likec4 1.22.0 → 1.22.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/__app__/src/chunks/{-index-overview-B8hfKX1i.js → -index-overview-Cg0Rizhy.js} +1 -1
- package/__app__/src/chunks/{main-BJUkPUKs.js → main-8uz6QKlw.js} +1984 -1925
- package/__app__/src/main.js +1 -1
- package/dist/cli/index.mjs +849 -126
- package/dist/index.mjs +2 -1
- package/dist/model/index.mjs +2 -1
- package/dist/shared/likec4.31-Bgt9N.mjs +3598 -0
- package/package.json +10 -18
- package/react/index.js +72 -26
- package/dist/cli/index.cjs +0 -476
- package/dist/cli/index.d.cts +0 -1
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -16112
- package/dist/model/index.cjs +0 -1
- package/dist/model/index.d.cts +0 -10
- package/dist/shared/likec4.CSvz6V2S.cjs +0 -1782
- package/dist/shared/likec4.DIBfXG6W.mjs +0 -1782
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "likec4",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -22,10 +22,6 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"sources": "./src/index.ts",
|
|
25
|
-
"require": {
|
|
26
|
-
"types": "./dist/index.d.cts",
|
|
27
|
-
"default": "./dist/index.cjs"
|
|
28
|
-
},
|
|
29
25
|
"default": {
|
|
30
26
|
"types": "./dist/index.d.mts",
|
|
31
27
|
"import": "./dist/index.mjs",
|
|
@@ -34,10 +30,6 @@
|
|
|
34
30
|
},
|
|
35
31
|
"./model": {
|
|
36
32
|
"sources": "./src/model/index.ts",
|
|
37
|
-
"require": {
|
|
38
|
-
"types": "./dist/model/index.d.cts",
|
|
39
|
-
"default": "./dist/model/index.cjs"
|
|
40
|
-
},
|
|
41
33
|
"default": {
|
|
42
34
|
"types": "./dist/model/index.d.mts",
|
|
43
35
|
"import": "./dist/model/index.mjs",
|
|
@@ -106,7 +98,7 @@
|
|
|
106
98
|
},
|
|
107
99
|
"dependencies": {
|
|
108
100
|
"@hpcc-js/wasm-graphviz": "1.7.0",
|
|
109
|
-
"@likec4/core": "~1.22.
|
|
101
|
+
"@likec4/core": "~1.22.1",
|
|
110
102
|
"@vitejs/plugin-react": "4.3.4",
|
|
111
103
|
"boxen": "^8.0.1",
|
|
112
104
|
"playwright": "1.50.1",
|
|
@@ -118,13 +110,13 @@
|
|
|
118
110
|
},
|
|
119
111
|
"devDependencies": {
|
|
120
112
|
"@fontsource/ibm-plex-sans": "^5.1.1",
|
|
121
|
-
"@likec4/diagram": "1.22.
|
|
122
|
-
"@likec4/generators": "1.22.
|
|
123
|
-
"@likec4/icons": "1.22.
|
|
124
|
-
"@likec4/language-server": "1.22.
|
|
125
|
-
"@likec4/layouts": "1.22.
|
|
126
|
-
"@likec4/log": "1.22.
|
|
127
|
-
"@likec4/tsconfig": "1.22.
|
|
113
|
+
"@likec4/diagram": "1.22.1",
|
|
114
|
+
"@likec4/generators": "1.22.1",
|
|
115
|
+
"@likec4/icons": "1.22.1",
|
|
116
|
+
"@likec4/language-server": "1.22.1",
|
|
117
|
+
"@likec4/layouts": "1.22.1",
|
|
118
|
+
"@likec4/log": "1.22.1",
|
|
119
|
+
"@likec4/tsconfig": "1.22.1",
|
|
128
120
|
"@mantine/core": "7.16.3",
|
|
129
121
|
"@mantine/hooks": "7.16.3",
|
|
130
122
|
"@mantine/vanilla-extract": "7.16.3",
|
|
@@ -161,8 +153,8 @@
|
|
|
161
153
|
"glob": "^11.0.1",
|
|
162
154
|
"html-to-image": "^1.11.11",
|
|
163
155
|
"json5": "^2.2.3",
|
|
156
|
+
"ky": "^1.7.5",
|
|
164
157
|
"langium": "3.3.1",
|
|
165
|
-
"latest-version": "^9.0.0",
|
|
166
158
|
"merge-error-cause": "^5.0.0",
|
|
167
159
|
"mkdirp": "^3.0.1",
|
|
168
160
|
"nano-spawn": "^0.2.0",
|
package/react/index.js
CHANGED
|
@@ -22702,12 +22702,12 @@ function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTy
|
|
|
22702
22702
|
return jsx("div", { "data-testid": "rf__wrapper", ...rest, style: { ...style2, ...wrapperStyle }, ref, className: cc(["react-flow", className, colorModeClassName]), id: id2, children: jsxs(Wrapper, { nodes, edges, width: width2, height, fitView: fitView2, nodeOrigin, nodeExtent, children: [jsx(GraphView, { onInit, onNodeClick, onEdgeClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, nodeTypes: nodeTypes2, edgeTypes: edgeTypes2, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, deleteKeyCode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent, minZoom, maxZoom, preventScrolling, zoomOnScroll, zoomOnPinch, zoomOnDoubleClick, panOnScroll, panOnScrollSpeed, panOnScrollMode, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, defaultMarkerColor, noDragClassName, noWheelClassName, noPanClassName, rfId, disableKeyboardA11y, nodeExtent, viewport, onViewportChange }), jsx(StoreUpdater, { nodes, edges, defaultNodes, defaultEdges, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, nodesDraggable, nodesConnectable, nodesFocusable, edgesFocusable, edgesReconnectable, elementsSelectable, elevateNodesOnSelect, elevateEdgesOnSelect, minZoom, maxZoom, nodeExtent, onNodesChange, onEdgesChange, snapToGrid, snapGrid, connectionMode, translateExtent, connectOnClick, defaultEdgeOptions, fitView: fitView2, fitViewOptions, onNodesDelete, onEdgesDelete, onDelete, onNodeDragStart, onNodeDrag, onNodeDragStop, onSelectionDrag, onSelectionDragStart, onSelectionDragStop, onMove, onMoveStart, onMoveEnd, noPanClassName, nodeOrigin, rfId, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, onError, connectionRadius, isValidConnection, selectNodesOnDrag, nodeDragThreshold, onBeforeDelete, paneClickDistance, debug: debug2 }), jsx(SelectionListener, { onSelectionChange }), children2, jsx(Attribution, { proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId, disableKeyboardA11y })] }) });
|
|
22703
22703
|
}
|
|
22704
22704
|
var index = fixedForwardRef(ReactFlow);
|
|
22705
|
-
const selector$6 = (s2) => {
|
|
22705
|
+
const selector$6$1 = (s2) => {
|
|
22706
22706
|
var _a;
|
|
22707
22707
|
return (_a = s2.domNode) == null ? void 0 : _a.querySelector(".react-flow__edgelabel-renderer");
|
|
22708
22708
|
};
|
|
22709
22709
|
function EdgeLabelRenderer({ children: children2 }) {
|
|
22710
|
-
const edgeLabelRenderer = useStore$1(selector$6);
|
|
22710
|
+
const edgeLabelRenderer = useStore$1(selector$6$1);
|
|
22711
22711
|
return edgeLabelRenderer ? createPortal(children2, edgeLabelRenderer) : null;
|
|
22712
22712
|
}
|
|
22713
22713
|
function useNodesState(initialNodes) {
|
|
@@ -24113,6 +24113,8 @@ var IconLayoutAlignTop = createReactComponent("outline", "layout-align-top", "Ic
|
|
|
24113
24113
|
var IconLayoutBoardSplit = createReactComponent("outline", "layout-board-split", "IconLayoutBoardSplit", [["path", { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z", key: "svg-0" }], ["path", { d: "M4 12h8", key: "svg-1" }], ["path", { d: "M12 15h8", key: "svg-2" }], ["path", { d: "M12 9h8", key: "svg-3" }], ["path", { d: "M12 4v16", key: "svg-4" }]]);
|
|
24114
24114
|
var IconLayoutCollage = createReactComponent("outline", "layout-collage", "IconLayoutCollage", [["path", { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z", key: "svg-0" }], ["path", { d: "M10 4l4 16", key: "svg-1" }], ["path", { d: "M12 12l-8 2", key: "svg-2" }]]);
|
|
24115
24115
|
var IconLayoutDashboard = createReactComponent("outline", "layout-dashboard", "IconLayoutDashboard", [["path", { d: "M5 4h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1", key: "svg-0" }], ["path", { d: "M5 16h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1", key: "svg-1" }], ["path", { d: "M15 12h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1", key: "svg-2" }], ["path", { d: "M15 4h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1", key: "svg-3" }]]);
|
|
24116
|
+
var IconLockOpen2 = createReactComponent("outline", "lock-open-2", "IconLockOpen2", [["path", { d: "M3 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z", key: "svg-0" }], ["path", { d: "M9 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0", key: "svg-1" }], ["path", { d: "M13 11v-4a4 4 0 1 1 8 0v4", key: "svg-2" }]]);
|
|
24117
|
+
var IconLock = createReactComponent("outline", "lock", "IconLock", [["path", { d: "M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z", key: "svg-0" }], ["path", { d: "M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0", key: "svg-1" }], ["path", { d: "M8 11v-4a4 4 0 1 1 8 0v4", key: "svg-2" }]]);
|
|
24116
24118
|
var IconMenu2 = createReactComponent("outline", "menu-2", "IconMenu2", [["path", { d: "M4 6l16 0", key: "svg-0" }], ["path", { d: "M4 12l16 0", key: "svg-1" }], ["path", { d: "M4 18l16 0", key: "svg-2" }]]);
|
|
24117
24119
|
var IconMenu = createReactComponent("outline", "menu", "IconMenu", [["path", { d: "M4 8l16 0", key: "svg-0" }], ["path", { d: "M4 16l16 0", key: "svg-1" }]]);
|
|
24118
24120
|
var IconRectangularPrism = createReactComponent("outline", "rectangular-prism", "IconRectangularPrism", [["path", { d: "M21 14.008v-5.018a1.98 1.98 0 0 0 -1 -1.717l-4 -2.008a2.016 2.016 0 0 0 -2 0l-10 5.008c-.619 .355 -1 1.01 -1 1.718v5.018c0 .709 .381 1.363 1 1.717l4 2.008a2.016 2.016 0 0 0 2 0l10 -5.008c.619 -.355 1 -1.01 1 -1.718z", key: "svg-0" }], ["path", { d: "M9 21v-7.5", key: "svg-1" }], ["path", { d: "M9 13.5l11.5 -5.5", key: "svg-2" }], ["path", { d: "M3.5 11l5.5 2.5", key: "svg-3" }]]);
|
|
@@ -31151,6 +31153,9 @@ function useDiagram() {
|
|
|
31151
31153
|
},
|
|
31152
31154
|
stopWalkthrough: () => {
|
|
31153
31155
|
actor.send({ type: "walkthrough.end" });
|
|
31156
|
+
},
|
|
31157
|
+
toggleFeature: (feature, forceValue) => {
|
|
31158
|
+
actor.send({ type: "toggle.feature", feature, ...forceValue !== void 0 && { forceValue } });
|
|
31154
31159
|
}
|
|
31155
31160
|
}), [actor]);
|
|
31156
31161
|
}
|
|
@@ -31988,12 +31993,7 @@ const hotkeyActor = fromCallback(({ sendBack }) => {
|
|
|
31988
31993
|
});
|
|
31989
31994
|
function createViewChange(parentContext) {
|
|
31990
31995
|
const { view, xystore, xyflow: xyflow2 } = parentContext, { nodeLookup } = xystore.getState(), movedNodes = /* @__PURE__ */ new Set();
|
|
31991
|
-
let bounds
|
|
31992
|
-
x: 0,
|
|
31993
|
-
y: 0,
|
|
31994
|
-
width: 1,
|
|
31995
|
-
height: 1
|
|
31996
|
-
};
|
|
31996
|
+
let bounds;
|
|
31997
31997
|
const nodes = l$4([...nodeLookup.values()], (acc, node2) => {
|
|
31998
31998
|
const dimensions = getNodeDimensions(node2);
|
|
31999
31999
|
(!isSamePoint(node2.internals.positionAbsolute, node2.data.position) || node2.initialWidth !== dimensions.width || node2.initialHeight !== dimensions.height) && movedNodes.add(node2.id);
|
|
@@ -32004,7 +32004,7 @@ function createViewChange(parentContext) {
|
|
|
32004
32004
|
width: Math.ceil(dimensions.width),
|
|
32005
32005
|
height: Math.ceil(dimensions.height)
|
|
32006
32006
|
};
|
|
32007
|
-
return bounds = getBoundsOfRects(bounds, rect), acc;
|
|
32007
|
+
return bounds = bounds ? getBoundsOfRects(bounds, rect) : rect, acc;
|
|
32008
32008
|
}, {}), edges = l$4((xyflow2 == null ? void 0 : xyflow2.getEdges()) ?? [], (acc, { source, target, data }) => {
|
|
32009
32009
|
let controlPoints = data.controlPoints ?? [];
|
|
32010
32010
|
const sourceOrTargetMoved = movedNodes.has(source) || movedNodes.has(target);
|
|
@@ -32031,9 +32031,9 @@ function createViewChange(parentContext) {
|
|
|
32031
32031
|
x2: Math.ceil(Math.max(...allX)),
|
|
32032
32032
|
y2: Math.ceil(Math.max(...allY))
|
|
32033
32033
|
});
|
|
32034
|
-
return bounds = getBoundsOfRects(bounds, rect), acc;
|
|
32034
|
+
return bounds = bounds ? getBoundsOfRects(bounds, rect) : rect, acc;
|
|
32035
32035
|
}, {});
|
|
32036
|
-
return {
|
|
32036
|
+
return bounds ?? (bounds = view.bounds), {
|
|
32037
32037
|
op: "save-manual-layout",
|
|
32038
32038
|
layout: {
|
|
32039
32039
|
hash: view.hash,
|
|
@@ -32183,13 +32183,21 @@ const diagramMachine = setup({
|
|
|
32183
32183
|
};
|
|
32184
32184
|
});
|
|
32185
32185
|
});
|
|
32186
|
-
}
|
|
32186
|
+
},
|
|
32187
|
+
updateFeatures: assign(({ event }) => (assertEvent(event, "update.features"), {
|
|
32188
|
+
features: {
|
|
32189
|
+
...event.features
|
|
32190
|
+
}
|
|
32191
|
+
}))
|
|
32187
32192
|
}
|
|
32188
32193
|
}).createMachine({
|
|
32189
32194
|
initial: "initializing",
|
|
32190
32195
|
context: ({ input: input2, self: self2, spawn }) => ({
|
|
32191
32196
|
...input2,
|
|
32192
32197
|
features: { ...AllDisabled },
|
|
32198
|
+
toggledFeatures: {
|
|
32199
|
+
enableReadOnly: !0
|
|
32200
|
+
},
|
|
32193
32201
|
initialized: !1,
|
|
32194
32202
|
viewportChangedManually: !1,
|
|
32195
32203
|
lastOnNavigate: null,
|
|
@@ -32681,9 +32689,7 @@ const diagramMachine = setup({
|
|
|
32681
32689
|
actions: assign(({ event }) => ({ ...event.inputs }))
|
|
32682
32690
|
},
|
|
32683
32691
|
"update.features": {
|
|
32684
|
-
actions:
|
|
32685
|
-
features: ({ event }) => event.features
|
|
32686
|
-
})
|
|
32692
|
+
actions: "updateFeatures"
|
|
32687
32693
|
},
|
|
32688
32694
|
"update.nodeData": {
|
|
32689
32695
|
actions: assign(updateNodeData)
|
|
@@ -32740,6 +32746,14 @@ const diagramMachine = setup({
|
|
|
32740
32746
|
"walkthrough.start": {
|
|
32741
32747
|
guard: "is dynamic view",
|
|
32742
32748
|
target: ".walkthrough"
|
|
32749
|
+
},
|
|
32750
|
+
"toggle.feature": {
|
|
32751
|
+
actions: assign({
|
|
32752
|
+
toggledFeatures: ({ context, event }) => ({
|
|
32753
|
+
...context.toggledFeatures,
|
|
32754
|
+
[`enable${event.feature}`]: event.forceValue ?? !(context.toggledFeatures[`enable${event.feature}`] ?? context.features[`enable${event.feature}`])
|
|
32755
|
+
})
|
|
32756
|
+
})
|
|
32743
32757
|
}
|
|
32744
32758
|
},
|
|
32745
32759
|
exit: [
|
|
@@ -32811,7 +32825,7 @@ function DiagramActor({ input: input2, children: children2 }) {
|
|
|
32811
32825
|
},
|
|
32812
32826
|
children: [
|
|
32813
32827
|
/* @__PURE__ */ jsx(SyncStore, { input: input2 }),
|
|
32814
|
-
children2
|
|
32828
|
+
/* @__PURE__ */ jsx(DiagramActorToggledFeatures, { children: children2 })
|
|
32815
32829
|
]
|
|
32816
32830
|
}
|
|
32817
32831
|
);
|
|
@@ -32826,6 +32840,16 @@ const SyncStore = ({ input: { view, xyedges, xynodes, ...inputs } }) => {
|
|
|
32826
32840
|
send({ type: "update.view", view, xyedges, xynodes });
|
|
32827
32841
|
}, [send, view, xyedges, xynodes]), null;
|
|
32828
32842
|
};
|
|
32843
|
+
function DiagramActorToggledFeatures({ children: children2 }) {
|
|
32844
|
+
const toggledFeatures = useDiagramContext((s2) => s2.toggledFeatures);
|
|
32845
|
+
return /* @__PURE__ */ jsx(
|
|
32846
|
+
DiagramFeatures,
|
|
32847
|
+
{
|
|
32848
|
+
overrides: toggledFeatures,
|
|
32849
|
+
children: children2
|
|
32850
|
+
}
|
|
32851
|
+
);
|
|
32852
|
+
}
|
|
32829
32853
|
function viewToNodesEdge(opts) {
|
|
32830
32854
|
var _a;
|
|
32831
32855
|
const {
|
|
@@ -36098,7 +36122,7 @@ function RelationshipsBrowser({ actorRef }) {
|
|
|
36098
36122
|
initialEdges: []
|
|
36099
36123
|
}), /* @__PURE__ */ jsx(RelationshipsBrowserActorContext.Provider, { value: actorRef, children: /* @__PURE__ */ jsx(ReactFlowProvider, { ...initialRef.current, children: /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(LayoutGroup, { id: id2, children: /* @__PURE__ */ jsx(RelationshipsBrowserXYFlow, {}) }) }) }) });
|
|
36100
36124
|
}
|
|
36101
|
-
const selector$
|
|
36125
|
+
const selector$6 = (state) => ({
|
|
36102
36126
|
initialized: state.context.initialized,
|
|
36103
36127
|
isActive: state.hasTag("active"),
|
|
36104
36128
|
nodes: state.context.xynodes,
|
|
@@ -36110,7 +36134,7 @@ const selector$5 = (state) => ({
|
|
|
36110
36134
|
nodes,
|
|
36111
36135
|
edges
|
|
36112
36136
|
} = useRelationshipsBrowserState(
|
|
36113
|
-
selector$
|
|
36137
|
+
selector$6,
|
|
36114
36138
|
selectorEq
|
|
36115
36139
|
);
|
|
36116
36140
|
return /* @__PURE__ */ jsx(
|
|
@@ -37365,7 +37389,7 @@ function RelationshipDetails({ actorRef }) {
|
|
|
37365
37389
|
defaultEdges: []
|
|
37366
37390
|
}), /* @__PURE__ */ jsx(RelationshipDetailsActorContext.Provider, { value: actorRef, children: /* @__PURE__ */ jsx(ReactFlowProvider, { ...initialRef.current, children: /* @__PURE__ */ jsx(RelationshipDetailsInner, {}) }) });
|
|
37367
37391
|
}
|
|
37368
|
-
const selector$
|
|
37392
|
+
const selector$5 = (state) => ({
|
|
37369
37393
|
edgeId: state.context.edgeId,
|
|
37370
37394
|
view: state.context.view,
|
|
37371
37395
|
initialized: state.context.initialized
|
|
@@ -37374,7 +37398,7 @@ const selector$4 = (state) => ({
|
|
|
37374
37398
|
edgeId,
|
|
37375
37399
|
view,
|
|
37376
37400
|
initialized
|
|
37377
|
-
} = useRelationshipDetailsState(selector$
|
|
37401
|
+
} = useRelationshipDetailsState(selector$5), {
|
|
37378
37402
|
edge,
|
|
37379
37403
|
xynodes,
|
|
37380
37404
|
xyedges,
|
|
@@ -37526,7 +37550,7 @@ function Fallback({ error, resetErrorBoundary }) {
|
|
|
37526
37550
|
}
|
|
37527
37551
|
) });
|
|
37528
37552
|
}
|
|
37529
|
-
const selector$
|
|
37553
|
+
const selector$4 = (s2) => {
|
|
37530
37554
|
var _a, _b, _c;
|
|
37531
37555
|
return {
|
|
37532
37556
|
relationshipsBrowserActor: s2.children.relationshipsBrowser,
|
|
@@ -37546,7 +37570,7 @@ const selector$3 = (s2) => {
|
|
|
37546
37570
|
viewId,
|
|
37547
37571
|
fromNode,
|
|
37548
37572
|
rectFromNode
|
|
37549
|
-
} = useDiagramActorState(selector$
|
|
37573
|
+
} = useDiagramActorState(selector$4, equals), isMotionReduced = useReducedMotion() ?? !1, isActiveOverlay = !!activeElementDetailsOf || !!relationshipsBrowserActor2 || !!relationshipDetailsActor2;
|
|
37550
37574
|
useEffect$2(() => {
|
|
37551
37575
|
!xyflowRendererDom || isMotionReduced || animate(xyflowRendererDom, {
|
|
37552
37576
|
opacity: isActiveOverlay ? 0.7 : 1,
|
|
@@ -38427,7 +38451,7 @@ const Tooltip = Tooltip$4.withProps({
|
|
|
38427
38451
|
color: "gray"
|
|
38428
38452
|
});
|
|
38429
38453
|
var navigationButtons = "qc0nyw0", panel = "qc0nyw1", actionIconGroup = "qc0nyw2", autolayoutButton = "qc0nyw4", autolayoutIndicator = "qc0nyw5", spacingSliderBody = "qc0nyw6", spacingSliderThumb = "qc0nyw7";
|
|
38430
|
-
const selector$
|
|
38454
|
+
const selector$3 = (state) => ({
|
|
38431
38455
|
viewId: state.view.id,
|
|
38432
38456
|
autoLayout: state.view.autoLayout
|
|
38433
38457
|
}), ChangeAutoLayoutButton = (props) => {
|
|
@@ -38436,7 +38460,7 @@ const selector$2 = (state) => ({
|
|
|
38436
38460
|
} = useDiagramEventHandlers(), diagram = useDiagram(), [rootRef, setRootRef] = useState$1(null), [controlsRefs, setControlsRefs] = useState$1({}), {
|
|
38437
38461
|
autoLayout,
|
|
38438
38462
|
viewId
|
|
38439
|
-
} = useDiagramContext(selector$
|
|
38463
|
+
} = useDiagramContext(selector$3), { ref, hovered: isSpacingHovered } = useHover$1(), setControlRef = (name) => (node2) => {
|
|
38440
38464
|
controlsRefs[name] = node2, setControlsRefs(controlsRefs);
|
|
38441
38465
|
}, setAutoLayout = (direction) => (event) => {
|
|
38442
38466
|
event.stopPropagation(), onChange == null || onChange({
|
|
@@ -38754,6 +38778,20 @@ const selector$2 = (state) => ({
|
|
|
38754
38778
|
"forward"
|
|
38755
38779
|
)
|
|
38756
38780
|
] });
|
|
38781
|
+
}, selector$2 = (state) => ({
|
|
38782
|
+
visible: state.features.enableReadOnly !== !0,
|
|
38783
|
+
isReadOnly: state.toggledFeatures.enableReadOnly ?? state.features.enableReadOnly
|
|
38784
|
+
}), ToggleReadonly = () => {
|
|
38785
|
+
const { visible: visible2, isReadOnly } = useDiagramContext(selector$2), diagram = useDiagram();
|
|
38786
|
+
return visible2 ? /* @__PURE__ */ jsx(Tooltip, { label: isReadOnly ? "Enable editing" : "Disable editing", children: /* @__PURE__ */ jsx(
|
|
38787
|
+
ActionIcon,
|
|
38788
|
+
{
|
|
38789
|
+
onClick: (e2) => {
|
|
38790
|
+
e2.stopPropagation(), diagram.toggleFeature("ReadOnly");
|
|
38791
|
+
},
|
|
38792
|
+
children: isReadOnly ? /* @__PURE__ */ jsx(IconLock, {}) : /* @__PURE__ */ jsx(IconLockOpen2, {})
|
|
38793
|
+
}
|
|
38794
|
+
) }) : null;
|
|
38757
38795
|
}, Controls = memo$2(() => {
|
|
38758
38796
|
const { viewId, hasLayoutDrift, viewportChanged } = useDiagramContext((c2) => ({
|
|
38759
38797
|
viewId: c2.view.id,
|
|
@@ -38811,6 +38849,7 @@ const selector$2 = (state) => ({
|
|
|
38811
38849
|
children: /* @__PURE__ */ jsx(IconFileSymlink, { stroke: 1.5 })
|
|
38812
38850
|
}
|
|
38813
38851
|
) }),
|
|
38852
|
+
enableControls && /* @__PURE__ */ jsx(ToggleReadonly, {}),
|
|
38814
38853
|
enableControls && hasLayoutDrift && /* @__PURE__ */ jsx(LayoutDriftNotification, { ...portalProps }),
|
|
38815
38854
|
enableControls && notReadOnly && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
38816
38855
|
/* @__PURE__ */ jsx(ChangeAutoLayoutButton, { ...portalProps }),
|
|
@@ -39331,8 +39370,15 @@ const selectXYProps = (ctx) => ({
|
|
|
39331
39370
|
zoomable: ctx.zoomable,
|
|
39332
39371
|
fitViewPadding: ctx.fitViewPadding,
|
|
39333
39372
|
enableFitView: ctx.features.enableFitView,
|
|
39334
|
-
enableReadOnly: ctx.features.enableReadOnly
|
|
39335
|
-
|
|
39373
|
+
enableReadOnly: ctx.features.enableReadOnly,
|
|
39374
|
+
...!ctx.features.enableFitView && {
|
|
39375
|
+
viewport: {
|
|
39376
|
+
x: -Math.min(ctx.view.bounds.x, 0),
|
|
39377
|
+
y: -Math.min(ctx.view.bounds.y, 0),
|
|
39378
|
+
zoom: 1
|
|
39379
|
+
}
|
|
39380
|
+
}
|
|
39381
|
+
}), equalsXYProps = (a2, b2) => a2.initialized === b2.initialized && a2.pannable === b2.pannable && a2.zoomable === b2.zoomable && a2.fitViewPadding === b2.fitViewPadding && a2.enableFitView === b2.enableFitView && a2.enableReadOnly === b2.enableReadOnly && shallowEqual(a2.nodes, b2.nodes) && shallowEqual(a2.edges, b2.edges) && shallowEqual(a2.viewport, b2.viewport), LikeC4DiagramXYFlow = memo$2(({ background, nodesDraggable, nodesSelectable }) => {
|
|
39336
39382
|
const diagram = useDiagram(), {
|
|
39337
39383
|
initialized,
|
|
39338
39384
|
nodes,
|