geonodes-web-render 0.3.19 β 0.3.21
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 +16 -0
- package/dist/embed.js +229 -251
- package/dist/types/gn/components/SimulationZoneFrame.d.ts +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# geonodes-web-render
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/geonodes-web-render?activeTab=readme)
|
|
4
|
+
|
|
3
5
|
A browser-based viewer for Blender node trees exported via the [Tree Clipper](https://extensions.blender.org/add-ons/tree-clipper/) add-on. It renders the exported JSON as a read-only, Blender-styled node graph using React Flow.
|
|
4
6
|
|
|
7
|
+
π¦ **npm:** [geonodes-web-render](https://www.npmjs.com/package/geonodes-web-render?activeTab=readme)
|
|
8
|
+
|
|
5
9
|
## What it does
|
|
6
10
|
|
|
7
11
|
Paste or load a Tree Clipper JSON export and the app displays the node graph with accurate socket colors, node header colors, reroute nodes, float curves, and simulation zones.
|
|
@@ -28,6 +32,18 @@ Tree Clipper JSON / base64 payload
|
|
|
28
32
|
- **Blender fidelity** β socket and header colors sourced from Blender's own tables; Math/Compare nodes show human-readable operation labels
|
|
29
33
|
- **Embeddable** β ships a separate `embed` entry point for use as a library
|
|
30
34
|
|
|
35
|
+
## Controls
|
|
36
|
+
|
|
37
|
+
| Action | Mouse | Trackpad |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| Box-select | Left-drag | Left-drag |
|
|
40
|
+
| Pan | Middle-drag | Two-finger drag |
|
|
41
|
+
| Zoom | Wheel | Pinch |
|
|
42
|
+
| Zoom (modifier) | `β`/`Ctrl` + wheel | `β`/`Ctrl` + two-finger |
|
|
43
|
+
| Context menu | Right-click | Right-click |
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
31
47
|
## Usage
|
|
32
48
|
|
|
33
49
|
### Standalone app
|
package/dist/embed.js
CHANGED
|
@@ -257,16 +257,16 @@ function re(e) {
|
|
|
257
257
|
//#endregion
|
|
258
258
|
//#region node_modules/d3-selection/src/selection/selectChild.js
|
|
259
259
|
var ie = Array.prototype.find;
|
|
260
|
-
function
|
|
260
|
+
function ae(e) {
|
|
261
261
|
return function() {
|
|
262
262
|
return ie.call(this.children, e);
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function G() {
|
|
266
266
|
return this.firstElementChild;
|
|
267
267
|
}
|
|
268
268
|
function oe(e) {
|
|
269
|
-
return this.select(e == null ?
|
|
269
|
+
return this.select(e == null ? G : ae(typeof e == "function" ? e : re(e)));
|
|
270
270
|
}
|
|
271
271
|
//#endregion
|
|
272
272
|
//#region node_modules/d3-selection/src/selection/selectChildren.js
|
|
@@ -6312,9 +6312,9 @@ function Hu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
6312
6312
|
}), N.current?.blur()) : n([e])), i && i(t, T);
|
|
6313
6313
|
}, ie = o ? (e) => {
|
|
6314
6314
|
o(e, { ...T });
|
|
6315
|
-
} : void 0,
|
|
6315
|
+
} : void 0, ae = s ? (e) => {
|
|
6316
6316
|
s(e, { ...T });
|
|
6317
|
-
} : void 0,
|
|
6317
|
+
} : void 0, G = c ? (e) => {
|
|
6318
6318
|
c(e, { ...T });
|
|
6319
6319
|
} : void 0, oe = l ? (e) => {
|
|
6320
6320
|
l(e, { ...T });
|
|
@@ -6339,8 +6339,8 @@ function Hu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
6339
6339
|
]),
|
|
6340
6340
|
onClick: re,
|
|
6341
6341
|
onDoubleClick: ie,
|
|
6342
|
-
onContextMenu:
|
|
6343
|
-
onMouseEnter:
|
|
6342
|
+
onContextMenu: ae,
|
|
6343
|
+
onMouseEnter: G,
|
|
6344
6344
|
onMouseMove: oe,
|
|
6345
6345
|
onMouseLeave: se,
|
|
6346
6346
|
onKeyDown: A ? (t) => {
|
|
@@ -6582,7 +6582,7 @@ function od() {
|
|
|
6582
6582
|
}
|
|
6583
6583
|
}, []);
|
|
6584
6584
|
}
|
|
6585
|
-
function sd({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: i, onNodeDoubleClick: a, onEdgeDoubleClick: o, onNodeMouseEnter: s, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: u, onSelectionContextMenu: d, onSelectionStart: f, onSelectionEnd: p, connectionLineType: m, connectionLineStyle: h, connectionLineComponent: v, connectionLineContainerStyle: y, selectionKeyCode: b, selectionOnDrag: x, selectionMode: S, multiSelectionKeyCode: C, panActivationKeyCode: w, zoomActivationKeyCode: T, deleteKeyCode: E, onlyRenderVisibleElements: D, elementsSelectable: O, defaultViewport: k, translateExtent: A, minZoom: j, maxZoom: M, preventScrolling: N, defaultMarkerColor: P, zoomOnScroll: F, zoomOnPinch: I, panOnScroll: L, panOnScrollSpeed: R, panOnScrollMode: ee, zoomOnDoubleClick: z, panOnDrag: B, autoPanOnSelection: V, onPaneClick: H, onPaneMouseEnter: U, onPaneMouseMove: W, onPaneMouseLeave: te, onPaneScroll: ne, onPaneContextMenu: re, paneClickDistance: ie, nodeClickDistance:
|
|
6585
|
+
function sd({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: i, onNodeDoubleClick: a, onEdgeDoubleClick: o, onNodeMouseEnter: s, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: u, onSelectionContextMenu: d, onSelectionStart: f, onSelectionEnd: p, connectionLineType: m, connectionLineStyle: h, connectionLineComponent: v, connectionLineContainerStyle: y, selectionKeyCode: b, selectionOnDrag: x, selectionMode: S, multiSelectionKeyCode: C, panActivationKeyCode: w, zoomActivationKeyCode: T, deleteKeyCode: E, onlyRenderVisibleElements: D, elementsSelectable: O, defaultViewport: k, translateExtent: A, minZoom: j, maxZoom: M, preventScrolling: N, defaultMarkerColor: P, zoomOnScroll: F, zoomOnPinch: I, panOnScroll: L, panOnScrollSpeed: R, panOnScrollMode: ee, zoomOnDoubleClick: z, panOnDrag: B, autoPanOnSelection: V, onPaneClick: H, onPaneMouseEnter: U, onPaneMouseMove: W, onPaneMouseLeave: te, onPaneScroll: ne, onPaneContextMenu: re, paneClickDistance: ie, nodeClickDistance: ae, onEdgeContextMenu: G, onEdgeMouseEnter: oe, onEdgeMouseMove: se, onEdgeMouseLeave: ce, reconnectRadius: le, onReconnect: ue, onReconnectStart: de, onReconnectEnd: fe, noDragClassName: pe, noWheelClassName: me, noPanClassName: he, disableKeyboardA11y: ge, nodeExtent: _e, rfId: ve, viewport: ye, onViewportChange: be }) {
|
|
6586
6586
|
return ad(e), ad(t), od(), Yu(n), Zu(ye), g(Xl, {
|
|
6587
6587
|
onPaneClick: H,
|
|
6588
6588
|
onPaneMouseEnter: U,
|
|
@@ -6630,7 +6630,7 @@ function sd({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick
|
|
|
6630
6630
|
onReconnectStart: de,
|
|
6631
6631
|
onReconnectEnd: fe,
|
|
6632
6632
|
onlyRenderVisibleElements: D,
|
|
6633
|
-
onEdgeContextMenu:
|
|
6633
|
+
onEdgeContextMenu: G,
|
|
6634
6634
|
onEdgeMouseEnter: oe,
|
|
6635
6635
|
onEdgeMouseMove: se,
|
|
6636
6636
|
onEdgeMouseLeave: ce,
|
|
@@ -6655,7 +6655,7 @@ function sd({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick
|
|
|
6655
6655
|
onNodeMouseMove: c,
|
|
6656
6656
|
onNodeMouseLeave: l,
|
|
6657
6657
|
onNodeContextMenu: u,
|
|
6658
|
-
nodeClickDistance:
|
|
6658
|
+
nodeClickDistance: ae,
|
|
6659
6659
|
onlyRenderVisibleElements: D,
|
|
6660
6660
|
noPanClassName: he,
|
|
6661
6661
|
noDragClassName: pe,
|
|
@@ -7004,7 +7004,7 @@ var md = {
|
|
|
7004
7004
|
position: "relative",
|
|
7005
7005
|
zIndex: 0
|
|
7006
7006
|
};
|
|
7007
|
-
function hd({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i, nodeTypes: o, edgeTypes: s, onNodeClick: c, onEdgeClick: l, onInit: u, onMove: d, onMoveStart: f, onMoveEnd: p, onConnect: m, onConnectStart: h, onConnectEnd: v, onClickConnectStart: y, onClickConnectEnd: b, onNodeMouseEnter: x, onNodeMouseMove: S, onNodeMouseLeave: C, onNodeContextMenu: w, onNodeDoubleClick: T, onNodeDragStart: E, onNodeDrag: O, onNodeDragStop: k, onNodesDelete: A, onEdgesDelete: j, onDelete: M, onSelectionChange: N, onSelectionDragStart: P, onSelectionDrag: F, onSelectionDragStop: I, onSelectionContextMenu: L, onSelectionStart: R, onSelectionEnd: ee, onBeforeDelete: z, connectionMode: B, connectionLineType: V = Ta.Bezier, connectionLineStyle: H, connectionLineComponent: U, connectionLineContainerStyle: W, deleteKeyCode: te = "Backspace", selectionKeyCode: ne = "Shift", selectionOnDrag: re = !1, selectionMode: ie = Ca.Full, panActivationKeyCode:
|
|
7007
|
+
function hd({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i, nodeTypes: o, edgeTypes: s, onNodeClick: c, onEdgeClick: l, onInit: u, onMove: d, onMoveStart: f, onMoveEnd: p, onConnect: m, onConnectStart: h, onConnectEnd: v, onClickConnectStart: y, onClickConnectEnd: b, onNodeMouseEnter: x, onNodeMouseMove: S, onNodeMouseLeave: C, onNodeContextMenu: w, onNodeDoubleClick: T, onNodeDragStart: E, onNodeDrag: O, onNodeDragStop: k, onNodesDelete: A, onEdgesDelete: j, onDelete: M, onSelectionChange: N, onSelectionDragStart: P, onSelectionDrag: F, onSelectionDragStop: I, onSelectionContextMenu: L, onSelectionStart: R, onSelectionEnd: ee, onBeforeDelete: z, connectionMode: B, connectionLineType: V = Ta.Bezier, connectionLineStyle: H, connectionLineComponent: U, connectionLineContainerStyle: W, deleteKeyCode: te = "Backspace", selectionKeyCode: ne = "Shift", selectionOnDrag: re = !1, selectionMode: ie = Ca.Full, panActivationKeyCode: ae = "Space", multiSelectionKeyCode: G = lo() ? "Meta" : "Control", zoomActivationKeyCode: oe = lo() ? "Meta" : "Control", snapToGrid: se, snapGrid: ce, onlyRenderVisibleElements: le = !1, selectNodesOnDrag: ue, nodesDraggable: de, autoPanOnNodeFocus: fe, nodesConnectable: pe, nodesFocusable: me, nodeOrigin: he = Fc, edgesFocusable: ge, edgesReconnectable: _e, elementsSelectable: ve = !0, defaultViewport: ye = Ic, minZoom: be = .5, maxZoom: xe = 2, translateExtent: Se = va, preventScrolling: Ce = !0, nodeExtent: we, defaultMarkerColor: Te = "#b1b1b7", zoomOnScroll: Ee = !0, zoomOnPinch: De = !0, panOnScroll: Oe = !1, panOnScrollSpeed: ke = .5, panOnScrollMode: Ae = Sa.Free, zoomOnDoubleClick: je = !0, panOnDrag: Me = !0, onPaneClick: Ne, onPaneMouseEnter: Pe, onPaneMouseMove: Fe, onPaneMouseLeave: Ie, onPaneScroll: Le, onPaneContextMenu: Re, paneClickDistance: ze = 1, nodeClickDistance: Be = 0, children: Ve, onReconnect: He, onReconnectStart: Ue, onReconnectEnd: We, onEdgeContextMenu: Ge, onEdgeDoubleClick: Ke, onEdgeMouseEnter: qe, onEdgeMouseMove: Je, onEdgeMouseLeave: Ye, reconnectRadius: Xe = 10, onNodesChange: Ze, onEdgesChange: Qe, noDragClassName: $e = "nodrag", noWheelClassName: et = "nowheel", noPanClassName: tt = "nopan", fitView: nt, fitViewOptions: rt, connectOnClick: it, attributionPosition: at, proOptions: ot, defaultEdgeOptions: st, elevateNodesOnSelect: ct = !0, elevateEdgesOnSelect: lt = !1, disableKeyboardA11y: ut = !1, autoPanOnConnect: dt, autoPanOnNodeDrag: ft, autoPanOnSelection: pt = !0, autoPanSpeed: mt, connectionRadius: ht, isValidConnection: gt, onError: _t, style: vt, id: yt, nodeDragThreshold: bt, connectionDragThreshold: xt, viewport: St, onViewportChange: Ct, width: wt, height: Tt, colorMode: Et = "light", debug: Dt, onScroll: Ot, ariaLabelConfig: kt, zIndexMode: At = "basic", ...jt }, Mt) {
|
|
7008
7008
|
let Nt = yt || "1", Pt = Hc(Et), Ft = a((e) => {
|
|
7009
7009
|
e.currentTarget.scrollTo({
|
|
7010
7010
|
top: 0,
|
|
@@ -7121,8 +7121,8 @@ function hd({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i
|
|
|
7121
7121
|
selectionOnDrag: re,
|
|
7122
7122
|
selectionMode: ie,
|
|
7123
7123
|
deleteKeyCode: te,
|
|
7124
|
-
multiSelectionKeyCode:
|
|
7125
|
-
panActivationKeyCode:
|
|
7124
|
+
multiSelectionKeyCode: G,
|
|
7125
|
+
panActivationKeyCode: ae,
|
|
7126
7126
|
zoomActivationKeyCode: oe,
|
|
7127
7127
|
onlyRenderVisibleElements: le,
|
|
7128
7128
|
defaultViewport: ye,
|
|
@@ -7486,18 +7486,18 @@ var Ud = i(Hd), Wd = i(Vd), Gd = 200, Kd = 150, qd = (e) => !e.hidden, Jd = (e)
|
|
|
7486
7486
|
};
|
|
7487
7487
|
}, Yd = "react-flow__minimap-desc";
|
|
7488
7488
|
function Xd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: o = 5, nodeStrokeWidth: s, nodeComponent: l, bgColor: u, maskColor: f, maskStrokeColor: p, maskStrokeWidth: m, position: h = "bottom-right", onClick: v, onNodeClick: y, pannable: b = !1, zoomable: x = !1, ariaLabel: S, inversePan: C, zoomStep: w = 1, offsetScale: T = 5 }) {
|
|
7489
|
-
let E = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(Jd, X), L = e?.width ?? Gd, R = e?.height ?? Kd, ee = k.width / L, z = k.height / R, B = Math.max(ee, z), V = B * L, H = B * R, U = T * B, W = k.x - (V - k.width) / 2 - U, te = k.y - (H - k.height) / 2 - U, ne = V + U * 2, re = H + U * 2, ie = `${Yd}-${j}`,
|
|
7490
|
-
|
|
7491
|
-
if (O.current && M) return
|
|
7489
|
+
let E = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(Jd, X), L = e?.width ?? Gd, R = e?.height ?? Kd, ee = k.width / L, z = k.height / R, B = Math.max(ee, z), V = B * L, H = B * R, U = T * B, W = k.x - (V - k.width) / 2 - U, te = k.y - (H - k.height) / 2 - U, ne = V + U * 2, re = H + U * 2, ie = `${Yd}-${j}`, ae = d(0), G = d();
|
|
7490
|
+
ae.current = B, c(() => {
|
|
7491
|
+
if (O.current && M) return G.current = As({
|
|
7492
7492
|
domNode: O.current,
|
|
7493
7493
|
panZoom: M,
|
|
7494
7494
|
getTransform: () => E.getState().transform,
|
|
7495
|
-
getViewScale: () =>
|
|
7495
|
+
getViewScale: () => ae.current
|
|
7496
7496
|
}), () => {
|
|
7497
|
-
|
|
7497
|
+
G.current?.destroy();
|
|
7498
7498
|
};
|
|
7499
7499
|
}, [M]), c(() => {
|
|
7500
|
-
|
|
7500
|
+
G.current?.update({
|
|
7501
7501
|
translateExtent: N,
|
|
7502
7502
|
width: P,
|
|
7503
7503
|
height: F,
|
|
@@ -7516,7 +7516,7 @@ function Xd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7516
7516
|
F
|
|
7517
7517
|
]);
|
|
7518
7518
|
let oe = v ? (e) => {
|
|
7519
|
-
let [t, n] =
|
|
7519
|
+
let [t, n] = G.current?.pointer(e) || [0, 0];
|
|
7520
7520
|
v(e, {
|
|
7521
7521
|
x: t,
|
|
7522
7522
|
y: n
|
|
@@ -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,
|
|
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
|
|
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
|
|
7741
|
-
return
|
|
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
|
|
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
|
-
},
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
7843
|
-
return
|
|
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
|
|
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
|
|
7865
|
-
return
|
|
7862
|
+
function uf(e) {
|
|
7863
|
+
return lf[e] ?? "CUSTOM";
|
|
7866
7864
|
}
|
|
7867
|
-
var
|
|
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
|
|
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
|
|
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
|
|
7925
|
-
let n =
|
|
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
|
|
7932
|
+
function hf(e) {
|
|
7935
7933
|
return e.replace(/\.\d{3}$/, "");
|
|
7936
7934
|
}
|
|
7937
|
-
function
|
|
7938
|
-
let n =
|
|
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
|
|
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
|
|
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:
|
|
7980
|
-
defaultValue:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
8018
|
+
return vf(t, n);
|
|
8021
8019
|
});
|
|
8022
|
-
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i =
|
|
8023
|
-
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ?
|
|
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 ||
|
|
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:
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
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) =>
|
|
8100
|
-
outputs: e.outputs.map((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
|
|
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
|
|
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:
|
|
8134
|
+
h: Tf(e)
|
|
8137
8135
|
};
|
|
8138
8136
|
}
|
|
8139
|
-
function
|
|
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 } =
|
|
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
|
|
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
|
|
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
|
|
8243
|
-
let t = new Set(e.edges.map((e) => e.targetSocketId)), n =
|
|
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 =
|
|
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])),
|
|
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
|
-
|
|
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
|
-
|
|
8255
|
-
|
|
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:
|
|
8254
|
+
id: `zone:simulation:${i.id}`,
|
|
8258
8255
|
type: "simulationZone",
|
|
8259
8256
|
position: {
|
|
8260
8257
|
x: e,
|
|
8261
|
-
y:
|
|
8258
|
+
y: t
|
|
8262
8259
|
},
|
|
8263
8260
|
draggable: !1,
|
|
8264
8261
|
selectable: !1,
|
|
8265
8262
|
connectable: !1,
|
|
8266
|
-
data: {
|
|
8263
|
+
data: {},
|
|
8267
8264
|
style: {
|
|
8268
|
-
width:
|
|
8269
|
-
height:
|
|
8265
|
+
width: n,
|
|
8266
|
+
height: a,
|
|
8270
8267
|
zIndex: -10
|
|
8271
8268
|
}
|
|
8272
|
-
}, ...r
|
|
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
|
|
8288
|
+
function jf(e, t) {
|
|
8300
8289
|
return Math.sqrt(e * e + t * t);
|
|
8301
8290
|
}
|
|
8302
|
-
function
|
|
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 =
|
|
8313
|
-
let n = e / u + i / d, r = t / u + a / d, o =
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
8456
|
-
function
|
|
8457
|
-
let a =
|
|
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 ?
|
|
8462
|
+
return s === 1 ? Rf(c(a + 1, o)) : s === 2 ? Rf(c(a, o + 1)) : c(a, o);
|
|
8474
8463
|
}
|
|
8475
|
-
function
|
|
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" ?
|
|
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
|
-
|
|
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
|
|
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
|
|
8527
|
-
let i = (e) => Math.round(
|
|
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
|
|
8519
|
+
var Uf = {
|
|
8531
8520
|
NEAR: "Near",
|
|
8532
8521
|
FAR: "Far",
|
|
8533
8522
|
CW: "CW",
|
|
8534
8523
|
CCW: "CCW"
|
|
8535
|
-
},
|
|
8536
|
-
function
|
|
8524
|
+
}, Wf = 64;
|
|
8525
|
+
function Gf({ data: e, width: t }) {
|
|
8537
8526
|
let n = [];
|
|
8538
|
-
for (let t = 0; t <=
|
|
8539
|
-
let r = t /
|
|
8540
|
-
n.push(`${
|
|
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:
|
|
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:
|
|
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
|
|
8583
|
-
function
|
|
8584
|
-
return o(
|
|
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
|
|
8577
|
+
var Jf = [
|
|
8589
8578
|
"X",
|
|
8590
8579
|
"Y",
|
|
8591
8580
|
"Z",
|
|
8592
8581
|
"W"
|
|
8593
|
-
],
|
|
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
|
-
},
|
|
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
|
|
8648
|
-
return e === "data_type" ?
|
|
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
|
|
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
|
|
8648
|
+
function $f(e) {
|
|
8660
8649
|
return e === "ROTATION" ? "Β°" : e === "FLOAT" ? " m" : "";
|
|
8661
8650
|
}
|
|
8662
|
-
function
|
|
8651
|
+
function ep(e) {
|
|
8663
8652
|
return parseFloat(e.toFixed(3)).toString();
|
|
8664
8653
|
}
|
|
8665
|
-
function
|
|
8666
|
-
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${
|
|
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
|
|
8657
|
+
function np(e) {
|
|
8669
8658
|
return Math.round(Math.min(1, Math.max(0, e)) * 255);
|
|
8670
8659
|
}
|
|
8671
|
-
function
|
|
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(${
|
|
8664
|
+
style: { background: `rgba(${np(t)},${np(n)},${np(r)},${i.toFixed(2)})` }
|
|
8676
8665
|
});
|
|
8677
8666
|
}
|
|
8678
|
-
function
|
|
8679
|
-
if (e.dataType === "RGBA") return /* @__PURE__ */ g(
|
|
8680
|
-
let t =
|
|
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:
|
|
8676
|
+
children: Jf[n]
|
|
8688
8677
|
}), /* @__PURE__ */ _("span", {
|
|
8689
8678
|
className: "gn-node__vec-value",
|
|
8690
|
-
children: [
|
|
8679
|
+
children: [ep(e), t]
|
|
8691
8680
|
})]
|
|
8692
8681
|
}, n))
|
|
8693
8682
|
});
|
|
8694
8683
|
}
|
|
8695
|
-
function
|
|
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:
|
|
8690
|
+
children: Zf(e, t)
|
|
8702
8691
|
}, e))
|
|
8703
8692
|
});
|
|
8704
8693
|
}
|
|
8705
|
-
var
|
|
8706
|
-
function
|
|
8707
|
-
let n = Math.max(10, t -
|
|
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
|
|
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 ${
|
|
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:
|
|
8749
|
+
children: tp(t.defaultValue.value, t.dataType)
|
|
8761
8750
|
}) : null
|
|
8762
8751
|
]
|
|
8763
8752
|
});
|
|
8764
8753
|
}
|
|
8765
|
-
function
|
|
8754
|
+
function up(e, t) {
|
|
8766
8755
|
return !t && !e.hideValue && e.defaultValue?.kind === "vec";
|
|
8767
8756
|
}
|
|
8768
|
-
function
|
|
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
|
|
8780
|
-
let t = e.data, 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(
|
|
8796
|
-
t.properties && /* @__PURE__ */ g(
|
|
8797
|
-
t.floatCurve && /* @__PURE__ */ g(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
-
}),
|
|
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
|
|
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
|
|
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: "
|
|
8864
|
-
background: "rgba(
|
|
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
|
|
8859
|
+
function hp(e) {
|
|
8883
8860
|
let t = e.data;
|
|
8884
8861
|
return /* @__PURE__ */ g("div", {
|
|
8885
8862
|
className: "gn-node-frame",
|
|
@@ -8909,53 +8886,53 @@ function gp(e) {
|
|
|
8909
8886
|
}
|
|
8910
8887
|
//#endregion
|
|
8911
8888
|
//#region src/gn/components/GeometryNodesFlow.tsx
|
|
8912
|
-
var
|
|
8913
|
-
gnNode:
|
|
8914
|
-
rerouteNode:
|
|
8915
|
-
simulationZone:
|
|
8916
|
-
nodeFrame:
|
|
8917
|
-
},
|
|
8918
|
-
function
|
|
8919
|
-
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"),
|
|
8889
|
+
var gp = {
|
|
8890
|
+
gnNode: fp,
|
|
8891
|
+
rerouteNode: pp,
|
|
8892
|
+
simulationZone: mp,
|
|
8893
|
+
nodeFrame: hp
|
|
8894
|
+
}, _p = { padding: .08 };
|
|
8895
|
+
function vp(e) {
|
|
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 = d(-Infinity), [P, F] = f(!1), [I, L] = f(!1), R = d([]), [ee, z, B] = _d(t), [V, H, U] = vd(n), [W, te] = f(void 0);
|
|
8920
8897
|
c(() => {
|
|
8921
8898
|
if (!v) return;
|
|
8922
8899
|
let e = h(m());
|
|
8923
|
-
|
|
8900
|
+
te([[e.x, e.y], [e.x + e.width, e.y + e.height]]);
|
|
8924
8901
|
}, [
|
|
8925
8902
|
v,
|
|
8926
8903
|
t,
|
|
8927
8904
|
m,
|
|
8928
8905
|
h
|
|
8929
8906
|
]), c(() => {
|
|
8930
|
-
|
|
8907
|
+
z(t), s?.([]), b.current = !1, p(_p);
|
|
8931
8908
|
}, [
|
|
8932
8909
|
t,
|
|
8933
|
-
|
|
8910
|
+
z,
|
|
8934
8911
|
s,
|
|
8935
8912
|
p
|
|
8936
8913
|
]), c(() => {
|
|
8937
|
-
|
|
8938
|
-
}, [n,
|
|
8914
|
+
H(n);
|
|
8915
|
+
}, [n, H]), c(() => {
|
|
8939
8916
|
let e = y.current;
|
|
8940
8917
|
if (!e) return;
|
|
8941
8918
|
let t = new ResizeObserver(() => {
|
|
8942
|
-
b.current || p(
|
|
8919
|
+
b.current || p(_p);
|
|
8943
8920
|
});
|
|
8944
8921
|
return t.observe(e), () => t.disconnect();
|
|
8945
8922
|
}, [p]);
|
|
8946
|
-
let
|
|
8923
|
+
let ne = a((e) => {
|
|
8947
8924
|
e && (b.current = !0);
|
|
8948
|
-
}, []),
|
|
8925
|
+
}, []), re = a(({ nodes: e }) => {
|
|
8949
8926
|
let t = e.map((e) => e.id);
|
|
8950
8927
|
x.current = t, s?.(t);
|
|
8951
|
-
}, [s]),
|
|
8928
|
+
}, [s]), ie = a((e) => {
|
|
8952
8929
|
e.preventDefault();
|
|
8953
8930
|
let t = y.current?.getBoundingClientRect();
|
|
8954
8931
|
C({
|
|
8955
8932
|
x: e.clientX - (t?.left ?? 0),
|
|
8956
8933
|
y: e.clientY - (t?.top ?? 0)
|
|
8957
8934
|
});
|
|
8958
|
-
}, []),
|
|
8935
|
+
}, []), ae = a(async () => {
|
|
8959
8936
|
C(null);
|
|
8960
8937
|
try {
|
|
8961
8938
|
let e = JSON.parse(r), t = new Set(x.current.map(Number).filter(Number.isFinite)), n = t.size > 0 ? E(e, t) : e, i = await T(JSON.stringify(n));
|
|
@@ -8963,23 +8940,24 @@ function yp(e) {
|
|
|
8963
8940
|
l();
|
|
8964
8941
|
return;
|
|
8965
8942
|
}
|
|
8966
|
-
|
|
8967
|
-
|
|
8943
|
+
R.current.forEach(clearTimeout), L(!1), F(!0), R.current = [setTimeout(() => L(!0), 2500), setTimeout(() => {
|
|
8944
|
+
F(!1), L(!1);
|
|
8968
8945
|
}, 3e3)];
|
|
8969
8946
|
} catch {}
|
|
8970
8947
|
}, [r, l]);
|
|
8971
|
-
c(() => () =>
|
|
8948
|
+
c(() => () => R.current.forEach(clearTimeout), []), c(() => () => {
|
|
8972
8949
|
A.current && clearTimeout(A.current);
|
|
8973
8950
|
}, []);
|
|
8974
|
-
let G = u === "hybrid",
|
|
8951
|
+
let G = u === "hybrid", oe = u === "always" || G && w, se = oe && j === "mouse", ce = oe && j === "trackpad", le = [1], ue = a((e) => {
|
|
8975
8952
|
if (!e.ctrlKey) {
|
|
8976
|
-
|
|
8953
|
+
e.deltaX !== 0 && (N.current = e.timeStamp);
|
|
8954
|
+
let t = e.timeStamp - N.current < 400 ? "trackpad" : "mouse";
|
|
8977
8955
|
M((e) => e === t ? e : t);
|
|
8978
8956
|
}
|
|
8979
8957
|
G && !w && !e.ctrlKey && (k(!0), A.current && clearTimeout(A.current), A.current = setTimeout(() => k(!1), 1600));
|
|
8980
|
-
}, [G, w]),
|
|
8958
|
+
}, [G, w]), de = a((e) => {
|
|
8981
8959
|
G && e.button === 0 && (D(!0), k(!1));
|
|
8982
|
-
}, [G]),
|
|
8960
|
+
}, [G]), fe = a(() => {
|
|
8983
8961
|
G && D(!1);
|
|
8984
8962
|
}, [G]);
|
|
8985
8963
|
return c(() => {
|
|
@@ -8998,23 +8976,23 @@ function yp(e) {
|
|
|
8998
8976
|
height: "100%",
|
|
8999
8977
|
position: "relative"
|
|
9000
8978
|
},
|
|
9001
|
-
onContextMenu:
|
|
9002
|
-
onPointerDown:
|
|
9003
|
-
onPointerLeave:
|
|
9004
|
-
onWheel:
|
|
8979
|
+
onContextMenu: ie,
|
|
8980
|
+
onPointerDown: de,
|
|
8981
|
+
onPointerLeave: fe,
|
|
8982
|
+
onWheel: ue,
|
|
9005
8983
|
children: [
|
|
9006
8984
|
/* @__PURE__ */ _(gd, {
|
|
9007
|
-
nodes:
|
|
9008
|
-
edges:
|
|
9009
|
-
onNodesChange:
|
|
9010
|
-
onEdgesChange:
|
|
9011
|
-
onSelectionChange:
|
|
9012
|
-
onMoveStart:
|
|
9013
|
-
nodeTypes:
|
|
8985
|
+
nodes: ee,
|
|
8986
|
+
edges: V,
|
|
8987
|
+
onNodesChange: B,
|
|
8988
|
+
onEdgesChange: U,
|
|
8989
|
+
onSelectionChange: re,
|
|
8990
|
+
onMoveStart: ne,
|
|
8991
|
+
nodeTypes: gp,
|
|
9014
8992
|
fitView: !0,
|
|
9015
|
-
fitViewOptions:
|
|
8993
|
+
fitViewOptions: _p,
|
|
9016
8994
|
minZoom: .2,
|
|
9017
|
-
translateExtent:
|
|
8995
|
+
translateExtent: W,
|
|
9018
8996
|
nodesDraggable: !1,
|
|
9019
8997
|
nodesConnectable: !1,
|
|
9020
8998
|
elementsSelectable: !0,
|
|
@@ -9024,10 +9002,10 @@ function yp(e) {
|
|
|
9024
9002
|
selectionOnDrag: !0,
|
|
9025
9003
|
selectionMode: Ca.Partial,
|
|
9026
9004
|
connectOnClick: !1,
|
|
9027
|
-
panOnDrag:
|
|
9028
|
-
zoomOnScroll:
|
|
9029
|
-
panOnScroll:
|
|
9030
|
-
preventScrolling:
|
|
9005
|
+
panOnDrag: le,
|
|
9006
|
+
zoomOnScroll: se,
|
|
9007
|
+
panOnScroll: ce,
|
|
9008
|
+
preventScrolling: oe,
|
|
9031
9009
|
zoomOnDoubleClick: !1,
|
|
9032
9010
|
children: [
|
|
9033
9011
|
/* @__PURE__ */ g(Dd, {
|
|
@@ -9050,7 +9028,7 @@ function yp(e) {
|
|
|
9050
9028
|
className: "gn-top-left",
|
|
9051
9029
|
children: [/* @__PURE__ */ _("span", {
|
|
9052
9030
|
className: "gn-version-badge",
|
|
9053
|
-
children: ["node-web-render v", "0.3.
|
|
9031
|
+
children: ["node-web-render v", "0.3.21"]
|
|
9054
9032
|
}), i.length > 1 ? /* @__PURE__ */ g("nav", {
|
|
9055
9033
|
className: "gn-breadcrumbs",
|
|
9056
9034
|
"aria-label": "Node group path",
|
|
@@ -9091,31 +9069,31 @@ function yp(e) {
|
|
|
9091
9069
|
type: "button",
|
|
9092
9070
|
className: "gn-context-menu__item",
|
|
9093
9071
|
role: "menuitem",
|
|
9094
|
-
onClick:
|
|
9072
|
+
onClick: ae,
|
|
9095
9073
|
children: "Copy selected nodes to Tree Clipper magic string"
|
|
9096
9074
|
})
|
|
9097
9075
|
}) : null,
|
|
9098
|
-
|
|
9099
|
-
className: `gn-context-toast${
|
|
9076
|
+
P || I ? /* @__PURE__ */ g("div", {
|
|
9077
|
+
className: `gn-context-toast${I ? " gnwr-leaving" : ""}`,
|
|
9100
9078
|
role: "status",
|
|
9101
9079
|
children: "Copied Tree Clipper magic string"
|
|
9102
9080
|
}) : null
|
|
9103
9081
|
]
|
|
9104
9082
|
});
|
|
9105
9083
|
}
|
|
9106
|
-
function
|
|
9084
|
+
function yp(e) {
|
|
9107
9085
|
let { jsonText: t, showHeader: n = !0, onSelectionChange: r, onCopiedMagicString: i, interaction: o = "always" } = e, [s, l] = f({
|
|
9108
9086
|
json: t,
|
|
9109
9087
|
ids: []
|
|
9110
9088
|
}), d = u(() => {
|
|
9111
9089
|
if (!t.trim()) return null;
|
|
9112
9090
|
try {
|
|
9113
|
-
let { rootId: e, trees: n } =
|
|
9091
|
+
let { rootId: e, trees: n } = xf(JSON.parse(t)), r = {};
|
|
9114
9092
|
for (let e of Object.values(n)) {
|
|
9115
|
-
let t =
|
|
9093
|
+
let t = wf(e);
|
|
9116
9094
|
r[t.id] = {
|
|
9117
9095
|
graph: t,
|
|
9118
|
-
flow:
|
|
9096
|
+
flow: Af(t)
|
|
9119
9097
|
};
|
|
9120
9098
|
}
|
|
9121
9099
|
return {
|
|
@@ -9179,9 +9157,9 @@ function bp(e) {
|
|
|
9179
9157
|
className: "flow-error",
|
|
9180
9158
|
role: "alert",
|
|
9181
9159
|
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: d.error })]
|
|
9182
|
-
}) : m ? /* @__PURE__ */ g(
|
|
9160
|
+
}) : m ? /* @__PURE__ */ g(Kf.Provider, {
|
|
9183
9161
|
value: v,
|
|
9184
|
-
children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(
|
|
9162
|
+
children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(vp, {
|
|
9185
9163
|
nodes: m.flow.nodes,
|
|
9186
9164
|
edges: m.flow.edges,
|
|
9187
9165
|
jsonText: t,
|
|
@@ -9203,7 +9181,7 @@ function bp(e) {
|
|
|
9203
9181
|
}
|
|
9204
9182
|
//#endregion
|
|
9205
9183
|
//#region src/components/TreeClipperLogo.tsx
|
|
9206
|
-
function
|
|
9184
|
+
function bp({ className: e }) {
|
|
9207
9185
|
return /* @__PURE__ */ _("svg", {
|
|
9208
9186
|
viewBox: "0 0 256 256",
|
|
9209
9187
|
className: e,
|
|
@@ -9264,7 +9242,7 @@ function xp({ className: e }) {
|
|
|
9264
9242
|
}
|
|
9265
9243
|
//#endregion
|
|
9266
9244
|
//#region src/embed.tsx
|
|
9267
|
-
function
|
|
9245
|
+
function xp(e) {
|
|
9268
9246
|
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
9247
|
!S.current || b.current || (y(!0), D.current && clearTimeout(D.current), D.current = setTimeout(() => {
|
|
9270
9248
|
m(!1), y(!1);
|
|
@@ -9308,7 +9286,7 @@ function Sp(e) {
|
|
|
9308
9286
|
className: "gnwr-loading",
|
|
9309
9287
|
role: "status",
|
|
9310
9288
|
"aria-live": "polite",
|
|
9311
|
-
children: [/* @__PURE__ */ g(
|
|
9289
|
+
children: [/* @__PURE__ */ g(bp, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
|
|
9312
9290
|
className: "gnwr-loading__label",
|
|
9313
9291
|
children: "Loading graphβ¦"
|
|
9314
9292
|
})]
|
|
@@ -9317,7 +9295,7 @@ function Sp(e) {
|
|
|
9317
9295
|
role: "alert",
|
|
9318
9296
|
children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
|
|
9319
9297
|
}) : /* @__PURE__ */ _(h, { children: [
|
|
9320
|
-
/* @__PURE__ */ g(
|
|
9298
|
+
/* @__PURE__ */ g(yp, {
|
|
9321
9299
|
jsonText: n,
|
|
9322
9300
|
showHeader: !1,
|
|
9323
9301
|
interaction: "hybrid",
|
|
@@ -9343,7 +9321,7 @@ function Sp(e) {
|
|
|
9343
9321
|
strokeLinecap: "round",
|
|
9344
9322
|
strokeLinejoin: "round"
|
|
9345
9323
|
})
|
|
9346
|
-
}), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
9324
|
+
}), /* @__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
9325
|
}),
|
|
9348
9326
|
(p || v) && /* @__PURE__ */ _("div", {
|
|
9349
9327
|
className: `gnwr-copy-toast${v ? " gnwr-leaving" : ""}`,
|
|
@@ -9368,22 +9346,22 @@ function Sp(e) {
|
|
|
9368
9346
|
})
|
|
9369
9347
|
});
|
|
9370
9348
|
}
|
|
9371
|
-
var
|
|
9372
|
-
function
|
|
9373
|
-
|
|
9349
|
+
var Sp = /* @__PURE__ */ new Map(), Cp = null;
|
|
9350
|
+
function wp(e, t) {
|
|
9351
|
+
Sp.get(e)?.unmount();
|
|
9374
9352
|
let r = m(e);
|
|
9375
|
-
|
|
9353
|
+
Sp.set(e, r), Cp = e;
|
|
9376
9354
|
let i = t.onClose;
|
|
9377
|
-
return r.render(n(
|
|
9355
|
+
return r.render(n(xp, {
|
|
9378
9356
|
...t,
|
|
9379
9357
|
onClose: i ? () => {
|
|
9380
|
-
|
|
9358
|
+
Tp(e), i();
|
|
9381
9359
|
} : void 0
|
|
9382
|
-
})), () =>
|
|
9360
|
+
})), () => Tp(e);
|
|
9383
9361
|
}
|
|
9384
|
-
function
|
|
9385
|
-
let t = e ??
|
|
9386
|
-
t && (
|
|
9362
|
+
function Tp(e) {
|
|
9363
|
+
let t = e ?? Cp;
|
|
9364
|
+
t && (Sp.get(t)?.unmount(), Sp.delete(t), t === Cp && (Cp = null));
|
|
9387
9365
|
}
|
|
9388
9366
|
//#endregion
|
|
9389
|
-
export {
|
|
9367
|
+
export { xp as GraphView, wp as mountGraphView, Tp as unmountGraphView };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function SimulationZoneFrame(props: NodeProps): import("react").JSX.Element;
|
|
1
|
+
export declare function SimulationZoneFrame(): import("react").JSX.Element;
|
package/package.json
CHANGED