@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
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkRKTZQUWRcjs = require('./chunk-RKTZQUWR.cjs');
7
+ var _chunk36USJJC4cjs = require('./chunk-36USJJC4.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 _chunkLKDSXT7Icjs = require('./chunk-LKDSXT7I.cjs');
20
20
 
21
21
 
22
- var _chunkM67JHEU2cjs = require('./chunk-M67JHEU2.cjs');
22
+ var _chunkXC7VF5YCcjs = require('./chunk-XC7VF5YC.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 _chunkDQE5NXY7cjs = require('./chunk-DQE5NXY7.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: [
@@ -55,13 +60,13 @@ function NoiseLoggerNode({ id, selected, data, type }) {
55
60
  _optionalChain([v, 'access', _12 => _12.position, 'optionalAccess', _13 => _13.z]),
56
61
  ": ",
57
62
  v.value
58
- ] }, i))]) }),
59
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
63
+ ] }, i))]) })
60
64
  ] });
61
65
  }
62
66
  var noise_logger_node_default = NoiseLoggerNode;
63
67
 
64
68
  // src/nodes/output/noise-output-node.tsx
69
+ var _compilerruntime = require('react/compiler-runtime');
65
70
  var _components = require('@awesome-flow/core/components');
66
71
 
67
72
 
@@ -72,40 +77,60 @@ var _components = require('@awesome-flow/core/components');
72
77
 
73
78
 
74
79
 
75
- var _libnoisesimplexts = require('libnoise-simplex-ts');
76
80
 
81
+ var _libnoisesimplexts = require('libnoise-simplex-ts');
77
82
 
78
- function NoiseBlendNode({ id, selected, data, type }) {
83
+ function NoiseBlendNode(t0) {
84
+ const $ = _compilerruntime.c.call(void 0, 13);
85
+ const {
86
+ id,
87
+ selected,
88
+ data,
89
+ type
90
+ } = t0;
79
91
  const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
80
- const onDataUpdated = _react.useCallback.call(void 0,
81
- (incomingData) => {
92
+ let t1;
93
+ if ($[0] !== id || $[1] !== updateComputedData) {
94
+ t1 = (incomingData) => {
82
95
  const incomingSources = incomingData["source" /* source */];
83
96
  const incomingControl = incomingData["control" /* control */];
84
97
  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 });
91
- }
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
98
+ const module = new (0, _libnoisesimplexts.Blend)(incomingSources[0].module, incomingSources[1].module, incomingControl[0].module);
99
+ updateComputedData(id, {
100
+ module
101
+ });
105
102
  }
106
- ),
107
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
108
- ] });
103
+ };
104
+ $[0] = id;
105
+ $[1] = updateComputedData;
106
+ $[2] = t1;
107
+ } else {
108
+ t1 = $[2];
109
+ }
110
+ const onDataUpdated = t1;
111
+ let t2;
112
+ if ($[3] !== data.handles || $[4] !== id || $[5] !== onDataUpdated) {
113
+ t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.HandlesIncomingDataStatus, { nodeId: id, handles: data.handles, groupBy: "dataId", onDataUpdated, type: "target", resetComputedData: true });
114
+ $[3] = data.handles;
115
+ $[4] = id;
116
+ $[5] = onDataUpdated;
117
+ $[6] = t2;
118
+ } else {
119
+ t2 = $[6];
120
+ }
121
+ let t3;
122
+ if ($[7] !== data || $[8] !== id || $[9] !== selected || $[10] !== t2 || $[11] !== type) {
123
+ t3 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: t2 });
124
+ $[7] = data;
125
+ $[8] = id;
126
+ $[9] = selected;
127
+ $[10] = t2;
128
+ $[11] = type;
129
+ $[12] = t3;
130
+ } else {
131
+ t3 = $[12];
132
+ }
133
+ return t3;
109
134
  }
110
135
  var noise_blend_node_default = NoiseBlendNode;
111
136
 
@@ -117,88 +142,158 @@ var noise_blend_node_default = NoiseBlendNode;
117
142
 
