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.
Files changed (340) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +262 -0
  3. package/lib/module/adapters/coordinates.js +135 -0
  4. package/lib/module/adapters/coordinates.js.map +1 -0
  5. package/lib/module/adapters/scroll.js +81 -0
  6. package/lib/module/adapters/scroll.js.map +1 -0
  7. package/lib/module/adapters/virtualizedList.js +69 -0
  8. package/lib/module/adapters/virtualizedList.js.map +1 -0
  9. package/lib/module/components/DndProvider.js +1144 -0
  10. package/lib/module/components/DndProvider.js.map +1 -0
  11. package/lib/module/components/DragHandle.js +65 -0
  12. package/lib/module/components/DragHandle.js.map +1 -0
  13. package/lib/module/components/GridController.js +151 -0
  14. package/lib/module/components/GridController.js.map +1 -0
  15. package/lib/module/components/GridDragHandle.js +15 -0
  16. package/lib/module/components/GridDragHandle.js.map +1 -0
  17. package/lib/module/components/GridZoneView.js +59 -0
  18. package/lib/module/components/GridZoneView.js.map +1 -0
  19. package/lib/module/components/SortableGrid.js +305 -0
  20. package/lib/module/components/SortableGrid.js.map +1 -0
  21. package/lib/module/components/SortableList.js +714 -0
  22. package/lib/module/components/SortableList.js.map +1 -0
  23. package/lib/module/components/dndTypes.js +4 -0
  24. package/lib/module/components/dndTypes.js.map +1 -0
  25. package/lib/module/components/gridTypes.js +4 -0
  26. package/lib/module/components/gridTypes.js.map +1 -0
  27. package/lib/module/components/handleViewProps.js +13 -0
  28. package/lib/module/components/handleViewProps.js.map +1 -0
  29. package/lib/module/contracts.js +4 -0
  30. package/lib/module/contracts.js.map +1 -0
  31. package/lib/module/controller/approval.js +98 -0
  32. package/lib/module/controller/approval.js.map +1 -0
  33. package/lib/module/controller/coordinatorBase.js +93 -0
  34. package/lib/module/controller/coordinatorBase.js.map +1 -0
  35. package/lib/module/controller/dndSession.js +621 -0
  36. package/lib/module/controller/dndSession.js.map +1 -0
  37. package/lib/module/controller/dndState.js +103 -0
  38. package/lib/module/controller/dndState.js.map +1 -0
  39. package/lib/module/controller/gridAdapter.js +191 -0
  40. package/lib/module/controller/gridAdapter.js.map +1 -0
  41. package/lib/module/controller/gridState.js +101 -0
  42. package/lib/module/controller/gridState.js.map +1 -0
  43. package/lib/module/controller/locations.js +48 -0
  44. package/lib/module/controller/locations.js.map +1 -0
  45. package/lib/module/controller/previewPath.js +73 -0
  46. package/lib/module/controller/previewPath.js.map +1 -0
  47. package/lib/module/controller/sessionCore.js +222 -0
  48. package/lib/module/controller/sessionCore.js.map +1 -0
  49. package/lib/module/controller/useDndState.js +9 -0
  50. package/lib/module/controller/useDndState.js.map +1 -0
  51. package/lib/module/controller/useGridState.js +9 -0
  52. package/lib/module/controller/useGridState.js.map +1 -0
  53. package/lib/module/controller/useStoreState.js +15 -0
  54. package/lib/module/controller/useStoreState.js.map +1 -0
  55. package/lib/module/defaults.js +7 -0
  56. package/lib/module/defaults.js.map +1 -0
  57. package/lib/module/diagnostics.js +16 -0
  58. package/lib/module/diagnostics.js.map +1 -0
  59. package/lib/module/engine/gridPlacements.js +54 -0
  60. package/lib/module/engine/gridPlacements.js.map +1 -0
  61. package/lib/module/engine/index.js +19 -0
  62. package/lib/module/engine/index.js.map +1 -0
  63. package/lib/module/engine/layout.js +36 -0
  64. package/lib/module/engine/layout.js.map +1 -0
  65. package/lib/module/engine/layoutMove.js +326 -0
  66. package/lib/module/engine/layoutMove.js.map +1 -0
  67. package/lib/module/engine/layoutState.js +344 -0
  68. package/lib/module/engine/layoutState.js.map +1 -0
  69. package/lib/module/engine/list.js +172 -0
  70. package/lib/module/engine/list.js.map +1 -0
  71. package/lib/module/engine/listIndex.js +125 -0
  72. package/lib/module/engine/listIndex.js.map +1 -0
  73. package/lib/module/engine/move.js +216 -0
  74. package/lib/module/engine/move.js.map +1 -0
  75. package/lib/module/engine/movementPolicy.js +77 -0
  76. package/lib/module/engine/movementPolicy.js.map +1 -0
  77. package/lib/module/engine/orderedTarget.js +71 -0
  78. package/lib/module/engine/orderedTarget.js.map +1 -0
  79. package/lib/module/engine/pack.js +30 -0
  80. package/lib/module/engine/pack.js.map +1 -0
  81. package/lib/module/engine/rectangles.js +12 -0
  82. package/lib/module/engine/rectangles.js.map +1 -0
  83. package/lib/module/engine/sameLayout.js +29 -0
  84. package/lib/module/engine/sameLayout.js.map +1 -0
  85. package/lib/module/engine/search.js +159 -0
  86. package/lib/module/engine/search.js.map +1 -0
  87. package/lib/module/engine/spatial.js +27 -0
  88. package/lib/module/engine/spatial.js.map +1 -0
  89. package/lib/module/engine/spatialAppRotation.js +39 -0
  90. package/lib/module/engine/spatialAppRotation.js.map +1 -0
  91. package/lib/module/engine/spatialExchange.js +164 -0
  92. package/lib/module/engine/spatialExchange.js.map +1 -0
  93. package/lib/module/engine/spatialInsertion.js +135 -0
  94. package/lib/module/engine/spatialInsertion.js.map +1 -0
  95. package/lib/module/engine/spatialPolicy.js +41 -0
  96. package/lib/module/engine/spatialPolicy.js.map +1 -0
  97. package/lib/module/engine/spatialRotation.js +48 -0
  98. package/lib/module/engine/spatialRotation.js.map +1 -0
  99. package/lib/module/engine/validation.js +205 -0
  100. package/lib/module/engine/validation.js.map +1 -0
  101. package/lib/module/gesture/DndGestureGroup.js +268 -0
  102. package/lib/module/gesture/DndGestureGroup.js.map +1 -0
  103. package/lib/module/gesture/DndGestureHost.js +32 -0
  104. package/lib/module/gesture/DndGestureHost.js.map +1 -0
  105. package/lib/module/gesture/gestureConfig.js +81 -0
  106. package/lib/module/gesture/gestureConfig.js.map +1 -0
  107. package/lib/module/gesture/gestureGrouping.js +122 -0
  108. package/lib/module/gesture/gestureGrouping.js.map +1 -0
  109. package/lib/module/gesture/gestureHost.js +106 -0
  110. package/lib/module/gesture/gestureHost.js.map +1 -0
  111. package/lib/module/index.js +23 -0
  112. package/lib/module/index.js.map +1 -0
  113. package/lib/module/package.json +1 -0
  114. package/lib/module/pointer/dndTarget.js +101 -0
  115. package/lib/module/pointer/dndTarget.js.map +1 -0
  116. package/lib/module/pointer/geometry.js +363 -0
  117. package/lib/module/pointer/geometry.js.map +1 -0
  118. package/lib/module/pointer/layoutTarget.js +307 -0
  119. package/lib/module/pointer/layoutTarget.js.map +1 -0
  120. package/lib/module/pointer/listCellMotion.js +99 -0
  121. package/lib/module/pointer/listCellMotion.js.map +1 -0
  122. package/lib/module/pointer/listTarget.js +42 -0
  123. package/lib/module/pointer/listTarget.js.map +1 -0
  124. package/lib/module/pointer/motion.js +37 -0
  125. package/lib/module/pointer/motion.js.map +1 -0
  126. package/lib/module/runtime/dndPresentation.js +81 -0
  127. package/lib/module/runtime/dndPresentation.js.map +1 -0
  128. package/lib/module/runtime/dndRenderStore.js +129 -0
  129. package/lib/module/runtime/dndRenderStore.js.map +1 -0
  130. package/lib/module/runtime/dndRuntime.js +135 -0
  131. package/lib/module/runtime/dndRuntime.js.map +1 -0
  132. package/lib/module/runtime/dndSettlement.js +77 -0
  133. package/lib/module/runtime/dndSettlement.js.map +1 -0
  134. package/lib/module/runtime/gridRuntime.js +37 -0
  135. package/lib/module/runtime/gridRuntime.js.map +1 -0
  136. package/lib/module/types.js +4 -0
  137. package/lib/module/types.js.map +1 -0
  138. package/lib/typescript/package.json +1 -0
  139. package/lib/typescript/src/adapters/coordinates.d.ts +9 -0
  140. package/lib/typescript/src/adapters/coordinates.d.ts.map +1 -0
  141. package/lib/typescript/src/adapters/scroll.d.ts +49 -0
  142. package/lib/typescript/src/adapters/scroll.d.ts.map +1 -0
  143. package/lib/typescript/src/adapters/virtualizedList.d.ts +22 -0
  144. package/lib/typescript/src/adapters/virtualizedList.d.ts.map +1 -0
  145. package/lib/typescript/src/components/DndProvider.d.ts +4 -0
  146. package/lib/typescript/src/components/DndProvider.d.ts.map +1 -0
  147. package/lib/typescript/src/components/DragHandle.d.ts +4 -0
  148. package/lib/typescript/src/components/DragHandle.d.ts.map +1 -0
  149. package/lib/typescript/src/components/GridController.d.ts +21 -0
  150. package/lib/typescript/src/components/GridController.d.ts.map +1 -0
  151. package/lib/typescript/src/components/GridDragHandle.d.ts +8 -0
  152. package/lib/typescript/src/components/GridDragHandle.d.ts.map +1 -0
  153. package/lib/typescript/src/components/GridZoneView.d.ts +8 -0
  154. package/lib/typescript/src/components/GridZoneView.d.ts.map +1 -0
  155. package/lib/typescript/src/components/SortableGrid.d.ts +4 -0
  156. package/lib/typescript/src/components/SortableGrid.d.ts.map +1 -0
  157. package/lib/typescript/src/components/SortableList.d.ts +4 -0
  158. package/lib/typescript/src/components/SortableList.d.ts.map +1 -0
  159. package/lib/typescript/src/components/dndTypes.d.ts +94 -0
  160. package/lib/typescript/src/components/dndTypes.d.ts.map +1 -0
  161. package/lib/typescript/src/components/gridTypes.d.ts +84 -0
  162. package/lib/typescript/src/components/gridTypes.d.ts.map +1 -0
  163. package/lib/typescript/src/components/handleViewProps.d.ts +6 -0
  164. package/lib/typescript/src/components/handleViewProps.d.ts.map +1 -0
  165. package/lib/typescript/src/contracts.d.ts +145 -0
  166. package/lib/typescript/src/contracts.d.ts.map +1 -0
  167. package/lib/typescript/src/controller/approval.d.ts +66 -0
  168. package/lib/typescript/src/controller/approval.d.ts.map +1 -0
  169. package/lib/typescript/src/controller/coordinatorBase.d.ts +37 -0
  170. package/lib/typescript/src/controller/coordinatorBase.d.ts.map +1 -0
  171. package/lib/typescript/src/controller/dndSession.d.ts +152 -0
  172. package/lib/typescript/src/controller/dndSession.d.ts.map +1 -0
  173. package/lib/typescript/src/controller/dndState.d.ts +27 -0
  174. package/lib/typescript/src/controller/dndState.d.ts.map +1 -0
  175. package/lib/typescript/src/controller/gridAdapter.d.ts +44 -0
  176. package/lib/typescript/src/controller/gridAdapter.d.ts.map +1 -0
  177. package/lib/typescript/src/controller/gridState.d.ts +18 -0
  178. package/lib/typescript/src/controller/gridState.d.ts.map +1 -0
  179. package/lib/typescript/src/controller/locations.d.ts +9 -0
  180. package/lib/typescript/src/controller/locations.d.ts.map +1 -0
  181. package/lib/typescript/src/controller/previewPath.d.ts +49 -0
  182. package/lib/typescript/src/controller/previewPath.d.ts.map +1 -0
  183. package/lib/typescript/src/controller/sessionCore.d.ts +106 -0
  184. package/lib/typescript/src/controller/sessionCore.d.ts.map +1 -0
  185. package/lib/typescript/src/controller/useDndState.d.ts +8 -0
  186. package/lib/typescript/src/controller/useDndState.d.ts.map +1 -0
  187. package/lib/typescript/src/controller/useGridState.d.ts +8 -0
  188. package/lib/typescript/src/controller/useGridState.d.ts.map +1 -0
  189. package/lib/typescript/src/controller/useStoreState.d.ts +16 -0
  190. package/lib/typescript/src/controller/useStoreState.d.ts.map +1 -0
  191. package/lib/typescript/src/defaults.d.ts +5 -0
  192. package/lib/typescript/src/defaults.d.ts.map +1 -0
  193. package/lib/typescript/src/diagnostics.d.ts +9 -0
  194. package/lib/typescript/src/diagnostics.d.ts.map +1 -0
  195. package/lib/typescript/src/engine/gridPlacements.d.ts +22 -0
  196. package/lib/typescript/src/engine/gridPlacements.d.ts.map +1 -0
  197. package/lib/typescript/src/engine/index.d.ts +28 -0
  198. package/lib/typescript/src/engine/index.d.ts.map +1 -0
  199. package/lib/typescript/src/engine/layout.d.ts +4 -0
  200. package/lib/typescript/src/engine/layout.d.ts.map +1 -0
  201. package/lib/typescript/src/engine/layoutMove.d.ts +46 -0
  202. package/lib/typescript/src/engine/layoutMove.d.ts.map +1 -0
  203. package/lib/typescript/src/engine/layoutState.d.ts +22 -0
  204. package/lib/typescript/src/engine/layoutState.d.ts.map +1 -0
  205. package/lib/typescript/src/engine/list.d.ts +68 -0
  206. package/lib/typescript/src/engine/list.d.ts.map +1 -0
  207. package/lib/typescript/src/engine/listIndex.d.ts +32 -0
  208. package/lib/typescript/src/engine/listIndex.d.ts.map +1 -0
  209. package/lib/typescript/src/engine/move.d.ts +10 -0
  210. package/lib/typescript/src/engine/move.d.ts.map +1 -0
  211. package/lib/typescript/src/engine/movementPolicy.d.ts +34 -0
  212. package/lib/typescript/src/engine/movementPolicy.d.ts.map +1 -0
  213. package/lib/typescript/src/engine/orderedTarget.d.ts +32 -0
  214. package/lib/typescript/src/engine/orderedTarget.d.ts.map +1 -0
  215. package/lib/typescript/src/engine/pack.d.ts +3 -0
  216. package/lib/typescript/src/engine/pack.d.ts.map +1 -0
  217. package/lib/typescript/src/engine/rectangles.d.ts +9 -0
  218. package/lib/typescript/src/engine/rectangles.d.ts.map +1 -0
  219. package/lib/typescript/src/engine/sameLayout.d.ts +4 -0
  220. package/lib/typescript/src/engine/sameLayout.d.ts.map +1 -0
  221. package/lib/typescript/src/engine/search.d.ts +28 -0
  222. package/lib/typescript/src/engine/search.d.ts.map +1 -0
  223. package/lib/typescript/src/engine/spatial.d.ts +16 -0
  224. package/lib/typescript/src/engine/spatial.d.ts.map +1 -0
  225. package/lib/typescript/src/engine/spatialAppRotation.d.ts +4 -0
  226. package/lib/typescript/src/engine/spatialAppRotation.d.ts.map +1 -0
  227. package/lib/typescript/src/engine/spatialExchange.d.ts +5 -0
  228. package/lib/typescript/src/engine/spatialExchange.d.ts.map +1 -0
  229. package/lib/typescript/src/engine/spatialInsertion.d.ts +5 -0
  230. package/lib/typescript/src/engine/spatialInsertion.d.ts.map +1 -0
  231. package/lib/typescript/src/engine/spatialPolicy.d.ts +9 -0
  232. package/lib/typescript/src/engine/spatialPolicy.d.ts.map +1 -0
  233. package/lib/typescript/src/engine/spatialRotation.d.ts +8 -0
  234. package/lib/typescript/src/engine/spatialRotation.d.ts.map +1 -0
  235. package/lib/typescript/src/engine/validation.d.ts +9 -0
  236. package/lib/typescript/src/engine/validation.d.ts.map +1 -0
  237. package/lib/typescript/src/gesture/DndGestureGroup.d.ts +33 -0
  238. package/lib/typescript/src/gesture/DndGestureGroup.d.ts.map +1 -0
  239. package/lib/typescript/src/gesture/DndGestureHost.d.ts +12 -0
  240. package/lib/typescript/src/gesture/DndGestureHost.d.ts.map +1 -0
  241. package/lib/typescript/src/gesture/gestureConfig.d.ts +15 -0
  242. package/lib/typescript/src/gesture/gestureConfig.d.ts.map +1 -0
  243. package/lib/typescript/src/gesture/gestureGrouping.d.ts +66 -0
  244. package/lib/typescript/src/gesture/gestureGrouping.d.ts.map +1 -0
  245. package/lib/typescript/src/gesture/gestureHost.d.ts +23 -0
  246. package/lib/typescript/src/gesture/gestureHost.d.ts.map +1 -0
  247. package/lib/typescript/src/index.d.ts +38 -0
  248. package/lib/typescript/src/index.d.ts.map +1 -0
  249. package/lib/typescript/src/pointer/dndTarget.d.ts +14 -0
  250. package/lib/typescript/src/pointer/dndTarget.d.ts.map +1 -0
  251. package/lib/typescript/src/pointer/geometry.d.ts +28 -0
  252. package/lib/typescript/src/pointer/geometry.d.ts.map +1 -0
  253. package/lib/typescript/src/pointer/layoutTarget.d.ts +43 -0
  254. package/lib/typescript/src/pointer/layoutTarget.d.ts.map +1 -0
  255. package/lib/typescript/src/pointer/listCellMotion.d.ts +43 -0
  256. package/lib/typescript/src/pointer/listCellMotion.d.ts.map +1 -0
  257. package/lib/typescript/src/pointer/listTarget.d.ts +7 -0
  258. package/lib/typescript/src/pointer/listTarget.d.ts.map +1 -0
  259. package/lib/typescript/src/pointer/motion.d.ts +20 -0
  260. package/lib/typescript/src/pointer/motion.d.ts.map +1 -0
  261. package/lib/typescript/src/runtime/dndPresentation.d.ts +37 -0
  262. package/lib/typescript/src/runtime/dndPresentation.d.ts.map +1 -0
  263. package/lib/typescript/src/runtime/dndRenderStore.d.ts +46 -0
  264. package/lib/typescript/src/runtime/dndRenderStore.d.ts.map +1 -0
  265. package/lib/typescript/src/runtime/dndRuntime.d.ts +138 -0
  266. package/lib/typescript/src/runtime/dndRuntime.d.ts.map +1 -0
  267. package/lib/typescript/src/runtime/dndSettlement.d.ts +18 -0
  268. package/lib/typescript/src/runtime/dndSettlement.d.ts.map +1 -0
  269. package/lib/typescript/src/runtime/gridRuntime.d.ts +54 -0
  270. package/lib/typescript/src/runtime/gridRuntime.d.ts.map +1 -0
  271. package/lib/typescript/src/types.d.ts +180 -0
  272. package/lib/typescript/src/types.d.ts.map +1 -0
  273. package/package.json +136 -0
  274. package/src/adapters/coordinates.ts +181 -0
  275. package/src/adapters/scroll.ts +147 -0
  276. package/src/adapters/virtualizedList.ts +112 -0
  277. package/src/components/DndProvider.tsx +1836 -0
  278. package/src/components/DragHandle.tsx +89 -0
  279. package/src/components/GridController.tsx +213 -0
  280. package/src/components/GridDragHandle.tsx +11 -0
  281. package/src/components/GridZoneView.tsx +57 -0
  282. package/src/components/SortableGrid.tsx +449 -0
  283. package/src/components/SortableList.tsx +1028 -0
  284. package/src/components/dndTypes.ts +102 -0
  285. package/src/components/gridTypes.ts +90 -0
  286. package/src/components/handleViewProps.ts +35 -0
  287. package/src/contracts.ts +149 -0
  288. package/src/controller/approval.ts +179 -0
  289. package/src/controller/coordinatorBase.ts +118 -0
  290. package/src/controller/dndSession.ts +1058 -0
  291. package/src/controller/dndState.ts +198 -0
  292. package/src/controller/gridAdapter.ts +268 -0
  293. package/src/controller/gridState.ts +187 -0
  294. package/src/controller/locations.ts +67 -0
  295. package/src/controller/previewPath.ts +90 -0
  296. package/src/controller/sessionCore.ts +390 -0
  297. package/src/controller/useDndState.ts +26 -0
  298. package/src/controller/useGridState.ts +22 -0
  299. package/src/controller/useStoreState.ts +27 -0
  300. package/src/defaults.ts +4 -0
  301. package/src/diagnostics.ts +23 -0
  302. package/src/engine/gridPlacements.ts +85 -0
  303. package/src/engine/index.ts +99 -0
  304. package/src/engine/layout.ts +29 -0
  305. package/src/engine/layoutMove.ts +401 -0
  306. package/src/engine/layoutState.ts +490 -0
  307. package/src/engine/list.ts +307 -0
  308. package/src/engine/listIndex.ts +174 -0
  309. package/src/engine/move.ts +274 -0
  310. package/src/engine/movementPolicy.ts +151 -0
  311. package/src/engine/orderedTarget.ts +131 -0
  312. package/src/engine/pack.ts +24 -0
  313. package/src/engine/rectangles.ts +18 -0
  314. package/src/engine/sameLayout.ts +50 -0
  315. package/src/engine/search.ts +174 -0
  316. package/src/engine/spatial.ts +36 -0
  317. package/src/engine/spatialAppRotation.ts +53 -0
  318. package/src/engine/spatialExchange.ts +212 -0
  319. package/src/engine/spatialInsertion.ts +157 -0
  320. package/src/engine/spatialPolicy.ts +48 -0
  321. package/src/engine/spatialRotation.ts +56 -0
  322. package/src/engine/validation.ts +358 -0
  323. package/src/gesture/DndGestureGroup.tsx +357 -0
  324. package/src/gesture/DndGestureHost.tsx +50 -0
  325. package/src/gesture/gestureConfig.ts +123 -0
  326. package/src/gesture/gestureGrouping.ts +210 -0
  327. package/src/gesture/gestureHost.tsx +163 -0
  328. package/src/index.ts +162 -0
  329. package/src/pointer/dndTarget.ts +213 -0
  330. package/src/pointer/geometry.ts +584 -0
  331. package/src/pointer/layoutTarget.ts +515 -0
  332. package/src/pointer/listCellMotion.ts +174 -0
  333. package/src/pointer/listTarget.ts +56 -0
  334. package/src/pointer/motion.ts +66 -0
  335. package/src/runtime/dndPresentation.ts +113 -0
  336. package/src/runtime/dndRenderStore.ts +246 -0
  337. package/src/runtime/dndRuntime.ts +311 -0
  338. package/src/runtime/dndSettlement.ts +117 -0
  339. package/src/runtime/gridRuntime.ts +73 -0
  340. package/src/types.ts +189 -0
