@likec4/diagram 1.43.0 → 1.45.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 +14727 -13166
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +14 -9
- package/dist/LikeC4Diagram.props.d.ts +25 -15
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4Styles.js +0 -3
- package/dist/LikeC4View.d.ts +8 -3
- package/dist/LikeC4View.js +29 -14
- package/dist/ReactLikeC4.d.ts +2 -2
- package/dist/ReactLikeC4.js +2 -2
- package/dist/StaticLikeC4Diagram.js +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -0
- package/dist/_virtual/assign-dea9f7c8.cjs.js +3 -0
- package/dist/_virtual/log-ec8d4df4.cjs.js +3 -0
- package/dist/_virtual/raise-da5b247f.cjs.js +3 -0
- package/dist/_virtual/xstate-actions.cjs.js +5 -0
- package/dist/_virtual/xstate-actions.cjs2.js +3 -0
- package/dist/_virtual/xstate-dev.cjs.js +3 -0
- package/dist/_virtual/xstate-guards.cjs.js +5 -0
- package/dist/_virtual/xstate-guards.cjs2.js +3 -0
- package/dist/base/Background.d.ts +2 -1
- package/dist/base/Background.js +11 -2
- package/dist/base/Base.d.ts +28 -0
- package/dist/base/BaseXYFlow.d.ts +5 -5
- package/dist/base/BaseXYFlow.js +38 -44
- package/dist/base/index.d.ts +6 -2
- package/dist/base/types.d.ts +1 -28
- package/dist/base/updateEdges.js +25 -14
- package/dist/base/updateNodes.d.ts +14 -0
- package/dist/base/updateNodes.js +51 -17
- package/dist/base-primitives/Markdown.d.ts +30 -4
- package/dist/base-primitives/Markdown.js +3 -2
- 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 +8 -1
- package/dist/base-primitives/edge/EdgeLabel.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeLabel.js +2 -0
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +4 -0
- package/dist/base-primitives/edge/EdgePath.d.ts +4 -0
- package/dist/base-primitives/edge/EdgePath.js +29 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +6 -4
- 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 +5 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- package/dist/base-primitives/element/ElementShape.js +5 -5
- package/dist/base-primitives/element/ElementTags.d.ts +6 -4
- package/dist/base-primitives/element/ElementTags.js +2 -1
- package/dist/base-primitives/memoEdge.js +4 -2
- package/dist/base-primitives/memoNode.d.ts +1 -1
- package/dist/base-primitives/memoNode.js +3 -3
- package/dist/components/ErrorFallback.js +52 -35
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +2 -1
- package/dist/context/DiagramFeatures.d.ts +25 -6
- package/dist/context/DiagramFeatures.js +28 -56
- package/dist/context/IconRenderer.js +6 -6
- package/dist/context/LikeC4ModelContext.js +3 -10
- package/dist/context/TagStylesContext.js +3 -19
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +3 -3
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +5 -5
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/safeContext.d.ts +6 -3
- package/dist/hooks/safeContext.js +10 -3
- package/dist/hooks/useCallbackRef.d.ts +1 -0
- package/dist/hooks/useCallbackRef.js +13 -0
- package/dist/hooks/useCurrentView.d.ts +11 -0
- package/dist/hooks/{useCurrentViewId.js → useCurrentView.js} +7 -3
- package/dist/hooks/useCurrentViewModel.js +4 -1
- package/dist/hooks/useDiagram.d.ts +7 -113
- package/dist/hooks/useDiagram.js +7 -127
- package/dist/hooks/useDiagramCompareLayout.d.ts +35 -0
- package/dist/hooks/useDiagramCompareLayout.js +65 -0
- 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/hooks/useUpdateEffect.js +2 -4
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +4 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/likec4diagram/DiagramUI.js +14 -7
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +60 -52
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +38 -0
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +256 -217
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +9 -2
- package/dist/likec4diagram/custom/edges/edges.css.js +3 -4
- package/dist/likec4diagram/custom/edges/useControlPoints.d.ts +8 -0
- package/dist/likec4diagram/custom/edges/useControlPoints.js +58 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +7 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +60 -0
- package/dist/likec4diagram/custom/edges/utils.d.ts +0 -12
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +4 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.js +15 -10
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +50 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -2
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +74 -29
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +4 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +1 -11
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +7 -51
- package/dist/likec4diagram/custom/nodes/toolbar/types.d.ts +5 -0
- package/dist/likec4diagram/custom/nodes/toolbar/types.js +7 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.d.ts +8 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +44 -0
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -10
- package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +95 -70
- package/dist/likec4diagram/state/assign.d.ts +13 -7
- package/dist/likec4diagram/state/assign.js +43 -282
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +79 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +109 -0
- package/dist/likec4diagram/state/diagram-api.js +126 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +1783 -0
- package/dist/likec4diagram/state/machine.actions.js +644 -0
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +579 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +129 -0
- package/dist/likec4diagram/state/machine.d.ts +22 -0
- package/dist/likec4diagram/state/machine.js +127 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +327 -0
- package/dist/likec4diagram/state/machine.setup.js +93 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +208 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +14 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +178 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3131 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +386 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.js +85 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +474 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.js +96 -0
- package/dist/likec4diagram/state/machine.state.ready.js +262 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +128 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +511 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +177 -0
- package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
- package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +31 -108
- package/dist/likec4diagram/state/syncManualLayoutActor.js +278 -142
- package/dist/likec4diagram/state/types.d.ts +7 -12
- package/dist/likec4diagram/state/utils.d.ts +19 -4
- package/dist/likec4diagram/state/utils.js +47 -4
- package/dist/likec4diagram/types.d.ts +8 -8
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +2 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +66 -0
- package/dist/likec4diagram/ui/index.d.ts +1 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +5 -4
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +237 -61
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +14 -17
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
- package/dist/navigationpanel/NavigationPanel.js +16 -8
- package/dist/navigationpanel/NavigationPanelControls.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +23 -17
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +62 -42
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +4 -2
- package/dist/navigationpanel/actor.d.ts +9 -205
- package/dist/navigationpanel/actor.js +6 -5
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +59 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +2 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.js +42 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +60 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +5 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +38 -0
- package/dist/navigationpanel/comparepanel/index.d.ts +1 -0
- package/dist/navigationpanel/controls/{ViewDetailsCard.d.ts → DetailsControls.d.ts} +1 -1
- package/dist/navigationpanel/controls/{ViewDetailsCard.js → DetailsControls.js} +18 -14
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +2 -0
- package/dist/navigationpanel/controls/LayoutWarning.js +102 -0
- package/dist/navigationpanel/controls/NavigationButtons.js +4 -3
- package/dist/navigationpanel/controls/OpenSource.js +2 -2
- package/dist/navigationpanel/controls/SearchControl.d.ts +2 -1
- package/dist/navigationpanel/controls/SearchControl.js +15 -17
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +26 -18
- package/dist/navigationpanel/controls/index.d.ts +2 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -2
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +5 -5
- package/dist/navigationpanel/editorpanel/CenterCamera.js +5 -2
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +21 -20
- package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -2
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +16 -13
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +15 -0
- package/dist/navigationpanel/styles.css.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +4 -4
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +14 -8
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +68 -50
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js +37 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dev/dist/xstate-dev.cjs.js +59 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js +140 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js +401 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js +2716 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js +26 -0
- package/dist/overlays/element-details/ElementDetails.js +7 -7
- package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
- package/dist/overlays/element-details/ElementDetailsCard.js +7 -5
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
- package/dist/overlays/element-details/MetadataValue.js +2 -2
- package/dist/overlays/element-details/TabPanelDeployments.js +6 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +8 -82
- package/dist/overlays/element-details/actor.js +0 -8
- package/dist/overlays/overlay/Overlay.js +10 -10
- package/dist/overlays/overlaysActor.d.ts +7 -150
- package/dist/overlays/overlaysActor.js +183 -161
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -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 -550
- package/dist/overlays/relationship-details/actor.js +18 -3
- package/dist/overlays/relationship-details/custom/ElementActions.js +8 -5
- package/dist/overlays/relationship-details/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationship-details/hooks.js +1 -1
- 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 +6 -4
- 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 -673
- package/dist/overlays/relationships-browser/actor.js +132 -110
- package/dist/overlays/relationships-browser/custom/ElementActions.js +44 -37
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationships-browser/hooks.js +7 -6
- 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/Search.js +2 -1
- package/dist/search/components/ElementsColumn.js +5 -3
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +21 -44
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +6 -4
- 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 +8 -6
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +83 -21
- package/dist/utils/vector.js +98 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +58 -0
- package/dist/utils/xyflow.d.ts +52 -8
- package/dist/utils/xyflow.js +31 -11
- package/package.json +26 -24
- package/panda.buildinfo.json +124 -71
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/hooks/useCurrentViewId.d.ts +0 -6
- package/dist/likec4diagram/custom/edges/utils.js +0 -23
- package/dist/likec4diagram/state/diagram-machine.d.ts +0 -2590
- package/dist/likec4diagram/state/diagram-machine.js +0 -1180
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +0 -1
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +0 -56
- package/dist/utils/get-view-bounds.d.ts +0 -3
- package/dist/utils/get-view-bounds.js +0 -14
- /package/dist/base/{types.js → Base.js} +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/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.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { BBox } from '@likec4/core';
|
|
2
|
+
import { resetLastClickedNode, emitEdgeClick, assignLastClickedNode, emitNodeClick, emitPaneClick, undimEverything, tagHighlight, notationsHighlight, startEditing, onEdgeDoubleClick, stopEditing, onEdgeMouseLeave, onEdgeMouseEnter, onNodeMouseLeave, onNodeMouseEnter, updateFeatures, ensureOverlaysActor, ensureSearchActor, ensureSyncLayoutActor, assignToggledFeatures, emitOpenSource, openElementDetails, stopSyncLayout, disableCompareWithLatest, resetEdgesControlPoints, layoutAlign, handleNavigate, closeAllOverlays, closeSearch, updateXYNodesEdges, sendSynced } from './machine.actions.js';
|
|
3
|
+
import { machine, targetState } from './machine.setup.js';
|
|
4
|
+
import { focused } from './machine.state.ready.focused.js';
|
|
5
|
+
import { idle } from './machine.state.ready.idle.js';
|
|
6
|
+
import { printing } from './machine.state.ready.printing.js';
|
|
7
|
+
import { walkthrough } from './machine.state.ready.walkthrough.js';
|
|
8
|
+
import { typedSystem, calcViewportForBounds } from './utils.js';
|
|
9
|
+
import { x as xstateActions_cjsExports } from '../../_virtual/xstate-actions.cjs.js';
|
|
10
|
+
import { x as xstateGuards_cjsExports } from '../../_virtual/xstate-guards.cjs.js';
|
|
11
|
+
import { setViewport, fitDiagram, cancelFitDiagram, raiseFitDiagram } from './machine.actions.layout.js';
|
|
12
|
+
|
|
13
|
+
const updateView = () => machine.enqueueActions(
|
|
14
|
+
({ enqueue, event, context, self }) => {
|
|
15
|
+
if (event.type !== "update.view") {
|
|
16
|
+
console.warn(`Ignoring unexpected event type: ${event.type} in action 'update.view'`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const nextView = event.view;
|
|
20
|
+
const isAnotherView = nextView.id !== context.view.id;
|
|
21
|
+
if (isAnotherView) {
|
|
22
|
+
console.warn("updateView called for another view - ignoring", { event });
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
enqueue(updateXYNodesEdges());
|
|
26
|
+
if (event.source === "internal") {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
enqueue(sendSynced());
|
|
30
|
+
let recenter = !context.viewportChangedManually;
|
|
31
|
+
if (context.toggledFeatures.enableCompareWithLatest === true && context.view._layout !== nextView._layout) {
|
|
32
|
+
if (nextView._layout === "auto" && context.viewportOnAutoLayout) {
|
|
33
|
+
enqueue(
|
|
34
|
+
setViewport({
|
|
35
|
+
viewport: context.viewportOnAutoLayout,
|
|
36
|
+
duration: 0
|
|
37
|
+
})
|
|
38
|
+
);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (nextView._layout === "manual" && context.viewportOnManualLayout) {
|
|
42
|
+
enqueue(
|
|
43
|
+
setViewport({
|
|
44
|
+
viewport: context.viewportOnManualLayout,
|
|
45
|
+
duration: 0
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
recenter = recenter || nextView._type === "dynamic" && context.view._type === "dynamic" && nextView.variant !== context.view.variant;
|
|
52
|
+
recenter = recenter || context.toggledFeatures.enableCompareWithLatest === true && !!nextView._layout && context.view._layout !== nextView._layout;
|
|
53
|
+
if (recenter) {
|
|
54
|
+
enqueue(cancelFitDiagram());
|
|
55
|
+
const nextViewport = calcViewportForBounds(
|
|
56
|
+
context,
|
|
57
|
+
event.view.bounds
|
|
58
|
+
);
|
|
59
|
+
let zoom = Math.min(nextViewport.zoom, context.viewport.zoom);
|
|
60
|
+
const center = BBox.center(event.view.bounds);
|
|
61
|
+
context.xyflow.setCenter(
|
|
62
|
+
Math.round(center.x),
|
|
63
|
+
Math.round(center.y),
|
|
64
|
+
{ zoom }
|
|
65
|
+
);
|
|
66
|
+
enqueue(raiseFitDiagram());
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
const ready = machine.createStateConfig({
|
|
71
|
+
initial: "idle",
|
|
72
|
+
entry: [
|
|
73
|
+
xstateActions_cjsExports.spawnChild("mediaPrintActorLogic", { id: "mediaPrint" }),
|
|
74
|
+
ensureSyncLayoutActor(),
|
|
75
|
+
ensureOverlaysActor(),
|
|
76
|
+
ensureSearchActor()
|
|
77
|
+
],
|
|
78
|
+
exit: [
|
|
79
|
+
cancelFitDiagram(),
|
|
80
|
+
xstateActions_cjsExports.stopChild("mediaPrint"),
|
|
81
|
+
closeAllOverlays(),
|
|
82
|
+
closeSearch(),
|
|
83
|
+
stopSyncLayout()
|
|
84
|
+
],
|
|
85
|
+
states: {
|
|
86
|
+
idle,
|
|
87
|
+
focused,
|
|
88
|
+
walkthrough,
|
|
89
|
+
printing
|
|
90
|
+
},
|
|
91
|
+
on: {
|
|
92
|
+
"navigate.*": {
|
|
93
|
+
actions: handleNavigate()
|
|
94
|
+
},
|
|
95
|
+
"layout.align": {
|
|
96
|
+
guard: "not readonly",
|
|
97
|
+
actions: [
|
|
98
|
+
startEditing("node"),
|
|
99
|
+
layoutAlign(),
|
|
100
|
+
stopEditing(true)
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"layout.resetEdgeControlPoints": {
|
|
104
|
+
guard: "not readonly",
|
|
105
|
+
actions: [
|
|
106
|
+
startEditing("edge"),
|
|
107
|
+
resetEdgesControlPoints(),
|
|
108
|
+
stopEditing(true)
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"layout.resetManualLayout": {
|
|
112
|
+
guard: "not readonly",
|
|
113
|
+
actions: [
|
|
114
|
+
stopSyncLayout(),
|
|
115
|
+
disableCompareWithLatest(),
|
|
116
|
+
xstateActions_cjsExports.emit({
|
|
117
|
+
type: "onChange",
|
|
118
|
+
change: {
|
|
119
|
+
op: "reset-manual-layout"
|
|
120
|
+
}
|
|
121
|
+
}),
|
|
122
|
+
ensureSyncLayoutActor()
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"xyflow.resized": {
|
|
126
|
+
guard: ({ context }) => context.features.enableFitView && !context.viewportChangedManually,
|
|
127
|
+
actions: [
|
|
128
|
+
cancelFitDiagram(),
|
|
129
|
+
raiseFitDiagram({ delay: 200 })
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"open.elementDetails": {
|
|
133
|
+
guard: "enabled: ElementDetails",
|
|
134
|
+
actions: openElementDetails()
|
|
135
|
+
},
|
|
136
|
+
"open.relationshipsBrowser": {
|
|
137
|
+
actions: xstateActions_cjsExports.sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event, self }) => ({
|
|
138
|
+
type: "open.relationshipsBrowser",
|
|
139
|
+
subject: event.fqn,
|
|
140
|
+
viewId: context.view.id,
|
|
141
|
+
scope: "view",
|
|
142
|
+
closeable: true,
|
|
143
|
+
enableChangeScope: true,
|
|
144
|
+
enableSelectSubject: true,
|
|
145
|
+
openSourceActor: self
|
|
146
|
+
}))
|
|
147
|
+
},
|
|
148
|
+
"open.relationshipDetails": {
|
|
149
|
+
actions: xstateActions_cjsExports.sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event, self }) => ({
|
|
150
|
+
type: "open.relationshipDetails",
|
|
151
|
+
viewId: context.view.id,
|
|
152
|
+
openSourceActor: self,
|
|
153
|
+
...event.params
|
|
154
|
+
}))
|
|
155
|
+
},
|
|
156
|
+
"open.source": {
|
|
157
|
+
guard: "enabled: OpenSource",
|
|
158
|
+
actions: emitOpenSource()
|
|
159
|
+
},
|
|
160
|
+
"walkthrough.start": {
|
|
161
|
+
guard: "is dynamic view",
|
|
162
|
+
target: targetState.walkthrough
|
|
163
|
+
},
|
|
164
|
+
"toggle.feature": {
|
|
165
|
+
actions: [
|
|
166
|
+
assignToggledFeatures(),
|
|
167
|
+
ensureSyncLayoutActor()
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"update.features": {
|
|
171
|
+
actions: [
|
|
172
|
+
updateFeatures(),
|
|
173
|
+
ensureOverlaysActor(),
|
|
174
|
+
ensureSearchActor(),
|
|
175
|
+
ensureSyncLayoutActor()
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"xyflow.nodeMouseEnter": {
|
|
179
|
+
actions: onNodeMouseEnter()
|
|
180
|
+
},
|
|
181
|
+
"xyflow.nodeMouseLeave": {
|
|
182
|
+
actions: onNodeMouseLeave()
|
|
183
|
+
},
|
|
184
|
+
"xyflow.edgeMouseEnter": {
|
|
185
|
+
actions: onEdgeMouseEnter()
|
|
186
|
+
},
|
|
187
|
+
"xyflow.edgeMouseLeave": {
|
|
188
|
+
actions: onEdgeMouseLeave()
|
|
189
|
+
},
|
|
190
|
+
"xyflow.edgeDoubleClick": {
|
|
191
|
+
guard: xstateGuards_cjsExports.and([
|
|
192
|
+
"not readonly",
|
|
193
|
+
({ event }) => !!event.edge.data.controlPoints && event.edge.data.controlPoints.length > 0
|
|
194
|
+
]),
|
|
195
|
+
actions: [
|
|
196
|
+
startEditing("edge"),
|
|
197
|
+
onEdgeDoubleClick(),
|
|
198
|
+
stopEditing(true)
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"notations.highlight": {
|
|
202
|
+
actions: notationsHighlight()
|
|
203
|
+
},
|
|
204
|
+
"notations.unhighlight": {
|
|
205
|
+
actions: undimEverything()
|
|
206
|
+
},
|
|
207
|
+
"tag.highlight": {
|
|
208
|
+
actions: tagHighlight()
|
|
209
|
+
},
|
|
210
|
+
"tag.unhighlight": {
|
|
211
|
+
actions: undimEverything()
|
|
212
|
+
},
|
|
213
|
+
"open.search": {
|
|
214
|
+
guard: "enabled: Search",
|
|
215
|
+
actions: xstateActions_cjsExports.sendTo(({ system }) => typedSystem(system).searchActorRef, ({ event }) => ({
|
|
216
|
+
type: "open",
|
|
217
|
+
search: event.search
|
|
218
|
+
}))
|
|
219
|
+
},
|
|
220
|
+
"xyflow.paneClick": {
|
|
221
|
+
actions: [
|
|
222
|
+
resetLastClickedNode(),
|
|
223
|
+
emitPaneClick()
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
"xyflow.nodeClick": {
|
|
227
|
+
actions: [
|
|
228
|
+
assignLastClickedNode(),
|
|
229
|
+
emitNodeClick()
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
"xyflow.edgeClick": {
|
|
233
|
+
actions: [
|
|
234
|
+
resetLastClickedNode(),
|
|
235
|
+
emitEdgeClick()
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
"xyflow.fitDiagram": {
|
|
239
|
+
guard: "enabled: FitView",
|
|
240
|
+
actions: fitDiagram()
|
|
241
|
+
},
|
|
242
|
+
"xyflow.setViewport": {
|
|
243
|
+
actions: setViewport()
|
|
244
|
+
},
|
|
245
|
+
"update.view": [
|
|
246
|
+
// Redirect to navigating state if received another view
|
|
247
|
+
{
|
|
248
|
+
guard: "is another view",
|
|
249
|
+
target: targetState.navigating
|
|
250
|
+
},
|
|
251
|
+
// Otherwise, just update the view in place
|
|
252
|
+
{
|
|
253
|
+
actions: updateView()
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"media.print.on": {
|
|
257
|
+
target: targetState.printing
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
export { ready };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { CancelAction, ActionFunction, Values, LogAction } from 'xstate';
|
|
2
|
+
import { Context, Events, EmittedEvents } from './machine.setup';
|
|
3
|
+
import { SyncLayoutActorLogic } from './syncManualLayoutActor';
|
|
4
|
+
import { HotkeyActorLogic } from './hotkeyActor';
|
|
5
|
+
import { OverlaysActorLogic } from '../../overlays/overlaysActor';
|
|
6
|
+
import { SearchActorLogic } from '../../search/searchActor';
|
|
7
|
+
import { MediaPrintActorLogic } from './mediaPrintActor';
|
|
8
|
+
/**
|
|
9
|
+
* State when the diagram is being prepared for printing.
|
|
10
|
+
* Adjusts the viewport to fit the entire diagram for optimal printing.
|
|
11
|
+
* Restores the previous viewport upon exiting the state.
|
|
12
|
+
*/
|
|
13
|
+
export declare const printing: {
|
|
14
|
+
id: string;
|
|
15
|
+
entry: CancelAction<Context, Events, undefined, Events>[];
|
|
16
|
+
exit: ActionFunction<Context, Events, Events, undefined, Values<{
|
|
17
|
+
syncManualLayoutActorLogic: {
|
|
18
|
+
src: "syncManualLayoutActorLogic";
|
|
19
|
+
logic: SyncLayoutActorLogic;
|
|
20
|
+
id: "syncLayout";
|
|
21
|
+
};
|
|
22
|
+
hotkeyActorLogic: {
|
|
23
|
+
src: "hotkeyActorLogic";
|
|
24
|
+
logic: HotkeyActorLogic;
|
|
25
|
+
id: "hotkey";
|
|
26
|
+
};
|
|
27
|
+
overlaysActorLogic: {
|
|
28
|
+
src: "overlaysActorLogic";
|
|
29
|
+
logic: OverlaysActorLogic;
|
|
30
|
+
id: "overlays";
|
|
31
|
+
};
|
|
32
|
+
searchActorLogic: {
|
|
33
|
+
src: "searchActorLogic";
|
|
34
|
+
logic: SearchActorLogic;
|
|
35
|
+
id: "search";
|
|
36
|
+
};
|
|
37
|
+
mediaPrintActorLogic: {
|
|
38
|
+
src: "mediaPrintActorLogic";
|
|
39
|
+
logic: MediaPrintActorLogic;
|
|
40
|
+
id: "mediaPrint";
|
|
41
|
+
};
|
|
42
|
+
}>, never, Values<{
|
|
43
|
+
isReady: {
|
|
44
|
+
type: "isReady";
|
|
45
|
+
params: unknown;
|
|
46
|
+
};
|
|
47
|
+
"enabled: FitView": {
|
|
48
|
+
type: "enabled: FitView";
|
|
49
|
+
params: unknown;
|
|
50
|
+
};
|
|
51
|
+
"enabled: FocusMode": {
|
|
52
|
+
type: "enabled: FocusMode";
|
|
53
|
+
params: unknown;
|
|
54
|
+
};
|
|
55
|
+
"enabled: Readonly": {
|
|
56
|
+
type: "enabled: Readonly";
|
|
57
|
+
params: unknown;
|
|
58
|
+
};
|
|
59
|
+
"enabled: RelationshipDetails": {
|
|
60
|
+
type: "enabled: RelationshipDetails";
|
|
61
|
+
params: unknown;
|
|
62
|
+
};
|
|
63
|
+
"enabled: Search": {
|
|
64
|
+
type: "enabled: Search";
|
|
65
|
+
params: unknown;
|
|
66
|
+
};
|
|
67
|
+
"enabled: ElementDetails": {
|
|
68
|
+
type: "enabled: ElementDetails";
|
|
69
|
+
params: unknown;
|
|
70
|
+
};
|
|
71
|
+
"enabled: OpenSource": {
|
|
72
|
+
type: "enabled: OpenSource";
|
|
73
|
+
params: unknown;
|
|
74
|
+
};
|
|
75
|
+
"enabled: DynamicViewWalkthrough": {
|
|
76
|
+
type: "enabled: DynamicViewWalkthrough";
|
|
77
|
+
params: unknown;
|
|
78
|
+
};
|
|
79
|
+
"enabled: Overlays": {
|
|
80
|
+
type: "enabled: Overlays";
|
|
81
|
+
params: unknown;
|
|
82
|
+
};
|
|
83
|
+
"not readonly": {
|
|
84
|
+
type: "not readonly";
|
|
85
|
+
params: unknown;
|
|
86
|
+
};
|
|
87
|
+
"is dynamic view": {
|
|
88
|
+
type: "is dynamic view";
|
|
89
|
+
params: unknown;
|
|
90
|
+
};
|
|
91
|
+
"is another view": {
|
|
92
|
+
type: "is another view";
|
|
93
|
+
params: unknown;
|
|
94
|
+
};
|
|
95
|
+
"click: node has modelFqn": {
|
|
96
|
+
type: "click: node has modelFqn";
|
|
97
|
+
params: unknown;
|
|
98
|
+
};
|
|
99
|
+
"click: selected node": {
|
|
100
|
+
type: "click: selected node";
|
|
101
|
+
params: unknown;
|
|
102
|
+
};
|
|
103
|
+
"click: same node": {
|
|
104
|
+
type: "click: same node";
|
|
105
|
+
params: unknown;
|
|
106
|
+
};
|
|
107
|
+
"click: focused node": {
|
|
108
|
+
type: "click: focused node";
|
|
109
|
+
params: unknown;
|
|
110
|
+
};
|
|
111
|
+
"click: node has connections": {
|
|
112
|
+
type: "click: node has connections";
|
|
113
|
+
params: unknown;
|
|
114
|
+
};
|
|
115
|
+
"click: selected edge": {
|
|
116
|
+
type: "click: selected edge";
|
|
117
|
+
params: unknown;
|
|
118
|
+
};
|
|
119
|
+
}>, never, EmittedEvents>[];
|
|
120
|
+
on: {
|
|
121
|
+
'media.print.off': {
|
|
122
|
+
target: string;
|
|
123
|
+
};
|
|
124
|
+
'*': {
|
|
125
|
+
actions: LogAction<Context, Events, undefined, Events>[];
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { log, enqueueActions } from 'xstate';
|
|
2
|
+
import { machine, targetState } from './machine.setup.js';
|
|
3
|
+
import { returnViewportBefore, cancelFitDiagram, assignViewportBefore, setViewport } from './machine.actions.layout.js';
|
|
4
|
+
|
|
5
|
+
const printing = machine.createStateConfig({
|
|
6
|
+
id: targetState.printing.slice(1),
|
|
7
|
+
entry: [
|
|
8
|
+
cancelFitDiagram(),
|
|
9
|
+
assignViewportBefore(),
|
|
10
|
+
enqueueActions(({ enqueue, context }) => {
|
|
11
|
+
const bounds = context.view.bounds;
|
|
12
|
+
const OFFSET = 16;
|
|
13
|
+
enqueue(
|
|
14
|
+
setViewport({
|
|
15
|
+
viewport: {
|
|
16
|
+
x: bounds.x + OFFSET,
|
|
17
|
+
y: bounds.y + OFFSET,
|
|
18
|
+
zoom: 1
|
|
19
|
+
},
|
|
20
|
+
duration: 0
|
|
21
|
+
})
|
|
22
|
+
);
|
|
23
|
+
})
|
|
24
|
+
],
|
|
25
|
+
exit: [
|
|
26
|
+
returnViewportBefore({ delay: 0, duration: 0 })
|
|
27
|
+
],
|
|
28
|
+
on: {
|
|
29
|
+
"media.print.off": {
|
|
30
|
+
target: targetState.idle
|
|
31
|
+
},
|
|
32
|
+
"*": {
|
|
33
|
+
actions: [
|
|
34
|
+
log(({ event }) => `Printing state - ignoring event: ${event.type}`)
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export { printing };
|