@ankhorage/zora 28.10.1 → 28.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/dist/capabilities/index.js +2 -1
  4. package/dist/capabilities/index.js.map +3 -3
  5. package/dist/constants/authoring.d.ts +3 -3
  6. package/dist/constants/authoring.d.ts.map +1 -1
  7. package/dist/constants/authoring.js +1 -0
  8. package/dist/constants/authoring.js.map +1 -1
  9. package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
  10. package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
  11. package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -1
  12. package/dist/features/calendar/adapters/inbound/Calendar.js +91 -7
  13. package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -1
  14. package/dist/features/card/cardMeta.d.ts +1 -1
  15. package/dist/features/card/mediaCardMeta.d.ts +1 -1
  16. package/dist/features/card/postCardMeta.d.ts +1 -1
  17. package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
  18. package/dist/features/dialog/dialogMeta.d.ts +2 -2
  19. package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts +5 -0
  20. package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts.map +1 -0
  21. package/dist/features/flow/adapters/inbound/FlowCanvas.js +261 -0
  22. package/dist/features/flow/adapters/inbound/FlowCanvas.js.map +1 -0
  23. package/dist/features/flow/application/createFlowEditorController.d.ts +13 -0
  24. package/dist/features/flow/application/createFlowEditorController.d.ts.map +1 -0
  25. package/dist/features/flow/application/createFlowEditorController.js +86 -0
  26. package/dist/features/flow/application/createFlowEditorController.js.map +1 -0
  27. package/dist/features/flow/application/getFlowPortAnchor.d.ts +10 -0
  28. package/dist/features/flow/application/getFlowPortAnchor.d.ts.map +1 -0
  29. package/dist/features/flow/application/getFlowPortAnchor.js +18 -0
  30. package/dist/features/flow/application/getFlowPortAnchor.js.map +1 -0
  31. package/dist/features/flow/application/mapFlowViewport.d.ts +10 -0
  32. package/dist/features/flow/application/mapFlowViewport.d.ts.map +1 -0
  33. package/dist/features/flow/application/mapFlowViewport.js +22 -0
  34. package/dist/features/flow/application/mapFlowViewport.js.map +1 -0
  35. package/dist/features/flow/public.d.ts +3 -0
  36. package/dist/features/flow/public.d.ts.map +1 -0
  37. package/dist/features/flow/public.js +2 -0
  38. package/dist/features/flow/public.js.map +1 -0
  39. package/dist/features/gradient/gradientMeta.d.ts +1 -1
  40. package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts +5 -0
  41. package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts.map +1 -0
  42. package/dist/features/graph-node/adapters/inbound/GraphNode.js +190 -0
  43. package/dist/features/graph-node/adapters/inbound/GraphNode.js.map +1 -0
  44. package/dist/features/graph-node/getGraphNodePortGeometry.d.ts +17 -0
  45. package/dist/features/graph-node/getGraphNodePortGeometry.d.ts.map +1 -0
  46. package/dist/features/graph-node/getGraphNodePortGeometry.js +23 -0
  47. package/dist/features/graph-node/getGraphNodePortGeometry.js.map +1 -0
  48. package/dist/features/graph-node/public.d.ts +3 -0
  49. package/dist/features/graph-node/public.d.ts.map +1 -0
  50. package/dist/features/graph-node/public.js +2 -0
  51. package/dist/features/graph-node/public.js.map +1 -0
  52. package/dist/features/grid-view/adapters/inbound/GridView.d.ts +1 -1
  53. package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
  54. package/dist/features/grid-view/adapters/inbound/GridView.js +105 -41
  55. package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
  56. package/dist/features/grid-view/application/createGridScrollSync.d.ts +2 -5
  57. package/dist/features/grid-view/application/createGridScrollSync.d.ts.map +1 -1
  58. package/dist/features/grid-view/application/createGridScrollSync.js +109 -45
  59. package/dist/features/grid-view/application/createGridScrollSync.js.map +1 -1
  60. package/dist/features/grid-view/public.d.ts +1 -1
  61. package/dist/features/grid-view/public.d.ts.map +1 -1
  62. package/dist/features/grid-view/public.js.map +1 -1
  63. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
  64. package/dist/features/layout/gridMeta.d.ts +1 -1
  65. package/dist/features/layout/screenMeta.d.ts +1 -1
  66. package/dist/features/layout/scrollViewMeta.d.ts +1 -1
  67. package/dist/features/layout/utils/createScrollGestureLock.d.ts.map +1 -1
  68. package/dist/features/layout/utils/createScrollGestureLock.js +4 -0
  69. package/dist/features/layout/utils/createScrollGestureLock.js.map +1 -1
  70. package/dist/features/layout/viewMeta.d.ts +1 -1
  71. package/dist/features/list/flatListMeta.d.ts +1 -1
  72. package/dist/features/list/sectionListMeta.d.ts +1 -1
  73. package/dist/features/master-detail/masterDetailMeta.d.ts +1 -1
  74. package/dist/features/popover/popoverMeta.d.ts +1 -1
  75. package/dist/features/reader/meta.d.ts +2 -2
  76. package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
  77. package/dist/features/scanner/meta.d.ts +2 -2
  78. package/dist/features/section/screenSectionMeta.d.ts +1 -1
  79. package/dist/features/surface/surfaceMeta.d.ts +1 -1
  80. package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
  81. package/dist/features/theme/node.d.ts +5 -0
  82. package/dist/features/theme/node.d.ts.map +1 -0
  83. package/dist/features/theme/node.js +4 -0
  84. package/dist/features/theme/node.js.map +1 -0
  85. package/dist/features/theme/public.d.ts +2 -0
  86. package/dist/features/theme/public.d.ts.map +1 -1
  87. package/dist/features/theme/public.js +1 -0
  88. package/dist/features/theme/public.js.map +1 -1
  89. package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts +1 -1
  90. package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts.map +1 -1
  91. package/dist/features/time-grid/adapters/inbound/TimeGrid.js +45 -22
  92. package/dist/features/time-grid/adapters/inbound/TimeGrid.js.map +1 -1
  93. package/dist/types/color.d.ts +3 -3
  94. package/dist/types/color.d.ts.map +1 -1
  95. package/dist/types/color.js.map +1 -1
  96. package/dist/types/flow.d.ts +81 -0
  97. package/dist/types/flow.d.ts.map +1 -0
  98. package/dist/types/flow.js +2 -0
  99. package/dist/types/flow.js.map +1 -0
  100. package/dist/types/graph-node.d.ts +42 -0
  101. package/dist/types/graph-node.d.ts.map +1 -0
  102. package/dist/types/graph-node.js +2 -0
  103. package/dist/types/graph-node.js.map +1 -0
  104. package/dist/types/grid-view.d.ts +27 -3
  105. package/dist/types/grid-view.d.ts.map +1 -1
  106. package/dist/types/grid-view.js.map +1 -1
  107. package/dist/types/layout.d.ts +2 -0
  108. package/dist/types/layout.d.ts.map +1 -1
  109. package/dist/types/layout.js.map +1 -1
  110. package/dist/types/time-grid.d.ts +9 -0
  111. package/dist/types/time-grid.d.ts.map +1 -1
  112. package/dist/types/time-grid.js.map +1 -1
  113. package/package.json +24 -6
  114. package/src/constants/authoring.ts +1 -0
  115. package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +65 -4
  116. package/src/features/calendar/adapters/inbound/Calendar.tsx +172 -22
  117. package/src/features/flow/adapters/inbound/FlowCanvas.tsx +501 -0
  118. package/src/features/flow/application/createFlowEditorController.test.ts +146 -0
  119. package/src/features/flow/application/createFlowEditorController.ts +99 -0
  120. package/src/features/flow/application/getFlowPortAnchor.test.ts +23 -0
  121. package/src/features/flow/application/getFlowPortAnchor.ts +30 -0
  122. package/src/features/flow/application/mapFlowViewport.test.ts +11 -0
  123. package/src/features/flow/application/mapFlowViewport.ts +29 -0
  124. package/src/features/flow/public.test.ts +7 -0
  125. package/src/features/flow/public.ts +13 -0
  126. package/src/features/graph-node/adapters/inbound/GraphNode.test.tsx +80 -0
  127. package/src/features/graph-node/adapters/inbound/GraphNode.tsx +259 -0
  128. package/src/features/graph-node/getGraphNodePortGeometry.test.ts +35 -0
  129. package/src/features/graph-node/getGraphNodePortGeometry.ts +41 -0
  130. package/src/features/graph-node/public.test.ts +7 -0
  131. package/src/features/graph-node/public.ts +2 -0
  132. package/src/features/grid-view/adapters/inbound/GridView.nativeScrollSync.test.tsx +198 -7
  133. package/src/features/grid-view/adapters/inbound/GridView.tsx +248 -145
  134. package/src/features/grid-view/application/createGridScrollSync.test.ts +46 -17
  135. package/src/features/grid-view/application/createGridScrollSync.ts +100 -43
  136. package/src/features/grid-view/public.ts +6 -1
  137. package/src/features/layout/utils/createScrollGestureLock.ts +4 -0
  138. package/src/features/theme/application/use-cases/compileZoraTheme.test.ts +1 -1
  139. package/src/features/theme/node.ts +18 -0
  140. package/src/features/theme/public.ts +7 -0
  141. package/src/features/time-grid/adapters/inbound/TimeGrid.tsx +64 -21
  142. package/src/platformAcceptance.test.ts +15 -11
  143. package/src/types/color.ts +3 -3
  144. package/src/types/flow.ts +99 -0
  145. package/src/types/graph-node.ts +45 -0
  146. package/src/types/grid-view.ts +25 -3
  147. package/src/types/layout.ts +2 -0
  148. package/src/types/time-grid.ts +9 -0
  149. package/web-dist/chunks/{Accordion-9dq115tn.js → Accordion-064hgrct.js} +3 -3
  150. package/web-dist/chunks/{Accordion-wbf7gqrm.js → Accordion-2b3sd76b.js} +3 -3
  151. package/web-dist/chunks/{Accordion-k9n1yse4.js → Accordion-2kv6p7by.js} +10 -38
  152. package/web-dist/chunks/{Accordion-6gc0jw1n.js → Accordion-5x4cv0kv.js} +1 -1
  153. package/web-dist/chunks/{Accordion-r8swmfjm.js → Accordion-6d63tc7d.js} +1 -1
  154. package/web-dist/chunks/{Accordion-vbz1mjm6.js → Accordion-7eysykr1.js} +4 -4
  155. package/web-dist/chunks/{Accordion-q2yxtdzc.js → Accordion-95003ycq.js} +144 -27
  156. package/web-dist/chunks/{Accordion-hadw5304.js → Accordion-98886mbn.js} +1 -1
  157. package/web-dist/chunks/{Accordion-vtbs98r4.js → Accordion-a0hbjxg9.js} +4 -4
  158. package/web-dist/chunks/{Accordion-73p2mg3h.js → Accordion-a49s4ywn.js} +4 -4
  159. package/web-dist/chunks/{Accordion-tb0vc91c.js → Accordion-a8b6g53f.js} +4 -4
  160. package/web-dist/chunks/{Accordion-25v2vczc.js → Accordion-afxbyvwp.js} +3 -3
  161. package/web-dist/chunks/{Accordion-g5pvs1aa.js → Accordion-ajqj6ymg.js} +5 -5
  162. package/web-dist/chunks/{Accordion-w2kx944a.js → Accordion-ak6dvant.js} +3 -3
  163. package/web-dist/chunks/{Accordion-778fjjsh.js → Accordion-b1tqkxx6.js} +3 -3
  164. package/web-dist/chunks/{Accordion-rp9cjtpg.js → Accordion-bm30dkbw.js} +2 -2
  165. package/web-dist/chunks/{Accordion-rsw5jt7m.js → Accordion-cah5j61y.js} +2 -2
  166. package/web-dist/chunks/{Accordion-pr1tv6jx.js → Accordion-dfr26j8m.js} +1 -1
  167. package/web-dist/chunks/{Accordion-zmrbktd8.js → Accordion-dnfgtbq3.js} +8 -8
  168. package/web-dist/chunks/{Accordion-m3tq2vcc.js → Accordion-dy1j2a7p.js} +6 -6
  169. package/web-dist/chunks/{Accordion-7pgh8q4h.js → Accordion-e9jwetg7.js} +2 -2
  170. package/web-dist/chunks/{Accordion-gnkzvj03.js → Accordion-e9xmwxzp.js} +1 -1
  171. package/web-dist/chunks/{Accordion-q8ymmar7.js → Accordion-ek0hh2nx.js} +4 -4
  172. package/web-dist/chunks/{Accordion-2berhsg5.js → Accordion-et7xzm6k.js} +9 -9
  173. package/web-dist/chunks/Accordion-eysfka31.js +1590 -0
  174. package/web-dist/chunks/{Accordion-59x6e7bs.js → Accordion-gb3mfjmx.js} +43 -20
  175. package/web-dist/chunks/{Accordion-3xfqmr1r.js → Accordion-gy3bx3xa.js} +2 -2
  176. package/web-dist/chunks/{Accordion-tj4fe6wk.js → Accordion-h2rnzgyv.js} +3 -3
  177. package/web-dist/chunks/Accordion-hbwhya78.js +83 -0
  178. package/web-dist/chunks/{Accordion-t9w365ke.js → Accordion-hbwyj12m.js} +1 -1
  179. package/web-dist/chunks/Accordion-jkgd7dmf.js +1 -0
  180. package/web-dist/chunks/{Accordion-qwftammh.js → Accordion-kxjjp03t.js} +5 -5
  181. package/web-dist/chunks/Accordion-mkd3k28h.js +275 -0
  182. package/web-dist/chunks/{Accordion-xqkkfwkm.js → Accordion-nhf8zjt4.js} +2 -2
  183. package/web-dist/chunks/{Accordion-hg4db1sk.js → Accordion-p84h11ek.js} +4 -4
  184. package/web-dist/chunks/{Accordion-zhgty1ae.js → Accordion-pagdkp07.js} +3 -3
  185. package/web-dist/chunks/{Accordion-dv5c27w4.js → Accordion-pjbmmr20.js} +1 -1
  186. package/web-dist/chunks/{Accordion-7ayxbm7k.js → Accordion-pr4a281g.js} +1 -1
  187. package/web-dist/chunks/{Accordion-yca8r7kx.js → Accordion-qz6ddnmv.js} +3 -3
  188. package/web-dist/chunks/{Accordion-dcjzxzv3.js → Accordion-rv90tjqr.js} +2 -2
  189. package/web-dist/chunks/{Accordion-0zk0xp73.js → Accordion-snk6nggm.js} +326 -174
  190. package/web-dist/chunks/{Accordion-casb2ndy.js → Accordion-th7yhwhf.js} +5 -5
  191. package/web-dist/chunks/{Accordion-e6ettgh0.js → Accordion-vbh3xqv6.js} +2 -2
  192. package/web-dist/chunks/{Accordion-vdzyhtyd.js → Accordion-w4zh2nws.js} +8 -8
  193. package/web-dist/chunks/Accordion-w8zke8fa.js +37 -0
  194. package/web-dist/chunks/{Accordion-3e60xwvy.js → Accordion-wkqemqjw.js} +1 -1
  195. package/web-dist/chunks/{Accordion-vwqf8kn1.js → Accordion-x9sb23p3.js} +3 -3
  196. package/web-dist/chunks/{Accordion-xhkphta6.js → Accordion-y6sg47rv.js} +1 -1
  197. package/web-dist/chunks/{Accordion-mw8zh0vs.js → Accordion-yannd7r3.js} +4 -4
  198. package/web-dist/chunks/{Accordion-457amtv7.js → Accordion-z3m3wvfz.js} +6 -1580
  199. package/web-dist/chunks/{Accordion-pvcdvh3w.js → Accordion-zagrbkq1.js} +2 -2
  200. package/web-dist/chunks/{Accordion-2jcas7qq.js → Accordion-zays65re.js} +5 -5
  201. package/web-dist/chunks/{RichTextClient-w75r2x97.js → RichTextClient-qd6gmm0x.js} +12 -11
  202. package/web-dist/chunks/{Video.native-bb9g33nd.js → Video.native-7zsbp5vg.js} +7 -6
  203. package/web-dist/components/accordion/Accordion.js +6 -5
  204. package/web-dist/components/accordion-item/AccordionItem.js +6 -5
  205. package/web-dist/components/activity-indicator/ActivityIndicator.js +1 -1
  206. package/web-dist/components/app-bar/AppBar.js +8 -7
  207. package/web-dist/components/app-header/AppHeader.js +8 -7
  208. package/web-dist/components/app-shell/AppShell.js +3 -2
  209. package/web-dist/components/audio/Audio.js +6 -5
  210. package/web-dist/components/auth-screen/AuthScreen.js +11 -10
  211. package/web-dist/components/avatar/Avatar.js +6 -5
  212. package/web-dist/components/avatar-group/AvatarGroup.js +6 -5
  213. package/web-dist/components/badge/Badge.js +2 -2
  214. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +11 -10
  215. package/web-dist/components/bottom-sheet/BottomSheet.js +4 -3
  216. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +4 -3
  217. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +4 -3
  218. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +4 -3
  219. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +4 -3
  220. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +4 -3
  221. package/web-dist/components/breadcrumbs/Breadcrumbs.js +6 -5
  222. package/web-dist/components/button/Button.js +4 -3
  223. package/web-dist/components/button-group/ButtonGroup.js +4 -3
  224. package/web-dist/components/calendar/Calendar.js +8 -7
  225. package/web-dist/components/camera-permission-view/CameraPermissionView.js +11 -10
  226. package/web-dist/components/card/Card.js +10 -9
  227. package/web-dist/components/card-back/CardBack.js +2 -2
  228. package/web-dist/components/card-hand/CardHand.js +2 -2
  229. package/web-dist/components/chat-list-item/ChatListItem.js +8 -7
  230. package/web-dist/components/checkbox/Checkbox.js +5 -4
  231. package/web-dist/components/checkbox-group/CheckboxGroup.js +5 -4
  232. package/web-dist/components/chess-board/ChessBoard.js +4 -3
  233. package/web-dist/components/chip/Chip.js +6 -5
  234. package/web-dist/components/chip-group/ChipGroup.js +6 -5
  235. package/web-dist/components/collection-editor/CollectionEditor.js +10 -9
  236. package/web-dist/components/color-hue-scale/ColorHueScale.js +17 -15
  237. package/web-dist/components/color-picker/ColorPicker.js +17 -15
  238. package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +3 -3
  239. package/web-dist/components/color-tone/ColorTone.js +17 -15
  240. package/web-dist/components/color-tone/ColorTone.types-0.d.ts +3 -3
  241. package/web-dist/components/color-wheel/ColorWheel.js +17 -15
  242. package/web-dist/components/color-wheel/ColorWheel.types-0.d.ts +1 -1
  243. package/web-dist/components/content-rail/ContentRail.js +5 -4
  244. package/web-dist/components/data-table/DataTable.js +16 -15
  245. package/web-dist/components/date-picker/DatePicker.js +10 -9
  246. package/web-dist/components/dialog/Dialog.js +5 -4
  247. package/web-dist/components/divider/Divider.js +3 -2
  248. package/web-dist/components/empty-state/EmptyState.js +11 -10
  249. package/web-dist/components/explorer/Explorer.js +8 -7
  250. package/web-dist/components/field/Field.js +5 -4
  251. package/web-dist/components/file-explorer/FileExplorer.js +8 -7
  252. package/web-dist/components/flat-list/FlatList.js +6 -5
  253. package/web-dist/components/flow-canvas/FlowCanvas.d.ts +7 -0
  254. package/web-dist/components/flow-canvas/FlowCanvas.dependency-0.d.ts +27 -0
  255. package/web-dist/components/flow-canvas/FlowCanvas.dependency-1.d.ts +3 -0
  256. package/web-dist/components/flow-canvas/FlowCanvas.js +513 -0
  257. package/web-dist/components/flow-canvas/FlowCanvas.types-0.d.ts +92 -0
  258. package/web-dist/components/flow-canvas/index.d.ts +2 -0
  259. package/web-dist/components/flow-canvas/index.js +2 -0
  260. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +11 -10
  261. package/web-dist/components/form/Form.js +7 -6
  262. package/web-dist/components/form-actions/FormActions.js +7 -6
  263. package/web-dist/components/form-error/FormError.js +7 -6
  264. package/web-dist/components/game/Game.js +4 -3
  265. package/web-dist/components/game-entity/GameEntity.js +4 -3
  266. package/web-dist/components/game-field/GameField.js +4 -3
  267. package/web-dist/components/game-input-zone/GameInputZone.js +4 -3
  268. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +4 -3
  269. package/web-dist/components/game-overlay/GameOverlay.js +4 -3
  270. package/web-dist/components/gradient/Gradient.js +4 -3
  271. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +4 -3
  272. package/web-dist/components/graph-node/GraphNode.d.ts +7 -0
  273. package/web-dist/components/graph-node/GraphNode.dependency-0.d.ts +27 -0
  274. package/web-dist/components/graph-node/GraphNode.dependency-1.d.ts +3 -0
  275. package/web-dist/components/graph-node/GraphNode.dependency-2.d.ts +5 -0
  276. package/web-dist/components/graph-node/GraphNode.js +20 -0
  277. package/web-dist/components/graph-node/GraphNode.types-0.d.ts +46 -0
  278. package/web-dist/components/graph-node/index.d.ts +2 -0
  279. package/web-dist/components/graph-node/index.js +2 -0
  280. package/web-dist/components/grid/Grid.js +3 -2
  281. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +2 -2
  282. package/web-dist/components/grid-ruler/GridRuler.js +2 -2
  283. package/web-dist/components/grid-view/GridView.d.ts +1 -1
  284. package/web-dist/components/grid-view/GridView.js +2 -1
  285. package/web-dist/components/grid-view/GridView.types-0.d.ts +21 -0
  286. package/web-dist/components/heading/Heading.js +2 -2
  287. package/web-dist/components/hero/Hero.js +10 -9
  288. package/web-dist/components/icon/Icon.js +2 -2
  289. package/web-dist/components/icon-button/IconButton.js +4 -3
  290. package/web-dist/components/image/Image.js +5 -4
  291. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +2 -2
  292. package/web-dist/components/link/Link.js +2 -2
  293. package/web-dist/components/list/List.js +6 -5
  294. package/web-dist/components/list-item/ListItem.js +6 -5
  295. package/web-dist/components/list-section/ListSection.js +6 -5
  296. package/web-dist/components/master-detail/MasterDetail.js +3 -2
  297. package/web-dist/components/matrix-grid/MatrixGrid.js +5 -4
  298. package/web-dist/components/media-card/MediaCard.js +10 -9
  299. package/web-dist/components/media-explorer/MediaExplorer.js +8 -7
  300. package/web-dist/components/message-bubble/MessageBubble.js +8 -7
  301. package/web-dist/components/metric-card/MetricCard.js +10 -9
  302. package/web-dist/components/missing-element/MissingElement.js +5 -4
  303. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +11 -10
  304. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +11 -10
  305. package/web-dist/components/opening-book/OpeningBook.js +4 -3
  306. package/web-dist/components/otp-form/OtpForm.js +11 -10
  307. package/web-dist/components/pagination/Pagination.js +5 -4
  308. package/web-dist/components/palette-item/PaletteItem.js +10 -9
  309. package/web-dist/components/playing-card/PlayingCard.js +2 -2
  310. package/web-dist/components/poker-training-table/PokerTrainingTable.js +2 -2
  311. package/web-dist/components/popover/Popover.js +1 -1
  312. package/web-dist/components/popover-menu/PopoverMenu.js +5 -4
  313. package/web-dist/components/post-card/PostCard.js +10 -9
  314. package/web-dist/components/product-card/ProductCard.js +10 -9
  315. package/web-dist/components/progress/Progress.js +5 -4
  316. package/web-dist/components/progress-ring/ProgressRing.js +5 -4
  317. package/web-dist/components/radio/Radio.js +6 -5
  318. package/web-dist/components/radio-group/RadioGroup.js +6 -5
  319. package/web-dist/components/rating/Rating.js +4 -3
  320. package/web-dist/components/reader/Reader.js +11 -10
  321. package/web-dist/components/rich-text/RichText.js +3 -3
  322. package/web-dist/components/runtime-authoring-overlay/RuntimeAuthoringOverlay.js +4 -3
  323. package/web-dist/components/scan-overlay/ScanOverlay.js +11 -10
  324. package/web-dist/components/screen/Screen.js +3 -2
  325. package/web-dist/components/screen-section/ScreenSection.js +5 -4
  326. package/web-dist/components/scroll-view/ScrollView.js +3 -2
  327. package/web-dist/components/search-input/SearchInput.js +6 -5
  328. package/web-dist/components/section-header/SectionHeader.js +5 -4
  329. package/web-dist/components/section-list/SectionList.js +6 -5
  330. package/web-dist/components/select/Select.js +11 -10
  331. package/web-dist/components/selectable-item/SelectableItem.js +4 -3
  332. package/web-dist/components/selection-provider/SelectionProvider.js +4 -3
  333. package/web-dist/components/sign-in-form/SignInForm.js +11 -10
  334. package/web-dist/components/sign-up-form/SignUpForm.js +11 -10
  335. package/web-dist/components/skeleton/Skeleton.js +13 -12
  336. package/web-dist/components/skeleton-card/SkeletonCard.js +13 -12
  337. package/web-dist/components/skeleton-list/SkeletonList.js +13 -12
  338. package/web-dist/components/skeleton-text/SkeletonText.js +13 -12
  339. package/web-dist/components/spatial-grid/SpatialGrid.js +2 -1
  340. package/web-dist/components/surface/Surface.js +2 -2
  341. package/web-dist/components/switch/Switch.js +1 -1
  342. package/web-dist/components/tab/Tab.js +2 -2
  343. package/web-dist/components/tab-list/TabList.js +2 -2
  344. package/web-dist/components/tab-panel/TabPanel.js +2 -2
  345. package/web-dist/components/tabletop-table/TabletopTable.js +2 -2
  346. package/web-dist/components/tabs/Tabs.js +2 -2
  347. package/web-dist/components/text/Text.js +2 -2
  348. package/web-dist/components/text-input/TextInput.js +5 -4
  349. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +4 -3
  350. package/web-dist/components/tile-grid/TileGrid.js +2 -1
  351. package/web-dist/components/time-grid/TimeGrid.d.ts +1 -1
  352. package/web-dist/components/time-grid/TimeGrid.dependency-2.d.ts +13 -0
  353. package/web-dist/components/time-grid/TimeGrid.js +3 -2
  354. package/web-dist/components/time-grid/TimeGrid.types-0.d.ts +10 -0
  355. package/web-dist/components/time-picker/TimePicker.js +7 -6
  356. package/web-dist/components/timeline/Timeline.js +6 -5
  357. package/web-dist/components/toast/Toast.js +2 -2
  358. package/web-dist/components/toast-provider/ToastProvider.js +2 -2
  359. package/web-dist/components/toolbar/Toolbar.js +11 -10
  360. package/web-dist/components/tree-item/TreeItem.js +9 -8
  361. package/web-dist/components/uploader/Uploader.js +13 -12
  362. package/web-dist/components/video/Video.js +7 -6
  363. package/web-dist/components/view/View.js +3 -2
  364. package/web-dist/components/zora-provider/ZoraProvider.d.ts +7 -0
  365. package/web-dist/components/zora-provider/ZoraProvider.dependency-0.d.ts +15 -0
  366. package/web-dist/components/zora-provider/ZoraProvider.js +11 -0
  367. package/web-dist/components/zora-provider/ZoraProvider.types-0.d.ts +19 -0
  368. package/web-dist/components/zora-provider/index.d.ts +2 -0
  369. package/web-dist/components/zora-provider/index.js +2 -0
  370. package/web-dist/components/zora-theme-scope/ZoraThemeScope.d.ts +14 -0
  371. package/web-dist/components/zora-theme-scope/ZoraThemeScope.js +11 -0
  372. package/web-dist/components/zora-theme-scope/ZoraThemeScope.types-0.d.ts +3 -0
  373. package/web-dist/components/zora-theme-scope/index.d.ts +2 -0
  374. package/web-dist/components/zora-theme-scope/index.js +2 -0
  375. package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +3 -2
  376. package/web-dist/manifest.json +1059 -832
  377. package/web-dist/runtime/ZoraProvider.js +4 -80
