geonodes-web-render 0.3.13 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/embed.js +247 -244
- package/package.json +1 -1
package/dist/embed.js
CHANGED
|
@@ -7124,8 +7124,17 @@ function pd(e) {
|
|
|
7124
7124
|
a((e) => n((t) => Kc(e, t)), [])
|
|
7125
7125
|
];
|
|
7126
7126
|
}
|
|
7127
|
+
var md = (e) => (t) => {
|
|
7128
|
+
if (!e.includeHiddenNodes) return t.nodesInitialized;
|
|
7129
|
+
if (t.nodeLookup.size === 0) return !1;
|
|
7130
|
+
for (let [, { internals: e }] of t.nodeLookup) if (e.handleBounds === void 0 || !so(e.userNode)) return !1;
|
|
7131
|
+
return !0;
|
|
7132
|
+
};
|
|
7133
|
+
function hd(e = { includeHiddenNodes: !1 }) {
|
|
7134
|
+
return Z(md(e));
|
|
7135
|
+
}
|
|
7127
7136
|
J.error014();
|
|
7128
|
-
function
|
|
7137
|
+
function gd({ dimensions: e, lineWidth: t, variant: n, className: r }) {
|
|
7129
7138
|
return g("path", {
|
|
7130
7139
|
strokeWidth: t,
|
|
7131
7140
|
d: `M${e[0] / 2} 0 V${e[1]} M0 ${e[1] / 2} H${e[0]}`,
|
|
@@ -7136,7 +7145,7 @@ function md({ dimensions: e, lineWidth: t, variant: n, className: r }) {
|
|
|
7136
7145
|
])
|
|
7137
7146
|
});
|
|
7138
7147
|
}
|
|
7139
|
-
function
|
|
7148
|
+
function _d({ radius: e, className: t }) {
|
|
7140
7149
|
return g("circle", {
|
|
7141
7150
|
cx: e,
|
|
7142
7151
|
cy: e,
|
|
@@ -7148,20 +7157,20 @@ function hd({ radius: e, className: t }) {
|
|
|
7148
7157
|
])
|
|
7149
7158
|
});
|
|
7150
7159
|
}
|
|
7151
|
-
var
|
|
7160
|
+
var vd;
|
|
7152
7161
|
(function(e) {
|
|
7153
7162
|
e.Lines = "lines", e.Dots = "dots", e.Cross = "cross";
|
|
7154
|
-
})(
|
|
7155
|
-
var
|
|
7156
|
-
[
|
|
7157
|
-
[
|
|
7158
|
-
[
|
|
7159
|
-
},
|
|
7163
|
+
})(vd ||= {});
|
|
7164
|
+
var yd = {
|
|
7165
|
+
[vd.Dots]: 1,
|
|
7166
|
+
[vd.Lines]: 1,
|
|
7167
|
+
[vd.Cross]: 6
|
|
7168
|
+
}, bd = (e) => ({
|
|
7160
7169
|
transform: e.transform,
|
|
7161
7170
|
patternId: `pattern-${e.rfId}`
|
|
7162
7171
|
});
|
|
7163
|
-
function
|
|
7164
|
-
let f = d(null), { transform: p, patternId: m } = Z(
|
|
7172
|
+
function xd({ id: e, variant: t = vd.Dots, gap: n = 20, size: r, lineWidth: i = 1, offset: a = 0, color: o, bgColor: s, style: c, className: l, patternClassName: u }) {
|
|
7173
|
+
let f = d(null), { transform: p, patternId: m } = Z(bd, X), h = r || yd[t], v = t === vd.Dots, y = t === vd.Cross, b = Array.isArray(n) ? n : [n, n], x = [b[0] * p[2] || 1, b[1] * p[2] || 1], C = h * p[2], w = Array.isArray(a) ? a : [a, a], T = y ? [C, C] : x, E = [w[0] * p[2] || 1 + T[0] / 2, w[1] * p[2] || 1 + T[1] / 2], D = `${m}${e || ""}`;
|
|
7165
7174
|
return _("svg", {
|
|
7166
7175
|
className: S(["react-flow__background", l]),
|
|
7167
7176
|
style: {
|
|
@@ -7180,10 +7189,10 @@ function yd({ id: e, variant: t = gd.Dots, gap: n = 20, size: r, lineWidth: i =
|
|
|
7180
7189
|
height: x[1],
|
|
7181
7190
|
patternUnits: "userSpaceOnUse",
|
|
7182
7191
|
patternTransform: `translate(-${E[0]},-${E[1]})`,
|
|
7183
|
-
children: v ? g(
|
|
7192
|
+
children: v ? g(_d, {
|
|
7184
7193
|
radius: C / 2,
|
|
7185
7194
|
className: u
|
|
7186
|
-
}) : g(
|
|
7195
|
+
}) : g(gd, {
|
|
7187
7196
|
dimensions: T,
|
|
7188
7197
|
lineWidth: i,
|
|
7189
7198
|
variant: t,
|
|
@@ -7198,44 +7207,44 @@ function yd({ id: e, variant: t = gd.Dots, gap: n = 20, size: r, lineWidth: i =
|
|
|
7198
7207
|
})]
|
|
7199
7208
|
});
|
|
7200
7209
|
}
|
|
7201
|
-
|
|
7202
|
-
var
|
|
7203
|
-
function
|
|
7210
|
+
xd.displayName = "Background";
|
|
7211
|
+
var Sd = i(xd);
|
|
7212
|
+
function Cd() {
|
|
7204
7213
|
return g("svg", {
|
|
7205
7214
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7206
7215
|
viewBox: "0 0 32 32",
|
|
7207
7216
|
children: g("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" })
|
|
7208
7217
|
});
|
|
7209
7218
|
}
|
|
7210
|
-
function
|
|
7219
|
+
function wd() {
|
|
7211
7220
|
return g("svg", {
|
|
7212
7221
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7213
7222
|
viewBox: "0 0 32 5",
|
|
7214
7223
|
children: g("path", { d: "M0 0h32v4.2H0z" })
|
|
7215
7224
|
});
|
|
7216
7225
|
}
|
|
7217
|
-
function
|
|
7226
|
+
function Td() {
|
|
7218
7227
|
return g("svg", {
|
|
7219
7228
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7220
7229
|
viewBox: "0 0 32 30",
|
|
7221
7230
|
children: g("path", { d: "M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z" })
|
|
7222
7231
|
});
|
|
7223
7232
|
}
|
|
7224
|
-
function
|
|
7233
|
+
function Ed() {
|
|
7225
7234
|
return g("svg", {
|
|
7226
7235
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7227
7236
|
viewBox: "0 0 25 32",
|
|
7228
7237
|
children: g("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z" })
|
|
7229
7238
|
});
|
|
7230
7239
|
}
|
|
7231
|
-
function
|
|
7240
|
+
function Dd() {
|
|
7232
7241
|
return g("svg", {
|
|
7233
7242
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7234
7243
|
viewBox: "0 0 25 32",
|
|
7235
7244
|
children: g("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z" })
|
|
7236
7245
|
});
|
|
7237
7246
|
}
|
|
7238
|
-
function
|
|
7247
|
+
function Od({ children: e, className: t, ...n }) {
|
|
7239
7248
|
return g("button", {
|
|
7240
7249
|
type: "button",
|
|
7241
7250
|
className: S(["react-flow__controls-button", t]),
|
|
@@ -7243,14 +7252,14 @@ function Ed({ children: e, className: t, ...n }) {
|
|
|
7243
7252
|
children: e
|
|
7244
7253
|
});
|
|
7245
7254
|
}
|
|
7246
|
-
var
|
|
7255
|
+
var kd = (e) => ({
|
|
7247
7256
|
isInteractive: e.nodesDraggable || e.nodesConnectable || e.elementsSelectable,
|
|
7248
7257
|
minZoomReached: e.transform[2] <= e.minZoom,
|
|
7249
7258
|
maxZoomReached: e.transform[2] >= e.maxZoom,
|
|
7250
7259
|
ariaLabelConfig: e.ariaLabelConfig
|
|
7251
7260
|
});
|
|
7252
|
-
function
|
|
7253
|
-
let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(
|
|
7261
|
+
function Ad({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: r = !0, fitViewOptions: i, onZoomIn: a, onZoomOut: o, onFitView: s, onInteractiveChange: c, className: l, children: u, position: d = "bottom-left", orientation: f = "vertical", "aria-label": p }) {
|
|
7262
|
+
let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(kd, X), { zoomIn: C, zoomOut: w, fitView: T } = ll();
|
|
7254
7263
|
return _(Sc, {
|
|
7255
7264
|
className: S([
|
|
7256
7265
|
"react-flow__controls",
|
|
@@ -7262,7 +7271,7 @@ function Od({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
|
|
|
7262
7271
|
"data-testid": "rf__controls",
|
|
7263
7272
|
"aria-label": p ?? x["controls.ariaLabel"],
|
|
7264
7273
|
children: [
|
|
7265
|
-
t && _(h, { children: [g(
|
|
7274
|
+
t && _(h, { children: [g(Od, {
|
|
7266
7275
|
onClick: () => {
|
|
7267
7276
|
C(), a?.();
|
|
7268
7277
|
},
|
|
@@ -7270,8 +7279,8 @@ function Od({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
|
|
|
7270
7279
|
title: x["controls.zoomIn.ariaLabel"],
|
|
7271
7280
|
"aria-label": x["controls.zoomIn.ariaLabel"],
|
|
7272
7281
|
disabled: b,
|
|
7273
|
-
children: g(
|
|
7274
|
-
}), g(
|
|
7282
|
+
children: g(Cd, {})
|
|
7283
|
+
}), g(Od, {
|
|
7275
7284
|
onClick: () => {
|
|
7276
7285
|
w(), o?.();
|
|
7277
7286
|
},
|
|
@@ -7279,18 +7288,18 @@ function Od({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
|
|
|
7279
7288
|
title: x["controls.zoomOut.ariaLabel"],
|
|
7280
7289
|
"aria-label": x["controls.zoomOut.ariaLabel"],
|
|
7281
7290
|
disabled: y,
|
|
7282
|
-
children: g(
|
|
7291
|
+
children: g(wd, {})
|
|
7283
7292
|
})] }),
|
|
7284
|
-
n && g(
|
|
7293
|
+
n && g(Od, {
|
|
7285
7294
|
className: "react-flow__controls-fitview",
|
|
7286
7295
|
onClick: () => {
|
|
7287
7296
|
T(i), s?.();
|
|
7288
7297
|
},
|
|
7289
7298
|
title: x["controls.fitView.ariaLabel"],
|
|
7290
7299
|
"aria-label": x["controls.fitView.ariaLabel"],
|
|
7291
|
-
children: g(
|
|
7300
|
+
children: g(Td, {})
|
|
7292
7301
|
}),
|
|
7293
|
-
r && g(
|
|
7302
|
+
r && g(Od, {
|
|
7294
7303
|
className: "react-flow__controls-interactive",
|
|
7295
7304
|
onClick: () => {
|
|
7296
7305
|
m.setState({
|
|
@@ -7301,15 +7310,15 @@ function Od({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
|
|
|
7301
7310
|
},
|
|
7302
7311
|
title: x["controls.interactive.ariaLabel"],
|
|
7303
7312
|
"aria-label": x["controls.interactive.ariaLabel"],
|
|
7304
|
-
children: g(v ?
|
|
7313
|
+
children: g(v ? Dd : Ed, {})
|
|
7305
7314
|
}),
|
|
7306
7315
|
u
|
|
7307
7316
|
]
|
|
7308
7317
|
});
|
|
7309
7318
|
}
|
|
7310
|
-
|
|
7311
|
-
var
|
|
7312
|
-
function
|
|
7319
|
+
Ad.displayName = "Controls";
|
|
7320
|
+
var jd = i(Ad);
|
|
7321
|
+
function Md({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, strokeColor: s, strokeWidth: c, className: l, borderRadius: u, shapeRendering: d, selected: f, onClick: p }) {
|
|
7313
7322
|
let { background: m, backgroundColor: h } = a || {}, _ = o || m || h;
|
|
7314
7323
|
return g("rect", {
|
|
7315
7324
|
className: S([
|
|
@@ -7332,10 +7341,10 @@ function Ad({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, stroke
|
|
|
7332
7341
|
onClick: p ? (t) => p(t, e) : void 0
|
|
7333
7342
|
});
|
|
7334
7343
|
}
|
|
7335
|
-
var
|
|
7336
|
-
function
|
|
7337
|
-
let s = Z(
|
|
7338
|
-
return g(h, { children: s.map((e) => g(
|
|
7344
|
+
var Nd = i(Md), Pd = (e) => e.nodes.map((e) => e.id), Fd = (e) => e instanceof Function ? e : () => e;
|
|
7345
|
+
function Id({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = Nd, onClick: o }) {
|
|
7346
|
+
let s = Z(Pd, X), c = Fd(t), l = Fd(e), u = Fd(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
|
|
7347
|
+
return g(h, { children: s.map((e) => g(Rd, {
|
|
7339
7348
|
id: e,
|
|
7340
7349
|
nodeColorFunc: c,
|
|
7341
7350
|
nodeStrokeColorFunc: l,
|
|
@@ -7347,7 +7356,7 @@ function Pd({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorde
|
|
|
7347
7356
|
shapeRendering: d
|
|
7348
7357
|
}, e)) });
|
|
7349
7358
|
}
|
|
7350
|
-
function
|
|
7359
|
+
function Ld({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: r, nodeBorderRadius: i, nodeStrokeWidth: a, shapeRendering: o, NodeComponent: s, onClick: c }) {
|
|
7351
7360
|
let { node: l, x: u, y: d, width: f, height: p } = Z((t) => {
|
|
7352
7361
|
let n = t.nodeLookup.get(e);
|
|
7353
7362
|
if (!n) return {
|
|
@@ -7383,7 +7392,7 @@ function Fd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc
|
|
|
7383
7392
|
id: l.id
|
|
7384
7393
|
});
|
|
7385
7394
|
}
|
|
7386
|
-
var
|
|
7395
|
+
var Rd = i(Ld), zd = i(Id), Bd = 200, Vd = 150, Hd = (e) => !e.hidden, Ud = (e) => {
|
|
7387
7396
|
let t = {
|
|
7388
7397
|
x: -e.transform[0] / e.transform[2],
|
|
7389
7398
|
y: -e.transform[1] / e.transform[2],
|
|
@@ -7392,7 +7401,7 @@ var Id = i(Fd), Ld = i(Pd), Rd = 200, zd = 150, Bd = (e) => !e.hidden, Vd = (e)
|
|
|
7392
7401
|
};
|
|
7393
7402
|
return {
|
|
7394
7403
|
viewBB: t,
|
|
7395
|
-
boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter:
|
|
7404
|
+
boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter: Hd }), t) : t,
|
|
7396
7405
|
rfId: e.rfId,
|
|
7397
7406
|
panZoom: e.panZoom,
|
|
7398
7407
|
translateExtent: e.translateExtent,
|
|
@@ -7400,9 +7409,9 @@ var Id = i(Fd), Ld = i(Pd), Rd = 200, zd = 150, Bd = (e) => !e.hidden, Vd = (e)
|
|
|
7400
7409
|
flowHeight: e.height,
|
|
7401
7410
|
ariaLabelConfig: e.ariaLabelConfig
|
|
7402
7411
|
};
|
|
7403
|
-
},
|
|
7404
|
-
function
|
|
7405
|
-
let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(
|
|
7412
|
+
}, Wd = "react-flow__minimap-desc";
|
|
7413
|
+
function Gd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: o = 5, nodeStrokeWidth: s, nodeComponent: l, bgColor: u, maskColor: f, maskStrokeColor: p, maskStrokeWidth: m, position: h = "bottom-right", onClick: v, onNodeClick: y, pannable: b = !1, zoomable: x = !1, ariaLabel: C, inversePan: w, zoomStep: T = 1, offsetScale: E = 5 }) {
|
|
7414
|
+
let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(Ud, X), L = e?.width ?? Bd, R = e?.height ?? Vd, ee = k.width / L, z = k.height / R, B = Math.max(ee, z), V = B * L, H = B * R, U = E * B, W = k.x - (V - k.width) / 2 - U, te = k.y - (H - k.height) / 2 - U, ne = V + U * 2, re = H + U * 2, ie = `${Wd}-${j}`, ae = d(0), oe = d();
|
|
7406
7415
|
ae.current = B, c(() => {
|
|
7407
7416
|
if (O.current && M) return oe.current = Ts({
|
|
7408
7417
|
domNode: O.current,
|
|
@@ -7469,7 +7478,7 @@ function Ud({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7469
7478
|
id: ie,
|
|
7470
7479
|
children: le
|
|
7471
7480
|
}),
|
|
7472
|
-
g(
|
|
7481
|
+
g(zd, {
|
|
7473
7482
|
onClick: ce,
|
|
7474
7483
|
nodeColor: r,
|
|
7475
7484
|
nodeStrokeColor: n,
|
|
@@ -7489,13 +7498,13 @@ function Ud({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7489
7498
|
})
|
|
7490
7499
|
});
|
|
7491
7500
|
}
|
|
7492
|
-
|
|
7493
|
-
var
|
|
7501
|
+
Gd.displayName = "MiniMap", i(Gd);
|
|
7502
|
+
var Kd = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, qd = {
|
|
7494
7503
|
[Bs.Line]: "right",
|
|
7495
7504
|
[Bs.Handle]: "bottom-right"
|
|
7496
7505
|
};
|
|
7497
|
-
function
|
|
7498
|
-
let C = Ol(), w = typeof e == "string" ? e : C, T = Q(), E = d(null), D = n === Bs.Handle, O = Z(a(
|
|
7506
|
+
function Jd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, style: i = void 0, children: o, color: s, minWidth: l = 10, minHeight: u = 10, maxWidth: f = Number.MAX_VALUE, maxHeight: p = Number.MAX_VALUE, keepAspectRatio: m = !1, resizeDirection: h, autoScale: _ = !0, shouldResize: v, onResizeStart: y, onResize: b, onResizeEnd: x }) {
|
|
7507
|
+
let C = Ol(), w = typeof e == "string" ? e : C, T = Q(), E = d(null), D = n === Bs.Handle, O = Z(a(Kd(D && _), [D, _]), X), k = d(null), A = t ?? qd[n];
|
|
7499
7508
|
return c(() => {
|
|
7500
7509
|
if (!(!E.current || !w)) return k.current ||= Zs({
|
|
7501
7510
|
domNode: E.current,
|
|
@@ -7621,17 +7630,17 @@ function Kd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, styl
|
|
|
7621
7630
|
children: o
|
|
7622
7631
|
});
|
|
7623
7632
|
}
|
|
7624
|
-
i(
|
|
7633
|
+
i(Jd);
|
|
7625
7634
|
//#endregion
|
|
7626
7635
|
//#region src/gn/ir/socketColors.ts
|
|
7627
|
-
function
|
|
7636
|
+
function Yd(e) {
|
|
7628
7637
|
return e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055;
|
|
7629
7638
|
}
|
|
7630
7639
|
function $(e, t, n) {
|
|
7631
|
-
let r = (e) => Math.round(Math.min(1, Math.max(0,
|
|
7640
|
+
let r = (e) => Math.round(Math.min(1, Math.max(0, Yd(e))) * 255).toString(16).padStart(2, "0");
|
|
7632
7641
|
return `#${r(e)}${r(t)}${r(n)}`;
|
|
7633
7642
|
}
|
|
7634
|
-
var
|
|
7643
|
+
var Xd = {
|
|
7635
7644
|
FLOAT: $(.63, .63, .63),
|
|
7636
7645
|
VECTOR: $(.39, .39, .78),
|
|
7637
7646
|
RGBA: $(.78, .78, .16),
|
|
@@ -7653,12 +7662,12 @@ var Jd = {
|
|
|
7653
7662
|
INT_VECTOR: $(.36, .47, .61),
|
|
7654
7663
|
CUSTOM: $(.2, .2, .2)
|
|
7655
7664
|
};
|
|
7656
|
-
function
|
|
7657
|
-
return
|
|
7665
|
+
function Zd(e) {
|
|
7666
|
+
return Xd[e] ?? Xd.CUSTOM;
|
|
7658
7667
|
}
|
|
7659
7668
|
//#endregion
|
|
7660
7669
|
//#region src/gn/ir/nodeColors.ts
|
|
7661
|
-
var
|
|
7670
|
+
var Qd = {
|
|
7662
7671
|
GEOMETRY: "#1d725e",
|
|
7663
7672
|
INPUT: "#82354c",
|
|
7664
7673
|
OUTPUT: "#3e232a",
|
|
@@ -7675,7 +7684,7 @@ var Xd = {
|
|
|
7675
7684
|
DISTORT: "#3e5a5b",
|
|
7676
7685
|
SCRIPT: "#203c3c",
|
|
7677
7686
|
DEFAULT: "#303030"
|
|
7678
|
-
},
|
|
7687
|
+
}, $d = {
|
|
7679
7688
|
ShaderNodeVectorMath: "VECTOR",
|
|
7680
7689
|
ShaderNodeVectorRotate: "VECTOR",
|
|
7681
7690
|
ShaderNodeVectorCurve: "VECTOR",
|
|
@@ -7697,10 +7706,10 @@ var Xd = {
|
|
|
7697
7706
|
ShaderNodeValue: "INPUT",
|
|
7698
7707
|
ShaderNodeRGB: "INPUT"
|
|
7699
7708
|
};
|
|
7700
|
-
function
|
|
7701
|
-
return e === "NodeGroupInput" || e === "NodeGroupOutput" ? "INTERFACE" : e.startsWith("NodeGroup") ? "GROUP" : e.startsWith("GeometryNodeSet") || e.startsWith("GeometryNodeTransform") || e.startsWith("GeometryNodeMerge") || e.startsWith("GeometryNodeJoin") || e.startsWith("GeometryNodeDelete") || e.startsWith("GeometryNodeSeparate") || e.startsWith("GeometryNodeDuplicate") || e.startsWith("GeometryNodeExtrude") || e.startsWith("GeometryNodeFlip") || e.startsWith("GeometryNodeSubdivide") || e.startsWith("GeometryNodeTriangulate") || e.startsWith("GeometryNodeMesh") || e.startsWith("GeometryNodeCurve") || e.startsWith("GeometryNodePoints") || e.startsWith("GeometryNodeVolume") || e.startsWith("GeometryNodeInstance") || e.startsWith("GeometryNodeRealize") || e.startsWith("GeometryNodeConvex") || e.startsWith("GeometryNodeFill") || e.startsWith("GeometryNodeSDF") || e.startsWith("GeometryNode") ? "GEOMETRY" : e.startsWith("ShaderNode") ? e in
|
|
7709
|
+
function ef(e) {
|
|
7710
|
+
return e === "NodeGroupInput" || e === "NodeGroupOutput" ? "INTERFACE" : e.startsWith("NodeGroup") ? "GROUP" : e.startsWith("GeometryNodeSet") || e.startsWith("GeometryNodeTransform") || e.startsWith("GeometryNodeMerge") || e.startsWith("GeometryNodeJoin") || e.startsWith("GeometryNodeDelete") || e.startsWith("GeometryNodeSeparate") || e.startsWith("GeometryNodeDuplicate") || e.startsWith("GeometryNodeExtrude") || e.startsWith("GeometryNodeFlip") || e.startsWith("GeometryNodeSubdivide") || e.startsWith("GeometryNodeTriangulate") || e.startsWith("GeometryNodeMesh") || e.startsWith("GeometryNodeCurve") || e.startsWith("GeometryNodePoints") || e.startsWith("GeometryNodeVolume") || e.startsWith("GeometryNodeInstance") || e.startsWith("GeometryNodeRealize") || e.startsWith("GeometryNodeConvex") || e.startsWith("GeometryNodeFill") || e.startsWith("GeometryNodeSDF") || e.startsWith("GeometryNode") ? "GEOMETRY" : e.startsWith("ShaderNode") ? e in $d ? $d[e] : e.startsWith("ShaderNodeTex") ? "TEXTURE" : "SHADER" : e.startsWith("FunctionNode") ? e.startsWith("FunctionNodeInput") ? "INPUT" : "CONVERTER" : "DEFAULT";
|
|
7702
7711
|
}
|
|
7703
|
-
var
|
|
7712
|
+
var tf = {
|
|
7704
7713
|
GeometryNodeInputMaterial: "INPUT",
|
|
7705
7714
|
GeometryNodeInputMaterialIndex: "INPUT",
|
|
7706
7715
|
GeometryNodeInputRadius: "INPUT",
|
|
@@ -7751,16 +7760,16 @@ var $d = {
|
|
|
7751
7760
|
GeometryNodeFieldVariance: "CONVERTER",
|
|
7752
7761
|
GeometryNodeViewer: "OUTPUT"
|
|
7753
7762
|
};
|
|
7754
|
-
function
|
|
7763
|
+
function nf(e, t) {
|
|
7755
7764
|
if (e === "ShaderNodeMix") return t === "VECTOR" ? "VECTOR" : t === "RGBA" ? "COLOR" : "CONVERTER";
|
|
7756
7765
|
if (e === "ShaderNodeMapRange") return t === "FLOAT_VECTOR" ? "VECTOR" : "CONVERTER";
|
|
7757
7766
|
}
|
|
7758
|
-
function
|
|
7759
|
-
return
|
|
7767
|
+
function rf(e, t) {
|
|
7768
|
+
return Qd[nf(e, t) ?? tf[e] ?? ef(e)] ?? Qd.DEFAULT;
|
|
7760
7769
|
}
|
|
7761
7770
|
//#endregion
|
|
7762
7771
|
//#region src/gn/importer/blenderTree.ts
|
|
7763
|
-
var
|
|
7772
|
+
var af = {
|
|
7764
7773
|
NodeSocketGeometry: "GEOMETRY",
|
|
7765
7774
|
NodeSocketFloat: "FLOAT",
|
|
7766
7775
|
NodeSocketVector: "VECTOR",
|
|
@@ -7777,10 +7786,10 @@ var nf = {
|
|
|
7777
7786
|
NodeSocketMatrix: "MATRIX",
|
|
7778
7787
|
NodeSocketMenu: "MENU"
|
|
7779
7788
|
};
|
|
7780
|
-
function
|
|
7781
|
-
return
|
|
7789
|
+
function of(e) {
|
|
7790
|
+
return af[e] ?? "CUSTOM";
|
|
7782
7791
|
}
|
|
7783
|
-
var
|
|
7792
|
+
var sf = {
|
|
7784
7793
|
HSV: [
|
|
7785
7794
|
"Hue",
|
|
7786
7795
|
"Saturation",
|
|
@@ -7797,7 +7806,7 @@ var af = {
|
|
|
7797
7806
|
"Blue"
|
|
7798
7807
|
]
|
|
7799
7808
|
};
|
|
7800
|
-
function
|
|
7809
|
+
function cf(e) {
|
|
7801
7810
|
let t = e.data.mapping?.data;
|
|
7802
7811
|
if (!t) return;
|
|
7803
7812
|
let n = t.curves?.data?.items;
|
|
@@ -7815,8 +7824,8 @@ function of(e) {
|
|
|
7815
7824
|
points: r
|
|
7816
7825
|
};
|
|
7817
7826
|
}
|
|
7818
|
-
function
|
|
7819
|
-
let n =
|
|
7827
|
+
function lf(e, t) {
|
|
7828
|
+
let n = sf[t ?? "RGB"] ?? sf.RGB, r = sf.RGB;
|
|
7820
7829
|
return e.map((e) => {
|
|
7821
7830
|
let t = r.indexOf(e.name);
|
|
7822
7831
|
return t === -1 ? e : {
|
|
@@ -7825,11 +7834,11 @@ function sf(e, t) {
|
|
|
7825
7834
|
};
|
|
7826
7835
|
});
|
|
7827
7836
|
}
|
|
7828
|
-
function
|
|
7837
|
+
function uf(e) {
|
|
7829
7838
|
return e.replace(/\.\d{3}$/, "");
|
|
7830
7839
|
}
|
|
7831
|
-
function
|
|
7832
|
-
let n =
|
|
7840
|
+
function df(e, t) {
|
|
7841
|
+
let n = of(e.data.socket_idname ?? ""), r = Zd(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
|
|
7833
7842
|
id: e,
|
|
7834
7843
|
name: "",
|
|
7835
7844
|
dataType: n,
|
|
@@ -7854,7 +7863,7 @@ function lf(e, t) {
|
|
|
7854
7863
|
outputs: [o(a)]
|
|
7855
7864
|
};
|
|
7856
7865
|
}
|
|
7857
|
-
function
|
|
7866
|
+
function ff(e) {
|
|
7858
7867
|
return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
|
|
7859
7868
|
kind: "vec",
|
|
7860
7869
|
values: e
|
|
@@ -7863,20 +7872,20 @@ function uf(e) {
|
|
|
7863
7872
|
value: e
|
|
7864
7873
|
} : null;
|
|
7865
7874
|
}
|
|
7866
|
-
function
|
|
7875
|
+
function pf(e, t) {
|
|
7867
7876
|
return {
|
|
7868
7877
|
id: String(e.id),
|
|
7869
7878
|
name: e.data.name,
|
|
7870
7879
|
dataType: e.data.type,
|
|
7871
7880
|
displayShape: e.data.display_shape,
|
|
7872
|
-
color:
|
|
7873
|
-
defaultValue:
|
|
7881
|
+
color: Zd(e.data.type),
|
|
7882
|
+
defaultValue: ff(e.data.default_value),
|
|
7874
7883
|
hideValue: e.data.hide_value ?? !1,
|
|
7875
7884
|
enabled: e.data.enabled ?? !0,
|
|
7876
7885
|
index: t
|
|
7877
7886
|
};
|
|
7878
7887
|
}
|
|
7879
|
-
function
|
|
7888
|
+
function mf(e) {
|
|
7880
7889
|
if (e.data.bl_idname === "FunctionNodeCompare") {
|
|
7881
7890
|
let t = {};
|
|
7882
7891
|
return e.data.data_type && (t.data_type = e.data.data_type), e.data.operation && (t.operation = e.data.operation), Object.keys(t).length > 0 ? t : void 0;
|
|
@@ -7886,7 +7895,7 @@ function ff(e) {
|
|
|
7886
7895
|
return e.data.operation && (t.operation = e.data.operation), e.data.use_clamp && (t.use_clamp = "true"), Object.keys(t).length > 0 ? t : void 0;
|
|
7887
7896
|
}
|
|
7888
7897
|
}
|
|
7889
|
-
function
|
|
7898
|
+
function hf(e, t) {
|
|
7890
7899
|
if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
|
|
7891
7900
|
if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
|
|
7892
7901
|
if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
|
|
@@ -7896,10 +7905,10 @@ function pf(e, t) {
|
|
|
7896
7905
|
nodes: e.data.nodes.data.items.map((e, t) => {
|
|
7897
7906
|
if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
|
|
7898
7907
|
let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
|
|
7899
|
-
if (e.data.bl_idname === "NodeReroute") return
|
|
7908
|
+
if (e.data.bl_idname === "NodeReroute") return df(e, n);
|
|
7900
7909
|
let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
|
|
7901
7910
|
if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
|
|
7902
|
-
return
|
|
7911
|
+
return pf(t, n);
|
|
7903
7912
|
});
|
|
7904
7913
|
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
|
|
7905
7914
|
...r[0],
|
|
@@ -7910,20 +7919,20 @@ function pf(e, t) {
|
|
|
7910
7919
|
});
|
|
7911
7920
|
let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
|
|
7912
7921
|
if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
|
|
7913
|
-
return
|
|
7922
|
+
return pf(t, n);
|
|
7914
7923
|
});
|
|
7915
|
-
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i =
|
|
7916
|
-
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ?
|
|
7924
|
+
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = lf(i, e.data.mode));
|
|
7925
|
+
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? cf(e) : void 0, o = mf(e);
|
|
7917
7926
|
return {
|
|
7918
7927
|
id: String(e.id),
|
|
7919
7928
|
type: e.data.bl_idname,
|
|
7920
|
-
label: e.data.label ||
|
|
7929
|
+
label: e.data.label || uf(e.data.name),
|
|
7921
7930
|
position: {
|
|
7922
7931
|
x: n[0],
|
|
7923
7932
|
y: -n[1]
|
|
7924
7933
|
},
|
|
7925
7934
|
width: e.data.width ?? 140,
|
|
7926
|
-
headerColor:
|
|
7935
|
+
headerColor: rf(e.data.bl_idname, e.data.data_type),
|
|
7927
7936
|
inputs: i,
|
|
7928
7937
|
outputs: r,
|
|
7929
7938
|
floatCurve: a,
|
|
@@ -7941,12 +7950,12 @@ function pf(e, t) {
|
|
|
7941
7950
|
})
|
|
7942
7951
|
};
|
|
7943
7952
|
}
|
|
7944
|
-
function
|
|
7953
|
+
function gf(e) {
|
|
7945
7954
|
if (!e || typeof e != "object") throw Error("JSON root must be an object.");
|
|
7946
7955
|
if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
|
|
7947
7956
|
let t = {};
|
|
7948
7957
|
for (let n = 0; n < e.node_trees.length; n++) {
|
|
7949
|
-
let r =
|
|
7958
|
+
let r = hf(e.node_trees[n], n);
|
|
7950
7959
|
t[r.id] = r;
|
|
7951
7960
|
}
|
|
7952
7961
|
let n = /* @__PURE__ */ new Set();
|
|
@@ -7965,21 +7974,21 @@ function mf(e) {
|
|
|
7965
7974
|
trees: t
|
|
7966
7975
|
};
|
|
7967
7976
|
}
|
|
7968
|
-
function
|
|
7977
|
+
function _f(e, t) {
|
|
7969
7978
|
return {
|
|
7970
7979
|
...t,
|
|
7971
7980
|
nodeId: e,
|
|
7972
7981
|
direction: "input"
|
|
7973
7982
|
};
|
|
7974
7983
|
}
|
|
7975
|
-
function
|
|
7984
|
+
function vf(e, t) {
|
|
7976
7985
|
return {
|
|
7977
7986
|
...t,
|
|
7978
7987
|
nodeId: e,
|
|
7979
7988
|
direction: "output"
|
|
7980
7989
|
};
|
|
7981
7990
|
}
|
|
7982
|
-
function
|
|
7991
|
+
function yf(e) {
|
|
7983
7992
|
let t = e.nodes.map((e) => ({
|
|
7984
7993
|
id: e.id,
|
|
7985
7994
|
type: e.type,
|
|
@@ -7987,8 +7996,8 @@ function _f(e) {
|
|
|
7987
7996
|
position: e.position,
|
|
7988
7997
|
width: e.width,
|
|
7989
7998
|
headerColor: e.headerColor,
|
|
7990
|
-
inputs: e.inputs.map((t) =>
|
|
7991
|
-
outputs: e.outputs.map((t) =>
|
|
7999
|
+
inputs: e.inputs.map((t) => _f(e.id, t)),
|
|
8000
|
+
outputs: e.outputs.map((t) => vf(e.id, t)),
|
|
7992
8001
|
floatCurve: e.floatCurve,
|
|
7993
8002
|
properties: e.properties,
|
|
7994
8003
|
groupTreeId: e.groupTreeId,
|
|
@@ -8012,11 +8021,11 @@ function _f(e) {
|
|
|
8012
8021
|
}
|
|
8013
8022
|
//#endregion
|
|
8014
8023
|
//#region src/gn/xyflow/mapGraphIRToFlow.ts
|
|
8015
|
-
function
|
|
8024
|
+
function bf(e) {
|
|
8016
8025
|
let t = Math.max(e.inputs.length, e.outputs.length);
|
|
8017
8026
|
return Math.max(60, 32 + t * 18 + 16);
|
|
8018
8027
|
}
|
|
8019
|
-
function
|
|
8028
|
+
function xf(e, t) {
|
|
8020
8029
|
if (e.type === "NodeReroute") {
|
|
8021
8030
|
let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
|
|
8022
8031
|
return {
|
|
@@ -8056,7 +8065,7 @@ function yf(e, t) {
|
|
|
8056
8065
|
}
|
|
8057
8066
|
};
|
|
8058
8067
|
}
|
|
8059
|
-
function
|
|
8068
|
+
function Sf(e, t, n) {
|
|
8060
8069
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
8061
8070
|
for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
|
|
8062
8071
|
for (let e of n.edges) r.has(e.sourceNodeId) || r.set(e.sourceNodeId, []), i.has(e.targetNodeId) || i.set(e.targetNodeId, []), r.get(e.sourceNodeId).push(e.targetNodeId), i.get(e.targetNodeId).push(e.sourceNodeId);
|
|
@@ -8080,16 +8089,16 @@ function bf(e, t, n) {
|
|
|
8080
8089
|
for (let e of a) s.has(e) && l.add(e);
|
|
8081
8090
|
return l;
|
|
8082
8091
|
}
|
|
8083
|
-
function
|
|
8084
|
-
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) =>
|
|
8092
|
+
function Cf(e) {
|
|
8093
|
+
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) => xf(e, t)), r = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), a = n;
|
|
8085
8094
|
if (r && i) {
|
|
8086
|
-
let t =
|
|
8095
|
+
let t = Sf(r.id, i.id, e);
|
|
8087
8096
|
if (t.size > 0) {
|
|
8088
8097
|
let i = new Map(e.nodes.map((e) => [e.id, e])), o = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
|
|
8089
8098
|
for (let e of t) {
|
|
8090
8099
|
let t = i.get(e);
|
|
8091
8100
|
if (!t) continue;
|
|
8092
|
-
let n = t.width, r =
|
|
8101
|
+
let n = t.width, r = bf(t);
|
|
8093
8102
|
o = Math.min(o, t.position.x), s = Math.min(s, t.position.y), c = Math.max(c, t.position.x + n), l = Math.max(l, t.position.y + r);
|
|
8094
8103
|
}
|
|
8095
8104
|
if (Number.isFinite(o) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
|
|
@@ -8137,7 +8146,7 @@ function xf(e) {
|
|
|
8137
8146
|
}
|
|
8138
8147
|
//#endregion
|
|
8139
8148
|
//#region src/gn/exporter/nodebpyExporter.ts
|
|
8140
|
-
function
|
|
8149
|
+
function wf(e, t) {
|
|
8141
8150
|
let n = e.node_trees;
|
|
8142
8151
|
if (!Array.isArray(n) || t.size === 0) return e;
|
|
8143
8152
|
let r = new Map(n.map((e) => [e.id, e])), i = /* @__PURE__ */ new Set(), a = [];
|
|
@@ -8197,25 +8206,25 @@ function Sf(e, t) {
|
|
|
8197
8206
|
}
|
|
8198
8207
|
//#endregion
|
|
8199
8208
|
//#region src/utils/encodeTreeClipperPayload.ts
|
|
8200
|
-
var
|
|
8201
|
-
function
|
|
8209
|
+
var Tf = "TreeClipper::";
|
|
8210
|
+
function Ef(e) {
|
|
8202
8211
|
let t = "", n = 32768;
|
|
8203
8212
|
for (let r = 0; r < e.length; r += n) t += String.fromCharCode(...e.subarray(r, r + n));
|
|
8204
8213
|
return btoa(t);
|
|
8205
8214
|
}
|
|
8206
|
-
async function
|
|
8215
|
+
async function Df(e) {
|
|
8207
8216
|
let t = new Blob([e]).stream().pipeThrough(new CompressionStream("gzip")), n = await new Response(t).arrayBuffer();
|
|
8208
8217
|
return new Uint8Array(n);
|
|
8209
8218
|
}
|
|
8210
|
-
async function
|
|
8211
|
-
return
|
|
8219
|
+
async function Of(e) {
|
|
8220
|
+
return Tf + Ef(await Df(new TextEncoder().encode(e)));
|
|
8212
8221
|
}
|
|
8213
8222
|
//#endregion
|
|
8214
8223
|
//#region src/gn/ir/curvePath.ts
|
|
8215
|
-
function
|
|
8224
|
+
function kf(e, t) {
|
|
8216
8225
|
return Math.sqrt(e * e + t * t);
|
|
8217
8226
|
}
|
|
8218
|
-
function
|
|
8227
|
+
function Af(e) {
|
|
8219
8228
|
let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
|
|
8220
8229
|
let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
|
|
8221
8230
|
if (i === "VECTOR") return {
|
|
@@ -8225,11 +8234,11 @@ function Of(e) {
|
|
|
8225
8234
|
let c = 0, l = 0, u = 0, d = 0;
|
|
8226
8235
|
if (o && s) {
|
|
8227
8236
|
let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
|
|
8228
|
-
if (u =
|
|
8229
|
-
let n = e / u + i / d, r = t / u + a / d, o =
|
|
8237
|
+
if (u = kf(e, t), d = kf(i, a), u > 1e-8 && d > 1e-8) {
|
|
8238
|
+
let n = e / u + i / d, r = t / u + a / d, o = kf(n, r);
|
|
8230
8239
|
o > 1e-8 && (c = n / o, l = r / o);
|
|
8231
8240
|
} else d > 1e-8 ? (c = (s[0] - n) / d, l = (s[1] - r) / d) : u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u);
|
|
8232
|
-
} else s ? (d =
|
|
8241
|
+
} else s ? (d = kf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = kf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
|
|
8233
8242
|
let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
|
|
8234
8243
|
if (i === "AUTO_CLAMPED") {
|
|
8235
8244
|
if (o) {
|
|
@@ -8274,7 +8283,7 @@ function Of(e) {
|
|
|
8274
8283
|
}
|
|
8275
8284
|
return n;
|
|
8276
8285
|
}
|
|
8277
|
-
function
|
|
8286
|
+
function jf(e, t, n, r, i, a, o) {
|
|
8278
8287
|
let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
|
|
8279
8288
|
if (e.length < 2) return {
|
|
8280
8289
|
strokePath: "",
|
|
@@ -8282,7 +8291,7 @@ function kf(e, t, n, r, i, a, o) {
|
|
|
8282
8291
|
zeroLinePath: "",
|
|
8283
8292
|
dotPositions: []
|
|
8284
8293
|
};
|
|
8285
|
-
let d =
|
|
8294
|
+
let d = Af(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
|
|
8286
8295
|
for (let t = 0; t < e.length - 1; t++) {
|
|
8287
8296
|
let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
|
|
8288
8297
|
m += ` C ${l(n[0]).toFixed(2)} ${u(n[1]).toFixed(2)},`, m += ` ${l(r[0]).toFixed(2)} ${u(r[1]).toFixed(2)},`, m += ` ${l(i).toFixed(2)} ${u(a).toFixed(2)}`;
|
|
@@ -8297,18 +8306,18 @@ function kf(e, t, n, r, i, a, o) {
|
|
|
8297
8306
|
}
|
|
8298
8307
|
//#endregion
|
|
8299
8308
|
//#region src/gn/components/groupNavContext.ts
|
|
8300
|
-
var
|
|
8301
|
-
function
|
|
8302
|
-
return o(
|
|
8309
|
+
var Mf = t(null);
|
|
8310
|
+
function Nf() {
|
|
8311
|
+
return o(Mf);
|
|
8303
8312
|
}
|
|
8304
8313
|
//#endregion
|
|
8305
8314
|
//#region src/gn/components/GenericGNNode.tsx
|
|
8306
|
-
var
|
|
8315
|
+
var Pf = [
|
|
8307
8316
|
"X",
|
|
8308
8317
|
"Y",
|
|
8309
8318
|
"Z",
|
|
8310
8319
|
"W"
|
|
8311
|
-
],
|
|
8320
|
+
], Ff = {
|
|
8312
8321
|
FLOAT: "Float",
|
|
8313
8322
|
INT: "Integer",
|
|
8314
8323
|
VECTOR: "Vector",
|
|
@@ -8316,7 +8325,7 @@ var Mf = [
|
|
|
8316
8325
|
STRING: "String",
|
|
8317
8326
|
BOOLEAN: "Boolean",
|
|
8318
8327
|
ROTATION: "Rotation"
|
|
8319
|
-
},
|
|
8328
|
+
}, If = {
|
|
8320
8329
|
EQUAL: "Equal",
|
|
8321
8330
|
NOT_EQUAL: "Not Equal",
|
|
8322
8331
|
LESS_THAN: "Less Than",
|
|
@@ -8362,10 +8371,10 @@ var Mf = [
|
|
|
8362
8371
|
RADIANS: "To Radians",
|
|
8363
8372
|
DEGREES: "To Degrees"
|
|
8364
8373
|
};
|
|
8365
|
-
function
|
|
8366
|
-
return e === "data_type" ?
|
|
8374
|
+
function Lf(e, t) {
|
|
8375
|
+
return e === "data_type" ? Ff[t] ?? t : e === "operation" ? If[t] ?? t : e === "use_clamp" ? "Clamp" : t;
|
|
8367
8376
|
}
|
|
8368
|
-
function
|
|
8377
|
+
function Rf(e) {
|
|
8369
8378
|
switch (e) {
|
|
8370
8379
|
case "LINE": return "gn-socket--line";
|
|
8371
8380
|
case "DIAMOND": return "gn-socket--diamond";
|
|
@@ -8374,55 +8383,55 @@ function If(e) {
|
|
|
8374
8383
|
default: return "gn-socket--circle";
|
|
8375
8384
|
}
|
|
8376
8385
|
}
|
|
8377
|
-
function
|
|
8386
|
+
function zf(e) {
|
|
8378
8387
|
return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
|
|
8379
8388
|
}
|
|
8380
|
-
function
|
|
8389
|
+
function Bf(e) {
|
|
8381
8390
|
return parseFloat(e.toFixed(3)).toString();
|
|
8382
8391
|
}
|
|
8383
|
-
function
|
|
8384
|
-
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${
|
|
8392
|
+
function Vf(e, t) {
|
|
8393
|
+
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${Bf(e)}${zf(t)}`;
|
|
8385
8394
|
}
|
|
8386
|
-
function
|
|
8395
|
+
function Hf(e) {
|
|
8387
8396
|
return Math.round(Math.min(1, Math.max(0, e)) * 255);
|
|
8388
8397
|
}
|
|
8389
|
-
function
|
|
8398
|
+
function Uf(e) {
|
|
8390
8399
|
let [t, n, r, i = 1] = e.values;
|
|
8391
8400
|
return /* @__PURE__ */ g("div", {
|
|
8392
8401
|
className: "gn-node__color-swatch",
|
|
8393
|
-
style: { background: `rgba(${
|
|
8402
|
+
style: { background: `rgba(${Hf(t)},${Hf(n)},${Hf(r)},${i.toFixed(2)})` }
|
|
8394
8403
|
});
|
|
8395
8404
|
}
|
|
8396
|
-
function
|
|
8397
|
-
if (e.dataType === "RGBA") return /* @__PURE__ */ g(
|
|
8398
|
-
let t =
|
|
8405
|
+
function Wf(e) {
|
|
8406
|
+
if (e.dataType === "RGBA") return /* @__PURE__ */ g(Uf, { values: e.values });
|
|
8407
|
+
let t = zf(e.dataType);
|
|
8399
8408
|
return /* @__PURE__ */ g("div", {
|
|
8400
8409
|
className: "gn-node__vec-block",
|
|
8401
8410
|
children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
|
|
8402
8411
|
className: "gn-node__vec-row",
|
|
8403
8412
|
children: [/* @__PURE__ */ g("span", {
|
|
8404
8413
|
className: "gn-node__vec-label",
|
|
8405
|
-
children:
|
|
8414
|
+
children: Pf[n]
|
|
8406
8415
|
}), /* @__PURE__ */ _("span", {
|
|
8407
8416
|
className: "gn-node__vec-value",
|
|
8408
|
-
children: [
|
|
8417
|
+
children: [Bf(e), t]
|
|
8409
8418
|
})]
|
|
8410
8419
|
}, n))
|
|
8411
8420
|
});
|
|
8412
8421
|
}
|
|
8413
|
-
function
|
|
8422
|
+
function Gf({ properties: e }) {
|
|
8414
8423
|
let t = Object.entries(e);
|
|
8415
8424
|
return t.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
8416
8425
|
className: "gn-node__props",
|
|
8417
8426
|
children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
|
|
8418
8427
|
className: "gn-node__prop-row",
|
|
8419
|
-
children:
|
|
8428
|
+
children: Lf(e, t)
|
|
8420
8429
|
}, e))
|
|
8421
8430
|
});
|
|
8422
8431
|
}
|
|
8423
|
-
var
|
|
8424
|
-
function
|
|
8425
|
-
let n = Math.max(10, t -
|
|
8432
|
+
var Kf = 120, qf = 6;
|
|
8433
|
+
function Jf({ curve: e, width: t }) {
|
|
8434
|
+
let n = Math.max(10, t - qf * 2), r = Kf, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = jf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
|
|
8426
8435
|
return /* @__PURE__ */ g("div", {
|
|
8427
8436
|
className: "gn-node__curve-wrap",
|
|
8428
8437
|
children: /* @__PURE__ */ _("svg", {
|
|
@@ -8453,7 +8462,7 @@ function Kf({ curve: e, width: t }) {
|
|
|
8453
8462
|
})
|
|
8454
8463
|
});
|
|
8455
8464
|
}
|
|
8456
|
-
function
|
|
8465
|
+
function Yf(e) {
|
|
8457
8466
|
let { socket: t, position: n, type: r, align: i, suppressDefault: a } = e, o = t.name.trim().length === 0, s = !a && !t.hideValue && t.defaultValue?.kind === "scalar";
|
|
8458
8467
|
return /* @__PURE__ */ _("div", {
|
|
8459
8468
|
className: `gn-node__socket-row gn-node__socket-row--${i}`,
|
|
@@ -8462,7 +8471,7 @@ function qf(e) {
|
|
|
8462
8471
|
id: t.id,
|
|
8463
8472
|
type: r,
|
|
8464
8473
|
position: n,
|
|
8465
|
-
className: `gn-socket ${
|
|
8474
|
+
className: `gn-socket ${Rf(t.displayShape)}`,
|
|
8466
8475
|
style: {
|
|
8467
8476
|
top: "50%",
|
|
8468
8477
|
background: t.color,
|
|
@@ -8475,15 +8484,15 @@ function qf(e) {
|
|
|
8475
8484
|
}),
|
|
8476
8485
|
s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
|
|
8477
8486
|
className: "gn-node__value",
|
|
8478
|
-
children:
|
|
8487
|
+
children: Vf(t.defaultValue.value, t.dataType)
|
|
8479
8488
|
}) : null
|
|
8480
8489
|
]
|
|
8481
8490
|
});
|
|
8482
8491
|
}
|
|
8483
|
-
function
|
|
8492
|
+
function Xf(e, t) {
|
|
8484
8493
|
return !t && !e.hideValue && e.defaultValue?.kind === "vec";
|
|
8485
8494
|
}
|
|
8486
|
-
function
|
|
8495
|
+
function Zf() {
|
|
8487
8496
|
return /* @__PURE__ */ _("div", {
|
|
8488
8497
|
className: "gn-node__stack",
|
|
8489
8498
|
"aria-hidden": "true",
|
|
@@ -8494,8 +8503,8 @@ function Yf() {
|
|
|
8494
8503
|
]
|
|
8495
8504
|
});
|
|
8496
8505
|
}
|
|
8497
|
-
function
|
|
8498
|
-
let t = e.data, n =
|
|
8506
|
+
function Qf(e) {
|
|
8507
|
+
let t = e.data, n = Nf(), r = new Set(t.connectedInputIds ?? []), i = t.outputs.filter((e) => e.enabled), a = t.inputs.filter((e) => e.enabled), o = t.groupTreeId, s = o !== void 0 && t.groupTreeName !== void 0 && !!n;
|
|
8499
8508
|
return /* @__PURE__ */ _("div", {
|
|
8500
8509
|
className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
|
|
8501
8510
|
onClick: s ? () => n.openGroup(o) : void 0,
|
|
@@ -8510,15 +8519,15 @@ function Xf(e) {
|
|
|
8510
8519
|
children: t.label
|
|
8511
8520
|
})
|
|
8512
8521
|
}),
|
|
8513
|
-
s && /* @__PURE__ */ g(
|
|
8514
|
-
t.properties && /* @__PURE__ */ g(
|
|
8515
|
-
t.floatCurve && /* @__PURE__ */ g(
|
|
8522
|
+
s && /* @__PURE__ */ g(Zf, {}),
|
|
8523
|
+
t.properties && /* @__PURE__ */ g(Gf, { properties: t.properties }),
|
|
8524
|
+
t.floatCurve && /* @__PURE__ */ g(Jf, {
|
|
8516
8525
|
curve: t.floatCurve,
|
|
8517
8526
|
width: t.width
|
|
8518
8527
|
}),
|
|
8519
8528
|
/* @__PURE__ */ _("div", {
|
|
8520
8529
|
className: "gn-node__body",
|
|
8521
|
-
children: [i.map((e) => /* @__PURE__ */ g(
|
|
8530
|
+
children: [i.map((e) => /* @__PURE__ */ g(Yf, {
|
|
8522
8531
|
socket: e,
|
|
8523
8532
|
position: Y.Right,
|
|
8524
8533
|
type: "source",
|
|
@@ -8526,13 +8535,13 @@ function Xf(e) {
|
|
|
8526
8535
|
suppressDefault: !0
|
|
8527
8536
|
}, e.id)), a.map((e) => {
|
|
8528
8537
|
let t = r.has(e.id);
|
|
8529
|
-
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(
|
|
8538
|
+
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(Yf, {
|
|
8530
8539
|
socket: e,
|
|
8531
8540
|
position: Y.Left,
|
|
8532
8541
|
type: "target",
|
|
8533
8542
|
align: "left",
|
|
8534
8543
|
suppressDefault: t
|
|
8535
|
-
}),
|
|
8544
|
+
}), Xf(e, t) ? /* @__PURE__ */ g(Wf, {
|
|
8536
8545
|
values: e.defaultValue.values,
|
|
8537
8546
|
dataType: e.dataType
|
|
8538
8547
|
}) : null] }, e.id);
|
|
@@ -8543,7 +8552,7 @@ function Xf(e) {
|
|
|
8543
8552
|
}
|
|
8544
8553
|
//#endregion
|
|
8545
8554
|
//#region src/gn/components/RerouteNode.tsx
|
|
8546
|
-
function
|
|
8555
|
+
function $f(e) {
|
|
8547
8556
|
let t = e.data;
|
|
8548
8557
|
return /* @__PURE__ */ _("div", {
|
|
8549
8558
|
className: "gn-reroute",
|
|
@@ -8563,7 +8572,7 @@ function Zf(e) {
|
|
|
8563
8572
|
}
|
|
8564
8573
|
//#endregion
|
|
8565
8574
|
//#region src/gn/components/SimulationZoneFrame.tsx
|
|
8566
|
-
function
|
|
8575
|
+
function ep(e) {
|
|
8567
8576
|
let t = e.data;
|
|
8568
8577
|
return /* @__PURE__ */ g("div", {
|
|
8569
8578
|
className: "gn-sim-zone",
|
|
@@ -8590,97 +8599,91 @@ function Qf(e) {
|
|
|
8590
8599
|
}
|
|
8591
8600
|
//#endregion
|
|
8592
8601
|
//#region src/gn/components/GeometryNodesFlow.tsx
|
|
8593
|
-
var
|
|
8594
|
-
gnNode:
|
|
8595
|
-
rerouteNode:
|
|
8596
|
-
simulationZone:
|
|
8597
|
-
},
|
|
8598
|
-
function np(e) {
|
|
8599
|
-
let t = e.style?.height;
|
|
8600
|
-
if (typeof t == "number") return t;
|
|
8601
|
-
let n = e.data, r = Math.max(n?.inputs?.length ?? 0, n?.outputs?.length ?? 0);
|
|
8602
|
-
return Math.max(60, 32 + r * 18 + 16);
|
|
8603
|
-
}
|
|
8602
|
+
var tp = {
|
|
8603
|
+
gnNode: Qf,
|
|
8604
|
+
rerouteNode: $f,
|
|
8605
|
+
simulationZone: ep
|
|
8606
|
+
}, np = { padding: .08 };
|
|
8604
8607
|
function rp(e) {
|
|
8605
|
-
let t =
|
|
8606
|
-
for (let a of e) {
|
|
8607
|
-
if (a.parentId) continue;
|
|
8608
|
-
let e = a.style?.width ?? a.width ?? 200, o = np(a);
|
|
8609
|
-
t = Math.min(t, a.position.x), n = Math.min(n, a.position.y), r = Math.max(r, a.position.x + e), i = Math.max(i, a.position.y + o);
|
|
8610
|
-
}
|
|
8611
|
-
return Number.isFinite(t) ? [[t - tp, n - tp], [r + tp, i + tp]] : [[-Infinity, -Infinity], [Infinity, Infinity]];
|
|
8612
|
-
}
|
|
8613
|
-
function ip(e) {
|
|
8614
|
-
let { nodes: t, edges: n, jsonText: r, breadcrumbs: i, onNavigate: o, onSelectionIds: s, onCopiedMagicString: l, zoomOnScroll: p = !0 } = e, { fitView: m } = ll(), h = d(null), v = d(!1), y = d([]), [b, x] = f(null), [S, C] = f(!1), [w, T] = f(!1), E = d([]), [D, O, k] = fd(t), [A, j, M] = pd(n), N = u(() => rp(t), [t]);
|
|
8608
|
+
let { nodes: t, edges: n, jsonText: r, breadcrumbs: i, onNavigate: o, onSelectionIds: s, onCopiedMagicString: l, zoomOnScroll: u = !0 } = e, { fitView: p, getNodes: m, getNodesBounds: h } = ll(), v = hd(), y = d(null), b = d(!1), x = d([]), [S, C] = f(null), [w, T] = f(!1), [E, D] = f(!1), O = d([]), [k, A, j] = fd(t), [M, N, P] = pd(n), [F, I] = f(void 0);
|
|
8615
8609
|
c(() => {
|
|
8616
|
-
|
|
8610
|
+
if (!v) return;
|
|
8611
|
+
let e = h(m());
|
|
8612
|
+
I([[e.x, e.y], [e.x + e.width, e.y + e.height]]);
|
|
8617
8613
|
}, [
|
|
8614
|
+
v,
|
|
8618
8615
|
t,
|
|
8619
|
-
|
|
8616
|
+
m,
|
|
8617
|
+
h
|
|
8618
|
+
]), c(() => {
|
|
8619
|
+
A(t), s?.([]), b.current = !1, p(np);
|
|
8620
|
+
}, [
|
|
8621
|
+
t,
|
|
8622
|
+
A,
|
|
8620
8623
|
s,
|
|
8621
|
-
|
|
8624
|
+
p
|
|
8622
8625
|
]), c(() => {
|
|
8623
|
-
|
|
8624
|
-
}, [n,
|
|
8625
|
-
let e =
|
|
8626
|
+
N(n);
|
|
8627
|
+
}, [n, N]), c(() => {
|
|
8628
|
+
let e = y.current;
|
|
8626
8629
|
if (!e) return;
|
|
8627
8630
|
let t = new ResizeObserver(() => {
|
|
8628
|
-
|
|
8631
|
+
b.current || p(np);
|
|
8629
8632
|
});
|
|
8630
8633
|
return t.observe(e), () => t.disconnect();
|
|
8631
|
-
}, [
|
|
8632
|
-
let
|
|
8633
|
-
e && (
|
|
8634
|
-
}, []),
|
|
8634
|
+
}, [p]);
|
|
8635
|
+
let L = a((e) => {
|
|
8636
|
+
e && (b.current = !0);
|
|
8637
|
+
}, []), R = a(({ nodes: e }) => {
|
|
8635
8638
|
let t = e.map((e) => e.id);
|
|
8636
|
-
|
|
8637
|
-
}, [s]),
|
|
8638
|
-
e.preventDefault(),
|
|
8639
|
+
x.current = t, s?.(t);
|
|
8640
|
+
}, [s]), ee = a((e) => {
|
|
8641
|
+
e.preventDefault(), C({
|
|
8639
8642
|
x: e.clientX,
|
|
8640
8643
|
y: e.clientY
|
|
8641
8644
|
});
|
|
8642
|
-
}, []),
|
|
8643
|
-
|
|
8645
|
+
}, []), z = a(async () => {
|
|
8646
|
+
C(null);
|
|
8644
8647
|
try {
|
|
8645
|
-
let e = JSON.parse(r), t = new Set(
|
|
8648
|
+
let e = JSON.parse(r), t = new Set(x.current.map(Number).filter(Number.isFinite)), n = t.size > 0 ? wf(e, t) : e, i = await Of(JSON.stringify(n));
|
|
8646
8649
|
if (await navigator.clipboard.writeText(i), l) {
|
|
8647
8650
|
l();
|
|
8648
8651
|
return;
|
|
8649
8652
|
}
|
|
8650
|
-
|
|
8651
|
-
|
|
8653
|
+
O.current.forEach(clearTimeout), D(!1), T(!0), O.current = [setTimeout(() => D(!0), 2500), setTimeout(() => {
|
|
8654
|
+
T(!1), D(!1);
|
|
8652
8655
|
}, 3e3)];
|
|
8653
8656
|
} catch {}
|
|
8654
8657
|
}, [r, l]);
|
|
8655
|
-
return c(() => () =>
|
|
8656
|
-
if (!
|
|
8657
|
-
let e = () =>
|
|
8658
|
-
e.key === "Escape" &&
|
|
8658
|
+
return c(() => () => O.current.forEach(clearTimeout), []), c(() => {
|
|
8659
|
+
if (!S) return;
|
|
8660
|
+
let e = () => C(null), t = (e) => {
|
|
8661
|
+
e.key === "Escape" && C(null);
|
|
8659
8662
|
};
|
|
8660
8663
|
return window.addEventListener("click", e), window.addEventListener("scroll", e, !0), window.addEventListener("keydown", t), () => {
|
|
8661
8664
|
window.removeEventListener("click", e), window.removeEventListener("scroll", e, !0), window.removeEventListener("keydown", t);
|
|
8662
8665
|
};
|
|
8663
|
-
}, [
|
|
8664
|
-
ref:
|
|
8666
|
+
}, [S]), /* @__PURE__ */ _("div", {
|
|
8667
|
+
ref: y,
|
|
8665
8668
|
style: {
|
|
8666
8669
|
width: "100%",
|
|
8667
8670
|
height: "100%",
|
|
8668
8671
|
position: "relative"
|
|
8669
8672
|
},
|
|
8670
|
-
onContextMenu:
|
|
8673
|
+
onContextMenu: ee,
|
|
8671
8674
|
children: [
|
|
8672
8675
|
/* @__PURE__ */ _(dd, {
|
|
8673
|
-
nodes:
|
|
8674
|
-
edges:
|
|
8675
|
-
onNodesChange:
|
|
8676
|
-
onEdgesChange:
|
|
8677
|
-
onSelectionChange:
|
|
8678
|
-
onMoveStart:
|
|
8679
|
-
nodeTypes:
|
|
8676
|
+
nodes: k,
|
|
8677
|
+
edges: M,
|
|
8678
|
+
onNodesChange: j,
|
|
8679
|
+
onEdgesChange: P,
|
|
8680
|
+
onSelectionChange: R,
|
|
8681
|
+
onMoveStart: L,
|
|
8682
|
+
nodeTypes: tp,
|
|
8680
8683
|
fitView: !0,
|
|
8681
|
-
fitViewOptions:
|
|
8684
|
+
fitViewOptions: np,
|
|
8682
8685
|
minZoom: .2,
|
|
8683
|
-
translateExtent:
|
|
8686
|
+
translateExtent: F,
|
|
8684
8687
|
nodesDraggable: !1,
|
|
8685
8688
|
nodesConnectable: !1,
|
|
8686
8689
|
elementsSelectable: !0,
|
|
@@ -8692,23 +8695,23 @@ function ip(e) {
|
|
|
8692
8695
|
connectOnClick: !1,
|
|
8693
8696
|
panOnDrag: [1, 2],
|
|
8694
8697
|
panOnScroll: !1,
|
|
8695
|
-
zoomOnScroll:
|
|
8696
|
-
preventScrolling:
|
|
8698
|
+
zoomOnScroll: u,
|
|
8699
|
+
preventScrolling: u,
|
|
8697
8700
|
zoomOnDoubleClick: !1,
|
|
8698
8701
|
children: [
|
|
8699
|
-
/* @__PURE__ */ g(
|
|
8702
|
+
/* @__PURE__ */ g(Sd, {
|
|
8700
8703
|
gap: 20,
|
|
8701
8704
|
size: 1,
|
|
8702
8705
|
color: "var(--grid-dot, #3a3a3a)"
|
|
8703
8706
|
}),
|
|
8704
|
-
/* @__PURE__ */ g(
|
|
8707
|
+
/* @__PURE__ */ g(jd, { showInteractive: !1 }),
|
|
8705
8708
|
/* @__PURE__ */ g(Sc, {
|
|
8706
8709
|
position: "top-left",
|
|
8707
8710
|
children: /* @__PURE__ */ _("div", {
|
|
8708
8711
|
className: "gn-top-left",
|
|
8709
8712
|
children: [/* @__PURE__ */ _("span", {
|
|
8710
8713
|
className: "gn-version-badge",
|
|
8711
|
-
children: ["node-web-render v", "0.3.
|
|
8714
|
+
children: ["node-web-render v", "0.3.14"]
|
|
8712
8715
|
}), i.length > 1 ? /* @__PURE__ */ g("nav", {
|
|
8713
8716
|
className: "gn-breadcrumbs",
|
|
8714
8717
|
"aria-label": "Node group path",
|
|
@@ -8737,11 +8740,11 @@ function ip(e) {
|
|
|
8737
8740
|
})
|
|
8738
8741
|
]
|
|
8739
8742
|
}),
|
|
8740
|
-
|
|
8743
|
+
S ? /* @__PURE__ */ g("div", {
|
|
8741
8744
|
className: "gn-context-menu",
|
|
8742
8745
|
style: {
|
|
8743
|
-
left:
|
|
8744
|
-
top:
|
|
8746
|
+
left: S.x,
|
|
8747
|
+
top: S.y
|
|
8745
8748
|
},
|
|
8746
8749
|
onClick: (e) => e.stopPropagation(),
|
|
8747
8750
|
role: "menu",
|
|
@@ -8749,31 +8752,31 @@ function ip(e) {
|
|
|
8749
8752
|
type: "button",
|
|
8750
8753
|
className: "gn-context-menu__item",
|
|
8751
8754
|
role: "menuitem",
|
|
8752
|
-
onClick:
|
|
8755
|
+
onClick: z,
|
|
8753
8756
|
children: "Copy selected nodes to Tree Clipper magic string"
|
|
8754
8757
|
})
|
|
8755
8758
|
}) : null,
|
|
8756
|
-
|
|
8757
|
-
className: `gn-context-toast${
|
|
8759
|
+
w || E ? /* @__PURE__ */ g("div", {
|
|
8760
|
+
className: `gn-context-toast${E ? " gnwr-leaving" : ""}`,
|
|
8758
8761
|
role: "status",
|
|
8759
8762
|
children: "Copied Tree Clipper magic string"
|
|
8760
8763
|
}) : null
|
|
8761
8764
|
]
|
|
8762
8765
|
});
|
|
8763
8766
|
}
|
|
8764
|
-
function
|
|
8767
|
+
function ip(e) {
|
|
8765
8768
|
let { jsonText: t, showHeader: n = !0, onSelectionChange: r, onCopiedMagicString: i, zoomOnScroll: o = !0 } = e, [s, l] = f({
|
|
8766
8769
|
json: t,
|
|
8767
8770
|
ids: []
|
|
8768
8771
|
}), d = u(() => {
|
|
8769
8772
|
if (!t.trim()) return null;
|
|
8770
8773
|
try {
|
|
8771
|
-
let { rootId: e, trees: n } =
|
|
8774
|
+
let { rootId: e, trees: n } = gf(JSON.parse(t)), r = {};
|
|
8772
8775
|
for (let e of Object.values(n)) {
|
|
8773
|
-
let t =
|
|
8776
|
+
let t = yf(e);
|
|
8774
8777
|
r[t.id] = {
|
|
8775
8778
|
graph: t,
|
|
8776
|
-
flow:
|
|
8779
|
+
flow: Cf(t)
|
|
8777
8780
|
};
|
|
8778
8781
|
}
|
|
8779
8782
|
return {
|
|
@@ -8837,9 +8840,9 @@ function ap(e) {
|
|
|
8837
8840
|
className: "flow-error",
|
|
8838
8841
|
role: "alert",
|
|
8839
8842
|
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: d.error })]
|
|
8840
|
-
}) : m ? /* @__PURE__ */ g(
|
|
8843
|
+
}) : m ? /* @__PURE__ */ g(Mf.Provider, {
|
|
8841
8844
|
value: v,
|
|
8842
|
-
children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(
|
|
8845
|
+
children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(rp, {
|
|
8843
8846
|
nodes: m.flow.nodes,
|
|
8844
8847
|
edges: m.flow.edges,
|
|
8845
8848
|
jsonText: t,
|
|
@@ -8861,7 +8864,7 @@ function ap(e) {
|
|
|
8861
8864
|
}
|
|
8862
8865
|
//#endregion
|
|
8863
8866
|
//#region src/components/TreeClipperLogo.tsx
|
|
8864
|
-
function
|
|
8867
|
+
function ap({ className: e }) {
|
|
8865
8868
|
return /* @__PURE__ */ _("svg", {
|
|
8866
8869
|
viewBox: "0 0 256 256",
|
|
8867
8870
|
className: e,
|
|
@@ -8922,7 +8925,7 @@ function op({ className: e }) {
|
|
|
8922
8925
|
}
|
|
8923
8926
|
//#endregion
|
|
8924
8927
|
//#region src/embed.tsx
|
|
8925
|
-
function
|
|
8928
|
+
function op(e) {
|
|
8926
8929
|
let { payload: t } = e, [n, r] = f(""), [i, a] = f(null), [o, s] = f(!0), [l, u] = f(!1), [p, m] = f(!1), v = d(!1), y = d(!1), b = d(null), S = d(null), C = d(null), w = () => {
|
|
8927
8930
|
!y.current || v.current || (m(!0), C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
8928
8931
|
u(!1), m(!1);
|
|
@@ -8961,7 +8964,7 @@ function sp(e) {
|
|
|
8961
8964
|
className: "gnwr-loading",
|
|
8962
8965
|
role: "status",
|
|
8963
8966
|
"aria-live": "polite",
|
|
8964
|
-
children: [/* @__PURE__ */ g(
|
|
8967
|
+
children: [/* @__PURE__ */ g(ap, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
|
|
8965
8968
|
className: "gnwr-loading__label",
|
|
8966
8969
|
children: "Loading graph…"
|
|
8967
8970
|
})]
|
|
@@ -8970,7 +8973,7 @@ function sp(e) {
|
|
|
8970
8973
|
role: "alert",
|
|
8971
8974
|
children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
|
|
8972
8975
|
}) : /* @__PURE__ */ _(h, { children: [
|
|
8973
|
-
/* @__PURE__ */ g(
|
|
8976
|
+
/* @__PURE__ */ g(ip, {
|
|
8974
8977
|
jsonText: n,
|
|
8975
8978
|
showHeader: !1,
|
|
8976
8979
|
zoomOnScroll: !1,
|
|
@@ -8995,7 +8998,7 @@ function sp(e) {
|
|
|
8995
8998
|
strokeLinecap: "round",
|
|
8996
8999
|
strokeLinejoin: "round"
|
|
8997
9000
|
})
|
|
8998
|
-
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
9001
|
+
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(ap, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: "Copy TreeClipper Magic String" })] })
|
|
8999
9002
|
}),
|
|
9000
9003
|
(l || p) && /* @__PURE__ */ _("div", {
|
|
9001
9004
|
className: `gnwr-copy-toast${p ? " gnwr-leaving" : ""}`,
|
|
@@ -9020,22 +9023,22 @@ function sp(e) {
|
|
|
9020
9023
|
})
|
|
9021
9024
|
});
|
|
9022
9025
|
}
|
|
9023
|
-
var
|
|
9024
|
-
function
|
|
9025
|
-
|
|
9026
|
+
var sp = /* @__PURE__ */ new Map(), cp = null;
|
|
9027
|
+
function lp(e, t) {
|
|
9028
|
+
sp.get(e)?.unmount();
|
|
9026
9029
|
let r = m(e);
|
|
9027
|
-
|
|
9030
|
+
sp.set(e, r), cp = e;
|
|
9028
9031
|
let i = t.onClose;
|
|
9029
|
-
return r.render(n(
|
|
9032
|
+
return r.render(n(op, {
|
|
9030
9033
|
...t,
|
|
9031
9034
|
onClose: i ? () => {
|
|
9032
|
-
|
|
9035
|
+
up(e), i();
|
|
9033
9036
|
} : void 0
|
|
9034
|
-
})), () =>
|
|
9037
|
+
})), () => up(e);
|
|
9035
9038
|
}
|
|
9036
|
-
function
|
|
9037
|
-
let t = e ??
|
|
9038
|
-
t && (
|
|
9039
|
+
function up(e) {
|
|
9040
|
+
let t = e ?? cp;
|
|
9041
|
+
t && (sp.get(t)?.unmount(), sp.delete(t), t === cp && (cp = null));
|
|
9039
9042
|
}
|
|
9040
9043
|
//#endregion
|
|
9041
|
-
export {
|
|
9044
|
+
export { op as GraphView, lp as mountGraphView, up as unmountGraphView };
|
package/package.json
CHANGED