118
143
 
119
144
 
120
- function NoiseSelectNode({ id, selected, data, type }) {
145
+
146
+ function NoiseSelectNode(t0) {
147
+ const $ = _compilerruntime.c.call(void 0, 37);
148
+ const {
149
+ id,
150
+ selected,
151
+ data,
152
+ type
153
+ } = t0;
121
154
  const [edgeFalloff, setEdgeFalloff] = _react.useState.call(void 0, data.edgeFalloff);
122
155
  const [lowerBound, setLowerBound] = _react.useState.call(void 0, data.lowerBound);
123
156
  const [upperBound, setUpperBound] = _react.useState.call(void 0, data.upperBound);
124
157
  const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
125
158
  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) => {
159
+ let t1;
160
+ let t2;
161
+ if ($[0] !== edgeFalloff || $[1] !== id || $[2] !== lowerBound || $[3] !== updateNodeData || $[4] !== upperBound) {
162
+ t1 = () => {
163
+ updateNodeData(id, {
164
+ edgeFalloff,
165
+ lowerBound,
166
+ upperBound
167
+ });
168
+ };
169
+ t2 = [edgeFalloff, lowerBound, upperBound, id, updateNodeData];
170
+ $[0] = edgeFalloff;
171
+ $[1] = id;
172
+ $[2] = lowerBound;
173
+ $[3] = updateNodeData;
174
+ $[4] = upperBound;
175
+ $[5] = t1;
176
+ $[6] = t2;
177
+ } else {
178
+ t1 = $[5];
179
+ t2 = $[6];
180
+ }
181
+ _react.useEffect.call(void 0, t1, t2);
182
+ let t3;
183
+ if ($[7] !== edgeFalloff || $[8] !== id || $[9] !== lowerBound || $[10] !== updateComputedData || $[11] !== upperBound) {
184
+ t3 = (incomingData) => {
131
185
  const incomingSources = incomingData["source" /* source */];
132
186
  const incomingControl = incomingData["control" /* control */];
133
187
  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 });
188
+ const module = new (0, _libnoisesimplexts.Select)(incomingSources[0].module, incomingSources[1].module, incomingControl[0].module, edgeFalloff, lowerBound, upperBound);
189
+ updateComputedData(id, {
190
+ module
191
+ });
143
192
  }
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
- ] });
193
+ };
194
+ $[7] = edgeFalloff;
195
+ $[8] = id;
196
+ $[9] = lowerBound;
197
+ $[10] = updateComputedData;
198
+ $[11] = upperBound;
199
+ $[12] = t3;
200
+ } else {
201
+ t3 = $[12];
202
+ }
203
+ const onDataUpdated = t3;
204
+ let t4;
205
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
206
+ t4 = (e) => setEdgeFalloff(Number(e));
207
+ $[13] = t4;
208
+ } else {
209
+ t4 = $[13];
210
+ }
211
+ let t5;
212
+ if ($[14] !== edgeFalloff) {
213
+ t5 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
214
+ "Edge Falloff:",
215
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: edgeFalloff, onChange: t4, step: 0.1 })
216
+ ] });
217
+ $[14] = edgeFalloff;
218
+ $[15] = t5;
219
+ } else {
220
+ t5 = $[15];
221
+ }
222
+ let t6;
223
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
224
+ t6 = (e_0) => setLowerBound(Number(e_0));
225
+ $[16] = t6;
226
+ } else {
227
+ t6 = $[16];
228
+ }
229
+ let t7;
230
+ if ($[17] !== lowerBound) {
231
+ t7 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
232
+ "Lower Bound:",
233
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: lowerBound, onChange: t6, step: 0.1 })
234
+ ] });
235
+ $[17] = lowerBound;
236
+ $[18] = t7;
237
+ } else {
238
+ t7 = $[18];
239
+ }
240
+ let t8;
241
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
242
+ t8 = (e_1) => setUpperBound(Number(e_1));
243
+ $[19] = t8;
244
+ } else {
245
+ t8 = $[19];
246
+ }
247
+ let t9;
248
+ if ($[20] !== upperBound) {
249
+ t9 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
250
+ "Upper Bound:",
251
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: upperBound, onChange: t8, step: 0.1 })
252
+ ] });
253
+ $[20] = upperBound;
254
+ $[21] = t9;
255
+ } else {
256
+ t9 = $[21];
257
+ }
258
+ let t10;
259
+ if ($[22] !== data.handles || $[23] !== id || $[24] !== onDataUpdated) {
260
+ t10 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.HandlesIncomingDataStatus, { nodeId: id, handles: data.handles, groupBy: "dataId", onDataUpdated, type: "target", resetComputedData: true });
261
+ $[22] = data.handles;
262
+ $[23] = id;
263
+ $[24] = onDataUpdated;
264
+ $[25] = t10;
265
+ } else {
266
+ t10 = $[25];
267
+ }
268
+ let t11;
269
+ if ($[26] !== t10 || $[27] !== t5 || $[28] !== t7 || $[29] !== t9) {
270
+ t11 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
271
+ t5,
272
+ t7,
273
+ t9,
274
+ t10
275
+ ] });
276
+ $[26] = t10;
277
+ $[27] = t5;
278
+ $[28] = t7;
279
+ $[29] = t9;
280
+ $[30] = t11;
281
+ } else {
282
+ t11 = $[30];
283
+ }
284
+ let t12;
285
+ if ($[31] !== data || $[32] !== id || $[33] !== selected || $[34] !== t11 || $[35] !== type) {
286
+ t12 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: t11 });
287
+ $[31] = data;
288
+ $[32] = id;
289
+ $[33] = selected;
290
+ $[34] = t11;
291
+ $[35] = type;
292
+ $[36] = t12;
293
+ } else {
294
+ t12 = $[36];
295
+ }
296
+ return t12;
202
297
  }
