geonodes-web-render 0.3.29 → 0.3.31
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
CHANGED
|
@@ -8081,54 +8081,63 @@ function Sf(e) {
|
|
|
8081
8081
|
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;
|
|
8082
8082
|
}
|
|
8083
8083
|
}
|
|
8084
|
-
function Cf(e) {
|
|
8085
|
-
|
|
8084
|
+
function Cf(e, t) {
|
|
8085
|
+
if (e.data.label) return e.data.label;
|
|
8086
|
+
if (xf.has(e.data.bl_idname) && e.data.operation) return uf(e.data.operation);
|
|
8087
|
+
if (e.data.node_tree != null) {
|
|
8088
|
+
let n = t.get(String(e.data.node_tree));
|
|
8089
|
+
if (n) return n;
|
|
8090
|
+
}
|
|
8091
|
+
return _f(e.data.name);
|
|
8086
8092
|
}
|
|
8087
|
-
function wf(e, t) {
|
|
8093
|
+
function wf(e, t, n) {
|
|
8088
8094
|
if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
|
|
8089
8095
|
if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
|
|
8090
8096
|
if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
|
|
8097
|
+
let r = /* @__PURE__ */ new Map();
|
|
8098
|
+
for (let t of e.data.nodes.data.items) t?.data?.name && r.set(t.data.name, String(t.id));
|
|
8091
8099
|
return {
|
|
8092
8100
|
id: String(e.id),
|
|
8093
8101
|
label: e.data.name,
|
|
8094
8102
|
nodes: e.data.nodes.data.items.map((e, t) => {
|
|
8095
8103
|
if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
|
|
8096
|
-
let
|
|
8097
|
-
if (e.data.bl_idname === "NodeReroute") return vf(e,
|
|
8098
|
-
let
|
|
8104
|
+
let i = e.data.location_absolute ?? e.data.location ?? [0, 0];
|
|
8105
|
+
if (e.data.bl_idname === "NodeReroute") return vf(e, i);
|
|
8106
|
+
let a = (e.data.outputs?.data?.items ?? []).map((t, n) => {
|
|
8099
8107
|
if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
|
|
8100
8108
|
return bf(t, n);
|
|
8101
8109
|
});
|
|
8102
|
-
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (
|
|
8103
|
-
...
|
|
8110
|
+
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (a[0] &&= {
|
|
8111
|
+
...a[0],
|
|
8104
8112
|
defaultValue: {
|
|
8105
8113
|
kind: "vec",
|
|
8106
8114
|
values: e.data.vector
|
|
8107
8115
|
}
|
|
8108
8116
|
});
|
|
8109
|
-
let
|
|
8117
|
+
let o = (e.data.inputs?.data?.items ?? []).map((t, n) => {
|
|
8110
8118
|
if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
|
|
8111
8119
|
return bf(t, n);
|
|
8112
8120
|
});
|
|
8113
|
-
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (
|
|
8114
|
-
let
|
|
8121
|
+
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (o = gf(o, e.data.mode));
|
|
8122
|
+
let s = e.data.bl_idname === "ShaderNodeFloatCurve" ? mf(e) : void 0, c = e.data.bl_idname === "ShaderNodeValToRGB" ? hf(e) : void 0, l = Sf(e);
|
|
8115
8123
|
return {
|
|
8116
8124
|
id: String(e.id),
|
|
8117
8125
|
type: e.data.bl_idname,
|
|
8118
|
-
label: Cf(e),
|
|
8126
|
+
label: Cf(e, n),
|
|
8119
8127
|
position: {
|
|
8120
|
-
x:
|
|
8121
|
-
y: -
|
|
8128
|
+
x: i[0],
|
|
8129
|
+
y: -i[1]
|
|
8122
8130
|
},
|
|
8123
8131
|
width: e.data.width ?? 140,
|
|
8124
8132
|
headerColor: cf(e.data.bl_idname, e.data.data_type),
|
|
8125
|
-
inputs:
|
|
8126
|
-
outputs:
|
|
8127
|
-
floatCurve:
|
|
8128
|
-
colorRamp:
|
|
8129
|
-
...
|
|
8133
|
+
inputs: o,
|
|
8134
|
+
outputs: a,
|
|
8135
|
+
floatCurve: s,
|
|
8136
|
+
colorRamp: c,
|
|
8137
|
+
...l ? { properties: l } : {},
|
|
8130
8138
|
...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) },
|
|
8131
|
-
...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
|
|
8139
|
+
...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) },
|
|
8140
|
+
...e.data.paired_output && r.has(e.data.paired_output) ? { pairedOutputId: r.get(e.data.paired_output) } : {}
|
|
8132
8141
|
};
|
|
8133
8142
|
}),
|
|
8134
8143
|
links: e.data.links.data.items.map((e, t) => {
|
|
@@ -8144,25 +8153,27 @@ function wf(e, t) {
|
|
|
8144
8153
|
function Tf(e) {
|
|
8145
8154
|
if (!e || typeof e != "object") throw Error("JSON root must be an object.");
|
|
8146
8155
|
if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
|
|
8147
|
-
let t =
|
|
8148
|
-
for (let n
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
+
let t = /* @__PURE__ */ new Map();
|
|
8157
|
+
for (let n of e.node_trees) n?.data?.name && t.set(String(n.id), n.data.name);
|
|
8158
|
+
let n = {};
|
|
8159
|
+
for (let r = 0; r < e.node_trees.length; r++) {
|
|
8160
|
+
let i = wf(e.node_trees[r], r, t);
|
|
8161
|
+
n[i.id] = i;
|
|
8162
|
+
}
|
|
8163
|
+
let r = /* @__PURE__ */ new Set();
|
|
8164
|
+
for (let e of Object.values(n)) for (let t of e.nodes) {
|
|
8165
|
+
if (t.groupTreeId === void 0) continue;
|
|
8166
|
+
let e = n[t.groupTreeId];
|
|
8156
8167
|
if (!e) {
|
|
8157
|
-
delete
|
|
8168
|
+
delete t.groupTreeId;
|
|
8158
8169
|
continue;
|
|
8159
8170
|
}
|
|
8160
|
-
|
|
8171
|
+
t.groupTreeName = e.label, r.add(e.id);
|
|
8161
8172
|
}
|
|
8162
|
-
let
|
|
8173
|
+
let i = e.node_trees.filter((e) => !r.has(String(e.id))), a = i.find((e) => e.data?.is_modifier) ?? i[0] ?? e.node_trees[0];
|
|
8163
8174
|
return {
|
|
8164
|
-
rootId: String(
|
|
8165
|
-
trees:
|
|
8175
|
+
rootId: String(a.id),
|
|
8176
|
+
trees: n
|
|
8166
8177
|
};
|
|
8167
8178
|
}
|
|
8168
8179
|
function Ef(e, t) {
|
|
@@ -8194,7 +8205,8 @@ function Of(e) {
|
|
|
8194
8205
|
properties: e.properties,
|
|
8195
8206
|
groupTreeId: e.groupTreeId,
|
|
8196
8207
|
groupTreeName: e.groupTreeName,
|
|
8197
|
-
parentFrameId: e.parentFrameId
|
|
8208
|
+
parentFrameId: e.parentFrameId,
|
|
8209
|
+
pairedOutputId: e.pairedOutputId
|
|
8198
8210
|
})), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
8199
8211
|
for (let e of t) for (let t of [...e.inputs, ...e.outputs]) n.set(t.id, e.id), r.set(t.id, t);
|
|
8200
8212
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -8284,7 +8296,65 @@ function jf(e) {
|
|
|
8284
8296
|
}
|
|
8285
8297
|
return r;
|
|
8286
8298
|
}
|
|
8287
|
-
|
|
8299
|
+
var Mf = [
|
|
8300
|
+
{
|
|
8301
|
+
input: "GeometryNodeSimulationInput",
|
|
8302
|
+
output: "GeometryNodeSimulationOutput",
|
|
8303
|
+
kind: "simulation"
|
|
8304
|
+
},
|
|
8305
|
+
{
|
|
8306
|
+
input: "GeometryNodeRepeatInput",
|
|
8307
|
+
output: "GeometryNodeRepeatOutput",
|
|
8308
|
+
kind: "repeat"
|
|
8309
|
+
},
|
|
8310
|
+
{
|
|
8311
|
+
input: "GeometryNodeForeachGeometryElementInput",
|
|
8312
|
+
output: "GeometryNodeForeachGeometryElementOutput",
|
|
8313
|
+
kind: "foreach"
|
|
8314
|
+
},
|
|
8315
|
+
{
|
|
8316
|
+
input: "NodeClosureInput",
|
|
8317
|
+
output: "NodeClosureOutput",
|
|
8318
|
+
kind: "closure"
|
|
8319
|
+
}
|
|
8320
|
+
];
|
|
8321
|
+
function Nf(e) {
|
|
8322
|
+
let t = new Map(e.nodes.map((e) => [e.id, e])), n = [];
|
|
8323
|
+
for (let r of Mf) {
|
|
8324
|
+
let i = e.nodes.filter((e) => e.type === r.input), a = e.nodes.filter((e) => e.type === r.output);
|
|
8325
|
+
for (let o of i) {
|
|
8326
|
+
let i = (o.pairedOutputId === void 0 ? void 0 : t.get(o.pairedOutputId)) ?? (a.length === 1 ? a[0] : void 0);
|
|
8327
|
+
if (!i || i.type !== r.output) continue;
|
|
8328
|
+
let s = Ff(o.id, i.id, e);
|
|
8329
|
+
if (s.size === 0) continue;
|
|
8330
|
+
let c = Infinity, l = -Infinity;
|
|
8331
|
+
for (let e of s) {
|
|
8332
|
+
let n = t.get(e);
|
|
8333
|
+
n && (c = Math.min(c, n.position.y), l = Math.max(l, n.position.y + Af(n).h));
|
|
8334
|
+
}
|
|
8335
|
+
let u = o.position.x + o.width / 2, d = i.position.x + i.width / 2, f = Math.min(u, d), p = Math.max(u, d);
|
|
8336
|
+
!Number.isFinite(c) || !Number.isFinite(l) || !Number.isFinite(f) || !Number.isFinite(p) || n.push({
|
|
8337
|
+
id: `zone:${r.kind}:${o.id}`,
|
|
8338
|
+
type: "simulationZone",
|
|
8339
|
+
position: {
|
|
8340
|
+
x: f,
|
|
8341
|
+
y: c - 26
|
|
8342
|
+
},
|
|
8343
|
+
draggable: !1,
|
|
8344
|
+
selectable: !1,
|
|
8345
|
+
connectable: !1,
|
|
8346
|
+
data: { kind: r.kind },
|
|
8347
|
+
style: {
|
|
8348
|
+
width: p - f,
|
|
8349
|
+
height: l - c + 52,
|
|
8350
|
+
zIndex: -10
|
|
8351
|
+
}
|
|
8352
|
+
});
|
|
8353
|
+
}
|
|
8354
|
+
}
|
|
8355
|
+
return n;
|
|
8356
|
+
}
|
|
8357
|
+
function Pf(e, t, n) {
|
|
8288
8358
|
if (e.type === "NodeReroute") {
|
|
8289
8359
|
let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
|
|
8290
8360
|
return {
|
|
@@ -8326,7 +8396,7 @@ function Mf(e, t, n) {
|
|
|
8326
8396
|
}
|
|
8327
8397
|
};
|
|
8328
8398
|
}
|
|
8329
|
-
function
|
|
8399
|
+
function Ff(e, t, n) {
|
|
8330
8400
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
8331
8401
|
for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
|
|
8332
8402
|
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);
|
|
@@ -8350,41 +8420,10 @@ function Nf(e, t, n) {
|
|
|
8350
8420
|
for (let e of a) s.has(e) && l.add(e);
|
|
8351
8421
|
return l;
|
|
8352
8422
|
}
|
|
8353
|
-
function
|
|
8354
|
-
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = new Set(e.edges.map((e) => e.sourceSocketId)), r = jf(e), i = e.nodes.filter((e) => e.type !== "NodeFrame").map((e) =>
|
|
8355
|
-
if (a && o) {
|
|
8356
|
-
let t = Nf(a.id, o.id, e);
|
|
8357
|
-
if (t.size > 0) {
|
|
8358
|
-
let n = new Map(e.nodes.map((e) => [e.id, e])), r = Infinity, c = -Infinity;
|
|
8359
|
-
for (let e of t) {
|
|
8360
|
-
let t = n.get(e);
|
|
8361
|
-
t && (r = Math.min(r, t.position.y), c = Math.max(c, t.position.y + kf(t)));
|
|
8362
|
-
}
|
|
8363
|
-
let l = a.position.x + a.width / 2, u = o.position.x + o.width / 2, d = Math.min(l, u), f = Math.max(l, u);
|
|
8364
|
-
if (Number.isFinite(r) && Number.isFinite(c) && Number.isFinite(d) && Number.isFinite(f)) {
|
|
8365
|
-
let e = d, t = r - 26, n = f - d, o = c - r + 52;
|
|
8366
|
-
s = [{
|
|
8367
|
-
id: `zone:simulation:${a.id}`,
|
|
8368
|
-
type: "simulationZone",
|
|
8369
|
-
position: {
|
|
8370
|
-
x: e,
|
|
8371
|
-
y: t
|
|
8372
|
-
},
|
|
8373
|
-
draggable: !1,
|
|
8374
|
-
selectable: !1,
|
|
8375
|
-
connectable: !1,
|
|
8376
|
-
data: {},
|
|
8377
|
-
style: {
|
|
8378
|
-
width: n,
|
|
8379
|
-
height: o,
|
|
8380
|
-
zIndex: -10
|
|
8381
|
-
}
|
|
8382
|
-
}, ...i];
|
|
8383
|
-
}
|
|
8384
|
-
}
|
|
8385
|
-
}
|
|
8423
|
+
function If(e) {
|
|
8424
|
+
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = new Set(e.edges.map((e) => e.sourceSocketId)), r = jf(e), i = e.nodes.filter((e) => e.type !== "NodeFrame").map((e) => Pf(e, t, n)), a = [...Nf(e), ...i];
|
|
8386
8425
|
return {
|
|
8387
|
-
nodes: [...r, ...
|
|
8426
|
+
nodes: [...r, ...a],
|
|
8388
8427
|
edges: e.edges.map((e) => ({
|
|
8389
8428
|
id: e.id,
|
|
8390
8429
|
source: e.sourceNodeId,
|
|
@@ -8398,10 +8437,10 @@ function Pf(e) {
|
|
|
8398
8437
|
}
|
|
8399
8438
|
//#endregion
|
|
8400
8439
|
//#region src/gn/ir/curvePath.ts
|
|
8401
|
-
function
|
|
8440
|
+
function Lf(e, t) {
|
|
8402
8441
|
return Math.sqrt(e * e + t * t);
|
|
8403
8442
|
}
|
|
8404
|
-
function
|
|
8443
|
+
function Rf(e) {
|
|
8405
8444
|
let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
|
|
8406
8445
|
let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
|
|
8407
8446
|
if (i === "VECTOR") return {
|
|
@@ -8411,11 +8450,11 @@ function If(e) {
|
|
|
8411
8450
|
let c = 0, l = 0, u = 0, d = 0;
|
|
8412
8451
|
if (o && s) {
|
|
8413
8452
|
let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
|
|
8414
|
-
if (u =
|
|
8415
|
-
let n = e / u + i / d, r = t / u + a / d, o =
|
|
8453
|
+
if (u = Lf(e, t), d = Lf(i, a), u > 1e-8 && d > 1e-8) {
|
|
8454
|
+
let n = e / u + i / d, r = t / u + a / d, o = Lf(n, r);
|
|
8416
8455
|
o > 1e-8 && (c = n / o, l = r / o);
|
|
8417
8456
|
} 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);
|
|
8418
|
-
} else s ? (d =
|
|
8457
|
+
} else s ? (d = Lf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = Lf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
|
|
8419
8458
|
let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
|
|
8420
8459
|
if (i === "AUTO_CLAMPED") {
|
|
8421
8460
|
if (o) {
|
|
@@ -8460,7 +8499,7 @@ function If(e) {
|
|
|
8460
8499
|
}
|
|
8461
8500
|
return n;
|
|
8462
8501
|
}
|
|
8463
|
-
function
|
|
8502
|
+
function zf(e, t, n, r, i, a, o) {
|
|
8464
8503
|
let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
|
|
8465
8504
|
if (e.length < 2) return {
|
|
8466
8505
|
strokePath: "",
|
|
@@ -8468,7 +8507,7 @@ function Lf(e, t, n, r, i, a, o) {
|
|
|
8468
8507
|
zeroLinePath: "",
|
|
8469
8508
|
dotPositions: []
|
|
8470
8509
|
};
|
|
8471
|
-
let d =
|
|
8510
|
+
let d = Rf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
|
|
8472
8511
|
for (let t = 0; t < e.length - 1; t++) {
|
|
8473
8512
|
let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
|
|
8474
8513
|
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)}`;
|
|
@@ -8483,7 +8522,7 @@ function Lf(e, t, n, r, i, a, o) {
|
|
|
8483
8522
|
}
|
|
8484
8523
|
//#endregion
|
|
8485
8524
|
//#region src/gn/components/ColorRampViz.tsx
|
|
8486
|
-
function
|
|
8525
|
+
function Bf([e, t, n]) {
|
|
8487
8526
|
let r = Math.max(e, t, n), i = r - Math.min(e, t, n), a = 0;
|
|
8488
8527
|
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));
|
|
8489
8528
|
let o = r === 0 ? 0 : i / r;
|
|
@@ -8493,7 +8532,7 @@ function Rf([e, t, n]) {
|
|
|
8493
8532
|
r
|
|
8494
8533
|
];
|
|
8495
8534
|
}
|
|
8496
|
-
function
|
|
8535
|
+
function Vf([e, t, n]) {
|
|
8497
8536
|
if (t === 0) return [
|
|
8498
8537
|
n,
|
|
8499
8538
|
n,
|
|
@@ -8533,7 +8572,7 @@ function zf([e, t, n]) {
|
|
|
8533
8572
|
];
|
|
8534
8573
|
}
|
|
8535
8574
|
}
|
|
8536
|
-
function
|
|
8575
|
+
function Hf([e, t, n]) {
|
|
8537
8576
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2, o = r - i, s = 0, c = 0;
|
|
8538
8577
|
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)), [
|
|
8539
8578
|
s,
|
|
@@ -8541,7 +8580,7 @@ function Bf([e, t, n]) {
|
|
|
8541
8580
|
a
|
|
8542
8581
|
];
|
|
8543
8582
|
}
|
|
8544
|
-
function
|
|
8583
|
+
function Uf([e, t, n]) {
|
|
8545
8584
|
if (t === 0) return [
|
|
8546
8585
|
n,
|
|
8547
8586
|
n,
|
|
@@ -8554,9 +8593,9 @@ function Vf([e, t, n]) {
|
|
|
8554
8593
|
a(e - 1 / 3)
|
|
8555
8594
|
];
|
|
8556
8595
|
}
|
|
8557
|
-
var
|
|
8558
|
-
function
|
|
8559
|
-
let a =
|
|
8596
|
+
var Wf = (e) => e < 1 ? e : e - 1;
|
|
8597
|
+
function Gf(e, t, n, r, i) {
|
|
8598
|
+
let a = Wf((r % 1 + 1) % 1), o = Wf((i % 1 + 1) % 1), s = 0;
|
|
8560
8599
|
switch (e) {
|
|
8561
8600
|
case "NEAR":
|
|
8562
8601
|
a < o && o - a > .5 ? s = 1 : a > o && o - a < -.5 && (s = 2);
|
|
@@ -8572,9 +8611,9 @@ function Uf(e, t, n, r, i) {
|
|
|
8572
8611
|
break;
|
|
8573
8612
|
}
|
|
8574
8613
|
let c = (e, r) => t * e + n * r;
|
|
8575
|
-
return s === 1 ?
|
|
8614
|
+
return s === 1 ? Wf(c(a + 1, o)) : s === 2 ? Wf(c(a, o + 1)) : c(a, o);
|
|
8576
8615
|
}
|
|
8577
|
-
function
|
|
8616
|
+
function Kf(e, t) {
|
|
8578
8617
|
let n = [...e.stops].sort((e, t) => e.position - t.position);
|
|
8579
8618
|
if (n.length === 0) return [
|
|
8580
8619
|
0,
|
|
@@ -8594,7 +8633,7 @@ function Wf(e, t) {
|
|
|
8594
8633
|
r === "EASE" && (c = 3 * c * c - 2 * c * c * c);
|
|
8595
8634
|
let l = c, u = 1 - c, d = u * a.color[3] + l * o.color[3];
|
|
8596
8635
|
if (e.colorMode === "HSV" || e.colorMode === "HSL") {
|
|
8597
|
-
let t = e.colorMode === "HSV" ?
|
|
8636
|
+
let t = e.colorMode === "HSV" ? Bf : Hf, n = e.colorMode === "HSV" ? Vf : Uf, r = t([
|
|
8598
8637
|
a.color[0],
|
|
8599
8638
|
a.color[1],
|
|
8600
8639
|
a.color[2]
|
|
@@ -8603,7 +8642,7 @@ function Wf(e, t) {
|
|
|
8603
8642
|
o.color[1],
|
|
8604
8643
|
o.color[2]
|
|
8605
8644
|
]), [s, c, f] = n([
|
|
8606
|
-
|
|
8645
|
+
Gf(e.hueInterpolation, l, u, i[0], r[0]),
|
|
8607
8646
|
u * r[1] + l * i[1],
|
|
8608
8647
|
u * r[2] + l * i[2]
|
|
8609
8648
|
]);
|
|
@@ -8621,25 +8660,25 @@ function Wf(e, t) {
|
|
|
8621
8660
|
d
|
|
8622
8661
|
];
|
|
8623
8662
|
}
|
|
8624
|
-
function
|
|
8663
|
+
function qf(e) {
|
|
8625
8664
|
let t = Math.min(1, Math.max(0, e));
|
|
8626
8665
|
return t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
|
|
8627
8666
|
}
|
|
8628
|
-
function
|
|
8629
|
-
let i = (e) => Math.round(
|
|
8667
|
+
function Jf([e, t, n, r]) {
|
|
8668
|
+
let i = (e) => Math.round(qf(e) * 255);
|
|
8630
8669
|
return `rgba(${i(e)}, ${i(t)}, ${i(n)}, ${r.toFixed(3)})`;
|
|
8631
8670
|
}
|
|
8632
|
-
var
|
|
8671
|
+
var Yf = {
|
|
8633
8672
|
NEAR: "Near",
|
|
8634
8673
|
FAR: "Far",
|
|
8635
8674
|
CW: "CW",
|
|
8636
8675
|
CCW: "CCW"
|
|
8637
|
-
},
|
|
8638
|
-
function
|
|
8676
|
+
}, Xf = 64;
|
|
8677
|
+
function Zf({ data: e, width: t }) {
|
|
8639
8678
|
let n = [];
|
|
8640
|
-
for (let t = 0; t <=
|
|
8641
|
-
let r = t /
|
|
8642
|
-
n.push(`${Kf(
|
|
8679
|
+
for (let t = 0; t <= Xf; t++) {
|
|
8680
|
+
let r = t / Xf;
|
|
8681
|
+
n.push(`${Jf(Kf(e, r))} ${(r * 100).toFixed(1)}%`);
|
|
8643
8682
|
}
|
|
8644
8683
|
let r = `linear-gradient(to right, ${n.join(", ")})`, i = [...e.stops].sort((e, t) => e.position - t.position), a = i[i.length - 1];
|
|
8645
8684
|
return /* @__PURE__ */ _("div", {
|
|
@@ -8653,7 +8692,7 @@ function Yf({ data: e, width: t }) {
|
|
|
8653
8692
|
children: e.colorMode
|
|
8654
8693
|
}), /* @__PURE__ */ g("span", {
|
|
8655
8694
|
className: "gn-color-ramp__select",
|
|
8656
|
-
children:
|
|
8695
|
+
children: Yf[e.hueInterpolation] ?? e.hueInterpolation
|
|
8657
8696
|
})]
|
|
8658
8697
|
}),
|
|
8659
8698
|
/* @__PURE__ */ _("div", {
|
|
@@ -8673,7 +8712,7 @@ function Yf({ data: e, width: t }) {
|
|
|
8673
8712
|
children: ["Pos ", a.position.toFixed(3)]
|
|
8674
8713
|
}), /* @__PURE__ */ g("span", {
|
|
8675
8714
|
className: "gn-color-ramp__swatch",
|
|
8676
|
-
style: { background:
|
|
8715
|
+
style: { background: Jf(a.color) }
|
|
8677
8716
|
})]
|
|
8678
8717
|
})
|
|
8679
8718
|
]
|
|
@@ -8681,18 +8720,18 @@ function Yf({ data: e, width: t }) {
|
|
|
8681
8720
|
}
|
|
8682
8721
|
//#endregion
|
|
8683
8722
|
//#region src/gn/components/groupNavContext.ts
|
|
8684
|
-
var
|
|
8685
|
-
function
|
|
8686
|
-
return o(
|
|
8723
|
+
var Qf = t(null);
|
|
8724
|
+
function $f() {
|
|
8725
|
+
return o(Qf);
|
|
8687
8726
|
}
|
|
8688
8727
|
//#endregion
|
|
8689
8728
|
//#region src/gn/components/GenericGNNode.tsx
|
|
8690
|
-
var
|
|
8729
|
+
var ep = [
|
|
8691
8730
|
"X",
|
|
8692
8731
|
"Y",
|
|
8693
8732
|
"Z",
|
|
8694
8733
|
"W"
|
|
8695
|
-
],
|
|
8734
|
+
], tp = {
|
|
8696
8735
|
FLOAT: "Float",
|
|
8697
8736
|
INT: "Integer",
|
|
8698
8737
|
VECTOR: "Vector",
|
|
@@ -8701,10 +8740,10 @@ var Qf = [
|
|
|
8701
8740
|
BOOLEAN: "Boolean",
|
|
8702
8741
|
ROTATION: "Rotation"
|
|
8703
8742
|
};
|
|
8704
|
-
function
|
|
8705
|
-
return e === "data_type" ?
|
|
8743
|
+
function np(e, t) {
|
|
8744
|
+
return e === "data_type" ? tp[t] ?? t : e === "operation" ? uf(t) : e === "use_clamp" ? "Clamp" : t;
|
|
8706
8745
|
}
|
|
8707
|
-
function
|
|
8746
|
+
function rp(e) {
|
|
8708
8747
|
switch (e) {
|
|
8709
8748
|
case "LINE": return "gn-socket--line";
|
|
8710
8749
|
case "DIAMOND": return "gn-socket--diamond";
|
|
@@ -8713,55 +8752,55 @@ function tp(e) {
|
|
|
8713
8752
|
default: return "gn-socket--circle";
|
|
8714
8753
|
}
|
|
8715
8754
|
}
|
|
8716
|
-
function
|
|
8755
|
+
function ip(e) {
|
|
8717
8756
|
return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
|
|
8718
8757
|
}
|
|
8719
|
-
function
|
|
8758
|
+
function ap(e) {
|
|
8720
8759
|
return parseFloat(e.toFixed(3)).toString();
|
|
8721
8760
|
}
|
|
8722
|
-
function
|
|
8723
|
-
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${
|
|
8761
|
+
function op(e, t) {
|
|
8762
|
+
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${ap(e)}${ip(t)}`;
|
|
8724
8763
|
}
|
|
8725
|
-
function
|
|
8764
|
+
function sp(e) {
|
|
8726
8765
|
return Math.round(Math.min(1, Math.max(0, e)) * 255);
|
|
8727
8766
|
}
|
|
8728
|
-
function
|
|
8767
|
+
function cp(e) {
|
|
8729
8768
|
let [t, n, r, i = 1] = e.values;
|
|
8730
8769
|
return /* @__PURE__ */ g("div", {
|
|
8731
8770
|
className: "gn-node__color-swatch",
|
|
8732
|
-
style: { background: `rgba(${
|
|
8771
|
+
style: { background: `rgba(${sp(t)},${sp(n)},${sp(r)},${i.toFixed(2)})` }
|
|
8733
8772
|
});
|
|
8734
8773
|
}
|
|
8735
|
-
function
|
|
8736
|
-
if (e.dataType === "RGBA") return /* @__PURE__ */ g(
|
|
8737
|
-
let t =
|
|
8774
|
+
function lp(e) {
|
|
8775
|
+
if (e.dataType === "RGBA") return /* @__PURE__ */ g(cp, { values: e.values });
|
|
8776
|
+
let t = ip(e.dataType);
|
|
8738
8777
|
return /* @__PURE__ */ g("div", {
|
|
8739
8778
|
className: "gn-node__vec-block",
|
|
8740
8779
|
children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
|
|
8741
8780
|
className: "gn-node__vec-row",
|
|
8742
8781
|
children: [/* @__PURE__ */ g("span", {
|
|
8743
8782
|
className: "gn-node__vec-label",
|
|
8744
|
-
children:
|
|
8783
|
+
children: ep[n]
|
|
8745
8784
|
}), /* @__PURE__ */ _("span", {
|
|
8746
8785
|
className: "gn-node__vec-value",
|
|
8747
|
-
children: [
|
|
8786
|
+
children: [ap(e), t]
|
|
8748
8787
|
})]
|
|
8749
8788
|
}, n))
|
|
8750
8789
|
});
|
|
8751
8790
|
}
|
|
8752
|
-
function
|
|
8791
|
+
function up({ properties: e }) {
|
|
8753
8792
|
let t = Object.entries(e);
|
|
8754
8793
|
return t.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
8755
8794
|
className: "gn-node__props",
|
|
8756
8795
|
children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
|
|
8757
8796
|
className: "gn-node__prop-row",
|
|
8758
|
-
children:
|
|
8797
|
+
children: np(e, t)
|
|
8759
8798
|
}, e))
|
|
8760
8799
|
});
|
|
8761
8800
|
}
|
|
8762
|
-
var
|
|
8763
|
-
function
|
|
8764
|
-
let n = Math.max(10, t -
|
|
8801
|
+
var dp = 120, fp = 6;
|
|
8802
|
+
function pp({ curve: e, width: t }) {
|
|
8803
|
+
let n = Math.max(10, t - fp * 2), r = dp, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = zf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
|
|
8765
8804
|
return /* @__PURE__ */ g("div", {
|
|
8766
8805
|
className: "gn-node__curve-wrap",
|
|
8767
8806
|
children: /* @__PURE__ */ _("svg", {
|
|
@@ -8792,7 +8831,7 @@ function dp({ curve: e, width: t }) {
|
|
|
8792
8831
|
})
|
|
8793
8832
|
});
|
|
8794
8833
|
}
|
|
8795
|
-
function
|
|
8834
|
+
function mp(e) {
|
|
8796
8835
|
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";
|
|
8797
8836
|
return /* @__PURE__ */ _("div", {
|
|
8798
8837
|
className: `gn-node__socket-row gn-node__socket-row--${i}`,
|
|
@@ -8801,7 +8840,7 @@ function fp(e) {
|
|
|
8801
8840
|
id: t.id,
|
|
8802
8841
|
type: r,
|
|
8803
8842
|
position: n,
|
|
8804
|
-
className: `gn-socket ${
|
|
8843
|
+
className: `gn-socket ${rp(t.displayShape)}`,
|
|
8805
8844
|
style: {
|
|
8806
8845
|
top: "50%",
|
|
8807
8846
|
background: t.color,
|
|
@@ -8814,15 +8853,15 @@ function fp(e) {
|
|
|
8814
8853
|
}),
|
|
8815
8854
|
s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
|
|
8816
8855
|
className: "gn-node__value",
|
|
8817
|
-
children:
|
|
8856
|
+
children: op(t.defaultValue.value, t.dataType)
|
|
8818
8857
|
}) : null
|
|
8819
8858
|
]
|
|
8820
8859
|
});
|
|
8821
8860
|
}
|
|
8822
|
-
function
|
|
8861
|
+
function hp(e, t) {
|
|
8823
8862
|
return !t && !e.hideValue && e.defaultValue?.kind === "vec";
|
|
8824
8863
|
}
|
|
8825
|
-
function
|
|
8864
|
+
function gp() {
|
|
8826
8865
|
return /* @__PURE__ */ _("div", {
|
|
8827
8866
|
className: "gn-node__stack",
|
|
8828
8867
|
"aria-hidden": "true",
|
|
@@ -8833,8 +8872,8 @@ function mp() {
|
|
|
8833
8872
|
]
|
|
8834
8873
|
});
|
|
8835
8874
|
}
|
|
8836
|
-
function
|
|
8837
|
-
let t = e.data, n =
|
|
8875
|
+
function _p(e) {
|
|
8876
|
+
let t = e.data, n = $f(), 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;
|
|
8838
8877
|
return /* @__PURE__ */ _("div", {
|
|
8839
8878
|
className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
|
|
8840
8879
|
onClick: s ? () => n.openGroup(o) : void 0,
|
|
@@ -8849,35 +8888,35 @@ function hp(e) {
|
|
|
8849
8888
|
children: t.label
|
|
8850
8889
|
})
|
|
8851
8890
|
}),
|
|
8852
|
-
s && /* @__PURE__ */ g(
|
|
8853
|
-
t.properties && /* @__PURE__ */ g(
|
|
8854
|
-
t.floatCurve && /* @__PURE__ */ g(
|
|
8891
|
+
s && /* @__PURE__ */ g(gp, {}),
|
|
8892
|
+
t.properties && /* @__PURE__ */ g(up, { properties: t.properties }),
|
|
8893
|
+
t.floatCurve && /* @__PURE__ */ g(pp, {
|
|
8855
8894
|
curve: t.floatCurve,
|
|
8856
8895
|
width: t.width
|
|
8857
8896
|
}),
|
|
8858
8897
|
/* @__PURE__ */ _("div", {
|
|
8859
8898
|
className: "gn-node__body",
|
|
8860
8899
|
children: [
|
|
8861
|
-
i.map((e) => /* @__PURE__ */ g(
|
|
8900
|
+
i.map((e) => /* @__PURE__ */ g(mp, {
|
|
8862
8901
|
socket: e,
|
|
8863
8902
|
position: Y.Right,
|
|
8864
8903
|
type: "source",
|
|
8865
8904
|
align: "right",
|
|
8866
8905
|
suppressDefault: !0
|
|
8867
8906
|
}, e.id)),
|
|
8868
|
-
t.colorRamp && /* @__PURE__ */ g(
|
|
8907
|
+
t.colorRamp && /* @__PURE__ */ g(Zf, {
|
|
8869
8908
|
data: t.colorRamp,
|
|
8870
8909
|
width: t.width
|
|
8871
8910
|
}),
|
|
8872
8911
|
a.map((e) => {
|
|
8873
8912
|
let t = r.has(e.id);
|
|
8874
|
-
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(
|
|
8913
|
+
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(mp, {
|
|
8875
8914
|
socket: e,
|
|
8876
8915
|
position: Y.Left,
|
|
8877
8916
|
type: "target",
|
|
8878
8917
|
align: "left",
|
|
8879
8918
|
suppressDefault: t
|
|
8880
|
-
}),
|
|
8919
|
+
}), hp(e, t) ? /* @__PURE__ */ g(lp, {
|
|
8881
8920
|
values: e.defaultValue.values,
|
|
8882
8921
|
dataType: e.dataType
|
|
8883
8922
|
}) : null] }, e.id);
|
|
@@ -8889,7 +8928,7 @@ function hp(e) {
|
|
|
8889
8928
|
}
|
|
8890
8929
|
//#endregion
|
|
8891
8930
|
//#region src/gn/components/RerouteNode.tsx
|
|
8892
|
-
function
|
|
8931
|
+
function vp(e) {
|
|
8893
8932
|
let t = e.data;
|
|
8894
8933
|
return /* @__PURE__ */ _("div", {
|
|
8895
8934
|
className: "gn-reroute",
|
|
@@ -8909,22 +8948,29 @@ function gp(e) {
|
|
|
8909
8948
|
}
|
|
8910
8949
|
//#endregion
|
|
8911
8950
|
//#region src/gn/components/SimulationZoneFrame.tsx
|
|
8912
|
-
|
|
8951
|
+
var yp = {
|
|
8952
|
+
simulation: "102, 65, 98",
|
|
8953
|
+
repeat: "118, 81, 47",
|
|
8954
|
+
foreach: "51, 82, 127",
|
|
8955
|
+
closure: "125, 125, 58"
|
|
8956
|
+
};
|
|
8957
|
+
function bp(e) {
|
|
8958
|
+
let t = yp[e.data.kind ?? "simulation"] ?? yp.simulation;
|
|
8913
8959
|
return /* @__PURE__ */ g("div", {
|
|
8914
8960
|
className: "gn-sim-zone",
|
|
8915
8961
|
style: {
|
|
8916
8962
|
width: "100%",
|
|
8917
8963
|
height: "100%",
|
|
8918
8964
|
borderRadius: 10,
|
|
8919
|
-
border:
|
|
8920
|
-
background:
|
|
8965
|
+
border: `1.5px solid rgba(${t}, 0.85)`,
|
|
8966
|
+
background: `rgba(${t}, 0.2)`,
|
|
8921
8967
|
pointerEvents: "none"
|
|
8922
8968
|
}
|
|
8923
8969
|
});
|
|
8924
8970
|
}
|
|
8925
8971
|
//#endregion
|
|
8926
8972
|
//#region src/gn/components/NodeFrame.tsx
|
|
8927
|
-
function
|
|
8973
|
+
function xp(e) {
|
|
8928
8974
|
let t = e.data;
|
|
8929
8975
|
return /* @__PURE__ */ g("div", {
|
|
8930
8976
|
className: "gn-node-frame",
|
|
@@ -8954,13 +9000,13 @@ function vp(e) {
|
|
|
8954
9000
|
}
|
|
8955
9001
|
//#endregion
|
|
8956
9002
|
//#region src/gn/components/GeometryNodesFlow.tsx
|
|
8957
|
-
var
|
|
8958
|
-
gnNode:
|
|
8959
|
-
rerouteNode:
|
|
8960
|
-
simulationZone:
|
|
8961
|
-
nodeFrame:
|
|
8962
|
-
},
|
|
8963
|
-
function
|
|
9003
|
+
var Sp = {
|
|
9004
|
+
gnNode: _p,
|
|
9005
|
+
rerouteNode: vp,
|
|
9006
|
+
simulationZone: bp,
|
|
9007
|
+
nodeFrame: xp
|
|
9008
|
+
}, Cp = { padding: .08 };
|
|
9009
|
+
function wp(e) {
|
|
8964
9010
|
let { nodes: t, edges: n, jsonText: r, breadcrumbs: i, onNavigate: o, onSelectionIds: s, onCopiedMagicString: l, interaction: u = "always", allowCopy: p = !0, allowSelection: m = !0 } = e, { fitView: h, getNodes: v, getNodesBounds: y } = ml(), b = bd(), x = d(null), S = d(!1), C = d([]), [w, D] = f(null), [O, k] = f(!1), [A, j] = f(!1), M = d(null), [N, P] = f("mouse"), F = d(-Infinity), [I, L] = f(!1), [R, z] = f(!1), B = d([]), [V, H, U] = _d(t), [W, G, ee] = vd(n), [te, ne] = f(void 0);
|
|
8965
9011
|
c(() => {
|
|
8966
9012
|
if (!b) return;
|
|
@@ -8972,7 +9018,7 @@ function xp(e) {
|
|
|
8972
9018
|
v,
|
|
8973
9019
|
y
|
|
8974
9020
|
]), c(() => {
|
|
8975
|
-
H(t), s?.([]), S.current = !1, h(
|
|
9021
|
+
H(t), s?.([]), S.current = !1, h(Cp);
|
|
8976
9022
|
}, [
|
|
8977
9023
|
t,
|
|
8978
9024
|
H,
|
|
@@ -8984,7 +9030,7 @@ function xp(e) {
|
|
|
8984
9030
|
let e = x.current;
|
|
8985
9031
|
if (!e) return;
|
|
8986
9032
|
let t = new ResizeObserver(() => {
|
|
8987
|
-
S.current || h(
|
|
9033
|
+
S.current || h(Cp);
|
|
8988
9034
|
});
|
|
8989
9035
|
return t.observe(e), () => t.disconnect();
|
|
8990
9036
|
}, [h]);
|
|
@@ -9066,9 +9112,9 @@ function xp(e) {
|
|
|
9066
9112
|
onEdgesChange: ee,
|
|
9067
9113
|
onSelectionChange: ie,
|
|
9068
9114
|
onMoveStart: re,
|
|
9069
|
-
nodeTypes:
|
|
9115
|
+
nodeTypes: Sp,
|
|
9070
9116
|
fitView: !0,
|
|
9071
|
-
fitViewOptions:
|
|
9117
|
+
fitViewOptions: Cp,
|
|
9072
9118
|
minZoom: .2,
|
|
9073
9119
|
translateExtent: te,
|
|
9074
9120
|
nodesDraggable: !1,
|
|
@@ -9106,7 +9152,7 @@ function xp(e) {
|
|
|
9106
9152
|
className: "gn-top-left",
|
|
9107
9153
|
children: [/* @__PURE__ */ _("span", {
|
|
9108
9154
|
className: "gn-version-badge",
|
|
9109
|
-
children: ["node-web-render v", "0.3.
|
|
9155
|
+
children: ["node-web-render v", "0.3.31"]
|
|
9110
9156
|
}), i.length > 1 ? /* @__PURE__ */ g("nav", {
|
|
9111
9157
|
className: "gn-breadcrumbs",
|
|
9112
9158
|
"aria-label": "Node group path",
|
|
@@ -9159,7 +9205,7 @@ function xp(e) {
|
|
|
9159
9205
|
]
|
|
9160
9206
|
});
|
|
9161
9207
|
}
|
|
9162
|
-
function
|
|
9208
|
+
function Tp(e) {
|
|
9163
9209
|
let { jsonText: t, showHeader: n = !0, onSelectionChange: r, onCopiedMagicString: i, interaction: o = "always", allowCopy: s = !0, allowSelection: l = !0 } = e, [d, p] = f({
|
|
9164
9210
|
json: t,
|
|
9165
9211
|
ids: []
|
|
@@ -9171,7 +9217,7 @@ function Sp(e) {
|
|
|
9171
9217
|
let t = Of(e);
|
|
9172
9218
|
r[t.id] = {
|
|
9173
9219
|
graph: t,
|
|
9174
|
-
flow:
|
|
9220
|
+
flow: If(t)
|
|
9175
9221
|
};
|
|
9176
9222
|
}
|
|
9177
9223
|
return {
|
|
@@ -9235,9 +9281,9 @@ function Sp(e) {
|
|
|
9235
9281
|
className: "flow-error",
|
|
9236
9282
|
role: "alert",
|
|
9237
9283
|
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: m.error })]
|
|
9238
|
-
}) : v ? /* @__PURE__ */ g(
|
|
9284
|
+
}) : v ? /* @__PURE__ */ g(Qf.Provider, {
|
|
9239
9285
|
value: b,
|
|
9240
|
-
children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(
|
|
9286
|
+
children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(wp, {
|
|
9241
9287
|
nodes: v.flow.nodes,
|
|
9242
9288
|
edges: v.flow.edges,
|
|
9243
9289
|
jsonText: t,
|
|
@@ -9261,7 +9307,7 @@ function Sp(e) {
|
|
|
9261
9307
|
}
|
|
9262
9308
|
//#endregion
|
|
9263
9309
|
//#region src/components/TreeClipperLogo.tsx
|
|
9264
|
-
function
|
|
9310
|
+
function Ep({ className: e }) {
|
|
9265
9311
|
return /* @__PURE__ */ _("svg", {
|
|
9266
9312
|
viewBox: "0 0 256 256",
|
|
9267
9313
|
className: e,
|
|
@@ -9322,7 +9368,7 @@ function Cp({ className: e }) {
|
|
|
9322
9368
|
}
|
|
9323
9369
|
//#endregion
|
|
9324
9370
|
//#region src/embed.tsx
|
|
9325
|
-
function
|
|
9371
|
+
function Dp(e) {
|
|
9326
9372
|
let { payload: t, showCopyButton: n = !0, allowSelection: r = !0 } = e, [i, a] = f(""), [o, s] = f(null), [l, u] = f(!0), [p, m] = f([]), [v, y] = f(!1), [b, S] = f(!1), C = d(!1), w = d(!1), D = d(null), O = d(null), k = d(null), A = () => {
|
|
9327
9373
|
!w.current || C.current || (S(!0), k.current && clearTimeout(k.current), k.current = setTimeout(() => {
|
|
9328
9374
|
y(!1), S(!1);
|
|
@@ -9366,7 +9412,7 @@ function wp(e) {
|
|
|
9366
9412
|
className: "gnwr-loading",
|
|
9367
9413
|
role: "status",
|
|
9368
9414
|
"aria-live": "polite",
|
|
9369
|
-
children: [/* @__PURE__ */ g(
|
|
9415
|
+
children: [/* @__PURE__ */ g(Ep, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
|
|
9370
9416
|
className: "gnwr-loading__label",
|
|
9371
9417
|
children: "Loading graph…"
|
|
9372
9418
|
})]
|
|
@@ -9374,7 +9420,7 @@ function wp(e) {
|
|
|
9374
9420
|
className: "flow-error",
|
|
9375
9421
|
role: "alert",
|
|
9376
9422
|
children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: o })]
|
|
9377
|
-
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
9423
|
+
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Tp, {
|
|
9378
9424
|
jsonText: i,
|
|
9379
9425
|
showHeader: !1,
|
|
9380
9426
|
interaction: "hybrid",
|
|
@@ -9401,7 +9447,7 @@ function wp(e) {
|
|
|
9401
9447
|
strokeLinecap: "round",
|
|
9402
9448
|
strokeLinejoin: "round"
|
|
9403
9449
|
})
|
|
9404
|
-
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
9450
|
+
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Ep, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: p.length > 0 ? `Copy Magic String of ${p.length} selected node${p.length === 1 ? "" : "s"}` : "Copy TreeClipper Magic String" })] })
|
|
9405
9451
|
}), (v || b) && /* @__PURE__ */ _("div", {
|
|
9406
9452
|
className: `gnwr-copy-toast${b ? " gnwr-leaving" : ""}`,
|
|
9407
9453
|
role: "status",
|
|
@@ -9424,22 +9470,22 @@ function wp(e) {
|
|
|
9424
9470
|
})
|
|
9425
9471
|
});
|
|
9426
9472
|
}
|
|
9427
|
-
var
|
|
9428
|
-
function
|
|
9429
|
-
|
|
9473
|
+
var Op = /* @__PURE__ */ new Map(), kp = null;
|
|
9474
|
+
function Ap(e, t) {
|
|
9475
|
+
Op.get(e)?.unmount();
|
|
9430
9476
|
let r = m(e);
|
|
9431
|
-
|
|
9477
|
+
Op.set(e, r), kp = e;
|
|
9432
9478
|
let i = t.onClose;
|
|
9433
|
-
return r.render(n(
|
|
9479
|
+
return r.render(n(Dp, {
|
|
9434
9480
|
...t,
|
|
9435
9481
|
onClose: i ? () => {
|
|
9436
|
-
|
|
9482
|
+
jp(e), i();
|
|
9437
9483
|
} : void 0
|
|
9438
|
-
})), () =>
|
|
9484
|
+
})), () => jp(e);
|
|
9439
9485
|
}
|
|
9440
|
-
function
|
|
9441
|
-
let t = e ??
|
|
9442
|
-
t && (
|
|
9486
|
+
function jp(e) {
|
|
9487
|
+
let t = e ?? kp;
|
|
9488
|
+
t && (Op.get(t)?.unmount(), Op.delete(t), t === kp && (kp = null));
|
|
9443
9489
|
}
|
|
9444
9490
|
//#endregion
|
|
9445
|
-
export {
|
|
9491
|
+
export { Dp as GraphView, Ap as mountGraphView, jp as unmountGraphView };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { NodeProps } from '@xyflow/react';
|
|
2
|
+
export declare function SimulationZoneFrame(props: NodeProps): import("react").JSX.Element;
|
|
@@ -35,6 +35,7 @@ type BlenderNode = {
|
|
|
35
35
|
single_output?: number;
|
|
36
36
|
vector?: number[];
|
|
37
37
|
node_tree?: number | null;
|
|
38
|
+
paired_output?: string;
|
|
38
39
|
mode?: string;
|
|
39
40
|
operation?: string;
|
|
40
41
|
data_type?: string;
|
|
@@ -145,6 +146,8 @@ export type NormalizedNode = {
|
|
|
145
146
|
groupTreeName?: string;
|
|
146
147
|
/** Id of the NodeFrame this node is parented to (Blender "parent"), if any. */
|
|
147
148
|
parentFrameId?: string;
|
|
149
|
+
/** For zone input nodes (Simulation/Repeat/…): id of the paired output node. */
|
|
150
|
+
pairedOutputId?: string;
|
|
148
151
|
};
|
|
149
152
|
export type NormalizedLink = {
|
|
150
153
|
id: string;
|
|
@@ -67,6 +67,8 @@ export type NodeIR = {
|
|
|
67
67
|
groupTreeName?: string;
|
|
68
68
|
/** Id of the NodeFrame this node is parented to (Blender "parent"), if any. */
|
|
69
69
|
parentFrameId?: string;
|
|
70
|
+
/** For zone input nodes (Simulation/Repeat/…): id of the paired output node. */
|
|
71
|
+
pairedOutputId?: string;
|
|
70
72
|
};
|
|
71
73
|
export type EdgeIR = {
|
|
72
74
|
id: string;
|
|
@@ -19,8 +19,9 @@ export type GNRerouteNodeData = {
|
|
|
19
19
|
inputSocketId: string;
|
|
20
20
|
outputSocketId: string;
|
|
21
21
|
};
|
|
22
|
+
export type ZoneKind = 'simulation' | 'repeat' | 'foreach' | 'closure';
|
|
22
23
|
export type SimulationZoneNodeData = {
|
|
23
|
-
|
|
24
|
+
kind: ZoneKind;
|
|
24
25
|
};
|
|
25
26
|
export type NodeFrameData = {
|
|
26
27
|
label: string;
|
package/package.json
CHANGED