@awesome-flow/noise 0.7.1 → 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 (57) hide show
  1. package/dist/abstract/index.cjs +29 -1
  2. package/dist/abstract/index.js +29 -1
  3. package/dist/chunk-2Y22M2Y4.js +0 -0
  4. package/dist/chunk-4PQ4USYV.cjs +1 -0
  5. package/dist/chunk-5ELMFIRV.js +0 -0
  6. package/dist/chunk-ACWBUUZ7.cjs +1376 -0
  7. package/dist/chunk-BG6U3TYO.js +1376 -0
  8. package/dist/chunk-D5JM4EYQ.cjs +305 -0
  9. package/dist/chunk-DWSACR65.js +305 -0
  10. package/dist/chunk-FFQRP23R.cjs +1 -0
  11. package/dist/chunk-JACBT4MS.cjs +1 -0
  12. package/dist/chunk-KHIIB5TH.js +93 -0
  13. package/dist/chunk-M67JHEU2.cjs +93 -0
  14. package/dist/chunk-N6YNJKLS.cjs +1 -0
  15. package/dist/chunk-PS5VUND5.js +348 -0
  16. package/dist/chunk-Q5FVGKKM.cjs +1 -0
  17. package/dist/chunk-RDQ4BOOV.js +522 -0
  18. package/dist/chunk-RKTZQUWR.cjs +348 -0
  19. package/dist/chunk-RVWCBH7K.js +0 -0
  20. package/dist/chunk-SD3T3LFY.js +0 -0
  21. package/dist/chunk-SGHEOOLW.js +19 -0
  22. package/dist/chunk-TOYKGWYO.js +0 -0
  23. package/dist/chunk-TZCT2GZV.cjs +522 -0
  24. package/dist/chunk-UNMRBZ5X.cjs +19 -0
  25. package/dist/chunk-WOJTKQKO.cjs +1 -0
  26. package/dist/chunk-XZQQ6N3L.js +0 -0
  27. package/dist/modules/index.cjs +6 -1
  28. package/dist/modules/index.js +6 -1
  29. package/dist/nodes/generators/index.cjs +24 -1
  30. package/dist/nodes/generators/index.js +24 -1
  31. package/dist/nodes/groups/index.cjs +6 -1
  32. package/dist/nodes/groups/index.js +6 -1
  33. package/dist/nodes/index.cjs +75 -1
  34. package/dist/nodes/index.js +75 -1
  35. package/dist/nodes/modifiers/index.cjs +23 -1
  36. package/dist/nodes/modifiers/index.js +23 -1
  37. package/dist/nodes/output/index.cjs +17 -1
  38. package/dist/nodes/output/index.js +17 -1
  39. package/dist/nodes/selectors/index.cjs +13 -1
  40. package/dist/nodes/selectors/index.js +13 -1
  41. package/dist/nodes/transformers/index.cjs +14 -1
  42. package/dist/nodes/transformers/index.js +14 -1
  43. package/dist/templates/generators/index.cjs +30 -1
  44. package/dist/templates/generators/index.js +30 -1
  45. package/dist/templates/groups/index.cjs +12 -1
  46. package/dist/templates/groups/index.js +12 -1
  47. package/dist/templates/index.cjs +77 -1
  48. package/dist/templates/index.js +77 -1
  49. package/dist/templates/modifiers/index.cjs +28 -1
  50. package/dist/templates/modifiers/index.js +28 -1
  51. package/dist/templates/output/index.cjs +18 -1
  52. package/dist/templates/output/index.js +18 -1
  53. package/dist/templates/selectors/index.cjs +14 -1
  54. package/dist/templates/selectors/index.js +14 -1
  55. package/dist/templates/transformers/index.cjs +20 -1
  56. package/dist/templates/transformers/index.js +20 -1
  57. package/package.json +26 -18
