Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular neodrag #182

Draft
wants to merge 59 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
4c5b86b
Push
PuruVJ Dec 9, 2024
bed083d
Push the modular API
PuruVJ Dec 12, 2024
3bda5b5
feat: implement axis and applyUserSelectHack plugins for enhanced dra…
PuruVJ Dec 12, 2024
bed52e7
fire drag end event
PuruVJ Dec 12, 2024
8a87230
Bounds work huzzah
PuruVJ Dec 13, 2024
908d3e0
Simplify bounds
PuruVJ Dec 13, 2024
b918854
State is the 3rd argument now
PuruVJ Dec 13, 2024
3db4df9
threshold plugin, less memory creation
PuruVJ Dec 16, 2024
fc724d0
Events plugin
PuruVJ Dec 16, 2024
851869e
Rearchitecht
PuruVJ Dec 16, 2024
baf180e
effectify events plugin
PuruVJ Dec 16, 2024
aa0e497
Fix threshold plugin
PuruVJ Dec 16, 2024
dd66a7a
Slight imprvements
PuruVJ Dec 16, 2024
24a0299
Basic controls plugin
PuruVJ Dec 17, 2024
bb96b18
Basic controlled position working now
PuruVJ Dec 17, 2024
8b6e9f8
Refactor draggable context and plugin handling for improved clarity a…
PuruVJ Dec 17, 2024
2fd83fc
pointer capture
PuruVJ Dec 17, 2024
530fef1
Change core structure slightly
PuruVJ Dec 17, 2024
6c23075
One event to rule them all
PuruVJ Dec 17, 2024
359db62
Remove axis: none
PuruVJ Dec 17, 2024
656b585
Implement update cycle
PuruVJ Dec 17, 2024
d470c1e
Tweak ControlFrom
PuruVJ Dec 17, 2024
5caa71d
Replace classes with stateMarker
PuruVJ Dec 17, 2024
b3c0f35
meh
PuruVJ Dec 17, 2024
377b48d
touchAction plugin
PuruVJ Dec 17, 2024
011df16
axis only takes x and y. both is provided by the core
PuruVJ Dec 17, 2024
a981783
Scroll lock plugin
PuruVJ Dec 20, 2024
ff354ed
Clear up for testing
PuruVJ Dec 21, 2024
2f20c67
Get SVGs working
PuruVJ Dec 21, 2024
7728b04
fix: exclude SVgSVGElement
PuruVJ Dec 21, 2024
9ce6d48
Expose draggable and instances
PuruVJ Dec 21, 2024
5613c08
Multi-drag, some
PuruVJ Dec 21, 2024
191e098
Basic turbopack shit
PuruVJ Dec 21, 2024
21746b5
Allow dragStart to run even if cancelled, give a chance to the cancel…
PuruVJ Dec 21, 2024
677cd41
Useless react wrapper
PuruVJ Dec 21, 2024
1395121
Use a state_sync plugin
PuruVJ Dec 22, 2024
f970d6e
Remove th console logs
PuruVJ Dec 22, 2024
b815693
Push
PuruVJ Dec 22, 2024
1350ca4
Provide react wrapper
PuruVJ Dec 22, 2024
27610bd
Attempting to memoize to death
PuruVJ Dec 22, 2024
c3aba12
FIne-grained plugin system
PuruVJ Dec 22, 2024
f8dc12c
Remove camelToKebab
PuruVJ Dec 22, 2024
3dfae8d
RAF effects
PuruVJ Dec 22, 2024
fef564a
Remove custom event support
PuruVJ Dec 22, 2024
2fbf506
pointercancel
PuruVJ Dec 22, 2024
c5a48f8
Propose takes variadic arguments now
PuruVJ Dec 27, 2024
da42af9
eh
PuruVJ Dec 27, 2024
4d5bb1c
Fix up tests
PuruVJ Dec 27, 2024
78a8485
Shared schema
PuruVJ Dec 28, 2024
b36030c
Rewrite tests, bounds test
PuruVJ Dec 28, 2024
722eb10
ignoreMultitouch
PuruVJ Dec 29, 2024
b6c3854
stateMarker test
PuruVJ Dec 29, 2024
599157b
Fix test
PuruVJ Dec 29, 2024
809c60b
applyUserSelectHack tests and Safari fix
PuruVJ Dec 29, 2024
19bacd6
clear up tests, tweak grid, grid tests
PuruVJ Dec 29, 2024
bd338e5
Move transform error to core
PuruVJ Dec 29, 2024
dea73a8
transform tests
PuruVJ Dec 29, 2024
b35c191
threshold test suiye, modifications
PuruVJ Dec 29, 2024
b0c9652
Overhaul controls behavior, controls test
PuruVJ Dec 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/rotten-bags-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@neodrag/core': patch
'@neodrag/react': patch
'@neodrag/solid': patch
'@neodrag/svelte': patch
'@neodrag/vanilla': patch
'@neodrag/vue': patch
---

