@awesome-flow/noise 0.7.0 → 0.8.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 (77) hide show
  1. package/dist/abstract/index.cjs +8 -3469
  2. package/dist/abstract/index.d.cts +2 -2
  3. package/dist/abstract/index.d.ts +2 -2
  4. package/dist/abstract/index.js +15 -3508
  5. package/dist/chunk-2Y22M2Y4.js +0 -0
  6. package/dist/chunk-4PQ4USYV.cjs +1 -0
  7. package/dist/chunk-5ELMFIRV.js +0 -0
  8. package/dist/chunk-ACWBUUZ7.cjs +1376 -0
  9. package/dist/chunk-BG6U3TYO.js +1376 -0
  10. package/dist/chunk-D5JM4EYQ.cjs +305 -0
  11. package/dist/chunk-DWSACR65.js +305 -0
  12. package/dist/chunk-FFQRP23R.cjs +1 -0
  13. package/dist/chunk-JACBT4MS.cjs +1 -0
  14. package/dist/chunk-KHIIB5TH.js +93 -0
  15. package/dist/chunk-M67JHEU2.cjs +93 -0
  16. package/dist/chunk-N6YNJKLS.cjs +1 -0
  17. package/dist/chunk-PS5VUND5.js +348 -0
  18. package/dist/chunk-Q5FVGKKM.cjs +1 -0
  19. package/dist/chunk-RDQ4BOOV.js +522 -0
  20. package/dist/chunk-RKTZQUWR.cjs +348 -0
  21. package/dist/chunk-RVWCBH7K.js +0 -0
  22. package/dist/chunk-SD3T3LFY.js +0 -0
  23. package/dist/chunk-SGHEOOLW.js +19 -0
  24. package/dist/chunk-TOYKGWYO.js +0 -0
  25. package/dist/chunk-TZCT2GZV.cjs +522 -0
  26. package/dist/chunk-UNMRBZ5X.cjs +19 -0
  27. package/dist/chunk-WOJTKQKO.cjs +1 -0
  28. package/dist/chunk-XZQQ6N3L.js +0 -0
  29. package/dist/modules/index.cjs +4 -42
  30. package/dist/modules/index.js +3 -15
  31. package/dist/nodes/generators/index.cjs +13 -335
  32. package/dist/nodes/generators/index.d.cts +7 -7
  33. package/dist/nodes/generators/index.d.ts +7 -7
  34. package/dist/nodes/generators/index.js +12 -299
  35. package/dist/nodes/groups/index.cjs +4 -111
  36. package/dist/nodes/groups/index.d.cts +2 -2
  37. package/dist/nodes/groups/index.d.ts +2 -2
  38. package/dist/nodes/groups/index.js +2 -88
  39. package/dist/nodes/index.cjs +75 -3425
  40. package/dist/nodes/index.js +37 -3397
  41. package/dist/nodes/modifiers/index.cjs +4 -1459
  42. package/dist/nodes/modifiers/index.d.cts +6 -6
  43. package/dist/nodes/modifiers/index.d.ts +6 -6
  44. package/dist/nodes/modifiers/index.js +11 -1479
  45. package/dist/nodes/output/index.cjs +8 -1335
  46. package/dist/nodes/output/index.d.cts +3 -3
  47. package/dist/nodes/output/index.d.ts +3 -3
  48. package/dist/nodes/output/index.js +10 -1361
  49. package/dist/nodes/selectors/index.cjs +8 -1317
  50. package/dist/nodes/selectors/index.d.cts +1 -1
  51. package/dist/nodes/selectors/index.d.ts +1 -1
  52. package/dist/nodes/selectors/index.js +8 -1343
  53. package/dist/nodes/transformers/index.cjs +8 -331
  54. package/dist/nodes/transformers/index.d.cts +5 -5
  55. package/dist/nodes/transformers/index.d.ts +5 -5
  56. package/dist/nodes/transformers/index.js +6 -311
  57. package/dist/templates/generators/index.cjs +8 -1199
  58. package/dist/templates/generators/index.d.cts +5 -5
  59. package/dist/templates/generators/index.d.ts +5 -5
  60. package/dist/templates/generators/index.js +17 -1226
  61. package/dist/templates/groups/index.cjs +8 -1199
  62. package/dist/templates/groups/index.js +8 -1226
  63. package/dist/templates/index.cjs +77 -1263
  64. package/dist/templates/index.js +43 -1226
  65. package/dist/templates/modifiers/index.cjs +8 -1199
  66. package/dist/templates/modifiers/index.d.cts +9 -9
  67. package/dist/templates/modifiers/index.d.ts +9 -9
  68. package/dist/templates/modifiers/index.js +16 -1226
  69. package/dist/templates/output/index.cjs +8 -1199
  70. package/dist/templates/output/index.d.cts +3 -3
  71. package/dist/templates/output/index.d.ts +3 -3
  72. package/dist/templates/output/index.js +11 -1226
  73. package/dist/templates/selectors/index.cjs +8 -1199
  74. package/dist/templates/selectors/index.js +9 -1226
  75. package/dist/templates/transformers/index.cjs +8 -1199
  76. package/dist/templates/transformers/index.js +12 -1226
  77. package/package.json +30 -20
