@likec4/diagram 1.42.1 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +6198 -4860
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +15 -12
- package/dist/LikeC4Diagram.props.d.ts +28 -14
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4View.d.ts +28 -4
- package/dist/LikeC4View.js +28 -17
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/ReactLikeC4.js +5 -7
- package/dist/StaticLikeC4Diagram.js +2 -2
- package/dist/_virtual/_commonjsHelpers.js +3 -0
- package/dist/_virtual/assign-dea9f7c8.cjs.js +3 -0
- package/dist/_virtual/log-ec8d4df4.cjs.js +3 -0
- package/dist/_virtual/raise-da5b247f.cjs.js +3 -0
- package/dist/_virtual/xstate-actions.cjs.js +5 -0
- package/dist/_virtual/xstate-actions.cjs2.js +3 -0
- package/dist/_virtual/xstate-dev.cjs.js +3 -0
- package/dist/_virtual/xstate-guards.cjs.js +5 -0
- package/dist/_virtual/xstate-guards.cjs2.js +3 -0
- package/dist/base/Background.d.ts +2 -1
- package/dist/base/Background.js +11 -2
- package/dist/base/Base.d.ts +28 -0
- package/dist/base/BaseXYFlow.d.ts +5 -5
- package/dist/base/BaseXYFlow.js +38 -44
- package/dist/base/const.d.ts +1 -1
- package/dist/base/const.js +1 -1
- package/dist/base/index.d.ts +6 -2
- package/dist/base/types.d.ts +1 -28
- package/dist/base/updateEdges.js +4 -3
- package/dist/base/updateNodes.js +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -0
- package/dist/base-primitives/edge/EdgeLabel.d.ts +1 -0
- package/dist/base-primitives/edge/EdgeLabel.js +2 -0
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +4 -0
- package/dist/base-primitives/edge/EdgePath.d.ts +4 -0
- package/dist/base-primitives/edge/EdgePath.js +9 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +1 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +2 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- package/dist/base-primitives/element/ElementTags.js +2 -1
- package/dist/base-primitives/memoEdge.js +4 -2
- package/dist/base-primitives/memoNode.d.ts +1 -1
- package/dist/base-primitives/memoNode.js +3 -3
- package/dist/components/ErrorFallback.js +52 -35
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +2 -1
- package/dist/context/DiagramFeatures.d.ts +24 -6
- package/dist/context/DiagramFeatures.js +28 -56
- package/dist/context/IconRenderer.js +6 -6
- package/dist/context/LikeC4ModelContext.js +3 -10
- package/dist/context/TagStylesContext.js +2 -18
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +1 -1
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +4 -4
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/safeContext.d.ts +6 -3
- package/dist/hooks/safeContext.js +10 -3
- package/dist/hooks/useCallbackRef.d.ts +1 -0
- package/dist/hooks/useCallbackRef.js +13 -0
- package/dist/hooks/useCurrentView.d.ts +11 -0
- package/dist/hooks/{useCurrentViewId.js → useCurrentView.js} +7 -3
- package/dist/hooks/useCurrentViewModel.js +4 -1
- package/dist/hooks/useDiagram.d.ts +7 -113
- package/dist/hooks/useDiagram.js +7 -127
- package/dist/hooks/useDiagramCompareLayout.d.ts +35 -0
- package/dist/hooks/useDiagramCompareLayout.js +60 -0
- package/dist/hooks/useUpdateEffect.js +2 -4
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +4 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/likec4diagram/DiagramUI.js +14 -7
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +54 -51
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +249 -220
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +7 -2
- package/dist/likec4diagram/custom/edges/edges.css.js +3 -4
- package/dist/likec4diagram/custom/edges/useControlPoints.d.ts +8 -0
- package/dist/likec4diagram/custom/edges/useControlPoints.js +58 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +7 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +60 -0
- package/dist/likec4diagram/custom/edges/utils.d.ts +0 -12
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +4 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.js +15 -10
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +4 -0
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.js +46 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -1
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +13 -9
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +4 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +1 -11
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +7 -51
- package/dist/likec4diagram/custom/nodes/toolbar/types.d.ts +5 -0
- package/dist/likec4diagram/custom/nodes/toolbar/types.js +7 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.d.ts +8 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +44 -0
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +5 -7
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +3 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +96 -70
- package/dist/likec4diagram/state/assign.d.ts +4 -2
- package/dist/likec4diagram/state/assign.js +39 -103
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +90 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +113 -0
- package/dist/likec4diagram/state/diagram-api.js +134 -0
- package/dist/likec4diagram/state/hotkeyActor.d.ts +7 -0
- package/dist/likec4diagram/state/hotkeyActor.js +17 -1
- package/dist/likec4diagram/state/machine.actions.d.ts +2099 -0
- package/dist/likec4diagram/state/machine.actions.js +735 -0
- package/dist/likec4diagram/state/machine.d.ts +3717 -0
- package/dist/likec4diagram/state/machine.js +141 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +284 -0
- package/dist/likec4diagram/state/machine.setup.js +71 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +183 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +117 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +45 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3666 -0
- package/dist/likec4diagram/state/machine.state.ready.js +437 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +220 -63
- package/dist/likec4diagram/state/syncManualLayoutActor.js +218 -143
- package/dist/likec4diagram/state/types.d.ts +4 -7
- package/dist/likec4diagram/state/utils.d.ts +4 -2
- package/dist/likec4diagram/state/utils.js +4 -1
- package/dist/likec4diagram/types.d.ts +6 -1
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +2 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +66 -0
- package/dist/likec4diagram/ui/index.d.ts +1 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.js +10 -12
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +225 -54
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +15 -15
- package/dist/navigationpanel/NavigationPanel.js +11 -7
- package/dist/navigationpanel/NavigationPanelControls.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +23 -17
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +62 -42
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +4 -2
- package/dist/navigationpanel/actor.d.ts +11 -7
- package/dist/navigationpanel/actor.js +5 -4
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +59 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +2 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.js +42 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +60 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +5 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +38 -0
- package/dist/navigationpanel/comparepanel/index.d.ts +1 -0
- package/dist/navigationpanel/controls/{ViewDetailsCard.d.ts → DetailsControls.d.ts} +1 -1
- package/dist/navigationpanel/controls/{ViewDetailsCard.js → DetailsControls.js} +18 -14
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +2 -0
- package/dist/navigationpanel/controls/LayoutWarning.js +102 -0
- package/dist/navigationpanel/controls/NavigationButtons.js +4 -3
- package/dist/navigationpanel/controls/OpenSource.js +2 -2
- package/dist/navigationpanel/controls/SearchControl.d.ts +2 -1
- package/dist/navigationpanel/controls/SearchControl.js +15 -17
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +19 -16
- package/dist/navigationpanel/controls/index.d.ts +2 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -2
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +5 -5
- package/dist/navigationpanel/editorpanel/CenterCamera.js +5 -2
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +21 -20
- package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -2
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +16 -13
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +15 -0
- package/dist/navigationpanel/styles.css.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +4 -4
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +14 -8
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +10 -10
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +66 -49
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js +37 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dev/dist/xstate-dev.cjs.js +59 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js +140 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js +401 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js +2716 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js +26 -0
- package/dist/overlays/element-details/ElementDetails.js +7 -7
- package/dist/overlays/element-details/ElementDetailsCard.js +18 -88
- package/dist/overlays/element-details/MetadataValue.d.ts +9 -0
- package/dist/overlays/element-details/MetadataValue.js +261 -0
- package/dist/overlays/element-details/TabPanelDeployments.js +6 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +3 -2
- package/dist/overlays/overlaysActor.d.ts +304 -62
- package/dist/overlays/overlaysActor.js +132 -131
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/actor.d.ts +14 -2
- package/dist/overlays/relationship-details/actor.js +23 -5
- package/dist/overlays/relationship-details/custom/ElementActions.js +8 -5
- package/dist/overlays/relationship-details/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationship-details/hooks.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -4
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.d.ts +239 -173
- package/dist/overlays/relationships-browser/actor.js +132 -110
- package/dist/overlays/relationships-browser/const.d.ts +3 -3
- package/dist/overlays/relationships-browser/const.js +3 -3
- package/dist/overlays/relationships-browser/custom/ElementActions.js +44 -37
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationships-browser/hooks.js +7 -6
- package/dist/search/Search.js +2 -1
- package/dist/search/components/ElementsColumn.js +5 -3
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +21 -44
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +6 -4
- package/dist/shadowroot/ShadowRoot.js +53 -12
- package/dist/shadowroot/styles.css.d.ts +0 -4
- package/dist/shadowroot/styles.css.js +1 -41
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +78 -21
- package/dist/utils/vector.js +91 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +57 -0
- package/dist/utils/xyflow.d.ts +49 -7
- package/dist/utils/xyflow.js +63 -11
- package/package.json +28 -27
- package/panda.buildinfo.json +140 -83
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/hooks/useCurrentViewId.d.ts +0 -6
- package/dist/likec4diagram/custom/edges/utils.js +0 -23
- package/dist/likec4diagram/state/diagram-machine.d.ts +0 -2590
- package/dist/likec4diagram/state/diagram-machine.js +0 -1180
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +0 -1
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +0 -56
- package/dist/utils/get-view-bounds.d.ts +0 -3
- package/dist/utils/get-view-bounds.js +0 -14
- /package/dist/base/{types.js → Base.js} +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { nonNullable, invariant, delay } from '@likec4/core/utils';
|
|
2
2
|
import { applyEdgeChanges, applyNodeChanges } from '@xyflow/react';
|
|
3
3
|
import { getViewportForBounds } from '@xyflow/system';
|
|
4
|
-
import {
|
|
5
|
-
import { setup, assign,
|
|
4
|
+
import { hasAtLeast, omit, isNullish } from 'remeda';
|
|
5
|
+
import { setup, assign, enqueueActions, cancel, raise, fromPromise, assertEvent } from 'xstate';
|
|
6
6
|
import { MinZoom, ZIndexes } from '../../base/const.js';
|
|
7
7
|
import { updateEdges } from '../../base/updateEdges.js';
|
|
8
8
|
import { updateNodes } from '../../base/updateNodes.js';
|
|
9
9
|
import { typedSystem } from '../../likec4diagram/state/utils.js';
|
|
10
|
+
import { getNodeCenter } from '../../utils/xyflow.js';
|
|
10
11
|
import { ViewPadding } from './const.js';
|
|
11
12
|
import { viewToNodesEdge } from './useViewToNodesEdges.js';
|
|
12
|
-
import { Base } from '../../base/
|
|
13
|
-
import { centerXYInternalNode } from '../../utils/xyflow.js';
|
|
13
|
+
import { Base } from '../../base/Base.js';
|
|
14
14
|
|
|
15
15
|
const findRootSubject = (nodes) => nodes.find(
|
|
16
16
|
(n) => n.data.column === "subjects" && isNullish(n.parentId)
|
|
@@ -54,7 +54,7 @@ const layouter = fromPromise(async ({ input, self, signal }) => {
|
|
|
54
54
|
y: nextSubjectNode.position.y + (nextSubjectNode.initialHeight ?? 0) / 2
|
|
55
55
|
};
|
|
56
56
|
const currentSubjectInternalNode = xyflow.getInternalNode(currentSubjectNode.id);
|
|
57
|
-
const currentSubjectCenter =
|
|
57
|
+
const currentSubjectCenter = getNodeCenter(currentSubjectInternalNode);
|
|
58
58
|
const nested = /* @__PURE__ */ new Set();
|
|
59
59
|
currentNodes.forEach((n) => {
|
|
60
60
|
if (n.id === existingNode.id) {
|
|
@@ -108,17 +108,20 @@ const layouter = fromPromise(async ({ input, self, signal }) => {
|
|
|
108
108
|
if (signal.aborted) {
|
|
109
109
|
return updateXYData();
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
const duration = 300;
|
|
112
|
+
xyflow.setCenter(currentSubjectCenter.x, currentSubjectCenter.y, { zoom, duration, interpolate: "smooth" });
|
|
113
|
+
await delay(duration);
|
|
112
114
|
await xyflow.setCenter(nextSubjectCenter.x, nextSubjectCenter.y, { zoom });
|
|
113
115
|
return updateXYData();
|
|
114
116
|
});
|
|
115
|
-
const
|
|
117
|
+
const machine = setup({
|
|
116
118
|
types: {
|
|
117
119
|
context: {},
|
|
118
120
|
tags: "",
|
|
119
121
|
children: {},
|
|
120
122
|
input: {},
|
|
121
123
|
events: {}
|
|
124
|
+
// emitted: {} as EmittedEvents,
|
|
122
125
|
},
|
|
123
126
|
actors: {
|
|
124
127
|
layouter
|
|
@@ -133,73 +136,93 @@ const _relationshipsBrowserLogic = setup({
|
|
|
133
136
|
}
|
|
134
137
|
return false;
|
|
135
138
|
}
|
|
136
|
-
},
|
|
137
|
-
actions: {
|
|
138
|
-
"xyflow.init": assign(({ event }) => {
|
|
139
|
-
assertEvent(event, "xyflow.init");
|
|
140
|
-
return {
|
|
141
|
-
xyflow: event.instance,
|
|
142
|
-
xystore: event.store
|
|
143
|
-
};
|
|
144
|
-
}),
|
|
145
|
-
"update.view": assign(({ event }) => {
|
|
146
|
-
assertEvent(event, "update.view");
|
|
147
|
-
return {
|
|
148
|
-
layouted: event.layouted,
|
|
149
|
-
...viewToNodesEdge(event.layouted)
|
|
150
|
-
};
|
|
151
|
-
}),
|
|
152
|
-
"xyflow:updateNodeInternals": ({ context }) => {
|
|
153
|
-
invariant(context.xystore, "xystore is not initialized");
|
|
154
|
-
const { domNode, updateNodeInternals } = context.xystore.getState();
|
|
155
|
-
const nodeIds = new Set(context.xyedges.flatMap((e) => [e.source, e.target]));
|
|
156
|
-
if (nodeIds.size === 0 || !domNode) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const updates = /* @__PURE__ */ new Map();
|
|
160
|
-
for (const updateId of nodeIds) {
|
|
161
|
-
const nodeElement = domNode.querySelector(`.react-flow__node[data-id="${updateId}"]`);
|
|
162
|
-
if (nodeElement) {
|
|
163
|
-
updates.set(updateId, { id: updateId, nodeElement, force: true });
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
updateNodeInternals(updates, { triggerFitView: false });
|
|
167
|
-
},
|
|
168
|
-
"xyflow:fitDiagram": ({ context }, params) => {
|
|
169
|
-
let { duration, bounds } = params ?? {};
|
|
170
|
-
duration ??= 450;
|
|
171
|
-
const { xyflow, xystore } = context;
|
|
172
|
-
invariant(xyflow, "xyflow is not initialized");
|
|
173
|
-
invariant(xystore, "xystore is not initialized");
|
|
174
|
-
bounds ??= context.layouted?.bounds;
|
|
175
|
-
const maxZoom = Math.max(xyflow.getZoom(), 1);
|
|
176
|
-
if (bounds) {
|
|
177
|
-
const { width, height } = xystore.getState();
|
|
178
|
-
const viewport = getViewportForBounds(bounds, width, height, MinZoom, maxZoom, ViewPadding);
|
|
179
|
-
xyflow.setViewport(viewport, duration > 0 ? { duration } : void 0).catch(console.error);
|
|
180
|
-
} else {
|
|
181
|
-
xyflow.fitView({
|
|
182
|
-
minZoom: MinZoom,
|
|
183
|
-
maxZoom,
|
|
184
|
-
padding: ViewPadding,
|
|
185
|
-
...duration > 0 && { duration }
|
|
186
|
-
}).catch(console.error);
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
"xyflow.applyNodeChanges": assign(({ context, event }) => {
|
|
190
|
-
assertEvent(event, "xyflow.applyNodeChanges");
|
|
191
|
-
return {
|
|
192
|
-
xynodes: applyNodeChanges(event.changes, context.xynodes)
|
|
193
|
-
};
|
|
194
|
-
}),
|
|
195
|
-
"xyflow.applyEdgeChanges": assign(({ context, event }) => {
|
|
196
|
-
assertEvent(event, "xyflow.applyEdgeChanges");
|
|
197
|
-
return {
|
|
198
|
-
xyedges: applyEdgeChanges(event.changes, context.xyedges)
|
|
199
|
-
};
|
|
200
|
-
})
|
|
201
139
|
}
|
|
202
|
-
})
|
|
140
|
+
});
|
|
141
|
+
const xyflowInit = () => machine.assign(({ event }) => {
|
|
142
|
+
assertEvent(event, "xyflow.init");
|
|
143
|
+
return {
|
|
144
|
+
xyflow: event.instance,
|
|
145
|
+
xystore: event.store
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
const updateView = () => machine.assign(({ event }) => {
|
|
149
|
+
assertEvent(event, "update.view");
|
|
150
|
+
return {
|
|
151
|
+
layouted: event.layouted,
|
|
152
|
+
...viewToNodesEdge(event.layouted)
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
const xyflowUpdateNodeInternals = () => machine.createAction(({ context }) => {
|
|
156
|
+
invariant(context.xystore, "xystore is not initialized");
|
|
157
|
+
const { domNode, updateNodeInternals } = context.xystore.getState();
|
|
158
|
+
const nodeIds = new Set(context.xyedges.flatMap((e) => [e.source, e.target]));
|
|
159
|
+
if (nodeIds.size === 0 || !domNode) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const updates = /* @__PURE__ */ new Map();
|
|
163
|
+
const domNodes = domNode.querySelectorAll(".react-flow__node");
|
|
164
|
+
for (const nodeElement of domNodes) {
|
|
165
|
+
const nodeId = nodeElement.getAttribute("data-id");
|
|
166
|
+
if (nodeId && nodeIds.has(nodeId)) {
|
|
167
|
+
updates.set(nodeId, { id: nodeId, nodeElement, force: true });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
updateNodeInternals(updates, { triggerFitView: false });
|
|
171
|
+
});
|
|
172
|
+
const xyflowFitDiagram = (params) => machine.createAction(({ context, event }) => {
|
|
173
|
+
params ??= event.type === "fitDiagram" ? event : {};
|
|
174
|
+
let { duration, bounds } = params ?? {};
|
|
175
|
+
duration ??= 450;
|
|
176
|
+
const { xyflow, xystore } = context;
|
|
177
|
+
invariant(xyflow, "xyflow is not initialized");
|
|
178
|
+
invariant(xystore, "xystore is not initialized");
|
|
179
|
+
bounds ??= context.layouted?.bounds;
|
|
180
|
+
const maxZoom = Math.max(xyflow.getZoom(), 1);
|
|
181
|
+
if (bounds) {
|
|
182
|
+
const { width, height } = xystore.getState();
|
|
183
|
+
const viewport = getViewportForBounds(bounds, width, height, MinZoom, maxZoom, ViewPadding);
|
|
184
|
+
xyflow.setViewport(viewport, duration > 0 ? { duration, interpolate: "smooth" } : void 0).catch(
|
|
185
|
+
console.error
|
|
186
|
+
);
|
|
187
|
+
} else {
|
|
188
|
+
xyflow.fitView({
|
|
189
|
+
minZoom: MinZoom,
|
|
190
|
+
maxZoom,
|
|
191
|
+
padding: ViewPadding,
|
|
192
|
+
...duration > 0 && { duration, interpolate: "smooth" }
|
|
193
|
+
}).catch(console.error);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
const xyflowApplyNodeChanges = () => machine.assign(({ context, event }) => {
|
|
197
|
+
assertEvent(event, "xyflow.applyNodeChanges");
|
|
198
|
+
return {
|
|
199
|
+
xynodes: applyNodeChanges(event.changes, context.xynodes)
|
|
200
|
+
};
|
|
201
|
+
});
|
|
202
|
+
const xyflowApplyEdgeChanges = () => machine.assign(({ context, event }) => {
|
|
203
|
+
assertEvent(event, "xyflow.applyEdgeChanges");
|
|
204
|
+
return {
|
|
205
|
+
xyedges: applyEdgeChanges(event.changes, context.xyedges)
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
const openRelationshipSource = () => machine.enqueueActions(({ system, event }) => {
|
|
209
|
+
if (event.type !== "xyflow.edgeClick") {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const diagramActor = typedSystem(system).diagramActorRef;
|
|
213
|
+
const relations = event.edge.data.relations;
|
|
214
|
+
if (hasAtLeast(relations, 1)) {
|
|
215
|
+
diagramActor.send({ type: "open.source", relation: relations[0] });
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
const dispose = () => machine.assign({
|
|
219
|
+
xyflow: null,
|
|
220
|
+
layouted: null,
|
|
221
|
+
xystore: null,
|
|
222
|
+
xyedges: [],
|
|
223
|
+
xynodes: []
|
|
224
|
+
});
|
|
225
|
+
const _relationshipsBrowserLogic = machine.createMachine({
|
|
203
226
|
id: "relationships-browser",
|
|
204
227
|
context: ({ input }) => ({
|
|
205
228
|
subject: input.subject,
|
|
@@ -218,21 +241,21 @@ const _relationshipsBrowserLogic = setup({
|
|
|
218
241
|
initial: "initializing",
|
|
219
242
|
on: {
|
|
220
243
|
"xyflow.applyNodeChanges": {
|
|
221
|
-
actions:
|
|
244
|
+
actions: xyflowApplyNodeChanges()
|
|
222
245
|
},
|
|
223
246
|
"xyflow.applyEdgeChanges": {
|
|
224
|
-
actions:
|
|
247
|
+
actions: xyflowApplyEdgeChanges()
|
|
225
248
|
}
|
|
226
249
|
},
|
|
227
250
|
states: {
|
|
228
251
|
initializing: {
|
|
229
252
|
on: {
|
|
230
253
|
"xyflow.init": {
|
|
231
|
-
actions:
|
|
254
|
+
actions: xyflowInit(),
|
|
232
255
|
target: "isReady"
|
|
233
256
|
},
|
|
234
257
|
"update.view": {
|
|
235
|
-
actions:
|
|
258
|
+
actions: updateView(),
|
|
236
259
|
target: "isReady"
|
|
237
260
|
},
|
|
238
261
|
"stop": "closed",
|
|
@@ -243,7 +266,7 @@ const _relationshipsBrowserLogic = setup({
|
|
|
243
266
|
always: [{
|
|
244
267
|
guard: "isReady",
|
|
245
268
|
actions: [
|
|
246
|
-
{
|
|
269
|
+
xyflowFitDiagram({ duration: 0 }),
|
|
247
270
|
raise({ type: "xyflow.updateNodeInternals" }, { delay: 150 })
|
|
248
271
|
],
|
|
249
272
|
target: "active"
|
|
@@ -267,19 +290,26 @@ const _relationshipsBrowserLogic = setup({
|
|
|
267
290
|
}
|
|
268
291
|
})
|
|
269
292
|
},
|
|
270
|
-
"xyflow.edgeClick":
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
293
|
+
"xyflow.edgeClick": [
|
|
294
|
+
{
|
|
295
|
+
guard: "hasViewId",
|
|
296
|
+
actions: enqueueActions(({ event, context, system, enqueue }) => {
|
|
297
|
+
if (event.edge.selected || event.edge.data.relations.length > 1) {
|
|
298
|
+
enqueue.sendTo(typedSystem(system).overlaysActorRef, {
|
|
299
|
+
type: "open.relationshipDetails",
|
|
300
|
+
viewId: context.viewId,
|
|
301
|
+
source: event.edge.data.sourceFqn,
|
|
302
|
+
target: event.edge.data.targetFqn
|
|
303
|
+
});
|
|
304
|
+
} else {
|
|
305
|
+
enqueue(openRelationshipSource());
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
actions: openRelationshipSource()
|
|
311
|
+
}
|
|
312
|
+
],
|
|
283
313
|
"navigate.to": {
|
|
284
314
|
actions: [
|
|
285
315
|
assign({
|
|
@@ -290,10 +320,10 @@ const _relationshipsBrowserLogic = setup({
|
|
|
290
320
|
]
|
|
291
321
|
},
|
|
292
322
|
"xyflow.paneDblClick": {
|
|
293
|
-
actions:
|
|
323
|
+
actions: xyflowFitDiagram()
|
|
294
324
|
},
|
|
295
325
|
"update.view": {
|
|
296
|
-
actions:
|
|
326
|
+
actions: updateView(),
|
|
297
327
|
target: ".layouting"
|
|
298
328
|
},
|
|
299
329
|
"change.scope": {
|
|
@@ -302,13 +332,10 @@ const _relationshipsBrowserLogic = setup({
|
|
|
302
332
|
})
|
|
303
333
|
},
|
|
304
334
|
"xyflow.updateNodeInternals": {
|
|
305
|
-
actions:
|
|
335
|
+
actions: xyflowUpdateNodeInternals()
|
|
306
336
|
},
|
|
307
337
|
"fitDiagram": {
|
|
308
|
-
actions:
|
|
309
|
-
type: "xyflow:fitDiagram",
|
|
310
|
-
params: prop("event")
|
|
311
|
-
}
|
|
338
|
+
actions: xyflowFitDiagram()
|
|
312
339
|
},
|
|
313
340
|
"xyflow.resized": {
|
|
314
341
|
actions: [
|
|
@@ -317,7 +344,7 @@ const _relationshipsBrowserLogic = setup({
|
|
|
317
344
|
]
|
|
318
345
|
},
|
|
319
346
|
"xyflow.init": {
|
|
320
|
-
actions:
|
|
347
|
+
actions: xyflowInit()
|
|
321
348
|
},
|
|
322
349
|
"xyflow.unmount": {
|
|
323
350
|
target: "initializing"
|
|
@@ -409,8 +436,8 @@ const _relationshipsBrowserLogic = setup({
|
|
|
409
436
|
navigateFromNode: null
|
|
410
437
|
});
|
|
411
438
|
enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 50 });
|
|
412
|
-
for (let i =
|
|
413
|
-
enqueue.raise({ type: "xyflow.updateNodeInternals" }, { delay:
|
|
439
|
+
for (let i = 1; i < 8; i++) {
|
|
440
|
+
enqueue.raise({ type: "xyflow.updateNodeInternals" }, { delay: 120 + i * 75 });
|
|
414
441
|
}
|
|
415
442
|
})
|
|
416
443
|
}
|
|
@@ -434,16 +461,11 @@ const _relationshipsBrowserLogic = setup({
|
|
|
434
461
|
},
|
|
435
462
|
closed: {
|
|
436
463
|
id: "closed",
|
|
437
|
-
type: "final"
|
|
464
|
+
type: "final",
|
|
465
|
+
entry: dispose()
|
|
438
466
|
}
|
|
439
467
|
},
|
|
440
|
-
exit:
|
|
441
|
-
xyflow: null,
|
|
442
|
-
layouted: null,
|
|
443
|
-
xystore: null,
|
|
444
|
-
xyedges: [],
|
|
445
|
-
xynodes: []
|
|
446
|
-
})
|
|
468
|
+
exit: dispose()
|
|
447
469
|
});
|
|
448
470
|
const relationshipsBrowserLogic = _relationshipsBrowserLogic;
|
|
449
471
|
|
|
@@ -1,51 +1,58 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
2
3
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
3
|
-
import { useCurrentViewId } from '../../../hooks/
|
|
4
|
-
import
|
|
4
|
+
import { useCurrentViewId } from '../../../hooks/useCurrentView.js';
|
|
5
|
+
import '@xstate/react';
|
|
6
|
+
import 'fast-equals';
|
|
7
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
5
8
|
import { useRelationshipsBrowser, useRelationshipsBrowserState } from '../hooks.js';
|
|
9
|
+
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
10
|
+
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
11
|
+
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
6
12
|
import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
|
|
7
|
-
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
8
|
-
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
9
|
-
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
10
13
|
|
|
14
|
+
const selectSubject = (state) => state.context.subject;
|
|
11
15
|
const ElementActions = (props) => {
|
|
12
16
|
const { enableNavigateTo, enableVscode } = useEnabledFeatures();
|
|
13
17
|
const diagram = useDiagram();
|
|
14
18
|
const currentViewId = useCurrentViewId();
|
|
15
19
|
const browser = useRelationshipsBrowser();
|
|
16
|
-
const subject = useRelationshipsBrowserState(
|
|
17
|
-
const buttons = [];
|
|
20
|
+
const subject = useRelationshipsBrowserState(selectSubject);
|
|
18
21
|
const { navigateTo, fqn } = props.data;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
22
|
+
const buttons = useMemo(() => {
|
|
23
|
+
const buttons2 = [];
|
|
24
|
+
if (navigateTo && enableNavigateTo && currentViewId !== navigateTo) {
|
|
25
|
+
buttons2.push({
|
|
26
|
+
key: "navigate",
|
|
27
|
+
icon: /* @__PURE__ */ jsx(IconZoomScan, {}),
|
|
28
|
+
onClick: (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
diagram.navigateTo(navigateTo);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (fqn !== subject) {
|
|
35
|
+
buttons2.push({
|
|
36
|
+
key: "relationships",
|
|
37
|
+
icon: /* @__PURE__ */ jsx(IconTransform, {}),
|
|
38
|
+
onClick: (e) => {
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
browser.navigateTo(fqn, props.id);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (enableVscode) {
|
|
45
|
+
buttons2.push({
|
|
46
|
+
key: "goToSource",
|
|
47
|
+
icon: /* @__PURE__ */ jsx(IconFileSymlink, {}),
|
|
48
|
+
onClick: (e) => {
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
diagram.openSource({ element: fqn });
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return buttons2;
|
|
55
|
+
}, [navigateTo, enableNavigateTo, currentViewId, fqn, subject, enableVscode, diagram, browser, props.id]);
|
|
49
56
|
return /* @__PURE__ */ jsx(
|
|
50
57
|
ElementActionButtons,
|
|
51
58
|
{
|
|
@@ -2,7 +2,10 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { css } from '@likec4/styles/css';
|
|
3
3
|
import { Tooltip } from '@mantine/core';
|
|
4
4
|
import { getBezierPath } from '@xyflow/system';
|
|
5
|
-
import
|
|
5
|
+
import '@xstate/react';
|
|
6
|
+
import 'fast-equals';
|
|
7
|
+
import 'react';
|
|
8
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
6
9
|
import { useRelationshipsBrowser } from '../hooks.js';
|
|
7
10
|
import { memoEdge } from '../../../base-primitives/memoEdge.js';
|
|
8
11
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Handle, Position } from '@xyflow/react';
|
|
3
3
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
4
|
-
import
|
|
4
|
+
import '@xstate/react';
|
|
5
|
+
import 'fast-equals';
|
|
6
|
+
import 'react';
|
|
7
|
+
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
5
8
|
import { ElementActions } from './ElementActions.js';
|
|
6
9
|
import { CompoundNodeContainer } from '../../../base-primitives/compound/CompoundNodeContainer.js';
|
|
7
10
|
import { CompoundTitle } from '../../../base-primitives/compound/CompoundTitle.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { nonNullable } from '@likec4/core';
|
|
2
|
-
import { useCallbackRef } from '@mantine/hooks';
|
|
3
2
|
import { useSelector } from '@xstate/react';
|
|
4
3
|
import { shallowEqual } from 'fast-equals';
|
|
5
4
|
import { createContext, useMemo, useContext } from 'react';
|
|
@@ -10,7 +9,7 @@ function useRelationshipsBrowserActor() {
|
|
|
10
9
|
}
|
|
11
10
|
function useRelationshipsBrowserState(selector, compare = shallowEqual) {
|
|
12
11
|
const actor = useRelationshipsBrowserActor();
|
|
13
|
-
return useSelector(actor,
|
|
12
|
+
return useSelector(actor, selector, compare);
|
|
14
13
|
}
|
|
15
14
|
function useRelationshipsBrowser() {
|
|
16
15
|
const actor = useRelationshipsBrowserActor();
|
|
@@ -22,10 +21,12 @@ function useRelationshipsBrowser() {
|
|
|
22
21
|
getState: () => actor.getSnapshot().context,
|
|
23
22
|
send: actor.send,
|
|
24
23
|
updateView: (layouted) => {
|
|
25
|
-
actor.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
if (actor.getSnapshot().status === "active") {
|
|
25
|
+
actor.send({
|
|
26
|
+
type: "update.view",
|
|
27
|
+
layouted
|
|
28
|
+
});
|
|
29
|
+
}
|
|
29
30
|
},
|
|
30
31
|
changeScope: (scope) => {
|
|
31
32
|
actor.send({
|
package/dist/search/Search.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { css } from '@likec4/styles/css';
|
|
3
3
|
import { Box, VStack } from '@likec4/styles/jsx';
|
|
4
4
|
import { Group, Grid, GridCol, Title, ScrollArea } from '@mantine/core';
|
|
5
|
-
import {
|
|
5
|
+
import { useHotkeys } from '@mantine/hooks';
|
|
6
6
|
import { useTimeoutEffect } from '@react-hookz/web';
|
|
7
7
|
import { useSelector } from '@xstate/react';
|
|
8
8
|
import { AnimatePresence, LayoutGroup } from 'motion/react';
|
|
@@ -11,6 +11,7 @@ import { ErrorBoundary } from 'react-error-boundary';
|
|
|
11
11
|
import { isTruthy } from 'remeda';
|
|
12
12
|
import { ErrorFallback } from '../components/ErrorFallback.js';
|
|
13
13
|
import { DiagramFeatures } from '../context/DiagramFeatures.js';
|
|
14
|
+
import { useCallbackRef } from '../hooks/useCallbackRef.js';
|
|
14
15
|
import { Overlay } from '../overlays/overlay/Overlay.js';
|
|
15
16
|
import { ElementsColumn } from './components/ElementsColumn.js';
|
|
16
17
|
import { PickView } from './components/PickView.js';
|
|
@@ -2,12 +2,14 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { ifilter, sortParentsFirst, isAncestor, nameFromFqn } from '@likec4/core/utils';
|
|
3
3
|
import { cx } from '@likec4/styles/css';
|
|
4
4
|
import { useTree, Tree, ActionIcon, UnstyledButton, Box, Group, Highlight, Tooltip, Text } from '@mantine/core';
|
|
5
|
-
import { useCallbackRef } from '@mantine/hooks';
|
|
6
5
|
import * as m from 'motion/react-m';
|
|
7
6
|
import { memo, useMemo, useEffect } from 'react';
|
|
8
7
|
import { isEmpty, pipe, reduce, only, first } from 'remeda';
|
|
9
8
|
import { IconOrShapeRenderer } from '../../context/IconRenderer.js';
|
|
10
|
-
import {
|
|
9
|
+
import { useCallbackRef } from '../../hooks/useCallbackRef.js';
|
|
10
|
+
import '@xstate/react';
|
|
11
|
+
import 'fast-equals';
|
|
12
|
+
import { useDiagram } from '../../hooks/safeContext.js';
|
|
11
13
|
import { sortByLabel } from '../../hooks/useLikeC4ElementsTree.js';
|
|
12
14
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
13
15
|
import { useNormalizedSearch, useSearchActor } from '../hooks.js';
|
|
@@ -15,7 +17,7 @@ import { focusable, buttonsva } from './_shared.css.js';
|
|
|
15
17
|
import { treeSubtree, treeLabel, treeRoot, treeNode, elementIcon, elementExpandIcon, elementTitleAndId, elementId, elementViewsCount } from './ElementsColumn.css.js';
|
|
16
18
|
import { stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
|
|
17
19
|
import { NothingFound } from './ViewsColum.js';
|
|
18
|
-
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
20
|
+
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
19
21
|
|
|
20
22
|
const btn = buttonsva();
|
|
21
23
|
const ElementsColumn = memo(() => {
|
|
@@ -6,7 +6,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
|
6
6
|
import { useSearchActor } from '../hooks.js';
|
|
7
7
|
import { pickviewBackdrop, pickview, pickviewGroup } from './styles.css.js';
|
|
8
8
|
import { ViewButton } from './ViewsColum.js';
|
|
9
|
-
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
9
|
+
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
10
10
|
|
|
11
11
|
function PickView({ elementFqn }) {
|
|
12
12
|
const searchActorRef = useSearchActor();
|