geonodes-web-render 0.3.19 → 0.3.20

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/README.md CHANGED
@@ -28,6 +28,18 @@ Tree Clipper JSON / base64 payload
28
28
  - **Blender fidelity** — socket and header colors sourced from Blender's own tables; Math/Compare nodes show human-readable operation labels
29
29
  - **Embeddable** — ships a separate `embed` entry point for use as a library
30
30
 
31
+ ## Controls
32
+
33
+ | Action | Mouse | Trackpad |
34
+ | --- | --- | --- |
35
+ | Box-select | Left-drag | Left-drag |
36
+ | Pan | Middle-drag | Two-finger drag |
37
+ | Zoom | Wheel | Pinch |
38
+ | Zoom (modifier) | `⌘`/`Ctrl` + wheel | `⌘`/`Ctrl` + two-finger |
39
+ | Context menu | Right-click | Right-click |
40
+
41
+ Mouse vs. trackpad is auto-detected per scroll, so wheel-zoom and two-finger-pan coexist. In an embed, scroll passes through to the page until you click the canvas to engage; moving the pointer off disengages.
42
+
31
43
  ## Usage
32
44
 
33
45
  ### Standalone app
package/dist/embed.js CHANGED
@@ -7708,15 +7708,13 @@ function $d({ nodeId: e, position: t, variant: n = Gs.Handle, className: r, styl
7708
7708
  i($d);
7709
7709
  //#endregion
7710
7710
  //#region src/gn/ir/socketColors.ts
7711
- function ef(e) {
7712
- return e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055;
7713
- }
7714
7711
  function $(e, t, n) {
7715
- let r = (e) => Math.round(Math.min(1, Math.max(0, ef(e))) * 255).toString(16).padStart(2, "0");
7712
+ let r = (e) => Math.round(Math.min(1, Math.max(0, e)) * 255).toString(16).padStart(2, "0");
7716
7713
  return `#${r(e)}${r(t)}${r(n)}`;
7717
7714
  }
7718
- var tf = {
7715
+ var ef = {
7719
7716
  FLOAT: $(.63, .63, .63),
7717
+ VALUE: $(.63, .63, .63),
7720
7718
  VECTOR: $(.39, .39, .78),
7721
7719
  RGBA: $(.78, .78, .16),
7722
7720
  SHADER: $(.39, .78, .39),
@@ -7737,12 +7735,12 @@ var tf = {
7737
7735
  INT_VECTOR: $(.36, .47, .61),
7738
7736
  CUSTOM: $(.2, .2, .2)
7739
7737
  };
7740
- function nf(e) {
7741
- return tf[e] ?? tf.CUSTOM;
7738
+ function tf(e) {
7739
+ return ef[e] ?? ef.CUSTOM;
7742
7740
  }
7743
7741
  //#endregion
7744
7742
  //#region src/gn/ir/nodeColors.ts
7745
- var rf = {
7743
+ var nf = {
7746
7744
  GEOMETRY: "#1d725e",
7747
7745
  INPUT: "#82354c",
7748
7746
  OUTPUT: "#3e232a",
@@ -7759,7 +7757,7 @@ var rf = {
7759
7757
  DISTORT: "#3e5a5b",
7760
7758
  SCRIPT: "#203c3c",
7761
7759
  DEFAULT: "#303030"
7762
- }, af = {
7760
+ }, rf = {
7763
7761
  ShaderNodeVectorMath: "VECTOR",
7764
7762
  ShaderNodeVectorRotate: "VECTOR",
7765
7763
  ShaderNodeVectorCurve: "VECTOR",
@@ -7781,10 +7779,10 @@ var rf = {
7781
7779
  ShaderNodeValue: "INPUT",
7782
7780
  ShaderNodeRGB: "INPUT"
7783
7781
  };
7784
- function of(e) {
7785
- 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 af ? af[e] : e.startsWith("ShaderNodeTex") ? "TEXTURE" : "SHADER" : e.startsWith("FunctionNode") ? e.startsWith("FunctionNodeInput") ? "INPUT" : "CONVERTER" : "DEFAULT";
7782
+ function af(e) {
7783
+ 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 rf ? rf[e] : e.startsWith("ShaderNodeTex") ? "TEXTURE" : "SHADER" : e.startsWith("FunctionNode") ? e.startsWith("FunctionNodeInput") ? "INPUT" : "CONVERTER" : "DEFAULT";
7786
7784
  }
7787
- var sf = {
7785
+ var of = {
7788
7786
  GeometryNodeInputMaterial: "INPUT",
7789
7787
  GeometryNodeInputMaterialIndex: "INPUT",
7790
7788
  GeometryNodeInputRadius: "INPUT",
@@ -7835,16 +7833,16 @@ var sf = {
7835
7833
  GeometryNodeFieldVariance: "CONVERTER",
7836
7834
  GeometryNodeViewer: "OUTPUT"
7837
7835
  };
7838
- function cf(e, t) {
7836
+ function sf(e, t) {
7839
7837
  if (e === "ShaderNodeMix") return t === "VECTOR" ? "VECTOR" : t === "RGBA" ? "COLOR" : "CONVERTER";
7840
7838
  if (e === "ShaderNodeMapRange") return t === "FLOAT_VECTOR" ? "VECTOR" : "CONVERTER";
7841
7839
  }
7842
- function lf(e, t) {
7843
- return rf[cf(e, t) ?? sf[e] ?? of(e)] ?? rf.DEFAULT;
7840
+ function cf(e, t) {
7841
+ return nf[sf(e, t) ?? of[e] ?? af(e)] ?? nf.DEFAULT;
7844
7842
  }
7845
7843
  //#endregion
7846
7844
  //#region src/gn/importer/blenderTree.ts
7847
- var uf = {
7845
+ var lf = {
7848
7846
  NodeSocketGeometry: "GEOMETRY",
7849
7847
  NodeSocketFloat: "FLOAT",
7850
7848
  NodeSocketVector: "VECTOR",
@@ -7861,10 +7859,10 @@ var uf = {
7861
7859
  NodeSocketMatrix: "MATRIX",
7862
7860
  NodeSocketMenu: "MENU"
7863
7861
  };
7864
- function df(e) {
7865
- return uf[e] ?? "CUSTOM";
7862
+ function uf(e) {
7863
+ return lf[e] ?? "CUSTOM";
7866
7864
  }
7867
- var ff = {
7865
+ var df = {
7868
7866
  HSV: [
7869
7867
  "Hue",
7870
7868
  "Saturation",
@@ -7881,7 +7879,7 @@ var ff = {
7881
7879
  "Blue"
7882
7880
  ]
7883
7881
  };
7884
- function pf(e) {
7882
+ function ff(e) {
7885
7883
  let t = e.data.mapping?.data;
7886
7884
  if (!t) return;
7887
7885
  let n = t.curves?.data?.items;
@@ -7899,7 +7897,7 @@ function pf(e) {
7899
7897
  points: r
7900
7898
  };
7901
7899
  }
7902
- function mf(e) {
7900
+ function pf(e) {
7903
7901
  let t = e.data.color_ramp?.data;
7904
7902
  if (!t) return;
7905
7903
  let n = (t.elements?.data?.items ?? []).map((e) => {
@@ -7921,8 +7919,8 @@ function mf(e) {
7921
7919
  stops: n
7922
7920
  };
7923
7921
  }
7924
- function hf(e, t) {
7925
- let n = ff[t ?? "RGB"] ?? ff.RGB, r = ff.RGB;
7922
+ function mf(e, t) {
7923
+ let n = df[t ?? "RGB"] ?? df.RGB, r = df.RGB;
7926
7924
  return e.map((e) => {
7927
7925
  let t = r.indexOf(e.name);
7928
7926
  return t === -1 ? e : {
@@ -7931,11 +7929,11 @@ function hf(e, t) {
7931
7929
  };
7932
7930
  });
7933
7931
  }
7934
- function gf(e) {
7932
+ function hf(e) {
7935
7933
  return e.replace(/\.\d{3}$/, "");
7936
7934
  }
7937
- function _f(e, t) {
7938
- let n = df(e.data.socket_idname ?? ""), r = nf(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
7935
+ function gf(e, t) {
7936
+ let n = uf(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) => ({
7939
7937
  id: e,
7940
7938
  name: "",
7941
7939
  dataType: n,
@@ -7961,7 +7959,7 @@ function _f(e, t) {
7961
7959
  ...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
7962
7960
  };
7963
7961
  }
7964
- function vf(e) {
7962
+ function _f(e) {
7965
7963
  return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
7966
7964
  kind: "vec",
7967
7965
  values: e
@@ -7970,20 +7968,20 @@ function vf(e) {
7970
7968
  value: e
7971
7969
  } : null;
7972
7970
  }
7973
- function yf(e, t) {
7971
+ function vf(e, t) {
7974
7972
  return {
7975
7973
  id: String(e.id),
7976
7974
  name: e.data.name,
7977
7975
  dataType: e.data.type,
7978
7976
  displayShape: e.data.display_shape,
7979
- color: nf(e.data.type),
7980
- defaultValue: vf(e.data.default_value),
7977
+ color: tf(e.data.type),
7978
+ defaultValue: _f(e.data.default_value),
7981
7979
  hideValue: e.data.hide_value ?? !1,
7982
7980
  enabled: e.data.enabled ?? !0,
7983
7981
  index: t
7984
7982
  };
7985
7983
  }
7986
- function bf(e) {
7984
+ function yf(e) {
7987
7985
  if (e.data.bl_idname === "FunctionNodeCompare") {
7988
7986
  let t = {};
7989
7987
  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;
@@ -7993,7 +7991,7 @@ function bf(e) {
7993
7991
  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;
7994
7992
  }
7995
7993
  }
7996
- function xf(e, t) {
7994
+ function bf(e, t) {
7997
7995
  if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
7998
7996
  if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
7999
7997
  if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
@@ -8003,10 +8001,10 @@ function xf(e, t) {
8003
8001
  nodes: e.data.nodes.data.items.map((e, t) => {
8004
8002
  if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
8005
8003
  let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
8006
- if (e.data.bl_idname === "NodeReroute") return _f(e, n);
8004
+ if (e.data.bl_idname === "NodeReroute") return gf(e, n);
8007
8005
  let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
8008
8006
  if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
8009
- return yf(t, n);
8007
+ return vf(t, n);
8010
8008
  });
8011
8009
  e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
8012
8010
  ...r[0],
@@ -8017,20 +8015,20 @@ function xf(e, t) {
8017
8015
  });
8018
8016
  let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
8019
8017
  if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
8020
- return yf(t, n);
8018
+ return vf(t, n);
8021
8019
  });
8022
- (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = hf(i, e.data.mode));
8023
- let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? pf(e) : void 0, o = e.data.bl_idname === "ShaderNodeValToRGB" ? mf(e) : void 0, s = bf(e);
8020
+ (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = mf(i, e.data.mode));
8021
+ let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? ff(e) : void 0, o = e.data.bl_idname === "ShaderNodeValToRGB" ? pf(e) : void 0, s = yf(e);
8024
8022
  return {
8025
8023
  id: String(e.id),
8026
8024
  type: e.data.bl_idname,
8027
- label: e.data.label || gf(e.data.name),
8025
+ label: e.data.label || hf(e.data.name),
8028
8026
  position: {
8029
8027
  x: n[0],
8030
8028
  y: -n[1]
8031
8029
  },
8032
8030
  width: e.data.width ?? 140,
8033
- headerColor: lf(e.data.bl_idname, e.data.data_type),
8031
+ headerColor: cf(e.data.bl_idname, e.data.data_type),
8034
8032
  inputs: i,
8035
8033
  outputs: r,
8036
8034
  floatCurve: a,
@@ -8050,12 +8048,12 @@ function xf(e, t) {
8050
8048
  })
8051
8049
  };
8052
8050
  }
8053
- function Sf(e) {
8051
+ function xf(e) {
8054
8052
  if (!e || typeof e != "object") throw Error("JSON root must be an object.");
8055
8053
  if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
8056
8054
  let t = {};
8057
8055
  for (let n = 0; n < e.node_trees.length; n++) {
8058
- let r = xf(e.node_trees[n], n);
8056
+ let r = bf(e.node_trees[n], n);
8059
8057
  t[r.id] = r;
8060
8058
  }
8061
8059
  let n = /* @__PURE__ */ new Set();
@@ -8074,21 +8072,21 @@ function Sf(e) {
8074
8072
  trees: t
8075
8073
  };
8076
8074
  }
8077
- function Cf(e, t) {
8075
+ function Sf(e, t) {
8078
8076
  return {
8079
8077
  ...t,
8080
8078
  nodeId: e,
8081
8079
  direction: "input"
8082
8080
  };
8083
8081
  }
8084
- function wf(e, t) {
8082
+ function Cf(e, t) {
8085
8083
  return {
8086
8084
  ...t,
8087
8085
  nodeId: e,
8088
8086
  direction: "output"
8089
8087
  };
8090
8088
  }
8091
- function Tf(e) {
8089
+ function wf(e) {
8092
8090
  let t = e.nodes.map((e) => ({
8093
8091
  id: e.id,
8094
8092
  type: e.type,
@@ -8096,8 +8094,8 @@ function Tf(e) {
8096
8094
  position: e.position,
8097
8095
  width: e.width,
8098
8096
  headerColor: e.headerColor,
8099
- inputs: e.inputs.map((t) => Cf(e.id, t)),
8100
- outputs: e.outputs.map((t) => wf(e.id, t)),
8097
+ inputs: e.inputs.map((t) => Sf(e.id, t)),
8098
+ outputs: e.outputs.map((t) => Cf(e.id, t)),
8101
8099
  floatCurve: e.floatCurve,
8102
8100
  colorRamp: e.colorRamp,
8103
8101
  properties: e.properties,
@@ -8123,20 +8121,20 @@ function Tf(e) {
8123
8121
  }
8124
8122
  //#endregion
8125
8123
  //#region src/gn/xyflow/mapGraphIRToFlow.ts
8126
- function Ef(e) {
8124
+ function Tf(e) {
8127
8125
  let t = Math.max(e.inputs.length, e.outputs.length);
8128
8126
  return Math.max(60, 32 + t * 18 + 16);
8129
8127
  }
8130
- function Df(e) {
8128
+ function Ef(e) {
8131
8129
  return e.type === "NodeReroute" ? {
8132
8130
  w: 12,
8133
8131
  h: 12
8134
8132
  } : {
8135
8133
  w: e.width,
8136
- h: Ef(e)
8134
+ h: Tf(e)
8137
8135
  };
8138
8136
  }
8139
- function Of(e) {
8137
+ function Df(e) {
8140
8138
  let t = e.nodes.filter((e) => e.type === "NodeFrame");
8141
8139
  if (t.length === 0) return [];
8142
8140
  let n = /* @__PURE__ */ new Map();
@@ -8151,7 +8149,7 @@ function Of(e) {
8151
8149
  if (t.length === 0) continue;
8152
8150
  let i = Infinity, a = Infinity, o = -Infinity, s = -Infinity;
8153
8151
  for (let e of t) {
8154
- let { w: t, h: n } = Df(e);
8152
+ let { w: t, h: n } = Ef(e);
8155
8153
  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);
8156
8154
  }
8157
8155
  Number.isFinite(i) && r.push({
@@ -8174,7 +8172,7 @@ function Of(e) {
8174
8172
  }
8175
8173
  return r;
8176
8174
  }
8177
- function kf(e, t) {
8175
+ function Of(e, t) {
8178
8176
  if (e.type === "NodeReroute") {
8179
8177
  let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
8180
8178
  return {
@@ -8215,7 +8213,7 @@ function kf(e, t) {
8215
8213
  }
8216
8214
  };
8217
8215
  }
8218
- function Af(e, t, n) {
8216
+ function kf(e, t, n) {
8219
8217
  let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
8220
8218
  for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
8221
8219
  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);
@@ -8239,45 +8237,36 @@ function Af(e, t, n) {
8239
8237
  for (let e of a) s.has(e) && l.add(e);
8240
8238
  return l;
8241
8239
  }
8242
- function jf(e) {
8243
- let t = new Set(e.edges.map((e) => e.targetSocketId)), n = Of(e), r = e.nodes.filter((e) => e.type !== "NodeFrame").map((e) => kf(e, t)), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), a = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), o = r;
8240
+ function Af(e) {
8241
+ let t = new Set(e.edges.map((e) => e.targetSocketId)), n = Df(e), r = e.nodes.filter((e) => e.type !== "NodeFrame").map((e) => Of(e, t)), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), a = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), o = r;
8244
8242
  if (i && a) {
8245
- let t = Af(i.id, a.id, e);
8243
+ let t = kf(i.id, a.id, e);
8246
8244
  if (t.size > 0) {
8247
- let n = new Map(e.nodes.map((e) => [e.id, e])), a = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
8245
+ let n = new Map(e.nodes.map((e) => [e.id, e])), s = Infinity, c = -Infinity;
8248
8246
  for (let e of t) {
8249
8247
  let t = n.get(e);
8250
- if (!t) continue;
8251
- let r = t.width, i = Ef(t);
8252
- 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);
8248
+ t && (s = Math.min(s, t.position.y), c = Math.max(c, t.position.y + Tf(t)));
8253
8249
  }
8254
- if (Number.isFinite(a) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
8255
- let e = a - 64, n = s - 64, u = c - a + 128, d = l - s + 128, f = `zone:simulation:${i.id}`;
8250
+ let l = i.position.x + i.width / 2, u = a.position.x + a.width / 2, d = Math.min(l, u), f = Math.max(l, u);
8251
+ if (Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(d) && Number.isFinite(f)) {
8252
+ let e = d, t = s - 26, n = f - d, a = c - s + 52;
8256
8253
  o = [{
8257
- id: f,
8254
+ id: `zone:simulation:${i.id}`,
8258
8255
  type: "simulationZone",
8259
8256
  position: {
8260
8257
  x: e,
8261
- y: n
8258
+ y: t
8262
8259
  },
8263
8260
  draggable: !1,
8264
8261
  selectable: !1,
8265
8262
  connectable: !1,
8266
- data: { label: "Simulation" },
8263
+ data: {},
8267
8264
  style: {
8268
- width: u,
8269
- height: d,
8265
+ width: n,
8266
+ height: a,
8270
8267
  zIndex: -10
8271
8268
  }
8272
- }, ...r.map((r) => t.has(r.id) ? {
8273
- ...r,
8274
- parentId: f,
8275
- extent: "parent",
8276
- position: {
8277
- x: r.position.x - e,
8278
- y: r.position.y - n
8279
- }
8280
- } : r)];
8269
+ }, ...r];
8281
8270
  }
8282
8271
  }
8283
8272
  }
@@ -8296,10 +8285,10 @@ function jf(e) {
8296
8285
  }
8297
8286
  //#endregion
8298
8287
  //#region src/gn/ir/curvePath.ts
8299
- function Mf(e, t) {
8288
+ function jf(e, t) {
8300
8289
  return Math.sqrt(e * e + t * t);
8301
8290
  }
8302
- function Nf(e) {
8291
+ function Mf(e) {
8303
8292
  let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
8304
8293
  let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
8305
8294
  if (i === "VECTOR") return {
@@ -8309,11 +8298,11 @@ function Nf(e) {
8309
8298
  let c = 0, l = 0, u = 0, d = 0;
8310
8299
  if (o && s) {
8311
8300
  let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
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);
8301
+ if (u = jf(e, t), d = jf(i, a), u > 1e-8 && d > 1e-8) {
8302
+ let n = e / u + i / d, r = t / u + a / d, o = jf(n, r);
8314
8303
  o > 1e-8 && (c = n / o, l = r / o);
8315
8304
  } 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);
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));
8305
+ } else s ? (d = jf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = jf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8317
8306
  let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
8318
8307
  if (i === "AUTO_CLAMPED") {
8319
8308
  if (o) {
@@ -8358,7 +8347,7 @@ function Nf(e) {
8358
8347
  }
8359
8348
  return n;
8360
8349
  }
8361
- function Pf(e, t, n, r, i, a, o) {
8350
+ function Nf(e, t, n, r, i, a, o) {
8362
8351
  let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
8363
8352
  if (e.length < 2) return {
8364
8353
  strokePath: "",
@@ -8366,7 +8355,7 @@ function Pf(e, t, n, r, i, a, o) {
8366
8355
  zeroLinePath: "",
8367
8356
  dotPositions: []
8368
8357
  };
8369
- let d = Nf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8358
+ let d = Mf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8370
8359
  for (let t = 0; t < e.length - 1; t++) {
8371
8360
  let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
8372
8361
  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)}`;
@@ -8381,7 +8370,7 @@ function Pf(e, t, n, r, i, a, o) {
8381
8370
  }
8382
8371
  //#endregion
8383
8372
  //#region src/gn/components/ColorRampViz.tsx
8384
- function Ff([e, t, n]) {
8373
+ function Pf([e, t, n]) {
8385
8374
  let r = Math.max(e, t, n), i = r - Math.min(e, t, n), a = 0;
8386
8375
  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
8376
  let o = r === 0 ? 0 : i / r;
@@ -8391,7 +8380,7 @@ function Ff([e, t, n]) {
8391
8380
  r
8392
8381
  ];
8393
8382
  }
8394
- function If([e, t, n]) {
8383
+ function Ff([e, t, n]) {
8395
8384
  if (t === 0) return [
8396
8385
  n,
8397
8386
  n,
@@ -8431,7 +8420,7 @@ function If([e, t, n]) {
8431
8420
  ];
8432
8421
  }
8433
8422
  }
8434
- function Lf([e, t, n]) {
8423
+ function If([e, t, n]) {
8435
8424
  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
8425
  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
8426
  s,
@@ -8439,7 +8428,7 @@ function Lf([e, t, n]) {
8439
8428
  a
8440
8429
  ];
8441
8430
  }
8442
- function Rf([e, t, n]) {
8431
+ function Lf([e, t, n]) {
8443
8432
  if (t === 0) return [
8444
8433
  n,
8445
8434
  n,
@@ -8452,9 +8441,9 @@ function Rf([e, t, n]) {
8452
8441
  a(e - 1 / 3)
8453
8442
  ];
8454
8443
  }
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;
8444
+ var Rf = (e) => e < 1 ? e : e - 1;
8445
+ function zf(e, t, n, r, i) {
8446
+ let a = Rf((r % 1 + 1) % 1), o = Rf((i % 1 + 1) % 1), s = 0;
8458
8447
  switch (e) {
8459
8448
  case "NEAR":
8460
8449
  a < o && o - a > .5 ? s = 1 : a > o && o - a < -.5 && (s = 2);
@@ -8470,9 +8459,9 @@ function Bf(e, t, n, r, i) {
8470
8459
  break;
8471
8460
  }
8472
8461
  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);
8462
+ return s === 1 ? Rf(c(a + 1, o)) : s === 2 ? Rf(c(a, o + 1)) : c(a, o);
8474
8463
  }
8475
- function Vf(e, t) {
8464
+ function Bf(e, t) {
8476
8465
  let n = [...e.stops].sort((e, t) => e.position - t.position);
8477
8466
  if (n.length === 0) return [
8478
8467
  0,
@@ -8492,7 +8481,7 @@ function Vf(e, t) {
8492
8481
  r === "EASE" && (c = 3 * c * c - 2 * c * c * c);
8493
8482
  let l = c, u = 1 - c, d = u * a.color[3] + l * o.color[3];
8494
8483
  if (e.colorMode === "HSV" || e.colorMode === "HSL") {
8495
- let t = e.colorMode === "HSV" ? Ff : Lf, n = e.colorMode === "HSV" ? If : Rf, r = t([
8484
+ let t = e.colorMode === "HSV" ? Pf : If, n = e.colorMode === "HSV" ? Ff : Lf, r = t([
8496
8485
  a.color[0],
8497
8486
  a.color[1],
8498
8487
  a.color[2]
@@ -8501,7 +8490,7 @@ function Vf(e, t) {
8501
8490
  o.color[1],
8502
8491
  o.color[2]
8503
8492
  ]), [s, c, f] = n([
8504
- Bf(e.hueInterpolation, l, u, i[0], r[0]),
8493
+ zf(e.hueInterpolation, l, u, i[0], r[0]),
8505
8494
  u * r[1] + l * i[1],
8506
8495
  u * r[2] + l * i[2]
8507
8496
  ]);
@@ -8519,25 +8508,25 @@ function Vf(e, t) {
8519
8508
  d
8520
8509
  ];
8521
8510
  }
8522
- function Hf(e) {
8511
+ function Vf(e) {
8523
8512
  let t = Math.min(1, Math.max(0, e));
8524
8513
  return t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
8525
8514
  }
8526
- function Uf([e, t, n, r]) {
8527
- let i = (e) => Math.round(Hf(e) * 255);
8515
+ function Hf([e, t, n, r]) {
8516
+ let i = (e) => Math.round(Vf(e) * 255);
8528
8517
  return `rgba(${i(e)}, ${i(t)}, ${i(n)}, ${r.toFixed(3)})`;
8529
8518
  }
8530
- var Wf = {
8519
+ var Uf = {
8531
8520
  NEAR: "Near",
8532
8521
  FAR: "Far",
8533
8522
  CW: "CW",
8534
8523
  CCW: "CCW"
8535
- }, Gf = 64;
8536
- function Kf({ data: e, width: t }) {
8524
+ }, Wf = 64;
8525
+ function Gf({ data: e, width: t }) {
8537
8526
  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)}%`);
8527
+ for (let t = 0; t <= Wf; t++) {
8528
+ let r = t / Wf;
8529
+ n.push(`${Hf(Bf(e, r))} ${(r * 100).toFixed(1)}%`);
8541
8530
  }
8542
8531
  let r = `linear-gradient(to right, ${n.join(", ")})`, i = [...e.stops].sort((e, t) => e.position - t.position), a = i[i.length - 1];
8543
8532
  return /* @__PURE__ */ _("div", {
@@ -8551,7 +8540,7 @@ function Kf({ data: e, width: t }) {
8551
8540
  children: e.colorMode
8552
8541
  }), /* @__PURE__ */ g("span", {
8553
8542
  className: "gn-color-ramp__select",
8554
- children: Wf[e.hueInterpolation] ?? e.hueInterpolation
8543
+ children: Uf[e.hueInterpolation] ?? e.hueInterpolation
8555
8544
  })]
8556
8545
  }),
8557
8546
  /* @__PURE__ */ _("div", {
@@ -8571,7 +8560,7 @@ function Kf({ data: e, width: t }) {
8571
8560
  children: ["Pos ", a.position.toFixed(3)]
8572
8561
  }), /* @__PURE__ */ g("span", {
8573
8562
  className: "gn-color-ramp__swatch",
8574
- style: { background: Uf(a.color) }
8563
+ style: { background: Hf(a.color) }
8575
8564
  })]
8576
8565
  })
8577
8566
  ]
@@ -8579,18 +8568,18 @@ function Kf({ data: e, width: t }) {
8579
8568
  }
8580
8569
  //#endregion
8581
8570
  //#region src/gn/components/groupNavContext.ts
8582
- var qf = t(null);
8583
- function Jf() {
8584
- return o(qf);
8571
+ var Kf = t(null);
8572
+ function qf() {
8573
+ return o(Kf);
8585
8574
  }
8586
8575
  //#endregion
8587
8576
  //#region src/gn/components/GenericGNNode.tsx
8588
- var Yf = [
8577
+ var Jf = [
8589
8578
  "X",
8590
8579
  "Y",
8591
8580
  "Z",
8592
8581
  "W"
8593
- ], Xf = {
8582
+ ], Yf = {
8594
8583
  FLOAT: "Float",
8595
8584
  INT: "Integer",
8596
8585
  VECTOR: "Vector",
@@ -8598,7 +8587,7 @@ var Yf = [
8598
8587
  STRING: "String",
8599
8588
  BOOLEAN: "Boolean",
8600
8589
  ROTATION: "Rotation"
8601
- }, Zf = {
8590
+ }, Xf = {
8602
8591
  EQUAL: "Equal",
8603
8592
  NOT_EQUAL: "Not Equal",
8604
8593
  LESS_THAN: "Less Than",
@@ -8644,10 +8633,10 @@ var Yf = [
8644
8633
  RADIANS: "To Radians",
8645
8634
  DEGREES: "To Degrees"
8646
8635
  };
8647
- function Qf(e, t) {
8648
- return e === "data_type" ? Xf[t] ?? t : e === "operation" ? Zf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8636
+ function Zf(e, t) {
8637
+ return e === "data_type" ? Yf[t] ?? t : e === "operation" ? Xf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8649
8638
  }
8650
- function $f(e) {
8639
+ function Qf(e) {
8651
8640
  switch (e) {
8652
8641
  case "LINE": return "gn-socket--line";
8653
8642
  case "DIAMOND": return "gn-socket--diamond";
@@ -8656,55 +8645,55 @@ function $f(e) {
8656
8645
  default: return "gn-socket--circle";
8657
8646
  }
8658
8647
  }
8659
- function ep(e) {
8648
+ function $f(e) {
8660
8649
  return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
8661
8650
  }
8662
- function tp(e) {
8651
+ function ep(e) {
8663
8652
  return parseFloat(e.toFixed(3)).toString();
8664
8653
  }
8665
- function np(e, t) {
8666
- return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${tp(e)}${ep(t)}`;
8654
+ function tp(e, t) {
8655
+ return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${ep(e)}${$f(t)}`;
8667
8656
  }
8668
- function rp(e) {
8657
+ function np(e) {
8669
8658
  return Math.round(Math.min(1, Math.max(0, e)) * 255);
8670
8659
  }
8671
- function ip(e) {
8660
+ function rp(e) {
8672
8661
  let [t, n, r, i = 1] = e.values;
8673
8662
  return /* @__PURE__ */ g("div", {
8674
8663
  className: "gn-node__color-swatch",
8675
- style: { background: `rgba(${rp(t)},${rp(n)},${rp(r)},${i.toFixed(2)})` }
8664
+ style: { background: `rgba(${np(t)},${np(n)},${np(r)},${i.toFixed(2)})` }
8676
8665
  });
8677
8666
  }
8678
- function ap(e) {
8679
- if (e.dataType === "RGBA") return /* @__PURE__ */ g(ip, { values: e.values });
8680
- let t = ep(e.dataType);
8667
+ function ip(e) {
8668
+ if (e.dataType === "RGBA") return /* @__PURE__ */ g(rp, { values: e.values });
8669
+ let t = $f(e.dataType);
8681
8670
  return /* @__PURE__ */ g("div", {
8682
8671
  className: "gn-node__vec-block",
8683
8672
  children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
8684
8673
  className: "gn-node__vec-row",
8685
8674
  children: [/* @__PURE__ */ g("span", {
8686
8675
  className: "gn-node__vec-label",
8687
- children: Yf[n]
8676
+ children: Jf[n]
8688
8677
  }), /* @__PURE__ */ _("span", {
8689
8678
  className: "gn-node__vec-value",
8690
- children: [tp(e), t]
8679
+ children: [ep(e), t]
8691
8680
  })]
8692
8681
  }, n))
8693
8682
  });
8694
8683
  }
8695
- function op({ properties: e }) {
8684
+ function ap({ properties: e }) {
8696
8685
  let t = Object.entries(e);
8697
8686
  return t.length === 0 ? null : /* @__PURE__ */ g("div", {
8698
8687
  className: "gn-node__props",
8699
8688
  children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
8700
8689
  className: "gn-node__prop-row",
8701
- children: Qf(e, t)
8690
+ children: Zf(e, t)
8702
8691
  }, e))
8703
8692
  });
8704
8693
  }
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);
8694
+ var op = 120, sp = 6;
8695
+ function cp({ curve: e, width: t }) {
8696
+ let n = Math.max(10, t - sp * 2), r = op, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = Nf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8708
8697
  return /* @__PURE__ */ g("div", {
8709
8698
  className: "gn-node__curve-wrap",
8710
8699
  children: /* @__PURE__ */ _("svg", {
@@ -8735,7 +8724,7 @@ function lp({ curve: e, width: t }) {
8735
8724
  })
8736
8725
  });
8737
8726
  }
8738
- function up(e) {
8727
+ function lp(e) {
8739
8728
  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";
8740
8729
  return /* @__PURE__ */ _("div", {
8741
8730
  className: `gn-node__socket-row gn-node__socket-row--${i}`,
@@ -8744,7 +8733,7 @@ function up(e) {
8744
8733
  id: t.id,
8745
8734
  type: r,
8746
8735
  position: n,
8747
- className: `gn-socket ${$f(t.displayShape)}`,
8736
+ className: `gn-socket ${Qf(t.displayShape)}`,
8748
8737
  style: {
8749
8738
  top: "50%",
8750
8739
  background: t.color,
@@ -8757,15 +8746,15 @@ function up(e) {
8757
8746
  }),
8758
8747
  s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
8759
8748
  className: "gn-node__value",
8760
- children: np(t.defaultValue.value, t.dataType)
8749
+ children: tp(t.defaultValue.value, t.dataType)
8761
8750
  }) : null
8762
8751
  ]
8763
8752
  });
8764
8753
  }
8765
- function dp(e, t) {
8754
+ function up(e, t) {
8766
8755
  return !t && !e.hideValue && e.defaultValue?.kind === "vec";
8767
8756
  }
8768
- function fp() {
8757
+ function dp() {
8769
8758
  return /* @__PURE__ */ _("div", {
8770
8759
  className: "gn-node__stack",
8771
8760
  "aria-hidden": "true",
@@ -8776,8 +8765,8 @@ function fp() {
8776
8765
  ]
8777
8766
  });
8778
8767
  }
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;
8768
+ function fp(e) {
8769
+ let t = e.data, n = qf(), 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;
8781
8770
  return /* @__PURE__ */ _("div", {
8782
8771
  className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
8783
8772
  onClick: s ? () => n.openGroup(o) : void 0,
@@ -8792,35 +8781,35 @@ function pp(e) {
8792
8781
  children: t.label
8793
8782
  })
8794
8783
  }),
8795
- s && /* @__PURE__ */ g(fp, {}),
8796
- t.properties && /* @__PURE__ */ g(op, { properties: t.properties }),
8797
- t.floatCurve && /* @__PURE__ */ g(lp, {
8784
+ s && /* @__PURE__ */ g(dp, {}),
8785
+ t.properties && /* @__PURE__ */ g(ap, { properties: t.properties }),
8786
+ t.floatCurve && /* @__PURE__ */ g(cp, {
8798
8787
  curve: t.floatCurve,
8799
8788
  width: t.width
8800
8789
  }),
8801
8790
  /* @__PURE__ */ _("div", {
8802
8791
  className: "gn-node__body",
8803
8792
  children: [
8804
- i.map((e) => /* @__PURE__ */ g(up, {
8793
+ i.map((e) => /* @__PURE__ */ g(lp, {
8805
8794
  socket: e,
8806
8795
  position: Y.Right,
8807
8796
  type: "source",
8808
8797
  align: "right",
8809
8798
  suppressDefault: !0
8810
8799
  }, e.id)),
8811
- t.colorRamp && /* @__PURE__ */ g(Kf, {
8800
+ t.colorRamp && /* @__PURE__ */ g(Gf, {
8812
8801
  data: t.colorRamp,
8813
8802
  width: t.width
8814
8803
  }),
8815
8804
  a.map((e) => {
8816
8805
  let t = r.has(e.id);
8817
- return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(up, {
8806
+ return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(lp, {
8818
8807
  socket: e,
8819
8808
  position: Y.Left,
8820
8809
  type: "target",
8821
8810
  align: "left",
8822
8811
  suppressDefault: t
8823
- }), dp(e, t) ? /* @__PURE__ */ g(ap, {
8812
+ }), up(e, t) ? /* @__PURE__ */ g(ip, {
8824
8813
  values: e.defaultValue.values,
8825
8814
  dataType: e.dataType
8826
8815
  }) : null] }, e.id);
@@ -8832,7 +8821,7 @@ function pp(e) {
8832
8821
  }
8833
8822
  //#endregion
8834
8823
  //#region src/gn/components/RerouteNode.tsx
8835
- function mp(e) {
8824
+ function pp(e) {
8836
8825
  let t = e.data;
8837
8826
  return /* @__PURE__ */ _("div", {
8838
8827
  className: "gn-reroute",
@@ -8852,34 +8841,22 @@ function mp(e) {
8852
8841
  }
8853
8842
  //#endregion
8854
8843
  //#region src/gn/components/SimulationZoneFrame.tsx
8855
- function hp(e) {
8856
- let t = e.data;
8844
+ function mp() {
8857
8845
  return /* @__PURE__ */ g("div", {
8858
8846
  className: "gn-sim-zone",
8859
8847
  style: {
8860
8848
  width: "100%",
8861
8849
  height: "100%",
8862
8850
  borderRadius: 10,
8863
- border: "2px solid rgba(170, 90, 255, 0.75)",
8864
- background: "rgba(170, 90, 255, 0.10)",
8865
- boxShadow: "0 0 0 1px rgba(30, 10, 50, 0.30) inset",
8851
+ border: "1.5px solid rgba(150, 104, 140, 0.5)",
8852
+ background: "rgba(124, 58, 96, 0.16)",
8866
8853
  pointerEvents: "none"
8867
- },
8868
- children: /* @__PURE__ */ g("div", {
8869
- style: {
8870
- padding: "6px 10px",
8871
- fontSize: 12,
8872
- color: "rgba(235, 220, 255, 0.95)",
8873
- textShadow: "0 1px 0 rgba(0,0,0,0.35)",
8874
- userSelect: "none"
8875
- },
8876
- children: t?.label ?? "Simulation"
8877
- })
8854
+ }
8878
8855
  });
8879
8856
  }
8880
8857
  //#endregion
8881
8858
  //#region src/gn/components/NodeFrame.tsx
8882
- function gp(e) {
8859
+ function hp(e) {
8883
8860
  let t = e.data;
8884
8861
  return /* @__PURE__ */ g("div", {
8885
8862
  className: "gn-node-frame",
@@ -8909,13 +8886,13 @@ function gp(e) {
8909
8886
  }
8910
8887
  //#endregion
8911
8888
  //#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) {
8889
+ var gp = {
8890
+ gnNode: fp,
8891
+ rerouteNode: pp,
8892
+ simulationZone: mp,
8893
+ nodeFrame: hp
8894
+ }, _p = { padding: .08 };
8895
+ function vp(e) {
8919
8896
  let { nodes: t, edges: n, jsonText: r, breadcrumbs: i, onNavigate: o, onSelectionIds: s, onCopiedMagicString: l, interaction: u = "always" } = e, { fitView: p, getNodes: m, getNodesBounds: h } = ml(), v = bd(), y = d(null), b = d(!1), x = d([]), [S, C] = f(null), [w, D] = f(!1), [O, k] = f(!1), A = d(null), [j, M] = f("mouse"), [N, P] = f(!1), [F, I] = f(!1), L = d([]), [R, ee, z] = _d(t), [B, V, H] = vd(n), [U, W] = f(void 0);
8920
8897
  c(() => {
8921
8898
  if (!v) return;
@@ -8927,7 +8904,7 @@ function yp(e) {
8927
8904
  m,
8928
8905
  h
8929
8906
  ]), c(() => {
8930
- ee(t), s?.([]), b.current = !1, p(vp);
8907
+ ee(t), s?.([]), b.current = !1, p(_p);
8931
8908
  }, [
8932
8909
  t,
8933
8910
  ee,
@@ -8939,7 +8916,7 @@ function yp(e) {
8939
8916
  let e = y.current;
8940
8917
  if (!e) return;
8941
8918
  let t = new ResizeObserver(() => {
8942
- b.current || p(vp);
8919
+ b.current || p(_p);
8943
8920
  });
8944
8921
  return t.observe(e), () => t.disconnect();
8945
8922
  }, [p]);
@@ -9010,9 +8987,9 @@ function yp(e) {
9010
8987
  onEdgesChange: H,
9011
8988
  onSelectionChange: ne,
9012
8989
  onMoveStart: te,
9013
- nodeTypes: _p,
8990
+ nodeTypes: gp,
9014
8991
  fitView: !0,
9015
- fitViewOptions: vp,
8992
+ fitViewOptions: _p,
9016
8993
  minZoom: .2,
9017
8994
  translateExtent: U,
9018
8995
  nodesDraggable: !1,
@@ -9050,7 +9027,7 @@ function yp(e) {
9050
9027
  className: "gn-top-left",
9051
9028
  children: [/* @__PURE__ */ _("span", {
9052
9029
  className: "gn-version-badge",
9053
- children: ["node-web-render v", "0.3.19"]
9030
+ children: ["node-web-render v", "0.3.20"]
9054
9031
  }), i.length > 1 ? /* @__PURE__ */ g("nav", {
9055
9032
  className: "gn-breadcrumbs",
9056
9033
  "aria-label": "Node group path",
@@ -9103,19 +9080,19 @@ function yp(e) {
9103
9080
  ]
9104
9081
  });
9105
9082
  }
9106
- function bp(e) {
9083
+ function yp(e) {
9107
9084
  let { jsonText: t, showHeader: n = !0, onSelectionChange: r, onCopiedMagicString: i, interaction: o = "always" } = e, [s, l] = f({
9108
9085
  json: t,
9109
9086
  ids: []
9110
9087
  }), d = u(() => {
9111
9088
  if (!t.trim()) return null;
9112
9089
  try {
9113
- let { rootId: e, trees: n } = Sf(JSON.parse(t)), r = {};
9090
+ let { rootId: e, trees: n } = xf(JSON.parse(t)), r = {};
9114
9091
  for (let e of Object.values(n)) {
9115
- let t = Tf(e);
9092
+ let t = wf(e);
9116
9093
  r[t.id] = {
9117
9094
  graph: t,
9118
- flow: jf(t)
9095
+ flow: Af(t)
9119
9096
  };
9120
9097
  }
9121
9098
  return {
@@ -9179,9 +9156,9 @@ function bp(e) {
9179
9156
  className: "flow-error",
9180
9157
  role: "alert",
9181
9158
  children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: d.error })]
9182
- }) : m ? /* @__PURE__ */ g(qf.Provider, {
9159
+ }) : m ? /* @__PURE__ */ g(Kf.Provider, {
9183
9160
  value: v,
9184
- children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(yp, {
9161
+ children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(vp, {
9185
9162
  nodes: m.flow.nodes,
9186
9163
  edges: m.flow.edges,
9187
9164
  jsonText: t,
@@ -9203,7 +9180,7 @@ function bp(e) {
9203
9180
  }
9204
9181
  //#endregion
9205
9182
  //#region src/components/TreeClipperLogo.tsx
9206
- function xp({ className: e }) {
9183
+ function bp({ className: e }) {
9207
9184
  return /* @__PURE__ */ _("svg", {
9208
9185
  viewBox: "0 0 256 256",
9209
9186
  className: e,
@@ -9264,7 +9241,7 @@ function xp({ className: e }) {
9264
9241
  }
9265
9242
  //#endregion
9266
9243
  //#region src/embed.tsx
9267
- function Sp(e) {
9244
+ function xp(e) {
9268
9245
  let { payload: t } = e, [n, r] = f(""), [i, a] = f(null), [o, s] = f(!0), [l, u] = f([]), [p, m] = f(!1), [v, y] = f(!1), b = d(!1), S = d(!1), C = d(null), w = d(null), D = d(null), O = () => {
9269
9246
  !S.current || b.current || (y(!0), D.current && clearTimeout(D.current), D.current = setTimeout(() => {
9270
9247
  m(!1), y(!1);
@@ -9308,7 +9285,7 @@ function Sp(e) {
9308
9285
  className: "gnwr-loading",
9309
9286
  role: "status",
9310
9287
  "aria-live": "polite",
9311
- children: [/* @__PURE__ */ g(xp, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
9288
+ children: [/* @__PURE__ */ g(bp, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
9312
9289
  className: "gnwr-loading__label",
9313
9290
  children: "Loading graph…"
9314
9291
  })]
@@ -9317,7 +9294,7 @@ function Sp(e) {
9317
9294
  role: "alert",
9318
9295
  children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
9319
9296
  }) : /* @__PURE__ */ _(h, { children: [
9320
- /* @__PURE__ */ g(bp, {
9297
+ /* @__PURE__ */ g(yp, {
9321
9298
  jsonText: n,
9322
9299
  showHeader: !1,
9323
9300
  interaction: "hybrid",
@@ -9343,7 +9320,7 @@ function Sp(e) {
9343
9320
  strokeLinecap: "round",
9344
9321
  strokeLinejoin: "round"
9345
9322
  })
9346
- }), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(xp, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: l.length > 0 ? `Copy Magic String of ${l.length} selected node${l.length === 1 ? "" : "s"}` : "Copy TreeClipper Magic String" })] })
9323
+ }), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(bp, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: l.length > 0 ? `Copy Magic String of ${l.length} selected node${l.length === 1 ? "" : "s"}` : "Copy TreeClipper Magic String" })] })
9347
9324
  }),
9348
9325
  (p || v) && /* @__PURE__ */ _("div", {
9349
9326
  className: `gnwr-copy-toast${v ? " gnwr-leaving" : ""}`,
@@ -9368,22 +9345,22 @@ function Sp(e) {
9368
9345
  })
9369
9346
  });
9370
9347
  }
9371
- var Cp = /* @__PURE__ */ new Map(), wp = null;
9372
- function Tp(e, t) {
9373
- Cp.get(e)?.unmount();
9348
+ var Sp = /* @__PURE__ */ new Map(), Cp = null;
9349
+ function wp(e, t) {
9350
+ Sp.get(e)?.unmount();
9374
9351
  let r = m(e);
9375
- Cp.set(e, r), wp = e;
9352
+ Sp.set(e, r), Cp = e;
9376
9353
  let i = t.onClose;
9377
- return r.render(n(Sp, {
9354
+ return r.render(n(xp, {
9378
9355
  ...t,
9379
9356
  onClose: i ? () => {
9380
- Ep(e), i();
9357
+ Tp(e), i();
9381
9358
  } : void 0
9382
- })), () => Ep(e);
9359
+ })), () => Tp(e);
9383
9360
  }
9384
- function Ep(e) {
9385
- let t = e ?? wp;
9386
- t && (Cp.get(t)?.unmount(), Cp.delete(t), t === wp && (wp = null));
9361
+ function Tp(e) {
9362
+ let t = e ?? Cp;
9363
+ t && (Sp.get(t)?.unmount(), Sp.delete(t), t === Cp && (Cp = null));
9387
9364
  }
9388
9365
  //#endregion
9389
- export { Sp as GraphView, Tp as mountGraphView, Ep as unmountGraphView };
9366
+ export { xp as GraphView, wp as mountGraphView, Tp as unmountGraphView };
@@ -1,2 +1 @@
1
- import { NodeProps } from '@xyflow/react';
2
- export declare function SimulationZoneFrame(props: NodeProps): import("react").JSX.Element;
1
+ export declare function SimulationZoneFrame(): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geonodes-web-render",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "description": "Browser-based viewer for Blender Geometry Nodes exported via Tree Clipper. Renders node trees as a read-only, Blender-styled graph.",
5
5
  "type": "module",
6
6
  "exports": {