geonodes-web-render 0.3.30 → 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 +45 -37
- package/package.json +1 -1
package/dist/embed.js
CHANGED
|
@@ -8081,57 +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.`);
|
|
8091
|
-
let
|
|
8092
|
-
for (let t of e.data.nodes.data.items) t?.data?.name &&
|
|
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));
|
|
8093
8099
|
return {
|
|
8094
8100
|
id: String(e.id),
|
|
8095
8101
|
label: e.data.name,
|
|
8096
8102
|
nodes: e.data.nodes.data.items.map((e, t) => {
|
|
8097
8103
|
if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
|
|
8098
|
-
let
|
|
8099
|
-
if (e.data.bl_idname === "NodeReroute") return vf(e,
|
|
8100
|
-
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) => {
|
|
8101
8107
|
if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
|
|
8102
8108
|
return bf(t, n);
|
|
8103
8109
|
});
|
|
8104
|
-
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (
|
|
8105
|
-
...
|
|
8110
|
+
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (a[0] &&= {
|
|
8111
|
+
...a[0],
|
|
8106
8112
|
defaultValue: {
|
|
8107
8113
|
kind: "vec",
|
|
8108
8114
|
values: e.data.vector
|
|
8109
8115
|
}
|
|
8110
8116
|
});
|
|
8111
|
-
let
|
|
8117
|
+
let o = (e.data.inputs?.data?.items ?? []).map((t, n) => {
|
|
8112
8118
|
if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
|
|
8113
8119
|
return bf(t, n);
|
|
8114
8120
|
});
|
|
8115
|
-
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (
|
|
8116
|
-
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);
|
|
8117
8123
|
return {
|
|
8118
8124
|
id: String(e.id),
|
|
8119
8125
|
type: e.data.bl_idname,
|
|
8120
|
-
label: Cf(e),
|
|
8126
|
+
label: Cf(e, n),
|
|
8121
8127
|
position: {
|
|
8122
|
-
x:
|
|
8123
|
-
y: -
|
|
8128
|
+
x: i[0],
|
|
8129
|
+
y: -i[1]
|
|
8124
8130
|
},
|
|
8125
8131
|
width: e.data.width ?? 140,
|
|
8126
8132
|
headerColor: cf(e.data.bl_idname, e.data.data_type),
|
|
8127
|
-
inputs:
|
|
8128
|
-
outputs:
|
|
8129
|
-
floatCurve:
|
|
8130
|
-
colorRamp:
|
|
8131
|
-
...
|
|
8133
|
+
inputs: o,
|
|
8134
|
+
outputs: a,
|
|
8135
|
+
floatCurve: s,
|
|
8136
|
+
colorRamp: c,
|
|
8137
|
+
...l ? { properties: l } : {},
|
|
8132
8138
|
...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) },
|
|
8133
8139
|
...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) },
|
|
8134
|
-
...e.data.paired_output &&
|
|
8140
|
+
...e.data.paired_output && r.has(e.data.paired_output) ? { pairedOutputId: r.get(e.data.paired_output) } : {}
|
|
8135
8141
|
};
|
|
8136
8142
|
}),
|
|
8137
8143
|
links: e.data.links.data.items.map((e, t) => {
|
|
@@ -8147,25 +8153,27 @@ function wf(e, t) {
|
|
|
8147
8153
|
function Tf(e) {
|
|
8148
8154
|
if (!e || typeof e != "object") throw Error("JSON root must be an object.");
|
|
8149
8155
|
if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
|
|
8150
|
-
let t =
|
|
8151
|
-
for (let n
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
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];
|
|
8159
8167
|
if (!e) {
|
|
8160
|
-
delete
|
|
8168
|
+
delete t.groupTreeId;
|
|
8161
8169
|
continue;
|
|
8162
8170
|
}
|
|
8163
|
-
|
|
8171
|
+
t.groupTreeName = e.label, r.add(e.id);
|
|
8164
8172
|
}
|
|
8165
|
-
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];
|
|
8166
8174
|
return {
|
|
8167
|
-
rootId: String(
|
|
8168
|
-
trees:
|
|
8175
|
+
rootId: String(a.id),
|
|
8176
|
+
trees: n
|
|
8169
8177
|
};
|
|
8170
8178
|
}
|
|
8171
8179
|
function Ef(e, t) {
|
|
@@ -9144,7 +9152,7 @@ function wp(e) {
|
|
|
9144
9152
|
className: "gn-top-left",
|
|
9145
9153
|
children: [/* @__PURE__ */ _("span", {
|
|
9146
9154
|
className: "gn-version-badge",
|
|
9147
|
-
children: ["node-web-render v", "0.3.
|
|
9155
|
+
children: ["node-web-render v", "0.3.31"]
|
|
9148
9156
|
}), i.length > 1 ? /* @__PURE__ */ g("nav", {
|
|
9149
9157
|
className: "gn-breadcrumbs",
|
|
9150
9158
|
"aria-label": "Node group path",
|
package/package.json
CHANGED