geonodes-web-render 0.3.28 → 0.3.29
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 +233 -191
- package/dist/types/gn/ir/operationLabels.d.ts +7 -0
- package/package.json +1 -1
package/dist/embed.js
CHANGED
|
@@ -7847,8 +7847,85 @@ function cf(e, t) {
|
|
|
7847
7847
|
return nf[sf(e, t) ?? of[e] ?? af(e)] ?? nf.DEFAULT;
|
|
7848
7848
|
}
|
|
7849
7849
|
//#endregion
|
|
7850
|
-
//#region src/gn/
|
|
7850
|
+
//#region src/gn/ir/operationLabels.ts
|
|
7851
7851
|
var lf = {
|
|
7852
|
+
EQUAL: "Equal",
|
|
7853
|
+
NOT_EQUAL: "Not Equal",
|
|
7854
|
+
LESS_THAN: "Less Than",
|
|
7855
|
+
LESS_EQUAL: "Less Than or Equal",
|
|
7856
|
+
GREATER_THAN: "Greater Than",
|
|
7857
|
+
GREATER_EQUAL: "Greater Than or Equal",
|
|
7858
|
+
ADD: "Add",
|
|
7859
|
+
SUBTRACT: "Subtract",
|
|
7860
|
+
MULTIPLY: "Multiply",
|
|
7861
|
+
DIVIDE: "Divide",
|
|
7862
|
+
MULTIPLY_ADD: "Multiply Add",
|
|
7863
|
+
POWER: "Power",
|
|
7864
|
+
LOGARITHM: "Logarithm",
|
|
7865
|
+
SQRT: "Square Root",
|
|
7866
|
+
INVERSE_SQRT: "Inverse Square Root",
|
|
7867
|
+
ABSOLUTE: "Absolute",
|
|
7868
|
+
EXPONENT: "Exponent",
|
|
7869
|
+
MINIMUM: "Minimum",
|
|
7870
|
+
MAXIMUM: "Maximum",
|
|
7871
|
+
SIGN: "Sign",
|
|
7872
|
+
COMPARE: "Compare",
|
|
7873
|
+
SMOOTH_MIN: "Smooth Minimum",
|
|
7874
|
+
SMOOTH_MAX: "Smooth Maximum",
|
|
7875
|
+
ROUND: "Round",
|
|
7876
|
+
FLOOR: "Floor",
|
|
7877
|
+
CEIL: "Ceiling",
|
|
7878
|
+
TRUNCATE: "Truncate",
|
|
7879
|
+
FRACTION: "Fraction",
|
|
7880
|
+
MODULO: "Modulo",
|
|
7881
|
+
WRAP: "Wrap",
|
|
7882
|
+
SNAP: "Snap",
|
|
7883
|
+
PINGPONG: "Ping-Pong",
|
|
7884
|
+
SINE: "Sine",
|
|
7885
|
+
COSINE: "Cosine",
|
|
7886
|
+
TANGENT: "Tangent",
|
|
7887
|
+
ARCSINE: "Arcsine",
|
|
7888
|
+
ARCCOSINE: "Arccosine",
|
|
7889
|
+
ARCTANGENT: "Arctangent",
|
|
7890
|
+
ARCTAN2: "Arctan2",
|
|
7891
|
+
SINH: "Hyperbolic Sine",
|
|
7892
|
+
COSH: "Hyperbolic Cosine",
|
|
7893
|
+
TANH: "Hyperbolic Tangent",
|
|
7894
|
+
RADIANS: "To Radians",
|
|
7895
|
+
DEGREES: "To Degrees",
|
|
7896
|
+
NEGATE: "Negate",
|
|
7897
|
+
DIVIDE_ROUND: "Divide Round",
|
|
7898
|
+
DIVIDE_FLOOR: "Divide Floor",
|
|
7899
|
+
DIVIDE_CEIL: "Divide Ceiling",
|
|
7900
|
+
FLOORED_MODULO: "Floored Modulo",
|
|
7901
|
+
GCD: "Greatest Common Divisor",
|
|
7902
|
+
LCM: "Least Common Multiple",
|
|
7903
|
+
CROSS_PRODUCT: "Cross Product",
|
|
7904
|
+
DOT_PRODUCT: "Dot Product",
|
|
7905
|
+
PROJECT: "Project",
|
|
7906
|
+
REFLECT: "Reflect",
|
|
7907
|
+
REFRACT: "Refract",
|
|
7908
|
+
FACEFORWARD: "Faceforward",
|
|
7909
|
+
DISTANCE: "Distance",
|
|
7910
|
+
LENGTH: "Length",
|
|
7911
|
+
SCALE: "Scale",
|
|
7912
|
+
NORMALIZE: "Normalize",
|
|
7913
|
+
AND: "And",
|
|
7914
|
+
OR: "Or",
|
|
7915
|
+
NOT: "Not",
|
|
7916
|
+
NAND: "Not And",
|
|
7917
|
+
NOR: "Nor",
|
|
7918
|
+
XNOR: "Equal",
|
|
7919
|
+
XOR: "Not Equal",
|
|
7920
|
+
IMPLY: "Imply",
|
|
7921
|
+
NIMPLY: "Subtract"
|
|
7922
|
+
};
|
|
7923
|
+
function uf(e) {
|
|
7924
|
+
return lf[e] ?? e;
|
|
7925
|
+
}
|
|
7926
|
+
//#endregion
|
|
7927
|
+
//#region src/gn/importer/blenderTree.ts
|
|
7928
|
+
var df = {
|
|
7852
7929
|
NodeSocketGeometry: "GEOMETRY",
|
|
7853
7930
|
NodeSocketFloat: "FLOAT",
|
|
7854
7931
|
NodeSocketVector: "VECTOR",
|
|
@@ -7865,10 +7942,10 @@ var lf = {
|
|
|
7865
7942
|
NodeSocketMatrix: "MATRIX",
|
|
7866
7943
|
NodeSocketMenu: "MENU"
|
|
7867
7944
|
};
|
|
7868
|
-
function
|
|
7869
|
-
return
|
|
7945
|
+
function ff(e) {
|
|
7946
|
+
return df[e] ?? "CUSTOM";
|
|
7870
7947
|
}
|
|
7871
|
-
var
|
|
7948
|
+
var pf = {
|
|
7872
7949
|
HSV: [
|
|
7873
7950
|
"Hue",
|
|
7874
7951
|
"Saturation",
|
|
@@ -7885,7 +7962,7 @@ var df = {
|
|
|
7885
7962
|
"Blue"
|
|
7886
7963
|
]
|
|
7887
7964
|
};
|
|
7888
|
-
function
|
|
7965
|
+
function mf(e) {
|
|
7889
7966
|
let t = e.data.mapping?.data;
|
|
7890
7967
|
if (!t) return;
|
|
7891
7968
|
let n = t.curves?.data?.items;
|
|
@@ -7903,7 +7980,7 @@ function ff(e) {
|
|
|
7903
7980
|
points: r
|
|
7904
7981
|
};
|
|
7905
7982
|
}
|
|
7906
|
-
function
|
|
7983
|
+
function hf(e) {
|
|
7907
7984
|
let t = e.data.color_ramp?.data;
|
|
7908
7985
|
if (!t) return;
|
|
7909
7986
|
let n = (t.elements?.data?.items ?? []).map((e) => {
|
|
@@ -7925,8 +8002,8 @@ function pf(e) {
|
|
|
7925
8002
|
stops: n
|
|
7926
8003
|
};
|
|
7927
8004
|
}
|
|
7928
|
-
function
|
|
7929
|
-
let n =
|
|
8005
|
+
function gf(e, t) {
|
|
8006
|
+
let n = pf[t ?? "RGB"] ?? pf.RGB, r = pf.RGB;
|
|
7930
8007
|
return e.map((e) => {
|
|
7931
8008
|
let t = r.indexOf(e.name);
|
|
7932
8009
|
return t === -1 ? e : {
|
|
@@ -7935,11 +8012,11 @@ function mf(e, t) {
|
|
|
7935
8012
|
};
|
|
7936
8013
|
});
|
|
7937
8014
|
}
|
|
7938
|
-
function
|
|
8015
|
+
function _f(e) {
|
|
7939
8016
|
return e.replace(/\.\d{3}$/, "");
|
|
7940
8017
|
}
|
|
7941
|
-
function
|
|
7942
|
-
let n =
|
|
8018
|
+
function vf(e, t) {
|
|
8019
|
+
let n = ff(e.data.socket_idname ?? ""), r = tf(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
|
|
7943
8020
|
id: e,
|
|
7944
8021
|
name: "",
|
|
7945
8022
|
dataType: n,
|
|
@@ -7965,7 +8042,7 @@ function gf(e, t) {
|
|
|
7965
8042
|
...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
|
|
7966
8043
|
};
|
|
7967
8044
|
}
|
|
7968
|
-
function
|
|
8045
|
+
function yf(e) {
|
|
7969
8046
|
return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
|
|
7970
8047
|
kind: "vec",
|
|
7971
8048
|
values: e
|
|
@@ -7974,30 +8051,40 @@ function _f(e) {
|
|
|
7974
8051
|
value: e
|
|
7975
8052
|
} : null;
|
|
7976
8053
|
}
|
|
7977
|
-
function
|
|
8054
|
+
function bf(e, t) {
|
|
7978
8055
|
return {
|
|
7979
8056
|
id: String(e.id),
|
|
7980
8057
|
name: e.data.name,
|
|
7981
8058
|
dataType: e.data.type,
|
|
7982
8059
|
displayShape: e.data.display_shape,
|
|
7983
8060
|
color: tf(e.data.type),
|
|
7984
|
-
defaultValue:
|
|
8061
|
+
defaultValue: yf(e.data.default_value),
|
|
7985
8062
|
hideValue: e.data.hide_value ?? !1,
|
|
7986
8063
|
enabled: e.data.enabled ?? !0,
|
|
7987
8064
|
index: t
|
|
7988
8065
|
};
|
|
7989
8066
|
}
|
|
7990
|
-
|
|
8067
|
+
var xf = new Set([
|
|
8068
|
+
"ShaderNodeMath",
|
|
8069
|
+
"ShaderNodeVectorMath",
|
|
8070
|
+
"FunctionNodeIntegerMath",
|
|
8071
|
+
"FunctionNodeBooleanMath",
|
|
8072
|
+
"FunctionNodeCompare"
|
|
8073
|
+
]);
|
|
8074
|
+
function Sf(e) {
|
|
7991
8075
|
if (e.data.bl_idname === "FunctionNodeCompare") {
|
|
7992
8076
|
let t = {};
|
|
7993
8077
|
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;
|
|
7994
8078
|
}
|
|
7995
|
-
if (e.data.bl_idname
|
|
8079
|
+
if (xf.has(e.data.bl_idname)) {
|
|
7996
8080
|
let t = {};
|
|
7997
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;
|
|
7998
8082
|
}
|
|
7999
8083
|
}
|
|
8000
|
-
function
|
|
8084
|
+
function Cf(e) {
|
|
8085
|
+
return e.data.label ? e.data.label : xf.has(e.data.bl_idname) && e.data.operation ? uf(e.data.operation) : _f(e.data.name);
|
|
8086
|
+
}
|
|
8087
|
+
function wf(e, t) {
|
|
8001
8088
|
if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
|
|
8002
8089
|
if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
|
|
8003
8090
|
if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
|
|
@@ -8007,10 +8094,10 @@ function bf(e, t) {
|
|
|
8007
8094
|
nodes: e.data.nodes.data.items.map((e, t) => {
|
|
8008
8095
|
if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
|
|
8009
8096
|
let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
|
|
8010
|
-
if (e.data.bl_idname === "NodeReroute") return
|
|
8097
|
+
if (e.data.bl_idname === "NodeReroute") return vf(e, n);
|
|
8011
8098
|
let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
|
|
8012
8099
|
if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
|
|
8013
|
-
return
|
|
8100
|
+
return bf(t, n);
|
|
8014
8101
|
});
|
|
8015
8102
|
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
|
|
8016
8103
|
...r[0],
|
|
@@ -8021,14 +8108,14 @@ function bf(e, t) {
|
|
|
8021
8108
|
});
|
|
8022
8109
|
let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
|
|
8023
8110
|
if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
|
|
8024
|
-
return
|
|
8111
|
+
return bf(t, n);
|
|
8025
8112
|
});
|
|
8026
|
-
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i =
|
|
8027
|
-
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ?
|
|
8113
|
+
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = gf(i, e.data.mode));
|
|
8114
|
+
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? mf(e) : void 0, o = e.data.bl_idname === "ShaderNodeValToRGB" ? hf(e) : void 0, s = Sf(e);
|
|
8028
8115
|
return {
|
|
8029
8116
|
id: String(e.id),
|
|
8030
8117
|
type: e.data.bl_idname,
|
|
8031
|
-
label:
|
|
8118
|
+
label: Cf(e),
|
|
8032
8119
|
position: {
|
|
8033
8120
|
x: n[0],
|
|
8034
8121
|
y: -n[1]
|
|
@@ -8054,12 +8141,12 @@ function bf(e, t) {
|
|
|
8054
8141
|
})
|
|
8055
8142
|
};
|
|
8056
8143
|
}
|
|
8057
|
-
function
|
|
8144
|
+
function Tf(e) {
|
|
8058
8145
|
if (!e || typeof e != "object") throw Error("JSON root must be an object.");
|
|
8059
8146
|
if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
|
|
8060
8147
|
let t = {};
|
|
8061
8148
|
for (let n = 0; n < e.node_trees.length; n++) {
|
|
8062
|
-
let r =
|
|
8149
|
+
let r = wf(e.node_trees[n], n);
|
|
8063
8150
|
t[r.id] = r;
|
|
8064
8151
|
}
|
|
8065
8152
|
let n = /* @__PURE__ */ new Set();
|
|
@@ -8078,21 +8165,21 @@ function xf(e) {
|
|
|
8078
8165
|
trees: t
|
|
8079
8166
|
};
|
|
8080
8167
|
}
|
|
8081
|
-
function
|
|
8168
|
+
function Ef(e, t) {
|
|
8082
8169
|
return {
|
|
8083
8170
|
...t,
|
|
8084
8171
|
nodeId: e,
|
|
8085
8172
|
direction: "input"
|
|
8086
8173
|
};
|
|
8087
8174
|
}
|
|
8088
|
-
function
|
|
8175
|
+
function Df(e, t) {
|
|
8089
8176
|
return {
|
|
8090
8177
|
...t,
|
|
8091
8178
|
nodeId: e,
|
|
8092
8179
|
direction: "output"
|
|
8093
8180
|
};
|
|
8094
8181
|
}
|
|
8095
|
-
function
|
|
8182
|
+
function Of(e) {
|
|
8096
8183
|
let t = e.nodes.map((e) => ({
|
|
8097
8184
|
id: e.id,
|
|
8098
8185
|
type: e.type,
|
|
@@ -8100,8 +8187,8 @@ function wf(e) {
|
|
|
8100
8187
|
position: e.position,
|
|
8101
8188
|
width: e.width,
|
|
8102
8189
|
headerColor: e.headerColor,
|
|
8103
|
-
inputs: e.inputs.map((t) =>
|
|
8104
|
-
outputs: e.outputs.map((t) =>
|
|
8190
|
+
inputs: e.inputs.map((t) => Ef(e.id, t)),
|
|
8191
|
+
outputs: e.outputs.map((t) => Df(e.id, t)),
|
|
8105
8192
|
floatCurve: e.floatCurve,
|
|
8106
8193
|
colorRamp: e.colorRamp,
|
|
8107
8194
|
properties: e.properties,
|
|
@@ -8146,20 +8233,20 @@ function wf(e) {
|
|
|
8146
8233
|
}
|
|
8147
8234
|
//#endregion
|
|
8148
8235
|
//#region src/gn/xyflow/mapGraphIRToFlow.ts
|
|
8149
|
-
function
|
|
8236
|
+
function kf(e) {
|
|
8150
8237
|
let t = Math.max(e.inputs.length, e.outputs.length);
|
|
8151
8238
|
return Math.max(60, 32 + t * 18 + 16);
|
|
8152
8239
|
}
|
|
8153
|
-
function
|
|
8240
|
+
function Af(e) {
|
|
8154
8241
|
return e.type === "NodeReroute" ? {
|
|
8155
8242
|
w: 12,
|
|
8156
8243
|
h: 12
|
|
8157
8244
|
} : {
|
|
8158
8245
|
w: e.width,
|
|
8159
|
-
h:
|
|
8246
|
+
h: kf(e)
|
|
8160
8247
|
};
|
|
8161
8248
|
}
|
|
8162
|
-
function
|
|
8249
|
+
function jf(e) {
|
|
8163
8250
|
let t = e.nodes.filter((e) => e.type === "NodeFrame");
|
|
8164
8251
|
if (t.length === 0) return [];
|
|
8165
8252
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -8174,7 +8261,7 @@ function Df(e) {
|
|
|
8174
8261
|
if (t.length === 0) continue;
|
|
8175
8262
|
let i = Infinity, a = Infinity, o = -Infinity, s = -Infinity;
|
|
8176
8263
|
for (let e of t) {
|
|
8177
|
-
let { w: t, h: n } =
|
|
8264
|
+
let { w: t, h: n } = Af(e);
|
|
8178
8265
|
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);
|
|
8179
8266
|
}
|
|
8180
8267
|
Number.isFinite(i) && r.push({
|
|
@@ -8197,7 +8284,7 @@ function Df(e) {
|
|
|
8197
8284
|
}
|
|
8198
8285
|
return r;
|
|
8199
8286
|
}
|
|
8200
|
-
function
|
|
8287
|
+
function Mf(e, t, n) {
|
|
8201
8288
|
if (e.type === "NodeReroute") {
|
|
8202
8289
|
let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
|
|
8203
8290
|
return {
|
|
@@ -8239,7 +8326,7 @@ function Of(e, t, n) {
|
|
|
8239
8326
|
}
|
|
8240
8327
|
};
|
|
8241
8328
|
}
|
|
8242
|
-
function
|
|
8329
|
+
function Nf(e, t, n) {
|
|
8243
8330
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
8244
8331
|
for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
|
|
8245
8332
|
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);
|
|
@@ -8263,15 +8350,15 @@ function kf(e, t, n) {
|
|
|
8263
8350
|
for (let e of a) s.has(e) && l.add(e);
|
|
8264
8351
|
return l;
|
|
8265
8352
|
}
|
|
8266
|
-
function
|
|
8267
|
-
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = new Set(e.edges.map((e) => e.sourceSocketId)), r =
|
|
8353
|
+
function Pf(e) {
|
|
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) => Mf(e, t, n)), a = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), o = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), s = i;
|
|
8268
8355
|
if (a && o) {
|
|
8269
|
-
let t =
|
|
8356
|
+
let t = Nf(a.id, o.id, e);
|
|
8270
8357
|
if (t.size > 0) {
|
|
8271
8358
|
let n = new Map(e.nodes.map((e) => [e.id, e])), r = Infinity, c = -Infinity;
|
|
8272
8359
|
for (let e of t) {
|
|
8273
8360
|
let t = n.get(e);
|
|
8274
|
-
t && (r = Math.min(r, t.position.y), c = Math.max(c, t.position.y +
|
|
8361
|
+
t && (r = Math.min(r, t.position.y), c = Math.max(c, t.position.y + kf(t)));
|
|
8275
8362
|
}
|
|
8276
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);
|
|
8277
8364
|
if (Number.isFinite(r) && Number.isFinite(c) && Number.isFinite(d) && Number.isFinite(f)) {
|
|
@@ -8311,10 +8398,10 @@ function Af(e) {
|
|
|
8311
8398
|
}
|
|
8312
8399
|
//#endregion
|
|
8313
8400
|
//#region src/gn/ir/curvePath.ts
|
|
8314
|
-
function
|
|
8401
|
+
function Ff(e, t) {
|
|
8315
8402
|
return Math.sqrt(e * e + t * t);
|
|
8316
8403
|
}
|
|
8317
|
-
function
|
|
8404
|
+
function If(e) {
|
|
8318
8405
|
let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
|
|
8319
8406
|
let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
|
|
8320
8407
|
if (i === "VECTOR") return {
|
|
@@ -8324,11 +8411,11 @@ function Mf(e) {
|
|
|
8324
8411
|
let c = 0, l = 0, u = 0, d = 0;
|
|
8325
8412
|
if (o && s) {
|
|
8326
8413
|
let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
|
|
8327
|
-
if (u =
|
|
8328
|
-
let n = e / u + i / d, r = t / u + a / d, o =
|
|
8414
|
+
if (u = Ff(e, t), d = Ff(i, a), u > 1e-8 && d > 1e-8) {
|
|
8415
|
+
let n = e / u + i / d, r = t / u + a / d, o = Ff(n, r);
|
|
8329
8416
|
o > 1e-8 && (c = n / o, l = r / o);
|
|
8330
8417
|
} 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);
|
|
8331
|
-
} else s ? (d =
|
|
8418
|
+
} else s ? (d = Ff(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = Ff(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
|
|
8332
8419
|
let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
|
|
8333
8420
|
if (i === "AUTO_CLAMPED") {
|
|
8334
8421
|
if (o) {
|
|
@@ -8373,7 +8460,7 @@ function Mf(e) {
|
|
|
8373
8460
|
}
|
|
8374
8461
|
return n;
|
|
8375
8462
|
}
|
|
8376
|
-
function
|
|
8463
|
+
function Lf(e, t, n, r, i, a, o) {
|
|
8377
8464
|
let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
|
|
8378
8465
|
if (e.length < 2) return {
|
|
8379
8466
|
strokePath: "",
|
|
@@ -8381,7 +8468,7 @@ function Nf(e, t, n, r, i, a, o) {
|
|
|
8381
8468
|
zeroLinePath: "",
|
|
8382
8469
|
dotPositions: []
|
|
8383
8470
|
};
|
|
8384
|
-
let d =
|
|
8471
|
+
let d = If(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
|
|
8385
8472
|
for (let t = 0; t < e.length - 1; t++) {
|
|
8386
8473
|
let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
|
|
8387
8474
|
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)}`;
|
|
@@ -8396,7 +8483,7 @@ function Nf(e, t, n, r, i, a, o) {
|
|
|
8396
8483
|
}
|
|
8397
8484
|
//#endregion
|
|
8398
8485
|
//#region src/gn/components/ColorRampViz.tsx
|
|
8399
|
-
function
|
|
8486
|
+
function Rf([e, t, n]) {
|
|
8400
8487
|
let r = Math.max(e, t, n), i = r - Math.min(e, t, n), a = 0;
|
|
8401
8488
|
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));
|
|
8402
8489
|
let o = r === 0 ? 0 : i / r;
|
|
@@ -8406,7 +8493,7 @@ function Pf([e, t, n]) {
|
|
|
8406
8493
|
r
|
|
8407
8494
|
];
|
|
8408
8495
|
}
|
|
8409
|
-
function
|
|
8496
|
+
function zf([e, t, n]) {
|
|
8410
8497
|
if (t === 0) return [
|
|
8411
8498
|
n,
|
|
8412
8499
|
n,
|
|
@@ -8446,7 +8533,7 @@ function Ff([e, t, n]) {
|
|
|
8446
8533
|
];
|
|
8447
8534
|
}
|
|
8448
8535
|
}
|
|
8449
|
-
function
|
|
8536
|
+
function Bf([e, t, n]) {
|
|
8450
8537
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2, o = r - i, s = 0, c = 0;
|
|
8451
8538
|
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)), [
|
|
8452
8539
|
s,
|
|
@@ -8454,7 +8541,7 @@ function If([e, t, n]) {
|
|
|
8454
8541
|
a
|
|
8455
8542
|
];
|
|
8456
8543
|
}
|
|
8457
|
-
function
|
|
8544
|
+
function Vf([e, t, n]) {
|
|
8458
8545
|
if (t === 0) return [
|
|
8459
8546
|
n,
|
|
8460
8547
|
n,
|
|
@@ -8467,9 +8554,9 @@ function Lf([e, t, n]) {
|
|
|
8467
8554
|
a(e - 1 / 3)
|
|
8468
8555
|
];
|
|
8469
8556
|
}
|
|
8470
|
-
var
|
|
8471
|
-
function
|
|
8472
|
-
let a =
|
|
8557
|
+
var Hf = (e) => e < 1 ? e : e - 1;
|
|
8558
|
+
function Uf(e, t, n, r, i) {
|
|
8559
|
+
let a = Hf((r % 1 + 1) % 1), o = Hf((i % 1 + 1) % 1), s = 0;
|
|
8473
8560
|
switch (e) {
|
|
8474
8561
|
case "NEAR":
|
|
8475
8562
|
a < o && o - a > .5 ? s = 1 : a > o && o - a < -.5 && (s = 2);
|
|
@@ -8485,9 +8572,9 @@ function zf(e, t, n, r, i) {
|
|
|
8485
8572
|
break;
|
|
8486
8573
|
}
|
|
8487
8574
|
let c = (e, r) => t * e + n * r;
|
|
8488
|
-
return s === 1 ?
|
|
8575
|
+
return s === 1 ? Hf(c(a + 1, o)) : s === 2 ? Hf(c(a, o + 1)) : c(a, o);
|
|
8489
8576
|
}
|
|
8490
|
-
function
|
|
8577
|
+
function Wf(e, t) {
|
|
8491
8578
|
let n = [...e.stops].sort((e, t) => e.position - t.position);
|
|
8492
8579
|
if (n.length === 0) return [
|
|
8493
8580
|
0,
|
|
@@ -8507,7 +8594,7 @@ function Bf(e, t) {
|
|
|
8507
8594
|
r === "EASE" && (c = 3 * c * c - 2 * c * c * c);
|
|
8508
8595
|
let l = c, u = 1 - c, d = u * a.color[3] + l * o.color[3];
|
|
8509
8596
|
if (e.colorMode === "HSV" || e.colorMode === "HSL") {
|
|
8510
|
-
let t = e.colorMode === "HSV" ?
|
|
8597
|
+
let t = e.colorMode === "HSV" ? Rf : Bf, n = e.colorMode === "HSV" ? zf : Vf, r = t([
|
|
8511
8598
|
a.color[0],
|
|
8512
8599
|
a.color[1],
|
|
8513
8600
|
a.color[2]
|
|
@@ -8516,7 +8603,7 @@ function Bf(e, t) {
|
|
|
8516
8603
|
o.color[1],
|
|
8517
8604
|
o.color[2]
|
|
8518
8605
|
]), [s, c, f] = n([
|
|
8519
|
-
|
|
8606
|
+
Uf(e.hueInterpolation, l, u, i[0], r[0]),
|
|
8520
8607
|
u * r[1] + l * i[1],
|
|
8521
8608
|
u * r[2] + l * i[2]
|
|
8522
8609
|
]);
|
|
@@ -8534,25 +8621,25 @@ function Bf(e, t) {
|
|
|
8534
8621
|
d
|
|
8535
8622
|
];
|
|
8536
8623
|
}
|
|
8537
|
-
function
|
|
8624
|
+
function Gf(e) {
|
|
8538
8625
|
let t = Math.min(1, Math.max(0, e));
|
|
8539
8626
|
return t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
|
|
8540
8627
|
}
|
|
8541
|
-
function
|
|
8542
|
-
let i = (e) => Math.round(
|
|
8628
|
+
function Kf([e, t, n, r]) {
|
|
8629
|
+
let i = (e) => Math.round(Gf(e) * 255);
|
|
8543
8630
|
return `rgba(${i(e)}, ${i(t)}, ${i(n)}, ${r.toFixed(3)})`;
|
|
8544
8631
|
}
|
|
8545
|
-
var
|
|
8632
|
+
var qf = {
|
|
8546
8633
|
NEAR: "Near",
|
|
8547
8634
|
FAR: "Far",
|
|
8548
8635
|
CW: "CW",
|
|
8549
8636
|
CCW: "CCW"
|
|
8550
|
-
},
|
|
8551
|
-
function
|
|
8637
|
+
}, Jf = 64;
|
|
8638
|
+
function Yf({ data: e, width: t }) {
|
|
8552
8639
|
let n = [];
|
|
8553
|
-
for (let t = 0; t <=
|
|
8554
|
-
let r = t /
|
|
8555
|
-
n.push(`${
|
|
8640
|
+
for (let t = 0; t <= Jf; t++) {
|
|
8641
|
+
let r = t / Jf;
|
|
8642
|
+
n.push(`${Kf(Wf(e, r))} ${(r * 100).toFixed(1)}%`);
|
|
8556
8643
|
}
|
|
8557
8644
|
let r = `linear-gradient(to right, ${n.join(", ")})`, i = [...e.stops].sort((e, t) => e.position - t.position), a = i[i.length - 1];
|
|
8558
8645
|
return /* @__PURE__ */ _("div", {
|
|
@@ -8566,7 +8653,7 @@ function Gf({ data: e, width: t }) {
|
|
|
8566
8653
|
children: e.colorMode
|
|
8567
8654
|
}), /* @__PURE__ */ g("span", {
|
|
8568
8655
|
className: "gn-color-ramp__select",
|
|
8569
|
-
children:
|
|
8656
|
+
children: qf[e.hueInterpolation] ?? e.hueInterpolation
|
|
8570
8657
|
})]
|
|
8571
8658
|
}),
|
|
8572
8659
|
/* @__PURE__ */ _("div", {
|
|
@@ -8586,7 +8673,7 @@ function Gf({ data: e, width: t }) {
|
|
|
8586
8673
|
children: ["Pos ", a.position.toFixed(3)]
|
|
8587
8674
|
}), /* @__PURE__ */ g("span", {
|
|
8588
8675
|
className: "gn-color-ramp__swatch",
|
|
8589
|
-
style: { background:
|
|
8676
|
+
style: { background: Kf(a.color) }
|
|
8590
8677
|
})]
|
|
8591
8678
|
})
|
|
8592
8679
|
]
|
|
@@ -8594,18 +8681,18 @@ function Gf({ data: e, width: t }) {
|
|
|
8594
8681
|
}
|
|
8595
8682
|
//#endregion
|
|
8596
8683
|
//#region src/gn/components/groupNavContext.ts
|
|
8597
|
-
var
|
|
8598
|
-
function
|
|
8599
|
-
return o(
|
|
8684
|
+
var Xf = t(null);
|
|
8685
|
+
function Zf() {
|
|
8686
|
+
return o(Xf);
|
|
8600
8687
|
}
|
|
8601
8688
|
//#endregion
|
|
8602
8689
|
//#region src/gn/components/GenericGNNode.tsx
|
|
8603
|
-
var
|
|
8690
|
+
var Qf = [
|
|
8604
8691
|
"X",
|
|
8605
8692
|
"Y",
|
|
8606
8693
|
"Z",
|
|
8607
8694
|
"W"
|
|
8608
|
-
],
|
|
8695
|
+
], $f = {
|
|
8609
8696
|
FLOAT: "Float",
|
|
8610
8697
|
INT: "Integer",
|
|
8611
8698
|
VECTOR: "Vector",
|
|
@@ -8613,56 +8700,11 @@ var Jf = [
|
|
|
8613
8700
|
STRING: "String",
|
|
8614
8701
|
BOOLEAN: "Boolean",
|
|
8615
8702
|
ROTATION: "Rotation"
|
|
8616
|
-
}, Xf = {
|
|
8617
|
-
EQUAL: "Equal",
|
|
8618
|
-
NOT_EQUAL: "Not Equal",
|
|
8619
|
-
LESS_THAN: "Less Than",
|
|
8620
|
-
LESS_EQUAL: "Less Than or Equal",
|
|
8621
|
-
GREATER_THAN: "Greater Than",
|
|
8622
|
-
GREATER_EQUAL: "Greater Than or Equal",
|
|
8623
|
-
ADD: "Add",
|
|
8624
|
-
SUBTRACT: "Subtract",
|
|
8625
|
-
MULTIPLY: "Multiply",
|
|
8626
|
-
DIVIDE: "Divide",
|
|
8627
|
-
MULTIPLY_ADD: "Multiply Add",
|
|
8628
|
-
POWER: "Power",
|
|
8629
|
-
LOGARITHM: "Logarithm",
|
|
8630
|
-
SQRT: "Square Root",
|
|
8631
|
-
INVERSE_SQRT: "Inverse Square Root",
|
|
8632
|
-
ABSOLUTE: "Absolute",
|
|
8633
|
-
EXPONENT: "Exponent",
|
|
8634
|
-
MINIMUM: "Minimum",
|
|
8635
|
-
MAXIMUM: "Maximum",
|
|
8636
|
-
SIGN: "Sign",
|
|
8637
|
-
COMPARE: "Compare",
|
|
8638
|
-
SMOOTH_MIN: "Smooth Minimum",
|
|
8639
|
-
SMOOTH_MAX: "Smooth Maximum",
|
|
8640
|
-
ROUND: "Round",
|
|
8641
|
-
FLOOR: "Floor",
|
|
8642
|
-
CEIL: "Ceiling",
|
|
8643
|
-
TRUNCATE: "Truncate",
|
|
8644
|
-
FRACTION: "Fraction",
|
|
8645
|
-
MODULO: "Modulo",
|
|
8646
|
-
WRAP: "Wrap",
|
|
8647
|
-
SNAP: "Snap",
|
|
8648
|
-
PINGPONG: "Ping-Pong",
|
|
8649
|
-
SINE: "Sine",
|
|
8650
|
-
COSINE: "Cosine",
|
|
8651
|
-
TANGENT: "Tangent",
|
|
8652
|
-
ARCSINE: "Arcsine",
|
|
8653
|
-
ARCCOSINE: "Arccosine",
|
|
8654
|
-
ARCTANGENT: "Arctangent",
|
|
8655
|
-
ARCTAN2: "Arctan2",
|
|
8656
|
-
SINH: "Hyperbolic Sine",
|
|
8657
|
-
COSH: "Hyperbolic Cosine",
|
|
8658
|
-
TANH: "Hyperbolic Tangent",
|
|
8659
|
-
RADIANS: "To Radians",
|
|
8660
|
-
DEGREES: "To Degrees"
|
|
8661
8703
|
};
|
|
8662
|
-
function
|
|
8663
|
-
return e === "data_type" ?
|
|
8704
|
+
function ep(e, t) {
|
|
8705
|
+
return e === "data_type" ? $f[t] ?? t : e === "operation" ? uf(t) : e === "use_clamp" ? "Clamp" : t;
|
|
8664
8706
|
}
|
|
8665
|
-
function
|
|
8707
|
+
function tp(e) {
|
|
8666
8708
|
switch (e) {
|
|
8667
8709
|
case "LINE": return "gn-socket--line";
|
|
8668
8710
|
case "DIAMOND": return "gn-socket--diamond";
|
|
@@ -8671,55 +8713,55 @@ function Qf(e) {
|
|
|
8671
8713
|
default: return "gn-socket--circle";
|
|
8672
8714
|
}
|
|
8673
8715
|
}
|
|
8674
|
-
function
|
|
8716
|
+
function np(e) {
|
|
8675
8717
|
return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
|
|
8676
8718
|
}
|
|
8677
|
-
function
|
|
8719
|
+
function rp(e) {
|
|
8678
8720
|
return parseFloat(e.toFixed(3)).toString();
|
|
8679
8721
|
}
|
|
8680
|
-
function
|
|
8681
|
-
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${
|
|
8722
|
+
function ip(e, t) {
|
|
8723
|
+
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${rp(e)}${np(t)}`;
|
|
8682
8724
|
}
|
|
8683
|
-
function
|
|
8725
|
+
function ap(e) {
|
|
8684
8726
|
return Math.round(Math.min(1, Math.max(0, e)) * 255);
|
|
8685
8727
|
}
|
|
8686
|
-
function
|
|
8728
|
+
function op(e) {
|
|
8687
8729
|
let [t, n, r, i = 1] = e.values;
|
|
8688
8730
|
return /* @__PURE__ */ g("div", {
|
|
8689
8731
|
className: "gn-node__color-swatch",
|
|
8690
|
-
style: { background: `rgba(${
|
|
8732
|
+
style: { background: `rgba(${ap(t)},${ap(n)},${ap(r)},${i.toFixed(2)})` }
|
|
8691
8733
|
});
|
|
8692
8734
|
}
|
|
8693
|
-
function
|
|
8694
|
-
if (e.dataType === "RGBA") return /* @__PURE__ */ g(
|
|
8695
|
-
let t =
|
|
8735
|
+
function sp(e) {
|
|
8736
|
+
if (e.dataType === "RGBA") return /* @__PURE__ */ g(op, { values: e.values });
|
|
8737
|
+
let t = np(e.dataType);
|
|
8696
8738
|
return /* @__PURE__ */ g("div", {
|
|
8697
8739
|
className: "gn-node__vec-block",
|
|
8698
8740
|
children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
|
|
8699
8741
|
className: "gn-node__vec-row",
|
|
8700
8742
|
children: [/* @__PURE__ */ g("span", {
|
|
8701
8743
|
className: "gn-node__vec-label",
|
|
8702
|
-
children:
|
|
8744
|
+
children: Qf[n]
|
|
8703
8745
|
}), /* @__PURE__ */ _("span", {
|
|
8704
8746
|
className: "gn-node__vec-value",
|
|
8705
|
-
children: [
|
|
8747
|
+
children: [rp(e), t]
|
|
8706
8748
|
})]
|
|
8707
8749
|
}, n))
|
|
8708
8750
|
});
|
|
8709
8751
|
}
|
|
8710
|
-
function
|
|
8752
|
+
function cp({ properties: e }) {
|
|
8711
8753
|
let t = Object.entries(e);
|
|
8712
8754
|
return t.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
8713
8755
|
className: "gn-node__props",
|
|
8714
8756
|
children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
|
|
8715
8757
|
className: "gn-node__prop-row",
|
|
8716
|
-
children:
|
|
8758
|
+
children: ep(e, t)
|
|
8717
8759
|
}, e))
|
|
8718
8760
|
});
|
|
8719
8761
|
}
|
|
8720
|
-
var
|
|
8721
|
-
function
|
|
8722
|
-
let n = Math.max(10, t -
|
|
8762
|
+
var lp = 120, up = 6;
|
|
8763
|
+
function dp({ curve: e, width: t }) {
|
|
8764
|
+
let n = Math.max(10, t - up * 2), r = lp, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = Lf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
|
|
8723
8765
|
return /* @__PURE__ */ g("div", {
|
|
8724
8766
|
className: "gn-node__curve-wrap",
|
|
8725
8767
|
children: /* @__PURE__ */ _("svg", {
|
|
@@ -8750,7 +8792,7 @@ function cp({ curve: e, width: t }) {
|
|
|
8750
8792
|
})
|
|
8751
8793
|
});
|
|
8752
8794
|
}
|
|
8753
|
-
function
|
|
8795
|
+
function fp(e) {
|
|
8754
8796
|
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";
|
|
8755
8797
|
return /* @__PURE__ */ _("div", {
|
|
8756
8798
|
className: `gn-node__socket-row gn-node__socket-row--${i}`,
|
|
@@ -8759,7 +8801,7 @@ function lp(e) {
|
|
|
8759
8801
|
id: t.id,
|
|
8760
8802
|
type: r,
|
|
8761
8803
|
position: n,
|
|
8762
|
-
className: `gn-socket ${
|
|
8804
|
+
className: `gn-socket ${tp(t.displayShape)}`,
|
|
8763
8805
|
style: {
|
|
8764
8806
|
top: "50%",
|
|
8765
8807
|
background: t.color,
|
|
@@ -8772,15 +8814,15 @@ function lp(e) {
|
|
|
8772
8814
|
}),
|
|
8773
8815
|
s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
|
|
8774
8816
|
className: "gn-node__value",
|
|
8775
|
-
children:
|
|
8817
|
+
children: ip(t.defaultValue.value, t.dataType)
|
|
8776
8818
|
}) : null
|
|
8777
8819
|
]
|
|
8778
8820
|
});
|
|
8779
8821
|
}
|
|
8780
|
-
function
|
|
8822
|
+
function pp(e, t) {
|
|
8781
8823
|
return !t && !e.hideValue && e.defaultValue?.kind === "vec";
|
|
8782
8824
|
}
|
|
8783
|
-
function
|
|
8825
|
+
function mp() {
|
|
8784
8826
|
return /* @__PURE__ */ _("div", {
|
|
8785
8827
|
className: "gn-node__stack",
|
|
8786
8828
|
"aria-hidden": "true",
|
|
@@ -8791,8 +8833,8 @@ function dp() {
|
|
|
8791
8833
|
]
|
|
8792
8834
|
});
|
|
8793
8835
|
}
|
|
8794
|
-
function
|
|
8795
|
-
let t = e.data, n =
|
|
8836
|
+
function hp(e) {
|
|
8837
|
+
let t = e.data, n = Zf(), 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;
|
|
8796
8838
|
return /* @__PURE__ */ _("div", {
|
|
8797
8839
|
className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
|
|
8798
8840
|
onClick: s ? () => n.openGroup(o) : void 0,
|
|
@@ -8807,35 +8849,35 @@ function fp(e) {
|
|
|
8807
8849
|
children: t.label
|
|
8808
8850
|
})
|
|
8809
8851
|
}),
|
|
8810
|
-
s && /* @__PURE__ */ g(
|
|
8811
|
-
t.properties && /* @__PURE__ */ g(
|
|
8812
|
-
t.floatCurve && /* @__PURE__ */ g(
|
|
8852
|
+
s && /* @__PURE__ */ g(mp, {}),
|
|
8853
|
+
t.properties && /* @__PURE__ */ g(cp, { properties: t.properties }),
|
|
8854
|
+
t.floatCurve && /* @__PURE__ */ g(dp, {
|
|
8813
8855
|
curve: t.floatCurve,
|
|
8814
8856
|
width: t.width
|
|
8815
8857
|
}),
|
|
8816
8858
|
/* @__PURE__ */ _("div", {
|
|
8817
8859
|
className: "gn-node__body",
|
|
8818
8860
|
children: [
|
|
8819
|
-
i.map((e) => /* @__PURE__ */ g(
|
|
8861
|
+
i.map((e) => /* @__PURE__ */ g(fp, {
|
|
8820
8862
|
socket: e,
|
|
8821
8863
|
position: Y.Right,
|
|
8822
8864
|
type: "source",
|
|
8823
8865
|
align: "right",
|
|
8824
8866
|
suppressDefault: !0
|
|
8825
8867
|
}, e.id)),
|
|
8826
|
-
t.colorRamp && /* @__PURE__ */ g(
|
|
8868
|
+
t.colorRamp && /* @__PURE__ */ g(Yf, {
|
|
8827
8869
|
data: t.colorRamp,
|
|
8828
8870
|
width: t.width
|
|
8829
8871
|
}),
|
|
8830
8872
|
a.map((e) => {
|
|
8831
8873
|
let t = r.has(e.id);
|
|
8832
|
-
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(
|
|
8874
|
+
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(fp, {
|
|
8833
8875
|
socket: e,
|
|
8834
8876
|
position: Y.Left,
|
|
8835
8877
|
type: "target",
|
|
8836
8878
|
align: "left",
|
|
8837
8879
|
suppressDefault: t
|
|
8838
|
-
}),
|
|
8880
|
+
}), pp(e, t) ? /* @__PURE__ */ g(sp, {
|
|
8839
8881
|
values: e.defaultValue.values,
|
|
8840
8882
|
dataType: e.dataType
|
|
8841
8883
|
}) : null] }, e.id);
|
|
@@ -8847,7 +8889,7 @@ function fp(e) {
|
|
|
8847
8889
|
}
|
|
8848
8890
|
//#endregion
|
|
8849
8891
|
//#region src/gn/components/RerouteNode.tsx
|
|
8850
|
-
function
|
|
8892
|
+
function gp(e) {
|
|
8851
8893
|
let t = e.data;
|
|
8852
8894
|
return /* @__PURE__ */ _("div", {
|
|
8853
8895
|
className: "gn-reroute",
|
|
@@ -8867,7 +8909,7 @@ function pp(e) {
|
|
|
8867
8909
|
}
|
|
8868
8910
|
//#endregion
|
|
8869
8911
|
//#region src/gn/components/SimulationZoneFrame.tsx
|
|
8870
|
-
function
|
|
8912
|
+
function _p() {
|
|
8871
8913
|
return /* @__PURE__ */ g("div", {
|
|
8872
8914
|
className: "gn-sim-zone",
|
|
8873
8915
|
style: {
|
|
@@ -8882,7 +8924,7 @@ function mp() {
|
|
|
8882
8924
|
}
|
|
8883
8925
|
//#endregion
|
|
8884
8926
|
//#region src/gn/components/NodeFrame.tsx
|
|
8885
|
-
function
|
|
8927
|
+
function vp(e) {
|
|
8886
8928
|
let t = e.data;
|
|
8887
8929
|
return /* @__PURE__ */ g("div", {
|
|
8888
8930
|
className: "gn-node-frame",
|
|
@@ -8912,13 +8954,13 @@ function hp(e) {
|
|
|
8912
8954
|
}
|
|
8913
8955
|
//#endregion
|
|
8914
8956
|
//#region src/gn/components/GeometryNodesFlow.tsx
|
|
8915
|
-
var
|
|
8916
|
-
gnNode:
|
|
8917
|
-
rerouteNode:
|
|
8918
|
-
simulationZone:
|
|
8919
|
-
nodeFrame:
|
|
8920
|
-
},
|
|
8921
|
-
function
|
|
8957
|
+
var yp = {
|
|
8958
|
+
gnNode: hp,
|
|
8959
|
+
rerouteNode: gp,
|
|
8960
|
+
simulationZone: _p,
|
|
8961
|
+
nodeFrame: vp
|
|
8962
|
+
}, bp = { padding: .08 };
|
|
8963
|
+
function xp(e) {
|
|
8922
8964
|
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);
|
|
8923
8965
|
c(() => {
|
|
8924
8966
|
if (!b) return;
|
|
@@ -8930,7 +8972,7 @@ function vp(e) {
|
|
|
8930
8972
|
v,
|
|
8931
8973
|
y
|
|
8932
8974
|
]), c(() => {
|
|
8933
|
-
H(t), s?.([]), S.current = !1, h(
|
|
8975
|
+
H(t), s?.([]), S.current = !1, h(bp);
|
|
8934
8976
|
}, [
|
|
8935
8977
|
t,
|
|
8936
8978
|
H,
|
|
@@ -8942,7 +8984,7 @@ function vp(e) {
|
|
|
8942
8984
|
let e = x.current;
|
|
8943
8985
|
if (!e) return;
|
|
8944
8986
|
let t = new ResizeObserver(() => {
|
|
8945
|
-
S.current || h(
|
|
8987
|
+
S.current || h(bp);
|
|
8946
8988
|
});
|
|
8947
8989
|
return t.observe(e), () => t.disconnect();
|
|
8948
8990
|
}, [h]);
|
|
@@ -9024,9 +9066,9 @@ function vp(e) {
|
|
|
9024
9066
|
onEdgesChange: ee,
|
|
9025
9067
|
onSelectionChange: ie,
|
|
9026
9068
|
onMoveStart: re,
|
|
9027
|
-
nodeTypes:
|
|
9069
|
+
nodeTypes: yp,
|
|
9028
9070
|
fitView: !0,
|
|
9029
|
-
fitViewOptions:
|
|
9071
|
+
fitViewOptions: bp,
|
|
9030
9072
|
minZoom: .2,
|
|
9031
9073
|
translateExtent: te,
|
|
9032
9074
|
nodesDraggable: !1,
|
|
@@ -9064,7 +9106,7 @@ function vp(e) {
|
|
|
9064
9106
|
className: "gn-top-left",
|
|
9065
9107
|
children: [/* @__PURE__ */ _("span", {
|
|
9066
9108
|
className: "gn-version-badge",
|
|
9067
|
-
children: ["node-web-render v", "0.3.
|
|
9109
|
+
children: ["node-web-render v", "0.3.29"]
|
|
9068
9110
|
}), i.length > 1 ? /* @__PURE__ */ g("nav", {
|
|
9069
9111
|
className: "gn-breadcrumbs",
|
|
9070
9112
|
"aria-label": "Node group path",
|
|
@@ -9117,19 +9159,19 @@ function vp(e) {
|
|
|
9117
9159
|
]
|
|
9118
9160
|
});
|
|
9119
9161
|
}
|
|
9120
|
-
function
|
|
9162
|
+
function Sp(e) {
|
|
9121
9163
|
let { jsonText: t, showHeader: n = !0, onSelectionChange: r, onCopiedMagicString: i, interaction: o = "always", allowCopy: s = !0, allowSelection: l = !0 } = e, [d, p] = f({
|
|
9122
9164
|
json: t,
|
|
9123
9165
|
ids: []
|
|
9124
9166
|
}), m = u(() => {
|
|
9125
9167
|
if (!t.trim()) return null;
|
|
9126
9168
|
try {
|
|
9127
|
-
let { rootId: e, trees: n } =
|
|
9169
|
+
let { rootId: e, trees: n } = Tf(JSON.parse(t)), r = {};
|
|
9128
9170
|
for (let e of Object.values(n)) {
|
|
9129
|
-
let t =
|
|
9171
|
+
let t = Of(e);
|
|
9130
9172
|
r[t.id] = {
|
|
9131
9173
|
graph: t,
|
|
9132
|
-
flow:
|
|
9174
|
+
flow: Pf(t)
|
|
9133
9175
|
};
|
|
9134
9176
|
}
|
|
9135
9177
|
return {
|
|
@@ -9193,9 +9235,9 @@ function yp(e) {
|
|
|
9193
9235
|
className: "flow-error",
|
|
9194
9236
|
role: "alert",
|
|
9195
9237
|
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: m.error })]
|
|
9196
|
-
}) : v ? /* @__PURE__ */ g(
|
|
9238
|
+
}) : v ? /* @__PURE__ */ g(Xf.Provider, {
|
|
9197
9239
|
value: b,
|
|
9198
|
-
children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(
|
|
9240
|
+
children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(xp, {
|
|
9199
9241
|
nodes: v.flow.nodes,
|
|
9200
9242
|
edges: v.flow.edges,
|
|
9201
9243
|
jsonText: t,
|
|
@@ -9219,7 +9261,7 @@ function yp(e) {
|
|
|
9219
9261
|
}
|
|
9220
9262
|
//#endregion
|
|
9221
9263
|
//#region src/components/TreeClipperLogo.tsx
|
|
9222
|
-
function
|
|
9264
|
+
function Cp({ className: e }) {
|
|
9223
9265
|
return /* @__PURE__ */ _("svg", {
|
|
9224
9266
|
viewBox: "0 0 256 256",
|
|
9225
9267
|
className: e,
|
|
@@ -9280,7 +9322,7 @@ function bp({ className: e }) {
|
|
|
9280
9322
|
}
|
|
9281
9323
|
//#endregion
|
|
9282
9324
|
//#region src/embed.tsx
|
|
9283
|
-
function
|
|
9325
|
+
function wp(e) {
|
|
9284
9326
|
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 = () => {
|
|
9285
9327
|
!w.current || C.current || (S(!0), k.current && clearTimeout(k.current), k.current = setTimeout(() => {
|
|
9286
9328
|
y(!1), S(!1);
|
|
@@ -9324,7 +9366,7 @@ function xp(e) {
|
|
|
9324
9366
|
className: "gnwr-loading",
|
|
9325
9367
|
role: "status",
|
|
9326
9368
|
"aria-live": "polite",
|
|
9327
|
-
children: [/* @__PURE__ */ g(
|
|
9369
|
+
children: [/* @__PURE__ */ g(Cp, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
|
|
9328
9370
|
className: "gnwr-loading__label",
|
|
9329
9371
|
children: "Loading graph…"
|
|
9330
9372
|
})]
|
|
@@ -9332,7 +9374,7 @@ function xp(e) {
|
|
|
9332
9374
|
className: "flow-error",
|
|
9333
9375
|
role: "alert",
|
|
9334
9376
|
children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: o })]
|
|
9335
|
-
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
9377
|
+
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Sp, {
|
|
9336
9378
|
jsonText: i,
|
|
9337
9379
|
showHeader: !1,
|
|
9338
9380
|
interaction: "hybrid",
|
|
@@ -9359,7 +9401,7 @@ function xp(e) {
|
|
|
9359
9401
|
strokeLinecap: "round",
|
|
9360
9402
|
strokeLinejoin: "round"
|
|
9361
9403
|
})
|
|
9362
|
-
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
9404
|
+
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Cp, { 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" })] })
|
|
9363
9405
|
}), (v || b) && /* @__PURE__ */ _("div", {
|
|
9364
9406
|
className: `gnwr-copy-toast${b ? " gnwr-leaving" : ""}`,
|
|
9365
9407
|
role: "status",
|
|
@@ -9382,22 +9424,22 @@ function xp(e) {
|
|
|
9382
9424
|
})
|
|
9383
9425
|
});
|
|
9384
9426
|
}
|
|
9385
|
-
var
|
|
9386
|
-
function
|
|
9387
|
-
|
|
9427
|
+
var Tp = /* @__PURE__ */ new Map(), Ep = null;
|
|
9428
|
+
function Dp(e, t) {
|
|
9429
|
+
Tp.get(e)?.unmount();
|
|
9388
9430
|
let r = m(e);
|
|
9389
|
-
|
|
9431
|
+
Tp.set(e, r), Ep = e;
|
|
9390
9432
|
let i = t.onClose;
|
|
9391
|
-
return r.render(n(
|
|
9433
|
+
return r.render(n(wp, {
|
|
9392
9434
|
...t,
|
|
9393
9435
|
onClose: i ? () => {
|
|
9394
|
-
|
|
9436
|
+
Op(e), i();
|
|
9395
9437
|
} : void 0
|
|
9396
|
-
})), () =>
|
|
9438
|
+
})), () => Op(e);
|
|
9397
9439
|
}
|
|
9398
|
-
function
|
|
9399
|
-
let t = e ??
|
|
9400
|
-
t && (
|
|
9440
|
+
function Op(e) {
|
|
9441
|
+
let t = e ?? Ep;
|
|
9442
|
+
t && (Tp.get(t)?.unmount(), Tp.delete(t), t === Ep && (Ep = null));
|
|
9401
9443
|
}
|
|
9402
9444
|
//#endregion
|
|
9403
|
-
export {
|
|
9445
|
+
export { wp as GraphView, Dp as mountGraphView, Op as unmountGraphView };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable labels for the `operation` enum shared by the math-style
|
|
3
|
+
* nodes (Math, Integer Math, Vector Math, Boolean Math, Compare). Mirrors
|
|
4
|
+
* the labels Blender shows in the node header / operation dropdown.
|
|
5
|
+
*/
|
|
6
|
+
export declare const OPERATION_LABELS: Record<string, string>;
|
|
7
|
+
export declare function operationLabel(operation: string): string;
|
package/package.json
CHANGED