likec4 1.7.4 → 1.8.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/README.md +7 -10
- package/dist/__app__/react/likec4.tsx +14 -1
- package/dist/__app__/src/chunks/{likec4-DA506XqP.js → likec4-Blyd4UZO.js} +229 -209
- package/dist/__app__/src/chunks/{mantine-CIkjlE3R.js → mantine-BYr8JSNL.js} +502 -347
- package/dist/__app__/src/chunks/{tanstack-router-C3bHLsEH.js → tanstack-router-ma6rQsdz.js} +34 -125
- package/dist/__app__/src/const.js +3 -1
- package/dist/__app__/src/main.js +1600 -986
- package/dist/__app__/src/style.css +1 -1
- package/dist/__app__/tsconfig.tsbuildinfo +1 -1
- package/dist/__app__/webcomponent/webcomponent.js +1640 -902
- package/dist/cli/index.mjs +299 -232
- package/package.json +28 -25
- package/react/LikeC4ViewElement.d.ts +24 -1
- package/react/index.mjs +1377 -643
- package/react/types-filter.d.ts +1 -1
- package/react/types.d.ts +27 -0
package/dist/__app__/src/main.js
CHANGED
|
@@ -2,17 +2,19 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { createContext as createContext$1, useLayoutEffect as useLayoutEffect$1, useEffect as useEffect$1, useContext as useContext$1, useRef as useRef$1, useInsertionEffect, useCallback as useCallback$1, useMemo as useMemo$1, forwardRef as forwardRef$1, Fragment as Fragment$1, createElement as createElement$1, useId as useId$1, Children, isValidElement, useState as useState$1, memo as memo$1, Component, StrictMode } from "react";
|
|
4
4
|
import { createRoot } from "react-dom/client";
|
|
5
|
-
import { L as Link, c as createRootRouteWithContext, S as ScrollRestoration, O as Outlet,
|
|
6
|
-
import { C as Container, T as Title, a as Text$1, G as Group, B as Button, c as createTheme, M as MantineProvider, b as MantineContext, u as useHotkeys, d as clsx, e as Box, A as ActionIcon$2, H as HoverCard, f as HoverCardTarget, U as UnstyledButton, g as HoverCardDropdown, S as Stack, h as Anchor, i as CopyButton$1, j as useLocalStorage, k as Card, l as CardSection, m as Spoiler, n as ButtonGroup,
|
|
7
|
-
import { ComponentName, basepath, useHashHistory } from "./const.js";
|
|
8
|
-
import {
|
|
5
|
+
import { L as Link, c as createRootRouteWithContext, S as ScrollRestoration, O as Outlet, u as useRouter, a as createFileRoute, b as useParams, d as useRouterState, i as isNotFound, n as notFound, R as RouterProvider, e as createRouter$1, f as createHashHistory, g as createBrowserHistory } from "./chunks/tanstack-router-ma6rQsdz.js";
|
|
6
|
+
import { C as Container, T as Title, a as Text$1, G as Group, B as Button, c as createTheme, M as MantineProvider, b as MantineContext, u as useHotkeys, d as clsx, e as Box, A as ActionIcon$2, H as HoverCard, f as HoverCardTarget, U as UnstyledButton, g as HoverCardDropdown, S as Stack, h as Anchor, i as CopyButton$1, j as useLocalStorage, k as Card, l as CardSection, m as Spoiler, n as ButtonGroup, o as Tooltip$2, p as ThemeIcon, P as Paper, q as Tabs, r as TabsList, s as TabsTab, t as TabsPanel, v as ScrollAreaAutosize, w as Badge, x as rem, D as Divider, y as Space, z as TooltipGroup, F as Flex, E as ColorSwatch, I as CheckIcon, J as Select, K as Slider, L as SegmentedControl, N as Popover, O as PopoverTarget, Q as PopoverDropdown, R as FloatingIndicator, V as Notification, W as Code, X as Center, Y as Image, Z as useMantineColorScheme, _ as SimpleGrid, $ as useTree, a0 as useComputedColorScheme, a1 as Tree, a2 as Drawer, a3 as ScrollArea, a4 as Alert, a5 as ModalRoot, a6 as ModalOverlay, a7 as ModalContent, a8 as ModalBody, a9 as useMantineTheme, aa as useMediaQuery, ab as useDisclosure, ac as Menu, ad as MenuTarget, ae as MenuDropdown, af as MenuLabel, ag as MenuItem, ah as LoadingOverlay, ai as useCallbackRef, aj as Burger, ak as Loader } from "./chunks/mantine-BYr8JSNL.js";
|
|
7
|
+
import { withOverviewGraph, ComponentName, basepath, useHashHistory } from "./const.js";
|
|
8
|
+
import { useOverviewGraph } from "virtual:likec4/overview-graph";
|
|
9
|
+
import { u as useReactFlow, a as useStoreApi, b as useNodesData, c as useStore, d as createWithEqualityFn, e as applyNodeChanges, f as applyEdgeChanges, g as getViewportForBounds, h as getNodeDimensions, i as getBoundsOfRects, s as shallow$1, j as boxToRect, k as useStoreWithEqualityFn, E as EdgeLabelRenderer, H as Handle, P as Position, l as useOnViewportChange, m as index, n as useOnSelectionChange, B as Background, o as BackgroundVariant, C as Controls, R as ReactFlowProvider, p as BaseEdge, q as useNodesState, r as useEdgesState } from "./chunks/likec4-Blyd4UZO.js";
|
|
10
|
+
import { usePreviewUrl } from "virtual:likec4/previews";
|
|
9
11
|
import { useLikeC4Views, useLikeC4View } from "virtual:likec4/store";
|
|
10
12
|
import { RenderIcon } from "./icons.js";
|
|
11
13
|
import { useStore as useStore$1 } from "@nanostores/react";
|
|
12
14
|
import { atom, onMount } from "nanostores";
|
|
13
|
-
var content = "_1u4wf800", image = "_1u4wf801", inner = "_1u4wf802", root = "_1u4wf803", description$2 = "_1u4wf804", title$3 = "_1u4wf805";
|
|
15
|
+
var content = "_1u4wf800", image = "_1u4wf801", inner = "_1u4wf802", root$1 = "_1u4wf803", description$2 = "_1u4wf804", title$3 = "_1u4wf805";
|
|
14
16
|
function NotFound() {
|
|
15
|
-
return /* @__PURE__ */ jsx(Container, { className: root, children: /* @__PURE__ */ jsxs("div", { className: inner, children: [
|
|
17
|
+
return /* @__PURE__ */ jsx(Container, { className: root$1, children: /* @__PURE__ */ jsxs("div", { className: inner, children: [
|
|
16
18
|
/* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 362 145", className: image, children: /* @__PURE__ */ jsx(
|
|
17
19
|
"path",
|
|
18
20
|
{
|
|
@@ -78,83 +80,473 @@ function RootComponent() {
|
|
|
78
80
|
)
|
|
79
81
|
] });
|
|
80
82
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
const blue$1 = {
|
|
84
|
+
fill: "#3b82f6",
|
|
85
|
+
stroke: "#2563eb",
|
|
86
|
+
hiContrast: "#eff6ff",
|
|
87
|
+
loContrast: "#bfdbfe"
|
|
88
|
+
}, sky$1 = {
|
|
89
|
+
fill: "#0284c7",
|
|
90
|
+
stroke: "#0369a1",
|
|
91
|
+
hiContrast: "#f0f9ff",
|
|
92
|
+
loContrast: "#B6ECF7"
|
|
93
|
+
}, slate$1 = {
|
|
94
|
+
fill: "#64748b",
|
|
95
|
+
stroke: "#475569",
|
|
96
|
+
hiContrast: "#f8fafc",
|
|
97
|
+
loContrast: "#cbd5e1"
|
|
98
|
+
}, ElementColors = {
|
|
99
|
+
primary: blue$1,
|
|
100
|
+
blue: blue$1,
|
|
101
|
+
secondary: sky$1,
|
|
102
|
+
sky: sky$1,
|
|
103
|
+
muted: slate$1,
|
|
104
|
+
slate: slate$1,
|
|
105
|
+
gray: {
|
|
106
|
+
// fill: colors.neutral[500],
|
|
107
|
+
// stroke: colors.neutral[600],
|
|
108
|
+
// hiContrast: colors.neutral[50],
|
|
109
|
+
// loContrast: colors.neutral[200],
|
|
110
|
+
fill: "#737373",
|
|
111
|
+
stroke: "#525252",
|
|
112
|
+
hiContrast: "#fafafa",
|
|
113
|
+
loContrast: "#d4d4d4"
|
|
114
|
+
},
|
|
115
|
+
red: {
|
|
116
|
+
// fill: colors.red[500],
|
|
117
|
+
// stroke: colors.red[600],
|
|
118
|
+
// hiContrast: colors.red[50],
|
|
119
|
+
// loContrast: colors.red[200],
|
|
120
|
+
fill: "#AC4D39",
|
|
121
|
+
// fill: '#b54548',
|
|
122
|
+
stroke: "#853A2D",
|
|
123
|
+
// hiContrast: '#fef2f2',
|
|
124
|
+
// loContrast: '#fecaca',
|
|
125
|
+
// hiContrast: '#191111', // colors.gray[900],
|
|
126
|
+
// loContrast: '#3b1219' // colors.gray[800],
|
|
127
|
+
hiContrast: "#FBD3CB",
|
|
128
|
+
// hiContrast: '#f8fafc',
|
|
129
|
+
// loContrast: '#fdd8d8' // radix black red 12
|
|
130
|
+
loContrast: "#f5b2a3"
|
|
131
|
+
},
|
|
132
|
+
green: {
|
|
133
|
+
fill: "#428a4f",
|
|
134
|
+
stroke: "#2d5d39",
|
|
135
|
+
hiContrast: "#f8fafc",
|
|
136
|
+
loContrast: "#c2f0c2"
|
|
137
|
+
},
|
|
138
|
+
amber: {
|
|
139
|
+
fill: "#A35829",
|
|
140
|
+
stroke: "#7E451D",
|
|
141
|
+
hiContrast: "#FFE0C2",
|
|
142
|
+
loContrast: "#f9b27c"
|
|
143
|
+
},
|
|
144
|
+
indigo: {
|
|
145
|
+
// fill: colors.indigo[500],
|
|
146
|
+
// stroke: colors.indigo[600],
|
|
147
|
+
// hiContrast: colors.indigo[50],
|
|
148
|
+
// loContrast: colors.indigo[200],
|
|
149
|
+
fill: "#6366f1",
|
|
150
|
+
stroke: "#4f46e5",
|
|
151
|
+
hiContrast: "#eef2ff",
|
|
152
|
+
loContrast: "#c7d2fe"
|
|
153
|
+
}
|
|
154
|
+
}, gray = {
|
|
155
|
+
lineColor: "#6E6E6E",
|
|
156
|
+
labelBgColor: "#18191b",
|
|
157
|
+
labelColor: "#C6C6C6"
|
|
158
|
+
}, slate = {
|
|
159
|
+
lineColor: "#64748b",
|
|
160
|
+
// 500
|
|
161
|
+
labelBgColor: "#0f172a",
|
|
162
|
+
// 900
|
|
163
|
+
labelColor: "#cbd5e1"
|
|
164
|
+
// 300
|
|
165
|
+
}, blue = {
|
|
166
|
+
lineColor: "#3b82f6",
|
|
167
|
+
// 500
|
|
168
|
+
labelBgColor: "#172554",
|
|
169
|
+
// 950
|
|
170
|
+
labelColor: "#60a5fa"
|
|
171
|
+
// 400
|
|
172
|
+
}, sky = {
|
|
173
|
+
lineColor: "#0ea5e9",
|
|
174
|
+
// 500
|
|
175
|
+
labelBgColor: "#082f49",
|
|
176
|
+
// 950
|
|
177
|
+
labelColor: "#38bdf8"
|
|
178
|
+
// 400
|
|
179
|
+
}, RelationshipColors = {
|
|
180
|
+
amber: {
|
|
181
|
+
lineColor: "#b45309",
|
|
182
|
+
labelBgColor: "#78350f",
|
|
183
|
+
labelColor: "#FFE0C2"
|
|
184
|
+
},
|
|
185
|
+
blue,
|
|
186
|
+
gray,
|
|
187
|
+
green: {
|
|
188
|
+
lineColor: "#15803d",
|
|
189
|
+
// 700
|
|
190
|
+
labelBgColor: "#052e16",
|
|
191
|
+
// 950
|
|
192
|
+
labelColor: "#22c55e"
|
|
193
|
+
// 500
|
|
194
|
+
},
|
|
195
|
+
indigo: {
|
|
196
|
+
lineColor: "#6366f1",
|
|
197
|
+
// 500
|
|
198
|
+
labelBgColor: "#1e1b4b",
|
|
199
|
+
// 950
|
|
200
|
+
labelColor: "#818cf8"
|
|
201
|
+
// 400
|
|
202
|
+
},
|
|
203
|
+
muted: slate,
|
|
204
|
+
primary: blue,
|
|
205
|
+
red: {
|
|
206
|
+
lineColor: "#AC4D39",
|
|
207
|
+
labelBgColor: "#b91c1c",
|
|
208
|
+
labelColor: "#f5b2a3"
|
|
209
|
+
},
|
|
210
|
+
secondary: sky,
|
|
211
|
+
sky,
|
|
212
|
+
slate
|
|
213
|
+
}, defaultTheme = {
|
|
214
|
+
elements: ElementColors,
|
|
215
|
+
relationships: RelationshipColors,
|
|
216
|
+
font: "Arial",
|
|
217
|
+
shadow: "#0a0a0a"
|
|
218
|
+
};
|
|
219
|
+
function fixProto(target, prototype) {
|
|
220
|
+
var setPrototypeOf = Object.setPrototypeOf;
|
|
221
|
+
setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype;
|
|
86
222
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
223
|
+
function fixStack(target, fn) {
|
|
224
|
+
fn === void 0 && (fn = target.constructor);
|
|
225
|
+
var captureStackTrace = Error.captureStackTrace;
|
|
226
|
+
captureStackTrace && captureStackTrace(target, fn);
|
|
227
|
+
}
|
|
228
|
+
var __extends = /* @__PURE__ */ function() {
|
|
229
|
+
var _extendStatics = function(d2, b2) {
|
|
230
|
+
return _extendStatics = Object.setPrototypeOf || {
|
|
231
|
+
__proto__: []
|
|
232
|
+
} instanceof Array && function(d3, b3) {
|
|
233
|
+
d3.__proto__ = b3;
|
|
234
|
+
} || function(d3, b3) {
|
|
235
|
+
for (var p2 in b3)
|
|
236
|
+
Object.prototype.hasOwnProperty.call(b3, p2) && (d3[p2] = b3[p2]);
|
|
237
|
+
}, _extendStatics(d2, b2);
|
|
238
|
+
};
|
|
239
|
+
return function(d2, b2) {
|
|
240
|
+
if (typeof b2 != "function" && b2 !== null) throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
|
|
241
|
+
_extendStatics(d2, b2);
|
|
242
|
+
function __() {
|
|
243
|
+
this.constructor = d2;
|
|
244
|
+
}
|
|
245
|
+
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
|
|
97
246
|
};
|
|
247
|
+
}(), CustomError = function(_super) {
|
|
248
|
+
__extends(CustomError2, _super);
|
|
249
|
+
function CustomError2(message, options) {
|
|
250
|
+
var _newTarget = this.constructor, _this = _super.call(this, message, options) || this;
|
|
251
|
+
return Object.defineProperty(_this, "name", {
|
|
252
|
+
value: _newTarget.name,
|
|
253
|
+
enumerable: !1,
|
|
254
|
+
configurable: !0
|
|
255
|
+
}), fixProto(_this, _newTarget.prototype), fixStack(_this), _this;
|
|
256
|
+
}
|
|
257
|
+
return CustomError2;
|
|
258
|
+
}(Error), s = { done: !1, hasNext: !1 };
|
|
259
|
+
function u$6(t2, n2, a2) {
|
|
260
|
+
let o2 = (r2) => t2(r2, ...n2);
|
|
261
|
+
return a2 === void 0 ? o2 : Object.assign(o2, { lazy: a2, lazyArgs: n2 });
|
|
98
262
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
263
|
+
function u$5(r2, n2, a2) {
|
|
264
|
+
let o2 = r2.length - n2.length;
|
|
265
|
+
if (o2 === 0) return r2(...n2);
|
|
266
|
+
if (o2 === 1) return u$6(r2, n2, a2);
|
|
267
|
+
throw new Error("Wrong number of arguments");
|
|
101
268
|
}
|
|
102
|
-
|
|
103
|
-
return
|
|
104
|
-
};
|
|
105
|
-
function sameValueZeroEqual(a2, b2) {
|
|
106
|
-
return a2 || b2 ? a2 === b2 : a2 === b2 || a2 !== a2 && b2 !== b2;
|
|
269
|
+
function r$3(...t2) {
|
|
270
|
+
return u$5(Object.values, t2);
|
|
107
271
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var index2 = a2.length;
|
|
111
|
-
if (b2.length !== index2)
|
|
112
|
-
return !1;
|
|
113
|
-
for (; index2-- > 0; )
|
|
114
|
-
if (!state.equals(a2[index2], b2[index2], index2, index2, a2, b2, state))
|
|
115
|
-
return !1;
|
|
116
|
-
return !0;
|
|
272
|
+
function i$3(...e2) {
|
|
273
|
+
return u$5(r$2, e2);
|
|
117
274
|
}
|
|
118
|
-
|
|
119
|
-
|
|
275
|
+
var r$2 = (e2, t2) => e2.length >= t2;
|
|
276
|
+
function u$4(...e2) {
|
|
277
|
+
return u$5(i$2, e2);
|
|
120
278
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var _a = aResult.value, aKey = _a[0], aValue = _a[1], _b = bResult.value, bKey = _b[0], bValue = _b[1];
|
|
127
|
-
!hasMatch && !matchedIndices[matchIndex] && (hasMatch = state.equals(aKey, bKey, index2, matchIndex, a2, b2, state) && state.equals(aValue, bValue, aKey, bKey, a2, b2, state)) && (matchedIndices[matchIndex] = !0), matchIndex++;
|
|
128
|
-
}
|
|
129
|
-
if (!hasMatch)
|
|
130
|
-
return !1;
|
|
131
|
-
index2++;
|
|
279
|
+
function i$2(e2, a2) {
|
|
280
|
+
let n2 = [];
|
|
281
|
+
for (let [o2, r2] of e2.entries()) {
|
|
282
|
+
if (!a2(r2, o2, e2)) break;
|
|
283
|
+
n2.push(r2);
|
|
132
284
|
}
|
|
133
|
-
return
|
|
285
|
+
return n2;
|
|
134
286
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
137
|
-
if (keys(b2).length !== index2)
|
|
138
|
-
return !1;
|
|
139
|
-
for (var property; index2-- > 0; )
|
|
140
|
-
if (property = properties[index2], property === OWNER && (a2.$$typeof || b2.$$typeof) && a2.$$typeof !== b2.$$typeof || !hasOwn(b2, property) || !state.equals(a2[property], b2[property], property, property, a2, b2, state))
|
|
141
|
-
return !1;
|
|
142
|
-
return !0;
|
|
287
|
+
function l$1(...e2) {
|
|
288
|
+
return u$5(u$3, e2);
|
|
143
289
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
|
|
290
|
+
var u$3 = (e2, a2, n2) => e2.reduce(a2, n2);
|
|
291
|
+
function b(t2) {
|
|
292
|
+
return (e2, r2) => {
|
|
293
|
+
if (r2 === 0) return t2(e2);
|
|
294
|
+
if (!Number.isInteger(r2)) throw new TypeError(`precision must be an integer: ${r2}`);
|
|
295
|
+
if (r2 > 15 || r2 < -15) throw new RangeError("precision must be between -15 and 15");
|
|
296
|
+
if (Number.isNaN(e2) || !Number.isFinite(e2)) return t2(e2);
|
|
297
|
+
let n2 = 10 ** r2;
|
|
298
|
+
return t2(e2 * n2) / n2;
|
|
299
|
+
};
|
|
152
300
|
}
|
|
153
|
-
function
|
|
154
|
-
return
|
|
301
|
+
function p$1(...o2) {
|
|
302
|
+
return u$5(t$4, o2);
|
|
155
303
|
}
|
|
156
|
-
|
|
157
|
-
|
|
304
|
+
var t$4 = (o2, e2) => o2[e2];
|
|
305
|
+
function a$2(...n2) {
|
|
306
|
+
return u$5(c, n2);
|
|
307
|
+
}
|
|
308
|
+
function c(n2, r2) {
|
|
309
|
+
let o2 = {};
|
|
310
|
+
for (let e2 of r2) e2 in n2 && (o2[e2] = n2[e2]);
|
|
311
|
+
return o2;
|
|
312
|
+
}
|
|
313
|
+
function t$3(...n2) {
|
|
314
|
+
return u$5(Object.keys, n2);
|
|
315
|
+
}
|
|
316
|
+
function a$1(...e2) {
|
|
317
|
+
return u$5(n$2, e2);
|
|
318
|
+
}
|
|
319
|
+
var n$2 = (e2) => e2.at(-1);
|
|
320
|
+
function m$1(...a2) {
|
|
321
|
+
return u$5(o$2, a2, p);
|
|
322
|
+
}
|
|
323
|
+
var o$2 = (a2, e2) => a2.map(e2), p = (a2) => (e2, r2, t2) => ({ done: !1, hasNext: !0, next: a2(e2, r2, t2) });
|
|
324
|
+
function n$1(e2) {
|
|
325
|
+
return !!e2;
|
|
326
|
+
}
|
|
327
|
+
function l(n2) {
|
|
328
|
+
return n2 != null;
|
|
329
|
+
}
|
|
330
|
+
function o$1(a2) {
|
|
331
|
+
return (t2) => !a2(t2);
|
|
332
|
+
}
|
|
333
|
+
function e$3(n2) {
|
|
334
|
+
return n2 == null;
|
|
335
|
+
}
|
|
336
|
+
function e$2(r2) {
|
|
337
|
+
return typeof r2 == "number" && !Number.isNaN(r2);
|
|
338
|
+
}
|
|
339
|
+
function n(r2) {
|
|
340
|
+
return Array.isArray(r2);
|
|
341
|
+
}
|
|
342
|
+
var e$1 = (n2) => Object.assign(n2, { single: !0 });
|
|
343
|
+
function f(...e2) {
|
|
344
|
+
return u$5(i$1, e2, e$1(u$2));
|
|
345
|
+
}
|
|
346
|
+
var i$1 = (e2, n2) => e2.find(n2), u$2 = (e2) => (n2, t2, o2) => e2(n2, t2, o2) ? { done: !0, hasNext: !0, next: n2 } : s;
|
|
347
|
+
function d(...e2) {
|
|
348
|
+
return u$5(r$1, e2, e$1(o));
|
|
349
|
+
}
|
|
350
|
+
var r$1 = ([e2]) => e2, o = () => a, a = (e2) => ({ hasNext: !0, next: e2, done: !0 });
|
|
351
|
+
function t$2(...r2) {
|
|
352
|
+
return u$5(Object.entries, r2);
|
|
353
|
+
}
|
|
354
|
+
function t$1(...a2) {
|
|
355
|
+
return u$5(e, a2);
|
|
356
|
+
}
|
|
357
|
+
var e = (a2, o2) => o2.every((l2) => l2(a2));
|
|
358
|
+
function y$1(...a2) {
|
|
359
|
+
return u$5(r, a2);
|
|
360
|
+
}
|
|
361
|
+
var r = (a2, o2) => o2.some((e2) => e2(a2));
|
|
362
|
+
function u$1(...e2) {
|
|
363
|
+
return u$5(b(Math.ceil), e2);
|
|
364
|
+
}
|
|
365
|
+
function u(...n2) {
|
|
366
|
+
return u$5(i, n2);
|
|
367
|
+
}
|
|
368
|
+
var i = (n2, { min: e2, max: r2 }) => e2 !== void 0 && n2 < e2 ? e2 : r2 !== void 0 && n2 > r2 ? r2 : n2;
|
|
369
|
+
function isString$1(value) {
|
|
370
|
+
return value != null && typeof value == "string";
|
|
371
|
+
}
|
|
372
|
+
class BaseError extends CustomError {
|
|
373
|
+
constructor(message, options) {
|
|
374
|
+
super(message, options), Object.defineProperty(this, "name", { value: "BaseError" });
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
class NullableError extends BaseError {
|
|
378
|
+
constructor(message, options) {
|
|
379
|
+
super(message, options), Object.defineProperty(this, "name", { value: "NullableError" });
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
class InvariantError extends BaseError {
|
|
383
|
+
constructor(message, options) {
|
|
384
|
+
super(message, options), Object.defineProperty(this, "name", { value: "InvariantError" });
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function nonNullable(value, message) {
|
|
388
|
+
if (typeof value > "u" || value == null)
|
|
389
|
+
throw new NullableError(message ?? `Expected defined value, but received ${value}`);
|
|
390
|
+
return value;
|
|
391
|
+
}
|
|
392
|
+
function invariant$1(condition, message) {
|
|
393
|
+
if (!condition)
|
|
394
|
+
throw new InvariantError(message ?? "Invariant failed");
|
|
395
|
+
}
|
|
396
|
+
class NonExhaustiveError extends BaseError {
|
|
397
|
+
constructor(message, options) {
|
|
398
|
+
super(message, options), Object.defineProperty(this, "name", { value: "NonExhaustiveError" });
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function nonexhaustive(value) {
|
|
402
|
+
throw new NonExhaustiveError(`NonExhaustive value: ${value}`);
|
|
403
|
+
}
|
|
404
|
+
const ElementShapes = [
|
|
405
|
+
"rectangle",
|
|
406
|
+
"person",
|
|
407
|
+
"browser",
|
|
408
|
+
"mobile",
|
|
409
|
+
"cylinder",
|
|
410
|
+
"storage",
|
|
411
|
+
"queue"
|
|
412
|
+
], isTagEqual = (operator) => "tag" in operator, isKindEqual = (operator) => "kind" in operator, isNotOperator = (operator) => "not" in operator, isAndOperator = (operator) => "and" in operator, isOrOperator = (operator) => "or" in operator;
|
|
413
|
+
function whereOperatorAsPredicate(operator) {
|
|
414
|
+
switch (!0) {
|
|
415
|
+
case isTagEqual(operator): {
|
|
416
|
+
if ("eq" in operator.tag) {
|
|
417
|
+
const tag2 = operator.tag.eq;
|
|
418
|
+
return (value) => Array.isArray(value.tags) && value.tags.includes(tag2);
|
|
419
|
+
}
|
|
420
|
+
const tag = operator.tag.neq;
|
|
421
|
+
return (value) => !Array.isArray(value.tags) || !value.tags.includes(tag);
|
|
422
|
+
}
|
|
423
|
+
case isKindEqual(operator): {
|
|
424
|
+
if ("eq" in operator.kind) {
|
|
425
|
+
const kind2 = operator.kind.eq;
|
|
426
|
+
return (value) => value.kind === kind2;
|
|
427
|
+
}
|
|
428
|
+
const kind = operator.kind.neq;
|
|
429
|
+
return (value) => e$3(value.kind) || value.kind !== kind;
|
|
430
|
+
}
|
|
431
|
+
case isNotOperator(operator): {
|
|
432
|
+
const predicate = whereOperatorAsPredicate(operator.not);
|
|
433
|
+
return o$1(predicate);
|
|
434
|
+
}
|
|
435
|
+
case isAndOperator(operator): {
|
|
436
|
+
const predicates = operator.and.map(whereOperatorAsPredicate);
|
|
437
|
+
return t$1(predicates);
|
|
438
|
+
}
|
|
439
|
+
case isOrOperator(operator): {
|
|
440
|
+
const predicates = operator.or.map(whereOperatorAsPredicate);
|
|
441
|
+
return y$1(predicates);
|
|
442
|
+
}
|
|
443
|
+
default:
|
|
444
|
+
nonexhaustive(operator);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
function StepEdgeId(step) {
|
|
448
|
+
return `step-${String(step).padStart(3, "0")}`;
|
|
449
|
+
}
|
|
450
|
+
function isStepEdgeId(id2) {
|
|
451
|
+
return id2.startsWith("step-");
|
|
452
|
+
}
|
|
453
|
+
function extractStep(id2) {
|
|
454
|
+
if (!isStepEdgeId(id2))
|
|
455
|
+
throw new Error(`Invalid step edge id: ${id2}`);
|
|
456
|
+
return Number(id2.slice(5));
|
|
457
|
+
}
|
|
458
|
+
function getBBoxCenter({
|
|
459
|
+
x: x2,
|
|
460
|
+
y: y2,
|
|
461
|
+
width,
|
|
462
|
+
height
|
|
463
|
+
}) {
|
|
464
|
+
return {
|
|
465
|
+
x: x2 + width / 2,
|
|
466
|
+
y: y2 + height / 2
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
function isAncestor(...args) {
|
|
470
|
+
const ancestor = isString$1(args[0]) ? args[0] : args[0].id;
|
|
471
|
+
return (isString$1(args[1]) ? args[1] : args[1].id).startsWith(ancestor + ".");
|
|
472
|
+
}
|
|
473
|
+
var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
474
|
+
function combineComparators(comparatorA, comparatorB) {
|
|
475
|
+
return function(a2, b2, state) {
|
|
476
|
+
return comparatorA(a2, b2, state) && comparatorB(a2, b2, state);
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
function createIsCircular(areItemsEqual) {
|
|
480
|
+
return function(a2, b2, state) {
|
|
481
|
+
if (!a2 || !b2 || typeof a2 != "object" || typeof b2 != "object")
|
|
482
|
+
return areItemsEqual(a2, b2, state);
|
|
483
|
+
var cache = state.cache, cachedA = cache.get(a2), cachedB = cache.get(b2);
|
|
484
|
+
if (cachedA && cachedB)
|
|
485
|
+
return cachedA === b2 && cachedB === a2;
|
|
486
|
+
cache.set(a2, b2), cache.set(b2, a2);
|
|
487
|
+
var result = areItemsEqual(a2, b2, state);
|
|
488
|
+
return cache.delete(a2), cache.delete(b2), result;
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
function getStrictProperties(object) {
|
|
492
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
493
|
+
}
|
|
494
|
+
var hasOwn = Object.hasOwn || function(object, property) {
|
|
495
|
+
return hasOwnProperty.call(object, property);
|
|
496
|
+
};
|
|
497
|
+
function sameValueZeroEqual(a2, b2) {
|
|
498
|
+
return a2 || b2 ? a2 === b2 : a2 === b2 || a2 !== a2 && b2 !== b2;
|
|
499
|
+
}
|
|
500
|
+
var OWNER = "_owner", getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, keys = Object.keys;
|
|
501
|
+
function areArraysEqual(a2, b2, state) {
|
|
502
|
+
var index2 = a2.length;
|
|
503
|
+
if (b2.length !== index2)
|
|
504
|
+
return !1;
|
|
505
|
+
for (; index2-- > 0; )
|
|
506
|
+
if (!state.equals(a2[index2], b2[index2], index2, index2, a2, b2, state))
|
|
507
|
+
return !1;
|
|
508
|
+
return !0;
|
|
509
|
+
}
|
|
510
|
+
function areDatesEqual(a2, b2) {
|
|
511
|
+
return sameValueZeroEqual(a2.getTime(), b2.getTime());
|
|
512
|
+
}
|
|
513
|
+
function areMapsEqual(a2, b2, state) {
|
|
514
|
+
if (a2.size !== b2.size)
|
|
515
|
+
return !1;
|
|
516
|
+
for (var matchedIndices = {}, aIterable = a2.entries(), index2 = 0, aResult, bResult; (aResult = aIterable.next()) && !aResult.done; ) {
|
|
517
|
+
for (var bIterable = b2.entries(), hasMatch = !1, matchIndex = 0; (bResult = bIterable.next()) && !bResult.done; ) {
|
|
518
|
+
var _a = aResult.value, aKey = _a[0], aValue = _a[1], _b = bResult.value, bKey = _b[0], bValue = _b[1];
|
|
519
|
+
!hasMatch && !matchedIndices[matchIndex] && (hasMatch = state.equals(aKey, bKey, index2, matchIndex, a2, b2, state) && state.equals(aValue, bValue, aKey, bKey, a2, b2, state)) && (matchedIndices[matchIndex] = !0), matchIndex++;
|
|
520
|
+
}
|
|
521
|
+
if (!hasMatch)
|
|
522
|
+
return !1;
|
|
523
|
+
index2++;
|
|
524
|
+
}
|
|
525
|
+
return !0;
|
|
526
|
+
}
|
|
527
|
+
function areObjectsEqual(a2, b2, state) {
|
|
528
|
+
var properties = keys(a2), index2 = properties.length;
|
|
529
|
+
if (keys(b2).length !== index2)
|
|
530
|
+
return !1;
|
|
531
|
+
for (var property; index2-- > 0; )
|
|
532
|
+
if (property = properties[index2], property === OWNER && (a2.$$typeof || b2.$$typeof) && a2.$$typeof !== b2.$$typeof || !hasOwn(b2, property) || !state.equals(a2[property], b2[property], property, property, a2, b2, state))
|
|
533
|
+
return !1;
|
|
534
|
+
return !0;
|
|
535
|
+
}
|
|
536
|
+
function areObjectsEqualStrict(a2, b2, state) {
|
|
537
|
+
var properties = getStrictProperties(a2), index2 = properties.length;
|
|
538
|
+
if (getStrictProperties(b2).length !== index2)
|
|
539
|
+
return !1;
|
|
540
|
+
for (var property, descriptorA, descriptorB; index2-- > 0; )
|
|
541
|
+
if (property = properties[index2], property === OWNER && (a2.$$typeof || b2.$$typeof) && a2.$$typeof !== b2.$$typeof || !hasOwn(b2, property) || !state.equals(a2[property], b2[property], property, property, a2, b2, state) || (descriptorA = getOwnPropertyDescriptor(a2, property), descriptorB = getOwnPropertyDescriptor(b2, property), (descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)))
|
|
542
|
+
return !1;
|
|
543
|
+
return !0;
|
|
544
|
+
}
|
|
545
|
+
function arePrimitiveWrappersEqual(a2, b2) {
|
|
546
|
+
return sameValueZeroEqual(a2.valueOf(), b2.valueOf());
|
|
547
|
+
}
|
|
548
|
+
function areRegExpsEqual(a2, b2) {
|
|
549
|
+
return a2.source === b2.source && a2.flags === b2.flags;
|
|
158
550
|
}
|
|
159
551
|
function areSetsEqual(a2, b2, state) {
|
|
160
552
|
if (a2.size !== b2.size)
|
|
@@ -300,7 +692,7 @@ function createCustomEqual(options) {
|
|
|
300
692
|
return createIsEqual({ circular, comparator, createState: createState2, equals, strict });
|
|
301
693
|
}
|
|
302
694
|
const MotionConfigContext = createContext$1({
|
|
303
|
-
transformPagePoint: (
|
|
695
|
+
transformPagePoint: (p2) => p2,
|
|
304
696
|
isStatic: !1,
|
|
305
697
|
reducedMotion: "never"
|
|
306
698
|
}), MotionContext = createContext$1({}), PresenceContext = createContext$1(null), isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$2 = isBrowser$1 ? useLayoutEffect$1 : useEffect$1, LazyContext = createContext$1({ strict: !1 }), camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), optimizedAppearDataId = "framerAppearId", optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId), MotionGlobalConfig = {
|
|
@@ -517,7 +909,7 @@ function loadFeatures(features) {
|
|
|
517
909
|
};
|
|
518
910
|
}
|
|
519
911
|
const LayoutGroupContext = createContext$1({}), motionComponentSymbol = Symbol.for("motionComponentSymbol"), noop$1 = (any) => any;
|
|
520
|
-
let invariant
|
|
912
|
+
let invariant = noop$1;
|
|
521
913
|
function createMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component: Component2 }) {
|
|
522
914
|
preloadedFeatures && loadFeatures(preloadedFeatures);
|
|
523
915
|
function MotionComponent(props2, externalRef) {
|
|
@@ -650,14 +1042,14 @@ const isMotionValue = (value) => !!(value && value.getVelocity), getValueAsType
|
|
|
650
1042
|
...number,
|
|
651
1043
|
default: 1
|
|
652
1044
|
}, sanitize = (v) => Math.round(v * 1e5) / 1e5, floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu, colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu, singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;
|
|
653
|
-
function isString
|
|
1045
|
+
function isString(v) {
|
|
654
1046
|
return typeof v == "string";
|
|
655
1047
|
}
|
|
656
1048
|
function isNullish(v) {
|
|
657
1049
|
return v == null;
|
|
658
1050
|
}
|
|
659
1051
|
const createUnitType = (unit) => ({
|
|
660
|
-
test: (v) => isString
|
|
1052
|
+
test: (v) => isString(v) && v.endsWith(unit) && v.split(" ").length === 1,
|
|
661
1053
|
parse: parseFloat,
|
|
662
1054
|
transform: (v) => `${v}${unit}`
|
|
663
1055
|
}), degrees = createUnitType("deg"), percent = createUnitType("%"), px = createUnitType("px"), vh = createUnitType("vh"), vw = createUnitType("vw"), progressPercentage = {
|
|
@@ -761,7 +1153,7 @@ function buildTransform(latestValues, transform, transformTemplate) {
|
|
|
761
1153
|
}
|
|
762
1154
|
const checkStringStartsWith = (token) => (key) => typeof key == "string" && key.startsWith(token), isCSSVariableName = checkStringStartsWith("--"), startsAsVariableToken = checkStringStartsWith("var(--"), isCSSVariableToken = (value) => startsAsVariableToken(value) ? singleCssVariableRegex.test(value.split("/*")[0].trim()) : !1, singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
|
|
763
1155
|
function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
764
|
-
const { style, vars, transformOrigin } = state;
|
|
1156
|
+
const { style, vars: vars2, transformOrigin } = state;
|
|
765
1157
|
let hasTransform = !1, hasTransformOrigin = !1;
|
|
766
1158
|
for (const key in latestValues) {
|
|
767
1159
|
const value = latestValues[key];
|
|
@@ -769,7 +1161,7 @@ function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
|
769
1161
|
hasTransform = !0;
|
|
770
1162
|
continue;
|
|
771
1163
|
} else if (isCSSVariableName(key)) {
|
|
772
|
-
|
|
1164
|
+
vars2[key] = value;
|
|
773
1165
|
continue;
|
|
774
1166
|
} else {
|
|
775
1167
|
const valueAsType = getValueAsType(value, numberValueTypes[key]);
|
|
@@ -920,10 +1312,10 @@ function createUseRender(forwardMotionProps = !1) {
|
|
|
920
1312
|
});
|
|
921
1313
|
};
|
|
922
1314
|
}
|
|
923
|
-
function renderHTML(element, { style, vars }, styleProp, projection) {
|
|
1315
|
+
function renderHTML(element, { style, vars: vars2 }, styleProp, projection) {
|
|
924
1316
|
Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));
|
|
925
|
-
for (const key in
|
|
926
|
-
element.style.setProperty(key,
|
|
1317
|
+
for (const key in vars2)
|
|
1318
|
+
element.style.setProperty(key, vars2[key]);
|
|
927
1319
|
}
|
|
928
1320
|
const camelCaseAttributes = /* @__PURE__ */ new Set([
|
|
929
1321
|
"baseFrequency",
|
|
@@ -1380,16 +1772,7 @@ function getFinalKeyframe(keyframes2, { repeat, repeatType = "loop" }, finalKeyf
|
|
|
1380
1772
|
const resolvedKeyframes = keyframes2.filter(isNotNull), index2 = repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : resolvedKeyframes.length - 1;
|
|
1381
1773
|
return !index2 || finalKeyframe === void 0 ? resolvedKeyframes[index2] : finalKeyframe;
|
|
1382
1774
|
}
|
|
1383
|
-
|
|
1384
|
-
function clearTime() {
|
|
1385
|
-
now = void 0;
|
|
1386
|
-
}
|
|
1387
|
-
const time = {
|
|
1388
|
-
now: () => (now === void 0 && time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()), now),
|
|
1389
|
-
set: (newTime) => {
|
|
1390
|
-
now = newTime, queueMicrotask(clearTime);
|
|
1391
|
-
}
|
|
1392
|
-
}, isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
|
|
1775
|
+
const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
|
|
1393
1776
|
function isNone(value) {
|
|
1394
1777
|
return typeof value == "number" ? value === 0 : value !== null ? value === "none" || value === "0" || isZeroValueString(value) : !0;
|
|
1395
1778
|
}
|
|
@@ -1531,14 +1914,14 @@ class KeyframeResolver {
|
|
|
1531
1914
|
this.isComplete || this.scheduleResolve();
|
|
1532
1915
|
}
|
|
1533
1916
|
}
|
|
1534
|
-
const isColorString = (type, testProp) => (v) => !!(isString
|
|
1535
|
-
if (!isString
|
|
1917
|
+
const isColorString = (type, testProp) => (v) => !!(isString(v) && singleColorRegex.test(v) && v.startsWith(type) || testProp && !isNullish(v) && Object.prototype.hasOwnProperty.call(v, testProp)), splitColor = (aName, bName, cName) => (v) => {
|
|
1918
|
+
if (!isString(v))
|
|
1536
1919
|
return v;
|
|
1537
|
-
const [a2, b2,
|
|
1920
|
+
const [a2, b2, c2, alpha2] = v.match(floatRegex);
|
|
1538
1921
|
return {
|
|
1539
1922
|
[aName]: parseFloat(a2),
|
|
1540
1923
|
[bName]: parseFloat(b2),
|
|
1541
|
-
[cName]: parseFloat(
|
|
1924
|
+
[cName]: parseFloat(c2),
|
|
1542
1925
|
alpha: alpha2 !== void 0 ? parseFloat(alpha2) : 1
|
|
1543
1926
|
};
|
|
1544
1927
|
}, clampRgbUnit = (v) => clamp(0, 255, v), rgbUnit = {
|
|
@@ -1569,11 +1952,11 @@ const hex = {
|
|
|
1569
1952
|
}, color = {
|
|
1570
1953
|
test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),
|
|
1571
1954
|
parse: (v) => rgba.test(v) ? rgba.parse(v) : hsla.test(v) ? hsla.parse(v) : hex.parse(v),
|
|
1572
|
-
transform: (v) => isString
|
|
1955
|
+
transform: (v) => isString(v) ? v : v.hasOwnProperty("red") ? rgba.transform(v) : hsla.transform(v)
|
|
1573
1956
|
};
|
|
1574
1957
|
function test(v) {
|
|
1575
1958
|
var _a, _b;
|
|
1576
|
-
return isNaN(v) && isString
|
|
1959
|
+
return isNaN(v) && isString(v) && (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) + (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) > 0;
|
|
1577
1960
|
}
|
|
1578
1961
|
const NUMBER_TOKEN = "number", COLOR_TOKEN = "color", VAR_TOKEN = "var", VAR_FUNCTION_TOKEN = "var(", SPLIT_TOKEN = "${}", complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
1579
1962
|
function analyseComplexValue(value) {
|
|
@@ -1662,12 +2045,12 @@ function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, n
|
|
|
1662
2045
|
unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);
|
|
1663
2046
|
}
|
|
1664
2047
|
class DOMKeyframesResolver extends KeyframeResolver {
|
|
1665
|
-
constructor(unresolvedKeyframes, onComplete, name, motionValue2) {
|
|
1666
|
-
super(unresolvedKeyframes, onComplete, name, motionValue2,
|
|
2048
|
+
constructor(unresolvedKeyframes, onComplete, name, motionValue2, element) {
|
|
2049
|
+
super(unresolvedKeyframes, onComplete, name, motionValue2, element, !0);
|
|
1667
2050
|
}
|
|
1668
2051
|
readKeyframes() {
|
|
1669
2052
|
const { unresolvedKeyframes, element, name } = this;
|
|
1670
|
-
if (!element.current)
|
|
2053
|
+
if (!element || !element.current)
|
|
1671
2054
|
return;
|
|
1672
2055
|
super.readKeyframes();
|
|
1673
2056
|
for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) {
|
|
@@ -1697,7 +2080,7 @@ class DOMKeyframesResolver extends KeyframeResolver {
|
|
|
1697
2080
|
}
|
|
1698
2081
|
measureInitialState() {
|
|
1699
2082
|
const { element, unresolvedKeyframes, name } = this;
|
|
1700
|
-
if (!element.current)
|
|
2083
|
+
if (!element || !element.current)
|
|
1701
2084
|
return;
|
|
1702
2085
|
name === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)), unresolvedKeyframes[0] = this.measuredOrigin;
|
|
1703
2086
|
const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
|
|
@@ -1706,7 +2089,7 @@ class DOMKeyframesResolver extends KeyframeResolver {
|
|
|
1706
2089
|
measureEndState() {
|
|
1707
2090
|
var _a;
|
|
1708
2091
|
const { element, name, unresolvedKeyframes } = this;
|
|
1709
|
-
if (!element.current)
|
|
2092
|
+
if (!element || !element.current)
|
|
1710
2093
|
return;
|
|
1711
2094
|
const value = element.getValue(name);
|
|
1712
2095
|
value && value.jump(this.measuredOrigin, !1);
|
|
@@ -1720,7 +2103,16 @@ function memo(callback) {
|
|
|
1720
2103
|
let result;
|
|
1721
2104
|
return () => (result === void 0 && (result = callback()), result);
|
|
1722
2105
|
}
|
|
1723
|
-
|
|
2106
|
+
let now;
|
|
2107
|
+
function clearTime() {
|
|
2108
|
+
now = void 0;
|
|
2109
|
+
}
|
|
2110
|
+
const time = {
|
|
2111
|
+
now: () => (now === void 0 && time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()), now),
|
|
2112
|
+
set: (newTime) => {
|
|
2113
|
+
now = newTime, queueMicrotask(clearTime);
|
|
2114
|
+
}
|
|
2115
|
+
}, isAnimatable = (value, name) => name === "zIndex" ? !1 : !!(typeof value == "number" || Array.isArray(value) || typeof value == "string" && // It's animatable if we have a string
|
|
1724
2116
|
(complex.test(value) || value === "0") && // And it contains numbers and/or colors
|
|
1725
2117
|
!value.startsWith("url("));
|
|
1726
2118
|
function hasKeyframesChanged(keyframes2) {
|
|
@@ -1740,9 +2132,10 @@ function canAnimate(keyframes2, name, type, velocity) {
|
|
|
1740
2132
|
const targetKeyframe = keyframes2[keyframes2.length - 1], isOriginAnimatable = isAnimatable(originKeyframe, name), isTargetAnimatable = isAnimatable(targetKeyframe, name);
|
|
1741
2133
|
return !isOriginAnimatable || !isTargetAnimatable ? !1 : hasKeyframesChanged(keyframes2) || type === "spring" && velocity;
|
|
1742
2134
|
}
|
|
2135
|
+
const MAX_RESOLVE_DELAY = 40;
|
|
1743
2136
|
class BaseAnimation {
|
|
1744
2137
|
constructor({ autoplay = !0, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", ...options }) {
|
|
1745
|
-
this.isStopped = !1, this.hasAttemptedResolve = !1, this.options = {
|
|
2138
|
+
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = time.now(), this.options = {
|
|
1746
2139
|
autoplay,
|
|
1747
2140
|
delay,
|
|
1748
2141
|
type,
|
|
@@ -1752,6 +2145,19 @@ class BaseAnimation {
|
|
|
1752
2145
|
...options
|
|
1753
2146
|
}, this.updateFinishedPromise();
|
|
1754
2147
|
}
|
|
2148
|
+
/**
|
|
2149
|
+
* This method uses the createdAt and resolvedAt to calculate the
|
|
2150
|
+
* animation startTime. *Ideally*, we would use the createdAt time as t=0
|
|
2151
|
+
* as the following frame would then be the first frame of the animation in
|
|
2152
|
+
* progress, which would feel snappier.
|
|
2153
|
+
*
|
|
2154
|
+
* However, if there's a delay (main thread work) between the creation of
|
|
2155
|
+
* the animation and the first commited frame, we prefer to use resolvedAt
|
|
2156
|
+
* to avoid a sudden jump into the animation.
|
|
2157
|
+
*/
|
|
2158
|
+
calcStartTime() {
|
|
2159
|
+
return this.resolvedAt ? this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY ? this.resolvedAt : this.createdAt : this.createdAt;
|
|
2160
|
+
}
|
|
1755
2161
|
/**
|
|
1756
2162
|
* A getter for resolved data. If keyframes are not yet resolved, accessing
|
|
1757
2163
|
* this.resolved will synchronously flush all pending keyframe resolvers.
|
|
@@ -1766,7 +2172,7 @@ class BaseAnimation {
|
|
|
1766
2172
|
* Otherwise, it will call initPlayback on the implementing class.
|
|
1767
2173
|
*/
|
|
1768
2174
|
onKeyframesResolved(keyframes2, finalKeyframe) {
|
|
1769
|
-
this.hasAttemptedResolve = !0;
|
|
2175
|
+
this.resolvedAt = time.now(), this.hasAttemptedResolve = !0;
|
|
1770
2176
|
const { name, type, velocity, delay, onComplete, onUpdate, isGenerator } = this.options;
|
|
1771
2177
|
if (!isGenerator && !canAnimate(keyframes2, name, type, velocity))
|
|
1772
2178
|
if (delay)
|
|
@@ -1810,8 +2216,8 @@ const safeMin = 1e-3, minDuration = 0.01, maxDuration$1 = 10, minDamping = 0.05,
|
|
|
1810
2216
|
function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1 }) {
|
|
1811
2217
|
let envelope, derivative, dampingRatio = 1 - bounce;
|
|
1812
2218
|
dampingRatio = clamp(minDamping, maxDamping, dampingRatio), duration = clamp(minDuration, maxDuration$1, millisecondsToSeconds(duration)), dampingRatio < 1 ? (envelope = (undampedFreq2) => {
|
|
1813
|
-
const exponentialDecay = undampedFreq2 * dampingRatio, delta = exponentialDecay * duration, a2 = exponentialDecay - velocity, b2 = calcAngularFreq(undampedFreq2, dampingRatio),
|
|
1814
|
-
return safeMin - a2 / b2 *
|
|
2219
|
+
const exponentialDecay = undampedFreq2 * dampingRatio, delta = exponentialDecay * duration, a2 = exponentialDecay - velocity, b2 = calcAngularFreq(undampedFreq2, dampingRatio), c2 = Math.exp(-delta);
|
|
2220
|
+
return safeMin - a2 / b2 * c2;
|
|
1815
2221
|
}, derivative = (undampedFreq2) => {
|
|
1816
2222
|
const delta = undampedFreq2 * dampingRatio * duration, d2 = delta * velocity + velocity, e2 = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq2, 2) * duration, f2 = Math.exp(-delta), g = calcAngularFreq(Math.pow(undampedFreq2, 2), dampingRatio);
|
|
1817
2223
|
return (-envelope(undampedFreq2) + safeMin > 0 ? -1 : 1) * ((d2 - e2) * f2) / g;
|
|
@@ -1955,7 +2361,7 @@ function cubicBezier(mX1, mY1, mX2, mY2) {
|
|
|
1955
2361
|
const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
|
|
1956
2362
|
return (t2) => t2 === 0 || t2 === 1 ? t2 : calcBezier(getTForX(t2), mY1, mY2);
|
|
1957
2363
|
}
|
|
1958
|
-
const easeIn = cubicBezier(0.42, 0, 1, 1), easeOut = cubicBezier(0, 0, 0.58, 1), easeInOut = cubicBezier(0.42, 0, 0.58, 1), isEasingArray = (ease2) => Array.isArray(ease2) && typeof ease2[0] != "number", mirrorEasing = (easing) => (
|
|
2364
|
+
const easeIn = cubicBezier(0.42, 0, 1, 1), easeOut = cubicBezier(0, 0, 0.58, 1), easeInOut = cubicBezier(0.42, 0, 0.58, 1), isEasingArray = (ease2) => Array.isArray(ease2) && typeof ease2[0] != "number", mirrorEasing = (easing) => (p2) => p2 <= 0.5 ? easing(2 * p2) / 2 : (2 - easing(2 * (1 - p2))) / 2, reverseEasing = (easing) => (p2) => 1 - easing(1 - p2), circIn = (p2) => 1 - Math.sin(Math.acos(p2)), circOut = reverseEasing(circIn), circInOut = mirrorEasing(circIn), backOut = cubicBezier(0.33, 1.53, 0.69, 0.99), backIn = reverseEasing(backOut), backInOut = mirrorEasing(backIn), anticipate = (p2) => (p2 *= 2) < 1 ? 0.5 * backIn(p2) : 0.5 * (2 - Math.pow(2, -10 * (p2 - 1))), easingLookup = {
|
|
1959
2365
|
linear: noop$1,
|
|
1960
2366
|
easeIn,
|
|
1961
2367
|
easeInOut,
|
|
@@ -1969,18 +2375,18 @@ const easeIn = cubicBezier(0.42, 0, 1, 1), easeOut = cubicBezier(0, 0, 0.58, 1),
|
|
|
1969
2375
|
anticipate
|
|
1970
2376
|
}, easingDefinitionToFunction = (definition) => {
|
|
1971
2377
|
if (Array.isArray(definition)) {
|
|
1972
|
-
invariant
|
|
2378
|
+
invariant(definition.length === 4);
|
|
1973
2379
|
const [x1, y1, x2, y2] = definition;
|
|
1974
2380
|
return cubicBezier(x1, y1, x2, y2);
|
|
1975
2381
|
} else if (typeof definition == "string")
|
|
1976
|
-
return invariant
|
|
2382
|
+
return invariant(easingLookup[definition] !== void 0), easingLookup[definition];
|
|
1977
2383
|
return definition;
|
|
1978
2384
|
}, progress = (from, to, value) => {
|
|
1979
2385
|
const toFromDifference = to - from;
|
|
1980
2386
|
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
1981
2387
|
}, mixNumber$1 = (from, to, progress2) => from + (to - from) * progress2;
|
|
1982
|
-
function hueToRgb(
|
|
1983
|
-
return t2 < 0 && (t2 += 1), t2 > 1 && (t2 -= 1), t2 < 1 / 6 ?
|
|
2388
|
+
function hueToRgb(p2, q, t2) {
|
|
2389
|
+
return t2 < 0 && (t2 += 1), t2 > 1 && (t2 -= 1), t2 < 1 / 6 ? p2 + (q - p2) * 6 * t2 : t2 < 1 / 2 ? q : t2 < 2 / 3 ? p2 + (q - p2) * (2 / 3 - t2) * 6 : p2;
|
|
1984
2390
|
}
|
|
1985
2391
|
function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) {
|
|
1986
2392
|
hue /= 360, saturation /= 100, lightness /= 100;
|
|
@@ -1988,8 +2394,8 @@ function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) {
|
|
|
1988
2394
|
if (!saturation)
|
|
1989
2395
|
red = green = blue2 = lightness;
|
|
1990
2396
|
else {
|
|
1991
|
-
const q = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation,
|
|
1992
|
-
red = hueToRgb(
|
|
2397
|
+
const q = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation, p2 = 2 * lightness - q;
|
|
2398
|
+
red = hueToRgb(p2, q, hue + 1 / 3), green = hueToRgb(p2, q, hue), blue2 = hueToRgb(p2, q, hue - 1 / 3);
|
|
1993
2399
|
}
|
|
1994
2400
|
return {
|
|
1995
2401
|
red: Math.round(red * 255),
|
|
@@ -1999,7 +2405,7 @@ function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) {
|
|
|
1999
2405
|
};
|
|
2000
2406
|
}
|
|
2001
2407
|
function mixImmediate(a2, b2) {
|
|
2002
|
-
return (
|
|
2408
|
+
return (p2) => p2 > 0 ? b2 : a2;
|
|
2003
2409
|
}
|
|
2004
2410
|
const mixLinearColor = (from, to, v) => {
|
|
2005
2411
|
const fromExpo = from * from, expo = v * (to * to - fromExpo) + fromExpo;
|
|
@@ -2020,19 +2426,19 @@ const mixColor = (from, to) => {
|
|
|
2020
2426
|
return (v) => (blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v), blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v), blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v), blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v), rgba.transform(blended));
|
|
2021
2427
|
}, invisibleValues = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
2022
2428
|
function mixVisibility(origin, target) {
|
|
2023
|
-
return invisibleValues.has(origin) ? (
|
|
2429
|
+
return invisibleValues.has(origin) ? (p2) => p2 <= 0 ? origin : target : (p2) => p2 >= 1 ? target : origin;
|
|
2024
2430
|
}
|
|
2025
2431
|
function mixNumber(a2, b2) {
|
|
2026
|
-
return (
|
|
2432
|
+
return (p2) => mixNumber$1(a2, b2, p2);
|
|
2027
2433
|
}
|
|
2028
2434
|
function getMixer(a2) {
|
|
2029
2435
|
return typeof a2 == "number" ? mixNumber : typeof a2 == "string" ? isCSSVariableToken(a2) ? mixImmediate : color.test(a2) ? mixColor : mixComplex : Array.isArray(a2) ? mixArray : typeof a2 == "object" ? color.test(a2) ? mixColor : mixObject : mixImmediate;
|
|
2030
2436
|
}
|
|
2031
2437
|
function mixArray(a2, b2) {
|
|
2032
2438
|
const output = [...a2], numValues = output.length, blendValue = a2.map((v, i2) => getMixer(v)(v, b2[i2]));
|
|
2033
|
-
return (
|
|
2439
|
+
return (p2) => {
|
|
2034
2440
|
for (let i2 = 0; i2 < numValues; i2++)
|
|
2035
|
-
output[i2] = blendValue[i2](
|
|
2441
|
+
output[i2] = blendValue[i2](p2);
|
|
2036
2442
|
return output;
|
|
2037
2443
|
};
|
|
2038
2444
|
}
|
|
@@ -2059,8 +2465,8 @@ const mixComplex = (origin, target) => {
|
|
|
2059
2465
|
const template = complex.createTransformer(target), originStats = analyseComplexValue(origin), targetStats = analyseComplexValue(target);
|
|
2060
2466
|
return originStats.indexes.var.length === targetStats.indexes.var.length && originStats.indexes.color.length === targetStats.indexes.color.length && originStats.indexes.number.length >= targetStats.indexes.number.length ? invisibleValues.has(origin) && !targetStats.values.length || invisibleValues.has(target) && !originStats.values.length ? mixVisibility(origin, target) : pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template) : mixImmediate(origin, target);
|
|
2061
2467
|
};
|
|
2062
|
-
function mix(from, to,
|
|
2063
|
-
return typeof from == "number" && typeof to == "number" && typeof
|
|
2468
|
+
function mix(from, to, p2) {
|
|
2469
|
+
return typeof from == "number" && typeof to == "number" && typeof p2 == "number" ? mixNumber$1(from, to, p2) : getMixer(from)(from, to);
|
|
2064
2470
|
}
|
|
2065
2471
|
function createMixers(output, ease2, customMixer) {
|
|
2066
2472
|
const mixers = [], mixerFactory = customMixer || mix, numMixers = output.length - 1;
|
|
@@ -2076,7 +2482,7 @@ function createMixers(output, ease2, customMixer) {
|
|
|
2076
2482
|
}
|
|
2077
2483
|
function interpolate(input, output, { clamp: isClamp = !0, ease: ease2, mixer } = {}) {
|
|
2078
2484
|
const inputLength = input.length;
|
|
2079
|
-
if (invariant
|
|
2485
|
+
if (invariant(inputLength === output.length), inputLength === 1)
|
|
2080
2486
|
return () => output[0];
|
|
2081
2487
|
if (inputLength === 2 && input[0] === input[1])
|
|
2082
2488
|
return () => output[1];
|
|
@@ -2153,16 +2559,16 @@ const frameloopDriver = (update) => {
|
|
|
2153
2559
|
spring
|
|
2154
2560
|
}, percentToProgress = (percent2) => percent2 / 100;
|
|
2155
2561
|
class MainThreadAnimation extends BaseAnimation {
|
|
2156
|
-
constructor(
|
|
2157
|
-
super(options), this.holdTime = null, this.
|
|
2562
|
+
constructor(options) {
|
|
2563
|
+
super(options), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
|
|
2158
2564
|
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
2159
2565
|
return;
|
|
2160
2566
|
this.teardown();
|
|
2161
2567
|
const { onStop } = this.options;
|
|
2162
2568
|
onStop && onStop();
|
|
2163
2569
|
};
|
|
2164
|
-
const { name, motionValue: motionValue2, keyframes: keyframes2 } = this.options, onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);
|
|
2165
|
-
|
|
2570
|
+
const { name, motionValue: motionValue2, element, keyframes: keyframes2 } = this.options, KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver, onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);
|
|
2571
|
+
this.resolver = new KeyframeResolver$1(keyframes2, onResolved, name, motionValue2, element), this.resolver.scheduleResolve();
|
|
2166
2572
|
}
|
|
2167
2573
|
initPlayback(keyframes$1) {
|
|
2168
2574
|
const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0 } = this.options, generatorFactory = generators[type] || keyframes;
|
|
@@ -2238,10 +2644,10 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
2238
2644
|
}
|
|
2239
2645
|
if (this.isStopped)
|
|
2240
2646
|
return;
|
|
2241
|
-
const { driver = frameloopDriver, onPlay } = this.options;
|
|
2647
|
+
const { driver = frameloopDriver, onPlay, startTime } = this.options;
|
|
2242
2648
|
this.driver || (this.driver = driver((timestamp) => this.tick(timestamp))), onPlay && onPlay();
|
|
2243
2649
|
const now2 = this.driver.now();
|
|
2244
|
-
this.holdTime !== null ? this.startTime = now2 - this.holdTime :
|
|
2650
|
+
this.holdTime !== null ? this.startTime = now2 - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = now2) : this.startTime = startTime ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
|
|
2245
2651
|
}
|
|
2246
2652
|
pause() {
|
|
2247
2653
|
var _a;
|
|
@@ -2276,7 +2682,7 @@ const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0]
|
|
|
2276
2682
|
function isWaapiSupportedEasing(easing) {
|
|
2277
2683
|
return !!(!easing || typeof easing == "string" && easing in supportedWaapiEasing || isBezierDefinition(easing) || Array.isArray(easing) && easing.every(isWaapiSupportedEasing));
|
|
2278
2684
|
}
|
|
2279
|
-
const cubicBezierAsString = ([a2, b2,
|
|
2685
|
+
const cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`, supportedWaapiEasing = {
|
|
2280
2686
|
linear: "linear",
|
|
2281
2687
|
ease: "ease",
|
|
2282
2688
|
easeIn: "ease-in",
|
|
@@ -2334,20 +2740,20 @@ function pregenerateKeyframes(keyframes2, options) {
|
|
|
2334
2740
|
class AcceleratedAnimation extends BaseAnimation {
|
|
2335
2741
|
constructor(options) {
|
|
2336
2742
|
super(options);
|
|
2337
|
-
const { name, motionValue: motionValue2, keyframes: keyframes2 } = this.options;
|
|
2338
|
-
this.resolver = new DOMKeyframesResolver(keyframes2, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue2), this.resolver.scheduleResolve();
|
|
2743
|
+
const { name, motionValue: motionValue2, element, keyframes: keyframes2 } = this.options;
|
|
2744
|
+
this.resolver = new DOMKeyframesResolver(keyframes2, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue2, element), this.resolver.scheduleResolve();
|
|
2339
2745
|
}
|
|
2340
2746
|
initPlayback(keyframes2, finalKeyframe) {
|
|
2341
2747
|
var _a;
|
|
2342
|
-
let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name } = this.options;
|
|
2748
|
+
let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name, startTime } = this.options;
|
|
2343
2749
|
if (!(!((_a = motionValue2.owner) === null || _a === void 0) && _a.current))
|
|
2344
2750
|
return !1;
|
|
2345
2751
|
if (requiresPregeneratedKeyframes(this.options)) {
|
|
2346
|
-
const { onComplete, onUpdate, motionValue: motionValue3, ...options } = this.options, pregeneratedAnimation = pregenerateKeyframes(keyframes2, options);
|
|
2752
|
+
const { onComplete, onUpdate, motionValue: motionValue3, element, ...options } = this.options, pregeneratedAnimation = pregenerateKeyframes(keyframes2, options);
|
|
2347
2753
|
keyframes2 = pregeneratedAnimation.keyframes, keyframes2.length === 1 && (keyframes2[1] = keyframes2[0]), duration = pregeneratedAnimation.duration, times = pregeneratedAnimation.times, ease2 = pregeneratedAnimation.ease, type = "keyframes";
|
|
2348
2754
|
}
|
|
2349
2755
|
const animation = animateStyle(motionValue2.owner.current, name, keyframes2, { ...this.options, duration, times, ease: ease2 });
|
|
2350
|
-
return animation.startTime =
|
|
2756
|
+
return animation.startTime = startTime ?? this.calcStartTime(), this.pendingTimeline ? (animation.timeline = this.pendingTimeline, this.pendingTimeline = void 0) : animation.onfinish = () => {
|
|
2351
2757
|
const { onComplete } = this.options;
|
|
2352
2758
|
motionValue2.set(getFinalKeyframe(keyframes2, this.options, finalKeyframe)), onComplete && onComplete(), this.cancel(), this.resolveFinishedPromise();
|
|
2353
2759
|
}, {
|
|
@@ -2401,6 +2807,13 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
2401
2807
|
const { animation } = resolved;
|
|
2402
2808
|
return animation.playState;
|
|
2403
2809
|
}
|
|
2810
|
+
get startTime() {
|
|
2811
|
+
const { resolved } = this;
|
|
2812
|
+
if (!resolved)
|
|
2813
|
+
return null;
|
|
2814
|
+
const { animation } = resolved;
|
|
2815
|
+
return animation.startTime;
|
|
2816
|
+
}
|
|
2404
2817
|
/**
|
|
2405
2818
|
* Replace the default DocumentTimeline with another AnimationTimeline.
|
|
2406
2819
|
* Currently used for scroll animations.
|
|
@@ -2444,7 +2857,7 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
2444
2857
|
if (animation.playState === "idle" || animation.playState === "finished")
|
|
2445
2858
|
return;
|
|
2446
2859
|
if (this.time) {
|
|
2447
|
-
const { motionValue: motionValue2, onUpdate, onComplete, ...options } = this.options, sampleAnimation = new MainThreadAnimation({
|
|
2860
|
+
const { motionValue: motionValue2, onUpdate, onComplete, element, ...options } = this.options, sampleAnimation = new MainThreadAnimation({
|
|
2448
2861
|
...options,
|
|
2449
2862
|
keyframes: keyframes2,
|
|
2450
2863
|
duration,
|
|
@@ -2528,6 +2941,9 @@ class GroupPlaybackControls {
|
|
|
2528
2941
|
set speed(speed) {
|
|
2529
2942
|
this.setAll("speed", speed);
|
|
2530
2943
|
}
|
|
2944
|
+
get startTime() {
|
|
2945
|
+
return this.getAll("startTime");
|
|
2946
|
+
}
|
|
2531
2947
|
get duration() {
|
|
2532
2948
|
let max2 = 0;
|
|
2533
2949
|
for (let i2 = 0; i2 < this.animations.length; i2++)
|
|
@@ -2592,15 +3008,15 @@ class SubscriptionManager {
|
|
|
2592
3008
|
add(handler) {
|
|
2593
3009
|
return addUniqueItem(this.subscriptions, handler), () => removeItem(this.subscriptions, handler);
|
|
2594
3010
|
}
|
|
2595
|
-
notify(a2, b2,
|
|
3011
|
+
notify(a2, b2, c2) {
|
|
2596
3012
|
const numSubscriptions = this.subscriptions.length;
|
|
2597
3013
|
if (numSubscriptions)
|
|
2598
3014
|
if (numSubscriptions === 1)
|
|
2599
|
-
this.subscriptions[0](a2, b2,
|
|
3015
|
+
this.subscriptions[0](a2, b2, c2);
|
|
2600
3016
|
else
|
|
2601
3017
|
for (let i2 = 0; i2 < numSubscriptions; i2++) {
|
|
2602
3018
|
const handler = this.subscriptions[i2];
|
|
2603
|
-
handler && handler(a2, b2,
|
|
3019
|
+
handler && handler(a2, b2, c2);
|
|
2604
3020
|
}
|
|
2605
3021
|
}
|
|
2606
3022
|
getSize() {
|
|
@@ -2621,7 +3037,7 @@ class MotionValue {
|
|
|
2621
3037
|
* @internal
|
|
2622
3038
|
*/
|
|
2623
3039
|
constructor(init, options = {}) {
|
|
2624
|
-
this.version = "11.3.
|
|
3040
|
+
this.version = "11.3.29", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v, render = !0) => {
|
|
2625
3041
|
const currentTime = time.now();
|
|
2626
3042
|
this.updatedAt !== currentTime && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(v), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), render && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
2627
3043
|
}, this.hasAnimated = !1, this.setCurrent(init), this.owner = options.owner;
|
|
@@ -2872,15 +3288,14 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
|
|
|
2872
3288
|
continue;
|
|
2873
3289
|
const valueTransition = {
|
|
2874
3290
|
delay,
|
|
2875
|
-
elapsed: 0,
|
|
2876
3291
|
...getValueTransition(transition || {}, key)
|
|
2877
3292
|
};
|
|
2878
3293
|
let isHandoff = !1;
|
|
2879
3294
|
if (window.MotionHandoffAnimation) {
|
|
2880
3295
|
const appearId = getOptimisedAppearId(visualElement);
|
|
2881
3296
|
if (appearId) {
|
|
2882
|
-
const
|
|
2883
|
-
|
|
3297
|
+
const startTime = window.MotionHandoffAnimation(appearId, key, frame);
|
|
3298
|
+
startTime !== null && (valueTransition.startTime = startTime, isHandoff = !0);
|
|
2884
3299
|
}
|
|
2885
3300
|
}
|
|
2886
3301
|
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key) ? { type: !1 } : valueTransition, visualElement, isHandoff, addValueToWillChange(visualElement, key)));
|
|
@@ -3177,7 +3592,7 @@ class VisualElement {
|
|
|
3177
3592
|
return {};
|
|
3178
3593
|
}
|
|
3179
3594
|
constructor({ parent, props: props2, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState }, options = {}) {
|
|
3180
|
-
this.applyWillChange = !1, this.
|
|
3595
|
+
this.applyWillChange = !1, this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = KeyframeResolver, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
3181
3596
|
this.isRenderScheduled = !1, this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
3182
3597
|
}, this.isRenderScheduled = !1, this.scheduleRender = () => {
|
|
3183
3598
|
this.isRenderScheduled || (this.isRenderScheduled = !0, frame.render(this.render, !1, !0));
|
|
@@ -3369,595 +3784,221 @@ class VisualElement {
|
|
|
3369
3784
|
this.events[eventName] && this.events[eventName].notify(...args);
|
|
3370
3785
|
}
|
|
3371
3786
|
}
|
|
3372
|
-
class DOMVisualElement extends VisualElement {
|
|
3373
|
-
constructor() {
|
|
3374
|
-
super(...arguments), this.KeyframeResolver = DOMKeyframesResolver;
|
|
3375
|
-
}
|
|
3376
|
-
sortInstanceNodePosition(a2, b2) {
|
|
3377
|
-
return a2.compareDocumentPosition(b2) & 2 ? 1 : -1;
|
|
3378
|
-
}
|
|
3379
|
-
getBaseTargetFromProps(props2, key) {
|
|
3380
|
-
return props2.style ? props2.style[key] : void 0;
|
|
3381
|
-
}
|
|
3382
|
-
removeValueFromRenderState(key, { vars, style }) {
|
|
3383
|
-
delete vars[key], delete style[key];
|
|
3384
|
-
}
|
|
3385
|
-
}
|
|
3386
|
-
function getComputedStyle$1(element) {
|
|
3387
|
-
return window.getComputedStyle(element);
|
|
3388
|
-
}
|
|
3389
|
-
class HTMLVisualElement extends DOMVisualElement {
|
|
3390
|
-
constructor() {
|
|
3391
|
-
super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance = renderHTML;
|
|
3392
|
-
}
|
|
3393
|
-
readValueFromInstance(instance, key) {
|
|
3394
|
-
if (transformProps.has(key)) {
|
|
3395
|
-
const defaultType = getDefaultValueType(key);
|
|
3396
|
-
return defaultType && defaultType.default || 0;
|
|
3397
|
-
} else {
|
|
3398
|
-
const computedStyle = getComputedStyle$1(instance), value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0;
|
|
3399
|
-
return typeof value == "string" ? value.trim() : value;
|
|
3400
|
-
}
|
|
3401
|
-
}
|
|
3402
|
-
measureInstanceViewportBox(instance, { transformPagePoint }) {
|
|
3403
|
-
return measureViewportBox(instance, transformPagePoint);
|
|
3404
|
-
}
|
|
3405
|
-
build(renderState, latestValues, props2) {
|
|
3406
|
-
buildHTMLStyles(renderState, latestValues, props2.transformTemplate);
|
|
3407
|
-
}
|
|
3408
|
-
scrapeMotionValuesFromProps(props2, prevProps, visualElement) {
|
|
3409
|
-
return scrapeMotionValuesFromProps$1(props2, prevProps, visualElement);
|
|
3410
|
-
}
|
|
3411
|
-
handleChildMotionValue() {
|
|
3412
|
-
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
3413
|
-
const { children } = this.props;
|
|
3414
|
-
isMotionValue(children) && (this.childSubscription = children.on("change", (latest) => {
|
|
3415
|
-
this.current && (this.current.textContent = `${latest}`);
|
|
3416
|
-
}));
|
|
3417
|
-
}
|
|
3418
|
-
}
|
|
3419
|
-
class SVGVisualElement extends DOMVisualElement {
|
|
3420
|
-
constructor() {
|
|
3421
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = createBox;
|
|
3422
|
-
}
|
|
3423
|
-
getBaseTargetFromProps(props2, key) {
|
|
3424
|
-
return props2[key];
|
|
3425
|
-
}
|
|
3426
|
-
readValueFromInstance(instance, key) {
|
|
3427
|
-
if (transformProps.has(key)) {
|
|
3428
|
-
const defaultType = getDefaultValueType(key);
|
|
3429
|
-
return defaultType && defaultType.default || 0;
|
|
3430
|
-
}
|
|
3431
|
-
return key = camelCaseAttributes.has(key) ? key : camelToDash(key), instance.getAttribute(key);
|
|
3432
|
-
}
|
|
3433
|
-
scrapeMotionValuesFromProps(props2, prevProps, visualElement) {
|
|
3434
|
-
return scrapeMotionValuesFromProps(props2, prevProps, visualElement);
|
|
3435
|
-
}
|
|
3436
|
-
build(renderState, latestValues, props2) {
|
|
3437
|
-
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props2.transformTemplate);
|
|
3438
|
-
}
|
|
3439
|
-
renderInstance(instance, renderState, styleProp, projection) {
|
|
3440
|
-
renderSVG(instance, renderState, styleProp, projection);
|
|
3441
|
-
}
|
|
3442
|
-
mount(instance) {
|
|
3443
|
-
this.isSVGTag = isSVGTag(instance.tagName), super.mount(instance);
|
|
3444
|
-
}
|
|
3445
|
-
}
|
|
3446
|
-
const createDomVisualElement = (Component2, options) => isSVGComponent(Component2) ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
|
|
3447
|
-
allowProjection: Component2 !== Fragment$1
|
|
3448
|
-
}), m = createMotionProxy(createDomMotionConfig);
|
|
3449
|
-
class PopChildMeasure extends React.Component {
|
|
3450
|
-
getSnapshotBeforeUpdate(prevProps) {
|
|
3451
|
-
const element = this.props.childRef.current;
|
|
3452
|
-
if (element && prevProps.isPresent && !this.props.isPresent) {
|
|
3453
|
-
const size = this.props.sizeRef.current;
|
|
3454
|
-
size.height = element.offsetHeight || 0, size.width = element.offsetWidth || 0, size.top = element.offsetTop, size.left = element.offsetLeft;
|
|
3455
|
-
}
|
|
3456
|
-
return null;
|
|
3457
|
-
}
|
|
3458
|
-
/**
|
|
3459
|
-
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
3460
|
-
*/
|
|
3461
|
-
componentDidUpdate() {
|
|
3462
|
-
}
|
|
3463
|
-
render() {
|
|
3464
|
-
return this.props.children;
|
|
3465
|
-
}
|
|
3466
|
-
}
|
|
3467
|
-
function PopChild({ children, isPresent }) {
|
|
3468
|
-
const id2 = useId$1(), ref = useRef$1(null), size = useRef$1({
|
|
3469
|
-
width: 0,
|
|
3470
|
-
height: 0,
|
|
3471
|
-
top: 0,
|
|
3472
|
-
left: 0
|
|
3473
|
-
}), { nonce } = useContext$1(MotionConfigContext);
|
|
3474
|
-
return useInsertionEffect(() => {
|
|
3475
|
-
const { width, height, top, left } = size.current;
|
|
3476
|
-
if (isPresent || !ref.current || !width || !height)
|
|
3477
|
-
return;
|
|
3478
|
-
ref.current.dataset.motionPopId = id2;
|
|
3479
|
-
const style = document.createElement("style");
|
|
3480
|
-
return nonce && (style.nonce = nonce), document.head.appendChild(style), style.sheet && style.sheet.insertRule(`
|
|
3481
|
-
[data-motion-pop-id="${id2}"] {
|
|
3482
|
-
position: absolute !important;
|
|
3483
|
-
width: ${width}px !important;
|
|
3484
|
-
height: ${height}px !important;
|
|
3485
|
-
top: ${top}px !important;
|
|
3486
|
-
left: ${left}px !important;
|
|
3487
|
-
}
|
|
3488
|
-
`), () => {
|
|
3489
|
-
document.head.removeChild(style);
|
|
3490
|
-
};
|
|
3491
|
-
}, [isPresent]), jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) });
|
|
3492
|
-
}
|
|
3493
|
-
const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom: custom5, presenceAffectsLayout, mode }) => {
|
|
3494
|
-
const presenceChildren = useConstant(newChildrenMap), id2 = useId$1(), context = useMemo$1(
|
|
3495
|
-
() => ({
|
|
3496
|
-
id: id2,
|
|
3497
|
-
initial,
|
|
3498
|
-
isPresent,
|
|
3499
|
-
custom: custom5,
|
|
3500
|
-
onExitComplete: (childId) => {
|
|
3501
|
-
presenceChildren.set(childId, !0);
|
|
3502
|
-
for (const isComplete of presenceChildren.values())
|
|
3503
|
-
if (!isComplete)
|
|
3504
|
-
return;
|
|
3505
|
-
onExitComplete && onExitComplete();
|
|
3506
|
-
},
|
|
3507
|
-
register: (childId) => (presenceChildren.set(childId, !1), () => presenceChildren.delete(childId))
|
|
3508
|
-
}),
|
|
3509
|
-
/**
|
|
3510
|
-
* If the presence of a child affects the layout of the components around it,
|
|
3511
|
-
* we want to make a new context value to ensure they get re-rendered
|
|
3512
|
-
* so they can detect that layout change.
|
|
3513
|
-
*/
|
|
3514
|
-
presenceAffectsLayout ? [Math.random()] : [isPresent]
|
|
3515
|
-
);
|
|
3516
|
-
return useMemo$1(() => {
|
|
3517
|
-
presenceChildren.forEach((_, key) => presenceChildren.set(key, !1));
|
|
3518
|
-
}, [isPresent]), React.useEffect(() => {
|
|
3519
|
-
!isPresent && !presenceChildren.size && onExitComplete && onExitComplete();
|
|
3520
|
-
}, [isPresent]), mode === "popLayout" && (children = jsx(PopChild, { isPresent, children })), jsx(PresenceContext.Provider, { value: context, children });
|
|
3521
|
-
};
|
|
3522
|
-
function newChildrenMap() {
|
|
3523
|
-
return /* @__PURE__ */ new Map();
|
|
3524
|
-
}
|
|
3525
|
-
const getChildKey = (child) => child.key || "";
|
|
3526
|
-
function onlyElements(children) {
|
|
3527
|
-
const filtered = [];
|
|
3528
|
-
return Children.forEach(children, (child) => {
|
|
3529
|
-
isValidElement(child) && filtered.push(child);
|
|
3530
|
-
}), filtered;
|
|
3531
|
-
}
|
|
3532
|
-
const AnimatePresence = ({ children, exitBeforeEnter, custom: custom5, initial = !0, onExitComplete, presenceAffectsLayout = !0, mode = "sync" }) => {
|
|
3533
|
-
const presentChildren = useMemo$1(() => onlyElements(children), [children]), presentKeys = presentChildren.map(getChildKey), isInitialRender = useRef$1(!0), pendingPresentChildren = useRef$1(presentChildren), exitComplete = useConstant(() => /* @__PURE__ */ new Map()), [diffedChildren, setDiffedChildren] = useState$1(presentChildren), [renderedChildren, setRenderedChildren] = useState$1(presentChildren);
|
|
3534
|
-
useIsomorphicLayoutEffect$2(() => {
|
|
3535
|
-
isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
|
|
3536
|
-
for (let i2 = 0; i2 < renderedChildren.length; i2++) {
|
|
3537
|
-
const key = getChildKey(renderedChildren[i2]);
|
|
3538
|
-
presentKeys.includes(key) ? exitComplete.delete(key) : exitComplete.get(key) !== !0 && exitComplete.set(key, !1);
|
|
3539
|
-
}
|
|
3540
|
-
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
|
|
3541
|
-
const exitingChildren = [];
|
|
3542
|
-
if (presentChildren !== diffedChildren) {
|
|
3543
|
-
let nextChildren = [...presentChildren];
|
|
3544
|
-
for (let i2 = 0; i2 < renderedChildren.length; i2++) {
|
|
3545
|
-
const child = renderedChildren[i2], key = getChildKey(child);
|
|
3546
|
-
presentKeys.includes(key) || (nextChildren.splice(i2, 0, child), exitingChildren.push(child));
|
|
3547
|
-
}
|
|
3548
|
-
mode === "wait" && exitingChildren.length && (nextChildren = exitingChildren), setRenderedChildren(onlyElements(nextChildren)), setDiffedChildren(presentChildren);
|
|
3549
|
-
return;
|
|
3550
|
-
}
|
|
3551
|
-
const { forceRender } = useContext$1(LayoutGroupContext);
|
|
3552
|
-
return jsx(Fragment, { children: renderedChildren.map((child) => {
|
|
3553
|
-
const key = getChildKey(child), isPresent = presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
|
|
3554
|
-
if (exitComplete.has(key))
|
|
3555
|
-
exitComplete.set(key, !0);
|
|
3556
|
-
else
|
|
3557
|
-
return;
|
|
3558
|
-
let isEveryExitComplete = !0;
|
|
3559
|
-
exitComplete.forEach((isExitComplete) => {
|
|
3560
|
-
isExitComplete || (isEveryExitComplete = !1);
|
|
3561
|
-
}), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete && onExitComplete());
|
|
3562
|
-
};
|
|
3563
|
-
return jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : !1, custom: isPresent ? void 0 : custom5, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, children: child }, key);
|
|
3564
|
-
}) });
|
|
3565
|
-
};
|
|
3566
|
-
function LazyMotion({ children, features, strict = !1 }) {
|
|
3567
|
-
const [, setIsLoaded] = useState$1(!isLazyBundle(features)), loadedRenderer = useRef$1(void 0);
|
|
3568
|
-
if (!isLazyBundle(features)) {
|
|
3569
|
-
const { renderer, ...loadedFeatures } = features;
|
|
3570
|
-
loadedRenderer.current = renderer, loadFeatures(loadedFeatures);
|
|
3571
|
-
}
|
|
3572
|
-
return useEffect$1(() => {
|
|
3573
|
-
isLazyBundle(features) && features().then(({ renderer, ...loadedFeatures }) => {
|
|
3574
|
-
loadFeatures(loadedFeatures), loadedRenderer.current = renderer, setIsLoaded(!0);
|
|
3575
|
-
});
|
|
3576
|
-
}, []), jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children });
|
|
3577
|
-
}
|
|
3578
|
-
function isLazyBundle(features) {
|
|
3579
|
-
return typeof features == "function";
|
|
3580
|
-
}
|
|
3581
|
-
const domAnimation = {
|
|
3582
|
-
renderer: createDomVisualElement,
|
|
3583
|
-
...animations,
|
|
3584
|
-
...gestureAnimations
|
|
3585
|
-
};
|
|
3586
|
-
var rootClassName = "likec4-diagram-root";
|
|
3587
|
-
const blue$1 = {
|
|
3588
|
-
fill: "#3b82f6",
|
|
3589
|
-
stroke: "#2563eb",
|
|
3590
|
-
hiContrast: "#eff6ff",
|
|
3591
|
-
loContrast: "#bfdbfe"
|
|
3592
|
-
}, sky$1 = {
|
|
3593
|
-
fill: "#0284c7",
|
|
3594
|
-
stroke: "#0369a1",
|
|
3595
|
-
hiContrast: "#f0f9ff",
|
|
3596
|
-
loContrast: "#B6ECF7"
|
|
3597
|
-
}, slate$1 = {
|
|
3598
|
-
fill: "#64748b",
|
|
3599
|
-
stroke: "#475569",
|
|
3600
|
-
hiContrast: "#f8fafc",
|
|
3601
|
-
loContrast: "#cbd5e1"
|
|
3602
|
-
}, ElementColors = {
|
|
3603
|
-
primary: blue$1,
|
|
3604
|
-
blue: blue$1,
|
|
3605
|
-
secondary: sky$1,
|
|
3606
|
-
sky: sky$1,
|
|
3607
|
-
muted: slate$1,
|
|
3608
|
-
slate: slate$1,
|
|
3609
|
-
gray: {
|
|
3610
|
-
// fill: colors.neutral[500],
|
|
3611
|
-
// stroke: colors.neutral[600],
|
|
3612
|
-
// hiContrast: colors.neutral[50],
|
|
3613
|
-
// loContrast: colors.neutral[200],
|
|
3614
|
-
fill: "#737373",
|
|
3615
|
-
stroke: "#525252",
|
|
3616
|
-
hiContrast: "#fafafa",
|
|
3617
|
-
loContrast: "#d4d4d4"
|
|
3618
|
-
},
|
|
3619
|
-
red: {
|
|
3620
|
-
// fill: colors.red[500],
|
|
3621
|
-
// stroke: colors.red[600],
|
|
3622
|
-
// hiContrast: colors.red[50],
|
|
3623
|
-
// loContrast: colors.red[200],
|
|
3624
|
-
fill: "#AC4D39",
|
|
3625
|
-
// fill: '#b54548',
|
|
3626
|
-
stroke: "#853A2D",
|
|
3627
|
-
// hiContrast: '#fef2f2',
|
|
3628
|
-
// loContrast: '#fecaca',
|
|
3629
|
-
// hiContrast: '#191111', // colors.gray[900],
|
|
3630
|
-
// loContrast: '#3b1219' // colors.gray[800],
|
|
3631
|
-
hiContrast: "#FBD3CB",
|
|
3632
|
-
// hiContrast: '#f8fafc',
|
|
3633
|
-
// loContrast: '#fdd8d8' // radix black red 12
|
|
3634
|
-
loContrast: "#f5b2a3"
|
|
3635
|
-
},
|
|
3636
|
-
green: {
|
|
3637
|
-
fill: "#428a4f",
|
|
3638
|
-
stroke: "#2d5d39",
|
|
3639
|
-
hiContrast: "#f8fafc",
|
|
3640
|
-
loContrast: "#c2f0c2"
|
|
3641
|
-
},
|
|
3642
|
-
amber: {
|
|
3643
|
-
fill: "#A35829",
|
|
3644
|
-
stroke: "#7E451D",
|
|
3645
|
-
hiContrast: "#FFE0C2",
|
|
3646
|
-
loContrast: "#f9b27c"
|
|
3647
|
-
},
|
|
3648
|
-
indigo: {
|
|
3649
|
-
// fill: colors.indigo[500],
|
|
3650
|
-
// stroke: colors.indigo[600],
|
|
3651
|
-
// hiContrast: colors.indigo[50],
|
|
3652
|
-
// loContrast: colors.indigo[200],
|
|
3653
|
-
fill: "#6366f1",
|
|
3654
|
-
stroke: "#4f46e5",
|
|
3655
|
-
hiContrast: "#eef2ff",
|
|
3656
|
-
loContrast: "#c7d2fe"
|
|
3657
|
-
}
|
|
3658
|
-
}, gray = {
|
|
3659
|
-
lineColor: "#6E6E6E",
|
|
3660
|
-
labelBgColor: "#18191b",
|
|
3661
|
-
labelColor: "#C6C6C6"
|
|
3662
|
-
}, slate = {
|
|
3663
|
-
lineColor: "#64748b",
|
|
3664
|
-
// 500
|
|
3665
|
-
labelBgColor: "#0f172a",
|
|
3666
|
-
// 900
|
|
3667
|
-
labelColor: "#cbd5e1"
|
|
3668
|
-
// 300
|
|
3669
|
-
}, blue = {
|
|
3670
|
-
lineColor: "#3b82f6",
|
|
3671
|
-
// 500
|
|
3672
|
-
labelBgColor: "#172554",
|
|
3673
|
-
// 950
|
|
3674
|
-
labelColor: "#60a5fa"
|
|
3675
|
-
// 400
|
|
3676
|
-
}, sky = {
|
|
3677
|
-
lineColor: "#0ea5e9",
|
|
3678
|
-
// 500
|
|
3679
|
-
labelBgColor: "#082f49",
|
|
3680
|
-
// 950
|
|
3681
|
-
labelColor: "#38bdf8"
|
|
3682
|
-
// 400
|
|
3683
|
-
}, RelationshipColors = {
|
|
3684
|
-
amber: {
|
|
3685
|
-
lineColor: "#b45309",
|
|
3686
|
-
labelBgColor: "#78350f",
|
|
3687
|
-
labelColor: "#FFE0C2"
|
|
3688
|
-
},
|
|
3689
|
-
blue,
|
|
3690
|
-
gray,
|
|
3691
|
-
green: {
|
|
3692
|
-
lineColor: "#15803d",
|
|
3693
|
-
// 700
|
|
3694
|
-
labelBgColor: "#052e16",
|
|
3695
|
-
// 950
|
|
3696
|
-
labelColor: "#22c55e"
|
|
3697
|
-
// 500
|
|
3698
|
-
},
|
|
3699
|
-
indigo: {
|
|
3700
|
-
lineColor: "#6366f1",
|
|
3701
|
-
// 500
|
|
3702
|
-
labelBgColor: "#1e1b4b",
|
|
3703
|
-
// 950
|
|
3704
|
-
labelColor: "#818cf8"
|
|
3705
|
-
// 400
|
|
3706
|
-
},
|
|
3707
|
-
muted: slate,
|
|
3708
|
-
primary: blue,
|
|
3709
|
-
red: {
|
|
3710
|
-
lineColor: "#AC4D39",
|
|
3711
|
-
labelBgColor: "#b91c1c",
|
|
3712
|
-
labelColor: "#f5b2a3"
|
|
3713
|
-
},
|
|
3714
|
-
secondary: sky,
|
|
3715
|
-
sky,
|
|
3716
|
-
slate
|
|
3717
|
-
}, defaultTheme = {
|
|
3718
|
-
elements: ElementColors,
|
|
3719
|
-
relationships: RelationshipColors,
|
|
3720
|
-
font: "Arial",
|
|
3721
|
-
shadow: "#0a0a0a"
|
|
3722
|
-
};
|
|
3723
|
-
function fixProto(target, prototype) {
|
|
3724
|
-
var setPrototypeOf = Object.setPrototypeOf;
|
|
3725
|
-
setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype;
|
|
3726
|
-
}
|
|
3727
|
-
function fixStack(target, fn) {
|
|
3728
|
-
fn === void 0 && (fn = target.constructor);
|
|
3729
|
-
var captureStackTrace = Error.captureStackTrace;
|
|
3730
|
-
captureStackTrace && captureStackTrace(target, fn);
|
|
3731
|
-
}
|
|
3732
|
-
var __extends = /* @__PURE__ */ function() {
|
|
3733
|
-
var _extendStatics = function(d2, b2) {
|
|
3734
|
-
return _extendStatics = Object.setPrototypeOf || {
|
|
3735
|
-
__proto__: []
|
|
3736
|
-
} instanceof Array && function(d3, b3) {
|
|
3737
|
-
d3.__proto__ = b3;
|
|
3738
|
-
} || function(d3, b3) {
|
|
3739
|
-
for (var p in b3)
|
|
3740
|
-
Object.prototype.hasOwnProperty.call(b3, p) && (d3[p] = b3[p]);
|
|
3741
|
-
}, _extendStatics(d2, b2);
|
|
3742
|
-
};
|
|
3743
|
-
return function(d2, b2) {
|
|
3744
|
-
if (typeof b2 != "function" && b2 !== null) throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
|
|
3745
|
-
_extendStatics(d2, b2);
|
|
3746
|
-
function __() {
|
|
3747
|
-
this.constructor = d2;
|
|
3748
|
-
}
|
|
3749
|
-
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
|
|
3750
|
-
};
|
|
3751
|
-
}(), CustomError = function(_super) {
|
|
3752
|
-
__extends(CustomError2, _super);
|
|
3753
|
-
function CustomError2(message, options) {
|
|
3754
|
-
var _newTarget = this.constructor, _this = _super.call(this, message, options) || this;
|
|
3755
|
-
return Object.defineProperty(_this, "name", {
|
|
3756
|
-
value: _newTarget.name,
|
|
3757
|
-
enumerable: !1,
|
|
3758
|
-
configurable: !0
|
|
3759
|
-
}), fixProto(_this, _newTarget.prototype), fixStack(_this), _this;
|
|
3760
|
-
}
|
|
3761
|
-
return CustomError2;
|
|
3762
|
-
}(Error), s = { done: !1, hasNext: !1 };
|
|
3763
|
-
function u$5(t2, n2, a2) {
|
|
3764
|
-
let o2 = (r2) => t2(r2, ...n2);
|
|
3765
|
-
return a2 === void 0 ? o2 : Object.assign(o2, { lazy: a2, lazyArgs: n2 });
|
|
3766
|
-
}
|
|
3767
|
-
function u$4(r2, n2, a2) {
|
|
3768
|
-
let o2 = r2.length - n2.length;
|
|
3769
|
-
if (o2 === 0) return r2(...n2);
|
|
3770
|
-
if (o2 === 1) return u$5(r2, n2, a2);
|
|
3771
|
-
throw new Error("Wrong number of arguments");
|
|
3772
|
-
}
|
|
3773
|
-
function r$3(...t2) {
|
|
3774
|
-
return u$4(Object.values, t2);
|
|
3775
|
-
}
|
|
3776
|
-
function i$3(...e2) {
|
|
3777
|
-
return u$4(r$2, e2);
|
|
3778
|
-
}
|
|
3779
|
-
var r$2 = (e2, t2) => e2.length >= t2;
|
|
3780
|
-
function d$1(...e2) {
|
|
3781
|
-
return u$4(i$2, e2);
|
|
3782
|
-
}
|
|
3783
|
-
function i$2(e2, o2) {
|
|
3784
|
-
let r2 = [];
|
|
3785
|
-
for (let [t2, n2] of e2.entries()) {
|
|
3786
|
-
if (!o2(n2, t2, e2)) break;
|
|
3787
|
-
r2.push(n2);
|
|
3788
|
-
}
|
|
3789
|
-
return r2;
|
|
3790
|
-
}
|
|
3791
|
-
function b(t2) {
|
|
3792
|
-
return (e2, r2) => {
|
|
3793
|
-
if (r2 === 0) return t2(e2);
|
|
3794
|
-
if (!Number.isInteger(r2)) throw new TypeError(`precision must be an integer: ${r2}`);
|
|
3795
|
-
if (r2 > 15 || r2 < -15) throw new RangeError("precision must be between -15 and 15");
|
|
3796
|
-
if (Number.isNaN(e2) || !Number.isFinite(e2)) return t2(e2);
|
|
3797
|
-
let n2 = 10 ** r2;
|
|
3798
|
-
return t2(e2 * n2) / n2;
|
|
3799
|
-
};
|
|
3800
|
-
}
|
|
3801
|
-
function l$1(...e2) {
|
|
3802
|
-
return u$4(u$3, e2);
|
|
3803
|
-
}
|
|
3804
|
-
var u$3 = (e2, a2, n2) => e2.reduce(a2, n2);
|
|
3805
|
-
function n$2(e2) {
|
|
3806
|
-
return !!e2;
|
|
3807
|
-
}
|
|
3808
|
-
function t$3(...n2) {
|
|
3809
|
-
return u$4(Object.keys, n2);
|
|
3810
|
-
}
|
|
3811
|
-
function a$1(...e2) {
|
|
3812
|
-
return u$4(n$1, e2);
|
|
3813
|
-
}
|
|
3814
|
-
var n$1 = (e2) => e2.at(-1);
|
|
3815
|
-
function l(n2) {
|
|
3816
|
-
return n2 != null;
|
|
3817
|
-
}
|
|
3818
|
-
function o$1(a2) {
|
|
3819
|
-
return (t2) => !a2(t2);
|
|
3820
|
-
}
|
|
3821
|
-
function e$3(n2) {
|
|
3822
|
-
return n2 == null;
|
|
3823
|
-
}
|
|
3824
|
-
function e$2(r2) {
|
|
3825
|
-
return typeof r2 == "number" && !Number.isNaN(r2);
|
|
3826
|
-
}
|
|
3827
|
-
function n(r2) {
|
|
3828
|
-
return Array.isArray(r2);
|
|
3829
|
-
}
|
|
3830
|
-
var e$1 = (n2) => Object.assign(n2, { single: !0 });
|
|
3831
|
-
function f(...e2) {
|
|
3832
|
-
return u$4(i$1, e2, e$1(u$2));
|
|
3833
|
-
}
|
|
3834
|
-
var i$1 = (e2, n2) => e2.find(n2), u$2 = (e2) => (n2, t2, o2) => e2(n2, t2, o2) ? { done: !0, hasNext: !0, next: n2 } : s;
|
|
3835
|
-
function d(...e2) {
|
|
3836
|
-
return u$4(r$1, e2, e$1(o));
|
|
3837
|
-
}
|
|
3838
|
-
var r$1 = ([e2]) => e2, o = () => a, a = (e2) => ({ hasNext: !0, next: e2, done: !0 });
|
|
3839
|
-
function t$2(...r2) {
|
|
3840
|
-
return u$4(Object.entries, r2);
|
|
3841
|
-
}
|
|
3842
|
-
function t$1(...a2) {
|
|
3843
|
-
return u$4(e, a2);
|
|
3844
|
-
}
|
|
3845
|
-
var e = (a2, o2) => o2.every((l2) => l2(a2));
|
|
3846
|
-
function y$1(...a2) {
|
|
3847
|
-
return u$4(r, a2);
|
|
3848
|
-
}
|
|
3849
|
-
var r = (a2, o2) => o2.some((e2) => e2(a2));
|
|
3850
|
-
function u$1(...e2) {
|
|
3851
|
-
return u$4(b(Math.ceil), e2);
|
|
3852
|
-
}
|
|
3853
|
-
function u(...n2) {
|
|
3854
|
-
return u$4(i, n2);
|
|
3855
|
-
}
|
|
3856
|
-
var i = (n2, { min: e2, max: r2 }) => e2 !== void 0 && n2 < e2 ? e2 : r2 !== void 0 && n2 > r2 ? r2 : n2;
|
|
3857
|
-
function isString(value) {
|
|
3858
|
-
return value != null && typeof value == "string";
|
|
3859
|
-
}
|
|
3860
|
-
class BaseError extends CustomError {
|
|
3861
|
-
constructor(message, options) {
|
|
3862
|
-
super(message, options), Object.defineProperty(this, "name", { value: "BaseError" });
|
|
3863
|
-
}
|
|
3864
|
-
}
|
|
3865
|
-
class NullableError extends BaseError {
|
|
3866
|
-
constructor(message, options) {
|
|
3867
|
-
super(message, options), Object.defineProperty(this, "name", { value: "NullableError" });
|
|
3868
|
-
}
|
|
3869
|
-
}
|
|
3870
|
-
class InvariantError extends BaseError {
|
|
3871
|
-
constructor(message, options) {
|
|
3872
|
-
super(message, options), Object.defineProperty(this, "name", { value: "InvariantError" });
|
|
3787
|
+
class DOMVisualElement extends VisualElement {
|
|
3788
|
+
constructor() {
|
|
3789
|
+
super(...arguments), this.KeyframeResolver = DOMKeyframesResolver;
|
|
3873
3790
|
}
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
}
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
throw new InvariantError(message ?? "Invariant failed");
|
|
3883
|
-
}
|
|
3884
|
-
class NonExhaustiveError extends BaseError {
|
|
3885
|
-
constructor(message, options) {
|
|
3886
|
-
super(message, options), Object.defineProperty(this, "name", { value: "NonExhaustiveError" });
|
|
3791
|
+
sortInstanceNodePosition(a2, b2) {
|
|
3792
|
+
return a2.compareDocumentPosition(b2) & 2 ? 1 : -1;
|
|
3793
|
+
}
|
|
3794
|
+
getBaseTargetFromProps(props2, key) {
|
|
3795
|
+
return props2.style ? props2.style[key] : void 0;
|
|
3796
|
+
}
|
|
3797
|
+
removeValueFromRenderState(key, { vars: vars2, style }) {
|
|
3798
|
+
delete vars2[key], delete style[key];
|
|
3887
3799
|
}
|
|
3888
3800
|
}
|
|
3889
|
-
function
|
|
3890
|
-
|
|
3801
|
+
function getComputedStyle$1(element) {
|
|
3802
|
+
return window.getComputedStyle(element);
|
|
3891
3803
|
}
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
case isTagEqual(operator): {
|
|
3904
|
-
if ("eq" in operator.tag) {
|
|
3905
|
-
const tag2 = operator.tag.eq;
|
|
3906
|
-
return (value) => Array.isArray(value.tags) && value.tags.includes(tag2);
|
|
3907
|
-
}
|
|
3908
|
-
const tag = operator.tag.neq;
|
|
3909
|
-
return (value) => !Array.isArray(value.tags) || !value.tags.includes(tag);
|
|
3910
|
-
}
|
|
3911
|
-
case isKindEqual(operator): {
|
|
3912
|
-
if ("eq" in operator.kind) {
|
|
3913
|
-
const kind2 = operator.kind.eq;
|
|
3914
|
-
return (value) => value.kind === kind2;
|
|
3915
|
-
}
|
|
3916
|
-
const kind = operator.kind.neq;
|
|
3917
|
-
return (value) => e$3(value.kind) || value.kind !== kind;
|
|
3918
|
-
}
|
|
3919
|
-
case isNotOperator(operator): {
|
|
3920
|
-
const predicate = whereOperatorAsPredicate(operator.not);
|
|
3921
|
-
return o$1(predicate);
|
|
3804
|
+
class HTMLVisualElement extends DOMVisualElement {
|
|
3805
|
+
constructor() {
|
|
3806
|
+
super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance = renderHTML;
|
|
3807
|
+
}
|
|
3808
|
+
readValueFromInstance(instance, key) {
|
|
3809
|
+
if (transformProps.has(key)) {
|
|
3810
|
+
const defaultType = getDefaultValueType(key);
|
|
3811
|
+
return defaultType && defaultType.default || 0;
|
|
3812
|
+
} else {
|
|
3813
|
+
const computedStyle = getComputedStyle$1(instance), value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0;
|
|
3814
|
+
return typeof value == "string" ? value.trim() : value;
|
|
3922
3815
|
}
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3816
|
+
}
|
|
3817
|
+
measureInstanceViewportBox(instance, { transformPagePoint }) {
|
|
3818
|
+
return measureViewportBox(instance, transformPagePoint);
|
|
3819
|
+
}
|
|
3820
|
+
build(renderState, latestValues, props2) {
|
|
3821
|
+
buildHTMLStyles(renderState, latestValues, props2.transformTemplate);
|
|
3822
|
+
}
|
|
3823
|
+
scrapeMotionValuesFromProps(props2, prevProps, visualElement) {
|
|
3824
|
+
return scrapeMotionValuesFromProps$1(props2, prevProps, visualElement);
|
|
3825
|
+
}
|
|
3826
|
+
handleChildMotionValue() {
|
|
3827
|
+
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
3828
|
+
const { children } = this.props;
|
|
3829
|
+
isMotionValue(children) && (this.childSubscription = children.on("change", (latest) => {
|
|
3830
|
+
this.current && (this.current.textContent = `${latest}`);
|
|
3831
|
+
}));
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
class SVGVisualElement extends DOMVisualElement {
|
|
3835
|
+
constructor() {
|
|
3836
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = createBox;
|
|
3837
|
+
}
|
|
3838
|
+
getBaseTargetFromProps(props2, key) {
|
|
3839
|
+
return props2[key];
|
|
3840
|
+
}
|
|
3841
|
+
readValueFromInstance(instance, key) {
|
|
3842
|
+
if (transformProps.has(key)) {
|
|
3843
|
+
const defaultType = getDefaultValueType(key);
|
|
3844
|
+
return defaultType && defaultType.default || 0;
|
|
3926
3845
|
}
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3846
|
+
return key = camelCaseAttributes.has(key) ? key : camelToDash(key), instance.getAttribute(key);
|
|
3847
|
+
}
|
|
3848
|
+
scrapeMotionValuesFromProps(props2, prevProps, visualElement) {
|
|
3849
|
+
return scrapeMotionValuesFromProps(props2, prevProps, visualElement);
|
|
3850
|
+
}
|
|
3851
|
+
build(renderState, latestValues, props2) {
|
|
3852
|
+
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props2.transformTemplate);
|
|
3853
|
+
}
|
|
3854
|
+
renderInstance(instance, renderState, styleProp, projection) {
|
|
3855
|
+
renderSVG(instance, renderState, styleProp, projection);
|
|
3856
|
+
}
|
|
3857
|
+
mount(instance) {
|
|
3858
|
+
this.isSVGTag = isSVGTag(instance.tagName), super.mount(instance);
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3861
|
+
const createDomVisualElement = (Component2, options) => isSVGComponent(Component2) ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
|
|
3862
|
+
allowProjection: Component2 !== Fragment$1
|
|
3863
|
+
}), m = createMotionProxy(createDomMotionConfig);
|
|
3864
|
+
class PopChildMeasure extends React.Component {
|
|
3865
|
+
getSnapshotBeforeUpdate(prevProps) {
|
|
3866
|
+
const element = this.props.childRef.current;
|
|
3867
|
+
if (element && prevProps.isPresent && !this.props.isPresent) {
|
|
3868
|
+
const size = this.props.sizeRef.current;
|
|
3869
|
+
size.height = element.offsetHeight || 0, size.width = element.offsetWidth || 0, size.top = element.offsetTop, size.left = element.offsetLeft;
|
|
3930
3870
|
}
|
|
3931
|
-
|
|
3932
|
-
|
|
3871
|
+
return null;
|
|
3872
|
+
}
|
|
3873
|
+
/**
|
|
3874
|
+
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
3875
|
+
*/
|
|
3876
|
+
componentDidUpdate() {
|
|
3877
|
+
}
|
|
3878
|
+
render() {
|
|
3879
|
+
return this.props.children;
|
|
3933
3880
|
}
|
|
3934
3881
|
}
|
|
3935
|
-
function
|
|
3936
|
-
|
|
3882
|
+
function PopChild({ children, isPresent }) {
|
|
3883
|
+
const id2 = useId$1(), ref = useRef$1(null), size = useRef$1({
|
|
3884
|
+
width: 0,
|
|
3885
|
+
height: 0,
|
|
3886
|
+
top: 0,
|
|
3887
|
+
left: 0
|
|
3888
|
+
}), { nonce } = useContext$1(MotionConfigContext);
|
|
3889
|
+
return useInsertionEffect(() => {
|
|
3890
|
+
const { width, height, top, left } = size.current;
|
|
3891
|
+
if (isPresent || !ref.current || !width || !height)
|
|
3892
|
+
return;
|
|
3893
|
+
ref.current.dataset.motionPopId = id2;
|
|
3894
|
+
const style = document.createElement("style");
|
|
3895
|
+
return nonce && (style.nonce = nonce), document.head.appendChild(style), style.sheet && style.sheet.insertRule(`
|
|
3896
|
+
[data-motion-pop-id="${id2}"] {
|
|
3897
|
+
position: absolute !important;
|
|
3898
|
+
width: ${width}px !important;
|
|
3899
|
+
height: ${height}px !important;
|
|
3900
|
+
top: ${top}px !important;
|
|
3901
|
+
left: ${left}px !important;
|
|
3902
|
+
}
|
|
3903
|
+
`), () => {
|
|
3904
|
+
document.head.removeChild(style);
|
|
3905
|
+
};
|
|
3906
|
+
}, [isPresent]), jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) });
|
|
3937
3907
|
}
|
|
3938
|
-
|
|
3939
|
-
|
|
3908
|
+
const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom: custom5, presenceAffectsLayout, mode }) => {
|
|
3909
|
+
const presenceChildren = useConstant(newChildrenMap), id2 = useId$1(), context = useMemo$1(
|
|
3910
|
+
() => ({
|
|
3911
|
+
id: id2,
|
|
3912
|
+
initial,
|
|
3913
|
+
isPresent,
|
|
3914
|
+
custom: custom5,
|
|
3915
|
+
onExitComplete: (childId) => {
|
|
3916
|
+
presenceChildren.set(childId, !0);
|
|
3917
|
+
for (const isComplete of presenceChildren.values())
|
|
3918
|
+
if (!isComplete)
|
|
3919
|
+
return;
|
|
3920
|
+
onExitComplete && onExitComplete();
|
|
3921
|
+
},
|
|
3922
|
+
register: (childId) => (presenceChildren.set(childId, !1), () => presenceChildren.delete(childId))
|
|
3923
|
+
}),
|
|
3924
|
+
/**
|
|
3925
|
+
* If the presence of a child affects the layout of the components around it,
|
|
3926
|
+
* we want to make a new context value to ensure they get re-rendered
|
|
3927
|
+
* so they can detect that layout change.
|
|
3928
|
+
*/
|
|
3929
|
+
presenceAffectsLayout ? [Math.random()] : [isPresent]
|
|
3930
|
+
);
|
|
3931
|
+
return useMemo$1(() => {
|
|
3932
|
+
presenceChildren.forEach((_, key) => presenceChildren.set(key, !1));
|
|
3933
|
+
}, [isPresent]), React.useEffect(() => {
|
|
3934
|
+
!isPresent && !presenceChildren.size && onExitComplete && onExitComplete();
|
|
3935
|
+
}, [isPresent]), mode === "popLayout" && (children = jsx(PopChild, { isPresent, children })), jsx(PresenceContext.Provider, { value: context, children });
|
|
3936
|
+
};
|
|
3937
|
+
function newChildrenMap() {
|
|
3938
|
+
return /* @__PURE__ */ new Map();
|
|
3940
3939
|
}
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
return
|
|
3940
|
+
const getChildKey = (child) => child.key || "";
|
|
3941
|
+
function onlyElements(children) {
|
|
3942
|
+
const filtered = [];
|
|
3943
|
+
return Children.forEach(children, (child) => {
|
|
3944
|
+
isValidElement(child) && filtered.push(child);
|
|
3945
|
+
}), filtered;
|
|
3945
3946
|
}
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3947
|
+
const AnimatePresence = ({ children, exitBeforeEnter, custom: custom5, initial = !0, onExitComplete, presenceAffectsLayout = !0, mode = "sync" }) => {
|
|
3948
|
+
const presentChildren = useMemo$1(() => onlyElements(children), [children]), presentKeys = presentChildren.map(getChildKey), isInitialRender = useRef$1(!0), pendingPresentChildren = useRef$1(presentChildren), exitComplete = useConstant(() => /* @__PURE__ */ new Map()), [diffedChildren, setDiffedChildren] = useState$1(presentChildren), [renderedChildren, setRenderedChildren] = useState$1(presentChildren);
|
|
3949
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
3950
|
+
isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
|
|
3951
|
+
for (let i2 = 0; i2 < renderedChildren.length; i2++) {
|
|
3952
|
+
const key = getChildKey(renderedChildren[i2]);
|
|
3953
|
+
presentKeys.includes(key) ? exitComplete.delete(key) : exitComplete.get(key) !== !0 && exitComplete.set(key, !1);
|
|
3954
|
+
}
|
|
3955
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
|
|
3956
|
+
const exitingChildren = [];
|
|
3957
|
+
if (presentChildren !== diffedChildren) {
|
|
3958
|
+
let nextChildren = [...presentChildren];
|
|
3959
|
+
for (let i2 = 0; i2 < renderedChildren.length; i2++) {
|
|
3960
|
+
const child = renderedChildren[i2], key = getChildKey(child);
|
|
3961
|
+
presentKeys.includes(key) || (nextChildren.splice(i2, 0, child), exitingChildren.push(child));
|
|
3962
|
+
}
|
|
3963
|
+
mode === "wait" && exitingChildren.length && (nextChildren = exitingChildren), setRenderedChildren(onlyElements(nextChildren)), setDiffedChildren(presentChildren);
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3966
|
+
const { forceRender } = useContext$1(LayoutGroupContext);
|
|
3967
|
+
return jsx(Fragment, { children: renderedChildren.map((child) => {
|
|
3968
|
+
const key = getChildKey(child), isPresent = presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
|
|
3969
|
+
if (exitComplete.has(key))
|
|
3970
|
+
exitComplete.set(key, !0);
|
|
3971
|
+
else
|
|
3972
|
+
return;
|
|
3973
|
+
let isEveryExitComplete = !0;
|
|
3974
|
+
exitComplete.forEach((isExitComplete) => {
|
|
3975
|
+
isExitComplete || (isEveryExitComplete = !1);
|
|
3976
|
+
}), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete && onExitComplete());
|
|
3977
|
+
};
|
|
3978
|
+
return jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : !1, custom: isPresent ? void 0 : custom5, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, children: child }, key);
|
|
3979
|
+
}) });
|
|
3980
|
+
};
|
|
3981
|
+
function LazyMotion({ children, features, strict = !1 }) {
|
|
3982
|
+
const [, setIsLoaded] = useState$1(!isLazyBundle(features)), loadedRenderer = useRef$1(void 0);
|
|
3983
|
+
if (!isLazyBundle(features)) {
|
|
3984
|
+
const { renderer, ...loadedFeatures } = features;
|
|
3985
|
+
loadedRenderer.current = renderer, loadFeatures(loadedFeatures);
|
|
3986
|
+
}
|
|
3987
|
+
return useEffect$1(() => {
|
|
3988
|
+
isLazyBundle(features) && features().then(({ renderer, ...loadedFeatures }) => {
|
|
3989
|
+
loadFeatures(loadedFeatures), loadedRenderer.current = renderer, setIsLoaded(!0);
|
|
3990
|
+
});
|
|
3991
|
+
}, []), jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children });
|
|
3956
3992
|
}
|
|
3957
|
-
function
|
|
3958
|
-
|
|
3959
|
-
return (isString(args[1]) ? args[1] : args[1].id).startsWith(ancestor + ".");
|
|
3993
|
+
function isLazyBundle(features) {
|
|
3994
|
+
return typeof features == "function";
|
|
3960
3995
|
}
|
|
3996
|
+
const domAnimation = {
|
|
3997
|
+
renderer: createDomVisualElement,
|
|
3998
|
+
...animations,
|
|
3999
|
+
...gestureAnimations
|
|
4000
|
+
};
|
|
4001
|
+
var rootClassName = "likec4-diagram-root";
|
|
3961
4002
|
function useSyncedRef(value) {
|
|
3962
4003
|
const ref = useRef$1(value);
|
|
3963
4004
|
return ref.current = value, useMemo$1(() => Object.freeze({
|
|
@@ -4328,26 +4369,26 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
|
|
|
4328
4369
|
if (t2 === 1)
|
|
4329
4370
|
return points[order].t = 1, points[order];
|
|
4330
4371
|
const mt = 1 - t2;
|
|
4331
|
-
let
|
|
4372
|
+
let p2 = points;
|
|
4332
4373
|
if (order === 0)
|
|
4333
4374
|
return points[0].t = t2, points[0];
|
|
4334
4375
|
if (order === 1) {
|
|
4335
4376
|
const ret = {
|
|
4336
|
-
x: mt *
|
|
4337
|
-
y: mt *
|
|
4377
|
+
x: mt * p2[0].x + t2 * p2[1].x,
|
|
4378
|
+
y: mt * p2[0].y + t2 * p2[1].y,
|
|
4338
4379
|
t: t2
|
|
4339
4380
|
};
|
|
4340
|
-
return _3d && (ret.z = mt *
|
|
4381
|
+
return _3d && (ret.z = mt * p2[0].z + t2 * p2[1].z), ret;
|
|
4341
4382
|
}
|
|
4342
4383
|
if (order < 4) {
|
|
4343
|
-
let mt2 = mt * mt, t22 = t2 * t2, a2, b2,
|
|
4344
|
-
order === 2 ? (
|
|
4384
|
+
let mt2 = mt * mt, t22 = t2 * t2, a2, b2, c2, d2 = 0;
|
|
4385
|
+
order === 2 ? (p2 = [p2[0], p2[1], p2[2], ZERO], a2 = mt2, b2 = mt * t2 * 2, c2 = t22) : order === 3 && (a2 = mt2 * mt, b2 = mt2 * t2 * 3, c2 = mt * t22 * 3, d2 = t2 * t22);
|
|
4345
4386
|
const ret = {
|
|
4346
|
-
x: a2 *
|
|
4347
|
-
y: a2 *
|
|
4387
|
+
x: a2 * p2[0].x + b2 * p2[1].x + c2 * p2[2].x + d2 * p2[3].x,
|
|
4388
|
+
y: a2 * p2[0].y + b2 * p2[1].y + c2 * p2[2].y + d2 * p2[3].y,
|
|
4348
4389
|
t: t2
|
|
4349
4390
|
};
|
|
4350
|
-
return _3d && (ret.z = a2 *
|
|
4391
|
+
return _3d && (ret.z = a2 * p2[0].z + b2 * p2[1].z + c2 * p2[2].z + d2 * p2[3].z), ret;
|
|
4351
4392
|
}
|
|
4352
4393
|
const dCpts = JSON.parse(JSON.stringify(points));
|
|
4353
4394
|
for (; dCpts.length > 1; ) {
|
|
@@ -4361,40 +4402,40 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
|
|
|
4361
4402
|
return dCpts[0].t = t2, dCpts[0];
|
|
4362
4403
|
},
|
|
4363
4404
|
computeWithRatios: function(t2, points, ratios, _3d) {
|
|
4364
|
-
const mt = 1 - t2, r2 = ratios,
|
|
4405
|
+
const mt = 1 - t2, r2 = ratios, p2 = points;
|
|
4365
4406
|
let f1 = r2[0], f2 = r2[1], f3 = r2[2], f4 = r2[3], d2;
|
|
4366
|
-
if (f1 *= mt, f2 *= t2,
|
|
4407
|
+
if (f1 *= mt, f2 *= t2, p2.length === 2)
|
|
4367
4408
|
return d2 = f1 + f2, {
|
|
4368
|
-
x: (f1 *
|
|
4369
|
-
y: (f1 *
|
|
4370
|
-
z: _3d ? (f1 *
|
|
4409
|
+
x: (f1 * p2[0].x + f2 * p2[1].x) / d2,
|
|
4410
|
+
y: (f1 * p2[0].y + f2 * p2[1].y) / d2,
|
|
4411
|
+
z: _3d ? (f1 * p2[0].z + f2 * p2[1].z) / d2 : !1,
|
|
4371
4412
|
t: t2
|
|
4372
4413
|
};
|
|
4373
|
-
if (f1 *= mt, f2 *= 2 * mt, f3 *= t2 * t2,
|
|
4414
|
+
if (f1 *= mt, f2 *= 2 * mt, f3 *= t2 * t2, p2.length === 3)
|
|
4374
4415
|
return d2 = f1 + f2 + f3, {
|
|
4375
|
-
x: (f1 *
|
|
4376
|
-
y: (f1 *
|
|
4377
|
-
z: _3d ? (f1 *
|
|
4416
|
+
x: (f1 * p2[0].x + f2 * p2[1].x + f3 * p2[2].x) / d2,
|
|
4417
|
+
y: (f1 * p2[0].y + f2 * p2[1].y + f3 * p2[2].y) / d2,
|
|
4418
|
+
z: _3d ? (f1 * p2[0].z + f2 * p2[1].z + f3 * p2[2].z) / d2 : !1,
|
|
4378
4419
|
t: t2
|
|
4379
4420
|
};
|
|
4380
|
-
if (f1 *= mt, f2 *= 1.5 * mt, f3 *= 3 * mt, f4 *= t2 * t2 * t2,
|
|
4421
|
+
if (f1 *= mt, f2 *= 1.5 * mt, f3 *= 3 * mt, f4 *= t2 * t2 * t2, p2.length === 4)
|
|
4381
4422
|
return d2 = f1 + f2 + f3 + f4, {
|
|
4382
|
-
x: (f1 *
|
|
4383
|
-
y: (f1 *
|
|
4384
|
-
z: _3d ? (f1 *
|
|
4423
|
+
x: (f1 * p2[0].x + f2 * p2[1].x + f3 * p2[2].x + f4 * p2[3].x) / d2,
|
|
4424
|
+
y: (f1 * p2[0].y + f2 * p2[1].y + f3 * p2[2].y + f4 * p2[3].y) / d2,
|
|
4425
|
+
z: _3d ? (f1 * p2[0].z + f2 * p2[1].z + f3 * p2[2].z + f4 * p2[3].z) / d2 : !1,
|
|
4385
4426
|
t: t2
|
|
4386
4427
|
};
|
|
4387
4428
|
},
|
|
4388
4429
|
derive: function(points, _3d) {
|
|
4389
4430
|
const dpoints = [];
|
|
4390
|
-
for (let
|
|
4431
|
+
for (let p2 = points, d2 = p2.length, c2 = d2 - 1; d2 > 1; d2--, c2--) {
|
|
4391
4432
|
const list = [];
|
|
4392
|
-
for (let j = 0, dpt; j <
|
|
4433
|
+
for (let j = 0, dpt; j < c2; j++)
|
|
4393
4434
|
dpt = {
|
|
4394
|
-
x:
|
|
4395
|
-
y:
|
|
4396
|
-
}, _3d && (dpt.z =
|
|
4397
|
-
dpoints.push(list),
|
|
4435
|
+
x: c2 * (p2[j + 1].x - p2[j].x),
|
|
4436
|
+
y: c2 * (p2[j + 1].y - p2[j].y)
|
|
4437
|
+
}, _3d && (dpt.z = c2 * (p2[j + 1].z - p2[j].z)), list.push(dpt);
|
|
4438
|
+
dpoints.push(list), p2 = list;
|
|
4398
4439
|
}
|
|
4399
4440
|
return dpoints;
|
|
4400
4441
|
},
|
|
@@ -4422,9 +4463,9 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
|
|
|
4422
4463
|
};
|
|
4423
4464
|
return v1.z !== void 0 && v2.z !== void 0 && (ret.z = v1.z + r2 * (v2.z - v1.z)), ret;
|
|
4424
4465
|
},
|
|
4425
|
-
pointToString: function(
|
|
4426
|
-
let s2 =
|
|
4427
|
-
return typeof
|
|
4466
|
+
pointToString: function(p2) {
|
|
4467
|
+
let s2 = p2.x + "/" + p2.y;
|
|
4468
|
+
return typeof p2.z < "u" && (s2 += "/" + p2.z), s2;
|
|
4428
4469
|
},
|
|
4429
4470
|
pointsToString: function(points) {
|
|
4430
4471
|
return "[" + points.map(utils.pointToString).join(", ") + "]";
|
|
@@ -4447,8 +4488,8 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
|
|
|
4447
4488
|
},
|
|
4448
4489
|
closest: function(LUT, point2) {
|
|
4449
4490
|
let mdist = pow(2, 63), mpos, d2;
|
|
4450
|
-
return LUT.forEach(function(
|
|
4451
|
-
d2 = utils.dist(point2,
|
|
4491
|
+
return LUT.forEach(function(p2, idx) {
|
|
4492
|
+
d2 = utils.dist(point2, p2), d2 < mdist && (mdist = d2, mpos = idx);
|
|
4452
4493
|
}), { mdist, mpos };
|
|
4453
4494
|
},
|
|
4454
4495
|
abcratio: function(t2, n2) {
|
|
@@ -4533,10 +4574,10 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
|
|
|
4533
4574
|
},
|
|
4534
4575
|
getminmax: function(curve2, d2, list) {
|
|
4535
4576
|
if (!list) return { min: 0, max: 0 };
|
|
4536
|
-
let min2 = nMax, max2 = nMin, t2,
|
|
4577
|
+
let min2 = nMax, max2 = nMin, t2, c2;
|
|
4537
4578
|
list.indexOf(0) === -1 && (list = [0].concat(list)), list.indexOf(1) === -1 && list.push(1);
|
|
4538
4579
|
for (let i2 = 0, len = list.length; i2 < len; i2++)
|
|
4539
|
-
t2 = list[i2],
|
|
4580
|
+
t2 = list[i2], c2 = curve2.get(t2), c2[d2] < min2 && (min2 = c2[d2]), c2[d2] > max2 && (max2 = c2[d2]);
|
|
4540
4581
|
return { min: min2, mid: (min2 + max2) / 2, max: max2, size: max2 - min2 };
|
|
4541
4582
|
},
|
|
4542
4583
|
align: function(points, line) {
|
|
@@ -4554,27 +4595,27 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
|
|
|
4554
4595
|
return 0 <= t2 && t2 <= 1;
|
|
4555
4596
|
};
|
|
4556
4597
|
if (order === 2) {
|
|
4557
|
-
const a3 = aligned[0].y, b3 = aligned[1].y,
|
|
4598
|
+
const a3 = aligned[0].y, b3 = aligned[1].y, c3 = aligned[2].y, d3 = a3 - 2 * b3 + c3;
|
|
4558
4599
|
if (d3 !== 0) {
|
|
4559
|
-
const m1 = -sqrt$1(b3 * b3 - a3 *
|
|
4600
|
+
const m1 = -sqrt$1(b3 * b3 - a3 * c3), m2 = -a3 + b3, v12 = -(m1 + m2) / d3, v2 = -(-m1 + m2) / d3;
|
|
4560
4601
|
return [v12, v2].filter(reduce);
|
|
4561
|
-
} else if (b3 !==
|
|
4562
|
-
return [(2 * b3 -
|
|
4602
|
+
} else if (b3 !== c3 && d3 === 0)
|
|
4603
|
+
return [(2 * b3 - c3) / (2 * b3 - 2 * c3)].filter(reduce);
|
|
4563
4604
|
return [];
|
|
4564
4605
|
}
|
|
4565
4606
|
const pa = aligned[0].y, pb = aligned[1].y, pc = aligned[2].y, pd = aligned[3].y;
|
|
4566
|
-
let d2 = -pa + 3 * pb - 3 * pc + pd, a2 = 3 * pa - 6 * pb + 3 * pc, b2 = -3 * pa + 3 * pb,
|
|
4607
|
+
let d2 = -pa + 3 * pb - 3 * pc + pd, a2 = 3 * pa - 6 * pb + 3 * pc, b2 = -3 * pa + 3 * pb, c2 = pa;
|
|
4567
4608
|
if (utils.approximately(d2, 0)) {
|
|
4568
4609
|
if (utils.approximately(a2, 0))
|
|
4569
|
-
return utils.approximately(b2, 0) ? [] : [-
|
|
4570
|
-
const q3 = sqrt$1(b2 * b2 - 4 * a2 *
|
|
4610
|
+
return utils.approximately(b2, 0) ? [] : [-c2 / b2].filter(reduce);
|
|
4611
|
+
const q3 = sqrt$1(b2 * b2 - 4 * a2 * c2), a22 = 2 * a2;
|
|
4571
4612
|
return [(q3 - b2) / a22, (-b2 - q3) / a22].filter(reduce);
|
|
4572
4613
|
}
|
|
4573
|
-
a2 /= d2, b2 /= d2,
|
|
4574
|
-
const
|
|
4614
|
+
a2 /= d2, b2 /= d2, c2 /= d2;
|
|
4615
|
+
const p2 = (3 * b2 - a2 * a2) / 3, p3 = p2 / 3, q = (2 * a2 * a2 * a2 - 9 * a2 * b2 + 27 * c2) / 27, q2 = q / 2, discriminant = q2 * q2 + p3 * p3 * p3;
|
|
4575
4616
|
let u1, v1, x1, x2, x3;
|
|
4576
4617
|
if (discriminant < 0) {
|
|
4577
|
-
const mp3 = -
|
|
4618
|
+
const mp3 = -p2 / 3, mp33 = mp3 * mp3 * mp3, r2 = sqrt$1(mp33), t2 = -q / (2 * r2), cosphi = t2 < -1 ? -1 : t2 > 1 ? 1 : t2, phi = acos$1(cosphi), crtr = crt(r2), t1 = 2 * crtr;
|
|
4578
4619
|
return x1 = t1 * cos$1(phi / 3) - a2 / 3, x2 = t1 * cos$1((phi + tau$1) / 3) - a2 / 3, x3 = t1 * cos$1((phi + 2 * tau$1) / 3) - a2 / 3, [x1, x2, x3].filter(reduce);
|
|
4579
4620
|
} else {
|
|
4580
4621
|
if (discriminant === 0)
|
|
@@ -4585,18 +4626,18 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
|
|
|
4585
4626
|
}
|
|
4586
4627
|
}
|
|
4587
4628
|
},
|
|
4588
|
-
droots: function(
|
|
4589
|
-
if (
|
|
4590
|
-
const a2 =
|
|
4629
|
+
droots: function(p2) {
|
|
4630
|
+
if (p2.length === 3) {
|
|
4631
|
+
const a2 = p2[0], b2 = p2[1], c2 = p2[2], d2 = a2 - 2 * b2 + c2;
|
|
4591
4632
|
if (d2 !== 0) {
|
|
4592
|
-
const m1 = -sqrt$1(b2 * b2 - a2 *
|
|
4633
|
+
const m1 = -sqrt$1(b2 * b2 - a2 * c2), m2 = -a2 + b2, v1 = -(m1 + m2) / d2, v2 = -(-m1 + m2) / d2;
|
|
4593
4634
|
return [v1, v2];
|
|
4594
|
-
} else if (b2 !==
|
|
4595
|
-
return [(2 * b2 -
|
|
4635
|
+
} else if (b2 !== c2 && d2 === 0)
|
|
4636
|
+
return [(2 * b2 - c2) / (2 * (b2 - c2))];
|
|
4596
4637
|
return [];
|
|
4597
4638
|
}
|
|
4598
|
-
if (
|
|
4599
|
-
const a2 =
|
|
4639
|
+
if (p2.length === 2) {
|
|
4640
|
+
const a2 = p2[0], b2 = p2[1];
|
|
4600
4641
|
return a2 !== b2 ? [a2 / (a2 - b2)] : [];
|
|
4601
4642
|
}
|
|
4602
4643
|
return [];
|
|
@@ -4616,7 +4657,7 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
|
|
|
4616
4657
|
},
|
|
4617
4658
|
inflections: function(points) {
|
|
4618
4659
|
if (points.length < 4) return [];
|
|
4619
|
-
const
|
|
4660
|
+
const p2 = utils.align(points, { p1: points[0], p2: points.slice(-1)[0] }), a2 = p2[2].x * p2[1].y, b2 = p2[3].x * p2[1].y, c2 = p2[1].x * p2[2].y, d2 = p2[3].x * p2[2].y, v1 = 18 * (-3 * a2 + 2 * b2 + 3 * c2 - d2), v2 = 18 * (3 * a2 - b2 - 3 * c2), v3 = 18 * (c2 - a2);
|
|
4620
4661
|
if (utils.approximately(v1, 0)) {
|
|
4621
4662
|
if (!utils.approximately(v2, 0)) {
|
|
4622
4663
|
let t2 = -v3 / v2;
|
|
@@ -4701,9 +4742,9 @@ class PolyBezier {
|
|
|
4701
4742
|
return this.curves[idx];
|
|
4702
4743
|
}
|
|
4703
4744
|
bbox() {
|
|
4704
|
-
const
|
|
4705
|
-
for (var bbox =
|
|
4706
|
-
utils.expandbox(bbox,
|
|
4745
|
+
const c2 = this.curves;
|
|
4746
|
+
for (var bbox = c2[0].bbox(), i2 = 1; i2 < c2.length; i2++)
|
|
4747
|
+
utils.expandbox(bbox, c2[i2].bbox());
|
|
4707
4748
|
return bbox;
|
|
4708
4749
|
}
|
|
4709
4750
|
offset(d2) {
|
|
@@ -4751,7 +4792,7 @@ class Bezier {
|
|
|
4751
4792
|
const order = this.order = points.length - 1, dims = this.dims = ["x", "y"];
|
|
4752
4793
|
_3d && dims.push("z"), this.dimlen = dims.length;
|
|
4753
4794
|
const aligned = utils.align(points, { p1: points[0], p2: points[order] }), baselength = utils.dist(points[0], points[order]);
|
|
4754
|
-
this._linear = aligned.reduce((t2,
|
|
4795
|
+
this._linear = aligned.reduce((t2, p2) => t2 + abs(p2.y), 0) < baselength / 50, this._lut = [], this._t1 = 0, this._t2 = 1, this.update();
|
|
4755
4796
|
}
|
|
4756
4797
|
static quadraticFromPoints(p1, p2, p3, t2) {
|
|
4757
4798
|
if (typeof t2 > "u" && (t2 = 0.5), t2 === 0)
|
|
@@ -4788,9 +4829,9 @@ class Bezier {
|
|
|
4788
4829
|
}
|
|
4789
4830
|
toSVG() {
|
|
4790
4831
|
if (this._3d) return !1;
|
|
4791
|
-
const
|
|
4792
|
-
for (let i2 = 1, last =
|
|
4793
|
-
s2.push(
|
|
4832
|
+
const p2 = this.points, x2 = p2[0].x, y2 = p2[0].y, s2 = ["M", x2, y2, this.order === 2 ? "Q" : "C"];
|
|
4833
|
+
for (let i2 = 1, last = p2.length; i2 < last; i2++)
|
|
4834
|
+
s2.push(p2[i2].x), s2.push(p2[i2].y);
|
|
4794
4835
|
return s2.join(" ");
|
|
4795
4836
|
}
|
|
4796
4837
|
setRatios(ratios) {
|
|
@@ -4803,8 +4844,8 @@ class Bezier {
|
|
|
4803
4844
|
print !== this._print && (this._print = print, this.update());
|
|
4804
4845
|
}
|
|
4805
4846
|
coordDigest() {
|
|
4806
|
-
return this.points.map(function(
|
|
4807
|
-
return "" + pos +
|
|
4847
|
+
return this.points.map(function(c2, pos) {
|
|
4848
|
+
return "" + pos + c2.x + c2.y + (c2.z ? c2.z : 0);
|
|
4808
4849
|
}).join("");
|
|
4809
4850
|
}
|
|
4810
4851
|
update() {
|
|
@@ -4836,24 +4877,24 @@ class Bezier {
|
|
|
4836
4877
|
if (this.verify(), steps2 = steps2 || 100, this._lut.length === steps2 + 1)
|
|
4837
4878
|
return this._lut;
|
|
4838
4879
|
this._lut = [], steps2++, this._lut = [];
|
|
4839
|
-
for (let i2 = 0,
|
|
4840
|
-
t2 = i2 / (steps2 - 1),
|
|
4880
|
+
for (let i2 = 0, p2, t2; i2 < steps2; i2++)
|
|
4881
|
+
t2 = i2 / (steps2 - 1), p2 = this.compute(t2), p2.t = t2, this._lut.push(p2);
|
|
4841
4882
|
return this._lut;
|
|
4842
4883
|
}
|
|
4843
4884
|
on(point2, error) {
|
|
4844
4885
|
error = error || 5;
|
|
4845
4886
|
const lut = this.getLUT(), hits = [];
|
|
4846
|
-
for (let i2 = 0,
|
|
4847
|
-
|
|
4887
|
+
for (let i2 = 0, c2, t2 = 0; i2 < lut.length; i2++)
|
|
4888
|
+
c2 = lut[i2], utils.dist(c2, point2) < error && (hits.push(c2), t2 += i2 / lut.length);
|
|
4848
4889
|
return hits.length ? t /= hits.length : !1;
|
|
4849
4890
|
}
|
|
4850
4891
|
project(point2) {
|
|
4851
4892
|
const LUT = this.getLUT(), l2 = LUT.length - 1, closest = utils.closest(LUT, point2), mpos = closest.mpos, t1 = (mpos - 1) / l2, t2 = (mpos + 1) / l2, step = 0.1 / l2;
|
|
4852
|
-
let mdist = closest.mdist, t3 = t1, ft = t3,
|
|
4893
|
+
let mdist = closest.mdist, t3 = t1, ft = t3, p2;
|
|
4853
4894
|
mdist += 1;
|
|
4854
4895
|
for (let d2; t3 < t2 + step; t3 += step)
|
|
4855
|
-
|
|
4856
|
-
return ft = ft < 0 ? 0 : ft > 1 ? 1 : ft,
|
|
4896
|
+
p2 = this.compute(t3), d2 = utils.dist(point2, p2), d2 < mdist && (mdist = d2, ft = t3);
|
|
4897
|
+
return ft = ft < 0 ? 0 : ft > 1 ? 1 : ft, p2 = this.compute(ft), p2.t = ft, p2.d = mdist, p2;
|
|
4857
4898
|
}
|
|
4858
4899
|
get(t2) {
|
|
4859
4900
|
return this.compute(t2);
|
|
@@ -4865,13 +4906,13 @@ class Bezier {
|
|
|
4865
4906
|
return this.ratios ? utils.computeWithRatios(t2, this.points, this.ratios, this._3d) : utils.compute(t2, this.points, this._3d, this.ratios);
|
|
4866
4907
|
}
|
|
4867
4908
|
raise() {
|
|
4868
|
-
const
|
|
4909
|
+
const p2 = this.points, np = [p2[0]], k = p2.length;
|
|
4869
4910
|
for (let i2 = 1, pi2, pim; i2 < k; i2++)
|
|
4870
|
-
pi2 =
|
|
4911
|
+
pi2 = p2[i2], pim = p2[i2 - 1], np[i2] = {
|
|
4871
4912
|
x: (k - i2) / k * pi2.x + i2 / k * pim.x,
|
|
4872
4913
|
y: (k - i2) / k * pi2.y + i2 / k * pim.y
|
|
4873
4914
|
};
|
|
4874
|
-
return np[k] =
|
|
4915
|
+
return np[k] = p2[k - 1], new Bezier(np);
|
|
4875
4916
|
}
|
|
4876
4917
|
derivative(t2) {
|
|
4877
4918
|
return utils.compute(t2, this.dpoints[0], this._3d);
|
|
@@ -4880,8 +4921,8 @@ class Bezier {
|
|
|
4880
4921
|
return utils.compute(t2, this.dpoints[1], this._3d);
|
|
4881
4922
|
}
|
|
4882
4923
|
align() {
|
|
4883
|
-
let
|
|
4884
|
-
return new Bezier(utils.align(
|
|
4924
|
+
let p2 = this.points;
|
|
4925
|
+
return new Bezier(utils.align(p2, { p1: p2[0], p2: p2[p2.length - 1] }));
|
|
4885
4926
|
}
|
|
4886
4927
|
curvature(t2) {
|
|
4887
4928
|
return utils.curvature(t2, this.dpoints[0], this.dpoints[1], this._3d);
|
|
@@ -4899,22 +4940,22 @@ class Bezier {
|
|
|
4899
4940
|
__normal3(t2) {
|
|
4900
4941
|
const r1 = this.derivative(t2), r2 = this.derivative(t2 + 0.01), q1 = sqrt(r1.x * r1.x + r1.y * r1.y + r1.z * r1.z), q2 = sqrt(r2.x * r2.x + r2.y * r2.y + r2.z * r2.z);
|
|
4901
4942
|
r1.x /= q1, r1.y /= q1, r1.z /= q1, r2.x /= q2, r2.y /= q2, r2.z /= q2;
|
|
4902
|
-
const
|
|
4943
|
+
const c2 = {
|
|
4903
4944
|
x: r2.y * r1.z - r2.z * r1.y,
|
|
4904
4945
|
y: r2.z * r1.x - r2.x * r1.z,
|
|
4905
4946
|
z: r2.x * r1.y - r2.y * r1.x
|
|
4906
|
-
}, m2 = sqrt(
|
|
4907
|
-
|
|
4947
|
+
}, m2 = sqrt(c2.x * c2.x + c2.y * c2.y + c2.z * c2.z);
|
|
4948
|
+
c2.x /= m2, c2.y /= m2, c2.z /= m2;
|
|
4908
4949
|
const R = [
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4950
|
+
c2.x * c2.x,
|
|
4951
|
+
c2.x * c2.y - c2.z,
|
|
4952
|
+
c2.x * c2.z + c2.y,
|
|
4953
|
+
c2.x * c2.y + c2.z,
|
|
4954
|
+
c2.y * c2.y,
|
|
4955
|
+
c2.y * c2.z - c2.x,
|
|
4956
|
+
c2.x * c2.z - c2.y,
|
|
4957
|
+
c2.y * c2.z + c2.x,
|
|
4958
|
+
c2.z * c2.z
|
|
4918
4959
|
];
|
|
4919
4960
|
return {
|
|
4920
4961
|
t: t2,
|
|
@@ -4924,12 +4965,12 @@ class Bezier {
|
|
|
4924
4965
|
};
|
|
4925
4966
|
}
|
|
4926
4967
|
hull(t2) {
|
|
4927
|
-
let
|
|
4928
|
-
for (q[idx++] =
|
|
4968
|
+
let p2 = this.points, _p = [], q = [], idx = 0;
|
|
4969
|
+
for (q[idx++] = p2[0], q[idx++] = p2[1], q[idx++] = p2[2], this.order === 3 && (q[idx++] = p2[3]); p2.length > 1; ) {
|
|
4929
4970
|
_p = [];
|
|
4930
|
-
for (let i2 = 0, pt, l2 =
|
|
4931
|
-
pt = utils.lerp(t2,
|
|
4932
|
-
|
|
4971
|
+
for (let i2 = 0, pt, l2 = p2.length - 1; i2 < l2; i2++)
|
|
4972
|
+
pt = utils.lerp(t2, p2[i2], p2[i2 + 1]), q[idx++] = pt, _p.push(pt);
|
|
4973
|
+
p2 = _p;
|
|
4933
4974
|
}
|
|
4934
4975
|
return q;
|
|
4935
4976
|
}
|
|
@@ -4952,8 +4993,8 @@ class Bezier {
|
|
|
4952
4993
|
function(dim) {
|
|
4953
4994
|
let mfn = function(v) {
|
|
4954
4995
|
return v[dim];
|
|
4955
|
-
},
|
|
4956
|
-
result[dim] = utils.droots(
|
|
4996
|
+
}, p2 = this.dpoints[0].map(mfn);
|
|
4997
|
+
result[dim] = utils.droots(p2), this.order === 3 && (p2 = this.dpoints[1].map(mfn), result[dim] = result[dim].concat(utils.droots(p2))), result[dim] = result[dim].filter(function(t2) {
|
|
4957
4998
|
return t2 >= 0 && t2 <= 1;
|
|
4958
4999
|
}), roots = roots.concat(result[dim].sort(utils.numberSort));
|
|
4959
5000
|
}.bind(this)
|
|
@@ -4975,21 +5016,21 @@ class Bezier {
|
|
|
4975
5016
|
}
|
|
4976
5017
|
offset(t2, d2) {
|
|
4977
5018
|
if (typeof d2 < "u") {
|
|
4978
|
-
const
|
|
4979
|
-
c,
|
|
5019
|
+
const c2 = this.get(t2), n2 = this.normal(t2), ret = {
|
|
5020
|
+
c: c2,
|
|
4980
5021
|
n: n2,
|
|
4981
|
-
x:
|
|
4982
|
-
y:
|
|
5022
|
+
x: c2.x + n2.x * d2,
|
|
5023
|
+
y: c2.y + n2.y * d2
|
|
4983
5024
|
};
|
|
4984
|
-
return this._3d && (ret.z =
|
|
5025
|
+
return this._3d && (ret.z = c2.z + n2.z * d2), ret;
|
|
4985
5026
|
}
|
|
4986
5027
|
if (this._linear) {
|
|
4987
|
-
const nv = this.normal(0), coords = this.points.map(function(
|
|
5028
|
+
const nv = this.normal(0), coords = this.points.map(function(p2) {
|
|
4988
5029
|
const ret = {
|
|
4989
|
-
x:
|
|
4990
|
-
y:
|
|
5030
|
+
x: p2.x + t2 * nv.x,
|
|
5031
|
+
y: p2.y + t2 * nv.y
|
|
4991
5032
|
};
|
|
4992
|
-
return
|
|
5033
|
+
return p2.z && nv.z && (ret.z = p2.z + t2 * nv.z), ret;
|
|
4993
5034
|
});
|
|
4994
5035
|
return [new Bezier(coords)];
|
|
4995
5036
|
}
|
|
@@ -5027,9 +5068,9 @@ class Bezier {
|
|
|
5027
5068
|
const o2 = this.order;
|
|
5028
5069
|
let d3 = this.points.map((_, i2) => (1 - i2 / o2) * d1 + i2 / o2 * d2);
|
|
5029
5070
|
return new Bezier(
|
|
5030
|
-
this.points.map((
|
|
5031
|
-
x:
|
|
5032
|
-
y:
|
|
5071
|
+
this.points.map((p2, i2) => ({
|
|
5072
|
+
x: p2.x + v.x * d3[i2],
|
|
5073
|
+
y: p2.y + v.y * d3[i2]
|
|
5033
5074
|
}))
|
|
5034
5075
|
);
|
|
5035
5076
|
}
|
|
@@ -5049,25 +5090,25 @@ class Bezier {
|
|
|
5049
5090
|
if (!o2)
|
|
5050
5091
|
throw new Error("cannot scale this curve. Try reducing it first.");
|
|
5051
5092
|
return [0, 1].forEach(function(t2) {
|
|
5052
|
-
const
|
|
5053
|
-
|
|
5093
|
+
const p2 = np[t2 * order] = utils.copy(points[t2 * order]);
|
|
5094
|
+
p2.x += (t2 ? r2 : r1) * v[t2].n.x, p2.y += (t2 ? r2 : r1) * v[t2].n.y;
|
|
5054
5095
|
}), distanceFn ? ([0, 1].forEach(function(t2) {
|
|
5055
5096
|
if (!(order === 2 && t2)) {
|
|
5056
|
-
var
|
|
5057
|
-
x:
|
|
5058
|
-
y:
|
|
5097
|
+
var p2 = points[t2 + 1], ov = {
|
|
5098
|
+
x: p2.x - o2.x,
|
|
5099
|
+
y: p2.y - o2.y
|
|
5059
5100
|
}, rc = distanceFn ? distanceFn((t2 + 1) / order) : d2;
|
|
5060
5101
|
distanceFn && !clockwise && (rc = -rc);
|
|
5061
5102
|
var m2 = sqrt(ov.x * ov.x + ov.y * ov.y);
|
|
5062
5103
|
ov.x /= m2, ov.y /= m2, np[t2 + 1] = {
|
|
5063
|
-
x:
|
|
5064
|
-
y:
|
|
5104
|
+
x: p2.x + rc * ov.x,
|
|
5105
|
+
y: p2.y + rc * ov.y
|
|
5065
5106
|
};
|
|
5066
5107
|
}
|
|
5067
5108
|
}), new Bezier(np)) : ([0, 1].forEach((t2) => {
|
|
5068
5109
|
if (order === 2 && t2) return;
|
|
5069
|
-
const
|
|
5070
|
-
np[t2 + 1] = utils.lli4(
|
|
5110
|
+
const p2 = np[t2 * order], d3 = this.derivative(t2), p22 = { x: p2.x + d3.x, y: p2.y + d3.y };
|
|
5111
|
+
np[t2 + 1] = utils.lli4(p2, p22, o2, points[t2 + 1]);
|
|
5071
5112
|
}), new Bezier(np));
|
|
5072
5113
|
}
|
|
5073
5114
|
outline(d1, d2, d3, d4) {
|
|
@@ -5081,7 +5122,7 @@ class Bezier {
|
|
|
5081
5122
|
return new PolyBezier(segments2);
|
|
5082
5123
|
}
|
|
5083
5124
|
const reduced = this.reduce(), len = reduced.length, fcurves = [];
|
|
5084
|
-
let bcurves = [],
|
|
5125
|
+
let bcurves = [], p2, alen = 0, tlen = this.length();
|
|
5085
5126
|
const graduated = typeof d3 < "u" && typeof d4 < "u";
|
|
5086
5127
|
function linearDistanceFunction(s2, e2, tlen2, alen2, slen) {
|
|
5087
5128
|
return function(v) {
|
|
@@ -5097,7 +5138,7 @@ class Bezier {
|
|
|
5097
5138
|
segment.scale(linearDistanceFunction(-d2, -d4, tlen, alen, slen))
|
|
5098
5139
|
)) : (fcurves.push(segment.scale(d1)), bcurves.push(segment.scale(-d2))), alen += slen;
|
|
5099
5140
|
}), bcurves = bcurves.map(function(s2) {
|
|
5100
|
-
return
|
|
5141
|
+
return p2 = s2.points, p2[3] ? s2.points = [p2[3], p2[2], p2[1], p2[0]] : s2.points = [p2[2], p2[1], p2[0]], s2;
|
|
5101
5142
|
}).reverse();
|
|
5102
5143
|
const fs = fcurves[0].points[0], fe = fcurves[len - 1].points[fcurves[len - 1].points.length - 1], bs = bcurves[len - 1].points[bcurves[len - 1].points.length - 1], be = bcurves[0].points[0], ls = utils.makeline(bs, fs), le = utils.makeline(fe, be), segments = [ls].concat(fcurves).concat([le]).concat(bcurves);
|
|
5103
5144
|
return new PolyBezier(segments);
|
|
@@ -5125,8 +5166,8 @@ class Bezier {
|
|
|
5125
5166
|
lineIntersects(line) {
|
|
5126
5167
|
const mx = min(line.p1.x, line.p2.x), my = min(line.p1.y, line.p2.y), MX = max(line.p1.x, line.p2.x), MY = max(line.p1.y, line.p2.y);
|
|
5127
5168
|
return utils.roots(this.points, line).filter((t2) => {
|
|
5128
|
-
var
|
|
5129
|
-
return utils.between(
|
|
5169
|
+
var p2 = this.get(t2);
|
|
5170
|
+
return utils.between(p2.x, mx, MX) && utils.between(p2.y, my, MY);
|
|
5130
5171
|
});
|
|
5131
5172
|
}
|
|
5132
5173
|
selfintersects(curveIntersectionThreshold) {
|
|
@@ -5201,7 +5242,7 @@ const nodeToRect = (nd) => ({
|
|
|
5201
5242
|
}), isInside = (test2, target) => test2.x >= target.x && test2.y >= target.y && test2.x + test2.width <= target.x + target.width && test2.y + test2.height <= target.y + target.height;
|
|
5202
5243
|
function bezierControlPoints(diagramEdge) {
|
|
5203
5244
|
let [start, ...bezierPoints] = diagramEdge.points;
|
|
5204
|
-
invariant(start, "start should be defined");
|
|
5245
|
+
invariant$1(start, "start should be defined");
|
|
5205
5246
|
const handles = [
|
|
5206
5247
|
// start
|
|
5207
5248
|
];
|
|
@@ -5215,7 +5256,7 @@ function bezierControlPoints(diagramEdge) {
|
|
|
5215
5256
|
});
|
|
5216
5257
|
}), bezierPoints = rest, start = end;
|
|
5217
5258
|
}
|
|
5218
|
-
return invariant(bezierPoints.length === 0, "all points should be consumed"), handles;
|
|
5259
|
+
return invariant$1(bezierPoints.length === 0, "all points should be consumed"), handles;
|
|
5219
5260
|
}
|
|
5220
5261
|
const isClose = (a2, b2) => Math.abs(a2 - b2) < 3.1;
|
|
5221
5262
|
function isSamePoint$1(a2, b2) {
|
|
@@ -5237,9 +5278,9 @@ function diagramViewToXYFlowData(view, opts) {
|
|
|
5237
5278
|
const ns = "", nodeById = (id2) => nonNullable(nodeLookup.get(id2), `Node not found: ${id2}`);
|
|
5238
5279
|
let next;
|
|
5239
5280
|
for (; next = traverse.shift(); ) {
|
|
5240
|
-
const { node, parent } = next;
|
|
5241
|
-
|
|
5242
|
-
const
|
|
5281
|
+
const { node, parent } = next, isCompound = i$3(node.children, 1);
|
|
5282
|
+
isCompound && traverse.push(...node.children.map((child) => ({ node: nodeById(child), parent: node })));
|
|
5283
|
+
const position = {
|
|
5243
5284
|
x: node.position[0],
|
|
5244
5285
|
y: node.position[1]
|
|
5245
5286
|
};
|
|
@@ -5254,6 +5295,7 @@ function diagramViewToXYFlowData(view, opts) {
|
|
|
5254
5295
|
},
|
|
5255
5296
|
draggable,
|
|
5256
5297
|
selectable: opts.selectable,
|
|
5298
|
+
focusable: opts.selectable && !isCompound,
|
|
5257
5299
|
deletable: !1,
|
|
5258
5300
|
position,
|
|
5259
5301
|
zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
|
|
@@ -5271,7 +5313,11 @@ function diagramViewToXYFlowData(view, opts) {
|
|
|
5271
5313
|
}
|
|
5272
5314
|
for (const edge of view.edges) {
|
|
5273
5315
|
const source = edge.source, target = edge.target, id2 = ns + edge.id;
|
|
5274
|
-
|
|
5316
|
+
if (!i$3(edge.points, 2)) {
|
|
5317
|
+
console.error("edge should have at least 2 points", edge);
|
|
5318
|
+
continue;
|
|
5319
|
+
}
|
|
5320
|
+
xyedges.push({
|
|
5275
5321
|
id: id2,
|
|
5276
5322
|
type: "relationship",
|
|
5277
5323
|
source: ns + source,
|
|
@@ -5462,7 +5508,7 @@ function createDiagramStore(props2) {
|
|
|
5462
5508
|
},
|
|
5463
5509
|
focusOnNode: (nodeId) => {
|
|
5464
5510
|
const { focusedNodeId, view, enableFocusMode } = get();
|
|
5465
|
-
if (invariant(enableFocusMode, "focus mode is not enabled"), nodeId !== focusedNodeId) {
|
|
5511
|
+
if (invariant$1(enableFocusMode, "focus mode is not enabled"), nodeId !== focusedNodeId) {
|
|
5466
5512
|
const notDimmed = new StringSet([nodeId]), dimmed2 = new StringSet();
|
|
5467
5513
|
for (const edge of view.edges)
|
|
5468
5514
|
edge.source === nodeId || edge.target === nodeId ? (notDimmed.add(edge.source), notDimmed.add(edge.target)) : dimmed2.add(edge.id);
|
|
@@ -5598,12 +5644,12 @@ function createDiagramStore(props2) {
|
|
|
5598
5644
|
};
|
|
5599
5645
|
data.label?.bbox && (_updated.labelBBox = data.label?.bbox), data.edge.labelBBox && (_updated.labelBBox ??= data.edge.labelBBox), controlPoints && i$3(controlPoints, 1) && (_updated.controlPoints = controlPoints), !sourceOrTargetMoved && data.edge.dotpos && (_updated.dotpos = data.edge.dotpos);
|
|
5600
5646
|
const allX = [
|
|
5601
|
-
...data.edge.points.map((
|
|
5602
|
-
...(controlPoints ?? []).map((
|
|
5647
|
+
...data.edge.points.map((p2) => p2[0]),
|
|
5648
|
+
...(controlPoints ?? []).map((p2) => p2.x),
|
|
5603
5649
|
..._updated.labelBBox ? [_updated.labelBBox.x, _updated.labelBBox.x + _updated.labelBBox.width] : []
|
|
5604
5650
|
], allY = [
|
|
5605
|
-
...data.edge.points.map((
|
|
5606
|
-
...(controlPoints ?? []).map((
|
|
5651
|
+
...data.edge.points.map((p2) => p2[1]),
|
|
5652
|
+
...(controlPoints ?? []).map((p2) => p2.y),
|
|
5607
5653
|
..._updated.labelBBox ? [_updated.labelBBox.y, _updated.labelBBox.y + _updated.labelBBox.height] : []
|
|
5608
5654
|
], rect = boxToRect({
|
|
5609
5655
|
x: Math.floor(Math.min(...allX)),
|
|
@@ -5651,9 +5697,9 @@ function createDiagramStore(props2) {
|
|
|
5651
5697
|
if (!onNavigateTo)
|
|
5652
5698
|
return;
|
|
5653
5699
|
const xynode = xynodes2.find(({ id: id2 }) => id2 === xynodeId);
|
|
5654
|
-
invariant(xynode, `xynode not found: ${xynodeId}`);
|
|
5700
|
+
invariant$1(xynode, `xynode not found: ${xynodeId}`);
|
|
5655
5701
|
const element = view.nodes.find(({ id: id2 }) => id2 === xynodeId);
|
|
5656
|
-
invariant(element?.navigateTo, `node is not navigable: ${xynodeId}`), cancelSaveManualLayout(), set(
|
|
5702
|
+
invariant$1(element?.navigateTo, `node is not navigable: ${xynodeId}`), cancelSaveManualLayout(), set(
|
|
5657
5703
|
{
|
|
5658
5704
|
lastClickedNodeId: xynodeId,
|
|
5659
5705
|
lastOnNavigate: {
|
|
@@ -5723,7 +5769,7 @@ function createDiagramStore(props2) {
|
|
|
5723
5769
|
},
|
|
5724
5770
|
activateDynamicStep: (nextStep) => {
|
|
5725
5771
|
const { isDynamicView, xyflow, xystore, fitViewPadding } = get();
|
|
5726
|
-
invariant(isDynamicView, "view is not dynamic");
|
|
5772
|
+
invariant$1(isDynamicView, "view is not dynamic");
|
|
5727
5773
|
const edgeId = StepEdgeId(nextStep), dimmed2 = new StringSet();
|
|
5728
5774
|
let edge = null;
|
|
5729
5775
|
for (const e2 of xyflow.getEdges()) {
|
|
@@ -5733,7 +5779,7 @@ function createDiagramStore(props2) {
|
|
|
5733
5779
|
}
|
|
5734
5780
|
dimmed2.add(e2.id);
|
|
5735
5781
|
}
|
|
5736
|
-
invariant(!!edge, `edge not found: ${edgeId}`);
|
|
5782
|
+
invariant$1(!!edge, `edge not found: ${edgeId}`);
|
|
5737
5783
|
const selected = [];
|
|
5738
5784
|
for (const n2 of xyflow.getNodes()) {
|
|
5739
5785
|
if (n2.id === edge.source || n2.id === edge.target) {
|
|
@@ -5781,6 +5827,13 @@ function createDiagramStore(props2) {
|
|
|
5781
5827
|
noReplace,
|
|
5782
5828
|
"onInit"
|
|
5783
5829
|
);
|
|
5830
|
+
},
|
|
5831
|
+
highlightByElementNotation: (notation, onlyOfKind) => {
|
|
5832
|
+
const { xynodes: xynodes2, xyedges: xyedges2 } = get(), dimmed2 = new StringSet(m$1(xyedges2, p$1("id")));
|
|
5833
|
+
xynodes2.forEach(({ id: id2, data }) => {
|
|
5834
|
+
const node = data.element;
|
|
5835
|
+
(node.shape !== notation.shape || node.color !== notation.color || !notation.kinds.includes(node.kind) || onlyOfKind && node.kind !== onlyOfKind) && dimmed2.add(id2);
|
|
5836
|
+
}), set({ dimmed: dimmed2 }, noReplace, "highlightByElementNotation");
|
|
5784
5837
|
}
|
|
5785
5838
|
}),
|
|
5786
5839
|
{
|
|
@@ -5818,7 +5871,7 @@ function DiagramContextProvider({
|
|
|
5818
5871
|
), useUpdateEffect(
|
|
5819
5872
|
() => {
|
|
5820
5873
|
const current = store.current;
|
|
5821
|
-
invariant(current, "DiagramContext.store.current is not defined"), deepEqual(whereFilter, current.getState().whereFilter) || current.setState({ whereFilter: structuredClone(whereFilter) }, !1, "update where filter"), current.getState().updateView(view);
|
|
5874
|
+
invariant$1(current, "DiagramContext.store.current is not defined"), deepEqual(whereFilter, current.getState().whereFilter) || current.setState({ whereFilter: structuredClone(whereFilter) }, !1, "update where filter"), current.getState().updateView(view);
|
|
5822
5875
|
},
|
|
5823
5876
|
[view, whereFilter],
|
|
5824
5877
|
(a2, b2) => shallowEqual(a2[0], b2[0]) && deepEqual(a2[1], b2[1])
|
|
@@ -5879,7 +5932,7 @@ function FitViewOnViewportResize({ diagramApi }) {
|
|
|
5879
5932
|
1e3
|
|
5880
5933
|
), null;
|
|
5881
5934
|
}
|
|
5882
|
-
function selector$
|
|
5935
|
+
function selector$4({ view, viewportChanged, fitViewPadding }) {
|
|
5883
5936
|
return {
|
|
5884
5937
|
layoutId: view.id + "_" + view.autoLayout + "_" + fitViewPadding,
|
|
5885
5938
|
viewportNotMoved: !viewportChanged
|
|
@@ -5889,7 +5942,7 @@ function FitViewOnDiagramChange() {
|
|
|
5889
5942
|
const {
|
|
5890
5943
|
layoutId,
|
|
5891
5944
|
viewportNotMoved
|
|
5892
|
-
} = useDiagramState(selector$
|
|
5945
|
+
} = useDiagramState(selector$4, shallowEqual), diagramApi = useDiagramStoreApi(), [currentLayoutId, setCurrent] = useState$1(layoutId), requiresFit = layoutId !== currentLayoutId;
|
|
5893
5946
|
return useDebouncedEffect(
|
|
5894
5947
|
() => {
|
|
5895
5948
|
layoutId !== currentLayoutId && (setCurrent(layoutId), diagramApi.getState().fitDiagram(450));
|
|
@@ -6100,11 +6153,11 @@ Linear.prototype = {
|
|
|
6100
6153
|
function curveLinear(context) {
|
|
6101
6154
|
return new Linear(context);
|
|
6102
6155
|
}
|
|
6103
|
-
function x(
|
|
6104
|
-
return
|
|
6156
|
+
function x(p2) {
|
|
6157
|
+
return p2[0];
|
|
6105
6158
|
}
|
|
6106
|
-
function y(
|
|
6107
|
-
return
|
|
6159
|
+
function y(p2) {
|
|
6160
|
+
return p2[1];
|
|
6108
6161
|
}
|
|
6109
6162
|
function d3line(x$1, y$12) {
|
|
6110
6163
|
var defined = constant(!0), context = null, curve2 = curveLinear, output = null, path = withPath(line);
|
|
@@ -6501,7 +6554,7 @@ const curveCatmullRomOpen = function custom4(alpha2) {
|
|
|
6501
6554
|
Dot,
|
|
6502
6555
|
ODot
|
|
6503
6556
|
};
|
|
6504
|
-
var container$
|
|
6557
|
+
var container$5 = "yi2p6v1", dimmed$3 = "yi2p6v2", edgePathBg = "yi2p6v3", markerContext = "yi2p6v4", controlPoint = "yi2p6v5", controlDragging = "yi2p6v6", cssEdgePath = "yi2p6v8", stepEdgeNumber = "yi2p6v9", varLabelX = "var(--yi2p6va)", varLabelY = "var(--yi2p6vb)", edgeLabel = "yi2p6vd", edgeLabelText = "yi2p6ve";
|
|
6505
6558
|
function getNodeIntersectionFromCenterToPoint(intersectionNode, { x: x1, y: y1 }) {
|
|
6506
6559
|
const {
|
|
6507
6560
|
width: intersectionNodeWidth,
|
|
@@ -6534,13 +6587,13 @@ const toMarker = (arrowType) => {
|
|
|
6534
6587
|
};
|
|
6535
6588
|
function bezierPath(bezierSpline) {
|
|
6536
6589
|
let [start, ...points] = bezierSpline;
|
|
6537
|
-
invariant(start, "start should be defined");
|
|
6590
|
+
invariant$1(start, "start should be defined");
|
|
6538
6591
|
let path = `M ${start[0]},${start[1]}`;
|
|
6539
6592
|
for (; i$3(points, 3); ) {
|
|
6540
6593
|
const [cp1, cp2, end, ...rest] = points;
|
|
6541
6594
|
path = path + ` C ${cp1[0]},${cp1[1]} ${cp2[0]},${cp2[1]} ${end[0]},${end[1]}`, points = rest;
|
|
6542
6595
|
}
|
|
6543
|
-
return invariant(points.length === 0, "all points should be consumed"), path;
|
|
6596
|
+
return invariant$1(points.length === 0, "all points should be consumed"), path;
|
|
6544
6597
|
}
|
|
6545
6598
|
const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
6546
6599
|
const [ax, ay] = n(a2) ? a2 : [a2.x, a2.y], [bx, by] = n(b2) ? b2 : [b2.x, b2.y];
|
|
@@ -6564,7 +6617,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6564
6617
|
isHovered: s2.hoveredEdgeId === id2,
|
|
6565
6618
|
isDimmed: s2.dimmed.has(id2),
|
|
6566
6619
|
hasOpenSourceRelation: !!s2.onOpenSourceRelation
|
|
6567
|
-
})), { nodeLookup, edgeLookup } = xyflowStore.getState(), sourceNode = nonNullable(nodeLookup.get(source), `source node ${source} not found`), targetNode = nonNullable(nodeLookup.get(target), `target node ${target} not found`), isModified = n$
|
|
6620
|
+
})), { nodeLookup, edgeLookup } = xyflowStore.getState(), sourceNode = nonNullable(nodeLookup.get(source), `source node ${source} not found`), targetNode = nonNullable(nodeLookup.get(target), `target node ${target} not found`), isModified = n$1(data.controlPoints) || !isSamePoint(sourceNode.internals.positionAbsolute, sourceNode.data.element.position) || !isSamePoint(targetNode.internals.positionAbsolute, targetNode.data.element.position), {
|
|
6568
6621
|
label,
|
|
6569
6622
|
edge: {
|
|
6570
6623
|
points: diagramEdgePoints,
|
|
@@ -6583,7 +6636,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6583
6636
|
x: label?.bbox.x ?? labelX,
|
|
6584
6637
|
y: label?.bbox.y ?? labelY
|
|
6585
6638
|
});
|
|
6586
|
-
let
|
|
6639
|
+
let edgePath2;
|
|
6587
6640
|
if (isModified) {
|
|
6588
6641
|
const sourceCenterPos = { x: sourceX, y: sourceY }, targetCenterPos = { x: targetX, y: targetY }, points = diagramEdge.dir === "back" ? [
|
|
6589
6642
|
targetCenterPos,
|
|
@@ -6598,9 +6651,9 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6598
6651
|
getNodeIntersectionFromCenterToPoint(targetNode, a$1(controlPoints) ?? sourceCenterPos),
|
|
6599
6652
|
targetCenterPos
|
|
6600
6653
|
];
|
|
6601
|
-
|
|
6654
|
+
edgePath2 = nonNullable(curve(points));
|
|
6602
6655
|
} else
|
|
6603
|
-
|
|
6656
|
+
edgePath2 = bezierPath(diagramEdgePoints);
|
|
6604
6657
|
const svgPathRef = useRef$1(null);
|
|
6605
6658
|
useEffect$1(() => {
|
|
6606
6659
|
const path = svgPathRef.current;
|
|
@@ -6610,7 +6663,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6610
6663
|
y: Math.round(dompoint.y)
|
|
6611
6664
|
};
|
|
6612
6665
|
setLabelPosition((current) => isSamePoint(current, point2) ? current : point2);
|
|
6613
|
-
}, [
|
|
6666
|
+
}, [edgePath2]), useDebouncedEffect(
|
|
6614
6667
|
() => {
|
|
6615
6668
|
!label || label.bbox.x === labelPos.x && label.bbox.y === labelPos.y || diagramStore.getState().xyflow.updateEdgeData(id2, {
|
|
6616
6669
|
label: {
|
|
@@ -6677,8 +6730,8 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6677
6730
|
"g",
|
|
6678
6731
|
{
|
|
6679
6732
|
className: clsx(
|
|
6680
|
-
container$
|
|
6681
|
-
isDimmed && dimmed$
|
|
6733
|
+
container$5,
|
|
6734
|
+
isDimmed && dimmed$3,
|
|
6682
6735
|
isControlPointDragging && controlDragging
|
|
6683
6736
|
),
|
|
6684
6737
|
"data-likec4-color": color2,
|
|
@@ -6690,7 +6743,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6690
6743
|
"path",
|
|
6691
6744
|
{
|
|
6692
6745
|
className: clsx("react-flow__edge-interaction"),
|
|
6693
|
-
d:
|
|
6746
|
+
d: edgePath2,
|
|
6694
6747
|
fill: "none",
|
|
6695
6748
|
stroke: "transparent",
|
|
6696
6749
|
strokeWidth: interactionWidth ?? 10
|
|
@@ -6705,7 +6758,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6705
6758
|
"path",
|
|
6706
6759
|
{
|
|
6707
6760
|
className: clsx("react-flow__edge-path", edgePathBg),
|
|
6708
|
-
d:
|
|
6761
|
+
d: edgePath2,
|
|
6709
6762
|
style,
|
|
6710
6763
|
strokeLinecap: "round"
|
|
6711
6764
|
}
|
|
@@ -6715,7 +6768,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6715
6768
|
{
|
|
6716
6769
|
ref: svgPathRef,
|
|
6717
6770
|
className: clsx("react-flow__edge-path", cssEdgePath),
|
|
6718
|
-
d:
|
|
6771
|
+
d: edgePath2,
|
|
6719
6772
|
style,
|
|
6720
6773
|
strokeLinecap: "round",
|
|
6721
6774
|
strokeDasharray,
|
|
@@ -6730,13 +6783,13 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6730
6783
|
onContextMenu: (e2) => {
|
|
6731
6784
|
e2.preventDefault(), e2.stopPropagation();
|
|
6732
6785
|
},
|
|
6733
|
-
children: controlPoints.map((
|
|
6786
|
+
children: controlPoints.map((p2, i2) => /* @__PURE__ */ jsx(
|
|
6734
6787
|
"circle",
|
|
6735
6788
|
{
|
|
6736
6789
|
onPointerDown: (e2) => onControlPointerDown(i2, e2),
|
|
6737
6790
|
className: controlPoint,
|
|
6738
|
-
cx:
|
|
6739
|
-
cy:
|
|
6791
|
+
cx: p2.x,
|
|
6792
|
+
cy: p2.y,
|
|
6740
6793
|
r: 3
|
|
6741
6794
|
},
|
|
6742
6795
|
i2
|
|
@@ -6786,9 +6839,9 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6786
6839
|
{
|
|
6787
6840
|
className: clsx([
|
|
6788
6841
|
"nodrag nopan",
|
|
6789
|
-
container$
|
|
6842
|
+
container$5,
|
|
6790
6843
|
edgeLabel,
|
|
6791
|
-
isDimmed && dimmed$
|
|
6844
|
+
isDimmed && dimmed$3
|
|
6792
6845
|
]),
|
|
6793
6846
|
style: {
|
|
6794
6847
|
...assignInlineVars({
|
|
@@ -6811,12 +6864,12 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
|
|
|
6811
6864
|
onClick: onClick || void 0,
|
|
6812
6865
|
children: [
|
|
6813
6866
|
stepNum !== null && /* @__PURE__ */ jsx(Box, { className: stepEdgeNumber, children: stepNum }),
|
|
6814
|
-
n$
|
|
6867
|
+
n$1(label?.text) && /* @__PURE__ */ jsx(Box, { className: edgeLabelText, children: label.text })
|
|
6815
6868
|
]
|
|
6816
6869
|
}
|
|
6817
6870
|
) });
|
|
6818
6871
|
/**
|
|
6819
|
-
* @license @tabler/icons-react v3.
|
|
6872
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6820
6873
|
*
|
|
6821
6874
|
* This source code is licensed under the MIT license.
|
|
6822
6875
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -6843,7 +6896,7 @@ var defaultAttributes = {
|
|
|
6843
6896
|
}
|
|
6844
6897
|
};
|
|
6845
6898
|
/**
|
|
6846
|
-
* @license @tabler/icons-react v3.
|
|
6899
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6847
6900
|
*
|
|
6848
6901
|
* This source code is licensed under the MIT license.
|
|
6849
6902
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -6876,182 +6929,210 @@ const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
6876
6929
|
return Component2.displayName = `${iconNamePascal}`, Component2;
|
|
6877
6930
|
};
|
|
6878
6931
|
/**
|
|
6879
|
-
* @license @tabler/icons-react v3.
|
|
6932
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6880
6933
|
*
|
|
6881
6934
|
* This source code is licensed under the MIT license.
|
|
6882
6935
|
* See the LICENSE file in the root directory of this source tree.
|
|
6883
6936
|
*/
|
|
6884
6937
|
var IconAlertTriangle = createReactComponent("outline", "alert-triangle", "IconAlertTriangle", [["path", { d: "M12 9v4", key: "svg-0" }], ["path", { d: "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z", key: "svg-1" }], ["path", { d: "M12 16h.01", key: "svg-2" }]]);
|
|
6885
6938
|
/**
|
|
6886
|
-
* @license @tabler/icons-react v3.
|
|
6939
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6887
6940
|
*
|
|
6888
6941
|
* This source code is licensed under the MIT license.
|
|
6889
6942
|
* See the LICENSE file in the root directory of this source tree.
|
|
6890
6943
|
*/
|
|
6891
6944
|
var IconArrowBigDownLines = createReactComponent("outline", "arrow-big-down-lines", "IconArrowBigDownLines", [["path", { d: "M15 12h3.586a1 1 0 0 1 .707 1.707l-6.586 6.586a1 1 0 0 1 -1.414 0l-6.586 -6.586a1 1 0 0 1 .707 -1.707h3.586v-3h6v3z", key: "svg-0" }], ["path", { d: "M15 3h-6", key: "svg-1" }], ["path", { d: "M15 6h-6", key: "svg-2" }]]);
|
|
6892
6945
|
/**
|
|
6893
|
-
* @license @tabler/icons-react v3.
|
|
6946
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6947
|
+
*
|
|
6948
|
+
* This source code is licensed under the MIT license.
|
|
6949
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6950
|
+
*/
|
|
6951
|
+
var IconArrowDownRight = createReactComponent("outline", "arrow-down-right", "IconArrowDownRight", [["path", { d: "M7 7l10 10", key: "svg-0" }], ["path", { d: "M17 8l0 9l-9 0", key: "svg-1" }]]);
|
|
6952
|
+
/**
|
|
6953
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6894
6954
|
*
|
|
6895
6955
|
* This source code is licensed under the MIT license.
|
|
6896
6956
|
* See the LICENSE file in the root directory of this source tree.
|
|
6897
6957
|
*/
|
|
6898
6958
|
var IconArrowLeft = createReactComponent("outline", "arrow-left", "IconArrowLeft", [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M5 12l6 6", key: "svg-1" }], ["path", { d: "M5 12l6 -6", key: "svg-2" }]]);
|
|
6899
6959
|
/**
|
|
6900
|
-
* @license @tabler/icons-react v3.
|
|
6960
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6901
6961
|
*
|
|
6902
6962
|
* This source code is licensed under the MIT license.
|
|
6903
6963
|
* See the LICENSE file in the root directory of this source tree.
|
|
6904
6964
|
*/
|
|
6905
6965
|
var IconCheck = createReactComponent("outline", "check", "IconCheck", [["path", { d: "M5 12l5 5l10 -10", key: "svg-0" }]]);
|
|
6906
6966
|
/**
|
|
6907
|
-
* @license @tabler/icons-react v3.
|
|
6967
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6908
6968
|
*
|
|
6909
6969
|
* This source code is licensed under the MIT license.
|
|
6910
6970
|
* See the LICENSE file in the root directory of this source tree.
|
|
6911
6971
|
*/
|
|
6912
6972
|
var IconChevronDown = createReactComponent("outline", "chevron-down", "IconChevronDown", [["path", { d: "M6 9l6 6l6 -6", key: "svg-0" }]]);
|
|
6913
6973
|
/**
|
|
6914
|
-
* @license @tabler/icons-react v3.
|
|
6974
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6915
6975
|
*
|
|
6916
6976
|
* This source code is licensed under the MIT license.
|
|
6917
6977
|
* See the LICENSE file in the root directory of this source tree.
|
|
6918
6978
|
*/
|
|
6919
6979
|
var IconChevronLeft = createReactComponent("outline", "chevron-left", "IconChevronLeft", [["path", { d: "M15 6l-6 6l6 6", key: "svg-0" }]]);
|
|
6920
6980
|
/**
|
|
6921
|
-
* @license @tabler/icons-react v3.
|
|
6981
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6922
6982
|
*
|
|
6923
6983
|
* This source code is licensed under the MIT license.
|
|
6924
6984
|
* See the LICENSE file in the root directory of this source tree.
|
|
6925
6985
|
*/
|
|
6926
6986
|
var IconChevronRight = createReactComponent("outline", "chevron-right", "IconChevronRight", [["path", { d: "M9 6l6 6l-6 6", key: "svg-0" }]]);
|
|
6927
6987
|
/**
|
|
6928
|
-
* @license @tabler/icons-react v3.
|
|
6988
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6929
6989
|
*
|
|
6930
6990
|
* This source code is licensed under the MIT license.
|
|
6931
6991
|
* See the LICENSE file in the root directory of this source tree.
|
|
6932
6992
|
*/
|
|
6933
6993
|
var IconCopy = createReactComponent("outline", "copy", "IconCopy", [["path", { d: "M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z", key: "svg-0" }], ["path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1", key: "svg-1" }]]);
|
|
6934
6994
|
/**
|
|
6935
|
-
* @license @tabler/icons-react v3.
|
|
6995
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6936
6996
|
*
|
|
6937
6997
|
* This source code is licensed under the MIT license.
|
|
6938
6998
|
* See the LICENSE file in the root directory of this source tree.
|
|
6939
6999
|
*/
|
|
6940
7000
|
var IconExternalLink = createReactComponent("outline", "external-link", "IconExternalLink", [["path", { d: "M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6", key: "svg-0" }], ["path", { d: "M11 13l9 -9", key: "svg-1" }], ["path", { d: "M15 4h5v5", key: "svg-2" }]]);
|
|
6941
7001
|
/**
|
|
6942
|
-
* @license @tabler/icons-react v3.
|
|
7002
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6943
7003
|
*
|
|
6944
7004
|
* This source code is licensed under the MIT license.
|
|
6945
7005
|
* See the LICENSE file in the root directory of this source tree.
|
|
6946
7006
|
*/
|
|
6947
7007
|
var IconFileCode = createReactComponent("outline", "file-code", "IconFileCode", [["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }], ["path", { d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z", key: "svg-1" }], ["path", { d: "M10 13l-1 2l1 2", key: "svg-2" }], ["path", { d: "M14 13l1 2l-1 2", key: "svg-3" }]]);
|
|
6948
7008
|
/**
|
|
6949
|
-
* @license @tabler/icons-react v3.
|
|
7009
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6950
7010
|
*
|
|
6951
7011
|
* This source code is licensed under the MIT license.
|
|
6952
7012
|
* See the LICENSE file in the root directory of this source tree.
|
|
6953
7013
|
*/
|
|
6954
7014
|
var IconFileSymlink = createReactComponent("outline", "file-symlink", "IconFileSymlink", [["path", { d: "M4 21v-4a3 3 0 0 1 3 -3h5", key: "svg-0" }], ["path", { d: "M9 17l3 -3l-3 -3", key: "svg-1" }], ["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-2" }], ["path", { d: "M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5", key: "svg-3" }]]);
|
|
6955
7015
|
/**
|
|
6956
|
-
* @license @tabler/icons-react v3.
|
|
7016
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6957
7017
|
*
|
|
6958
7018
|
* This source code is licensed under the MIT license.
|
|
6959
7019
|
* See the LICENSE file in the root directory of this source tree.
|
|
6960
7020
|
*/
|
|
6961
7021
|
var IconFocusCentered = createReactComponent("outline", "focus-centered", "IconFocusCentered", [["path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-0" }], ["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-1" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-2" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-3" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-4" }]]);
|
|
6962
7022
|
/**
|
|
6963
|
-
* @license @tabler/icons-react v3.
|
|
7023
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6964
7024
|
*
|
|
6965
7025
|
* This source code is licensed under the MIT license.
|
|
6966
7026
|
* See the LICENSE file in the root directory of this source tree.
|
|
6967
7027
|
*/
|
|
6968
7028
|
var IconFolderOpen = createReactComponent("outline", "folder-open", "IconFolderOpen", [["path", { d: "M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2", key: "svg-0" }]]);
|
|
6969
7029
|
/**
|
|
6970
|
-
* @license @tabler/icons-react v3.
|
|
7030
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7031
|
+
*
|
|
7032
|
+
* This source code is licensed under the MIT license.
|
|
7033
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7034
|
+
*/
|
|
7035
|
+
var IconHelpCircle = createReactComponent("outline", "help-circle", "IconHelpCircle", [["path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", key: "svg-0" }], ["path", { d: "M12 16v.01", key: "svg-1" }], ["path", { d: "M12 13a2 2 0 0 0 .914 -3.782a1.98 1.98 0 0 0 -2.414 .483", key: "svg-2" }]]);
|
|
7036
|
+
/**
|
|
7037
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6971
7038
|
*
|
|
6972
7039
|
* This source code is licensed under the MIT license.
|
|
6973
7040
|
* See the LICENSE file in the root directory of this source tree.
|
|
6974
7041
|
*/
|
|
6975
7042
|
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" }]]);
|
|
6976
7043
|
/**
|
|
6977
|
-
* @license @tabler/icons-react v3.
|
|
7044
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6978
7045
|
*
|
|
6979
7046
|
* This source code is licensed under the MIT license.
|
|
6980
7047
|
* See the LICENSE file in the root directory of this source tree.
|
|
6981
7048
|
*/
|
|
6982
7049
|
var IconLink = createReactComponent("outline", "link", "IconLink", [["path", { d: "M9 15l6 -6", key: "svg-0" }], ["path", { d: "M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464", key: "svg-1" }], ["path", { d: "M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463", key: "svg-2" }]]);
|
|
6983
7050
|
/**
|
|
6984
|
-
* @license @tabler/icons-react v3.
|
|
7051
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7052
|
+
*
|
|
7053
|
+
* This source code is licensed under the MIT license.
|
|
7054
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7055
|
+
*/
|
|
7056
|
+
var IconLoader = createReactComponent("outline", "loader", "IconLoader", [["path", { d: "M12 6l0 -3", key: "svg-0" }], ["path", { d: "M16.25 7.75l2.15 -2.15", key: "svg-1" }], ["path", { d: "M18 12l3 0", key: "svg-2" }], ["path", { d: "M16.25 16.25l2.15 2.15", key: "svg-3" }], ["path", { d: "M12 18l0 3", key: "svg-4" }], ["path", { d: "M7.75 16.25l-2.15 2.15", key: "svg-5" }], ["path", { d: "M6 12l-3 0", key: "svg-6" }], ["path", { d: "M7.75 7.75l-2.15 -2.15", key: "svg-7" }]]);
|
|
7057
|
+
/**
|
|
7058
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6985
7059
|
*
|
|
6986
7060
|
* This source code is licensed under the MIT license.
|
|
6987
7061
|
* See the LICENSE file in the root directory of this source tree.
|
|
6988
7062
|
*/
|
|
6989
7063
|
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" }]]);
|
|
6990
7064
|
/**
|
|
6991
|
-
* @license @tabler/icons-react v3.
|
|
7065
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6992
7066
|
*
|
|
6993
7067
|
* This source code is licensed under the MIT license.
|
|
6994
7068
|
* See the LICENSE file in the root directory of this source tree.
|
|
6995
7069
|
*/
|
|
6996
7070
|
var IconMenu = createReactComponent("outline", "menu", "IconMenu", [["path", { d: "M4 8l16 0", key: "svg-0" }], ["path", { d: "M4 16l16 0", key: "svg-1" }]]);
|
|
6997
7071
|
/**
|
|
6998
|
-
* @license @tabler/icons-react v3.
|
|
7072
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
6999
7073
|
*
|
|
7000
7074
|
* This source code is licensed under the MIT license.
|
|
7001
7075
|
* See the LICENSE file in the root directory of this source tree.
|
|
7002
7076
|
*/
|
|
7003
7077
|
var IconMoonStars = createReactComponent("outline", "moon-stars", "IconMoonStars", [["path", { d: "M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z", key: "svg-0" }], ["path", { d: "M17 4a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2", key: "svg-1" }], ["path", { d: "M19 11h2m-1 -1v2", key: "svg-2" }]]);
|
|
7004
7078
|
/**
|
|
7005
|
-
* @license @tabler/icons-react v3.
|
|
7079
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7006
7080
|
*
|
|
7007
7081
|
* This source code is licensed under the MIT license.
|
|
7008
7082
|
* See the LICENSE file in the root directory of this source tree.
|
|
7009
7083
|
*/
|
|
7010
7084
|
var IconShare = createReactComponent("outline", "share", "IconShare", [["path", { d: "M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-0" }], ["path", { d: "M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-1" }], ["path", { d: "M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-2" }], ["path", { d: "M8.7 10.7l6.6 -3.4", key: "svg-3" }], ["path", { d: "M8.7 13.3l6.6 3.4", key: "svg-4" }]]);
|
|
7011
7085
|
/**
|
|
7012
|
-
* @license @tabler/icons-react v3.
|
|
7086
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7013
7087
|
*
|
|
7014
7088
|
* This source code is licensed under the MIT license.
|
|
7015
7089
|
* See the LICENSE file in the root directory of this source tree.
|
|
7016
7090
|
*/
|
|
7017
7091
|
var IconSun = createReactComponent("outline", "sun", "IconSun", [["path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0", key: "svg-0" }], ["path", { d: "M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7", key: "svg-1" }]]);
|
|
7018
7092
|
/**
|
|
7019
|
-
* @license @tabler/icons-react v3.
|
|
7093
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7020
7094
|
*
|
|
7021
7095
|
* This source code is licensed under the MIT license.
|
|
7022
7096
|
* See the LICENSE file in the root directory of this source tree.
|
|
7023
7097
|
*/
|
|
7024
7098
|
var IconZoomScan = createReactComponent("outline", "zoom-scan", "IconZoomScan", [["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-0" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-1" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-2" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-3" }], ["path", { d: "M8 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0", key: "svg-4" }], ["path", { d: "M16 16l-2.5 -2.5", key: "svg-5" }]]);
|
|
7025
7099
|
/**
|
|
7026
|
-
* @license @tabler/icons-react v3.
|
|
7100
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7101
|
+
*
|
|
7102
|
+
* This source code is licensed under the MIT license.
|
|
7103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7104
|
+
*/
|
|
7105
|
+
var IconFileFilled = createReactComponent("filled", "file-filled", "IconFileFilled", [["path", { d: "M12 2l.117 .007a1 1 0 0 1 .876 .876l.007 .117v4l.005 .15a2 2 0 0 0 1.838 1.844l.157 .006h4l.117 .007a1 1 0 0 1 .876 .876l.007 .117v9a3 3 0 0 1 -2.824 2.995l-.176 .005h-10a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-14a3 3 0 0 1 2.824 -2.995l.176 -.005h5z", key: "svg-0" }], ["path", { d: "M19 7h-4l-.001 -4.001z", key: "svg-1" }]]);
|
|
7106
|
+
/**
|
|
7107
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7027
7108
|
*
|
|
7028
7109
|
* This source code is licensed under the MIT license.
|
|
7029
7110
|
* See the LICENSE file in the root directory of this source tree.
|
|
7030
7111
|
*/
|
|
7031
7112
|
var IconFolderFilled = createReactComponent("filled", "folder-filled", "IconFolderFilled", [["path", { d: "M9 3a1 1 0 0 1 .608 .206l.1 .087l2.706 2.707h6.586a3 3 0 0 1 2.995 2.824l.005 .176v8a3 3 0 0 1 -2.824 2.995l-.176 .005h-14a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-11a3 3 0 0 1 2.824 -2.995l.176 -.005h4z", key: "svg-0" }]]);
|
|
7032
7113
|
/**
|
|
7033
|
-
* @license @tabler/icons-react v3.
|
|
7114
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7034
7115
|
*
|
|
7035
7116
|
* This source code is licensed under the MIT license.
|
|
7036
7117
|
* See the LICENSE file in the root directory of this source tree.
|
|
7037
7118
|
*/
|
|
7038
7119
|
var IconPlayerPlayFilled = createReactComponent("filled", "player-play-filled", "IconPlayerPlayFilled", [["path", { d: "M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z", key: "svg-0" }]]);
|
|
7039
7120
|
/**
|
|
7040
|
-
* @license @tabler/icons-react v3.
|
|
7121
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7041
7122
|
*
|
|
7042
7123
|
* This source code is licensed under the MIT license.
|
|
7043
7124
|
* See the LICENSE file in the root directory of this source tree.
|
|
7044
7125
|
*/
|
|
7045
7126
|
var IconPlayerSkipBackFilled = createReactComponent("filled", "player-skip-back-filled", "IconPlayerSkipBackFilled", [["path", { d: "M19.496 4.136l-12 7a1 1 0 0 0 0 1.728l12 7a1 1 0 0 0 1.504 -.864v-14a1 1 0 0 0 -1.504 -.864z", key: "svg-0" }], ["path", { d: "M4 4a1 1 0 0 1 .993 .883l.007 .117v14a1 1 0 0 1 -1.993 .117l-.007 -.117v-14a1 1 0 0 1 1 -1z", key: "svg-1" }]]);
|
|
7046
7127
|
/**
|
|
7047
|
-
* @license @tabler/icons-react v3.
|
|
7128
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7048
7129
|
*
|
|
7049
7130
|
* This source code is licensed under the MIT license.
|
|
7050
7131
|
* See the LICENSE file in the root directory of this source tree.
|
|
7051
7132
|
*/
|
|
7052
7133
|
var IconPlayerSkipForwardFilled = createReactComponent("filled", "player-skip-forward-filled", "IconPlayerSkipForwardFilled", [["path", { d: "M3 5v14a1 1 0 0 0 1.504 .864l12 -7a1 1 0 0 0 0 -1.728l-12 -7a1 1 0 0 0 -1.504 .864z", key: "svg-0" }], ["path", { d: "M20 4a1 1 0 0 1 .993 .883l.007 .117v14a1 1 0 0 1 -1.993 .117l-.007 -.117v-14a1 1 0 0 1 1 -1z", key: "svg-1" }]]);
|
|
7053
7134
|
/**
|
|
7054
|
-
* @license @tabler/icons-react v3.
|
|
7135
|
+
* @license @tabler/icons-react v3.12.0 - MIT
|
|
7055
7136
|
*
|
|
7056
7137
|
* This source code is licensed under the MIT license.
|
|
7057
7138
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -7068,6 +7149,7 @@ function NavigateToBtn({ xynodeId, className }) {
|
|
|
7068
7149
|
onClick: (event) => {
|
|
7069
7150
|
event.stopPropagation(), diagramApi.getState().triggerOnNavigateTo(xynodeId, event);
|
|
7070
7151
|
},
|
|
7152
|
+
role: "button",
|
|
7071
7153
|
onDoubleClick: (event) => event.stopPropagation(),
|
|
7072
7154
|
children: /* @__PURE__ */ jsx(
|
|
7073
7155
|
IconZoomScan,
|
|
@@ -7081,7 +7163,7 @@ function NavigateToBtn({ xynodeId, className }) {
|
|
|
7081
7163
|
}
|
|
7082
7164
|
);
|
|
7083
7165
|
}
|
|
7084
|
-
var container$
|
|
7166
|
+
var container$4 = "c3cfh00", nodeHandlerInCenter = "c3cfh01", dimmed$2 = "c3cfh02", varOpacity = "var(--c3cfh03)", varBorderTransparency = "var(--c3cfh04)", compoundBody = "c3cfh05", transparent = "c3cfh07", title$2 = "c3cfh08", titleWithNavigation = "c3cfh09", indicator$1 = "c3cfh0d", navigateBtn = "c3cfh0f";
|
|
7085
7167
|
const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.data.element, next.data.element), CompoundNodeMemo = /* @__PURE__ */ memo$1(function({
|
|
7086
7168
|
id: id2,
|
|
7087
7169
|
data: {
|
|
@@ -7112,10 +7194,10 @@ const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.dat
|
|
|
7112
7194
|
Box,
|
|
7113
7195
|
{
|
|
7114
7196
|
className: clsx(
|
|
7115
|
-
container$
|
|
7197
|
+
container$4,
|
|
7116
7198
|
"likec4-compound-node",
|
|
7117
7199
|
opacity < 1 && "likec4-compound-transparent",
|
|
7118
|
-
isDimmed && dimmed$
|
|
7200
|
+
isDimmed && dimmed$2
|
|
7119
7201
|
),
|
|
7120
7202
|
mod: {
|
|
7121
7203
|
"compound-depth": depth,
|
|
@@ -7176,16 +7258,16 @@ const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.dat
|
|
|
7176
7258
|
)
|
|
7177
7259
|
] });
|
|
7178
7260
|
}, isEqualProps$1);
|
|
7179
|
-
var container$
|
|
7180
|
-
const selector$
|
|
7261
|
+
var container$3 = "_14ylloj1", handleCenter$1 = "_14ylloj2", containerAnimated = "_14ylloj3", dimmed$1 = "_14ylloj4", indicator = "_14ylloj7", fillElementFill = "_14ylloj8", fillMixStroke = "_14ylloja", hasIcon = "_14yllojb", title$1 = "_14ylloje", description$1 = "_14yllojf", technology = "_14yllojg", elementDataContainer = "_14yllojh", elementTextData = "_14ylloji", elementIcon = "_14yllojj", cssShapeSvg = "_14yllojm", cssNavigateBtn = "_14yllojn", elementLink = "_1s87wm0", trigger = "_1s87wm1";
|
|
7262
|
+
const selector$3 = (s2) => {
|
|
7181
7263
|
const target = s2.getContainer();
|
|
7182
7264
|
return target ? { target } : null;
|
|
7183
7265
|
};
|
|
7184
7266
|
function ElementLink({
|
|
7185
7267
|
element
|
|
7186
7268
|
}) {
|
|
7187
|
-
invariant(element.links, "ElementLink: links are required");
|
|
7188
|
-
const id2 = useId$1(), portalProps = useDiagramState(selector$
|
|
7269
|
+
invariant$1(element.links, "ElementLink: links are required");
|
|
7270
|
+
const id2 = useId$1(), portalProps = useDiagramState(selector$3);
|
|
7189
7271
|
return /* @__PURE__ */ jsx("div", { className: elementLink, "data-likec4-linkid": id2, children: /* @__PURE__ */ jsxs(
|
|
7190
7272
|
HoverCard,
|
|
7191
7273
|
{
|
|
@@ -7225,8 +7307,8 @@ function ElementLink({
|
|
|
7225
7307
|
onClick: (e2) => e2.stopPropagation(),
|
|
7226
7308
|
p: "xs",
|
|
7227
7309
|
children: /* @__PURE__ */ jsx(Stack, { gap: "xs", children: element.links.map((link) => /* @__PURE__ */ jsxs(Group, { wrap: "nowrap", gap: "sm", children: [
|
|
7228
|
-
/* @__PURE__ */ jsx(Box, { flex: "1", style: { overflow: "clip", maxWidth: u(element.width, { min: 200, max: 400 }) }, children: /* @__PURE__ */ jsx(Anchor, { href: link, target: "_blank", fz: "13", truncate: "end", children: link }) }),
|
|
7229
|
-
/* @__PURE__ */ jsx(CopyButton$1, { value: link, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
|
|
7310
|
+
/* @__PURE__ */ jsx(Box, { flex: "1", style: { overflow: "clip", maxWidth: u(element.width, { min: 200, max: 400 }) }, children: /* @__PURE__ */ jsx(Anchor, { href: link.url, target: "_blank", fz: "13", truncate: "end", children: link.title || link.url }) }),
|
|
7311
|
+
/* @__PURE__ */ jsx(CopyButton$1, { value: link.url, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
|
|
7230
7312
|
Button,
|
|
7231
7313
|
{
|
|
7232
7314
|
size: "compact-xs",
|
|
@@ -7237,7 +7319,7 @@ function ElementLink({
|
|
|
7237
7319
|
children: copied ? "copied" : "copy"
|
|
7238
7320
|
}
|
|
7239
7321
|
) })
|
|
7240
|
-
] }, link)) })
|
|
7322
|
+
] }, link.url)) })
|
|
7241
7323
|
}
|
|
7242
7324
|
)
|
|
7243
7325
|
]
|
|
@@ -7480,7 +7562,7 @@ const Text = Text$1.withProps({
|
|
|
7480
7562
|
{
|
|
7481
7563
|
type: "target",
|
|
7482
7564
|
position: Position.Top,
|
|
7483
|
-
className: handleCenter
|
|
7565
|
+
className: handleCenter$1
|
|
7484
7566
|
}
|
|
7485
7567
|
),
|
|
7486
7568
|
/* @__PURE__ */ jsxs(
|
|
@@ -7488,8 +7570,8 @@ const Text = Text$1.withProps({
|
|
|
7488
7570
|
{
|
|
7489
7571
|
id: id2,
|
|
7490
7572
|
className: clsx([
|
|
7491
|
-
container$
|
|
7492
|
-
isDimmed && dimmed,
|
|
7573
|
+
container$3,
|
|
7574
|
+
isDimmed && dimmed$1,
|
|
7493
7575
|
animate !== "idle" && containerAnimated,
|
|
7494
7576
|
"likec4-element-node"
|
|
7495
7577
|
]),
|
|
@@ -7537,7 +7619,7 @@ const Text = Text$1.withProps({
|
|
|
7537
7619
|
{
|
|
7538
7620
|
className: clsx(
|
|
7539
7621
|
elementDataContainer,
|
|
7540
|
-
n$
|
|
7622
|
+
n$1(elementIcon2) && hasIcon,
|
|
7541
7623
|
"likec4-element"
|
|
7542
7624
|
),
|
|
7543
7625
|
children: [
|
|
@@ -7578,7 +7660,7 @@ const Text = Text$1.withProps({
|
|
|
7578
7660
|
{
|
|
7579
7661
|
type: "source",
|
|
7580
7662
|
position: Position.Top,
|
|
7581
|
-
className: handleCenter
|
|
7663
|
+
className: handleCenter$1
|
|
7582
7664
|
}
|
|
7583
7665
|
)
|
|
7584
7666
|
] });
|
|
@@ -7951,9 +8033,9 @@ class Strength {
|
|
|
7951
8033
|
* @param [w] weight
|
|
7952
8034
|
* @return strength
|
|
7953
8035
|
*/
|
|
7954
|
-
static create(a2, b2,
|
|
8036
|
+
static create(a2, b2, c2, w = 1) {
|
|
7955
8037
|
let result = 0;
|
|
7956
|
-
return result += Math.max(0, Math.min(1e3, a2 * w)) * 1e6, result += Math.max(0, Math.min(1e3, b2 * w)) * 1e3, result += Math.max(0, Math.min(1e3,
|
|
8038
|
+
return result += Math.max(0, Math.min(1e3, a2 * w)) * 1e6, result += Math.max(0, Math.min(1e3, b2 * w)) * 1e3, result += Math.max(0, Math.min(1e3, c2 * w)), result;
|
|
7957
8039
|
}
|
|
7958
8040
|
/**
|
|
7959
8041
|
* The 'required' symbolic strength.
|
|
@@ -8175,9 +8257,9 @@ class Solver {
|
|
|
8175
8257
|
* Update the values of the variables.
|
|
8176
8258
|
*/
|
|
8177
8259
|
updateVariables() {
|
|
8178
|
-
let
|
|
8179
|
-
for (let i2 = 0, n2 =
|
|
8180
|
-
let pair =
|
|
8260
|
+
let vars2 = this._varMap, rows = this._rowMap;
|
|
8261
|
+
for (let i2 = 0, n2 = vars2.size(); i2 < n2; ++i2) {
|
|
8262
|
+
let pair = vars2.itemAt(i2), rowPair = rows.find(pair.second);
|
|
8181
8263
|
rowPair !== void 0 ? pair.first.setValue(rowPair.second.constant()) : pair.first.setValue(0);
|
|
8182
8264
|
}
|
|
8183
8265
|
}
|
|
@@ -8388,9 +8470,9 @@ class Solver {
|
|
|
8388
8470
|
_getDualEnteringSymbol(row) {
|
|
8389
8471
|
let ratio = Number.MAX_VALUE, entering = INVALID_SYMBOL, cells = row.cells();
|
|
8390
8472
|
for (let i2 = 0, n2 = cells.size(); i2 < n2; ++i2) {
|
|
8391
|
-
let pair = cells.itemAt(i2), symbol = pair.first,
|
|
8392
|
-
if (
|
|
8393
|
-
let r2 = this._objective.coefficientFor(symbol) /
|
|
8473
|
+
let pair = cells.itemAt(i2), symbol = pair.first, c2 = pair.second;
|
|
8474
|
+
if (c2 > 0 && symbol.type() !== SymbolType.Dummy) {
|
|
8475
|
+
let r2 = this._objective.coefficientFor(symbol) / c2;
|
|
8394
8476
|
r2 < ratio && (ratio = r2, entering = symbol);
|
|
8395
8477
|
}
|
|
8396
8478
|
}
|
|
@@ -8444,17 +8526,17 @@ class Solver {
|
|
|
8444
8526
|
_getMarkerLeavingSymbol(marker) {
|
|
8445
8527
|
let dmax = Number.MAX_VALUE, r1 = dmax, r2 = dmax, invalid = INVALID_SYMBOL, first = invalid, second = invalid, third = invalid, rows = this._rowMap;
|
|
8446
8528
|
for (let i2 = 0, n2 = rows.size(); i2 < n2; ++i2) {
|
|
8447
|
-
let pair = rows.itemAt(i2), row = pair.second,
|
|
8448
|
-
if (
|
|
8529
|
+
let pair = rows.itemAt(i2), row = pair.second, c2 = row.coefficientFor(marker);
|
|
8530
|
+
if (c2 === 0)
|
|
8449
8531
|
continue;
|
|
8450
8532
|
let symbol = pair.first;
|
|
8451
8533
|
if (symbol.type() === SymbolType.External)
|
|
8452
8534
|
third = symbol;
|
|
8453
|
-
else if (
|
|
8454
|
-
let r3 = -row.constant() /
|
|
8535
|
+
else if (c2 < 0) {
|
|
8536
|
+
let r3 = -row.constant() / c2;
|
|
8455
8537
|
r3 < r1 && (r1 = r3, first = symbol);
|
|
8456
8538
|
} else {
|
|
8457
|
-
let r3 = row.constant() /
|
|
8539
|
+
let r3 = row.constant() / c2;
|
|
8458
8540
|
r3 < r2 && (r2 = r3, second = symbol);
|
|
8459
8541
|
}
|
|
8460
8542
|
}
|
|
@@ -8839,7 +8921,7 @@ function useLayoutConstraints() {
|
|
|
8839
8921
|
cancelSaveManualLayout(), solverRef.current = createLayoutConstraints(xystore, xynode.id);
|
|
8840
8922
|
},
|
|
8841
8923
|
onNodeDrag: (_event, xynode) => {
|
|
8842
|
-
invariant(solverRef.current, "solverRef.current should be defined"), solverRef.current?.onNodeDrag(xynode);
|
|
8924
|
+
invariant$1(solverRef.current, "solverRef.current should be defined"), solverRef.current?.onNodeDrag(xynode);
|
|
8843
8925
|
},
|
|
8844
8926
|
onNodeDragStop: (_event, _xynode) => {
|
|
8845
8927
|
diagramApi.getState().scheduleSaveManualLayout(), solverRef.current = void 0;
|
|
@@ -8961,7 +9043,7 @@ function useXYFlowEvents() {
|
|
|
8961
9043
|
setLastClickedEdge
|
|
8962
9044
|
} = diagramApi.getState();
|
|
8963
9045
|
lastClickedEdgeId !== xyedge.id && setLastClickedEdge(xyedge.id);
|
|
8964
|
-
const isNotAFirstClick = lastClickedEdgeId === xyedge.id, isEdgeOfFocusedNode = n$
|
|
9046
|
+
const isNotAFirstClick = lastClickedEdgeId === xyedge.id, isEdgeOfFocusedNode = n$1(focusedNodeId) && (focusedNodeId === xyedge.source || focusedNodeId === xyedge.target);
|
|
8965
9047
|
if (isDynamicView && enableDynamicViewWalkthrough && (isEdgeOfFocusedNode || isNotAFirstClick || l(activeDynamicViewStep))) {
|
|
8966
9048
|
const nextStep = extractStep(xyedge.data.edge.id);
|
|
8967
9049
|
if (activeDynamicViewStep !== nextStep) {
|
|
@@ -9020,12 +9102,12 @@ function useXYFlowEvents() {
|
|
|
9020
9102
|
};
|
|
9021
9103
|
}, [diagramApi]);
|
|
9022
9104
|
}
|
|
9023
|
-
const nodeTypes = {
|
|
9105
|
+
const nodeTypes$1 = {
|
|
9024
9106
|
element: ElementNodeMemo,
|
|
9025
9107
|
compound: CompoundNodeMemo
|
|
9026
|
-
}, edgeTypes = {
|
|
9108
|
+
}, edgeTypes$1 = {
|
|
9027
9109
|
relationship: RelationshipEdge
|
|
9028
|
-
}, selector$
|
|
9110
|
+
}, selector$2 = (s2) => ({
|
|
9029
9111
|
nodes: s2.xynodes,
|
|
9030
9112
|
edges: s2.xyedges,
|
|
9031
9113
|
onInit: s2.onInit,
|
|
@@ -9073,7 +9155,7 @@ function XYFlow({
|
|
|
9073
9155
|
hasOnEdgeContextMenu,
|
|
9074
9156
|
translateX,
|
|
9075
9157
|
translateY
|
|
9076
|
-
} = useDiagramState(selector$
|
|
9158
|
+
} = useDiagramState(selector$2, shallowEqual), [zoomOnDoubleClick, setZoomOnDoubleClick] = useState$1(zoomable), layoutConstraints = useLayoutConstraints(), handlers = useXYFlowEvents();
|
|
9077
9159
|
return useOnViewportChange({
|
|
9078
9160
|
onEnd: ({ x: x2, y: y2, zoom }) => {
|
|
9079
9161
|
const roundedX = Math.round(x2), roundedY = Math.round(y2);
|
|
@@ -9087,8 +9169,8 @@ function XYFlow({
|
|
|
9087
9169
|
...colorMode && { colorMode },
|
|
9088
9170
|
nodes,
|
|
9089
9171
|
edges,
|
|
9090
|
-
nodeTypes,
|
|
9091
|
-
edgeTypes,
|
|
9172
|
+
nodeTypes: nodeTypes$1,
|
|
9173
|
+
edgeTypes: edgeTypes$1,
|
|
9092
9174
|
zoomOnPinch: zoomable,
|
|
9093
9175
|
zoomOnScroll: !pannable && zoomable,
|
|
9094
9176
|
...!zoomable && {
|
|
@@ -9159,15 +9241,15 @@ function XYFlow({
|
|
|
9159
9241
|
}
|
|
9160
9242
|
);
|
|
9161
9243
|
}
|
|
9162
|
-
var container$
|
|
9163
|
-
const selector = (s2) => ({
|
|
9244
|
+
var container$2 = "_19ci0hj0", card$1 = "_19ci0hj1", title = "_19ci0hj2", description = "_19ci0hj3";
|
|
9245
|
+
const selector$1 = (s2) => ({
|
|
9164
9246
|
id: s2.view.id,
|
|
9165
9247
|
title: s2.view.title ?? "untitled",
|
|
9166
9248
|
description: s2.view.description,
|
|
9167
9249
|
links: s2.view.links
|
|
9168
9250
|
});
|
|
9169
9251
|
function DiagramTitlePanel() {
|
|
9170
|
-
const { id: id2, title: title$12, description: description$12, links } = useDiagramState(selector), [isCollapsed, setCollapsed] = useLocalStorage({
|
|
9252
|
+
const { id: id2, title: title$12, description: description$12, links } = useDiagramState(selector$1), [isCollapsed, setCollapsed] = useLocalStorage({
|
|
9171
9253
|
key: "diagram-title-panel-collapsed",
|
|
9172
9254
|
defaultValue: !1
|
|
9173
9255
|
}), toggle = () => setCollapsed((v) => !v);
|
|
@@ -9180,7 +9262,7 @@ function DiagramTitlePanel() {
|
|
|
9180
9262
|
opacity: 0.05,
|
|
9181
9263
|
scale: 0.6
|
|
9182
9264
|
},
|
|
9183
|
-
className: clsx("react-flow__panel", container$
|
|
9265
|
+
className: clsx("react-flow__panel", container$2),
|
|
9184
9266
|
style: {
|
|
9185
9267
|
transformOrigin: "left center"
|
|
9186
9268
|
},
|
|
@@ -9188,8 +9270,8 @@ function DiagramTitlePanel() {
|
|
|
9188
9270
|
Card,
|
|
9189
9271
|
{
|
|
9190
9272
|
radius: "sm",
|
|
9191
|
-
className: card,
|
|
9192
|
-
withBorder: !
|
|
9273
|
+
className: card$1,
|
|
9274
|
+
withBorder: !isCollapsed,
|
|
9193
9275
|
p: isCollapsed ? "sm" : "md",
|
|
9194
9276
|
onDoubleClick: (e2) => e2.stopPropagation(),
|
|
9195
9277
|
children: [
|
|
@@ -9198,17 +9280,18 @@ function DiagramTitlePanel() {
|
|
|
9198
9280
|
{
|
|
9199
9281
|
fullWidth: !0,
|
|
9200
9282
|
justify: "stretch",
|
|
9201
|
-
size: "
|
|
9202
|
-
py: 2,
|
|
9283
|
+
size: "md",
|
|
9203
9284
|
radius: "0",
|
|
9204
9285
|
variant: "subtle",
|
|
9205
|
-
color: "
|
|
9286
|
+
color: "gray",
|
|
9206
9287
|
onClick: toggle,
|
|
9207
|
-
|
|
9288
|
+
fw: 500,
|
|
9289
|
+
fz: "sm",
|
|
9290
|
+
children: title$12
|
|
9208
9291
|
}
|
|
9209
9292
|
) }),
|
|
9210
9293
|
!isCollapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9211
|
-
/* @__PURE__ */ jsx(CardSection, { mb: "
|
|
9294
|
+
/* @__PURE__ */ jsx(CardSection, { mb: "xs", children: /* @__PURE__ */ jsx(
|
|
9212
9295
|
Button,
|
|
9213
9296
|
{
|
|
9214
9297
|
fullWidth: !0,
|
|
@@ -9295,16 +9378,16 @@ function DiagramTitlePanel() {
|
|
|
9295
9378
|
/* @__PURE__ */ jsx(Box, { flex: "1", style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx(
|
|
9296
9379
|
Anchor,
|
|
9297
9380
|
{
|
|
9298
|
-
href: link,
|
|
9381
|
+
href: link.url,
|
|
9299
9382
|
target: "_blank",
|
|
9300
9383
|
fz: "xs",
|
|
9301
9384
|
truncate: "end",
|
|
9302
9385
|
display: "inline-block",
|
|
9303
9386
|
w: "100%",
|
|
9304
|
-
children: link
|
|
9387
|
+
children: link.title || link.url
|
|
9305
9388
|
}
|
|
9306
9389
|
) }),
|
|
9307
|
-
/* @__PURE__ */ jsx(CopyButton$1, { value: link, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
|
|
9390
|
+
/* @__PURE__ */ jsx(CopyButton$1, { value: link.url, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
|
|
9308
9391
|
Button,
|
|
9309
9392
|
{
|
|
9310
9393
|
size: "compact-xs",
|
|
@@ -9315,7 +9398,7 @@ function DiagramTitlePanel() {
|
|
|
9315
9398
|
children: copied ? "copied" : "copy"
|
|
9316
9399
|
}
|
|
9317
9400
|
) })
|
|
9318
|
-
] }, link))
|
|
9401
|
+
] }, link.url))
|
|
9319
9402
|
}
|
|
9320
9403
|
)
|
|
9321
9404
|
] })
|
|
@@ -9326,7 +9409,7 @@ function DiagramTitlePanel() {
|
|
|
9326
9409
|
id2
|
|
9327
9410
|
) });
|
|
9328
9411
|
}
|
|
9329
|
-
var container = "h3ljtj0", buttons = "h3ljtj1", btn = "h3ljtj3";
|
|
9412
|
+
var container$1 = "h3ljtj0", buttons = "h3ljtj1", btn = "h3ljtj3";
|
|
9330
9413
|
function DynamicViewWalkthrough() {
|
|
9331
9414
|
const isMobile = useXYStore((s2) => s2.width <= 750), {
|
|
9332
9415
|
nextDynamicStep,
|
|
@@ -9361,7 +9444,7 @@ function DynamicViewWalkthrough() {
|
|
|
9361
9444
|
return /* @__PURE__ */ jsxs(
|
|
9362
9445
|
Box,
|
|
9363
9446
|
{
|
|
9364
|
-
className: clsx("react-flow__panel", container),
|
|
9447
|
+
className: clsx("react-flow__panel", container$1),
|
|
9365
9448
|
onClick: (e2) => e2.stopPropagation(),
|
|
9366
9449
|
onDoubleClick: (e2) => e2.stopPropagation(),
|
|
9367
9450
|
children: [
|
|
@@ -9415,6 +9498,227 @@ function DynamicViewWalkthrough() {
|
|
|
9415
9498
|
}
|
|
9416
9499
|
);
|
|
9417
9500
|
}
|
|
9501
|
+
var vars = { safariAnimationHook: "var(--likec4-safari-animation-hook)", default: { font: "var(--likec4-default-font-family)" }, likec4: { font: "var(--likec4-font-family)", background: { color: "var(--likec4-background-color)", pattern: { color: "var(--likec4-background-pattern-color)" } } }, compound: { font: "var(--likec4-compound-font-family)", titleColor: "var(--likec4-compound-title-color)" }, element: { font: "var(--likec4-element-font-family)", fill: "var(--likec4-element-fill)", stroke: "var(--likec4-element-stroke)", hiContrast: "var(--likec4-element-hiContrast)", loContrast: "var(--likec4-element-loContrast)" }, relation: { lineColor: "var(--likec4-relation-lineColor)", labelColor: "var(--likec4-relation-labelColor)", labelBgColor: "var(--likec4-relation-labelBg)" }, optionsPanel: { top: "var(--likec4-options-panel-top)", right: "var(--likec4-options-panel-right)" }, navigationPanel: { top: "var(--likec4-navigation-panel-top)", left: "var(--likec4-navigation-panel-left)" } }, container = "eaj0yq0", card = "eaj0yq1", tabPanel = "eaj0yq2", elementNotation = "eaj0yq3", shapeSvg = "eaj0yq4", shapeBadge = "eaj0yq5";
|
|
9502
|
+
const ElementNotation = ({ value }) => {
|
|
9503
|
+
const {
|
|
9504
|
+
title: title2,
|
|
9505
|
+
color: color2 = "primary",
|
|
9506
|
+
shape = "rectangle"
|
|
9507
|
+
} = value, [onlyKind, setOnlyKind] = useState$1(null), diagramStore = useDiagramStoreApi(), w = 300, h = 200;
|
|
9508
|
+
return /* @__PURE__ */ jsx(
|
|
9509
|
+
Card,
|
|
9510
|
+
{
|
|
9511
|
+
shadow: "none",
|
|
9512
|
+
px: "xs",
|
|
9513
|
+
py: "sm",
|
|
9514
|
+
className: elementNotation,
|
|
9515
|
+
mod: {
|
|
9516
|
+
"data-likec4-color": color2
|
|
9517
|
+
},
|
|
9518
|
+
onMouseEnter: () => {
|
|
9519
|
+
setOnlyKind(null), diagramStore.getState().highlightByElementNotation(value);
|
|
9520
|
+
},
|
|
9521
|
+
onMouseLeave: () => {
|
|
9522
|
+
setOnlyKind(null), diagramStore.setState({ dimmed: /* @__PURE__ */ new Set() });
|
|
9523
|
+
},
|
|
9524
|
+
children: /* @__PURE__ */ jsxs(
|
|
9525
|
+
Group,
|
|
9526
|
+
{
|
|
9527
|
+
gap: "sm",
|
|
9528
|
+
align: "stretch",
|
|
9529
|
+
wrap: "nowrap",
|
|
9530
|
+
children: [
|
|
9531
|
+
/* @__PURE__ */ jsx(
|
|
9532
|
+
Box,
|
|
9533
|
+
{
|
|
9534
|
+
flex: "0 0 70px",
|
|
9535
|
+
style: {
|
|
9536
|
+
width: 70,
|
|
9537
|
+
height: u$1(70 * (h / w), 0)
|
|
9538
|
+
},
|
|
9539
|
+
children: /* @__PURE__ */ jsx(
|
|
9540
|
+
"svg",
|
|
9541
|
+
{
|
|
9542
|
+
className: clsx(
|
|
9543
|
+
shapeSvg
|
|
9544
|
+
),
|
|
9545
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
9546
|
+
children: /* @__PURE__ */ jsx(
|
|
9547
|
+
ElementShapeSvg,
|
|
9548
|
+
{
|
|
9549
|
+
shape,
|
|
9550
|
+
w,
|
|
9551
|
+
h
|
|
9552
|
+
}
|
|
9553
|
+
)
|
|
9554
|
+
}
|
|
9555
|
+
)
|
|
9556
|
+
}
|
|
9557
|
+
),
|
|
9558
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 4, flex: 1, children: [
|
|
9559
|
+
/* @__PURE__ */ jsx(Group, { gap: 4, flex: "0 0 auto", children: value.kinds.map((kind) => /* @__PURE__ */ jsx(
|
|
9560
|
+
Badge,
|
|
9561
|
+
{
|
|
9562
|
+
className: shapeBadge,
|
|
9563
|
+
onMouseEnter: () => {
|
|
9564
|
+
setOnlyKind(kind), diagramStore.getState().highlightByElementNotation(value, kind);
|
|
9565
|
+
},
|
|
9566
|
+
onMouseLeave: () => {
|
|
9567
|
+
setOnlyKind(null), diagramStore.getState().highlightByElementNotation(value);
|
|
9568
|
+
},
|
|
9569
|
+
opacity: l(onlyKind) && onlyKind !== kind ? 0.25 : 1,
|
|
9570
|
+
color: l(onlyKind) && onlyKind !== kind ? "gray" : vars.element.fill,
|
|
9571
|
+
children: kind
|
|
9572
|
+
},
|
|
9573
|
+
kind
|
|
9574
|
+
)) }),
|
|
9575
|
+
/* @__PURE__ */ jsx(
|
|
9576
|
+
Text$1,
|
|
9577
|
+
{
|
|
9578
|
+
component: "div",
|
|
9579
|
+
fz: "sm",
|
|
9580
|
+
fw: 500,
|
|
9581
|
+
lh: "1.25",
|
|
9582
|
+
style: {
|
|
9583
|
+
textWrap: "pretty"
|
|
9584
|
+
},
|
|
9585
|
+
children: title2
|
|
9586
|
+
}
|
|
9587
|
+
)
|
|
9588
|
+
] })
|
|
9589
|
+
]
|
|
9590
|
+
}
|
|
9591
|
+
)
|
|
9592
|
+
}
|
|
9593
|
+
);
|
|
9594
|
+
}, selector = (s2) => ({
|
|
9595
|
+
id: s2.view.id,
|
|
9596
|
+
notations: s2.view.notation?.elements ?? [],
|
|
9597
|
+
height: s2.xystore.getState().height,
|
|
9598
|
+
isVisible: e$3(s2.focusedNodeId ?? s2.activeDynamicViewStep),
|
|
9599
|
+
target: s2.getContainer()
|
|
9600
|
+
});
|
|
9601
|
+
function NotationPanel() {
|
|
9602
|
+
const {
|
|
9603
|
+
id: id2,
|
|
9604
|
+
notations,
|
|
9605
|
+
isVisible,
|
|
9606
|
+
height,
|
|
9607
|
+
target
|
|
9608
|
+
} = useDiagramState(selector), [isCollapsed, setCollapsed] = useLocalStorage({
|
|
9609
|
+
key: "notation-panel-collapsed",
|
|
9610
|
+
defaultValue: !0
|
|
9611
|
+
}), hasNotations = notations.length > 0, portalProps = target ? { portalProps: { target } } : { withinPortal: !1 };
|
|
9612
|
+
return /* @__PURE__ */ jsxs(AnimatePresence, { children: [
|
|
9613
|
+
!hasNotations && /* @__PURE__ */ jsx(
|
|
9614
|
+
m.div,
|
|
9615
|
+
{
|
|
9616
|
+
initial: { opacity: 0.75, translateX: "50%" },
|
|
9617
|
+
animate: { opacity: 1, translateX: 0 },
|
|
9618
|
+
exit: {
|
|
9619
|
+
translateX: "100%",
|
|
9620
|
+
opacity: 0.6
|
|
9621
|
+
},
|
|
9622
|
+
className: clsx("react-flow__panel", container),
|
|
9623
|
+
children: /* @__PURE__ */ jsx(Tooltip$2, { label: "Diagram has no notations", color: "orange", ...portalProps, children: /* @__PURE__ */ jsx(
|
|
9624
|
+
ThemeIcon,
|
|
9625
|
+
{
|
|
9626
|
+
size: "xl",
|
|
9627
|
+
variant: "light",
|
|
9628
|
+
color: "orange",
|
|
9629
|
+
radius: "md",
|
|
9630
|
+
children: /* @__PURE__ */ jsx(IconAlertTriangle, {})
|
|
9631
|
+
}
|
|
9632
|
+
) })
|
|
9633
|
+
},
|
|
9634
|
+
"empty"
|
|
9635
|
+
),
|
|
9636
|
+
hasNotations && isVisible && isCollapsed && /* @__PURE__ */ jsx(
|
|
9637
|
+
m.div,
|
|
9638
|
+
{
|
|
9639
|
+
initial: { opacity: 0.75, translateX: "50%" },
|
|
9640
|
+
animate: { opacity: 1, translateX: 0 },
|
|
9641
|
+
exit: {
|
|
9642
|
+
translateX: "100%",
|
|
9643
|
+
opacity: 0.6
|
|
9644
|
+
},
|
|
9645
|
+
className: clsx("react-flow__panel", container),
|
|
9646
|
+
children: /* @__PURE__ */ jsx(Tooltip$2, { label: "Show notation", color: "dark", fz: "xs", ...portalProps, children: /* @__PURE__ */ jsx(
|
|
9647
|
+
ActionIcon$2,
|
|
9648
|
+
{
|
|
9649
|
+
size: "xl",
|
|
9650
|
+
variant: "light",
|
|
9651
|
+
color: "gray",
|
|
9652
|
+
radius: "md",
|
|
9653
|
+
onClick: () => setCollapsed(!1),
|
|
9654
|
+
children: /* @__PURE__ */ jsx(IconHelpCircle, { stroke: 1.5 })
|
|
9655
|
+
}
|
|
9656
|
+
) })
|
|
9657
|
+
},
|
|
9658
|
+
"collapsed"
|
|
9659
|
+
),
|
|
9660
|
+
hasNotations && isVisible && !isCollapsed && /* @__PURE__ */ jsx(
|
|
9661
|
+
m.div,
|
|
9662
|
+
{
|
|
9663
|
+
initial: {
|
|
9664
|
+
opacity: 0.75,
|
|
9665
|
+
// translateX: '50%',
|
|
9666
|
+
scale: 0.2
|
|
9667
|
+
},
|
|
9668
|
+
animate: { opacity: 1, scale: 1 },
|
|
9669
|
+
exit: {
|
|
9670
|
+
opacity: 0,
|
|
9671
|
+
scale: 0.25
|
|
9672
|
+
},
|
|
9673
|
+
className: clsx("react-flow__panel", container),
|
|
9674
|
+
style: {
|
|
9675
|
+
transformOrigin: "bottom right"
|
|
9676
|
+
},
|
|
9677
|
+
children: /* @__PURE__ */ jsx(
|
|
9678
|
+
Paper,
|
|
9679
|
+
{
|
|
9680
|
+
radius: "sm",
|
|
9681
|
+
withBorder: !0,
|
|
9682
|
+
shadow: "lg",
|
|
9683
|
+
className: card,
|
|
9684
|
+
children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: "first", radius: "xs", children: [
|
|
9685
|
+
/* @__PURE__ */ jsxs(TabsList, { children: [
|
|
9686
|
+
/* @__PURE__ */ jsx(
|
|
9687
|
+
ActionIcon$2,
|
|
9688
|
+
{
|
|
9689
|
+
size: "md",
|
|
9690
|
+
variant: "subtle",
|
|
9691
|
+
color: "gray",
|
|
9692
|
+
ml: 2,
|
|
9693
|
+
style: {
|
|
9694
|
+
alignSelf: "center"
|
|
9695
|
+
},
|
|
9696
|
+
onClick: () => setCollapsed(!0),
|
|
9697
|
+
children: /* @__PURE__ */ jsx(IconArrowDownRight, { stroke: 2 })
|
|
9698
|
+
}
|
|
9699
|
+
),
|
|
9700
|
+
/* @__PURE__ */ jsx(TabsTab, { value: "first", fz: "xs", children: "Elements" }),
|
|
9701
|
+
/* @__PURE__ */ jsx(TabsTab, { value: "second", fz: "xs", disabled: !0, children: "Relationships" })
|
|
9702
|
+
] }),
|
|
9703
|
+
/* @__PURE__ */ jsx(TabsPanel, { value: "first", className: tabPanel, hidden: isCollapsed, children: /* @__PURE__ */ jsx(
|
|
9704
|
+
ScrollAreaAutosize,
|
|
9705
|
+
{
|
|
9706
|
+
viewportProps: {
|
|
9707
|
+
style: {
|
|
9708
|
+
maxHeight: height > 50 ? `min(40vh, ${height - 20}px)` : "40vh"
|
|
9709
|
+
}
|
|
9710
|
+
},
|
|
9711
|
+
children: /* @__PURE__ */ jsx(Stack, { gap: 0, children: notations.map((n2, i2) => /* @__PURE__ */ jsx(ElementNotation, { value: n2 }, i2)) })
|
|
9712
|
+
}
|
|
9713
|
+
) })
|
|
9714
|
+
] })
|
|
9715
|
+
}
|
|
9716
|
+
)
|
|
9717
|
+
},
|
|
9718
|
+
id2
|
|
9719
|
+
)
|
|
9720
|
+
] });
|
|
9721
|
+
}
|
|
9418
9722
|
const {
|
|
9419
9723
|
primary,
|
|
9420
9724
|
secondary,
|
|
@@ -9435,7 +9739,7 @@ const {
|
|
|
9435
9739
|
throw new Error("NodeOptions: nodes and props.nodes should have the same length");
|
|
9436
9740
|
const showShapeOption = nodes.some((node) => node.type === "element"), [firstNode, ...rest] = nodes, showGoToSource = rest.length === 0 && diagramApi.getState().onOpenSourceElement, showOpacityOption = firstNode.type === "compound" && (rest.length === 0 || rest.every((node) => node.type === "compound")), triggerChange = (style) => {
|
|
9437
9741
|
const targets = nodes.map((node) => node.data.element.id);
|
|
9438
|
-
invariant(i$3(targets, 1), "At least one target is required"), diagramApi.getState().triggerChangeElementStyle({
|
|
9742
|
+
invariant$1(i$3(targets, 1), "At least one target is required"), diagramApi.getState().triggerChangeElementStyle({
|
|
9439
9743
|
op: "change-element-style",
|
|
9440
9744
|
style,
|
|
9441
9745
|
targets
|
|
@@ -9521,7 +9825,7 @@ function Colors({
|
|
|
9521
9825
|
onColorChange
|
|
9522
9826
|
}) {
|
|
9523
9827
|
let selectedColor = firstNode.data.element.color;
|
|
9524
|
-
|
|
9828
|
+
u$4(nodes, (node) => node.data.element.color !== selectedColor ? (selectedColor = null, !1) : !0);
|
|
9525
9829
|
const changeColor = (color2) => () => {
|
|
9526
9830
|
selectedColor !== color2 && onColorChange(color2);
|
|
9527
9831
|
};
|
|
@@ -9577,7 +9881,7 @@ function ShapeOption({
|
|
|
9577
9881
|
onShapeChange
|
|
9578
9882
|
}) {
|
|
9579
9883
|
let selectedShape = firstNode.data.element.shape;
|
|
9580
|
-
return
|
|
9884
|
+
return u$4(nodes, (node) => node.data.element.shape !== selectedShape ? (selectedShape = null, !1) : !0), /* @__PURE__ */ jsxs("div", { children: [
|
|
9581
9885
|
/* @__PURE__ */ jsx(Divider, { label: "shape", labelPosition: "left" }),
|
|
9582
9886
|
/* @__PURE__ */ jsx(
|
|
9583
9887
|
Select,
|
|
@@ -9942,19 +10246,19 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
9942
10246
|
showFitDiagram,
|
|
9943
10247
|
showLayoutDriftWarning,
|
|
9944
10248
|
showChangeAutoLayout,
|
|
9945
|
-
|
|
10249
|
+
target,
|
|
9946
10250
|
showGoToSource
|
|
9947
10251
|
} = useDiagramState((s2) => {
|
|
9948
|
-
const isNotActive = s2.activeDynamicViewStep === null && s2.focusedNodeId === null
|
|
10252
|
+
const isNotActive = s2.activeDynamicViewStep === null && s2.focusedNodeId === null;
|
|
9949
10253
|
return {
|
|
9950
10254
|
showNavigationButtons: !!s2.onBurgerMenuClick || s2.showNavigationButtons && !!s2.onNavigateTo,
|
|
9951
10255
|
showFitDiagram: s2.fitViewEnabled && s2.zoomable && s2.viewportChanged,
|
|
9952
10256
|
showLayoutDriftWarning: s2.readonly !== !0 && s2.view.hasLayoutDrift === !0 && isNotActive,
|
|
9953
10257
|
showChangeAutoLayout: s2.readonly !== !0 && !!s2.onChange && isNotActive,
|
|
9954
10258
|
showGoToSource: !!s2.onOpenSourceView,
|
|
9955
|
-
|
|
10259
|
+
target: s2.getContainer()
|
|
9956
10260
|
};
|
|
9957
|
-
}), portalProps =
|
|
10261
|
+
}), portalProps = target ? { portalProps: { target } } : void 0;
|
|
9958
10262
|
return /* @__PURE__ */ jsxs(
|
|
9959
10263
|
Stack,
|
|
9960
10264
|
{
|
|
@@ -10034,7 +10338,7 @@ function literalToEnum(value) {
|
|
|
10034
10338
|
}
|
|
10035
10339
|
function XYFlowBackground({ background }) {
|
|
10036
10340
|
if (typeof background == "string")
|
|
10037
|
-
return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(background) });
|
|
10341
|
+
return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(background), size: 2, gap: 20 });
|
|
10038
10342
|
const { variant, ...rest } = background;
|
|
10039
10343
|
return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(variant), ...rest });
|
|
10040
10344
|
}
|
|
@@ -10045,11 +10349,13 @@ const XYFlowInner = memo$1(function({
|
|
|
10045
10349
|
showDiagramTitle
|
|
10046
10350
|
}) {
|
|
10047
10351
|
const {
|
|
10352
|
+
showNotations,
|
|
10048
10353
|
isDynamicView,
|
|
10049
10354
|
isDynamicViewActive,
|
|
10050
10355
|
readonly,
|
|
10051
10356
|
enableDynamicViewWalkthrough
|
|
10052
10357
|
} = useDiagramState((s2) => ({
|
|
10358
|
+
showNotations: s2.showNotations,
|
|
10053
10359
|
isDynamicView: s2.isDynamicView,
|
|
10054
10360
|
readonly: s2.readonly,
|
|
10055
10361
|
enableDynamicViewWalkthrough: s2.enableDynamicViewWalkthrough,
|
|
@@ -10062,6 +10368,7 @@ const XYFlowInner = memo$1(function({
|
|
|
10062
10368
|
readonly !== !0 && /* @__PURE__ */ jsx(OptionsPanel, {}),
|
|
10063
10369
|
showDiagramTitle === !0 && !isDynamicViewActive && /* @__PURE__ */ jsx(DiagramTitlePanel, {}),
|
|
10064
10370
|
isDynamicView && enableDynamicViewWalkthrough && /* @__PURE__ */ jsx(DynamicViewWalkthrough, {}),
|
|
10371
|
+
showNotations && /* @__PURE__ */ jsx(NotationPanel, {}),
|
|
10065
10372
|
children
|
|
10066
10373
|
] });
|
|
10067
10374
|
}, shallowEqual);
|
|
@@ -10080,6 +10387,7 @@ function LikeC4Diagram({
|
|
|
10080
10387
|
controls = !1,
|
|
10081
10388
|
showElementLinks = !0,
|
|
10082
10389
|
showDiagramTitle = !0,
|
|
10390
|
+
showNotations = !0,
|
|
10083
10391
|
enableDynamicViewWalkthrough = !1,
|
|
10084
10392
|
enableFocusMode = !1,
|
|
10085
10393
|
initialWidth,
|
|
@@ -10127,6 +10435,7 @@ function LikeC4Diagram({
|
|
|
10127
10435
|
fitViewPadding,
|
|
10128
10436
|
showElementLinks,
|
|
10129
10437
|
showNavigationButtons,
|
|
10438
|
+
showNotations,
|
|
10130
10439
|
nodesDraggable,
|
|
10131
10440
|
nodesSelectable,
|
|
10132
10441
|
experimentalEdgeEditing,
|
|
@@ -10224,6 +10533,7 @@ function StaticLikeC4Diagram({
|
|
|
10224
10533
|
background,
|
|
10225
10534
|
showElementLinks: !0,
|
|
10226
10535
|
showDiagramTitle: !1,
|
|
10536
|
+
showNotations: !1,
|
|
10227
10537
|
enableDynamicViewWalkthrough: !1,
|
|
10228
10538
|
enableFocusMode: !1,
|
|
10229
10539
|
nodesSelectable: !1,
|
|
@@ -10232,10 +10542,292 @@ function StaticLikeC4Diagram({
|
|
|
10232
10542
|
}
|
|
10233
10543
|
);
|
|
10234
10544
|
}
|
|
10235
|
-
var
|
|
10236
|
-
|
|
10237
|
-
|
|
10545
|
+
var root = "mxt2a80";
|
|
10546
|
+
function edgePath(points) {
|
|
10547
|
+
return points.reduce((acc, [x2, y2], i2) => acc + `${i2 === 0 ? "M" : " L"} ${x2},${y2}`, "");
|
|
10548
|
+
}
|
|
10549
|
+
function LinkEdge({
|
|
10550
|
+
id: id2,
|
|
10551
|
+
data,
|
|
10552
|
+
...props2
|
|
10553
|
+
}) {
|
|
10554
|
+
if (!data)
|
|
10555
|
+
return null;
|
|
10556
|
+
const path = edgePath(data.points);
|
|
10557
|
+
return /* @__PURE__ */ jsx(
|
|
10558
|
+
BaseEdge,
|
|
10559
|
+
{
|
|
10560
|
+
id: id2,
|
|
10561
|
+
path,
|
|
10562
|
+
...props2
|
|
10563
|
+
}
|
|
10564
|
+
);
|
|
10565
|
+
}
|
|
10566
|
+
var handleCenter = "_1n8mzjc0", toplevelNode = "_1n8mzjc1", nestedNode = "_1n8mzjc2", dimmed = "_1n8mzjc3", folderNode = "_1n8mzjc4", fileNode = "_1n8mzjc5", viewNode = "_1n8mzjc6", viewNodeImageSection = "_1n8mzjc7", viewTitle = "_1n8mzjc8";
|
|
10567
|
+
const FolderNode = /* @__PURE__ */ memo$1(function({
|
|
10568
|
+
data,
|
|
10569
|
+
parentId,
|
|
10570
|
+
id: id2
|
|
10571
|
+
}) {
|
|
10572
|
+
const isTopLevel = e$3(parentId);
|
|
10573
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10574
|
+
/* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
|
|
10575
|
+
/* @__PURE__ */ jsx(
|
|
10576
|
+
Paper,
|
|
10577
|
+
{
|
|
10578
|
+
p: "sm",
|
|
10579
|
+
pt: "xs",
|
|
10580
|
+
radius: "md",
|
|
10581
|
+
withBorder: !0,
|
|
10582
|
+
shadow: isTopLevel ? "lg" : "xs",
|
|
10583
|
+
className: clsx(
|
|
10584
|
+
folderNode,
|
|
10585
|
+
isTopLevel ? toplevelNode : nestedNode,
|
|
10586
|
+
data.dimmed && dimmed
|
|
10587
|
+
),
|
|
10588
|
+
children: /* @__PURE__ */ jsxs(Group, { gap: 8, children: [
|
|
10589
|
+
/* @__PURE__ */ jsx(ThemeIcon, { size: 24, variant: "transparent", color: "dark.4", children: /* @__PURE__ */ jsx(IconFolderFilled, { size: "100%" }) }),
|
|
10590
|
+
/* @__PURE__ */ jsx(Text$1, { size: "lg", fw: 500, children: data.label })
|
|
10591
|
+
] })
|
|
10592
|
+
}
|
|
10593
|
+
),
|
|
10594
|
+
/* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
|
|
10595
|
+
] });
|
|
10596
|
+
}), FileNode = /* @__PURE__ */ memo$1(function({
|
|
10597
|
+
data,
|
|
10598
|
+
parentId,
|
|
10599
|
+
id: id2
|
|
10600
|
+
}) {
|
|
10601
|
+
const isTopLevel = e$3(parentId);
|
|
10602
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10603
|
+
/* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
|
|
10604
|
+
/* @__PURE__ */ jsx(
|
|
10605
|
+
Paper,
|
|
10606
|
+
{
|
|
10607
|
+
p: "sm",
|
|
10608
|
+
pt: "xs",
|
|
10609
|
+
radius: "md",
|
|
10610
|
+
withBorder: !0,
|
|
10611
|
+
shadow: isTopLevel ? "lg" : "xs",
|
|
10612
|
+
className: clsx(
|
|
10613
|
+
fileNode,
|
|
10614
|
+
isTopLevel ? toplevelNode : nestedNode,
|
|
10615
|
+
data.dimmed && dimmed
|
|
10616
|
+
),
|
|
10617
|
+
children: /* @__PURE__ */ jsxs(Group, { gap: 8, children: [
|
|
10618
|
+
/* @__PURE__ */ jsx(ThemeIcon, { size: 24, variant: "transparent", color: "dark.3", children: /* @__PURE__ */ jsx(IconFileFilled, { size: "100%" }) }),
|
|
10619
|
+
/* @__PURE__ */ jsx(Text$1, { size: "lg", fw: 500, children: data.label })
|
|
10620
|
+
] })
|
|
10621
|
+
}
|
|
10622
|
+
),
|
|
10623
|
+
/* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
|
|
10624
|
+
] });
|
|
10625
|
+
}), ViewNode = /* @__PURE__ */ memo$1(function({
|
|
10626
|
+
data,
|
|
10627
|
+
height = 320
|
|
10628
|
+
}) {
|
|
10629
|
+
const imageUrl = usePreviewUrl(data.viewId);
|
|
10630
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10631
|
+
/* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
|
|
10632
|
+
/* @__PURE__ */ jsxs(
|
|
10633
|
+
Card,
|
|
10634
|
+
{
|
|
10635
|
+
className: clsx(
|
|
10636
|
+
viewNode,
|
|
10637
|
+
data.dimmed && dimmed
|
|
10638
|
+
),
|
|
10639
|
+
withBorder: !0,
|
|
10640
|
+
shadow: "xs",
|
|
10641
|
+
padding: 0,
|
|
10642
|
+
children: [
|
|
10643
|
+
/* @__PURE__ */ jsx(CardSection, { className: viewNodeImageSection, children: imageUrl ? /* @__PURE__ */ jsx(
|
|
10644
|
+
Image,
|
|
10645
|
+
{
|
|
10646
|
+
src: imageUrl,
|
|
10647
|
+
fit: "contain",
|
|
10648
|
+
h: height - 60
|
|
10649
|
+
}
|
|
10650
|
+
) : /* @__PURE__ */ jsx(Center, { h: height - 60, children: /* @__PURE__ */ jsxs(Group, { children: [
|
|
10651
|
+
/* @__PURE__ */ jsx(ThemeIcon, { size: 60, variant: "transparent", color: "dark", children: /* @__PURE__ */ jsx(IconLoader, { stroke: 1.5, size: "100%" }) }),
|
|
10652
|
+
/* @__PURE__ */ jsx(Text$1, { size: "xl", fw: 500, c: "dimmed", children: "Preview not available" })
|
|
10653
|
+
] }) }) }),
|
|
10654
|
+
/* @__PURE__ */ jsx(Box, { className: viewTitle, h: 60, p: "sm", pl: "md", children: /* @__PURE__ */ jsx(Text$1, { component: "div", size: "lg", fw: 500, children: data.label }) })
|
|
10655
|
+
]
|
|
10656
|
+
}
|
|
10657
|
+
),
|
|
10658
|
+
/* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
|
|
10659
|
+
] });
|
|
10660
|
+
}), nodeTypes = {
|
|
10661
|
+
folder: FolderNode,
|
|
10662
|
+
file: FileNode,
|
|
10663
|
+
view: ViewNode
|
|
10664
|
+
}, edgeTypes = {
|
|
10665
|
+
link: LinkEdge
|
|
10666
|
+
}, overviewGraphToXYFlowData = (graph) => ({
|
|
10667
|
+
nodes: graph.nodes.map(({ id: id2, parentId, position, width, height, ...node }) => {
|
|
10668
|
+
const parent = parentId ? graph.nodes.find((n2) => n2.id === parentId) : null, rect = {
|
|
10669
|
+
...position,
|
|
10670
|
+
width,
|
|
10671
|
+
height
|
|
10672
|
+
};
|
|
10673
|
+
parent && (position = {
|
|
10674
|
+
x: position.x - parent.position.x,
|
|
10675
|
+
y: position.y - parent.position.y
|
|
10676
|
+
});
|
|
10677
|
+
const xyparent = parent ? { parentId: parent.id } : {};
|
|
10678
|
+
switch (node.type) {
|
|
10679
|
+
case "file":
|
|
10680
|
+
case "folder":
|
|
10681
|
+
return {
|
|
10682
|
+
id: id2,
|
|
10683
|
+
type: node.type,
|
|
10684
|
+
data: {
|
|
10685
|
+
dimmed: !1,
|
|
10686
|
+
label: node.label,
|
|
10687
|
+
path: node.path,
|
|
10688
|
+
rect
|
|
10689
|
+
},
|
|
10690
|
+
deletable: !1,
|
|
10691
|
+
position,
|
|
10692
|
+
width,
|
|
10693
|
+
height,
|
|
10694
|
+
zIndex: 1,
|
|
10695
|
+
...xyparent
|
|
10696
|
+
};
|
|
10697
|
+
case "view":
|
|
10698
|
+
return {
|
|
10699
|
+
id: id2,
|
|
10700
|
+
type: "view",
|
|
10701
|
+
data: {
|
|
10702
|
+
dimmed: !1,
|
|
10703
|
+
label: node.label,
|
|
10704
|
+
viewId: node.viewId,
|
|
10705
|
+
rect
|
|
10706
|
+
},
|
|
10707
|
+
selectable: !1,
|
|
10708
|
+
deletable: !1,
|
|
10709
|
+
position,
|
|
10710
|
+
width,
|
|
10711
|
+
height,
|
|
10712
|
+
zIndex: 3,
|
|
10713
|
+
...xyparent
|
|
10714
|
+
};
|
|
10715
|
+
default:
|
|
10716
|
+
nonexhaustive(node);
|
|
10717
|
+
}
|
|
10718
|
+
}),
|
|
10719
|
+
edges: graph.edges.map((edge) => ({
|
|
10720
|
+
id: edge.id,
|
|
10721
|
+
source: edge.source,
|
|
10722
|
+
target: edge.target,
|
|
10723
|
+
type: "link",
|
|
10724
|
+
zIndex: 2,
|
|
10725
|
+
hidden: !0,
|
|
10726
|
+
data: {
|
|
10727
|
+
points: edge.points
|
|
10728
|
+
}
|
|
10729
|
+
}))
|
|
10238
10730
|
});
|
|
10731
|
+
function OverviewDiagrams({
|
|
10732
|
+
graph,
|
|
10733
|
+
fitViewPadding = 0.1,
|
|
10734
|
+
zoomable = !0,
|
|
10735
|
+
pannable = !0
|
|
10736
|
+
}) {
|
|
10737
|
+
const router = useRouter(), xyflowRef = useRef$1(), { colorScheme } = useMantineColorScheme(), xyflowdata = useMemo$1(() => overviewGraphToXYFlowData(graph), [graph]), [nodes, setNodes, onNodesChange] = useNodesState(xyflowdata.nodes), [edges, setEdges, onEdgeChanges] = useEdgesState(xyflowdata.edges);
|
|
10738
|
+
useUpdateEffect(() => {
|
|
10739
|
+
setNodes(
|
|
10740
|
+
(nodes2) => xyflowdata.nodes.map((n2) => {
|
|
10741
|
+
const current = nodes2.find((node) => node.id === n2.id);
|
|
10742
|
+
return current ? { ...a$2(current, ["selected", "hidden"]), ...n2 } : n2;
|
|
10743
|
+
})
|
|
10744
|
+
), setEdges(xyflowdata.edges);
|
|
10745
|
+
}, [xyflowdata.nodes, xyflowdata.edges]);
|
|
10746
|
+
const focusedNode = nodes.find((node) => node.selected);
|
|
10747
|
+
return useUpdateEffect(() => {
|
|
10748
|
+
const xyflow = xyflowRef.current;
|
|
10749
|
+
xyflow && (focusedNode ? xyflow.fitView({
|
|
10750
|
+
maxZoom: 1,
|
|
10751
|
+
padding: fitViewPadding,
|
|
10752
|
+
nodes: [focusedNode],
|
|
10753
|
+
duration: 450
|
|
10754
|
+
}) : xyflow.fitView({
|
|
10755
|
+
maxZoom: 1,
|
|
10756
|
+
padding: fitViewPadding,
|
|
10757
|
+
duration: 800
|
|
10758
|
+
}));
|
|
10759
|
+
}, [focusedNode?.id ?? null]), /* @__PURE__ */ jsx(
|
|
10760
|
+
index,
|
|
10761
|
+
{
|
|
10762
|
+
colorMode: colorScheme === "auto" ? "system" : colorScheme,
|
|
10763
|
+
className: root,
|
|
10764
|
+
nodeTypes,
|
|
10765
|
+
edgeTypes,
|
|
10766
|
+
nodes,
|
|
10767
|
+
onNodesChange,
|
|
10768
|
+
edges,
|
|
10769
|
+
onEdgesChange: onEdgeChanges,
|
|
10770
|
+
fitView: !0,
|
|
10771
|
+
fitViewOptions: useMemo$1(() => ({
|
|
10772
|
+
minZoom: 0.05,
|
|
10773
|
+
maxZoom: 1,
|
|
10774
|
+
padding: fitViewPadding,
|
|
10775
|
+
includeHiddenNodes: !0
|
|
10776
|
+
}), [fitViewPadding]),
|
|
10777
|
+
nodesDraggable: !1,
|
|
10778
|
+
nodesConnectable: !1,
|
|
10779
|
+
nodesFocusable: !0,
|
|
10780
|
+
edgesReconnectable: !1,
|
|
10781
|
+
edgesFocusable: !1,
|
|
10782
|
+
multiSelectionKeyCode: null,
|
|
10783
|
+
zoomOnPinch: zoomable,
|
|
10784
|
+
zoomOnScroll: !pannable && zoomable,
|
|
10785
|
+
zoomOnDoubleClick: !1,
|
|
10786
|
+
...!zoomable && {
|
|
10787
|
+
zoomActivationKeyCode: null
|
|
10788
|
+
},
|
|
10789
|
+
maxZoom: zoomable ? 2 : 1,
|
|
10790
|
+
minZoom: zoomable ? 0.01 : 1,
|
|
10791
|
+
preventScrolling: zoomable || pannable,
|
|
10792
|
+
noDragClassName: "nodrag",
|
|
10793
|
+
noPanClassName: "nopan",
|
|
10794
|
+
panOnScroll: pannable,
|
|
10795
|
+
panOnDrag: pannable,
|
|
10796
|
+
...!pannable && {
|
|
10797
|
+
selectionKeyCode: null
|
|
10798
|
+
},
|
|
10799
|
+
onInit: (instance) => xyflowRef.current = instance,
|
|
10800
|
+
onNodeClick: (event, node) => {
|
|
10801
|
+
if (node.type === "view") {
|
|
10802
|
+
event.stopPropagation(), setNodes((nodes2) => nodes2.map(({ data, ...n2 }) => ({ ...n2, data: { ...data, dimmed: n2.id !== node.id } }))), xyflowRef.current?.fitView({
|
|
10803
|
+
maxZoom: 10,
|
|
10804
|
+
padding: 0,
|
|
10805
|
+
nodes: [node],
|
|
10806
|
+
duration: 1200
|
|
10807
|
+
}), setTimeout(() => {
|
|
10808
|
+
xyflowRef.current?.updateNodeData(node.id, { dimmed: !0 });
|
|
10809
|
+
}, 400), setTimeout(() => {
|
|
10810
|
+
router.navigate({
|
|
10811
|
+
to: "/view/$viewId/",
|
|
10812
|
+
params: {
|
|
10813
|
+
viewId: node.data.viewId
|
|
10814
|
+
},
|
|
10815
|
+
search: !0
|
|
10816
|
+
});
|
|
10817
|
+
}, 800);
|
|
10818
|
+
return;
|
|
10819
|
+
}
|
|
10820
|
+
node.selected && (event.stopPropagation(), setNodes((nodes2) => nodes2.map((n2) => n2.id === node.id ? { ...n2, selected: !1 } : n2)));
|
|
10821
|
+
},
|
|
10822
|
+
children: /* @__PURE__ */ jsx(Background, { variant: BackgroundVariant.Dots, size: 4, gap: 50 })
|
|
10823
|
+
}
|
|
10824
|
+
);
|
|
10825
|
+
}
|
|
10826
|
+
function OverviewPage() {
|
|
10827
|
+
const graph = useOverviewGraph();
|
|
10828
|
+
return /* @__PURE__ */ jsx(Box, { pos: "fixed", inset: 0, children: /* @__PURE__ */ jsx(OverviewDiagrams, { graph }) });
|
|
10829
|
+
}
|
|
10830
|
+
var previewBg = "_15b5f732";
|
|
10239
10831
|
function IndexPage() {
|
|
10240
10832
|
const views = t$3(useLikeC4Views());
|
|
10241
10833
|
return /* @__PURE__ */ jsx(
|
|
@@ -10249,7 +10841,7 @@ function IndexPage() {
|
|
|
10249
10841
|
}
|
|
10250
10842
|
);
|
|
10251
10843
|
}
|
|
10252
|
-
|
|
10844
|
+
function ViewCard({ viewId }) {
|
|
10253
10845
|
const diagram = useLikeC4View(viewId);
|
|
10254
10846
|
if (!diagram)
|
|
10255
10847
|
return null;
|
|
@@ -10272,7 +10864,7 @@ const ViewCard = memo$1(({ viewId }) => {
|
|
|
10272
10864
|
]
|
|
10273
10865
|
}
|
|
10274
10866
|
);
|
|
10275
|
-
}
|
|
10867
|
+
}
|
|
10276
10868
|
function DiagramPreview(props2) {
|
|
10277
10869
|
const [diagram, setDiagram] = useState$1(null);
|
|
10278
10870
|
return useDebouncedEffect(
|
|
@@ -10295,6 +10887,9 @@ function DiagramPreview(props2) {
|
|
|
10295
10887
|
}
|
|
10296
10888
|
) });
|
|
10297
10889
|
}
|
|
10890
|
+
const Route$9 = createFileRoute("/")({
|
|
10891
|
+
component: withOverviewGraph ? OverviewPage : IndexPage
|
|
10892
|
+
});
|
|
10298
10893
|
var svgContainer = "_1dn84dq1", cssViewOutlet = "_1dn84dq3", cssExportView = "_1dn84dq4", cssWebcomponentView = "_1dn84dq5", cssWebcomponentIframeContainer = "_1dn84dq6";
|
|
10299
10894
|
const Route$8 = createFileRoute("/webcomponent/$")({
|
|
10300
10895
|
component: WebcomponentPage
|
|
@@ -10461,7 +11056,7 @@ function buildDiagramTreeData(views) {
|
|
|
10461
11056
|
label: view.title ?? view.id,
|
|
10462
11057
|
type: "diagram",
|
|
10463
11058
|
children: []
|
|
10464
|
-
}), parent !== root2 && (parent.children.sort(compareTreeNodes), n$
|
|
11059
|
+
}), parent !== root2 && (parent.children.sort(compareTreeNodes), n$1(view.relativePath) && parent.type !== "file" && (parent.type = "file"));
|
|
10465
11060
|
}
|
|
10466
11061
|
return root2.children.sort(compareTreeNodes);
|
|
10467
11062
|
}
|
|
@@ -10473,7 +11068,7 @@ const isFile = (node) => isTreeNodeData(node) && node.type === "file", FolderIco
|
|
|
10473
11068
|
const data = useDiagramsTreeData(), { viewId } = useParams({
|
|
10474
11069
|
from: "/view/$viewId"
|
|
10475
11070
|
}), diagram = useLikeC4View(viewId), initialExpandedState = {};
|
|
10476
|
-
if (diagram && n$
|
|
11071
|
+
if (diagram && n$1(diagram.relativePath)) {
|
|
10477
11072
|
const segments = diagram.relativePath.split("/");
|
|
10478
11073
|
let path = "@fs";
|
|
10479
11074
|
for (const segment of segments)
|
|
@@ -10755,7 +11350,7 @@ function Header({ diagram }) {
|
|
|
10755
11350
|
right: "0.5rem",
|
|
10756
11351
|
p: 4,
|
|
10757
11352
|
radius: "sm",
|
|
10758
|
-
shadow: "
|
|
11353
|
+
shadow: "lg",
|
|
10759
11354
|
children: [
|
|
10760
11355
|
/* @__PURE__ */ jsxs(Group, { gap: isTablet ? 6 : 4, wrap: "nowrap", children: [
|
|
10761
11356
|
isReactDiagramRoute ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -10772,7 +11367,7 @@ function Header({ diagram }) {
|
|
|
10772
11367
|
children: "Back to diagram"
|
|
10773
11368
|
}
|
|
10774
11369
|
),
|
|
10775
|
-
/* @__PURE__ */ jsx(Divider, { orientation: "vertical",
|
|
11370
|
+
/* @__PURE__ */ jsx(Divider, { orientation: "vertical", visibleFrom: "md" }),
|
|
10776
11371
|
/* @__PURE__ */ jsx(ColorSchemeToggle, {}),
|
|
10777
11372
|
/* @__PURE__ */ jsx(Space, {})
|
|
10778
11373
|
] }),
|
|
@@ -10791,7 +11386,7 @@ function Header({ diagram }) {
|
|
|
10791
11386
|
function ExportButton() {
|
|
10792
11387
|
const params = useParams({
|
|
10793
11388
|
from: "/view/$viewId"
|
|
10794
|
-
});
|
|
11389
|
+
}), previewUrl = usePreviewUrl(params.viewId);
|
|
10795
11390
|
return /* @__PURE__ */ jsxs(Menu, { shadow: "md", width: 200, trigger: "click-hover", openDelay: 200, children: [
|
|
10796
11391
|
/* @__PURE__ */ jsx(MenuTarget, { children: /* @__PURE__ */ jsx(
|
|
10797
11392
|
Button,
|
|
@@ -10807,7 +11402,16 @@ function ExportButton() {
|
|
|
10807
11402
|
) }),
|
|
10808
11403
|
/* @__PURE__ */ jsxs(MenuDropdown, { children: [
|
|
10809
11404
|
/* @__PURE__ */ jsx(MenuLabel, { children: "Current view" }),
|
|
10810
|
-
/* @__PURE__ */ jsx(
|
|
11405
|
+
previewUrl ? /* @__PURE__ */ jsx(
|
|
11406
|
+
MenuItem,
|
|
11407
|
+
{
|
|
11408
|
+
component: "a",
|
|
11409
|
+
href: previewUrl,
|
|
11410
|
+
download: `${params.viewId}.png`,
|
|
11411
|
+
target: "_blank",
|
|
11412
|
+
children: "Export as .png"
|
|
11413
|
+
}
|
|
11414
|
+
) : /* @__PURE__ */ jsx(
|
|
10811
11415
|
MenuItem,
|
|
10812
11416
|
{
|
|
10813
11417
|
component: Link,
|
|
@@ -10866,10 +11470,10 @@ function Fallback({ error, resetErrorBoundary }) {
|
|
|
10866
11470
|
] }) });
|
|
10867
11471
|
}
|
|
10868
11472
|
function ViewLayout() {
|
|
10869
|
-
return
|
|
11473
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10870
11474
|
/* @__PURE__ */ jsx(Box, { className: cssViewOutlet, children: /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: Fallback, children: /* @__PURE__ */ jsx(Outlet, {}) }) }),
|
|
10871
11475
|
/* @__PURE__ */ jsx(ViewHeader, {}),
|
|
10872
|
-
/* @__PURE__ */ jsx(SidebarDrawer, {})
|
|
11476
|
+
!withOverviewGraph && /* @__PURE__ */ jsx(SidebarDrawer, {})
|
|
10873
11477
|
] });
|
|
10874
11478
|
}
|
|
10875
11479
|
function ViewHeader() {
|
|
@@ -10974,6 +11578,7 @@ function ExportPage() {
|
|
|
10974
11578
|
enableDynamicViewWalkthrough: !1,
|
|
10975
11579
|
showElementLinks: !1,
|
|
10976
11580
|
showDiagramTitle: !1,
|
|
11581
|
+
showNotations: !1,
|
|
10977
11582
|
nodesSelectable: !1,
|
|
10978
11583
|
nodesDraggable: !1,
|
|
10979
11584
|
enableFocusMode: !1,
|
|
@@ -11023,6 +11628,7 @@ function EmbedPage() {
|
|
|
11023
11628
|
enableDynamicViewWalkthrough: !1,
|
|
11024
11629
|
showElementLinks: !1,
|
|
11025
11630
|
showDiagramTitle: !1,
|
|
11631
|
+
showNotations: !1,
|
|
11026
11632
|
nodesSelectable: !1,
|
|
11027
11633
|
nodesDraggable: !1,
|
|
11028
11634
|
enableFocusMode: !1,
|
|
@@ -11066,7 +11672,12 @@ function ViewReact() {
|
|
|
11066
11672
|
nodesSelectable: !1,
|
|
11067
11673
|
renderIcon: RenderIcon,
|
|
11068
11674
|
onNavigateTo,
|
|
11069
|
-
onBurgerMenuClick:
|
|
11675
|
+
onBurgerMenuClick: withOverviewGraph ? () => {
|
|
11676
|
+
router.navigate({
|
|
11677
|
+
to: "/",
|
|
11678
|
+
search: !0
|
|
11679
|
+
});
|
|
11680
|
+
} : SidebarDrawerOps.open
|
|
11070
11681
|
}
|
|
11071
11682
|
);
|
|
11072
11683
|
}
|
|
@@ -11366,7 +11977,7 @@ function handlePointerMove(event) {
|
|
|
11366
11977
|
x: x2,
|
|
11367
11978
|
y: y2
|
|
11368
11979
|
} = getResizeEventCoordinates(event);
|
|
11369
|
-
if (event.buttons === 0 && (isPointerDown = !1, updateResizeHandlerStates("up", event)), !isPointerDown) {
|
|
11980
|
+
if (isPointerDown && event.buttons === 0 && (isPointerDown = !1, updateResizeHandlerStates("up", event)), !isPointerDown) {
|
|
11370
11981
|
const {
|
|
11371
11982
|
target
|
|
11372
11983
|
} = event;
|
|
@@ -12253,7 +12864,7 @@ function PanelGroupWithForwardedRef({
|
|
|
12253
12864
|
prevLayout,
|
|
12254
12865
|
trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
|
|
12255
12866
|
}), layoutChanged = !compareLayouts(prevLayout, nextLayout);
|
|
12256
|
-
(isPointerEvent(event) || isMouseEvent(event)) && prevDeltaRef.current != delta && (prevDeltaRef.current = delta, layoutChanged
|
|
12867
|
+
(isPointerEvent(event) || isMouseEvent(event)) && prevDeltaRef.current != delta && (prevDeltaRef.current = delta, !layoutChanged && delta !== 0 ? isHorizontal ? reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX) : reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX) : reportConstraintsViolation(dragHandleId, 0)), layoutChanged && (setLayout(nextLayout), eagerValuesRef.current.layout = nextLayout, onLayout2 && onLayout2(nextLayout), callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current));
|
|
12257
12868
|
}, []), resizePanel2 = useCallback((panelData, unsafePanelSize) => {
|
|
12258
12869
|
const {
|
|
12259
12870
|
onLayout: onLayout2
|
|
@@ -12624,9 +13235,7 @@ function ViewEditor() {
|
|
|
12624
13235
|
search: !0
|
|
12625
13236
|
});
|
|
12626
13237
|
});
|
|
12627
|
-
if (
|
|
12628
|
-
console.log("onChange", event);
|
|
12629
|
-
}), !view)
|
|
13238
|
+
if (!view)
|
|
12630
13239
|
throw notFound();
|
|
12631
13240
|
return /* @__PURE__ */ jsx(
|
|
12632
13241
|
LikeC4Diagram,
|
|
@@ -12645,7 +13254,12 @@ function ViewEditor() {
|
|
|
12645
13254
|
enableFocusMode: !1,
|
|
12646
13255
|
onNavigateTo,
|
|
12647
13256
|
renderIcon: RenderIcon,
|
|
12648
|
-
onBurgerMenuClick:
|
|
13257
|
+
onBurgerMenuClick: withOverviewGraph ? () => {
|
|
13258
|
+
router.navigate({
|
|
13259
|
+
to: "/",
|
|
13260
|
+
search: !0
|
|
13261
|
+
});
|
|
13262
|
+
} : SidebarDrawerOps.open
|
|
12649
13263
|
}
|
|
12650
13264
|
);
|
|
12651
13265
|
}
|