@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.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts +5 -0
- package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts.map +1 -0
- package/dist/features/flow/adapters/inbound/FlowCanvas.js +261 -0
- package/dist/features/flow/adapters/inbound/FlowCanvas.js.map +1 -0
- package/dist/features/flow/application/createFlowEditorController.d.ts +13 -0
- package/dist/features/flow/application/createFlowEditorController.d.ts.map +1 -0
- package/dist/features/flow/application/createFlowEditorController.js +86 -0
- package/dist/features/flow/application/createFlowEditorController.js.map +1 -0
- package/dist/features/flow/application/getFlowPortAnchor.d.ts +10 -0
- package/dist/features/flow/application/getFlowPortAnchor.d.ts.map +1 -0
- package/dist/features/flow/application/getFlowPortAnchor.js +18 -0
- package/dist/features/flow/application/getFlowPortAnchor.js.map +1 -0
- package/dist/features/flow/application/mapFlowViewport.d.ts +10 -0
- package/dist/features/flow/application/mapFlowViewport.d.ts.map +1 -0
- package/dist/features/flow/application/mapFlowViewport.js +22 -0
- package/dist/features/flow/application/mapFlowViewport.js.map +1 -0
- package/dist/features/flow/public.d.ts +3 -0
- package/dist/features/flow/public.d.ts.map +1 -0
- package/dist/features/flow/public.js +2 -0
- package/dist/features/flow/public.js.map +1 -0
- package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts +5 -0
- package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts.map +1 -0
- package/dist/features/graph-node/adapters/inbound/GraphNode.js +190 -0
- package/dist/features/graph-node/adapters/inbound/GraphNode.js.map +1 -0
- package/dist/features/graph-node/getGraphNodePortGeometry.d.ts +17 -0
- package/dist/features/graph-node/getGraphNodePortGeometry.d.ts.map +1 -0
- package/dist/features/graph-node/getGraphNodePortGeometry.js +23 -0
- package/dist/features/graph-node/getGraphNodePortGeometry.js.map +1 -0
- package/dist/features/graph-node/public.d.ts +3 -0
- package/dist/features/graph-node/public.d.ts.map +1 -0
- package/dist/features/graph-node/public.js +2 -0
- package/dist/features/graph-node/public.js.map +1 -0
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.js +105 -41
- package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
- package/dist/features/grid-view/application/createGridScrollSync.d.ts +2 -5
- package/dist/features/grid-view/application/createGridScrollSync.d.ts.map +1 -1
- package/dist/features/grid-view/application/createGridScrollSync.js +109 -45
- package/dist/features/grid-view/application/createGridScrollSync.js.map +1 -1
- package/dist/features/grid-view/public.d.ts +1 -1
- package/dist/features/grid-view/public.d.ts.map +1 -1
- package/dist/features/grid-view/public.js.map +1 -1
- package/dist/features/layout/utils/createScrollGestureLock.d.ts.map +1 -1
- package/dist/features/layout/utils/createScrollGestureLock.js +4 -0
- package/dist/features/layout/utils/createScrollGestureLock.js.map +1 -1
- package/dist/features/theme/node.d.ts +5 -0
- package/dist/features/theme/node.d.ts.map +1 -0
- package/dist/features/theme/node.js +4 -0
- package/dist/features/theme/node.js.map +1 -0
- package/dist/features/theme/public.d.ts +2 -0
- package/dist/features/theme/public.d.ts.map +1 -1
- package/dist/features/theme/public.js +1 -0
- package/dist/features/theme/public.js.map +1 -1
- package/dist/types/flow.d.ts +81 -0
- package/dist/types/flow.d.ts.map +1 -0
- package/dist/types/flow.js +2 -0
- package/dist/types/flow.js.map +1 -0
- package/dist/types/graph-node.d.ts +42 -0
- package/dist/types/graph-node.d.ts.map +1 -0
- package/dist/types/graph-node.js +2 -0
- package/dist/types/graph-node.js.map +1 -0
- package/dist/types/grid-view.d.ts +27 -3
- package/dist/types/grid-view.d.ts.map +1 -1
- package/dist/types/grid-view.js.map +1 -1
- package/dist/types/layout.d.ts +2 -0
- package/dist/types/layout.d.ts.map +1 -1
- package/dist/types/layout.js.map +1 -1
- package/package.json +21 -3
- package/src/features/flow/adapters/inbound/FlowCanvas.tsx +501 -0
- package/src/features/flow/application/createFlowEditorController.test.ts +146 -0
- package/src/features/flow/application/createFlowEditorController.ts +99 -0
- package/src/features/flow/application/getFlowPortAnchor.test.ts +23 -0
- package/src/features/flow/application/getFlowPortAnchor.ts +30 -0
- package/src/features/flow/application/mapFlowViewport.test.ts +11 -0
- package/src/features/flow/application/mapFlowViewport.ts +29 -0
- package/src/features/flow/public.test.ts +7 -0
- package/src/features/flow/public.ts +13 -0
- package/src/features/graph-node/adapters/inbound/GraphNode.test.tsx +80 -0
- package/src/features/graph-node/adapters/inbound/GraphNode.tsx +259 -0
- package/src/features/graph-node/getGraphNodePortGeometry.test.ts +35 -0
- package/src/features/graph-node/getGraphNodePortGeometry.ts +41 -0
- package/src/features/graph-node/public.test.ts +7 -0
- package/src/features/graph-node/public.ts +2 -0
- package/src/features/grid-view/adapters/inbound/GridView.nativeScrollSync.test.tsx +198 -7
- package/src/features/grid-view/adapters/inbound/GridView.tsx +248 -145
- package/src/features/grid-view/application/createGridScrollSync.test.ts +46 -17
- package/src/features/grid-view/application/createGridScrollSync.ts +100 -43
- package/src/features/grid-view/public.ts +6 -1
- package/src/features/layout/utils/createScrollGestureLock.ts +4 -0
- package/src/features/theme/application/use-cases/compileZoraTheme.test.ts +1 -1
- package/src/features/theme/node.ts +18 -0
- package/src/features/theme/public.ts +7 -0
- package/src/platformAcceptance.test.ts +15 -11
- package/src/types/flow.ts +99 -0
- package/src/types/graph-node.ts +45 -0
- package/src/types/grid-view.ts +25 -3
- package/src/types/layout.ts +2 -0
- package/web-dist/chunks/{Accordion-9dq115tn.js → Accordion-064hgrct.js} +3 -3
- package/web-dist/chunks/{Accordion-wbf7gqrm.js → Accordion-2b3sd76b.js} +3 -3
- package/web-dist/chunks/{Accordion-k9n1yse4.js → Accordion-2kv6p7by.js} +10 -38
- package/web-dist/chunks/{Accordion-6gc0jw1n.js → Accordion-5x4cv0kv.js} +1 -1
- package/web-dist/chunks/{Accordion-r8swmfjm.js → Accordion-6d63tc7d.js} +1 -1
- package/web-dist/chunks/{Accordion-vbz1mjm6.js → Accordion-7eysykr1.js} +4 -4
- package/web-dist/chunks/{Accordion-59x6e7bs.js → Accordion-91qf4q27.js} +1 -1
- package/web-dist/chunks/{Accordion-hadw5304.js → Accordion-98886mbn.js} +1 -1
- package/web-dist/chunks/{Accordion-vtbs98r4.js → Accordion-a0hbjxg9.js} +4 -4
- package/web-dist/chunks/{Accordion-73p2mg3h.js → Accordion-a49s4ywn.js} +4 -4
- package/web-dist/chunks/{Accordion-tb0vc91c.js → Accordion-a8b6g53f.js} +4 -4
- package/web-dist/chunks/{Accordion-25v2vczc.js → Accordion-afxbyvwp.js} +3 -3
- package/web-dist/chunks/{Accordion-g5pvs1aa.js → Accordion-ajqj6ymg.js} +5 -5
- package/web-dist/chunks/{Accordion-w2kx944a.js → Accordion-ak6dvant.js} +3 -3
- package/web-dist/chunks/{Accordion-778fjjsh.js → Accordion-b1tqkxx6.js} +3 -3
- package/web-dist/chunks/{Accordion-rp9cjtpg.js → Accordion-bm30dkbw.js} +2 -2
- package/web-dist/chunks/{Accordion-rsw5jt7m.js → Accordion-cah5j61y.js} +2 -2
- package/web-dist/chunks/{Accordion-pr1tv6jx.js → Accordion-dfr26j8m.js} +1 -1
- package/web-dist/chunks/{Accordion-zmrbktd8.js → Accordion-dnfgtbq3.js} +8 -8
- package/web-dist/chunks/{Accordion-m3tq2vcc.js → Accordion-dy1j2a7p.js} +6 -6
- package/web-dist/chunks/{Accordion-7pgh8q4h.js → Accordion-e9jwetg7.js} +2 -2
- package/web-dist/chunks/{Accordion-gnkzvj03.js → Accordion-e9xmwxzp.js} +1 -1
- package/web-dist/chunks/{Accordion-q8ymmar7.js → Accordion-ek0hh2nx.js} +4 -4
- package/web-dist/chunks/{Accordion-2berhsg5.js → Accordion-et7xzm6k.js} +9 -9
- package/web-dist/chunks/Accordion-eysfka31.js +1590 -0
- package/web-dist/chunks/{Accordion-3xfqmr1r.js → Accordion-gy3bx3xa.js} +2 -2
- package/web-dist/chunks/{Accordion-tj4fe6wk.js → Accordion-h2rnzgyv.js} +3 -3
- package/web-dist/chunks/Accordion-hbwhya78.js +83 -0
- package/web-dist/chunks/{Accordion-t9w365ke.js → Accordion-hbwyj12m.js} +1 -1
- package/web-dist/chunks/{Accordion-q2yxtdzc.js → Accordion-j3esnt3f.js} +6 -6
- package/web-dist/chunks/Accordion-jkgd7dmf.js +1 -0
- package/web-dist/chunks/{Accordion-qwftammh.js → Accordion-kxjjp03t.js} +5 -5
- package/web-dist/chunks/Accordion-mkd3k28h.js +275 -0
- package/web-dist/chunks/{Accordion-xqkkfwkm.js → Accordion-nhf8zjt4.js} +2 -2
- package/web-dist/chunks/{Accordion-hg4db1sk.js → Accordion-p84h11ek.js} +4 -4
- package/web-dist/chunks/{Accordion-zhgty1ae.js → Accordion-pagdkp07.js} +3 -3
- package/web-dist/chunks/{Accordion-dv5c27w4.js → Accordion-pjbmmr20.js} +1 -1
- package/web-dist/chunks/{Accordion-7ayxbm7k.js → Accordion-pr4a281g.js} +1 -1
- package/web-dist/chunks/{Accordion-yca8r7kx.js → Accordion-qz6ddnmv.js} +3 -3
- package/web-dist/chunks/{Accordion-dcjzxzv3.js → Accordion-rv90tjqr.js} +2 -2
- package/web-dist/chunks/{Accordion-0zk0xp73.js → Accordion-snk6nggm.js} +326 -174
- package/web-dist/chunks/{Accordion-casb2ndy.js → Accordion-th7yhwhf.js} +5 -5
- package/web-dist/chunks/{Accordion-e6ettgh0.js → Accordion-vbh3xqv6.js} +2 -2
- package/web-dist/chunks/{Accordion-vdzyhtyd.js → Accordion-w4zh2nws.js} +8 -8
- package/web-dist/chunks/Accordion-w8zke8fa.js +37 -0
- package/web-dist/chunks/{Accordion-3e60xwvy.js → Accordion-wkqemqjw.js} +1 -1
- package/web-dist/chunks/{Accordion-vwqf8kn1.js → Accordion-x9sb23p3.js} +3 -3
- package/web-dist/chunks/{Accordion-xhkphta6.js → Accordion-y6sg47rv.js} +1 -1
- package/web-dist/chunks/{Accordion-mw8zh0vs.js → Accordion-yannd7r3.js} +4 -4
- package/web-dist/chunks/{Accordion-457amtv7.js → Accordion-z3m3wvfz.js} +6 -1580
- package/web-dist/chunks/{Accordion-pvcdvh3w.js → Accordion-zagrbkq1.js} +2 -2
- package/web-dist/chunks/{Accordion-2jcas7qq.js → Accordion-zays65re.js} +5 -5
- package/web-dist/chunks/{RichTextClient-w75r2x97.js → RichTextClient-qd6gmm0x.js} +12 -11
- package/web-dist/chunks/{Video.native-bb9g33nd.js → Video.native-7zsbp5vg.js} +7 -6
- package/web-dist/components/accordion/Accordion.js +6 -5
- package/web-dist/components/accordion-item/AccordionItem.js +6 -5
- package/web-dist/components/activity-indicator/ActivityIndicator.js +1 -1
- package/web-dist/components/app-bar/AppBar.js +8 -7
- package/web-dist/components/app-header/AppHeader.js +8 -7
- package/web-dist/components/app-shell/AppShell.js +3 -2
- package/web-dist/components/audio/Audio.js +6 -5
- package/web-dist/components/auth-screen/AuthScreen.js +11 -10
- package/web-dist/components/avatar/Avatar.js +6 -5
- package/web-dist/components/avatar-group/AvatarGroup.js +6 -5
- package/web-dist/components/badge/Badge.js +2 -2
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +11 -10
- package/web-dist/components/bottom-sheet/BottomSheet.js +4 -3
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +4 -3
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +4 -3
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +4 -3
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +4 -3
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +4 -3
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +6 -5
- package/web-dist/components/button/Button.js +4 -3
- package/web-dist/components/button-group/ButtonGroup.js +4 -3
- package/web-dist/components/calendar/Calendar.js +8 -7
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +11 -10
- package/web-dist/components/card/Card.js +10 -9
- package/web-dist/components/card-back/CardBack.js +2 -2
- package/web-dist/components/card-hand/CardHand.js +2 -2
- package/web-dist/components/chat-list-item/ChatListItem.js +8 -7
- package/web-dist/components/checkbox/Checkbox.js +5 -4
- package/web-dist/components/checkbox-group/CheckboxGroup.js +5 -4
- package/web-dist/components/chess-board/ChessBoard.js +4 -3
- package/web-dist/components/chip/Chip.js +6 -5
- package/web-dist/components/chip-group/ChipGroup.js +6 -5
- package/web-dist/components/collection-editor/CollectionEditor.js +10 -9
- package/web-dist/components/color-hue-scale/ColorHueScale.js +17 -15
- package/web-dist/components/color-picker/ColorPicker.js +17 -15
- package/web-dist/components/color-tone/ColorTone.js +17 -15
- package/web-dist/components/color-wheel/ColorWheel.js +17 -15
- package/web-dist/components/content-rail/ContentRail.js +5 -4
- package/web-dist/components/data-table/DataTable.js +16 -15
- package/web-dist/components/date-picker/DatePicker.js +10 -9
- package/web-dist/components/dialog/Dialog.js +5 -4
- package/web-dist/components/divider/Divider.js +3 -2
- package/web-dist/components/empty-state/EmptyState.js +11 -10
- package/web-dist/components/explorer/Explorer.js +8 -7
- package/web-dist/components/field/Field.js +5 -4
- package/web-dist/components/file-explorer/FileExplorer.js +8 -7
- package/web-dist/components/flat-list/FlatList.js +6 -5
- package/web-dist/components/flow-canvas/FlowCanvas.d.ts +7 -0
- package/web-dist/components/flow-canvas/FlowCanvas.dependency-0.d.ts +27 -0
- package/web-dist/components/flow-canvas/FlowCanvas.dependency-1.d.ts +3 -0
- package/web-dist/components/flow-canvas/FlowCanvas.js +513 -0
- package/web-dist/components/flow-canvas/FlowCanvas.types-0.d.ts +92 -0
- package/web-dist/components/flow-canvas/index.d.ts +2 -0
- package/web-dist/components/flow-canvas/index.js +2 -0
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +11 -10
- package/web-dist/components/form/Form.js +7 -6
- package/web-dist/components/form-actions/FormActions.js +7 -6
- package/web-dist/components/form-error/FormError.js +7 -6
- package/web-dist/components/game/Game.js +4 -3
- package/web-dist/components/game-entity/GameEntity.js +4 -3
- package/web-dist/components/game-field/GameField.js +4 -3
- package/web-dist/components/game-input-zone/GameInputZone.js +4 -3
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +4 -3
- package/web-dist/components/game-overlay/GameOverlay.js +4 -3
- package/web-dist/components/gradient/Gradient.js +4 -3
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +4 -3
- package/web-dist/components/graph-node/GraphNode.d.ts +7 -0
- package/web-dist/components/graph-node/GraphNode.dependency-0.d.ts +27 -0
- package/web-dist/components/graph-node/GraphNode.dependency-1.d.ts +3 -0
- package/web-dist/components/graph-node/GraphNode.dependency-2.d.ts +5 -0
- package/web-dist/components/graph-node/GraphNode.js +20 -0
- package/web-dist/components/graph-node/GraphNode.types-0.d.ts +46 -0
- package/web-dist/components/graph-node/index.d.ts +2 -0
- package/web-dist/components/graph-node/index.js +2 -0
- package/web-dist/components/grid/Grid.js +3 -2
- package/web-dist/components/grid-line-overlay/GridLineOverlay.js +2 -2
- package/web-dist/components/grid-ruler/GridRuler.js +2 -2
- package/web-dist/components/grid-view/GridView.d.ts +1 -1
- package/web-dist/components/grid-view/GridView.js +2 -1
- package/web-dist/components/grid-view/GridView.types-0.d.ts +21 -0
- package/web-dist/components/heading/Heading.js +2 -2
- package/web-dist/components/hero/Hero.js +10 -9
- package/web-dist/components/icon/Icon.js +2 -2
- package/web-dist/components/icon-button/IconButton.js +4 -3
- package/web-dist/components/image/Image.js +5 -4
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +2 -2
- package/web-dist/components/link/Link.js +2 -2
- package/web-dist/components/list/List.js +6 -5
- package/web-dist/components/list-item/ListItem.js +6 -5
- package/web-dist/components/list-section/ListSection.js +6 -5
- package/web-dist/components/master-detail/MasterDetail.js +3 -2
- package/web-dist/components/matrix-grid/MatrixGrid.js +5 -4
- package/web-dist/components/media-card/MediaCard.js +10 -9
- package/web-dist/components/media-explorer/MediaExplorer.js +8 -7
- package/web-dist/components/message-bubble/MessageBubble.js +8 -7
- package/web-dist/components/metric-card/MetricCard.js +10 -9
- package/web-dist/components/missing-element/MissingElement.js +5 -4
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +11 -10
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +11 -10
- package/web-dist/components/opening-book/OpeningBook.js +4 -3
- package/web-dist/components/otp-form/OtpForm.js +11 -10
- package/web-dist/components/pagination/Pagination.js +5 -4
- package/web-dist/components/palette-item/PaletteItem.js +10 -9
- package/web-dist/components/playing-card/PlayingCard.js +2 -2
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +2 -2
- package/web-dist/components/popover/Popover.js +1 -1
- package/web-dist/components/popover-menu/PopoverMenu.js +5 -4
- package/web-dist/components/post-card/PostCard.js +10 -9
- package/web-dist/components/product-card/ProductCard.js +10 -9
- package/web-dist/components/progress/Progress.js +5 -4
- package/web-dist/components/progress-ring/ProgressRing.js +5 -4
- package/web-dist/components/radio/Radio.js +6 -5
- package/web-dist/components/radio-group/RadioGroup.js +6 -5
- package/web-dist/components/rating/Rating.js +4 -3
- package/web-dist/components/reader/Reader.js +11 -10
- package/web-dist/components/rich-text/RichText.js +3 -3
- package/web-dist/components/runtime-authoring-overlay/RuntimeAuthoringOverlay.js +4 -3
- package/web-dist/components/scan-overlay/ScanOverlay.js +11 -10
- package/web-dist/components/screen/Screen.js +3 -2
- package/web-dist/components/screen-section/ScreenSection.js +5 -4
- package/web-dist/components/scroll-view/ScrollView.js +3 -2
- package/web-dist/components/search-input/SearchInput.js +6 -5
- package/web-dist/components/section-header/SectionHeader.js +5 -4
- package/web-dist/components/section-list/SectionList.js +6 -5
- package/web-dist/components/select/Select.js +11 -10
- package/web-dist/components/selectable-item/SelectableItem.js +4 -3
- package/web-dist/components/selection-provider/SelectionProvider.js +4 -3
- package/web-dist/components/sign-in-form/SignInForm.js +11 -10
- package/web-dist/components/sign-up-form/SignUpForm.js +11 -10
- package/web-dist/components/skeleton/Skeleton.js +13 -12
- package/web-dist/components/skeleton-card/SkeletonCard.js +13 -12
- package/web-dist/components/skeleton-list/SkeletonList.js +13 -12
- package/web-dist/components/skeleton-text/SkeletonText.js +13 -12
- package/web-dist/components/spatial-grid/SpatialGrid.js +2 -1
- package/web-dist/components/surface/Surface.js +2 -2
- package/web-dist/components/switch/Switch.js +1 -1
- package/web-dist/components/tab/Tab.js +2 -2
- package/web-dist/components/tab-list/TabList.js +2 -2
- package/web-dist/components/tab-panel/TabPanel.js +2 -2
- package/web-dist/components/tabletop-table/TabletopTable.js +2 -2
- package/web-dist/components/tabs/Tabs.js +2 -2
- package/web-dist/components/text/Text.js +2 -2
- package/web-dist/components/text-input/TextInput.js +5 -4
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +4 -3
- package/web-dist/components/tile-grid/TileGrid.js +2 -1
- package/web-dist/components/time-grid/TimeGrid.js +3 -2
- package/web-dist/components/time-picker/TimePicker.js +7 -6
- package/web-dist/components/timeline/Timeline.js +6 -5
- package/web-dist/components/toast/Toast.js +2 -2
- package/web-dist/components/toast-provider/ToastProvider.js +2 -2
- package/web-dist/components/toolbar/Toolbar.js +11 -10
- package/web-dist/components/tree-item/TreeItem.js +9 -8
- package/web-dist/components/uploader/Uploader.js +13 -12
- package/web-dist/components/video/Video.js +7 -6
- package/web-dist/components/view/View.js +3 -2
- package/web-dist/components/zora-provider/ZoraProvider.d.ts +7 -0
- package/web-dist/components/zora-provider/ZoraProvider.dependency-0.d.ts +15 -0
- package/web-dist/components/zora-provider/ZoraProvider.js +11 -0
- package/web-dist/components/zora-provider/ZoraProvider.types-0.d.ts +19 -0
- package/web-dist/components/zora-provider/index.d.ts +2 -0
- package/web-dist/components/zora-provider/index.js +2 -0
- package/web-dist/components/zora-theme-scope/ZoraThemeScope.d.ts +14 -0
- package/web-dist/components/zora-theme-scope/ZoraThemeScope.js +11 -0
- package/web-dist/components/zora-theme-scope/ZoraThemeScope.types-0.d.ts +3 -0
- package/web-dist/components/zora-theme-scope/index.d.ts +2 -0
- package/web-dist/components/zora-theme-scope/index.js +2 -0
- package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +3 -2
- package/web-dist/manifest.json +1058 -832
- 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
|
-
|
|
43
|
+
acceptUnownedScroll = true,
|
|
38
44
|
now = Date.now,
|
|
39
45
|
schedule = setTimeout,
|
|
40
46
|
cancel = clearTimeout
|
|
41
47
|
}) {
|
|
42
|
-
let
|
|
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(
|
|
60
|
-
|
|
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
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
pending.set(axis,
|
|
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(
|
|
99
|
-
if (source === "in-flight" &&
|
|
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,
|
|
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
|
-
|
|
106
|
-
|
|
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(
|
|
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(
|
|
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
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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.
|
|
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
|
-
|
|
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__ */
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
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
|
-
|
|
415
|
-
style: { height, width
|
|
416
|
-
onMomentumScrollEnd: (event) =>
|
|
417
|
-
onScroll: (event) => handleNativeScroll("
|
|
418
|
-
onScrollBeginDrag: (event) =>
|
|
419
|
-
children: /* @__PURE__ */ jsx(
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
},
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
},
|
|
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
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
})
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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
|
-
|
|
461
|
-
|
|
462
|
-
|
|
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
|
|
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,
|