@awesome-flow/noise 0.6.0 → 0.7.1
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 +1 -3561
- package/dist/abstract/index.d.cts +8 -14
- package/dist/abstract/index.d.ts +8 -14
- package/dist/abstract/index.js +1 -3595
- 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 +1 -70
- package/dist/modules/index.d.cts +2 -10
- package/dist/modules/index.d.ts +2 -10
- package/dist/modules/index.js +1 -33
- 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 +1 -389
- package/dist/nodes/generators/index.d.cts +9 -14
- package/dist/nodes/generators/index.d.ts +9 -14
- package/dist/nodes/generators/index.js +1 -343
- package/dist/nodes/groups/index.cjs +1 -113
- package/dist/nodes/groups/index.d.cts +2 -2
- package/dist/nodes/groups/index.d.ts +2 -2
- package/dist/nodes/groups/index.js +1 -92
- package/dist/nodes/index.cjs +1 -3496
- package/dist/nodes/index.d.cts +3 -6
- package/dist/nodes/index.d.ts +3 -6
- package/dist/nodes/index.js +1 -3507
- package/dist/nodes/modifiers/index.cjs +1 -1493
- package/dist/nodes/modifiers/index.d.cts +7 -10
- package/dist/nodes/modifiers/index.d.ts +7 -10
- package/dist/nodes/modifiers/index.js +1 -1506
- package/dist/nodes/output/index.cjs +1 -1390
- package/dist/nodes/output/index.d.cts +3 -3
- package/dist/nodes/output/index.d.ts +3 -3
- package/dist/nodes/output/index.js +1 -1406
- package/dist/nodes/selectors/index.cjs +1 -1372
- package/dist/nodes/selectors/index.d.cts +3 -6
- package/dist/nodes/selectors/index.d.ts +3 -6
- package/dist/nodes/selectors/index.js +1 -1390
- package/dist/nodes/transformers/index.cjs +1 -337
- package/dist/nodes/transformers/index.d.cts +7 -10
- package/dist/nodes/transformers/index.d.ts +7 -10
- package/dist/nodes/transformers/index.js +1 -319
- package/dist/templates/generators/index.cjs +1 -1273
- package/dist/templates/generators/index.d.cts +7 -14
- package/dist/templates/generators/index.d.ts +7 -14
- package/dist/templates/generators/index.js +1 -1282
- package/dist/templates/groups/index.cjs +1 -1253
- package/dist/templates/groups/index.js +1 -1272
- package/dist/templates/index.cjs +1 -1315
- package/dist/templates/index.d.cts +4 -7
- package/dist/templates/index.d.ts +4 -7
- package/dist/templates/index.js +1 -1303
- package/dist/templates/modifiers/index.cjs +1 -1269
- package/dist/templates/modifiers/index.d.cts +10 -13
- package/dist/templates/modifiers/index.d.ts +10 -13
- package/dist/templates/modifiers/index.js +1 -1280
- package/dist/templates/output/index.cjs +1 -1259
- package/dist/templates/output/index.d.cts +3 -3
- package/dist/templates/output/index.d.ts +3 -3
- package/dist/templates/output/index.js +1 -1275
- package/dist/templates/selectors/index.cjs +1 -1255
- package/dist/templates/selectors/index.d.cts +2 -5
- package/dist/templates/selectors/index.d.ts +2 -5
- package/dist/templates/selectors/index.js +1 -1273
- package/dist/templates/transformers/index.cjs +1 -1261
- package/dist/templates/transformers/index.d.cts +3 -6
- package/dist/templates/transformers/index.d.ts +3 -6
- package/dist/templates/transformers/index.js +1 -1276
- package/package.json +12 -8
package/dist/nodes/index.cjs
CHANGED
|
@@ -1,3496 +1 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __export = (target, all) => {
|
|
11
|
-
for (var name in all)
|
|
12
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
-
};
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (let key of __getOwnPropNames(from))
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
-
mod
|
|
29
|
-
));
|
|
30
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
-
|
|
32
|
-
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
33
|
-
var require_fast_deep_equal = __commonJS({
|
|
34
|
-
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports2, module2) {
|
|
35
|
-
"use strict";
|
|
36
|
-
module2.exports = function equal(a, b) {
|
|
37
|
-
if (a === b)
|
|
38
|
-
return true;
|
|
39
|
-
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
40
|
-
if (a.constructor !== b.constructor)
|
|
41
|
-
return false;
|
|
42
|
-
var length, i, keys;
|
|
43
|
-
if (Array.isArray(a)) {
|
|
44
|
-
length = a.length;
|
|
45
|
-
if (length != b.length)
|
|
46
|
-
return false;
|
|
47
|
-
for (i = length; i-- !== 0; )
|
|
48
|
-
if (!equal(a[i], b[i]))
|
|
49
|
-
return false;
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
if (a.constructor === RegExp)
|
|
53
|
-
return a.source === b.source && a.flags === b.flags;
|
|
54
|
-
if (a.valueOf !== Object.prototype.valueOf)
|
|
55
|
-
return a.valueOf() === b.valueOf();
|
|
56
|
-
if (a.toString !== Object.prototype.toString)
|
|
57
|
-
return a.toString() === b.toString();
|
|
58
|
-
keys = Object.keys(a);
|
|
59
|
-
length = keys.length;
|
|
60
|
-
if (length !== Object.keys(b).length)
|
|
61
|
-
return false;
|
|
62
|
-
for (i = length; i-- !== 0; )
|
|
63
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
64
|
-
return false;
|
|
65
|
-
for (i = length; i-- !== 0; ) {
|
|
66
|
-
var key = keys[i];
|
|
67
|
-
if (!equal(a[key], b[key]))
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
return a !== a && b !== b;
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// src/nodes/index.ts
|
|
78
|
-
var nodes_exports = {};
|
|
79
|
-
__export(nodes_exports, {
|
|
80
|
-
ModuleGroupNode: () => module_group_node_default,
|
|
81
|
-
NoiseAbsNode: () => noise_abs_node_default,
|
|
82
|
-
NoiseBillowNode: () => noise_billow_node_default,
|
|
83
|
-
NoiseBlendNode: () => noise_blend_node_default,
|
|
84
|
-
NoiseCheckerboardNode: () => noise_checkerboard_node_default,
|
|
85
|
-
NoiseClampNode: () => noise_clamp_node_default,
|
|
86
|
-
NoiseCombineNode: () => noise_combine_node_default,
|
|
87
|
-
NoiseConstNode: () => noise_const_node_default,
|
|
88
|
-
NoiseCurveNode: () => noise_curve_node_default,
|
|
89
|
-
NoiseCylindersNode: () => noise_cylinders_node_default,
|
|
90
|
-
NoiseDisplaceNode: () => noise_displace_node_default,
|
|
91
|
-
NoiseExponentNode: () => noise_exponent_node_default,
|
|
92
|
-
NoiseInvertNode: () => noise_invert_node_default,
|
|
93
|
-
NoiseLoggerNode: () => noise_logger_node_default,
|
|
94
|
-
NoiseNormalizeNode: () => noise_normalize_node_default,
|
|
95
|
-
NoiseOutputNode: () => noise_output_node_default,
|
|
96
|
-
NoisePerlinNode: () => noise_perlin_node_default,
|
|
97
|
-
NoiseRawTextureNode: () => noise_raw_texture_node_default,
|
|
98
|
-
NoiseRidgedMultiNode: () => noise_ridgedmulti_node_default,
|
|
99
|
-
NoiseRotatePointNode: () => noise_rotate_point_node_default,
|
|
100
|
-
NoiseScaleBiasNode: () => noise_scale_bias_node_default,
|
|
101
|
-
NoiseScalePointNode: () => noise_scale_point_node_default,
|
|
102
|
-
NoiseSelectNode: () => noise_select_node_default,
|
|
103
|
-
NoiseSimplexNode: () => noise_simplex_node_default,
|
|
104
|
-
NoiseSpheresNode: () => noise_spheres_node_default,
|
|
105
|
-
NoiseTerraceNode: () => noise_terrace_node_default,
|
|
106
|
-
NoiseTranslatePointNode: () => noise_translate_point_node_default,
|
|
107
|
-
NoiseTurbulenceNode: () => noise_turbulence_node_default,
|
|
108
|
-
NoiseVoronoiNode: () => noise_voronoi_node_default,
|
|
109
|
-
PositionConstNode: () => position_const_node_default,
|
|
110
|
-
PositionGridNode: () => position_grid_node_default,
|
|
111
|
-
PositionsLoggerNode: () => positions_logger_node_default
|
|
112
|
-
});
|
|
113
|
-
module.exports = __toCommonJS(nodes_exports);
|
|
114
|
-
|
|
115
|
-
// src/nodes/generators/noise-billow-node.tsx
|
|
116
|
-
var import_layout = require("@awesome-flow/core/layout");
|
|
117
|
-
var import_react = require("react");
|
|
118
|
-
var import_generator = require("libnoise-ts/module/generator");
|
|
119
|
-
var import_hooks = require("@awesome-flow/core/hooks");
|
|
120
|
-
var import_components = require("@awesome-flow/core/components");
|
|
121
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
122
|
-
function NoiseBillowNode({ id, selected, data, type }) {
|
|
123
|
-
const updateComputedData = (0, import_hooks.useUpdateNodeComputedData)();
|
|
124
|
-
const module2 = (0, import_react.useMemo)(() => new import_generator.Billow(), []);
|
|
125
|
-
const onPropertiesChange = (0, import_react.useCallback)(
|
|
126
|
-
(properties) => {
|
|
127
|
-
Object.keys(properties).forEach((k) => {
|
|
128
|
-
module2[k] = properties[k].value;
|
|
129
|
-
});
|
|
130
|
-
updateComputedData(id, { module: module2 });
|
|
131
|
-
},
|
|
132
|
-
[id, module2, updateComputedData]
|
|
133
|
-
);
|
|
134
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_layout.NodeContainer, { id, selected, data, type, children: [
|
|
135
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
136
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
137
|
-
] });
|
|
138
|
-
}
|
|
139
|
-
var noise_billow_node_default = NoiseBillowNode;
|
|
140
|
-
|
|
141
|
-
// src/nodes/generators/noise-checkerboard-node.tsx
|
|
142
|
-
var import_layout2 = require("@awesome-flow/core/layout");
|
|
143
|
-
var import_react2 = require("react");
|
|
144
|
-
var import_generator2 = require("libnoise-ts/module/generator");
|
|
145
|
-
var import_hooks2 = require("@awesome-flow/core/hooks");
|
|
146
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
147
|
-
function NoiseCheckerboardNode({ id, selected, data, type }) {
|
|
148
|
-
const updateComputedData = (0, import_hooks2.useUpdateNodeComputedData)();
|
|
149
|
-
const module2 = (0, import_react2.useMemo)(() => new import_generator2.Checkerboard(), []);
|
|
150
|
-
(0, import_react2.useEffect)(() => {
|
|
151
|
-
updateComputedData(id, { module: module2 });
|
|
152
|
-
}, [id, module2, updateComputedData]);
|
|
153
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_layout2.NodeContainer, { id, selected, data, type });
|
|
154
|
-
}
|
|
155
|
-
var noise_checkerboard_node_default = NoiseCheckerboardNode;
|
|
156
|
-
|
|
157
|
-
// src/nodes/generators/noise-const-node.tsx
|
|
158
|
-
var import_layout3 = require("@awesome-flow/core/layout");
|
|
159
|
-
var import_react3 = require("react");
|
|
160
|
-
var import_core = require("@mantine/core");
|
|
161
|
-
var import_hooks3 = require("@awesome-flow/core/hooks");
|
|
162
|
-
var import_generator3 = require("libnoise-ts/module/generator");
|
|
163
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
164
|
-
function NoiseConstNode({ id, selected, data, type }) {
|
|
165
|
-
const [min, setMin] = (0, import_react3.useState)(data.min);
|
|
166
|
-
const [max, setMax] = (0, import_react3.useState)(data.max);
|
|
167
|
-
const [noise, setNoise] = (0, import_react3.useState)(data.noise);
|
|
168
|
-
const updateNodeData = (0, import_hooks3.useUpdateNodeData)();
|
|
169
|
-
const updateComputedData = (0, import_hooks3.useUpdateNodeComputedData)();
|
|
170
|
-
const module2 = (0, import_react3.useMemo)(() => new import_generator3.Const(), []);
|
|
171
|
-
(0, import_react3.useEffect)(() => {
|
|
172
|
-
module2.value = noise;
|
|
173
|
-
updateNodeData(id, { noise, min, max });
|
|
174
|
-
updateComputedData(id, { module: module2 });
|
|
175
|
-
}, [noise, min, max, module2, updateNodeData, id, updateComputedData]);
|
|
176
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_layout3.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core.Stack, { children: [
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core.Group, { children: [
|
|
178
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core.NumberInput, { size: "xs", w: 100, value: min, onChange: (e) => setMin(Number(e)) }),
|
|
179
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core.NumberInput, { size: "xs", w: 100, value: max, onChange: (e) => setMax(Number(e)) })
|
|
180
|
-
] }),
|
|
181
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core.Group, { children: [
|
|
182
|
-
"noise:",
|
|
183
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
184
|
-
import_core.NumberInput,
|
|
185
|
-
{
|
|
186
|
-
size: "xs",
|
|
187
|
-
value: noise,
|
|
188
|
-
onChange: (e) => setNoise(Number(e)),
|
|
189
|
-
max,
|
|
190
|
-
min,
|
|
191
|
-
step: 0.1
|
|
192
|
-
}
|
|
193
|
-
)
|
|
194
|
-
] })
|
|
195
|
-
] }) });
|
|
196
|
-
}
|
|
197
|
-
var noise_const_node_default = NoiseConstNode;
|
|
198
|
-
|
|
199
|
-
// src/nodes/generators/noise-cylinders-node.tsx
|
|
200
|
-
var import_layout4 = require("@awesome-flow/core/layout");
|
|
201
|
-
var import_react4 = require("react");
|
|
202
|
-
var import_generator4 = require("libnoise-ts/module/generator");
|
|
203
|
-
var import_hooks4 = require("@awesome-flow/core/hooks");
|
|
204
|
-
var import_components2 = require("@awesome-flow/core/components");
|
|
205
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
206
|
-
function NoiseCylindersNode({ id, selected, data, type }) {
|
|
207
|
-
const updateComputedData = (0, import_hooks4.useUpdateNodeComputedData)();
|
|
208
|
-
const module2 = (0, import_react4.useMemo)(() => new import_generator4.Cylinders(), []);
|
|
209
|
-
const onPropertiesChange = (0, import_react4.useCallback)(
|
|
210
|
-
(properties) => {
|
|
211
|
-
Object.keys(properties).forEach((k) => {
|
|
212
|
-
module2[k] = properties[k].value;
|
|
213
|
-
});
|
|
214
|
-
updateComputedData(id, { module: module2 });
|
|
215
|
-
},
|
|
216
|
-
[id, module2, updateComputedData]
|
|
217
|
-
);
|
|
218
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_layout4.NodeContainer, { id, selected, data, type, children: [
|
|
219
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_components2.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
220
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_layout4.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
221
|
-
] });
|
|
222
|
-
}
|
|
223
|
-
var noise_cylinders_node_default = NoiseCylindersNode;
|
|
224
|
-
|
|
225
|
-
// src/nodes/generators/noise-perlin-node.tsx
|
|
226
|
-
var import_layout5 = require("@awesome-flow/core/layout");
|
|
227
|
-
var import_react5 = require("react");
|
|
228
|
-
var import_generator5 = require("libnoise-ts/module/generator");
|
|
229
|
-
var import_hooks5 = require("@awesome-flow/core/hooks");
|
|
230
|
-
var import_components3 = require("@awesome-flow/core/components");
|
|
231
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
232
|
-
function NoisePerlinNode({ id, selected, data, type }) {
|
|
233
|
-
const updateComputedData = (0, import_hooks5.useUpdateNodeComputedData)();
|
|
234
|
-
const module2 = (0, import_react5.useMemo)(() => new import_generator5.Perlin(), []);
|
|
235
|
-
const onPropertiesChange = (0, import_react5.useCallback)(
|
|
236
|
-
(properties) => {
|
|
237
|
-
Object.keys(properties).forEach((k) => {
|
|
238
|
-
module2[k] = properties[k].value;
|
|
239
|
-
});
|
|
240
|
-
updateComputedData(id, { module: module2 });
|
|
241
|
-
},
|
|
242
|
-
[id, module2, updateComputedData]
|
|
243
|
-
);
|
|
244
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_layout5.NodeContainer, { id, selected, data, type, children: [
|
|
245
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components3.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
246
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_layout5.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
247
|
-
] });
|
|
248
|
-
}
|
|
249
|
-
var noise_perlin_node_default = NoisePerlinNode;
|
|
250
|
-
|
|
251
|
-
// src/nodes/generators/noise-ridgedmulti-node.tsx
|
|
252
|
-
var import_layout6 = require("@awesome-flow/core/layout");
|
|
253
|
-
var import_react6 = require("react");
|
|
254
|
-
var import_generator6 = require("libnoise-ts/module/generator");
|
|
255
|
-
var import_hooks6 = require("@awesome-flow/core/hooks");
|
|
256
|
-
var import_components4 = require("@awesome-flow/core/components");
|
|
257
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
258
|
-
function NoiseRidgedMultiNode({ id, selected, data, type }) {
|
|
259
|
-
const updateComputedData = (0, import_hooks6.useUpdateNodeComputedData)();
|
|
260
|
-
const module2 = (0, import_react6.useMemo)(() => new import_generator6.RidgedMulti(), []);
|
|
261
|
-
const onPropertiesChange = (0, import_react6.useCallback)((properties) => {
|
|
262
|
-
Object.keys(properties).forEach((k) => module2[k] = properties[k].value);
|
|
263
|
-
updateComputedData(id, { module: module2 });
|
|
264
|
-
}, []);
|
|
265
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_layout6.NodeContainer, { id, selected, data, type, children: [
|
|
266
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_components4.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
267
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_layout6.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
268
|
-
] });
|
|
269
|
-
}
|
|
270
|
-
var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
|
|
271
|
-
|
|
272
|
-
// src/nodes/generators/noise-simplex-node.tsx
|
|
273
|
-
var import_layout7 = require("@awesome-flow/core/layout");
|
|
274
|
-
var import_react7 = require("react");
|
|
275
|
-
var import_hooks7 = require("@awesome-flow/core/hooks");
|
|
276
|
-
|
|
277
|
-
// src/modules/simplex-module.ts
|
|
278
|
-
var import_Module = __toESM(require("libnoise-ts/module/Module"), 1);
|
|
279
|
-
var import_simplex_noise = require("simplex-noise");
|
|
280
|
-
var SimplexModule = class extends import_Module.default {
|
|
281
|
-
noise;
|
|
282
|
-
constructor(random) {
|
|
283
|
-
super();
|
|
284
|
-
this.noise = (0, import_simplex_noise.createNoise3D)(random);
|
|
285
|
-
}
|
|
286
|
-
getValue(x, y, z) {
|
|
287
|
-
return this.noise(x, y, z);
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// src/nodes/generators/noise-simplex-node.tsx
|
|
292
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
293
|
-
function NoiseSimplexNode({ id, selected, data, type }) {
|
|
294
|
-
const updateComputedData = (0, import_hooks7.useUpdateNodeComputedData)();
|
|
295
|
-
const module2 = (0, import_react7.useMemo)(() => new SimplexModule(), []);
|
|
296
|
-
(0, import_react7.useEffect)(() => {
|
|
297
|
-
updateComputedData(id, { module: module2 });
|
|
298
|
-
}, []);
|
|
299
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_layout7.NodeContainer, { id, selected, data, type });
|
|
300
|
-
}
|
|
301
|
-
var noise_simplex_node_default = NoiseSimplexNode;
|
|
302
|
-
|
|
303
|
-
// src/nodes/generators/noise-spheres-node.tsx
|
|
304
|
-
var import_layout8 = require("@awesome-flow/core/layout");
|
|
305
|
-
var import_react8 = require("react");
|
|
306
|
-
var import_generator7 = require("libnoise-ts/module/generator");
|
|
307
|
-
var import_hooks8 = require("@awesome-flow/core/hooks");
|
|
308
|
-
var import_components5 = require("@awesome-flow/core/components");
|
|
309
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
310
|
-
function NoiseSpheresNode({ id, selected, data, type }) {
|
|
311
|
-
const updateComputedData = (0, import_hooks8.useUpdateNodeComputedData)();
|
|
312
|
-
const module2 = (0, import_react8.useMemo)(() => new import_generator7.Spheres(), []);
|
|
313
|
-
const onPropertiesChange = (0, import_react8.useCallback)((properties) => {
|
|
314
|
-
Object.keys(properties).forEach((k) => module2[k] = properties[k].value);
|
|
315
|
-
updateComputedData(id, { module: module2 });
|
|
316
|
-
}, []);
|
|
317
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_layout8.NodeContainer, { id, selected, data, type, children: [
|
|
318
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components5.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
319
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_layout8.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
320
|
-
] });
|
|
321
|
-
}
|
|
322
|
-
var noise_spheres_node_default = NoiseSpheresNode;
|
|
323
|
-
|
|
324
|
-
// src/nodes/generators/noise-voronoi-node.tsx
|
|
325
|
-
var import_layout9 = require("@awesome-flow/core/layout");
|
|
326
|
-
var import_react9 = require("react");
|
|
327
|
-
var import_generator8 = require("libnoise-ts/module/generator");
|
|
328
|
-
var import_hooks9 = require("@awesome-flow/core/hooks");
|
|
329
|
-
var import_components6 = require("@awesome-flow/core/components");
|
|
330
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
331
|
-
function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
332
|
-
const updateComputedData = (0, import_hooks9.useUpdateNodeComputedData)();
|
|
333
|
-
const onPropertiesChange = (0, import_react9.useCallback)(
|
|
334
|
-
(properties) => {
|
|
335
|
-
const module2 = new import_generator8.Voronoi(
|
|
336
|
-
properties.frequency.value,
|
|
337
|
-
properties.displacement.value,
|
|
338
|
-
properties.distance.value,
|
|
339
|
-
properties.seed.value
|
|
340
|
-
);
|
|
341
|
-
updateComputedData(id, { module: module2 });
|
|
342
|
-
},
|
|
343
|
-
[]
|
|
344
|
-
);
|
|
345
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_layout9.NodeContainer, { id, selected, data, type, children: [
|
|
346
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components6.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
347
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_layout9.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
348
|
-
] });
|
|
349
|
-
}
|
|
350
|
-
var noise_voronoi_node_default = NoiseVoronoiNode;
|
|
351
|
-
|
|
352
|
-
// src/nodes/generators/position-const-node.tsx
|
|
353
|
-
var import_layout10 = require("@awesome-flow/core/layout");
|
|
354
|
-
var import_react10 = require("react");
|
|
355
|
-
var import_core2 = require("@mantine/core");
|
|
356
|
-
var import_hooks10 = require("@awesome-flow/core/hooks");
|
|
357
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
358
|
-
function PositionConstNode({ id, selected, data, type }) {
|
|
359
|
-
const position = data.position ?? { x: 0, y: 0, z: 0 };
|
|
360
|
-
const [x, setX] = (0, import_react10.useState)(position.x);
|
|
361
|
-
const [y, setY] = (0, import_react10.useState)(position.y);
|
|
362
|
-
const [z, setZ] = (0, import_react10.useState)(position.z);
|
|
363
|
-
const updateNodeData = (0, import_hooks10.useUpdateNodeData)();
|
|
364
|
-
const updateComputedData = (0, import_hooks10.useUpdateNodeComputedData)();
|
|
365
|
-
(0, import_react10.useEffect)(() => {
|
|
366
|
-
const position2 = { x, y, z };
|
|
367
|
-
updateNodeData(id, {
|
|
368
|
-
position: position2
|
|
369
|
-
});
|
|
370
|
-
updateComputedData(id, {
|
|
371
|
-
positions: [position2]
|
|
372
|
-
});
|
|
373
|
-
}, [x, y, z]);
|
|
374
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_layout10.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core2.Stack, { children: [
|
|
375
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core2.Group, { children: [
|
|
376
|
-
"x: ",
|
|
377
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
378
|
-
] }),
|
|
379
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core2.Group, { children: [
|
|
380
|
-
"y: ",
|
|
381
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
382
|
-
] }),
|
|
383
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core2.Group, { children: [
|
|
384
|
-
"z: ",
|
|
385
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
386
|
-
] })
|
|
387
|
-
] }) });
|
|
388
|
-
}
|
|
389
|
-
var position_const_node_default = PositionConstNode;
|
|
390
|
-
|
|
391
|
-
// src/nodes/generators/position-grid-node.tsx
|
|
392
|
-
var import_layout11 = require("@awesome-flow/core/layout");
|
|
393
|
-
var import_react11 = require("react");
|
|
394
|
-
var import_core3 = require("@mantine/core");
|
|
395
|
-
var import_hooks11 = require("@awesome-flow/core/hooks");
|
|
396
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
397
|
-
function PositionGridNode({ id, selected, data, type }) {
|
|
398
|
-
const [x, setX] = (0, import_react11.useState)(data.center?.x);
|
|
399
|
-
const [y, setY] = (0, import_react11.useState)(data.center?.y);
|
|
400
|
-
const [z, setZ] = (0, import_react11.useState)(data.center?.z);
|
|
401
|
-
const [radius, setRadius] = (0, import_react11.useState)(data.radius);
|
|
402
|
-
const updateNodeData = (0, import_hooks11.useUpdateNodeData)();
|
|
403
|
-
const updateComputedData = (0, import_hooks11.useUpdateNodeComputedData)();
|
|
404
|
-
(0, import_react11.useEffect)(() => {
|
|
405
|
-
updateNodeData(id, {
|
|
406
|
-
center: { x, y, z }
|
|
407
|
-
});
|
|
408
|
-
}, [x, y, z]);
|
|
409
|
-
(0, import_react11.useEffect)(() => {
|
|
410
|
-
updateNodeData(id, {
|
|
411
|
-
radius
|
|
412
|
-
});
|
|
413
|
-
}, [radius]);
|
|
414
|
-
(0, import_react11.useEffect)(() => {
|
|
415
|
-
const positions = [];
|
|
416
|
-
for (let i = -radius; i < radius; i++) {
|
|
417
|
-
for (let j = -radius; j < radius; j++) {
|
|
418
|
-
positions.push({ x: x + i, y: y + j, z });
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
updateComputedData(id, {
|
|
422
|
-
positions
|
|
423
|
-
});
|
|
424
|
-
}, [x, y, z, radius]);
|
|
425
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_layout11.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core3.Stack, { children: [
|
|
426
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core3.Group, { children: [
|
|
427
|
-
"x: ",
|
|
428
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
429
|
-
] }),
|
|
430
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core3.Group, { children: [
|
|
431
|
-
"y: ",
|
|
432
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
433
|
-
] }),
|
|
434
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core3.Group, { children: [
|
|
435
|
-
"z: ",
|
|
436
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
437
|
-
] }),
|
|
438
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core3.Group, { children: [
|
|
439
|
-
"r: ",
|
|
440
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: radius, onChange: (e) => setRadius(Number(e)) })
|
|
441
|
-
] })
|
|
442
|
-
] }) });
|
|
443
|
-
}
|
|
444
|
-
var position_grid_node_default = PositionGridNode;
|
|
445
|
-
|
|
446
|
-
// src/nodes/groups/module-group-node.tsx
|
|
447
|
-
var import_layout12 = require("@awesome-flow/core/layout");
|
|
448
|
-
var import_react12 = require("@xyflow/react");
|
|
449
|
-
var import_react13 = require("react");
|
|
450
|
-
var import_shallow = require("zustand/shallow");
|
|
451
|
-
var import_core4 = require("@mantine/core");
|
|
452
|
-
var import_hooks12 = require("@awesome-flow/core/hooks");
|
|
453
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
454
|
-
function ModuleGroupNode({
|
|
455
|
-
id,
|
|
456
|
-
selected,
|
|
457
|
-
data,
|
|
458
|
-
type,
|
|
459
|
-
width,
|
|
460
|
-
height
|
|
461
|
-
}) {
|
|
462
|
-
const updateNodeInternals = (0, import_react12.useUpdateNodeInternals)();
|
|
463
|
-
const triggerNodeChanges = (0, import_react12.useStore)((s) => s.triggerNodeChanges);
|
|
464
|
-
const { groupNodes, setGroupCollapsed } = (0, import_hooks12.useFlowStore)(
|
|
465
|
-
(0, import_react13.useCallback)(
|
|
466
|
-
(state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
|
|
467
|
-
[]
|
|
468
|
-
)
|
|
469
|
-
);
|
|
470
|
-
const intersectingNode = (0, import_hooks12.useInteractiveStore)(
|
|
471
|
-
(0, import_react13.useCallback)((state) => state.nodeIntersectionTargets[id], [id]),
|
|
472
|
-
import_shallow.shallow
|
|
473
|
-
);
|
|
474
|
-
(0, import_react13.useEffect)(() => {
|
|
475
|
-
updateNodeInternals(id);
|
|
476
|
-
}, [width, height]);
|
|
477
|
-
(0, import_react13.useEffect)(() => {
|
|
478
|
-
triggerNodeChanges([
|
|
479
|
-
{
|
|
480
|
-
id,
|
|
481
|
-
type: "select",
|
|
482
|
-
selected: !!intersectingNode
|
|
483
|
-
}
|
|
484
|
-
]);
|
|
485
|
-
}, [intersectingNode]);
|
|
486
|
-
const onCollapsed = (0, import_react13.useCallback)((collapsed) => {
|
|
487
|
-
setGroupCollapsed(id, collapsed);
|
|
488
|
-
}, []);
|
|
489
|
-
const size = (0, import_react13.useMemo)(() => {
|
|
490
|
-
return {
|
|
491
|
-
width: data.initialSize?.width || 100,
|
|
492
|
-
height: data.initialSize?.height || 50
|
|
493
|
-
};
|
|
494
|
-
}, [data.initialSize]);
|
|
495
|
-
const incomingModules = (0, import_hooks12.useIncomingComputedData)(id);
|
|
496
|
-
const updateComputedData = (0, import_hooks12.useUpdateNodeComputedData)();
|
|
497
|
-
(0, import_react13.useEffect)(() => {
|
|
498
|
-
if (incomingModules?.length) {
|
|
499
|
-
const { module: module2 } = incomingModules[0];
|
|
500
|
-
updateComputedData(id, { module: module2 });
|
|
501
|
-
}
|
|
502
|
-
}, [incomingModules]);
|
|
503
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
504
|
-
import_layout12.NodeContainer,
|
|
505
|
-
{
|
|
506
|
-
id,
|
|
507
|
-
selected,
|
|
508
|
-
data,
|
|
509
|
-
title: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core4.Group, { justify: "space-between", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_core4.Group, { gap: "xs", children: [
|
|
510
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core4.Badge, { size: "xs", variant: "outline", radius: "xs", color: "gray", children: groupNodes?.length || 0 }),
|
|
511
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_layout12.NodeCollapse, { nodeId: id, isCollapsed: data.isCollapsed, onCollapsed })
|
|
512
|
-
] }) }),
|
|
513
|
-
type,
|
|
514
|
-
children: [
|
|
515
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
516
|
-
import_react12.NodeResizer,
|
|
517
|
-
{
|
|
518
|
-
nodeId: id,
|
|
519
|
-
minWidth: size.width,
|
|
520
|
-
minHeight: size.height,
|
|
521
|
-
isVisible: selected && !data.isCollapsed
|
|
522
|
-
}
|
|
523
|
-
),
|
|
524
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_layout12.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
525
|
-
]
|
|
526
|
-
}
|
|
527
|
-
);
|
|
528
|
-
}
|
|
529
|
-
var module_group_node_default = ModuleGroupNode;
|
|
530
|
-
|
|
531
|
-
// src/nodes/modifiers/noise-abs-node.tsx
|
|
532
|
-
var import_layout13 = require("@awesome-flow/core/layout");
|
|
533
|
-
var import_react14 = require("react");
|
|
534
|
-
var import_hooks13 = require("@awesome-flow/core/hooks");
|
|
535
|
-
var import_modifier = require("libnoise-ts/module/modifier");
|
|
536
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
537
|
-
function NoiseAbsNode({ id, selected, data, type }) {
|
|
538
|
-
const incoming = (0, import_hooks13.useIncomingComputedData)(id);
|
|
539
|
-
const updateComputedData = (0, import_hooks13.useUpdateNodeComputedData)();
|
|
540
|
-
(0, import_react14.useEffect)(() => {
|
|
541
|
-
if (incoming?.length > 0) {
|
|
542
|
-
const module2 = new import_modifier.Abs(incoming[0].module);
|
|
543
|
-
updateComputedData(id, { module: module2 });
|
|
544
|
-
}
|
|
545
|
-
}, [incoming]);
|
|
546
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_layout13.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_layout13.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" }) });
|
|
547
|
-
}
|
|
548
|
-
var noise_abs_node_default = NoiseAbsNode;
|
|
549
|
-
|
|
550
|
-
// src/nodes/modifiers/noise-clamp-node.tsx
|
|
551
|
-
var import_layout14 = require("@awesome-flow/core/layout");
|
|
552
|
-
var import_react15 = require("react");
|
|
553
|
-
var import_core5 = require("@mantine/core");
|
|
554
|
-
var import_hooks14 = require("@awesome-flow/core/hooks");
|
|
555
|
-
var import_modifier2 = require("libnoise-ts/module/modifier");
|
|
556
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
557
|
-
function NoiseClampNode({ id, selected, data, type }) {
|
|
558
|
-
const [lowerBound, setLowerBound] = (0, import_react15.useState)(data.lowerBound);
|
|
559
|
-
const [upperBound, setUpperBound] = (0, import_react15.useState)(data.upperBound);
|
|
560
|
-
const incoming = (0, import_hooks14.useIncomingComputedData)(id);
|
|
561
|
-
const updateNodeData = (0, import_hooks14.useUpdateNodeData)();
|
|
562
|
-
const updateComputedData = (0, import_hooks14.useUpdateNodeComputedData)();
|
|
563
|
-
(0, import_react15.useEffect)(() => {
|
|
564
|
-
if (incoming?.length) {
|
|
565
|
-
const module2 = new import_modifier2.Clamp(incoming[0].module, lowerBound, upperBound);
|
|
566
|
-
updateComputedData(id, { module: module2 });
|
|
567
|
-
}
|
|
568
|
-
updateNodeData(id, { lowerBound, upperBound });
|
|
569
|
-
}, [incoming, lowerBound, upperBound]);
|
|
570
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_layout14.NodeContainer, { id, selected, data, type, children: [
|
|
571
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core5.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core5.Group, { children: [
|
|
572
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
573
|
-
import_core5.NumberInput,
|
|
574
|
-
{
|
|
575
|
-
size: "xs",
|
|
576
|
-
w: 100,
|
|
577
|
-
value: lowerBound,
|
|
578
|
-
onChange: (e) => setLowerBound(Number(e)),
|
|
579
|
-
step: 0.1
|
|
580
|
-
}
|
|
581
|
-
),
|
|
582
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
583
|
-
import_core5.NumberInput,
|
|
584
|
-
{
|
|
585
|
-
size: "xs",
|
|
586
|
-
w: 100,
|
|
587
|
-
value: upperBound,
|
|
588
|
-
onChange: (e) => setUpperBound(Number(e)),
|
|
589
|
-
step: 0.1
|
|
590
|
-
}
|
|
591
|
-
)
|
|
592
|
-
] }) }),
|
|
593
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_layout14.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
594
|
-
] });
|
|
595
|
-
}
|
|
596
|
-
var noise_clamp_node_default = NoiseClampNode;
|
|
597
|
-
|
|
598
|
-
// src/nodes/modifiers/noise-combine-node.tsx
|
|
599
|
-
var import_layout15 = require("@awesome-flow/core/layout");
|
|
600
|
-
var import_react16 = require("react");
|
|
601
|
-
var import_hooks15 = require("@awesome-flow/core/hooks");
|
|
602
|
-
var import_icons_react = require("@tabler/icons-react");
|
|
603
|
-
|
|
604
|
-
// src/abstract/operations.ts
|
|
605
|
-
var import_combiner = require("libnoise-ts/module/combiner");
|
|
606
|
-
var noiseCombineModuleMap = {
|
|
607
|
-
["add" /* add */]: import_combiner.Add,
|
|
608
|
-
["max" /* max */]: import_combiner.Max,
|
|
609
|
-
["min" /* min */]: import_combiner.Min,
|
|
610
|
-
["multiply" /* multiply */]: import_combiner.Multiply,
|
|
611
|
-
["power" /* power */]: import_combiner.Power
|
|
612
|
-
};
|
|
613
|
-
|
|
614
|
-
// src/nodes/modifiers/noise-combine-node.tsx
|
|
615
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
616
|
-
var options = {
|
|
617
|
-
add: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconPlus, {}),
|
|
618
|
-
min: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronLeft, {}),
|
|
619
|
-
max: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronRight, {}),
|
|
620
|
-
multiply: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconAsterisk, {}),
|
|
621
|
-
power: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronUp, {})
|
|
622
|
-
};
|
|
623
|
-
function NoiseCombineNode({ id, selected, data, type }) {
|
|
624
|
-
const updateNodeData = (0, import_hooks15.useUpdateNodeData)();
|
|
625
|
-
const updateComputedData = (0, import_hooks15.useUpdateNodeComputedData)();
|
|
626
|
-
const incoming = (0, import_hooks15.useIncomingComputedData)(id);
|
|
627
|
-
(0, import_react16.useEffect)(() => {
|
|
628
|
-
const ModuleFactory = noiseCombineModuleMap[data.operation];
|
|
629
|
-
if (incoming?.length > 1) {
|
|
630
|
-
const module2 = new ModuleFactory(incoming[0].module, incoming[1].module);
|
|
631
|
-
updateComputedData(id, { module: module2 });
|
|
632
|
-
}
|
|
633
|
-
}, [data.operation, incoming]);
|
|
634
|
-
const onChange = (0, import_react16.useCallback)((operation) => {
|
|
635
|
-
updateNodeData(id, { operation });
|
|
636
|
-
}, []);
|
|
637
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_layout15.NodeContainer, { id, selected, data, type, children: [
|
|
638
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_layout15.NodeCombobox, { options, selected: data.operation, onChange, width: 150 }),
|
|
639
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_layout15.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
640
|
-
] });
|
|
641
|
-
}
|
|
642
|
-
var noise_combine_node_default = NoiseCombineNode;
|
|
643
|
-
|
|
644
|
-
// src/nodes/modifiers/noise-curve-node.tsx
|
|
645
|
-
var import_layout16 = require("@awesome-flow/core/layout");
|
|
646
|
-
var import_core6 = require("@mantine/core");
|
|
647
|
-
var import_hooks16 = require("@awesome-flow/core/hooks");
|
|
648
|
-
|
|
649
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
650
|
-
var import_react23 = require("react");
|
|
651
|
-
|
|
652
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/actions/actions.mjs
|
|
653
|
-
var import_react17 = require("react");
|
|
654
|
-
function validateFormName(name) {
|
|
655
|
-
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
656
|
-
throw new Error(
|
|
657
|
-
`[@mantine/use-form] Form name "${name}" is invalid, it should contain only letters, numbers and dashes`
|
|
658
|
-
);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
var useIsomorphicEffect = typeof window !== "undefined" ? import_react17.useLayoutEffect : import_react17.useEffect;
|
|
662
|
-
function useFormEvent(eventKey, handler) {
|
|
663
|
-
useIsomorphicEffect(() => {
|
|
664
|
-
if (eventKey) {
|
|
665
|
-
window.addEventListener(eventKey, handler);
|
|
666
|
-
return () => window.removeEventListener(eventKey, handler);
|
|
667
|
-
}
|
|
668
|
-
return void 0;
|
|
669
|
-
}, [eventKey]);
|
|
670
|
-
}
|
|
671
|
-
function useFormActions(name, form) {
|
|
672
|
-
if (name) {
|
|
673
|
-
validateFormName(name);
|
|
674
|
-
}
|
|
675
|
-
useFormEvent(
|
|
676
|
-
`mantine-form:${name}:set-field-value`,
|
|
677
|
-
(event) => form.setFieldValue(event.detail.path, event.detail.value)
|
|
678
|
-
);
|
|
679
|
-
useFormEvent(
|
|
680
|
-
`mantine-form:${name}:set-values`,
|
|
681
|
-
(event) => form.setValues(event.detail)
|
|
682
|
-
);
|
|
683
|
-
useFormEvent(
|
|
684
|
-
`mantine-form:${name}:set-initial-values`,
|
|
685
|
-
(event) => form.setInitialValues(event.detail)
|
|
686
|
-
);
|
|
687
|
-
useFormEvent(
|
|
688
|
-
`mantine-form:${name}:set-errors`,
|
|
689
|
-
(event) => form.setErrors(event.detail)
|
|
690
|
-
);
|
|
691
|
-
useFormEvent(
|
|
692
|
-
`mantine-form:${name}:set-field-error`,
|
|
693
|
-
(event) => form.setFieldError(event.detail.path, event.detail.error)
|
|
694
|
-
);
|
|
695
|
-
useFormEvent(
|
|
696
|
-
`mantine-form:${name}:clear-field-error`,
|
|
697
|
-
(event) => form.clearFieldError(event.detail)
|
|
698
|
-
);
|
|
699
|
-
useFormEvent(`mantine-form:${name}:clear-errors`, form.clearErrors);
|
|
700
|
-
useFormEvent(`mantine-form:${name}:reset`, form.reset);
|
|
701
|
-
useFormEvent(`mantine-form:${name}:validate`, form.validate);
|
|
702
|
-
useFormEvent(
|
|
703
|
-
`mantine-form:${name}:validate-field`,
|
|
704
|
-
(event) => form.validateField(event.detail)
|
|
705
|
-
);
|
|
706
|
-
useFormEvent(
|
|
707
|
-
`mantine-form:${name}:reorder-list-item`,
|
|
708
|
-
(event) => form.reorderListItem(event.detail.path, event.detail.payload)
|
|
709
|
-
);
|
|
710
|
-
useFormEvent(
|
|
711
|
-
`mantine-form:${name}:remove-list-item`,
|
|
712
|
-
(event) => form.removeListItem(event.detail.path, event.detail.index)
|
|
713
|
-
);
|
|
714
|
-
useFormEvent(
|
|
715
|
-
`mantine-form:${name}:insert-list-item`,
|
|
716
|
-
(event) => form.insertListItem(event.detail.path, event.detail.item, event.detail.index)
|
|
717
|
-
);
|
|
718
|
-
useFormEvent(
|
|
719
|
-
`mantine-form:${name}:set-dirty`,
|
|
720
|
-
(event) => form.setDirty(event.detail)
|
|
721
|
-
);
|
|
722
|
-
useFormEvent(
|
|
723
|
-
`mantine-form:${name}:set-touched`,
|
|
724
|
-
(event) => form.setTouched(event.detail)
|
|
725
|
-
);
|
|
726
|
-
useFormEvent(
|
|
727
|
-
`mantine-form:${name}:reset-dirty`,
|
|
728
|
-
(event) => form.resetDirty(event.detail)
|
|
729
|
-
);
|
|
730
|
-
useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
// ../../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
|
|
734
|
-
function getInputOnChange(setValue) {
|
|
735
|
-
return (val) => {
|
|
736
|
-
if (!val) {
|
|
737
|
-
setValue(val);
|
|
738
|
-
} else if (typeof val === "function") {
|
|
739
|
-
setValue(val);
|
|
740
|
-
} else if (typeof val === "object" && "nativeEvent" in val) {
|
|
741
|
-
const { currentTarget } = val;
|
|
742
|
-
if (currentTarget instanceof HTMLInputElement) {
|
|
743
|
-
if (currentTarget.type === "checkbox") {
|
|
744
|
-
setValue(currentTarget.checked);
|
|
745
|
-
} else {
|
|
746
|
-
setValue(currentTarget.value);
|
|
747
|
-
}
|
|
748
|
-
} else if (currentTarget instanceof HTMLTextAreaElement || currentTarget instanceof HTMLSelectElement) {
|
|
749
|
-
setValue(currentTarget.value);
|
|
750
|
-
}
|
|
751
|
-
} else {
|
|
752
|
-
setValue(val);
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
758
|
-
var import_react18 = require("react");
|
|
759
|
-
|
|
760
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
761
|
-
function filterErrors(errors) {
|
|
762
|
-
if (errors === null || typeof errors !== "object") {
|
|
763
|
-
return {};
|
|
764
|
-
}
|
|
765
|
-
return Object.keys(errors).reduce((acc, key) => {
|
|
766
|
-
const errorValue = errors[key];
|
|
767
|
-
if (errorValue !== void 0 && errorValue !== null && errorValue !== false) {
|
|
768
|
-
acc[key] = errorValue;
|
|
769
|
-
}
|
|
770
|
-
return acc;
|
|
771
|
-
}, {});
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
775
|
-
function useFormErrors(initialErrors) {
|
|
776
|
-
const [errorsState, setErrorsState] = (0, import_react18.useState)(filterErrors(initialErrors));
|
|
777
|
-
const errorsRef = (0, import_react18.useRef)(errorsState);
|
|
778
|
-
const setErrors = (0, import_react18.useCallback)((errors) => {
|
|
779
|
-
setErrorsState((current) => {
|
|
780
|
-
const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
|
|
781
|
-
errorsRef.current = newErrors;
|
|
782
|
-
return newErrors;
|
|
783
|
-
});
|
|
784
|
-
}, []);
|
|
785
|
-
const clearErrors = (0, import_react18.useCallback)(() => setErrors({}), []);
|
|
786
|
-
const clearFieldError = (0, import_react18.useCallback)(
|
|
787
|
-
(path) => {
|
|
788
|
-
if (errorsRef.current[path] === void 0) {
|
|
789
|
-
return;
|
|
790
|
-
}
|
|
791
|
-
setErrors((current) => {
|
|
792
|
-
const errors = { ...current };
|
|
793
|
-
delete errors[path];
|
|
794
|
-
return errors;
|
|
795
|
-
});
|
|
796
|
-
},
|
|
797
|
-
[errorsState]
|
|
798
|
-
);
|
|
799
|
-
const setFieldError = (0, import_react18.useCallback)(
|
|
800
|
-
(path, error) => {
|
|
801
|
-
if (error == null || error === false) {
|
|
802
|
-
clearFieldError(path);
|
|
803
|
-
} else if (errorsRef.current[path] !== error) {
|
|
804
|
-
setErrors((current) => ({ ...current, [path]: error }));
|
|
805
|
-
}
|
|
806
|
-
},
|
|
807
|
-
[errorsState]
|
|
808
|
-
);
|
|
809
|
-
return {
|
|
810
|
-
errorsState,
|
|
811
|
-
setErrors,
|
|
812
|
-
clearErrors,
|
|
813
|
-
setFieldError,
|
|
814
|
-
clearFieldError
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
819
|
-
var import_react19 = require("react");
|
|
820
|
-
|
|
821
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
822
|
-
function clearListState(field, state) {
|
|
823
|
-
if (state === null || typeof state !== "object") {
|
|
824
|
-
return {};
|
|
825
|
-
}
|
|
826
|
-
const clone = { ...state };
|
|
827
|
-
Object.keys(state).forEach((errorKey) => {
|
|
828
|
-
if (errorKey.includes(`${String(field)}.`)) {
|
|
829
|
-
delete clone[errorKey];
|
|
830
|
-
}
|
|
831
|
-
});
|
|
832
|
-
return clone;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
836
|
-
function getIndexFromKeyAfterPath(key, path) {
|
|
837
|
-
const split = key.substring(path.length + 1).split(".")[0];
|
|
838
|
-
return parseInt(split, 10);
|
|
839
|
-
}
|
|
840
|
-
function changeErrorIndices(path, index, errors, change) {
|
|
841
|
-
if (index === void 0) {
|
|
842
|
-
return errors;
|
|
843
|
-
}
|
|
844
|
-
const pathString = `${String(path)}`;
|
|
845
|
-
let clearedErrors = errors;
|
|
846
|
-
if (change === -1) {
|
|
847
|
-
clearedErrors = clearListState(`${pathString}.${index}`, clearedErrors);
|
|
848
|
-
}
|
|
849
|
-
const cloned = { ...clearedErrors };
|
|
850
|
-
const changedKeys = /* @__PURE__ */ new Set();
|
|
851
|
-
Object.entries(clearedErrors).filter(([key]) => {
|
|
852
|
-
if (!key.startsWith(`${pathString}.`)) {
|
|
853
|
-
return false;
|
|
854
|
-
}
|
|
855
|
-
const currIndex = getIndexFromKeyAfterPath(key, pathString);
|
|
856
|
-
if (Number.isNaN(currIndex)) {
|
|
857
|
-
return false;
|
|
858
|
-
}
|
|
859
|
-
return currIndex >= index;
|
|
860
|
-
}).forEach(([key, value]) => {
|
|
861
|
-
const currIndex = getIndexFromKeyAfterPath(key, pathString);
|
|
862
|
-
const newKey = key.replace(
|
|
863
|
-
`${pathString}.${currIndex}`,
|
|
864
|
-
`${pathString}.${currIndex + change}`
|
|
865
|
-
);
|
|
866
|
-
cloned[newKey] = value;
|
|
867
|
-
changedKeys.add(newKey);
|
|
868
|
-
if (!changedKeys.has(key)) {
|
|
869
|
-
delete cloned[key];
|
|
870
|
-
}
|
|
871
|
-
});
|
|
872
|
-
return cloned;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
876
|
-
function reorderErrors(path, { from, to }, errors) {
|
|
877
|
-
const oldKeyStart = `${path}.${from}`;
|
|
878
|
-
const newKeyStart = `${path}.${to}`;
|
|
879
|
-
const clone = { ...errors };
|
|
880
|
-
Object.keys(errors).every((key) => {
|
|
881
|
-
let oldKey;
|
|
882
|
-
let newKey;
|
|
883
|
-
if (key.startsWith(oldKeyStart)) {
|
|
884
|
-
oldKey = key;
|
|
885
|
-
newKey = key.replace(oldKeyStart, newKeyStart);
|
|
886
|
-
}
|
|
887
|
-
if (key.startsWith(newKeyStart)) {
|
|
888
|
-
oldKey = key.replace(newKeyStart, oldKeyStart);
|
|
889
|
-
newKey = key;
|
|
890
|
-
}
|
|
891
|
-
if (oldKey && newKey) {
|
|
892
|
-
const value1 = clone[oldKey];
|
|
893
|
-
const value2 = clone[newKey];
|
|
894
|
-
value2 === void 0 ? delete clone[oldKey] : clone[oldKey] = value2;
|
|
895
|
-
value1 === void 0 ? delete clone[newKey] : clone[newKey] = value1;
|
|
896
|
-
return false;
|
|
897
|
-
}
|
|
898
|
-
return true;
|
|
899
|
-
});
|
|
900
|
-
return clone;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
|
|
904
|
-
function set(obj, key, val) {
|
|
905
|
-
if (typeof val.value === "object")
|
|
906
|
-
val.value = klona(val.value);
|
|
907
|
-
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === "__proto__") {
|
|
908
|
-
Object.defineProperty(obj, key, val);
|
|
909
|
-
} else
|
|
910
|
-
obj[key] = val.value;
|
|
911
|
-
}
|
|
912
|
-
function klona(x) {
|
|
913
|
-
if (typeof x !== "object")
|
|
914
|
-
return x;
|
|
915
|
-
var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);
|
|
916
|
-
if (str === "[object Object]") {
|
|
917
|
-
tmp = Object.create(x.__proto__ || null);
|
|
918
|
-
} else if (str === "[object Array]") {
|
|
919
|
-
tmp = Array(x.length);
|
|
920
|
-
} else if (str === "[object Set]") {
|
|
921
|
-
tmp = /* @__PURE__ */ new Set();
|
|
922
|
-
x.forEach(function(val) {
|
|
923
|
-
tmp.add(klona(val));
|
|
924
|
-
});
|
|
925
|
-
} else if (str === "[object Map]") {
|
|
926
|
-
tmp = /* @__PURE__ */ new Map();
|
|
927
|
-
x.forEach(function(val, key) {
|
|
928
|
-
tmp.set(klona(key), klona(val));
|
|
929
|
-
});
|
|
930
|
-
} else if (str === "[object Date]") {
|
|
931
|
-
tmp = /* @__PURE__ */ new Date(+x);
|
|
932
|
-
} else if (str === "[object RegExp]") {
|
|
933
|
-
tmp = new RegExp(x.source, x.flags);
|
|
934
|
-
} else if (str === "[object DataView]") {
|
|
935
|
-
tmp = new x.constructor(klona(x.buffer));
|
|
936
|
-
} else if (str === "[object ArrayBuffer]") {
|
|
937
|
-
tmp = x.slice(0);
|
|
938
|
-
} else if (str.slice(-6) === "Array]") {
|
|
939
|
-
tmp = new x.constructor(x);
|
|
940
|
-
}
|
|
941
|
-
if (tmp) {
|
|
942
|
-
for (list = Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
|
943
|
-
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
944
|
-
}
|
|
945
|
-
for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
946
|
-
if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k])
|
|
947
|
-
continue;
|
|
948
|
-
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
return tmp || x;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
955
|
-
function getSplittedPath(path) {
|
|
956
|
-
if (typeof path !== "string") {
|
|
957
|
-
return [];
|
|
958
|
-
}
|
|
959
|
-
return path.split(".");
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
963
|
-
function getPath(path, values) {
|
|
964
|
-
const splittedPath = getSplittedPath(path);
|
|
965
|
-
if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
|
|
966
|
-
return void 0;
|
|
967
|
-
}
|
|
968
|
-
let value = values[splittedPath[0]];
|
|
969
|
-
for (let i = 1; i < splittedPath.length; i += 1) {
|
|
970
|
-
if (value === void 0) {
|
|
971
|
-
break;
|
|
972
|
-
}
|
|
973
|
-
value = value[splittedPath[i]];
|
|
974
|
-
}
|
|
975
|
-
return value;
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
979
|
-
function setPath(path, value, values) {
|
|
980
|
-
const splittedPath = getSplittedPath(path);
|
|
981
|
-
if (splittedPath.length === 0) {
|
|
982
|
-
return values;
|
|
983
|
-
}
|
|
984
|
-
const cloned = klona(values);
|
|
985
|
-
if (splittedPath.length === 1) {
|
|
986
|
-
cloned[splittedPath[0]] = value;
|
|
987
|
-
return cloned;
|
|
988
|
-
}
|
|
989
|
-
let val = cloned[splittedPath[0]];
|
|
990
|
-
for (let i = 1; i < splittedPath.length - 1; i += 1) {
|
|
991
|
-
if (val === void 0) {
|
|
992
|
-
return cloned;
|
|
993
|
-
}
|
|
994
|
-
val = val[splittedPath[i]];
|
|
995
|
-
}
|
|
996
|
-
val[splittedPath[splittedPath.length - 1]] = value;
|
|
997
|
-
return cloned;
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
1001
|
-
function reorderPath(path, { from, to }, values) {
|
|
1002
|
-
const currentValue = getPath(path, values);
|
|
1003
|
-
if (!Array.isArray(currentValue)) {
|
|
1004
|
-
return values;
|
|
1005
|
-
}
|
|
1006
|
-
const cloned = [...currentValue];
|
|
1007
|
-
const item = currentValue[from];
|
|
1008
|
-
cloned.splice(from, 1);
|
|
1009
|
-
cloned.splice(to, 0, item);
|
|
1010
|
-
return setPath(path, cloned, values);
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
1014
|
-
function insertPath(path, value, index, values) {
|
|
1015
|
-
const currentValue = getPath(path, values);
|
|
1016
|
-
if (!Array.isArray(currentValue)) {
|
|
1017
|
-
return values;
|
|
1018
|
-
}
|
|
1019
|
-
const cloned = [...currentValue];
|
|
1020
|
-
cloned.splice(typeof index === "number" ? index : cloned.length, 0, value);
|
|
1021
|
-
return setPath(path, cloned, values);
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
1025
|
-
function removePath(path, index, values) {
|
|
1026
|
-
const currentValue = getPath(path, values);
|
|
1027
|
-
if (!Array.isArray(currentValue)) {
|
|
1028
|
-
return values;
|
|
1029
|
-
}
|
|
1030
|
-
return setPath(
|
|
1031
|
-
path,
|
|
1032
|
-
currentValue.filter((_, itemIndex) => itemIndex !== index),
|
|
1033
|
-
values
|
|
1034
|
-
);
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
// ../../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
|
|
1038
|
-
function useFormList({
|
|
1039
|
-
$values,
|
|
1040
|
-
$errors,
|
|
1041
|
-
$status
|
|
1042
|
-
}) {
|
|
1043
|
-
const reorderListItem = (0, import_react19.useCallback)((path, payload) => {
|
|
1044
|
-
$status.clearFieldDirty(path);
|
|
1045
|
-
$errors.setErrors((errs) => reorderErrors(path, payload, errs));
|
|
1046
|
-
$values.setValues({
|
|
1047
|
-
values: reorderPath(path, payload, $values.refValues.current),
|
|
1048
|
-
updateState: true
|
|
1049
|
-
});
|
|
1050
|
-
}, []);
|
|
1051
|
-
const removeListItem = (0, import_react19.useCallback)((path, index) => {
|
|
1052
|
-
$status.clearFieldDirty(path);
|
|
1053
|
-
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));
|
|
1054
|
-
$values.setValues({
|
|
1055
|
-
values: removePath(path, index, $values.refValues.current),
|
|
1056
|
-
updateState: true
|
|
1057
|
-
});
|
|
1058
|
-
}, []);
|
|
1059
|
-
const insertListItem = (0, import_react19.useCallback)((path, item, index) => {
|
|
1060
|
-
$status.clearFieldDirty(path);
|
|
1061
|
-
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));
|
|
1062
|
-
$values.setValues({
|
|
1063
|
-
values: insertPath(path, item, index, $values.refValues.current),
|
|
1064
|
-
updateState: true
|
|
1065
|
-
});
|
|
1066
|
-
}, []);
|
|
1067
|
-
return { reorderListItem, removeListItem, insertListItem };
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1071
|
-
var import_react20 = require("react");
|
|
1072
|
-
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
1073
|
-
|
|
1074
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
1075
|
-
function getStatus(status, path) {
|
|
1076
|
-
const paths = Object.keys(status);
|
|
1077
|
-
if (typeof path === "string") {
|
|
1078
|
-
const nestedPaths = paths.filter((statusPath) => statusPath.startsWith(`${path}.`));
|
|
1079
|
-
return status[path] || nestedPaths.some((statusPath) => status[statusPath]) || false;
|
|
1080
|
-
}
|
|
1081
|
-
return paths.some((statusPath) => status[statusPath]);
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
// ../../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
|
|
1085
|
-
function useFormStatus({
|
|
1086
|
-
initialDirty,
|
|
1087
|
-
initialTouched,
|
|
1088
|
-
mode,
|
|
1089
|
-
$values
|
|
1090
|
-
}) {
|
|
1091
|
-
const [touchedState, setTouchedState] = (0, import_react20.useState)(initialTouched);
|
|
1092
|
-
const [dirtyState, setDirtyState] = (0, import_react20.useState)(initialDirty);
|
|
1093
|
-
const touchedRef = (0, import_react20.useRef)(initialTouched);
|
|
1094
|
-
const dirtyRef = (0, import_react20.useRef)(initialDirty);
|
|
1095
|
-
const setTouched = (0, import_react20.useCallback)((values) => {
|
|
1096
|
-
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
1097
|
-
touchedRef.current = resolvedValues;
|
|
1098
|
-
if (mode === "controlled") {
|
|
1099
|
-
setTouchedState(resolvedValues);
|
|
1100
|
-
}
|
|
1101
|
-
}, []);
|
|
1102
|
-
const setDirty = (0, import_react20.useCallback)((values) => {
|
|
1103
|
-
const resolvedValues = typeof values === "function" ? values(dirtyRef.current) : values;
|
|
1104
|
-
dirtyRef.current = resolvedValues;
|
|
1105
|
-
if (mode === "controlled") {
|
|
1106
|
-
setDirtyState(resolvedValues);
|
|
1107
|
-
}
|
|
1108
|
-
}, []);
|
|
1109
|
-
const resetTouched = (0, import_react20.useCallback)(() => setTouched({}), []);
|
|
1110
|
-
const resetDirty = (values) => {
|
|
1111
|
-
const newSnapshot = values ? { ...values, ...$values.refValues.current } : $values.refValues.current;
|
|
1112
|
-
$values.setValuesSnapshot(newSnapshot);
|
|
1113
|
-
setDirty({});
|
|
1114
|
-
};
|
|
1115
|
-
const setFieldTouched = (0, import_react20.useCallback)((path, touched) => {
|
|
1116
|
-
setTouched((currentTouched) => {
|
|
1117
|
-
if (getStatus(currentTouched, path) === touched) {
|
|
1118
|
-
return currentTouched;
|
|
1119
|
-
}
|
|
1120
|
-
return { ...currentTouched, [path]: touched };
|
|
1121
|
-
});
|
|
1122
|
-
}, []);
|
|
1123
|
-
const setFieldDirty = (0, import_react20.useCallback)((path, dirty) => {
|
|
1124
|
-
setDirty((currentDirty) => {
|
|
1125
|
-
if (getStatus(currentDirty, path) === dirty) {
|
|
1126
|
-
return currentDirty;
|
|
1127
|
-
}
|
|
1128
|
-
return { ...currentDirty, [path]: dirty };
|
|
1129
|
-
});
|
|
1130
|
-
}, []);
|
|
1131
|
-
const isTouched = (0, import_react20.useCallback)(
|
|
1132
|
-
(path) => getStatus(touchedRef.current, path),
|
|
1133
|
-
[]
|
|
1134
|
-
);
|
|
1135
|
-
const clearFieldDirty = (0, import_react20.useCallback)(
|
|
1136
|
-
(path) => setDirty((current) => {
|
|
1137
|
-
if (typeof path !== "string") {
|
|
1138
|
-
return current;
|
|
1139
|
-
}
|
|
1140
|
-
const result = clearListState(path, current);
|
|
1141
|
-
delete result[path];
|
|
1142
|
-
if ((0, import_fast_deep_equal.default)(result, current)) {
|
|
1143
|
-
return current;
|
|
1144
|
-
}
|
|
1145
|
-
return result;
|
|
1146
|
-
}),
|
|
1147
|
-
[]
|
|
1148
|
-
);
|
|
1149
|
-
const isDirty = (0, import_react20.useCallback)((path) => {
|
|
1150
|
-
if (path) {
|
|
1151
|
-
const overriddenValue = getPath(path, dirtyRef.current);
|
|
1152
|
-
if (typeof overriddenValue === "boolean") {
|
|
1153
|
-
return overriddenValue;
|
|
1154
|
-
}
|
|
1155
|
-
const sliceOfValues = getPath(path, $values.refValues.current);
|
|
1156
|
-
const sliceOfInitialValues = getPath(path, $values.valuesSnapshot.current);
|
|
1157
|
-
return !(0, import_fast_deep_equal.default)(sliceOfValues, sliceOfInitialValues);
|
|
1158
|
-
}
|
|
1159
|
-
const isOverridden = Object.keys(dirtyRef.current).length > 0;
|
|
1160
|
-
if (isOverridden) {
|
|
1161
|
-
return getStatus(dirtyRef.current);
|
|
1162
|
-
}
|
|
1163
|
-
return !(0, import_fast_deep_equal.default)($values.refValues.current, $values.valuesSnapshot.current);
|
|
1164
|
-
}, []);
|
|
1165
|
-
const getDirty = (0, import_react20.useCallback)(() => dirtyRef.current, []);
|
|
1166
|
-
const getTouched = (0, import_react20.useCallback)(() => touchedRef.current, []);
|
|
1167
|
-
return {
|
|
1168
|
-
touchedState,
|
|
1169
|
-
dirtyState,
|
|
1170
|
-
touchedRef,
|
|
1171
|
-
dirtyRef,
|
|
1172
|
-
setTouched,
|
|
1173
|
-
setDirty,
|
|
1174
|
-
resetDirty,
|
|
1175
|
-
resetTouched,
|
|
1176
|
-
isTouched,
|
|
1177
|
-
setFieldTouched,
|
|
1178
|
-
setFieldDirty,
|
|
1179
|
-
setTouchedState,
|
|
1180
|
-
setDirtyState,
|
|
1181
|
-
clearFieldDirty,
|
|
1182
|
-
isDirty,
|
|
1183
|
-
getDirty,
|
|
1184
|
-
getTouched
|
|
1185
|
-
};
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1189
|
-
var import_react21 = require("react");
|
|
1190
|
-
function useFormValues({
|
|
1191
|
-
initialValues,
|
|
1192
|
-
onValuesChange,
|
|
1193
|
-
mode
|
|
1194
|
-
}) {
|
|
1195
|
-
const initialized = (0, import_react21.useRef)(false);
|
|
1196
|
-
const [stateValues, setStateValues] = (0, import_react21.useState)(initialValues || {});
|
|
1197
|
-
const refValues = (0, import_react21.useRef)(stateValues);
|
|
1198
|
-
const valuesSnapshot = (0, import_react21.useRef)(stateValues);
|
|
1199
|
-
const setValues = (0, import_react21.useCallback)(
|
|
1200
|
-
({
|
|
1201
|
-
values,
|
|
1202
|
-
subscribers,
|
|
1203
|
-
updateState = true,
|
|
1204
|
-
mergeWithPreviousValues = true
|
|
1205
|
-
}) => {
|
|
1206
|
-
const previousValues = refValues.current;
|
|
1207
|
-
const resolvedValues = values instanceof Function ? values(refValues.current) : values;
|
|
1208
|
-
const updatedValues = mergeWithPreviousValues ? { ...previousValues, ...resolvedValues } : resolvedValues;
|
|
1209
|
-
refValues.current = updatedValues;
|
|
1210
|
-
updateState && setStateValues(updatedValues);
|
|
1211
|
-
onValuesChange?.(updatedValues, previousValues);
|
|
1212
|
-
subscribers?.filter(Boolean).forEach((subscriber) => subscriber({ updatedValues, previousValues }));
|
|
1213
|
-
},
|
|
1214
|
-
[onValuesChange]
|
|
1215
|
-
);
|
|
1216
|
-
const setFieldValue = (0, import_react21.useCallback)((payload) => {
|
|
1217
|
-
const currentValue = getPath(payload.path, refValues.current);
|
|
1218
|
-
const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;
|
|
1219
|
-
if (currentValue !== updatedValue) {
|
|
1220
|
-
const previousValues = refValues.current;
|
|
1221
|
-
const updatedValues = setPath(payload.path, updatedValue, refValues.current);
|
|
1222
|
-
setValues({ values: updatedValues, updateState: payload.updateState });
|
|
1223
|
-
payload.subscribers?.filter(Boolean).forEach(
|
|
1224
|
-
(subscriber) => subscriber({ path: payload.path, updatedValues, previousValues })
|
|
1225
|
-
);
|
|
1226
|
-
}
|
|
1227
|
-
}, []);
|
|
1228
|
-
const setValuesSnapshot = (0, import_react21.useCallback)((payload) => {
|
|
1229
|
-
valuesSnapshot.current = payload;
|
|
1230
|
-
}, []);
|
|
1231
|
-
const initialize = (0, import_react21.useCallback)((values, onInitialize) => {
|
|
1232
|
-
if (!initialized.current) {
|
|
1233
|
-
initialized.current = true;
|
|
1234
|
-
setValues({ values, updateState: mode === "controlled" });
|
|
1235
|
-
setValuesSnapshot(values);
|
|
1236
|
-
onInitialize();
|
|
1237
|
-
}
|
|
1238
|
-
}, []);
|
|
1239
|
-
const resetValues = (0, import_react21.useCallback)(() => {
|
|
1240
|
-
setValues({
|
|
1241
|
-
values: valuesSnapshot.current,
|
|
1242
|
-
updateState: true,
|
|
1243
|
-
mergeWithPreviousValues: false
|
|
1244
|
-
});
|
|
1245
|
-
}, []);
|
|
1246
|
-
const getValues = (0, import_react21.useCallback)(() => refValues.current, []);
|
|
1247
|
-
return {
|
|
1248
|
-
initialized,
|
|
1249
|
-
stateValues,
|
|
1250
|
-
refValues,
|
|
1251
|
-
valuesSnapshot,
|
|
1252
|
-
setValues,
|
|
1253
|
-
setFieldValue,
|
|
1254
|
-
resetValues,
|
|
1255
|
-
setValuesSnapshot,
|
|
1256
|
-
initialize,
|
|
1257
|
-
getValues
|
|
1258
|
-
};
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1262
|
-
var import_react22 = require("react");
|
|
1263
|
-
function useFormWatch({
|
|
1264
|
-
$status
|
|
1265
|
-
}) {
|
|
1266
|
-
const subscribers = (0, import_react22.useRef)(
|
|
1267
|
-
{}
|
|
1268
|
-
);
|
|
1269
|
-
const watch = (0, import_react22.useCallback)((path, callback) => {
|
|
1270
|
-
(0, import_react22.useEffect)(() => {
|
|
1271
|
-
subscribers.current[path] = subscribers.current[path] || [];
|
|
1272
|
-
subscribers.current[path].push(callback);
|
|
1273
|
-
return () => {
|
|
1274
|
-
subscribers.current[path] = subscribers.current[path].filter((cb) => cb !== callback);
|
|
1275
|
-
};
|
|
1276
|
-
}, [callback]);
|
|
1277
|
-
}, []);
|
|
1278
|
-
const getFieldSubscribers = (0, import_react22.useCallback)((path) => {
|
|
1279
|
-
if (!subscribers.current[path]) {
|
|
1280
|
-
return [];
|
|
1281
|
-
}
|
|
1282
|
-
return subscribers.current[path].map(
|
|
1283
|
-
(callback) => (input) => callback({
|
|
1284
|
-
previousValue: getPath(path, input.previousValues),
|
|
1285
|
-
value: getPath(path, input.updatedValues),
|
|
1286
|
-
touched: $status.isTouched(path),
|
|
1287
|
-
dirty: $status.isDirty(path)
|
|
1288
|
-
})
|
|
1289
|
-
);
|
|
1290
|
-
}, []);
|
|
1291
|
-
return {
|
|
1292
|
-
subscribers,
|
|
1293
|
-
watch,
|
|
1294
|
-
getFieldSubscribers
|
|
1295
|
-
};
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1299
|
-
function getDataPath(formName, fieldPath) {
|
|
1300
|
-
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1304
|
-
function getValidationResults(errors) {
|
|
1305
|
-
const filteredErrors = filterErrors(errors);
|
|
1306
|
-
return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
|
|
1307
|
-
}
|
|
1308
|
-
function validateRulesRecord(rules, values, path = "", errors = {}) {
|
|
1309
|
-
if (typeof rules !== "object" || rules === null) {
|
|
1310
|
-
return errors;
|
|
1311
|
-
}
|
|
1312
|
-
return Object.keys(rules).reduce((acc, ruleKey) => {
|
|
1313
|
-
const rule = rules[ruleKey];
|
|
1314
|
-
const rulePath = `${path === "" ? "" : `${path}.`}${ruleKey}`;
|
|
1315
|
-
const value = getPath(rulePath, values);
|
|
1316
|
-
let arrayValidation = false;
|
|
1317
|
-
if (typeof rule === "function") {
|
|
1318
|
-
acc[rulePath] = rule(value, values, rulePath);
|
|
1319
|
-
}
|
|
1320
|
-
if (typeof rule === "object" && Array.isArray(value)) {
|
|
1321
|
-
arrayValidation = true;
|
|
1322
|
-
value.forEach(
|
|
1323
|
-
(_item, index) => validateRulesRecord(rule, values, `${rulePath}.${index}`, acc)
|
|
1324
|
-
);
|
|
1325
|
-
}
|
|
1326
|
-
if (typeof rule === "object" && typeof value === "object" && value !== null) {
|
|
1327
|
-
if (!arrayValidation) {
|
|
1328
|
-
validateRulesRecord(rule, values, rulePath, acc);
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
return acc;
|
|
1332
|
-
}, errors);
|
|
1333
|
-
}
|
|
1334
|
-
function validateValues(validate, values) {
|
|
1335
|
-
if (typeof validate === "function") {
|
|
1336
|
-
return getValidationResults(validate(values));
|
|
1337
|
-
}
|
|
1338
|
-
return getValidationResults(validateRulesRecord(validate, values));
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
1342
|
-
function validateFieldValue(path, rules, values) {
|
|
1343
|
-
if (typeof path !== "string") {
|
|
1344
|
-
return { hasError: false, error: null };
|
|
1345
|
-
}
|
|
1346
|
-
const results = validateValues(rules, values);
|
|
1347
|
-
const pathInError = Object.keys(results.errors).find(
|
|
1348
|
-
(errorKey) => path.split(".").every((pathPart, i) => pathPart === errorKey.split(".")[i])
|
|
1349
|
-
);
|
|
1350
|
-
return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/form-index.mjs
|
|
1354
|
-
var FORM_INDEX = "__MANTINE_FORM_INDEX__";
|
|
1355
|
-
|
|
1356
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
1357
|
-
function shouldValidateOnChange(path, validateInputOnChange) {
|
|
1358
|
-
if (!validateInputOnChange) {
|
|
1359
|
-
return false;
|
|
1360
|
-
}
|
|
1361
|
-
if (typeof validateInputOnChange === "boolean") {
|
|
1362
|
-
return validateInputOnChange;
|
|
1363
|
-
}
|
|
1364
|
-
if (Array.isArray(validateInputOnChange)) {
|
|
1365
|
-
return validateInputOnChange.includes(path.replace(/[.][0-9]/g, `.${FORM_INDEX}`));
|
|
1366
|
-
}
|
|
1367
|
-
return false;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
1371
|
-
function useForm({
|
|
1372
|
-
name,
|
|
1373
|
-
mode = "controlled",
|
|
1374
|
-
initialValues,
|
|
1375
|
-
initialErrors = {},
|
|
1376
|
-
initialDirty = {},
|
|
1377
|
-
initialTouched = {},
|
|
1378
|
-
clearInputErrorOnChange = true,
|
|
1379
|
-
validateInputOnChange = false,
|
|
1380
|
-
validateInputOnBlur = false,
|
|
1381
|
-
onValuesChange,
|
|
1382
|
-
transformValues = (values) => values,
|
|
1383
|
-
enhanceGetInputProps,
|
|
1384
|
-
validate: rules
|
|
1385
|
-
} = {}) {
|
|
1386
|
-
const $errors = useFormErrors(initialErrors);
|
|
1387
|
-
const $values = useFormValues({ initialValues, onValuesChange, mode });
|
|
1388
|
-
const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });
|
|
1389
|
-
const $list = useFormList({ $values, $errors, $status });
|
|
1390
|
-
const $watch = useFormWatch({ $status });
|
|
1391
|
-
const [formKey, setFormKey] = (0, import_react23.useState)(0);
|
|
1392
|
-
const [fieldKeys, setFieldKeys] = (0, import_react23.useState)({});
|
|
1393
|
-
const reset = (0, import_react23.useCallback)(() => {
|
|
1394
|
-
$values.resetValues();
|
|
1395
|
-
$errors.clearErrors();
|
|
1396
|
-
$status.resetDirty();
|
|
1397
|
-
$status.resetTouched();
|
|
1398
|
-
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
1399
|
-
}, []);
|
|
1400
|
-
const initialize = (0, import_react23.useCallback)((values) => {
|
|
1401
|
-
$values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
|
|
1402
|
-
}, []);
|
|
1403
|
-
const setFieldValue = (0, import_react23.useCallback)(
|
|
1404
|
-
(path, value, options2) => {
|
|
1405
|
-
const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
|
|
1406
|
-
$status.clearFieldDirty(path);
|
|
1407
|
-
$status.setFieldTouched(path, true);
|
|
1408
|
-
!shouldValidate && clearInputErrorOnChange && $errors.clearFieldError(path);
|
|
1409
|
-
$values.setFieldValue({
|
|
1410
|
-
path,
|
|
1411
|
-
value,
|
|
1412
|
-
updateState: mode === "controlled",
|
|
1413
|
-
subscribers: [
|
|
1414
|
-
...$watch.getFieldSubscribers(path),
|
|
1415
|
-
shouldValidate ? (payload) => {
|
|
1416
|
-
const validationResults = validateFieldValue(path, rules, payload.updatedValues);
|
|
1417
|
-
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
1418
|
-
} : null,
|
|
1419
|
-
options2?.forceUpdate !== false && mode !== "controlled" ? () => setFieldKeys((keys) => ({
|
|
1420
|
-
...keys,
|
|
1421
|
-
[path]: (keys[path] || 0) + 1
|
|
1422
|
-
})) : null
|
|
1423
|
-
]
|
|
1424
|
-
});
|
|
1425
|
-
},
|
|
1426
|
-
[onValuesChange, rules]
|
|
1427
|
-
);
|
|
1428
|
-
const setValues = (0, import_react23.useCallback)(
|
|
1429
|
-
(values) => {
|
|
1430
|
-
const previousValues = $values.refValues.current;
|
|
1431
|
-
$values.setValues({ values, updateState: mode === "controlled" });
|
|
1432
|
-
clearInputErrorOnChange && $errors.clearErrors();
|
|
1433
|
-
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
1434
|
-
Object.keys($watch.subscribers.current).forEach((path) => {
|
|
1435
|
-
const value = getPath(path, $values.refValues.current);
|
|
1436
|
-
const previousValue = getPath(path, previousValues);
|
|
1437
|
-
if (value !== previousValue) {
|
|
1438
|
-
$watch.getFieldSubscribers(path).forEach((cb) => cb({ previousValues, updatedValues: $values.refValues.current }));
|
|
1439
|
-
}
|
|
1440
|
-
});
|
|
1441
|
-
},
|
|
1442
|
-
[onValuesChange, clearInputErrorOnChange]
|
|
1443
|
-
);
|
|
1444
|
-
const validate = (0, import_react23.useCallback)(() => {
|
|
1445
|
-
const results = validateValues(rules, $values.refValues.current);
|
|
1446
|
-
$errors.setErrors(results.errors);
|
|
1447
|
-
return results;
|
|
1448
|
-
}, [rules]);
|
|
1449
|
-
const validateField = (0, import_react23.useCallback)(
|
|
1450
|
-
(path) => {
|
|
1451
|
-
const results = validateFieldValue(path, rules, $values.refValues.current);
|
|
1452
|
-
results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);
|
|
1453
|
-
return results;
|
|
1454
|
-
},
|
|
1455
|
-
[rules]
|
|
1456
|
-
);
|
|
1457
|
-
const getInputProps = (path, { type = "input", withError = true, withFocus = true, ...otherOptions } = {}) => {
|
|
1458
|
-
const onChange = getInputOnChange(
|
|
1459
|
-
(value) => setFieldValue(path, value, { forceUpdate: false })
|
|
1460
|
-
);
|
|
1461
|
-
const payload = { onChange, "data-path": getDataPath(name, path) };
|
|
1462
|
-
if (withError) {
|
|
1463
|
-
payload.error = $errors.errorsState[path];
|
|
1464
|
-
}
|
|
1465
|
-
if (type === "checkbox") {
|
|
1466
|
-
payload[mode === "controlled" ? "checked" : "defaultChecked"] = getPath(
|
|
1467
|
-
path,
|
|
1468
|
-
$values.refValues.current
|
|
1469
|
-
);
|
|
1470
|
-
} else {
|
|
1471
|
-
payload[mode === "controlled" ? "value" : "defaultValue"] = getPath(
|
|
1472
|
-
path,
|
|
1473
|
-
$values.refValues.current
|
|
1474
|
-
);
|
|
1475
|
-
}
|
|
1476
|
-
if (withFocus) {
|
|
1477
|
-
payload.onFocus = () => $status.setFieldTouched(path, true);
|
|
1478
|
-
payload.onBlur = () => {
|
|
1479
|
-
if (shouldValidateOnChange(path, validateInputOnBlur)) {
|
|
1480
|
-
const validationResults = validateFieldValue(path, rules, $values.refValues.current);
|
|
1481
|
-
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
1482
|
-
}
|
|
1483
|
-
};
|
|
1484
|
-
}
|
|
1485
|
-
return Object.assign(
|
|
1486
|
-
payload,
|
|
1487
|
-
enhanceGetInputProps?.({
|
|
1488
|
-
inputProps: payload,
|
|
1489
|
-
field: path,
|
|
1490
|
-
options: { type, withError, withFocus, ...otherOptions },
|
|
1491
|
-
form
|
|
1492
|
-
})
|
|
1493
|
-
);
|
|
1494
|
-
};
|
|
1495
|
-
const onSubmit = (handleSubmit, handleValidationFailure) => (event) => {
|
|
1496
|
-
event?.preventDefault();
|
|
1497
|
-
const results = validate();
|
|
1498
|
-
if (results.hasErrors) {
|
|
1499
|
-
handleValidationFailure?.(results.errors, $values.refValues.current, event);
|
|
1500
|
-
} else {
|
|
1501
|
-
handleSubmit?.(transformValues($values.refValues.current), event);
|
|
1502
|
-
}
|
|
1503
|
-
};
|
|
1504
|
-
const getTransformedValues = (input) => transformValues(input || $values.refValues.current);
|
|
1505
|
-
const onReset = (0, import_react23.useCallback)((event) => {
|
|
1506
|
-
event.preventDefault();
|
|
1507
|
-
reset();
|
|
1508
|
-
}, []);
|
|
1509
|
-
const isValid = (0, import_react23.useCallback)(
|
|
1510
|
-
(path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,
|
|
1511
|
-
[rules]
|
|
1512
|
-
);
|
|
1513
|
-
const key = (path) => `${formKey}-${path}-${fieldKeys[path] || 0}`;
|
|
1514
|
-
const getInputNode = (0, import_react23.useCallback)(
|
|
1515
|
-
(path) => document.querySelector(`[data-path="${getDataPath(name, path)}"]`),
|
|
1516
|
-
[]
|
|
1517
|
-
);
|
|
1518
|
-
const form = {
|
|
1519
|
-
watch: $watch.watch,
|
|
1520
|
-
initialized: $values.initialized.current,
|
|
1521
|
-
values: $values.stateValues,
|
|
1522
|
-
getValues: $values.getValues,
|
|
1523
|
-
setInitialValues: $values.setValuesSnapshot,
|
|
1524
|
-
initialize,
|
|
1525
|
-
setValues,
|
|
1526
|
-
setFieldValue,
|
|
1527
|
-
errors: $errors.errorsState,
|
|
1528
|
-
setErrors: $errors.setErrors,
|
|
1529
|
-
setFieldError: $errors.setFieldError,
|
|
1530
|
-
clearFieldError: $errors.clearFieldError,
|
|
1531
|
-
clearErrors: $errors.clearErrors,
|
|
1532
|
-
resetDirty: $status.resetDirty,
|
|
1533
|
-
setTouched: $status.setTouched,
|
|
1534
|
-
setDirty: $status.setDirty,
|
|
1535
|
-
isTouched: $status.isTouched,
|
|
1536
|
-
resetTouched: $status.resetTouched,
|
|
1537
|
-
isDirty: $status.isDirty,
|
|
1538
|
-
getTouched: $status.getTouched,
|
|
1539
|
-
getDirty: $status.getDirty,
|
|
1540
|
-
reorderListItem: $list.reorderListItem,
|
|
1541
|
-
insertListItem: $list.insertListItem,
|
|
1542
|
-
removeListItem: $list.removeListItem,
|
|
1543
|
-
reset,
|
|
1544
|
-
validate,
|
|
1545
|
-
validateField,
|
|
1546
|
-
getInputProps,
|
|
1547
|
-
onSubmit,
|
|
1548
|
-
onReset,
|
|
1549
|
-
isValid,
|
|
1550
|
-
getTransformedValues,
|
|
1551
|
-
key,
|
|
1552
|
-
getInputNode
|
|
1553
|
-
};
|
|
1554
|
-
useFormActions(name, form);
|
|
1555
|
-
return form;
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
// src/nodes/modifiers/noise-curve-node.tsx
|
|
1559
|
-
var import_react24 = require("react");
|
|
1560
|
-
var import_modifier3 = require("libnoise-ts/module/modifier");
|
|
1561
|
-
var import_util = require("libnoise-ts/util");
|
|
1562
|
-
var import_icons_react2 = require("@tabler/icons-react");
|
|
1563
|
-
var import_hooks17 = require("@mantine/hooks");
|
|
1564
|
-
var import_abstract = require("@awesome-flow/core/abstract");
|
|
1565
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1566
|
-
function NoiseCurveNode({ id, selected, data, type }) {
|
|
1567
|
-
const incoming = (0, import_hooks16.useIncomingComputedData)(id);
|
|
1568
|
-
const updateNodeData = (0, import_hooks16.useUpdateNodeData)();
|
|
1569
|
-
const updateComputedData = (0, import_hooks16.useUpdateNodeComputedData)();
|
|
1570
|
-
const [values, setValues] = (0, import_react24.useState)([]);
|
|
1571
|
-
const form = useForm({
|
|
1572
|
-
mode: "uncontrolled",
|
|
1573
|
-
initialValues: {
|
|
1574
|
-
points: []
|
|
1575
|
-
},
|
|
1576
|
-
validateInputOnChange: [`points.${FORM_INDEX}.input`],
|
|
1577
|
-
clearInputErrorOnChange: true,
|
|
1578
|
-
validate: {
|
|
1579
|
-
points: {
|
|
1580
|
-
input: (value, values2) => {
|
|
1581
|
-
const counts = {};
|
|
1582
|
-
values2.points.forEach((x) => {
|
|
1583
|
-
counts[x.input] = (counts[x.input] || 0) + 1;
|
|
1584
|
-
});
|
|
1585
|
-
return counts[value] > 1;
|
|
1586
|
-
}
|
|
1587
|
-
}
|
|
1588
|
-
},
|
|
1589
|
-
onValuesChange: (0, import_react24.useCallback)((values2) => {
|
|
1590
|
-
if (form.isValid()) {
|
|
1591
|
-
const points = values2.points.map((v) => ({ input: v.input, output: v.output }));
|
|
1592
|
-
setValues(points);
|
|
1593
|
-
updateNodeData(id, { points });
|
|
1594
|
-
}
|
|
1595
|
-
form.validate();
|
|
1596
|
-
}, [])
|
|
1597
|
-
});
|
|
1598
|
-
(0, import_react24.useEffect)(() => {
|
|
1599
|
-
const points = data.points?.length ? data.points.map((v) => ({ input: v.input, output: v.output, key: (0, import_hooks17.randomId)() })) : [1, 2, 3, 4].map(() => ({ input: 0, output: 0, key: (0, import_hooks17.randomId)() }));
|
|
1600
|
-
form.initialize({ points });
|
|
1601
|
-
}, []);
|
|
1602
|
-
(0, import_react24.useEffect)(() => {
|
|
1603
|
-
if (incoming?.length && values?.length >= 4) {
|
|
1604
|
-
const module2 = new import_modifier3.Curve(
|
|
1605
|
-
incoming[0].module,
|
|
1606
|
-
values.map((p) => new import_util.Tuple(p.input, p.output))
|
|
1607
|
-
);
|
|
1608
|
-
updateComputedData(id, { module: module2 });
|
|
1609
|
-
}
|
|
1610
|
-
}, [values, incoming]);
|
|
1611
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core6.Group, { mt: "xs", children: [
|
|
1612
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1613
|
-
import_core6.NumberInput,
|
|
1614
|
-
{
|
|
1615
|
-
size: "xs",
|
|
1616
|
-
w: 100,
|
|
1617
|
-
placeholder: "Input Value",
|
|
1618
|
-
...form.getInputProps(`points.${index}.input`),
|
|
1619
|
-
step: 0.1
|
|
1620
|
-
},
|
|
1621
|
-
form.key(`points.${index}.input`)
|
|
1622
|
-
),
|
|
1623
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1624
|
-
import_core6.NumberInput,
|
|
1625
|
-
{
|
|
1626
|
-
size: "xs",
|
|
1627
|
-
w: 100,
|
|
1628
|
-
placeholder: "Output Value",
|
|
1629
|
-
...form.getInputProps(`points.${index}.output`),
|
|
1630
|
-
step: 0.1
|
|
1631
|
-
},
|
|
1632
|
-
form.key(`points.${index}.output`)
|
|
1633
|
-
),
|
|
1634
|
-
data.state === import_abstract.NodeState.edit && values.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1635
|
-
import_core6.ActionIcon,
|
|
1636
|
-
{
|
|
1637
|
-
color: "red",
|
|
1638
|
-
variant: "outline",
|
|
1639
|
-
size: "sm",
|
|
1640
|
-
onClick: () => form.removeListItem("points", index),
|
|
1641
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons_react2.IconX, { size: "1rem" })
|
|
1642
|
-
}
|
|
1643
|
-
)
|
|
1644
|
-
] }, item.key));
|
|
1645
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_layout16.NodeContainer, { id, selected, type, data, children: [
|
|
1646
|
-
fields,
|
|
1647
|
-
data.state === import_abstract.NodeState.edit && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1648
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core6.Space, { h: 10 }),
|
|
1649
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1650
|
-
import_core6.Button,
|
|
1651
|
-
{
|
|
1652
|
-
variant: "outline",
|
|
1653
|
-
size: "xs",
|
|
1654
|
-
fullWidth: true,
|
|
1655
|
-
onClick: () => form.insertListItem("points", { input: 0, output: 0, key: (0, import_hooks17.randomId)() }),
|
|
1656
|
-
children: "Add control point"
|
|
1657
|
-
}
|
|
1658
|
-
)
|
|
1659
|
-
] }),
|
|
1660
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_layout16.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1661
|
-
] });
|
|
1662
|
-
}
|
|
1663
|
-
var noise_curve_node_default = NoiseCurveNode;
|
|
1664
|
-
|
|
1665
|
-
// src/nodes/modifiers/noise-exponent-node.tsx
|
|
1666
|
-
var import_layout17 = require("@awesome-flow/core/layout");
|
|
1667
|
-
var import_react25 = require("react");
|
|
1668
|
-
var import_core7 = require("@mantine/core");
|
|
1669
|
-
var import_hooks18 = require("@awesome-flow/core/hooks");
|
|
1670
|
-
var import_modifier4 = require("libnoise-ts/module/modifier");
|
|
1671
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1672
|
-
function NoiseExponentNode({ id, selected, data, type }) {
|
|
1673
|
-
const [exponent, setExponent] = (0, import_react25.useState)(data.exponent);
|
|
1674
|
-
const incoming = (0, import_hooks18.useIncomingComputedData)(id);
|
|
1675
|
-
const updateNodeData = (0, import_hooks18.useUpdateNodeData)();
|
|
1676
|
-
const updateComputedData = (0, import_hooks18.useUpdateNodeComputedData)();
|
|
1677
|
-
(0, import_react25.useEffect)(() => {
|
|
1678
|
-
if (incoming?.length > 0) {
|
|
1679
|
-
const module2 = new import_modifier4.Exponent(incoming[0].module, exponent);
|
|
1680
|
-
updateComputedData(id, { module: module2 });
|
|
1681
|
-
}
|
|
1682
|
-
updateNodeData(id, { exponent });
|
|
1683
|
-
}, [incoming, exponent]);
|
|
1684
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_layout17.NodeContainer, { id, selected, data, type, children: [
|
|
1685
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core7.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core7.Group, { children: [
|
|
1686
|
-
"Exponent:",
|
|
1687
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1688
|
-
import_core7.NumberInput,
|
|
1689
|
-
{
|
|
1690
|
-
size: "xs",
|
|
1691
|
-
value: exponent,
|
|
1692
|
-
onChange: (e) => setExponent(Number(e)),
|
|
1693
|
-
step: 0.1
|
|
1694
|
-
}
|
|
1695
|
-
)
|
|
1696
|
-
] }) }),
|
|
1697
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_layout17.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1698
|
-
] });
|
|
1699
|
-
}
|
|
1700
|
-
var noise_exponent_node_default = NoiseExponentNode;
|
|
1701
|
-
|
|
1702
|
-
// src/nodes/modifiers/noise-invert-node.tsx
|
|
1703
|
-
var import_layout18 = require("@awesome-flow/core/layout");
|
|
1704
|
-
var import_react26 = require("react");
|
|
1705
|
-
var import_hooks19 = require("@awesome-flow/core/hooks");
|
|
1706
|
-
var import_modifier5 = require("libnoise-ts/module/modifier");
|
|
1707
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1708
|
-
function NoiseInvertNode({ id, selected, data, type }) {
|
|
1709
|
-
const incoming = (0, import_hooks19.useIncomingComputedData)(id);
|
|
1710
|
-
const updateComputedData = (0, import_hooks19.useUpdateNodeComputedData)();
|
|
1711
|
-
(0, import_react26.useEffect)(() => {
|
|
1712
|
-
if (incoming?.length > 0) {
|
|
1713
|
-
const module2 = new import_modifier5.Invert(incoming[0].module);
|
|
1714
|
-
updateComputedData(id, { module: module2 });
|
|
1715
|
-
}
|
|
1716
|
-
}, [incoming]);
|
|
1717
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_layout18.NodeContainer, { id, selected, data, type, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_layout18.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" }) });
|
|
1718
|
-
}
|
|
1719
|
-
var noise_invert_node_default = NoiseInvertNode;
|
|
1720
|
-
|
|
1721
|
-
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
1722
|
-
var import_layout19 = require("@awesome-flow/core/layout");
|
|
1723
|
-
var import_react27 = require("react");
|
|
1724
|
-
var import_core8 = require("@mantine/core");
|
|
1725
|
-
var import_hooks20 = require("@awesome-flow/core/hooks");
|
|
1726
|
-
|
|
1727
|
-
// src/modules/normalize-noise-module.ts
|
|
1728
|
-
var import_modifier6 = __toESM(require("libnoise-ts/module/modifier"), 1);
|
|
1729
|
-
var NormalizeNoiseModule = class extends import_modifier6.default {
|
|
1730
|
-
constructor(source, lowerBound, upperBound) {
|
|
1731
|
-
super(source);
|
|
1732
|
-
this.lowerBound = lowerBound;
|
|
1733
|
-
this.upperBound = upperBound;
|
|
1734
|
-
}
|
|
1735
|
-
getValue(x, y, z) {
|
|
1736
|
-
return normalize(this.sourceModule.getValue(x, y, z), this.lowerBound, this.upperBound);
|
|
1737
|
-
}
|
|
1738
|
-
};
|
|
1739
|
-
function normalize(value, min, max) {
|
|
1740
|
-
return (value - min) / (max - min);
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
1744
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1745
|
-
function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
1746
|
-
const [intervalStart, setIntervalStart] = (0, import_react27.useState)(data.intervalStart);
|
|
1747
|
-
const [intervalEnd, setIntervalEnd] = (0, import_react27.useState)(data.intervalEnd);
|
|
1748
|
-
const incoming = (0, import_hooks20.useIncomingComputedData)(id);
|
|
1749
|
-
const updateNodeData = (0, import_hooks20.useUpdateNodeData)();
|
|
1750
|
-
const updateComputedData = (0, import_hooks20.useUpdateNodeComputedData)();
|
|
1751
|
-
(0, import_react27.useEffect)(() => {
|
|
1752
|
-
if (incoming?.length) {
|
|
1753
|
-
const source = incoming[0].module;
|
|
1754
|
-
const module2 = new NormalizeNoiseModule(source, intervalStart, intervalEnd);
|
|
1755
|
-
updateComputedData(id, { module: module2 });
|
|
1756
|
-
}
|
|
1757
|
-
updateNodeData(id, { intervalStart, intervalEnd });
|
|
1758
|
-
}, [incoming, intervalStart, intervalEnd]);
|
|
1759
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_layout19.NodeContainer, { id, selected, data, type, children: [
|
|
1760
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core8.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core8.Group, { children: [
|
|
1761
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1762
|
-
import_core8.NumberInput,
|
|
1763
|
-
{
|
|
1764
|
-
size: "xs",
|
|
1765
|
-
w: 100,
|
|
1766
|
-
value: intervalStart,
|
|
1767
|
-
onChange: (e) => setIntervalStart(Number(e))
|
|
1768
|
-
}
|
|
1769
|
-
),
|
|
1770
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1771
|
-
import_core8.NumberInput,
|
|
1772
|
-
{
|
|
1773
|
-
size: "xs",
|
|
1774
|
-
w: 100,
|
|
1775
|
-
value: intervalEnd,
|
|
1776
|
-
onChange: (e) => setIntervalEnd(Number(e))
|
|
1777
|
-
}
|
|
1778
|
-
)
|
|
1779
|
-
] }) }),
|
|
1780
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_layout19.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1781
|
-
] });
|
|
1782
|
-
}
|
|
1783
|
-
var noise_normalize_node_default = NoiseNormalizeNode;
|
|
1784
|
-
|
|
1785
|
-
// src/nodes/modifiers/noise-scale-bias-node.tsx
|
|
1786
|
-
var import_layout20 = require("@awesome-flow/core/layout");
|
|
1787
|
-
var import_react28 = require("react");
|
|
1788
|
-
var import_core9 = require("@mantine/core");
|
|
1789
|
-
var import_hooks21 = require("@awesome-flow/core/hooks");
|
|
1790
|
-
var import_modifier7 = require("libnoise-ts/module/modifier");
|
|
1791
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1792
|
-
function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
1793
|
-
const [scale, setScale] = (0, import_react28.useState)(data.scale);
|
|
1794
|
-
const [bias, setBias] = (0, import_react28.useState)(data.bias);
|
|
1795
|
-
const incoming = (0, import_hooks21.useIncomingComputedData)(id);
|
|
1796
|
-
const updateNodeData = (0, import_hooks21.useUpdateNodeData)();
|
|
1797
|
-
const updateComputedData = (0, import_hooks21.useUpdateNodeComputedData)();
|
|
1798
|
-
(0, import_react28.useEffect)(() => {
|
|
1799
|
-
if (incoming?.length > 0) {
|
|
1800
|
-
const module2 = new import_modifier7.ScaleBias(incoming[0].module, scale, bias);
|
|
1801
|
-
updateComputedData(id, { module: module2 });
|
|
1802
|
-
}
|
|
1803
|
-
updateNodeData(id, { scale, bias });
|
|
1804
|
-
}, [incoming, scale, bias]);
|
|
1805
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_layout20.NodeContainer, { id, selected, data, type, children: [
|
|
1806
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core9.Stack, { children: [
|
|
1807
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core9.Group, { children: [
|
|
1808
|
-
"Scale:",
|
|
1809
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1810
|
-
import_core9.NumberInput,
|
|
1811
|
-
{
|
|
1812
|
-
size: "xs",
|
|
1813
|
-
w: 100,
|
|
1814
|
-
value: scale,
|
|
1815
|
-
onChange: (e) => setScale(Number(e)),
|
|
1816
|
-
step: 0.1
|
|
1817
|
-
}
|
|
1818
|
-
)
|
|
1819
|
-
] }),
|
|
1820
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core9.Group, { children: [
|
|
1821
|
-
"Bias:",
|
|
1822
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1823
|
-
import_core9.NumberInput,
|
|
1824
|
-
{
|
|
1825
|
-
size: "xs",
|
|
1826
|
-
w: 100,
|
|
1827
|
-
value: bias,
|
|
1828
|
-
onChange: (e) => setBias(Number(e)),
|
|
1829
|
-
step: 0.1
|
|
1830
|
-
}
|
|
1831
|
-
)
|
|
1832
|
-
] })
|
|
1833
|
-
] }),
|
|
1834
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_layout20.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1835
|
-
] });
|
|
1836
|
-
}
|
|
1837
|
-
var noise_scale_bias_node_default = NoiseScaleBiasNode;
|
|
1838
|
-
|
|
1839
|
-
// src/nodes/modifiers/noise-terrace-node.tsx
|
|
1840
|
-
var import_layout21 = require("@awesome-flow/core/layout");
|
|
1841
|
-
var import_core10 = require("@mantine/core");
|
|
1842
|
-
var import_hooks22 = require("@awesome-flow/core/hooks");
|
|
1843
|
-
var import_react29 = require("react");
|
|
1844
|
-
var import_modifier8 = require("libnoise-ts/module/modifier");
|
|
1845
|
-
var import_icons_react3 = require("@tabler/icons-react");
|
|
1846
|
-
var import_hooks23 = require("@mantine/hooks");
|
|
1847
|
-
var import_abstract2 = require("@awesome-flow/core/abstract");
|
|
1848
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1849
|
-
function NoiseTerraceNode({ id, selected, data, type }) {
|
|
1850
|
-
const incoming = (0, import_hooks22.useIncomingComputedData)(id);
|
|
1851
|
-
const updateNodeData = (0, import_hooks22.useUpdateNodeData)();
|
|
1852
|
-
const updateComputedData = (0, import_hooks22.useUpdateNodeComputedData)();
|
|
1853
|
-
const [values, setValues] = (0, import_react29.useState)([]);
|
|
1854
|
-
const form = useForm({
|
|
1855
|
-
mode: "uncontrolled",
|
|
1856
|
-
initialValues: {
|
|
1857
|
-
points: []
|
|
1858
|
-
},
|
|
1859
|
-
validateInputOnChange: [`points.${FORM_INDEX}.input`],
|
|
1860
|
-
clearInputErrorOnChange: true,
|
|
1861
|
-
onValuesChange: (0, import_react29.useCallback)((values2) => {
|
|
1862
|
-
if (form.isValid()) {
|
|
1863
|
-
const points = values2.points.map((v) => v.value);
|
|
1864
|
-
setValues(points);
|
|
1865
|
-
updateNodeData(id, { points });
|
|
1866
|
-
}
|
|
1867
|
-
form.validate();
|
|
1868
|
-
}, [])
|
|
1869
|
-
});
|
|
1870
|
-
(0, import_react29.useEffect)(() => {
|
|
1871
|
-
const points = data.points?.length ? data.points.map((v) => ({ value: v, key: (0, import_hooks23.randomId)() })) : [1, 2].map(() => ({ value: 0, key: (0, import_hooks23.randomId)() }));
|
|
1872
|
-
form.initialize({ points });
|
|
1873
|
-
}, []);
|
|
1874
|
-
(0, import_react29.useEffect)(() => {
|
|
1875
|
-
if (incoming?.length && values?.length >= 2) {
|
|
1876
|
-
const module2 = new import_modifier8.Terrace(incoming[0].module, values);
|
|
1877
|
-
updateComputedData(id, { module: module2 });
|
|
1878
|
-
}
|
|
1879
|
-
}, [values, incoming]);
|
|
1880
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core10.Group, { mt: "xs", children: [
|
|
1881
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1882
|
-
import_core10.NumberInput,
|
|
1883
|
-
{
|
|
1884
|
-
size: "xs",
|
|
1885
|
-
placeholder: "Input Value",
|
|
1886
|
-
...form.getInputProps(`points.${index}.value`),
|
|
1887
|
-
step: 0.1
|
|
1888
|
-
},
|
|
1889
|
-
form.key(`points.${index}.value`)
|
|
1890
|
-
),
|
|
1891
|
-
data.state === import_abstract2.NodeState.edit && values.length > 2 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1892
|
-
import_core10.ActionIcon,
|
|
1893
|
-
{
|
|
1894
|
-
color: "red",
|
|
1895
|
-
variant: "outline",
|
|
1896
|
-
size: "sm",
|
|
1897
|
-
onClick: () => form.removeListItem("points", index),
|
|
1898
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons_react3.IconX, { size: "1rem" })
|
|
1899
|
-
}
|
|
1900
|
-
)
|
|
1901
|
-
] }, item.key));
|
|
1902
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_layout21.NodeContainer, { id, selected, type, data, children: [
|
|
1903
|
-
fields,
|
|
1904
|
-
data.state === import_abstract2.NodeState.edit && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1905
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core10.Space, { h: 10 }),
|
|
1906
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1907
|
-
import_core10.Button,
|
|
1908
|
-
{
|
|
1909
|
-
variant: "outline",
|
|
1910
|
-
size: "xs",
|
|
1911
|
-
fullWidth: true,
|
|
1912
|
-
onClick: () => form.insertListItem("points", { value: 0, key: (0, import_hooks23.randomId)() }),
|
|
1913
|
-
children: "Add control point"
|
|
1914
|
-
}
|
|
1915
|
-
)
|
|
1916
|
-
] }),
|
|
1917
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_layout21.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1918
|
-
] });
|
|
1919
|
-
}
|
|
1920
|
-
var noise_terrace_node_default = NoiseTerraceNode;
|
|
1921
|
-
|
|
1922
|
-
// src/nodes/output/noise-logger-node.tsx
|
|
1923
|
-
var import_layout22 = require("@awesome-flow/core/layout");
|
|
1924
|
-
var import_react30 = require("react");
|
|
1925
|
-
var import_core11 = require("@mantine/core");
|
|
1926
|
-
var import_hooks24 = require("@awesome-flow/core/hooks");
|
|
1927
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1928
|
-
function NoiseLoggerNode({ id, selected, data, type }) {
|
|
1929
|
-
const incoming = (0, import_hooks24.useIncomingComputedData)(id);
|
|
1930
|
-
const noise = (0, import_react30.useMemo)(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
1931
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_layout22.NodeContainer, { id, selected, data, type, children: [
|
|
1932
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core11.Text, { children: [
|
|
1933
|
-
"Size: ",
|
|
1934
|
-
noise?.length || 0
|
|
1935
|
-
] }),
|
|
1936
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core11.Divider, { h: 5 }),
|
|
1937
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core11.Stack, { children: noise?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core11.Text, { children: [
|
|
1938
|
-
v.position?.x,
|
|
1939
|
-
":",
|
|
1940
|
-
v.position?.y,
|
|
1941
|
-
":",
|
|
1942
|
-
v.position?.z,
|
|
1943
|
-
": ",
|
|
1944
|
-
v.value
|
|
1945
|
-
] }, i)) }),
|
|
1946
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_layout22.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1947
|
-
] });
|
|
1948
|
-
}
|
|
1949
|
-
var noise_logger_node_default = NoiseLoggerNode;
|
|
1950
|
-
|
|
1951
|
-
// src/nodes/output/noise-output-node.tsx
|
|
1952
|
-
var import_layout32 = require("@awesome-flow/core/layout");
|
|
1953
|
-
var import_react40 = require("react");
|
|
1954
|
-
var import_hooks34 = require("@awesome-flow/core/hooks");
|
|
1955
|
-
var import_components11 = require("@awesome-flow/core/components");
|
|
1956
|
-
var import_core18 = require("@mantine/core");
|
|
1957
|
-
|
|
1958
|
-
// src/nodes/output/noise-raw-texture-node.tsx
|
|
1959
|
-
var import_layout23 = require("@awesome-flow/core/layout");
|
|
1960
|
-
var import_react31 = require("react");
|
|
1961
|
-
var import_hooks25 = require("@awesome-flow/core/hooks");
|
|
1962
|
-
var import_core12 = require("@mantine/core");
|
|
1963
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1964
|
-
function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
1965
|
-
const updateComputedData = (0, import_hooks25.useUpdateNodeComputedData)();
|
|
1966
|
-
const [dataLength, setDataLength] = (0, import_react31.useState)(0);
|
|
1967
|
-
const [resolution, setResolution] = (0, import_react31.useState)(0);
|
|
1968
|
-
const incoming = (0, import_hooks25.useIncomingComputedData)(id);
|
|
1969
|
-
const noise = (0, import_react31.useMemo)(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
1970
|
-
(0, import_react31.useEffect)(() => {
|
|
1971
|
-
if (noise?.length) {
|
|
1972
|
-
const size = Math.ceil(Math.sqrt(noise.length));
|
|
1973
|
-
const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
|
|
1974
|
-
const dataArray = new Uint8Array(size * size * 4);
|
|
1975
|
-
dataArray.set(colors);
|
|
1976
|
-
setResolution(size);
|
|
1977
|
-
setDataLength(dataArray.length);
|
|
1978
|
-
updateComputedData(id, { textureData: dataArray, textureResolution: size });
|
|
1979
|
-
}
|
|
1980
|
-
}, [noise]);
|
|
1981
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_layout23.NodeContainer, { id, selected, data, type, children: [
|
|
1982
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core12.Stack, { children: [
|
|
1983
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core12.Group, { children: [
|
|
1984
|
-
"Resolution: ",
|
|
1985
|
-
resolution,
|
|
1986
|
-
"x",
|
|
1987
|
-
resolution
|
|
1988
|
-
] }),
|
|
1989
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core12.Group, { children: [
|
|
1990
|
-
"Input Length: ",
|
|
1991
|
-
noise?.length || 0
|
|
1992
|
-
] }),
|
|
1993
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core12.Group, { children: [
|
|
1994
|
-
"Output Length (",
|
|
1995
|
-
resolution,
|
|
1996
|
-
"*",
|
|
1997
|
-
resolution,
|
|
1998
|
-
"*4): ",
|
|
1999
|
-
dataLength
|
|
2000
|
-
] })
|
|
2001
|
-
] }),
|
|
2002
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_layout23.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2003
|
-
] });
|
|
2004
|
-
}
|
|
2005
|
-
var noise_raw_texture_node_default = NoiseRawTextureNode;
|
|
2006
|
-
|
|
2007
|
-
// src/nodes/output/positions-logger-node.tsx
|
|
2008
|
-
var import_layout24 = require("@awesome-flow/core/layout");
|
|
2009
|
-
var import_react32 = require("react");
|
|
2010
|
-
var import_core13 = require("@mantine/core");
|
|
2011
|
-
var import_hooks26 = require("@awesome-flow/core/hooks");
|
|
2012
|
-
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2013
|
-
function PositionsLoggerNode({ id, selected, data, type }) {
|
|
2014
|
-
const incoming = (0, import_hooks26.useIncomingComputedData)(id);
|
|
2015
|
-
const positions = (0, import_react32.useMemo)(() => {
|
|
2016
|
-
return incoming?.map((p) => p.positions).flat();
|
|
2017
|
-
}, [incoming]);
|
|
2018
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_layout24.NodeContainer, { id, selected, data, type, children: [
|
|
2019
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core13.Text, { children: [
|
|
2020
|
-
"Size: ",
|
|
2021
|
-
positions?.length || 0
|
|
2022
|
-
] }),
|
|
2023
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core13.Divider, { h: 5 }),
|
|
2024
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core13.Stack, { children: positions?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core13.Text, { children: [
|
|
2025
|
-
v.x,
|
|
2026
|
-
":",
|
|
2027
|
-
v.y,
|
|
2028
|
-
":",
|
|
2029
|
-
v.z
|
|
2030
|
-
] }, i)) }),
|
|
2031
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_layout24.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2032
|
-
] });
|
|
2033
|
-
}
|
|
2034
|
-
var positions_logger_node_default = PositionsLoggerNode;
|
|
2035
|
-
|
|
2036
|
-
// src/nodes/selectors/noise-blend-node.tsx
|
|
2037
|
-
var import_layout25 = require("@awesome-flow/core/layout");
|
|
2038
|
-
var import_react33 = require("react");
|
|
2039
|
-
var import_hooks27 = require("@awesome-flow/core/hooks");
|
|
2040
|
-
var import_selector = require("libnoise-ts/module/selector");
|
|
2041
|
-
var import_components7 = require("@awesome-flow/core/components");
|
|
2042
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2043
|
-
function NoiseBlendNode({ id, selected, data, type }) {
|
|
2044
|
-
const updateComputedData = (0, import_hooks27.useUpdateNodeComputedData)();
|
|
2045
|
-
const onDataUpdated = (0, import_react33.useCallback)(
|
|
2046
|
-
(incomingData) => {
|
|
2047
|
-
const incomingSources = incomingData["source" /* source */];
|
|
2048
|
-
const incomingControl = incomingData["control" /* control */];
|
|
2049
|
-
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2050
|
-
const module2 = new import_selector.Blend(
|
|
2051
|
-
incomingSources[0].module,
|
|
2052
|
-
incomingSources[1].module,
|
|
2053
|
-
incomingControl[0].module
|
|
2054
|
-
);
|
|
2055
|
-
updateComputedData(id, { module: module2 });
|
|
2056
|
-
}
|
|
2057
|
-
},
|
|
2058
|
-
[]
|
|
2059
|
-
);
|
|
2060
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_layout25.NodeContainer, { id, selected, data, type, children: [
|
|
2061
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2062
|
-
import_components7.HandlesIncomingDataStatus,
|
|
2063
|
-
{
|
|
2064
|
-
nodeId: id,
|
|
2065
|
-
handles: data.handles,
|
|
2066
|
-
handleKey: "dataId",
|
|
2067
|
-
onDataUpdated,
|
|
2068
|
-
type: "target",
|
|
2069
|
-
resetComputedData: true
|
|
2070
|
-
}
|
|
2071
|
-
),
|
|
2072
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_layout25.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2073
|
-
] });
|
|
2074
|
-
}
|
|
2075
|
-
var noise_blend_node_default = NoiseBlendNode;
|
|
2076
|
-
|
|
2077
|
-
// src/nodes/selectors/noise-select-node.tsx
|
|
2078
|
-
var import_layout26 = require("@awesome-flow/core/layout");
|
|
2079
|
-
var import_react34 = require("react");
|
|
2080
|
-
var import_hooks28 = require("@awesome-flow/core/hooks");
|
|
2081
|
-
var import_selector2 = require("libnoise-ts/module/selector");
|
|
2082
|
-
var import_core14 = require("@mantine/core");
|
|
2083
|
-
var import_components8 = require("@awesome-flow/core/components");
|
|
2084
|
-
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2085
|
-
function NoiseSelectNode({ id, selected, data, type }) {
|
|
2086
|
-
const [edgeFalloff, setEdgeFalloff] = (0, import_react34.useState)(data.edgeFalloff);
|
|
2087
|
-
const [lowerBound, setLowerBound] = (0, import_react34.useState)(data.lowerBound);
|
|
2088
|
-
const [upperBound, setUpperBound] = (0, import_react34.useState)(data.upperBound);
|
|
2089
|
-
const updateNodeData = (0, import_hooks28.useUpdateNodeData)();
|
|
2090
|
-
const updateComputedData = (0, import_hooks28.useUpdateNodeComputedData)();
|
|
2091
|
-
(0, import_react34.useEffect)(() => {
|
|
2092
|
-
updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
|
|
2093
|
-
}, [edgeFalloff, lowerBound, upperBound]);
|
|
2094
|
-
const onDataUpdated = (0, import_react34.useCallback)(
|
|
2095
|
-
(incomingData) => {
|
|
2096
|
-
const incomingSources = incomingData["source" /* source */];
|
|
2097
|
-
const incomingControl = incomingData["control" /* control */];
|
|
2098
|
-
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2099
|
-
const module2 = new import_selector2.Select(
|
|
2100
|
-
incomingSources[0].module,
|
|
2101
|
-
incomingSources[1].module,
|
|
2102
|
-
incomingControl[0].module,
|
|
2103
|
-
edgeFalloff,
|
|
2104
|
-
lowerBound,
|
|
2105
|
-
upperBound
|
|
2106
|
-
);
|
|
2107
|
-
updateComputedData(id, { module: module2 });
|
|
2108
|
-
}
|
|
2109
|
-
},
|
|
2110
|
-
[]
|
|
2111
|
-
);
|
|
2112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_layout26.NodeContainer, { id, selected, data, type, children: [
|
|
2113
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core14.Stack, { children: [
|
|
2114
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core14.Group, { children: [
|
|
2115
|
-
"Edge Falloff:",
|
|
2116
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2117
|
-
import_core14.NumberInput,
|
|
2118
|
-
{
|
|
2119
|
-
size: "xs",
|
|
2120
|
-
w: 100,
|
|
2121
|
-
value: edgeFalloff,
|
|
2122
|
-
onChange: (e) => setEdgeFalloff(Number(e)),
|
|
2123
|
-
step: 0.1
|
|
2124
|
-
}
|
|
2125
|
-
)
|
|
2126
|
-
] }),
|
|
2127
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core14.Group, { children: [
|
|
2128
|
-
"Lower Bound:",
|
|
2129
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2130
|
-
import_core14.NumberInput,
|
|
2131
|
-
{
|
|
2132
|
-
size: "xs",
|
|
2133
|
-
w: 100,
|
|
2134
|
-
value: lowerBound,
|
|
2135
|
-
onChange: (e) => setLowerBound(Number(e)),
|
|
2136
|
-
step: 0.1
|
|
2137
|
-
}
|
|
2138
|
-
)
|
|
2139
|
-
] }),
|
|
2140
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core14.Group, { children: [
|
|
2141
|
-
"Upper Bound:",
|
|
2142
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2143
|
-
import_core14.NumberInput,
|
|
2144
|
-
{
|
|
2145
|
-
size: "xs",
|
|
2146
|
-
w: 100,
|
|
2147
|
-
value: upperBound,
|
|
2148
|
-
onChange: (e) => setUpperBound(Number(e)),
|
|
2149
|
-
step: 0.1
|
|
2150
|
-
}
|
|
2151
|
-
)
|
|
2152
|
-
] }),
|
|
2153
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2154
|
-
import_components8.HandlesIncomingDataStatus,
|
|
2155
|
-
{
|
|
2156
|
-
nodeId: id,
|
|
2157
|
-
handles: data.handles,
|
|
2158
|
-
handleKey: "dataId",
|
|
2159
|
-
onDataUpdated,
|
|
2160
|
-
type: "target",
|
|
2161
|
-
resetComputedData: true
|
|
2162
|
-
}
|
|
2163
|
-
)
|
|
2164
|
-
] }),
|
|
2165
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_layout26.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2166
|
-
] });
|
|
2167
|
-
}
|
|
2168
|
-
var noise_select_node_default = NoiseSelectNode;
|
|
2169
|
-
|
|
2170
|
-
// src/nodes/transformers/noise-displace-node.tsx
|
|
2171
|
-
var import_layout27 = require("@awesome-flow/core/layout");
|
|
2172
|
-
var import_react35 = require("react");
|
|
2173
|
-
var import_hooks29 = require("@awesome-flow/core/hooks");
|
|
2174
|
-
var import_transformer = require("libnoise-ts/module/transformer");
|
|
2175
|
-
var import_components9 = require("@awesome-flow/core/components");
|
|
2176
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2177
|
-
function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
2178
|
-
const updateComputedData = (0, import_hooks29.useUpdateNodeComputedData)();
|
|
2179
|
-
const onDataUpdated = (0, import_react35.useCallback)(
|
|
2180
|
-
(handleData) => {
|
|
2181
|
-
const sourceModule = handleData["source" /* sourceModule */];
|
|
2182
|
-
const xModule = handleData["x-module" /* xModule */];
|
|
2183
|
-
const yModule = handleData["y-module" /* yModule */];
|
|
2184
|
-
const zModule = handleData["z-module" /* zModule */];
|
|
2185
|
-
if (sourceModule && xModule && yModule && zModule) {
|
|
2186
|
-
const module2 = new import_transformer.Displace(
|
|
2187
|
-
sourceModule[0].module,
|
|
2188
|
-
xModule[0].module,
|
|
2189
|
-
yModule[0].module,
|
|
2190
|
-
zModule[0].module
|
|
2191
|
-
);
|
|
2192
|
-
updateComputedData(id, { module: module2 });
|
|
2193
|
-
}
|
|
2194
|
-
},
|
|
2195
|
-
[]
|
|
2196
|
-
);
|
|
2197
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_layout27.NodeContainer, { id, selected, data, type, children: [
|
|
2198
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2199
|
-
import_components9.HandlesIncomingDataStatus,
|
|
2200
|
-
{
|
|
2201
|
-
nodeId: id,
|
|
2202
|
-
handles: data.handles,
|
|
2203
|
-
handleKey: "dataId",
|
|
2204
|
-
onDataUpdated,
|
|
2205
|
-
type: "target",
|
|
2206
|
-
resetComputedData: true
|
|
2207
|
-
}
|
|
2208
|
-
),
|
|
2209
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_layout27.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2210
|
-
] });
|
|
2211
|
-
}
|
|
2212
|
-
var noise_displace_node_default = NoiseDisplaceNode;
|
|
2213
|
-
|
|
2214
|
-
// src/nodes/transformers/noise-rotate-point-node.tsx
|
|
2215
|
-
var import_layout28 = require("@awesome-flow/core/layout");
|
|
2216
|
-
var import_react36 = require("react");
|
|
2217
|
-
var import_hooks30 = require("@awesome-flow/core/hooks");
|
|
2218
|
-
var import_core15 = require("@mantine/core");
|
|
2219
|
-
var import_transformer2 = require("libnoise-ts/module/transformer");
|
|
2220
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2221
|
-
function NoiseRotatePointNode({
|
|
2222
|
-
id,
|
|
2223
|
-
selected,
|
|
2224
|
-
data,
|
|
2225
|
-
type
|
|
2226
|
-
}) {
|
|
2227
|
-
const [xAngle, setXAngle] = (0, import_react36.useState)(data.xAngle);
|
|
2228
|
-
const [yAngle, setYAngle] = (0, import_react36.useState)(data.yAngle);
|
|
2229
|
-
const [zAngle, setZAngle] = (0, import_react36.useState)(data.zAngle);
|
|
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_react36.useEffect)(() => {
|
|
2234
|
-
if (incoming?.length) {
|
|
2235
|
-
const module2 = new import_transformer2.RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
|
|
2236
|
-
updateComputedData(id, { module: module2 });
|
|
2237
|
-
}
|
|
2238
|
-
updateNodeData(id, { xAngle, yAngle, zAngle });
|
|
2239
|
-
}, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
|
|
2240
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_layout28.NodeContainer, { id, selected, data, type, children: [
|
|
2241
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core15.Stack, { children: [
|
|
2242
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core15.Group, { children: [
|
|
2243
|
-
"X Angle:",
|
|
2244
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2245
|
-
import_core15.NumberInput,
|
|
2246
|
-
{
|
|
2247
|
-
size: "xs",
|
|
2248
|
-
w: 100,
|
|
2249
|
-
value: xAngle,
|
|
2250
|
-
onChange: (e) => setXAngle(Number(e)),
|
|
2251
|
-
step: 0.01
|
|
2252
|
-
}
|
|
2253
|
-
)
|
|
2254
|
-
] }),
|
|
2255
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core15.Group, { children: [
|
|
2256
|
-
"Y Angle:",
|
|
2257
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2258
|
-
import_core15.NumberInput,
|
|
2259
|
-
{
|
|
2260
|
-
size: "xs",
|
|
2261
|
-
w: 100,
|
|
2262
|
-
value: yAngle,
|
|
2263
|
-
onChange: (e) => setYAngle(Number(e)),
|
|
2264
|
-
step: 0.01
|
|
2265
|
-
}
|
|
2266
|
-
)
|
|
2267
|
-
] }),
|
|
2268
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core15.Group, { children: [
|
|
2269
|
-
"Z Angle:",
|
|
2270
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2271
|
-
import_core15.NumberInput,
|
|
2272
|
-
{
|
|
2273
|
-
size: "xs",
|
|
2274
|
-
w: 100,
|
|
2275
|
-
value: zAngle,
|
|
2276
|
-
onChange: (e) => setZAngle(Number(e)),
|
|
2277
|
-
step: 0.01
|
|
2278
|
-
}
|
|
2279
|
-
)
|
|
2280
|
-
] })
|
|
2281
|
-
] }),
|
|
2282
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_layout28.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2283
|
-
] });
|
|
2284
|
-
}
|
|
2285
|
-
var noise_rotate_point_node_default = NoiseRotatePointNode;
|
|
2286
|
-
|
|
2287
|
-
// src/nodes/transformers/noise-scale-point-node.tsx
|
|
2288
|
-
var import_layout29 = require("@awesome-flow/core/layout");
|
|
2289
|
-
var import_react37 = require("react");
|
|
2290
|
-
var import_hooks31 = require("@awesome-flow/core/hooks");
|
|
2291
|
-
var import_core16 = require("@mantine/core");
|
|
2292
|
-
var import_transformer3 = require("libnoise-ts/module/transformer");
|
|
2293
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2294
|
-
function NoiseScalePointNode({
|
|
2295
|
-
id,
|
|
2296
|
-
selected,
|
|
2297
|
-
data,
|
|
2298
|
-
type
|
|
2299
|
-
}) {
|
|
2300
|
-
const [xScale, setXScale] = (0, import_react37.useState)(data.xScale);
|
|
2301
|
-
const [yScale, setYScale] = (0, import_react37.useState)(data.yScale);
|
|
2302
|
-
const [zScale, setZScale] = (0, import_react37.useState)(data.zScale);
|
|
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_react37.useEffect)(() => {
|
|
2307
|
-
if (incoming?.length) {
|
|
2308
|
-
const module2 = new import_transformer3.ScalePoint(incoming[0].module, xScale, yScale, zScale);
|
|
2309
|
-
updateComputedData(id, { module: module2 });
|
|
2310
|
-
}
|
|
2311
|
-
updateNodeData(id, { xScale, yScale, zScale });
|
|
2312
|
-
}, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
|
|
2313
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_layout29.NodeContainer, { id, selected, data, type, children: [
|
|
2314
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core16.Stack, { children: [
|
|
2315
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core16.Group, { children: [
|
|
2316
|
-
"X Scale:",
|
|
2317
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2318
|
-
import_core16.NumberInput,
|
|
2319
|
-
{
|
|
2320
|
-
size: "xs",
|
|
2321
|
-
w: 100,
|
|
2322
|
-
value: xScale,
|
|
2323
|
-
onChange: (e) => setXScale(Number(e)),
|
|
2324
|
-
step: 0.01
|
|
2325
|
-
}
|
|
2326
|
-
)
|
|
2327
|
-
] }),
|
|
2328
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core16.Group, { children: [
|
|
2329
|
-
"Y Scale:",
|
|
2330
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2331
|
-
import_core16.NumberInput,
|
|
2332
|
-
{
|
|
2333
|
-
size: "xs",
|
|
2334
|
-
w: 100,
|
|
2335
|
-
value: yScale,
|
|
2336
|
-
onChange: (e) => setYScale(Number(e)),
|
|
2337
|
-
step: 0.01
|
|
2338
|
-
}
|
|
2339
|
-
)
|
|
2340
|
-
] }),
|
|
2341
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core16.Group, { children: [
|
|
2342
|
-
"Z Scale:",
|
|
2343
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2344
|
-
import_core16.NumberInput,
|
|
2345
|
-
{
|
|
2346
|
-
size: "xs",
|
|
2347
|
-
w: 100,
|
|
2348
|
-
value: zScale,
|
|
2349
|
-
onChange: (e) => setZScale(Number(e)),
|
|
2350
|
-
step: 0.01
|
|
2351
|
-
}
|
|
2352
|
-
)
|
|
2353
|
-
] })
|
|
2354
|
-
] }),
|
|
2355
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_layout29.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2356
|
-
] });
|
|
2357
|
-
}
|
|
2358
|
-
var noise_scale_point_node_default = NoiseScalePointNode;
|
|
2359
|
-
|
|
2360
|
-
// src/nodes/transformers/noise-translate-point-node.tsx
|
|
2361
|
-
var import_layout30 = require("@awesome-flow/core/layout");
|
|
2362
|
-
var import_react38 = require("react");
|
|
2363
|
-
var import_hooks32 = require("@awesome-flow/core/hooks");
|
|
2364
|
-
var import_core17 = require("@mantine/core");
|
|
2365
|
-
var import_transformer4 = require("libnoise-ts/module/transformer");
|
|
2366
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2367
|
-
function NoiseTranslatePointNode({
|
|
2368
|
-
id,
|
|
2369
|
-
selected,
|
|
2370
|
-
data,
|
|
2371
|
-
type
|
|
2372
|
-
}) {
|
|
2373
|
-
const [translateX, setTranslateX] = (0, import_react38.useState)(data.translateX);
|
|
2374
|
-
const [translateY, setTranslateY] = (0, import_react38.useState)(data.translateY);
|
|
2375
|
-
const [translateZ, setTranslateZ] = (0, import_react38.useState)(data.translateZ);
|
|
2376
|
-
const incoming = (0, import_hooks32.useIncomingComputedData)(id);
|
|
2377
|
-
const updateNodeData = (0, import_hooks32.useUpdateNodeData)();
|
|
2378
|
-
const updateComputedData = (0, import_hooks32.useUpdateNodeComputedData)();
|
|
2379
|
-
(0, import_react38.useEffect)(() => {
|
|
2380
|
-
if (incoming?.length) {
|
|
2381
|
-
const module2 = new import_transformer4.TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
|
|
2382
|
-
updateComputedData(id, { module: module2 });
|
|
2383
|
-
}
|
|
2384
|
-
updateNodeData(id, { translateX, translateY, translateZ });
|
|
2385
|
-
}, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
|
|
2386
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_layout30.NodeContainer, { id, selected, data, type, children: [
|
|
2387
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core17.Stack, { children: [
|
|
2388
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core17.Group, { children: [
|
|
2389
|
-
"Translate X:",
|
|
2390
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2391
|
-
import_core17.NumberInput,
|
|
2392
|
-
{
|
|
2393
|
-
size: "xs",
|
|
2394
|
-
w: 100,
|
|
2395
|
-
value: translateX,
|
|
2396
|
-
onChange: (e) => setTranslateX(Number(e)),
|
|
2397
|
-
step: 1
|
|
2398
|
-
}
|
|
2399
|
-
)
|
|
2400
|
-
] }),
|
|
2401
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core17.Group, { children: [
|
|
2402
|
-
"Translate Y:",
|
|
2403
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2404
|
-
import_core17.NumberInput,
|
|
2405
|
-
{
|
|
2406
|
-
size: "xs",
|
|
2407
|
-
w: 100,
|
|
2408
|
-
value: translateY,
|
|
2409
|
-
onChange: (e) => setTranslateY(Number(e)),
|
|
2410
|
-
step: 1
|
|
2411
|
-
}
|
|
2412
|
-
)
|
|
2413
|
-
] }),
|
|
2414
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core17.Group, { children: [
|
|
2415
|
-
"Translate Z:",
|
|
2416
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2417
|
-
import_core17.NumberInput,
|
|
2418
|
-
{
|
|
2419
|
-
size: "xs",
|
|
2420
|
-
w: 100,
|
|
2421
|
-
value: translateZ,
|
|
2422
|
-
onChange: (e) => setTranslateZ(Number(e)),
|
|
2423
|
-
step: 1
|
|
2424
|
-
}
|
|
2425
|
-
)
|
|
2426
|
-
] })
|
|
2427
|
-
] }),
|
|
2428
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_layout30.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2429
|
-
] });
|
|
2430
|
-
}
|
|
2431
|
-
var noise_translate_point_node_default = NoiseTranslatePointNode;
|
|
2432
|
-
|
|
2433
|
-
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
2434
|
-
var import_layout31 = require("@awesome-flow/core/layout");
|
|
2435
|
-
var import_react39 = require("react");
|
|
2436
|
-
var import_hooks33 = require("@awesome-flow/core/hooks");
|
|
2437
|
-
var import_transformer5 = require("libnoise-ts/module/transformer");
|
|
2438
|
-
var import_components10 = require("@awesome-flow/core/components");
|
|
2439
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2440
|
-
function NoiseTurbulenceNode({
|
|
2441
|
-
id,
|
|
2442
|
-
selected,
|
|
2443
|
-
data,
|
|
2444
|
-
type
|
|
2445
|
-
}) {
|
|
2446
|
-
const [properties, setProperties] = (0, import_react39.useState)(null);
|
|
2447
|
-
const incoming = (0, import_hooks33.useIncomingComputedData)(id);
|
|
2448
|
-
const updateComputedData = (0, import_hooks33.useUpdateNodeComputedData)();
|
|
2449
|
-
const onPropertiesChange = (0, import_react39.useCallback)((props) => {
|
|
2450
|
-
setProperties(props);
|
|
2451
|
-
}, []);
|
|
2452
|
-
(0, import_react39.useEffect)(() => {
|
|
2453
|
-
if (incoming?.length && properties) {
|
|
2454
|
-
const module2 = new import_transformer5.Turbulence(
|
|
2455
|
-
incoming[0].module,
|
|
2456
|
-
properties.frequency.value,
|
|
2457
|
-
properties.power.value,
|
|
2458
|
-
properties.roughness.value,
|
|
2459
|
-
properties.seed.value
|
|
2460
|
-
);
|
|
2461
|
-
updateComputedData(id, { module: module2 });
|
|
2462
|
-
}
|
|
2463
|
-
}, [id, incoming, properties]);
|
|
2464
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_layout31.NodeContainer, { id, selected, data, type, children: [
|
|
2465
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components10.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
2466
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_layout31.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2467
|
-
] });
|
|
2468
|
-
}
|
|
2469
|
-
var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
2470
|
-
|
|
2471
|
-
// src/templates/generators/noise-checkerboard-template.ts
|
|
2472
|
-
var import_system = require("@xyflow/system");
|
|
2473
|
-
var NoiseCheckerboardNodeTemplateFactory = class {
|
|
2474
|
-
template = {
|
|
2475
|
-
type: "noise-checkerboard" /* noiseCheckerboard */,
|
|
2476
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2477
|
-
data: {
|
|
2478
|
-
title: "Checkerboard Noise"
|
|
2479
|
-
},
|
|
2480
|
-
handles: [
|
|
2481
|
-
{
|
|
2482
|
-
position: import_system.Position.Right,
|
|
2483
|
-
dataType: "module" /* module */,
|
|
2484
|
-
connection: "source"
|
|
2485
|
-
}
|
|
2486
|
-
]
|
|
2487
|
-
};
|
|
2488
|
-
};
|
|
2489
|
-
|
|
2490
|
-
// src/templates/generators/noise-const-template.ts
|
|
2491
|
-
var import_system2 = require("@xyflow/system");
|
|
2492
|
-
var NoiseConstNodeTemplateFactory = class {
|
|
2493
|
-
template = {
|
|
2494
|
-
type: "noise-constant" /* noiseConst */,
|
|
2495
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2496
|
-
data: {
|
|
2497
|
-
title: "Const Value Noise",
|
|
2498
|
-
noise: 0,
|
|
2499
|
-
min: -1,
|
|
2500
|
-
max: 1
|
|
2501
|
-
},
|
|
2502
|
-
handles: [
|
|
2503
|
-
{
|
|
2504
|
-
position: import_system2.Position.Right,
|
|
2505
|
-
dataType: "module" /* module */,
|
|
2506
|
-
connection: "source"
|
|
2507
|
-
}
|
|
2508
|
-
]
|
|
2509
|
-
};
|
|
2510
|
-
};
|
|
2511
|
-
|
|
2512
|
-
// src/templates/generators/noise-cylinders-template.ts
|
|
2513
|
-
var import_abstract5 = require("@awesome-flow/core/abstract");
|
|
2514
|
-
var import_system3 = require("@xyflow/system");
|
|
2515
|
-
var NoiseCylindersNodeTemplateFactory = class {
|
|
2516
|
-
template = {
|
|
2517
|
-
type: "noise-cylinders" /* noiseCylinders */,
|
|
2518
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2519
|
-
data: {
|
|
2520
|
-
title: "Cylinders Noise",
|
|
2521
|
-
frequency: 0.1
|
|
2522
|
-
},
|
|
2523
|
-
handles: [
|
|
2524
|
-
{
|
|
2525
|
-
position: import_system3.Position.Left,
|
|
2526
|
-
dataType: import_abstract5.CoreHandleType.variableProperty,
|
|
2527
|
-
connection: "target"
|
|
2528
|
-
},
|
|
2529
|
-
{
|
|
2530
|
-
position: import_system3.Position.Right,
|
|
2531
|
-
dataType: "module" /* module */,
|
|
2532
|
-
connection: "source"
|
|
2533
|
-
}
|
|
2534
|
-
]
|
|
2535
|
-
};
|
|
2536
|
-
};
|
|
2537
|
-
|
|
2538
|
-
// src/templates/generators/noise-perlin-template.ts
|
|
2539
|
-
var import_abstract6 = require("@awesome-flow/core/abstract");
|
|
2540
|
-
var import_system4 = require("@xyflow/system");
|
|
2541
|
-
var NoisePerlinNodeTemplateFactory = class {
|
|
2542
|
-
template = {
|
|
2543
|
-
type: "noise-perlin" /* noisePerlin */,
|
|
2544
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2545
|
-
data: {
|
|
2546
|
-
title: "Perlin Noise",
|
|
2547
|
-
frequency: 0.1,
|
|
2548
|
-
lacunarity: 2,
|
|
2549
|
-
octaves: 5,
|
|
2550
|
-
persistence: 0.5,
|
|
2551
|
-
seed: 0
|
|
2552
|
-
},
|
|
2553
|
-
handles: [
|
|
2554
|
-
{
|
|
2555
|
-
position: import_system4.Position.Left,
|
|
2556
|
-
dataType: import_abstract6.CoreHandleType.variableProperty,
|
|
2557
|
-
connection: "target"
|
|
2558
|
-
},
|
|
2559
|
-
{
|
|
2560
|
-
position: import_system4.Position.Right,
|
|
2561
|
-
dataType: "module" /* module */,
|
|
2562
|
-
connection: "source"
|
|
2563
|
-
}
|
|
2564
|
-
]
|
|
2565
|
-
};
|
|
2566
|
-
};
|
|
2567
|
-
|
|
2568
|
-
// src/templates/generators/noise-ridgedmulti-template.ts
|
|
2569
|
-
var import_abstract7 = require("@awesome-flow/core/abstract");
|
|
2570
|
-
var import_system5 = require("@xyflow/system");
|
|
2571
|
-
var NoiseRidgedMultiNodeTemplateFactory = class {
|
|
2572
|
-
template = {
|
|
2573
|
-
type: "noise-ridged-multi" /* noiseRidgedMulti */,
|
|
2574
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2575
|
-
data: {
|
|
2576
|
-
title: "Ridged Multi Noise",
|
|
2577
|
-
frequency: 0.1,
|
|
2578
|
-
lacunarity: 2,
|
|
2579
|
-
octaves: 6,
|
|
2580
|
-
offset: 1,
|
|
2581
|
-
gain: 2,
|
|
2582
|
-
seed: 0
|
|
2583
|
-
},
|
|
2584
|
-
handles: [
|
|
2585
|
-
{
|
|
2586
|
-
position: import_system5.Position.Left,
|
|
2587
|
-
dataType: import_abstract7.CoreHandleType.variableProperty,
|
|
2588
|
-
connection: "target"
|
|
2589
|
-
},
|
|
2590
|
-
{
|
|
2591
|
-
position: import_system5.Position.Right,
|
|
2592
|
-
dataType: "module" /* module */,
|
|
2593
|
-
connection: "source"
|
|
2594
|
-
}
|
|
2595
|
-
]
|
|
2596
|
-
};
|
|
2597
|
-
};
|
|
2598
|
-
|
|
2599
|
-
// src/templates/generators/noise-simplex-template.ts
|
|
2600
|
-
var import_abstract8 = require("@awesome-flow/core/abstract");
|
|
2601
|
-
var import_system6 = require("@xyflow/system");
|
|
2602
|
-
var NoiseSimplexNodeTemplateFactory = class {
|
|
2603
|
-
template = {
|
|
2604
|
-
type: "noise-simplex" /* noiseSimplex */,
|
|
2605
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2606
|
-
data: {
|
|
2607
|
-
title: "Simplex Noise"
|
|
2608
|
-
},
|
|
2609
|
-
handles: [
|
|
2610
|
-
{
|
|
2611
|
-
position: import_system6.Position.Left,
|
|
2612
|
-
dataType: import_abstract8.CoreHandleType.variableProperty,
|
|
2613
|
-
connection: "target"
|
|
2614
|
-
},
|
|
2615
|
-
{
|
|
2616
|
-
position: import_system6.Position.Right,
|
|
2617
|
-
dataType: "module" /* module */,
|
|
2618
|
-
connection: "source"
|
|
2619
|
-
}
|
|
2620
|
-
]
|
|
2621
|
-
};
|
|
2622
|
-
};
|
|
2623
|
-
|
|
2624
|
-
// src/templates/generators/noise-spheres-template.ts
|
|
2625
|
-
var import_abstract9 = require("@awesome-flow/core/abstract");
|
|
2626
|
-
var import_system7 = require("@xyflow/system");
|
|
2627
|
-
var NoiseSpheresNodeTemplateFactory = class {
|
|
2628
|
-
template = {
|
|
2629
|
-
type: "noise-spheres" /* noiseSpheres */,
|
|
2630
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2631
|
-
data: {
|
|
2632
|
-
title: "Spheres Noise",
|
|
2633
|
-
frequency: 0.1
|
|
2634
|
-
},
|
|
2635
|
-
handles: [
|
|
2636
|
-
{
|
|
2637
|
-
position: import_system7.Position.Left,
|
|
2638
|
-
dataType: import_abstract9.CoreHandleType.variableProperty,
|
|
2639
|
-
connection: "target"
|
|
2640
|
-
},
|
|
2641
|
-
{
|
|
2642
|
-
position: import_system7.Position.Right,
|
|
2643
|
-
dataType: "module" /* module */,
|
|
2644
|
-
connection: "source"
|
|
2645
|
-
}
|
|
2646
|
-
]
|
|
2647
|
-
};
|
|
2648
|
-
};
|
|
2649
|
-
|
|
2650
|
-
// src/templates/generators/noise-voronoi-template.ts
|
|
2651
|
-
var import_abstract10 = require("@awesome-flow/core/abstract");
|
|
2652
|
-
var import_system8 = require("@xyflow/system");
|
|
2653
|
-
var NoiseVoronoiNodeTemplateFactory = class {
|
|
2654
|
-
template = {
|
|
2655
|
-
type: "noise-voronoi" /* noiseVoronoi */,
|
|
2656
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
2657
|
-
data: {
|
|
2658
|
-
title: "Voronoi Noise",
|
|
2659
|
-
frequency: 0.1,
|
|
2660
|
-
displacement: 1,
|
|
2661
|
-
distance: true,
|
|
2662
|
-
seed: 0
|
|
2663
|
-
},
|
|
2664
|
-
handles: [
|
|
2665
|
-
{
|
|
2666
|
-
position: import_system8.Position.Left,
|
|
2667
|
-
dataType: import_abstract10.CoreHandleType.variableProperty,
|
|
2668
|
-
connection: "target"
|
|
2669
|
-
},
|
|
2670
|
-
{
|
|
2671
|
-
position: import_system8.Position.Right,
|
|
2672
|
-
dataType: "module" /* module */,
|
|
2673
|
-
connection: "source"
|
|
2674
|
-
}
|
|
2675
|
-
]
|
|
2676
|
-
};
|
|
2677
|
-
};
|
|
2678
|
-
|
|
2679
|
-
// src/templates/generators/position-const-template.ts
|
|
2680
|
-
var import_system9 = require("@xyflow/system");
|
|
2681
|
-
var PositionConstNodeTemplateFactory = class {
|
|
2682
|
-
template = {
|
|
2683
|
-
type: "position" /* position */,
|
|
2684
|
-
group: "Positions" /* positions */,
|
|
2685
|
-
data: {
|
|
2686
|
-
title: "Position Output",
|
|
2687
|
-
position: { x: 0, y: 0, z: 0 }
|
|
2688
|
-
},
|
|
2689
|
-
handles: [
|
|
2690
|
-
{
|
|
2691
|
-
position: import_system9.Position.Right,
|
|
2692
|
-
dataType: "position" /* position */,
|
|
2693
|
-
connection: "source"
|
|
2694
|
-
}
|
|
2695
|
-
]
|
|
2696
|
-
};
|
|
2697
|
-
};
|
|
2698
|
-
|
|
2699
|
-
// src/templates/generators/position-grid-template.ts
|
|
2700
|
-
var import_system10 = require("@xyflow/system");
|
|
2701
|
-
var PositionGridNodeTemplateFactory = class {
|
|
2702
|
-
template = {
|
|
2703
|
-
type: "grid" /* grid */,
|
|
2704
|
-
group: "Positions" /* positions */,
|
|
2705
|
-
data: {
|
|
2706
|
-
title: "Grid Output",
|
|
2707
|
-
center: { x: 0, y: 0, z: 0 },
|
|
2708
|
-
radius: 1
|
|
2709
|
-
},
|
|
2710
|
-
handles: [
|
|
2711
|
-
{
|
|
2712
|
-
position: import_system10.Position.Right,
|
|
2713
|
-
dataType: "position" /* position */,
|
|
2714
|
-
connection: "source"
|
|
2715
|
-
}
|
|
2716
|
-
]
|
|
2717
|
-
};
|
|
2718
|
-
};
|
|
2719
|
-
|
|
2720
|
-
// src/templates/modifiers/noise-normalize-template.ts
|
|
2721
|
-
var import_utils = require("@awesome-flow/core/utils");
|
|
2722
|
-
var import_system11 = require("@xyflow/system");
|
|
2723
|
-
var NoiseNormalizeNodeTemplateFactory = class {
|
|
2724
|
-
template = {
|
|
2725
|
-
id: import_utils.IDGenerator.template(),
|
|
2726
|
-
type: "noise-normalize" /* noiseNormalize */,
|
|
2727
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2728
|
-
data: {
|
|
2729
|
-
title: "Normalize Noise",
|
|
2730
|
-
intervalStart: -1,
|
|
2731
|
-
intervalEnd: 1
|
|
2732
|
-
},
|
|
2733
|
-
handles: [
|
|
2734
|
-
{
|
|
2735
|
-
position: import_system11.Position.Left,
|
|
2736
|
-
dataType: "module" /* module */,
|
|
2737
|
-
connection: "target",
|
|
2738
|
-
maxConnections: 1
|
|
2739
|
-
},
|
|
2740
|
-
{
|
|
2741
|
-
position: import_system11.Position.Right,
|
|
2742
|
-
dataType: "module" /* module */,
|
|
2743
|
-
connection: "source"
|
|
2744
|
-
}
|
|
2745
|
-
]
|
|
2746
|
-
};
|
|
2747
|
-
};
|
|
2748
|
-
|
|
2749
|
-
// src/templates/output/noise-logger-template.ts
|
|
2750
|
-
var import_system12 = require("@xyflow/system");
|
|
2751
|
-
var NoiseLoggerNodeTemplateFactory = class {
|
|
2752
|
-
template = {
|
|
2753
|
-
type: "noise-logger" /* noiseLogger */,
|
|
2754
|
-
group: "Output" /* output */,
|
|
2755
|
-
data: {
|
|
2756
|
-
title: "Noise Logger"
|
|
2757
|
-
},
|
|
2758
|
-
handles: [
|
|
2759
|
-
{
|
|
2760
|
-
position: import_system12.Position.Left,
|
|
2761
|
-
dataType: "noise" /* noise */,
|
|
2762
|
-
connection: "target"
|
|
2763
|
-
}
|
|
2764
|
-
]
|
|
2765
|
-
};
|
|
2766
|
-
};
|
|
2767
|
-
|
|
2768
|
-
// src/templates/output/noise-raw-texture-template.ts
|
|
2769
|
-
var import_system13 = require("@xyflow/system");
|
|
2770
|
-
var NoiseRawTextureTemplateFactory = class {
|
|
2771
|
-
template = {
|
|
2772
|
-
type: "texture-data" /* textureData */,
|
|
2773
|
-
group: "Output" /* output */,
|
|
2774
|
-
data: {
|
|
2775
|
-
title: "Texture Data"
|
|
2776
|
-
},
|
|
2777
|
-
handles: [
|
|
2778
|
-
{
|
|
2779
|
-
position: import_system13.Position.Left,
|
|
2780
|
-
dataType: "noise" /* noise */,
|
|
2781
|
-
connection: "target",
|
|
2782
|
-
maxConnections: 1
|
|
2783
|
-
},
|
|
2784
|
-
{
|
|
2785
|
-
position: import_system13.Position.Right,
|
|
2786
|
-
dataType: "texture" /* texture */,
|
|
2787
|
-
connection: "source"
|
|
2788
|
-
}
|
|
2789
|
-
]
|
|
2790
|
-
};
|
|
2791
|
-
};
|
|
2792
|
-
|
|
2793
|
-
// src/templates/output/position-logger-template.ts
|
|
2794
|
-
var import_system14 = require("@xyflow/system");
|
|
2795
|
-
var PositionLoggerNodeTemplateFactory = class {
|
|
2796
|
-
template = {
|
|
2797
|
-
type: "position-logger" /* positionLogger */,
|
|
2798
|
-
group: "Positions" /* positions */,
|
|
2799
|
-
data: {
|
|
2800
|
-
title: "Position Logger"
|
|
2801
|
-
},
|
|
2802
|
-
handles: [
|
|
2803
|
-
{
|
|
2804
|
-
position: import_system14.Position.Left,
|
|
2805
|
-
dataType: "position" /* position */,
|
|
2806
|
-
connection: "target"
|
|
2807
|
-
}
|
|
2808
|
-
]
|
|
2809
|
-
};
|
|
2810
|
-
};
|
|
2811
|
-
|
|
2812
|
-
// src/templates/modifiers/noise-combine-template.ts
|
|
2813
|
-
var import_system15 = require("@xyflow/system");
|
|
2814
|
-
var NoiseCombineNodeTemplateFactory = class {
|
|
2815
|
-
template = {
|
|
2816
|
-
type: "noise-combiner" /* noiseCombine */,
|
|
2817
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2818
|
-
data: {
|
|
2819
|
-
title: "Combine Noise",
|
|
2820
|
-
operation: "add" /* add */
|
|
2821
|
-
},
|
|
2822
|
-
handles: [
|
|
2823
|
-
{
|
|
2824
|
-
position: import_system15.Position.Left,
|
|
2825
|
-
dataType: "module" /* module */,
|
|
2826
|
-
connection: "target",
|
|
2827
|
-
maxConnections: 2
|
|
2828
|
-
},
|
|
2829
|
-
{
|
|
2830
|
-
position: import_system15.Position.Right,
|
|
2831
|
-
dataType: "module" /* module */,
|
|
2832
|
-
connection: "source"
|
|
2833
|
-
}
|
|
2834
|
-
]
|
|
2835
|
-
};
|
|
2836
|
-
};
|
|
2837
|
-
|
|
2838
|
-
// src/templates/modifiers/noise-clamp-template.ts
|
|
2839
|
-
var import_system16 = require("@xyflow/system");
|
|
2840
|
-
var NoiseClampNodeTemplateFactory = class {
|
|
2841
|
-
template = {
|
|
2842
|
-
type: "noise-clamp" /* noiseClamp */,
|
|
2843
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2844
|
-
data: {
|
|
2845
|
-
title: "Clamp Noise",
|
|
2846
|
-
lowerBound: -1,
|
|
2847
|
-
upperBound: 1
|
|
2848
|
-
},
|
|
2849
|
-
handles: [
|
|
2850
|
-
{
|
|
2851
|
-
position: import_system16.Position.Left,
|
|
2852
|
-
dataType: "module" /* module */,
|
|
2853
|
-
connection: "target",
|
|
2854
|
-
maxConnections: 1
|
|
2855
|
-
},
|
|
2856
|
-
{
|
|
2857
|
-
position: import_system16.Position.Right,
|
|
2858
|
-
dataType: "module" /* module */,
|
|
2859
|
-
connection: "source"
|
|
2860
|
-
}
|
|
2861
|
-
]
|
|
2862
|
-
};
|
|
2863
|
-
};
|
|
2864
|
-
|
|
2865
|
-
// src/templates/modifiers/noise-abs-template.ts
|
|
2866
|
-
var import_system17 = require("@xyflow/system");
|
|
2867
|
-
var NoiseAbsNodeTemplateFactory = class {
|
|
2868
|
-
template = {
|
|
2869
|
-
type: "noise-abs" /* noiseAbs */,
|
|
2870
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2871
|
-
data: {
|
|
2872
|
-
title: "Abs Noise"
|
|
2873
|
-
},
|
|
2874
|
-
handles: [
|
|
2875
|
-
{
|
|
2876
|
-
position: import_system17.Position.Left,
|
|
2877
|
-
dataType: "module" /* module */,
|
|
2878
|
-
connection: "target",
|
|
2879
|
-
maxConnections: 1
|
|
2880
|
-
},
|
|
2881
|
-
{
|
|
2882
|
-
position: import_system17.Position.Right,
|
|
2883
|
-
dataType: "module" /* module */,
|
|
2884
|
-
connection: "source"
|
|
2885
|
-
}
|
|
2886
|
-
]
|
|
2887
|
-
};
|
|
2888
|
-
};
|
|
2889
|
-
|
|
2890
|
-
// src/templates/output/noise-output-template.ts
|
|
2891
|
-
var import_system18 = require("@xyflow/system");
|
|
2892
|
-
var NoiseOutputNodeTemplateFactory = class {
|
|
2893
|
-
template = {
|
|
2894
|
-
type: "noise-output" /* noiseOutput */,
|
|
2895
|
-
group: "Output" /* output */,
|
|
2896
|
-
data: {
|
|
2897
|
-
title: "Noise Output"
|
|
2898
|
-
},
|
|
2899
|
-
handles: [
|
|
2900
|
-
{
|
|
2901
|
-
position: import_system18.Position.Left,
|
|
2902
|
-
dataType: "position" /* position */,
|
|
2903
|
-
connection: "target"
|
|
2904
|
-
},
|
|
2905
|
-
{
|
|
2906
|
-
position: import_system18.Position.Left,
|
|
2907
|
-
dataType: "module" /* module */,
|
|
2908
|
-
connection: "target",
|
|
2909
|
-
maxConnections: 1
|
|
2910
|
-
},
|
|
2911
|
-
{
|
|
2912
|
-
position: import_system18.Position.Right,
|
|
2913
|
-
dataType: "noise" /* noise */,
|
|
2914
|
-
connection: "source"
|
|
2915
|
-
}
|
|
2916
|
-
]
|
|
2917
|
-
};
|
|
2918
|
-
};
|
|
2919
|
-
|
|
2920
|
-
// src/templates/modifiers/noise-curve-template.ts
|
|
2921
|
-
var import_abstract19 = require("@awesome-flow/core/abstract");
|
|
2922
|
-
var import_system19 = require("@xyflow/system");
|
|
2923
|
-
var NoiseCurveNodeTemplateFactory = class {
|
|
2924
|
-
template = {
|
|
2925
|
-
type: "noise-curve" /* noiseCurve */,
|
|
2926
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2927
|
-
data: {
|
|
2928
|
-
title: "Noise Curve",
|
|
2929
|
-
points: []
|
|
2930
|
-
},
|
|
2931
|
-
handles: [
|
|
2932
|
-
{
|
|
2933
|
-
position: import_system19.Position.Left,
|
|
2934
|
-
dataType: "module" /* module */,
|
|
2935
|
-
connection: "target",
|
|
2936
|
-
maxConnections: 1
|
|
2937
|
-
},
|
|
2938
|
-
{
|
|
2939
|
-
position: import_system19.Position.Left,
|
|
2940
|
-
dataType: import_abstract19.CoreHandleType.variableProperty,
|
|
2941
|
-
connection: "target"
|
|
2942
|
-
},
|
|
2943
|
-
{
|
|
2944
|
-
position: import_system19.Position.Right,
|
|
2945
|
-
dataType: "module" /* module */,
|
|
2946
|
-
connection: "source"
|
|
2947
|
-
}
|
|
2948
|
-
]
|
|
2949
|
-
};
|
|
2950
|
-
};
|
|
2951
|
-
|
|
2952
|
-
// src/templates/modifiers/noise-exponent-template.ts
|
|
2953
|
-
var import_system20 = require("@xyflow/system");
|
|
2954
|
-
var NoiseExponentNodeTemplateFactory = class {
|
|
2955
|
-
template = {
|
|
2956
|
-
type: "noise-exponent" /* noiseExponent */,
|
|
2957
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2958
|
-
data: {
|
|
2959
|
-
title: "Noise Exponent",
|
|
2960
|
-
exponent: 1
|
|
2961
|
-
},
|
|
2962
|
-
handles: [
|
|
2963
|
-
{
|
|
2964
|
-
position: import_system20.Position.Left,
|
|
2965
|
-
dataType: "module" /* module */,
|
|
2966
|
-
connection: "target",
|
|
2967
|
-
maxConnections: 1
|
|
2968
|
-
},
|
|
2969
|
-
{
|
|
2970
|
-
position: import_system20.Position.Right,
|
|
2971
|
-
dataType: "module" /* module */,
|
|
2972
|
-
connection: "source"
|
|
2973
|
-
}
|
|
2974
|
-
]
|
|
2975
|
-
};
|
|
2976
|
-
};
|
|
2977
|
-
|
|
2978
|
-
// src/templates/modifiers/noise-invert-template.ts
|
|
2979
|
-
var import_system21 = require("@xyflow/system");
|
|
2980
|
-
var NoiseInvertNodeTemplateFactory = class {
|
|
2981
|
-
template = {
|
|
2982
|
-
type: "noise-invert" /* noiseInvert */,
|
|
2983
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2984
|
-
data: {
|
|
2985
|
-
title: "Invert Noise"
|
|
2986
|
-
},
|
|
2987
|
-
handles: [
|
|
2988
|
-
{
|
|
2989
|
-
position: import_system21.Position.Left,
|
|
2990
|
-
dataType: "module" /* module */,
|
|
2991
|
-
connection: "target",
|
|
2992
|
-
maxConnections: 1
|
|
2993
|
-
},
|
|
2994
|
-
{
|
|
2995
|
-
position: import_system21.Position.Right,
|
|
2996
|
-
dataType: "module" /* module */,
|
|
2997
|
-
connection: "source"
|
|
2998
|
-
}
|
|
2999
|
-
]
|
|
3000
|
-
};
|
|
3001
|
-
};
|
|
3002
|
-
|
|
3003
|
-
// src/templates/modifiers/noise-scalebias-template.ts
|
|
3004
|
-
var import_system22 = require("@xyflow/system");
|
|
3005
|
-
var NoiseScaleBiasNodeTemplateFactory = class {
|
|
3006
|
-
template = {
|
|
3007
|
-
type: "noise-scale-bias" /* noiseScaleBias */,
|
|
3008
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
3009
|
-
data: {
|
|
3010
|
-
title: "Scale/Bias Noise",
|
|
3011
|
-
scale: 1,
|
|
3012
|
-
bias: 0
|
|
3013
|
-
},
|
|
3014
|
-
handles: [
|
|
3015
|
-
{
|
|
3016
|
-
position: import_system22.Position.Left,
|
|
3017
|
-
dataType: "module" /* module */,
|
|
3018
|
-
connection: "target",
|
|
3019
|
-
maxConnections: 1
|
|
3020
|
-
},
|
|
3021
|
-
{
|
|
3022
|
-
position: import_system22.Position.Right,
|
|
3023
|
-
dataType: "module" /* module */,
|
|
3024
|
-
connection: "source"
|
|
3025
|
-
}
|
|
3026
|
-
]
|
|
3027
|
-
};
|
|
3028
|
-
};
|
|
3029
|
-
|
|
3030
|
-
// src/templates/modifiers/noise-terrace-template.ts
|
|
3031
|
-
var import_system23 = require("@xyflow/system");
|
|
3032
|
-
var NoiseTerraceNodeTemplateFactory = class {
|
|
3033
|
-
template = {
|
|
3034
|
-
type: "noise-terrace" /* noiseTerrace */,
|
|
3035
|
-
group: "Noise Modifiers" /* noiseModifiers */,
|
|
3036
|
-
data: {
|
|
3037
|
-
title: "Noise Terrace",
|
|
3038
|
-
points: []
|
|
3039
|
-
},
|
|
3040
|
-
handles: [
|
|
3041
|
-
{
|
|
3042
|
-
position: import_system23.Position.Left,
|
|
3043
|
-
dataType: "module" /* module */,
|
|
3044
|
-
connection: "target",
|
|
3045
|
-
maxConnections: 1
|
|
3046
|
-
},
|
|
3047
|
-
{
|
|
3048
|
-
position: import_system23.Position.Right,
|
|
3049
|
-
dataType: "module" /* module */,
|
|
3050
|
-
connection: "source"
|
|
3051
|
-
}
|
|
3052
|
-
]
|
|
3053
|
-
};
|
|
3054
|
-
};
|
|
3055
|
-
|
|
3056
|
-
// src/templates/selectors/noise-blend-template.ts
|
|
3057
|
-
var import_system24 = require("@xyflow/system");
|
|
3058
|
-
var NoiseBlendNodeTemplateFactory = class {
|
|
3059
|
-
template = {
|
|
3060
|
-
type: "noise-blend" /* noiseBlend */,
|
|
3061
|
-
group: "Noise Selectors" /* noiseSelectors */,
|
|
3062
|
-
data: {
|
|
3063
|
-
title: "Noise Blend"
|
|
3064
|
-
},
|
|
3065
|
-
handles: [
|
|
3066
|
-
{
|
|
3067
|
-
position: import_system24.Position.Left,
|
|
3068
|
-
dataType: "module" /* module */,
|
|
3069
|
-
connection: "target",
|
|
3070
|
-
label: "Source Modules",
|
|
3071
|
-
dataId: "source" /* source */,
|
|
3072
|
-
maxConnections: 2,
|
|
3073
|
-
minConnections: 2
|
|
3074
|
-
},
|
|
3075
|
-
{
|
|
3076
|
-
position: import_system24.Position.Left,
|
|
3077
|
-
dataType: "module" /* module */,
|
|
3078
|
-
dataId: "control" /* control */,
|
|
3079
|
-
connection: "target",
|
|
3080
|
-
label: "Control Module",
|
|
3081
|
-
maxConnections: 1
|
|
3082
|
-
},
|
|
3083
|
-
{
|
|
3084
|
-
position: import_system24.Position.Right,
|
|
3085
|
-
dataType: "module" /* module */,
|
|
3086
|
-
dataId: "output" /* output */,
|
|
3087
|
-
connection: "source"
|
|
3088
|
-
}
|
|
3089
|
-
]
|
|
3090
|
-
};
|
|
3091
|
-
};
|
|
3092
|
-
|
|
3093
|
-
// src/templates/selectors/noise-select-template.ts
|
|
3094
|
-
var import_system25 = require("@xyflow/system");
|
|
3095
|
-
var NoiseSelectNodeTemplateFactory = class {
|
|
3096
|
-
template = {
|
|
3097
|
-
type: "noise-select" /* noiseSelect */,
|
|
3098
|
-
group: "Noise Selectors" /* noiseSelectors */,
|
|
3099
|
-
data: {
|
|
3100
|
-
title: "Noise Select",
|
|
3101
|
-
edgeFalloff: 0,
|
|
3102
|
-
lowerBound: -1,
|
|
3103
|
-
upperBound: 1
|
|
3104
|
-
},
|
|
3105
|
-
handles: [
|
|
3106
|
-
{
|
|
3107
|
-
position: import_system25.Position.Left,
|
|
3108
|
-
dataType: "module" /* module */,
|
|
3109
|
-
dataId: "source" /* source */,
|
|
3110
|
-
connection: "target",
|
|
3111
|
-
label: "Source Modules",
|
|
3112
|
-
maxConnections: 2,
|
|
3113
|
-
minConnections: 2
|
|
3114
|
-
},
|
|
3115
|
-
{
|
|
3116
|
-
position: import_system25.Position.Left,
|
|
3117
|
-
dataType: "module" /* module */,
|
|
3118
|
-
dataId: "control" /* control */,
|
|
3119
|
-
connection: "target",
|
|
3120
|
-
label: "Control Module",
|
|
3121
|
-
maxConnections: 1
|
|
3122
|
-
},
|
|
3123
|
-
{
|
|
3124
|
-
position: import_system25.Position.Right,
|
|
3125
|
-
dataType: "module" /* module */,
|
|
3126
|
-
dataId: "output" /* output */,
|
|
3127
|
-
connection: "source"
|
|
3128
|
-
}
|
|
3129
|
-
]
|
|
3130
|
-
};
|
|
3131
|
-
};
|
|
3132
|
-
|
|
3133
|
-
// src/templates/transformers/noise-displace-template.ts
|
|
3134
|
-
var import_system26 = require("@xyflow/system");
|
|
3135
|
-
var NoiseDisplaceNodeTemplateFactory = class {
|
|
3136
|
-
template = {
|
|
3137
|
-
type: "noise-displace" /* noiseDisplace */,
|
|
3138
|
-
group: "Noise Transformers" /* noiseTransformers */,
|
|
3139
|
-
data: {
|
|
3140
|
-
title: "Noise Displace"
|
|
3141
|
-
},
|
|
3142
|
-
handles: [
|
|
3143
|
-
{
|
|
3144
|
-
position: import_system26.Position.Left,
|
|
3145
|
-
connection: "target",
|
|
3146
|
-
label: "Source Module",
|
|
3147
|
-
dataType: "module" /* module */,
|
|
3148
|
-
dataId: "source" /* sourceModule */,
|
|
3149
|
-
maxConnections: 1
|
|
3150
|
-
},
|
|
3151
|
-
{
|
|
3152
|
-
position: import_system26.Position.Left,
|
|
3153
|
-
connection: "target",
|
|
3154
|
-
label: "X Module",
|
|
3155
|
-
dataType: "module" /* module */,
|
|
3156
|
-
dataId: "x-module" /* xModule */,
|
|
3157
|
-
maxConnections: 1
|
|
3158
|
-
},
|
|
3159
|
-
{
|
|
3160
|
-
position: import_system26.Position.Left,
|
|
3161
|
-
connection: "target",
|
|
3162
|
-
label: "Y Module",
|
|
3163
|
-
dataType: "module" /* module */,
|
|
3164
|
-
dataId: "y-module" /* yModule */,
|
|
3165
|
-
maxConnections: 1
|
|
3166
|
-
},
|
|
3167
|
-
{
|
|
3168
|
-
position: import_system26.Position.Left,
|
|
3169
|
-
connection: "target",
|
|
3170
|
-
label: "Z Module",
|
|
3171
|
-
dataType: "module" /* module */,
|
|
3172
|
-
dataId: "z-module" /* zModule */,
|
|
3173
|
-
maxConnections: 1
|
|
3174
|
-
},
|
|
3175
|
-
{
|
|
3176
|
-
position: import_system26.Position.Right,
|
|
3177
|
-
dataType: "module" /* module */,
|
|
3178
|
-
dataId: "output" /* output */,
|
|
3179
|
-
connection: "source"
|
|
3180
|
-
}
|
|
3181
|
-
]
|
|
3182
|
-
};
|
|
3183
|
-
};
|
|
3184
|
-
|
|
3185
|
-
// src/templates/transformers/noise-rotate-point-template.ts
|
|
3186
|
-
var import_system27 = require("@xyflow/system");
|
|
3187
|
-
var NoiseRotatePointNodeTemplateFactory = class {
|
|
3188
|
-
template = {
|
|
3189
|
-
type: "noise-rotate-point" /* noiseRotatePoint */,
|
|
3190
|
-
group: "Noise Transformers" /* noiseTransformers */,
|
|
3191
|
-
data: {
|
|
3192
|
-
title: "Noise Rotate Point",
|
|
3193
|
-
xAngle: 0,
|
|
3194
|
-
yAngle: 0,
|
|
3195
|
-
zAngle: 0
|
|
3196
|
-
},
|
|
3197
|
-
handles: [
|
|
3198
|
-
{
|
|
3199
|
-
position: import_system27.Position.Left,
|
|
3200
|
-
dataType: "module" /* module */,
|
|
3201
|
-
connection: "target",
|
|
3202
|
-
label: "Source Module",
|
|
3203
|
-
maxConnections: 1
|
|
3204
|
-
},
|
|
3205
|
-
{
|
|
3206
|
-
position: import_system27.Position.Right,
|
|
3207
|
-
dataType: "module" /* module */,
|
|
3208
|
-
connection: "source"
|
|
3209
|
-
}
|
|
3210
|
-
]
|
|
3211
|
-
};
|
|
3212
|
-
};
|
|
3213
|
-
|
|
3214
|
-
// src/templates/transformers/noise-scale-point-template.ts
|
|
3215
|
-
var import_system28 = require("@xyflow/system");
|
|
3216
|
-
var NoiseScalePointNodeTemplateFactory = class {
|
|
3217
|
-
template = {
|
|
3218
|
-
type: "noise-scale-point" /* noiseScalePoint */,
|
|
3219
|
-
group: "Noise Transformers" /* noiseTransformers */,
|
|
3220
|
-
data: {
|
|
3221
|
-
title: "Noise Scale Point",
|
|
3222
|
-
xScale: 1,
|
|
3223
|
-
yScale: 1,
|
|
3224
|
-
zScale: 1
|
|
3225
|
-
},
|
|
3226
|
-
handles: [
|
|
3227
|
-
{
|
|
3228
|
-
position: import_system28.Position.Left,
|
|
3229
|
-
dataType: "module" /* module */,
|
|
3230
|
-
connection: "target",
|
|
3231
|
-
label: "Source Module",
|
|
3232
|
-
maxConnections: 1
|
|
3233
|
-
},
|
|
3234
|
-
{
|
|
3235
|
-
position: import_system28.Position.Right,
|
|
3236
|
-
dataType: "module" /* module */,
|
|
3237
|
-
connection: "source"
|
|
3238
|
-
}
|
|
3239
|
-
]
|
|
3240
|
-
};
|
|
3241
|
-
};
|
|
3242
|
-
|
|
3243
|
-
// src/templates/transformers/noise-translate-point-template.ts
|
|
3244
|
-
var import_system29 = require("@xyflow/system");
|
|
3245
|
-
var NoiseTranslatePointNodeTemplateFactory = class {
|
|
3246
|
-
template = {
|
|
3247
|
-
type: "noise-translate-point" /* noiseTranslatePoint */,
|
|
3248
|
-
group: "Noise Transformers" /* noiseTransformers */,
|
|
3249
|
-
data: {
|
|
3250
|
-
title: "Noise Translate Point",
|
|
3251
|
-
translateX: 0,
|
|
3252
|
-
translateY: 0,
|
|
3253
|
-
translateZ: 0
|
|
3254
|
-
},
|
|
3255
|
-
handles: [
|
|
3256
|
-
{
|
|
3257
|
-
position: import_system29.Position.Left,
|
|
3258
|
-
dataType: "module" /* module */,
|
|
3259
|
-
connection: "target",
|
|
3260
|
-
label: "Source Module",
|
|
3261
|
-
maxConnections: 1
|
|
3262
|
-
},
|
|
3263
|
-
{
|
|
3264
|
-
position: import_system29.Position.Right,
|
|
3265
|
-
dataType: "module" /* module */,
|
|
3266
|
-
connection: "source"
|
|
3267
|
-
}
|
|
3268
|
-
]
|
|
3269
|
-
};
|
|
3270
|
-
};
|
|
3271
|
-
|
|
3272
|
-
// src/templates/transformers/noise-turbulence-template.ts
|
|
3273
|
-
var import_abstract31 = require("@awesome-flow/core/abstract");
|
|
3274
|
-
var import_system30 = require("@xyflow/system");
|
|
3275
|
-
var NoiseTurbulenceNodeTemplateFactory = class {
|
|
3276
|
-
template = {
|
|
3277
|
-
type: "noise-turbulence" /* noiseTurbulence */,
|
|
3278
|
-
group: "Noise Transformers" /* noiseTransformers */,
|
|
3279
|
-
data: {
|
|
3280
|
-
title: "Noise Turbulence",
|
|
3281
|
-
frequency: 1,
|
|
3282
|
-
power: 1,
|
|
3283
|
-
roughness: 1,
|
|
3284
|
-
seed: 0
|
|
3285
|
-
},
|
|
3286
|
-
handles: [
|
|
3287
|
-
{
|
|
3288
|
-
position: import_system30.Position.Left,
|
|
3289
|
-
dataType: "module" /* module */,
|
|
3290
|
-
connection: "target",
|
|
3291
|
-
label: "Source Module",
|
|
3292
|
-
maxConnections: 1
|
|
3293
|
-
},
|
|
3294
|
-
{
|
|
3295
|
-
position: import_system30.Position.Left,
|
|
3296
|
-
dataType: import_abstract31.CoreHandleType.variableProperty,
|
|
3297
|
-
label: "Variable Properties",
|
|
3298
|
-
connection: "target"
|
|
3299
|
-
},
|
|
3300
|
-
{
|
|
3301
|
-
position: import_system30.Position.Right,
|
|
3302
|
-
dataType: "module" /* module */,
|
|
3303
|
-
connection: "source"
|
|
3304
|
-
}
|
|
3305
|
-
]
|
|
3306
|
-
};
|
|
3307
|
-
};
|
|
3308
|
-
|
|
3309
|
-
// src/templates/generators/noise-billow-template.ts
|
|
3310
|
-
var import_abstract33 = require("@awesome-flow/core/abstract");
|
|
3311
|
-
var import_utils2 = require("@awesome-flow/core/utils");
|
|
3312
|
-
var import_system31 = require("@xyflow/system");
|
|
3313
|
-
var NoiseBillowNodeTemplateFactory = class {
|
|
3314
|
-
template = {
|
|
3315
|
-
id: import_utils2.IDGenerator.template(),
|
|
3316
|
-
type: "noise-billow" /* noiseBillow */,
|
|
3317
|
-
group: "Noise Generators" /* noiseGenerators */,
|
|
3318
|
-
data: {
|
|
3319
|
-
title: "Billow Noise",
|
|
3320
|
-
frequency: 0.1,
|
|
3321
|
-
lacunarity: 2,
|
|
3322
|
-
octaves: 5,
|
|
3323
|
-
persistence: 0.5,
|
|
3324
|
-
seed: 0
|
|
3325
|
-
},
|
|
3326
|
-
handles: [
|
|
3327
|
-
{
|
|
3328
|
-
position: import_system31.Position.Left,
|
|
3329
|
-
dataType: import_abstract33.CoreHandleType.variableProperty,
|
|
3330
|
-
connection: "target"
|
|
3331
|
-
},
|
|
3332
|
-
{
|
|
3333
|
-
position: import_system31.Position.Right,
|
|
3334
|
-
dataType: "module" /* module */,
|
|
3335
|
-
connection: "source"
|
|
3336
|
-
}
|
|
3337
|
-
]
|
|
3338
|
-
};
|
|
3339
|
-
};
|
|
3340
|
-
|
|
3341
|
-
// src/templates/groups/module-group-template.ts
|
|
3342
|
-
var import_abstract34 = require("@awesome-flow/core/abstract");
|
|
3343
|
-
var import_utils3 = require("@awesome-flow/core/utils");
|
|
3344
|
-
var import_system32 = require("@xyflow/system");
|
|
3345
|
-
var ModuleGroupNodeTemplateFactory = class {
|
|
3346
|
-
template = {
|
|
3347
|
-
id: import_utils3.IDGenerator.template(),
|
|
3348
|
-
type: "group-module" /* groupModule */,
|
|
3349
|
-
group: import_abstract34.CoreTemplateGroup.groups,
|
|
3350
|
-
data: {
|
|
3351
|
-
title: "Modules Group",
|
|
3352
|
-
isGroup: true,
|
|
3353
|
-
initialSize: {
|
|
3354
|
-
width: 300,
|
|
3355
|
-
height: 200
|
|
3356
|
-
},
|
|
3357
|
-
collapsedSize: {
|
|
3358
|
-
width: 300,
|
|
3359
|
-
height: 80
|
|
3360
|
-
}
|
|
3361
|
-
},
|
|
3362
|
-
handles: [
|
|
3363
|
-
{
|
|
3364
|
-
position: import_system32.Position.Bottom,
|
|
3365
|
-
dataType: "module" /* module */,
|
|
3366
|
-
connection: "target",
|
|
3367
|
-
maxConnections: 1,
|
|
3368
|
-
hideOnCollapse: true
|
|
3369
|
-
},
|
|
3370
|
-
{
|
|
3371
|
-
position: import_system32.Position.Right,
|
|
3372
|
-
dataType: "module" /* module */,
|
|
3373
|
-
connection: "source"
|
|
3374
|
-
}
|
|
3375
|
-
]
|
|
3376
|
-
};
|
|
3377
|
-
};
|
|
3378
|
-
|
|
3379
|
-
// src/abstract/node-types.ts
|
|
3380
|
-
var noiseNodeTemplates = {
|
|
3381
|
-
["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
|
|
3382
|
-
["noise-simplex" /* noiseSimplex */]: new NoiseSimplexNodeTemplateFactory(),
|
|
3383
|
-
["noise-billow" /* noiseBillow */]: new NoiseBillowNodeTemplateFactory(),
|
|
3384
|
-
["noise-checkerboard" /* noiseCheckerboard */]: new NoiseCheckerboardNodeTemplateFactory(),
|
|
3385
|
-
["noise-normalize" /* noiseNormalize */]: new NoiseNormalizeNodeTemplateFactory(),
|
|
3386
|
-
["noise-logger" /* noiseLogger */]: new NoiseLoggerNodeTemplateFactory(),
|
|
3387
|
-
["noise-constant" /* noiseConst */]: new NoiseConstNodeTemplateFactory(),
|
|
3388
|
-
["position" /* position */]: new PositionConstNodeTemplateFactory(),
|
|
3389
|
-
["position-logger" /* positionLogger */]: new PositionLoggerNodeTemplateFactory(),
|
|
3390
|
-
["grid" /* grid */]: new PositionGridNodeTemplateFactory(),
|
|
3391
|
-
["texture-data" /* textureData */]: new NoiseRawTextureTemplateFactory(),
|
|
3392
|
-
["noise-cylinders" /* noiseCylinders */]: new NoiseCylindersNodeTemplateFactory(),
|
|
3393
|
-
["noise-perlin" /* noisePerlin */]: new NoisePerlinNodeTemplateFactory(),
|
|
3394
|
-
["noise-ridged-multi" /* noiseRidgedMulti */]: new NoiseRidgedMultiNodeTemplateFactory(),
|
|
3395
|
-
["noise-spheres" /* noiseSpheres */]: new NoiseSpheresNodeTemplateFactory(),
|
|
3396
|
-
["noise-voronoi" /* noiseVoronoi */]: new NoiseVoronoiNodeTemplateFactory(),
|
|
3397
|
-
["noise-combiner" /* noiseCombine */]: new NoiseCombineNodeTemplateFactory(),
|
|
3398
|
-
["noise-clamp" /* noiseClamp */]: new NoiseClampNodeTemplateFactory(),
|
|
3399
|
-
["noise-abs" /* noiseAbs */]: new NoiseAbsNodeTemplateFactory(),
|
|
3400
|
-
["noise-curve" /* noiseCurve */]: new NoiseCurveNodeTemplateFactory(),
|
|
3401
|
-
["noise-exponent" /* noiseExponent */]: new NoiseExponentNodeTemplateFactory(),
|
|
3402
|
-
["noise-invert" /* noiseInvert */]: new NoiseInvertNodeTemplateFactory(),
|
|
3403
|
-
["noise-scale-bias" /* noiseScaleBias */]: new NoiseScaleBiasNodeTemplateFactory(),
|
|
3404
|
-
["noise-terrace" /* noiseTerrace */]: new NoiseTerraceNodeTemplateFactory(),
|
|
3405
|
-
["noise-blend" /* noiseBlend */]: new NoiseBlendNodeTemplateFactory(),
|
|
3406
|
-
["noise-select" /* noiseSelect */]: new NoiseSelectNodeTemplateFactory(),
|
|
3407
|
-
["noise-displace" /* noiseDisplace */]: new NoiseDisplaceNodeTemplateFactory(),
|
|
3408
|
-
["noise-rotate-point" /* noiseRotatePoint */]: new NoiseRotatePointNodeTemplateFactory(),
|
|
3409
|
-
["noise-scale-point" /* noiseScalePoint */]: new NoiseScalePointNodeTemplateFactory(),
|
|
3410
|
-
["noise-translate-point" /* noiseTranslatePoint */]: new NoiseTranslatePointNodeTemplateFactory(),
|
|
3411
|
-
["noise-turbulence" /* noiseTurbulence */]: new NoiseTurbulenceNodeTemplateFactory(),
|
|
3412
|
-
["group-module" /* groupModule */]: new ModuleGroupNodeTemplateFactory()
|
|
3413
|
-
};
|
|
3414
|
-
|
|
3415
|
-
// src/nodes/output/noise-output-node.tsx
|
|
3416
|
-
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3417
|
-
function NoiseOutputNode({ id, selected, data, type }) {
|
|
3418
|
-
const [size, setSize] = (0, import_react40.useState)(0);
|
|
3419
|
-
const updateComputedData = (0, import_hooks34.useUpdateNodeComputedData)();
|
|
3420
|
-
const onDataUpdated = (0, import_react40.useCallback)(
|
|
3421
|
-
(handleData) => {
|
|
3422
|
-
const incomingPositions = handleData["position" /* position */];
|
|
3423
|
-
const incomingModule = handleData["module" /* module */];
|
|
3424
|
-
if (incomingPositions?.length && incomingModule?.length && incomingModule[0]?.module) {
|
|
3425
|
-
const { module: module2 } = incomingModule[0];
|
|
3426
|
-
const noise = [];
|
|
3427
|
-
for (const input of incomingPositions) {
|
|
3428
|
-
for (const position of input.positions) {
|
|
3429
|
-
const value = module2.getValue(position.x, position.y, position.z);
|
|
3430
|
-
noise.push({
|
|
3431
|
-
position,
|
|
3432
|
-
value
|
|
3433
|
-
});
|
|
3434
|
-
}
|
|
3435
|
-
}
|
|
3436
|
-
updateComputedData(id, { noise, module: module2 });
|
|
3437
|
-
setSize(noise.length);
|
|
3438
|
-
}
|
|
3439
|
-
},
|
|
3440
|
-
[]
|
|
3441
|
-
);
|
|
3442
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_layout32.NodeContainer, { id, selected, data, type, children: [
|
|
3443
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3444
|
-
import_components11.HandlesIncomingDataStatus,
|
|
3445
|
-
{
|
|
3446
|
-
nodeId: id,
|
|
3447
|
-
handles: data.handles,
|
|
3448
|
-
handleKey: "dataType",
|
|
3449
|
-
onDataUpdated,
|
|
3450
|
-
type: "target",
|
|
3451
|
-
resetComputedData: true
|
|
3452
|
-
}
|
|
3453
|
-
),
|
|
3454
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_core18.Text, { mt: 5, children: [
|
|
3455
|
-
"Noise points: ",
|
|
3456
|
-
size
|
|
3457
|
-
] }),
|
|
3458
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_layout32.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
3459
|
-
] });
|
|
3460
|
-
}
|
|
3461
|
-
var noise_output_node_default = NoiseOutputNode;
|
|
3462
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
3463
|
-
0 && (module.exports = {
|
|
3464
|
-
ModuleGroupNode,
|
|
3465
|
-
NoiseAbsNode,
|
|
3466
|
-
NoiseBillowNode,
|
|
3467
|
-
NoiseBlendNode,
|
|
3468
|
-
NoiseCheckerboardNode,
|
|
3469
|
-
NoiseClampNode,
|
|
3470
|
-
NoiseCombineNode,
|
|
3471
|
-
NoiseConstNode,
|
|
3472
|
-
NoiseCurveNode,
|
|
3473
|
-
NoiseCylindersNode,
|
|
3474
|
-
NoiseDisplaceNode,
|
|
3475
|
-
NoiseExponentNode,
|
|
3476
|
-
NoiseInvertNode,
|
|
3477
|
-
NoiseLoggerNode,
|
|
3478
|
-
NoiseNormalizeNode,
|
|
3479
|
-
NoiseOutputNode,
|
|
3480
|
-
NoisePerlinNode,
|
|
3481
|
-
NoiseRawTextureNode,
|
|
3482
|
-
NoiseRidgedMultiNode,
|
|
3483
|
-
NoiseRotatePointNode,
|
|
3484
|
-
NoiseScaleBiasNode,
|
|
3485
|
-
NoiseScalePointNode,
|
|
3486
|
-
NoiseSelectNode,
|
|
3487
|
-
NoiseSimplexNode,
|
|
3488
|
-
NoiseSpheresNode,
|
|
3489
|
-
NoiseTerraceNode,
|
|
3490
|
-
NoiseTranslatePointNode,
|
|
3491
|
-
NoiseTurbulenceNode,
|
|
3492
|
-
NoiseVoronoiNode,
|
|
3493
|
-
PositionConstNode,
|
|
3494
|
-
PositionGridNode,
|
|
3495
|
-
PositionsLoggerNode
|
|
3496
|
-
});
|
|
1
|
+
var Nt=Object.defineProperty;var $r=Object.getOwnPropertyDescriptor;var Kr=Object.getOwnPropertyNames;var Wr=Object.prototype.hasOwnProperty;var _r=(e,i)=>{for(var o in i)Nt(e,o,{get:i[o],enumerable:!0})},Jr=(e,i,o,p)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of Kr(i))!Wr.call(e,t)&&t!==o&&Nt(e,t,{get:()=>i[t],enumerable:!(p=$r(i,t))||p.enumerable});return e};var Qr=e=>Jr(Nt({},"__esModule",{value:!0}),e);var zi={};_r(zi,{ModuleGroupNode:()=>It,NoiseAbsNode:()=>Mt,NoiseBillowNode:()=>ct,NoiseBlendNode:()=>Ot,NoiseCheckerboardNode:()=>ft,NoiseClampNode:()=>St,NoiseCombineNode:()=>wt,NoiseConstNode:()=>yt,NoiseCurveNode:()=>Bt,NoiseCylindersNode:()=>Ct,NoiseDisplaceNode:()=>Yt,NoiseExponentNode:()=>kt,NoiseInvertNode:()=>zt,NoiseLoggerNode:()=>Vt,NoiseNormalizeNode:()=>Rt,NoiseOutputNode:()=>fa,NoisePerlinNode:()=>Tt,NoiseRawTextureNode:()=>Et,NoiseRidgedMultiNode:()=>gt,NoiseRotatePointNode:()=>Zt,NoiseScaleBiasNode:()=>Ft,NoiseScalePointNode:()=>qt,NoiseSelectNode:()=>Xt,NoiseSpheresNode:()=>Dt,NoiseTerraceNode:()=>Ut,NoiseTranslatePointNode:()=>$t,NoiseTurbulenceNode:()=>Kt,NoiseVoronoiNode:()=>ht,PositionConstNode:()=>Pt,PositionGridNode:()=>xt,PositionsLoggerNode:()=>Ht});module.exports=Qr(zi);var ya=require("@awesome-flow/core/components"),Ca=require("@awesome-flow/core/hooks"),Xe=require("@awesome-flow/core/layout"),Ta=require("libnoise-simplex-ts"),ga=require("react"),Be=require("react/jsx-runtime");function jr({id:e,selected:i,data:o,type:p}){let t=(0,Ca.useUpdateNodeComputedData)(),m=(0,ga.useCallback)(a=>{let n=new Ta.Billow;Object.keys(a).forEach(r=>n[r]=a[r].value),t(e,{module:n})},[e]);return(0,Be.jsxs)(Xe.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,Be.jsx)(ya.NodePropertyVariables,{data:o,nodeId:e,onPropertiesChange:m}),(0,Be.jsx)(Xe.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var ct=jr;var Da=require("@awesome-flow/core/hooks"),ha=require("@awesome-flow/core/layout"),Pa=require("libnoise-simplex-ts"),xa=require("react"),Ia=require("react/jsx-runtime");function ei({id:e,selected:i,data:o,type:p}){let t=(0,Da.useUpdateNodeComputedData)();return(0,xa.useEffect)(()=>{let m=new Pa.Checkerboard;t(e,{module:m})},[e]),(0,Ia.jsx)(ha.NodeContainer,{id:e,selected:i,data:o,type:p})}var ft=ei;var Ye=require("@awesome-flow/core/hooks"),ba=require("@awesome-flow/core/layout"),H=require("@mantine/core"),Ma=require("libnoise-simplex-ts"),ne=require("react"),E=require("react/jsx-runtime");function oi({id:e,selected:i,data:o,type:p}){let[t,m]=(0,ne.useState)(o.min),[a,n]=(0,ne.useState)(o.max),[r,d]=(0,ne.useState)(o.noise),N=(0,Ye.useUpdateNodeData)(),s=(0,Ye.useUpdateNodeComputedData)();return(0,ne.useEffect)(()=>{let u=new Ma.Const(r);N(e,{noise:r,min:t,max:a}),s(e,{module:u})},[r,t,a]),(0,E.jsx)(ba.NodeContainer,{id:e,selected:i,data:o,type:p,children:(0,E.jsxs)(H.Stack,{children:[(0,E.jsxs)(H.Group,{children:[(0,E.jsx)(H.NumberInput,{size:"xs",w:100,value:t,onChange:u=>m(Number(u))}),(0,E.jsx)(H.NumberInput,{size:"xs",w:100,value:a,onChange:u=>n(Number(u))})]}),(0,E.jsxs)(H.Group,{children:["noise:",(0,E.jsx)(H.NumberInput,{size:"xs",value:r,onChange:u=>d(Number(u)),max:a,min:t,step:.1})]})]})})}var yt=oi;var Sa=require("@awesome-flow/core/components"),wa=require("@awesome-flow/core/hooks"),Ze=require("@awesome-flow/core/layout"),va=require("libnoise-simplex-ts"),Ba=require("react"),ke=require("react/jsx-runtime");function ti({id:e,selected:i,data:o,type:p}){let t=(0,wa.useUpdateNodeComputedData)(),m=(0,Ba.useCallback)(a=>{let n=new va.Cylinders;Object.keys(a).forEach(r=>n[r]=a[r].value),t(e,{module:n})},[e]);return(0,ke.jsxs)(Ze.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,ke.jsx)(Sa.NodePropertyVariables,{data:o,nodeId:e,onPropertiesChange:m}),(0,ke.jsx)(Ze.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Ct=ti;var ka=require("@awesome-flow/core/components"),Ga=require("@awesome-flow/core/hooks"),qe=require("@awesome-flow/core/layout"),za=require("libnoise-simplex-ts"),Ra=require("react"),Ge=require("react/jsx-runtime");function ai({id:e,selected:i,data:o,type:p}){let t=(0,Ga.useUpdateNodeComputedData)(),m=(0,Ra.useCallback)(a=>{let n=new za.Perlin;Object.keys(a).forEach(r=>n[r]=a[r].value),t(e,{module:n})},[e,t]);return(0,Ge.jsxs)(qe.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,Ge.jsx)(ka.NodePropertyVariables,{data:o,nodeId:e,onPropertiesChange:m}),(0,Ge.jsx)(qe.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Tt=ai;var Fa=require("@awesome-flow/core/components"),La=require("@awesome-flow/core/hooks"),$e=require("@awesome-flow/core/layout"),Ua=require("libnoise-simplex-ts"),Va=require("react"),ze=require("react/jsx-runtime");function ri({id:e,selected:i,data:o,type:p}){let t=(0,La.useUpdateNodeComputedData)(),m=(0,Va.useCallback)(a=>{let n=new Ua.RidgedMulti;Object.keys(a).forEach(r=>n[r]=a[r].value),t(e,{module:n})},[]);return(0,ze.jsxs)($e.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,ze.jsx)(Fa.NodePropertyVariables,{data:o,nodeId:e,onPropertiesChange:m}),(0,ze.jsx)($e.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var gt=ri;var Ea=require("@awesome-flow/core/components"),Ha=require("@awesome-flow/core/hooks"),Ke=require("@awesome-flow/core/layout"),Aa=require("libnoise-simplex-ts"),Oa=require("react"),Re=require("react/jsx-runtime");function ii({id:e,selected:i,data:o,type:p}){let t=(0,Ha.useUpdateNodeComputedData)(),m=(0,Oa.useCallback)(a=>{let n=new Aa.Spheres;Object.keys(a).forEach(r=>n[r]=a[r].value),t(e,{module:n})},[]);return(0,Re.jsxs)(Ke.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,Re.jsx)(Ea.NodePropertyVariables,{data:o,nodeId:e,onPropertiesChange:m}),(0,Re.jsx)(Ke.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Dt=ii;var Xa=require("@awesome-flow/core/components"),Ya=require("@awesome-flow/core/hooks"),We=require("@awesome-flow/core/layout"),Za=require("libnoise-simplex-ts"),qa=require("react"),Fe=require("react/jsx-runtime");function ni({id:e,selected:i,data:o,type:p}){let t=(0,Ya.useUpdateNodeComputedData)(),m=(0,qa.useCallback)(a=>{let n=new Za.Voronoi(a.frequency.value,a.displacement.value,a.distance.value,a.seed.value);t(e,{module:n})},[]);return(0,Fe.jsxs)(We.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,Fe.jsx)(Xa.NodePropertyVariables,{data:o,nodeId:e,onPropertiesChange:m}),(0,Fe.jsx)(We.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var ht=ni;var _e=require("@awesome-flow/core/hooks"),$a=require("@awesome-flow/core/layout"),v=require("@mantine/core"),pe=require("react"),w=require("react/jsx-runtime");function pi({id:e,selected:i,data:o,type:p}){let t=o.position??{x:0,y:0,z:0},[m,a]=(0,pe.useState)(t.x),[n,r]=(0,pe.useState)(t.y),[d,N]=(0,pe.useState)(t.z),s=(0,_e.useUpdateNodeData)(),u=(0,_e.useUpdateNodeComputedData)();return(0,pe.useEffect)(()=>{let l={x:m,y:n,z:d};s(e,{position:l}),u(e,{positions:[l]})},[m,n,d]),(0,w.jsx)($a.NodeContainer,{id:e,selected:i,data:o,type:p,children:(0,w.jsxs)(v.Stack,{children:[(0,w.jsxs)(v.Group,{children:["x: ",(0,w.jsx)(v.NumberInput,{size:"xs",w:100,value:m,onChange:l=>a(Number(l))})]}),(0,w.jsxs)(v.Group,{children:["y: ",(0,w.jsx)(v.NumberInput,{size:"xs",w:100,value:n,onChange:l=>r(Number(l))})]}),(0,w.jsxs)(v.Group,{children:["z: ",(0,w.jsx)(v.NumberInput,{size:"xs",w:100,value:d,onChange:l=>N(Number(l))})]})]})})}var Pt=pi;var Je=require("@awesome-flow/core/hooks"),Ka=require("@awesome-flow/core/layout"),P=require("@mantine/core"),A=require("react"),h=require("react/jsx-runtime");function si({id:e,selected:i,data:o,type:p}){let[t,m]=(0,A.useState)(o.center?.x),[a,n]=(0,A.useState)(o.center?.y),[r,d]=(0,A.useState)(o.center?.z),[N,s]=(0,A.useState)(o.radius),u=(0,Je.useUpdateNodeData)(),l=(0,Je.useUpdateNodeComputedData)();return(0,A.useEffect)(()=>{u(e,{center:{x:t,y:a,z:r}})},[t,a,r]),(0,A.useEffect)(()=>{u(e,{radius:N})},[N]),(0,A.useEffect)(()=>{let C=[];for(let T=-N;T<N;T++)for(let ve=-N;ve<N;ve++)C.push({x:t+T,y:a+ve,z:r});l(e,{positions:C})},[t,a,r,N]),(0,h.jsx)(Ka.NodeContainer,{id:e,selected:i,data:o,type:p,children:(0,h.jsxs)(P.Stack,{children:[(0,h.jsxs)(P.Group,{children:["x: ",(0,h.jsx)(P.NumberInput,{size:"xs",w:100,value:t,onChange:C=>m(Number(C))})]}),(0,h.jsxs)(P.Group,{children:["y: ",(0,h.jsx)(P.NumberInput,{size:"xs",w:100,value:a,onChange:C=>n(Number(C))})]}),(0,h.jsxs)(P.Group,{children:["z: ",(0,h.jsx)(P.NumberInput,{size:"xs",w:100,value:r,onChange:C=>d(Number(C))})]}),(0,h.jsxs)(P.Group,{children:["r: ",(0,h.jsx)(P.NumberInput,{size:"xs",w:100,value:N,onChange:C=>s(Number(C))})]})]})})}var xt=si;var Y=require("@awesome-flow/core/hooks"),se=require("@awesome-flow/core/layout"),Le=require("@mantine/core"),me=require("@xyflow/react"),B=require("react"),Wa=require("zustand/shallow"),O=require("react/jsx-runtime");function mi({id:e,selected:i,data:o,type:p,width:t,height:m}){let a=(0,me.useUpdateNodeInternals)(),n=(0,me.useStore)(T=>T.triggerNodeChanges),{groupNodes:r,setGroupCollapsed:d}=(0,Y.useFlowStore)((0,B.useCallback)(T=>({groupNodes:T.groups[e],setGroupCollapsed:T.setGroupCollapsed}),[])),N=(0,Y.useInteractiveStore)((0,B.useCallback)(T=>T.nodeIntersectionTargets[e],[e]),Wa.shallow);(0,B.useEffect)(()=>{a(e)},[t,m]),(0,B.useEffect)(()=>{n([{id:e,type:"select",selected:!!N}])},[N]);let s=(0,B.useCallback)(T=>{d(e,T)},[]),u=(0,B.useMemo)(()=>({width:o.initialSize?.width||100,height:o.initialSize?.height||50}),[o.initialSize]),l=(0,Y.useIncomingComputedData)(e),C=(0,Y.useUpdateNodeComputedData)();return(0,B.useEffect)(()=>{if(l?.length){let{module:T}=l[0];C(e,{module:T})}},[l]),(0,O.jsxs)(se.NodeContainer,{id:e,selected:i,data:o,title:(0,O.jsx)(Le.Group,{justify:"space-between",children:(0,O.jsxs)(Le.Group,{gap:"xs",children:[(0,O.jsx)(Le.Badge,{size:"xs",variant:"outline",radius:"xs",color:"gray",children:r?.length||0}),(0,O.jsx)(se.NodeCollapse,{nodeId:e,isCollapsed:o.isCollapsed,onCollapsed:s})]})}),type:p,children:[(0,O.jsx)(me.NodeResizer,{nodeId:e,minWidth:u.width,minHeight:u.height,isVisible:i&&!o.isCollapsed}),(0,O.jsx)(se.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var It=mi;var Qe=require("@awesome-flow/core/hooks"),je=require("@awesome-flow/core/layout"),_a=require("libnoise-simplex-ts"),Ja=require("react"),bt=require("react/jsx-runtime");function di({id:e,selected:i,data:o,type:p}){let t=(0,Qe.useIncomingComputedData)(e),m=(0,Qe.useUpdateNodeComputedData)();return(0,Ja.useEffect)(()=>{if(t?.length>0){let a=new _a.Abs(t[0].module);m(e,{module:a})}},[t]),(0,bt.jsx)(je.NodeContainer,{id:e,selected:i,data:o,type:p,children:(0,bt.jsx)(je.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})})}var Mt=di;var de=require("@awesome-flow/core/hooks"),eo=require("@awesome-flow/core/layout"),Q=require("@mantine/core"),Qa=require("libnoise-simplex-ts"),Ue=require("react"),Z=require("react/jsx-runtime");function li({id:e,selected:i,data:o,type:p}){let[t,m]=(0,Ue.useState)(o.lowerBound),[a,n]=(0,Ue.useState)(o.upperBound),r=(0,de.useIncomingComputedData)(e),d=(0,de.useUpdateNodeData)(),N=(0,de.useUpdateNodeComputedData)();return(0,Ue.useEffect)(()=>{if(r?.length){let s=new Qa.Clamp(r[0].module,t,a);N(e,{module:s})}d(e,{lowerBound:t,upperBound:a})},[r,t,a]),(0,Z.jsxs)(eo.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,Z.jsx)(Q.Stack,{children:(0,Z.jsxs)(Q.Group,{children:[(0,Z.jsx)(Q.NumberInput,{size:"xs",w:100,value:t,onChange:s=>m(Number(s)),step:.1}),(0,Z.jsx)(Q.NumberInput,{size:"xs",w:100,value:a,onChange:s=>n(Number(s)),step:.1})]})}),(0,Z.jsx)(eo.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var St=li;var le=require("@awesome-flow/core/hooks"),ue=require("@awesome-flow/core/layout"),z=require("@tabler/icons-react"),oo=require("react");var k=require("libnoise-simplex-ts");var ja={add:k.Add,max:k.Max,min:k.Min,multiply:k.Multiply,power:k.Power};var G=require("react/jsx-runtime"),ui={add:(0,G.jsx)(z.IconPlus,{}),min:(0,G.jsx)(z.IconChevronLeft,{}),max:(0,G.jsx)(z.IconChevronRight,{}),multiply:(0,G.jsx)(z.IconAsterisk,{}),power:(0,G.jsx)(z.IconChevronUp,{})};function Ni({id:e,selected:i,data:o,type:p}){let t=(0,le.useUpdateNodeData)(),m=(0,le.useUpdateNodeComputedData)(),a=(0,le.useIncomingComputedData)(e);(0,oo.useEffect)(()=>{let r=ja[o.operation];if(a?.length>1){let d=new r(a[0].module,a[1].module);m(e,{module:d})}},[o.operation,a]);let n=(0,oo.useCallback)(r=>{t(e,{operation:r})},[]);return(0,G.jsxs)(ue.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,G.jsx)(ue.NodeCombobox,{options:ui,selected:o.operation,onChange:n,width:150}),(0,G.jsx)(ue.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var wt=Ni;var vt=require("@awesome-flow/core/abstract"),Ne=require("@awesome-flow/core/hooks"),ao=require("@awesome-flow/core/layout"),I=require("@mantine/core"),ro=require("@mantine/form"),to=require("@mantine/hooks"),er=require("@tabler/icons-react"),io=require("libnoise-simplex-ts"),j=require("react"),g=require("react/jsx-runtime");function ci({id:e,selected:i,data:o,type:p}){let t=(0,Ne.useIncomingComputedData)(e),m=(0,Ne.useUpdateNodeData)(),a=(0,Ne.useUpdateNodeComputedData)(),[n,r]=(0,j.useState)([]),d=(0,ro.useForm)({mode:"uncontrolled",initialValues:{points:[]},validateInputOnChange:[`points.${ro.FORM_INDEX}.input`],clearInputErrorOnChange:!0,validate:{points:{input:(s,u)=>{let l={};return u.points.forEach(C=>{l[C.input]=(l[C.input]||0)+1}),l[s]>1}}},onValuesChange:(0,j.useCallback)(s=>{if(d.validate(),d.isValid()){let u=s.points.map(l=>({input:l.input,output:l.output}));r(u),m(e,{points:u})}},[])});(0,j.useEffect)(()=>{let s=o.points?.length?o.points.map(u=>({input:u.input,output:u.output,key:(0,to.randomId)()})):[1,2,3,4].map(()=>({input:0,output:0,key:(0,to.randomId)()}));d.initialize({points:s})},[]),(0,j.useEffect)(()=>{if(t?.length&&n?.length>=4){let s=new io.Curve(t[0].module,n.map(u=>new io.Tuple(u.input,u.output)));a(e,{module:s})}},[n,t]);let N=d.getValues().points.map((s,u)=>(0,g.jsxs)(I.Group,{mt:"xs",children:[(0,g.jsx)(I.NumberInput,{size:"xs",w:100,placeholder:"Input Value",...d.getInputProps(`points.${u}.input`),step:.1},d.key(`points.${u}.input`)),(0,g.jsx)(I.NumberInput,{size:"xs",w:100,placeholder:"Output Value",...d.getInputProps(`points.${u}.output`),step:.1},d.key(`points.${u}.output`)),o.state===vt.NodeState.edit&&n.length>4&&(0,g.jsx)(I.ActionIcon,{color:"red",variant:"outline",size:"sm",onClick:()=>d.removeListItem("points",u),children:(0,g.jsx)(er.IconX,{size:"1rem"})})]},s.key));return(0,g.jsxs)(ao.NodeContainer,{id:e,selected:i,type:p,data:o,children:[N,o.state===vt.NodeState.edit&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(I.Space,{h:10}),(0,g.jsx)(I.Button,{variant:"outline",size:"xs",fullWidth:!0,onClick:()=>d.insertListItem("points",{input:0,output:0,key:(0,to.randomId)()}),children:"Add control point"})]}),(0,g.jsx)(ao.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Bt=ci;var ce=require("@awesome-flow/core/hooks"),no=require("@awesome-flow/core/layout"),fe=require("@mantine/core"),or=require("libnoise-simplex-ts"),po=require("react"),ee=require("react/jsx-runtime");function fi({id:e,selected:i,data:o,type:p}){let[t,m]=(0,po.useState)(o.exponent),a=(0,ce.useIncomingComputedData)(e),n=(0,ce.useUpdateNodeData)(),r=(0,ce.useUpdateNodeComputedData)();return(0,po.useEffect)(()=>{if(a?.length>0){let d=new or.Exponent(a[0].module,t);r(e,{module:d})}n(e,{exponent:t})},[a,t]),(0,ee.jsxs)(no.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,ee.jsx)(fe.Stack,{children:(0,ee.jsxs)(fe.Group,{children:["Exponent:",(0,ee.jsx)(fe.NumberInput,{size:"xs",value:t,onChange:d=>m(Number(d)),step:.1})]})}),(0,ee.jsx)(no.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var kt=fi;var so=require("@awesome-flow/core/hooks"),mo=require("@awesome-flow/core/layout"),tr=require("libnoise-simplex-ts"),ar=require("react"),Gt=require("react/jsx-runtime");function yi({id:e,selected:i,data:o,type:p}){let t=(0,so.useIncomingComputedData)(e),m=(0,so.useUpdateNodeComputedData)();return(0,ar.useEffect)(()=>{if(t?.length>0){let a=new tr.Invert(t[0].module);m(e,{module:a})}},[t]),(0,Gt.jsx)(mo.NodeContainer,{id:e,selected:i,data:o,type:p,children:(0,Gt.jsx)(mo.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})})}var zt=yi;var ye=require("@awesome-flow/core/hooks"),uo=require("@awesome-flow/core/layout"),oe=require("@mantine/core"),Ve=require("react");var rr=require("libnoise-simplex-ts"),lo=class extends rr.ModifierModule{constructor(o,p,t){super(o);this.lowerBound=p;this.upperBound=t}getValue(o,p,t){return Ci(this.sourceModule.getValue(o,p,t),this.lowerBound,this.upperBound)}};function Ci(e,i,o){return(e-i)/(o-i)}var q=require("react/jsx-runtime");function Ti({id:e,selected:i,data:o,type:p}){let[t,m]=(0,Ve.useState)(o.intervalStart),[a,n]=(0,Ve.useState)(o.intervalEnd),r=(0,ye.useIncomingComputedData)(e),d=(0,ye.useUpdateNodeData)(),N=(0,ye.useUpdateNodeComputedData)();return(0,Ve.useEffect)(()=>{if(r?.length){let s=r[0].module,u=new lo(s,t,a);N(e,{module:u})}d(e,{intervalStart:t,intervalEnd:a})},[r,t,a]),(0,q.jsxs)(uo.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,q.jsx)(oe.Stack,{children:(0,q.jsxs)(oe.Group,{children:[(0,q.jsx)(oe.NumberInput,{size:"xs",w:100,value:t,onChange:s=>m(Number(s))}),(0,q.jsx)(oe.NumberInput,{size:"xs",w:100,value:a,onChange:s=>n(Number(s))})]})}),(0,q.jsx)(uo.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Rt=Ti;var Ce=require("@awesome-flow/core/hooks"),No=require("@awesome-flow/core/layout"),$=require("@mantine/core"),ir=require("libnoise-simplex-ts"),Ee=require("react"),X=require("react/jsx-runtime");function gi({id:e,selected:i,data:o,type:p}){let[t,m]=(0,Ee.useState)(o.scale),[a,n]=(0,Ee.useState)(o.bias),r=(0,Ce.useIncomingComputedData)(e),d=(0,Ce.useUpdateNodeData)(),N=(0,Ce.useUpdateNodeComputedData)();return(0,Ee.useEffect)(()=>{if(r?.length>0){let s=new ir.ScaleBias(r[0].module,t,a);N(e,{module:s})}d(e,{scale:t,bias:a})},[r,t,a]),(0,X.jsxs)(No.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,X.jsxs)($.Stack,{children:[(0,X.jsxs)($.Group,{children:["Scale:",(0,X.jsx)($.NumberInput,{size:"xs",w:100,value:t,onChange:s=>m(Number(s)),step:.1})]}),(0,X.jsxs)($.Group,{children:["Bias:",(0,X.jsx)($.NumberInput,{size:"xs",w:100,value:a,onChange:s=>n(Number(s)),step:.1})]})]}),(0,X.jsx)(No.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Ft=gi;var Lt=require("@awesome-flow/core/abstract"),Te=require("@awesome-flow/core/hooks"),fo=require("@awesome-flow/core/layout"),R=require("@mantine/core"),yo=require("@mantine/form"),co=require("@mantine/hooks"),nr=require("@tabler/icons-react"),pr=require("libnoise-simplex-ts"),te=require("react"),D=require("react/jsx-runtime");function Di({id:e,selected:i,data:o,type:p}){let t=(0,Te.useIncomingComputedData)(e),m=(0,Te.useUpdateNodeData)(),a=(0,Te.useUpdateNodeComputedData)(),[n,r]=(0,te.useState)([]),d=(0,yo.useForm)({mode:"uncontrolled",initialValues:{points:[]},validateInputOnChange:[`points.${yo.FORM_INDEX}.input`],clearInputErrorOnChange:!0,onValuesChange:(0,te.useCallback)(s=>{if(d.isValid()){let u=s.points.map(l=>l.value);r(u),m(e,{points:u})}d.validate()},[])});(0,te.useEffect)(()=>{let s=o.points?.length?o.points.map(u=>({value:u,key:(0,co.randomId)()})):[1,2].map(()=>({value:0,key:(0,co.randomId)()}));d.initialize({points:s})},[]),(0,te.useEffect)(()=>{if(t?.length&&n?.length>=2){let s=new pr.Terrace(t[0].module,n);a(e,{module:s})}},[n,t]);let N=d.getValues().points.map((s,u)=>(0,D.jsxs)(R.Group,{mt:"xs",children:[(0,D.jsx)(R.NumberInput,{size:"xs",placeholder:"Input Value",...d.getInputProps(`points.${u}.value`),step:.1},d.key(`points.${u}.value`)),o.state===Lt.NodeState.edit&&n.length>2&&(0,D.jsx)(R.ActionIcon,{color:"red",variant:"outline",size:"sm",onClick:()=>d.removeListItem("points",u),children:(0,D.jsx)(nr.IconX,{size:"1rem"})})]},s.key));return(0,D.jsxs)(fo.NodeContainer,{id:e,selected:i,type:p,data:o,children:[N,o.state===Lt.NodeState.edit&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(R.Space,{h:10}),(0,D.jsx)(R.Button,{variant:"outline",size:"xs",fullWidth:!0,onClick:()=>d.insertListItem("points",{value:0,key:(0,co.randomId)()}),children:"Add control point"})]}),(0,D.jsx)(fo.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Ut=Di;var sr=require("@awesome-flow/core/hooks"),Co=require("@awesome-flow/core/layout"),ae=require("@mantine/core"),mr=require("react"),K=require("react/jsx-runtime");function hi({id:e,selected:i,data:o,type:p}){let t=(0,sr.useIncomingComputedData)(e),m=(0,mr.useMemo)(()=>t?.map(a=>a.noise).flat(),[t]);return(0,K.jsxs)(Co.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,K.jsxs)(ae.Text,{children:["Size: ",m?.length||0]}),(0,K.jsx)(ae.Divider,{h:5}),(0,K.jsx)(ae.Stack,{children:m?.map((a,n)=>(0,K.jsxs)(ae.Text,{children:[a.position?.x,":",a.position?.y,":",a.position?.z,": ",a.value]},n))}),(0,K.jsx)(Co.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Vt=hi;var Yr=require("@awesome-flow/core/components"),Zr=require("@awesome-flow/core/hooks"),lt=require("@awesome-flow/core/layout"),qr=require("@mantine/core"),ut=require("react");var To=require("@awesome-flow/core/hooks"),go=require("@awesome-flow/core/layout"),ge=require("@mantine/core"),re=require("react"),W=require("react/jsx-runtime");function Pi({id:e,selected:i,data:o,type:p}){let t=(0,To.useUpdateNodeComputedData)(),[m,a]=(0,re.useState)(0),[n,r]=(0,re.useState)(0),d=(0,To.useIncomingComputedData)(e),N=(0,re.useMemo)(()=>d?.map(s=>s.noise).flat(),[d]);return(0,re.useEffect)(()=>{if(N?.length){let s=Math.ceil(Math.sqrt(N.length)),u=N.map(C=>[C.value*255,C.value*255,C.value*255,255]).flat(),l=new Uint8Array(s*s*4);l.set(u),r(s),a(l.length),t(e,{textureData:l,textureResolutionX:s,textureResolutionY:s})}},[N]),(0,W.jsxs)(go.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,W.jsxs)(ge.Stack,{children:[(0,W.jsxs)(ge.Group,{children:["Resolution: ",n,"x",n]}),(0,W.jsxs)(ge.Group,{children:["Input Length: ",N?.length||0]}),(0,W.jsxs)(ge.Group,{children:["Output Length (",n,"*",n,"*4): ",m]})]}),(0,W.jsx)(go.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Et=Pi;var dr=require("@awesome-flow/core/hooks"),Do=require("@awesome-flow/core/layout"),ie=require("@mantine/core"),lr=require("react"),_=require("react/jsx-runtime");function xi({id:e,selected:i,data:o,type:p}){let t=(0,dr.useIncomingComputedData)(e),m=(0,lr.useMemo)(()=>t?.map(a=>a.positions).flat(),[t]);return(0,_.jsxs)(Do.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,_.jsxs)(ie.Text,{children:["Size: ",m?.length||0]}),(0,_.jsx)(ie.Divider,{h:5}),(0,_.jsx)(ie.Stack,{children:m?.map((a,n)=>(0,_.jsxs)(ie.Text,{children:[a.x,":",a.y,":",a.z]},n))}),(0,_.jsx)(Do.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Ht=xi;var ur=require("@awesome-flow/core/components"),Nr=require("@awesome-flow/core/hooks"),ho=require("@awesome-flow/core/layout"),cr=require("libnoise-simplex-ts"),fr=require("react");var He=require("react/jsx-runtime");function Ii({id:e,selected:i,data:o,type:p}){let t=(0,Nr.useUpdateNodeComputedData)(),m=(0,fr.useCallback)(a=>{let n=a.source,r=a.control;if(n?.length>=2&&r?.length){let d=new cr.Blend(n[0].module,n[1].module,r[0].module);t(e,{module:d})}},[]);return(0,He.jsxs)(ho.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,He.jsx)(ur.HandlesIncomingDataStatus,{nodeId:e,handles:o.handles,handleKey:"dataId",onDataUpdated:m,type:"target",resetComputedData:!0}),(0,He.jsx)(ho.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Ot=Ii;var yr=require("@awesome-flow/core/components"),Po=require("@awesome-flow/core/hooks"),xo=require("@awesome-flow/core/layout"),F=require("@mantine/core"),Cr=require("libnoise-simplex-ts"),J=require("react");var x=require("react/jsx-runtime");function bi({id:e,selected:i,data:o,type:p}){let[t,m]=(0,J.useState)(o.edgeFalloff),[a,n]=(0,J.useState)(o.lowerBound),[r,d]=(0,J.useState)(o.upperBound),N=(0,Po.useUpdateNodeData)(),s=(0,Po.useUpdateNodeComputedData)();(0,J.useEffect)(()=>{N(e,{edgeFalloff:t,lowerBound:a,upperBound:r})},[t,a,r]);let u=(0,J.useCallback)(l=>{let C=l.source,T=l.control;if(C?.length>=2&&T?.length){let ve=new Cr.Select(C[0].module,C[1].module,T[0].module,t,a,r);s(e,{module:ve})}},[]);return(0,x.jsxs)(xo.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,x.jsxs)(F.Stack,{children:[(0,x.jsxs)(F.Group,{children:["Edge Falloff:",(0,x.jsx)(F.NumberInput,{size:"xs",w:100,value:t,onChange:l=>m(Number(l)),step:.1})]}),(0,x.jsxs)(F.Group,{children:["Lower Bound:",(0,x.jsx)(F.NumberInput,{size:"xs",w:100,value:a,onChange:l=>n(Number(l)),step:.1})]}),(0,x.jsxs)(F.Group,{children:["Upper Bound:",(0,x.jsx)(F.NumberInput,{size:"xs",w:100,value:r,onChange:l=>d(Number(l)),step:.1})]}),(0,x.jsx)(yr.HandlesIncomingDataStatus,{nodeId:e,handles:o.handles,handleKey:"dataId",onDataUpdated:u,type:"target",resetComputedData:!0})]}),(0,x.jsx)(xo.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Xt=bi;var Tr=require("@awesome-flow/core/components"),gr=require("@awesome-flow/core/hooks"),Io=require("@awesome-flow/core/layout"),Dr=require("libnoise-simplex-ts"),hr=require("react");var Ae=require("react/jsx-runtime");function Si({id:e,selected:i,data:o,type:p}){let t=(0,gr.useUpdateNodeComputedData)(),m=(0,hr.useCallback)(a=>{let n=a.source,r=a["x-module"],d=a["y-module"],N=a["z-module"];if(n&&r&&d&&N){let s=new Dr.Displace(n[0].module,r[0].module,d[0].module,N[0].module);t(e,{module:s})}},[]);return(0,Ae.jsxs)(Io.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,Ae.jsx)(Tr.HandlesIncomingDataStatus,{nodeId:e,handles:o.handles,handleKey:"dataId",onDataUpdated:m,type:"target",resetComputedData:!0}),(0,Ae.jsx)(Io.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Yt=Si;var he=require("@awesome-flow/core/hooks"),bo=require("@awesome-flow/core/layout"),L=require("@mantine/core"),Pr=require("libnoise-simplex-ts"),De=require("react"),b=require("react/jsx-runtime");function wi({id:e,selected:i,data:o,type:p}){let[t,m]=(0,De.useState)(o.xAngle),[a,n]=(0,De.useState)(o.yAngle),[r,d]=(0,De.useState)(o.zAngle),N=(0,he.useIncomingComputedData)(e),s=(0,he.useUpdateNodeData)(),u=(0,he.useUpdateNodeComputedData)();return(0,De.useEffect)(()=>{if(N?.length){let l=new Pr.RotatePoint(N[0].module,t,a,r);u(e,{module:l})}s(e,{xAngle:t,yAngle:a,zAngle:r})},[e,u,s,N,t,a,r]),(0,b.jsxs)(bo.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,b.jsxs)(L.Stack,{children:[(0,b.jsxs)(L.Group,{children:["X Angle:",(0,b.jsx)(L.NumberInput,{size:"xs",w:100,value:t,onChange:l=>m(Number(l)),step:.01})]}),(0,b.jsxs)(L.Group,{children:["Y Angle:",(0,b.jsx)(L.NumberInput,{size:"xs",w:100,value:a,onChange:l=>n(Number(l)),step:.01})]}),(0,b.jsxs)(L.Group,{children:["Z Angle:",(0,b.jsx)(L.NumberInput,{size:"xs",w:100,value:r,onChange:l=>d(Number(l)),step:.01})]})]}),(0,b.jsx)(bo.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Zt=wi;var xe=require("@awesome-flow/core/hooks"),Mo=require("@awesome-flow/core/layout"),U=require("@mantine/core"),xr=require("libnoise-simplex-ts"),Pe=require("react"),M=require("react/jsx-runtime");function vi({id:e,selected:i,data:o,type:p}){let[t,m]=(0,Pe.useState)(o.xScale),[a,n]=(0,Pe.useState)(o.yScale),[r,d]=(0,Pe.useState)(o.zScale),N=(0,xe.useIncomingComputedData)(e),s=(0,xe.useUpdateNodeData)(),u=(0,xe.useUpdateNodeComputedData)();return(0,Pe.useEffect)(()=>{if(N?.length){let l=new xr.ScalePoint(N[0].module,t,a,r);u(e,{module:l})}s(e,{xScale:t,yScale:a,zScale:r})},[e,N,u,s,t,a,r]),(0,M.jsxs)(Mo.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,M.jsxs)(U.Stack,{children:[(0,M.jsxs)(U.Group,{children:["X Scale:",(0,M.jsx)(U.NumberInput,{size:"xs",w:100,value:t,onChange:l=>m(Number(l)),step:.01})]}),(0,M.jsxs)(U.Group,{children:["Y Scale:",(0,M.jsx)(U.NumberInput,{size:"xs",w:100,value:a,onChange:l=>n(Number(l)),step:.01})]}),(0,M.jsxs)(U.Group,{children:["Z Scale:",(0,M.jsx)(U.NumberInput,{size:"xs",w:100,value:r,onChange:l=>d(Number(l)),step:.01})]})]}),(0,M.jsx)(Mo.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var qt=vi;var be=require("@awesome-flow/core/hooks"),So=require("@awesome-flow/core/layout"),V=require("@mantine/core"),Ir=require("libnoise-simplex-ts"),Ie=require("react"),S=require("react/jsx-runtime");function Bi({id:e,selected:i,data:o,type:p}){let[t,m]=(0,Ie.useState)(o.translateX),[a,n]=(0,Ie.useState)(o.translateY),[r,d]=(0,Ie.useState)(o.translateZ),N=(0,be.useIncomingComputedData)(e),s=(0,be.useUpdateNodeData)(),u=(0,be.useUpdateNodeComputedData)();return(0,Ie.useEffect)(()=>{if(N?.length){let l=new Ir.TranslatePoint(N[0].module,t,a,r);u(e,{module:l})}s(e,{translateX:t,translateY:a,translateZ:r})},[e,N,t,a,r,u,s]),(0,S.jsxs)(So.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,S.jsxs)(V.Stack,{children:[(0,S.jsxs)(V.Group,{children:["Translate X:",(0,S.jsx)(V.NumberInput,{size:"xs",w:100,value:t,onChange:l=>m(Number(l)),step:1})]}),(0,S.jsxs)(V.Group,{children:["Translate Y:",(0,S.jsx)(V.NumberInput,{size:"xs",w:100,value:a,onChange:l=>n(Number(l)),step:1})]}),(0,S.jsxs)(V.Group,{children:["Translate Z:",(0,S.jsx)(V.NumberInput,{size:"xs",w:100,value:r,onChange:l=>d(Number(l)),step:1})]})]}),(0,S.jsx)(So.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var $t=Bi;var br=require("@awesome-flow/core/components"),wo=require("@awesome-flow/core/hooks"),vo=require("@awesome-flow/core/layout"),Mr=require("libnoise-simplex-ts"),Me=require("react"),Oe=require("react/jsx-runtime");function ki({id:e,selected:i,data:o,type:p}){let[t,m]=(0,Me.useState)(null),a=(0,wo.useIncomingComputedData)(e),n=(0,wo.useUpdateNodeComputedData)(),r=(0,Me.useCallback)(d=>{m(d)},[]);return(0,Me.useEffect)(()=>{if(a?.length&&t){let d=new Mr.Turbulence(a[0].module,t.frequency.value,t.power.value,t.roughness.value,t.seed.value);n(e,{module:d})}},[e,a,t]),(0,Oe.jsxs)(vo.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,Oe.jsx)(br.NodePropertyVariables,{data:o,nodeId:e,onPropertiesChange:r}),(0,Oe.jsx)(vo.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var Kt=ki;var Sr=require("@awesome-flow/core/abstract"),wr=require("@awesome-flow/core/utils"),Wt=require("@xyflow/system");var Bo=class{template={id:wr.IDGenerator.template(),type:"noise-billow",group:"Noise Generators",data:{title:"Billow Noise",frequency:.1,lacunarity:2,octaves:5,persistence:.5,seed:0},handles:[{position:Wt.Position.Left,dataType:Sr.CoreHandleType.variableProperty,connection:"target"},{position:Wt.Position.Right,dataType:"module",connection:"source"}]}};var vr=require("@xyflow/system");var ko=class{template={type:"noise-checkerboard",group:"Noise Generators",data:{title:"Checkerboard Noise"},handles:[{position:vr.Position.Right,dataType:"module",connection:"source"}]}};var Br=require("@xyflow/system");var Go=class{template={type:"noise-constant",group:"Noise Generators",data:{title:"Const Value Noise",noise:0,min:-1,max:1},handles:[{position:Br.Position.Right,dataType:"module",connection:"source"}]}};var kr=require("@awesome-flow/core/abstract"),_t=require("@xyflow/system");var zo=class{template={type:"noise-cylinders",group:"Noise Generators",data:{title:"Cylinders Noise",frequency:.1},handles:[{position:_t.Position.Left,dataType:kr.CoreHandleType.variableProperty,connection:"target"},{position:_t.Position.Right,dataType:"module",connection:"source"}]}};var Gr=require("@awesome-flow/core/abstract"),Jt=require("@xyflow/system");var Ro=class{template={type:"noise-perlin",group:"Noise Generators",data:{title:"Perlin Noise",frequency:.1,lacunarity:2,octaves:5,persistence:.5,seed:0},handles:[{position:Jt.Position.Left,dataType:Gr.CoreHandleType.variableProperty,connection:"target"},{position:Jt.Position.Right,dataType:"module",connection:"source"}]}};var zr=require("@awesome-flow/core/abstract"),Qt=require("@xyflow/system");var Fo=class{template={type:"noise-ridged-multi",group:"Noise Generators",data:{title:"Ridged Multi Noise",frequency:.1,lacunarity:2,octaves:6,offset:1,gain:2,seed:0},handles:[{position:Qt.Position.Left,dataType:zr.CoreHandleType.variableProperty,connection:"target"},{position:Qt.Position.Right,dataType:"module",connection:"source"}]}};var Rr=require("@awesome-flow/core/abstract"),jt=require("@xyflow/system");var Lo=class{template={type:"noise-spheres",group:"Noise Generators",data:{title:"Spheres Noise",frequency:.1},handles:[{position:jt.Position.Left,dataType:Rr.CoreHandleType.variableProperty,connection:"target"},{position:jt.Position.Right,dataType:"module",connection:"source"}]}};var Fr=require("@awesome-flow/core/abstract"),ea=require("@xyflow/system");var Uo=class{template={type:"noise-voronoi",group:"Noise Generators",data:{title:"Voronoi Noise",frequency:.1,displacement:1,distance:!0,seed:0},handles:[{position:ea.Position.Left,dataType:Fr.CoreHandleType.variableProperty,connection:"target"},{position:ea.Position.Right,dataType:"module",connection:"source"}]}};var Lr=require("@xyflow/system");var Vo=class{template={type:"position",group:"Positions",data:{title:"Position Output",position:{x:0,y:0,z:0}},handles:[{position:Lr.Position.Right,dataType:"position",connection:"source"}]}};var Ur=require("@xyflow/system");var Eo=class{template={type:"grid",group:"Positions",data:{title:"Grid Output",center:{x:0,y:0,z:0},radius:1},handles:[{position:Ur.Position.Right,dataType:"position",connection:"source"}]}};var Vr=require("@awesome-flow/core/abstract"),Er=require("@awesome-flow/core/utils"),oa=require("@xyflow/system");var Ho=class{template={id:Er.IDGenerator.template(),type:"group-module",group:Vr.CoreTemplateGroup.groups,data:{title:"Modules Group",isGroup:!0,initialSize:{width:300,height:200},collapsedSize:{width:300,height:80}},handles:[{position:oa.Position.Bottom,dataType:"module",connection:"target",maxConnections:1,hideOnCollapse:!0},{position:oa.Position.Right,dataType:"module",connection:"source"}]}};var ta=require("@xyflow/system");var Ao=class{template={type:"noise-abs",group:"Noise Modifiers",data:{title:"Abs Noise"},handles:[{position:ta.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:ta.Position.Right,dataType:"module",connection:"source"}]}};var aa=require("@xyflow/system");var Oo=class{template={type:"noise-clamp",group:"Noise Modifiers",data:{title:"Clamp Noise",lowerBound:-1,upperBound:1},handles:[{position:aa.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:aa.Position.Right,dataType:"module",connection:"source"}]}};var ra=require("@xyflow/system");var Xo=class{template={type:"noise-combiner",group:"Noise Modifiers",data:{title:"Combine Noise",operation:"add"},handles:[{position:ra.Position.Left,dataType:"module",connection:"target",maxConnections:2},{position:ra.Position.Right,dataType:"module",connection:"source"}]}};var ia=require("@xyflow/system");var Yo=class{template={type:"noise-curve",group:"Noise Modifiers",data:{title:"Noise Curve",points:[]},handles:[{position:ia.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:ia.Position.Right,dataType:"module",connection:"source"}]}};var na=require("@xyflow/system");var Zo=class{template={type:"noise-exponent",group:"Noise Modifiers",data:{title:"Noise Exponent",exponent:1},handles:[{position:na.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:na.Position.Right,dataType:"module",connection:"source"}]}};var pa=require("@xyflow/system");var qo=class{template={type:"noise-invert",group:"Noise Modifiers",data:{title:"Invert Noise"},handles:[{position:pa.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:pa.Position.Right,dataType:"module",connection:"source"}]}};var Hr=require("@awesome-flow/core/utils"),sa=require("@xyflow/system");var $o=class{template={id:Hr.IDGenerator.template(),type:"noise-normalize",group:"Noise Modifiers",data:{title:"Normalize Noise",intervalStart:-1,intervalEnd:1},handles:[{position:sa.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:sa.Position.Right,dataType:"module",connection:"source"}]}};var ma=require("@xyflow/system");var Ko=class{template={type:"noise-scale-bias",group:"Noise Modifiers",data:{title:"Scale/Bias Noise",scale:1,bias:0},handles:[{position:ma.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:ma.Position.Right,dataType:"module",connection:"source"}]}};var da=require("@xyflow/system");var Wo=class{template={type:"noise-terrace",group:"Noise Modifiers",data:{title:"Noise Terrace",points:[]},handles:[{position:da.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:da.Position.Right,dataType:"module",connection:"source"}]}};var Ar=require("@xyflow/system");var _o=class{template={type:"noise-logger",group:"Output",data:{title:"Noise Logger"},handles:[{position:Ar.Position.Left,dataType:"noise",connection:"target"}]}};var Jo=require("@xyflow/system");var Qo=class{template={type:"noise-output",group:"Output",data:{title:"Noise Output"},handles:[{position:Jo.Position.Left,dataType:"position",connection:"target"},{position:Jo.Position.Left,dataType:"module",connection:"target",maxConnections:1},{position:Jo.Position.Right,dataType:"noise",connection:"source"}]}};var la=require("@xyflow/system");var jo=class{template={type:"texture-data",group:"Output",data:{title:"Texture Data"},handles:[{position:la.Position.Left,dataType:"noise",connection:"target",maxConnections:1},{position:la.Position.Right,dataType:"texture",connection:"source"}]}};var Or=require("@xyflow/system");var et=class{template={type:"position-logger",group:"Positions",data:{title:"Position Logger"},handles:[{position:Or.Position.Left,dataType:"position",connection:"target"}]}};var ot=require("@xyflow/system");var tt=class{template={type:"noise-blend",group:"Noise Selectors",data:{title:"Noise Blend"},handles:[{position:ot.Position.Left,dataType:"module",connection:"target",label:"Source Modules",dataId:"source",maxConnections:2,minConnections:2},{position:ot.Position.Left,dataType:"module",dataId:"control",connection:"target",label:"Control Module",maxConnections:1},{position:ot.Position.Right,dataType:"module",dataId:"output",connection:"source"}]}};var at=require("@xyflow/system");var rt=class{template={type:"noise-select",group:"Noise Selectors",data:{title:"Noise Select",edgeFalloff:0,lowerBound:-1,upperBound:1},handles:[{position:at.Position.Left,dataType:"module",dataId:"source",connection:"target",label:"Source Modules",maxConnections:2,minConnections:2},{position:at.Position.Left,dataType:"module",dataId:"control",connection:"target",label:"Control Module",maxConnections:1},{position:at.Position.Right,dataType:"module",dataId:"output",connection:"source"}]}};var Se=require("@xyflow/system");var it=class{template={type:"noise-displace",group:"Noise Transformers",data:{title:"Noise Displace"},handles:[{position:Se.Position.Left,connection:"target",label:"Source Module",dataType:"module",dataId:"source",maxConnections:1},{position:Se.Position.Left,connection:"target",label:"X Module",dataType:"module",dataId:"x-module",maxConnections:1},{position:Se.Position.Left,connection:"target",label:"Y Module",dataType:"module",dataId:"y-module",maxConnections:1},{position:Se.Position.Left,connection:"target",label:"Z Module",dataType:"module",dataId:"z-module",maxConnections:1},{position:Se.Position.Right,dataType:"module",dataId:"output",connection:"source"}]}};var ua=require("@xyflow/system");var nt=class{template={type:"noise-rotate-point",group:"Noise Transformers",data:{title:"Noise Rotate Point",xAngle:0,yAngle:0,zAngle:0},handles:[{position:ua.Position.Left,dataType:"module",connection:"target",label:"Source Module",maxConnections:1},{position:ua.Position.Right,dataType:"module",connection:"source"}]}};var Na=require("@xyflow/system");var pt=class{template={type:"noise-scale-point",group:"Noise Transformers",data:{title:"Noise Scale Point",xScale:1,yScale:1,zScale:1},handles:[{position:Na.Position.Left,dataType:"module",connection:"target",label:"Source Module",maxConnections:1},{position:Na.Position.Right,dataType:"module",connection:"source"}]}};var ca=require("@xyflow/system");var st=class{template={type:"noise-translate-point",group:"Noise Transformers",data:{title:"Noise Translate Point",translateX:0,translateY:0,translateZ:0},handles:[{position:ca.Position.Left,dataType:"module",connection:"target",label:"Source Module",maxConnections:1},{position:ca.Position.Right,dataType:"module",connection:"source"}]}};var Xr=require("@awesome-flow/core/abstract"),mt=require("@xyflow/system");var dt=class{template={type:"noise-turbulence",group:"Noise Transformers",data:{title:"Noise Turbulence",frequency:1,power:1,roughness:1,seed:0},handles:[{position:mt.Position.Left,dataType:"module",connection:"target",label:"Source Module",maxConnections:1},{position:mt.Position.Left,dataType:Xr.CoreHandleType.variableProperty,label:"Variable Properties",connection:"target"},{position:mt.Position.Right,dataType:"module",connection:"source"}]}};var Ad={"noise-output":new Qo,"noise-billow":new Bo,"noise-checkerboard":new ko,"noise-normalize":new $o,"noise-logger":new _o,"noise-constant":new Go,position:new Vo,"position-logger":new et,grid:new Eo,"texture-data":new jo,"noise-cylinders":new zo,"noise-perlin":new Ro,"noise-ridged-multi":new Fo,"noise-spheres":new Lo,"noise-voronoi":new Uo,"noise-combiner":new Xo,"noise-clamp":new Oo,"noise-abs":new Ao,"noise-curve":new Yo,"noise-exponent":new Zo,"noise-invert":new qo,"noise-scale-bias":new Ko,"noise-terrace":new Wo,"noise-blend":new tt,"noise-select":new rt,"noise-displace":new it,"noise-rotate-point":new nt,"noise-scale-point":new pt,"noise-translate-point":new st,"noise-turbulence":new dt,"group-module":new Ho};var we=require("react/jsx-runtime");function Gi({id:e,selected:i,data:o,type:p}){let[t,m]=(0,ut.useState)(0),a=(0,Zr.useUpdateNodeComputedData)(),n=(0,ut.useCallback)(r=>{let d=r.position,N=r.module;if(d?.length&&N?.length&&N[0]?.module){let{module:s}=N[0],u=[];for(let l of d)for(let C of l.positions){let T=s.getValue(C.x,C.y,C.z);u.push({position:C,value:T})}a(e,{noise:u,module:s}),m(u.length)}},[]);return(0,we.jsxs)(lt.NodeContainer,{id:e,selected:i,data:o,type:p,children:[(0,we.jsx)(Yr.HandlesIncomingDataStatus,{nodeId:e,handles:o.handles,handleKey:"dataType",onDataUpdated:n,type:"target",resetComputedData:!0}),(0,we.jsxs)(qr.Text,{mt:5,children:["Noise points: ",t]}),(0,we.jsx)(lt.NodeTrackConnections,{handles:o.handles,nodeId:e,type:"target"})]})}var fa=Gi;0&&(module.exports={ModuleGroupNode,NoiseAbsNode,NoiseBillowNode,NoiseBlendNode,NoiseCheckerboardNode,NoiseClampNode,NoiseCombineNode,NoiseConstNode,NoiseCurveNode,NoiseCylindersNode,NoiseDisplaceNode,NoiseExponentNode,NoiseInvertNode,NoiseLoggerNode,NoiseNormalizeNode,NoiseOutputNode,NoisePerlinNode,NoiseRawTextureNode,NoiseRidgedMultiNode,NoiseRotatePointNode,NoiseScaleBiasNode,NoiseScalePointNode,NoiseSelectNode,NoiseSpheresNode,NoiseTerraceNode,NoiseTranslatePointNode,NoiseTurbulenceNode,NoiseVoronoiNode,PositionConstNode,PositionGridNode,PositionsLoggerNode});
|