@likec4/diagram 1.57.0 → 1.59.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/dist/LikeC4Diagram.js +1 -1
- package/dist/LikeC4Diagram.props.d.ts +1 -1
- package/dist/LikeC4Styles.js +1 -1
- package/dist/LikeC4View.js +2 -2
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/base/Base.d.ts +3 -2
- package/dist/base/Base.js +14 -26
- package/dist/base/BaseXYFlow.d.ts +2 -1
- package/dist/base/BaseXYFlow.js +63 -4
- package/dist/base/keyboardZoom.d.ts +3 -0
- package/dist/base/keyboardZoom.js +20 -0
- package/dist/base/updateEdges.js +7 -16
- package/dist/base/updateNodes.js +3 -9
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundActionButton.js +5 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +5 -2
- package/dist/base-primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundTitle.d.ts +7 -1
- package/dist/base-primitives/compound/CompoundTitle.js +2 -1
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +2 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -2
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -0
- package/dist/base-primitives/edge/EdgeLabel.js +2 -5
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeMarkers.d.ts +8 -8
- package/dist/base-primitives/element/ElementActionButtons.d.ts +2 -1
- package/dist/base-primitives/element/ElementActionButtons.js +4 -1
- package/dist/base-primitives/element/ElementData.d.ts +4 -2
- package/dist/base-primitives/element/ElementData.js +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +1 -1
- package/dist/base-primitives/element/ElementShape.d.ts +1 -1
- package/dist/base-primitives/element/ElementShape.js +3 -0
- package/dist/base-primitives/element/ElementTags.d.ts +1 -1
- package/dist/base-primitives/element/ElementTags.js +1 -3
- package/dist/components/ErrorFallback.d.ts +2 -2
- package/dist/components/ErrorFallback.js +3 -5
- package/dist/components/Link.js +6 -6
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +1 -1
- package/dist/components/PortalToContainer.d.ts +1 -1
- package/dist/components/RootContainer.d.ts +1 -1
- package/dist/components/SearchControl.css.js +11 -11
- package/dist/components/SearchControl.d.ts +2 -2
- package/dist/components/ViewNotFound.d.ts +2 -2
- package/dist/context/CurrentViewModelProvider.d.ts +1 -1
- package/dist/context/DefaultMantineProvider.d.ts +1 -1
- package/dist/context/DiagramEventHandlers.d.ts +1 -1
- package/dist/context/EnsureMantine.d.ts +1 -1
- package/dist/context/FramerMotionConfig.d.ts +3 -3
- package/dist/context/FramerMotionConfig.js +2 -2
- package/dist/context/IconRenderer.d.ts +2 -2
- package/dist/context/IconRenderer.js +32 -12
- package/dist/context/LikeC4ModelContext.d.ts +1 -1
- package/dist/context/TagStylesContext.d.ts +4 -3
- package/dist/context/TagStylesContext.js +20 -22
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/index.js +3 -2
- package/dist/editor/LikeC4EditorProvider.d.ts +2 -2
- package/dist/editor/actor/actions.d.ts +74 -15
- package/dist/editor/actor/actions.js +91 -25
- package/dist/editor/actor/hotkey.d.ts +1 -1
- package/dist/editor/actor/hotkey.js +7 -0
- package/dist/editor/actor/machine.d.ts +4 -6
- package/dist/editor/actor/machine.js +1 -0
- package/dist/editor/actor/setup.d.ts +25 -4
- package/dist/editor/actor/setup.js +8 -6
- package/dist/editor/actor/state.editor.d.ts +64 -14
- package/dist/editor/actor/state.editor.js +12 -11
- package/dist/editor/actor/state.sync-queue.d.ts +283 -91
- package/dist/editor/actor/state.sync-queue.js +93 -56
- package/dist/editor/actor/types.d.ts +6 -1
- package/dist/editor/actor/types.js +1 -1
- package/dist/editor/useEditorActorLogic.js +14 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/safeContext.d.ts +156 -3
- package/dist/hooks/safeContext.js +60 -12
- package/dist/hooks/useCurrentViewModel.js +1 -1
- package/dist/hooks/useDiagram.d.ts +8 -0
- package/dist/hooks/useDiagram.js +9 -2
- package/dist/hooks/useEditorActor.d.ts +5 -0
- package/dist/hooks/useEditorActor.js +4 -3
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +5 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -2
- package/dist/likec4diagram/DiagramUI.d.ts +1 -1
- package/dist/likec4diagram/DiagramUI.js +19 -6
- package/dist/likec4diagram/DiagramXYFlow.js +54 -17
- package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
- package/dist/likec4diagram/convert-to-xyflow.js +29 -10
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +140 -18
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +1 -0
- package/dist/likec4diagram/custom/edges/edges.css.js +6 -2
- package/dist/likec4diagram/custom/index.d.ts +2 -1
- package/dist/likec4diagram/custom/index.js +5 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +4 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +32 -19
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.ts +2 -0
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +234 -0
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +7 -7
- package/dist/likec4diagram/custom/nodes/nodes.js +20 -5
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.d.ts +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
- package/dist/likec4diagram/relationship-popover/components.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.js +11 -20
- package/dist/likec4diagram/state/aligners.js +1 -1
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/createViewChange.js +2 -1
- package/dist/likec4diagram/state/diagram-api.d.ts +18 -10
- package/dist/likec4diagram/state/diagram-api.js +333 -229
- package/dist/likec4diagram/state/machine.actions.d.ts +1026 -332
- package/dist/likec4diagram/state/machine.actions.js +118 -46
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +123 -51
- package/dist/likec4diagram/state/machine.actions.layout.js +40 -33
- package/dist/likec4diagram/state/machine.d.ts +154 -16
- package/dist/likec4diagram/state/machine.js +5 -41
- package/dist/likec4diagram/state/machine.setup.d.ts +84 -19
- package/dist/likec4diagram/state/machine.setup.js +65 -12
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +59 -33
- package/dist/likec4diagram/state/machine.state.navigating.js +7 -3
- package/dist/likec4diagram/state/machine.state.ready.d.ts +1540 -476
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +294 -53
- package/dist/likec4diagram/state/machine.state.ready.focused.js +3 -3
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +264 -73
- package/dist/likec4diagram/state/machine.state.ready.idle.js +31 -6
- package/dist/likec4diagram/state/machine.state.ready.js +22 -16
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +23 -9
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +288 -84
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +135 -66
- package/dist/likec4diagram/state/types.d.ts +4 -2
- package/dist/likec4diagram/state/utils.d.ts +7 -0
- package/dist/likec4diagram/state/utils.js +36 -34
- package/dist/likec4diagram/types.d.ts +49 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
- package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +1 -1
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +2 -2
- package/dist/likec4diagram/ui/index.d.ts +2 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -5
- package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +519 -0
- package/dist/likec4diagram/ui/sequence-outline/state.d.ts +36 -0
- package/dist/likec4diagram/ui/sequence-outline/state.js +55 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +116 -62
- package/dist/likec4diagram/xyflow-sequence/_types.d.ts +55 -5
- package/dist/likec4diagram/xyflow-sequence/const.d.ts +5 -5
- package/dist/likec4diagram/xyflow-sequence/const.js +4 -4
- package/dist/likec4diagram/xyflow-sequence/layouter.d.ts +30 -6
- package/dist/likec4diagram/xyflow-sequence/layouter.js +561 -0
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.d.ts → sequence-view-to-xy.d.ts} +8 -2
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.js → sequence-view-to-xy.js} +112 -14
- package/dist/likec4diagram/xyflow-sequence/sequence-view.d.ts +2 -7
- package/dist/likec4diagram/xyflow-sequence/sequence-view.js +144 -0
- package/dist/likec4diagram/xyflow-sequence/utils.d.ts +9 -1
- package/dist/likec4diagram/xyflow-sequence/utils.js +96 -0
- package/dist/navigationpanel/NavigationPanel.d.ts +5 -2
- package/dist/navigationpanel/NavigationPanel.js +58 -59
- package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +47 -40
- package/dist/navigationpanel/_common.d.ts +2 -2
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.actions.d.ts +19 -0
- package/dist/navigationpanel/actor.actions.js +45 -0
- package/dist/navigationpanel/actor.d.ts +34 -96
- package/dist/navigationpanel/actor.js +21 -84
- package/dist/navigationpanel/actor.setup.d.ts +98 -0
- package/dist/navigationpanel/actor.setup.js +31 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +4 -5
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.js +7 -8
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +1 -1
- package/dist/navigationpanel/controls/LogoButton.d.ts +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
- package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/EditorPanel.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +8 -8
- package/dist/navigationpanel/hooks.d.ts +20 -5
- package/dist/navigationpanel/hooks.js +4 -18
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +2 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -5
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +5 -5
- package/dist/overlays/Overlays.d.ts +4 -2
- package/dist/overlays/Overlays.js +10 -10
- package/dist/overlays/element-details/ElementDetails.d.ts +1 -1
- package/dist/overlays/element-details/ElementDetailsCard.css.js +17 -17
- package/dist/overlays/element-details/ElementDetailsCard.d.ts +1 -1
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -2
- package/dist/overlays/element-details/MetadataValue.js +15 -15
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -11
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelRelationships.js +1 -1
- package/dist/overlays/element-details/TabPanelStructure.css.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.d.ts +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +2 -3
- package/dist/overlays/hooks.d.ts +28 -0
- package/dist/overlays/hooks.js +5 -0
- package/dist/overlays/overlay/Overlay.js +34 -25
- package/dist/overlays/overlaysActor.js +0 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
- package/dist/overlays/relationship-details/SelectEdge.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +4 -4
- package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.d.ts +1 -1
- package/dist/overlays/relationships-browser/actor.js +79 -78
- package/dist/overlays/relationships-browser/custom/ElementActions.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/EmptyNode.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +4 -4
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.js +1 -1
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/projects-overview/ProjectsOverview.d.ts +1 -1
- package/dist/projects-overview/actor.js +4 -4
- package/dist/projects-overview/custom/nodeTypes.d.ts +1 -1
- package/dist/projects-overview/panel/ProjectsOverviewPanel.d.ts +1 -1
- package/dist/search/Search.d.ts +1 -1
- package/dist/search/Search.js +1 -1
- package/dist/search/XStateSearchAdapter.d.ts +1 -1
- package/dist/search/components/ElementsColumn.css.js +2 -2
- package/dist/search/components/ElementsColumn.d.ts +1 -1
- package/dist/search/components/PickView.d.ts +1 -1
- package/dist/search/components/SearchByTags.d.ts +1 -1
- package/dist/search/components/SearchInput.d.ts +1 -1
- package/dist/search/components/ViewsColum.d.ts +3 -3
- package/dist/search/components/ViewsColum.js +1 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +23 -23
- package/dist/search/components/styles.css.js +4 -4
- package/dist/shadowroot/ShadowRoot.d.ts +2 -3
- package/dist/shadowroot/ShadowRoot.js +95 -41
- package/dist/shadowroot/index.d.ts +1 -0
- package/dist/styles2.js +1 -1
- package/dist/utils/defineActors.d.ts +21 -0
- package/dist/utils/defineActors.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +5 -4
- package/dist/utils/readableText.d.ts +11 -0
- package/dist/utils/readableText.js +18 -0
- package/package.json +30 -43
- package/panda.buildinfo.json +271 -295
- package/styles-min.css +1 -1
- package/styles-xyflow.css +1 -1
- package/styles.css +1 -1
- package/adhoc-editor/package.json +0 -4
- package/dist/adhoc-editor/EditorPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorPanel.js +0 -106
- package/dist/adhoc-editor/ElementsTree.d.ts +0 -2
- package/dist/adhoc-editor/ElementsTree.js +0 -112
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +0 -4
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +0 -83
- package/dist/adhoc-editor/components/Tree.d.ts +0 -48
- package/dist/adhoc-editor/components/Tree.js +0 -213
- package/dist/adhoc-editor/hooks.d.ts +0 -14
- package/dist/adhoc-editor/hooks.js +0 -34
- package/dist/adhoc-editor/index.d.ts +0 -2
- package/dist/adhoc-editor/index.js +0 -2
- package/dist/adhoc-editor/state/ActorProvider.d.ts +0 -5
- package/dist/adhoc-editor/state/ActorProvider.js +0 -37
- package/dist/adhoc-editor/state/actor.d.ts +0 -13
- package/dist/adhoc-editor/state/actor.editor.d.ts +0 -56
- package/dist/adhoc-editor/state/actor.editor.js +0 -167
- package/dist/adhoc-editor/state/actor.js +0 -14
- package/dist/adhoc-editor/state/actor.layouter.d.ts +0 -51
- package/dist/adhoc-editor/state/actor.layouter.js +0 -54
- package/dist/adhoc-editor/state/actor.types.d.ts +0 -63
- package/dist/adhoc-editor/state/actor.types.js +0 -25
- package/dist/adhoc-editor/state/panel.d.ts +0 -95
- package/dist/adhoc-editor/state/panel.js +0 -124
- package/dist/adhoc-editor/state/utils.d.ts +0 -17
- package/dist/adhoc-editor/state/utils.js +0 -25
- package/dist/adhoc-editor/useElementsTree.d.ts +0 -18
- package/dist/adhoc-editor/useElementsTree.js +0 -98
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +0 -6
- package/dist/shadowroot/styles.css.d.ts +0 -12
- package/dist/shadowroot/styles.css.js +0 -59
|
@@ -72,7 +72,10 @@ function ElementNode(props) {
|
|
|
72
72
|
children: [
|
|
73
73
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
74
74
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
75
|
-
/* @__PURE__ */ jsx(ElementData, {
|
|
75
|
+
/* @__PURE__ */ jsx(ElementData, {
|
|
76
|
+
...props,
|
|
77
|
+
"aria-hidden": true
|
|
78
|
+
}),
|
|
76
79
|
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
77
80
|
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
78
81
|
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
@@ -89,7 +92,10 @@ function DeploymentNode(props) {
|
|
|
89
92
|
children: [
|
|
90
93
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
91
94
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
92
|
-
/* @__PURE__ */ jsx(ElementData, {
|
|
95
|
+
/* @__PURE__ */ jsx(ElementData, {
|
|
96
|
+
...props,
|
|
97
|
+
"aria-hidden": true
|
|
98
|
+
}),
|
|
93
99
|
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
94
100
|
/* @__PURE__ */ jsx(DeploymentElementActions, { ...props }),
|
|
95
101
|
enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
@@ -115,7 +121,10 @@ function CompoundElementNode(props) {
|
|
|
115
121
|
nodeProps: props,
|
|
116
122
|
children: [
|
|
117
123
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
118
|
-
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
124
|
+
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
125
|
+
...props,
|
|
126
|
+
"aria-hidden": true
|
|
127
|
+
}),
|
|
119
128
|
/* @__PURE__ */ jsx(CompoundActions, { ...props }),
|
|
120
129
|
enableElementDetails && /* @__PURE__ */ jsx(CompoundDetailsButtonWithHandler, { ...props }),
|
|
121
130
|
!enableReadOnly && /* @__PURE__ */ jsx(CompoundElementToolbar, { ...props }),
|
|
@@ -130,7 +139,10 @@ function CompoundDeploymentNode(props) {
|
|
|
130
139
|
nodeProps: props,
|
|
131
140
|
children: [
|
|
132
141
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
133
|
-
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
142
|
+
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
143
|
+
...props,
|
|
144
|
+
"aria-hidden": true
|
|
145
|
+
}),
|
|
134
146
|
/* @__PURE__ */ jsx(CompoundActions, { ...props }),
|
|
135
147
|
enableElementDetails && /* @__PURE__ */ jsx(CompoundDetailsButtonWithHandler, { ...props }),
|
|
136
148
|
!enableReadOnly && /* @__PURE__ */ jsx(CompoundDeploymentToolbar, { ...props }),
|
|
@@ -145,7 +157,10 @@ function ViewGroupNode(props) {
|
|
|
145
157
|
nodeProps: props,
|
|
146
158
|
children: [
|
|
147
159
|
enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
|
|
148
|
-
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
160
|
+
/* @__PURE__ */ jsx(CompoundTitle, {
|
|
161
|
+
...props,
|
|
162
|
+
"aria-hidden": true
|
|
163
|
+
}),
|
|
149
164
|
/* @__PURE__ */ jsx(DefaultHandles, { direction: props.data.viewLayoutDir })
|
|
150
165
|
]
|
|
151
166
|
});
|
|
@@ -8,15 +8,15 @@ type ColorButtonProps = Omit<PopoverProps, 'onChange'> & {
|
|
|
8
8
|
onColorPreview: (color: ThemeColor | null) => void;
|
|
9
9
|
onChange: OnStyleChange;
|
|
10
10
|
};
|
|
11
|
-
export declare function ColorButton({ elementColor, elementOpacity, onColorPreview, isOpacityEditable, onChange, ...props }: ColorButtonProps): import("react
|
|
11
|
+
export declare function ColorButton({ elementColor, elementOpacity, onColorPreview, isOpacityEditable, onChange, ...props }: ColorButtonProps): import("react").JSX.Element;
|
|
12
12
|
export declare function ColorSwatches({ theme, elementColor, onColorPreview, onChange, }: {
|
|
13
13
|
theme: LikeC4Theme;
|
|
14
14
|
elementColor: ThemeColor;
|
|
15
15
|
onColorPreview: (color: ThemeColor | null) => void;
|
|
16
16
|
onChange: (color: ThemeColor) => void;
|
|
17
|
-
}): import("react
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
18
|
export declare function OpacityOption({ elementOpacity, onOpacityChange, }: {
|
|
19
19
|
elementOpacity: number | undefined;
|
|
20
20
|
onOpacityChange: (opacity: number) => void;
|
|
21
|
-
}): import("react
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Types } from '../../../types';
|
|
2
|
-
export declare function CompoundElementToolbar(props: Types.NodeProps<'compound-element'>): import("react
|
|
3
|
-
export declare function CompoundDeploymentToolbar(props: Types.NodeProps<'compound-deployment'>): import("react
|
|
2
|
+
export declare function CompoundElementToolbar(props: Types.NodeProps<'compound-element'>): import("react").JSX.Element;
|
|
3
|
+
export declare function CompoundDeploymentToolbar(props: Types.NodeProps<'compound-deployment'>): import("react").JSX.Element;
|
|
@@ -4,5 +4,5 @@ export declare function ElementToolbar(props: Types.NodeProps<'element' | 'seq-a
|
|
|
4
4
|
data: {
|
|
5
5
|
modelFqn: Fqn;
|
|
6
6
|
};
|
|
7
|
-
}): import("react
|
|
8
|
-
export declare function DeploymentElementToolbar(props: Types.NodeProps<'deployment'>): import("react
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function DeploymentElementToolbar(props: Types.NodeProps<'deployment'>): import("react").JSX.Element;
|
|
@@ -5,4 +5,4 @@ export type ToolbarProps = Omit<NodeToolbarProps, 'title'> & {
|
|
|
5
5
|
nodeProps: BaseNodeProps;
|
|
6
6
|
title: ReactNode;
|
|
7
7
|
};
|
|
8
|
-
export declare function Toolbar({ title, children, nodeProps, ...props }: ToolbarProps): import("react
|
|
8
|
+
export declare function Toolbar({ title, children, nodeProps, ...props }: ToolbarProps): import("react").JSX.Element | null;
|
|
@@ -6,13 +6,13 @@ import { TooltipProps, PlaceholderPolymorphicProps } from '@mantine/core';
|
|
|
6
6
|
export declare const Tooltip: NamedExoticComponent< TooltipProps & RefAttributes<HTMLDivElement> & PlaceholderPolymorphicProps>;
|
|
7
7
|
export declare function BrowseRelationshipsButton({ fqn }: {
|
|
8
8
|
fqn: Fqn;
|
|
9
|
-
}): import("react
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
10
|
export declare function GoToSourceButton(props: MergeExclusive<{
|
|
11
11
|
elementId: Fqn;
|
|
12
12
|
}, {
|
|
13
13
|
deploymentId: DeploymentFqn;
|
|
14
|
-
}>): import("react
|
|
14
|
+
}>): import("react").JSX.Element | null;
|
|
15
15
|
export declare function BorderStyleOption({ elementBorderStyle, onChange, }: {
|
|
16
16
|
elementBorderStyle: BorderStyle | undefined;
|
|
17
17
|
onChange: OnStyleChange;
|
|
18
|
-
}): import("react
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -100,4 +100,4 @@ function BorderStyleOption({ elementBorderStyle = "none", onChange }) {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
|
-
export { BorderStyleOption, BrowseRelationshipsButton, GoToSourceButton };
|
|
103
|
+
export { BorderStyleOption, BrowseRelationshipsButton, GoToSourceButton, Tooltip$1 as Tooltip };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const RelationshipPopover: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const RelationshipPopover: MemoExoticComponent<() => import("react").JSX.Element | null>;
|
|
@@ -3,8 +3,8 @@ import { roundDpr } from "../../utils/roundDpr.js";
|
|
|
3
3
|
import { useRootContainerRef } from "../../context/RootContainerContext.js";
|
|
4
4
|
import { useDiagramEventHandlers } from "../../context/DiagramEventHandlers.js";
|
|
5
5
|
import { useEnabledFeatures } from "../../context/DiagramFeatures.js";
|
|
6
|
-
import { useDiagram } from "../../hooks/safeContext.js";
|
|
7
|
-
import {
|
|
6
|
+
import { selectDiagramContext, useDiagram, useDiagramSelector } from "../../hooks/safeContext.js";
|
|
7
|
+
import { useOnDiagramEvent } from "../../hooks/useDiagram.js";
|
|
8
8
|
import { useLikeC4Model } from "../../hooks/useLikeC4Model.js";
|
|
9
9
|
import { findDiagramEdge, findDiagramNode } from "../state/utils.js";
|
|
10
10
|
import { Markdown } from "../../base-primitives/Markdown.js";
|
|
@@ -25,7 +25,7 @@ import { Box as Box$1, HStack, VStack, styled } from "@likec4/styles/jsx";
|
|
|
25
25
|
import { bleed } from "@likec4/styles/patterns";
|
|
26
26
|
import { autoPlacement, autoUpdate, computePosition, hide, offset, size } from "@floating-ui/dom";
|
|
27
27
|
//#region src/likec4diagram/relationship-popover/RelationshipPopover.tsx
|
|
28
|
-
|
|
28
|
+
var selector = selectDiagramContext((c) => {
|
|
29
29
|
let selected = null;
|
|
30
30
|
for (const edge of c.xyedges) if (edge.selected) {
|
|
31
31
|
if (selected) {
|
|
@@ -38,12 +38,12 @@ function selectDiagramContext(c) {
|
|
|
38
38
|
viewId: c.view.id,
|
|
39
39
|
selected
|
|
40
40
|
};
|
|
41
|
-
}
|
|
41
|
+
});
|
|
42
42
|
var RelationshipPopover = memo(() => {
|
|
43
43
|
const likec4model = useLikeC4Model();
|
|
44
44
|
const actorRef = useActorRef(RelationshipPopoverActorLogic);
|
|
45
45
|
const diagram = useDiagram();
|
|
46
|
-
const { viewId, selected } =
|
|
46
|
+
const { viewId, selected } = useDiagramSelector(selector);
|
|
47
47
|
const openedEdgeId = useSelector(actorRef, (s) => s.hasTag("opened") ? s.context.edgeId : null);
|
|
48
48
|
useOnDiagramEvent("navigateTo", () => {
|
|
49
49
|
actorRef.send({ type: "close" });
|
|
@@ -95,14 +95,14 @@ var RelationshipPopover = memo(() => {
|
|
|
95
95
|
diagram,
|
|
96
96
|
openedEdgeId
|
|
97
97
|
]);
|
|
98
|
-
const { diagramEdge, sourceNode, targetNode } =
|
|
98
|
+
const { diagramEdge, sourceNode, targetNode } = useDiagramSelector(useCallback(({ context: ctx }) => {
|
|
99
99
|
const diagramEdge = openedEdgeId ? findDiagramEdge(ctx, openedEdgeId) : null;
|
|
100
100
|
return {
|
|
101
101
|
diagramEdge,
|
|
102
102
|
sourceNode: diagramEdge ? findDiagramNode(ctx, diagramEdge.source) : null,
|
|
103
103
|
targetNode: diagramEdge ? findDiagramNode(ctx, diagramEdge.target) : null
|
|
104
104
|
};
|
|
105
|
-
},
|
|
105
|
+
}, [openedEdgeId]), shallowEqual);
|
|
106
106
|
if (!diagramEdge || !sourceNode || !targetNode || isEmpty(diagramEdge.relations)) return null;
|
|
107
107
|
const [direct, nested] = pipe(diagramEdge.relations, map((id) => {
|
|
108
108
|
try {
|
|
@@ -340,8 +340,8 @@ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode
|
|
|
340
340
|
gap: "1",
|
|
341
341
|
rounded: "sm",
|
|
342
342
|
backgroundColor: { _hover: {
|
|
343
|
-
base: "mantine.
|
|
344
|
-
_dark: "mantine.
|
|
343
|
+
base: "mantine.gray[1]",
|
|
344
|
+
_dark: "mantine.dark[5]/70"
|
|
345
345
|
} }
|
|
346
346
|
}),
|
|
347
347
|
children: [
|
|
@@ -448,7 +448,7 @@ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode
|
|
|
448
448
|
className: css({
|
|
449
449
|
userSelect: "all",
|
|
450
450
|
wordBreak: "break-word",
|
|
451
|
-
minWidth: 0
|
|
451
|
+
minWidth: "0"
|
|
452
452
|
}),
|
|
453
453
|
children: r.kind
|
|
454
454
|
})]
|
|
@@ -460,7 +460,7 @@ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode
|
|
|
460
460
|
className: css({
|
|
461
461
|
userSelect: "all",
|
|
462
462
|
wordBreak: "break-word",
|
|
463
|
-
minWidth: 0
|
|
463
|
+
minWidth: "0"
|
|
464
464
|
}),
|
|
465
465
|
children: r.technology
|
|
466
466
|
})]
|
|
@@ -469,10 +469,11 @@ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode
|
|
|
469
469
|
css: {
|
|
470
470
|
paddingLeft: "2.5",
|
|
471
471
|
py: "1.5",
|
|
472
|
-
|
|
472
|
+
borderLeftWidth: "2",
|
|
473
|
+
borderLeftStyle: "dotted",
|
|
473
474
|
borderLeftColor: {
|
|
474
|
-
base: "mantine.
|
|
475
|
-
_dark: "mantine.
|
|
475
|
+
base: "mantine.gray[3]",
|
|
476
|
+
_dark: "mantine.dark[4]"
|
|
476
477
|
}
|
|
477
478
|
},
|
|
478
479
|
children: /* @__PURE__ */ jsx(Markdown, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Color } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
import { StyledComponent } from '
|
|
3
|
+
import { StyledComponent } from '../../../styled-system/types';
|
|
4
4
|
export declare const Endpoint: ({ children, likec4color }: PropsWithChildren<{
|
|
5
5
|
likec4color: Color;
|
|
6
|
-
}>) => import("react
|
|
6
|
+
}>) => import("react").JSX.Element;
|
|
7
7
|
export declare const RelationshipTitle: StyledComponent<"div", {}>;
|
|
@@ -11,4 +11,4 @@ export declare function DiagramActorProvider({ id, view, zoomable, pannable, nod
|
|
|
11
11
|
fitViewPadding: ViewPaddings;
|
|
12
12
|
where?: WhereOperator | null;
|
|
13
13
|
dynamicViewVariant?: DynamicViewDisplayVariant | undefined;
|
|
14
|
-
}>): import("react
|
|
14
|
+
}>): import("react").JSX.Element;
|
|
@@ -2,14 +2,13 @@ import "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { useUpdateEffect } from "../../hooks/useUpdateEffect.js";
|
|
3
3
|
import { useDiagramEventHandlersRef } from "../../context/DiagramEventHandlers.js";
|
|
4
4
|
import { DiagramFeatures, useEnabledFeatures } from "../../context/DiagramFeatures.js";
|
|
5
|
-
import { DiagramActorContextProvider, DiagramApiContextProvider, useDiagram } from "../../hooks/safeContext.js";
|
|
6
|
-
import {
|
|
7
|
-
import { ErrorBoundary } from "../../components/ErrorFallback.js";
|
|
8
|
-
import { useEditorActorLogic } from "../../editor/useEditorActorLogic.js";
|
|
9
|
-
import { makeDiagramApi } from "./diagram-api.js";
|
|
5
|
+
import { DiagramActorContextProvider, DiagramApiContextProvider, selectDiagramContext, useDiagram, useDiagramSelector } from "../../hooks/safeContext.js";
|
|
6
|
+
import { useOnDiagramEvent } from "../../hooks/useDiagram.js";
|
|
10
7
|
import { DiagramToggledFeaturesPersistence } from "./persistence.js";
|
|
8
|
+
import { useEditorActorLogic } from "../../editor/useEditorActorLogic.js";
|
|
9
|
+
import { DiagramApi } from "./diagram-api.js";
|
|
11
10
|
import { diagramMachine } from "./machine.js";
|
|
12
|
-
import { memo, useEffect, useRef
|
|
11
|
+
import { memo, useEffect, useRef } from "react";
|
|
13
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { useStoreApi } from "@xyflow/react";
|
|
15
14
|
import { isNullish } from "remeda";
|
|
@@ -17,9 +16,9 @@ import { useActorRef } from "@xstate/react";
|
|
|
17
16
|
//#region src/likec4diagram/state/DiagramActorProvider.tsx
|
|
18
17
|
function DiagramActorProvider({ id, view, zoomable, pannable, nodesDraggable, nodesSelectable, fitViewPadding, where = null, children, dynamicViewVariant: _defaultVariant }) {
|
|
19
18
|
const xystore = useStoreApi();
|
|
20
|
-
const
|
|
19
|
+
const editor = useEditorActorLogic();
|
|
21
20
|
const features = useEnabledFeatures();
|
|
22
|
-
const actor = useActorRef(diagramMachine.provide({ actors: {
|
|
21
|
+
const actor = useActorRef(diagramMachine.provide({ actors: { editor } }), {
|
|
23
22
|
id: `diagram-${id}`,
|
|
24
23
|
systemId: "diagram",
|
|
25
24
|
input: {
|
|
@@ -43,14 +42,6 @@ function DiagramActorProvider({ id, view, zoomable, pannable, nodesDraggable, no
|
|
|
43
42
|
});
|
|
44
43
|
actorRef.current = actor;
|
|
45
44
|
}
|
|
46
|
-
const [api, setApi] = useState(() => makeDiagramApi(actorRef));
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
setApi((api) => {
|
|
49
|
-
if (api.ref === actorRef) return api;
|
|
50
|
-
console.error("DiagramMachine actorRef changed, creating new DiagramApi instance, this should not happen during the lifetime of the actor");
|
|
51
|
-
return makeDiagramApi(actorRef);
|
|
52
|
-
});
|
|
53
|
-
}, [actorRef]);
|
|
54
45
|
useEffect(() => {
|
|
55
46
|
actor.send({
|
|
56
47
|
type: "update.features",
|
|
@@ -91,12 +82,12 @@ function DiagramActorProvider({ id, view, zoomable, pannable, nodesDraggable, no
|
|
|
91
82
|
return /* @__PURE__ */ jsx(DiagramActorContextProvider, {
|
|
92
83
|
value: actor,
|
|
93
84
|
children: /* @__PURE__ */ jsxs(DiagramApiContextProvider, {
|
|
94
|
-
value:
|
|
95
|
-
children: [/* @__PURE__ */ jsx(
|
|
85
|
+
value: DiagramApi.withActor(actorRef),
|
|
86
|
+
children: [/* @__PURE__ */ jsx(ToggledFeatures, { children }), /* @__PURE__ */ jsx(PropagateDiagramActorEvents, {})]
|
|
96
87
|
})
|
|
97
88
|
});
|
|
98
89
|
}
|
|
99
|
-
var selectToggledFeatures =
|
|
90
|
+
var selectToggledFeatures = selectDiagramContext((context) => {
|
|
100
91
|
let toggledFeatures = context.toggledFeatures;
|
|
101
92
|
const enableCompareWithLatest = context.view.drifts != null && context.view.drifts.length > 0 && context.features.enableCompareWithLatest && (toggledFeatures.enableCompareWithLatest ?? false) && isNullish(context.activeWalkthrough);
|
|
102
93
|
const enableReadOnly = context.features.enableReadOnly || toggledFeatures.enableReadOnly || !!context.activeWalkthrough || enableCompareWithLatest && context.view._layout === "auto";
|
|
@@ -108,7 +99,7 @@ var selectToggledFeatures = selectDiagramActorContext((context) => {
|
|
|
108
99
|
return toggledFeatures;
|
|
109
100
|
});
|
|
110
101
|
function ToggledFeatures({ children }) {
|
|
111
|
-
const toggledFeatures =
|
|
102
|
+
const toggledFeatures = useDiagramSelector(selectToggledFeatures);
|
|
112
103
|
useUpdateEffect(() => {
|
|
113
104
|
DiagramToggledFeaturesPersistence.write(toggledFeatures);
|
|
114
105
|
}, [toggledFeatures]);
|
|
@@ -18,7 +18,7 @@ export declare function mergeXYNodesEdges(context: Pick<DiagramContext, 'xynodes
|
|
|
18
18
|
view: LayoutedView;
|
|
19
19
|
};
|
|
20
20
|
export declare function focusNodesEdges(context: DiagramContext): {
|
|
21
|
-
xynodes: Types.Node<"element" | "deployment" | "compound-element" | "compound-deployment" | "view-group" | "seq-actor" | "seq-parallel">[];
|
|
21
|
+
xynodes: Types.Node<"element" | "deployment" | "compound-element" | "compound-deployment" | "view-group" | "seq-actor" | "seq-parallel" | "seq-subflow">[];
|
|
22
22
|
xyedges: Types.Edge<"relationship" | "seq-step">[];
|
|
23
23
|
} | null;
|
|
24
24
|
export declare function updateNodeData({ context, event }: ActionArg): Partial<DiagramContext>;
|
|
@@ -27,7 +27,7 @@ function mergeXYNodesEdges(context, event) {
|
|
|
27
27
|
function focusNodesEdges(context) {
|
|
28
28
|
const { xynodes: _xynodes, xyedges: _xyedges, focusedNode } = context;
|
|
29
29
|
if (!focusedNode) return null;
|
|
30
|
-
const focused = new Set([focusedNode]);
|
|
30
|
+
const focused = /* @__PURE__ */ new Set([focusedNode]);
|
|
31
31
|
const xyedges = _xyedges.map((edge) => {
|
|
32
32
|
if (edge.source === focusedNode || edge.target === focusedNode) {
|
|
33
33
|
focused.add(edge.source);
|
|
@@ -14,7 +14,7 @@ function createViewChange(parentContext) {
|
|
|
14
14
|
console.error(`Internal node not found for ${node.id}`);
|
|
15
15
|
return node;
|
|
16
16
|
}
|
|
17
|
-
const xynodedata = xynodes.find((n) => n.id === node.id)?.data ?? internal.data;
|
|
17
|
+
const xynodedata = xynodes.find((n) => n.data.id === node.id)?.data ?? internal.data;
|
|
18
18
|
const position = internal.internals.positionAbsolute;
|
|
19
19
|
const { width, height } = getNodeDimensions(internal);
|
|
20
20
|
if (!isSamePoint(position, node) || node.width !== width || node.height !== height) movedNodes.add(node.id);
|
|
@@ -50,6 +50,7 @@ function createViewChange(parentContext) {
|
|
|
50
50
|
height: Math.round(data.labelBBox.height)
|
|
51
51
|
};
|
|
52
52
|
else _updated.labelBBox = null;
|
|
53
|
+
if (data.isLabelCustomized !== void 0) _updated.isLabelCustomized = data.isLabelCustomized;
|
|
53
54
|
if (hasAtLeast(controlPoints, 1)) _updated.controlPoints = map(controlPoints, (v) => ({
|
|
54
55
|
x: Math.round(v.x),
|
|
55
56
|
y: Math.round(v.y)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicViewDisplayVariant, NodeNotation as ElementNotation, ViewChange } from '@likec4/core/types';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
3
|
import { PartialDeep } from 'type-fest';
|
|
4
|
-
import {
|
|
4
|
+
import { TogglableFeature } from '../../context/DiagramFeatures';
|
|
5
5
|
import { EditorActorRef } from '../../editor/actor/machine';
|
|
6
6
|
import { OpenSourceParams } from '../../LikeC4Diagram.props';
|
|
7
7
|
import { OverlaysActorRef } from '../../overlays/overlaysActor';
|
|
@@ -16,19 +16,22 @@ type ViewId<A> = t.aux.ViewId<A>;
|
|
|
16
16
|
type Fqn<A> = t.aux.Fqn<A>;
|
|
17
17
|
type NodeId = t.aux.NodeId;
|
|
18
18
|
type EdgeId = t.aux.EdgeId;
|
|
19
|
-
export
|
|
19
|
+
export declare class DiagramApi<A extends Any = Unknown> {
|
|
20
|
+
private static cache;
|
|
21
|
+
static withActor(actorRef: RefObject<DiagramActorRef>): DiagramApi;
|
|
20
22
|
/**
|
|
21
23
|
* React ref to the diagram actor
|
|
22
24
|
*/
|
|
23
25
|
readonly ref: RefObject<DiagramActorRef>;
|
|
26
|
+
private constructor();
|
|
24
27
|
/**
|
|
25
28
|
* @warning Do not use in render phase
|
|
26
29
|
*/
|
|
27
|
-
|
|
30
|
+
get actor(): DiagramActorRef;
|
|
28
31
|
/**
|
|
29
32
|
* @warning Do not use in render phase
|
|
30
33
|
*/
|
|
31
|
-
|
|
34
|
+
get currentView(): t.DiagramView<A>;
|
|
32
35
|
/**
|
|
33
36
|
* Editor actor reference
|
|
34
37
|
* @warning Do not use in render phase
|
|
@@ -70,7 +73,7 @@ export interface DiagramApi<A extends Any = Unknown> {
|
|
|
70
73
|
/**
|
|
71
74
|
* If running in editor, trigger opening source file
|
|
72
75
|
*/
|
|
73
|
-
openSource(params: OpenSourceParams<
|
|
76
|
+
openSource(params: OpenSourceParams<Unknown>): void;
|
|
74
77
|
/**
|
|
75
78
|
* Open element details card
|
|
76
79
|
*/
|
|
@@ -137,18 +140,23 @@ export interface DiagramApi<A extends Any = Unknown> {
|
|
|
137
140
|
* @warning Do not use in render phase
|
|
138
141
|
*/
|
|
139
142
|
findDiagramEdge(xyedgeId: string): t.DiagramEdge<A> | null;
|
|
140
|
-
startWalkthrough(): void;
|
|
141
|
-
walkthroughStep(
|
|
143
|
+
startWalkthrough(stepId?: t.StepPath): void;
|
|
144
|
+
walkthroughStep(value?: 'next' | 'prev' | {
|
|
145
|
+
step: t.StepPath;
|
|
146
|
+
}): void;
|
|
142
147
|
stopWalkthrough(): void;
|
|
143
|
-
toggleFeature(feature:
|
|
148
|
+
toggleFeature(feature: TogglableFeature, forceValue?: boolean): void;
|
|
144
149
|
highlightNotation(notation: ElementNotation, kind?: string): void;
|
|
145
150
|
unhighlightNotation(): void;
|
|
146
151
|
openSearch(searchValue?: string): void;
|
|
147
|
-
triggerChange(
|
|
152
|
+
triggerChange(change: ViewChange): void;
|
|
148
153
|
/**
|
|
149
154
|
* Switch dynamic view display variant
|
|
150
155
|
*/
|
|
151
156
|
switchDynamicViewVariant(variant: DynamicViewDisplayVariant): void;
|
|
157
|
+
/**
|
|
158
|
+
* Toggle sequence flow collapse/expand
|
|
159
|
+
*/
|
|
160
|
+
toggleSequenceFlow(flowId: t.StepPath): void;
|
|
152
161
|
}
|
|
153
|
-
export declare function makeDiagramApi<A extends Any = Unknown>(actorRef: RefObject<DiagramActorRef>): DiagramApi<A>;
|
|
154
162
|
export {};
|