geonodes-web-render 0.3.13 → 0.3.15
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.css +1 -1
- package/dist/embed.js +592 -278
- package/dist/types/gn/components/ColorRampViz.d.ts +7 -0
- package/dist/types/gn/components/NodeFrame.d.ts +2 -0
- package/dist/types/gn/importer/blenderTree.d.ts +23 -1
- package/dist/types/gn/ir/types.d.ts +17 -0
- package/dist/types/gn/xyflow/mapGraphIRToFlow.d.ts +5 -1
- package/package.json +1 -2
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,30 @@ function of(e) {
|
|
|
7815
7824
|
points: r
|
|
7816
7825
|
};
|
|
7817
7826
|
}
|
|
7818
|
-
function
|
|
7819
|
-
let
|
|
7827
|
+
function lf(e) {
|
|
7828
|
+
let t = e.data.color_ramp?.data;
|
|
7829
|
+
if (!t) return;
|
|
7830
|
+
let n = (t.elements?.data?.items ?? []).map((e) => {
|
|
7831
|
+
let t = e.data.color;
|
|
7832
|
+
return {
|
|
7833
|
+
position: e.data.position,
|
|
7834
|
+
color: [
|
|
7835
|
+
t[0],
|
|
7836
|
+
t[1],
|
|
7837
|
+
t[2],
|
|
7838
|
+
e.data.alpha ?? t[3] ?? 1
|
|
7839
|
+
]
|
|
7840
|
+
};
|
|
7841
|
+
});
|
|
7842
|
+
return {
|
|
7843
|
+
interpolation: t.interpolation ?? "LINEAR",
|
|
7844
|
+
colorMode: t.color_mode ?? "RGB",
|
|
7845
|
+
hueInterpolation: t.hue_interpolation ?? "NEAR",
|
|
7846
|
+
stops: n
|
|
7847
|
+
};
|
|
7848
|
+
}
|
|
7849
|
+
function uf(e, t) {
|
|
7850
|
+
let n = sf[t ?? "RGB"] ?? sf.RGB, r = sf.RGB;
|
|
7820
7851
|
return e.map((e) => {
|
|
7821
7852
|
let t = r.indexOf(e.name);
|
|
7822
7853
|
return t === -1 ? e : {
|
|
@@ -7825,11 +7856,11 @@ function sf(e, t) {
|
|
|
7825
7856
|
};
|
|
7826
7857
|
});
|
|
7827
7858
|
}
|
|
7828
|
-
function
|
|
7859
|
+
function df(e) {
|
|
7829
7860
|
return e.replace(/\.\d{3}$/, "");
|
|
7830
7861
|
}
|
|
7831
|
-
function
|
|
7832
|
-
let n =
|
|
7862
|
+
function ff(e, t) {
|
|
7863
|
+
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
7864
|
id: e,
|
|
7834
7865
|
name: "",
|
|
7835
7866
|
dataType: n,
|
|
@@ -7851,10 +7882,11 @@ function lf(e, t) {
|
|
|
7851
7882
|
width: 0,
|
|
7852
7883
|
headerColor: "",
|
|
7853
7884
|
inputs: [o(i)],
|
|
7854
|
-
outputs: [o(a)]
|
|
7885
|
+
outputs: [o(a)],
|
|
7886
|
+
...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
|
|
7855
7887
|
};
|
|
7856
7888
|
}
|
|
7857
|
-
function
|
|
7889
|
+
function pf(e) {
|
|
7858
7890
|
return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
|
|
7859
7891
|
kind: "vec",
|
|
7860
7892
|
values: e
|
|
@@ -7863,20 +7895,20 @@ function uf(e) {
|
|
|
7863
7895
|
value: e
|
|
7864
7896
|
} : null;
|
|
7865
7897
|
}
|
|
7866
|
-
function
|
|
7898
|
+
function mf(e, t) {
|
|
7867
7899
|
return {
|
|
7868
7900
|
id: String(e.id),
|
|
7869
7901
|
name: e.data.name,
|
|
7870
7902
|
dataType: e.data.type,
|
|
7871
7903
|
displayShape: e.data.display_shape,
|
|
7872
|
-
color:
|
|
7873
|
-
defaultValue:
|
|
7904
|
+
color: Zd(e.data.type),
|
|
7905
|
+
defaultValue: pf(e.data.default_value),
|
|
7874
7906
|
hideValue: e.data.hide_value ?? !1,
|
|
7875
7907
|
enabled: e.data.enabled ?? !0,
|
|
7876
7908
|
index: t
|
|
7877
7909
|
};
|
|
7878
7910
|
}
|
|
7879
|
-
function
|
|
7911
|
+
function hf(e) {
|
|
7880
7912
|
if (e.data.bl_idname === "FunctionNodeCompare") {
|
|
7881
7913
|
let t = {};
|
|
7882
7914
|
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 +7918,7 @@ function ff(e) {
|
|
|
7886
7918
|
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
7919
|
}
|
|
7888
7920
|
}
|
|
7889
|
-
function
|
|
7921
|
+
function gf(e, t) {
|
|
7890
7922
|
if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
|
|
7891
7923
|
if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
|
|
7892
7924
|
if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
|
|
@@ -7896,10 +7928,10 @@ function pf(e, t) {
|
|
|
7896
7928
|
nodes: e.data.nodes.data.items.map((e, t) => {
|
|
7897
7929
|
if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
|
|
7898
7930
|
let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
|
|
7899
|
-
if (e.data.bl_idname === "NodeReroute") return
|
|
7931
|
+
if (e.data.bl_idname === "NodeReroute") return ff(e, n);
|
|
7900
7932
|
let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
|
|
7901
7933
|
if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
|
|
7902
|
-
return
|
|
7934
|
+
return mf(t, n);
|
|
7903
7935
|
});
|
|
7904
7936
|
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
|
|
7905
7937
|
...r[0],
|
|
@@ -7910,25 +7942,27 @@ function pf(e, t) {
|
|
|
7910
7942
|
});
|
|
7911
7943
|
let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
|
|
7912
7944
|
if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
|
|
7913
|
-
return
|
|
7945
|
+
return mf(t, n);
|
|
7914
7946
|
});
|
|
7915
|
-
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i =
|
|
7916
|
-
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ?
|
|
7947
|
+
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = uf(i, e.data.mode));
|
|
7948
|
+
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? cf(e) : void 0, o = e.data.bl_idname === "ShaderNodeValToRGB" ? lf(e) : void 0, s = hf(e);
|
|
7917
7949
|
return {
|
|
7918
7950
|
id: String(e.id),
|
|
7919
7951
|
type: e.data.bl_idname,
|
|
7920
|
-
label: e.data.label ||
|
|
7952
|
+
label: e.data.label || df(e.data.name),
|
|
7921
7953
|
position: {
|
|
7922
7954
|
x: n[0],
|
|
7923
7955
|
y: -n[1]
|
|
7924
7956
|
},
|
|
7925
7957
|
width: e.data.width ?? 140,
|
|
7926
|
-
headerColor:
|
|
7958
|
+
headerColor: rf(e.data.bl_idname, e.data.data_type),
|
|
7927
7959
|
inputs: i,
|
|
7928
7960
|
outputs: r,
|
|
7929
7961
|
floatCurve: a,
|
|
7930
|
-
|
|
7931
|
-
...
|
|
7962
|
+
colorRamp: o,
|
|
7963
|
+
...s ? { properties: s } : {},
|
|
7964
|
+
...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) },
|
|
7965
|
+
...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
|
|
7932
7966
|
};
|
|
7933
7967
|
}),
|
|
7934
7968
|
links: e.data.links.data.items.map((e, t) => {
|
|
@@ -7941,12 +7975,12 @@ function pf(e, t) {
|
|
|
7941
7975
|
})
|
|
7942
7976
|
};
|
|
7943
7977
|
}
|
|
7944
|
-
function
|
|
7978
|
+
function _f(e) {
|
|
7945
7979
|
if (!e || typeof e != "object") throw Error("JSON root must be an object.");
|
|
7946
7980
|
if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
|
|
7947
7981
|
let t = {};
|
|
7948
7982
|
for (let n = 0; n < e.node_trees.length; n++) {
|
|
7949
|
-
let r =
|
|
7983
|
+
let r = gf(e.node_trees[n], n);
|
|
7950
7984
|
t[r.id] = r;
|
|
7951
7985
|
}
|
|
7952
7986
|
let n = /* @__PURE__ */ new Set();
|
|
@@ -7965,21 +7999,21 @@ function mf(e) {
|
|
|
7965
7999
|
trees: t
|
|
7966
8000
|
};
|
|
7967
8001
|
}
|
|
7968
|
-
function
|
|
8002
|
+
function vf(e, t) {
|
|
7969
8003
|
return {
|
|
7970
8004
|
...t,
|
|
7971
8005
|
nodeId: e,
|
|
7972
8006
|
direction: "input"
|
|
7973
8007
|
};
|
|
7974
8008
|
}
|
|
7975
|
-
function
|
|
8009
|
+
function yf(e, t) {
|
|
7976
8010
|
return {
|
|
7977
8011
|
...t,
|
|
7978
8012
|
nodeId: e,
|
|
7979
8013
|
direction: "output"
|
|
7980
8014
|
};
|
|
7981
8015
|
}
|
|
7982
|
-
function
|
|
8016
|
+
function bf(e) {
|
|
7983
8017
|
let t = e.nodes.map((e) => ({
|
|
7984
8018
|
id: e.id,
|
|
7985
8019
|
type: e.type,
|
|
@@ -7987,12 +8021,14 @@ function _f(e) {
|
|
|
7987
8021
|
position: e.position,
|
|
7988
8022
|
width: e.width,
|
|
7989
8023
|
headerColor: e.headerColor,
|
|
7990
|
-
inputs: e.inputs.map((t) =>
|
|
7991
|
-
outputs: e.outputs.map((t) =>
|
|
8024
|
+
inputs: e.inputs.map((t) => vf(e.id, t)),
|
|
8025
|
+
outputs: e.outputs.map((t) => yf(e.id, t)),
|
|
7992
8026
|
floatCurve: e.floatCurve,
|
|
8027
|
+
colorRamp: e.colorRamp,
|
|
7993
8028
|
properties: e.properties,
|
|
7994
8029
|
groupTreeId: e.groupTreeId,
|
|
7995
|
-
groupTreeName: e.groupTreeName
|
|
8030
|
+
groupTreeName: e.groupTreeName,
|
|
8031
|
+
parentFrameId: e.parentFrameId
|
|
7996
8032
|
})), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
7997
8033
|
for (let e of t) for (let t of [...e.inputs, ...e.outputs]) n.set(t.id, e.id), r.set(t.id, t);
|
|
7998
8034
|
let i = e.links.map((e) => ({
|
|
@@ -8012,11 +8048,58 @@ function _f(e) {
|
|
|
8012
8048
|
}
|
|
8013
8049
|
//#endregion
|
|
8014
8050
|
//#region src/gn/xyflow/mapGraphIRToFlow.ts
|
|
8015
|
-
function
|
|
8051
|
+
function xf(e) {
|
|
8016
8052
|
let t = Math.max(e.inputs.length, e.outputs.length);
|
|
8017
8053
|
return Math.max(60, 32 + t * 18 + 16);
|
|
8018
8054
|
}
|
|
8019
|
-
function
|
|
8055
|
+
function Sf(e) {
|
|
8056
|
+
return e.type === "NodeReroute" ? {
|
|
8057
|
+
w: 12,
|
|
8058
|
+
h: 12
|
|
8059
|
+
} : {
|
|
8060
|
+
w: e.width,
|
|
8061
|
+
h: xf(e)
|
|
8062
|
+
};
|
|
8063
|
+
}
|
|
8064
|
+
function Cf(e) {
|
|
8065
|
+
let t = e.nodes.filter((e) => e.type === "NodeFrame");
|
|
8066
|
+
if (t.length === 0) return [];
|
|
8067
|
+
let n = /* @__PURE__ */ new Map();
|
|
8068
|
+
for (let t of e.nodes) {
|
|
8069
|
+
if (!t.parentFrameId) continue;
|
|
8070
|
+
let e = n.get(t.parentFrameId) ?? [];
|
|
8071
|
+
e.push(t), n.set(t.parentFrameId, e);
|
|
8072
|
+
}
|
|
8073
|
+
let r = [];
|
|
8074
|
+
for (let e of t) {
|
|
8075
|
+
let t = n.get(e.id) ?? [];
|
|
8076
|
+
if (t.length === 0) continue;
|
|
8077
|
+
let i = Infinity, a = Infinity, o = -Infinity, s = -Infinity;
|
|
8078
|
+
for (let e of t) {
|
|
8079
|
+
let { w: t, h: n } = Sf(e);
|
|
8080
|
+
i = Math.min(i, e.position.x), a = Math.min(a, e.position.y), o = Math.max(o, e.position.x + t), s = Math.max(s, e.position.y + n);
|
|
8081
|
+
}
|
|
8082
|
+
Number.isFinite(i) && r.push({
|
|
8083
|
+
id: `frame:${e.id}`,
|
|
8084
|
+
type: "nodeFrame",
|
|
8085
|
+
position: {
|
|
8086
|
+
x: i - 28,
|
|
8087
|
+
y: a - 48
|
|
8088
|
+
},
|
|
8089
|
+
draggable: !1,
|
|
8090
|
+
selectable: !1,
|
|
8091
|
+
connectable: !1,
|
|
8092
|
+
data: { label: e.label },
|
|
8093
|
+
style: {
|
|
8094
|
+
width: o - i + 56,
|
|
8095
|
+
height: s - a + 48 + 28,
|
|
8096
|
+
zIndex: -8
|
|
8097
|
+
}
|
|
8098
|
+
});
|
|
8099
|
+
}
|
|
8100
|
+
return r;
|
|
8101
|
+
}
|
|
8102
|
+
function wf(e, t) {
|
|
8020
8103
|
if (e.type === "NodeReroute") {
|
|
8021
8104
|
let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
|
|
8022
8105
|
return {
|
|
@@ -8050,13 +8133,14 @@ function yf(e, t) {
|
|
|
8050
8133
|
outputs: e.outputs,
|
|
8051
8134
|
connectedInputIds: e.inputs.filter((e) => t.has(e.id)).map((e) => e.id),
|
|
8052
8135
|
floatCurve: e.floatCurve,
|
|
8136
|
+
colorRamp: e.colorRamp,
|
|
8053
8137
|
properties: e.properties,
|
|
8054
8138
|
groupTreeId: e.groupTreeId,
|
|
8055
8139
|
groupTreeName: e.groupTreeName
|
|
8056
8140
|
}
|
|
8057
8141
|
};
|
|
8058
8142
|
}
|
|
8059
|
-
function
|
|
8143
|
+
function Tf(e, t, n) {
|
|
8060
8144
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
8061
8145
|
for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
|
|
8062
8146
|
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,26 +8164,26 @@ function bf(e, t, n) {
|
|
|
8080
8164
|
for (let e of a) s.has(e) && l.add(e);
|
|
8081
8165
|
return l;
|
|
8082
8166
|
}
|
|
8083
|
-
function
|
|
8084
|
-
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) =>
|
|
8085
|
-
if (
|
|
8086
|
-
let t =
|
|
8167
|
+
function Ef(e) {
|
|
8168
|
+
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = Cf(e), r = e.nodes.filter((e) => e.type !== "NodeFrame").map((e) => wf(e, t)), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), a = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), o = r;
|
|
8169
|
+
if (i && a) {
|
|
8170
|
+
let t = Tf(i.id, a.id, e);
|
|
8087
8171
|
if (t.size > 0) {
|
|
8088
|
-
let
|
|
8172
|
+
let n = new Map(e.nodes.map((e) => [e.id, e])), a = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
|
|
8089
8173
|
for (let e of t) {
|
|
8090
|
-
let t =
|
|
8174
|
+
let t = n.get(e);
|
|
8091
8175
|
if (!t) continue;
|
|
8092
|
-
let
|
|
8093
|
-
|
|
8176
|
+
let r = t.width, i = xf(t);
|
|
8177
|
+
a = Math.min(a, t.position.x), s = Math.min(s, t.position.y), c = Math.max(c, t.position.x + r), l = Math.max(l, t.position.y + i);
|
|
8094
8178
|
}
|
|
8095
|
-
if (Number.isFinite(
|
|
8096
|
-
let e =
|
|
8097
|
-
|
|
8179
|
+
if (Number.isFinite(a) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
|
|
8180
|
+
let e = a - 64, n = s - 64, u = c - a + 128, d = l - s + 128, f = `zone:simulation:${i.id}`;
|
|
8181
|
+
o = [{
|
|
8098
8182
|
id: f,
|
|
8099
8183
|
type: "simulationZone",
|
|
8100
8184
|
position: {
|
|
8101
8185
|
x: e,
|
|
8102
|
-
y:
|
|
8186
|
+
y: n
|
|
8103
8187
|
},
|
|
8104
8188
|
draggable: !1,
|
|
8105
8189
|
selectable: !1,
|
|
@@ -8110,20 +8194,20 @@ function xf(e) {
|
|
|
8110
8194
|
height: d,
|
|
8111
8195
|
zIndex: -10
|
|
8112
8196
|
}
|
|
8113
|
-
}, ...
|
|
8114
|
-
...
|
|
8197
|
+
}, ...r.map((r) => t.has(r.id) ? {
|
|
8198
|
+
...r,
|
|
8115
8199
|
parentId: f,
|
|
8116
8200
|
extent: "parent",
|
|
8117
8201
|
position: {
|
|
8118
|
-
x:
|
|
8119
|
-
y:
|
|
8202
|
+
x: r.position.x - e,
|
|
8203
|
+
y: r.position.y - n
|
|
8120
8204
|
}
|
|
8121
|
-
} :
|
|
8205
|
+
} : r)];
|
|
8122
8206
|
}
|
|
8123
8207
|
}
|
|
8124
8208
|
}
|
|
8125
8209
|
return {
|
|
8126
|
-
nodes:
|
|
8210
|
+
nodes: [...n, ...o],
|
|
8127
8211
|
edges: e.edges.map((e) => ({
|
|
8128
8212
|
id: e.id,
|
|
8129
8213
|
source: e.sourceNodeId,
|
|
@@ -8137,7 +8221,7 @@ function xf(e) {
|
|
|
8137
8221
|
}
|
|
8138
8222
|
//#endregion
|
|
8139
8223
|
//#region src/gn/exporter/nodebpyExporter.ts
|
|
8140
|
-
function
|
|
8224
|
+
function Df(e, t) {
|
|
8141
8225
|
let n = e.node_trees;
|
|
8142
8226
|
if (!Array.isArray(n) || t.size === 0) return e;
|
|
8143
8227
|
let r = new Map(n.map((e) => [e.id, e])), i = /* @__PURE__ */ new Set(), a = [];
|
|
@@ -8197,25 +8281,25 @@ function Sf(e, t) {
|
|
|
8197
8281
|
}
|
|
8198
8282
|
//#endregion
|
|
8199
8283
|
//#region src/utils/encodeTreeClipperPayload.ts
|
|
8200
|
-
var
|
|
8201
|
-
function
|
|
8284
|
+
var Of = "TreeClipper::";
|
|
8285
|
+
function kf(e) {
|
|
8202
8286
|
let t = "", n = 32768;
|
|
8203
8287
|
for (let r = 0; r < e.length; r += n) t += String.fromCharCode(...e.subarray(r, r + n));
|
|
8204
8288
|
return btoa(t);
|
|
8205
8289
|
}
|
|
8206
|
-
async function
|
|
8290
|
+
async function Af(e) {
|
|
8207
8291
|
let t = new Blob([e]).stream().pipeThrough(new CompressionStream("gzip")), n = await new Response(t).arrayBuffer();
|
|
8208
8292
|
return new Uint8Array(n);
|
|
8209
8293
|
}
|
|
8210
|
-
async function
|
|
8211
|
-
return
|
|
8294
|
+
async function jf(e) {
|
|
8295
|
+
return Of + kf(await Af(new TextEncoder().encode(e)));
|
|
8212
8296
|
}
|
|
8213
8297
|
//#endregion
|
|
8214
8298
|
//#region src/gn/ir/curvePath.ts
|
|
8215
|
-
function
|
|
8299
|
+
function Mf(e, t) {
|
|
8216
8300
|
return Math.sqrt(e * e + t * t);
|
|
8217
8301
|
}
|
|
8218
|
-
function
|
|
8302
|
+
function Nf(e) {
|
|
8219
8303
|
let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
|
|
8220
8304
|
let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
|
|
8221
8305
|
if (i === "VECTOR") return {
|
|
@@ -8225,11 +8309,11 @@ function Of(e) {
|
|
|
8225
8309
|
let c = 0, l = 0, u = 0, d = 0;
|
|
8226
8310
|
if (o && s) {
|
|
8227
8311
|
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 =
|
|
8312
|
+
if (u = Mf(e, t), d = Mf(i, a), u > 1e-8 && d > 1e-8) {
|
|
8313
|
+
let n = e / u + i / d, r = t / u + a / d, o = Mf(n, r);
|
|
8230
8314
|
o > 1e-8 && (c = n / o, l = r / o);
|
|
8231
8315
|
} 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 =
|
|
8316
|
+
} else s ? (d = Mf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = Mf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
|
|
8233
8317
|
let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
|
|
8234
8318
|
if (i === "AUTO_CLAMPED") {
|
|
8235
8319
|
if (o) {
|
|
@@ -8274,7 +8358,7 @@ function Of(e) {
|
|
|
8274
8358
|
}
|
|
8275
8359
|
return n;
|
|
8276
8360
|
}
|
|
8277
|
-
function
|
|
8361
|
+
function Pf(e, t, n, r, i, a, o) {
|
|
8278
8362
|
let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
|
|
8279
8363
|
if (e.length < 2) return {
|
|
8280
8364
|
strokePath: "",
|
|
@@ -8282,7 +8366,7 @@ function kf(e, t, n, r, i, a, o) {
|
|
|
8282
8366
|
zeroLinePath: "",
|
|
8283
8367
|
dotPositions: []
|
|
8284
8368
|
};
|
|
8285
|
-
let d =
|
|
8369
|
+
let d = Nf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
|
|
8286
8370
|
for (let t = 0; t < e.length - 1; t++) {
|
|
8287
8371
|
let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
|
|
8288
8372
|
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)}`;
|
|
@@ -8296,19 +8380,217 @@ function kf(e, t, n, r, i, a, o) {
|
|
|
8296
8380
|
};
|
|
8297
8381
|
}
|
|
8298
8382
|
//#endregion
|
|
8383
|
+
//#region src/gn/components/ColorRampViz.tsx
|
|
8384
|
+
function Ff([e, t, n]) {
|
|
8385
|
+
let r = Math.max(e, t, n), i = r - Math.min(e, t, n), a = 0;
|
|
8386
|
+
i !== 0 && (a = r === e ? (t - n) / i % 6 : r === t ? (n - e) / i + 2 : (e - t) / i + 4, a /= 6, a < 0 && (a += 1));
|
|
8387
|
+
let o = r === 0 ? 0 : i / r;
|
|
8388
|
+
return [
|
|
8389
|
+
a,
|
|
8390
|
+
o,
|
|
8391
|
+
r
|
|
8392
|
+
];
|
|
8393
|
+
}
|
|
8394
|
+
function If([e, t, n]) {
|
|
8395
|
+
if (t === 0) return [
|
|
8396
|
+
n,
|
|
8397
|
+
n,
|
|
8398
|
+
n
|
|
8399
|
+
];
|
|
8400
|
+
let r = Math.floor(e * 6), i = e * 6 - r, a = n * (1 - t), o = n * (1 - t * i), s = n * (1 - t * (1 - i));
|
|
8401
|
+
switch ((r % 6 + 6) % 6) {
|
|
8402
|
+
case 0: return [
|
|
8403
|
+
n,
|
|
8404
|
+
s,
|
|
8405
|
+
a
|
|
8406
|
+
];
|
|
8407
|
+
case 1: return [
|
|
8408
|
+
o,
|
|
8409
|
+
n,
|
|
8410
|
+
a
|
|
8411
|
+
];
|
|
8412
|
+
case 2: return [
|
|
8413
|
+
a,
|
|
8414
|
+
n,
|
|
8415
|
+
s
|
|
8416
|
+
];
|
|
8417
|
+
case 3: return [
|
|
8418
|
+
a,
|
|
8419
|
+
o,
|
|
8420
|
+
n
|
|
8421
|
+
];
|
|
8422
|
+
case 4: return [
|
|
8423
|
+
s,
|
|
8424
|
+
a,
|
|
8425
|
+
n
|
|
8426
|
+
];
|
|
8427
|
+
default: return [
|
|
8428
|
+
n,
|
|
8429
|
+
a,
|
|
8430
|
+
o
|
|
8431
|
+
];
|
|
8432
|
+
}
|
|
8433
|
+
}
|
|
8434
|
+
function Lf([e, t, n]) {
|
|
8435
|
+
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2, o = r - i, s = 0, c = 0;
|
|
8436
|
+
return o !== 0 && (c = a > .5 ? o / (2 - r - i) : o / (r + i), s = r === e ? (t - n) / o % 6 : r === t ? (n - e) / o + 2 : (e - t) / o + 4, s /= 6, s < 0 && (s += 1)), [
|
|
8437
|
+
s,
|
|
8438
|
+
c,
|
|
8439
|
+
a
|
|
8440
|
+
];
|
|
8441
|
+
}
|
|
8442
|
+
function Rf([e, t, n]) {
|
|
8443
|
+
if (t === 0) return [
|
|
8444
|
+
n,
|
|
8445
|
+
n,
|
|
8446
|
+
n
|
|
8447
|
+
];
|
|
8448
|
+
let r = n < .5 ? n * (1 + t) : n + t - n * t, i = 2 * n - r, a = (e) => (e < 0 && (e += 1), e > 1 && --e, e < 1 / 6 ? i + (r - i) * 6 * e : e < 1 / 2 ? r : e < 2 / 3 ? i + (r - i) * (2 / 3 - e) * 6 : i);
|
|
8449
|
+
return [
|
|
8450
|
+
a(e + 1 / 3),
|
|
8451
|
+
a(e),
|
|
8452
|
+
a(e - 1 / 3)
|
|
8453
|
+
];
|
|
8454
|
+
}
|
|
8455
|
+
var zf = (e) => e < 1 ? e : e - 1;
|
|
8456
|
+
function Bf(e, t, n, r, i) {
|
|
8457
|
+
let a = zf((r % 1 + 1) % 1), o = zf((i % 1 + 1) % 1), s = 0;
|
|
8458
|
+
switch (e) {
|
|
8459
|
+
case "NEAR":
|
|
8460
|
+
a < o && o - a > .5 ? s = 1 : a > o && o - a < -.5 && (s = 2);
|
|
8461
|
+
break;
|
|
8462
|
+
case "FAR":
|
|
8463
|
+
a === o || a < o && o - a < .5 ? s = 1 : a > o && o - a > -.5 && (s = 2);
|
|
8464
|
+
break;
|
|
8465
|
+
case "CCW":
|
|
8466
|
+
a > o && (s = 2);
|
|
8467
|
+
break;
|
|
8468
|
+
case "CW":
|
|
8469
|
+
a < o && (s = 1);
|
|
8470
|
+
break;
|
|
8471
|
+
}
|
|
8472
|
+
let c = (e, r) => t * e + n * r;
|
|
8473
|
+
return s === 1 ? zf(c(a + 1, o)) : s === 2 ? zf(c(a, o + 1)) : c(a, o);
|
|
8474
|
+
}
|
|
8475
|
+
function Vf(e, t) {
|
|
8476
|
+
let n = [...e.stops].sort((e, t) => e.position - t.position);
|
|
8477
|
+
if (n.length === 0) return [
|
|
8478
|
+
0,
|
|
8479
|
+
0,
|
|
8480
|
+
0,
|
|
8481
|
+
1
|
|
8482
|
+
];
|
|
8483
|
+
if (n.length === 1) return n[0].color;
|
|
8484
|
+
let r = e.colorMode === "RGB" ? e.interpolation : "LINEAR";
|
|
8485
|
+
if (t <= n[0].position) return n[0].color;
|
|
8486
|
+
if (t >= n[n.length - 1].position) return n[n.length - 1].color;
|
|
8487
|
+
let i = 0;
|
|
8488
|
+
for (; i < n.length - 1 && n[i + 1].position <= t;) i++;
|
|
8489
|
+
let a = n[i], o = n[i + 1];
|
|
8490
|
+
if (r === "CONSTANT") return a.color;
|
|
8491
|
+
let s = o.position - a.position, c = s === 0 ? 0 : (t - a.position) / s;
|
|
8492
|
+
r === "EASE" && (c = 3 * c * c - 2 * c * c * c);
|
|
8493
|
+
let l = c, u = 1 - c, d = u * a.color[3] + l * o.color[3];
|
|
8494
|
+
if (e.colorMode === "HSV" || e.colorMode === "HSL") {
|
|
8495
|
+
let t = e.colorMode === "HSV" ? Ff : Lf, n = e.colorMode === "HSV" ? If : Rf, r = t([
|
|
8496
|
+
a.color[0],
|
|
8497
|
+
a.color[1],
|
|
8498
|
+
a.color[2]
|
|
8499
|
+
]), i = t([
|
|
8500
|
+
o.color[0],
|
|
8501
|
+
o.color[1],
|
|
8502
|
+
o.color[2]
|
|
8503
|
+
]), [s, c, f] = n([
|
|
8504
|
+
Bf(e.hueInterpolation, l, u, i[0], r[0]),
|
|
8505
|
+
u * r[1] + l * i[1],
|
|
8506
|
+
u * r[2] + l * i[2]
|
|
8507
|
+
]);
|
|
8508
|
+
return [
|
|
8509
|
+
s,
|
|
8510
|
+
c,
|
|
8511
|
+
f,
|
|
8512
|
+
d
|
|
8513
|
+
];
|
|
8514
|
+
}
|
|
8515
|
+
return [
|
|
8516
|
+
u * a.color[0] + l * o.color[0],
|
|
8517
|
+
u * a.color[1] + l * o.color[1],
|
|
8518
|
+
u * a.color[2] + l * o.color[2],
|
|
8519
|
+
d
|
|
8520
|
+
];
|
|
8521
|
+
}
|
|
8522
|
+
function Hf(e) {
|
|
8523
|
+
let t = Math.min(1, Math.max(0, e));
|
|
8524
|
+
return t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
|
|
8525
|
+
}
|
|
8526
|
+
function Uf([e, t, n, r]) {
|
|
8527
|
+
let i = (e) => Math.round(Hf(e) * 255);
|
|
8528
|
+
return `rgba(${i(e)}, ${i(t)}, ${i(n)}, ${r.toFixed(3)})`;
|
|
8529
|
+
}
|
|
8530
|
+
var Wf = {
|
|
8531
|
+
NEAR: "Near",
|
|
8532
|
+
FAR: "Far",
|
|
8533
|
+
CW: "CW",
|
|
8534
|
+
CCW: "CCW"
|
|
8535
|
+
}, Gf = 64;
|
|
8536
|
+
function Kf({ data: e, width: t }) {
|
|
8537
|
+
let n = [];
|
|
8538
|
+
for (let t = 0; t <= Gf; t++) {
|
|
8539
|
+
let r = t / Gf;
|
|
8540
|
+
n.push(`${Uf(Vf(e, r))} ${(r * 100).toFixed(1)}%`);
|
|
8541
|
+
}
|
|
8542
|
+
let r = `linear-gradient(to right, ${n.join(", ")})`, i = [...e.stops].sort((e, t) => e.position - t.position), a = i[i.length - 1];
|
|
8543
|
+
return /* @__PURE__ */ _("div", {
|
|
8544
|
+
className: "gn-color-ramp",
|
|
8545
|
+
style: { width: t },
|
|
8546
|
+
children: [
|
|
8547
|
+
/* @__PURE__ */ _("div", {
|
|
8548
|
+
className: "gn-color-ramp__row",
|
|
8549
|
+
children: [/* @__PURE__ */ g("span", {
|
|
8550
|
+
className: "gn-color-ramp__select",
|
|
8551
|
+
children: e.colorMode
|
|
8552
|
+
}), /* @__PURE__ */ g("span", {
|
|
8553
|
+
className: "gn-color-ramp__select",
|
|
8554
|
+
children: Wf[e.hueInterpolation] ?? e.hueInterpolation
|
|
8555
|
+
})]
|
|
8556
|
+
}),
|
|
8557
|
+
/* @__PURE__ */ _("div", {
|
|
8558
|
+
className: "gn-color-ramp__bar-wrap",
|
|
8559
|
+
children: [/* @__PURE__ */ g("div", {
|
|
8560
|
+
className: "gn-color-ramp__checker",
|
|
8561
|
+
style: { backgroundImage: r }
|
|
8562
|
+
}), i.map((e, t) => /* @__PURE__ */ g("span", {
|
|
8563
|
+
className: `gn-color-ramp__stop${e === a ? " is-active" : ""}`,
|
|
8564
|
+
style: { left: `${e.position * 100}%` }
|
|
8565
|
+
}, t))]
|
|
8566
|
+
}),
|
|
8567
|
+
a && /* @__PURE__ */ _("div", {
|
|
8568
|
+
className: "gn-color-ramp__row gn-color-ramp__active",
|
|
8569
|
+
children: [/* @__PURE__ */ _("span", {
|
|
8570
|
+
className: "gn-color-ramp__pos",
|
|
8571
|
+
children: ["Pos ", a.position.toFixed(3)]
|
|
8572
|
+
}), /* @__PURE__ */ g("span", {
|
|
8573
|
+
className: "gn-color-ramp__swatch",
|
|
8574
|
+
style: { background: Uf(a.color) }
|
|
8575
|
+
})]
|
|
8576
|
+
})
|
|
8577
|
+
]
|
|
8578
|
+
});
|
|
8579
|
+
}
|
|
8580
|
+
//#endregion
|
|
8299
8581
|
//#region src/gn/components/groupNavContext.ts
|
|
8300
|
-
var
|
|
8301
|
-
function
|
|
8302
|
-
return o(
|
|
8582
|
+
var qf = t(null);
|
|
8583
|
+
function Jf() {
|
|
8584
|
+
return o(qf);
|
|
8303
8585
|
}
|
|
8304
8586
|
//#endregion
|
|
8305
8587
|
//#region src/gn/components/GenericGNNode.tsx
|
|
8306
|
-
var
|
|
8588
|
+
var Yf = [
|
|
8307
8589
|
"X",
|
|
8308
8590
|
"Y",
|
|
8309
8591
|
"Z",
|
|
8310
8592
|
"W"
|
|
8311
|
-
],
|
|
8593
|
+
], Xf = {
|
|
8312
8594
|
FLOAT: "Float",
|
|
8313
8595
|
INT: "Integer",
|
|
8314
8596
|
VECTOR: "Vector",
|
|
@@ -8316,7 +8598,7 @@ var Mf = [
|
|
|
8316
8598
|
STRING: "String",
|
|
8317
8599
|
BOOLEAN: "Boolean",
|
|
8318
8600
|
ROTATION: "Rotation"
|
|
8319
|
-
},
|
|
8601
|
+
}, Zf = {
|
|
8320
8602
|
EQUAL: "Equal",
|
|
8321
8603
|
NOT_EQUAL: "Not Equal",
|
|
8322
8604
|
LESS_THAN: "Less Than",
|
|
@@ -8362,10 +8644,10 @@ var Mf = [
|
|
|
8362
8644
|
RADIANS: "To Radians",
|
|
8363
8645
|
DEGREES: "To Degrees"
|
|
8364
8646
|
};
|
|
8365
|
-
function
|
|
8366
|
-
return e === "data_type" ?
|
|
8647
|
+
function Qf(e, t) {
|
|
8648
|
+
return e === "data_type" ? Xf[t] ?? t : e === "operation" ? Zf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
|
|
8367
8649
|
}
|
|
8368
|
-
function
|
|
8650
|
+
function $f(e) {
|
|
8369
8651
|
switch (e) {
|
|
8370
8652
|
case "LINE": return "gn-socket--line";
|
|
8371
8653
|
case "DIAMOND": return "gn-socket--diamond";
|
|
@@ -8374,55 +8656,55 @@ function If(e) {
|
|
|
8374
8656
|
default: return "gn-socket--circle";
|
|
8375
8657
|
}
|
|
8376
8658
|
}
|
|
8377
|
-
function
|
|
8659
|
+
function ep(e) {
|
|
8378
8660
|
return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
|
|
8379
8661
|
}
|
|
8380
|
-
function
|
|
8662
|
+
function tp(e) {
|
|
8381
8663
|
return parseFloat(e.toFixed(3)).toString();
|
|
8382
8664
|
}
|
|
8383
|
-
function
|
|
8384
|
-
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${
|
|
8665
|
+
function np(e, t) {
|
|
8666
|
+
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${tp(e)}${ep(t)}`;
|
|
8385
8667
|
}
|
|
8386
|
-
function
|
|
8668
|
+
function rp(e) {
|
|
8387
8669
|
return Math.round(Math.min(1, Math.max(0, e)) * 255);
|
|
8388
8670
|
}
|
|
8389
|
-
function
|
|
8671
|
+
function ip(e) {
|
|
8390
8672
|
let [t, n, r, i = 1] = e.values;
|
|
8391
8673
|
return /* @__PURE__ */ g("div", {
|
|
8392
8674
|
className: "gn-node__color-swatch",
|
|
8393
|
-
style: { background: `rgba(${
|
|
8675
|
+
style: { background: `rgba(${rp(t)},${rp(n)},${rp(r)},${i.toFixed(2)})` }
|
|
8394
8676
|
});
|
|
8395
8677
|
}
|
|
8396
|
-
function
|
|
8397
|
-
if (e.dataType === "RGBA") return /* @__PURE__ */ g(
|
|
8398
|
-
let t =
|
|
8678
|
+
function ap(e) {
|
|
8679
|
+
if (e.dataType === "RGBA") return /* @__PURE__ */ g(ip, { values: e.values });
|
|
8680
|
+
let t = ep(e.dataType);
|
|
8399
8681
|
return /* @__PURE__ */ g("div", {
|
|
8400
8682
|
className: "gn-node__vec-block",
|
|
8401
8683
|
children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
|
|
8402
8684
|
className: "gn-node__vec-row",
|
|
8403
8685
|
children: [/* @__PURE__ */ g("span", {
|
|
8404
8686
|
className: "gn-node__vec-label",
|
|
8405
|
-
children:
|
|
8687
|
+
children: Yf[n]
|
|
8406
8688
|
}), /* @__PURE__ */ _("span", {
|
|
8407
8689
|
className: "gn-node__vec-value",
|
|
8408
|
-
children: [
|
|
8690
|
+
children: [tp(e), t]
|
|
8409
8691
|
})]
|
|
8410
8692
|
}, n))
|
|
8411
8693
|
});
|
|
8412
8694
|
}
|
|
8413
|
-
function
|
|
8695
|
+
function op({ properties: e }) {
|
|
8414
8696
|
let t = Object.entries(e);
|
|
8415
8697
|
return t.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
8416
8698
|
className: "gn-node__props",
|
|
8417
8699
|
children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
|
|
8418
8700
|
className: "gn-node__prop-row",
|
|
8419
|
-
children:
|
|
8701
|
+
children: Qf(e, t)
|
|
8420
8702
|
}, e))
|
|
8421
8703
|
});
|
|
8422
8704
|
}
|
|
8423
|
-
var
|
|
8424
|
-
function
|
|
8425
|
-
let n = Math.max(10, t -
|
|
8705
|
+
var sp = 120, cp = 6;
|
|
8706
|
+
function lp({ curve: e, width: t }) {
|
|
8707
|
+
let n = Math.max(10, t - cp * 2), r = sp, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = Pf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
|
|
8426
8708
|
return /* @__PURE__ */ g("div", {
|
|
8427
8709
|
className: "gn-node__curve-wrap",
|
|
8428
8710
|
children: /* @__PURE__ */ _("svg", {
|
|
@@ -8453,7 +8735,7 @@ function Kf({ curve: e, width: t }) {
|
|
|
8453
8735
|
})
|
|
8454
8736
|
});
|
|
8455
8737
|
}
|
|
8456
|
-
function
|
|
8738
|
+
function up(e) {
|
|
8457
8739
|
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
8740
|
return /* @__PURE__ */ _("div", {
|
|
8459
8741
|
className: `gn-node__socket-row gn-node__socket-row--${i}`,
|
|
@@ -8462,7 +8744,7 @@ function qf(e) {
|
|
|
8462
8744
|
id: t.id,
|
|
8463
8745
|
type: r,
|
|
8464
8746
|
position: n,
|
|
8465
|
-
className: `gn-socket ${
|
|
8747
|
+
className: `gn-socket ${$f(t.displayShape)}`,
|
|
8466
8748
|
style: {
|
|
8467
8749
|
top: "50%",
|
|
8468
8750
|
background: t.color,
|
|
@@ -8475,15 +8757,15 @@ function qf(e) {
|
|
|
8475
8757
|
}),
|
|
8476
8758
|
s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
|
|
8477
8759
|
className: "gn-node__value",
|
|
8478
|
-
children:
|
|
8760
|
+
children: np(t.defaultValue.value, t.dataType)
|
|
8479
8761
|
}) : null
|
|
8480
8762
|
]
|
|
8481
8763
|
});
|
|
8482
8764
|
}
|
|
8483
|
-
function
|
|
8765
|
+
function dp(e, t) {
|
|
8484
8766
|
return !t && !e.hideValue && e.defaultValue?.kind === "vec";
|
|
8485
8767
|
}
|
|
8486
|
-
function
|
|
8768
|
+
function fp() {
|
|
8487
8769
|
return /* @__PURE__ */ _("div", {
|
|
8488
8770
|
className: "gn-node__stack",
|
|
8489
8771
|
"aria-hidden": "true",
|
|
@@ -8494,8 +8776,8 @@ function Yf() {
|
|
|
8494
8776
|
]
|
|
8495
8777
|
});
|
|
8496
8778
|
}
|
|
8497
|
-
function
|
|
8498
|
-
let t = e.data, n =
|
|
8779
|
+
function pp(e) {
|
|
8780
|
+
let t = e.data, n = Jf(), 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
8781
|
return /* @__PURE__ */ _("div", {
|
|
8500
8782
|
className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
|
|
8501
8783
|
onClick: s ? () => n.openGroup(o) : void 0,
|
|
@@ -8510,40 +8792,47 @@ function Xf(e) {
|
|
|
8510
8792
|
children: t.label
|
|
8511
8793
|
})
|
|
8512
8794
|
}),
|
|
8513
|
-
s && /* @__PURE__ */ g(
|
|
8514
|
-
t.properties && /* @__PURE__ */ g(
|
|
8515
|
-
t.floatCurve && /* @__PURE__ */ g(
|
|
8795
|
+
s && /* @__PURE__ */ g(fp, {}),
|
|
8796
|
+
t.properties && /* @__PURE__ */ g(op, { properties: t.properties }),
|
|
8797
|
+
t.floatCurve && /* @__PURE__ */ g(lp, {
|
|
8516
8798
|
curve: t.floatCurve,
|
|
8517
8799
|
width: t.width
|
|
8518
8800
|
}),
|
|
8519
8801
|
/* @__PURE__ */ _("div", {
|
|
8520
8802
|
className: "gn-node__body",
|
|
8521
|
-
children: [
|
|
8522
|
-
|
|
8523
|
-
position: Y.Right,
|
|
8524
|
-
type: "source",
|
|
8525
|
-
align: "right",
|
|
8526
|
-
suppressDefault: !0
|
|
8527
|
-
}, e.id)), a.map((e) => {
|
|
8528
|
-
let t = r.has(e.id);
|
|
8529
|
-
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(qf, {
|
|
8803
|
+
children: [
|
|
8804
|
+
i.map((e) => /* @__PURE__ */ g(up, {
|
|
8530
8805
|
socket: e,
|
|
8531
|
-
position: Y.
|
|
8532
|
-
type: "
|
|
8533
|
-
align: "
|
|
8534
|
-
suppressDefault:
|
|
8535
|
-
}
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8806
|
+
position: Y.Right,
|
|
8807
|
+
type: "source",
|
|
8808
|
+
align: "right",
|
|
8809
|
+
suppressDefault: !0
|
|
8810
|
+
}, e.id)),
|
|
8811
|
+
t.colorRamp && /* @__PURE__ */ g(Kf, {
|
|
8812
|
+
data: t.colorRamp,
|
|
8813
|
+
width: t.width
|
|
8814
|
+
}),
|
|
8815
|
+
a.map((e) => {
|
|
8816
|
+
let t = r.has(e.id);
|
|
8817
|
+
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(up, {
|
|
8818
|
+
socket: e,
|
|
8819
|
+
position: Y.Left,
|
|
8820
|
+
type: "target",
|
|
8821
|
+
align: "left",
|
|
8822
|
+
suppressDefault: t
|
|
8823
|
+
}), dp(e, t) ? /* @__PURE__ */ g(ap, {
|
|
8824
|
+
values: e.defaultValue.values,
|
|
8825
|
+
dataType: e.dataType
|
|
8826
|
+
}) : null] }, e.id);
|
|
8827
|
+
})
|
|
8828
|
+
]
|
|
8540
8829
|
})
|
|
8541
8830
|
]
|
|
8542
8831
|
});
|
|
8543
8832
|
}
|
|
8544
8833
|
//#endregion
|
|
8545
8834
|
//#region src/gn/components/RerouteNode.tsx
|
|
8546
|
-
function
|
|
8835
|
+
function mp(e) {
|
|
8547
8836
|
let t = e.data;
|
|
8548
8837
|
return /* @__PURE__ */ _("div", {
|
|
8549
8838
|
className: "gn-reroute",
|
|
@@ -8563,7 +8852,7 @@ function Zf(e) {
|
|
|
8563
8852
|
}
|
|
8564
8853
|
//#endregion
|
|
8565
8854
|
//#region src/gn/components/SimulationZoneFrame.tsx
|
|
8566
|
-
function
|
|
8855
|
+
function hp(e) {
|
|
8567
8856
|
let t = e.data;
|
|
8568
8857
|
return /* @__PURE__ */ g("div", {
|
|
8569
8858
|
className: "gn-sim-zone",
|
|
@@ -8589,98 +8878,123 @@ function Qf(e) {
|
|
|
8589
8878
|
});
|
|
8590
8879
|
}
|
|
8591
8880
|
//#endregion
|
|
8592
|
-
//#region src/gn/components/
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8881
|
+
//#region src/gn/components/NodeFrame.tsx
|
|
8882
|
+
function gp(e) {
|
|
8883
|
+
let t = e.data;
|
|
8884
|
+
return /* @__PURE__ */ g("div", {
|
|
8885
|
+
className: "gn-node-frame",
|
|
8886
|
+
style: {
|
|
8887
|
+
width: "100%",
|
|
8888
|
+
height: "100%",
|
|
8889
|
+
borderRadius: 10,
|
|
8890
|
+
border: "1px solid rgba(255, 255, 255, 0.09)",
|
|
8891
|
+
background: "rgba(255, 255, 255, 0.035)",
|
|
8892
|
+
pointerEvents: "none"
|
|
8893
|
+
},
|
|
8894
|
+
children: t?.label ? /* @__PURE__ */ g("div", {
|
|
8895
|
+
style: {
|
|
8896
|
+
textAlign: "center",
|
|
8897
|
+
padding: "10px 12px",
|
|
8898
|
+
fontSize: 15,
|
|
8899
|
+
fontWeight: 500,
|
|
8900
|
+
color: "rgba(235, 235, 235, 0.6)",
|
|
8901
|
+
userSelect: "none",
|
|
8902
|
+
whiteSpace: "nowrap",
|
|
8903
|
+
overflow: "hidden",
|
|
8904
|
+
textOverflow: "ellipsis"
|
|
8905
|
+
},
|
|
8906
|
+
children: t.label
|
|
8907
|
+
}) : null
|
|
8908
|
+
});
|
|
8612
8909
|
}
|
|
8613
|
-
|
|
8614
|
-
|
|
8910
|
+
//#endregion
|
|
8911
|
+
//#region src/gn/components/GeometryNodesFlow.tsx
|
|
8912
|
+
var _p = {
|
|
8913
|
+
gnNode: pp,
|
|
8914
|
+
rerouteNode: mp,
|
|
8915
|
+
simulationZone: hp,
|
|
8916
|
+
nodeFrame: gp
|
|
8917
|
+
}, vp = { padding: .08 };
|
|
8918
|
+
function yp(e) {
|
|
8919
|
+
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
8920
|
c(() => {
|
|
8616
|
-
|
|
8921
|
+
if (!v) return;
|
|
8922
|
+
let e = h(m());
|
|
8923
|
+
I([[e.x, e.y], [e.x + e.width, e.y + e.height]]);
|
|
8617
8924
|
}, [
|
|
8925
|
+
v,
|
|
8618
8926
|
t,
|
|
8619
|
-
|
|
8927
|
+
m,
|
|
8928
|
+
h
|
|
8929
|
+
]), c(() => {
|
|
8930
|
+
A(t), s?.([]), b.current = !1, p(vp);
|
|
8931
|
+
}, [
|
|
8932
|
+
t,
|
|
8933
|
+
A,
|
|
8620
8934
|
s,
|
|
8621
|
-
|
|
8935
|
+
p
|
|
8622
8936
|
]), c(() => {
|
|
8623
|
-
|
|
8624
|
-
}, [n,
|
|
8625
|
-
let e =
|
|
8937
|
+
N(n);
|
|
8938
|
+
}, [n, N]), c(() => {
|
|
8939
|
+
let e = y.current;
|
|
8626
8940
|
if (!e) return;
|
|
8627
8941
|
let t = new ResizeObserver(() => {
|
|
8628
|
-
|
|
8942
|
+
b.current || p(vp);
|
|
8629
8943
|
});
|
|
8630
8944
|
return t.observe(e), () => t.disconnect();
|
|
8631
|
-
}, [
|
|
8632
|
-
let
|
|
8633
|
-
e && (
|
|
8634
|
-
}, []),
|
|
8945
|
+
}, [p]);
|
|
8946
|
+
let L = a((e) => {
|
|
8947
|
+
e && (b.current = !0);
|
|
8948
|
+
}, []), R = a(({ nodes: e }) => {
|
|
8635
8949
|
let t = e.map((e) => e.id);
|
|
8636
|
-
|
|
8637
|
-
}, [s]),
|
|
8638
|
-
e.preventDefault(),
|
|
8950
|
+
x.current = t, s?.(t);
|
|
8951
|
+
}, [s]), ee = a((e) => {
|
|
8952
|
+
e.preventDefault(), C({
|
|
8639
8953
|
x: e.clientX,
|
|
8640
8954
|
y: e.clientY
|
|
8641
8955
|
});
|
|
8642
|
-
}, []),
|
|
8643
|
-
|
|
8956
|
+
}, []), z = a(async () => {
|
|
8957
|
+
C(null);
|
|
8644
8958
|
try {
|
|
8645
|
-
let e = JSON.parse(r), t = new Set(
|
|
8959
|
+
let e = JSON.parse(r), t = new Set(x.current.map(Number).filter(Number.isFinite)), n = t.size > 0 ? Df(e, t) : e, i = await jf(JSON.stringify(n));
|
|
8646
8960
|
if (await navigator.clipboard.writeText(i), l) {
|
|
8647
8961
|
l();
|
|
8648
8962
|
return;
|
|
8649
8963
|
}
|
|
8650
|
-
|
|
8651
|
-
|
|
8964
|
+
O.current.forEach(clearTimeout), D(!1), T(!0), O.current = [setTimeout(() => D(!0), 2500), setTimeout(() => {
|
|
8965
|
+
T(!1), D(!1);
|
|
8652
8966
|
}, 3e3)];
|
|
8653
8967
|
} catch {}
|
|
8654
8968
|
}, [r, l]);
|
|
8655
|
-
return c(() => () =>
|
|
8656
|
-
if (!
|
|
8657
|
-
let e = () =>
|
|
8658
|
-
e.key === "Escape" &&
|
|
8969
|
+
return c(() => () => O.current.forEach(clearTimeout), []), c(() => {
|
|
8970
|
+
if (!S) return;
|
|
8971
|
+
let e = () => C(null), t = (e) => {
|
|
8972
|
+
e.key === "Escape" && C(null);
|
|
8659
8973
|
};
|
|
8660
8974
|
return window.addEventListener("click", e), window.addEventListener("scroll", e, !0), window.addEventListener("keydown", t), () => {
|
|
8661
8975
|
window.removeEventListener("click", e), window.removeEventListener("scroll", e, !0), window.removeEventListener("keydown", t);
|
|
8662
8976
|
};
|
|
8663
|
-
}, [
|
|
8664
|
-
ref:
|
|
8977
|
+
}, [S]), /* @__PURE__ */ _("div", {
|
|
8978
|
+
ref: y,
|
|
8665
8979
|
style: {
|
|
8666
8980
|
width: "100%",
|
|
8667
8981
|
height: "100%",
|
|
8668
8982
|
position: "relative"
|
|
8669
8983
|
},
|
|
8670
|
-
onContextMenu:
|
|
8984
|
+
onContextMenu: ee,
|
|
8671
8985
|
children: [
|
|
8672
8986
|
/* @__PURE__ */ _(dd, {
|
|
8673
|
-
nodes:
|
|
8674
|
-
edges:
|
|
8675
|
-
onNodesChange:
|
|
8676
|
-
onEdgesChange:
|
|
8677
|
-
onSelectionChange:
|
|
8678
|
-
onMoveStart:
|
|
8679
|
-
nodeTypes:
|
|
8987
|
+
nodes: k,
|
|
8988
|
+
edges: M,
|
|
8989
|
+
onNodesChange: j,
|
|
8990
|
+
onEdgesChange: P,
|
|
8991
|
+
onSelectionChange: R,
|
|
8992
|
+
onMoveStart: L,
|
|
8993
|
+
nodeTypes: _p,
|
|
8680
8994
|
fitView: !0,
|
|
8681
|
-
fitViewOptions:
|
|
8995
|
+
fitViewOptions: vp,
|
|
8682
8996
|
minZoom: .2,
|
|
8683
|
-
translateExtent:
|
|
8997
|
+
translateExtent: F,
|
|
8684
8998
|
nodesDraggable: !1,
|
|
8685
8999
|
nodesConnectable: !1,
|
|
8686
9000
|
elementsSelectable: !0,
|
|
@@ -8692,23 +9006,23 @@ function ip(e) {
|
|
|
8692
9006
|
connectOnClick: !1,
|
|
8693
9007
|
panOnDrag: [1, 2],
|
|
8694
9008
|
panOnScroll: !1,
|
|
8695
|
-
zoomOnScroll:
|
|
8696
|
-
preventScrolling:
|
|
9009
|
+
zoomOnScroll: u,
|
|
9010
|
+
preventScrolling: u,
|
|
8697
9011
|
zoomOnDoubleClick: !1,
|
|
8698
9012
|
children: [
|
|
8699
|
-
/* @__PURE__ */ g(
|
|
9013
|
+
/* @__PURE__ */ g(Sd, {
|
|
8700
9014
|
gap: 20,
|
|
8701
9015
|
size: 1,
|
|
8702
9016
|
color: "var(--grid-dot, #3a3a3a)"
|
|
8703
9017
|
}),
|
|
8704
|
-
/* @__PURE__ */ g(
|
|
9018
|
+
/* @__PURE__ */ g(jd, { showInteractive: !1 }),
|
|
8705
9019
|
/* @__PURE__ */ g(Sc, {
|
|
8706
9020
|
position: "top-left",
|
|
8707
9021
|
children: /* @__PURE__ */ _("div", {
|
|
8708
9022
|
className: "gn-top-left",
|
|
8709
9023
|
children: [/* @__PURE__ */ _("span", {
|
|
8710
9024
|
className: "gn-version-badge",
|
|
8711
|
-
children: ["node-web-render v", "0.3.
|
|
9025
|
+
children: ["node-web-render v", "0.3.15"]
|
|
8712
9026
|
}), i.length > 1 ? /* @__PURE__ */ g("nav", {
|
|
8713
9027
|
className: "gn-breadcrumbs",
|
|
8714
9028
|
"aria-label": "Node group path",
|
|
@@ -8737,11 +9051,11 @@ function ip(e) {
|
|
|
8737
9051
|
})
|
|
8738
9052
|
]
|
|
8739
9053
|
}),
|
|
8740
|
-
|
|
9054
|
+
S ? /* @__PURE__ */ g("div", {
|
|
8741
9055
|
className: "gn-context-menu",
|
|
8742
9056
|
style: {
|
|
8743
|
-
left:
|
|
8744
|
-
top:
|
|
9057
|
+
left: S.x,
|
|
9058
|
+
top: S.y
|
|
8745
9059
|
},
|
|
8746
9060
|
onClick: (e) => e.stopPropagation(),
|
|
8747
9061
|
role: "menu",
|
|
@@ -8749,31 +9063,31 @@ function ip(e) {
|
|
|
8749
9063
|
type: "button",
|
|
8750
9064
|
className: "gn-context-menu__item",
|
|
8751
9065
|
role: "menuitem",
|
|
8752
|
-
onClick:
|
|
9066
|
+
onClick: z,
|
|
8753
9067
|
children: "Copy selected nodes to Tree Clipper magic string"
|
|
8754
9068
|
})
|
|
8755
9069
|
}) : null,
|
|
8756
|
-
|
|
8757
|
-
className: `gn-context-toast${
|
|
9070
|
+
w || E ? /* @__PURE__ */ g("div", {
|
|
9071
|
+
className: `gn-context-toast${E ? " gnwr-leaving" : ""}`,
|
|
8758
9072
|
role: "status",
|
|
8759
9073
|
children: "Copied Tree Clipper magic string"
|
|
8760
9074
|
}) : null
|
|
8761
9075
|
]
|
|
8762
9076
|
});
|
|
8763
9077
|
}
|
|
8764
|
-
function
|
|
9078
|
+
function bp(e) {
|
|
8765
9079
|
let { jsonText: t, showHeader: n = !0, onSelectionChange: r, onCopiedMagicString: i, zoomOnScroll: o = !0 } = e, [s, l] = f({
|
|
8766
9080
|
json: t,
|
|
8767
9081
|
ids: []
|
|
8768
9082
|
}), d = u(() => {
|
|
8769
9083
|
if (!t.trim()) return null;
|
|
8770
9084
|
try {
|
|
8771
|
-
let { rootId: e, trees: n } =
|
|
9085
|
+
let { rootId: e, trees: n } = _f(JSON.parse(t)), r = {};
|
|
8772
9086
|
for (let e of Object.values(n)) {
|
|
8773
|
-
let t =
|
|
9087
|
+
let t = bf(e);
|
|
8774
9088
|
r[t.id] = {
|
|
8775
9089
|
graph: t,
|
|
8776
|
-
flow:
|
|
9090
|
+
flow: Ef(t)
|
|
8777
9091
|
};
|
|
8778
9092
|
}
|
|
8779
9093
|
return {
|
|
@@ -8837,9 +9151,9 @@ function ap(e) {
|
|
|
8837
9151
|
className: "flow-error",
|
|
8838
9152
|
role: "alert",
|
|
8839
9153
|
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: d.error })]
|
|
8840
|
-
}) : m ? /* @__PURE__ */ g(
|
|
9154
|
+
}) : m ? /* @__PURE__ */ g(qf.Provider, {
|
|
8841
9155
|
value: v,
|
|
8842
|
-
children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(
|
|
9156
|
+
children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(yp, {
|
|
8843
9157
|
nodes: m.flow.nodes,
|
|
8844
9158
|
edges: m.flow.edges,
|
|
8845
9159
|
jsonText: t,
|
|
@@ -8861,7 +9175,7 @@ function ap(e) {
|
|
|
8861
9175
|
}
|
|
8862
9176
|
//#endregion
|
|
8863
9177
|
//#region src/components/TreeClipperLogo.tsx
|
|
8864
|
-
function
|
|
9178
|
+
function xp({ className: e }) {
|
|
8865
9179
|
return /* @__PURE__ */ _("svg", {
|
|
8866
9180
|
viewBox: "0 0 256 256",
|
|
8867
9181
|
className: e,
|
|
@@ -8922,7 +9236,7 @@ function op({ className: e }) {
|
|
|
8922
9236
|
}
|
|
8923
9237
|
//#endregion
|
|
8924
9238
|
//#region src/embed.tsx
|
|
8925
|
-
function
|
|
9239
|
+
function Sp(e) {
|
|
8926
9240
|
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
9241
|
!y.current || v.current || (m(!0), C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
8928
9242
|
u(!1), m(!1);
|
|
@@ -8961,7 +9275,7 @@ function sp(e) {
|
|
|
8961
9275
|
className: "gnwr-loading",
|
|
8962
9276
|
role: "status",
|
|
8963
9277
|
"aria-live": "polite",
|
|
8964
|
-
children: [/* @__PURE__ */ g(
|
|
9278
|
+
children: [/* @__PURE__ */ g(xp, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
|
|
8965
9279
|
className: "gnwr-loading__label",
|
|
8966
9280
|
children: "Loading graph…"
|
|
8967
9281
|
})]
|
|
@@ -8970,7 +9284,7 @@ function sp(e) {
|
|
|
8970
9284
|
role: "alert",
|
|
8971
9285
|
children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
|
|
8972
9286
|
}) : /* @__PURE__ */ _(h, { children: [
|
|
8973
|
-
/* @__PURE__ */ g(
|
|
9287
|
+
/* @__PURE__ */ g(bp, {
|
|
8974
9288
|
jsonText: n,
|
|
8975
9289
|
showHeader: !1,
|
|
8976
9290
|
zoomOnScroll: !1,
|
|
@@ -8995,7 +9309,7 @@ function sp(e) {
|
|
|
8995
9309
|
strokeLinecap: "round",
|
|
8996
9310
|
strokeLinejoin: "round"
|
|
8997
9311
|
})
|
|
8998
|
-
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
9312
|
+
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(xp, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: "Copy TreeClipper Magic String" })] })
|
|
8999
9313
|
}),
|
|
9000
9314
|
(l || p) && /* @__PURE__ */ _("div", {
|
|
9001
9315
|
className: `gnwr-copy-toast${p ? " gnwr-leaving" : ""}`,
|
|
@@ -9020,22 +9334,22 @@ function sp(e) {
|
|
|
9020
9334
|
})
|
|
9021
9335
|
});
|
|
9022
9336
|
}
|
|
9023
|
-
var
|
|
9024
|
-
function
|
|
9025
|
-
|
|
9337
|
+
var Cp = /* @__PURE__ */ new Map(), wp = null;
|
|
9338
|
+
function Tp(e, t) {
|
|
9339
|
+
Cp.get(e)?.unmount();
|
|
9026
9340
|
let r = m(e);
|
|
9027
|
-
|
|
9341
|
+
Cp.set(e, r), wp = e;
|
|
9028
9342
|
let i = t.onClose;
|
|
9029
|
-
return r.render(n(
|
|
9343
|
+
return r.render(n(Sp, {
|
|
9030
9344
|
...t,
|
|
9031
9345
|
onClose: i ? () => {
|
|
9032
|
-
|
|
9346
|
+
Ep(e), i();
|
|
9033
9347
|
} : void 0
|
|
9034
|
-
})), () =>
|
|
9348
|
+
})), () => Ep(e);
|
|
9035
9349
|
}
|
|
9036
|
-
function
|
|
9037
|
-
let t = e ??
|
|
9038
|
-
t && (
|
|
9350
|
+
function Ep(e) {
|
|
9351
|
+
let t = e ?? wp;
|
|
9352
|
+
t && (Cp.get(t)?.unmount(), Cp.delete(t), t === wp && (wp = null));
|
|
9039
9353
|
}
|
|
9040
9354
|
//#endregion
|
|
9041
|
-
export {
|
|
9355
|
+
export { Sp as GraphView, Tp as mountGraphView, Ep as unmountGraphView };
|