@awesome-flow/noise 0.3.0 → 0.4.0

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 (101) hide show
  1. package/dist/abstract/index.cjs +1405 -2078
  2. package/dist/abstract/index.cjs.map +1 -1
  3. package/dist/abstract/index.d.cts +23 -25
  4. package/dist/abstract/index.d.ts +23 -25
  5. package/dist/abstract/index.js +1315 -1996
  6. package/dist/abstract/index.js.map +1 -1
  7. package/dist/index-BungWYrh.d.cts +49 -0
  8. package/dist/index-DsQSjZC5.d.ts +49 -0
  9. package/dist/{node-props-CeZ8Oshz.d.ts → node-props-BbqbXDXn.d.cts} +2 -22
  10. package/dist/{node-props-hKW-_KOU.d.cts → node-props-BbqbXDXn.d.ts} +2 -22
  11. package/dist/nodes/generators/index.cjs +130 -380
  12. package/dist/nodes/generators/index.cjs.map +1 -1
  13. package/dist/nodes/generators/index.d.cts +2 -8
  14. package/dist/nodes/generators/index.d.ts +2 -8
  15. package/dist/nodes/generators/index.js +112 -360
  16. package/dist/nodes/generators/index.js.map +1 -1
  17. package/dist/nodes/groups/index.cjs +25 -13
  18. package/dist/nodes/groups/index.cjs.map +1 -1
  19. package/dist/nodes/groups/index.js +26 -14
  20. package/dist/nodes/groups/index.js.map +1 -1
  21. package/dist/nodes/index.cjs +1654 -988
  22. package/dist/nodes/index.cjs.map +1 -1
  23. package/dist/nodes/index.d.cts +3 -5
  24. package/dist/nodes/index.d.ts +3 -5
  25. package/dist/nodes/index.js +1622 -960
  26. package/dist/nodes/index.js.map +1 -1
  27. package/dist/nodes/modifiers/index.cjs +17 -119
  28. package/dist/nodes/modifiers/index.cjs.map +1 -1
  29. package/dist/nodes/modifiers/index.d.cts +2 -6
  30. package/dist/nodes/modifiers/index.d.ts +2 -6
  31. package/dist/nodes/modifiers/index.js +16 -124
  32. package/dist/nodes/modifiers/index.js.map +1 -1
  33. package/dist/nodes/output/index.cjs +1271 -89
  34. package/dist/nodes/output/index.cjs.map +1 -1
  35. package/dist/nodes/output/index.js +1314 -92
  36. package/dist/nodes/output/index.js.map +1 -1
  37. package/dist/nodes/selectors/index.cjs +1296 -58
  38. package/dist/nodes/selectors/index.cjs.map +1 -1
  39. package/dist/nodes/selectors/index.d.cts +1 -3
  40. package/dist/nodes/selectors/index.d.ts +1 -3
  41. package/dist/nodes/selectors/index.js +1339 -65
  42. package/dist/nodes/selectors/index.js.map +1 -1
  43. package/dist/nodes/transformers/index.cjs +67 -206
  44. package/dist/nodes/transformers/index.cjs.map +1 -1
  45. package/dist/nodes/transformers/index.d.cts +3 -5
  46. package/dist/nodes/transformers/index.d.ts +3 -5
  47. package/dist/nodes/transformers/index.js +54 -193
  48. package/dist/nodes/transformers/index.js.map +1 -1
  49. package/dist/templates/generators/index.cjs +839 -1278
  50. package/dist/templates/generators/index.cjs.map +1 -1
  51. package/dist/templates/generators/index.d.cts +13 -50
  52. package/dist/templates/generators/index.d.ts +13 -50
  53. package/dist/templates/generators/index.js +836 -1280
  54. package/dist/templates/generators/index.js.map +1 -1
  55. package/dist/templates/groups/index.cjs +837 -1272
  56. package/dist/templates/groups/index.cjs.map +1 -1
  57. package/dist/templates/groups/index.d.cts +1 -5
  58. package/dist/templates/groups/index.d.ts +1 -5
  59. package/dist/templates/groups/index.js +835 -1277
  60. package/dist/templates/groups/index.js.map +1 -1
  61. package/dist/templates/index.cjs +839 -1280
  62. package/dist/templates/index.cjs.map +1 -1
  63. package/dist/templates/index.d.cts +4 -7
  64. package/dist/templates/index.d.ts +4 -7
  65. package/dist/templates/index.js +836 -1281
  66. package/dist/templates/index.js.map +1 -1
  67. package/dist/templates/modifiers/index.cjs +841 -1278
  68. package/dist/templates/modifiers/index.cjs.map +1 -1
  69. package/dist/templates/modifiers/index.d.cts +11 -38
  70. package/dist/templates/modifiers/index.d.ts +11 -38
  71. package/dist/templates/modifiers/index.js +838 -1281
  72. package/dist/templates/modifiers/index.js.map +1 -1
  73. package/dist/templates/output/index.cjs +839 -1274
  74. package/dist/templates/output/index.cjs.map +1 -1
  75. package/dist/templates/output/index.d.cts +4 -14
  76. package/dist/templates/output/index.d.ts +4 -14
  77. package/dist/templates/output/index.js +837 -1279
  78. package/dist/templates/output/index.js.map +1 -1
  79. package/dist/templates/selectors/index.cjs +839 -1274
  80. package/dist/templates/selectors/index.cjs.map +1 -1
  81. package/dist/templates/selectors/index.d.cts +3 -9
  82. package/dist/templates/selectors/index.d.ts +3 -9
  83. package/dist/templates/selectors/index.js +837 -1279
  84. package/dist/templates/selectors/index.js.map +1 -1
  85. package/dist/templates/transformers/index.cjs +839 -1274
  86. package/dist/templates/transformers/index.cjs.map +1 -1
  87. package/dist/templates/transformers/index.d.cts +3 -36
  88. package/dist/templates/transformers/index.d.ts +3 -36
  89. package/dist/templates/transformers/index.js +837 -1279
  90. package/dist/templates/transformers/index.js.map +1 -1
  91. package/package.json +3 -3
  92. package/dist/handle-types-D-v5S53h.d.cts +0 -22
  93. package/dist/handle-types-D-v5S53h.d.ts +0 -22
  94. package/dist/layout/index.cjs +0 -164
  95. package/dist/layout/index.cjs.map +0 -1
  96. package/dist/layout/index.d.cts +0 -26
  97. package/dist/layout/index.d.ts +0 -26
  98. package/dist/layout/index.js +0 -136
  99. package/dist/layout/index.js.map +0 -1
  100. package/dist/properties-BxwtU6i9.d.cts +0 -9
  101. package/dist/properties-BxwtU6i9.d.ts +0 -9
