Skip to content

Commit 5b4abf8

Browse files
authored
Version Packages (next) (#1014)
2 parents 2d90b9e + 81e123d commit 5b4abf8

7 files changed

Lines changed: 44 additions & 5 deletions

File tree

.changeset/pre.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
"@solid-primitives/async": "0.0.100",
103103
"@solid-primitives/url": "0.1.0",
104104
"@solid-primitives/favicon": "0.0.100",
105-
"@solid-primitives/sortable": "0.0.100"
105+
"@solid-primitives/sortable": "0.0.100",
106+
"@solid-primitives/drag-drop": "0.0.100"
106107
},
107108
"changesets": [
108109
"a11y-dataset-hydration-safety",
@@ -127,6 +128,7 @@
127128
"deep-solid2-migration",
128129
"destructure-solid2-migration",
129130
"devices-solid2-migration",
131+
"drag-new-package",
130132
"eleven-baths-build",
131133
"eleven-buttons-jump",
132134
"event-bus-solid2-migration",

packages/drag-drop/CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# @solid-primitives/drag-drop
2+
3+
## 0.1.0-next.0
4+
5+
### Minor Changes
6+
7+
- 75d2a1f: New package: `@solid-primitives/drag-drop` — composable drag-and-drop primitives for Solid 2.0.
8+
9+
### Exports
10+
11+
**Pointer-event DnD** (UI element dragging):
12+
- `makeDraggable` — non-reactive base, no Solid owner required
13+
- `makeDroppable` — non-reactive drop target base
14+
- `createDraggable` — reactive draggable with `isDragging`, `transform`, auto style/class; keyboard-accessible (`Space`/`Enter` to pick up/drop, arrow keys to nudge, `Escape` to cancel)
15+
- `createDroppable` — reactive drop target with `isOver`, `active`, auto style/class
16+
- `createSortable` — combines draggable + droppable on the same element
17+
- `createDragContext` — coordinates a tree of draggables and droppables, with optional `autoScroll` near viewport edges
18+
- `arrayMove` — pure reorder helper for `onDragEnd` + `createSortable`
19+
20+
**Native HTML5 DnD** (file drops, `draggable="true"` elements):
21+
- `makeNativeDroppable` — non-reactive base with depth-counter fix for child elements
22+
- `createNativeDroppable` — reactive native drop zone for OS file drops
23+
24+
**Collision detection strategies** (pure functions, pass to `createDragContext`):
25+
- `closestCenter`, `closestCorners`, `rectIntersection`, `pointerWithin` (default)
26+
27+
### Notes
28+
- The reported `transform` is corrected for page scroll during a drag, so the dragged element doesn't visually drift from the pointer if the page scrolls mid-drag (needed for `autoScroll` to look right, and for any scrollable page in general).
29+
- `createDroppable`/`createSortable` log a dev-mode warning when used without a `createDragContext` ancestor, since `isOver`/`active` silently stay `false`/`null` in that case.
30+
- `isDragging`/`isOver` are backed by `createProjection` instead of a per-instance `active()?.id === id` memo, so a drag start/end or hover change in a large list only notifies the specific items involved.

packages/drag-drop/deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solid-primitives/drag-drop",
3-
"version": "0.0.100",
3+
"version": "0.1.0-next.0",
44
"description": "Composable drag-and-drop primitives.",
55
"license": "MIT",
66
"exports": "./src/index.ts",

packages/drag-drop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solid-primitives/drag-drop",
3-
"version": "0.0.100",
3+
"version": "0.1.0-next.0",
44
"description": "Composable drag-and-drop primitives.",
55
"author": "David Di Biase <dave@solidjs.com>",
66
"contributors": [],

packages/upload/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @solid-primitives/upload
22

3+
## 1.0.0-next.4
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [75d2a1f]
8+
- @solid-primitives/drag-drop@0.1.0-next.0
9+
310
## 1.0.0-next.3
411

512
### Patch Changes

packages/upload/deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solid-primitives/upload",
3-
"version": "1.0.0-next.3",
3+
"version": "1.0.0-next.4",
44
"description": "Primitives for uploading files.",
55
"license": "MIT",
66
"exports": "./src/index.ts",

packages/upload/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solid-primitives/upload",
3-
"version": "1.0.0-next.3",
3+
"version": "1.0.0-next.4",
44
"description": "Primitives for uploading files.",
55
"author": "Rustam Ashurmatov <rr.ashurmatov.21@gmail.com>",
66
"license": "MIT",

0 commit comments

Comments
 (0)