fix: apply neodrag class on action init, not pointerdown
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist/
.DS_Store
.env
.pnpm-store/
.turbo
7 changes: 4 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"singleQuote": true,
"printWidth": 100,
"useTabs": true
"singleQuote": true,
"printWidth": 100,
"useTabs": true,
"trailingComma": "all"
}
42 changes: 21 additions & 21 deletions docs/src/data/sizes.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"react": {
"size": 2.18,
"version": "2.2.0"
},
"solid": {
"size": 1.98,
"version": "2.2.0"
},
"svelte": {
"size": 1.94,
"version": "2.2.0"
},
"vanilla": {
"size": 2,
"version": "2.2.0"
},
"vue": {
"size": 1.98,
"version": "2.2.0"
}
}
"svelte": {
"size": 3.64,
"version": "2.2.0"
},
"react": {
"size": 2.28,
"version": "2.2.0"
},
"solid": {
"size": 2.07,
"version": "2.2.0"
},
"vue": {
"size": 1.98,
"version": "2.2.0"
},
"vanilla": {
"size": 2.1,
"version": "2.2.0"
}
}
5 changes: 5 additions & 0 deletions docs/src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ export function elements_overlap(el1: HTMLElement, el2: HTMLElement) {
export function wait_for(ms: number) {
return new Promise((r) => setTimeout(r, ms));
}

// Add scroll helpers
export function isWindow(container: HTMLElement | Window): container is Window {
return container === window;
}
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"type": "module",
"scripts": {
"changeset": "changeset",
"compile": "pnpm -r compile",
"docs:build": "pnpm compile && pnpm sizes && cd docs && pnpm build",
"compile": "turbo run compile",
"docs:build": "turbo run docs#build",
"ci:version": "changeset version",
"ci:release": "changeset publish",
"sizes": "tsx scripts/gather-sizes.ts"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@sveltejs/vite-plugin-svelte": "3.1.0",
"@sveltejs/vite-plugin-svelte": "5.0.2",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/svelte": "^4.0.5",
"@types/react": "^18.2.79",
Expand All @@ -29,9 +29,16 @@
"terser": "^5.26.0",
"tsup": "^8.0.1",
"tsx": "^4.6.2",
"turbo": "^2.3.3",
"typescript": "^5.4.5",
"vite": "^5.2.9",
"vitest": "^1.5.0",
"vue": "^3.4.23"
}
},
"pnpm": {
"overrides": {
"vite": "^6.0"
}
},
"packageManager": "pnpm@9.14.0"
}
15 changes: 12 additions & 3 deletions packages/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
import { Format } from 'tsup';
import { defineConfig } from 'tsup';

export const core_config = ({ dtsBanner = '', includeUMD = false, globalName = 'neodrag' } = {}) =>
export const core_config = ({
modularAsIndex = false,
dtsBanner = '',
includeUMD = false,
globalName = 'neodrag',
} = {}) =>
defineConfig([
{
entry: ['./src/index.ts'],
entry: {
index: `./src/${modularAsIndex ? 'modular' : 'index'}.ts`,
},
format: 'esm',
external: ['vue', 'react', 'solid-js', 'svelte'],
dts: { resolve: true, banner: dtsBanner },
clean: true,
treeshake: 'smallest',
},
{
entry: ['./src/index.ts'],
entry: {
index: `./src/${modularAsIndex ? 'modular' : 'index'}.ts`,
},
minify: 'terser',
external: ['vue', 'react', 'solid-js', 'svelte'],
format: 'esm',
Expand Down
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": {
"production": "./dist/index.js",
"development": "./dist/index.js"
},
"default": "./dist/index.js"
"import": "./dist/index.js"
},
"./plugins": {
"types": "./dist/plugins.d.ts",
"import": "./dist/plugins.js"
},
"./package.json": "./package.json"
},
Expand Down
Loading