203
298
  var noise_select_node_default = NoiseSelectNode;
204
299
 
@@ -208,50 +303,133 @@ var noise_select_node_default = NoiseSelectNode;
208
303
 
209
304
 
210
305
 
211
- function NoiseRawTextureNode({ id, selected, data, type }) {
306
+
307
+ function NoiseRawTextureNode(t0) {
308
+ const $ = _compilerruntime.c.call(void 0, 24);
309
+ const {
310
+ id,
311
+ selected,
312
+ data,
313
+ type
314
+ } = t0;
212
315
  const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
213
316
  const [dataLength, setDataLength] = _react.useState.call(void 0, 0);
214
317
  const [resolution, setResolution] = _react.useState.call(void 0, 0);
215
318
  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
- ] });
319
+ let t1;
320
+ let t2;
321
+ if ($[0] !== incoming) {
322
+ t2 = _optionalChain([incoming, 'optionalAccess', _18 => _18.map, 'call', _19 => _19(_temp), 'access', _20 => _20.flat, 'call', _21 => _21()]);
323
+ $[0] = incoming;
324
+ $[1] = t2;
325
+ } else {
326
+ t2 = $[1];
327
+ }
328
+ t1 = t2;
329
+ const noise = t1;
330
+ let t3;
331
+ let t4;
332
+ if ($[2] !== id || $[3] !== noise || $[4] !== updateComputedData) {
333
+ t3 = () => {
334
+ if (_optionalChain([noise, 'optionalAccess', _22 => _22.length])) {
335
+ const size = Math.ceil(Math.sqrt(noise.length));
336
+ const colors = noise.map(_temp2).flat();
337
+ const dataArray = new Uint8Array(size * size * 4);
338
+ dataArray.set(colors);
339
+ setResolution(size);
340
+ setDataLength(dataArray.length);
341
+ updateComputedData(id, {
342
+ textureData: dataArray,
343
+ textureResolutionX: size,
344
+ textureResolutionY: size
345
+ });
346
+ }
347
+ };
348
+ t4 = [noise, updateComputedData, id];
349
+ $[2] = id;
350
+ $[3] = noise;
351
+ $[4] = updateComputedData;
352
+ $[5] = t3;
353
+ $[6] = t4;
354
+ } else {
355
+ t3 = $[5];
356
+ t4 = $[6];
357
+ }
358
+ _react.useEffect.call(void 0, t3, t4);
359
+ let t5;
360
+ if ($[7] !== resolution) {
361
+ t5 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
362
+ "Resolution: ",
363
+ resolution,
364
+ "x",
365
+ resolution
366
+ ] });
367
+ $[7] = resolution;
368
+ $[8] = t5;
369
+ } else {
370
+ t5 = $[8];
371
+ }
372
+ const t6 = _optionalChain([noise, 'optionalAccess', _23 => _23.length]) || 0;
373
+ let t7;
374
+ if ($[9] !== t6) {
375
+ t7 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
376
+ "Input Length: ",
377
+ t6
378
+ ] });
379
+ $[9] = t6;
380
+ $[10] = t7;
381
+ } else {
382
+ t7 = $[10];
383
+ }
384
+ let t8;
385
+ if ($[11] !== dataLength || $[12] !== resolution) {
386
+ t8 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
387
+ "Output Length (",
388
+ resolution,
389
+ "*",
390
+ resolution,
391
+ "*4): ",
392
+ dataLength
393
+ ] });
394
+ $[11] = dataLength;
395
+ $[12] = resolution;
396
+ $[13] = t8;
397
+ } else {
398
+ t8 = $[13];
399
+ }
400
+ let t9;
401
+ if ($[14] !== t5 || $[15] !== t7 || $[16] !== t8) {
402
+ t9 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
403
+ t5,
404
+ t7,
405
+ t8
406
+ ] });
407
+ $[14] = t5;
408
+ $[15] = t7;
409
+ $[16] = t8;
410
+ $[17] = t9;
411
+ } else {
412
+ t9 = $[17];
413
+ }
414
+ let t10;
415
+ if ($[18] !== data || $[19] !== id || $[20] !== selected || $[21] !== t9 || $[22] !== type) {
416
+ t10 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: t9 });
417
+ $[18] = data;
418
+ $[19] = id;
419
+ $[20] = selected;
420
+ $[21] = t9;
421
+ $[22] = type;
422
+ $[23] = t10;
423
+ } else {
424
+ t10 = $[23];
425
+ }
426
+ return t10;
427
+ }
428
+ function _temp2(n) {
429
+ return [n.value * 255, n.value * 255, n.value * 255, 255];
430
+ }
431
+ function _temp(p) {
432
+ return p.noise;
255
433
  }
