@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,7 +1,7 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { assertEvent, assign, setup } from "xstate";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/likec4diagram/relationship-popover/actor.ts
|
|
5
5
|
const _actorLogic = setup({
|
|
6
6
|
types: {
|
|
7
7
|
context: {},
|
|
@@ -116,5 +116,4 @@ const _actorLogic = setup({
|
|
|
116
116
|
});
|
|
117
117
|
const RelationshipPopoverActorLogic = _actorLogic;
|
|
118
118
|
|
|
119
|
-
//#endregion
|
|
120
119
|
export { RelationshipPopoverActorLogic };
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { styled } from "@likec4/styles/jsx";
|
|
4
4
|
import { txt } from "@likec4/styles/patterns";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/likec4diagram/relationship-popover/components.tsx
|
|
7
7
|
const Endpoint = ({ children, likec4color }) => {
|
|
8
8
|
return /* @__PURE__ */ jsx("div", {
|
|
9
9
|
"data-likec4-color": likec4color,
|
|
@@ -43,5 +43,4 @@ const RelationshipTitle = styled("div", { base: {
|
|
|
43
43
|
minWidth: "0"
|
|
44
44
|
} });
|
|
45
45
|
|
|
46
|
-
//#endregion
|
|
47
46
|
export { Endpoint, RelationshipTitle };
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { MaxZoom, MinZoom } from "../../base/const.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { ComparingLayoutsProvider } from "../../context/ComparingLayoutsContext.mjs";
|
|
4
4
|
import { useDiagramEventHandlers } from "../../context/DiagramEventHandlers.mjs";
|
|
5
5
|
import { DiagramFeatures, useEnabledFeatures } from "../../context/DiagramFeatures.mjs";
|
|
6
|
-
import { DiagramActorContextProvider, DiagramApiContextProvider, selectDiagramContext, useDiagram, useDiagramSelector } from "../../hooks/safeContext.mjs";
|
|
7
|
-
import { useOnDiagramEvent } from "../../hooks/useDiagram.mjs";
|
|
8
|
-
import { DiagramToggledFeaturesPersistence } from "./persistence.mjs";
|
|
9
6
|
import { useEditorActorLogic } from "../../editor/useEditorActorLogic.mjs";
|
|
7
|
+
import { DiagramActorContextProvider, DiagramApiContextProvider, selectDiagramSnapshot, useDiagram, useDiagramSelector } from "../../hooks/safeContext.mjs";
|
|
8
|
+
import { useOnDiagramEvent } from "../../hooks/useDiagram.mjs";
|
|
9
|
+
import { useUpdateEffect } from "../../hooks/useUpdateEffect.mjs";
|
|
10
10
|
import { DiagramApi } from "./diagram-api.mjs";
|
|
11
11
|
import { diagramMachine } from "./machine.mjs";
|
|
12
|
-
import {
|
|
12
|
+
import { deriveToggledFeatures, isComparingLayouts } from "./machine.setup.mjs";
|
|
13
|
+
import { DiagramToggledFeaturesPersistence } from "./persistence.mjs";
|
|
14
|
+
import { useEffect } from "react";
|
|
13
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
16
|
import { useStoreApi } from "@xyflow/react";
|
|
15
|
-
import {
|
|
17
|
+
import { shallowEqual } from "fast-equals";
|
|
16
18
|
import { useActorRef } from "@xstate/react";
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
// src/likec4diagram/state/DiagramActorProvider.tsx
|
|
19
21
|
function DiagramActorProvider({ id, view, zoomable, pannable, fitView, initialZoom, nodesDraggable, nodesSelectable, fitViewPadding, where = null, minZoom = MinZoom, maxZoom = 3, children, dynamicViewVariant: _defaultVariant, relationshipBrowserScope }) {
|
|
20
22
|
const xystore = useStoreApi();
|
|
21
23
|
const editor = useEditorActorLogic();
|
|
@@ -41,20 +43,12 @@ function DiagramActorProvider({ id, view, zoomable, pannable, fitView, initialZo
|
|
|
41
43
|
relationshipBrowserScope
|
|
42
44
|
}
|
|
43
45
|
});
|
|
44
|
-
const actorRef = useRef(actor);
|
|
45
|
-
if (actorRef.current !== actor) {
|
|
46
|
-
console.warn("DiagramMachine actor instance changed", {
|
|
47
|
-
previous: actorRef.current.getSnapshot().context,
|
|
48
|
-
current: actor.getSnapshot().context
|
|
49
|
-
});
|
|
50
|
-
actorRef.current = actor;
|
|
51
|
-
}
|
|
52
46
|
useEffect(() => {
|
|
53
47
|
actor.send({
|
|
54
48
|
type: "update.features",
|
|
55
49
|
features
|
|
56
50
|
});
|
|
57
|
-
}, [
|
|
51
|
+
}, [features]);
|
|
58
52
|
useUpdateEffect(() => actor.send({
|
|
59
53
|
type: "update.inputs",
|
|
60
54
|
inputs: {
|
|
@@ -71,7 +65,6 @@ function DiagramActorProvider({ id, view, zoomable, pannable, fitView, initialZo
|
|
|
71
65
|
relationshipBrowserScope
|
|
72
66
|
}
|
|
73
67
|
}), [
|
|
74
|
-
actor,
|
|
75
68
|
zoomable,
|
|
76
69
|
where,
|
|
77
70
|
pannable,
|
|
@@ -90,39 +83,35 @@ function DiagramActorProvider({ id, view, zoomable, pannable, fitView, initialZo
|
|
|
90
83
|
type: "switch.dynamicViewVariant",
|
|
91
84
|
variant: _defaultVariant
|
|
92
85
|
});
|
|
93
|
-
}, [
|
|
86
|
+
}, [_defaultVariant]);
|
|
94
87
|
useEffect(() => actor.send({
|
|
95
88
|
type: "update.view",
|
|
96
89
|
view,
|
|
97
90
|
source: "external"
|
|
98
|
-
}), [
|
|
91
|
+
}), [view]);
|
|
99
92
|
return /* @__PURE__ */ jsx(DiagramActorContextProvider, {
|
|
100
93
|
value: actor,
|
|
101
94
|
children: /* @__PURE__ */ jsxs(DiagramApiContextProvider, {
|
|
102
|
-
value: DiagramApi.withActor(
|
|
95
|
+
value: DiagramApi.withActor(actor),
|
|
103
96
|
children: [/* @__PURE__ */ jsx(ToggledFeatures, { children }), /* @__PURE__ */ jsx(PropagateDiagramActorEvents, {})]
|
|
104
97
|
})
|
|
105
98
|
});
|
|
106
99
|
}
|
|
107
|
-
const selectToggledFeatures =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (toggledFeatures.enableReadOnly !== enableReadOnly || toggledFeatures.enableCompareWithLatest !== enableCompareWithLatest) toggledFeatures = {
|
|
112
|
-
...toggledFeatures,
|
|
113
|
-
enableCompareWithLatest,
|
|
114
|
-
enableReadOnly
|
|
115
|
-
};
|
|
116
|
-
return toggledFeatures;
|
|
117
|
-
});
|
|
100
|
+
const selectToggledFeatures = selectDiagramSnapshot((snapshot) => ({
|
|
101
|
+
toggledFeatures: deriveToggledFeatures(snapshot),
|
|
102
|
+
isComparing: isComparingLayouts(snapshot)
|
|
103
|
+
}), (a, b) => a.isComparing === b.isComparing && shallowEqual(a.toggledFeatures, b.toggledFeatures));
|
|
118
104
|
function ToggledFeatures({ children }) {
|
|
119
|
-
const toggledFeatures = useDiagramSelector(selectToggledFeatures);
|
|
105
|
+
const { toggledFeatures, isComparing } = useDiagramSelector(selectToggledFeatures);
|
|
120
106
|
useUpdateEffect(() => {
|
|
121
107
|
DiagramToggledFeaturesPersistence.write(toggledFeatures);
|
|
122
108
|
}, [toggledFeatures]);
|
|
123
109
|
return /* @__PURE__ */ jsx(DiagramFeatures, {
|
|
124
110
|
overrides: toggledFeatures,
|
|
125
|
-
children
|
|
111
|
+
children: /* @__PURE__ */ jsx(ComparingLayoutsProvider, {
|
|
112
|
+
value: isComparing,
|
|
113
|
+
children
|
|
114
|
+
})
|
|
126
115
|
});
|
|
127
116
|
}
|
|
128
117
|
function PropagateDiagramActorEvents() {
|
|
@@ -148,5 +137,4 @@ function PropagateDiagramActorEvents() {
|
|
|
148
137
|
return null;
|
|
149
138
|
}
|
|
150
139
|
|
|
151
|
-
//#endregion
|
|
152
140
|
export { DiagramActorProvider };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import "@xyflow/react";
|
|
3
|
-
//#region src/likec4diagram/state/aligners.d.ts
|
|
4
3
|
export type GridAlignmentMode = 'Column' | 'Row';
|
|
5
4
|
export type LinearAlignmentMode = 'Left' | 'Center' | 'Right' | 'Top' | 'Middle' | 'Bottom';
|
|
6
|
-
export type AlignmentMode = LinearAlignmentMode | GridAlignmentMode;
|
|
7
|
-
//#endregion
|
|
5
|
+
export type AlignmentMode = LinearAlignmentMode | GridAlignmentMode;
|
|
@@ -3,7 +3,7 @@ import { map, pick, pipe, reduce, sortBy } from "remeda";
|
|
|
3
3
|
import { invariant, nonexhaustive } from "@likec4/core";
|
|
4
4
|
import { getNodeDimensions } from "@xyflow/system";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/likec4diagram/state/aligners.ts
|
|
7
7
|
var Aligner = class {};
|
|
8
8
|
var LinearAligner = class extends Aligner {
|
|
9
9
|
getEdgePosition;
|
|
@@ -290,5 +290,4 @@ function getAligner(mode) {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
//#endregion
|
|
294
293
|
export { Aligner, GridAligner, LinearAligner, getAligner, getLinearAligner, toNodeRect };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { getNodeCenter } from "../../utils/xyflow.mjs";
|
|
3
2
|
import { Base } from "../../base/Base.mjs";
|
|
4
3
|
import { updateEdges } from "../../base/updateEdges.mjs";
|
|
5
4
|
import { updateNodes } from "../../base/updateNodes.mjs";
|
|
5
|
+
import { getNodeCenter } from "../../utils/xyflow.mjs";
|
|
6
6
|
import { deepEqual } from "fast-equals";
|
|
7
7
|
import { mergeDeep } from "remeda";
|
|
8
8
|
import { nonNullable } from "@likec4/core";
|
|
9
|
-
import { vector } from "@likec4/core/geometry";
|
|
10
9
|
import { getNodeDimensions } from "@xyflow/system";
|
|
10
|
+
import { vector } from "@likec4/core/geometry";
|
|
11
11
|
import { assertEvent } from "xstate";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// src/likec4diagram/state/assign.ts
|
|
14
14
|
function mergeXYNodesEdges(context, event) {
|
|
15
15
|
const nextView = event.view;
|
|
16
16
|
const isSameView = context.view.id === nextView.id;
|
|
@@ -95,5 +95,4 @@ function resetEdgeControlPoints(nodeLookup, edge) {
|
|
|
95
95
|
return [sourceBorderPoint.add(sourceToTarget.multiply(.4)).round().toObject(), sourceBorderPoint.add(sourceToTarget.multiply(.6)).round().toObject()];
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
//#endregion
|
|
99
98
|
export { focusNodesEdges, mergeXYNodesEdges, resetEdgeControlPoints, updateEdgeData, updateNodeData };
|
|
@@ -3,7 +3,7 @@ import { calcViewBounds } from "../../utils/view-bounds.mjs";
|
|
|
3
3
|
import { hasAtLeast, map } from "remeda";
|
|
4
4
|
import { getNodeDimensions } from "@xyflow/system";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/likec4diagram/state/createViewChange.ts
|
|
7
7
|
function createViewChange(parentContext) {
|
|
8
8
|
const { view: { drifts: _1, _layout: _2, ...view }, xynodes, xystore } = parentContext;
|
|
9
9
|
const { nodeLookup, edgeLookup } = xystore.getState();
|
|
@@ -69,5 +69,4 @@ function createViewChange(parentContext) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
//#endregion
|
|
73
72
|
export { createViewChange };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { TogglableFeature } from "../../context/DiagramFeatures.mjs";
|
|
3
|
+
import { EditorActorRef } from "../../editor/actor/machine.mjs";
|
|
4
|
+
import { OpenSourceParams, RelationshipBrowserScope } from "../../LikeC4Diagram.props.mjs";
|
|
3
5
|
import { OverlaysActorRef } from "../../overlays/overlaysActor.mjs";
|
|
4
6
|
import { SearchActorRef } from "../../search/searchActor.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { TogglableFeature } from "../../context/DiagramFeatures.mjs";
|
|
7
|
+
import { Types } from "../types.mjs";
|
|
7
8
|
import { AlignmentMode } from "./aligners.mjs";
|
|
8
|
-
import { OpenSourceParams, RelationshipBrowserScope } from "../../LikeC4Diagram.props.mjs";
|
|
9
9
|
import { Context, ElementViewDisplayVariant, Events } from "./machine.setup.mjs";
|
|
10
10
|
import { DiagramActorRef } from "./types.mjs";
|
|
11
|
-
import { RefObject } from "react";
|
|
12
11
|
import * as t from "@likec4/core/types";
|
|
13
12
|
import { DynamicViewDisplayVariant, NodeNotation, ViewChange } from "@likec4/core/types";
|
|
14
13
|
import { PartialDeep } from "type-fest";
|
|
15
|
-
|
|
16
|
-
type Any$1 = t.aux.Any;
|
|
14
|
+
type Any$1 = t.aux.AnyLayouted;
|
|
17
15
|
type Unknown = t.aux.UnknownLayouted;
|
|
18
16
|
type ViewId$1<A> = t.aux.ViewId<A>;
|
|
19
17
|
type Fqn$1<A> = t.aux.Fqn<A>;
|
|
@@ -21,16 +19,12 @@ type NodeId$1 = t.aux.NodeId;
|
|
|
21
19
|
type EdgeId$1 = t.aux.EdgeId;
|
|
22
20
|
export declare class DiagramApi<A extends Any$1 = Unknown> {
|
|
23
21
|
private static cache;
|
|
24
|
-
static withActor(actorRef:
|
|
25
|
-
/**
|
|
26
|
-
* React ref to the diagram actor
|
|
27
|
-
*/
|
|
28
|
-
readonly ref: RefObject<DiagramActorRef>;
|
|
29
|
-
private constructor();
|
|
22
|
+
static withActor(actorRef: DiagramActorRef): DiagramApi<Unknown>;
|
|
30
23
|
/**
|
|
31
24
|
* @warning Do not use in render phase
|
|
32
25
|
*/
|
|
33
|
-
|
|
26
|
+
readonly actor: DiagramActorRef;
|
|
27
|
+
private constructor();
|
|
34
28
|
/**
|
|
35
29
|
* @warning Do not use in render phase
|
|
36
30
|
*/
|
|
@@ -78,7 +72,17 @@ export declare class DiagramApi<A extends Any$1 = Unknown> {
|
|
|
78
72
|
*/
|
|
79
73
|
openSource(params: OpenSourceParams<Unknown>): void;
|
|
80
74
|
/**
|
|
81
|
-
* Open element
|
|
75
|
+
* Open details for a diagram node, or an explicit element/deployment subject outside the current view.
|
|
76
|
+
*/
|
|
77
|
+
openNodeDetails(target: NodeId$1 | {
|
|
78
|
+
type: 'element';
|
|
79
|
+
element: Fqn$1<A>;
|
|
80
|
+
} | {
|
|
81
|
+
type: 'deployment';
|
|
82
|
+
deployment: t.aux.DeploymentFqn<A>;
|
|
83
|
+
}, fromNode?: NodeId$1): void;
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated Use `openNodeDetails({ type: 'element', element: fqn }, fromNode)`.
|
|
82
86
|
*/
|
|
83
87
|
openElementDetails(fqn: Fqn$1<A>, fromNode?: NodeId$1): void;
|
|
84
88
|
openRelationshipDetails(...params: [edgeId: EdgeId$1] | [source: Fqn$1<A>, target: Fqn$1<A>]): void;
|
|
@@ -87,6 +91,10 @@ export declare class DiagramApi<A extends Any$1 = Unknown> {
|
|
|
87
91
|
highlightNode(nodeId: NodeId$1): void;
|
|
88
92
|
highlightEdge(edgeId: EdgeId$1): void;
|
|
89
93
|
unhighlightAll(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Select nodes and edges in the diagram
|
|
96
|
+
* @param target - Optional selection target. If not provided, resets selection
|
|
97
|
+
*/
|
|
90
98
|
select(target?: {
|
|
91
99
|
nodes?: NodeId$1[];
|
|
92
100
|
edges?: (EdgeId$1 | t.StepPath)[];
|
|
@@ -152,6 +160,15 @@ export declare class DiagramApi<A extends Any$1 = Unknown> {
|
|
|
152
160
|
step: t.StepPath;
|
|
153
161
|
}): void;
|
|
154
162
|
stopWalkthrough(): void;
|
|
163
|
+
/**
|
|
164
|
+
* Starts comparing manual layout with the latest auto layout.
|
|
165
|
+
* Ignored if the view has no layout drifts, or the feature is disabled.
|
|
166
|
+
*/
|
|
167
|
+
startCompare(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Stops comparing layouts, switches back to manual layout (if auto is active)
|
|
170
|
+
*/
|
|
171
|
+
endCompare(): void;
|
|
155
172
|
toggleFeature(feature: TogglableFeature, forceValue?: boolean): void;
|
|
156
173
|
highlightNotation(notation: NodeNotation, kind?: string): void;
|
|
157
174
|
unhighlightNotation(): void;
|
|
@@ -170,4 +187,4 @@ export declare class DiagramApi<A extends Any$1 = Unknown> {
|
|
|
170
187
|
*/
|
|
171
188
|
toggleSequenceFlow(flowId: t.StepPath): void;
|
|
172
189
|
}
|
|
173
|
-
|
|
190
|
+
export {};
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { findDiagramEdge, findDiagramNode, findNodeByModelFqn, typedSystem } from "./utils.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { invariant, nonNullable } from "@likec4/core/utils";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/likec4diagram/state/diagram-api.ts
|
|
6
6
|
var DiagramApi = class DiagramApi {
|
|
7
|
-
static cache =
|
|
7
|
+
static cache = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
static withActor(actorRef) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor(actorRef) {
|
|
16
|
-
this.ref = actorRef;
|
|
9
|
+
let api = this.cache.get(actorRef);
|
|
10
|
+
if (!api) {
|
|
11
|
+
api = new DiagramApi(actorRef);
|
|
12
|
+
this.cache.set(actorRef, api);
|
|
13
|
+
}
|
|
14
|
+
return api;
|
|
17
15
|
}
|
|
18
16
|
/**
|
|
19
17
|
* @warning Do not use in render phase
|
|
20
18
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
actor;
|
|
20
|
+
constructor(actor) {
|
|
21
|
+
this.actor = actor;
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
25
24
|
* @warning Do not use in render phase
|
|
26
25
|
*/
|
|
27
26
|
get currentView() {
|
|
28
|
-
return this.
|
|
27
|
+
return this.actor.getSnapshot().context.view;
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
* Editor actor reference
|
|
32
31
|
* @warning Do not use in render phase
|
|
33
32
|
*/
|
|
34
33
|
editorActor() {
|
|
35
|
-
const editorActor = typedSystem(this.
|
|
34
|
+
const editorActor = typedSystem(this.actor.system).editorActorRef;
|
|
36
35
|
return nonNullable(editorActor, "Editor actor not found in actor system");
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
@@ -40,7 +39,7 @@ var DiagramApi = class DiagramApi {
|
|
|
40
39
|
* @warning Do not use in render phase
|
|
41
40
|
*/
|
|
42
41
|
overlays() {
|
|
43
|
-
const overlaysActor = typedSystem(this.
|
|
42
|
+
const overlaysActor = typedSystem(this.actor.system).overlaysActorRef;
|
|
44
43
|
return nonNullable(overlaysActor, "Overlays actor not found in actor system");
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
@@ -48,14 +47,14 @@ var DiagramApi = class DiagramApi {
|
|
|
48
47
|
* @warning Do not use in render phase
|
|
49
48
|
*/
|
|
50
49
|
searchActor() {
|
|
51
|
-
const searchActor = typedSystem(this.
|
|
50
|
+
const searchActor = typedSystem(this.actor.system).searchActorRef;
|
|
52
51
|
return nonNullable(searchActor, "Search actor not found in actor system");
|
|
53
52
|
}
|
|
54
53
|
/**
|
|
55
54
|
* Send event to diagram actor
|
|
56
55
|
*/
|
|
57
56
|
send(event) {
|
|
58
|
-
this.
|
|
57
|
+
this.actor.send(event);
|
|
59
58
|
}
|
|
60
59
|
/**
|
|
61
60
|
* Navigate to view
|
|
@@ -106,15 +105,24 @@ var DiagramApi = class DiagramApi {
|
|
|
106
105
|
});
|
|
107
106
|
}
|
|
108
107
|
/**
|
|
109
|
-
* Open element
|
|
108
|
+
* Open details for a diagram node, or an explicit element/deployment subject outside the current view.
|
|
110
109
|
*/
|
|
111
|
-
|
|
110
|
+
openNodeDetails(target, fromNode) {
|
|
112
111
|
this.send({
|
|
113
|
-
type: "open.
|
|
114
|
-
|
|
112
|
+
type: "open.nodeDetails",
|
|
113
|
+
target,
|
|
115
114
|
fromNode
|
|
116
115
|
});
|
|
117
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Use `openNodeDetails({ type: 'element', element: fqn }, fromNode)`.
|
|
119
|
+
*/
|
|
120
|
+
openElementDetails(fqn, fromNode) {
|
|
121
|
+
this.openNodeDetails({
|
|
122
|
+
type: "element",
|
|
123
|
+
element: fqn
|
|
124
|
+
}, fromNode);
|
|
125
|
+
}
|
|
118
126
|
openRelationshipDetails(...params) {
|
|
119
127
|
if (params.length === 1) this.send({
|
|
120
128
|
type: "open.relationshipDetails",
|
|
@@ -157,6 +165,10 @@ var DiagramApi = class DiagramApi {
|
|
|
157
165
|
unhighlightAll() {
|
|
158
166
|
this.send({ type: "unhighlight.all" });
|
|
159
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Select nodes and edges in the diagram
|
|
170
|
+
* @param target - Optional selection target. If not provided, resets selection
|
|
171
|
+
*/
|
|
160
172
|
select(target) {
|
|
161
173
|
const nodes = target?.nodes ?? [];
|
|
162
174
|
const edges = target?.edges ?? [];
|
|
@@ -192,7 +204,7 @@ var DiagramApi = class DiagramApi {
|
|
|
192
204
|
* Start editing, either node or edge
|
|
193
205
|
*/
|
|
194
206
|
startEditing(subject) {
|
|
195
|
-
const editorActor = typedSystem(this.
|
|
207
|
+
const editorActor = typedSystem(this.actor.system).editorActorRef;
|
|
196
208
|
invariant(editorActor, "No editor actor found in diagram actor system");
|
|
197
209
|
editorActor.send({
|
|
198
210
|
type: "edit.move.start",
|
|
@@ -205,7 +217,7 @@ var DiagramApi = class DiagramApi {
|
|
|
205
217
|
* @default false
|
|
206
218
|
*/
|
|
207
219
|
stopEditing(wasChanged = false) {
|
|
208
|
-
const editorActor = typedSystem(this.
|
|
220
|
+
const editorActor = typedSystem(this.actor.system).editorActorRef;
|
|
209
221
|
invariant(editorActor, "No editor actor found in diagram actor system");
|
|
210
222
|
editorActor.send({ type: wasChanged ? "edit.move.end" : "edit.move.cancel" });
|
|
211
223
|
}
|
|
@@ -214,7 +226,7 @@ var DiagramApi = class DiagramApi {
|
|
|
214
226
|
* @returns true if there was something to undo
|
|
215
227
|
*/
|
|
216
228
|
undoEditing() {
|
|
217
|
-
const editorActor = typedSystem(this.
|
|
229
|
+
const editorActor = typedSystem(this.actor.system).editorActorRef;
|
|
218
230
|
invariant(editorActor, "No editor actor found in diagram actor system");
|
|
219
231
|
const hasUndo = editorActor.getSnapshot().context.history !== null;
|
|
220
232
|
if (hasUndo) editorActor.send({ type: "undo" });
|
|
@@ -249,7 +261,7 @@ var DiagramApi = class DiagramApi {
|
|
|
249
261
|
* Used by search to highlight an element on the current view.
|
|
250
262
|
*/
|
|
251
263
|
focusOnElement(elementFqn) {
|
|
252
|
-
const context = this.
|
|
264
|
+
const context = this.actor.getSnapshot().context;
|
|
253
265
|
const node = findNodeByModelFqn(context.xynodes, elementFqn);
|
|
254
266
|
if (node) this.send({
|
|
255
267
|
type: "focus.node",
|
|
@@ -261,25 +273,25 @@ var DiagramApi = class DiagramApi {
|
|
|
261
273
|
* @warning Do not use in render phase
|
|
262
274
|
*/
|
|
263
275
|
getContext() {
|
|
264
|
-
return this.
|
|
276
|
+
return this.actor.getSnapshot().context;
|
|
265
277
|
}
|
|
266
278
|
/**
|
|
267
279
|
* @warning Do not use in render phase
|
|
268
280
|
*/
|
|
269
281
|
findDiagramNode(xynodeId) {
|
|
270
|
-
return findDiagramNode(this.
|
|
282
|
+
return findDiagramNode(this.actor.getSnapshot().context, xynodeId);
|
|
271
283
|
}
|
|
272
284
|
/**
|
|
273
285
|
* @warning Do not use in render phase
|
|
274
286
|
*/
|
|
275
287
|
findEdge(xyedgeId) {
|
|
276
|
-
return this.
|
|
288
|
+
return this.actor.getSnapshot().context.xyedges.find((e) => e.data.id === xyedgeId) ?? null;
|
|
277
289
|
}
|
|
278
290
|
/**
|
|
279
291
|
* @warning Do not use in render phase
|
|
280
292
|
*/
|
|
281
293
|
findDiagramEdge(xyedgeId) {
|
|
282
|
-
return findDiagramEdge(this.
|
|
294
|
+
return findDiagramEdge(this.actor.getSnapshot().context, xyedgeId);
|
|
283
295
|
}
|
|
284
296
|
startWalkthrough(stepId) {
|
|
285
297
|
this.send({
|
|
@@ -300,6 +312,19 @@ var DiagramApi = class DiagramApi {
|
|
|
300
312
|
stopWalkthrough() {
|
|
301
313
|
this.send({ type: "walkthrough.end" });
|
|
302
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Starts comparing manual layout with the latest auto layout.
|
|
317
|
+
* Ignored if the view has no layout drifts, or the feature is disabled.
|
|
318
|
+
*/
|
|
319
|
+
startCompare() {
|
|
320
|
+
this.send({ type: "compare.start" });
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Stops comparing layouts, switches back to manual layout (if auto is active)
|
|
324
|
+
*/
|
|
325
|
+
endCompare() {
|
|
326
|
+
this.send({ type: "compare.end" });
|
|
327
|
+
}
|
|
303
328
|
toggleFeature(feature, forceValue) {
|
|
304
329
|
this.send({
|
|
305
330
|
type: "toggle.feature",
|
|
@@ -358,5 +383,4 @@ var DiagramApi = class DiagramApi {
|
|
|
358
383
|
}
|
|
359
384
|
};
|
|
360
385
|
|
|
361
|
-
//#endregion
|
|
362
386
|
export { DiagramApi };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { AnyEventObject, CallbackActorLogic, NonReducibleUnknown } from "xstate";
|
|
3
|
-
//#region src/likec4diagram/state/hotkeyActor.d.ts
|
|
4
3
|
export type HotKeyEvent = {
|
|
5
4
|
type: 'key.esc' | `key.arrow.${'left' | 'right' | 'up' | 'down'}`;
|
|
6
5
|
};
|
|
7
|
-
export interface HotkeyActorLogic extends CallbackActorLogic<AnyEventObject, NonReducibleUnknown, HotKeyEvent> {}
|
|
8
|
-
//#endregion
|
|
6
|
+
export interface HotkeyActorLogic extends CallbackActorLogic<AnyEventObject, NonReducibleUnknown, HotKeyEvent> {}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { isEventFromSearch } from "../../utils/search-event.mjs";
|
|
2
3
|
import { getHotkeyHandler } from "@mantine/hooks";
|
|
3
4
|
import { fromCallback } from "xstate";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
// src/likec4diagram/state/hotkeyActor.ts
|
|
6
7
|
const hotkeyActorLogic = fromCallback(({ sendBack }) => {
|
|
7
8
|
const escHandler = getHotkeyHandler([[
|
|
8
9
|
"Escape",
|
|
@@ -46,13 +47,18 @@ const hotkeyActorLogic = fromCallback(({ sendBack }) => {
|
|
|
46
47
|
{ preventDefault: true }
|
|
47
48
|
]
|
|
48
49
|
]);
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
const onEsc = (event) => {
|
|
51
|
+
if (!isEventFromSearch(event)) escHandler(event);
|
|
52
|
+
};
|
|
53
|
+
const onArrows = (event) => {
|
|
54
|
+
if (!isEventFromSearch(event)) arrowshandler(event);
|
|
55
|
+
};
|
|
56
|
+
document.body.addEventListener("keydown", onEsc);
|
|
57
|
+
document.body.addEventListener("keydown", onArrows, { capture: true });
|
|
51
58
|
return () => {
|
|
52
|
-
document.body.removeEventListener("keydown",
|
|
53
|
-
document.body.removeEventListener("keydown",
|
|
59
|
+
document.body.removeEventListener("keydown", onEsc);
|
|
60
|
+
document.body.removeEventListener("keydown", onArrows, { capture: true });
|
|
54
61
|
};
|
|
55
62
|
});
|
|
56
63
|
|
|
57
|
-
//#endregion
|
|
58
64
|
export { hotkeyActorLogic };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __name } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { calcEdgeBounds } from "../../utils/view-bounds.mjs";
|
|
3
|
-
import { activeSequenceBounds, focusedBounds, getEdgeBounds, viewBounds } from "./utils.mjs";
|
|
4
3
|
import { isActiveSequenceWalkthrough, machine } from "./machine.setup.mjs";
|
|
4
|
+
import { activeSequenceBounds, focusedBounds, getEdgeBounds, viewBounds } from "./utils.mjs";
|
|
5
5
|
import { getNodesBounds, getViewportForBounds } from "@xyflow/react";
|
|
6
6
|
import { BBox, invariant, isNonEmptyArray, nonNullable } from "@likec4/core";
|
|
7
7
|
import { assertEvent } from "xstate";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/likec4diagram/state/machine.actions.layout.ts
|
|
10
10
|
const calcMaxZoom = (context, transform = [
|
|
11
11
|
0,
|
|
12
12
|
0,
|
|
@@ -172,5 +172,4 @@ const returnViewportBefore = (params) => machine.enqueueActions(({ enqueue, cont
|
|
|
172
172
|
else enqueue(raiseFitDiagram({ ...params }));
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
-
//#endregion
|
|
176
175
|
export { assignViewportBefore, cancelFitDiagram, centerOnNodeOrEdge, fitDiagram, fitFocusedBounds, raiseFitDiagram, raiseSetViewport, raiseUpdateView, returnViewportBefore, setViewport, setViewportCenter };
|