@likec4/diagram 1.27.3 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +974 -1036
- package/dist/LikeC4CustomColors.js +2 -2
- package/dist/LikeC4Diagram.js +2 -2
- package/dist/LikeC4ModelProvider.js +1 -1
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/react.production.js +3 -0
- package/dist/base/BaseXYFlow.js +5 -5
- package/dist/base/primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base/primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.js +2 -2
- package/dist/base/primitives/customEdge.js +2 -2
- package/dist/base/primitives/customNode.js +2 -2
- package/dist/base/primitives/edge/EdgeActionButton.d.ts +1 -2
- package/dist/base/primitives/edge/EdgeContainer.js +1 -1
- package/dist/base/primitives/edge/EdgeLabel.js +1 -1
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -1
- package/dist/base/primitives/edge/EdgePath.d.ts +10 -42
- package/dist/base/primitives/edge/EdgePath.js +23 -16
- package/dist/base/primitives/edge/edge.css.js +1 -1
- package/dist/base/primitives/element/ElementActionButtons.d.ts +1 -1
- package/dist/base/primitives/element/ElementActionButtons.js +6 -5
- package/dist/base/primitives/element/ElementDetailsButton.js +5 -2
- package/dist/base/primitives/element/ElementNodeContainer.js +3 -3
- package/dist/base/updateEdges.js +7 -2
- package/dist/base/updateNodes.js +11 -3
- package/dist/bundle/LikeC4View.js +3 -3
- package/dist/bundle/ReactLikeC4.js +1 -1
- package/dist/bundle/ShadowRoot.js +3 -3
- package/dist/bundle/styles.css.js +4 -4
- package/dist/context/ControlsCustomLayout.js +1 -1
- package/dist/context/DiagramEventHandlers.js +5 -5
- package/dist/context/DiagramFeatures.js +7 -7
- package/dist/context/EnsureMantine.js +2 -2
- package/dist/context/FramerMotionConfig.js +2 -2
- package/dist/context/IconRenderer.js +4 -4
- package/dist/context/ReduceGraphics.js +2 -2
- package/dist/context/RootContainer.js +5 -9
- package/dist/hooks/safeContext.js +3 -3
- package/dist/hooks/useCurrentViewId.js +1 -1
- package/dist/hooks/useDiagram.d.ts +3 -7
- package/dist/hooks/useDiagram.js +2 -2
- package/dist/hooks/useMantinePortalProps.js +2 -2
- package/dist/hooks/useSetState.js +3 -3
- package/dist/hooks/useUpdateEffect.js +1 -1
- package/dist/likec4diagram/DiagramUI.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +2 -2
- package/dist/likec4diagram/custom/edges/NotePopover.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +17 -7
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +6 -6
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +4 -4
- package/dist/likec4diagram/ui/controls/Controls.js +6 -6
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +1 -1
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +4 -5
- package/dist/likec4diagram/ui/search/ElementsColumn.js +88 -77
- package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +2 -1
- package/dist/likec4diagram/ui/search/LikeC4Search.js +27 -24
- package/dist/likec4diagram/ui/search/SearchInput.js +1 -1
- package/dist/likec4diagram/ui/search/ViewsColum.js +3 -2
- package/dist/likec4diagram/ui/search/state.js +11 -9
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +1 -1
- package/dist/likec4diagram/useLayoutConstraints.js +3 -3
- package/dist/likec4model/LikeC4ModelContext.js +2 -2
- package/dist/likec4model/useLikeC4ElementsTree.js +2 -2
- package/dist/likec4model/useLikeC4Model.js +2 -2
- package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react.production.js +548 -0
- package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/index.js +15 -0
- package/dist/overlays/Overlays.js +8 -8
- package/dist/overlays/element-details/ElementDetailsCard.js +5 -5
- package/dist/overlays/element-details/TabPanelDeployments.js +7 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +6 -3
- package/dist/overlays/element-details/actor.d.ts +301 -301
- package/dist/overlays/element-details/actorContext.js +3 -3
- package/dist/overlays/overlay/Overlay.css.d.ts +2 -25
- package/dist/overlays/overlay/Overlay.css.js +0 -40
- package/dist/overlays/overlay/Overlay.d.ts +1 -1
- package/dist/overlays/overlay/Overlay.js +99 -89
- package/dist/overlays/overlaysActor.js +4 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +28 -23
- package/dist/overlays/relationship-details/SelectEdge.js +3 -6
- package/dist/overlays/relationship-details/actor.d.ts +2 -0
- package/dist/overlays/relationship-details/custom/edgeTypes.js +1 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/hooks.d.ts +3 -1
- package/dist/overlays/relationship-details/hooks.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +9 -11
- package/dist/overlays/relationships-browser/SelectElement.js +8 -5
- package/dist/overlays/relationships-browser/actor.d.ts +1 -1
- package/dist/overlays/relationships-browser/actor.js +6 -12
- package/dist/overlays/relationships-browser/const.d.ts +2 -1
- package/dist/overlays/relationships-browser/const.js +6 -1
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +3 -4
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +2 -2
- package/dist/overlays/relationships-browser/hooks.d.ts +1 -1
- package/dist/overlays/relationships-browser/hooks.js +4 -4
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -2
- package/dist/state/DiagramActorProvider.js +5 -3
- package/dist/state/diagram-machine.d.ts +2 -2
- package/dist/state/diagram-machine.js +3 -4
- package/dist/state/hotkeyActor.js +12 -3
- package/dist/styles.css.js +1 -1
- package/package.json +21 -17
- package/src/base/BaseXYFlow.tsx +2 -2
- package/src/base/primitives/compound/CompoundActionButton.tsx +1 -1
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +1 -1
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +0 -3
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +1 -1
- package/src/base/primitives/edge/EdgeActionButton.tsx +1 -2
- package/src/base/primitives/edge/EdgePath.tsx +22 -14
- package/src/base/primitives/edge/edge.css.ts +1 -1
- package/src/base/primitives/element/ElementActionButtons.tsx +7 -5
- package/src/base/primitives/element/ElementDetailsButton.tsx +5 -1
- package/src/base/primitives/element/ElementNodeContainer.css.ts +0 -18
- package/src/base/primitives/element/ElementNodeContainer.tsx +1 -1
- package/src/base/updateEdges.ts +6 -9
- package/src/base/updateNodes.ts +10 -14
- package/src/bundle/styles.css.ts +7 -2
- package/src/components/SearchControl.css.ts +4 -8
- package/src/context/FramerMotionConfig.tsx +1 -1
- package/src/context/RootContainer.tsx +0 -4
- package/src/hooks/useDiagram.ts +1 -1
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +8 -2
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +1 -1
- package/src/likec4diagram/custom/edges/edges.css.ts +0 -2
- package/src/likec4diagram/ui/controls/Controls.tsx +53 -55
- package/src/likec4diagram/ui/controls/NavigationButtons.tsx +1 -1
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
- package/src/likec4diagram/ui/notation/NotationPanel.css.ts +0 -4
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -2
- package/src/likec4diagram/ui/search/ElementsColumn.tsx +94 -71
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +48 -55
- package/src/likec4diagram/ui/search/ViewsColum.tsx +2 -2
- package/src/likec4diagram/ui/search/ViewsColumn.css.ts +0 -4
- package/src/likec4diagram/ui/search/state.ts +8 -6
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -1
- package/src/overlays/Overlays.tsx +4 -4
- package/src/overlays/element-details/ElementDetailsCard.tsx +1 -1
- package/src/overlays/element-details/TabPanelDeployments.tsx +2 -0
- package/src/overlays/element-details/TabPanelStructure.tsx +2 -1
- package/src/overlays/overlay/Overlay.css.ts +0 -40
- package/src/overlays/overlay/Overlay.tsx +109 -99
- package/src/overlays/overlaysActor.ts +5 -1
- package/src/overlays/relationship-details/RelationshipDetails.tsx +25 -16
- package/src/overlays/relationship-details/SelectEdge.tsx +0 -14
- package/src/overlays/relationship-details/actor.ts +2 -1
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +1 -1
- package/src/overlays/relationship-details/custom/nodeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +1 -3
- package/src/overlays/relationships-browser/SelectElement.tsx +2 -0
- package/src/overlays/relationships-browser/actor.ts +8 -13
- package/src/overlays/relationships-browser/const.ts +8 -1
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +2 -3
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +2 -2
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +1 -2
- package/src/state/DiagramActorProvider.tsx +4 -1
- package/src/state/diagram-machine.ts +2 -3
- package/src/state/hotkeyActor.ts +13 -3
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { ancestorsFqn } from '@likec4/core';
|
|
3
3
|
import { useTree, Group, Box, Popover, PopoverTarget, Button, Text, PopoverDropdown, ScrollAreaAutosize, Tree, ActionIcon, Tooltip, SegmentedControl } from '@mantine/core';
|
|
4
4
|
import { IconSelector, IconChevronRight } from '@tabler/icons-react';
|
|
5
|
-
import {
|
|
5
|
+
import { r as reactExports } from '../../_virtual/index.js';
|
|
6
6
|
import { useRelationshipsBrowser, useRelationshipsBrowserState } from './hooks.js';
|
|
7
7
|
import * as SelectElement_css from './SelectElement.css.js';
|
|
8
8
|
import { scrollArea } from './SelectElement.css.js';
|
|
@@ -20,7 +20,9 @@ const selector2 = (state) => {
|
|
|
20
20
|
enableChangeScope: state.context.enableChangeScope
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
const
|
|
23
|
+
const setHoveredNode = () => {
|
|
24
|
+
};
|
|
25
|
+
const SelectElement = reactExports.memo(() => {
|
|
24
26
|
const browser = useRelationshipsBrowser();
|
|
25
27
|
const {
|
|
26
28
|
subjectId,
|
|
@@ -30,15 +32,16 @@ const SelectElement = memo(() => {
|
|
|
30
32
|
enableSelectSubject,
|
|
31
33
|
enableChangeScope
|
|
32
34
|
} = useRelationshipsBrowserState(selector2);
|
|
33
|
-
const root = useRef(null);
|
|
34
|
-
const viewport = useRef(null);
|
|
35
|
+
const root = reactExports.useRef(null);
|
|
36
|
+
const viewport = reactExports.useRef(null);
|
|
35
37
|
const model = useLikeC4Model(true);
|
|
36
38
|
const subject = model.findElement(subjectId);
|
|
37
39
|
const data = useLikeC4ElementsTree(scope === "view" && viewId ? viewId : void 0);
|
|
38
40
|
const tree = useTree({
|
|
39
41
|
multiple: false
|
|
40
42
|
});
|
|
41
|
-
|
|
43
|
+
tree.setHoveredNode = setHoveredNode;
|
|
44
|
+
reactExports.useEffect(() => {
|
|
42
45
|
ancestorsFqn(subjectId).reverse().forEach((id) => {
|
|
43
46
|
tree.expand(id);
|
|
44
47
|
});
|
|
@@ -1140,7 +1140,7 @@ export declare const relationshipsBrowserLogic: StateMachine<Readonly<{
|
|
|
1140
1140
|
active?: boolean;
|
|
1141
1141
|
dimmed?: Base.Dimmed;
|
|
1142
1142
|
};
|
|
1143
|
-
}> &
|
|
1143
|
+
}> & ViewportHelperFunctions & {
|
|
1144
1144
|
viewportInitialized: boolean;
|
|
1145
1145
|
};
|
|
1146
1146
|
xystore: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { invariant, nonNullable, delay } from '@likec4/core';
|
|
2
2
|
import { applyEdgeChanges, applyNodeChanges } from '@xyflow/react';
|
|
3
|
-
import { getViewportForBounds
|
|
3
|
+
import { getViewportForBounds } from '@xyflow/system';
|
|
4
4
|
import { prop, omit, isNullish } from 'remeda';
|
|
5
5
|
import { setup, assign, fromPromise, assertEvent, enqueueActions, cancel, raise } from 'xstate';
|
|
6
6
|
import { MinZoom, ZIndexes } from '../../base/const.js';
|
|
@@ -55,8 +55,6 @@ const layouter = fromPromise(async ({ input, self, signal }) => {
|
|
|
55
55
|
};
|
|
56
56
|
const currentSubjectInternalNode = xyflow.getInternalNode(currentSubjectNode.id);
|
|
57
57
|
const currentSubjectCenter = centerXYInternalNode(currentSubjectInternalNode);
|
|
58
|
-
const existingInternalNode = xyflow.getInternalNode(existingNode.id);
|
|
59
|
-
const existingDimensions = getNodeDimensions(existingInternalNode);
|
|
60
58
|
const nested = /* @__PURE__ */ new Set();
|
|
61
59
|
currentNodes.forEach((n) => {
|
|
62
60
|
if (n.id === existingNode.id) {
|
|
@@ -88,8 +86,8 @@ const layouter = fromPromise(async ({ input, self, signal }) => {
|
|
|
88
86
|
return {
|
|
89
87
|
...omit(n, ["parentId"]),
|
|
90
88
|
position: {
|
|
91
|
-
x: currentSubjectCenter.x -
|
|
92
|
-
y: currentSubjectCenter.y -
|
|
89
|
+
x: currentSubjectCenter.x - n.initialWidth / 2,
|
|
90
|
+
y: currentSubjectCenter.y - n.initialHeight / 2
|
|
93
91
|
},
|
|
94
92
|
zIndex: ZIndexes.Max,
|
|
95
93
|
hidden: false,
|
|
@@ -105,16 +103,12 @@ const layouter = fromPromise(async ({ input, self, signal }) => {
|
|
|
105
103
|
xynodes: currentNodes,
|
|
106
104
|
xyedges: []
|
|
107
105
|
});
|
|
108
|
-
|
|
109
|
-
zoom,
|
|
110
|
-
nextviewport.zoom
|
|
111
|
-
);
|
|
112
|
-
await delay(175);
|
|
106
|
+
await delay(120);
|
|
113
107
|
next.xynodes = next.xynodes.map(Base.setDimmed(false));
|
|
114
108
|
if (signal.aborted) {
|
|
115
109
|
return updateXYData();
|
|
116
110
|
}
|
|
117
|
-
await xyflow.setCenter(currentSubjectCenter.x, currentSubjectCenter.y, { zoom, duration:
|
|
111
|
+
await xyflow.setCenter(currentSubjectCenter.x, currentSubjectCenter.y, { zoom, duration: 300 });
|
|
118
112
|
await xyflow.setCenter(nextSubjectCenter.x, nextSubjectCenter.y, { zoom });
|
|
119
113
|
return updateXYData();
|
|
120
114
|
});
|
|
@@ -414,7 +408,7 @@ const relationshipsBrowserLogic = setup({
|
|
|
414
408
|
xyedges: event.output.xyedges,
|
|
415
409
|
navigateFromNode: null
|
|
416
410
|
});
|
|
417
|
-
enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 50 });
|
|
411
|
+
enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 50 });
|
|
418
412
|
for (let i = 0; i < 6; i++) {
|
|
419
413
|
enqueue.raise({ type: "xyflow.updateNodeInternals" }, { delay: 100 + i * 100 });
|
|
420
414
|
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Padding } from '@xyflow/system';
|
|
2
|
+
export declare const ViewPadding: Padding;
|
|
@@ -72,13 +72,12 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
72
72
|
/* @__PURE__ */ jsx(
|
|
73
73
|
EdgePath,
|
|
74
74
|
{
|
|
75
|
-
|
|
75
|
+
edgeProps,
|
|
76
76
|
svgPath,
|
|
77
77
|
...markOrange && {
|
|
78
78
|
strokeWidth: 5
|
|
79
79
|
}
|
|
80
|
-
}
|
|
81
|
-
id
|
|
80
|
+
}
|
|
82
81
|
),
|
|
83
82
|
/* @__PURE__ */ jsx(
|
|
84
83
|
EdgeLabelContainer,
|
|
@@ -95,7 +94,7 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
95
94
|
children: label
|
|
96
95
|
}
|
|
97
96
|
)
|
|
98
|
-
] }
|
|
97
|
+
] });
|
|
99
98
|
});
|
|
100
99
|
|
|
101
100
|
export { RelationshipEdge };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Handle } from '@xyflow/react';
|
|
3
3
|
import { Position } from '@xyflow/system';
|
|
4
|
-
import
|
|
4
|
+
import * as m from 'motion/react-m';
|
|
5
5
|
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
6
6
|
import { ElementActions } from './ElementActions.js';
|
|
7
7
|
import { EmptyNode as EmptyNode$1 } from './EmptyNode.js';
|
|
@@ -29,7 +29,7 @@ const ElementDetailsButtonWithHandler = (props) => {
|
|
|
29
29
|
const ElementNode = customNode((props) => {
|
|
30
30
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { component: m.div, layoutId: props.id, nodeProps: props, children: [
|
|
31
31
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
32
|
-
/* @__PURE__ */ jsx(ElementTitle, { ...props
|
|
32
|
+
/* @__PURE__ */ jsx(ElementTitle, { ...props }),
|
|
33
33
|
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
34
34
|
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
35
35
|
/* @__PURE__ */ jsx(ElementPorts, { ...props })
|
|
@@ -57,7 +57,7 @@ export declare function useRelationshipsBrowser(): {
|
|
|
57
57
|
active?: boolean;
|
|
58
58
|
dimmed?: import("../../base").Base.Dimmed;
|
|
59
59
|
};
|
|
60
|
-
}> &
|
|
60
|
+
}> & ViewportHelperFunctions & {
|
|
61
61
|
viewportInitialized: boolean;
|
|
62
62
|
}) | null;
|
|
63
63
|
xystore: XYStoreApi | null;
|
|
@@ -2,11 +2,11 @@ import { nonNullable } from '@likec4/core';
|
|
|
2
2
|
import { useCallbackRef } from '@mantine/hooks';
|
|
3
3
|
import { useSelector } from '@xstate/react';
|
|
4
4
|
import { shallowEqual } from 'fast-equals';
|
|
5
|
-
import {
|
|
5
|
+
import { r as reactExports } from '../../_virtual/index.js';
|
|
6
6
|
|
|
7
|
-
const RelationshipsBrowserActorContext = createContext(null);
|
|
7
|
+
const RelationshipsBrowserActorContext = reactExports.createContext(null);
|
|
8
8
|
function useRelationshipsBrowserActor() {
|
|
9
|
-
return nonNullable(useContext(RelationshipsBrowserActorContext), "No RelationshipsBrowserActorContext");
|
|
9
|
+
return nonNullable(reactExports.useContext(RelationshipsBrowserActorContext), "No RelationshipsBrowserActorContext");
|
|
10
10
|
}
|
|
11
11
|
function useRelationshipsBrowserState(selector, compare = shallowEqual) {
|
|
12
12
|
const actor = useRelationshipsBrowserActor();
|
|
@@ -14,7 +14,7 @@ function useRelationshipsBrowserState(selector, compare = shallowEqual) {
|
|
|
14
14
|
}
|
|
15
15
|
function useRelationshipsBrowser() {
|
|
16
16
|
const actor = useRelationshipsBrowserActor();
|
|
17
|
-
return useMemo(() => ({
|
|
17
|
+
return reactExports.useMemo(() => ({
|
|
18
18
|
actor,
|
|
19
19
|
get rootElementId() {
|
|
20
20
|
return `relationships-browser-${actor.sessionId.replaceAll(":", "_")}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as reactExports } from '../../_virtual/index.js';
|
|
2
2
|
import dagre from '@dagrejs/dagre';
|
|
3
3
|
import { toArray, invariant, ifind, DefaultMap } from '@likec4/core';
|
|
4
4
|
import { pipe, concat, map, groupBy, prop, forEachObj, filter, mapToObj, find, only, unique, tap, reduce, sortBy } from 'remeda';
|
|
@@ -454,7 +454,7 @@ function layoutRelationshipsView(data, scope) {
|
|
|
454
454
|
}
|
|
455
455
|
function useRelationshipsView(subject, viewId, scope) {
|
|
456
456
|
const model = useLikeC4Model(true);
|
|
457
|
-
return useMemo(() => {
|
|
457
|
+
return reactExports.useMemo(() => {
|
|
458
458
|
const view = viewId ? model.findView(viewId) : null;
|
|
459
459
|
const data = layoutRelationshipsView(
|
|
460
460
|
computeRelationshipsView(subject, model, viewId, scope),
|
|
@@ -41,7 +41,6 @@ function viewToNodesEdge(view) {
|
|
|
41
41
|
draggable: false,
|
|
42
42
|
selectable: true,
|
|
43
43
|
focusable: true,
|
|
44
|
-
deletable: false,
|
|
45
44
|
position,
|
|
46
45
|
zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
|
|
47
46
|
style: {
|
|
@@ -140,7 +139,7 @@ function viewToNodesEdge(view) {
|
|
|
140
139
|
zIndex: ZIndexes.Edge,
|
|
141
140
|
// selectable: selectable,
|
|
142
141
|
// hidden: !visiblePredicate(edge),
|
|
143
|
-
deletable: false,
|
|
142
|
+
// deletable: false,
|
|
144
143
|
data: {
|
|
145
144
|
sourceFqn: edge.sourceFqn,
|
|
146
145
|
targetFqn: edge.targetFqn,
|
|
@@ -3,7 +3,7 @@ import { useDeepCompareEffect } from '@react-hookz/web';
|
|
|
3
3
|
import { useActorRef, useSelector } from '@xstate/react';
|
|
4
4
|
import { useStoreApi } from '@xyflow/react';
|
|
5
5
|
import { shallowEqual } from 'fast-equals';
|
|
6
|
-
import {
|
|
6
|
+
import { r as reactExports } from '../_virtual/index.js';
|
|
7
7
|
import { useDiagramEventHandlersRef } from '../context/DiagramEventHandlers.js';
|
|
8
8
|
import { useEnabledFeatures, DiagramFeatures } from '../context/DiagramFeatures.js';
|
|
9
9
|
import { DiagramActorSafeContext } from '../hooks/safeContext.js';
|
|
@@ -27,7 +27,9 @@ function DiagramActorProvider({
|
|
|
27
27
|
diagramMachine.provide({
|
|
28
28
|
actions: {
|
|
29
29
|
"trigger:NavigateTo": (_, { viewId }) => {
|
|
30
|
-
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
handlersRef.current.onNavigateTo?.(viewId);
|
|
32
|
+
}, 30);
|
|
31
33
|
},
|
|
32
34
|
"trigger:OnChange": (_, params) => {
|
|
33
35
|
handlersRef.current.onChange?.(params);
|
|
@@ -61,7 +63,7 @@ function DiagramActorProvider({
|
|
|
61
63
|
useUpdateEffect(() => {
|
|
62
64
|
actorRef.send({ type: "update.inputs", inputs });
|
|
63
65
|
}, [inputs]);
|
|
64
|
-
useEffect(() => {
|
|
66
|
+
reactExports.useEffect(() => {
|
|
65
67
|
actorRef.send({ type: "update.features", features });
|
|
66
68
|
}, [features]);
|
|
67
69
|
const { xyedges, xynodes } = useViewToNodesEdges({
|
|
@@ -2210,7 +2210,7 @@ export declare const diagramMachine: StateMachine<Context, Events, {
|
|
|
2210
2210
|
readonly params: {
|
|
2211
2211
|
readonly duration: 0;
|
|
2212
2212
|
};
|
|
2213
|
-
},
|
|
2213
|
+
}, ActionFunction<Context, Events, Events, undefined, Values<{
|
|
2214
2214
|
syncManualLayoutActorLogic: {
|
|
2215
2215
|
src: "syncManualLayoutActorLogic";
|
|
2216
2216
|
logic: StateMachine<Readonly< Input>, SyncLayoutEvents, {}, never, {
|
|
@@ -2463,7 +2463,7 @@ export declare const diagramMachine: StateMachine<Context, Events, {
|
|
|
2463
2463
|
}>;
|
|
2464
2464
|
id: "overlays";
|
|
2465
2465
|
};
|
|
2466
|
-
}>, never, never, never, never
|
|
2466
|
+
}>, never, never, never, never>, "startSyncLayout"];
|
|
2467
2467
|
readonly target: "ready";
|
|
2468
2468
|
}, {
|
|
2469
2469
|
readonly target: "initializing";
|
|
@@ -332,7 +332,6 @@ const diagramMachine = setup({
|
|
|
332
332
|
type: "xyflow:fitDiagram",
|
|
333
333
|
params: { duration: 0 }
|
|
334
334
|
},
|
|
335
|
-
"startSyncLayout",
|
|
336
335
|
assign(({ context }) => ({
|
|
337
336
|
navigationHistory: {
|
|
338
337
|
currentIndex: 0,
|
|
@@ -342,7 +341,8 @@ const diagramMachine = setup({
|
|
|
342
341
|
viewport: { ...context.xyflow.getViewport() }
|
|
343
342
|
}]
|
|
344
343
|
}
|
|
345
|
-
}))
|
|
344
|
+
})),
|
|
345
|
+
"startSyncLayout"
|
|
346
346
|
],
|
|
347
347
|
target: "ready"
|
|
348
348
|
}, {
|
|
@@ -743,13 +743,11 @@ const diagramMachine = setup({
|
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
745
|
});
|
|
746
|
-
enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 80 });
|
|
747
746
|
} else {
|
|
748
747
|
enqueue({
|
|
749
748
|
type: "xyflow:setViewportCenter",
|
|
750
749
|
params: getBBoxCenter(event.view.bounds)
|
|
751
750
|
});
|
|
752
|
-
enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
|
|
753
751
|
}
|
|
754
752
|
enqueue.assign(updateNavigationHistory);
|
|
755
753
|
enqueue.assign({
|
|
@@ -757,6 +755,7 @@ const diagramMachine = setup({
|
|
|
757
755
|
lastOnNavigate: null
|
|
758
756
|
});
|
|
759
757
|
enqueue("startSyncLayout");
|
|
758
|
+
enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 25 });
|
|
760
759
|
}),
|
|
761
760
|
target: "#idle"
|
|
762
761
|
}
|
|
@@ -3,15 +3,24 @@ import { fromCallback } from 'xstate';
|
|
|
3
3
|
|
|
4
4
|
const hotkeyActorLogic = fromCallback(({ sendBack }) => {
|
|
5
5
|
const escHandler = getHotkeyHandler([
|
|
6
|
-
["Escape", () =>
|
|
6
|
+
["Escape", (event) => {
|
|
7
|
+
event.stopPropagation();
|
|
8
|
+
sendBack({ type: "key.esc" });
|
|
9
|
+
}, {
|
|
7
10
|
preventDefault: true
|
|
8
11
|
}]
|
|
9
12
|
]);
|
|
10
13
|
const arrowshandler = getHotkeyHandler([
|
|
11
|
-
["ArrowLeft", () =>
|
|
14
|
+
["ArrowLeft", (event) => {
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
sendBack({ type: "key.arrow.left" });
|
|
17
|
+
}, {
|
|
12
18
|
preventDefault: true
|
|
13
19
|
}],
|
|
14
|
-
["ArrowRight", () =>
|
|
20
|
+
["ArrowRight", (event) => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
sendBack({ type: "key.arrow.right" });
|
|
23
|
+
}, {
|
|
15
24
|
preventDefault: true
|
|
16
25
|
}]
|
|
17
26
|
]);
|