@startupjs-ui/draggable 0.1.11 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.1.16](https://github.com/startupjs/startupjs-ui/compare/v0.1.15...v0.1.16) (2026-02-10)
7
+
8
+ **Note:** Version bump only for package @startupjs-ui/draggable
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.1.11](https://github.com/startupjs/startupjs-ui/compare/v0.1.10...v0.1.11) (2026-01-20)
7
15
 
8
16
  **Note:** Version bump only for package @startupjs-ui/draggable
package/README.mdx CHANGED
@@ -21,11 +21,11 @@ import './index.mdx.cssx.styl'
21
21
 
22
22
  # Draggable
23
23
 
24
- `Draggable` provides simple building blocks for drag & drop on React Native / RN Web:
24
+ `Draggable` provides simple building blocks for drag and drop on React Native and React Native Web:
25
25
 
26
- - `DragDropProvider` stores drag/drop state and exposes it via context
27
- - `Droppable` marks a drop target and tracks the order of its children
28
- - `Draggable` handles gestures and renders the dragged item into a `Portal`
26
+ - **DragDropProvider** -- stores drag/drop state and exposes it via context
27
+ - **Droppable** -- marks a drop target and tracks the order of its children
28
+ - **Draggable** -- handles gestures and renders the dragged item into a Portal
29
29
 
30
30
  ```jsx
31
31
  import { DragDropProvider, Droppable, Draggable } from 'startupjs-ui'
@@ -34,9 +34,37 @@ import { DragDropProvider, Droppable, Draggable } from 'startupjs-ui'
34
34
  ## How it works
35
35
 
36
36
  1. Wrap the area with `DragDropProvider`.
37
- 2. Inside it render one or more `Droppable`s with unique `dropId`.
38
- 3. Render `Draggable`s inside each `Droppable`, each with a unique `dragId`.
39
- 4. Update your own data in `onDragEnd` using `{ dragId, dropId, dropHoverId, hoverIndex }`.
37
+ 2. Inside it, render one or more `Droppable` containers, each with a unique `dropId`.
38
+ 3. Render `Draggable` items inside each `Droppable`, each with a unique `dragId`.
39
+ 4. Update your data in the `onDragEnd` callback using `{ dragId, dropId, dropHoverId, hoverIndex }`.
40
+
41
+ ## Props
42
+
43
+ ### DragDropProvider
44
+
45
+ - **children** -- the content to render inside the provider
46
+
47
+ ### Droppable
48
+
49
+ - **dropId** (required) -- a unique identifier for this drop target
50
+ - **type** -- an optional type string for filtering which draggables can be dropped here
51
+ - **style** -- custom styles for the droppable container
52
+ - **onHover** -- called when an active drag enters this droppable area
53
+ - **onLeave** -- called when an active drag leaves this droppable area
54
+
55
+ ### Draggable
56
+
57
+ - **dragId** (required) -- a unique identifier for this draggable item
58
+ - **type** -- an optional type string for filtering compatible drop targets
59
+ - **style** -- custom styles for the draggable item
60
+ - **onDragBegin** -- called when the drag gesture starts; receives `{ dragId, dropId, dropHoverId, hoverIndex }`
61
+ - **onDragEnd** -- called when the drag gesture ends; receives `{ dragId, dropId, dropHoverId, hoverIndex }`
62
+
63
+ The callback options contain:
64
+ - `dragId` -- the id of the dragged item
65
+ - `dropId` -- the id of the droppable the item originated from
66
+ - `dropHoverId` -- the id of the droppable the item is currently hovering over
67
+ - `hoverIndex` -- the index position within the hovered droppable
40
68
 
41
69
  ## Simple example (reorder in a single list)
42
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/draggable",
3
- "version": "0.1.11",
3
+ "version": "0.1.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -9,7 +9,7 @@
9
9
  "type": "module",
10
10
  "dependencies": {
11
11
  "@startupjs-ui/core": "^0.1.11",
12
- "@startupjs-ui/portal": "^0.1.11"
12
+ "@startupjs-ui/portal": "^0.1.16"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "react": "*",
@@ -17,5 +17,5 @@
17
17
  "react-native-gesture-handler": "*",
18
18
  "startupjs": "*"
19
19
  },
20
- "gitHead": "b21659a9d8408cd921560196db22a18fd8eda82d"
20
+ "gitHead": "9943aa3566d5d80f5b404473906eb3c0611f9ee5"
21
21
  }