@likec4/diagram 1.47.0 → 1.48.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/LICENSE +1 -1
- package/README.md +1 -1
- package/bundle/index.js +5489 -4909
- package/dist/LikeC4Diagram.js +18 -12
- package/dist/LikeC4Diagram.props.d.ts +1 -5
- package/dist/LikeC4ProjectsProvider.js +7 -5
- package/dist/LikeC4Styles.d.ts +2 -6
- package/dist/LikeC4Styles.js +44 -43
- package/dist/LikeC4View.d.ts +9 -1
- package/dist/LikeC4View.js +10 -8
- package/dist/ReactLikeC4.d.ts +12 -2
- package/dist/ReactLikeC4.js +5 -3
- package/dist/adhoc-editor/ActorProvider.d.ts +7 -0
- package/dist/adhoc-editor/ActorProvider.js +41 -0
- package/dist/adhoc-editor/EditorNavigationPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorNavigationPanel.js +32 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +4 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +71 -0
- package/dist/adhoc-editor/SelectElementOverlay.d.ts +1 -0
- package/dist/adhoc-editor/SelectElementOverlay.js +124 -0
- package/dist/adhoc-editor/actor.d.ts +131 -0
- package/dist/adhoc-editor/actor.editor.d.ts +54 -0
- package/dist/adhoc-editor/actor.editor.js +96 -0
- package/dist/adhoc-editor/actor.js +20 -0
- package/dist/adhoc-editor/actor.layouter.d.ts +48 -0
- package/dist/adhoc-editor/actor.layouter.js +66 -0
- package/dist/adhoc-editor/actor.types.d.ts +57 -0
- package/dist/adhoc-editor/actor.types.js +22 -0
- package/dist/adhoc-editor/hooks.d.ts +14 -0
- package/dist/adhoc-editor/hooks.js +47 -0
- package/dist/adhoc-editor/index.d.ts +2 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +6 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +104 -0
- package/dist/base/const.d.ts +1 -0
- package/dist/base/const.js +2 -1
- package/dist/base/updateEdges.js +26 -3
- package/dist/base/updateNodes.js +8 -5
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/Markdown.js +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +4 -2
- package/dist/base-primitives/NodeHandles.js +46 -19
- package/dist/base-primitives/compound/CompoundActionButton.js +3 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +3 -1
- package/dist/base-primitives/compound/CompoundNodeContainer.js +6 -4
- package/dist/base-primitives/compound/CompoundTitle.js +1 -2
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +5 -2
- package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -1
- package/dist/base-primitives/element/ElementActionButtons.js +31 -58
- package/dist/base-primitives/element/ElementData.d.ts +7 -7
- package/dist/base-primitives/element/ElementData.js +61 -48
- package/dist/base-primitives/element/ElementDetailsButton.js +2 -1
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +2 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +1 -0
- package/dist/base-primitives/element/ElementTags.d.ts +6 -2
- package/dist/base-primitives/element/ElementTags.js +55 -32
- package/dist/base-primitives/index.d.ts +1 -1
- package/dist/base-primitives/memoEdge.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -2
- package/dist/components/Logo.js +1 -1
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +9 -28
- package/dist/components/RootContainer.js +5 -8
- package/dist/context/DefaultMantineProvider.d.ts +2 -0
- package/dist/context/DefaultMantineProvider.js +66 -0
- package/dist/context/DiagramFeatures.js +12 -11
- package/dist/context/EnsureMantine.d.ts +0 -3
- package/dist/context/EnsureMantine.js +3 -4
- package/dist/context/IconRenderer.d.ts +14 -0
- package/dist/context/IconRenderer.js +8 -8
- package/dist/context/TagStylesContext.js +12 -4
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +2 -2
- package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
- package/dist/editor/LikeC4EditorCallbacks.js +5 -0
- package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
- package/dist/editor/LikeC4EditorProvider.js +2 -2
- package/dist/editor/applyChangesToManualLayout.js +1 -0
- package/dist/editor/editorActor.actions.d.ts +25 -25
- package/dist/editor/editorActor.actions.js +2 -2
- package/dist/editor/editorActor.setup.d.ts +84 -0
- package/dist/editor/editorActor.setup.js +38 -0
- package/dist/editor/editorActor.states.d.ts +9 -0
- package/dist/editor/{editorActor.js → editorActor.states.js} +22 -64
- package/dist/editor/index.d.ts +4 -3
- package/dist/editor/useEditorActorLogic.d.ts +2 -564
- package/dist/editor/useEditorActorLogic.js +8 -12
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useCallbackRef.d.ts +6 -0
- package/dist/hooks/useCurrentViewModel.d.ts +10 -0
- package/dist/hooks/useDiagram.js +2 -2
- package/dist/hooks/useDiagramCompareLayout.d.ts +1 -1
- package/dist/hooks/useDiagramCompareLayout.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +2 -2
- package/dist/hooks/useSetState.d.ts +6 -1
- package/dist/hooks/useSetState.js +7 -4
- package/dist/hooks/useXYFlow.d.ts +7 -1
- package/dist/hooks/useXYFlow.js +4 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +4 -2
- package/dist/likec4diagram/DiagramUI.js +1 -3
- package/dist/likec4diagram/DiagramXYFlow.js +25 -12
- package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
- package/dist/likec4diagram/convert-to-xyflow.js +2 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +13 -14
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +68 -35
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -5
- package/dist/likec4diagram/custom/nodes/nodes.js +25 -6
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +5 -4
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +7 -6
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -15
- package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
- package/dist/likec4diagram/relationship-popover/components.js +39 -0
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +14 -15
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/createViewChange.js +16 -4
- package/dist/likec4diagram/state/machine.actions.d.ts +65 -0
- package/dist/likec4diagram/state/machine.actions.js +51 -39
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +22 -2
- package/dist/likec4diagram/state/machine.actions.layout.js +32 -14
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.js +31 -30
- package/dist/likec4diagram/state/machine.setup.d.ts +21 -5
- package/dist/likec4diagram/state/machine.setup.js +13 -4
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
- package/dist/likec4diagram/state/machine.state.navigating.js +81 -49
- package/dist/likec4diagram/state/machine.state.ready.d.ts +508 -582
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
- package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
- package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
- package/dist/likec4diagram/state/machine.state.ready.js +80 -69
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +13 -14
- package/dist/likec4diagram/state/utils.js +11 -3
- package/dist/likec4diagram/types.d.ts +9 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.js +4 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +5 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +10 -8
- package/dist/navigationpanel/NavigationPanel.js +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +4 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +1 -2
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +5 -5
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -2
- package/dist/navigationpanel/controls/SearchControl.js +8 -12
- package/dist/navigationpanel/controls/ToggleReadonly.js +4 -5
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +4 -4
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/styles.css.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +67 -67
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +4 -4
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
- package/dist/overlays/element-details/MetadataValue.js +6 -7
- package/dist/overlays/element-details/TabPanelDeployments.js +7 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -25
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +3 -2
- package/dist/overlays/overlaysActor.js +18 -0
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.css.js +2 -2
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/compute.js +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +21 -6
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationships-browser/layout.d.ts +1 -1
- package/dist/overlays/relationships-browser/layout.js +1 -1
- package/dist/projects-overview/actor.js +8 -31
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/projects-overview/panel/ProjectsOverviewPanel.js +1 -1
- package/dist/search/Search.d.ts +1 -4
- package/dist/search/Search.js +89 -87
- package/dist/search/components/ElementsColumn.css.js +3 -3
- package/dist/search/components/ElementsColumn.js +3 -4
- package/dist/search/components/PickView.d.ts +3 -1
- package/dist/search/components/PickView.js +5 -4
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +2 -2
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +1 -1
- package/dist/search/components/utils.js +1 -1
- package/dist/search/hooks.d.ts +1 -6
- package/dist/search/hooks.js +12 -9
- package/dist/search/searchActor.d.ts +1 -1
- package/dist/shadowroot/ShadowRoot.js +20 -19
- package/dist/shadowroot/styles.css.d.ts +0 -2
- package/dist/shadowroot/styles.css.js +1 -34
- package/dist/styles-font.css2.js +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.js +9 -5
- package/dist/utils/xyflow.d.ts +19 -3
- package/dist/utils/xyflow.js +52 -9
- package/package.json +21 -20
- package/panda.buildinfo.json +80 -104
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/editor/__tests__/fixture.d.ts +0 -205
- package/dist/editor/editorActor.d.ts +0 -653
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
- package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
- package/dist/overlays/relationships-browser/custom/styles.css.d.ts +0 -1
- package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
|
@@ -341,6 +341,10 @@ export declare const focusOnNodesAndEdges: () => ActionFunction<Context, Events,
|
|
|
341
341
|
type: "click: selected edge";
|
|
342
342
|
params: unknown;
|
|
343
343
|
};
|
|
344
|
+
"click: active walkthrough step": {
|
|
345
|
+
type: "click: active walkthrough step";
|
|
346
|
+
params: unknown;
|
|
347
|
+
};
|
|
344
348
|
}>, never, EmittedEvents>;
|
|
345
349
|
export declare const undimEverything: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
346
350
|
hotkeyActorLogic: {
|
|
@@ -456,6 +460,7 @@ export declare const onNodeMouseLeave: (params?: {
|
|
|
456
460
|
}>, never, never, never, never>;
|
|
457
461
|
export declare const emitPaneClick: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, EmittedEvents>;
|
|
458
462
|
export declare const emitOpenSource: (params?: OpenSourceParams) => ActionFunction<Context, Events, Events, undefined, never, never, never, never, EmittedEvents>;
|
|
463
|
+
export declare const emitOpenSourceOfView: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, EmittedEvents>;
|
|
459
464
|
export declare const emitInitialized: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, EmittedEvents>;
|
|
460
465
|
export declare const emitNodeClick: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, EmittedEvents>;
|
|
461
466
|
export declare const emitNavigateTo: (params?: {
|
|
@@ -577,6 +582,10 @@ export declare const triggerChange: (viewChange?: ViewChange) => ActionFunction<
|
|
|
577
582
|
type: "click: selected edge";
|
|
578
583
|
params: unknown;
|
|
579
584
|
};
|
|
585
|
+
"click: active walkthrough step": {
|
|
586
|
+
type: "click: active walkthrough step";
|
|
587
|
+
params: unknown;
|
|
588
|
+
};
|
|
580
589
|
}>, never, EmittedEvents>;
|
|
581
590
|
export declare const emitOnLayoutTypeChange: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
582
591
|
hotkeyActorLogic: {
|
|
@@ -693,6 +702,10 @@ export declare const emitOnLayoutTypeChange: () => ActionFunction<Context, Event
|
|
|
693
702
|
type: "click: selected edge";
|
|
694
703
|
params: unknown;
|
|
695
704
|
};
|
|
705
|
+
"click: active walkthrough step": {
|
|
706
|
+
type: "click: active walkthrough step";
|
|
707
|
+
params: unknown;
|
|
708
|
+
};
|
|
696
709
|
}>, never, EmittedEvents>;
|
|
697
710
|
export declare const layoutAlign: (params?: {
|
|
698
711
|
mode: AlignmentMode;
|
|
@@ -811,6 +824,10 @@ export declare const layoutAlign: (params?: {
|
|
|
811
824
|
type: "click: selected edge";
|
|
812
825
|
params: unknown;
|
|
813
826
|
};
|
|
827
|
+
"click: active walkthrough step": {
|
|
828
|
+
type: "click: active walkthrough step";
|
|
829
|
+
params: unknown;
|
|
830
|
+
};
|
|
814
831
|
}>, never, EmittedEvents>;
|
|
815
832
|
export declare const resetEdgesControlPoints: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
816
833
|
hotkeyActorLogic: {
|
|
@@ -1037,6 +1054,10 @@ export declare const stopEditorActor: () => ActionFunction<Context, Events, Even
|
|
|
1037
1054
|
type: "click: selected edge";
|
|
1038
1055
|
params: unknown;
|
|
1039
1056
|
};
|
|
1057
|
+
"click: active walkthrough step": {
|
|
1058
|
+
type: "click: active walkthrough step";
|
|
1059
|
+
params: unknown;
|
|
1060
|
+
};
|
|
1040
1061
|
}>, never, EmittedEvents>;
|
|
1041
1062
|
/**
|
|
1042
1063
|
* Ensure that the sync layout actor is running or stopped based on the read-only state
|
|
@@ -1156,6 +1177,10 @@ export declare const ensureEditorActor: () => ActionFunction<Context, Events, Ev
|
|
|
1156
1177
|
type: "click: selected edge";
|
|
1157
1178
|
params: unknown;
|
|
1158
1179
|
};
|
|
1180
|
+
"click: active walkthrough step": {
|
|
1181
|
+
type: "click: active walkthrough step";
|
|
1182
|
+
params: unknown;
|
|
1183
|
+
};
|
|
1159
1184
|
}>, never, EmittedEvents>;
|
|
1160
1185
|
export declare const startEditing: (subject?: "node" | "edge") => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
1161
1186
|
export declare const sendSynced: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
@@ -1279,6 +1304,10 @@ export declare const openElementDetails: (params?: {
|
|
|
1279
1304
|
type: "click: selected edge";
|
|
1280
1305
|
params: unknown;
|
|
1281
1306
|
};
|
|
1307
|
+
"click: active walkthrough step": {
|
|
1308
|
+
type: "click: active walkthrough step";
|
|
1309
|
+
params: unknown;
|
|
1310
|
+
};
|
|
1282
1311
|
}>, never, EmittedEvents>;
|
|
1283
1312
|
export declare const openOverlay: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
1284
1313
|
hotkeyActorLogic: {
|
|
@@ -1395,6 +1424,10 @@ export declare const openOverlay: () => ActionFunction<Context, Events, Events,
|
|
|
1395
1424
|
type: "click: selected edge";
|
|
1396
1425
|
params: unknown;
|
|
1397
1426
|
};
|
|
1427
|
+
"click: active walkthrough step": {
|
|
1428
|
+
type: "click: active walkthrough step";
|
|
1429
|
+
params: unknown;
|
|
1430
|
+
};
|
|
1398
1431
|
}>, never, EmittedEvents>;
|
|
1399
1432
|
export declare const openSourceOfFocusedOrLastClickedNode: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
1400
1433
|
hotkeyActorLogic: {
|
|
@@ -1511,6 +1544,10 @@ export declare const openSourceOfFocusedOrLastClickedNode: () => ActionFunction<
|
|
|
1511
1544
|
type: "click: selected edge";
|
|
1512
1545
|
params: unknown;
|
|
1513
1546
|
};
|
|
1547
|
+
"click: active walkthrough step": {
|
|
1548
|
+
type: "click: active walkthrough step";
|
|
1549
|
+
params: unknown;
|
|
1550
|
+
};
|
|
1514
1551
|
}>, never, EmittedEvents>;
|
|
1515
1552
|
/**
|
|
1516
1553
|
* Ensure that the overlays actor is running or stopped based on the current feature flags
|
|
@@ -1630,6 +1667,10 @@ export declare const ensureOverlaysActor: () => ActionFunction<Context, Events,
|
|
|
1630
1667
|
type: "click: selected edge";
|
|
1631
1668
|
params: unknown;
|
|
1632
1669
|
};
|
|
1670
|
+
"click: active walkthrough step": {
|
|
1671
|
+
type: "click: active walkthrough step";
|
|
1672
|
+
params: unknown;
|
|
1673
|
+
};
|
|
1633
1674
|
}>, never, EmittedEvents>;
|
|
1634
1675
|
/**
|
|
1635
1676
|
* Ensure that the search actor is running or stopped based on the current feature flags
|
|
@@ -1749,6 +1790,10 @@ export declare const ensureSearchActor: () => ActionFunction<Context, Events, Ev
|
|
|
1749
1790
|
type: "click: selected edge";
|
|
1750
1791
|
params: unknown;
|
|
1751
1792
|
};
|
|
1793
|
+
"click: active walkthrough step": {
|
|
1794
|
+
type: "click: active walkthrough step";
|
|
1795
|
+
params: unknown;
|
|
1796
|
+
};
|
|
1752
1797
|
}>, never, EmittedEvents>;
|
|
1753
1798
|
export declare const onEdgeMouseEnter: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
1754
1799
|
hotkeyActorLogic: {
|
|
@@ -1865,6 +1910,10 @@ export declare const onEdgeMouseEnter: () => ActionFunction<Context, Events, Eve
|
|
|
1865
1910
|
type: "click: selected edge";
|
|
1866
1911
|
params: unknown;
|
|
1867
1912
|
};
|
|
1913
|
+
"click: active walkthrough step": {
|
|
1914
|
+
type: "click: active walkthrough step";
|
|
1915
|
+
params: unknown;
|
|
1916
|
+
};
|
|
1868
1917
|
}>, never, EmittedEvents>;
|
|
1869
1918
|
export declare const onEdgeMouseLeave: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
1870
1919
|
hotkeyActorLogic: {
|
|
@@ -1981,6 +2030,10 @@ export declare const onEdgeMouseLeave: () => ActionFunction<Context, Events, Eve
|
|
|
1981
2030
|
type: "click: selected edge";
|
|
1982
2031
|
params: unknown;
|
|
1983
2032
|
};
|
|
2033
|
+
"click: active walkthrough step": {
|
|
2034
|
+
type: "click: active walkthrough step";
|
|
2035
|
+
params: unknown;
|
|
2036
|
+
};
|
|
1984
2037
|
}>, never, EmittedEvents>;
|
|
1985
2038
|
export declare const reraise: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
1986
2039
|
export declare const startHotKeyActor: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
@@ -2126,6 +2179,10 @@ export declare const startAutoUnfocusTimer: () => ActionFunction<Context, Events
|
|
|
2126
2179
|
type: "click: selected edge";
|
|
2127
2180
|
params: unknown;
|
|
2128
2181
|
};
|
|
2182
|
+
"click: active walkthrough step": {
|
|
2183
|
+
type: "click: active walkthrough step";
|
|
2184
|
+
params: unknown;
|
|
2185
|
+
};
|
|
2129
2186
|
}>, never, EmittedEvents>;
|
|
2130
2187
|
export declare const cancelAutoUnfocusTimer: () => CancelAction<Context, Events, undefined, Events>;
|
|
2131
2188
|
export declare const handleNavigate: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
@@ -2243,6 +2300,10 @@ export declare const handleNavigate: () => ActionFunction<Context, Events, Event
|
|
|
2243
2300
|
type: "click: selected edge";
|
|
2244
2301
|
params: unknown;
|
|
2245
2302
|
};
|
|
2303
|
+
"click: active walkthrough step": {
|
|
2304
|
+
type: "click: active walkthrough step";
|
|
2305
|
+
params: unknown;
|
|
2306
|
+
};
|
|
2246
2307
|
}>, never, EmittedEvents>;
|
|
2247
2308
|
export declare const updateView: () => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
2248
2309
|
hotkeyActorLogic: {
|
|
@@ -2359,4 +2420,8 @@ export declare const updateView: () => ActionFunction<Context, Events, Events, u
|
|
|
2359
2420
|
type: "click: selected edge";
|
|
2360
2421
|
params: unknown;
|
|
2361
2422
|
};
|
|
2423
|
+
"click: active walkthrough step": {
|
|
2424
|
+
type: "click: active walkthrough step";
|
|
2425
|
+
params: unknown;
|
|
2426
|
+
};
|
|
2362
2427
|
}>, never, EmittedEvents>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nonNullable, nonexhaustive, invariant } from '@likec4/core';
|
|
1
|
+
import { nonNullable, BBox, nonexhaustive, invariant } from '@likec4/core';
|
|
2
2
|
import { nodeToRect } from '@xyflow/system';
|
|
3
3
|
import { produce } from 'immer';
|
|
4
4
|
import { hasAtLeast, isTruthy } from 'remeda';
|
|
@@ -7,10 +7,10 @@ import { convertToXYFlow } from '../convert-to-xyflow.js';
|
|
|
7
7
|
import { createLayoutConstraints } from '../useLayoutConstraints.js';
|
|
8
8
|
import { getAligner, toNodeRect } from './aligners.js';
|
|
9
9
|
import { resetEdgeControlPoints, mergeXYNodesEdges, focusNodesEdges } from './assign.js';
|
|
10
|
-
import { setViewport, cancelFitDiagram, raiseFitDiagram } from './machine.actions.layout.js';
|
|
10
|
+
import { setViewport, setViewportCenter, cancelFitDiagram, raiseFitDiagram } from './machine.actions.layout.js';
|
|
11
11
|
export { assignViewportBefore, fitDiagram, fitFocusedBounds, raiseSetViewport, raiseUpdateView, returnViewportBefore } from './machine.actions.layout.js';
|
|
12
12
|
import { machine } from './machine.setup.js';
|
|
13
|
-
import { typedSystem, findDiagramEdge,
|
|
13
|
+
import { typedSystem, findDiagramNode, findDiagramEdge, viewBounds } from './utils.js';
|
|
14
14
|
import { Base } from '../../base/Base.js';
|
|
15
15
|
|
|
16
16
|
const disableCompareWithLatest = () => machine.assign(({ context }) => {
|
|
@@ -31,20 +31,20 @@ const onEdgeDoubleClick = () => machine.assign(({ context, event }) => {
|
|
|
31
31
|
const { nodeLookup } = context.xystore.getState();
|
|
32
32
|
return {
|
|
33
33
|
xyedges: context.xyedges.map((e) => {
|
|
34
|
-
if (e.id
|
|
35
|
-
|
|
36
|
-
const pt = controlPoints[0];
|
|
37
|
-
return {
|
|
38
|
-
...e,
|
|
39
|
-
data: {
|
|
40
|
-
...e.data,
|
|
41
|
-
controlPoints,
|
|
42
|
-
labelBBox: e.data.labelBBox ? { ...e.data.labelBBox, ...pt } : null,
|
|
43
|
-
labelXY: null
|
|
44
|
-
}
|
|
45
|
-
};
|
|
34
|
+
if (e.id !== event.edge.id) {
|
|
35
|
+
return e;
|
|
46
36
|
}
|
|
47
|
-
|
|
37
|
+
const controlPoints = resetEdgeControlPoints(nodeLookup, e);
|
|
38
|
+
const pt = controlPoints[0];
|
|
39
|
+
return {
|
|
40
|
+
...e,
|
|
41
|
+
data: {
|
|
42
|
+
...e.data,
|
|
43
|
+
controlPoints,
|
|
44
|
+
labelBBox: e.data.labelBBox ? { ...e.data.labelBBox, ...pt } : null,
|
|
45
|
+
labelXY: null
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
48
|
})
|
|
49
49
|
};
|
|
50
50
|
});
|
|
@@ -75,10 +75,11 @@ const assignFocusedNode = () => machine.assign(({ event }) => {
|
|
|
75
75
|
case "xyflow.nodeClick":
|
|
76
76
|
focusedNode = event.node.data.id;
|
|
77
77
|
break;
|
|
78
|
-
case "focus.node":
|
|
78
|
+
case "focus.node": {
|
|
79
79
|
focusedNode = event.nodeId;
|
|
80
80
|
autoUnfocusTimer = event.autoUnfocus === true;
|
|
81
81
|
break;
|
|
82
|
+
}
|
|
82
83
|
default:
|
|
83
84
|
throw new Error(`Unexpected event type: ${event.type} in action 'assign: focusedNode'`);
|
|
84
85
|
}
|
|
@@ -105,6 +106,7 @@ const assignXYDataFromView = (view) => machine.assign(({ context, event }) => {
|
|
|
105
106
|
{
|
|
106
107
|
assertEvent(event, "update.view");
|
|
107
108
|
xydata = "xynodes" in event ? event : convertToXYFlow({
|
|
109
|
+
currentViewId: context.view.id,
|
|
108
110
|
dynamicViewVariant: context.dynamicViewVariant,
|
|
109
111
|
view: event.view,
|
|
110
112
|
where: context.where
|
|
@@ -188,18 +190,18 @@ const emitPaneClick = () => machine.emit(() => ({
|
|
|
188
190
|
type: "paneClick"
|
|
189
191
|
}));
|
|
190
192
|
const emitOpenSource = (params) => machine.emit(({ event }) => {
|
|
191
|
-
if (params) {
|
|
192
|
-
return {
|
|
193
|
-
type: "openSource",
|
|
194
|
-
params
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
193
|
assertEvent(event, "open.source");
|
|
198
194
|
return {
|
|
199
195
|
type: "openSource",
|
|
200
196
|
params: event
|
|
201
197
|
};
|
|
202
198
|
});
|
|
199
|
+
const emitOpenSourceOfView = () => machine.emit(({ context }) => ({
|
|
200
|
+
type: "openSource",
|
|
201
|
+
params: {
|
|
202
|
+
view: context.view.id
|
|
203
|
+
}
|
|
204
|
+
}));
|
|
203
205
|
const emitInitialized = () => machine.emit(({ context }) => {
|
|
204
206
|
invariant(context.xyflow, "XYFlow instance not found");
|
|
205
207
|
return {
|
|
@@ -361,12 +363,13 @@ const tagHighlight = () => machine.assign(({ context, event }) => {
|
|
|
361
363
|
});
|
|
362
364
|
const assignToggledFeatures = () => machine.assign(({ context, event }) => {
|
|
363
365
|
assertEvent(event, "toggle.feature");
|
|
364
|
-
const
|
|
366
|
+
const feature = `enable${event.feature}`;
|
|
367
|
+
const currentValue = context.toggledFeatures[feature] ?? context.features[feature];
|
|
365
368
|
const nextValue = event.forceValue ?? !currentValue;
|
|
366
369
|
return {
|
|
367
370
|
toggledFeatures: {
|
|
368
371
|
...context.toggledFeatures,
|
|
369
|
-
[
|
|
372
|
+
[feature]: nextValue
|
|
370
373
|
}
|
|
371
374
|
};
|
|
372
375
|
});
|
|
@@ -418,7 +421,7 @@ const sendSynced = () => machine.sendTo(
|
|
|
418
421
|
type: "synced"
|
|
419
422
|
}
|
|
420
423
|
);
|
|
421
|
-
const stopEditing = (wasChanged =
|
|
424
|
+
const stopEditing = (wasChanged = false) => machine.sendTo(
|
|
422
425
|
typedSystem.editorActor,
|
|
423
426
|
{
|
|
424
427
|
type: "edit.finish",
|
|
@@ -507,6 +510,10 @@ const openOverlay = () => machine.enqueueActions(({ context, event, enqueue, che
|
|
|
507
510
|
break;
|
|
508
511
|
}
|
|
509
512
|
case "open.relationshipsBrowser": {
|
|
513
|
+
if (!context.features.enableRelationshipBrowser) {
|
|
514
|
+
console.warn("RelationshipBrowser feature is disabled");
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
510
517
|
enqueue.sendTo(
|
|
511
518
|
typedSystem.overlaysActor,
|
|
512
519
|
{
|
|
@@ -522,6 +529,10 @@ const openOverlay = () => machine.enqueueActions(({ context, event, enqueue, che
|
|
|
522
529
|
break;
|
|
523
530
|
}
|
|
524
531
|
case "open.relationshipDetails": {
|
|
532
|
+
if (!context.features.enableRelationshipDetails) {
|
|
533
|
+
console.warn("RelationshipDetails feature is disabled");
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
525
536
|
enqueue.sendTo(
|
|
526
537
|
typedSystem.overlaysActor,
|
|
527
538
|
{
|
|
@@ -629,14 +640,12 @@ const handleNavigate = () => machine.enqueueActions(({ enqueue, context, event }
|
|
|
629
640
|
viewport,
|
|
630
641
|
viewportChangedManually,
|
|
631
642
|
viewportBefore,
|
|
632
|
-
navigationHistory
|
|
633
|
-
currentIndex,
|
|
634
|
-
history: _history
|
|
635
|
-
}
|
|
643
|
+
navigationHistory
|
|
636
644
|
} = context;
|
|
637
|
-
let history =
|
|
645
|
+
let { currentIndex, history: _history } = navigationHistory;
|
|
646
|
+
let history = _history;
|
|
638
647
|
if (currentIndex < _history.length) {
|
|
639
|
-
const updatedEntry = produce(_history
|
|
648
|
+
const updatedEntry = produce(_history.at(currentIndex) ?? {}, (draft) => {
|
|
640
649
|
draft.viewport = { ...viewport };
|
|
641
650
|
draft.viewportChangedManually = viewportChangedManually;
|
|
642
651
|
draft.focusedNode = focusedNode;
|
|
@@ -648,7 +657,7 @@ const handleNavigate = () => machine.enqueueActions(({ enqueue, context, event }
|
|
|
648
657
|
draft.dynamicViewVariant = null;
|
|
649
658
|
}
|
|
650
659
|
if (viewportBefore) {
|
|
651
|
-
draft.viewportBefore = viewportBefore;
|
|
660
|
+
draft.viewportBefore = structuredClone(viewportBefore);
|
|
652
661
|
} else {
|
|
653
662
|
delete draft.viewportBefore;
|
|
654
663
|
}
|
|
@@ -720,7 +729,6 @@ const updateView = () => machine.enqueueActions(
|
|
|
720
729
|
return;
|
|
721
730
|
}
|
|
722
731
|
enqueue(sendSynced());
|
|
723
|
-
let recenter = !context.viewportChangedManually && !context.focusedNode && !context.activeWalkthrough;
|
|
724
732
|
if (context.toggledFeatures.enableCompareWithLatest === true && context.view._layout !== nextView._layout) {
|
|
725
733
|
if (nextView._layout === "auto" && context.viewportOnAutoLayout) {
|
|
726
734
|
enqueue(
|
|
@@ -741,15 +749,19 @@ const updateView = () => machine.enqueueActions(
|
|
|
741
749
|
return;
|
|
742
750
|
}
|
|
743
751
|
}
|
|
744
|
-
recenter =
|
|
752
|
+
let recenter = !context.viewportChangedManually && !context.focusedNode && !context.activeWalkthrough;
|
|
745
753
|
recenter = recenter || context.toggledFeatures.enableCompareWithLatest === true && !!nextView._layout && context.view._layout !== nextView._layout;
|
|
754
|
+
if (nextView._type === "dynamic" && context.view._type === "dynamic") {
|
|
755
|
+
if (nextView.variant === context.view.variant && nextView.variant !== context.dynamicViewVariant) {
|
|
756
|
+
const nextCenter = BBox.center(viewBounds(context, nextView));
|
|
757
|
+
enqueue(setViewportCenter(nextCenter));
|
|
758
|
+
}
|
|
759
|
+
}
|
|
746
760
|
if (recenter) {
|
|
747
761
|
enqueue(cancelFitDiagram());
|
|
748
|
-
enqueue(raiseFitDiagram(
|
|
749
|
-
bounds: event.view.bounds
|
|
750
|
-
}));
|
|
762
|
+
enqueue(raiseFitDiagram());
|
|
751
763
|
}
|
|
752
764
|
}
|
|
753
765
|
);
|
|
754
766
|
|
|
755
|
-
export { assignDynamicViewVariant, assignFocusedNode, assignLastClickedNode, assignToggledFeatures, assignXYDataFromView, cancelAutoUnfocusTimer, cancelEditing, cancelFitDiagram, closeAllOverlays, closeSearch, disableCompareWithLatest, emitEdgeClick, emitInitialized, emitNavigateTo, emitNodeClick, emitOnLayoutTypeChange, emitOpenSource, emitPaneClick, ensureEditorActor, ensureOverlaysActor, ensureSearchActor, focusOnNodesAndEdges, handleNavigate, layoutAlign, notationsHighlight, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseLeave, onNodeMouseEnter, onNodeMouseLeave, openElementDetails, openOverlay, openSourceOfFocusedOrLastClickedNode, raiseFitDiagram, resetEdgesControlPoints, resetLastClickedNode, sendSynced, setViewport, startAutoUnfocusTimer, startEditing, startHotKeyActor, stopEditing, stopEditorActor, stopHotKeyActor, tagHighlight, triggerChange, undimEverything, updateFeatures, updateInputs, updateView };
|
|
767
|
+
export { assignDynamicViewVariant, assignFocusedNode, assignLastClickedNode, assignToggledFeatures, assignXYDataFromView, cancelAutoUnfocusTimer, cancelEditing, cancelFitDiagram, closeAllOverlays, closeSearch, disableCompareWithLatest, emitEdgeClick, emitInitialized, emitNavigateTo, emitNodeClick, emitOnLayoutTypeChange, emitOpenSource, emitOpenSourceOfView, emitPaneClick, ensureEditorActor, ensureOverlaysActor, ensureSearchActor, focusOnNodesAndEdges, handleNavigate, layoutAlign, notationsHighlight, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseLeave, onNodeMouseEnter, onNodeMouseLeave, openElementDetails, openOverlay, openSourceOfFocusedOrLastClickedNode, raiseFitDiagram, resetEdgesControlPoints, resetLastClickedNode, sendSynced, setViewport, setViewportCenter, startAutoUnfocusTimer, startEditing, startHotKeyActor, stopEditing, stopEditorActor, stopHotKeyActor, tagHighlight, triggerChange, undimEverything, updateFeatures, updateInputs, updateView };
|
|
@@ -126,6 +126,10 @@ export declare const setViewport: (params?: {
|
|
|
126
126
|
type: "click: selected edge";
|
|
127
127
|
params: unknown;
|
|
128
128
|
};
|
|
129
|
+
"click: active walkthrough step": {
|
|
130
|
+
type: "click: active walkthrough step";
|
|
131
|
+
params: unknown;
|
|
132
|
+
};
|
|
129
133
|
}>, never, EmittedEvents>;
|
|
130
134
|
export declare const setViewportCenter: (params?: {
|
|
131
135
|
x: number;
|
|
@@ -245,11 +249,15 @@ export declare const setViewportCenter: (params?: {
|
|
|
245
249
|
type: "click: selected edge";
|
|
246
250
|
params: unknown;
|
|
247
251
|
};
|
|
252
|
+
"click: active walkthrough step": {
|
|
253
|
+
type: "click: active walkthrough step";
|
|
254
|
+
params: unknown;
|
|
255
|
+
};
|
|
248
256
|
}>, never, EmittedEvents>;
|
|
249
257
|
export declare const fitDiagram: (params?: {
|
|
250
258
|
duration?: number;
|
|
251
259
|
bounds?: BBox;
|
|
252
|
-
}) => ActionFunction<Context, Events, Events,
|
|
260
|
+
}) => ActionFunction<Context, Events, Events, unknown, Values<{
|
|
253
261
|
hotkeyActorLogic: {
|
|
254
262
|
src: "hotkeyActorLogic";
|
|
255
263
|
logic: HotkeyActorLogic;
|
|
@@ -364,6 +372,10 @@ export declare const fitDiagram: (params?: {
|
|
|
364
372
|
type: "click: selected edge";
|
|
365
373
|
params: unknown;
|
|
366
374
|
};
|
|
375
|
+
"click: active walkthrough step": {
|
|
376
|
+
type: "click: active walkthrough step";
|
|
377
|
+
params: unknown;
|
|
378
|
+
};
|
|
367
379
|
}>, never, EmittedEvents>;
|
|
368
380
|
export declare const fitFocusedBounds: () => ActionFunction<Context, Events, Events, unknown, Values<{
|
|
369
381
|
hotkeyActorLogic: {
|
|
@@ -480,6 +492,10 @@ export declare const fitFocusedBounds: () => ActionFunction<Context, Events, Eve
|
|
|
480
492
|
type: "click: selected edge";
|
|
481
493
|
params: unknown;
|
|
482
494
|
};
|
|
495
|
+
"click: active walkthrough step": {
|
|
496
|
+
type: "click: active walkthrough step";
|
|
497
|
+
params: unknown;
|
|
498
|
+
};
|
|
483
499
|
}>, never, EmittedEvents>;
|
|
484
500
|
export declare const raiseSetViewport: (params: {
|
|
485
501
|
delay?: number;
|
|
@@ -493,7 +509,7 @@ export declare const raiseFitDiagram: (params?: {
|
|
|
493
509
|
bounds?: BBox;
|
|
494
510
|
}) => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
495
511
|
export declare const raiseUpdateView: (view?: DiagramView) => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
496
|
-
export declare const assignViewportBefore: (viewport?: Viewport |
|
|
512
|
+
export declare const assignViewportBefore: (viewport?: Viewport | false) => ActionFunction<Context, Events, Events, undefined, Values<{
|
|
497
513
|
hotkeyActorLogic: {
|
|
498
514
|
src: "hotkeyActorLogic";
|
|
499
515
|
logic: HotkeyActorLogic;
|
|
@@ -638,4 +654,8 @@ export declare const returnViewportBefore: (params?: {
|
|
|
638
654
|
type: "click: selected edge";
|
|
639
655
|
params: unknown;
|
|
640
656
|
};
|
|
657
|
+
"click: active walkthrough step": {
|
|
658
|
+
type: "click: active walkthrough step";
|
|
659
|
+
params: unknown;
|
|
660
|
+
};
|
|
641
661
|
}>, never, EmittedEvents>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { nonNullable } from '@likec4/core';
|
|
1
|
+
import { nonNullable, BBox, invariant } from '@likec4/core';
|
|
2
2
|
import { getViewportForBounds } from '@xyflow/react';
|
|
3
3
|
import { assertEvent } from 'xstate';
|
|
4
4
|
import { machine } from './machine.setup.js';
|
|
5
|
-
import { activeSequenceBounds, focusedBounds } from './utils.js';
|
|
5
|
+
import { viewBounds, activeSequenceBounds, focusedBounds } from './utils.js';
|
|
6
6
|
import { MinZoom } from '../../base/const.js';
|
|
7
7
|
|
|
8
8
|
const setViewport = (params) => machine.createAction(({ context, event }) => {
|
|
@@ -15,7 +15,7 @@ const setViewport = (params) => machine.createAction(({ context, event }) => {
|
|
|
15
15
|
viewport = event.viewport;
|
|
16
16
|
duration = event.duration;
|
|
17
17
|
}
|
|
18
|
-
duration = duration ??
|
|
18
|
+
duration = duration ?? 450;
|
|
19
19
|
const { panZoom } = nonNullable(context.xystore).getState();
|
|
20
20
|
const animationProps = duration > 0 ? { duration, interpolate: "smooth" } : void 0;
|
|
21
21
|
panZoom?.setViewport({
|
|
@@ -23,21 +23,38 @@ const setViewport = (params) => machine.createAction(({ context, event }) => {
|
|
|
23
23
|
y: Math.round(viewport.y),
|
|
24
24
|
zoom: viewport.zoom
|
|
25
25
|
}, animationProps).catch((err) => {
|
|
26
|
-
console.error("Error during
|
|
26
|
+
console.error("Error during setViewport", { err });
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const setViewportCenter = (params) => machine.createAction(({ context, event }) => {
|
|
30
|
+
let center;
|
|
31
|
+
if (params) {
|
|
32
|
+
center = params;
|
|
33
|
+
} else if (event.type === "update.view") {
|
|
34
|
+
center = BBox.center(viewBounds(context, event.view));
|
|
35
|
+
} else {
|
|
36
|
+
center = BBox.center(viewBounds(context));
|
|
37
|
+
}
|
|
38
|
+
invariant(context.xyflow, "xyflow is not initialized");
|
|
39
|
+
const zoom = context.xyflow.getZoom();
|
|
40
|
+
context.xyflow.setCenter(
|
|
41
|
+
Math.round(center.x),
|
|
42
|
+
Math.round(center.y),
|
|
43
|
+
{ zoom }
|
|
44
|
+
).catch((err) => {
|
|
45
|
+
console.error("Error during setViewportCenter", { err });
|
|
27
46
|
});
|
|
28
47
|
});
|
|
29
|
-
const fitDiagram = (params) => machine.
|
|
30
|
-
let bounds
|
|
48
|
+
const fitDiagram = (params) => machine.createAction(({ context, event }) => {
|
|
49
|
+
let bounds, duration;
|
|
31
50
|
if (params) {
|
|
32
|
-
bounds = params.bounds
|
|
51
|
+
bounds = params.bounds;
|
|
33
52
|
duration = params.duration;
|
|
34
53
|
} else if (event.type === "xyflow.fitDiagram") {
|
|
35
|
-
bounds = event.bounds
|
|
54
|
+
bounds = event.bounds;
|
|
36
55
|
duration = event.duration;
|
|
37
|
-
enqueue.assign({
|
|
38
|
-
viewportChangedManually: false
|
|
39
|
-
});
|
|
40
56
|
}
|
|
57
|
+
bounds ??= viewBounds(context);
|
|
41
58
|
duration ??= 450;
|
|
42
59
|
const { width, height, panZoom, transform } = nonNullable(context.xystore).getState();
|
|
43
60
|
const maxZoom = Math.max(1, transform[2]);
|
|
@@ -119,18 +136,19 @@ const assignViewportBefore = (viewport) => machine.assign(({ context }) => {
|
|
|
119
136
|
});
|
|
120
137
|
const returnViewportBefore = (params) => machine.enqueueActions(({ enqueue, context: { viewportBefore } }) => {
|
|
121
138
|
enqueue(cancelFitDiagram());
|
|
139
|
+
const noDelay = params?.delay === 0;
|
|
122
140
|
if (viewportBefore) {
|
|
123
141
|
enqueue.assign({
|
|
124
142
|
viewportChangedManually: viewportBefore.wasChangedManually,
|
|
125
143
|
viewportBefore: null
|
|
126
144
|
});
|
|
127
|
-
if (
|
|
145
|
+
if (noDelay) {
|
|
128
146
|
enqueue(setViewport({ viewport: viewportBefore.value, ...params }));
|
|
129
147
|
} else {
|
|
130
148
|
enqueue(raiseSetViewport({ viewport: viewportBefore.value, ...params }));
|
|
131
149
|
}
|
|
132
150
|
} else {
|
|
133
|
-
if (
|
|
151
|
+
if (noDelay) {
|
|
134
152
|
enqueue(fitDiagram({ ...params }));
|
|
135
153
|
} else {
|
|
136
154
|
enqueue(raiseFitDiagram({ ...params }));
|
|
@@ -138,4 +156,4 @@ const returnViewportBefore = (params) => machine.enqueueActions(({ enqueue, cont
|
|
|
138
156
|
}
|
|
139
157
|
});
|
|
140
158
|
|
|
141
|
-
export { assignViewportBefore, cancelFitDiagram, fitDiagram, fitFocusedBounds, raiseFitDiagram, raiseSetViewport, raiseUpdateView, returnViewportBefore, setViewport };
|
|
159
|
+
export { assignViewportBefore, cancelFitDiagram, fitDiagram, fitFocusedBounds, raiseFitDiagram, raiseSetViewport, raiseUpdateView, returnViewportBefore, setViewport, setViewportCenter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActorRef, MachineSnapshot, StateMachine } from 'xstate';
|
|
2
|
-
import { EditorActorRef } from '../../editor/editorActor';
|
|
2
|
+
import { EditorActorRef } from '../../editor/editorActor.states';
|
|
3
3
|
import { OverlaysActorRef } from '../../overlays/overlaysActor';
|
|
4
4
|
import { SearchActorRef } from '../../search/searchActor';
|
|
5
5
|
import { Context as DiagramContext, EmittedEvents as DiagramEmittedEvents, Events as DiagramEvents, Input } from './machine.setup';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { applyEdgeChanges, applyNodeChanges } from '@xyflow/react';
|
|
2
2
|
import { DefaultFeatures } from '../../context/DiagramFeatures.js';
|
|
3
3
|
import { updateEdgeData, updateNodeData } from './assign.js';
|
|
4
|
-
import { emitOnLayoutTypeChange, triggerChange, updateFeatures, updateInputs, assignDynamicViewVariant
|
|
4
|
+
import { stopEditorActor, emitOnLayoutTypeChange, triggerChange, updateFeatures, updateInputs, assignDynamicViewVariant } from './machine.actions.js';
|
|
5
5
|
import { machine } from './machine.setup.js';
|
|
6
6
|
import { isReady, initializing } from './machine.state.initializing.js';
|
|
7
7
|
import { navigating } from './machine.state.navigating.js';
|
|
8
8
|
import { ready } from './machine.state.ready.js';
|
|
9
9
|
import { DiagramToggledFeaturesPersistence } from './persistence.js';
|
|
10
10
|
import { x as xstateActions_cjsExports } from '../../_virtual/xstate-actions.cjs.js';
|
|
11
|
-
import {
|
|
11
|
+
import { cancelFitDiagram, raiseUpdateView } from './machine.actions.layout.js';
|
|
12
12
|
|
|
13
13
|
const _diagramMachine = machine.createMachine({
|
|
14
14
|
initial: "initializing",
|
|
@@ -49,25 +49,7 @@ const _diagramMachine = machine.createMachine({
|
|
|
49
49
|
ready,
|
|
50
50
|
navigating,
|
|
51
51
|
final: {
|
|
52
|
-
type: "final"
|
|
53
|
-
entry: [
|
|
54
|
-
stopEditorActor(),
|
|
55
|
-
cancelFitDiagram(),
|
|
56
|
-
xstateActions_cjsExports.stopChild("hotkey"),
|
|
57
|
-
xstateActions_cjsExports.stopChild("overlays"),
|
|
58
|
-
xstateActions_cjsExports.stopChild("search"),
|
|
59
|
-
xstateActions_cjsExports.stopChild("mediaPrint"),
|
|
60
|
-
xstateActions_cjsExports.assign({
|
|
61
|
-
xyflow: null,
|
|
62
|
-
xystore: null,
|
|
63
|
-
xyedges: [],
|
|
64
|
-
xynodes: [],
|
|
65
|
-
initialized: {
|
|
66
|
-
xydata: false,
|
|
67
|
-
xyflow: false
|
|
68
|
-
}
|
|
69
|
-
})
|
|
70
|
-
]
|
|
52
|
+
type: "final"
|
|
71
53
|
}
|
|
72
54
|
},
|
|
73
55
|
on: {
|
|
@@ -81,6 +63,9 @@ const _diagramMachine = machine.createMachine({
|
|
|
81
63
|
guard: ({ context, event }) => context.dynamicViewVariant !== event.variant,
|
|
82
64
|
actions: [
|
|
83
65
|
assignDynamicViewVariant(),
|
|
66
|
+
xstateActions_cjsExports.assign({
|
|
67
|
+
viewportChangedManually: false
|
|
68
|
+
}),
|
|
84
69
|
raiseUpdateView()
|
|
85
70
|
]
|
|
86
71
|
},
|
|
@@ -106,14 +91,12 @@ const _diagramMachine = machine.createMachine({
|
|
|
106
91
|
"emit.onLayoutTypeChange": {
|
|
107
92
|
actions: emitOnLayoutTypeChange()
|
|
108
93
|
},
|
|
109
|
-
"xyflow.
|
|
110
|
-
actions: xstateActions_cjsExports.assign({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
actions: xstateActions_cjsExports.assign({
|
|
116
|
-
xyedges: ({ context, event }) => applyEdgeChanges(event.changes, context.xyedges)
|
|
94
|
+
"xyflow.applyChanges": {
|
|
95
|
+
actions: xstateActions_cjsExports.assign(({ context, event }) => {
|
|
96
|
+
return {
|
|
97
|
+
xynodes: event.nodes ? applyNodeChanges(event.nodes, context.xynodes) : context.xynodes,
|
|
98
|
+
xyedges: event.edges ? applyEdgeChanges(event.edges, context.xyedges) : context.xyedges
|
|
99
|
+
};
|
|
117
100
|
})
|
|
118
101
|
},
|
|
119
102
|
"xyflow.viewportMoved": {
|
|
@@ -123,7 +106,25 @@ const _diagramMachine = machine.createMachine({
|
|
|
123
106
|
}))
|
|
124
107
|
},
|
|
125
108
|
"destroy": {
|
|
126
|
-
target: ".final"
|
|
109
|
+
target: ".final",
|
|
110
|
+
actions: [
|
|
111
|
+
stopEditorActor(),
|
|
112
|
+
cancelFitDiagram(),
|
|
113
|
+
xstateActions_cjsExports.stopChild("hotkey"),
|
|
114
|
+
xstateActions_cjsExports.stopChild("overlays"),
|
|
115
|
+
xstateActions_cjsExports.stopChild("search"),
|
|
116
|
+
xstateActions_cjsExports.stopChild("mediaPrint"),
|
|
117
|
+
xstateActions_cjsExports.assign({
|
|
118
|
+
xyflow: null,
|
|
119
|
+
xystore: null,
|
|
120
|
+
xyedges: [],
|
|
121
|
+
xynodes: [],
|
|
122
|
+
initialized: {
|
|
123
|
+
xydata: false,
|
|
124
|
+
xyflow: false
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
]
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
});
|