@ankhorage/zora 22.0.72 → 22.0.74
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 +13 -0
- package/README.md +1 -1
- package/dist/{features/authoring/allowedChildren.d.ts → constants/authoring.d.ts} +40 -1
- package/dist/constants/authoring.d.ts.map +1 -0
- package/dist/{features/authoring/allowedChildren.js → constants/authoring.js} +53 -1
- package/dist/constants/authoring.js.map +1 -0
- package/dist/features/accordion/accordionItemMeta.js +1 -1
- package/dist/features/accordion/accordionItemMeta.js.map +1 -1
- package/dist/features/accordion/accordionMeta.js.map +1 -1
- package/dist/features/activity-indicator/activityIndicatorMeta.js.map +1 -1
- package/dist/features/app-bar/appBarMeta.js.map +1 -1
- package/dist/features/auth/forgotPasswordFormMeta.js.map +1 -1
- package/dist/features/auth/oauthProviderButtonMeta.js.map +1 -1
- package/dist/features/auth/oauthProviderListMeta.js.map +1 -1
- package/dist/features/auth/otpFormMeta.js.map +1 -1
- package/dist/features/auth/signInFormMeta.js.map +1 -1
- package/dist/features/auth/signUpFormMeta.js.map +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.js +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.js.map +1 -1
- package/dist/features/breadcrumbs/breadcrumbsMeta.js.map +1 -1
- package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/Button.js +2 -1
- package/dist/features/button/adapters/inbound/Button.js.map +1 -1
- package/dist/features/button/buttonGroupMeta.js.map +1 -1
- package/dist/features/button/buttonMeta.js +1 -1
- package/dist/features/button/buttonMeta.js.map +1 -1
- package/dist/features/card/adapters/inbound/Card.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/Card.js +2 -1
- package/dist/features/card/adapters/inbound/Card.js.map +1 -1
- package/dist/features/card/cardMeta.js +2 -2
- package/dist/features/card/cardMeta.js.map +1 -1
- package/dist/features/card/mediaCardMeta.js +1 -1
- package/dist/features/card/mediaCardMeta.js.map +1 -1
- package/dist/features/card/postCardMeta.js +1 -1
- package/dist/features/card/postCardMeta.js.map +1 -1
- package/dist/features/card/productCardMeta.js.map +1 -1
- package/dist/features/chat/chatListItemMeta.js.map +1 -1
- package/dist/features/chat/messageBubbleMeta.js +1 -1
- package/dist/features/chat/messageBubbleMeta.js.map +1 -1
- package/dist/features/collection-editor/meta.js.map +1 -1
- package/dist/features/content-rail/contentRailMeta.js +1 -1
- package/dist/features/content-rail/contentRailMeta.js.map +1 -1
- package/dist/features/date-picker/datePickerMeta.js.map +1 -1
- package/dist/features/dialog/dialogMeta.js +1 -1
- package/dist/features/dialog/dialogMeta.js.map +1 -1
- package/dist/features/empty-state/emptyStateMeta.js.map +1 -1
- package/dist/features/form/checkbox/checkboxMeta.js.map +1 -1
- package/dist/features/form/field/meta.js.map +1 -1
- package/dist/features/form/formActionsMeta.js.map +1 -1
- package/dist/features/form/formErrorMeta.js.map +1 -1
- package/dist/features/form/formMeta.js.map +1 -1
- package/dist/features/form/radio/adapters/inbound/RadioGroup.d.ts.map +1 -1
- package/dist/features/form/radio/adapters/inbound/RadioGroup.js +2 -1
- package/dist/features/form/radio/adapters/inbound/RadioGroup.js.map +1 -1
- package/dist/features/form/radio/radioMeta.js.map +1 -1
- package/dist/features/form/select/selectMeta.js.map +1 -1
- package/dist/features/form/switch/switchMeta.js.map +1 -1
- package/dist/features/form/text-input/textInputMeta.js.map +1 -1
- package/dist/features/game/{adapters/inbound → utils}/measureGameEntity.d.ts +1 -1
- package/dist/features/game/utils/measureGameEntity.d.ts.map +1 -0
- package/dist/features/game/utils/measureGameEntity.js.map +1 -0
- package/dist/features/game/utils/useGameEntityMeasurement.js +1 -1
- package/dist/features/game/utils/useGameEntityMeasurement.js.map +1 -1
- package/dist/features/gradient/gradientMeta.js +1 -1
- package/dist/features/gradient/gradientMeta.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphNodeOverlay.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphNodeOverlay.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphNodeOverlay.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.d.ts +1 -96
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/fitGraphViewport.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/fitGraphViewport.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/fitGraphViewport.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/readGraphRenderedNodes.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/readGraphRenderedNodes.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/readGraphRenderedNodes.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runGraphLayout.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runGraphLayout.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runGraphLayout.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.js.map +1 -1
- package/dist/features/graph-view/public.d.ts +2 -1
- package/dist/features/graph-view/public.d.ts.map +1 -1
- package/dist/features/graph-view/public.js +1 -1
- package/dist/features/graph-view/public.js.map +1 -1
- package/dist/features/hero/heroMeta.js.map +1 -1
- package/dist/features/icon/iconMeta.js.map +1 -1
- package/dist/features/image/imageMeta.js.map +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.js +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.js.map +1 -1
- package/dist/features/layout/appShellMeta.js.map +1 -1
- package/dist/features/layout/gridMeta.js +1 -1
- package/dist/features/layout/gridMeta.js.map +1 -1
- package/dist/features/layout/screenMeta.js +1 -1
- package/dist/features/layout/screenMeta.js.map +1 -1
- package/dist/features/layout/scrollViewMeta.js +1 -1
- package/dist/features/layout/scrollViewMeta.js.map +1 -1
- package/dist/features/layout/viewMeta.js +1 -1
- package/dist/features/layout/viewMeta.js.map +1 -1
- package/dist/features/list/flatListMeta.js +1 -1
- package/dist/features/list/flatListMeta.js.map +1 -1
- package/dist/features/list/meta.js.map +1 -1
- package/dist/features/missing-element/missingElementMeta.js.map +1 -1
- package/dist/features/palette-item/paletteItemMeta.js.map +1 -1
- package/dist/features/popover-menu/popoverMenuMeta.js.map +1 -1
- package/dist/features/progress/progressMeta.js.map +1 -1
- package/dist/features/reader/meta.js +1 -1
- package/dist/features/reader/meta.js.map +1 -1
- package/dist/features/{authoring → registry}/bindableComponentMeta.d.ts.map +1 -1
- package/dist/features/registry/bindableComponentMeta.js.map +1 -0
- package/dist/features/registry/componentMeta.d.ts.map +1 -0
- package/dist/features/{authoring → registry}/componentMeta.js +1 -1
- package/dist/features/registry/componentMeta.js.map +1 -0
- package/dist/features/{authoring/utils → registry}/createManifestBindings.d.ts +1 -1
- package/dist/features/registry/createManifestBindings.d.ts.map +1 -0
- package/dist/features/registry/createManifestBindings.js.map +1 -0
- package/dist/features/{authoring/utils → registry}/finalizeFeatureMetadata.d.ts +1 -1
- package/dist/features/registry/finalizeFeatureMetadata.d.ts.map +1 -0
- package/dist/features/{authoring/utils → registry}/finalizeFeatureMetadata.js +1 -1
- package/dist/features/registry/finalizeFeatureMetadata.js.map +1 -0
- package/dist/features/{authoring → registry}/index.d.ts +1 -1
- package/dist/features/registry/index.d.ts.map +1 -0
- package/dist/features/{authoring → registry}/index.js +1 -1
- package/dist/features/registry/index.js.map +1 -0
- package/dist/features/registry/themeRecipeMeta.d.ts.map +1 -0
- package/dist/features/registry/themeRecipeMeta.js.map +1 -0
- package/dist/features/scanner/meta.js +1 -1
- package/dist/features/scanner/meta.js.map +1 -1
- package/dist/features/section/screenSectionMeta.js +1 -1
- package/dist/features/section/screenSectionMeta.js.map +1 -1
- package/dist/features/section/sectionHeaderMeta.js.map +1 -1
- package/dist/features/selection/meta.js.map +1 -1
- package/dist/features/skeleton/skeletonMeta.js.map +1 -1
- package/dist/features/surface/surfaceMeta.js +1 -1
- package/dist/features/surface/surfaceMeta.js.map +1 -1
- package/dist/features/tabs/tabPanelMeta.js +1 -1
- package/dist/features/tabs/tabPanelMeta.js.map +1 -1
- package/dist/features/theme/ThemeModeToggle.meta.js.map +1 -1
- package/dist/features/theme/composition/useZoraThemeRecipe.d.ts +3 -1
- package/dist/features/theme/composition/useZoraThemeRecipe.d.ts.map +1 -1
- package/dist/features/theme/composition/useZoraThemeRecipe.js +3 -2
- package/dist/features/theme/composition/useZoraThemeRecipe.js.map +1 -1
- package/dist/features/theme/utils/resolveZoraThemeRecipe.d.ts +3 -1
- package/dist/features/theme/utils/resolveZoraThemeRecipe.d.ts.map +1 -1
- package/dist/features/theme/utils/resolveZoraThemeRecipe.js +6 -6
- package/dist/features/theme/utils/resolveZoraThemeRecipe.js.map +1 -1
- package/dist/features/time-picker/timePickerMeta.js.map +1 -1
- package/dist/features/timeline/meta.js.map +1 -1
- package/dist/features/toast/toastMeta.js.map +1 -1
- package/dist/features/toast/toastProviderMeta.js.map +1 -1
- package/dist/features/tree-view/meta.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.js +2 -1
- package/dist/features/typography/adapters/inbound/Heading.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.js +2 -1
- package/dist/features/typography/adapters/inbound/Text.js.map +1 -1
- package/dist/features/typography/headingMeta.js +1 -1
- package/dist/features/typography/headingMeta.js.map +1 -1
- package/dist/features/typography/textMeta.js +1 -1
- package/dist/features/typography/textMeta.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/auth.js.map +1 -1
- package/dist/types/avatar-group.d.ts +1 -1
- package/dist/types/avatar-group.d.ts.map +1 -1
- package/dist/types/avatar-group.js.map +1 -1
- package/dist/types/button-group.d.ts +1 -1
- package/dist/types/button-group.d.ts.map +1 -1
- package/dist/types/button-group.js.map +1 -1
- package/dist/types/chat.d.ts +1 -1
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/chat.js.map +1 -1
- package/dist/types/gradient.d.ts +1 -1
- package/dist/types/gradient.d.ts.map +1 -1
- package/dist/types/gradient.js.map +1 -1
- package/dist/types/graph-view.d.ts +98 -0
- package/dist/types/graph-view.d.ts.map +1 -0
- package/dist/types/graph-view.js +2 -0
- package/dist/types/graph-view.js.map +1 -0
- package/dist/types/graphViewRuntime.d.ts +1 -1
- package/dist/types/graphViewRuntime.d.ts.map +1 -1
- package/dist/types/graphViewRuntime.js.map +1 -1
- package/dist/types/post-card.d.ts +1 -1
- package/dist/types/post-card.d.ts.map +1 -1
- package/dist/types/post-card.js.map +1 -1
- package/dist/types/radio.d.ts +1 -1
- package/dist/types/radio.d.ts.map +1 -1
- package/dist/types/radio.js.map +1 -1
- package/dist/types/scanner.d.ts +1 -1
- package/dist/types/scanner.d.ts.map +1 -1
- package/dist/types/scanner.js.map +1 -1
- package/dist/types/skeleton.d.ts +1 -1
- package/dist/types/skeleton.d.ts.map +1 -1
- package/dist/types/skeleton.js.map +1 -1
- package/dist/types/theme-mode-toggle.d.ts +1 -1
- package/dist/types/theme-mode-toggle.d.ts.map +1 -1
- package/dist/types/theme-mode-toggle.js.map +1 -1
- package/package.json +25 -25
- package/src/{features/authoring/allowedChildren.ts → constants/authoring.ts} +55 -0
- package/src/features/accordion/accordionItemMeta.ts +2 -2
- package/src/features/accordion/accordionMeta.ts +1 -1
- package/src/features/activity-indicator/activityIndicatorMeta.ts +1 -1
- package/src/features/app-bar/appBarMeta.ts +1 -1
- package/src/features/auth/forgotPasswordFormMeta.ts +1 -1
- package/src/features/auth/oauthProviderButtonMeta.ts +1 -1
- package/src/features/auth/oauthProviderListMeta.ts +1 -1
- package/src/features/auth/otpFormMeta.ts +1 -1
- package/src/features/auth/public.test.ts +21 -18
- package/src/features/auth/signInFormMeta.ts +1 -1
- package/src/features/auth/signUpFormMeta.ts +1 -1
- package/src/features/bottom-sheet/bottomSheetMeta.ts +1 -1
- package/src/features/breadcrumbs/breadcrumbsMeta.ts +1 -1
- package/src/features/button/adapters/inbound/Button.tsx +2 -1
- package/src/features/button/buttonGroupMeta.ts +1 -1
- package/src/features/button/buttonMeta.ts +2 -2
- package/src/features/card/adapters/inbound/Card.tsx +2 -1
- package/src/features/card/adapters/inbound/PostCard.test.tsx +4 -4
- package/src/features/card/adapters/inbound/ProductCard.test.tsx +9 -9
- package/src/features/card/cardMeta.ts +3 -3
- package/src/features/card/mediaCardMeta.ts +1 -1
- package/src/features/card/postCardMeta.ts +2 -2
- package/src/features/card/productCardMeta.ts +1 -1
- package/src/features/chat/adapters/inbound/ChatListItem.test.tsx +4 -4
- package/src/features/chat/chatListItemMeta.ts +1 -1
- package/src/features/chat/messageBubbleMeta.ts +2 -2
- package/src/features/collection-editor/meta.ts +1 -1
- package/src/features/content-rail/contentRailMeta.ts +2 -2
- package/src/features/date-picker/datePickerMeta.ts +1 -1
- package/src/features/date-picker/public.test.ts +4 -6
- package/src/features/dialog/dialogMeta.ts +1 -1
- package/src/features/empty-state/emptyStateMeta.ts +1 -1
- package/src/features/form/checkbox/checkboxMeta.ts +1 -1
- package/src/features/form/field/meta.ts +1 -1
- package/src/features/form/formActionsMeta.ts +1 -1
- package/src/features/form/formErrorMeta.ts +1 -1
- package/src/features/form/formMeta.ts +1 -1
- package/src/features/form/radio/adapters/inbound/RadioGroup.tsx +2 -1
- package/src/features/form/radio/radioMeta.ts +1 -1
- package/src/features/form/select/selectMeta.ts +1 -1
- package/src/features/form/switch/switchMeta.ts +1 -1
- package/src/features/form/text-input/textInputMeta.ts +1 -1
- package/src/features/game/{adapters/inbound → utils}/measureGameEntity.ts +1 -1
- package/src/features/game/utils/useGameEntityMeasurement.ts +1 -1
- package/src/features/gradient/gradientMeta.ts +2 -2
- package/src/features/gradient/public.test.ts +4 -6
- package/src/features/graph-view/adapters/inbound/web-artifact/GraphNodeOverlay.tsx +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx +6 -116
- package/src/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.test.ts +2 -2
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +8 -8
- package/src/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.test.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/fitGraphViewport.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/readGraphRenderedNodes.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/runGraphLayout.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.ts +1 -1
- package/src/features/graph-view/public.ts +18 -18
- package/src/features/hero/heroMeta.ts +1 -1
- package/src/features/icon/iconMeta.ts +1 -1
- package/src/features/icon/utils/meta.test.ts +8 -17
- package/src/features/image/imageMeta.ts +1 -1
- package/src/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.ts +1 -1
- package/src/features/layout/appShellMeta.ts +1 -1
- package/src/features/layout/gridMeta.ts +2 -2
- package/src/features/layout/screenMeta.ts +2 -2
- package/src/features/layout/scrollViewMeta.ts +1 -1
- package/src/features/layout/viewMeta.ts +2 -2
- package/src/features/list/flatListMeta.ts +1 -1
- package/src/features/list/meta.ts +1 -1
- package/src/features/missing-element/MissingElement.test.ts +7 -6
- package/src/features/missing-element/missingElementMeta.ts +1 -1
- package/src/features/palette-item/paletteItemMeta.ts +1 -1
- package/src/features/popover-menu/popoverMenuMeta.ts +1 -1
- package/src/features/progress/progressMeta.ts +1 -1
- package/src/features/reader/meta.ts +2 -2
- package/src/features/{authoring → registry}/componentMeta.ts +1 -1
- package/src/features/{authoring/utils → registry}/createManifestBindings.ts +1 -1
- package/src/features/{authoring → registry}/featureManifest.test.ts +1 -1
- package/src/features/{authoring/utils → registry}/finalizeFeatureMetadata.ts +2 -2
- package/src/features/{authoring → registry}/index.ts +1 -1
- package/src/features/scanner/meta.ts +2 -2
- package/src/features/section/screenSectionMeta.ts +2 -2
- package/src/features/section/sectionHeaderMeta.ts +1 -1
- package/src/features/selection/meta.ts +1 -1
- package/src/features/skeleton/public.test.ts +6 -6
- package/src/features/skeleton/skeletonMeta.ts +1 -1
- package/src/features/surface/surfaceMeta.ts +1 -1
- package/src/features/tabs/tabPanelMeta.ts +1 -1
- package/src/features/theme/ThemeModeToggle.meta.ts +1 -1
- package/src/features/theme/composition/useZoraThemeRecipe.ts +4 -2
- package/src/features/theme/utils/resolveZoraThemeRecipe.test.ts +45 -8
- package/src/features/theme/utils/resolveZoraThemeRecipe.ts +11 -8
- package/src/features/time-picker/public.test.ts +4 -6
- package/src/features/time-picker/timePickerMeta.ts +1 -1
- package/src/features/timeline/meta.ts +1 -1
- package/src/features/toast/public.test.ts +4 -3
- package/src/features/toast/toastMeta.ts +1 -1
- package/src/features/toast/toastProviderMeta.ts +1 -1
- package/src/features/tree-view/meta.ts +1 -1
- package/src/features/typography/adapters/inbound/Heading.tsx +2 -1
- package/src/features/typography/adapters/inbound/Text.tsx +2 -1
- package/src/features/typography/headingMeta.ts +2 -2
- package/src/features/typography/textMeta.ts +2 -2
- package/src/features/uploader/public.test.ts +1 -1
- package/src/index.ts +33 -33
- package/src/structureOwnership.test.ts +3 -3
- package/src/types/auth.ts +1 -1
- package/src/types/avatar-group.ts +1 -1
- package/src/types/button-group.ts +1 -1
- package/src/types/chat.ts +1 -1
- package/src/types/gradient.ts +1 -1
- package/src/types/graph-view.ts +117 -0
- package/src/types/graphViewRuntime.ts +1 -1
- package/src/types/post-card.ts +1 -1
- package/src/types/radio.ts +1 -1
- package/src/types/scanner.ts +1 -1
- package/src/types/skeleton.ts +1 -1
- package/src/types/theme-mode-toggle.ts +1 -1
- package/web-dist/chunks/{Accordion-jd33dw92.js → Accordion-07rdw2vh.js} +1 -1
- package/web-dist/chunks/{Accordion-sn80af3k.js → Accordion-45ej9brb.js} +1 -1
- package/web-dist/chunks/{Accordion-qyckg9d2.js → Accordion-555gnfmw.js} +3 -3
- package/web-dist/chunks/{Accordion-ypdtx57y.js → Accordion-73m7z73v.js} +3 -3
- package/web-dist/chunks/{Accordion-s334j5tf.js → Accordion-8af800ts.js} +2 -2
- package/web-dist/chunks/{Accordion-7ycn5332.js → Accordion-9rnepkvk.js} +1 -1
- package/web-dist/chunks/{Accordion-1vbm971q.js → Accordion-avmgvcef.js} +1 -1
- package/web-dist/chunks/{Accordion-a03xpbc0.js → Accordion-b3qy1trj.js} +39 -7
- package/web-dist/chunks/Accordion-e1nn8m46.js +82 -0
- package/web-dist/chunks/{Accordion-eps4ej1m.js → Accordion-emczc5rg.js} +33 -5
- package/web-dist/chunks/{Accordion-wzybs1e3.js → Accordion-jhwsvx3g.js} +1 -1
- package/web-dist/chunks/{Accordion-qy22k9t8.js → Accordion-jj3bg8c1.js} +1 -1
- package/web-dist/chunks/{Accordion-nn80tt99.js → Accordion-mpnb4qqw.js} +2 -2
- package/web-dist/chunks/{Accordion-z5rdysmt.js → Accordion-nc5gnvnb.js} +33 -4
- package/web-dist/chunks/{Accordion-qkrwkab6.js → Accordion-nn38n7q4.js} +1 -1
- package/web-dist/chunks/{Accordion-zh8esf04.js → Accordion-pnvt10cv.js} +2 -2
- package/web-dist/chunks/{Accordion-4prv90j4.js → Accordion-qvt6qdqm.js} +1 -1
- package/web-dist/chunks/{Accordion-hk6zs4dc.js → Accordion-tj61sa5s.js} +2 -2
- package/web-dist/chunks/{Accordion-5r2dxq03.js → Accordion-v1dtv6v0.js} +1 -1
- package/web-dist/chunks/{Accordion-5t5sw5cp.js → Accordion-vmz8y01b.js} +4 -4
- package/web-dist/chunks/{Accordion-pssgp0pq.js → Accordion-ycmg06sq.js} +71 -4
- package/web-dist/chunks/{Accordion-h62mzp3n.js → Accordion-yz7b7njb.js} +2 -2
- package/web-dist/chunks/{Accordion-2ga47602.js → Accordion-zf3kzvef.js} +1 -1
- package/web-dist/components/accordion/Accordion.js +3 -3
- package/web-dist/components/accordion-item/AccordionItem.js +3 -3
- package/web-dist/components/app-bar/AppBar.js +4 -4
- package/web-dist/components/avatar/Avatar.js +3 -3
- package/web-dist/components/avatar-group/AvatarGroup.js +3 -3
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +6 -6
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +3 -3
- package/web-dist/components/button/Button.js +2 -2
- package/web-dist/components/button-group/ButtonGroup.js +2 -2
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +6 -6
- package/web-dist/components/card/Card.js +5 -5
- package/web-dist/components/chat-list-item/ChatListItem.js +4 -4
- package/web-dist/components/checkbox/Checkbox.js +3 -3
- package/web-dist/components/checkbox-group/CheckboxGroup.js +3 -3
- package/web-dist/components/chip/Chip.js +3 -3
- package/web-dist/components/chip-group/ChipGroup.js +3 -3
- package/web-dist/components/collection-editor/CollectionEditor.js +5 -5
- package/web-dist/components/content-rail/ContentRail.js +3 -3
- package/web-dist/components/data-table/DataTable.js +9 -9
- package/web-dist/components/date-picker/DatePicker.js +3 -3
- package/web-dist/components/dialog/Dialog.js +3 -3
- package/web-dist/components/empty-state/EmptyState.js +6 -6
- package/web-dist/components/field/Field.js +3 -3
- package/web-dist/components/flat-list/FlatList.js +4 -4
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +7 -7
- package/web-dist/components/form/Form.js +5 -5
- package/web-dist/components/form-actions/FormActions.js +5 -5
- package/web-dist/components/form-error/FormError.js +5 -5
- package/web-dist/components/game/Game.js +1 -1
- package/web-dist/components/game-entity/GameEntity.js +1 -1
- package/web-dist/components/game-field/GameField.js +1 -1
- package/web-dist/components/game-input-zone/GameInputZone.js +1 -1
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +1 -1
- package/web-dist/components/game-overlay/GameOverlay.js +1 -1
- package/web-dist/components/graph-view/GraphView.d.ts +1 -96
- package/web-dist/components/heading/Heading.js +2 -2
- package/web-dist/components/hero/Hero.js +5 -5
- package/web-dist/components/icon-button/IconButton.js +2 -2
- package/web-dist/components/list/List.js +4 -4
- package/web-dist/components/list-item/ListItem.js +4 -4
- package/web-dist/components/list-section/ListSection.js +4 -4
- package/web-dist/components/media-card/MediaCard.js +5 -5
- package/web-dist/components/message-bubble/MessageBubble.js +4 -4
- package/web-dist/components/metric-card/MetricCard.js +5 -5
- package/web-dist/components/missing-element/MissingElement.js +2 -2
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +7 -7
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +7 -7
- package/web-dist/components/otp-form/OtpForm.js +7 -7
- package/web-dist/components/pagination/Pagination.js +3 -3
- package/web-dist/components/palette-item/PaletteItem.js +5 -5
- package/web-dist/components/post-card/PostCard.js +5 -5
- package/web-dist/components/product-card/ProductCard.js +5 -5
- package/web-dist/components/progress/Progress.js +3 -3
- package/web-dist/components/progress-ring/ProgressRing.js +3 -3
- package/web-dist/components/radio/Radio.js +3 -3
- package/web-dist/components/radio-group/RadioGroup.js +3 -3
- package/web-dist/components/reader-surface/ReaderSurface.js +5 -5
- package/web-dist/components/scan-overlay/ScanOverlay.js +6 -6
- package/web-dist/components/screen-section/ScreenSection.js +3 -3
- package/web-dist/components/search-input/SearchInput.js +3 -3
- package/web-dist/components/section-header/SectionHeader.js +3 -3
- package/web-dist/components/section-list/SectionList.js +4 -4
- package/web-dist/components/select/Select.js +2 -2
- package/web-dist/components/sign-in-form/SignInForm.js +7 -7
- package/web-dist/components/sign-up-form/SignUpForm.js +7 -7
- package/web-dist/components/skeleton/Skeleton.js +8 -8
- package/web-dist/components/skeleton-card/SkeletonCard.js +8 -8
- package/web-dist/components/skeleton-list/SkeletonList.js +8 -8
- package/web-dist/components/skeleton-text/SkeletonText.js +8 -8
- package/web-dist/components/text/Text.js +2 -2
- package/web-dist/components/text-input/TextInput.js +3 -3
- package/web-dist/components/time-picker/TimePicker.js +3 -3
- package/web-dist/components/timeline/Timeline.js +2 -2
- package/web-dist/components/toolbar/Toolbar.js +5 -5
- package/web-dist/components/tree-item/TreeItem.js +5 -5
- package/web-dist/components/uploader/Uploader.js +7 -7
- package/web-dist/manifest.json +354 -354
- package/dist/features/authoring/allowedChildren.d.ts.map +0 -1
- package/dist/features/authoring/allowedChildren.js.map +0 -1
- package/dist/features/authoring/bindableComponentMeta.js.map +0 -1
- package/dist/features/authoring/componentMeta.d.ts.map +0 -1
- package/dist/features/authoring/componentMeta.js.map +0 -1
- package/dist/features/authoring/constants.d.ts +0 -40
- package/dist/features/authoring/constants.d.ts.map +0 -1
- package/dist/features/authoring/constants.js +0 -53
- package/dist/features/authoring/constants.js.map +0 -1
- package/dist/features/authoring/index.d.ts.map +0 -1
- package/dist/features/authoring/index.js.map +0 -1
- package/dist/features/authoring/themeRecipeMeta.d.ts.map +0 -1
- package/dist/features/authoring/themeRecipeMeta.js.map +0 -1
- package/dist/features/authoring/utils/createManifestBindings.d.ts.map +0 -1
- package/dist/features/authoring/utils/createManifestBindings.js.map +0 -1
- package/dist/features/authoring/utils/finalizeFeatureMetadata.d.ts.map +0 -1
- package/dist/features/authoring/utils/finalizeFeatureMetadata.js.map +0 -1
- package/dist/features/game/adapters/inbound/measureGameEntity.d.ts.map +0 -1
- package/dist/features/game/adapters/inbound/measureGameEntity.js.map +0 -1
- package/src/features/authoring/constants.ts +0 -56
- package/web-dist/chunks/Accordion-wvphg9x4.js +0 -246
- /package/dist/features/game/{adapters/inbound → utils}/measureGameEntity.js +0 -0
- /package/dist/features/{authoring → registry}/bindableComponentMeta.d.ts +0 -0
- /package/dist/features/{authoring → registry}/bindableComponentMeta.js +0 -0
- /package/dist/features/{authoring → registry}/componentMeta.d.ts +0 -0
- /package/dist/features/{authoring/utils → registry}/createManifestBindings.js +0 -0
- /package/dist/features/{authoring → registry}/themeRecipeMeta.d.ts +0 -0
- /package/dist/features/{authoring → registry}/themeRecipeMeta.js +0 -0
- /package/src/features/{authoring → registry}/authoringMeta.test.ts +0 -0
- /package/src/features/{authoring → registry}/bindableComponentMeta.test.ts +0 -0
- /package/src/features/{authoring → registry}/bindableComponentMeta.ts +0 -0
- /package/src/features/{authoring → registry}/componentMeta.test.ts +0 -0
- /package/src/features/{authoring → registry}/radioGroupReachability.test.ts +0 -0
- /package/src/features/{authoring → registry}/themeRecipeMeta.test.ts +0 -0
- /package/src/features/{authoring → registry}/themeRecipeMeta.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGameEntityMeasurement.js","sourceRoot":"","sources":["../../../../src/features/game/utils/useGameEntityMeasurement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useGameEntityMeasurement.js","sourceRoot":"","sources":["../../../../src/features/game/utils/useGameEntityMeasurement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qFAAqF;AACrF,MAAM,UAAU,wBAAwB,CACtC,UAAwC,EACxC,aAAiC;IAEjC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IACrD,MAAM,mBAAmB,GAAG,OAAO,EAAE,mBAAmB,CAAC;IAEzD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,aAAa,KAAK,SAAS,IAAI,mBAAmB,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QACvF,OAAO,mBAAmB,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IACzF,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC;AACvD,CAAC","sourcesContent":["import React from 'react';\nimport type { View } from 'react-native';\n\nimport { GameRuntimeContext } from '../composition/GameRuntimeContext';\nimport { measureGameEntity } from './measureGameEntity';\n\n/*** Register one optional measurable GameEntity view inside its local Game scope. */\nexport function useGameEntityMeasurement(\n elementRef: React.RefObject<View | null>,\n measurementId: string | undefined,\n): void {\n const runtime = React.useContext(GameRuntimeContext);\n const registerMeasurement = runtime?.registerMeasurement;\n\n React.useEffect(() => {\n if (measurementId === undefined || registerMeasurement === undefined) return undefined;\n return registerMeasurement(measurementId, () => measureGameEntity(elementRef.current));\n }, [elementRef, measurementId, registerMeasurement]);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradientMeta.js","sourceRoot":"","sources":["../../../src/features/gradient/gradientMeta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gradientMeta.js","sourceRoot":"","sources":["../../../src/features/gradient/gradientMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAGvE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,uEAAuE;IACpF,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,GAAG,0BAA0B,CAAC;IAChD,SAAS,EAAE;QACT,KAAK,EAAE,UAAU;KAClB;IACD,KAAK,EAAE;QACL,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,QAAQ;SAChB;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE;QACnE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;QAC7D,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC/D,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE;QAC1E,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE;QACrE,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;KAC7D;CACmC,CAAC","sourcesContent":["import { CONTAINER_ALLOWED_CHILDREN } from '../../constants/authoring';\nimport type { ZoraComponentMeta } from '../../types/authoring';\n\nexport const gradientMeta = {\n name: 'Gradient',\n category: 'component',\n description: 'Renders a host-backed gradient container for nested manifest content.',\n directManifestNode: true,\n allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],\n blueprint: {\n label: 'Gradient',\n },\n props: {\n colors: {\n type: 'array',\n category: 'Style',\n label: 'Colors',\n },\n locations: { type: 'array', category: 'Style', label: 'Locations' },\n width: { type: 'number', category: 'Layout', label: 'Width' },\n height: { type: 'number', category: 'Layout', label: 'Height' },\n minHeight: { type: 'number', category: 'Layout', label: 'Minimum height' },\n radius: { type: 'radius', category: 'Style', label: 'Corner radius' },\n p: { type: 'spacing', category: 'Layout', label: 'Padding' },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { GraphViewElementEventType, GraphViewNode, GraphViewNodeRenderContext, GraphViewRenderedNode, GraphViewSize } from '
|
|
2
|
+
import type { GraphViewElementEventType, GraphViewNode, GraphViewNodeRenderContext, GraphViewRenderedNode, GraphViewSize } from '../../../../../types/graph-view';
|
|
3
3
|
interface GraphNodeOverlayProps {
|
|
4
4
|
readonly nodes: readonly GraphViewNode[];
|
|
5
5
|
readonly renderedNodes: readonly GraphViewRenderedNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphNodeOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphNodeOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EACV,yBAAyB,EACzB,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACrB,aAAa,EACd,MAAM,
|
|
1
|
+
{"version":3,"file":"GraphNodeOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphNodeOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EACV,yBAAyB,EACzB,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACrB,aAAa,EACd,MAAM,iCAAiC,CAAC;AAEzC,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC,QAAQ,CAAC,aAAa,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACzD,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,KAAK,CAAC,SAAS,CAAC;IAC9E,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAC5E,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAChE;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAgC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphNodeOverlay.js","sourceRoot":"","sources":["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ewNodeRenderContext,\n GraphViewRenderedNode,\n GraphViewSize,\n} from '
|
|
1
|
+
{"version":3,"file":"GraphNodeOverlay.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphNodeOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,mGAAmG;AACnG,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAC7B,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAU,CAAC,CAAC,EAClE,CAAC,KAAK,CAAC,KAAK,CAAC,CACd,CAAC;IAEF,OAAO,CACL,CAAC,GAAG,CACF,WAAW,CACX,KAAK,CAAC,CAAC;YACL,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,QAAQ;YAClB,aAAa,EAAE,MAAM;YACrB,QAAQ,EAAE,UAAU;SACrB,CAAC,CAEF;MAAA,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;YACxC,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YAC5C,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC;YACvB,OAAO,CACL,CAAC,iBAAiB,CAChB,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACb,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,UAAU,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAC7B,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,UAAU,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAC7B,CACH,CAAC;QACJ,CAAC,CAAC,CAC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O,QAAQ,IAAI,IAAI,CAAC;AAC1B,CAAC","sourcesContent":["import React from 'react';\n\nimport type {\n GraphViewElementEventType,\n GraphViewNode,\n GraphViewNodeRenderContext,\n GraphViewRenderedNode,\n GraphViewSize,\n} from '../../../../../types/graph-view';\n\ninterface GraphNodeOverlayProps {\n readonly nodes: readonly GraphViewNode[];\n readonly renderedNodes: readonly GraphViewRenderedNode[];\n readonly renderNode: (context: GraphViewNodeRenderContext) => React.ReactNode;\n readonly onNodeEvent: (id: string, type: GraphViewElementEventType) => void;\n readonly onNodeSize: (id: string, size: GraphViewSize) => void;\n}\n\n/*** Render optional React node content above Cytoscape at its authoritative rendered positions. */\nexport function GraphNodeOverlay(props: GraphNodeOverlayProps) {\n const nodesById = React.useMemo(\n () => new Map(props.nodes.map((node) => [node.id, node] as const)),\n [props.nodes],\n );\n\n return (\n <div\n aria-hidden\n style={{\n inset: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n }}\n >\n {props.renderedNodes.map((renderedNode) => {\n const node = nodesById.get(renderedNode.id);\n if (!node) return null;\n return (\n <MeasuredGraphNode\n key={node.id}\n node={node}\n renderedNode={renderedNode}\n renderNode={props.renderNode}\n onNodeEvent={props.onNodeEvent}\n onNodeSize={props.onNodeSize}\n />\n );\n })}\n </div>\n );\n}\n\ninterface MeasuredGraphNodeProps {\n readonly node: GraphViewNode;\n readonly renderedNode: GraphViewRenderedNode;\n readonly renderNode: GraphNodeOverlayProps['renderNode'];\n readonly onNodeEvent: GraphNodeOverlayProps['onNodeEvent'];\n readonly onNodeSize: GraphNodeOverlayProps['onNodeSize'];\n}\n\n/*** Measure one rich node at model scale and translate its DOM interactions into graph events. */\nfunction MeasuredGraphNode(props: MeasuredGraphNodeProps) {\n const elementRef = React.useRef<HTMLDivElement | null>(null);\n const { node, onNodeSize, renderedNode } = props;\n\n React.useLayoutEffect(() => {\n const element = elementRef.current;\n if (element === null) return;\n reportElementSize(element, node.id, onNodeSize);\n\n const Observer = readResizeObserverConstructor();\n if (Observer === null) return;\n const observer = new Observer(() => reportElementSize(element, node.id, onNodeSize));\n observer.observe(element);\n return () => observer.disconnect();\n }, [node.id, onNodeSize]);\n\n return (\n <div\n ref={(element) => {\n elementRef.current = element;\n }}\n style={{\n left: renderedNode.position.x,\n pointerEvents: 'auto',\n position: 'absolute',\n top: renderedNode.position.y,\n transform: `translate(-50%, -50%) scale(${renderedNode.zoom})`,\n transformOrigin: 'center',\n }}\n onClick={() => props.onNodeEvent(node.id, 'press')}\n onDoubleClick={() => props.onNodeEvent(node.id, 'double-press')}\n onMouseEnter={() => props.onNodeEvent(node.id, 'pointer-enter')}\n onMouseLeave={() => props.onNodeEvent(node.id, 'pointer-leave')}\n >\n {props.renderNode({\n hovered: renderedNode.hovered,\n node,\n selected: renderedNode.selected,\n zoom: renderedNode.zoom,\n })}\n </div>\n );\n}\n\n/*** Report unscaled DOM dimensions only when a measurable node has positive size. */\nfunction reportElementSize(\n element: unknown,\n nodeId: string,\n onNodeSize: (id: string, size: GraphViewSize) => void,\n) {\n const measured = element as {\n readonly offsetHeight?: unknown;\n readonly offsetWidth?: unknown;\n };\n if (typeof measured.offsetWidth !== 'number' || typeof measured.offsetHeight !== 'number') return;\n if (measured.offsetWidth <= 0 || measured.offsetHeight <= 0) return;\n onNodeSize(nodeId, {\n width: measured.offsetWidth,\n height: measured.offsetHeight,\n });\n}\n\n/*** Read ResizeObserver without requiring the DOM lib in the package TypeScript target. */\nfunction readResizeObserverConstructor(): ResizeObserverConstructorLike | null {\n const observer = (\n globalThis as unknown as {\n ResizeObserver?: ResizeObserverConstructorLike;\n }\n ).ResizeObserver;\n return observer ?? null;\n}\n\ninterface ResizeObserverLike {\n disconnect(): void;\n observe(target: unknown): void;\n}\n\ntype ResizeObserverConstructorLike = new (callback: () => void) => ResizeObserverLike;\n"]}
|
|
@@ -1,100 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export type GraphViewElementEventType = 'press' | 'double-press' | 'select' | 'unselect' | 'pointer-enter' | 'pointer-leave';
|
|
4
|
-
export interface GraphViewNode {
|
|
5
|
-
readonly id: string;
|
|
6
|
-
readonly label?: string;
|
|
7
|
-
readonly parentId?: string;
|
|
8
|
-
readonly classes?: string;
|
|
9
|
-
readonly data?: Readonly<Record<string, unknown>>;
|
|
10
|
-
}
|
|
11
|
-
export interface GraphViewEdge {
|
|
12
|
-
readonly id?: string;
|
|
13
|
-
readonly source: string;
|
|
14
|
-
readonly target: string;
|
|
15
|
-
readonly classes?: string;
|
|
16
|
-
readonly data?: Readonly<Record<string, unknown>>;
|
|
17
|
-
}
|
|
18
|
-
export interface GraphViewStyleRule {
|
|
19
|
-
readonly selector: string;
|
|
20
|
-
readonly style: Readonly<Record<string, unknown>>;
|
|
21
|
-
}
|
|
22
|
-
export interface GraphViewPoint {
|
|
23
|
-
readonly x: number;
|
|
24
|
-
readonly y: number;
|
|
25
|
-
}
|
|
26
|
-
export interface GraphViewSize {
|
|
27
|
-
readonly width: number;
|
|
28
|
-
readonly height: number;
|
|
29
|
-
}
|
|
30
|
-
export interface GraphViewNodeRenderContext {
|
|
31
|
-
readonly hovered: boolean;
|
|
32
|
-
readonly node: GraphViewNode;
|
|
33
|
-
readonly selected: boolean;
|
|
34
|
-
readonly zoom: number;
|
|
35
|
-
}
|
|
36
|
-
export interface GraphViewRenderedNode {
|
|
37
|
-
readonly hovered: boolean;
|
|
38
|
-
readonly id: string;
|
|
39
|
-
readonly position: GraphViewPoint;
|
|
40
|
-
readonly selected: boolean;
|
|
41
|
-
readonly zoom: number;
|
|
42
|
-
}
|
|
43
|
-
export interface GraphViewViewport {
|
|
44
|
-
readonly zoom: number;
|
|
45
|
-
readonly pan: GraphViewPoint;
|
|
46
|
-
}
|
|
47
|
-
export interface GraphViewFitOptions {
|
|
48
|
-
/** Optimize existing layout spacing without rerunning its algorithm; whole-graph fits only. */
|
|
49
|
-
readonly optimizeSpacing?: boolean;
|
|
50
|
-
readonly nodeIds?: readonly string[];
|
|
51
|
-
readonly padding?: number;
|
|
52
|
-
}
|
|
53
|
-
export interface GraphViewElementEvent {
|
|
54
|
-
readonly id: string;
|
|
55
|
-
readonly type: GraphViewElementEventType;
|
|
56
|
-
}
|
|
57
|
-
export interface GraphViewController {
|
|
58
|
-
fit(options?: GraphViewFitOptions): void;
|
|
59
|
-
getViewport(): GraphViewViewport;
|
|
60
|
-
getZoomRange(): {
|
|
61
|
-
readonly min: number;
|
|
62
|
-
readonly max: number;
|
|
63
|
-
};
|
|
64
|
-
setPan(pan: GraphViewPoint): void;
|
|
65
|
-
setZoom(zoom: number): void;
|
|
66
|
-
zoomBy(factor: number): void;
|
|
67
|
-
}
|
|
68
|
-
export interface GraphViewProps {
|
|
69
|
-
readonly nodes: readonly GraphViewNode[];
|
|
70
|
-
readonly edges: readonly GraphViewEdge[];
|
|
71
|
-
readonly layout?: GraphViewLayoutName;
|
|
72
|
-
readonly layoutOptions?: Readonly<Record<string, unknown>>;
|
|
73
|
-
readonly spacingFactor?: number;
|
|
74
|
-
readonly styleRules?: readonly GraphViewStyleRule[];
|
|
75
|
-
readonly selectedNodeIds?: readonly string[];
|
|
76
|
-
readonly renderNode?: (context: GraphViewNodeRenderContext) => React.ReactNode;
|
|
77
|
-
readonly getNodeSize?: (node: GraphViewNode) => GraphViewSize | undefined;
|
|
78
|
-
readonly fitPadding?: number;
|
|
79
|
-
readonly minZoom?: number;
|
|
80
|
-
readonly maxZoom?: number;
|
|
81
|
-
readonly minReadableLabelSize?: number;
|
|
82
|
-
readonly maxFitLabelSize?: number;
|
|
83
|
-
/** Zoom values and bounds use the full-node fit as 1 when fit-relative is selected. */
|
|
84
|
-
readonly zoomMode?: 'absolute' | 'fit-relative';
|
|
85
|
-
/** Measure plain labels before layout instead of estimating width from character count. */
|
|
86
|
-
readonly sizeNodesToLabels?: boolean;
|
|
87
|
-
readonly className?: string;
|
|
88
|
-
readonly style?: React.CSSProperties;
|
|
89
|
-
readonly ariaLabel?: string;
|
|
90
|
-
readonly onReady?: (controller: GraphViewController) => void;
|
|
91
|
-
readonly onLayoutComplete?: (controller: GraphViewController) => void;
|
|
92
|
-
readonly onNodeEvent?: (event: GraphViewElementEvent) => void;
|
|
93
|
-
readonly onEdgeEvent?: (event: GraphViewElementEvent) => void;
|
|
94
|
-
readonly onViewportChange?: (viewport: GraphViewViewport) => void;
|
|
95
|
-
readonly onSpacingFactorChange?: (spacingFactor: number) => void;
|
|
96
|
-
}
|
|
97
|
-
export type GraphViewCallbacks = Pick<GraphViewProps, 'onEdgeEvent' | 'onLayoutComplete' | 'onNodeEvent' | 'onReady' | 'onViewportChange' | 'onSpacingFactorChange'>;
|
|
2
|
+
import type { GraphViewProps } from '../../../../../types/graph-view';
|
|
98
3
|
/***
|
|
99
4
|
* Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.
|
|
100
5
|
* zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphView.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GraphView.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,iCAAiC,CAAC;AAMzC;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBA6B9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphView.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAqB,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AAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,uEAAuE;AACvE,SAAS,aAAa,CAAC,KAAqB;IAC1C,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;KACnD,CAAC;AACJ,CAAC","sourcesContent":["import type { CytoscapeOptions } from 'cytoscape';\nimport React from 'react';\n\nimport { createGraphRuntime, type GraphRuntime } from './createGraphRuntime';\nimport { GraphNodeOverlay } from './GraphNodeOverlay';\n\nexport type GraphViewLayoutName = 'breadthfirst' | 'circle' | 'concentric' | 'elk' | 'grid';\nexport type GraphViewElementEventType =\n 'press' | 'double-press' | 'select' | 'unselect' | 'pointer-enter' | 'pointer-leave';\n\nexport interface GraphViewNode {\n readonly id: string;\n readonly label?: string;\n readonly parentId?: string;\n readonly classes?: string;\n readonly data?: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewEdge {\n readonly id?: string;\n readonly source: string;\n readonly target: string;\n readonly classes?: string;\n readonly data?: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewStyleRule {\n readonly selector: string;\n readonly style: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport interface GraphViewSize {\n readonly width: number;\n readonly height: number;\n}\n\nexport interface GraphViewNodeRenderContext {\n readonly hovered: boolean;\n readonly node: GraphViewNode;\n readonly selected: boolean;\n readonly zoom: number;\n}\n\nexport interface GraphViewRenderedNode {\n readonly hovered: boolean;\n readonly id: string;\n readonly position: GraphViewPoint;\n readonly selected: boolean;\n readonly zoom: number;\n}\n\nexport interface GraphViewViewport {\n readonly zoom: number;\n readonly pan: GraphViewPoint;\n}\n\nexport interface GraphViewFitOptions {\n /** Optimize existing layout spacing without rerunning its algorithm; whole-graph fits only. */\n readonly optimizeSpacing?: boolean;\n readonly nodeIds?: readonly string[];\n readonly padding?: number;\n}\n\nexport interface GraphViewElementEvent {\n readonly id: string;\n readonly type: GraphViewElementEventType;\n}\n\nexport interface GraphViewController {\n fit(options?: GraphViewFitOptions): void;\n getViewport(): GraphViewViewport;\n getZoomRange(): { readonly min: number; readonly max: number };\n setPan(pan: GraphViewPoint): void;\n setZoom(zoom: number): void;\n zoomBy(factor: number): void;\n}\n\nexport interface GraphViewProps {\n readonly nodes: readonly GraphViewNode[];\n readonly edges: readonly GraphViewEdge[];\n readonly layout?: GraphViewLayoutName;\n readonly layoutOptions?: Readonly<Record<string, unknown>>;\n readonly spacingFactor?: number;\n readonly styleRules?: readonly GraphViewStyleRule[];\n readonly selectedNodeIds?: readonly string[];\n readonly renderNode?: (context: GraphViewNodeRenderContext) => React.ReactNode;\n readonly getNodeSize?: (node: GraphViewNode) => GraphViewSize | undefined;\n readonly fitPadding?: number;\n readonly minZoom?: number;\n readonly maxZoom?: number;\n readonly minReadableLabelSize?: number;\n readonly maxFitLabelSize?: number;\n /** Zoom values and bounds use the full-node fit as 1 when fit-relative is selected. */\n readonly zoomMode?: 'absolute' | 'fit-relative';\n /** Measure plain labels before layout instead of estimating width from character count. */\n readonly sizeNodesToLabels?: boolean;\n readonly className?: string;\n readonly style?: React.CSSProperties;\n readonly ariaLabel?: string;\n readonly onReady?: (controller: GraphViewController) => void;\n readonly onLayoutComplete?: (controller: GraphViewController) => void;\n readonly onNodeEvent?: (event: GraphViewElementEvent) => void;\n readonly onEdgeEvent?: (event: GraphViewElementEvent) => void;\n readonly onViewportChange?: (viewport: GraphViewViewport) => void;\n readonly onSpacingFactorChange?: (spacingFactor: number) => void;\n}\n\nexport type GraphViewCallbacks = Pick<\n GraphViewProps,\n | 'onEdgeEvent'\n | 'onLayoutComplete'\n | 'onNodeEvent'\n | 'onReady'\n | 'onViewportChange'\n | 'onSpacingFactorChange'\n>;\n\ntype GraphContainer = NonNullable<CytoscapeOptions['container']>;\n\n/***\n * Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.\n * zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative\n * to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units.\n * sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode\n * text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners.\n * minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size.\n * maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs.\n * onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }).\n * Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering\n * and uses bounded collision checks including labels and compound siblings; it can recover uniformly\n * cramped layouts but cannot repair non-uniform overlaps.\n */\nexport function GraphView(props: GraphViewProps) {\n const { containerRef, renderedNodes, runtimeRef } = useGraphViewRuntime(props);\n\n return (\n <div\n aria-label={props.ariaLabel ?? 'Graph'}\n className={props.className}\n role=\"application\"\n style={{\n height: '100%',\n minHeight: 0,\n minWidth: 0,\n position: 'relative',\n width: '100%',\n ...props.style,\n }}\n >\n <div ref={containerRef} style={{ height: '100%', width: '100%' }} />\n {props.renderNode ? (\n <GraphNodeOverlay\n nodes={props.nodes}\n renderedNodes={renderedNodes}\n renderNode={props.renderNode}\n onNodeEvent={(id, type) => runtimeRef.current?.handleOverlayNodeEvent(id, type)}\n onNodeSize={(id, size) => runtimeRef.current?.setNodeSize(id, size)}\n />\n ) : null}\n </div>\n );\n}\n\n/*** Compose React synchronization around the single imperative graph runtime. */\nfunction useGraphViewRuntime(props: GraphViewProps) {\n const containerRef = React.useRef<GraphContainer | null>(null);\n const runtimeRef = React.useRef<GraphRuntime | null>(null);\n const callbacksRef = useGraphCallbacksRef(props);\n const [renderedNodes, setRenderedNodes] = React.useState<readonly GraphViewRenderedNode[]>([]);\n\n useRuntimeLifecycle(containerRef, runtimeRef, callbacksRef);\n useRuntimeGraphUpdate(runtimeRef, props);\n useRuntimeSelection(runtimeRef, props.selectedNodeIds);\n useRenderedNodeSubscription(runtimeRef, props.renderNode, setRenderedNodes);\n useKnownNodeSizes(runtimeRef, props.nodes, props.getNodeSize);\n\n return { containerRef, renderedNodes, runtimeRef };\n}\n\n/*** Keep the callback ref current without mutating refs during render. */\nfunction useGraphCallbacksRef(props: GraphViewProps) {\n const callbacksRef = React.useRef<GraphViewCallbacks>(readCallbacks(props));\n const {\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n } = props;\n\n React.useEffect(() => {\n callbacksRef.current = {\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n };\n }, [\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n ]);\n\n return callbacksRef;\n}\n\n/*** Create and dispose the runtime only with the underlying browser container lifetime. */\nfunction useRuntimeLifecycle(\n containerRef: { current: GraphContainer | null },\n runtimeRef: { current: GraphRuntime | null },\n callbacksRef: { current: GraphViewCallbacks },\n) {\n React.useEffect(() => {\n const container = containerRef.current;\n if (container === null) return;\n const runtime = createGraphRuntime(container, callbacksRef);\n runtimeRef.current = runtime;\n return () => {\n runtime.destroy();\n runtimeRef.current = null;\n };\n }, [callbacksRef, containerRef, runtimeRef]);\n}\n\n/*** Synchronize graph data and layout policy without exposing Cytoscape to React. */\nfunction useRuntimeGraphUpdate(\n runtimeRef: { current: GraphRuntime | null },\n props: GraphViewProps,\n) {\n const {\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n renderNode,\n spacingFactor,\n styleRules,\n } = props;\n\n React.useEffect(() => {\n runtimeRef.current?.update({\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n richNodeRendering: renderNode !== undefined,\n spacingFactor,\n styleRules,\n });\n }, [\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n renderNode,\n runtimeRef,\n spacingFactor,\n styleRules,\n ]);\n}\n\n/*** Synchronize optional controlled selection independently from graph layout. */\nfunction useRuntimeSelection(\n runtimeRef: { current: GraphRuntime | null },\n selectedNodeIds: readonly string[] | undefined,\n) {\n React.useEffect(() => {\n runtimeRef.current?.setSelectedNodeIds(selectedNodeIds);\n }, [runtimeRef, selectedNodeIds]);\n}\n\n/*** Subscribe the optional rich-node overlay to rendered runtime positions. */\nfunction useRenderedNodeSubscription(\n runtimeRef: { current: GraphRuntime | null },\n renderNode: GraphViewProps['renderNode'],\n setRenderedNodes: (nodes: readonly GraphViewRenderedNode[]) => void,\n) {\n React.useEffect(() => {\n const runtime = runtimeRef.current;\n if (runtime === null || renderNode === undefined) {\n setRenderedNodes([]);\n return;\n }\n return runtime.subscribeRenderedNodes(setRenderedNodes);\n }, [renderNode, runtimeRef, setRenderedNodes]);\n}\n\n/*** Seed known rich-node dimensions without requiring DOM measurement. */\nfunction useKnownNodeSizes(\n runtimeRef: { current: GraphRuntime | null },\n nodes: readonly GraphViewNode[],\n getNodeSize: GraphViewProps['getNodeSize'],\n) {\n React.useEffect(() => {\n const runtime = runtimeRef.current;\n if (runtime === null || getNodeSize === undefined) return;\n for (const node of nodes) {\n const size = getNodeSize(node);\n if (size) runtime.setNodeSize(node.id, size);\n }\n }, [getNodeSize, nodes, runtimeRef]);\n}\n\n/*** Read callback props for the initial runtime callback-ref value. */\nfunction readCallbacks(props: GraphViewProps): GraphViewCallbacks {\n return {\n onEdgeEvent: props.onEdgeEvent,\n onLayoutComplete: props.onLayoutComplete,\n onNodeEvent: props.onNodeEvent,\n onReady: props.onReady,\n onViewportChange: props.onViewportChange,\n onSpacingFactorChange: props.onSpacingFactorChange,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GraphView.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAE/E,OAAO,CACL,CAAC,GAAG,CACF,UAAU,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,OAAO,CAAC,CACvC,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAC3B,IAAI,CAAC,aAAa,CAClB,KAAK,CAAC,CAAC;YACL,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,MAAM;YACb,GAAG,KAAK,CAAC,KAAK;SACf,CAAC,CAEF;MAAA,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EACjE;MAAA,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAClB,CAAC,gBAAgB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C,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,0EAA0E;AAC1E,SAAS,iBAAiB,CACxB,UAA4C,EAC5C,KAA+B,EAC/B,WAA0C;IAE1C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,OAAO,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS;YAAE,OAAO;QAC1D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,IAAI;gBAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,uEAAuE;AACvE,SAAS,aAAa,CAAC,KAAqB;IAC1C,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;KACnD,CAAC;AACJ,CAAC","sourcesContent":["import type { CytoscapeOptions } from 'cytoscape';\nimport React from 'react';\n\nimport type {\n GraphViewCallbacks,\n GraphViewNode,\n GraphViewProps,\n GraphViewRenderedNode,\n} from '../../../../../types/graph-view';\nimport { createGraphRuntime, type GraphRuntime } from './createGraphRuntime';\nimport { GraphNodeOverlay } from './GraphNodeOverlay';\n\ntype GraphContainer = NonNullable<CytoscapeOptions['container']>;\n\n/***\n * Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.\n * zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative\n * to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units.\n * sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode\n * text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners.\n * minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size.\n * maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs.\n * onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }).\n * Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering\n * and uses bounded collision checks including labels and compound siblings; it can recover uniformly\n * cramped layouts but cannot repair non-uniform overlaps.\n */\nexport function GraphView(props: GraphViewProps) {\n const { containerRef, renderedNodes, runtimeRef } = useGraphViewRuntime(props);\n\n return (\n <div\n aria-label={props.ariaLabel ?? 'Graph'}\n className={props.className}\n role=\"application\"\n style={{\n height: '100%',\n minHeight: 0,\n minWidth: 0,\n position: 'relative',\n width: '100%',\n ...props.style,\n }}\n >\n <div ref={containerRef} style={{ height: '100%', width: '100%' }} />\n {props.renderNode ? (\n <GraphNodeOverlay\n nodes={props.nodes}\n renderedNodes={renderedNodes}\n renderNode={props.renderNode}\n onNodeEvent={(id, type) => runtimeRef.current?.handleOverlayNodeEvent(id, type)}\n onNodeSize={(id, size) => runtimeRef.current?.setNodeSize(id, size)}\n />\n ) : null}\n </div>\n );\n}\n\n/*** Compose React synchronization around the single imperative graph runtime. */\nfunction useGraphViewRuntime(props: GraphViewProps) {\n const containerRef = React.useRef<GraphContainer | null>(null);\n const runtimeRef = React.useRef<GraphRuntime | null>(null);\n const callbacksRef = useGraphCallbacksRef(props);\n const [renderedNodes, setRenderedNodes] = React.useState<readonly GraphViewRenderedNode[]>([]);\n\n useRuntimeLifecycle(containerRef, runtimeRef, callbacksRef);\n useRuntimeGraphUpdate(runtimeRef, props);\n useRuntimeSelection(runtimeRef, props.selectedNodeIds);\n useRenderedNodeSubscription(runtimeRef, props.renderNode, setRenderedNodes);\n useKnownNodeSizes(runtimeRef, props.nodes, props.getNodeSize);\n\n return { containerRef, renderedNodes, runtimeRef };\n}\n\n/*** Keep the callback ref current without mutating refs during render. */\nfunction useGraphCallbacksRef(props: GraphViewProps) {\n const callbacksRef = React.useRef<GraphViewCallbacks>(readCallbacks(props));\n const {\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n } = props;\n\n React.useEffect(() => {\n callbacksRef.current = {\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n };\n }, [\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n ]);\n\n return callbacksRef;\n}\n\n/*** Create and dispose the runtime only with the underlying browser container lifetime. */\nfunction useRuntimeLifecycle(\n containerRef: { current: GraphContainer | null },\n runtimeRef: { current: GraphRuntime | null },\n callbacksRef: { current: GraphViewCallbacks },\n) {\n React.useEffect(() => {\n const container = containerRef.current;\n if (container === null) return;\n const runtime = createGraphRuntime(container, callbacksRef);\n runtimeRef.current = runtime;\n return () => {\n runtime.destroy();\n runtimeRef.current = null;\n };\n }, [callbacksRef, containerRef, runtimeRef]);\n}\n\n/*** Synchronize graph data and layout policy without exposing Cytoscape to React. */\nfunction useRuntimeGraphUpdate(\n runtimeRef: { current: GraphRuntime | null },\n props: GraphViewProps,\n) {\n const {\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n renderNode,\n spacingFactor,\n styleRules,\n } = props;\n\n React.useEffect(() => {\n runtimeRef.current?.update({\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n richNodeRendering: renderNode !== undefined,\n spacingFactor,\n styleRules,\n });\n }, [\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n renderNode,\n runtimeRef,\n spacingFactor,\n styleRules,\n ]);\n}\n\n/*** Synchronize optional controlled selection independently from graph layout. */\nfunction useRuntimeSelection(\n runtimeRef: { current: GraphRuntime | null },\n selectedNodeIds: readonly string[] | undefined,\n) {\n React.useEffect(() => {\n runtimeRef.current?.setSelectedNodeIds(selectedNodeIds);\n }, [runtimeRef, selectedNodeIds]);\n}\n\n/*** Subscribe the optional rich-node overlay to rendered runtime positions. */\nfunction useRenderedNodeSubscription(\n runtimeRef: { current: GraphRuntime | null },\n renderNode: GraphViewProps['renderNode'],\n setRenderedNodes: (nodes: readonly GraphViewRenderedNode[]) => void,\n) {\n React.useEffect(() => {\n const runtime = runtimeRef.current;\n if (runtime === null || renderNode === undefined) {\n setRenderedNodes([]);\n return;\n }\n return runtime.subscribeRenderedNodes(setRenderedNodes);\n }, [renderNode, runtimeRef, setRenderedNodes]);\n}\n\n/*** Seed known rich-node dimensions without requiring DOM measurement. */\nfunction useKnownNodeSizes(\n runtimeRef: { current: GraphRuntime | null },\n nodes: readonly GraphViewNode[],\n getNodeSize: GraphViewProps['getNodeSize'],\n) {\n React.useEffect(() => {\n const runtime = runtimeRef.current;\n if (runtime === null || getNodeSize === undefined) return;\n for (const node of nodes) {\n const size = getNodeSize(node);\n if (size) runtime.setNodeSize(node.id, size);\n }\n }, [getNodeSize, nodes, runtimeRef]);\n}\n\n/*** Read callback props for the initial runtime callback-ref value. */\nfunction readCallbacks(props: GraphViewProps): GraphViewCallbacks {\n return {\n onEdgeEvent: props.onEdgeEvent,\n onLayoutComplete: props.onLayoutComplete,\n onNodeEvent: props.onNodeEvent,\n onReady: props.onReady,\n onViewportChange: props.onViewportChange,\n onSpacingFactorChange: props.onSpacingFactorChange,\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Core } from 'cytoscape';
|
|
2
|
-
import type { GraphViewCallbacks, GraphViewController } from '
|
|
2
|
+
import type { GraphViewCallbacks, GraphViewController } from '../../../../../types/graph-view';
|
|
3
3
|
/*** Bind stable Cytoscape events that always read the latest React callbacks. */
|
|
4
4
|
export declare function bindGraphEvents(cy: Core, callbacksRef: {
|
|
5
5
|
current: GraphViewCallbacks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindGraphEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,
|
|
1
|
+
{"version":3,"file":"bindGraphEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAEzC,iFAAiF;AACjF,wBAAgB,eAAe,CAC7B,EAAE,EAAE,IAAI,EACR,YAAY,EAAE;IAAE,OAAO,EAAE,kBAAkB,CAAA;CAAE,EAC7C,UAAU,EAAE,mBAAmB,EAC/B,eAAe,EAAE,MAAM,IAAI,cAe5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindGraphEvents.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.ts"],"names":[],"mappings":"AAQA,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAC7B,EAAQ,EACR,YAA6C,EAC7C,UAA+B,EAC/B,eAA2B;IAE3B,MAAM,YAAY,GAAG,iB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O,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,wFAAwF;AACxF,SAAS,kBAAkB,CAAC,KAAc;IACxC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,UAAU,CAC/F,CAAC;AACJ,CAAC;AAMD,mFAAmF;AACnF,SAAS,gBAAgB,CACvB,SAA6B,EAC7B,QAAyB,EACzB,KAAwE;IAExE,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACxB,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO;IACT,CAAC;IACD,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,uFAAuF;AACvF,SAAS,mBAAmB,CAC1B,EAAQ,EACR,QAAyB,EACzB,QAAwC;IAExC,KAAK,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,QAAQ,EAAE,CAAC;QACnD,EAAE,CAAC,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,CAAC,KAAK,EAAE,OAAO,CAAC;IAChB,CAAC,QAAQ,EAAE,cAAc,CAAC;IAC1B,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,UAAU,EAAE,UAAU,CAAC;IACxB,CAAC,WAAW,EAAE,eAAe,CAAC;IAC9B,CAAC,UAAU,EAAE,eAAe,CAAC;CAC+C,CAAC","sourcesContent":["import type { Core, EventObject } from 'cytoscape';\n\nimport type {\n GraphViewCallbacks,\n GraphViewController,\n GraphViewElementEventType,\n} from '
|
|
1
|
+
{"version":3,"file":"bindGraphEvents.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.ts"],"names":[],"mappings":"AAQA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AAC,CAAC;QACF,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACzC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,wFAAwF;AACxF,SAAS,kBAAkB,CAAC,KAAc;IACxC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,UAAU,CAC/F,CAAC;AACJ,CAAC;AAMD,mFAAmF;AACnF,SAAS,gBAAgB,CACvB,SAA6B,EAC7B,QAAyB,EACzB,KAAwE;IAExE,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACxB,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO;IACT,CAAC;IACD,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,uFAAuF;AACvF,SAAS,mBAAmB,CAC1B,EAAQ,EACR,QAAyB,EACzB,QAAwC;IAExC,KAAK,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,QAAQ,EAAE,CAAC;QACnD,EAAE,CAAC,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,CAAC,KAAK,EAAE,OAAO,CAAC;IAChB,CAAC,QAAQ,EAAE,cAAc,CAAC;IAC1B,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,UAAU,EAAE,UAAU,CAAC;IACxB,CAAC,WAAW,EAAE,eAAe,CAAC;IAC9B,CAAC,UAAU,EAAE,eAAe,CAAC;CAC+C,CAAC","sourcesContent":["import type { Core, EventObject } from 'cytoscape';\n\nimport type {\n GraphViewCallbacks,\n GraphViewController,\n GraphViewElementEventType,\n} from '../../../../../types/graph-view';\n\n/*** Bind stable Cytoscape events that always read the latest React callbacks. */\nexport function bindGraphEvents(\n cy: Core,\n callbacksRef: { current: GraphViewCallbacks },\n controller: GraphViewController,\n onRuntimeChange: () => void,\n) {\n const nodeHandlers = bindElementEvents(cy, 'node', callbacksRef, onRuntimeChange);\n const edgeHandlers = bindElementEvents(cy, 'edge', callbacksRef, onRuntimeChange);\n const viewportHandler = () => {\n callbacksRef.current.onViewportChange?.(controller.getViewport());\n onRuntimeChange();\n };\n cy.on('zoom pan', viewportHandler);\n\n return () => {\n unbindElementEvents(cy, 'node', nodeHandlers);\n unbindElementEvents(cy, 'edge', edgeHandlers);\n cy.off('zoom pan', viewportHandler);\n };\n}\n\ntype ElementSelector = 'edge' | 'node';\n\ninterface BoundElementHandler {\n readonly cytoscapeEvent: string;\n readonly handler: (event: EventObject) => void;\n}\n\n/*** Bind one selector's translated event set without resubscribing on callback changes. */\nfunction bindElementEvents(\n cy: Core,\n selector: ElementSelector,\n callbacksRef: { current: GraphViewCallbacks },\n onRuntimeChange: () => void,\n): readonly BoundElementHandler[] {\n return EVENT_TYPES.map(([cytoscapeEvent, type]) => {\n const handler = (event: EventObject) => {\n const target: unknown = event.target;\n if (!isGraphEventTarget(target)) return;\n emitElementEvent(callbacksRef.current, selector, {\n id: target.id(),\n type,\n });\n onRuntimeChange();\n };\n cy.on(cytoscapeEvent, selector, handler);\n return { cytoscapeEvent, handler };\n });\n}\n\n/*** Return whether a Cytoscape event target exposes the element identifier contract. */\nfunction isGraphEventTarget(value: unknown): value is GraphEventTarget {\n return (\n typeof value === 'object' && value !== null && 'id' in value && typeof value.id === 'function'\n );\n}\n\ninterface GraphEventTarget {\n id(): string;\n}\n\n/*** Emit one translated element event without dynamic callback-property access. */\nfunction emitElementEvent(\n callbacks: GraphViewCallbacks,\n selector: ElementSelector,\n event: { readonly id: string; readonly type: GraphViewElementEventType },\n) {\n if (selector === 'node') {\n callbacks.onNodeEvent?.(event);\n return;\n }\n callbacks.onEdgeEvent?.(event);\n}\n\n/*** Remove one selector's event handlers using the exact bound callback identities. */\nfunction unbindElementEvents(\n cy: Core,\n selector: ElementSelector,\n handlers: readonly BoundElementHandler[],\n) {\n for (const { cytoscapeEvent, handler } of handlers) {\n cy.off(cytoscapeEvent, selector, handler);\n }\n}\n\nconst EVENT_TYPES = [\n ['tap', 'press'],\n ['dbltap', 'double-press'],\n ['select', 'select'],\n ['unselect', 'unselect'],\n ['mouseover', 'pointer-enter'],\n ['mouseout', 'pointer-leave'],\n] as const satisfies readonly (readonly [string, GraphViewElementEventType])[];\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Core } from 'cytoscape';
|
|
2
|
+
import type { GraphViewController, GraphViewFitOptions } from '../../../../../types/graph-view';
|
|
2
3
|
import type { GraphRuntimeUpdate } from '../../../../../types/graphViewRuntime';
|
|
3
|
-
import type { GraphViewController, GraphViewFitOptions } from './GraphView';
|
|
4
4
|
/*** Own viewport units and limits alongside the public controller, without exposing Cytoscape. */
|
|
5
5
|
export declare function createGraphController(cy: Core, fitPaddingRef: {
|
|
6
6
|
current: number;
|
package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphController.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"createGraphController.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAGhF,kGAAkG;AAClG,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,IAAI,EACR,aAAa,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAClC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI;;qBA8CjC,kBAAkB;gBASvB,OAAO;EAwBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphController.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createGraphController.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,kGAAkG;AAClG,MAAM,UAAU,qBAAqB,CACnC,EAAQ,EACR,aAAkC,EAClC,WAAoD;IAEpD,MAAM,KAAK,GAAG;QACZ,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,KAAK;QACf,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,CAAC;QACN,YAAY,EAAE,CAAC;QACf,OAAO,EAAE,QAAQ;QACjB,YAAY,EAAE,CAAC;QACf,OAAO,EAAE,QAAQ;KAClB,CAAC;IACF,MAAM,UAAU,GAAwB;QACtC,GAAG,CAAC,OAAO;YACT,IAAI,OAAO,EAAE,eAAe,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,CAAC;gBACxE,WAAW,CAAC,OAAO,CAAC,CAAC;gBACrB,OAAO;YACT,CAAC;YACD,gBAAgB,CACd,EAAE,EACF;gBACE,OAAO,EAAE,OAAO,EAAE,OAAO;gBACzB,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,aAAa,CAAC,OAAO;aACnD,EACD,KAAK,CAAC,OAAO,CACd,CAAC;QACJ,CAAC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C;IACxC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;IACvC,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;IACzC,IAAI,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,+EAA+E;AAC/E,SAAS,eAAe,CAAC,EAAQ,EAAE,IAAY;IAC7C,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACxF,CAAC","sourcesContent":["import type { Core } from 'cytoscape';\n\nimport type { GraphViewController, GraphViewFitOptions } from '../../../../../types/graph-view';\nimport type { GraphRuntimeUpdate } from '../../../../../types/graphViewRuntime';\nimport { fitGraphViewport } from './fitGraphViewport';\n\n/*** Own viewport units and limits alongside the public controller, without exposing Cytoscape. */\nexport function createGraphController(\n cy: Core,\n fitPaddingRef: { current: number },\n optimizeFit?: (options: GraphViewFitOptions) => void,\n) {\n const state = {\n scale: 1,\n relative: false,\n min: 0.05,\n max: 2,\n readableSize: 0,\n fitSize: Infinity,\n readableZoom: 0,\n fitZoom: Infinity,\n };\n const controller: GraphViewController = {\n fit(options) {\n if (options?.optimizeSpacing && !options.nodeIds?.length && optimizeFit) {\n optimizeFit(options);\n return;\n }\n fitGraphViewport(\n cy,\n {\n nodeIds: options?.nodeIds,\n padding: options?.padding ?? fitPaddingRef.current,\n },\n state.fitZoom,\n );\n },\n getViewport() {\n return { pan: cy.pan(), zoom: cy.zoom() / state.scale };\n },\n getZoomRange() {\n return { min: cy.minZoom() / state.scale, max: cy.maxZoom() / state.scale };\n },\n setPan(pan) {\n cy.pan(pan);\n },\n setZoom(zoom) {\n setCenteredZoom(cy, zoom * state.scale);\n },\n zoomBy(factor) {\n setCenteredZoom(cy, cy.zoom() * factor);\n },\n };\n\n return {\n controller,\n configure(input: GraphRuntimeUpdate) {\n state.relative = input.zoomMode === 'fit-relative';\n state.min = input.minZoom ?? 0.05;\n state.max = input.maxZoom ?? 2;\n state.readableSize = positiveSize(input.minReadableLabelSize, 0);\n state.fitSize = positiveSize(input.maxFitLabelSize, Infinity);\n if (!state.relative) state.scale = 1;\n applyZoomLimits(cy, state);\n },\n settle(fit: boolean) {\n const logicalZoom = cy.zoom() / state.scale;\n const fonts = cy\n .nodes()\n .filter((node) => !node.isParent() && Boolean(node.style('label')))\n .map((node) => Number.parseFloat(String(node.style('font-size'))))\n .filter((size) => Number.isFinite(size) && size > 0);\n state.readableZoom = fonts.length\n ? state.readableSize / fonts.reduce((minimum, size) => Math.min(minimum, size), Infinity)\n : 0;\n state.fitZoom = fonts.length\n ? state.fitSize / fonts.reduce((maximum, size) => Math.max(maximum, size), 0)\n : Infinity;\n state.scale = state.relative\n ? Math.min(getNodeFitZoom(cy, fitPaddingRef.current), state.fitZoom)\n : 1;\n applyZoomLimits(cy, state);\n if (fit) controller.fit();\n else if (state.relative) {\n setCenteredZoom(cy, logicalZoom * state.scale);\n cy.center(cy.nodes());\n }\n },\n };\n}\n\n/*** Keep pointer, wheel, and programmatic zoom on the same limits in the engine's native units. */\nfunction applyZoomLimits(\n cy: Core,\n state: {\n readonly min: number;\n readonly max: number;\n readonly scale: number;\n readonly readableZoom: number;\n },\n) {\n const min = state.min * state.scale;\n cy.minZoom(Math.min(cy.minZoom(), min));\n cy.maxZoom(Math.max(min, state.max * state.scale, state.readableZoom));\n cy.minZoom(min);\n}\n\n/*** Ignore invalid optional typography targets at the public configuration boundary. */\nfunction positiveSize(value: number | undefined, fallback: number): number {\n return value !== undefined && Number.isFinite(value) && value > 0 ? value : fallback;\n}\n\n/***\n * Recompute the fit reference only after layout or resize, never on every pan/zoom event.\n * Cache the geometry-derived scale in the viewport owner; labels are included, edges excluded.\n */\nfunction getNodeFitZoom(cy: Core, padding: number): number {\n if (cy.nodes().empty()) return 1;\n const bounds = cy.nodes().boundingBox();\n const width = cy.width() - 2 * padding;\n const height = cy.height() - 2 * padding;\n if (width <= 0 || height <= 0 || bounds.w <= 0 || bounds.h <= 0) return 1;\n return Math.min(width / bounds.w, height / bounds.h);\n}\n\n/*** Zoom around the visible viewport center instead of its top-left corner. */\nfunction setCenteredZoom(cy: Core, zoom: number) {\n cy.zoom({ level: zoom, renderedPosition: { x: cy.width() / 2, y: cy.height() / 2 } });\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CytoscapeOptions } from 'cytoscape';
|
|
2
|
+
import type { GraphViewCallbacks, GraphViewElementEventType, GraphViewRenderedNode, GraphViewSize } from '../../../../../types/graph-view';
|
|
2
3
|
import type { GraphRuntimeUpdate } from '../../../../../types/graphViewRuntime';
|
|
3
|
-
import type { GraphViewCallbacks, GraphViewElementEventType, GraphViewRenderedNode, GraphViewSize } from './GraphView';
|
|
4
4
|
type GraphContainer = CytoscapeOptions['container'];
|
|
5
5
|
type RenderedNodeListener = (nodes: readonly GraphViewRenderedNode[]) => void;
|
|
6
6
|
export interface GraphRuntime {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphRuntime.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAkB,EAAa,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"createGraphRuntime.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAkB,EAAa,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAEzB,qBAAqB,EACrB,aAAa,EAEd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAiBhF,KAAK,cAAc,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACpD,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,KAAK,IAAI,CAAC;AAE9E,MAAM,WAAW,YAAY;IAC3B,OAAO,IAAI,IAAI,CAAC;IAChB,sBAAsB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC1E,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IACnD,kBAAkB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC;IACjE,sBAAsB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,IAAI,CAAC;IACnE,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACzC;AA4BD,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,cAAc,EACzB,YAAY,EAAE;IAAE,OAAO,EAAE,kBAAkB,CAAA;CAAE,GAC5C,YAAY,CAmBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphRuntime.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAoC,MAAM,WAAW,CAAC;AAGxE,OAAO,EAAE,eAAe,EAAE,M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;QAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC9D,IAAI,IAAI,KAAK,OAAO;QAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3D,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED,+EAA+E;AAC/E,SAAS,iBAAiB,CAAC,EAAQ;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,8EAA8E;AAC9E,SAAS,cAAc,CAAC,KAAwB;IAC9C,KAAK,CAAC,cAAc,EAAE,UAAU,EAAE,CAAC;IACnC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzB,KAAK,CAAC,YAAY,EAAE,CAAC;IACrB,KAAK,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;IACpC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE;QAAE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;AAChD,CAAC;AAED,oBAAoB,EAAE,CAAC","sourcesContent":["import cytoscape, { type Core, type CytoscapeOptions } from 'cytoscape';\n\nimport type { GraphRuntimeUpdate } from '../../../../../types/graphViewRuntime';\nimport { bindGraphEvents } from './bindGraphEvents';\nimport { compactGraphSpacing } from './compactGraphSpacing';\nimport { createGraphController } from './createGraphController';\nimport { createGraphLoopSizer } from './createGraphLoopSizer';\nimport { createGraphResizeObserver, type GraphResizeObserver } from './createGraphResizeObserver';\nimport { getGraphGeometryKey } from './getGraphGeometryKey';\nimport { getGraphTopologyKey } from './getGraphTopologyKey';\nimport type {\n GraphViewCallbacks,\n GraphViewElementEventType,\n GraphViewFitOptions,\n GraphViewRenderedNode,\n GraphViewSize,\n GraphViewStyleRule,\n} from './GraphView';\nimport { hasGraphLayoutChanged } from './hasGraphLayoutChanged';\nimport { readGraphRenderedNodes } from './readGraphRenderedNodes';\nimport { registerGraphLayouts } from './registerGraphLayouts';\nimport { runGraphLayout } from './runGraphLayout';\nimport { scheduleGraphFrame } from './scheduleGraphFrame';\nimport { shouldFitGraphAfterLayout } from './shouldFitGraphAfterLayout';\nimport { sizeGraphNodesToLabels } from './sizeGraphNodesToLabels';\nimport { syncGraphElements } from './syncGraphElements';\n\ntype GraphContainer = CytoscapeOptions['container'];\ntype RenderedNodeListener = (nodes: readonly GraphViewRenderedNode[]) => void;\n\nexport interface GraphRuntime {\n destroy(): void;\n handleOverlayNodeEvent(id: string, type: GraphViewElementEventType): void;\n setNodeSize(id: string, size: GraphViewSize): void;\n setSelectedNodeIds(nodeIds: readonly string[] | undefined): void;\n subscribeRenderedNodes(listener: RenderedNodeListener): () => void;\n update(input: GraphRuntimeUpdate): void;\n}\n\ninterface GraphRuntimeState {\n readonly fitRequestRef: { current: GraphViewFitOptions | null };\n readonly optimizedSpacingRef: { current: number | null };\n readonly callbacksRef: { current: GraphViewCallbacks };\n readonly controller: ReturnType<typeof createGraphController>['controller'];\n readonly viewport: ReturnType<typeof createGraphController>;\n readonly cy: Core;\n readonly fitPaddingRef: { current: number };\n readonly generationRef: { current: number };\n readonly geometryRef: { current: string | null };\n readonly hoveredNodeIds: Set<string>;\n readonly latestUpdateRef: { current: GraphRuntimeUpdate | null };\n readonly layoutRef: { current: ReturnType<typeof runGraphLayout> | null };\n readonly layoutRunningRef: { current: boolean };\n readonly nodeSizes: Map<string, GraphViewSize>;\n readonly labelSizedNodeIds: Set<string>;\n readonly loopSizer: ReturnType<typeof createGraphLoopSizer>;\n readonly pendingInitialFitRef: { current: boolean };\n readonly readyRef: { current: boolean };\n readonly settledTopologyRef: { current: string | null };\n readonly relayoutScheduledRef: { current: boolean };\n readonly renderedNodeListeners: Set<RenderedNodeListener>;\n readonly resizeObserver: GraphResizeObserver | null;\n readonly unbindEvents: () => void;\n}\n\n/*** Create one Cytoscape runtime that exclusively owns layout, fit, resize, and disposal. */\nexport function createGraphRuntime(\n container: GraphContainer,\n callbacksRef: { current: GraphViewCallbacks },\n): GraphRuntime {\n const cy = cytoscape({\n container,\n elements: [],\n minZoom: 0.05,\n maxZoom: 2,\n selectionType: 'additive',\n userPanningEnabled: true,\n });\n const state = createRuntimeState(cy, container, callbacksRef);\n\n return {\n destroy: () => destroyRuntime(state),\n handleOverlayNodeEvent: (id, type) => handleOverlayNodeEvent(state, id, type),\n setNodeSize: (id, size) => setNodeSize(state, id, size),\n setSelectedNodeIds: (nodeIds) => setSelectedNodeIds(state, nodeIds),\n subscribeRenderedNodes: (listener) => subscribeRenderedNodes(state, listener),\n update: (input) => updateRuntime(state, input),\n };\n}\n\n/*** Build the mutable state shared by the single graph-runtime owner. */\nfunction createRuntimeState(\n cy: Core,\n container: GraphContainer,\n callbacksRef: { current: GraphViewCallbacks },\n): GraphRuntimeState {\n const fitPaddingRef = { current: 50 };\n const viewport = createGraphController(cy, fitPaddingRef, (options) =>\n requestOptimizedFit(state, options),\n );\n const { controller } = viewport;\n const layoutRunningRef = { current: false };\n const readyRef = { current: false };\n const renderedNodeListeners = new Set<RenderedNodeListener>();\n const stateBase = {\n fitRequestRef: { current: null as GraphViewFitOptions | null },\n optimizedSpacingRef: { current: null as number | null },\n callbacksRef,\n controller,\n viewport,\n cy,\n fitPaddingRef,\n generationRef: { current: 0 },\n geometryRef: { current: null as string | null },\n hoveredNodeIds: new Set<string>(),\n latestUpdateRef: { current: null as GraphRuntimeUpdate | null },\n layoutRef: { current: null as ReturnType<typeof runGraphLayout> | null },\n layoutRunningRef,\n nodeSizes: new Map<string, GraphViewSize>(),\n labelSizedNodeIds: new Set<string>(),\n loopSizer: createGraphLoopSizer(cy),\n pendingInitialFitRef: { current: false },\n readyRef,\n settledTopologyRef: { current: null as string | null },\n relayoutScheduledRef: { current: false },\n renderedNodeListeners,\n };\n const unbindEvents = bindGraphEvents(cy, callbacksRef, controller, () =>\n emitRenderedNodes(stateBase),\n );\n const resizeObserver = createGraphResizeObserver({\n container,\n cy,\n settleViewport: () => viewport.settle(true),\n layoutRunningRef,\n pendingInitialFitRef: stateBase.pendingInitialFitRef,\n onViewportSettled: (completedPendingInitialFit) => {\n emitRenderedNodes(stateBase);\n if (!completedPendingInitialFit || readyRef.current) return;\n readyRef.current = true;\n callbacksRef.current.onReady?.(controller);\n callbacksRef.current.onLayoutComplete?.(controller);\n },\n readyRef,\n });\n\n const state = { ...stateBase, resizeObserver, unbindEvents };\n return state;\n}\n\n/***\n * Reconcile presentation in place and relayout only when graph geometry or layout policy changes.\n * Batch reconciliation and skip layout for presentation-only updates.\n */\nfunction updateRuntime(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n if (state.cy.destroyed()) return;\n const last = state.latestUpdateRef.current;\n const acceptsSpacing =\n state.optimizedSpacingRef.current !== null &&\n state.optimizedSpacingRef.current === input.spacingFactor;\n const previous = acceptsSpacing && last ? { ...last, spacingFactor: input.spacingFactor } : last;\n if (acceptsSpacing) state.optimizedSpacingRef.current = null;\n state.latestUpdateRef.current = input;\n state.fitPaddingRef.current = input.fitPadding ?? 50;\n state.viewport.configure(input);\n state.cy.batch(() => {\n if (previous?.nodes !== input.nodes || previous.edges !== input.edges) {\n syncGraphElements(state.cy, input.nodes, input.edges);\n }\n if (\n previous?.styleRules !== input.styleRules ||\n previous?.richNodeRendering !== input.richNodeRendering\n ) {\n state.loopSizer.reset();\n applyGraphStyles(state.cy, input.styleRules, input.richNodeRendering);\n }\n });\n sizeGraphNodesToLabels(\n state.cy,\n state.labelSizedNodeIds,\n input.sizeNodesToLabels === true && !input.richNodeRendering,\n );\n applyKnownNodeSizes(state);\n state.loopSizer.update();\n const geometry = getGraphGeometryKey(state.cy);\n const relayout = geometry !== state.geometryRef.current || hasGraphLayoutChanged(previous, input);\n state.geometryRef.current = geometry;\n if (!relayout) {\n if (\n previous?.zoomMode !== input.zoomMode ||\n previous?.fitPadding !== input.fitPadding ||\n previous?.minZoom !== input.minZoom ||\n previous?.maxZoom !== input.maxZoom ||\n previous?.minReadableLabelSize !== input.minReadableLabelSize ||\n previous?.maxFitLabelSize !== input.maxFitLabelSize\n ) {\n state.viewport.settle(previous?.zoomMode !== input.zoomMode);\n }\n emitRenderedNodes(state);\n if (!state.layoutRunningRef.current && !state.pendingInitialFitRef.current)\n state.callbacksRef.current.onLayoutComplete?.(state.controller);\n return;\n }\n stopCurrentLayout(state);\n state.fitRequestRef.current = null;\n state.optimizedSpacingRef.current = null;\n startCurrentLayout(state, input);\n}\n\n/*** Start a generation-safe layout whose completion is the only normal automatic fit trigger. */\nfunction startCurrentLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n state.pendingInitialFitRef.current = false;\n const generation = state.generationRef.current + 1;\n state.generationRef.current = generation;\n state.layoutRunningRef.current = true;\n state.cy.resize();\n state.layoutRef.current = runGraphLayout(\n state.cy,\n {\n layout: input.layout ?? 'concentric',\n layoutOptions: input.layoutOptions,\n spacingFactor: input.spacingFactor ?? 1,\n },\n () => completeCurrentLayout(state, generation),\n );\n}\n\n/***\n * Settle only the latest layout generation and fit once from node bounds.\n * Discard stale completions and avoid repeated automatic fits.\n */\nfunction completeCurrentLayout(state: GraphRuntimeState, generation: number) {\n scheduleGraphFrame(() => {\n if (state.cy.destroyed() || generation !== state.generationRef.current) return;\n state.loopSizer.update();\n state.layoutRef.current = null;\n state.cy.resize();\n state.layoutRunningRef.current = false;\n if (!hasUsableViewport(state.cy)) {\n if (!state.readyRef.current) state.pendingInitialFitRef.current = true;\n return;\n }\n state.pendingInitialFitRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null) return;\n const topology = getGraphTopologyKey(input.nodes, input.edges);\n const shouldFit = shouldFitGraphAfterLayout(\n state.readyRef.current,\n topology !== state.settledTopologyRef.current,\n );\n state.viewport.settle(shouldFit);\n state.settledTopologyRef.current = topology;\n const fitRequest = state.fitRequestRef.current;\n state.fitRequestRef.current = null;\n if (fitRequest) requestOptimizedFit(state, fitRequest);\n emitRenderedNodes(state);\n\n if (!state.readyRef.current) {\n state.readyRef.current = true;\n state.callbacksRef.current.onReady?.(state.controller);\n }\n state.callbacksRef.current.onLayoutComplete?.(state.controller);\n });\n}\n\n/***\n * Handle explicit readable-fit intent in the runtime owner, never from zoom or React effects.\n * Bounded spacing optimization preserves the settled algorithm instead of repeatedly running it.\n */\nfunction requestOptimizedFit(state: GraphRuntimeState, options: GraphViewFitOptions) {\n if (state.cy.destroyed()) return;\n if (state.layoutRunningRef.current) {\n state.fitRequestRef.current = options;\n return;\n }\n const input = state.latestUpdateRef.current;\n if (!input) return;\n const previous = state.optimizedSpacingRef.current ?? input.spacingFactor ?? 1;\n const spacing = compactGraphSpacing(state.cy, previous);\n state.geometryRef.current = getGraphGeometryKey(state.cy);\n state.loopSizer.update();\n state.viewport.settle(false);\n state.controller.fit({ ...options, optimizeSpacing: false });\n if (spacing !== previous) {\n state.optimizedSpacingRef.current = spacing;\n state.callbacksRef.current.onSpacingFactorChange?.(spacing);\n }\n emitRenderedNodes(state);\n}\n\n/*** Stop the current layout and invalidate every stale completion callback. */\nfunction stopCurrentLayout(state: GraphRuntimeState) {\n state.generationRef.current += 1;\n state.layoutRunningRef.current = false;\n state.layoutRef.current?.stop();\n state.layoutRef.current = null;\n}\n\n/*** Apply consumer styles and hide native node paint only when React rich nodes are active. */\nfunction applyGraphStyles(\n cy: Core,\n rules: readonly GraphViewStyleRule[] | undefined,\n richNodeRendering: boolean,\n) {\n const styles = [...(rules ?? [])];\n if (richNodeRendering) {\n styles.push({\n selector: 'node',\n style: {\n 'background-opacity': 0,\n 'border-width': 0,\n label: '',\n 'overlay-opacity': 0,\n },\n });\n }\n if (styles.length > 0) cy.style(styles).update();\n}\n\n/***\n * Synchronize controlled selection without rerunning layout.\n * Selection updates must not trigger graph reconstruction or layout.\n */\nfunction setSelectedNodeIds(state: GraphRuntimeState, nodeIds: readonly string[] | undefined) {\n if (state.cy.destroyed() || nodeIds === undefined) return;\n const selectedIds = new Set(nodeIds);\n state.cy.nodes().forEach((node) => {\n if (selectedIds.has(node.id())) node.select();\n else node.unselect();\n });\n emitRenderedNodes(state);\n}\n\n/***\n * Persist one rich-node size and schedule at most one relayout for changed geometry.\n * Ignore unchanged measurements before scheduling layout work.\n */\nfunction setNodeSize(state: GraphRuntimeState, id: string, size: GraphViewSize) {\n const previous = state.nodeSizes.get(id);\n if (previous?.width === size.width && previous.height === size.height) return;\n state.nodeSizes.set(id, size);\n applyNodeSize(state.cy, id, size);\n scheduleMeasuredNodeRelayout(state);\n}\n\n/*** Apply every known rich-node size after Cytoscape elements are replaced. */\nfunction applyKnownNodeSizes(state: GraphRuntimeState) {\n for (const [id, size] of state.nodeSizes) applyNodeSize(state.cy, id, size);\n}\n\n/*** Apply one measured model-space size as a Cytoscape per-node style bypass. */\nfunction applyNodeSize(cy: Core, id: string, size: GraphViewSize) {\n const node = cy.getElementById(id);\n if (node.empty()) return;\n node.style({ height: size.height, width: size.width });\n}\n\n/***\n * Coalesce DOM measurements into one follow-up layout generation.\n * Keep one scheduled layout per frame instead of one per measured node.\n */\nfunction scheduleMeasuredNodeRelayout(state: GraphRuntimeState) {\n if (state.relayoutScheduledRef.current) return;\n state.relayoutScheduledRef.current = true;\n scheduleGraphFrame(() => {\n state.relayoutScheduledRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null || state.cy.destroyed()) return;\n stopCurrentLayout(state);\n startCurrentLayout(state, input);\n });\n}\n\n/*** Subscribe one React overlay to rendered node state without exposing the Cytoscape core. */\nfunction subscribeRenderedNodes(state: GraphRuntimeState, listener: RenderedNodeListener) {\n state.renderedNodeListeners.add(listener);\n listener(readGraphRenderedNodes(state.cy, state.hoveredNodeIds));\n return () => {\n state.renderedNodeListeners.delete(listener);\n };\n}\n\n/***\n * Publish current rendered node positions only to active rich-node subscribers.\n * Skip snapshot preparation when no overlay is subscribed.\n */\nfunction emitRenderedNodes(\n state: Pick<GraphRuntimeState, 'cy' | 'hoveredNodeIds' | 'renderedNodeListeners'>,\n) {\n if (state.renderedNodeListeners.size === 0) return;\n const nodes = readGraphRenderedNodes(state.cy, state.hoveredNodeIds);\n for (const listener of state.renderedNodeListeners) listener(nodes);\n}\n\n/*** Translate one rich-overlay event back into normal graph selection and callbacks. */\nfunction handleOverlayNodeEvent(\n state: GraphRuntimeState,\n id: string,\n type: GraphViewElementEventType,\n) {\n if (type === 'pointer-enter') state.hoveredNodeIds.add(id);\n if (type === 'pointer-leave') state.hoveredNodeIds.delete(id);\n if (type === 'press') state.cy.getElementById(id).select();\n state.callbacksRef.current.onNodeEvent?.({ id, type });\n emitRenderedNodes(state);\n}\n\n/*** Return whether Cytoscape currently has dimensions suitable for fitting. */\nfunction hasUsableViewport(cy: Core): boolean {\n return cy.width() > 0 && cy.height() > 0;\n}\n\n/*** Dispose all runtime resources in the reverse order they were acquired. */\nfunction destroyRuntime(state: GraphRuntimeState) {\n state.resizeObserver?.disconnect();\n stopCurrentLayout(state);\n state.unbindEvents();\n state.renderedNodeListeners.clear();\n if (!state.cy.destroyed()) state.cy.destroy();\n}\n\nregisterGraphLayouts();\n"]}
|
|
1
|
+
{"version":3,"file":"createGraphRuntime.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAoC,MAAM,WAAW,CAAC;AAWxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAA4B,MAAM,6BAA6B,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAA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AC,CAAC;IACvD,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED,+EAA+E;AAC/E,SAAS,iBAAiB,CAAC,EAAQ;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,8EAA8E;AAC9E,SAAS,cAAc,CAAC,KAAwB;IAC9C,KAAK,CAAC,cAAc,EAAE,UAAU,EAAE,CAAC;IACnC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzB,KAAK,CAAC,YAAY,EAAE,CAAC;IACrB,KAAK,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;IACpC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE;QAAE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;AAChD,CAAC;AAED,oBAAoB,EAAE,CAAC","sourcesContent":["import cytoscape, { type Core, type CytoscapeOptions } from 'cytoscape';\n\nimport type {\n GraphViewCallbacks,\n GraphViewElementEventType,\n GraphViewFitOptions,\n GraphViewRenderedNode,\n GraphViewSize,\n GraphViewStyleRule,\n} from '../../../../../types/graph-view';\nimport type { GraphRuntimeUpdate } from '../../../../../types/graphViewRuntime';\nimport { bindGraphEvents } from './bindGraphEvents';\nimport { compactGraphSpacing } from './compactGraphSpacing';\nimport { createGraphController } from './createGraphController';\nimport { createGraphLoopSizer } from './createGraphLoopSizer';\nimport { createGraphResizeObserver, type GraphResizeObserver } from './createGraphResizeObserver';\nimport { getGraphGeometryKey } from './getGraphGeometryKey';\nimport { getGraphTopologyKey } from './getGraphTopologyKey';\nimport { hasGraphLayoutChanged } from './hasGraphLayoutChanged';\nimport { readGraphRenderedNodes } from './readGraphRenderedNodes';\nimport { registerGraphLayouts } from './registerGraphLayouts';\nimport { runGraphLayout } from './runGraphLayout';\nimport { scheduleGraphFrame } from './scheduleGraphFrame';\nimport { shouldFitGraphAfterLayout } from './shouldFitGraphAfterLayout';\nimport { sizeGraphNodesToLabels } from './sizeGraphNodesToLabels';\nimport { syncGraphElements } from './syncGraphElements';\n\ntype GraphContainer = CytoscapeOptions['container'];\ntype RenderedNodeListener = (nodes: readonly GraphViewRenderedNode[]) => void;\n\nexport interface GraphRuntime {\n destroy(): void;\n handleOverlayNodeEvent(id: string, type: GraphViewElementEventType): void;\n setNodeSize(id: string, size: GraphViewSize): void;\n setSelectedNodeIds(nodeIds: readonly string[] | undefined): void;\n subscribeRenderedNodes(listener: RenderedNodeListener): () => void;\n update(input: GraphRuntimeUpdate): void;\n}\n\ninterface GraphRuntimeState {\n readonly fitRequestRef: { current: GraphViewFitOptions | null };\n readonly optimizedSpacingRef: { current: number | null };\n readonly callbacksRef: { current: GraphViewCallbacks };\n readonly controller: ReturnType<typeof createGraphController>['controller'];\n readonly viewport: ReturnType<typeof createGraphController>;\n readonly cy: Core;\n readonly fitPaddingRef: { current: number };\n readonly generationRef: { current: number };\n readonly geometryRef: { current: string | null };\n readonly hoveredNodeIds: Set<string>;\n readonly latestUpdateRef: { current: GraphRuntimeUpdate | null };\n readonly layoutRef: { current: ReturnType<typeof runGraphLayout> | null };\n readonly layoutRunningRef: { current: boolean };\n readonly nodeSizes: Map<string, GraphViewSize>;\n readonly labelSizedNodeIds: Set<string>;\n readonly loopSizer: ReturnType<typeof createGraphLoopSizer>;\n readonly pendingInitialFitRef: { current: boolean };\n readonly readyRef: { current: boolean };\n readonly settledTopologyRef: { current: string | null };\n readonly relayoutScheduledRef: { current: boolean };\n readonly renderedNodeListeners: Set<RenderedNodeListener>;\n readonly resizeObserver: GraphResizeObserver | null;\n readonly unbindEvents: () => void;\n}\n\n/*** Create one Cytoscape runtime that exclusively owns layout, fit, resize, and disposal. */\nexport function createGraphRuntime(\n container: GraphContainer,\n callbacksRef: { current: GraphViewCallbacks },\n): GraphRuntime {\n const cy = cytoscape({\n container,\n elements: [],\n minZoom: 0.05,\n maxZoom: 2,\n selectionType: 'additive',\n userPanningEnabled: true,\n });\n const state = createRuntimeState(cy, container, callbacksRef);\n\n return {\n destroy: () => destroyRuntime(state),\n handleOverlayNodeEvent: (id, type) => handleOverlayNodeEvent(state, id, type),\n setNodeSize: (id, size) => setNodeSize(state, id, size),\n setSelectedNodeIds: (nodeIds) => setSelectedNodeIds(state, nodeIds),\n subscribeRenderedNodes: (listener) => subscribeRenderedNodes(state, listener),\n update: (input) => updateRuntime(state, input),\n };\n}\n\n/*** Build the mutable state shared by the single graph-runtime owner. */\nfunction createRuntimeState(\n cy: Core,\n container: GraphContainer,\n callbacksRef: { current: GraphViewCallbacks },\n): GraphRuntimeState {\n const fitPaddingRef = { current: 50 };\n const viewport = createGraphController(cy, fitPaddingRef, (options) =>\n requestOptimizedFit(state, options),\n );\n const { controller } = viewport;\n const layoutRunningRef = { current: false };\n const readyRef = { current: false };\n const renderedNodeListeners = new Set<RenderedNodeListener>();\n const stateBase = {\n fitRequestRef: { current: null as GraphViewFitOptions | null },\n optimizedSpacingRef: { current: null as number | null },\n callbacksRef,\n controller,\n viewport,\n cy,\n fitPaddingRef,\n generationRef: { current: 0 },\n geometryRef: { current: null as string | null },\n hoveredNodeIds: new Set<string>(),\n latestUpdateRef: { current: null as GraphRuntimeUpdate | null },\n layoutRef: { current: null as ReturnType<typeof runGraphLayout> | null },\n layoutRunningRef,\n nodeSizes: new Map<string, GraphViewSize>(),\n labelSizedNodeIds: new Set<string>(),\n loopSizer: createGraphLoopSizer(cy),\n pendingInitialFitRef: { current: false },\n readyRef,\n settledTopologyRef: { current: null as string | null },\n relayoutScheduledRef: { current: false },\n renderedNodeListeners,\n };\n const unbindEvents = bindGraphEvents(cy, callbacksRef, controller, () =>\n emitRenderedNodes(stateBase),\n );\n const resizeObserver = createGraphResizeObserver({\n container,\n cy,\n settleViewport: () => viewport.settle(true),\n layoutRunningRef,\n pendingInitialFitRef: stateBase.pendingInitialFitRef,\n onViewportSettled: (completedPendingInitialFit) => {\n emitRenderedNodes(stateBase);\n if (!completedPendingInitialFit || readyRef.current) return;\n readyRef.current = true;\n callbacksRef.current.onReady?.(controller);\n callbacksRef.current.onLayoutComplete?.(controller);\n },\n readyRef,\n });\n\n const state = { ...stateBase, resizeObserver, unbindEvents };\n return state;\n}\n\n/***\n * Reconcile presentation in place and relayout only when graph geometry or layout policy changes.\n * Batch reconciliation and skip layout for presentation-only updates.\n */\nfunction updateRuntime(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n if (state.cy.destroyed()) return;\n const last = state.latestUpdateRef.current;\n const acceptsSpacing =\n state.optimizedSpacingRef.current !== null &&\n state.optimizedSpacingRef.current === input.spacingFactor;\n const previous = acceptsSpacing && last ? { ...last, spacingFactor: input.spacingFactor } : last;\n if (acceptsSpacing) state.optimizedSpacingRef.current = null;\n state.latestUpdateRef.current = input;\n state.fitPaddingRef.current = input.fitPadding ?? 50;\n state.viewport.configure(input);\n state.cy.batch(() => {\n if (previous?.nodes !== input.nodes || previous.edges !== input.edges) {\n syncGraphElements(state.cy, input.nodes, input.edges);\n }\n if (\n previous?.styleRules !== input.styleRules ||\n previous?.richNodeRendering !== input.richNodeRendering\n ) {\n state.loopSizer.reset();\n applyGraphStyles(state.cy, input.styleRules, input.richNodeRendering);\n }\n });\n sizeGraphNodesToLabels(\n state.cy,\n state.labelSizedNodeIds,\n input.sizeNodesToLabels === true && !input.richNodeRendering,\n );\n applyKnownNodeSizes(state);\n state.loopSizer.update();\n const geometry = getGraphGeometryKey(state.cy);\n const relayout = geometry !== state.geometryRef.current || hasGraphLayoutChanged(previous, input);\n state.geometryRef.current = geometry;\n if (!relayout) {\n if (\n previous?.zoomMode !== input.zoomMode ||\n previous?.fitPadding !== input.fitPadding ||\n previous?.minZoom !== input.minZoom ||\n previous?.maxZoom !== input.maxZoom ||\n previous?.minReadableLabelSize !== input.minReadableLabelSize ||\n previous?.maxFitLabelSize !== input.maxFitLabelSize\n ) {\n state.viewport.settle(previous?.zoomMode !== input.zoomMode);\n }\n emitRenderedNodes(state);\n if (!state.layoutRunningRef.current && !state.pendingInitialFitRef.current)\n state.callbacksRef.current.onLayoutComplete?.(state.controller);\n return;\n }\n stopCurrentLayout(state);\n state.fitRequestRef.current = null;\n state.optimizedSpacingRef.current = null;\n startCurrentLayout(state, input);\n}\n\n/*** Start a generation-safe layout whose completion is the only normal automatic fit trigger. */\nfunction startCurrentLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n state.pendingInitialFitRef.current = false;\n const generation = state.generationRef.current + 1;\n state.generationRef.current = generation;\n state.layoutRunningRef.current = true;\n state.cy.resize();\n state.layoutRef.current = runGraphLayout(\n state.cy,\n {\n layout: input.layout ?? 'concentric',\n layoutOptions: input.layoutOptions,\n spacingFactor: input.spacingFactor ?? 1,\n },\n () => completeCurrentLayout(state, generation),\n );\n}\n\n/***\n * Settle only the latest layout generation and fit once from node bounds.\n * Discard stale completions and avoid repeated automatic fits.\n */\nfunction completeCurrentLayout(state: GraphRuntimeState, generation: number) {\n scheduleGraphFrame(() => {\n if (state.cy.destroyed() || generation !== state.generationRef.current) return;\n state.loopSizer.update();\n state.layoutRef.current = null;\n state.cy.resize();\n state.layoutRunningRef.current = false;\n if (!hasUsableViewport(state.cy)) {\n if (!state.readyRef.current) state.pendingInitialFitRef.current = true;\n return;\n }\n state.pendingInitialFitRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null) return;\n const topology = getGraphTopologyKey(input.nodes, input.edges);\n const shouldFit = shouldFitGraphAfterLayout(\n state.readyRef.current,\n topology !== state.settledTopologyRef.current,\n );\n state.viewport.settle(shouldFit);\n state.settledTopologyRef.current = topology;\n const fitRequest = state.fitRequestRef.current;\n state.fitRequestRef.current = null;\n if (fitRequest) requestOptimizedFit(state, fitRequest);\n emitRenderedNodes(state);\n\n if (!state.readyRef.current) {\n state.readyRef.current = true;\n state.callbacksRef.current.onReady?.(state.controller);\n }\n state.callbacksRef.current.onLayoutComplete?.(state.controller);\n });\n}\n\n/***\n * Handle explicit readable-fit intent in the runtime owner, never from zoom or React effects.\n * Bounded spacing optimization preserves the settled algorithm instead of repeatedly running it.\n */\nfunction requestOptimizedFit(state: GraphRuntimeState, options: GraphViewFitOptions) {\n if (state.cy.destroyed()) return;\n if (state.layoutRunningRef.current) {\n state.fitRequestRef.current = options;\n return;\n }\n const input = state.latestUpdateRef.current;\n if (!input) return;\n const previous = state.optimizedSpacingRef.current ?? input.spacingFactor ?? 1;\n const spacing = compactGraphSpacing(state.cy, previous);\n state.geometryRef.current = getGraphGeometryKey(state.cy);\n state.loopSizer.update();\n state.viewport.settle(false);\n state.controller.fit({ ...options, optimizeSpacing: false });\n if (spacing !== previous) {\n state.optimizedSpacingRef.current = spacing;\n state.callbacksRef.current.onSpacingFactorChange?.(spacing);\n }\n emitRenderedNodes(state);\n}\n\n/*** Stop the current layout and invalidate every stale completion callback. */\nfunction stopCurrentLayout(state: GraphRuntimeState) {\n state.generationRef.current += 1;\n state.layoutRunningRef.current = false;\n state.layoutRef.current?.stop();\n state.layoutRef.current = null;\n}\n\n/*** Apply consumer styles and hide native node paint only when React rich nodes are active. */\nfunction applyGraphStyles(\n cy: Core,\n rules: readonly GraphViewStyleRule[] | undefined,\n richNodeRendering: boolean,\n) {\n const styles = [...(rules ?? [])];\n if (richNodeRendering) {\n styles.push({\n selector: 'node',\n style: {\n 'background-opacity': 0,\n 'border-width': 0,\n label: '',\n 'overlay-opacity': 0,\n },\n });\n }\n if (styles.length > 0) cy.style(styles).update();\n}\n\n/***\n * Synchronize controlled selection without rerunning layout.\n * Selection updates must not trigger graph reconstruction or layout.\n */\nfunction setSelectedNodeIds(state: GraphRuntimeState, nodeIds: readonly string[] | undefined) {\n if (state.cy.destroyed() || nodeIds === undefined) return;\n const selectedIds = new Set(nodeIds);\n state.cy.nodes().forEach((node) => {\n if (selectedIds.has(node.id())) node.select();\n else node.unselect();\n });\n emitRenderedNodes(state);\n}\n\n/***\n * Persist one rich-node size and schedule at most one relayout for changed geometry.\n * Ignore unchanged measurements before scheduling layout work.\n */\nfunction setNodeSize(state: GraphRuntimeState, id: string, size: GraphViewSize) {\n const previous = state.nodeSizes.get(id);\n if (previous?.width === size.width && previous.height === size.height) return;\n state.nodeSizes.set(id, size);\n applyNodeSize(state.cy, id, size);\n scheduleMeasuredNodeRelayout(state);\n}\n\n/*** Apply every known rich-node size after Cytoscape elements are replaced. */\nfunction applyKnownNodeSizes(state: GraphRuntimeState) {\n for (const [id, size] of state.nodeSizes) applyNodeSize(state.cy, id, size);\n}\n\n/*** Apply one measured model-space size as a Cytoscape per-node style bypass. */\nfunction applyNodeSize(cy: Core, id: string, size: GraphViewSize) {\n const node = cy.getElementById(id);\n if (node.empty()) return;\n node.style({ height: size.height, width: size.width });\n}\n\n/***\n * Coalesce DOM measurements into one follow-up layout generation.\n * Keep one scheduled layout per frame instead of one per measured node.\n */\nfunction scheduleMeasuredNodeRelayout(state: GraphRuntimeState) {\n if (state.relayoutScheduledRef.current) return;\n state.relayoutScheduledRef.current = true;\n scheduleGraphFrame(() => {\n state.relayoutScheduledRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null || state.cy.destroyed()) return;\n stopCurrentLayout(state);\n startCurrentLayout(state, input);\n });\n}\n\n/*** Subscribe one React overlay to rendered node state without exposing the Cytoscape core. */\nfunction subscribeRenderedNodes(state: GraphRuntimeState, listener: RenderedNodeListener) {\n state.renderedNodeListeners.add(listener);\n listener(readGraphRenderedNodes(state.cy, state.hoveredNodeIds));\n return () => {\n state.renderedNodeListeners.delete(listener);\n };\n}\n\n/***\n * Publish current rendered node positions only to active rich-node subscribers.\n * Skip snapshot preparation when no overlay is subscribed.\n */\nfunction emitRenderedNodes(\n state: Pick<GraphRuntimeState, 'cy' | 'hoveredNodeIds' | 'renderedNodeListeners'>,\n) {\n if (state.renderedNodeListeners.size === 0) return;\n const nodes = readGraphRenderedNodes(state.cy, state.hoveredNodeIds);\n for (const listener of state.renderedNodeListeners) listener(nodes);\n}\n\n/*** Translate one rich-overlay event back into normal graph selection and callbacks. */\nfunction handleOverlayNodeEvent(\n state: GraphRuntimeState,\n id: string,\n type: GraphViewElementEventType,\n) {\n if (type === 'pointer-enter') state.hoveredNodeIds.add(id);\n if (type === 'pointer-leave') state.hoveredNodeIds.delete(id);\n if (type === 'press') state.cy.getElementById(id).select();\n state.callbacksRef.current.onNodeEvent?.({ id, type });\n emitRenderedNodes(state);\n}\n\n/*** Return whether Cytoscape currently has dimensions suitable for fitting. */\nfunction hasUsableViewport(cy: Core): boolean {\n return cy.width() > 0 && cy.height() > 0;\n}\n\n/*** Dispose all runtime resources in the reverse order they were acquired. */\nfunction destroyRuntime(state: GraphRuntimeState) {\n state.resizeObserver?.disconnect();\n stopCurrentLayout(state);\n state.unbindEvents();\n state.renderedNodeListeners.clear();\n if (!state.cy.destroyed()) state.cy.destroy();\n}\n\nregisterGraphLayouts();\n"]}
|
package/dist/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ElementDefinition } from 'cytoscape';
|
|
2
|
-
import type { GraphViewEdge, GraphViewNode } from '
|
|
2
|
+
import type { GraphViewEdge, GraphViewNode } from '../../../../../types/graph-view';
|
|
3
3
|
/*** Convert plain graph data into renderable Cytoscape elements without impossible compound edges. */
|
|
4
4
|
export declare function createRenderableGraphElements(nodes: readonly GraphViewNode[], edges: readonly GraphViewEdge[]): ElementDefinition[];
|
|
5
5
|
//# sourceMappingURL=createRenderableGraphElements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRenderableGraphElements.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"createRenderableGraphElements.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEpF,sGAAsG;AACtG,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,iBAAiB,EAAE,CAoBrB"}
|
package/dist/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRenderableGraphElements.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.ts"],"names":[],"mappings":"AAIA,sGAAsG;AACtG,MAAM,UAAU,6BAA6B,CAC3C,KAA+B,EAC/B,KAA+B;IAE/B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CACpF,CAAC;IACF,MAAM,YAAY,GAAwB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7D,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;QAC3B,IAAI,EAAE;YACJ,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;YACpB,EAA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AA8E;AAC9E,SAAS,UAAU,CACjB,gBAAwB,EACxB,MAAc,EACd,UAAuC;IAEvC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,IAAI,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACtD,IAAI,OAAO,KAAK,gBAAgB;YAAE,OAAO,IAAI,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { ElementDefinition } from 'cytoscape';\n\nimport type { GraphViewEdge, GraphViewNode } from '
|
|
1
|
+
{"version":3,"file":"createRenderableGraphElements.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createRenderableGraphElements.ts"],"names":[],"mappings":"AAIA,sGAAsG;AACtG,MAAM,UAAU,6BAA6B,CAC3C,KAA+B,EAC/B,KAA+B;IAE/B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CACpF,CAAC;IACF,MAAM,YAAY,GAAwB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7D,KAAK,EAAE,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M,IAAI,KAAK,EAAE;gBACxD,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB;SACF;KACF,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,SAAS,UAAU,CACjB,gBAAwB,EACxB,MAAc,EACd,UAAuC;IAEvC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,IAAI,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACtD,IAAI,OAAO,KAAK,gBAAgB;YAAE,OAAO,IAAI,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { ElementDefinition } from 'cytoscape';\n\nimport type { GraphViewEdge, GraphViewNode } from '../../../../../types/graph-view';\n\n/*** Convert plain graph data into renderable Cytoscape elements without impossible compound edges. */\nexport function createRenderableGraphElements(\n nodes: readonly GraphViewNode[],\n edges: readonly GraphViewEdge[],\n): ElementDefinition[] {\n const nodeIds = new Set(nodes.map((node) => node.id));\n const parentById = new Map(\n nodes.flatMap((node) => (node.parentId ? [[node.id, node.parentId] as const] : [])),\n );\n const nodeElements: ElementDefinition[] = nodes.map((node) => ({\n group: 'nodes',\n classes: node.classes ?? '',\n data: {\n ...(node.data ?? {}),\n id: node.id,\n label: node.label ?? node.id,\n parent: node.parentId,\n },\n }));\n const edgeElements = edges.flatMap((edge, index) =>\n createEdgeElement(edge, index, nodeIds, parentById),\n );\n\n return [...nodeElements, ...edgeElements];\n}\n\n/*** Build one edge unless one endpoint owns the other in the compound hierarchy. */\nfunction createEdgeElement(\n edge: GraphViewEdge,\n index: number,\n nodeIds: ReadonlySet<string>,\n parentById: ReadonlyMap<string, string>,\n): ElementDefinition[] {\n if (!nodeIds.has(edge.source) || !nodeIds.has(edge.target)) return [];\n if (isAncestor(edge.source, edge.target, parentById)) return [];\n if (isAncestor(edge.target, edge.source, parentById)) return [];\n\n return [\n {\n group: 'edges',\n classes: edge.classes ?? '',\n data: {\n ...(edge.data ?? {}),\n id: edge.id ?? `${edge.source}->${edge.target}:${index}`,\n source: edge.source,\n target: edge.target,\n },\n },\n ];\n}\n\n/*** Return whether a node appears in another node's compound parent chain. */\nfunction isAncestor(\n possibleAncestor: string,\n nodeId: string,\n parentById: ReadonlyMap<string, string>,\n): boolean {\n const visited = new Set<string>();\n let current = parentById.get(nodeId);\n\n while (current !== undefined && !visited.has(current)) {\n if (current === possibleAncestor) return true;\n visited.add(current);\n current = parentById.get(current);\n }\n\n return false;\n}\n"]}
|