@@ -1,47 +1,42 @@
1
1
  // src/nodes/transformers/noise-displace-node.tsx
2
2
  import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
3
- import { useEffect, useMemo } from "react";
4
- import { useIncomingHandleData, useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
3
+ import { useCallback } from "react";
4
+ import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
5
5
  import { Displace } from "libnoise-ts/module/transformer";
6
- import { Badge, Stack } from "@mantine/core";
6
+ import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  function NoiseDisplaceNode({ id, selected, data, type }) {
9
9
  const updateComputedData = useUpdateNodeComputedData();
10
- const incomingHandleData = useIncomingHandleData(id, data.handles);
11
- const { sourceModule, xModule, yModule, zModule } = useMemo(() => {
12
- return {
13
- sourceModule: incomingHandleData["source" /* sourceModule */],
14
- xModule: incomingHandleData["x-module" /* xModule */],
15
- yModule: incomingHandleData["y-module" /* yModule */],
16
- zModule: incomingHandleData["z-module" /* zModule */]
17
- };
18
- }, [incomingHandleData]);
19
- useEffect(() => {
20
- if (sourceModule && xModule && yModule && zModule) {
21
- const module = new Displace(
22
- sourceModule[0].module,
23
- xModule[0].module,
24
- yModule[0].module,
25
- zModule[0].module
26
- );
27
- updateComputedData(id, { module });
28
- }
29
- }, [id, updateComputedData, sourceModule, xModule, yModule, zModule]);
30
- const { sourceColor, xColor, yColor, zColor } = useMemo(() => {
31
- return {
32
- sourceColor: sourceModule ? "green" : "orange",
33
- xColor: xModule ? "green" : "orange",
34
- yColor: yModule ? "green" : "orange",
35
- zColor: zModule ? "green" : "orange"
36
- };
37
- }, [sourceModule, xModule, yModule, zModule]);
10
+ const onDataUpdated = useCallback(
11
+ (handleData) => {
12
+ const sourceModule = handleData["source" /* sourceModule */];
13
+ const xModule = handleData["x-module" /* xModule */];
14
+ const yModule = handleData["y-module" /* yModule */];
15
+ const zModule = handleData["z-module" /* zModule */];
16
+ if (sourceModule && xModule && yModule && zModule) {
17
+ const module = new Displace(
18
+ sourceModule[0].module,
19
+ xModule[0].module,
20
+ yModule[0].module,
21
+ zModule[0].module
22
+ );
23
+ updateComputedData(id, { module });
24
+ }
25
+ },
26
+ []
27
+ );
38
28
  return /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
39
- /* @__PURE__ */ jsxs(Stack, { align: "center", children: [
40
- /* @__PURE__ */ jsx(Badge, { color: sourceColor, children: "Source Module" }),
41
- /* @__PURE__ */ jsx(Badge, { color: xColor, children: "X Module" }),
42
- /* @__PURE__ */ jsx(Badge, { color: yColor, children: "Y Module" }),
43
- /* @__PURE__ */ jsx(Badge, { color: zColor, children: "Z Module" })
44
- ] }),
29
+ /* @__PURE__ */ jsx(
30
+ HandlesIncomingDataStatus,
31
+ {
32
+ nodeId: id,
33
+ handles: data.handles,
34
+ handleKey: "dataId",
35
+ onDataUpdated,
36
+ type: "target",
37
+ resetComputedData: true
38
+ }
39
+ ),
45
40
  /* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
46
41
  ] });
47
42
  }
@@ -49,13 +44,13 @@ var noise_displace_node_default = NoiseDisplaceNode;
49
44
 
50
45
  // src/nodes/transformers/noise-rotate-point-node.tsx
51
46
  import { NodeContainer as NodeContainer2, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
52
- import { useEffect as useEffect2, useState } from "react";
47
+ import { useEffect, useState } from "react";
53
48
  import {
54
49
  useIncomingComputedData,
55
50
  useUpdateNodeComputedData as useUpdateNodeComputedData2,
56
51
  useUpdateNodeData
57
52
  } from "@awesome-flow/core/hooks";
58
- import { Group, NumberInput, Stack as Stack2 } from "@mantine/core";
53
+ import { Group, NumberInput, Stack } from "@mantine/core";
59
54
  import { RotatePoint } from "libnoise-ts/module/transformer";
60
55
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
61
56
  function NoiseRotatePointNode({
@@ -70,7 +65,7 @@ function NoiseRotatePointNode({
70
65
  const incoming = useIncomingComputedData(id);
71
66
  const updateNodeData = useUpdateNodeData();
72
67
  const updateComputedData = useUpdateNodeComputedData2();
73
- useEffect2(() => {
68
+ useEffect(() => {
74
69
  if (incoming?.length) {
75
70
  const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
76
71
  updateComputedData(id, { module });
@@ -78,7 +73,7 @@ function NoiseRotatePointNode({
78
73
  updateNodeData(id, { xAngle, yAngle, zAngle });
79
74
  }, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
80
75
  return /* @__PURE__ */ jsxs2(NodeContainer2, { id, selected, data, type, children: [
81
- /* @__PURE__ */ jsxs2(Stack2, { children: [
76
+ /* @__PURE__ */ jsxs2(Stack, { children: [
82
77
  /* @__PURE__ */ jsxs2(Group, { children: [
83
78
  "X Angle:",
84
79
  /* @__PURE__ */ jsx2(
@@ -126,13 +121,13 @@ var noise_rotate_point_node_default = NoiseRotatePointNode;
126
121
 
127
122
  // src/nodes/transformers/noise-scale-point-node.tsx
128
123
  import { NodeContainer as NodeContainer3, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
129
- import { useEffect as useEffect3, useState as useState2 } from "react";
124
+ import { useEffect as useEffect2, useState as useState2 } from "react";
130
125
  import {
131
126
  useIncomingComputedData as useIncomingComputedData2,
132
127
  useUpdateNodeComputedData as useUpdateNodeComputedData3,
133
128
  useUpdateNodeData as useUpdateNodeData2
134
129
  } from "@awesome-flow/core/hooks";
135
- import { Group as Group2, NumberInput as NumberInput2, Stack as Stack3 } from "@mantine/core";
130
+ import { Group as Group2, NumberInput as NumberInput2, Stack as Stack2 } from "@mantine/core";
136
131
  import { ScalePoint } from "libnoise-ts/module/transformer";
137
132
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
138
133
  function NoiseScalePointNode({
@@ -147,7 +142,7 @@ function NoiseScalePointNode({
147
142
  const incoming = useIncomingComputedData2(id);
148
143
  const updateNodeData = useUpdateNodeData2();
149
144
  const updateComputedData = useUpdateNodeComputedData3();
150
- useEffect3(() => {
145
+ useEffect2(() => {
151
146
  if (incoming?.length) {
152
147
  const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);
153
148
  updateComputedData(id, { module });
@@ -155,7 +150,7 @@ function NoiseScalePointNode({
155
150
  updateNodeData(id, { xScale, yScale, zScale });
156
151
  }, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
157
152
  return /* @__PURE__ */ jsxs3(NodeContainer3, { id, selected, data, type, children: [
158
- /* @__PURE__ */ jsxs3(Stack3, { children: [
153
+ /* @__PURE__ */ jsxs3(Stack2, { children: [
159
154
  /* @__PURE__ */ jsxs3(Group2, { children: [
160
155
  "X Scale:",
161
156
  /* @__PURE__ */ jsx3(
@@ -203,13 +198,13 @@ var noise_scale_point_node_default = NoiseScalePointNode;
203
198
 
204
199
  // src/nodes/transformers/noise-translate-point-node.tsx
205
200
  import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
206
- import { useEffect as useEffect4, useState as useState3 } from "react";
201
+ import { useEffect as useEffect3, useState as useState3 } from "react";
207
202
  import {
208
203
  useIncomingComputedData as useIncomingComputedData3,
209
204
  useUpdateNodeComputedData as useUpdateNodeComputedData4,
210
205
  useUpdateNodeData as useUpdateNodeData3
211
206
  } from "@awesome-flow/core/hooks";
212
- import { Group as Group3, NumberInput as NumberInput3, Stack as Stack4 } from "@mantine/core";
207
+ import { Group as Group3, NumberInput as NumberInput3, Stack as Stack3 } from "@mantine/core";
213
208
  import { TranslatePoint } from "libnoise-ts/module/transformer";
214
209
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
215
210
  function NoiseTranslatePointNode({
@@ -224,7 +219,7 @@ function NoiseTranslatePointNode({
224
219
  const incoming = useIncomingComputedData3(id);
225
220
  const updateNodeData = useUpdateNodeData3();
226
221
  const updateComputedData = useUpdateNodeComputedData4();
227
- useEffect4(() => {
222
+ useEffect3(() => {
228
223
  if (incoming?.length) {
229
224
  const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
230
225
  updateComputedData(id, { module });
@@ -232,7 +227,7 @@ function NoiseTranslatePointNode({
232
227
  updateNodeData(id, { translateX, translateY, translateZ });
233
228
  }, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
234
229
  return /* @__PURE__ */ jsxs4(NodeContainer4, { id, selected, data, type, children: [
235
- /* @__PURE__ */ jsxs4(Stack4, { children: [
230
+ /* @__PURE__ */ jsxs4(Stack3, { children: [
236
231
  /* @__PURE__ */ jsxs4(Group3, { children: [
237
232
  "Translate X:",
238
233
  /* @__PURE__ */ jsx4(
@@ -280,159 +275,25 @@ var noise_translate_point_node_default = NoiseTranslatePointNode;
280
275
 
281
276
  // src/nodes/transformers/noise-turbulence-node .tsx
282
277
  import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
283
- import { useCallback as useCallback2, useEffect as useEffect6, useState as useState5 } from "react";
278
+ import { useCallback as useCallback2, useEffect as useEffect4, useState as useState4 } from "react";
284
279
  import { useIncomingComputedData as useIncomingComputedData4, useUpdateNodeComputedData as useUpdateNodeComputedData5 } from "@awesome-flow/core/hooks";
285
280
  import { Turbulence } from "libnoise-ts/module/transformer";
286
-
287
- // src/layout/node-property-variables.tsx
288
- import { useIncomingNodeData, useUpdateNodeData as useUpdateNodeData4 } from "@awesome-flow/core/hooks";
289
- import { useCallback, useEffect as useEffect5, useMemo as useMemo2, useState as useState4 } from "react";
290
- import { Group as Group4, Stack as Stack5 } from "@mantine/core";
291
- import { getObjectKeys } from "@awesome-flow/core/utils";
292
- import { nodeDataPropertyExcept } from "@awesome-flow/core/abstract";
293
-
294
- // src/layout/node-value-input.tsx
295
- import { Input, NumberInput as NumberInput4, Switch } from "@mantine/core";
296
- import { Fragment, jsx as jsx5 } from "react/jsx-runtime";
297
- function NodeValueInput({ value, disabled, step, onChange }) {
298
- if (value === void 0 || value === null) {
299
- return /* @__PURE__ */ jsx5(Fragment, {});
300
- }
301
- switch (typeof value) {
302
- case "boolean": {
303
- return /* @__PURE__ */ jsx5(
304
- Switch,
305
- {
306
- checked: value,
307
- disabled,
308
- onChange: (e) => onChange(e.currentTarget.checked)
309
- }
310
- );
311
- }
312
- case "number": {
313
- return /* @__PURE__ */ jsx5(NumberInput4, { value, disabled, step, onChange: (e) => onChange(e) });
314
- }
315
- case "string": {
316
- return /* @__PURE__ */ jsx5(
317
- Input,
318
- {
319
- value,
320
- disabled,
321
- onChange: (e) => onChange(e.currentTarget.value)
322
- }
323
- );
324
- }
325
- default:
326
- throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);
327
- }
328
- }
329
- var node_value_input_default = NodeValueInput;
330
-
331
- // src/layout/node-property-input.tsx
332
- import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
333
- function NodePropertyInput({ property, onChange }) {
334
- if (!property) {
335
- return /* @__PURE__ */ jsx6(Fragment2, {});
336
- }
337
- return /* @__PURE__ */ jsx6(
338
- node_value_input_default,
339
- {
340
- value: property.value,
341
- disabled: property.disabled,
342
- step: property.step,
343
- onChange: (value) => onChange(property.name, value)
344
- }
345
- );
346
- }
347
- var node_property_input_default = NodePropertyInput;
348
-
349
- // src/layout/node-property-variables.tsx
350
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
351
- function NodePropertyVariables({
352
- data,
353
- nodeId,
354
- onPropertiesChange,
355
- except = nodeDataPropertyExcept
356
- }) {
357
- const [properties, setProperties] = useState4(() => {
358
- const keys = getObjectKeys(data, except);
359
- const dataProps = {};
360
- for (const key of keys) {
361
- dataProps[key] = {
362
- name: key,
363
- value: data[key]
364
- };
365
- }
366
- return dataProps;
367
- });
368
- const updateNodeData = useUpdateNodeData4();
369
- const incoming = useIncomingNodeData(nodeId);
370
- const resetAllDisabled = useCallback(() => {
371
- const keys = Object.keys(properties);
372
- keys.forEach((k) => {
373
- properties[k].disabled = false;
374
- });
375
- setProperties(properties);
376
- }, []);
377
- const updatePropertyValue = useCallback((name, value, disabled) => {
378
- let property = properties[name];
379
- if (property) {
380
- property.value = value;
381
- } else {
382
- property = {
383
- name,
384
- value
385
- };
386
- }
387
- property.disabled = disabled;
388
- setProperties({ ...properties, [name]: property });
389
- updateNodeData(nodeId, { [name]: value });
390
- }, []);
391
- useEffect5(() => {
392
- resetAllDisabled();
393
- if (incoming?.length) {
394
- for (const connection of incoming) {
395
- if (connection.property && properties[connection.property.name] !== void 0) {
396
- updatePropertyValue(connection.property.name, connection.property.value, true);
397
- }
398
- }
399
- }
400
- }, [incoming]);
401
- useEffect5(() => {
402
- if (onPropertiesChange) {
403
- onPropertiesChange(properties);
404
- }
405
- }, [onPropertiesChange, properties]);
406
- const nodes = useMemo2(() => {
407
- return Object.keys(properties).map((key) => {
408
- const property = properties[key];
409
- return /* @__PURE__ */ jsxs5(Group4, { children: [
410
- property.name,
411
- ":",
412
- /* @__PURE__ */ jsx7(node_property_input_default, { property, onChange: updatePropertyValue })
413
- ] }, key);
414
- });
415
- }, [properties, updatePropertyValue]);
416
- return /* @__PURE__ */ jsx7(Stack5, { children: nodes });
417
- }
418
- var node_property_variables_default = NodePropertyVariables;
419
-
420
- // src/nodes/transformers/noise-turbulence-node .tsx
421
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
281
+ import { NodePropertyVariables } from "@awesome-flow/core/components";
282
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
422
283
  function NoiseTurbulenceNode({
423
284
  id,
424
285
  selected,
425
286
  data,
426
287
  type
427
288
  }) {
428
- const [properties, setProperties] = useState5(null);
289
+ const [properties, setProperties] = useState4(null);
429
290
  const incoming = useIncomingComputedData4(id);
430
291
  const updateComputedData = useUpdateNodeComputedData5();
431
292
  const onPropertiesChange = useCallback2((props) => {
432
293
  setProperties(props);
433
294
  }, []);
434
- useEffect6(() => {
435
- if (incoming?.length) {
295
+ useEffect4(() => {
296
+ if (incoming?.length && properties) {
436
297
  const module = new Turbulence(
437
298
  incoming[0].module,
438
299
  properties.frequency.value,
@@ -442,10 +303,10 @@ function NoiseTurbulenceNode({
442
303
  );
443
304
  updateComputedData(id, { module });
444
305
  }
445
- }, [id, incoming, properties, updateComputedData]);
446
- return /* @__PURE__ */ jsxs6(NodeContainer5, { id, selected, data, type, children: [
447
- /* @__PURE__ */ jsx8(node_property_variables_default, { data, nodeId: id, onPropertiesChange }),
448
- /* @__PURE__ */ jsx8(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
306
+ }, [id, incoming, properties]);
307
+ return /* @__PURE__ */ jsxs5(NodeContainer5, { id, selected, data, type, children: [
308
+ /* @__PURE__ */ jsx5(NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
309
+ /* @__PURE__ */ jsx5(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
449
310
  ] });
450
311
  }
451
312
  var noise_turbulence_node_default = NoiseTurbulenceNode;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/nodes/transformers/noise-displace-node.tsx","../../../src/nodes/transformers/noise-rotate-point-node.tsx","../../../src/nodes/transformers/noise-scale-point-node.tsx","../../../src/nodes/transformers/noise-translate-point-node.tsx","../../../src/nodes/transformers/noise-turbulence-node .tsx","../../../src/layout/node-property-variables.tsx","../../../src/layout/node-value-input.tsx","../../../src/layout/node-property-input.tsx"],"sourcesContent":["import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useMemo } from 'react';\nimport { useIncomingHandleData, useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Displace } from 'libnoise-ts/module/transformer';\nimport { Badge, Stack } from '@mantine/core';\nimport { ComputedModuleData, NodeDisplaceNoiseData } from '../../abstract/node-props';\nimport { DisplacementModule } from '../../abstract/handle-types';\n\nfunction NoiseDisplaceNode({ id, selected, data, type }: NodeProps<Node<NodeDisplaceNoiseData>>) {\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n const incomingHandleData = useIncomingHandleData<ComputedModuleData>(id, data.handles);\n\n const { sourceModule, xModule, yModule, zModule } = useMemo(() => {\n return {\n sourceModule: incomingHandleData[DisplacementModule.sourceModule],\n xModule: incomingHandleData[DisplacementModule.xModule],\n yModule: incomingHandleData[DisplacementModule.yModule],\n zModule: incomingHandleData[DisplacementModule.zModule],\n };\n }, [incomingHandleData]);\n\n useEffect(() => {\n if (sourceModule && xModule && yModule && zModule) {\n const module = new Displace(\n sourceModule[0].module,\n xModule[0].module,\n yModule[0].module,\n zModule[0].module\n );\n\n updateComputedData(id, { module });\n }\n }, [id, updateComputedData, sourceModule, xModule, yModule, zModule]);\n\n const { sourceColor, xColor, yColor, zColor } = useMemo(() => {\n return {\n sourceColor: sourceModule ? 'green' : 'orange',\n xColor: xModule ? 'green' : 'orange',\n yColor: yModule ? 'green' : 'orange',\n zColor: zModule ? 'green' : 'orange',\n };\n }, [sourceModule, xModule, yModule, zModule]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack align=\"center\">\n <Badge color={sourceColor}>Source Module</Badge>\n <Badge color={xColor}>X Module</Badge>\n <Badge color={yColor}>Y Module</Badge>\n <Badge color={zColor}>Z Module</Badge>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseDisplaceNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { RotatePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeRotatePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseRotatePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeRotatePointNoiseData>>) {\n const [xAngle, setXAngle] = useState(data.xAngle);\n const [yAngle, setYAngle] = useState(data.yAngle);\n const [zAngle, setZAngle] = useState(data.zAngle);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeRotatePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { xAngle, yAngle, zAngle });\n }, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n X Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={xAngle}\n onChange={(e) => setXAngle(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Y Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={yAngle}\n onChange={(e) => setYAngle(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Z Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={zAngle}\n onChange={(e) => setZAngle(Number(e))}\n step={0.01}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseRotatePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { ScalePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeScalePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseScalePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeScalePointNoiseData>>) {\n const [xScale, setXScale] = useState(data.xScale);\n const [yScale, setYScale] = useState(data.yScale);\n const [zScale, setZScale] = useState(data.zScale);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeScalePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { xScale, yScale, zScale });\n }, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n X Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={xScale}\n onChange={(e) => setXScale(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Y Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={yScale}\n onChange={(e) => setYScale(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Z Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={zScale}\n onChange={(e) => setZScale(Number(e))}\n step={0.01}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseScalePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { TranslatePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeTranslatePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseTranslatePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeTranslatePointNoiseData>>) {\n const [translateX, setTranslateX] = useState(data.translateX);\n const [translateY, setTranslateY] = useState(data.translateY);\n const [translateZ, setTranslateZ] = useState(data.translateZ);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeTranslatePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { translateX, translateY, translateZ });\n }, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n Translate X:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateX}\n onChange={(e) => setTranslateX(Number(e))}\n step={1}\n />\n </Group>\n <Group>\n Translate Y:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateY}\n onChange={(e) => setTranslateY(Number(e))}\n step={1}\n />\n </Group>\n <Group>\n Translate Z:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateZ}\n onChange={(e) => setTranslateZ(Number(e))}\n step={1}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTranslatePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useCallback, useEffect, useState } from 'react';\nimport { useIncomingComputedData, useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Turbulence } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeTurbulenceNoiseData } from '../../abstract/node-props';\nimport { PropertyValue } from '../../abstract/properties';\nimport NodePropertyVariables from '../../layout/node-property-variables';\n\nfunction NoiseTurbulenceNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeTurbulenceNoiseData>>) {\n const [properties, setProperties] = useState(null);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const onPropertiesChange = useCallback((props: Record<string, PropertyValue<number>>) => {\n setProperties(props);\n }, []);\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new Turbulence(\n incoming[0].module,\n properties.frequency.value,\n properties.power.value,\n properties.roughness.value,\n properties.seed.value\n );\n updateComputedData(id, { module });\n }\n }, [id, incoming, properties, updateComputedData]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <NodePropertyVariables data={data} nodeId={id} onPropertiesChange={onPropertiesChange} />\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTurbulenceNode;\n","import { useIncomingNodeData, useUpdateNodeData } from '@awesome-flow/core/hooks';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { Group, Stack } from '@mantine/core';\nimport { getObjectKeys } from '@awesome-flow/core/utils';\nimport { nodeDataPropertyExcept } from '@awesome-flow/core/abstract';\nimport { NodeVariablePropertyData } from '../abstract/node-props';\nimport { PropertyValue, ValueType } from '../abstract/properties';\nimport NodePropertyInput from './node-property-input';\n\nexport type NodeTrackVariablesProps = {\n nodeId: string;\n data: Record<string, any>;\n except?: Set<string>;\n onPropertiesChange?: (properties: Record<string, PropertyValue>) => void;\n};\n\nfunction NodePropertyVariables({\n data,\n nodeId,\n onPropertiesChange,\n except = nodeDataPropertyExcept,\n}: Readonly<NodeTrackVariablesProps>) {\n const [properties, setProperties] = useState<Record<string, PropertyValue>>(() => {\n const keys = getObjectKeys(data, except);\n\n const dataProps = {};\n\n for (const key of keys) {\n dataProps[key] = {\n name: key,\n value: data[key],\n } satisfies PropertyValue;\n }\n\n return dataProps;\n });\n\n const updateNodeData = useUpdateNodeData();\n const incoming = useIncomingNodeData<NodeVariablePropertyData>(nodeId);\n\n const resetAllDisabled = useCallback(() => {\n const keys = Object.keys(properties);\n\n keys.forEach((k) => {\n properties[k].disabled = false;\n });\n\n setProperties(properties);\n }, []);\n\n const updatePropertyValue = useCallback((name: string, value: ValueType, disabled?: boolean) => {\n let property = properties[name];\n\n if (property) {\n property.value = value;\n } else {\n property = {\n name,\n value,\n };\n }\n\n property.disabled = disabled;\n\n setProperties({ ...properties, [name]: property });\n updateNodeData(nodeId, { [name]: value });\n }, []);\n\n useEffect(() => {\n resetAllDisabled();\n\n if (incoming?.length) {\n for (const connection of incoming) {\n if (connection.property && properties[connection.property.name] !== undefined) {\n updatePropertyValue(connection.property.name, connection.property.value, true);\n }\n }\n }\n }, [incoming]);\n\n useEffect(() => {\n if (onPropertiesChange) {\n onPropertiesChange(properties);\n }\n }, [onPropertiesChange, properties]);\n\n const nodes = useMemo(() => {\n return Object.keys(properties).map((key) => {\n const property = properties[key];\n\n return (\n <Group key={key}>\n {property.name}:<NodePropertyInput property={property} onChange={updatePropertyValue} />\n </Group>\n );\n });\n }, [properties, updatePropertyValue]);\n\n return <Stack>{nodes}</Stack>;\n}\n\nexport default NodePropertyVariables;\n","import { Input, NumberInput, Switch } from '@mantine/core';\nimport { ValueType } from '../abstract/properties';\n\nexport type NodeValueInputProps = {\n value: ValueType;\n disabled?: boolean;\n step?: number;\n onChange: (value: ValueType) => void;\n};\n\nfunction NodeValueInput({ value, disabled, step, onChange }: Readonly<NodeValueInputProps>) {\n if (value === undefined || value === null) {\n return <></>;\n }\n\n switch (typeof value) {\n case 'boolean': {\n return (\n <Switch\n checked={value}\n disabled={disabled}\n onChange={(e) => onChange(e.currentTarget.checked)}\n />\n );\n }\n\n case 'number': {\n return (\n <NumberInput value={value} disabled={disabled} step={step} onChange={(e) => onChange(e)} />\n );\n }\n\n case 'string': {\n return (\n <Input\n value={value}\n disabled={disabled}\n onChange={(e) => onChange(e.currentTarget.value)}\n />\n );\n }\n\n default:\n throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);\n }\n}\n\nexport default NodeValueInput;\n","import { ValueType, PropertyValue } from '../abstract/properties';\nimport NodeValueInput from './node-value-input';\n\nexport type NodePropertyInputProps = {\n property: PropertyValue;\n onChange: (name: string, value: ValueType) => void;\n};\n\nfunction NodePropertyInput({ property, onChange }: Readonly<NodePropertyInputProps>) {\n if (!property) {\n return <></>;\n }\n\n return (\n <NodeValueInput\n value={property.value}\n disabled={property.disabled}\n step={property.step}\n onChange={(value) => onChange(property.name, value)}\n />\n );\n}\n\nexport default NodePropertyInput;\n"],"mappings":";AAAA,SAAS,eAAe,4BAA4B;AAEpD,SAAS,WAAW,eAAe;AACnC,SAAS,uBAAuB,iCAAiC;AACjE,SAAS,gBAAgB;AACzB,SAAS,OAA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K,UAAS;AAAA,KACzE;AAEJ;AAEA,IAAO,gCAAQ;","names":["NodeContainer","NodeTrackConnections","useEffect","useUpdateNodeComputedData","Stack","jsx","jsxs","NodeContainer","NodeTrackConnections","useEffect","useState","useIncomingComputedData","useUpdateNodeComputedData","useUpdateNodeData","Group","NumberInput","Stack","jsx","jsxs","NodeContainer","NodeTrackConnections","useEffect","useState","useIncomingComputedData","useUpdateNodeComputedData","useUpdateNodeData","Group","NumberInput","Stack","jsx","jsxs","NodeContainer","NodeTrackConnections","useCallback","useEffect","useState","useIncomingComputedData","useUpdateNodeComputedData","useUpdateNodeData","useEffect","useMemo","useState","Group","Stack","NumberInput","jsx","Fragment","jsx","jsx","jsxs","useState","useUpdateNodeData","useEffect","useMemo","Group","Stack","jsx","jsxs","useState","useIncomingComputedData","useUpdateNodeComputedData","useCallback","useEffect","NodeContainer","NodeTrackConnections"]}
1
+ {"version":3,"sources":["../../../src/nodes/transformers/noise-displace-node.tsx","../../../src/nodes/transformers/noise-rotate-point-node.tsx","../../../src/nodes/transformers/noise-scale-point-node.tsx","../../../src/nodes/transformers/noise-translate-point-node.tsx","../../../src/nodes/transformers/noise-turbulence-node .tsx"],"sourcesContent":["import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useCallback } from 'react';\nimport { useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Displace } from 'libnoise-ts/module/transformer';\nimport { HandlesIncomingDataStatus } from '@awesome-flow/core/components';\nimport { BasicNodeData } from '@awesome-flow/core/abstract';\nimport { ComputedModuleData } from '../../abstract/node-props';\nimport { DisplacementHandle } from '../../abstract/handle-types';\n\nfunction NoiseDisplaceNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>) {\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const onDataUpdated = useCallback(\n (handleData: Record<DisplacementHandle, ComputedModuleData>) => {\n const sourceModule = handleData[DisplacementHandle.sourceModule];\n const xModule = handleData[DisplacementHandle.xModule];\n const yModule = handleData[DisplacementHandle.yModule];\n const zModule = handleData[DisplacementHandle.zModule];\n\n if (sourceModule && xModule && yModule && zModule) {\n const module = new Displace(\n sourceModule[0].module,\n xModule[0].module,\n yModule[0].module,\n zModule[0].module\n );\n\n updateComputedData(id, { module });\n }\n },\n []\n );\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <HandlesIncomingDataStatus\n nodeId={id}\n handles={data.handles}\n handleKey=\"dataId\"\n onDataUpdated={onDataUpdated}\n type=\"target\"\n resetComputedData\n />\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseDisplaceNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { RotatePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeRotatePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseRotatePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeRotatePointNoiseData>>) {\n const [xAngle, setXAngle] = useState(data.xAngle);\n const [yAngle, setYAngle] = useState(data.yAngle);\n const [zAngle, setZAngle] = useState(data.zAngle);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeRotatePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { xAngle, yAngle, zAngle });\n }, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n X Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={xAngle}\n onChange={(e) => setXAngle(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Y Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={yAngle}\n onChange={(e) => setYAngle(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Z Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={zAngle}\n onChange={(e) => setZAngle(Number(e))}\n step={0.01}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseRotatePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { ScalePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeScalePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseScalePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeScalePointNoiseData>>) {\n const [xScale, setXScale] = useState(data.xScale);\n const [yScale, setYScale] = useState(data.yScale);\n const [zScale, setZScale] = useState(data.zScale);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeScalePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { xScale, yScale, zScale });\n }, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n X Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={xScale}\n onChange={(e) => setXScale(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Y Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={yScale}\n onChange={(e) => setYScale(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Z Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={zScale}\n onChange={(e) => setZScale(Number(e))}\n step={0.01}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseScalePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { TranslatePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeTranslatePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseTranslatePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeTranslatePointNoiseData>>) {\n const [translateX, setTranslateX] = useState(data.translateX);\n const [translateY, setTranslateY] = useState(data.translateY);\n const [translateZ, setTranslateZ] = useState(data.translateZ);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeTranslatePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { translateX, translateY, translateZ });\n }, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n Translate X:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateX}\n onChange={(e) => setTranslateX(Number(e))}\n step={1}\n />\n </Group>\n <Group>\n Translate Y:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateY}\n onChange={(e) => setTranslateY(Number(e))}\n step={1}\n />\n </Group>\n <Group>\n Translate Z:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateZ}\n onChange={(e) => setTranslateZ(Number(e))}\n step={1}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTranslatePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useCallback, useEffect, useState } from 'react';\nimport { useIncomingComputedData, useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Turbulence } from 'libnoise-ts/module/transformer';\nimport { PropertyValue } from '@awesome-flow/core/abstract';\nimport { NodePropertyVariables } from '@awesome-flow/core/components';\nimport { ComputedModuleData, NodeTurbulenceNoiseData } from '../../abstract/node-props';\n\nfunction NoiseTurbulenceNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeTurbulenceNoiseData>>) {\n const [properties, setProperties] = useState(null);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const onPropertiesChange = useCallback((props: Record<string, PropertyValue<number>>) => {\n setProperties(props);\n }, []);\n\n useEffect(() => {\n if (incoming?.length && properties) {\n const module = new Turbulence(\n incoming[0].module,\n properties.frequency.value,\n properties.power.value,\n properties.roughness.value,\n properties.seed.value\n );\n updateComputedData(id, { module });\n }\n }, [id, incoming, properties]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <NodePropertyVariables data={data} nodeId={id} onPropertiesChange={onPropertiesChange} />\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTurbulenceNode;\n"],"mappings":";AAA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sB,MAAY,QAAQ,IAAI,oBAAwC;AAAA,IACvF,gBAAAA,KAACN,uBAAA,EAAqB,SAAS,KAAK,SAAS,QAAQ,IAAI,MAAK,UAAS;AAAA,KACzE;AAEJ;AAEA,IAAO,gCAAQ;","names":["NodeContainer","NodeTrackConnections","useUpdateNodeComputedData","jsx","jsxs","NodeContainer","NodeTrackConnections","useEffect","useState","useIncomingComputedData","useUpdateNodeComputedData","useUpdateNodeData","Group","NumberInput","Stack","jsx","jsxs","NodeContainer","NodeTrackConnections","useEffect","useState","useIncomingComputedData","useUpdateNodeComputedData","useUpdateNodeData","Group","NumberInput","Stack","jsx","jsxs","NodeContainer","NodeTrackConnections","useCallback","useEffect","useState","useIncomingComputedData","useUpdateNodeComputedData","jsx","jsxs"]}