@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,13 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import"../../chunks/Accordion-e8tapf5a.js";
|
|
3
|
-
import"../../chunks/Accordion-
|
|
4
|
-
import"../../chunks/Accordion-
|
|
3
|
+
import"../../chunks/Accordion-pagdkp07.js";
|
|
4
|
+
import"../../chunks/Accordion-2kv6p7by.js";
|
|
5
|
+
import"../../chunks/Accordion-w8zke8fa.js";
|
|
5
6
|
import"../../chunks/Accordion-x1ze1wvk.js";
|
|
6
7
|
import"../../chunks/Accordion-fkftnxgw.js";
|
|
7
|
-
import"../../chunks/Accordion-
|
|
8
|
+
import"../../chunks/Accordion-5x4cv0kv.js";
|
|
8
9
|
import {
|
|
9
10
|
Field2
|
|
10
|
-
} from "../../chunks/Accordion-
|
|
11
|
+
} from "../../chunks/Accordion-ak6dvant.js";
|
|
11
12
|
export {
|
|
12
13
|
Field2 as Field
|
|
13
14
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import"../../chunks/Accordion-
|
|
2
|
+
import"../../chunks/Accordion-w8zke8fa.js";
|
|
3
|
+
import"../../chunks/Accordion-snk6nggm.js";
|
|
3
4
|
import"../../chunks/Accordion-e8tapf5a.js";
|
|
4
|
-
import"../../chunks/Accordion-
|
|
5
|
-
import"../../chunks/Accordion-
|
|
6
|
-
import"../../chunks/Accordion-
|
|
5
|
+
import"../../chunks/Accordion-pagdkp07.js";
|
|
6
|
+
import"../../chunks/Accordion-hbwyj12m.js";
|
|
7
|
+
import"../../chunks/Accordion-2kv6p7by.js";
|
|
7
8
|
import"../../chunks/Accordion-x1ze1wvk.js";
|
|
8
|
-
import"../../chunks/Accordion-
|
|
9
|
+
import"../../chunks/Accordion-2b3sd76b.js";
|
|
9
10
|
import"../../chunks/Accordion-fkftnxgw.js";
|
|
10
|
-
import"../../chunks/Accordion-
|
|
11
|
+
import"../../chunks/Accordion-5x4cv0kv.js";
|
|
11
12
|
import {
|
|
12
13
|
FileExplorer2
|
|
13
|
-
} from "../../chunks/Accordion-
|
|
14
|
+
} from "../../chunks/Accordion-ajqj6ymg.js";
|
|
14
15
|
export {
|
|
15
16
|
FileExplorer2 as FileExplorer
|
|
16
17
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import"../../chunks/Accordion-e8tapf5a.js";
|
|
3
|
-
import"../../chunks/Accordion-
|
|
3
|
+
import"../../chunks/Accordion-pagdkp07.js";
|
|
4
4
|
import"../../chunks/Accordion-x1ze1wvk.js";
|
|
5
5
|
import"../../chunks/Accordion-fkftnxgw.js";
|
|
6
|
-
import"../../chunks/Accordion-
|
|
7
|
-
import"../../chunks/Accordion-
|
|
6
|
+
import"../../chunks/Accordion-5x4cv0kv.js";
|
|
7
|
+
import"../../chunks/Accordion-2kv6p7by.js";
|
|
8
|
+
import"../../chunks/Accordion-w8zke8fa.js";
|
|
8
9
|
import {
|
|
9
10
|
FlatList2
|
|
10
|
-
} from "../../chunks/Accordion-
|
|
11
|
-
import"../../chunks/Accordion-
|
|
11
|
+
} from "../../chunks/Accordion-7eysykr1.js";
|
|
12
|
+
import"../../chunks/Accordion-qz6ddnmv.js";
|
|
12
13
|
export {
|
|
13
14
|
FlatList2 as FlatList
|
|
14
15
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { FlowCanvasProps } from './FlowCanvas.types-0.js';
|
|
4
|
+
|
|
5
|
+
/** Render the controlled, accessible process-editor canvas shared by React Native and React Native Web. */
|
|
6
|
+
export declare const FlowCanvas: (props: FlowCanvasProps) => React.ReactElement | null;
|
|
7
|
+
export type { FlowCanvasProps, FlowConnection, FlowConnectionRejection, FlowNodeData, FlowNodeRenderState, FlowPaletteItem, FlowPoint, FlowPort, FlowPortAddress, FlowViewport } from './FlowCanvas.types-0.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { InteractionPolicy } from '@ankhorage/surface/web';
|
|
2
|
+
|
|
3
|
+
import type { ZoraThemeId, ZoraThemeMode } from './FlowCanvas.dependency-1.js';
|
|
4
|
+
|
|
5
|
+
export interface ZoraBaseProps {
|
|
6
|
+
/**
|
|
7
|
+
* Overrides the active ZORA theme for this component and its subtree.
|
|
8
|
+
* If omitted, the nearest parent theme is inherited.
|
|
9
|
+
*
|
|
10
|
+
* Plan 2: theme registries are not available yet. Only the inherited theme id
|
|
11
|
+
* is valid; unknown ids throw in dev/test and warn+fallback in production.
|
|
12
|
+
*/
|
|
13
|
+
themeId?: ZoraThemeId;
|
|
14
|
+
/**
|
|
15
|
+
* Overrides the light/dark mode for this component and its subtree.
|
|
16
|
+
* If omitted, the nearest parent mode is inherited.
|
|
17
|
+
*/
|
|
18
|
+
mode?: ZoraThemeMode;
|
|
19
|
+
/** Inherits the nearest surface polarity unless explicitly inverted or reset to normal. */
|
|
20
|
+
inverted?: boolean;
|
|
21
|
+
testID?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Controls whether user interaction is enabled or suppressed.
|
|
24
|
+
* When omitted, the component behaves as enabled.
|
|
25
|
+
*/
|
|
26
|
+
interactionPolicy?: InteractionPolicy;
|
|
27
|
+
}
|
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Path,
|
|
4
|
+
elements_web_default
|
|
5
|
+
} from "../../chunks/Accordion-z3m3wvfz.js";
|
|
6
|
+
import"../../chunks/Accordion-e8tapf5a.js";
|
|
7
|
+
import {
|
|
8
|
+
withZoraThemeScope
|
|
9
|
+
} from "../../chunks/Accordion-pagdkp07.js";
|
|
10
|
+
import"../../chunks/Accordion-e9xmwxzp.js";
|
|
11
|
+
import"../../chunks/Accordion-2kv6p7by.js";
|
|
12
|
+
import"../../chunks/Accordion-w8zke8fa.js";
|
|
13
|
+
import {
|
|
14
|
+
useZoraTheme2
|
|
15
|
+
} from "../../chunks/Accordion-x1ze1wvk.js";
|
|
16
|
+
import"../../chunks/Accordion-fkftnxgw.js";
|
|
17
|
+
import"../../chunks/Accordion-5x4cv0kv.js";
|
|
18
|
+
import"../../chunks/Accordion-dnfgtbq3.js";
|
|
19
|
+
import"../../chunks/Accordion-hbwyj12m.js";
|
|
20
|
+
import"../../chunks/Accordion-a0hbjxg9.js";
|
|
21
|
+
import"../../chunks/Accordion-vbh3xqv6.js";
|
|
22
|
+
import"../../chunks/Accordion-2b3sd76b.js";
|
|
23
|
+
import {
|
|
24
|
+
getGraphNodePortGeometry,
|
|
25
|
+
GraphNode2
|
|
26
|
+
} from "../../chunks/Accordion-mkd3k28h.js";
|
|
27
|
+
import {
|
|
28
|
+
GridView2
|
|
29
|
+
} from "../../chunks/Accordion-snk6nggm.js";
|
|
30
|
+
import {
|
|
31
|
+
viewportToWorld
|
|
32
|
+
} from "../../chunks/Accordion-tnyqv1xv.js";
|
|
33
|
+
|
|
34
|
+
// src/features/flow/adapters/inbound/FlowCanvas.tsx
|
|
35
|
+
import React from "react";
|
|
36
|
+
import { Pressable, Text, View } from "react-native-web";
|
|
37
|
+
|
|
38
|
+
// src/features/flow/application/createFlowEditorController.ts
|
|
39
|
+
function createFlowEditorController(props) {
|
|
40
|
+
const selectNode = (nodeId) => {
|
|
41
|
+
if (props.readOnly || props.nodes.find((node) => node.id === nodeId)?.disabled)
|
|
42
|
+
return;
|
|
43
|
+
props.onNodeSelectionChange?.([nodeId]);
|
|
44
|
+
};
|
|
45
|
+
const moveNode = (nodeId, delta) => {
|
|
46
|
+
if (props.readOnly)
|
|
47
|
+
return;
|
|
48
|
+
const node = props.nodes.find((candidate) => candidate.id === nodeId);
|
|
49
|
+
if (!node || node.disabled)
|
|
50
|
+
return;
|
|
51
|
+
props.onNodesMove?.(props.nodes.map((candidate) => candidate.id === nodeId ? { ...candidate, position: movePosition(candidate, delta) } : candidate));
|
|
52
|
+
};
|
|
53
|
+
const setViewport = (viewport) => props.onViewportChange?.(viewport);
|
|
54
|
+
const connect = (source, target) => {
|
|
55
|
+
const rejection = connectionRejection(props.nodes, source, target);
|
|
56
|
+
if (props.readOnly || rejection)
|
|
57
|
+
return rejection;
|
|
58
|
+
props.onConnect?.(source, target);
|
|
59
|
+
return;
|
|
60
|
+
};
|
|
61
|
+
const deleteNodes = (nodeIds) => {
|
|
62
|
+
if (props.readOnly || nodeIds.length === 0)
|
|
63
|
+
return;
|
|
64
|
+
const enabledNodeIds = nodeIds.filter((nodeId) => {
|
|
65
|
+
const node = props.nodes.find((candidate) => candidate.id === nodeId);
|
|
66
|
+
return node !== undefined && !node.disabled;
|
|
67
|
+
});
|
|
68
|
+
if (enabledNodeIds.length > 0)
|
|
69
|
+
props.onNodesDelete?.(enabledNodeIds);
|
|
70
|
+
};
|
|
71
|
+
return { connect, deleteNodes, moveNode, selectNode, setViewport };
|
|
72
|
+
}
|
|
73
|
+
function movePosition(node, delta) {
|
|
74
|
+
return { x: node.position.x + delta.x, y: node.position.y + delta.y };
|
|
75
|
+
}
|
|
76
|
+
function connectionRejection(nodes, source, target) {
|
|
77
|
+
if (source.nodeId === target.nodeId)
|
|
78
|
+
return "connection_requires_distinct_nodes";
|
|
79
|
+
const sourcePort = findPort(nodes, source);
|
|
80
|
+
const targetPort = findPort(nodes, target);
|
|
81
|
+
if (sourcePort?.direction !== "output" || targetPort?.direction !== "input") {
|
|
82
|
+
return "connection_requires_output_to_input";
|
|
83
|
+
}
|
|
84
|
+
if (sourcePort.disabled || targetPort.disabled)
|
|
85
|
+
return "connection_targets_disabled_port";
|
|
86
|
+
return compatibleDataSchemas(sourcePort.data, targetPort.data) ? undefined : "connection_types_incompatible";
|
|
87
|
+
}
|
|
88
|
+
function compatibleDataSchemas(source, target) {
|
|
89
|
+
const sourceReference = source?.schemaRef?.id ?? source?.schema?.ref?.id;
|
|
90
|
+
const targetReference = target?.schemaRef?.id ?? target?.schema?.ref?.id;
|
|
91
|
+
if (sourceReference && targetReference)
|
|
92
|
+
return sourceReference === targetReference;
|
|
93
|
+
if (sourceReference || targetReference)
|
|
94
|
+
return false;
|
|
95
|
+
const sourceTypes = schemaTypes(source?.schema?.type);
|
|
96
|
+
const targetTypes = schemaTypes(target?.schema?.type);
|
|
97
|
+
if (sourceTypes.length === 0 || targetTypes.length === 0)
|
|
98
|
+
return true;
|
|
99
|
+
return sourceTypes.some((type) => targetTypes.includes(type));
|
|
100
|
+
}
|
|
101
|
+
function schemaTypes(type) {
|
|
102
|
+
if (typeof type === "string")
|
|
103
|
+
return [type];
|
|
104
|
+
return Array.isArray(type) && type.every((candidate) => typeof candidate === "string") ? type : [];
|
|
105
|
+
}
|
|
106
|
+
function findPort(nodes, address) {
|
|
107
|
+
return nodes.find((node) => node.id === address.nodeId)?.ports.find((port) => port.id === address.portId);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// src/features/flow/application/getFlowPortAnchor.ts
|
|
111
|
+
function getFlowPortAnchorKey(address) {
|
|
112
|
+
return JSON.stringify([address.nodeId, address.portId]);
|
|
113
|
+
}
|
|
114
|
+
function getFlowPortAnchor(anchors, address) {
|
|
115
|
+
return anchors.get(getFlowPortAnchorKey(address));
|
|
116
|
+
}
|
|
117
|
+
function getDeterministicFlowPortAnchor(node, address) {
|
|
118
|
+
return getGraphNodePortGeometry({ ports: node.ports }).ports.find((port) => port.id === address.portId)?.anchor;
|
|
119
|
+
}
|
|
120
|
+
function getDeterministicFlowNodeHeight(node) {
|
|
121
|
+
return getGraphNodePortGeometry({ ports: node.ports }).height;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// src/features/flow/application/mapFlowViewport.ts
|
|
125
|
+
function flowViewportToGrid(viewport, size) {
|
|
126
|
+
return {
|
|
127
|
+
height: size.height,
|
|
128
|
+
offsetX: -viewport.pan.x / viewport.zoom,
|
|
129
|
+
offsetY: -viewport.pan.y / viewport.zoom,
|
|
130
|
+
pixelsPerUnitX: viewport.zoom,
|
|
131
|
+
pixelsPerUnitY: viewport.zoom,
|
|
132
|
+
width: size.width
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function gridViewportToFlow(viewport) {
|
|
136
|
+
return {
|
|
137
|
+
pan: {
|
|
138
|
+
x: viewport.offsetX === 0 ? 0 : -viewport.offsetX * viewport.pixelsPerUnitX,
|
|
139
|
+
y: viewport.offsetY === 0 ? 0 : -viewport.offsetY * viewport.pixelsPerUnitY
|
|
140
|
+
},
|
|
141
|
+
zoom: viewport.pixelsPerUnitX
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// src/features/flow/adapters/inbound/FlowCanvas.tsx
|
|
146
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
147
|
+
var WORLD_PADDING = 2000;
|
|
148
|
+
var FlowCanvas = withZoraThemeScope(FlowCanvasInner);
|
|
149
|
+
function FlowCanvasInner(props) {
|
|
150
|
+
const propsRef = React.useRef(props);
|
|
151
|
+
const controllerRef = React.useRef(createFlowEditorController(props));
|
|
152
|
+
const pendingSourceRef = React.useRef(null);
|
|
153
|
+
React.useLayoutEffect(() => {
|
|
154
|
+
propsRef.current = props;
|
|
155
|
+
controllerRef.current = createFlowEditorController(props);
|
|
156
|
+
}, [props]);
|
|
157
|
+
const [localAnchors, setLocalAnchors] = React.useState(new Map);
|
|
158
|
+
const [nodeHeights, setNodeHeights] = React.useState(new Map);
|
|
159
|
+
const [size, setSize] = React.useState({ height: 0, width: 0 });
|
|
160
|
+
const { theme } = useZoraTheme2();
|
|
161
|
+
const selectedNodeIdSet = React.useMemo(() => new Set(props.selectedNodeIds ?? []), [props.selectedNodeIds]);
|
|
162
|
+
const minZoom = props.minZoom ?? 0.5;
|
|
163
|
+
const maxZoom = props.maxZoom ?? 2;
|
|
164
|
+
const gridViewport = React.useMemo(() => flowViewportToGrid(props.viewport, size), [props.viewport, size]);
|
|
165
|
+
const items = React.useMemo(() => props.nodes.map((node) => ({
|
|
166
|
+
height: nodeHeights.get(node.id) ?? getDeterministicFlowNodeHeight(node),
|
|
167
|
+
id: node.id,
|
|
168
|
+
width: getGraphNodePortGeometry({ ports: node.ports }).width,
|
|
169
|
+
x: node.position.x,
|
|
170
|
+
y: node.position.y
|
|
171
|
+
})), [nodeHeights, props.nodes]);
|
|
172
|
+
const world = React.useMemo(() => createWorldBounds(items, gridViewport), [gridViewport, items]);
|
|
173
|
+
const constraints = React.useMemo(() => ({ world }), [world]);
|
|
174
|
+
const nodeById = React.useMemo(() => new Map(props.nodes.map((node) => [node.id, node])), [props.nodes]);
|
|
175
|
+
const selectPort = React.useCallback((address) => {
|
|
176
|
+
const { current } = propsRef;
|
|
177
|
+
const port = current.nodes.find((node) => node.id === address.nodeId)?.ports.find((item) => item.id === address.portId);
|
|
178
|
+
if (!port || current.readOnly)
|
|
179
|
+
return;
|
|
180
|
+
const pendingSource = pendingSourceRef.current;
|
|
181
|
+
if (pendingSource === null) {
|
|
182
|
+
if (port.direction === "output")
|
|
183
|
+
pendingSourceRef.current = address;
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const rejection = controllerRef.current.connect(pendingSource, address);
|
|
187
|
+
if (rejection)
|
|
188
|
+
current.onConnectionRejected?.(pendingSource, address, rejection);
|
|
189
|
+
pendingSourceRef.current = null;
|
|
190
|
+
}, []);
|
|
191
|
+
const setZoom = React.useCallback((zoom) => {
|
|
192
|
+
const { current } = propsRef;
|
|
193
|
+
controllerRef.current.setViewport({
|
|
194
|
+
...current.viewport,
|
|
195
|
+
zoom: Math.max(minZoom, Math.min(maxZoom, zoom))
|
|
196
|
+
});
|
|
197
|
+
}, [maxZoom, minZoom]);
|
|
198
|
+
const setPortAnchor = React.useCallback((address, anchor) => {
|
|
199
|
+
const key = getFlowPortAnchorKey(address);
|
|
200
|
+
setLocalAnchors((current) => {
|
|
201
|
+
const previous = current.get(key);
|
|
202
|
+
if (previous?.x === anchor.x && previous.y === anchor.y)
|
|
203
|
+
return current;
|
|
204
|
+
return new Map(current).set(key, anchor);
|
|
205
|
+
});
|
|
206
|
+
}, []);
|
|
207
|
+
const setNodeHeight = React.useCallback((nodeId, height) => {
|
|
208
|
+
setNodeHeights((current) => current.get(nodeId) === height ? current : new Map(current).set(nodeId, height));
|
|
209
|
+
}, []);
|
|
210
|
+
const publishViewport = React.useCallback((next) => controllerRef.current.setViewport(gridViewportToFlow(next)), []);
|
|
211
|
+
const viewportRef = React.useRef(gridViewport);
|
|
212
|
+
React.useLayoutEffect(() => {
|
|
213
|
+
viewportRef.current = gridViewport;
|
|
214
|
+
}, [gridViewport]);
|
|
215
|
+
const moveNode = React.useCallback((nodeId, delta) => {
|
|
216
|
+
const grid = viewportRef.current;
|
|
217
|
+
const origin = viewportToWorld({ x: 0, y: 0 }, grid);
|
|
218
|
+
const target = viewportToWorld(delta, grid);
|
|
219
|
+
controllerRef.current.moveNode(nodeId, { x: target.x - origin.x, y: target.y - origin.y });
|
|
220
|
+
}, []);
|
|
221
|
+
const disconnect = React.useCallback((connectionId) => propsRef.current.onDisconnect?.(connectionId), []);
|
|
222
|
+
const deleteSelectedNodes = React.useCallback(() => controllerRef.current.deleteNodes(propsRef.current.selectedNodeIds ?? []), []);
|
|
223
|
+
const renderNode = (item) => {
|
|
224
|
+
const node = nodeById.get(item.id);
|
|
225
|
+
if (!node)
|
|
226
|
+
return null;
|
|
227
|
+
const selected = selectedNodeIdSet.has(node.id);
|
|
228
|
+
return /* @__PURE__ */ jsx(View, {
|
|
229
|
+
style: {
|
|
230
|
+
transform: [{ scale: props.viewport.zoom }],
|
|
231
|
+
transformOrigin: "top left",
|
|
232
|
+
width: getGraphNodePortGeometry({ ports: node.ports }).width
|
|
233
|
+
},
|
|
234
|
+
onLayout: (event) => setNodeHeight(node.id, event.nativeEvent.layout.height),
|
|
235
|
+
children: /* @__PURE__ */ jsx(GraphNode2, {
|
|
236
|
+
description: node.description,
|
|
237
|
+
disabled: node.disabled,
|
|
238
|
+
ports: node.ports.map((port) => ({
|
|
239
|
+
...port,
|
|
240
|
+
testID: `flow-port-${node.id}-${port.id}`
|
|
241
|
+
})),
|
|
242
|
+
readOnly: props.readOnly === true,
|
|
243
|
+
selected,
|
|
244
|
+
testID: `flow-node-${node.id}`,
|
|
245
|
+
title: node.title,
|
|
246
|
+
width: getGraphNodePortGeometry({ ports: node.ports }).width,
|
|
247
|
+
onMove: (delta) => moveNode(node.id, delta),
|
|
248
|
+
onPortLayout: (portId, anchor) => setPortAnchor({ nodeId: node.id, portId }, anchor),
|
|
249
|
+
onPortPress: (portId) => selectPort({ nodeId: node.id, portId }),
|
|
250
|
+
onPress: () => controllerRef.current.selectNode(node.id),
|
|
251
|
+
children: props.renderNode?.(node, { selected })
|
|
252
|
+
})
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
return /* @__PURE__ */ jsxs(View, {
|
|
256
|
+
style: {
|
|
257
|
+
backgroundColor: theme.semantics.neutral.surfaceHover,
|
|
258
|
+
borderColor: theme.semantics.neutral.divider,
|
|
259
|
+
borderRadius: 14,
|
|
260
|
+
borderWidth: 1,
|
|
261
|
+
flex: 1,
|
|
262
|
+
minHeight: 360,
|
|
263
|
+
overflow: "hidden"
|
|
264
|
+
},
|
|
265
|
+
testID: props.testID,
|
|
266
|
+
children: [
|
|
267
|
+
/* @__PURE__ */ jsx(FlowToolbar, {
|
|
268
|
+
canRedo: props.canRedo === true,
|
|
269
|
+
canUndo: props.canUndo === true,
|
|
270
|
+
canDelete: (props.selectedNodeIds?.length ?? 0) > 0,
|
|
271
|
+
readOnly: props.readOnly === true,
|
|
272
|
+
onDelete: deleteSelectedNodes,
|
|
273
|
+
onRedo: props.onRedo,
|
|
274
|
+
onUndo: props.onUndo,
|
|
275
|
+
onZoomIn: () => setZoom(props.viewport.zoom + 0.1),
|
|
276
|
+
onZoomOut: () => setZoom(props.viewport.zoom - 0.1)
|
|
277
|
+
}),
|
|
278
|
+
/* @__PURE__ */ jsx(View, {
|
|
279
|
+
onLayout: (event) => setSize({
|
|
280
|
+
height: Math.round(event.nativeEvent.layout.height),
|
|
281
|
+
width: Math.round(event.nativeEvent.layout.width)
|
|
282
|
+
}),
|
|
283
|
+
testID: props.testID ? `${props.testID}-viewport` : undefined,
|
|
284
|
+
style: { backgroundColor: theme.semantics.surface.default, flex: 1, minHeight: 300 },
|
|
285
|
+
children: size.width > 0 && size.height > 0 ? /* @__PURE__ */ jsx(GridView2, {
|
|
286
|
+
contentHeight: world.height,
|
|
287
|
+
contentWidth: world.width,
|
|
288
|
+
height: size.height,
|
|
289
|
+
items,
|
|
290
|
+
renderItem: renderNode,
|
|
291
|
+
renderWorldLayer: (layer) => /* @__PURE__ */ jsx(FlowEdges, {
|
|
292
|
+
anchors: localAnchors,
|
|
293
|
+
connections: props.connections,
|
|
294
|
+
layer,
|
|
295
|
+
nodes: nodeById,
|
|
296
|
+
readOnly: props.readOnly === true,
|
|
297
|
+
onDisconnect: disconnect
|
|
298
|
+
}),
|
|
299
|
+
testID: props.testID ? `${props.testID}-grid` : undefined,
|
|
300
|
+
viewport: gridViewport,
|
|
301
|
+
viewportConstraints: constraints,
|
|
302
|
+
viewportControls: "hidden",
|
|
303
|
+
width: size.width,
|
|
304
|
+
zoomLimits: { maxX: maxZoom, maxY: maxZoom, minX: minZoom, minY: minZoom },
|
|
305
|
+
onViewportChange: publishViewport
|
|
306
|
+
}) : null
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ jsx(FlowPalette, {
|
|
309
|
+
items: props.paletteItems,
|
|
310
|
+
readOnly: props.readOnly === true,
|
|
311
|
+
onInsert: props.onInsert
|
|
312
|
+
})
|
|
313
|
+
]
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function createWorldBounds(items, viewport) {
|
|
317
|
+
const visibleWidth = viewport.width / viewport.pixelsPerUnitX;
|
|
318
|
+
const visibleHeight = viewport.height / viewport.pixelsPerUnitY;
|
|
319
|
+
let minX = viewport.offsetX;
|
|
320
|
+
let minY = viewport.offsetY;
|
|
321
|
+
let maxX = viewport.offsetX + visibleWidth;
|
|
322
|
+
let maxY = viewport.offsetY + visibleHeight;
|
|
323
|
+
for (const item of items) {
|
|
324
|
+
minX = Math.min(minX, item.x - WORLD_PADDING);
|
|
325
|
+
minY = Math.min(minY, item.y - WORLD_PADDING);
|
|
326
|
+
maxX = Math.max(maxX, item.x + item.width + WORLD_PADDING);
|
|
327
|
+
maxY = Math.max(maxY, item.y + item.height + WORLD_PADDING);
|
|
328
|
+
}
|
|
329
|
+
return { height: maxY - minY, width: maxX - minX, x: minX, y: minY };
|
|
330
|
+
}
|
|
331
|
+
function FlowToolbar(props) {
|
|
332
|
+
const { theme } = useZoraTheme2();
|
|
333
|
+
return /* @__PURE__ */ jsxs(View, {
|
|
334
|
+
style: {
|
|
335
|
+
backgroundColor: theme.semantics.surface.default,
|
|
336
|
+
borderBottomColor: theme.semantics.neutral.divider,
|
|
337
|
+
borderBottomWidth: 1,
|
|
338
|
+
flexDirection: "row",
|
|
339
|
+
flexWrap: "wrap",
|
|
340
|
+
gap: 8,
|
|
341
|
+
padding: 10,
|
|
342
|
+
width: "100%"
|
|
343
|
+
},
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ jsx(FlowControl, {
|
|
346
|
+
label: "Zoom out",
|
|
347
|
+
onPress: props.onZoomOut
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ jsx(FlowControl, {
|
|
350
|
+
label: "Zoom in",
|
|
351
|
+
onPress: props.onZoomIn
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ jsx(FlowControl, {
|
|
354
|
+
disabled: props.readOnly || !props.canDelete,
|
|
355
|
+
label: "Delete selected nodes",
|
|
356
|
+
onPress: props.onDelete
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ jsx(FlowControl, {
|
|
359
|
+
disabled: props.readOnly || !props.canUndo,
|
|
360
|
+
label: "Undo",
|
|
361
|
+
onPress: props.onUndo
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ jsx(FlowControl, {
|
|
364
|
+
disabled: props.readOnly || !props.canRedo,
|
|
365
|
+
label: "Redo",
|
|
366
|
+
onPress: props.onRedo
|
|
367
|
+
})
|
|
368
|
+
]
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function FlowControl(props) {
|
|
372
|
+
const { theme } = useZoraTheme2();
|
|
373
|
+
return /* @__PURE__ */ jsx(Pressable, {
|
|
374
|
+
accessibilityLabel: props.label,
|
|
375
|
+
accessibilityRole: "button",
|
|
376
|
+
accessibilityState: { disabled: props.disabled },
|
|
377
|
+
disabled: props.disabled,
|
|
378
|
+
style: {
|
|
379
|
+
backgroundColor: props.disabled ? theme.semantics.neutral.surfaceHover : theme.semantics.neutral.surface,
|
|
380
|
+
borderColor: props.disabled ? theme.semantics.neutral.divider : theme.colors.primary,
|
|
381
|
+
borderRadius: 9,
|
|
382
|
+
borderWidth: 1,
|
|
383
|
+
justifyContent: "center",
|
|
384
|
+
minHeight: 44,
|
|
385
|
+
minWidth: 44,
|
|
386
|
+
paddingHorizontal: 10,
|
|
387
|
+
paddingVertical: 7
|
|
388
|
+
},
|
|
389
|
+
onPress: props.onPress,
|
|
390
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
391
|
+
style: {
|
|
392
|
+
color: props.disabled ? theme.semantics.neutral.textMuted : theme.colors.primary,
|
|
393
|
+
fontSize: 12,
|
|
394
|
+
fontWeight: "700"
|
|
395
|
+
},
|
|
396
|
+
children: props.label
|
|
397
|
+
})
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
var FlowEdges = React.memo(function FlowEdges(props) {
|
|
401
|
+
const { theme } = useZoraTheme2();
|
|
402
|
+
const { layer } = props;
|
|
403
|
+
const resolve = (address) => {
|
|
404
|
+
const node = props.nodes.get(address.nodeId);
|
|
405
|
+
if (!node)
|
|
406
|
+
return;
|
|
407
|
+
const deterministic = getDeterministicFlowPortAnchor(node, address);
|
|
408
|
+
if (!deterministic)
|
|
409
|
+
return;
|
|
410
|
+
const local = getFlowPortAnchor(props.anchors, address) ?? deterministic;
|
|
411
|
+
return {
|
|
412
|
+
x: layer.origin.x + (node.position.x + local.x) * layer.pixelsPerUnitX,
|
|
413
|
+
y: layer.origin.y + (node.position.y + local.y) * layer.pixelsPerUnitY
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
const edges = props.connections.map((connection) => ({
|
|
417
|
+
connection,
|
|
418
|
+
source: resolve(connection.source),
|
|
419
|
+
target: resolve(connection.target)
|
|
420
|
+
}));
|
|
421
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
422
|
+
children: [
|
|
423
|
+
/* @__PURE__ */ jsx(elements_web_default, {
|
|
424
|
+
height: layer.height,
|
|
425
|
+
pointerEvents: "none",
|
|
426
|
+
style: { left: 0, position: "absolute", top: 0 },
|
|
427
|
+
width: layer.width,
|
|
428
|
+
children: edges.map((edge) => /* @__PURE__ */ jsx(FlowEdgePath, {
|
|
429
|
+
source: edge.source,
|
|
430
|
+
stroke: theme.colors.primary,
|
|
431
|
+
target: edge.target,
|
|
432
|
+
testID: `flow-edge-${edge.connection.id}`
|
|
433
|
+
}, edge.connection.id))
|
|
434
|
+
}),
|
|
435
|
+
edges.map((edge) => /* @__PURE__ */ jsx(FlowEdgeControl, {
|
|
436
|
+
connection: edge.connection,
|
|
437
|
+
onDisconnect: props.onDisconnect,
|
|
438
|
+
readOnly: props.readOnly,
|
|
439
|
+
source: edge.source,
|
|
440
|
+
target: edge.target
|
|
441
|
+
}, edge.connection.id))
|
|
442
|
+
]
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
var FlowEdgePath = React.memo(function FlowEdgePath(props) {
|
|
446
|
+
if (!props.source || !props.target)
|
|
447
|
+
return null;
|
|
448
|
+
const controlDistance = Math.max(48, Math.abs(props.target.x - props.source.x) / 2);
|
|
449
|
+
return /* @__PURE__ */ jsx(Path, {
|
|
450
|
+
d: `M ${props.source.x} ${props.source.y} C ${props.source.x + controlDistance} ${props.source.y}, ${props.target.x - controlDistance} ${props.target.y}, ${props.target.x} ${props.target.y}`,
|
|
451
|
+
fill: "none",
|
|
452
|
+
stroke: props.stroke,
|
|
453
|
+
strokeWidth: 3,
|
|
454
|
+
testID: props.testID
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
var FlowEdgeControl = React.memo(function FlowEdgeControl(props) {
|
|
458
|
+
if (!props.source || !props.target)
|
|
459
|
+
return null;
|
|
460
|
+
return /* @__PURE__ */ jsx(Pressable, {
|
|
461
|
+
accessibilityHint: "Disconnect this flow connection",
|
|
462
|
+
accessibilityLabel: props.connection.label ?? `Connection ${props.connection.id}`,
|
|
463
|
+
accessibilityRole: "button",
|
|
464
|
+
accessibilityState: { disabled: props.readOnly },
|
|
465
|
+
disabled: props.readOnly,
|
|
466
|
+
style: {
|
|
467
|
+
height: 44,
|
|
468
|
+
left: (props.source.x + props.target.x) / 2 - 22,
|
|
469
|
+
position: "absolute",
|
|
470
|
+
top: (props.source.y + props.target.y) / 2 - 22,
|
|
471
|
+
width: 44,
|
|
472
|
+
zIndex: 1
|
|
473
|
+
},
|
|
474
|
+
onPress: () => props.onDisconnect?.(props.connection.id)
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
function FlowPalette(props) {
|
|
478
|
+
const { theme } = useZoraTheme2();
|
|
479
|
+
if (!props.items?.length)
|
|
480
|
+
return null;
|
|
481
|
+
return /* @__PURE__ */ jsx(View, {
|
|
482
|
+
accessibilityLabel: "Flow palette",
|
|
483
|
+
style: { backgroundColor: theme.colors.primary, gap: 8, padding: 12 },
|
|
484
|
+
children: props.items.map((item) => /* @__PURE__ */ jsxs(Pressable, {
|
|
485
|
+
accessibilityHint: "Insert this node",
|
|
486
|
+
accessibilityLabel: item.title,
|
|
487
|
+
accessibilityRole: "button",
|
|
488
|
+
accessibilityState: { disabled: props.readOnly || item.disabled },
|
|
489
|
+
disabled: props.readOnly || item.disabled,
|
|
490
|
+
style: {
|
|
491
|
+
backgroundColor: theme.semantics.neutral.surface,
|
|
492
|
+
borderRadius: 8,
|
|
493
|
+
justifyContent: "center",
|
|
494
|
+
minHeight: 44,
|
|
495
|
+
padding: 10
|
|
496
|
+
},
|
|
497
|
+
onPress: () => props.onInsert?.(item.id),
|
|
498
|
+
children: [
|
|
499
|
+
/* @__PURE__ */ jsx(Text, {
|
|
500
|
+
style: { color: theme.semantics.neutral.text, fontWeight: "700" },
|
|
501
|
+
children: item.title
|
|
502
|
+
}),
|
|
503
|
+
item.description ? /* @__PURE__ */ jsx(Text, {
|
|
504
|
+
style: { color: theme.semantics.neutral.textMuted },
|
|
505
|
+
children: item.description
|
|
506
|
+
}) : null
|
|
507
|
+
]
|
|
508
|
+
}, item.id))
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
export {
|
|
512
|
+
FlowCanvas
|
|
513
|
+
};
|