@@ -0,0 +1,32 @@
1
+ import type { ListLayout } from './list.js';
2
+ /**
3
+ * A detached snapshot shared with UI worklets: rebuild it whenever the layout
4
+ * geometry changes. Numeric columns are typed arrays so each crosses runtimes
5
+ * as one buffer copy, and unchanged columns keep their identity so the runtime
6
+ * serialization cache can reuse them.
7
+ */
8
+ export type ListTargetIndex = {
9
+ readonly revision: number;
10
+ /** Boundary centers in ascending order. */
11
+ readonly thresholds: Float64Array;
12
+ /** `entry.index` of each boundary; a NaN index sorts last as Infinity. */
13
+ readonly entryIndices: Float64Array;
14
+ /** Prefixed item ID → slot in `positions` and `ranks`. */
15
+ readonly slots: Readonly<Record<string, number>>;
16
+ /** Position of the first matching ID in the original layout, by slot. */
17
+ readonly positions: Int32Array;
18
+ /** Boundary rank of the first matching ID, by slot; -1 without a boundary. */
19
+ readonly ranks: Int32Array;
20
+ /** Further boundary ranks of caller-edited duplicate IDs, by prefixed key. */
21
+ readonly additionalRanks?: Readonly<Record<string, readonly number[]>>;
22
+ };
23
+ /**
24
+ * Prepare once on the JS thread, then share this plain data with UI worklets.
25
+ * Original centers retain the active item's footprint; only the returned
26
+ * insertion index excludes it. No references to the mutable layout are kept.
27
+ * Passing the previous index of the same zone reuses its unchanged columns.
28
+ */
29
+ export declare function createListTargetIndex(layout: ListLayout, previous?: ListTargetIndex): ListTargetIndex;
30
+ /** Find an insertion index in O(log n), without allocation or layout scanning. */
31
+ export declare function findListTargetIndex(index: ListTargetIndex, activeItemId: string | null, center: number): number | null;
32
+ //# sourceMappingURL=listIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listIndex.d.ts","sourceRoot":"","sources":["../../../../src/engine/listIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAQ,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC;IAClC,0EAA0E;IAC1E,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CACxE,CAAC;AAgCF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,EAClB,QAAQ,CAAC,EAAE,eAAe,GACzB,eAAe,CAiEjB;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,EACtB,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,CAsCf"}
@@ -0,0 +1,10 @@
1
+ import { type DiagnosticObserver } from '../diagnostics.js';
2
+ import type { MoveInput, MoveResult } from '../types.js';
3
+ /**
4
+ * Compute one atomic candidate from the input snapshot. The engine remembers no
5
+ * earlier preview; the session decides whether that snapshot is the committed
6
+ * value or the latest same-zone preview. Drop permission, pointer geometry,
7
+ * sessions and animation belong to the controller.
8
+ */
9
+ export declare function computeMove<T>(input: MoveInput<T>, onDiagnostic?: DiagnosticObserver): MoveResult<T>;
10
+ //# sourceMappingURL=move.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move.d.ts","sourceRoot":"","sources":["../../../../src/engine/move.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EAGxB,MAAM,mBAAgB,CAAC;AAExB,OAAO,KAAK,EAKV,SAAS,EACT,UAAU,EAGX,MAAM,aAAU,CAAC;AAoBlB;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,YAAY,CAAC,EAAE,kBAAkB,GAChC,UAAU,CAAC,CAAC,CAAC,CAmBf"}
@@ -0,0 +1,34 @@
1
+ import type { ValidationResult } from '../types.js';
2
+ export type GridMoveCandidate = 'row-rotation' | 'insert' | 'exchange';
3
+ /** Declarative configuration shared by the JS engine and UI worklets. */
4
+ export type GridMovementPolicy = {
5
+ /** Full-width exchange items may rotate every item in their vertical corridor. */
6
+ rowRotation?: 'disabled' | 'full-width';
7
+ /** Home compatibility: a one-cell insert item can pull an adjacent exchange item. */
8
+ adjacentInsertExchange?: 'disabled' | 'single-cell';
9
+ /** First applicable rule wins. Rejection never falls through to another rule. */
10
+ candidateOrder?: readonly GridMoveCandidate[];
11
+ pointer?: {
12
+ /** Extra distance beyond half a cell pitch, in [0, 0.5]. Default 0.12. */
13
+ cellHysteresis?: number;
14
+ /** Cell-pitch fraction required when displacing exchange items, in [0.5, 1]. */
15
+ exchangeThreshold?: number;
16
+ /** Zone entry and ordered-slot margin in React Native logical pixels. */
17
+ boundaryHysteresis?: number;
18
+ };
19
+ };
20
+ export type ResolvedGridMovementPolicy = {
21
+ rowRotation: NonNullable<GridMovementPolicy['rowRotation']>;
22
+ adjacentInsertExchange: NonNullable<GridMovementPolicy['adjacentInsertExchange']>;
23
+ candidateOrder: readonly GridMoveCandidate[];
24
+ pointer: Required<NonNullable<GridMovementPolicy['pointer']>>;
25
+ };
26
+ /** Neutral placement rules; caller data and item size never imply home behavior. */
27
+ export declare const DEFAULT_GRID_MOVEMENT_POLICY: ResolvedGridMovementPolicy;
28
+ /** Explicit compatibility with the extracted home grid's reversible movements. */
29
+ export declare const HOME_GRID_MOVEMENT_POLICY: ResolvedGridMovementPolicy;
30
+ /** Copy configuration when starting a session so later caller edits cannot change it. */
31
+ export declare function resolveGridMovementPolicy(policy?: GridMovementPolicy): ResolvedGridMovementPolicy;
32
+ /** Invalid policies reject the complete move before any candidate is computed. */
33
+ export declare function validateGridMovementPolicy(policy: unknown): ValidationResult;
34
+ //# sourceMappingURL=movementPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"movementPolicy.d.ts","sourceRoot":"","sources":["../../../../src/engine/movementPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAU,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEvE,yEAAyE;AACzE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kFAAkF;IAClF,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,qFAAqF;IACrF,sBAAsB,CAAC,EAAE,UAAU,GAAG,aAAa,CAAC;IACpD,iFAAiF;IACjF,cAAc,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC9C,OAAO,CAAC,EAAE;QACR,0EAA0E;QAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,gFAAgF;QAChF,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,yEAAyE;QACzE,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5D,sBAAsB,EAAE,WAAW,CACjC,kBAAkB,CAAC,wBAAwB,CAAC,CAC7C,CAAC;IACF,cAAc,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC7C,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;CAC/D,CAAC;AAQF,oFAAoF;AACpF,eAAO,MAAM,4BAA4B,EAAE,0BAUvC,CAAC;AAEL,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,EAAE,0BAKpC,CAAC;AAEL,yFAAyF;AACzF,wBAAgB,yBAAyB,CACvC,MAAM,CAAC,EAAE,kBAAkB,GAC1B,0BAA0B,CAwB5B;AAMD,kFAAkF;AAClF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,GAAG,gBAAgB,CA0D5E"}
@@ -0,0 +1,32 @@
1
+ import type { CellSpan, ValidationIssue } from '../types.js';
2
+ export type OrderedIndexInput = {
3
+ rows: number;
4
+ columns: number;
5
+ itemSpan: CellSpan;
6
+ /** Target item count after removing the active item for a same-zone move. */
7
+ itemCount: number;
8
+ /** Moving item's center, relative to the target content origin (without padding). */
9
+ center: {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ cellWidth: number;
14
+ cellHeight: number;
15
+ rowGap: number;
16
+ columnGap: number;
17
+ };
18
+ export type OrderedIndexResult = {
19
+ status: 'ok';
20
+ index: number;
21
+ } | {
22
+ status: 'impossible';
23
+ } | {
24
+ status: 'invalid';
25
+ issues: ValidationIssue[];
26
+ };
27
+ /**
28
+ * Raw ordered boundary. The caller first hit-tests the pointer against actual zones,
29
+ * removes the active item, and then applies the same hysteresis for preview and drop.
30
+ */
31
+ export declare function computeOrderedIndex(input: OrderedIndexInput): OrderedIndexResult;
32
+ //# sourceMappingURL=orderedTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderedTarget.d.ts","sourceRoot":"","sources":["../../../../src/engine/orderedTarget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAU,CAAC;AAI1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAErD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,GACvB,kBAAkB,CAsGpB"}
@@ -0,0 +1,3 @@
1
+ import type { PackInput, PackResult } from '../types.js';
2
+ export declare function packItems<T>(input: PackInput<T>): PackResult<T>;
3
+ //# sourceMappingURL=pack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../../src/engine/pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAU,CAAC;AAKtD,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAkB/D"}
@@ -0,0 +1,9 @@
1
+ import type { CellPosition, CellSpan } from '../types.js';
2
+ type CellRectangle = {
3
+ position: CellPosition;
4
+ span: CellSpan;
5
+ };
6
+ /** Internal: rectangles have validated nonnegative anchors and positive spans. */
7
+ export declare function rectanglesOverlap(a: CellRectangle, b: CellRectangle): boolean;
8
+ export {};
9
+ //# sourceMappingURL=rectangles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rectangles.d.ts","sourceRoot":"","sources":["../../../../src/engine/rectangles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAU,CAAC;AAEvD,KAAK,aAAa,GAAG;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEhE,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAY7E"}
@@ -0,0 +1,4 @@
1
+ import type { GridValue } from '../types.js';
2
+ /** Compare validated layouts. Data, responses and spatial array order are not layout. */
3
+ export declare function hasSameLayout<T>(a: GridValue<T>, b: GridValue<T>): boolean;
4
+ //# sourceMappingURL=sameLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sameLayout.d.ts","sourceRoot":"","sources":["../../../../src/engine/sameLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,aAAU,CAAC;AAwCpD,yFAAyF;AACzF,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAQ1E"}
@@ -0,0 +1,28 @@
1
+ import type { CellPosition, GridItem, PositionedItem } from '../types.js';
2
+ export type PlacementSearchResult<T> = {
3
+ status: 'ok';
4
+ placements: PositionedItem<T>[];
5
+ attempts: number;
6
+ } | {
7
+ status: 'impossible' | 'unresolved';
8
+ attempts: number;
9
+ };
10
+ type PlacementSearchProgress<T> = PlacementSearchResult<T> | {
11
+ status: 'pending';
12
+ attempts: number;
13
+ };
14
+ type SearchInput<T> = {
15
+ items: readonly GridItem<T>[];
16
+ fixedItems?: readonly PositionedItem<T>[];
17
+ rows: number;
18
+ columns: number;
19
+ searchBudget: number;
20
+ };
21
+ /** Distance shells, then row/column order. No grid-sized array or sort. */
22
+ export declare function nearestCandidates(maxRow: number, maxCol: number, origin: CellPosition): Generator<CellPosition>;
23
+ /** Internal: inputs are validated by the caller; fixed rectangles never move. */
24
+ export declare function createPlacementSearch<T>({ items, fixedItems, rows, columns, searchBudget, }: SearchInput<T>): {
25
+ advance: (maxAttempts: number) => PlacementSearchProgress<T>;
26
+ };
27
+ export {};
28
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../src/engine/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAU,CAAC;AAIvE,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAC/B;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,MAAM,EAAE,YAAY,GAAG,YAAY,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9D,KAAK,uBAAuB,CAAC,CAAC,IAC5B,qBAAqB,CAAC,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,KAAK,WAAW,CAAC,CAAC,IAAI;IACpB,KAAK,EAAE,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAaF,2EAA2E;AAC3E,wBAAiB,iBAAiB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,GACnB,SAAS,CAAC,YAAY,CAAC,CA8BzB;AAyBD,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EACvC,KAAK,EACL,UAAe,EACf,IAAI,EACJ,OAAO,EACP,YAAY,GACb,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG;IAClB,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,uBAAuB,CAAC,CAAC,CAAC,CAAC;CAC9D,CA2EA"}
@@ -0,0 +1,16 @@
1
+ import type { PositionedItem } from '../types.js';
2
+ import type { GridMovementPolicy } from './movementPolicy.js';
3
+ import type { PlacementSearchResult } from './search.js';
4
+ export type SpatialMoveInput<T> = {
5
+ items: readonly PositionedItem<T>[];
6
+ active: PositionedItem<T>;
7
+ /** Original active item, only when the source and target are the same zone. */
8
+ origin?: PositionedItem<T>;
9
+ rows: number;
10
+ columns: number;
11
+ searchBudget: number;
12
+ movementPolicy?: GridMovementPolicy;
13
+ };
14
+ /** Internal: target input is valid, and items excludes the active item. */
15
+ export declare function resolveSpatialMove<T>(input: SpatialMoveInput<T>): PlacementSearchResult<T>;
16
+ //# sourceMappingURL=spatial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial.d.ts","sourceRoot":"","sources":["../../../../src/engine/spatial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAU,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAU,CAAC;AAMtD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,KAAK,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC1B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC,CAAC;AAEF,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GACzB,qBAAqB,CAAC,CAAC,CAAC,CAY1B"}
@@ -0,0 +1,4 @@
1
+ import type { SpatialMoveInput } from './spatial.js';
2
+ /** Resolve an adjacent app drag through the same move as dragging its widget. */
3
+ export declare function normalizeAppWidgetMove<T>(input: SpatialMoveInput<T>): SpatialMoveInput<T> | null;
4
+ //# sourceMappingURL=spatialAppRotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatialAppRotation.d.ts","sourceRoot":"","sources":["../../../../src/engine/spatialAppRotation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAW,CAAC;AAElD,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GACzB,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CA8C5B"}
@@ -0,0 +1,5 @@
1
+ import { type PlacementSearchResult } from './search.js';
2
+ import type { SpatialMoveInput } from './spatial.js';
3
+ /** Exchange equal regions, preserving whole items and their empty cells. */
4
+ export declare function exchangeSpatialRegions<T>({ items, active, origin, rows, columns, searchBudget, }: SpatialMoveInput<T>): PlacementSearchResult<T>;
5
+ //# sourceMappingURL=spatialExchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatialExchange.d.ts","sourceRoot":"","sources":["../../../../src/engine/spatialExchange.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,aAAU,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAW,CAAC;AA0IlD,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,EACxC,KAAK,EACL,MAAM,EACN,MAAM,EACN,IAAI,EACJ,OAAO,EACP,YAAY,GACb,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CA6DhD"}
@@ -0,0 +1,5 @@
1
+ import type { PositionedItem } from '../types.js';
2
+ import type { PlacementSearchResult } from './search.js';
3
+ import type { SpatialMoveInput } from './spatial.js';
4
+ export declare function insertSpatialItem<T>(input: SpatialMoveInput<T>, colliders: readonly PositionedItem<T>[]): PlacementSearchResult<T>;
5
+ //# sourceMappingURL=spatialInsertion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatialInsertion.d.ts","sourceRoot":"","sources":["../../../../src/engine/spatialInsertion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,cAAc,EAAE,MAAM,aAAU,CAAC;AAGvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAU,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAW,CAAC;AAuIlD,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,SAAS,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,EAAE,GACtC,qBAAqB,CAAC,CAAC,CAAC,CAc1B"}
@@ -0,0 +1,9 @@
1
+ import type { GridMoveCandidate } from './movementPolicy.js';
2
+ import type { SpatialMoveInput } from './spatial.js';
3
+ /** Shared rule selection only: no packing, search, or caller callbacks on the UI thread. */
4
+ export declare function selectSpatialMove<T>(input: SpatialMoveInput<T>): {
5
+ move: SpatialMoveInput<T>;
6
+ kind: GridMoveCandidate | "vacancy" | "blocked";
7
+ colliders: import("./index.js").PositionedItem<T>[];
8
+ };
9
+ //# sourceMappingURL=spatialPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatialPolicy.d.ts","sourceRoot":"","sources":["../../../../src/engine/spatialPolicy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAW,CAAC;AAGlD,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;;;;EAwC9D"}
@@ -0,0 +1,8 @@
1
+ import type { PlacementSearchResult } from './search.js';
2
+ import type { SpatialMoveInput } from './spatial.js';
3
+ /**
4
+ * Move a full-width exchange item through a vertical band, preserving its holes.
5
+ * Null means this movement belongs to another policy; impossible is terminal.
6
+ */
7
+ export declare function rotateSpatialRows<T>({ items, active, origin, columns, }: SpatialMoveInput<T>): PlacementSearchResult<T> | null;
8
+ //# sourceMappingURL=spatialRotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatialRotation.d.ts","sourceRoot":"","sources":["../../../../src/engine/spatialRotation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAU,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAW,CAAC;AAElD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,EACnC,KAAK,EACL,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI,CAyCvD"}
@@ -0,0 +1,9 @@
1
+ import type { CellPosition, CellSpan, GridValue, GridZone, PackInput, ValidationResult } from '../types.js';
2
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
3
+ export declare function isPositiveInteger(value: unknown): value is number;
4
+ export declare function isCellSpan(value: unknown): value is CellSpan;
5
+ export declare function isCellPosition(value: unknown): value is CellPosition;
6
+ export declare function validateZone<T>(zone: GridZone<T>): ValidationResult;
7
+ export declare function validateValue<T>(value: GridValue<T>): ValidationResult;
8
+ export declare function validatePackInput<T>(input: PackInput<T>): ValidationResult;
9
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/engine/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EAET,gBAAgB,EACjB,MAAM,aAAU,CAAC;AAOlB,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEjE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAM5D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAQpE;AA8OD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAInE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,gBAAgB,CA6CtE;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,gBAAgB,CA2B1E"}
@@ -0,0 +1,33 @@
1
+ import type { HostInstance } from 'react-native';
2
+ import { type AnimatedRef, type SharedValue } from 'react-native-reanimated';
3
+ import { type DndMotion, type DndRuntime } from '../runtime/dndRuntime.js';
4
+ import { type GestureGroupProps, type PublishedTargetChannel } from './gestureGrouping.js';
5
+ export type DndGestureRuntime = Pick<DndRuntime, 'motion' | 'token' | 'zones' | 'disabled' | 'rootRef' | 'begin' | 'move' | 'release' | 'dragAxis' | 'activationDelayMs' | 'gestureConfigRevision' | 'frameDriven'> & {
6
+ enabled: SharedValue<boolean>;
7
+ revision: number | SharedValue<number>;
8
+ prepareRelease?(state: DndMotion): void;
9
+ };
10
+ /**
11
+ * UI-thread hit target of one registered handle. The host keeps the object
12
+ * identical while its registration is unchanged, so Worklets reuses the
13
+ * serialized copy when the group's target list is published again.
14
+ */
15
+ export type DndHandleTarget = {
16
+ id: number;
17
+ itemId: string;
18
+ zoneId: string;
19
+ ref: AnimatedRef<HostInstance>;
20
+ sourceRef: AnimatedRef<HostInstance>;
21
+ disabled: boolean;
22
+ };
23
+ /** Delivers a group's hit targets without re-rendering the group. */
24
+ export declare function createTargetChannel(initial: readonly DndHandleTarget[]): PublishedTargetChannel<DndHandleTarget>;
25
+ export type DndGestureGroupProps = GestureGroupProps<DndGestureRuntime, DndHandleTarget>;
26
+ /**
27
+ * One native Pan serves every handle that shares a gesture relation signature.
28
+ * The recognizer belongs to the Provider, so a source cell can leave the
29
+ * virtualized window or remount without touching the active gesture; the hit
30
+ * target list only decides which handle an initial touch may activate.
31
+ */
32
+ export declare function DndGestureGroup({ groupId, relations, channel, runtime, publish, }: DndGestureGroupProps): null;
33
+ //# sourceMappingURL=DndGestureGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DndGestureGroup.d.ts","sourceRoot":"","sources":["../../../../src/gesture/DndGestureGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,0BAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC5B,MAAM,sBAAmB,CAAC;AAE3B,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,UAAU,EACR,QAAQ,GACR,OAAO,GACP,OAAO,GACP,UAAU,GACV,SAAS,GACT,OAAO,GACP,MAAM,GACN,SAAS,GACT,UAAU,GACV,mBAAmB,GACnB,uBAAuB,GACvB,aAAa,CAChB,GAAG;IACF,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,cAAc,CAAC,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAC/B,SAAS,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACrC,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,qEAAqE;AACrE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,sBAAsB,CAAC,eAAe,CAAC,CAEzC;AAED,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAClD,iBAAiB,EACjB,eAAe,CAChB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,SAAS,EACT,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE,oBAAoB,QA6QtB"}
@@ -0,0 +1,12 @@
1
+ import { type DndGestureRuntime, type DndHandleTarget } from './DndGestureGroup.js';
2
+ import type { DndHandleRegistration } from '../runtime/dndRuntime.js';
3
+ import { type GestureGroupSnapshot, type GestureOwner, type GestureRegistry, type GroupingState } from './gestureGrouping.js';
4
+ /** Handle mounts update their native owners without rendering the Provider. */
5
+ export declare function createDndGestureRegistry(): GestureRegistry<DndHandleRegistration>;
6
+ export type DndGestureRegistry = GestureRegistry<DndHandleRegistration>;
7
+ /** Groups the published owners by gesture relation signature; see `groupGestureOwners`. */
8
+ export declare function groupGestureOwners(owners: readonly GestureOwner<DndHandleRegistration>[], state: GroupingState<DndHandleRegistration, DndHandleTarget>): readonly GestureGroupSnapshot<DndHandleTarget>[];
9
+ export declare const DndGestureHost: ({ children, registry, runtime, }: import("./gestureHost.js").GestureHostProps<DndHandleRegistration, DndGestureRuntime> & {
10
+ children: import("react").ReactElement;
11
+ }) => import("react").JSX.Element;
12
+ //# sourceMappingURL=DndGestureHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DndGestureHost.d.ts","sourceRoot":"","sources":["../../../../src/gesture/DndGestureHost.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,sBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAAuB,CAAC;AACnE,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,sBAAmB,CAAC;AAiB3B,+EAA+E;AAC/E,wBAAgB,wBAAwB,IAAI,eAAe,CAAC,qBAAqB,CAAC,CAEjF;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC;AAExE,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,YAAY,CAAC,qBAAqB,CAAC,EAAE,EACtD,KAAK,EAAE,aAAa,CAAC,qBAAqB,EAAE,eAAe,CAAC,GAC3D,SAAS,oBAAoB,CAAC,eAAe,CAAC,EAAE,CAElD;AAED,eAAO,MAAM,cAAc;;iCAIyB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { GestureRelations } from '../components/gridTypes.js';
2
+ import type { ValidationIssue } from '../types.js';
3
+ type GestureRelationResult = {
4
+ valid: true;
5
+ relations: GestureRelations | undefined;
6
+ } | {
7
+ valid: false;
8
+ issues: ValidationIssue[];
9
+ };
10
+ /** Element-wise equality of the three relation lists; a single gesture equals a one-element list. */
11
+ export declare function sameGestureRelations(first: GestureRelations | undefined, second: GestureRelations | undefined): boolean;
12
+ /** Attachment to an actual detector still requires device validation by the caller. */
13
+ export declare function validateGestureRelations(value: unknown): GestureRelationResult;
14
+ export {};
15
+ //# sourceMappingURL=gestureConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gestureConfig.d.ts","sourceRoot":"","sources":["../../../../src/gesture/gestureConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAU,CAAC;AAEhD,KAAK,qBAAqB,GACtB;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,gBAAgB,GAAG,SAAS,CAAA;CAAE,GACxD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AA2ChD,qGAAqG;AACrG,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,gBAAgB,GAAG,SAAS,EACnC,MAAM,EAAE,gBAAgB,GAAG,SAAS,GACnC,OAAO,CAaT;AAED,uFAAuF;AACvF,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,GACb,qBAAqB,CAoDvB"}
@@ -0,0 +1,66 @@
1
+ import type { PanGesture } from 'react-native-gesture-handler';
2
+ import type { GestureRelations } from '../components/gridTypes.js';
3
+ /** One registered handle as the gesture host sees it. */
4
+ export type GestureOwner<Registration> = {
5
+ id: number;
6
+ registration: Registration;
7
+ };
8
+ export type GestureRegistry<Registration> = {
9
+ getSnapshot(): readonly GestureOwner<Registration>[];
10
+ subscribe(listener: () => void): () => void;
11
+ setOwners(next: readonly GestureOwner<Registration>[]): void;
12
+ };
13
+ /** Handle mounts update their native owners without rendering the controller. */
14
+ export declare function createGestureRegistry<Registration>(): GestureRegistry<Registration>;
15
+ /**
16
+ * Delivers a group's hit targets without re-rendering the group. A re-render
17
+ * would make Reanimated and Gesture Handler rebuild and re-register the native
18
+ * event handler, which costs a serialization of every callback closure.
19
+ */
20
+ export type TargetChannel<Target> = {
21
+ readonly targets: readonly Target[];
22
+ subscribe(listener: (targets: readonly Target[]) => void): () => void;
23
+ };
24
+ export type PublishedTargetChannel<Target> = TargetChannel<Target> & {
25
+ set(targets: readonly Target[]): void;
26
+ };
27
+ export declare function createTargetChannel<Target>(initial: readonly Target[]): PublishedTargetChannel<Target>;
28
+ /** Props of one shared-recognizer component rendered by a gesture host. */
29
+ export type GestureGroupProps<Runtime, Target> = {
30
+ groupId: number;
31
+ relations: GestureRelations | undefined;
32
+ channel: TargetChannel<Target>;
33
+ runtime: Runtime;
34
+ publish(groupId: number, gesture: PanGesture | null): void;
35
+ };
36
+ /** Handles sharing one relation signature share one native recognizer. */
37
+ export type GestureGroupSnapshot<Target> = {
38
+ groupId: number;
39
+ relations: GestureRelations | undefined;
40
+ targets: readonly Target[];
41
+ /** Stable per group; the group element never re-renders for target changes. */
42
+ channel: PublishedTargetChannel<Target>;
43
+ };
44
+ export type GroupingState<Registration, Target> = {
45
+ targets: Map<number, {
46
+ registration: Registration;
47
+ target: Target;
48
+ }>;
49
+ signatures: Array<{
50
+ relations: GestureRelations | undefined;
51
+ groupId: number;
52
+ }>;
53
+ nextGroupId: number;
54
+ groups: readonly GestureGroupSnapshot<Target>[];
55
+ };
56
+ export declare function createGroupingState<Registration, Target>(): GroupingState<Registration, Target>;
57
+ /**
58
+ * Groups the published owners by gesture relation signature. Target objects
59
+ * stay identical while their registration is unchanged and a group's target
60
+ * array stays identical while its content is unchanged, so an unchanged group
61
+ * publishes nothing to the UI runtime.
62
+ */
63
+ export declare function groupGestureOwners<Registration extends {
64
+ gestureRelations?: GestureRelations;
65
+ }, Target>(owners: readonly GestureOwner<Registration>[], state: GroupingState<Registration, Target>, toTarget: (owner: GestureOwner<Registration>) => Target): readonly GestureGroupSnapshot<Target>[];
66
+ //# sourceMappingURL=gestureGrouping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gestureGrouping.d.ts","sourceRoot":"","sources":["../../../../src/gesture/gestureGrouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAAyB,CAAC;AAEhE,yDAAyD;AACzD,MAAM,MAAM,YAAY,CAAC,YAAY,IAAI;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,YAAY,IAAI;IAC1C,WAAW,IAAI,SAAS,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;IACrD,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,SAAS,CAAC,IAAI,EAAE,SAAS,YAAY,CAAC,YAAY,CAAC,EAAE,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AAE,MAAM,IAAI;IAChD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrE,UAAU,EAAE,KAAK,CAAC;QAChB,SAAS,EAAE,gBAAgB,GAAG,SAAS,CAAC;QACxC,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;CACjD,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,KAAK,aAAa,CACxE,YAAY,EACZ,MAAM,CACP,CAEA;AAYD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,SAAS;IAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CAAE,EAC5D,MAAM,EAEN,MAAM,EAAE,SAAS,YAAY,CAAC,YAAY,CAAC,EAAE,EAC7C,KAAK,EAAE,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC,EAC1C,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,YAAY,CAAC,KAAK,MAAM,GACtD,SAAS,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAkEzC"}
@@ -0,0 +1,23 @@
1
+ import { type ComponentType, type ReactElement } from 'react';
2
+ import { type GestureGroupProps, type GestureOwner, type GestureRegistry } from './gestureGrouping.js';
3
+ import type { GestureRelations } from '../components/gridTypes.js';
4
+ export type GestureHostProps<Registration, Runtime> = {
5
+ registry: GestureRegistry<Registration>;
6
+ runtime: Runtime;
7
+ };
8
+ /**
9
+ * Builds a host that owns one native recognizer per gesture relation
10
+ * signature. Handle mounts publish through the registry; the host groups them,
11
+ * renders one `Group` per signature and composes their recognizers on a single
12
+ * detector around the root content. Root content updates never render the
13
+ * detector or the groups.
14
+ */
15
+ export declare function createGestureHost<Registration extends {
16
+ gestureRelations?: GestureRelations;
17
+ }, Target, Runtime>({ Group, toTarget, }: {
18
+ Group: ComponentType<GestureGroupProps<Runtime, Target>>;
19
+ toTarget(owner: GestureOwner<Registration>): Target;
20
+ }): ({ children, registry, runtime, }: GestureHostProps<Registration, Runtime> & {
21
+ children: ReactElement;
22
+ }) => import("react").JSX.Element;
23
+ //# sourceMappingURL=gestureHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gestureHost.d.ts","sourceRoot":"","sources":["../../../../src/gesture/gestureHost.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AASf,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,sBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAAyB,CAAC;AAEhE,MAAM,MAAM,gBAAgB,CAAC,YAAY,EAAE,OAAO,IAAI;IACpD,QAAQ,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IACxC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AASF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,SAAS;IAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CAAE,EAC5D,MAAM,EACN,OAAO,EACP,EACA,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;CACrD,IA4FsB,kCAIlB,gBAAgB,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,iCAOxE"}
@@ -0,0 +1,38 @@
1
+ export { GridController } from './components/GridController.js';
2
+ export { DndProvider } from './components/DndProvider.js';
3
+ export { SortableList } from './components/SortableList.js';
4
+ export { SortableGrid } from './components/SortableGrid.js';
5
+ export { resolveListVirtualization } from './adapters/virtualizedList.js';
6
+ export type { ListVirtualizationOptions, ListVirtualizationResult, } from './adapters/virtualizedList.js';
7
+ export { DragHandle } from './components/DragHandle.js';
8
+ export type { DndProviderHandle, DndProviderProps, SortableListProps, SortableGridProps, GridItemRenderArgs, DragHandleProps, DragHandleViewProps, ListItemRenderArgs, DndPreviewArgs, DndMotionConfig, } from './components/dndTypes.js';
9
+ export { useDndState } from './controller/useDndState.js';
10
+ export type { DndState } from './controller/useDndState.js';
11
+ export { createDndStateStore, respondToDndProposal, } from './controller/dndState.js';
12
+ export type { DndValue, DndProposal, DndProposalResult, DndStateStore, DndStateUpdate, } from './controller/dndState.js';
13
+ export type { DndCancelReason, DndDragEndEvent, DndDropFailureReason, GridItemLayoutResolverArgs, } from './controller/dndSession.js';
14
+ export { computeListLayout, computeListIndex, ListSizeCache, } from './engine/list.js';
15
+ export type { ListLayout, ListLayoutEntry, ListLayoutInput, ListLayoutResult, ListMeasurementContext, } from './engine/list.js';
16
+ export { computeLayoutMove } from './engine/layoutMove.js';
17
+ export type { GridItemLayout, LayoutMoveInput, LayoutMoveResult, } from './engine/layoutMove.js';
18
+ export { computeAutoScroll, constrainDragPoint, validateAutoScrollOptions, } from './adapters/scroll.js';
19
+ export type { AutoScrollInput, AutoScrollOptions, AutoScrollOptionsValidationResult, AutoScrollResult, DragAxis, } from './adapters/scroll.js';
20
+ export { GridDragHandle } from './components/GridDragHandle.js';
21
+ export { GridZoneView } from './components/GridZoneView.js';
22
+ export { useGridState } from './controller/useGridState.js';
23
+ export type { GridState } from './controller/useGridState.js';
24
+ export { createGridStateStore, respondToGridProposal, } from './controller/gridState.js';
25
+ export type { GridStateStore, GridStateUpdate, GridProposalResult, } from './controller/gridState.js';
26
+ export type { GridMotionConfig } from './pointer/motion.js';
27
+ export type { HandleViewProps } from './components/handleViewProps.js';
28
+ export { DEFAULT_ACTIVATION_DELAY_MS, DEFAULT_SEARCH_BUDGET } from './defaults.js';
29
+ export { DEFAULT_GRID_MOVEMENT_POLICY, HOME_GRID_MOVEMENT_POLICY, resolveGridMovementPolicy, validateGridMovementPolicy, } from './engine/movementPolicy.js';
30
+ export type { GridMoveCandidate, GridMovementPolicy, ResolvedGridMovementPolicy, } from './engine/movementPolicy.js';
31
+ export type * from './contracts.js';
32
+ export { validateLayoutState, fromGridValue, toGridValue, } from './engine/layoutState.js';
33
+ export { screenToContent, contentToScreen, screenRectToContent, contentRectToScreen, validateRectMeasurement, } from './adapters/coordinates.js';
34
+ export type { DragPreviewArgs, GestureRelations, GridControllerHandle, GridControllerProps, GridDragHandleProps, GridInsets, GridZoneViewProps, ItemRenderArgs, ZoneGeometry, } from './components/gridTypes.js';
35
+ export type { OrderedIndexInput, OrderedIndexResult } from './engine/index.js';
36
+ export { computeMove, computeOrderedIndex, computeZoneLayout, hasSameLayout, packItems, validateValue, } from './engine/index.js';
37
+ export type { CancelReason, CanDropArgs, CellPosition, CellSpan, CleanupReason, DragEndEvent, DragStartEvent, DropDecision, GridChange, GridDiagnosticEvent, GridItem, GridProposal, GridValue, GridZone, ItemLocation, ItemPlacement, MoveInput, MoveResult, OrderedZone, PackInput, PackResult, PositionedItem, RevisionedGridValue, ProposalInterruptReason, SpatialZone, ValidationCode, ValidationIssue, ValidationResult, ZoneLayoutResult, } from './types.js';
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA2B,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA4B,CAAC;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ACZ,UAAU,EACV,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { LayoutLocation } from '../contracts.js';
2
+ import type { GridItemLayout } from '../engine/layoutMove.js';
3
+ import type { GridMovementPolicy } from '../engine/movementPolicy.js';
4
+ import type { DndMotion, UiZoneRegistration } from '../runtime/dndRuntime.js';
5
+ export type DndTargetSession = {
6
+ token: number;
7
+ policyRevision: number;
8
+ gridItems: Record<string, GridItemLayout>;
9
+ movementPolicy?: GridMovementPolicy;
10
+ };
11
+ export declare function sameLayoutTarget(a: LayoutLocation | null, b: LayoutLocation | null): boolean;
12
+ /** Prepared geometry only; policy permission and final validation stay on JS. */
13
+ export declare function uiLayoutTarget(state: DndMotion, registrations: readonly UiZoneRegistration[], session: DndTargetSession, previousTarget: LayoutLocation | null): LayoutLocation | null;
14
+ //# sourceMappingURL=dndTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dndTarget.d.ts","sourceRoot":"","sources":["../../../../src/pointer/dndTarget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAc,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,0BAAuB,CAAC;AAW3E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC1C,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,cAAc,GAAG,IAAI,EACxB,CAAC,EAAE,cAAc,GAAG,IAAI,GACvB,OAAO,CAST;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,SAAS,kBAAkB,EAAE,EAC5C,OAAO,EAAE,gBAAgB,EACzB,cAAc,EAAE,cAAc,GAAG,IAAI,GACpC,cAAc,GAAG,IAAI,CA0KvB"}
@@ -0,0 +1,28 @@
1
+ import type { CellPosition, CellSpan, GridZone, ItemLocation } from '../types.js';
2
+ import type { CellGeometry, MeasuredZone, UiMotion, WindowRect } from '../runtime/gridRuntime.js';
3
+ import type { ZoneGeometry } from '../components/gridTypes.js';
4
+ /**
5
+ * The cell an ordered slot starts at. The engine owns the same arithmetic in
6
+ * `slotPosition`; that module stays free of worklet directives, so the pointer
7
+ * keeps a worklet copy and `tests/pointer/orderedSlots.test.ts` pins them
8
+ * together.
9
+ */
10
+ export declare function orderedSlotPosition(index: number, itemSpan: CellSpan, columns: number): CellPosition;
11
+ /** The ordered slot a cell starts, or null when it is not a slot origin. */
12
+ export declare function orderedSlotIndex(position: CellPosition, itemSpan: CellSpan, columns: number): number | null;
13
+ export declare function isUsableRect(rect: WindowRect | null): rect is WindowRect;
14
+ export declare function rectContains(rect: WindowRect, x: number, y: number): boolean;
15
+ export declare function getCellGeometry(zone: Pick<GridZone<unknown>, 'rows' | 'columns'>, geometry: ZoneGeometry, width: number, height: number, pixelRatio?: number): CellGeometry | null;
16
+ /** Item rectangle relative to its zone, including the zone's content padding. */
17
+ export declare function itemRect(position: CellPosition, span: CellSpan, geometry: ZoneGeometry, cells: CellGeometry): WindowRect;
18
+ /** Check the resolved placement, which a region exchange may shift from the pointer target. */
19
+ export declare function isPlacementVisible(zones: readonly MeasuredZone[], outlet: WindowRect, target: ItemLocation, span: CellSpan): boolean;
20
+ export declare function sameTarget(left: ItemLocation | null, right: ItemLocation | null): boolean;
21
+ export declare function sourceItemTarget(measured: MeasuredZone, itemId: string): ItemLocation | null;
22
+ /** Worklet equivalent of computeOrderedIndex for already validated measured zones. */
23
+ export declare function orderedIndexForCenter(measured: MeasuredZone, itemId: string | null, centerX: number, centerY: number): number | null;
24
+ type PointerTarget = Pick<UiMotion, 'target' | 'x' | 'y' | 'width' | 'height'>;
25
+ /** Preview movement and release use this same hysteresis-adjusted logical target. */
26
+ export declare function readPointerTarget(current: UiMotion, absoluteX: number, absoluteY: number): PointerTarget;
27
+ export {};
28
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../src/pointer/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,YAAY,EAEb,MAAM,aAAU,CAAC;AAIlB,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,UAAU,EACX,MAAM,2BAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAAyB,CAAC;AAO5D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GACd,YAAY,CAOd;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,IAAI,CAcf;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,IAAI,UAAU,CAWxE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,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