@likec4/diagram 1.39.3 → 1.39.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/{chunk-C2OWyQIU.js → chunk-CW_KClZe.js} +750 -753
- package/bundle/custom.js +20 -20
- package/bundle/index.js +620 -607
- package/dist/LikeC4Diagram.js +2 -2
- package/dist/LikeC4Styles.js +0 -10
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -7
- package/dist/bundle/ShadowRoot.js +1 -7
- package/dist/bundle/styles.css.js +6 -5
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useId.d.ts +1 -0
- package/dist/hooks/useId.js +7 -0
- package/dist/likec4diagram/DiagramXYFlow.js +2 -4
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +1 -1
- package/dist/navigationpanel/NavigationPanel.js +2 -3
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -0
- package/dist/state/DiagramActorProvider.js +12 -19
- package/dist/state/diagram-machine.d.ts +111 -91
- package/dist/state/diagram-machine.js +57 -19
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +6 -6
- package/panda.buildinfo.json +5 -5
- package/src/LikeC4Diagram.tsx +2 -2
- package/src/LikeC4Styles.tsx +0 -6
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +0 -6
- package/src/bundle/ShadowRoot.tsx +1 -7
- package/src/bundle/styles.css.ts +5 -6
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useId.ts +5 -0
- package/src/likec4diagram/DiagramXYFlow.tsx +2 -4
- package/src/likec4diagram/relationship-popover/RelationshipPopover.tsx +1 -1
- package/src/navigationpanel/NavigationPanel.tsx +2 -3
- package/src/navigationpanel/NavigationPanelDropdown.tsx +9 -0
- package/src/state/DiagramActorProvider.tsx +12 -24
- package/src/state/diagram-machine.ts +69 -28
- package/dist/globals.css.js +0 -3
- package/src/globals.css +0 -124
|
@@ -321,23 +321,23 @@ function sva(config) {
|
|
|
321
321
|
}
|
|
322
322
|
var __assign = function() {
|
|
323
323
|
return __assign = Object.assign || function(t2) {
|
|
324
|
-
for (var
|
|
325
|
-
|
|
326
|
-
for (var p in
|
|
324
|
+
for (var s, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
|
|
325
|
+
s = arguments[i2];
|
|
326
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t2[p] = s[p]);
|
|
327
327
|
}
|
|
328
328
|
return t2;
|
|
329
329
|
}, __assign.apply(this, arguments);
|
|
330
330
|
};
|
|
331
|
-
function __rest(
|
|
331
|
+
function __rest(s, e2) {
|
|
332
332
|
var t2 = {};
|
|
333
|
-
for (var p in
|
|
334
|
-
if (
|
|
335
|
-
for (var i2 = 0, p = Object.getOwnPropertySymbols(
|
|
336
|
-
e2.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(
|
|
333
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e2.indexOf(p) < 0 && (t2[p] = s[p]);
|
|
334
|
+
if (s != null && typeof Object.getOwnPropertySymbols == "function")
|
|
335
|
+
for (var i2 = 0, p = Object.getOwnPropertySymbols(s); i2 < p.length; i2++)
|
|
336
|
+
e2.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i2]) && (t2[p[i2]] = s[p[i2]]);
|
|
337
337
|
return t2;
|
|
338
338
|
}
|
|
339
339
|
function __spreadArray(to, from, pack) {
|
|
340
|
-
if (pack || arguments.length === 2) for (var i2 = 0,
|
|
340
|
+
if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar; i2 < l; i2++)
|
|
341
341
|
(ar || !(i2 in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i2)), ar[i2] = from[i2]);
|
|
342
342
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
343
343
|
}
|
|
@@ -687,8 +687,8 @@ var nonPassive = passiveSupported ? { passive: !1 } : !1, alwaysContainsScroll =
|
|
|
687
687
|
return [event.deltaX, event.deltaY];
|
|
688
688
|
}, extractRef = function(ref) {
|
|
689
689
|
return ref && "current" in ref ? ref.current : ref;
|
|
690
|
-
}, deltaCompare = function(x,
|
|
691
|
-
return x[0] ===
|
|
690
|
+
}, deltaCompare = function(x, y) {
|
|
691
|
+
return x[0] === y[0] && x[1] === y[1];
|
|
692
692
|
}, generateStyle = function(id2) {
|
|
693
693
|
return `
|
|
694
694
|
.block-interactivity-`.concat(id2, ` {pointer-events: none;}
|
|
@@ -1227,7 +1227,7 @@ function useMove(onChange, handlers, dir = "ltr") {
|
|
|
1227
1227
|
(node) => {
|
|
1228
1228
|
if (cleanupRef.current && (cleanupRef.current(), cleanupRef.current = null), !node)
|
|
1229
1229
|
return;
|
|
1230
|
-
const onScrub = ({ x, y
|
|
1230
|
+
const onScrub = ({ x, y }) => {
|
|
1231
1231
|
cancelAnimationFrame(frame2.current), frame2.current = requestAnimationFrame(() => {
|
|
1232
1232
|
if (mounted.current && node) {
|
|
1233
1233
|
node.style.userSelect = "none";
|
|
@@ -1236,7 +1236,7 @@ function useMove(onChange, handlers, dir = "ltr") {
|
|
|
1236
1236
|
const _x = clamp$3((x - rect.left) / rect.width, 0, 1);
|
|
1237
1237
|
onChange({
|
|
1238
1238
|
x: dir === "ltr" ? _x : 1 - _x,
|
|
1239
|
-
y: clamp$3((
|
|
1239
|
+
y: clamp$3((y - rect.top) / rect.height, 0, 1)
|
|
1240
1240
|
});
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
@@ -1365,17 +1365,17 @@ function getRefProp(element) {
|
|
|
1365
1365
|
function createVarsResolver(resolver) {
|
|
1366
1366
|
return resolver;
|
|
1367
1367
|
}
|
|
1368
|
-
function r$
|
|
1369
|
-
var t2,
|
|
1368
|
+
function r$2(e2) {
|
|
1369
|
+
var t2, f, n2 = "";
|
|
1370
1370
|
if (typeof e2 == "string" || typeof e2 == "number") n2 += e2;
|
|
1371
1371
|
else if (typeof e2 == "object") if (Array.isArray(e2)) {
|
|
1372
|
-
var
|
|
1373
|
-
for (t2 = 0; t2 <
|
|
1374
|
-
} else for (
|
|
1372
|
+
var o = e2.length;
|
|
1373
|
+
for (t2 = 0; t2 < o; t2++) e2[t2] && (f = r$2(e2[t2])) && (n2 && (n2 += " "), n2 += f);
|
|
1374
|
+
} else for (f in e2) e2[f] && (n2 && (n2 += " "), n2 += f);
|
|
1375
1375
|
return n2;
|
|
1376
1376
|
}
|
|
1377
1377
|
function clsx() {
|
|
1378
|
-
for (var e2, t2,
|
|
1378
|
+
for (var e2, t2, f = 0, n2 = "", o = arguments.length; f < o; f++) (e2 = arguments[f]) && (t2 = r$2(e2)) && (n2 && (n2 += " "), n2 += t2);
|
|
1379
1379
|
return n2;
|
|
1380
1380
|
}
|
|
1381
1381
|
const EMPTY_CLASS_NAMES = {};
|
|
@@ -1473,7 +1473,7 @@ function hslStringToRgba(hslaString) {
|
|
|
1473
1473
|
b: 0,
|
|
1474
1474
|
a: 1
|
|
1475
1475
|
};
|
|
1476
|
-
const h = parseInt(matches2[1], 10),
|
|
1476
|
+
const h = parseInt(matches2[1], 10), s = parseInt(matches2[2], 10) / 100, l = parseInt(matches2[3], 10) / 100, a = matches2[5] ? parseFloat(matches2[5]) : void 0, chroma = (1 - Math.abs(2 * l - 1)) * s, huePrime = h / 60, x = chroma * (1 - Math.abs(huePrime % 2 - 1)), m2 = l - chroma / 2;
|
|
1477
1477
|
let r2, g, b;
|
|
1478
1478
|
return huePrime >= 0 && huePrime < 1 ? (r2 = chroma, g = x, b = 0) : huePrime >= 1 && huePrime < 2 ? (r2 = x, g = chroma, b = 0) : huePrime >= 2 && huePrime < 3 ? (r2 = 0, g = chroma, b = x) : huePrime >= 3 && huePrime < 4 ? (r2 = 0, g = x, b = chroma) : huePrime >= 4 && huePrime < 5 ? (r2 = x, g = 0, b = chroma) : (r2 = chroma, g = 0, b = x), {
|
|
1479
1479
|
r: Math.round((r2 + m2) * 255),
|
|
@@ -1493,7 +1493,7 @@ function toRgba(color2) {
|
|
|
1493
1493
|
function darken(color2, alpha2) {
|
|
1494
1494
|
if (color2.startsWith("var("))
|
|
1495
1495
|
return `color-mix(in srgb, ${color2}, black ${alpha2 * 100}%)`;
|
|
1496
|
-
const { r: r2, g, b, a } = toRgba(color2),
|
|
1496
|
+
const { r: r2, g, b, a } = toRgba(color2), f = 1 - alpha2, dark = (input) => Math.round(input * f);
|
|
1497
1497
|
return `rgba(${dark(r2)}, ${dark(g)}, ${dark(b)}, ${a})`;
|
|
1498
1498
|
}
|
|
1499
1499
|
function getPrimaryShade(theme, colorScheme) {
|
|
@@ -3061,19 +3061,19 @@ function getPaddingObject(padding) {
|
|
|
3061
3061
|
function rectToClientRect(rect) {
|
|
3062
3062
|
const {
|
|
3063
3063
|
x,
|
|
3064
|
-
y
|
|
3064
|
+
y,
|
|
3065
3065
|
width,
|
|
3066
3066
|
height
|
|
3067
3067
|
} = rect;
|
|
3068
3068
|
return {
|
|
3069
3069
|
width,
|
|
3070
3070
|
height,
|
|
3071
|
-
top:
|
|
3071
|
+
top: y,
|
|
3072
3072
|
left: x,
|
|
3073
3073
|
right: x + width,
|
|
3074
|
-
bottom:
|
|
3074
|
+
bottom: y + height,
|
|
3075
3075
|
x,
|
|
3076
|
-
y
|
|
3076
|
+
y
|
|
3077
3077
|
};
|
|
3078
3078
|
}
|
|
3079
3079
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
@@ -3137,7 +3137,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3137
3137
|
strategy
|
|
3138
3138
|
}), {
|
|
3139
3139
|
x,
|
|
3140
|
-
y
|
|
3140
|
+
y
|
|
3141
3141
|
} = computeCoordsFromPlacement(rects, placement, rtl), statefulPlacement = placement, middlewareData = {}, resetCount = 0;
|
|
3142
3142
|
for (let i2 = 0; i2 < validMiddleware.length; i2++) {
|
|
3143
3143
|
const {
|
|
@@ -3150,7 +3150,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3150
3150
|
reset
|
|
3151
3151
|
} = await fn({
|
|
3152
3152
|
x,
|
|
3153
|
-
y
|
|
3153
|
+
y,
|
|
3154
3154
|
initialPlacement: placement,
|
|
3155
3155
|
placement: statefulPlacement,
|
|
3156
3156
|
strategy,
|
|
@@ -3162,7 +3162,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3162
3162
|
floating
|
|
3163
3163
|
}
|
|
3164
3164
|
});
|
|
3165
|
-
x = nextX ?? x,
|
|
3165
|
+
x = nextX ?? x, y = nextY ?? y, middlewareData = {
|
|
3166
3166
|
...middlewareData,
|
|
3167
3167
|
[name]: {
|
|
3168
3168
|
...middlewareData[name],
|
|
@@ -3174,12 +3174,12 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3174
3174
|
strategy
|
|
3175
3175
|
}) : reset.rects), {
|
|
3176
3176
|
x,
|
|
3177
|
-
y
|
|
3177
|
+
y
|
|
3178
3178
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl)), i2 = -1);
|
|
3179
3179
|
}
|
|
3180
3180
|
return {
|
|
3181
3181
|
x,
|
|
3182
|
-
y
|
|
3182
|
+
y,
|
|
3183
3183
|
placement: statefulPlacement,
|
|
3184
3184
|
strategy,
|
|
3185
3185
|
middlewareData
|
|
@@ -3190,7 +3190,7 @@ async function detectOverflow(state, options) {
|
|
|
3190
3190
|
options === void 0 && (options = {});
|
|
3191
3191
|
const {
|
|
3192
3192
|
x,
|
|
3193
|
-
y
|
|
3193
|
+
y,
|
|
3194
3194
|
platform: platform2,
|
|
3195
3195
|
rects,
|
|
3196
3196
|
elements,
|
|
@@ -3208,7 +3208,7 @@ async function detectOverflow(state, options) {
|
|
|
3208
3208
|
strategy
|
|
3209
3209
|
})), rect = elementContext === "floating" ? {
|
|
3210
3210
|
x,
|
|
3211
|
-
y
|
|
3211
|
+
y,
|
|
3212
3212
|
width: rects.floating.width,
|
|
3213
3213
|
height: rects.floating.height
|
|
3214
3214
|
} : rects.reference, offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating)), offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
@@ -3236,7 +3236,7 @@ const arrow$3 = (options) => ({
|
|
|
3236
3236
|
async fn(state) {
|
|
3237
3237
|
const {
|
|
3238
3238
|
x,
|
|
3239
|
-
y
|
|
3239
|
+
y,
|
|
3240
3240
|
placement,
|
|
3241
3241
|
rects,
|
|
3242
3242
|
platform: platform2,
|
|
@@ -3250,7 +3250,7 @@ const arrow$3 = (options) => ({
|
|
|
3250
3250
|
return {};
|
|
3251
3251
|
const paddingObject = getPaddingObject(padding), coords = {
|
|
3252
3252
|
x,
|
|
3253
|
-
y
|
|
3253
|
+
y
|
|
3254
3254
|
}, axis = getAlignmentAxis(placement), length = getAxisLength(axis), arrowDimensions = await platform2.getDimensions(element), isYAxis = axis === "y", minProp = isYAxis ? "top" : "left", maxProp = isYAxis ? "bottom" : "right", clientProp = isYAxis ? "clientHeight" : "clientWidth", endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length], startDiff = coords[axis] - rects.reference[axis], arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
|
|
3255
3255
|
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
3256
3256
|
(!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) && (clientSize = elements.floating[clientProp] || rects.floating[length]);
|
|
@@ -3313,20 +3313,20 @@ const autoPlacement$1 = function(options) {
|
|
|
3313
3313
|
placement: nextPlacement
|
|
3314
3314
|
}
|
|
3315
3315
|
};
|
|
3316
|
-
const placementsSortedByMostSpace = allOverflows.map((
|
|
3317
|
-
const alignment2 = getAlignment(
|
|
3318
|
-
return [
|
|
3316
|
+
const placementsSortedByMostSpace = allOverflows.map((d) => {
|
|
3317
|
+
const alignment2 = getAlignment(d.placement);
|
|
3318
|
+
return [d.placement, alignment2 && crossAxis ? (
|
|
3319
3319
|
// Check along the mainAxis and main crossAxis side.
|
|
3320
|
-
|
|
3320
|
+
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0)
|
|
3321
3321
|
) : (
|
|
3322
3322
|
// Check only the mainAxis.
|
|
3323
|
-
|
|
3324
|
-
),
|
|
3325
|
-
}).sort((a, b) => a[1] - b[1]), resetPlacement = ((_placementsThatFitOnE = placementsSortedByMostSpace.filter((
|
|
3323
|
+
d.overflows[0]
|
|
3324
|
+
), d.overflows];
|
|
3325
|
+
}).sort((a, b) => a[1] - b[1]), resetPlacement = ((_placementsThatFitOnE = placementsSortedByMostSpace.filter((d) => d[2].slice(
|
|
3326
3326
|
0,
|
|
3327
3327
|
// Aligned placements should not check their opposite crossAxis
|
|
3328
3328
|
// side.
|
|
3329
|
-
getAlignment(
|
|
3329
|
+
getAlignment(d[0]) ? 2 : 3
|
|
3330
3330
|
).every((v) => v <= 0))[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
3331
3331
|
return resetPlacement !== placement ? {
|
|
3332
3332
|
data: {
|
|
@@ -3379,7 +3379,7 @@ const autoPlacement$1 = function(options) {
|
|
|
3379
3379
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement = placements2[nextIndex];
|
|
3380
3380
|
if (nextPlacement && (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : !1) || // We leave the current main axis only if every placement on that axis
|
|
3381
3381
|
// overflows the main axis.
|
|
3382
|
-
overflowsData.every((
|
|
3382
|
+
overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : !0)))
|
|
3383
3383
|
return {
|
|
3384
3384
|
data: {
|
|
3385
3385
|
index: nextIndex,
|
|
@@ -3389,20 +3389,20 @@ const autoPlacement$1 = function(options) {
|
|
|
3389
3389
|
placement: nextPlacement
|
|
3390
3390
|
}
|
|
3391
3391
|
};
|
|
3392
|
-
let resetPlacement = (_overflowsData$filter = overflowsData.filter((
|
|
3392
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
3393
3393
|
if (!resetPlacement)
|
|
3394
3394
|
switch (fallbackStrategy) {
|
|
3395
3395
|
case "bestFit": {
|
|
3396
3396
|
var _overflowsData$filter2;
|
|
3397
|
-
const placement2 = (_overflowsData$filter2 = overflowsData.filter((
|
|
3397
|
+
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
|
|
3398
3398
|
if (hasFallbackAxisSideDirection) {
|
|
3399
|
-
const currentSideAxis = getSideAxis(
|
|
3399
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
3400
3400
|
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
3401
3401
|
// reading directions favoring greater width.
|
|
3402
3402
|
currentSideAxis === "y";
|
|
3403
3403
|
}
|
|
3404
3404
|
return !0;
|
|
3405
|
-
}).map((
|
|
3405
|
+
}).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
3406
3406
|
placement2 && (resetPlacement = placement2);
|
|
3407
3407
|
break;
|
|
3408
3408
|
}
|
|
@@ -3506,11 +3506,11 @@ const inline$2 = function(options) {
|
|
|
3506
3506
|
} = state, {
|
|
3507
3507
|
padding = 2,
|
|
3508
3508
|
x,
|
|
3509
|
-
y
|
|
3509
|
+
y
|
|
3510
3510
|
} = evaluate(options, state), nativeClientRects = Array.from(await (platform2.getClientRects == null ? void 0 : platform2.getClientRects(elements.reference)) || []), clientRects = getRectsByLine(nativeClientRects), fallback = rectToClientRect(getBoundingRect(nativeClientRects)), paddingObject = getPaddingObject(padding);
|
|
3511
3511
|
function getBoundingClientRect2() {
|
|
3512
|
-
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null &&
|
|
3513
|
-
return clientRects.find((rect) => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right &&
|
|
3512
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null)
|
|
3513
|
+
return clientRects.find((rect) => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
3514
3514
|
if (clientRects.length >= 2) {
|
|
3515
3515
|
if (getSideAxis(placement) === "y") {
|
|
3516
3516
|
const firstRect = clientRects[0], lastRect = clientRects[clientRects.length - 1], isTop = getSide(placement) === "top", top2 = firstRect.top, bottom2 = lastRect.bottom, left2 = isTop ? firstRect.left : lastRect.left, right2 = isTop ? firstRect.right : lastRect.right, width2 = right2 - left2, height2 = bottom2 - top2;
|
|
@@ -3589,13 +3589,13 @@ const offset$3 = function(options) {
|
|
|
3589
3589
|
var _middlewareData$offse, _middlewareData$arrow;
|
|
3590
3590
|
const {
|
|
3591
3591
|
x,
|
|
3592
|
-
y
|
|
3592
|
+
y,
|
|
3593
3593
|
placement,
|
|
3594
3594
|
middlewareData
|
|
3595
3595
|
} = state, diffCoords = await convertValueToCoords(state, options);
|
|
3596
3596
|
return placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset ? {} : {
|
|
3597
3597
|
x: x + diffCoords.x,
|
|
3598
|
-
y:
|
|
3598
|
+
y: y + diffCoords.y,
|
|
3599
3599
|
data: {
|
|
3600
3600
|
...diffCoords,
|
|
3601
3601
|
placement
|
|
@@ -3610,7 +3610,7 @@ const offset$3 = function(options) {
|
|
|
3610
3610
|
async fn(state) {
|
|
3611
3611
|
const {
|
|
3612
3612
|
x,
|
|
3613
|
-
y
|
|
3613
|
+
y,
|
|
3614
3614
|
placement
|
|
3615
3615
|
} = state, {
|
|
3616
3616
|
mainAxis: checkMainAxis = !0,
|
|
@@ -3619,18 +3619,18 @@ const offset$3 = function(options) {
|
|
|
3619
3619
|
fn: (_ref) => {
|
|
3620
3620
|
let {
|
|
3621
3621
|
x: x2,
|
|
3622
|
-
y:
|
|
3622
|
+
y: y2
|
|
3623
3623
|
} = _ref;
|
|
3624
3624
|
return {
|
|
3625
3625
|
x: x2,
|
|
3626
|
-
y:
|
|
3626
|
+
y: y2
|
|
3627
3627
|
};
|
|
3628
3628
|
}
|
|
3629
3629
|
},
|
|
3630
3630
|
...detectOverflowOptions
|
|
3631
3631
|
} = evaluate(options, state), coords = {
|
|
3632
3632
|
x,
|
|
3633
|
-
y
|
|
3633
|
+
y
|
|
3634
3634
|
}, overflow = await detectOverflow(state, detectOverflowOptions), crossAxis = getSideAxis(getSide(placement)), mainAxis = getOppositeAxis(crossAxis);
|
|
3635
3635
|
let mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis];
|
|
3636
3636
|
if (checkMainAxis) {
|
|
@@ -3650,7 +3650,7 @@ const offset$3 = function(options) {
|
|
|
3650
3650
|
...limitedCoords,
|
|
3651
3651
|
data: {
|
|
3652
3652
|
x: limitedCoords.x - x,
|
|
3653
|
-
y: limitedCoords.y -
|
|
3653
|
+
y: limitedCoords.y - y,
|
|
3654
3654
|
enabled: {
|
|
3655
3655
|
[mainAxis]: checkMainAxis,
|
|
3656
3656
|
[crossAxis]: checkCrossAxis
|
|
@@ -3665,7 +3665,7 @@ const offset$3 = function(options) {
|
|
|
3665
3665
|
fn(state) {
|
|
3666
3666
|
const {
|
|
3667
3667
|
x,
|
|
3668
|
-
y
|
|
3668
|
+
y,
|
|
3669
3669
|
placement,
|
|
3670
3670
|
rects,
|
|
3671
3671
|
middlewareData
|
|
@@ -3675,7 +3675,7 @@ const offset$3 = function(options) {
|
|
|
3675
3675
|
crossAxis: checkCrossAxis = !0
|
|
3676
3676
|
} = evaluate(options, state), coords = {
|
|
3677
3677
|
x,
|
|
3678
|
-
y
|
|
3678
|
+
y
|
|
3679
3679
|
}, crossAxis = getSideAxis(placement), mainAxis = getOppositeAxis(crossAxis);
|
|
3680
3680
|
let mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis];
|
|
3681
3681
|
const rawOffset = evaluate(offset2, state), computedOffset = typeof rawOffset == "number" ? {
|
|
@@ -3764,10 +3764,10 @@ function getScale(element) {
|
|
|
3764
3764
|
height,
|
|
3765
3765
|
$
|
|
3766
3766
|
} = getCssDimensions(domElement);
|
|
3767
|
-
let x = ($ ? round(rect.width) : rect.width) / width,
|
|
3768
|
-
return (!x || !Number.isFinite(x)) && (x = 1), (!
|
|
3767
|
+
let x = ($ ? round(rect.width) : rect.width) / width, y = ($ ? round(rect.height) : rect.height) / height;
|
|
3768
|
+
return (!x || !Number.isFinite(x)) && (x = 1), (!y || !Number.isFinite(y)) && (y = 1), {
|
|
3769
3769
|
x,
|
|
3770
|
-
y
|
|
3770
|
+
y
|
|
3771
3771
|
};
|
|
3772
3772
|
}
|
|
3773
3773
|
const noOffsets = /* @__PURE__ */ createCoords(0);
|
|
@@ -3787,20 +3787,20 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3787
3787
|
let scale2 = createCoords(1);
|
|
3788
3788
|
includeScale && (offsetParent ? isElement(offsetParent) && (scale2 = getScale(offsetParent)) : scale2 = getScale(element));
|
|
3789
3789
|
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
3790
|
-
let x = (clientRect.left + visualOffsets.x) / scale2.x,
|
|
3790
|
+
let x = (clientRect.left + visualOffsets.x) / scale2.x, y = (clientRect.top + visualOffsets.y) / scale2.y, width = clientRect.width / scale2.x, height = clientRect.height / scale2.y;
|
|
3791
3791
|
if (domElement) {
|
|
3792
3792
|
const win2 = getWindow(domElement), offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
3793
3793
|
let currentWin = win2, currentIFrame = getFrameElement(currentWin);
|
|
3794
3794
|
for (; currentIFrame && offsetParent && offsetWin !== currentWin; ) {
|
|
3795
3795
|
const iframeScale = getScale(currentIFrame), iframeRect = currentIFrame.getBoundingClientRect(), css2 = getComputedStyle$1(currentIFrame), left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x, top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y;
|
|
3796
|
-
x *= iframeScale.x,
|
|
3796
|
+
x *= iframeScale.x, y *= iframeScale.y, width *= iframeScale.x, height *= iframeScale.y, x += left, y += top, currentWin = getWindow(currentIFrame), currentIFrame = getFrameElement(currentWin);
|
|
3797
3797
|
}
|
|
3798
3798
|
}
|
|
3799
3799
|
return rectToClientRect({
|
|
3800
3800
|
width,
|
|
3801
3801
|
height,
|
|
3802
3802
|
x,
|
|
3803
|
-
y
|
|
3803
|
+
y
|
|
3804
3804
|
});
|
|
3805
3805
|
}
|
|
3806
3806
|
function getWindowScrollBarX(element, rect) {
|
|
@@ -3808,10 +3808,10 @@ function getWindowScrollBarX(element, rect) {
|
|
|
3808
3808
|
return rect ? rect.left + leftScroll : getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
3809
3809
|
}
|
|
3810
3810
|
function getHTMLOffset(documentElement, scroll) {
|
|
3811
|
-
const htmlRect = documentElement.getBoundingClientRect(), x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect),
|
|
3811
|
+
const htmlRect = documentElement.getBoundingClientRect(), x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect), y = htmlRect.top + scroll.scrollTop;
|
|
3812
3812
|
return {
|
|
3813
3813
|
x,
|
|
3814
|
-
y
|
|
3814
|
+
y
|
|
3815
3815
|
};
|
|
3816
3816
|
}
|
|
3817
3817
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
@@ -3847,22 +3847,22 @@ function getClientRects(element) {
|
|
|
3847
3847
|
function getDocumentRect(element) {
|
|
3848
3848
|
const html = getDocumentElement(element), scroll = getNodeScroll(element), body2 = element.ownerDocument.body, width = max$1(html.scrollWidth, html.clientWidth, body2.scrollWidth, body2.clientWidth), height = max$1(html.scrollHeight, html.clientHeight, body2.scrollHeight, body2.clientHeight);
|
|
3849
3849
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
3850
|
-
const
|
|
3850
|
+
const y = -scroll.scrollTop;
|
|
3851
3851
|
return getComputedStyle$1(body2).direction === "rtl" && (x += max$1(html.clientWidth, body2.clientWidth) - width), {
|
|
3852
3852
|
width,
|
|
3853
3853
|
height,
|
|
3854
3854
|
x,
|
|
3855
|
-
y
|
|
3855
|
+
y
|
|
3856
3856
|
};
|
|
3857
3857
|
}
|
|
3858
3858
|
const SCROLLBAR_MAX = 25;
|
|
3859
3859
|
function getViewportRect(element, strategy) {
|
|
3860
3860
|
const win2 = getWindow(element), html = getDocumentElement(element), visualViewport = win2.visualViewport;
|
|
3861
|
-
let width = html.clientWidth, height = html.clientHeight, x = 0,
|
|
3861
|
+
let width = html.clientWidth, height = html.clientHeight, x = 0, y = 0;
|
|
3862
3862
|
if (visualViewport) {
|
|
3863
3863
|
width = visualViewport.width, height = visualViewport.height;
|
|
3864
3864
|
const visualViewportBased = isWebKit();
|
|
3865
|
-
(!visualViewportBased || visualViewportBased && strategy === "fixed") && (x = visualViewport.offsetLeft,
|
|
3865
|
+
(!visualViewportBased || visualViewportBased && strategy === "fixed") && (x = visualViewport.offsetLeft, y = visualViewport.offsetTop);
|
|
3866
3866
|
}
|
|
3867
3867
|
const windowScrollbarX = getWindowScrollBarX(html);
|
|
3868
3868
|
if (windowScrollbarX <= 0) {
|
|
@@ -3873,17 +3873,17 @@ function getViewportRect(element, strategy) {
|
|
|
3873
3873
|
width,
|
|
3874
3874
|
height,
|
|
3875
3875
|
x,
|
|
3876
|
-
y
|
|
3876
|
+
y
|
|
3877
3877
|
};
|
|
3878
3878
|
}
|
|
3879
3879
|
const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
3880
3880
|
function getInnerBoundingClientRect(element, strategy) {
|
|
3881
|
-
const clientRect = getBoundingClientRect(element, !0, strategy === "fixed"), top = clientRect.top + element.clientTop, left = clientRect.left + element.clientLeft, scale2 = isHTMLElement(element) ? getScale(element) : createCoords(1), width = element.clientWidth * scale2.x, height = element.clientHeight * scale2.y, x = left * scale2.x,
|
|
3881
|
+
const clientRect = getBoundingClientRect(element, !0, strategy === "fixed"), top = clientRect.top + element.clientTop, left = clientRect.left + element.clientLeft, scale2 = isHTMLElement(element) ? getScale(element) : createCoords(1), width = element.clientWidth * scale2.x, height = element.clientHeight * scale2.y, x = left * scale2.x, y = top * scale2.y;
|
|
3882
3882
|
return {
|
|
3883
3883
|
width,
|
|
3884
3884
|
height,
|
|
3885
3885
|
x,
|
|
3886
|
-
y
|
|
3886
|
+
y
|
|
3887
3887
|
};
|
|
3888
3888
|
}
|
|
3889
3889
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
@@ -3966,10 +3966,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3966
3966
|
offsets.x = offsetRect.x + offsetParent.clientLeft, offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
3967
3967
|
} else documentElement && setLeftRTLScrollbarOffset();
|
|
3968
3968
|
isFixed && !isOffsetParentAnElement && documentElement && setLeftRTLScrollbarOffset();
|
|
3969
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0), x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
|
|
3969
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0), x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x, y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
3970
3970
|
return {
|
|
3971
3971
|
x,
|
|
3972
|
-
y
|
|
3972
|
+
y,
|
|
3973
3973
|
width: rect.width,
|
|
3974
3974
|
height: rect.height
|
|
3975
3975
|
};
|
|
@@ -4253,17 +4253,17 @@ function useFloating$1(options) {
|
|
|
4253
4253
|
};
|
|
4254
4254
|
if (!elements.floating)
|
|
4255
4255
|
return initialStyles;
|
|
4256
|
-
const x = roundByDPR(elements.floating, data.x),
|
|
4256
|
+
const x = roundByDPR(elements.floating, data.x), y = roundByDPR(elements.floating, data.y);
|
|
4257
4257
|
return transform2 ? {
|
|
4258
4258
|
...initialStyles,
|
|
4259
|
-
transform: "translate(" + x + "px, " +
|
|
4259
|
+
transform: "translate(" + x + "px, " + y + "px)",
|
|
4260
4260
|
...getDPR(elements.floating) >= 1.5 && {
|
|
4261
4261
|
willChange: "transform"
|
|
4262
4262
|
}
|
|
4263
4263
|
} : {
|
|
4264
4264
|
position: strategy,
|
|
4265
4265
|
left: x,
|
|
4266
|
-
top:
|
|
4266
|
+
top: y
|
|
4267
4267
|
};
|
|
4268
4268
|
}, [strategy, transform2, elements.floating, data.x, data.y]);
|
|
4269
4269
|
return React.useMemo(() => ({
|
|
@@ -4369,7 +4369,7 @@ function createPubSub() {
|
|
|
4369
4369
|
},
|
|
4370
4370
|
off(event, listener) {
|
|
4371
4371
|
var _map$get2;
|
|
4372
|
-
map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter((
|
|
4372
|
+
map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter((l) => l !== listener)) || []);
|
|
4373
4373
|
}
|
|
4374
4374
|
};
|
|
4375
4375
|
}
|
|
@@ -7444,7 +7444,7 @@ function useFloatingTooltip({
|
|
|
7444
7444
|
position,
|
|
7445
7445
|
defaultOpened
|
|
7446
7446
|
}) {
|
|
7447
|
-
const [opened, setOpened] = useState(defaultOpened), boundaryRef = useRef(null), { x, y
|
|
7447
|
+
const [opened, setOpened] = useState(defaultOpened), boundaryRef = useRef(null), { x, y, elements, refs, update, placement } = useFloating({
|
|
7448
7448
|
placement: position,
|
|
7449
7449
|
middleware: [
|
|
7450
7450
|
shift({
|
|
@@ -7485,7 +7485,7 @@ function useFloatingTooltip({
|
|
|
7485
7485
|
});
|
|
7486
7486
|
};
|
|
7487
7487
|
}
|
|
7488
|
-
}, [elements.reference, refs.floating.current, update, handleMouseMove, opened]), { handleMouseMove, x, y
|
|
7488
|
+
}, [elements.reference, refs.floating.current, update, handleMouseMove, opened]), { handleMouseMove, x, y, opened, setOpened, boundaryRef, floating: refs.setFloating };
|
|
7489
7489
|
}
|
|
7490
7490
|
var classes$3 = { tooltip: "m_1b3c8819", arrow: "m_f898399f" };
|
|
7491
7491
|
const defaultProps$5 = {
|
|
@@ -7537,7 +7537,7 @@ const defaultProps$5 = {
|
|
|
7537
7537
|
rootSelector: "tooltip",
|
|
7538
7538
|
vars,
|
|
7539
7539
|
varsResolver: varsResolver$4
|
|
7540
|
-
}), { handleMouseMove, x, y
|
|
7540
|
+
}), { handleMouseMove, x, y, opened, boundaryRef, floating, setOpened } = useFloatingTooltip({
|
|
7541
7541
|
offset: offset2,
|
|
7542
7542
|
position,
|
|
7543
7543
|
defaultOpened
|
|
@@ -7561,7 +7561,7 @@ const defaultProps$5 = {
|
|
|
7561
7561
|
...getStyleObject(style2, theme),
|
|
7562
7562
|
zIndex,
|
|
7563
7563
|
display: !disabled && opened ? "block" : "none",
|
|
7564
|
-
top: (
|
|
7564
|
+
top: (y && Math.round(y)) ?? "",
|
|
7565
7565
|
left: (x && Math.round(x)) ?? ""
|
|
7566
7566
|
}
|
|
7567
7567
|
}),
|
|
@@ -7617,7 +7617,7 @@ function useTooltip(settings) {
|
|
|
7617
7617
|
[uid]
|
|
7618
7618
|
), {
|
|
7619
7619
|
x,
|
|
7620
|
-
y
|
|
7620
|
+
y,
|
|
7621
7621
|
context: context2,
|
|
7622
7622
|
refs,
|
|
7623
7623
|
placement,
|
|
@@ -7646,7 +7646,7 @@ function useTooltip(settings) {
|
|
|
7646
7646
|
const isGroupPhase = opened && currentId && currentId !== uid;
|
|
7647
7647
|
return {
|
|
7648
7648
|
x,
|
|
7649
|
-
y
|
|
7649
|
+
y,
|
|
7650
7650
|
arrowX,
|
|
7651
7651
|
arrowY,
|
|
7652
7652
|
reference: refs.setReference,
|
|
@@ -8215,7 +8215,7 @@ const defaultProps$1 = {
|
|
|
8215
8215
|
max: 100,
|
|
8216
8216
|
step: 1,
|
|
8217
8217
|
marks: [],
|
|
8218
|
-
label: (
|
|
8218
|
+
label: (f) => f,
|
|
8219
8219
|
labelTransitionProps: { transition: "fade", duration: 0 },
|
|
8220
8220
|
thumbLabel: "",
|
|
8221
8221
|
showLabelOnHover: !0,
|
|
@@ -8634,112 +8634,109 @@ const __iconNode$1 = [["path", { d: "M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0", key: "s
|
|
|
8634
8634
|
* See the LICENSE file in the root directory of this source tree.
|
|
8635
8635
|
*/
|
|
8636
8636
|
const __iconNode = [["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" }]], IconZoomScan = createReactComponent("outline", "zoom-scan", "ZoomScan", __iconNode);
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8637
|
+
function e$5(e2, t2, n2) {
|
|
8638
|
+
let r2 = (n3) => e2(n3, ...t2);
|
|
8639
|
+
return n2 === void 0 ? r2 : Object.assign(r2, { lazy: n2, lazyArgs: t2 });
|
|
8640
|
+
}
|
|
8641
|
+
function t$a(t2, n2, r2) {
|
|
8642
|
+
let i2 = t2.length - n2.length;
|
|
8643
|
+
if (i2 === 0) return t2(...n2);
|
|
8644
|
+
if (i2 === 1) return e$5(t2, n2, r2);
|
|
8645
|
+
throw Error("Wrong number of arguments");
|
|
8646
|
+
}
|
|
8647
|
+
function t$9(...t2) {
|
|
8648
|
+
return t$a(n$5, t2);
|
|
8649
|
+
}
|
|
8650
|
+
const n$5 = (e2, { min: t2, max: n2 }) => t2 !== void 0 && e2 < t2 ? t2 : n2 !== void 0 && e2 > n2 ? n2 : e2, t$8 = { done: !1, hasNext: !1 };
|
|
8651
|
+
function t$7(e2, ...t2) {
|
|
8652
|
+
let a = e2, o = t2.map((e3) => "lazy" in e3 ? r$1(e3) : void 0), s = 0;
|
|
8653
|
+
for (; s < t2.length; ) {
|
|
8654
|
+
if (o[s] === void 0 || !i(a)) {
|
|
8655
|
+
let e4 = t2[s];
|
|
8656
|
+
a = e4(a), s += 1;
|
|
8644
8657
|
continue;
|
|
8645
8658
|
}
|
|
8646
|
-
let
|
|
8647
|
-
for (let
|
|
8648
|
-
let
|
|
8649
|
-
if (
|
|
8659
|
+
let e3 = [];
|
|
8660
|
+
for (let n2 = s; n2 < t2.length; n2++) {
|
|
8661
|
+
let t3 = o[n2];
|
|
8662
|
+
if (t3 === void 0 || (e3.push(t3), t3.isSingle)) break;
|
|
8650
8663
|
}
|
|
8651
|
-
let
|
|
8652
|
-
for (let
|
|
8653
|
-
let { isSingle:
|
|
8654
|
-
|
|
8664
|
+
let r2 = [];
|
|
8665
|
+
for (let t3 of a) if (n$4(t3, r2, e3)) break;
|
|
8666
|
+
let { isSingle: c } = e3.at(-1);
|
|
8667
|
+
a = c ? r2[0] : r2, s += e3.length;
|
|
8655
8668
|
}
|
|
8656
|
-
return
|
|
8669
|
+
return a;
|
|
8657
8670
|
}
|
|
8658
|
-
function
|
|
8659
|
-
if (
|
|
8660
|
-
let
|
|
8661
|
-
for (let [
|
|
8662
|
-
let { index:
|
|
8663
|
-
if (
|
|
8664
|
-
if (
|
|
8665
|
-
for (let
|
|
8666
|
-
return
|
|
8671
|
+
function n$4(t2, r2, i2) {
|
|
8672
|
+
if (i2.length === 0) return r2.push(t2), !1;
|
|
8673
|
+
let a = t2, o = t$8, s = !1;
|
|
8674
|
+
for (let [e2, t3] of i2.entries()) {
|
|
8675
|
+
let { index: c, items: l } = t3;
|
|
8676
|
+
if (l.push(a), o = t3(a, c, l), t3.index += 1, o.hasNext) {
|
|
8677
|
+
if (o.hasMany ?? !1) {
|
|
8678
|
+
for (let t4 of o.next) if (n$4(t4, r2, i2.slice(e2 + 1))) return !0;
|
|
8679
|
+
return s;
|
|
8667
8680
|
}
|
|
8668
|
-
|
|
8681
|
+
a = o.next;
|
|
8669
8682
|
}
|
|
8670
|
-
if (!
|
|
8671
|
-
|
|
8683
|
+
if (!o.hasNext) break;
|
|
8684
|
+
o.done && (s = !0);
|
|
8672
8685
|
}
|
|
8673
|
-
return
|
|
8674
|
-
}
|
|
8675
|
-
function y(t2) {
|
|
8676
|
-
let { lazy: o2, lazyArgs: n2 } = t2, u2 = o2(...n2);
|
|
8677
|
-
return Object.assign(u2, { isSingle: o2.single ?? !1, index: 0, items: [] });
|
|
8678
|
-
}
|
|
8679
|
-
function B(t2) {
|
|
8680
|
-
return typeof t2 == "string" || typeof t2 == "object" && t2 !== null && Symbol.iterator in t2;
|
|
8686
|
+
return o.hasNext && r2.push(a), s;
|
|
8681
8687
|
}
|
|
8682
|
-
function
|
|
8683
|
-
let t2 =
|
|
8684
|
-
return
|
|
8685
|
-
}
|
|
8686
|
-
function u$2(r2, n2, o2) {
|
|
8687
|
-
let a = r2.length - n2.length;
|
|
8688
|
-
if (a === 0) return r2(...n2);
|
|
8689
|
-
if (a === 1) return u$3(r2, n2, o2);
|
|
8690
|
-
throw new Error("Wrong number of arguments");
|
|
8691
|
-
}
|
|
8692
|
-
function i$1(...e2) {
|
|
8693
|
-
return u$2(n$2, e2);
|
|
8688
|
+
function r$1(e2) {
|
|
8689
|
+
let { lazy: t2, lazyArgs: n2 } = e2, r2 = t2(...n2);
|
|
8690
|
+
return Object.assign(r2, { isSingle: t2.single ?? !1, index: 0, items: [] });
|
|
8694
8691
|
}
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
return u$2(d, n2);
|
|
8692
|
+
function i(e2) {
|
|
8693
|
+
return typeof e2 == "string" || typeof e2 == "object" && !!e2 && Symbol.iterator in e2;
|
|
8698
8694
|
}
|
|
8699
|
-
function
|
|
8700
|
-
|
|
8701
|
-
for (let [a, t2] of n2.entries()) {
|
|
8702
|
-
let [y2, u2] = o2(t2, a, n2);
|
|
8703
|
-
e2[y2] = u2;
|
|
8704
|
-
}
|
|
8705
|
-
return e2;
|
|
8695
|
+
function t$6(...t2) {
|
|
8696
|
+
return t$a(n$3, t2);
|
|
8706
8697
|
}
|
|
8707
|
-
|
|
8708
|
-
|
|
8698
|
+
const n$3 = (e2, t2) => e2.length >= t2;
|
|
8699
|
+
function t$5(...t2) {
|
|
8700
|
+
return t$a(Object.entries, t2);
|
|
8709
8701
|
}
|
|
8710
|
-
function
|
|
8711
|
-
return
|
|
8702
|
+
function t$4(...t2) {
|
|
8703
|
+
return t$a(n$2, t2, r);
|
|
8712
8704
|
}
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
return
|
|
8705
|
+
const n$2 = (e2, t2) => e2.flatMap(t2), r = (e2) => (t2, n2, r2) => {
|
|
8706
|
+
let i2 = e2(t2, n2, r2);
|
|
8707
|
+
return Array.isArray(i2) ? { done: !1, hasNext: !0, hasMany: !0, next: i2 } : { done: !1, hasNext: !0, next: i2 };
|
|
8708
|
+
};
|
|
8709
|
+
function e$4(e2) {
|
|
8710
|
+
return Array.isArray(e2);
|
|
8716
8711
|
}
|
|
8717
|
-
function e(
|
|
8718
|
-
return
|
|
8712
|
+
function e$3(e2) {
|
|
8713
|
+
return e2 === "" || e2 === void 0 ? !0 : Array.isArray(e2) ? e2.length === 0 : Object.keys(e2).length === 0;
|
|
8719
8714
|
}
|
|
8720
|
-
|
|
8721
|
-
|
|
8715
|
+
const e$2 = (e2) => typeof e2 == "function";
|
|
8716
|
+
function e$1(e2) {
|
|
8717
|
+
return typeof e2 == "number" && !Number.isNaN(e2);
|
|
8722
8718
|
}
|
|
8723
|
-
function
|
|
8724
|
-
return
|
|
8719
|
+
function e(e2) {
|
|
8720
|
+
return !!e2;
|
|
8725
8721
|
}
|
|
8726
|
-
function
|
|
8727
|
-
return
|
|
8722
|
+
function t$3(...t2) {
|
|
8723
|
+
return t$a(n$1, t2);
|
|
8728
8724
|
}
|
|
8729
|
-
|
|
8730
|
-
|
|
8725
|
+
const n$1 = (e2, t2) => e2.join(t2);
|
|
8726
|
+
function t$2(...t2) {
|
|
8727
|
+
return t$a(Object.keys, t2);
|
|
8731
8728
|
}
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
return Array.isArray(n2) ? { done: !1, hasNext: !0, hasMany: !0, next: n2 } : { done: !1, hasNext: !0, next: n2 };
|
|
8735
|
-
};
|
|
8736
|
-
function t$1(...r2) {
|
|
8737
|
-
return u$2(Object.entries, r2);
|
|
8729
|
+
function t$1(...t2) {
|
|
8730
|
+
return t$a(n, t2);
|
|
8738
8731
|
}
|
|
8739
|
-
function
|
|
8740
|
-
|
|
8732
|
+
function n(e2, t2) {
|
|
8733
|
+
let n2 = {};
|
|
8734
|
+
for (let [r2, i2] of e2.entries()) {
|
|
8735
|
+
let [a, o] = t2(i2, r2, e2);
|
|
8736
|
+
n2[a] = o;
|
|
8737
|
+
}
|
|
8738
|
+
return n2;
|
|
8741
8739
|
}
|
|
8742
|
-
var i = (n2, { min: e2, max: r2 }) => e2 !== void 0 && n2 < e2 ? e2 : r2 !== void 0 && n2 > r2 ? r2 : n2;
|
|
8743
8740
|
const LayoutGroupContext = createContext({});
|
|
8744
8741
|
function useConstant(init2) {
|
|
8745
8742
|
const ref = useRef(null);
|
|
@@ -9916,23 +9913,23 @@ function onRemove(typename) {
|
|
|
9916
9913
|
return function() {
|
|
9917
9914
|
var on = this.__on;
|
|
9918
9915
|
if (on) {
|
|
9919
|
-
for (var j = 0, i2 = -1, m2 = on.length,
|
|
9920
|
-
|
|
9916
|
+
for (var j = 0, i2 = -1, m2 = on.length, o; j < m2; ++j)
|
|
9917
|
+
o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name ? this.removeEventListener(o.type, o.listener, o.options) : on[++i2] = o;
|
|
9921
9918
|
++i2 ? on.length = i2 : delete this.__on;
|
|
9922
9919
|
}
|
|
9923
9920
|
};
|
|
9924
9921
|
}
|
|
9925
9922
|
function onAdd(typename, value, options) {
|
|
9926
9923
|
return function() {
|
|
9927
|
-
var on = this.__on,
|
|
9924
|
+
var on = this.__on, o, listener = contextListener(value);
|
|
9928
9925
|
if (on) {
|
|
9929
9926
|
for (var j = 0, m2 = on.length; j < m2; ++j)
|
|
9930
|
-
if ((
|
|
9931
|
-
this.removeEventListener(
|
|
9927
|
+
if ((o = on[j]).type === typename.type && o.name === typename.name) {
|
|
9928
|
+
this.removeEventListener(o.type, o.listener, o.options), this.addEventListener(o.type, o.listener = listener, o.options = options), o.value = value;
|
|
9932
9929
|
return;
|
|
9933
9930
|
}
|
|
9934
9931
|
}
|
|
9935
|
-
this.addEventListener(typename.type, listener, options),
|
|
9932
|
+
this.addEventListener(typename.type, listener, options), o = { type: typename.type, name: typename.name, value, listener, options }, on ? on.push(o) : this.__on = [o];
|
|
9936
9933
|
};
|
|
9937
9934
|
}
|
|
9938
9935
|
function selection_on(typename, value, options) {
|
|
@@ -9940,10 +9937,10 @@ function selection_on(typename, value, options) {
|
|
|
9940
9937
|
if (arguments.length < 2) {
|
|
9941
9938
|
var on = this.node().__on;
|
|
9942
9939
|
if (on) {
|
|
9943
|
-
for (var j = 0, m2 = on.length,
|
|
9944
|
-
for (i2 = 0,
|
|
9945
|
-
if ((t2 = typenames[i2]).type ===
|
|
9946
|
-
return
|
|
9940
|
+
for (var j = 0, m2 = on.length, o; j < m2; ++j)
|
|
9941
|
+
for (i2 = 0, o = on[j]; i2 < n2; ++i2)
|
|
9942
|
+
if ((t2 = typenames[i2]).type === o.type && t2.name === o.name)
|
|
9943
|
+
return o.value;
|
|
9947
9944
|
}
|
|
9948
9945
|
return;
|
|
9949
9946
|
}
|
|
@@ -10067,7 +10064,7 @@ function DragEvent(type, {
|
|
|
10067
10064
|
identifier,
|
|
10068
10065
|
active,
|
|
10069
10066
|
x,
|
|
10070
|
-
y
|
|
10067
|
+
y,
|
|
10071
10068
|
dx,
|
|
10072
10069
|
dy,
|
|
10073
10070
|
dispatch: dispatch2
|
|
@@ -10080,7 +10077,7 @@ function DragEvent(type, {
|
|
|
10080
10077
|
identifier: { value: identifier, enumerable: !0, configurable: !0 },
|
|
10081
10078
|
active: { value: active, enumerable: !0, configurable: !0 },
|
|
10082
10079
|
x: { value: x, enumerable: !0, configurable: !0 },
|
|
10083
|
-
y: { value:
|
|
10080
|
+
y: { value: y, enumerable: !0, configurable: !0 },
|
|
10084
10081
|
dx: { value: dx, enumerable: !0, configurable: !0 },
|
|
10085
10082
|
dy: { value: dy, enumerable: !0, configurable: !0 },
|
|
10086
10083
|
_: { value: dispatch2 }
|
|
@@ -10096,8 +10093,8 @@ function defaultFilter$1(event) {
|
|
|
10096
10093
|
function defaultContainer() {
|
|
10097
10094
|
return this.parentNode;
|
|
10098
10095
|
}
|
|
10099
|
-
function defaultSubject(event,
|
|
10100
|
-
return
|
|
10096
|
+
function defaultSubject(event, d) {
|
|
10097
|
+
return d ?? { x: event.x, y: event.y };
|
|
10101
10098
|
}
|
|
10102
10099
|
function defaultTouchable$1() {
|
|
10103
10100
|
return navigator.maxTouchPoints || "ontouchstart" in this;
|
|
@@ -10107,9 +10104,9 @@ function drag() {
|
|
|
10107
10104
|
function drag2(selection2) {
|
|
10108
10105
|
selection2.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved, nonpassive).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
10109
10106
|
}
|
|
10110
|
-
function mousedowned(event,
|
|
10111
|
-
if (!(touchending || !filter2.call(this, event,
|
|
10112
|
-
var gesture = beforestart(this, container2.call(this, event,
|
|
10107
|
+
function mousedowned(event, d) {
|
|
10108
|
+
if (!(touchending || !filter2.call(this, event, d))) {
|
|
10109
|
+
var gesture = beforestart(this, container2.call(this, event, d), event, d, "mouse");
|
|
10113
10110
|
gesture && (select(event.view).on("mousemove.drag", mousemoved, nonpassivecapture).on("mouseup.drag", mouseupped, nonpassivecapture), dragDisable(event.view), nopropagation$1(event), mousemoving = !1, mousedownx = event.clientX, mousedowny = event.clientY, gesture("start", event));
|
|
10114
10111
|
}
|
|
10115
10112
|
}
|
|
@@ -10123,11 +10120,11 @@ function drag() {
|
|
|
10123
10120
|
function mouseupped(event) {
|
|
10124
10121
|
select(event.view).on("mousemove.drag mouseup.drag", null), yesdrag(event.view, mousemoving), noevent$1(event), gestures.mouse("end", event);
|
|
10125
10122
|
}
|
|
10126
|
-
function touchstarted(event,
|
|
10127
|
-
if (filter2.call(this, event,
|
|
10128
|
-
var touches = event.changedTouches, c = container2.call(this, event,
|
|
10123
|
+
function touchstarted(event, d) {
|
|
10124
|
+
if (filter2.call(this, event, d)) {
|
|
10125
|
+
var touches = event.changedTouches, c = container2.call(this, event, d), n2 = touches.length, i2, gesture;
|
|
10129
10126
|
for (i2 = 0; i2 < n2; ++i2)
|
|
10130
|
-
(gesture = beforestart(this, c, event,
|
|
10127
|
+
(gesture = beforestart(this, c, event, d, touches[i2].identifier, touches[i2])) && (nopropagation$1(event), gesture("start", event, touches[i2]));
|
|
10131
10128
|
}
|
|
10132
10129
|
}
|
|
10133
10130
|
function touchmoved(event) {
|
|
@@ -10142,9 +10139,9 @@ function drag() {
|
|
|
10142
10139
|
}, 500), i2 = 0; i2 < n2; ++i2)
|
|
10143
10140
|
(gesture = gestures[touches[i2].identifier]) && (nopropagation$1(event), gesture("end", event, touches[i2]));
|
|
10144
10141
|
}
|
|
10145
|
-
function beforestart(that, container3, event,
|
|
10146
|
-
var dispatch2 = listeners.copy(), p = pointer(touch || event, container3), dx, dy,
|
|
10147
|
-
if ((
|
|
10142
|
+
function beforestart(that, container3, event, d, identifier, touch) {
|
|
10143
|
+
var dispatch2 = listeners.copy(), p = pointer(touch || event, container3), dx, dy, s;
|
|
10144
|
+
if ((s = subject.call(that, new DragEvent("beforestart", {
|
|
10148
10145
|
sourceEvent: event,
|
|
10149
10146
|
target: drag2,
|
|
10150
10147
|
identifier,
|
|
@@ -10154,8 +10151,8 @@ function drag() {
|
|
|
10154
10151
|
dx: 0,
|
|
10155
10152
|
dy: 0,
|
|
10156
10153
|
dispatch: dispatch2
|
|
10157
|
-
}),
|
|
10158
|
-
return dx =
|
|
10154
|
+
}), d)) != null)
|
|
10155
|
+
return dx = s.x - p[0] || 0, dy = s.y - p[1] || 0, function gesture(type, event2, touch2) {
|
|
10159
10156
|
var p0 = p, n2;
|
|
10160
10157
|
switch (type) {
|
|
10161
10158
|
case "start":
|
|
@@ -10173,7 +10170,7 @@ function drag() {
|
|
|
10173
10170
|
that,
|
|
10174
10171
|
new DragEvent(type, {
|
|
10175
10172
|
sourceEvent: event2,
|
|
10176
|
-
subject:
|
|
10173
|
+
subject: s,
|
|
10177
10174
|
target: drag2,
|
|
10178
10175
|
identifier,
|
|
10179
10176
|
active: n2,
|
|
@@ -10183,7 +10180,7 @@ function drag() {
|
|
|
10183
10180
|
dy: p[1] - p0[1],
|
|
10184
10181
|
dispatch: dispatch2
|
|
10185
10182
|
}),
|
|
10186
|
-
|
|
10183
|
+
d
|
|
10187
10184
|
);
|
|
10188
10185
|
};
|
|
10189
10186
|
}
|
|
@@ -10390,8 +10387,8 @@ function color_formatRgb() {
|
|
|
10390
10387
|
return this.rgb().formatRgb();
|
|
10391
10388
|
}
|
|
10392
10389
|
function color(format) {
|
|
10393
|
-
var m2,
|
|
10394
|
-
return format = (format + "").trim().toLowerCase(), (m2 = reHex.exec(format)) ? (
|
|
10390
|
+
var m2, l;
|
|
10391
|
+
return format = (format + "").trim().toLowerCase(), (m2 = reHex.exec(format)) ? (l = m2[1].length, m2 = parseInt(m2[1], 16), l === 6 ? rgbn(m2) : l === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l === 8 ? rgba(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l === 4 ? rgba(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format)) ? rgba(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format)) ? rgba(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format) ? rgbn(named[format]) : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
|
10395
10392
|
}
|
|
10396
10393
|
function rgbn(n2) {
|
|
10397
10394
|
return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
|
|
@@ -10399,8 +10396,8 @@ function rgbn(n2) {
|
|
|
10399
10396
|
function rgba(r2, g, b, a) {
|
|
10400
10397
|
return a <= 0 && (r2 = g = b = NaN), new Rgb(r2, g, b, a);
|
|
10401
10398
|
}
|
|
10402
|
-
function rgbConvert(
|
|
10403
|
-
return
|
|
10399
|
+
function rgbConvert(o) {
|
|
10400
|
+
return o instanceof Color || (o = color(o)), o ? (o = o.rgb(), new Rgb(o.r, o.g, o.b, o.opacity)) : new Rgb();
|
|
10404
10401
|
}
|
|
10405
10402
|
function rgb(r2, g, b, opacity) {
|
|
10406
10403
|
return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g, b, opacity ?? 1);
|
|
@@ -10450,22 +10447,22 @@ function clampi(value) {
|
|
|
10450
10447
|
function hex(value) {
|
|
10451
10448
|
return value = clampi(value), (value < 16 ? "0" : "") + value.toString(16);
|
|
10452
10449
|
}
|
|
10453
|
-
function hsla(h,
|
|
10454
|
-
return a <= 0 ? h =
|
|
10450
|
+
function hsla(h, s, l, a) {
|
|
10451
|
+
return a <= 0 ? h = s = l = NaN : l <= 0 || l >= 1 ? h = s = NaN : s <= 0 && (h = NaN), new Hsl(h, s, l, a);
|
|
10455
10452
|
}
|
|
10456
|
-
function hslConvert(
|
|
10457
|
-
if (
|
|
10458
|
-
if (
|
|
10459
|
-
if (
|
|
10460
|
-
|
|
10461
|
-
var r2 =
|
|
10462
|
-
return
|
|
10453
|
+
function hslConvert(o) {
|
|
10454
|
+
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
10455
|
+
if (o instanceof Color || (o = color(o)), !o) return new Hsl();
|
|
10456
|
+
if (o instanceof Hsl) return o;
|
|
10457
|
+
o = o.rgb();
|
|
10458
|
+
var r2 = o.r / 255, g = o.g / 255, b = o.b / 255, min2 = Math.min(r2, g, b), max2 = Math.max(r2, g, b), h = NaN, s = max2 - min2, l = (max2 + min2) / 2;
|
|
10459
|
+
return s ? (r2 === max2 ? h = (g - b) / s + (g < b) * 6 : g === max2 ? h = (b - r2) / s + 2 : h = (r2 - g) / s + 4, s /= l < 0.5 ? max2 + min2 : 2 - max2 - min2, h *= 60) : s = l > 0 && l < 1 ? 0 : h, new Hsl(h, s, l, o.opacity);
|
|
10463
10460
|
}
|
|
10464
|
-
function hsl(h,
|
|
10465
|
-
return arguments.length === 1 ? hslConvert(h) : new Hsl(h,
|
|
10461
|
+
function hsl(h, s, l, opacity) {
|
|
10462
|
+
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity ?? 1);
|
|
10466
10463
|
}
|
|
10467
|
-
function Hsl(h,
|
|
10468
|
-
this.h = +h, this.s = +
|
|
10464
|
+
function Hsl(h, s, l, opacity) {
|
|
10465
|
+
this.h = +h, this.s = +s, this.l = +l, this.opacity = +opacity;
|
|
10469
10466
|
}
|
|
10470
10467
|
define(Hsl, hsl, extend(Color, {
|
|
10471
10468
|
brighter(k) {
|
|
@@ -10475,7 +10472,7 @@ define(Hsl, hsl, extend(Color, {
|
|
|
10475
10472
|
return k = k == null ? darker : Math.pow(darker, k), new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
10476
10473
|
},
|
|
10477
10474
|
rgb() {
|
|
10478
|
-
var h = this.h % 360 + (this.h < 0) * 360,
|
|
10475
|
+
var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
|
|
10479
10476
|
return new Rgb(
|
|
10480
10477
|
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
10481
10478
|
hsl2rgb(h, m1, m2),
|
|
@@ -10504,27 +10501,27 @@ function hsl2rgb(h, m1, m2) {
|
|
|
10504
10501
|
return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
|
10505
10502
|
}
|
|
10506
10503
|
const constant$1 = (x) => () => x;
|
|
10507
|
-
function linear(a,
|
|
10504
|
+
function linear(a, d) {
|
|
10508
10505
|
return function(t2) {
|
|
10509
|
-
return a + t2 *
|
|
10506
|
+
return a + t2 * d;
|
|
10510
10507
|
};
|
|
10511
10508
|
}
|
|
10512
|
-
function exponential(a, b,
|
|
10513
|
-
return a = Math.pow(a,
|
|
10514
|
-
return Math.pow(a + t2 * b,
|
|
10509
|
+
function exponential(a, b, y) {
|
|
10510
|
+
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t2) {
|
|
10511
|
+
return Math.pow(a + t2 * b, y);
|
|
10515
10512
|
};
|
|
10516
10513
|
}
|
|
10517
|
-
function gamma(
|
|
10518
|
-
return (
|
|
10519
|
-
return b - a ? exponential(a, b,
|
|
10514
|
+
function gamma(y) {
|
|
10515
|
+
return (y = +y) == 1 ? nogamma : function(a, b) {
|
|
10516
|
+
return b - a ? exponential(a, b, y) : constant$1(isNaN(a) ? b : a);
|
|
10520
10517
|
};
|
|
10521
10518
|
}
|
|
10522
10519
|
function nogamma(a, b) {
|
|
10523
|
-
var
|
|
10524
|
-
return
|
|
10520
|
+
var d = b - a;
|
|
10521
|
+
return d ? linear(a, d) : constant$1(isNaN(a) ? b : a);
|
|
10525
10522
|
}
|
|
10526
|
-
const interpolateRgb = (function rgbGamma(
|
|
10527
|
-
var color2 = gamma(
|
|
10523
|
+
const interpolateRgb = (function rgbGamma(y) {
|
|
10524
|
+
var color2 = gamma(y);
|
|
10528
10525
|
function rgb$1(start2, end) {
|
|
10529
10526
|
var r2 = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g = color2(start2.g, end.g), b = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
|
|
10530
10527
|
return function(t2) {
|
|
@@ -10554,9 +10551,9 @@ function genericArray(a, b) {
|
|
|
10554
10551
|
};
|
|
10555
10552
|
}
|
|
10556
10553
|
function date(a, b) {
|
|
10557
|
-
var
|
|
10554
|
+
var d = /* @__PURE__ */ new Date();
|
|
10558
10555
|
return a = +a, b = +b, function(t2) {
|
|
10559
|
-
return
|
|
10556
|
+
return d.setTime(a * (1 - t2) + b * t2), d;
|
|
10560
10557
|
};
|
|
10561
10558
|
}
|
|
10562
10559
|
function interpolateNumber(a, b) {
|
|
@@ -10586,12 +10583,12 @@ function one(b) {
|
|
|
10586
10583
|
};
|
|
10587
10584
|
}
|
|
10588
10585
|
function interpolateString(a, b) {
|
|
10589
|
-
var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1,
|
|
10586
|
+
var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1, s = [], q = [];
|
|
10590
10587
|
for (a = a + "", b = b + ""; (am = reA.exec(a)) && (bm = reB.exec(b)); )
|
|
10591
|
-
(bs = bm.index) > bi && (bs = b.slice(bi, bs),
|
|
10592
|
-
return bi < b.length && (bs = b.slice(bi),
|
|
10593
|
-
for (var i3 = 0,
|
|
10594
|
-
return
|
|
10588
|
+
(bs = bm.index) > bi && (bs = b.slice(bi, bs), s[i2] ? s[i2] += bs : s[++i2] = bs), (am = am[0]) === (bm = bm[0]) ? s[i2] ? s[i2] += bm : s[++i2] = bm : (s[++i2] = null, q.push({ i: i2, x: interpolateNumber(am, bm) })), bi = reB.lastIndex;
|
|
10589
|
+
return bi < b.length && (bs = b.slice(bi), s[i2] ? s[i2] += bs : s[++i2] = bs), s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t2) {
|
|
10590
|
+
for (var i3 = 0, o; i3 < b; ++i3) s[(o = q[i3]).i] = o.x(t2);
|
|
10591
|
+
return s.join("");
|
|
10595
10592
|
});
|
|
10596
10593
|
}
|
|
10597
10594
|
function interpolate$1(a, b) {
|
|
@@ -10606,11 +10603,11 @@ var degrees = 180 / Math.PI, identity$2 = {
|
|
|
10606
10603
|
scaleX: 1,
|
|
10607
10604
|
scaleY: 1
|
|
10608
10605
|
};
|
|
10609
|
-
function decompose(a, b, c,
|
|
10606
|
+
function decompose(a, b, c, d, e2, f) {
|
|
10610
10607
|
var scaleX, scaleY, skewX;
|
|
10611
|
-
return (scaleX = Math.sqrt(a * a + b * b)) && (a /= scaleX, b /= scaleX), (skewX = a * c + b *
|
|
10608
|
+
return (scaleX = Math.sqrt(a * a + b * b)) && (a /= scaleX, b /= scaleX), (skewX = a * c + b * d) && (c -= a * skewX, d -= b * skewX), (scaleY = Math.sqrt(c * c + d * d)) && (c /= scaleY, d /= scaleY, skewX /= scaleY), a * d < b * c && (a = -a, b = -b, skewX = -skewX, scaleX = -scaleX), {
|
|
10612
10609
|
translateX: e2,
|
|
10613
|
-
translateY:
|
|
10610
|
+
translateY: f,
|
|
10614
10611
|
rotate: Math.atan2(b, a) * degrees,
|
|
10615
10612
|
skewX: Math.atan(skewX) * degrees,
|
|
10616
10613
|
scaleX,
|
|
@@ -10626,32 +10623,32 @@ function parseSvg(value) {
|
|
|
10626
10623
|
return value == null || (svgNode || (svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g")), svgNode.setAttribute("transform", value), !(value = svgNode.transform.baseVal.consolidate())) ? identity$2 : (value = value.matrix, decompose(value.a, value.b, value.c, value.d, value.e, value.f));
|
|
10627
10624
|
}
|
|
10628
10625
|
function interpolateTransform(parse2, pxComma, pxParen, degParen) {
|
|
10629
|
-
function pop(
|
|
10630
|
-
return
|
|
10626
|
+
function pop(s) {
|
|
10627
|
+
return s.length ? s.pop() + " " : "";
|
|
10631
10628
|
}
|
|
10632
|
-
function translate(xa, ya, xb, yb,
|
|
10629
|
+
function translate(xa, ya, xb, yb, s, q) {
|
|
10633
10630
|
if (xa !== xb || ya !== yb) {
|
|
10634
|
-
var i2 =
|
|
10631
|
+
var i2 = s.push("translate(", null, pxComma, null, pxParen);
|
|
10635
10632
|
q.push({ i: i2 - 4, x: interpolateNumber(xa, xb) }, { i: i2 - 2, x: interpolateNumber(ya, yb) });
|
|
10636
|
-
} else (xb || yb) &&
|
|
10633
|
+
} else (xb || yb) && s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
10637
10634
|
}
|
|
10638
|
-
function rotate(a, b,
|
|
10639
|
-
a !== b ? (a - b > 180 ? b += 360 : b - a > 180 && (a += 360), q.push({ i:
|
|
10635
|
+
function rotate(a, b, s, q) {
|
|
10636
|
+
a !== b ? (a - b > 180 ? b += 360 : b - a > 180 && (a += 360), q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) })) : b && s.push(pop(s) + "rotate(" + b + degParen);
|
|
10640
10637
|
}
|
|
10641
|
-
function skewX(a, b,
|
|
10642
|
-
a !== b ? q.push({ i:
|
|
10638
|
+
function skewX(a, b, s, q) {
|
|
10639
|
+
a !== b ? q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b) }) : b && s.push(pop(s) + "skewX(" + b + degParen);
|
|
10643
10640
|
}
|
|
10644
|
-
function scale2(xa, ya, xb, yb,
|
|
10641
|
+
function scale2(xa, ya, xb, yb, s, q) {
|
|
10645
10642
|
if (xa !== xb || ya !== yb) {
|
|
10646
|
-
var i2 =
|
|
10643
|
+
var i2 = s.push(pop(s) + "scale(", null, ",", null, ")");
|
|
10647
10644
|
q.push({ i: i2 - 4, x: interpolateNumber(xa, xb) }, { i: i2 - 2, x: interpolateNumber(ya, yb) });
|
|
10648
|
-
} else (xb !== 1 || yb !== 1) &&
|
|
10645
|
+
} else (xb !== 1 || yb !== 1) && s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
10649
10646
|
}
|
|
10650
10647
|
return function(a, b) {
|
|
10651
|
-
var
|
|
10652
|
-
return a = parse2(a), b = parse2(b), translate(a.translateX, a.translateY, b.translateX, b.translateY,
|
|
10653
|
-
for (var i2 = -1, n2 = q.length,
|
|
10654
|
-
return
|
|
10648
|
+
var s = [], q = [];
|
|
10649
|
+
return a = parse2(a), b = parse2(b), translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q), rotate(a.rotate, b.rotate, s, q), skewX(a.skewX, b.skewX, s, q), scale2(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q), a = b = null, function(t2) {
|
|
10650
|
+
for (var i2 = -1, n2 = q.length, o; ++i2 < n2; ) s[(o = q[i2]).i] = o.x(t2);
|
|
10651
|
+
return s.join("");
|
|
10655
10652
|
};
|
|
10656
10653
|
};
|
|
10657
10654
|
}
|
|
@@ -10679,11 +10676,11 @@ const interpolateZoom = (function zoomRho(rho, rho2, rho4) {
|
|
|
10679
10676
|
else {
|
|
10680
10677
|
var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
10681
10678
|
S = (r1 - r0) / rho, i2 = function(t2) {
|
|
10682
|
-
var
|
|
10679
|
+
var s = t2 * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
10683
10680
|
return [
|
|
10684
|
-
ux0 +
|
|
10685
|
-
uy0 +
|
|
10686
|
-
w0 * coshr0 / cosh(rho *
|
|
10681
|
+
ux0 + u * dx,
|
|
10682
|
+
uy0 + u * dy,
|
|
10683
|
+
w0 * coshr0 / cosh(rho * s + r0)
|
|
10687
10684
|
];
|
|
10688
10685
|
};
|
|
10689
10686
|
}
|
|
@@ -10694,8 +10691,8 @@ const interpolateZoom = (function zoomRho(rho, rho2, rho4) {
|
|
|
10694
10691
|
return zoomRho(_1, _2, _4);
|
|
10695
10692
|
}, zoom2;
|
|
10696
10693
|
})(Math.SQRT2, 2, 4);
|
|
10697
|
-
var frame = 0, timeout$1 = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance == "object" && performance.now ? performance : Date, setFrame = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(
|
|
10698
|
-
setTimeout(
|
|
10694
|
+
var frame = 0, timeout$1 = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance == "object" && performance.now ? performance : Date, setFrame = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
|
|
10695
|
+
setTimeout(f, 17);
|
|
10699
10696
|
};
|
|
10700
10697
|
function now() {
|
|
10701
10698
|
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
|
@@ -10799,18 +10796,18 @@ function create(node, id2, self2) {
|
|
|
10799
10796
|
self2.state = SCHEDULED, self2.timer.restart(start2, self2.delay, self2.time), self2.delay <= elapsed && start2(elapsed - self2.delay);
|
|
10800
10797
|
}
|
|
10801
10798
|
function start2(elapsed) {
|
|
10802
|
-
var i2, j, n2,
|
|
10799
|
+
var i2, j, n2, o;
|
|
10803
10800
|
if (self2.state !== SCHEDULED) return stop();
|
|
10804
10801
|
for (i2 in schedules)
|
|
10805
|
-
if (
|
|
10806
|
-
if (
|
|
10807
|
-
|
|
10802
|
+
if (o = schedules[i2], o.name === self2.name) {
|
|
10803
|
+
if (o.state === STARTED) return timeout(start2);
|
|
10804
|
+
o.state === RUNNING ? (o.state = ENDED, o.timer.stop(), o.on.call("interrupt", node, node.__data__, o.index, o.group), delete schedules[i2]) : +i2 < id2 && (o.state = ENDED, o.timer.stop(), o.on.call("cancel", node, node.__data__, o.index, o.group), delete schedules[i2]);
|
|
10808
10805
|
}
|
|
10809
10806
|
if (timeout(function() {
|
|
10810
10807
|
self2.state === STARTED && (self2.state = RUNNING, self2.timer.restart(tick, self2.delay, self2.time), tick(elapsed));
|
|
10811
10808
|
}), self2.state = STARTING, self2.on.call("start", node, node.__data__, self2.index, self2.group), self2.state === STARTING) {
|
|
10812
10809
|
for (self2.state = STARTED, tween = new Array(n2 = self2.tween.length), i2 = 0, j = -1; i2 < n2; ++i2)
|
|
10813
|
-
(
|
|
10810
|
+
(o = self2.tween[i2].value.call(node, node.__data__, self2.index, self2.group)) && (tween[++j] = o);
|
|
10814
10811
|
tween.length = j + 1;
|
|
10815
10812
|
}
|
|
10816
10813
|
}
|
|
@@ -11081,7 +11078,7 @@ function transition_selectAll(select2) {
|
|
|
11081
11078
|
for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j = 0; j < m2; ++j)
|
|
11082
11079
|
for (var group = groups[j], n2 = group.length, node, i2 = 0; i2 < n2; ++i2)
|
|
11083
11080
|
if (node = group[i2]) {
|
|
11084
|
-
for (var children2 = select2.call(node, node.__data__, i2, group), child, inherit2 = get(node, id2), k = 0,
|
|
11081
|
+
for (var children2 = select2.call(node, node.__data__, i2, group), child, inherit2 = get(node, id2), k = 0, l = children2.length; k < l; ++k)
|
|
11085
11082
|
(child = children2[k]) && schedule(child, name, id2, k, children2, inherit2);
|
|
11086
11083
|
subgroups.push(children2), parents.push(node);
|
|
11087
11084
|
}
|
|
@@ -11289,16 +11286,16 @@ function ZoomEvent(type, {
|
|
|
11289
11286
|
_: { value: dispatch2 }
|
|
11290
11287
|
});
|
|
11291
11288
|
}
|
|
11292
|
-
function Transform(k, x,
|
|
11293
|
-
this.k = k, this.x = x, this.y =
|
|
11289
|
+
function Transform(k, x, y) {
|
|
11290
|
+
this.k = k, this.x = x, this.y = y;
|
|
11294
11291
|
}
|
|
11295
11292
|
Transform.prototype = {
|
|
11296
11293
|
constructor: Transform,
|
|
11297
11294
|
scale: function(k) {
|
|
11298
11295
|
return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
|
11299
11296
|
},
|
|
11300
|
-
translate: function(x,
|
|
11301
|
-
return x === 0 &
|
|
11297
|
+
translate: function(x, y) {
|
|
11298
|
+
return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
|
11302
11299
|
},
|
|
11303
11300
|
apply: function(point) {
|
|
11304
11301
|
return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
|
@@ -11306,8 +11303,8 @@ Transform.prototype = {
|
|
|
11306
11303
|
applyX: function(x) {
|
|
11307
11304
|
return x * this.k + this.x;
|
|
11308
11305
|
},
|
|
11309
|
-
applyY: function(
|
|
11310
|
-
return
|
|
11306
|
+
applyY: function(y) {
|
|
11307
|
+
return y * this.k + this.y;
|
|
11311
11308
|
},
|
|
11312
11309
|
invert: function(location) {
|
|
11313
11310
|
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
|
@@ -11315,14 +11312,14 @@ Transform.prototype = {
|
|
|
11315
11312
|
invertX: function(x) {
|
|
11316
11313
|
return (x - this.x) / this.k;
|
|
11317
11314
|
},
|
|
11318
|
-
invertY: function(
|
|
11319
|
-
return (
|
|
11315
|
+
invertY: function(y) {
|
|
11316
|
+
return (y - this.y) / this.k;
|
|
11320
11317
|
},
|
|
11321
11318
|
rescaleX: function(x) {
|
|
11322
11319
|
return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
|
11323
11320
|
},
|
|
11324
|
-
rescaleY: function(
|
|
11325
|
-
return
|
|
11321
|
+
rescaleY: function(y) {
|
|
11322
|
+
return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
|
11326
11323
|
},
|
|
11327
11324
|
toString: function() {
|
|
11328
11325
|
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
@@ -11383,19 +11380,19 @@ function zoom() {
|
|
|
11383
11380
|
var e2 = extent.apply(this, arguments), t0 = this.__zoom, p0 = p == null ? centroid(e2) : typeof p == "function" ? p.apply(this, arguments) : p, p1 = t0.invert(p0), k1 = typeof k == "function" ? k.apply(this, arguments) : k;
|
|
11384
11381
|
return constrain(translate(scale2(t0, k1), p0, p1), e2, translateExtent);
|
|
11385
11382
|
}, p, event);
|
|
11386
|
-
}, zoom2.translateBy = function(selection2, x,
|
|
11383
|
+
}, zoom2.translateBy = function(selection2, x, y, event) {
|
|
11387
11384
|
zoom2.transform(selection2, function() {
|
|
11388
11385
|
return constrain(this.__zoom.translate(
|
|
11389
11386
|
typeof x == "function" ? x.apply(this, arguments) : x,
|
|
11390
|
-
typeof
|
|
11387
|
+
typeof y == "function" ? y.apply(this, arguments) : y
|
|
11391
11388
|
), extent.apply(this, arguments), translateExtent);
|
|
11392
11389
|
}, null, event);
|
|
11393
|
-
}, zoom2.translateTo = function(selection2, x,
|
|
11390
|
+
}, zoom2.translateTo = function(selection2, x, y, p, event) {
|
|
11394
11391
|
zoom2.transform(selection2, function() {
|
|
11395
11392
|
var e2 = extent.apply(this, arguments), t2 = this.__zoom, p0 = p == null ? centroid(e2) : typeof p == "function" ? p.apply(this, arguments) : p;
|
|
11396
11393
|
return constrain(identity$1.translate(p0[0], p0[1]).scale(t2.k).translate(
|
|
11397
11394
|
typeof x == "function" ? -x.apply(this, arguments) : -x,
|
|
11398
|
-
typeof
|
|
11395
|
+
typeof y == "function" ? -y.apply(this, arguments) : -y
|
|
11399
11396
|
), e2, translateExtent);
|
|
11400
11397
|
}, p, event);
|
|
11401
11398
|
};
|
|
@@ -11403,8 +11400,8 @@ function zoom() {
|
|
|
11403
11400
|
return k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)), k === transform2.k ? transform2 : new Transform(k, transform2.x, transform2.y);
|
|
11404
11401
|
}
|
|
11405
11402
|
function translate(transform2, p0, p1) {
|
|
11406
|
-
var x = p0[0] - p1[0] * transform2.k,
|
|
11407
|
-
return x === transform2.x &&
|
|
11403
|
+
var x = p0[0] - p1[0] * transform2.k, y = p0[1] - p1[1] * transform2.k;
|
|
11404
|
+
return x === transform2.x && y === transform2.y ? transform2 : new Transform(transform2.k, x, y);
|
|
11408
11405
|
}
|
|
11409
11406
|
function centroid(extent2) {
|
|
11410
11407
|
return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
|
|
@@ -11419,8 +11416,8 @@ function zoom() {
|
|
|
11419
11416
|
return function(t2) {
|
|
11420
11417
|
if (t2 === 1) t2 = b;
|
|
11421
11418
|
else {
|
|
11422
|
-
var
|
|
11423
|
-
t2 = new Transform(k, p[0] -
|
|
11419
|
+
var l = i2(t2), k = w / l[2];
|
|
11420
|
+
t2 = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k);
|
|
11424
11421
|
}
|
|
11425
11422
|
g.zoom(null, t2);
|
|
11426
11423
|
};
|
|
@@ -11446,7 +11443,7 @@ function zoom() {
|
|
|
11446
11443
|
return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
|
11447
11444
|
},
|
|
11448
11445
|
emit: function(type) {
|
|
11449
|
-
var
|
|
11446
|
+
var d = select(this.that).datum();
|
|
11450
11447
|
listeners.call(
|
|
11451
11448
|
type,
|
|
11452
11449
|
this.that,
|
|
@@ -11456,7 +11453,7 @@ function zoom() {
|
|
|
11456
11453
|
transform: this.that.__zoom,
|
|
11457
11454
|
dispatch: listeners
|
|
11458
11455
|
}),
|
|
11459
|
-
|
|
11456
|
+
d
|
|
11460
11457
|
);
|
|
11461
11458
|
}
|
|
11462
11459
|
};
|
|
@@ -11507,15 +11504,15 @@ function zoom() {
|
|
|
11507
11504
|
}
|
|
11508
11505
|
function touchmoved(event, ...args) {
|
|
11509
11506
|
if (this.__zooming) {
|
|
11510
|
-
var g = gesture(this, args).event(event), touches = event.changedTouches, n2 = touches.length, i2, t2, p,
|
|
11507
|
+
var g = gesture(this, args).event(event), touches = event.changedTouches, n2 = touches.length, i2, t2, p, l;
|
|
11511
11508
|
for (noevent(event), i2 = 0; i2 < n2; ++i2)
|
|
11512
11509
|
t2 = touches[i2], p = pointer(t2, this), g.touch0 && g.touch0[2] === t2.identifier ? g.touch0[0] = p : g.touch1 && g.touch1[2] === t2.identifier && (g.touch1[0] = p);
|
|
11513
11510
|
if (t2 = g.that.__zoom, g.touch1) {
|
|
11514
11511
|
var p0 = g.touch0[0], l0 = g.touch0[1], p1 = g.touch1[0], l1 = g.touch1[1], dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
|
|
11515
|
-
t2 = scale2(t2, Math.sqrt(dp / dl)), p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2],
|
|
11516
|
-
} else if (g.touch0) p = g.touch0[0],
|
|
11512
|
+
t2 = scale2(t2, Math.sqrt(dp / dl)), p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2], l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
|
|
11513
|
+
} else if (g.touch0) p = g.touch0[0], l = g.touch0[1];
|
|
11517
11514
|
else return;
|
|
11518
|
-
g.zoom("touch", constrain(translate(t2, p,
|
|
11515
|
+
g.zoom("touch", constrain(translate(t2, p, l), g.extent, translateExtent));
|
|
11519
11516
|
}
|
|
11520
11517
|
}
|
|
11521
11518
|
function touchended(event, ...args) {
|
|
@@ -11581,7 +11578,7 @@ const errorMessages = {
|
|
|
11581
11578
|
], elementSelectionKeys = ["Enter", " ", "Escape"], defaultAriaLabelConfig = {
|
|
11582
11579
|
"node.a11yDescription.default": "Press enter or space to select a node. Press delete to remove it and escape to cancel.",
|
|
11583
11580
|
"node.a11yDescription.keyboardDisabled": "Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.",
|
|
11584
|
-
"node.a11yDescription.ariaLiveMessage": ({ direction, x, y
|
|
11581
|
+
"node.a11yDescription.ariaLiveMessage": ({ direction, x, y }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`,
|
|
11585
11582
|
"edge.a11yDescription.default": "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.",
|
|
11586
11583
|
// Control elements
|
|
11587
11584
|
"controls.ariaLabel": "Control Panel",
|
|
@@ -11769,31 +11766,31 @@ const calcAutoPanVelocity = (value, min2, max2) => value < min2 ? clamp(Math.abs
|
|
|
11769
11766
|
y: Math.min(box1.y, box2.y),
|
|
11770
11767
|
x2: Math.max(box1.x2, box2.x2),
|
|
11771
11768
|
y2: Math.max(box1.y2, box2.y2)
|
|
11772
|
-
}), rectToBox = ({ x, y
|
|
11769
|
+
}), rectToBox = ({ x, y, width, height }) => ({
|
|
11773
11770
|
x,
|
|
11774
|
-
y
|
|
11771
|
+
y,
|
|
11775
11772
|
x2: x + width,
|
|
11776
|
-
y2:
|
|
11777
|
-
}), boxToRect = ({ x, y
|
|
11773
|
+
y2: y + height
|
|
11774
|
+
}), boxToRect = ({ x, y, x2, y2 }) => ({
|
|
11778
11775
|
x,
|
|
11779
|
-
y
|
|
11776
|
+
y,
|
|
11780
11777
|
width: x2 - x,
|
|
11781
|
-
height:
|
|
11778
|
+
height: y2 - y
|
|
11782
11779
|
}), nodeToRect = (node, nodeOrigin = [0, 0]) => {
|
|
11783
|
-
const { x, y
|
|
11780
|
+
const { x, y } = isInternalNodeBase(node) ? node.internals.positionAbsolute : getNodePositionWithOrigin(node, nodeOrigin);
|
|
11784
11781
|
return {
|
|
11785
11782
|
x,
|
|
11786
|
-
y
|
|
11783
|
+
y,
|
|
11787
11784
|
width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,
|
|
11788
11785
|
height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0
|
|
11789
11786
|
};
|
|
11790
11787
|
}, nodeToBox = (node, nodeOrigin = [0, 0]) => {
|
|
11791
|
-
const { x, y
|
|
11788
|
+
const { x, y } = isInternalNodeBase(node) ? node.internals.positionAbsolute : getNodePositionWithOrigin(node, nodeOrigin);
|
|
11792
11789
|
return {
|
|
11793
11790
|
x,
|
|
11794
|
-
y
|
|
11791
|
+
y,
|
|
11795
11792
|
x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0),
|
|
11796
|
-
y2:
|
|
11793
|
+
y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0)
|
|
11797
11794
|
};
|
|
11798
11795
|
}, getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2))), getOverlappingArea = (rectA, rectB) => {
|
|
11799
11796
|
const xOverlap = Math.max(0, Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - Math.max(rectA.x, rectB.x)), yOverlap = Math.max(0, Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - Math.max(rectA.y, rectB.y));
|
|
@@ -11802,15 +11799,15 @@ const calcAutoPanVelocity = (value, min2, max2) => value < min2 ? clamp(Math.abs
|
|
|
11802
11799
|
}, snapPosition = (position, snapGrid = [1, 1]) => ({
|
|
11803
11800
|
x: snapGrid[0] * Math.round(position.x / snapGrid[0]),
|
|
11804
11801
|
y: snapGrid[1] * Math.round(position.y / snapGrid[1])
|
|
11805
|
-
}), pointToRendererPoint = ({ x, y
|
|
11802
|
+
}), pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = !1, snapGrid = [1, 1]) => {
|
|
11806
11803
|
const position = {
|
|
11807
11804
|
x: (x - tx) / tScale,
|
|
11808
|
-
y: (
|
|
11805
|
+
y: (y - ty) / tScale
|
|
11809
11806
|
};
|
|
11810
11807
|
return snapToGrid ? snapPosition(position, snapGrid) : position;
|
|
11811
|
-
}, rendererPointToPoint = ({ x, y
|
|
11808
|
+
}, rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => ({
|
|
11812
11809
|
x: x * tScale + tx,
|
|
11813
|
-
y:
|
|
11810
|
+
y: y * tScale + ty
|
|
11814
11811
|
});
|
|
11815
11812
|
function parsePadding(padding, viewport) {
|
|
11816
11813
|
if (typeof padding == "number")
|
|
@@ -11845,8 +11842,8 @@ function parsePaddings(padding, width, height) {
|
|
|
11845
11842
|
}
|
|
11846
11843
|
return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };
|
|
11847
11844
|
}
|
|
11848
|
-
function calculateAppliedPaddings(bounds, x,
|
|
11849
|
-
const { x: left, y: top } = rendererPointToPoint(bounds, [x,
|
|
11845
|
+
function calculateAppliedPaddings(bounds, x, y, zoom2, width, height) {
|
|
11846
|
+
const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom2]), { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom2]), right = width - boundRight, bottom = height - boundBottom;
|
|
11850
11847
|
return {
|
|
11851
11848
|
left: Math.floor(left),
|
|
11852
11849
|
top: Math.floor(top),
|
|
@@ -11855,7 +11852,7 @@ function calculateAppliedPaddings(bounds, x, y2, zoom2, width, height) {
|
|
|
11855
11852
|
};
|
|
11856
11853
|
}
|
|
11857
11854
|
const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {
|
|
11858
|
-
const p = parsePaddings(padding, width, height), xZoom = (width - p.x) / bounds.width, yZoom = (height - p.y) / bounds.height, zoom2 = Math.min(xZoom, yZoom), clampedZoom = clamp(zoom2, minZoom, maxZoom), boundsCenterX = bounds.x + bounds.width / 2, boundsCenterY = bounds.y + bounds.height / 2, x = width / 2 - boundsCenterX * clampedZoom,
|
|
11855
|
+
const p = parsePaddings(padding, width, height), xZoom = (width - p.x) / bounds.width, yZoom = (height - p.y) / bounds.height, zoom2 = Math.min(xZoom, yZoom), clampedZoom = clamp(zoom2, minZoom, maxZoom), boundsCenterX = bounds.x + bounds.width / 2, boundsCenterY = bounds.y + bounds.height / 2, x = width / 2 - boundsCenterX * clampedZoom, y = height / 2 - boundsCenterY * clampedZoom, newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height), offset2 = {
|
|
11859
11856
|
left: Math.min(newPadding.left - p.left, 0),
|
|
11860
11857
|
top: Math.min(newPadding.top - p.top, 0),
|
|
11861
11858
|
right: Math.min(newPadding.right - p.right, 0),
|
|
@@ -11863,7 +11860,7 @@ const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding)
|
|
|
11863
11860
|
};
|
|
11864
11861
|
return {
|
|
11865
11862
|
x: x - offset2.left + offset2.right,
|
|
11866
|
-
y:
|
|
11863
|
+
y: y - offset2.top + offset2.bottom,
|
|
11867
11864
|
zoom: clampedZoom
|
|
11868
11865
|
};
|
|
11869
11866
|
}, isMacOs = () => typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0;
|
|
@@ -11905,7 +11902,7 @@ function mergeAriaLabelConfig(partial) {
|
|
|
11905
11902
|
return { ...defaultAriaLabelConfig, ...partial || {} };
|
|
11906
11903
|
}
|
|
11907
11904
|
function getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = !1, transform: transform2, containerBounds }) {
|
|
11908
|
-
const { x, y
|
|
11905
|
+
const { x, y } = getEventPosition(event), pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform2), { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;
|
|
11909
11906
|
return {
|
|
11910
11907
|
xSnapped,
|
|
11911
11908
|
ySnapped,
|
|
@@ -12086,15 +12083,15 @@ function getPoints({ source, sourcePosition = Position.Bottom, target, targetPos
|
|
|
12086
12083
|
], centerX, centerY, defaultOffsetX, defaultOffsetY];
|
|
12087
12084
|
}
|
|
12088
12085
|
function getBend(a, b, c, size2) {
|
|
12089
|
-
const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size2), { x, y
|
|
12090
|
-
if (a.x === x && x === c.x || a.y ===
|
|
12091
|
-
return `L${x} ${
|
|
12092
|
-
if (a.y ===
|
|
12086
|
+
const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size2), { x, y } = b;
|
|
12087
|
+
if (a.x === x && x === c.x || a.y === y && y === c.y)
|
|
12088
|
+
return `L${x} ${y}`;
|
|
12089
|
+
if (a.y === y) {
|
|
12093
12090
|
const xDir2 = a.x < c.x ? -1 : 1, yDir2 = a.y < c.y ? 1 : -1;
|
|
12094
|
-
return `L ${x + bendSize * xDir2},${
|
|
12091
|
+
return `L ${x + bendSize * xDir2},${y}Q ${x},${y} ${x},${y + bendSize * yDir2}`;
|
|
12095
12092
|
}
|
|
12096
12093
|
const xDir = a.x < c.x ? 1 : -1, yDir = a.y < c.y ? -1 : 1;
|
|
12097
|
-
return `L ${x},${
|
|
12094
|
+
return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`;
|
|
12098
12095
|
}
|
|
12099
12096
|
function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius: borderRadius2 = 5, centerX, centerY, offset: offset2 = 20, stepPosition = 0.5 }) {
|
|
12100
12097
|
const [points, labelX, labelY, offsetX, offsetY] = getPoints({
|
|
@@ -12151,22 +12148,22 @@ function toHandleBounds(handles) {
|
|
|
12151
12148
|
};
|
|
12152
12149
|
}
|
|
12153
12150
|
function getHandlePosition(node, handle, fallbackPosition = Position.Left, center = !1) {
|
|
12154
|
-
const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x,
|
|
12151
|
+
const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x, y = (handle?.y ?? 0) + node.internals.positionAbsolute.y, { width, height } = handle ?? getNodeDimensions(node);
|
|
12155
12152
|
if (center)
|
|
12156
|
-
return { x: x + width / 2, y:
|
|
12153
|
+
return { x: x + width / 2, y: y + height / 2 };
|
|
12157
12154
|
switch (handle?.position ?? fallbackPosition) {
|
|
12158
12155
|
case Position.Top:
|
|
12159
|
-
return { x: x + width / 2, y
|
|
12156
|
+
return { x: x + width / 2, y };
|
|
12160
12157
|
case Position.Right:
|
|
12161
|
-
return { x: x + width, y:
|
|
12158
|
+
return { x: x + width, y: y + height / 2 };
|
|
12162
12159
|
case Position.Bottom:
|
|
12163
|
-
return { x: x + width / 2, y:
|
|
12160
|
+
return { x: x + width / 2, y: y + height };
|
|
12164
12161
|
case Position.Left:
|
|
12165
|
-
return { x, y:
|
|
12162
|
+
return { x, y: y + height / 2 };
|
|
12166
12163
|
}
|
|
12167
12164
|
}
|
|
12168
12165
|
function getHandle$1(bounds, handleId) {
|
|
12169
|
-
return bounds && (handleId ? bounds.find((
|
|
12166
|
+
return bounds && (handleId ? bounds.find((d) => d.id === handleId) : bounds[0]) || null;
|
|
12170
12167
|
}
|
|
12171
12168
|
function getMarkerId(marker, id2) {
|
|
12172
12169
|
return marker ? typeof marker == "string" ? marker : `${id2 ? `${id2}__` : ""}${Object.keys(marker).sort().map((key) => `${key}=${marker[key]}`).join("&")}` : "";
|
|
@@ -12275,12 +12272,12 @@ function updateChildNode(node, nodeLookup, parentLookup, options) {
|
|
|
12275
12272
|
return;
|
|
12276
12273
|
}
|
|
12277
12274
|
updateParentLookup(node, parentLookup);
|
|
12278
|
-
const selectedNodeZ = elevateNodesOnSelect ? 1e3 : 0, { x, y
|
|
12275
|
+
const selectedNodeZ = elevateNodesOnSelect ? 1e3 : 0, { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ), { positionAbsolute } = node.internals, positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y;
|
|
12279
12276
|
(positionChanged || z !== node.internals.z) && nodeLookup.set(node.id, {
|
|
12280
12277
|
...node,
|
|
12281
12278
|
internals: {
|
|
12282
12279
|
...node.internals,
|
|
12283
|
-
positionAbsolute: positionChanged ? { x, y
|
|
12280
|
+
positionAbsolute: positionChanged ? { x, y } : positionAbsolute,
|
|
12284
12281
|
z
|
|
12285
12282
|
}
|
|
12286
12283
|
});
|
|
@@ -12488,13 +12485,13 @@ function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = !0 })
|
|
|
12488
12485
|
nodesFromDragItems
|
|
12489
12486
|
];
|
|
12490
12487
|
}
|
|
12491
|
-
function calculateSnapOffset({ dragItems, snapGrid, x, y
|
|
12488
|
+
function calculateSnapOffset({ dragItems, snapGrid, x, y }) {
|
|
12492
12489
|
const refDragItem = dragItems.values().next().value;
|
|
12493
12490
|
if (!refDragItem)
|
|
12494
12491
|
return null;
|
|
12495
12492
|
const refPos = {
|
|
12496
12493
|
x: x - refDragItem.distance.x,
|
|
12497
|
-
y:
|
|
12494
|
+
y: y - refDragItem.distance.y
|
|
12498
12495
|
}, refPosSnapped = snapPosition(refPos, snapGrid);
|
|
12499
12496
|
return {
|
|
12500
12497
|
x: refPosSnapped.x - refPos.x,
|
|
@@ -12505,30 +12502,30 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
12505
12502
|
let lastPos = { x: null, y: null }, autoPanId = 0, dragItems = /* @__PURE__ */ new Map(), autoPanStarted = !1, mousePosition = { x: 0, y: 0 }, containerBounds = null, dragStarted = !1, d3Selection = null, abortDrag = !1, nodePositionsChanged = !1, dragEvent = null;
|
|
12506
12503
|
function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0 }) {
|
|
12507
12504
|
d3Selection = select(domNode);
|
|
12508
|
-
function updateNodes({ x, y
|
|
12505
|
+
function updateNodes({ x, y }) {
|
|
12509
12506
|
const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions } = getStoreItems();
|
|
12510
|
-
lastPos = { x, y
|
|
12507
|
+
lastPos = { x, y };
|
|
12511
12508
|
let hasChange = !1;
|
|
12512
12509
|
const isMultiDrag = dragItems.size > 1, nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null, multiDragSnapOffset = isMultiDrag && snapToGrid ? calculateSnapOffset({
|
|
12513
12510
|
dragItems,
|
|
12514
12511
|
snapGrid,
|
|
12515
12512
|
x,
|
|
12516
|
-
y
|
|
12513
|
+
y
|
|
12517
12514
|
}) : null;
|
|
12518
12515
|
for (const [id2, dragItem] of dragItems) {
|
|
12519
12516
|
if (!nodeLookup.has(id2))
|
|
12520
12517
|
continue;
|
|
12521
|
-
let nextPosition = { x: x - dragItem.distance.x, y:
|
|
12518
|
+
let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };
|
|
12522
12519
|
snapToGrid && (nextPosition = multiDragSnapOffset ? {
|
|
12523
12520
|
x: Math.round(nextPosition.x + multiDragSnapOffset.x),
|
|
12524
12521
|
y: Math.round(nextPosition.y + multiDragSnapOffset.y)
|
|
12525
12522
|
} : snapPosition(nextPosition, snapGrid));
|
|
12526
12523
|
let adjustedNodeExtent = null;
|
|
12527
12524
|
if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {
|
|
12528
|
-
const { positionAbsolute: positionAbsolute2 } = dragItem.internals, x1 = positionAbsolute2.x - nodesBox.x + nodeExtent[0][0], x2 = positionAbsolute2.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0], y1 = positionAbsolute2.y - nodesBox.y + nodeExtent[0][1],
|
|
12525
|
+
const { positionAbsolute: positionAbsolute2 } = dragItem.internals, x1 = positionAbsolute2.x - nodesBox.x + nodeExtent[0][0], x2 = positionAbsolute2.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0], y1 = positionAbsolute2.y - nodesBox.y + nodeExtent[0][1], y2 = positionAbsolute2.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1];
|
|
12529
12526
|
adjustedNodeExtent = [
|
|
12530
12527
|
[x1, y1],
|
|
12531
|
-
[x2,
|
|
12528
|
+
[x2, y2]
|
|
12532
12529
|
];
|
|
12533
12530
|
}
|
|
12534
12531
|
const { position, positionAbsolute } = calculateNodePosition({
|
|
@@ -12582,8 +12579,8 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
12582
12579
|
if (dragEvent = event.sourceEvent, (event.sourceEvent.type === "touchmove" && event.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
12583
12580
|
nodeId && !nodeLookup.has(nodeId)) && (abortDrag = !0), !abortDrag) {
|
|
12584
12581
|
if (!autoPanStarted && autoPanOnNodeDrag && dragStarted && (autoPanStarted = !0, autoPan()), !dragStarted) {
|
|
12585
|
-
const x = pointerPos.xSnapped - (lastPos.x ?? 0),
|
|
12586
|
-
Math.sqrt(x * x +
|
|
12582
|
+
const x = pointerPos.xSnapped - (lastPos.x ?? 0), y = pointerPos.ySnapped - (lastPos.y ?? 0);
|
|
12583
|
+
Math.sqrt(x * x + y * y) > nodeDragThreshold && startDrag(event);
|
|
12587
12584
|
}
|
|
12588
12585
|
(lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted && (mousePosition = getEventPosition(event.sourceEvent, containerBounds), updateNodes(pointerPos));
|
|
12589
12586
|
}
|
|
@@ -12634,8 +12631,8 @@ function getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {
|
|
|
12634
12631
|
for (const handle of allHandles) {
|
|
12635
12632
|
if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id)
|
|
12636
12633
|
continue;
|
|
12637
|
-
const { x, y
|
|
12638
|
-
distance2 > connectionRadius || (distance2 < minDistance ? (closestHandles = [{ ...handle, x, y
|
|
12634
|
+
const { x, y } = getHandlePosition(node, handle, handle.position, !0), distance2 = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2));
|
|
12635
|
+
distance2 > connectionRadius || (distance2 < minDistance ? (closestHandles = [{ ...handle, x, y }], minDistance = distance2) : distance2 === minDistance && closestHandles.push({ ...handle, x, y }));
|
|
12639
12636
|
}
|
|
12640
12637
|
}
|
|
12641
12638
|
if (!closestHandles.length)
|
|
@@ -12664,7 +12661,7 @@ const alwaysValid = () => !0;
|
|
|
12664
12661
|
function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy: panBy2, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode }) {
|
|
12665
12662
|
const doc = getHostForElement(event.target);
|
|
12666
12663
|
let autoPanId = 0, closestHandle;
|
|
12667
|
-
const { x, y
|
|
12664
|
+
const { x, y } = getEventPosition(event), handleType = getHandleType(edgeUpdaterType, handleDomNode), containerBounds = domNode?.getBoundingClientRect();
|
|
12668
12665
|
let connectionStarted = !1;
|
|
12669
12666
|
if (!containerBounds || !handleType)
|
|
12670
12667
|
return;
|
|
@@ -12675,8 +12672,8 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12675
12672
|
function autoPan() {
|
|
12676
12673
|
if (!autoPanOnConnect || !containerBounds)
|
|
12677
12674
|
return;
|
|
12678
|
-
const [x2,
|
|
12679
|
-
panBy2({ x: x2, y:
|
|
12675
|
+
const [x2, y2] = calcAutoPan(position, containerBounds, autoPanSpeed);
|
|
12676
|
+
panBy2({ x: x2, y: y2 }), autoPanId = requestAnimationFrame(autoPan);
|
|
12680
12677
|
}
|
|
12681
12678
|
const fromHandle = {
|
|
12682
12679
|
...fromHandleInternal,
|
|
@@ -12702,7 +12699,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12702
12699
|
dragThreshold === 0 && startConnection();
|
|
12703
12700
|
function onPointerMove(event2) {
|
|
12704
12701
|
if (!connectionStarted) {
|
|
12705
|
-
const { x: evtX, y: evtY } = getEventPosition(event2), dx = evtX - x, dy = evtY -
|
|
12702
|
+
const { x: evtX, y: evtY } = getEventPosition(event2), dx = evtX - x, dy = evtY - y;
|
|
12706
12703
|
if (!(dx * dx + dy * dy > dragThreshold * dragThreshold))
|
|
12707
12704
|
return;
|
|
12708
12705
|
startConnection();
|
|
@@ -12751,7 +12748,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12751
12748
|
doc.addEventListener("mousemove", onPointerMove), doc.addEventListener("mouseup", onPointerUp), doc.addEventListener("touchmove", onPointerMove), doc.addEventListener("touchend", onPointerUp);
|
|
12752
12749
|
}
|
|
12753
12750
|
function isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup }) {
|
|
12754
|
-
const isTarget = fromType === "target", handleDomNode = handle ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`) : null, { x, y
|
|
12751
|
+
const isTarget = fromType === "target", handleDomNode = handle ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`) : null, { x, y } = getEventPosition(event), handleBelow = doc.elementFromPoint(x, y), handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode, result = {
|
|
12755
12752
|
handleDomNode: handleToCheck,
|
|
12756
12753
|
isValid: !1,
|
|
12757
12754
|
connection: null,
|
|
@@ -12829,7 +12826,7 @@ const viewChanged = (prevViewport, eventViewport) => prevViewport.x !== eventVie
|
|
|
12829
12826
|
x: transform2.x,
|
|
12830
12827
|
y: transform2.y,
|
|
12831
12828
|
zoom: transform2.k
|
|
12832
|
-
}), viewportToTransform = ({ x, y
|
|
12829
|
+
}), viewportToTransform = ({ x, y, zoom: zoom2 }) => identity$1.translate(x, y).scale(zoom2), isWrappedWithClass = (event, className) => event.target.closest(`.${className}`), isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2), defaultEase = (t2) => ((t2 *= 2) <= 1 ? t2 * t2 * t2 : (t2 -= 2) * t2 * t2 + 2) / 2, getD3Transition = (selection2, duration = 0, ease = defaultEase, onEnd = () => {
|
|
12833
12830
|
}) => {
|
|
12834
12831
|
const hasDuration = typeof duration == "number" && duration > 0;
|
|
12835
12832
|
return hasDuration || onEnd(), hasDuration ? selection2.transition().duration(duration).ease(ease).on("end", onEnd) : selection2;
|
|
@@ -12864,11 +12861,11 @@ function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection
|
|
|
12864
12861
|
};
|
|
12865
12862
|
}
|
|
12866
12863
|
function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {
|
|
12867
|
-
return function(event,
|
|
12864
|
+
return function(event, d) {
|
|
12868
12865
|
const isWheel = event.type === "wheel", preventZoom = !preventScrolling && isWheel && !event.ctrlKey, hasNoWheelClass = isWrappedWithClass(event, noWheelClassName);
|
|
12869
12866
|
if (event.ctrlKey && isWheel && hasNoWheelClass && event.preventDefault(), preventZoom || hasNoWheelClass)
|
|
12870
12867
|
return null;
|
|
12871
|
-
event.preventDefault(), d3ZoomHandler.call(this, event,
|
|
12868
|
+
event.preventDefault(), d3ZoomHandler.call(this, event, d);
|
|
12872
12869
|
};
|
|
12873
12870
|
}
|
|
12874
12871
|
function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) {
|
|
@@ -13118,12 +13115,12 @@ function getDimensionsAfterResize(startValues, controlDirection, pointerPosition
|
|
|
13118
13115
|
}
|
|
13119
13116
|
}
|
|
13120
13117
|
distY = distY + (distY < 0 ? clampY : -clampY), distX = distX + (distX < 0 ? clampX : -clampX), keepAspectRatio && (isDiagonal ? newWidth > newHeight * aspectRatio ? distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio : distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio : isHorizontal ? (distY = distX / aspectRatio, affectsY = affectsX) : (distX = distY * aspectRatio, affectsX = affectsY));
|
|
13121
|
-
const x = affectsX ? startX + distX : startX,
|
|
13118
|
+
const x = affectsX ? startX + distX : startX, y = affectsY ? startY + distY : startY;
|
|
13122
13119
|
return {
|
|
13123
13120
|
width: startWidth + (affectsX ? -distX : distX),
|
|
13124
13121
|
height: startHeight + (affectsY ? -distY : distY),
|
|
13125
13122
|
x: nodeOrigin[0] * distX * (affectsX ? -1 : 1) + x,
|
|
13126
|
-
y: nodeOrigin[1] * distY * (affectsY ? -1 : 1) +
|
|
13123
|
+
y: nodeOrigin[1] * distY * (affectsY ? -1 : 1) + y
|
|
13127
13124
|
};
|
|
13128
13125
|
}
|
|
13129
13126
|
const initPrevValues$1 = { width: 0, height: 0, x: 0, y: 0 }, initStartValues = {
|
|
@@ -13139,10 +13136,10 @@ function nodeToParentExtent(node) {
|
|
|
13139
13136
|
];
|
|
13140
13137
|
}
|
|
13141
13138
|
function nodeToChildExtent(child, parent, nodeOrigin) {
|
|
13142
|
-
const x = parent.position.x + child.position.x,
|
|
13139
|
+
const x = parent.position.x + child.position.x, y = parent.position.y + child.position.y, width = child.measured.width ?? 0, height = child.measured.height ?? 0, originOffsetX = nodeOrigin[0] * width, originOffsetY = nodeOrigin[1] * height;
|
|
13143
13140
|
return [
|
|
13144
|
-
[x - originOffsetX,
|
|
13145
|
-
[x + width - originOffsetX,
|
|
13141
|
+
[x - originOffsetX, y - originOffsetY],
|
|
13142
|
+
[x + width - originOffsetX, y + height - originOffsetY]
|
|
13146
13143
|
];
|
|
13147
13144
|
}
|
|
13148
13145
|
function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
@@ -13195,11 +13192,11 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
13195
13192
|
}), childChanges = [];
|
|
13196
13193
|
if (!node)
|
|
13197
13194
|
return;
|
|
13198
|
-
const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues, change = {}, nodeOrigin = node.origin ?? storeNodeOrigin, { width, height, x, y
|
|
13195
|
+
const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues, change = {}, nodeOrigin = node.origin ?? storeNodeOrigin, { width, height, x, y } = getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, parentExtent, childExtent), isWidthChange = width !== prevWidth, isHeightChange = height !== prevHeight, isXPosChange = x !== prevX && isWidthChange, isYPosChange = y !== prevY && isHeightChange;
|
|
13199
13196
|
if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange)
|
|
13200
13197
|
return;
|
|
13201
|
-
if ((isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) && (change.x = isXPosChange ? x : prevValues.x, change.y = isYPosChange ?
|
|
13202
|
-
const xChange = x - prevX, yChange =
|
|
13198
|
+
if ((isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) && (change.x = isXPosChange ? x : prevValues.x, change.y = isYPosChange ? y : prevValues.y, prevValues.x = change.x, prevValues.y = change.y, childNodes.length > 0)) {
|
|
13199
|
+
const xChange = x - prevX, yChange = y - prevY;
|
|
13203
13200
|
for (const childNode of childNodes)
|
|
13204
13201
|
childNode.position = {
|
|
13205
13202
|
x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth),
|
|
@@ -13252,8 +13249,8 @@ function requireUseSyncExternalStoreShim_production() {
|
|
|
13252
13249
|
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
13253
13250
|
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
13254
13251
|
var React2 = React__default;
|
|
13255
|
-
function is(x,
|
|
13256
|
-
return x ===
|
|
13252
|
+
function is(x, y) {
|
|
13253
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
13257
13254
|
}
|
|
13258
13255
|
var objectIs = typeof Object.is == "function" ? Object.is : is, useState2 = React2.useState, useEffect2 = React2.useEffect, useLayoutEffect2 = React2.useLayoutEffect, useDebugValue2 = React2.useDebugValue;
|
|
13259
13256
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
@@ -13306,8 +13303,8 @@ function requireWithSelector_production() {
|
|
|
13306
13303
|
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
13307
13304
|
hasRequiredWithSelector_production = 1;
|
|
13308
13305
|
var React2 = React__default, shim2 = requireShim();
|
|
13309
|
-
function is(x,
|
|
13310
|
-
return x ===
|
|
13306
|
+
function is(x, y) {
|
|
13307
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
13311
13308
|
}
|
|
13312
13309
|
var objectIs = typeof Object.is == "function" ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React2.useRef, useEffect2 = React2.useEffect, useMemo2 = React2.useMemo, useDebugValue2 = React2.useDebugValue;
|
|
13313
13310
|
return withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector2, isEqual2) {
|
|
@@ -13440,7 +13437,7 @@ const style$1 = { display: "none" }, ariaLiveStyle = {
|
|
|
13440
13437
|
overflow: "hidden",
|
|
13441
13438
|
clip: "rect(0px, 0px, 0px, 0px)",
|
|
13442
13439
|
clipPath: "inset(100%)"
|
|
13443
|
-
}, ARIA_NODE_DESC_KEY = "react-flow__node-desc", ARIA_EDGE_DESC_KEY = "react-flow__edge-desc", ARIA_LIVE_MESSAGE = "react-flow__aria-live", ariaLiveSelector = (
|
|
13440
|
+
}, ARIA_NODE_DESC_KEY = "react-flow__node-desc", ARIA_EDGE_DESC_KEY = "react-flow__edge-desc", ARIA_LIVE_MESSAGE = "react-flow__aria-live", ariaLiveSelector = (s) => s.ariaLiveMessage, ariaLabelConfigSelector = (s) => s.ariaLabelConfig;
|
|
13444
13441
|
function AriaLiveMessage({ rfId }) {
|
|
13445
13442
|
const ariaLiveMessage = useStore(ariaLiveSelector);
|
|
13446
13443
|
return jsx("div", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, "aria-live": "assertive", "aria-atomic": "true", style: ariaLiveStyle, children: ariaLiveMessage });
|
|
@@ -13457,11 +13454,11 @@ Panel.displayName = "Panel";
|
|
|
13457
13454
|
function Attribution({ proOptions, position = "bottom-right" }) {
|
|
13458
13455
|
return proOptions?.hideAttribution ? null : jsx(Panel, { position, className: "react-flow__attribution", "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev", children: jsx("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution", children: "React Flow" }) });
|
|
13459
13456
|
}
|
|
13460
|
-
const selector$m = (
|
|
13457
|
+
const selector$m = (s) => {
|
|
13461
13458
|
const selectedNodes = [], selectedEdges = [];
|
|
13462
|
-
for (const [, node] of
|
|
13459
|
+
for (const [, node] of s.nodeLookup)
|
|
13463
13460
|
node.selected && selectedNodes.push(node.internals.userNode);
|
|
13464
|
-
for (const [, edge] of
|
|
13461
|
+
for (const [, edge] of s.edgeLookup)
|
|
13465
13462
|
edge.selected && selectedEdges.push(edge);
|
|
13466
13463
|
return { selectedNodes, selectedEdges };
|
|
13467
13464
|
}, selectId = (obj) => obj.id;
|
|
@@ -13475,7 +13472,7 @@ function SelectionListenerInner({ onSelectionChange }) {
|
|
|
13475
13472
|
onSelectionChange?.(params), store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params));
|
|
13476
13473
|
}, [selectedNodes, selectedEdges, onSelectionChange]), null;
|
|
13477
13474
|
}
|
|
13478
|
-
const changeSelector = (
|
|
13475
|
+
const changeSelector = (s) => !!s.onSelectionChangeHandlers;
|
|
13479
13476
|
function SelectionListener({ onSelectionChange }) {
|
|
13480
13477
|
const storeHasSelectionChangeHandlers = useStore(changeSelector);
|
|
13481
13478
|
return onSelectionChange || storeHasSelectionChangeHandlers ? jsx(SelectionListenerInner, { onSelectionChange }) : null;
|
|
@@ -13539,16 +13536,16 @@ const defaultNodeOrigin = [0, 0], defaultViewport = { x: 0, y: 0, zoom: 1 }, rea
|
|
|
13539
13536
|
"autoPanSpeed",
|
|
13540
13537
|
"paneClickDistance",
|
|
13541
13538
|
"ariaLabelConfig"
|
|
13542
|
-
], fieldsToTrack = [...reactFlowFieldsToTrack, "rfId"], selector$l = (
|
|
13543
|
-
setNodes:
|
|
13544
|
-
setEdges:
|
|
13545
|
-
setMinZoom:
|
|
13546
|
-
setMaxZoom:
|
|
13547
|
-
setTranslateExtent:
|
|
13548
|
-
setNodeExtent:
|
|
13549
|
-
reset:
|
|
13550
|
-
setDefaultNodesAndEdges:
|
|
13551
|
-
setPaneClickDistance:
|
|
13539
|
+
], fieldsToTrack = [...reactFlowFieldsToTrack, "rfId"], selector$l = (s) => ({
|
|
13540
|
+
setNodes: s.setNodes,
|
|
13541
|
+
setEdges: s.setEdges,
|
|
13542
|
+
setMinZoom: s.setMinZoom,
|
|
13543
|
+
setMaxZoom: s.setMaxZoom,
|
|
13544
|
+
setTranslateExtent: s.setTranslateExtent,
|
|
13545
|
+
setNodeExtent: s.setNodeExtent,
|
|
13546
|
+
reset: s.reset,
|
|
13547
|
+
setDefaultNodesAndEdges: s.setDefaultNodesAndEdges,
|
|
13548
|
+
setPaneClickDistance: s.setPaneClickDistance
|
|
13552
13549
|
}), initPrevValues = {
|
|
13553
13550
|
/*
|
|
13554
13551
|
* these are values that are also passed directly to other components
|
|
@@ -13666,10 +13663,10 @@ const useViewportHelper = () => {
|
|
|
13666
13663
|
}, options), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
13667
13664
|
},
|
|
13668
13665
|
getViewport: () => {
|
|
13669
|
-
const [x,
|
|
13670
|
-
return { x, y
|
|
13666
|
+
const [x, y, zoom2] = store.getState().transform;
|
|
13667
|
+
return { x, y, zoom: zoom2 };
|
|
13671
13668
|
},
|
|
13672
|
-
setCenter: async (x,
|
|
13669
|
+
setCenter: async (x, y, options) => store.getState().setCenter(x, y, options),
|
|
13673
13670
|
fitBounds: async (bounds, options) => {
|
|
13674
13671
|
const { width, height, minZoom, maxZoom, panZoom } = store.getState(), viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1);
|
|
13675
13672
|
return panZoom ? (await panZoom.setViewport(viewport, {
|
|
@@ -13843,7 +13840,7 @@ function useBatchContext() {
|
|
|
13843
13840
|
throw new Error("useBatchContext must be used within a BatchProvider");
|
|
13844
13841
|
return batchContext;
|
|
13845
13842
|
}
|
|
13846
|
-
const selector$k = (
|
|
13843
|
+
const selector$k = (s) => !!s.panZoom;
|
|
13847
13844
|
function useReactFlow() {
|
|
13848
13845
|
const viewportHelper = useViewportHelper(), store = useStoreApi(), batchContext = useBatchContext(), viewportInitialized = useStore(selector$k), generalHelper = useMemo(() => {
|
|
13849
13846
|
const getInternalNode = (id2) => store.getState().nodeLookup.get(id2), setNodes = (payload) => {
|
|
@@ -13895,13 +13892,13 @@ function useReactFlow() {
|
|
|
13895
13892
|
batchContext.edgeQueue.push((edges) => [...edges, ...newEdges]);
|
|
13896
13893
|
},
|
|
13897
13894
|
toObject: () => {
|
|
13898
|
-
const { nodes = [], edges = [], transform: transform2 } = store.getState(), [x,
|
|
13895
|
+
const { nodes = [], edges = [], transform: transform2 } = store.getState(), [x, y, zoom2] = transform2;
|
|
13899
13896
|
return {
|
|
13900
13897
|
nodes: nodes.map((n2) => ({ ...n2 })),
|
|
13901
13898
|
edges: edges.map((e2) => ({ ...e2 })),
|
|
13902
13899
|
viewport: {
|
|
13903
13900
|
x,
|
|
13904
|
-
y
|
|
13901
|
+
y,
|
|
13905
13902
|
zoom: zoom2
|
|
13906
13903
|
}
|
|
13907
13904
|
};
|
|
@@ -14009,9 +14006,9 @@ const containerStyle = {
|
|
|
14009
14006
|
height: "100%",
|
|
14010
14007
|
top: 0,
|
|
14011
14008
|
left: 0
|
|
14012
|
-
}, selector$j = (
|
|
14013
|
-
userSelectionActive:
|
|
14014
|
-
lib:
|
|
14009
|
+
}, selector$j = (s) => ({
|
|
14010
|
+
userSelectionActive: s.userSelectionActive,
|
|
14011
|
+
lib: s.lib
|
|
14015
14012
|
});
|
|
14016
14013
|
function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panOnScroll = !1, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = !0, panOnDrag = !0, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = !0, children: children2, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance }) {
|
|
14017
14014
|
const store = useStoreApi(), zoomPane = useRef(null), { userSelectionActive, lib } = useStore(selector$j, shallow$1), zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode), panZoom = useRef();
|
|
@@ -14042,10 +14039,10 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panO
|
|
|
14042
14039
|
onMoveEnd?.(event, vp), onViewportChangeEnd?.(vp);
|
|
14043
14040
|
}
|
|
14044
14041
|
});
|
|
14045
|
-
const { x, y
|
|
14042
|
+
const { x, y, zoom: zoom2 } = panZoom.current.getViewport();
|
|
14046
14043
|
return store.setState({
|
|
14047
14044
|
panZoom: panZoom.current,
|
|
14048
|
-
transform: [x,
|
|
14045
|
+
transform: [x, y, zoom2],
|
|
14049
14046
|
domNode: zoomPane.current.closest(".react-flow")
|
|
14050
14047
|
}), () => {
|
|
14051
14048
|
panZoom.current?.destroy();
|
|
@@ -14087,9 +14084,9 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panO
|
|
|
14087
14084
|
onTransformChange
|
|
14088
14085
|
]), jsx("div", { className: "react-flow__renderer", ref: zoomPane, style: containerStyle, children: children2 });
|
|
14089
14086
|
}
|
|
14090
|
-
const selector$i = (
|
|
14091
|
-
userSelectionActive:
|
|
14092
|
-
userSelectionRect:
|
|
14087
|
+
const selector$i = (s) => ({
|
|
14088
|
+
userSelectionActive: s.userSelectionActive,
|
|
14089
|
+
userSelectionRect: s.userSelectionRect
|
|
14093
14090
|
});
|
|
14094
14091
|
function UserSelection() {
|
|
14095
14092
|
const { userSelectionActive, userSelectionRect } = useStore(selector$i, shallow$1);
|
|
@@ -14101,11 +14098,11 @@ function UserSelection() {
|
|
|
14101
14098
|
}
|
|
14102
14099
|
const wrapHandler = (handler, containerRef) => (event) => {
|
|
14103
14100
|
event.target === containerRef.current && handler?.(event);
|
|
14104
|
-
}, selector$h = (
|
|
14105
|
-
userSelectionActive:
|
|
14106
|
-
elementsSelectable:
|
|
14107
|
-
connectionInProgress:
|
|
14108
|
-
dragging:
|
|
14101
|
+
}, selector$h = (s) => ({
|
|
14102
|
+
userSelectionActive: s.userSelectionActive,
|
|
14103
|
+
elementsSelectable: s.elementsSelectable,
|
|
14104
|
+
connectionInProgress: s.connection.inProgress,
|
|
14105
|
+
dragging: s.paneDragging
|
|
14109
14106
|
});
|
|
14110
14107
|
function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children: children2 }) {
|
|
14111
14108
|
const store = useStoreApi(), { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow$1), hasActiveSelection = elementsSelectable && (isSelecting || userSelectionActive), container2 = useRef(null), containerBounds = useRef(), selectedNodeIds = useRef(/* @__PURE__ */ new Set()), selectedEdgeIds = useRef(/* @__PURE__ */ new Set()), selectionInProgress = useRef(!1), selectionStarted = useRef(!1), onClick = (event) => {
|
|
@@ -14125,15 +14122,15 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
14125
14122
|
if (containerBounds.current = domNode?.getBoundingClientRect(), !elementsSelectable || !isSelecting || event.button !== 0 || event.target !== container2.current || !containerBounds.current)
|
|
14126
14123
|
return;
|
|
14127
14124
|
event.target?.setPointerCapture?.(event.pointerId), selectionStarted.current = !0, selectionInProgress.current = !1;
|
|
14128
|
-
const { x, y
|
|
14125
|
+
const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current);
|
|
14129
14126
|
resetSelectedElements(), store.setState({
|
|
14130
14127
|
userSelectionRect: {
|
|
14131
14128
|
width: 0,
|
|
14132
14129
|
height: 0,
|
|
14133
14130
|
startX: x,
|
|
14134
|
-
startY:
|
|
14131
|
+
startY: y,
|
|
14135
14132
|
x,
|
|
14136
|
-
y
|
|
14133
|
+
y
|
|
14137
14134
|
}
|
|
14138
14135
|
}), onSelectionStart?.(event);
|
|
14139
14136
|
}, onPointerMove = (event) => {
|
|
@@ -14256,10 +14253,10 @@ function useMoveSelectedNodes() {
|
|
|
14256
14253
|
}
|
|
14257
14254
|
const NodeIdContext = createContext(null), Provider = NodeIdContext.Provider;
|
|
14258
14255
|
NodeIdContext.Consumer;
|
|
14259
|
-
const useNodeId = () => useContext(NodeIdContext), selector$g = (
|
|
14260
|
-
connectOnClick:
|
|
14261
|
-
noPanClassName:
|
|
14262
|
-
rfId:
|
|
14256
|
+
const useNodeId = () => useContext(NodeIdContext), selector$g = (s) => ({
|
|
14257
|
+
connectOnClick: s.connectOnClick,
|
|
14258
|
+
noPanClassName: s.noPanClassName,
|
|
14259
|
+
rfId: s.rfId
|
|
14263
14260
|
}), connectingSelector = (nodeId, handleId, type) => (state) => {
|
|
14264
14261
|
const { connectionClickStartHandle: clickHandle, connectionMode, connection } = state, { fromHandle, toHandle, isValid } = connection, connectingTo = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === type;
|
|
14265
14262
|
return {
|
|
@@ -14402,15 +14399,15 @@ function getNodeInlineStyleDimensions(node) {
|
|
|
14402
14399
|
height: node.height ?? node.style?.height
|
|
14403
14400
|
};
|
|
14404
14401
|
}
|
|
14405
|
-
const selector$f = (
|
|
14406
|
-
const { width, height, x, y
|
|
14402
|
+
const selector$f = (s) => {
|
|
14403
|
+
const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, {
|
|
14407
14404
|
filter: (node) => !!node.selected
|
|
14408
14405
|
});
|
|
14409
14406
|
return {
|
|
14410
14407
|
width: isNumeric(width) ? width : null,
|
|
14411
14408
|
height: isNumeric(height) ? height : null,
|
|
14412
|
-
userSelectionActive:
|
|
14413
|
-
transformString: `translate(${
|
|
14409
|
+
userSelectionActive: s.userSelectionActive,
|
|
14410
|
+
transformString: `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]}) translate(${x}px,${y}px)`
|
|
14414
14411
|
};
|
|
14415
14412
|
};
|
|
14416
14413
|
function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y }) {
|
|
@@ -14439,17 +14436,17 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
|
|
|
14439
14436
|
height
|
|
14440
14437
|
} }) });
|
|
14441
14438
|
}
|
|
14442
|
-
const win = typeof window < "u" ? window : void 0, selector$e = (
|
|
14439
|
+
const win = typeof window < "u" ? window : void 0, selector$e = (s) => ({ nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive });
|
|
14443
14440
|
function FlowRendererComponent({ children: children2, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport }) {
|
|
14444
14441
|
const { nodesSelectionActive, userSelectionActive } = useStore(selector$e), selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win }), panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win }), panOnDrag = panActivationKeyPressed || _panOnDrag, panOnScroll = panActivationKeyPressed || _panOnScroll, _selectionOnDrag = selectionOnDrag && panOnDrag !== !0, isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag;
|
|
14445
14442
|
return useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode }), jsx(ZoomPane, { onPaneContextMenu, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, children: jsxs(Pane, { onSelectionStart, onSelectionEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, panOnDrag, isSelecting: !!isSelecting, selectionMode, selectionKeyPressed, selectionOnDrag: _selectionOnDrag, children: [children2, nodesSelectionActive && jsx(NodesSelection, { onSelectionContextMenu, noPanClassName, disableKeyboardA11y })] }) });
|
|
14446
14443
|
}
|
|
14447
14444
|
FlowRendererComponent.displayName = "FlowRenderer";
|
|
14448
|
-
const FlowRenderer = memo$1(FlowRendererComponent), selector$d = (onlyRenderVisible) => (
|
|
14445
|
+
const FlowRenderer = memo$1(FlowRendererComponent), selector$d = (onlyRenderVisible) => (s) => onlyRenderVisible ? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, !0).map((node) => node.id) : Array.from(s.nodeLookup.keys());
|
|
14449
14446
|
function useVisibleNodeIds(onlyRenderVisible) {
|
|
14450
14447
|
return useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow$1);
|
|
14451
14448
|
}
|
|
14452
|
-
const selector$c = (
|
|
14449
|
+
const selector$c = (s) => s.updateNodeInternals;
|
|
14453
14450
|
function useResizeObserver() {
|
|
14454
14451
|
const updateNodeInternals2 = useStore(selector$c), [resizeObserver] = useState(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((entries) => {
|
|
14455
14452
|
const updates = /* @__PURE__ */ new Map();
|
|
@@ -14480,8 +14477,8 @@ function useNodeObserver({ node, nodeType, hasDimensions, resizeObserver }) {
|
|
|
14480
14477
|
}, [node.id, nodeType, node.sourcePosition, node.targetPosition]), nodeRef;
|
|
14481
14478
|
}
|
|
14482
14479
|
function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError }) {
|
|
14483
|
-
const { node, internals, isParent: isParent2 } = useStore((
|
|
14484
|
-
const node2 =
|
|
14480
|
+
const { node, internals, isParent: isParent2 } = useStore((s) => {
|
|
14481
|
+
const node2 = s.nodeLookup.get(id2), isParent22 = s.parentLookup.has(id2);
|
|
14485
14482
|
return {
|
|
14486
14483
|
node: node2,
|
|
14487
14484
|
internals: node2.internals,
|
|
@@ -14567,12 +14564,12 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
14567
14564
|
...inlineDimensions
|
|
14568
14565
|
}, "data-id": id2, "data-testid": `rf__node-${id2}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, onFocus: isFocusable ? onFocus : void 0, role: node.ariaRole ?? (isFocusable ? "group" : void 0), "aria-roledescription": "node", "aria-describedby": disableKeyboardA11y ? void 0 : `${ARIA_NODE_DESC_KEY}-${rfId}`, "aria-label": node.ariaLabel, ...node.domAttributes, children: jsx(Provider, { value: id2, children: jsx(NodeComponent, { id: id2, data: node.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node.selected ?? !1, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? !0, isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) });
|
|
14569
14566
|
}
|
|
14570
|
-
const selector$b = (
|
|
14571
|
-
nodesDraggable:
|
|
14572
|
-
nodesConnectable:
|
|
14573
|
-
nodesFocusable:
|
|
14574
|
-
elementsSelectable:
|
|
14575
|
-
onError:
|
|
14567
|
+
const selector$b = (s) => ({
|
|
14568
|
+
nodesDraggable: s.nodesDraggable,
|
|
14569
|
+
nodesConnectable: s.nodesConnectable,
|
|
14570
|
+
nodesFocusable: s.nodesFocusable,
|
|
14571
|
+
elementsSelectable: s.elementsSelectable,
|
|
14572
|
+
onError: s.onError
|
|
14576
14573
|
});
|
|
14577
14574
|
function NodeRendererComponent(props) {
|
|
14578
14575
|
const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow$1), nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements), resizeObserver = useResizeObserver();
|
|
@@ -14608,19 +14605,19 @@ function NodeRendererComponent(props) {
|
|
|
14608
14605
|
NodeRendererComponent.displayName = "NodeRenderer";
|
|
14609
14606
|
const NodeRenderer = memo$1(NodeRendererComponent);
|
|
14610
14607
|
function useVisibleEdgeIds(onlyRenderVisible) {
|
|
14611
|
-
return useStore(useCallback((
|
|
14608
|
+
return useStore(useCallback((s) => {
|
|
14612
14609
|
if (!onlyRenderVisible)
|
|
14613
|
-
return
|
|
14610
|
+
return s.edges.map((edge) => edge.id);
|
|
14614
14611
|
const visibleEdgeIds = [];
|
|
14615
|
-
if (
|
|
14616
|
-
for (const edge of
|
|
14617
|
-
const sourceNode =
|
|
14612
|
+
if (s.width && s.height)
|
|
14613
|
+
for (const edge of s.edges) {
|
|
14614
|
+
const sourceNode = s.nodeLookup.get(edge.source), targetNode = s.nodeLookup.get(edge.target);
|
|
14618
14615
|
sourceNode && targetNode && isEdgeVisible({
|
|
14619
14616
|
sourceNode,
|
|
14620
14617
|
targetNode,
|
|
14621
|
-
width:
|
|
14622
|
-
height:
|
|
14623
|
-
transform:
|
|
14618
|
+
width: s.width,
|
|
14619
|
+
height: s.height,
|
|
14620
|
+
transform: s.transform
|
|
14624
14621
|
}) && visibleEdgeIds.push(edge.id);
|
|
14625
14622
|
}
|
|
14626
14623
|
return visibleEdgeIds;
|
|
@@ -14650,7 +14647,7 @@ const Marker = ({ id: id2, type, color: color2, width = 12.5, height = 12.5, mar
|
|
|
14650
14647
|
const Symbol2 = useMarkerSymbol(type);
|
|
14651
14648
|
return Symbol2 ? jsx("marker", { className: "react-flow__arrowhead", id: id2, markerWidth: `${width}`, markerHeight: `${height}`, viewBox: "-10 -10 20 20", markerUnits, orient, refX: "0", refY: "0", children: jsx(Symbol2, { color: color2, strokeWidth }) }) : null;
|
|
14652
14649
|
}, MarkerDefinitions = ({ defaultColor, rfId }) => {
|
|
14653
|
-
const edges = useStore((
|
|
14650
|
+
const edges = useStore((s) => s.edges), defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions), markers = useMemo(() => createMarkerIds(edges, {
|
|
14654
14651
|
id: rfId,
|
|
14655
14652
|
defaultColor,
|
|
14656
14653
|
defaultMarkerStart: defaultEdgeOptions?.markerStart,
|
|
@@ -14660,7 +14657,7 @@ const Marker = ({ id: id2, type, color: color2, width = 12.5, height = 12.5, mar
|
|
|
14660
14657
|
};
|
|
14661
14658
|
MarkerDefinitions.displayName = "MarkerDefinitions";
|
|
14662
14659
|
var MarkerDefinitions$1 = memo$1(MarkerDefinitions);
|
|
14663
|
-
function EdgeTextComponent({ x, y
|
|
14660
|
+
function EdgeTextComponent({ x, y, label, labelStyle, labelShowBg = !0, labelBgStyle, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children: children2, className, ...rest }) {
|
|
14664
14661
|
const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 1, y: 0, width: 0, height: 0 }), edgeTextClasses = cc(["react-flow__edge-textwrapper", className]), edgeTextRef = useRef(null);
|
|
14665
14662
|
return useEffect(() => {
|
|
14666
14663
|
if (edgeTextRef.current) {
|
|
@@ -14672,7 +14669,7 @@ function EdgeTextComponent({ x, y: y2, label, labelStyle, labelShowBg = !0, labe
|
|
|
14672
14669
|
height: textBbox.height
|
|
14673
14670
|
});
|
|
14674
14671
|
}
|
|
14675
|
-
}, [label]), label ? jsxs("g", { transform: `translate(${x - edgeTextBbox.width / 2} ${
|
|
14672
|
+
}, [label]), label ? jsxs("g", { transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? "visible" : "hidden", ...rest, children: [labelShowBg && jsx("rect", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: "react-flow__edge-textbg", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius }), jsx("text", { className: "react-flow__edge-text", y: edgeTextBbox.height / 2, dy: "0.3em", ref: edgeTextRef, style: labelStyle, children: label }), children2] }) : null;
|
|
14676
14673
|
}
|
|
14677
14674
|
EdgeTextComponent.displayName = "EdgeText";
|
|
14678
14675
|
const EdgeText = memo$1(EdgeTextComponent);
|
|
@@ -14796,7 +14793,7 @@ const builtinEdgeTypes = {
|
|
|
14796
14793
|
targetY: null,
|
|
14797
14794
|
sourcePosition: null,
|
|
14798
14795
|
targetPosition: null
|
|
14799
|
-
}, shiftX = (x, shift2, position) => position === Position.Left ? x - shift2 : position === Position.Right ? x + shift2 : x, shiftY = (
|
|
14796
|
+
}, shiftX = (x, shift2, position) => position === Position.Left ? x - shift2 : position === Position.Right ? x + shift2 : x, shiftY = (y, shift2, position) => position === Position.Top ? y - shift2 : position === Position.Bottom ? y + shift2 : y, EdgeUpdaterClassName = "react-flow__edgeupdater";
|
|
14800
14797
|
function EdgeAnchor({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type }) {
|
|
14801
14798
|
return jsx("circle", { onMouseDown, onMouseEnter, onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: "transparent", fill: "transparent" });
|
|
14802
14799
|
}
|
|
@@ -14838,8 +14835,8 @@ function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, so
|
|
|
14838
14835
|
return jsxs(Fragment$1, { children: [(isReconnectable === !0 || isReconnectable === "source") && jsx(EdgeAnchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: reconnectRadius, onMouseDown: onReconnectSourceMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "source" }), (isReconnectable === !0 || isReconnectable === "target") && jsx(EdgeAnchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: reconnectRadius, onMouseDown: onReconnectTargetMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "target" })] });
|
|
14839
14836
|
}
|
|
14840
14837
|
function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y }) {
|
|
14841
|
-
let edge = useStore((
|
|
14842
|
-
const defaultEdgeOptions = useStore((
|
|
14838
|
+
let edge = useStore((s) => s.edgeLookup.get(id2));
|
|
14839
|
+
const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);
|
|
14843
14840
|
edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge;
|
|
14844
14841
|
let edgeType = edge.type || "default", EdgeComponent = edgeTypes?.[edgeType] || builtinEdgeTypes[edgeType];
|
|
14845
14842
|
EdgeComponent === void 0 && (onError?.("011", errorMessages.error011(edgeType)), edgeType = "default", EdgeComponent = edgeTypes?.default || builtinEdgeTypes.default);
|
|
@@ -14905,19 +14902,19 @@ function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSele
|
|
|
14905
14902
|
}
|
|
14906
14903
|
]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, role: edge.ariaRole ?? (isFocusable ? "group" : "img"), "aria-roledescription": "edge", "data-id": id2, "data-testid": `rf__edge-${id2}`, "aria-label": edge.ariaLabel === null ? void 0 : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : void 0, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && jsx(EdgeComponent, { id: id2, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? !0, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: "pathOptions" in edge ? edge.pathOptions : void 0, interactionWidth: edge.interactionWidth }), isReconnectable && jsx(EdgeUpdateAnchors, { edge, isReconnectable, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, setUpdateHover, setReconnecting })] }) });
|
|
14907
14904
|
}
|
|
14908
|
-
const selector$a = (
|
|
14909
|
-
edgesFocusable:
|
|
14910
|
-
edgesReconnectable:
|
|
14911
|
-
elementsSelectable:
|
|
14912
|
-
connectionMode:
|
|
14913
|
-
onError:
|
|
14905
|
+
const selector$a = (s) => ({
|
|
14906
|
+
edgesFocusable: s.edgesFocusable,
|
|
14907
|
+
edgesReconnectable: s.edgesReconnectable,
|
|
14908
|
+
elementsSelectable: s.elementsSelectable,
|
|
14909
|
+
connectionMode: s.connectionMode,
|
|
14910
|
+
onError: s.onError
|
|
14914
14911
|
});
|
|
14915
14912
|
function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y }) {
|
|
14916
14913
|
const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow$1), edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);
|
|
14917
14914
|
return jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId }), edgeIds.map((id2) => jsx(EdgeWrapper, { id: id2, edgesFocusable, edgesReconnectable, elementsSelectable, noPanClassName, onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart, onReconnectEnd, rfId, onError, edgeTypes, disableKeyboardA11y }, id2))] });
|
|
14918
14915
|
}
|
|
14919
14916
|
EdgeRendererComponent.displayName = "EdgeRenderer";
|
|
14920
|
-
const EdgeRenderer = memo$1(EdgeRendererComponent), selector$9 = (
|
|
14917
|
+
const EdgeRenderer = memo$1(EdgeRendererComponent), selector$9 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`;
|
|
14921
14918
|
function Viewport({ children: children2 }) {
|
|
14922
14919
|
const transform2 = useStore(selector$9);
|
|
14923
14920
|
return jsx("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform: transform2 }, children: children2 });
|
|
@@ -14935,8 +14932,8 @@ function useViewportSync(viewport) {
|
|
|
14935
14932
|
viewport && (syncViewport?.(viewport), store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] }));
|
|
14936
14933
|
}, [viewport, syncViewport]), null;
|
|
14937
14934
|
}
|
|
14938
|
-
function storeSelector$1(
|
|
14939
|
-
return
|
|
14935
|
+
function storeSelector$1(s) {
|
|
14936
|
+
return s.connection.inProgress ? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) } : { ...s.connection };
|
|
14940
14937
|
}
|
|
14941
14938
|
function getSelector(connectionSelector) {
|
|
14942
14939
|
return storeSelector$1;
|
|
@@ -14945,12 +14942,12 @@ function useConnection(connectionSelector) {
|
|
|
14945
14942
|
const combinedSelector = getSelector();
|
|
14946
14943
|
return useStore(combinedSelector, shallow$1);
|
|
14947
14944
|
}
|
|
14948
|
-
const selector$7 = (
|
|
14949
|
-
nodesConnectable:
|
|
14950
|
-
isValid:
|
|
14951
|
-
inProgress:
|
|
14952
|
-
width:
|
|
14953
|
-
height:
|
|
14945
|
+
const selector$7 = (s) => ({
|
|
14946
|
+
nodesConnectable: s.nodesConnectable,
|
|
14947
|
+
isValid: s.connection.isValid,
|
|
14948
|
+
inProgress: s.connection.inProgress,
|
|
14949
|
+
width: s.width,
|
|
14950
|
+
height: s.height
|
|
14954
14951
|
});
|
|
14955
14952
|
function ConnectionLineWrapper({ containerStyle: containerStyle2, style: style2, type, component }) {
|
|
14956
14953
|
const { nodesConnectable, width, height, isValid, inProgress } = useStore(selector$7, shallow$1);
|
|
@@ -15018,8 +15015,8 @@ const GraphView = memo$1(GraphViewComponent), getInitialState = ({ nodes, edges,
|
|
|
15018
15015
|
if (fitView && width && height) {
|
|
15019
15016
|
const bounds = getInternalNodesBounds(nodeLookup, {
|
|
15020
15017
|
filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight))
|
|
15021
|
-
}), { x, y
|
|
15022
|
-
transform2 = [x,
|
|
15018
|
+
}), { x, y, zoom: zoom2 } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1);
|
|
15019
|
+
transform2 = [x, y, zoom2];
|
|
15023
15020
|
}
|
|
15024
15021
|
return {
|
|
15025
15022
|
rfId: "1",
|
|
@@ -15249,14 +15246,14 @@ const GraphView = memo$1(GraphViewComponent), getInitialState = ({ nodes, edges,
|
|
|
15249
15246
|
const { transform: transform2, width: width2, height: height2, panZoom, translateExtent } = get2();
|
|
15250
15247
|
return panBy({ delta, panZoom, transform: transform2, translateExtent, width: width2, height: height2 });
|
|
15251
15248
|
},
|
|
15252
|
-
setCenter: async (x,
|
|
15249
|
+
setCenter: async (x, y, options) => {
|
|
15253
15250
|
const { width: width2, height: height2, maxZoom: maxZoom2, panZoom } = get2();
|
|
15254
15251
|
if (!panZoom)
|
|
15255
15252
|
return Promise.resolve(!1);
|
|
15256
15253
|
const nextZoom = typeof options?.zoom < "u" ? options.zoom : maxZoom2;
|
|
15257
15254
|
return await panZoom.setViewport({
|
|
15258
15255
|
x: width2 / 2 - x * nextZoom,
|
|
15259
|
-
y: height2 / 2 -
|
|
15256
|
+
y: height2 / 2 - y * nextZoom,
|
|
15260
15257
|
zoom: nextZoom
|
|
15261
15258
|
}, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate }), Promise.resolve(!0);
|
|
15262
15259
|
},
|
|
@@ -15305,13 +15302,13 @@ function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTy
|
|
|
15305
15302
|
return jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style2, ...wrapperStyle }, ref, className: cc(["react-flow", className, colorModeClassName]), id: id2, role: "application", children: jsxs(Wrapper, { nodes, edges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, children: [jsx(GraphView, { onInit, onNodeClick, onEdgeClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, nodeTypes, edgeTypes, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, deleteKeyCode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent, minZoom, maxZoom, preventScrolling, zoomOnScroll, zoomOnPinch, zoomOnDoubleClick, panOnScroll, panOnScrollSpeed, panOnScrollMode, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, defaultMarkerColor, noDragClassName, noWheelClassName, noPanClassName, rfId, disableKeyboardA11y, nodeExtent, viewport, onViewportChange }), jsx(StoreUpdater, { nodes, edges, defaultNodes, defaultEdges, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, edgesFocusable, edgesReconnectable, elementsSelectable, elevateNodesOnSelect, elevateEdgesOnSelect, minZoom, maxZoom, nodeExtent, onNodesChange, onEdgesChange, snapToGrid, snapGrid, connectionMode, translateExtent, connectOnClick, defaultEdgeOptions, fitView, fitViewOptions, onNodesDelete, onEdgesDelete, onDelete, onNodeDragStart, onNodeDrag, onNodeDragStop, onSelectionDrag, onSelectionDragStart, onSelectionDragStop, onMove, onMoveStart, onMoveEnd, noPanClassName, nodeOrigin, rfId, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, onError, connectionRadius, isValidConnection, selectNodesOnDrag, nodeDragThreshold, connectionDragThreshold, onBeforeDelete, paneClickDistance, debug, ariaLabelConfig }), jsx(SelectionListener, { onSelectionChange }), children2, jsx(Attribution, { proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId, disableKeyboardA11y })] }) });
|
|
15306
15303
|
}
|
|
15307
15304
|
var index = fixedForwardRef(ReactFlow);
|
|
15308
|
-
const selector$6 = (
|
|
15305
|
+
const selector$6 = (s) => s.domNode?.querySelector(".react-flow__edgelabel-renderer");
|
|
15309
15306
|
function EdgeLabelRenderer({ children: children2 }) {
|
|
15310
15307
|
const edgeLabelRenderer = useStore(selector$6);
|
|
15311
15308
|
return edgeLabelRenderer ? createPortal(children2, edgeLabelRenderer) : null;
|
|
15312
15309
|
}
|
|
15313
15310
|
function useInternalNode(id2) {
|
|
15314
|
-
return useStore(useCallback((
|
|
15311
|
+
return useStore(useCallback((s) => s.nodeLookup.get(id2), [id2]), shallow$1);
|
|
15315
15312
|
}
|
|
15316
15313
|
function LinePattern({ dimensions, lineWidth, variant, className }) {
|
|
15317
15314
|
return jsx("path", { strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`, className: cc(["react-flow__background-pattern", variant, className]) });
|
|
@@ -15327,7 +15324,7 @@ const defaultSize = {
|
|
|
15327
15324
|
[BackgroundVariant.Dots]: 1,
|
|
15328
15325
|
[BackgroundVariant.Lines]: 1,
|
|
15329
15326
|
[BackgroundVariant.Cross]: 6
|
|
15330
|
-
}, selector$3 = (
|
|
15327
|
+
}, selector$3 = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` });
|
|
15331
15328
|
function BackgroundComponent({
|
|
15332
15329
|
id: id2,
|
|
15333
15330
|
variant = BackgroundVariant.Dots,
|
|
@@ -15374,11 +15371,11 @@ function UnlockIcon() {
|
|
|
15374
15371
|
function ControlButton({ children: children2, className, ...rest }) {
|
|
15375
15372
|
return jsx("button", { type: "button", className: cc(["react-flow__controls-button", className]), ...rest, children: children2 });
|
|
15376
15373
|
}
|
|
15377
|
-
const selector$2 = (
|
|
15378
|
-
isInteractive:
|
|
15379
|
-
minZoomReached:
|
|
15380
|
-
maxZoomReached:
|
|
15381
|
-
ariaLabelConfig:
|
|
15374
|
+
const selector$2 = (s) => ({
|
|
15375
|
+
isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,
|
|
15376
|
+
minZoomReached: s.transform[2] <= s.minZoom,
|
|
15377
|
+
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
15378
|
+
ariaLabelConfig: s.ariaLabelConfig
|
|
15382
15379
|
});
|
|
15383
15380
|
function ControlsComponent({ style: style2, showZoom = !0, showFitView = !0, showInteractive = !0, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children: children2, position = "bottom-left", orientation = "vertical", "aria-label": ariaLabel }) {
|
|
15384
15381
|
const store = useStoreApi(), { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector$2, shallow$1), { zoomIn, zoomOut, fitView } = useReactFlow(), onZoomInHandler = () => {
|
|
@@ -15398,15 +15395,15 @@ function ControlsComponent({ style: style2, showZoom = !0, showFitView = !0, sho
|
|
|
15398
15395
|
}
|
|
15399
15396
|
ControlsComponent.displayName = "Controls";
|
|
15400
15397
|
memo$1(ControlsComponent);
|
|
15401
|
-
function MiniMapNodeComponent({ id: id2, x, y
|
|
15398
|
+
function MiniMapNodeComponent({ id: id2, x, y, width, height, style: style2, color: color2, strokeColor, strokeWidth, className, borderRadius: borderRadius2, shapeRendering, selected: selected2, onClick }) {
|
|
15402
15399
|
const { background, backgroundColor } = style2 || {}, fill = color2 || background || backgroundColor;
|
|
15403
|
-
return jsx("rect", { className: cc(["react-flow__minimap-node", { selected: selected2 }, className]), x, y
|
|
15400
|
+
return jsx("rect", { className: cc(["react-flow__minimap-node", { selected: selected2 }, className]), x, y, rx: borderRadius2, ry: borderRadius2, width, height, style: {
|
|
15404
15401
|
fill,
|
|
15405
15402
|
stroke: strokeColor,
|
|
15406
15403
|
strokeWidth
|
|
15407
15404
|
}, shapeRendering, onClick: onClick ? (event) => onClick(event, id2) : void 0 });
|
|
15408
15405
|
}
|
|
15409
|
-
const MiniMapNode = memo$1(MiniMapNodeComponent), selectorNodeIds = (
|
|
15406
|
+
const MiniMapNode = memo$1(MiniMapNodeComponent), selectorNodeIds = (s) => s.nodes.map((node) => node.id), getAttrFunction = (func) => func instanceof Function ? func : () => func;
|
|
15410
15407
|
function MiniMapNodes({
|
|
15411
15408
|
nodeStrokeColor,
|
|
15412
15409
|
nodeColor,
|
|
@@ -15433,36 +15430,36 @@ function MiniMapNodes({
|
|
|
15433
15430
|
)) });
|
|
15434
15431
|
}
|
|
15435
15432
|
function NodeComponentWrapperInner({ id: id2, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick }) {
|
|
15436
|
-
const { node, x, y
|
|
15437
|
-
const { internals } =
|
|
15433
|
+
const { node, x, y, width, height } = useStore((s) => {
|
|
15434
|
+
const { internals } = s.nodeLookup.get(id2), node2 = internals.userNode, { x: x2, y: y2 } = internals.positionAbsolute, { width: width2, height: height2 } = getNodeDimensions(node2);
|
|
15438
15435
|
return {
|
|
15439
15436
|
node: node2,
|
|
15440
15437
|
x: x2,
|
|
15441
|
-
y:
|
|
15438
|
+
y: y2,
|
|
15442
15439
|
width: width2,
|
|
15443
15440
|
height: height2
|
|
15444
15441
|
};
|
|
15445
15442
|
}, shallow$1);
|
|
15446
|
-
return !node || node.hidden || !nodeHasDimensions(node) ? null : jsx(NodeComponent, { x, y
|
|
15443
|
+
return !node || node.hidden || !nodeHasDimensions(node) ? null : jsx(NodeComponent, { x, y, width, height, style: node.style, selected: !!node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering, onClick, id: node.id });
|
|
15447
15444
|
}
|
|
15448
15445
|
const NodeComponentWrapper = memo$1(NodeComponentWrapperInner);
|
|
15449
15446
|
var MiniMapNodes$1 = memo$1(MiniMapNodes);
|
|
15450
|
-
const defaultWidth = 200, defaultHeight = 150, filterHidden = (node) => !node.hidden, selector$1 = (
|
|
15447
|
+
const defaultWidth = 200, defaultHeight = 150, filterHidden = (node) => !node.hidden, selector$1 = (s) => {
|
|
15451
15448
|
const viewBB = {
|
|
15452
|
-
x: -
|
|
15453
|
-
y: -
|
|
15454
|
-
width:
|
|
15455
|
-
height:
|
|
15449
|
+
x: -s.transform[0] / s.transform[2],
|
|
15450
|
+
y: -s.transform[1] / s.transform[2],
|
|
15451
|
+
width: s.width / s.transform[2],
|
|
15452
|
+
height: s.height / s.transform[2]
|
|
15456
15453
|
};
|
|
15457
15454
|
return {
|
|
15458
15455
|
viewBB,
|
|
15459
|
-
boundingRect:
|
|
15460
|
-
rfId:
|
|
15461
|
-
panZoom:
|
|
15462
|
-
translateExtent:
|
|
15463
|
-
flowWidth:
|
|
15464
|
-
flowHeight:
|
|
15465
|
-
ariaLabelConfig:
|
|
15456
|
+
boundingRect: s.nodeLookup.size > 0 ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB) : viewBB,
|
|
15457
|
+
rfId: s.rfId,
|
|
15458
|
+
panZoom: s.panZoom,
|
|
15459
|
+
translateExtent: s.translateExtent,
|
|
15460
|
+
flowWidth: s.width,
|
|
15461
|
+
flowHeight: s.height,
|
|
15462
|
+
ariaLabelConfig: s.ariaLabelConfig
|
|
15466
15463
|
};
|
|
15467
15464
|
}, ARIA_LABEL_KEY = "react-flow__minimap-desc";
|
|
15468
15465
|
function MiniMapComponent({
|
|
@@ -15492,7 +15489,7 @@ function MiniMapComponent({
|
|
|
15492
15489
|
zoomStep = 1,
|
|
15493
15490
|
offsetScale = 5
|
|
15494
15491
|
}) {
|
|
15495
|
-
const store = useStoreApi(), svg = useRef(null), { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow$1), elementWidth = style2?.width ?? defaultWidth, elementHeight = style2?.height ?? defaultHeight, scaledWidth = boundingRect.width / elementWidth, scaledHeight = boundingRect.height / elementHeight, viewScale = Math.max(scaledWidth, scaledHeight), viewWidth = viewScale * elementWidth, viewHeight = viewScale * elementHeight, offset2 = offsetScale * viewScale, x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset2,
|
|
15492
|
+
const store = useStoreApi(), svg = useRef(null), { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow$1), elementWidth = style2?.width ?? defaultWidth, elementHeight = style2?.height ?? defaultHeight, scaledWidth = boundingRect.width / elementWidth, scaledHeight = boundingRect.height / elementHeight, viewScale = Math.max(scaledWidth, scaledHeight), viewWidth = viewScale * elementWidth, viewHeight = viewScale * elementHeight, offset2 = offsetScale * viewScale, x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset2, y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset2, width = viewWidth + offset2 * 2, height = viewHeight + offset2 * 2, labelledBy = `${ARIA_LABEL_KEY}-${rfId}`, viewScaleRef = useRef(0), minimapInstance = useRef();
|
|
15496
15493
|
viewScaleRef.current = viewScale, useEffect(() => {
|
|
15497
15494
|
if (svg.current && panZoom)
|
|
15498
15495
|
return minimapInstance.current = XYMinimap({
|
|
@@ -15515,8 +15512,8 @@ function MiniMapComponent({
|
|
|
15515
15512
|
});
|
|
15516
15513
|
}, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]);
|
|
15517
15514
|
const onSvgClick = onClick ? (event) => {
|
|
15518
|
-
const [x2,
|
|
15519
|
-
onClick(event, { x: x2, y:
|
|
15515
|
+
const [x2, y2] = minimapInstance.current?.pointer(event) || [0, 0];
|
|
15516
|
+
onClick(event, { x: x2, y: y2 });
|
|
15520
15517
|
} : void 0, onSvgNodeClick = onNodeClick ? useCallback((event, nodeId) => {
|
|
15521
15518
|
const node = store.getState().nodeLookup.get(nodeId).internals.userNode;
|
|
15522
15519
|
onNodeClick(event, node);
|
|
@@ -15530,7 +15527,7 @@ function MiniMapComponent({
|
|
|
15530
15527
|
"--xy-minimap-node-background-color-props": typeof nodeColor == "string" ? nodeColor : void 0,
|
|
15531
15528
|
"--xy-minimap-node-stroke-color-props": typeof nodeStrokeColor == "string" ? nodeStrokeColor : void 0,
|
|
15532
15529
|
"--xy-minimap-node-stroke-width-props": typeof nodeStrokeWidth == "number" ? nodeStrokeWidth : void 0
|
|
15533
|
-
}, className: cc(["react-flow__minimap", className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${
|
|
15530
|
+
}, className: cc(["react-flow__minimap", className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick, children: [_ariaLabel && jsx("title", { id: labelledBy, children: _ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor, nodeStrokeColor, nodeBorderRadius, nodeClassName, nodeStrokeWidth, nodeComponent }), jsx("path", { className: "react-flow__minimap-mask", d: `M${x - offset2},${y - offset2}h${width + offset2 * 2}v${height + offset2 * 2}h${-width - offset2 * 2}z
|
|
15534
15531
|
M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) });
|
|
15535
15532
|
}
|
|
15536
15533
|
MiniMapComponent.displayName = "MiniMap";
|
|
@@ -15675,12 +15672,12 @@ function NodeToolbar({ nodeId, children: children2, className, style: style2, is
|
|
|
15675
15672
|
const contextNodeId = useNodeId(), nodesSelector2 = useCallback((state) => (Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ""]).reduce((res, id2) => {
|
|
15676
15673
|
const node = state.nodeLookup.get(id2);
|
|
15677
15674
|
return node && res.set(node.id, node), res;
|
|
15678
|
-
}, /* @__PURE__ */ new Map()), [nodeId, contextNodeId]), nodes = useStore(nodesSelector2, nodesEqualityFn), { x, y
|
|
15675
|
+
}, /* @__PURE__ */ new Map()), [nodeId, contextNodeId]), nodes = useStore(nodesSelector2, nodesEqualityFn), { x, y, zoom: zoom2, selectedNodesCount } = useStore(storeSelector, shallow$1);
|
|
15679
15676
|
if (!(typeof isVisible == "boolean" ? isVisible : nodes.size === 1 && nodes.values().next().value?.selected && selectedNodesCount === 1) || !nodes.size)
|
|
15680
15677
|
return null;
|
|
15681
15678
|
const nodeRect = getInternalNodesBounds(nodes), nodesArray = Array.from(nodes.values()), zIndex = Math.max(...nodesArray.map((node) => node.internals.z + 1)), wrapperStyle2 = {
|
|
15682
15679
|
position: "absolute",
|
|
15683
|
-
transform: getNodeToolbarTransform(nodeRect, { x, y
|
|
15680
|
+
transform: getNodeToolbarTransform(nodeRect, { x, y, zoom: zoom2 }, position, offset2, align),
|
|
15684
15681
|
zIndex,
|
|
15685
15682
|
...style2
|
|
15686
15683
|
};
|
|
@@ -15793,8 +15790,8 @@ const { valueOf, toString } = Object.prototype, isEqual = (a, b) => {
|
|
|
15793
15790
|
return a2.toString() === b2.toString();
|
|
15794
15791
|
const aKeys = Object.keys(a2);
|
|
15795
15792
|
let key;
|
|
15796
|
-
for (let
|
|
15797
|
-
if (key = aKeys[
|
|
15793
|
+
for (let l = aKeys.length; l-- !== 0; )
|
|
15794
|
+
if (key = aKeys[l], !Object.hasOwn(b2, key) || !inner(a2[key], b2[key]))
|
|
15798
15795
|
return !1;
|
|
15799
15796
|
return Object.keys(b2).length === aKeys.length;
|
|
15800
15797
|
};
|
|
@@ -15843,7 +15840,7 @@ const HandlerNames = [
|
|
|
15843
15840
|
"onChange",
|
|
15844
15841
|
"onCanvasDblClick"
|
|
15845
15842
|
], DiagramEventHandlersReactContext = createContext({
|
|
15846
|
-
...
|
|
15843
|
+
...t$1(HandlerNames, (name) => [name, null]),
|
|
15847
15844
|
handlersRef: {
|
|
15848
15845
|
current: {}
|
|
15849
15846
|
}
|
|
@@ -15852,8 +15849,8 @@ function DiagramEventHandlers({
|
|
|
15852
15849
|
handlers,
|
|
15853
15850
|
children: children2
|
|
15854
15851
|
}) {
|
|
15855
|
-
const handlersRef = useSyncedRef(handlers), deps = HandlerNames.map((name) =>
|
|
15856
|
-
...
|
|
15852
|
+
const handlersRef = useSyncedRef(handlers), deps = HandlerNames.map((name) => e$2(handlers[name])), value = useMemo(() => ({
|
|
15853
|
+
...t$1(HandlerNames, (name) => handlersRef.current[name] ? [name, (...args) => handlersRef.current[name]?.(...args)] : [name, null]),
|
|
15857
15854
|
handlersRef
|
|
15858
15855
|
}), [handlersRef, ...deps]);
|
|
15859
15856
|
return /* @__PURE__ */ jsx(DiagramEventHandlersReactContext.Provider, { value, children: children2 });
|
|
@@ -16143,7 +16140,7 @@ const FeatureNames = [
|
|
|
16143
16140
|
*/
|
|
16144
16141
|
"Vscode",
|
|
16145
16142
|
"ElementTags"
|
|
16146
|
-
], AllDisabled =
|
|
16143
|
+
], AllDisabled = t$1(
|
|
16147
16144
|
FeatureNames,
|
|
16148
16145
|
(name) => [`enable${name}`, !1]
|
|
16149
16146
|
), DiagramFeaturesContext = createContext(AllDisabled), validate = (features) => {
|
|
@@ -16454,14 +16451,14 @@ const TagStylesContext = createContext({}), radixColors = [
|
|
|
16454
16451
|
function TagStylesProvider({ children: children2, rootSelector }) {
|
|
16455
16452
|
const tags = useLikeC4Specification().tags, { specs, stylesheet } = useDeepCompareMemo(() => tags ? {
|
|
16456
16453
|
specs: tags,
|
|
16457
|
-
stylesheet:
|
|
16458
|
-
t$
|
|
16459
|
-
|
|
16454
|
+
stylesheet: t$7(
|
|
16455
|
+
t$5(tags),
|
|
16456
|
+
t$4(([tag, spec]) => [
|
|
16460
16457
|
`:is(${rootSelector} [data-likec4-tag="${tag}"]) {`,
|
|
16461
16458
|
generateColorVars(spec),
|
|
16462
16459
|
"}"
|
|
16463
16460
|
]),
|
|
16464
|
-
|
|
16461
|
+
t$3(`
|
|
16465
16462
|
`)
|
|
16466
16463
|
)
|
|
16467
16464
|
} : { specs: {}, stylesheet: "" }, [tags, rootSelector]);
|
|
@@ -16542,7 +16539,7 @@ function useIsZoomTooSmall() {
|
|
|
16542
16539
|
}
|
|
16543
16540
|
function getDevicePixelRatio() {
|
|
16544
16541
|
const dpr = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : 1;
|
|
16545
|
-
return
|
|
16542
|
+
return t$9(Math.floor(dpr), {
|
|
16546
16543
|
min: 1,
|
|
16547
16544
|
max: 4
|
|
16548
16545
|
});
|
|
@@ -16611,9 +16608,9 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16611
16608
|
0.0123412297999872
|
|
16612
16609
|
],
|
|
16613
16610
|
arcfn: function(t2, derivativeFn) {
|
|
16614
|
-
const
|
|
16615
|
-
let
|
|
16616
|
-
return typeof
|
|
16611
|
+
const d = derivativeFn(t2);
|
|
16612
|
+
let l = d.x * d.x + d.y * d.y;
|
|
16613
|
+
return typeof d.z < "u" && (l += d.z * d.z), sqrt$1(l);
|
|
16617
16614
|
},
|
|
16618
16615
|
compute: function(t2, points, _3d) {
|
|
16619
16616
|
if (t2 === 0)
|
|
@@ -16634,14 +16631,14 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16634
16631
|
return _3d && (ret.z = mt * p[0].z + t2 * p[1].z), ret;
|
|
16635
16632
|
}
|
|
16636
16633
|
if (order < 4) {
|
|
16637
|
-
let mt2 = mt * mt, t22 = t2 * t2, a, b, c,
|
|
16638
|
-
order === 2 ? (p = [p[0], p[1], p[2], ZERO], a = mt2, b = mt * t2 * 2, c = t22) : order === 3 && (a = mt2 * mt, b = mt2 * t2 * 3, c = mt * t22 * 3,
|
|
16634
|
+
let mt2 = mt * mt, t22 = t2 * t2, a, b, c, d = 0;
|
|
16635
|
+
order === 2 ? (p = [p[0], p[1], p[2], ZERO], a = mt2, b = mt * t2 * 2, c = t22) : order === 3 && (a = mt2 * mt, b = mt2 * t2 * 3, c = mt * t22 * 3, d = t2 * t22);
|
|
16639
16636
|
const ret = {
|
|
16640
|
-
x: a * p[0].x + b * p[1].x + c * p[2].x +
|
|
16641
|
-
y: a * p[0].y + b * p[1].y + c * p[2].y +
|
|
16637
|
+
x: a * p[0].x + b * p[1].x + c * p[2].x + d * p[3].x,
|
|
16638
|
+
y: a * p[0].y + b * p[1].y + c * p[2].y + d * p[3].y,
|
|
16642
16639
|
t: t2
|
|
16643
16640
|
};
|
|
16644
|
-
return _3d && (ret.z = a * p[0].z + b * p[1].z + c * p[2].z +
|
|
16641
|
+
return _3d && (ret.z = a * p[0].z + b * p[1].z + c * p[2].z + d * p[3].z), ret;
|
|
16645
16642
|
}
|
|
16646
16643
|
const dCpts = JSON.parse(JSON.stringify(points));
|
|
16647
16644
|
for (; dCpts.length > 1; ) {
|
|
@@ -16656,32 +16653,32 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16656
16653
|
},
|
|
16657
16654
|
computeWithRatios: function(t2, points, ratios, _3d) {
|
|
16658
16655
|
const mt = 1 - t2, r2 = ratios, p = points;
|
|
16659
|
-
let f1 = r2[0], f2 = r2[1], f3 = r2[2], f4 = r2[3],
|
|
16656
|
+
let f1 = r2[0], f2 = r2[1], f3 = r2[2], f4 = r2[3], d;
|
|
16660
16657
|
if (f1 *= mt, f2 *= t2, p.length === 2)
|
|
16661
|
-
return
|
|
16662
|
-
x: (f1 * p[0].x + f2 * p[1].x) /
|
|
16663
|
-
y: (f1 * p[0].y + f2 * p[1].y) /
|
|
16664
|
-
z: _3d ? (f1 * p[0].z + f2 * p[1].z) /
|
|
16658
|
+
return d = f1 + f2, {
|
|
16659
|
+
x: (f1 * p[0].x + f2 * p[1].x) / d,
|
|
16660
|
+
y: (f1 * p[0].y + f2 * p[1].y) / d,
|
|
16661
|
+
z: _3d ? (f1 * p[0].z + f2 * p[1].z) / d : !1,
|
|
16665
16662
|
t: t2
|
|
16666
16663
|
};
|
|
16667
16664
|
if (f1 *= mt, f2 *= 2 * mt, f3 *= t2 * t2, p.length === 3)
|
|
16668
|
-
return
|
|
16669
|
-
x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x) /
|
|
16670
|
-
y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y) /
|
|
16671
|
-
z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z) /
|
|
16665
|
+
return d = f1 + f2 + f3, {
|
|
16666
|
+
x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x) / d,
|
|
16667
|
+
y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y) / d,
|
|
16668
|
+
z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z) / d : !1,
|
|
16672
16669
|
t: t2
|
|
16673
16670
|
};
|
|
16674
16671
|
if (f1 *= mt, f2 *= 1.5 * mt, f3 *= 3 * mt, f4 *= t2 * t2 * t2, p.length === 4)
|
|
16675
|
-
return
|
|
16676
|
-
x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x + f4 * p[3].x) /
|
|
16677
|
-
y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y + f4 * p[3].y) /
|
|
16678
|
-
z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z + f4 * p[3].z) /
|
|
16672
|
+
return d = f1 + f2 + f3 + f4, {
|
|
16673
|
+
x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x + f4 * p[3].x) / d,
|
|
16674
|
+
y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y + f4 * p[3].y) / d,
|
|
16675
|
+
z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z + f4 * p[3].z) / d : !1,
|
|
16679
16676
|
t: t2
|
|
16680
16677
|
};
|
|
16681
16678
|
},
|
|
16682
16679
|
derive: function(points, _3d) {
|
|
16683
16680
|
const dpoints = [];
|
|
16684
|
-
for (let p = points,
|
|
16681
|
+
for (let p = points, d = p.length, c = d - 1; d > 1; d--, c--) {
|
|
16685
16682
|
const list = [];
|
|
16686
16683
|
for (let j = 0, dpt; j < c; j++)
|
|
16687
16684
|
dpt = {
|
|
@@ -16717,8 +16714,8 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16717
16714
|
return v1.z !== void 0 && v2.z !== void 0 && (ret.z = v1.z + r2 * (v2.z - v1.z)), ret;
|
|
16718
16715
|
},
|
|
16719
16716
|
pointToString: function(p) {
|
|
16720
|
-
let
|
|
16721
|
-
return typeof p.z < "u" && (
|
|
16717
|
+
let s = p.x + "/" + p.y;
|
|
16718
|
+
return typeof p.z < "u" && (s += "/" + p.z), s;
|
|
16722
16719
|
},
|
|
16723
16720
|
pointsToString: function(points) {
|
|
16724
16721
|
return "[" + points.map(utils.pointToString).join(", ") + "]";
|
|
@@ -16726,23 +16723,23 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16726
16723
|
copy: function(obj) {
|
|
16727
16724
|
return JSON.parse(JSON.stringify(obj));
|
|
16728
16725
|
},
|
|
16729
|
-
angle: function(
|
|
16730
|
-
const dx1 = v1.x -
|
|
16726
|
+
angle: function(o, v1, v2) {
|
|
16727
|
+
const dx1 = v1.x - o.x, dy1 = v1.y - o.y, dx2 = v2.x - o.x, dy2 = v2.y - o.y, cross = dx1 * dy2 - dy1 * dx2, dot = dx1 * dx2 + dy1 * dy2;
|
|
16731
16728
|
return atan2(cross, dot);
|
|
16732
16729
|
},
|
|
16733
16730
|
// round as string, to avoid rounding errors
|
|
16734
|
-
round: function(v,
|
|
16735
|
-
const
|
|
16736
|
-
return parseFloat(
|
|
16731
|
+
round: function(v, d) {
|
|
16732
|
+
const s = "" + v, pos = s.indexOf(".");
|
|
16733
|
+
return parseFloat(s.substring(0, pos + 1 + d));
|
|
16737
16734
|
},
|
|
16738
16735
|
dist: function(p1, p2) {
|
|
16739
16736
|
const dx = p1.x - p2.x, dy = p1.y - p2.y;
|
|
16740
16737
|
return sqrt$1(dx * dx + dy * dy);
|
|
16741
16738
|
},
|
|
16742
16739
|
closest: function(LUT, point) {
|
|
16743
|
-
let mdist = pow(2, 63), mpos,
|
|
16740
|
+
let mdist = pow(2, 63), mpos, d;
|
|
16744
16741
|
return LUT.forEach(function(p, idx) {
|
|
16745
|
-
|
|
16742
|
+
d = utils.dist(point, p), d < mdist && (mdist = d, mpos = idx);
|
|
16746
16743
|
}), { mdist, mpos };
|
|
16747
16744
|
},
|
|
16748
16745
|
abcratio: function(t2, n2) {
|
|
@@ -16766,8 +16763,8 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16766
16763
|
return top / bottom;
|
|
16767
16764
|
},
|
|
16768
16765
|
lli8: function(x1, y1, x2, y2, x3, y3, x4, y4) {
|
|
16769
|
-
const nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4), ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
|
|
16770
|
-
return
|
|
16766
|
+
const nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4), ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4), d = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
|
|
16767
|
+
return d == 0 ? !1 : { x: nx / d, y: ny / d };
|
|
16771
16768
|
},
|
|
16772
16769
|
lli4: function(p1, p2, p3, p4) {
|
|
16773
16770
|
const x1 = p1.x, y1 = p1.y, x2 = p2.x, y2 = p2.y, x3 = p3.x, y3 = p3.y, x4 = p4.x, y4 = p4.y;
|
|
@@ -16788,8 +16785,8 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16788
16785
|
},
|
|
16789
16786
|
findbbox: function(sections) {
|
|
16790
16787
|
let mx = nMax, my = nMax, MX = nMin, MY = nMin;
|
|
16791
|
-
return sections.forEach(function(
|
|
16792
|
-
const bbox =
|
|
16788
|
+
return sections.forEach(function(s) {
|
|
16789
|
+
const bbox = s.bbox();
|
|
16793
16790
|
mx > bbox.x.min && (mx = bbox.x.min), my > bbox.y.min && (my = bbox.y.min), MX < bbox.x.max && (MX = bbox.x.max), MY < bbox.y.max && (MY = bbox.y.max);
|
|
16794
16791
|
}), {
|
|
16795
16792
|
x: { min: mx, mid: (mx + MX) / 2, max: MX, size: MX - mx },
|
|
@@ -16825,22 +16822,22 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16825
16822
|
);
|
|
16826
16823
|
}, shape;
|
|
16827
16824
|
},
|
|
16828
|
-
getminmax: function(curve,
|
|
16825
|
+
getminmax: function(curve, d, list) {
|
|
16829
16826
|
if (!list) return { min: 0, max: 0 };
|
|
16830
16827
|
let min2 = nMax, max2 = nMin, t2, c;
|
|
16831
16828
|
list.indexOf(0) === -1 && (list = [0].concat(list)), list.indexOf(1) === -1 && list.push(1);
|
|
16832
16829
|
for (let i2 = 0, len = list.length; i2 < len; i2++)
|
|
16833
|
-
t2 = list[i2], c = curve.get(t2), c[
|
|
16830
|
+
t2 = list[i2], c = curve.get(t2), c[d] < min2 && (min2 = c[d]), c[d] > max2 && (max2 = c[d]);
|
|
16834
16831
|
return { min: min2, mid: (min2 + max2) / 2, max: max2, size: max2 - min2 };
|
|
16835
16832
|
},
|
|
16836
16833
|
align: function(points, line) {
|
|
16837
|
-
const tx = line.p1.x, ty = line.p1.y, a = -atan2(line.p2.y - ty, line.p2.x - tx),
|
|
16834
|
+
const tx = line.p1.x, ty = line.p1.y, a = -atan2(line.p2.y - ty, line.p2.x - tx), d = function(v) {
|
|
16838
16835
|
return {
|
|
16839
16836
|
x: (v.x - tx) * cos$1(a) - (v.y - ty) * sin$1(a),
|
|
16840
16837
|
y: (v.x - tx) * sin$1(a) + (v.y - ty) * cos$1(a)
|
|
16841
16838
|
};
|
|
16842
16839
|
};
|
|
16843
|
-
return points.map(
|
|
16840
|
+
return points.map(d);
|
|
16844
16841
|
},
|
|
16845
16842
|
roots: function(points, line) {
|
|
16846
16843
|
line = line || { p1: { x: 0, y: 0 }, p2: { x: 1, y: 0 } };
|
|
@@ -16848,23 +16845,23 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16848
16845
|
return 0 <= t2 && t2 <= 1;
|
|
16849
16846
|
};
|
|
16850
16847
|
if (order === 2) {
|
|
16851
|
-
const a2 = aligned[0].y, b2 = aligned[1].y, c2 = aligned[2].y,
|
|
16852
|
-
if (
|
|
16853
|
-
const m1 = -sqrt$1(b2 * b2 - a2 * c2), m2 = -a2 + b2, v12 = -(m1 + m2) /
|
|
16848
|
+
const a2 = aligned[0].y, b2 = aligned[1].y, c2 = aligned[2].y, d2 = a2 - 2 * b2 + c2;
|
|
16849
|
+
if (d2 !== 0) {
|
|
16850
|
+
const m1 = -sqrt$1(b2 * b2 - a2 * c2), m2 = -a2 + b2, v12 = -(m1 + m2) / d2, v2 = -(-m1 + m2) / d2;
|
|
16854
16851
|
return [v12, v2].filter(reduce);
|
|
16855
|
-
} else if (b2 !== c2 &&
|
|
16852
|
+
} else if (b2 !== c2 && d2 === 0)
|
|
16856
16853
|
return [(2 * b2 - c2) / (2 * b2 - 2 * c2)].filter(reduce);
|
|
16857
16854
|
return [];
|
|
16858
16855
|
}
|
|
16859
16856
|
const pa = aligned[0].y, pb = aligned[1].y, pc = aligned[2].y, pd = aligned[3].y;
|
|
16860
|
-
let
|
|
16861
|
-
if (utils.approximately(
|
|
16857
|
+
let d = -pa + 3 * pb - 3 * pc + pd, a = 3 * pa - 6 * pb + 3 * pc, b = -3 * pa + 3 * pb, c = pa;
|
|
16858
|
+
if (utils.approximately(d, 0)) {
|
|
16862
16859
|
if (utils.approximately(a, 0))
|
|
16863
16860
|
return utils.approximately(b, 0) ? [] : [-c / b].filter(reduce);
|
|
16864
16861
|
const q3 = sqrt$1(b * b - 4 * a * c), a2 = 2 * a;
|
|
16865
16862
|
return [(q3 - b) / a2, (-b - q3) / a2].filter(reduce);
|
|
16866
16863
|
}
|
|
16867
|
-
a /=
|
|
16864
|
+
a /= d, b /= d, c /= d;
|
|
16868
16865
|
const p = (3 * b - a * a) / 3, p3 = p / 3, q = (2 * a * a * a - 9 * a * b + 27 * c) / 27, q2 = q / 2, discriminant = q2 * q2 + p3 * p3 * p3;
|
|
16869
16866
|
let u1, v1, x1, x2, x3;
|
|
16870
16867
|
if (discriminant < 0) {
|
|
@@ -16881,11 +16878,11 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16881
16878
|
},
|
|
16882
16879
|
droots: function(p) {
|
|
16883
16880
|
if (p.length === 3) {
|
|
16884
|
-
const a = p[0], b = p[1], c = p[2],
|
|
16885
|
-
if (
|
|
16886
|
-
const m1 = -sqrt$1(b * b - a * c), m2 = -a + b, v1 = -(m1 + m2) /
|
|
16881
|
+
const a = p[0], b = p[1], c = p[2], d = a - 2 * b + c;
|
|
16882
|
+
if (d !== 0) {
|
|
16883
|
+
const m1 = -sqrt$1(b * b - a * c), m2 = -a + b, v1 = -(m1 + m2) / d, v2 = -(-m1 + m2) / d;
|
|
16887
16884
|
return [v1, v2];
|
|
16888
|
-
} else if (b !== c &&
|
|
16885
|
+
} else if (b !== c && d === 0)
|
|
16889
16886
|
return [(2 * b - c) / (2 * (b - c))];
|
|
16890
16887
|
return [];
|
|
16891
16888
|
}
|
|
@@ -16897,10 +16894,10 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16897
16894
|
},
|
|
16898
16895
|
curvature: function(t2, d1, d2, _3d, kOnly) {
|
|
16899
16896
|
let num, dnm, adk, dk, k = 0, r2 = 0;
|
|
16900
|
-
const
|
|
16897
|
+
const d = utils.compute(t2, d1), dd = utils.compute(t2, d2), qdsum = d.x * d.x + d.y * d.y;
|
|
16901
16898
|
if (_3d ? (num = sqrt$1(
|
|
16902
|
-
pow(
|
|
16903
|
-
), dnm = pow(qdsum +
|
|
16899
|
+
pow(d.y * dd.z - dd.y * d.z, 2) + pow(d.z * dd.x - dd.z * d.x, 2) + pow(d.x * dd.y - dd.x * d.y, 2)
|
|
16900
|
+
), dnm = pow(qdsum + d.z * d.z, 3 / 2)) : (num = d.x * dd.y - d.y * dd.x, dnm = pow(qdsum, 3 / 2)), num === 0 || dnm === 0)
|
|
16904
16901
|
return { k: 0, r: 0 };
|
|
16905
16902
|
if (k = num / dnm, r2 = dnm / num, !kOnly) {
|
|
16906
16903
|
const pk = utils.curvature(t2 - 1e-3, d1, d2, _3d, !0).k, nk = utils.curvature(t2 + 1e-3, d1, d2, _3d, !0).k;
|
|
@@ -16910,7 +16907,7 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16910
16907
|
},
|
|
16911
16908
|
inflections: function(points) {
|
|
16912
16909
|
if (points.length < 4) return [];
|
|
16913
|
-
const p = utils.align(points, { p1: points[0], p2: points.slice(-1)[0] }), a = p[2].x * p[1].y, b = p[3].x * p[1].y, c = p[1].x * p[2].y,
|
|
16910
|
+
const p = utils.align(points, { p1: points[0], p2: points.slice(-1)[0] }), a = p[2].x * p[1].y, b = p[3].x * p[1].y, c = p[1].x * p[2].y, d = p[3].x * p[2].y, v1 = 18 * (-3 * a + 2 * b + 3 * c - d), v2 = 18 * (3 * a - b - 3 * c), v3 = 18 * (c - a);
|
|
16914
16911
|
if (utils.approximately(v1, 0)) {
|
|
16915
16912
|
if (!utils.approximately(v2, 0)) {
|
|
16916
16913
|
let t2 = -v3 / v2;
|
|
@@ -16918,19 +16915,19 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16918
16915
|
}
|
|
16919
16916
|
return [];
|
|
16920
16917
|
}
|
|
16921
|
-
const
|
|
16922
|
-
if (utils.approximately(
|
|
16918
|
+
const d2 = 2 * v1;
|
|
16919
|
+
if (utils.approximately(d2, 0)) return [];
|
|
16923
16920
|
const trm = v2 * v2 - 4 * v1 * v3;
|
|
16924
16921
|
if (trm < 0) return [];
|
|
16925
16922
|
const sq = Math.sqrt(trm);
|
|
16926
|
-
return [(sq - v2) /
|
|
16923
|
+
return [(sq - v2) / d2, -(v2 + sq) / d2].filter(function(r2) {
|
|
16927
16924
|
return 0 <= r2 && r2 <= 1;
|
|
16928
16925
|
});
|
|
16929
16926
|
},
|
|
16930
16927
|
bboxoverlap: function(b1, b2) {
|
|
16931
16928
|
const dims = ["x", "y"], len = dims.length;
|
|
16932
|
-
for (let i2 = 0, dim,
|
|
16933
|
-
if (dim = dims[i2],
|
|
16929
|
+
for (let i2 = 0, dim, l, t2, d; i2 < len; i2++)
|
|
16930
|
+
if (dim = dims[i2], l = b1[dim].mid, t2 = b2[dim].mid, d = (b1[dim].size + b2[dim].size) / 2, abs$1(l - t2) >= d) return !1;
|
|
16934
16931
|
return !0;
|
|
16935
16932
|
},
|
|
16936
16933
|
expandbox: function(bbox, _bbox) {
|
|
@@ -16962,8 +16959,8 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
16962
16959
|
},
|
|
16963
16960
|
getccenter: function(p1, p2, p3) {
|
|
16964
16961
|
const dx1 = p2.x - p1.x, dy1 = p2.y - p1.y, dx2 = p3.x - p2.x, dy2 = p3.y - p2.y, dx1p = dx1 * cos$1(quart) - dy1 * sin$1(quart), dy1p = dx1 * sin$1(quart) + dy1 * cos$1(quart), dx2p = dx2 * cos$1(quart) - dy2 * sin$1(quart), dy2p = dx2 * sin$1(quart) + dy2 * cos$1(quart), mx1 = (p1.x + p2.x) / 2, my1 = (p1.y + p2.y) / 2, mx2 = (p2.x + p3.x) / 2, my2 = (p2.y + p3.y) / 2, mx1n = mx1 + dx1p, my1n = my1 + dy1p, mx2n = mx2 + dx2p, my2n = my2 + dy2p, arc = utils.lli8(mx1, my1, mx1n, my1n, mx2, my2, mx2n, my2n), r2 = utils.dist(arc, p1);
|
|
16965
|
-
let
|
|
16966
|
-
return
|
|
16962
|
+
let s = atan2(p1.y - arc.y, p1.x - arc.x), m2 = atan2(p2.y - arc.y, p2.x - arc.x), e2 = atan2(p3.y - arc.y, p3.x - arc.x), _;
|
|
16963
|
+
return s < e2 ? ((s > m2 || m2 > e2) && (s += tau), s > e2 && (_ = e2, e2 = s, s = _)) : e2 < m2 && m2 < s ? (_ = e2, e2 = s, s = _) : e2 += tau, arc.s = s, arc.e = e2, arc.r = r2, arc;
|
|
16967
16964
|
},
|
|
16968
16965
|
numberSort: function(a, b) {
|
|
16969
16966
|
return a - b;
|
|
@@ -17000,10 +16997,10 @@ class PolyBezier {
|
|
|
17000
16997
|
utils.expandbox(bbox, c[i2].bbox());
|
|
17001
16998
|
return bbox;
|
|
17002
16999
|
}
|
|
17003
|
-
offset(
|
|
17000
|
+
offset(d) {
|
|
17004
17001
|
const offset2 = [];
|
|
17005
17002
|
return this.curves.forEach(function(v) {
|
|
17006
|
-
offset2.push(...v.offset(
|
|
17003
|
+
offset2.push(...v.offset(d));
|
|
17007
17004
|
}), new PolyBezier(offset2);
|
|
17008
17005
|
}
|
|
17009
17006
|
}
|
|
@@ -17015,8 +17012,8 @@ class Bezier {
|
|
|
17015
17012
|
coordlen = args.length;
|
|
17016
17013
|
const newargs = [];
|
|
17017
17014
|
args.forEach(function(point2) {
|
|
17018
|
-
["x", "y", "z"].forEach(function(
|
|
17019
|
-
typeof point2[
|
|
17015
|
+
["x", "y", "z"].forEach(function(d) {
|
|
17016
|
+
typeof point2[d] < "u" && newargs.push(point2[d]);
|
|
17020
17017
|
});
|
|
17021
17018
|
}), args = newargs;
|
|
17022
17019
|
}
|
|
@@ -17055,11 +17052,11 @@ class Bezier {
|
|
|
17055
17052
|
const abc = Bezier.getABC(2, p1, p2, p3, t2);
|
|
17056
17053
|
return new Bezier(p1, abc.A, p3);
|
|
17057
17054
|
}
|
|
17058
|
-
static cubicFromPoints(S,
|
|
17055
|
+
static cubicFromPoints(S, B, E, t2, d1) {
|
|
17059
17056
|
typeof t2 > "u" && (t2 = 0.5);
|
|
17060
|
-
const abc = Bezier.getABC(3, S,
|
|
17061
|
-
typeof d1 > "u" && (d1 = utils.dist(
|
|
17062
|
-
const d2 = d1 * (1 - t2) / t2, selen = utils.dist(S, E), lx = (E.x - S.x) / selen, ly = (E.y - S.y) / selen, bx1 = d1 * lx, by1 = d1 * ly, bx2 = d2 * lx, by2 = d2 * ly, e1 = { x:
|
|
17057
|
+
const abc = Bezier.getABC(3, S, B, E, t2);
|
|
17058
|
+
typeof d1 > "u" && (d1 = utils.dist(B, abc.C));
|
|
17059
|
+
const d2 = d1 * (1 - t2) / t2, selen = utils.dist(S, E), lx = (E.x - S.x) / selen, ly = (E.y - S.y) / selen, bx1 = d1 * lx, by1 = d1 * ly, bx2 = d2 * lx, by2 = d2 * ly, e1 = { x: B.x - bx1, y: B.y - by1 }, e2 = { x: B.x + bx2, y: B.y + by2 }, A = abc.A, v1 = { x: A.x + (e1.x - A.x) / (1 - t2), y: A.y + (e1.y - A.y) / (1 - t2) }, v2 = { x: A.x + (e2.x - A.x) / t2, y: A.y + (e2.y - A.y) / t2 }, nc1 = { x: S.x + (v1.x - S.x) / t2, y: S.y + (v1.y - S.y) / t2 }, nc2 = {
|
|
17063
17060
|
x: E.x + (v2.x - E.x) / (1 - t2),
|
|
17064
17061
|
y: E.y + (v2.y - E.y) / (1 - t2)
|
|
17065
17062
|
};
|
|
@@ -17082,10 +17079,10 @@ class Bezier {
|
|
|
17082
17079
|
}
|
|
17083
17080
|
toSVG() {
|
|
17084
17081
|
if (this._3d) return !1;
|
|
17085
|
-
const p = this.points, x = p[0].x,
|
|
17082
|
+
const p = this.points, x = p[0].x, y = p[0].y, s = ["M", x, y, this.order === 2 ? "Q" : "C"];
|
|
17086
17083
|
for (let i2 = 1, last = p.length; i2 < last; i2++)
|
|
17087
|
-
|
|
17088
|
-
return
|
|
17084
|
+
s.push(p[i2].x), s.push(p[i2].y);
|
|
17085
|
+
return s.join(" ");
|
|
17089
17086
|
}
|
|
17090
17087
|
setRatios(ratios) {
|
|
17091
17088
|
if (ratios.length !== this.points.length)
|
|
@@ -17111,20 +17108,20 @@ class Bezier {
|
|
|
17111
17108
|
length() {
|
|
17112
17109
|
return utils.length(this.derivative.bind(this));
|
|
17113
17110
|
}
|
|
17114
|
-
static getABC(order = 2, S,
|
|
17115
|
-
const
|
|
17116
|
-
x:
|
|
17117
|
-
y:
|
|
17118
|
-
},
|
|
17111
|
+
static getABC(order = 2, S, B, E, t2 = 0.5) {
|
|
17112
|
+
const u = utils.projectionratio(t2, order), um = 1 - u, C = {
|
|
17113
|
+
x: u * S.x + um * E.x,
|
|
17114
|
+
y: u * S.y + um * E.y
|
|
17115
|
+
}, s = utils.abcratio(t2, order);
|
|
17119
17116
|
return { A: {
|
|
17120
|
-
x:
|
|
17121
|
-
y:
|
|
17122
|
-
}, B
|
|
17117
|
+
x: B.x + (B.x - C.x) / s,
|
|
17118
|
+
y: B.y + (B.y - C.y) / s
|
|
17119
|
+
}, B, C, S, E };
|
|
17123
17120
|
}
|
|
17124
|
-
getABC(t2,
|
|
17125
|
-
|
|
17121
|
+
getABC(t2, B) {
|
|
17122
|
+
B = B || this.get(t2);
|
|
17126
17123
|
let S = this.points[0], E = this.points[this.order];
|
|
17127
|
-
return Bezier.getABC(this.order, S,
|
|
17124
|
+
return Bezier.getABC(this.order, S, B, E, t2);
|
|
17128
17125
|
}
|
|
17129
17126
|
getLUT(steps) {
|
|
17130
17127
|
if (this.verify(), steps = steps || 100, this._lut.length === steps + 1)
|
|
@@ -17142,11 +17139,11 @@ class Bezier {
|
|
|
17142
17139
|
return hits.length ? t /= hits.length : !1;
|
|
17143
17140
|
}
|
|
17144
17141
|
project(point) {
|
|
17145
|
-
const LUT = this.getLUT(),
|
|
17142
|
+
const LUT = this.getLUT(), l = LUT.length - 1, closest = utils.closest(LUT, point), mpos = closest.mpos, t1 = (mpos - 1) / l, t2 = (mpos + 1) / l, step = 0.1 / l;
|
|
17146
17143
|
let mdist = closest.mdist, t3 = t1, ft = t3, p;
|
|
17147
17144
|
mdist += 1;
|
|
17148
|
-
for (let
|
|
17149
|
-
p = this.compute(t3),
|
|
17145
|
+
for (let d; t3 < t2 + step; t3 += step)
|
|
17146
|
+
p = this.compute(t3), d = utils.dist(point, p), d < mdist && (mdist = d, ft = t3);
|
|
17150
17147
|
return ft = ft < 0 ? 0 : ft > 1 ? 1 : ft, p = this.compute(ft), p.t = ft, p.d = mdist, p;
|
|
17151
17148
|
}
|
|
17152
17149
|
get(t2) {
|
|
@@ -17187,8 +17184,8 @@ class Bezier {
|
|
|
17187
17184
|
return this._3d ? this.__normal3(t2) : this.__normal2(t2);
|
|
17188
17185
|
}
|
|
17189
17186
|
__normal2(t2) {
|
|
17190
|
-
const
|
|
17191
|
-
return { t: t2, x: -
|
|
17187
|
+
const d = this.derivative(t2), q = sqrt(d.x * d.x + d.y * d.y);
|
|
17188
|
+
return { t: t2, x: -d.y / q, y: d.x / q };
|
|
17192
17189
|
}
|
|
17193
17190
|
__normal3(t2) {
|
|
17194
17191
|
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);
|
|
@@ -17221,7 +17218,7 @@ class Bezier {
|
|
|
17221
17218
|
let p = this.points, _p = [], q = [], idx = 0;
|
|
17222
17219
|
for (q[idx++] = p[0], q[idx++] = p[1], q[idx++] = p[2], this.order === 3 && (q[idx++] = p[3]); p.length > 1; ) {
|
|
17223
17220
|
_p = [];
|
|
17224
|
-
for (let i2 = 0, pt,
|
|
17221
|
+
for (let i2 = 0, pt, l = p.length - 1; i2 < l; i2++)
|
|
17225
17222
|
pt = utils.lerp(t2, p[i2], p[i2 + 1]), q[idx++] = pt, _p.push(pt);
|
|
17226
17223
|
p = _p;
|
|
17227
17224
|
}
|
|
@@ -17258,8 +17255,8 @@ class Bezier {
|
|
|
17258
17255
|
bbox() {
|
|
17259
17256
|
const extrema = this.extrema(), result = {};
|
|
17260
17257
|
return this.dims.forEach(
|
|
17261
|
-
function(
|
|
17262
|
-
result[
|
|
17258
|
+
function(d) {
|
|
17259
|
+
result[d] = utils.getminmax(this, d, extrema[d]);
|
|
17263
17260
|
}.bind(this)
|
|
17264
17261
|
), result;
|
|
17265
17262
|
}
|
|
@@ -17267,15 +17264,15 @@ class Bezier {
|
|
|
17267
17264
|
const lbbox = this.bbox(), tbbox = curve.bbox();
|
|
17268
17265
|
return utils.bboxoverlap(lbbox, tbbox);
|
|
17269
17266
|
}
|
|
17270
|
-
offset(t2,
|
|
17271
|
-
if (typeof
|
|
17267
|
+
offset(t2, d) {
|
|
17268
|
+
if (typeof d < "u") {
|
|
17272
17269
|
const c = this.get(t2), n2 = this.normal(t2), ret = {
|
|
17273
17270
|
c,
|
|
17274
17271
|
n: n2,
|
|
17275
|
-
x: c.x + n2.x *
|
|
17276
|
-
y: c.y + n2.y *
|
|
17272
|
+
x: c.x + n2.x * d,
|
|
17273
|
+
y: c.y + n2.y * d
|
|
17277
17274
|
};
|
|
17278
|
-
return this._3d && (ret.z = c.z + n2.z *
|
|
17275
|
+
return this._3d && (ret.z = c.z + n2.z * d), ret;
|
|
17279
17276
|
}
|
|
17280
17277
|
if (this._linear) {
|
|
17281
17278
|
const nv = this.normal(0), coords = this.points.map(function(p) {
|
|
@@ -17287,8 +17284,8 @@ class Bezier {
|
|
|
17287
17284
|
});
|
|
17288
17285
|
return [new Bezier(coords)];
|
|
17289
17286
|
}
|
|
17290
|
-
return this.reduce().map(function(
|
|
17291
|
-
return
|
|
17287
|
+
return this.reduce().map(function(s) {
|
|
17288
|
+
return s._linear ? s.offset(t2)[0] : s.scale(t2);
|
|
17292
17289
|
});
|
|
17293
17290
|
}
|
|
17294
17291
|
simple() {
|
|
@@ -17297,8 +17294,8 @@ class Bezier {
|
|
|
17297
17294
|
if (a1 > 0 && a2 < 0 || a1 < 0 && a2 > 0) return !1;
|
|
17298
17295
|
}
|
|
17299
17296
|
const n1 = this.normal(0), n2 = this.normal(1);
|
|
17300
|
-
let
|
|
17301
|
-
return this._3d && (
|
|
17297
|
+
let s = n1.x * n2.x + n1.y * n2.y;
|
|
17298
|
+
return this._3d && (s += n1.z * n2.z), abs(acos(s)) < pi / 3;
|
|
17302
17299
|
}
|
|
17303
17300
|
reduce() {
|
|
17304
17301
|
let i2, t1 = 0, t2 = 0, step = 0.01, segment, pass1 = [], pass2 = [], extrema = this.extrema().values;
|
|
@@ -17318,29 +17315,29 @@ class Bezier {
|
|
|
17318
17315
|
}
|
|
17319
17316
|
translate(v, d1, d2) {
|
|
17320
17317
|
d2 = typeof d2 == "number" ? d2 : d1;
|
|
17321
|
-
const
|
|
17322
|
-
let
|
|
17318
|
+
const o = this.order;
|
|
17319
|
+
let d = this.points.map((_, i2) => (1 - i2 / o) * d1 + i2 / o * d2);
|
|
17323
17320
|
return new Bezier(
|
|
17324
17321
|
this.points.map((p, i2) => ({
|
|
17325
|
-
x: p.x + v.x *
|
|
17326
|
-
y: p.y + v.y *
|
|
17322
|
+
x: p.x + v.x * d[i2],
|
|
17323
|
+
y: p.y + v.y * d[i2]
|
|
17327
17324
|
}))
|
|
17328
17325
|
);
|
|
17329
17326
|
}
|
|
17330
|
-
scale(
|
|
17327
|
+
scale(d) {
|
|
17331
17328
|
const order = this.order;
|
|
17332
17329
|
let distanceFn = !1;
|
|
17333
|
-
if (typeof
|
|
17330
|
+
if (typeof d == "function" && (distanceFn = d), distanceFn && order === 2)
|
|
17334
17331
|
return this.raise().scale(distanceFn);
|
|
17335
17332
|
const clockwise = this.clockwise, points = this.points;
|
|
17336
17333
|
if (this._linear)
|
|
17337
17334
|
return this.translate(
|
|
17338
17335
|
this.normal(0),
|
|
17339
|
-
distanceFn ? distanceFn(0) :
|
|
17340
|
-
distanceFn ? distanceFn(1) :
|
|
17336
|
+
distanceFn ? distanceFn(0) : d,
|
|
17337
|
+
distanceFn ? distanceFn(1) : d
|
|
17341
17338
|
);
|
|
17342
|
-
const r1 = distanceFn ? distanceFn(0) :
|
|
17343
|
-
if (!
|
|
17339
|
+
const r1 = distanceFn ? distanceFn(0) : d, r2 = distanceFn ? distanceFn(1) : d, v = [this.offset(0, 10), this.offset(1, 10)], np = [], o = utils.lli4(v[0], v[0].c, v[1], v[1].c);
|
|
17340
|
+
if (!o)
|
|
17344
17341
|
throw new Error("cannot scale this curve. Try reducing it first.");
|
|
17345
17342
|
return [0, 1].forEach(function(t2) {
|
|
17346
17343
|
const p = np[t2 * order] = utils.copy(points[t2 * order]);
|
|
@@ -17348,9 +17345,9 @@ class Bezier {
|
|
|
17348
17345
|
}), distanceFn ? ([0, 1].forEach(function(t2) {
|
|
17349
17346
|
if (!(order === 2 && t2)) {
|
|
17350
17347
|
var p = points[t2 + 1], ov = {
|
|
17351
|
-
x: p.x -
|
|
17352
|
-
y: p.y -
|
|
17353
|
-
}, rc = distanceFn ? distanceFn((t2 + 1) / order) :
|
|
17348
|
+
x: p.x - o.x,
|
|
17349
|
+
y: p.y - o.y
|
|
17350
|
+
}, rc = distanceFn ? distanceFn((t2 + 1) / order) : d;
|
|
17354
17351
|
distanceFn && !clockwise && (rc = -rc);
|
|
17355
17352
|
var m2 = sqrt(ov.x * ov.x + ov.y * ov.y);
|
|
17356
17353
|
ov.x /= m2, ov.y /= m2, np[t2 + 1] = {
|
|
@@ -17360,27 +17357,27 @@ class Bezier {
|
|
|
17360
17357
|
}
|
|
17361
17358
|
}), new Bezier(np)) : ([0, 1].forEach((t2) => {
|
|
17362
17359
|
if (order === 2 && t2) return;
|
|
17363
|
-
const p = np[t2 * order],
|
|
17364
|
-
np[t2 + 1] = utils.lli4(p, p2,
|
|
17360
|
+
const p = np[t2 * order], d2 = this.derivative(t2), p2 = { x: p.x + d2.x, y: p.y + d2.y };
|
|
17361
|
+
np[t2 + 1] = utils.lli4(p, p2, o, points[t2 + 1]);
|
|
17365
17362
|
}), new Bezier(np));
|
|
17366
17363
|
}
|
|
17367
17364
|
outline(d1, d2, d3, d4) {
|
|
17368
17365
|
if (d2 = d2 === void 0 ? d1 : d2, this._linear) {
|
|
17369
17366
|
const n2 = this.normal(0), start2 = this.points[0], end = this.points[this.points.length - 1];
|
|
17370
|
-
let
|
|
17371
|
-
d3 === void 0 && (d3 = d1, d4 = d2),
|
|
17372
|
-
const fline = [
|
|
17373
|
-
|
|
17374
|
-
const bline = [e2, mid,
|
|
17367
|
+
let s, mid, e2;
|
|
17368
|
+
d3 === void 0 && (d3 = d1, d4 = d2), s = { x: start2.x + n2.x * d1, y: start2.y + n2.y * d1 }, e2 = { x: end.x + n2.x * d3, y: end.y + n2.y * d3 }, mid = { x: (s.x + e2.x) / 2, y: (s.y + e2.y) / 2 };
|
|
17369
|
+
const fline = [s, mid, e2];
|
|
17370
|
+
s = { x: start2.x - n2.x * d2, y: start2.y - n2.y * d2 }, e2 = { x: end.x - n2.x * d4, y: end.y - n2.y * d4 }, mid = { x: (s.x + e2.x) / 2, y: (s.y + e2.y) / 2 };
|
|
17371
|
+
const bline = [e2, mid, s], ls2 = utils.makeline(bline[2], fline[0]), le2 = utils.makeline(fline[2], bline[0]), segments2 = [ls2, new Bezier(fline), le2, new Bezier(bline)];
|
|
17375
17372
|
return new PolyBezier(segments2);
|
|
17376
17373
|
}
|
|
17377
17374
|
const reduced = this.reduce(), len = reduced.length, fcurves = [];
|
|
17378
17375
|
let bcurves = [], p, alen = 0, tlen = this.length();
|
|
17379
17376
|
const graduated = typeof d3 < "u" && typeof d4 < "u";
|
|
17380
|
-
function linearDistanceFunction(
|
|
17377
|
+
function linearDistanceFunction(s, e2, tlen2, alen2, slen) {
|
|
17381
17378
|
return function(v) {
|
|
17382
|
-
const f1 = alen2 / tlen2, f2 = (alen2 + slen) / tlen2,
|
|
17383
|
-
return utils.map(v, 0, 1,
|
|
17379
|
+
const f1 = alen2 / tlen2, f2 = (alen2 + slen) / tlen2, d = e2 - s;
|
|
17380
|
+
return utils.map(v, 0, 1, s + f1 * d, s + f2 * d);
|
|
17384
17381
|
};
|
|
17385
17382
|
}
|
|
17386
17383
|
reduced.forEach(function(segment) {
|
|
@@ -17390,8 +17387,8 @@ class Bezier {
|
|
|
17390
17387
|
), bcurves.push(
|
|
17391
17388
|
segment.scale(linearDistanceFunction(-d2, -d4, tlen, alen, slen))
|
|
17392
17389
|
)) : (fcurves.push(segment.scale(d1)), bcurves.push(segment.scale(-d2))), alen += slen;
|
|
17393
|
-
}), bcurves = bcurves.map(function(
|
|
17394
|
-
return p =
|
|
17390
|
+
}), bcurves = bcurves.map(function(s) {
|
|
17391
|
+
return p = s.points, p[3] ? s.points = [p[3], p[2], p[1], p[0]] : s.points = [p[2], p[1], p[0]], s;
|
|
17395
17392
|
}).reverse();
|
|
17396
17393
|
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);
|
|
17397
17394
|
return new PolyBezier(segments);
|
|
@@ -17431,9 +17428,9 @@ class Bezier {
|
|
|
17431
17428
|
}
|
|
17432
17429
|
curveintersects(c1, c2, curveIntersectionThreshold) {
|
|
17433
17430
|
const pairs = [];
|
|
17434
|
-
c1.forEach(function(
|
|
17431
|
+
c1.forEach(function(l) {
|
|
17435
17432
|
c2.forEach(function(r2) {
|
|
17436
|
-
|
|
17433
|
+
l.overlaps(r2) && pairs.push({ left: l, right: r2 });
|
|
17437
17434
|
});
|
|
17438
17435
|
});
|
|
17439
17436
|
let intersections = [];
|
|
@@ -17449,8 +17446,8 @@ class Bezier {
|
|
|
17449
17446
|
arcs(errorThreshold) {
|
|
17450
17447
|
return errorThreshold = errorThreshold || 0.5, this._iterate(errorThreshold, []);
|
|
17451
17448
|
}
|
|
17452
|
-
_error(pc, np1,
|
|
17453
|
-
const q = (e2 -
|
|
17449
|
+
_error(pc, np1, s, e2) {
|
|
17450
|
+
const q = (e2 - s) / 4, c1 = this.get(s + q), c2 = this.get(e2 - q), ref = utils.dist(pc, np1), d1 = utils.dist(pc, c1), d2 = utils.dist(pc, c2);
|
|
17454
17451
|
return abs(d1 - ref) + abs(d2 - ref);
|
|
17455
17452
|
}
|
|
17456
17453
|
_iterate(errorThreshold, circles) {
|
|
@@ -17465,11 +17462,11 @@ class Bezier {
|
|
|
17465
17462
|
}, curr_good = this._error(arc, np1, t_s, t_e) <= errorThreshold, done = prev_good && !curr_good, done || (prev_e = t_e), curr_good) {
|
|
17466
17463
|
if (t_e >= 1) {
|
|
17467
17464
|
if (arc.interval.end = prev_e = 1, prev_arc = arc, t_e > 1) {
|
|
17468
|
-
let
|
|
17465
|
+
let d = {
|
|
17469
17466
|
x: arc.x + arc.r * cos(arc.e),
|
|
17470
17467
|
y: arc.y + arc.r * sin(arc.e)
|
|
17471
17468
|
};
|
|
17472
|
-
arc.e += utils.angle({ x: arc.x, y: arc.y },
|
|
17469
|
+
arc.e += utils.angle({ x: arc.x, y: arc.y }, d, this.get(1));
|
|
17473
17470
|
}
|
|
17474
17471
|
break;
|
|
17475
17472
|
}
|
|
@@ -17490,13 +17487,13 @@ function bezierControlPoints(diagramEdge) {
|
|
|
17490
17487
|
const handles = [
|
|
17491
17488
|
// start
|
|
17492
17489
|
];
|
|
17493
|
-
for (;
|
|
17490
|
+
for (; t$6(bezierPoints, 3); ) {
|
|
17494
17491
|
const [cp1, cp2, end, ...rest] = bezierPoints, bezier = new Bezier(start2[0], start2[1], cp1[0], cp1[1], cp2[0], cp2[1], end[0], end[1]), inflections = bezier.inflections();
|
|
17495
17492
|
inflections.length === 0 && inflections.push(0.5), inflections.forEach((t2) => {
|
|
17496
|
-
const { x, y
|
|
17493
|
+
const { x, y } = bezier.get(t2);
|
|
17497
17494
|
handles.push({
|
|
17498
17495
|
x: Math.round(x),
|
|
17499
|
-
y: Math.round(
|
|
17496
|
+
y: Math.round(y)
|
|
17500
17497
|
});
|
|
17501
17498
|
}), bezierPoints = rest, start2 = end;
|
|
17502
17499
|
}
|
|
@@ -17504,7 +17501,7 @@ function bezierControlPoints(diagramEdge) {
|
|
|
17504
17501
|
}
|
|
17505
17502
|
const isClose = (a, b) => Math.abs(a - b) < 3.1;
|
|
17506
17503
|
function isSamePoint(a, b) {
|
|
17507
|
-
const [ax, ay] =
|
|
17504
|
+
const [ax, ay] = e$4(a) ? a : [a.x, a.y], [bx, by] = e$4(b) ? b : [b.x, b.y];
|
|
17508
17505
|
return isClose(ax, bx) && isClose(ay, by);
|
|
17509
17506
|
}
|
|
17510
17507
|
function stopPropagation(e2) {
|
|
@@ -17521,7 +17518,7 @@ function bezierPath(bezierSpline) {
|
|
|
17521
17518
|
let [start2, ...points] = bezierSpline;
|
|
17522
17519
|
invariant(start2, "start should be defined");
|
|
17523
17520
|
let path = `M ${start2[0]},${start2[1]}`;
|
|
17524
|
-
for (;
|
|
17521
|
+
for (; t$6(points, 3); ) {
|
|
17525
17522
|
const [cp1, cp2, end, ...rest] = points;
|
|
17526
17523
|
path = path + ` C ${cp1[0]},${cp1[1]} ${cp2[0]},${cp2[1]} ${end[0]},${end[1]}`, points = rest;
|
|
17527
17524
|
}
|
|
@@ -18409,19 +18406,19 @@ function getProperAncestors(stateNode, toStateNode) {
|
|
|
18409
18406
|
}
|
|
18410
18407
|
function getAllStateNodes(stateNodes) {
|
|
18411
18408
|
const nodeSet = new Set(stateNodes), adjList = getAdjList(nodeSet);
|
|
18412
|
-
for (const
|
|
18413
|
-
if (
|
|
18414
|
-
getInitialStateNodesWithTheirAncestors(
|
|
18415
|
-
else if (
|
|
18416
|
-
for (const child of getChildren(
|
|
18409
|
+
for (const s of nodeSet)
|
|
18410
|
+
if (s.type === "compound" && (!adjList.get(s) || !adjList.get(s).length))
|
|
18411
|
+
getInitialStateNodesWithTheirAncestors(s).forEach((sn) => nodeSet.add(sn));
|
|
18412
|
+
else if (s.type === "parallel") {
|
|
18413
|
+
for (const child of getChildren(s))
|
|
18417
18414
|
if (child.type !== "history" && !nodeSet.has(child)) {
|
|
18418
18415
|
const initialStates = getInitialStateNodesWithTheirAncestors(child);
|
|
18419
18416
|
for (const initialStateNode of initialStates)
|
|
18420
18417
|
nodeSet.add(initialStateNode);
|
|
18421
18418
|
}
|
|
18422
18419
|
}
|
|
18423
|
-
for (const
|
|
18424
|
-
let m2 =
|
|
18420
|
+
for (const s of nodeSet) {
|
|
18421
|
+
let m2 = s.parent;
|
|
18425
18422
|
for (; m2; )
|
|
18426
18423
|
nodeSet.add(m2), m2 = m2.parent;
|
|
18427
18424
|
}
|
|
@@ -18446,8 +18443,8 @@ function getValueFromAdj(baseNode, adjList) {
|
|
|
18446
18443
|
}
|
|
18447
18444
|
function getAdjList(stateNodes) {
|
|
18448
18445
|
const adjList = /* @__PURE__ */ new Map();
|
|
18449
|
-
for (const
|
|
18450
|
-
adjList.has(
|
|
18446
|
+
for (const s of stateNodes)
|
|
18447
|
+
adjList.has(s) || adjList.set(s, []), s.parent && (adjList.has(s.parent) || adjList.set(s.parent, []), adjList.get(s.parent).push(s));
|
|
18451
18448
|
return adjList;
|
|
18452
18449
|
}
|
|
18453
18450
|
function getStateValue(rootNode, stateNodes) {
|
|
@@ -18455,7 +18452,7 @@ function getStateValue(rootNode, stateNodes) {
|
|
|
18455
18452
|
return getValueFromAdj(rootNode, getAdjList(config));
|
|
18456
18453
|
}
|
|
18457
18454
|
function isInFinalState(stateNodeSet, stateNode) {
|
|
18458
|
-
return stateNode.type === "compound" ? getChildren(stateNode).some((
|
|
18455
|
+
return stateNode.type === "compound" ? getChildren(stateNode).some((s) => s.type === "final" && stateNodeSet.has(s)) : stateNode.type === "parallel" ? getChildren(stateNode).every((sn) => isInFinalState(stateNodeSet, sn)) : stateNode.type === "final";
|
|
18459
18456
|
}
|
|
18460
18457
|
const isStateId = (str) => str[0] === STATE_IDENTIFIER;
|
|
18461
18458
|
function getCandidates(stateNode, receivedEventType) {
|
|
@@ -18845,15 +18842,15 @@ function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mu
|
|
|
18845
18842
|
function computeEntrySet(transitions2, historyValue, statesForDefaultEntry, statesToEnter) {
|
|
18846
18843
|
for (const t2 of transitions2) {
|
|
18847
18844
|
const domain = getTransitionDomain(t2, historyValue);
|
|
18848
|
-
for (const
|
|
18849
|
-
!isHistoryNode(
|
|
18850
|
-
(t2.source !==
|
|
18845
|
+
for (const s of t2.target || [])
|
|
18846
|
+
!isHistoryNode(s) && // if the target is different than the source then it will *definitely* be entered
|
|
18847
|
+
(t2.source !== s || // we know that the domain can't lie within the source
|
|
18851
18848
|
// if it's different than the source then it's outside of it and it means that the target has to be entered as well
|
|
18852
18849
|
t2.source !== domain || // reentering transitions always enter the target, even if it's the source itself
|
|
18853
|
-
t2.reenter) && (statesToEnter.add(
|
|
18850
|
+
t2.reenter) && (statesToEnter.add(s), statesForDefaultEntry.add(s)), addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);
|
|
18854
18851
|
const targetStates = getEffectiveTargetStates(t2, historyValue);
|
|
18855
|
-
for (const
|
|
18856
|
-
const ancestors = getProperAncestors(
|
|
18852
|
+
for (const s of targetStates) {
|
|
18853
|
+
const ancestors = getProperAncestors(s, domain);
|
|
18857
18854
|
domain?.type === "parallel" && ancestors.push(domain), addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, ancestors, !t2.source.parent && t2.reenter ? void 0 : domain);
|
|
18858
18855
|
}
|
|
18859
18856
|
}
|
|
@@ -18862,29 +18859,29 @@ function addDescendantStatesToEnter(stateNode, historyValue, statesForDefaultEnt
|
|
|
18862
18859
|
if (isHistoryNode(stateNode))
|
|
18863
18860
|
if (historyValue[stateNode.id]) {
|
|
18864
18861
|
const historyStateNodes = historyValue[stateNode.id];
|
|
18865
|
-
for (const
|
|
18866
|
-
statesToEnter.add(
|
|
18867
|
-
for (const
|
|
18868
|
-
addProperAncestorStatesToEnter(
|
|
18862
|
+
for (const s of historyStateNodes)
|
|
18863
|
+
statesToEnter.add(s), addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);
|
|
18864
|
+
for (const s of historyStateNodes)
|
|
18865
|
+
addProperAncestorStatesToEnter(s, stateNode.parent, statesToEnter, historyValue, statesForDefaultEntry);
|
|
18869
18866
|
} else {
|
|
18870
18867
|
const historyDefaultTransition = resolveHistoryDefaultTransition(stateNode);
|
|
18871
|
-
for (const
|
|
18872
|
-
statesToEnter.add(
|
|
18873
|
-
for (const
|
|
18874
|
-
addProperAncestorStatesToEnter(
|
|
18868
|
+
for (const s of historyDefaultTransition.target)
|
|
18869
|
+
statesToEnter.add(s), historyDefaultTransition === stateNode.parent?.initial && statesForDefaultEntry.add(stateNode.parent), addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);
|
|
18870
|
+
for (const s of historyDefaultTransition.target)
|
|
18871
|
+
addProperAncestorStatesToEnter(s, stateNode.parent, statesToEnter, historyValue, statesForDefaultEntry);
|
|
18875
18872
|
}
|
|
18876
18873
|
else if (stateNode.type === "compound") {
|
|
18877
18874
|
const [initialState] = stateNode.initial.target;
|
|
18878
18875
|
isHistoryNode(initialState) || (statesToEnter.add(initialState), statesForDefaultEntry.add(initialState)), addDescendantStatesToEnter(initialState, historyValue, statesForDefaultEntry, statesToEnter), addProperAncestorStatesToEnter(initialState, stateNode, statesToEnter, historyValue, statesForDefaultEntry);
|
|
18879
18876
|
} else if (stateNode.type === "parallel")
|
|
18880
18877
|
for (const child of getChildren(stateNode).filter((sn) => !isHistoryNode(sn)))
|
|
18881
|
-
[...statesToEnter].some((
|
|
18878
|
+
[...statesToEnter].some((s) => isDescendant(s, child)) || (isHistoryNode(child) || (statesToEnter.add(child), statesForDefaultEntry.add(child)), addDescendantStatesToEnter(child, historyValue, statesForDefaultEntry, statesToEnter));
|
|
18882
18879
|
}
|
|
18883
18880
|
function addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, ancestors, reentrancyDomain) {
|
|
18884
18881
|
for (const anc of ancestors)
|
|
18885
18882
|
if ((!reentrancyDomain || isDescendant(anc, reentrancyDomain)) && statesToEnter.add(anc), anc.type === "parallel")
|
|
18886
18883
|
for (const child of getChildren(anc).filter((sn) => !isHistoryNode(sn)))
|
|
18887
|
-
[...statesToEnter].some((
|
|
18884
|
+
[...statesToEnter].some((s) => isDescendant(s, child)) || (statesToEnter.add(child), addDescendantStatesToEnter(child, historyValue, statesForDefaultEntry, statesToEnter));
|
|
18888
18885
|
}
|
|
18889
18886
|
function addProperAncestorStatesToEnter(stateNode, toStateNode, statesToEnter, historyValue, statesForDefaultEntry) {
|
|
18890
18887
|
addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, getProperAncestors(stateNode, toStateNode));
|
|
@@ -18901,8 +18898,8 @@ function exitStates(currentSnapshot, event, actorScope, transitions2, mutStateNo
|
|
|
18901
18898
|
...historyValue
|
|
18902
18899
|
}, changedHistory[historyNode.id] = Array.from(mutStateNodeSet).filter(predicate);
|
|
18903
18900
|
}
|
|
18904
|
-
for (const
|
|
18905
|
-
nextSnapshot = resolveActionsAndContext(nextSnapshot, event, actorScope, [...
|
|
18901
|
+
for (const s of statesToExit)
|
|
18902
|
+
nextSnapshot = resolveActionsAndContext(nextSnapshot, event, actorScope, [...s.exit, ...s.invoke.map((def) => stopChild(def.id))], internalQueue, void 0), mutStateNodeSet.delete(s);
|
|
18906
18903
|
return [nextSnapshot, changedHistory || historyValue];
|
|
18907
18904
|
}
|
|
18908
18905
|
function getAction(machine, actionType) {
|
|
@@ -19029,9 +19026,9 @@ function selectTransitions(event, nextState) {
|
|
|
19029
19026
|
function selectEventlessTransitions(nextState, event) {
|
|
19030
19027
|
const enabledTransitionSet = /* @__PURE__ */ new Set(), atomicStates = nextState._nodes.filter(isAtomicStateNode);
|
|
19031
19028
|
for (const stateNode of atomicStates)
|
|
19032
|
-
loop: for (const
|
|
19033
|
-
if (
|
|
19034
|
-
for (const transition of
|
|
19029
|
+
loop: for (const s of [stateNode].concat(getProperAncestors(stateNode, void 0)))
|
|
19030
|
+
if (s.always) {
|
|
19031
|
+
for (const transition of s.always)
|
|
19035
19032
|
if (transition.guard === void 0 || evaluateGuard(transition.guard, nextState.context, event, nextState)) {
|
|
19036
19033
|
enabledTransitionSet.add(transition);
|
|
19037
19034
|
break loop;
|
|
@@ -19444,7 +19441,7 @@ function useDiagramActorSnapshot(selector2, compare = shallowEqual) {
|
|
|
19444
19441
|
return useSelector(actorRef, useCallbackRef(selector2), compare);
|
|
19445
19442
|
}
|
|
19446
19443
|
function useDiagramContext(selector2, compare = shallowEqual, deps) {
|
|
19447
|
-
const actorRef = useDiagramActorRef(), select2 = useCallback((
|
|
19444
|
+
const actorRef = useDiagramActorRef(), select2 = useCallback((s) => selector2(s.context), deps ?? []);
|
|
19448
19445
|
return useSelector(actorRef, select2, compare);
|
|
19449
19446
|
}
|
|
19450
19447
|
function useOnDiagramEvent(event, callback) {
|
|
@@ -19821,18 +19818,18 @@ function CompoundNodeContainer({
|
|
|
19821
19818
|
style: style2,
|
|
19822
19819
|
...rest
|
|
19823
19820
|
}) {
|
|
19824
|
-
let opacity =
|
|
19821
|
+
let opacity = t$9(data.style.opacity ?? 100, {
|
|
19825
19822
|
min: 0,
|
|
19826
19823
|
max: 100
|
|
19827
19824
|
});
|
|
19828
|
-
const isTransparent = opacity < 99, MIN_OPACITY = 65, borderOpacity = MIN_OPACITY +
|
|
19825
|
+
const isTransparent = opacity < 99, MIN_OPACITY = 65, borderOpacity = MIN_OPACITY + t$9((100 - MIN_OPACITY) * (opacity / 100), {
|
|
19829
19826
|
min: 0,
|
|
19830
19827
|
max: 100 - MIN_OPACITY
|
|
19831
19828
|
}), compoundClass = compoundNode({
|
|
19832
19829
|
isTransparent,
|
|
19833
19830
|
inverseColor: opacity < 60,
|
|
19834
19831
|
borderStyle: data.style.border ?? (isTransparent ? "dashed" : "none")
|
|
19835
|
-
}), depth =
|
|
19832
|
+
}), depth = t$9(data.depth ?? 1, {
|
|
19836
19833
|
min: 1,
|
|
19837
19834
|
max: 5
|
|
19838
19835
|
});
|
|
@@ -20502,9 +20499,9 @@ function ElementTitle({ id: id2, data, iconSize }) {
|
|
|
20502
20499
|
},
|
|
20503
20500
|
className: elementNodeIcon()
|
|
20504
20501
|
}), classes2 = elementNodeData({
|
|
20505
|
-
hasIcon:
|
|
20502
|
+
hasIcon: e(elementIcon),
|
|
20506
20503
|
hasDescription: !!data.description?.nonEmpty,
|
|
20507
|
-
hasTechnology: !
|
|
20504
|
+
hasTechnology: !e$3(data.technology ?? "")
|
|
20508
20505
|
}), size2 = nodeSizes(data.style).size, isSmOrXs = size2 === "sm" || size2 === "xs";
|
|
20509
20506
|
return /* @__PURE__ */ jsxs(
|
|
20510
20507
|
Box,
|
|
@@ -20513,7 +20510,7 @@ function ElementTitle({ id: id2, data, iconSize }) {
|
|
|
20513
20510
|
classes2.root,
|
|
20514
20511
|
"likec4-element"
|
|
20515
20512
|
),
|
|
20516
|
-
style: e(iconSize) ? {
|
|
20513
|
+
style: e$1(iconSize) ? {
|
|
20517
20514
|
// @ts-ignore
|
|
20518
20515
|
"--likec4-icon-size": `${iconSize}px`
|
|
20519
20516
|
} : void 0,
|
|
@@ -20592,7 +20589,7 @@ const style = {
|
|
|
20592
20589
|
}
|
|
20593
20590
|
}), buttons2;
|
|
20594
20591
|
}, [enableNavigateTo, enableRelationshipBrowser, diagram, modelFqn, navigateTo, props.id]);
|
|
20595
|
-
return extraButtons &&
|
|
20592
|
+
return extraButtons && t$6(extraButtons, 1) && (buttons = [...buttons, ...extraButtons]), /* @__PURE__ */ jsx(ElementActionButtons, { ...props, buttons });
|
|
20596
20593
|
}, DeploymentElementActions = ({
|
|
20597
20594
|
extraButtons,
|
|
20598
20595
|
...props
|
|
@@ -20614,7 +20611,7 @@ const style = {
|
|
|
20614
20611
|
}
|
|
20615
20612
|
}), buttons2;
|
|
20616
20613
|
}, [enableNavigateTo, enableRelationshipBrowser, diagram, modelFqn, navigateTo, props.id]);
|
|
20617
|
-
return extraButtons &&
|
|
20614
|
+
return extraButtons && t$6(extraButtons, 1) && (buttons = [...buttons, ...extraButtons]), /* @__PURE__ */ jsx(ElementActionButtons, { ...props, buttons });
|
|
20618
20615
|
}, {
|
|
20619
20616
|
primary,
|
|
20620
20617
|
secondary,
|
|
@@ -20624,7 +20621,7 @@ const style = {
|
|
|
20624
20621
|
{ key: "primary", value: primary.fill },
|
|
20625
20622
|
{ key: "secondary", value: secondary.fill },
|
|
20626
20623
|
{ key: "muted", value: muted.fill }
|
|
20627
|
-
], colors = t$
|
|
20624
|
+
], colors = t$2(otherColors).map((key) => ({
|
|
20628
20625
|
key,
|
|
20629
20626
|
value: defaultTheme.elements[key].fill
|
|
20630
20627
|
})), Tooltip = Tooltip$1.withProps({
|
|
@@ -20863,7 +20860,7 @@ const toolbarTitle = css({
|
|
|
20863
20860
|
textOverflow: "ellipsis",
|
|
20864
20861
|
overflow: "hidden",
|
|
20865
20862
|
whiteSpace: "nowrap"
|
|
20866
|
-
}), useSelectedNodesCount = () => useDiagramContext((
|
|
20863
|
+
}), useSelectedNodesCount = () => useDiagramContext((s) => s.xynodes.filter((x) => x.selected).length);
|
|
20867
20864
|
function Toolbar({ title, children: children2, nodeProps, ...props }) {
|
|
20868
20865
|
const selectedNodesCount = useSelectedNodesCount(), {
|
|
20869
20866
|
selected: selected2 = !1,
|
|
@@ -21231,34 +21228,11 @@ function useCurrentViewModel() {
|
|
|
21231
21228
|
throw new Error("No LikeC4ViewModel in context found");
|
|
21232
21229
|
return vm;
|
|
21233
21230
|
}
|
|
21234
|
-
const selectViewId = (
|
|
21231
|
+
const selectViewId = (s) => s.context.view.id;
|
|
21235
21232
|
function useCurrentViewId() {
|
|
21236
21233
|
const actorRef = useDiagramActorRef();
|
|
21237
21234
|
return useSelector(actorRef, selectViewId);
|
|
21238
21235
|
}
|
|
21239
|
-
const LikeC4ProjectsContext = createContext(null), emptyProjects = [];
|
|
21240
|
-
function useLikeC4Projects() {
|
|
21241
|
-
const ctx = useContext(LikeC4ProjectsContext);
|
|
21242
|
-
return ctx ? ctx.projects : emptyProjects;
|
|
21243
|
-
}
|
|
21244
|
-
const emptyOnProjectChange = () => {
|
|
21245
|
-
}, emptyContext = {
|
|
21246
|
-
projects: emptyProjects,
|
|
21247
|
-
onProjectChange: emptyOnProjectChange
|
|
21248
|
-
};
|
|
21249
|
-
function useLikeC4ProjectsContext() {
|
|
21250
|
-
return useContext(LikeC4ProjectsContext) ?? emptyContext;
|
|
21251
|
-
}
|
|
21252
|
-
function useHasProjects() {
|
|
21253
|
-
const ctx = useContext(LikeC4ProjectsContext);
|
|
21254
|
-
return ctx ? ctx.projects.length > 1 : !1;
|
|
21255
|
-
}
|
|
21256
|
-
function useLikeC4ProjectId() {
|
|
21257
|
-
const ctx = useContext(LikeC4ModelContext);
|
|
21258
|
-
if (!ctx)
|
|
21259
|
-
throw new Error("No LikeC4ModelContext found");
|
|
21260
|
-
return ctx.projectId;
|
|
21261
|
-
}
|
|
21262
21236
|
const backdropBlur = "--_blur", backdropOpacity = "--_opacity", level = "--_level", offset = "--_offset", inset = "--_inset", borderRadius = "--_border-radius", dialog = css.raw({
|
|
21263
21237
|
boxSizing: "border-box",
|
|
21264
21238
|
margin: "0",
|
|
@@ -21483,6 +21457,29 @@ const backdropBlur = "--_blur", backdropOpacity = "--_opacity", level = "--_leve
|
|
|
21483
21457
|
);
|
|
21484
21458
|
});
|
|
21485
21459
|
Overlay.displayName = "Overlay";
|
|
21460
|
+
const LikeC4ProjectsContext = createContext(null), emptyProjects = [];
|
|
21461
|
+
function useLikeC4Projects() {
|
|
21462
|
+
const ctx = useContext(LikeC4ProjectsContext);
|
|
21463
|
+
return ctx ? ctx.projects : emptyProjects;
|
|
21464
|
+
}
|
|
21465
|
+
const emptyOnProjectChange = () => {
|
|
21466
|
+
}, emptyContext = {
|
|
21467
|
+
projects: emptyProjects,
|
|
21468
|
+
onProjectChange: emptyOnProjectChange
|
|
21469
|
+
};
|
|
21470
|
+
function useLikeC4ProjectsContext() {
|
|
21471
|
+
return useContext(LikeC4ProjectsContext) ?? emptyContext;
|
|
21472
|
+
}
|
|
21473
|
+
function useHasProjects() {
|
|
21474
|
+
const ctx = useContext(LikeC4ProjectsContext);
|
|
21475
|
+
return ctx ? ctx.projects.length > 1 : !1;
|
|
21476
|
+
}
|
|
21477
|
+
function useLikeC4ProjectId() {
|
|
21478
|
+
const ctx = useContext(LikeC4ModelContext);
|
|
21479
|
+
if (!ctx)
|
|
21480
|
+
throw new Error("No LikeC4ModelContext found");
|
|
21481
|
+
return ctx.projectId;
|
|
21482
|
+
}
|
|
21486
21483
|
export {
|
|
21487
21484
|
FloatingDelayGroup as $,
|
|
21488
21485
|
createVarsResolver as A,
|
|
@@ -21554,10 +21551,10 @@ export {
|
|
|
21554
21551
|
findElementAncestor as aa,
|
|
21555
21552
|
useClickOutside as ab,
|
|
21556
21553
|
createReactComponent as ac,
|
|
21557
|
-
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21554
|
+
t$a as ad,
|
|
21555
|
+
t$7 as ae,
|
|
21556
|
+
t$8 as af,
|
|
21557
|
+
t$6 as ag,
|
|
21561
21558
|
number as ah,
|
|
21562
21559
|
alpha as ai,
|
|
21563
21560
|
clamp$1 as aj,
|
|
@@ -21643,11 +21640,11 @@ export {
|
|
|
21643
21640
|
getStateNodeByPath as by,
|
|
21644
21641
|
getPersistedSnapshot as bz,
|
|
21645
21642
|
useMantineStyleNonce as c,
|
|
21646
|
-
|
|
21643
|
+
ElementActionButtons as c$,
|
|
21647
21644
|
Box as c0,
|
|
21648
|
-
|
|
21645
|
+
e as c1,
|
|
21649
21646
|
EdgeLabelRenderer as c2,
|
|
21650
|
-
e as c3,
|
|
21647
|
+
e$1 as c3,
|
|
21651
21648
|
getNodeDimensions as c4,
|
|
21652
21649
|
useXYFlow as c5,
|
|
21653
21650
|
useDiagram as c6,
|
|
@@ -21671,16 +21668,16 @@ export {
|
|
|
21671
21668
|
MenuTarget as cO,
|
|
21672
21669
|
MenuDropdown as cP,
|
|
21673
21670
|
MenuItem as cQ,
|
|
21674
|
-
|
|
21675
|
-
|
|
21676
|
-
|
|
21677
|
-
|
|
21678
|
-
|
|
21679
|
-
|
|
21680
|
-
|
|
21681
|
-
|
|
21682
|
-
|
|
21683
|
-
|
|
21671
|
+
useOnDiagramEvent as cR,
|
|
21672
|
+
useLikeC4Model as cS,
|
|
21673
|
+
Divider as cT,
|
|
21674
|
+
e$4 as cU,
|
|
21675
|
+
useDiagramActorRef as cV,
|
|
21676
|
+
useCurrentViewModel as cW,
|
|
21677
|
+
useActorRef as cX,
|
|
21678
|
+
useUpdateEffect$1 as cY,
|
|
21679
|
+
Group as cZ,
|
|
21680
|
+
getBezierPath as c_,
|
|
21684
21681
|
bezierControlPoints as ca,
|
|
21685
21682
|
bezierPath as cb,
|
|
21686
21683
|
ViewGroupNode as cc,
|
|
@@ -21689,7 +21686,7 @@ export {
|
|
|
21689
21686
|
DeploymentNode as cf,
|
|
21690
21687
|
ElementNode as cg,
|
|
21691
21688
|
useDiagramActorSnapshot as ch,
|
|
21692
|
-
|
|
21689
|
+
e$3 as ci,
|
|
21693
21690
|
MotionButton as cj,
|
|
21694
21691
|
Tooltip$1 as ck,
|
|
21695
21692
|
useDiagramEventHandlers as cl,
|
|
@@ -21709,21 +21706,21 @@ export {
|
|
|
21709
21706
|
useCurrentViewId as cz,
|
|
21710
21707
|
alpha$1 as d,
|
|
21711
21708
|
getBoundsOfRects as d$,
|
|
21712
|
-
|
|
21713
|
-
|
|
21714
|
-
|
|
21715
|
-
|
|
21716
|
-
|
|
21717
|
-
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
|
|
21721
|
-
|
|
21722
|
-
|
|
21723
|
-
|
|
21724
|
-
|
|
21725
|
-
|
|
21726
|
-
|
|
21709
|
+
IconTransform as d0,
|
|
21710
|
+
CompoundNodeContainer as d1,
|
|
21711
|
+
CompoundTitle as d2,
|
|
21712
|
+
CompoundDetailsButton as d3,
|
|
21713
|
+
ElementNodeContainer as d4,
|
|
21714
|
+
ElementShape as d5,
|
|
21715
|
+
ElementTitle as d6,
|
|
21716
|
+
ElementTags as d7,
|
|
21717
|
+
Handle as d8,
|
|
21718
|
+
Position as d9,
|
|
21719
|
+
e$2 as dA,
|
|
21720
|
+
VisuallyHidden as dB,
|
|
21721
|
+
IconOrShapeRenderer as dC,
|
|
21722
|
+
FocusTrap as dD,
|
|
21723
|
+
t$2 as dE,
|
|
21727
21724
|
findDiagramEdge as dF,
|
|
21728
21725
|
findDiagramNode as dG,
|
|
21729
21726
|
autoUpdate as dH,
|
|
@@ -21740,37 +21737,37 @@ export {
|
|
|
21740
21737
|
useTimeout as dS,
|
|
21741
21738
|
useCustomCompareMemo as dT,
|
|
21742
21739
|
useLikeC4Specification as dU,
|
|
21743
|
-
|
|
21740
|
+
t$3 as dV,
|
|
21744
21741
|
applyEdgeChanges as dW,
|
|
21745
21742
|
applyNodeChanges as dX,
|
|
21746
21743
|
getViewportForBounds as dY,
|
|
21747
21744
|
typedSystem as dZ,
|
|
21748
21745
|
centerXYInternalNode as d_,
|
|
21749
|
-
|
|
21750
|
-
|
|
21751
|
-
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21746
|
+
ElementDetailsButton as da,
|
|
21747
|
+
getDefaultExportFromCjs as db,
|
|
21748
|
+
t$1 as dc,
|
|
21749
|
+
IconSelector as dd,
|
|
21750
|
+
SegmentedControl as de,
|
|
21751
|
+
ReactFlowProvider as df,
|
|
21752
|
+
useStoreApi as dg,
|
|
21753
|
+
useReactFlow as dh,
|
|
21754
|
+
Panel as di,
|
|
21755
|
+
m as dj,
|
|
21756
|
+
Stack as dk,
|
|
21757
|
+
t$9 as dl,
|
|
21758
|
+
useSyncedRef as dm,
|
|
21759
|
+
IconRenderer as dn,
|
|
21760
|
+
useTimeoutEffect as dp,
|
|
21761
|
+
ReactRemoveScroll as dq,
|
|
21762
|
+
ActionIconGroup as dr,
|
|
21763
|
+
IfEnabled as ds,
|
|
21764
|
+
DiagramFeatures as dt,
|
|
21765
|
+
t$5 as du,
|
|
21766
|
+
customNode as dv,
|
|
21767
|
+
useXYStore as dw,
|
|
21768
|
+
useReducedMotionConfig as dx,
|
|
21769
|
+
Overlay as dy,
|
|
21770
|
+
sva as dz,
|
|
21774
21771
|
em as e,
|
|
21775
21772
|
boxToRect as e0,
|
|
21776
21773
|
and as e1,
|