@awesome-flow/noise 0.6.0 → 0.7.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.
- package/dist/abstract/index.cjs +663 -734
- package/dist/abstract/index.d.cts +6 -12
- package/dist/abstract/index.d.ts +6 -12
- package/dist/abstract/index.js +449 -522
- package/dist/{index-BungWYrh.d.cts → index-CfiOpOzX.d.cts} +1 -1
- package/dist/{index-DsQSjZC5.d.ts → index-mlK0X4O1.d.ts} +1 -1
- package/dist/modules/index.cjs +4 -30
- package/dist/modules/index.d.cts +2 -10
- package/dist/modules/index.d.ts +2 -10
- package/dist/modules/index.js +2 -17
- package/dist/{node-props-BbqbXDXn.d.cts → node-props-CAV2WNDN.d.cts} +3 -7
- package/dist/{node-props-BbqbXDXn.d.ts → node-props-CAV2WNDN.d.ts} +3 -7
- package/dist/nodes/generators/index.cjs +71 -114
- package/dist/nodes/generators/index.d.cts +3 -8
- package/dist/nodes/generators/index.d.ts +3 -8
- package/dist/nodes/generators/index.js +47 -79
- package/dist/nodes/index.cjs +604 -675
- package/dist/nodes/index.d.cts +3 -6
- package/dist/nodes/index.d.ts +3 -6
- package/dist/nodes/index.js +394 -466
- package/dist/nodes/modifiers/index.cjs +37 -52
- package/dist/nodes/modifiers/index.d.cts +2 -5
- package/dist/nodes/modifiers/index.d.ts +2 -5
- package/dist/nodes/modifiers/index.js +23 -38
- package/dist/nodes/output/index.cjs +239 -285
- package/dist/nodes/output/index.js +252 -290
- package/dist/nodes/selectors/index.cjs +230 -280
- package/dist/nodes/selectors/index.d.cts +2 -5
- package/dist/nodes/selectors/index.d.ts +2 -5
- package/dist/nodes/selectors/index.js +248 -290
- package/dist/nodes/transformers/index.cjs +10 -10
- package/dist/nodes/transformers/index.d.cts +2 -5
- package/dist/nodes/transformers/index.d.ts +2 -5
- package/dist/nodes/transformers/index.js +5 -5
- package/dist/templates/generators/index.cjs +201 -253
- package/dist/templates/generators/index.d.cts +3 -10
- package/dist/templates/generators/index.d.ts +3 -10
- package/dist/templates/generators/index.js +236 -279
- package/dist/templates/groups/index.cjs +201 -251
- package/dist/templates/groups/index.js +236 -278
- package/dist/templates/index.cjs +201 -253
- package/dist/templates/index.d.cts +4 -7
- package/dist/templates/index.d.ts +4 -7
- package/dist/templates/index.js +236 -279
- package/dist/templates/modifiers/index.cjs +201 -251
- package/dist/templates/modifiers/index.d.cts +2 -5
- package/dist/templates/modifiers/index.d.ts +2 -5
- package/dist/templates/modifiers/index.js +236 -278
- package/dist/templates/output/index.cjs +201 -251
- package/dist/templates/output/index.js +236 -278
- package/dist/templates/selectors/index.cjs +201 -251
- package/dist/templates/selectors/index.d.cts +2 -5
- package/dist/templates/selectors/index.d.ts +2 -5
- package/dist/templates/selectors/index.js +236 -278
- package/dist/templates/transformers/index.cjs +201 -251
- package/dist/templates/transformers/index.d.cts +3 -6
- package/dist/templates/transformers/index.d.ts +3 -6
- package/dist/templates/transformers/index.js +236 -278
- package/package.json +6 -4
package/dist/nodes/index.cjs
CHANGED
|
@@ -34,38 +34,28 @@ var require_fast_deep_equal = __commonJS({
|
|
|
34
34
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports2, module2) {
|
|
35
35
|
"use strict";
|
|
36
36
|
module2.exports = function equal(a, b) {
|
|
37
|
-
if (a === b)
|
|
38
|
-
return true;
|
|
37
|
+
if (a === b) return true;
|
|
39
38
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
40
|
-
if (a.constructor !== b.constructor)
|
|
41
|
-
return false;
|
|
39
|
+
if (a.constructor !== b.constructor) return false;
|
|
42
40
|
var length, i, keys;
|
|
43
41
|
if (Array.isArray(a)) {
|
|
44
42
|
length = a.length;
|
|
45
|
-
if (length != b.length)
|
|
46
|
-
return false;
|
|
43
|
+
if (length != b.length) return false;
|
|
47
44
|
for (i = length; i-- !== 0; )
|
|
48
|
-
if (!equal(a[i], b[i]))
|
|
49
|
-
return false;
|
|
45
|
+
if (!equal(a[i], b[i])) return false;
|
|
50
46
|
return true;
|
|
51
47
|
}
|
|
52
|
-
if (a.constructor === RegExp)
|
|
53
|
-
|
|
54
|
-
if (a.
|
|
55
|
-
return a.valueOf() === b.valueOf();
|
|
56
|
-
if (a.toString !== Object.prototype.toString)
|
|
57
|
-
return a.toString() === b.toString();
|
|
48
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
49
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
50
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
58
51
|
keys = Object.keys(a);
|
|
59
52
|
length = keys.length;
|
|
60
|
-
if (length !== Object.keys(b).length)
|
|
61
|
-
return false;
|
|
53
|
+
if (length !== Object.keys(b).length) return false;
|
|
62
54
|
for (i = length; i-- !== 0; )
|
|
63
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
64
|
-
return false;
|
|
55
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
65
56
|
for (i = length; i-- !== 0; ) {
|
|
66
57
|
var key = keys[i];
|
|
67
|
-
if (!equal(a[key], b[key]))
|
|
68
|
-
return false;
|
|
58
|
+
if (!equal(a[key], b[key])) return false;
|
|
69
59
|
}
|
|
70
60
|
return true;
|
|
71
61
|
}
|
|
@@ -100,7 +90,6 @@ __export(nodes_exports, {
|
|
|
100
90
|
NoiseScaleBiasNode: () => noise_scale_bias_node_default,
|
|
101
91
|
NoiseScalePointNode: () => noise_scale_point_node_default,
|
|
102
92
|
NoiseSelectNode: () => noise_select_node_default,
|
|
103
|
-
NoiseSimplexNode: () => noise_simplex_node_default,
|
|
104
93
|
NoiseSpheresNode: () => noise_spheres_node_default,
|
|
105
94
|
NoiseTerraceNode: () => noise_terrace_node_default,
|
|
106
95
|
NoiseTranslatePointNode: () => noise_translate_point_node_default,
|
|
@@ -115,13 +104,13 @@ module.exports = __toCommonJS(nodes_exports);
|
|
|
115
104
|
// src/nodes/generators/noise-billow-node.tsx
|
|
116
105
|
var import_layout = require("@awesome-flow/core/layout");
|
|
117
106
|
var import_react = require("react");
|
|
118
|
-
var
|
|
107
|
+
var import_libnoise_simplex_ts = require("libnoise-simplex-ts");
|
|
119
108
|
var import_hooks = require("@awesome-flow/core/hooks");
|
|
120
109
|
var import_components = require("@awesome-flow/core/components");
|
|
121
110
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
122
111
|
function NoiseBillowNode({ id, selected, data, type }) {
|
|
123
112
|
const updateComputedData = (0, import_hooks.useUpdateNodeComputedData)();
|
|
124
|
-
const module2 = (0, import_react.useMemo)(() => new
|
|
113
|
+
const module2 = (0, import_react.useMemo)(() => new import_libnoise_simplex_ts.Billow(), []);
|
|
125
114
|
const onPropertiesChange = (0, import_react.useCallback)(
|
|
126
115
|
(properties) => {
|
|
127
116
|
Object.keys(properties).forEach((k) => {
|
|
@@ -141,12 +130,12 @@ var noise_billow_node_default = NoiseBillowNode;
|
|
|
141
130
|
// src/nodes/generators/noise-checkerboard-node.tsx
|
|
142
131
|
var import_layout2 = require("@awesome-flow/core/layout");
|
|
143
132
|
var import_react2 = require("react");
|
|
144
|
-
var
|
|
133
|
+
var import_libnoise_simplex_ts2 = require("libnoise-simplex-ts");
|
|
145
134
|
var import_hooks2 = require("@awesome-flow/core/hooks");
|
|
146
135
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
147
136
|
function NoiseCheckerboardNode({ id, selected, data, type }) {
|
|
148
137
|
const updateComputedData = (0, import_hooks2.useUpdateNodeComputedData)();
|
|
149
|
-
const module2 = (0, import_react2.useMemo)(() => new
|
|
138
|
+
const module2 = (0, import_react2.useMemo)(() => new import_libnoise_simplex_ts2.Checkerboard(), []);
|
|
150
139
|
(0, import_react2.useEffect)(() => {
|
|
151
140
|
updateComputedData(id, { module: module2 });
|
|
152
141
|
}, [id, module2, updateComputedData]);
|
|
@@ -159,7 +148,7 @@ var import_layout3 = require("@awesome-flow/core/layout");
|
|
|
159
148
|
var import_react3 = require("react");
|
|
160
149
|
var import_core = require("@mantine/core");
|
|
161
150
|
var import_hooks3 = require("@awesome-flow/core/hooks");
|
|
162
|
-
var
|
|
151
|
+
var import_libnoise_simplex_ts3 = require("libnoise-simplex-ts");
|
|
163
152
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
164
153
|
function NoiseConstNode({ id, selected, data, type }) {
|
|
165
154
|
const [min, setMin] = (0, import_react3.useState)(data.min);
|
|
@@ -167,7 +156,7 @@ function NoiseConstNode({ id, selected, data, type }) {
|
|
|
167
156
|
const [noise, setNoise] = (0, import_react3.useState)(data.noise);
|
|
168
157
|
const updateNodeData = (0, import_hooks3.useUpdateNodeData)();
|
|
169
158
|
const updateComputedData = (0, import_hooks3.useUpdateNodeComputedData)();
|
|
170
|
-
const module2 = (0, import_react3.useMemo)(() => new
|
|
159
|
+
const module2 = (0, import_react3.useMemo)(() => new import_libnoise_simplex_ts3.Const(), []);
|
|
171
160
|
(0, import_react3.useEffect)(() => {
|
|
172
161
|
module2.value = noise;
|
|
173
162
|
updateNodeData(id, { noise, min, max });
|
|
@@ -199,13 +188,13 @@ var noise_const_node_default = NoiseConstNode;
|
|
|
199
188
|
// src/nodes/generators/noise-cylinders-node.tsx
|
|
200
189
|
var import_layout4 = require("@awesome-flow/core/layout");
|
|
201
190
|
var import_react4 = require("react");
|
|
202
|
-
var
|
|
191
|
+
var import_libnoise_simplex_ts4 = require("libnoise-simplex-ts");
|
|
203
192
|
var import_hooks4 = require("@awesome-flow/core/hooks");
|
|
204
193
|
var import_components2 = require("@awesome-flow/core/components");
|
|
205
194
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
206
195
|
function NoiseCylindersNode({ id, selected, data, type }) {
|
|
207
196
|
const updateComputedData = (0, import_hooks4.useUpdateNodeComputedData)();
|
|
208
|
-
const module2 = (0, import_react4.useMemo)(() => new
|
|
197
|
+
const module2 = (0, import_react4.useMemo)(() => new import_libnoise_simplex_ts4.Cylinders(), []);
|
|
209
198
|
const onPropertiesChange = (0, import_react4.useCallback)(
|
|
210
199
|
(properties) => {
|
|
211
200
|
Object.keys(properties).forEach((k) => {
|
|
@@ -225,13 +214,13 @@ var noise_cylinders_node_default = NoiseCylindersNode;
|
|
|
225
214
|
// src/nodes/generators/noise-perlin-node.tsx
|
|
226
215
|
var import_layout5 = require("@awesome-flow/core/layout");
|
|
227
216
|
var import_react5 = require("react");
|
|
228
|
-
var
|
|
217
|
+
var import_libnoise_simplex_ts5 = require("libnoise-simplex-ts");
|
|
229
218
|
var import_hooks5 = require("@awesome-flow/core/hooks");
|
|
230
219
|
var import_components3 = require("@awesome-flow/core/components");
|
|
231
220
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
232
221
|
function NoisePerlinNode({ id, selected, data, type }) {
|
|
233
222
|
const updateComputedData = (0, import_hooks5.useUpdateNodeComputedData)();
|
|
234
|
-
const module2 = (0, import_react5.useMemo)(() => new
|
|
223
|
+
const module2 = (0, import_react5.useMemo)(() => new import_libnoise_simplex_ts5.Perlin(), []);
|
|
235
224
|
const onPropertiesChange = (0, import_react5.useCallback)(
|
|
236
225
|
(properties) => {
|
|
237
226
|
Object.keys(properties).forEach((k) => {
|
|
@@ -251,13 +240,13 @@ var noise_perlin_node_default = NoisePerlinNode;
|
|
|
251
240
|
// src/nodes/generators/noise-ridgedmulti-node.tsx
|
|
252
241
|
var import_layout6 = require("@awesome-flow/core/layout");
|
|
253
242
|
var import_react6 = require("react");
|
|
254
|
-
var
|
|
243
|
+
var import_libnoise_simplex_ts6 = require("libnoise-simplex-ts");
|
|
255
244
|
var import_hooks6 = require("@awesome-flow/core/hooks");
|
|
256
245
|
var import_components4 = require("@awesome-flow/core/components");
|
|
257
246
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
258
247
|
function NoiseRidgedMultiNode({ id, selected, data, type }) {
|
|
259
248
|
const updateComputedData = (0, import_hooks6.useUpdateNodeComputedData)();
|
|
260
|
-
const module2 = (0, import_react6.useMemo)(() => new
|
|
249
|
+
const module2 = (0, import_react6.useMemo)(() => new import_libnoise_simplex_ts6.RidgedMulti(), []);
|
|
261
250
|
const onPropertiesChange = (0, import_react6.useCallback)((properties) => {
|
|
262
251
|
Object.keys(properties).forEach((k) => module2[k] = properties[k].value);
|
|
263
252
|
updateComputedData(id, { module: module2 });
|
|
@@ -269,70 +258,39 @@ function NoiseRidgedMultiNode({ id, selected, data, type }) {
|
|
|
269
258
|
}
|
|
270
259
|
var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
|
|
271
260
|
|
|
272
|
-
// src/nodes/generators/noise-
|
|
261
|
+
// src/nodes/generators/noise-spheres-node.tsx
|
|
273
262
|
var import_layout7 = require("@awesome-flow/core/layout");
|
|
274
263
|
var import_react7 = require("react");
|
|
264
|
+
var import_libnoise_simplex_ts7 = require("libnoise-simplex-ts");
|
|
275
265
|
var import_hooks7 = require("@awesome-flow/core/hooks");
|
|
276
|
-
|
|
277
|
-
// src/modules/simplex-module.ts
|
|
278
|
-
var import_Module = __toESM(require("libnoise-ts/module/Module"), 1);
|
|
279
|
-
var import_simplex_noise = require("simplex-noise");
|
|
280
|
-
var SimplexModule = class extends import_Module.default {
|
|
281
|
-
noise;
|
|
282
|
-
constructor(random) {
|
|
283
|
-
super();
|
|
284
|
-
this.noise = (0, import_simplex_noise.createNoise3D)(random);
|
|
285
|
-
}
|
|
286
|
-
getValue(x, y, z) {
|
|
287
|
-
return this.noise(x, y, z);
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// src/nodes/generators/noise-simplex-node.tsx
|
|
292
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
293
|
-
function NoiseSimplexNode({ id, selected, data, type }) {
|
|
294
|
-
const updateComputedData = (0, import_hooks7.useUpdateNodeComputedData)();
|
|
295
|
-
const module2 = (0, import_react7.useMemo)(() => new SimplexModule(), []);
|
|
296
|
-
(0, import_react7.useEffect)(() => {
|
|
297
|
-
updateComputedData(id, { module: module2 });
|
|
298
|
-
}, []);
|
|
299
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_layout7.NodeContainer, { id, selected, data, type });
|
|
300
|
-
}
|
|
301
|
-
var noise_simplex_node_default = NoiseSimplexNode;
|
|
302
|
-
|
|
303
|
-
// src/nodes/generators/noise-spheres-node.tsx
|
|
304
|
-
var import_layout8 = require("@awesome-flow/core/layout");
|
|
305
|
-
var import_react8 = require("react");
|
|
306
|
-
var import_generator7 = require("libnoise-ts/module/generator");
|
|
307
|
-
var import_hooks8 = require("@awesome-flow/core/hooks");
|
|
308
266
|
var import_components5 = require("@awesome-flow/core/components");
|
|
309
|
-
var
|
|
267
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
310
268
|
function NoiseSpheresNode({ id, selected, data, type }) {
|
|
311
|
-
const updateComputedData = (0,
|
|
312
|
-
const module2 = (0,
|
|
313
|
-
const onPropertiesChange = (0,
|
|
269
|
+
const updateComputedData = (0, import_hooks7.useUpdateNodeComputedData)();
|
|
270
|
+
const module2 = (0, import_react7.useMemo)(() => new import_libnoise_simplex_ts7.Spheres(), []);
|
|
271
|
+
const onPropertiesChange = (0, import_react7.useCallback)((properties) => {
|
|
314
272
|
Object.keys(properties).forEach((k) => module2[k] = properties[k].value);
|
|
315
273
|
updateComputedData(id, { module: module2 });
|
|
316
274
|
}, []);
|
|
317
|
-
return /* @__PURE__ */ (0,
|
|
318
|
-
/* @__PURE__ */ (0,
|
|
319
|
-
/* @__PURE__ */ (0,
|
|
275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_layout7.NodeContainer, { id, selected, data, type, children: [
|
|
276
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components5.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
277
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_layout7.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
320
278
|
] });
|
|
321
279
|
}
|
|
322
280
|
var noise_spheres_node_default = NoiseSpheresNode;
|
|
323
281
|
|
|
324
282
|
// src/nodes/generators/noise-voronoi-node.tsx
|
|
325
|
-
var
|
|
326
|
-
var
|
|
327
|
-
var
|
|
328
|
-
var
|
|
283
|
+
var import_layout8 = require("@awesome-flow/core/layout");
|
|
284
|
+
var import_react8 = require("react");
|
|
285
|
+
var import_libnoise_simplex_ts8 = require("libnoise-simplex-ts");
|
|
286
|
+
var import_hooks8 = require("@awesome-flow/core/hooks");
|
|
329
287
|
var import_components6 = require("@awesome-flow/core/components");
|
|
330
|
-
var
|
|
288
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
331
289
|
function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
332
|
-
const updateComputedData = (0,
|
|
333
|
-
const onPropertiesChange = (0,
|
|
290
|
+
const updateComputedData = (0, import_hooks8.useUpdateNodeComputedData)();
|
|
291
|
+
const onPropertiesChange = (0, import_react8.useCallback)(
|
|
334
292
|
(properties) => {
|
|
335
|
-
const module2 = new
|
|
293
|
+
const module2 = new import_libnoise_simplex_ts8.Voronoi(
|
|
336
294
|
properties.frequency.value,
|
|
337
295
|
properties.displacement.value,
|
|
338
296
|
properties.distance.value,
|
|
@@ -342,27 +300,27 @@ function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
|
342
300
|
},
|
|
343
301
|
[]
|
|
344
302
|
);
|
|
345
|
-
return /* @__PURE__ */ (0,
|
|
346
|
-
/* @__PURE__ */ (0,
|
|
347
|
-
/* @__PURE__ */ (0,
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_layout8.NodeContainer, { id, selected, data, type, children: [
|
|
304
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components6.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_layout8.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
348
306
|
] });
|
|
349
307
|
}
|
|
350
308
|
var noise_voronoi_node_default = NoiseVoronoiNode;
|
|
351
309
|
|
|
352
310
|
// src/nodes/generators/position-const-node.tsx
|
|
353
|
-
var
|
|
354
|
-
var
|
|
311
|
+
var import_layout9 = require("@awesome-flow/core/layout");
|
|
312
|
+
var import_react9 = require("react");
|
|
355
313
|
var import_core2 = require("@mantine/core");
|
|
356
|
-
var
|
|
357
|
-
var
|
|
314
|
+
var import_hooks9 = require("@awesome-flow/core/hooks");
|
|
315
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
358
316
|
function PositionConstNode({ id, selected, data, type }) {
|
|
359
317
|
const position = data.position ?? { x: 0, y: 0, z: 0 };
|
|
360
|
-
const [x, setX] = (0,
|
|
361
|
-
const [y, setY] = (0,
|
|
362
|
-
const [z, setZ] = (0,
|
|
363
|
-
const updateNodeData = (0,
|
|
364
|
-
const updateComputedData = (0,
|
|
365
|
-
(0,
|
|
318
|
+
const [x, setX] = (0, import_react9.useState)(position.x);
|
|
319
|
+
const [y, setY] = (0, import_react9.useState)(position.y);
|
|
320
|
+
const [z, setZ] = (0, import_react9.useState)(position.z);
|
|
321
|
+
const updateNodeData = (0, import_hooks9.useUpdateNodeData)();
|
|
322
|
+
const updateComputedData = (0, import_hooks9.useUpdateNodeComputedData)();
|
|
323
|
+
(0, import_react9.useEffect)(() => {
|
|
366
324
|
const position2 = { x, y, z };
|
|
367
325
|
updateNodeData(id, {
|
|
368
326
|
position: position2
|
|
@@ -371,47 +329,47 @@ function PositionConstNode({ id, selected, data, type }) {
|
|
|
371
329
|
positions: [position2]
|
|
372
330
|
});
|
|
373
331
|
}, [x, y, z]);
|
|
374
|
-
return /* @__PURE__ */ (0,
|
|
375
|
-
/* @__PURE__ */ (0,
|
|
332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_layout9.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core2.Stack, { children: [
|
|
333
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core2.Group, { children: [
|
|
376
334
|
"x: ",
|
|
377
|
-
/* @__PURE__ */ (0,
|
|
335
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
378
336
|
] }),
|
|
379
|
-
/* @__PURE__ */ (0,
|
|
337
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core2.Group, { children: [
|
|
380
338
|
"y: ",
|
|
381
|
-
/* @__PURE__ */ (0,
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
382
340
|
] }),
|
|
383
|
-
/* @__PURE__ */ (0,
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core2.Group, { children: [
|
|
384
342
|
"z: ",
|
|
385
|
-
/* @__PURE__ */ (0,
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
386
344
|
] })
|
|
387
345
|
] }) });
|
|
388
346
|
}
|
|
389
347
|
var position_const_node_default = PositionConstNode;
|
|
390
348
|
|
|
391
349
|
// src/nodes/generators/position-grid-node.tsx
|
|
392
|
-
var
|
|
393
|
-
var
|
|
350
|
+
var import_layout10 = require("@awesome-flow/core/layout");
|
|
351
|
+
var import_react10 = require("react");
|
|
394
352
|
var import_core3 = require("@mantine/core");
|
|
395
|
-
var
|
|
396
|
-
var
|
|
353
|
+
var import_hooks10 = require("@awesome-flow/core/hooks");
|
|
354
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
397
355
|
function PositionGridNode({ id, selected, data, type }) {
|
|
398
|
-
const [x, setX] = (0,
|
|
399
|
-
const [y, setY] = (0,
|
|
400
|
-
const [z, setZ] = (0,
|
|
401
|
-
const [radius, setRadius] = (0,
|
|
402
|
-
const updateNodeData = (0,
|
|
403
|
-
const updateComputedData = (0,
|
|
404
|
-
(0,
|
|
356
|
+
const [x, setX] = (0, import_react10.useState)(data.center?.x);
|
|
357
|
+
const [y, setY] = (0, import_react10.useState)(data.center?.y);
|
|
358
|
+
const [z, setZ] = (0, import_react10.useState)(data.center?.z);
|
|
359
|
+
const [radius, setRadius] = (0, import_react10.useState)(data.radius);
|
|
360
|
+
const updateNodeData = (0, import_hooks10.useUpdateNodeData)();
|
|
361
|
+
const updateComputedData = (0, import_hooks10.useUpdateNodeComputedData)();
|
|
362
|
+
(0, import_react10.useEffect)(() => {
|
|
405
363
|
updateNodeData(id, {
|
|
406
364
|
center: { x, y, z }
|
|
407
365
|
});
|
|
408
366
|
}, [x, y, z]);
|
|
409
|
-
(0,
|
|
367
|
+
(0, import_react10.useEffect)(() => {
|
|
410
368
|
updateNodeData(id, {
|
|
411
369
|
radius
|
|
412
370
|
});
|
|
413
371
|
}, [radius]);
|
|
414
|
-
(0,
|
|
372
|
+
(0, import_react10.useEffect)(() => {
|
|
415
373
|
const positions = [];
|
|
416
374
|
for (let i = -radius; i < radius; i++) {
|
|
417
375
|
for (let j = -radius; j < radius; j++) {
|
|
@@ -422,35 +380,35 @@ function PositionGridNode({ id, selected, data, type }) {
|
|
|
422
380
|
positions
|
|
423
381
|
});
|
|
424
382
|
}, [x, y, z, radius]);
|
|
425
|
-
return /* @__PURE__ */ (0,
|
|
426
|
-
/* @__PURE__ */ (0,
|
|
383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_layout10.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core3.Stack, { children: [
|
|
384
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core3.Group, { children: [
|
|
427
385
|
"x: ",
|
|
428
|
-
/* @__PURE__ */ (0,
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
429
387
|
] }),
|
|
430
|
-
/* @__PURE__ */ (0,
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core3.Group, { children: [
|
|
431
389
|
"y: ",
|
|
432
|
-
/* @__PURE__ */ (0,
|
|
390
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
433
391
|
] }),
|
|
434
|
-
/* @__PURE__ */ (0,
|
|
392
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core3.Group, { children: [
|
|
435
393
|
"z: ",
|
|
436
|
-
/* @__PURE__ */ (0,
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
437
395
|
] }),
|
|
438
|
-
/* @__PURE__ */ (0,
|
|
396
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core3.Group, { children: [
|
|
439
397
|
"r: ",
|
|
440
|
-
/* @__PURE__ */ (0,
|
|
398
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: radius, onChange: (e) => setRadius(Number(e)) })
|
|
441
399
|
] })
|
|
442
400
|
] }) });
|
|
443
401
|
}
|
|
444
402
|
var position_grid_node_default = PositionGridNode;
|
|
445
403
|
|
|
446
404
|
// src/nodes/groups/module-group-node.tsx
|
|
447
|
-
var
|
|
448
|
-
var
|
|
449
|
-
var
|
|
405
|
+
var import_layout11 = require("@awesome-flow/core/layout");
|
|
406
|
+
var import_react11 = require("@xyflow/react");
|
|
407
|
+
var import_react12 = require("react");
|
|
450
408
|
var import_shallow = require("zustand/shallow");
|
|
451
409
|
var import_core4 = require("@mantine/core");
|
|
452
|
-
var
|
|
453
|
-
var
|
|
410
|
+
var import_hooks11 = require("@awesome-flow/core/hooks");
|
|
411
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
454
412
|
function ModuleGroupNode({
|
|
455
413
|
id,
|
|
456
414
|
selected,
|
|
@@ -459,22 +417,22 @@ function ModuleGroupNode({
|
|
|
459
417
|
width,
|
|
460
418
|
height
|
|
461
419
|
}) {
|
|
462
|
-
const updateNodeInternals = (0,
|
|
463
|
-
const triggerNodeChanges = (0,
|
|
464
|
-
const { groupNodes, setGroupCollapsed } = (0,
|
|
465
|
-
(0,
|
|
420
|
+
const updateNodeInternals = (0, import_react11.useUpdateNodeInternals)();
|
|
421
|
+
const triggerNodeChanges = (0, import_react11.useStore)((s) => s.triggerNodeChanges);
|
|
422
|
+
const { groupNodes, setGroupCollapsed } = (0, import_hooks11.useFlowStore)(
|
|
423
|
+
(0, import_react12.useCallback)(
|
|
466
424
|
(state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
|
|
467
425
|
[]
|
|
468
426
|
)
|
|
469
427
|
);
|
|
470
|
-
const intersectingNode = (0,
|
|
471
|
-
(0,
|
|
428
|
+
const intersectingNode = (0, import_hooks11.useInteractiveStore)(
|
|
429
|
+
(0, import_react12.useCallback)((state) => state.nodeIntersectionTargets[id], [id]),
|
|
472
430
|
import_shallow.shallow
|
|
473
431
|
);
|
|
474
|
-
(0,
|
|
432
|
+
(0, import_react12.useEffect)(() => {
|
|
475
433
|
updateNodeInternals(id);
|
|
476
434
|
}, [width, height]);
|
|
477
|
-
(0,
|
|
435
|
+
(0, import_react12.useEffect)(() => {
|
|
478
436
|
triggerNodeChanges([
|
|
479
437
|
{
|
|
480
438
|
id,
|
|
@@ -483,37 +441,37 @@ function ModuleGroupNode({
|
|
|
483
441
|
}
|
|
484
442
|
]);
|
|
485
443
|
}, [intersectingNode]);
|
|
486
|
-
const onCollapsed = (0,
|
|
444
|
+
const onCollapsed = (0, import_react12.useCallback)((collapsed) => {
|
|
487
445
|
setGroupCollapsed(id, collapsed);
|
|
488
446
|
}, []);
|
|
489
|
-
const size = (0,
|
|
447
|
+
const size = (0, import_react12.useMemo)(() => {
|
|
490
448
|
return {
|
|
491
449
|
width: data.initialSize?.width || 100,
|
|
492
450
|
height: data.initialSize?.height || 50
|
|
493
451
|
};
|
|
494
452
|
}, [data.initialSize]);
|
|
495
|
-
const incomingModules = (0,
|
|
496
|
-
const updateComputedData = (0,
|
|
497
|
-
(0,
|
|
453
|
+
const incomingModules = (0, import_hooks11.useIncomingComputedData)(id);
|
|
454
|
+
const updateComputedData = (0, import_hooks11.useUpdateNodeComputedData)();
|
|
455
|
+
(0, import_react12.useEffect)(() => {
|
|
498
456
|
if (incomingModules?.length) {
|
|
499
457
|
const { module: module2 } = incomingModules[0];
|
|
500
458
|
updateComputedData(id, { module: module2 });
|
|
501
459
|
}
|
|
502
460
|
}, [incomingModules]);
|
|
503
|
-
return /* @__PURE__ */ (0,
|
|
504
|
-
|
|
461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
462
|
+
import_layout11.NodeContainer,
|
|
505
463
|
{
|
|
506
464
|
id,
|
|
507
465
|
selected,
|
|
508
466
|
data,
|
|
509
|
-
title: /* @__PURE__ */ (0,
|
|
510
|
-
/* @__PURE__ */ (0,
|
|
511
|
-
/* @__PURE__ */ (0,
|
|
467
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core4.Group, { justify: "space-between", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core4.Group, { gap: "xs", children: [
|
|
468
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core4.Badge, { size: "xs", variant: "outline", radius: "xs", color: "gray", children: groupNodes?.length || 0 }),
|
|
469
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_layout11.NodeCollapse, { nodeId: id, isCollapsed: data.isCollapsed, onCollapsed })
|
|
512
470
|
] }) }),
|
|
513
471
|
type,
|
|
514
472
|
children: [
|
|
515
|
-
/* @__PURE__ */ (0,
|
|
516
|
-
|
|
473
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
474
|
+
import_react11.NodeResizer,
|
|
517
475
|
{
|
|
518
476
|
nodeId: id,
|
|
519
477
|
minWidth: size.width,
|
|
@@ -521,7 +479,7 @@ function ModuleGroupNode({
|
|
|
521
479
|
isVisible: selected && !data.isCollapsed
|
|
522
480
|
}
|
|
523
481
|
),
|
|
524
|
-
/* @__PURE__ */ (0,
|
|
482
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_layout11.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
525
483
|
]
|
|
526
484
|
}
|
|
527
485
|
);
|
|
@@ -529,47 +487,47 @@ function ModuleGroupNode({
|
|
|
529
487
|
var module_group_node_default = ModuleGroupNode;
|
|
530
488
|
|
|
531
489
|
// src/nodes/modifiers/noise-abs-node.tsx
|
|
532
|
-
var
|
|
533
|
-
var
|
|
534
|
-
var
|
|
535
|
-
var
|
|
536
|
-
var
|
|
490
|
+
var import_layout12 = require("@awesome-flow/core/layout");
|
|
491
|
+
var import_react13 = require("react");
|
|
492
|
+
var import_hooks12 = require("@awesome-flow/core/hooks");
|
|
493
|
+
var import_libnoise_simplex_ts9 = require("libnoise-simplex-ts");
|
|
494
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
537
495
|
function NoiseAbsNode({ id, selected, data, type }) {
|
|
538
|
-
const incoming = (0,
|
|
539
|
-
const updateComputedData = (0,
|
|
540
|
-
(0,
|
|
496
|
+
const incoming = (0, import_hooks12.useIncomingComputedData)(id);
|
|
497
|
+
const updateComputedData = (0, import_hooks12.useUpdateNodeComputedData)();
|
|
498
|
+
(0, import_react13.useEffect)(() => {
|
|
541
499
|
if (incoming?.length > 0) {
|
|
542
|
-
const module2 = new
|
|
500
|
+
const module2 = new import_libnoise_simplex_ts9.Abs(incoming[0].module);
|
|
543
501
|
updateComputedData(id, { module: module2 });
|
|
544
502
|
}
|
|
545
503
|
}, [incoming]);
|
|
546
|
-
return /* @__PURE__ */ (0,
|
|
504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_layout12.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_layout12.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" }) });
|
|
547
505
|
}
|
|
548
506
|
var noise_abs_node_default = NoiseAbsNode;
|
|
549
507
|
|
|
550
508
|
// src/nodes/modifiers/noise-clamp-node.tsx
|
|
551
|
-
var
|
|
552
|
-
var
|
|
509
|
+
var import_layout13 = require("@awesome-flow/core/layout");
|
|
510
|
+
var import_react14 = require("react");
|
|
553
511
|
var import_core5 = require("@mantine/core");
|
|
554
|
-
var
|
|
555
|
-
var
|
|
556
|
-
var
|
|
512
|
+
var import_hooks13 = require("@awesome-flow/core/hooks");
|
|
513
|
+
var import_libnoise_simplex_ts10 = require("libnoise-simplex-ts");
|
|
514
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
557
515
|
function NoiseClampNode({ id, selected, data, type }) {
|
|
558
|
-
const [lowerBound, setLowerBound] = (0,
|
|
559
|
-
const [upperBound, setUpperBound] = (0,
|
|
560
|
-
const incoming = (0,
|
|
561
|
-
const updateNodeData = (0,
|
|
562
|
-
const updateComputedData = (0,
|
|
563
|
-
(0,
|
|
516
|
+
const [lowerBound, setLowerBound] = (0, import_react14.useState)(data.lowerBound);
|
|
517
|
+
const [upperBound, setUpperBound] = (0, import_react14.useState)(data.upperBound);
|
|
518
|
+
const incoming = (0, import_hooks13.useIncomingComputedData)(id);
|
|
519
|
+
const updateNodeData = (0, import_hooks13.useUpdateNodeData)();
|
|
520
|
+
const updateComputedData = (0, import_hooks13.useUpdateNodeComputedData)();
|
|
521
|
+
(0, import_react14.useEffect)(() => {
|
|
564
522
|
if (incoming?.length) {
|
|
565
|
-
const module2 = new
|
|
523
|
+
const module2 = new import_libnoise_simplex_ts10.Clamp(incoming[0].module, lowerBound, upperBound);
|
|
566
524
|
updateComputedData(id, { module: module2 });
|
|
567
525
|
}
|
|
568
526
|
updateNodeData(id, { lowerBound, upperBound });
|
|
569
527
|
}, [incoming, lowerBound, upperBound]);
|
|
570
|
-
return /* @__PURE__ */ (0,
|
|
571
|
-
/* @__PURE__ */ (0,
|
|
572
|
-
/* @__PURE__ */ (0,
|
|
528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_layout13.NodeContainer, { id, selected, data, type, children: [
|
|
529
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core5.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core5.Group, { children: [
|
|
530
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
573
531
|
import_core5.NumberInput,
|
|
574
532
|
{
|
|
575
533
|
size: "xs",
|
|
@@ -579,7 +537,7 @@ function NoiseClampNode({ id, selected, data, type }) {
|
|
|
579
537
|
step: 0.1
|
|
580
538
|
}
|
|
581
539
|
),
|
|
582
|
-
/* @__PURE__ */ (0,
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
583
541
|
import_core5.NumberInput,
|
|
584
542
|
{
|
|
585
543
|
size: "xs",
|
|
@@ -590,67 +548,67 @@ function NoiseClampNode({ id, selected, data, type }) {
|
|
|
590
548
|
}
|
|
591
549
|
)
|
|
592
550
|
] }) }),
|
|
593
|
-
/* @__PURE__ */ (0,
|
|
551
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_layout13.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
594
552
|
] });
|
|
595
553
|
}
|
|
596
554
|
var noise_clamp_node_default = NoiseClampNode;
|
|
597
555
|
|
|
598
556
|
// src/nodes/modifiers/noise-combine-node.tsx
|
|
599
|
-
var
|
|
600
|
-
var
|
|
601
|
-
var
|
|
557
|
+
var import_layout14 = require("@awesome-flow/core/layout");
|
|
558
|
+
var import_react15 = require("react");
|
|
559
|
+
var import_hooks14 = require("@awesome-flow/core/hooks");
|
|
602
560
|
var import_icons_react = require("@tabler/icons-react");
|
|
603
561
|
|
|
604
562
|
// src/abstract/operations.ts
|
|
605
|
-
var
|
|
563
|
+
var import_libnoise_simplex_ts11 = require("libnoise-simplex-ts");
|
|
606
564
|
var noiseCombineModuleMap = {
|
|
607
|
-
["add" /* add */]:
|
|
608
|
-
["max" /* max */]:
|
|
609
|
-
["min" /* min */]:
|
|
610
|
-
["multiply" /* multiply */]:
|
|
611
|
-
["power" /* power */]:
|
|
565
|
+
["add" /* add */]: import_libnoise_simplex_ts11.Add,
|
|
566
|
+
["max" /* max */]: import_libnoise_simplex_ts11.Max,
|
|
567
|
+
["min" /* min */]: import_libnoise_simplex_ts11.Min,
|
|
568
|
+
["multiply" /* multiply */]: import_libnoise_simplex_ts11.Multiply,
|
|
569
|
+
["power" /* power */]: import_libnoise_simplex_ts11.Power
|
|
612
570
|
};
|
|
613
571
|
|
|
614
572
|
// src/nodes/modifiers/noise-combine-node.tsx
|
|
615
|
-
var
|
|
573
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
616
574
|
var options = {
|
|
617
|
-
add: /* @__PURE__ */ (0,
|
|
618
|
-
min: /* @__PURE__ */ (0,
|
|
619
|
-
max: /* @__PURE__ */ (0,
|
|
620
|
-
multiply: /* @__PURE__ */ (0,
|
|
621
|
-
power: /* @__PURE__ */ (0,
|
|
575
|
+
add: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons_react.IconPlus, {}),
|
|
576
|
+
min: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons_react.IconChevronLeft, {}),
|
|
577
|
+
max: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons_react.IconChevronRight, {}),
|
|
578
|
+
multiply: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons_react.IconAsterisk, {}),
|
|
579
|
+
power: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons_react.IconChevronUp, {})
|
|
622
580
|
};
|
|
623
581
|
function NoiseCombineNode({ id, selected, data, type }) {
|
|
624
|
-
const updateNodeData = (0,
|
|
625
|
-
const updateComputedData = (0,
|
|
626
|
-
const incoming = (0,
|
|
627
|
-
(0,
|
|
582
|
+
const updateNodeData = (0, import_hooks14.useUpdateNodeData)();
|
|
583
|
+
const updateComputedData = (0, import_hooks14.useUpdateNodeComputedData)();
|
|
584
|
+
const incoming = (0, import_hooks14.useIncomingComputedData)(id);
|
|
585
|
+
(0, import_react15.useEffect)(() => {
|
|
628
586
|
const ModuleFactory = noiseCombineModuleMap[data.operation];
|
|
629
587
|
if (incoming?.length > 1) {
|
|
630
588
|
const module2 = new ModuleFactory(incoming[0].module, incoming[1].module);
|
|
631
589
|
updateComputedData(id, { module: module2 });
|
|
632
590
|
}
|
|
633
591
|
}, [data.operation, incoming]);
|
|
634
|
-
const onChange = (0,
|
|
592
|
+
const onChange = (0, import_react15.useCallback)((operation) => {
|
|
635
593
|
updateNodeData(id, { operation });
|
|
636
594
|
}, []);
|
|
637
|
-
return /* @__PURE__ */ (0,
|
|
638
|
-
/* @__PURE__ */ (0,
|
|
639
|
-
/* @__PURE__ */ (0,
|
|
595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_layout14.NodeContainer, { id, selected, data, type, children: [
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_layout14.NodeCombobox, { options, selected: data.operation, onChange, width: 150 }),
|
|
597
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_layout14.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
640
598
|
] });
|
|
641
599
|
}
|
|
642
600
|
var noise_combine_node_default = NoiseCombineNode;
|
|
643
601
|
|
|
644
602
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
645
|
-
var
|
|
603
|
+
var import_layout15 = require("@awesome-flow/core/layout");
|
|
646
604
|
var import_core6 = require("@mantine/core");
|
|
647
|
-
var
|
|
605
|
+
var import_hooks15 = require("@awesome-flow/core/hooks");
|
|
648
606
|
|
|
649
607
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
650
|
-
var
|
|
608
|
+
var import_react22 = require("react");
|
|
651
609
|
|
|
652
610
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/actions/actions.mjs
|
|
653
|
-
var
|
|
611
|
+
var import_react16 = require("react");
|
|
654
612
|
function validateFormName(name) {
|
|
655
613
|
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
656
614
|
throw new Error(
|
|
@@ -658,7 +616,7 @@ function validateFormName(name) {
|
|
|
658
616
|
);
|
|
659
617
|
}
|
|
660
618
|
}
|
|
661
|
-
var useIsomorphicEffect = typeof window !== "undefined" ?
|
|
619
|
+
var useIsomorphicEffect = typeof window !== "undefined" ? import_react16.useLayoutEffect : import_react16.useEffect;
|
|
662
620
|
function useFormEvent(eventKey, handler) {
|
|
663
621
|
useIsomorphicEffect(() => {
|
|
664
622
|
if (eventKey) {
|
|
@@ -755,7 +713,7 @@ function getInputOnChange(setValue) {
|
|
|
755
713
|
}
|
|
756
714
|
|
|
757
715
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
758
|
-
var
|
|
716
|
+
var import_react17 = require("react");
|
|
759
717
|
|
|
760
718
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
761
719
|
function filterErrors(errors) {
|
|
@@ -773,17 +731,17 @@ function filterErrors(errors) {
|
|
|
773
731
|
|
|
774
732
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
775
733
|
function useFormErrors(initialErrors) {
|
|
776
|
-
const [errorsState, setErrorsState] = (0,
|
|
777
|
-
const errorsRef = (0,
|
|
778
|
-
const setErrors = (0,
|
|
734
|
+
const [errorsState, setErrorsState] = (0, import_react17.useState)(filterErrors(initialErrors));
|
|
735
|
+
const errorsRef = (0, import_react17.useRef)(errorsState);
|
|
736
|
+
const setErrors = (0, import_react17.useCallback)((errors) => {
|
|
779
737
|
setErrorsState((current) => {
|
|
780
738
|
const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
|
|
781
739
|
errorsRef.current = newErrors;
|
|
782
740
|
return newErrors;
|
|
783
741
|
});
|
|
784
742
|
}, []);
|
|
785
|
-
const clearErrors = (0,
|
|
786
|
-
const clearFieldError = (0,
|
|
743
|
+
const clearErrors = (0, import_react17.useCallback)(() => setErrors({}), []);
|
|
744
|
+
const clearFieldError = (0, import_react17.useCallback)(
|
|
787
745
|
(path) => {
|
|
788
746
|
if (errorsRef.current[path] === void 0) {
|
|
789
747
|
return;
|
|
@@ -796,7 +754,7 @@ function useFormErrors(initialErrors) {
|
|
|
796
754
|
},
|
|
797
755
|
[errorsState]
|
|
798
756
|
);
|
|
799
|
-
const setFieldError = (0,
|
|
757
|
+
const setFieldError = (0, import_react17.useCallback)(
|
|
800
758
|
(path, error) => {
|
|
801
759
|
if (error == null || error === false) {
|
|
802
760
|
clearFieldError(path);
|
|
@@ -816,7 +774,7 @@ function useFormErrors(initialErrors) {
|
|
|
816
774
|
}
|
|
817
775
|
|
|
818
776
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
819
|
-
var
|
|
777
|
+
var import_react18 = require("react");
|
|
820
778
|
|
|
821
779
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
822
780
|
function clearListState(field, state) {
|
|
@@ -902,16 +860,13 @@ function reorderErrors(path, { from, to }, errors) {
|
|
|
902
860
|
|
|
903
861
|
// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
|
|
904
862
|
function set(obj, key, val) {
|
|
905
|
-
if (typeof val.value === "object")
|
|
906
|
-
val.value = klona(val.value);
|
|
863
|
+
if (typeof val.value === "object") val.value = klona(val.value);
|
|
907
864
|
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === "__proto__") {
|
|
908
865
|
Object.defineProperty(obj, key, val);
|
|
909
|
-
} else
|
|
910
|
-
obj[key] = val.value;
|
|
866
|
+
} else obj[key] = val.value;
|
|
911
867
|
}
|
|
912
868
|
function klona(x) {
|
|
913
|
-
if (typeof x !== "object")
|
|
914
|
-
return x;
|
|
869
|
+
if (typeof x !== "object") return x;
|
|
915
870
|
var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);
|
|
916
871
|
if (str === "[object Object]") {
|
|
917
872
|
tmp = Object.create(x.__proto__ || null);
|
|
@@ -943,8 +898,7 @@ function klona(x) {
|
|
|
943
898
|
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
944
899
|
}
|
|
945
900
|
for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
946
|
-
if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k])
|
|
947
|
-
continue;
|
|
901
|
+
if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k]) continue;
|
|
948
902
|
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
949
903
|
}
|
|
950
904
|
}
|
|
@@ -1040,7 +994,7 @@ function useFormList({
|
|
|
1040
994
|
$errors,
|
|
1041
995
|
$status
|
|
1042
996
|
}) {
|
|
1043
|
-
const reorderListItem = (0,
|
|
997
|
+
const reorderListItem = (0, import_react18.useCallback)((path, payload) => {
|
|
1044
998
|
$status.clearFieldDirty(path);
|
|
1045
999
|
$errors.setErrors((errs) => reorderErrors(path, payload, errs));
|
|
1046
1000
|
$values.setValues({
|
|
@@ -1048,7 +1002,7 @@ function useFormList({
|
|
|
1048
1002
|
updateState: true
|
|
1049
1003
|
});
|
|
1050
1004
|
}, []);
|
|
1051
|
-
const removeListItem = (0,
|
|
1005
|
+
const removeListItem = (0, import_react18.useCallback)((path, index) => {
|
|
1052
1006
|
$status.clearFieldDirty(path);
|
|
1053
1007
|
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));
|
|
1054
1008
|
$values.setValues({
|
|
@@ -1056,7 +1010,7 @@ function useFormList({
|
|
|
1056
1010
|
updateState: true
|
|
1057
1011
|
});
|
|
1058
1012
|
}, []);
|
|
1059
|
-
const insertListItem = (0,
|
|
1013
|
+
const insertListItem = (0, import_react18.useCallback)((path, item, index) => {
|
|
1060
1014
|
$status.clearFieldDirty(path);
|
|
1061
1015
|
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));
|
|
1062
1016
|
$values.setValues({
|
|
@@ -1068,7 +1022,7 @@ function useFormList({
|
|
|
1068
1022
|
}
|
|
1069
1023
|
|
|
1070
1024
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1071
|
-
var
|
|
1025
|
+
var import_react19 = require("react");
|
|
1072
1026
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
1073
1027
|
|
|
1074
1028
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
@@ -1088,31 +1042,31 @@ function useFormStatus({
|
|
|
1088
1042
|
mode,
|
|
1089
1043
|
$values
|
|
1090
1044
|
}) {
|
|
1091
|
-
const [touchedState, setTouchedState] = (0,
|
|
1092
|
-
const [dirtyState, setDirtyState] = (0,
|
|
1093
|
-
const touchedRef = (0,
|
|
1094
|
-
const dirtyRef = (0,
|
|
1095
|
-
const setTouched = (0,
|
|
1045
|
+
const [touchedState, setTouchedState] = (0, import_react19.useState)(initialTouched);
|
|
1046
|
+
const [dirtyState, setDirtyState] = (0, import_react19.useState)(initialDirty);
|
|
1047
|
+
const touchedRef = (0, import_react19.useRef)(initialTouched);
|
|
1048
|
+
const dirtyRef = (0, import_react19.useRef)(initialDirty);
|
|
1049
|
+
const setTouched = (0, import_react19.useCallback)((values) => {
|
|
1096
1050
|
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
1097
1051
|
touchedRef.current = resolvedValues;
|
|
1098
1052
|
if (mode === "controlled") {
|
|
1099
1053
|
setTouchedState(resolvedValues);
|
|
1100
1054
|
}
|
|
1101
1055
|
}, []);
|
|
1102
|
-
const setDirty = (0,
|
|
1056
|
+
const setDirty = (0, import_react19.useCallback)((values) => {
|
|
1103
1057
|
const resolvedValues = typeof values === "function" ? values(dirtyRef.current) : values;
|
|
1104
1058
|
dirtyRef.current = resolvedValues;
|
|
1105
1059
|
if (mode === "controlled") {
|
|
1106
1060
|
setDirtyState(resolvedValues);
|
|
1107
1061
|
}
|
|
1108
1062
|
}, []);
|
|
1109
|
-
const resetTouched = (0,
|
|
1063
|
+
const resetTouched = (0, import_react19.useCallback)(() => setTouched({}), []);
|
|
1110
1064
|
const resetDirty = (values) => {
|
|
1111
1065
|
const newSnapshot = values ? { ...values, ...$values.refValues.current } : $values.refValues.current;
|
|
1112
1066
|
$values.setValuesSnapshot(newSnapshot);
|
|
1113
1067
|
setDirty({});
|
|
1114
1068
|
};
|
|
1115
|
-
const setFieldTouched = (0,
|
|
1069
|
+
const setFieldTouched = (0, import_react19.useCallback)((path, touched) => {
|
|
1116
1070
|
setTouched((currentTouched) => {
|
|
1117
1071
|
if (getStatus(currentTouched, path) === touched) {
|
|
1118
1072
|
return currentTouched;
|
|
@@ -1120,7 +1074,7 @@ function useFormStatus({
|
|
|
1120
1074
|
return { ...currentTouched, [path]: touched };
|
|
1121
1075
|
});
|
|
1122
1076
|
}, []);
|
|
1123
|
-
const setFieldDirty = (0,
|
|
1077
|
+
const setFieldDirty = (0, import_react19.useCallback)((path, dirty) => {
|
|
1124
1078
|
setDirty((currentDirty) => {
|
|
1125
1079
|
if (getStatus(currentDirty, path) === dirty) {
|
|
1126
1080
|
return currentDirty;
|
|
@@ -1128,11 +1082,11 @@ function useFormStatus({
|
|
|
1128
1082
|
return { ...currentDirty, [path]: dirty };
|
|
1129
1083
|
});
|
|
1130
1084
|
}, []);
|
|
1131
|
-
const isTouched = (0,
|
|
1085
|
+
const isTouched = (0, import_react19.useCallback)(
|
|
1132
1086
|
(path) => getStatus(touchedRef.current, path),
|
|
1133
1087
|
[]
|
|
1134
1088
|
);
|
|
1135
|
-
const clearFieldDirty = (0,
|
|
1089
|
+
const clearFieldDirty = (0, import_react19.useCallback)(
|
|
1136
1090
|
(path) => setDirty((current) => {
|
|
1137
1091
|
if (typeof path !== "string") {
|
|
1138
1092
|
return current;
|
|
@@ -1146,7 +1100,7 @@ function useFormStatus({
|
|
|
1146
1100
|
}),
|
|
1147
1101
|
[]
|
|
1148
1102
|
);
|
|
1149
|
-
const isDirty = (0,
|
|
1103
|
+
const isDirty = (0, import_react19.useCallback)((path) => {
|
|
1150
1104
|
if (path) {
|
|
1151
1105
|
const overriddenValue = getPath(path, dirtyRef.current);
|
|
1152
1106
|
if (typeof overriddenValue === "boolean") {
|
|
@@ -1162,8 +1116,8 @@ function useFormStatus({
|
|
|
1162
1116
|
}
|
|
1163
1117
|
return !(0, import_fast_deep_equal.default)($values.refValues.current, $values.valuesSnapshot.current);
|
|
1164
1118
|
}, []);
|
|
1165
|
-
const getDirty = (0,
|
|
1166
|
-
const getTouched = (0,
|
|
1119
|
+
const getDirty = (0, import_react19.useCallback)(() => dirtyRef.current, []);
|
|
1120
|
+
const getTouched = (0, import_react19.useCallback)(() => touchedRef.current, []);
|
|
1167
1121
|
return {
|
|
1168
1122
|
touchedState,
|
|
1169
1123
|
dirtyState,
|
|
@@ -1186,17 +1140,17 @@ function useFormStatus({
|
|
|
1186
1140
|
}
|
|
1187
1141
|
|
|
1188
1142
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1189
|
-
var
|
|
1143
|
+
var import_react20 = require("react");
|
|
1190
1144
|
function useFormValues({
|
|
1191
1145
|
initialValues,
|
|
1192
1146
|
onValuesChange,
|
|
1193
1147
|
mode
|
|
1194
1148
|
}) {
|
|
1195
|
-
const initialized = (0,
|
|
1196
|
-
const [stateValues, setStateValues] = (0,
|
|
1197
|
-
const refValues = (0,
|
|
1198
|
-
const valuesSnapshot = (0,
|
|
1199
|
-
const setValues = (0,
|
|
1149
|
+
const initialized = (0, import_react20.useRef)(false);
|
|
1150
|
+
const [stateValues, setStateValues] = (0, import_react20.useState)(initialValues || {});
|
|
1151
|
+
const refValues = (0, import_react20.useRef)(stateValues);
|
|
1152
|
+
const valuesSnapshot = (0, import_react20.useRef)(stateValues);
|
|
1153
|
+
const setValues = (0, import_react20.useCallback)(
|
|
1200
1154
|
({
|
|
1201
1155
|
values,
|
|
1202
1156
|
subscribers,
|
|
@@ -1213,7 +1167,7 @@ function useFormValues({
|
|
|
1213
1167
|
},
|
|
1214
1168
|
[onValuesChange]
|
|
1215
1169
|
);
|
|
1216
|
-
const setFieldValue = (0,
|
|
1170
|
+
const setFieldValue = (0, import_react20.useCallback)((payload) => {
|
|
1217
1171
|
const currentValue = getPath(payload.path, refValues.current);
|
|
1218
1172
|
const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;
|
|
1219
1173
|
if (currentValue !== updatedValue) {
|
|
@@ -1225,10 +1179,10 @@ function useFormValues({
|
|
|
1225
1179
|
);
|
|
1226
1180
|
}
|
|
1227
1181
|
}, []);
|
|
1228
|
-
const setValuesSnapshot = (0,
|
|
1182
|
+
const setValuesSnapshot = (0, import_react20.useCallback)((payload) => {
|
|
1229
1183
|
valuesSnapshot.current = payload;
|
|
1230
1184
|
}, []);
|
|
1231
|
-
const initialize = (0,
|
|
1185
|
+
const initialize = (0, import_react20.useCallback)((values, onInitialize) => {
|
|
1232
1186
|
if (!initialized.current) {
|
|
1233
1187
|
initialized.current = true;
|
|
1234
1188
|
setValues({ values, updateState: mode === "controlled" });
|
|
@@ -1236,14 +1190,14 @@ function useFormValues({
|
|
|
1236
1190
|
onInitialize();
|
|
1237
1191
|
}
|
|
1238
1192
|
}, []);
|
|
1239
|
-
const resetValues = (0,
|
|
1193
|
+
const resetValues = (0, import_react20.useCallback)(() => {
|
|
1240
1194
|
setValues({
|
|
1241
1195
|
values: valuesSnapshot.current,
|
|
1242
1196
|
updateState: true,
|
|
1243
1197
|
mergeWithPreviousValues: false
|
|
1244
1198
|
});
|
|
1245
1199
|
}, []);
|
|
1246
|
-
const getValues = (0,
|
|
1200
|
+
const getValues = (0, import_react20.useCallback)(() => refValues.current, []);
|
|
1247
1201
|
return {
|
|
1248
1202
|
initialized,
|
|
1249
1203
|
stateValues,
|
|
@@ -1259,15 +1213,15 @@ function useFormValues({
|
|
|
1259
1213
|
}
|
|
1260
1214
|
|
|
1261
1215
|
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1262
|
-
var
|
|
1216
|
+
var import_react21 = require("react");
|
|
1263
1217
|
function useFormWatch({
|
|
1264
1218
|
$status
|
|
1265
1219
|
}) {
|
|
1266
|
-
const subscribers = (0,
|
|
1220
|
+
const subscribers = (0, import_react21.useRef)(
|
|
1267
1221
|
{}
|
|
1268
1222
|
);
|
|
1269
|
-
const watch = (0,
|
|
1270
|
-
(0,
|
|
1223
|
+
const watch = (0, import_react21.useCallback)((path, callback) => {
|
|
1224
|
+
(0, import_react21.useEffect)(() => {
|
|
1271
1225
|
subscribers.current[path] = subscribers.current[path] || [];
|
|
1272
1226
|
subscribers.current[path].push(callback);
|
|
1273
1227
|
return () => {
|
|
@@ -1275,7 +1229,7 @@ function useFormWatch({
|
|
|
1275
1229
|
};
|
|
1276
1230
|
}, [callback]);
|
|
1277
1231
|
}, []);
|
|
1278
|
-
const getFieldSubscribers = (0,
|
|
1232
|
+
const getFieldSubscribers = (0, import_react21.useCallback)((path) => {
|
|
1279
1233
|
if (!subscribers.current[path]) {
|
|
1280
1234
|
return [];
|
|
1281
1235
|
}
|
|
@@ -1388,19 +1342,19 @@ function useForm({
|
|
|
1388
1342
|
const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });
|
|
1389
1343
|
const $list = useFormList({ $values, $errors, $status });
|
|
1390
1344
|
const $watch = useFormWatch({ $status });
|
|
1391
|
-
const [formKey, setFormKey] = (0,
|
|
1392
|
-
const [fieldKeys, setFieldKeys] = (0,
|
|
1393
|
-
const reset = (0,
|
|
1345
|
+
const [formKey, setFormKey] = (0, import_react22.useState)(0);
|
|
1346
|
+
const [fieldKeys, setFieldKeys] = (0, import_react22.useState)({});
|
|
1347
|
+
const reset = (0, import_react22.useCallback)(() => {
|
|
1394
1348
|
$values.resetValues();
|
|
1395
1349
|
$errors.clearErrors();
|
|
1396
1350
|
$status.resetDirty();
|
|
1397
1351
|
$status.resetTouched();
|
|
1398
1352
|
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
1399
1353
|
}, []);
|
|
1400
|
-
const initialize = (0,
|
|
1354
|
+
const initialize = (0, import_react22.useCallback)((values) => {
|
|
1401
1355
|
$values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
|
|
1402
1356
|
}, []);
|
|
1403
|
-
const setFieldValue = (0,
|
|
1357
|
+
const setFieldValue = (0, import_react22.useCallback)(
|
|
1404
1358
|
(path, value, options2) => {
|
|
1405
1359
|
const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
|
|
1406
1360
|
$status.clearFieldDirty(path);
|
|
@@ -1425,7 +1379,7 @@ function useForm({
|
|
|
1425
1379
|
},
|
|
1426
1380
|
[onValuesChange, rules]
|
|
1427
1381
|
);
|
|
1428
|
-
const setValues = (0,
|
|
1382
|
+
const setValues = (0, import_react22.useCallback)(
|
|
1429
1383
|
(values) => {
|
|
1430
1384
|
const previousValues = $values.refValues.current;
|
|
1431
1385
|
$values.setValues({ values, updateState: mode === "controlled" });
|
|
@@ -1441,12 +1395,12 @@ function useForm({
|
|
|
1441
1395
|
},
|
|
1442
1396
|
[onValuesChange, clearInputErrorOnChange]
|
|
1443
1397
|
);
|
|
1444
|
-
const validate = (0,
|
|
1398
|
+
const validate = (0, import_react22.useCallback)(() => {
|
|
1445
1399
|
const results = validateValues(rules, $values.refValues.current);
|
|
1446
1400
|
$errors.setErrors(results.errors);
|
|
1447
1401
|
return results;
|
|
1448
1402
|
}, [rules]);
|
|
1449
|
-
const validateField = (0,
|
|
1403
|
+
const validateField = (0, import_react22.useCallback)(
|
|
1450
1404
|
(path) => {
|
|
1451
1405
|
const results = validateFieldValue(path, rules, $values.refValues.current);
|
|
1452
1406
|
results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);
|
|
@@ -1502,16 +1456,16 @@ function useForm({
|
|
|
1502
1456
|
}
|
|
1503
1457
|
};
|
|
1504
1458
|
const getTransformedValues = (input) => transformValues(input || $values.refValues.current);
|
|
1505
|
-
const onReset = (0,
|
|
1459
|
+
const onReset = (0, import_react22.useCallback)((event) => {
|
|
1506
1460
|
event.preventDefault();
|
|
1507
1461
|
reset();
|
|
1508
1462
|
}, []);
|
|
1509
|
-
const isValid = (0,
|
|
1463
|
+
const isValid = (0, import_react22.useCallback)(
|
|
1510
1464
|
(path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,
|
|
1511
1465
|
[rules]
|
|
1512
1466
|
);
|
|
1513
1467
|
const key = (path) => `${formKey}-${path}-${fieldKeys[path] || 0}`;
|
|
1514
|
-
const getInputNode = (0,
|
|
1468
|
+
const getInputNode = (0, import_react22.useCallback)(
|
|
1515
1469
|
(path) => document.querySelector(`[data-path="${getDataPath(name, path)}"]`),
|
|
1516
1470
|
[]
|
|
1517
1471
|
);
|
|
@@ -1556,18 +1510,17 @@ function useForm({
|
|
|
1556
1510
|
}
|
|
1557
1511
|
|
|
1558
1512
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
1559
|
-
var
|
|
1560
|
-
var
|
|
1561
|
-
var import_util = require("libnoise-ts/util");
|
|
1513
|
+
var import_react23 = require("react");
|
|
1514
|
+
var import_libnoise_simplex_ts12 = require("libnoise-simplex-ts");
|
|
1562
1515
|
var import_icons_react2 = require("@tabler/icons-react");
|
|
1563
|
-
var
|
|
1516
|
+
var import_hooks16 = require("@mantine/hooks");
|
|
1564
1517
|
var import_abstract = require("@awesome-flow/core/abstract");
|
|
1565
|
-
var
|
|
1518
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1566
1519
|
function NoiseCurveNode({ id, selected, data, type }) {
|
|
1567
|
-
const incoming = (0,
|
|
1568
|
-
const updateNodeData = (0,
|
|
1569
|
-
const updateComputedData = (0,
|
|
1570
|
-
const [values, setValues] = (0,
|
|
1520
|
+
const incoming = (0, import_hooks15.useIncomingComputedData)(id);
|
|
1521
|
+
const updateNodeData = (0, import_hooks15.useUpdateNodeData)();
|
|
1522
|
+
const updateComputedData = (0, import_hooks15.useUpdateNodeComputedData)();
|
|
1523
|
+
const [values, setValues] = (0, import_react23.useState)([]);
|
|
1571
1524
|
const form = useForm({
|
|
1572
1525
|
mode: "uncontrolled",
|
|
1573
1526
|
initialValues: {
|
|
@@ -1586,7 +1539,7 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1586
1539
|
}
|
|
1587
1540
|
}
|
|
1588
1541
|
},
|
|
1589
|
-
onValuesChange: (0,
|
|
1542
|
+
onValuesChange: (0, import_react23.useCallback)((values2) => {
|
|
1590
1543
|
if (form.isValid()) {
|
|
1591
1544
|
const points = values2.points.map((v) => ({ input: v.input, output: v.output }));
|
|
1592
1545
|
setValues(points);
|
|
@@ -1595,21 +1548,21 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1595
1548
|
form.validate();
|
|
1596
1549
|
}, [])
|
|
1597
1550
|
});
|
|
1598
|
-
(0,
|
|
1599
|
-
const points = data.points?.length ? data.points.map((v) => ({ input: v.input, output: v.output, key: (0,
|
|
1551
|
+
(0, import_react23.useEffect)(() => {
|
|
1552
|
+
const points = data.points?.length ? data.points.map((v) => ({ input: v.input, output: v.output, key: (0, import_hooks16.randomId)() })) : [1, 2, 3, 4].map(() => ({ input: 0, output: 0, key: (0, import_hooks16.randomId)() }));
|
|
1600
1553
|
form.initialize({ points });
|
|
1601
1554
|
}, []);
|
|
1602
|
-
(0,
|
|
1555
|
+
(0, import_react23.useEffect)(() => {
|
|
1603
1556
|
if (incoming?.length && values?.length >= 4) {
|
|
1604
|
-
const module2 = new
|
|
1557
|
+
const module2 = new import_libnoise_simplex_ts12.Curve(
|
|
1605
1558
|
incoming[0].module,
|
|
1606
|
-
values.map((p) => new
|
|
1559
|
+
values.map((p) => new import_libnoise_simplex_ts12.Tuple(p.input, p.output))
|
|
1607
1560
|
);
|
|
1608
1561
|
updateComputedData(id, { module: module2 });
|
|
1609
1562
|
}
|
|
1610
1563
|
}, [values, incoming]);
|
|
1611
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0,
|
|
1612
|
-
/* @__PURE__ */ (0,
|
|
1564
|
+
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core6.Group, { mt: "xs", children: [
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1613
1566
|
import_core6.NumberInput,
|
|
1614
1567
|
{
|
|
1615
1568
|
size: "xs",
|
|
@@ -1620,7 +1573,7 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1620
1573
|
},
|
|
1621
1574
|
form.key(`points.${index}.input`)
|
|
1622
1575
|
),
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1576
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1624
1577
|
import_core6.NumberInput,
|
|
1625
1578
|
{
|
|
1626
1579
|
size: "xs",
|
|
@@ -1631,60 +1584,60 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1631
1584
|
},
|
|
1632
1585
|
form.key(`points.${index}.output`)
|
|
1633
1586
|
),
|
|
1634
|
-
data.state === import_abstract.NodeState.edit && values.length > 4 && /* @__PURE__ */ (0,
|
|
1587
|
+
data.state === import_abstract.NodeState.edit && values.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1635
1588
|
import_core6.ActionIcon,
|
|
1636
1589
|
{
|
|
1637
1590
|
color: "red",
|
|
1638
1591
|
variant: "outline",
|
|
1639
1592
|
size: "sm",
|
|
1640
1593
|
onClick: () => form.removeListItem("points", index),
|
|
1641
|
-
children: /* @__PURE__ */ (0,
|
|
1594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react2.IconX, { size: "1rem" })
|
|
1642
1595
|
}
|
|
1643
1596
|
)
|
|
1644
1597
|
] }, item.key));
|
|
1645
|
-
return /* @__PURE__ */ (0,
|
|
1598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_layout15.NodeContainer, { id, selected, type, data, children: [
|
|
1646
1599
|
fields,
|
|
1647
|
-
data.state === import_abstract.NodeState.edit && /* @__PURE__ */ (0,
|
|
1648
|
-
/* @__PURE__ */ (0,
|
|
1649
|
-
/* @__PURE__ */ (0,
|
|
1600
|
+
data.state === import_abstract.NodeState.edit && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1601
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core6.Space, { h: 10 }),
|
|
1602
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1650
1603
|
import_core6.Button,
|
|
1651
1604
|
{
|
|
1652
1605
|
variant: "outline",
|
|
1653
1606
|
size: "xs",
|
|
1654
1607
|
fullWidth: true,
|
|
1655
|
-
onClick: () => form.insertListItem("points", { input: 0, output: 0, key: (0,
|
|
1608
|
+
onClick: () => form.insertListItem("points", { input: 0, output: 0, key: (0, import_hooks16.randomId)() }),
|
|
1656
1609
|
children: "Add control point"
|
|
1657
1610
|
}
|
|
1658
1611
|
)
|
|
1659
1612
|
] }),
|
|
1660
|
-
/* @__PURE__ */ (0,
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_layout15.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1661
1614
|
] });
|
|
1662
1615
|
}
|
|
1663
1616
|
var noise_curve_node_default = NoiseCurveNode;
|
|
1664
1617
|
|
|
1665
1618
|
// src/nodes/modifiers/noise-exponent-node.tsx
|
|
1666
|
-
var
|
|
1667
|
-
var
|
|
1619
|
+
var import_layout16 = require("@awesome-flow/core/layout");
|
|
1620
|
+
var import_react24 = require("react");
|
|
1668
1621
|
var import_core7 = require("@mantine/core");
|
|
1669
|
-
var
|
|
1670
|
-
var
|
|
1671
|
-
var
|
|
1622
|
+
var import_hooks17 = require("@awesome-flow/core/hooks");
|
|
1623
|
+
var import_libnoise_simplex_ts13 = require("libnoise-simplex-ts");
|
|
1624
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1672
1625
|
function NoiseExponentNode({ id, selected, data, type }) {
|
|
1673
|
-
const [exponent, setExponent] = (0,
|
|
1674
|
-
const incoming = (0,
|
|
1675
|
-
const updateNodeData = (0,
|
|
1676
|
-
const updateComputedData = (0,
|
|
1677
|
-
(0,
|
|
1626
|
+
const [exponent, setExponent] = (0, import_react24.useState)(data.exponent);
|
|
1627
|
+
const incoming = (0, import_hooks17.useIncomingComputedData)(id);
|
|
1628
|
+
const updateNodeData = (0, import_hooks17.useUpdateNodeData)();
|
|
1629
|
+
const updateComputedData = (0, import_hooks17.useUpdateNodeComputedData)();
|
|
1630
|
+
(0, import_react24.useEffect)(() => {
|
|
1678
1631
|
if (incoming?.length > 0) {
|
|
1679
|
-
const module2 = new
|
|
1632
|
+
const module2 = new import_libnoise_simplex_ts13.Exponent(incoming[0].module, exponent);
|
|
1680
1633
|
updateComputedData(id, { module: module2 });
|
|
1681
1634
|
}
|
|
1682
1635
|
updateNodeData(id, { exponent });
|
|
1683
1636
|
}, [incoming, exponent]);
|
|
1684
|
-
return /* @__PURE__ */ (0,
|
|
1685
|
-
/* @__PURE__ */ (0,
|
|
1637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_layout16.NodeContainer, { id, selected, data, type, children: [
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core7.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core7.Group, { children: [
|
|
1686
1639
|
"Exponent:",
|
|
1687
|
-
/* @__PURE__ */ (0,
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1688
1641
|
import_core7.NumberInput,
|
|
1689
1642
|
{
|
|
1690
1643
|
size: "xs",
|
|
@@ -1694,39 +1647,39 @@ function NoiseExponentNode({ id, selected, data, type }) {
|
|
|
1694
1647
|
}
|
|
1695
1648
|
)
|
|
1696
1649
|
] }) }),
|
|
1697
|
-
/* @__PURE__ */ (0,
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_layout16.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1698
1651
|
] });
|
|
1699
1652
|
}
|
|
1700
1653
|
var noise_exponent_node_default = NoiseExponentNode;
|
|
1701
1654
|
|
|
1702
1655
|
// src/nodes/modifiers/noise-invert-node.tsx
|
|
1703
|
-
var
|
|
1704
|
-
var
|
|
1705
|
-
var
|
|
1706
|
-
var
|
|
1707
|
-
var
|
|
1656
|
+
var import_layout17 = require("@awesome-flow/core/layout");
|
|
1657
|
+
var import_react25 = require("react");
|
|
1658
|
+
var import_hooks18 = require("@awesome-flow/core/hooks");
|
|
1659
|
+
var import_libnoise_simplex_ts14 = require("libnoise-simplex-ts");
|
|
1660
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1708
1661
|
function NoiseInvertNode({ id, selected, data, type }) {
|
|
1709
|
-
const incoming = (0,
|
|
1710
|
-
const updateComputedData = (0,
|
|
1711
|
-
(0,
|
|
1662
|
+
const incoming = (0, import_hooks18.useIncomingComputedData)(id);
|
|
1663
|
+
const updateComputedData = (0, import_hooks18.useUpdateNodeComputedData)();
|
|
1664
|
+
(0, import_react25.useEffect)(() => {
|
|
1712
1665
|
if (incoming?.length > 0) {
|
|
1713
|
-
const module2 = new
|
|
1666
|
+
const module2 = new import_libnoise_simplex_ts14.Invert(incoming[0].module);
|
|
1714
1667
|
updateComputedData(id, { module: module2 });
|
|
1715
1668
|
}
|
|
1716
1669
|
}, [incoming]);
|
|
1717
|
-
return /* @__PURE__ */ (0,
|
|
1670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_layout17.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_layout17.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" }) });
|
|
1718
1671
|
}
|
|
1719
1672
|
var noise_invert_node_default = NoiseInvertNode;
|
|
1720
1673
|
|
|
1721
1674
|
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
1722
|
-
var
|
|
1723
|
-
var
|
|
1675
|
+
var import_layout18 = require("@awesome-flow/core/layout");
|
|
1676
|
+
var import_react26 = require("react");
|
|
1724
1677
|
var import_core8 = require("@mantine/core");
|
|
1725
|
-
var
|
|
1678
|
+
var import_hooks19 = require("@awesome-flow/core/hooks");
|
|
1726
1679
|
|
|
1727
1680
|
// src/modules/normalize-noise-module.ts
|
|
1728
|
-
var
|
|
1729
|
-
var NormalizeNoiseModule = class extends
|
|
1681
|
+
var import_libnoise_simplex_ts15 = require("libnoise-simplex-ts");
|
|
1682
|
+
var NormalizeNoiseModule = class extends import_libnoise_simplex_ts15.ModifierModule {
|
|
1730
1683
|
constructor(source, lowerBound, upperBound) {
|
|
1731
1684
|
super(source);
|
|
1732
1685
|
this.lowerBound = lowerBound;
|
|
@@ -1741,14 +1694,14 @@ function normalize(value, min, max) {
|
|
|
1741
1694
|
}
|
|
1742
1695
|
|
|
1743
1696
|
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
1744
|
-
var
|
|
1697
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1745
1698
|
function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
1746
|
-
const [intervalStart, setIntervalStart] = (0,
|
|
1747
|
-
const [intervalEnd, setIntervalEnd] = (0,
|
|
1748
|
-
const incoming = (0,
|
|
1749
|
-
const updateNodeData = (0,
|
|
1750
|
-
const updateComputedData = (0,
|
|
1751
|
-
(0,
|
|
1699
|
+
const [intervalStart, setIntervalStart] = (0, import_react26.useState)(data.intervalStart);
|
|
1700
|
+
const [intervalEnd, setIntervalEnd] = (0, import_react26.useState)(data.intervalEnd);
|
|
1701
|
+
const incoming = (0, import_hooks19.useIncomingComputedData)(id);
|
|
1702
|
+
const updateNodeData = (0, import_hooks19.useUpdateNodeData)();
|
|
1703
|
+
const updateComputedData = (0, import_hooks19.useUpdateNodeComputedData)();
|
|
1704
|
+
(0, import_react26.useEffect)(() => {
|
|
1752
1705
|
if (incoming?.length) {
|
|
1753
1706
|
const source = incoming[0].module;
|
|
1754
1707
|
const module2 = new NormalizeNoiseModule(source, intervalStart, intervalEnd);
|
|
@@ -1756,9 +1709,9 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
1756
1709
|
}
|
|
1757
1710
|
updateNodeData(id, { intervalStart, intervalEnd });
|
|
1758
1711
|
}, [incoming, intervalStart, intervalEnd]);
|
|
1759
|
-
return /* @__PURE__ */ (0,
|
|
1760
|
-
/* @__PURE__ */ (0,
|
|
1761
|
-
/* @__PURE__ */ (0,
|
|
1712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_layout18.NodeContainer, { id, selected, data, type, children: [
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core8.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core8.Group, { children: [
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1762
1715
|
import_core8.NumberInput,
|
|
1763
1716
|
{
|
|
1764
1717
|
size: "xs",
|
|
@@ -1767,7 +1720,7 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
1767
1720
|
onChange: (e) => setIntervalStart(Number(e))
|
|
1768
1721
|
}
|
|
1769
1722
|
),
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1723
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1771
1724
|
import_core8.NumberInput,
|
|
1772
1725
|
{
|
|
1773
1726
|
size: "xs",
|
|
@@ -1777,36 +1730,36 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
1777
1730
|
}
|
|
1778
1731
|
)
|
|
1779
1732
|
] }) }),
|
|
1780
|
-
/* @__PURE__ */ (0,
|
|
1733
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_layout18.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1781
1734
|
] });
|
|
1782
1735
|
}
|
|
1783
1736
|
var noise_normalize_node_default = NoiseNormalizeNode;
|
|
1784
1737
|
|
|
1785
1738
|
// src/nodes/modifiers/noise-scale-bias-node.tsx
|
|
1786
|
-
var
|
|
1787
|
-
var
|
|
1739
|
+
var import_layout19 = require("@awesome-flow/core/layout");
|
|
1740
|
+
var import_react27 = require("react");
|
|
1788
1741
|
var import_core9 = require("@mantine/core");
|
|
1789
|
-
var
|
|
1790
|
-
var
|
|
1791
|
-
var
|
|
1742
|
+
var import_hooks20 = require("@awesome-flow/core/hooks");
|
|
1743
|
+
var import_libnoise_simplex_ts16 = require("libnoise-simplex-ts");
|
|
1744
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1792
1745
|
function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
1793
|
-
const [scale, setScale] = (0,
|
|
1794
|
-
const [bias, setBias] = (0,
|
|
1795
|
-
const incoming = (0,
|
|
1796
|
-
const updateNodeData = (0,
|
|
1797
|
-
const updateComputedData = (0,
|
|
1798
|
-
(0,
|
|
1746
|
+
const [scale, setScale] = (0, import_react27.useState)(data.scale);
|
|
1747
|
+
const [bias, setBias] = (0, import_react27.useState)(data.bias);
|
|
1748
|
+
const incoming = (0, import_hooks20.useIncomingComputedData)(id);
|
|
1749
|
+
const updateNodeData = (0, import_hooks20.useUpdateNodeData)();
|
|
1750
|
+
const updateComputedData = (0, import_hooks20.useUpdateNodeComputedData)();
|
|
1751
|
+
(0, import_react27.useEffect)(() => {
|
|
1799
1752
|
if (incoming?.length > 0) {
|
|
1800
|
-
const module2 = new
|
|
1753
|
+
const module2 = new import_libnoise_simplex_ts16.ScaleBias(incoming[0].module, scale, bias);
|
|
1801
1754
|
updateComputedData(id, { module: module2 });
|
|
1802
1755
|
}
|
|
1803
1756
|
updateNodeData(id, { scale, bias });
|
|
1804
1757
|
}, [incoming, scale, bias]);
|
|
1805
|
-
return /* @__PURE__ */ (0,
|
|
1806
|
-
/* @__PURE__ */ (0,
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_layout19.NodeContainer, { id, selected, data, type, children: [
|
|
1759
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core9.Stack, { children: [
|
|
1760
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core9.Group, { children: [
|
|
1808
1761
|
"Scale:",
|
|
1809
|
-
/* @__PURE__ */ (0,
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1810
1763
|
import_core9.NumberInput,
|
|
1811
1764
|
{
|
|
1812
1765
|
size: "xs",
|
|
@@ -1817,9 +1770,9 @@ function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
|
1817
1770
|
}
|
|
1818
1771
|
)
|
|
1819
1772
|
] }),
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1773
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core9.Group, { children: [
|
|
1821
1774
|
"Bias:",
|
|
1822
|
-
/* @__PURE__ */ (0,
|
|
1775
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1823
1776
|
import_core9.NumberInput,
|
|
1824
1777
|
{
|
|
1825
1778
|
size: "xs",
|
|
@@ -1831,26 +1784,26 @@ function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
|
1831
1784
|
)
|
|
1832
1785
|
] })
|
|
1833
1786
|
] }),
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1787
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_layout19.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1835
1788
|
] });
|
|
1836
1789
|
}
|
|
1837
1790
|
var noise_scale_bias_node_default = NoiseScaleBiasNode;
|
|
1838
1791
|
|
|
1839
1792
|
// src/nodes/modifiers/noise-terrace-node.tsx
|
|
1840
|
-
var
|
|
1793
|
+
var import_layout20 = require("@awesome-flow/core/layout");
|
|
1841
1794
|
var import_core10 = require("@mantine/core");
|
|
1842
|
-
var
|
|
1843
|
-
var
|
|
1844
|
-
var
|
|
1795
|
+
var import_hooks21 = require("@awesome-flow/core/hooks");
|
|
1796
|
+
var import_react28 = require("react");
|
|
1797
|
+
var import_libnoise_simplex_ts17 = require("libnoise-simplex-ts");
|
|
1845
1798
|
var import_icons_react3 = require("@tabler/icons-react");
|
|
1846
|
-
var
|
|
1799
|
+
var import_hooks22 = require("@mantine/hooks");
|
|
1847
1800
|
var import_abstract2 = require("@awesome-flow/core/abstract");
|
|
1848
|
-
var
|
|
1801
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1849
1802
|
function NoiseTerraceNode({ id, selected, data, type }) {
|
|
1850
|
-
const incoming = (0,
|
|
1851
|
-
const updateNodeData = (0,
|
|
1852
|
-
const updateComputedData = (0,
|
|
1853
|
-
const [values, setValues] = (0,
|
|
1803
|
+
const incoming = (0, import_hooks21.useIncomingComputedData)(id);
|
|
1804
|
+
const updateNodeData = (0, import_hooks21.useUpdateNodeData)();
|
|
1805
|
+
const updateComputedData = (0, import_hooks21.useUpdateNodeComputedData)();
|
|
1806
|
+
const [values, setValues] = (0, import_react28.useState)([]);
|
|
1854
1807
|
const form = useForm({
|
|
1855
1808
|
mode: "uncontrolled",
|
|
1856
1809
|
initialValues: {
|
|
@@ -1858,7 +1811,7 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
1858
1811
|
},
|
|
1859
1812
|
validateInputOnChange: [`points.${FORM_INDEX}.input`],
|
|
1860
1813
|
clearInputErrorOnChange: true,
|
|
1861
|
-
onValuesChange: (0,
|
|
1814
|
+
onValuesChange: (0, import_react28.useCallback)((values2) => {
|
|
1862
1815
|
if (form.isValid()) {
|
|
1863
1816
|
const points = values2.points.map((v) => v.value);
|
|
1864
1817
|
setValues(points);
|
|
@@ -1867,18 +1820,18 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
1867
1820
|
form.validate();
|
|
1868
1821
|
}, [])
|
|
1869
1822
|
});
|
|
1870
|
-
(0,
|
|
1871
|
-
const points = data.points?.length ? data.points.map((v) => ({ value: v, key: (0,
|
|
1823
|
+
(0, import_react28.useEffect)(() => {
|
|
1824
|
+
const points = data.points?.length ? data.points.map((v) => ({ value: v, key: (0, import_hooks22.randomId)() })) : [1, 2].map(() => ({ value: 0, key: (0, import_hooks22.randomId)() }));
|
|
1872
1825
|
form.initialize({ points });
|
|
1873
1826
|
}, []);
|
|
1874
|
-
(0,
|
|
1827
|
+
(0, import_react28.useEffect)(() => {
|
|
1875
1828
|
if (incoming?.length && values?.length >= 2) {
|
|
1876
|
-
const module2 = new
|
|
1829
|
+
const module2 = new import_libnoise_simplex_ts17.Terrace(incoming[0].module, values);
|
|
1877
1830
|
updateComputedData(id, { module: module2 });
|
|
1878
1831
|
}
|
|
1879
1832
|
}, [values, incoming]);
|
|
1880
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0,
|
|
1881
|
-
/* @__PURE__ */ (0,
|
|
1833
|
+
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core10.Group, { mt: "xs", children: [
|
|
1834
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1882
1835
|
import_core10.NumberInput,
|
|
1883
1836
|
{
|
|
1884
1837
|
size: "xs",
|
|
@@ -1888,53 +1841,53 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
1888
1841
|
},
|
|
1889
1842
|
form.key(`points.${index}.value`)
|
|
1890
1843
|
),
|
|
1891
|
-
data.state === import_abstract2.NodeState.edit && values.length > 2 && /* @__PURE__ */ (0,
|
|
1844
|
+
data.state === import_abstract2.NodeState.edit && values.length > 2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1892
1845
|
import_core10.ActionIcon,
|
|
1893
1846
|
{
|
|
1894
1847
|
color: "red",
|
|
1895
1848
|
variant: "outline",
|
|
1896
1849
|
size: "sm",
|
|
1897
1850
|
onClick: () => form.removeListItem("points", index),
|
|
1898
|
-
children: /* @__PURE__ */ (0,
|
|
1851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons_react3.IconX, { size: "1rem" })
|
|
1899
1852
|
}
|
|
1900
1853
|
)
|
|
1901
1854
|
] }, item.key));
|
|
1902
|
-
return /* @__PURE__ */ (0,
|
|
1855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_layout20.NodeContainer, { id, selected, type, data, children: [
|
|
1903
1856
|
fields,
|
|
1904
|
-
data.state === import_abstract2.NodeState.edit && /* @__PURE__ */ (0,
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1857
|
+
data.state === import_abstract2.NodeState.edit && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1858
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core10.Space, { h: 10 }),
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1907
1860
|
import_core10.Button,
|
|
1908
1861
|
{
|
|
1909
1862
|
variant: "outline",
|
|
1910
1863
|
size: "xs",
|
|
1911
1864
|
fullWidth: true,
|
|
1912
|
-
onClick: () => form.insertListItem("points", { value: 0, key: (0,
|
|
1865
|
+
onClick: () => form.insertListItem("points", { value: 0, key: (0, import_hooks22.randomId)() }),
|
|
1913
1866
|
children: "Add control point"
|
|
1914
1867
|
}
|
|
1915
1868
|
)
|
|
1916
1869
|
] }),
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
1870
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_layout20.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1918
1871
|
] });
|
|
1919
1872
|
}
|
|
1920
1873
|
var noise_terrace_node_default = NoiseTerraceNode;
|
|
1921
1874
|
|
|
1922
1875
|
// src/nodes/output/noise-logger-node.tsx
|
|
1923
|
-
var
|
|
1924
|
-
var
|
|
1876
|
+
var import_layout21 = require("@awesome-flow/core/layout");
|
|
1877
|
+
var import_react29 = require("react");
|
|
1925
1878
|
var import_core11 = require("@mantine/core");
|
|
1926
|
-
var
|
|
1927
|
-
var
|
|
1879
|
+
var import_hooks23 = require("@awesome-flow/core/hooks");
|
|
1880
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1928
1881
|
function NoiseLoggerNode({ id, selected, data, type }) {
|
|
1929
|
-
const incoming = (0,
|
|
1930
|
-
const noise = (0,
|
|
1931
|
-
return /* @__PURE__ */ (0,
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1882
|
+
const incoming = (0, import_hooks23.useIncomingComputedData)(id);
|
|
1883
|
+
const noise = (0, import_react29.useMemo)(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
1884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_layout21.NodeContainer, { id, selected, data, type, children: [
|
|
1885
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core11.Text, { children: [
|
|
1933
1886
|
"Size: ",
|
|
1934
1887
|
noise?.length || 0
|
|
1935
1888
|
] }),
|
|
1936
|
-
/* @__PURE__ */ (0,
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
1889
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core11.Divider, { h: 5 }),
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core11.Stack, { children: noise?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core11.Text, { children: [
|
|
1938
1891
|
v.position?.x,
|
|
1939
1892
|
":",
|
|
1940
1893
|
v.position?.y,
|
|
@@ -1943,31 +1896,31 @@ function NoiseLoggerNode({ id, selected, data, type }) {
|
|
|
1943
1896
|
": ",
|
|
1944
1897
|
v.value
|
|
1945
1898
|
] }, i)) }),
|
|
1946
|
-
/* @__PURE__ */ (0,
|
|
1899
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_layout21.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1947
1900
|
] });
|
|
1948
1901
|
}
|
|
1949
1902
|
var noise_logger_node_default = NoiseLoggerNode;
|
|
1950
1903
|
|
|
1951
1904
|
// src/nodes/output/noise-output-node.tsx
|
|
1952
|
-
var
|
|
1953
|
-
var
|
|
1954
|
-
var
|
|
1905
|
+
var import_layout31 = require("@awesome-flow/core/layout");
|
|
1906
|
+
var import_react39 = require("react");
|
|
1907
|
+
var import_hooks33 = require("@awesome-flow/core/hooks");
|
|
1955
1908
|
var import_components11 = require("@awesome-flow/core/components");
|
|
1956
1909
|
var import_core18 = require("@mantine/core");
|
|
1957
1910
|
|
|
1958
1911
|
// src/nodes/output/noise-raw-texture-node.tsx
|
|
1959
|
-
var
|
|
1960
|
-
var
|
|
1961
|
-
var
|
|
1912
|
+
var import_layout22 = require("@awesome-flow/core/layout");
|
|
1913
|
+
var import_react30 = require("react");
|
|
1914
|
+
var import_hooks24 = require("@awesome-flow/core/hooks");
|
|
1962
1915
|
var import_core12 = require("@mantine/core");
|
|
1963
|
-
var
|
|
1916
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1964
1917
|
function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
1965
|
-
const updateComputedData = (0,
|
|
1966
|
-
const [dataLength, setDataLength] = (0,
|
|
1967
|
-
const [resolution, setResolution] = (0,
|
|
1968
|
-
const incoming = (0,
|
|
1969
|
-
const noise = (0,
|
|
1970
|
-
(0,
|
|
1918
|
+
const updateComputedData = (0, import_hooks24.useUpdateNodeComputedData)();
|
|
1919
|
+
const [dataLength, setDataLength] = (0, import_react30.useState)(0);
|
|
1920
|
+
const [resolution, setResolution] = (0, import_react30.useState)(0);
|
|
1921
|
+
const incoming = (0, import_hooks24.useIncomingComputedData)(id);
|
|
1922
|
+
const noise = (0, import_react30.useMemo)(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
1923
|
+
(0, import_react30.useEffect)(() => {
|
|
1971
1924
|
if (noise?.length) {
|
|
1972
1925
|
const size = Math.ceil(Math.sqrt(noise.length));
|
|
1973
1926
|
const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
|
|
@@ -1975,22 +1928,26 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
1975
1928
|
dataArray.set(colors);
|
|
1976
1929
|
setResolution(size);
|
|
1977
1930
|
setDataLength(dataArray.length);
|
|
1978
|
-
updateComputedData(id, {
|
|
1931
|
+
updateComputedData(id, {
|
|
1932
|
+
textureData: dataArray,
|
|
1933
|
+
textureResolutionX: size,
|
|
1934
|
+
textureResolutionY: size
|
|
1935
|
+
});
|
|
1979
1936
|
}
|
|
1980
1937
|
}, [noise]);
|
|
1981
|
-
return /* @__PURE__ */ (0,
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
1983
|
-
/* @__PURE__ */ (0,
|
|
1938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_layout22.NodeContainer, { id, selected, data, type, children: [
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core12.Stack, { children: [
|
|
1940
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core12.Group, { children: [
|
|
1984
1941
|
"Resolution: ",
|
|
1985
1942
|
resolution,
|
|
1986
1943
|
"x",
|
|
1987
1944
|
resolution
|
|
1988
1945
|
] }),
|
|
1989
|
-
/* @__PURE__ */ (0,
|
|
1946
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core12.Group, { children: [
|
|
1990
1947
|
"Input Length: ",
|
|
1991
1948
|
noise?.length || 0
|
|
1992
1949
|
] }),
|
|
1993
|
-
/* @__PURE__ */ (0,
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core12.Group, { children: [
|
|
1994
1951
|
"Output Length (",
|
|
1995
1952
|
resolution,
|
|
1996
1953
|
"*",
|
|
@@ -1999,55 +1956,55 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
1999
1956
|
dataLength
|
|
2000
1957
|
] })
|
|
2001
1958
|
] }),
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
1959
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_layout22.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2003
1960
|
] });
|
|
2004
1961
|
}
|
|
2005
1962
|
var noise_raw_texture_node_default = NoiseRawTextureNode;
|
|
2006
1963
|
|
|
2007
1964
|
// src/nodes/output/positions-logger-node.tsx
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
1965
|
+
var import_layout23 = require("@awesome-flow/core/layout");
|
|
1966
|
+
var import_react31 = require("react");
|
|
2010
1967
|
var import_core13 = require("@mantine/core");
|
|
2011
|
-
var
|
|
2012
|
-
var
|
|
1968
|
+
var import_hooks25 = require("@awesome-flow/core/hooks");
|
|
1969
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2013
1970
|
function PositionsLoggerNode({ id, selected, data, type }) {
|
|
2014
|
-
const incoming = (0,
|
|
2015
|
-
const positions = (0,
|
|
1971
|
+
const incoming = (0, import_hooks25.useIncomingComputedData)(id);
|
|
1972
|
+
const positions = (0, import_react31.useMemo)(() => {
|
|
2016
1973
|
return incoming?.map((p) => p.positions).flat();
|
|
2017
1974
|
}, [incoming]);
|
|
2018
|
-
return /* @__PURE__ */ (0,
|
|
2019
|
-
/* @__PURE__ */ (0,
|
|
1975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_layout23.NodeContainer, { id, selected, data, type, children: [
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core13.Text, { children: [
|
|
2020
1977
|
"Size: ",
|
|
2021
1978
|
positions?.length || 0
|
|
2022
1979
|
] }),
|
|
2023
|
-
/* @__PURE__ */ (0,
|
|
2024
|
-
/* @__PURE__ */ (0,
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core13.Divider, { h: 5 }),
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core13.Stack, { children: positions?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core13.Text, { children: [
|
|
2025
1982
|
v.x,
|
|
2026
1983
|
":",
|
|
2027
1984
|
v.y,
|
|
2028
1985
|
":",
|
|
2029
1986
|
v.z
|
|
2030
1987
|
] }, i)) }),
|
|
2031
|
-
/* @__PURE__ */ (0,
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_layout23.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2032
1989
|
] });
|
|
2033
1990
|
}
|
|
2034
1991
|
var positions_logger_node_default = PositionsLoggerNode;
|
|
2035
1992
|
|
|
2036
1993
|
// src/nodes/selectors/noise-blend-node.tsx
|
|
2037
|
-
var
|
|
2038
|
-
var
|
|
2039
|
-
var
|
|
2040
|
-
var
|
|
1994
|
+
var import_layout24 = require("@awesome-flow/core/layout");
|
|
1995
|
+
var import_react32 = require("react");
|
|
1996
|
+
var import_hooks26 = require("@awesome-flow/core/hooks");
|
|
1997
|
+
var import_libnoise_simplex_ts18 = require("libnoise-simplex-ts");
|
|
2041
1998
|
var import_components7 = require("@awesome-flow/core/components");
|
|
2042
|
-
var
|
|
1999
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2043
2000
|
function NoiseBlendNode({ id, selected, data, type }) {
|
|
2044
|
-
const updateComputedData = (0,
|
|
2045
|
-
const onDataUpdated = (0,
|
|
2001
|
+
const updateComputedData = (0, import_hooks26.useUpdateNodeComputedData)();
|
|
2002
|
+
const onDataUpdated = (0, import_react32.useCallback)(
|
|
2046
2003
|
(incomingData) => {
|
|
2047
2004
|
const incomingSources = incomingData["source" /* source */];
|
|
2048
2005
|
const incomingControl = incomingData["control" /* control */];
|
|
2049
2006
|
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2050
|
-
const module2 = new
|
|
2007
|
+
const module2 = new import_libnoise_simplex_ts18.Blend(
|
|
2051
2008
|
incomingSources[0].module,
|
|
2052
2009
|
incomingSources[1].module,
|
|
2053
2010
|
incomingControl[0].module
|
|
@@ -2057,8 +2014,8 @@ function NoiseBlendNode({ id, selected, data, type }) {
|
|
|
2057
2014
|
},
|
|
2058
2015
|
[]
|
|
2059
2016
|
);
|
|
2060
|
-
return /* @__PURE__ */ (0,
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_layout24.NodeContainer, { id, selected, data, type, children: [
|
|
2018
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2062
2019
|
import_components7.HandlesIncomingDataStatus,
|
|
2063
2020
|
{
|
|
2064
2021
|
nodeId: id,
|
|
@@ -2069,34 +2026,34 @@ function NoiseBlendNode({ id, selected, data, type }) {
|
|
|
2069
2026
|
resetComputedData: true
|
|
2070
2027
|
}
|
|
2071
2028
|
),
|
|
2072
|
-
/* @__PURE__ */ (0,
|
|
2029
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_layout24.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2073
2030
|
] });
|
|
2074
2031
|
}
|
|
2075
2032
|
var noise_blend_node_default = NoiseBlendNode;
|
|
2076
2033
|
|
|
2077
2034
|
// src/nodes/selectors/noise-select-node.tsx
|
|
2078
|
-
var
|
|
2079
|
-
var
|
|
2080
|
-
var
|
|
2081
|
-
var
|
|
2035
|
+
var import_layout25 = require("@awesome-flow/core/layout");
|
|
2036
|
+
var import_react33 = require("react");
|
|
2037
|
+
var import_hooks27 = require("@awesome-flow/core/hooks");
|
|
2038
|
+
var import_libnoise_simplex_ts19 = require("libnoise-simplex-ts");
|
|
2082
2039
|
var import_core14 = require("@mantine/core");
|
|
2083
2040
|
var import_components8 = require("@awesome-flow/core/components");
|
|
2084
|
-
var
|
|
2041
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2085
2042
|
function NoiseSelectNode({ id, selected, data, type }) {
|
|
2086
|
-
const [edgeFalloff, setEdgeFalloff] = (0,
|
|
2087
|
-
const [lowerBound, setLowerBound] = (0,
|
|
2088
|
-
const [upperBound, setUpperBound] = (0,
|
|
2089
|
-
const updateNodeData = (0,
|
|
2090
|
-
const updateComputedData = (0,
|
|
2091
|
-
(0,
|
|
2043
|
+
const [edgeFalloff, setEdgeFalloff] = (0, import_react33.useState)(data.edgeFalloff);
|
|
2044
|
+
const [lowerBound, setLowerBound] = (0, import_react33.useState)(data.lowerBound);
|
|
2045
|
+
const [upperBound, setUpperBound] = (0, import_react33.useState)(data.upperBound);
|
|
2046
|
+
const updateNodeData = (0, import_hooks27.useUpdateNodeData)();
|
|
2047
|
+
const updateComputedData = (0, import_hooks27.useUpdateNodeComputedData)();
|
|
2048
|
+
(0, import_react33.useEffect)(() => {
|
|
2092
2049
|
updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
|
|
2093
2050
|
}, [edgeFalloff, lowerBound, upperBound]);
|
|
2094
|
-
const onDataUpdated = (0,
|
|
2051
|
+
const onDataUpdated = (0, import_react33.useCallback)(
|
|
2095
2052
|
(incomingData) => {
|
|
2096
2053
|
const incomingSources = incomingData["source" /* source */];
|
|
2097
2054
|
const incomingControl = incomingData["control" /* control */];
|
|
2098
2055
|
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2099
|
-
const module2 = new
|
|
2056
|
+
const module2 = new import_libnoise_simplex_ts19.Select(
|
|
2100
2057
|
incomingSources[0].module,
|
|
2101
2058
|
incomingSources[1].module,
|
|
2102
2059
|
incomingControl[0].module,
|
|
@@ -2109,11 +2066,11 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2109
2066
|
},
|
|
2110
2067
|
[]
|
|
2111
2068
|
);
|
|
2112
|
-
return /* @__PURE__ */ (0,
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
2114
|
-
/* @__PURE__ */ (0,
|
|
2069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_layout25.NodeContainer, { id, selected, data, type, children: [
|
|
2070
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core14.Stack, { children: [
|
|
2071
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core14.Group, { children: [
|
|
2115
2072
|
"Edge Falloff:",
|
|
2116
|
-
/* @__PURE__ */ (0,
|
|
2073
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2117
2074
|
import_core14.NumberInput,
|
|
2118
2075
|
{
|
|
2119
2076
|
size: "xs",
|
|
@@ -2124,9 +2081,9 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2124
2081
|
}
|
|
2125
2082
|
)
|
|
2126
2083
|
] }),
|
|
2127
|
-
/* @__PURE__ */ (0,
|
|
2084
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core14.Group, { children: [
|
|
2128
2085
|
"Lower Bound:",
|
|
2129
|
-
/* @__PURE__ */ (0,
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2130
2087
|
import_core14.NumberInput,
|
|
2131
2088
|
{
|
|
2132
2089
|
size: "xs",
|
|
@@ -2137,9 +2094,9 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2137
2094
|
}
|
|
2138
2095
|
)
|
|
2139
2096
|
] }),
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core14.Group, { children: [
|
|
2141
2098
|
"Upper Bound:",
|
|
2142
|
-
/* @__PURE__ */ (0,
|
|
2099
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2143
2100
|
import_core14.NumberInput,
|
|
2144
2101
|
{
|
|
2145
2102
|
size: "xs",
|
|
@@ -2150,7 +2107,7 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2150
2107
|
}
|
|
2151
2108
|
)
|
|
2152
2109
|
] }),
|
|
2153
|
-
/* @__PURE__ */ (0,
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2154
2111
|
import_components8.HandlesIncomingDataStatus,
|
|
2155
2112
|
{
|
|
2156
2113
|
nodeId: id,
|
|
@@ -2162,28 +2119,28 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2162
2119
|
}
|
|
2163
2120
|
)
|
|
2164
2121
|
] }),
|
|
2165
|
-
/* @__PURE__ */ (0,
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_layout25.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2166
2123
|
] });
|
|
2167
2124
|
}
|
|
2168
2125
|
var noise_select_node_default = NoiseSelectNode;
|
|
2169
2126
|
|
|
2170
2127
|
// src/nodes/transformers/noise-displace-node.tsx
|
|
2171
|
-
var
|
|
2172
|
-
var
|
|
2173
|
-
var
|
|
2174
|
-
var
|
|
2128
|
+
var import_layout26 = require("@awesome-flow/core/layout");
|
|
2129
|
+
var import_react34 = require("react");
|
|
2130
|
+
var import_hooks28 = require("@awesome-flow/core/hooks");
|
|
2131
|
+
var import_libnoise_simplex_ts20 = require("libnoise-simplex-ts");
|
|
2175
2132
|
var import_components9 = require("@awesome-flow/core/components");
|
|
2176
|
-
var
|
|
2133
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2177
2134
|
function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
2178
|
-
const updateComputedData = (0,
|
|
2179
|
-
const onDataUpdated = (0,
|
|
2135
|
+
const updateComputedData = (0, import_hooks28.useUpdateNodeComputedData)();
|
|
2136
|
+
const onDataUpdated = (0, import_react34.useCallback)(
|
|
2180
2137
|
(handleData) => {
|
|
2181
2138
|
const sourceModule = handleData["source" /* sourceModule */];
|
|
2182
2139
|
const xModule = handleData["x-module" /* xModule */];
|
|
2183
2140
|
const yModule = handleData["y-module" /* yModule */];
|
|
2184
2141
|
const zModule = handleData["z-module" /* zModule */];
|
|
2185
2142
|
if (sourceModule && xModule && yModule && zModule) {
|
|
2186
|
-
const module2 = new
|
|
2143
|
+
const module2 = new import_libnoise_simplex_ts20.Displace(
|
|
2187
2144
|
sourceModule[0].module,
|
|
2188
2145
|
xModule[0].module,
|
|
2189
2146
|
yModule[0].module,
|
|
@@ -2194,8 +2151,8 @@ function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
|
2194
2151
|
},
|
|
2195
2152
|
[]
|
|
2196
2153
|
);
|
|
2197
|
-
return /* @__PURE__ */ (0,
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_layout26.NodeContainer, { id, selected, data, type, children: [
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2199
2156
|
import_components9.HandlesIncomingDataStatus,
|
|
2200
2157
|
{
|
|
2201
2158
|
nodeId: id,
|
|
@@ -2206,42 +2163,42 @@ function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
|
2206
2163
|
resetComputedData: true
|
|
2207
2164
|
}
|
|
2208
2165
|
),
|
|
2209
|
-
/* @__PURE__ */ (0,
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_layout26.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2210
2167
|
] });
|
|
2211
2168
|
}
|
|
2212
2169
|
var noise_displace_node_default = NoiseDisplaceNode;
|
|
2213
2170
|
|
|
2214
2171
|
// src/nodes/transformers/noise-rotate-point-node.tsx
|
|
2215
|
-
var
|
|
2216
|
-
var
|
|
2217
|
-
var
|
|
2172
|
+
var import_layout27 = require("@awesome-flow/core/layout");
|
|
2173
|
+
var import_react35 = require("react");
|
|
2174
|
+
var import_hooks29 = require("@awesome-flow/core/hooks");
|
|
2218
2175
|
var import_core15 = require("@mantine/core");
|
|
2219
|
-
var
|
|
2220
|
-
var
|
|
2176
|
+
var import_libnoise_simplex_ts21 = require("libnoise-simplex-ts");
|
|
2177
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2221
2178
|
function NoiseRotatePointNode({
|
|
2222
2179
|
id,
|
|
2223
2180
|
selected,
|
|
2224
2181
|
data,
|
|
2225
2182
|
type
|
|
2226
2183
|
}) {
|
|
2227
|
-
const [xAngle, setXAngle] = (0,
|
|
2228
|
-
const [yAngle, setYAngle] = (0,
|
|
2229
|
-
const [zAngle, setZAngle] = (0,
|
|
2230
|
-
const incoming = (0,
|
|
2231
|
-
const updateNodeData = (0,
|
|
2232
|
-
const updateComputedData = (0,
|
|
2233
|
-
(0,
|
|
2184
|
+
const [xAngle, setXAngle] = (0, import_react35.useState)(data.xAngle);
|
|
2185
|
+
const [yAngle, setYAngle] = (0, import_react35.useState)(data.yAngle);
|
|
2186
|
+
const [zAngle, setZAngle] = (0, import_react35.useState)(data.zAngle);
|
|
2187
|
+
const incoming = (0, import_hooks29.useIncomingComputedData)(id);
|
|
2188
|
+
const updateNodeData = (0, import_hooks29.useUpdateNodeData)();
|
|
2189
|
+
const updateComputedData = (0, import_hooks29.useUpdateNodeComputedData)();
|
|
2190
|
+
(0, import_react35.useEffect)(() => {
|
|
2234
2191
|
if (incoming?.length) {
|
|
2235
|
-
const module2 = new
|
|
2192
|
+
const module2 = new import_libnoise_simplex_ts21.RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
|
|
2236
2193
|
updateComputedData(id, { module: module2 });
|
|
2237
2194
|
}
|
|
2238
2195
|
updateNodeData(id, { xAngle, yAngle, zAngle });
|
|
2239
2196
|
}, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
|
|
2240
|
-
return /* @__PURE__ */ (0,
|
|
2241
|
-
/* @__PURE__ */ (0,
|
|
2242
|
-
/* @__PURE__ */ (0,
|
|
2197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_layout27.NodeContainer, { id, selected, data, type, children: [
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core15.Stack, { children: [
|
|
2199
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core15.Group, { children: [
|
|
2243
2200
|
"X Angle:",
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2201
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2245
2202
|
import_core15.NumberInput,
|
|
2246
2203
|
{
|
|
2247
2204
|
size: "xs",
|
|
@@ -2252,9 +2209,9 @@ function NoiseRotatePointNode({
|
|
|
2252
2209
|
}
|
|
2253
2210
|
)
|
|
2254
2211
|
] }),
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2212
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core15.Group, { children: [
|
|
2256
2213
|
"Y Angle:",
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2214
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2258
2215
|
import_core15.NumberInput,
|
|
2259
2216
|
{
|
|
2260
2217
|
size: "xs",
|
|
@@ -2265,9 +2222,9 @@ function NoiseRotatePointNode({
|
|
|
2265
2222
|
}
|
|
2266
2223
|
)
|
|
2267
2224
|
] }),
|
|
2268
|
-
/* @__PURE__ */ (0,
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core15.Group, { children: [
|
|
2269
2226
|
"Z Angle:",
|
|
2270
|
-
/* @__PURE__ */ (0,
|
|
2227
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2271
2228
|
import_core15.NumberInput,
|
|
2272
2229
|
{
|
|
2273
2230
|
size: "xs",
|
|
@@ -2279,42 +2236,42 @@ function NoiseRotatePointNode({
|
|
|
2279
2236
|
)
|
|
2280
2237
|
] })
|
|
2281
2238
|
] }),
|
|
2282
|
-
/* @__PURE__ */ (0,
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_layout27.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2283
2240
|
] });
|
|
2284
2241
|
}
|
|
2285
2242
|
var noise_rotate_point_node_default = NoiseRotatePointNode;
|
|
2286
2243
|
|
|
2287
2244
|
// src/nodes/transformers/noise-scale-point-node.tsx
|
|
2288
|
-
var
|
|
2289
|
-
var
|
|
2290
|
-
var
|
|
2245
|
+
var import_layout28 = require("@awesome-flow/core/layout");
|
|
2246
|
+
var import_react36 = require("react");
|
|
2247
|
+
var import_hooks30 = require("@awesome-flow/core/hooks");
|
|
2291
2248
|
var import_core16 = require("@mantine/core");
|
|
2292
|
-
var
|
|
2293
|
-
var
|
|
2249
|
+
var import_libnoise_simplex_ts22 = require("libnoise-simplex-ts");
|
|
2250
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2294
2251
|
function NoiseScalePointNode({
|
|
2295
2252
|
id,
|
|
2296
2253
|
selected,
|
|
2297
2254
|
data,
|
|
2298
2255
|
type
|
|
2299
2256
|
}) {
|
|
2300
|
-
const [xScale, setXScale] = (0,
|
|
2301
|
-
const [yScale, setYScale] = (0,
|
|
2302
|
-
const [zScale, setZScale] = (0,
|
|
2303
|
-
const incoming = (0,
|
|
2304
|
-
const updateNodeData = (0,
|
|
2305
|
-
const updateComputedData = (0,
|
|
2306
|
-
(0,
|
|
2257
|
+
const [xScale, setXScale] = (0, import_react36.useState)(data.xScale);
|
|
2258
|
+
const [yScale, setYScale] = (0, import_react36.useState)(data.yScale);
|
|
2259
|
+
const [zScale, setZScale] = (0, import_react36.useState)(data.zScale);
|
|
2260
|
+
const incoming = (0, import_hooks30.useIncomingComputedData)(id);
|
|
2261
|
+
const updateNodeData = (0, import_hooks30.useUpdateNodeData)();
|
|
2262
|
+
const updateComputedData = (0, import_hooks30.useUpdateNodeComputedData)();
|
|
2263
|
+
(0, import_react36.useEffect)(() => {
|
|
2307
2264
|
if (incoming?.length) {
|
|
2308
|
-
const module2 = new
|
|
2265
|
+
const module2 = new import_libnoise_simplex_ts22.ScalePoint(incoming[0].module, xScale, yScale, zScale);
|
|
2309
2266
|
updateComputedData(id, { module: module2 });
|
|
2310
2267
|
}
|
|
2311
2268
|
updateNodeData(id, { xScale, yScale, zScale });
|
|
2312
2269
|
}, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
|
|
2313
|
-
return /* @__PURE__ */ (0,
|
|
2314
|
-
/* @__PURE__ */ (0,
|
|
2315
|
-
/* @__PURE__ */ (0,
|
|
2270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_layout28.NodeContainer, { id, selected, data, type, children: [
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core16.Stack, { children: [
|
|
2272
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core16.Group, { children: [
|
|
2316
2273
|
"X Scale:",
|
|
2317
|
-
/* @__PURE__ */ (0,
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2318
2275
|
import_core16.NumberInput,
|
|
2319
2276
|
{
|
|
2320
2277
|
size: "xs",
|
|
@@ -2325,9 +2282,9 @@ function NoiseScalePointNode({
|
|
|
2325
2282
|
}
|
|
2326
2283
|
)
|
|
2327
2284
|
] }),
|
|
2328
|
-
/* @__PURE__ */ (0,
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core16.Group, { children: [
|
|
2329
2286
|
"Y Scale:",
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
2287
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2331
2288
|
import_core16.NumberInput,
|
|
2332
2289
|
{
|
|
2333
2290
|
size: "xs",
|
|
@@ -2338,9 +2295,9 @@ function NoiseScalePointNode({
|
|
|
2338
2295
|
}
|
|
2339
2296
|
)
|
|
2340
2297
|
] }),
|
|
2341
|
-
/* @__PURE__ */ (0,
|
|
2298
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core16.Group, { children: [
|
|
2342
2299
|
"Z Scale:",
|
|
2343
|
-
/* @__PURE__ */ (0,
|
|
2300
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2344
2301
|
import_core16.NumberInput,
|
|
2345
2302
|
{
|
|
2346
2303
|
size: "xs",
|
|
@@ -2352,42 +2309,42 @@ function NoiseScalePointNode({
|
|
|
2352
2309
|
)
|
|
2353
2310
|
] })
|
|
2354
2311
|
] }),
|
|
2355
|
-
/* @__PURE__ */ (0,
|
|
2312
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_layout28.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2356
2313
|
] });
|
|
2357
2314
|
}
|
|
2358
2315
|
var noise_scale_point_node_default = NoiseScalePointNode;
|
|
2359
2316
|
|
|
2360
2317
|
// src/nodes/transformers/noise-translate-point-node.tsx
|
|
2361
|
-
var
|
|
2362
|
-
var
|
|
2363
|
-
var
|
|
2318
|
+
var import_layout29 = require("@awesome-flow/core/layout");
|
|
2319
|
+
var import_react37 = require("react");
|
|
2320
|
+
var import_hooks31 = require("@awesome-flow/core/hooks");
|
|
2364
2321
|
var import_core17 = require("@mantine/core");
|
|
2365
|
-
var
|
|
2366
|
-
var
|
|
2322
|
+
var import_libnoise_simplex_ts23 = require("libnoise-simplex-ts");
|
|
2323
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2367
2324
|
function NoiseTranslatePointNode({
|
|
2368
2325
|
id,
|
|
2369
2326
|
selected,
|
|
2370
2327
|
data,
|
|
2371
2328
|
type
|
|
2372
2329
|
}) {
|
|
2373
|
-
const [translateX, setTranslateX] = (0,
|
|
2374
|
-
const [translateY, setTranslateY] = (0,
|
|
2375
|
-
const [translateZ, setTranslateZ] = (0,
|
|
2376
|
-
const incoming = (0,
|
|
2377
|
-
const updateNodeData = (0,
|
|
2378
|
-
const updateComputedData = (0,
|
|
2379
|
-
(0,
|
|
2330
|
+
const [translateX, setTranslateX] = (0, import_react37.useState)(data.translateX);
|
|
2331
|
+
const [translateY, setTranslateY] = (0, import_react37.useState)(data.translateY);
|
|
2332
|
+
const [translateZ, setTranslateZ] = (0, import_react37.useState)(data.translateZ);
|
|
2333
|
+
const incoming = (0, import_hooks31.useIncomingComputedData)(id);
|
|
2334
|
+
const updateNodeData = (0, import_hooks31.useUpdateNodeData)();
|
|
2335
|
+
const updateComputedData = (0, import_hooks31.useUpdateNodeComputedData)();
|
|
2336
|
+
(0, import_react37.useEffect)(() => {
|
|
2380
2337
|
if (incoming?.length) {
|
|
2381
|
-
const module2 = new
|
|
2338
|
+
const module2 = new import_libnoise_simplex_ts23.TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
|
|
2382
2339
|
updateComputedData(id, { module: module2 });
|
|
2383
2340
|
}
|
|
2384
2341
|
updateNodeData(id, { translateX, translateY, translateZ });
|
|
2385
2342
|
}, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
|
|
2386
|
-
return /* @__PURE__ */ (0,
|
|
2387
|
-
/* @__PURE__ */ (0,
|
|
2388
|
-
/* @__PURE__ */ (0,
|
|
2343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_layout29.NodeContainer, { id, selected, data, type, children: [
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core17.Stack, { children: [
|
|
2345
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core17.Group, { children: [
|
|
2389
2346
|
"Translate X:",
|
|
2390
|
-
/* @__PURE__ */ (0,
|
|
2347
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2391
2348
|
import_core17.NumberInput,
|
|
2392
2349
|
{
|
|
2393
2350
|
size: "xs",
|
|
@@ -2398,9 +2355,9 @@ function NoiseTranslatePointNode({
|
|
|
2398
2355
|
}
|
|
2399
2356
|
)
|
|
2400
2357
|
] }),
|
|
2401
|
-
/* @__PURE__ */ (0,
|
|
2358
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core17.Group, { children: [
|
|
2402
2359
|
"Translate Y:",
|
|
2403
|
-
/* @__PURE__ */ (0,
|
|
2360
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2404
2361
|
import_core17.NumberInput,
|
|
2405
2362
|
{
|
|
2406
2363
|
size: "xs",
|
|
@@ -2411,9 +2368,9 @@ function NoiseTranslatePointNode({
|
|
|
2411
2368
|
}
|
|
2412
2369
|
)
|
|
2413
2370
|
] }),
|
|
2414
|
-
/* @__PURE__ */ (0,
|
|
2371
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core17.Group, { children: [
|
|
2415
2372
|
"Translate Z:",
|
|
2416
|
-
/* @__PURE__ */ (0,
|
|
2373
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2417
2374
|
import_core17.NumberInput,
|
|
2418
2375
|
{
|
|
2419
2376
|
size: "xs",
|
|
@@ -2425,33 +2382,33 @@ function NoiseTranslatePointNode({
|
|
|
2425
2382
|
)
|
|
2426
2383
|
] })
|
|
2427
2384
|
] }),
|
|
2428
|
-
/* @__PURE__ */ (0,
|
|
2385
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_layout29.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2429
2386
|
] });
|
|
2430
2387
|
}
|
|
2431
2388
|
var noise_translate_point_node_default = NoiseTranslatePointNode;
|
|
2432
2389
|
|
|
2433
2390
|
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
2434
|
-
var
|
|
2435
|
-
var
|
|
2436
|
-
var
|
|
2437
|
-
var
|
|
2391
|
+
var import_layout30 = require("@awesome-flow/core/layout");
|
|
2392
|
+
var import_react38 = require("react");
|
|
2393
|
+
var import_hooks32 = require("@awesome-flow/core/hooks");
|
|
2394
|
+
var import_libnoise_simplex_ts24 = require("libnoise-simplex-ts");
|
|
2438
2395
|
var import_components10 = require("@awesome-flow/core/components");
|
|
2439
|
-
var
|
|
2396
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2440
2397
|
function NoiseTurbulenceNode({
|
|
2441
2398
|
id,
|
|
2442
2399
|
selected,
|
|
2443
2400
|
data,
|
|
2444
2401
|
type
|
|
2445
2402
|
}) {
|
|
2446
|
-
const [properties, setProperties] = (0,
|
|
2447
|
-
const incoming = (0,
|
|
2448
|
-
const updateComputedData = (0,
|
|
2449
|
-
const onPropertiesChange = (0,
|
|
2403
|
+
const [properties, setProperties] = (0, import_react38.useState)(null);
|
|
2404
|
+
const incoming = (0, import_hooks32.useIncomingComputedData)(id);
|
|
2405
|
+
const updateComputedData = (0, import_hooks32.useUpdateNodeComputedData)();
|
|
2406
|
+
const onPropertiesChange = (0, import_react38.useCallback)((props) => {
|
|
2450
2407
|
setProperties(props);
|
|
2451
2408
|
}, []);
|
|
2452
|
-
(0,
|
|
2409
|
+
(0, import_react38.useEffect)(() => {
|
|
2453
2410
|
if (incoming?.length && properties) {
|
|
2454
|
-
const module2 = new
|
|
2411
|
+
const module2 = new import_libnoise_simplex_ts24.Turbulence(
|
|
2455
2412
|
incoming[0].module,
|
|
2456
2413
|
properties.frequency.value,
|
|
2457
2414
|
properties.power.value,
|
|
@@ -2461,9 +2418,9 @@ function NoiseTurbulenceNode({
|
|
|
2461
2418
|
updateComputedData(id, { module: module2 });
|
|
2462
2419
|
}
|
|
2463
2420
|
}, [id, incoming, properties]);
|
|
2464
|
-
return /* @__PURE__ */ (0,
|
|
2465
|
-
/* @__PURE__ */ (0,
|
|
2466
|
-
/* @__PURE__ */ (0,
|
|
2421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_layout30.NodeContainer, { id, selected, data, type, children: [
|
|
2422
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components10.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
2423
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_layout30.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2467
2424
|
] });
|
|
2468
2425
|
}
|
|
2469
2426
|
var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
@@ -2596,34 +2553,9 @@ var NoiseRidgedMultiNodeTemplateFactory = class {
|
|
|
2596
2553
|
};
|
|
2597
2554
|
};
|
|
2598
2555
|
|
|
2599
|
-
// src/templates/generators/noise-
|
|
2556
|
+
// src/templates/generators/noise-spheres-template.ts
|
|
2600
2557
|
var import_abstract8 = require("@awesome-flow/core/abstract");
|
|
2601
2558
|
var import_system6 = require("@xyflow/system");
|
|
2602
|
-
var NoiseSimplexNodeTemplateFactory = class {
|
|
2603
|
-
template = {
|
|
2604
|
-
type: "noise-simplex" /* noiseSimplex */,
|
|
2605
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2606
|
-
data: {
|
|
2607
|
-
title: "Simplex Noise"
|
|
2608
|
-
},
|
|
2609
|
-
handles: [
|
|
2610
|
-
{
|
|
2611
|
-
position: import_system6.Position.Left,
|
|
2612
|
-
dataType: import_abstract8.CoreHandleType.variableProperty,
|
|
2613
|
-
connection: "target"
|
|
2614
|
-
},
|
|
2615
|
-
{
|
|
2616
|
-
position: import_system6.Position.Right,
|
|
2617
|
-
dataType: "module" /* module */,
|
|
2618
|
-
connection: "source"
|
|
2619
|
-
}
|
|
2620
|
-
]
|
|
2621
|
-
};
|
|
2622
|
-
};
|
|
2623
|
-
|
|
2624
|
-
// src/templates/generators/noise-spheres-template.ts
|
|
2625
|
-
var import_abstract9 = require("@awesome-flow/core/abstract");
|
|
2626
|
-
var import_system7 = require("@xyflow/system");
|
|
2627
2559
|
var NoiseSpheresNodeTemplateFactory = class {
|
|
2628
2560
|
template = {
|
|
2629
2561
|
type: "noise-spheres" /* noiseSpheres */,
|
|
@@ -2634,12 +2566,12 @@ var NoiseSpheresNodeTemplateFactory = class {
|
|
|
2634
2566
|
},
|
|
2635
2567
|
handles: [
|
|
2636
2568
|
{
|
|
2637
|
-
position:
|
|
2638
|
-
dataType:
|
|
2569
|
+
position: import_system6.Position.Left,
|
|
2570
|
+
dataType: import_abstract8.CoreHandleType.variableProperty,
|
|
2639
2571
|
connection: "target"
|
|
2640
2572
|
},
|
|
2641
2573
|
{
|
|
2642
|
-
position:
|
|
2574
|
+
position: import_system6.Position.Right,
|
|
2643
2575
|
dataType: "module" /* module */,
|
|
2644
2576
|
connection: "source"
|
|
2645
2577
|
}
|
|
@@ -2648,8 +2580,8 @@ var NoiseSpheresNodeTemplateFactory = class {
|
|
|
2648
2580
|
};
|
|
2649
2581
|
|
|
2650
2582
|
// src/templates/generators/noise-voronoi-template.ts
|
|
2651
|
-
var
|
|
2652
|
-
var
|
|
2583
|
+
var import_abstract9 = require("@awesome-flow/core/abstract");
|
|
2584
|
+
var import_system7 = require("@xyflow/system");
|
|
2653
2585
|
var NoiseVoronoiNodeTemplateFactory = class {
|
|
2654
2586
|
template = {
|
|
2655
2587
|
type: "noise-voronoi" /* noiseVoronoi */,
|
|
@@ -2663,12 +2595,12 @@ var NoiseVoronoiNodeTemplateFactory = class {
|
|
|
2663
2595
|
},
|
|
2664
2596
|
handles: [
|
|
2665
2597
|
{
|
|
2666
|
-
position:
|
|
2667
|
-
dataType:
|
|
2598
|
+
position: import_system7.Position.Left,
|
|
2599
|
+
dataType: import_abstract9.CoreHandleType.variableProperty,
|
|
2668
2600
|
connection: "target"
|
|
2669
2601
|
},
|
|
2670
2602
|
{
|
|
2671
|
-
position:
|
|
2603
|
+
position: import_system7.Position.Right,
|
|
2672
2604
|
dataType: "module" /* module */,
|
|
2673
2605
|
connection: "source"
|
|
2674
2606
|
}
|
|
@@ -2677,7 +2609,7 @@ var NoiseVoronoiNodeTemplateFactory = class {
|
|
|
2677
2609
|
};
|
|
2678
2610
|
|
|
2679
2611
|
// src/templates/generators/position-const-template.ts
|
|
2680
|
-
var
|
|
2612
|
+
var import_system8 = require("@xyflow/system");
|
|
2681
2613
|
var PositionConstNodeTemplateFactory = class {
|
|
2682
2614
|
template = {
|
|
2683
2615
|
type: "position" /* position */,
|
|
@@ -2688,7 +2620,7 @@ var PositionConstNodeTemplateFactory = class {
|
|
|
2688
2620
|
},
|
|
2689
2621
|
handles: [
|
|
2690
2622
|
{
|
|
2691
|
-
position:
|
|
2623
|
+
position: import_system8.Position.Right,
|
|
2692
2624
|
dataType: "position" /* position */,
|
|
2693
2625
|
connection: "source"
|
|
2694
2626
|
}
|
|
@@ -2697,7 +2629,7 @@ var PositionConstNodeTemplateFactory = class {
|
|
|
2697
2629
|
};
|
|
2698
2630
|
|
|
2699
2631
|
// src/templates/generators/position-grid-template.ts
|
|
2700
|
-
var
|
|
2632
|
+
var import_system9 = require("@xyflow/system");
|
|
2701
2633
|
var PositionGridNodeTemplateFactory = class {
|
|
2702
2634
|
template = {
|
|
2703
2635
|
type: "grid" /* grid */,
|
|
@@ -2709,7 +2641,7 @@ var PositionGridNodeTemplateFactory = class {
|
|
|
2709
2641
|
},
|
|
2710
2642
|
handles: [
|
|
2711
2643
|
{
|
|
2712
|
-
position:
|
|
2644
|
+
position: import_system9.Position.Right,
|
|
2713
2645
|
dataType: "position" /* position */,
|
|
2714
2646
|
connection: "source"
|
|
2715
2647
|
}
|
|
@@ -2719,7 +2651,7 @@ var PositionGridNodeTemplateFactory = class {
|
|
|
2719
2651
|
|
|
2720
2652
|
// src/templates/modifiers/noise-normalize-template.ts
|
|
2721
2653
|
var import_utils = require("@awesome-flow/core/utils");
|
|
2722
|
-
var
|
|
2654
|
+
var import_system10 = require("@xyflow/system");
|
|
2723
2655
|
var NoiseNormalizeNodeTemplateFactory = class {
|
|
2724
2656
|
template = {
|
|
2725
2657
|
id: import_utils.IDGenerator.template(),
|
|
@@ -2732,13 +2664,13 @@ var NoiseNormalizeNodeTemplateFactory = class {
|
|
|
2732
2664
|
},
|
|
2733
2665
|
handles: [
|
|
2734
2666
|
{
|
|
2735
|
-
position:
|
|
2667
|
+
position: import_system10.Position.Left,
|
|
2736
2668
|
dataType: "module" /* module */,
|
|
2737
2669
|
connection: "target",
|
|
2738
2670
|
maxConnections: 1
|
|
2739
2671
|
},
|
|
2740
2672
|
{
|
|
2741
|
-
position:
|
|
2673
|
+
position: import_system10.Position.Right,
|
|
2742
2674
|
dataType: "module" /* module */,
|
|
2743
2675
|
connection: "source"
|
|
2744
2676
|
}
|
|
@@ -2747,7 +2679,7 @@ var NoiseNormalizeNodeTemplateFactory = class {
|
|
|
2747
2679
|
};
|
|
2748
2680
|
|
|
2749
2681
|
// src/templates/output/noise-logger-template.ts
|
|
2750
|
-
var
|
|
2682
|
+
var import_system11 = require("@xyflow/system");
|
|
2751
2683
|
var NoiseLoggerNodeTemplateFactory = class {
|
|
2752
2684
|
template = {
|
|
2753
2685
|
type: "noise-logger" /* noiseLogger */,
|
|
@@ -2757,7 +2689,7 @@ var NoiseLoggerNodeTemplateFactory = class {
|
|
|
2757
2689
|
},
|
|
2758
2690
|
handles: [
|
|
2759
2691
|
{
|
|
2760
|
-
position:
|
|
2692
|
+
position: import_system11.Position.Left,
|
|
2761
2693
|
dataType: "noise" /* noise */,
|
|
2762
2694
|
connection: "target"
|
|
2763
2695
|
}
|
|
@@ -2766,7 +2698,7 @@ var NoiseLoggerNodeTemplateFactory = class {
|
|
|
2766
2698
|
};
|
|
2767
2699
|
|
|
2768
2700
|
// src/templates/output/noise-raw-texture-template.ts
|
|
2769
|
-
var
|
|
2701
|
+
var import_system12 = require("@xyflow/system");
|
|
2770
2702
|
var NoiseRawTextureTemplateFactory = class {
|
|
2771
2703
|
template = {
|
|
2772
2704
|
type: "texture-data" /* textureData */,
|
|
@@ -2776,13 +2708,13 @@ var NoiseRawTextureTemplateFactory = class {
|
|
|
2776
2708
|
},
|
|
2777
2709
|
handles: [
|
|
2778
2710
|
{
|
|
2779
|
-
position:
|
|
2711
|
+
position: import_system12.Position.Left,
|
|
2780
2712
|
dataType: "noise" /* noise */,
|
|
2781
2713
|
connection: "target",
|
|
2782
2714
|
maxConnections: 1
|
|
2783
2715
|
},
|
|
2784
2716
|
{
|
|
2785
|
-
position:
|
|
2717
|
+
position: import_system12.Position.Right,
|
|
2786
2718
|
dataType: "texture" /* texture */,
|
|
2787
2719
|
connection: "source"
|
|
2788
2720
|
}
|
|
@@ -2791,7 +2723,7 @@ var NoiseRawTextureTemplateFactory = class {
|
|
|
2791
2723
|
};
|
|
2792
2724
|
|
|
2793
2725
|
// src/templates/output/position-logger-template.ts
|
|
2794
|
-
var
|
|
2726
|
+
var import_system13 = require("@xyflow/system");
|
|
2795
2727
|
var PositionLoggerNodeTemplateFactory = class {
|
|
2796
2728
|
template = {
|
|
2797
2729
|
type: "position-logger" /* positionLogger */,
|
|
@@ -2801,7 +2733,7 @@ var PositionLoggerNodeTemplateFactory = class {
|
|
|
2801
2733
|
},
|
|
2802
2734
|
handles: [
|
|
2803
2735
|
{
|
|
2804
|
-
position:
|
|
2736
|
+
position: import_system13.Position.Left,
|
|
2805
2737
|
dataType: "position" /* position */,
|
|
2806
2738
|
connection: "target"
|
|
2807
2739
|
}
|
|
@@ -2810,7 +2742,7 @@ var PositionLoggerNodeTemplateFactory = class {
|
|
|
2810
2742
|
};
|
|
2811
2743
|
|
|
2812
2744
|
// src/templates/modifiers/noise-combine-template.ts
|
|
2813
|
-
var
|
|
2745
|
+
var import_system14 = require("@xyflow/system");
|
|
2814
2746
|
var NoiseCombineNodeTemplateFactory = class {
|
|
2815
2747
|
template = {
|
|
2816
2748
|
type: "noise-combiner" /* noiseCombine */,
|
|
@@ -2821,13 +2753,13 @@ var NoiseCombineNodeTemplateFactory = class {
|
|
|
2821
2753
|
},
|
|
2822
2754
|
handles: [
|
|
2823
2755
|
{
|
|
2824
|
-
position:
|
|
2756
|
+
position: import_system14.Position.Left,
|
|
2825
2757
|
dataType: "module" /* module */,
|
|
2826
2758
|
connection: "target",
|
|
2827
2759
|
maxConnections: 2
|
|
2828
2760
|
},
|
|
2829
2761
|
{
|
|
2830
|
-
position:
|
|
2762
|
+
position: import_system14.Position.Right,
|
|
2831
2763
|
dataType: "module" /* module */,
|
|
2832
2764
|
connection: "source"
|
|
2833
2765
|
}
|
|
@@ -2836,7 +2768,7 @@ var NoiseCombineNodeTemplateFactory = class {
|
|
|
2836
2768
|
};
|
|
2837
2769
|
|
|
2838
2770
|
// src/templates/modifiers/noise-clamp-template.ts
|
|
2839
|
-
var
|
|
2771
|
+
var import_system15 = require("@xyflow/system");
|
|
2840
2772
|
var NoiseClampNodeTemplateFactory = class {
|
|
2841
2773
|
template = {
|
|
2842
2774
|
type: "noise-clamp" /* noiseClamp */,
|
|
@@ -2848,13 +2780,13 @@ var NoiseClampNodeTemplateFactory = class {
|
|
|
2848
2780
|
},
|
|
2849
2781
|
handles: [
|
|
2850
2782
|
{
|
|
2851
|
-
position:
|
|
2783
|
+
position: import_system15.Position.Left,
|
|
2852
2784
|
dataType: "module" /* module */,
|
|
2853
2785
|
connection: "target",
|
|
2854
2786
|
maxConnections: 1
|
|
2855
2787
|
},
|
|
2856
2788
|
{
|
|
2857
|
-
position:
|
|
2789
|
+
position: import_system15.Position.Right,
|
|
2858
2790
|
dataType: "module" /* module */,
|
|
2859
2791
|
connection: "source"
|
|
2860
2792
|
}
|
|
@@ -2863,7 +2795,7 @@ var NoiseClampNodeTemplateFactory = class {
|
|
|
2863
2795
|
};
|
|
2864
2796
|
|
|
2865
2797
|
// src/templates/modifiers/noise-abs-template.ts
|
|
2866
|
-
var
|
|
2798
|
+
var import_system16 = require("@xyflow/system");
|
|
2867
2799
|
var NoiseAbsNodeTemplateFactory = class {
|
|
2868
2800
|
template = {
|
|
2869
2801
|
type: "noise-abs" /* noiseAbs */,
|
|
@@ -2873,13 +2805,13 @@ var NoiseAbsNodeTemplateFactory = class {
|
|
|
2873
2805
|
},
|
|
2874
2806
|
handles: [
|
|
2875
2807
|
{
|
|
2876
|
-
position:
|
|
2808
|
+
position: import_system16.Position.Left,
|
|
2877
2809
|
dataType: "module" /* module */,
|
|
2878
2810
|
connection: "target",
|
|
2879
2811
|
maxConnections: 1
|
|
2880
2812
|
},
|
|
2881
2813
|
{
|
|
2882
|
-
position:
|
|
2814
|
+
position: import_system16.Position.Right,
|
|
2883
2815
|
dataType: "module" /* module */,
|
|
2884
2816
|
connection: "source"
|
|
2885
2817
|
}
|
|
@@ -2888,7 +2820,7 @@ var NoiseAbsNodeTemplateFactory = class {
|
|
|
2888
2820
|
};
|
|
2889
2821
|
|
|
2890
2822
|
// src/templates/output/noise-output-template.ts
|
|
2891
|
-
var
|
|
2823
|
+
var import_system17 = require("@xyflow/system");
|
|
2892
2824
|
var NoiseOutputNodeTemplateFactory = class {
|
|
2893
2825
|
template = {
|
|
2894
2826
|
type: "noise-output" /* noiseOutput */,
|
|
@@ -2898,18 +2830,18 @@ var NoiseOutputNodeTemplateFactory = class {
|
|
|
2898
2830
|
},
|
|
2899
2831
|
handles: [
|
|
2900
2832
|
{
|
|
2901
|
-
position:
|
|
2833
|
+
position: import_system17.Position.Left,
|
|
2902
2834
|
dataType: "position" /* position */,
|
|
2903
2835
|
connection: "target"
|
|
2904
2836
|
},
|
|
2905
2837
|
{
|
|
2906
|
-
position:
|
|
2838
|
+
position: import_system17.Position.Left,
|
|
2907
2839
|
dataType: "module" /* module */,
|
|
2908
2840
|
connection: "target",
|
|
2909
2841
|
maxConnections: 1
|
|
2910
2842
|
},
|
|
2911
2843
|
{
|
|
2912
|
-
position:
|
|
2844
|
+
position: import_system17.Position.Right,
|
|
2913
2845
|
dataType: "noise" /* noise */,
|
|
2914
2846
|
connection: "source"
|
|
2915
2847
|
}
|
|
@@ -2918,8 +2850,7 @@ var NoiseOutputNodeTemplateFactory = class {
|
|
|
2918
2850
|
};
|
|
2919
2851
|
|
|
2920
2852
|
// src/templates/modifiers/noise-curve-template.ts
|
|
2921
|
-
var
|
|
2922
|
-
var import_system19 = require("@xyflow/system");
|
|
2853
|
+
var import_system18 = require("@xyflow/system");
|
|
2923
2854
|
var NoiseCurveNodeTemplateFactory = class {
|
|
2924
2855
|
template = {
|
|
2925
2856
|
type: "noise-curve" /* noiseCurve */,
|
|
@@ -2930,18 +2861,18 @@ var NoiseCurveNodeTemplateFactory = class {
|
|
|
2930
2861
|
},
|
|
2931
2862
|
handles: [
|
|
2932
2863
|
{
|
|
2933
|
-
position:
|
|
2864
|
+
position: import_system18.Position.Left,
|
|
2934
2865
|
dataType: "module" /* module */,
|
|
2935
2866
|
connection: "target",
|
|
2936
2867
|
maxConnections: 1
|
|
2937
2868
|
},
|
|
2869
|
+
// {
|
|
2870
|
+
// position: Position.Left,
|
|
2871
|
+
// dataType: CoreHandleType.variableProperty,
|
|
2872
|
+
// connection: 'target',
|
|
2873
|
+
// },
|
|
2938
2874
|
{
|
|
2939
|
-
position:
|
|
2940
|
-
dataType: import_abstract19.CoreHandleType.variableProperty,
|
|
2941
|
-
connection: "target"
|
|
2942
|
-
},
|
|
2943
|
-
{
|
|
2944
|
-
position: import_system19.Position.Right,
|
|
2875
|
+
position: import_system18.Position.Right,
|
|
2945
2876
|
dataType: "module" /* module */,
|
|
2946
2877
|
connection: "source"
|
|
2947
2878
|
}
|
|
@@ -2950,7 +2881,7 @@ var NoiseCurveNodeTemplateFactory = class {
|
|
|
2950
2881
|
};
|
|
2951
2882
|
|
|
2952
2883
|
// src/templates/modifiers/noise-exponent-template.ts
|
|
2953
|
-
var
|
|
2884
|
+
var import_system19 = require("@xyflow/system");
|
|
2954
2885
|
var NoiseExponentNodeTemplateFactory = class {
|
|
2955
2886
|
template = {
|
|
2956
2887
|
type: "noise-exponent" /* noiseExponent */,
|
|
@@ -2961,13 +2892,13 @@ var NoiseExponentNodeTemplateFactory = class {
|
|
|
2961
2892
|
},
|
|
2962
2893
|
handles: [
|
|
2963
2894
|
{
|
|
2964
|
-
position:
|
|
2895
|
+
position: import_system19.Position.Left,
|
|
2965
2896
|
dataType: "module" /* module */,
|
|
2966
2897
|
connection: "target",
|
|
2967
2898
|
maxConnections: 1
|
|
2968
2899
|
},
|
|
2969
2900
|
{
|
|
2970
|
-
position:
|
|
2901
|
+
position: import_system19.Position.Right,
|
|
2971
2902
|
dataType: "module" /* module */,
|
|
2972
2903
|
connection: "source"
|
|
2973
2904
|
}
|
|
@@ -2976,7 +2907,7 @@ var NoiseExponentNodeTemplateFactory = class {
|
|
|
2976
2907
|
};
|
|
2977
2908
|
|
|
2978
2909
|
// src/templates/modifiers/noise-invert-template.ts
|
|
2979
|
-
var
|
|
2910
|
+
var import_system20 = require("@xyflow/system");
|
|
2980
2911
|
var NoiseInvertNodeTemplateFactory = class {
|
|
2981
2912
|
template = {
|
|
2982
2913
|
type: "noise-invert" /* noiseInvert */,
|
|
@@ -2986,13 +2917,13 @@ var NoiseInvertNodeTemplateFactory = class {
|
|
|
2986
2917
|
},
|
|
2987
2918
|
handles: [
|
|
2988
2919
|
{
|
|
2989
|
-
position:
|
|
2920
|
+
position: import_system20.Position.Left,
|
|
2990
2921
|
dataType: "module" /* module */,
|
|
2991
2922
|
connection: "target",
|
|
2992
2923
|
maxConnections: 1
|
|
2993
2924
|
},
|
|
2994
2925
|
{
|
|
2995
|
-
position:
|
|
2926
|
+
position: import_system20.Position.Right,
|
|
2996
2927
|
dataType: "module" /* module */,
|
|
2997
2928
|
connection: "source"
|
|
2998
2929
|
}
|
|
@@ -3001,7 +2932,7 @@ var NoiseInvertNodeTemplateFactory = class {
|
|
|
3001
2932
|
};
|
|
3002
2933
|
|
|
3003
2934
|
// src/templates/modifiers/noise-scalebias-template.ts
|
|
3004
|
-
var
|
|
2935
|
+
var import_system21 = require("@xyflow/system");
|
|
3005
2936
|
var NoiseScaleBiasNodeTemplateFactory = class {
|
|
3006
2937
|
template = {
|
|
3007
2938
|
type: "noise-scale-bias" /* noiseScaleBias */,
|
|
@@ -3013,13 +2944,13 @@ var NoiseScaleBiasNodeTemplateFactory = class {
|
|
|
3013
2944
|
},
|
|
3014
2945
|
handles: [
|
|
3015
2946
|
{
|
|
3016
|
-
position:
|
|
2947
|
+
position: import_system21.Position.Left,
|
|
3017
2948
|
dataType: "module" /* module */,
|
|
3018
2949
|
connection: "target",
|
|
3019
2950
|
maxConnections: 1
|
|
3020
2951
|
},
|
|
3021
2952
|
{
|
|
3022
|
-
position:
|
|
2953
|
+
position: import_system21.Position.Right,
|
|
3023
2954
|
dataType: "module" /* module */,
|
|
3024
2955
|
connection: "source"
|
|
3025
2956
|
}
|
|
@@ -3028,7 +2959,7 @@ var NoiseScaleBiasNodeTemplateFactory = class {
|
|
|
3028
2959
|
};
|
|
3029
2960
|
|
|
3030
2961
|
// src/templates/modifiers/noise-terrace-template.ts
|
|
3031
|
-
var
|
|
2962
|
+
var import_system22 = require("@xyflow/system");
|
|
3032
2963
|
var NoiseTerraceNodeTemplateFactory = class {
|
|
3033
2964
|
template = {
|
|
3034
2965
|
type: "noise-terrace" /* noiseTerrace */,
|
|
@@ -3039,13 +2970,13 @@ var NoiseTerraceNodeTemplateFactory = class {
|
|
|
3039
2970
|
},
|
|
3040
2971
|
handles: [
|
|
3041
2972
|
{
|
|
3042
|
-
position:
|
|
2973
|
+
position: import_system22.Position.Left,
|
|
3043
2974
|
dataType: "module" /* module */,
|
|
3044
2975
|
connection: "target",
|
|
3045
2976
|
maxConnections: 1
|
|
3046
2977
|
},
|
|
3047
2978
|
{
|
|
3048
|
-
position:
|
|
2979
|
+
position: import_system22.Position.Right,
|
|
3049
2980
|
dataType: "module" /* module */,
|
|
3050
2981
|
connection: "source"
|
|
3051
2982
|
}
|
|
@@ -3054,7 +2985,7 @@ var NoiseTerraceNodeTemplateFactory = class {
|
|
|
3054
2985
|
};
|
|
3055
2986
|
|
|
3056
2987
|
// src/templates/selectors/noise-blend-template.ts
|
|
3057
|
-
var
|
|
2988
|
+
var import_system23 = require("@xyflow/system");
|
|
3058
2989
|
var NoiseBlendNodeTemplateFactory = class {
|
|
3059
2990
|
template = {
|
|
3060
2991
|
type: "noise-blend" /* noiseBlend */,
|
|
@@ -3064,7 +2995,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
3064
2995
|
},
|
|
3065
2996
|
handles: [
|
|
3066
2997
|
{
|
|
3067
|
-
position:
|
|
2998
|
+
position: import_system23.Position.Left,
|
|
3068
2999
|
dataType: "module" /* module */,
|
|
3069
3000
|
connection: "target",
|
|
3070
3001
|
label: "Source Modules",
|
|
@@ -3073,7 +3004,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
3073
3004
|
minConnections: 2
|
|
3074
3005
|
},
|
|
3075
3006
|
{
|
|
3076
|
-
position:
|
|
3007
|
+
position: import_system23.Position.Left,
|
|
3077
3008
|
dataType: "module" /* module */,
|
|
3078
3009
|
dataId: "control" /* control */,
|
|
3079
3010
|
connection: "target",
|
|
@@ -3081,7 +3012,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
3081
3012
|
maxConnections: 1
|
|
3082
3013
|
},
|
|
3083
3014
|
{
|
|
3084
|
-
position:
|
|
3015
|
+
position: import_system23.Position.Right,
|
|
3085
3016
|
dataType: "module" /* module */,
|
|
3086
3017
|
dataId: "output" /* output */,
|
|
3087
3018
|
connection: "source"
|
|
@@ -3091,7 +3022,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
3091
3022
|
};
|
|
3092
3023
|
|
|
3093
3024
|
// src/templates/selectors/noise-select-template.ts
|
|
3094
|
-
var
|
|
3025
|
+
var import_system24 = require("@xyflow/system");
|
|
3095
3026
|
var NoiseSelectNodeTemplateFactory = class {
|
|
3096
3027
|
template = {
|
|
3097
3028
|
type: "noise-select" /* noiseSelect */,
|
|
@@ -3104,7 +3035,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
3104
3035
|
},
|
|
3105
3036
|
handles: [
|
|
3106
3037
|
{
|
|
3107
|
-
position:
|
|
3038
|
+
position: import_system24.Position.Left,
|
|
3108
3039
|
dataType: "module" /* module */,
|
|
3109
3040
|
dataId: "source" /* source */,
|
|
3110
3041
|
connection: "target",
|
|
@@ -3113,7 +3044,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
3113
3044
|
minConnections: 2
|
|
3114
3045
|
},
|
|
3115
3046
|
{
|
|
3116
|
-
position:
|
|
3047
|
+
position: import_system24.Position.Left,
|
|
3117
3048
|
dataType: "module" /* module */,
|
|
3118
3049
|
dataId: "control" /* control */,
|
|
3119
3050
|
connection: "target",
|
|
@@ -3121,7 +3052,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
3121
3052
|
maxConnections: 1
|
|
3122
3053
|
},
|
|
3123
3054
|
{
|
|
3124
|
-
position:
|
|
3055
|
+
position: import_system24.Position.Right,
|
|
3125
3056
|
dataType: "module" /* module */,
|
|
3126
3057
|
dataId: "output" /* output */,
|
|
3127
3058
|
connection: "source"
|
|
@@ -3131,7 +3062,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
3131
3062
|
};
|
|
3132
3063
|
|
|
3133
3064
|
// src/templates/transformers/noise-displace-template.ts
|
|
3134
|
-
var
|
|
3065
|
+
var import_system25 = require("@xyflow/system");
|
|
3135
3066
|
var NoiseDisplaceNodeTemplateFactory = class {
|
|
3136
3067
|
template = {
|
|
3137
3068
|
type: "noise-displace" /* noiseDisplace */,
|
|
@@ -3141,7 +3072,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3141
3072
|
},
|
|
3142
3073
|
handles: [
|
|
3143
3074
|
{
|
|
3144
|
-
position:
|
|
3075
|
+
position: import_system25.Position.Left,
|
|
3145
3076
|
connection: "target",
|
|
3146
3077
|
label: "Source Module",
|
|
3147
3078
|
dataType: "module" /* module */,
|
|
@@ -3149,7 +3080,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3149
3080
|
maxConnections: 1
|
|
3150
3081
|
},
|
|
3151
3082
|
{
|
|
3152
|
-
position:
|
|
3083
|
+
position: import_system25.Position.Left,
|
|
3153
3084
|
connection: "target",
|
|
3154
3085
|
label: "X Module",
|
|
3155
3086
|
dataType: "module" /* module */,
|
|
@@ -3157,7 +3088,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3157
3088
|
maxConnections: 1
|
|
3158
3089
|
},
|
|
3159
3090
|
{
|
|
3160
|
-
position:
|
|
3091
|
+
position: import_system25.Position.Left,
|
|
3161
3092
|
connection: "target",
|
|
3162
3093
|
label: "Y Module",
|
|
3163
3094
|
dataType: "module" /* module */,
|
|
@@ -3165,7 +3096,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3165
3096
|
maxConnections: 1
|
|
3166
3097
|
},
|
|
3167
3098
|
{
|
|
3168
|
-
position:
|
|
3099
|
+
position: import_system25.Position.Left,
|
|
3169
3100
|
connection: "target",
|
|
3170
3101
|
label: "Z Module",
|
|
3171
3102
|
dataType: "module" /* module */,
|
|
@@ -3173,7 +3104,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3173
3104
|
maxConnections: 1
|
|
3174
3105
|
},
|
|
3175
3106
|
{
|
|
3176
|
-
position:
|
|
3107
|
+
position: import_system25.Position.Right,
|
|
3177
3108
|
dataType: "module" /* module */,
|
|
3178
3109
|
dataId: "output" /* output */,
|
|
3179
3110
|
connection: "source"
|
|
@@ -3183,7 +3114,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3183
3114
|
};
|
|
3184
3115
|
|
|
3185
3116
|
// src/templates/transformers/noise-rotate-point-template.ts
|
|
3186
|
-
var
|
|
3117
|
+
var import_system26 = require("@xyflow/system");
|
|
3187
3118
|
var NoiseRotatePointNodeTemplateFactory = class {
|
|
3188
3119
|
template = {
|
|
3189
3120
|
type: "noise-rotate-point" /* noiseRotatePoint */,
|
|
@@ -3196,14 +3127,14 @@ var NoiseRotatePointNodeTemplateFactory = class {
|
|
|
3196
3127
|
},
|
|
3197
3128
|
handles: [
|
|
3198
3129
|
{
|
|
3199
|
-
position:
|
|
3130
|
+
position: import_system26.Position.Left,
|
|
3200
3131
|
dataType: "module" /* module */,
|
|
3201
3132
|
connection: "target",
|
|
3202
3133
|
label: "Source Module",
|
|
3203
3134
|
maxConnections: 1
|
|
3204
3135
|
},
|
|
3205
3136
|
{
|
|
3206
|
-
position:
|
|
3137
|
+
position: import_system26.Position.Right,
|
|
3207
3138
|
dataType: "module" /* module */,
|
|
3208
3139
|
connection: "source"
|
|
3209
3140
|
}
|
|
@@ -3212,7 +3143,7 @@ var NoiseRotatePointNodeTemplateFactory = class {
|
|
|
3212
3143
|
};
|
|
3213
3144
|
|
|
3214
3145
|
// src/templates/transformers/noise-scale-point-template.ts
|
|
3215
|
-
var
|
|
3146
|
+
var import_system27 = require("@xyflow/system");
|
|
3216
3147
|
var NoiseScalePointNodeTemplateFactory = class {
|
|
3217
3148
|
template = {
|
|
3218
3149
|
type: "noise-scale-point" /* noiseScalePoint */,
|
|
@@ -3225,14 +3156,14 @@ var NoiseScalePointNodeTemplateFactory = class {
|
|
|
3225
3156
|
},
|
|
3226
3157
|
handles: [
|
|
3227
3158
|
{
|
|
3228
|
-
position:
|
|
3159
|
+
position: import_system27.Position.Left,
|
|
3229
3160
|
dataType: "module" /* module */,
|
|
3230
3161
|
connection: "target",
|
|
3231
3162
|
label: "Source Module",
|
|
3232
3163
|
maxConnections: 1
|
|
3233
3164
|
},
|
|
3234
3165
|
{
|
|
3235
|
-
position:
|
|
3166
|
+
position: import_system27.Position.Right,
|
|
3236
3167
|
dataType: "module" /* module */,
|
|
3237
3168
|
connection: "source"
|
|
3238
3169
|
}
|
|
@@ -3241,7 +3172,7 @@ var NoiseScalePointNodeTemplateFactory = class {
|
|
|
3241
3172
|
};
|
|
3242
3173
|
|
|
3243
3174
|
// src/templates/transformers/noise-translate-point-template.ts
|
|
3244
|
-
var
|
|
3175
|
+
var import_system28 = require("@xyflow/system");
|
|
3245
3176
|
var NoiseTranslatePointNodeTemplateFactory = class {
|
|
3246
3177
|
template = {
|
|
3247
3178
|
type: "noise-translate-point" /* noiseTranslatePoint */,
|
|
@@ -3254,14 +3185,14 @@ var NoiseTranslatePointNodeTemplateFactory = class {
|
|
|
3254
3185
|
},
|
|
3255
3186
|
handles: [
|
|
3256
3187
|
{
|
|
3257
|
-
position:
|
|
3188
|
+
position: import_system28.Position.Left,
|
|
3258
3189
|
dataType: "module" /* module */,
|
|
3259
3190
|
connection: "target",
|
|
3260
3191
|
label: "Source Module",
|
|
3261
3192
|
maxConnections: 1
|
|
3262
3193
|
},
|
|
3263
3194
|
{
|
|
3264
|
-
position:
|
|
3195
|
+
position: import_system28.Position.Right,
|
|
3265
3196
|
dataType: "module" /* module */,
|
|
3266
3197
|
connection: "source"
|
|
3267
3198
|
}
|
|
@@ -3270,8 +3201,8 @@ var NoiseTranslatePointNodeTemplateFactory = class {
|
|
|
3270
3201
|
};
|
|
3271
3202
|
|
|
3272
3203
|
// src/templates/transformers/noise-turbulence-template.ts
|
|
3273
|
-
var
|
|
3274
|
-
var
|
|
3204
|
+
var import_abstract29 = require("@awesome-flow/core/abstract");
|
|
3205
|
+
var import_system29 = require("@xyflow/system");
|
|
3275
3206
|
var NoiseTurbulenceNodeTemplateFactory = class {
|
|
3276
3207
|
template = {
|
|
3277
3208
|
type: "noise-turbulence" /* noiseTurbulence */,
|
|
@@ -3285,20 +3216,20 @@ var NoiseTurbulenceNodeTemplateFactory = class {
|
|
|
3285
3216
|
},
|
|
3286
3217
|
handles: [
|
|
3287
3218
|
{
|
|
3288
|
-
position:
|
|
3219
|
+
position: import_system29.Position.Left,
|
|
3289
3220
|
dataType: "module" /* module */,
|
|
3290
3221
|
connection: "target",
|
|
3291
3222
|
label: "Source Module",
|
|
3292
3223
|
maxConnections: 1
|
|
3293
3224
|
},
|
|
3294
3225
|
{
|
|
3295
|
-
position:
|
|
3296
|
-
dataType:
|
|
3226
|
+
position: import_system29.Position.Left,
|
|
3227
|
+
dataType: import_abstract29.CoreHandleType.variableProperty,
|
|
3297
3228
|
label: "Variable Properties",
|
|
3298
3229
|
connection: "target"
|
|
3299
3230
|
},
|
|
3300
3231
|
{
|
|
3301
|
-
position:
|
|
3232
|
+
position: import_system29.Position.Right,
|
|
3302
3233
|
dataType: "module" /* module */,
|
|
3303
3234
|
connection: "source"
|
|
3304
3235
|
}
|
|
@@ -3307,9 +3238,9 @@ var NoiseTurbulenceNodeTemplateFactory = class {
|
|
|
3307
3238
|
};
|
|
3308
3239
|
|
|
3309
3240
|
// src/templates/generators/noise-billow-template.ts
|
|
3310
|
-
var
|
|
3241
|
+
var import_abstract31 = require("@awesome-flow/core/abstract");
|
|
3311
3242
|
var import_utils2 = require("@awesome-flow/core/utils");
|
|
3312
|
-
var
|
|
3243
|
+
var import_system30 = require("@xyflow/system");
|
|
3313
3244
|
var NoiseBillowNodeTemplateFactory = class {
|
|
3314
3245
|
template = {
|
|
3315
3246
|
id: import_utils2.IDGenerator.template(),
|
|
@@ -3325,12 +3256,12 @@ var NoiseBillowNodeTemplateFactory = class {
|
|
|
3325
3256
|
},
|
|
3326
3257
|
handles: [
|
|
3327
3258
|
{
|
|
3328
|
-
position:
|
|
3329
|
-
dataType:
|
|
3259
|
+
position: import_system30.Position.Left,
|
|
3260
|
+
dataType: import_abstract31.CoreHandleType.variableProperty,
|
|
3330
3261
|
connection: "target"
|
|
3331
3262
|
},
|
|
3332
3263
|
{
|
|
3333
|
-
position:
|
|
3264
|
+
position: import_system30.Position.Right,
|
|
3334
3265
|
dataType: "module" /* module */,
|
|
3335
3266
|
connection: "source"
|
|
3336
3267
|
}
|
|
@@ -3339,14 +3270,14 @@ var NoiseBillowNodeTemplateFactory = class {
|
|
|
3339
3270
|
};
|
|
3340
3271
|
|
|
3341
3272
|
// src/templates/groups/module-group-template.ts
|
|
3342
|
-
var
|
|
3273
|
+
var import_abstract32 = require("@awesome-flow/core/abstract");
|
|
3343
3274
|
var import_utils3 = require("@awesome-flow/core/utils");
|
|
3344
|
-
var
|
|
3275
|
+
var import_system31 = require("@xyflow/system");
|
|
3345
3276
|
var ModuleGroupNodeTemplateFactory = class {
|
|
3346
3277
|
template = {
|
|
3347
3278
|
id: import_utils3.IDGenerator.template(),
|
|
3348
3279
|
type: "group-module" /* groupModule */,
|
|
3349
|
-
group:
|
|
3280
|
+
group: import_abstract32.CoreTemplateGroup.groups,
|
|
3350
3281
|
data: {
|
|
3351
3282
|
title: "Modules Group",
|
|
3352
3283
|
isGroup: true,
|
|
@@ -3361,14 +3292,14 @@ var ModuleGroupNodeTemplateFactory = class {
|
|
|
3361
3292
|
},
|
|
3362
3293
|
handles: [
|
|
3363
3294
|
{
|
|
3364
|
-
position:
|
|
3295
|
+
position: import_system31.Position.Bottom,
|
|
3365
3296
|
dataType: "module" /* module */,
|
|
3366
3297
|
connection: "target",
|
|
3367
3298
|
maxConnections: 1,
|
|
3368
3299
|
hideOnCollapse: true
|
|
3369
3300
|
},
|
|
3370
3301
|
{
|
|
3371
|
-
position:
|
|
3302
|
+
position: import_system31.Position.Right,
|
|
3372
3303
|
dataType: "module" /* module */,
|
|
3373
3304
|
connection: "source"
|
|
3374
3305
|
}
|
|
@@ -3379,7 +3310,6 @@ var ModuleGroupNodeTemplateFactory = class {
|
|
|
3379
3310
|
// src/abstract/node-types.ts
|
|
3380
3311
|
var noiseNodeTemplates = {
|
|
3381
3312
|
["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
|
|
3382
|
-
["noise-simplex" /* noiseSimplex */]: new NoiseSimplexNodeTemplateFactory(),
|
|
3383
3313
|
["noise-billow" /* noiseBillow */]: new NoiseBillowNodeTemplateFactory(),
|
|
3384
3314
|
["noise-checkerboard" /* noiseCheckerboard */]: new NoiseCheckerboardNodeTemplateFactory(),
|
|
3385
3315
|
["noise-normalize" /* noiseNormalize */]: new NoiseNormalizeNodeTemplateFactory(),
|
|
@@ -3413,11 +3343,11 @@ var noiseNodeTemplates = {
|
|
|
3413
3343
|
};
|
|
3414
3344
|
|
|
3415
3345
|
// src/nodes/output/noise-output-node.tsx
|
|
3416
|
-
var
|
|
3346
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3417
3347
|
function NoiseOutputNode({ id, selected, data, type }) {
|
|
3418
|
-
const [size, setSize] = (0,
|
|
3419
|
-
const updateComputedData = (0,
|
|
3420
|
-
const onDataUpdated = (0,
|
|
3348
|
+
const [size, setSize] = (0, import_react39.useState)(0);
|
|
3349
|
+
const updateComputedData = (0, import_hooks33.useUpdateNodeComputedData)();
|
|
3350
|
+
const onDataUpdated = (0, import_react39.useCallback)(
|
|
3421
3351
|
(handleData) => {
|
|
3422
3352
|
const incomingPositions = handleData["position" /* position */];
|
|
3423
3353
|
const incomingModule = handleData["module" /* module */];
|
|
@@ -3439,8 +3369,8 @@ function NoiseOutputNode({ id, selected, data, type }) {
|
|
|
3439
3369
|
},
|
|
3440
3370
|
[]
|
|
3441
3371
|
);
|
|
3442
|
-
return /* @__PURE__ */ (0,
|
|
3443
|
-
/* @__PURE__ */ (0,
|
|
3372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_layout31.NodeContainer, { id, selected, data, type, children: [
|
|
3373
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3444
3374
|
import_components11.HandlesIncomingDataStatus,
|
|
3445
3375
|
{
|
|
3446
3376
|
nodeId: id,
|
|
@@ -3451,11 +3381,11 @@ function NoiseOutputNode({ id, selected, data, type }) {
|
|
|
3451
3381
|
resetComputedData: true
|
|
3452
3382
|
}
|
|
3453
3383
|
),
|
|
3454
|
-
/* @__PURE__ */ (0,
|
|
3384
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core18.Text, { mt: 5, children: [
|
|
3455
3385
|
"Noise points: ",
|
|
3456
3386
|
size
|
|
3457
3387
|
] }),
|
|
3458
|
-
/* @__PURE__ */ (0,
|
|
3388
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_layout31.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
3459
3389
|
] });
|
|
3460
3390
|
}
|
|
3461
3391
|
var noise_output_node_default = NoiseOutputNode;
|
|
@@ -3484,7 +3414,6 @@ var noise_output_node_default = NoiseOutputNode;
|
|
|
3484
3414
|
NoiseScaleBiasNode,
|
|
3485
3415
|
NoiseScalePointNode,
|
|
3486
3416
|
NoiseSelectNode,
|
|
3487
|
-
NoiseSimplexNode,
|
|
3488
3417
|
NoiseSpheresNode,
|
|
3489
3418
|
NoiseTerraceNode,
|
|
3490
3419
|
NoiseTranslatePointNode,
|