@awesome-flow/noise 0.9.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.
Files changed (79) hide show
  1. package/dist/abstract/index.cjs +6 -6
  2. package/dist/abstract/index.d.cts +10 -8
  3. package/dist/abstract/index.d.ts +10 -8
  4. package/dist/abstract/index.js +5 -5
  5. package/dist/chunk-4YL2V7SE.js +641 -0
  6. package/dist/chunk-76MMGOOY.cjs +1008 -0
  7. package/dist/{chunk-BG6U3TYO.js → chunk-BE4RLT5P.js} +445 -178
  8. package/dist/chunk-D5QJ3563.cjs +641 -0
  9. package/dist/chunk-EHBNVDTI.js +60 -0
  10. package/dist/chunk-L45ZU7VL.js +1008 -0
  11. package/dist/{chunk-ACWBUUZ7.cjs → chunk-MIYOMNAG.cjs} +467 -200
  12. package/dist/chunk-O5DVJAMK.cjs +974 -0
  13. package/dist/chunk-S2ZGHJ75.js +974 -0
  14. package/dist/chunk-X2GXADE5.cjs +60 -0
  15. package/dist/{index-mlK0X4O1.d.ts → index-DAAmYCPU.d.ts} +1 -1
  16. package/dist/{index-CfiOpOzX.d.cts → index-EzT2GjIx.d.cts} +1 -1
  17. package/dist/{node-props-CAV2WNDN.d.ts → node-props-D8SnrgWa.d.cts} +1 -1
  18. package/dist/{node-props-CAV2WNDN.d.cts → node-props-D8SnrgWa.d.ts} +1 -1
  19. package/dist/nodes/generators/index.cjs +2 -2
  20. package/dist/nodes/generators/index.d.cts +1 -1
  21. package/dist/nodes/generators/index.d.ts +1 -1
  22. package/dist/nodes/generators/index.js +1 -1
  23. package/dist/nodes/groups/index.cjs +2 -2
  24. package/dist/nodes/groups/index.d.cts +1 -1
  25. package/dist/nodes/groups/index.d.ts +1 -1
  26. package/dist/nodes/groups/index.js +1 -1
  27. package/dist/nodes/index.cjs +6 -6
  28. package/dist/nodes/index.d.cts +4 -2
  29. package/dist/nodes/index.d.ts +4 -2
  30. package/dist/nodes/index.js +5 -5
  31. package/dist/nodes/modifiers/index.cjs +2 -2
  32. package/dist/nodes/modifiers/index.d.cts +6 -19
  33. package/dist/nodes/modifiers/index.d.ts +6 -19
  34. package/dist/nodes/modifiers/index.js +1 -1
  35. package/dist/nodes/output/index.cjs +6 -6
  36. package/dist/nodes/output/index.js +5 -5
  37. package/dist/nodes/selectors/index.cjs +6 -6
  38. package/dist/nodes/selectors/index.d.cts +1 -1
  39. package/dist/nodes/selectors/index.d.ts +1 -1
  40. package/dist/nodes/selectors/index.js +5 -5
  41. package/dist/nodes/transformers/index.cjs +2 -2
  42. package/dist/nodes/transformers/index.d.cts +1 -1
  43. package/dist/nodes/transformers/index.d.ts +1 -1
  44. package/dist/nodes/transformers/index.js +1 -1
  45. package/dist/noise-terrace-node-D2ezdTnC.d.cts +22 -0
  46. package/dist/noise-terrace-node-DW81ZQk6.d.ts +22 -0
  47. package/dist/templates/generators/index.cjs +6 -6
  48. package/dist/templates/generators/index.d.cts +1 -1
  49. package/dist/templates/generators/index.d.ts +1 -1
  50. package/dist/templates/generators/index.js +5 -5
  51. package/dist/templates/groups/index.cjs +6 -6
  52. package/dist/templates/groups/index.js +5 -5
  53. package/dist/templates/index.cjs +6 -6
  54. package/dist/templates/index.d.cts +2 -2
  55. package/dist/templates/index.d.ts +2 -2
  56. package/dist/templates/index.js +5 -5
  57. package/dist/templates/modifiers/index.cjs +6 -6
  58. package/dist/templates/modifiers/index.d.cts +1 -1
  59. package/dist/templates/modifiers/index.d.ts +1 -1
  60. package/dist/templates/modifiers/index.js +5 -5
  61. package/dist/templates/output/index.cjs +6 -6
  62. package/dist/templates/output/index.js +5 -5
  63. package/dist/templates/selectors/index.cjs +6 -6
  64. package/dist/templates/selectors/index.d.cts +1 -1
  65. package/dist/templates/selectors/index.d.ts +1 -1
  66. package/dist/templates/selectors/index.js +5 -5
  67. package/dist/templates/transformers/index.cjs +6 -6
  68. package/dist/templates/transformers/index.d.cts +2 -2
  69. package/dist/templates/transformers/index.d.ts +2 -2
  70. package/dist/templates/transformers/index.js +5 -5
  71. package/package.json +6 -5
  72. package/dist/chunk-D5JM4EYQ.cjs +0 -305
  73. package/dist/chunk-DWSACR65.js +0 -305
  74. package/dist/chunk-KHIIB5TH.js +0 -93
  75. package/dist/chunk-M67JHEU2.cjs +0 -93
  76. package/dist/chunk-PS5VUND5.js +0 -348
  77. package/dist/chunk-RDQ4BOOV.js +0 -522
  78. package/dist/chunk-RKTZQUWR.cjs +0 -348
  79. package/dist/chunk-TZCT2GZV.cjs +0 -522
