@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.
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 +15 -14
  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
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkRKTZQUWRcjs = require('./chunk-RKTZQUWR.cjs');
7
+ var _chunkD5QJ3563cjs = require('./chunk-D5QJ3563.cjs');
8
8
 
9
9
 
10
10
 
@@ -16,10 +16,10 @@ var _chunkRKTZQUWRcjs = require('./chunk-RKTZQUWR.cjs');
16
16
 
17
17
 
18
18
 
19
- var _chunkD5JM4EYQcjs = require('./chunk-D5JM4EYQ.cjs');
19
+ var _chunkO5DVJAMKcjs = require('./chunk-O5DVJAMK.cjs');
20
20
 
21
21
 
22
- var _chunkM67JHEU2cjs = require('./chunk-M67JHEU2.cjs');
22
+ var _chunkX2GXADE5cjs = require('./chunk-X2GXADE5.cjs');
23
23
 
24
24
 
25
25
 
@@ -30,7 +30,7 @@ var _chunkM67JHEU2cjs = require('./chunk-M67JHEU2.cjs');
30
30
 
31
31
 
32
32
 
33
- var _chunkTZCT2GZVcjs = require('./chunk-TZCT2GZV.cjs');
33
+ var _chunk76MMGOOYcjs = require('./chunk-76MMGOOY.cjs');
34
34
 
35
35
  // src/nodes/output/noise-logger-node.tsx
36
36
  var _hooks = require('@awesome-flow/core/hooks');
@@ -38,7 +38,12 @@ var _layout = require('@awesome-flow/core/layout');
38
38
  var _core = require('@mantine/core');
39
39
  var _react = require('react');
40
40
  var _jsxruntime = require('react/jsx-runtime');
41
- function NoiseLoggerNode({ id, selected, data, type }) {
41
+ function NoiseLoggerNode({
42
+ id,
43
+ selected,
44
+ data,
45
+ type
46
+ }) {
42
47
  const incoming = _hooks.useIncomingComputedData.call(void 0, id);
43
48
  const noise = _react.useMemo.call(void 0, () => _optionalChain([incoming, 'optionalAccess', _ => _.map, 'call', _2 => _2((p) => p.noise), 'access', _3 => _3.flat, 'call', _4 => _4()]), [incoming]);
44
49
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
@@ -62,6 +67,7 @@ function NoiseLoggerNode({ id, selected, data, type }) {
62
67
  var noise_logger_node_default = NoiseLoggerNode;
63
68
 
64
69
  // src/nodes/output/noise-output-node.tsx
70
+ var _compilerruntime = require('react/compiler-runtime');
65
71
  var _components = require('@awesome-flow/core/components');
66
72
 
67
73
 
@@ -72,40 +78,73 @@ var _components = require('@awesome-flow/core/components');
72
78
 
73
79
 
74
80
 
75
- var _libnoisesimplexts = require('libnoise-simplex-ts');
76
81
 
82
+ var _libnoisesimplexts = require('libnoise-simplex-ts');
77
83
 
78
- function NoiseBlendNode({ id, selected, data, type }) {
84
+ function NoiseBlendNode(t0) {
85
+ const $ = _compilerruntime.c.call(void 0, 17);
86
+ const {
87
+ id,
88
+ selected,
89
+ data,
90
+ type
91
+ } = t0;
79
92
  const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
80
- const onDataUpdated = _react.useCallback.call(void 0,
81
- (incomingData) => {
93
+ let t1;
94
+ if ($[0] !== id || $[1] !== updateComputedData) {
95
+ t1 = (incomingData) => {
82
96
  const incomingSources = incomingData["source" /* source */];
83
97
  const incomingControl = incomingData["control" /* control */];
84
98
  if (_optionalChain([incomingSources, 'optionalAccess', _14 => _14.length]) >= 2 && _optionalChain([incomingControl, 'optionalAccess', _15 => _15.length])) {
85
- const module = new (0, _libnoisesimplexts.Blend)(
86
- incomingSources[0].module,
87
- incomingSources[1].module,
88
- incomingControl[0].module
89
- );
90
- updateComputedData(id, { module });
99
+ const module = new (0, _libnoisesimplexts.Blend)(incomingSources[0].module, incomingSources[1].module, incomingControl[0].module);
100
+ updateComputedData(id, {
101
+ module
102
+ });
91
103
  }
92
- },
93
- []
94
- );
95
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
96
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
97
- _components.HandlesIncomingDataStatus,
98
- {
99
- nodeId: id,
100
- handles: data.handles,
101
- handleKey: "dataId",
102
- onDataUpdated,
103
- type: "target",
104
- resetComputedData: true
105
- }
106
- ),
107
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
108
- ] });
104
+ };
105
+ $[0] = id;
106
+ $[1] = updateComputedData;
107
+ $[2] = t1;
108
+ } else {
109
+ t1 = $[2];
110
+ }
111
+ const onDataUpdated = t1;
112
+ let t2;
113
+ if ($[3] !== data.handles || $[4] !== id || $[5] !== onDataUpdated) {
114
+ t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.HandlesIncomingDataStatus, { nodeId: id, handles: data.handles, handleKey: "dataId", onDataUpdated, type: "target", resetComputedData: true });
115
+ $[3] = data.handles;
116
+ $[4] = id;
117
+ $[5] = onDataUpdated;
118
+ $[6] = t2;
119
+ } else {
120
+ t2 = $[6];
121
+ }
122
+ let t3;
123
+ if ($[7] !== data.handles || $[8] !== id) {
124
+ t3 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" });
125
+ $[7] = data.handles;
126
+ $[8] = id;
127
+ $[9] = t3;
128
+ } else {
129
+ t3 = $[9];
130
+ }
131
+ let t4;
132
+ if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t2 || $[14] !== t3 || $[15] !== type) {
133
+ t4 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
134
+ t2,
135
+ t3
136
+ ] });
137
+ $[10] = data;
138
+ $[11] = id;
139
+ $[12] = selected;
140
+ $[13] = t2;
141
+ $[14] = t3;
142
+ $[15] = type;
143
+ $[16] = t4;
144
+ } else {
145
+ t4 = $[16];
146
+ }
147
+ return t4;
109
148
  }
