@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
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { DynamicViewDisplayVariant, NodeNotation as ElementNotation, ViewChange } from '@likec4/core/types';
|
|
2
|
+
import { RefObject } from 'react';
|
|
2
3
|
import { PartialDeep } from 'type-fest';
|
|
3
4
|
import { FeatureName } from '../../context/DiagramFeatures';
|
|
4
5
|
import { OpenSourceParams } from '../../LikeC4Diagram.props';
|
|
6
|
+
import { OverlaysActorRef } from '../../overlays/overlaysActor';
|
|
5
7
|
import { Types } from '../types';
|
|
6
8
|
import { AlignmentMode } from './aligners';
|
|
7
|
-
import {
|
|
9
|
+
import { DiagramActorRef, DiagramContext, DiagramEvents } from './types';
|
|
8
10
|
import type * as t from '@likec4/core/types';
|
|
9
11
|
type Any = t.aux.Any;
|
|
10
12
|
type Unknown = t.aux.UnknownLayouted;
|
|
@@ -13,19 +15,30 @@ type Fqn<A> = t.aux.Fqn<A>;
|
|
|
13
15
|
type NodeId = t.aux.NodeId;
|
|
14
16
|
type EdgeId = t.aux.EdgeId;
|
|
15
17
|
export interface DiagramApi<A extends Any = Unknown> {
|
|
18
|
+
/**
|
|
19
|
+
* React ref to the diagram actor
|
|
20
|
+
*/
|
|
21
|
+
readonly ref: RefObject<DiagramActorRef>;
|
|
22
|
+
/**
|
|
23
|
+
* @warning Do not use in render phase
|
|
24
|
+
*/
|
|
16
25
|
readonly actor: DiagramActorRef;
|
|
17
26
|
/**
|
|
18
27
|
* @warning Do not use in render phase
|
|
19
28
|
*/
|
|
20
29
|
readonly currentView: t.DiagramView<A>;
|
|
30
|
+
overlays(): OverlaysActorRef;
|
|
21
31
|
/**
|
|
22
32
|
* Send event to diagram actor
|
|
23
33
|
*/
|
|
24
|
-
send(event:
|
|
34
|
+
send(event: DiagramEvents): void;
|
|
25
35
|
/**
|
|
26
36
|
* Navigate to view
|
|
37
|
+
* @param viewId - Target view ID
|
|
38
|
+
* @param fromNode - Node from which navigation was triggered
|
|
39
|
+
* @param focusOnElement - Element FQN to focus after navigation (from search)
|
|
27
40
|
*/
|
|
28
|
-
navigateTo(viewId: ViewId<A>, fromNode?: NodeId): void;
|
|
41
|
+
navigateTo(viewId: ViewId<A>, fromNode?: NodeId, focusOnElement?: Fqn<A>): void;
|
|
29
42
|
/**
|
|
30
43
|
* Navigate back or forward in history
|
|
31
44
|
*/
|
|
@@ -77,9 +90,10 @@ export interface DiagramApi<A extends Any = Unknown> {
|
|
|
77
90
|
*/
|
|
78
91
|
focusNode(nodeId: NodeId): void;
|
|
79
92
|
/**
|
|
80
|
-
*
|
|
93
|
+
* Focus on element by FQN (finds the node and focuses on it).
|
|
94
|
+
* Used by search to highlight an element on the current view.
|
|
81
95
|
*/
|
|
82
|
-
|
|
96
|
+
focusOnElement(elementFqn: Fqn<A>): void;
|
|
83
97
|
/**
|
|
84
98
|
* @warning Do not use in render phase
|
|
85
99
|
*/
|
|
@@ -109,5 +123,5 @@ export interface DiagramApi<A extends Any = Unknown> {
|
|
|
109
123
|
*/
|
|
110
124
|
switchDynamicViewVariant(variant: DynamicViewDisplayVariant): void;
|
|
111
125
|
}
|
|
112
|
-
export declare function makeDiagramApi<A extends Any = Unknown>(
|
|
126
|
+
export declare function makeDiagramApi<A extends Any = Unknown>(actorRef: RefObject<DiagramActorRef>): DiagramApi<A>;
|
|
113
127
|
export {};
|
|
@@ -1,132 +1,138 @@
|
|
|
1
|
-
import { invariant } from '@likec4/core/utils';
|
|
2
|
-
import { findDiagramEdge, findDiagramNode, typedSystem } from './utils.js';
|
|
1
|
+
import { invariant, nonNullable } from '@likec4/core/utils';
|
|
2
|
+
import { findDiagramEdge, findDiagramNode, findNodeByModelFqn, typedSystem } from './utils.js';
|
|
3
3
|
|
|
4
|
-
function makeDiagramApi(
|
|
4
|
+
function makeDiagramApi(actorRef) {
|
|
5
5
|
return {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
ref: actorRef,
|
|
7
|
+
get actor() {
|
|
8
|
+
return actorRef.current;
|
|
9
|
+
},
|
|
10
|
+
overlays() {
|
|
11
|
+
return nonNullable(actorRef.current.getSnapshot().children.overlays, "Overlays actor not found");
|
|
12
|
+
},
|
|
13
|
+
send: (event) => actorRef.current.send(event),
|
|
14
|
+
navigateTo: (viewId, fromNode, focusOnElement) => {
|
|
15
|
+
actorRef.current.send({
|
|
10
16
|
type: "navigate.to",
|
|
11
17
|
viewId,
|
|
12
|
-
...fromNode && { fromNode }
|
|
18
|
+
...fromNode && { fromNode },
|
|
19
|
+
...focusOnElement && { focusOnElement }
|
|
13
20
|
});
|
|
14
21
|
},
|
|
15
22
|
navigate: (direction) => {
|
|
16
|
-
|
|
23
|
+
actorRef.current.send({ type: `navigate.${direction}` });
|
|
17
24
|
},
|
|
18
25
|
fitDiagram: (duration = 350) => {
|
|
19
|
-
|
|
26
|
+
actorRef.current.send({ type: "xyflow.fitDiagram", duration });
|
|
20
27
|
},
|
|
21
28
|
openRelationshipsBrowser: (fqn) => {
|
|
22
|
-
|
|
29
|
+
actorRef.current.send({ type: "open.relationshipsBrowser", fqn });
|
|
23
30
|
},
|
|
24
31
|
openSource: (params) => {
|
|
25
|
-
|
|
32
|
+
actorRef.current.send({ type: "open.source", ...params });
|
|
26
33
|
},
|
|
27
34
|
openElementDetails: (fqn, fromNode) => {
|
|
28
|
-
|
|
35
|
+
actorRef.current.send({ type: "open.elementDetails", fqn, fromNode });
|
|
29
36
|
},
|
|
30
37
|
openRelationshipDetails: (...params) => {
|
|
31
38
|
if (params.length === 1) {
|
|
32
|
-
|
|
39
|
+
actorRef.current.send({ type: "open.relationshipDetails", params: { edgeId: params[0] } });
|
|
33
40
|
} else {
|
|
34
|
-
|
|
41
|
+
actorRef.current.send({ type: "open.relationshipDetails", params: { source: params[0], target: params[1] } });
|
|
35
42
|
}
|
|
36
43
|
},
|
|
37
44
|
updateNodeData: (nodeId, data) => {
|
|
38
|
-
|
|
45
|
+
actorRef.current.send({ type: "update.nodeData", nodeId, data });
|
|
39
46
|
},
|
|
40
47
|
updateEdgeData: (edgeId, data) => {
|
|
41
|
-
|
|
42
|
-
type: "update.edgeData",
|
|
43
|
-
edgeId,
|
|
44
|
-
data
|
|
45
|
-
});
|
|
48
|
+
actorRef.current.send({ type: "update.edgeData", edgeId, data });
|
|
46
49
|
},
|
|
47
50
|
startEditing: (subject) => {
|
|
48
|
-
const
|
|
49
|
-
invariant(
|
|
50
|
-
|
|
51
|
+
const editorActor = typedSystem(actorRef.current.system).editorActorRef;
|
|
52
|
+
invariant(editorActor, "No editor actor found in diagram actor system");
|
|
53
|
+
editorActor.send({ type: "edit.start", subject });
|
|
51
54
|
},
|
|
52
55
|
stopEditing: (wasChanged = false) => {
|
|
53
|
-
const
|
|
54
|
-
invariant(
|
|
55
|
-
|
|
56
|
+
const editorActor = typedSystem(actorRef.current.system).editorActorRef;
|
|
57
|
+
invariant(editorActor, "No editor actor found in diagram actor system");
|
|
58
|
+
editorActor.send({ type: "edit.finish", wasChanged });
|
|
56
59
|
},
|
|
57
60
|
undoEditing: () => {
|
|
58
|
-
const
|
|
59
|
-
invariant(
|
|
60
|
-
const hasUndo =
|
|
61
|
+
const editorActor = typedSystem(actorRef.current.system).editorActorRef;
|
|
62
|
+
invariant(editorActor, "No editor actor found in diagram actor system");
|
|
63
|
+
const hasUndo = editorActor.getSnapshot().context.history.length > 0;
|
|
61
64
|
if (hasUndo) {
|
|
62
|
-
|
|
65
|
+
editorActor.send({ type: "undo" });
|
|
63
66
|
}
|
|
64
67
|
return hasUndo;
|
|
65
68
|
},
|
|
66
69
|
align: (mode) => {
|
|
67
|
-
|
|
70
|
+
actorRef.current.send({ type: "layout.align", mode });
|
|
68
71
|
},
|
|
69
72
|
resetEdgeControlPoints: () => {
|
|
70
|
-
|
|
73
|
+
actorRef.current.send({ type: "layout.resetEdgeControlPoints" });
|
|
71
74
|
},
|
|
72
75
|
focusNode: (nodeId) => {
|
|
73
|
-
|
|
76
|
+
actorRef.current.send({ type: "focus.node", nodeId });
|
|
77
|
+
},
|
|
78
|
+
focusOnElement: (elementFqn) => {
|
|
79
|
+
const context = actorRef.current.getSnapshot().context;
|
|
80
|
+
const node = findNodeByModelFqn(context.xynodes, elementFqn);
|
|
81
|
+
if (node) {
|
|
82
|
+
actorRef.current.send({ type: "focus.node", nodeId: node.id, autoUnfocus: true });
|
|
83
|
+
}
|
|
74
84
|
},
|
|
75
85
|
/**
|
|
76
86
|
* @warning Do not use in render phase
|
|
77
87
|
*/
|
|
78
88
|
get currentView() {
|
|
79
|
-
return
|
|
89
|
+
return actorRef.current.getSnapshot().context.view;
|
|
80
90
|
},
|
|
81
91
|
/**
|
|
82
92
|
* @warning Do not use in render phase
|
|
83
93
|
*/
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @warning Do not use in render phase
|
|
87
|
-
*/
|
|
88
|
-
getContext: () => actor.getSnapshot().context,
|
|
94
|
+
getContext: () => actorRef.current.getSnapshot().context,
|
|
89
95
|
/**
|
|
90
96
|
* @warning Do not use in render phase
|
|
91
97
|
*/
|
|
92
98
|
findDiagramNode: (xynodeId) => {
|
|
93
|
-
return findDiagramNode(
|
|
99
|
+
return findDiagramNode(actorRef.current.getSnapshot().context, xynodeId);
|
|
94
100
|
},
|
|
95
101
|
findEdge: (xyedgeId) => {
|
|
96
|
-
return
|
|
102
|
+
return actorRef.current.getSnapshot().context.xyedges.find((e) => e.data.id === xyedgeId) ?? null;
|
|
97
103
|
},
|
|
98
104
|
/**
|
|
99
105
|
* @warning Do not use in render phase
|
|
100
106
|
*/
|
|
101
107
|
findDiagramEdge: (xyedgeId) => {
|
|
102
|
-
return findDiagramEdge(
|
|
108
|
+
return findDiagramEdge(actorRef.current.getSnapshot().context, xyedgeId);
|
|
103
109
|
},
|
|
104
110
|
startWalkthrough: () => {
|
|
105
|
-
|
|
111
|
+
actorRef.current.send({ type: "walkthrough.start" });
|
|
106
112
|
},
|
|
107
113
|
walkthroughStep: (direction = "next") => {
|
|
108
|
-
|
|
114
|
+
actorRef.current.send({ type: "walkthrough.step", direction });
|
|
109
115
|
},
|
|
110
116
|
stopWalkthrough: () => {
|
|
111
|
-
|
|
117
|
+
actorRef.current.send({ type: "walkthrough.end" });
|
|
112
118
|
},
|
|
113
119
|
toggleFeature: (feature, forceValue) => {
|
|
114
|
-
|
|
120
|
+
actorRef.current.send({ type: "toggle.feature", feature, ...forceValue !== void 0 && { forceValue } });
|
|
115
121
|
},
|
|
116
122
|
highlightNotation: (notation, kind) => {
|
|
117
|
-
|
|
123
|
+
actorRef.current.send({ type: "notations.highlight", notation, ...kind && { kind } });
|
|
118
124
|
},
|
|
119
125
|
unhighlightNotation: () => {
|
|
120
|
-
|
|
126
|
+
actorRef.current.send({ type: "notations.unhighlight" });
|
|
121
127
|
},
|
|
122
128
|
openSearch: (searchValue) => {
|
|
123
|
-
|
|
129
|
+
actorRef.current.send({ type: "open.search", ...searchValue && { search: searchValue } });
|
|
124
130
|
},
|
|
125
131
|
triggerChange: (change) => {
|
|
126
|
-
|
|
132
|
+
actorRef.current.send({ type: "trigger.change", change });
|
|
127
133
|
},
|
|
128
134
|
switchDynamicViewVariant: (variant) => {
|
|
129
|
-
|
|
135
|
+
actorRef.current.send({ type: "switch.dynamicViewVariant", variant });
|
|
130
136
|
}
|
|
131
137
|
};
|
|
132
138
|
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { AnyEventObject, CallbackActorLogic, NonReducibleUnknown } from 'xstate';
|
|
2
2
|
export type HotKeyEvent = {
|
|
3
|
-
type: 'key.esc' | `key.arrow.${'left' | 'right'}`;
|
|
3
|
+
type: 'key.esc' | `key.arrow.${'left' | 'right' | 'up' | 'down'}`;
|
|
4
4
|
};
|
|
5
5
|
export interface HotkeyActorLogic extends CallbackActorLogic<AnyEventObject, NonReducibleUnknown, HotKeyEvent> {
|
|
6
6
|
}
|
|
7
7
|
export declare const hotkeyActorLogic: HotkeyActorLogic;
|
|
8
|
-
type UndoEvent = {
|
|
9
|
-
type: 'undo';
|
|
10
|
-
};
|
|
11
|
-
export interface UndoHotKeyActorLogic extends CallbackActorLogic<AnyEventObject, NonReducibleUnknown, UndoEvent> {
|
|
12
|
-
}
|
|
13
|
-
export declare const undoHotKeyActorLogic: UndoHotKeyActorLogic;
|
|
14
|
-
export {};
|
|
@@ -5,7 +5,6 @@ const hotkeyActorLogic = fromCallback(({ sendBack }) => {
|
|
|
5
5
|
const escHandler = getHotkeyHandler([
|
|
6
6
|
["Escape", (event) => {
|
|
7
7
|
event.stopPropagation();
|
|
8
|
-
console.log("Escape karsarsey pressed");
|
|
9
8
|
sendBack({ type: "key.esc" });
|
|
10
9
|
}, {
|
|
11
10
|
preventDefault: true
|
|
@@ -18,11 +17,23 @@ const hotkeyActorLogic = fromCallback(({ sendBack }) => {
|
|
|
18
17
|
}, {
|
|
19
18
|
preventDefault: true
|
|
20
19
|
}],
|
|
20
|
+
["ArrowUp", (event) => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
sendBack({ type: "key.arrow.up" });
|
|
23
|
+
}, {
|
|
24
|
+
preventDefault: true
|
|
25
|
+
}],
|
|
21
26
|
["ArrowRight", (event) => {
|
|
22
27
|
event.stopPropagation();
|
|
23
28
|
sendBack({ type: "key.arrow.right" });
|
|
24
29
|
}, {
|
|
25
30
|
preventDefault: true
|
|
31
|
+
}],
|
|
32
|
+
["ArrowDown", (event) => {
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
sendBack({ type: "key.arrow.down" });
|
|
35
|
+
}, {
|
|
36
|
+
preventDefault: true
|
|
26
37
|
}]
|
|
27
38
|
]);
|
|
28
39
|
document.body.addEventListener("keydown", escHandler);
|
|
@@ -32,20 +43,5 @@ const hotkeyActorLogic = fromCallback(({ sendBack }) => {
|
|
|
32
43
|
document.body.removeEventListener("keydown", arrowshandler, { capture: true });
|
|
33
44
|
};
|
|
34
45
|
});
|
|
35
|
-
const undoHotKeyActorLogic = fromCallback(({ sendBack }) => {
|
|
36
|
-
const ctrlZHandler = getHotkeyHandler([
|
|
37
|
-
["mod + z", (event) => {
|
|
38
|
-
console.log("Undo hotkey pressed");
|
|
39
|
-
event.stopPropagation();
|
|
40
|
-
sendBack({ type: "undo" });
|
|
41
|
-
}, {
|
|
42
|
-
preventDefault: true
|
|
43
|
-
}]
|
|
44
|
-
]);
|
|
45
|
-
document.body.addEventListener("keydown", ctrlZHandler, { capture: true });
|
|
46
|
-
return () => {
|
|
47
|
-
document.body.removeEventListener("keydown", ctrlZHandler, { capture: true });
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
46
|
|
|
51
|
-
export { hotkeyActorLogic
|
|
47
|
+
export { hotkeyActorLogic };
|