256
434
  var noise_raw_texture_node_default = NoiseRawTextureNode;
257
435
 
@@ -261,7 +439,12 @@ var noise_raw_texture_node_default = NoiseRawTextureNode;
261
439
 
262
440
 
263
441
 
264
- function PositionsLoggerNode({ id, selected, data, type }) {
442
+ function PositionsLoggerNode({
443
+ id,
444
+ selected,
445
+ data,
446
+ type
447
+ }) {
265
448
  const incoming = _hooks.useIncomingComputedData.call(void 0, id);
266
449
  const positions = _react.useMemo.call(void 0, () => {
267
450
  return _optionalChain([incoming, 'optionalAccess', _24 => _24.map, 'call', _25 => _25((p) => p.positions), 'access', _26 => _26.flat, 'call', _27 => _27()]);
@@ -278,8 +461,7 @@ function PositionsLoggerNode({ id, selected, data, type }) {
278
461
  v.y,
279
462
  ":",
280
463
  v.z
281
- ] }, i))]) }),
282
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
464
+ ] }, i))]) })
283
465
  ] });
284
466
  }
285
467
  var positions_logger_node_default = PositionsLoggerNode;
@@ -688,11 +870,6 @@ var NoiseCurveNodeTemplateFactory = (_class15 = class {constructor() { _class15.
688
870
  connection: "target",
689
871
  maxConnections: 1
690
872
  },
691
- // {
692
- // position: Position.Left,
693
- // dataType: CoreHandleType.variableProperty,
694
- // connection: 'target',
695
- // },
696
873
  {
697
874
  position: _system.Position.Right,
698
875
  dataType: "module" /* module */,
@@ -1217,37 +1394,37 @@ var NoiseNodeType = /* @__PURE__ */ ((NoiseNodeType2) => {
1217
1394
  return NoiseNodeType2;
1218
1395
  })(NoiseNodeType || {});
1219
1396
  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,
1397
+ ["group-module" /* groupModule */]: _chunkXC7VF5YCcjs.module_group_node_default,
1398
+ ["position" /* position */]: _chunkLKDSXT7Icjs.position_const_node_default,
1399
+ ["grid" /* grid */]: _chunkLKDSXT7Icjs.position_grid_node_default,
1223
1400
  ["noise-output" /* noiseOutput */]: noise_output_node_default,
1224
1401
  ["texture-data" /* textureData */]: noise_raw_texture_node_default,
1225
1402
  ["noise-logger" /* noiseLogger */]: noise_logger_node_default,
1226
1403
  ["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,
1404
+ ["noise-constant" /* noiseConst */]: _chunkLKDSXT7Icjs.noise_const_node_default,
1405
+ ["noise-billow" /* noiseBillow */]: _chunkLKDSXT7Icjs.noise_billow_node_default,
1406
+ ["noise-checkerboard" /* noiseCheckerboard */]: _chunkLKDSXT7Icjs.noise_checkerboard_node_default,
1407
+ ["noise-cylinders" /* noiseCylinders */]: _chunkLKDSXT7Icjs.noise_cylinders_node_default,
1408
+ ["noise-perlin" /* noisePerlin */]: _chunkLKDSXT7Icjs.noise_perlin_node_default,
1409
+ ["noise-ridged-multi" /* noiseRidgedMulti */]: _chunkLKDSXT7Icjs.noise_ridgedmulti_node_default,
1410
+ ["noise-spheres" /* noiseSpheres */]: _chunkLKDSXT7Icjs.noise_spheres_node_default,
1411
+ ["noise-voronoi" /* noiseVoronoi */]: _chunkLKDSXT7Icjs.noise_voronoi_node_default,
1412
+ ["noise-combiner" /* noiseCombine */]: _chunkDQE5NXY7cjs.noise_combine_node_default,
1413
+ ["noise-clamp" /* noiseClamp */]: _chunkDQE5NXY7cjs.noise_clamp_node_default,
1414
+ ["noise-abs" /* noiseAbs */]: _chunkDQE5NXY7cjs.noise_abs_node_default,
1415
+ ["noise-normalize" /* noiseNormalize */]: _chunkDQE5NXY7cjs.noise_normalize_node_default,
1416
+ ["noise-curve" /* noiseCurve */]: _chunkDQE5NXY7cjs.noise_curve_node_default,
1417
+ ["noise-exponent" /* noiseExponent */]: _chunkDQE5NXY7cjs.noise_exponent_node_default,
1418
+ ["noise-invert" /* noiseInvert */]: _chunkDQE5NXY7cjs.noise_invert_node_default,
1419
+ ["noise-scale-bias" /* noiseScaleBias */]: _chunkDQE5NXY7cjs.noise_scale_bias_node_default,
1420
+ ["noise-terrace" /* noiseTerrace */]: _chunkDQE5NXY7cjs.noise_terrace_node_default,
1244
1421
  ["noise-blend" /* noiseBlend */]: noise_blend_node_default,
1245
1422
  ["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
1423
+ ["noise-displace" /* noiseDisplace */]: _chunk36USJJC4cjs.noise_displace_node_default,
1424
+ ["noise-rotate-point" /* noiseRotatePoint */]: _chunk36USJJC4cjs.noise_rotate_point_node_default,
1425
+ ["noise-scale-point" /* noiseScalePoint */]: _chunk36USJJC4cjs.noise_scale_point_node_default,
1426
+ ["noise-translate-point" /* noiseTranslatePoint */]: _chunk36USJJC4cjs.noise_translate_point_node_default,
1427
+ ["noise-turbulence" /* noiseTurbulence */]: _chunk36USJJC4cjs.noise_turbulence_node_default
1251
1428
  };
1252
1429
  var noiseNodeTemplates = {
1253
1430
  ["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
@@ -1285,15 +1462,25 @@ var noiseNodeTemplates = {
1285
1462
 
1286
1463
  // src/nodes/output/noise-output-node.tsx
1287
1464
 
1288
- function NoiseOutputNode({ id, selected, data, type }) {
1465
+ function NoiseOutputNode(t0) {
1466
+ const $ = _compilerruntime.c.call(void 0, 16);
1467
+ const {
1468
+ id,
1469
+ selected,
1470
+ data,
1471
+ type
1472
+ } = t0;
1289
1473
  const [size, setSize] = _react.useState.call(void 0, 0);
1290
1474
  const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
1291
- const onDataUpdated = _react.useCallback.call(void 0,
1292
- (handleData) => {
1475
+ let t1;
1476
+ if ($[0] !== id || $[1] !== updateComputedData) {
1477
+ t1 = (handleData) => {
1293
1478
  const incomingPositions = handleData["position" /* position */];
1294
1479
  const incomingModule = handleData["module" /* module */];
1295
1480
  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];
1481
+ const {
1482
+ module
1483
+ } = incomingModule[0];
1297
1484
  const noise = [];
1298
1485
  for (const input of incomingPositions) {
1299
1486
  for (const position of input.positions) {
@@ -1304,30 +1491,58 @@ function NoiseOutputNode({ id, selected, data, type }) {
1304
1491
  });
1305
1492
  }
1306
1493
  }
1307
- updateComputedData(id, { noise, module });
1494
+ updateComputedData(id, {
1495
+ noise,
1496
+ module
1497
+ });
1308
1498
  setSize(noise.length);
1309
1499
  }
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: [
1500
+ };
1501
+ $[0] = id;
1502
+ $[1] = updateComputedData;
1503
+ $[2] = t1;
1504
+ } else {
1505
+ t1 = $[2];
1506
+ }
1507
+ const onDataUpdated = t1;
1508
+ let t2;
1509
+ if ($[3] !== data.handles || $[4] !== id || $[5] !== onDataUpdated) {
1510
+ t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.HandlesIncomingDataStatus, { nodeId: id, handles: data.handles, groupBy: "dataType", onDataUpdated, type: "target", resetComputedData: true });
1511
+ $[3] = data.handles;
1512
+ $[4] = id;
1513
+ $[5] = onDataUpdated;
1514
+ $[6] = t2;
1515
+ } else {
1516
+ t2 = $[6];
1517
+ }
1518
+ let t3;
1519
+ if ($[7] !== size) {
1520
+ t3 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { mt: 5, children: [
1326
1521
  "Noise points: ",
1327
1522
  size
1328
- ] }),
1329
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
1330
- ] });
1523
+ ] });
1524
+ $[7] = size;
1525
+ $[8] = t3;
1526
+ } else {
1527
+ t3 = $[8];
1528
+ }
1529
+ let t4;
1530
+ if ($[9] !== data || $[10] !== id || $[11] !== selected || $[12] !== t2 || $[13] !== t3 || $[14] !== type) {
1531
+ t4 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
1532
+ t2,
1533
+ t3
1534
+ ] });
1535
+ $[9] = data;
1536
+ $[10] = id;
1537
+ $[11] = selected;
1538
+ $[12] = t2;
1539
+ $[13] = t3;
1540
+ $[14] = type;
1541
+ $[15] = t4;
1542
+ } else {
1543
+ t4 = $[15];
1544
+ }
1545
+ return t4;
1331
1546
  }
1332
1547
  var noise_output_node_default = NoiseOutputNode;
1333
1548