@awesome-flow/noise 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/abstract/index.cjs +6 -6
  2. package/dist/abstract/index.d.cts +10 -8
  3. package/dist/abstract/index.d.ts +10 -8
  4. package/dist/abstract/index.js +5 -5
  5. package/dist/chunk-4YL2V7SE.js +641 -0
  6. package/dist/chunk-76MMGOOY.cjs +1008 -0
  7. package/dist/{chunk-BG6U3TYO.js → chunk-BE4RLT5P.js} +445 -178
  8. package/dist/chunk-D5QJ3563.cjs +641 -0
  9. package/dist/chunk-EHBNVDTI.js +60 -0
  10. package/dist/chunk-L45ZU7VL.js +1008 -0
  11. package/dist/{chunk-ACWBUUZ7.cjs → chunk-MIYOMNAG.cjs} +467 -200
  12. package/dist/chunk-O5DVJAMK.cjs +974 -0
  13. package/dist/chunk-S2ZGHJ75.js +974 -0
  14. package/dist/chunk-X2GXADE5.cjs +60 -0
  15. package/dist/{index-mlK0X4O1.d.ts → index-DAAmYCPU.d.ts} +1 -1
  16. package/dist/{index-CfiOpOzX.d.cts → index-EzT2GjIx.d.cts} +1 -1
  17. package/dist/{node-props-CAV2WNDN.d.ts → node-props-D8SnrgWa.d.cts} +1 -1
  18. package/dist/{node-props-CAV2WNDN.d.cts → node-props-D8SnrgWa.d.ts} +1 -1
  19. package/dist/nodes/generators/index.cjs +2 -2
  20. package/dist/nodes/generators/index.d.cts +1 -1
  21. package/dist/nodes/generators/index.d.ts +1 -1
  22. package/dist/nodes/generators/index.js +1 -1
  23. package/dist/nodes/groups/index.cjs +2 -2
  24. package/dist/nodes/groups/index.d.cts +1 -1
  25. package/dist/nodes/groups/index.d.ts +1 -1
  26. package/dist/nodes/groups/index.js +1 -1
  27. package/dist/nodes/index.cjs +6 -6
  28. package/dist/nodes/index.d.cts +4 -2
  29. package/dist/nodes/index.d.ts +4 -2
  30. package/dist/nodes/index.js +5 -5
  31. package/dist/nodes/modifiers/index.cjs +2 -2
  32. package/dist/nodes/modifiers/index.d.cts +6 -19
  33. package/dist/nodes/modifiers/index.d.ts +6 -19
  34. package/dist/nodes/modifiers/index.js +1 -1
  35. package/dist/nodes/output/index.cjs +6 -6
  36. package/dist/nodes/output/index.js +5 -5
  37. package/dist/nodes/selectors/index.cjs +6 -6
  38. package/dist/nodes/selectors/index.d.cts +1 -1
  39. package/dist/nodes/selectors/index.d.ts +1 -1
  40. package/dist/nodes/selectors/index.js +5 -5
  41. package/dist/nodes/transformers/index.cjs +2 -2
  42. package/dist/nodes/transformers/index.d.cts +1 -1
  43. package/dist/nodes/transformers/index.d.ts +1 -1
  44. package/dist/nodes/transformers/index.js +1 -1
  45. package/dist/noise-terrace-node-D2ezdTnC.d.cts +22 -0
  46. package/dist/noise-terrace-node-DW81ZQk6.d.ts +22 -0
  47. package/dist/templates/generators/index.cjs +6 -6
  48. package/dist/templates/generators/index.d.cts +1 -1
  49. package/dist/templates/generators/index.d.ts +1 -1
  50. package/dist/templates/generators/index.js +5 -5
  51. package/dist/templates/groups/index.cjs +6 -6
  52. package/dist/templates/groups/index.js +5 -5
  53. package/dist/templates/index.cjs +6 -6
  54. package/dist/templates/index.d.cts +2 -2
  55. package/dist/templates/index.d.ts +2 -2
  56. package/dist/templates/index.js +5 -5
  57. package/dist/templates/modifiers/index.cjs +6 -6
  58. package/dist/templates/modifiers/index.d.cts +1 -1
  59. package/dist/templates/modifiers/index.d.ts +1 -1
  60. package/dist/templates/modifiers/index.js +5 -5
  61. package/dist/templates/output/index.cjs +6 -6
  62. package/dist/templates/output/index.js +5 -5
  63. package/dist/templates/selectors/index.cjs +6 -6
  64. package/dist/templates/selectors/index.d.cts +1 -1
  65. package/dist/templates/selectors/index.d.ts +1 -1
  66. package/dist/templates/selectors/index.js +5 -5
  67. package/dist/templates/transformers/index.cjs +6 -6
  68. package/dist/templates/transformers/index.d.cts +2 -2
  69. package/dist/templates/transformers/index.d.ts +2 -2
  70. package/dist/templates/transformers/index.js +5 -5
  71. package/package.json +6 -5
  72. package/dist/chunk-D5JM4EYQ.cjs +0 -305
  73. package/dist/chunk-DWSACR65.js +0 -305
  74. package/dist/chunk-KHIIB5TH.js +0 -93
  75. package/dist/chunk-M67JHEU2.cjs +0 -93
  76. package/dist/chunk-PS5VUND5.js +0 -348
  77. package/dist/chunk-RDQ4BOOV.js +0 -522
  78. package/dist/chunk-RKTZQUWR.cjs +0 -348
  79. package/dist/chunk-TZCT2GZV.cjs +0 -522
