@awesome-flow/noise 0.9.0 → 0.9.2

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