@likec4/diagram 1.60.0 → 1.61.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/README.md +63 -11
- package/dist/LikeC4Diagram.d.mts +4 -6
- package/dist/LikeC4Diagram.mjs +13 -12
- package/dist/LikeC4Diagram.props.d.mts +5 -7
- package/dist/LikeC4MantineProvider.d.mts +1 -2
- package/dist/LikeC4MantineProvider.mjs +26 -11
- package/dist/LikeC4ModelProvider.d.mts +1 -3
- package/dist/LikeC4ModelProvider.mjs +1 -2
- package/dist/LikeC4ProjectsOverview.d.mts +1 -3
- package/dist/LikeC4ProjectsOverview.mjs +1 -2
- package/dist/LikeC4ProjectsProvider.d.mts +1 -2
- package/dist/LikeC4ProjectsProvider.mjs +2 -3
- package/dist/LikeC4Styles.d.mts +1 -2
- package/dist/LikeC4Styles.mjs +11 -6
- package/dist/LikeC4View.d.mts +3 -5
- package/dist/LikeC4View.mjs +12 -11
- package/dist/ReactLikeC4.d.mts +3 -5
- package/dist/ReactLikeC4.mjs +8 -7
- package/dist/StaticLikeC4Diagram.d.mts +1 -3
- package/dist/StaticLikeC4Diagram.mjs +1 -2
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/base/Background.mjs +1 -2
- package/dist/base/Base.d.mts +1 -2
- package/dist/base/Base.mjs +1 -2
- package/dist/base/BaseXYFlow.mjs +12 -10
- package/dist/base/const.d.mts +1 -3
- package/dist/base/const.mjs +1 -2
- package/dist/base/keyboardZoom.mjs +1 -2
- package/dist/base/types.d.mts +2 -4
- package/dist/base/updateEdges.mjs +1 -2
- package/dist/base/updateNodes.mjs +1 -2
- package/dist/base-primitives/Markdown.d.mts +5 -5
- package/dist/base-primitives/Markdown.mjs +22 -11
- package/dist/base-primitives/NodeHandles.d.mts +1 -3
- package/dist/base-primitives/NodeHandles.mjs +1 -2
- package/dist/base-primitives/compound/CompoundActionButton.d.mts +1 -2
- package/dist/base-primitives/compound/CompoundActionButton.mjs +3 -4
- package/dist/base-primitives/compound/CompoundDetailsButton.d.mts +1 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.mjs +3 -4
- package/dist/base-primitives/compound/CompoundNodeContainer.d.mts +1 -2
- package/dist/base-primitives/compound/CompoundNodeContainer.mjs +1 -2
- package/dist/base-primitives/compound/CompoundTitle.d.mts +1 -2
- package/dist/base-primitives/compound/CompoundTitle.mjs +1 -2
- package/dist/base-primitives/compound/actionbtns.css.mjs +1 -2
- package/dist/base-primitives/edge/EdgeActionButton.mjs +2 -3
- package/dist/base-primitives/edge/EdgeContainer.mjs +2 -3
- package/dist/base-primitives/edge/EdgeLabel.mjs +3 -3
- package/dist/base-primitives/edge/EdgeLabelContainer.mjs +2 -3
- package/dist/base-primitives/edge/EdgeMarkers.mjs +1 -2
- package/dist/base-primitives/edge/EdgePath.mjs +1 -2
- package/dist/base-primitives/element/ElementActionButtons.d.mts +1 -2
- package/dist/base-primitives/element/ElementActionButtons.mjs +2 -3
- package/dist/base-primitives/element/ElementData.d.mts +1 -2
- package/dist/base-primitives/element/ElementData.mjs +1 -2
- package/dist/base-primitives/element/ElementDetailsButton.d.mts +1 -2
- package/dist/base-primitives/element/ElementDetailsButton.mjs +2 -3
- package/dist/base-primitives/element/ElementNodeContainer.d.mts +1 -2
- package/dist/base-primitives/element/ElementNodeContainer.mjs +2 -3
- package/dist/base-primitives/element/ElementShape.d.mts +11 -6
- package/dist/base-primitives/element/ElementShape.mjs +10 -5
- package/dist/base-primitives/element/ElementTags.d.mts +6 -3
- package/dist/base-primitives/element/ElementTags.mjs +2 -4
- package/dist/base-primitives/index.d.mts +5 -5
- package/dist/base-primitives/memoEdge.d.mts +2 -6
- package/dist/base-primitives/memoEdge.mjs +1 -2
- package/dist/base-primitives/memoNode.d.mts +2 -6
- package/dist/components/EmptyBox.mjs +1 -2
- package/dist/components/ErrorFallback.d.mts +4 -3
- package/dist/components/ErrorFallback.mjs +61 -56
- package/dist/components/FloatingWindow.mjs +3 -4
- package/dist/components/GithubIcon.mjs +1 -2
- package/dist/components/Link.mjs +3 -4
- package/dist/components/Logo.d.mts +3 -5
- package/dist/components/Logo.mjs +28 -35
- package/dist/components/NavigationLink.mjs +1 -2
- package/dist/components/NavigationPanel.mjs +11 -11
- package/dist/components/PortalToContainer.d.mts +1 -3
- package/dist/components/PortalToContainer.mjs +1 -2
- package/dist/components/RootContainer.mjs +1 -2
- package/dist/components/SearchControl.css.mjs +1 -2
- package/dist/components/SearchControl.d.mts +1 -2
- package/dist/components/SearchControl.mjs +2 -3
- package/dist/components/ViewIcon.mjs +5 -6
- package/dist/components/ViewNotFound.mjs +1 -2
- package/dist/components/markdown/MarkdownWithRefs.mjs +268 -0
- package/dist/components/markdown/markdown-refs.mjs +145 -0
- package/dist/components/markdown/useMarkdownRefsInteractivity.mjs +126 -0
- package/dist/context/ComparingLayoutsContext.mjs +24 -0
- package/dist/context/CurrentViewModelProvider.mjs +1 -2
- package/dist/context/DiagramEventHandlers.mjs +3 -4
- package/dist/context/DiagramFeatures.d.mts +2 -3
- package/dist/context/DiagramFeatures.mjs +15 -9
- package/dist/context/EnsureMantine.mjs +1 -2
- package/dist/context/FramerMotionConfig.d.mts +1 -3
- package/dist/context/FramerMotionConfig.mjs +1 -2
- package/dist/context/IconRenderer.d.mts +1 -3
- package/dist/context/IconRenderer.mjs +14 -14
- package/dist/context/LikeC4ModelContext.d.mts +1 -2
- package/dist/context/LikeC4ModelContext.mjs +1 -2
- package/dist/context/LikeC4ProjectsContext.d.mts +1 -3
- package/dist/context/LikeC4ProjectsContext.mjs +1 -2
- package/dist/context/RootContainerContext.mjs +1 -2
- package/dist/context/TagStylesContext.d.mts +1 -2
- package/dist/context/TagStylesContext.mjs +7 -19
- package/dist/custom/builtins.d.mts +4 -1
- package/dist/custom/customNodes.d.mts +164 -7
- package/dist/custom/customNodes.mjs +387 -8
- package/dist/custom/index.d.mts +18 -30
- package/dist/custom/index.mjs +11 -19
- package/dist/custom/primitives.d.mts +3 -5
- package/dist/customization/CustomizationContext.d.mts +50 -0
- package/dist/customization/CustomizationContext.mjs +64 -0
- package/dist/customization/customizable.d.mts +32 -0
- package/dist/customization/customizable.mjs +75 -0
- package/dist/customization/customization-types.d.mts +40 -0
- package/dist/customization/customization-types.mjs +8 -0
- package/dist/customization/stableComponents.mjs +35 -0
- package/dist/editor/LikeC4EditorCallbacks.d.mts +1 -3
- package/dist/editor/LikeC4EditorCallbacks.mjs +1 -2
- package/dist/editor/LikeC4EditorProvider.d.mts +1 -3
- package/dist/editor/LikeC4EditorProvider.mjs +1 -2
- package/dist/editor/actor/actions.mjs +2 -3
- package/dist/editor/actor/hotkey.d.mts +1 -3
- package/dist/editor/actor/hotkey.mjs +1 -2
- package/dist/editor/actor/machine.d.mts +2 -4
- package/dist/editor/actor/machine.mjs +1 -2
- package/dist/editor/actor/setup.d.mts +1 -2
- package/dist/editor/actor/setup.mjs +1 -2
- package/dist/editor/actor/state.editor.mjs +2 -3
- package/dist/editor/actor/state.sync-queue.mjs +2 -3
- package/dist/editor/actor/types.d.mts +1 -3
- package/dist/editor/actor/types.mjs +1 -2
- package/dist/editor/applyChangesToManualLayout.mjs +1 -2
- package/dist/editor/index.d.mts +1 -1
- package/dist/editor/useEditorActorLogic.mjs +3 -4
- package/dist/hooks/safeContext.d.mts +16 -35
- package/dist/hooks/safeContext.mjs +1 -2
- package/dist/hooks/useCallbackRef.mjs +1 -2
- package/dist/hooks/useCurrentView.d.mts +1 -3
- package/dist/hooks/useCurrentView.mjs +1 -2
- package/dist/hooks/useCurrentViewModel.d.mts +0 -2
- package/dist/hooks/useCurrentViewModel.mjs +1 -2
- package/dist/hooks/useDiagram.d.mts +3 -12
- package/dist/hooks/useDiagram.mjs +11 -10
- package/dist/hooks/useDiagramCompareLayout.d.mts +2 -4
- package/dist/hooks/useDiagramCompareLayout.mjs +12 -21
- package/dist/hooks/useDiagramMarkdownRefActions.mjs +35 -0
- package/dist/hooks/useEdgeLabelFontLoader.mjs +29 -0
- package/dist/hooks/useEdgeTracks.mjs +2 -3
- package/dist/hooks/useEditorActor.mjs +1 -2
- package/dist/hooks/useId.mjs +1 -2
- package/dist/hooks/useLikeC4ElementsTree.mjs +1 -2
- package/dist/hooks/useLikeC4Model.d.mts +0 -2
- package/dist/hooks/useLikeC4Model.mjs +1 -2
- package/dist/hooks/useLikeC4Project.d.mts +2 -4
- package/dist/hooks/useLikeC4Project.mjs +1 -2
- package/dist/hooks/useLikeC4Styles.d.mts +1 -3
- package/dist/hooks/useLikeC4Styles.mjs +1 -2
- package/dist/hooks/useMantinePortalProps.mjs +1 -2
- package/dist/hooks/useSetState.mjs +1 -2
- package/dist/hooks/useUpdateEffect.d.mts +0 -2
- package/dist/hooks/useUpdateEffect.mjs +1 -2
- package/dist/hooks/useXYFlow.d.mts +1 -3
- package/dist/hooks/useXYFlow.mjs +1 -2
- package/dist/index.d.mts +20 -18
- package/dist/index.mjs +20 -18
- package/dist/likec4diagram/DiagramUI.mjs +14 -11
- package/dist/likec4diagram/DiagramXYFlow.mjs +34 -34
- package/dist/likec4diagram/convert-to-xyflow.mjs +7 -3
- package/dist/likec4diagram/custom/edges/EdgeDrifts.mjs +4 -3
- package/dist/likec4diagram/custom/edges/RelationshipEdge.mjs +18 -14
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.mjs +3 -4
- package/dist/likec4diagram/custom/edges/useControlPoints.mjs +2 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.mjs +2 -3
- package/dist/likec4diagram/custom/index.mjs +4 -5
- package/dist/likec4diagram/custom/nodes/CompoundActions.d.mts +1 -2
- package/dist/likec4diagram/custom/nodes/CompoundActions.mjs +2 -3
- package/dist/likec4diagram/custom/nodes/ElementActions.d.mts +3 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.mjs +4 -5
- package/dist/likec4diagram/custom/nodes/GraphElementNode.d.mts +6 -1
- package/dist/likec4diagram/custom/nodes/GraphElementNode.mjs +3 -4
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.mts +6 -1
- package/dist/likec4diagram/custom/nodes/NodeDrifts.mjs +4 -3
- package/dist/likec4diagram/custom/nodes/NodeNotes.mjs +3 -5
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.d.mts +1 -3
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.mjs +3 -4
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.mts +3 -1
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/index.d.mts +4 -4
- package/dist/likec4diagram/custom/nodes/nodes.d.mts +3 -4
- package/dist/likec4diagram/custom/nodes/nodes.mjs +19 -21
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.d.mts +1 -3
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.mts +1 -3
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.mjs +4 -5
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.mts +1 -3
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.mjs +4 -6
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.mjs +3 -4
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/types.mjs +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.mjs +1 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.mjs +29 -12
- package/dist/likec4diagram/relationship-popover/actor.mjs +1 -2
- package/dist/likec4diagram/relationship-popover/components.mjs +1 -2
- package/dist/likec4diagram/state/DiagramActorProvider.mjs +22 -34
- package/dist/likec4diagram/state/aligners.d.mts +1 -3
- package/dist/likec4diagram/state/aligners.mjs +1 -2
- package/dist/likec4diagram/state/assign.mjs +3 -4
- package/dist/likec4diagram/state/createViewChange.mjs +1 -2
- package/dist/likec4diagram/state/diagram-api.d.mts +33 -16
- package/dist/likec4diagram/state/diagram-api.mjs +55 -31
- package/dist/likec4diagram/state/hotkeyActor.d.mts +1 -3
- package/dist/likec4diagram/state/hotkeyActor.mjs +12 -6
- package/dist/likec4diagram/state/machine.actions.layout.mjs +2 -3
- package/dist/likec4diagram/state/machine.actions.mjs +81 -44
- package/dist/likec4diagram/state/machine.d.mts +107 -15
- package/dist/likec4diagram/state/machine.mjs +3 -4
- package/dist/likec4diagram/state/machine.setup.d.mts +14 -10
- package/dist/likec4diagram/state/machine.setup.mjs +55 -28
- package/dist/likec4diagram/state/machine.state.initializing.mjs +3 -4
- package/dist/likec4diagram/state/machine.state.navigating.mjs +3 -6
- package/dist/likec4diagram/state/machine.state.ready.comparing.mjs +63 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.mjs +10 -7
- package/dist/likec4diagram/state/machine.state.ready.idle.mjs +10 -7
- package/dist/likec4diagram/state/machine.state.ready.mjs +8 -8
- package/dist/likec4diagram/state/machine.state.ready.printing.mjs +3 -4
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.mjs +5 -6
- package/dist/likec4diagram/state/mediaPrintActor.d.mts +1 -3
- package/dist/likec4diagram/state/mediaPrintActor.mjs +1 -2
- package/dist/likec4diagram/state/persistence.mjs +12 -5
- package/dist/likec4diagram/state/types.d.mts +1 -3
- package/dist/likec4diagram/state/utils.mjs +2 -3
- package/dist/likec4diagram/types.d.mts +1 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.mjs +5 -7
- package/dist/likec4diagram/ui/notation/NotationPanel.css.mjs +1 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.mjs +6 -7
- package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.mjs +2 -3
- package/dist/likec4diagram/ui/sequence-outline/FlowRow.mjs +3 -4
- package/dist/likec4diagram/ui/sequence-outline/OutlineBody.mjs +4 -7
- package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.mjs +4 -5
- package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.mjs +4 -6
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.mjs +2 -3
- package/dist/likec4diagram/ui/sequence-outline/StepBadge.mjs +1 -2
- package/dist/likec4diagram/ui/sequence-outline/StepRow.mjs +7 -8
- package/dist/likec4diagram/ui/sequence-outline/StoreProvider.mjs +3 -9
- package/dist/likec4diagram/ui/sequence-outline/depth-of-field.mjs +1 -2
- package/dist/likec4diagram/ui/sequence-outline/motion.mjs +1 -2
- package/dist/likec4diagram/ui/sequence-outline/presentation.mjs +7 -8
- package/dist/likec4diagram/ui/sequence-outline/tree.mjs +1 -2
- package/dist/likec4diagram/ui/sequence-outline/types.mjs +1 -2
- package/dist/likec4diagram/useLayoutConstraints.mjs +5 -10
- package/dist/likec4diagram/useNodeDragHandlers.mjs +28 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.mjs +9 -2
- package/dist/likec4diagram/xyflow-graph/graph-view-to-xy.mjs +1 -2
- package/dist/likec4diagram/xyflow-graph/useGraphForceSimulation.mjs +3 -6
- package/dist/likec4diagram/xyflow-props.mjs +25 -0
- package/dist/likec4diagram/xyflow-sequence/const.mjs +1 -2
- package/dist/likec4diagram/xyflow-sequence/layouter.mjs +2 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-view-to-xy.mjs +2 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-view.mjs +2 -3
- package/dist/likec4diagram/xyflow-sequence/utils.mjs +1 -2
- package/dist/navigationpanel/ElementViewControls.mjs +6 -7
- package/dist/navigationpanel/NavigationPanel.mjs +38 -67
- package/dist/navigationpanel/NavigationPanelControls.mjs +35 -114
- package/dist/navigationpanel/NavigationPanelDropdown.mjs +37 -34
- package/dist/navigationpanel/_common.mjs +3 -4
- package/dist/navigationpanel/actor.actions.mjs +1 -2
- package/dist/navigationpanel/actor.d.mts +0 -2
- package/dist/navigationpanel/actor.mjs +2 -3
- package/dist/navigationpanel/actor.setup.d.mts +1 -3
- package/dist/navigationpanel/actor.setup.mjs +1 -2
- package/dist/navigationpanel/comparepanel/ComparePanel.mjs +160 -90
- package/dist/navigationpanel/comparepanel/DriftsSummary.mjs +173 -142
- package/dist/{likec4diagram/ui → navigationpanel/comparepanel}/LayoutDriftFrame.mjs +6 -12
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.mjs +14 -19
- package/dist/navigationpanel/controls/LayoutWarning.mjs +3 -4
- package/dist/navigationpanel/controls/LogoButton.mjs +5 -23
- package/dist/navigationpanel/controls/NavigationBreadcrumbs.mjs +110 -0
- package/dist/navigationpanel/controls/NavigationButtons.mjs +3 -4
- package/dist/navigationpanel/controls/OpenSource.mjs +2 -3
- package/dist/navigationpanel/controls/SearchControl.mjs +2 -3
- package/dist/navigationpanel/controls/ToggleReadonly.mjs +36 -21
- package/dist/navigationpanel/controls/ViewDetailsButton.mjs +12 -15
- package/dist/navigationpanel/dropdown/ProjectsMenu.mjs +46 -13
- package/dist/navigationpanel/editorpanel/ApplySemanticLayout.mjs +3 -4
- package/dist/navigationpanel/editorpanel/CenterCamera.mjs +2 -3
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.mjs +3 -4
- package/dist/navigationpanel/editorpanel/EditorPanel.mjs +4 -4
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.mjs +11 -13
- package/dist/navigationpanel/editorpanel/ToggleReadonly.mjs +2 -3
- package/dist/navigationpanel/editorpanel/_common.mjs +1 -2
- package/dist/navigationpanel/editorpanel/styles.mjs +1 -2
- package/dist/navigationpanel/hooks.mjs +1 -2
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.mjs +5 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.mjs +7 -9
- package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.mjs +1 -2
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.mjs +3 -4
- package/dist/navigationpanel/windows/ViewDetailsWindow.mjs +44 -38
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowFork.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowGuide.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.mjs +1 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCaretRightFilled.mjs +16 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCornerDownRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStop.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRepeat.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRobot.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSparkles.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs +1 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.49.0_react@19.3.0 → @tabler_icons-react@3.49.0_react@19.3.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.mjs +1 -2
- package/dist/overlays/Overlays.mjs +4 -5
- package/dist/overlays/element-details/ElementDetails.mjs +2 -3
- package/dist/overlays/element-details/ElementDetailsCard.css.mjs +148 -102
- package/dist/overlays/element-details/ElementDetailsCard.mjs +503 -256
- package/dist/overlays/element-details/MetadataValue.mjs +115 -222
- package/dist/overlays/element-details/PropertiesSplit.mjs +162 -0
- package/dist/overlays/element-details/TabPanelDeployments.css.mjs +1 -2
- package/dist/overlays/element-details/TabPanelDeployments.mjs +5 -6
- package/dist/overlays/element-details/TabPanelRelationships.css.mjs +1 -2
- package/dist/overlays/element-details/TabPanelRelationships.mjs +6 -7
- package/dist/overlays/element-details/TabPanelStructure.css.mjs +1 -2
- package/dist/overlays/element-details/TabPanelStructure.mjs +3 -4
- package/dist/overlays/element-details/TabPanelViews.mjs +51 -0
- package/dist/overlays/element-details/actor.d.mts +6 -7
- package/dist/overlays/element-details/actor.mjs +31 -15
- package/dist/overlays/element-details/actorContext.mjs +1 -2
- package/dist/overlays/element-details/subject.d.mts +12 -0
- package/dist/overlays/element-details/subject.mjs +15 -0
- package/dist/overlays/hooks.mjs +1 -2
- package/dist/overlays/overlay/Overlay.d.mts +1 -3
- package/dist/overlays/overlay/Overlay.mjs +4 -5
- package/dist/overlays/overlaysActor.d.mts +12 -5
- package/dist/overlays/overlaysActor.mjs +24 -6
- package/dist/overlays/relationship-details/RelationshipDetails.mjs +16 -8
- package/dist/overlays/relationship-details/SelectEdge.css.mjs +1 -2
- package/dist/overlays/relationship-details/SelectEdge.mjs +3 -4
- package/dist/overlays/relationship-details/_types.d.mts +6 -4
- package/dist/overlays/relationship-details/actor.d.mts +0 -2
- package/dist/overlays/relationship-details/actor.mjs +2 -3
- package/dist/overlays/relationship-details/compute.mjs +1 -2
- package/dist/overlays/relationship-details/custom/ElementActions.mjs +6 -7
- package/dist/overlays/relationship-details/custom/edgeTypes.mjs +8 -13
- package/dist/overlays/relationship-details/custom/nodeTypes.mjs +8 -6
- package/dist/overlays/relationship-details/hooks.mjs +1 -2
- package/dist/overlays/relationship-details/layout-to-xyflow.mjs +3 -3
- package/dist/overlays/relationship-details/layout.d.mts +1 -3
- package/dist/overlays/relationship-details/layout.mjs +39 -13
- package/dist/overlays/relationships-browser/RelationshipsBrowser.mjs +12 -13
- package/dist/overlays/relationships-browser/SelectElement.css.mjs +1 -2
- package/dist/overlays/relationships-browser/SelectElement.mjs +4 -5
- package/dist/overlays/relationships-browser/_types.d.mts +6 -4
- package/dist/overlays/relationships-browser/actor.d.mts +0 -2
- package/dist/overlays/relationships-browser/actor.mjs +4 -5
- package/dist/overlays/relationships-browser/const.mjs +1 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.mjs +6 -7
- package/dist/overlays/relationships-browser/custom/EmptyNode.mjs +1 -2
- package/dist/overlays/relationships-browser/custom/edgeTypes.mjs +14 -17
- package/dist/overlays/relationships-browser/custom/nodeTypes.mjs +12 -7
- package/dist/overlays/relationships-browser/hooks.mjs +1 -2
- package/dist/overlays/relationships-browser/layout.d.mts +1 -3
- package/dist/overlays/relationships-browser/layout.mjs +73 -24
- package/dist/overlays/relationships-browser/useViewToNodesEdges.mjs +2 -2
- package/dist/overlays/types.d.mts +5 -7
- package/dist/projects-overview/ProjectsOverview.d.mts +1 -3
- package/dist/projects-overview/ProjectsOverview.mjs +1 -2
- package/dist/projects-overview/ProjectsOverviewXY.d.mts +1 -3
- package/dist/projects-overview/ProjectsOverviewXY.mjs +3 -4
- package/dist/projects-overview/actor.mjs +1 -2
- package/dist/projects-overview/context.mjs +1 -2
- package/dist/projects-overview/custom/edgeTypes.mjs +2 -3
- package/dist/projects-overview/custom/nodeTypes.mjs +3 -4
- package/dist/projects-overview/hooks.mjs +1 -2
- package/dist/projects-overview/layouted-to-xyflow.mjs +1 -2
- package/dist/projects-overview/panel/ProjectsOverviewPanel.mjs +1 -2
- package/dist/projects-overview/persistence.mjs +1 -2
- package/dist/search/Search.d.mts +1 -3
- package/dist/search/Search.mjs +13 -12
- package/dist/search/SearchContext.d.mts +1 -3
- package/dist/search/SearchContext.mjs +1 -2
- package/dist/search/XStateSearchAdapter.mjs +1 -2
- package/dist/search/components/ElementsColumn.css.mjs +1 -2
- package/dist/search/components/ElementsColumn.mjs +31 -9
- package/dist/search/components/PickView.mjs +3 -4
- package/dist/search/components/SearchByTags.mjs +3 -4
- package/dist/search/components/SearchInput.mjs +3 -4
- package/dist/search/components/ViewsColum.mjs +20 -20
- package/dist/search/components/ViewsColumn.css.mjs +1 -2
- package/dist/search/components/_shared.css.mjs +1 -2
- package/dist/search/components/styles.css.mjs +1 -2
- package/dist/search/components/utils.mjs +32 -3
- package/dist/search/fuzzy.mjs +27 -0
- package/dist/search/hooks.mjs +1 -2
- package/dist/search/metadata-search.mjs +32 -0
- package/dist/search/searchActor.d.mts +1 -3
- package/dist/search/searchActor.mjs +1 -2
- package/dist/shadowroot/ShadowRoot.mjs +8 -7
- package/dist/styles-font2.mjs +1 -2
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles2.mjs +2 -3
- package/dist/utils/defineActors.d.mts +1 -3
- package/dist/utils/defineActors.mjs +1 -2
- package/dist/utils/edge-corners.mjs +2 -3
- package/dist/utils/edge-endpoints.mjs +1 -2
- package/dist/utils/edge-label.mjs +1 -2
- package/dist/utils/edge-path-through-label.mjs +51 -0
- package/dist/utils/edge-path.mjs +1 -2
- package/dist/utils/edge-tracks.mjs +1 -2
- package/dist/utils/filterProjects.d.mts +10 -0
- package/dist/utils/filterProjects.mjs +36 -0
- package/dist/utils/index.mjs +1 -0
- package/dist/utils/measure-edge-label.mjs +129 -0
- package/dist/utils/readableText.mjs +1 -2
- package/dist/utils/roundDpr.mjs +1 -2
- package/dist/utils/search-event.mjs +17 -0
- package/dist/utils/view-bounds.d.mts +1 -3
- package/dist/utils/view-bounds.mjs +1 -2
- package/dist/utils/view-routing.mjs +1 -2
- package/dist/utils/xyflow.mjs +2 -3
- package/dist/webcomponent/defineWebcomponent.d.mts +12 -0
- package/dist/webcomponent/defineWebcomponent.mjs +93 -0
- package/package.json +29 -26
- package/panda.buildinfo.json +211 -208
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/base-primitives/memoNode.mjs +0 -23
- package/dist/context/DiagramEventHandlers.d.mts +0 -11
- package/dist/custom/hooks.d.mts +0 -17
- package/dist/hooks/useSetState.d.mts +0 -10
- package/dist/likec4diagram/custom/edges/edges.css.mjs +0 -50
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.mjs +0 -69
- package/dist/navigationpanel/comparepanel/ComparePanelControls.mjs +0 -56
- package/dist/navigationpanel/styles.css.mjs +0 -23
- package/src/styles-font.css +0 -114
- package/src/styles-min.css +0 -2
- package/src/styles-xyflow.css +0 -1
- package/src/styles.css +0 -3
|
@@ -1,33 +1,62 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { Base } from "../../base/Base.mjs";
|
|
3
|
+
import { detailsSubject } from "../../overlays/element-details/subject.mjs";
|
|
3
4
|
import { viewRouting } from "../../utils/view-routing.mjs";
|
|
4
5
|
import { convertToXYFlow } from "../convert-to-xyflow.mjs";
|
|
5
|
-
import { findDiagramEdge, findDiagramNode, typedSystem, viewBounds } from "./utils.mjs";
|
|
6
|
-
import { machine } from "./machine.setup.mjs";
|
|
7
6
|
import { createLayoutConstraints } from "../useLayoutConstraints.mjs";
|
|
8
|
-
import { focusNodesEdges, mergeXYNodesEdges, resetEdgeControlPoints } from "./assign.mjs";
|
|
9
7
|
import { getAligner, toNodeRect } from "./aligners.mjs";
|
|
8
|
+
import { focusNodesEdges, mergeXYNodesEdges, resetEdgeControlPoints } from "./assign.mjs";
|
|
10
9
|
import { assignViewportBefore, cancelFitDiagram, centerOnNodeOrEdge, fitDiagram, fitFocusedBounds, raiseFitDiagram, raiseSetViewport, raiseUpdateView, returnViewportBefore, setViewport, setViewportCenter } from "./machine.actions.layout.mjs";
|
|
10
|
+
import { machine } from "./machine.setup.mjs";
|
|
11
|
+
import { findDiagramEdge, findDiagramNode, typedSystem, viewBounds } from "./utils.mjs";
|
|
11
12
|
import { hasAtLeast, isTruthy, mapToObj, omit } from "remeda";
|
|
12
13
|
import { dynamicViewFlow, exact, invariant, isDynamicView, nonNullable, nonexhaustive } from "@likec4/core";
|
|
14
|
+
import { nodeToRect } from "@xyflow/system";
|
|
13
15
|
import { BBox as BBox$1 } from "@likec4/core/geometry";
|
|
14
16
|
import { difference as difference$1, isString as isString$1 } from "@likec4/core/utils";
|
|
15
|
-
import { nodeToRect } from "@xyflow/system";
|
|
16
17
|
import { getViewFolderPath } from "@likec4/core/model";
|
|
17
18
|
import { assertEvent } from "xstate";
|
|
18
19
|
import { produce } from "immer";
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
// src/likec4diagram/state/machine.actions.ts
|
|
21
22
|
const resetSelection = () => machine.raise({ type: "xyflow.resetSelection" });
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Resolves the layout type requested by `emit.onLayoutTypeChange`,
|
|
25
|
+
* or toggles the current one, if the action is triggered by another event.
|
|
26
|
+
*/
|
|
27
|
+
const resolveNextLayoutType = (context, event) => {
|
|
28
|
+
if (event.type === "emit.onLayoutTypeChange") return event.layoutType;
|
|
29
|
+
return context.view._layout === "auto" ? "manual" : "auto";
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Comparing layouts: before switching the layout type,
|
|
33
|
+
* remembers the viewport of the current layout (to restore it when switching back)
|
|
34
|
+
* and cancels pending editor changes when switching from manual to auto.
|
|
35
|
+
*/
|
|
36
|
+
const beforeLayoutTypeChangeWhileComparing = () => machine.enqueueActions(({ context, event, enqueue }) => {
|
|
37
|
+
const currentLayoutType = context.view._layout;
|
|
38
|
+
const nextLayoutType = resolveNextLayoutType(context, event);
|
|
39
|
+
if (!currentLayoutType || currentLayoutType === nextLayoutType) return;
|
|
40
|
+
if (currentLayoutType === "manual") {
|
|
41
|
+
enqueue.sendTo(typedSystem.editorActor, { type: "cancel" });
|
|
42
|
+
enqueue.assign({ viewportOnManualLayout: context.viewport });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
enqueue.assign({ viewportOnAutoLayout: context.viewport });
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Comparing layouts: on exit, switches back to manual layout (if auto is active)
|
|
49
|
+
* and forgets the remembered viewports.
|
|
50
|
+
*/
|
|
51
|
+
const exitComparingLayouts = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
52
|
+
if (context.view._layout === "auto") enqueue.emit({
|
|
53
|
+
type: "onLayoutTypeChange",
|
|
54
|
+
layoutType: "manual"
|
|
55
|
+
});
|
|
56
|
+
enqueue.assign({
|
|
28
57
|
viewportOnAutoLayout: null,
|
|
29
58
|
viewportOnManualLayout: null
|
|
30
|
-
};
|
|
59
|
+
});
|
|
31
60
|
});
|
|
32
61
|
const onEdgeDoubleClick = () => machine.assign(({ context, event }) => {
|
|
33
62
|
assertEvent(event, "xyflow.edgeDoubleClick");
|
|
@@ -233,18 +262,11 @@ const emitOnLayoutTypeChange = () => machine.enqueueActions(({ event, context, e
|
|
|
233
262
|
return;
|
|
234
263
|
}
|
|
235
264
|
const currentLayoutType = context.view._layout;
|
|
236
|
-
|
|
237
|
-
if (event.type === "emit.onLayoutTypeChange") nextLayoutType = event.layoutType;
|
|
265
|
+
const nextLayoutType = resolveNextLayoutType(context, event);
|
|
238
266
|
if (currentLayoutType === nextLayoutType) {
|
|
239
267
|
console.warn("Ignoring layout type change event, layout type is already", currentLayoutType);
|
|
240
268
|
return;
|
|
241
269
|
}
|
|
242
|
-
if (context.toggledFeatures.enableCompareWithLatest === true) {
|
|
243
|
-
if (currentLayoutType === "manual" && nextLayoutType === "auto") enqueue.sendTo(typedSystem.editorActor, { type: "cancel" });
|
|
244
|
-
const currentViewport = context.viewport;
|
|
245
|
-
if (currentLayoutType === "auto") enqueue.assign({ viewportOnAutoLayout: currentViewport });
|
|
246
|
-
if (currentLayoutType === "manual") enqueue.assign({ viewportOnManualLayout: currentViewport });
|
|
247
|
-
}
|
|
248
270
|
enqueue.emit({
|
|
249
271
|
type: "onLayoutTypeChange",
|
|
250
272
|
layoutType: nextLayoutType
|
|
@@ -407,27 +429,35 @@ const sendSynced = () => {
|
|
|
407
429
|
};
|
|
408
430
|
const stopEditing = (wasChanged = false) => machine.sendTo(typedSystem.editorActor, { type: wasChanged ? "edit.move.end" : "edit.move.cancel" });
|
|
409
431
|
const cancelEditing = () => machine.sendTo(typedSystem.editorActor, { type: "cancel" });
|
|
410
|
-
const
|
|
411
|
-
const openElementDetails = (params) => machine.enqueueActions(({ context, event, enqueue }) => {
|
|
432
|
+
const openNodeDetails = () => machine.enqueueActions(({ context, event, enqueue }) => {
|
|
412
433
|
let initiatedFrom = null;
|
|
413
434
|
let fromNodeId;
|
|
414
435
|
let subject;
|
|
415
436
|
switch (true) {
|
|
416
|
-
case
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
case event.type === "xyflow.nodeClick":
|
|
421
|
-
if (!hasModelFqn(event.node)) {
|
|
422
|
-
console.warn("No modelFqn in clicked node data");
|
|
437
|
+
case event.type === "xyflow.nodeClick": {
|
|
438
|
+
const clickedSubject = detailsSubject(event.node.data);
|
|
439
|
+
if (!clickedSubject) {
|
|
440
|
+
console.warn("No model or deployment reference in clicked node data");
|
|
423
441
|
return;
|
|
424
442
|
}
|
|
425
|
-
subject =
|
|
443
|
+
subject = clickedSubject;
|
|
426
444
|
fromNodeId = event.node.data.id;
|
|
427
445
|
break;
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
446
|
+
}
|
|
447
|
+
case event.type === "open.nodeDetails":
|
|
448
|
+
if (isString$1(event.target)) {
|
|
449
|
+
const node = context.xynodes.find((n) => n.id === event.target);
|
|
450
|
+
const nodeSubject = node ? detailsSubject(node.data) : null;
|
|
451
|
+
if (!nodeSubject) {
|
|
452
|
+
console.warn("No model or deployment reference for node", event.target);
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
subject = nodeSubject;
|
|
456
|
+
fromNodeId = event.fromNode ?? event.target;
|
|
457
|
+
} else {
|
|
458
|
+
subject = event.target;
|
|
459
|
+
fromNodeId = event.fromNode ?? (subject.type === "deployment" ? context.view.nodes.find((n) => n.deploymentRef === subject.deployment)?.id : void 0);
|
|
460
|
+
}
|
|
431
461
|
break;
|
|
432
462
|
default: {
|
|
433
463
|
if (!context.lastClickedNode) {
|
|
@@ -436,11 +466,12 @@ const openElementDetails = (params) => machine.enqueueActions(({ context, event,
|
|
|
436
466
|
}
|
|
437
467
|
fromNodeId = context.lastClickedNode.id;
|
|
438
468
|
const node = context.xynodes.find((n) => n.id === fromNodeId);
|
|
439
|
-
|
|
440
|
-
|
|
469
|
+
const clickedSubject = node ? detailsSubject(node.data) : null;
|
|
470
|
+
if (!clickedSubject) {
|
|
471
|
+
console.warn("No model or deployment reference in last clicked node");
|
|
441
472
|
return;
|
|
442
473
|
}
|
|
443
|
-
subject =
|
|
474
|
+
subject = clickedSubject;
|
|
444
475
|
break;
|
|
445
476
|
}
|
|
446
477
|
}
|
|
@@ -469,15 +500,15 @@ const openOverlay = () => machine.enqueueActions(({ context, event, enqueue, che
|
|
|
469
500
|
assertEvent(event, [
|
|
470
501
|
"open.relationshipsBrowser",
|
|
471
502
|
"open.relationshipDetails",
|
|
472
|
-
"open.
|
|
503
|
+
"open.nodeDetails"
|
|
473
504
|
]);
|
|
474
505
|
if (!check("enabled: Overlays")) {
|
|
475
506
|
console.warn("Overlays feature is disabled");
|
|
476
507
|
return;
|
|
477
508
|
}
|
|
478
509
|
switch (event.type) {
|
|
479
|
-
case "open.
|
|
480
|
-
check("enabled: ElementDetails") ? enqueue(
|
|
510
|
+
case "open.nodeDetails":
|
|
511
|
+
check("enabled: ElementDetails") ? enqueue(openNodeDetails()) : console.warn("ElementDetails feature is disabled");
|
|
481
512
|
break;
|
|
482
513
|
case "open.relationshipsBrowser":
|
|
483
514
|
if (!context.features.enableRelationshipBrowser) {
|
|
@@ -718,7 +749,13 @@ const handleNavigate = () => machine.enqueueActions(({ enqueue, context, event }
|
|
|
718
749
|
default: nonexhaustive(event);
|
|
719
750
|
}
|
|
720
751
|
});
|
|
721
|
-
|
|
752
|
+
/**
|
|
753
|
+
* Updates the current view in place.
|
|
754
|
+
*
|
|
755
|
+
* @param params.restoreLayoutViewport - when layout type changes (comparing layouts),
|
|
756
|
+
* restore the viewport remembered for the next layout type, or recenter
|
|
757
|
+
*/
|
|
758
|
+
const updateView = (params) => machine.enqueueActions(({ enqueue, event, context }) => {
|
|
722
759
|
if (event.type !== "update.view") {
|
|
723
760
|
console.warn(`Ignoring unexpected event type: ${event.type} in action 'update.view'`);
|
|
724
761
|
return;
|
|
@@ -731,7 +768,8 @@ const updateView = () => machine.enqueueActions(({ enqueue, event, context }) =>
|
|
|
731
768
|
enqueue(assignXYDataFromView());
|
|
732
769
|
if (event.source === "editor") return;
|
|
733
770
|
enqueue(sendSynced());
|
|
734
|
-
|
|
771
|
+
const restoreLayoutViewport = params?.restoreLayoutViewport === true;
|
|
772
|
+
if (restoreLayoutViewport && context.view._layout !== nextView._layout) {
|
|
735
773
|
if (nextView._layout === "auto" && context.viewportOnAutoLayout) {
|
|
736
774
|
enqueue(setViewport({
|
|
737
775
|
viewport: context.viewportOnAutoLayout,
|
|
@@ -748,7 +786,7 @@ const updateView = () => machine.enqueueActions(({ enqueue, event, context }) =>
|
|
|
748
786
|
}
|
|
749
787
|
}
|
|
750
788
|
let recenter = !context.viewportChangedManually && !context.focusedNode && !context.activeWalkthrough;
|
|
751
|
-
recenter = recenter ||
|
|
789
|
+
recenter = recenter || restoreLayoutViewport && !!nextView._layout && context.view._layout !== nextView._layout;
|
|
752
790
|
if (nextView._type === "dynamic" && context.view._type === "dynamic") {
|
|
753
791
|
if (nextView.variant === context.view.variant && nextView.variant !== context.dynamicViewVariant) {
|
|
754
792
|
const nextCenter = BBox$1.center(viewBounds(context, nextView));
|
|
@@ -796,5 +834,4 @@ const collapseOrExpandSequenceFlow = () => machine.enqueueActions(({ enqueue, ev
|
|
|
796
834
|
}
|
|
797
835
|
});
|
|
798
836
|
|
|
799
|
-
|
|
800
|
-
export { assignDynamicViewVariant, assignElementViewVariant, assignFocusedNode, assignLastClickedNode, assignToggledFeatures, assignViewportBefore, assignXYDataFromView, cancelAutoUnfocusTimer, cancelEditing, cancelFitDiagram, centerOnNodeOrEdge, closeAllOverlays, collapseOrExpandSequenceFlow, disableCompareWithLatest, emitEdgeClick, emitInitialized, emitNavigateTo, emitNodeClick, emitOnLayoutTypeChange, emitOpenSource, emitOpenSourceOfView, emitPaneClick, ensureAllActors, ensureEditorActor, ensureNavigationPanelActor, ensureOverlaysActor, ensureSearchActor, fitDiagram, fitFocusedBounds, focusOnNodesAndEdges, handleNavigate, highlightNodeOrEdge, layoutAlign, notationsHighlight, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseLeave, onNodeMouseEnter, onNodeMouseLeave, openElementDetails, openOverlay, openSourceOfFocusedOrLastClickedNode, raiseFitDiagram, raiseSetViewport, raiseUpdateView, resetEdgesControlPoints, resetLastClickedNode, resetSelection, returnViewportBefore, sendSynced, setViewport, setViewportCenter, startAutoUnfocusTimer, startEditing, startHotKeyActor, stopEditing, stopEditorActor, stopHotKeyActor, tagHighlight, triggerChange, undimEverything, updateFeatures, updateInputs, updateView };
|
|
837
|
+
export { assignDynamicViewVariant, assignElementViewVariant, assignFocusedNode, assignLastClickedNode, assignToggledFeatures, assignViewportBefore, assignXYDataFromView, beforeLayoutTypeChangeWhileComparing, cancelAutoUnfocusTimer, cancelEditing, cancelFitDiagram, centerOnNodeOrEdge, closeAllOverlays, collapseOrExpandSequenceFlow, emitEdgeClick, emitInitialized, emitNavigateTo, emitNodeClick, emitOnLayoutTypeChange, emitOpenSource, emitOpenSourceOfView, emitPaneClick, ensureAllActors, ensureEditorActor, ensureNavigationPanelActor, ensureOverlaysActor, ensureSearchActor, exitComparingLayouts, fitDiagram, fitFocusedBounds, focusOnNodesAndEdges, handleNavigate, highlightNodeOrEdge, layoutAlign, notationsHighlight, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseLeave, onNodeMouseEnter, onNodeMouseLeave, openNodeDetails, openOverlay, openSourceOfFocusedOrLastClickedNode, raiseFitDiagram, raiseSetViewport, raiseUpdateView, resetEdgesControlPoints, resetLastClickedNode, resetSelection, returnViewportBefore, sendSynced, setViewport, setViewportCenter, startAutoUnfocusTimer, startEditing, startHotKeyActor, stopEditing, stopEditorActor, stopHotKeyActor, tagHighlight, triggerChange, undimEverything, updateFeatures, updateInputs, updateView };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { BaseEditorActorRef } from "../../editor/actor/setup.mjs";
|
|
3
|
-
import { NavigationPanelActorLogic, NavigationPanelActorRef } from "../../navigationpanel/actor.mjs";
|
|
4
|
-
import { OverlaysActorLogic, OverlaysActorRef } from "../../overlays/overlaysActor.mjs";
|
|
5
2
|
import { SearchActorLogic, SearchActorRef } from "../../search/searchActor.mjs";
|
|
3
|
+
import { EditorActorLogic } from "../../editor/actor/machine.mjs";
|
|
6
4
|
import { HotkeyActorLogic } from "./hotkeyActor.mjs";
|
|
5
|
+
import { OverlaysActorLogic, OverlaysActorRef } from "../../overlays/overlaysActor.mjs";
|
|
7
6
|
import { MediaPrintActorLogic } from "./mediaPrintActor.mjs";
|
|
8
|
-
import { EditorActorLogic } from "../../editor/actor/machine.mjs";
|
|
9
7
|
import "../../editor/index.mjs";
|
|
8
|
+
import { NavigationPanelActorLogic, NavigationPanelActorRef } from "../../navigationpanel/actor.mjs";
|
|
10
9
|
import { BaseDiagramMachineLogic, Context, EmittedEvents, Events, Input } from "./machine.setup.mjs";
|
|
10
|
+
import { BaseEditorActorRef } from "../../editor/actor/setup.mjs";
|
|
11
11
|
import { ActorRef, SnapshotFrom, StateValueFrom } from "xstate";
|
|
12
|
-
//#region src/likec4diagram/state/machine.d.ts
|
|
13
12
|
declare const _diagramMachine: import("xstate").StateMachine<Context, Events, {
|
|
14
13
|
search?: import("xstate").ActorRefFromLogic<SearchActorLogic>;
|
|
15
14
|
hotkey?: import("xstate").ActorRefFromLogic<HotkeyActorLogic>;
|
|
@@ -41,20 +40,114 @@ declare const _diagramMachine: import("xstate").StateMachine<Context, Events, {
|
|
|
41
40
|
src: "navigationPanel";
|
|
42
41
|
logic: NavigationPanelActorLogic;
|
|
43
42
|
id: "navigationPanel";
|
|
44
|
-
}, never,
|
|
45
|
-
|
|
43
|
+
}, never, {
|
|
44
|
+
type: "isReady";
|
|
45
|
+
params: unknown;
|
|
46
|
+
} | {
|
|
47
|
+
type: "enabled: Editor";
|
|
48
|
+
params: unknown;
|
|
49
|
+
} | {
|
|
50
|
+
type: "enabled: FitView";
|
|
51
|
+
params: unknown;
|
|
52
|
+
} | {
|
|
53
|
+
type: "enabled: FocusMode";
|
|
54
|
+
params: unknown;
|
|
55
|
+
} | {
|
|
56
|
+
type: "enabled: Readonly";
|
|
57
|
+
params: unknown;
|
|
58
|
+
} | {
|
|
59
|
+
type: "enabled: RelationshipDetails";
|
|
60
|
+
params: unknown;
|
|
61
|
+
} | {
|
|
62
|
+
type: "enabled: Search";
|
|
63
|
+
params: unknown;
|
|
64
|
+
} | {
|
|
65
|
+
type: "enabled: ElementDetails";
|
|
66
|
+
params: unknown;
|
|
67
|
+
} | {
|
|
68
|
+
type: "enabled: OpenSource";
|
|
69
|
+
params: unknown;
|
|
70
|
+
} | {
|
|
71
|
+
type: "enabled: DynamicViewWalkthrough";
|
|
72
|
+
params: unknown;
|
|
73
|
+
} | {
|
|
74
|
+
type: "enabled: NavigationPanel";
|
|
75
|
+
params: unknown;
|
|
46
76
|
} | {
|
|
47
|
-
|
|
77
|
+
type: "focus.node: autoUnfocus";
|
|
78
|
+
params: unknown;
|
|
79
|
+
} | {
|
|
80
|
+
type: "enabled: Overlays";
|
|
81
|
+
params: unknown;
|
|
82
|
+
} | {
|
|
83
|
+
type: "not readonly";
|
|
84
|
+
params: unknown;
|
|
85
|
+
} | {
|
|
86
|
+
type: "can compare layouts";
|
|
87
|
+
params: unknown;
|
|
88
|
+
} | {
|
|
89
|
+
type: "is dynamic view";
|
|
90
|
+
params: unknown;
|
|
91
|
+
} | {
|
|
92
|
+
type: "is dynamic view in sequence variant";
|
|
93
|
+
params: unknown;
|
|
94
|
+
} | {
|
|
95
|
+
type: "is same view";
|
|
96
|
+
params: unknown;
|
|
97
|
+
} | {
|
|
98
|
+
type: "is another view";
|
|
99
|
+
params: unknown;
|
|
100
|
+
} | {
|
|
101
|
+
type: "click: node has modelFqn";
|
|
102
|
+
params: unknown;
|
|
103
|
+
} | {
|
|
104
|
+
type: "click: node has details";
|
|
105
|
+
params: unknown;
|
|
106
|
+
} | {
|
|
107
|
+
type: "click: selected node";
|
|
108
|
+
params: unknown;
|
|
109
|
+
} | {
|
|
110
|
+
type: "click: same node";
|
|
111
|
+
params: unknown;
|
|
112
|
+
} | {
|
|
113
|
+
type: "click: focused node";
|
|
114
|
+
params: unknown;
|
|
115
|
+
} | {
|
|
116
|
+
type: "click: node.type = seq-subflow";
|
|
117
|
+
params: unknown;
|
|
118
|
+
} | {
|
|
119
|
+
type: "click: node has connections";
|
|
120
|
+
params: unknown;
|
|
121
|
+
} | {
|
|
122
|
+
type: "click: selected edge";
|
|
123
|
+
params: unknown;
|
|
124
|
+
} | {
|
|
125
|
+
type: "click: active walkthrough step";
|
|
126
|
+
params: unknown;
|
|
127
|
+
}, never, "final" | "isReady" | "initializing" | "navigating" | {
|
|
128
|
+
ready: "idle" | "walkthrough" | "focused" | "printing" | "comparing";
|
|
48
129
|
}, string, Input, import("xstate").NonReducibleUnknown, EmittedEvents, import("xstate").MetaObject, {
|
|
49
130
|
states: {
|
|
50
131
|
readonly initializing: {};
|
|
51
|
-
readonly isReady: {
|
|
52
|
-
states?: {};
|
|
53
|
-
id?: string | undefined | undefined;
|
|
54
|
-
};
|
|
132
|
+
readonly isReady: {};
|
|
55
133
|
readonly ready: {
|
|
56
|
-
states
|
|
57
|
-
|
|
134
|
+
states: {
|
|
135
|
+
idle: {
|
|
136
|
+
id: string;
|
|
137
|
+
};
|
|
138
|
+
focused: {
|
|
139
|
+
id: string;
|
|
140
|
+
};
|
|
141
|
+
walkthrough: {
|
|
142
|
+
id: string;
|
|
143
|
+
};
|
|
144
|
+
printing: {
|
|
145
|
+
id: string;
|
|
146
|
+
};
|
|
147
|
+
comparing: {
|
|
148
|
+
id: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
58
151
|
};
|
|
59
152
|
readonly navigating: {
|
|
60
153
|
id: string;
|
|
@@ -70,5 +163,4 @@ export interface DiagramMachineLogic extends BaseDiagramMachineLogic<{
|
|
|
70
163
|
}, StateValueFrom<typeof _diagramMachine>> {}
|
|
71
164
|
export type DiagramMachineSnapshot = SnapshotFrom<DiagramMachineLogic>;
|
|
72
165
|
export interface DiagramMachineRef extends ActorRef<DiagramMachineSnapshot, Events, EmittedEvents> {}
|
|
73
|
-
//#endregion
|
|
74
166
|
export type { Context as DiagramContext, EmittedEvents as DiagramEmittedEvents, Events as DiagramEvents };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { Context, machine } from "./machine.setup.mjs";
|
|
3
2
|
import { updateEdgeData, updateNodeData } from "./assign.mjs";
|
|
4
|
-
import { cancelFitDiagram, raiseUpdateView } from "./machine.actions.layout.mjs";
|
|
5
3
|
import { assignDynamicViewVariant, assignElementViewVariant, emitOnLayoutTypeChange, stopEditorActor, triggerChange, updateFeatures, updateInputs } from "./machine.actions.mjs";
|
|
4
|
+
import { cancelFitDiagram, raiseUpdateView } from "./machine.actions.layout.mjs";
|
|
5
|
+
import { Context, machine } from "./machine.setup.mjs";
|
|
6
6
|
import { initializing, isReady } from "./machine.state.initializing.mjs";
|
|
7
7
|
import { navigating } from "./machine.state.navigating.mjs";
|
|
8
8
|
import { ready } from "./machine.state.ready.mjs";
|
|
9
9
|
import { applyEdgeChanges, applyNodeChanges } from "@xyflow/react";
|
|
10
10
|
import { assign, stopChild } from "xstate/actions";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// src/likec4diagram/state/machine.ts
|
|
13
13
|
const _diagramMachine = machine.createMachine({
|
|
14
14
|
initial: "initializing",
|
|
15
15
|
context: Context,
|
|
@@ -87,5 +87,4 @@ const _diagramMachine = machine.createMachine({
|
|
|
87
87
|
*/
|
|
88
88
|
const diagramMachine = _diagramMachine;
|
|
89
89
|
|
|
90
|
-
//#endregion
|
|
91
90
|
export { diagramMachine };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { NavigationPanelActorLogic } from "../../navigationpanel/actor.mjs";
|
|
2
|
+
import { HotKeyEvent, HotkeyActorLogic } from "./hotkeyActor.mjs";
|
|
4
3
|
import { OverlaysActorLogic } from "../../overlays/overlaysActor.mjs";
|
|
4
|
+
import { EditorActorLogic } from "../../editor/actor/machine.mjs";
|
|
5
5
|
import { SearchActorLogic } from "../../search/searchActor.mjs";
|
|
6
|
-
import { HotKeyEvent, HotkeyActorLogic } from "./hotkeyActor.mjs";
|
|
7
6
|
import { MediaPrintActorLogic, MediaPrintEvent } from "./mediaPrintActor.mjs";
|
|
8
|
-
import { EditorActorLogic } from "../../editor/actor/machine.mjs";
|
|
9
7
|
import "../../editor/index.mjs";
|
|
8
|
+
import { NavigationPanelActorLogic } from "../../navigationpanel/actor.mjs";
|
|
10
9
|
import { EnabledFeatures, TogglableFeature } from "../../context/DiagramFeatures.mjs";
|
|
11
10
|
import { XYFlowInstance, XYStoreApi } from "../../hooks/useXYFlow.mjs";
|
|
12
|
-
import { AlignmentMode } from "./aligners.mjs";
|
|
13
11
|
import { OpenSourceParams, RelationshipBrowserScope, ViewPaddings } from "../../LikeC4Diagram.props.mjs";
|
|
12
|
+
import { DetailsSubject } from "../../overlays/element-details/subject.mjs";
|
|
13
|
+
import { Types } from "../types.mjs";
|
|
14
|
+
import { AlignmentMode } from "./aligners.mjs";
|
|
14
15
|
import { MouseEvent } from "react";
|
|
15
|
-
import { BBox } from "@likec4/core/geometry";
|
|
16
16
|
import { EdgeChange, NodeChange, Rect, Viewport } from "@xyflow/system";
|
|
17
|
+
import { BBox } from "@likec4/core/geometry";
|
|
17
18
|
import { DiagramEdge, DiagramNode, DiagramView, DynamicViewDisplayVariant, EdgeId, Fqn, LayoutType, NodeId, NodeNotation, StepPath, ViewChange, ViewId, WhereOperator } from "@likec4/core/types";
|
|
18
19
|
import { ActorRefFromLogic, StateMachine, StateValue } from "xstate";
|
|
19
20
|
import { PartialDeep } from "type-fest";
|
|
20
|
-
//#region src/likec4diagram/state/machine.setup.d.ts
|
|
21
21
|
/**
|
|
22
22
|
* Display variant for element views: plain boxes-and-lines diagram, or a compact graph
|
|
23
23
|
* of circles (topology-focused, akin to Structurizr's "Explore" graph view).
|
|
@@ -212,8 +212,8 @@ export type Events = HotKeyEvent | MediaPrintEvent | {
|
|
|
212
212
|
} | ({
|
|
213
213
|
type: 'open.source';
|
|
214
214
|
} & OpenSourceParams) | {
|
|
215
|
-
type: 'open.
|
|
216
|
-
|
|
215
|
+
type: 'open.nodeDetails';
|
|
216
|
+
target: NodeId | DetailsSubject;
|
|
217
217
|
fromNode?: NodeId | undefined;
|
|
218
218
|
} | {
|
|
219
219
|
type: 'open.relationshipDetails';
|
|
@@ -271,6 +271,10 @@ export type Events = HotKeyEvent | MediaPrintEvent | {
|
|
|
271
271
|
direction?: never;
|
|
272
272
|
} | {
|
|
273
273
|
type: 'walkthrough.end';
|
|
274
|
+
} | {
|
|
275
|
+
type: 'compare.start';
|
|
276
|
+
} | {
|
|
277
|
+
type: 'compare.end';
|
|
274
278
|
} | {
|
|
275
279
|
type: 'sequence.flow.collapse';
|
|
276
280
|
flowId: StepPath;
|
|
@@ -373,4 +377,4 @@ type ChildrenActor = { [K in keyof ChildrenActors]: {
|
|
|
373
377
|
* Here is a trick to reduce inference types
|
|
374
378
|
*/
|
|
375
379
|
export interface BaseDiagramMachineLogic<Actors extends Partial<ActorLogicMap> = ActorLogicMap, State extends StateValue = never> extends StateMachine<Context, Events, Actors & Omit<ActorLogicMap, keyof Actors>, ChildrenActor, never, never, never, State, never, Input, never, EmittedEvents, never, never> {}
|
|
376
|
-
|
|
380
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { MaxZoom, MinZoom } from "../../base/const.mjs";
|
|
3
3
|
import { DefaultFeatures } from "../../context/DiagramFeatures.mjs";
|
|
4
|
-
import { defineActors } from "../../utils/defineActors.mjs";
|
|
5
4
|
import { editorActorLogic } from "../../editor/actor/machine.mjs";
|
|
6
5
|
import { navigationPanelActorLogic } from "../../navigationpanel/actor.mjs";
|
|
7
6
|
import { overlaysActorLogic } from "../../overlays/overlaysActor.mjs";
|
|
8
7
|
import { searchActorLogic } from "../../search/searchActor.mjs";
|
|
8
|
+
import { defineActors } from "../../utils/defineActors.mjs";
|
|
9
9
|
import { hotkeyActorLogic } from "./hotkeyActor.mjs";
|
|
10
10
|
import { mediaPrintActorLogic } from "./mediaPrintActor.mjs";
|
|
11
11
|
import { DiagramToggledFeaturesPersistence } from "./persistence.mjs";
|
|
@@ -13,8 +13,9 @@ import { isTruthy, mapValues } from "remeda";
|
|
|
13
13
|
import { hasProp, isDynamicView, nonexhaustive } from "@likec4/core";
|
|
14
14
|
import { BBox as BBox$1 } from "@likec4/core/geometry";
|
|
15
15
|
import { assertEvent, setup } from "xstate";
|
|
16
|
+
import { and, not, or, stateIn } from "xstate/guards";
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
// src/likec4diagram/state/machine.setup.ts
|
|
18
19
|
function Context({ input }) {
|
|
19
20
|
return {
|
|
20
21
|
...input,
|
|
@@ -26,10 +27,7 @@ function Context({ input }) {
|
|
|
26
27
|
...DefaultFeatures,
|
|
27
28
|
...input.features
|
|
28
29
|
},
|
|
29
|
-
toggledFeatures: DiagramToggledFeaturesPersistence.read() ?? {
|
|
30
|
-
enableReadOnly: true,
|
|
31
|
-
enableCompareWithLatest: false
|
|
32
|
-
},
|
|
30
|
+
toggledFeatures: DiagramToggledFeaturesPersistence.read() ?? { enableReadOnly: true },
|
|
33
31
|
initialized: {
|
|
34
32
|
xydata: false,
|
|
35
33
|
xyflow: false
|
|
@@ -61,19 +59,50 @@ function Context({ input }) {
|
|
|
61
59
|
maxZoom: input.maxZoom ?? 3
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Tag of the `ready.comparing` state (comparing manual layout with the latest auto layout)
|
|
64
|
+
*/
|
|
65
|
+
const ComparingTag = "comparing";
|
|
66
|
+
/**
|
|
67
|
+
* Returns true if the diagram is in `ready.comparing` state
|
|
68
|
+
*/
|
|
69
|
+
const isComparingLayouts = (snapshot) => snapshot.hasTag(ComparingTag);
|
|
70
|
+
/**
|
|
71
|
+
* Readonly mode is enabled when:
|
|
72
|
+
* - Global `features.enableReadOnly` is true (even if toggled off at runtime)
|
|
73
|
+
* OR
|
|
74
|
+
* - Runtime feature `ReadOnly` is toggled on
|
|
75
|
+
* OR
|
|
76
|
+
* - There is an active walkthrough
|
|
77
|
+
* OR
|
|
78
|
+
* - Comparing layouts, and auto layout is active
|
|
79
|
+
*/
|
|
80
|
+
const isReadOnlyContext = (context, isComparing) => context.features.enableReadOnly || (context.toggledFeatures.enableReadOnly ?? false) || isTruthy(context.activeWalkthrough) || isComparing && context.view._layout === "auto";
|
|
81
|
+
/**
|
|
82
|
+
* Derives runtime features (toggled features combined with the state of the diagram)
|
|
83
|
+
*/
|
|
84
|
+
const deriveToggledFeatures = (snapshot) => ({ enableReadOnly: isReadOnlyContext(snapshot.context, isComparingLayouts(snapshot)) });
|
|
85
|
+
/**
|
|
86
|
+
* Returns true if comparing layouts is possible:
|
|
87
|
+
* feature is enabled, view is layouted and has drifts
|
|
88
|
+
*/
|
|
89
|
+
const canCompareLayouts = (context) => context.features.enableCompareWithLatest && isTruthy(context.view._layout) && !!context.view.drifts && context.view.drifts.length > 0;
|
|
74
90
|
function isActiveSequenceWalkthrough(context) {
|
|
75
91
|
return isDynamicView(context.view) && context.dynamicViewVariant === "sequence" && !!context.activeWalkthrough && hasProp(context.view, "flow");
|
|
76
92
|
}
|
|
93
|
+
const targetState = {
|
|
94
|
+
idle: "#idle",
|
|
95
|
+
focused: "#focused",
|
|
96
|
+
walkthrough: "#walkthrough",
|
|
97
|
+
printing: "#printing",
|
|
98
|
+
comparing: "#comparing",
|
|
99
|
+
navigating: "#navigating"
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Guard: diagram is readonly (see {@link isReadOnlyContext}).
|
|
103
|
+
* Uses `stateIn` to check if comparing layouts, as guards don't have access to the state value.
|
|
104
|
+
*/
|
|
105
|
+
const isReadOnly = or([({ context }) => isReadOnlyContext(context, false), and([stateIn(targetState.comparing), ({ context }) => context.view._layout === "auto"])]);
|
|
77
106
|
const actors = defineActors({
|
|
78
107
|
hotkey: hotkeyActorLogic,
|
|
79
108
|
overlays: overlaysActorLogic,
|
|
@@ -95,8 +124,8 @@ const machine = setup({
|
|
|
95
124
|
"isReady": ({ context }) => context.initialized.xydata && context.initialized.xyflow,
|
|
96
125
|
"enabled: Editor": ({ context }) => context.features.enableEditor,
|
|
97
126
|
"enabled: FitView": ({ context }) => context.features.enableFitView,
|
|
98
|
-
"enabled: FocusMode": ({ context }) => context.features.enableFocusMode
|
|
99
|
-
"enabled: Readonly":
|
|
127
|
+
"enabled: FocusMode": and([({ context }) => context.features.enableFocusMode, isReadOnly]),
|
|
128
|
+
"enabled: Readonly": isReadOnly,
|
|
100
129
|
"enabled: RelationshipDetails": ({ context }) => context.features.enableRelationshipDetails,
|
|
101
130
|
"enabled: Search": ({ context }) => context.features.enableSearch,
|
|
102
131
|
"enabled: ElementDetails": ({ context }) => context.features.enableElementDetails,
|
|
@@ -108,7 +137,8 @@ const machine = setup({
|
|
|
108
137
|
return event.autoUnfocus === true;
|
|
109
138
|
},
|
|
110
139
|
"enabled: Overlays": ({ context }) => context.features.enableElementDetails || context.features.enableRelationshipBrowser || context.features.enableRelationshipDetails,
|
|
111
|
-
"not readonly": (
|
|
140
|
+
"not readonly": not(isReadOnly),
|
|
141
|
+
"can compare layouts": ({ context }) => canCompareLayouts(context),
|
|
112
142
|
"is dynamic view": ({ context }) => context.view._type === "dynamic",
|
|
113
143
|
"is dynamic view in sequence variant": ({ context }) => context.view._type === "dynamic" && context.dynamicViewVariant === "sequence",
|
|
114
144
|
"is same view": ({ context, event }) => {
|
|
@@ -127,6 +157,11 @@ const machine = setup({
|
|
|
127
157
|
assertEvent(event, "xyflow.nodeClick");
|
|
128
158
|
return "modelFqn" in event.node.data;
|
|
129
159
|
},
|
|
160
|
+
"click: node has details": ({ event }) => {
|
|
161
|
+
assertEvent(event, "xyflow.nodeClick");
|
|
162
|
+
const data = event.node.data;
|
|
163
|
+
return "deploymentFqn" in data && !!data.deploymentFqn || "modelFqn" in data && !!data.modelFqn;
|
|
164
|
+
},
|
|
130
165
|
"click: selected node": ({ event }) => {
|
|
131
166
|
assertEvent(event, "xyflow.nodeClick");
|
|
132
167
|
return event.node.selected === true;
|
|
@@ -157,14 +192,6 @@ const machine = setup({
|
|
|
157
192
|
}
|
|
158
193
|
}
|
|
159
194
|
});
|
|
160
|
-
const targetState = {
|
|
161
|
-
idle: "#idle",
|
|
162
|
-
focused: "#focused",
|
|
163
|
-
walkthrough: "#walkthrough",
|
|
164
|
-
printing: "#printing",
|
|
165
|
-
navigating: "#navigating"
|
|
166
|
-
};
|
|
167
195
|
const to = mapValues(targetState, (id) => ({ target: id }));
|
|
168
196
|
|
|
169
|
-
|
|
170
|
-
export { Context, deriveToggledFeatures, isActiveSequenceWalkthrough, machine, targetState, to };
|
|
197
|
+
export { ComparingTag, Context, canCompareLayouts, deriveToggledFeatures, isActiveSequenceWalkthrough, isComparingLayouts, machine, targetState, to };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { machine } from "./machine.setup.mjs";
|
|
3
|
-
import { fitDiagram } from "./machine.actions.layout.mjs";
|
|
4
2
|
import { assignXYDataFromView, emitInitialized } from "./machine.actions.mjs";
|
|
3
|
+
import { fitDiagram } from "./machine.actions.layout.mjs";
|
|
4
|
+
import { machine } from "./machine.setup.mjs";
|
|
5
5
|
import { assign } from "xstate/actions";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/likec4diagram/state/machine.state.initializing.ts
|
|
8
8
|
/**
|
|
9
9
|
* To be in `initializing` state, the diagram must wait for two events:
|
|
10
10
|
* - `xyflow.init` - indicates that the `xyflow` instance is ready
|
|
@@ -56,5 +56,4 @@ const isReady = machine.createStateConfig({ always: [{
|
|
|
56
56
|
target: "ready"
|
|
57
57
|
}, { target: "initializing" }] });
|
|
58
58
|
|
|
59
|
-
//#endregion
|
|
60
59
|
export { initializing, isReady };
|
|
@@ -2,18 +2,17 @@ import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { roundDpr } from "../../utils/roundDpr.mjs";
|
|
3
3
|
import { parsePaddings } from "../../utils/xyflow.mjs";
|
|
4
4
|
import { convertToXYFlow } from "../convert-to-xyflow.mjs";
|
|
5
|
-
import { calcViewportForBounds, findCorrespondingNode, findNodeByModelFqn, nodeRef, viewBounds } from "./utils.mjs";
|
|
6
|
-
import { machine, targetState, to } from "./machine.setup.mjs";
|
|
7
5
|
import { mergeXYNodesEdges } from "./assign.mjs";
|
|
8
6
|
import { cancelFitDiagram, raiseSetViewport } from "./machine.actions.layout.mjs";
|
|
9
|
-
import {
|
|
7
|
+
import { machine, targetState, to } from "./machine.setup.mjs";
|
|
8
|
+
import { calcViewportForBounds, findCorrespondingNode, findNodeByModelFqn, nodeRef, viewBounds } from "./utils.mjs";
|
|
10
9
|
import { isTruthy } from "remeda";
|
|
11
10
|
import { BBox } from "@likec4/core/geometry";
|
|
12
11
|
import { invariant } from "@likec4/core/utils";
|
|
13
12
|
import { assertEvent } from "xstate";
|
|
14
13
|
import { enqueueActions as enqueueActions$1 } from "xstate/actions";
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
// src/likec4diagram/state/machine.state.navigating.ts
|
|
17
16
|
/**
|
|
18
17
|
* If the user navigates back or forward using the browser's back/forward buttons,
|
|
19
18
|
* update the navigation history and return to the previous or next view.
|
|
@@ -62,7 +61,6 @@ const navigating = machine.createStateConfig({
|
|
|
62
61
|
actions: [
|
|
63
62
|
cancelFitDiagram(),
|
|
64
63
|
handleBrowserForwardBackward(),
|
|
65
|
-
disableCompareWithLatest(),
|
|
66
64
|
enqueueActions$1(({ enqueue, context, event }) => {
|
|
67
65
|
assertEvent(event, "update.view");
|
|
68
66
|
const { xyflow, xystore, navigationHistory: { currentIndex, history } } = context;
|
|
@@ -201,5 +199,4 @@ const navigating = machine.createStateConfig({
|
|
|
201
199
|
}
|
|
202
200
|
});
|
|
203
201
|
|
|
204
|
-
//#endregion
|
|
205
202
|
export { navigating };
|