@@ -4,7 +4,7 @@ import {
4
4
  noise_scale_point_node_default,
5
5
  noise_translate_point_node_default,
6
6
  noise_turbulence_node_default
7
- } from "./chunk-PS5VUND5.js";
7
+ } from "./chunk-4YL2V7SE.js";
8
8
  import {
9
9
  noise_billow_node_default,
10
10
  noise_checkerboard_node_default,
@@ -16,10 +16,10 @@ import {
16
16
  noise_voronoi_node_default,
17
17
  position_const_node_default,
18
18
  position_grid_node_default
19
- } from "./chunk-DWSACR65.js";
19
+ } from "./chunk-S2ZGHJ75.js";
20
20
  import {
21
21
  module_group_node_default
22
- } from "./chunk-KHIIB5TH.js";
22
+ } from "./chunk-EHBNVDTI.js";
23
23
  import {
24
24
  noise_abs_node_default,
25
25
  noise_clamp_node_default,
@@ -30,7 +30,7 @@ import {
30
30
  noise_normalize_node_default,
31
31
  noise_scale_bias_node_default,
32
32
  noise_terrace_node_default
33
- } from "./chunk-RDQ4BOOV.js";
33
+ } from "./chunk-L45ZU7VL.js";
34
34
 
35
35
  // src/nodes/output/noise-logger-node.tsx
36
36
  import { useIncomingComputedData } from "@awesome-flow/core/hooks";
@@ -38,7 +38,12 @@ import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
38
38
  import { Divider, Stack, Text } from "@mantine/core";
39
39
  import { useMemo } from "react";
40
40
  import { jsx, jsxs } from "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 = useIncomingComputedData(id);
43
48
  const noise = useMemo(() => incoming?.map((p) => p.noise).flat(), [incoming]);
44
49
  return /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
@@ -62,196 +67,409 @@ 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
+ import { c as _c4 } from "react/compiler-runtime";
65
71
  import { HandlesIncomingDataStatus as HandlesIncomingDataStatus3 } from "@awesome-flow/core/components";
66
72
  import { useUpdateNodeComputedData as useUpdateNodeComputedData4 } from "@awesome-flow/core/hooks";
67
73
  import { NodeContainer as NodeContainer6, NodeTrackConnections as NodeTrackConnections6 } from "@awesome-flow/core/layout";
68
74
  import { Text as Text3 } from "@mantine/core";
69
- import { useCallback as useCallback3, useState as useState3 } from "react";
75
+ import { useState as useState3 } from "react";
70
76
 
71
77
  // src/nodes/selectors/noise-blend-node.tsx
78
+ import { c as _c } from "react/compiler-runtime";
72
79
  import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
73
80
  import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
