@likec4/diagram 1.58.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/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/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/element/ElementActionButtons.d.ts +1 -0
- package/dist/base-primitives/element/ElementActionButtons.js +4 -1
- package/dist/base-primitives/element/ElementData.d.ts +3 -1
- 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.js +3 -0
- package/dist/components/ErrorFallback.js +3 -5
- package/dist/components/Link.js +6 -6
- package/dist/components/NavigationPanel.js +1 -1
- package/dist/components/SearchControl.css.js +11 -11
- package/dist/context/TagStylesContext.d.ts +3 -3
- package/dist/context/TagStylesContext.js +16 -16
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/index.js +3 -2
- package/dist/editor/actor/actions.js +1 -1
- package/dist/editor/actor/machine.d.ts +4 -6
- package/dist/editor/actor/setup.d.ts +16 -2
- package/dist/editor/actor/setup.js +5 -4
- 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.js +1 -1
- 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 +1 -1
- package/dist/index.js +2 -2
- package/dist/likec4diagram/DiagramUI.js +19 -6
- package/dist/likec4diagram/DiagramXYFlow.js +39 -14
- package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
- package/dist/likec4diagram/convert-to-xyflow.js +29 -10
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +13 -4
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
- package/dist/likec4diagram/custom/edges/edges.css.js +1 -1
- package/dist/likec4diagram/custom/index.d.ts +2 -1
- package/dist/likec4diagram/custom/index.js +5 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
- 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.js +20 -5
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
- package/dist/likec4diagram/relationship-popover/components.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 +1 -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 +115 -44
- 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 +47 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
- package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
- 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/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 +112 -60
- 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} +111 -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/NavigationPanelDropdown.js +45 -38
- 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/DriftsSummary.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +7 -8
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +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.js +2 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +4 -4
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
- 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/ElementDetailsCard.css.js +17 -17
- 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.js +1 -1
- package/dist/overlays/element-details/TabPanelStructure.css.js +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/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +79 -78
- 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/actor.js +4 -4
- package/dist/search/Search.js +1 -1
- package/dist/search/components/ElementsColumn.css.js +2 -2
- 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 +1 -1
- package/dist/shadowroot/ShadowRoot.js +76 -28
- 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 +18 -30
- package/panda.buildinfo.json +267 -288
- package/styles-min.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/context/ShadowRootContext.d.ts +0 -3
- package/dist/context/ShadowRootContext.js +0 -5
- package/dist/shadowroot/styles.d.ts +0 -13
- package/dist/shadowroot/styles.js +0 -60
|
@@ -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);
|
|
@@ -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 {};
|