@ankhorage/zora 28.10.1 → 28.11.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 (323) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts +5 -0
  4. package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts.map +1 -0
  5. package/dist/features/flow/adapters/inbound/FlowCanvas.js +261 -0
  6. package/dist/features/flow/adapters/inbound/FlowCanvas.js.map +1 -0
  7. package/dist/features/flow/application/createFlowEditorController.d.ts +13 -0
  8. package/dist/features/flow/application/createFlowEditorController.d.ts.map +1 -0
  9. package/dist/features/flow/application/createFlowEditorController.js +86 -0
  10. package/dist/features/flow/application/createFlowEditorController.js.map +1 -0
  11. package/dist/features/flow/application/getFlowPortAnchor.d.ts +10 -0
  12. package/dist/features/flow/application/getFlowPortAnchor.d.ts.map +1 -0
  13. package/dist/features/flow/application/getFlowPortAnchor.js +18 -0
  14. package/dist/features/flow/application/getFlowPortAnchor.js.map +1 -0
  15. package/dist/features/flow/application/mapFlowViewport.d.ts +10 -0
  16. package/dist/features/flow/application/mapFlowViewport.d.ts.map +1 -0
  17. package/dist/features/flow/application/mapFlowViewport.js +22 -0
  18. package/dist/features/flow/application/mapFlowViewport.js.map +1 -0
  19. package/dist/features/flow/public.d.ts +3 -0
  20. package/dist/features/flow/public.d.ts.map +1 -0
  21. package/dist/features/flow/public.js +2 -0
  22. package/dist/features/flow/public.js.map +1 -0
  23. package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts +5 -0
  24. package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts.map +1 -0
  25. package/dist/features/graph-node/adapters/inbound/GraphNode.js +190 -0
  26. package/dist/features/graph-node/adapters/inbound/GraphNode.js.map +1 -0
  27. package/dist/features/graph-node/getGraphNodePortGeometry.d.ts +17 -0
  28. package/dist/features/graph-node/getGraphNodePortGeometry.d.ts.map +1 -0
  29. package/dist/features/graph-node/getGraphNodePortGeometry.js +23 -0
  30. package/dist/features/graph-node/getGraphNodePortGeometry.js.map +1 -0
  31. package/dist/features/graph-node/public.d.ts +3 -0
  32. package/dist/features/graph-node/public.d.ts.map +1 -0
  33. package/dist/features/graph-node/public.js +2 -0
  34. package/dist/features/graph-node/public.js.map +1 -0
  35. package/dist/features/grid-view/adapters/inbound/GridView.d.ts +1 -1
  36. package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
  37. package/dist/features/grid-view/adapters/inbound/GridView.js +105 -41
  38. package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
  39. package/dist/features/grid-view/application/createGridScrollSync.d.ts +2 -5
  40. package/dist/features/grid-view/application/createGridScrollSync.d.ts.map +1 -1
  41. package/dist/features/grid-view/application/createGridScrollSync.js +109 -45
  42. package/dist/features/grid-view/application/createGridScrollSync.js.map +1 -1
  43. package/dist/features/grid-view/public.d.ts +1 -1
  44. package/dist/features/grid-view/public.d.ts.map +1 -1
  45. package/dist/features/grid-view/public.js.map +1 -1
  46. package/dist/features/layout/utils/createScrollGestureLock.d.ts.map +1 -1
  47. package/dist/features/layout/utils/createScrollGestureLock.js +4 -0
  48. package/dist/features/layout/utils/createScrollGestureLock.js.map +1 -1
  49. package/dist/features/theme/node.d.ts +5 -0
  50. package/dist/features/theme/node.d.ts.map +1 -0
  51. package/dist/features/theme/node.js +4 -0
  52. package/dist/features/theme/node.js.map +1 -0
  53. package/dist/features/theme/public.d.ts +2 -0
  54. package/dist/features/theme/public.d.ts.map +1 -1
  55. package/dist/features/theme/public.js +1 -0
  56. package/dist/features/theme/public.js.map +1 -1
  57. package/dist/types/flow.d.ts +81 -0
  58. package/dist/types/flow.d.ts.map +1 -0
  59. package/dist/types/flow.js +2 -0
  60. package/dist/types/flow.js.map +1 -0
  61. package/dist/types/graph-node.d.ts +42 -0
  62. package/dist/types/graph-node.d.ts.map +1 -0
  63. package/dist/types/graph-node.js +2 -0
  64. package/dist/types/graph-node.js.map +1 -0
  65. package/dist/types/grid-view.d.ts +27 -3
  66. package/dist/types/grid-view.d.ts.map +1 -1
  67. package/dist/types/grid-view.js.map +1 -1
  68. package/dist/types/layout.d.ts +2 -0
  69. package/dist/types/layout.d.ts.map +1 -1
  70. package/dist/types/layout.js.map +1 -1
  71. package/package.json +21 -3
  72. package/src/features/flow/adapters/inbound/FlowCanvas.tsx +501 -0
  73. package/src/features/flow/application/createFlowEditorController.test.ts +146 -0
  74. package/src/features/flow/application/createFlowEditorController.ts +99 -0
  75. package/src/features/flow/application/getFlowPortAnchor.test.ts +23 -0
  76. package/src/features/flow/application/getFlowPortAnchor.ts +30 -0
  77. package/src/features/flow/application/mapFlowViewport.test.ts +11 -0
  78. package/src/features/flow/application/mapFlowViewport.ts +29 -0
  79. package/src/features/flow/public.test.ts +7 -0
  80. package/src/features/flow/public.ts +13 -0
  81. package/src/features/graph-node/adapters/inbound/GraphNode.test.tsx +80 -0
  82. package/src/features/graph-node/adapters/inbound/GraphNode.tsx +259 -0
  83. package/src/features/graph-node/getGraphNodePortGeometry.test.ts +35 -0
  84. package/src/features/graph-node/getGraphNodePortGeometry.ts +41 -0
  85. package/src/features/graph-node/public.test.ts +7 -0
  86. package/src/features/graph-node/public.ts +2 -0
  87. package/src/features/grid-view/adapters/inbound/GridView.nativeScrollSync.test.tsx +198 -7
  88. package/src/features/grid-view/adapters/inbound/GridView.tsx +248 -145
  89. package/src/features/grid-view/application/createGridScrollSync.test.ts +46 -17
  90. package/src/features/grid-view/application/createGridScrollSync.ts +100 -43
  91. package/src/features/grid-view/public.ts +6 -1
  92. package/src/features/layout/utils/createScrollGestureLock.ts +4 -0
  93. package/src/features/theme/application/use-cases/compileZoraTheme.test.ts +1 -1
  94. package/src/features/theme/node.ts +18 -0
  95. package/src/features/theme/public.ts +7 -0
  96. package/src/platformAcceptance.test.ts +15 -11
  97. package/src/types/flow.ts +99 -0
  98. package/src/types/graph-node.ts +45 -0
  99. package/src/types/grid-view.ts +25 -3
  100. package/src/types/layout.ts +2 -0
  101. package/web-dist/chunks/{Accordion-9dq115tn.js → Accordion-064hgrct.js} +3 -3
  102. package/web-dist/chunks/{Accordion-wbf7gqrm.js → Accordion-2b3sd76b.js} +3 -3
  103. package/web-dist/chunks/{Accordion-k9n1yse4.js → Accordion-2kv6p7by.js} +10 -38
  104. package/web-dist/chunks/{Accordion-6gc0jw1n.js → Accordion-5x4cv0kv.js} +1 -1
  105. package/web-dist/chunks/{Accordion-r8swmfjm.js → Accordion-6d63tc7d.js} +1 -1
  106. package/web-dist/chunks/{Accordion-vbz1mjm6.js → Accordion-7eysykr1.js} +4 -4
  107. package/web-dist/chunks/{Accordion-59x6e7bs.js → Accordion-91qf4q27.js} +1 -1
  108. package/web-dist/chunks/{Accordion-hadw5304.js → Accordion-98886mbn.js} +1 -1
  109. package/web-dist/chunks/{Accordion-vtbs98r4.js → Accordion-a0hbjxg9.js} +4 -4
  110. package/web-dist/chunks/{Accordion-73p2mg3h.js → Accordion-a49s4ywn.js} +4 -4
  111. package/web-dist/chunks/{Accordion-tb0vc91c.js → Accordion-a8b6g53f.js} +4 -4
  112. package/web-dist/chunks/{Accordion-25v2vczc.js → Accordion-afxbyvwp.js} +3 -3
  113. package/web-dist/chunks/{Accordion-g5pvs1aa.js → Accordion-ajqj6ymg.js} +5 -5
  114. package/web-dist/chunks/{Accordion-w2kx944a.js → Accordion-ak6dvant.js} +3 -3
  115. package/web-dist/chunks/{Accordion-778fjjsh.js → Accordion-b1tqkxx6.js} +3 -3
  116. package/web-dist/chunks/{Accordion-rp9cjtpg.js → Accordion-bm30dkbw.js} +2 -2
  117. package/web-dist/chunks/{Accordion-rsw5jt7m.js → Accordion-cah5j61y.js} +2 -2
  118. package/web-dist/chunks/{Accordion-pr1tv6jx.js → Accordion-dfr26j8m.js} +1 -1
  119. package/web-dist/chunks/{Accordion-zmrbktd8.js → Accordion-dnfgtbq3.js} +8 -8
  120. package/web-dist/chunks/{Accordion-m3tq2vcc.js → Accordion-dy1j2a7p.js} +6 -6
  121. package/web-dist/chunks/{Accordion-7pgh8q4h.js → Accordion-e9jwetg7.js} +2 -2
  122. package/web-dist/chunks/{Accordion-gnkzvj03.js → Accordion-e9xmwxzp.js} +1 -1
  123. package/web-dist/chunks/{Accordion-q8ymmar7.js → Accordion-ek0hh2nx.js} +4 -4
  124. package/web-dist/chunks/{Accordion-2berhsg5.js → Accordion-et7xzm6k.js} +9 -9
  125. package/web-dist/chunks/Accordion-eysfka31.js +1590 -0
  126. package/web-dist/chunks/{Accordion-3xfqmr1r.js → Accordion-gy3bx3xa.js} +2 -2
  127. package/web-dist/chunks/{Accordion-tj4fe6wk.js → Accordion-h2rnzgyv.js} +3 -3
  128. package/web-dist/chunks/Accordion-hbwhya78.js +83 -0
  129. package/web-dist/chunks/{Accordion-t9w365ke.js → Accordion-hbwyj12m.js} +1 -1
  130. package/web-dist/chunks/{Accordion-q2yxtdzc.js → Accordion-j3esnt3f.js} +6 -6
  131. package/web-dist/chunks/Accordion-jkgd7dmf.js +1 -0
  132. package/web-dist/chunks/{Accordion-qwftammh.js → Accordion-kxjjp03t.js} +5 -5
  133. package/web-dist/chunks/Accordion-mkd3k28h.js +275 -0
  134. package/web-dist/chunks/{Accordion-xqkkfwkm.js → Accordion-nhf8zjt4.js} +2 -2
  135. package/web-dist/chunks/{Accordion-hg4db1sk.js → Accordion-p84h11ek.js} +4 -4
  136. package/web-dist/chunks/{Accordion-zhgty1ae.js → Accordion-pagdkp07.js} +3 -3
  137. package/web-dist/chunks/{Accordion-dv5c27w4.js → Accordion-pjbmmr20.js} +1 -1
  138. package/web-dist/chunks/{Accordion-7ayxbm7k.js → Accordion-pr4a281g.js} +1 -1
  139. package/web-dist/chunks/{Accordion-yca8r7kx.js → Accordion-qz6ddnmv.js} +3 -3
  140. package/web-dist/chunks/{Accordion-dcjzxzv3.js → Accordion-rv90tjqr.js} +2 -2
  141. package/web-dist/chunks/{Accordion-0zk0xp73.js → Accordion-snk6nggm.js} +326 -174
  142. package/web-dist/chunks/{Accordion-casb2ndy.js → Accordion-th7yhwhf.js} +5 -5
  143. package/web-dist/chunks/{Accordion-e6ettgh0.js → Accordion-vbh3xqv6.js} +2 -2
  144. package/web-dist/chunks/{Accordion-vdzyhtyd.js → Accordion-w4zh2nws.js} +8 -8
  145. package/web-dist/chunks/Accordion-w8zke8fa.js +37 -0
  146. package/web-dist/chunks/{Accordion-3e60xwvy.js → Accordion-wkqemqjw.js} +1 -1
  147. package/web-dist/chunks/{Accordion-vwqf8kn1.js → Accordion-x9sb23p3.js} +3 -3
  148. package/web-dist/chunks/{Accordion-xhkphta6.js → Accordion-y6sg47rv.js} +1 -1
  149. package/web-dist/chunks/{Accordion-mw8zh0vs.js → Accordion-yannd7r3.js} +4 -4
  150. package/web-dist/chunks/{Accordion-457amtv7.js → Accordion-z3m3wvfz.js} +6 -1580
  151. package/web-dist/chunks/{Accordion-pvcdvh3w.js → Accordion-zagrbkq1.js} +2 -2
  152. package/web-dist/chunks/{Accordion-2jcas7qq.js → Accordion-zays65re.js} +5 -5
  153. package/web-dist/chunks/{RichTextClient-w75r2x97.js → RichTextClient-qd6gmm0x.js} +12 -11
  154. package/web-dist/chunks/{Video.native-bb9g33nd.js → Video.native-7zsbp5vg.js} +7 -6
  155. package/web-dist/components/accordion/Accordion.js +6 -5
  156. package/web-dist/components/accordion-item/AccordionItem.js +6 -5
  157. package/web-dist/components/activity-indicator/ActivityIndicator.js +1 -1
  158. package/web-dist/components/app-bar/AppBar.js +8 -7
  159. package/web-dist/components/app-header/AppHeader.js +8 -7
  160. package/web-dist/components/app-shell/AppShell.js +3 -2
  161. package/web-dist/components/audio/Audio.js +6 -5
  162. package/web-dist/components/auth-screen/AuthScreen.js +11 -10
  163. package/web-dist/components/avatar/Avatar.js +6 -5
  164. package/web-dist/components/avatar-group/AvatarGroup.js +6 -5
  165. package/web-dist/components/badge/Badge.js +2 -2
  166. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +11 -10
  167. package/web-dist/components/bottom-sheet/BottomSheet.js +4 -3
  168. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +4 -3
  169. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +4 -3
  170. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +4 -3
  171. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +4 -3
  172. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +4 -3
  173. package/web-dist/components/breadcrumbs/Breadcrumbs.js +6 -5
  174. package/web-dist/components/button/Button.js +4 -3
  175. package/web-dist/components/button-group/ButtonGroup.js +4 -3
  176. package/web-dist/components/calendar/Calendar.js +8 -7
  177. package/web-dist/components/camera-permission-view/CameraPermissionView.js +11 -10
  178. package/web-dist/components/card/Card.js +10 -9
  179. package/web-dist/components/card-back/CardBack.js +2 -2
  180. package/web-dist/components/card-hand/CardHand.js +2 -2
  181. package/web-dist/components/chat-list-item/ChatListItem.js +8 -7
  182. package/web-dist/components/checkbox/Checkbox.js +5 -4
  183. package/web-dist/components/checkbox-group/CheckboxGroup.js +5 -4
  184. package/web-dist/components/chess-board/ChessBoard.js +4 -3
  185. package/web-dist/components/chip/Chip.js +6 -5
  186. package/web-dist/components/chip-group/ChipGroup.js +6 -5
  187. package/web-dist/components/collection-editor/CollectionEditor.js +10 -9
  188. package/web-dist/components/color-hue-scale/ColorHueScale.js +17 -15
  189. package/web-dist/components/color-picker/ColorPicker.js +17 -15
  190. package/web-dist/components/color-tone/ColorTone.js +17 -15
  191. package/web-dist/components/color-wheel/ColorWheel.js +17 -15
  192. package/web-dist/components/content-rail/ContentRail.js +5 -4
  193. package/web-dist/components/data-table/DataTable.js +16 -15
  194. package/web-dist/components/date-picker/DatePicker.js +10 -9
  195. package/web-dist/components/dialog/Dialog.js +5 -4
  196. package/web-dist/components/divider/Divider.js +3 -2
  197. package/web-dist/components/empty-state/EmptyState.js +11 -10
  198. package/web-dist/components/explorer/Explorer.js +8 -7
  199. package/web-dist/components/field/Field.js +5 -4
  200. package/web-dist/components/file-explorer/FileExplorer.js +8 -7
  201. package/web-dist/components/flat-list/FlatList.js +6 -5
  202. package/web-dist/components/flow-canvas/FlowCanvas.d.ts +7 -0
  203. package/web-dist/components/flow-canvas/FlowCanvas.dependency-0.d.ts +27 -0
  204. package/web-dist/components/flow-canvas/FlowCanvas.dependency-1.d.ts +3 -0
  205. package/web-dist/components/flow-canvas/FlowCanvas.js +513 -0
  206. package/web-dist/components/flow-canvas/FlowCanvas.types-0.d.ts +92 -0
  207. package/web-dist/components/flow-canvas/index.d.ts +2 -0
  208. package/web-dist/components/flow-canvas/index.js +2 -0
  209. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +11 -10
  210. package/web-dist/components/form/Form.js +7 -6
  211. package/web-dist/components/form-actions/FormActions.js +7 -6
  212. package/web-dist/components/form-error/FormError.js +7 -6
  213. package/web-dist/components/game/Game.js +4 -3
  214. package/web-dist/components/game-entity/GameEntity.js +4 -3
  215. package/web-dist/components/game-field/GameField.js +4 -3
  216. package/web-dist/components/game-input-zone/GameInputZone.js +4 -3
  217. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +4 -3
  218. package/web-dist/components/game-overlay/GameOverlay.js +4 -3
  219. package/web-dist/components/gradient/Gradient.js +4 -3
  220. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +4 -3
  221. package/web-dist/components/graph-node/GraphNode.d.ts +7 -0
  222. package/web-dist/components/graph-node/GraphNode.dependency-0.d.ts +27 -0
  223. package/web-dist/components/graph-node/GraphNode.dependency-1.d.ts +3 -0
  224. package/web-dist/components/graph-node/GraphNode.dependency-2.d.ts +5 -0
  225. package/web-dist/components/graph-node/GraphNode.js +20 -0
  226. package/web-dist/components/graph-node/GraphNode.types-0.d.ts +46 -0
  227. package/web-dist/components/graph-node/index.d.ts +2 -0
  228. package/web-dist/components/graph-node/index.js +2 -0
  229. package/web-dist/components/grid/Grid.js +3 -2
  230. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +2 -2
  231. package/web-dist/components/grid-ruler/GridRuler.js +2 -2
  232. package/web-dist/components/grid-view/GridView.d.ts +1 -1
  233. package/web-dist/components/grid-view/GridView.js +2 -1
  234. package/web-dist/components/grid-view/GridView.types-0.d.ts +21 -0
  235. package/web-dist/components/heading/Heading.js +2 -2
  236. package/web-dist/components/hero/Hero.js +10 -9
  237. package/web-dist/components/icon/Icon.js +2 -2
  238. package/web-dist/components/icon-button/IconButton.js +4 -3
  239. package/web-dist/components/image/Image.js +5 -4
  240. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +2 -2
  241. package/web-dist/components/link/Link.js +2 -2
  242. package/web-dist/components/list/List.js +6 -5
  243. package/web-dist/components/list-item/ListItem.js +6 -5
  244. package/web-dist/components/list-section/ListSection.js +6 -5
  245. package/web-dist/components/master-detail/MasterDetail.js +3 -2
  246. package/web-dist/components/matrix-grid/MatrixGrid.js +5 -4
  247. package/web-dist/components/media-card/MediaCard.js +10 -9
  248. package/web-dist/components/media-explorer/MediaExplorer.js +8 -7
  249. package/web-dist/components/message-bubble/MessageBubble.js +8 -7
  250. package/web-dist/components/metric-card/MetricCard.js +10 -9
  251. package/web-dist/components/missing-element/MissingElement.js +5 -4
  252. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +11 -10
  253. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +11 -10
  254. package/web-dist/components/opening-book/OpeningBook.js +4 -3
  255. package/web-dist/components/otp-form/OtpForm.js +11 -10
  256. package/web-dist/components/pagination/Pagination.js +5 -4
  257. package/web-dist/components/palette-item/PaletteItem.js +10 -9
  258. package/web-dist/components/playing-card/PlayingCard.js +2 -2
  259. package/web-dist/components/poker-training-table/PokerTrainingTable.js +2 -2
  260. package/web-dist/components/popover/Popover.js +1 -1
  261. package/web-dist/components/popover-menu/PopoverMenu.js +5 -4
  262. package/web-dist/components/post-card/PostCard.js +10 -9
  263. package/web-dist/components/product-card/ProductCard.js +10 -9
  264. package/web-dist/components/progress/Progress.js +5 -4
  265. package/web-dist/components/progress-ring/ProgressRing.js +5 -4
  266. package/web-dist/components/radio/Radio.js +6 -5
  267. package/web-dist/components/radio-group/RadioGroup.js +6 -5
  268. package/web-dist/components/rating/Rating.js +4 -3
  269. package/web-dist/components/reader/Reader.js +11 -10
  270. package/web-dist/components/rich-text/RichText.js +3 -3
  271. package/web-dist/components/runtime-authoring-overlay/RuntimeAuthoringOverlay.js +4 -3
  272. package/web-dist/components/scan-overlay/ScanOverlay.js +11 -10
  273. package/web-dist/components/screen/Screen.js +3 -2
  274. package/web-dist/components/screen-section/ScreenSection.js +5 -4
  275. package/web-dist/components/scroll-view/ScrollView.js +3 -2
  276. package/web-dist/components/search-input/SearchInput.js +6 -5
  277. package/web-dist/components/section-header/SectionHeader.js +5 -4
  278. package/web-dist/components/section-list/SectionList.js +6 -5
  279. package/web-dist/components/select/Select.js +11 -10
  280. package/web-dist/components/selectable-item/SelectableItem.js +4 -3
  281. package/web-dist/components/selection-provider/SelectionProvider.js +4 -3
  282. package/web-dist/components/sign-in-form/SignInForm.js +11 -10
  283. package/web-dist/components/sign-up-form/SignUpForm.js +11 -10
  284. package/web-dist/components/skeleton/Skeleton.js +13 -12
  285. package/web-dist/components/skeleton-card/SkeletonCard.js +13 -12
  286. package/web-dist/components/skeleton-list/SkeletonList.js +13 -12
  287. package/web-dist/components/skeleton-text/SkeletonText.js +13 -12
  288. package/web-dist/components/spatial-grid/SpatialGrid.js +2 -1
  289. package/web-dist/components/surface/Surface.js +2 -2
  290. package/web-dist/components/switch/Switch.js +1 -1
  291. package/web-dist/components/tab/Tab.js +2 -2
  292. package/web-dist/components/tab-list/TabList.js +2 -2
  293. package/web-dist/components/tab-panel/TabPanel.js +2 -2
  294. package/web-dist/components/tabletop-table/TabletopTable.js +2 -2
  295. package/web-dist/components/tabs/Tabs.js +2 -2
  296. package/web-dist/components/text/Text.js +2 -2
  297. package/web-dist/components/text-input/TextInput.js +5 -4
  298. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +4 -3
  299. package/web-dist/components/tile-grid/TileGrid.js +2 -1
  300. package/web-dist/components/time-grid/TimeGrid.js +3 -2
  301. package/web-dist/components/time-picker/TimePicker.js +7 -6
  302. package/web-dist/components/timeline/Timeline.js +6 -5
  303. package/web-dist/components/toast/Toast.js +2 -2
  304. package/web-dist/components/toast-provider/ToastProvider.js +2 -2
  305. package/web-dist/components/toolbar/Toolbar.js +11 -10
  306. package/web-dist/components/tree-item/TreeItem.js +9 -8
  307. package/web-dist/components/uploader/Uploader.js +13 -12
  308. package/web-dist/components/video/Video.js +7 -6
  309. package/web-dist/components/view/View.js +3 -2
  310. package/web-dist/components/zora-provider/ZoraProvider.d.ts +7 -0
  311. package/web-dist/components/zora-provider/ZoraProvider.dependency-0.d.ts +15 -0
  312. package/web-dist/components/zora-provider/ZoraProvider.js +11 -0
  313. package/web-dist/components/zora-provider/ZoraProvider.types-0.d.ts +19 -0
  314. package/web-dist/components/zora-provider/index.d.ts +2 -0
  315. package/web-dist/components/zora-provider/index.js +2 -0
  316. package/web-dist/components/zora-theme-scope/ZoraThemeScope.d.ts +14 -0
  317. package/web-dist/components/zora-theme-scope/ZoraThemeScope.js +11 -0
  318. package/web-dist/components/zora-theme-scope/ZoraThemeScope.types-0.d.ts +3 -0
  319. package/web-dist/components/zora-theme-scope/index.d.ts +2 -0
  320. package/web-dist/components/zora-theme-scope/index.js +2 -0
  321. package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +3 -2
  322. package/web-dist/manifest.json +1058 -832
  323. package/web-dist/runtime/ZoraProvider.js +4 -80