@@ -0,0 +1,305 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/nodes/generators/noise-billow-node.tsx
2
+ var _components = require('@awesome-flow/core/components');
3
+ var _hooks = require('@awesome-flow/core/hooks');
4
+ var _layout = require('@awesome-flow/core/layout');
5
+ var _libnoisesimplexts = require('libnoise-simplex-ts');
6
+ var _react = require('react');
7
+ var _jsxruntime = require('react/jsx-runtime');
8
+ function NoiseBillowNode({ id, selected, data, type }) {
9
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
10
+ const onPropertiesChange = _react.useCallback.call(void 0,
11
+ (properties) => {
12
+ const module = new (0, _libnoisesimplexts.Billow)();
13
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
14
+ updateComputedData(id, { module });
15
+ },
16
+ [id]
17
+ );
18
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
19
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
20
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
21
+ ] });
22
+ }
23
+ var noise_billow_node_default = NoiseBillowNode;
24
+
25
+ // src/nodes/generators/noise-checkerboard-node.tsx
26
+
27
+
28
+
29
+
30
+
31
+ function NoiseCheckerboardNode({ id, selected, data, type }) {
32
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
33
+ _react.useEffect.call(void 0, () => {
34
+ const module = new (0, _libnoisesimplexts.Checkerboard)();
35
+ updateComputedData(id, { module });
36
+ }, [id]);
37
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type });
38
+ }
39
+ var noise_checkerboard_node_default = NoiseCheckerboardNode;
40
+
41
+ // src/nodes/generators/noise-const-node.tsx
42
+
43
+
44
+ var _core = require('@mantine/core');
45
+
46
+
47
+
48
+ function NoiseConstNode({ id, selected, data, type }) {
49
+ const [min, setMin] = _react.useState.call(void 0, data.min);
50
+ const [max, setMax] = _react.useState.call(void 0, data.max);
51
+ const [noise, setNoise] = _react.useState.call(void 0, data.noise);
52
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
53
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
54
+ _react.useEffect.call(void 0, () => {
55
+ const module = new (0, _libnoisesimplexts.Const)(noise);
56
+ updateNodeData(id, { noise, min, max });
57
+ updateComputedData(id, { module });
58
+ }, [noise, min, max]);
59
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
60
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
61
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: min, onChange: (e) => setMin(Number(e)) }),
62
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: max, onChange: (e) => setMax(Number(e)) })
63
+ ] }),
64
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
65
+ "noise:",
66
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
67
+ _core.NumberInput,
68
+ {
69
+ size: "xs",
70
+ value: noise,
71
+ onChange: (e) => setNoise(Number(e)),
72
+ max,
73
+ min,
74
+ step: 0.1
75
+ }
76
+ )
77
+ ] })
78
+ ] }) });
79
+ }
80
+ var noise_const_node_default = NoiseConstNode;
81
+
82
+ // src/nodes/generators/noise-cylinders-node.tsx
83
+
84
+
85
+
86
+
87
+
88
+
89
+ function NoiseCylindersNode({ id, selected, data, type }) {
90
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
91
+ const onPropertiesChange = _react.useCallback.call(void 0,
92
+ (properties) => {
93
+ const module = new (0, _libnoisesimplexts.Cylinders)();
94
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
95
+ updateComputedData(id, { module });
96
+ },
97
+ [id]
98
+ );
99
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
100
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
101
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
102
+ ] });
103
+ }
104
+ var noise_cylinders_node_default = NoiseCylindersNode;
105
+
106
+ // src/nodes/generators/noise-perlin-node.tsx
107
+
108
+
109
+
110
+
111
+
112
+
113
+ function NoisePerlinNode({ id, selected, data, type }) {
114
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
115
+ const onPropertiesChange = _react.useCallback.call(void 0,
116
+ (properties) => {
117
+ const module = new (0, _libnoisesimplexts.Perlin)();
118
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
119
+ updateComputedData(id, { module });
120
+ },
121
+ [id, updateComputedData]
122
+ );
123
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
124
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
125
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
126
+ ] });
127
+ }
128
+ var noise_perlin_node_default = NoisePerlinNode;
129
+
130
+ // src/nodes/generators/noise-ridgedmulti-node.tsx
131
+
132
+
133
+
134
+
135
+
136
+
137
+ function NoiseRidgedMultiNode({ id, selected, data, type }) {
138
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
139
+ const onPropertiesChange = _react.useCallback.call(void 0, (properties) => {
140
+ const module = new (0, _libnoisesimplexts.RidgedMulti)();
141
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
142
+ updateComputedData(id, { module });
143
+ }, []);
144
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
145
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
146
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
147
+ ] });
148
+ }
149
+ var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
150
+
151
+ // src/nodes/generators/noise-spheres-node.tsx
152
+
153
+
154
+
155
+
156
+
157
+
158
+ function NoiseSpheresNode({ id, selected, data, type }) {
159
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
160
+ const onPropertiesChange = _react.useCallback.call(void 0, (properties) => {
161
+ const module = new (0, _libnoisesimplexts.Spheres)();
162
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
163
+ updateComputedData(id, { module });
164
+ }, []);
165
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
166
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
167
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
168
+ ] });
169
+ }
170
+ var noise_spheres_node_default = NoiseSpheresNode;
171
+
172
+ // src/nodes/generators/noise-voronoi-node.tsx
173
+
174
+
175
+
176
+
177
+
178
+
179
+ function NoiseVoronoiNode({ id, selected, data, type }) {
180
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
181
+ const onPropertiesChange = _react.useCallback.call(void 0,
182
+ (properties) => {
183
+ const module = new (0, _libnoisesimplexts.Voronoi)(
184
+ properties.frequency.value,
185
+ properties.displacement.value,
186
+ properties.distance.value,
187
+ properties.seed.value
188
+ );
189
+ updateComputedData(id, { module });
190
+ },
191
+ []
192
+ );
193
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
194
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
195
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
196
+ ] });
197
+ }
198
+ var noise_voronoi_node_default = NoiseVoronoiNode;
199
+
200
+ // src/nodes/generators/position-const-node.tsx
201
+
202
+
203
+
204
+
205
+
206
+ function PositionConstNode({ id, selected, data, type }) {
207
+ const position = _nullishCoalesce(data.position, () => ( { x: 0, y: 0, z: 0 }));
208
+ const [x, setX] = _react.useState.call(void 0, position.x);
209
+ const [y, setY] = _react.useState.call(void 0, position.y);
210
+ const [z, setZ] = _react.useState.call(void 0, position.z);
211
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
212
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
213
+ _react.useEffect.call(void 0, () => {
214
+ const position2 = { x, y, z };
215
+ updateNodeData(id, {
216
+ position: position2
217
+ });
218
+ updateComputedData(id, {
219
+ positions: [position2]
220
+ });
221
+ }, [x, y, z]);
222
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
223
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
224
+ "x: ",
225
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
226
+ ] }),
227
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
228
+ "y: ",
229
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
230
+ ] }),
231
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
232
+ "z: ",
233
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
234
+ ] })
235
+ ] }) });
236
+ }
237
+ var position_const_node_default = PositionConstNode;
238
+
239
+ // src/nodes/generators/position-grid-node.tsx
240
+
241
+
242
+
243
+
244
+
245
+ function PositionGridNode({ id, selected, data, type }) {
246
+ const [x, setX] = _react.useState.call(void 0, _optionalChain([data, 'access', _ => _.center, 'optionalAccess', _2 => _2.x]));
247
+ const [y, setY] = _react.useState.call(void 0, _optionalChain([data, 'access', _3 => _3.center, 'optionalAccess', _4 => _4.y]));
248
+ const [z, setZ] = _react.useState.call(void 0, _optionalChain([data, 'access', _5 => _5.center, 'optionalAccess', _6 => _6.z]));
249
+ const [radius, setRadius] = _react.useState.call(void 0, data.radius);
250
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
251
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
252
+ _react.useEffect.call(void 0, () => {
253
+ updateNodeData(id, {
254
+ center: { x, y, z }
255
+ });
256
+ }, [x, y, z]);
257
+ _react.useEffect.call(void 0, () => {
258
+ updateNodeData(id, {
259
+ radius
260
+ });
261
+ }, [radius]);
262
+ _react.useEffect.call(void 0, () => {
263
+ const positions = [];
264
+ for (let i = -radius; i < radius; i++) {
265
+ for (let j = -radius; j < radius; j++) {
266
+ positions.push({ x: x + i, y: y + j, z });
267
+ }
268
+ }
269
+ updateComputedData(id, {
270
+ positions
271
+ });
272
+ }, [x, y, z, radius]);
273
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
274
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
275
+ "x: ",
276
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
277
+ ] }),
278
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
279
+ "y: ",
280
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
281
+ ] }),
282
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
283
+ "z: ",
284
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
285
+ ] }),
286
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
287
+ "r: ",
288
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: radius, onChange: (e) => setRadius(Number(e)) })
289
+ ] })
290
+ ] }) });
291
+ }
292
+ var position_grid_node_default = PositionGridNode;
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+ exports.noise_billow_node_default = noise_billow_node_default; exports.noise_checkerboard_node_default = noise_checkerboard_node_default; exports.noise_const_node_default = noise_const_node_default; exports.noise_cylinders_node_default = noise_cylinders_node_default; exports.noise_perlin_node_default = noise_perlin_node_default; exports.noise_ridgedmulti_node_default = noise_ridgedmulti_node_default; exports.noise_spheres_node_default = noise_spheres_node_default; exports.noise_voronoi_node_default = noise_voronoi_node_default; exports.position_const_node_default = position_const_node_default; exports.position_grid_node_default = position_grid_node_default;
@@ -0,0 +1,305 @@
1
+ // src/nodes/generators/noise-billow-node.tsx
2
+ import { NodePropertyVariables } from "@awesome-flow/core/components";
3
+ import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
4
+ import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
5
+ import { Billow } from "libnoise-simplex-ts";
6
+ import { useCallback } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ function NoiseBillowNode({ id, selected, data, type }) {
9
+ const updateComputedData = useUpdateNodeComputedData();
10
+ const onPropertiesChange = useCallback(
11
+ (properties) => {
12
+ const module = new Billow();
13
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
14
+ updateComputedData(id, { module });
15
+ },
16
+ [id]
17
+ );
18
+ return /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
19
+ /* @__PURE__ */ jsx(NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
20
+ /* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
21
+ ] });
22
+ }
23
+ var noise_billow_node_default = NoiseBillowNode;
24
+
25
+ // src/nodes/generators/noise-checkerboard-node.tsx
26
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData2 } from "@awesome-flow/core/hooks";
27
+ import { NodeContainer as NodeContainer2 } from "@awesome-flow/core/layout";
28
+ import { Checkerboard } from "libnoise-simplex-ts";
29
+ import { useEffect } from "react";
30
+ import { jsx as jsx2 } from "react/jsx-runtime";
31
+ function NoiseCheckerboardNode({ id, selected, data, type }) {
32
+ const updateComputedData = useUpdateNodeComputedData2();
33
+ useEffect(() => {
34
+ const module = new Checkerboard();
35
+ updateComputedData(id, { module });
36
+ }, [id]);
37
+ return /* @__PURE__ */ jsx2(NodeContainer2, { id, selected, data, type });
38
+ }
39
+ var noise_checkerboard_node_default = NoiseCheckerboardNode;
40
+
41
+ // src/nodes/generators/noise-const-node.tsx
42
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData3, useUpdateNodeData } from "@awesome-flow/core/hooks";
43
+ import { NodeContainer as NodeContainer3 } from "@awesome-flow/core/layout";
44
+ import { Group, NumberInput, Stack } from "@mantine/core";
45
+ import { Const } from "libnoise-simplex-ts";
46
+ import { useEffect as useEffect2, useState } from "react";
47
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
48
+ function NoiseConstNode({ id, selected, data, type }) {
49
+ const [min, setMin] = useState(data.min);
50
+ const [max, setMax] = useState(data.max);
51
+ const [noise, setNoise] = useState(data.noise);
52
+ const updateNodeData = useUpdateNodeData();
53
+ const updateComputedData = useUpdateNodeComputedData3();
54
+ useEffect2(() => {
55
+ const module = new Const(noise);
56
+ updateNodeData(id, { noise, min, max });
57
+ updateComputedData(id, { module });
58
+ }, [noise, min, max]);
59
+ return /* @__PURE__ */ jsx3(NodeContainer3, { id, selected, data, type, children: /* @__PURE__ */ jsxs2(Stack, { children: [
60
+ /* @__PURE__ */ jsxs2(Group, { children: [
61
+ /* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: min, onChange: (e) => setMin(Number(e)) }),
62
+ /* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: max, onChange: (e) => setMax(Number(e)) })
63
+ ] }),
64
+ /* @__PURE__ */ jsxs2(Group, { children: [
65
+ "noise:",
66
+ /* @__PURE__ */ jsx3(
67
+ NumberInput,
68
+ {
69
+ size: "xs",
70
+ value: noise,
71
+ onChange: (e) => setNoise(Number(e)),
72
+ max,
73
+ min,
74
+ step: 0.1
75
+ }
76
+ )
77
+ ] })
78
+ ] }) });
79
+ }
80
+ var noise_const_node_default = NoiseConstNode;
81
+
82
+ // src/nodes/generators/noise-cylinders-node.tsx
83
+ import { NodePropertyVariables as NodePropertyVariables2 } from "@awesome-flow/core/components";
84
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData4 } from "@awesome-flow/core/hooks";
85
+ import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
86
+ import { Cylinders } from "libnoise-simplex-ts";
87
+ import { useCallback as useCallback2 } from "react";
88
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
89
+ function NoiseCylindersNode({ id, selected, data, type }) {
90
+ const updateComputedData = useUpdateNodeComputedData4();
91
+ const onPropertiesChange = useCallback2(
92
+ (properties) => {
93
+ const module = new Cylinders();
94
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
95
+ updateComputedData(id, { module });
96
+ },
97
+ [id]
98
+ );
99
+ return /* @__PURE__ */ jsxs3(NodeContainer4, { id, selected, data, type, children: [
100
+ /* @__PURE__ */ jsx4(NodePropertyVariables2, { data, nodeId: id, onPropertiesChange }),
101
+ /* @__PURE__ */ jsx4(NodeTrackConnections2, { handles: data.handles, nodeId: id, type: "target" })
102
+ ] });
103
+ }
104
+ var noise_cylinders_node_default = NoiseCylindersNode;
105
+
106
+ // src/nodes/generators/noise-perlin-node.tsx
107
+ import { NodePropertyVariables as NodePropertyVariables3 } from "@awesome-flow/core/components";
108
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData5 } from "@awesome-flow/core/hooks";
109
+ import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
110
+ import { Perlin } from "libnoise-simplex-ts";
111
+ import { useCallback as useCallback3 } from "react";
112
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
113
+ function NoisePerlinNode({ id, selected, data, type }) {
114
+ const updateComputedData = useUpdateNodeComputedData5();
115
+ const onPropertiesChange = useCallback3(
116
+ (properties) => {
117
+ const module = new Perlin();
118
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
119
+ updateComputedData(id, { module });
120
+ },
121
+ [id, updateComputedData]
122
+ );
123
+ return /* @__PURE__ */ jsxs4(NodeContainer5, { id, selected, data, type, children: [
124
+ /* @__PURE__ */ jsx5(NodePropertyVariables3, { data, nodeId: id, onPropertiesChange }),
125
+ /* @__PURE__ */ jsx5(NodeTrackConnections3, { handles: data.handles, nodeId: id, type: "target" })
126
+ ] });
127
+ }
128
+ var noise_perlin_node_default = NoisePerlinNode;
129
+
130
+ // src/nodes/generators/noise-ridgedmulti-node.tsx
131
+ import { NodePropertyVariables as NodePropertyVariables4 } from "@awesome-flow/core/components";
132
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData6 } from "@awesome-flow/core/hooks";
133
+ import { NodeContainer as NodeContainer6, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
134
+ import { RidgedMulti } from "libnoise-simplex-ts";
135
+ import { useCallback as useCallback4 } from "react";
136
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
137
+ function NoiseRidgedMultiNode({ id, selected, data, type }) {
138
+ const updateComputedData = useUpdateNodeComputedData6();
139
+ const onPropertiesChange = useCallback4((properties) => {
140
+ const module = new RidgedMulti();
141
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
142
+ updateComputedData(id, { module });
143
+ }, []);
144
+ return /* @__PURE__ */ jsxs5(NodeContainer6, { id, selected, data, type, children: [
145
+ /* @__PURE__ */ jsx6(NodePropertyVariables4, { data, nodeId: id, onPropertiesChange }),
146
+ /* @__PURE__ */ jsx6(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" })
147
+ ] });
148
+ }
149
+ var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
150
+
151
+ // src/nodes/generators/noise-spheres-node.tsx
152
+ import { NodePropertyVariables as NodePropertyVariables5 } from "@awesome-flow/core/components";
153
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData7 } from "@awesome-flow/core/hooks";
154
+ import { NodeContainer as NodeContainer7, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
155
+ import { Spheres } from "libnoise-simplex-ts";
156
+ import { useCallback as useCallback5 } from "react";
157
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
158
+ function NoiseSpheresNode({ id, selected, data, type }) {
159
+ const updateComputedData = useUpdateNodeComputedData7();
160
+ const onPropertiesChange = useCallback5((properties) => {
161
+ const module = new Spheres();
162
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
163
+ updateComputedData(id, { module });
164
+ }, []);
165
+ return /* @__PURE__ */ jsxs6(NodeContainer7, { id, selected, data, type, children: [
166
+ /* @__PURE__ */ jsx7(NodePropertyVariables5, { data, nodeId: id, onPropertiesChange }),
167
+ /* @__PURE__ */ jsx7(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
168
+ ] });
169
+ }
170
+ var noise_spheres_node_default = NoiseSpheresNode;
171
+
172
+ // src/nodes/generators/noise-voronoi-node.tsx
173
+ import { NodePropertyVariables as NodePropertyVariables6 } from "@awesome-flow/core/components";
174
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData8 } from "@awesome-flow/core/hooks";
175
+ import { NodeContainer as NodeContainer8, NodeTrackConnections as NodeTrackConnections6 } from "@awesome-flow/core/layout";
176
+ import { Voronoi } from "libnoise-simplex-ts";
177
+ import { useCallback as useCallback6 } from "react";
178
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
179
+ function NoiseVoronoiNode({ id, selected, data, type }) {
180
+ const updateComputedData = useUpdateNodeComputedData8();
181
+ const onPropertiesChange = useCallback6(
182
+ (properties) => {
183
+ const module = new Voronoi(
184
+ properties.frequency.value,
185
+ properties.displacement.value,
186
+ properties.distance.value,
187
+ properties.seed.value
188
+ );
189
+ updateComputedData(id, { module });
190
+ },
191
+ []
192
+ );
193
+ return /* @__PURE__ */ jsxs7(NodeContainer8, { id, selected, data, type, children: [
194
+ /* @__PURE__ */ jsx8(NodePropertyVariables6, { data, nodeId: id, onPropertiesChange }),
195
+ /* @__PURE__ */ jsx8(NodeTrackConnections6, { handles: data.handles, nodeId: id, type: "target" })
196
+ ] });
197
+ }
198
+ var noise_voronoi_node_default = NoiseVoronoiNode;
199
+
200
+ // src/nodes/generators/position-const-node.tsx
201
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData9, useUpdateNodeData as useUpdateNodeData2 } from "@awesome-flow/core/hooks";
202
+ import { NodeContainer as NodeContainer9 } from "@awesome-flow/core/layout";
203
+ import { Group as Group2, NumberInput as NumberInput2, Stack as Stack2 } from "@mantine/core";
204
+ import { useEffect as useEffect3, useState as useState2 } from "react";
205
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
206
+ function PositionConstNode({ id, selected, data, type }) {
207
+ const position = data.position ?? { x: 0, y: 0, z: 0 };
208
+ const [x, setX] = useState2(position.x);
209
+ const [y, setY] = useState2(position.y);
210
+ const [z, setZ] = useState2(position.z);
211
+ const updateNodeData = useUpdateNodeData2();
212
+ const updateComputedData = useUpdateNodeComputedData9();
213
+ useEffect3(() => {
214
+ const position2 = { x, y, z };
215
+ updateNodeData(id, {
216
+ position: position2
217
+ });
218
+ updateComputedData(id, {
219
+ positions: [position2]
220
+ });
221
+ }, [x, y, z]);
222
+ return /* @__PURE__ */ jsx9(NodeContainer9, { id, selected, data, type, children: /* @__PURE__ */ jsxs8(Stack2, { children: [
223
+ /* @__PURE__ */ jsxs8(Group2, { children: [
224
+ "x: ",
225
+ /* @__PURE__ */ jsx9(NumberInput2, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
226
+ ] }),
227
+ /* @__PURE__ */ jsxs8(Group2, { children: [
228
+ "y: ",
229
+ /* @__PURE__ */ jsx9(NumberInput2, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
230
+ ] }),
231
+ /* @__PURE__ */ jsxs8(Group2, { children: [
232
+ "z: ",
233
+ /* @__PURE__ */ jsx9(NumberInput2, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
234
+ ] })
235
+ ] }) });
236
+ }
237
+ var position_const_node_default = PositionConstNode;
238
+
239
+ // src/nodes/generators/position-grid-node.tsx
240
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData10, useUpdateNodeData as useUpdateNodeData3 } from "@awesome-flow/core/hooks";
241
+ import { NodeContainer as NodeContainer10 } from "@awesome-flow/core/layout";
242
+ import { Group as Group3, NumberInput as NumberInput3, Stack as Stack3 } from "@mantine/core";
243
+ import { useEffect as useEffect4, useState as useState3 } from "react";
244
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
245
+ function PositionGridNode({ id, selected, data, type }) {
246
+ const [x, setX] = useState3(data.center?.x);
247
+ const [y, setY] = useState3(data.center?.y);
248
+ const [z, setZ] = useState3(data.center?.z);
249
+ const [radius, setRadius] = useState3(data.radius);
250
+ const updateNodeData = useUpdateNodeData3();
251
+ const updateComputedData = useUpdateNodeComputedData10();
252
+ useEffect4(() => {
253
+ updateNodeData(id, {
254
+ center: { x, y, z }
255
+ });
256
+ }, [x, y, z]);
257
+ useEffect4(() => {
258
+ updateNodeData(id, {
259
+ radius
260
+ });
261
+ }, [radius]);
262
+ useEffect4(() => {
263
+ const positions = [];
264
+ for (let i = -radius; i < radius; i++) {
265
+ for (let j = -radius; j < radius; j++) {
266
+ positions.push({ x: x + i, y: y + j, z });
267
+ }
268
+ }
269
+ updateComputedData(id, {
270
+ positions
271
+ });
272
+ }, [x, y, z, radius]);
273
+ return /* @__PURE__ */ jsx10(NodeContainer10, { id, selected, data, type, children: /* @__PURE__ */ jsxs9(Stack3, { children: [
274
+ /* @__PURE__ */ jsxs9(Group3, { children: [
275
+ "x: ",
276
+ /* @__PURE__ */ jsx10(NumberInput3, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
277
+ ] }),
278
+ /* @__PURE__ */ jsxs9(Group3, { children: [
279
+ "y: ",
280
+ /* @__PURE__ */ jsx10(NumberInput3, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
281
+ ] }),
282
+ /* @__PURE__ */ jsxs9(Group3, { children: [
283
+ "z: ",
284
+ /* @__PURE__ */ jsx10(NumberInput3, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
285
+ ] }),
286
+ /* @__PURE__ */ jsxs9(Group3, { children: [
287
+ "r: ",
288
+ /* @__PURE__ */ jsx10(NumberInput3, { size: "xs", w: 100, value: radius, onChange: (e) => setRadius(Number(e)) })
289
+ ] })
290
+ ] }) });
291
+ }
292
+ var position_grid_node_default = PositionGridNode;
293
+
294
+ export {
295
+ noise_billow_node_default,
296
+ noise_checkerboard_node_default,
297
+ noise_const_node_default,
298
+ noise_cylinders_node_default,
299
+ noise_perlin_node_default,
300
+ noise_ridgedmulti_node_default,
301
+ noise_spheres_node_default,
302
+ noise_voronoi_node_default,
303
+ position_const_node_default,
304
+ position_grid_node_default
305
+ };
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ "use strict";