@awesome-flow/noise 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract/index.cjs +6 -6
- package/dist/abstract/index.d.cts +10 -8
- package/dist/abstract/index.d.ts +10 -8
- package/dist/abstract/index.js +5 -5
- package/dist/chunk-4YL2V7SE.js +641 -0
- package/dist/chunk-76MMGOOY.cjs +1008 -0
- package/dist/{chunk-BG6U3TYO.js → chunk-BE4RLT5P.js} +445 -178
- package/dist/chunk-D5QJ3563.cjs +641 -0
- package/dist/chunk-EHBNVDTI.js +60 -0
- package/dist/chunk-L45ZU7VL.js +1008 -0
- package/dist/{chunk-ACWBUUZ7.cjs → chunk-MIYOMNAG.cjs} +467 -200
- package/dist/chunk-O5DVJAMK.cjs +974 -0
- package/dist/chunk-S2ZGHJ75.js +974 -0
- package/dist/chunk-X2GXADE5.cjs +60 -0
- package/dist/{index-mlK0X4O1.d.ts → index-DAAmYCPU.d.ts} +1 -1
- package/dist/{index-CfiOpOzX.d.cts → index-EzT2GjIx.d.cts} +1 -1
- package/dist/{node-props-CAV2WNDN.d.ts → node-props-D8SnrgWa.d.cts} +1 -1
- package/dist/{node-props-CAV2WNDN.d.cts → node-props-D8SnrgWa.d.ts} +1 -1
- package/dist/nodes/generators/index.cjs +2 -2
- package/dist/nodes/generators/index.d.cts +1 -1
- package/dist/nodes/generators/index.d.ts +1 -1
- package/dist/nodes/generators/index.js +1 -1
- package/dist/nodes/groups/index.cjs +2 -2
- package/dist/nodes/groups/index.d.cts +1 -1
- package/dist/nodes/groups/index.d.ts +1 -1
- package/dist/nodes/groups/index.js +1 -1
- package/dist/nodes/index.cjs +6 -6
- package/dist/nodes/index.d.cts +4 -2
- package/dist/nodes/index.d.ts +4 -2
- package/dist/nodes/index.js +5 -5
- package/dist/nodes/modifiers/index.cjs +2 -2
- package/dist/nodes/modifiers/index.d.cts +6 -19
- package/dist/nodes/modifiers/index.d.ts +6 -19
- package/dist/nodes/modifiers/index.js +1 -1
- package/dist/nodes/output/index.cjs +6 -6
- package/dist/nodes/output/index.js +5 -5
- package/dist/nodes/selectors/index.cjs +6 -6
- package/dist/nodes/selectors/index.d.cts +1 -1
- package/dist/nodes/selectors/index.d.ts +1 -1
- package/dist/nodes/selectors/index.js +5 -5
- package/dist/nodes/transformers/index.cjs +2 -2
- package/dist/nodes/transformers/index.d.cts +1 -1
- package/dist/nodes/transformers/index.d.ts +1 -1
- package/dist/nodes/transformers/index.js +1 -1
- package/dist/noise-terrace-node-D2ezdTnC.d.cts +22 -0
- package/dist/noise-terrace-node-DW81ZQk6.d.ts +22 -0
- package/dist/templates/generators/index.cjs +6 -6
- package/dist/templates/generators/index.d.cts +1 -1
- package/dist/templates/generators/index.d.ts +1 -1
- package/dist/templates/generators/index.js +5 -5
- package/dist/templates/groups/index.cjs +6 -6
- package/dist/templates/groups/index.js +5 -5
- package/dist/templates/index.cjs +6 -6
- package/dist/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- package/dist/templates/index.js +5 -5
- package/dist/templates/modifiers/index.cjs +6 -6
- package/dist/templates/modifiers/index.d.cts +1 -1
- package/dist/templates/modifiers/index.d.ts +1 -1
- package/dist/templates/modifiers/index.js +5 -5
- package/dist/templates/output/index.cjs +6 -6
- package/dist/templates/output/index.js +5 -5
- package/dist/templates/selectors/index.cjs +6 -6
- package/dist/templates/selectors/index.d.cts +1 -1
- package/dist/templates/selectors/index.d.ts +1 -1
- package/dist/templates/selectors/index.js +5 -5
- package/dist/templates/transformers/index.cjs +6 -6
- package/dist/templates/transformers/index.d.cts +2 -2
- package/dist/templates/transformers/index.d.ts +2 -2
- package/dist/templates/transformers/index.js +5 -5
- package/package.json +15 -14
- package/dist/chunk-D5JM4EYQ.cjs +0 -305
- package/dist/chunk-DWSACR65.js +0 -305
- package/dist/chunk-KHIIB5TH.js +0 -93
- package/dist/chunk-M67JHEU2.cjs +0 -93
- package/dist/chunk-PS5VUND5.js +0 -348
- package/dist/chunk-RDQ4BOOV.js +0 -522
- package/dist/chunk-RKTZQUWR.cjs +0 -348
- package/dist/chunk-TZCT2GZV.cjs +0 -522
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
// src/nodes/transformers/noise-displace-node.tsx
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
|
|
4
|
+
import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
|
|
5
|
+
import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
|
|
6
|
+
import { Displace } from "libnoise-simplex-ts";
|
|
7
|
+
|
|
8
|
+
// src/abstract/handle-types.ts
|
|
9
|
+
var NoiseHandleType = /* @__PURE__ */ ((NoiseHandleType2) => {
|
|
10
|
+
NoiseHandleType2["texture"] = "texture";
|
|
11
|
+
NoiseHandleType2["noise"] = "noise";
|
|
12
|
+
NoiseHandleType2["position"] = "position";
|
|
13
|
+
NoiseHandleType2["module"] = "module";
|
|
14
|
+
return NoiseHandleType2;
|
|
15
|
+
})(NoiseHandleType || {});
|
|
16
|
+
var DisplacementHandle = /* @__PURE__ */ ((DisplacementHandle2) => {
|
|
17
|
+
DisplacementHandle2["sourceModule"] = "source";
|
|
18
|
+
DisplacementHandle2["xModule"] = "x-module";
|
|
19
|
+
DisplacementHandle2["yModule"] = "y-module";
|
|
20
|
+
DisplacementHandle2["zModule"] = "z-module";
|
|
21
|
+
DisplacementHandle2["output"] = "output";
|
|
22
|
+
return DisplacementHandle2;
|
|
23
|
+
})(DisplacementHandle || {});
|
|
24
|
+
var NoiseSourceControlHandle = /* @__PURE__ */ ((NoiseSourceControlHandle2) => {
|
|
25
|
+
NoiseSourceControlHandle2["source"] = "source";
|
|
26
|
+
NoiseSourceControlHandle2["control"] = "control";
|
|
27
|
+
NoiseSourceControlHandle2["output"] = "output";
|
|
28
|
+
return NoiseSourceControlHandle2;
|
|
29
|
+
})(NoiseSourceControlHandle || {});
|
|
30
|
+
|
|
31
|
+
// src/nodes/transformers/noise-displace-node.tsx
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
function NoiseDisplaceNode(t0) {
|
|
34
|
+
const $ = _c(17);
|
|
35
|
+
const {
|
|
36
|
+
id,
|
|
37
|
+
selected,
|
|
38
|
+
data,
|
|
39
|
+
type
|
|
40
|
+
} = t0;
|
|
41
|
+
const updateComputedData = useUpdateNodeComputedData();
|
|
42
|
+
let t1;
|
|
43
|
+
if ($[0] !== id || $[1] !== updateComputedData) {
|
|
44
|
+
t1 = (handleData) => {
|
|
45
|
+
const sourceModule = handleData["source" /* sourceModule */];
|
|
46
|
+
const xModule = handleData["x-module" /* xModule */];
|
|
47
|
+
const yModule = handleData["y-module" /* yModule */];
|
|
48
|
+
const zModule = handleData["z-module" /* zModule */];
|
|
49
|
+
if (sourceModule && xModule && yModule && zModule) {
|
|
50
|
+
const module = new Displace(sourceModule[0].module, xModule[0].module, yModule[0].module, zModule[0].module);
|
|
51
|
+
updateComputedData(id, {
|
|
52
|
+
module
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
$[0] = id;
|
|
57
|
+
$[1] = updateComputedData;
|
|
58
|
+
$[2] = t1;
|
|
59
|
+
} else {
|
|
60
|
+
t1 = $[2];
|
|
61
|
+
}
|
|
62
|
+
const onDataUpdated = t1;
|
|
63
|
+
let t2;
|
|
64
|
+
if ($[3] !== data.handles || $[4] !== id || $[5] !== onDataUpdated) {
|
|
65
|
+
t2 = /* @__PURE__ */ jsx(HandlesIncomingDataStatus, { nodeId: id, handles: data.handles, handleKey: "dataId", onDataUpdated, type: "target", resetComputedData: true });
|
|
66
|
+
$[3] = data.handles;
|
|
67
|
+
$[4] = id;
|
|
68
|
+
$[5] = onDataUpdated;
|
|
69
|
+
$[6] = t2;
|
|
70
|
+
} else {
|
|
71
|
+
t2 = $[6];
|
|
72
|
+
}
|
|
73
|
+
let t3;
|
|
74
|
+
if ($[7] !== data.handles || $[8] !== id) {
|
|
75
|
+
t3 = /* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" });
|
|
76
|
+
$[7] = data.handles;
|
|
77
|
+
$[8] = id;
|
|
78
|
+
$[9] = t3;
|
|
79
|
+
} else {
|
|
80
|
+
t3 = $[9];
|
|
81
|
+
}
|
|
82
|
+
let t4;
|
|
83
|
+
if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t2 || $[14] !== t3 || $[15] !== type) {
|
|
84
|
+
t4 = /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
|
|
85
|
+
t2,
|
|
86
|
+
t3
|
|
87
|
+
] });
|
|
88
|
+
$[10] = data;
|
|
89
|
+
$[11] = id;
|
|
90
|
+
$[12] = selected;
|
|
91
|
+
$[13] = t2;
|
|
92
|
+
$[14] = t3;
|
|
93
|
+
$[15] = type;
|
|
94
|
+
$[16] = t4;
|
|
95
|
+
} else {
|
|
96
|
+
t4 = $[16];
|
|
97
|
+
}
|
|
98
|
+
return t4;
|
|
99
|
+
}
|
|
100
|
+
var noise_displace_node_default = NoiseDisplaceNode;
|
|
101
|
+
|
|
102
|
+
// src/nodes/transformers/noise-rotate-point-node.tsx
|
|
103
|
+
import { c as _c2 } from "react/compiler-runtime";
|
|
104
|
+
import { useIncomingComputedData, useUpdateNodeComputedData as useUpdateNodeComputedData2, useUpdateNodeData } from "@awesome-flow/core/hooks";
|
|
105
|
+
import { NodeContainer as NodeContainer2, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
|
|
106
|
+
import { Group, NumberInput, Stack } from "@mantine/core";
|
|
107
|
+
import { RotatePoint } from "libnoise-simplex-ts";
|
|
108
|
+
import { useEffect, useState } from "react";
|
|
109
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
110
|
+
function NoiseRotatePointNode(t0) {
|
|
111
|
+
const $ = _c2(32);
|
|
112
|
+
const {
|
|
113
|
+
id,
|
|
114
|
+
selected,
|
|
115
|
+
data,
|
|
116
|
+
type
|
|
117
|
+
} = t0;
|
|
118
|
+
const [xAngle, setXAngle] = useState(data.xAngle);
|
|
119
|
+
const [yAngle, setYAngle] = useState(data.yAngle);
|
|
120
|
+
const [zAngle, setZAngle] = useState(data.zAngle);
|
|
121
|
+
const incoming = useIncomingComputedData(id);
|
|
122
|
+
const updateNodeData = useUpdateNodeData();
|
|
123
|
+
const updateComputedData = useUpdateNodeComputedData2();
|
|
124
|
+
let t1;
|
|
125
|
+
let t2;
|
|
126
|
+
if ($[0] !== id || $[1] !== incoming || $[2] !== updateComputedData || $[3] !== updateNodeData || $[4] !== xAngle || $[5] !== yAngle || $[6] !== zAngle) {
|
|
127
|
+
t1 = () => {
|
|
128
|
+
if (incoming?.length) {
|
|
129
|
+
const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
|
|
130
|
+
updateComputedData(id, {
|
|
131
|
+
module
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
updateNodeData(id, {
|
|
135
|
+
xAngle,
|
|
136
|
+
yAngle,
|
|
137
|
+
zAngle
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
t2 = [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle];
|
|
141
|
+
$[0] = id;
|
|
142
|
+
$[1] = incoming;
|
|
143
|
+
$[2] = updateComputedData;
|
|
144
|
+
$[3] = updateNodeData;
|
|
145
|
+
$[4] = xAngle;
|
|
146
|
+
$[5] = yAngle;
|
|
147
|
+
$[6] = zAngle;
|
|
148
|
+
$[7] = t1;
|
|
149
|
+
$[8] = t2;
|
|
150
|
+
} else {
|
|
151
|
+
t1 = $[7];
|
|
152
|
+
t2 = $[8];
|
|
153
|
+
}
|
|
154
|
+
useEffect(t1, t2);
|
|
155
|
+
let t3;
|
|
156
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
157
|
+
t3 = (e) => setXAngle(Number(e));
|
|
158
|
+
$[9] = t3;
|
|
159
|
+
} else {
|
|
160
|
+
t3 = $[9];
|
|
161
|
+
}
|
|
162
|
+
let t4;
|
|
163
|
+
if ($[10] !== xAngle) {
|
|
164
|
+
t4 = /* @__PURE__ */ jsxs2(Group, { children: [
|
|
165
|
+
"X Angle:",
|
|
166
|
+
/* @__PURE__ */ jsx2(NumberInput, { size: "xs", w: 100, value: xAngle, onChange: t3, step: 0.01 })
|
|
167
|
+
] });
|
|
168
|
+
$[10] = xAngle;
|
|
169
|
+
$[11] = t4;
|
|
170
|
+
} else {
|
|
171
|
+
t4 = $[11];
|
|
172
|
+
}
|
|
173
|
+
let t5;
|
|
174
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
175
|
+
t5 = (e_0) => setYAngle(Number(e_0));
|
|
176
|
+
$[12] = t5;
|
|
177
|
+
} else {
|
|
178
|
+
t5 = $[12];
|
|
179
|
+
}
|
|
180
|
+
let t6;
|
|
181
|
+
if ($[13] !== yAngle) {
|
|
182
|
+
t6 = /* @__PURE__ */ jsxs2(Group, { children: [
|
|
183
|
+
"Y Angle:",
|
|
184
|
+
/* @__PURE__ */ jsx2(NumberInput, { size: "xs", w: 100, value: yAngle, onChange: t5, step: 0.01 })
|
|
185
|
+
] });
|
|
186
|
+
$[13] = yAngle;
|
|
187
|
+
$[14] = t6;
|
|
188
|
+
} else {
|
|
189
|
+
t6 = $[14];
|
|
190
|
+
}
|
|
191
|
+
let t7;
|
|
192
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
193
|
+
t7 = (e_1) => setZAngle(Number(e_1));
|
|
194
|
+
$[15] = t7;
|
|
195
|
+
} else {
|
|
196
|
+
t7 = $[15];
|
|
197
|
+
}
|
|
198
|
+
let t8;
|
|
199
|
+
if ($[16] !== zAngle) {
|
|
200
|
+
t8 = /* @__PURE__ */ jsxs2(Group, { children: [
|
|
201
|
+
"Z Angle:",
|
|
202
|
+
/* @__PURE__ */ jsx2(NumberInput, { size: "xs", w: 100, value: zAngle, onChange: t7, step: 0.01 })
|
|
203
|
+
] });
|
|
204
|
+
$[16] = zAngle;
|
|
205
|
+
$[17] = t8;
|
|
206
|
+
} else {
|
|
207
|
+
t8 = $[17];
|
|
208
|
+
}
|
|
209
|
+
let t9;
|
|
210
|
+
if ($[18] !== t4 || $[19] !== t6 || $[20] !== t8) {
|
|
211
|
+
t9 = /* @__PURE__ */ jsxs2(Stack, { children: [
|
|
212
|
+
t4,
|
|
213
|
+
t6,
|
|
214
|
+
t8
|
|
215
|
+
] });
|
|
216
|
+
$[18] = t4;
|
|
217
|
+
$[19] = t6;
|
|
218
|
+
$[20] = t8;
|
|
219
|
+
$[21] = t9;
|
|
220
|
+
} else {
|
|
221
|
+
t9 = $[21];
|
|
222
|
+
}
|
|
223
|
+
let t10;
|
|
224
|
+
if ($[22] !== data.handles || $[23] !== id) {
|
|
225
|
+
t10 = /* @__PURE__ */ jsx2(NodeTrackConnections2, { handles: data.handles, nodeId: id, type: "target" });
|
|
226
|
+
$[22] = data.handles;
|
|
227
|
+
$[23] = id;
|
|
228
|
+
$[24] = t10;
|
|
229
|
+
} else {
|
|
230
|
+
t10 = $[24];
|
|
231
|
+
}
|
|
232
|
+
let t11;
|
|
233
|
+
if ($[25] !== data || $[26] !== id || $[27] !== selected || $[28] !== t10 || $[29] !== t9 || $[30] !== type) {
|
|
234
|
+
t11 = /* @__PURE__ */ jsxs2(NodeContainer2, { id, selected, data, type, children: [
|
|
235
|
+
t9,
|
|
236
|
+
t10
|
|
237
|
+
] });
|
|
238
|
+
$[25] = data;
|
|
239
|
+
$[26] = id;
|
|
240
|
+
$[27] = selected;
|
|
241
|
+
$[28] = t10;
|
|
242
|
+
$[29] = t9;
|
|
243
|
+
$[30] = type;
|
|
244
|
+
$[31] = t11;
|
|
245
|
+
} else {
|
|
246
|
+
t11 = $[31];
|
|
247
|
+
}
|
|
248
|
+
return t11;
|
|
249
|
+
}
|
|
250
|
+
var noise_rotate_point_node_default = NoiseRotatePointNode;
|
|
251
|
+
|
|
252
|
+
// src/nodes/transformers/noise-scale-point-node.tsx
|
|
253
|
+
import { c as _c3 } from "react/compiler-runtime";
|
|
254
|
+
import { useIncomingComputedData as useIncomingComputedData2, useUpdateNodeComputedData as useUpdateNodeComputedData3, useUpdateNodeData as useUpdateNodeData2 } from "@awesome-flow/core/hooks";
|
|
255
|
+
import { NodeContainer as NodeContainer3, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
|
|
256
|
+
import { Group as Group2, NumberInput as NumberInput2, Stack as Stack2 } from "@mantine/core";
|
|
257
|
+
import { ScalePoint } from "libnoise-simplex-ts";
|
|
258
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
259
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
260
|
+
function NoiseScalePointNode(t0) {
|
|
261
|
+
const $ = _c3(32);
|
|
262
|
+
const {
|
|
263
|
+
id,
|
|
264
|
+
selected,
|
|
265
|
+
data,
|
|
266
|
+
type
|
|
267
|
+
} = t0;
|
|
268
|
+
const [xScale, setXScale] = useState2(data.xScale);
|
|
269
|
+
const [yScale, setYScale] = useState2(data.yScale);
|
|
270
|
+
const [zScale, setZScale] = useState2(data.zScale);
|
|
271
|
+
const incoming = useIncomingComputedData2(id);
|
|
272
|
+
const updateNodeData = useUpdateNodeData2();
|
|
273
|
+
const updateComputedData = useUpdateNodeComputedData3();
|
|
274
|
+
let t1;
|
|
275
|
+
let t2;
|
|
276
|
+
if ($[0] !== id || $[1] !== incoming || $[2] !== updateComputedData || $[3] !== updateNodeData || $[4] !== xScale || $[5] !== yScale || $[6] !== zScale) {
|
|
277
|
+
t1 = () => {
|
|
278
|
+
if (incoming?.length) {
|
|
279
|
+
const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);
|
|
280
|
+
updateComputedData(id, {
|
|
281
|
+
module
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
updateNodeData(id, {
|
|
285
|
+
xScale,
|
|
286
|
+
yScale,
|
|
287
|
+
zScale
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
t2 = [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale];
|
|
291
|
+
$[0] = id;
|
|
292
|
+
$[1] = incoming;
|
|
293
|
+
$[2] = updateComputedData;
|
|
294
|
+
$[3] = updateNodeData;
|
|
295
|
+
$[4] = xScale;
|
|
296
|
+
$[5] = yScale;
|
|
297
|
+
$[6] = zScale;
|
|
298
|
+
$[7] = t1;
|
|
299
|
+
$[8] = t2;
|
|
300
|
+
} else {
|
|
301
|
+
t1 = $[7];
|
|
302
|
+
t2 = $[8];
|
|
303
|
+
}
|
|
304
|
+
useEffect2(t1, t2);
|
|
305
|
+
let t3;
|
|
306
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
307
|
+
t3 = (e) => setXScale(Number(e));
|
|
308
|
+
$[9] = t3;
|
|
309
|
+
} else {
|
|
310
|
+
t3 = $[9];
|
|
311
|
+
}
|
|
312
|
+
let t4;
|
|
313
|
+
if ($[10] !== xScale) {
|
|
314
|
+
t4 = /* @__PURE__ */ jsxs3(Group2, { children: [
|
|
315
|
+
"X Scale:",
|
|
316
|
+
/* @__PURE__ */ jsx3(NumberInput2, { size: "xs", w: 100, value: xScale, onChange: t3, step: 0.01 })
|
|
317
|
+
] });
|
|
318
|
+
$[10] = xScale;
|
|
319
|
+
$[11] = t4;
|
|
320
|
+
} else {
|
|
321
|
+
t4 = $[11];
|
|
322
|
+
}
|
|
323
|
+
let t5;
|
|
324
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
325
|
+
t5 = (e_0) => setYScale(Number(e_0));
|
|
326
|
+
$[12] = t5;
|
|
327
|
+
} else {
|
|
328
|
+
t5 = $[12];
|
|
329
|
+
}
|
|
330
|
+
let t6;
|
|
331
|
+
if ($[13] !== yScale) {
|
|
332
|
+
t6 = /* @__PURE__ */ jsxs3(Group2, { children: [
|
|
333
|
+
"Y Scale:",
|
|
334
|
+
/* @__PURE__ */ jsx3(NumberInput2, { size: "xs", w: 100, value: yScale, onChange: t5, step: 0.01 })
|
|
335
|
+
] });
|
|
336
|
+
$[13] = yScale;
|
|
337
|
+
$[14] = t6;
|
|
338
|
+
} else {
|
|
339
|
+
t6 = $[14];
|
|
340
|
+
}
|
|
341
|
+
let t7;
|
|
342
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
343
|
+
t7 = (e_1) => setZScale(Number(e_1));
|
|
344
|
+
$[15] = t7;
|
|
345
|
+
} else {
|
|
346
|
+
t7 = $[15];
|
|
347
|
+
}
|
|
348
|
+
let t8;
|
|
349
|
+
if ($[16] !== zScale) {
|
|
350
|
+
t8 = /* @__PURE__ */ jsxs3(Group2, { children: [
|
|
351
|
+
"Z Scale:",
|
|
352
|
+
/* @__PURE__ */ jsx3(NumberInput2, { size: "xs", w: 100, value: zScale, onChange: t7, step: 0.01 })
|
|
353
|
+
] });
|
|
354
|
+
$[16] = zScale;
|
|
355
|
+
$[17] = t8;
|
|
356
|
+
} else {
|
|
357
|
+
t8 = $[17];
|
|
358
|
+
}
|
|
359
|
+
let t9;
|
|
360
|
+
if ($[18] !== t4 || $[19] !== t6 || $[20] !== t8) {
|
|
361
|
+
t9 = /* @__PURE__ */ jsxs3(Stack2, { children: [
|
|
362
|
+
t4,
|
|
363
|
+
t6,
|
|
364
|
+
t8
|
|
365
|
+
] });
|
|
366
|
+
$[18] = t4;
|
|
367
|
+
$[19] = t6;
|
|
368
|
+
$[20] = t8;
|
|
369
|
+
$[21] = t9;
|
|
370
|
+
} else {
|
|
371
|
+
t9 = $[21];
|
|
372
|
+
}
|
|
373
|
+
let t10;
|
|
374
|
+
if ($[22] !== data.handles || $[23] !== id) {
|
|
375
|
+
t10 = /* @__PURE__ */ jsx3(NodeTrackConnections3, { handles: data.handles, nodeId: id, type: "target" });
|
|
376
|
+
$[22] = data.handles;
|
|
377
|
+
$[23] = id;
|
|
378
|
+
$[24] = t10;
|
|
379
|
+
} else {
|
|
380
|
+
t10 = $[24];
|
|
381
|
+
}
|
|
382
|
+
let t11;
|
|
383
|
+
if ($[25] !== data || $[26] !== id || $[27] !== selected || $[28] !== t10 || $[29] !== t9 || $[30] !== type) {
|
|
384
|
+
t11 = /* @__PURE__ */ jsxs3(NodeContainer3, { id, selected, data, type, children: [
|
|
385
|
+
t9,
|
|
386
|
+
t10
|
|
387
|
+
] });
|
|
388
|
+
$[25] = data;
|
|
389
|
+
$[26] = id;
|
|
390
|
+
$[27] = selected;
|
|
391
|
+
$[28] = t10;
|
|
392
|
+
$[29] = t9;
|
|
393
|
+
$[30] = type;
|
|
394
|
+
$[31] = t11;
|
|
395
|
+
} else {
|
|
396
|
+
t11 = $[31];
|
|
397
|
+
}
|
|
398
|
+
return t11;
|
|
399
|
+
}
|
|
400
|
+
var noise_scale_point_node_default = NoiseScalePointNode;
|
|
401
|
+
|
|
402
|
+
// src/nodes/transformers/noise-translate-point-node.tsx
|
|
403
|
+
import { c as _c4 } from "react/compiler-runtime";
|
|
404
|
+
import { useIncomingComputedData as useIncomingComputedData3, useUpdateNodeComputedData as useUpdateNodeComputedData4, useUpdateNodeData as useUpdateNodeData3 } from "@awesome-flow/core/hooks";
|
|
405
|
+
import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
|
|
406
|
+
import { Group as Group3, NumberInput as NumberInput3, Stack as Stack3 } from "@mantine/core";
|
|
407
|
+
import { TranslatePoint } from "libnoise-simplex-ts";
|
|
408
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
409
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
410
|
+
function NoiseTranslatePointNode(t0) {
|
|
411
|
+
const $ = _c4(32);
|
|
412
|
+
const {
|
|
413
|
+
id,
|
|
414
|
+
selected,
|
|
415
|
+
data,
|
|
416
|
+
type
|
|
417
|
+
} = t0;
|
|
418
|
+
const [translateX, setTranslateX] = useState3(data.translateX);
|
|
419
|
+
const [translateY, setTranslateY] = useState3(data.translateY);
|
|
420
|
+
const [translateZ, setTranslateZ] = useState3(data.translateZ);
|
|
421
|
+
const incoming = useIncomingComputedData3(id);
|
|
422
|
+
const updateNodeData = useUpdateNodeData3();
|
|
423
|
+
const updateComputedData = useUpdateNodeComputedData4();
|
|
424
|
+
let t1;
|
|
425
|
+
let t2;
|
|
426
|
+
if ($[0] !== id || $[1] !== incoming || $[2] !== translateX || $[3] !== translateY || $[4] !== translateZ || $[5] !== updateComputedData || $[6] !== updateNodeData) {
|
|
427
|
+
t1 = () => {
|
|
428
|
+
if (incoming?.length) {
|
|
429
|
+
const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
|
|
430
|
+
updateComputedData(id, {
|
|
431
|
+
module
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
updateNodeData(id, {
|
|
435
|
+
translateX,
|
|
436
|
+
translateY,
|
|
437
|
+
translateZ
|
|
438
|
+
});
|
|
439
|
+
};
|
|
440
|
+
t2 = [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData];
|
|
441
|
+
$[0] = id;
|
|
442
|
+
$[1] = incoming;
|
|
443
|
+
$[2] = translateX;
|
|
444
|
+
$[3] = translateY;
|
|
445
|
+
$[4] = translateZ;
|
|
446
|
+
$[5] = updateComputedData;
|
|
447
|
+
$[6] = updateNodeData;
|
|
448
|
+
$[7] = t1;
|
|
449
|
+
$[8] = t2;
|
|
450
|
+
} else {
|
|
451
|
+
t1 = $[7];
|
|
452
|
+
t2 = $[8];
|
|
453
|
+
}
|
|
454
|
+
useEffect3(t1, t2);
|
|
455
|
+
let t3;
|
|
456
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
457
|
+
t3 = (e) => setTranslateX(Number(e));
|
|
458
|
+
$[9] = t3;
|
|
459
|
+
} else {
|
|
460
|
+
t3 = $[9];
|
|
461
|
+
}
|
|
462
|
+
let t4;
|
|
463
|
+
if ($[10] !== translateX) {
|
|
464
|
+
t4 = /* @__PURE__ */ jsxs4(Group3, { children: [
|
|
465
|
+
"Translate X:",
|
|
466
|
+
/* @__PURE__ */ jsx4(NumberInput3, { size: "xs", w: 100, value: translateX, onChange: t3, step: 1 })
|
|
467
|
+
] });
|
|
468
|
+
$[10] = translateX;
|
|
469
|
+
$[11] = t4;
|
|
470
|
+
} else {
|
|
471
|
+
t4 = $[11];
|
|
472
|
+
}
|
|
473
|
+
let t5;
|
|
474
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
475
|
+
t5 = (e_0) => setTranslateY(Number(e_0));
|
|
476
|
+
$[12] = t5;
|
|
477
|
+
} else {
|
|
478
|
+
t5 = $[12];
|
|
479
|
+
}
|
|
480
|
+
let t6;
|
|
481
|
+
if ($[13] !== translateY) {
|
|
482
|
+
t6 = /* @__PURE__ */ jsxs4(Group3, { children: [
|
|
483
|
+
"Translate Y:",
|
|
484
|
+
/* @__PURE__ */ jsx4(NumberInput3, { size: "xs", w: 100, value: translateY, onChange: t5, step: 1 })
|
|
485
|
+
] });
|
|
486
|
+
$[13] = translateY;
|
|
487
|
+
$[14] = t6;
|
|
488
|
+
} else {
|
|
489
|
+
t6 = $[14];
|
|
490
|
+
}
|
|
491
|
+
let t7;
|
|
492
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
493
|
+
t7 = (e_1) => setTranslateZ(Number(e_1));
|
|
494
|
+
$[15] = t7;
|
|
495
|
+
} else {
|
|
496
|
+
t7 = $[15];
|
|
497
|
+
}
|
|
498
|
+
let t8;
|
|
499
|
+
if ($[16] !== translateZ) {
|
|
500
|
+
t8 = /* @__PURE__ */ jsxs4(Group3, { children: [
|
|
501
|
+
"Translate Z:",
|
|
502
|
+
/* @__PURE__ */ jsx4(NumberInput3, { size: "xs", w: 100, value: translateZ, onChange: t7, step: 1 })
|
|
503
|
+
] });
|
|
504
|
+
$[16] = translateZ;
|
|
505
|
+
$[17] = t8;
|
|
506
|
+
} else {
|
|
507
|
+
t8 = $[17];
|
|
508
|
+
}
|
|
509
|
+
let t9;
|
|
510
|
+
if ($[18] !== t4 || $[19] !== t6 || $[20] !== t8) {
|
|
511
|
+
t9 = /* @__PURE__ */ jsxs4(Stack3, { children: [
|
|
512
|
+
t4,
|
|
513
|
+
t6,
|
|
514
|
+
t8
|
|
515
|
+
] });
|
|
516
|
+
$[18] = t4;
|
|
517
|
+
$[19] = t6;
|
|
518
|
+
$[20] = t8;
|
|
519
|
+
$[21] = t9;
|
|
520
|
+
} else {
|
|
521
|
+
t9 = $[21];
|
|
522
|
+
}
|
|
523
|
+
let t10;
|
|
524
|
+
if ($[22] !== data.handles || $[23] !== id) {
|
|
525
|
+
t10 = /* @__PURE__ */ jsx4(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" });
|
|
526
|
+
$[22] = data.handles;
|
|
527
|
+
$[23] = id;
|
|
528
|
+
$[24] = t10;
|
|
529
|
+
} else {
|
|
530
|
+
t10 = $[24];
|
|
531
|
+
}
|
|
532
|
+
let t11;
|
|
533
|
+
if ($[25] !== data || $[26] !== id || $[27] !== selected || $[28] !== t10 || $[29] !== t9 || $[30] !== type) {
|
|
534
|
+
t11 = /* @__PURE__ */ jsxs4(NodeContainer4, { id, selected, data, type, children: [
|
|
535
|
+
t9,
|
|
536
|
+
t10
|
|
537
|
+
] });
|
|
538
|
+
$[25] = data;
|
|
539
|
+
$[26] = id;
|
|
540
|
+
$[27] = selected;
|
|
541
|
+
$[28] = t10;
|
|
542
|
+
$[29] = t9;
|
|
543
|
+
$[30] = type;
|
|
544
|
+
$[31] = t11;
|
|
545
|
+
} else {
|
|
546
|
+
t11 = $[31];
|
|
547
|
+
}
|
|
548
|
+
return t11;
|
|
549
|
+
}
|
|
550
|
+
var noise_translate_point_node_default = NoiseTranslatePointNode;
|
|
551
|
+
|
|
552
|
+
// src/nodes/transformers/noise-turbulence-node.tsx
|
|
553
|
+
import { c as _c5 } from "react/compiler-runtime";
|
|
554
|
+
import { NodePropertyVariables } from "@awesome-flow/core/components";
|
|
555
|
+
import { useIncomingComputedData as useIncomingComputedData4, useUpdateNodeComputedData as useUpdateNodeComputedData5 } from "@awesome-flow/core/hooks";
|
|
556
|
+
import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
|
|
557
|
+
import { Turbulence } from "libnoise-simplex-ts";
|
|
558
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
559
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
560
|
+
function NoiseTurbulenceNode(t0) {
|
|
561
|
+
const $ = _c5(19);
|
|
562
|
+
const {
|
|
563
|
+
id,
|
|
564
|
+
selected,
|
|
565
|
+
data,
|
|
566
|
+
type
|
|
567
|
+
} = t0;
|
|
568
|
+
const [properties, setProperties] = useState4(null);
|
|
569
|
+
const incoming = useIncomingComputedData4(id);
|
|
570
|
+
const updateComputedData = useUpdateNodeComputedData5();
|
|
571
|
+
let t1;
|
|
572
|
+
let t2;
|
|
573
|
+
if ($[0] !== id || $[1] !== incoming || $[2] !== properties || $[3] !== updateComputedData) {
|
|
574
|
+
t1 = () => {
|
|
575
|
+
if (incoming?.length && properties) {
|
|
576
|
+
const module = new Turbulence(incoming[0].module, properties.frequency.value, properties.power.value, properties.roughness.value, properties.seed.value);
|
|
577
|
+
updateComputedData(id, {
|
|
578
|
+
module
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
t2 = [id, incoming, properties, updateComputedData];
|
|
583
|
+
$[0] = id;
|
|
584
|
+
$[1] = incoming;
|
|
585
|
+
$[2] = properties;
|
|
586
|
+
$[3] = updateComputedData;
|
|
587
|
+
$[4] = t1;
|
|
588
|
+
$[5] = t2;
|
|
589
|
+
} else {
|
|
590
|
+
t1 = $[4];
|
|
591
|
+
t2 = $[5];
|
|
592
|
+
}
|
|
593
|
+
useEffect4(t1, t2);
|
|
594
|
+
let t3;
|
|
595
|
+
if ($[6] !== data || $[7] !== id) {
|
|
596
|
+
t3 = /* @__PURE__ */ jsx5(NodePropertyVariables, { data, nodeId: id, onPropertiesChange: setProperties });
|
|
597
|
+
$[6] = data;
|
|
598
|
+
$[7] = id;
|
|
599
|
+
$[8] = t3;
|
|
600
|
+
} else {
|
|
601
|
+
t3 = $[8];
|
|
602
|
+
}
|
|
603
|
+
let t4;
|
|
604
|
+
if ($[9] !== data.handles || $[10] !== id) {
|
|
605
|
+
t4 = /* @__PURE__ */ jsx5(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" });
|
|
606
|
+
$[9] = data.handles;
|
|
607
|
+
$[10] = id;
|
|
608
|
+
$[11] = t4;
|
|
609
|
+
} else {
|
|
610
|
+
t4 = $[11];
|
|
611
|
+
}
|
|
612
|
+
let t5;
|
|
613
|
+
if ($[12] !== data || $[13] !== id || $[14] !== selected || $[15] !== t3 || $[16] !== t4 || $[17] !== type) {
|
|
614
|
+
t5 = /* @__PURE__ */ jsxs5(NodeContainer5, { id, selected, data, type, children: [
|
|
615
|
+
t3,
|
|
616
|
+
t4
|
|
617
|
+
] });
|
|
618
|
+
$[12] = data;
|
|
619
|
+
$[13] = id;
|
|
620
|
+
$[14] = selected;
|
|
621
|
+
$[15] = t3;
|
|
622
|
+
$[16] = t4;
|
|
623
|
+
$[17] = type;
|
|
624
|
+
$[18] = t5;
|
|
625
|
+
} else {
|
|
626
|
+
t5 = $[18];
|
|
627
|
+
}
|
|
628
|
+
return t5;
|
|
629
|
+
}
|
|
630
|
+
var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
631
|
+
|
|
632
|
+
export {
|
|
633
|
+
NoiseHandleType,
|
|
634
|
+
DisplacementHandle,
|
|
635
|
+
NoiseSourceControlHandle,
|
|
636
|
+
noise_displace_node_default,
|
|
637
|
+
noise_rotate_point_node_default,
|
|
638
|
+
noise_scale_point_node_default,
|
|
639
|
+
noise_translate_point_node_default,
|
|
640
|
+
noise_turbulence_node_default
|
|
641
|
+
};
|