@likec4/diagram 1.46.4 → 1.48.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/LICENSE +1 -1
- package/README.md +1 -1
- package/bundle/index.js +7332 -5799
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +20 -14
- package/dist/LikeC4Diagram.props.d.ts +2 -6
- package/dist/LikeC4ProjectsOverview.d.ts +7 -0
- package/dist/LikeC4ProjectsOverview.js +32 -0
- package/dist/LikeC4ProjectsProvider.js +7 -5
- package/dist/LikeC4Styles.d.ts +2 -6
- package/dist/LikeC4Styles.js +44 -43
- package/dist/LikeC4View.d.ts +9 -1
- package/dist/LikeC4View.js +10 -8
- package/dist/ReactLikeC4.d.ts +12 -2
- package/dist/ReactLikeC4.js +5 -3
- package/dist/adhoc-editor/ActorProvider.d.ts +7 -0
- package/dist/adhoc-editor/ActorProvider.js +41 -0
- package/dist/adhoc-editor/EditorNavigationPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorNavigationPanel.js +32 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +4 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +71 -0
- package/dist/adhoc-editor/SelectElementOverlay.d.ts +1 -0
- package/dist/adhoc-editor/SelectElementOverlay.js +124 -0
- package/dist/adhoc-editor/actor.d.ts +131 -0
- package/dist/adhoc-editor/actor.editor.d.ts +54 -0
- package/dist/adhoc-editor/actor.editor.js +96 -0
- package/dist/adhoc-editor/actor.js +20 -0
- package/dist/adhoc-editor/actor.layouter.d.ts +48 -0
- package/dist/adhoc-editor/actor.layouter.js +66 -0
- package/dist/adhoc-editor/actor.types.d.ts +57 -0
- package/dist/adhoc-editor/actor.types.js +22 -0
- package/dist/adhoc-editor/hooks.d.ts +14 -0
- package/dist/adhoc-editor/hooks.js +47 -0
- package/dist/adhoc-editor/index.d.ts +2 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +6 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +104 -0
- package/dist/base/const.d.ts +1 -0
- package/dist/base/const.js +2 -1
- package/dist/base/updateEdges.js +26 -3
- package/dist/base/updateNodes.js +8 -5
- package/dist/base-primitives/Markdown.js +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +4 -2
- package/dist/base-primitives/NodeHandles.js +46 -19
- package/dist/base-primitives/compound/CompoundActionButton.js +3 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +3 -1
- package/dist/base-primitives/compound/CompoundNodeContainer.d.ts +4 -3
- package/dist/base-primitives/compound/CompoundNodeContainer.js +6 -4
- package/dist/base-primitives/compound/CompoundTitle.js +1 -2
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +5 -2
- package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -1
- package/dist/base-primitives/element/ElementActionButtons.js +31 -58
- package/dist/base-primitives/element/ElementData.d.ts +7 -7
- package/dist/base-primitives/element/ElementData.js +61 -48
- package/dist/base-primitives/element/ElementDetailsButton.js +2 -1
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +2 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +3 -3
- package/dist/base-primitives/element/ElementShape.js +109 -20
- package/dist/base-primitives/element/ElementTags.d.ts +6 -2
- package/dist/base-primitives/element/ElementTags.js +55 -32
- package/dist/base-primitives/index.d.ts +1 -1
- package/dist/base-primitives/memoEdge.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -2
- package/dist/components/Logo.js +1 -1
- package/dist/components/NavigationPanel.d.ts +11 -0
- package/dist/components/NavigationPanel.js +50 -0
- package/dist/components/RootContainer.js +5 -8
- package/dist/context/DefaultMantineProvider.d.ts +2 -0
- package/dist/context/DefaultMantineProvider.js +66 -0
- package/dist/context/DiagramEventHandlers.js +1 -1
- package/dist/context/DiagramFeatures.js +12 -11
- package/dist/context/EnsureMantine.d.ts +0 -3
- package/dist/context/EnsureMantine.js +3 -4
- package/dist/context/IconRenderer.d.ts +14 -0
- package/dist/context/IconRenderer.js +11 -8
- package/dist/context/TagStylesContext.js +12 -4
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +2 -2
- package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
- package/dist/editor/LikeC4EditorCallbacks.js +5 -0
- package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
- package/dist/editor/LikeC4EditorProvider.js +2 -2
- package/dist/editor/applyChangesToManualLayout.js +1 -0
- package/dist/editor/editorActor.actions.d.ts +25 -25
- package/dist/editor/editorActor.actions.js +2 -2
- package/dist/editor/editorActor.setup.d.ts +84 -0
- package/dist/editor/editorActor.setup.js +38 -0
- package/dist/editor/editorActor.states.d.ts +9 -0
- package/dist/editor/{editorActor.js → editorActor.states.js} +22 -64
- package/dist/editor/index.d.ts +4 -3
- package/dist/editor/useEditorActorLogic.d.ts +2 -564
- package/dist/editor/useEditorActorLogic.js +8 -12
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useCallbackRef.d.ts +6 -0
- package/dist/hooks/useCurrentViewModel.d.ts +10 -0
- package/dist/hooks/useDiagram.js +2 -2
- package/dist/hooks/useDiagramCompareLayout.d.ts +1 -1
- package/dist/hooks/useDiagramCompareLayout.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +2 -2
- package/dist/hooks/useLikeC4Project.js +10 -2
- package/dist/hooks/useLikeC4Styles.js +0 -3
- package/dist/hooks/useSetState.d.ts +6 -1
- package/dist/hooks/useSetState.js +7 -4
- package/dist/hooks/useXYFlow.d.ts +7 -1
- package/dist/hooks/useXYFlow.js +4 -4
- package/dist/index.d.ts +9 -5
- package/dist/index.js +6 -3
- package/dist/likec4diagram/DiagramUI.js +1 -3
- package/dist/likec4diagram/DiagramXYFlow.js +26 -12
- package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
- package/dist/likec4diagram/convert-to-xyflow.js +2 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +13 -14
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +68 -35
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -5
- package/dist/likec4diagram/custom/nodes/nodes.js +25 -6
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +8 -7
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +1 -38
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +35 -19
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +9 -5
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +46 -10
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -15
- package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
- package/dist/likec4diagram/relationship-popover/components.js +39 -0
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +14 -15
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/createViewChange.js +16 -4
- package/dist/likec4diagram/state/machine.actions.d.ts +65 -0
- package/dist/likec4diagram/state/machine.actions.js +51 -39
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +22 -2
- package/dist/likec4diagram/state/machine.actions.layout.js +32 -14
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.js +31 -30
- package/dist/likec4diagram/state/machine.setup.d.ts +21 -5
- package/dist/likec4diagram/state/machine.setup.js +13 -4
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
- package/dist/likec4diagram/state/machine.state.navigating.js +81 -49
- package/dist/likec4diagram/state/machine.state.ready.d.ts +508 -582
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
- package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
- package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
- package/dist/likec4diagram/state/machine.state.ready.js +80 -69
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +13 -14
- package/dist/likec4diagram/state/utils.js +11 -3
- package/dist/likec4diagram/types.d.ts +9 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.js +4 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +5 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +10 -8
- package/dist/likec4diagram/xyflow-sequence/utils.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanel.js +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +6 -4
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- package/dist/navigationpanel/_common.js +1 -2
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +5 -5
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
- package/dist/navigationpanel/controls/LogoButton.d.ts +1 -0
- package/dist/navigationpanel/controls/{BurgerButton.js → LogoButton.js} +5 -5
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -2
- package/dist/navigationpanel/controls/SearchControl.js +8 -12
- package/dist/navigationpanel/controls/ToggleReadonly.js +4 -5
- package/dist/navigationpanel/controls/index.d.ts +1 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
- 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/editorpanel/styles.js +4 -4
- package/dist/navigationpanel/styles.css.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +67 -67
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +4 -4
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
- package/dist/overlays/element-details/MetadataValue.js +6 -7
- package/dist/overlays/element-details/TabPanelDeployments.js +7 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -25
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +3 -2
- package/dist/overlays/overlaysActor.js +18 -0
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.css.js +2 -2
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/compute.js +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +21 -6
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +0 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationships-browser/layout.d.ts +1 -1
- package/dist/overlays/relationships-browser/layout.js +1 -1
- package/dist/projects-overview/ProjectsOverview.d.ts +13 -0
- package/dist/projects-overview/ProjectsOverview.js +57 -0
- package/dist/projects-overview/ProjectsOverviewXY.d.ts +17 -0
- package/dist/projects-overview/ProjectsOverviewXY.js +98 -0
- package/dist/projects-overview/_types.d.ts +34 -0
- package/dist/projects-overview/actor.d.ts +121 -0
- package/dist/projects-overview/actor.js +359 -0
- package/dist/projects-overview/context.d.ts +4 -0
- package/dist/projects-overview/context.js +9 -0
- package/dist/projects-overview/custom/edgeTypes.d.ts +3 -0
- package/dist/projects-overview/custom/edgeTypes.js +23 -0
- package/dist/projects-overview/custom/index.d.ts +2 -0
- package/dist/projects-overview/custom/nodeTypes.d.ts +2 -0
- package/dist/projects-overview/custom/nodeTypes.js +45 -0
- package/dist/projects-overview/hooks.d.ts +5 -0
- package/dist/projects-overview/hooks.js +14 -0
- package/dist/projects-overview/index.d.ts +1 -0
- package/dist/projects-overview/layouted-to-xyflow.d.ts +6 -0
- package/dist/projects-overview/layouted-to-xyflow.js +49 -0
- package/dist/projects-overview/panel/ProjectsOverviewPanel.d.ts +1 -0
- package/dist/projects-overview/panel/ProjectsOverviewPanel.js +11 -0
- package/dist/projects-overview/persistence.d.ts +5 -0
- package/dist/projects-overview/persistence.js +24 -0
- package/dist/search/Search.d.ts +1 -4
- package/dist/search/Search.js +89 -87
- package/dist/search/components/ElementsColumn.css.js +3 -3
- package/dist/search/components/ElementsColumn.js +3 -4
- package/dist/search/components/PickView.d.ts +3 -1
- package/dist/search/components/PickView.js +5 -4
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +2 -2
- package/dist/search/components/_shared.css.js +1 -1
- package/dist/search/components/utils.js +1 -1
- package/dist/search/hooks.d.ts +1 -6
- package/dist/search/hooks.js +12 -9
- package/dist/search/searchActor.d.ts +1 -1
- package/dist/shadowroot/ShadowRoot.js +20 -19
- package/dist/shadowroot/styles.css.d.ts +0 -2
- package/dist/shadowroot/styles.css.js +1 -34
- package/dist/styles-font.css2.js +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.js +9 -5
- package/dist/utils/xyflow.d.ts +19 -3
- package/dist/utils/xyflow.js +52 -9
- package/package.json +23 -22
- package/panda.buildinfo.json +93 -84
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/base-primitives/element/ElementNodeContainer.css.d.ts +0 -1
- package/dist/base-primitives/element/ElementNodeContainer.css.js +0 -39
- package/dist/editor/__tests__/fixture.d.ts +0 -205
- package/dist/editor/editorActor.d.ts +0 -653
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
- package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
- package/dist/navigationpanel/controls/BurgerButton.d.ts +0 -1
- package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
- /package/dist/{overlays/relationships-browser → projects-overview}/custom/styles.css.d.ts +0 -0
|
@@ -1,565 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { StateMachine, ActorRefFromLogic, PromiseActorLogic, EventObject, NonReducibleUnknown, Values, MetaObject, ConditionalRequired, InputFrom, RequiredActorOptions, IsNotNever, GetConcreteByKey, AnyActorLogic, RequiredLogicInput, ActorRef, MachineSnapshot, AnyActorRef, StateValue, AnyEventObject, CancelAction, ActionFunction, LogAction, DoneActorEvent, ErrorActorEvent, ActionArgs, StopAction } from 'xstate';
|
|
3
|
-
import { HotkeyActorLogic } from './hotkeyActor';
|
|
1
|
+
import { EditorActorLogic } from './editorActor.states';
|
|
4
2
|
import type * as t from '@likec4/core/types';
|
|
5
|
-
export declare function useEditorActorLogic(viewId: t.ViewId):
|
|
6
|
-
[x: string]: ActorRefFromLogic<HotkeyActorLogic> | ActorRefFromLogic<PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>> | ActorRefFromLogic<PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>> | undefined;
|
|
7
|
-
hotkey?: ActorRefFromLogic<HotkeyActorLogic>;
|
|
8
|
-
}, Values<{
|
|
9
|
-
hotkey: {
|
|
10
|
-
src: "hotkey";
|
|
11
|
-
logic: HotkeyActorLogic;
|
|
12
|
-
id: "hotkey";
|
|
13
|
-
};
|
|
14
|
-
applyLatest: {
|
|
15
|
-
src: "applyLatest";
|
|
16
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
17
|
-
id: string | undefined;
|
|
18
|
-
};
|
|
19
|
-
executeChange: {
|
|
20
|
-
src: "executeChange";
|
|
21
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
22
|
-
id: string | undefined;
|
|
23
|
-
};
|
|
24
|
-
}>, never, Values<{
|
|
25
|
-
"has pending": {
|
|
26
|
-
type: "has pending";
|
|
27
|
-
params: unknown;
|
|
28
|
-
};
|
|
29
|
-
"can undo": {
|
|
30
|
-
type: "can undo";
|
|
31
|
-
params: unknown;
|
|
32
|
-
};
|
|
33
|
-
}>, "350ms" | "waitBeforeSync", "pending" | "idle" | "editing" | "afterEdit" | "executeChanges" | {
|
|
34
|
-
applyLatestToManual: "call" | "wait";
|
|
35
|
-
}, "pending", EditorActorInput, NonReducibleUnknown, EditorActorEmitedEvent, MetaObject, {
|
|
36
|
-
readonly id: "editor";
|
|
37
|
-
readonly context: ({ input }: {
|
|
38
|
-
spawn: {
|
|
39
|
-
<TSrc extends "hotkey" | "applyLatest" | "executeChange">(logic: TSrc, ...[options]: ({
|
|
40
|
-
src: "hotkey";
|
|
41
|
-
logic: HotkeyActorLogic;
|
|
42
|
-
id: "hotkey";
|
|
43
|
-
} extends infer T ? T extends {
|
|
44
|
-
src: "hotkey";
|
|
45
|
-
logic: HotkeyActorLogic;
|
|
46
|
-
id: "hotkey";
|
|
47
|
-
} ? T extends {
|
|
48
|
-
src: TSrc;
|
|
49
|
-
} ? ConditionalRequired<[options?: {
|
|
50
|
-
id?: T["id"];
|
|
51
|
-
systemId?: string;
|
|
52
|
-
input?: InputFrom<T["logic"]>;
|
|
53
|
-
syncSnapshot?: boolean;
|
|
54
|
-
} & { [K in RequiredActorOptions<T>]: unknown; }], IsNotNever<RequiredActorOptions<T>>> : never : never : never) | ({
|
|
55
|
-
src: "applyLatest";
|
|
56
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
57
|
-
id: string | undefined;
|
|
58
|
-
} extends infer T_1 ? T_1 extends {
|
|
59
|
-
src: "applyLatest";
|
|
60
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
61
|
-
id: string | undefined;
|
|
62
|
-
} ? T_1 extends {
|
|
63
|
-
src: TSrc;
|
|
64
|
-
} ? ConditionalRequired<[options?: {
|
|
65
|
-
id?: T_1["id"];
|
|
66
|
-
systemId?: string;
|
|
67
|
-
input?: InputFrom<T_1["logic"]>;
|
|
68
|
-
syncSnapshot?: boolean;
|
|
69
|
-
} & { [K_1 in RequiredActorOptions<T_1>]: unknown; }], IsNotNever<RequiredActorOptions<T_1>>> : never : never : never) | ({
|
|
70
|
-
src: "executeChange";
|
|
71
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
72
|
-
id: string | undefined;
|
|
73
|
-
} extends infer T_2 ? T_2 extends {
|
|
74
|
-
src: "executeChange";
|
|
75
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
76
|
-
id: string | undefined;
|
|
77
|
-
} ? T_2 extends {
|
|
78
|
-
src: TSrc;
|
|
79
|
-
} ? ConditionalRequired<[options?: {
|
|
80
|
-
id?: T_2["id"];
|
|
81
|
-
systemId?: string;
|
|
82
|
-
input?: InputFrom<T_2["logic"]>;
|
|
83
|
-
syncSnapshot?: boolean;
|
|
84
|
-
} & { [K_2 in RequiredActorOptions<T_2>]: unknown; }], IsNotNever<RequiredActorOptions<T_2>>> : never : never : never)): ActorRefFromLogic< GetConcreteByKey<Values<{
|
|
85
|
-
hotkey: {
|
|
86
|
-
src: "hotkey";
|
|
87
|
-
logic: HotkeyActorLogic;
|
|
88
|
-
id: "hotkey";
|
|
89
|
-
};
|
|
90
|
-
applyLatest: {
|
|
91
|
-
src: "applyLatest";
|
|
92
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
93
|
-
id: string | undefined;
|
|
94
|
-
};
|
|
95
|
-
executeChange: {
|
|
96
|
-
src: "executeChange";
|
|
97
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
98
|
-
id: string | undefined;
|
|
99
|
-
};
|
|
100
|
-
}>, "src", TSrc>["logic"]>;
|
|
101
|
-
<TLogic extends AnyActorLogic>(src: TLogic, ...[options]: ConditionalRequired<[options?: {
|
|
102
|
-
id?: never;
|
|
103
|
-
systemId?: string;
|
|
104
|
-
input?: InputFrom<TLogic>;
|
|
105
|
-
syncSnapshot?: boolean;
|
|
106
|
-
} & { [K in RequiredLogicInput<TLogic>]: unknown; }], IsNotNever<RequiredLogicInput<TLogic>>>): ActorRefFromLogic<TLogic>;
|
|
107
|
-
};
|
|
108
|
-
input: EditorActorInput;
|
|
109
|
-
self: ActorRef<MachineSnapshot<EditorActorContext, EditorActorEvent, Record<string, AnyActorRef | undefined>, StateValue, string, unknown, any, any>, EditorActorEvent, AnyEventObject>;
|
|
110
|
-
}) => {
|
|
111
|
-
viewId: t.ViewId;
|
|
112
|
-
beforeEditing: null;
|
|
113
|
-
editing: null;
|
|
114
|
-
pendingChanges: never[];
|
|
115
|
-
history: never[];
|
|
116
|
-
};
|
|
117
|
-
readonly initial: "idle";
|
|
118
|
-
readonly states: {
|
|
119
|
-
readonly idle: {
|
|
120
|
-
id: string;
|
|
121
|
-
on: {
|
|
122
|
-
sync: {
|
|
123
|
-
target: "#pending";
|
|
124
|
-
};
|
|
125
|
-
'edit.start': {
|
|
126
|
-
target: "#editing";
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
readonly editing: {
|
|
131
|
-
id: string;
|
|
132
|
-
tags: "pending";
|
|
133
|
-
entry: CancelAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>[];
|
|
134
|
-
on: {
|
|
135
|
-
change: {
|
|
136
|
-
target: "#executeChanges";
|
|
137
|
-
actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
138
|
-
hotkey: {
|
|
139
|
-
src: "hotkey";
|
|
140
|
-
logic: HotkeyActorLogic;
|
|
141
|
-
id: "hotkey";
|
|
142
|
-
};
|
|
143
|
-
applyLatest: {
|
|
144
|
-
src: "applyLatest";
|
|
145
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
146
|
-
id: string | undefined;
|
|
147
|
-
};
|
|
148
|
-
executeChange: {
|
|
149
|
-
src: "executeChange";
|
|
150
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
151
|
-
id: string | undefined;
|
|
152
|
-
};
|
|
153
|
-
}>, never, Values<{
|
|
154
|
-
"has pending": {
|
|
155
|
-
type: "has pending";
|
|
156
|
-
params: unknown;
|
|
157
|
-
};
|
|
158
|
-
"can undo": {
|
|
159
|
-
type: "can undo";
|
|
160
|
-
params: unknown;
|
|
161
|
-
};
|
|
162
|
-
}>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
|
|
163
|
-
};
|
|
164
|
-
'edit.finish': {
|
|
165
|
-
target: "#afterEdit";
|
|
166
|
-
actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
167
|
-
hotkey: {
|
|
168
|
-
src: "hotkey";
|
|
169
|
-
logic: HotkeyActorLogic;
|
|
170
|
-
id: "hotkey";
|
|
171
|
-
};
|
|
172
|
-
applyLatest: {
|
|
173
|
-
src: "applyLatest";
|
|
174
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
175
|
-
id: string | undefined;
|
|
176
|
-
};
|
|
177
|
-
executeChange: {
|
|
178
|
-
src: "executeChange";
|
|
179
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
180
|
-
id: string | undefined;
|
|
181
|
-
};
|
|
182
|
-
}>, never, Values<{
|
|
183
|
-
"has pending": {
|
|
184
|
-
type: "has pending";
|
|
185
|
-
params: unknown;
|
|
186
|
-
};
|
|
187
|
-
"can undo": {
|
|
188
|
-
type: "can undo";
|
|
189
|
-
params: unknown;
|
|
190
|
-
};
|
|
191
|
-
}>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
|
|
192
|
-
};
|
|
193
|
-
undo: {
|
|
194
|
-
target: "#idle";
|
|
195
|
-
actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
196
|
-
hotkey: {
|
|
197
|
-
src: "hotkey";
|
|
198
|
-
logic: HotkeyActorLogic;
|
|
199
|
-
id: "hotkey";
|
|
200
|
-
};
|
|
201
|
-
applyLatest: {
|
|
202
|
-
src: "applyLatest";
|
|
203
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
204
|
-
id: string | undefined;
|
|
205
|
-
};
|
|
206
|
-
executeChange: {
|
|
207
|
-
src: "executeChange";
|
|
208
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
209
|
-
id: string | undefined;
|
|
210
|
-
};
|
|
211
|
-
}>, never, Values<{
|
|
212
|
-
"has pending": {
|
|
213
|
-
type: "has pending";
|
|
214
|
-
params: unknown;
|
|
215
|
-
};
|
|
216
|
-
"can undo": {
|
|
217
|
-
type: "can undo";
|
|
218
|
-
params: unknown;
|
|
219
|
-
};
|
|
220
|
-
}>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
|
-
readonly pending: {
|
|
225
|
-
id: string;
|
|
226
|
-
tags: "pending"[];
|
|
227
|
-
entry: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
228
|
-
hotkey: {
|
|
229
|
-
src: "hotkey";
|
|
230
|
-
logic: HotkeyActorLogic;
|
|
231
|
-
id: "hotkey";
|
|
232
|
-
};
|
|
233
|
-
applyLatest: {
|
|
234
|
-
src: "applyLatest";
|
|
235
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
236
|
-
id: string | undefined;
|
|
237
|
-
};
|
|
238
|
-
executeChange: {
|
|
239
|
-
src: "executeChange";
|
|
240
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
241
|
-
id: string | undefined;
|
|
242
|
-
};
|
|
243
|
-
}>, never, Values<{
|
|
244
|
-
"has pending": {
|
|
245
|
-
type: "has pending";
|
|
246
|
-
params: unknown;
|
|
247
|
-
};
|
|
248
|
-
"can undo": {
|
|
249
|
-
type: "can undo";
|
|
250
|
-
params: unknown;
|
|
251
|
-
};
|
|
252
|
-
}>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
|
|
253
|
-
on: {
|
|
254
|
-
sync: {
|
|
255
|
-
target: "#pending";
|
|
256
|
-
reenter: true;
|
|
257
|
-
};
|
|
258
|
-
'edit.start': {
|
|
259
|
-
target: "#editing";
|
|
260
|
-
actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
261
|
-
hotkey: {
|
|
262
|
-
src: "hotkey";
|
|
263
|
-
logic: HotkeyActorLogic;
|
|
264
|
-
id: "hotkey";
|
|
265
|
-
};
|
|
266
|
-
applyLatest: {
|
|
267
|
-
src: "applyLatest";
|
|
268
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
269
|
-
id: string | undefined;
|
|
270
|
-
};
|
|
271
|
-
executeChange: {
|
|
272
|
-
src: "executeChange";
|
|
273
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
274
|
-
id: string | undefined;
|
|
275
|
-
};
|
|
276
|
-
}>, never, never, never, never>[];
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
after: {
|
|
280
|
-
waitBeforeSync: {
|
|
281
|
-
target: "#executeChanges";
|
|
282
|
-
actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
283
|
-
hotkey: {
|
|
284
|
-
src: "hotkey";
|
|
285
|
-
logic: HotkeyActorLogic;
|
|
286
|
-
id: "hotkey";
|
|
287
|
-
};
|
|
288
|
-
applyLatest: {
|
|
289
|
-
src: "applyLatest";
|
|
290
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
291
|
-
id: string | undefined;
|
|
292
|
-
};
|
|
293
|
-
executeChange: {
|
|
294
|
-
src: "executeChange";
|
|
295
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
296
|
-
id: string | undefined;
|
|
297
|
-
};
|
|
298
|
-
}>, never, never, never, never>[];
|
|
299
|
-
};
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
readonly afterEdit: {
|
|
303
|
-
id: string;
|
|
304
|
-
always: ({
|
|
305
|
-
target: "#pending";
|
|
306
|
-
guard: "has pending";
|
|
307
|
-
} | {
|
|
308
|
-
target: "#idle";
|
|
309
|
-
})[];
|
|
310
|
-
};
|
|
311
|
-
readonly applyLatestToManual: {
|
|
312
|
-
id: string;
|
|
313
|
-
entry: CancelAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>[];
|
|
314
|
-
initial: string;
|
|
315
|
-
on: {
|
|
316
|
-
'*': {
|
|
317
|
-
actions: LogAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>[];
|
|
318
|
-
};
|
|
319
|
-
};
|
|
320
|
-
states: {
|
|
321
|
-
call: {
|
|
322
|
-
invoke: {
|
|
323
|
-
src: "applyLatest";
|
|
324
|
-
input: ({ context }: {
|
|
325
|
-
context: EditorActorContext;
|
|
326
|
-
event: EditorActorEvent;
|
|
327
|
-
self: ActorRef<MachineSnapshot<EditorActorContext, EditorActorEvent, Record<string, AnyActorRef>, StateValue, string, unknown, any, any>, EditorActorEvent, AnyEventObject>;
|
|
328
|
-
}) => {
|
|
329
|
-
current: t.DiagramView | undefined;
|
|
330
|
-
viewId: t.ViewId;
|
|
331
|
-
};
|
|
332
|
-
onDone: {
|
|
333
|
-
actions: ActionFunction<EditorActorContext, DoneActorEvent<EditorCalls.ApplyLatestToManual.Output, string>, EditorActorEvent, undefined, never, never, never, "350ms" | "waitBeforeSync", never>;
|
|
334
|
-
target: string;
|
|
335
|
-
};
|
|
336
|
-
onError: {
|
|
337
|
-
target: "#idle";
|
|
338
|
-
actions: ( ActionFunction<EditorActorContext, ErrorActorEvent<unknown, string>, EditorActorEvent, undefined, Values<{
|
|
339
|
-
hotkey: {
|
|
340
|
-
src: "hotkey";
|
|
341
|
-
logic: HotkeyActorLogic;
|
|
342
|
-
id: "hotkey";
|
|
343
|
-
};
|
|
344
|
-
applyLatest: {
|
|
345
|
-
src: "applyLatest";
|
|
346
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
347
|
-
id: string | undefined;
|
|
348
|
-
};
|
|
349
|
-
executeChange: {
|
|
350
|
-
src: "executeChange";
|
|
351
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
352
|
-
id: string | undefined;
|
|
353
|
-
};
|
|
354
|
-
}>, never, never, never, never> | (({ event }: ActionArgs<EditorActorContext, ErrorActorEvent<unknown, string>, EditorActorEvent>) => void))[];
|
|
355
|
-
};
|
|
356
|
-
};
|
|
357
|
-
};
|
|
358
|
-
wait: {
|
|
359
|
-
entry: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
360
|
-
hotkey: {
|
|
361
|
-
src: "hotkey";
|
|
362
|
-
logic: HotkeyActorLogic;
|
|
363
|
-
id: "hotkey";
|
|
364
|
-
};
|
|
365
|
-
applyLatest: {
|
|
366
|
-
src: "applyLatest";
|
|
367
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
368
|
-
id: string | undefined;
|
|
369
|
-
};
|
|
370
|
-
executeChange: {
|
|
371
|
-
src: "executeChange";
|
|
372
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
373
|
-
id: string | undefined;
|
|
374
|
-
};
|
|
375
|
-
}>, never, never, never, never>;
|
|
376
|
-
after: {
|
|
377
|
-
'350ms': {
|
|
378
|
-
target: "#executeChanges";
|
|
379
|
-
actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
380
|
-
hotkey: {
|
|
381
|
-
src: "hotkey";
|
|
382
|
-
logic: HotkeyActorLogic;
|
|
383
|
-
id: "hotkey";
|
|
384
|
-
};
|
|
385
|
-
applyLatest: {
|
|
386
|
-
src: "applyLatest";
|
|
387
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
388
|
-
id: string | undefined;
|
|
389
|
-
};
|
|
390
|
-
executeChange: {
|
|
391
|
-
src: "executeChange";
|
|
392
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
393
|
-
id: string | undefined;
|
|
394
|
-
};
|
|
395
|
-
}>, never, Values<{
|
|
396
|
-
"has pending": {
|
|
397
|
-
type: "has pending";
|
|
398
|
-
params: unknown;
|
|
399
|
-
};
|
|
400
|
-
"can undo": {
|
|
401
|
-
type: "can undo";
|
|
402
|
-
params: unknown;
|
|
403
|
-
};
|
|
404
|
-
}>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>[];
|
|
405
|
-
};
|
|
406
|
-
};
|
|
407
|
-
};
|
|
408
|
-
};
|
|
409
|
-
};
|
|
410
|
-
readonly executeChanges: {
|
|
411
|
-
id: string;
|
|
412
|
-
entry: CancelAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>[];
|
|
413
|
-
invoke: {
|
|
414
|
-
src: "executeChange";
|
|
415
|
-
input: ({ context }: {
|
|
416
|
-
context: EditorActorContext;
|
|
417
|
-
event: EditorActorEvent;
|
|
418
|
-
self: ActorRef<MachineSnapshot<EditorActorContext, EditorActorEvent, Record<string, AnyActorRef>, StateValue, string, unknown, any, any>, EditorActorEvent, AnyEventObject>;
|
|
419
|
-
}) => {
|
|
420
|
-
changes: t.ViewChange[];
|
|
421
|
-
viewId: t.ViewId;
|
|
422
|
-
};
|
|
423
|
-
onDone: {
|
|
424
|
-
target: "#idle";
|
|
425
|
-
actions: ActionFunction<EditorActorContext, DoneActorEvent<NonReducibleUnknown, string>, EditorActorEvent, undefined, Values<{
|
|
426
|
-
hotkey: {
|
|
427
|
-
src: "hotkey";
|
|
428
|
-
logic: HotkeyActorLogic;
|
|
429
|
-
id: "hotkey";
|
|
430
|
-
};
|
|
431
|
-
applyLatest: {
|
|
432
|
-
src: "applyLatest";
|
|
433
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
434
|
-
id: string | undefined;
|
|
435
|
-
};
|
|
436
|
-
executeChange: {
|
|
437
|
-
src: "executeChange";
|
|
438
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
439
|
-
id: string | undefined;
|
|
440
|
-
};
|
|
441
|
-
}>, never, Values<{
|
|
442
|
-
"has pending": {
|
|
443
|
-
type: "has pending";
|
|
444
|
-
params: unknown;
|
|
445
|
-
};
|
|
446
|
-
"can undo": {
|
|
447
|
-
type: "can undo";
|
|
448
|
-
params: unknown;
|
|
449
|
-
};
|
|
450
|
-
}>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
|
|
451
|
-
};
|
|
452
|
-
onError: {
|
|
453
|
-
target: "#afterEdit";
|
|
454
|
-
actions: ({ event }: ActionArgs<EditorActorContext, ErrorActorEvent<unknown, string>, EditorActorEvent>) => void;
|
|
455
|
-
};
|
|
456
|
-
};
|
|
457
|
-
on: {
|
|
458
|
-
'*': {
|
|
459
|
-
actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, never, never, never, "350ms" | "waitBeforeSync", never>;
|
|
460
|
-
};
|
|
461
|
-
};
|
|
462
|
-
};
|
|
463
|
-
};
|
|
464
|
-
readonly on: {
|
|
465
|
-
readonly cancel: {
|
|
466
|
-
readonly target: "#idle";
|
|
467
|
-
readonly actions: readonly [ CancelAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>, ActionFunction<EditorActorContext, {
|
|
468
|
-
type: "cancel";
|
|
469
|
-
}, EditorActorEvent, undefined, Values<{
|
|
470
|
-
hotkey: {
|
|
471
|
-
src: "hotkey";
|
|
472
|
-
logic: HotkeyActorLogic;
|
|
473
|
-
id: "hotkey";
|
|
474
|
-
};
|
|
475
|
-
applyLatest: {
|
|
476
|
-
src: "applyLatest";
|
|
477
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
478
|
-
id: string | undefined;
|
|
479
|
-
};
|
|
480
|
-
executeChange: {
|
|
481
|
-
src: "executeChange";
|
|
482
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
483
|
-
id: string | undefined;
|
|
484
|
-
};
|
|
485
|
-
}>, never, never, never, never>];
|
|
486
|
-
};
|
|
487
|
-
readonly synced: {
|
|
488
|
-
readonly actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
489
|
-
hotkey: {
|
|
490
|
-
src: "hotkey";
|
|
491
|
-
logic: HotkeyActorLogic;
|
|
492
|
-
id: "hotkey";
|
|
493
|
-
};
|
|
494
|
-
applyLatest: {
|
|
495
|
-
src: "applyLatest";
|
|
496
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
497
|
-
id: string | undefined;
|
|
498
|
-
};
|
|
499
|
-
executeChange: {
|
|
500
|
-
src: "executeChange";
|
|
501
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
502
|
-
id: string | undefined;
|
|
503
|
-
};
|
|
504
|
-
}>, never, never, never, never>;
|
|
505
|
-
};
|
|
506
|
-
readonly undo: {
|
|
507
|
-
readonly target: "#idle";
|
|
508
|
-
readonly guard: "can undo";
|
|
509
|
-
readonly actions: ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
|
|
510
|
-
hotkey: {
|
|
511
|
-
src: "hotkey";
|
|
512
|
-
logic: HotkeyActorLogic;
|
|
513
|
-
id: "hotkey";
|
|
514
|
-
};
|
|
515
|
-
applyLatest: {
|
|
516
|
-
src: "applyLatest";
|
|
517
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
518
|
-
id: string | undefined;
|
|
519
|
-
};
|
|
520
|
-
executeChange: {
|
|
521
|
-
src: "executeChange";
|
|
522
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
523
|
-
id: string | undefined;
|
|
524
|
-
};
|
|
525
|
-
}>, never, Values<{
|
|
526
|
-
"has pending": {
|
|
527
|
-
type: "has pending";
|
|
528
|
-
params: unknown;
|
|
529
|
-
};
|
|
530
|
-
"can undo": {
|
|
531
|
-
type: "can undo";
|
|
532
|
-
params: unknown;
|
|
533
|
-
};
|
|
534
|
-
}>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
|
|
535
|
-
};
|
|
536
|
-
readonly change: {
|
|
537
|
-
readonly target: "#executeChanges";
|
|
538
|
-
};
|
|
539
|
-
readonly applyLatestToManual: {
|
|
540
|
-
readonly target: "#applyLatestToManual";
|
|
541
|
-
};
|
|
542
|
-
readonly reset: {
|
|
543
|
-
readonly target: "#idle";
|
|
544
|
-
readonly actions: readonly [ CancelAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>, ActionFunction<EditorActorContext, {
|
|
545
|
-
type: "reset";
|
|
546
|
-
}, EditorActorEvent, undefined, Values<{
|
|
547
|
-
hotkey: {
|
|
548
|
-
src: "hotkey";
|
|
549
|
-
logic: HotkeyActorLogic;
|
|
550
|
-
id: "hotkey";
|
|
551
|
-
};
|
|
552
|
-
applyLatest: {
|
|
553
|
-
src: "applyLatest";
|
|
554
|
-
logic: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
555
|
-
id: string | undefined;
|
|
556
|
-
};
|
|
557
|
-
executeChange: {
|
|
558
|
-
src: "executeChange";
|
|
559
|
-
logic: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
560
|
-
id: string | undefined;
|
|
561
|
-
};
|
|
562
|
-
}>, never, never, never, never>, StopAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>];
|
|
563
|
-
};
|
|
564
|
-
};
|
|
565
|
-
}>;
|
|
3
|
+
export declare function useEditorActorLogic(viewId: t.ViewId): EditorActorLogic;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
1
2
|
import { fromPromise } from 'xstate';
|
|
2
3
|
import { applyChangesToManualLayout } from './applyChangesToManualLayout.js';
|
|
3
|
-
import { editorActorLogic } from './editorActor.js';
|
|
4
|
-
import {
|
|
4
|
+
import { editorActorLogic } from './editorActor.states.js';
|
|
5
|
+
import { useOptionalLikeC4Editor } from './LikeC4EditorProvider.js';
|
|
5
6
|
import { useCallbackRef } from '../hooks/useCallbackRef.js';
|
|
6
7
|
|
|
7
8
|
function useEditorActorLogic(viewId) {
|
|
8
|
-
const port =
|
|
9
|
+
const port = useOptionalLikeC4Editor();
|
|
9
10
|
const applyLatest = useCallbackRef(
|
|
10
11
|
async ({ input: { viewId: viewId2, current } }) => {
|
|
11
12
|
if (!port) {
|
|
12
13
|
console.error("No editor port available for applying latest to manual layout");
|
|
13
14
|
return Promise.reject(new Error("No editor port"));
|
|
14
15
|
}
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
Promise.resolve().then(() => port.fetchView(viewId2, "auto"))
|
|
18
|
-
]).catch((err) => {
|
|
19
|
-
console.error("Failed to fetch views for applying latest to manual layout", err);
|
|
20
|
-
return Promise.reject(err);
|
|
21
|
-
});
|
|
16
|
+
const manual = await Promise.resolve().then(() => current ?? port.fetchView(viewId2, "manual"));
|
|
17
|
+
const latest = await Promise.resolve().then(() => port.fetchView(viewId2, "auto"));
|
|
22
18
|
const updated = applyChangesToManualLayout(manual, latest);
|
|
23
19
|
return {
|
|
24
20
|
updated
|
|
@@ -43,12 +39,12 @@ function useEditorActorLogic(viewId) {
|
|
|
43
39
|
return {};
|
|
44
40
|
}
|
|
45
41
|
);
|
|
46
|
-
return editorActorLogic.provide({
|
|
42
|
+
return useMemo(() => editorActorLogic.provide({
|
|
47
43
|
actors: {
|
|
48
44
|
applyLatest: fromPromise(applyLatest),
|
|
49
45
|
executeChange: fromPromise(executeChange)
|
|
50
46
|
}
|
|
51
|
-
});
|
|
47
|
+
}), [applyLatest, executeChange]);
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
export { useEditorActorLogic };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { useMantinePortalProps } from './useMantinePortalProps';
|
|
|
4
4
|
export { useMediaPrint } from './useMediaPrint';
|
|
5
5
|
export { useSetState } from './useSetState';
|
|
6
6
|
export { useUpdateEffect } from './useUpdateEffect';
|
|
7
|
-
export { useCurrentZoom, useIsZoomTooSmall, useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi } from './useXYFlow';
|
|
7
|
+
export { useCurrentZoom, useCurrentZoomAtLeast, useIsZoomTooSmall, useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi, } from './useXYFlow';
|
|
8
8
|
export type { XYFlowInstance, XYStoreApi, XYStoreState } from './useXYFlow';
|
|
9
9
|
export { useCurrentView, useCurrentViewId } from './useCurrentView';
|
|
10
10
|
export { useCurrentViewModel } from './useCurrentViewModel';
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memoizes a callback function so that it will not be recreated on every render.
|
|
3
|
+
* The returned function is guaranteed to be the same reference across renders.
|
|
4
|
+
* @param callback the callback function to memoize
|
|
5
|
+
* @returns the memoized callback function
|
|
6
|
+
*/
|
|
1
7
|
export declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | null | undefined): T;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { CurrentViewModel } from '../context/LikeC4ModelContext';
|
|
2
2
|
export type { CurrentViewModel };
|
|
3
|
+
/**
|
|
4
|
+
* Returns the current view model from the context, or null if no view model is found.
|
|
5
|
+
* @see useCurrentViewModel
|
|
6
|
+
*/
|
|
3
7
|
export declare function useOptionalCurrentViewModel(): CurrentViewModel | null;
|
|
8
|
+
/**
|
|
9
|
+
* Hook to get the current view model from the context.
|
|
10
|
+
* Throws an error if no view model is found in the context.
|
|
11
|
+
*
|
|
12
|
+
* @see useOptionalCurrentViewModel
|
|
13
|
+
*/
|
|
4
14
|
export declare function useCurrentViewModel(): CurrentViewModel;
|
package/dist/hooks/useDiagram.js
CHANGED
|
@@ -9,10 +9,10 @@ function useDiagramActorSnapshot(selector, compare = shallowEqual) {
|
|
|
9
9
|
const actorRef = useDiagramActorRef();
|
|
10
10
|
return useSelector(actorRef, selector, compare);
|
|
11
11
|
}
|
|
12
|
-
function useDiagramContext(selector, compare = shallowEqual, deps) {
|
|
12
|
+
function useDiagramContext(selector, compare = shallowEqual, deps = []) {
|
|
13
13
|
const actorRef = useDiagramActorRef();
|
|
14
14
|
const selectorRef = useCallbackRef(selector);
|
|
15
|
-
const select = useCallback((s) => selectorRef(s.context), deps
|
|
15
|
+
const select = useCallback((s) => selectorRef(s.context), deps);
|
|
16
16
|
return useSelector(actorRef, select, compare);
|
|
17
17
|
}
|
|
18
18
|
function useOnDiagramEvent(event, callback, options) {
|