@awesome-flow/noise 0.1.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 (109) hide show
  1. package/dist/abstract/index.cjs +4234 -0
  2. package/dist/abstract/index.cjs.map +1 -0
  3. package/dist/abstract/index.d.cts +137 -0
  4. package/dist/abstract/index.d.ts +137 -0
  5. package/dist/abstract/index.js +4271 -0
  6. package/dist/abstract/index.js.map +1 -0
  7. package/dist/handle-types-D-v5S53h.d.cts +22 -0
  8. package/dist/handle-types-D-v5S53h.d.ts +22 -0
  9. package/dist/layout/index.cjs +164 -0
  10. package/dist/layout/index.cjs.map +1 -0
  11. package/dist/layout/index.d.cts +26 -0
  12. package/dist/layout/index.d.ts +26 -0
  13. package/dist/layout/index.js +136 -0
  14. package/dist/layout/index.js.map +1 -0
  15. package/dist/modules/index.cjs +71 -0
  16. package/dist/modules/index.cjs.map +1 -0
  17. package/dist/modules/index.d.cts +18 -0
  18. package/dist/modules/index.d.ts +18 -0
  19. package/dist/modules/index.js +34 -0
  20. package/dist/modules/index.js.map +1 -0
  21. package/dist/node-props-CeZ8Oshz.d.ts +161 -0
  22. package/dist/node-props-hKW-_KOU.d.cts +161 -0
  23. package/dist/nodes/generators/index.cjs +640 -0
  24. package/dist/nodes/generators/index.cjs.map +1 -0
  25. package/dist/nodes/generators/index.d.cts +38 -0
  26. package/dist/nodes/generators/index.d.ts +38 -0
  27. package/dist/nodes/generators/index.js +592 -0
  28. package/dist/nodes/generators/index.js.map +1 -0
  29. package/dist/nodes/groups/index.cjs +104 -0
  30. package/dist/nodes/groups/index.cjs.map +1 -0
  31. package/dist/nodes/groups/index.d.cts +7 -0
  32. package/dist/nodes/groups/index.d.ts +7 -0
  33. package/dist/nodes/groups/index.js +78 -0
  34. package/dist/nodes/groups/index.js.map +1 -0
  35. package/dist/nodes/index.cjs +2830 -0
  36. package/dist/nodes/index.cjs.map +1 -0
  37. package/dist/nodes/index.d.cts +16 -0
  38. package/dist/nodes/index.d.ts +16 -0
  39. package/dist/nodes/index.js +2840 -0
  40. package/dist/nodes/index.js.map +1 -0
  41. package/dist/nodes/modifiers/index.cjs +1593 -0
  42. package/dist/nodes/modifiers/index.cjs.map +1 -0
  43. package/dist/nodes/modifiers/index.d.cts +32 -0
  44. package/dist/nodes/modifiers/index.d.ts +32 -0
  45. package/dist/nodes/modifiers/index.js +1612 -0
  46. package/dist/nodes/modifiers/index.js.map +1 -0
  47. package/dist/nodes/output/index.cjs +210 -0
  48. package/dist/nodes/output/index.cjs.map +1 -0
  49. package/dist/nodes/output/index.d.cts +13 -0
  50. package/dist/nodes/output/index.d.ts +13 -0
  51. package/dist/nodes/output/index.js +181 -0
  52. package/dist/nodes/output/index.js.map +1 -0
  53. package/dist/nodes/selectors/index.cjs +136 -0
  54. package/dist/nodes/selectors/index.cjs.map +1 -0
  55. package/dist/nodes/selectors/index.d.cts +16 -0
  56. package/dist/nodes/selectors/index.d.ts +16 -0
  57. package/dist/nodes/selectors/index.js +113 -0
  58. package/dist/nodes/selectors/index.js.map +1 -0
  59. package/dist/nodes/transformers/index.cjs +477 -0
  60. package/dist/nodes/transformers/index.cjs.map +1 -0
  61. package/dist/nodes/transformers/index.d.cts +22 -0
  62. package/dist/nodes/transformers/index.d.ts +22 -0
  63. package/dist/nodes/transformers/index.js +459 -0
  64. package/dist/nodes/transformers/index.js.map +1 -0
  65. package/dist/properties-BxwtU6i9.d.cts +9 -0
  66. package/dist/properties-BxwtU6i9.d.ts +9 -0
  67. package/dist/templates/generators/index.cjs +1714 -0
  68. package/dist/templates/generators/index.cjs.map +1 -0
  69. package/dist/templates/generators/index.d.cts +89 -0
  70. package/dist/templates/generators/index.d.ts +89 -0
  71. package/dist/templates/generators/index.js +1723 -0
  72. package/dist/templates/generators/index.js.map +1 -0
  73. package/dist/templates/groups/index.cjs +1690 -0
  74. package/dist/templates/groups/index.cjs.map +1 -0
  75. package/dist/templates/groups/index.d.cts +11 -0
  76. package/dist/templates/groups/index.d.ts +11 -0
  77. package/dist/templates/groups/index.js +1711 -0
  78. package/dist/templates/groups/index.js.map +1 -0
  79. package/dist/templates/index.cjs +1758 -0
  80. package/dist/templates/index.cjs.map +1 -0
  81. package/dist/templates/index.d.cts +15 -0
  82. package/dist/templates/index.d.ts +15 -0
  83. package/dist/templates/index.js +1745 -0
  84. package/dist/templates/index.js.map +1 -0
  85. package/dist/templates/modifiers/index.cjs +1708 -0
  86. package/dist/templates/modifiers/index.cjs.map +1 -0
  87. package/dist/templates/modifiers/index.d.cts +71 -0
  88. package/dist/templates/modifiers/index.d.ts +71 -0
  89. package/dist/templates/modifiers/index.js +1720 -0
  90. package/dist/templates/modifiers/index.js.map +1 -0
  91. package/dist/templates/output/index.cjs +1696 -0
  92. package/dist/templates/output/index.cjs.map +1 -0
  93. package/dist/templates/output/index.d.cts +29 -0
  94. package/dist/templates/output/index.d.ts +29 -0
  95. package/dist/templates/output/index.js +1714 -0
  96. package/dist/templates/output/index.js.map +1 -0
  97. package/dist/templates/selectors/index.cjs +1692 -0
  98. package/dist/templates/selectors/index.cjs.map +1 -0
  99. package/dist/templates/selectors/index.d.cts +22 -0
  100. package/dist/templates/selectors/index.d.ts +22 -0
  101. package/dist/templates/selectors/index.js +1712 -0
  102. package/dist/templates/selectors/index.js.map +1 -0
  103. package/dist/templates/transformers/index.cjs +1698 -0
  104. package/dist/templates/transformers/index.cjs.map +1 -0
  105. package/dist/templates/transformers/index.d.cts +40 -0
  106. package/dist/templates/transformers/index.d.ts +40 -0
  107. package/dist/templates/transformers/index.js +1715 -0
  108. package/dist/templates/transformers/index.js.map +1 -0
  109. package/package.json +111 -0