@@ -0,0 +1,522 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
2
+
3
+ var _chunkUNMRBZ5Xcjs = require('./chunk-UNMRBZ5X.cjs');
4
+
5
+ // src/nodes/modifiers/noise-abs-node.tsx
6
+ var _hooks = require('@awesome-flow/core/hooks');
7
+ var _layout = require('@awesome-flow/core/layout');
8
+ var _libnoisesimplexts = require('libnoise-simplex-ts');
9
+ var _react = require('react');
10
+ var _jsxruntime = require('react/jsx-runtime');
11
+ function NoiseAbsNode({ id, selected, data, type }) {
12
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
13
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
14
+ _react.useEffect.call(void 0, () => {
15
+ if (_optionalChain([incoming, 'optionalAccess', _ => _.length]) > 0) {
16
+ const module = new (0, _libnoisesimplexts.Abs)(incoming[0].module);
17
+ updateComputedData(id, { module });
18
+ }
19
+ }, [incoming]);
20
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" }) });
21
+ }
22
+ var noise_abs_node_default = NoiseAbsNode;
23
+
24
+ // src/nodes/modifiers/noise-clamp-node.tsx
25
+
26
+
27
+
28
+
29
+
30
+
31
+ var _core = require('@mantine/core');
32
+
33
+
34
+
35
+ function NoiseClampNode({ id, selected, data, type }) {
36
+ const [lowerBound, setLowerBound] = _react.useState.call(void 0, data.lowerBound);
37
+ const [upperBound, setUpperBound] = _react.useState.call(void 0, data.upperBound);
38
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
39
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
40
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
41
+ _react.useEffect.call(void 0, () => {
42
+ if (_optionalChain([incoming, 'optionalAccess', _2 => _2.length])) {
43
+ const module = new (0, _libnoisesimplexts.Clamp)(incoming[0].module, lowerBound, upperBound);
44
+ updateComputedData(id, { module });
45
+ }
46
+ updateNodeData(id, { lowerBound, upperBound });
47
+ }, [incoming, lowerBound, upperBound]);
48
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
49
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
50
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
51
+ _core.NumberInput,
52
+ {
53
+ size: "xs",
54
+ w: 100,
55
+ value: lowerBound,
56
+ onChange: (e) => setLowerBound(Number(e)),
57
+ step: 0.1
58
+ }
59
+ ),
60
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
61
+ _core.NumberInput,
62
+ {
63
+ size: "xs",
64
+ w: 100,
65
+ value: upperBound,
66
+ onChange: (e) => setUpperBound(Number(e)),
67
+ step: 0.1
68
+ }
69
+ )
70
+ ] }) }),
71
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
72
+ ] });
73
+ }
74
+ var noise_clamp_node_default = NoiseClampNode;
75
+
76
+ // src/nodes/modifiers/noise-combine-node.tsx
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ var _iconsreact = require('@tabler/icons-react');
90
+
91
+
92
+ // src/abstract/operations.ts
93
+
94
+ var NoiseCombineType = /* @__PURE__ */ ((NoiseCombineType3) => {
95
+ NoiseCombineType3["add"] = "add";
96
+ NoiseCombineType3["max"] = "max";
97
+ NoiseCombineType3["min"] = "min";
98
+ NoiseCombineType3["multiply"] = "multiply";
99
+ NoiseCombineType3["power"] = "power";
100
+ return NoiseCombineType3;
101
+ })(NoiseCombineType || {});
102
+ var noiseCombineModuleMap = {
103
+ ["add" /* add */]: _libnoisesimplexts.Add,
104
+ ["max" /* max */]: _libnoisesimplexts.Max,
105
+ ["min" /* min */]: _libnoisesimplexts.Min,
106
+ ["multiply" /* multiply */]: _libnoisesimplexts.Multiply,
107
+ ["power" /* power */]: _libnoisesimplexts.Power
108
+ };
109
+
110
+ // src/nodes/modifiers/noise-combine-node.tsx
111
+
112
+ var options = {
113
+ add: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconPlus, {}),
114
+ min: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconChevronLeft, {}),
115
+ max: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconChevronRight, {}),
116
+ multiply: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconAsterisk, {}),
117
+ power: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconChevronUp, {})
118
+ };
119
+ function NoiseCombineNode({ id, selected, data, type }) {
120
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
121
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
122
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
123
+ _react.useEffect.call(void 0, () => {
124
+ const ModuleFactory = noiseCombineModuleMap[data.operation];
125
+ if (_optionalChain([incoming, 'optionalAccess', _3 => _3.length]) > 1) {
126
+ const module = new ModuleFactory(incoming[0].module, incoming[1].module);
127
+ updateComputedData(id, { module });
128
+ }
129
+ }, [data.operation, incoming]);
130
+ const onChange = _react.useCallback.call(void 0, (operation) => {
131
+ updateNodeData(id, { operation });
132
+ }, []);
133
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
134
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeCombobox, { options, selected: data.operation, onChange, width: 150 }),
135
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
136
+ ] });
137
+ }
138
+ var noise_combine_node_default = NoiseCombineNode;
139
+
140
+ // src/nodes/modifiers/noise-curve-node.tsx
141
+ var _abstract = require('@awesome-flow/core/abstract');
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+ var _form = require('@mantine/form');
150
+ var _hooks3 = require('@mantine/hooks');
151
+
152
+
153
+
154
+
155
+ function NoiseCurveNode({ id, selected, data, type }) {
156
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
157
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
158
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
159
+ const [values, setValues] = _react.useState.call(void 0, []);
160
+ const form = _form.useForm.call(void 0, {
161
+ mode: "uncontrolled",
162
+ initialValues: {
163
+ points: []
164
+ },
165
+ validateInputOnChange: [`points.${_form.FORM_INDEX}.input`],
166
+ clearInputErrorOnChange: true,
167
+ validate: {
168
+ points: {
169
+ input: (value, values2) => {
170
+ const counts = {};
171
+ values2.points.forEach((x) => {
172
+ counts[x.input] = (counts[x.input] || 0) + 1;
173
+ });
174
+ return counts[value] > 1;
175
+ }
176
+ }
177
+ },
178
+ onValuesChange: _react.useCallback.call(void 0, (values2) => {
179
+ form.validate();
180
+ if (form.isValid()) {
181
+ const points = values2.points.map((v) => ({ input: v.input, output: v.output }));
182
+ setValues(points);
183
+ updateNodeData(id, { points });
184
+ }
185
+ }, [])
186
+ });
187
+ _react.useEffect.call(void 0, () => {
188
+ const points = _optionalChain([data, 'access', _4 => _4.points, 'optionalAccess', _5 => _5.length]) ? data.points.map((v) => ({ input: v.input, output: v.output, key: _hooks3.randomId.call(void 0, ) })) : [1, 2, 3, 4].map(() => ({ input: 0, output: 0, key: _hooks3.randomId.call(void 0, ) }));
189
+ form.initialize({ points });
190
+ }, []);
191
+ _react.useEffect.call(void 0, () => {
192
+ if (_optionalChain([incoming, 'optionalAccess', _6 => _6.length]) && _optionalChain([values, 'optionalAccess', _7 => _7.length]) >= 4) {
193
+ const module = new (0, _libnoisesimplexts.Curve)(
194
+ incoming[0].module,
195
+ values.map((p) => new (0, _libnoisesimplexts.Tuple)(p.input, p.output))
196
+ );
197
+ updateComputedData(id, { module });
198
+ }
199
+ }, [values, incoming]);
200
+ const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { mt: "xs", children: [
201
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
202
+ _core.NumberInput,
203
+ {
204
+ size: "xs",
205
+ w: 100,
206
+ placeholder: "Input Value",
207
+ ...form.getInputProps(`points.${index}.input`),
208
+ step: 0.1
209
+ },
210
+ form.key(`points.${index}.input`)
211
+ ),
212
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
213
+ _core.NumberInput,
214
+ {
215
+ size: "xs",
216
+ w: 100,
217
+ placeholder: "Output Value",
218
+ ...form.getInputProps(`points.${index}.output`),
219
+ step: 0.1
220
+ },
221
+ form.key(`points.${index}.output`)
222
+ ),
223
+ data.state === _abstract.NodeState.edit && values.length > 4 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
224
+ _core.ActionIcon,
225
+ {
226
+ color: "red",
227
+ variant: "outline",
228
+ size: "sm",
229
+ onClick: () => form.removeListItem("points", index),
230
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconX, { size: "1rem" })
231
+ }
232
+ )
233
+ ] }, item.key));
234
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, type, data, children: [
235
+ fields,
236
+ data.state === _abstract.NodeState.edit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
237
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Space, { h: 10 }),
238
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
239
+ _core.Button,
240
+ {
241
+ variant: "outline",
242
+ size: "xs",
243
+ fullWidth: true,
244
+ onClick: () => form.insertListItem("points", { input: 0, output: 0, key: _hooks3.randomId.call(void 0, ) }),
245
+ children: "Add control point"
246
+ }
247
+ )
248
+ ] }),
249
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
250
+ ] });
251
+ }
252
+ var noise_curve_node_default = NoiseCurveNode;
253
+
254
+ // src/nodes/modifiers/noise-exponent-node.tsx
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+ function NoiseExponentNode({ id, selected, data, type }) {
266
+ const [exponent, setExponent] = _react.useState.call(void 0, data.exponent);
267
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
268
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
269
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
270
+ _react.useEffect.call(void 0, () => {
271
+ if (_optionalChain([incoming, 'optionalAccess', _8 => _8.length]) > 0) {
272
+ const module = new (0, _libnoisesimplexts.Exponent)(incoming[0].module, exponent);
273
+ updateComputedData(id, { module });
274
+ }
275
+ updateNodeData(id, { exponent });
276
+ }, [incoming, exponent]);
277
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
278
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
279
+ "Exponent:",
280
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
281
+ _core.NumberInput,
282
+ {
283
+ size: "xs",
284
+ value: exponent,
285
+ onChange: (e) => setExponent(Number(e)),
286
+ step: 0.1
287
+ }
288
+ )
289
+ ] }) }),
290
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
291
+ ] });
292
+ }
293
+ var noise_exponent_node_default = NoiseExponentNode;
294
+
295
+ // src/nodes/modifiers/noise-invert-node.tsx
296
+
297
+
298
+
299
+
300
+
301
+ function NoiseInvertNode({ id, selected, data, type }) {
302
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
303
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
304
+ _react.useEffect.call(void 0, () => {
305
+ if (_optionalChain([incoming, 'optionalAccess', _9 => _9.length]) > 0) {
306
+ const module = new (0, _libnoisesimplexts.Invert)(incoming[0].module);
307
+ updateComputedData(id, { module });
308
+ }
309
+ }, [incoming]);
310
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" }) });
311
+ }
312
+ var noise_invert_node_default = NoiseInvertNode;
313
+
314
+ // src/nodes/modifiers/noise-normalize-node.tsx
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+ function NoiseNormalizeNode({ id, selected, data, type }) {
325
+ const [intervalStart, setIntervalStart] = _react.useState.call(void 0, data.intervalStart);
326
+ const [intervalEnd, setIntervalEnd] = _react.useState.call(void 0, data.intervalEnd);
327
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
328
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
329
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
330
+ _react.useEffect.call(void 0, () => {
331
+ if (_optionalChain([incoming, 'optionalAccess', _10 => _10.length])) {
332
+ const source = incoming[0].module;
333
+ const module = new (0, _chunkUNMRBZ5Xcjs.NormalizeNoiseModule)(source, intervalStart, intervalEnd);
334
+ updateComputedData(id, { module });
335
+ }
336
+ updateNodeData(id, { intervalStart, intervalEnd });
337
+ }, [incoming, intervalStart, intervalEnd]);
338
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
339
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
340
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
341
+ _core.NumberInput,
342
+ {
343
+ size: "xs",
344
+ w: 100,
345
+ value: intervalStart,
346
+ onChange: (e) => setIntervalStart(Number(e))
347
+ }
348
+ ),
349
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
350
+ _core.NumberInput,
351
+ {
352
+ size: "xs",
353
+ w: 100,
354
+ value: intervalEnd,
355
+ onChange: (e) => setIntervalEnd(Number(e))
356
+ }
357
+ )
358
+ ] }) }),
359
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
360
+ ] });
361
+ }
362
+ var noise_normalize_node_default = NoiseNormalizeNode;
363
+
364
+ // src/nodes/modifiers/noise-scale-bias-node.tsx
365
+
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+ function NoiseScaleBiasNode({ id, selected, data, type }) {
376
+ const [scale, setScale] = _react.useState.call(void 0, data.scale);
377
+ const [bias, setBias] = _react.useState.call(void 0, data.bias);
378
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
379
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
380
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
381
+ _react.useEffect.call(void 0, () => {
382
+ if (_optionalChain([incoming, 'optionalAccess', _11 => _11.length]) > 0) {
383
+ const module = new (0, _libnoisesimplexts.ScaleBias)(incoming[0].module, scale, bias);
384
+ updateComputedData(id, { module });
385
+ }
386
+ updateNodeData(id, { scale, bias });
387
+ }, [incoming, scale, bias]);
388
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
389
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
390
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
391
+ "Scale:",
392
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
393
+ _core.NumberInput,
394
+ {
395
+ size: "xs",
396
+ w: 100,
397
+ value: scale,
398
+ onChange: (e) => setScale(Number(e)),
399
+ step: 0.1
400
+ }
401
+ )
402
+ ] }),
403
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
404
+ "Bias:",
405
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
406
+ _core.NumberInput,
407
+ {
408
+ size: "xs",
409
+ w: 100,
410
+ value: bias,
411
+ onChange: (e) => setBias(Number(e)),
412
+ step: 0.1
413
+ }
414
+ )
415
+ ] })
416
+ ] }),
417
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
418
+ ] });
419
+ }
420
+ var noise_scale_bias_node_default = NoiseScaleBiasNode;
421
+
422
+ // src/nodes/modifiers/noise-terrace-node.tsx
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+ function NoiseTerraceNode({ id, selected, data, type }) {
438
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
439
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
440
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
441
+ const [values, setValues] = _react.useState.call(void 0, []);
442
+ const form = _form.useForm.call(void 0, {
443
+ mode: "uncontrolled",
444
+ initialValues: {
445
+ points: []
446
+ },
447
+ validateInputOnChange: [`points.${_form.FORM_INDEX}.input`],
448
+ clearInputErrorOnChange: true,
449
+ onValuesChange: _react.useCallback.call(void 0, (values2) => {
450
+ if (form.isValid()) {
451
+ const points = values2.points.map((v) => v.value);
452
+ setValues(points);
453
+ updateNodeData(id, { points });
454
+ }
455
+ form.validate();
456
+ }, [])
457
+ });
458
+ _react.useEffect.call(void 0, () => {
459
+ const points = _optionalChain([data, 'access', _12 => _12.points, 'optionalAccess', _13 => _13.length]) ? data.points.map((v) => ({ value: v, key: _hooks3.randomId.call(void 0, ) })) : [1, 2].map(() => ({ value: 0, key: _hooks3.randomId.call(void 0, ) }));
460
+ form.initialize({ points });
461
+ }, []);
462
+ _react.useEffect.call(void 0, () => {
463
+ if (_optionalChain([incoming, 'optionalAccess', _14 => _14.length]) && _optionalChain([values, 'optionalAccess', _15 => _15.length]) >= 2) {
464
+ const module = new (0, _libnoisesimplexts.Terrace)(incoming[0].module, values);
465
+ updateComputedData(id, { module });
466
+ }
467
+ }, [values, incoming]);
468
+ const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { mt: "xs", children: [
469
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
470
+ _core.NumberInput,
471
+ {
472
+ size: "xs",
473
+ placeholder: "Input Value",
474
+ ...form.getInputProps(`points.${index}.value`),
475
+ step: 0.1
476
+ },
477
+ form.key(`points.${index}.value`)
478
+ ),
479
+ data.state === _abstract.NodeState.edit && values.length > 2 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
480
+ _core.ActionIcon,
481
+ {
482
+ color: "red",
483
+ variant: "outline",
484
+ size: "sm",
485
+ onClick: () => form.removeListItem("points", index),
486
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconX, { size: "1rem" })
487
+ }
488
+ )
489
+ ] }, item.key));
490
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, type, data, children: [
491
+ fields,
492
+ data.state === _abstract.NodeState.edit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
493
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Space, { h: 10 }),
494
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
495
+ _core.Button,
496
+ {
497
+ variant: "outline",
498
+ size: "xs",
499
+ fullWidth: true,
500
+ onClick: () => form.insertListItem("points", { value: 0, key: _hooks3.randomId.call(void 0, ) }),
501
+ children: "Add control point"
502
+ }
503
+ )
504
+ ] }),
505
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
506
+ ] });
507
+ }
508
+ var noise_terrace_node_default = NoiseTerraceNode;
509
+
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+ exports.noise_abs_node_default = noise_abs_node_default; exports.noise_clamp_node_default = noise_clamp_node_default; exports.NoiseCombineType = NoiseCombineType; exports.noiseCombineModuleMap = noiseCombineModuleMap; exports.noise_combine_node_default = noise_combine_node_default; exports.noise_curve_node_default = noise_curve_node_default; exports.noise_exponent_node_default = noise_exponent_node_default; exports.noise_invert_node_default = noise_invert_node_default; exports.noise_normalize_node_default = noise_normalize_node_default; exports.noise_scale_bias_node_default = noise_scale_bias_node_default; exports.noise_terrace_node_default = noise_terrace_node_default;
@@ -0,0 +1,19 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/modules/normalize-noise-module.ts
2
+ var _libnoisesimplexts = require('libnoise-simplex-ts');
3
+ var NormalizeNoiseModule = class extends _libnoisesimplexts.ModifierModule {
4
+ constructor(source, lowerBound, upperBound) {
5
+ super(source);
6
+ this.lowerBound = lowerBound;
7
+ this.upperBound = upperBound;
8
+ }
9
+ getValue(x, y, z) {
10
+ return normalize(this.sourceModule.getValue(x, y, z), this.lowerBound, this.upperBound);
11
+ }
12
+ };
13
+ function normalize(value, min, max) {
14
+ return (value - min) / (max - min);
15
+ }
16
+
17
+
18
+
19
+ exports.NormalizeNoiseModule = NormalizeNoiseModule;
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
@@ -1 +1,6 @@
1
- var t=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var s=(u,e)=>{for(var r in e)t(u,r,{get:e[r],enumerable:!0})},c=(u,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of p(e))!d.call(u,n)&&n!==r&&t(u,n,{get:()=>e[n],enumerable:!(o=l(e,n))||o.enumerable});return u};var i=u=>c(t({},"__esModule",{value:!0}),u);var B={};s(B,{NormalizeNoiseModule:()=>b});module.exports=i(B);var m=require("libnoise-simplex-ts"),b=class extends m.ModifierModule{constructor(r,o,n){super(r);this.lowerBound=o;this.upperBound=n}getValue(r,o,n){return f(this.sourceModule.getValue(r,o,n),this.lowerBound,this.upperBound)}};function f(u,e,r){return(u-e)/(r-e)}0&&(module.exports={NormalizeNoiseModule});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkUNMRBZ5Xcjs = require('../chunk-UNMRBZ5X.cjs');
4
+
5
+
6
+ exports.NormalizeNoiseModule = _chunkUNMRBZ5Xcjs.NormalizeNoiseModule;
@@ -1 +1,6 @@
1
- import{ModifierModule as b}from"libnoise-simplex-ts";var t=class extends b{constructor(e,n,o){super(e);this.lowerBound=n;this.upperBound=o}getValue(e,n,o){return m(this.sourceModule.getValue(e,n,o),this.lowerBound,this.upperBound)}};function m(r,u,e){return(r-u)/(e-u)}export{t as NormalizeNoiseModule};
1
+ import {
2
+ NormalizeNoiseModule
3
+ } from "../chunk-SGHEOOLW.js";
4
+ export {
5
+ NormalizeNoiseModule
6
+ };
@@ -1 +1,24 @@
1
- var Y=Object.defineProperty;var So=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Ro=Object.prototype.hasOwnProperty;var Bo=(o,a)=>{for(var e in a)Y(o,e,{get:a[e],enumerable:!0})},Eo=(o,a,e,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of Uo(a))!Ro.call(o,t)&&t!==e&&Y(o,t,{get:()=>a[t],enumerable:!(s=So(a,t))||s.enumerable});return o};var To=o=>Eo(Y({},"__esModule",{value:!0}),o);var Lo={};Bo(Lo,{NoiseBillowNode:()=>J,NoiseCheckerboardNode:()=>_,NoiseConstNode:()=>eo,NoiseCylindersNode:()=>so,NoisePerlinNode:()=>No,NoiseRidgedMultiNode:()=>Do,NoiseSpheresNode:()=>bo,NoiseVoronoiNode:()=>wo,PositionConstNode:()=>zo,PositionGridNode:()=>Io});module.exports=To(Lo);var Z=require("@awesome-flow/core/components"),q=require("@awesome-flow/core/hooks"),G=require("@awesome-flow/core/layout"),A=require("libnoise-simplex-ts"),H=require("react"),M=require("react/jsx-runtime");function Oo({id:o,selected:a,data:e,type:s}){let t=(0,q.useUpdateNodeComputedData)(),p=(0,H.useCallback)(r=>{let n=new A.Billow;Object.keys(r).forEach(d=>n[d]=r[d].value),t(o,{module:n})},[o]);return(0,M.jsxs)(G.NodeContainer,{id:o,selected:a,data:e,type:s,children:[(0,M.jsx)(Z.NodePropertyVariables,{data:e,nodeId:o,onPropertiesChange:p}),(0,M.jsx)(G.NodeTrackConnections,{handles:e.handles,nodeId:o,type:"target"})]})}var J=Oo;var K=require("@awesome-flow/core/hooks"),L=require("@awesome-flow/core/layout"),Q=require("libnoise-simplex-ts"),W=require("react"),$=require("react/jsx-runtime");function Fo({id:o,selected:a,data:e,type:s}){let t=(0,K.useUpdateNodeComputedData)();return(0,W.useEffect)(()=>{let p=new Q.Checkerboard;t(o,{module:p})},[o]),(0,$.jsx)(L.NodeContainer,{id:o,selected:a,data:e,type:s})}var _=Fo;var I=require("@awesome-flow/core/hooks"),j=require("@awesome-flow/core/layout"),P=require("@mantine/core"),oo=require("libnoise-simplex-ts"),g=require("react"),D=require("react/jsx-runtime");function Xo({id:o,selected:a,data:e,type:s}){let[t,p]=(0,g.useState)(e.min),[r,n]=(0,g.useState)(e.max),[d,h]=(0,g.useState)(e.noise),m=(0,I.useUpdateNodeData)(),x=(0,I.useUpdateNodeComputedData)();return(0,g.useEffect)(()=>{let i=new oo.Const(d);m(o,{noise:d,min:t,max:r}),x(o,{module:i})},[d,t,r]),(0,D.jsx)(j.NodeContainer,{id:o,selected:a,data:e,type:s,children:(0,D.jsxs)(P.Stack,{children:[(0,D.jsxs)(P.Group,{children:[(0,D.jsx)(P.NumberInput,{size:"xs",w:100,value:t,onChange:i=>p(Number(i))}),(0,D.jsx)(P.NumberInput,{size:"xs",w:100,value:r,onChange:i=>n(Number(i))})]}),(0,D.jsxs)(P.Group,{children:["noise:",(0,D.jsx)(P.NumberInput,{size:"xs",value:d,onChange:i=>h(Number(i)),max:r,min:t,step:.1})]})]})})}var eo=Xo;var to=require("@awesome-flow/core/components"),ro=require("@awesome-flow/core/hooks"),S=require("@awesome-flow/core/layout"),ao=require("libnoise-simplex-ts"),no=require("react"),V=require("react/jsx-runtime");function Yo({id:o,selected:a,data:e,type:s}){let t=(0,ro.useUpdateNodeComputedData)(),p=(0,no.useCallback)(r=>{let n=new ao.Cylinders;Object.keys(r).forEach(d=>n[d]=r[d].value),t(o,{module:n})},[o]);return(0,V.jsxs)(S.NodeContainer,{id:o,selected:a,data:e,type:s,children:[(0,V.jsx)(to.NodePropertyVariables,{data:e,nodeId:o,onPropertiesChange:p}),(0,V.jsx)(S.NodeTrackConnections,{handles:e.handles,nodeId:o,type:"target"})]})}var so=Yo;var po=require("@awesome-flow/core/components"),mo=require("@awesome-flow/core/hooks"),U=require("@awesome-flow/core/layout"),io=require("libnoise-simplex-ts"),uo=require("react"),k=require("react/jsx-runtime");function Zo({id:o,selected:a,data:e,type:s}){let t=(0,mo.useUpdateNodeComputedData)(),p=(0,uo.useCallback)(r=>{let n=new io.Perlin;Object.keys(r).forEach(d=>n[d]=r[d].value),t(o,{module:n})},[o,t]);return(0,k.jsxs)(U.NodeContainer,{id:o,selected:a,data:e,type:s,children:[(0,k.jsx)(po.NodePropertyVariables,{data:e,nodeId:o,onPropertiesChange:p}),(0,k.jsx)(U.NodeTrackConnections,{handles:e.handles,nodeId:o,type:"target"})]})}var No=Zo;var lo=require("@awesome-flow/core/components"),fo=require("@awesome-flow/core/hooks"),R=require("@awesome-flow/core/layout"),Co=require("libnoise-simplex-ts"),co=require("react"),w=require("react/jsx-runtime");function qo({id:o,selected:a,data:e,type:s}){let t=(0,fo.useUpdateNodeComputedData)(),p=(0,co.useCallback)(r=>{let n=new Co.RidgedMulti;Object.keys(r).forEach(d=>n[d]=r[d].value),t(o,{module:n})},[]);return(0,w.jsxs)(R.NodeContainer,{id:o,selected:a,data:e,type:s,children:[(0,w.jsx)(lo.NodePropertyVariables,{data:e,nodeId:o,onPropertiesChange:p}),(0,w.jsx)(R.NodeTrackConnections,{handles:e.handles,nodeId:o,type:"target"})]})}var Do=qo;var Po=require("@awesome-flow/core/components"),yo=require("@awesome-flow/core/hooks"),B=require("@awesome-flow/core/layout"),ho=require("libnoise-simplex-ts"),go=require("react"),v=require("react/jsx-runtime");function Ao({id:o,selected:a,data:e,type:s}){let t=(0,yo.useUpdateNodeComputedData)(),p=(0,go.useCallback)(r=>{let n=new ho.Spheres;Object.keys(r).forEach(d=>n[d]=r[d].value),t(o,{module:n})},[]);return(0,v.jsxs)(B.NodeContainer,{id:o,selected:a,data:e,type:s,children:[(0,v.jsx)(Po.NodePropertyVariables,{data:e,nodeId:o,onPropertiesChange:p}),(0,v.jsx)(B.NodeTrackConnections,{handles:e.handles,nodeId:o,type:"target"})]})}var bo=Ao;var xo=require("@awesome-flow/core/components"),Mo=require("@awesome-flow/core/hooks"),E=require("@awesome-flow/core/layout"),Vo=require("libnoise-simplex-ts"),ko=require("react"),z=require("react/jsx-runtime");function Ho({id:o,selected:a,data:e,type:s}){let t=(0,Mo.useUpdateNodeComputedData)(),p=(0,ko.useCallback)(r=>{let n=new Vo.Voronoi(r.frequency.value,r.displacement.value,r.distance.value,r.seed.value);t(o,{module:n})},[]);return(0,z.jsxs)(E.NodeContainer,{id:o,selected:a,data:e,type:s,children:[(0,z.jsx)(xo.NodePropertyVariables,{data:e,nodeId:o,onPropertiesChange:p}),(0,z.jsx)(E.NodeTrackConnections,{handles:e.handles,nodeId:o,type:"target"})]})}var wo=Ho;var T=require("@awesome-flow/core/hooks"),vo=require("@awesome-flow/core/layout"),c=require("@mantine/core"),b=require("react"),C=require("react/jsx-runtime");function Jo({id:o,selected:a,data:e,type:s}){let t=e.position??{x:0,y:0,z:0},[p,r]=(0,b.useState)(t.x),[n,d]=(0,b.useState)(t.y),[h,m]=(0,b.useState)(t.z),x=(0,T.useUpdateNodeData)(),i=(0,T.useUpdateNodeComputedData)();return(0,b.useEffect)(()=>{let l={x:p,y:n,z:h};x(o,{position:l}),i(o,{positions:[l]})},[p,n,h]),(0,C.jsx)(vo.NodeContainer,{id:o,selected:a,data:e,type:s,children:(0,C.jsxs)(c.Stack,{children:[(0,C.jsxs)(c.Group,{children:["x: ",(0,C.jsx)(c.NumberInput,{size:"xs",w:100,value:p,onChange:l=>r(Number(l))})]}),(0,C.jsxs)(c.Group,{children:["y: ",(0,C.jsx)(c.NumberInput,{size:"xs",w:100,value:n,onChange:l=>d(Number(l))})]}),(0,C.jsxs)(c.Group,{children:["z: ",(0,C.jsx)(c.NumberInput,{size:"xs",w:100,value:h,onChange:l=>m(Number(l))})]})]})})}var zo=Jo;var O=require("@awesome-flow/core/hooks"),Go=require("@awesome-flow/core/layout"),N=require("@mantine/core"),y=require("react"),u=require("react/jsx-runtime");function Ko({id:o,selected:a,data:e,type:s}){let[t,p]=(0,y.useState)(e.center?.x),[r,n]=(0,y.useState)(e.center?.y),[d,h]=(0,y.useState)(e.center?.z),[m,x]=(0,y.useState)(e.radius),i=(0,O.useUpdateNodeData)(),l=(0,O.useUpdateNodeComputedData)();return(0,y.useEffect)(()=>{i(o,{center:{x:t,y:r,z:d}})},[t,r,d]),(0,y.useEffect)(()=>{i(o,{radius:m})},[m]),(0,y.useEffect)(()=>{let f=[];for(let F=-m;F<m;F++)for(let X=-m;X<m;X++)f.push({x:t+F,y:r+X,z:d});l(o,{positions:f})},[t,r,d,m]),(0,u.jsx)(Go.NodeContainer,{id:o,selected:a,data:e,type:s,children:(0,u.jsxs)(N.Stack,{children:[(0,u.jsxs)(N.Group,{children:["x: ",(0,u.jsx)(N.NumberInput,{size:"xs",w:100,value:t,onChange:f=>p(Number(f))})]}),(0,u.jsxs)(N.Group,{children:["y: ",(0,u.jsx)(N.NumberInput,{size:"xs",w:100,value:r,onChange:f=>n(Number(f))})]}),(0,u.jsxs)(N.Group,{children:["z: ",(0,u.jsx)(N.NumberInput,{size:"xs",w:100,value:d,onChange:f=>h(Number(f))})]}),(0,u.jsxs)(N.Group,{children:["r: ",(0,u.jsx)(N.NumberInput,{size:"xs",w:100,value:m,onChange:f=>x(Number(f))})]})]})})}var Io=Ko;0&&(module.exports={NoiseBillowNode,NoiseCheckerboardNode,NoiseConstNode,NoiseCylindersNode,NoisePerlinNode,NoiseRidgedMultiNode,NoiseSpheresNode,NoiseVoronoiNode,PositionConstNode,PositionGridNode});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+ var _chunkD5JM4EYQcjs = require('../../chunk-D5JM4EYQ.cjs');
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+ exports.NoiseBillowNode = _chunkD5JM4EYQcjs.noise_billow_node_default; exports.NoiseCheckerboardNode = _chunkD5JM4EYQcjs.noise_checkerboard_node_default; exports.NoiseConstNode = _chunkD5JM4EYQcjs.noise_const_node_default; exports.NoiseCylindersNode = _chunkD5JM4EYQcjs.noise_cylinders_node_default; exports.NoisePerlinNode = _chunkD5JM4EYQcjs.noise_perlin_node_default; exports.NoiseRidgedMultiNode = _chunkD5JM4EYQcjs.noise_ridgedmulti_node_default; exports.NoiseSpheresNode = _chunkD5JM4EYQcjs.noise_spheres_node_default; exports.NoiseVoronoiNode = _chunkD5JM4EYQcjs.noise_voronoi_node_default; exports.PositionConstNode = _chunkD5JM4EYQcjs.position_const_node_default; exports.PositionGridNode = _chunkD5JM4EYQcjs.position_grid_node_default;
@@ -1 +1,24 @@
1
- import{NodePropertyVariables as F}from"@awesome-flow/core/components";import{useUpdateNodeComputedData as X}from"@awesome-flow/core/hooks";import{NodeContainer as Y,NodeTrackConnections as Z}from"@awesome-flow/core/layout";import{Billow as q}from"libnoise-simplex-ts";import{useCallback as A}from"react";import{jsx as S,jsxs as K}from"react/jsx-runtime";function H({id:o,selected:s,data:e,type:p}){let r=X(),n=A(t=>{let d=new q;Object.keys(t).forEach(a=>d[a]=t[a].value),r(o,{module:d})},[o]);return K(Y,{id:o,selected:s,data:e,type:p,children:[S(F,{data:e,nodeId:o,onPropertiesChange:n}),S(Z,{handles:e.handles,nodeId:o,type:"target"})]})}var J=H;import{useUpdateNodeComputedData as L}from"@awesome-flow/core/hooks";import{NodeContainer as Q}from"@awesome-flow/core/layout";import{Checkerboard as W}from"libnoise-simplex-ts";import{useEffect as _}from"react";import{jsx as oo}from"react/jsx-runtime";function $({id:o,selected:s,data:e,type:p}){let r=L();return _(()=>{let n=new W;r(o,{module:n})},[o]),oo(Q,{id:o,selected:s,data:e,type:p})}var j=$;import{useUpdateNodeComputedData as eo,useUpdateNodeData as to}from"@awesome-flow/core/hooks";import{NodeContainer as ro}from"@awesome-flow/core/layout";import{Group as U,NumberInput as V,Stack as ao}from"@mantine/core";import{Const as no}from"libnoise-simplex-ts";import{useEffect as so,useState as k}from"react";import{jsx as D,jsxs as w}from"react/jsx-runtime";function po({id:o,selected:s,data:e,type:p}){let[r,n]=k(e.min),[t,d]=k(e.max),[a,l]=k(e.noise),m=to(),f=eo();return so(()=>{let i=new no(a);m(o,{noise:a,min:r,max:t}),f(o,{module:i})},[a,r,t]),D(ro,{id:o,selected:s,data:e,type:p,children:w(ao,{children:[w(U,{children:[D(V,{size:"xs",w:100,value:r,onChange:i=>n(Number(i))}),D(V,{size:"xs",w:100,value:t,onChange:i=>d(Number(i))})]}),w(U,{children:["noise:",D(V,{size:"xs",value:a,onChange:i=>l(Number(i)),max:t,min:r,step:.1})]})]})})}var mo=po;import{NodePropertyVariables as io}from"@awesome-flow/core/components";import{useUpdateNodeComputedData as uo}from"@awesome-flow/core/hooks";import{NodeContainer as No,NodeTrackConnections as lo}from"@awesome-flow/core/layout";import{Cylinders as fo}from"libnoise-simplex-ts";import{useCallback as Co}from"react";import{jsx as R,jsxs as Po}from"react/jsx-runtime";function co({id:o,selected:s,data:e,type:p}){let r=uo(),n=Co(t=>{let d=new fo;Object.keys(t).forEach(a=>d[a]=t[a].value),r(o,{module:d})},[o]);return Po(No,{id:o,selected:s,data:e,type:p,children:[R(io,{data:e,nodeId:o,onPropertiesChange:n}),R(lo,{handles:e.handles,nodeId:o,type:"target"})]})}var Do=co;import{NodePropertyVariables as yo}from"@awesome-flow/core/components";import{useUpdateNodeComputedData as ho}from"@awesome-flow/core/hooks";import{NodeContainer as go,NodeTrackConnections as bo}from"@awesome-flow/core/layout";import{Perlin as xo}from"libnoise-simplex-ts";import{useCallback as Mo}from"react";import{jsx as B,jsxs as wo}from"react/jsx-runtime";function Vo({id:o,selected:s,data:e,type:p}){let r=ho(),n=Mo(t=>{let d=new xo;Object.keys(t).forEach(a=>d[a]=t[a].value),r(o,{module:d})},[o,r]);return wo(go,{id:o,selected:s,data:e,type:p,children:[B(yo,{data:e,nodeId:o,onPropertiesChange:n}),B(bo,{handles:e.handles,nodeId:o,type:"target"})]})}var ko=Vo;import{NodePropertyVariables as vo}from"@awesome-flow/core/components";import{useUpdateNodeComputedData as zo}from"@awesome-flow/core/hooks";import{NodeContainer as Go,NodeTrackConnections as Io}from"@awesome-flow/core/layout";import{RidgedMulti as So}from"libnoise-simplex-ts";import{useCallback as Uo}from"react";import{jsx as E,jsxs as Eo}from"react/jsx-runtime";function Ro({id:o,selected:s,data:e,type:p}){let r=zo(),n=Uo(t=>{let d=new So;Object.keys(t).forEach(a=>d[a]=t[a].value),r(o,{module:d})},[]);return Eo(Go,{id:o,selected:s,data:e,type:p,children:[E(vo,{data:e,nodeId:o,onPropertiesChange:n}),E(Io,{handles:e.handles,nodeId:o,type:"target"})]})}var Bo=Ro;import{NodePropertyVariables as To}from"@awesome-flow/core/components";import{useUpdateNodeComputedData as Oo}from"@awesome-flow/core/hooks";import{NodeContainer as Fo,NodeTrackConnections as Xo}from"@awesome-flow/core/layout";import{Spheres as Yo}from"libnoise-simplex-ts";import{useCallback as Zo}from"react";import{jsx as T,jsxs as Ho}from"react/jsx-runtime";function qo({id:o,selected:s,data:e,type:p}){let r=Oo(),n=Zo(t=>{let d=new Yo;Object.keys(t).forEach(a=>d[a]=t[a].value),r(o,{module:d})},[]);return Ho(Fo,{id:o,selected:s,data:e,type:p,children:[T(To,{data:e,nodeId:o,onPropertiesChange:n}),T(Xo,{handles:e.handles,nodeId:o,type:"target"})]})}var Ao=qo;import{NodePropertyVariables as Jo}from"@awesome-flow/core/components";import{useUpdateNodeComputedData as Ko}from"@awesome-flow/core/hooks";import{NodeContainer as Lo,NodeTrackConnections as Qo}from"@awesome-flow/core/layout";import{Voronoi as Wo}from"libnoise-simplex-ts";import{useCallback as _o}from"react";import{jsx as O,jsxs as oe}from"react/jsx-runtime";function $o({id:o,selected:s,data:e,type:p}){let r=Ko(),n=_o(t=>{let d=new Wo(t.frequency.value,t.displacement.value,t.distance.value,t.seed.value);r(o,{module:d})},[]);return oe(Lo,{id:o,selected:s,data:e,type:p,children:[O(Jo,{data:e,nodeId:o,onPropertiesChange:n}),O(Qo,{handles:e.handles,nodeId:o,type:"target"})]})}var jo=$o;import{useUpdateNodeComputedData as ee,useUpdateNodeData as te}from"@awesome-flow/core/hooks";import{NodeContainer as re}from"@awesome-flow/core/layout";import{Group as v,NumberInput as z,Stack as ae}from"@mantine/core";import{useEffect as de,useState as G}from"react";import{jsx as P,jsxs as y}from"react/jsx-runtime";function ne({id:o,selected:s,data:e,type:p}){let r=e.position??{x:0,y:0,z:0},[n,t]=G(r.x),[d,a]=G(r.y),[l,m]=G(r.z),f=te(),i=ee();return de(()=>{let u={x:n,y:d,z:l};f(o,{position:u}),i(o,{positions:[u]})},[n,d,l]),P(re,{id:o,selected:s,data:e,type:p,children:y(ae,{children:[y(v,{children:["x: ",P(z,{size:"xs",w:100,value:n,onChange:u=>t(Number(u))})]}),y(v,{children:["y: ",P(z,{size:"xs",w:100,value:d,onChange:u=>a(Number(u))})]}),y(v,{children:["z: ",P(z,{size:"xs",w:100,value:l,onChange:u=>m(Number(u))})]})]})})}var se=ne;import{useUpdateNodeComputedData as pe,useUpdateNodeData as me}from"@awesome-flow/core/hooks";import{NodeContainer as ie}from"@awesome-flow/core/layout";import{Group as h,NumberInput as g,Stack as ue}from"@mantine/core";import{useEffect as I,useState as b}from"react";import{jsx as C,jsxs as c}from"react/jsx-runtime";function Ne({id:o,selected:s,data:e,type:p}){let[r,n]=b(e.center?.x),[t,d]=b(e.center?.y),[a,l]=b(e.center?.z),[m,f]=b(e.radius),i=me(),u=pe();return I(()=>{i(o,{center:{x:r,y:t,z:a}})},[r,t,a]),I(()=>{i(o,{radius:m})},[m]),I(()=>{let N=[];for(let x=-m;x<m;x++)for(let M=-m;M<m;M++)N.push({x:r+x,y:t+M,z:a});u(o,{positions:N})},[r,t,a,m]),C(ie,{id:o,selected:s,data:e,type:p,children:c(ue,{children:[c(h,{children:["x: ",C(g,{size:"xs",w:100,value:r,onChange:N=>n(Number(N))})]}),c(h,{children:["y: ",C(g,{size:"xs",w:100,value:t,onChange:N=>d(Number(N))})]}),c(h,{children:["z: ",C(g,{size:"xs",w:100,value:a,onChange:N=>l(Number(N))})]}),c(h,{children:["r: ",C(g,{size:"xs",w:100,value:m,onChange:N=>f(Number(N))})]})]})})}var le=Ne;export{J as NoiseBillowNode,j as NoiseCheckerboardNode,mo as NoiseConstNode,Do as NoiseCylindersNode,ko as NoisePerlinNode,Bo as NoiseRidgedMultiNode,Ao as NoiseSpheresNode,jo as NoiseVoronoiNode,se as PositionConstNode,le as PositionGridNode};
1
+ import {
2
+ noise_billow_node_default,
3
+ noise_checkerboard_node_default,
4
+ noise_const_node_default,
5
+ noise_cylinders_node_default,
6
+ noise_perlin_node_default,
7
+ noise_ridgedmulti_node_default,
8
+ noise_spheres_node_default,
9
+ noise_voronoi_node_default,
10
+ position_const_node_default,
11
+ position_grid_node_default
12
+ } from "../../chunk-DWSACR65.js";
13
+ export {
14
+ noise_billow_node_default as NoiseBillowNode,
15
+ noise_checkerboard_node_default as NoiseCheckerboardNode,
16
+ noise_const_node_default as NoiseConstNode,
17
+ noise_cylinders_node_default as NoiseCylindersNode,
18
+ noise_perlin_node_default as NoisePerlinNode,
19
+ noise_ridgedmulti_node_default as NoiseRidgedMultiNode,
20
+ noise_spheres_node_default as NoiseSpheresNode,
21
+ noise_voronoi_node_default as NoiseVoronoiNode,
22
+ position_const_node_default as PositionConstNode,
23
+ position_grid_node_default as PositionGridNode
24
+ };
@@ -1 +1,6 @@
1
- var c=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var x=(e,o)=>{for(var t in o)c(e,t,{get:o[t],enumerable:!0})},B=(e,o,t,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of y(o))!b.call(e,a)&&a!==t&&c(e,a,{get:()=>o[a],enumerable:!(u=S(o,a))||u.enumerable});return e};var k=e=>B(c({},"__esModule",{value:!0}),e);var P={};x(P,{ModuleGroupNode:()=>h});module.exports=k(P);var d=require("@awesome-flow/core/hooks"),i=require("@awesome-flow/core/layout"),p=require("@mantine/core"),l=require("@xyflow/react"),r=require("react"),N=require("zustand/shallow"),n=require("react/jsx-runtime");function v({id:e,selected:o,data:t,type:u,width:a,height:f}){let D=(0,l.useUpdateNodeInternals)(),G=(0,l.useStore)(s=>s.triggerNodeChanges),{groupNodes:I,setGroupCollapsed:M}=(0,d.useFlowStore)((0,r.useCallback)(s=>({groupNodes:s.groups[e],setGroupCollapsed:s.setGroupCollapsed}),[])),g=(0,d.useInteractiveStore)((0,r.useCallback)(s=>s.nodeIntersectionTargets[e],[e]),N.shallow);(0,r.useEffect)(()=>{D(e)},[a,f]),(0,r.useEffect)(()=>{G([{id:e,type:"select",selected:!!g}])},[g]);let w=(0,r.useCallback)(s=>{M(e,s)},[]),C=(0,r.useMemo)(()=>({width:t.initialSize?.width||100,height:t.initialSize?.height||50}),[t.initialSize]),m=(0,d.useIncomingComputedData)(e),z=(0,d.useUpdateNodeComputedData)();return(0,r.useEffect)(()=>{if(m?.length){let{module:s}=m[0];z(e,{module:s})}},[m]),(0,n.jsxs)(i.NodeContainer,{id:e,selected:o,data:t,title:(0,n.jsx)(p.Group,{justify:"space-between",children:(0,n.jsxs)(p.Group,{gap:"xs",children:[(0,n.jsx)(p.Badge,{size:"xs",variant:"outline",radius:"xs",color:"gray",children:I?.length||0}),(0,n.jsx)(i.NodeCollapse,{nodeId:e,isCollapsed:t.isCollapsed,onCollapsed:w})]})}),type:u,children:[(0,n.jsx)(l.NodeResizer,{nodeId:e,minWidth:C.width,minHeight:C.height,isVisible:o&&!t.isCollapsed}),(0,n.jsx)(i.NodeTrackConnections,{handles:t.handles,nodeId:e,type:"target"})]})}var h=v;0&&(module.exports={ModuleGroupNode});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkM67JHEU2cjs = require('../../chunk-M67JHEU2.cjs');
4
+
5
+
6
+ exports.ModuleGroupNode = _chunkM67JHEU2cjs.module_group_node_default;