@awesome-flow/noise 0.5.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 +701 -769
- package/dist/abstract/index.d.cts +6 -12
- package/dist/abstract/index.d.ts +6 -12
- package/dist/abstract/index.js +498 -568
- 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 +642 -710
- package/dist/nodes/index.d.cts +3 -6
- package/dist/nodes/index.d.ts +3 -6
- package/dist/nodes/index.js +443 -512
- package/dist/nodes/modifiers/index.cjs +77 -89
- package/dist/nodes/modifiers/index.d.cts +2 -5
- package/dist/nodes/modifiers/index.d.ts +2 -5
- package/dist/nodes/modifiers/index.js +73 -85
- 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/abstract/index.cjs
CHANGED
|
@@ -29,43 +29,33 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
));
|
|
30
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
31
|
|
|
32
|
-
// ../../node_modules/fast-deep-equal/index.js
|
|
32
|
+
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
33
33
|
var require_fast_deep_equal = __commonJS({
|
|
34
|
-
"../../node_modules/fast-deep-equal/index.js"(exports2, module2) {
|
|
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
|
}
|
|
@@ -112,51 +102,20 @@ var NoiseSourceControlHandle = /* @__PURE__ */ ((NoiseSourceControlHandle2) => {
|
|
|
112
102
|
return NoiseSourceControlHandle2;
|
|
113
103
|
})(NoiseSourceControlHandle || {});
|
|
114
104
|
|
|
115
|
-
// src/nodes/generators/
|
|
105
|
+
// src/nodes/generators/position-const-node.tsx
|
|
116
106
|
var import_layout = require("@awesome-flow/core/layout");
|
|
117
107
|
var import_react = require("react");
|
|
108
|
+
var import_core = require("@mantine/core");
|
|
118
109
|
var import_hooks = require("@awesome-flow/core/hooks");
|
|
119
|
-
|
|
120
|
-
// src/modules/simplex-module.ts
|
|
121
|
-
var import_Module = __toESM(require("libnoise-ts/module/Module"), 1);
|
|
122
|
-
var import_simplex_noise = require("simplex-noise");
|
|
123
|
-
var SimplexModule = class extends import_Module.default {
|
|
124
|
-
noise;
|
|
125
|
-
constructor(random) {
|
|
126
|
-
super();
|
|
127
|
-
this.noise = (0, import_simplex_noise.createNoise3D)(random);
|
|
128
|
-
}
|
|
129
|
-
getValue(x, y, z) {
|
|
130
|
-
return this.noise(x, y, z);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
// src/nodes/generators/noise-simplex-node.tsx
|
|
135
110
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
136
|
-
function NoiseSimplexNode({ id, selected, data, type }) {
|
|
137
|
-
const updateComputedData = (0, import_hooks.useUpdateNodeComputedData)();
|
|
138
|
-
const module2 = (0, import_react.useMemo)(() => new SimplexModule(), []);
|
|
139
|
-
(0, import_react.useEffect)(() => {
|
|
140
|
-
updateComputedData(id, { module: module2 });
|
|
141
|
-
}, []);
|
|
142
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_layout.NodeContainer, { id, selected, data, type });
|
|
143
|
-
}
|
|
144
|
-
var noise_simplex_node_default = NoiseSimplexNode;
|
|
145
|
-
|
|
146
|
-
// src/nodes/generators/position-const-node.tsx
|
|
147
|
-
var import_layout2 = require("@awesome-flow/core/layout");
|
|
148
|
-
var import_react2 = require("react");
|
|
149
|
-
var import_core = require("@mantine/core");
|
|
150
|
-
var import_hooks2 = require("@awesome-flow/core/hooks");
|
|
151
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
152
111
|
function PositionConstNode({ id, selected, data, type }) {
|
|
153
112
|
const position = data.position ?? { x: 0, y: 0, z: 0 };
|
|
154
|
-
const [x, setX] = (0,
|
|
155
|
-
const [y, setY] = (0,
|
|
156
|
-
const [z, setZ] = (0,
|
|
157
|
-
const updateNodeData = (0,
|
|
158
|
-
const updateComputedData = (0,
|
|
159
|
-
(0,
|
|
113
|
+
const [x, setX] = (0, import_react.useState)(position.x);
|
|
114
|
+
const [y, setY] = (0, import_react.useState)(position.y);
|
|
115
|
+
const [z, setZ] = (0, import_react.useState)(position.z);
|
|
116
|
+
const updateNodeData = (0, import_hooks.useUpdateNodeData)();
|
|
117
|
+
const updateComputedData = (0, import_hooks.useUpdateNodeComputedData)();
|
|
118
|
+
(0, import_react.useEffect)(() => {
|
|
160
119
|
const position2 = { x, y, z };
|
|
161
120
|
updateNodeData(id, {
|
|
162
121
|
position: position2
|
|
@@ -165,47 +124,47 @@ function PositionConstNode({ id, selected, data, type }) {
|
|
|
165
124
|
positions: [position2]
|
|
166
125
|
});
|
|
167
126
|
}, [x, y, z]);
|
|
168
|
-
return /* @__PURE__ */ (0,
|
|
169
|
-
/* @__PURE__ */ (0,
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_layout.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Stack, { children: [
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Group, { children: [
|
|
170
129
|
"x: ",
|
|
171
|
-
/* @__PURE__ */ (0,
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
172
131
|
] }),
|
|
173
|
-
/* @__PURE__ */ (0,
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Group, { children: [
|
|
174
133
|
"y: ",
|
|
175
|
-
/* @__PURE__ */ (0,
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
176
135
|
] }),
|
|
177
|
-
/* @__PURE__ */ (0,
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Group, { children: [
|
|
178
137
|
"z: ",
|
|
179
|
-
/* @__PURE__ */ (0,
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
180
139
|
] })
|
|
181
140
|
] }) });
|
|
182
141
|
}
|
|
183
142
|
var position_const_node_default = PositionConstNode;
|
|
184
143
|
|
|
185
144
|
// src/nodes/generators/position-grid-node.tsx
|
|
186
|
-
var
|
|
187
|
-
var
|
|
145
|
+
var import_layout2 = require("@awesome-flow/core/layout");
|
|
146
|
+
var import_react2 = require("react");
|
|
188
147
|
var import_core2 = require("@mantine/core");
|
|
189
|
-
var
|
|
190
|
-
var
|
|
148
|
+
var import_hooks2 = require("@awesome-flow/core/hooks");
|
|
149
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
191
150
|
function PositionGridNode({ id, selected, data, type }) {
|
|
192
|
-
const [x, setX] = (0,
|
|
193
|
-
const [y, setY] = (0,
|
|
194
|
-
const [z, setZ] = (0,
|
|
195
|
-
const [radius, setRadius] = (0,
|
|
196
|
-
const updateNodeData = (0,
|
|
197
|
-
const updateComputedData = (0,
|
|
198
|
-
(0,
|
|
151
|
+
const [x, setX] = (0, import_react2.useState)(data.center?.x);
|
|
152
|
+
const [y, setY] = (0, import_react2.useState)(data.center?.y);
|
|
153
|
+
const [z, setZ] = (0, import_react2.useState)(data.center?.z);
|
|
154
|
+
const [radius, setRadius] = (0, import_react2.useState)(data.radius);
|
|
155
|
+
const updateNodeData = (0, import_hooks2.useUpdateNodeData)();
|
|
156
|
+
const updateComputedData = (0, import_hooks2.useUpdateNodeComputedData)();
|
|
157
|
+
(0, import_react2.useEffect)(() => {
|
|
199
158
|
updateNodeData(id, {
|
|
200
159
|
center: { x, y, z }
|
|
201
160
|
});
|
|
202
161
|
}, [x, y, z]);
|
|
203
|
-
(0,
|
|
162
|
+
(0, import_react2.useEffect)(() => {
|
|
204
163
|
updateNodeData(id, {
|
|
205
164
|
radius
|
|
206
165
|
});
|
|
207
166
|
}, [radius]);
|
|
208
|
-
(0,
|
|
167
|
+
(0, import_react2.useEffect)(() => {
|
|
209
168
|
const positions = [];
|
|
210
169
|
for (let i = -radius; i < radius; i++) {
|
|
211
170
|
for (let j = -radius; j < radius; j++) {
|
|
@@ -216,36 +175,36 @@ function PositionGridNode({ id, selected, data, type }) {
|
|
|
216
175
|
positions
|
|
217
176
|
});
|
|
218
177
|
}, [x, y, z, radius]);
|
|
219
|
-
return /* @__PURE__ */ (0,
|
|
220
|
-
/* @__PURE__ */ (0,
|
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_layout2.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Stack, { children: [
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { children: [
|
|
221
180
|
"x: ",
|
|
222
|
-
/* @__PURE__ */ (0,
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
223
182
|
] }),
|
|
224
|
-
/* @__PURE__ */ (0,
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { children: [
|
|
225
184
|
"y: ",
|
|
226
|
-
/* @__PURE__ */ (0,
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
227
186
|
] }),
|
|
228
|
-
/* @__PURE__ */ (0,
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { children: [
|
|
229
188
|
"z: ",
|
|
230
|
-
/* @__PURE__ */ (0,
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
231
190
|
] }),
|
|
232
|
-
/* @__PURE__ */ (0,
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { children: [
|
|
233
192
|
"r: ",
|
|
234
|
-
/* @__PURE__ */ (0,
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: radius, onChange: (e) => setRadius(Number(e)) })
|
|
235
194
|
] })
|
|
236
195
|
] }) });
|
|
237
196
|
}
|
|
238
197
|
var position_grid_node_default = PositionGridNode;
|
|
239
198
|
|
|
240
199
|
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
241
|
-
var
|
|
242
|
-
var
|
|
200
|
+
var import_layout3 = require("@awesome-flow/core/layout");
|
|
201
|
+
var import_react3 = require("react");
|
|
243
202
|
var import_core3 = require("@mantine/core");
|
|
244
|
-
var
|
|
203
|
+
var import_hooks3 = require("@awesome-flow/core/hooks");
|
|
245
204
|
|
|
246
205
|
// src/modules/normalize-noise-module.ts
|
|
247
|
-
var
|
|
248
|
-
var NormalizeNoiseModule = class extends
|
|
206
|
+
var import_libnoise_simplex_ts = require("libnoise-simplex-ts");
|
|
207
|
+
var NormalizeNoiseModule = class extends import_libnoise_simplex_ts.ModifierModule {
|
|
249
208
|
constructor(source, lowerBound, upperBound) {
|
|
250
209
|
super(source);
|
|
251
210
|
this.lowerBound = lowerBound;
|
|
@@ -260,14 +219,14 @@ function normalize(value, min, max) {
|
|
|
260
219
|
}
|
|
261
220
|
|
|
262
221
|
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
263
|
-
var
|
|
222
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
264
223
|
function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
265
|
-
const [intervalStart, setIntervalStart] = (0,
|
|
266
|
-
const [intervalEnd, setIntervalEnd] = (0,
|
|
267
|
-
const incoming = (0,
|
|
268
|
-
const updateNodeData = (0,
|
|
269
|
-
const updateComputedData = (0,
|
|
270
|
-
(0,
|
|
224
|
+
const [intervalStart, setIntervalStart] = (0, import_react3.useState)(data.intervalStart);
|
|
225
|
+
const [intervalEnd, setIntervalEnd] = (0, import_react3.useState)(data.intervalEnd);
|
|
226
|
+
const incoming = (0, import_hooks3.useIncomingComputedData)(id);
|
|
227
|
+
const updateNodeData = (0, import_hooks3.useUpdateNodeData)();
|
|
228
|
+
const updateComputedData = (0, import_hooks3.useUpdateNodeComputedData)();
|
|
229
|
+
(0, import_react3.useEffect)(() => {
|
|
271
230
|
if (incoming?.length) {
|
|
272
231
|
const source = incoming[0].module;
|
|
273
232
|
const module2 = new NormalizeNoiseModule(source, intervalStart, intervalEnd);
|
|
@@ -275,9 +234,9 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
275
234
|
}
|
|
276
235
|
updateNodeData(id, { intervalStart, intervalEnd });
|
|
277
236
|
}, [incoming, intervalStart, intervalEnd]);
|
|
278
|
-
return /* @__PURE__ */ (0,
|
|
279
|
-
/* @__PURE__ */ (0,
|
|
280
|
-
/* @__PURE__ */ (0,
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_layout3.NodeContainer, { id, selected, data, type, children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core3.Group, { children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
281
240
|
import_core3.NumberInput,
|
|
282
241
|
{
|
|
283
242
|
size: "xs",
|
|
@@ -286,7 +245,7 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
286
245
|
onChange: (e) => setIntervalStart(Number(e))
|
|
287
246
|
}
|
|
288
247
|
),
|
|
289
|
-
/* @__PURE__ */ (0,
|
|
248
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
290
249
|
import_core3.NumberInput,
|
|
291
250
|
{
|
|
292
251
|
size: "xs",
|
|
@@ -296,38 +255,38 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
296
255
|
}
|
|
297
256
|
)
|
|
298
257
|
] }) }),
|
|
299
|
-
/* @__PURE__ */ (0,
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_layout3.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
300
259
|
] });
|
|
301
260
|
}
|
|
302
261
|
var noise_normalize_node_default = NoiseNormalizeNode;
|
|
303
262
|
|
|
304
263
|
// src/nodes/generators/noise-const-node.tsx
|
|
305
|
-
var
|
|
306
|
-
var
|
|
264
|
+
var import_layout4 = require("@awesome-flow/core/layout");
|
|
265
|
+
var import_react4 = require("react");
|
|
307
266
|
var import_core4 = require("@mantine/core");
|
|
308
|
-
var
|
|
309
|
-
var
|
|
310
|
-
var
|
|
267
|
+
var import_hooks4 = require("@awesome-flow/core/hooks");
|
|
268
|
+
var import_libnoise_simplex_ts2 = require("libnoise-simplex-ts");
|
|
269
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
311
270
|
function NoiseConstNode({ id, selected, data, type }) {
|
|
312
|
-
const [min, setMin] = (0,
|
|
313
|
-
const [max, setMax] = (0,
|
|
314
|
-
const [noise, setNoise] = (0,
|
|
315
|
-
const updateNodeData = (0,
|
|
316
|
-
const updateComputedData = (0,
|
|
317
|
-
const module2 = (0,
|
|
318
|
-
(0,
|
|
271
|
+
const [min, setMin] = (0, import_react4.useState)(data.min);
|
|
272
|
+
const [max, setMax] = (0, import_react4.useState)(data.max);
|
|
273
|
+
const [noise, setNoise] = (0, import_react4.useState)(data.noise);
|
|
274
|
+
const updateNodeData = (0, import_hooks4.useUpdateNodeData)();
|
|
275
|
+
const updateComputedData = (0, import_hooks4.useUpdateNodeComputedData)();
|
|
276
|
+
const module2 = (0, import_react4.useMemo)(() => new import_libnoise_simplex_ts2.Const(), []);
|
|
277
|
+
(0, import_react4.useEffect)(() => {
|
|
319
278
|
module2.value = noise;
|
|
320
279
|
updateNodeData(id, { noise, min, max });
|
|
321
280
|
updateComputedData(id, { module: module2 });
|
|
322
281
|
}, [noise, min, max, module2, updateNodeData, id, updateComputedData]);
|
|
323
|
-
return /* @__PURE__ */ (0,
|
|
324
|
-
/* @__PURE__ */ (0,
|
|
325
|
-
/* @__PURE__ */ (0,
|
|
326
|
-
/* @__PURE__ */ (0,
|
|
282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_layout4.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Stack, { children: [
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Group, { children: [
|
|
284
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.NumberInput, { size: "xs", w: 100, value: min, onChange: (e) => setMin(Number(e)) }),
|
|
285
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.NumberInput, { size: "xs", w: 100, value: max, onChange: (e) => setMax(Number(e)) })
|
|
327
286
|
] }),
|
|
328
|
-
/* @__PURE__ */ (0,
|
|
287
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Group, { children: [
|
|
329
288
|
"noise:",
|
|
330
|
-
/* @__PURE__ */ (0,
|
|
289
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
331
290
|
import_core4.NumberInput,
|
|
332
291
|
{
|
|
333
292
|
size: "xs",
|
|
@@ -344,16 +303,16 @@ function NoiseConstNode({ id, selected, data, type }) {
|
|
|
344
303
|
var noise_const_node_default = NoiseConstNode;
|
|
345
304
|
|
|
346
305
|
// src/nodes/generators/noise-billow-node.tsx
|
|
347
|
-
var
|
|
348
|
-
var
|
|
349
|
-
var
|
|
350
|
-
var
|
|
306
|
+
var import_layout5 = require("@awesome-flow/core/layout");
|
|
307
|
+
var import_react5 = require("react");
|
|
308
|
+
var import_libnoise_simplex_ts3 = require("libnoise-simplex-ts");
|
|
309
|
+
var import_hooks5 = require("@awesome-flow/core/hooks");
|
|
351
310
|
var import_components = require("@awesome-flow/core/components");
|
|
352
|
-
var
|
|
311
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
353
312
|
function NoiseBillowNode({ id, selected, data, type }) {
|
|
354
|
-
const updateComputedData = (0,
|
|
355
|
-
const module2 = (0,
|
|
356
|
-
const onPropertiesChange = (0,
|
|
313
|
+
const updateComputedData = (0, import_hooks5.useUpdateNodeComputedData)();
|
|
314
|
+
const module2 = (0, import_react5.useMemo)(() => new import_libnoise_simplex_ts3.Billow(), []);
|
|
315
|
+
const onPropertiesChange = (0, import_react5.useCallback)(
|
|
357
316
|
(properties) => {
|
|
358
317
|
Object.keys(properties).forEach((k) => {
|
|
359
318
|
module2[k] = properties[k].value;
|
|
@@ -362,29 +321,29 @@ function NoiseBillowNode({ id, selected, data, type }) {
|
|
|
362
321
|
},
|
|
363
322
|
[id, module2, updateComputedData]
|
|
364
323
|
);
|
|
365
|
-
return /* @__PURE__ */ (0,
|
|
366
|
-
/* @__PURE__ */ (0,
|
|
367
|
-
/* @__PURE__ */ (0,
|
|
324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_layout5.NodeContainer, { id, selected, data, type, children: [
|
|
325
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
326
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_layout5.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
368
327
|
] });
|
|
369
328
|
}
|
|
370
329
|
var noise_billow_node_default = NoiseBillowNode;
|
|
371
330
|
|
|
372
331
|
// src/nodes/output/noise-logger-node.tsx
|
|
373
|
-
var
|
|
374
|
-
var
|
|
332
|
+
var import_layout6 = require("@awesome-flow/core/layout");
|
|
333
|
+
var import_react6 = require("react");
|
|
375
334
|
var import_core5 = require("@mantine/core");
|
|
376
|
-
var
|
|
377
|
-
var
|
|
335
|
+
var import_hooks6 = require("@awesome-flow/core/hooks");
|
|
336
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
378
337
|
function NoiseLoggerNode({ id, selected, data, type }) {
|
|
379
|
-
const incoming = (0,
|
|
380
|
-
const noise = (0,
|
|
381
|
-
return /* @__PURE__ */ (0,
|
|
382
|
-
/* @__PURE__ */ (0,
|
|
338
|
+
const incoming = (0, import_hooks6.useIncomingComputedData)(id);
|
|
339
|
+
const noise = (0, import_react6.useMemo)(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_layout6.NodeContainer, { id, selected, data, type, children: [
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core5.Text, { children: [
|
|
383
342
|
"Size: ",
|
|
384
343
|
noise?.length || 0
|
|
385
344
|
] }),
|
|
386
|
-
/* @__PURE__ */ (0,
|
|
387
|
-
/* @__PURE__ */ (0,
|
|
345
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core5.Divider, { h: 5 }),
|
|
346
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core5.Stack, { children: noise?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core5.Text, { children: [
|
|
388
347
|
v.position?.x,
|
|
389
348
|
":",
|
|
390
349
|
v.position?.y,
|
|
@@ -393,24 +352,24 @@ function NoiseLoggerNode({ id, selected, data, type }) {
|
|
|
393
352
|
": ",
|
|
394
353
|
v.value
|
|
395
354
|
] }, i)) }),
|
|
396
|
-
/* @__PURE__ */ (0,
|
|
355
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_layout6.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
397
356
|
] });
|
|
398
357
|
}
|
|
399
358
|
var noise_logger_node_default = NoiseLoggerNode;
|
|
400
359
|
|
|
401
360
|
// src/nodes/output/noise-raw-texture-node.tsx
|
|
402
|
-
var
|
|
403
|
-
var
|
|
404
|
-
var
|
|
361
|
+
var import_layout7 = require("@awesome-flow/core/layout");
|
|
362
|
+
var import_react7 = require("react");
|
|
363
|
+
var import_hooks7 = require("@awesome-flow/core/hooks");
|
|
405
364
|
var import_core6 = require("@mantine/core");
|
|
406
|
-
var
|
|
365
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
407
366
|
function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
408
|
-
const updateComputedData = (0,
|
|
409
|
-
const [dataLength, setDataLength] = (0,
|
|
410
|
-
const [resolution, setResolution] = (0,
|
|
411
|
-
const incoming = (0,
|
|
412
|
-
const noise = (0,
|
|
413
|
-
(0,
|
|
367
|
+
const updateComputedData = (0, import_hooks7.useUpdateNodeComputedData)();
|
|
368
|
+
const [dataLength, setDataLength] = (0, import_react7.useState)(0);
|
|
369
|
+
const [resolution, setResolution] = (0, import_react7.useState)(0);
|
|
370
|
+
const incoming = (0, import_hooks7.useIncomingComputedData)(id);
|
|
371
|
+
const noise = (0, import_react7.useMemo)(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
372
|
+
(0, import_react7.useEffect)(() => {
|
|
414
373
|
if (noise?.length) {
|
|
415
374
|
const size = Math.ceil(Math.sqrt(noise.length));
|
|
416
375
|
const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
|
|
@@ -418,22 +377,26 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
418
377
|
dataArray.set(colors);
|
|
419
378
|
setResolution(size);
|
|
420
379
|
setDataLength(dataArray.length);
|
|
421
|
-
updateComputedData(id, {
|
|
380
|
+
updateComputedData(id, {
|
|
381
|
+
textureData: dataArray,
|
|
382
|
+
textureResolutionX: size,
|
|
383
|
+
textureResolutionY: size
|
|
384
|
+
});
|
|
422
385
|
}
|
|
423
386
|
}, [noise]);
|
|
424
|
-
return /* @__PURE__ */ (0,
|
|
425
|
-
/* @__PURE__ */ (0,
|
|
426
|
-
/* @__PURE__ */ (0,
|
|
387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_layout7.NodeContainer, { id, selected, data, type, children: [
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.Stack, { children: [
|
|
389
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.Group, { children: [
|
|
427
390
|
"Resolution: ",
|
|
428
391
|
resolution,
|
|
429
392
|
"x",
|
|
430
393
|
resolution
|
|
431
394
|
] }),
|
|
432
|
-
/* @__PURE__ */ (0,
|
|
395
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.Group, { children: [
|
|
433
396
|
"Input Length: ",
|
|
434
397
|
noise?.length || 0
|
|
435
398
|
] }),
|
|
436
|
-
/* @__PURE__ */ (0,
|
|
399
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.Group, { children: [
|
|
437
400
|
"Output Length (",
|
|
438
401
|
resolution,
|
|
439
402
|
"*",
|
|
@@ -442,67 +405,67 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
442
405
|
dataLength
|
|
443
406
|
] })
|
|
444
407
|
] }),
|
|
445
|
-
/* @__PURE__ */ (0,
|
|
408
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_layout7.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
446
409
|
] });
|
|
447
410
|
}
|
|
448
411
|
var noise_raw_texture_node_default = NoiseRawTextureNode;
|
|
449
412
|
|
|
450
413
|
// src/nodes/generators/noise-checkerboard-node.tsx
|
|
451
|
-
var
|
|
452
|
-
var
|
|
453
|
-
var
|
|
454
|
-
var
|
|
455
|
-
var
|
|
414
|
+
var import_layout8 = require("@awesome-flow/core/layout");
|
|
415
|
+
var import_react8 = require("react");
|
|
416
|
+
var import_libnoise_simplex_ts4 = require("libnoise-simplex-ts");
|
|
417
|
+
var import_hooks8 = require("@awesome-flow/core/hooks");
|
|
418
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
456
419
|
function NoiseCheckerboardNode({ id, selected, data, type }) {
|
|
457
|
-
const updateComputedData = (0,
|
|
458
|
-
const module2 = (0,
|
|
459
|
-
(0,
|
|
420
|
+
const updateComputedData = (0, import_hooks8.useUpdateNodeComputedData)();
|
|
421
|
+
const module2 = (0, import_react8.useMemo)(() => new import_libnoise_simplex_ts4.Checkerboard(), []);
|
|
422
|
+
(0, import_react8.useEffect)(() => {
|
|
460
423
|
updateComputedData(id, { module: module2 });
|
|
461
424
|
}, [id, module2, updateComputedData]);
|
|
462
|
-
return /* @__PURE__ */ (0,
|
|
425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_layout8.NodeContainer, { id, selected, data, type });
|
|
463
426
|
}
|
|
464
427
|
var noise_checkerboard_node_default = NoiseCheckerboardNode;
|
|
465
428
|
|
|
466
429
|
// src/nodes/output/positions-logger-node.tsx
|
|
467
|
-
var
|
|
468
|
-
var
|
|
430
|
+
var import_layout9 = require("@awesome-flow/core/layout");
|
|
431
|
+
var import_react9 = require("react");
|
|
469
432
|
var import_core7 = require("@mantine/core");
|
|
470
|
-
var
|
|
471
|
-
var
|
|
433
|
+
var import_hooks9 = require("@awesome-flow/core/hooks");
|
|
434
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
472
435
|
function PositionsLoggerNode({ id, selected, data, type }) {
|
|
473
|
-
const incoming = (0,
|
|
474
|
-
const positions = (0,
|
|
436
|
+
const incoming = (0, import_hooks9.useIncomingComputedData)(id);
|
|
437
|
+
const positions = (0, import_react9.useMemo)(() => {
|
|
475
438
|
return incoming?.map((p) => p.positions).flat();
|
|
476
439
|
}, [incoming]);
|
|
477
|
-
return /* @__PURE__ */ (0,
|
|
478
|
-
/* @__PURE__ */ (0,
|
|
440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_layout9.NodeContainer, { id, selected, data, type, children: [
|
|
441
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core7.Text, { children: [
|
|
479
442
|
"Size: ",
|
|
480
443
|
positions?.length || 0
|
|
481
444
|
] }),
|
|
482
|
-
/* @__PURE__ */ (0,
|
|
483
|
-
/* @__PURE__ */ (0,
|
|
445
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core7.Divider, { h: 5 }),
|
|
446
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core7.Stack, { children: positions?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core7.Text, { children: [
|
|
484
447
|
v.x,
|
|
485
448
|
":",
|
|
486
449
|
v.y,
|
|
487
450
|
":",
|
|
488
451
|
v.z
|
|
489
452
|
] }, i)) }),
|
|
490
|
-
/* @__PURE__ */ (0,
|
|
453
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_layout9.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
491
454
|
] });
|
|
492
455
|
}
|
|
493
456
|
var positions_logger_node_default = PositionsLoggerNode;
|
|
494
457
|
|
|
495
458
|
// src/nodes/generators/noise-cylinders-node.tsx
|
|
496
|
-
var
|
|
497
|
-
var
|
|
498
|
-
var
|
|
499
|
-
var
|
|
459
|
+
var import_layout10 = require("@awesome-flow/core/layout");
|
|
460
|
+
var import_react10 = require("react");
|
|
461
|
+
var import_libnoise_simplex_ts5 = require("libnoise-simplex-ts");
|
|
462
|
+
var import_hooks10 = require("@awesome-flow/core/hooks");
|
|
500
463
|
var import_components2 = require("@awesome-flow/core/components");
|
|
501
|
-
var
|
|
464
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
502
465
|
function NoiseCylindersNode({ id, selected, data, type }) {
|
|
503
|
-
const updateComputedData = (0,
|
|
504
|
-
const module2 = (0,
|
|
505
|
-
const onPropertiesChange = (0,
|
|
466
|
+
const updateComputedData = (0, import_hooks10.useUpdateNodeComputedData)();
|
|
467
|
+
const module2 = (0, import_react10.useMemo)(() => new import_libnoise_simplex_ts5.Cylinders(), []);
|
|
468
|
+
const onPropertiesChange = (0, import_react10.useCallback)(
|
|
506
469
|
(properties) => {
|
|
507
470
|
Object.keys(properties).forEach((k) => {
|
|
508
471
|
module2[k] = properties[k].value;
|
|
@@ -511,24 +474,24 @@ function NoiseCylindersNode({ id, selected, data, type }) {
|
|
|
511
474
|
},
|
|
512
475
|
[id, module2, updateComputedData]
|
|
513
476
|
);
|
|
514
|
-
return /* @__PURE__ */ (0,
|
|
515
|
-
/* @__PURE__ */ (0,
|
|
516
|
-
/* @__PURE__ */ (0,
|
|
477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_layout10.NodeContainer, { id, selected, data, type, children: [
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_components2.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
479
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_layout10.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
517
480
|
] });
|
|
518
481
|
}
|
|
519
482
|
var noise_cylinders_node_default = NoiseCylindersNode;
|
|
520
483
|
|
|
521
484
|
// src/nodes/generators/noise-perlin-node.tsx
|
|
522
|
-
var
|
|
523
|
-
var
|
|
524
|
-
var
|
|
525
|
-
var
|
|
485
|
+
var import_layout11 = require("@awesome-flow/core/layout");
|
|
486
|
+
var import_react11 = require("react");
|
|
487
|
+
var import_libnoise_simplex_ts6 = require("libnoise-simplex-ts");
|
|
488
|
+
var import_hooks11 = require("@awesome-flow/core/hooks");
|
|
526
489
|
var import_components3 = require("@awesome-flow/core/components");
|
|
527
|
-
var
|
|
490
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
528
491
|
function NoisePerlinNode({ id, selected, data, type }) {
|
|
529
|
-
const updateComputedData = (0,
|
|
530
|
-
const module2 = (0,
|
|
531
|
-
const onPropertiesChange = (0,
|
|
492
|
+
const updateComputedData = (0, import_hooks11.useUpdateNodeComputedData)();
|
|
493
|
+
const module2 = (0, import_react11.useMemo)(() => new import_libnoise_simplex_ts6.Perlin(), []);
|
|
494
|
+
const onPropertiesChange = (0, import_react11.useCallback)(
|
|
532
495
|
(properties) => {
|
|
533
496
|
Object.keys(properties).forEach((k) => {
|
|
534
497
|
module2[k] = properties[k].value;
|
|
@@ -537,67 +500,67 @@ function NoisePerlinNode({ id, selected, data, type }) {
|
|
|
537
500
|
},
|
|
538
501
|
[id, module2, updateComputedData]
|
|
539
502
|
);
|
|
540
|
-
return /* @__PURE__ */ (0,
|
|
541
|
-
/* @__PURE__ */ (0,
|
|
542
|
-
/* @__PURE__ */ (0,
|
|
503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_layout11.NodeContainer, { id, selected, data, type, children: [
|
|
504
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components3.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
505
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_layout11.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
543
506
|
] });
|
|
544
507
|
}
|
|
545
508
|
var noise_perlin_node_default = NoisePerlinNode;
|
|
546
509
|
|
|
547
510
|
// src/nodes/generators/noise-ridgedmulti-node.tsx
|
|
548
|
-
var
|
|
549
|
-
var
|
|
550
|
-
var
|
|
551
|
-
var
|
|
511
|
+
var import_layout12 = require("@awesome-flow/core/layout");
|
|
512
|
+
var import_react12 = require("react");
|
|
513
|
+
var import_libnoise_simplex_ts7 = require("libnoise-simplex-ts");
|
|
514
|
+
var import_hooks12 = require("@awesome-flow/core/hooks");
|
|
552
515
|
var import_components4 = require("@awesome-flow/core/components");
|
|
553
|
-
var
|
|
516
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
554
517
|
function NoiseRidgedMultiNode({ id, selected, data, type }) {
|
|
555
|
-
const updateComputedData = (0,
|
|
556
|
-
const module2 = (0,
|
|
557
|
-
const onPropertiesChange = (0,
|
|
518
|
+
const updateComputedData = (0, import_hooks12.useUpdateNodeComputedData)();
|
|
519
|
+
const module2 = (0, import_react12.useMemo)(() => new import_libnoise_simplex_ts7.RidgedMulti(), []);
|
|
520
|
+
const onPropertiesChange = (0, import_react12.useCallback)((properties) => {
|
|
558
521
|
Object.keys(properties).forEach((k) => module2[k] = properties[k].value);
|
|
559
522
|
updateComputedData(id, { module: module2 });
|
|
560
523
|
}, []);
|
|
561
|
-
return /* @__PURE__ */ (0,
|
|
562
|
-
/* @__PURE__ */ (0,
|
|
563
|
-
/* @__PURE__ */ (0,
|
|
524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_layout12.NodeContainer, { id, selected, data, type, children: [
|
|
525
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_components4.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
526
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_layout12.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
564
527
|
] });
|
|
565
528
|
}
|
|
566
529
|
var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
|
|
567
530
|
|
|
568
531
|
// src/nodes/generators/noise-spheres-node.tsx
|
|
569
|
-
var
|
|
570
|
-
var
|
|
571
|
-
var
|
|
572
|
-
var
|
|
532
|
+
var import_layout13 = require("@awesome-flow/core/layout");
|
|
533
|
+
var import_react13 = require("react");
|
|
534
|
+
var import_libnoise_simplex_ts8 = require("libnoise-simplex-ts");
|
|
535
|
+
var import_hooks13 = require("@awesome-flow/core/hooks");
|
|
573
536
|
var import_components5 = require("@awesome-flow/core/components");
|
|
574
|
-
var
|
|
537
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
575
538
|
function NoiseSpheresNode({ id, selected, data, type }) {
|
|
576
|
-
const updateComputedData = (0,
|
|
577
|
-
const module2 = (0,
|
|
578
|
-
const onPropertiesChange = (0,
|
|
539
|
+
const updateComputedData = (0, import_hooks13.useUpdateNodeComputedData)();
|
|
540
|
+
const module2 = (0, import_react13.useMemo)(() => new import_libnoise_simplex_ts8.Spheres(), []);
|
|
541
|
+
const onPropertiesChange = (0, import_react13.useCallback)((properties) => {
|
|
579
542
|
Object.keys(properties).forEach((k) => module2[k] = properties[k].value);
|
|
580
543
|
updateComputedData(id, { module: module2 });
|
|
581
544
|
}, []);
|
|
582
|
-
return /* @__PURE__ */ (0,
|
|
583
|
-
/* @__PURE__ */ (0,
|
|
584
|
-
/* @__PURE__ */ (0,
|
|
545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_layout13.NodeContainer, { id, selected, data, type, children: [
|
|
546
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_components5.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
547
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_layout13.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
585
548
|
] });
|
|
586
549
|
}
|
|
587
550
|
var noise_spheres_node_default = NoiseSpheresNode;
|
|
588
551
|
|
|
589
552
|
// src/nodes/generators/noise-voronoi-node.tsx
|
|
590
|
-
var
|
|
591
|
-
var
|
|
592
|
-
var
|
|
593
|
-
var
|
|
553
|
+
var import_layout14 = require("@awesome-flow/core/layout");
|
|
554
|
+
var import_react14 = require("react");
|
|
555
|
+
var import_libnoise_simplex_ts9 = require("libnoise-simplex-ts");
|
|
556
|
+
var import_hooks14 = require("@awesome-flow/core/hooks");
|
|
594
557
|
var import_components6 = require("@awesome-flow/core/components");
|
|
595
|
-
var
|
|
558
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
596
559
|
function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
597
|
-
const updateComputedData = (0,
|
|
598
|
-
const onPropertiesChange = (0,
|
|
560
|
+
const updateComputedData = (0, import_hooks14.useUpdateNodeComputedData)();
|
|
561
|
+
const onPropertiesChange = (0, import_react14.useCallback)(
|
|
599
562
|
(properties) => {
|
|
600
|
-
const module2 = new
|
|
563
|
+
const module2 = new import_libnoise_simplex_ts9.Voronoi(
|
|
601
564
|
properties.frequency.value,
|
|
602
565
|
properties.displacement.value,
|
|
603
566
|
properties.distance.value,
|
|
@@ -607,21 +570,21 @@ function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
|
607
570
|
},
|
|
608
571
|
[]
|
|
609
572
|
);
|
|
610
|
-
return /* @__PURE__ */ (0,
|
|
611
|
-
/* @__PURE__ */ (0,
|
|
612
|
-
/* @__PURE__ */ (0,
|
|
573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_layout14.NodeContainer, { id, selected, data, type, children: [
|
|
574
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_components6.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_layout14.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
613
576
|
] });
|
|
614
577
|
}
|
|
615
578
|
var noise_voronoi_node_default = NoiseVoronoiNode;
|
|
616
579
|
|
|
617
580
|
// src/nodes/modifiers/noise-combine-node.tsx
|
|
618
|
-
var
|
|
619
|
-
var
|
|
620
|
-
var
|
|
581
|
+
var import_layout15 = require("@awesome-flow/core/layout");
|
|
582
|
+
var import_react15 = require("react");
|
|
583
|
+
var import_hooks15 = require("@awesome-flow/core/hooks");
|
|
621
584
|
var import_icons_react = require("@tabler/icons-react");
|
|
622
585
|
|
|
623
586
|
// src/abstract/operations.ts
|
|
624
|
-
var
|
|
587
|
+
var import_libnoise_simplex_ts10 = require("libnoise-simplex-ts");
|
|
625
588
|
var NoiseCombineType = /* @__PURE__ */ ((NoiseCombineType3) => {
|
|
626
589
|
NoiseCombineType3["add"] = "add";
|
|
627
590
|
NoiseCombineType3["max"] = "max";
|
|
@@ -631,66 +594,66 @@ var NoiseCombineType = /* @__PURE__ */ ((NoiseCombineType3) => {
|
|
|
631
594
|
return NoiseCombineType3;
|
|
632
595
|
})(NoiseCombineType || {});
|
|
633
596
|
var noiseCombineModuleMap = {
|
|
634
|
-
["add" /* add */]:
|
|
635
|
-
["max" /* max */]:
|
|
636
|
-
["min" /* min */]:
|
|
637
|
-
["multiply" /* multiply */]:
|
|
638
|
-
["power" /* power */]:
|
|
597
|
+
["add" /* add */]: import_libnoise_simplex_ts10.Add,
|
|
598
|
+
["max" /* max */]: import_libnoise_simplex_ts10.Max,
|
|
599
|
+
["min" /* min */]: import_libnoise_simplex_ts10.Min,
|
|
600
|
+
["multiply" /* multiply */]: import_libnoise_simplex_ts10.Multiply,
|
|
601
|
+
["power" /* power */]: import_libnoise_simplex_ts10.Power
|
|
639
602
|
};
|
|
640
603
|
|
|
641
604
|
// src/nodes/modifiers/noise-combine-node.tsx
|
|
642
|
-
var
|
|
605
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
643
606
|
var options = {
|
|
644
|
-
add: /* @__PURE__ */ (0,
|
|
645
|
-
min: /* @__PURE__ */ (0,
|
|
646
|
-
max: /* @__PURE__ */ (0,
|
|
647
|
-
multiply: /* @__PURE__ */ (0,
|
|
648
|
-
power: /* @__PURE__ */ (0,
|
|
607
|
+
add: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconPlus, {}),
|
|
608
|
+
min: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronLeft, {}),
|
|
609
|
+
max: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronRight, {}),
|
|
610
|
+
multiply: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconAsterisk, {}),
|
|
611
|
+
power: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronUp, {})
|
|
649
612
|
};
|
|
650
613
|
function NoiseCombineNode({ id, selected, data, type }) {
|
|
651
|
-
const updateNodeData = (0,
|
|
652
|
-
const updateComputedData = (0,
|
|
653
|
-
const incoming = (0,
|
|
654
|
-
(0,
|
|
614
|
+
const updateNodeData = (0, import_hooks15.useUpdateNodeData)();
|
|
615
|
+
const updateComputedData = (0, import_hooks15.useUpdateNodeComputedData)();
|
|
616
|
+
const incoming = (0, import_hooks15.useIncomingComputedData)(id);
|
|
617
|
+
(0, import_react15.useEffect)(() => {
|
|
655
618
|
const ModuleFactory = noiseCombineModuleMap[data.operation];
|
|
656
619
|
if (incoming?.length > 1) {
|
|
657
620
|
const module2 = new ModuleFactory(incoming[0].module, incoming[1].module);
|
|
658
621
|
updateComputedData(id, { module: module2 });
|
|
659
622
|
}
|
|
660
623
|
}, [data.operation, incoming]);
|
|
661
|
-
const onChange = (0,
|
|
624
|
+
const onChange = (0, import_react15.useCallback)((operation) => {
|
|
662
625
|
updateNodeData(id, { operation });
|
|
663
626
|
}, []);
|
|
664
|
-
return /* @__PURE__ */ (0,
|
|
665
|
-
/* @__PURE__ */ (0,
|
|
666
|
-
/* @__PURE__ */ (0,
|
|
627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_layout15.NodeContainer, { id, selected, data, type, children: [
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_layout15.NodeCombobox, { options, selected: data.operation, onChange, width: 150 }),
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_layout15.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
667
630
|
] });
|
|
668
631
|
}
|
|
669
632
|
var noise_combine_node_default = NoiseCombineNode;
|
|
670
633
|
|
|
671
634
|
// src/nodes/modifiers/noise-clamp-node.tsx
|
|
672
|
-
var
|
|
673
|
-
var
|
|
635
|
+
var import_layout16 = require("@awesome-flow/core/layout");
|
|
636
|
+
var import_react16 = require("react");
|
|
674
637
|
var import_core8 = require("@mantine/core");
|
|
675
|
-
var
|
|
676
|
-
var
|
|
677
|
-
var
|
|
638
|
+
var import_hooks16 = require("@awesome-flow/core/hooks");
|
|
639
|
+
var import_libnoise_simplex_ts11 = require("libnoise-simplex-ts");
|
|
640
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
678
641
|
function NoiseClampNode({ id, selected, data, type }) {
|
|
679
|
-
const [lowerBound, setLowerBound] = (0,
|
|
680
|
-
const [upperBound, setUpperBound] = (0,
|
|
681
|
-
const incoming = (0,
|
|
682
|
-
const updateNodeData = (0,
|
|
683
|
-
const updateComputedData = (0,
|
|
684
|
-
(0,
|
|
642
|
+
const [lowerBound, setLowerBound] = (0, import_react16.useState)(data.lowerBound);
|
|
643
|
+
const [upperBound, setUpperBound] = (0, import_react16.useState)(data.upperBound);
|
|
644
|
+
const incoming = (0, import_hooks16.useIncomingComputedData)(id);
|
|
645
|
+
const updateNodeData = (0, import_hooks16.useUpdateNodeData)();
|
|
646
|
+
const updateComputedData = (0, import_hooks16.useUpdateNodeComputedData)();
|
|
647
|
+
(0, import_react16.useEffect)(() => {
|
|
685
648
|
if (incoming?.length) {
|
|
686
|
-
const module2 = new
|
|
649
|
+
const module2 = new import_libnoise_simplex_ts11.Clamp(incoming[0].module, lowerBound, upperBound);
|
|
687
650
|
updateComputedData(id, { module: module2 });
|
|
688
651
|
}
|
|
689
652
|
updateNodeData(id, { lowerBound, upperBound });
|
|
690
653
|
}, [incoming, lowerBound, upperBound]);
|
|
691
|
-
return /* @__PURE__ */ (0,
|
|
692
|
-
/* @__PURE__ */ (0,
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_layout16.NodeContainer, { id, selected, data, type, children: [
|
|
655
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core8.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core8.Group, { children: [
|
|
656
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
694
657
|
import_core8.NumberInput,
|
|
695
658
|
{
|
|
696
659
|
size: "xs",
|
|
@@ -700,7 +663,7 @@ function NoiseClampNode({ id, selected, data, type }) {
|
|
|
700
663
|
step: 0.1
|
|
701
664
|
}
|
|
702
665
|
),
|
|
703
|
-
/* @__PURE__ */ (0,
|
|
666
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
704
667
|
import_core8.NumberInput,
|
|
705
668
|
{
|
|
706
669
|
size: "xs",
|
|
@@ -711,41 +674,41 @@ function NoiseClampNode({ id, selected, data, type }) {
|
|
|
711
674
|
}
|
|
712
675
|
)
|
|
713
676
|
] }) }),
|
|
714
|
-
/* @__PURE__ */ (0,
|
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_layout16.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
715
678
|
] });
|
|
716
679
|
}
|
|
717
680
|
var noise_clamp_node_default = NoiseClampNode;
|
|
718
681
|
|
|
719
682
|
// src/nodes/modifiers/noise-abs-node.tsx
|
|
720
|
-
var
|
|
721
|
-
var
|
|
722
|
-
var
|
|
723
|
-
var
|
|
724
|
-
var
|
|
683
|
+
var import_layout17 = require("@awesome-flow/core/layout");
|
|
684
|
+
var import_react17 = require("react");
|
|
685
|
+
var import_hooks17 = require("@awesome-flow/core/hooks");
|
|
686
|
+
var import_libnoise_simplex_ts12 = require("libnoise-simplex-ts");
|
|
687
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
725
688
|
function NoiseAbsNode({ id, selected, data, type }) {
|
|
726
|
-
const incoming = (0,
|
|
727
|
-
const updateComputedData = (0,
|
|
728
|
-
(0,
|
|
689
|
+
const incoming = (0, import_hooks17.useIncomingComputedData)(id);
|
|
690
|
+
const updateComputedData = (0, import_hooks17.useUpdateNodeComputedData)();
|
|
691
|
+
(0, import_react17.useEffect)(() => {
|
|
729
692
|
if (incoming?.length > 0) {
|
|
730
|
-
const module2 = new
|
|
693
|
+
const module2 = new import_libnoise_simplex_ts12.Abs(incoming[0].module);
|
|
731
694
|
updateComputedData(id, { module: module2 });
|
|
732
695
|
}
|
|
733
696
|
}, [incoming]);
|
|
734
|
-
return /* @__PURE__ */ (0,
|
|
697
|
+
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" }) });
|
|
735
698
|
}
|
|
736
699
|
var noise_abs_node_default = NoiseAbsNode;
|
|
737
700
|
|
|
738
701
|
// src/nodes/output/noise-output-node.tsx
|
|
739
|
-
var
|
|
740
|
-
var
|
|
741
|
-
var
|
|
702
|
+
var import_layout18 = require("@awesome-flow/core/layout");
|
|
703
|
+
var import_react18 = require("react");
|
|
704
|
+
var import_hooks18 = require("@awesome-flow/core/hooks");
|
|
742
705
|
var import_components7 = require("@awesome-flow/core/components");
|
|
743
706
|
var import_core9 = require("@mantine/core");
|
|
744
|
-
var
|
|
707
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
745
708
|
function NoiseOutputNode({ id, selected, data, type }) {
|
|
746
|
-
const [size, setSize] = (0,
|
|
747
|
-
const updateComputedData = (0,
|
|
748
|
-
const onDataUpdated = (0,
|
|
709
|
+
const [size, setSize] = (0, import_react18.useState)(0);
|
|
710
|
+
const updateComputedData = (0, import_hooks18.useUpdateNodeComputedData)();
|
|
711
|
+
const onDataUpdated = (0, import_react18.useCallback)(
|
|
749
712
|
(handleData) => {
|
|
750
713
|
const incomingPositions = handleData["position" /* position */];
|
|
751
714
|
const incomingModule = handleData["module" /* module */];
|
|
@@ -767,8 +730,8 @@ function NoiseOutputNode({ id, selected, data, type }) {
|
|
|
767
730
|
},
|
|
768
731
|
[]
|
|
769
732
|
);
|
|
770
|
-
return /* @__PURE__ */ (0,
|
|
771
|
-
/* @__PURE__ */ (0,
|
|
733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_layout18.NodeContainer, { id, selected, data, type, children: [
|
|
734
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
772
735
|
import_components7.HandlesIncomingDataStatus,
|
|
773
736
|
{
|
|
774
737
|
nodeId: id,
|
|
@@ -779,25 +742,25 @@ function NoiseOutputNode({ id, selected, data, type }) {
|
|
|
779
742
|
resetComputedData: true
|
|
780
743
|
}
|
|
781
744
|
),
|
|
782
|
-
/* @__PURE__ */ (0,
|
|
745
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core9.Text, { mt: 5, children: [
|
|
783
746
|
"Noise points: ",
|
|
784
747
|
size
|
|
785
748
|
] }),
|
|
786
|
-
/* @__PURE__ */ (0,
|
|
749
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_layout18.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
787
750
|
] });
|
|
788
751
|
}
|
|
789
752
|
var noise_output_node_default = NoiseOutputNode;
|
|
790
753
|
|
|
791
754
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
792
|
-
var
|
|
755
|
+
var import_layout19 = require("@awesome-flow/core/layout");
|
|
793
756
|
var import_core10 = require("@mantine/core");
|
|
794
|
-
var
|
|
757
|
+
var import_hooks19 = require("@awesome-flow/core/hooks");
|
|
795
758
|
|
|
796
|
-
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
797
|
-
var
|
|
759
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
760
|
+
var import_react25 = require("react");
|
|
798
761
|
|
|
799
|
-
// ../../node_modules/@mantine/form/esm/actions/actions.mjs
|
|
800
|
-
var
|
|
762
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/actions/actions.mjs
|
|
763
|
+
var import_react19 = require("react");
|
|
801
764
|
function validateFormName(name) {
|
|
802
765
|
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
803
766
|
throw new Error(
|
|
@@ -805,7 +768,7 @@ function validateFormName(name) {
|
|
|
805
768
|
);
|
|
806
769
|
}
|
|
807
770
|
}
|
|
808
|
-
var useIsomorphicEffect = typeof window !== "undefined" ?
|
|
771
|
+
var useIsomorphicEffect = typeof window !== "undefined" ? import_react19.useLayoutEffect : import_react19.useEffect;
|
|
809
772
|
function useFormEvent(eventKey, handler) {
|
|
810
773
|
useIsomorphicEffect(() => {
|
|
811
774
|
if (eventKey) {
|
|
@@ -877,7 +840,7 @@ function useFormActions(name, form) {
|
|
|
877
840
|
useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
|
|
878
841
|
}
|
|
879
842
|
|
|
880
|
-
// ../../node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
|
|
843
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
|
|
881
844
|
function getInputOnChange(setValue) {
|
|
882
845
|
return (val) => {
|
|
883
846
|
if (!val) {
|
|
@@ -901,10 +864,10 @@ function getInputOnChange(setValue) {
|
|
|
901
864
|
};
|
|
902
865
|
}
|
|
903
866
|
|
|
904
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
905
|
-
var
|
|
867
|
+
// ../../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
|
|
868
|
+
var import_react20 = require("react");
|
|
906
869
|
|
|
907
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
870
|
+
// ../../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
|
|
908
871
|
function filterErrors(errors) {
|
|
909
872
|
if (errors === null || typeof errors !== "object") {
|
|
910
873
|
return {};
|
|
@@ -918,18 +881,21 @@ function filterErrors(errors) {
|
|
|
918
881
|
}, {});
|
|
919
882
|
}
|
|
920
883
|
|
|
921
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
884
|
+
// ../../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
|
|
922
885
|
function useFormErrors(initialErrors) {
|
|
923
|
-
const [errorsState, setErrorsState] = (0,
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
886
|
+
const [errorsState, setErrorsState] = (0, import_react20.useState)(filterErrors(initialErrors));
|
|
887
|
+
const errorsRef = (0, import_react20.useRef)(errorsState);
|
|
888
|
+
const setErrors = (0, import_react20.useCallback)((errors) => {
|
|
889
|
+
setErrorsState((current) => {
|
|
890
|
+
const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
|
|
891
|
+
errorsRef.current = newErrors;
|
|
892
|
+
return newErrors;
|
|
893
|
+
});
|
|
928
894
|
}, []);
|
|
929
|
-
const clearErrors = (0,
|
|
930
|
-
const clearFieldError = (0,
|
|
895
|
+
const clearErrors = (0, import_react20.useCallback)(() => setErrors({}), []);
|
|
896
|
+
const clearFieldError = (0, import_react20.useCallback)(
|
|
931
897
|
(path) => {
|
|
932
|
-
if (
|
|
898
|
+
if (errorsRef.current[path] === void 0) {
|
|
933
899
|
return;
|
|
934
900
|
}
|
|
935
901
|
setErrors((current) => {
|
|
@@ -940,11 +906,11 @@ function useFormErrors(initialErrors) {
|
|
|
940
906
|
},
|
|
941
907
|
[errorsState]
|
|
942
908
|
);
|
|
943
|
-
const setFieldError = (0,
|
|
909
|
+
const setFieldError = (0, import_react20.useCallback)(
|
|
944
910
|
(path, error) => {
|
|
945
911
|
if (error == null || error === false) {
|
|
946
912
|
clearFieldError(path);
|
|
947
|
-
} else if (
|
|
913
|
+
} else if (errorsRef.current[path] !== error) {
|
|
948
914
|
setErrors((current) => ({ ...current, [path]: error }));
|
|
949
915
|
}
|
|
950
916
|
},
|
|
@@ -959,10 +925,10 @@ function useFormErrors(initialErrors) {
|
|
|
959
925
|
};
|
|
960
926
|
}
|
|
961
927
|
|
|
962
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
963
|
-
var
|
|
928
|
+
// ../../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
|
|
929
|
+
var import_react21 = require("react");
|
|
964
930
|
|
|
965
|
-
// ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
931
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
966
932
|
function clearListState(field, state) {
|
|
967
933
|
if (state === null || typeof state !== "object") {
|
|
968
934
|
return {};
|
|
@@ -976,7 +942,7 @@ function clearListState(field, state) {
|
|
|
976
942
|
return clone;
|
|
977
943
|
}
|
|
978
944
|
|
|
979
|
-
// ../../node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
945
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
980
946
|
function getIndexFromKeyAfterPath(key, path) {
|
|
981
947
|
const split = key.substring(path.length + 1).split(".")[0];
|
|
982
948
|
return parseInt(split, 10);
|
|
@@ -1016,7 +982,7 @@ function changeErrorIndices(path, index, errors, change) {
|
|
|
1016
982
|
return cloned;
|
|
1017
983
|
}
|
|
1018
984
|
|
|
1019
|
-
// ../../node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
985
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
1020
986
|
function reorderErrors(path, { from, to }, errors) {
|
|
1021
987
|
const oldKeyStart = `${path}.${from}`;
|
|
1022
988
|
const newKeyStart = `${path}.${to}`;
|
|
@@ -1044,18 +1010,15 @@ function reorderErrors(path, { from, to }, errors) {
|
|
|
1044
1010
|
return clone;
|
|
1045
1011
|
}
|
|
1046
1012
|
|
|
1047
|
-
// ../../node_modules/klona/full/index.mjs
|
|
1013
|
+
// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
|
|
1048
1014
|
function set(obj, key, val) {
|
|
1049
|
-
if (typeof val.value === "object")
|
|
1050
|
-
val.value = klona(val.value);
|
|
1015
|
+
if (typeof val.value === "object") val.value = klona(val.value);
|
|
1051
1016
|
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === "__proto__") {
|
|
1052
1017
|
Object.defineProperty(obj, key, val);
|
|
1053
|
-
} else
|
|
1054
|
-
obj[key] = val.value;
|
|
1018
|
+
} else obj[key] = val.value;
|
|
1055
1019
|
}
|
|
1056
1020
|
function klona(x) {
|
|
1057
|
-
if (typeof x !== "object")
|
|
1058
|
-
return x;
|
|
1021
|
+
if (typeof x !== "object") return x;
|
|
1059
1022
|
var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);
|
|
1060
1023
|
if (str === "[object Object]") {
|
|
1061
1024
|
tmp = Object.create(x.__proto__ || null);
|
|
@@ -1087,15 +1050,14 @@ function klona(x) {
|
|
|
1087
1050
|
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
1088
1051
|
}
|
|
1089
1052
|
for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
1090
|
-
if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k])
|
|
1091
|
-
continue;
|
|
1053
|
+
if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k]) continue;
|
|
1092
1054
|
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
1093
1055
|
}
|
|
1094
1056
|
}
|
|
1095
1057
|
return tmp || x;
|
|
1096
1058
|
}
|
|
1097
1059
|
|
|
1098
|
-
// ../../node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
1060
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
1099
1061
|
function getSplittedPath(path) {
|
|
1100
1062
|
if (typeof path !== "string") {
|
|
1101
1063
|
return [];
|
|
@@ -1103,7 +1065,7 @@ function getSplittedPath(path) {
|
|
|
1103
1065
|
return path.split(".");
|
|
1104
1066
|
}
|
|
1105
1067
|
|
|
1106
|
-
// ../../node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
1068
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
1107
1069
|
function getPath(path, values) {
|
|
1108
1070
|
const splittedPath = getSplittedPath(path);
|
|
1109
1071
|
if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
|
|
@@ -1119,7 +1081,7 @@ function getPath(path, values) {
|
|
|
1119
1081
|
return value;
|
|
1120
1082
|
}
|
|
1121
1083
|
|
|
1122
|
-
// ../../node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
1084
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
1123
1085
|
function setPath(path, value, values) {
|
|
1124
1086
|
const splittedPath = getSplittedPath(path);
|
|
1125
1087
|
if (splittedPath.length === 0) {
|
|
@@ -1141,7 +1103,7 @@ function setPath(path, value, values) {
|
|
|
1141
1103
|
return cloned;
|
|
1142
1104
|
}
|
|
1143
1105
|
|
|
1144
|
-
// ../../node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
1106
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
1145
1107
|
function reorderPath(path, { from, to }, values) {
|
|
1146
1108
|
const currentValue = getPath(path, values);
|
|
1147
1109
|
if (!Array.isArray(currentValue)) {
|
|
@@ -1154,7 +1116,7 @@ function reorderPath(path, { from, to }, values) {
|
|
|
1154
1116
|
return setPath(path, cloned, values);
|
|
1155
1117
|
}
|
|
1156
1118
|
|
|
1157
|
-
// ../../node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
1119
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
1158
1120
|
function insertPath(path, value, index, values) {
|
|
1159
1121
|
const currentValue = getPath(path, values);
|
|
1160
1122
|
if (!Array.isArray(currentValue)) {
|
|
@@ -1165,7 +1127,7 @@ function insertPath(path, value, index, values) {
|
|
|
1165
1127
|
return setPath(path, cloned, values);
|
|
1166
1128
|
}
|
|
1167
1129
|
|
|
1168
|
-
// ../../node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
1130
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
1169
1131
|
function removePath(path, index, values) {
|
|
1170
1132
|
const currentValue = getPath(path, values);
|
|
1171
1133
|
if (!Array.isArray(currentValue)) {
|
|
@@ -1178,13 +1140,13 @@ function removePath(path, index, values) {
|
|
|
1178
1140
|
);
|
|
1179
1141
|
}
|
|
1180
1142
|
|
|
1181
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
1143
|
+
// ../../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
|
|
1182
1144
|
function useFormList({
|
|
1183
1145
|
$values,
|
|
1184
1146
|
$errors,
|
|
1185
1147
|
$status
|
|
1186
1148
|
}) {
|
|
1187
|
-
const reorderListItem = (0,
|
|
1149
|
+
const reorderListItem = (0, import_react21.useCallback)((path, payload) => {
|
|
1188
1150
|
$status.clearFieldDirty(path);
|
|
1189
1151
|
$errors.setErrors((errs) => reorderErrors(path, payload, errs));
|
|
1190
1152
|
$values.setValues({
|
|
@@ -1192,7 +1154,7 @@ function useFormList({
|
|
|
1192
1154
|
updateState: true
|
|
1193
1155
|
});
|
|
1194
1156
|
}, []);
|
|
1195
|
-
const removeListItem = (0,
|
|
1157
|
+
const removeListItem = (0, import_react21.useCallback)((path, index) => {
|
|
1196
1158
|
$status.clearFieldDirty(path);
|
|
1197
1159
|
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));
|
|
1198
1160
|
$values.setValues({
|
|
@@ -1200,7 +1162,7 @@ function useFormList({
|
|
|
1200
1162
|
updateState: true
|
|
1201
1163
|
});
|
|
1202
1164
|
}, []);
|
|
1203
|
-
const insertListItem = (0,
|
|
1165
|
+
const insertListItem = (0, import_react21.useCallback)((path, item, index) => {
|
|
1204
1166
|
$status.clearFieldDirty(path);
|
|
1205
1167
|
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));
|
|
1206
1168
|
$values.setValues({
|
|
@@ -1211,11 +1173,11 @@ function useFormList({
|
|
|
1211
1173
|
return { reorderListItem, removeListItem, insertListItem };
|
|
1212
1174
|
}
|
|
1213
1175
|
|
|
1214
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1215
|
-
var
|
|
1176
|
+
// ../../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
|
|
1177
|
+
var import_react22 = require("react");
|
|
1216
1178
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
1217
1179
|
|
|
1218
|
-
// ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
1180
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
1219
1181
|
function getStatus(status, path) {
|
|
1220
1182
|
const paths = Object.keys(status);
|
|
1221
1183
|
if (typeof path === "string") {
|
|
@@ -1225,38 +1187,38 @@ function getStatus(status, path) {
|
|
|
1225
1187
|
return paths.some((statusPath) => status[statusPath]);
|
|
1226
1188
|
}
|
|
1227
1189
|
|
|
1228
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1190
|
+
// ../../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
|
|
1229
1191
|
function useFormStatus({
|
|
1230
1192
|
initialDirty,
|
|
1231
1193
|
initialTouched,
|
|
1232
1194
|
mode,
|
|
1233
1195
|
$values
|
|
1234
1196
|
}) {
|
|
1235
|
-
const [touchedState, setTouchedState] = (0,
|
|
1236
|
-
const [dirtyState, setDirtyState] = (0,
|
|
1237
|
-
const touchedRef = (0,
|
|
1238
|
-
const dirtyRef = (0,
|
|
1239
|
-
const setTouched = (0,
|
|
1197
|
+
const [touchedState, setTouchedState] = (0, import_react22.useState)(initialTouched);
|
|
1198
|
+
const [dirtyState, setDirtyState] = (0, import_react22.useState)(initialDirty);
|
|
1199
|
+
const touchedRef = (0, import_react22.useRef)(initialTouched);
|
|
1200
|
+
const dirtyRef = (0, import_react22.useRef)(initialDirty);
|
|
1201
|
+
const setTouched = (0, import_react22.useCallback)((values) => {
|
|
1240
1202
|
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
1241
1203
|
touchedRef.current = resolvedValues;
|
|
1242
1204
|
if (mode === "controlled") {
|
|
1243
1205
|
setTouchedState(resolvedValues);
|
|
1244
1206
|
}
|
|
1245
1207
|
}, []);
|
|
1246
|
-
const setDirty = (0,
|
|
1208
|
+
const setDirty = (0, import_react22.useCallback)((values) => {
|
|
1247
1209
|
const resolvedValues = typeof values === "function" ? values(dirtyRef.current) : values;
|
|
1248
1210
|
dirtyRef.current = resolvedValues;
|
|
1249
1211
|
if (mode === "controlled") {
|
|
1250
1212
|
setDirtyState(resolvedValues);
|
|
1251
1213
|
}
|
|
1252
1214
|
}, []);
|
|
1253
|
-
const resetTouched = (0,
|
|
1215
|
+
const resetTouched = (0, import_react22.useCallback)(() => setTouched({}), []);
|
|
1254
1216
|
const resetDirty = (values) => {
|
|
1255
1217
|
const newSnapshot = values ? { ...values, ...$values.refValues.current } : $values.refValues.current;
|
|
1256
1218
|
$values.setValuesSnapshot(newSnapshot);
|
|
1257
1219
|
setDirty({});
|
|
1258
1220
|
};
|
|
1259
|
-
const setFieldTouched = (0,
|
|
1221
|
+
const setFieldTouched = (0, import_react22.useCallback)((path, touched) => {
|
|
1260
1222
|
setTouched((currentTouched) => {
|
|
1261
1223
|
if (getStatus(currentTouched, path) === touched) {
|
|
1262
1224
|
return currentTouched;
|
|
@@ -1264,7 +1226,7 @@ function useFormStatus({
|
|
|
1264
1226
|
return { ...currentTouched, [path]: touched };
|
|
1265
1227
|
});
|
|
1266
1228
|
}, []);
|
|
1267
|
-
const setFieldDirty = (0,
|
|
1229
|
+
const setFieldDirty = (0, import_react22.useCallback)((path, dirty) => {
|
|
1268
1230
|
setDirty((currentDirty) => {
|
|
1269
1231
|
if (getStatus(currentDirty, path) === dirty) {
|
|
1270
1232
|
return currentDirty;
|
|
@@ -1272,11 +1234,11 @@ function useFormStatus({
|
|
|
1272
1234
|
return { ...currentDirty, [path]: dirty };
|
|
1273
1235
|
});
|
|
1274
1236
|
}, []);
|
|
1275
|
-
const isTouched = (0,
|
|
1237
|
+
const isTouched = (0, import_react22.useCallback)(
|
|
1276
1238
|
(path) => getStatus(touchedRef.current, path),
|
|
1277
1239
|
[]
|
|
1278
1240
|
);
|
|
1279
|
-
const clearFieldDirty = (0,
|
|
1241
|
+
const clearFieldDirty = (0, import_react22.useCallback)(
|
|
1280
1242
|
(path) => setDirty((current) => {
|
|
1281
1243
|
if (typeof path !== "string") {
|
|
1282
1244
|
return current;
|
|
@@ -1290,7 +1252,7 @@ function useFormStatus({
|
|
|
1290
1252
|
}),
|
|
1291
1253
|
[]
|
|
1292
1254
|
);
|
|
1293
|
-
const isDirty = (0,
|
|
1255
|
+
const isDirty = (0, import_react22.useCallback)((path) => {
|
|
1294
1256
|
if (path) {
|
|
1295
1257
|
const overriddenValue = getPath(path, dirtyRef.current);
|
|
1296
1258
|
if (typeof overriddenValue === "boolean") {
|
|
@@ -1306,8 +1268,8 @@ function useFormStatus({
|
|
|
1306
1268
|
}
|
|
1307
1269
|
return !(0, import_fast_deep_equal.default)($values.refValues.current, $values.valuesSnapshot.current);
|
|
1308
1270
|
}, []);
|
|
1309
|
-
const getDirty = (0,
|
|
1310
|
-
const getTouched = (0,
|
|
1271
|
+
const getDirty = (0, import_react22.useCallback)(() => dirtyRef.current, []);
|
|
1272
|
+
const getTouched = (0, import_react22.useCallback)(() => touchedRef.current, []);
|
|
1311
1273
|
return {
|
|
1312
1274
|
touchedState,
|
|
1313
1275
|
dirtyState,
|
|
@@ -1329,18 +1291,18 @@ function useFormStatus({
|
|
|
1329
1291
|
};
|
|
1330
1292
|
}
|
|
1331
1293
|
|
|
1332
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1333
|
-
var
|
|
1294
|
+
// ../../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
|
|
1295
|
+
var import_react23 = require("react");
|
|
1334
1296
|
function useFormValues({
|
|
1335
1297
|
initialValues,
|
|
1336
1298
|
onValuesChange,
|
|
1337
1299
|
mode
|
|
1338
1300
|
}) {
|
|
1339
|
-
const initialized = (0,
|
|
1340
|
-
const [stateValues, setStateValues] = (0,
|
|
1341
|
-
const refValues = (0,
|
|
1342
|
-
const valuesSnapshot = (0,
|
|
1343
|
-
const setValues = (0,
|
|
1301
|
+
const initialized = (0, import_react23.useRef)(false);
|
|
1302
|
+
const [stateValues, setStateValues] = (0, import_react23.useState)(initialValues || {});
|
|
1303
|
+
const refValues = (0, import_react23.useRef)(stateValues);
|
|
1304
|
+
const valuesSnapshot = (0, import_react23.useRef)(stateValues);
|
|
1305
|
+
const setValues = (0, import_react23.useCallback)(
|
|
1344
1306
|
({
|
|
1345
1307
|
values,
|
|
1346
1308
|
subscribers,
|
|
@@ -1357,7 +1319,7 @@ function useFormValues({
|
|
|
1357
1319
|
},
|
|
1358
1320
|
[onValuesChange]
|
|
1359
1321
|
);
|
|
1360
|
-
const setFieldValue = (0,
|
|
1322
|
+
const setFieldValue = (0, import_react23.useCallback)((payload) => {
|
|
1361
1323
|
const currentValue = getPath(payload.path, refValues.current);
|
|
1362
1324
|
const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;
|
|
1363
1325
|
if (currentValue !== updatedValue) {
|
|
@@ -1369,10 +1331,10 @@ function useFormValues({
|
|
|
1369
1331
|
);
|
|
1370
1332
|
}
|
|
1371
1333
|
}, []);
|
|
1372
|
-
const setValuesSnapshot = (0,
|
|
1334
|
+
const setValuesSnapshot = (0, import_react23.useCallback)((payload) => {
|
|
1373
1335
|
valuesSnapshot.current = payload;
|
|
1374
1336
|
}, []);
|
|
1375
|
-
const initialize = (0,
|
|
1337
|
+
const initialize = (0, import_react23.useCallback)((values, onInitialize) => {
|
|
1376
1338
|
if (!initialized.current) {
|
|
1377
1339
|
initialized.current = true;
|
|
1378
1340
|
setValues({ values, updateState: mode === "controlled" });
|
|
@@ -1380,14 +1342,14 @@ function useFormValues({
|
|
|
1380
1342
|
onInitialize();
|
|
1381
1343
|
}
|
|
1382
1344
|
}, []);
|
|
1383
|
-
const resetValues = (0,
|
|
1345
|
+
const resetValues = (0, import_react23.useCallback)(() => {
|
|
1384
1346
|
setValues({
|
|
1385
1347
|
values: valuesSnapshot.current,
|
|
1386
1348
|
updateState: true,
|
|
1387
1349
|
mergeWithPreviousValues: false
|
|
1388
1350
|
});
|
|
1389
1351
|
}, []);
|
|
1390
|
-
const getValues = (0,
|
|
1352
|
+
const getValues = (0, import_react23.useCallback)(() => refValues.current, []);
|
|
1391
1353
|
return {
|
|
1392
1354
|
initialized,
|
|
1393
1355
|
stateValues,
|
|
@@ -1402,16 +1364,16 @@ function useFormValues({
|
|
|
1402
1364
|
};
|
|
1403
1365
|
}
|
|
1404
1366
|
|
|
1405
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1406
|
-
var
|
|
1367
|
+
// ../../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
|
|
1368
|
+
var import_react24 = require("react");
|
|
1407
1369
|
function useFormWatch({
|
|
1408
1370
|
$status
|
|
1409
1371
|
}) {
|
|
1410
|
-
const subscribers = (0,
|
|
1372
|
+
const subscribers = (0, import_react24.useRef)(
|
|
1411
1373
|
{}
|
|
1412
1374
|
);
|
|
1413
|
-
const watch = (0,
|
|
1414
|
-
(0,
|
|
1375
|
+
const watch = (0, import_react24.useCallback)((path, callback) => {
|
|
1376
|
+
(0, import_react24.useEffect)(() => {
|
|
1415
1377
|
subscribers.current[path] = subscribers.current[path] || [];
|
|
1416
1378
|
subscribers.current[path].push(callback);
|
|
1417
1379
|
return () => {
|
|
@@ -1419,7 +1381,7 @@ function useFormWatch({
|
|
|
1419
1381
|
};
|
|
1420
1382
|
}, [callback]);
|
|
1421
1383
|
}, []);
|
|
1422
|
-
const getFieldSubscribers = (0,
|
|
1384
|
+
const getFieldSubscribers = (0, import_react24.useCallback)((path) => {
|
|
1423
1385
|
if (!subscribers.current[path]) {
|
|
1424
1386
|
return [];
|
|
1425
1387
|
}
|
|
@@ -1439,12 +1401,12 @@ function useFormWatch({
|
|
|
1439
1401
|
};
|
|
1440
1402
|
}
|
|
1441
1403
|
|
|
1442
|
-
// ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1404
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1443
1405
|
function getDataPath(formName, fieldPath) {
|
|
1444
1406
|
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
1445
1407
|
}
|
|
1446
1408
|
|
|
1447
|
-
// ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1409
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1448
1410
|
function getValidationResults(errors) {
|
|
1449
1411
|
const filteredErrors = filterErrors(errors);
|
|
1450
1412
|
return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
|
|
@@ -1482,7 +1444,7 @@ function validateValues(validate, values) {
|
|
|
1482
1444
|
return getValidationResults(validateRulesRecord(validate, values));
|
|
1483
1445
|
}
|
|
1484
1446
|
|
|
1485
|
-
// ../../node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
1447
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
1486
1448
|
function validateFieldValue(path, rules, values) {
|
|
1487
1449
|
if (typeof path !== "string") {
|
|
1488
1450
|
return { hasError: false, error: null };
|
|
@@ -1494,10 +1456,10 @@ function validateFieldValue(path, rules, values) {
|
|
|
1494
1456
|
return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
|
|
1495
1457
|
}
|
|
1496
1458
|
|
|
1497
|
-
// ../../node_modules/@mantine/form/esm/form-index.mjs
|
|
1459
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/form-index.mjs
|
|
1498
1460
|
var FORM_INDEX = "__MANTINE_FORM_INDEX__";
|
|
1499
1461
|
|
|
1500
|
-
// ../../node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
1462
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
1501
1463
|
function shouldValidateOnChange(path, validateInputOnChange) {
|
|
1502
1464
|
if (!validateInputOnChange) {
|
|
1503
1465
|
return false;
|
|
@@ -1511,7 +1473,7 @@ function shouldValidateOnChange(path, validateInputOnChange) {
|
|
|
1511
1473
|
return false;
|
|
1512
1474
|
}
|
|
1513
1475
|
|
|
1514
|
-
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
1476
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
1515
1477
|
function useForm({
|
|
1516
1478
|
name,
|
|
1517
1479
|
mode = "controlled",
|
|
@@ -1532,19 +1494,19 @@ function useForm({
|
|
|
1532
1494
|
const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });
|
|
1533
1495
|
const $list = useFormList({ $values, $errors, $status });
|
|
1534
1496
|
const $watch = useFormWatch({ $status });
|
|
1535
|
-
const [formKey, setFormKey] = (0,
|
|
1536
|
-
const [fieldKeys, setFieldKeys] = (0,
|
|
1537
|
-
const reset = (0,
|
|
1497
|
+
const [formKey, setFormKey] = (0, import_react25.useState)(0);
|
|
1498
|
+
const [fieldKeys, setFieldKeys] = (0, import_react25.useState)({});
|
|
1499
|
+
const reset = (0, import_react25.useCallback)(() => {
|
|
1538
1500
|
$values.resetValues();
|
|
1539
1501
|
$errors.clearErrors();
|
|
1540
1502
|
$status.resetDirty();
|
|
1541
1503
|
$status.resetTouched();
|
|
1542
1504
|
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
1543
1505
|
}, []);
|
|
1544
|
-
const initialize = (0,
|
|
1506
|
+
const initialize = (0, import_react25.useCallback)((values) => {
|
|
1545
1507
|
$values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
|
|
1546
1508
|
}, []);
|
|
1547
|
-
const setFieldValue = (0,
|
|
1509
|
+
const setFieldValue = (0, import_react25.useCallback)(
|
|
1548
1510
|
(path, value, options2) => {
|
|
1549
1511
|
const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
|
|
1550
1512
|
$status.clearFieldDirty(path);
|
|
@@ -1569,7 +1531,7 @@ function useForm({
|
|
|
1569
1531
|
},
|
|
1570
1532
|
[onValuesChange, rules]
|
|
1571
1533
|
);
|
|
1572
|
-
const setValues = (0,
|
|
1534
|
+
const setValues = (0, import_react25.useCallback)(
|
|
1573
1535
|
(values) => {
|
|
1574
1536
|
const previousValues = $values.refValues.current;
|
|
1575
1537
|
$values.setValues({ values, updateState: mode === "controlled" });
|
|
@@ -1585,12 +1547,12 @@ function useForm({
|
|
|
1585
1547
|
},
|
|
1586
1548
|
[onValuesChange, clearInputErrorOnChange]
|
|
1587
1549
|
);
|
|
1588
|
-
const validate = (0,
|
|
1550
|
+
const validate = (0, import_react25.useCallback)(() => {
|
|
1589
1551
|
const results = validateValues(rules, $values.refValues.current);
|
|
1590
1552
|
$errors.setErrors(results.errors);
|
|
1591
1553
|
return results;
|
|
1592
1554
|
}, [rules]);
|
|
1593
|
-
const validateField = (0,
|
|
1555
|
+
const validateField = (0, import_react25.useCallback)(
|
|
1594
1556
|
(path) => {
|
|
1595
1557
|
const results = validateFieldValue(path, rules, $values.refValues.current);
|
|
1596
1558
|
results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);
|
|
@@ -1646,16 +1608,16 @@ function useForm({
|
|
|
1646
1608
|
}
|
|
1647
1609
|
};
|
|
1648
1610
|
const getTransformedValues = (input) => transformValues(input || $values.refValues.current);
|
|
1649
|
-
const onReset = (0,
|
|
1611
|
+
const onReset = (0, import_react25.useCallback)((event) => {
|
|
1650
1612
|
event.preventDefault();
|
|
1651
1613
|
reset();
|
|
1652
1614
|
}, []);
|
|
1653
|
-
const isValid = (0,
|
|
1615
|
+
const isValid = (0, import_react25.useCallback)(
|
|
1654
1616
|
(path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,
|
|
1655
1617
|
[rules]
|
|
1656
1618
|
);
|
|
1657
1619
|
const key = (path) => `${formKey}-${path}-${fieldKeys[path] || 0}`;
|
|
1658
|
-
const getInputNode = (0,
|
|
1620
|
+
const getInputNode = (0, import_react25.useCallback)(
|
|
1659
1621
|
(path) => document.querySelector(`[data-path="${getDataPath(name, path)}"]`),
|
|
1660
1622
|
[]
|
|
1661
1623
|
);
|
|
@@ -1700,18 +1662,17 @@ function useForm({
|
|
|
1700
1662
|
}
|
|
1701
1663
|
|
|
1702
1664
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
1703
|
-
var
|
|
1704
|
-
var
|
|
1705
|
-
var import_util = require("libnoise-ts/util");
|
|
1665
|
+
var import_react26 = require("react");
|
|
1666
|
+
var import_libnoise_simplex_ts13 = require("libnoise-simplex-ts");
|
|
1706
1667
|
var import_icons_react2 = require("@tabler/icons-react");
|
|
1707
|
-
var
|
|
1668
|
+
var import_hooks20 = require("@mantine/hooks");
|
|
1708
1669
|
var import_abstract2 = require("@awesome-flow/core/abstract");
|
|
1709
|
-
var
|
|
1670
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1710
1671
|
function NoiseCurveNode({ id, selected, data, type }) {
|
|
1711
|
-
const incoming = (0,
|
|
1712
|
-
const updateNodeData = (0,
|
|
1713
|
-
const updateComputedData = (0,
|
|
1714
|
-
const [values, setValues] = (0,
|
|
1672
|
+
const incoming = (0, import_hooks19.useIncomingComputedData)(id);
|
|
1673
|
+
const updateNodeData = (0, import_hooks19.useUpdateNodeData)();
|
|
1674
|
+
const updateComputedData = (0, import_hooks19.useUpdateNodeComputedData)();
|
|
1675
|
+
const [values, setValues] = (0, import_react26.useState)([]);
|
|
1715
1676
|
const form = useForm({
|
|
1716
1677
|
mode: "uncontrolled",
|
|
1717
1678
|
initialValues: {
|
|
@@ -1730,7 +1691,7 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1730
1691
|
}
|
|
1731
1692
|
}
|
|
1732
1693
|
},
|
|
1733
|
-
onValuesChange: (0,
|
|
1694
|
+
onValuesChange: (0, import_react26.useCallback)((values2) => {
|
|
1734
1695
|
if (form.isValid()) {
|
|
1735
1696
|
const points = values2.points.map((v) => ({ input: v.input, output: v.output }));
|
|
1736
1697
|
setValues(points);
|
|
@@ -1739,21 +1700,21 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1739
1700
|
form.validate();
|
|
1740
1701
|
}, [])
|
|
1741
1702
|
});
|
|
1742
|
-
(0,
|
|
1743
|
-
const points = data.points?.length ? data.points.map((v) => ({ input: v.input, output: v.output, key: (0,
|
|
1703
|
+
(0, import_react26.useEffect)(() => {
|
|
1704
|
+
const points = data.points?.length ? data.points.map((v) => ({ input: v.input, output: v.output, key: (0, import_hooks20.randomId)() })) : [1, 2, 3, 4].map(() => ({ input: 0, output: 0, key: (0, import_hooks20.randomId)() }));
|
|
1744
1705
|
form.initialize({ points });
|
|
1745
1706
|
}, []);
|
|
1746
|
-
(0,
|
|
1707
|
+
(0, import_react26.useEffect)(() => {
|
|
1747
1708
|
if (incoming?.length && values?.length >= 4) {
|
|
1748
|
-
const module2 = new
|
|
1709
|
+
const module2 = new import_libnoise_simplex_ts13.Curve(
|
|
1749
1710
|
incoming[0].module,
|
|
1750
|
-
values.map((p) => new
|
|
1711
|
+
values.map((p) => new import_libnoise_simplex_ts13.Tuple(p.input, p.output))
|
|
1751
1712
|
);
|
|
1752
1713
|
updateComputedData(id, { module: module2 });
|
|
1753
1714
|
}
|
|
1754
1715
|
}, [values, incoming]);
|
|
1755
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0,
|
|
1756
|
-
/* @__PURE__ */ (0,
|
|
1716
|
+
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core10.Group, { mt: "xs", children: [
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1757
1718
|
import_core10.NumberInput,
|
|
1758
1719
|
{
|
|
1759
1720
|
size: "xs",
|
|
@@ -1764,7 +1725,7 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1764
1725
|
},
|
|
1765
1726
|
form.key(`points.${index}.input`)
|
|
1766
1727
|
),
|
|
1767
|
-
/* @__PURE__ */ (0,
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1768
1729
|
import_core10.NumberInput,
|
|
1769
1730
|
{
|
|
1770
1731
|
size: "xs",
|
|
@@ -1775,60 +1736,60 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1775
1736
|
},
|
|
1776
1737
|
form.key(`points.${index}.output`)
|
|
1777
1738
|
),
|
|
1778
|
-
data.state === import_abstract2.NodeState.edit && values.length > 4 && /* @__PURE__ */ (0,
|
|
1739
|
+
data.state === import_abstract2.NodeState.edit && values.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1779
1740
|
import_core10.ActionIcon,
|
|
1780
1741
|
{
|
|
1781
1742
|
color: "red",
|
|
1782
1743
|
variant: "outline",
|
|
1783
1744
|
size: "sm",
|
|
1784
1745
|
onClick: () => form.removeListItem("points", index),
|
|
1785
|
-
children: /* @__PURE__ */ (0,
|
|
1746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons_react2.IconX, { size: "1rem" })
|
|
1786
1747
|
}
|
|
1787
1748
|
)
|
|
1788
1749
|
] }, item.key));
|
|
1789
|
-
return /* @__PURE__ */ (0,
|
|
1750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_layout19.NodeContainer, { id, selected, type, data, children: [
|
|
1790
1751
|
fields,
|
|
1791
|
-
data.state === import_abstract2.NodeState.edit && /* @__PURE__ */ (0,
|
|
1792
|
-
/* @__PURE__ */ (0,
|
|
1793
|
-
/* @__PURE__ */ (0,
|
|
1752
|
+
data.state === import_abstract2.NodeState.edit && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1753
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core10.Space, { h: 10 }),
|
|
1754
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1794
1755
|
import_core10.Button,
|
|
1795
1756
|
{
|
|
1796
1757
|
variant: "outline",
|
|
1797
1758
|
size: "xs",
|
|
1798
1759
|
fullWidth: true,
|
|
1799
|
-
onClick: () => form.insertListItem("points", { input: 0, output: 0, key: (0,
|
|
1760
|
+
onClick: () => form.insertListItem("points", { input: 0, output: 0, key: (0, import_hooks20.randomId)() }),
|
|
1800
1761
|
children: "Add control point"
|
|
1801
1762
|
}
|
|
1802
1763
|
)
|
|
1803
1764
|
] }),
|
|
1804
|
-
/* @__PURE__ */ (0,
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_layout19.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1805
1766
|
] });
|
|
1806
1767
|
}
|
|
1807
1768
|
var noise_curve_node_default = NoiseCurveNode;
|
|
1808
1769
|
|
|
1809
1770
|
// src/nodes/modifiers/noise-exponent-node.tsx
|
|
1810
|
-
var
|
|
1811
|
-
var
|
|
1771
|
+
var import_layout20 = require("@awesome-flow/core/layout");
|
|
1772
|
+
var import_react27 = require("react");
|
|
1812
1773
|
var import_core11 = require("@mantine/core");
|
|
1813
|
-
var
|
|
1814
|
-
var
|
|
1815
|
-
var
|
|
1774
|
+
var import_hooks21 = require("@awesome-flow/core/hooks");
|
|
1775
|
+
var import_libnoise_simplex_ts14 = require("libnoise-simplex-ts");
|
|
1776
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1816
1777
|
function NoiseExponentNode({ id, selected, data, type }) {
|
|
1817
|
-
const [exponent, setExponent] = (0,
|
|
1818
|
-
const incoming = (0,
|
|
1819
|
-
const updateNodeData = (0,
|
|
1820
|
-
const updateComputedData = (0,
|
|
1821
|
-
(0,
|
|
1778
|
+
const [exponent, setExponent] = (0, import_react27.useState)(data.exponent);
|
|
1779
|
+
const incoming = (0, import_hooks21.useIncomingComputedData)(id);
|
|
1780
|
+
const updateNodeData = (0, import_hooks21.useUpdateNodeData)();
|
|
1781
|
+
const updateComputedData = (0, import_hooks21.useUpdateNodeComputedData)();
|
|
1782
|
+
(0, import_react27.useEffect)(() => {
|
|
1822
1783
|
if (incoming?.length > 0) {
|
|
1823
|
-
const module2 = new
|
|
1784
|
+
const module2 = new import_libnoise_simplex_ts14.Exponent(incoming[0].module, exponent);
|
|
1824
1785
|
updateComputedData(id, { module: module2 });
|
|
1825
1786
|
}
|
|
1826
1787
|
updateNodeData(id, { exponent });
|
|
1827
1788
|
}, [incoming, exponent]);
|
|
1828
|
-
return /* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_layout20.NodeContainer, { id, selected, data, type, children: [
|
|
1790
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core11.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core11.Group, { children: [
|
|
1830
1791
|
"Exponent:",
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1792
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1832
1793
|
import_core11.NumberInput,
|
|
1833
1794
|
{
|
|
1834
1795
|
size: "xs",
|
|
@@ -1838,55 +1799,55 @@ function NoiseExponentNode({ id, selected, data, type }) {
|
|
|
1838
1799
|
}
|
|
1839
1800
|
)
|
|
1840
1801
|
] }) }),
|
|
1841
|
-
/* @__PURE__ */ (0,
|
|
1802
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_layout20.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1842
1803
|
] });
|
|
1843
1804
|
}
|
|
1844
1805
|
var noise_exponent_node_default = NoiseExponentNode;
|
|
1845
1806
|
|
|
1846
1807
|
// src/nodes/modifiers/noise-invert-node.tsx
|
|
1847
|
-
var
|
|
1848
|
-
var
|
|
1849
|
-
var
|
|
1850
|
-
var
|
|
1851
|
-
var
|
|
1808
|
+
var import_layout21 = require("@awesome-flow/core/layout");
|
|
1809
|
+
var import_react28 = require("react");
|
|
1810
|
+
var import_hooks22 = require("@awesome-flow/core/hooks");
|
|
1811
|
+
var import_libnoise_simplex_ts15 = require("libnoise-simplex-ts");
|
|
1812
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1852
1813
|
function NoiseInvertNode({ id, selected, data, type }) {
|
|
1853
|
-
const incoming = (0,
|
|
1854
|
-
const updateComputedData = (0,
|
|
1855
|
-
(0,
|
|
1814
|
+
const incoming = (0, import_hooks22.useIncomingComputedData)(id);
|
|
1815
|
+
const updateComputedData = (0, import_hooks22.useUpdateNodeComputedData)();
|
|
1816
|
+
(0, import_react28.useEffect)(() => {
|
|
1856
1817
|
if (incoming?.length > 0) {
|
|
1857
|
-
const module2 = new
|
|
1818
|
+
const module2 = new import_libnoise_simplex_ts15.Invert(incoming[0].module);
|
|
1858
1819
|
updateComputedData(id, { module: module2 });
|
|
1859
1820
|
}
|
|
1860
1821
|
}, [incoming]);
|
|
1861
|
-
return /* @__PURE__ */ (0,
|
|
1822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_layout21.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_layout21.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" }) });
|
|
1862
1823
|
}
|
|
1863
1824
|
var noise_invert_node_default = NoiseInvertNode;
|
|
1864
1825
|
|
|
1865
1826
|
// src/nodes/modifiers/noise-scale-bias-node.tsx
|
|
1866
|
-
var
|
|
1867
|
-
var
|
|
1827
|
+
var import_layout22 = require("@awesome-flow/core/layout");
|
|
1828
|
+
var import_react29 = require("react");
|
|
1868
1829
|
var import_core12 = require("@mantine/core");
|
|
1869
|
-
var
|
|
1870
|
-
var
|
|
1871
|
-
var
|
|
1830
|
+
var import_hooks23 = require("@awesome-flow/core/hooks");
|
|
1831
|
+
var import_libnoise_simplex_ts16 = require("libnoise-simplex-ts");
|
|
1832
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1872
1833
|
function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
1873
|
-
const [scale, setScale] = (0,
|
|
1874
|
-
const [bias, setBias] = (0,
|
|
1875
|
-
const incoming = (0,
|
|
1876
|
-
const updateNodeData = (0,
|
|
1877
|
-
const updateComputedData = (0,
|
|
1878
|
-
(0,
|
|
1834
|
+
const [scale, setScale] = (0, import_react29.useState)(data.scale);
|
|
1835
|
+
const [bias, setBias] = (0, import_react29.useState)(data.bias);
|
|
1836
|
+
const incoming = (0, import_hooks23.useIncomingComputedData)(id);
|
|
1837
|
+
const updateNodeData = (0, import_hooks23.useUpdateNodeData)();
|
|
1838
|
+
const updateComputedData = (0, import_hooks23.useUpdateNodeComputedData)();
|
|
1839
|
+
(0, import_react29.useEffect)(() => {
|
|
1879
1840
|
if (incoming?.length > 0) {
|
|
1880
|
-
const module2 = new
|
|
1841
|
+
const module2 = new import_libnoise_simplex_ts16.ScaleBias(incoming[0].module, scale, bias);
|
|
1881
1842
|
updateComputedData(id, { module: module2 });
|
|
1882
1843
|
}
|
|
1883
1844
|
updateNodeData(id, { scale, bias });
|
|
1884
1845
|
}, [incoming, scale, bias]);
|
|
1885
|
-
return /* @__PURE__ */ (0,
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_layout22.NodeContainer, { id, selected, data, type, children: [
|
|
1847
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core12.Stack, { children: [
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core12.Group, { children: [
|
|
1888
1849
|
"Scale:",
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
1850
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1890
1851
|
import_core12.NumberInput,
|
|
1891
1852
|
{
|
|
1892
1853
|
size: "xs",
|
|
@@ -1897,9 +1858,9 @@ function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
|
1897
1858
|
}
|
|
1898
1859
|
)
|
|
1899
1860
|
] }),
|
|
1900
|
-
/* @__PURE__ */ (0,
|
|
1861
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core12.Group, { children: [
|
|
1901
1862
|
"Bias:",
|
|
1902
|
-
/* @__PURE__ */ (0,
|
|
1863
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1903
1864
|
import_core12.NumberInput,
|
|
1904
1865
|
{
|
|
1905
1866
|
size: "xs",
|
|
@@ -1911,26 +1872,26 @@ function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
|
1911
1872
|
)
|
|
1912
1873
|
] })
|
|
1913
1874
|
] }),
|
|
1914
|
-
/* @__PURE__ */ (0,
|
|
1875
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_layout22.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1915
1876
|
] });
|
|
1916
1877
|
}
|
|
1917
1878
|
var noise_scale_bias_node_default = NoiseScaleBiasNode;
|
|
1918
1879
|
|
|
1919
1880
|
// src/nodes/modifiers/noise-terrace-node.tsx
|
|
1920
|
-
var
|
|
1881
|
+
var import_layout23 = require("@awesome-flow/core/layout");
|
|
1921
1882
|
var import_core13 = require("@mantine/core");
|
|
1922
|
-
var
|
|
1923
|
-
var
|
|
1924
|
-
var
|
|
1883
|
+
var import_hooks24 = require("@awesome-flow/core/hooks");
|
|
1884
|
+
var import_react30 = require("react");
|
|
1885
|
+
var import_libnoise_simplex_ts17 = require("libnoise-simplex-ts");
|
|
1925
1886
|
var import_icons_react3 = require("@tabler/icons-react");
|
|
1926
|
-
var
|
|
1887
|
+
var import_hooks25 = require("@mantine/hooks");
|
|
1927
1888
|
var import_abstract3 = require("@awesome-flow/core/abstract");
|
|
1928
|
-
var
|
|
1889
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1929
1890
|
function NoiseTerraceNode({ id, selected, data, type }) {
|
|
1930
|
-
const incoming = (0,
|
|
1931
|
-
const updateNodeData = (0,
|
|
1932
|
-
const updateComputedData = (0,
|
|
1933
|
-
const [values, setValues] = (0,
|
|
1891
|
+
const incoming = (0, import_hooks24.useIncomingComputedData)(id);
|
|
1892
|
+
const updateNodeData = (0, import_hooks24.useUpdateNodeData)();
|
|
1893
|
+
const updateComputedData = (0, import_hooks24.useUpdateNodeComputedData)();
|
|
1894
|
+
const [values, setValues] = (0, import_react30.useState)([]);
|
|
1934
1895
|
const form = useForm({
|
|
1935
1896
|
mode: "uncontrolled",
|
|
1936
1897
|
initialValues: {
|
|
@@ -1938,7 +1899,7 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
1938
1899
|
},
|
|
1939
1900
|
validateInputOnChange: [`points.${FORM_INDEX}.input`],
|
|
1940
1901
|
clearInputErrorOnChange: true,
|
|
1941
|
-
onValuesChange: (0,
|
|
1902
|
+
onValuesChange: (0, import_react30.useCallback)((values2) => {
|
|
1942
1903
|
if (form.isValid()) {
|
|
1943
1904
|
const points = values2.points.map((v) => v.value);
|
|
1944
1905
|
setValues(points);
|
|
@@ -1947,18 +1908,18 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
1947
1908
|
form.validate();
|
|
1948
1909
|
}, [])
|
|
1949
1910
|
});
|
|
1950
|
-
(0,
|
|
1951
|
-
const points = data.points?.length ? data.points.map((v) => ({ value: v, key: (0,
|
|
1911
|
+
(0, import_react30.useEffect)(() => {
|
|
1912
|
+
const points = data.points?.length ? data.points.map((v) => ({ value: v, key: (0, import_hooks25.randomId)() })) : [1, 2].map(() => ({ value: 0, key: (0, import_hooks25.randomId)() }));
|
|
1952
1913
|
form.initialize({ points });
|
|
1953
1914
|
}, []);
|
|
1954
|
-
(0,
|
|
1915
|
+
(0, import_react30.useEffect)(() => {
|
|
1955
1916
|
if (incoming?.length && values?.length >= 2) {
|
|
1956
|
-
const module2 = new
|
|
1917
|
+
const module2 = new import_libnoise_simplex_ts17.Terrace(incoming[0].module, values);
|
|
1957
1918
|
updateComputedData(id, { module: module2 });
|
|
1958
1919
|
}
|
|
1959
1920
|
}, [values, incoming]);
|
|
1960
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0,
|
|
1961
|
-
/* @__PURE__ */ (0,
|
|
1921
|
+
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core13.Group, { mt: "xs", children: [
|
|
1922
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1962
1923
|
import_core13.NumberInput,
|
|
1963
1924
|
{
|
|
1964
1925
|
size: "xs",
|
|
@@ -1968,52 +1929,52 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
1968
1929
|
},
|
|
1969
1930
|
form.key(`points.${index}.value`)
|
|
1970
1931
|
),
|
|
1971
|
-
data.state === import_abstract3.NodeState.edit && values.length > 2 && /* @__PURE__ */ (0,
|
|
1932
|
+
data.state === import_abstract3.NodeState.edit && values.length > 2 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1972
1933
|
import_core13.ActionIcon,
|
|
1973
1934
|
{
|
|
1974
1935
|
color: "red",
|
|
1975
1936
|
variant: "outline",
|
|
1976
1937
|
size: "sm",
|
|
1977
1938
|
onClick: () => form.removeListItem("points", index),
|
|
1978
|
-
children: /* @__PURE__ */ (0,
|
|
1939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_icons_react3.IconX, { size: "1rem" })
|
|
1979
1940
|
}
|
|
1980
1941
|
)
|
|
1981
1942
|
] }, item.key));
|
|
1982
|
-
return /* @__PURE__ */ (0,
|
|
1943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_layout23.NodeContainer, { id, selected, type, data, children: [
|
|
1983
1944
|
fields,
|
|
1984
|
-
data.state === import_abstract3.NodeState.edit && /* @__PURE__ */ (0,
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
1986
|
-
/* @__PURE__ */ (0,
|
|
1945
|
+
data.state === import_abstract3.NodeState.edit && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
1946
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core13.Space, { h: 10 }),
|
|
1947
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1987
1948
|
import_core13.Button,
|
|
1988
1949
|
{
|
|
1989
1950
|
variant: "outline",
|
|
1990
1951
|
size: "xs",
|
|
1991
1952
|
fullWidth: true,
|
|
1992
|
-
onClick: () => form.insertListItem("points", { value: 0, key: (0,
|
|
1953
|
+
onClick: () => form.insertListItem("points", { value: 0, key: (0, import_hooks25.randomId)() }),
|
|
1993
1954
|
children: "Add control point"
|
|
1994
1955
|
}
|
|
1995
1956
|
)
|
|
1996
1957
|
] }),
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_layout23.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1998
1959
|
] });
|
|
1999
1960
|
}
|
|
2000
1961
|
var noise_terrace_node_default = NoiseTerraceNode;
|
|
2001
1962
|
|
|
2002
1963
|
// src/nodes/selectors/noise-blend-node.tsx
|
|
2003
|
-
var
|
|
2004
|
-
var
|
|
2005
|
-
var
|
|
2006
|
-
var
|
|
1964
|
+
var import_layout24 = require("@awesome-flow/core/layout");
|
|
1965
|
+
var import_react31 = require("react");
|
|
1966
|
+
var import_hooks26 = require("@awesome-flow/core/hooks");
|
|
1967
|
+
var import_libnoise_simplex_ts18 = require("libnoise-simplex-ts");
|
|
2007
1968
|
var import_components8 = require("@awesome-flow/core/components");
|
|
2008
|
-
var
|
|
1969
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2009
1970
|
function NoiseBlendNode({ id, selected, data, type }) {
|
|
2010
|
-
const updateComputedData = (0,
|
|
2011
|
-
const onDataUpdated = (0,
|
|
1971
|
+
const updateComputedData = (0, import_hooks26.useUpdateNodeComputedData)();
|
|
1972
|
+
const onDataUpdated = (0, import_react31.useCallback)(
|
|
2012
1973
|
(incomingData) => {
|
|
2013
1974
|
const incomingSources = incomingData["source" /* source */];
|
|
2014
1975
|
const incomingControl = incomingData["control" /* control */];
|
|
2015
1976
|
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2016
|
-
const module2 = new
|
|
1977
|
+
const module2 = new import_libnoise_simplex_ts18.Blend(
|
|
2017
1978
|
incomingSources[0].module,
|
|
2018
1979
|
incomingSources[1].module,
|
|
2019
1980
|
incomingControl[0].module
|
|
@@ -2023,8 +1984,8 @@ function NoiseBlendNode({ id, selected, data, type }) {
|
|
|
2023
1984
|
},
|
|
2024
1985
|
[]
|
|
2025
1986
|
);
|
|
2026
|
-
return /* @__PURE__ */ (0,
|
|
2027
|
-
/* @__PURE__ */ (0,
|
|
1987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_layout24.NodeContainer, { id, selected, data, type, children: [
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2028
1989
|
import_components8.HandlesIncomingDataStatus,
|
|
2029
1990
|
{
|
|
2030
1991
|
nodeId: id,
|
|
@@ -2035,34 +1996,34 @@ function NoiseBlendNode({ id, selected, data, type }) {
|
|
|
2035
1996
|
resetComputedData: true
|
|
2036
1997
|
}
|
|
2037
1998
|
),
|
|
2038
|
-
/* @__PURE__ */ (0,
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_layout24.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2039
2000
|
] });
|
|
2040
2001
|
}
|
|
2041
2002
|
var noise_blend_node_default = NoiseBlendNode;
|
|
2042
2003
|
|
|
2043
2004
|
// src/nodes/selectors/noise-select-node.tsx
|
|
2044
|
-
var
|
|
2045
|
-
var
|
|
2046
|
-
var
|
|
2047
|
-
var
|
|
2005
|
+
var import_layout25 = require("@awesome-flow/core/layout");
|
|
2006
|
+
var import_react32 = require("react");
|
|
2007
|
+
var import_hooks27 = require("@awesome-flow/core/hooks");
|
|
2008
|
+
var import_libnoise_simplex_ts19 = require("libnoise-simplex-ts");
|
|
2048
2009
|
var import_core14 = require("@mantine/core");
|
|
2049
2010
|
var import_components9 = require("@awesome-flow/core/components");
|
|
2050
|
-
var
|
|
2011
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2051
2012
|
function NoiseSelectNode({ id, selected, data, type }) {
|
|
2052
|
-
const [edgeFalloff, setEdgeFalloff] = (0,
|
|
2053
|
-
const [lowerBound, setLowerBound] = (0,
|
|
2054
|
-
const [upperBound, setUpperBound] = (0,
|
|
2055
|
-
const updateNodeData = (0,
|
|
2056
|
-
const updateComputedData = (0,
|
|
2057
|
-
(0,
|
|
2013
|
+
const [edgeFalloff, setEdgeFalloff] = (0, import_react32.useState)(data.edgeFalloff);
|
|
2014
|
+
const [lowerBound, setLowerBound] = (0, import_react32.useState)(data.lowerBound);
|
|
2015
|
+
const [upperBound, setUpperBound] = (0, import_react32.useState)(data.upperBound);
|
|
2016
|
+
const updateNodeData = (0, import_hooks27.useUpdateNodeData)();
|
|
2017
|
+
const updateComputedData = (0, import_hooks27.useUpdateNodeComputedData)();
|
|
2018
|
+
(0, import_react32.useEffect)(() => {
|
|
2058
2019
|
updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
|
|
2059
2020
|
}, [edgeFalloff, lowerBound, upperBound]);
|
|
2060
|
-
const onDataUpdated = (0,
|
|
2021
|
+
const onDataUpdated = (0, import_react32.useCallback)(
|
|
2061
2022
|
(incomingData) => {
|
|
2062
2023
|
const incomingSources = incomingData["source" /* source */];
|
|
2063
2024
|
const incomingControl = incomingData["control" /* control */];
|
|
2064
2025
|
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2065
|
-
const module2 = new
|
|
2026
|
+
const module2 = new import_libnoise_simplex_ts19.Select(
|
|
2066
2027
|
incomingSources[0].module,
|
|
2067
2028
|
incomingSources[1].module,
|
|
2068
2029
|
incomingControl[0].module,
|
|
@@ -2075,11 +2036,11 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2075
2036
|
},
|
|
2076
2037
|
[]
|
|
2077
2038
|
);
|
|
2078
|
-
return /* @__PURE__ */ (0,
|
|
2079
|
-
/* @__PURE__ */ (0,
|
|
2080
|
-
/* @__PURE__ */ (0,
|
|
2039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_layout25.NodeContainer, { id, selected, data, type, children: [
|
|
2040
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core14.Stack, { children: [
|
|
2041
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core14.Group, { children: [
|
|
2081
2042
|
"Edge Falloff:",
|
|
2082
|
-
/* @__PURE__ */ (0,
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2083
2044
|
import_core14.NumberInput,
|
|
2084
2045
|
{
|
|
2085
2046
|
size: "xs",
|
|
@@ -2090,9 +2051,9 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2090
2051
|
}
|
|
2091
2052
|
)
|
|
2092
2053
|
] }),
|
|
2093
|
-
/* @__PURE__ */ (0,
|
|
2054
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core14.Group, { children: [
|
|
2094
2055
|
"Lower Bound:",
|
|
2095
|
-
/* @__PURE__ */ (0,
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2096
2057
|
import_core14.NumberInput,
|
|
2097
2058
|
{
|
|
2098
2059
|
size: "xs",
|
|
@@ -2103,9 +2064,9 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2103
2064
|
}
|
|
2104
2065
|
)
|
|
2105
2066
|
] }),
|
|
2106
|
-
/* @__PURE__ */ (0,
|
|
2067
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core14.Group, { children: [
|
|
2107
2068
|
"Upper Bound:",
|
|
2108
|
-
/* @__PURE__ */ (0,
|
|
2069
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2109
2070
|
import_core14.NumberInput,
|
|
2110
2071
|
{
|
|
2111
2072
|
size: "xs",
|
|
@@ -2116,7 +2077,7 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2116
2077
|
}
|
|
2117
2078
|
)
|
|
2118
2079
|
] }),
|
|
2119
|
-
/* @__PURE__ */ (0,
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2120
2081
|
import_components9.HandlesIncomingDataStatus,
|
|
2121
2082
|
{
|
|
2122
2083
|
nodeId: id,
|
|
@@ -2128,28 +2089,28 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2128
2089
|
}
|
|
2129
2090
|
)
|
|
2130
2091
|
] }),
|
|
2131
|
-
/* @__PURE__ */ (0,
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_layout25.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2132
2093
|
] });
|
|
2133
2094
|
}
|
|
2134
2095
|
var noise_select_node_default = NoiseSelectNode;
|
|
2135
2096
|
|
|
2136
2097
|
// src/nodes/transformers/noise-displace-node.tsx
|
|
2137
|
-
var
|
|
2138
|
-
var
|
|
2139
|
-
var
|
|
2140
|
-
var
|
|
2098
|
+
var import_layout26 = require("@awesome-flow/core/layout");
|
|
2099
|
+
var import_react33 = require("react");
|
|
2100
|
+
var import_hooks28 = require("@awesome-flow/core/hooks");
|
|
2101
|
+
var import_libnoise_simplex_ts20 = require("libnoise-simplex-ts");
|
|
2141
2102
|
var import_components10 = require("@awesome-flow/core/components");
|
|
2142
|
-
var
|
|
2103
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2143
2104
|
function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
2144
|
-
const updateComputedData = (0,
|
|
2145
|
-
const onDataUpdated = (0,
|
|
2105
|
+
const updateComputedData = (0, import_hooks28.useUpdateNodeComputedData)();
|
|
2106
|
+
const onDataUpdated = (0, import_react33.useCallback)(
|
|
2146
2107
|
(handleData) => {
|
|
2147
2108
|
const sourceModule = handleData["source" /* sourceModule */];
|
|
2148
2109
|
const xModule = handleData["x-module" /* xModule */];
|
|
2149
2110
|
const yModule = handleData["y-module" /* yModule */];
|
|
2150
2111
|
const zModule = handleData["z-module" /* zModule */];
|
|
2151
2112
|
if (sourceModule && xModule && yModule && zModule) {
|
|
2152
|
-
const module2 = new
|
|
2113
|
+
const module2 = new import_libnoise_simplex_ts20.Displace(
|
|
2153
2114
|
sourceModule[0].module,
|
|
2154
2115
|
xModule[0].module,
|
|
2155
2116
|
yModule[0].module,
|
|
@@ -2160,8 +2121,8 @@ function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
|
2160
2121
|
},
|
|
2161
2122
|
[]
|
|
2162
2123
|
);
|
|
2163
|
-
return /* @__PURE__ */ (0,
|
|
2164
|
-
/* @__PURE__ */ (0,
|
|
2124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_layout26.NodeContainer, { id, selected, data, type, children: [
|
|
2125
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2165
2126
|
import_components10.HandlesIncomingDataStatus,
|
|
2166
2127
|
{
|
|
2167
2128
|
nodeId: id,
|
|
@@ -2172,42 +2133,42 @@ function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
|
2172
2133
|
resetComputedData: true
|
|
2173
2134
|
}
|
|
2174
2135
|
),
|
|
2175
|
-
/* @__PURE__ */ (0,
|
|
2136
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_layout26.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2176
2137
|
] });
|
|
2177
2138
|
}
|
|
2178
2139
|
var noise_displace_node_default = NoiseDisplaceNode;
|
|
2179
2140
|
|
|
2180
2141
|
// src/nodes/transformers/noise-rotate-point-node.tsx
|
|
2181
|
-
var
|
|
2182
|
-
var
|
|
2183
|
-
var
|
|
2142
|
+
var import_layout27 = require("@awesome-flow/core/layout");
|
|
2143
|
+
var import_react34 = require("react");
|
|
2144
|
+
var import_hooks29 = require("@awesome-flow/core/hooks");
|
|
2184
2145
|
var import_core15 = require("@mantine/core");
|
|
2185
|
-
var
|
|
2186
|
-
var
|
|
2146
|
+
var import_libnoise_simplex_ts21 = require("libnoise-simplex-ts");
|
|
2147
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2187
2148
|
function NoiseRotatePointNode({
|
|
2188
2149
|
id,
|
|
2189
2150
|
selected,
|
|
2190
2151
|
data,
|
|
2191
2152
|
type
|
|
2192
2153
|
}) {
|
|
2193
|
-
const [xAngle, setXAngle] = (0,
|
|
2194
|
-
const [yAngle, setYAngle] = (0,
|
|
2195
|
-
const [zAngle, setZAngle] = (0,
|
|
2196
|
-
const incoming = (0,
|
|
2197
|
-
const updateNodeData = (0,
|
|
2198
|
-
const updateComputedData = (0,
|
|
2199
|
-
(0,
|
|
2154
|
+
const [xAngle, setXAngle] = (0, import_react34.useState)(data.xAngle);
|
|
2155
|
+
const [yAngle, setYAngle] = (0, import_react34.useState)(data.yAngle);
|
|
2156
|
+
const [zAngle, setZAngle] = (0, import_react34.useState)(data.zAngle);
|
|
2157
|
+
const incoming = (0, import_hooks29.useIncomingComputedData)(id);
|
|
2158
|
+
const updateNodeData = (0, import_hooks29.useUpdateNodeData)();
|
|
2159
|
+
const updateComputedData = (0, import_hooks29.useUpdateNodeComputedData)();
|
|
2160
|
+
(0, import_react34.useEffect)(() => {
|
|
2200
2161
|
if (incoming?.length) {
|
|
2201
|
-
const module2 = new
|
|
2162
|
+
const module2 = new import_libnoise_simplex_ts21.RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
|
|
2202
2163
|
updateComputedData(id, { module: module2 });
|
|
2203
2164
|
}
|
|
2204
2165
|
updateNodeData(id, { xAngle, yAngle, zAngle });
|
|
2205
2166
|
}, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
|
|
2206
|
-
return /* @__PURE__ */ (0,
|
|
2207
|
-
/* @__PURE__ */ (0,
|
|
2208
|
-
/* @__PURE__ */ (0,
|
|
2167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_layout27.NodeContainer, { id, selected, data, type, children: [
|
|
2168
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core15.Stack, { children: [
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core15.Group, { children: [
|
|
2209
2170
|
"X Angle:",
|
|
2210
|
-
/* @__PURE__ */ (0,
|
|
2171
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2211
2172
|
import_core15.NumberInput,
|
|
2212
2173
|
{
|
|
2213
2174
|
size: "xs",
|
|
@@ -2218,9 +2179,9 @@ function NoiseRotatePointNode({
|
|
|
2218
2179
|
}
|
|
2219
2180
|
)
|
|
2220
2181
|
] }),
|
|
2221
|
-
/* @__PURE__ */ (0,
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core15.Group, { children: [
|
|
2222
2183
|
"Y Angle:",
|
|
2223
|
-
/* @__PURE__ */ (0,
|
|
2184
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2224
2185
|
import_core15.NumberInput,
|
|
2225
2186
|
{
|
|
2226
2187
|
size: "xs",
|
|
@@ -2231,9 +2192,9 @@ function NoiseRotatePointNode({
|
|
|
2231
2192
|
}
|
|
2232
2193
|
)
|
|
2233
2194
|
] }),
|
|
2234
|
-
/* @__PURE__ */ (0,
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core15.Group, { children: [
|
|
2235
2196
|
"Z Angle:",
|
|
2236
|
-
/* @__PURE__ */ (0,
|
|
2197
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2237
2198
|
import_core15.NumberInput,
|
|
2238
2199
|
{
|
|
2239
2200
|
size: "xs",
|
|
@@ -2245,42 +2206,42 @@ function NoiseRotatePointNode({
|
|
|
2245
2206
|
)
|
|
2246
2207
|
] })
|
|
2247
2208
|
] }),
|
|
2248
|
-
/* @__PURE__ */ (0,
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_layout27.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2249
2210
|
] });
|
|
2250
2211
|
}
|
|
2251
2212
|
var noise_rotate_point_node_default = NoiseRotatePointNode;
|
|
2252
2213
|
|
|
2253
2214
|
// src/nodes/transformers/noise-scale-point-node.tsx
|
|
2254
|
-
var
|
|
2255
|
-
var
|
|
2256
|
-
var
|
|
2215
|
+
var import_layout28 = require("@awesome-flow/core/layout");
|
|
2216
|
+
var import_react35 = require("react");
|
|
2217
|
+
var import_hooks30 = require("@awesome-flow/core/hooks");
|
|
2257
2218
|
var import_core16 = require("@mantine/core");
|
|
2258
|
-
var
|
|
2259
|
-
var
|
|
2219
|
+
var import_libnoise_simplex_ts22 = require("libnoise-simplex-ts");
|
|
2220
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2260
2221
|
function NoiseScalePointNode({
|
|
2261
2222
|
id,
|
|
2262
2223
|
selected,
|
|
2263
2224
|
data,
|
|
2264
2225
|
type
|
|
2265
2226
|
}) {
|
|
2266
|
-
const [xScale, setXScale] = (0,
|
|
2267
|
-
const [yScale, setYScale] = (0,
|
|
2268
|
-
const [zScale, setZScale] = (0,
|
|
2269
|
-
const incoming = (0,
|
|
2270
|
-
const updateNodeData = (0,
|
|
2271
|
-
const updateComputedData = (0,
|
|
2272
|
-
(0,
|
|
2227
|
+
const [xScale, setXScale] = (0, import_react35.useState)(data.xScale);
|
|
2228
|
+
const [yScale, setYScale] = (0, import_react35.useState)(data.yScale);
|
|
2229
|
+
const [zScale, setZScale] = (0, import_react35.useState)(data.zScale);
|
|
2230
|
+
const incoming = (0, import_hooks30.useIncomingComputedData)(id);
|
|
2231
|
+
const updateNodeData = (0, import_hooks30.useUpdateNodeData)();
|
|
2232
|
+
const updateComputedData = (0, import_hooks30.useUpdateNodeComputedData)();
|
|
2233
|
+
(0, import_react35.useEffect)(() => {
|
|
2273
2234
|
if (incoming?.length) {
|
|
2274
|
-
const module2 = new
|
|
2235
|
+
const module2 = new import_libnoise_simplex_ts22.ScalePoint(incoming[0].module, xScale, yScale, zScale);
|
|
2275
2236
|
updateComputedData(id, { module: module2 });
|
|
2276
2237
|
}
|
|
2277
2238
|
updateNodeData(id, { xScale, yScale, zScale });
|
|
2278
2239
|
}, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
|
|
2279
|
-
return /* @__PURE__ */ (0,
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2281
|
-
/* @__PURE__ */ (0,
|
|
2240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_layout28.NodeContainer, { id, selected, data, type, children: [
|
|
2241
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core16.Stack, { children: [
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core16.Group, { children: [
|
|
2282
2243
|
"X Scale:",
|
|
2283
|
-
/* @__PURE__ */ (0,
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2284
2245
|
import_core16.NumberInput,
|
|
2285
2246
|
{
|
|
2286
2247
|
size: "xs",
|
|
@@ -2291,9 +2252,9 @@ function NoiseScalePointNode({
|
|
|
2291
2252
|
}
|
|
2292
2253
|
)
|
|
2293
2254
|
] }),
|
|
2294
|
-
/* @__PURE__ */ (0,
|
|
2255
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core16.Group, { children: [
|
|
2295
2256
|
"Y Scale:",
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2297
2258
|
import_core16.NumberInput,
|
|
2298
2259
|
{
|
|
2299
2260
|
size: "xs",
|
|
@@ -2304,9 +2265,9 @@ function NoiseScalePointNode({
|
|
|
2304
2265
|
}
|
|
2305
2266
|
)
|
|
2306
2267
|
] }),
|
|
2307
|
-
/* @__PURE__ */ (0,
|
|
2268
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core16.Group, { children: [
|
|
2308
2269
|
"Z Scale:",
|
|
2309
|
-
/* @__PURE__ */ (0,
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2310
2271
|
import_core16.NumberInput,
|
|
2311
2272
|
{
|
|
2312
2273
|
size: "xs",
|
|
@@ -2318,42 +2279,42 @@ function NoiseScalePointNode({
|
|
|
2318
2279
|
)
|
|
2319
2280
|
] })
|
|
2320
2281
|
] }),
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2282
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_layout28.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2322
2283
|
] });
|
|
2323
2284
|
}
|
|
2324
2285
|
var noise_scale_point_node_default = NoiseScalePointNode;
|
|
2325
2286
|
|
|
2326
2287
|
// src/nodes/transformers/noise-translate-point-node.tsx
|
|
2327
|
-
var
|
|
2328
|
-
var
|
|
2329
|
-
var
|
|
2288
|
+
var import_layout29 = require("@awesome-flow/core/layout");
|
|
2289
|
+
var import_react36 = require("react");
|
|
2290
|
+
var import_hooks31 = require("@awesome-flow/core/hooks");
|
|
2330
2291
|
var import_core17 = require("@mantine/core");
|
|
2331
|
-
var
|
|
2332
|
-
var
|
|
2292
|
+
var import_libnoise_simplex_ts23 = require("libnoise-simplex-ts");
|
|
2293
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2333
2294
|
function NoiseTranslatePointNode({
|
|
2334
2295
|
id,
|
|
2335
2296
|
selected,
|
|
2336
2297
|
data,
|
|
2337
2298
|
type
|
|
2338
2299
|
}) {
|
|
2339
|
-
const [translateX, setTranslateX] = (0,
|
|
2340
|
-
const [translateY, setTranslateY] = (0,
|
|
2341
|
-
const [translateZ, setTranslateZ] = (0,
|
|
2342
|
-
const incoming = (0,
|
|
2343
|
-
const updateNodeData = (0,
|
|
2344
|
-
const updateComputedData = (0,
|
|
2345
|
-
(0,
|
|
2300
|
+
const [translateX, setTranslateX] = (0, import_react36.useState)(data.translateX);
|
|
2301
|
+
const [translateY, setTranslateY] = (0, import_react36.useState)(data.translateY);
|
|
2302
|
+
const [translateZ, setTranslateZ] = (0, import_react36.useState)(data.translateZ);
|
|
2303
|
+
const incoming = (0, import_hooks31.useIncomingComputedData)(id);
|
|
2304
|
+
const updateNodeData = (0, import_hooks31.useUpdateNodeData)();
|
|
2305
|
+
const updateComputedData = (0, import_hooks31.useUpdateNodeComputedData)();
|
|
2306
|
+
(0, import_react36.useEffect)(() => {
|
|
2346
2307
|
if (incoming?.length) {
|
|
2347
|
-
const module2 = new
|
|
2308
|
+
const module2 = new import_libnoise_simplex_ts23.TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
|
|
2348
2309
|
updateComputedData(id, { module: module2 });
|
|
2349
2310
|
}
|
|
2350
2311
|
updateNodeData(id, { translateX, translateY, translateZ });
|
|
2351
2312
|
}, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
|
|
2352
|
-
return /* @__PURE__ */ (0,
|
|
2353
|
-
/* @__PURE__ */ (0,
|
|
2354
|
-
/* @__PURE__ */ (0,
|
|
2313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_layout29.NodeContainer, { id, selected, data, type, children: [
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core17.Stack, { children: [
|
|
2315
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core17.Group, { children: [
|
|
2355
2316
|
"Translate X:",
|
|
2356
|
-
/* @__PURE__ */ (0,
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2357
2318
|
import_core17.NumberInput,
|
|
2358
2319
|
{
|
|
2359
2320
|
size: "xs",
|
|
@@ -2364,9 +2325,9 @@ function NoiseTranslatePointNode({
|
|
|
2364
2325
|
}
|
|
2365
2326
|
)
|
|
2366
2327
|
] }),
|
|
2367
|
-
/* @__PURE__ */ (0,
|
|
2328
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core17.Group, { children: [
|
|
2368
2329
|
"Translate Y:",
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2370
2331
|
import_core17.NumberInput,
|
|
2371
2332
|
{
|
|
2372
2333
|
size: "xs",
|
|
@@ -2377,9 +2338,9 @@ function NoiseTranslatePointNode({
|
|
|
2377
2338
|
}
|
|
2378
2339
|
)
|
|
2379
2340
|
] }),
|
|
2380
|
-
/* @__PURE__ */ (0,
|
|
2341
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core17.Group, { children: [
|
|
2381
2342
|
"Translate Z:",
|
|
2382
|
-
/* @__PURE__ */ (0,
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2383
2344
|
import_core17.NumberInput,
|
|
2384
2345
|
{
|
|
2385
2346
|
size: "xs",
|
|
@@ -2391,33 +2352,33 @@ function NoiseTranslatePointNode({
|
|
|
2391
2352
|
)
|
|
2392
2353
|
] })
|
|
2393
2354
|
] }),
|
|
2394
|
-
/* @__PURE__ */ (0,
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_layout29.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2395
2356
|
] });
|
|
2396
2357
|
}
|
|
2397
2358
|
var noise_translate_point_node_default = NoiseTranslatePointNode;
|
|
2398
2359
|
|
|
2399
2360
|
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
2400
|
-
var
|
|
2401
|
-
var
|
|
2402
|
-
var
|
|
2403
|
-
var
|
|
2361
|
+
var import_layout30 = require("@awesome-flow/core/layout");
|
|
2362
|
+
var import_react37 = require("react");
|
|
2363
|
+
var import_hooks32 = require("@awesome-flow/core/hooks");
|
|
2364
|
+
var import_libnoise_simplex_ts24 = require("libnoise-simplex-ts");
|
|
2404
2365
|
var import_components11 = require("@awesome-flow/core/components");
|
|
2405
|
-
var
|
|
2366
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2406
2367
|
function NoiseTurbulenceNode({
|
|
2407
2368
|
id,
|
|
2408
2369
|
selected,
|
|
2409
2370
|
data,
|
|
2410
2371
|
type
|
|
2411
2372
|
}) {
|
|
2412
|
-
const [properties, setProperties] = (0,
|
|
2413
|
-
const incoming = (0,
|
|
2414
|
-
const updateComputedData = (0,
|
|
2415
|
-
const onPropertiesChange = (0,
|
|
2373
|
+
const [properties, setProperties] = (0, import_react37.useState)(null);
|
|
2374
|
+
const incoming = (0, import_hooks32.useIncomingComputedData)(id);
|
|
2375
|
+
const updateComputedData = (0, import_hooks32.useUpdateNodeComputedData)();
|
|
2376
|
+
const onPropertiesChange = (0, import_react37.useCallback)((props) => {
|
|
2416
2377
|
setProperties(props);
|
|
2417
2378
|
}, []);
|
|
2418
|
-
(0,
|
|
2379
|
+
(0, import_react37.useEffect)(() => {
|
|
2419
2380
|
if (incoming?.length && properties) {
|
|
2420
|
-
const module2 = new
|
|
2381
|
+
const module2 = new import_libnoise_simplex_ts24.Turbulence(
|
|
2421
2382
|
incoming[0].module,
|
|
2422
2383
|
properties.frequency.value,
|
|
2423
2384
|
properties.power.value,
|
|
@@ -2427,9 +2388,9 @@ function NoiseTurbulenceNode({
|
|
|
2427
2388
|
updateComputedData(id, { module: module2 });
|
|
2428
2389
|
}
|
|
2429
2390
|
}, [id, incoming, properties]);
|
|
2430
|
-
return /* @__PURE__ */ (0,
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_layout30.NodeContainer, { id, selected, data, type, children: [
|
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components11.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
2393
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_layout30.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2433
2394
|
] });
|
|
2434
2395
|
}
|
|
2435
2396
|
var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
@@ -2575,34 +2536,9 @@ var NoiseRidgedMultiNodeTemplateFactory = class {
|
|
|
2575
2536
|
};
|
|
2576
2537
|
};
|
|
2577
2538
|
|
|
2578
|
-
// src/templates/generators/noise-
|
|
2539
|
+
// src/templates/generators/noise-spheres-template.ts
|
|
2579
2540
|
var import_abstract9 = require("@awesome-flow/core/abstract");
|
|
2580
2541
|
var import_system6 = require("@xyflow/system");
|
|
2581
|
-
var NoiseSimplexNodeTemplateFactory = class {
|
|
2582
|
-
template = {
|
|
2583
|
-
type: "noise-simplex" /* noiseSimplex */,
|
|
2584
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2585
|
-
data: {
|
|
2586
|
-
title: "Simplex Noise"
|
|
2587
|
-
},
|
|
2588
|
-
handles: [
|
|
2589
|
-
{
|
|
2590
|
-
position: import_system6.Position.Left,
|
|
2591
|
-
dataType: import_abstract9.CoreHandleType.variableProperty,
|
|
2592
|
-
connection: "target"
|
|
2593
|
-
},
|
|
2594
|
-
{
|
|
2595
|
-
position: import_system6.Position.Right,
|
|
2596
|
-
dataType: "module" /* module */,
|
|
2597
|
-
connection: "source"
|
|
2598
|
-
}
|
|
2599
|
-
]
|
|
2600
|
-
};
|
|
2601
|
-
};
|
|
2602
|
-
|
|
2603
|
-
// src/templates/generators/noise-spheres-template.ts
|
|
2604
|
-
var import_abstract10 = require("@awesome-flow/core/abstract");
|
|
2605
|
-
var import_system7 = require("@xyflow/system");
|
|
2606
2542
|
var NoiseSpheresNodeTemplateFactory = class {
|
|
2607
2543
|
template = {
|
|
2608
2544
|
type: "noise-spheres" /* noiseSpheres */,
|
|
@@ -2613,12 +2549,12 @@ var NoiseSpheresNodeTemplateFactory = class {
|
|
|
2613
2549
|
},
|
|
2614
2550
|
handles: [
|
|
2615
2551
|
{
|
|
2616
|
-
position:
|
|
2617
|
-
dataType:
|
|
2552
|
+
position: import_system6.Position.Left,
|
|
2553
|
+
dataType: import_abstract9.CoreHandleType.variableProperty,
|
|
2618
2554
|
connection: "target"
|
|
2619
2555
|
},
|
|
2620
2556
|
{
|
|
2621
|
-
position:
|
|
2557
|
+
position: import_system6.Position.Right,
|
|
2622
2558
|
dataType: "module" /* module */,
|
|
2623
2559
|
connection: "source"
|
|
2624
2560
|
}
|
|
@@ -2627,8 +2563,8 @@ var NoiseSpheresNodeTemplateFactory = class {
|
|
|
2627
2563
|
};
|
|
2628
2564
|
|
|
2629
2565
|
// src/templates/generators/noise-voronoi-template.ts
|
|
2630
|
-
var
|
|
2631
|
-
var
|
|
2566
|
+
var import_abstract10 = require("@awesome-flow/core/abstract");
|
|
2567
|
+
var import_system7 = require("@xyflow/system");
|
|
2632
2568
|
var NoiseVoronoiNodeTemplateFactory = class {
|
|
2633
2569
|
template = {
|
|
2634
2570
|
type: "noise-voronoi" /* noiseVoronoi */,
|
|
@@ -2642,12 +2578,12 @@ var NoiseVoronoiNodeTemplateFactory = class {
|
|
|
2642
2578
|
},
|
|
2643
2579
|
handles: [
|
|
2644
2580
|
{
|
|
2645
|
-
position:
|
|
2646
|
-
dataType:
|
|
2581
|
+
position: import_system7.Position.Left,
|
|
2582
|
+
dataType: import_abstract10.CoreHandleType.variableProperty,
|
|
2647
2583
|
connection: "target"
|
|
2648
2584
|
},
|
|
2649
2585
|
{
|
|
2650
|
-
position:
|
|
2586
|
+
position: import_system7.Position.Right,
|
|
2651
2587
|
dataType: "module" /* module */,
|
|
2652
2588
|
connection: "source"
|
|
2653
2589
|
}
|
|
@@ -2656,7 +2592,7 @@ var NoiseVoronoiNodeTemplateFactory = class {
|
|
|
2656
2592
|
};
|
|
2657
2593
|
|
|
2658
2594
|
// src/templates/generators/position-const-template.ts
|
|
2659
|
-
var
|
|
2595
|
+
var import_system8 = require("@xyflow/system");
|
|
2660
2596
|
var PositionConstNodeTemplateFactory = class {
|
|
2661
2597
|
template = {
|
|
2662
2598
|
type: "position" /* position */,
|
|
@@ -2667,7 +2603,7 @@ var PositionConstNodeTemplateFactory = class {
|
|
|
2667
2603
|
},
|
|
2668
2604
|
handles: [
|
|
2669
2605
|
{
|
|
2670
|
-
position:
|
|
2606
|
+
position: import_system8.Position.Right,
|
|
2671
2607
|
dataType: "position" /* position */,
|
|
2672
2608
|
connection: "source"
|
|
2673
2609
|
}
|
|
@@ -2676,7 +2612,7 @@ var PositionConstNodeTemplateFactory = class {
|
|
|
2676
2612
|
};
|
|
2677
2613
|
|
|
2678
2614
|
// src/templates/generators/position-grid-template.ts
|
|
2679
|
-
var
|
|
2615
|
+
var import_system9 = require("@xyflow/system");
|
|
2680
2616
|
var PositionGridNodeTemplateFactory = class {
|
|
2681
2617
|
template = {
|
|
2682
2618
|
type: "grid" /* grid */,
|
|
@@ -2688,7 +2624,7 @@ var PositionGridNodeTemplateFactory = class {
|
|
|
2688
2624
|
},
|
|
2689
2625
|
handles: [
|
|
2690
2626
|
{
|
|
2691
|
-
position:
|
|
2627
|
+
position: import_system9.Position.Right,
|
|
2692
2628
|
dataType: "position" /* position */,
|
|
2693
2629
|
connection: "source"
|
|
2694
2630
|
}
|
|
@@ -2698,7 +2634,7 @@ var PositionGridNodeTemplateFactory = class {
|
|
|
2698
2634
|
|
|
2699
2635
|
// src/templates/modifiers/noise-normalize-template.ts
|
|
2700
2636
|
var import_utils = require("@awesome-flow/core/utils");
|
|
2701
|
-
var
|
|
2637
|
+
var import_system10 = require("@xyflow/system");
|
|
2702
2638
|
var NoiseNormalizeNodeTemplateFactory = class {
|
|
2703
2639
|
template = {
|
|
2704
2640
|
id: import_utils.IDGenerator.template(),
|
|
@@ -2711,13 +2647,13 @@ var NoiseNormalizeNodeTemplateFactory = class {
|
|
|
2711
2647
|
},
|
|
2712
2648
|
handles: [
|
|
2713
2649
|
{
|
|
2714
|
-
position:
|
|
2650
|
+
position: import_system10.Position.Left,
|
|
2715
2651
|
dataType: "module" /* module */,
|
|
2716
2652
|
connection: "target",
|
|
2717
2653
|
maxConnections: 1
|
|
2718
2654
|
},
|
|
2719
2655
|
{
|
|
2720
|
-
position:
|
|
2656
|
+
position: import_system10.Position.Right,
|
|
2721
2657
|
dataType: "module" /* module */,
|
|
2722
2658
|
connection: "source"
|
|
2723
2659
|
}
|
|
@@ -2726,7 +2662,7 @@ var NoiseNormalizeNodeTemplateFactory = class {
|
|
|
2726
2662
|
};
|
|
2727
2663
|
|
|
2728
2664
|
// src/templates/output/noise-logger-template.ts
|
|
2729
|
-
var
|
|
2665
|
+
var import_system11 = require("@xyflow/system");
|
|
2730
2666
|
var NoiseLoggerNodeTemplateFactory = class {
|
|
2731
2667
|
template = {
|
|
2732
2668
|
type: "noise-logger" /* noiseLogger */,
|
|
@@ -2736,7 +2672,7 @@ var NoiseLoggerNodeTemplateFactory = class {
|
|
|
2736
2672
|
},
|
|
2737
2673
|
handles: [
|
|
2738
2674
|
{
|
|
2739
|
-
position:
|
|
2675
|
+
position: import_system11.Position.Left,
|
|
2740
2676
|
dataType: "noise" /* noise */,
|
|
2741
2677
|
connection: "target"
|
|
2742
2678
|
}
|
|
@@ -2745,7 +2681,7 @@ var NoiseLoggerNodeTemplateFactory = class {
|
|
|
2745
2681
|
};
|
|
2746
2682
|
|
|
2747
2683
|
// src/templates/output/noise-raw-texture-template.ts
|
|
2748
|
-
var
|
|
2684
|
+
var import_system12 = require("@xyflow/system");
|
|
2749
2685
|
var NoiseRawTextureTemplateFactory = class {
|
|
2750
2686
|
template = {
|
|
2751
2687
|
type: "texture-data" /* textureData */,
|
|
@@ -2755,13 +2691,13 @@ var NoiseRawTextureTemplateFactory = class {
|
|
|
2755
2691
|
},
|
|
2756
2692
|
handles: [
|
|
2757
2693
|
{
|
|
2758
|
-
position:
|
|
2694
|
+
position: import_system12.Position.Left,
|
|
2759
2695
|
dataType: "noise" /* noise */,
|
|
2760
2696
|
connection: "target",
|
|
2761
2697
|
maxConnections: 1
|
|
2762
2698
|
},
|
|
2763
2699
|
{
|
|
2764
|
-
position:
|
|
2700
|
+
position: import_system12.Position.Right,
|
|
2765
2701
|
dataType: "texture" /* texture */,
|
|
2766
2702
|
connection: "source"
|
|
2767
2703
|
}
|
|
@@ -2770,7 +2706,7 @@ var NoiseRawTextureTemplateFactory = class {
|
|
|
2770
2706
|
};
|
|
2771
2707
|
|
|
2772
2708
|
// src/templates/output/position-logger-template.ts
|
|
2773
|
-
var
|
|
2709
|
+
var import_system13 = require("@xyflow/system");
|
|
2774
2710
|
var PositionLoggerNodeTemplateFactory = class {
|
|
2775
2711
|
template = {
|
|
2776
2712
|
type: "position-logger" /* positionLogger */,
|
|
@@ -2780,7 +2716,7 @@ var PositionLoggerNodeTemplateFactory = class {
|
|
|
2780
2716
|
},
|
|
2781
2717
|
handles: [
|
|
2782
2718
|
{
|
|
2783
|
-
position:
|
|
2719
|
+
position: import_system13.Position.Left,
|
|
2784
2720
|
dataType: "position" /* position */,
|
|
2785
2721
|
connection: "target"
|
|
2786
2722
|
}
|
|
@@ -2789,7 +2725,7 @@ var PositionLoggerNodeTemplateFactory = class {
|
|
|
2789
2725
|
};
|
|
2790
2726
|
|
|
2791
2727
|
// src/templates/modifiers/noise-combine-template.ts
|
|
2792
|
-
var
|
|
2728
|
+
var import_system14 = require("@xyflow/system");
|
|
2793
2729
|
var NoiseCombineNodeTemplateFactory = class {
|
|
2794
2730
|
template = {
|
|
2795
2731
|
type: "noise-combiner" /* noiseCombine */,
|
|
@@ -2800,13 +2736,13 @@ var NoiseCombineNodeTemplateFactory = class {
|
|
|
2800
2736
|
},
|
|
2801
2737
|
handles: [
|
|
2802
2738
|
{
|
|
2803
|
-
position:
|
|
2739
|
+
position: import_system14.Position.Left,
|
|
2804
2740
|
dataType: "module" /* module */,
|
|
2805
2741
|
connection: "target",
|
|
2806
2742
|
maxConnections: 2
|
|
2807
2743
|
},
|
|
2808
2744
|
{
|
|
2809
|
-
position:
|
|
2745
|
+
position: import_system14.Position.Right,
|
|
2810
2746
|
dataType: "module" /* module */,
|
|
2811
2747
|
connection: "source"
|
|
2812
2748
|
}
|
|
@@ -2815,7 +2751,7 @@ var NoiseCombineNodeTemplateFactory = class {
|
|
|
2815
2751
|
};
|
|
2816
2752
|
|
|
2817
2753
|
// src/templates/modifiers/noise-clamp-template.ts
|
|
2818
|
-
var
|
|
2754
|
+
var import_system15 = require("@xyflow/system");
|
|
2819
2755
|
var NoiseClampNodeTemplateFactory = class {
|
|
2820
2756
|
template = {
|
|
2821
2757
|
type: "noise-clamp" /* noiseClamp */,
|
|
@@ -2827,13 +2763,13 @@ var NoiseClampNodeTemplateFactory = class {
|
|
|
2827
2763
|
},
|
|
2828
2764
|
handles: [
|
|
2829
2765
|
{
|
|
2830
|
-
position:
|
|
2766
|
+
position: import_system15.Position.Left,
|
|
2831
2767
|
dataType: "module" /* module */,
|
|
2832
2768
|
connection: "target",
|
|
2833
2769
|
maxConnections: 1
|
|
2834
2770
|
},
|
|
2835
2771
|
{
|
|
2836
|
-
position:
|
|
2772
|
+
position: import_system15.Position.Right,
|
|
2837
2773
|
dataType: "module" /* module */,
|
|
2838
2774
|
connection: "source"
|
|
2839
2775
|
}
|
|
@@ -2842,7 +2778,7 @@ var NoiseClampNodeTemplateFactory = class {
|
|
|
2842
2778
|
};
|
|
2843
2779
|
|
|
2844
2780
|
// src/templates/modifiers/noise-abs-template.ts
|
|
2845
|
-
var
|
|
2781
|
+
var import_system16 = require("@xyflow/system");
|
|
2846
2782
|
var NoiseAbsNodeTemplateFactory = class {
|
|
2847
2783
|
template = {
|
|
2848
2784
|
type: "noise-abs" /* noiseAbs */,
|
|
@@ -2852,13 +2788,13 @@ var NoiseAbsNodeTemplateFactory = class {
|
|
|
2852
2788
|
},
|
|
2853
2789
|
handles: [
|
|
2854
2790
|
{
|
|
2855
|
-
position:
|
|
2791
|
+
position: import_system16.Position.Left,
|
|
2856
2792
|
dataType: "module" /* module */,
|
|
2857
2793
|
connection: "target",
|
|
2858
2794
|
maxConnections: 1
|
|
2859
2795
|
},
|
|
2860
2796
|
{
|
|
2861
|
-
position:
|
|
2797
|
+
position: import_system16.Position.Right,
|
|
2862
2798
|
dataType: "module" /* module */,
|
|
2863
2799
|
connection: "source"
|
|
2864
2800
|
}
|
|
@@ -2867,7 +2803,7 @@ var NoiseAbsNodeTemplateFactory = class {
|
|
|
2867
2803
|
};
|
|
2868
2804
|
|
|
2869
2805
|
// src/templates/output/noise-output-template.ts
|
|
2870
|
-
var
|
|
2806
|
+
var import_system17 = require("@xyflow/system");
|
|
2871
2807
|
var NoiseOutputNodeTemplateFactory = class {
|
|
2872
2808
|
template = {
|
|
2873
2809
|
type: "noise-output" /* noiseOutput */,
|
|
@@ -2877,18 +2813,18 @@ var NoiseOutputNodeTemplateFactory = class {
|
|
|
2877
2813
|
},
|
|
2878
2814
|
handles: [
|
|
2879
2815
|
{
|
|
2880
|
-
position:
|
|
2816
|
+
position: import_system17.Position.Left,
|
|
2881
2817
|
dataType: "position" /* position */,
|
|
2882
2818
|
connection: "target"
|
|
2883
2819
|
},
|
|
2884
2820
|
{
|
|
2885
|
-
position:
|
|
2821
|
+
position: import_system17.Position.Left,
|
|
2886
2822
|
dataType: "module" /* module */,
|
|
2887
2823
|
connection: "target",
|
|
2888
2824
|
maxConnections: 1
|
|
2889
2825
|
},
|
|
2890
2826
|
{
|
|
2891
|
-
position:
|
|
2827
|
+
position: import_system17.Position.Right,
|
|
2892
2828
|
dataType: "noise" /* noise */,
|
|
2893
2829
|
connection: "source"
|
|
2894
2830
|
}
|
|
@@ -2897,8 +2833,7 @@ var NoiseOutputNodeTemplateFactory = class {
|
|
|
2897
2833
|
};
|
|
2898
2834
|
|
|
2899
2835
|
// src/templates/modifiers/noise-curve-template.ts
|
|
2900
|
-
var
|
|
2901
|
-
var import_system19 = require("@xyflow/system");
|
|
2836
|
+
var import_system18 = require("@xyflow/system");
|
|
2902
2837
|
var NoiseCurveNodeTemplateFactory = class {
|
|
2903
2838
|
template = {
|
|
2904
2839
|
type: "noise-curve" /* noiseCurve */,
|
|
@@ -2909,18 +2844,18 @@ var NoiseCurveNodeTemplateFactory = class {
|
|
|
2909
2844
|
},
|
|
2910
2845
|
handles: [
|
|
2911
2846
|
{
|
|
2912
|
-
position:
|
|
2847
|
+
position: import_system18.Position.Left,
|
|
2913
2848
|
dataType: "module" /* module */,
|
|
2914
2849
|
connection: "target",
|
|
2915
2850
|
maxConnections: 1
|
|
2916
2851
|
},
|
|
2852
|
+
// {
|
|
2853
|
+
// position: Position.Left,
|
|
2854
|
+
// dataType: CoreHandleType.variableProperty,
|
|
2855
|
+
// connection: 'target',
|
|
2856
|
+
// },
|
|
2917
2857
|
{
|
|
2918
|
-
position:
|
|
2919
|
-
dataType: import_abstract20.CoreHandleType.variableProperty,
|
|
2920
|
-
connection: "target"
|
|
2921
|
-
},
|
|
2922
|
-
{
|
|
2923
|
-
position: import_system19.Position.Right,
|
|
2858
|
+
position: import_system18.Position.Right,
|
|
2924
2859
|
dataType: "module" /* module */,
|
|
2925
2860
|
connection: "source"
|
|
2926
2861
|
}
|
|
@@ -2929,7 +2864,7 @@ var NoiseCurveNodeTemplateFactory = class {
|
|
|
2929
2864
|
};
|
|
2930
2865
|
|
|
2931
2866
|
// src/templates/modifiers/noise-exponent-template.ts
|
|
2932
|
-
var
|
|
2867
|
+
var import_system19 = require("@xyflow/system");
|
|
2933
2868
|
var NoiseExponentNodeTemplateFactory = class {
|
|
2934
2869
|
template = {
|
|
2935
2870
|
type: "noise-exponent" /* noiseExponent */,
|
|
@@ -2940,13 +2875,13 @@ var NoiseExponentNodeTemplateFactory = class {
|
|
|
2940
2875
|
},
|
|
2941
2876
|
handles: [
|
|
2942
2877
|
{
|
|
2943
|
-
position:
|
|
2878
|
+
position: import_system19.Position.Left,
|
|
2944
2879
|
dataType: "module" /* module */,
|
|
2945
2880
|
connection: "target",
|
|
2946
2881
|
maxConnections: 1
|
|
2947
2882
|
},
|
|
2948
2883
|
{
|
|
2949
|
-
position:
|
|
2884
|
+
position: import_system19.Position.Right,
|
|
2950
2885
|
dataType: "module" /* module */,
|
|
2951
2886
|
connection: "source"
|
|
2952
2887
|
}
|
|
@@ -2955,7 +2890,7 @@ var NoiseExponentNodeTemplateFactory = class {
|
|
|
2955
2890
|
};
|
|
2956
2891
|
|
|
2957
2892
|
// src/templates/modifiers/noise-invert-template.ts
|
|
2958
|
-
var
|
|
2893
|
+
var import_system20 = require("@xyflow/system");
|
|
2959
2894
|
var NoiseInvertNodeTemplateFactory = class {
|
|
2960
2895
|
template = {
|
|
2961
2896
|
type: "noise-invert" /* noiseInvert */,
|
|
@@ -2965,13 +2900,13 @@ var NoiseInvertNodeTemplateFactory = class {
|
|
|
2965
2900
|
},
|
|
2966
2901
|
handles: [
|
|
2967
2902
|
{
|
|
2968
|
-
position:
|
|
2903
|
+
position: import_system20.Position.Left,
|
|
2969
2904
|
dataType: "module" /* module */,
|
|
2970
2905
|
connection: "target",
|
|
2971
2906
|
maxConnections: 1
|
|
2972
2907
|
},
|
|
2973
2908
|
{
|
|
2974
|
-
position:
|
|
2909
|
+
position: import_system20.Position.Right,
|
|
2975
2910
|
dataType: "module" /* module */,
|
|
2976
2911
|
connection: "source"
|
|
2977
2912
|
}
|
|
@@ -2980,7 +2915,7 @@ var NoiseInvertNodeTemplateFactory = class {
|
|
|
2980
2915
|
};
|
|
2981
2916
|
|
|
2982
2917
|
// src/templates/modifiers/noise-scalebias-template.ts
|
|
2983
|
-
var
|
|
2918
|
+
var import_system21 = require("@xyflow/system");
|
|
2984
2919
|
var NoiseScaleBiasNodeTemplateFactory = class {
|
|
2985
2920
|
template = {
|
|
2986
2921
|
type: "noise-scale-bias" /* noiseScaleBias */,
|
|
@@ -2992,13 +2927,13 @@ var NoiseScaleBiasNodeTemplateFactory = class {
|
|
|
2992
2927
|
},
|
|
2993
2928
|
handles: [
|
|
2994
2929
|
{
|
|
2995
|
-
position:
|
|
2930
|
+
position: import_system21.Position.Left,
|
|
2996
2931
|
dataType: "module" /* module */,
|
|
2997
2932
|
connection: "target",
|
|
2998
2933
|
maxConnections: 1
|
|
2999
2934
|
},
|
|
3000
2935
|
{
|
|
3001
|
-
position:
|
|
2936
|
+
position: import_system21.Position.Right,
|
|
3002
2937
|
dataType: "module" /* module */,
|
|
3003
2938
|
connection: "source"
|
|
3004
2939
|
}
|
|
@@ -3007,7 +2942,7 @@ var NoiseScaleBiasNodeTemplateFactory = class {
|
|
|
3007
2942
|
};
|
|
3008
2943
|
|
|
3009
2944
|
// src/templates/modifiers/noise-terrace-template.ts
|
|
3010
|
-
var
|
|
2945
|
+
var import_system22 = require("@xyflow/system");
|
|
3011
2946
|
var NoiseTerraceNodeTemplateFactory = class {
|
|
3012
2947
|
template = {
|
|
3013
2948
|
type: "noise-terrace" /* noiseTerrace */,
|
|
@@ -3018,13 +2953,13 @@ var NoiseTerraceNodeTemplateFactory = class {
|
|
|
3018
2953
|
},
|
|
3019
2954
|
handles: [
|
|
3020
2955
|
{
|
|
3021
|
-
position:
|
|
2956
|
+
position: import_system22.Position.Left,
|
|
3022
2957
|
dataType: "module" /* module */,
|
|
3023
2958
|
connection: "target",
|
|
3024
2959
|
maxConnections: 1
|
|
3025
2960
|
},
|
|
3026
2961
|
{
|
|
3027
|
-
position:
|
|
2962
|
+
position: import_system22.Position.Right,
|
|
3028
2963
|
dataType: "module" /* module */,
|
|
3029
2964
|
connection: "source"
|
|
3030
2965
|
}
|
|
@@ -3033,7 +2968,7 @@ var NoiseTerraceNodeTemplateFactory = class {
|
|
|
3033
2968
|
};
|
|
3034
2969
|
|
|
3035
2970
|
// src/templates/selectors/noise-blend-template.ts
|
|
3036
|
-
var
|
|
2971
|
+
var import_system23 = require("@xyflow/system");
|
|
3037
2972
|
var NoiseBlendNodeTemplateFactory = class {
|
|
3038
2973
|
template = {
|
|
3039
2974
|
type: "noise-blend" /* noiseBlend */,
|
|
@@ -3043,7 +2978,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
3043
2978
|
},
|
|
3044
2979
|
handles: [
|
|
3045
2980
|
{
|
|
3046
|
-
position:
|
|
2981
|
+
position: import_system23.Position.Left,
|
|
3047
2982
|
dataType: "module" /* module */,
|
|
3048
2983
|
connection: "target",
|
|
3049
2984
|
label: "Source Modules",
|
|
@@ -3052,7 +2987,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
3052
2987
|
minConnections: 2
|
|
3053
2988
|
},
|
|
3054
2989
|
{
|
|
3055
|
-
position:
|
|
2990
|
+
position: import_system23.Position.Left,
|
|
3056
2991
|
dataType: "module" /* module */,
|
|
3057
2992
|
dataId: "control" /* control */,
|
|
3058
2993
|
connection: "target",
|
|
@@ -3060,7 +2995,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
3060
2995
|
maxConnections: 1
|
|
3061
2996
|
},
|
|
3062
2997
|
{
|
|
3063
|
-
position:
|
|
2998
|
+
position: import_system23.Position.Right,
|
|
3064
2999
|
dataType: "module" /* module */,
|
|
3065
3000
|
dataId: "output" /* output */,
|
|
3066
3001
|
connection: "source"
|
|
@@ -3070,7 +3005,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
3070
3005
|
};
|
|
3071
3006
|
|
|
3072
3007
|
// src/templates/selectors/noise-select-template.ts
|
|
3073
|
-
var
|
|
3008
|
+
var import_system24 = require("@xyflow/system");
|
|
3074
3009
|
var NoiseSelectNodeTemplateFactory = class {
|
|
3075
3010
|
template = {
|
|
3076
3011
|
type: "noise-select" /* noiseSelect */,
|
|
@@ -3083,7 +3018,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
3083
3018
|
},
|
|
3084
3019
|
handles: [
|
|
3085
3020
|
{
|
|
3086
|
-
position:
|
|
3021
|
+
position: import_system24.Position.Left,
|
|
3087
3022
|
dataType: "module" /* module */,
|
|
3088
3023
|
dataId: "source" /* source */,
|
|
3089
3024
|
connection: "target",
|
|
@@ -3092,7 +3027,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
3092
3027
|
minConnections: 2
|
|
3093
3028
|
},
|
|
3094
3029
|
{
|
|
3095
|
-
position:
|
|
3030
|
+
position: import_system24.Position.Left,
|
|
3096
3031
|
dataType: "module" /* module */,
|
|
3097
3032
|
dataId: "control" /* control */,
|
|
3098
3033
|
connection: "target",
|
|
@@ -3100,7 +3035,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
3100
3035
|
maxConnections: 1
|
|
3101
3036
|
},
|
|
3102
3037
|
{
|
|
3103
|
-
position:
|
|
3038
|
+
position: import_system24.Position.Right,
|
|
3104
3039
|
dataType: "module" /* module */,
|
|
3105
3040
|
dataId: "output" /* output */,
|
|
3106
3041
|
connection: "source"
|
|
@@ -3110,7 +3045,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
3110
3045
|
};
|
|
3111
3046
|
|
|
3112
3047
|
// src/templates/transformers/noise-displace-template.ts
|
|
3113
|
-
var
|
|
3048
|
+
var import_system25 = require("@xyflow/system");
|
|
3114
3049
|
var NoiseDisplaceNodeTemplateFactory = class {
|
|
3115
3050
|
template = {
|
|
3116
3051
|
type: "noise-displace" /* noiseDisplace */,
|
|
@@ -3120,7 +3055,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3120
3055
|
},
|
|
3121
3056
|
handles: [
|
|
3122
3057
|
{
|
|
3123
|
-
position:
|
|
3058
|
+
position: import_system25.Position.Left,
|
|
3124
3059
|
connection: "target",
|
|
3125
3060
|
label: "Source Module",
|
|
3126
3061
|
dataType: "module" /* module */,
|
|
@@ -3128,7 +3063,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3128
3063
|
maxConnections: 1
|
|
3129
3064
|
},
|
|
3130
3065
|
{
|
|
3131
|
-
position:
|
|
3066
|
+
position: import_system25.Position.Left,
|
|
3132
3067
|
connection: "target",
|
|
3133
3068
|
label: "X Module",
|
|
3134
3069
|
dataType: "module" /* module */,
|
|
@@ -3136,7 +3071,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3136
3071
|
maxConnections: 1
|
|
3137
3072
|
},
|
|
3138
3073
|
{
|
|
3139
|
-
position:
|
|
3074
|
+
position: import_system25.Position.Left,
|
|
3140
3075
|
connection: "target",
|
|
3141
3076
|
label: "Y Module",
|
|
3142
3077
|
dataType: "module" /* module */,
|
|
@@ -3144,7 +3079,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3144
3079
|
maxConnections: 1
|
|
3145
3080
|
},
|
|
3146
3081
|
{
|
|
3147
|
-
position:
|
|
3082
|
+
position: import_system25.Position.Left,
|
|
3148
3083
|
connection: "target",
|
|
3149
3084
|
label: "Z Module",
|
|
3150
3085
|
dataType: "module" /* module */,
|
|
@@ -3152,7 +3087,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3152
3087
|
maxConnections: 1
|
|
3153
3088
|
},
|
|
3154
3089
|
{
|
|
3155
|
-
position:
|
|
3090
|
+
position: import_system25.Position.Right,
|
|
3156
3091
|
dataType: "module" /* module */,
|
|
3157
3092
|
dataId: "output" /* output */,
|
|
3158
3093
|
connection: "source"
|
|
@@ -3162,7 +3097,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
3162
3097
|
};
|
|
3163
3098
|
|
|
3164
3099
|
// src/templates/transformers/noise-rotate-point-template.ts
|
|
3165
|
-
var
|
|
3100
|
+
var import_system26 = require("@xyflow/system");
|
|
3166
3101
|
var NoiseRotatePointNodeTemplateFactory = class {
|
|
3167
3102
|
template = {
|
|
3168
3103
|
type: "noise-rotate-point" /* noiseRotatePoint */,
|
|
@@ -3175,14 +3110,14 @@ var NoiseRotatePointNodeTemplateFactory = class {
|
|
|
3175
3110
|
},
|
|
3176
3111
|
handles: [
|
|
3177
3112
|
{
|
|
3178
|
-
position:
|
|
3113
|
+
position: import_system26.Position.Left,
|
|
3179
3114
|
dataType: "module" /* module */,
|
|
3180
3115
|
connection: "target",
|
|
3181
3116
|
label: "Source Module",
|
|
3182
3117
|
maxConnections: 1
|
|
3183
3118
|
},
|
|
3184
3119
|
{
|
|
3185
|
-
position:
|
|
3120
|
+
position: import_system26.Position.Right,
|
|
3186
3121
|
dataType: "module" /* module */,
|
|
3187
3122
|
connection: "source"
|
|
3188
3123
|
}
|
|
@@ -3191,7 +3126,7 @@ var NoiseRotatePointNodeTemplateFactory = class {
|
|
|
3191
3126
|
};
|
|
3192
3127
|
|
|
3193
3128
|
// src/templates/transformers/noise-scale-point-template.ts
|
|
3194
|
-
var
|
|
3129
|
+
var import_system27 = require("@xyflow/system");
|
|
3195
3130
|
var NoiseScalePointNodeTemplateFactory = class {
|
|
3196
3131
|
template = {
|
|
3197
3132
|
type: "noise-scale-point" /* noiseScalePoint */,
|
|
@@ -3204,14 +3139,14 @@ var NoiseScalePointNodeTemplateFactory = class {
|
|
|
3204
3139
|
},
|
|
3205
3140
|
handles: [
|
|
3206
3141
|
{
|
|
3207
|
-
position:
|
|
3142
|
+
position: import_system27.Position.Left,
|
|
3208
3143
|
dataType: "module" /* module */,
|
|
3209
3144
|
connection: "target",
|
|
3210
3145
|
label: "Source Module",
|
|
3211
3146
|
maxConnections: 1
|
|
3212
3147
|
},
|
|
3213
3148
|
{
|
|
3214
|
-
position:
|
|
3149
|
+
position: import_system27.Position.Right,
|
|
3215
3150
|
dataType: "module" /* module */,
|
|
3216
3151
|
connection: "source"
|
|
3217
3152
|
}
|
|
@@ -3220,7 +3155,7 @@ var NoiseScalePointNodeTemplateFactory = class {
|
|
|
3220
3155
|
};
|
|
3221
3156
|
|
|
3222
3157
|
// src/templates/transformers/noise-translate-point-template.ts
|
|
3223
|
-
var
|
|
3158
|
+
var import_system28 = require("@xyflow/system");
|
|
3224
3159
|
var NoiseTranslatePointNodeTemplateFactory = class {
|
|
3225
3160
|
template = {
|
|
3226
3161
|
type: "noise-translate-point" /* noiseTranslatePoint */,
|
|
@@ -3233,14 +3168,14 @@ var NoiseTranslatePointNodeTemplateFactory = class {
|
|
|
3233
3168
|
},
|
|
3234
3169
|
handles: [
|
|
3235
3170
|
{
|
|
3236
|
-
position:
|
|
3171
|
+
position: import_system28.Position.Left,
|
|
3237
3172
|
dataType: "module" /* module */,
|
|
3238
3173
|
connection: "target",
|
|
3239
3174
|
label: "Source Module",
|
|
3240
3175
|
maxConnections: 1
|
|
3241
3176
|
},
|
|
3242
3177
|
{
|
|
3243
|
-
position:
|
|
3178
|
+
position: import_system28.Position.Right,
|
|
3244
3179
|
dataType: "module" /* module */,
|
|
3245
3180
|
connection: "source"
|
|
3246
3181
|
}
|
|
@@ -3249,8 +3184,8 @@ var NoiseTranslatePointNodeTemplateFactory = class {
|
|
|
3249
3184
|
};
|
|
3250
3185
|
|
|
3251
3186
|
// src/templates/transformers/noise-turbulence-template.ts
|
|
3252
|
-
var
|
|
3253
|
-
var
|
|
3187
|
+
var import_abstract30 = require("@awesome-flow/core/abstract");
|
|
3188
|
+
var import_system29 = require("@xyflow/system");
|
|
3254
3189
|
var NoiseTurbulenceNodeTemplateFactory = class {
|
|
3255
3190
|
template = {
|
|
3256
3191
|
type: "noise-turbulence" /* noiseTurbulence */,
|
|
@@ -3264,20 +3199,20 @@ var NoiseTurbulenceNodeTemplateFactory = class {
|
|
|
3264
3199
|
},
|
|
3265
3200
|
handles: [
|
|
3266
3201
|
{
|
|
3267
|
-
position:
|
|
3202
|
+
position: import_system29.Position.Left,
|
|
3268
3203
|
dataType: "module" /* module */,
|
|
3269
3204
|
connection: "target",
|
|
3270
3205
|
label: "Source Module",
|
|
3271
3206
|
maxConnections: 1
|
|
3272
3207
|
},
|
|
3273
3208
|
{
|
|
3274
|
-
position:
|
|
3275
|
-
dataType:
|
|
3209
|
+
position: import_system29.Position.Left,
|
|
3210
|
+
dataType: import_abstract30.CoreHandleType.variableProperty,
|
|
3276
3211
|
label: "Variable Properties",
|
|
3277
3212
|
connection: "target"
|
|
3278
3213
|
},
|
|
3279
3214
|
{
|
|
3280
|
-
position:
|
|
3215
|
+
position: import_system29.Position.Right,
|
|
3281
3216
|
dataType: "module" /* module */,
|
|
3282
3217
|
connection: "source"
|
|
3283
3218
|
}
|
|
@@ -3286,9 +3221,9 @@ var NoiseTurbulenceNodeTemplateFactory = class {
|
|
|
3286
3221
|
};
|
|
3287
3222
|
|
|
3288
3223
|
// src/templates/generators/noise-billow-template.ts
|
|
3289
|
-
var
|
|
3224
|
+
var import_abstract32 = require("@awesome-flow/core/abstract");
|
|
3290
3225
|
var import_utils2 = require("@awesome-flow/core/utils");
|
|
3291
|
-
var
|
|
3226
|
+
var import_system30 = require("@xyflow/system");
|
|
3292
3227
|
var NoiseBillowNodeTemplateFactory = class {
|
|
3293
3228
|
template = {
|
|
3294
3229
|
id: import_utils2.IDGenerator.template(),
|
|
@@ -3304,12 +3239,12 @@ var NoiseBillowNodeTemplateFactory = class {
|
|
|
3304
3239
|
},
|
|
3305
3240
|
handles: [
|
|
3306
3241
|
{
|
|
3307
|
-
position:
|
|
3308
|
-
dataType:
|
|
3242
|
+
position: import_system30.Position.Left,
|
|
3243
|
+
dataType: import_abstract32.CoreHandleType.variableProperty,
|
|
3309
3244
|
connection: "target"
|
|
3310
3245
|
},
|
|
3311
3246
|
{
|
|
3312
|
-
position:
|
|
3247
|
+
position: import_system30.Position.Right,
|
|
3313
3248
|
dataType: "module" /* module */,
|
|
3314
3249
|
connection: "source"
|
|
3315
3250
|
}
|
|
@@ -3318,14 +3253,14 @@ var NoiseBillowNodeTemplateFactory = class {
|
|
|
3318
3253
|
};
|
|
3319
3254
|
|
|
3320
3255
|
// src/templates/groups/module-group-template.ts
|
|
3321
|
-
var
|
|
3256
|
+
var import_abstract33 = require("@awesome-flow/core/abstract");
|
|
3322
3257
|
var import_utils3 = require("@awesome-flow/core/utils");
|
|
3323
|
-
var
|
|
3258
|
+
var import_system31 = require("@xyflow/system");
|
|
3324
3259
|
var ModuleGroupNodeTemplateFactory = class {
|
|
3325
3260
|
template = {
|
|
3326
3261
|
id: import_utils3.IDGenerator.template(),
|
|
3327
3262
|
type: "group-module" /* groupModule */,
|
|
3328
|
-
group:
|
|
3263
|
+
group: import_abstract33.CoreTemplateGroup.groups,
|
|
3329
3264
|
data: {
|
|
3330
3265
|
title: "Modules Group",
|
|
3331
3266
|
isGroup: true,
|
|
@@ -3340,14 +3275,14 @@ var ModuleGroupNodeTemplateFactory = class {
|
|
|
3340
3275
|
},
|
|
3341
3276
|
handles: [
|
|
3342
3277
|
{
|
|
3343
|
-
position:
|
|
3278
|
+
position: import_system31.Position.Bottom,
|
|
3344
3279
|
dataType: "module" /* module */,
|
|
3345
3280
|
connection: "target",
|
|
3346
3281
|
maxConnections: 1,
|
|
3347
3282
|
hideOnCollapse: true
|
|
3348
3283
|
},
|
|
3349
3284
|
{
|
|
3350
|
-
position:
|
|
3285
|
+
position: import_system31.Position.Right,
|
|
3351
3286
|
dataType: "module" /* module */,
|
|
3352
3287
|
connection: "source"
|
|
3353
3288
|
}
|
|
@@ -3356,13 +3291,13 @@ var ModuleGroupNodeTemplateFactory = class {
|
|
|
3356
3291
|
};
|
|
3357
3292
|
|
|
3358
3293
|
// src/nodes/groups/module-group-node.tsx
|
|
3359
|
-
var
|
|
3360
|
-
var
|
|
3361
|
-
var
|
|
3294
|
+
var import_layout31 = require("@awesome-flow/core/layout");
|
|
3295
|
+
var import_react38 = require("@xyflow/react");
|
|
3296
|
+
var import_react39 = require("react");
|
|
3362
3297
|
var import_shallow = require("zustand/shallow");
|
|
3363
3298
|
var import_core18 = require("@mantine/core");
|
|
3364
|
-
var
|
|
3365
|
-
var
|
|
3299
|
+
var import_hooks33 = require("@awesome-flow/core/hooks");
|
|
3300
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3366
3301
|
function ModuleGroupNode({
|
|
3367
3302
|
id,
|
|
3368
3303
|
selected,
|
|
@@ -3371,22 +3306,22 @@ function ModuleGroupNode({
|
|
|
3371
3306
|
width,
|
|
3372
3307
|
height
|
|
3373
3308
|
}) {
|
|
3374
|
-
const updateNodeInternals = (0,
|
|
3375
|
-
const triggerNodeChanges = (0,
|
|
3376
|
-
const { groupNodes, setGroupCollapsed } = (0,
|
|
3377
|
-
(0,
|
|
3309
|
+
const updateNodeInternals = (0, import_react38.useUpdateNodeInternals)();
|
|
3310
|
+
const triggerNodeChanges = (0, import_react38.useStore)((s) => s.triggerNodeChanges);
|
|
3311
|
+
const { groupNodes, setGroupCollapsed } = (0, import_hooks33.useFlowStore)(
|
|
3312
|
+
(0, import_react39.useCallback)(
|
|
3378
3313
|
(state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
|
|
3379
3314
|
[]
|
|
3380
3315
|
)
|
|
3381
3316
|
);
|
|
3382
|
-
const intersectingNode = (0,
|
|
3383
|
-
(0,
|
|
3317
|
+
const intersectingNode = (0, import_hooks33.useInteractiveStore)(
|
|
3318
|
+
(0, import_react39.useCallback)((state) => state.nodeIntersectionTargets[id], [id]),
|
|
3384
3319
|
import_shallow.shallow
|
|
3385
3320
|
);
|
|
3386
|
-
(0,
|
|
3321
|
+
(0, import_react39.useEffect)(() => {
|
|
3387
3322
|
updateNodeInternals(id);
|
|
3388
3323
|
}, [width, height]);
|
|
3389
|
-
(0,
|
|
3324
|
+
(0, import_react39.useEffect)(() => {
|
|
3390
3325
|
triggerNodeChanges([
|
|
3391
3326
|
{
|
|
3392
3327
|
id,
|
|
@@ -3395,37 +3330,37 @@ function ModuleGroupNode({
|
|
|
3395
3330
|
}
|
|
3396
3331
|
]);
|
|
3397
3332
|
}, [intersectingNode]);
|
|
3398
|
-
const onCollapsed = (0,
|
|
3333
|
+
const onCollapsed = (0, import_react39.useCallback)((collapsed) => {
|
|
3399
3334
|
setGroupCollapsed(id, collapsed);
|
|
3400
3335
|
}, []);
|
|
3401
|
-
const size = (0,
|
|
3336
|
+
const size = (0, import_react39.useMemo)(() => {
|
|
3402
3337
|
return {
|
|
3403
3338
|
width: data.initialSize?.width || 100,
|
|
3404
3339
|
height: data.initialSize?.height || 50
|
|
3405
3340
|
};
|
|
3406
3341
|
}, [data.initialSize]);
|
|
3407
|
-
const incomingModules = (0,
|
|
3408
|
-
const updateComputedData = (0,
|
|
3409
|
-
(0,
|
|
3342
|
+
const incomingModules = (0, import_hooks33.useIncomingComputedData)(id);
|
|
3343
|
+
const updateComputedData = (0, import_hooks33.useUpdateNodeComputedData)();
|
|
3344
|
+
(0, import_react39.useEffect)(() => {
|
|
3410
3345
|
if (incomingModules?.length) {
|
|
3411
3346
|
const { module: module2 } = incomingModules[0];
|
|
3412
3347
|
updateComputedData(id, { module: module2 });
|
|
3413
3348
|
}
|
|
3414
3349
|
}, [incomingModules]);
|
|
3415
|
-
return /* @__PURE__ */ (0,
|
|
3416
|
-
|
|
3350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3351
|
+
import_layout31.NodeContainer,
|
|
3417
3352
|
{
|
|
3418
3353
|
id,
|
|
3419
3354
|
selected,
|
|
3420
3355
|
data,
|
|
3421
|
-
title: /* @__PURE__ */ (0,
|
|
3422
|
-
/* @__PURE__ */ (0,
|
|
3423
|
-
/* @__PURE__ */ (0,
|
|
3356
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core18.Group, { justify: "space-between", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core18.Group, { gap: "xs", children: [
|
|
3357
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core18.Badge, { size: "xs", variant: "outline", radius: "xs", color: "gray", children: groupNodes?.length || 0 }),
|
|
3358
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_layout31.NodeCollapse, { nodeId: id, isCollapsed: data.isCollapsed, onCollapsed })
|
|
3424
3359
|
] }) }),
|
|
3425
3360
|
type,
|
|
3426
3361
|
children: [
|
|
3427
|
-
/* @__PURE__ */ (0,
|
|
3428
|
-
|
|
3362
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3363
|
+
import_react38.NodeResizer,
|
|
3429
3364
|
{
|
|
3430
3365
|
nodeId: id,
|
|
3431
3366
|
minWidth: size.width,
|
|
@@ -3433,7 +3368,7 @@ function ModuleGroupNode({
|
|
|
3433
3368
|
isVisible: selected && !data.isCollapsed
|
|
3434
3369
|
}
|
|
3435
3370
|
),
|
|
3436
|
-
/* @__PURE__ */ (0,
|
|
3371
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_layout31.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
3437
3372
|
]
|
|
3438
3373
|
}
|
|
3439
3374
|
);
|
|
@@ -3450,7 +3385,6 @@ var NoiseNodeType = /* @__PURE__ */ ((NoiseNodeType2) => {
|
|
|
3450
3385
|
NoiseNodeType2["noiseLogger"] = "noise-logger";
|
|
3451
3386
|
NoiseNodeType2["noiseOutput"] = "noise-output";
|
|
3452
3387
|
NoiseNodeType2["noiseConst"] = "noise-constant";
|
|
3453
|
-
NoiseNodeType2["noiseSimplex"] = "noise-simplex";
|
|
3454
3388
|
NoiseNodeType2["noiseBillow"] = "noise-billow";
|
|
3455
3389
|
NoiseNodeType2["noiseCheckerboard"] = "noise-checkerboard";
|
|
3456
3390
|
NoiseNodeType2["noiseNormalize"] = "noise-normalize";
|
|
@@ -3486,7 +3420,6 @@ var noiseNodeTypes = {
|
|
|
3486
3420
|
["position-logger" /* positionLogger */]: positions_logger_node_default,
|
|
3487
3421
|
["noise-constant" /* noiseConst */]: noise_const_node_default,
|
|
3488
3422
|
["noise-billow" /* noiseBillow */]: noise_billow_node_default,
|
|
3489
|
-
["noise-simplex" /* noiseSimplex */]: noise_simplex_node_default,
|
|
3490
3423
|
["noise-checkerboard" /* noiseCheckerboard */]: noise_checkerboard_node_default,
|
|
3491
3424
|
["noise-cylinders" /* noiseCylinders */]: noise_cylinders_node_default,
|
|
3492
3425
|
["noise-perlin" /* noisePerlin */]: noise_perlin_node_default,
|
|
@@ -3512,7 +3445,6 @@ var noiseNodeTypes = {
|
|
|
3512
3445
|
};
|
|
3513
3446
|
var noiseNodeTemplates = {
|
|
3514
3447
|
["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
|
|
3515
|
-
["noise-simplex" /* noiseSimplex */]: new NoiseSimplexNodeTemplateFactory(),
|
|
3516
3448
|
["noise-billow" /* noiseBillow */]: new NoiseBillowNodeTemplateFactory(),
|
|
3517
3449
|
["noise-checkerboard" /* noiseCheckerboard */]: new NoiseCheckerboardNodeTemplateFactory(),
|
|
3518
3450
|
["noise-normalize" /* noiseNormalize */]: new NoiseNormalizeNodeTemplateFactory(),
|