@ankhorage/zora 28.10.1 → 28.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +2 -1
- package/dist/capabilities/index.js.map +3 -3
- package/dist/constants/authoring.d.ts +3 -3
- package/dist/constants/authoring.d.ts.map +1 -1
- package/dist/constants/authoring.js +1 -0
- package/dist/constants/authoring.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -1
- package/dist/features/calendar/adapters/inbound/Calendar.js +91 -7
- package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
- package/dist/features/dialog/dialogMeta.d.ts +2 -2
- 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/gradient/gradientMeta.d.ts +1 -1
- 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/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/screenMeta.d.ts +1 -1
- package/dist/features/layout/scrollViewMeta.d.ts +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/layout/viewMeta.d.ts +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/master-detail/masterDetailMeta.d.ts +1 -1
- package/dist/features/popover/popoverMeta.d.ts +1 -1
- package/dist/features/reader/meta.d.ts +2 -2
- package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
- package/dist/features/scanner/meta.d.ts +2 -2
- package/dist/features/section/screenSectionMeta.d.ts +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/tabPanelMeta.d.ts +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/features/time-grid/adapters/inbound/TimeGrid.d.ts +1 -1
- package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts.map +1 -1
- package/dist/features/time-grid/adapters/inbound/TimeGrid.js +45 -22
- package/dist/features/time-grid/adapters/inbound/TimeGrid.js.map +1 -1
- package/dist/types/color.d.ts +3 -3
- package/dist/types/color.d.ts.map +1 -1
- package/dist/types/color.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/dist/types/time-grid.d.ts +9 -0
- package/dist/types/time-grid.d.ts.map +1 -1
- package/dist/types/time-grid.js.map +1 -1
- package/package.json +24 -6
- package/src/constants/authoring.ts +1 -0
- package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +65 -4
- package/src/features/calendar/adapters/inbound/Calendar.tsx +172 -22
- 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/features/time-grid/adapters/inbound/TimeGrid.tsx +64 -21
- package/src/platformAcceptance.test.ts +15 -11
- package/src/types/color.ts +3 -3
- 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/src/types/time-grid.ts +9 -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-q2yxtdzc.js → Accordion-95003ycq.js} +144 -27
- 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-59x6e7bs.js → Accordion-gb3mfjmx.js} +43 -20
- 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-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-picker/ColorPicker.types-0.d.ts +3 -3
- package/web-dist/components/color-tone/ColorTone.js +17 -15
- package/web-dist/components/color-tone/ColorTone.types-0.d.ts +3 -3
- package/web-dist/components/color-wheel/ColorWheel.js +17 -15
- package/web-dist/components/color-wheel/ColorWheel.types-0.d.ts +1 -1
- 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.d.ts +1 -1
- package/web-dist/components/time-grid/TimeGrid.dependency-2.d.ts +13 -0
- package/web-dist/components/time-grid/TimeGrid.js +3 -2
- package/web-dist/components/time-grid/TimeGrid.types-0.d.ts +10 -0
- 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 +1059 -832
- package/web-dist/runtime/ZoraProvider.js +4 -80
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from '@ankhorage/grid-view';
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import {
|
|
14
|
+
Platform,
|
|
14
15
|
Pressable as NativePressable,
|
|
15
16
|
ScrollView as NativeScrollView,
|
|
16
17
|
Text as NativeText,
|
|
@@ -19,6 +20,9 @@ import {
|
|
|
19
20
|
|
|
20
21
|
import type { GridScrollAxis, GridScrollSync, GridViewProps } from '../../../../types/grid-view';
|
|
21
22
|
import type { ReactNativeComponentInstance } from '../../../../types/react-native';
|
|
23
|
+
import { ScrollGestureLockContext } from '../../../layout/adapters/inbound/ScrollGestureLockContext';
|
|
24
|
+
import { useScrollGestureLock } from '../../../layout/adapters/inbound/useScrollGestureLock';
|
|
25
|
+
import { createScrollGestureLock } from '../../../layout/utils/createScrollGestureLock';
|
|
22
26
|
import { createGridScrollSync } from '../../application/createGridScrollSync';
|
|
23
27
|
|
|
24
28
|
type PinchGesture = Readonly<{ distance: number; focalPoint: GridPoint }>;
|
|
@@ -56,7 +60,10 @@ export function GridView({
|
|
|
56
60
|
renderItem,
|
|
57
61
|
testID,
|
|
58
62
|
viewportInteraction = 'enabled',
|
|
63
|
+
viewportControls = 'visible',
|
|
64
|
+
renderWorldLayer,
|
|
59
65
|
}: GridViewProps) {
|
|
66
|
+
const parentScrollLock = useScrollGestureLock();
|
|
60
67
|
const [uncontrolledViewport, setUncontrolledViewport] = React.useState(() =>
|
|
61
68
|
createInitialViewport(width, height, zoom, defaultViewport),
|
|
62
69
|
);
|
|
@@ -67,12 +74,14 @@ export function GridView({
|
|
|
67
74
|
const gridRef = React.useRef<ReactNativeComponentInstance<typeof NativeView>>(null);
|
|
68
75
|
const panRef = React.useRef<(displacement: GridPoint) => void>(() => undefined);
|
|
69
76
|
const scrollSyncRef = React.useRef<GridScrollSync | undefined>(undefined);
|
|
77
|
+
const dragPanRef = React.useRef<GridPoint | undefined>(undefined);
|
|
70
78
|
const pinchGestureRef = React.useRef<PinchGesture | undefined>(undefined);
|
|
71
79
|
const pinchMeasurementRef = React.useRef(0);
|
|
72
80
|
const pinchSessionRef = React.useRef(0);
|
|
73
81
|
const viewportOriginRef = React.useRef<ViewportOrigin>({ x: 0, y: 0 });
|
|
74
82
|
const focusRevealProposalRef = React.useRef<FocusRevealProposal | undefined>(undefined);
|
|
75
83
|
const focusRevealViewportRef = React.useRef<GridViewport | undefined>(undefined);
|
|
84
|
+
const [activeItemGestures, setActiveItemGestures] = React.useState(0);
|
|
76
85
|
const [isPinching, setIsPinching] = React.useState(false);
|
|
77
86
|
const constraints = React.useMemo(
|
|
78
87
|
() => viewportConstraints ?? createContentConstraints(contentWidth, contentHeight),
|
|
@@ -102,6 +111,13 @@ export function GridView({
|
|
|
102
111
|
const uncontrolled = controlledViewport === undefined;
|
|
103
112
|
const interactive = interactionPolicy !== 'passive';
|
|
104
113
|
const viewportInteractive = interactive && viewportInteraction === 'enabled';
|
|
114
|
+
const scrollLock = React.useMemo(
|
|
115
|
+
() =>
|
|
116
|
+
createScrollGestureLock(parentScrollLock, (delta) =>
|
|
117
|
+
setActiveItemGestures((count) => count + delta),
|
|
118
|
+
),
|
|
119
|
+
[parentScrollLock],
|
|
120
|
+
);
|
|
105
121
|
|
|
106
122
|
const publish = React.useCallback(
|
|
107
123
|
(nextViewport: GridViewport) => {
|
|
@@ -129,7 +145,7 @@ export function GridView({
|
|
|
129
145
|
),
|
|
130
146
|
);
|
|
131
147
|
|
|
132
|
-
React.
|
|
148
|
+
React.useLayoutEffect(() => {
|
|
133
149
|
viewportRef.current = viewport;
|
|
134
150
|
}, [viewport]);
|
|
135
151
|
|
|
@@ -144,8 +160,7 @@ export function GridView({
|
|
|
144
160
|
// Declared before the viewport-sync effect so the arbiter exists when that effect runs.
|
|
145
161
|
React.useEffect(() => {
|
|
146
162
|
const scrollSync = createGridScrollSync({
|
|
147
|
-
|
|
148
|
-
panRef.current(axis === 'x' ? { x: -displacement, y: 0 } : { x: 0, y: -displacement }),
|
|
163
|
+
acceptUnownedScroll: Platform.OS === 'web',
|
|
149
164
|
onUserScroll: (axis, displacement) =>
|
|
150
165
|
panRef.current(axis === 'x' ? { x: -displacement, y: 0 } : { x: 0, y: -displacement }),
|
|
151
166
|
scrollTo: (axis, offset, animated) => {
|
|
@@ -160,11 +175,48 @@ export function GridView({
|
|
|
160
175
|
};
|
|
161
176
|
}, []);
|
|
162
177
|
|
|
163
|
-
/** Routes native scroll events to the arbiter unless a pinch owns the
|
|
178
|
+
/** Routes native scroll events to the arbiter unless a pinch or an item gesture owns the scroll. */
|
|
164
179
|
const handleNativeScroll = (axis: GridScrollAxis, offset: number) => {
|
|
180
|
+
if (scrollLock.isActive?.()) {
|
|
181
|
+
const mapping = createScrollMapping(viewportRef.current, constraints);
|
|
182
|
+
scrollSyncRef.current?.restore(
|
|
183
|
+
axis,
|
|
184
|
+
offset,
|
|
185
|
+
axis === 'x' ? mapping.horizontal.position : mapping.vertical.position,
|
|
186
|
+
);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
165
189
|
if (!pinchGestureRef.current) scrollSyncRef.current?.scrolled(axis, offset);
|
|
166
190
|
};
|
|
167
191
|
|
|
192
|
+
/*** Keeps locked native lifecycle signals under the same restore ownership as their scroll frames. */
|
|
193
|
+
const handleNativeScrollBegan = (axis: GridScrollAxis, offset: number) => {
|
|
194
|
+
if (scrollLock.isActive?.()) {
|
|
195
|
+
const mapping = createScrollMapping(viewportRef.current, constraints);
|
|
196
|
+
scrollSyncRef.current?.restore(
|
|
197
|
+
axis,
|
|
198
|
+
offset,
|
|
199
|
+
axis === 'x' ? mapping.horizontal.position : mapping.vertical.position,
|
|
200
|
+
);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
scrollSyncRef.current?.dragBegan(axis, offset);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/*** Keeps locked native completion signals from settling a descendant gesture as a viewport pan. */
|
|
207
|
+
const handleNativeScrollEnded = (axis: GridScrollAxis, offset: number) => {
|
|
208
|
+
if (scrollLock.isActive?.()) {
|
|
209
|
+
const mapping = createScrollMapping(viewportRef.current, constraints);
|
|
210
|
+
scrollSyncRef.current?.restore(
|
|
211
|
+
axis,
|
|
212
|
+
offset,
|
|
213
|
+
axis === 'x' ? mapping.horizontal.position : mapping.vertical.position,
|
|
214
|
+
);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
scrollSyncRef.current?.scrollEnded(axis, offset);
|
|
218
|
+
};
|
|
219
|
+
|
|
168
220
|
const refreshViewportOrigin = React.useCallback(() => {
|
|
169
221
|
gridRef.current?.measureInWindow((x, y) => {
|
|
170
222
|
viewportOriginRef.current = { x, y };
|
|
@@ -295,158 +347,204 @@ export function GridView({
|
|
|
295
347
|
};
|
|
296
348
|
|
|
297
349
|
return (
|
|
298
|
-
<
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
<NativeScrollView
|
|
340
|
-
ref={horizontalScrollRef}
|
|
341
|
-
testID={testID ? `${testID}-horizontal-scroll` : undefined}
|
|
342
|
-
horizontal
|
|
343
|
-
scrollEnabled={viewportInteractive && !isPinching}
|
|
344
|
-
scrollEventThrottle={16}
|
|
345
|
-
showsHorizontalScrollIndicator
|
|
346
|
-
style={{ height, width }}
|
|
347
|
-
onMomentumScrollEnd={(event) =>
|
|
348
|
-
scrollSyncRef.current?.scrollEnded('x', event.nativeEvent.contentOffset.x)
|
|
349
|
-
}
|
|
350
|
-
onScroll={(event) => handleNativeScroll('x', event.nativeEvent.contentOffset.x)}
|
|
351
|
-
onScrollBeginDrag={(event) =>
|
|
352
|
-
scrollSyncRef.current?.dragBegan('x', event.nativeEvent.contentOffset.x)
|
|
353
|
-
}
|
|
350
|
+
<ScrollGestureLockContext.Provider value={scrollLock}>
|
|
351
|
+
<NativeView
|
|
352
|
+
ref={gridRef}
|
|
353
|
+
accessibilityLabel="Interactive grid viewport"
|
|
354
|
+
onLayout={refreshViewportOrigin}
|
|
355
|
+
onTouchEnd={() => {
|
|
356
|
+
const wasPinching = pinchGestureRef.current !== undefined;
|
|
357
|
+
pinchMeasurementRef.current += 1;
|
|
358
|
+
pinchSessionRef.current += 1;
|
|
359
|
+
pinchGestureRef.current = undefined;
|
|
360
|
+
setIsPinching(false);
|
|
361
|
+
if (wasPinching) syncScrollPosition();
|
|
362
|
+
}}
|
|
363
|
+
onTouchCancel={() => {
|
|
364
|
+
const wasPinching = pinchGestureRef.current !== undefined;
|
|
365
|
+
pinchMeasurementRef.current += 1;
|
|
366
|
+
pinchSessionRef.current += 1;
|
|
367
|
+
pinchGestureRef.current = undefined;
|
|
368
|
+
setIsPinching(false);
|
|
369
|
+
if (wasPinching) syncScrollPosition();
|
|
370
|
+
}}
|
|
371
|
+
onTouchMove={(event) => {
|
|
372
|
+
if (!viewportInteractive) return;
|
|
373
|
+
measurePinchGesture([...event.nativeEvent.touches], pinchSessionRef.current, (pinch) => {
|
|
374
|
+
const previous = pinchGestureRef.current;
|
|
375
|
+
pinchGestureRef.current = pinch;
|
|
376
|
+
setIsPinching(pinch !== undefined);
|
|
377
|
+
if (!pinch || !previous) return;
|
|
378
|
+
zoomAt(pinch.focalPoint, pinch.distance / previous.distance);
|
|
379
|
+
});
|
|
380
|
+
}}
|
|
381
|
+
onTouchStart={(event) => {
|
|
382
|
+
const session = pinchSessionRef.current + 1;
|
|
383
|
+
pinchSessionRef.current = session;
|
|
384
|
+
measurePinchGesture([...event.nativeEvent.touches], session, (pinch) => {
|
|
385
|
+
pinchGestureRef.current = pinch;
|
|
386
|
+
setIsPinching(pinch !== undefined);
|
|
387
|
+
});
|
|
388
|
+
}}
|
|
389
|
+
style={{ height, overflow: 'hidden', width }}
|
|
390
|
+
testID={testID}
|
|
354
391
|
>
|
|
355
392
|
<NativeScrollView
|
|
356
|
-
ref={
|
|
357
|
-
|
|
358
|
-
|
|
393
|
+
ref={horizontalScrollRef}
|
|
394
|
+
disableScrollViewPanResponder
|
|
395
|
+
nestedScrollEnabled
|
|
396
|
+
testID={testID ? `${testID}-horizontal-scroll` : undefined}
|
|
397
|
+
horizontal
|
|
398
|
+
scrollEnabled={viewportInteractive && activeItemGestures === 0 && !isPinching}
|
|
359
399
|
scrollEventThrottle={16}
|
|
360
|
-
|
|
361
|
-
style={{ height, width
|
|
400
|
+
showsHorizontalScrollIndicator
|
|
401
|
+
style={{ height, width }}
|
|
362
402
|
onMomentumScrollEnd={(event) =>
|
|
363
|
-
|
|
403
|
+
handleNativeScrollEnded('x', event.nativeEvent.contentOffset.x)
|
|
364
404
|
}
|
|
365
|
-
onScroll={(event) => handleNativeScroll('
|
|
405
|
+
onScroll={(event) => handleNativeScroll('x', event.nativeEvent.contentOffset.x)}
|
|
366
406
|
onScrollBeginDrag={(event) =>
|
|
367
|
-
|
|
407
|
+
handleNativeScrollBegan('x', event.nativeEvent.contentOffset.x)
|
|
368
408
|
}
|
|
369
409
|
>
|
|
370
|
-
<
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}}
|
|
410
|
+
<NativeScrollView
|
|
411
|
+
ref={verticalScrollRef}
|
|
412
|
+
disableScrollViewPanResponder
|
|
413
|
+
nestedScrollEnabled
|
|
414
|
+
testID={testID ? `${testID}-vertical-scroll` : undefined}
|
|
415
|
+
scrollEnabled={viewportInteractive && activeItemGestures === 0 && !isPinching}
|
|
416
|
+
scrollEventThrottle={16}
|
|
417
|
+
showsVerticalScrollIndicator
|
|
418
|
+
style={{ height, width: scrollMapping.horizontal.contentSize }}
|
|
419
|
+
onMomentumScrollEnd={(event) =>
|
|
420
|
+
handleNativeScrollEnded('y', event.nativeEvent.contentOffset.y)
|
|
421
|
+
}
|
|
422
|
+
onScroll={(event) => handleNativeScroll('y', event.nativeEvent.contentOffset.y)}
|
|
423
|
+
onScrollBeginDrag={(event) =>
|
|
424
|
+
handleNativeScrollBegan('y', event.nativeEvent.contentOffset.y)
|
|
425
|
+
}
|
|
375
426
|
>
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
427
|
+
<NativeView
|
|
428
|
+
style={{
|
|
429
|
+
height: scrollMapping.vertical.contentSize,
|
|
430
|
+
width: scrollMapping.horizontal.contentSize,
|
|
431
|
+
}}
|
|
432
|
+
>
|
|
433
|
+
{Platform.OS === 'web' && viewportInteractive ? (
|
|
382
434
|
<NativeView
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
435
|
+
accessible={false}
|
|
436
|
+
onResponderGrant={(event) => {
|
|
437
|
+
dragPanRef.current = { x: event.nativeEvent.pageX, y: event.nativeEvent.pageY };
|
|
438
|
+
}}
|
|
439
|
+
onResponderMove={(event) => {
|
|
440
|
+
const previous = dragPanRef.current;
|
|
441
|
+
if (!previous) return;
|
|
442
|
+
const next = { x: event.nativeEvent.pageX, y: event.nativeEvent.pageY };
|
|
443
|
+
dragPanRef.current = next;
|
|
444
|
+
pan({ x: next.x - previous.x, y: next.y - previous.y });
|
|
445
|
+
}}
|
|
446
|
+
onResponderRelease={() => {
|
|
447
|
+
dragPanRef.current = undefined;
|
|
390
448
|
}}
|
|
391
|
-
|
|
392
|
-
|
|
449
|
+
onResponderTerminate={() => {
|
|
450
|
+
dragPanRef.current = undefined;
|
|
451
|
+
}}
|
|
452
|
+
onStartShouldSetResponderCapture={() => true}
|
|
453
|
+
style={fillStyle}
|
|
454
|
+
testID={testID ? `${testID}-background` : undefined}
|
|
455
|
+
/>
|
|
456
|
+
) : null}
|
|
457
|
+
{renderWorldLayer ? (
|
|
458
|
+
<NativeView pointerEvents="box-none" style={fillStyle}>
|
|
459
|
+
{renderWorldLayer({
|
|
460
|
+
height: scrollMapping.vertical.contentSize,
|
|
461
|
+
origin: {
|
|
462
|
+
x: scrollMapping.horizontal.origin,
|
|
463
|
+
y: scrollMapping.vertical.origin,
|
|
464
|
+
},
|
|
465
|
+
pixelsPerUnitX: viewport.pixelsPerUnitX,
|
|
466
|
+
pixelsPerUnitY: viewport.pixelsPerUnitY,
|
|
467
|
+
width: scrollMapping.horizontal.contentSize,
|
|
468
|
+
})}
|
|
393
469
|
</NativeView>
|
|
394
|
-
)
|
|
395
|
-
|
|
396
|
-
|
|
470
|
+
) : null}
|
|
471
|
+
{visibleItems.map((item) => {
|
|
472
|
+
const position = worldToViewport(
|
|
473
|
+
{ x: item.x, y: item.y },
|
|
474
|
+
{ ...viewport, offsetX: 0, offsetY: 0 },
|
|
475
|
+
);
|
|
476
|
+
return (
|
|
477
|
+
<NativeView
|
|
478
|
+
key={item.id}
|
|
479
|
+
style={{
|
|
480
|
+
height: item.height * viewport.pixelsPerUnitY,
|
|
481
|
+
left: position.x + scrollMapping.horizontal.origin,
|
|
482
|
+
position: 'absolute',
|
|
483
|
+
top: position.y + scrollMapping.vertical.origin,
|
|
484
|
+
width: item.width * viewport.pixelsPerUnitX,
|
|
485
|
+
}}
|
|
486
|
+
>
|
|
487
|
+
{renderItem(item)}
|
|
488
|
+
</NativeView>
|
|
489
|
+
);
|
|
490
|
+
})}
|
|
491
|
+
</NativeView>
|
|
492
|
+
</NativeScrollView>
|
|
397
493
|
</NativeScrollView>
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
</
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
</
|
|
494
|
+
{viewportInteractive && viewportControls === 'visible' ? (
|
|
495
|
+
<NativeView accessibilityLabel="Viewport controls" style={controlsStyle}>
|
|
496
|
+
<NativePressable
|
|
497
|
+
accessibilityLabel="Pan left"
|
|
498
|
+
accessibilityRole="button"
|
|
499
|
+
onPress={() => pan({ x: 48, y: 0 })}
|
|
500
|
+
>
|
|
501
|
+
<NativeText>←</NativeText>
|
|
502
|
+
</NativePressable>
|
|
503
|
+
<NativePressable
|
|
504
|
+
accessibilityLabel="Pan right"
|
|
505
|
+
accessibilityRole="button"
|
|
506
|
+
onPress={() => pan({ x: -48, y: 0 })}
|
|
507
|
+
>
|
|
508
|
+
<NativeText>→</NativeText>
|
|
509
|
+
</NativePressable>
|
|
510
|
+
<NativePressable
|
|
511
|
+
accessibilityLabel="Pan up"
|
|
512
|
+
accessibilityRole="button"
|
|
513
|
+
onPress={() => pan({ x: 0, y: 48 })}
|
|
514
|
+
>
|
|
515
|
+
<NativeText>↑</NativeText>
|
|
516
|
+
</NativePressable>
|
|
517
|
+
<NativePressable
|
|
518
|
+
accessibilityLabel="Pan down"
|
|
519
|
+
accessibilityRole="button"
|
|
520
|
+
onPress={() => pan({ x: 0, y: -48 })}
|
|
521
|
+
>
|
|
522
|
+
<NativeText>↓</NativeText>
|
|
523
|
+
</NativePressable>
|
|
524
|
+
<NativePressable
|
|
525
|
+
accessibilityLabel="Zoom in"
|
|
526
|
+
accessibilityRole="button"
|
|
527
|
+
onPress={() => zoomAt({ x: width / 2, y: height / 2 }, 1.2)}
|
|
528
|
+
>
|
|
529
|
+
<NativeText>+</NativeText>
|
|
530
|
+
</NativePressable>
|
|
531
|
+
<NativePressable
|
|
532
|
+
accessibilityLabel="Zoom out"
|
|
533
|
+
accessibilityRole="button"
|
|
534
|
+
onPress={() => zoomAt({ x: width / 2, y: height / 2 }, 1 / 1.2)}
|
|
535
|
+
>
|
|
536
|
+
<NativeText>−</NativeText>
|
|
537
|
+
</NativePressable>
|
|
538
|
+
</NativeView>
|
|
539
|
+
) : null}
|
|
540
|
+
</NativeView>
|
|
541
|
+
</ScrollGestureLockContext.Provider>
|
|
446
542
|
);
|
|
447
543
|
}
|
|
448
544
|
|
|
545
|
+
const fillStyle = { bottom: 0, left: 0, position: 'absolute' as const, right: 0, top: 0 };
|
|
449
546
|
const controlsStyle = { bottom: 8, gap: 4, position: 'absolute' as const, right: 8 };
|
|
547
|
+
const VIEWPORT_NUMERIC_TOLERANCE = Number.EPSILON * 1024;
|
|
450
548
|
|
|
451
549
|
/*** Builds the initial world position and independent scales for uncontrolled rendering. */
|
|
452
550
|
function createInitialViewport(
|
|
@@ -539,15 +637,20 @@ function createScrollAxisMapping({
|
|
|
539
637
|
/*** Compares canonical viewport fields without treating equal proposals as state changes. */
|
|
540
638
|
function areViewportsEqual(left: GridViewport, right: GridViewport): boolean {
|
|
541
639
|
return (
|
|
542
|
-
left.width
|
|
543
|
-
left.height
|
|
544
|
-
left.offsetX
|
|
545
|
-
left.offsetY
|
|
546
|
-
left.pixelsPerUnitX
|
|
547
|
-
left.pixelsPerUnitY
|
|
640
|
+
areViewportValuesEqual(left.width, right.width) &&
|
|
641
|
+
areViewportValuesEqual(left.height, right.height) &&
|
|
642
|
+
areViewportValuesEqual(left.offsetX, right.offsetX) &&
|
|
643
|
+
areViewportValuesEqual(left.offsetY, right.offsetY) &&
|
|
644
|
+
areViewportValuesEqual(left.pixelsPerUnitX, right.pixelsPerUnitX) &&
|
|
645
|
+
areViewportValuesEqual(left.pixelsPerUnitY, right.pixelsPerUnitY)
|
|
548
646
|
);
|
|
549
647
|
}
|
|
550
648
|
|
|
649
|
+
/*** Treats machine-scale arithmetic residue as unchanged without rounding real viewport movement. */
|
|
650
|
+
function areViewportValuesEqual(left: number, right: number): boolean {
|
|
651
|
+
return Math.abs(left - right) <= VIEWPORT_NUMERIC_TOLERANCE;
|
|
652
|
+
}
|
|
653
|
+
|
|
551
654
|
/*** Skips a rejected controlled focus proposal until its focus or incoming viewport changes. */
|
|
552
655
|
function isRepeatedControlledFocusRevealProposal({
|
|
553
656
|
controlled,
|
|
@@ -24,17 +24,16 @@ function advance(milliseconds: number) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/*** Creates a controller whose native requests and user scrolls are recorded. */
|
|
27
|
-
function createRecordedSync() {
|
|
28
|
-
const programmaticScrolls: UserScroll[] = [];
|
|
27
|
+
function createRecordedSync(acceptUnownedScroll = true) {
|
|
29
28
|
const requests: ScrollRequest[] = [];
|
|
30
29
|
const userScrolls: UserScroll[] = [];
|
|
31
30
|
const sync = createGridScrollSync({
|
|
31
|
+
acceptUnownedScroll,
|
|
32
32
|
now: () => clock,
|
|
33
|
-
onProgrammaticScroll: (axis, displacement) => programmaticScrolls.push([axis, displacement]),
|
|
34
33
|
onUserScroll: (axis, displacement) => userScrolls.push([axis, displacement]),
|
|
35
34
|
scrollTo: (axis, offset, animated) => requests.push([axis, offset, animated]),
|
|
36
35
|
});
|
|
37
|
-
return {
|
|
36
|
+
return { requests, sync, userScrolls };
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
test('adopts native scrolling as user input when nothing was requested', () => {
|
|
@@ -133,24 +132,36 @@ test('keeps a vertical animation pending while the user drags horizontally', ()
|
|
|
133
132
|
sync.dragBegan('x', 120);
|
|
134
133
|
sync.scrolled('y', 80);
|
|
135
134
|
sync.scrolled('y', 199.7);
|
|
135
|
+
sync.scrolled('x', 140);
|
|
136
136
|
|
|
137
|
-
expect(userScrolls).toEqual([['x',
|
|
137
|
+
expect(userScrolls).toEqual([['x', 20]]);
|
|
138
138
|
});
|
|
139
139
|
|
|
140
|
-
test('
|
|
140
|
+
test('uses a native drag-begin offset as the baseline when it interrupts an animation', () => {
|
|
141
141
|
const { sync, userScrolls } = createRecordedSync();
|
|
142
142
|
sync.request({ x: 0, y: 200 }, true);
|
|
143
143
|
sync.scrolled('y', 40);
|
|
144
144
|
|
|
145
145
|
sync.dragBegan('y', 55);
|
|
146
146
|
|
|
147
|
-
expect(userScrolls).toEqual([
|
|
147
|
+
expect(userScrolls).toEqual([]);
|
|
148
148
|
expect(jest.getTimerCount()).toBe(0);
|
|
149
149
|
sync.scrolled('y', 70);
|
|
150
|
-
expect(userScrolls).toEqual([
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
expect(userScrolls).toEqual([['y', 15]]);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test('does not publish a viewport pan from a descendant gesture terminal offset at native drag begin', () => {
|
|
154
|
+
const { sync, userScrolls } = createRecordedSync(false);
|
|
155
|
+
|
|
156
|
+
sync.request({ x: 2000, y: 2000 }, false);
|
|
157
|
+
sync.scrolled('x', 2000);
|
|
158
|
+
sync.scrolled('y', 2000);
|
|
159
|
+
sync.dragBegan('x', 1995);
|
|
160
|
+
sync.dragBegan('y', 2004.6666666666665);
|
|
161
|
+
sync.scrollEnded('x', 1995);
|
|
162
|
+
sync.scrollEnded('y', 2004.6666666666665);
|
|
163
|
+
|
|
164
|
+
expect(userScrolls).toEqual([]);
|
|
154
165
|
});
|
|
155
166
|
|
|
156
167
|
test('adopts the final native offset when an unreachable animation ends short', () => {
|
|
@@ -201,8 +212,8 @@ test('suppresses late animation echoes even after fallback reconciles a stalled
|
|
|
201
212
|
]);
|
|
202
213
|
});
|
|
203
214
|
|
|
204
|
-
test('converges the logical position when a delayed animation resumes after fallback', () => {
|
|
205
|
-
const {
|
|
215
|
+
test('converges the logical position when a delayed browser animation resumes after fallback', () => {
|
|
216
|
+
const { sync, userScrolls } = createRecordedSync();
|
|
206
217
|
sync.request({ x: 0, y: 200 }, true);
|
|
207
218
|
sync.scrolled('y', 40);
|
|
208
219
|
|
|
@@ -213,10 +224,6 @@ test('converges the logical position when a delayed animation resumes after fall
|
|
|
213
224
|
sync.scrollEnded('y', 200);
|
|
214
225
|
|
|
215
226
|
expect(userScrolls).toEqual([['y', -160]]);
|
|
216
|
-
expect(programmaticScrolls).toEqual([
|
|
217
|
-
['y', 60],
|
|
218
|
-
['y', 100],
|
|
219
|
-
]);
|
|
220
227
|
});
|
|
221
228
|
|
|
222
229
|
test('retargeting discards residual echo ownership from an earlier animation', () => {
|
|
@@ -277,6 +284,28 @@ test('returns control to the user once the programmatic scroll window expires',
|
|
|
277
284
|
expect(userScrolls).toEqual([['y', -110]]);
|
|
278
285
|
});
|
|
279
286
|
|
|
287
|
+
test('keeps restoration ownership through delayed lifecycle events without blocking the next drag', () => {
|
|
288
|
+
const { requests, sync, userScrolls } = createRecordedSync(false);
|
|
289
|
+
|
|
290
|
+
sync.restore('y', 24, 0);
|
|
291
|
+
sync.scrolled('y', 0);
|
|
292
|
+
sync.dragBegan('y', 24);
|
|
293
|
+
sync.scrollEnded('y', 24);
|
|
294
|
+
sync.scrolled('y', 0);
|
|
295
|
+
|
|
296
|
+
expect(userScrolls).toEqual([]);
|
|
297
|
+
expect(requests).toEqual([
|
|
298
|
+
['y', 0, false],
|
|
299
|
+
['y', 0, false],
|
|
300
|
+
['y', 0, false],
|
|
301
|
+
]);
|
|
302
|
+
|
|
303
|
+
sync.dragBegan('y', 0);
|
|
304
|
+
sync.scrolled('y', 16);
|
|
305
|
+
|
|
306
|
+
expect(userScrolls).toEqual([['y', 16]]);
|
|
307
|
+
});
|
|
308
|
+
|
|
280
309
|
test('cancels every pending settle timer on dispose', () => {
|
|
281
310
|
const { sync, userScrolls } = createRecordedSync();
|
|
282
311
|
sync.request({ x: 300, y: 200 }, true);
|