110
149
  var noise_blend_node_default = NoiseBlendNode;
111
150
 
@@ -117,88 +156,171 @@ var noise_blend_node_default = NoiseBlendNode;
117
156
 
118
157
 
119
158
 
120
- function NoiseSelectNode({ id, selected, data, type }) {
159
+
160
+ function NoiseSelectNode(t0) {
161
+ const $ = _compilerruntime.c.call(void 0, 41);
162
+ const {
163
+ id,
164
+ selected,
165
+ data,
166
+ type
167
+ } = t0;
121
168
  const [edgeFalloff, setEdgeFalloff] = _react.useState.call(void 0, data.edgeFalloff);
122
169
  const [lowerBound, setLowerBound] = _react.useState.call(void 0, data.lowerBound);
123
170
  const [upperBound, setUpperBound] = _react.useState.call(void 0, data.upperBound);
124
171
  const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
125
172
  const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
126
- _react.useEffect.call(void 0, () => {
127
- updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
128
- }, [edgeFalloff, lowerBound, upperBound]);
129
- const onDataUpdated = _react.useCallback.call(void 0,
130
- (incomingData) => {
173
+ let t1;
174
+ let t2;
175
+ if ($[0] !== edgeFalloff || $[1] !== id || $[2] !== lowerBound || $[3] !== updateNodeData || $[4] !== upperBound) {
176
+ t1 = () => {
177
+ updateNodeData(id, {
178
+ edgeFalloff,
179
+ lowerBound,
180
+ upperBound
181
+ });
182
+ };
183
+ t2 = [edgeFalloff, lowerBound, upperBound, id, updateNodeData];
184
+ $[0] = edgeFalloff;
185
+ $[1] = id;
186
+ $[2] = lowerBound;
187
+ $[3] = updateNodeData;
188
+ $[4] = upperBound;
189
+ $[5] = t1;
190
+ $[6] = t2;
191
+ } else {
192
+ t1 = $[5];
193
+ t2 = $[6];
194
+ }
195
+ _react.useEffect.call(void 0, t1, t2);
196
+ let t3;
197
+ if ($[7] !== edgeFalloff || $[8] !== id || $[9] !== lowerBound || $[10] !== updateComputedData || $[11] !== upperBound) {
198
+ t3 = (incomingData) => {
131
199
  const incomingSources = incomingData["source" /* source */];
132
200
  const incomingControl = incomingData["control" /* control */];
133
201
  if (_optionalChain([incomingSources, 'optionalAccess', _16 => _16.length]) >= 2 && _optionalChain([incomingControl, 'optionalAccess', _17 => _17.length])) {
134
- const module = new (0, _libnoisesimplexts.Select)(
135
- incomingSources[0].module,
136
- incomingSources[1].module,
137
- incomingControl[0].module,
138
- edgeFalloff,
139
- lowerBound,
140
- upperBound
141
- );
142
- updateComputedData(id, { module });
202
+ const module = new (0, _libnoisesimplexts.Select)(incomingSources[0].module, incomingSources[1].module, incomingControl[0].module, edgeFalloff, lowerBound, upperBound);
203
+ updateComputedData(id, {
204
+ module
205
+ });
143
206
  }
144
- },
145
- []
146
- );
147
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
148
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
149
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
150
- "Edge Falloff:",
151
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
152
- _core.NumberInput,
153
- {
154
- size: "xs",
155
- w: 100,
156
- value: edgeFalloff,
157
- onChange: (e) => setEdgeFalloff(Number(e)),
158
- step: 0.1
159
- }
160
- )
161
- ] }),
162
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
163
- "Lower Bound:",
164
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
165
- _core.NumberInput,
166
- {
167
- size: "xs",
168
- w: 100,
169
- value: lowerBound,
170
- onChange: (e) => setLowerBound(Number(e)),
171
- step: 0.1
172
- }
173
- )
174
- ] }),
175
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
176
- "Upper Bound:",
177
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
178
- _core.NumberInput,
179
- {
180
- size: "xs",
181
- w: 100,
182
- value: upperBound,
183
- onChange: (e) => setUpperBound(Number(e)),
184
- step: 0.1
185
- }
186
- )
187
- ] }),
188
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
189
- _components.HandlesIncomingDataStatus,
190
- {
191
- nodeId: id,
192
- handles: data.handles,
193
- handleKey: "dataId",
194
- onDataUpdated,
195
- type: "target",
196
- resetComputedData: true
197
- }
198
- )
199
- ] }),
200
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
201
- ] });
207
+ };
208
+ $[7] = edgeFalloff;
209
+ $[8] = id;
210
+ $[9] = lowerBound;
211
+ $[10] = updateComputedData;
212
+ $[11] = upperBound;
213
+ $[12] = t3;
214
+ } else {
215
+ t3 = $[12];
216
+ }
217
+ const onDataUpdated = t3;
218
+ let t4;
219
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
220
+ t4 = (e) => setEdgeFalloff(Number(e));
221
+ $[13] = t4;
222
+ } else {
223
+ t4 = $[13];
224
+ }
225
+ let t5;
226
+ if ($[14] !== edgeFalloff) {
227
+ t5 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
228
+ "Edge Falloff:",
229
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: edgeFalloff, onChange: t4, step: 0.1 })
230
+ ] });
231
+ $[14] = edgeFalloff;
232
+ $[15] = t5;
233
+ } else {
234
+ t5 = $[15];
235
+ }
236
+ let t6;
237
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
238
+ t6 = (e_0) => setLowerBound(Number(e_0));
239
+ $[16] = t6;
240
+ } else {
241
+ t6 = $[16];
242
+ }
243
+ let t7;
244
+ if ($[17] !== lowerBound) {
245
+ t7 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
246
+ "Lower Bound:",
247
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: lowerBound, onChange: t6, step: 0.1 })
248
+ ] });
249
+ $[17] = lowerBound;
250
+ $[18] = t7;
251
+ } else {
252
+ t7 = $[18];
253
+ }
254
+ let t8;
255
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
256
+ t8 = (e_1) => setUpperBound(Number(e_1));
257
+ $[19] = t8;
258
+ } else {
259
+ t8 = $[19];
260
+ }
261
+ let t9;
262
+ if ($[20] !== upperBound) {
263
+ t9 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
264
+ "Upper Bound:",
265
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: upperBound, onChange: t8, step: 0.1 })
266
+ ] });
267
+ $[20] = upperBound;
268
+ $[21] = t9;
269
+ } else {
270
+ t9 = $[21];
271
+ }
272
+ let t10;
273
+ if ($[22] !== data.handles || $[23] !== id || $[24] !== onDataUpdated) {
274
+ t10 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.HandlesIncomingDataStatus, { nodeId: id, handles: data.handles, handleKey: "dataId", onDataUpdated, type: "target", resetComputedData: true });
275
+ $[22] = data.handles;
276
+ $[23] = id;
277
+ $[24] = onDataUpdated;
278
+ $[25] = t10;
279
+ } else {
280
+ t10 = $[25];
281
+ }
282
+ let t11;
283
+ if ($[26] !== t10 || $[27] !== t5 || $[28] !== t7 || $[29] !== t9) {
284
+ t11 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
285
+ t5,
286
+ t7,
287
+ t9,
288
+ t10
289
+ ] });
290
+ $[26] = t10;
291
+ $[27] = t5;
292
+ $[28] = t7;
293
+ $[29] = t9;
294
+ $[30] = t11;
295
+ } else {
296
+ t11 = $[30];
297
+ }
298
+ let t12;
299
+ if ($[31] !== data.handles || $[32] !== id) {
300
+ t12 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" });
301
+ $[31] = data.handles;
302
+ $[32] = id;
303
+ $[33] = t12;
304
+ } else {
305
+ t12 = $[33];
306
+ }
307
+ let t13;
308
+ if ($[34] !== data || $[35] !== id || $[36] !== selected || $[37] !== t11 || $[38] !== t12 || $[39] !== type) {
309
+ t13 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
310
+ t11,
311
+ t12
312
+ ] });
313
+ $[34] = data;
314
+ $[35] = id;
315
+ $[36] = selected;
316
+ $[37] = t11;
317
+ $[38] = t12;
318
+ $[39] = type;
319
+ $[40] = t13;
320
+ } else {
321
+ t13 = $[40];
322
+ }
323
+ return t13;
202
324
  }
