@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,13 +1,14 @@
|
|
|
1
1
|
import { applyEdgeChanges, applyNodeChanges } from '@xyflow/react';
|
|
2
2
|
import { DefaultFeatures } from '../../context/DiagramFeatures.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { updateEdgeData, updateNodeData } from './assign.js';
|
|
4
|
+
import { emitOnLayoutTypeChange, triggerChange, updateFeatures, updateInputs, assignDynamicViewVariant, stopEditorActor } from './machine.actions.js';
|
|
5
5
|
import { machine } from './machine.setup.js';
|
|
6
6
|
import { isReady, initializing } from './machine.state.initializing.js';
|
|
7
7
|
import { navigating } from './machine.state.navigating.js';
|
|
8
8
|
import { ready } from './machine.state.ready.js';
|
|
9
9
|
import { DiagramToggledFeaturesPersistence } from './persistence.js';
|
|
10
10
|
import { x as xstateActions_cjsExports } from '../../_virtual/xstate-actions.cjs.js';
|
|
11
|
+
import { raiseUpdateView, cancelFitDiagram } from './machine.actions.layout.js';
|
|
11
12
|
|
|
12
13
|
const _diagramMachine = machine.createMachine({
|
|
13
14
|
initial: "initializing",
|
|
@@ -28,8 +29,9 @@ const _diagramMachine = machine.createMachine({
|
|
|
28
29
|
lastOnNavigate: null,
|
|
29
30
|
lastClickedNode: null,
|
|
30
31
|
focusedNode: null,
|
|
32
|
+
autoUnfocusTimer: false,
|
|
31
33
|
activeElementDetails: null,
|
|
32
|
-
|
|
34
|
+
viewportBefore: null,
|
|
33
35
|
viewportOnManualLayout: null,
|
|
34
36
|
viewportOnAutoLayout: null,
|
|
35
37
|
navigationHistory: {
|
|
@@ -45,96 +47,85 @@ const _diagramMachine = machine.createMachine({
|
|
|
45
47
|
initializing,
|
|
46
48
|
isReady,
|
|
47
49
|
ready,
|
|
48
|
-
navigating
|
|
50
|
+
navigating,
|
|
51
|
+
final: {
|
|
52
|
+
type: "final",
|
|
53
|
+
entry: [
|
|
54
|
+
stopEditorActor(),
|
|
55
|
+
cancelFitDiagram(),
|
|
56
|
+
xstateActions_cjsExports.stopChild("hotkey"),
|
|
57
|
+
xstateActions_cjsExports.stopChild("overlays"),
|
|
58
|
+
xstateActions_cjsExports.stopChild("search"),
|
|
59
|
+
xstateActions_cjsExports.stopChild("mediaPrint"),
|
|
60
|
+
xstateActions_cjsExports.assign({
|
|
61
|
+
xyflow: null,
|
|
62
|
+
xystore: null,
|
|
63
|
+
xyedges: [],
|
|
64
|
+
xynodes: [],
|
|
65
|
+
initialized: {
|
|
66
|
+
xydata: false,
|
|
67
|
+
xyflow: false
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
}
|
|
49
72
|
},
|
|
50
73
|
on: {
|
|
51
|
-
"xyflow.paneClick": {
|
|
52
|
-
actions: [
|
|
53
|
-
resetLastClickedNode(),
|
|
54
|
-
emitPaneClick()
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
"xyflow.nodeClick": {
|
|
58
|
-
actions: [
|
|
59
|
-
assignLastClickedNode(),
|
|
60
|
-
emitNodeClick()
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
"xyflow.edgeClick": {
|
|
64
|
-
actions: [
|
|
65
|
-
resetLastClickedNode(),
|
|
66
|
-
emitEdgeClick()
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
"xyflow.applyNodeChanges": {
|
|
70
|
-
actions: xstateActions_cjsExports.assign({
|
|
71
|
-
xynodes: ({ context, event }) => applyNodeChanges(event.changes, context.xynodes)
|
|
72
|
-
})
|
|
73
|
-
},
|
|
74
|
-
"xyflow.applyEdgeChanges": {
|
|
75
|
-
actions: xstateActions_cjsExports.assign({
|
|
76
|
-
xyedges: ({ context, event }) => applyEdgeChanges(event.changes, context.xyedges)
|
|
77
|
-
})
|
|
78
|
-
},
|
|
79
|
-
"xyflow.viewportMoved": {
|
|
80
|
-
actions: xstateActions_cjsExports.assign({
|
|
81
|
-
viewportChangedManually: (({ event }) => event.manually),
|
|
82
|
-
viewport: (({ event }) => event.viewport)
|
|
83
|
-
})
|
|
84
|
-
},
|
|
85
|
-
"fitDiagram": {
|
|
86
|
-
guard: "enabled: FitView",
|
|
87
|
-
actions: xyflow.fitDiagram()
|
|
88
|
-
},
|
|
89
74
|
"update.nodeData": {
|
|
90
75
|
actions: xstateActions_cjsExports.assign(updateNodeData)
|
|
91
76
|
},
|
|
92
77
|
"update.edgeData": {
|
|
93
78
|
actions: xstateActions_cjsExports.assign(updateEdgeData)
|
|
94
79
|
},
|
|
95
|
-
"
|
|
80
|
+
"switch.dynamicViewVariant": {
|
|
81
|
+
guard: ({ context, event }) => context.dynamicViewVariant !== event.variant,
|
|
96
82
|
actions: [
|
|
97
|
-
|
|
98
|
-
|
|
83
|
+
assignDynamicViewVariant(),
|
|
84
|
+
raiseUpdateView()
|
|
99
85
|
]
|
|
100
86
|
},
|
|
101
87
|
"update.inputs": {
|
|
102
88
|
actions: updateInputs()
|
|
103
89
|
},
|
|
104
|
-
"update.
|
|
105
|
-
actions:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
"update.view-bounds": {
|
|
91
|
+
actions: xstateActions_cjsExports.assign(({ context, event }) => {
|
|
92
|
+
return {
|
|
93
|
+
view: {
|
|
94
|
+
...context.view,
|
|
95
|
+
bounds: event.bounds
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
})
|
|
110
99
|
},
|
|
111
|
-
"
|
|
112
|
-
actions:
|
|
100
|
+
"update.features": {
|
|
101
|
+
actions: updateFeatures()
|
|
113
102
|
},
|
|
114
|
-
"
|
|
115
|
-
actions:
|
|
103
|
+
"trigger.change": {
|
|
104
|
+
actions: triggerChange()
|
|
116
105
|
},
|
|
117
106
|
"emit.onLayoutTypeChange": {
|
|
118
107
|
actions: emitOnLayoutTypeChange()
|
|
108
|
+
},
|
|
109
|
+
"xyflow.applyNodeChanges": {
|
|
110
|
+
actions: xstateActions_cjsExports.assign({
|
|
111
|
+
xynodes: ({ context, event }) => applyNodeChanges(event.changes, context.xynodes)
|
|
112
|
+
})
|
|
113
|
+
},
|
|
114
|
+
"xyflow.applyEdgeChanges": {
|
|
115
|
+
actions: xstateActions_cjsExports.assign({
|
|
116
|
+
xyedges: ({ context, event }) => applyEdgeChanges(event.changes, context.xyedges)
|
|
117
|
+
})
|
|
118
|
+
},
|
|
119
|
+
"xyflow.viewportMoved": {
|
|
120
|
+
actions: xstateActions_cjsExports.assign(({ event, context }) => ({
|
|
121
|
+
viewportChangedManually: context.viewportChangedManually || event.manually,
|
|
122
|
+
viewport: event.viewport
|
|
123
|
+
}))
|
|
124
|
+
},
|
|
125
|
+
"destroy": {
|
|
126
|
+
target: ".final"
|
|
119
127
|
}
|
|
120
|
-
}
|
|
121
|
-
exit: [
|
|
122
|
-
stopSyncLayout(),
|
|
123
|
-
cancelFitDiagram(),
|
|
124
|
-
xstateActions_cjsExports.stopChild("hotkey"),
|
|
125
|
-
xstateActions_cjsExports.stopChild("overlays"),
|
|
126
|
-
xstateActions_cjsExports.stopChild("search"),
|
|
127
|
-
xstateActions_cjsExports.assign({
|
|
128
|
-
xyflow: null,
|
|
129
|
-
xystore: null,
|
|
130
|
-
xyedges: [],
|
|
131
|
-
xynodes: [],
|
|
132
|
-
initialized: {
|
|
133
|
-
xydata: false,
|
|
134
|
-
xyflow: false
|
|
135
|
-
}
|
|
136
|
-
})
|
|
137
|
-
]
|
|
128
|
+
}
|
|
138
129
|
});
|
|
139
130
|
const diagramMachine = _diagramMachine;
|
|
140
131
|
|
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
import { BBox } from '@likec4/core';
|
|
2
|
-
import { DiagramEdge, DiagramNode, DiagramView, DynamicViewDisplayVariant, EdgeId, Fqn, LayoutType, NodeId, NodeNotation as ElementNotation, StepEdgeId, ViewChange, ViewId } from '@likec4/core/types';
|
|
2
|
+
import { DiagramEdge, DiagramNode, DiagramView, DynamicViewDisplayVariant, EdgeId, Fqn, LayoutType, NodeId, NodeNotation as ElementNotation, StepEdgeId, ViewChange, ViewId, WhereOperator } from '@likec4/core/types';
|
|
3
3
|
import { EdgeChange, NodeChange, Rect, Viewport } from '@xyflow/system';
|
|
4
4
|
import { MouseEvent } from 'react';
|
|
5
5
|
import { PartialDeep } from 'type-fest';
|
|
6
|
-
import { EnabledFeatures,
|
|
6
|
+
import { EnabledFeatures, TogglableFeature } from '../../context/DiagramFeatures';
|
|
7
7
|
import { XYFlowInstance, XYStoreApi } from '../../hooks/useXYFlow';
|
|
8
|
-
import { OpenSourceParams,
|
|
8
|
+
import { OpenSourceParams, ViewPaddings } from '../../LikeC4Diagram.props';
|
|
9
9
|
import { Types } from '../types';
|
|
10
10
|
import { AlignmentMode } from './aligners';
|
|
11
11
|
import { HotKeyEvent, HotkeyActorLogic } from './hotkeyActor';
|
|
12
|
+
import { MediaPrintEvent, MediaPrintActorLogic } from './mediaPrintActor';
|
|
12
13
|
import { SetupReturn, NonReducibleUnknown, MetaObject } from 'xstate';
|
|
13
|
-
import { SyncLayoutActorLogic } from './syncManualLayoutActor';
|
|
14
14
|
import { OverlaysActorLogic } from '../../overlays/overlaysActor';
|
|
15
15
|
import { SearchActorLogic } from '../../search/searchActor';
|
|
16
|
+
import { EditorActorLogic } from '../../editor';
|
|
17
|
+
/**
|
|
18
|
+
* Navigation history entry represents a current view state,
|
|
19
|
+
* including viewport, focused node, dynamic view variant, etc.
|
|
20
|
+
*/
|
|
21
|
+
export interface NavigationHistoryEntry {
|
|
22
|
+
viewId: ViewId;
|
|
23
|
+
viewport: Viewport;
|
|
24
|
+
viewportChangedManually: boolean;
|
|
25
|
+
viewportBefore?: null | {
|
|
26
|
+
wasChangedManually: boolean;
|
|
27
|
+
value: Viewport;
|
|
28
|
+
};
|
|
29
|
+
focusedNode?: NodeId | null;
|
|
30
|
+
dynamicViewVariant?: DynamicViewDisplayVariant | null;
|
|
31
|
+
activeWalkthrough?: null | StepEdgeId;
|
|
32
|
+
}
|
|
16
33
|
export interface NavigationHistory {
|
|
17
|
-
history: ReadonlyArray<
|
|
18
|
-
viewId: ViewId;
|
|
19
|
-
fromNode: NodeId | null;
|
|
20
|
-
viewport: Viewport;
|
|
21
|
-
}>;
|
|
34
|
+
history: ReadonlyArray<NavigationHistoryEntry>;
|
|
22
35
|
currentIndex: number;
|
|
23
36
|
}
|
|
24
37
|
export interface Input {
|
|
@@ -28,10 +41,13 @@ export interface Input {
|
|
|
28
41
|
pannable: boolean;
|
|
29
42
|
nodesDraggable: boolean;
|
|
30
43
|
nodesSelectable: boolean;
|
|
31
|
-
fitViewPadding:
|
|
44
|
+
fitViewPadding: ViewPaddings;
|
|
45
|
+
where: WhereOperator | null;
|
|
32
46
|
dynamicViewVariant?: DynamicViewDisplayVariant | undefined;
|
|
33
47
|
}
|
|
34
|
-
export type ToggledFeatures =
|
|
48
|
+
export type ToggledFeatures = {
|
|
49
|
+
[P in `enable${TogglableFeature}`]?: boolean;
|
|
50
|
+
};
|
|
35
51
|
export interface Context extends Input {
|
|
36
52
|
xynodes: Types.Node[];
|
|
37
53
|
xyedges: Types.Edge[];
|
|
@@ -43,10 +59,20 @@ export interface Context extends Input {
|
|
|
43
59
|
};
|
|
44
60
|
viewport: Viewport;
|
|
45
61
|
viewportChangedManually: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Viewport before entering focus mode, walkthrough or printing
|
|
64
|
+
*/
|
|
65
|
+
viewportBefore: null | {
|
|
66
|
+
wasChangedManually: boolean;
|
|
67
|
+
value: Viewport;
|
|
68
|
+
};
|
|
69
|
+
viewportOnManualLayout: null | Viewport;
|
|
70
|
+
viewportOnAutoLayout: null | Viewport;
|
|
46
71
|
lastOnNavigate: null | {
|
|
47
72
|
fromView: ViewId;
|
|
48
73
|
toView: ViewId;
|
|
49
74
|
fromNode: NodeId | null;
|
|
75
|
+
focusOnElement?: Fqn | null;
|
|
50
76
|
};
|
|
51
77
|
navigationHistory: NavigationHistory;
|
|
52
78
|
lastClickedNode: null | {
|
|
@@ -55,15 +81,13 @@ export interface Context extends Input {
|
|
|
55
81
|
timestamp: number;
|
|
56
82
|
};
|
|
57
83
|
focusedNode: NodeId | null;
|
|
84
|
+
autoUnfocusTimer: boolean;
|
|
58
85
|
activeElementDetails: null | {
|
|
59
86
|
fqn: Fqn;
|
|
60
87
|
fromNode: NodeId | null;
|
|
61
88
|
nodeRect?: Rect | null;
|
|
62
89
|
nodeRectScreen?: Rect | null;
|
|
63
90
|
};
|
|
64
|
-
viewportBeforeFocus: null | Viewport;
|
|
65
|
-
viewportOnManualLayout: null | Viewport;
|
|
66
|
-
viewportOnAutoLayout: null | Viewport;
|
|
67
91
|
xyflow: XYFlowInstance | null;
|
|
68
92
|
dynamicViewVariant: DynamicViewDisplayVariant;
|
|
69
93
|
activeWalkthrough: null | {
|
|
@@ -71,7 +95,7 @@ export interface Context extends Input {
|
|
|
71
95
|
parallelPrefix: string | null;
|
|
72
96
|
};
|
|
73
97
|
}
|
|
74
|
-
export type Events = HotKeyEvent | {
|
|
98
|
+
export type Events = HotKeyEvent | MediaPrintEvent | {
|
|
75
99
|
type: 'xyflow.init';
|
|
76
100
|
instance: XYFlowInstance;
|
|
77
101
|
} | {
|
|
@@ -113,6 +137,14 @@ export type Events = HotKeyEvent | {
|
|
|
113
137
|
type: 'xyflow.edgeMouseLeave';
|
|
114
138
|
edge: Types.Edge;
|
|
115
139
|
event: MouseEvent;
|
|
140
|
+
} | {
|
|
141
|
+
type: 'xyflow.fitDiagram';
|
|
142
|
+
duration?: number;
|
|
143
|
+
bounds?: BBox;
|
|
144
|
+
} | {
|
|
145
|
+
type: 'xyflow.setViewport';
|
|
146
|
+
duration?: number;
|
|
147
|
+
viewport: Viewport;
|
|
116
148
|
} | {
|
|
117
149
|
type: 'update.nodeData';
|
|
118
150
|
nodeId: NodeId;
|
|
@@ -124,18 +156,22 @@ export type Events = HotKeyEvent | {
|
|
|
124
156
|
} | {
|
|
125
157
|
type: 'update.view';
|
|
126
158
|
view: DiagramView;
|
|
159
|
+
source?: 'editor' | 'external';
|
|
160
|
+
} | {
|
|
161
|
+
type: 'update.view';
|
|
162
|
+
view: DiagramView;
|
|
163
|
+
source?: 'editor' | 'external';
|
|
127
164
|
xynodes: Types.Node[];
|
|
128
165
|
xyedges: Types.Edge[];
|
|
166
|
+
} | {
|
|
167
|
+
type: 'update.view-bounds';
|
|
168
|
+
bounds: BBox;
|
|
129
169
|
} | {
|
|
130
170
|
type: 'update.inputs';
|
|
131
171
|
inputs: Partial<Omit<Input, 'view' | 'xystore' | 'dynamicViewVariant'>>;
|
|
132
172
|
} | {
|
|
133
173
|
type: 'update.features';
|
|
134
174
|
features: EnabledFeatures;
|
|
135
|
-
} | {
|
|
136
|
-
type: 'fitDiagram';
|
|
137
|
-
duration?: number;
|
|
138
|
-
bounds?: BBox;
|
|
139
175
|
} | ({
|
|
140
176
|
type: 'open.source';
|
|
141
177
|
} & OpenSourceParams) | {
|
|
@@ -160,6 +196,7 @@ export type Events = HotKeyEvent | {
|
|
|
160
196
|
type: 'navigate.to';
|
|
161
197
|
viewId: ViewId;
|
|
162
198
|
fromNode?: NodeId | undefined;
|
|
199
|
+
focusOnElement?: Fqn | undefined;
|
|
163
200
|
} | {
|
|
164
201
|
type: 'navigate.back';
|
|
165
202
|
} | {
|
|
@@ -174,6 +211,9 @@ export type Events = HotKeyEvent | {
|
|
|
174
211
|
} | {
|
|
175
212
|
type: 'focus.node';
|
|
176
213
|
nodeId: NodeId;
|
|
214
|
+
autoUnfocus?: boolean;
|
|
215
|
+
} | {
|
|
216
|
+
type: 'focus.autoUnfocus';
|
|
177
217
|
} | {
|
|
178
218
|
type: 'switch.dynamicViewVariant';
|
|
179
219
|
variant: DynamicViewDisplayVariant;
|
|
@@ -198,14 +238,16 @@ export type Events = HotKeyEvent | {
|
|
|
198
238
|
type: 'tag.unhighlight';
|
|
199
239
|
} | {
|
|
200
240
|
type: 'toggle.feature';
|
|
201
|
-
feature:
|
|
241
|
+
feature: TogglableFeature;
|
|
202
242
|
forceValue?: boolean;
|
|
203
243
|
} | {
|
|
204
|
-
type: '
|
|
244
|
+
type: 'trigger.change';
|
|
205
245
|
change: ViewChange;
|
|
206
246
|
} | {
|
|
207
247
|
type: 'emit.onLayoutTypeChange';
|
|
208
248
|
layoutType: LayoutType;
|
|
249
|
+
} | {
|
|
250
|
+
type: 'destroy';
|
|
209
251
|
};
|
|
210
252
|
export type EmittedEvents = {
|
|
211
253
|
type: 'initialized';
|
|
@@ -242,9 +284,6 @@ export type EmittedEvents = {
|
|
|
242
284
|
edge: Types.Edge;
|
|
243
285
|
} | {
|
|
244
286
|
type: 'walkthroughStopped';
|
|
245
|
-
} | {
|
|
246
|
-
type: 'onChange';
|
|
247
|
-
change: ViewChange;
|
|
248
287
|
} | {
|
|
249
288
|
type: 'onLayoutTypeChange';
|
|
250
289
|
layoutType: LayoutType;
|
|
@@ -253,27 +292,35 @@ export type ActionArg = {
|
|
|
253
292
|
context: Context;
|
|
254
293
|
event: Events;
|
|
255
294
|
};
|
|
295
|
+
export declare const deriveToggledFeatures: (context: Context) => Required<ToggledFeatures>;
|
|
256
296
|
export declare const machine: SetupReturn<Context, Events, {
|
|
257
|
-
syncManualLayoutActorLogic: SyncLayoutActorLogic;
|
|
258
297
|
hotkeyActorLogic: HotkeyActorLogic;
|
|
259
298
|
overlaysActorLogic: OverlaysActorLogic;
|
|
260
299
|
searchActorLogic: SearchActorLogic;
|
|
300
|
+
mediaPrintActorLogic: MediaPrintActorLogic;
|
|
301
|
+
editorActor: EditorActorLogic;
|
|
261
302
|
}, {
|
|
262
|
-
syncLayout: "syncManualLayoutActorLogic";
|
|
263
303
|
hotkey: "hotkeyActorLogic";
|
|
264
304
|
overlays: "overlaysActorLogic";
|
|
265
305
|
search: "searchActorLogic";
|
|
306
|
+
mediaPrint: "mediaPrintActorLogic";
|
|
307
|
+
editor: "editorActor";
|
|
266
308
|
}, {}, {
|
|
267
309
|
isReady: unknown;
|
|
310
|
+
'enabled: Editor': unknown;
|
|
268
311
|
'enabled: FitView': unknown;
|
|
269
312
|
'enabled: FocusMode': unknown;
|
|
270
313
|
'enabled: Readonly': unknown;
|
|
271
314
|
'enabled: RelationshipDetails': unknown;
|
|
272
315
|
'enabled: Search': unknown;
|
|
273
316
|
'enabled: ElementDetails': unknown;
|
|
317
|
+
'enabled: OpenSource': unknown;
|
|
274
318
|
'enabled: DynamicViewWalkthrough': unknown;
|
|
319
|
+
'focus.node: autoUnfocus': unknown;
|
|
320
|
+
'enabled: Overlays': unknown;
|
|
275
321
|
'not readonly': unknown;
|
|
276
322
|
'is dynamic view': unknown;
|
|
323
|
+
'is same view': unknown;
|
|
277
324
|
'is another view': unknown;
|
|
278
325
|
'click: node has modelFqn': unknown;
|
|
279
326
|
'click: selected node': unknown;
|
|
@@ -282,3 +329,10 @@ export declare const machine: SetupReturn<Context, Events, {
|
|
|
282
329
|
'click: node has connections': unknown;
|
|
283
330
|
'click: selected edge': unknown;
|
|
284
331
|
}, never, string, Input, NonReducibleUnknown, EmittedEvents, MetaObject>;
|
|
332
|
+
export declare const targetState: {
|
|
333
|
+
idle: string;
|
|
334
|
+
focused: string;
|
|
335
|
+
walkthrough: string;
|
|
336
|
+
printing: string;
|
|
337
|
+
navigating: string;
|
|
338
|
+
};
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { nonexhaustive } from '@likec4/core';
|
|
2
|
+
import { isTruthy } from 'remeda';
|
|
2
3
|
import { setup, assertEvent } from 'xstate';
|
|
4
|
+
import { editorActorLogic } from '../../editor/editorActor.js';
|
|
3
5
|
import { overlaysActorLogic } from '../../overlays/overlaysActor.js';
|
|
4
6
|
import { searchActorLogic } from '../../search/searchActor.js';
|
|
5
7
|
import { hotkeyActorLogic } from './hotkeyActor.js';
|
|
6
|
-
import {
|
|
8
|
+
import { mediaPrintActorLogic } from './mediaPrintActor.js';
|
|
7
9
|
|
|
8
|
-
const
|
|
10
|
+
const deriveToggledFeatures = (context) => {
|
|
11
|
+
let toggledFeatures = context.toggledFeatures;
|
|
12
|
+
const hasActiveWalkthrough = isTruthy(context.activeWalkthrough);
|
|
13
|
+
const enableCompareWithLatest = context.features.enableCompareWithLatest && (toggledFeatures.enableCompareWithLatest ?? false) && isTruthy(context.view._layout) && !hasActiveWalkthrough;
|
|
14
|
+
const enableReadOnly = context.features.enableReadOnly || (toggledFeatures.enableReadOnly ?? false) || hasActiveWalkthrough || context.dynamicViewVariant === "sequence" && context.view._type === "dynamic" || enableCompareWithLatest && context.view._layout === "auto";
|
|
15
|
+
return {
|
|
16
|
+
enableCompareWithLatest,
|
|
17
|
+
enableReadOnly
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const isReadOnly = (context) => deriveToggledFeatures(context).enableReadOnly;
|
|
9
21
|
const machine = setup({
|
|
10
22
|
types: {
|
|
11
23
|
context: {},
|
|
@@ -15,22 +27,40 @@ const machine = setup({
|
|
|
15
27
|
emitted: {}
|
|
16
28
|
},
|
|
17
29
|
actors: {
|
|
18
|
-
syncManualLayoutActorLogic,
|
|
19
30
|
hotkeyActorLogic,
|
|
20
31
|
overlaysActorLogic,
|
|
21
|
-
searchActorLogic
|
|
32
|
+
searchActorLogic,
|
|
33
|
+
mediaPrintActorLogic,
|
|
34
|
+
editorActor: editorActorLogic
|
|
22
35
|
},
|
|
23
36
|
guards: {
|
|
24
37
|
"isReady": ({ context }) => context.initialized.xydata && context.initialized.xyflow,
|
|
38
|
+
"enabled: Editor": ({ context }) => context.features.enableEditor,
|
|
25
39
|
"enabled: FitView": ({ context }) => context.features.enableFitView,
|
|
26
|
-
"enabled: FocusMode": ({ context }) =>
|
|
40
|
+
"enabled: FocusMode": ({ context }) => context.features.enableFocusMode && isReadOnly(context),
|
|
27
41
|
"enabled: Readonly": ({ context }) => isReadOnly(context),
|
|
28
42
|
"enabled: RelationshipDetails": ({ context }) => context.features.enableRelationshipDetails,
|
|
29
43
|
"enabled: Search": ({ context }) => context.features.enableSearch,
|
|
30
44
|
"enabled: ElementDetails": ({ context }) => context.features.enableElementDetails,
|
|
31
|
-
"enabled:
|
|
45
|
+
"enabled: OpenSource": ({ context }) => context.features.enableVscode,
|
|
46
|
+
"enabled: DynamicViewWalkthrough": ({ context }) => context.features.enableDynamicViewWalkthrough,
|
|
47
|
+
"focus.node: autoUnfocus": ({ event }) => {
|
|
48
|
+
assertEvent(event, "focus.node");
|
|
49
|
+
return event.autoUnfocus === true;
|
|
50
|
+
},
|
|
51
|
+
"enabled: Overlays": ({ context }) => context.features.enableElementDetails || context.features.enableRelationshipBrowser || context.features.enableRelationshipDetails,
|
|
32
52
|
"not readonly": ({ context }) => !isReadOnly(context),
|
|
33
53
|
"is dynamic view": ({ context }) => context.view._type === "dynamic",
|
|
54
|
+
"is same view": ({ context, event }) => {
|
|
55
|
+
assertEvent(event, ["update.view", "navigate.to"]);
|
|
56
|
+
if (event.type === "update.view") {
|
|
57
|
+
return context.view.id === event.view.id;
|
|
58
|
+
}
|
|
59
|
+
if (event.type === "navigate.to") {
|
|
60
|
+
return context.view.id === event.viewId;
|
|
61
|
+
}
|
|
62
|
+
nonexhaustive(event.type);
|
|
63
|
+
},
|
|
34
64
|
"is another view": ({ context, event }) => {
|
|
35
65
|
assertEvent(event, ["update.view", "navigate.to"]);
|
|
36
66
|
if (event.type === "update.view") {
|
|
@@ -67,5 +97,12 @@ const machine = setup({
|
|
|
67
97
|
}
|
|
68
98
|
}
|
|
69
99
|
});
|
|
100
|
+
const targetState = {
|
|
101
|
+
idle: "#idle",
|
|
102
|
+
focused: "#focused",
|
|
103
|
+
walkthrough: "#walkthrough",
|
|
104
|
+
printing: "#printing",
|
|
105
|
+
navigating: "#navigating"
|
|
106
|
+
};
|
|
70
107
|
|
|
71
|
-
export { machine };
|
|
108
|
+
export { deriveToggledFeatures, machine, targetState };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ActionFunction, Values } from 'xstate';
|
|
2
2
|
import { Context, Events, EmittedEvents } from './machine.setup';
|
|
3
3
|
import { XYFlowInstance } from '../../hooks';
|
|
4
|
-
import { SyncLayoutActorLogic } from './syncManualLayoutActor';
|
|
5
4
|
import { HotkeyActorLogic } from './hotkeyActor';
|
|
6
5
|
import { OverlaysActorLogic } from '../../overlays/overlaysActor';
|
|
7
6
|
import { SearchActorLogic } from '../../search/searchActor';
|
|
7
|
+
import { MediaPrintActorLogic } from './mediaPrintActor';
|
|
8
|
+
import { EditorActorLogic } from '../../editor';
|
|
8
9
|
import { DiagramView } from '@likec4/core';
|
|
9
10
|
/**
|
|
10
11
|
* To be in `initializing` state, the diagram must wait for two events:
|
|
@@ -20,11 +21,6 @@ export declare const initializing: {
|
|
|
20
21
|
type: "xyflow.init";
|
|
21
22
|
instance: XYFlowInstance;
|
|
22
23
|
}, Events, undefined, Values<{
|
|
23
|
-
syncManualLayoutActorLogic: {
|
|
24
|
-
src: "syncManualLayoutActorLogic";
|
|
25
|
-
logic: SyncLayoutActorLogic;
|
|
26
|
-
id: "syncLayout";
|
|
27
|
-
};
|
|
28
24
|
hotkeyActorLogic: {
|
|
29
25
|
src: "hotkeyActorLogic";
|
|
30
26
|
logic: HotkeyActorLogic;
|
|
@@ -40,6 +36,16 @@ export declare const initializing: {
|
|
|
40
36
|
logic: SearchActorLogic;
|
|
41
37
|
id: "search";
|
|
42
38
|
};
|
|
39
|
+
mediaPrintActorLogic: {
|
|
40
|
+
src: "mediaPrintActorLogic";
|
|
41
|
+
logic: MediaPrintActorLogic;
|
|
42
|
+
id: "mediaPrint";
|
|
43
|
+
};
|
|
44
|
+
editorActor: {
|
|
45
|
+
src: "editorActor";
|
|
46
|
+
logic: EditorActorLogic;
|
|
47
|
+
id: "editor";
|
|
48
|
+
};
|
|
43
49
|
}>, never, never, never, never>;
|
|
44
50
|
target: string;
|
|
45
51
|
};
|
|
@@ -47,14 +53,14 @@ export declare const initializing: {
|
|
|
47
53
|
actions: ActionFunction<Context, {
|
|
48
54
|
type: "update.view";
|
|
49
55
|
view: DiagramView;
|
|
56
|
+
source?: "editor" | "external";
|
|
57
|
+
} | {
|
|
58
|
+
type: "update.view";
|
|
59
|
+
view: DiagramView;
|
|
60
|
+
source?: "editor" | "external";
|
|
50
61
|
xynodes: import("../types").Types.Node[];
|
|
51
62
|
xyedges: import("../types").Types.Edge[];
|
|
52
63
|
}, Events, undefined, Values<{
|
|
53
|
-
syncManualLayoutActorLogic: {
|
|
54
|
-
src: "syncManualLayoutActorLogic";
|
|
55
|
-
logic: SyncLayoutActorLogic;
|
|
56
|
-
id: "syncLayout";
|
|
57
|
-
};
|
|
58
64
|
hotkeyActorLogic: {
|
|
59
65
|
src: "hotkeyActorLogic";
|
|
60
66
|
logic: HotkeyActorLogic;
|
|
@@ -70,7 +76,17 @@ export declare const initializing: {
|
|
|
70
76
|
logic: SearchActorLogic;
|
|
71
77
|
id: "search";
|
|
72
78
|
};
|
|
73
|
-
|
|
79
|
+
mediaPrintActorLogic: {
|
|
80
|
+
src: "mediaPrintActorLogic";
|
|
81
|
+
logic: MediaPrintActorLogic;
|
|
82
|
+
id: "mediaPrint";
|
|
83
|
+
};
|
|
84
|
+
editorActor: {
|
|
85
|
+
src: "editorActor";
|
|
86
|
+
logic: EditorActorLogic;
|
|
87
|
+
id: "editor";
|
|
88
|
+
};
|
|
89
|
+
}>, never, never, never, never>[];
|
|
74
90
|
target: string;
|
|
75
91
|
};
|
|
76
92
|
};
|
|
@@ -84,11 +100,6 @@ export declare const isReady: {
|
|
|
84
100
|
always: ({
|
|
85
101
|
guard: "isReady";
|
|
86
102
|
actions: ActionFunction<Context, Events, Events, undefined, Values<{
|
|
87
|
-
syncManualLayoutActorLogic: {
|
|
88
|
-
src: "syncManualLayoutActorLogic";
|
|
89
|
-
logic: SyncLayoutActorLogic;
|
|
90
|
-
id: "syncLayout";
|
|
91
|
-
};
|
|
92
103
|
hotkeyActorLogic: {
|
|
93
104
|
src: "hotkeyActorLogic";
|
|
94
105
|
logic: HotkeyActorLogic;
|
|
@@ -104,11 +115,25 @@ export declare const isReady: {
|
|
|
104
115
|
logic: SearchActorLogic;
|
|
105
116
|
id: "search";
|
|
106
117
|
};
|
|
118
|
+
mediaPrintActorLogic: {
|
|
119
|
+
src: "mediaPrintActorLogic";
|
|
120
|
+
logic: MediaPrintActorLogic;
|
|
121
|
+
id: "mediaPrint";
|
|
122
|
+
};
|
|
123
|
+
editorActor: {
|
|
124
|
+
src: "editorActor";
|
|
125
|
+
logic: EditorActorLogic;
|
|
126
|
+
id: "editor";
|
|
127
|
+
};
|
|
107
128
|
}>, never, Values<{
|
|
108
129
|
isReady: {
|
|
109
130
|
type: "isReady";
|
|
110
131
|
params: unknown;
|
|
111
132
|
};
|
|
133
|
+
"enabled: Editor": {
|
|
134
|
+
type: "enabled: Editor";
|
|
135
|
+
params: unknown;
|
|
136
|
+
};
|
|
112
137
|
"enabled: FitView": {
|
|
113
138
|
type: "enabled: FitView";
|
|
114
139
|
params: unknown;
|
|
@@ -133,10 +158,22 @@ export declare const isReady: {
|
|
|
133
158
|
type: "enabled: ElementDetails";
|
|
134
159
|
params: unknown;
|
|
135
160
|
};
|
|
161
|
+
"enabled: OpenSource": {
|
|
162
|
+
type: "enabled: OpenSource";
|
|
163
|
+
params: unknown;
|
|
164
|
+
};
|
|
136
165
|
"enabled: DynamicViewWalkthrough": {
|
|
137
166
|
type: "enabled: DynamicViewWalkthrough";
|
|
138
167
|
params: unknown;
|
|
139
168
|
};
|
|
169
|
+
"focus.node: autoUnfocus": {
|
|
170
|
+
type: "focus.node: autoUnfocus";
|
|
171
|
+
params: unknown;
|
|
172
|
+
};
|
|
173
|
+
"enabled: Overlays": {
|
|
174
|
+
type: "enabled: Overlays";
|
|
175
|
+
params: unknown;
|
|
176
|
+
};
|
|
140
177
|
"not readonly": {
|
|
141
178
|
type: "not readonly";
|
|
142
179
|
params: unknown;
|
|
@@ -145,6 +182,10 @@ export declare const isReady: {
|
|
|
145
182
|
type: "is dynamic view";
|
|
146
183
|
params: unknown;
|
|
147
184
|
};
|
|
185
|
+
"is same view": {
|
|
186
|
+
type: "is same view";
|
|
187
|
+
params: unknown;
|
|
188
|
+
};
|
|
148
189
|
"is another view": {
|
|
149
190
|
type: "is another view";
|
|
150
191
|
params: unknown;
|