react-native-layout-dnd 0.1.0-alpha.0
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/LICENSE +20 -0
- package/README.md +262 -0
- package/lib/module/adapters/coordinates.js +135 -0
- package/lib/module/adapters/coordinates.js.map +1 -0
- package/lib/module/adapters/scroll.js +81 -0
- package/lib/module/adapters/scroll.js.map +1 -0
- package/lib/module/adapters/virtualizedList.js +69 -0
- package/lib/module/adapters/virtualizedList.js.map +1 -0
- package/lib/module/components/DndProvider.js +1144 -0
- package/lib/module/components/DndProvider.js.map +1 -0
- package/lib/module/components/DragHandle.js +65 -0
- package/lib/module/components/DragHandle.js.map +1 -0
- package/lib/module/components/GridController.js +151 -0
- package/lib/module/components/GridController.js.map +1 -0
- package/lib/module/components/GridDragHandle.js +15 -0
- package/lib/module/components/GridDragHandle.js.map +1 -0
- package/lib/module/components/GridZoneView.js +59 -0
- package/lib/module/components/GridZoneView.js.map +1 -0
- package/lib/module/components/SortableGrid.js +305 -0
- package/lib/module/components/SortableGrid.js.map +1 -0
- package/lib/module/components/SortableList.js +714 -0
- package/lib/module/components/SortableList.js.map +1 -0
- package/lib/module/components/dndTypes.js +4 -0
- package/lib/module/components/dndTypes.js.map +1 -0
- package/lib/module/components/gridTypes.js +4 -0
- package/lib/module/components/gridTypes.js.map +1 -0
- package/lib/module/components/handleViewProps.js +13 -0
- package/lib/module/components/handleViewProps.js.map +1 -0
- package/lib/module/contracts.js +4 -0
- package/lib/module/contracts.js.map +1 -0
- package/lib/module/controller/approval.js +98 -0
- package/lib/module/controller/approval.js.map +1 -0
- package/lib/module/controller/coordinatorBase.js +93 -0
- package/lib/module/controller/coordinatorBase.js.map +1 -0
- package/lib/module/controller/dndSession.js +621 -0
- package/lib/module/controller/dndSession.js.map +1 -0
- package/lib/module/controller/dndState.js +103 -0
- package/lib/module/controller/dndState.js.map +1 -0
- package/lib/module/controller/gridAdapter.js +191 -0
- package/lib/module/controller/gridAdapter.js.map +1 -0
- package/lib/module/controller/gridState.js +101 -0
- package/lib/module/controller/gridState.js.map +1 -0
- package/lib/module/controller/locations.js +48 -0
- package/lib/module/controller/locations.js.map +1 -0
- package/lib/module/controller/previewPath.js +73 -0
- package/lib/module/controller/previewPath.js.map +1 -0
- package/lib/module/controller/sessionCore.js +222 -0
- package/lib/module/controller/sessionCore.js.map +1 -0
- package/lib/module/controller/useDndState.js +9 -0
- package/lib/module/controller/useDndState.js.map +1 -0
- package/lib/module/controller/useGridState.js +9 -0
- package/lib/module/controller/useGridState.js.map +1 -0
- package/lib/module/controller/useStoreState.js +15 -0
- package/lib/module/controller/useStoreState.js.map +1 -0
- package/lib/module/defaults.js +7 -0
- package/lib/module/defaults.js.map +1 -0
- package/lib/module/diagnostics.js +16 -0
- package/lib/module/diagnostics.js.map +1 -0
- package/lib/module/engine/gridPlacements.js +54 -0
- package/lib/module/engine/gridPlacements.js.map +1 -0
- package/lib/module/engine/index.js +19 -0
- package/lib/module/engine/index.js.map +1 -0
- package/lib/module/engine/layout.js +36 -0
- package/lib/module/engine/layout.js.map +1 -0
- package/lib/module/engine/layoutMove.js +326 -0
- package/lib/module/engine/layoutMove.js.map +1 -0
- package/lib/module/engine/layoutState.js +344 -0
- package/lib/module/engine/layoutState.js.map +1 -0
- package/lib/module/engine/list.js +172 -0
- package/lib/module/engine/list.js.map +1 -0
- package/lib/module/engine/listIndex.js +125 -0
- package/lib/module/engine/listIndex.js.map +1 -0
- package/lib/module/engine/move.js +216 -0
- package/lib/module/engine/move.js.map +1 -0
- package/lib/module/engine/movementPolicy.js +77 -0
- package/lib/module/engine/movementPolicy.js.map +1 -0
- package/lib/module/engine/orderedTarget.js +71 -0
- package/lib/module/engine/orderedTarget.js.map +1 -0
- package/lib/module/engine/pack.js +30 -0
- package/lib/module/engine/pack.js.map +1 -0
- package/lib/module/engine/rectangles.js +12 -0
- package/lib/module/engine/rectangles.js.map +1 -0
- package/lib/module/engine/sameLayout.js +29 -0
- package/lib/module/engine/sameLayout.js.map +1 -0
- package/lib/module/engine/search.js +159 -0
- package/lib/module/engine/search.js.map +1 -0
- package/lib/module/engine/spatial.js +27 -0
- package/lib/module/engine/spatial.js.map +1 -0
- package/lib/module/engine/spatialAppRotation.js +39 -0
- package/lib/module/engine/spatialAppRotation.js.map +1 -0
- package/lib/module/engine/spatialExchange.js +164 -0
- package/lib/module/engine/spatialExchange.js.map +1 -0
- package/lib/module/engine/spatialInsertion.js +135 -0
- package/lib/module/engine/spatialInsertion.js.map +1 -0
- package/lib/module/engine/spatialPolicy.js +41 -0
- package/lib/module/engine/spatialPolicy.js.map +1 -0
- package/lib/module/engine/spatialRotation.js +48 -0
- package/lib/module/engine/spatialRotation.js.map +1 -0
- package/lib/module/engine/validation.js +205 -0
- package/lib/module/engine/validation.js.map +1 -0
- package/lib/module/gesture/DndGestureGroup.js +268 -0
- package/lib/module/gesture/DndGestureGroup.js.map +1 -0
- package/lib/module/gesture/DndGestureHost.js +32 -0
- package/lib/module/gesture/DndGestureHost.js.map +1 -0
- package/lib/module/gesture/gestureConfig.js +81 -0
- package/lib/module/gesture/gestureConfig.js.map +1 -0
- package/lib/module/gesture/gestureGrouping.js +122 -0
- package/lib/module/gesture/gestureGrouping.js.map +1 -0
- package/lib/module/gesture/gestureHost.js +106 -0
- package/lib/module/gesture/gestureHost.js.map +1 -0
- package/lib/module/index.js +23 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/pointer/dndTarget.js +101 -0
- package/lib/module/pointer/dndTarget.js.map +1 -0
- package/lib/module/pointer/geometry.js +363 -0
- package/lib/module/pointer/geometry.js.map +1 -0
- package/lib/module/pointer/layoutTarget.js +307 -0
- package/lib/module/pointer/layoutTarget.js.map +1 -0
- package/lib/module/pointer/listCellMotion.js +99 -0
- package/lib/module/pointer/listCellMotion.js.map +1 -0
- package/lib/module/pointer/listTarget.js +42 -0
- package/lib/module/pointer/listTarget.js.map +1 -0
- package/lib/module/pointer/motion.js +37 -0
- package/lib/module/pointer/motion.js.map +1 -0
- package/lib/module/runtime/dndPresentation.js +81 -0
- package/lib/module/runtime/dndPresentation.js.map +1 -0
- package/lib/module/runtime/dndRenderStore.js +129 -0
- package/lib/module/runtime/dndRenderStore.js.map +1 -0
- package/lib/module/runtime/dndRuntime.js +135 -0
- package/lib/module/runtime/dndRuntime.js.map +1 -0
- package/lib/module/runtime/dndSettlement.js +77 -0
- package/lib/module/runtime/dndSettlement.js.map +1 -0
- package/lib/module/runtime/gridRuntime.js +37 -0
- package/lib/module/runtime/gridRuntime.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/adapters/coordinates.d.ts +9 -0
- package/lib/typescript/src/adapters/coordinates.d.ts.map +1 -0
- package/lib/typescript/src/adapters/scroll.d.ts +49 -0
- package/lib/typescript/src/adapters/scroll.d.ts.map +1 -0
- package/lib/typescript/src/adapters/virtualizedList.d.ts +22 -0
- package/lib/typescript/src/adapters/virtualizedList.d.ts.map +1 -0
- package/lib/typescript/src/components/DndProvider.d.ts +4 -0
- package/lib/typescript/src/components/DndProvider.d.ts.map +1 -0
- package/lib/typescript/src/components/DragHandle.d.ts +4 -0
- package/lib/typescript/src/components/DragHandle.d.ts.map +1 -0
- package/lib/typescript/src/components/GridController.d.ts +21 -0
- package/lib/typescript/src/components/GridController.d.ts.map +1 -0
- package/lib/typescript/src/components/GridDragHandle.d.ts +8 -0
- package/lib/typescript/src/components/GridDragHandle.d.ts.map +1 -0
- package/lib/typescript/src/components/GridZoneView.d.ts +8 -0
- package/lib/typescript/src/components/GridZoneView.d.ts.map +1 -0
- package/lib/typescript/src/components/SortableGrid.d.ts +4 -0
- package/lib/typescript/src/components/SortableGrid.d.ts.map +1 -0
- package/lib/typescript/src/components/SortableList.d.ts +4 -0
- package/lib/typescript/src/components/SortableList.d.ts.map +1 -0
- package/lib/typescript/src/components/dndTypes.d.ts +94 -0
- package/lib/typescript/src/components/dndTypes.d.ts.map +1 -0
- package/lib/typescript/src/components/gridTypes.d.ts +84 -0
- package/lib/typescript/src/components/gridTypes.d.ts.map +1 -0
- package/lib/typescript/src/components/handleViewProps.d.ts +6 -0
- package/lib/typescript/src/components/handleViewProps.d.ts.map +1 -0
- package/lib/typescript/src/contracts.d.ts +145 -0
- package/lib/typescript/src/contracts.d.ts.map +1 -0
- package/lib/typescript/src/controller/approval.d.ts +66 -0
- package/lib/typescript/src/controller/approval.d.ts.map +1 -0
- package/lib/typescript/src/controller/coordinatorBase.d.ts +37 -0
- package/lib/typescript/src/controller/coordinatorBase.d.ts.map +1 -0
- package/lib/typescript/src/controller/dndSession.d.ts +152 -0
- package/lib/typescript/src/controller/dndSession.d.ts.map +1 -0
- package/lib/typescript/src/controller/dndState.d.ts +27 -0
- package/lib/typescript/src/controller/dndState.d.ts.map +1 -0
- package/lib/typescript/src/controller/gridAdapter.d.ts +44 -0
- package/lib/typescript/src/controller/gridAdapter.d.ts.map +1 -0
- package/lib/typescript/src/controller/gridState.d.ts +18 -0
- package/lib/typescript/src/controller/gridState.d.ts.map +1 -0
- package/lib/typescript/src/controller/locations.d.ts +9 -0
- package/lib/typescript/src/controller/locations.d.ts.map +1 -0
- package/lib/typescript/src/controller/previewPath.d.ts +49 -0
- package/lib/typescript/src/controller/previewPath.d.ts.map +1 -0
- package/lib/typescript/src/controller/sessionCore.d.ts +106 -0
- package/lib/typescript/src/controller/sessionCore.d.ts.map +1 -0
- package/lib/typescript/src/controller/useDndState.d.ts +8 -0
- package/lib/typescript/src/controller/useDndState.d.ts.map +1 -0
- package/lib/typescript/src/controller/useGridState.d.ts +8 -0
- package/lib/typescript/src/controller/useGridState.d.ts.map +1 -0
- package/lib/typescript/src/controller/useStoreState.d.ts +16 -0
- package/lib/typescript/src/controller/useStoreState.d.ts.map +1 -0
- package/lib/typescript/src/defaults.d.ts +5 -0
- package/lib/typescript/src/defaults.d.ts.map +1 -0
- package/lib/typescript/src/diagnostics.d.ts +9 -0
- package/lib/typescript/src/diagnostics.d.ts.map +1 -0
- package/lib/typescript/src/engine/gridPlacements.d.ts +22 -0
- package/lib/typescript/src/engine/gridPlacements.d.ts.map +1 -0
- package/lib/typescript/src/engine/index.d.ts +28 -0
- package/lib/typescript/src/engine/index.d.ts.map +1 -0
- package/lib/typescript/src/engine/layout.d.ts +4 -0
- package/lib/typescript/src/engine/layout.d.ts.map +1 -0
- package/lib/typescript/src/engine/layoutMove.d.ts +46 -0
- package/lib/typescript/src/engine/layoutMove.d.ts.map +1 -0
- package/lib/typescript/src/engine/layoutState.d.ts +22 -0
- package/lib/typescript/src/engine/layoutState.d.ts.map +1 -0
- package/lib/typescript/src/engine/list.d.ts +68 -0
- package/lib/typescript/src/engine/list.d.ts.map +1 -0
- package/lib/typescript/src/engine/listIndex.d.ts +32 -0
- package/lib/typescript/src/engine/listIndex.d.ts.map +1 -0
- package/lib/typescript/src/engine/move.d.ts +10 -0
- package/lib/typescript/src/engine/move.d.ts.map +1 -0
- package/lib/typescript/src/engine/movementPolicy.d.ts +34 -0
- package/lib/typescript/src/engine/movementPolicy.d.ts.map +1 -0
- package/lib/typescript/src/engine/orderedTarget.d.ts +32 -0
- package/lib/typescript/src/engine/orderedTarget.d.ts.map +1 -0
- package/lib/typescript/src/engine/pack.d.ts +3 -0
- package/lib/typescript/src/engine/pack.d.ts.map +1 -0
- package/lib/typescript/src/engine/rectangles.d.ts +9 -0
- package/lib/typescript/src/engine/rectangles.d.ts.map +1 -0
- package/lib/typescript/src/engine/sameLayout.d.ts +4 -0
- package/lib/typescript/src/engine/sameLayout.d.ts.map +1 -0
- package/lib/typescript/src/engine/search.d.ts +28 -0
- package/lib/typescript/src/engine/search.d.ts.map +1 -0
- package/lib/typescript/src/engine/spatial.d.ts +16 -0
- package/lib/typescript/src/engine/spatial.d.ts.map +1 -0
- package/lib/typescript/src/engine/spatialAppRotation.d.ts +4 -0
- package/lib/typescript/src/engine/spatialAppRotation.d.ts.map +1 -0
- package/lib/typescript/src/engine/spatialExchange.d.ts +5 -0
- package/lib/typescript/src/engine/spatialExchange.d.ts.map +1 -0
- package/lib/typescript/src/engine/spatialInsertion.d.ts +5 -0
- package/lib/typescript/src/engine/spatialInsertion.d.ts.map +1 -0
- package/lib/typescript/src/engine/spatialPolicy.d.ts +9 -0
- package/lib/typescript/src/engine/spatialPolicy.d.ts.map +1 -0
- package/lib/typescript/src/engine/spatialRotation.d.ts +8 -0
- package/lib/typescript/src/engine/spatialRotation.d.ts.map +1 -0
- package/lib/typescript/src/engine/validation.d.ts +9 -0
- package/lib/typescript/src/engine/validation.d.ts.map +1 -0
- package/lib/typescript/src/gesture/DndGestureGroup.d.ts +33 -0
- package/lib/typescript/src/gesture/DndGestureGroup.d.ts.map +1 -0
- package/lib/typescript/src/gesture/DndGestureHost.d.ts +12 -0
- package/lib/typescript/src/gesture/DndGestureHost.d.ts.map +1 -0
- package/lib/typescript/src/gesture/gestureConfig.d.ts +15 -0
- package/lib/typescript/src/gesture/gestureConfig.d.ts.map +1 -0
- package/lib/typescript/src/gesture/gestureGrouping.d.ts +66 -0
- package/lib/typescript/src/gesture/gestureGrouping.d.ts.map +1 -0
- package/lib/typescript/src/gesture/gestureHost.d.ts +23 -0
- package/lib/typescript/src/gesture/gestureHost.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +38 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/pointer/dndTarget.d.ts +14 -0
- package/lib/typescript/src/pointer/dndTarget.d.ts.map +1 -0
- package/lib/typescript/src/pointer/geometry.d.ts +28 -0
- package/lib/typescript/src/pointer/geometry.d.ts.map +1 -0
- package/lib/typescript/src/pointer/layoutTarget.d.ts +43 -0
- package/lib/typescript/src/pointer/layoutTarget.d.ts.map +1 -0
- package/lib/typescript/src/pointer/listCellMotion.d.ts +43 -0
- package/lib/typescript/src/pointer/listCellMotion.d.ts.map +1 -0
- package/lib/typescript/src/pointer/listTarget.d.ts +7 -0
- package/lib/typescript/src/pointer/listTarget.d.ts.map +1 -0
- package/lib/typescript/src/pointer/motion.d.ts +20 -0
- package/lib/typescript/src/pointer/motion.d.ts.map +1 -0
- package/lib/typescript/src/runtime/dndPresentation.d.ts +37 -0
- package/lib/typescript/src/runtime/dndPresentation.d.ts.map +1 -0
- package/lib/typescript/src/runtime/dndRenderStore.d.ts +46 -0
- package/lib/typescript/src/runtime/dndRenderStore.d.ts.map +1 -0
- package/lib/typescript/src/runtime/dndRuntime.d.ts +138 -0
- package/lib/typescript/src/runtime/dndRuntime.d.ts.map +1 -0
- package/lib/typescript/src/runtime/dndSettlement.d.ts +18 -0
- package/lib/typescript/src/runtime/dndSettlement.d.ts.map +1 -0
- package/lib/typescript/src/runtime/gridRuntime.d.ts +54 -0
- package/lib/typescript/src/runtime/gridRuntime.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +180 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +136 -0
- package/src/adapters/coordinates.ts +181 -0
- package/src/adapters/scroll.ts +147 -0
- package/src/adapters/virtualizedList.ts +112 -0
- package/src/components/DndProvider.tsx +1836 -0
- package/src/components/DragHandle.tsx +89 -0
- package/src/components/GridController.tsx +213 -0
- package/src/components/GridDragHandle.tsx +11 -0
- package/src/components/GridZoneView.tsx +57 -0
- package/src/components/SortableGrid.tsx +449 -0
- package/src/components/SortableList.tsx +1028 -0
- package/src/components/dndTypes.ts +102 -0
- package/src/components/gridTypes.ts +90 -0
- package/src/components/handleViewProps.ts +35 -0
- package/src/contracts.ts +149 -0
- package/src/controller/approval.ts +179 -0
- package/src/controller/coordinatorBase.ts +118 -0
- package/src/controller/dndSession.ts +1058 -0
- package/src/controller/dndState.ts +198 -0
- package/src/controller/gridAdapter.ts +268 -0
- package/src/controller/gridState.ts +187 -0
- package/src/controller/locations.ts +67 -0
- package/src/controller/previewPath.ts +90 -0
- package/src/controller/sessionCore.ts +390 -0
- package/src/controller/useDndState.ts +26 -0
- package/src/controller/useGridState.ts +22 -0
- package/src/controller/useStoreState.ts +27 -0
- package/src/defaults.ts +4 -0
- package/src/diagnostics.ts +23 -0
- package/src/engine/gridPlacements.ts +85 -0
- package/src/engine/index.ts +99 -0
- package/src/engine/layout.ts +29 -0
- package/src/engine/layoutMove.ts +401 -0
- package/src/engine/layoutState.ts +490 -0
- package/src/engine/list.ts +307 -0
- package/src/engine/listIndex.ts +174 -0
- package/src/engine/move.ts +274 -0
- package/src/engine/movementPolicy.ts +151 -0
- package/src/engine/orderedTarget.ts +131 -0
- package/src/engine/pack.ts +24 -0
- package/src/engine/rectangles.ts +18 -0
- package/src/engine/sameLayout.ts +50 -0
- package/src/engine/search.ts +174 -0
- package/src/engine/spatial.ts +36 -0
- package/src/engine/spatialAppRotation.ts +53 -0
- package/src/engine/spatialExchange.ts +212 -0
- package/src/engine/spatialInsertion.ts +157 -0
- package/src/engine/spatialPolicy.ts +48 -0
- package/src/engine/spatialRotation.ts +56 -0
- package/src/engine/validation.ts +358 -0
- package/src/gesture/DndGestureGroup.tsx +357 -0
- package/src/gesture/DndGestureHost.tsx +50 -0
- package/src/gesture/gestureConfig.ts +123 -0
- package/src/gesture/gestureGrouping.ts +210 -0
- package/src/gesture/gestureHost.tsx +163 -0
- package/src/index.ts +162 -0
- package/src/pointer/dndTarget.ts +213 -0
- package/src/pointer/geometry.ts +584 -0
- package/src/pointer/layoutTarget.ts +515 -0
- package/src/pointer/listCellMotion.ts +174 -0
- package/src/pointer/listTarget.ts +56 -0
- package/src/pointer/motion.ts +66 -0
- package/src/runtime/dndPresentation.ts +113 -0
- package/src/runtime/dndRenderStore.ts +246 -0
- package/src/runtime/dndRuntime.ts +311 -0
- package/src/runtime/dndSettlement.ts +117 -0
- package/src/runtime/gridRuntime.ts +73 -0
- package/src/types.ts +189 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Answers once per drag session whether a zone keeps its native slots in
|
|
5
|
+
* committed order while `activeItemId` is dragged. Adapters whose mounted set
|
|
6
|
+
* depends on slot order (windowed lists) answer from their render window.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Native cells keep their slots during a preview. Shared geometry moves them. */
|
|
10
|
+
function retainNativeSlots(previous, next) {
|
|
11
|
+
if (!previous || !next || previous.kind !== next.kind) return next;
|
|
12
|
+
if (previous === next) return previous;
|
|
13
|
+
if (previous.kind === 'list' && next.kind === 'list') {
|
|
14
|
+
if (previous.orientation !== next.orientation || previous.itemIds.length !== next.itemIds.length) return next;
|
|
15
|
+
const ids = new Set(previous.itemIds);
|
|
16
|
+
return next.itemIds.every(id => ids.has(id)) ? previous : next;
|
|
17
|
+
}
|
|
18
|
+
if (previous.kind === 'grid' && next.kind === 'grid') {
|
|
19
|
+
if (previous.rows !== next.rows || previous.columns !== next.columns || previous.placements.length !== next.placements.length) return next;
|
|
20
|
+
const placements = new Map(previous.placements.map(placement => [placement.itemId, placement]));
|
|
21
|
+
return next.placements.every(placement => {
|
|
22
|
+
const old = placements.get(placement.itemId);
|
|
23
|
+
return old && old.span.rows === placement.span.rows && old.span.cols === placement.span.cols && old.placement === placement.placement;
|
|
24
|
+
}) ? previous : next;
|
|
25
|
+
}
|
|
26
|
+
return next;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Separate React subscriptions from frame-by-frame approved presentation. */
|
|
30
|
+
export class DndRenderStore {
|
|
31
|
+
zones = new Map();
|
|
32
|
+
itemIndices = new WeakMap();
|
|
33
|
+
items = new Map();
|
|
34
|
+
retainDecisions = new Map();
|
|
35
|
+
constructor(source) {
|
|
36
|
+
this.source = source;
|
|
37
|
+
}
|
|
38
|
+
getSnapshot = () => this.source.getSnapshot();
|
|
39
|
+
getProviderSnapshot = () => {
|
|
40
|
+
const next = this.source.getSnapshot();
|
|
41
|
+
const previous = this.provider;
|
|
42
|
+
if (previous && previous.value === next.value && previous.phase === next.phase && previous.sessionId === next.sessionId && previous.itemId === next.itemId && previous.sourceZoneId === next.sourceZoneId && previous.targetZoneId === next.targetZoneId && previous.validity === next.validity && previous.disabled === next.disabled) return previous;
|
|
43
|
+
return this.provider = next;
|
|
44
|
+
};
|
|
45
|
+
getZoneSnapshot = (zoneId, preserveSlots = true) => {
|
|
46
|
+
const current = this.source.getSnapshot();
|
|
47
|
+
const zone = current.value?.zones.find(entry => entry.id === zoneId);
|
|
48
|
+
const items = current.value?.items;
|
|
49
|
+
const revision = current.value?.revision ?? 0;
|
|
50
|
+
const key = `${preserveSlots === false ? 'ordered' : 'stable'}:${zoneId}`;
|
|
51
|
+
const previous = this.zones.get(key);
|
|
52
|
+
const candidate = current.displayValue?.zones.find(entry => entry.id === zoneId);
|
|
53
|
+
const display = current.phase !== 'idle' && this.retainSlots(key, current, preserveSlots) ? retainNativeSlots(previous && previous.zone === zone && previous.items === items && previous.revision === revision ? previous.display : zone, candidate) : candidate;
|
|
54
|
+
// The revision of the value the display comes from: candidate geometry is
|
|
55
|
+
// prepared under the candidate's revision, exactly as the provider asks
|
|
56
|
+
// the adapter to prepare it for the UI runtime.
|
|
57
|
+
const displayRevision = display === zone ? revision : display === candidate ? current.displayValue?.revision ?? revision : previous?.displayRevision ?? revision;
|
|
58
|
+
const next = {
|
|
59
|
+
zone,
|
|
60
|
+
display,
|
|
61
|
+
items,
|
|
62
|
+
revision,
|
|
63
|
+
displayRevision,
|
|
64
|
+
activeItemId: current.itemId,
|
|
65
|
+
scrollEnabled: current.phase === 'idle'
|
|
66
|
+
};
|
|
67
|
+
if (previous && Object.keys(next).every(field => previous[field] === next[field])) return previous;
|
|
68
|
+
this.zones.set(key, next);
|
|
69
|
+
return next;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** A rule is consulted once per drag session so its answer cannot flip mid-drag. */
|
|
73
|
+
retainSlots(key, current, preserveSlots) {
|
|
74
|
+
if (typeof preserveSlots !== 'function') return preserveSlots;
|
|
75
|
+
if (current.itemId === null) return true;
|
|
76
|
+
const decision = this.retainDecisions.get(key);
|
|
77
|
+
if (decision && decision.sessionId === current.sessionId && decision.itemId === current.itemId) return decision.retain;
|
|
78
|
+
const retain = preserveSlots(current.itemId);
|
|
79
|
+
this.retainDecisions.set(key, {
|
|
80
|
+
sessionId: current.sessionId,
|
|
81
|
+
itemId: current.itemId,
|
|
82
|
+
retain
|
|
83
|
+
});
|
|
84
|
+
return retain;
|
|
85
|
+
}
|
|
86
|
+
getItemSnapshot = (zoneId, itemId) => {
|
|
87
|
+
const zone = this.source.getSnapshot().displayValue?.zones.find(entry => entry.id === zoneId);
|
|
88
|
+
let indices = zone && this.itemIndices.get(zone);
|
|
89
|
+
if (zone && !indices) {
|
|
90
|
+
const prepared = new Map();
|
|
91
|
+
if (zone.kind === 'list') zone.itemIds.forEach((id, index) => prepared.set(id, {
|
|
92
|
+
index
|
|
93
|
+
}));else zone.placements.forEach((entry, index) => prepared.set(entry.itemId, {
|
|
94
|
+
index,
|
|
95
|
+
row: entry.position.row,
|
|
96
|
+
col: entry.position.col
|
|
97
|
+
}));
|
|
98
|
+
// Many mounted cells read the same approved display in one notification.
|
|
99
|
+
// Build its ID index once instead of scanning the zone for every cell.
|
|
100
|
+
this.itemIndices.set(zone, prepared);
|
|
101
|
+
indices = prepared;
|
|
102
|
+
}
|
|
103
|
+
const next = indices?.get(itemId);
|
|
104
|
+
let selected = this.items.get(zoneId);
|
|
105
|
+
if (!next) {
|
|
106
|
+
selected?.delete(itemId);
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
const previous = selected?.get(itemId);
|
|
110
|
+
if (previous && previous.index === next.index && previous.row === next.row && previous.col === next.col) return previous;
|
|
111
|
+
if (!selected) {
|
|
112
|
+
selected = new Map();
|
|
113
|
+
this.items.set(zoneId, selected);
|
|
114
|
+
}
|
|
115
|
+
selected.set(itemId, next);
|
|
116
|
+
return next;
|
|
117
|
+
};
|
|
118
|
+
subscribeSelection(get, listener) {
|
|
119
|
+
let previous = get();
|
|
120
|
+
return this.source.subscribe(() => {
|
|
121
|
+
const next = get();
|
|
122
|
+
if (Object.is(previous, next)) return;
|
|
123
|
+
previous = next;
|
|
124
|
+
listener();
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
subscribeProvider = listener => this.subscribeSelection(this.getProviderSnapshot, listener);
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=dndRenderStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["retainNativeSlots","previous","next","kind","orientation","itemIds","length","ids","Set","every","id","has","rows","columns","placements","Map","map","placement","itemId","old","get","span","cols","DndRenderStore","zones","itemIndices","WeakMap","items","retainDecisions","constructor","source","getSnapshot","getProviderSnapshot","provider","value","phase","sessionId","sourceZoneId","targetZoneId","validity","disabled","getZoneSnapshot","zoneId","preserveSlots","current","zone","find","entry","revision","key","candidate","displayValue","display","retainSlots","displayRevision","activeItemId","scrollEnabled","Object","keys","field","set","decision","retain","getItemSnapshot","indices","prepared","forEach","index","row","position","col","selected","delete","undefined","subscribeSelection","listener","subscribe","is","subscribeProvider"],"sourceRoot":"../../../src","sources":["runtime/dndRenderStore.ts"],"mappings":";;AAwBA;AACA;AACA;AACA;AACA;;AAGA;AACA,SAASA,iBAAiBA,CACxBC,QAAgC,EAChCC,IAA4B,EACJ;EACxB,IAAI,CAACD,QAAQ,IAAI,CAACC,IAAI,IAAID,QAAQ,CAACE,IAAI,KAAKD,IAAI,CAACC,IAAI,EAAE,OAAOD,IAAI;EAClE,IAAID,QAAQ,KAAKC,IAAI,EAAE,OAAOD,QAAQ;EACtC,IAAIA,QAAQ,CAACE,IAAI,KAAK,MAAM,IAAID,IAAI,CAACC,IAAI,KAAK,MAAM,EAAE;IACpD,IACEF,QAAQ,CAACG,WAAW,KAAKF,IAAI,CAACE,WAAW,IACzCH,QAAQ,CAACI,OAAO,CAACC,MAAM,KAAKJ,IAAI,CAACG,OAAO,CAACC,MAAM,EAE/C,OAAOJ,IAAI;IACb,MAAMK,GAAG,GAAG,IAAIC,GAAG,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,GAAG,IAAIxD,GAAG,CAAC,CAAC;MACpB,IAAI,CAACY,KAAK,CAACiC,GAAG,CAAClB,MAAM,EAAE6B,QAAQ,CAAC;IAClC;IACAA,QAAQ,CAACX,GAAG,CAAC1C,MAAM,EAAEhB,IAAI,CAAC;IAC1B,OAAOA,IAAI;EACb,CAAC;EAEDwE,kBAAkBA,CAChBtD,GAAoB,EACpBuD,QAAoB,EACR;IACZ,IAAI1E,QAAQ,GAAGmB,GAAG,CAAC,CAAC;IACpB,OAAO,IAAI,CAACU,MAAM,CAAC8C,SAAS,CAAC,MAAM;MACjC,MAAM1E,IAAI,GAAGkB,GAAG,CAAC,CAAC;MAClB,IAAIqC,MAAM,CAACoB,EAAE,CAAC5E,QAAQ,EAAEC,IAAI,CAAC,EAAE;MAC/BD,QAAQ,GAAGC,IAAI;MACfyE,QAAQ,CAAC,CAAC;IACZ,CAAC,CAAC;EACJ;EAEAG,iBAAiB,GAAIH,QAAoB,IACvC,IAAI,CAACD,kBAAkB,CAAC,IAAI,CAAC1C,mBAAmB,EAAE2C,QAAQ,CAAC;AAC/D","ignoreList":[]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useMemo, useSyncExternalStore } from 'react';
|
|
4
|
+
import { measure } from 'react-native-reanimated';
|
|
5
|
+
import { DndRenderStore } from "./dndRenderStore.js";
|
|
6
|
+
export const EMPTY_DND_MOTION = {
|
|
7
|
+
token: 0,
|
|
8
|
+
handleId: null,
|
|
9
|
+
seq: 0,
|
|
10
|
+
phase: 'idle',
|
|
11
|
+
itemId: null,
|
|
12
|
+
sourceZoneId: null,
|
|
13
|
+
revision: 0,
|
|
14
|
+
pointer: {
|
|
15
|
+
x: 0,
|
|
16
|
+
y: 0
|
|
17
|
+
},
|
|
18
|
+
origin: {
|
|
19
|
+
x: 0,
|
|
20
|
+
y: 0
|
|
21
|
+
},
|
|
22
|
+
axis: 'both',
|
|
23
|
+
activationDelayMs: 250,
|
|
24
|
+
configRevision: 0,
|
|
25
|
+
grip: {
|
|
26
|
+
x: 0,
|
|
27
|
+
y: 0
|
|
28
|
+
},
|
|
29
|
+
width: 0,
|
|
30
|
+
height: 0,
|
|
31
|
+
root: {
|
|
32
|
+
x: 0,
|
|
33
|
+
y: 0,
|
|
34
|
+
width: 0,
|
|
35
|
+
height: 0
|
|
36
|
+
},
|
|
37
|
+
zones: [],
|
|
38
|
+
visible: false
|
|
39
|
+
};
|
|
40
|
+
export const DndRuntimeContext = /*#__PURE__*/createContext(null);
|
|
41
|
+
export const DndItemContext = /*#__PURE__*/createContext(null);
|
|
42
|
+
export function useDndRuntime() {
|
|
43
|
+
const runtime = useContext(DndRuntimeContext);
|
|
44
|
+
if (!runtime) throw new Error('SortableList, SortableGrid and DragHandle must be inside DndProvider.');
|
|
45
|
+
return runtime;
|
|
46
|
+
}
|
|
47
|
+
function renderStoreFor(runtime) {
|
|
48
|
+
return runtime.renderStore ?? new DndRenderStore({
|
|
49
|
+
getSnapshot: () => runtime.snapshot,
|
|
50
|
+
subscribe: () => () => {}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const inactiveHandleSelection = {
|
|
54
|
+
get: () => false,
|
|
55
|
+
subscribe: _listener => () => {}
|
|
56
|
+
};
|
|
57
|
+
export function useDndZoneSnapshot(runtime, zoneId, preserveSlots = true) {
|
|
58
|
+
const selection = useMemo(() => {
|
|
59
|
+
const store = renderStoreFor(runtime);
|
|
60
|
+
// Without shared presentation nothing moves retained slots on the UI
|
|
61
|
+
// runtime, so React must follow the candidate order itself.
|
|
62
|
+
const get = () => store.getZoneSnapshot(zoneId, runtime.presentation ? preserveSlots : false);
|
|
63
|
+
return {
|
|
64
|
+
get,
|
|
65
|
+
subscribe: listener => store.subscribeSelection(get, listener)
|
|
66
|
+
};
|
|
67
|
+
}, [runtime, zoneId, preserveSlots]);
|
|
68
|
+
return useSyncExternalStore(selection.subscribe, selection.get);
|
|
69
|
+
}
|
|
70
|
+
export function useDndHandleActive(runtime, itemId, disabled) {
|
|
71
|
+
const selection = useMemo(() => {
|
|
72
|
+
if (!disabled) return inactiveHandleSelection;
|
|
73
|
+
const store = renderStoreFor(runtime);
|
|
74
|
+
const get = () => store.getSnapshot().itemId === itemId;
|
|
75
|
+
return {
|
|
76
|
+
get,
|
|
77
|
+
subscribe: listener => store.subscribeSelection(get, listener)
|
|
78
|
+
};
|
|
79
|
+
}, [runtime, itemId, disabled]);
|
|
80
|
+
return useSyncExternalStore(selection.subscribe, selection.get);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Public render arguments follow approved previews independently of native slots. */
|
|
84
|
+
export function useDndItemSnapshot(runtime, zoneId, itemId) {
|
|
85
|
+
const selection = useMemo(() => {
|
|
86
|
+
const store = renderStoreFor(runtime);
|
|
87
|
+
const get = () => store.getItemSnapshot(zoneId, itemId);
|
|
88
|
+
return {
|
|
89
|
+
get,
|
|
90
|
+
subscribe: listener => store.subscribeSelection(get, listener)
|
|
91
|
+
};
|
|
92
|
+
}, [runtime, zoneId, itemId]);
|
|
93
|
+
return useSyncExternalStore(selection.subscribe, selection.get);
|
|
94
|
+
}
|
|
95
|
+
export function measureDndRect(ref) {
|
|
96
|
+
'worklet';
|
|
97
|
+
|
|
98
|
+
const result = measure(ref);
|
|
99
|
+
if (!result || ![result.pageX, result.pageY, result.width, result.height].every(Number.isFinite) || result.width <= 0 || result.height <= 0) return null;
|
|
100
|
+
return {
|
|
101
|
+
x: result.pageX,
|
|
102
|
+
y: result.pageY,
|
|
103
|
+
width: result.width,
|
|
104
|
+
height: result.height
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export function readListViewports(zones) {
|
|
108
|
+
'worklet';
|
|
109
|
+
|
|
110
|
+
const timestampMs = globalThis.performance.now();
|
|
111
|
+
const measured = [];
|
|
112
|
+
for (const zone of zones) {
|
|
113
|
+
const rect = measureDndRect(zone.ref);
|
|
114
|
+
const offset = zone.kind === 'grid' ? 0 : zone.offset.get();
|
|
115
|
+
if (rect && Number.isFinite(offset)) measured.push({
|
|
116
|
+
zoneId: zone.zoneId,
|
|
117
|
+
offset,
|
|
118
|
+
layoutVersion: zone.layoutVersion,
|
|
119
|
+
viewport: {
|
|
120
|
+
source: 'measured',
|
|
121
|
+
space: 'screen',
|
|
122
|
+
rect,
|
|
123
|
+
revision: zone.revision,
|
|
124
|
+
timestampMs
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return measured;
|
|
129
|
+
}
|
|
130
|
+
export function pointInRect(point, rect) {
|
|
131
|
+
'worklet';
|
|
132
|
+
|
|
133
|
+
return point.x >= rect.x && point.x <= rect.x + rect.width && point.y >= rect.y && point.y <= rect.y + rect.height;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=dndRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useMemo","useSyncExternalStore","measure","DndRenderStore","EMPTY_DND_MOTION","token","handleId","seq","phase","itemId","sourceZoneId","revision","pointer","x","y","origin","axis","activationDelayMs","configRevision","grip","width","height","root","zones","visible","DndRuntimeContext","DndItemContext","useDndRuntime","runtime","Error","renderStoreFor","renderStore","getSnapshot","snapshot","subscribe","inactiveHandleSelection","get","_listener","useDndZoneSnapshot","zoneId","preserveSlots","selection","store","getZoneSnapshot","presentation","listener","subscribeSelection","useDndHandleActive","disabled","useDndItemSnapshot","getItemSnapshot","measureDndRect","ref","result","pageX","pageY","every","Number","isFinite","readListViewports","timestampMs","globalThis","performance","now","measured","zone","rect","offset","kind","push","layoutVersion","viewport","source","space","pointInRect","point"],"sourceRoot":"../../../src","sources":["runtime/dndRuntime.ts"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,UAAU,EACVC,OAAO,EACPC,oBAAoB,QACf,OAAO;AAEd,SACEC,OAAO,QAGF,yBAAyB;AAsBhC,SACEC,cAAc,QAGT,qBAAkB;AAmEzB,OAAO,MAAMC,gBAA2B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"../pointer/geometry.js";
|
|
4
|
+
function containsPixels(outer, inner, pixelRatio) {
|
|
5
|
+
'worklet';
|
|
6
|
+
|
|
7
|
+
return Math.round(inner.x * pixelRatio) >= Math.round(outer.x * pixelRatio) && Math.round(inner.y * pixelRatio) >= Math.round(outer.y * pixelRatio) && Math.round((inner.x + inner.width) * pixelRatio) <= Math.round((outer.x + outer.width) * pixelRatio) && Math.round((inner.y + inner.height) * pixelRatio) <= Math.round((outer.y + outer.height) * pixelRatio);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Resolve the committed logical slot without waiting for a native cell. */
|
|
11
|
+
export function settlementTarget({
|
|
12
|
+
root,
|
|
13
|
+
viewport,
|
|
14
|
+
contentRect,
|
|
15
|
+
scrollOffset,
|
|
16
|
+
pixelRatio = 1
|
|
17
|
+
}) {
|
|
18
|
+
'worklet';
|
|
19
|
+
|
|
20
|
+
if (!isUsableRect(root) || !isUsableRect(viewport) || !isUsableRect(contentRect) || !Number.isFinite(scrollOffset.x) || !Number.isFinite(scrollOffset.y) || !Number.isFinite(pixelRatio) || pixelRatio <= 0) return null;
|
|
21
|
+
const expected = {
|
|
22
|
+
x: viewport.x + contentRect.x - scrollOffset.x,
|
|
23
|
+
y: viewport.y + contentRect.y - scrollOffset.y,
|
|
24
|
+
width: contentRect.width,
|
|
25
|
+
height: contentRect.height
|
|
26
|
+
};
|
|
27
|
+
if (!isUsableRect(expected) || !containsPixels(viewport, expected, pixelRatio) || !containsPixels(root, expected, pixelRatio)) return null;
|
|
28
|
+
return {
|
|
29
|
+
...expected,
|
|
30
|
+
x: expected.x - root.x,
|
|
31
|
+
y: expected.y - root.y
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Native alignment gates only the final handoff, not the overlay animation. */
|
|
36
|
+
export function settlementDestination({
|
|
37
|
+
root,
|
|
38
|
+
viewport,
|
|
39
|
+
contentRect,
|
|
40
|
+
nativeRect,
|
|
41
|
+
scrollOffset,
|
|
42
|
+
pixelRatio = 1
|
|
43
|
+
}) {
|
|
44
|
+
'worklet';
|
|
45
|
+
|
|
46
|
+
const target = settlementTarget({
|
|
47
|
+
root,
|
|
48
|
+
viewport,
|
|
49
|
+
contentRect,
|
|
50
|
+
scrollOffset,
|
|
51
|
+
pixelRatio
|
|
52
|
+
});
|
|
53
|
+
if (!target || !isUsableRect(nativeRect)) return null;
|
|
54
|
+
const tolerance = 1 / pixelRatio;
|
|
55
|
+
if (Math.abs(nativeRect.x - root.x - target.x) > tolerance || Math.abs(nativeRect.y - root.y - target.y) > tolerance || Math.abs(nativeRect.width - target.width) > tolerance || Math.abs(nativeRect.height - target.height) > tolerance || !containsPixels(viewport, nativeRect, pixelRatio) || !containsPixels(root, nativeRect, pixelRatio)) return null;
|
|
56
|
+
return {
|
|
57
|
+
x: nativeRect.x - root.x,
|
|
58
|
+
y: nativeRect.y - root.y,
|
|
59
|
+
width: nativeRect.width,
|
|
60
|
+
height: nativeRect.height
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Both rectangles use root coordinates; progress is the native animation value. */
|
|
65
|
+
export function interpolateSettlementRect(from, to, progress) {
|
|
66
|
+
'worklet';
|
|
67
|
+
|
|
68
|
+
if (!isUsableRect(from) || !isUsableRect(to) || !Number.isFinite(progress)) return null;
|
|
69
|
+
const amount = Math.max(0, Math.min(1, progress));
|
|
70
|
+
return {
|
|
71
|
+
x: from.x + (to.x - from.x) * amount,
|
|
72
|
+
y: from.y + (to.y - from.y) * amount,
|
|
73
|
+
width: from.width + (to.width - from.width) * amount,
|
|
74
|
+
height: from.height + (to.height - from.height) * amount
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=dndSettlement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isUsableRect","containsPixels","outer","inner","pixelRatio","Math","round","x","y","width","height","settlementTarget","root","viewport","contentRect","scrollOffset","Number","isFinite","expected","settlementDestination","nativeRect","target","tolerance","abs","interpolateSettlementRect","from","to","progress","amount","max","min"],"sourceRoot":"../../../src","sources":["runtime/dndSettlement.ts"],"mappings":";;AAEA,SAASA,YAAY,QAAQ,wBAAqB;AAYlD,SAASC,cAAcA,CACrBC,KAAiB,EACjBC,KAAiB,EACjBC,UAAkB,EACT;EACT,SAAS;;EACT,OACEC,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,CAAC,GAAGH,UAAU,CAAC,IAAIC,IAAI,CAACC,KAAK,CAACJ,KAAK,CAACK,CAAC,GAAGH,UAAU,CAAC,IACpEC,IAAI,CAACC,KAAK,CAACH,KAAK,CAACK,CAAC,GAAGJ,UAAU,CAAC,IAAIC,IAAI,CAACC,KAAK,CAACJ,KAAK,CAACM,CAAC,GAAGJ,UAAU,CAAC,IACpEC,IAAI,CAACC,KAAK,CAAC,CAACH,KAAK,CAACI,CAAC,GAAGJ,KAAK,CAACM,KAAK,IAAIL,UAAU,CAAC,IAC9CC,IAAI,CAACC,KAAK,CAAC,CAACJ,KAAK,CAACK,CAAC,GAAGL,KAAK,CAACO,KAAK,IAAIL,UAAU,CAAC,IAClDC,IAAI,CAACC,KAAK,CAAC,CAACH,KAAK,CAACK,CAAC,GAAGL,KAAK,CAACO,MAAM,IAAIN,UAAU,CAAC,IAC/CC,IAAI,CAACC,KAAK,CAAC,CAACJ,KAAK,CAACM,CAAC,GAAGN,KAAK,CAACQ,MAAM,IAAIN,UAAU,CAAC;AAEvD;;AAEA;AACA,OAAO,SAASO,gBAAgBA,CAAC;EAC/BC,IAAI;EACJC,QAAQ;EACRC,WAAW;EACXC,YAAY;EACZX,UAAU,GAAG;AACyB,CAAC,EAAqB;EAC5D,SAAS;;EACT,IACE,CAACJ,YAAY,CAACY,IAAI,CAAC,IACnB,CAACZ,YAAY,CAACa,QAAQ,CAAC,IACvB,CAACb,YAAY,CAACc,WAAW,CAAC,IAC1B,CAACE,MAAM,CAACC,QAAQ,CAACF,YAAY,CAACR,CAAC,CAAC,IA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E,CAACnB,CAAC,GAAGkB,IAAI,CAAClB,CAAC,IAAIqB,MAAM;IACpCpB,CAAC,EAAEiB,IAAI,CAACjB,CAAC,GAAG,CAACkB,EAAE,CAAClB,CAAC,GAAGiB,IAAI,CAACjB,CAAC,IAAIoB,MAAM;IACpCnB,KAAK,EAAEgB,IAAI,CAAChB,KAAK,GAAG,CAACiB,EAAE,CAACjB,KAAK,GAAGgB,IAAI,CAAChB,KAAK,IAAImB,MAAM;IACpDlB,MAAM,EAAEe,IAAI,CAACf,MAAM,GAAG,CAACgB,EAAE,CAAChB,MAAM,GAAGe,IAAI,CAACf,MAAM,IAAIkB;EACpD,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Geometry vocabulary of the grid pointer policy (`pointer/geometry.ts`),
|
|
5
|
+
* shared by the provider's layout targeting. The React runtime of the former
|
|
6
|
+
* grid controller no longer lives here.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const EMPTY_MOTION = {
|
|
10
|
+
token: 0,
|
|
11
|
+
phase: 'idle',
|
|
12
|
+
itemId: null,
|
|
13
|
+
sourceZoneId: null,
|
|
14
|
+
seq: 0,
|
|
15
|
+
target: null,
|
|
16
|
+
span: {
|
|
17
|
+
rows: 1,
|
|
18
|
+
cols: 1
|
|
19
|
+
},
|
|
20
|
+
x: 0,
|
|
21
|
+
y: 0,
|
|
22
|
+
width: 0,
|
|
23
|
+
height: 0,
|
|
24
|
+
gripX: 0,
|
|
25
|
+
gripY: 0,
|
|
26
|
+
zones: [],
|
|
27
|
+
outlet: {
|
|
28
|
+
x: 0,
|
|
29
|
+
y: 0,
|
|
30
|
+
width: 0,
|
|
31
|
+
height: 0
|
|
32
|
+
},
|
|
33
|
+
validity: 'pending',
|
|
34
|
+
visible: false,
|
|
35
|
+
destination: null
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=gridRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EMPTY_MOTION","token","phase","itemId","sourceZoneId","seq","target","span","rows","cols","x","y","width","height","gripX","gripY","zones","outlet","validity","visible","destination"],"sourceRoot":"../../../src","sources":["runtime/gridRuntime.ts"],"mappings":";;AAQA;AACA;AACA;AACA;AACA;;AAyCA,OAAO,MAAMA,YAAsB,GAAG;EACpCC,KAAK,EAAE,CAAC;EACRC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,IAAI;EACZC,YAAY,EAAE,IAAI;EAClBC,GAAG,EAAE,CAAC;EACNC,MAAM,EAAE,IAAI;EACZC,IAAI,EAAE;IAAEC,IAAI,EAAE,CAAC;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BC,CAAC,EAAE,CAAC;EACJC,CAAC,EAAE,CAAC;EACJC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE,CAAC;EACRC,KAAK,EAAE,CAAC;EACRC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE;IAAEP,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE,CAAC;EAC3CK,QAAQ,EAAE,SAAS;EACnBC,OAAO,EAAE,KAAK;EACdC,WAAW,EAAE;AACf,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CoordinateResult, LayoutPoint, MeasurementFreshness, RectMeasurement, ZoneCoordinateContext } from '../contracts.js';
|
|
2
|
+
/** Estimates remain estimates after validation; callers must inspect source. */
|
|
3
|
+
export declare function validateRectMeasurement<Measurement extends RectMeasurement>(measurement: Measurement, freshness: MeasurementFreshness): CoordinateResult<Measurement>;
|
|
4
|
+
/** Convert absolute screen pixels to zone content pixels using the current offset. */
|
|
5
|
+
export declare function screenToContent(point: LayoutPoint, context: ZoneCoordinateContext, freshness: MeasurementFreshness): CoordinateResult<LayoutPoint>;
|
|
6
|
+
export declare function contentToScreen(point: LayoutPoint, context: ZoneCoordinateContext, freshness: MeasurementFreshness): CoordinateResult<LayoutPoint>;
|
|
7
|
+
export declare function screenRectToContent(measurement: RectMeasurement<'screen'>, context: ZoneCoordinateContext, freshness: MeasurementFreshness): CoordinateResult<RectMeasurement<'content'>>;
|
|
8
|
+
export declare function contentRectToScreen(measurement: RectMeasurement<'content'>, context: ZoneCoordinateContext, freshness: MeasurementFreshness): CoordinateResult<RectMeasurement<'screen'>>;
|
|
9
|
+
//# sourceMappingURL=coordinates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../../../../src/adapters/coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EAEX,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACtB,MAAM,iBAAc,CAAC;AAgCtB,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,WAAW,SAAS,eAAe,EACzE,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,oBAAoB,GAC9B,gBAAgB,CAAC,WAAW,CAAC,CAgC/B;AA8CD,sFAAsF;AACtF,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,oBAAoB,GAC9B,gBAAgB,CAAC,WAAW,CAAC,CAE/B;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,oBAAoB,GAC9B,gBAAgB,CAAC,WAAW,CAAC,CAE/B;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,eAAe,CAAC,QAAQ,CAAC,EACtC,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,oBAAoB,GAC9B,gBAAgB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAgB9C;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,eAAe,CAAC,SAAS,CAAC,EACvC,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,oBAAoB,GAC9B,gBAAgB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAgB7C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { LayoutPoint } from '../contracts.js';
|
|
2
|
+
/** The permitted drag direction is independent of a list's orientation. */
|
|
3
|
+
export type DragAxis = 'x' | 'y' | 'both';
|
|
4
|
+
export type AutoScrollOptions = {
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
/** Edge activation distance in logical pixels. Defaults to 48. */
|
|
7
|
+
edgeThreshold?: number;
|
|
8
|
+
/** Maximum speed in logical pixels per second. Defaults to 600. */
|
|
9
|
+
maxSpeed?: number;
|
|
10
|
+
};
|
|
11
|
+
/** One axis of a measured scroll viewport, using logical pixels throughout. */
|
|
12
|
+
export type AutoScrollInput = {
|
|
13
|
+
/** Absolute screen coordinate on the scrolling axis. */
|
|
14
|
+
pointer: number;
|
|
15
|
+
viewportStart: number;
|
|
16
|
+
viewportSize: number;
|
|
17
|
+
/** Current native scroll offset; temporary bounce offsets are accepted. */
|
|
18
|
+
offset: number;
|
|
19
|
+
contentSize: number;
|
|
20
|
+
deltaTimeMs: number;
|
|
21
|
+
options?: AutoScrollOptions;
|
|
22
|
+
};
|
|
23
|
+
export type AutoScrollResult = {
|
|
24
|
+
valid: true;
|
|
25
|
+
/** Bounded native scroll target, including when velocity is zero. */
|
|
26
|
+
offset: number;
|
|
27
|
+
/** Actual speed after clamping, in logical pixels per second. */
|
|
28
|
+
velocity: number;
|
|
29
|
+
} | {
|
|
30
|
+
valid: false;
|
|
31
|
+
reason: 'invalid-input' | 'invalid-options';
|
|
32
|
+
};
|
|
33
|
+
export type AutoScrollOptionsValidationResult = {
|
|
34
|
+
valid: true;
|
|
35
|
+
} | {
|
|
36
|
+
valid: false;
|
|
37
|
+
reason: 'invalid-options';
|
|
38
|
+
};
|
|
39
|
+
/** Validate public options before activating a gesture or executing a frame. */
|
|
40
|
+
export declare function validateAutoScrollOptions(options?: AutoScrollOptions): AutoScrollOptionsValidationResult;
|
|
41
|
+
/**
|
|
42
|
+
* Compute one frame of edge scrolling for either orientation. Adapters should
|
|
43
|
+
* call scrollTo only for nonzero velocity, preserving native bounce while idle.
|
|
44
|
+
* Call only during an active drag, and re-read its candidate after scrolling.
|
|
45
|
+
*/
|
|
46
|
+
export declare function computeAutoScroll(input: AutoScrollInput): AutoScrollResult;
|
|
47
|
+
/** Project a validated screen point onto the configured axis through origin. */
|
|
48
|
+
export declare function constrainDragPoint(point: LayoutPoint, origin: LayoutPoint, axis: DragAxis): LayoutPoint;
|
|
49
|
+
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../../src/adapters/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAc,CAAC;AAEhD,2EAA2E;AAC3E,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,eAAe,GAAG;IAC5B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB;IACE,KAAK,EAAE,IAAI,CAAC;IACZ,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;CAClB,GACD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,iCAAiC,GAC3C;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAEhE,gFAAgF;AAChF,wBAAgB,yBAAyB,CACvC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,iCAAiC,CAgBnC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAoE1E;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,QAAQ,GACb,WAAW,CAMb"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { LayoutValidationIssue } from '../contracts.js';
|
|
2
|
+
/** FlatList rendering limits; enabling virtualization preserves the layout API. */
|
|
3
|
+
export type ListVirtualizationOptions = {
|
|
4
|
+
/** Cells rendered initially. Defaults to 12. */
|
|
5
|
+
initialNumToRender?: number;
|
|
6
|
+
/** Maximum cells rendered in each batch. Defaults to 12. */
|
|
7
|
+
maxToRenderPerBatch?: number;
|
|
8
|
+
/** Render window in viewport lengths; must exceed 1. Defaults to 7. */
|
|
9
|
+
windowSize?: number;
|
|
10
|
+
/** Delay between render batches in milliseconds. Defaults to 50. */
|
|
11
|
+
updateCellsBatchingPeriod?: number;
|
|
12
|
+
};
|
|
13
|
+
export type ListVirtualizationResult = {
|
|
14
|
+
valid: true;
|
|
15
|
+
options: Required<ListVirtualizationOptions> | null;
|
|
16
|
+
} | {
|
|
17
|
+
valid: false;
|
|
18
|
+
issues: LayoutValidationIssue[];
|
|
19
|
+
};
|
|
20
|
+
/** Undefined/false selects ScrollView; true or an options object selects FlatList. */
|
|
21
|
+
export declare function resolveListVirtualization(value: unknown): ListVirtualizationResult;
|
|
22
|
+
//# sourceMappingURL=virtualizedList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtualizedList.d.ts","sourceRoot":"","sources":["../../../../src/adapters/virtualizedList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAc,CAAC;AAG1D,mFAAmF;AACnF,MAAM,MAAM,yBAAyB,GAAG;IACtC,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,4DAA4D;IAC5D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAA;CAAE,GACpE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,qBAAqB,EAAE,CAAA;CAAE,CAAC;AAiBtD,sFAAsF;AACtF,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,GACb,wBAAwB,CA0E1B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DndProviderProps } from './dndTypes.js';
|
|
2
|
+
/** Shared gesture, session and overlay for grid, ScrollView and FlatList zones. */
|
|
3
|
+
export declare function DndProvider<T>({ value, onChange, canDrop, onDragStart, onDragEnd, onDragSettled, onValidationError, onDiagnostic, responseTimeoutMs, getGridItemLayout, movementPolicy, searchBudget, disabled, activation, dragAxis, motion: motionConfig, renderDragPreview, waitForDragPreviewReady, dragPreviewStyle, ref, children, style, onLayout, ...viewProps }: DndProviderProps<T>): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=DndProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DndProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/DndProvider.tsx"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,eAAY,CAAC;AAuIvE,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC7B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,QAAgB,EAChB,UAAqD,EACrD,QAAiB,EACjB,MAAM,EAAE,YAAY,EACpB,iBAAiB,EACjB,uBAA+B,EAC/B,gBAAgB,EAChB,GAAG,EACH,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,gBAAgB,CAAC,CAAC,CAAC,+BA2iDrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragHandle.d.ts","sourceRoot":"","sources":["../../../../src/components/DragHandle.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAY,CAAC;AAGlD,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BA0EhD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { GridItem } from '../types.js';
|
|
3
|
+
import type { GridControllerProps, ItemRenderArgs } from './gridTypes.js';
|
|
4
|
+
/** What `GridZoneView` needs from its controller to render the grid API's items. */
|
|
5
|
+
export type GridAdapterScope<T> = {
|
|
6
|
+
renderItem(args: ItemRenderArgs<T>): ReactNode;
|
|
7
|
+
/** The caller's own item object, so render callbacks see stable identities. */
|
|
8
|
+
itemOf(itemId: string): GridItem<T> | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare const GridAdapterContext: import("react").Context<GridAdapterScope<unknown> | null>;
|
|
11
|
+
/**
|
|
12
|
+
* The grid API on the shared provider. `GridValue` is converted to the
|
|
13
|
+
* provider's layout state once per committed value; candidates, changes and
|
|
14
|
+
* end events are converted back with their ordered zones, item data and
|
|
15
|
+
* revision intact. Zones render through `GridZoneView`, handles through
|
|
16
|
+
* `GridDragHandle`; both are thin wrappers over the provider's components.
|
|
17
|
+
* `onDragEnd` is delivered once the preview has settled, as the grid API
|
|
18
|
+
* always did (the provider's `onDragSettled` timing).
|
|
19
|
+
*/
|
|
20
|
+
export declare function GridController<T>({ value, onChange, renderItem, renderDragPreview, waitForDragPreviewReady, dragPreviewStyle, canDrop, onDragStart, onDragEnd, onValidationError, onDiagnostic, searchBudget, activation, movementPolicy, motion, responseTimeoutMs, disabled, ref, children, ...viewProps }: GridControllerProps<T>): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=GridController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridController.d.ts","sourceRoot":"","sources":["../../../../src/components/GridController.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAcf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAU,CAAC;AAIzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,gBAAa,CAAC;AAEvE,oFAAoF;AACpF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC/C,+EAA+E;IAC/E,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,kBAAkB,2DACwB,CAAC;AAIxD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,EAChC,KAAK,EACL,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,uBAA+B,EAC/B,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,MAAM,EACN,iBAAiB,EACjB,QAAgB,EAChB,GAAG,EACH,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,mBAAmB,CAAC,CAAC,CAAC,+BA8IxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GridDragHandleProps } from './gridTypes.js';
|
|
2
|
+
/**
|
|
3
|
+
* A grid item's hit area. The provider owns one native recognizer per gesture
|
|
4
|
+
* relation signature, so mounting, re-rendering or unmounting a handle never
|
|
5
|
+
* creates, re-serializes or drops a native handler.
|
|
6
|
+
*/
|
|
7
|
+
export declare function GridDragHandle(props: GridDragHandleProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=GridDragHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridDragHandle.d.ts","sourceRoot":"","sources":["../../../../src/components/GridDragHandle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAa,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,+BAExD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GridZoneViewProps } from './gridTypes.js';
|
|
2
|
+
/**
|
|
3
|
+
* One zone of a `GridController`: the provider's grid adapter rendering the
|
|
4
|
+
* controller's `renderItem` with the grid API's arguments. Ordered zones
|
|
5
|
+
* (`strategy: 'ordered'`) keep their slot layout and capacity.
|
|
6
|
+
*/
|
|
7
|
+
export declare function GridZoneView({ zoneId, geometry, children, ...props }: GridZoneViewProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=GridZoneView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridZoneView.d.ts","sourceRoot":"","sources":["../../../../src/components/GridZoneView.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAa,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,+BAkCnB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SortableGridProps } from './dndTypes.js';
|
|
2
|
+
/** Spatial cells in the same provider/session as SortableList. */
|
|
3
|
+
export declare function SortableGrid<T>({ zoneId, geometry, renderItem, dropIndicatorStyle, children, style, onLayout, ...viewProps }: SortableGridProps<T>): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=SortableGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortableGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/SortableGrid.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,eAAY,CAAC;AAgJxE,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,MAAM,EACN,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,iBAAiB,CAAC,CAAC,CAAC,+BAwQtB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SortableListProps } from './dndTypes.js';
|
|
2
|
+
/** Shared measured layout for ScrollView and FlatList adapters. */
|
|
3
|
+
export declare function SortableList<T>({ zoneId, renderItem, estimatedItemSize, itemSize, gap, paddingStart, paddingEnd, autoScroll, scrollEnabled, showsScrollIndicator, onScrollOffsetChange, virtualization, onLayout, style, ...viewProps }: SortableListProps<T>): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=SortableList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortableList.d.ts","sourceRoot":"","sources":["../../../../src/components/SortableList.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,eAAY,CAAC;AAkWxE,mEAAmE;AACnE,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,MAAM,EACN,UAAU,EACV,iBAAsB,EACtB,QAAQ,EACR,GAAO,EACP,YAAgB,EAChB,UAAc,EACd,UAAU,EACV,aAAoB,EACpB,oBAA2B,EAC3B,oBAAoB,EACpB,cAAsB,EACtB,QAAQ,EACR,KAAK,EACL,GAAG,SAAS,EACb,EAAE,iBAAiB,CAAC,CAAC,CAAC,+BAqlBtB"}
|