203
325
  var noise_select_node_default = NoiseSelectNode;
204
326
 
@@ -208,50 +330,146 @@ var noise_select_node_default = NoiseSelectNode;
208
330
 
209
331
 
210
332
 
211
- function NoiseRawTextureNode({ id, selected, data, type }) {
333
+
334
+ function NoiseRawTextureNode(t0) {
335
+ const $ = _compilerruntime.c.call(void 0, 28);
336
+ const {
337
+ id,
338
+ selected,
339
+ data,
340
+ type
341
+ } = t0;
212
342
  const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
213
343
  const [dataLength, setDataLength] = _react.useState.call(void 0, 0);
214
344
  const [resolution, setResolution] = _react.useState.call(void 0, 0);
215
345
  const incoming = _hooks.useIncomingComputedData.call(void 0, id);
216
- const noise = _react.useMemo.call(void 0, () => _optionalChain([incoming, 'optionalAccess', _18 => _18.map, 'call', _19 => _19((p) => p.noise), 'access', _20 => _20.flat, 'call', _21 => _21()]), [incoming]);
217
- _react.useEffect.call(void 0, () => {
218
- if (_optionalChain([noise, 'optionalAccess', _22 => _22.length])) {
219
- const size = Math.ceil(Math.sqrt(noise.length));
220
- const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
221
- const dataArray = new Uint8Array(size * size * 4);
222
- dataArray.set(colors);
223
- setResolution(size);
224
- setDataLength(dataArray.length);
225
- updateComputedData(id, {
226
- textureData: dataArray,
227
- textureResolutionX: size,
228
- textureResolutionY: size
229
- });
230
- }
231
- }, [noise]);
232
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
233
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
234
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
235
- "Resolution: ",
236
- resolution,
237
- "x",
238
- resolution
239
- ] }),
240
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
241
- "Input Length: ",
242
- _optionalChain([noise, 'optionalAccess', _23 => _23.length]) || 0
243
- ] }),
244
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
245
- "Output Length (",
246
- resolution,
247
- "*",
248
- resolution,
249
- "*4): ",
250
- dataLength
251
- ] })
252
- ] }),
253
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
254
- ] });
346
+ let t1;
347
+ let t2;
348
+ if ($[0] !== incoming) {
349
+ t2 = _optionalChain([incoming, 'optionalAccess', _18 => _18.map, 'call', _19 => _19(_temp), 'access', _20 => _20.flat, 'call', _21 => _21()]);
350
+ $[0] = incoming;
351
+ $[1] = t2;
352
+ } else {
353
+ t2 = $[1];
354
+ }
355
+ t1 = t2;
356
+ const noise = t1;
357
+ let t3;
358
+ let t4;
359
+ if ($[2] !== id || $[3] !== noise || $[4] !== updateComputedData) {
360
+ t3 = () => {
361
+ if (_optionalChain([noise, 'optionalAccess', _22 => _22.length])) {
362
+ const size = Math.ceil(Math.sqrt(noise.length));
363
+ const colors = noise.map(_temp2).flat();
364
+ const dataArray = new Uint8Array(size * size * 4);
365
+ dataArray.set(colors);
366
+ setResolution(size);
367
+ setDataLength(dataArray.length);
368
+ updateComputedData(id, {
369
+ textureData: dataArray,
370
+ textureResolutionX: size,
371
+ textureResolutionY: size
372
+ });
373
+ }
374
+ };
375
+ t4 = [noise, updateComputedData, id];
376
+ $[2] = id;
377
+ $[3] = noise;
378
+ $[4] = updateComputedData;
379
+ $[5] = t3;
380
+ $[6] = t4;
381
+ } else {
382
+ t3 = $[5];
383
+ t4 = $[6];
384
+ }
385
+ _react.useEffect.call(void 0, t3, t4);
386
+ let t5;
387
+ if ($[7] !== resolution) {
388
+ t5 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
389
+ "Resolution: ",
390
+ resolution,
391
+ "x",
392
+ resolution
393
+ ] });
394
+ $[7] = resolution;
395
+ $[8] = t5;
396
+ } else {
397
+ t5 = $[8];
398
+ }
399
+ const t6 = _optionalChain([noise, 'optionalAccess', _23 => _23.length]) || 0;
400
+ let t7;
401
+ if ($[9] !== t6) {
402
+ t7 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
403
+ "Input Length: ",
404
+ t6
405
+ ] });
406
+ $[9] = t6;
407
+ $[10] = t7;
408
+ } else {
409
+ t7 = $[10];
410
+ }
411
+ let t8;
412
+ if ($[11] !== dataLength || $[12] !== resolution) {
413
+ t8 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
414
+ "Output Length (",
415
+ resolution,
416
+ "*",
417
+ resolution,
418
+ "*4): ",
419
+ dataLength
420
+ ] });
421
+ $[11] = dataLength;
422
+ $[12] = resolution;
423
+ $[13] = t8;
424
+ } else {
425
+ t8 = $[13];
426
+ }
427
+ let t9;
428
+ if ($[14] !== t5 || $[15] !== t7 || $[16] !== t8) {
429
+ t9 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
430
+ t5,
431
+ t7,
432
+ t8
433
+ ] });
434
+ $[14] = t5;
435
+ $[15] = t7;
436
+ $[16] = t8;
437
+ $[17] = t9;
438
+ } else {
439
+ t9 = $[17];
440
+ }
441
+ let t10;
442
+ if ($[18] !== data.handles || $[19] !== id) {
443
+ t10 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" });
444
+ $[18] = data.handles;
445
+ $[19] = id;
446
+ $[20] = t10;
447
+ } else {
448
+ t10 = $[20];
449
+ }
450
+ let t11;
451
+ if ($[21] !== data || $[22] !== id || $[23] !== selected || $[24] !== t10 || $[25] !== t9 || $[26] !== type) {
452
+ t11 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
453
+ t9,
454
+ t10
455
+ ] });
456
+ $[21] = data;
457
+ $[22] = id;
458
+ $[23] = selected;
459
+ $[24] = t10;
460
+ $[25] = t9;
461
+ $[26] = type;
462
+ $[27] = t11;
463
+ } else {
464
+ t11 = $[27];
465
+ }
466
+ return t11;
467
+ }
468
+ function _temp2(n) {
469
+ return [n.value * 255, n.value * 255, n.value * 255, 255];
470
+ }
471
+ function _temp(p) {
472
+ return p.noise;
255
473
  }