@@ -0,0 +1,459 @@
1
+ // src/nodes/transformers/noise-displace-node.tsx
2
+ import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
3
+ import { useEffect, useMemo } from "react";
4
+ import { useIncomingHandleData, useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
5
+ import { Displace } from "libnoise-ts/module/transformer";
6
+ import { Badge, Stack } from "@mantine/core";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ function NoiseDisplaceNode({ id, selected, data, type }) {
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]);
38
+ 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
+ ] }),
45
+ /* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
46
+ ] });
47
+ }
48
+ var noise_displace_node_default = NoiseDisplaceNode;
49
+
50
+ // src/nodes/transformers/noise-rotate-point-node.tsx
51
+ import { NodeContainer as NodeContainer2, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
52
+ import { useEffect as useEffect2, useState } from "react";
53
+ import {
54
+ useIncomingComputedData,
55
+ useUpdateNodeComputedData as useUpdateNodeComputedData2,
56
+ useUpdateNodeData
57
+ } from "@awesome-flow/core/hooks";
58
+ import { Group, NumberInput, Stack as Stack2 } from "@mantine/core";
59
+ import { RotatePoint } from "libnoise-ts/module/transformer";
60
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
61
+ function NoiseRotatePointNode({
62
+ id,
63
+ selected,
64
+ data,
65
+ type
66
+ }) {
67
+ const [xAngle, setXAngle] = useState(data.xAngle);
68
+ const [yAngle, setYAngle] = useState(data.yAngle);
69
+ const [zAngle, setZAngle] = useState(data.zAngle);
70
+ const incoming = useIncomingComputedData(id);
71
+ const updateNodeData = useUpdateNodeData();
72
+ const updateComputedData = useUpdateNodeComputedData2();
73
+ useEffect2(() => {
74
+ if (incoming?.length) {
75
+ const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
76
+ updateComputedData(id, { module });
77
+ }
78
+ updateNodeData(id, { xAngle, yAngle, zAngle });
79
+ }, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
80
+ return /* @__PURE__ */ jsxs2(NodeContainer2, { id, selected, data, type, children: [
81
+ /* @__PURE__ */ jsxs2(Stack2, { children: [
82
+ /* @__PURE__ */ jsxs2(Group, { children: [
83
+ "X Angle:",
84
+ /* @__PURE__ */ jsx2(
85
+ NumberInput,
86
+ {
87
+ size: "xs",
88
+ w: 100,
89
+ value: xAngle,
90
+ onChange: (e) => setXAngle(Number(e)),
91
+ step: 0.01
92
+ }
93
+ )
94
+ ] }),
95
+ /* @__PURE__ */ jsxs2(Group, { children: [
96
+ "Y Angle:",
97
+ /* @__PURE__ */ jsx2(
98
+ NumberInput,
99
+ {
100
+ size: "xs",
101
+ w: 100,
102
+ value: yAngle,
103
+ onChange: (e) => setYAngle(Number(e)),
104
+ step: 0.01
105
+ }
106
+ )
107
+ ] }),
108
+ /* @__PURE__ */ jsxs2(Group, { children: [
109
+ "Z Angle:",
110
+ /* @__PURE__ */ jsx2(
111
+ NumberInput,
112
+ {
113
+ size: "xs",
114
+ w: 100,
115
+ value: zAngle,
116
+ onChange: (e) => setZAngle(Number(e)),
117
+ step: 0.01
118
+ }
119
+ )
120
+ ] })
121
+ ] }),
122
+ /* @__PURE__ */ jsx2(NodeTrackConnections2, { handles: data.handles, nodeId: id, type: "target" })
123
+ ] });
124
+ }
125
+ var noise_rotate_point_node_default = NoiseRotatePointNode;
126
+
127
+ // src/nodes/transformers/noise-scale-point-node.tsx
128
+ import { NodeContainer as NodeContainer3, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
129
+ import { useEffect as useEffect3, useState as useState2 } from "react";
130
+ import {
131
+ useIncomingComputedData as useIncomingComputedData2,
132
+ useUpdateNodeComputedData as useUpdateNodeComputedData3,
133
+ useUpdateNodeData as useUpdateNodeData2
134
+ } from "@awesome-flow/core/hooks";
135
+ import { Group as Group2, NumberInput as NumberInput2, Stack as Stack3 } from "@mantine/core";
136
+ import { ScalePoint } from "libnoise-ts/module/transformer";
137
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
138
+ function NoiseScalePointNode({
139
+ id,
140
+ selected,
141
+ data,
142
+ type
143
+ }) {
144
+ const [xScale, setXScale] = useState2(data.xScale);
145
+ const [yScale, setYScale] = useState2(data.yScale);
146
+ const [zScale, setZScale] = useState2(data.zScale);
147
+ const incoming = useIncomingComputedData2(id);
148
+ const updateNodeData = useUpdateNodeData2();
149
+ const updateComputedData = useUpdateNodeComputedData3();
150
+ useEffect3(() => {
151
+ if (incoming?.length) {
152
+ const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);
153
+ updateComputedData(id, { module });
154
+ }
155
+ updateNodeData(id, { xScale, yScale, zScale });
156
+ }, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
157
+ return /* @__PURE__ */ jsxs3(NodeContainer3, { id, selected, data, type, children: [
158
+ /* @__PURE__ */ jsxs3(Stack3, { children: [
159
+ /* @__PURE__ */ jsxs3(Group2, { children: [
160
+ "X Scale:",
161
+ /* @__PURE__ */ jsx3(
162
+ NumberInput2,
163
+ {
164
+ size: "xs",
165
+ w: 100,
166
+ value: xScale,
167
+ onChange: (e) => setXScale(Number(e)),
168
+ step: 0.01
169
+ }
170
+ )
171
+ ] }),
172
+ /* @__PURE__ */ jsxs3(Group2, { children: [
173
+ "Y Scale:",
174
+ /* @__PURE__ */ jsx3(
175
+ NumberInput2,
176
+ {
177
+ size: "xs",
178
+ w: 100,
179
+ value: yScale,
180
+ onChange: (e) => setYScale(Number(e)),
181
+ step: 0.01
182
+ }
183
+ )
184
+ ] }),
185
+ /* @__PURE__ */ jsxs3(Group2, { children: [
186
+ "Z Scale:",
187
+ /* @__PURE__ */ jsx3(
188
+ NumberInput2,
189
+ {
190
+ size: "xs",
191
+ w: 100,
192
+ value: zScale,
193
+ onChange: (e) => setZScale(Number(e)),
194
+ step: 0.01
195
+ }
196
+ )
197
+ ] })
198
+ ] }),
199
+ /* @__PURE__ */ jsx3(NodeTrackConnections3, { handles: data.handles, nodeId: id, type: "target" })
200
+ ] });
201
+ }
202
+ var noise_scale_point_node_default = NoiseScalePointNode;
203
+
204
+ // src/nodes/transformers/noise-translate-point-node.tsx
205
+ import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
206
+ import { useEffect as useEffect4, useState as useState3 } from "react";
207
+ import {
208
+ useIncomingComputedData as useIncomingComputedData3,
209
+ useUpdateNodeComputedData as useUpdateNodeComputedData4,
210
+ useUpdateNodeData as useUpdateNodeData3
211
+ } from "@awesome-flow/core/hooks";
212
+ import { Group as Group3, NumberInput as NumberInput3, Stack as Stack4 } from "@mantine/core";
213
+ import { TranslatePoint } from "libnoise-ts/module/transformer";
214
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
215
+ function NoiseTranslatePointNode({
216
+ id,
217
+ selected,
218
+ data,
219
+ type
220
+ }) {
221
+ const [translateX, setTranslateX] = useState3(data.translateX);
222
+ const [translateY, setTranslateY] = useState3(data.translateY);
223
+ const [translateZ, setTranslateZ] = useState3(data.translateZ);
224
+ const incoming = useIncomingComputedData3(id);
225
+ const updateNodeData = useUpdateNodeData3();
226
+ const updateComputedData = useUpdateNodeComputedData4();
227
+ useEffect4(() => {
228
+ if (incoming?.length) {
229
+ const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
230
+ updateComputedData(id, { module });
231
+ }
232
+ updateNodeData(id, { translateX, translateY, translateZ });
233
+ }, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
234
+ return /* @__PURE__ */ jsxs4(NodeContainer4, { id, selected, data, type, children: [
235
+ /* @__PURE__ */ jsxs4(Stack4, { children: [
236
+ /* @__PURE__ */ jsxs4(Group3, { children: [
237
+ "Translate X:",
238
+ /* @__PURE__ */ jsx4(
239
+ NumberInput3,
240
+ {
241
+ size: "xs",
242
+ w: 100,
243
+ value: translateX,
244
+ onChange: (e) => setTranslateX(Number(e)),
245
+ step: 1
246
+ }
247
+ )
248
+ ] }),
249
+ /* @__PURE__ */ jsxs4(Group3, { children: [
250
+ "Translate Y:",
251
+ /* @__PURE__ */ jsx4(
252
+ NumberInput3,
253
+ {
254
+ size: "xs",
255
+ w: 100,
256
+ value: translateY,
257
+ onChange: (e) => setTranslateY(Number(e)),
258
+ step: 1
259
+ }
260
+ )
261
+ ] }),
262
+ /* @__PURE__ */ jsxs4(Group3, { children: [
263
+ "Translate Z:",
264
+ /* @__PURE__ */ jsx4(
265
+ NumberInput3,
266
+ {
267
+ size: "xs",
268
+ w: 100,
269
+ value: translateZ,
270
+ onChange: (e) => setTranslateZ(Number(e)),
271
+ step: 1
272
+ }
273
+ )
274
+ ] })
275
+ ] }),
276
+ /* @__PURE__ */ jsx4(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" })
277
+ ] });
278
+ }
279
+ var noise_translate_point_node_default = NoiseTranslatePointNode;
280
+
281
+ // src/nodes/transformers/noise-turbulence-node .tsx
282
+ 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";
284
+ import { useIncomingComputedData as useIncomingComputedData4, useUpdateNodeComputedData as useUpdateNodeComputedData5 } from "@awesome-flow/core/hooks";
285
+ 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";
422
+ function NoiseTurbulenceNode({
423
+ id,
424
+ selected,
425
+ data,
426
+ type
427
+ }) {
428
+ const [properties, setProperties] = useState5(null);
429
+ const incoming = useIncomingComputedData4(id);
430
+ const updateComputedData = useUpdateNodeComputedData5();
431
+ const onPropertiesChange = useCallback2((props) => {
432
+ setProperties(props);
433
+ }, []);
434
+ useEffect6(() => {
435
+ if (incoming?.length) {
436
+ const module = new Turbulence(
437
+ incoming[0].module,
438
+ properties.frequency.value,
439
+ properties.power.value,
440
+ properties.roughness.value,
441
+ properties.seed.value
442
+ );
443
+ updateComputedData(id, { module });
444
+ }
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" })
449
+ ] });
450
+ }
451
+ var noise_turbulence_node_default = NoiseTurbulenceNode;
452
+ export {
453
+ noise_displace_node_default as NoiseDisplaceNode,
454
+ noise_rotate_point_node_default as NoiseRotatePointNode,
455
+ noise_scale_point_node_default as NoiseScalePointNode,
456
+ noise_translate_point_node_default as NoiseTranslatePointNode,
457
+ noise_turbulence_node_default as NoiseTurbulenceNode
458
+ };
459
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,OAAO,aAAa;AAyCvB,SACE,KADF;AArCN,SAAS,kBAAkB,EAAE,IAAI,UAAU,MAAM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nections","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"]}
@@ -0,0 +1,9 @@
1
+ type ValueType = string | number | boolean;
2
+ type PropertyValue<TValue extends ValueType = ValueType> = {
3
+ name: string;
4
+ value: TValue;
5
+ step?: number;
6
+ disabled?: boolean;
7
+ };
8
+
9
+ export type { PropertyValue as P, ValueType as V };
@@ -0,0 +1,9 @@
1
+ type ValueType = string | number | boolean;
2
+ type PropertyValue<TValue extends ValueType = ValueType> = {
3
+ name: string;
4
+ value: TValue;
5
+ step?: number;
6
+ disabled?: boolean;
7
+ };
8
+
9
+ export type { PropertyValue as P, ValueType as V };