74
81
  import { NodeContainer as NodeContainer2, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
75
82
  import { Blend } from "libnoise-simplex-ts";
76
- import { useCallback } from "react";
77
83
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
78
- function NoiseBlendNode({ id, selected, data, type }) {
84
+ function NoiseBlendNode(t0) {
85
+ const $ = _c(17);
86
+ const {
87
+ id,
88
+ selected,
89
+ data,
90
+ type
91
+ } = t0;
79
92
  const updateComputedData = useUpdateNodeComputedData();
80
- const onDataUpdated = useCallback(
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 (incomingSources?.length >= 2 && incomingControl?.length) {
85
- const module = new Blend(
86
- incomingSources[0].module,
87
- incomingSources[1].module,
88
- incomingControl[0].module
89
- );
90
- updateComputedData(id, { module });
99
+ const module = new Blend(incomingSources[0].module, incomingSources[1].module, incomingControl[0].module);
100
+ updateComputedData(id, {
101
+ module
102
+ });
91
103
  }
92
- },
93
- []
94
- );
95
- return /* @__PURE__ */ jsxs2(NodeContainer2, { id, selected, data, type, children: [
96
- /* @__PURE__ */ jsx2(
97
- HandlesIncomingDataStatus,
98
- {
99
- nodeId: id,
100
- handles: data.handles,
101
- handleKey: "dataId",
102
- onDataUpdated,
103
- type: "target",
104
- resetComputedData: true
105
- }
106
- ),
107
- /* @__PURE__ */ jsx2(NodeTrackConnections2, { 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__ */ jsx2(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__ */ jsx2(NodeTrackConnections2, { 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__ */ jsxs2(NodeContainer2, { 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
 
112
151
  // src/nodes/selectors/noise-select-node.tsx
152
+ import { c as _c2 } from "react/compiler-runtime";
113
153
  import { HandlesIncomingDataStatus as HandlesIncomingDataStatus2 } from "@awesome-flow/core/components";
114
154
  import { useUpdateNodeComputedData as useUpdateNodeComputedData2, useUpdateNodeData } from "@awesome-flow/core/hooks";
115
155
  import { NodeContainer as NodeContainer3, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
116
156
  import { Group, NumberInput, Stack as Stack2 } from "@mantine/core";
117
157
  import { Select } from "libnoise-simplex-ts";
118
- import { useCallback as useCallback2, useEffect, useState } from "react";
158
+ import { useEffect, useState } from "react";
119
159
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
120
- function NoiseSelectNode({ id, selected, data, type }) {
160
+ function NoiseSelectNode(t0) {
161
+ const $ = _c2(41);
162
+ const {
163
+ id,
164
+ selected,
165
+ data,
166
+ type
167
+ } = t0;
121
168
  const [edgeFalloff, setEdgeFalloff] = useState(data.edgeFalloff);
122
169
  const [lowerBound, setLowerBound] = useState(data.lowerBound);
123
170
  const [upperBound, setUpperBound] = useState(data.upperBound);
124
171
  const updateNodeData = useUpdateNodeData();
125
172
  const updateComputedData = useUpdateNodeComputedData2();
126
- useEffect(() => {
127
- updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
128
- }, [edgeFalloff, lowerBound, upperBound]);
129
- const onDataUpdated = useCallback2(
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
+ useEffect(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 (incomingSources?.length >= 2 && incomingControl?.length) {
134
- const module = new 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 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__ */ jsxs3(NodeContainer3, { id, selected, data, type, children: [
148
- /* @__PURE__ */ jsxs3(Stack2, { children: [
149
- /* @__PURE__ */ jsxs3(Group, { children: [
150
- "Edge Falloff:",
151
- /* @__PURE__ */ jsx3(
152
- 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__ */ jsxs3(Group, { children: [
163
- "Lower Bound:",
164
- /* @__PURE__ */ jsx3(
165
- 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__ */ jsxs3(Group, { children: [
176
- "Upper Bound:",
177
- /* @__PURE__ */ jsx3(
178
- 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__ */ jsx3(
189
- HandlesIncomingDataStatus2,
190
- {
191
- nodeId: id,
192
- handles: data.handles,
193
- handleKey: "dataId",
194
- onDataUpdated,
195
- type: "target",
196
- resetComputedData: true
197
- }
198
- )
199
- ] }),
200
- /* @__PURE__ */ jsx3(NodeTrackConnections3, { 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__ */ jsxs3(Group, { children: [
228
+ "Edge Falloff:",
229
+ /* @__PURE__ */ jsx3(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__ */ jsxs3(Group, { children: [
246
+ "Lower Bound:",
247
+ /* @__PURE__ */ jsx3(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__ */ jsxs3(Group, { children: [
264
+ "Upper Bound:",
265
+ /* @__PURE__ */ jsx3(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__ */ jsx3(HandlesIncomingDataStatus2, { 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__ */ jsxs3(Stack2, { 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__ */ jsx3(NodeTrackConnections3, { 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__ */ jsxs3(NodeContainer3, { 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
 
205
327
  // src/nodes/output/noise-raw-texture-node.tsx
328
+ import { c as _c3 } from "react/compiler-runtime";
206
329
  import { useIncomingComputedData as useIncomingComputedData2, useUpdateNodeComputedData as useUpdateNodeComputedData3 } from "@awesome-flow/core/hooks";
207
330
  import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
208
331
  import { Group as Group2, Stack as Stack3 } from "@mantine/core";
209
- import { useEffect as useEffect2, useMemo as useMemo2, useState as useState2 } from "react";
332
+ import { useEffect as useEffect2, useState as useState2 } from "react";
210
333
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
211
- function NoiseRawTextureNode({ id, selected, data, type }) {
334
+ function NoiseRawTextureNode(t0) {
335
+ const $ = _c3(28);
336
+ const {
337
+ id,
338
+ selected,
339
+ data,
340
+ type
341
+ } = t0;
212
342
  const updateComputedData = useUpdateNodeComputedData3();
213
343
  const [dataLength, setDataLength] = useState2(0);
214
344
  const [resolution, setResolution] = useState2(0);
215
345
  const incoming = useIncomingComputedData2(id);
216
- const noise = useMemo2(() => incoming?.map((p) => p.noise).flat(), [incoming]);
217
- useEffect2(() => {
218
- if (noise?.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__ */ jsxs4(NodeContainer4, { id, selected, data, type, children: [
233
- /* @__PURE__ */ jsxs4(Stack3, { children: [
234
- /* @__PURE__ */ jsxs4(Group2, { children: [
235
- "Resolution: ",
236
- resolution,
237
- "x",
238
- resolution
239
- ] }),
240
- /* @__PURE__ */ jsxs4(Group2, { children: [
241
- "Input Length: ",
242
- noise?.length || 0
243
- ] }),
244
- /* @__PURE__ */ jsxs4(Group2, { children: [
245
- "Output Length (",
246
- resolution,
247
- "*",
248
- resolution,
249
- "*4): ",
250
- dataLength
251
- ] })
252
- ] }),
253
- /* @__PURE__ */ jsx4(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" })
254
- ] });
346
+ let t1;
347
+ let t2;
348
+ if ($[0] !== incoming) {
349
+ t2 = incoming?.map(_temp).flat();
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 (noise?.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
+ useEffect2(t3, t4);
386
+ let t5;
387
+ if ($[7] !== resolution) {
388
+ t5 = /* @__PURE__ */ jsxs4(Group2, { 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 = noise?.length || 0;
400
+ let t7;
401
+ if ($[9] !== t6) {
402
+ t7 = /* @__PURE__ */ jsxs4(Group2, { 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__ */ jsxs4(Group2, { 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__ */ jsxs4(Stack3, { 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__ */ jsx4(NodeTrackConnections4, { 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__ */ jsxs4(NodeContainer4, { 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 @@ import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConne
261
479
  import { Divider as Divider2, Stack as Stack4, Text as Text2 } from "@mantine/core";
262
480
  import { useMemo as useMemo3 } from "react";
263
481
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
264
- function PositionsLoggerNode({ id, selected, data, type }) {
482
+ function PositionsLoggerNode({
483
+ id,
484
+ selected,
485
+ data,
486
+ type
487
+ }) {
265
488
  const incoming = useIncomingComputedData3(id);
266
489
  const positions = useMemo3(() => {
267
490
  return incoming?.map((p) => p.positions).flat();
@@ -688,11 +911,6 @@ var NoiseCurveNodeTemplateFactory = class {
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: Position15.Right,
698
916
  dataType: "module" /* module */,
@@ -1285,15 +1503,25 @@ var noiseNodeTemplates = {
1285
1503
 
1286
1504
  // src/nodes/output/noise-output-node.tsx
1287
1505
  import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1288
- function NoiseOutputNode({ id, selected, data, type }) {
1506
+ function NoiseOutputNode(t0) {
1507
+ const $ = _c4(20);
1508
+ const {
1509
+ id,
1510
+ selected,
1511
+ data,
1512
+ type
1513
+ } = t0;
1289
1514
  const [size, setSize] = useState3(0);
1290
1515
  const updateComputedData = useUpdateNodeComputedData4();
1291
- const onDataUpdated = useCallback3(
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 (incomingPositions?.length && incomingModule?.length && incomingModule[0]?.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__ */ jsxs6(NodeContainer6, { id, selected, data, type, children: [
1314
- /* @__PURE__ */ jsx6(
1315
- HandlesIncomingDataStatus3,
1316
- {
1317
- nodeId: id,
1318
- handles: data.handles,
1319
- handleKey: "dataType",
1320
- onDataUpdated,
1321
- type: "target",
1322
- resetComputedData: true
1323
- }
1324
- ),
1325
- /* @__PURE__ */ jsxs6(Text3, { 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__ */ jsx6(HandlesIncomingDataStatus3, { 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__ */ jsxs6(Text3, { mt: 5, children: [
1326
1562
  "Noise points: ",
1327
1563
  size
1328
- ] }),
1329
- /* @__PURE__ */ jsx6(NodeTrackConnections6, { 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__ */ jsx6(NodeTrackConnections6, { 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__ */ jsxs6(NodeContainer6, { 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