256
474
  var noise_raw_texture_node_default = NoiseRawTextureNode;
257
475
 
@@ -261,7 +479,12 @@ var noise_raw_texture_node_default = NoiseRawTextureNode;
261
479
 
262
480
 
263
481
 
264
- function PositionsLoggerNode({ id, selected, data, type }) {
482
+ function PositionsLoggerNode({
483
+ id,
484
+ selected,
485
+ data,
486
+ type
487
+ }) {
265
488
  const incoming = _hooks.useIncomingComputedData.call(void 0, id);
266
489
  const positions = _react.useMemo.call(void 0, () => {
267
490
  return _optionalChain([incoming, 'optionalAccess', _24 => _24.map, 'call', _25 => _25((p) => p.positions), 'access', _26 => _26.flat, 'call', _27 => _27()]);
@@ -688,11 +911,6 @@ var NoiseCurveNodeTemplateFactory = (_class15 = class {constructor() { _class15.
688
911
  connection: "target",
689
912
  maxConnections: 1
690
913
  },
691
- // {
692
- // position: Position.Left,
693
- // dataType: CoreHandleType.variableProperty,
694
- // connection: 'target',
695
- // },
696
914
  {
697
915
  position: _system.Position.Right,
698
916
  dataType: "module" /* module */,
@@ -1217,37 +1435,37 @@ var NoiseNodeType = /* @__PURE__ */ ((NoiseNodeType2) => {
1217
1435
  return NoiseNodeType2;
1218
1436
  })(NoiseNodeType || {});
1219
1437
  var noiseNodeTypes = {
1220
- ["group-module" /* groupModule */]: _chunkM67JHEU2cjs.module_group_node_default,
1221
- ["position" /* position */]: _chunkD5JM4EYQcjs.position_const_node_default,
1222
- ["grid" /* grid */]: _chunkD5JM4EYQcjs.position_grid_node_default,
1438
+ ["group-module" /* groupModule */]: _chunkX2GXADE5cjs.module_group_node_default,
1439
+ ["position" /* position */]: _chunkO5DVJAMKcjs.position_const_node_default,
1440
+ ["grid" /* grid */]: _chunkO5DVJAMKcjs.position_grid_node_default,
1223
1441
  ["noise-output" /* noiseOutput */]: noise_output_node_default,
1224
1442
  ["texture-data" /* textureData */]: noise_raw_texture_node_default,
1225
1443
  ["noise-logger" /* noiseLogger */]: noise_logger_node_default,
1226
1444
  ["position-logger" /* positionLogger */]: positions_logger_node_default,
1227
- ["noise-constant" /* noiseConst */]: _chunkD5JM4EYQcjs.noise_const_node_default,
1228
- ["noise-billow" /* noiseBillow */]: _chunkD5JM4EYQcjs.noise_billow_node_default,
1229
- ["noise-checkerboard" /* noiseCheckerboard */]: _chunkD5JM4EYQcjs.noise_checkerboard_node_default,
1230
- ["noise-cylinders" /* noiseCylinders */]: _chunkD5JM4EYQcjs.noise_cylinders_node_default,
1231
- ["noise-perlin" /* noisePerlin */]: _chunkD5JM4EYQcjs.noise_perlin_node_default,
1232
- ["noise-ridged-multi" /* noiseRidgedMulti */]: _chunkD5JM4EYQcjs.noise_ridgedmulti_node_default,
1233
- ["noise-spheres" /* noiseSpheres */]: _chunkD5JM4EYQcjs.noise_spheres_node_default,
1234
- ["noise-voronoi" /* noiseVoronoi */]: _chunkD5JM4EYQcjs.noise_voronoi_node_default,
1235
- ["noise-combiner" /* noiseCombine */]: _chunkTZCT2GZVcjs.noise_combine_node_default,
1236
- ["noise-clamp" /* noiseClamp */]: _chunkTZCT2GZVcjs.noise_clamp_node_default,
1237
- ["noise-abs" /* noiseAbs */]: _chunkTZCT2GZVcjs.noise_abs_node_default,
1238
- ["noise-normalize" /* noiseNormalize */]: _chunkTZCT2GZVcjs.noise_normalize_node_default,
1239
- ["noise-curve" /* noiseCurve */]: _chunkTZCT2GZVcjs.noise_curve_node_default,
1240
- ["noise-exponent" /* noiseExponent */]: _chunkTZCT2GZVcjs.noise_exponent_node_default,
1241
- ["noise-invert" /* noiseInvert */]: _chunkTZCT2GZVcjs.noise_invert_node_default,
1242
- ["noise-scale-bias" /* noiseScaleBias */]: _chunkTZCT2GZVcjs.noise_scale_bias_node_default,
1243
- ["noise-terrace" /* noiseTerrace */]: _chunkTZCT2GZVcjs.noise_terrace_node_default,
1445
+ ["noise-constant" /* noiseConst */]: _chunkO5DVJAMKcjs.noise_const_node_default,
1446
+ ["noise-billow" /* noiseBillow */]: _chunkO5DVJAMKcjs.noise_billow_node_default,
1447
+ ["noise-checkerboard" /* noiseCheckerboard */]: _chunkO5DVJAMKcjs.noise_checkerboard_node_default,
1448
+ ["noise-cylinders" /* noiseCylinders */]: _chunkO5DVJAMKcjs.noise_cylinders_node_default,
1449
+ ["noise-perlin" /* noisePerlin */]: _chunkO5DVJAMKcjs.noise_perlin_node_default,
1450
+ ["noise-ridged-multi" /* noiseRidgedMulti */]: _chunkO5DVJAMKcjs.noise_ridgedmulti_node_default,
1451
+ ["noise-spheres" /* noiseSpheres */]: _chunkO5DVJAMKcjs.noise_spheres_node_default,
1452
+ ["noise-voronoi" /* noiseVoronoi */]: _chunkO5DVJAMKcjs.noise_voronoi_node_default,
1453
+ ["noise-combiner" /* noiseCombine */]: _chunk76MMGOOYcjs.noise_combine_node_default,
1454
+ ["noise-clamp" /* noiseClamp */]: _chunk76MMGOOYcjs.noise_clamp_node_default,
1455
+ ["noise-abs" /* noiseAbs */]: _chunk76MMGOOYcjs.noise_abs_node_default,
1456
+ ["noise-normalize" /* noiseNormalize */]: _chunk76MMGOOYcjs.noise_normalize_node_default,
1457
+ ["noise-curve" /* noiseCurve */]: _chunk76MMGOOYcjs.noise_curve_node_default,
1458
+ ["noise-exponent" /* noiseExponent */]: _chunk76MMGOOYcjs.noise_exponent_node_default,
1459
+ ["noise-invert" /* noiseInvert */]: _chunk76MMGOOYcjs.noise_invert_node_default,
1460
+ ["noise-scale-bias" /* noiseScaleBias */]: _chunk76MMGOOYcjs.noise_scale_bias_node_default,
1461
+ ["noise-terrace" /* noiseTerrace */]: _chunk76MMGOOYcjs.noise_terrace_node_default,
1244
1462
  ["noise-blend" /* noiseBlend */]: noise_blend_node_default,
1245
1463
  ["noise-select" /* noiseSelect */]: noise_select_node_default,
1246
- ["noise-displace" /* noiseDisplace */]: _chunkRKTZQUWRcjs.noise_displace_node_default,
1247
- ["noise-rotate-point" /* noiseRotatePoint */]: _chunkRKTZQUWRcjs.noise_rotate_point_node_default,
1248
- ["noise-scale-point" /* noiseScalePoint */]: _chunkRKTZQUWRcjs.noise_scale_point_node_default,
1249
- ["noise-translate-point" /* noiseTranslatePoint */]: _chunkRKTZQUWRcjs.noise_translate_point_node_default,
1250
- ["noise-turbulence" /* noiseTurbulence */]: _chunkRKTZQUWRcjs.noise_turbulence_node_default
1464
+ ["noise-displace" /* noiseDisplace */]: _chunkD5QJ3563cjs.noise_displace_node_default,
1465
+ ["noise-rotate-point" /* noiseRotatePoint */]: _chunkD5QJ3563cjs.noise_rotate_point_node_default,
1466
+ ["noise-scale-point" /* noiseScalePoint */]: _chunkD5QJ3563cjs.noise_scale_point_node_default,
1467
+ ["noise-translate-point" /* noiseTranslatePoint */]: _chunkD5QJ3563cjs.noise_translate_point_node_default,
1468
+ ["noise-turbulence" /* noiseTurbulence */]: _chunkD5QJ3563cjs.noise_turbulence_node_default
1251
1469
  };
1252
1470
  var noiseNodeTemplates = {
1253
1471
  ["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
@@ -1285,15 +1503,25 @@ var noiseNodeTemplates = {
1285
1503
 
1286
1504
  // src/nodes/output/noise-output-node.tsx
1287
1505
 
1288
- function NoiseOutputNode({ id, selected, data, type }) {
1506
+ function NoiseOutputNode(t0) {
1507
+ const $ = _compilerruntime.c.call(void 0, 20);
1508
+ const {
1509
+ id,
1510
+ selected,
1511
+ data,
1512
+ type
1513
+ } = t0;
1289
1514
  const [size, setSize] = _react.useState.call(void 0, 0);
1290
1515
  const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
1291
- const onDataUpdated = _react.useCallback.call(void 0,
1292
- (handleData) => {
1516
+ let t1;
1517
+ if ($[0] !== id || $[1] !== updateComputedData) {
1518
+ t1 = (handleData) => {
1293
1519
  const incomingPositions = handleData["position" /* position */];
1294
1520
  const incomingModule = handleData["module" /* module */];
1295
1521
  if (_optionalChain([incomingPositions, 'optionalAccess', _31 => _31.length]) && _optionalChain([incomingModule, 'optionalAccess', _32 => _32.length]) && _optionalChain([incomingModule, 'access', _33 => _33[0], 'optionalAccess', _34 => _34.module])) {
1296
- const { module } = incomingModule[0];
1522
+ const {
1523
+ module
1524
+ } = incomingModule[0];
1297
1525
  const noise = [];
1298
1526
  for (const input of incomingPositions) {
1299
1527
  for (const position of input.positions) {
@@ -1304,30 +1532,69 @@ function NoiseOutputNode({ id, selected, data, type }) {
1304
1532
  });
1305
1533
  }
1306
1534
  }
1307
- updateComputedData(id, { noise, module });
1535
+ updateComputedData(id, {
1536
+ noise,
1537
+ module
1538
+ });
1308
1539
  setSize(noise.length);
1309
1540
  }
1310
- },
1311
- []
1312
- );
1313
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
1314
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1315
- _components.HandlesIncomingDataStatus,
1316
- {
1317
- nodeId: id,
1318
- handles: data.handles,
1319
- handleKey: "dataType",
1320
- onDataUpdated,
1321
- type: "target",
1322
- resetComputedData: true
1323
- }
1324
- ),
1325
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { mt: 5, children: [
1541
+ };
1542
+ $[0] = id;
1543
+ $[1] = updateComputedData;
1544
+ $[2] = t1;
1545
+ } else {
1546
+ t1 = $[2];
1547
+ }
1548
+ const onDataUpdated = t1;
1549
+ let t2;
1550
+ if ($[3] !== data.handles || $[4] !== id || $[5] !== onDataUpdated) {
1551
+ t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.HandlesIncomingDataStatus, { nodeId: id, handles: data.handles, handleKey: "dataType", onDataUpdated, type: "target", resetComputedData: true });
1552
+ $[3] = data.handles;
1553
+ $[4] = id;
1554
+ $[5] = onDataUpdated;
1555
+ $[6] = t2;
1556
+ } else {
1557
+ t2 = $[6];
1558
+ }
1559
+ let t3;
1560
+ if ($[7] !== size) {
1561
+ t3 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { mt: 5, children: [
1326
1562
  "Noise points: ",
1327
1563
  size
1328
- ] }),
1329
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
1330
- ] });
1564
+ ] });
1565
+ $[7] = size;
1566
+ $[8] = t3;
1567
+ } else {
1568
+ t3 = $[8];
1569
+ }
1570
+ let t4;
1571
+ if ($[9] !== data.handles || $[10] !== id) {
1572
+ t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" });
1573
+ $[9] = data.handles;
1574
+ $[10] = id;
1575
+ $[11] = t4;
1576
+ } else {
1577
+ t4 = $[11];
1578
+ }
1579
+ let t5;
1580
+ if ($[12] !== data || $[13] !== id || $[14] !== selected || $[15] !== t2 || $[16] !== t3 || $[17] !== t4 || $[18] !== type) {
1581
+ t5 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
1582
+ t2,
1583
+ t3,
1584
+ t4
1585
+ ] });
1586
+ $[12] = data;
1587
+ $[13] = id;
1588
+ $[14] = selected;
1589
+ $[15] = t2;
1590
+ $[16] = t3;
1591
+ $[17] = t4;
1592
+ $[18] = type;
1593
+ $[19] = t5;
1594
+ } else {
1595
+ t5 = $[19];
1596
+ }
1597
+ return t5;
1331
1598
  }
1332
1599
  var noise_output_node_default = NoiseOutputNode;
1333
1600