@ankhorage/zora 25.6.2 → 25.8.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 (295) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/dist/capabilities/index.js +13 -1
  4. package/dist/capabilities/index.js.map +5 -4
  5. package/dist/features/grid-interactions/adapters/inbound/GridInteractions.d.ts +5 -0
  6. package/dist/features/grid-interactions/adapters/inbound/GridInteractions.d.ts.map +1 -0
  7. package/dist/features/grid-interactions/adapters/inbound/GridInteractions.js +40 -0
  8. package/dist/features/grid-interactions/adapters/inbound/GridInteractions.js.map +1 -0
  9. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.d.ts +2 -0
  10. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.d.ts.map +1 -0
  11. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.js +2 -0
  12. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.js.map +1 -0
  13. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.native.d.ts +11 -0
  14. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.native.d.ts.map +1 -0
  15. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.native.js +5 -0
  16. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.native.js.map +1 -0
  17. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.web.d.ts +11 -0
  18. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.web.d.ts.map +1 -0
  19. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.web.js +20 -0
  20. package/dist/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.web.js.map +1 -0
  21. package/dist/features/grid-interactions/adapters/inbound/createGridInteractionsPointerQueue.d.ts +17 -0
  22. package/dist/features/grid-interactions/adapters/inbound/createGridInteractionsPointerQueue.d.ts.map +1 -0
  23. package/dist/features/grid-interactions/adapters/inbound/createGridInteractionsPointerQueue.js +76 -0
  24. package/dist/features/grid-interactions/adapters/inbound/createGridInteractionsPointerQueue.js.map +1 -0
  25. package/dist/features/grid-interactions/adapters/inbound/resolveGridInteractionPointer.d.ts +21 -0
  26. package/dist/features/grid-interactions/adapters/inbound/resolveGridInteractionPointer.d.ts.map +1 -0
  27. package/dist/features/grid-interactions/adapters/inbound/resolveGridInteractionPointer.js +20 -0
  28. package/dist/features/grid-interactions/adapters/inbound/resolveGridInteractionPointer.js.map +1 -0
  29. package/dist/features/grid-interactions/application/createGridInteractionsController.d.ts +4 -0
  30. package/dist/features/grid-interactions/application/createGridInteractionsController.d.ts.map +1 -0
  31. package/dist/features/grid-interactions/application/createGridInteractionsController.js +191 -0
  32. package/dist/features/grid-interactions/application/createGridInteractionsController.js.map +1 -0
  33. package/dist/features/grid-interactions/meta.d.ts +11 -0
  34. package/dist/features/grid-interactions/meta.d.ts.map +1 -0
  35. package/dist/features/grid-interactions/meta.js +11 -0
  36. package/dist/features/grid-interactions/meta.js.map +1 -0
  37. package/dist/features/grid-interactions/public.d.ts +4 -0
  38. package/dist/features/grid-interactions/public.d.ts.map +1 -0
  39. package/dist/features/grid-interactions/public.js +3 -0
  40. package/dist/features/grid-interactions/public.js.map +1 -0
  41. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.d.ts.map +1 -1
  42. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.js +73 -19
  43. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.js.map +1 -1
  44. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.d.ts +9 -0
  45. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.d.ts.map +1 -0
  46. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.js +5 -0
  47. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.js.map +1 -0
  48. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.native.d.ts +9 -0
  49. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.native.d.ts.map +1 -0
  50. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.native.js +5 -0
  51. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.native.js.map +1 -0
  52. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.web.d.ts +9 -0
  53. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.web.d.ts.map +1 -0
  54. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.web.js +28 -0
  55. package/dist/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.web.js.map +1 -0
  56. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.d.ts +14 -0
  57. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.d.ts.map +1 -0
  58. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.js +50 -0
  59. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.js.map +1 -0
  60. package/dist/features/matrix-grid/application/createMatrixGridSparseIndex.d.ts +18 -0
  61. package/dist/features/matrix-grid/application/createMatrixGridSparseIndex.d.ts.map +1 -0
  62. package/dist/features/matrix-grid/application/createMatrixGridSparseIndex.js +56 -0
  63. package/dist/features/matrix-grid/application/createMatrixGridSparseIndex.js.map +1 -0
  64. package/dist/features/matrix-grid/application/getMatrixGridNextFocusId.d.ts +4 -0
  65. package/dist/features/matrix-grid/application/getMatrixGridNextFocusId.d.ts.map +1 -0
  66. package/dist/features/matrix-grid/application/getMatrixGridNextFocusId.js +65 -0
  67. package/dist/features/matrix-grid/application/getMatrixGridNextFocusId.js.map +1 -0
  68. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.d.ts +8 -1
  69. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.d.ts.map +1 -1
  70. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.js +15 -4
  71. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.js.map +1 -1
  72. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.d.ts.map +1 -1
  73. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js +2 -0
  74. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js.map +1 -1
  75. package/dist/features/registry/componentMeta.d.ts.map +1 -1
  76. package/dist/features/registry/componentMeta.js +2 -0
  77. package/dist/features/registry/componentMeta.js.map +1 -1
  78. package/dist/index.d.ts +1 -0
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +1 -0
  81. package/dist/index.js.map +1 -1
  82. package/dist/types/grid-interactions.d.ts +58 -0
  83. package/dist/types/grid-interactions.d.ts.map +1 -0
  84. package/dist/types/grid-interactions.js +2 -0
  85. package/dist/types/grid-interactions.js.map +1 -0
  86. package/dist/types/matrix-grid.d.ts +2 -0
  87. package/dist/types/matrix-grid.d.ts.map +1 -1
  88. package/dist/types/matrix-grid.js.map +1 -1
  89. package/package.json +5 -5
  90. package/src/features/grid-interactions/adapters/inbound/GridInteractions.test.tsx +143 -0
  91. package/src/features/grid-interactions/adapters/inbound/GridInteractions.tsx +79 -0
  92. package/src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.native.tsx +14 -0
  93. package/src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.tsx +1 -0
  94. package/src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.web.tsx +41 -0
  95. package/src/features/grid-interactions/adapters/inbound/createGridInteractionsPointerQueue.test.ts +98 -0
  96. package/src/features/grid-interactions/adapters/inbound/createGridInteractionsPointerQueue.ts +94 -0
  97. package/src/features/grid-interactions/adapters/inbound/resolveGridInteractionPointer.test.ts +33 -0
  98. package/src/features/grid-interactions/adapters/inbound/resolveGridInteractionPointer.ts +45 -0
  99. package/src/features/grid-interactions/application/createGridInteractionsController.test.ts +115 -0
  100. package/src/features/grid-interactions/application/createGridInteractionsController.ts +231 -0
  101. package/src/features/grid-interactions/meta.ts +12 -0
  102. package/src/features/grid-interactions/public.ts +11 -0
  103. package/src/features/matrix-grid/adapters/inbound/MatrixGrid.test.tsx +280 -2
  104. package/src/features/matrix-grid/adapters/inbound/MatrixGrid.tsx +121 -31
  105. package/src/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.native.tsx +11 -0
  106. package/src/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.tsx +11 -0
  107. package/src/features/matrix-grid/adapters/inbound/MatrixGridKeyboardProxy.web.tsx +43 -0
  108. package/src/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.ts +70 -0
  109. package/src/features/matrix-grid/application/createMatrixGridSparseIndex.test.ts +35 -0
  110. package/src/features/matrix-grid/application/createMatrixGridSparseIndex.ts +105 -0
  111. package/src/features/matrix-grid/application/getMatrixGridNextFocusId.test.ts +93 -0
  112. package/src/features/matrix-grid/application/getMatrixGridNextFocusId.ts +112 -0
  113. package/src/features/matrix-grid/application/resolveMatrixGridSelection.test.ts +63 -2
  114. package/src/features/matrix-grid/application/resolveMatrixGridSelection.ts +27 -4
  115. package/src/features/registry/ZORA_COMPONENT_REGISTRY.ts +2 -0
  116. package/src/features/registry/componentMeta.ts +2 -0
  117. package/src/index.ts +11 -0
  118. package/src/types/grid-interactions.ts +72 -0
  119. package/src/types/matrix-grid.ts +2 -0
  120. package/web-dist/chunks/{Accordion-5g05kfmx.js → Accordion-0q2wzjdd.js} +4 -4
  121. package/web-dist/chunks/{Accordion-b96evb46.js → Accordion-1fsrnq73.js} +1 -1
  122. package/web-dist/chunks/{Accordion-h3y8qev2.js → Accordion-38ts3gnn.js} +2 -2
  123. package/web-dist/chunks/{Accordion-jnc315h7.js → Accordion-8pkw32q9.js} +2 -2
  124. package/web-dist/chunks/{Accordion-h7zsx9eg.js → Accordion-9jrxktne.js} +3 -3
  125. package/web-dist/chunks/{Accordion-9w8wg9mf.js → Accordion-9rnsg9pk.js} +1 -1
  126. package/web-dist/chunks/{Accordion-4zqd7twp.js → Accordion-9ygakvwk.js} +5 -5
  127. package/web-dist/chunks/{Accordion-fhnazn3n.js → Accordion-b74j4hdt.js} +1 -1
  128. package/web-dist/chunks/{Accordion-nssr5gep.js → Accordion-c50pywj3.js} +2 -2
  129. package/web-dist/chunks/{Accordion-pvj5npzc.js → Accordion-ddrn94v3.js} +3 -3
  130. package/web-dist/chunks/{Accordion-090y18cv.js → Accordion-dk0dtyc0.js} +3 -3
  131. package/web-dist/chunks/{Accordion-59pa0677.js → Accordion-fcczvwgg.js} +0 -1
  132. package/web-dist/chunks/{Accordion-sp4k08kw.js → Accordion-geah5s4f.js} +4 -4
  133. package/web-dist/chunks/{Accordion-6rrqpb2h.js → Accordion-h4ekm5cp.js} +2 -2
  134. package/web-dist/chunks/{Accordion-3d4wkzg7.js → Accordion-hecpczme.js} +5 -5
  135. package/web-dist/chunks/{Accordion-a6551mh4.js → Accordion-hn43wt45.js} +1 -1
  136. package/web-dist/chunks/{Accordion-sw7ep29d.js → Accordion-hnx7hx55.js} +2 -2
  137. package/web-dist/chunks/{Accordion-rsvphbe4.js → Accordion-j1chy29e.js} +1 -1
  138. package/web-dist/chunks/{Accordion-ewf1zen9.js → Accordion-k9cxpg08.js} +5 -5
  139. package/web-dist/chunks/{Accordion-5df6cgyf.js → Accordion-md1g54wg.js} +1 -1
  140. package/web-dist/chunks/{Accordion-kjtcbe09.js → Accordion-p1ebrt17.js} +3 -3
  141. package/web-dist/chunks/{Accordion-qn398m1x.js → Accordion-r2g18vxa.js} +1 -1
  142. package/web-dist/chunks/{Accordion-zt9yghdz.js → Accordion-rctfgyfv.js} +4 -4
  143. package/web-dist/chunks/{Accordion-88t8fgxv.js → Accordion-rfc5mdbv.js} +1 -1
  144. package/web-dist/chunks/{Accordion-fmzxat3v.js → Accordion-sdnzqktc.js} +4 -4
  145. package/web-dist/chunks/{Accordion-v0grdh6q.js → Accordion-sq7ya2ye.js} +2 -2
  146. package/web-dist/chunks/{Accordion-ejx5gcf9.js → Accordion-t5scffdr.js} +9 -9
  147. package/web-dist/chunks/{Accordion-sy1cc5my.js → Accordion-ts788t7b.js} +3 -3
  148. package/web-dist/chunks/{Accordion-4s68t3h7.js → Accordion-v3rzy273.js} +6 -6
  149. package/web-dist/chunks/{Accordion-7tjz25jh.js → Accordion-vbzjq3z8.js} +1 -1
  150. package/web-dist/chunks/{Accordion-jh72azm2.js → Accordion-vg337250.js} +2 -2
  151. package/web-dist/chunks/{Accordion-42jfy1a1.js → Accordion-vj1m2wck.js} +1 -1
  152. package/web-dist/chunks/{Accordion-tqpsmdrk.js → Accordion-vxg5sw01.js} +4 -4
  153. package/web-dist/chunks/{Accordion-61ntvh14.js → Accordion-w59y0jdf.js} +4 -4
  154. package/web-dist/chunks/{Accordion-fjxcn6g9.js → Accordion-wcmrasqx.js} +8 -8
  155. package/web-dist/chunks/{Accordion-r1cj2w9e.js → Accordion-wpk8dxqp.js} +3 -3
  156. package/web-dist/chunks/{Accordion-w6qedeba.js → Accordion-x055n3b3.js} +1 -1
  157. package/web-dist/chunks/{Accordion-dbf93gxh.js → Accordion-xcm1qc39.js} +1 -1
  158. package/web-dist/chunks/{Accordion-7kq500r1.js → Accordion-xgxxg1hz.js} +1 -1
  159. package/web-dist/chunks/{Accordion-a4cma5b6.js → Accordion-y3083394.js} +3 -3
  160. package/web-dist/chunks/{Accordion-40tenzcg.js → Accordion-yexfbrzg.js} +4 -4
  161. package/web-dist/chunks/{Accordion-2r0gqk3x.js → Accordion-ztw7zp6v.js} +5 -5
  162. package/web-dist/chunks/{Accordion-bz04casa.js → Accordion-zypyr9xw.js} +211 -6
  163. package/web-dist/components/accordion/Accordion.js +5 -5
  164. package/web-dist/components/accordion-item/AccordionItem.js +5 -5
  165. package/web-dist/components/activity-indicator/ActivityIndicator.js +1 -1
  166. package/web-dist/components/app-bar/AppBar.js +7 -7
  167. package/web-dist/components/app-header/AppHeader.js +7 -7
  168. package/web-dist/components/app-shell/AppShell.js +2 -2
  169. package/web-dist/components/auth-screen/AuthScreen.js +10 -10
  170. package/web-dist/components/avatar/Avatar.js +5 -5
  171. package/web-dist/components/avatar-group/AvatarGroup.js +5 -5
  172. package/web-dist/components/badge/Badge.js +2 -2
  173. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +10 -10
  174. package/web-dist/components/bottom-sheet/BottomSheet.js +3 -3
  175. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +3 -3
  176. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +3 -3
  177. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +3 -3
  178. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +3 -3
  179. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +3 -3
  180. package/web-dist/components/breadcrumbs/Breadcrumbs.js +5 -5
  181. package/web-dist/components/button/Button.js +3 -3
  182. package/web-dist/components/button-group/ButtonGroup.js +3 -3
  183. package/web-dist/components/camera-permission-view/CameraPermissionView.js +10 -10
  184. package/web-dist/components/card/Card.js +9 -9
  185. package/web-dist/components/card-back/CardBack.js +2 -2
  186. package/web-dist/components/card-hand/CardHand.js +2 -2
  187. package/web-dist/components/chat-list-item/ChatListItem.js +7 -7
  188. package/web-dist/components/checkbox/Checkbox.js +4 -4
  189. package/web-dist/components/checkbox-group/CheckboxGroup.js +4 -4
  190. package/web-dist/components/chess-board/ChessBoard.js +2 -2
  191. package/web-dist/components/chip/Chip.js +5 -5
  192. package/web-dist/components/chip-group/ChipGroup.js +5 -5
  193. package/web-dist/components/collection-editor/CollectionEditor.js +9 -9
  194. package/web-dist/components/content-rail/ContentRail.js +4 -4
  195. package/web-dist/components/data-table/DataTable.js +14 -14
  196. package/web-dist/components/date-picker/DatePicker.js +5 -5
  197. package/web-dist/components/dialog/Dialog.js +4 -4
  198. package/web-dist/components/divider/Divider.js +2 -2
  199. package/web-dist/components/empty-state/EmptyState.js +10 -10
  200. package/web-dist/components/explorer/Explorer.js +7 -7
  201. package/web-dist/components/field/Field.js +4 -4
  202. package/web-dist/components/file-explorer/FileExplorer.js +7 -7
  203. package/web-dist/components/flat-list/FlatList.js +5 -5
  204. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +10 -10
  205. package/web-dist/components/form/Form.js +6 -6
  206. package/web-dist/components/form-actions/FormActions.js +6 -6
  207. package/web-dist/components/form-error/FormError.js +6 -6
  208. package/web-dist/components/game/Game.js +3 -3
  209. package/web-dist/components/game-entity/GameEntity.js +3 -3
  210. package/web-dist/components/game-field/GameField.js +3 -3
  211. package/web-dist/components/game-input-zone/GameInputZone.js +3 -3
  212. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +3 -3
  213. package/web-dist/components/game-overlay/GameOverlay.js +3 -3
  214. package/web-dist/components/gradient/Gradient.js +3 -3
  215. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +3 -3
  216. package/web-dist/components/graph-view/GraphView.js +2 -2
  217. package/web-dist/components/grid/Grid.js +2 -2
  218. package/web-dist/components/grid-interactions/GridInteractions.d.ts +3 -0
  219. package/web-dist/components/grid-interactions/GridInteractions.js +371 -0
  220. package/web-dist/components/grid-interactions/index.d.ts +1 -0
  221. package/web-dist/components/grid-interactions/index.js +2 -0
  222. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +2 -2
  223. package/web-dist/components/grid-ruler/GridRuler.js +2 -2
  224. package/web-dist/components/grid-view/GridView.js +1 -1
  225. package/web-dist/components/heading/Heading.js +2 -2
  226. package/web-dist/components/hero/Hero.js +9 -9
  227. package/web-dist/components/icon/Icon.js +2 -2
  228. package/web-dist/components/icon-button/IconButton.js +3 -3
  229. package/web-dist/components/image/Image.js +4 -4
  230. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +2 -2
  231. package/web-dist/components/list/List.js +5 -5
  232. package/web-dist/components/list-item/ListItem.js +5 -5
  233. package/web-dist/components/list-section/ListSection.js +5 -5
  234. package/web-dist/components/matrix-grid/MatrixGrid.js +296 -47
  235. package/web-dist/components/media-card/MediaCard.js +9 -9
  236. package/web-dist/components/media-explorer/MediaExplorer.js +7 -7
  237. package/web-dist/components/message-bubble/MessageBubble.js +7 -7
  238. package/web-dist/components/metric-card/MetricCard.js +9 -9
  239. package/web-dist/components/missing-element/MissingElement.js +4 -4
  240. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +10 -10
  241. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +10 -10
  242. package/web-dist/components/opening-book/OpeningBook.js +2 -2
  243. package/web-dist/components/otp-form/OtpForm.js +10 -10
  244. package/web-dist/components/pagination/Pagination.js +4 -4
  245. package/web-dist/components/palette-item/PaletteItem.js +9 -9
  246. package/web-dist/components/playing-card/PlayingCard.js +2 -2
  247. package/web-dist/components/poker-training-table/PokerTrainingTable.js +2 -2
  248. package/web-dist/components/popover-menu/PopoverMenu.js +4 -4
  249. package/web-dist/components/post-card/PostCard.js +9 -9
  250. package/web-dist/components/product-card/ProductCard.js +9 -9
  251. package/web-dist/components/progress/Progress.js +4 -4
  252. package/web-dist/components/progress-ring/ProgressRing.js +4 -4
  253. package/web-dist/components/radio/Radio.js +5 -5
  254. package/web-dist/components/radio-group/RadioGroup.js +5 -5
  255. package/web-dist/components/rating/Rating.js +3 -3
  256. package/web-dist/components/reader/Reader.js +10 -10
  257. package/web-dist/components/scan-overlay/ScanOverlay.js +10 -10
  258. package/web-dist/components/screen/Screen.js +2 -2
  259. package/web-dist/components/screen-section/ScreenSection.js +4 -4
  260. package/web-dist/components/scroll-view/ScrollView.js +2 -2
  261. package/web-dist/components/search-input/SearchInput.js +4 -4
  262. package/web-dist/components/section-header/SectionHeader.js +4 -4
  263. package/web-dist/components/section-list/SectionList.js +5 -5
  264. package/web-dist/components/select/Select.js +4 -4
  265. package/web-dist/components/selectable-item/SelectableItem.js +2 -2
  266. package/web-dist/components/selection-provider/SelectionProvider.js +2 -2
  267. package/web-dist/components/sign-in-form/SignInForm.js +10 -10
  268. package/web-dist/components/sign-up-form/SignUpForm.js +10 -10
  269. package/web-dist/components/skeleton/Skeleton.js +12 -12
  270. package/web-dist/components/skeleton-card/SkeletonCard.js +12 -12
  271. package/web-dist/components/skeleton-list/SkeletonList.js +12 -12
  272. package/web-dist/components/skeleton-text/SkeletonText.js +12 -12
  273. package/web-dist/components/spatial-grid/SpatialGrid.js +1 -1
  274. package/web-dist/components/surface/Surface.js +2 -2
  275. package/web-dist/components/switch/Switch.js +1 -1
  276. package/web-dist/components/tab/Tab.js +2 -2
  277. package/web-dist/components/tab-list/TabList.js +2 -2
  278. package/web-dist/components/tab-panel/TabPanel.js +2 -2
  279. package/web-dist/components/tabletop-table/TabletopTable.js +2 -2
  280. package/web-dist/components/tabs/Tabs.js +2 -2
  281. package/web-dist/components/text/Text.js +2 -2
  282. package/web-dist/components/text-input/TextInput.js +4 -4
  283. package/web-dist/components/tile-grid/TileGrid.js +1 -1
  284. package/web-dist/components/time-grid/TimeGrid.js +2 -2
  285. package/web-dist/components/time-picker/TimePicker.js +5 -5
  286. package/web-dist/components/timeline/Timeline.js +4 -4
  287. package/web-dist/components/toast/Toast.js +2 -2
  288. package/web-dist/components/toast-provider/ToastProvider.js +2 -2
  289. package/web-dist/components/toolbar/Toolbar.js +9 -9
  290. package/web-dist/components/tree-item/TreeItem.js +9 -9
  291. package/web-dist/components/tree-view/TreeView.js +1 -1
  292. package/web-dist/components/uploader/Uploader.js +12 -12
  293. package/web-dist/components/view/View.js +2 -2
  294. package/web-dist/manifest.json +787 -772
  295. package/web-dist/runtime/ZoraProvider.js +3 -3
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { GridInteractionsProps } from '../../../../types/grid-interactions';
3
+ /*** Adapts native responder and keyboard events to the controlled grid interaction boundary. */
4
+ export declare function GridInteractions({ children, interactionPolicy, resizeHandle, testID, ...props }: GridInteractionsProps): React.JSX.Element;
5
+ //# sourceMappingURL=GridInteractions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridInteractions.d.ts","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/GridInteractions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAM7C,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,GAAG,KAAK,EACT,EAAE,qBAAqB,qBA2DvB"}
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+ import { createGridInteractionsController } from '../../application/createGridInteractionsController';
4
+ import { createGridInteractionsPointerQueue } from './createGridInteractionsPointerQueue';
5
+ import { GridInteractionsKeyboardProxy } from './GridInteractionsKeyboardProxy';
6
+ import { resolveGridInteractionPointer } from './resolveGridInteractionPointer';
7
+ /*** Adapts native responder and keyboard events to the controlled grid interaction boundary. */
8
+ export function GridInteractions({ children, interactionPolicy, resizeHandle, testID, ...props }) {
9
+ const controllerProps = React.useMemo(() => ({ ...props, interactionPolicy }), [interactionPolicy, props]);
10
+ const [controller] = React.useState(() => createGridInteractionsController(controllerProps));
11
+ const surfaceRef = React.useRef(null);
12
+ const [pointerQueue] = React.useState(() => createGridInteractionsPointerQueue());
13
+ React.useLayoutEffect(() => controller.update(controllerProps), [controller, controllerProps]);
14
+ React.useLayoutEffect(() => {
15
+ pointerQueue.activate();
16
+ return () => {
17
+ pointerQueue.dispose();
18
+ controller.cancel();
19
+ };
20
+ }, [controller, pointerQueue]);
21
+ const withPointer = (event, handlePointer) => {
22
+ const surface = surfaceRef.current;
23
+ if (!surface)
24
+ return;
25
+ const eventSnapshot = { nativeEvent: { ...event.nativeEvent } };
26
+ pointerQueue.enqueue(surface, (origin) => handlePointer(resolveGridInteractionPointer(eventSnapshot, origin)));
27
+ };
28
+ const enabled = interactionPolicy !== 'passive';
29
+ return (<View accessible accessibilityLabel="Grid interaction surface" accessibilityRole="adjustable" ref={surfaceRef} testID={testID} onResponderGrant={(event) => withPointer(event, (pointer) => controller.begin(pointer, resizeHandle))} onResponderMove={(event) => withPointer(event, controller.move)} onResponderRelease={(event) => withPointer(event, controller.end)} onResponderTerminate={() => {
30
+ pointerQueue.cancel();
31
+ controller.cancel();
32
+ }} onStartShouldSetResponder={() => enabled}>
33
+ <GridInteractionsKeyboardProxy enabled={enabled} onKeyDown={(key, keyPointer) => {
34
+ return controller.keyDown(key, keyPointer);
35
+ }}>
36
+ {children}
37
+ </GridInteractionsKeyboardProxy>
38
+ </View>);
39
+ }
40
+ //# sourceMappingURL=GridInteractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridInteractions.js","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/GridInteractions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAMpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACtG,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,gGAAgG;AAChG,MAAM,UAAU,gBAAgB,CAAC,EAC/B,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,GAAG,KAAK,EACc;IACtB,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CACnC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,iBAAiB,EAAE,CAAC,EACvC,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAC3B,CAAC;IACF,MAAM,CAAC,UAAU,CAAC,GAAG,KA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AAC,CAAC,MAAM,CAAC,CACf,gBAAgB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAC1B,WAAW,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CACzE,CAAC,CACD,eAAe,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAChE,kBAAkB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAClE,oBAAoB,CAAC,CAAC,GAAG,EAAE;YACzB,YAAY,CAAC,MAAM,EAAE,CAAC;YACtB,UAAU,CAAC,MAAM,EAAE,CAAC;QACtB,CAAC,CAAC,CACF,yBAAyB,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAEzC;MAAA,CAAC,6BAA6B,CAC5B,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE;YAC7B,OAAO,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAC7C,CAAC,CAAC,CAEF;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,6BAA6B,CACjC;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport type {\n GridInteractionsController,\n GridInteractionsProps,\n} from '../../../../types/grid-interactions';\nimport { createGridInteractionsController } from '../../application/createGridInteractionsController';\nimport { createGridInteractionsPointerQueue } from './createGridInteractionsPointerQueue';\nimport { GridInteractionsKeyboardProxy } from './GridInteractionsKeyboardProxy';\nimport { resolveGridInteractionPointer } from './resolveGridInteractionPointer';\n\n/*** Adapts native responder and keyboard events to the controlled grid interaction boundary. */\nexport function GridInteractions({\n children,\n interactionPolicy,\n resizeHandle,\n testID,\n ...props\n}: GridInteractionsProps) {\n const controllerProps = React.useMemo(\n () => ({ ...props, interactionPolicy }),\n [interactionPolicy, props],\n );\n const [controller] = React.useState<GridInteractionsController>(() =>\n createGridInteractionsController(controllerProps),\n );\n const surfaceRef = React.useRef<View>(null);\n const [pointerQueue] = React.useState(() => createGridInteractionsPointerQueue());\n React.useLayoutEffect(() => controller.update(controllerProps), [controller, controllerProps]);\n React.useLayoutEffect(() => {\n pointerQueue.activate();\n return () => {\n pointerQueue.dispose();\n controller.cancel();\n };\n }, [controller, pointerQueue]);\n const withPointer = (\n event: Parameters<typeof resolveGridInteractionPointer>[0],\n handlePointer: (pointer: ReturnType<typeof resolveGridInteractionPointer>) => void,\n ) => {\n const surface = surfaceRef.current;\n if (!surface) return;\n const eventSnapshot = { nativeEvent: { ...event.nativeEvent } };\n pointerQueue.enqueue(surface, (origin) =>\n handlePointer(resolveGridInteractionPointer(eventSnapshot, origin)),\n );\n };\n const enabled = interactionPolicy !== 'passive';\n\n return (\n <View\n accessible\n accessibilityLabel=\"Grid interaction surface\"\n accessibilityRole=\"adjustable\"\n ref={surfaceRef}\n testID={testID}\n onResponderGrant={(event) =>\n withPointer(event, (pointer) => controller.begin(pointer, resizeHandle))\n }\n onResponderMove={(event) => withPointer(event, controller.move)}\n onResponderRelease={(event) => withPointer(event, controller.end)}\n onResponderTerminate={() => {\n pointerQueue.cancel();\n controller.cancel();\n }}\n onStartShouldSetResponder={() => enabled}\n >\n <GridInteractionsKeyboardProxy\n enabled={enabled}\n onKeyDown={(key, keyPointer) => {\n return controller.keyDown(key, keyPointer);\n }}\n >\n {children}\n </GridInteractionsKeyboardProxy>\n </View>\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { GridInteractionsKeyboardProxy } from './GridInteractionsKeyboardProxy.native';
2
+ //# sourceMappingURL=GridInteractionsKeyboardProxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridInteractionsKeyboardProxy.d.ts","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { GridInteractionsKeyboardProxy } from './GridInteractionsKeyboardProxy.native';
2
+ //# sourceMappingURL=GridInteractionsKeyboardProxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridInteractionsKeyboardProxy.js","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC","sourcesContent":["export { GridInteractionsKeyboardProxy } from './GridInteractionsKeyboardProxy.native';\n"]}
@@ -0,0 +1,11 @@
1
+ import type React from 'react';
2
+ import type { GridInteractionPointer } from '../../../../types/grid-interactions';
3
+ /*** Leaves native accessibility focus untouched where browser keyboard events are unavailable. */
4
+ export declare function GridInteractionsKeyboardProxy({ children }: GridInteractionsKeyboardProxyProps): React.JSX.Element;
5
+ interface GridInteractionsKeyboardProxyProps {
6
+ readonly children: React.ReactNode;
7
+ readonly enabled: boolean;
8
+ readonly onKeyDown: (key: string, pointer: GridInteractionPointer) => boolean;
9
+ }
10
+ export {};
11
+ //# sourceMappingURL=GridInteractionsKeyboardProxy.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridInteractionsKeyboardProxy.native.d.ts","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAElF,kGAAkG;AAClG,wBAAgB,6BAA6B,CAAC,EAAE,QAAQ,EAAE,EAAE,kCAAkC,qBAE7F;AAED,UAAU,kCAAkC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC;CAC/E"}
@@ -0,0 +1,5 @@
1
+ /*** Leaves native accessibility focus untouched where browser keyboard events are unavailable. */
2
+ export function GridInteractionsKeyboardProxy({ children }) {
3
+ return <>{children}</>;
4
+ }
5
+ //# sourceMappingURL=GridInteractionsKeyboardProxy.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridInteractionsKeyboardProxy.native.js","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.native.tsx"],"names":[],"mappings":"AAIA,kGAAkG;AAClG,MAAM,UAAU,6BAA6B,CAAC,EAAE,QAAQ,EAAsC;IAC5F,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzB,CAAC","sourcesContent":["import type React from 'react';\n\nimport type { GridInteractionPointer } from '../../../../types/grid-interactions';\n\n/*** Leaves native accessibility focus untouched where browser keyboard events are unavailable. */\nexport function GridInteractionsKeyboardProxy({ children }: GridInteractionsKeyboardProxyProps) {\n return <>{children}</>;\n}\n\ninterface GridInteractionsKeyboardProxyProps {\n readonly children: React.ReactNode;\n readonly enabled: boolean;\n readonly onKeyDown: (key: string, pointer: GridInteractionPointer) => boolean;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type React from 'react';
2
+ import type { GridInteractionPointer } from '../../../../types/grid-interactions';
3
+ /*** Adapts web keyboard movement and resize commands without changing native responder behavior. */
4
+ export declare function GridInteractionsKeyboardProxy({ children, enabled, onKeyDown, }: GridInteractionsKeyboardProxyProps): React.JSX.Element;
5
+ interface GridInteractionsKeyboardProxyProps {
6
+ readonly children: React.ReactNode;
7
+ readonly enabled: boolean;
8
+ readonly onKeyDown: (key: string, pointer: GridInteractionPointer) => boolean;
9
+ }
10
+ export {};
11
+ //# sourceMappingURL=GridInteractionsKeyboardProxy.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridInteractionsKeyboardProxy.web.d.ts","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAElF,oGAAoG;AACpG,wBAAgB,6BAA6B,CAAC,EAC5C,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE,kCAAkC,qBAyBpC;AAED,UAAU,kCAAkC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC;CAC/E"}
@@ -0,0 +1,20 @@
1
+ /*** Adapts web keyboard movement and resize commands without changing native responder behavior. */
2
+ export function GridInteractionsKeyboardProxy({ children, enabled, onKeyDown, }) {
3
+ return (<div aria-label="Grid interaction keyboard controls" onKeyDown={(event) => {
4
+ if (!enabled)
5
+ return;
6
+ if (onKeyDown(event.key, {
7
+ altKey: event.altKey,
8
+ ctrlKey: event.ctrlKey,
9
+ metaKey: event.metaKey,
10
+ shiftKey: event.shiftKey,
11
+ x: 0,
12
+ y: 0,
13
+ })) {
14
+ event.preventDefault();
15
+ }
16
+ }} style={{ display: 'contents' }} tabIndex={enabled ? 0 : -1}>
17
+ {children}
18
+ </div>);
19
+ }
20
+ //# sourceMappingURL=GridInteractionsKeyboardProxy.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridInteractionsKeyboardProxy.web.js","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/GridInteractionsKeyboardProxy.web.tsx"],"names":[],"mappings":"AAIA,oGAAoG;AACpG,MAAM,UAAU,6BAA6B,CAAC,EAC5C,QAAQ,EACR,OAAO,EACP,SAAS,GAC0B;IACnC,OAAO,CACL,CAAC,GAAG,CACF,UAAU,CAAC,oCAAoC,CAC/C,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,IACE,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE;gBACnB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,CAAC,EAAE,CAAC;gBACJ,CAAC,EAAE,CAAC;aACL,CAAC,EACF,CAAC;gBACD,KAAK,CAAC,cAAc,EAAE,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CACF,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAC/B,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAE3B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type React from 'react';\n\nimport type { GridInteractionPointer } from '../../../../types/grid-interactions';\n\n/*** Adapts web keyboard movement and resize commands without changing native responder behavior. */\nexport function GridInteractionsKeyboardProxy({\n children,\n enabled,\n onKeyDown,\n}: GridInteractionsKeyboardProxyProps) {\n return (\n <div\n aria-label=\"Grid interaction keyboard controls\"\n onKeyDown={(event) => {\n if (!enabled) return;\n if (\n onKeyDown(event.key, {\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n shiftKey: event.shiftKey,\n x: 0,\n y: 0,\n })\n ) {\n event.preventDefault();\n }\n }}\n style={{ display: 'contents' }}\n tabIndex={enabled ? 0 : -1}\n >\n {children}\n </div>\n );\n}\n\ninterface GridInteractionsKeyboardProxyProps {\n readonly children: React.ReactNode;\n readonly enabled: boolean;\n readonly onKeyDown: (key: string, pointer: GridInteractionPointer) => boolean;\n}\n"]}
@@ -0,0 +1,17 @@
1
+ /*** Serializes native responder measurements and invalidates work from canceled interaction lifecycles. */
2
+ export declare function createGridInteractionsPointerQueue(): {
3
+ activate: () => void;
4
+ enqueue: (surface: GridInteractionSurface, handleOrigin: (origin: GridInteractionSurfaceOrigin) => void) => void;
5
+ cancel: () => void;
6
+ dispose: () => void;
7
+ };
8
+ interface GridInteractionSurface {
9
+ readonly getBoundingClientRect?: () => Pick<DOMRect, 'left' | 'top'>;
10
+ readonly measureInWindow?: (callback: (x: number, y: number) => void) => void;
11
+ }
12
+ interface GridInteractionSurfaceOrigin {
13
+ readonly x: number;
14
+ readonly y: number;
15
+ }
16
+ export {};
17
+ //# sourceMappingURL=createGridInteractionsPointerQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGridInteractionsPointerQueue.d.ts","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/createGridInteractionsPointerQueue.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,wBAAgB,kCAAkC;;uBAsCnC,sBAAsB,gBACjB,CAAC,MAAM,EAAE,4BAA4B,KAAK,IAAI;;;EAoBjE;AAQD,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC;IACrE,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;CAC/E;AAED,UAAU,4BAA4B;IACpC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,76 @@
1
+ /*** Serializes native responder measurements and invalidates work from canceled interaction lifecycles. */
2
+ export function createGridInteractionsPointerQueue() {
3
+ let active = true;
4
+ let generation = 0;
5
+ let measuring = false;
6
+ let measurementId = 0;
7
+ let activeMeasurementId;
8
+ let pending = [];
9
+ const processNext = () => {
10
+ if (measuring)
11
+ return;
12
+ const pointerWork = pending.at(0);
13
+ if (pointerWork === undefined)
14
+ return;
15
+ pending = pending.slice(1);
16
+ measuring = true;
17
+ const currentMeasurementId = ++measurementId;
18
+ activeMeasurementId = currentMeasurementId;
19
+ let settled = false;
20
+ measureSurfaceOrigin(pointerWork.surface, (origin) => {
21
+ if (settled)
22
+ return;
23
+ settled = true;
24
+ if (activeMeasurementId !== currentMeasurementId)
25
+ return;
26
+ try {
27
+ if (active && pointerWork.generation === generation) {
28
+ pointerWork.handleOrigin(origin);
29
+ }
30
+ }
31
+ finally {
32
+ activeMeasurementId = undefined;
33
+ measuring = false;
34
+ processNext();
35
+ }
36
+ });
37
+ };
38
+ return {
39
+ activate: () => {
40
+ active = true;
41
+ },
42
+ enqueue: (surface, handleOrigin) => {
43
+ if (!active)
44
+ return;
45
+ pending = [...pending, { generation, handleOrigin, surface }];
46
+ processNext();
47
+ },
48
+ cancel: () => {
49
+ generation += 1;
50
+ pending = [];
51
+ activeMeasurementId = undefined;
52
+ measuring = false;
53
+ },
54
+ dispose: () => {
55
+ active = false;
56
+ generation += 1;
57
+ pending = [];
58
+ activeMeasurementId = undefined;
59
+ measuring = false;
60
+ },
61
+ };
62
+ }
63
+ /*** Resolves the current surface origin through RNW DOM geometry or native asynchronous measurement. */
64
+ function measureSurfaceOrigin(surface, onOrigin) {
65
+ const rect = surface.getBoundingClientRect?.();
66
+ if (rect) {
67
+ onOrigin({ x: rect.left, y: rect.top });
68
+ return;
69
+ }
70
+ if (surface.measureInWindow !== undefined) {
71
+ surface.measureInWindow((x, y) => onOrigin({ x, y }));
72
+ return;
73
+ }
74
+ onOrigin({ x: 0, y: 0 });
75
+ }
76
+ //# sourceMappingURL=createGridInteractionsPointerQueue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGridInteractionsPointerQueue.js","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/createGridInteractionsPointerQueue.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,UAAU,kCAAkC;IAChD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,mBAAuC,CAAC;IAC5C,IAAI,OAAO,GAA0C,EAAE,CAAC;IAExD,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,SAAS;YAAE,OAAO;QACtB,MAAM,WAAW,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,WAAW,KAAK,SAAS;YAAE,OAAO;QACtC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,SAAS,GAAG,IAAI,CAAC;QACjB,MAAM,oBAAoB,GAAG,EAAE,aAAa,CAAC;QAC7C,mBAAmB,GAAG,oBAAoB,CAAC;QAC3C,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,oBAAoB,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE;YACnD,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,mBAAmB,KAAK,oBAAoB;gBAAE,OAAO;YACzD,IAAI,CAAC;gBACH,IAAI,MAAM,IAAI,WAAW,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;oBACpD,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;oBAAS,CAAC;gBACT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AAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACtD,OAAO;IACT,CAAC;IACD,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/*** Serializes native responder measurements and invalidates work from canceled interaction lifecycles. */\nexport function createGridInteractionsPointerQueue() {\n let active = true;\n let generation = 0;\n let measuring = false;\n let measurementId = 0;\n let activeMeasurementId: number | undefined;\n let pending: readonly GridInteractionPointerWork[] = [];\n\n const processNext = () => {\n if (measuring) return;\n const pointerWork = pending.at(0);\n if (pointerWork === undefined) return;\n pending = pending.slice(1);\n measuring = true;\n const currentMeasurementId = ++measurementId;\n activeMeasurementId = currentMeasurementId;\n let settled = false;\n measureSurfaceOrigin(pointerWork.surface, (origin) => {\n if (settled) return;\n settled = true;\n if (activeMeasurementId !== currentMeasurementId) return;\n try {\n if (active && pointerWork.generation === generation) {\n pointerWork.handleOrigin(origin);\n }\n } finally {\n activeMeasurementId = undefined;\n measuring = false;\n processNext();\n }\n });\n };\n\n return {\n activate: () => {\n active = true;\n },\n enqueue: (\n surface: GridInteractionSurface,\n handleOrigin: (origin: GridInteractionSurfaceOrigin) => void,\n ) => {\n if (!active) return;\n pending = [...pending, { generation, handleOrigin, surface }];\n processNext();\n },\n cancel: () => {\n generation += 1;\n pending = [];\n activeMeasurementId = undefined;\n measuring = false;\n },\n dispose: () => {\n active = false;\n generation += 1;\n pending = [];\n activeMeasurementId = undefined;\n measuring = false;\n },\n };\n}\n\ninterface GridInteractionPointerWork {\n readonly generation: number;\n readonly handleOrigin: (origin: GridInteractionSurfaceOrigin) => void;\n readonly surface: GridInteractionSurface;\n}\n\ninterface GridInteractionSurface {\n readonly getBoundingClientRect?: () => Pick<DOMRect, 'left' | 'top'>;\n readonly measureInWindow?: (callback: (x: number, y: number) => void) => void;\n}\n\ninterface GridInteractionSurfaceOrigin {\n readonly x: number;\n readonly y: number;\n}\n\n/*** Resolves the current surface origin through RNW DOM geometry or native asynchronous measurement. */\nfunction measureSurfaceOrigin(\n surface: GridInteractionSurface,\n onOrigin: (origin: GridInteractionSurfaceOrigin) => void,\n) {\n const rect = surface.getBoundingClientRect?.();\n if (rect) {\n onOrigin({ x: rect.left, y: rect.top });\n return;\n }\n if (surface.measureInWindow !== undefined) {\n surface.measureInWindow((x, y) => onOrigin({ x, y }));\n return;\n }\n onOrigin({ x: 0, y: 0 });\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import type { GridInteractionPointer } from '../../../../types/grid-interactions';
2
+ /*** Converts a responder event into coordinates local to the interaction surface. */
3
+ export declare function resolveGridInteractionPointer(event: GridInteractionNativePointerEvent, surfaceOrigin: GridInteractionSurfaceOrigin): GridInteractionPointer;
4
+ interface GridInteractionNativePointerEvent {
5
+ readonly nativeEvent: {
6
+ readonly altKey?: boolean;
7
+ readonly ctrlKey?: boolean;
8
+ readonly locationX: number;
9
+ readonly locationY: number;
10
+ readonly metaKey?: boolean;
11
+ readonly pageX?: number;
12
+ readonly pageY?: number;
13
+ readonly shiftKey?: boolean;
14
+ };
15
+ }
16
+ interface GridInteractionSurfaceOrigin {
17
+ readonly x: number;
18
+ readonly y: number;
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=resolveGridInteractionPointer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveGridInteractionPointer.d.ts","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/resolveGridInteractionPointer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAElF,qFAAqF;AACrF,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,iCAAiC,EACxC,aAAa,EAAE,4BAA4B,GAC1C,sBAAsB,CAoBxB;AAED,UAAU,iCAAiC;IACzC,QAAQ,CAAC,WAAW,EAAE;QACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH;AAED,UAAU,4BAA4B;IACpC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,20 @@
1
+ /*** Converts a responder event into coordinates local to the interaction surface. */
2
+ export function resolveGridInteractionPointer(event, surfaceOrigin) {
3
+ const { nativeEvent } = event;
4
+ const { pageX, pageY } = nativeEvent;
5
+ const x = typeof pageX === 'number' && Number.isFinite(pageX)
6
+ ? pageX - surfaceOrigin.x
7
+ : nativeEvent.locationX;
8
+ const y = typeof pageY === 'number' && Number.isFinite(pageY)
9
+ ? pageY - surfaceOrigin.y
10
+ : nativeEvent.locationY;
11
+ return {
12
+ altKey: nativeEvent.altKey,
13
+ ctrlKey: nativeEvent.ctrlKey,
14
+ metaKey: nativeEvent.metaKey,
15
+ shiftKey: nativeEvent.shiftKey,
16
+ x,
17
+ y,
18
+ };
19
+ }
20
+ //# sourceMappingURL=resolveGridInteractionPointer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveGridInteractionPointer.js","sourceRoot":"","sources":["../../../../../src/features/grid-interactions/adapters/inbound/resolveGridInteractionPointer.ts"],"names":[],"mappings":"AAEA,qFAAqF;AACrF,MAAM,UAAU,6BAA6B,CAC3C,KAAwC,EACxC,aAA2C;IAE3C,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC9B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC;IACrC,MAAM,CAAC,GACL,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QACjD,CAAC,CAAC,KAAK,GAAG,aAAa,CAAC,CAAC;QACzB,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC;IAC5B,MAAM,CAAC,GACL,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QACjD,CAAC,CAAC,KAAK,GAAG,aAAa,CAAC,CAAC;QACzB,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC;IAE5B,OAAO;QACL,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,CAAC;QACD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { GridInteractionPointer } from '../../../../types/grid-interactions';\n\n/*** Converts a responder event into coordinates local to the interaction surface. */\nexport function resolveGridInteractionPointer(\n event: GridInteractionNativePointerEvent,\n surfaceOrigin: GridInteractionSurfaceOrigin,\n): GridInteractionPointer {\n const { nativeEvent } = event;\n const { pageX, pageY } = nativeEvent;\n const x =\n typeof pageX === 'number' && Number.isFinite(pageX)\n ? pageX - surfaceOrigin.x\n : nativeEvent.locationX;\n const y =\n typeof pageY === 'number' && Number.isFinite(pageY)\n ? pageY - surfaceOrigin.y\n : nativeEvent.locationY;\n\n return {\n altKey: nativeEvent.altKey,\n ctrlKey: nativeEvent.ctrlKey,\n metaKey: nativeEvent.metaKey,\n shiftKey: nativeEvent.shiftKey,\n x,\n y,\n };\n}\n\ninterface GridInteractionNativePointerEvent {\n readonly nativeEvent: {\n readonly altKey?: boolean;\n readonly ctrlKey?: boolean;\n readonly locationX: number;\n readonly locationY: number;\n readonly metaKey?: boolean;\n readonly pageX?: number;\n readonly pageY?: number;\n readonly shiftKey?: boolean;\n };\n}\n\ninterface GridInteractionSurfaceOrigin {\n readonly x: number;\n readonly y: number;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { GridInteractionsController, GridInteractionsControllerProps } from '../../../types/grid-interactions';
2
+ /*** Create a platform-neutral controlled interaction controller using grid-view geometry only. */
3
+ export declare function createGridInteractionsController(props: GridInteractionsControllerProps): GridInteractionsController;
4
+ //# sourceMappingURL=createGridInteractionsController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGridInteractionsController.d.ts","sourceRoot":"","sources":["../../../../src/features/grid-interactions/application/createGridInteractionsController.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAIV,0BAA0B,EAC1B,+BAA+B,EAChC,MAAM,kCAAkC,CAAC;AAc1C,kGAAkG;AAClG,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,+BAA+B,GACrC,0BAA0B,CA8E5B"}
@@ -0,0 +1,191 @@
1
+ import { hitTestWorldRects, moveWorldRects, panViewport, resizeWorldRect, resolveWorldSnapCandidate, selectWorldRects, viewportToWorld, } from '@ankhorage/grid-view';
2
+ /*** Create a platform-neutral controlled interaction controller using grid-view geometry only. */
3
+ export function createGridInteractionsController(props) {
4
+ let currentProps = props;
5
+ let state = { kind: 'idle' };
6
+ let previousIntent;
7
+ const point = (pointer) => Number.isFinite(pointer.x) && Number.isFinite(pointer.y)
8
+ ? viewportToWorld(pointer, currentProps.viewport)
9
+ : undefined;
10
+ const emit = (intent) => {
11
+ if (JSON.stringify(previousIntent) === JSON.stringify(intent))
12
+ return;
13
+ previousIntent = intent;
14
+ currentProps.onIntent(intent);
15
+ };
16
+ return {
17
+ begin: (pointer, handle) => {
18
+ if (!canEdit(currentProps))
19
+ return;
20
+ const start = point(pointer);
21
+ if (start === undefined)
22
+ return;
23
+ if (pointer.spaceKey === true || pointer.altKey === true) {
24
+ state = { kind: 'pan', start };
25
+ return;
26
+ }
27
+ const target = hitTestWorldRects(currentProps.items, start);
28
+ if (target === undefined || isProtected(target)) {
29
+ state = { kind: 'marquee', start };
30
+ return;
31
+ }
32
+ if (handle !== undefined && target.resizable !== false) {
33
+ state = { kind: 'resize', start, item: target, handle };
34
+ return;
35
+ }
36
+ const itemIds = currentProps.selectedIds?.includes(target.id) === true
37
+ ? currentProps.selectedIds
38
+ : [target.id];
39
+ state = { kind: 'move', start, itemIds };
40
+ },
41
+ move: (pointer) => {
42
+ if (!canEdit(currentProps))
43
+ return;
44
+ const current = point(pointer);
45
+ if (current !== undefined)
46
+ emitPreview(state, current, currentProps, emit);
47
+ },
48
+ end: (pointer) => {
49
+ if (!canEdit(currentProps)) {
50
+ state = { kind: 'idle' };
51
+ return;
52
+ }
53
+ const current = point(pointer);
54
+ if (current !== undefined)
55
+ emitPreview(state, current, currentProps, emit);
56
+ state = { kind: 'idle' };
57
+ },
58
+ cancel: () => {
59
+ state = { kind: 'idle' };
60
+ },
61
+ keyDown: (key, pointer = { x: 0, y: 0 }) => {
62
+ if (!canEdit(currentProps))
63
+ return false;
64
+ const focusedId = currentProps.selectedIds?.at(-1);
65
+ const focused = currentProps.items.find((item) => item.id === focusedId);
66
+ if (!focused || isProtected(focused))
67
+ return false;
68
+ const increment = pointer.shiftKey === true ? 10 : 1;
69
+ const delta = keyToDelta(key, increment);
70
+ if (delta === undefined)
71
+ return false;
72
+ if (pointer.altKey === true) {
73
+ emit({
74
+ type: 'resize',
75
+ itemIds: [focused.id],
76
+ rects: [resizeWorldRect(focused, resizeHandleForDelta(delta), delta)],
77
+ });
78
+ return true;
79
+ }
80
+ emit({ type: 'move', itemIds: [focused.id], rects: moveWorldRects([focused], delta) });
81
+ return true;
82
+ },
83
+ update: (nextProps) => {
84
+ currentProps = nextProps;
85
+ },
86
+ };
87
+ }
88
+ /*** Determines whether the component-wide interaction policy permits edit intents. */
89
+ function canEdit(props) {
90
+ return props.interactionPolicy !== 'passive';
91
+ }
92
+ /*** Emit one controlled preview/intention without retaining or mutating caller-owned item data. */
93
+ function emitPreview(state, current, props, emit) {
94
+ if (state.kind === 'idle')
95
+ return;
96
+ if (state.kind === 'pan') {
97
+ emit({
98
+ type: 'pan',
99
+ itemIds: [],
100
+ viewport: panViewport(props.viewport, {
101
+ x: state.start.x - current.x,
102
+ y: state.start.y - current.y,
103
+ }),
104
+ });
105
+ return;
106
+ }
107
+ if (state.kind === 'marquee') {
108
+ const marquee = normalizeRect(state.start, current);
109
+ const itemIds = selectWorldRects(props.items, marquee, {
110
+ mode: props.marqueeMode ?? 'intersect',
111
+ }).filter((id) => {
112
+ const item = props.items.find((candidate) => candidate.id === id);
113
+ return item !== undefined && !isProtected(item);
114
+ });
115
+ emit({ type: 'marquee', itemIds, marquee });
116
+ return;
117
+ }
118
+ const delta = resolveSnapDelta(state, current, props);
119
+ if (state.kind === 'move') {
120
+ const selected = props.items.filter((item) => state.itemIds.includes(item.id));
121
+ emit({ type: 'move', itemIds: state.itemIds, rects: moveWorldRects(selected, delta) });
122
+ return;
123
+ }
124
+ emit({
125
+ type: 'resize',
126
+ itemIds: [state.item.id],
127
+ rects: [resizeWorldRect(state.item, state.handle, delta)],
128
+ });
129
+ }
130
+ /*** Resolve explicit per-axis candidate snapping without inventing geometry outside grid-view. */
131
+ function resolveSnapDelta(state, current, props) {
132
+ if (state.kind === 'idle' || state.kind === 'marquee' || state.kind === 'pan') {
133
+ return { x: 0, y: 0 };
134
+ }
135
+ const raw = { x: current.x - state.start.x, y: current.y - state.start.y };
136
+ if (props.snap?.enabled !== true)
137
+ return raw;
138
+ const anchor = state.kind === 'resize' ? state.item : props.items.find((item) => item.id === state.itemIds[0]);
139
+ if (anchor === undefined)
140
+ return raw;
141
+ const options = {
142
+ enabled: true,
143
+ tolerancePixels: props.snap.tolerancePixels,
144
+ priorities: props.snap.priorities,
145
+ };
146
+ return {
147
+ x: resolveWorldSnapCandidate(anchor.x + raw.x, props.snap.x ?? [], {
148
+ ...options,
149
+ pixelsPerUnit: props.viewport.pixelsPerUnitX,
150
+ }) - anchor.x,
151
+ y: resolveWorldSnapCandidate(anchor.y + raw.y, props.snap.y ?? [], {
152
+ ...options,
153
+ pixelsPerUnit: props.viewport.pixelsPerUnitY,
154
+ }) - anchor.y,
155
+ };
156
+ }
157
+ /*** Keep all caller-declared protected items out of selection and edit intents. */
158
+ function isProtected(item) {
159
+ return (item.disabled === true ||
160
+ item.locked === true ||
161
+ item.readOnly === true ||
162
+ item.passive === true);
163
+ }
164
+ /*** Normalize an arbitrary-direction drag into the world rectangle expected by grid-view selection. */
165
+ function normalizeRect(start, end) {
166
+ return {
167
+ x: Math.min(start.x, end.x),
168
+ y: Math.min(start.y, end.y),
169
+ width: Math.abs(end.x - start.x),
170
+ height: Math.abs(end.y - start.y),
171
+ };
172
+ }
173
+ /** Maps accessible arrow keys to caller-controlled world-space edit increments. */
174
+ function keyToDelta(key, increment) {
175
+ if (key === 'ArrowUp')
176
+ return { x: 0, y: -increment };
177
+ if (key === 'ArrowRight')
178
+ return { x: increment, y: 0 };
179
+ if (key === 'ArrowDown')
180
+ return { x: 0, y: increment };
181
+ if (key === 'ArrowLeft')
182
+ return { x: -increment, y: 0 };
183
+ return undefined;
184
+ }
185
+ /** Chooses the physical edge matching an accessible resize direction. */
186
+ function resizeHandleForDelta(delta) {
187
+ if (delta.x < 0)
188
+ return delta.y < 0 ? 'top-left' : delta.y > 0 ? 'bottom-left' : 'left';
189
+ return delta.y < 0 ? 'top-right' : delta.y > 0 ? 'bottom-right' : 'right';
190
+ }
191
+ //# sourceMappingURL=createGridInteractionsController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGridInteractionsController.js","sourceRoot":"","sources":["../../../../src/features/grid-interactions/application/createGridInteractionsController.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAsB9B,kG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AAI,KAAK,CAAC,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IACxF,OAAO,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC;AAC5E,CAAC","sourcesContent":["import {\n type GridPoint,\n type GridRect,\n type GridResizeHandle,\n hitTestWorldRects,\n moveWorldRects,\n panViewport,\n resizeWorldRect,\n resolveWorldSnapCandidate,\n selectWorldRects,\n viewportToWorld,\n} from '@ankhorage/grid-view';\n\nimport type {\n GridInteractionIntent,\n GridInteractionItem,\n GridInteractionPointer,\n GridInteractionsController,\n GridInteractionsControllerProps,\n} from '../../../types/grid-interactions';\n\ntype InteractionState =\n | { readonly kind: 'idle' }\n | { readonly kind: 'marquee'; readonly start: GridPoint }\n | { readonly kind: 'pan'; readonly start: GridPoint }\n | { readonly kind: 'move'; readonly start: GridPoint; readonly itemIds: readonly string[] }\n | {\n readonly kind: 'resize';\n readonly start: GridPoint;\n readonly item: GridInteractionItem;\n readonly handle: GridResizeHandle;\n };\n\n/*** Create a platform-neutral controlled interaction controller using grid-view geometry only. */\nexport function createGridInteractionsController(\n props: GridInteractionsControllerProps,\n): GridInteractionsController {\n let currentProps = props;\n let state: InteractionState = { kind: 'idle' };\n let previousIntent: GridInteractionIntent | undefined;\n const point = (pointer: GridInteractionPointer) =>\n Number.isFinite(pointer.x) && Number.isFinite(pointer.y)\n ? viewportToWorld(pointer, currentProps.viewport)\n : undefined;\n const emit = (intent: GridInteractionIntent) => {\n if (JSON.stringify(previousIntent) === JSON.stringify(intent)) return;\n previousIntent = intent;\n currentProps.onIntent(intent);\n };\n\n return {\n begin: (pointer, handle) => {\n if (!canEdit(currentProps)) return;\n const start = point(pointer);\n if (start === undefined) return;\n if (pointer.spaceKey === true || pointer.altKey === true) {\n state = { kind: 'pan', start };\n return;\n }\n const target = hitTestWorldRects(currentProps.items, start);\n if (target === undefined || isProtected(target)) {\n state = { kind: 'marquee', start };\n return;\n }\n if (handle !== undefined && target.resizable !== false) {\n state = { kind: 'resize', start, item: target, handle };\n return;\n }\n const itemIds =\n currentProps.selectedIds?.includes(target.id) === true\n ? currentProps.selectedIds\n : [target.id];\n state = { kind: 'move', start, itemIds };\n },\n move: (pointer) => {\n if (!canEdit(currentProps)) return;\n const current = point(pointer);\n if (current !== undefined) emitPreview(state, current, currentProps, emit);\n },\n end: (pointer) => {\n if (!canEdit(currentProps)) {\n state = { kind: 'idle' };\n return;\n }\n const current = point(pointer);\n if (current !== undefined) emitPreview(state, current, currentProps, emit);\n state = { kind: 'idle' };\n },\n cancel: () => {\n state = { kind: 'idle' };\n },\n keyDown: (key, pointer = { x: 0, y: 0 }) => {\n if (!canEdit(currentProps)) return false;\n const focusedId = currentProps.selectedIds?.at(-1);\n const focused = currentProps.items.find((item) => item.id === focusedId);\n if (!focused || isProtected(focused)) return false;\n const increment = pointer.shiftKey === true ? 10 : 1;\n const delta = keyToDelta(key, increment);\n if (delta === undefined) return false;\n if (pointer.altKey === true) {\n emit({\n type: 'resize',\n itemIds: [focused.id],\n rects: [resizeWorldRect(focused, resizeHandleForDelta(delta), delta)],\n });\n return true;\n }\n emit({ type: 'move', itemIds: [focused.id], rects: moveWorldRects([focused], delta) });\n return true;\n },\n update: (nextProps) => {\n currentProps = nextProps;\n },\n };\n}\n\n/*** Determines whether the component-wide interaction policy permits edit intents. */\nfunction canEdit(props: GridInteractionsControllerProps): boolean {\n return props.interactionPolicy !== 'passive';\n}\n\n/*** Emit one controlled preview/intention without retaining or mutating caller-owned item data. */\nfunction emitPreview(\n state: InteractionState,\n current: GridPoint,\n props: GridInteractionsControllerProps,\n emit: (intent: GridInteractionIntent) => void,\n) {\n if (state.kind === 'idle') return;\n if (state.kind === 'pan') {\n emit({\n type: 'pan',\n itemIds: [],\n viewport: panViewport(props.viewport, {\n x: state.start.x - current.x,\n y: state.start.y - current.y,\n }),\n });\n return;\n }\n if (state.kind === 'marquee') {\n const marquee = normalizeRect(state.start, current);\n const itemIds = selectWorldRects(props.items, marquee, {\n mode: props.marqueeMode ?? 'intersect',\n }).filter((id) => {\n const item = props.items.find((candidate) => candidate.id === id);\n return item !== undefined && !isProtected(item);\n });\n emit({ type: 'marquee', itemIds, marquee });\n return;\n }\n const delta = resolveSnapDelta(state, current, props);\n if (state.kind === 'move') {\n const selected = props.items.filter((item) => state.itemIds.includes(item.id));\n emit({ type: 'move', itemIds: state.itemIds, rects: moveWorldRects(selected, delta) });\n return;\n }\n emit({\n type: 'resize',\n itemIds: [state.item.id],\n rects: [resizeWorldRect(state.item, state.handle, delta)],\n });\n}\n\n/*** Resolve explicit per-axis candidate snapping without inventing geometry outside grid-view. */\nfunction resolveSnapDelta(\n state: InteractionState,\n current: GridPoint,\n props: GridInteractionsControllerProps,\n): GridPoint {\n if (state.kind === 'idle' || state.kind === 'marquee' || state.kind === 'pan') {\n return { x: 0, y: 0 };\n }\n const raw = { x: current.x - state.start.x, y: current.y - state.start.y };\n if (props.snap?.enabled !== true) return raw;\n const anchor =\n state.kind === 'resize' ? state.item : props.items.find((item) => item.id === state.itemIds[0]);\n if (anchor === undefined) return raw;\n const options = {\n enabled: true,\n tolerancePixels: props.snap.tolerancePixels,\n priorities: props.snap.priorities,\n };\n return {\n x:\n resolveWorldSnapCandidate(anchor.x + raw.x, props.snap.x ?? [], {\n ...options,\n pixelsPerUnit: props.viewport.pixelsPerUnitX,\n }) - anchor.x,\n y:\n resolveWorldSnapCandidate(anchor.y + raw.y, props.snap.y ?? [], {\n ...options,\n pixelsPerUnit: props.viewport.pixelsPerUnitY,\n }) - anchor.y,\n };\n}\n\n/*** Keep all caller-declared protected items out of selection and edit intents. */\nfunction isProtected(item: GridInteractionItem): boolean {\n return (\n item.disabled === true ||\n item.locked === true ||\n item.readOnly === true ||\n item.passive === true\n );\n}\n\n/*** Normalize an arbitrary-direction drag into the world rectangle expected by grid-view selection. */\nfunction normalizeRect(start: GridPoint, end: GridPoint): GridRect {\n return {\n x: Math.min(start.x, end.x),\n y: Math.min(start.y, end.y),\n width: Math.abs(end.x - start.x),\n height: Math.abs(end.y - start.y),\n };\n}\n\n/** Maps accessible arrow keys to caller-controlled world-space edit increments. */\nfunction keyToDelta(key: string, increment: number): GridPoint | undefined {\n if (key === 'ArrowUp') return { x: 0, y: -increment };\n if (key === 'ArrowRight') return { x: increment, y: 0 };\n if (key === 'ArrowDown') return { x: 0, y: increment };\n if (key === 'ArrowLeft') return { x: -increment, y: 0 };\n return undefined;\n}\n\n/** Chooses the physical edge matching an accessible resize direction. */\nfunction resizeHandleForDelta(delta: GridPoint): GridResizeHandle {\n if (delta.x < 0) return delta.y < 0 ? 'top-left' : delta.y > 0 ? 'bottom-left' : 'left';\n return delta.y < 0 ? 'top-right' : delta.y > 0 ? 'bottom-right' : 'right';\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /** Grid input is a code composition boundary because it accepts live geometry and callbacks. */
2
+ export declare const gridInteractionsMeta: {
3
+ readonly name: "GridInteractions";
4
+ readonly category: "foundation";
5
+ readonly description: "Maps native and web input to controlled world-space grid interaction intents.";
6
+ readonly directManifestNode: false;
7
+ readonly note: "Requires live viewport geometry, item data, and an executable intent callback; available through code APIs only.";
8
+ readonly allowedChildren: readonly [];
9
+ readonly props: {};
10
+ };
11
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/features/grid-interactions/meta.ts"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,eAAO,MAAM,oBAAoB;;;;;;;;CAQK,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** Grid input is a code composition boundary because it accepts live geometry and callbacks. */
2
+ export const gridInteractionsMeta = {
3
+ name: 'GridInteractions',
4
+ category: 'foundation',
5
+ description: 'Maps native and web input to controlled world-space grid interaction intents.',
6
+ directManifestNode: false,
7
+ note: 'Requires live viewport geometry, item data, and an executable intent callback; available through code APIs only.',
8
+ allowedChildren: [],
9
+ props: {},
10
+ };
11
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/features/grid-interactions/meta.ts"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,+EAA+E;IAC5F,kBAAkB,EAAE,KAAK;IACzB,IAAI,EAAE,kHAAkH;IACxH,eAAe,EAAE,EAAE;IACnB,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../types/authoring';\n\n/** Grid input is a code composition boundary because it accepts live geometry and callbacks. */\nexport const gridInteractionsMeta = {\n name: 'GridInteractions',\n category: 'foundation',\n description: 'Maps native and web input to controlled world-space grid interaction intents.',\n directManifestNode: false,\n note: 'Requires live viewport geometry, item data, and an executable intent callback; available through code APIs only.',\n allowedChildren: [],\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
@@ -0,0 +1,4 @@
1
+ export type { GridInteractionIntent, GridInteractionItem, GridInteractionPointer, GridInteractionsController, GridInteractionsControllerProps, GridInteractionSnap, GridInteractionsProps, } from '../../types/grid-interactions';
2
+ export { GridInteractions } from './adapters/inbound/GridInteractions';
3
+ export { createGridInteractionsController } from './application/createGridInteractionsController';
4
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/grid-interactions/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,+BAA+B,EAC/B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { GridInteractions } from './adapters/inbound/GridInteractions';
2
+ export { createGridInteractionsController } from './application/createGridInteractionsController';
3
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/grid-interactions/public.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC","sourcesContent":["export type {\n GridInteractionIntent,\n GridInteractionItem,\n GridInteractionPointer,\n GridInteractionsController,\n GridInteractionsControllerProps,\n GridInteractionSnap,\n GridInteractionsProps,\n} from '../../types/grid-interactions';\nexport { GridInteractions } from './adapters/inbound/GridInteractions';\nexport { createGridInteractionsController } from './application/createGridInteractionsController';\n"]}