@likec4/diagram 1.44.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +18847 -17876
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +15 -12
- package/dist/LikeC4Diagram.props.d.ts +13 -20
- package/dist/LikeC4ProjectsProvider.js +8 -4
- package/dist/LikeC4Styles.js +0 -3
- package/dist/LikeC4View.d.ts +3 -3
- package/dist/LikeC4View.js +8 -8
- package/dist/ReactLikeC4.d.ts +3 -6
- package/dist/StaticLikeC4Diagram.js +0 -2
- package/dist/base/Base.d.ts +1 -1
- package/dist/base/updateEdges.js +25 -15
- package/dist/base/updateNodes.d.ts +14 -0
- package/dist/base/updateNodes.js +51 -18
- package/dist/base-primitives/Markdown.d.ts +30 -4
- package/dist/base-primitives/Markdown.js +3 -2
- package/dist/base-primitives/NodeHandles.d.ts +2 -1
- package/dist/base-primitives/NodeHandles.js +22 -18
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +6 -4
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -2
- package/dist/base-primitives/edge/EdgeLabel.js +16 -16
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -4
- package/dist/base-primitives/edge/EdgePath.js +27 -12
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +3 -3
- package/dist/base-primitives/element/ElementData.d.ts +3 -3
- package/dist/base-primitives/element/ElementData.js +13 -7
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
- package/dist/base-primitives/element/ElementDetailsButton.js +4 -1
- package/dist/base-primitives/element/ElementShape.js +5 -5
- package/dist/base-primitives/element/ElementTags.d.ts +6 -4
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +0 -1
- package/dist/context/DiagramFeatures.d.ts +2 -1
- package/dist/context/DiagramFeatures.js +1 -0
- package/dist/context/EnsureMantine.js +2 -1
- package/dist/context/IconRenderer.js +6 -6
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.js +1 -1
- package/dist/editor/LikeC4EditorProvider.d.ts +22 -0
- package/dist/editor/LikeC4EditorProvider.js +12 -0
- package/dist/editor/__tests__/fixture.d.ts +205 -0
- package/dist/editor/applyChangesToManualLayout.d.ts +8 -0
- package/dist/editor/applyChangesToManualLayout.js +182 -0
- package/dist/editor/editorActor.actions.d.ts +201 -0
- package/dist/editor/editorActor.actions.js +149 -0
- package/dist/editor/editorActor.d.ts +653 -0
- package/dist/editor/editorActor.js +324 -0
- package/dist/editor/hotkeyActor.d.ts +7 -0
- package/dist/editor/hotkeyActor.js +19 -0
- package/dist/editor/index.d.ts +3 -2
- package/dist/editor/useEditorActorLogic.d.ts +565 -0
- package/dist/editor/useEditorActorLogic.js +54 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/safeContext.d.ts +3 -2
- package/dist/hooks/safeContext.js +7 -4
- package/dist/hooks/useDiagram.d.ts +4 -2
- package/dist/hooks/useDiagram.js +19 -8
- package/dist/hooks/useDiagramCompareLayout.d.ts +8 -0
- package/dist/hooks/useDiagramCompareLayout.js +29 -4
- package/dist/hooks/useLikeC4Project.d.ts +6 -1
- package/dist/hooks/useLikeC4Project.js +14 -2
- package/dist/hooks/useMediaPrint.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/likec4diagram/DiagramXYFlow.js +11 -7
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +34 -0
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +90 -54
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +3 -1
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/edges.css.js +30 -24
- package/dist/likec4diagram/custom/edges/useControlPoints.js +5 -5
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +5 -5
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/{ElementNodeDrifts.js → NodeDrifts.js} +12 -13
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.js +61 -23
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +128 -15
- package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +63 -72
- package/dist/likec4diagram/state/assign.d.ts +14 -7
- package/dist/likec4diagram/state/assign.js +28 -200
- package/dist/likec4diagram/state/createViewChange.js +23 -30
- package/dist/likec4diagram/state/diagram-api.d.ts +20 -6
- package/dist/likec4diagram/state/diagram-api.js +58 -52
- package/dist/likec4diagram/state/hotkeyActor.d.ts +1 -8
- package/dist/likec4diagram/state/hotkeyActor.js +13 -17
- package/dist/likec4diagram/state/machine.actions.d.ts +1127 -864
- package/dist/likec4diagram/state/machine.actions.js +316 -296
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +641 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +141 -0
- package/dist/likec4diagram/state/machine.d.ts +18 -3712
- package/dist/likec4diagram/state/machine.js +64 -73
- package/dist/likec4diagram/state/machine.setup.d.ts +80 -26
- package/dist/likec4diagram/state/machine.setup.js +44 -7
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +58 -17
- package/dist/likec4diagram/state/machine.state.initializing.js +14 -14
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +5 -108
- package/dist/likec4diagram/state/machine.state.navigating.js +187 -35
- package/dist/likec4diagram/state/machine.state.ready.d.ts +2997 -2598
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +710 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.js +98 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +540 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.js +105 -0
- package/dist/likec4diagram/state/machine.state.ready.js +95 -347
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +140 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +684 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +190 -0
- package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
- package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
- package/dist/likec4diagram/state/types.d.ts +11 -9
- package/dist/likec4diagram/state/utils.d.ts +44 -5
- package/dist/likec4diagram/state/utils.js +62 -6
- package/dist/likec4diagram/types.d.ts +8 -13
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.js +104 -103
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +12 -15
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
- package/dist/navigationpanel/NavigationPanel.js +11 -10
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- package/dist/navigationpanel/_common.js +1 -1
- package/dist/navigationpanel/actor.d.ts +4 -204
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +40 -14
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +6 -4
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +2 -2
- package/dist/navigationpanel/controls/DetailsControls.js +2 -2
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +2 -2
- package/dist/navigationpanel/controls/ToggleReadonly.js +32 -19
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +9 -9
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +4 -3
- package/dist/overlays/Overlays.js +24 -12
- package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
- package/dist/overlays/element-details/MetadataValue.js +4 -6
- package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
- package/dist/overlays/element-details/TabPanelRelationships.js +12 -7
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +8 -83
- package/dist/overlays/element-details/actor.js +0 -8
- package/dist/overlays/overlay/Overlay.js +10 -10
- package/dist/overlays/overlaysActor.d.ts +7 -392
- package/dist/overlays/overlaysActor.js +73 -49
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/_types.d.ts +3 -4
- package/dist/overlays/relationship-details/actor.d.ts +6 -562
- package/dist/overlays/relationship-details/actor.js +1 -0
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
- package/dist/overlays/relationship-details/layout.d.ts +3 -3
- package/dist/overlays/relationship-details/layout.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/_types.d.ts +2 -3
- package/dist/overlays/relationships-browser/actor.d.ts +7 -739
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +3 -3
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
- package/dist/overlays/types.d.ts +12 -13
- package/dist/search/components/ElementsColumn.js +7 -3
- package/dist/search/components/PickView.js +3 -1
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.d.ts +3 -1
- package/dist/search/components/ViewsColum.js +13 -7
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/searchActor.d.ts +3 -66
- package/dist/shadowroot/ShadowRoot.d.ts +5 -7
- package/dist/shadowroot/ShadowRoot.js +7 -5
- package/dist/shadowroot/styles.css.js +6 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/view-bounds.js +7 -6
- package/dist/utils/xyflow.d.ts +6 -5
- package/dist/utils/xyflow.js +26 -57
- package/package.json +24 -23
- package/panda.buildinfo.json +65 -71
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/base-primitives/edge/edge.css.d.ts +0 -4
- package/dist/base-primitives/edge/edge.css.js +0 -71
- package/dist/editor/LikeC4EditorContext.d.ts +0 -21
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +0 -4
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +0 -280
- package/dist/likec4diagram/state/syncManualLayoutActor.js +0 -248
- package/dist/utils/vector.d.ts +0 -81
- package/dist/utils/vector.js +0 -120
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { isStepEdgeId, getParallelStepsPrefix, invariant } from '@likec4/core';
|
|
2
|
+
import { clamp, first } from 'remeda';
|
|
3
|
+
import { assertEvent } from 'xstate';
|
|
4
|
+
import { SeqParallelAreaColor } from '../xyflow-sequence/const.js';
|
|
5
|
+
import { updateView, emitEdgeClick, stopHotKeyActor, undimEverything, startHotKeyActor, cancelEditing } from './machine.actions.js';
|
|
6
|
+
import { machine, targetState } from './machine.setup.js';
|
|
7
|
+
import { x as xstateActions_cjsExports } from '../../_virtual/xstate-actions.cjs.js';
|
|
8
|
+
import { fitFocusedBounds, returnViewportBefore, cancelFitDiagram, assignViewportBefore } from './machine.actions.layout.js';
|
|
9
|
+
import { Base } from '../../base/Base.js';
|
|
10
|
+
|
|
11
|
+
const updateActiveWalkthroughState = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
12
|
+
const { activeWalkthrough } = context;
|
|
13
|
+
if (!activeWalkthrough) {
|
|
14
|
+
console.warn("Active walkthrough is null");
|
|
15
|
+
enqueue.raise({ type: "walkthrough.end" });
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const { stepId, parallelPrefix } = activeWalkthrough;
|
|
19
|
+
const step = context.xyedges.find((x) => x.id === stepId);
|
|
20
|
+
if (!step) {
|
|
21
|
+
console.warn("Invalid walkthrough stepId:", stepId);
|
|
22
|
+
enqueue.raise({ type: "walkthrough.end" });
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
enqueue.assign({
|
|
26
|
+
xyedges: context.xyedges.map((edge) => {
|
|
27
|
+
const active = stepId === edge.id || !!parallelPrefix && edge.id.startsWith(parallelPrefix);
|
|
28
|
+
return Base.setData(edge, {
|
|
29
|
+
active,
|
|
30
|
+
dimmed: stepId !== edge.id
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
xynodes: context.xynodes.map((node) => {
|
|
34
|
+
const dimmed = step.source !== node.id && step.target !== node.id;
|
|
35
|
+
if (node.type === "seq-parallel") {
|
|
36
|
+
return Base.setData(node, {
|
|
37
|
+
color: parallelPrefix === node.data.parallelPrefix ? SeqParallelAreaColor.active : SeqParallelAreaColor.default,
|
|
38
|
+
dimmed
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return Base.setDimmed(node, dimmed);
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
const emitWalkthroughStarted = () => machine.emit(({ context }) => {
|
|
46
|
+
const edge = context.xyedges.find((x) => x.id === context.activeWalkthrough?.stepId);
|
|
47
|
+
invariant(edge, "Invalid walkthrough state");
|
|
48
|
+
return {
|
|
49
|
+
type: "walkthroughStarted",
|
|
50
|
+
edge
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
const emitWalkthroughStopped = () => machine.emit(() => ({
|
|
54
|
+
type: "walkthroughStopped"
|
|
55
|
+
}));
|
|
56
|
+
const emitWalkthroughStep = () => machine.emit(({ context }) => {
|
|
57
|
+
const edge = context.xyedges.find((x) => x.id === context.activeWalkthrough?.stepId);
|
|
58
|
+
invariant(edge, "Invalid walkthrough state");
|
|
59
|
+
return {
|
|
60
|
+
type: "walkthroughStep",
|
|
61
|
+
edge
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
const walkthrough = machine.createStateConfig({
|
|
65
|
+
id: targetState.walkthrough.slice(1),
|
|
66
|
+
entry: [
|
|
67
|
+
startHotKeyActor(),
|
|
68
|
+
cancelEditing(),
|
|
69
|
+
cancelFitDiagram(),
|
|
70
|
+
assignViewportBefore(),
|
|
71
|
+
xstateActions_cjsExports.assign({
|
|
72
|
+
activeWalkthrough: ({ context, event }) => {
|
|
73
|
+
assertEvent(event, "walkthrough.start");
|
|
74
|
+
const stepId = event.stepId ?? first(context.xyedges).id;
|
|
75
|
+
return {
|
|
76
|
+
stepId,
|
|
77
|
+
parallelPrefix: getParallelStepsPrefix(stepId)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
updateActiveWalkthroughState(),
|
|
82
|
+
fitFocusedBounds(),
|
|
83
|
+
emitWalkthroughStarted()
|
|
84
|
+
],
|
|
85
|
+
exit: [
|
|
86
|
+
stopHotKeyActor(),
|
|
87
|
+
xstateActions_cjsExports.enqueueActions(({ enqueue, context }) => {
|
|
88
|
+
enqueue.assign({
|
|
89
|
+
activeWalkthrough: null
|
|
90
|
+
});
|
|
91
|
+
if (context.dynamicViewVariant === "sequence" && context.activeWalkthrough?.parallelPrefix) {
|
|
92
|
+
enqueue.assign({
|
|
93
|
+
xynodes: context.xynodes.map((n) => {
|
|
94
|
+
if (n.type === "seq-parallel") {
|
|
95
|
+
return Base.setData(n, {
|
|
96
|
+
color: SeqParallelAreaColor.default
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return n;
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
104
|
+
undimEverything(),
|
|
105
|
+
returnViewportBefore(),
|
|
106
|
+
emitWalkthroughStopped()
|
|
107
|
+
],
|
|
108
|
+
on: {
|
|
109
|
+
"key.esc": {
|
|
110
|
+
target: targetState.idle
|
|
111
|
+
},
|
|
112
|
+
"key.arrow.left": {
|
|
113
|
+
actions: xstateActions_cjsExports.raise({ type: "walkthrough.step", direction: "previous" })
|
|
114
|
+
},
|
|
115
|
+
"key.arrow.up": {
|
|
116
|
+
actions: xstateActions_cjsExports.raise({ type: "walkthrough.step", direction: "previous" })
|
|
117
|
+
},
|
|
118
|
+
"key.arrow.right": {
|
|
119
|
+
actions: xstateActions_cjsExports.raise({ type: "walkthrough.step", direction: "next" })
|
|
120
|
+
},
|
|
121
|
+
"key.arrow.down": {
|
|
122
|
+
actions: xstateActions_cjsExports.raise({ type: "walkthrough.step", direction: "next" })
|
|
123
|
+
},
|
|
124
|
+
"walkthrough.step": {
|
|
125
|
+
actions: [
|
|
126
|
+
xstateActions_cjsExports.assign(({ context, event }) => {
|
|
127
|
+
const { stepId } = context.activeWalkthrough;
|
|
128
|
+
const stepIndex = context.xyedges.findIndex((e) => e.id === stepId);
|
|
129
|
+
const nextStepIndex = clamp(event.direction === "next" ? stepIndex + 1 : stepIndex - 1, {
|
|
130
|
+
min: 0,
|
|
131
|
+
max: context.xyedges.length - 1
|
|
132
|
+
});
|
|
133
|
+
if (nextStepIndex === stepIndex) {
|
|
134
|
+
return {};
|
|
135
|
+
}
|
|
136
|
+
const nextStepId = context.xyedges[nextStepIndex].id;
|
|
137
|
+
return {
|
|
138
|
+
activeWalkthrough: {
|
|
139
|
+
stepId: nextStepId,
|
|
140
|
+
parallelPrefix: getParallelStepsPrefix(nextStepId)
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}),
|
|
144
|
+
updateActiveWalkthroughState(),
|
|
145
|
+
fitFocusedBounds(),
|
|
146
|
+
emitWalkthroughStep()
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"xyflow.edgeClick": {
|
|
150
|
+
actions: [
|
|
151
|
+
xstateActions_cjsExports.assign(({ event, context }) => {
|
|
152
|
+
if (!isStepEdgeId(event.edge.id) || event.edge.id === context.activeWalkthrough?.stepId) {
|
|
153
|
+
return {};
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
activeWalkthrough: {
|
|
157
|
+
stepId: event.edge.id,
|
|
158
|
+
parallelPrefix: getParallelStepsPrefix(event.edge.id)
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}),
|
|
162
|
+
updateActiveWalkthroughState(),
|
|
163
|
+
fitFocusedBounds(),
|
|
164
|
+
emitEdgeClick(),
|
|
165
|
+
emitWalkthroughStep()
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"notations.unhighlight": {
|
|
169
|
+
actions: updateActiveWalkthroughState()
|
|
170
|
+
},
|
|
171
|
+
"tag.unhighlight": {
|
|
172
|
+
actions: updateActiveWalkthroughState()
|
|
173
|
+
},
|
|
174
|
+
"update.view": {
|
|
175
|
+
guard: "is same view",
|
|
176
|
+
actions: [
|
|
177
|
+
updateView(),
|
|
178
|
+
updateActiveWalkthroughState()
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
"walkthrough.end": {
|
|
182
|
+
target: targetState.idle
|
|
183
|
+
},
|
|
184
|
+
"xyflow.paneDblClick": {
|
|
185
|
+
target: targetState.idle
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
export { walkthrough };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnyEventObject, CallbackActorLogic, NonReducibleUnknown } from 'xstate';
|
|
2
|
+
export type MediaPrintEvent = {
|
|
3
|
+
type: 'media.print.on';
|
|
4
|
+
} | {
|
|
5
|
+
type: 'media.print.off';
|
|
6
|
+
};
|
|
7
|
+
export interface MediaPrintActorLogic extends CallbackActorLogic<AnyEventObject, NonReducibleUnknown, MediaPrintEvent> {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Actor logic to listen for media print events.
|
|
11
|
+
*/
|
|
12
|
+
export declare const mediaPrintActorLogic: MediaPrintActorLogic;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { fromCallback } from 'xstate';
|
|
2
|
+
|
|
3
|
+
const mediaPrintActorLogic = fromCallback(({ sendBack }) => {
|
|
4
|
+
const beforePrint = () => {
|
|
5
|
+
sendBack({ type: "media.print.on" });
|
|
6
|
+
};
|
|
7
|
+
const afterPrint = () => {
|
|
8
|
+
sendBack({ type: "media.print.off" });
|
|
9
|
+
};
|
|
10
|
+
window.addEventListener("beforeprint", beforePrint);
|
|
11
|
+
window.addEventListener("afterprint", afterPrint);
|
|
12
|
+
return () => {
|
|
13
|
+
window.removeEventListener("beforeprint", beforePrint);
|
|
14
|
+
window.removeEventListener("afterprint", afterPrint);
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { mediaPrintActorLogic };
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActorSystem } from 'xstate';
|
|
2
|
+
import { EditorActorRef } from '../../editor/editorActor';
|
|
2
3
|
import { OverlaysActorRef } from '../../overlays/overlaysActor';
|
|
3
4
|
import { SearchActorRef } from '../../search/searchActor';
|
|
4
|
-
import {
|
|
5
|
-
|
|
5
|
+
import { DiagramMachineRef } from './machine';
|
|
6
|
+
export type NodeWithData = {
|
|
7
|
+
id: string;
|
|
8
|
+
data: Record<string, unknown>;
|
|
9
|
+
};
|
|
6
10
|
export type System = ActorSystem<{
|
|
7
11
|
actors: {
|
|
8
|
-
diagram:
|
|
12
|
+
diagram: DiagramMachineRef;
|
|
9
13
|
overlays: OverlaysActorRef;
|
|
10
14
|
search: SearchActorRef;
|
|
11
|
-
|
|
15
|
+
editor: EditorActorRef;
|
|
12
16
|
};
|
|
13
17
|
}>;
|
|
14
|
-
export interface DiagramActorRef extends
|
|
18
|
+
export interface DiagramActorRef extends DiagramMachineRef {
|
|
15
19
|
system: System;
|
|
16
20
|
}
|
|
17
|
-
export type DiagramActorSnapshot
|
|
18
|
-
export type DiagramActorEvent = EventFromLogic<DiagramMachineLogic>;
|
|
19
|
-
export type { Context as DiagramContext, EmittedEvents as DiagramEmittedEvents, } from './machine.setup';
|
|
21
|
+
export type { DiagramContext, DiagramEmittedEvents, DiagramEvents, DiagramMachineSnapshot as DiagramActorSnapshot, } from './machine';
|
|
@@ -1,16 +1,39 @@
|
|
|
1
|
-
import { DiagramEdge, DiagramNode, BBox } from '@likec4/core/types';
|
|
1
|
+
import { DiagramEdge, DiagramNode, DiagramView, Fqn, BBox } from '@likec4/core/types';
|
|
2
|
+
import { Viewport } from '@xyflow/system';
|
|
2
3
|
import { ActorSystem } from 'xstate';
|
|
4
|
+
import { EditorActorRef } from '../../editor/editorActor';
|
|
5
|
+
import { ViewPaddings } from '../../LikeC4Diagram.props';
|
|
3
6
|
import { OverlaysActorRef } from '../../overlays/overlaysActor';
|
|
4
7
|
import { SearchActorRef } from '../../search/searchActor';
|
|
8
|
+
import { Types } from '../types';
|
|
5
9
|
import { Context } from './machine.setup';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
10
|
+
import { DiagramActorRef, NodeWithData } from './types';
|
|
11
|
+
import { DeploymentFqn } from '@likec4/core';
|
|
12
|
+
export declare const findNodeByModelFqn: <T extends NodeWithData>(xynodes: T[], elementFqn: Fqn) => (T & {
|
|
13
|
+
data: {
|
|
14
|
+
modelFqn: Fqn;
|
|
15
|
+
};
|
|
16
|
+
}) | null;
|
|
8
17
|
export declare function typedSystem(system: ActorSystem<any>): {
|
|
9
|
-
readonly syncLayoutActorRef: SyncLayoutActorRef | null;
|
|
10
18
|
readonly overlaysActorRef: OverlaysActorRef | null;
|
|
11
19
|
readonly diagramActorRef: DiagramActorRef;
|
|
12
20
|
readonly searchActorRef: SearchActorRef | null;
|
|
21
|
+
readonly editorActorRef: EditorActorRef | null;
|
|
13
22
|
};
|
|
23
|
+
export declare namespace typedSystem {
|
|
24
|
+
var editorActor: ({ system }: {
|
|
25
|
+
system: ActorSystem<any>;
|
|
26
|
+
}) => EditorActorRef;
|
|
27
|
+
var overlaysActor: ({ system }: {
|
|
28
|
+
system: ActorSystem<any>;
|
|
29
|
+
}) => OverlaysActorRef;
|
|
30
|
+
var diagramActor: ({ system }: {
|
|
31
|
+
system: ActorSystem<any>;
|
|
32
|
+
}) => DiagramActorRef;
|
|
33
|
+
var searchActor: ({ system }: {
|
|
34
|
+
system: ActorSystem<any>;
|
|
35
|
+
}) => SearchActorRef;
|
|
36
|
+
}
|
|
14
37
|
export declare function findDiagramNode(ctx: Context, xynodeId: string): DiagramNode | null;
|
|
15
38
|
export declare function findDiagramEdge(ctx: Context, xyedgeId: string): DiagramEdge | null;
|
|
16
39
|
export declare function focusedBounds(params: {
|
|
@@ -23,5 +46,21 @@ export declare function activeSequenceBounds(params: {
|
|
|
23
46
|
context: Context;
|
|
24
47
|
}): {
|
|
25
48
|
bounds: BBox;
|
|
26
|
-
duration
|
|
49
|
+
duration: number;
|
|
50
|
+
};
|
|
51
|
+
export declare function nodeRef(node: Types.Node): DeploymentFqn | Fqn | null;
|
|
52
|
+
export declare function findCorrespondingNode(context: Pick<Context, 'lastOnNavigate' | 'xynodes'>, event: {
|
|
53
|
+
view: DiagramView;
|
|
54
|
+
xynodes: Types.Node[];
|
|
55
|
+
}): {
|
|
56
|
+
fromNode: Types.Node<"element" | "deployment" | "compound-element" | "compound-deployment" | "view-group" | "seq-actor" | "seq-parallel"> | null | undefined;
|
|
57
|
+
toNode: Types.Node<"element" | "deployment" | "compound-element" | "compound-deployment" | "view-group" | "seq-actor" | "seq-parallel"> | null | undefined;
|
|
58
|
+
};
|
|
59
|
+
export declare function calcViewportForBounds(context: Pick<Context, 'xystore' | 'fitViewPadding'>, bounds: BBox): Viewport;
|
|
60
|
+
export declare function parseAsNumber(value: string | number | undefined): number;
|
|
61
|
+
export declare function parseViewPaddings(paddings: ViewPaddings): {
|
|
62
|
+
top: number;
|
|
63
|
+
right: number;
|
|
64
|
+
bottom: number;
|
|
65
|
+
left: number;
|
|
27
66
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { BBox } from '@likec4/core/types';
|
|
2
|
-
import { nonNullable } from '@likec4/core/utils';
|
|
3
|
-
import { getNodesBounds, getNodeDimensions, getEdgePosition } from '@xyflow/system';
|
|
2
|
+
import { nonNullable, nonexhaustive } from '@likec4/core/utils';
|
|
3
|
+
import { getViewportForBounds, getNodesBounds, getNodeDimensions, getEdgePosition } from '@xyflow/system';
|
|
4
|
+
import { MinZoom } from '../../base/const.js';
|
|
4
5
|
|
|
6
|
+
const findNodeByModelFqn = (xynodes, elementFqn) => {
|
|
7
|
+
const node = xynodes.find((n) => "modelFqn" in n.data && n.data["modelFqn"] === elementFqn);
|
|
8
|
+
return node ? node : null;
|
|
9
|
+
};
|
|
5
10
|
function typedSystem(system) {
|
|
6
11
|
return {
|
|
7
|
-
get syncLayoutActorRef() {
|
|
8
|
-
return system.get("syncLayout") ?? null;
|
|
9
|
-
},
|
|
10
12
|
get overlaysActorRef() {
|
|
11
13
|
return system.get("overlays") ?? null;
|
|
12
14
|
},
|
|
@@ -15,9 +17,24 @@ function typedSystem(system) {
|
|
|
15
17
|
},
|
|
16
18
|
get searchActorRef() {
|
|
17
19
|
return system.get("search") ?? null;
|
|
20
|
+
},
|
|
21
|
+
get editorActorRef() {
|
|
22
|
+
return system.get("editor") ?? null;
|
|
18
23
|
}
|
|
19
24
|
};
|
|
20
25
|
}
|
|
26
|
+
typedSystem.editorActor = ({ system }) => {
|
|
27
|
+
return system.get("editor");
|
|
28
|
+
};
|
|
29
|
+
typedSystem.overlaysActor = ({ system }) => {
|
|
30
|
+
return system.get("overlays");
|
|
31
|
+
};
|
|
32
|
+
typedSystem.diagramActor = ({ system }) => {
|
|
33
|
+
return system.get("diagram");
|
|
34
|
+
};
|
|
35
|
+
typedSystem.searchActor = ({ system }) => {
|
|
36
|
+
return system.get("search");
|
|
37
|
+
};
|
|
21
38
|
function findDiagramNode(ctx, xynodeId) {
|
|
22
39
|
return ctx.view.nodes.find((n) => n.id === xynodeId) ?? null;
|
|
23
40
|
}
|
|
@@ -124,5 +141,44 @@ function getEdgeBounds(edge, store) {
|
|
|
124
141
|
[edgePosition.targetX, edgePosition.targetY]
|
|
125
142
|
]);
|
|
126
143
|
}
|
|
144
|
+
function nodeRef(node) {
|
|
145
|
+
switch (node.type) {
|
|
146
|
+
case "element":
|
|
147
|
+
case "compound-element":
|
|
148
|
+
case "seq-actor":
|
|
149
|
+
return node.data.modelFqn;
|
|
150
|
+
case "deployment":
|
|
151
|
+
case "compound-deployment":
|
|
152
|
+
return node.data.modelFqn ?? node.data.deploymentFqn;
|
|
153
|
+
case "seq-parallel":
|
|
154
|
+
case "view-group":
|
|
155
|
+
return null;
|
|
156
|
+
default:
|
|
157
|
+
nonexhaustive(node);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function findCorrespondingNode(context, event) {
|
|
161
|
+
const fromNodeId = context.lastOnNavigate?.fromNode;
|
|
162
|
+
const fromNode = fromNodeId && context.xynodes.find((n) => n.id === fromNodeId);
|
|
163
|
+
const fromRef = fromNode && nodeRef(fromNode);
|
|
164
|
+
const toNode = fromRef && event.xynodes.find((n) => nodeRef(n) === fromRef);
|
|
165
|
+
return { fromNode, toNode };
|
|
166
|
+
}
|
|
167
|
+
function calcViewportForBounds(context, bounds) {
|
|
168
|
+
let {
|
|
169
|
+
width,
|
|
170
|
+
height,
|
|
171
|
+
transform
|
|
172
|
+
} = context.xystore.getState();
|
|
173
|
+
const maxZoom = Math.max(transform[2], 1);
|
|
174
|
+
return getViewportForBounds(
|
|
175
|
+
bounds,
|
|
176
|
+
width,
|
|
177
|
+
height,
|
|
178
|
+
MinZoom,
|
|
179
|
+
maxZoom,
|
|
180
|
+
context.fitViewPadding
|
|
181
|
+
);
|
|
182
|
+
}
|
|
127
183
|
|
|
128
|
-
export { activeSequenceBounds, findDiagramEdge, findDiagramNode, focusedBounds, typedSystem };
|
|
184
|
+
export { activeSequenceBounds, calcViewportForBounds, findCorrespondingNode, findDiagramEdge, findDiagramNode, findNodeByModelFqn, focusedBounds, nodeRef, typedSystem };
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { BBox, DeploymentFqn, DiagramEdge,
|
|
1
|
+
import { BBox, DeploymentFqn, DiagramEdge, DiagramNode, DiagramNodeDriftReason, ExclusiveUnion, Fqn, IconUrl, MarkdownOrString, NonEmptyReadonlyArray, ViewId } from '@likec4/core/types';
|
|
2
2
|
import { XYPosition } from '@xyflow/system';
|
|
3
3
|
import { FunctionComponent } from 'react';
|
|
4
4
|
import { Simplify } from 'type-fest';
|
|
5
5
|
import { BaseEdge, BaseEdgeData, BaseEdgeProps, BaseNode, BaseNodeData, BaseNodeProps, NonOptional } from '../base/types';
|
|
6
6
|
export declare namespace Types {
|
|
7
|
-
type LeafNodeData = Simplify<BaseNodeData & NonOptional<Pick<DiagramNode, 'id' | 'title' | 'color' | 'shape' | 'width' | 'level' | 'height' | 'style' | 'tags' | 'x' | 'y'>> & {
|
|
8
|
-
technology: string | null;
|
|
9
|
-
description: RichTextOrEmpty;
|
|
7
|
+
type LeafNodeData = Simplify<BaseNodeData & NonOptional<Pick<DiagramNode, 'id' | 'title' | 'technology' | 'description' | 'color' | 'shape' | 'width' | 'level' | 'height' | 'style' | 'tags' | 'x' | 'y'>> & {
|
|
10
8
|
/**
|
|
11
9
|
* View this node belongs to
|
|
12
10
|
*/
|
|
13
11
|
viewId: ViewId;
|
|
14
12
|
isMultiple?: boolean | undefined;
|
|
15
13
|
icon: string | null;
|
|
14
|
+
drifts: NonEmptyReadonlyArray<DiagramNodeDriftReason> | null;
|
|
16
15
|
}>;
|
|
17
16
|
/**
|
|
18
17
|
* Represents element from logical model
|
|
@@ -24,7 +23,6 @@ export declare namespace Types {
|
|
|
24
23
|
* If set - this node has navigation to another view and diagram has handler for this
|
|
25
24
|
*/
|
|
26
25
|
navigateTo: ViewId | null;
|
|
27
|
-
drifts: NonEmptyReadonlyArray<DiagramNodeDriftReason> | null;
|
|
28
26
|
}>;
|
|
29
27
|
/**
|
|
30
28
|
* Represents element from deployment model
|
|
@@ -33,7 +31,6 @@ export declare namespace Types {
|
|
|
33
31
|
navigateTo: ViewId | null;
|
|
34
32
|
deploymentFqn: DeploymentFqn;
|
|
35
33
|
modelFqn: Fqn | null;
|
|
36
|
-
drifts: NonEmptyReadonlyArray<DiagramNodeDriftReason> | null;
|
|
37
34
|
}>;
|
|
38
35
|
type SequenceActorNodePort = {
|
|
39
36
|
id: string;
|
|
@@ -59,6 +56,7 @@ export declare namespace Types {
|
|
|
59
56
|
viewId: ViewId;
|
|
60
57
|
depth: number;
|
|
61
58
|
icon?: IconUrl;
|
|
59
|
+
drifts: NonEmptyReadonlyArray<DiagramNodeDriftReason> | null;
|
|
62
60
|
}>;
|
|
63
61
|
type CompoundElementNodeData = Simplify<CompoundNodeData & {
|
|
64
62
|
modelFqn: Fqn;
|
|
@@ -67,7 +65,6 @@ export declare namespace Types {
|
|
|
67
65
|
* If set - this node has navigation to another view and diagram has handler for this
|
|
68
66
|
*/
|
|
69
67
|
navigateTo: ViewId | null;
|
|
70
|
-
drifts: NonEmptyReadonlyArray<DiagramNodeDriftReason> | null;
|
|
71
68
|
}>;
|
|
72
69
|
type CompoundDeploymentNodeData = Simplify<CompoundNodeData & {
|
|
73
70
|
deploymentFqn: DeploymentFqn;
|
|
@@ -79,7 +76,6 @@ export declare namespace Types {
|
|
|
79
76
|
* If set - this node has navigation to another view and diagram has handler for this
|
|
80
77
|
*/
|
|
81
78
|
navigateTo: ViewId | null;
|
|
82
|
-
drifts: NonEmptyReadonlyArray<DiagramNodeDriftReason> | null;
|
|
83
79
|
}>;
|
|
84
80
|
type ViewGroupNodeData = Simplify<CompoundNodeData & {
|
|
85
81
|
isViewGroup: true;
|
|
@@ -106,14 +102,13 @@ export declare namespace Types {
|
|
|
106
102
|
type: Type;
|
|
107
103
|
}>;
|
|
108
104
|
type NodeProps<Type extends NodeType = NodeType> = BaseNodeProps<Node<Type>>;
|
|
109
|
-
type RelationshipEdgeData = Simplify<BaseEdgeData & NonOptional<Pick<DiagramEdge, 'id' | 'label' | 'labelBBox' | 'technology' | 'points' | 'dir' | 'color' | 'line' | 'head' | 'tail' | 'navigateTo' | 'astPath'>> & {
|
|
110
|
-
notes:
|
|
105
|
+
type RelationshipEdgeData = Simplify<BaseEdgeData & NonOptional<Pick<DiagramEdge, 'id' | 'label' | 'labelBBox' | 'technology' | 'points' | 'dir' | 'color' | 'line' | 'head' | 'tail' | 'navigateTo' | 'astPath' | 'drifts'>> & {
|
|
106
|
+
notes: MarkdownOrString | null;
|
|
111
107
|
labelXY: XYPosition | null;
|
|
112
108
|
controlPoints: XYPosition[] | undefined | null;
|
|
113
|
-
drifts: NonEmptyReadonlyArray<DiagramEdgeDriftReason> | null;
|
|
114
109
|
}>;
|
|
115
|
-
type SequenceStepEdgeData = Simplify<BaseEdgeData & NonOptional<Pick<DiagramEdge, 'id' | 'label' | 'technology' | 'points' | 'dir' | 'color' | 'line' | 'head' | 'tail' | 'navigateTo' | 'astPath'>> & {
|
|
116
|
-
notes:
|
|
110
|
+
type SequenceStepEdgeData = Simplify<BaseEdgeData & NonOptional<Pick<DiagramEdge, 'id' | 'label' | 'technology' | 'points' | 'dir' | 'color' | 'line' | 'head' | 'tail' | 'navigateTo' | 'astPath' | 'drifts'>> & {
|
|
111
|
+
notes: MarkdownOrString | null;
|
|
117
112
|
labelXY: XYPosition | null;
|
|
118
113
|
labelBBox: BBox;
|
|
119
114
|
controlPoints: XYPosition[] | undefined | null;
|
|
@@ -7,7 +7,10 @@ const container = css({
|
|
|
7
7
|
padding: "2",
|
|
8
8
|
margin: "0",
|
|
9
9
|
width: "min-content",
|
|
10
|
-
height: "min-content"
|
|
10
|
+
height: "min-content",
|
|
11
|
+
_print: {
|
|
12
|
+
display: "none"
|
|
13
|
+
}
|
|
11
14
|
});
|
|
12
15
|
const icon = css({
|
|
13
16
|
["--ai-radius"]: "0px",
|
|
@@ -43,7 +46,7 @@ const elementNotation = css({
|
|
|
43
46
|
// WebkitBackdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
|
|
44
47
|
// backdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
|
|
45
48
|
// vars: {
|
|
46
|
-
// // [stokeFillMix]: `color-mix(in
|
|
49
|
+
// // [stokeFillMix]: `color-mix(in oklab, ${vars.element.stroke} 90%, ${vars.element.fill})`
|
|
47
50
|
// },
|
|
48
51
|
_hover: {
|
|
49
52
|
transition: "all 120ms ease-out",
|
|
@@ -9,9 +9,9 @@ import { useDiagramContext } from '../../../hooks/useDiagram.js';
|
|
|
9
9
|
import { useXYStore } from '../../../hooks/useXYFlow.js';
|
|
10
10
|
import { container, icon, card, tabPanel, shapeBadge, elementNotation } from './NotationPanel.css.js';
|
|
11
11
|
import { useMantinePortalProps } from '../../../hooks/useMantinePortalProps.js';
|
|
12
|
-
import IconAlertTriangle from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.
|
|
13
|
-
import IconHelpCircle from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.
|
|
14
|
-
import IconArrowDownRight from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.
|
|
12
|
+
import IconAlertTriangle from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js';
|
|
13
|
+
import IconHelpCircle from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js';
|
|
14
|
+
import IconArrowDownRight from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js';
|
|
15
15
|
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
16
16
|
import { ElementShape } from '../../../base-primitives/element/ElementShape.js';
|
|
17
17
|
|