@@ -0,0 +1,974 @@
1
+ // src/nodes/generators/noise-billow-node.tsx
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import { NodePropertyVariables } from "@awesome-flow/core/components";
4
+ import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
5
+ import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
6
+ import { Billow } from "libnoise-simplex-ts";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ function NoiseBillowNode(t0) {
9
+ const $ = _c(17);
10
+ const {
11
+ id,
12
+ selected,
13
+ data,
14
+ type
15
+ } = t0;
16
+ const updateComputedData = useUpdateNodeComputedData();
17
+ let t1;
18
+ if ($[0] !== id || $[1] !== updateComputedData) {
19
+ t1 = (properties) => {
20
+ const module = new Billow();
21
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
22
+ updateComputedData(id, {
23
+ module
24
+ });
25
+ };
26
+ $[0] = id;
27
+ $[1] = updateComputedData;
28
+ $[2] = t1;
29
+ } else {
30
+ t1 = $[2];
31
+ }
32
+ const onPropertiesChange = t1;
33
+ let t2;
34
+ if ($[3] !== data || $[4] !== id || $[5] !== onPropertiesChange) {
35
+ t2 = /* @__PURE__ */ jsx(NodePropertyVariables, { data, nodeId: id, onPropertiesChange });
36
+ $[3] = data;
37
+ $[4] = id;
38
+ $[5] = onPropertiesChange;
39
+ $[6] = t2;
40
+ } else {
41
+ t2 = $[6];
42
+ }
43
+ let t3;
44
+ if ($[7] !== data.handles || $[8] !== id) {
45
+ t3 = /* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" });
46
+ $[7] = data.handles;
47
+ $[8] = id;
48
+ $[9] = t3;
49
+ } else {
50
+ t3 = $[9];
51
+ }
52
+ let t4;
53
+ if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t2 || $[14] !== t3 || $[15] !== type) {
54
+ t4 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
55
+ t2,
56
+ t3
57
+ ] }) });
58
+ $[10] = data;
59
+ $[11] = id;
60
+ $[12] = selected;
61
+ $[13] = t2;
62
+ $[14] = t3;
63
+ $[15] = type;
64
+ $[16] = t4;
65
+ } else {
66
+ t4 = $[16];
67
+ }
68
+ return t4;
69
+ }
70
+ var noise_billow_node_default = NoiseBillowNode;
71
+
72
+ // src/nodes/generators/noise-checkerboard-node.tsx
73
+ import { c as _c2 } from "react/compiler-runtime";
74
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData2 } from "@awesome-flow/core/hooks";
75
+ import { NodeContainer as NodeContainer2 } from "@awesome-flow/core/layout";
76
+ import { Checkerboard } from "libnoise-simplex-ts";
77
+ import { useEffect } from "react";
78
+ import { jsx as jsx2 } from "react/jsx-runtime";
79
+ function NoiseCheckerboardNode(t0) {
80
+ const $ = _c2(9);
81
+ const {
82
+ id,
83
+ selected,
84
+ data,
85
+ type
86
+ } = t0;
87
+ const updateComputedData = useUpdateNodeComputedData2();
88
+ let t1;
89
+ let t2;
90
+ if ($[0] !== id || $[1] !== updateComputedData) {
91
+ t1 = () => {
92
+ const module = new Checkerboard();
93
+ updateComputedData(id, {
94
+ module
95
+ });
96
+ };
97
+ t2 = [id, updateComputedData];
98
+ $[0] = id;
99
+ $[1] = updateComputedData;
100
+ $[2] = t1;
101
+ $[3] = t2;
102
+ } else {
103
+ t1 = $[2];
104
+ t2 = $[3];
105
+ }
106
+ useEffect(t1, t2);
107
+ let t3;
108
+ if ($[4] !== data || $[5] !== id || $[6] !== selected || $[7] !== type) {
109
+ t3 = /* @__PURE__ */ jsx2(NodeContainer2, { id, selected, data, type });
110
+ $[4] = data;
111
+ $[5] = id;
112
+ $[6] = selected;
113
+ $[7] = type;
114
+ $[8] = t3;
115
+ } else {
116
+ t3 = $[8];
117
+ }
118
+ return t3;
119
+ }
120
+ var noise_checkerboard_node_default = NoiseCheckerboardNode;
121
+
122
+ // src/nodes/generators/noise-const-node.tsx
123
+ import { c as _c3 } from "react/compiler-runtime";
124
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData3, useUpdateNodeData } from "@awesome-flow/core/hooks";
125
+ import { NodeContainer as NodeContainer3 } from "@awesome-flow/core/layout";
126
+ import { Group, NumberInput, Stack } from "@mantine/core";
127
+ import { Const } from "libnoise-simplex-ts";
128
+ import { useEffect as useEffect2, useState } from "react";
129
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
130
+ function NoiseConstNode(t0) {
131
+ const $ = _c3(31);
132
+ const {
133
+ id,
134
+ selected,
135
+ data,
136
+ type
137
+ } = t0;
138
+ const [min, setMin] = useState(data.min);
139
+ const [max, setMax] = useState(data.max);
140
+ const [noise, setNoise] = useState(data.noise);
141
+ const updateNodeData = useUpdateNodeData();
142
+ const updateComputedData = useUpdateNodeComputedData3();
143
+ let t1;
144
+ let t2;
145
+ if ($[0] !== id || $[1] !== max || $[2] !== min || $[3] !== noise || $[4] !== updateComputedData || $[5] !== updateNodeData) {
146
+ t1 = () => {
147
+ const module = new Const(noise);
148
+ updateNodeData(id, {
149
+ noise,
150
+ min,
151
+ max
152
+ });
153
+ updateComputedData(id, {
154
+ module
155
+ });
156
+ };
157
+ t2 = [id, noise, min, max, updateNodeData, updateComputedData];
158
+ $[0] = id;
159
+ $[1] = max;
160
+ $[2] = min;
161
+ $[3] = noise;
162
+ $[4] = updateComputedData;
163
+ $[5] = updateNodeData;
164
+ $[6] = t1;
165
+ $[7] = t2;
166
+ } else {
167
+ t1 = $[6];
168
+ t2 = $[7];
169
+ }
170
+ useEffect2(t1, t2);
171
+ let t3;
172
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
173
+ t3 = (e) => setMin(Number(e));
174
+ $[8] = t3;
175
+ } else {
176
+ t3 = $[8];
177
+ }
178
+ let t4;
179
+ if ($[9] !== min) {
180
+ t4 = /* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: min, onChange: t3 });
181
+ $[9] = min;
182
+ $[10] = t4;
183
+ } else {
184
+ t4 = $[10];
185
+ }
186
+ let t5;
187
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
188
+ t5 = (e_0) => setMax(Number(e_0));
189
+ $[11] = t5;
190
+ } else {
191
+ t5 = $[11];
192
+ }
193
+ let t6;
194
+ if ($[12] !== max) {
195
+ t6 = /* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: max, onChange: t5 });
196
+ $[12] = max;
197
+ $[13] = t6;
198
+ } else {
199
+ t6 = $[13];
200
+ }
201
+ let t7;
202
+ if ($[14] !== t4 || $[15] !== t6) {
203
+ t7 = /* @__PURE__ */ jsxs2(Group, { children: [
204
+ t4,
205
+ t6
206
+ ] });
207
+ $[14] = t4;
208
+ $[15] = t6;
209
+ $[16] = t7;
210
+ } else {
211
+ t7 = $[16];
212
+ }
213
+ let t8;
214
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
215
+ t8 = (e_1) => setNoise(Number(e_1));
216
+ $[17] = t8;
217
+ } else {
218
+ t8 = $[17];
219
+ }
220
+ let t9;
221
+ if ($[18] !== max || $[19] !== min || $[20] !== noise) {
222
+ t9 = /* @__PURE__ */ jsxs2(Group, { children: [
223
+ "noise:",
224
+ /* @__PURE__ */ jsx3(NumberInput, { size: "xs", value: noise, onChange: t8, max, min, step: 0.1 })
225
+ ] });
226
+ $[18] = max;
227
+ $[19] = min;
228
+ $[20] = noise;
229
+ $[21] = t9;
230
+ } else {
231
+ t9 = $[21];
232
+ }
233
+ let t10;
234
+ if ($[22] !== t7 || $[23] !== t9) {
235
+ t10 = /* @__PURE__ */ jsxs2(Stack, { children: [
236
+ t7,
237
+ t9
238
+ ] });
239
+ $[22] = t7;
240
+ $[23] = t9;
241
+ $[24] = t10;
242
+ } else {
243
+ t10 = $[24];
244
+ }
245
+ let t11;
246
+ if ($[25] !== data || $[26] !== id || $[27] !== selected || $[28] !== t10 || $[29] !== type) {
247
+ t11 = /* @__PURE__ */ jsx3(NodeContainer3, { id, selected, data, type, children: t10 });
248
+ $[25] = data;
249
+ $[26] = id;
250
+ $[27] = selected;
251
+ $[28] = t10;
252
+ $[29] = type;
253
+ $[30] = t11;
254
+ } else {
255
+ t11 = $[30];
256
+ }
257
+ return t11;
258
+ }
259
+ var noise_const_node_default = NoiseConstNode;
260
+
261
+ // src/nodes/generators/noise-cylinders-node.tsx
262
+ import { c as _c4 } from "react/compiler-runtime";
263
+ import { NodePropertyVariables as NodePropertyVariables2 } from "@awesome-flow/core/components";
264
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData4 } from "@awesome-flow/core/hooks";
265
+ import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
266
+ import { Cylinders } from "libnoise-simplex-ts";
267
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
268
+ function NoiseCylindersNode(t0) {
269
+ const $ = _c4(17);
270
+ const {
271
+ id,
272
+ selected,
273
+ data,
274
+ type
275
+ } = t0;
276
+ const updateComputedData = useUpdateNodeComputedData4();
277
+ let t1;
278
+ if ($[0] !== id || $[1] !== updateComputedData) {
279
+ t1 = (properties) => {
280
+ const module = new Cylinders();
281
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
282
+ updateComputedData(id, {
283
+ module
284
+ });
285
+ };
286
+ $[0] = id;
287
+ $[1] = updateComputedData;
288
+ $[2] = t1;
289
+ } else {
290
+ t1 = $[2];
291
+ }
292
+ const onPropertiesChange = t1;
293
+ let t2;
294
+ if ($[3] !== data || $[4] !== id || $[5] !== onPropertiesChange) {
295
+ t2 = /* @__PURE__ */ jsx4(NodePropertyVariables2, { data, nodeId: id, onPropertiesChange });
296
+ $[3] = data;
297
+ $[4] = id;
298
+ $[5] = onPropertiesChange;
299
+ $[6] = t2;
300
+ } else {
301
+ t2 = $[6];
302
+ }
303
+ let t3;
304
+ if ($[7] !== data.handles || $[8] !== id) {
305
+ t3 = /* @__PURE__ */ jsx4(NodeTrackConnections2, { handles: data.handles, nodeId: id, type: "target" });
306
+ $[7] = data.handles;
307
+ $[8] = id;
308
+ $[9] = t3;
309
+ } else {
310
+ t3 = $[9];
311
+ }
312
+ let t4;
313
+ if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t2 || $[14] !== t3 || $[15] !== type) {
314
+ t4 = /* @__PURE__ */ jsxs3(NodeContainer4, { id, selected, data, type, children: [
315
+ t2,
316
+ t3
317
+ ] });
318
+ $[10] = data;
319
+ $[11] = id;
320
+ $[12] = selected;
321
+ $[13] = t2;
322
+ $[14] = t3;
323
+ $[15] = type;
324
+ $[16] = t4;
325
+ } else {
326
+ t4 = $[16];
327
+ }
328
+ return t4;
329
+ }
330
+ var noise_cylinders_node_default = NoiseCylindersNode;
331
+
332
+ // src/nodes/generators/noise-perlin-node.tsx
333
+ import { c as _c5 } from "react/compiler-runtime";
334
+ import { NodePropertyVariables as NodePropertyVariables3 } from "@awesome-flow/core/components";
335
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData5 } from "@awesome-flow/core/hooks";
336
+ import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
337
+ import { Perlin } from "libnoise-simplex-ts";
338
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
339
+ function NoisePerlinNode(t0) {
340
+ const $ = _c5(17);
341
+ const {
342
+ id,
343
+ selected,
344
+ data,
345
+ type
346
+ } = t0;
347
+ const updateComputedData = useUpdateNodeComputedData5();
348
+ let t1;
349
+ if ($[0] !== id || $[1] !== updateComputedData) {
350
+ t1 = (properties) => {
351
+ const module = new Perlin();
352
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
353
+ updateComputedData(id, {
354
+ module
355
+ });
356
+ };
357
+ $[0] = id;
358
+ $[1] = updateComputedData;
359
+ $[2] = t1;
360
+ } else {
361
+ t1 = $[2];
362
+ }
363
+ const onPropertiesChange = t1;
364
+ let t2;
365
+ if ($[3] !== data || $[4] !== id || $[5] !== onPropertiesChange) {
366
+ t2 = /* @__PURE__ */ jsx5(NodePropertyVariables3, { data, nodeId: id, onPropertiesChange });
367
+ $[3] = data;
368
+ $[4] = id;
369
+ $[5] = onPropertiesChange;
370
+ $[6] = t2;
371
+ } else {
372
+ t2 = $[6];
373
+ }
374
+ let t3;
375
+ if ($[7] !== data.handles || $[8] !== id) {
376
+ t3 = /* @__PURE__ */ jsx5(NodeTrackConnections3, { handles: data.handles, nodeId: id, type: "target" });
377
+ $[7] = data.handles;
378
+ $[8] = id;
379
+ $[9] = t3;
380
+ } else {
381
+ t3 = $[9];
382
+ }
383
+ let t4;
384
+ if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t2 || $[14] !== t3 || $[15] !== type) {
385
+ t4 = /* @__PURE__ */ jsxs4(NodeContainer5, { id, selected, data, type, children: [
386
+ t2,
387
+ t3
388
+ ] });
389
+ $[10] = data;
390
+ $[11] = id;
391
+ $[12] = selected;
392
+ $[13] = t2;
393
+ $[14] = t3;
394
+ $[15] = type;
395
+ $[16] = t4;
396
+ } else {
397
+ t4 = $[16];
398
+ }
399
+ return t4;
400
+ }
401
+ var noise_perlin_node_default = NoisePerlinNode;
402
+
403
+ // src/nodes/generators/noise-ridgedmulti-node.tsx
404
+ import { c as _c6 } from "react/compiler-runtime";
405
+ import { NodePropertyVariables as NodePropertyVariables4 } from "@awesome-flow/core/components";
406
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData6 } from "@awesome-flow/core/hooks";
407
+ import { NodeContainer as NodeContainer6, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
408
+ import { RidgedMulti } from "libnoise-simplex-ts";
409
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
410
+ function NoiseRidgedMultiNode(t0) {
411
+ const $ = _c6(17);
412
+ const {
413
+ id,
414
+ selected,
415
+ data,
416
+ type
417
+ } = t0;
418
+ const updateComputedData = useUpdateNodeComputedData6();
419
+ let t1;
420
+ if ($[0] !== id || $[1] !== updateComputedData) {
421
+ t1 = (properties) => {
422
+ const module = new RidgedMulti();
423
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
424
+ updateComputedData(id, {
425
+ module
426
+ });
427
+ };
428
+ $[0] = id;
429
+ $[1] = updateComputedData;
430
+ $[2] = t1;
431
+ } else {
432
+ t1 = $[2];
433
+ }
434
+ const onPropertiesChange = t1;
435
+ let t2;
436
+ if ($[3] !== data || $[4] !== id || $[5] !== onPropertiesChange) {
437
+ t2 = /* @__PURE__ */ jsx6(NodePropertyVariables4, { data, nodeId: id, onPropertiesChange });
438
+ $[3] = data;
439
+ $[4] = id;
440
+ $[5] = onPropertiesChange;
441
+ $[6] = t2;
442
+ } else {
443
+ t2 = $[6];
444
+ }
445
+ let t3;
446
+ if ($[7] !== data.handles || $[8] !== id) {
447
+ t3 = /* @__PURE__ */ jsx6(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" });
448
+ $[7] = data.handles;
449
+ $[8] = id;
450
+ $[9] = t3;
451
+ } else {
452
+ t3 = $[9];
453
+ }
454
+ let t4;
455
+ if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t2 || $[14] !== t3 || $[15] !== type) {
456
+ t4 = /* @__PURE__ */ jsxs5(NodeContainer6, { id, selected, data, type, children: [
457
+ t2,
458
+ t3
459
+ ] });
460
+ $[10] = data;
461
+ $[11] = id;
462
+ $[12] = selected;
463
+ $[13] = t2;
464
+ $[14] = t3;
465
+ $[15] = type;
466
+ $[16] = t4;
467
+ } else {
468
+ t4 = $[16];
469
+ }
470
+ return t4;
471
+ }
472
+ var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
473
+
474
+ // src/nodes/generators/noise-spheres-node.tsx
475
+ import { c as _c7 } from "react/compiler-runtime";
476
+ import { NodePropertyVariables as NodePropertyVariables5 } from "@awesome-flow/core/components";
477
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData7 } from "@awesome-flow/core/hooks";
478
+ import { NodeContainer as NodeContainer7, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
479
+ import { Spheres } from "libnoise-simplex-ts";
480
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
481
+ function NoiseSpheresNode(t0) {
482
+ const $ = _c7(17);
483
+ const {
484
+ id,
485
+ selected,
486
+ data,
487
+ type
488
+ } = t0;
489
+ const updateComputedData = useUpdateNodeComputedData7();
490
+ let t1;
491
+ if ($[0] !== id || $[1] !== updateComputedData) {
492
+ t1 = (properties) => {
493
+ const module = new Spheres();
494
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
495
+ updateComputedData(id, {
496
+ module
497
+ });
498
+ };
499
+ $[0] = id;
500
+ $[1] = updateComputedData;
501
+ $[2] = t1;
502
+ } else {
503
+ t1 = $[2];
504
+ }
505
+ const onPropertiesChange = t1;
506
+ let t2;
507
+ if ($[3] !== data || $[4] !== id || $[5] !== onPropertiesChange) {
508
+ t2 = /* @__PURE__ */ jsx7(NodePropertyVariables5, { data, nodeId: id, onPropertiesChange });
509
+ $[3] = data;
510
+ $[4] = id;
511
+ $[5] = onPropertiesChange;
512
+ $[6] = t2;
513
+ } else {
514
+ t2 = $[6];
515
+ }
516
+ let t3;
517
+ if ($[7] !== data.handles || $[8] !== id) {
518
+ t3 = /* @__PURE__ */ jsx7(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" });
519
+ $[7] = data.handles;
520
+ $[8] = id;
521
+ $[9] = t3;
522
+ } else {
523
+ t3 = $[9];
524
+ }
525
+ let t4;
526
+ if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t2 || $[14] !== t3 || $[15] !== type) {
527
+ t4 = /* @__PURE__ */ jsxs6(NodeContainer7, { id, selected, data, type, children: [
528
+ t2,
529
+ t3
530
+ ] });
531
+ $[10] = data;
532
+ $[11] = id;
533
+ $[12] = selected;
534
+ $[13] = t2;
535
+ $[14] = t3;
536
+ $[15] = type;
537
+ $[16] = t4;
538
+ } else {
539
+ t4 = $[16];
540
+ }
541
+ return t4;
542
+ }
543
+ var noise_spheres_node_default = NoiseSpheresNode;
544
+
545
+ // src/nodes/generators/noise-voronoi-node.tsx
546
+ import { c as _c8 } from "react/compiler-runtime";
547
+ import { NodePropertyVariables as NodePropertyVariables6 } from "@awesome-flow/core/components";
548
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData8 } from "@awesome-flow/core/hooks";
549
+ import { NodeContainer as NodeContainer8, NodeTrackConnections as NodeTrackConnections6 } from "@awesome-flow/core/layout";
550
+ import { Voronoi } from "libnoise-simplex-ts";
551
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
552
+ function NoiseVoronoiNode(t0) {
553
+ const $ = _c8(17);
554
+ const {
555
+ id,
556
+ selected,
557
+ data,
558
+ type
559
+ } = t0;
560
+ const updateComputedData = useUpdateNodeComputedData8();
561
+ let t1;
562
+ if ($[0] !== id || $[1] !== updateComputedData) {
563
+ t1 = (properties) => {
564
+ const module = new Voronoi(properties.frequency.value, properties.displacement.value, properties.distance.value, properties.seed.value);
565
+ updateComputedData(id, {
566
+ module
567
+ });
568
+ };
569
+ $[0] = id;
570
+ $[1] = updateComputedData;
571
+ $[2] = t1;
572
+ } else {
573
+ t1 = $[2];
574
+ }
575
+ const onPropertiesChange = t1;
576
+ let t2;
577
+ if ($[3] !== data || $[4] !== id || $[5] !== onPropertiesChange) {
578
+ t2 = /* @__PURE__ */ jsx8(NodePropertyVariables6, { data, nodeId: id, onPropertiesChange });
579
+ $[3] = data;
580
+ $[4] = id;
581
+ $[5] = onPropertiesChange;
582
+ $[6] = t2;
583
+ } else {
584
+ t2 = $[6];
585
+ }
586
+ let t3;
587
+ if ($[7] !== data.handles || $[8] !== id) {
588
+ t3 = /* @__PURE__ */ jsx8(NodeTrackConnections6, { handles: data.handles, nodeId: id, type: "target" });
589
+ $[7] = data.handles;
590
+ $[8] = id;
591
+ $[9] = t3;
592
+ } else {
593
+ t3 = $[9];
594
+ }
595
+ let t4;
596
+ if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t2 || $[14] !== t3 || $[15] !== type) {
597
+ t4 = /* @__PURE__ */ jsxs7(NodeContainer8, { id, selected, data, type, children: [
598
+ t2,
599
+ t3
600
+ ] });
601
+ $[10] = data;
602
+ $[11] = id;
603
+ $[12] = selected;
604
+ $[13] = t2;
605
+ $[14] = t3;
606
+ $[15] = type;
607
+ $[16] = t4;
608
+ } else {
609
+ t4 = $[16];
610
+ }
611
+ return t4;
612
+ }
613
+ var noise_voronoi_node_default = NoiseVoronoiNode;
614
+
615
+ // src/nodes/generators/position-const-node.tsx
616
+ import { c as _c9 } from "react/compiler-runtime";
617
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData9, useUpdateNodeData as useUpdateNodeData2 } from "@awesome-flow/core/hooks";
618
+ import { NodeContainer as NodeContainer9 } from "@awesome-flow/core/layout";
619
+ import { Group as Group2, NumberInput as NumberInput2, Stack as Stack2 } from "@mantine/core";
620
+ import { useEffect as useEffect3, useState as useState2 } from "react";
621
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
622
+ function PositionConstNode(t0) {
623
+ const $ = _c9(29);
624
+ const {
625
+ id,
626
+ selected,
627
+ data,
628
+ type
629
+ } = t0;
630
+ let t1;
631
+ if ($[0] !== data.position) {
632
+ t1 = data.position ?? {
633
+ x: 0,
634
+ y: 0,
635
+ z: 0
636
+ };
637
+ $[0] = data.position;
638
+ $[1] = t1;
639
+ } else {
640
+ t1 = $[1];
641
+ }
642
+ const position = t1;
643
+ const [x, setX] = useState2(position.x);
644
+ const [y, setY] = useState2(position.y);
645
+ const [z, setZ] = useState2(position.z);
646
+ const updateNodeData = useUpdateNodeData2();
647
+ const updateComputedData = useUpdateNodeComputedData9();
648
+ let t2;
649
+ let t3;
650
+ if ($[2] !== id || $[3] !== updateComputedData || $[4] !== updateNodeData || $[5] !== x || $[6] !== y || $[7] !== z) {
651
+ t2 = () => {
652
+ const position_0 = {
653
+ x,
654
+ y,
655
+ z
656
+ };
657
+ updateNodeData(id, {
658
+ position: position_0
659
+ });
660
+ updateComputedData(id, {
661
+ positions: [position_0]
662
+ });
663
+ };
664
+ t3 = [x, y, z, id, updateComputedData, updateNodeData];
665
+ $[2] = id;
666
+ $[3] = updateComputedData;
667
+ $[4] = updateNodeData;
668
+ $[5] = x;
669
+ $[6] = y;
670
+ $[7] = z;
671
+ $[8] = t2;
672
+ $[9] = t3;
673
+ } else {
674
+ t2 = $[8];
675
+ t3 = $[9];
676
+ }
677
+ useEffect3(t2, t3);
678
+ let t4;
679
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
680
+ t4 = (e) => setX(Number(e));
681
+ $[10] = t4;
682
+ } else {
683
+ t4 = $[10];
684
+ }
685
+ let t5;
686
+ if ($[11] !== x) {
687
+ t5 = /* @__PURE__ */ jsxs8(Group2, { children: [
688
+ "x: ",
689
+ /* @__PURE__ */ jsx9(NumberInput2, { size: "xs", w: 100, value: x, onChange: t4 })
690
+ ] });
691
+ $[11] = x;
692
+ $[12] = t5;
693
+ } else {
694
+ t5 = $[12];
695
+ }
696
+ let t6;
697
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
698
+ t6 = (e_0) => setY(Number(e_0));
699
+ $[13] = t6;
700
+ } else {
701
+ t6 = $[13];
702
+ }
703
+ let t7;
704
+ if ($[14] !== y) {
705
+ t7 = /* @__PURE__ */ jsxs8(Group2, { children: [
706
+ "y: ",
707
+ /* @__PURE__ */ jsx9(NumberInput2, { size: "xs", w: 100, value: y, onChange: t6 })
708
+ ] });
709
+ $[14] = y;
710
+ $[15] = t7;
711
+ } else {
712
+ t7 = $[15];
713
+ }
714
+ let t8;
715
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
716
+ t8 = (e_1) => setZ(Number(e_1));
717
+ $[16] = t8;
718
+ } else {
719
+ t8 = $[16];
720
+ }
721
+ let t9;
722
+ if ($[17] !== z) {
723
+ t9 = /* @__PURE__ */ jsxs8(Group2, { children: [
724
+ "z: ",
725
+ /* @__PURE__ */ jsx9(NumberInput2, { size: "xs", w: 100, value: z, onChange: t8 })
726
+ ] });
727
+ $[17] = z;
728
+ $[18] = t9;
729
+ } else {
730
+ t9 = $[18];
731
+ }
732
+ let t10;
733
+ if ($[19] !== t5 || $[20] !== t7 || $[21] !== t9) {
734
+ t10 = /* @__PURE__ */ jsxs8(Stack2, { children: [
735
+ t5,
736
+ t7,
737
+ t9
738
+ ] });
739
+ $[19] = t5;
740
+ $[20] = t7;
741
+ $[21] = t9;
742
+ $[22] = t10;
743
+ } else {
744
+ t10 = $[22];
745
+ }
746
+ let t11;
747
+ if ($[23] !== data || $[24] !== id || $[25] !== selected || $[26] !== t10 || $[27] !== type) {
748
+ t11 = /* @__PURE__ */ jsx9(NodeContainer9, { id, selected, data, type, children: t10 });
749
+ $[23] = data;
750
+ $[24] = id;
751
+ $[25] = selected;
752
+ $[26] = t10;
753
+ $[27] = type;
754
+ $[28] = t11;
755
+ } else {
756
+ t11 = $[28];
757
+ }
758
+ return t11;
759
+ }
760
+ var position_const_node_default = PositionConstNode;
761
+
762
+ // src/nodes/generators/position-grid-node.tsx
763
+ import { c as _c10 } from "react/compiler-runtime";
764
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData10, useUpdateNodeData as useUpdateNodeData3 } from "@awesome-flow/core/hooks";
765
+ import { NodeContainer as NodeContainer10 } from "@awesome-flow/core/layout";
766
+ import { Group as Group3, NumberInput as NumberInput3, Stack as Stack3 } from "@mantine/core";
767
+ import { useEffect as useEffect4, useState as useState3 } from "react";
768
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
769
+ function PositionGridNode(t0) {
770
+ const $ = _c10(43);
771
+ const {
772
+ id,
773
+ selected,
774
+ data,
775
+ type
776
+ } = t0;
777
+ const [x, setX] = useState3(data.center?.x);
778
+ const [y, setY] = useState3(data.center?.y);
779
+ const [z, setZ] = useState3(data.center?.z);
780
+ const [radius, setRadius] = useState3(data.radius);
781
+ const updateNodeData = useUpdateNodeData3();
782
+ const updateComputedData = useUpdateNodeComputedData10();
783
+ let t1;
784
+ let t2;
785
+ if ($[0] !== id || $[1] !== updateNodeData || $[2] !== x || $[3] !== y || $[4] !== z) {
786
+ t1 = () => {
787
+ updateNodeData(id, {
788
+ center: {
789
+ x,
790
+ y,
791
+ z
792
+ }
793
+ });
794
+ };
795
+ t2 = [x, y, z, id, updateNodeData];
796
+ $[0] = id;
797
+ $[1] = updateNodeData;
798
+ $[2] = x;
799
+ $[3] = y;
800
+ $[4] = z;
801
+ $[5] = t1;
802
+ $[6] = t2;
803
+ } else {
804
+ t1 = $[5];
805
+ t2 = $[6];
806
+ }
807
+ useEffect4(t1, t2);
808
+ let t3;
809
+ let t4;
810
+ if ($[7] !== id || $[8] !== radius || $[9] !== updateNodeData) {
811
+ t3 = () => {
812
+ updateNodeData(id, {
813
+ radius
814
+ });
815
+ };
816
+ t4 = [radius, id, updateNodeData];
817
+ $[7] = id;
818
+ $[8] = radius;
819
+ $[9] = updateNodeData;
820
+ $[10] = t3;
821
+ $[11] = t4;
822
+ } else {
823
+ t3 = $[10];
824
+ t4 = $[11];
825
+ }
826
+ useEffect4(t3, t4);
827
+ let t5;
828
+ let t6;
829
+ if ($[12] !== id || $[13] !== radius || $[14] !== updateComputedData || $[15] !== x || $[16] !== y || $[17] !== z) {
830
+ t5 = () => {
831
+ const positions = [];
832
+ for (let i = -radius; i < radius; i++) {
833
+ for (let j = -radius; j < radius; j++) {
834
+ positions.push({
835
+ x: x + i,
836
+ y: y + j,
837
+ z
838
+ });
839
+ }
840
+ }
841
+ updateComputedData(id, {
842
+ positions
843
+ });
844
+ };
845
+ t6 = [x, y, z, radius, id, updateComputedData];
846
+ $[12] = id;
847
+ $[13] = radius;
848
+ $[14] = updateComputedData;
849
+ $[15] = x;
850
+ $[16] = y;
851
+ $[17] = z;
852
+ $[18] = t5;
853
+ $[19] = t6;
854
+ } else {
855
+ t5 = $[18];
856
+ t6 = $[19];
857
+ }
858
+ useEffect4(t5, t6);
859
+ let t7;
860
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
861
+ t7 = (e) => setX(Number(e));
862
+ $[20] = t7;
863
+ } else {
864
+ t7 = $[20];
865
+ }
866
+ let t8;
867
+ if ($[21] !== x) {
868
+ t8 = /* @__PURE__ */ jsxs9(Group3, { children: [
869
+ "x: ",
870
+ /* @__PURE__ */ jsx10(NumberInput3, { size: "xs", w: 100, value: x, onChange: t7 })
871
+ ] });
872
+ $[21] = x;
873
+ $[22] = t8;
874
+ } else {
875
+ t8 = $[22];
876
+ }
877
+ let t9;
878
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
879
+ t9 = (e_0) => setY(Number(e_0));
880
+ $[23] = t9;
881
+ } else {
882
+ t9 = $[23];
883
+ }
884
+ let t10;
885
+ if ($[24] !== y) {
886
+ t10 = /* @__PURE__ */ jsxs9(Group3, { children: [
887
+ "y: ",
888
+ /* @__PURE__ */ jsx10(NumberInput3, { size: "xs", w: 100, value: y, onChange: t9 })
889
+ ] });
890
+ $[24] = y;
891
+ $[25] = t10;
892
+ } else {
893
+ t10 = $[25];
894
+ }
895
+ let t11;
896
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
897
+ t11 = (e_1) => setZ(Number(e_1));
898
+ $[26] = t11;
899
+ } else {
900
+ t11 = $[26];
901
+ }
902
+ let t12;
903
+ if ($[27] !== z) {
904
+ t12 = /* @__PURE__ */ jsxs9(Group3, { children: [
905
+ "z: ",
906
+ /* @__PURE__ */ jsx10(NumberInput3, { size: "xs", w: 100, value: z, onChange: t11 })
907
+ ] });
908
+ $[27] = z;
909
+ $[28] = t12;
910
+ } else {
911
+ t12 = $[28];
912
+ }
913
+ let t13;
914
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
915
+ t13 = (e_2) => setRadius(Number(e_2));
916
+ $[29] = t13;
917
+ } else {
918
+ t13 = $[29];
919
+ }
920
+ let t14;
921
+ if ($[30] !== radius) {
922
+ t14 = /* @__PURE__ */ jsxs9(Group3, { children: [
923
+ "r: ",
924
+ /* @__PURE__ */ jsx10(NumberInput3, { size: "xs", w: 100, value: radius, onChange: t13 })
925
+ ] });
926
+ $[30] = radius;
927
+ $[31] = t14;
928
+ } else {
929
+ t14 = $[31];
930
+ }
931
+ let t15;
932
+ if ($[32] !== t10 || $[33] !== t12 || $[34] !== t14 || $[35] !== t8) {
933
+ t15 = /* @__PURE__ */ jsxs9(Stack3, { children: [
934
+ t8,
935
+ t10,
936
+ t12,
937
+ t14
938
+ ] });
939
+ $[32] = t10;
940
+ $[33] = t12;
941
+ $[34] = t14;
942
+ $[35] = t8;
943
+ $[36] = t15;
944
+ } else {
945
+ t15 = $[36];
946
+ }
947
+ let t16;
948
+ if ($[37] !== data || $[38] !== id || $[39] !== selected || $[40] !== t15 || $[41] !== type) {
949
+ t16 = /* @__PURE__ */ jsx10(NodeContainer10, { id, selected, data, type, children: t15 });
950
+ $[37] = data;
951
+ $[38] = id;
952
+ $[39] = selected;
953
+ $[40] = t15;
954
+ $[41] = type;
955
+ $[42] = t16;
956
+ } else {
957
+ t16 = $[42];
958
+ }
959
+ return t16;
960
+ }
961
+ var position_grid_node_default = PositionGridNode;
962
+
963
+ export {
964
+ noise_billow_node_default,
965
+ noise_checkerboard_node_default,
966
+ noise_const_node_default,
967
+ noise_cylinders_node_default,
968
+ noise_perlin_node_default,
969
+ noise_ridgedmulti_node_default,
970
+ noise_spheres_node_default,
971
+ noise_voronoi_node_default,
972
+ position_const_node_default,
973
+ position_grid_node_default
974
+ };