@mk-drag-and-drop/react 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/README.md +14 -0
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -453,6 +453,16 @@ Preview movement does not trigger full target remeasurement. The app still
453
453
  commits data on drop, using placement derived from the current preview DOM
454
454
  order. React rendering should then reflect the final data.
455
455
 
456
+ React uses the DOM package placement rules. Same-container sortable preview
457
+ keeps its movement-responsive first-placement behavior: forward movement places
458
+ after a newly active target, backward movement places before, and no
459
+ sortable-axis movement uses the target midpoint. When a sortable item first
460
+ enters a different DOM container, the initial side is based on the target
461
+ midpoint on the sortable axis: above or left of midpoint places before, while
462
+ below or right of midpoint places after. `placementBoundary` remains a
463
+ same-target reversal and hysteresis control after preview placement exists; it
464
+ does not decide the initial side for cross-container sortable entry.
465
+
456
466
  Examples may rerender a full list for simplicity, but granular state management,
457
467
  external stores, server commits, and imperative rendering strategies are
458
468
  compatible. The package does not require React state.
@@ -552,6 +562,10 @@ DOM registry may narrow measured candidates to relevant sortable item, neighbor,
552
562
  or container entries before the targeting algorithm runs; the algorithm still
553
563
  chooses from that narrowed measured list.
554
564
 
565
+ The before/after side follows the DOM package sortable placement behavior
566
+ described above, including midpoint initial placement for cross-container entry
567
+ and `placementBoundary` for later same-target reversal behavior.
568
+
555
569
  - `lockToXAxis()`
556
570
  - `lockToYAxis()`
557
571
  - `restrictToContainer(refOrResolver)`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mk-drag-and-drop/react",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "React hooks and provider for the mk drag-and-drop DOM runtime.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://mkramer.dev",
@@ -39,7 +39,7 @@
39
39
  ],
40
40
  "sideEffects": false,
41
41
  "dependencies": {
42
- "@mk-drag-and-drop/dom": "^0.4.0"
42
+ "@mk-drag-and-drop/dom": "^0.4.1"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": "^19.0.0"
@@ -57,8 +57,8 @@
57
57
  "react-dom": "^19.2.7",
58
58
  "vitest": "^2.1.9",
59
59
  "typescript": "5.5.4",
60
- "@repo/eslint-config": "0.0.0",
61
- "@repo/typescript-config": "0.0.0"
60
+ "@repo/typescript-config": "0.0.0",
61
+ "@repo/eslint-config": "0.0.0"
62
62
  },
63
63
  "scripts": {
64
64
  "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",