@likec4/diagram 1.44.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +18847 -17876
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +15 -12
- package/dist/LikeC4Diagram.props.d.ts +13 -20
- package/dist/LikeC4ProjectsProvider.js +8 -4
- package/dist/LikeC4Styles.js +0 -3
- package/dist/LikeC4View.d.ts +3 -3
- package/dist/LikeC4View.js +8 -8
- package/dist/ReactLikeC4.d.ts +3 -6
- package/dist/StaticLikeC4Diagram.js +0 -2
- package/dist/base/Base.d.ts +1 -1
- package/dist/base/updateEdges.js +25 -15
- package/dist/base/updateNodes.d.ts +14 -0
- package/dist/base/updateNodes.js +51 -18
- package/dist/base-primitives/Markdown.d.ts +30 -4
- package/dist/base-primitives/Markdown.js +3 -2
- package/dist/base-primitives/NodeHandles.d.ts +2 -1
- package/dist/base-primitives/NodeHandles.js +22 -18
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +6 -4
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -2
- package/dist/base-primitives/edge/EdgeLabel.js +16 -16
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -4
- package/dist/base-primitives/edge/EdgePath.js +27 -12
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +3 -3
- package/dist/base-primitives/element/ElementData.d.ts +3 -3
- package/dist/base-primitives/element/ElementData.js +13 -7
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
- package/dist/base-primitives/element/ElementDetailsButton.js +4 -1
- package/dist/base-primitives/element/ElementShape.js +5 -5
- package/dist/base-primitives/element/ElementTags.d.ts +6 -4
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +0 -1
- package/dist/context/DiagramFeatures.d.ts +2 -1
- package/dist/context/DiagramFeatures.js +1 -0
- package/dist/context/EnsureMantine.js +2 -1
- package/dist/context/IconRenderer.js +6 -6
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.js +1 -1
- package/dist/editor/LikeC4EditorProvider.d.ts +22 -0
- package/dist/editor/LikeC4EditorProvider.js +12 -0
- package/dist/editor/__tests__/fixture.d.ts +205 -0
- package/dist/editor/applyChangesToManualLayout.d.ts +8 -0
- package/dist/editor/applyChangesToManualLayout.js +182 -0
- package/dist/editor/editorActor.actions.d.ts +201 -0
- package/dist/editor/editorActor.actions.js +149 -0
- package/dist/editor/editorActor.d.ts +653 -0
- package/dist/editor/editorActor.js +324 -0
- package/dist/editor/hotkeyActor.d.ts +7 -0
- package/dist/editor/hotkeyActor.js +19 -0
- package/dist/editor/index.d.ts +3 -2
- package/dist/editor/useEditorActorLogic.d.ts +565 -0
- package/dist/editor/useEditorActorLogic.js +54 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/safeContext.d.ts +3 -2
- package/dist/hooks/safeContext.js +7 -4
- package/dist/hooks/useDiagram.d.ts +4 -2
- package/dist/hooks/useDiagram.js +19 -8
- package/dist/hooks/useDiagramCompareLayout.d.ts +8 -0
- package/dist/hooks/useDiagramCompareLayout.js +29 -4
- package/dist/hooks/useLikeC4Project.d.ts +6 -1
- package/dist/hooks/useLikeC4Project.js +14 -2
- package/dist/hooks/useMediaPrint.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/likec4diagram/DiagramXYFlow.js +11 -7
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +34 -0
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +90 -54
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +3 -1
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/edges.css.js +30 -24
- package/dist/likec4diagram/custom/edges/useControlPoints.js +5 -5
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +5 -5
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/{ElementNodeDrifts.js → NodeDrifts.js} +12 -13
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.js +61 -23
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +128 -15
- package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +63 -72
- package/dist/likec4diagram/state/assign.d.ts +14 -7
- package/dist/likec4diagram/state/assign.js +28 -200
- package/dist/likec4diagram/state/createViewChange.js +23 -30
- package/dist/likec4diagram/state/diagram-api.d.ts +20 -6
- package/dist/likec4diagram/state/diagram-api.js +58 -52
- package/dist/likec4diagram/state/hotkeyActor.d.ts +1 -8
- package/dist/likec4diagram/state/hotkeyActor.js +13 -17
- package/dist/likec4diagram/state/machine.actions.d.ts +1127 -864
- package/dist/likec4diagram/state/machine.actions.js +316 -296
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +641 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +141 -0
- package/dist/likec4diagram/state/machine.d.ts +18 -3712
- package/dist/likec4diagram/state/machine.js +64 -73
- package/dist/likec4diagram/state/machine.setup.d.ts +80 -26
- package/dist/likec4diagram/state/machine.setup.js +44 -7
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +58 -17
- package/dist/likec4diagram/state/machine.state.initializing.js +14 -14
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +5 -108
- package/dist/likec4diagram/state/machine.state.navigating.js +187 -35
- package/dist/likec4diagram/state/machine.state.ready.d.ts +2997 -2598
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +710 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.js +98 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +540 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.js +105 -0
- package/dist/likec4diagram/state/machine.state.ready.js +95 -347
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +140 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +684 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +190 -0
- package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
- package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
- package/dist/likec4diagram/state/types.d.ts +11 -9
- package/dist/likec4diagram/state/utils.d.ts +44 -5
- package/dist/likec4diagram/state/utils.js +62 -6
- package/dist/likec4diagram/types.d.ts +8 -13
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.js +104 -103
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +12 -15
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
- package/dist/navigationpanel/NavigationPanel.js +11 -10
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- package/dist/navigationpanel/_common.js +1 -1
- package/dist/navigationpanel/actor.d.ts +4 -204
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +40 -14
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +6 -4
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +2 -2
- package/dist/navigationpanel/controls/DetailsControls.js +2 -2
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +2 -2
- package/dist/navigationpanel/controls/ToggleReadonly.js +32 -19
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +9 -9
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +4 -3
- package/dist/overlays/Overlays.js +24 -12
- package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
- package/dist/overlays/element-details/MetadataValue.js +4 -6
- package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
- package/dist/overlays/element-details/TabPanelRelationships.js +12 -7
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +8 -83
- package/dist/overlays/element-details/actor.js +0 -8
- package/dist/overlays/overlay/Overlay.js +10 -10
- package/dist/overlays/overlaysActor.d.ts +7 -392
- package/dist/overlays/overlaysActor.js +73 -49
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/_types.d.ts +3 -4
- package/dist/overlays/relationship-details/actor.d.ts +6 -562
- package/dist/overlays/relationship-details/actor.js +1 -0
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
- package/dist/overlays/relationship-details/layout.d.ts +3 -3
- package/dist/overlays/relationship-details/layout.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/_types.d.ts +2 -3
- package/dist/overlays/relationships-browser/actor.d.ts +7 -739
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +3 -3
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
- package/dist/overlays/types.d.ts +12 -13
- package/dist/search/components/ElementsColumn.js +7 -3
- package/dist/search/components/PickView.js +3 -1
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.d.ts +3 -1
- package/dist/search/components/ViewsColum.js +13 -7
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/searchActor.d.ts +3 -66
- package/dist/shadowroot/ShadowRoot.d.ts +5 -7
- package/dist/shadowroot/ShadowRoot.js +7 -5
- package/dist/shadowroot/styles.css.js +6 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/view-bounds.js +7 -6
- package/dist/utils/xyflow.d.ts +6 -5
- package/dist/utils/xyflow.js +26 -57
- package/package.json +24 -23
- package/panda.buildinfo.json +65 -71
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/base-primitives/edge/edge.css.d.ts +0 -4
- package/dist/base-primitives/edge/edge.css.js +0 -71
- package/dist/editor/LikeC4EditorContext.d.ts +0 -21
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +0 -4
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +0 -280
- package/dist/likec4diagram/state/syncManualLayoutActor.js +0 -248
- package/dist/utils/vector.d.ts +0 -81
- package/dist/utils/vector.js +0 -120
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { find } from 'remeda';
|
|
2
|
+
import { setup, assign, fromPromise, enqueueActions, sendTo, log } from 'xstate';
|
|
3
|
+
import { cancelSync, stopHotkey, undo, markHistoryAsSynched, reschedule, isLayoutChange, withoutSnapshotChanges, addSnapshotToPendingChanges, ensureHotKey, pushHistory, saveStateBeforeEdit, stopEditing, startEditing } from './editorActor.actions.js';
|
|
4
|
+
import { hotkeyActorLogic } from './hotkeyActor.js';
|
|
5
|
+
|
|
6
|
+
const applyLatest = fromPromise(
|
|
7
|
+
() => {
|
|
8
|
+
throw new Error("Not implemented");
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
const executeChange = fromPromise(
|
|
12
|
+
() => {
|
|
13
|
+
throw new Error("Not implemented");
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
const diagramActorRef = function(params) {
|
|
17
|
+
return params.system.get("diagram");
|
|
18
|
+
};
|
|
19
|
+
const machine = setup({
|
|
20
|
+
types: {
|
|
21
|
+
context: {},
|
|
22
|
+
events: {},
|
|
23
|
+
emitted: {},
|
|
24
|
+
input: {},
|
|
25
|
+
children: {},
|
|
26
|
+
tags: {}
|
|
27
|
+
},
|
|
28
|
+
delays: {
|
|
29
|
+
"350ms": 350,
|
|
30
|
+
"waitBeforeSync": 2e3
|
|
31
|
+
},
|
|
32
|
+
actors: {
|
|
33
|
+
applyLatest,
|
|
34
|
+
executeChange,
|
|
35
|
+
hotkey: hotkeyActorLogic
|
|
36
|
+
},
|
|
37
|
+
guards: {
|
|
38
|
+
"has pending": ({ context }) => context.pendingChanges.length > 0,
|
|
39
|
+
"can undo": ({ context }) => context.history.length > 0
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const to = {
|
|
43
|
+
idle: { target: "#idle" },
|
|
44
|
+
editing: { target: "#editing" },
|
|
45
|
+
afterEdit: { target: "#afterEdit" },
|
|
46
|
+
pending: { target: "#pending" },
|
|
47
|
+
applyLatestToManual: { target: "#applyLatestToManual" },
|
|
48
|
+
executeChanges: { target: "#executeChanges" }
|
|
49
|
+
};
|
|
50
|
+
const idle = machine.createStateConfig({
|
|
51
|
+
id: "idle",
|
|
52
|
+
on: {
|
|
53
|
+
"sync": {
|
|
54
|
+
...to.pending
|
|
55
|
+
},
|
|
56
|
+
"edit.start": {
|
|
57
|
+
...to.editing
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const editing = machine.createStateConfig({
|
|
62
|
+
id: "editing",
|
|
63
|
+
tags: "pending",
|
|
64
|
+
entry: [
|
|
65
|
+
startEditing(),
|
|
66
|
+
cancelSync()
|
|
67
|
+
],
|
|
68
|
+
on: {
|
|
69
|
+
change: {
|
|
70
|
+
actions: stopEditing(),
|
|
71
|
+
...to.executeChanges
|
|
72
|
+
},
|
|
73
|
+
"edit.finish": {
|
|
74
|
+
actions: stopEditing(),
|
|
75
|
+
...to.afterEdit
|
|
76
|
+
},
|
|
77
|
+
"undo": {
|
|
78
|
+
actions: stopEditing(),
|
|
79
|
+
...to.idle
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const pending = machine.createStateConfig({
|
|
84
|
+
id: "pending",
|
|
85
|
+
tags: ["pending"],
|
|
86
|
+
entry: ensureHotKey(),
|
|
87
|
+
on: {
|
|
88
|
+
"sync": {
|
|
89
|
+
reenter: true,
|
|
90
|
+
...to.pending
|
|
91
|
+
},
|
|
92
|
+
"edit.start": {
|
|
93
|
+
// this allows to return back from editing in afterEdit state
|
|
94
|
+
actions: [
|
|
95
|
+
addSnapshotToPendingChanges()
|
|
96
|
+
],
|
|
97
|
+
...to.editing
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
after: {
|
|
101
|
+
"waitBeforeSync": {
|
|
102
|
+
actions: [
|
|
103
|
+
addSnapshotToPendingChanges()
|
|
104
|
+
],
|
|
105
|
+
...to.executeChanges
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
const afterEdit = machine.createStateConfig({
|
|
110
|
+
id: "afterEdit",
|
|
111
|
+
always: [
|
|
112
|
+
{ guard: "has pending", ...to.pending },
|
|
113
|
+
{ ...to.idle }
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
const applyLatestToManual = machine.createStateConfig({
|
|
117
|
+
id: "applyLatestToManual",
|
|
118
|
+
entry: [
|
|
119
|
+
cancelSync(),
|
|
120
|
+
saveStateBeforeEdit()
|
|
121
|
+
],
|
|
122
|
+
initial: "call",
|
|
123
|
+
on: {
|
|
124
|
+
// catch all events
|
|
125
|
+
"*": {
|
|
126
|
+
actions: [
|
|
127
|
+
log(({ event }) => `applyLatestToManual received unexpected event: ${event.type}`),
|
|
128
|
+
reschedule(350)
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
states: {
|
|
133
|
+
// Fetch latest and manual layouts
|
|
134
|
+
// Apply changes, send update to diagram
|
|
135
|
+
call: {
|
|
136
|
+
invoke: {
|
|
137
|
+
src: "applyLatest",
|
|
138
|
+
input: ({ context }) => {
|
|
139
|
+
const current = context.beforeEditing?.change.layout;
|
|
140
|
+
return {
|
|
141
|
+
current: current && current._layout === "manual" ? current : void 0,
|
|
142
|
+
viewId: context.viewId
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
onDone: {
|
|
146
|
+
actions: sendTo(
|
|
147
|
+
diagramActorRef,
|
|
148
|
+
({ event }) => ({
|
|
149
|
+
type: "update.view",
|
|
150
|
+
view: event.output.updated
|
|
151
|
+
}),
|
|
152
|
+
{ delay: 10 }
|
|
153
|
+
),
|
|
154
|
+
target: "wait"
|
|
155
|
+
},
|
|
156
|
+
onError: {
|
|
157
|
+
actions: [
|
|
158
|
+
assign({
|
|
159
|
+
beforeEditing: null,
|
|
160
|
+
pendingChanges: []
|
|
161
|
+
}),
|
|
162
|
+
({ event }) => {
|
|
163
|
+
console.error(event.error);
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
...to.idle
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
// Now we wait 350ms, take new snapshot and send save-view-snapshot
|
|
171
|
+
wait: {
|
|
172
|
+
entry: pushHistory(),
|
|
173
|
+
after: {
|
|
174
|
+
"350ms": {
|
|
175
|
+
actions: [
|
|
176
|
+
addSnapshotToPendingChanges(),
|
|
177
|
+
ensureHotKey()
|
|
178
|
+
],
|
|
179
|
+
...to.executeChanges
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
const executeChanges = machine.createStateConfig({
|
|
186
|
+
id: "executeChanges",
|
|
187
|
+
entry: [
|
|
188
|
+
assign(({ event, context }) => {
|
|
189
|
+
if (event.type === "change") {
|
|
190
|
+
if (isLayoutChange(event.change)) {
|
|
191
|
+
return {
|
|
192
|
+
pendingChanges: [
|
|
193
|
+
...withoutSnapshotChanges(context.pendingChanges),
|
|
194
|
+
event.change
|
|
195
|
+
]
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
if (!context.pendingChanges.includes(event.change)) {
|
|
199
|
+
return {
|
|
200
|
+
pendingChanges: [
|
|
201
|
+
...context.pendingChanges,
|
|
202
|
+
event.change
|
|
203
|
+
]
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return {};
|
|
208
|
+
}),
|
|
209
|
+
cancelSync()
|
|
210
|
+
],
|
|
211
|
+
invoke: {
|
|
212
|
+
src: "executeChange",
|
|
213
|
+
input: ({ context }) => ({
|
|
214
|
+
changes: context.pendingChanges,
|
|
215
|
+
viewId: context.viewId
|
|
216
|
+
}),
|
|
217
|
+
onDone: {
|
|
218
|
+
actions: enqueueActions(({ context, enqueue }) => {
|
|
219
|
+
const snapshot = find(context.pendingChanges, (c) => c.op === "save-view-snapshot");
|
|
220
|
+
if (snapshot) {
|
|
221
|
+
enqueue.sendTo(
|
|
222
|
+
diagramActorRef,
|
|
223
|
+
{
|
|
224
|
+
type: "update.view-bounds",
|
|
225
|
+
bounds: snapshot.layout.bounds
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
enqueue.assign({
|
|
230
|
+
pendingChanges: []
|
|
231
|
+
});
|
|
232
|
+
}),
|
|
233
|
+
...to.idle
|
|
234
|
+
},
|
|
235
|
+
onError: {
|
|
236
|
+
actions: ({ event }) => {
|
|
237
|
+
console.error(event.error);
|
|
238
|
+
},
|
|
239
|
+
...to.afterEdit
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
on: {
|
|
243
|
+
"*": {
|
|
244
|
+
actions: reschedule()
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
const _editorActorLogic = machine.createMachine({
|
|
249
|
+
id: "editor",
|
|
250
|
+
context: ({ input }) => ({
|
|
251
|
+
viewId: input.viewId,
|
|
252
|
+
beforeEditing: null,
|
|
253
|
+
editing: null,
|
|
254
|
+
pendingChanges: [],
|
|
255
|
+
history: []
|
|
256
|
+
}),
|
|
257
|
+
initial: "idle",
|
|
258
|
+
// TODO: listen to diagram actor, if switches to "sequence" dynamic view, cancel editing
|
|
259
|
+
// entry: ({ self, system }) => {
|
|
260
|
+
// // let previous = ''
|
|
261
|
+
// // const a = (self._parent as DiagramMachineRef).subscribe({
|
|
262
|
+
// // next({ context }) {
|
|
263
|
+
// // const current = context.view._type === 'dynamic' ? context.dynamicViewVariant
|
|
264
|
+
// // },
|
|
265
|
+
// // })
|
|
266
|
+
// const s = self.subscribe({
|
|
267
|
+
// complete: () => {
|
|
268
|
+
// console.log('editor actor completed')
|
|
269
|
+
// s.unsubscribe()
|
|
270
|
+
// },
|
|
271
|
+
// })
|
|
272
|
+
// },
|
|
273
|
+
states: {
|
|
274
|
+
idle,
|
|
275
|
+
editing,
|
|
276
|
+
pending,
|
|
277
|
+
afterEdit,
|
|
278
|
+
applyLatestToManual,
|
|
279
|
+
executeChanges
|
|
280
|
+
},
|
|
281
|
+
on: {
|
|
282
|
+
cancel: {
|
|
283
|
+
actions: [
|
|
284
|
+
cancelSync(),
|
|
285
|
+
assign({
|
|
286
|
+
editing: null,
|
|
287
|
+
beforeEditing: null,
|
|
288
|
+
pendingChanges: []
|
|
289
|
+
})
|
|
290
|
+
],
|
|
291
|
+
...to.idle
|
|
292
|
+
},
|
|
293
|
+
synced: {
|
|
294
|
+
actions: markHistoryAsSynched()
|
|
295
|
+
},
|
|
296
|
+
undo: {
|
|
297
|
+
guard: "can undo",
|
|
298
|
+
actions: undo(),
|
|
299
|
+
...to.idle
|
|
300
|
+
},
|
|
301
|
+
change: {
|
|
302
|
+
...to.executeChanges
|
|
303
|
+
},
|
|
304
|
+
"applyLatestToManual": {
|
|
305
|
+
...to.applyLatestToManual
|
|
306
|
+
},
|
|
307
|
+
reset: {
|
|
308
|
+
actions: [
|
|
309
|
+
cancelSync(),
|
|
310
|
+
assign({
|
|
311
|
+
history: [],
|
|
312
|
+
editing: null,
|
|
313
|
+
beforeEditing: null,
|
|
314
|
+
pendingChanges: []
|
|
315
|
+
}),
|
|
316
|
+
stopHotkey()
|
|
317
|
+
],
|
|
318
|
+
...to.idle
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
const editorActorLogic = _editorActorLogic;
|
|
323
|
+
|
|
324
|
+
export { editorActorLogic, machine };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnyEventObject, CallbackActorLogic, NonReducibleUnknown } from 'xstate';
|
|
2
|
+
export type HotKeyEvent = {
|
|
3
|
+
type: 'undo';
|
|
4
|
+
};
|
|
5
|
+
export interface HotkeyActorLogic extends CallbackActorLogic<AnyEventObject, NonReducibleUnknown, HotKeyEvent> {
|
|
6
|
+
}
|
|
7
|
+
export declare const hotkeyActorLogic: HotkeyActorLogic;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getHotkeyHandler } from '@mantine/hooks';
|
|
2
|
+
import { fromCallback } from 'xstate';
|
|
3
|
+
|
|
4
|
+
const hotkeyActorLogic = fromCallback(({ sendBack }) => {
|
|
5
|
+
const ctrlZHandler = getHotkeyHandler([
|
|
6
|
+
["mod + z", (event) => {
|
|
7
|
+
event.stopPropagation();
|
|
8
|
+
sendBack({ type: "undo" });
|
|
9
|
+
}, {
|
|
10
|
+
preventDefault: true
|
|
11
|
+
}]
|
|
12
|
+
]);
|
|
13
|
+
document.body.addEventListener("keydown", ctrlZHandler, { capture: true });
|
|
14
|
+
return () => {
|
|
15
|
+
document.body.removeEventListener("keydown", ctrlZHandler, { capture: true });
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { hotkeyActorLogic };
|
package/dist/editor/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { EnsureEditorContext,
|
|
2
|
-
export type {
|
|
1
|
+
export { EnsureEditorContext, LikeC4EditorProvider, useOptionalLikeC4EditorPort, } from './LikeC4EditorProvider';
|
|
2
|
+
export type { LikeC4EditorPort } from './LikeC4EditorProvider';
|
|
3
|
+
export type * from './editorActor';
|