@@ -1,4 +1,9 @@
1
1
  'use client';
2
+ import {
3
+ createScrollGestureLock,
4
+ ScrollGestureLockContext,
5
+ useScrollGestureLock
6
+ } from "./Accordion-w8zke8fa.js";
2
7
  import {
3
8
  getVisibleGridItems,
4
9
  constrainViewport,
@@ -11,6 +16,7 @@ import {
11
16
  // src/features/grid-view/adapters/inbound/GridView.tsx
12
17
  import React from "react";
13
18
  import {
19
+ Platform,
14
20
  Pressable as NativePressable,
15
21
  ScrollView as NativeScrollView,
16
22
  Text as NativeText,
@@ -34,14 +40,16 @@ var AXES = ["x", "y"];
34
40
  function createGridScrollSync({
35
41
  scrollTo,
36
42
  onUserScroll,
37
- onProgrammaticScroll,
43
+ acceptUnownedScroll = true,
38
44
  now = Date.now,
39
45
  schedule = setTimeout,
40
46
  cancel = clearTimeout
41
47
  }) {
42
- let position = { x: 0, y: 0 };
48
+ let expectedPosition = { x: 0, y: 0 };
49
+ let observedPosition = { x: 0, y: 0 };
43
50
  const pending = new Map;
44
51
  const inFlight = new Map;
52
+ const userGestures = new Set;
45
53
  const echoTails = new Map;
46
54
  const timers = new Map;
47
55
  const clearTimer = (axis) => {
@@ -56,8 +64,16 @@ function createGridScrollSync({
56
64
  inFlight.delete(axis);
57
65
  };
58
66
  const adopt = (axis, offset) => {
59
- const displacement = offset - readAxis(position, axis);
60
- position = withAxis(position, axis, offset);
67
+ const displacement = offset - readAxis(observedPosition, axis);
68
+ observedPosition = withAxis(observedPosition, axis, offset);
69
+ expectedPosition = withAxis(expectedPosition, axis, offset);
70
+ if (displacement !== 0)
71
+ onUserScroll(axis, displacement);
72
+ };
73
+ const adoptFromExpected = (axis, offset) => {
74
+ const displacement = offset - readAxis(expectedPosition, axis);
75
+ observedPosition = withAxis(observedPosition, axis, offset);
76
+ expectedPosition = withAxis(expectedPosition, axis, offset);
61
77
  if (displacement !== 0)
62
78
  onUserScroll(axis, displacement);
63
79
  };
@@ -65,23 +81,51 @@ function createGridScrollSync({
65
81
  const pendingScroll = pending.get(axis);
66
82
  const offset = finalOffset ?? inFlight.get(axis);
67
83
  release(axis);
68
- if (offset !== undefined) {
69
- if (finalOffset === undefined && pendingScroll?.animated && !isSameOffset(offset, pendingScroll.target)) {
70
- echoTails.set(axis, { lastOffset: offset, target: pendingScroll.target });
71
- } else {
72
- echoTails.delete(axis);
73
- }
74
- adopt(axis, offset);
84
+ if (offset === undefined)
85
+ return;
86
+ if (pendingScroll?.animated && !isSameOffset(offset, pendingScroll.target)) {
87
+ echoTails.set(axis, { lastOffset: offset, target: pendingScroll.target });
88
+ } else {
89
+ echoTails.delete(axis);
75
90
  }
91
+ if (acceptUnownedScroll)
92
+ adoptFromExpected(axis, offset);
93
+ else
94
+ observedPosition = withAxis(observedPosition, axis, offset);
95
+ };
96
+ const restore = (axis, offset, target) => {
97
+ release(axis);
98
+ echoTails.delete(axis);
99
+ userGestures.delete(axis);
100
+ observedPosition = withAxis(observedPosition, axis, offset);
101
+ expectedPosition = withAxis(expectedPosition, axis, target);
102
+ pending.set(axis, {
103
+ animated: false,
104
+ expiresAt: Number.POSITIVE_INFINITY,
105
+ restoring: true,
106
+ target
107
+ });
108
+ if (!isSameOffset(offset, target))
109
+ scrollTo(axis, target, false);
76
110
  };
77
111
  const scrolled = (axis, offset) => {
112
+ const pendingScroll = pending.get(axis);
113
+ if (pendingScroll?.restoring) {
114
+ observedPosition = withAxis(observedPosition, axis, offset);
115
+ if (!isSameOffset(offset, pendingScroll.target))
116
+ restore(axis, offset, pendingScroll.target);
117
+ return;
118
+ }
119
+ if (userGestures.has(axis)) {
120
+ adopt(axis, offset);
121
+ return;
122
+ }
78
123
  const tail = echoTails.get(axis);
79
124
  if (tail) {
80
125
  if (isContinuingProgrammaticEcho(tail, offset)) {
81
- const displacement = offset - readAxis(position, axis);
82
- position = withAxis(position, axis, offset);
83
- if (displacement !== 0)
84
- onProgrammaticScroll(axis, displacement);
126
+ observedPosition = withAxis(observedPosition, axis, offset);
127
+ if (acceptUnownedScroll)
128
+ expectedPosition = withAxis(expectedPosition, axis, offset);
85
129
  if (isSameOffset(offset, tail.target))
86
130
  echoTails.delete(axis);
87
131
  else
@@ -90,49 +134,78 @@ function createGridScrollSync({
90
134
  }
91
135
  echoTails.delete(axis);
92
136
  }
93
- let pendingScroll = pending.get(axis);
94
- if (pendingScroll?.animated && now() > pendingScroll.expiresAt) {
95
- pendingScroll = { ...pendingScroll, expiresAt: now() + ANIMATED_SCROLL_WINDOW_MS };
96
- pending.set(axis, pendingScroll);
137
+ let currentPending = pendingScroll;
138
+ if (currentPending?.animated && now() > currentPending.expiresAt) {
139
+ currentPending = { ...currentPending, expiresAt: now() + ANIMATED_SCROLL_WINDOW_MS };
140
+ pending.set(axis, currentPending);
97
141
  }
98
- const source = resolveScrollEventSource(pendingScroll, offset, now());
99
- if (source === "in-flight" && pendingScroll) {
142
+ const source = resolveScrollEventSource(currentPending, offset, now());
143
+ if (source === "in-flight" && currentPending) {
100
144
  clearTimer(axis);
101
145
  inFlight.set(axis, offset);
102
- timers.set(axis, schedule(() => settle(axis), Math.max(0, pendingScroll.expiresAt - now())));
146
+ timers.set(axis, schedule(() => settle(axis), Math.max(0, currentPending.expiresAt - now())));
147
+ observedPosition = withAxis(observedPosition, axis, offset);
103
148
  return;
104
149
  }
105
- release(axis);
106
- if (source === "user")
150
+ if (source === "settled") {
151
+ release(axis);
152
+ observedPosition = withAxis(observedPosition, axis, offset);
153
+ return;
154
+ }
155
+ if (currentPending && !acceptUnownedScroll) {
156
+ release(axis);
157
+ observedPosition = withAxis(observedPosition, axis, offset);
158
+ return;
159
+ }
160
+ if (acceptUnownedScroll)
161
+ adoptFromExpected(axis, offset);
162
+ else
107
163
  adopt(axis, offset);
108
164
  };
109
165
  return {
110
- isCurrent: (next) => AXES.every((axis) => isSameOffset(readAxis(position, axis), readAxis(next, axis))),
166
+ isCurrent: (next) => AXES.every((axis) => isSameOffset(readAxis(expectedPosition, axis), readAxis(next, axis))),
111
167
  request: (next, animated) => {
112
168
  const windowMs = animated ? ANIMATED_SCROLL_WINDOW_MS : IMMEDIATE_SCROLL_WINDOW_MS;
113
169
  const expiresAt = now() + windowMs;
114
170
  for (const axis of AXES) {
115
171
  const target = readAxis(next, axis);
116
- if (isSameOffset(readAxis(position, axis), target))
172
+ if (isSameOffset(readAxis(expectedPosition, axis), target))
117
173
  continue;
118
174
  release(axis);
119
175
  echoTails.delete(axis);
176
+ userGestures.delete(axis);
120
177
  pending.set(axis, { animated, expiresAt, target });
121
178
  scrollTo(axis, target, animated);
179
+ expectedPosition = withAxis(expectedPosition, axis, target);
122
180
  }
123
- position = next;
124
181
  },
182
+ restore,
125
183
  scrolled,
126
184
  dragBegan: (axis, offset) => {
127
- const hadTail = echoTails.delete(axis);
128
- if (pending.has(axis) || inFlight.has(axis))
129
- settle(axis, offset);
130
- else if (hadTail)
131
- adopt(axis, offset);
185
+ const pendingScroll = pending.get(axis);
186
+ if (pendingScroll?.restoring && !isSameOffset(offset, pendingScroll.target)) {
187
+ restore(axis, offset, pendingScroll.target);
188
+ return;
189
+ }
190
+ release(axis);
191
+ echoTails.delete(axis);
192
+ userGestures.add(axis);
193
+ observedPosition = withAxis(observedPosition, axis, offset);
194
+ expectedPosition = withAxis(expectedPosition, axis, offset);
132
195
  },
133
196
  scrollEnded: (axis, offset) => {
197
+ const pendingScroll = pending.get(axis);
198
+ if (pendingScroll?.restoring) {
199
+ if (!isSameOffset(offset, pendingScroll.target))
200
+ restore(axis, offset, pendingScroll.target);
201
+ return;
202
+ }
203
+ if (userGestures.has(axis)) {
204
+ scrolled(axis, offset);
205
+ userGestures.delete(axis);
206
+ return;
207
+ }
134
208
  scrolled(axis, offset);
135
- echoTails.delete(axis);
136
209
  if (pending.has(axis))
137
210
  settle(axis, offset);
138
211
  },
@@ -140,6 +213,7 @@ function createGridScrollSync({
140
213
  for (const axis of AXES)
141
214
  release(axis);
142
215
  echoTails.clear();
216
+ userGestures.clear();
143
217
  }
144
218
  };
145
219
  }
@@ -180,8 +254,11 @@ function GridView2({
180
254
  onVisibleItemIdsChange,
181
255
  renderItem,
182
256
  testID,
183
- viewportInteraction = "enabled"
257
+ viewportInteraction = "enabled",
258
+ viewportControls = "visible",
259
+ renderWorldLayer
184
260
  }) {
261
+ const parentScrollLock = useScrollGestureLock();
185
262
  const [uncontrolledViewport, setUncontrolledViewport] = React.useState(() => createInitialViewport(width, height, zoom, defaultViewport));
186
263
  const horizontalScrollRef = React.useRef(null);
187
264
  const verticalScrollRef = React.useRef(null);
@@ -190,12 +267,14 @@ function GridView2({
190
267
  return;
191
268
  });
192
269
  const scrollSyncRef = React.useRef(undefined);
270
+ const dragPanRef = React.useRef(undefined);
193
271
  const pinchGestureRef = React.useRef(undefined);
194
272
  const pinchMeasurementRef = React.useRef(0);
195
273
  const pinchSessionRef = React.useRef(0);
196
274
  const viewportOriginRef = React.useRef({ x: 0, y: 0 });
197
275
  const focusRevealProposalRef = React.useRef(undefined);
198
276
  const focusRevealViewportRef = React.useRef(undefined);
277
+ const [activeItemGestures, setActiveItemGestures] = React.useState(0);
199
278
  const [isPinching, setIsPinching] = React.useState(false);
200
279
  const constraints = React.useMemo(() => viewportConstraints ?? createContentConstraints(contentWidth, contentHeight), [contentHeight, contentWidth, viewportConstraints]);
201
280
  const sourceViewport = controlledViewport ?? uncontrolledViewport;
@@ -213,6 +292,7 @@ function GridView2({
213
292
  const uncontrolled = controlledViewport === undefined;
214
293
  const interactive = interactionPolicy !== "passive";
215
294
  const viewportInteractive = interactive && viewportInteraction === "enabled";
295
+ const scrollLock = React.useMemo(() => createScrollGestureLock(parentScrollLock, (delta) => setActiveItemGestures((count) => count + delta)), [parentScrollLock]);
216
296
  const publish = React.useCallback((nextViewport) => {
217
297
  if (areViewportsEqual(viewportRef.current, nextViewport))
218
298
  return;
@@ -227,7 +307,7 @@ function GridView2({
227
307
  pixelsPerUnitX: viewportRef.current.pixelsPerUnitX * factor,
228
308
  pixelsPerUnitY: viewportRef.current.pixelsPerUnitY * factor
229
309
  }, zoomLimits, constraints));
230
- React.useEffect(() => {
310
+ React.useLayoutEffect(() => {
231
311
  viewportRef.current = viewport;
232
312
  }, [viewport]);
233
313
  React.useEffect(() => {
@@ -238,7 +318,7 @@ function GridView2({
238
318
  });
239
319
  React.useEffect(() => {
240
320
  const scrollSync = createGridScrollSync({
241
- onProgrammaticScroll: (axis, displacement) => panRef.current(axis === "x" ? { x: -displacement, y: 0 } : { x: 0, y: -displacement }),
321
+ acceptUnownedScroll: Platform.OS === "web",
242
322
  onUserScroll: (axis, displacement) => panRef.current(axis === "x" ? { x: -displacement, y: 0 } : { x: 0, y: -displacement }),
243
323
  scrollTo: (axis, offset, animated) => {
244
324
  if (axis === "x")
@@ -254,9 +334,30 @@ function GridView2({
254
334
  };
255
335
  }, []);
256
336
  const handleNativeScroll = (axis, offset) => {
337
+ if (scrollLock.isActive?.()) {
338
+ const mapping = createScrollMapping(viewportRef.current, constraints);
339
+ scrollSyncRef.current?.restore(axis, offset, axis === "x" ? mapping.horizontal.position : mapping.vertical.position);
340
+ return;
341
+ }
257
342
  if (!pinchGestureRef.current)
258
343
  scrollSyncRef.current?.scrolled(axis, offset);
259
344
  };
345
+ const handleNativeScrollBegan = (axis, offset) => {
346
+ if (scrollLock.isActive?.()) {
347
+ const mapping = createScrollMapping(viewportRef.current, constraints);
348
+ scrollSyncRef.current?.restore(axis, offset, axis === "x" ? mapping.horizontal.position : mapping.vertical.position);
349
+ return;
350
+ }
351
+ scrollSyncRef.current?.dragBegan(axis, offset);
352
+ };
353
+ const handleNativeScrollEnded = (axis, offset) => {
354
+ if (scrollLock.isActive?.()) {
355
+ const mapping = createScrollMapping(viewportRef.current, constraints);
356
+ scrollSyncRef.current?.restore(axis, offset, axis === "x" ? mapping.horizontal.position : mapping.vertical.position);
357
+ return;
358
+ }
359
+ scrollSyncRef.current?.scrollEnded(axis, offset);
360
+ };
260
361
  const refreshViewportOrigin = React.useCallback(() => {
261
362
  gridRef.current?.measureInWindow((x, y) => {
262
363
  viewportOriginRef.current = { x, y };
@@ -350,151 +451,199 @@ function GridView2({
350
451
  };
351
452
  scrollSyncRef.current?.request(nextPosition, false);
352
453
  };
353
- return /* @__PURE__ */ jsxs(NativeView, {
354
- ref: gridRef,
355
- accessibilityLabel: "Interactive grid viewport",
356
- onLayout: refreshViewportOrigin,
357
- onTouchEnd: () => {
358
- const wasPinching = pinchGestureRef.current !== undefined;
359
- pinchMeasurementRef.current += 1;
360
- pinchSessionRef.current += 1;
361
- pinchGestureRef.current = undefined;
362
- setIsPinching(false);
363
- if (wasPinching)
364
- syncScrollPosition();
365
- },
366
- onTouchCancel: () => {
367
- const wasPinching = pinchGestureRef.current !== undefined;
368
- pinchMeasurementRef.current += 1;
369
- pinchSessionRef.current += 1;
370
- pinchGestureRef.current = undefined;
371
- setIsPinching(false);
372
- if (wasPinching)
373
- syncScrollPosition();
374
- },
375
- onTouchMove: (event) => {
376
- if (!viewportInteractive)
377
- return;
378
- measurePinchGesture([...event.nativeEvent.touches], pinchSessionRef.current, (pinch) => {
379
- const previous = pinchGestureRef.current;
380
- pinchGestureRef.current = pinch;
381
- setIsPinching(pinch !== undefined);
382
- if (!pinch || !previous)
454
+ return /* @__PURE__ */ jsx(ScrollGestureLockContext.Provider, {
455
+ value: scrollLock,
456
+ children: /* @__PURE__ */ jsxs(NativeView, {
457
+ ref: gridRef,
458
+ accessibilityLabel: "Interactive grid viewport",
459
+ onLayout: refreshViewportOrigin,
460
+ onTouchEnd: () => {
461
+ const wasPinching = pinchGestureRef.current !== undefined;
462
+ pinchMeasurementRef.current += 1;
463
+ pinchSessionRef.current += 1;
464
+ pinchGestureRef.current = undefined;
465
+ setIsPinching(false);
466
+ if (wasPinching)
467
+ syncScrollPosition();
468
+ },
469
+ onTouchCancel: () => {
470
+ const wasPinching = pinchGestureRef.current !== undefined;
471
+ pinchMeasurementRef.current += 1;
472
+ pinchSessionRef.current += 1;
473
+ pinchGestureRef.current = undefined;
474
+ setIsPinching(false);
475
+ if (wasPinching)
476
+ syncScrollPosition();
477
+ },
478
+ onTouchMove: (event) => {
479
+ if (!viewportInteractive)
383
480
  return;
384
- zoomAt(pinch.focalPoint, pinch.distance / previous.distance);
385
- });
386
- },
387
- onTouchStart: (event) => {
388
- const session = pinchSessionRef.current + 1;
389
- pinchSessionRef.current = session;
390
- measurePinchGesture([...event.nativeEvent.touches], session, (pinch) => {
391
- pinchGestureRef.current = pinch;
392
- setIsPinching(pinch !== undefined);
393
- });
394
- },
395
- style: { height, overflow: "hidden", width },
396
- testID,
397
- children: [
398
- /* @__PURE__ */ jsx(NativeScrollView, {
399
- ref: horizontalScrollRef,
400
- testID: testID ? `${testID}-horizontal-scroll` : undefined,
401
- horizontal: true,
402
- scrollEnabled: viewportInteractive && !isPinching,
403
- scrollEventThrottle: 16,
404
- showsHorizontalScrollIndicator: true,
405
- style: { height, width },
406
- onMomentumScrollEnd: (event) => scrollSyncRef.current?.scrollEnded("x", event.nativeEvent.contentOffset.x),
407
- onScroll: (event) => handleNativeScroll("x", event.nativeEvent.contentOffset.x),
408
- onScrollBeginDrag: (event) => scrollSyncRef.current?.dragBegan("x", event.nativeEvent.contentOffset.x),
409
- children: /* @__PURE__ */ jsx(NativeScrollView, {
410
- ref: verticalScrollRef,
411
- testID: testID ? `${testID}-vertical-scroll` : undefined,
412
- scrollEnabled: viewportInteractive && !isPinching,
481
+ measurePinchGesture([...event.nativeEvent.touches], pinchSessionRef.current, (pinch) => {
482
+ const previous = pinchGestureRef.current;
483
+ pinchGestureRef.current = pinch;
484
+ setIsPinching(pinch !== undefined);
485
+ if (!pinch || !previous)
486
+ return;
487
+ zoomAt(pinch.focalPoint, pinch.distance / previous.distance);
488
+ });
489
+ },
490
+ onTouchStart: (event) => {
491
+ const session = pinchSessionRef.current + 1;
492
+ pinchSessionRef.current = session;
493
+ measurePinchGesture([...event.nativeEvent.touches], session, (pinch) => {
494
+ pinchGestureRef.current = pinch;
495
+ setIsPinching(pinch !== undefined);
496
+ });
497
+ },
498
+ style: { height, overflow: "hidden", width },
499
+ testID,
500
+ children: [
501
+ /* @__PURE__ */ jsx(NativeScrollView, {
502
+ ref: horizontalScrollRef,
503
+ disableScrollViewPanResponder: true,
504
+ nestedScrollEnabled: true,
505
+ testID: testID ? `${testID}-horizontal-scroll` : undefined,
506
+ horizontal: true,
507
+ scrollEnabled: viewportInteractive && activeItemGestures === 0 && !isPinching,
413
508
  scrollEventThrottle: 16,
414
- showsVerticalScrollIndicator: true,
415
- style: { height, width: scrollMapping.horizontal.contentSize },
416
- onMomentumScrollEnd: (event) => scrollSyncRef.current?.scrollEnded("y", event.nativeEvent.contentOffset.y),
417
- onScroll: (event) => handleNativeScroll("y", event.nativeEvent.contentOffset.y),
418
- onScrollBeginDrag: (event) => scrollSyncRef.current?.dragBegan("y", event.nativeEvent.contentOffset.y),
419
- children: /* @__PURE__ */ jsx(NativeView, {
420
- style: {
421
- height: scrollMapping.vertical.contentSize,
422
- width: scrollMapping.horizontal.contentSize
423
- },
424
- children: visibleItems.map((item) => {
425
- const position = worldToViewport({ x: item.x, y: item.y }, { ...viewport, offsetX: 0, offsetY: 0 });
426
- return /* @__PURE__ */ jsx(NativeView, {
427
- style: {
428
- height: item.height * viewport.pixelsPerUnitY,
429
- left: position.x + scrollMapping.horizontal.origin,
430
- position: "absolute",
431
- top: position.y + scrollMapping.vertical.origin,
432
- width: item.width * viewport.pixelsPerUnitX
433
- },
434
- children: renderItem(item)
435
- }, item.id);
509
+ showsHorizontalScrollIndicator: true,
510
+ style: { height, width },
511
+ onMomentumScrollEnd: (event) => handleNativeScrollEnded("x", event.nativeEvent.contentOffset.x),
512
+ onScroll: (event) => handleNativeScroll("x", event.nativeEvent.contentOffset.x),
513
+ onScrollBeginDrag: (event) => handleNativeScrollBegan("x", event.nativeEvent.contentOffset.x),
514
+ children: /* @__PURE__ */ jsx(NativeScrollView, {
515
+ ref: verticalScrollRef,
516
+ disableScrollViewPanResponder: true,
517
+ nestedScrollEnabled: true,
518
+ testID: testID ? `${testID}-vertical-scroll` : undefined,
519
+ scrollEnabled: viewportInteractive && activeItemGestures === 0 && !isPinching,
520
+ scrollEventThrottle: 16,
521
+ showsVerticalScrollIndicator: true,
522
+ style: { height, width: scrollMapping.horizontal.contentSize },
523
+ onMomentumScrollEnd: (event) => handleNativeScrollEnded("y", event.nativeEvent.contentOffset.y),
524
+ onScroll: (event) => handleNativeScroll("y", event.nativeEvent.contentOffset.y),
525
+ onScrollBeginDrag: (event) => handleNativeScrollBegan("y", event.nativeEvent.contentOffset.y),
526
+ children: /* @__PURE__ */ jsxs(NativeView, {
527
+ style: {
528
+ height: scrollMapping.vertical.contentSize,
529
+ width: scrollMapping.horizontal.contentSize
530
+ },
531
+ children: [
532
+ Platform.OS === "web" && viewportInteractive ? /* @__PURE__ */ jsx(NativeView, {
533
+ accessible: false,
534
+ onResponderGrant: (event) => {
535
+ dragPanRef.current = { x: event.nativeEvent.pageX, y: event.nativeEvent.pageY };
536
+ },
537
+ onResponderMove: (event) => {
538
+ const previous = dragPanRef.current;
539
+ if (!previous)
540
+ return;
541
+ const next = { x: event.nativeEvent.pageX, y: event.nativeEvent.pageY };
542
+ dragPanRef.current = next;
543
+ pan({ x: next.x - previous.x, y: next.y - previous.y });
544
+ },
545
+ onResponderRelease: () => {
546
+ dragPanRef.current = undefined;
547
+ },
548
+ onResponderTerminate: () => {
549
+ dragPanRef.current = undefined;
550
+ },
551
+ onStartShouldSetResponderCapture: () => true,
552
+ style: fillStyle,
553
+ testID: testID ? `${testID}-background` : undefined
554
+ }) : null,
555
+ renderWorldLayer ? /* @__PURE__ */ jsx(NativeView, {
556
+ pointerEvents: "box-none",
557
+ style: fillStyle,
558
+ children: renderWorldLayer({
559
+ height: scrollMapping.vertical.contentSize,
560
+ origin: {
561
+ x: scrollMapping.horizontal.origin,
562
+ y: scrollMapping.vertical.origin
563
+ },
564
+ pixelsPerUnitX: viewport.pixelsPerUnitX,
565
+ pixelsPerUnitY: viewport.pixelsPerUnitY,
566
+ width: scrollMapping.horizontal.contentSize
567
+ })
568
+ }) : null,
569
+ visibleItems.map((item) => {
570
+ const position = worldToViewport({ x: item.x, y: item.y }, { ...viewport, offsetX: 0, offsetY: 0 });
571
+ return /* @__PURE__ */ jsx(NativeView, {
572
+ style: {
573
+ height: item.height * viewport.pixelsPerUnitY,
574
+ left: position.x + scrollMapping.horizontal.origin,
575
+ position: "absolute",
576
+ top: position.y + scrollMapping.vertical.origin,
577
+ width: item.width * viewport.pixelsPerUnitX
578
+ },
579
+ children: renderItem(item)
580
+ }, item.id);
581
+ })
582
+ ]
436
583
  })
437
584
  })
438
- })
439
- }),
440
- viewportInteractive ? /* @__PURE__ */ jsxs(NativeView, {
441
- accessibilityLabel: "Viewport controls",
442
- style: controlsStyle,
443
- children: [
444
- /* @__PURE__ */ jsx(NativePressable, {
445
- accessibilityLabel: "Pan left",
446
- accessibilityRole: "button",
447
- onPress: () => pan({ x: 48, y: 0 }),
448
- children: /* @__PURE__ */ jsx(NativeText, {
449
- children: "←"
450
- })
451
- }),
452
- /* @__PURE__ */ jsx(NativePressable, {
453
- accessibilityLabel: "Pan right",
454
- accessibilityRole: "button",
455
- onPress: () => pan({ x: -48, y: 0 }),
456
- children: /* @__PURE__ */ jsx(NativeText, {
457
- children: "→"
585
+ }),
586
+ viewportInteractive && viewportControls === "visible" ? /* @__PURE__ */ jsxs(NativeView, {
587
+ accessibilityLabel: "Viewport controls",
588
+ style: controlsStyle,
589
+ children: [
590
+ /* @__PURE__ */ jsx(NativePressable, {
591
+ accessibilityLabel: "Pan left",
592
+ accessibilityRole: "button",
593
+ onPress: () => pan({ x: 48, y: 0 }),
594
+ children: /* @__PURE__ */ jsx(NativeText, {
595
+ children: "←"
596
+ })
597
+ }),
598
+ /* @__PURE__ */ jsx(NativePressable, {
599
+ accessibilityLabel: "Pan right",
600
+ accessibilityRole: "button",
601
+ onPress: () => pan({ x: -48, y: 0 }),
602
+ children: /* @__PURE__ */ jsx(NativeText, {
603
+ children: "→"
604
+ })
605
+ }),
606
+ /* @__PURE__ */ jsx(NativePressable, {
607
+ accessibilityLabel: "Pan up",
608
+ accessibilityRole: "button",
609
+ onPress: () => pan({ x: 0, y: 48 }),
610
+ children: /* @__PURE__ */ jsx(NativeText, {
611
+ children: "↑"
612
+ })
613
+ }),
614
+ /* @__PURE__ */ jsx(NativePressable, {
615
+ accessibilityLabel: "Pan down",
616
+ accessibilityRole: "button",
617
+ onPress: () => pan({ x: 0, y: -48 }),
618
+ children: /* @__PURE__ */ jsx(NativeText, {
619
+ children: "↓"
620
+ })
621
+ }),
622
+ /* @__PURE__ */ jsx(NativePressable, {
623
+ accessibilityLabel: "Zoom in",
624
+ accessibilityRole: "button",
625
+ onPress: () => zoomAt({ x: width / 2, y: height / 2 }, 1.2),
626
+ children: /* @__PURE__ */ jsx(NativeText, {
627
+ children: "+"
628
+ })
629
+ }),
630
+ /* @__PURE__ */ jsx(NativePressable, {
631
+ accessibilityLabel: "Zoom out",
632
+ accessibilityRole: "button",
633
+ onPress: () => zoomAt({ x: width / 2, y: height / 2 }, 1 / 1.2),
634
+ children: /* @__PURE__ */ jsx(NativeText, {
635
+ children: "−"
636
+ })
458
637
  })
459
- }),
460
- /* @__PURE__ */ jsx(NativePressable, {
461
- accessibilityLabel: "Pan up",
462
- accessibilityRole: "button",
463
- onPress: () => pan({ x: 0, y: 48 }),
464
- children: /* @__PURE__ */ jsx(NativeText, {
465
- children: "↑"
466
- })
467
- }),
468
- /* @__PURE__ */ jsx(NativePressable, {
469
- accessibilityLabel: "Pan down",
470
- accessibilityRole: "button",
471
- onPress: () => pan({ x: 0, y: -48 }),
472
- children: /* @__PURE__ */ jsx(NativeText, {
473
- children: "↓"
474
- })
475
- }),
476
- /* @__PURE__ */ jsx(NativePressable, {
477
- accessibilityLabel: "Zoom in",
478
- accessibilityRole: "button",
479
- onPress: () => zoomAt({ x: width / 2, y: height / 2 }, 1.2),
480
- children: /* @__PURE__ */ jsx(NativeText, {
481
- children: "+"
482
- })
483
- }),
484
- /* @__PURE__ */ jsx(NativePressable, {
485
- accessibilityLabel: "Zoom out",
486
- accessibilityRole: "button",
487
- onPress: () => zoomAt({ x: width / 2, y: height / 2 }, 1 / 1.2),
488
- children: /* @__PURE__ */ jsx(NativeText, {
489
- children: "−"
490
- })
491
- })
492
- ]
493
- }) : null
494
- ]
638
+ ]
639
+ }) : null
640
+ ]
641
+ })
495
642
  });
496
643
  }
644
+ var fillStyle = { bottom: 0, left: 0, position: "absolute", right: 0, top: 0 };
497
645
  var controlsStyle = { bottom: 8, gap: 4, position: "absolute", right: 8 };
646
+ var VIEWPORT_NUMERIC_TOLERANCE = Number.EPSILON * 1024;
498
647
  function createInitialViewport(width, height, zoom, viewport) {
499
648
  return {
500
649
  height,
@@ -545,7 +694,10 @@ function createScrollAxisMapping({
545
694
  };
546
695
  }
547
696
  function areViewportsEqual(left, right) {
548
- return left.width === right.width && left.height === right.height && left.offsetX === right.offsetX && left.offsetY === right.offsetY && left.pixelsPerUnitX === right.pixelsPerUnitX && left.pixelsPerUnitY === right.pixelsPerUnitY;
697
+ return areViewportValuesEqual(left.width, right.width) && areViewportValuesEqual(left.height, right.height) && areViewportValuesEqual(left.offsetX, right.offsetX) && areViewportValuesEqual(left.offsetY, right.offsetY) && areViewportValuesEqual(left.pixelsPerUnitX, right.pixelsPerUnitX) && areViewportValuesEqual(left.pixelsPerUnitY, right.pixelsPerUnitY);
698
+ }
699
+ function areViewportValuesEqual(left, right) {
700
+ return Math.abs(left - right) <= VIEWPORT_NUMERIC_TOLERANCE;
549
701
  }
550
702
  function isRepeatedControlledFocusRevealProposal({
551
703
  controlled,