@@ -11,6 +11,7 @@ import {
11
11
  } from '@ankhorage/grid-view';
12
12
  import React from 'react';
13
13
  import {
14
+ Platform,
14
15
  Pressable as NativePressable,
15
16
  ScrollView as NativeScrollView,
16
17
  Text as NativeText,
@@ -19,6 +20,9 @@ import {
19
20
 
20
21
  import type { GridScrollAxis, GridScrollSync, GridViewProps } from '../../../../types/grid-view';
21
22
  import type { ReactNativeComponentInstance } from '../../../../types/react-native';
23
+ import { ScrollGestureLockContext } from '../../../layout/adapters/inbound/ScrollGestureLockContext';
24
+ import { useScrollGestureLock } from '../../../layout/adapters/inbound/useScrollGestureLock';
25
+ import { createScrollGestureLock } from '../../../layout/utils/createScrollGestureLock';
22
26
  import { createGridScrollSync } from '../../application/createGridScrollSync';
23
27
 
24
28
  type PinchGesture = Readonly<{ distance: number; focalPoint: GridPoint }>;
@@ -56,7 +60,10 @@ export function GridView({
56
60
  renderItem,
57
61
  testID,
58
62
  viewportInteraction = 'enabled',
63
+ viewportControls = 'visible',
64
+ renderWorldLayer,
59
65
  }: GridViewProps) {
66
+ const parentScrollLock = useScrollGestureLock();
60
67
  const [uncontrolledViewport, setUncontrolledViewport] = React.useState(() =>
61
68
  createInitialViewport(width, height, zoom, defaultViewport),
62
69
  );
@@ -67,12 +74,14 @@ export function GridView({
67
74
  const gridRef = React.useRef<ReactNativeComponentInstance<typeof NativeView>>(null);
68
75
  const panRef = React.useRef<(displacement: GridPoint) => void>(() => undefined);
69
76
  const scrollSyncRef = React.useRef<GridScrollSync | undefined>(undefined);
77
+ const dragPanRef = React.useRef<GridPoint | undefined>(undefined);
70
78
  const pinchGestureRef = React.useRef<PinchGesture | undefined>(undefined);
71
79
  const pinchMeasurementRef = React.useRef(0);
72
80
  const pinchSessionRef = React.useRef(0);
73
81
  const viewportOriginRef = React.useRef<ViewportOrigin>({ x: 0, y: 0 });
74
82
  const focusRevealProposalRef = React.useRef<FocusRevealProposal | undefined>(undefined);
75
83
  const focusRevealViewportRef = React.useRef<GridViewport | undefined>(undefined);
84
+ const [activeItemGestures, setActiveItemGestures] = React.useState(0);
76
85
  const [isPinching, setIsPinching] = React.useState(false);
77
86
  const constraints = React.useMemo(
78
87
  () => viewportConstraints ?? createContentConstraints(contentWidth, contentHeight),
@@ -102,6 +111,13 @@ export function GridView({
102
111
  const uncontrolled = controlledViewport === undefined;
103
112
  const interactive = interactionPolicy !== 'passive';
104
113
  const viewportInteractive = interactive && viewportInteraction === 'enabled';
114
+ const scrollLock = React.useMemo(
115
+ () =>
116
+ createScrollGestureLock(parentScrollLock, (delta) =>
117
+ setActiveItemGestures((count) => count + delta),
118
+ ),
119
+ [parentScrollLock],
120
+ );
105
121
 
106
122
  const publish = React.useCallback(
107
123
  (nextViewport: GridViewport) => {
@@ -129,7 +145,7 @@ export function GridView({
129
145
  ),
130
146
  );
131
147
 
132
- React.useEffect(() => {
148
+ React.useLayoutEffect(() => {
133
149
  viewportRef.current = viewport;
134
150
  }, [viewport]);
135
151
 
@@ -144,8 +160,7 @@ export function GridView({
144
160
  // Declared before the viewport-sync effect so the arbiter exists when that effect runs.
145
161
  React.useEffect(() => {
146
162
  const scrollSync = createGridScrollSync({
147
- onProgrammaticScroll: (axis, displacement) =>
148
- panRef.current(axis === 'x' ? { x: -displacement, y: 0 } : { x: 0, y: -displacement }),
163
+ acceptUnownedScroll: Platform.OS === 'web',
149
164
  onUserScroll: (axis, displacement) =>
150
165
  panRef.current(axis === 'x' ? { x: -displacement, y: 0 } : { x: 0, y: -displacement }),
151
166
  scrollTo: (axis, offset, animated) => {
@@ -160,11 +175,48 @@ export function GridView({
160
175
  };
161
176
  }, []);
162
177
 
163
- /** Routes native scroll events to the arbiter unless a pinch owns the gesture. */
178
+ /** Routes native scroll events to the arbiter unless a pinch or an item gesture owns the scroll. */
164
179
  const handleNativeScroll = (axis: GridScrollAxis, offset: number) => {
180
+ if (scrollLock.isActive?.()) {
181
+ const mapping = createScrollMapping(viewportRef.current, constraints);
182
+ scrollSyncRef.current?.restore(
183
+ axis,
184
+ offset,
185
+ axis === 'x' ? mapping.horizontal.position : mapping.vertical.position,
186
+ );
187
+ return;
188
+ }
165
189
  if (!pinchGestureRef.current) scrollSyncRef.current?.scrolled(axis, offset);
166
190
  };
167
191
 
192
+ /*** Keeps locked native lifecycle signals under the same restore ownership as their scroll frames. */
193
+ const handleNativeScrollBegan = (axis: GridScrollAxis, offset: number) => {
194
+ if (scrollLock.isActive?.()) {
195
+ const mapping = createScrollMapping(viewportRef.current, constraints);
196
+ scrollSyncRef.current?.restore(
197
+ axis,
198
+ offset,
199
+ axis === 'x' ? mapping.horizontal.position : mapping.vertical.position,
200
+ );
201
+ return;
202
+ }
203
+ scrollSyncRef.current?.dragBegan(axis, offset);
204
+ };
205
+
206
+ /*** Keeps locked native completion signals from settling a descendant gesture as a viewport pan. */
207
+ const handleNativeScrollEnded = (axis: GridScrollAxis, offset: number) => {
208
+ if (scrollLock.isActive?.()) {
209
+ const mapping = createScrollMapping(viewportRef.current, constraints);
210
+ scrollSyncRef.current?.restore(
211
+ axis,
212
+ offset,
213
+ axis === 'x' ? mapping.horizontal.position : mapping.vertical.position,
214
+ );
215
+ return;
216
+ }
217
+ scrollSyncRef.current?.scrollEnded(axis, offset);
218
+ };
219
+
168
220
  const refreshViewportOrigin = React.useCallback(() => {
169
221
  gridRef.current?.measureInWindow((x, y) => {
170
222
  viewportOriginRef.current = { x, y };
@@ -295,158 +347,204 @@ export function GridView({
295
347
  };
296
348
 
297
349
  return (
298
- <NativeView
299
- ref={gridRef}
300
- accessibilityLabel="Interactive grid viewport"
301
- onLayout={refreshViewportOrigin}
302
- onTouchEnd={() => {
303
- const wasPinching = pinchGestureRef.current !== undefined;
304
- pinchMeasurementRef.current += 1;
305
- pinchSessionRef.current += 1;
306
- pinchGestureRef.current = undefined;
307
- setIsPinching(false);
308
- if (wasPinching) syncScrollPosition();
309
- }}
310
- onTouchCancel={() => {
311
- const wasPinching = pinchGestureRef.current !== undefined;
312
- pinchMeasurementRef.current += 1;
313
- pinchSessionRef.current += 1;
314
- pinchGestureRef.current = undefined;
315
- setIsPinching(false);
316
- if (wasPinching) syncScrollPosition();
317
- }}
318
- onTouchMove={(event) => {
319
- if (!viewportInteractive) return;
320
- measurePinchGesture([...event.nativeEvent.touches], pinchSessionRef.current, (pinch) => {
321
- const previous = pinchGestureRef.current;
322
- pinchGestureRef.current = pinch;
323
- setIsPinching(pinch !== undefined);
324
- if (!pinch || !previous) return;
325
- zoomAt(pinch.focalPoint, pinch.distance / previous.distance);
326
- });
327
- }}
328
- onTouchStart={(event) => {
329
- const session = pinchSessionRef.current + 1;
330
- pinchSessionRef.current = session;
331
- measurePinchGesture([...event.nativeEvent.touches], session, (pinch) => {
332
- pinchGestureRef.current = pinch;
333
- setIsPinching(pinch !== undefined);
334
- });
335
- }}
336
- style={{ height, overflow: 'hidden', width }}
337
- testID={testID}
338
- >
339
- <NativeScrollView
340
- ref={horizontalScrollRef}
341
- testID={testID ? `${testID}-horizontal-scroll` : undefined}
342
- horizontal
343
- scrollEnabled={viewportInteractive && !isPinching}
344
- scrollEventThrottle={16}
345
- showsHorizontalScrollIndicator
346
- style={{ height, width }}
347
- onMomentumScrollEnd={(event) =>
348
- scrollSyncRef.current?.scrollEnded('x', event.nativeEvent.contentOffset.x)
349
- }
350
- onScroll={(event) => handleNativeScroll('x', event.nativeEvent.contentOffset.x)}
351
- onScrollBeginDrag={(event) =>
352
- scrollSyncRef.current?.dragBegan('x', event.nativeEvent.contentOffset.x)
353
- }
350
+ <ScrollGestureLockContext.Provider value={scrollLock}>
351
+ <NativeView
352
+ ref={gridRef}
353
+ accessibilityLabel="Interactive grid viewport"
354
+ onLayout={refreshViewportOrigin}
355
+ onTouchEnd={() => {
356
+ const wasPinching = pinchGestureRef.current !== undefined;
357
+ pinchMeasurementRef.current += 1;
358
+ pinchSessionRef.current += 1;
359
+ pinchGestureRef.current = undefined;
360
+ setIsPinching(false);
361
+ if (wasPinching) syncScrollPosition();
362
+ }}
363
+ onTouchCancel={() => {
364
+ const wasPinching = pinchGestureRef.current !== undefined;
365
+ pinchMeasurementRef.current += 1;
366
+ pinchSessionRef.current += 1;
367
+ pinchGestureRef.current = undefined;
368
+ setIsPinching(false);
369
+ if (wasPinching) syncScrollPosition();
370
+ }}
371
+ onTouchMove={(event) => {
372
+ if (!viewportInteractive) return;
373
+ measurePinchGesture([...event.nativeEvent.touches], pinchSessionRef.current, (pinch) => {
374
+ const previous = pinchGestureRef.current;
375
+ pinchGestureRef.current = pinch;
376
+ setIsPinching(pinch !== undefined);
377
+ if (!pinch || !previous) return;
378
+ zoomAt(pinch.focalPoint, pinch.distance / previous.distance);
379
+ });
380
+ }}
381
+ onTouchStart={(event) => {
382
+ const session = pinchSessionRef.current + 1;
383
+ pinchSessionRef.current = session;
384
+ measurePinchGesture([...event.nativeEvent.touches], session, (pinch) => {
385
+ pinchGestureRef.current = pinch;
386
+ setIsPinching(pinch !== undefined);
387
+ });
388
+ }}
389
+ style={{ height, overflow: 'hidden', width }}
390
+ testID={testID}
354
391
  >
355
392
  <NativeScrollView
356
- ref={verticalScrollRef}
357
- testID={testID ? `${testID}-vertical-scroll` : undefined}
358
- scrollEnabled={viewportInteractive && !isPinching}
393
+ ref={horizontalScrollRef}
394
+ disableScrollViewPanResponder
395
+ nestedScrollEnabled
396
+ testID={testID ? `${testID}-horizontal-scroll` : undefined}
397
+ horizontal
398
+ scrollEnabled={viewportInteractive && activeItemGestures === 0 && !isPinching}
359
399
  scrollEventThrottle={16}
360
- showsVerticalScrollIndicator
361
- style={{ height, width: scrollMapping.horizontal.contentSize }}
400
+ showsHorizontalScrollIndicator
401
+ style={{ height, width }}
362
402
  onMomentumScrollEnd={(event) =>
363
- scrollSyncRef.current?.scrollEnded('y', event.nativeEvent.contentOffset.y)
403
+ handleNativeScrollEnded('x', event.nativeEvent.contentOffset.x)
364
404
  }
365
- onScroll={(event) => handleNativeScroll('y', event.nativeEvent.contentOffset.y)}
405
+ onScroll={(event) => handleNativeScroll('x', event.nativeEvent.contentOffset.x)}
366
406
  onScrollBeginDrag={(event) =>
367
- scrollSyncRef.current?.dragBegan('y', event.nativeEvent.contentOffset.y)
407
+ handleNativeScrollBegan('x', event.nativeEvent.contentOffset.x)
368
408
  }
369
409
  >
370
- <NativeView
371
- style={{
372
- height: scrollMapping.vertical.contentSize,
373
- width: scrollMapping.horizontal.contentSize,
374
- }}
410
+ <NativeScrollView
411
+ ref={verticalScrollRef}
412
+ disableScrollViewPanResponder
413
+ nestedScrollEnabled
414
+ testID={testID ? `${testID}-vertical-scroll` : undefined}
415
+ scrollEnabled={viewportInteractive && activeItemGestures === 0 && !isPinching}
416
+ scrollEventThrottle={16}
417
+ showsVerticalScrollIndicator
418
+ style={{ height, width: scrollMapping.horizontal.contentSize }}
419
+ onMomentumScrollEnd={(event) =>
420
+ handleNativeScrollEnded('y', event.nativeEvent.contentOffset.y)
421
+ }
422
+ onScroll={(event) => handleNativeScroll('y', event.nativeEvent.contentOffset.y)}
423
+ onScrollBeginDrag={(event) =>
424
+ handleNativeScrollBegan('y', event.nativeEvent.contentOffset.y)
425
+ }
375
426
  >
376
- {visibleItems.map((item) => {
377
- const position = worldToViewport(
378
- { x: item.x, y: item.y },
379
- { ...viewport, offsetX: 0, offsetY: 0 },
380
- );
381
- return (
427
+ <NativeView
428
+ style={{
429
+ height: scrollMapping.vertical.contentSize,
430
+ width: scrollMapping.horizontal.contentSize,
431
+ }}
432
+ >
433
+ {Platform.OS === 'web' && viewportInteractive ? (
382
434
  <NativeView
383
- key={item.id}
384
- style={{
385
- height: item.height * viewport.pixelsPerUnitY,
386
- left: position.x + scrollMapping.horizontal.origin,
387
- position: 'absolute',
388
- top: position.y + scrollMapping.vertical.origin,
389
- width: item.width * viewport.pixelsPerUnitX,
435
+ accessible={false}
436
+ onResponderGrant={(event) => {
437
+ dragPanRef.current = { x: event.nativeEvent.pageX, y: event.nativeEvent.pageY };
438
+ }}
439
+ onResponderMove={(event) => {
440
+ const previous = dragPanRef.current;
441
+ if (!previous) return;
442
+ const next = { x: event.nativeEvent.pageX, y: event.nativeEvent.pageY };
443
+ dragPanRef.current = next;
444
+ pan({ x: next.x - previous.x, y: next.y - previous.y });
445
+ }}
446
+ onResponderRelease={() => {
447
+ dragPanRef.current = undefined;
390
448
  }}
391
- >
392
- {renderItem(item)}
449
+ onResponderTerminate={() => {
450
+ dragPanRef.current = undefined;
451
+ }}
452
+ onStartShouldSetResponderCapture={() => true}
453
+ style={fillStyle}
454
+ testID={testID ? `${testID}-background` : undefined}
455
+ />
456
+ ) : null}
457
+ {renderWorldLayer ? (
458
+ <NativeView pointerEvents="box-none" style={fillStyle}>
459
+ {renderWorldLayer({
460
+ height: scrollMapping.vertical.contentSize,
461
+ origin: {
462
+ x: scrollMapping.horizontal.origin,
463
+ y: scrollMapping.vertical.origin,
464
+ },
465
+ pixelsPerUnitX: viewport.pixelsPerUnitX,
466
+ pixelsPerUnitY: viewport.pixelsPerUnitY,
467
+ width: scrollMapping.horizontal.contentSize,
468
+ })}
393
469
  </NativeView>
394
- );
395
- })}
396
- </NativeView>
470
+ ) : null}
471
+ {visibleItems.map((item) => {
472
+ const position = worldToViewport(
473
+ { x: item.x, y: item.y },
474
+ { ...viewport, offsetX: 0, offsetY: 0 },
475
+ );
476
+ return (
477
+ <NativeView
478
+ key={item.id}
479
+ style={{
480
+ height: item.height * viewport.pixelsPerUnitY,
481
+ left: position.x + scrollMapping.horizontal.origin,
482
+ position: 'absolute',
483
+ top: position.y + scrollMapping.vertical.origin,
484
+ width: item.width * viewport.pixelsPerUnitX,
485
+ }}
486
+ >
487
+ {renderItem(item)}
488
+ </NativeView>
489
+ );
490
+ })}
491
+ </NativeView>
492
+ </NativeScrollView>
397
493
  </NativeScrollView>
398
- </NativeScrollView>
399
- {viewportInteractive ? (
400
- <NativeView accessibilityLabel="Viewport controls" style={controlsStyle}>
401
- <NativePressable
402
- accessibilityLabel="Pan left"
403
- accessibilityRole="button"
404
- onPress={() => pan({ x: 48, y: 0 })}
405
- >
406
- <NativeText>←</NativeText>
407
- </NativePressable>
408
- <NativePressable
409
- accessibilityLabel="Pan right"
410
- accessibilityRole="button"
411
- onPress={() => pan({ x: -48, y: 0 })}
412
- >
413
- <NativeText>→</NativeText>
414
- </NativePressable>
415
- <NativePressable
416
- accessibilityLabel="Pan up"
417
- accessibilityRole="button"
418
- onPress={() => pan({ x: 0, y: 48 })}
419
- >
420
- <NativeText>↑</NativeText>
421
- </NativePressable>
422
- <NativePressable
423
- accessibilityLabel="Pan down"
424
- accessibilityRole="button"
425
- onPress={() => pan({ x: 0, y: -48 })}
426
- >
427
- <NativeText>↓</NativeText>
428
- </NativePressable>
429
- <NativePressable
430
- accessibilityLabel="Zoom in"
431
- accessibilityRole="button"
432
- onPress={() => zoomAt({ x: width / 2, y: height / 2 }, 1.2)}
433
- >
434
- <NativeText>+</NativeText>
435
- </NativePressable>
436
- <NativePressable
437
- accessibilityLabel="Zoom out"
438
- accessibilityRole="button"
439
- onPress={() => zoomAt({ x: width / 2, y: height / 2 }, 1 / 1.2)}
440
- >
441
- <NativeText>−</NativeText>
442
- </NativePressable>
443
- </NativeView>
444
- ) : null}
445
- </NativeView>
494
+ {viewportInteractive && viewportControls === 'visible' ? (
495
+ <NativeView accessibilityLabel="Viewport controls" style={controlsStyle}>
496
+ <NativePressable
497
+ accessibilityLabel="Pan left"
498
+ accessibilityRole="button"
499
+ onPress={() => pan({ x: 48, y: 0 })}
500
+ >
501
+ <NativeText>←</NativeText>
502
+ </NativePressable>
503
+ <NativePressable
504
+ accessibilityLabel="Pan right"
505
+ accessibilityRole="button"
506
+ onPress={() => pan({ x: -48, y: 0 })}
507
+ >
508
+ <NativeText>→</NativeText>
509
+ </NativePressable>
510
+ <NativePressable
511
+ accessibilityLabel="Pan up"
512
+ accessibilityRole="button"
513
+ onPress={() => pan({ x: 0, y: 48 })}
514
+ >
515
+ <NativeText>↑</NativeText>
516
+ </NativePressable>
517
+ <NativePressable
518
+ accessibilityLabel="Pan down"
519
+ accessibilityRole="button"
520
+ onPress={() => pan({ x: 0, y: -48 })}
521
+ >
522
+ <NativeText>↓</NativeText>
523
+ </NativePressable>
524
+ <NativePressable
525
+ accessibilityLabel="Zoom in"
526
+ accessibilityRole="button"
527
+ onPress={() => zoomAt({ x: width / 2, y: height / 2 }, 1.2)}
528
+ >
529
+ <NativeText>+</NativeText>
530
+ </NativePressable>
531
+ <NativePressable
532
+ accessibilityLabel="Zoom out"
533
+ accessibilityRole="button"
534
+ onPress={() => zoomAt({ x: width / 2, y: height / 2 }, 1 / 1.2)}
535
+ >
536
+ <NativeText>−</NativeText>
537
+ </NativePressable>
538
+ </NativeView>
539
+ ) : null}
540
+ </NativeView>
541
+ </ScrollGestureLockContext.Provider>
446
542
  );
447
543
  }
448
544
 
545
+ const fillStyle = { bottom: 0, left: 0, position: 'absolute' as const, right: 0, top: 0 };
449
546
  const controlsStyle = { bottom: 8, gap: 4, position: 'absolute' as const, right: 8 };
547
+ const VIEWPORT_NUMERIC_TOLERANCE = Number.EPSILON * 1024;
450
548
 
451
549
  /*** Builds the initial world position and independent scales for uncontrolled rendering. */
452
550
  function createInitialViewport(
@@ -539,15 +637,20 @@ function createScrollAxisMapping({
539
637
  /*** Compares canonical viewport fields without treating equal proposals as state changes. */
540
638
  function areViewportsEqual(left: GridViewport, right: GridViewport): boolean {
541
639
  return (
542
- left.width === right.width &&
543
- left.height === right.height &&
544
- left.offsetX === right.offsetX &&
545
- left.offsetY === right.offsetY &&
546
- left.pixelsPerUnitX === right.pixelsPerUnitX &&
547
- left.pixelsPerUnitY === right.pixelsPerUnitY
640
+ areViewportValuesEqual(left.width, right.width) &&
641
+ areViewportValuesEqual(left.height, right.height) &&
642
+ areViewportValuesEqual(left.offsetX, right.offsetX) &&
643
+ areViewportValuesEqual(left.offsetY, right.offsetY) &&
644
+ areViewportValuesEqual(left.pixelsPerUnitX, right.pixelsPerUnitX) &&
645
+ areViewportValuesEqual(left.pixelsPerUnitY, right.pixelsPerUnitY)
548
646
  );
549
647
  }
550
648
 
649
+ /*** Treats machine-scale arithmetic residue as unchanged without rounding real viewport movement. */
650
+ function areViewportValuesEqual(left: number, right: number): boolean {
651
+ return Math.abs(left - right) <= VIEWPORT_NUMERIC_TOLERANCE;
652
+ }
653
+
551
654
  /*** Skips a rejected controlled focus proposal until its focus or incoming viewport changes. */
552
655
  function isRepeatedControlledFocusRevealProposal({
553
656
  controlled,
@@ -24,17 +24,16 @@ function advance(milliseconds: number) {
24
24
  }
25
25
 
26
26
  /*** Creates a controller whose native requests and user scrolls are recorded. */
27
- function createRecordedSync() {
28
- const programmaticScrolls: UserScroll[] = [];
27
+ function createRecordedSync(acceptUnownedScroll = true) {
29
28
  const requests: ScrollRequest[] = [];
30
29
  const userScrolls: UserScroll[] = [];
31
30
  const sync = createGridScrollSync({
31
+ acceptUnownedScroll,
32
32
  now: () => clock,
33
- onProgrammaticScroll: (axis, displacement) => programmaticScrolls.push([axis, displacement]),
34
33
  onUserScroll: (axis, displacement) => userScrolls.push([axis, displacement]),
35
34
  scrollTo: (axis, offset, animated) => requests.push([axis, offset, animated]),
36
35
  });
37
- return { programmaticScrolls, requests, sync, userScrolls };
36
+ return { requests, sync, userScrolls };
38
37
  }
39
38
 
40
39
  test('adopts native scrolling as user input when nothing was requested', () => {
@@ -133,24 +132,36 @@ test('keeps a vertical animation pending while the user drags horizontally', ()
133
132
  sync.dragBegan('x', 120);
134
133
  sync.scrolled('y', 80);
135
134
  sync.scrolled('y', 199.7);
135
+ sync.scrolled('x', 140);
136
136
 
137
- expect(userScrolls).toEqual([['x', -180]]);
137
+ expect(userScrolls).toEqual([['x', 20]]);
138
138
  });
139
139
 
140
- test('adopts the native offset reported when a drag interrupts an animation', () => {
140
+ test('uses a native drag-begin offset as the baseline when it interrupts an animation', () => {
141
141
  const { sync, userScrolls } = createRecordedSync();
142
142
  sync.request({ x: 0, y: 200 }, true);
143
143
  sync.scrolled('y', 40);
144
144
 
145
145
  sync.dragBegan('y', 55);
146
146
 
147
- expect(userScrolls).toEqual([['y', -145]]);
147
+ expect(userScrolls).toEqual([]);
148
148
  expect(jest.getTimerCount()).toBe(0);
149
149
  sync.scrolled('y', 70);
150
- expect(userScrolls).toEqual([
151
- ['y', -145],
152
- ['y', 15],
153
- ]);
150
+ expect(userScrolls).toEqual([['y', 15]]);
151
+ });
152
+
153
+ test('does not publish a viewport pan from a descendant gesture terminal offset at native drag begin', () => {
154
+ const { sync, userScrolls } = createRecordedSync(false);
155
+
156
+ sync.request({ x: 2000, y: 2000 }, false);
157
+ sync.scrolled('x', 2000);
158
+ sync.scrolled('y', 2000);
159
+ sync.dragBegan('x', 1995);
160
+ sync.dragBegan('y', 2004.6666666666665);
161
+ sync.scrollEnded('x', 1995);
162
+ sync.scrollEnded('y', 2004.6666666666665);
163
+
164
+ expect(userScrolls).toEqual([]);
154
165
  });
155
166
 
156
167
  test('adopts the final native offset when an unreachable animation ends short', () => {
@@ -201,8 +212,8 @@ test('suppresses late animation echoes even after fallback reconciles a stalled
201
212
  ]);
202
213
  });
203
214
 
204
- test('converges the logical position when a delayed animation resumes after fallback', () => {
205
- const { programmaticScrolls, sync, userScrolls } = createRecordedSync();
215
+ test('converges the logical position when a delayed browser animation resumes after fallback', () => {
216
+ const { sync, userScrolls } = createRecordedSync();
206
217
  sync.request({ x: 0, y: 200 }, true);
207
218
  sync.scrolled('y', 40);
208
219
 
@@ -213,10 +224,6 @@ test('converges the logical position when a delayed animation resumes after fall
213
224
  sync.scrollEnded('y', 200);
214
225
 
215
226
  expect(userScrolls).toEqual([['y', -160]]);
216
- expect(programmaticScrolls).toEqual([
217
- ['y', 60],
218
- ['y', 100],
219
- ]);
220
227
  });
221
228
 
222
229
  test('retargeting discards residual echo ownership from an earlier animation', () => {
@@ -277,6 +284,28 @@ test('returns control to the user once the programmatic scroll window expires',
277
284
  expect(userScrolls).toEqual([['y', -110]]);
278
285
  });
279
286
 
287
+ test('keeps restoration ownership through delayed lifecycle events without blocking the next drag', () => {
288
+ const { requests, sync, userScrolls } = createRecordedSync(false);
289
+
290
+ sync.restore('y', 24, 0);
291
+ sync.scrolled('y', 0);
292
+ sync.dragBegan('y', 24);
293
+ sync.scrollEnded('y', 24);
294
+ sync.scrolled('y', 0);
295
+
296
+ expect(userScrolls).toEqual([]);
297
+ expect(requests).toEqual([
298
+ ['y', 0, false],
299
+ ['y', 0, false],
300
+ ['y', 0, false],
301
+ ]);
302
+
303
+ sync.dragBegan('y', 0);
304
+ sync.scrolled('y', 16);
305
+
306
+ expect(userScrolls).toEqual([['y', 16]]);
307
+ });
308
+
280
309
  test('cancels every pending settle timer on dispose', () => {
281
310
  const { sync, userScrolls } = createRecordedSync();
282
311
  sync.request({ x: 300, y: 200 }, true);