@awesome-flow/noise 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract/index.cjs +1405 -2078
- package/dist/abstract/index.cjs.map +1 -1
- package/dist/abstract/index.d.cts +23 -25
- package/dist/abstract/index.d.ts +23 -25
- package/dist/abstract/index.js +1315 -1996
- package/dist/abstract/index.js.map +1 -1
- package/dist/index-BungWYrh.d.cts +49 -0
- package/dist/index-DsQSjZC5.d.ts +49 -0
- package/dist/{node-props-CeZ8Oshz.d.ts → node-props-BbqbXDXn.d.cts} +2 -22
- package/dist/{node-props-hKW-_KOU.d.cts → node-props-BbqbXDXn.d.ts} +2 -22
- package/dist/nodes/generators/index.cjs +130 -380
- package/dist/nodes/generators/index.cjs.map +1 -1
- package/dist/nodes/generators/index.d.cts +2 -8
- package/dist/nodes/generators/index.d.ts +2 -8
- package/dist/nodes/generators/index.js +112 -360
- package/dist/nodes/generators/index.js.map +1 -1
- package/dist/nodes/groups/index.cjs +25 -13
- package/dist/nodes/groups/index.cjs.map +1 -1
- package/dist/nodes/groups/index.js +26 -14
- package/dist/nodes/groups/index.js.map +1 -1
- package/dist/nodes/index.cjs +1654 -988
- package/dist/nodes/index.cjs.map +1 -1
- package/dist/nodes/index.d.cts +3 -5
- package/dist/nodes/index.d.ts +3 -5
- package/dist/nodes/index.js +1622 -960
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/modifiers/index.cjs +17 -119
- package/dist/nodes/modifiers/index.cjs.map +1 -1
- package/dist/nodes/modifiers/index.d.cts +2 -6
- package/dist/nodes/modifiers/index.d.ts +2 -6
- package/dist/nodes/modifiers/index.js +16 -124
- package/dist/nodes/modifiers/index.js.map +1 -1
- package/dist/nodes/output/index.cjs +1271 -89
- package/dist/nodes/output/index.cjs.map +1 -1
- package/dist/nodes/output/index.js +1314 -92
- package/dist/nodes/output/index.js.map +1 -1
- package/dist/nodes/selectors/index.cjs +1296 -58
- package/dist/nodes/selectors/index.cjs.map +1 -1
- package/dist/nodes/selectors/index.d.cts +1 -3
- package/dist/nodes/selectors/index.d.ts +1 -3
- package/dist/nodes/selectors/index.js +1339 -65
- package/dist/nodes/selectors/index.js.map +1 -1
- package/dist/nodes/transformers/index.cjs +67 -206
- package/dist/nodes/transformers/index.cjs.map +1 -1
- package/dist/nodes/transformers/index.d.cts +3 -5
- package/dist/nodes/transformers/index.d.ts +3 -5
- package/dist/nodes/transformers/index.js +54 -193
- package/dist/nodes/transformers/index.js.map +1 -1
- package/dist/templates/generators/index.cjs +839 -1278
- package/dist/templates/generators/index.cjs.map +1 -1
- package/dist/templates/generators/index.d.cts +13 -50
- package/dist/templates/generators/index.d.ts +13 -50
- package/dist/templates/generators/index.js +836 -1280
- package/dist/templates/generators/index.js.map +1 -1
- package/dist/templates/groups/index.cjs +837 -1272
- package/dist/templates/groups/index.cjs.map +1 -1
- package/dist/templates/groups/index.d.cts +1 -5
- package/dist/templates/groups/index.d.ts +1 -5
- package/dist/templates/groups/index.js +835 -1277
- package/dist/templates/groups/index.js.map +1 -1
- package/dist/templates/index.cjs +839 -1280
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +4 -7
- package/dist/templates/index.d.ts +4 -7
- package/dist/templates/index.js +836 -1281
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/modifiers/index.cjs +841 -1278
- package/dist/templates/modifiers/index.cjs.map +1 -1
- package/dist/templates/modifiers/index.d.cts +11 -38
- package/dist/templates/modifiers/index.d.ts +11 -38
- package/dist/templates/modifiers/index.js +838 -1281
- package/dist/templates/modifiers/index.js.map +1 -1
- package/dist/templates/output/index.cjs +839 -1274
- package/dist/templates/output/index.cjs.map +1 -1
- package/dist/templates/output/index.d.cts +4 -14
- package/dist/templates/output/index.d.ts +4 -14
- package/dist/templates/output/index.js +837 -1279
- package/dist/templates/output/index.js.map +1 -1
- package/dist/templates/selectors/index.cjs +839 -1274
- package/dist/templates/selectors/index.cjs.map +1 -1
- package/dist/templates/selectors/index.d.cts +3 -9
- package/dist/templates/selectors/index.d.ts +3 -9
- package/dist/templates/selectors/index.js +837 -1279
- package/dist/templates/selectors/index.js.map +1 -1
- package/dist/templates/transformers/index.cjs +839 -1274
- package/dist/templates/transformers/index.cjs.map +1 -1
- package/dist/templates/transformers/index.d.cts +3 -36
- package/dist/templates/transformers/index.d.ts +3 -36
- package/dist/templates/transformers/index.js +837 -1279
- package/dist/templates/transformers/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/handle-types-D-v5S53h.d.cts +0 -22
- package/dist/handle-types-D-v5S53h.d.ts +0 -22
- package/dist/layout/index.cjs +0 -164
- package/dist/layout/index.cjs.map +0 -1
- package/dist/layout/index.d.cts +0 -26
- package/dist/layout/index.d.ts +0 -26
- package/dist/layout/index.js +0 -136
- package/dist/layout/index.js.map +0 -1
- package/dist/properties-BxwtU6i9.d.cts +0 -9
- package/dist/properties-BxwtU6i9.d.ts +0 -9
package/dist/nodes/index.cjs
CHANGED
|
@@ -77,7 +77,7 @@ var require_fast_deep_equal = __commonJS({
|
|
|
77
77
|
// src/nodes/index.ts
|
|
78
78
|
var nodes_exports = {};
|
|
79
79
|
__export(nodes_exports, {
|
|
80
|
-
ModuleGroupNode: () =>
|
|
80
|
+
ModuleGroupNode: () => module_group_node_default,
|
|
81
81
|
NoiseAbsNode: () => noise_abs_node_default,
|
|
82
82
|
NoiseBillowNode: () => noise_billow_node_default,
|
|
83
83
|
NoiseBlendNode: () => noise_blend_node_default,
|
|
@@ -108,159 +108,21 @@ __export(nodes_exports, {
|
|
|
108
108
|
NoiseVoronoiNode: () => noise_voronoi_node_default,
|
|
109
109
|
PositionConstNode: () => position_const_node_default,
|
|
110
110
|
PositionGridNode: () => position_grid_node_default,
|
|
111
|
-
PositionsLoggerNode: () => positions_logger_node_default
|
|
112
|
-
VariableCombineNode: () => variable_combine_node_default,
|
|
113
|
-
VariablePropertyNode: () => variable_property_node_default,
|
|
114
|
-
VariableValueNode: () => variable_value_node_default
|
|
111
|
+
PositionsLoggerNode: () => positions_logger_node_default
|
|
115
112
|
});
|
|
116
113
|
module.exports = __toCommonJS(nodes_exports);
|
|
117
114
|
|
|
118
115
|
// src/nodes/generators/noise-billow-node.tsx
|
|
119
116
|
var import_layout = require("@awesome-flow/core/layout");
|
|
120
|
-
var
|
|
117
|
+
var import_react = require("react");
|
|
121
118
|
var import_generator = require("libnoise-ts/module/generator");
|
|
122
|
-
var import_hooks2 = require("@awesome-flow/core/hooks");
|
|
123
|
-
var import_abstract2 = require("@awesome-flow/core/abstract");
|
|
124
|
-
|
|
125
|
-
// src/layout/node-property-variables.tsx
|
|
126
119
|
var import_hooks = require("@awesome-flow/core/hooks");
|
|
127
|
-
var
|
|
128
|
-
var import_core2 = require("@mantine/core");
|
|
129
|
-
var import_utils = require("@awesome-flow/core/utils");
|
|
130
|
-
var import_abstract = require("@awesome-flow/core/abstract");
|
|
131
|
-
|
|
132
|
-
// src/layout/node-value-input.tsx
|
|
133
|
-
var import_core = require("@mantine/core");
|
|
120
|
+
var import_components = require("@awesome-flow/core/components");
|
|
134
121
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
135
|
-
function NodeValueInput({ value, disabled, step, onChange }) {
|
|
136
|
-
if (value === void 0 || value === null) {
|
|
137
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
138
|
-
}
|
|
139
|
-
switch (typeof value) {
|
|
140
|
-
case "boolean": {
|
|
141
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
-
import_core.Switch,
|
|
143
|
-
{
|
|
144
|
-
checked: value,
|
|
145
|
-
disabled,
|
|
146
|
-
onChange: (e) => onChange(e.currentTarget.checked)
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
case "number": {
|
|
151
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.NumberInput, { value, disabled, step, onChange: (e) => onChange(e) });
|
|
152
|
-
}
|
|
153
|
-
case "string": {
|
|
154
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
155
|
-
import_core.Input,
|
|
156
|
-
{
|
|
157
|
-
value,
|
|
158
|
-
disabled,
|
|
159
|
-
onChange: (e) => onChange(e.currentTarget.value)
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
default:
|
|
164
|
-
throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
var node_value_input_default = NodeValueInput;
|
|
168
|
-
|
|
169
|
-
// src/layout/node-property-input.tsx
|
|
170
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
171
|
-
function NodePropertyInput({ property, onChange }) {
|
|
172
|
-
if (!property) {
|
|
173
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {});
|
|
174
|
-
}
|
|
175
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
176
|
-
node_value_input_default,
|
|
177
|
-
{
|
|
178
|
-
value: property.value,
|
|
179
|
-
disabled: property.disabled,
|
|
180
|
-
step: property.step,
|
|
181
|
-
onChange: (value) => onChange(property.name, value)
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
var node_property_input_default = NodePropertyInput;
|
|
186
|
-
|
|
187
|
-
// src/layout/node-property-variables.tsx
|
|
188
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
189
|
-
function NodePropertyVariables({
|
|
190
|
-
data,
|
|
191
|
-
nodeId,
|
|
192
|
-
onPropertiesChange,
|
|
193
|
-
except = import_abstract.nodeDataPropertyExcept
|
|
194
|
-
}) {
|
|
195
|
-
const [properties, setProperties] = (0, import_react.useState)(() => {
|
|
196
|
-
const keys = (0, import_utils.getObjectKeys)(data, except);
|
|
197
|
-
const dataProps = {};
|
|
198
|
-
for (const key of keys) {
|
|
199
|
-
dataProps[key] = {
|
|
200
|
-
name: key,
|
|
201
|
-
value: data[key]
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
return dataProps;
|
|
205
|
-
});
|
|
206
|
-
const updateNodeData = (0, import_hooks.useUpdateNodeData)();
|
|
207
|
-
const incoming = (0, import_hooks.useIncomingNodeData)(nodeId);
|
|
208
|
-
const resetAllDisabled = (0, import_react.useCallback)(() => {
|
|
209
|
-
const keys = Object.keys(properties);
|
|
210
|
-
keys.forEach((k) => {
|
|
211
|
-
properties[k].disabled = false;
|
|
212
|
-
});
|
|
213
|
-
setProperties(properties);
|
|
214
|
-
}, []);
|
|
215
|
-
const updatePropertyValue = (0, import_react.useCallback)((name, value, disabled) => {
|
|
216
|
-
let property = properties[name];
|
|
217
|
-
if (property) {
|
|
218
|
-
property.value = value;
|
|
219
|
-
} else {
|
|
220
|
-
property = {
|
|
221
|
-
name,
|
|
222
|
-
value
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
property.disabled = disabled;
|
|
226
|
-
setProperties({ ...properties, [name]: property });
|
|
227
|
-
updateNodeData(nodeId, { [name]: value });
|
|
228
|
-
}, []);
|
|
229
|
-
(0, import_react.useEffect)(() => {
|
|
230
|
-
resetAllDisabled();
|
|
231
|
-
if (incoming?.length) {
|
|
232
|
-
for (const connection of incoming) {
|
|
233
|
-
if (connection.property && properties[connection.property.name] !== void 0) {
|
|
234
|
-
updatePropertyValue(connection.property.name, connection.property.value, true);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}, [incoming]);
|
|
239
|
-
(0, import_react.useEffect)(() => {
|
|
240
|
-
if (onPropertiesChange) {
|
|
241
|
-
onPropertiesChange(properties);
|
|
242
|
-
}
|
|
243
|
-
}, [onPropertiesChange, properties]);
|
|
244
|
-
const nodes = (0, import_react.useMemo)(() => {
|
|
245
|
-
return Object.keys(properties).map((key) => {
|
|
246
|
-
const property = properties[key];
|
|
247
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core2.Group, { children: [
|
|
248
|
-
property.name,
|
|
249
|
-
":",
|
|
250
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(node_property_input_default, { property, onChange: updatePropertyValue })
|
|
251
|
-
] }, key);
|
|
252
|
-
});
|
|
253
|
-
}, [properties, updatePropertyValue]);
|
|
254
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.Stack, { children: nodes });
|
|
255
|
-
}
|
|
256
|
-
var node_property_variables_default = NodePropertyVariables;
|
|
257
|
-
|
|
258
|
-
// src/nodes/generators/noise-billow-node.tsx
|
|
259
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
260
122
|
function NoiseBillowNode({ id, selected, data, type }) {
|
|
261
|
-
const updateComputedData = (0,
|
|
262
|
-
const module2 = (0,
|
|
263
|
-
const onPropertiesChange = (0,
|
|
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)(
|
|
264
126
|
(properties) => {
|
|
265
127
|
Object.keys(properties).forEach((k) => {
|
|
266
128
|
module2[k] = properties[k].value;
|
|
@@ -269,65 +131,57 @@ function NoiseBillowNode({ id, selected, data, type }) {
|
|
|
269
131
|
},
|
|
270
132
|
[id, module2, updateComputedData]
|
|
271
133
|
);
|
|
272
|
-
return /* @__PURE__ */ (0,
|
|
273
|
-
/* @__PURE__ */ (0,
|
|
274
|
-
|
|
275
|
-
{
|
|
276
|
-
data,
|
|
277
|
-
except: import_abstract2.nodeDataPropertyExcept,
|
|
278
|
-
nodeId: id,
|
|
279
|
-
onPropertiesChange
|
|
280
|
-
}
|
|
281
|
-
),
|
|
282
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
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" })
|
|
283
137
|
] });
|
|
284
138
|
}
|
|
285
139
|
var noise_billow_node_default = NoiseBillowNode;
|
|
286
140
|
|
|
287
141
|
// src/nodes/generators/noise-checkerboard-node.tsx
|
|
288
142
|
var import_layout2 = require("@awesome-flow/core/layout");
|
|
289
|
-
var
|
|
143
|
+
var import_react2 = require("react");
|
|
290
144
|
var import_generator2 = require("libnoise-ts/module/generator");
|
|
291
|
-
var
|
|
292
|
-
var
|
|
145
|
+
var import_hooks2 = require("@awesome-flow/core/hooks");
|
|
146
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
293
147
|
function NoiseCheckerboardNode({ id, selected, data, type }) {
|
|
294
|
-
const updateComputedData = (0,
|
|
295
|
-
const module2 = (0,
|
|
296
|
-
(0,
|
|
148
|
+
const updateComputedData = (0, import_hooks2.useUpdateNodeComputedData)();
|
|
149
|
+
const module2 = (0, import_react2.useMemo)(() => new import_generator2.Checkerboard(), []);
|
|
150
|
+
(0, import_react2.useEffect)(() => {
|
|
297
151
|
updateComputedData(id, { module: module2 });
|
|
298
152
|
}, [id, module2, updateComputedData]);
|
|
299
|
-
return /* @__PURE__ */ (0,
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_layout2.NodeContainer, { id, selected, data, type });
|
|
300
154
|
}
|
|
301
155
|
var noise_checkerboard_node_default = NoiseCheckerboardNode;
|
|
302
156
|
|
|
303
157
|
// src/nodes/generators/noise-const-node.tsx
|
|
304
158
|
var import_layout3 = require("@awesome-flow/core/layout");
|
|
305
|
-
var
|
|
306
|
-
var
|
|
307
|
-
var
|
|
159
|
+
var import_react3 = require("react");
|
|
160
|
+
var import_core = require("@mantine/core");
|
|
161
|
+
var import_hooks3 = require("@awesome-flow/core/hooks");
|
|
308
162
|
var import_generator3 = require("libnoise-ts/module/generator");
|
|
309
|
-
var
|
|
163
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
310
164
|
function NoiseConstNode({ id, selected, data, type }) {
|
|
311
|
-
const [min, setMin] = (0,
|
|
312
|
-
const [max, setMax] = (0,
|
|
313
|
-
const [noise, setNoise] = (0,
|
|
314
|
-
const updateNodeData = (0,
|
|
315
|
-
const updateComputedData = (0,
|
|
316
|
-
const module2 = (0,
|
|
317
|
-
(0,
|
|
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)(() => {
|
|
318
172
|
module2.value = noise;
|
|
319
173
|
updateNodeData(id, { noise, min, max });
|
|
320
174
|
updateComputedData(id, { module: module2 });
|
|
321
175
|
}, [noise, min, max, module2, updateNodeData, id, updateComputedData]);
|
|
322
|
-
return /* @__PURE__ */ (0,
|
|
323
|
-
/* @__PURE__ */ (0,
|
|
324
|
-
/* @__PURE__ */ (0,
|
|
325
|
-
/* @__PURE__ */ (0,
|
|
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)) })
|
|
326
180
|
] }),
|
|
327
|
-
/* @__PURE__ */ (0,
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core.Group, { children: [
|
|
328
182
|
"noise:",
|
|
329
|
-
/* @__PURE__ */ (0,
|
|
330
|
-
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
184
|
+
import_core.NumberInput,
|
|
331
185
|
{
|
|
332
186
|
size: "xs",
|
|
333
187
|
value: noise,
|
|
@@ -344,14 +198,15 @@ var noise_const_node_default = NoiseConstNode;
|
|
|
344
198
|
|
|
345
199
|
// src/nodes/generators/noise-cylinders-node.tsx
|
|
346
200
|
var import_layout4 = require("@awesome-flow/core/layout");
|
|
347
|
-
var
|
|
201
|
+
var import_react4 = require("react");
|
|
348
202
|
var import_generator4 = require("libnoise-ts/module/generator");
|
|
349
|
-
var
|
|
350
|
-
var
|
|
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");
|
|
351
206
|
function NoiseCylindersNode({ id, selected, data, type }) {
|
|
352
|
-
const updateComputedData = (0,
|
|
353
|
-
const module2 = (0,
|
|
354
|
-
const onPropertiesChange = (0,
|
|
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)(
|
|
355
210
|
(properties) => {
|
|
356
211
|
Object.keys(properties).forEach((k) => {
|
|
357
212
|
module2[k] = properties[k].value;
|
|
@@ -360,23 +215,24 @@ function NoiseCylindersNode({ id, selected, data, type }) {
|
|
|
360
215
|
},
|
|
361
216
|
[id, module2, updateComputedData]
|
|
362
217
|
);
|
|
363
|
-
return /* @__PURE__ */ (0,
|
|
364
|
-
/* @__PURE__ */ (0,
|
|
365
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
366
221
|
] });
|
|
367
222
|
}
|
|
368
223
|
var noise_cylinders_node_default = NoiseCylindersNode;
|
|
369
224
|
|
|
370
225
|
// src/nodes/generators/noise-perlin-node.tsx
|
|
371
226
|
var import_layout5 = require("@awesome-flow/core/layout");
|
|
372
|
-
var
|
|
227
|
+
var import_react5 = require("react");
|
|
373
228
|
var import_generator5 = require("libnoise-ts/module/generator");
|
|
374
|
-
var
|
|
375
|
-
var
|
|
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");
|
|
376
232
|
function NoisePerlinNode({ id, selected, data, type }) {
|
|
377
|
-
const updateComputedData = (0,
|
|
378
|
-
const module2 = (0,
|
|
379
|
-
const onPropertiesChange = (0,
|
|
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)(
|
|
380
236
|
(properties) => {
|
|
381
237
|
Object.keys(properties).forEach((k) => {
|
|
382
238
|
module2[k] = properties[k].value;
|
|
@@ -385,37 +241,38 @@ function NoisePerlinNode({ id, selected, data, type }) {
|
|
|
385
241
|
},
|
|
386
242
|
[id, module2, updateComputedData]
|
|
387
243
|
);
|
|
388
|
-
return /* @__PURE__ */ (0,
|
|
389
|
-
/* @__PURE__ */ (0,
|
|
390
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
391
247
|
] });
|
|
392
248
|
}
|
|
393
249
|
var noise_perlin_node_default = NoisePerlinNode;
|
|
394
250
|
|
|
395
251
|
// src/nodes/generators/noise-ridgedmulti-node.tsx
|
|
396
252
|
var import_layout6 = require("@awesome-flow/core/layout");
|
|
397
|
-
var
|
|
253
|
+
var import_react6 = require("react");
|
|
398
254
|
var import_generator6 = require("libnoise-ts/module/generator");
|
|
399
|
-
var
|
|
400
|
-
var
|
|
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");
|
|
401
258
|
function NoiseRidgedMultiNode({ id, selected, data, type }) {
|
|
402
|
-
const updateComputedData = (0,
|
|
403
|
-
const module2 = (0,
|
|
404
|
-
const onPropertiesChange = (0,
|
|
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) => {
|
|
405
262
|
Object.keys(properties).forEach((k) => module2[k] = properties[k].value);
|
|
406
263
|
updateComputedData(id, { module: module2 });
|
|
407
264
|
}, []);
|
|
408
|
-
return /* @__PURE__ */ (0,
|
|
409
|
-
/* @__PURE__ */ (0,
|
|
410
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
411
268
|
] });
|
|
412
269
|
}
|
|
413
270
|
var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
|
|
414
271
|
|
|
415
272
|
// src/nodes/generators/noise-simplex-node.tsx
|
|
416
273
|
var import_layout7 = require("@awesome-flow/core/layout");
|
|
417
|
-
var
|
|
418
|
-
var
|
|
274
|
+
var import_react7 = require("react");
|
|
275
|
+
var import_hooks7 = require("@awesome-flow/core/hooks");
|
|
419
276
|
|
|
420
277
|
// src/modules/simplex-module.ts
|
|
421
278
|
var import_Module = __toESM(require("libnoise-ts/module/Module"), 1);
|
|
@@ -432,46 +289,48 @@ var SimplexModule = class extends import_Module.default {
|
|
|
432
289
|
};
|
|
433
290
|
|
|
434
291
|
// src/nodes/generators/noise-simplex-node.tsx
|
|
435
|
-
var
|
|
292
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
436
293
|
function NoiseSimplexNode({ id, selected, data, type }) {
|
|
437
|
-
const updateComputedData = (0,
|
|
438
|
-
const module2 = (0,
|
|
439
|
-
(0,
|
|
294
|
+
const updateComputedData = (0, import_hooks7.useUpdateNodeComputedData)();
|
|
295
|
+
const module2 = (0, import_react7.useMemo)(() => new SimplexModule(), []);
|
|
296
|
+
(0, import_react7.useEffect)(() => {
|
|
440
297
|
updateComputedData(id, { module: module2 });
|
|
441
298
|
}, []);
|
|
442
|
-
return /* @__PURE__ */ (0,
|
|
299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_layout7.NodeContainer, { id, selected, data, type });
|
|
443
300
|
}
|
|
444
301
|
var noise_simplex_node_default = NoiseSimplexNode;
|
|
445
302
|
|
|
446
303
|
// src/nodes/generators/noise-spheres-node.tsx
|
|
447
304
|
var import_layout8 = require("@awesome-flow/core/layout");
|
|
448
|
-
var
|
|
305
|
+
var import_react8 = require("react");
|
|
449
306
|
var import_generator7 = require("libnoise-ts/module/generator");
|
|
450
|
-
var
|
|
451
|
-
var
|
|
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");
|
|
452
310
|
function NoiseSpheresNode({ id, selected, data, type }) {
|
|
453
|
-
const updateComputedData = (0,
|
|
454
|
-
const module2 = (0,
|
|
455
|
-
const onPropertiesChange = (0,
|
|
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) => {
|
|
456
314
|
Object.keys(properties).forEach((k) => module2[k] = properties[k].value);
|
|
457
315
|
updateComputedData(id, { module: module2 });
|
|
458
316
|
}, []);
|
|
459
|
-
return /* @__PURE__ */ (0,
|
|
460
|
-
/* @__PURE__ */ (0,
|
|
461
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
462
320
|
] });
|
|
463
321
|
}
|
|
464
322
|
var noise_spheres_node_default = NoiseSpheresNode;
|
|
465
323
|
|
|
466
324
|
// src/nodes/generators/noise-voronoi-node.tsx
|
|
467
325
|
var import_layout9 = require("@awesome-flow/core/layout");
|
|
468
|
-
var
|
|
326
|
+
var import_react9 = require("react");
|
|
469
327
|
var import_generator8 = require("libnoise-ts/module/generator");
|
|
470
|
-
var
|
|
471
|
-
var
|
|
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");
|
|
472
331
|
function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
473
|
-
const updateComputedData = (0,
|
|
474
|
-
const onPropertiesChange = (0,
|
|
332
|
+
const updateComputedData = (0, import_hooks9.useUpdateNodeComputedData)();
|
|
333
|
+
const onPropertiesChange = (0, import_react9.useCallback)(
|
|
475
334
|
(properties) => {
|
|
476
335
|
const module2 = new import_generator8.Voronoi(
|
|
477
336
|
properties.frequency.value,
|
|
@@ -483,27 +342,27 @@ function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
|
483
342
|
},
|
|
484
343
|
[]
|
|
485
344
|
);
|
|
486
|
-
return /* @__PURE__ */ (0,
|
|
487
|
-
/* @__PURE__ */ (0,
|
|
488
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
489
348
|
] });
|
|
490
349
|
}
|
|
491
350
|
var noise_voronoi_node_default = NoiseVoronoiNode;
|
|
492
351
|
|
|
493
352
|
// src/nodes/generators/position-const-node.tsx
|
|
494
353
|
var import_layout10 = require("@awesome-flow/core/layout");
|
|
495
|
-
var
|
|
496
|
-
var
|
|
497
|
-
var
|
|
498
|
-
var
|
|
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");
|
|
499
358
|
function PositionConstNode({ id, selected, data, type }) {
|
|
500
359
|
const position = data.position ?? { x: 0, y: 0, z: 0 };
|
|
501
|
-
const [x, setX] = (0,
|
|
502
|
-
const [y, setY] = (0,
|
|
503
|
-
const [z, setZ] = (0,
|
|
504
|
-
const updateNodeData = (0,
|
|
505
|
-
const updateComputedData = (0,
|
|
506
|
-
(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)(() => {
|
|
507
366
|
const position2 = { x, y, z };
|
|
508
367
|
updateNodeData(id, {
|
|
509
368
|
position: position2
|
|
@@ -512,18 +371,18 @@ function PositionConstNode({ id, selected, data, type }) {
|
|
|
512
371
|
positions: [position2]
|
|
513
372
|
});
|
|
514
373
|
}, [x, y, z]);
|
|
515
|
-
return /* @__PURE__ */ (0,
|
|
516
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
517
376
|
"x: ",
|
|
518
|
-
/* @__PURE__ */ (0,
|
|
377
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
519
378
|
] }),
|
|
520
|
-
/* @__PURE__ */ (0,
|
|
379
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core2.Group, { children: [
|
|
521
380
|
"y: ",
|
|
522
|
-
/* @__PURE__ */ (0,
|
|
381
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
523
382
|
] }),
|
|
524
|
-
/* @__PURE__ */ (0,
|
|
383
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core2.Group, { children: [
|
|
525
384
|
"z: ",
|
|
526
|
-
/* @__PURE__ */ (0,
|
|
385
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core2.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
527
386
|
] })
|
|
528
387
|
] }) });
|
|
529
388
|
}
|
|
@@ -531,28 +390,28 @@ var position_const_node_default = PositionConstNode;
|
|
|
531
390
|
|
|
532
391
|
// src/nodes/generators/position-grid-node.tsx
|
|
533
392
|
var import_layout11 = require("@awesome-flow/core/layout");
|
|
534
|
-
var
|
|
535
|
-
var
|
|
536
|
-
var
|
|
537
|
-
var
|
|
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");
|
|
538
397
|
function PositionGridNode({ id, selected, data, type }) {
|
|
539
|
-
const [x, setX] = (0,
|
|
540
|
-
const [y, setY] = (0,
|
|
541
|
-
const [z, setZ] = (0,
|
|
542
|
-
const [radius, setRadius] = (0,
|
|
543
|
-
const updateNodeData = (0,
|
|
544
|
-
const updateComputedData = (0,
|
|
545
|
-
(0,
|
|
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)(() => {
|
|
546
405
|
updateNodeData(id, {
|
|
547
406
|
center: { x, y, z }
|
|
548
407
|
});
|
|
549
408
|
}, [x, y, z]);
|
|
550
|
-
(0,
|
|
409
|
+
(0, import_react11.useEffect)(() => {
|
|
551
410
|
updateNodeData(id, {
|
|
552
411
|
radius
|
|
553
412
|
});
|
|
554
413
|
}, [radius]);
|
|
555
|
-
(0,
|
|
414
|
+
(0, import_react11.useEffect)(() => {
|
|
556
415
|
const positions = [];
|
|
557
416
|
for (let i = -radius; i < radius; i++) {
|
|
558
417
|
for (let j = -radius; j < radius; j++) {
|
|
@@ -563,143 +422,36 @@ function PositionGridNode({ id, selected, data, type }) {
|
|
|
563
422
|
positions
|
|
564
423
|
});
|
|
565
424
|
}, [x, y, z, radius]);
|
|
566
|
-
return /* @__PURE__ */ (0,
|
|
567
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
568
427
|
"x: ",
|
|
569
|
-
/* @__PURE__ */ (0,
|
|
428
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
570
429
|
] }),
|
|
571
|
-
/* @__PURE__ */ (0,
|
|
430
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core3.Group, { children: [
|
|
572
431
|
"y: ",
|
|
573
|
-
/* @__PURE__ */ (0,
|
|
432
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
574
433
|
] }),
|
|
575
|
-
/* @__PURE__ */ (0,
|
|
434
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core3.Group, { children: [
|
|
576
435
|
"z: ",
|
|
577
|
-
/* @__PURE__ */ (0,
|
|
436
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
578
437
|
] }),
|
|
579
|
-
/* @__PURE__ */ (0,
|
|
438
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core3.Group, { children: [
|
|
580
439
|
"r: ",
|
|
581
|
-
/* @__PURE__ */ (0,
|
|
440
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core3.NumberInput, { size: "xs", w: 100, value: radius, onChange: (e) => setRadius(Number(e)) })
|
|
582
441
|
] })
|
|
583
442
|
] }) });
|
|
584
443
|
}
|
|
585
444
|
var position_grid_node_default = PositionGridNode;
|
|
586
445
|
|
|
587
|
-
// src/nodes/
|
|
446
|
+
// src/nodes/groups/module-group-node.tsx
|
|
588
447
|
var import_layout12 = require("@awesome-flow/core/layout");
|
|
448
|
+
var import_react12 = require("@xyflow/react");
|
|
449
|
+
var import_abstract = require("@awesome-flow/core/abstract");
|
|
589
450
|
var import_react13 = require("react");
|
|
590
|
-
var import_core6 = require("@mantine/core");
|
|
591
|
-
var import_hooks13 = require("@awesome-flow/core/hooks");
|
|
592
|
-
var import_utils2 = require("@awesome-flow/core/utils");
|
|
593
|
-
var import_abstract3 = require("@awesome-flow/core/abstract");
|
|
594
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
595
|
-
function VariablePropertyNode({
|
|
596
|
-
id,
|
|
597
|
-
selected,
|
|
598
|
-
data,
|
|
599
|
-
type
|
|
600
|
-
}) {
|
|
601
|
-
const [options3, setOptions] = (0, import_react13.useState)({});
|
|
602
|
-
const [selectedProperty, setSelectedProperty] = (0, import_react13.useState)(data.property);
|
|
603
|
-
const updateNodeData = (0, import_hooks13.useUpdateNodeData)();
|
|
604
|
-
const outgoing = (0, import_hooks13.useOutgoingNodes)(id);
|
|
605
|
-
const incoming = (0, import_hooks13.useIncomingNodeData)(id);
|
|
606
|
-
(0, import_react13.useEffect)(() => {
|
|
607
|
-
if (outgoing?.length) {
|
|
608
|
-
const { data: data2 } = outgoing[0];
|
|
609
|
-
const properties = (0, import_utils2.getObjectPropertyMap)(data2, import_abstract3.nodeDataPropertyExcept);
|
|
610
|
-
setOptions(properties);
|
|
611
|
-
if (!selectedProperty) {
|
|
612
|
-
const keys = Object.keys(properties);
|
|
613
|
-
if (keys.length) {
|
|
614
|
-
setSelectedProperty({
|
|
615
|
-
name: keys[0],
|
|
616
|
-
value: properties[keys[0]]
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
} else {
|
|
621
|
-
setSelectedProperty(null);
|
|
622
|
-
}
|
|
623
|
-
}, [outgoing]);
|
|
624
|
-
(0, import_react13.useEffect)(() => {
|
|
625
|
-
if (!incoming?.length && selectedProperty?.disabled) {
|
|
626
|
-
setSelectedProperty({ ...selectedProperty, disabled: false });
|
|
627
|
-
} else if (incoming?.length && selectedProperty) {
|
|
628
|
-
const incomingValue = incoming[0].value;
|
|
629
|
-
if (incomingValue !== void 0 && incomingValue !== null) {
|
|
630
|
-
setSelectedProperty({
|
|
631
|
-
name: selectedProperty.name,
|
|
632
|
-
value: incomingValue,
|
|
633
|
-
disabled: true
|
|
634
|
-
});
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}, [incoming]);
|
|
638
|
-
(0, import_react13.useEffect)(() => {
|
|
639
|
-
if (selectedProperty) {
|
|
640
|
-
updateNodeData(id, { property: selectedProperty });
|
|
641
|
-
}
|
|
642
|
-
}, [selectedProperty]);
|
|
643
|
-
const onPropertyChange = (0, import_react13.useCallback)(
|
|
644
|
-
(selected2) => {
|
|
645
|
-
setSelectedProperty({
|
|
646
|
-
name: selected2,
|
|
647
|
-
value: options3[selected2]
|
|
648
|
-
});
|
|
649
|
-
},
|
|
650
|
-
[options3]
|
|
651
|
-
);
|
|
652
|
-
const onValueChange = (0, import_react13.useCallback)((name, value) => {
|
|
653
|
-
setSelectedProperty({
|
|
654
|
-
name,
|
|
655
|
-
value
|
|
656
|
-
});
|
|
657
|
-
}, []);
|
|
658
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_layout12.NodeContainer, { id, selected, data, type, children: [
|
|
659
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core6.Stack, { align: "center", children: [
|
|
660
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
661
|
-
import_layout12.NodeCombobox,
|
|
662
|
-
{
|
|
663
|
-
options: options3,
|
|
664
|
-
onChange: onPropertyChange,
|
|
665
|
-
selected: selectedProperty?.name,
|
|
666
|
-
hideListValues: true
|
|
667
|
-
}
|
|
668
|
-
),
|
|
669
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(node_property_input_default, { property: selectedProperty, onChange: onValueChange })
|
|
670
|
-
] }),
|
|
671
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_layout12.NodeTrackConnections, { handles: data.handles, nodeId: id })
|
|
672
|
-
] });
|
|
673
|
-
}
|
|
674
|
-
var variable_property_node_default = VariablePropertyNode;
|
|
675
|
-
|
|
676
|
-
// src/nodes/generators/variable-value-node.tsx
|
|
677
|
-
var import_layout13 = require("@awesome-flow/core/layout");
|
|
678
|
-
var import_react14 = require("react");
|
|
679
|
-
var import_hooks14 = require("@awesome-flow/core/hooks");
|
|
680
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
681
|
-
function VariableValueNode({ id, selected, data, type }) {
|
|
682
|
-
const [value, setValue] = (0, import_react14.useState)(data.value || 0);
|
|
683
|
-
const updateNodeData = (0, import_hooks14.useUpdateNodeData)();
|
|
684
|
-
const onValueChange = (0, import_react14.useCallback)((newValue) => {
|
|
685
|
-
updateNodeData(id, { value: newValue });
|
|
686
|
-
setValue(newValue);
|
|
687
|
-
}, []);
|
|
688
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_layout13.NodeContainer, { id, selected, data, type, children: [
|
|
689
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(node_value_input_default, { value, onChange: onValueChange }),
|
|
690
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_layout13.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "source" })
|
|
691
|
-
] });
|
|
692
|
-
}
|
|
693
|
-
var variable_value_node_default = VariableValueNode;
|
|
694
|
-
|
|
695
|
-
// src/nodes/groups/node-module-group.tsx
|
|
696
|
-
var import_layout14 = require("@awesome-flow/core/layout");
|
|
697
|
-
var import_react15 = require("@xyflow/react");
|
|
698
|
-
var import_abstract4 = require("@awesome-flow/core/abstract");
|
|
699
|
-
var import_react16 = require("react");
|
|
700
451
|
var import_shallow = require("zustand/shallow");
|
|
701
|
-
var
|
|
702
|
-
var
|
|
452
|
+
var import_core4 = require("@mantine/core");
|
|
453
|
+
var import_hooks12 = require("@awesome-flow/core/hooks");
|
|
454
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
703
455
|
function ModuleGroupNode({
|
|
704
456
|
id,
|
|
705
457
|
selected,
|
|
@@ -708,23 +460,23 @@ function ModuleGroupNode({
|
|
|
708
460
|
width,
|
|
709
461
|
height
|
|
710
462
|
}) {
|
|
711
|
-
const context = (0,
|
|
712
|
-
const updateNodeInternals = (0,
|
|
713
|
-
const triggerNodeChanges = (0,
|
|
463
|
+
const context = (0, import_react13.useContext)(import_abstract.FlowContext);
|
|
464
|
+
const updateNodeInternals = (0, import_react12.useUpdateNodeInternals)();
|
|
465
|
+
const triggerNodeChanges = (0, import_react12.useStore)((s) => s.triggerNodeChanges);
|
|
714
466
|
const { groupNodes, setGroupCollapsed } = context.useFlowStore(
|
|
715
|
-
(0,
|
|
467
|
+
(0, import_react13.useCallback)(
|
|
716
468
|
(state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
|
|
717
469
|
[]
|
|
718
470
|
)
|
|
719
471
|
);
|
|
720
472
|
const intersectingNode = context.useInteractivityStore(
|
|
721
|
-
(0,
|
|
473
|
+
(0, import_react13.useCallback)((state) => state.nodeIntersectionTargets[id], [id]),
|
|
722
474
|
import_shallow.shallow
|
|
723
475
|
);
|
|
724
|
-
(0,
|
|
476
|
+
(0, import_react13.useEffect)(() => {
|
|
725
477
|
updateNodeInternals(id);
|
|
726
478
|
}, [width, height]);
|
|
727
|
-
(0,
|
|
479
|
+
(0, import_react13.useEffect)(() => {
|
|
728
480
|
triggerNodeChanges([
|
|
729
481
|
{
|
|
730
482
|
id,
|
|
@@ -733,83 +485,94 @@ function ModuleGroupNode({
|
|
|
733
485
|
}
|
|
734
486
|
]);
|
|
735
487
|
}, [intersectingNode]);
|
|
736
|
-
const onCollapsed = (0,
|
|
488
|
+
const onCollapsed = (0, import_react13.useCallback)((collapsed) => {
|
|
737
489
|
setGroupCollapsed(id, collapsed);
|
|
738
490
|
}, []);
|
|
739
|
-
const size = (0,
|
|
491
|
+
const size = (0, import_react13.useMemo)(() => {
|
|
740
492
|
return {
|
|
741
493
|
width: data.initialSize?.width || 100,
|
|
742
494
|
height: data.initialSize?.height || 50
|
|
743
495
|
};
|
|
744
496
|
}, [data.initialSize]);
|
|
745
|
-
|
|
746
|
-
|
|
497
|
+
const incomingModules = (0, import_hooks12.useIncomingComputedData)(id);
|
|
498
|
+
const updateComputedData = (0, import_hooks12.useUpdateNodeComputedData)();
|
|
499
|
+
(0, import_react13.useEffect)(() => {
|
|
500
|
+
if (incomingModules?.length) {
|
|
501
|
+
const { module: module2 } = incomingModules[0];
|
|
502
|
+
updateComputedData(id, { module: module2 });
|
|
503
|
+
}
|
|
504
|
+
}, [incomingModules]);
|
|
505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
506
|
+
import_layout12.NodeContainer,
|
|
747
507
|
{
|
|
748
508
|
id,
|
|
749
509
|
selected,
|
|
750
510
|
data,
|
|
751
|
-
title: /* @__PURE__ */ (0,
|
|
752
|
-
/* @__PURE__ */ (0,
|
|
753
|
-
/* @__PURE__ */ (0,
|
|
511
|
+
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: [
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core4.Badge, { size: "xs", variant: "outline", radius: "xs", color: "gray", children: groupNodes?.length || 0 }),
|
|
513
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_layout12.NodeCollapse, { nodeId: id, isCollapsed: data.isCollapsed, onCollapsed })
|
|
754
514
|
] }) }),
|
|
755
515
|
type,
|
|
756
|
-
children:
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
516
|
+
children: [
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
518
|
+
import_react12.NodeResizer,
|
|
519
|
+
{
|
|
520
|
+
nodeId: id,
|
|
521
|
+
minWidth: size.width,
|
|
522
|
+
minHeight: size.height,
|
|
523
|
+
isVisible: selected && !data.isCollapsed
|
|
524
|
+
}
|
|
525
|
+
),
|
|
526
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_layout12.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
527
|
+
]
|
|
765
528
|
}
|
|
766
529
|
);
|
|
767
530
|
}
|
|
768
|
-
var
|
|
531
|
+
var module_group_node_default = ModuleGroupNode;
|
|
769
532
|
|
|
770
533
|
// src/nodes/modifiers/noise-abs-node.tsx
|
|
771
|
-
var
|
|
772
|
-
var
|
|
773
|
-
var
|
|
534
|
+
var import_layout13 = require("@awesome-flow/core/layout");
|
|
535
|
+
var import_react14 = require("react");
|
|
536
|
+
var import_hooks13 = require("@awesome-flow/core/hooks");
|
|
774
537
|
var import_modifier = require("libnoise-ts/module/modifier");
|
|
775
|
-
var
|
|
538
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
776
539
|
function NoiseAbsNode({ id, selected, data, type }) {
|
|
777
|
-
const incoming = (0,
|
|
778
|
-
const updateComputedData = (0,
|
|
779
|
-
(0,
|
|
540
|
+
const incoming = (0, import_hooks13.useIncomingComputedData)(id);
|
|
541
|
+
const updateComputedData = (0, import_hooks13.useUpdateNodeComputedData)();
|
|
542
|
+
(0, import_react14.useEffect)(() => {
|
|
780
543
|
if (incoming?.length > 0) {
|
|
781
544
|
const module2 = new import_modifier.Abs(incoming[0].module);
|
|
782
545
|
updateComputedData(id, { module: module2 });
|
|
783
546
|
}
|
|
784
547
|
}, [incoming]);
|
|
785
|
-
return /* @__PURE__ */ (0,
|
|
548
|
+
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" }) });
|
|
786
549
|
}
|
|
787
550
|
var noise_abs_node_default = NoiseAbsNode;
|
|
788
551
|
|
|
789
552
|
// src/nodes/modifiers/noise-clamp-node.tsx
|
|
790
|
-
var
|
|
791
|
-
var
|
|
792
|
-
var
|
|
793
|
-
var
|
|
553
|
+
var import_layout14 = require("@awesome-flow/core/layout");
|
|
554
|
+
var import_react15 = require("react");
|
|
555
|
+
var import_core5 = require("@mantine/core");
|
|
556
|
+
var import_hooks14 = require("@awesome-flow/core/hooks");
|
|
794
557
|
var import_modifier2 = require("libnoise-ts/module/modifier");
|
|
795
|
-
var
|
|
558
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
796
559
|
function NoiseClampNode({ id, selected, data, type }) {
|
|
797
|
-
const [lowerBound, setLowerBound] = (0,
|
|
798
|
-
const [upperBound, setUpperBound] = (0,
|
|
799
|
-
const incoming = (0,
|
|
800
|
-
const updateNodeData = (0,
|
|
801
|
-
const updateComputedData = (0,
|
|
802
|
-
(0,
|
|
560
|
+
const [lowerBound, setLowerBound] = (0, import_react15.useState)(data.lowerBound);
|
|
561
|
+
const [upperBound, setUpperBound] = (0, import_react15.useState)(data.upperBound);
|
|
562
|
+
const incoming = (0, import_hooks14.useIncomingComputedData)(id);
|
|
563
|
+
const updateNodeData = (0, import_hooks14.useUpdateNodeData)();
|
|
564
|
+
const updateComputedData = (0, import_hooks14.useUpdateNodeComputedData)();
|
|
565
|
+
(0, import_react15.useEffect)(() => {
|
|
803
566
|
if (incoming?.length) {
|
|
804
567
|
const module2 = new import_modifier2.Clamp(incoming[0].module, lowerBound, upperBound);
|
|
805
568
|
updateComputedData(id, { module: module2 });
|
|
806
569
|
}
|
|
807
570
|
updateNodeData(id, { lowerBound, upperBound });
|
|
808
571
|
}, [incoming, lowerBound, upperBound]);
|
|
809
|
-
return /* @__PURE__ */ (0,
|
|
810
|
-
/* @__PURE__ */ (0,
|
|
811
|
-
/* @__PURE__ */ (0,
|
|
812
|
-
|
|
572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_layout14.NodeContainer, { id, selected, data, type, children: [
|
|
573
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core5.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core5.Group, { children: [
|
|
574
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
575
|
+
import_core5.NumberInput,
|
|
813
576
|
{
|
|
814
577
|
size: "xs",
|
|
815
578
|
w: 100,
|
|
@@ -818,8 +581,8 @@ function NoiseClampNode({ id, selected, data, type }) {
|
|
|
818
581
|
step: 0.1
|
|
819
582
|
}
|
|
820
583
|
),
|
|
821
|
-
/* @__PURE__ */ (0,
|
|
822
|
-
|
|
584
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
585
|
+
import_core5.NumberInput,
|
|
823
586
|
{
|
|
824
587
|
size: "xs",
|
|
825
588
|
w: 100,
|
|
@@ -829,15 +592,15 @@ function NoiseClampNode({ id, selected, data, type }) {
|
|
|
829
592
|
}
|
|
830
593
|
)
|
|
831
594
|
] }) }),
|
|
832
|
-
/* @__PURE__ */ (0,
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_layout14.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
833
596
|
] });
|
|
834
597
|
}
|
|
835
598
|
var noise_clamp_node_default = NoiseClampNode;
|
|
836
599
|
|
|
837
600
|
// src/nodes/modifiers/noise-combine-node.tsx
|
|
838
|
-
var
|
|
839
|
-
var
|
|
840
|
-
var
|
|
601
|
+
var import_layout15 = require("@awesome-flow/core/layout");
|
|
602
|
+
var import_react16 = require("react");
|
|
603
|
+
var import_hooks15 = require("@awesome-flow/core/hooks");
|
|
841
604
|
var import_icons_react = require("@tabler/icons-react");
|
|
842
605
|
|
|
843
606
|
// src/abstract/operations.ts
|
|
@@ -851,45 +614,45 @@ var noiseCombineModuleMap = {
|
|
|
851
614
|
};
|
|
852
615
|
|
|
853
616
|
// src/nodes/modifiers/noise-combine-node.tsx
|
|
854
|
-
var
|
|
617
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
855
618
|
var options = {
|
|
856
|
-
add: /* @__PURE__ */ (0,
|
|
857
|
-
min: /* @__PURE__ */ (0,
|
|
858
|
-
max: /* @__PURE__ */ (0,
|
|
859
|
-
multiply: /* @__PURE__ */ (0,
|
|
860
|
-
power: /* @__PURE__ */ (0,
|
|
619
|
+
add: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconPlus, {}),
|
|
620
|
+
min: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronLeft, {}),
|
|
621
|
+
max: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronRight, {}),
|
|
622
|
+
multiply: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconAsterisk, {}),
|
|
623
|
+
power: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react.IconChevronUp, {})
|
|
861
624
|
};
|
|
862
625
|
function NoiseCombineNode({ id, selected, data, type }) {
|
|
863
|
-
const updateNodeData = (0,
|
|
864
|
-
const updateComputedData = (0,
|
|
865
|
-
const incoming = (0,
|
|
866
|
-
(0,
|
|
867
|
-
const ModuleFactory = noiseCombineModuleMap[data.operation];
|
|
626
|
+
const updateNodeData = (0, import_hooks15.useUpdateNodeData)();
|
|
627
|
+
const updateComputedData = (0, import_hooks15.useUpdateNodeComputedData)();
|
|
628
|
+
const incoming = (0, import_hooks15.useIncomingComputedData)(id);
|
|
629
|
+
(0, import_react16.useEffect)(() => {
|
|
630
|
+
const ModuleFactory = noiseCombineModuleMap[data.operation];
|
|
868
631
|
if (incoming?.length > 1) {
|
|
869
632
|
const module2 = new ModuleFactory(incoming[0].module, incoming[1].module);
|
|
870
633
|
updateComputedData(id, { module: module2 });
|
|
871
634
|
}
|
|
872
635
|
}, [data.operation, incoming]);
|
|
873
|
-
const onChange = (0,
|
|
636
|
+
const onChange = (0, import_react16.useCallback)((operation) => {
|
|
874
637
|
updateNodeData(id, { operation });
|
|
875
638
|
}, []);
|
|
876
|
-
return /* @__PURE__ */ (0,
|
|
877
|
-
/* @__PURE__ */ (0,
|
|
878
|
-
/* @__PURE__ */ (0,
|
|
639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_layout15.NodeContainer, { id, selected, data, type, children: [
|
|
640
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_layout15.NodeCombobox, { options, selected: data.operation, onChange, width: 150 }),
|
|
641
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_layout15.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
879
642
|
] });
|
|
880
643
|
}
|
|
881
644
|
var noise_combine_node_default = NoiseCombineNode;
|
|
882
645
|
|
|
883
646
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
884
|
-
var
|
|
885
|
-
var
|
|
886
|
-
var
|
|
647
|
+
var import_layout16 = require("@awesome-flow/core/layout");
|
|
648
|
+
var import_core6 = require("@mantine/core");
|
|
649
|
+
var import_hooks16 = require("@awesome-flow/core/hooks");
|
|
887
650
|
|
|
888
651
|
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
889
|
-
var
|
|
652
|
+
var import_react23 = require("react");
|
|
890
653
|
|
|
891
654
|
// ../../node_modules/@mantine/form/esm/actions/actions.mjs
|
|
892
|
-
var
|
|
655
|
+
var import_react17 = require("react");
|
|
893
656
|
function validateFormName(name) {
|
|
894
657
|
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
895
658
|
throw new Error(
|
|
@@ -897,7 +660,7 @@ function validateFormName(name) {
|
|
|
897
660
|
);
|
|
898
661
|
}
|
|
899
662
|
}
|
|
900
|
-
var useIsomorphicEffect = typeof window !== "undefined" ?
|
|
663
|
+
var useIsomorphicEffect = typeof window !== "undefined" ? import_react17.useLayoutEffect : import_react17.useEffect;
|
|
901
664
|
function useFormEvent(eventKey, handler) {
|
|
902
665
|
useIsomorphicEffect(() => {
|
|
903
666
|
if (eventKey) {
|
|
@@ -994,7 +757,7 @@ function getInputOnChange(setValue) {
|
|
|
994
757
|
}
|
|
995
758
|
|
|
996
759
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
997
|
-
var
|
|
760
|
+
var import_react18 = require("react");
|
|
998
761
|
|
|
999
762
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
1000
763
|
function filterErrors(errors) {
|
|
@@ -1012,14 +775,14 @@ function filterErrors(errors) {
|
|
|
1012
775
|
|
|
1013
776
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
1014
777
|
function useFormErrors(initialErrors) {
|
|
1015
|
-
const [errorsState, setErrorsState] = (0,
|
|
1016
|
-
const setErrors = (0,
|
|
778
|
+
const [errorsState, setErrorsState] = (0, import_react18.useState)(filterErrors(initialErrors));
|
|
779
|
+
const setErrors = (0, import_react18.useCallback)((errors) => {
|
|
1017
780
|
setErrorsState(
|
|
1018
781
|
(current) => filterErrors(typeof errors === "function" ? errors(current) : errors)
|
|
1019
782
|
);
|
|
1020
783
|
}, []);
|
|
1021
|
-
const clearErrors = (0,
|
|
1022
|
-
const clearFieldError = (0,
|
|
784
|
+
const clearErrors = (0, import_react18.useCallback)(() => setErrorsState({}), []);
|
|
785
|
+
const clearFieldError = (0, import_react18.useCallback)(
|
|
1023
786
|
(path) => {
|
|
1024
787
|
if (errorsState[path] === void 0) {
|
|
1025
788
|
return;
|
|
@@ -1032,7 +795,7 @@ function useFormErrors(initialErrors) {
|
|
|
1032
795
|
},
|
|
1033
796
|
[errorsState]
|
|
1034
797
|
);
|
|
1035
|
-
const setFieldError = (0,
|
|
798
|
+
const setFieldError = (0, import_react18.useCallback)(
|
|
1036
799
|
(path, error) => {
|
|
1037
800
|
if (error == null || error === false) {
|
|
1038
801
|
clearFieldError(path);
|
|
@@ -1052,7 +815,7 @@ function useFormErrors(initialErrors) {
|
|
|
1052
815
|
}
|
|
1053
816
|
|
|
1054
817
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
1055
|
-
var
|
|
818
|
+
var import_react19 = require("react");
|
|
1056
819
|
|
|
1057
820
|
// ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
1058
821
|
function clearListState(field, state) {
|
|
@@ -1276,7 +1039,7 @@ function useFormList({
|
|
|
1276
1039
|
$errors,
|
|
1277
1040
|
$status
|
|
1278
1041
|
}) {
|
|
1279
|
-
const reorderListItem = (0,
|
|
1042
|
+
const reorderListItem = (0, import_react19.useCallback)((path, payload) => {
|
|
1280
1043
|
$status.clearFieldDirty(path);
|
|
1281
1044
|
$errors.setErrors((errs) => reorderErrors(path, payload, errs));
|
|
1282
1045
|
$values.setValues({
|
|
@@ -1284,7 +1047,7 @@ function useFormList({
|
|
|
1284
1047
|
updateState: true
|
|
1285
1048
|
});
|
|
1286
1049
|
}, []);
|
|
1287
|
-
const removeListItem = (0,
|
|
1050
|
+
const removeListItem = (0, import_react19.useCallback)((path, index) => {
|
|
1288
1051
|
$status.clearFieldDirty(path);
|
|
1289
1052
|
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));
|
|
1290
1053
|
$values.setValues({
|
|
@@ -1292,7 +1055,7 @@ function useFormList({
|
|
|
1292
1055
|
updateState: true
|
|
1293
1056
|
});
|
|
1294
1057
|
}, []);
|
|
1295
|
-
const insertListItem = (0,
|
|
1058
|
+
const insertListItem = (0, import_react19.useCallback)((path, item, index) => {
|
|
1296
1059
|
$status.clearFieldDirty(path);
|
|
1297
1060
|
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));
|
|
1298
1061
|
$values.setValues({
|
|
@@ -1304,7 +1067,7 @@ function useFormList({
|
|
|
1304
1067
|
}
|
|
1305
1068
|
|
|
1306
1069
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1307
|
-
var
|
|
1070
|
+
var import_react20 = require("react");
|
|
1308
1071
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
1309
1072
|
|
|
1310
1073
|
// ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
@@ -1324,31 +1087,31 @@ function useFormStatus({
|
|
|
1324
1087
|
mode,
|
|
1325
1088
|
$values
|
|
1326
1089
|
}) {
|
|
1327
|
-
const [touchedState, setTouchedState] = (0,
|
|
1328
|
-
const [dirtyState, setDirtyState] = (0,
|
|
1329
|
-
const touchedRef = (0,
|
|
1330
|
-
const dirtyRef = (0,
|
|
1331
|
-
const setTouched = (0,
|
|
1090
|
+
const [touchedState, setTouchedState] = (0, import_react20.useState)(initialTouched);
|
|
1091
|
+
const [dirtyState, setDirtyState] = (0, import_react20.useState)(initialDirty);
|
|
1092
|
+
const touchedRef = (0, import_react20.useRef)(initialTouched);
|
|
1093
|
+
const dirtyRef = (0, import_react20.useRef)(initialDirty);
|
|
1094
|
+
const setTouched = (0, import_react20.useCallback)((values) => {
|
|
1332
1095
|
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
1333
1096
|
touchedRef.current = resolvedValues;
|
|
1334
1097
|
if (mode === "controlled") {
|
|
1335
1098
|
setTouchedState(resolvedValues);
|
|
1336
1099
|
}
|
|
1337
1100
|
}, []);
|
|
1338
|
-
const setDirty = (0,
|
|
1101
|
+
const setDirty = (0, import_react20.useCallback)((values) => {
|
|
1339
1102
|
const resolvedValues = typeof values === "function" ? values(dirtyRef.current) : values;
|
|
1340
1103
|
dirtyRef.current = resolvedValues;
|
|
1341
1104
|
if (mode === "controlled") {
|
|
1342
1105
|
setDirtyState(resolvedValues);
|
|
1343
1106
|
}
|
|
1344
1107
|
}, []);
|
|
1345
|
-
const resetTouched = (0,
|
|
1108
|
+
const resetTouched = (0, import_react20.useCallback)(() => setTouched({}), []);
|
|
1346
1109
|
const resetDirty = (values) => {
|
|
1347
1110
|
const newSnapshot = values ? { ...values, ...$values.refValues.current } : $values.refValues.current;
|
|
1348
1111
|
$values.setValuesSnapshot(newSnapshot);
|
|
1349
1112
|
setDirty({});
|
|
1350
1113
|
};
|
|
1351
|
-
const setFieldTouched = (0,
|
|
1114
|
+
const setFieldTouched = (0, import_react20.useCallback)((path, touched) => {
|
|
1352
1115
|
setTouched((currentTouched) => {
|
|
1353
1116
|
if (getStatus(currentTouched, path) === touched) {
|
|
1354
1117
|
return currentTouched;
|
|
@@ -1356,7 +1119,7 @@ function useFormStatus({
|
|
|
1356
1119
|
return { ...currentTouched, [path]: touched };
|
|
1357
1120
|
});
|
|
1358
1121
|
}, []);
|
|
1359
|
-
const setFieldDirty = (0,
|
|
1122
|
+
const setFieldDirty = (0, import_react20.useCallback)((path, dirty) => {
|
|
1360
1123
|
setDirty((currentDirty) => {
|
|
1361
1124
|
if (getStatus(currentDirty, path) === dirty) {
|
|
1362
1125
|
return currentDirty;
|
|
@@ -1364,11 +1127,11 @@ function useFormStatus({
|
|
|
1364
1127
|
return { ...currentDirty, [path]: dirty };
|
|
1365
1128
|
});
|
|
1366
1129
|
}, []);
|
|
1367
|
-
const isTouched = (0,
|
|
1130
|
+
const isTouched = (0, import_react20.useCallback)(
|
|
1368
1131
|
(path) => getStatus(touchedRef.current, path),
|
|
1369
1132
|
[]
|
|
1370
1133
|
);
|
|
1371
|
-
const clearFieldDirty = (0,
|
|
1134
|
+
const clearFieldDirty = (0, import_react20.useCallback)(
|
|
1372
1135
|
(path) => setDirty((current) => {
|
|
1373
1136
|
if (typeof path !== "string") {
|
|
1374
1137
|
return current;
|
|
@@ -1382,7 +1145,7 @@ function useFormStatus({
|
|
|
1382
1145
|
}),
|
|
1383
1146
|
[]
|
|
1384
1147
|
);
|
|
1385
|
-
const isDirty = (0,
|
|
1148
|
+
const isDirty = (0, import_react20.useCallback)((path) => {
|
|
1386
1149
|
if (path) {
|
|
1387
1150
|
const overriddenValue = getPath(path, dirtyRef.current);
|
|
1388
1151
|
if (typeof overriddenValue === "boolean") {
|
|
@@ -1398,8 +1161,8 @@ function useFormStatus({
|
|
|
1398
1161
|
}
|
|
1399
1162
|
return !(0, import_fast_deep_equal.default)($values.refValues.current, $values.valuesSnapshot.current);
|
|
1400
1163
|
}, []);
|
|
1401
|
-
const getDirty = (0,
|
|
1402
|
-
const getTouched = (0,
|
|
1164
|
+
const getDirty = (0, import_react20.useCallback)(() => dirtyRef.current, []);
|
|
1165
|
+
const getTouched = (0, import_react20.useCallback)(() => touchedRef.current, []);
|
|
1403
1166
|
return {
|
|
1404
1167
|
touchedState,
|
|
1405
1168
|
dirtyState,
|
|
@@ -1422,17 +1185,17 @@ function useFormStatus({
|
|
|
1422
1185
|
}
|
|
1423
1186
|
|
|
1424
1187
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1425
|
-
var
|
|
1188
|
+
var import_react21 = require("react");
|
|
1426
1189
|
function useFormValues({
|
|
1427
1190
|
initialValues,
|
|
1428
1191
|
onValuesChange,
|
|
1429
1192
|
mode
|
|
1430
1193
|
}) {
|
|
1431
|
-
const initialized = (0,
|
|
1432
|
-
const [stateValues, setStateValues] = (0,
|
|
1433
|
-
const refValues = (0,
|
|
1434
|
-
const valuesSnapshot = (0,
|
|
1435
|
-
const setValues = (0,
|
|
1194
|
+
const initialized = (0, import_react21.useRef)(false);
|
|
1195
|
+
const [stateValues, setStateValues] = (0, import_react21.useState)(initialValues || {});
|
|
1196
|
+
const refValues = (0, import_react21.useRef)(stateValues);
|
|
1197
|
+
const valuesSnapshot = (0, import_react21.useRef)(stateValues);
|
|
1198
|
+
const setValues = (0, import_react21.useCallback)(
|
|
1436
1199
|
({
|
|
1437
1200
|
values,
|
|
1438
1201
|
subscribers,
|
|
@@ -1449,7 +1212,7 @@ function useFormValues({
|
|
|
1449
1212
|
},
|
|
1450
1213
|
[onValuesChange]
|
|
1451
1214
|
);
|
|
1452
|
-
const setFieldValue = (0,
|
|
1215
|
+
const setFieldValue = (0, import_react21.useCallback)((payload) => {
|
|
1453
1216
|
const currentValue = getPath(payload.path, refValues.current);
|
|
1454
1217
|
const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;
|
|
1455
1218
|
if (currentValue !== updatedValue) {
|
|
@@ -1461,10 +1224,10 @@ function useFormValues({
|
|
|
1461
1224
|
);
|
|
1462
1225
|
}
|
|
1463
1226
|
}, []);
|
|
1464
|
-
const setValuesSnapshot = (0,
|
|
1227
|
+
const setValuesSnapshot = (0, import_react21.useCallback)((payload) => {
|
|
1465
1228
|
valuesSnapshot.current = payload;
|
|
1466
1229
|
}, []);
|
|
1467
|
-
const initialize = (0,
|
|
1230
|
+
const initialize = (0, import_react21.useCallback)((values, onInitialize) => {
|
|
1468
1231
|
if (!initialized.current) {
|
|
1469
1232
|
initialized.current = true;
|
|
1470
1233
|
setValues({ values, updateState: mode === "controlled" });
|
|
@@ -1472,14 +1235,14 @@ function useFormValues({
|
|
|
1472
1235
|
onInitialize();
|
|
1473
1236
|
}
|
|
1474
1237
|
}, []);
|
|
1475
|
-
const resetValues = (0,
|
|
1238
|
+
const resetValues = (0, import_react21.useCallback)(() => {
|
|
1476
1239
|
setValues({
|
|
1477
1240
|
values: valuesSnapshot.current,
|
|
1478
1241
|
updateState: true,
|
|
1479
1242
|
mergeWithPreviousValues: false
|
|
1480
1243
|
});
|
|
1481
1244
|
}, []);
|
|
1482
|
-
const getValues = (0,
|
|
1245
|
+
const getValues = (0, import_react21.useCallback)(() => refValues.current, []);
|
|
1483
1246
|
return {
|
|
1484
1247
|
initialized,
|
|
1485
1248
|
stateValues,
|
|
@@ -1495,15 +1258,15 @@ function useFormValues({
|
|
|
1495
1258
|
}
|
|
1496
1259
|
|
|
1497
1260
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1498
|
-
var
|
|
1261
|
+
var import_react22 = require("react");
|
|
1499
1262
|
function useFormWatch({
|
|
1500
1263
|
$status
|
|
1501
1264
|
}) {
|
|
1502
|
-
const subscribers = (0,
|
|
1265
|
+
const subscribers = (0, import_react22.useRef)(
|
|
1503
1266
|
{}
|
|
1504
1267
|
);
|
|
1505
|
-
const watch = (0,
|
|
1506
|
-
(0,
|
|
1268
|
+
const watch = (0, import_react22.useCallback)((path, callback) => {
|
|
1269
|
+
(0, import_react22.useEffect)(() => {
|
|
1507
1270
|
subscribers.current[path] = subscribers.current[path] || [];
|
|
1508
1271
|
subscribers.current[path].push(callback);
|
|
1509
1272
|
return () => {
|
|
@@ -1511,7 +1274,7 @@ function useFormWatch({
|
|
|
1511
1274
|
};
|
|
1512
1275
|
}, [callback]);
|
|
1513
1276
|
}, []);
|
|
1514
|
-
const getFieldSubscribers = (0,
|
|
1277
|
+
const getFieldSubscribers = (0, import_react22.useCallback)((path) => {
|
|
1515
1278
|
if (!subscribers.current[path]) {
|
|
1516
1279
|
return [];
|
|
1517
1280
|
}
|
|
@@ -1531,6 +1294,11 @@ function useFormWatch({
|
|
|
1531
1294
|
};
|
|
1532
1295
|
}
|
|
1533
1296
|
|
|
1297
|
+
// ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1298
|
+
function getDataPath(formName, fieldPath) {
|
|
1299
|
+
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1534
1302
|
// ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1535
1303
|
function getValidationResults(errors) {
|
|
1536
1304
|
const filteredErrors = filterErrors(errors);
|
|
@@ -1619,20 +1387,20 @@ function useForm({
|
|
|
1619
1387
|
const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });
|
|
1620
1388
|
const $list = useFormList({ $values, $errors, $status });
|
|
1621
1389
|
const $watch = useFormWatch({ $status });
|
|
1622
|
-
const [formKey, setFormKey] = (0,
|
|
1623
|
-
const [fieldKeys, setFieldKeys] = (0,
|
|
1624
|
-
const reset = (0,
|
|
1390
|
+
const [formKey, setFormKey] = (0, import_react23.useState)(0);
|
|
1391
|
+
const [fieldKeys, setFieldKeys] = (0, import_react23.useState)({});
|
|
1392
|
+
const reset = (0, import_react23.useCallback)(() => {
|
|
1625
1393
|
$values.resetValues();
|
|
1626
1394
|
$errors.clearErrors();
|
|
1627
1395
|
$status.resetDirty();
|
|
1628
1396
|
$status.resetTouched();
|
|
1629
1397
|
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
1630
1398
|
}, []);
|
|
1631
|
-
const initialize = (0,
|
|
1399
|
+
const initialize = (0, import_react23.useCallback)((values) => {
|
|
1632
1400
|
$values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
|
|
1633
1401
|
}, []);
|
|
1634
|
-
const setFieldValue = (0,
|
|
1635
|
-
(path, value,
|
|
1402
|
+
const setFieldValue = (0, import_react23.useCallback)(
|
|
1403
|
+
(path, value, options2) => {
|
|
1636
1404
|
const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
|
|
1637
1405
|
$status.clearFieldDirty(path);
|
|
1638
1406
|
$status.setFieldTouched(path, true);
|
|
@@ -1647,7 +1415,7 @@ function useForm({
|
|
|
1647
1415
|
const validationResults = validateFieldValue(path, rules, payload.updatedValues);
|
|
1648
1416
|
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
1649
1417
|
} : null,
|
|
1650
|
-
|
|
1418
|
+
options2?.forceUpdate !== false && mode !== "controlled" ? () => setFieldKeys((keys) => ({
|
|
1651
1419
|
...keys,
|
|
1652
1420
|
[path]: (keys[path] || 0) + 1
|
|
1653
1421
|
})) : null
|
|
@@ -1656,7 +1424,7 @@ function useForm({
|
|
|
1656
1424
|
},
|
|
1657
1425
|
[onValuesChange, rules]
|
|
1658
1426
|
);
|
|
1659
|
-
const setValues = (0,
|
|
1427
|
+
const setValues = (0, import_react23.useCallback)(
|
|
1660
1428
|
(values) => {
|
|
1661
1429
|
const previousValues = $values.refValues.current;
|
|
1662
1430
|
$values.setValues({ values, updateState: mode === "controlled" });
|
|
@@ -1672,12 +1440,12 @@ function useForm({
|
|
|
1672
1440
|
},
|
|
1673
1441
|
[onValuesChange, clearInputErrorOnChange]
|
|
1674
1442
|
);
|
|
1675
|
-
const validate = (0,
|
|
1443
|
+
const validate = (0, import_react23.useCallback)(() => {
|
|
1676
1444
|
const results = validateValues(rules, $values.refValues.current);
|
|
1677
1445
|
$errors.setErrors(results.errors);
|
|
1678
1446
|
return results;
|
|
1679
1447
|
}, [rules]);
|
|
1680
|
-
const validateField = (0,
|
|
1448
|
+
const validateField = (0, import_react23.useCallback)(
|
|
1681
1449
|
(path) => {
|
|
1682
1450
|
const results = validateFieldValue(path, rules, $values.refValues.current);
|
|
1683
1451
|
results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);
|
|
@@ -1689,7 +1457,7 @@ function useForm({
|
|
|
1689
1457
|
const onChange = getInputOnChange(
|
|
1690
1458
|
(value) => setFieldValue(path, value, { forceUpdate: false })
|
|
1691
1459
|
);
|
|
1692
|
-
const payload = { onChange };
|
|
1460
|
+
const payload = { onChange, "data-path": getDataPath(name, path) };
|
|
1693
1461
|
if (withError) {
|
|
1694
1462
|
payload.error = $errors.errorsState[path];
|
|
1695
1463
|
}
|
|
@@ -1733,15 +1501,19 @@ function useForm({
|
|
|
1733
1501
|
}
|
|
1734
1502
|
};
|
|
1735
1503
|
const getTransformedValues = (input) => transformValues(input || $values.refValues.current);
|
|
1736
|
-
const onReset = (0,
|
|
1504
|
+
const onReset = (0, import_react23.useCallback)((event) => {
|
|
1737
1505
|
event.preventDefault();
|
|
1738
1506
|
reset();
|
|
1739
1507
|
}, []);
|
|
1740
|
-
const isValid = (0,
|
|
1508
|
+
const isValid = (0, import_react23.useCallback)(
|
|
1741
1509
|
(path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,
|
|
1742
1510
|
[rules]
|
|
1743
1511
|
);
|
|
1744
1512
|
const key = (path) => `${formKey}-${path}-${fieldKeys[path] || 0}`;
|
|
1513
|
+
const getInputNode = (0, import_react23.useCallback)(
|
|
1514
|
+
(path) => document.querySelector(`[data-path="${getDataPath(name, path)}"]`),
|
|
1515
|
+
[]
|
|
1516
|
+
);
|
|
1745
1517
|
const form = {
|
|
1746
1518
|
watch: $watch.watch,
|
|
1747
1519
|
initialized: $values.initialized.current,
|
|
@@ -1775,25 +1547,26 @@ function useForm({
|
|
|
1775
1547
|
onReset,
|
|
1776
1548
|
isValid,
|
|
1777
1549
|
getTransformedValues,
|
|
1778
|
-
key
|
|
1550
|
+
key,
|
|
1551
|
+
getInputNode
|
|
1779
1552
|
};
|
|
1780
1553
|
useFormActions(name, form);
|
|
1781
1554
|
return form;
|
|
1782
1555
|
}
|
|
1783
1556
|
|
|
1784
1557
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
1785
|
-
var
|
|
1558
|
+
var import_react24 = require("react");
|
|
1786
1559
|
var import_modifier3 = require("libnoise-ts/module/modifier");
|
|
1787
1560
|
var import_util = require("libnoise-ts/util");
|
|
1788
1561
|
var import_icons_react2 = require("@tabler/icons-react");
|
|
1789
|
-
var
|
|
1790
|
-
var
|
|
1791
|
-
var
|
|
1562
|
+
var import_hooks17 = require("@mantine/hooks");
|
|
1563
|
+
var import_abstract2 = require("@awesome-flow/core/abstract");
|
|
1564
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1792
1565
|
function NoiseCurveNode({ id, selected, data, type }) {
|
|
1793
|
-
const incoming = (0,
|
|
1794
|
-
const updateNodeData = (0,
|
|
1795
|
-
const updateComputedData = (0,
|
|
1796
|
-
const [values, setValues] = (0,
|
|
1566
|
+
const incoming = (0, import_hooks16.useIncomingComputedData)(id);
|
|
1567
|
+
const updateNodeData = (0, import_hooks16.useUpdateNodeData)();
|
|
1568
|
+
const updateComputedData = (0, import_hooks16.useUpdateNodeComputedData)();
|
|
1569
|
+
const [values, setValues] = (0, import_react24.useState)([]);
|
|
1797
1570
|
const form = useForm({
|
|
1798
1571
|
mode: "uncontrolled",
|
|
1799
1572
|
initialValues: {
|
|
@@ -1812,7 +1585,7 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1812
1585
|
}
|
|
1813
1586
|
}
|
|
1814
1587
|
},
|
|
1815
|
-
onValuesChange: (0,
|
|
1588
|
+
onValuesChange: (0, import_react24.useCallback)((values2) => {
|
|
1816
1589
|
if (form.isValid()) {
|
|
1817
1590
|
const points = values2.points.map((v) => ({ input: v.input, output: v.output }));
|
|
1818
1591
|
setValues(points);
|
|
@@ -1821,11 +1594,11 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1821
1594
|
form.validate();
|
|
1822
1595
|
}, [])
|
|
1823
1596
|
});
|
|
1824
|
-
(0,
|
|
1825
|
-
const points = data.points?.length ? data.points.map((v) => ({ input: v.input, output: v.output, key: (0,
|
|
1597
|
+
(0, import_react24.useEffect)(() => {
|
|
1598
|
+
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)() }));
|
|
1826
1599
|
form.initialize({ points });
|
|
1827
1600
|
}, []);
|
|
1828
|
-
(0,
|
|
1601
|
+
(0, import_react24.useEffect)(() => {
|
|
1829
1602
|
if (incoming?.length && values?.length >= 4) {
|
|
1830
1603
|
const module2 = new import_modifier3.Curve(
|
|
1831
1604
|
incoming[0].module,
|
|
@@ -1834,9 +1607,9 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1834
1607
|
updateComputedData(id, { module: module2 });
|
|
1835
1608
|
}
|
|
1836
1609
|
}, [values, incoming]);
|
|
1837
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0,
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1839
|
-
|
|
1610
|
+
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core6.Group, { mt: "xs", children: [
|
|
1611
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1612
|
+
import_core6.NumberInput,
|
|
1840
1613
|
{
|
|
1841
1614
|
size: "xs",
|
|
1842
1615
|
w: 100,
|
|
@@ -1846,8 +1619,8 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1846
1619
|
},
|
|
1847
1620
|
form.key(`points.${index}.input`)
|
|
1848
1621
|
),
|
|
1849
|
-
/* @__PURE__ */ (0,
|
|
1850
|
-
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1623
|
+
import_core6.NumberInput,
|
|
1851
1624
|
{
|
|
1852
1625
|
size: "xs",
|
|
1853
1626
|
w: 100,
|
|
@@ -1857,61 +1630,61 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1857
1630
|
},
|
|
1858
1631
|
form.key(`points.${index}.output`)
|
|
1859
1632
|
),
|
|
1860
|
-
data.state ===
|
|
1861
|
-
|
|
1633
|
+
data.state === import_abstract2.NodeState.edit && values.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1634
|
+
import_core6.ActionIcon,
|
|
1862
1635
|
{
|
|
1863
1636
|
color: "red",
|
|
1864
1637
|
variant: "outline",
|
|
1865
1638
|
size: "sm",
|
|
1866
1639
|
onClick: () => form.removeListItem("points", index),
|
|
1867
|
-
children: /* @__PURE__ */ (0,
|
|
1640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons_react2.IconX, { size: "1rem" })
|
|
1868
1641
|
}
|
|
1869
1642
|
)
|
|
1870
1643
|
] }, item.key));
|
|
1871
|
-
return /* @__PURE__ */ (0,
|
|
1644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_layout16.NodeContainer, { id, selected, type, data, children: [
|
|
1872
1645
|
fields,
|
|
1873
|
-
data.state ===
|
|
1874
|
-
/* @__PURE__ */ (0,
|
|
1875
|
-
/* @__PURE__ */ (0,
|
|
1876
|
-
|
|
1646
|
+
data.state === import_abstract2.NodeState.edit && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1647
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core6.Space, { h: 10 }),
|
|
1648
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1649
|
+
import_core6.Button,
|
|
1877
1650
|
{
|
|
1878
1651
|
variant: "outline",
|
|
1879
1652
|
size: "xs",
|
|
1880
1653
|
fullWidth: true,
|
|
1881
|
-
onClick: () => form.insertListItem("points", { input: 0, output: 0, key: (0,
|
|
1654
|
+
onClick: () => form.insertListItem("points", { input: 0, output: 0, key: (0, import_hooks17.randomId)() }),
|
|
1882
1655
|
children: "Add control point"
|
|
1883
1656
|
}
|
|
1884
1657
|
)
|
|
1885
1658
|
] }),
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
1659
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_layout16.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1887
1660
|
] });
|
|
1888
1661
|
}
|
|
1889
1662
|
var noise_curve_node_default = NoiseCurveNode;
|
|
1890
1663
|
|
|
1891
1664
|
// src/nodes/modifiers/noise-exponent-node.tsx
|
|
1892
|
-
var
|
|
1893
|
-
var
|
|
1894
|
-
var
|
|
1895
|
-
var
|
|
1665
|
+
var import_layout17 = require("@awesome-flow/core/layout");
|
|
1666
|
+
var import_react25 = require("react");
|
|
1667
|
+
var import_core7 = require("@mantine/core");
|
|
1668
|
+
var import_hooks18 = require("@awesome-flow/core/hooks");
|
|
1896
1669
|
var import_modifier4 = require("libnoise-ts/module/modifier");
|
|
1897
|
-
var
|
|
1670
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1898
1671
|
function NoiseExponentNode({ id, selected, data, type }) {
|
|
1899
|
-
const [exponent, setExponent] = (0,
|
|
1900
|
-
const incoming = (0,
|
|
1901
|
-
const updateNodeData = (0,
|
|
1902
|
-
const updateComputedData = (0,
|
|
1903
|
-
(0,
|
|
1672
|
+
const [exponent, setExponent] = (0, import_react25.useState)(data.exponent);
|
|
1673
|
+
const incoming = (0, import_hooks18.useIncomingComputedData)(id);
|
|
1674
|
+
const updateNodeData = (0, import_hooks18.useUpdateNodeData)();
|
|
1675
|
+
const updateComputedData = (0, import_hooks18.useUpdateNodeComputedData)();
|
|
1676
|
+
(0, import_react25.useEffect)(() => {
|
|
1904
1677
|
if (incoming?.length > 0) {
|
|
1905
1678
|
const module2 = new import_modifier4.Exponent(incoming[0].module, exponent);
|
|
1906
1679
|
updateComputedData(id, { module: module2 });
|
|
1907
1680
|
}
|
|
1908
1681
|
updateNodeData(id, { exponent });
|
|
1909
1682
|
}, [incoming, exponent]);
|
|
1910
|
-
return /* @__PURE__ */ (0,
|
|
1911
|
-
/* @__PURE__ */ (0,
|
|
1683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_layout17.NodeContainer, { id, selected, data, type, children: [
|
|
1684
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core7.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core7.Group, { children: [
|
|
1912
1685
|
"Exponent:",
|
|
1913
|
-
/* @__PURE__ */ (0,
|
|
1914
|
-
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1687
|
+
import_core7.NumberInput,
|
|
1915
1688
|
{
|
|
1916
1689
|
size: "xs",
|
|
1917
1690
|
value: exponent,
|
|
@@ -1920,35 +1693,35 @@ function NoiseExponentNode({ id, selected, data, type }) {
|
|
|
1920
1693
|
}
|
|
1921
1694
|
)
|
|
1922
1695
|
] }) }),
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_layout17.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
1924
1697
|
] });
|
|
1925
1698
|
}
|
|
1926
1699
|
var noise_exponent_node_default = NoiseExponentNode;
|
|
1927
1700
|
|
|
1928
1701
|
// src/nodes/modifiers/noise-invert-node.tsx
|
|
1929
|
-
var
|
|
1930
|
-
var
|
|
1931
|
-
var
|
|
1702
|
+
var import_layout18 = require("@awesome-flow/core/layout");
|
|
1703
|
+
var import_react26 = require("react");
|
|
1704
|
+
var import_hooks19 = require("@awesome-flow/core/hooks");
|
|
1932
1705
|
var import_modifier5 = require("libnoise-ts/module/modifier");
|
|
1933
|
-
var
|
|
1706
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1934
1707
|
function NoiseInvertNode({ id, selected, data, type }) {
|
|
1935
|
-
const incoming = (0,
|
|
1936
|
-
const updateComputedData = (0,
|
|
1937
|
-
(0,
|
|
1708
|
+
const incoming = (0, import_hooks19.useIncomingComputedData)(id);
|
|
1709
|
+
const updateComputedData = (0, import_hooks19.useUpdateNodeComputedData)();
|
|
1710
|
+
(0, import_react26.useEffect)(() => {
|
|
1938
1711
|
if (incoming?.length > 0) {
|
|
1939
1712
|
const module2 = new import_modifier5.Invert(incoming[0].module);
|
|
1940
1713
|
updateComputedData(id, { module: module2 });
|
|
1941
1714
|
}
|
|
1942
1715
|
}, [incoming]);
|
|
1943
|
-
return /* @__PURE__ */ (0,
|
|
1716
|
+
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" }) });
|
|
1944
1717
|
}
|
|
1945
1718
|
var noise_invert_node_default = NoiseInvertNode;
|
|
1946
1719
|
|
|
1947
1720
|
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
1948
|
-
var
|
|
1949
|
-
var
|
|
1950
|
-
var
|
|
1951
|
-
var
|
|
1721
|
+
var import_layout19 = require("@awesome-flow/core/layout");
|
|
1722
|
+
var import_react27 = require("react");
|
|
1723
|
+
var import_core8 = require("@mantine/core");
|
|
1724
|
+
var import_hooks20 = require("@awesome-flow/core/hooks");
|
|
1952
1725
|
|
|
1953
1726
|
// src/modules/normalize-noise-module.ts
|
|
1954
1727
|
var import_modifier6 = __toESM(require("libnoise-ts/module/modifier"), 1);
|
|
@@ -1967,14 +1740,14 @@ function normalize(value, min, max) {
|
|
|
1967
1740
|
}
|
|
1968
1741
|
|
|
1969
1742
|
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
1970
|
-
var
|
|
1743
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1971
1744
|
function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
1972
|
-
const [intervalStart, setIntervalStart] = (0,
|
|
1973
|
-
const [intervalEnd, setIntervalEnd] = (0,
|
|
1974
|
-
const incoming = (0,
|
|
1975
|
-
const updateNodeData = (0,
|
|
1976
|
-
const updateComputedData = (0,
|
|
1977
|
-
(0,
|
|
1745
|
+
const [intervalStart, setIntervalStart] = (0, import_react27.useState)(data.intervalStart);
|
|
1746
|
+
const [intervalEnd, setIntervalEnd] = (0, import_react27.useState)(data.intervalEnd);
|
|
1747
|
+
const incoming = (0, import_hooks20.useIncomingComputedData)(id);
|
|
1748
|
+
const updateNodeData = (0, import_hooks20.useUpdateNodeData)();
|
|
1749
|
+
const updateComputedData = (0, import_hooks20.useUpdateNodeComputedData)();
|
|
1750
|
+
(0, import_react27.useEffect)(() => {
|
|
1978
1751
|
if (incoming?.length) {
|
|
1979
1752
|
const source = incoming[0].module;
|
|
1980
1753
|
const module2 = new NormalizeNoiseModule(source, intervalStart, intervalEnd);
|
|
@@ -1982,10 +1755,10 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
1982
1755
|
}
|
|
1983
1756
|
updateNodeData(id, { intervalStart, intervalEnd });
|
|
1984
1757
|
}, [incoming, intervalStart, intervalEnd]);
|
|
1985
|
-
return /* @__PURE__ */ (0,
|
|
1986
|
-
/* @__PURE__ */ (0,
|
|
1987
|
-
/* @__PURE__ */ (0,
|
|
1988
|
-
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_layout19.NodeContainer, { id, selected, data, type, children: [
|
|
1759
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core8.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core8.Group, { children: [
|
|
1760
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1761
|
+
import_core8.NumberInput,
|
|
1989
1762
|
{
|
|
1990
1763
|
size: "xs",
|
|
1991
1764
|
w: 100,
|
|
@@ -1993,8 +1766,8 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
1993
1766
|
onChange: (e) => setIntervalStart(Number(e))
|
|
1994
1767
|
}
|
|
1995
1768
|
),
|
|
1996
|
-
/* @__PURE__ */ (0,
|
|
1997
|
-
|
|
1769
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1770
|
+
import_core8.NumberInput,
|
|
1998
1771
|
{
|
|
1999
1772
|
size: "xs",
|
|
2000
1773
|
w: 100,
|
|
@@ -2003,37 +1776,37 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
2003
1776
|
}
|
|
2004
1777
|
)
|
|
2005
1778
|
] }) }),
|
|
2006
|
-
/* @__PURE__ */ (0,
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_layout19.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2007
1780
|
] });
|
|
2008
1781
|
}
|
|
2009
1782
|
var noise_normalize_node_default = NoiseNormalizeNode;
|
|
2010
1783
|
|
|
2011
1784
|
// src/nodes/modifiers/noise-scale-bias-node.tsx
|
|
2012
|
-
var
|
|
2013
|
-
var
|
|
2014
|
-
var
|
|
2015
|
-
var
|
|
1785
|
+
var import_layout20 = require("@awesome-flow/core/layout");
|
|
1786
|
+
var import_react28 = require("react");
|
|
1787
|
+
var import_core9 = require("@mantine/core");
|
|
1788
|
+
var import_hooks21 = require("@awesome-flow/core/hooks");
|
|
2016
1789
|
var import_modifier7 = require("libnoise-ts/module/modifier");
|
|
2017
|
-
var
|
|
1790
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2018
1791
|
function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
2019
|
-
const [scale, setScale] = (0,
|
|
2020
|
-
const [bias, setBias] = (0,
|
|
2021
|
-
const incoming = (0,
|
|
2022
|
-
const updateNodeData = (0,
|
|
2023
|
-
const updateComputedData = (0,
|
|
2024
|
-
(0,
|
|
1792
|
+
const [scale, setScale] = (0, import_react28.useState)(data.scale);
|
|
1793
|
+
const [bias, setBias] = (0, import_react28.useState)(data.bias);
|
|
1794
|
+
const incoming = (0, import_hooks21.useIncomingComputedData)(id);
|
|
1795
|
+
const updateNodeData = (0, import_hooks21.useUpdateNodeData)();
|
|
1796
|
+
const updateComputedData = (0, import_hooks21.useUpdateNodeComputedData)();
|
|
1797
|
+
(0, import_react28.useEffect)(() => {
|
|
2025
1798
|
if (incoming?.length > 0) {
|
|
2026
1799
|
const module2 = new import_modifier7.ScaleBias(incoming[0].module, scale, bias);
|
|
2027
1800
|
updateComputedData(id, { module: module2 });
|
|
2028
1801
|
}
|
|
2029
1802
|
updateNodeData(id, { scale, bias });
|
|
2030
1803
|
}, [incoming, scale, bias]);
|
|
2031
|
-
return /* @__PURE__ */ (0,
|
|
2032
|
-
/* @__PURE__ */ (0,
|
|
2033
|
-
/* @__PURE__ */ (0,
|
|
1804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_layout20.NodeContainer, { id, selected, data, type, children: [
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core9.Stack, { children: [
|
|
1806
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core9.Group, { children: [
|
|
2034
1807
|
"Scale:",
|
|
2035
|
-
/* @__PURE__ */ (0,
|
|
2036
|
-
|
|
1808
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1809
|
+
import_core9.NumberInput,
|
|
2037
1810
|
{
|
|
2038
1811
|
size: "xs",
|
|
2039
1812
|
w: 100,
|
|
@@ -2043,10 +1816,10 @@ function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
|
2043
1816
|
}
|
|
2044
1817
|
)
|
|
2045
1818
|
] }),
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core9.Group, { children: [
|
|
2047
1820
|
"Bias:",
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2049
|
-
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1822
|
+
import_core9.NumberInput,
|
|
2050
1823
|
{
|
|
2051
1824
|
size: "xs",
|
|
2052
1825
|
w: 100,
|
|
@@ -2057,26 +1830,26 @@ function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
|
2057
1830
|
)
|
|
2058
1831
|
] })
|
|
2059
1832
|
] }),
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
1833
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_layout20.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2061
1834
|
] });
|
|
2062
1835
|
}
|
|
2063
1836
|
var noise_scale_bias_node_default = NoiseScaleBiasNode;
|
|
2064
1837
|
|
|
2065
1838
|
// src/nodes/modifiers/noise-terrace-node.tsx
|
|
2066
|
-
var
|
|
2067
|
-
var
|
|
2068
|
-
var
|
|
2069
|
-
var
|
|
1839
|
+
var import_layout21 = require("@awesome-flow/core/layout");
|
|
1840
|
+
var import_core10 = require("@mantine/core");
|
|
1841
|
+
var import_hooks22 = require("@awesome-flow/core/hooks");
|
|
1842
|
+
var import_react29 = require("react");
|
|
2070
1843
|
var import_modifier8 = require("libnoise-ts/module/modifier");
|
|
2071
1844
|
var import_icons_react3 = require("@tabler/icons-react");
|
|
2072
|
-
var
|
|
2073
|
-
var
|
|
2074
|
-
var
|
|
1845
|
+
var import_hooks23 = require("@mantine/hooks");
|
|
1846
|
+
var import_abstract3 = require("@awesome-flow/core/abstract");
|
|
1847
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2075
1848
|
function NoiseTerraceNode({ id, selected, data, type }) {
|
|
2076
|
-
const incoming = (0,
|
|
2077
|
-
const updateNodeData = (0,
|
|
2078
|
-
const updateComputedData = (0,
|
|
2079
|
-
const [values, setValues] = (0,
|
|
1849
|
+
const incoming = (0, import_hooks22.useIncomingComputedData)(id);
|
|
1850
|
+
const updateNodeData = (0, import_hooks22.useUpdateNodeData)();
|
|
1851
|
+
const updateComputedData = (0, import_hooks22.useUpdateNodeComputedData)();
|
|
1852
|
+
const [values, setValues] = (0, import_react29.useState)([]);
|
|
2080
1853
|
const form = useForm({
|
|
2081
1854
|
mode: "uncontrolled",
|
|
2082
1855
|
initialValues: {
|
|
@@ -2084,7 +1857,7 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
2084
1857
|
},
|
|
2085
1858
|
validateInputOnChange: [`points.${FORM_INDEX}.input`],
|
|
2086
1859
|
clearInputErrorOnChange: true,
|
|
2087
|
-
onValuesChange: (0,
|
|
1860
|
+
onValuesChange: (0, import_react29.useCallback)((values2) => {
|
|
2088
1861
|
if (form.isValid()) {
|
|
2089
1862
|
const points = values2.points.map((v) => v.value);
|
|
2090
1863
|
setValues(points);
|
|
@@ -2093,19 +1866,19 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
2093
1866
|
form.validate();
|
|
2094
1867
|
}, [])
|
|
2095
1868
|
});
|
|
2096
|
-
(0,
|
|
2097
|
-
const points = data.points?.length ? data.points.map((v) => ({ value: v, key: (0,
|
|
1869
|
+
(0, import_react29.useEffect)(() => {
|
|
1870
|
+
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)() }));
|
|
2098
1871
|
form.initialize({ points });
|
|
2099
1872
|
}, []);
|
|
2100
|
-
(0,
|
|
1873
|
+
(0, import_react29.useEffect)(() => {
|
|
2101
1874
|
if (incoming?.length && values?.length >= 2) {
|
|
2102
1875
|
const module2 = new import_modifier8.Terrace(incoming[0].module, values);
|
|
2103
1876
|
updateComputedData(id, { module: module2 });
|
|
2104
1877
|
}
|
|
2105
1878
|
}, [values, incoming]);
|
|
2106
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0,
|
|
2107
|
-
/* @__PURE__ */ (0,
|
|
2108
|
-
|
|
1879
|
+
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core10.Group, { mt: "xs", children: [
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1881
|
+
import_core10.NumberInput,
|
|
2109
1882
|
{
|
|
2110
1883
|
size: "xs",
|
|
2111
1884
|
placeholder: "Input Value",
|
|
@@ -2114,113 +1887,53 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
2114
1887
|
},
|
|
2115
1888
|
form.key(`points.${index}.value`)
|
|
2116
1889
|
),
|
|
2117
|
-
data.state ===
|
|
2118
|
-
|
|
1890
|
+
data.state === import_abstract3.NodeState.edit && values.length > 2 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1891
|
+
import_core10.ActionIcon,
|
|
2119
1892
|
{
|
|
2120
1893
|
color: "red",
|
|
2121
1894
|
variant: "outline",
|
|
2122
1895
|
size: "sm",
|
|
2123
1896
|
onClick: () => form.removeListItem("points", index),
|
|
2124
|
-
children: /* @__PURE__ */ (0,
|
|
1897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons_react3.IconX, { size: "1rem" })
|
|
2125
1898
|
}
|
|
2126
1899
|
)
|
|
2127
1900
|
] }, item.key));
|
|
2128
|
-
return /* @__PURE__ */ (0,
|
|
1901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_layout21.NodeContainer, { id, selected, type, data, children: [
|
|
2129
1902
|
fields,
|
|
2130
|
-
data.state ===
|
|
2131
|
-
/* @__PURE__ */ (0,
|
|
2132
|
-
/* @__PURE__ */ (0,
|
|
2133
|
-
|
|
1903
|
+
data.state === import_abstract3.NodeState.edit && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1904
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core10.Space, { h: 10 }),
|
|
1905
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1906
|
+
import_core10.Button,
|
|
2134
1907
|
{
|
|
2135
1908
|
variant: "outline",
|
|
2136
1909
|
size: "xs",
|
|
2137
1910
|
fullWidth: true,
|
|
2138
|
-
onClick: () => form.insertListItem("points", { value: 0, key: (0,
|
|
1911
|
+
onClick: () => form.insertListItem("points", { value: 0, key: (0, import_hooks23.randomId)() }),
|
|
2139
1912
|
children: "Add control point"
|
|
2140
1913
|
}
|
|
2141
1914
|
)
|
|
2142
1915
|
] }),
|
|
2143
|
-
/* @__PURE__ */ (0,
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_layout21.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2144
1917
|
] });
|
|
2145
1918
|
}
|
|
2146
1919
|
var noise_terrace_node_default = NoiseTerraceNode;
|
|
2147
1920
|
|
|
2148
|
-
// src/nodes/modifiers/variable-combine-node.tsx
|
|
2149
|
-
var import_layout24 = require("@awesome-flow/core/layout");
|
|
2150
|
-
var import_react33 = require("react");
|
|
2151
|
-
var import_hooks26 = require("@awesome-flow/core/hooks");
|
|
2152
|
-
var import_icons_react4 = require("@tabler/icons-react");
|
|
2153
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2154
|
-
var options2 = {
|
|
2155
|
-
add: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons_react4.IconPlus, {}),
|
|
2156
|
-
divide: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons_react4.IconDivide, {}),
|
|
2157
|
-
min: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons_react4.IconChevronLeft, {}),
|
|
2158
|
-
max: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons_react4.IconChevronRight, {}),
|
|
2159
|
-
multiply: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons_react4.IconAsterisk, {}),
|
|
2160
|
-
power: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons_react4.IconChevronUp, {})
|
|
2161
|
-
};
|
|
2162
|
-
function VariableCombineNode({
|
|
2163
|
-
id,
|
|
2164
|
-
selected,
|
|
2165
|
-
data,
|
|
2166
|
-
type
|
|
2167
|
-
}) {
|
|
2168
|
-
const [operation, setOperation] = (0, import_react33.useState)(data.operation);
|
|
2169
|
-
const [value, setValue] = (0, import_react33.useState)(data.value);
|
|
2170
|
-
const updateNodeData = (0, import_hooks26.useUpdateNodeData)();
|
|
2171
|
-
const incoming = (0, import_hooks26.useIncomingNodeData)(id);
|
|
2172
|
-
(0, import_react33.useEffect)(() => {
|
|
2173
|
-
if (incoming?.length > 1) {
|
|
2174
|
-
const result = getOperationResult(operation, incoming[0].value, incoming[1].value);
|
|
2175
|
-
setValue(result);
|
|
2176
|
-
updateNodeData(id, { value: result });
|
|
2177
|
-
}
|
|
2178
|
-
}, [operation, incoming]);
|
|
2179
|
-
const onChange = (0, import_react33.useCallback)((op) => {
|
|
2180
|
-
updateNodeData(id, { operation: op });
|
|
2181
|
-
setOperation(op);
|
|
2182
|
-
}, []);
|
|
2183
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_layout24.NodeContainer, { id, selected, data, type, children: [
|
|
2184
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_layout24.NodeCombobox, { options: options2, selected: operation, onChange }),
|
|
2185
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(node_value_input_default, { value, onChange: () => {
|
|
2186
|
-
}, disabled: true }),
|
|
2187
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_layout24.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2188
|
-
] });
|
|
2189
|
-
}
|
|
2190
|
-
function getOperationResult(operation, value1, value2) {
|
|
2191
|
-
switch (operation) {
|
|
2192
|
-
case "add" /* add */:
|
|
2193
|
-
return Number(value1) + Number(value2);
|
|
2194
|
-
case "divide" /* divide */:
|
|
2195
|
-
return Number(value1) / (Number(value2) || 1);
|
|
2196
|
-
case "max" /* max */:
|
|
2197
|
-
return Number(value1) > Number(value2) ? value1 : value2;
|
|
2198
|
-
case "min" /* min */:
|
|
2199
|
-
return Number(value1) < Number(value2) ? value1 : value2;
|
|
2200
|
-
case "multiply" /* multiply */:
|
|
2201
|
-
return Number(value1) * Number(value2);
|
|
2202
|
-
case "power" /* power */:
|
|
2203
|
-
return Number(value1) ** Number(value2);
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
var variable_combine_node_default = VariableCombineNode;
|
|
2207
|
-
|
|
2208
1921
|
// src/nodes/output/noise-logger-node.tsx
|
|
2209
|
-
var
|
|
2210
|
-
var
|
|
2211
|
-
var
|
|
2212
|
-
var
|
|
2213
|
-
var
|
|
1922
|
+
var import_layout22 = require("@awesome-flow/core/layout");
|
|
1923
|
+
var import_react30 = require("react");
|
|
1924
|
+
var import_core11 = require("@mantine/core");
|
|
1925
|
+
var import_hooks24 = require("@awesome-flow/core/hooks");
|
|
1926
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2214
1927
|
function NoiseLoggerNode({ id, selected, data, type }) {
|
|
2215
|
-
const incoming = (0,
|
|
2216
|
-
const noise = (0,
|
|
2217
|
-
return /* @__PURE__ */ (0,
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
1928
|
+
const incoming = (0, import_hooks24.useIncomingComputedData)(id);
|
|
1929
|
+
const noise = (0, import_react30.useMemo)(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
1930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_layout22.NodeContainer, { id, selected, data, type, children: [
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core11.Text, { children: [
|
|
2219
1932
|
"Size: ",
|
|
2220
1933
|
noise?.length || 0
|
|
2221
1934
|
] }),
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2223
|
-
/* @__PURE__ */ (0,
|
|
1935
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core11.Divider, { h: 5 }),
|
|
1936
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core11.Stack, { children: noise?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core11.Text, { children: [
|
|
2224
1937
|
v.position?.x,
|
|
2225
1938
|
":",
|
|
2226
1939
|
v.position?.y,
|
|
@@ -2229,92 +1942,31 @@ function NoiseLoggerNode({ id, selected, data, type }) {
|
|
|
2229
1942
|
": ",
|
|
2230
1943
|
v.value
|
|
2231
1944
|
] }, i)) }),
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
1945
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_layout22.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2233
1946
|
] });
|
|
2234
1947
|
}
|
|
2235
1948
|
var noise_logger_node_default = NoiseLoggerNode;
|
|
2236
1949
|
|
|
2237
1950
|
// src/nodes/output/noise-output-node.tsx
|
|
2238
|
-
var
|
|
2239
|
-
var
|
|
2240
|
-
var
|
|
2241
|
-
var
|
|
2242
|
-
var
|
|
2243
|
-
function NoiseOutputNode({ id, selected, data, type }) {
|
|
2244
|
-
const [generating, setGenerating] = (0, import_react35.useState)(false);
|
|
2245
|
-
const updateComputedData = (0, import_hooks28.useUpdateNodeComputedData)();
|
|
2246
|
-
const incomingModules = (0, import_hooks28.useIncomingComputedData)(id, 8 /* module */);
|
|
2247
|
-
const incomingPositions = (0, import_hooks28.useIncomingComputedData)(
|
|
2248
|
-
id,
|
|
2249
|
-
4 /* position */
|
|
2250
|
-
);
|
|
2251
|
-
(0, import_react35.useEffect)(() => {
|
|
2252
|
-
if (incomingPositions?.length && incomingModules?.length) {
|
|
2253
|
-
const { module: module2 } = incomingModules[0];
|
|
2254
|
-
if (module2) {
|
|
2255
|
-
setGenerating(true);
|
|
2256
|
-
}
|
|
2257
|
-
}
|
|
2258
|
-
}, [incomingModules, incomingPositions]);
|
|
2259
|
-
(0, import_react35.useEffect)(() => {
|
|
2260
|
-
if (incomingPositions?.length && incomingModules?.length) {
|
|
2261
|
-
const { module: module2 } = incomingModules[0];
|
|
2262
|
-
if (module2 && generating) {
|
|
2263
|
-
const noise = [];
|
|
2264
|
-
for (const input of incomingPositions) {
|
|
2265
|
-
for (const position of input.positions) {
|
|
2266
|
-
const value = module2.getValue(position.x, position.y, position.z);
|
|
2267
|
-
noise.push({
|
|
2268
|
-
position,
|
|
2269
|
-
value
|
|
2270
|
-
});
|
|
2271
|
-
}
|
|
2272
|
-
}
|
|
2273
|
-
console.log("SET COMPUTED DATA");
|
|
2274
|
-
updateComputedData(id, { noise, module: module2 });
|
|
2275
|
-
setGenerating(false);
|
|
2276
|
-
}
|
|
2277
|
-
}
|
|
2278
|
-
}, [generating]);
|
|
2279
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_layout27.NodeContainer, { id, selected, data, type, children: [
|
|
2280
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core15.Box, { pos: "relative", children: [
|
|
2281
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2282
|
-
import_core15.LoadingOverlay,
|
|
2283
|
-
{
|
|
2284
|
-
visible: generating,
|
|
2285
|
-
zIndex: 1e3,
|
|
2286
|
-
overlayProps: { radius: "sm", blur: 2 }
|
|
2287
|
-
}
|
|
2288
|
-
),
|
|
2289
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core15.Stack, { children: [
|
|
2290
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core15.Group, { children: [
|
|
2291
|
-
"Position Inputs: ",
|
|
2292
|
-
incomingPositions?.length
|
|
2293
|
-
] }),
|
|
2294
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core15.Group, { children: [
|
|
2295
|
-
"Module Inputs: ",
|
|
2296
|
-
incomingModules?.length
|
|
2297
|
-
] })
|
|
2298
|
-
] })
|
|
2299
|
-
] }),
|
|
2300
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_layout27.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2301
|
-
] });
|
|
2302
|
-
}
|
|
2303
|
-
var noise_output_node_default = NoiseOutputNode;
|
|
1951
|
+
var import_layout32 = require("@awesome-flow/core/layout");
|
|
1952
|
+
var import_react40 = require("react");
|
|
1953
|
+
var import_hooks34 = require("@awesome-flow/core/hooks");
|
|
1954
|
+
var import_components11 = require("@awesome-flow/core/components");
|
|
1955
|
+
var import_core18 = require("@mantine/core");
|
|
2304
1956
|
|
|
2305
1957
|
// src/nodes/output/noise-raw-texture-node.tsx
|
|
2306
|
-
var
|
|
2307
|
-
var
|
|
2308
|
-
var
|
|
2309
|
-
var
|
|
2310
|
-
var
|
|
1958
|
+
var import_layout23 = require("@awesome-flow/core/layout");
|
|
1959
|
+
var import_react31 = require("react");
|
|
1960
|
+
var import_hooks25 = require("@awesome-flow/core/hooks");
|
|
1961
|
+
var import_core12 = require("@mantine/core");
|
|
1962
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2311
1963
|
function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
2312
|
-
const updateComputedData = (0,
|
|
2313
|
-
const [dataLength, setDataLength] = (0,
|
|
2314
|
-
const [resolution, setResolution] = (0,
|
|
2315
|
-
const incoming = (0,
|
|
2316
|
-
const noise = (0,
|
|
2317
|
-
(0,
|
|
1964
|
+
const updateComputedData = (0, import_hooks25.useUpdateNodeComputedData)();
|
|
1965
|
+
const [dataLength, setDataLength] = (0, import_react31.useState)(0);
|
|
1966
|
+
const [resolution, setResolution] = (0, import_react31.useState)(0);
|
|
1967
|
+
const incoming = (0, import_hooks25.useIncomingComputedData)(id);
|
|
1968
|
+
const noise = (0, import_react31.useMemo)(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
1969
|
+
(0, import_react31.useEffect)(() => {
|
|
2318
1970
|
if (noise?.length) {
|
|
2319
1971
|
const size = Math.ceil(Math.sqrt(noise.length));
|
|
2320
1972
|
const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
|
|
@@ -2325,19 +1977,19 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
2325
1977
|
updateComputedData(id, { textureData: dataArray, textureResolution: size });
|
|
2326
1978
|
}
|
|
2327
1979
|
}, [noise]);
|
|
2328
|
-
return /* @__PURE__ */ (0,
|
|
2329
|
-
/* @__PURE__ */ (0,
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
1980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_layout23.NodeContainer, { id, selected, data, type, children: [
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core12.Stack, { children: [
|
|
1982
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core12.Group, { children: [
|
|
2331
1983
|
"Resolution: ",
|
|
2332
1984
|
resolution,
|
|
2333
1985
|
"x",
|
|
2334
1986
|
resolution
|
|
2335
1987
|
] }),
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core12.Group, { children: [
|
|
2337
1989
|
"Input Length: ",
|
|
2338
1990
|
noise?.length || 0
|
|
2339
1991
|
] }),
|
|
2340
|
-
/* @__PURE__ */ (0,
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core12.Group, { children: [
|
|
2341
1993
|
"Output Length (",
|
|
2342
1994
|
resolution,
|
|
2343
1995
|
"*",
|
|
@@ -2346,100 +1998,122 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
2346
1998
|
dataLength
|
|
2347
1999
|
] })
|
|
2348
2000
|
] }),
|
|
2349
|
-
/* @__PURE__ */ (0,
|
|
2001
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_layout23.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2350
2002
|
] });
|
|
2351
2003
|
}
|
|
2352
2004
|
var noise_raw_texture_node_default = NoiseRawTextureNode;
|
|
2353
2005
|
|
|
2354
2006
|
// src/nodes/output/positions-logger-node.tsx
|
|
2355
|
-
var
|
|
2356
|
-
var
|
|
2357
|
-
var
|
|
2358
|
-
var
|
|
2359
|
-
var
|
|
2007
|
+
var import_layout24 = require("@awesome-flow/core/layout");
|
|
2008
|
+
var import_react32 = require("react");
|
|
2009
|
+
var import_core13 = require("@mantine/core");
|
|
2010
|
+
var import_hooks26 = require("@awesome-flow/core/hooks");
|
|
2011
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2360
2012
|
function PositionsLoggerNode({ id, selected, data, type }) {
|
|
2361
|
-
const incoming = (0,
|
|
2362
|
-
const positions = (0,
|
|
2013
|
+
const incoming = (0, import_hooks26.useIncomingComputedData)(id);
|
|
2014
|
+
const positions = (0, import_react32.useMemo)(() => {
|
|
2363
2015
|
return incoming?.map((p) => p.positions).flat();
|
|
2364
2016
|
}, [incoming]);
|
|
2365
|
-
return /* @__PURE__ */ (0,
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_layout24.NodeContainer, { id, selected, data, type, children: [
|
|
2018
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core13.Text, { children: [
|
|
2367
2019
|
"Size: ",
|
|
2368
2020
|
positions?.length || 0
|
|
2369
2021
|
] }),
|
|
2370
|
-
/* @__PURE__ */ (0,
|
|
2371
|
-
/* @__PURE__ */ (0,
|
|
2022
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core13.Divider, { h: 5 }),
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core13.Stack, { children: positions?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core13.Text, { children: [
|
|
2372
2024
|
v.x,
|
|
2373
2025
|
":",
|
|
2374
2026
|
v.y,
|
|
2375
2027
|
":",
|
|
2376
2028
|
v.z
|
|
2377
2029
|
] }, i)) }),
|
|
2378
|
-
/* @__PURE__ */ (0,
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_layout24.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2379
2031
|
] });
|
|
2380
2032
|
}
|
|
2381
2033
|
var positions_logger_node_default = PositionsLoggerNode;
|
|
2382
2034
|
|
|
2383
2035
|
// src/nodes/selectors/noise-blend-node.tsx
|
|
2384
|
-
var
|
|
2385
|
-
var
|
|
2386
|
-
var
|
|
2036
|
+
var import_layout25 = require("@awesome-flow/core/layout");
|
|
2037
|
+
var import_react33 = require("react");
|
|
2038
|
+
var import_hooks27 = require("@awesome-flow/core/hooks");
|
|
2387
2039
|
var import_selector = require("libnoise-ts/module/selector");
|
|
2388
|
-
var
|
|
2389
|
-
var
|
|
2040
|
+
var import_components7 = require("@awesome-flow/core/components");
|
|
2041
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2390
2042
|
function NoiseBlendNode({ id, selected, data, type }) {
|
|
2391
|
-
const
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2043
|
+
const updateComputedData = (0, import_hooks27.useUpdateNodeComputedData)();
|
|
2044
|
+
const onDataUpdated = (0, import_react33.useCallback)(
|
|
2045
|
+
(incomingData) => {
|
|
2046
|
+
const incomingSources = incomingData["source" /* source */];
|
|
2047
|
+
const incomingControl = incomingData["control" /* control */];
|
|
2048
|
+
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2049
|
+
const module2 = new import_selector.Blend(
|
|
2050
|
+
incomingSources[0].module,
|
|
2051
|
+
incomingSources[1].module,
|
|
2052
|
+
incomingControl[0].module
|
|
2053
|
+
);
|
|
2054
|
+
updateComputedData(id, { module: module2 });
|
|
2055
|
+
}
|
|
2056
|
+
},
|
|
2057
|
+
[]
|
|
2058
|
+
);
|
|
2059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_layout25.NodeContainer, { id, selected, data, type, children: [
|
|
2060
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2061
|
+
import_components7.HandlesIncomingDataStatus,
|
|
2062
|
+
{
|
|
2063
|
+
nodeId: id,
|
|
2064
|
+
handles: data.handles,
|
|
2065
|
+
handleKey: "dataId",
|
|
2066
|
+
onDataUpdated,
|
|
2067
|
+
type: "target",
|
|
2068
|
+
resetComputedData: true
|
|
2069
|
+
}
|
|
2070
|
+
),
|
|
2071
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_layout25.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2405
2072
|
] });
|
|
2406
2073
|
}
|
|
2407
2074
|
var noise_blend_node_default = NoiseBlendNode;
|
|
2408
2075
|
|
|
2409
2076
|
// src/nodes/selectors/noise-select-node.tsx
|
|
2410
|
-
var
|
|
2411
|
-
var
|
|
2412
|
-
var
|
|
2077
|
+
var import_layout26 = require("@awesome-flow/core/layout");
|
|
2078
|
+
var import_react34 = require("react");
|
|
2079
|
+
var import_hooks28 = require("@awesome-flow/core/hooks");
|
|
2413
2080
|
var import_selector2 = require("libnoise-ts/module/selector");
|
|
2414
|
-
var
|
|
2415
|
-
var
|
|
2081
|
+
var import_core14 = require("@mantine/core");
|
|
2082
|
+
var import_components8 = require("@awesome-flow/core/components");
|
|
2083
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2416
2084
|
function NoiseSelectNode({ id, selected, data, type }) {
|
|
2417
|
-
const [edgeFalloff, setEdgeFalloff] = (0,
|
|
2418
|
-
const [lowerBound, setLowerBound] = (0,
|
|
2419
|
-
const [upperBound, setUpperBound] = (0,
|
|
2420
|
-
const
|
|
2421
|
-
const
|
|
2422
|
-
|
|
2423
|
-
(0, import_react39.useEffect)(() => {
|
|
2424
|
-
if (incoming?.length > 2) {
|
|
2425
|
-
const module2 = new import_selector2.Select(
|
|
2426
|
-
incoming[0].module,
|
|
2427
|
-
incoming[1].module,
|
|
2428
|
-
incoming[2].module,
|
|
2429
|
-
edgeFalloff,
|
|
2430
|
-
lowerBound,
|
|
2431
|
-
upperBound
|
|
2432
|
-
);
|
|
2433
|
-
updateComputedData(id, { module: module2 });
|
|
2434
|
-
}
|
|
2085
|
+
const [edgeFalloff, setEdgeFalloff] = (0, import_react34.useState)(data.edgeFalloff);
|
|
2086
|
+
const [lowerBound, setLowerBound] = (0, import_react34.useState)(data.lowerBound);
|
|
2087
|
+
const [upperBound, setUpperBound] = (0, import_react34.useState)(data.upperBound);
|
|
2088
|
+
const updateNodeData = (0, import_hooks28.useUpdateNodeData)();
|
|
2089
|
+
const updateComputedData = (0, import_hooks28.useUpdateNodeComputedData)();
|
|
2090
|
+
(0, import_react34.useEffect)(() => {
|
|
2435
2091
|
updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
|
|
2436
|
-
}, [
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2092
|
+
}, [edgeFalloff, lowerBound, upperBound]);
|
|
2093
|
+
const onDataUpdated = (0, import_react34.useCallback)(
|
|
2094
|
+
(incomingData) => {
|
|
2095
|
+
const incomingSources = incomingData["source" /* source */];
|
|
2096
|
+
const incomingControl = incomingData["control" /* control */];
|
|
2097
|
+
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2098
|
+
const module2 = new import_selector2.Select(
|
|
2099
|
+
incomingSources[0].module,
|
|
2100
|
+
incomingSources[1].module,
|
|
2101
|
+
incomingControl[0].module,
|
|
2102
|
+
edgeFalloff,
|
|
2103
|
+
lowerBound,
|
|
2104
|
+
upperBound
|
|
2105
|
+
);
|
|
2106
|
+
updateComputedData(id, { module: module2 });
|
|
2107
|
+
}
|
|
2108
|
+
},
|
|
2109
|
+
[]
|
|
2110
|
+
);
|
|
2111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_layout26.NodeContainer, { id, selected, data, type, children: [
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core14.Stack, { children: [
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core14.Group, { children: [
|
|
2114
|
+
"Edge Falloff:",
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2116
|
+
import_core14.NumberInput,
|
|
2443
2117
|
{
|
|
2444
2118
|
size: "xs",
|
|
2445
2119
|
w: 100,
|
|
@@ -2449,10 +2123,10 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2449
2123
|
}
|
|
2450
2124
|
)
|
|
2451
2125
|
] }),
|
|
2452
|
-
/* @__PURE__ */ (0,
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core14.Group, { children: [
|
|
2453
2127
|
"Lower Bound:",
|
|
2454
|
-
/* @__PURE__ */ (0,
|
|
2455
|
-
|
|
2128
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2129
|
+
import_core14.NumberInput,
|
|
2456
2130
|
{
|
|
2457
2131
|
size: "xs",
|
|
2458
2132
|
w: 100,
|
|
@@ -2462,10 +2136,10 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2462
2136
|
}
|
|
2463
2137
|
)
|
|
2464
2138
|
] }),
|
|
2465
|
-
/* @__PURE__ */ (0,
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core14.Group, { children: [
|
|
2466
2140
|
"Upper Bound:",
|
|
2467
|
-
/* @__PURE__ */ (0,
|
|
2468
|
-
|
|
2141
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2142
|
+
import_core14.NumberInput,
|
|
2469
2143
|
{
|
|
2470
2144
|
size: "xs",
|
|
2471
2145
|
w: 100,
|
|
@@ -2475,97 +2149,99 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2475
2149
|
}
|
|
2476
2150
|
)
|
|
2477
2151
|
] }),
|
|
2478
|
-
/* @__PURE__ */ (0,
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2153
|
+
import_components8.HandlesIncomingDataStatus,
|
|
2154
|
+
{
|
|
2155
|
+
nodeId: id,
|
|
2156
|
+
handles: data.handles,
|
|
2157
|
+
handleKey: "dataId",
|
|
2158
|
+
onDataUpdated,
|
|
2159
|
+
type: "target",
|
|
2160
|
+
resetComputedData: true
|
|
2161
|
+
}
|
|
2162
|
+
)
|
|
2482
2163
|
] }),
|
|
2483
|
-
/* @__PURE__ */ (0,
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_layout26.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2484
2165
|
] });
|
|
2485
2166
|
}
|
|
2486
2167
|
var noise_select_node_default = NoiseSelectNode;
|
|
2487
2168
|
|
|
2488
2169
|
// src/nodes/transformers/noise-displace-node.tsx
|
|
2489
|
-
var
|
|
2490
|
-
var
|
|
2491
|
-
var
|
|
2170
|
+
var import_layout27 = require("@awesome-flow/core/layout");
|
|
2171
|
+
var import_react35 = require("react");
|
|
2172
|
+
var import_hooks29 = require("@awesome-flow/core/hooks");
|
|
2492
2173
|
var import_transformer = require("libnoise-ts/module/transformer");
|
|
2493
|
-
var
|
|
2494
|
-
var
|
|
2174
|
+
var import_components9 = require("@awesome-flow/core/components");
|
|
2175
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2495
2176
|
function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
2496
|
-
const updateComputedData = (0,
|
|
2497
|
-
const
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core20.Badge, { color: xColor, children: "X Module" }),
|
|
2529
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core20.Badge, { color: yColor, children: "Y Module" }),
|
|
2530
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core20.Badge, { color: zColor, children: "Z Module" })
|
|
2531
|
-
] }),
|
|
2532
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_layout32.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2177
|
+
const updateComputedData = (0, import_hooks29.useUpdateNodeComputedData)();
|
|
2178
|
+
const onDataUpdated = (0, import_react35.useCallback)(
|
|
2179
|
+
(handleData) => {
|
|
2180
|
+
const sourceModule = handleData["source" /* sourceModule */];
|
|
2181
|
+
const xModule = handleData["x-module" /* xModule */];
|
|
2182
|
+
const yModule = handleData["y-module" /* yModule */];
|
|
2183
|
+
const zModule = handleData["z-module" /* zModule */];
|
|
2184
|
+
if (sourceModule && xModule && yModule && zModule) {
|
|
2185
|
+
const module2 = new import_transformer.Displace(
|
|
2186
|
+
sourceModule[0].module,
|
|
2187
|
+
xModule[0].module,
|
|
2188
|
+
yModule[0].module,
|
|
2189
|
+
zModule[0].module
|
|
2190
|
+
);
|
|
2191
|
+
updateComputedData(id, { module: module2 });
|
|
2192
|
+
}
|
|
2193
|
+
},
|
|
2194
|
+
[]
|
|
2195
|
+
);
|
|
2196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_layout27.NodeContainer, { id, selected, data, type, children: [
|
|
2197
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2198
|
+
import_components9.HandlesIncomingDataStatus,
|
|
2199
|
+
{
|
|
2200
|
+
nodeId: id,
|
|
2201
|
+
handles: data.handles,
|
|
2202
|
+
handleKey: "dataId",
|
|
2203
|
+
onDataUpdated,
|
|
2204
|
+
type: "target",
|
|
2205
|
+
resetComputedData: true
|
|
2206
|
+
}
|
|
2207
|
+
),
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_layout27.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2533
2209
|
] });
|
|
2534
2210
|
}
|
|
2535
2211
|
var noise_displace_node_default = NoiseDisplaceNode;
|
|
2536
2212
|
|
|
2537
2213
|
// src/nodes/transformers/noise-rotate-point-node.tsx
|
|
2538
|
-
var
|
|
2539
|
-
var
|
|
2540
|
-
var
|
|
2541
|
-
var
|
|
2214
|
+
var import_layout28 = require("@awesome-flow/core/layout");
|
|
2215
|
+
var import_react36 = require("react");
|
|
2216
|
+
var import_hooks30 = require("@awesome-flow/core/hooks");
|
|
2217
|
+
var import_core15 = require("@mantine/core");
|
|
2542
2218
|
var import_transformer2 = require("libnoise-ts/module/transformer");
|
|
2543
|
-
var
|
|
2219
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2544
2220
|
function NoiseRotatePointNode({
|
|
2545
2221
|
id,
|
|
2546
2222
|
selected,
|
|
2547
2223
|
data,
|
|
2548
2224
|
type
|
|
2549
2225
|
}) {
|
|
2550
|
-
const [xAngle, setXAngle] = (0,
|
|
2551
|
-
const [yAngle, setYAngle] = (0,
|
|
2552
|
-
const [zAngle, setZAngle] = (0,
|
|
2553
|
-
const incoming = (0,
|
|
2554
|
-
const updateNodeData = (0,
|
|
2555
|
-
const updateComputedData = (0,
|
|
2556
|
-
(0,
|
|
2226
|
+
const [xAngle, setXAngle] = (0, import_react36.useState)(data.xAngle);
|
|
2227
|
+
const [yAngle, setYAngle] = (0, import_react36.useState)(data.yAngle);
|
|
2228
|
+
const [zAngle, setZAngle] = (0, import_react36.useState)(data.zAngle);
|
|
2229
|
+
const incoming = (0, import_hooks30.useIncomingComputedData)(id);
|
|
2230
|
+
const updateNodeData = (0, import_hooks30.useUpdateNodeData)();
|
|
2231
|
+
const updateComputedData = (0, import_hooks30.useUpdateNodeComputedData)();
|
|
2232
|
+
(0, import_react36.useEffect)(() => {
|
|
2557
2233
|
if (incoming?.length) {
|
|
2558
2234
|
const module2 = new import_transformer2.RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
|
|
2559
2235
|
updateComputedData(id, { module: module2 });
|
|
2560
2236
|
}
|
|
2561
2237
|
updateNodeData(id, { xAngle, yAngle, zAngle });
|
|
2562
2238
|
}, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
|
|
2563
|
-
return /* @__PURE__ */ (0,
|
|
2564
|
-
/* @__PURE__ */ (0,
|
|
2565
|
-
/* @__PURE__ */ (0,
|
|
2239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_layout28.NodeContainer, { id, selected, data, type, children: [
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core15.Stack, { children: [
|
|
2241
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core15.Group, { children: [
|
|
2566
2242
|
"X Angle:",
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2568
|
-
|
|
2243
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2244
|
+
import_core15.NumberInput,
|
|
2569
2245
|
{
|
|
2570
2246
|
size: "xs",
|
|
2571
2247
|
w: 100,
|
|
@@ -2575,10 +2251,10 @@ function NoiseRotatePointNode({
|
|
|
2575
2251
|
}
|
|
2576
2252
|
)
|
|
2577
2253
|
] }),
|
|
2578
|
-
/* @__PURE__ */ (0,
|
|
2254
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core15.Group, { children: [
|
|
2579
2255
|
"Y Angle:",
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2581
|
-
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2257
|
+
import_core15.NumberInput,
|
|
2582
2258
|
{
|
|
2583
2259
|
size: "xs",
|
|
2584
2260
|
w: 100,
|
|
@@ -2588,10 +2264,10 @@ function NoiseRotatePointNode({
|
|
|
2588
2264
|
}
|
|
2589
2265
|
)
|
|
2590
2266
|
] }),
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core15.Group, { children: [
|
|
2592
2268
|
"Z Angle:",
|
|
2593
|
-
/* @__PURE__ */ (0,
|
|
2594
|
-
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2270
|
+
import_core15.NumberInput,
|
|
2595
2271
|
{
|
|
2596
2272
|
size: "xs",
|
|
2597
2273
|
w: 100,
|
|
@@ -2602,43 +2278,43 @@ function NoiseRotatePointNode({
|
|
|
2602
2278
|
)
|
|
2603
2279
|
] })
|
|
2604
2280
|
] }),
|
|
2605
|
-
/* @__PURE__ */ (0,
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_layout28.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2606
2282
|
] });
|
|
2607
2283
|
}
|
|
2608
2284
|
var noise_rotate_point_node_default = NoiseRotatePointNode;
|
|
2609
2285
|
|
|
2610
2286
|
// src/nodes/transformers/noise-scale-point-node.tsx
|
|
2611
|
-
var
|
|
2612
|
-
var
|
|
2613
|
-
var
|
|
2614
|
-
var
|
|
2287
|
+
var import_layout29 = require("@awesome-flow/core/layout");
|
|
2288
|
+
var import_react37 = require("react");
|
|
2289
|
+
var import_hooks31 = require("@awesome-flow/core/hooks");
|
|
2290
|
+
var import_core16 = require("@mantine/core");
|
|
2615
2291
|
var import_transformer3 = require("libnoise-ts/module/transformer");
|
|
2616
|
-
var
|
|
2292
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2617
2293
|
function NoiseScalePointNode({
|
|
2618
2294
|
id,
|
|
2619
2295
|
selected,
|
|
2620
2296
|
data,
|
|
2621
2297
|
type
|
|
2622
2298
|
}) {
|
|
2623
|
-
const [xScale, setXScale] = (0,
|
|
2624
|
-
const [yScale, setYScale] = (0,
|
|
2625
|
-
const [zScale, setZScale] = (0,
|
|
2626
|
-
const incoming = (0,
|
|
2627
|
-
const updateNodeData = (0,
|
|
2628
|
-
const updateComputedData = (0,
|
|
2629
|
-
(0,
|
|
2299
|
+
const [xScale, setXScale] = (0, import_react37.useState)(data.xScale);
|
|
2300
|
+
const [yScale, setYScale] = (0, import_react37.useState)(data.yScale);
|
|
2301
|
+
const [zScale, setZScale] = (0, import_react37.useState)(data.zScale);
|
|
2302
|
+
const incoming = (0, import_hooks31.useIncomingComputedData)(id);
|
|
2303
|
+
const updateNodeData = (0, import_hooks31.useUpdateNodeData)();
|
|
2304
|
+
const updateComputedData = (0, import_hooks31.useUpdateNodeComputedData)();
|
|
2305
|
+
(0, import_react37.useEffect)(() => {
|
|
2630
2306
|
if (incoming?.length) {
|
|
2631
2307
|
const module2 = new import_transformer3.ScalePoint(incoming[0].module, xScale, yScale, zScale);
|
|
2632
2308
|
updateComputedData(id, { module: module2 });
|
|
2633
2309
|
}
|
|
2634
2310
|
updateNodeData(id, { xScale, yScale, zScale });
|
|
2635
2311
|
}, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
|
|
2636
|
-
return /* @__PURE__ */ (0,
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
2638
|
-
/* @__PURE__ */ (0,
|
|
2312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_layout29.NodeContainer, { id, selected, data, type, children: [
|
|
2313
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core16.Stack, { children: [
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core16.Group, { children: [
|
|
2639
2315
|
"X Scale:",
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2641
|
-
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2317
|
+
import_core16.NumberInput,
|
|
2642
2318
|
{
|
|
2643
2319
|
size: "xs",
|
|
2644
2320
|
w: 100,
|
|
@@ -2648,10 +2324,10 @@ function NoiseScalePointNode({
|
|
|
2648
2324
|
}
|
|
2649
2325
|
)
|
|
2650
2326
|
] }),
|
|
2651
|
-
/* @__PURE__ */ (0,
|
|
2327
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core16.Group, { children: [
|
|
2652
2328
|
"Y Scale:",
|
|
2653
|
-
/* @__PURE__ */ (0,
|
|
2654
|
-
|
|
2329
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2330
|
+
import_core16.NumberInput,
|
|
2655
2331
|
{
|
|
2656
2332
|
size: "xs",
|
|
2657
2333
|
w: 100,
|
|
@@ -2661,10 +2337,10 @@ function NoiseScalePointNode({
|
|
|
2661
2337
|
}
|
|
2662
2338
|
)
|
|
2663
2339
|
] }),
|
|
2664
|
-
/* @__PURE__ */ (0,
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core16.Group, { children: [
|
|
2665
2341
|
"Z Scale:",
|
|
2666
|
-
/* @__PURE__ */ (0,
|
|
2667
|
-
|
|
2342
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2343
|
+
import_core16.NumberInput,
|
|
2668
2344
|
{
|
|
2669
2345
|
size: "xs",
|
|
2670
2346
|
w: 100,
|
|
@@ -2675,43 +2351,43 @@ function NoiseScalePointNode({
|
|
|
2675
2351
|
)
|
|
2676
2352
|
] })
|
|
2677
2353
|
] }),
|
|
2678
|
-
/* @__PURE__ */ (0,
|
|
2354
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_layout29.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2679
2355
|
] });
|
|
2680
2356
|
}
|
|
2681
2357
|
var noise_scale_point_node_default = NoiseScalePointNode;
|
|
2682
2358
|
|
|
2683
2359
|
// src/nodes/transformers/noise-translate-point-node.tsx
|
|
2684
|
-
var
|
|
2685
|
-
var
|
|
2686
|
-
var
|
|
2687
|
-
var
|
|
2360
|
+
var import_layout30 = require("@awesome-flow/core/layout");
|
|
2361
|
+
var import_react38 = require("react");
|
|
2362
|
+
var import_hooks32 = require("@awesome-flow/core/hooks");
|
|
2363
|
+
var import_core17 = require("@mantine/core");
|
|
2688
2364
|
var import_transformer4 = require("libnoise-ts/module/transformer");
|
|
2689
|
-
var
|
|
2365
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2690
2366
|
function NoiseTranslatePointNode({
|
|
2691
2367
|
id,
|
|
2692
2368
|
selected,
|
|
2693
2369
|
data,
|
|
2694
2370
|
type
|
|
2695
2371
|
}) {
|
|
2696
|
-
const [translateX, setTranslateX] = (0,
|
|
2697
|
-
const [translateY, setTranslateY] = (0,
|
|
2698
|
-
const [translateZ, setTranslateZ] = (0,
|
|
2699
|
-
const incoming = (0,
|
|
2700
|
-
const updateNodeData = (0,
|
|
2701
|
-
const updateComputedData = (0,
|
|
2702
|
-
(0,
|
|
2372
|
+
const [translateX, setTranslateX] = (0, import_react38.useState)(data.translateX);
|
|
2373
|
+
const [translateY, setTranslateY] = (0, import_react38.useState)(data.translateY);
|
|
2374
|
+
const [translateZ, setTranslateZ] = (0, import_react38.useState)(data.translateZ);
|
|
2375
|
+
const incoming = (0, import_hooks32.useIncomingComputedData)(id);
|
|
2376
|
+
const updateNodeData = (0, import_hooks32.useUpdateNodeData)();
|
|
2377
|
+
const updateComputedData = (0, import_hooks32.useUpdateNodeComputedData)();
|
|
2378
|
+
(0, import_react38.useEffect)(() => {
|
|
2703
2379
|
if (incoming?.length) {
|
|
2704
2380
|
const module2 = new import_transformer4.TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
|
|
2705
2381
|
updateComputedData(id, { module: module2 });
|
|
2706
2382
|
}
|
|
2707
2383
|
updateNodeData(id, { translateX, translateY, translateZ });
|
|
2708
2384
|
}, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
|
|
2709
|
-
return /* @__PURE__ */ (0,
|
|
2710
|
-
/* @__PURE__ */ (0,
|
|
2711
|
-
/* @__PURE__ */ (0,
|
|
2385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_layout30.NodeContainer, { id, selected, data, type, children: [
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core17.Stack, { children: [
|
|
2387
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core17.Group, { children: [
|
|
2712
2388
|
"Translate X:",
|
|
2713
|
-
/* @__PURE__ */ (0,
|
|
2714
|
-
|
|
2389
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2390
|
+
import_core17.NumberInput,
|
|
2715
2391
|
{
|
|
2716
2392
|
size: "xs",
|
|
2717
2393
|
w: 100,
|
|
@@ -2721,10 +2397,10 @@ function NoiseTranslatePointNode({
|
|
|
2721
2397
|
}
|
|
2722
2398
|
)
|
|
2723
2399
|
] }),
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core17.Group, { children: [
|
|
2725
2401
|
"Translate Y:",
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2727
|
-
|
|
2402
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2403
|
+
import_core17.NumberInput,
|
|
2728
2404
|
{
|
|
2729
2405
|
size: "xs",
|
|
2730
2406
|
w: 100,
|
|
@@ -2734,10 +2410,10 @@ function NoiseTranslatePointNode({
|
|
|
2734
2410
|
}
|
|
2735
2411
|
)
|
|
2736
2412
|
] }),
|
|
2737
|
-
/* @__PURE__ */ (0,
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core17.Group, { children: [
|
|
2738
2414
|
"Translate Z:",
|
|
2739
|
-
/* @__PURE__ */ (0,
|
|
2740
|
-
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2416
|
+
import_core17.NumberInput,
|
|
2741
2417
|
{
|
|
2742
2418
|
size: "xs",
|
|
2743
2419
|
w: 100,
|
|
@@ -2748,31 +2424,32 @@ function NoiseTranslatePointNode({
|
|
|
2748
2424
|
)
|
|
2749
2425
|
] })
|
|
2750
2426
|
] }),
|
|
2751
|
-
/* @__PURE__ */ (0,
|
|
2427
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_layout30.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2752
2428
|
] });
|
|
2753
2429
|
}
|
|
2754
2430
|
var noise_translate_point_node_default = NoiseTranslatePointNode;
|
|
2755
2431
|
|
|
2756
2432
|
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
2757
|
-
var
|
|
2758
|
-
var
|
|
2759
|
-
var
|
|
2433
|
+
var import_layout31 = require("@awesome-flow/core/layout");
|
|
2434
|
+
var import_react39 = require("react");
|
|
2435
|
+
var import_hooks33 = require("@awesome-flow/core/hooks");
|
|
2760
2436
|
var import_transformer5 = require("libnoise-ts/module/transformer");
|
|
2761
|
-
var
|
|
2437
|
+
var import_components10 = require("@awesome-flow/core/components");
|
|
2438
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2762
2439
|
function NoiseTurbulenceNode({
|
|
2763
2440
|
id,
|
|
2764
2441
|
selected,
|
|
2765
2442
|
data,
|
|
2766
2443
|
type
|
|
2767
2444
|
}) {
|
|
2768
|
-
const [properties, setProperties] = (0,
|
|
2769
|
-
const incoming = (0,
|
|
2770
|
-
const updateComputedData = (0,
|
|
2771
|
-
const onPropertiesChange = (0,
|
|
2445
|
+
const [properties, setProperties] = (0, import_react39.useState)(null);
|
|
2446
|
+
const incoming = (0, import_hooks33.useIncomingComputedData)(id);
|
|
2447
|
+
const updateComputedData = (0, import_hooks33.useUpdateNodeComputedData)();
|
|
2448
|
+
const onPropertiesChange = (0, import_react39.useCallback)((props) => {
|
|
2772
2449
|
setProperties(props);
|
|
2773
2450
|
}, []);
|
|
2774
|
-
(0,
|
|
2775
|
-
if (incoming?.length) {
|
|
2451
|
+
(0, import_react39.useEffect)(() => {
|
|
2452
|
+
if (incoming?.length && properties) {
|
|
2776
2453
|
const module2 = new import_transformer5.Turbulence(
|
|
2777
2454
|
incoming[0].module,
|
|
2778
2455
|
properties.frequency.value,
|
|
@@ -2782,13 +2459,1005 @@ function NoiseTurbulenceNode({
|
|
|
2782
2459
|
);
|
|
2783
2460
|
updateComputedData(id, { module: module2 });
|
|
2784
2461
|
}
|
|
2785
|
-
}, [id, incoming, properties
|
|
2786
|
-
return /* @__PURE__ */ (0,
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2788
|
-
/* @__PURE__ */ (0,
|
|
2462
|
+
}, [id, incoming, properties]);
|
|
2463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_layout31.NodeContainer, { id, selected, data, type, children: [
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components10.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
2465
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_layout31.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
2789
2466
|
] });
|
|
2790
2467
|
}
|
|
2791
2468
|
var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
2469
|
+
|
|
2470
|
+
// src/templates/generators/noise-checkerboard-template.ts
|
|
2471
|
+
var import_system = require("@xyflow/system");
|
|
2472
|
+
var NoiseCheckerboardNodeTemplateFactory = class {
|
|
2473
|
+
template = {
|
|
2474
|
+
type: "noise-checkerboard" /* noiseCheckerboard */,
|
|
2475
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2476
|
+
data: {
|
|
2477
|
+
title: "Checkerboard Noise"
|
|
2478
|
+
},
|
|
2479
|
+
handles: [
|
|
2480
|
+
{
|
|
2481
|
+
position: import_system.Position.Right,
|
|
2482
|
+
dataType: "module" /* module */,
|
|
2483
|
+
connection: "source"
|
|
2484
|
+
}
|
|
2485
|
+
]
|
|
2486
|
+
};
|
|
2487
|
+
};
|
|
2488
|
+
|
|
2489
|
+
// src/templates/generators/noise-const-template.ts
|
|
2490
|
+
var import_system2 = require("@xyflow/system");
|
|
2491
|
+
var NoiseConstNodeTemplateFactory = class {
|
|
2492
|
+
template = {
|
|
2493
|
+
type: "noise-constant" /* noiseConst */,
|
|
2494
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2495
|
+
data: {
|
|
2496
|
+
title: "Const Value Noise",
|
|
2497
|
+
noise: 0,
|
|
2498
|
+
min: -1,
|
|
2499
|
+
max: 1
|
|
2500
|
+
},
|
|
2501
|
+
handles: [
|
|
2502
|
+
{
|
|
2503
|
+
position: import_system2.Position.Right,
|
|
2504
|
+
dataType: "module" /* module */,
|
|
2505
|
+
connection: "source"
|
|
2506
|
+
}
|
|
2507
|
+
]
|
|
2508
|
+
};
|
|
2509
|
+
};
|
|
2510
|
+
|
|
2511
|
+
// src/templates/generators/noise-cylinders-template.ts
|
|
2512
|
+
var import_abstract6 = require("@awesome-flow/core/abstract");
|
|
2513
|
+
var import_system3 = require("@xyflow/system");
|
|
2514
|
+
var NoiseCylindersNodeTemplateFactory = class {
|
|
2515
|
+
template = {
|
|
2516
|
+
type: "noise-cylinders" /* noiseCylinders */,
|
|
2517
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2518
|
+
data: {
|
|
2519
|
+
title: "Cylinders Noise",
|
|
2520
|
+
frequency: 0.1
|
|
2521
|
+
},
|
|
2522
|
+
handles: [
|
|
2523
|
+
{
|
|
2524
|
+
position: import_system3.Position.Left,
|
|
2525
|
+
dataType: import_abstract6.CoreHandleType.variableProperty,
|
|
2526
|
+
connection: "target"
|
|
2527
|
+
},
|
|
2528
|
+
{
|
|
2529
|
+
position: import_system3.Position.Right,
|
|
2530
|
+
dataType: "module" /* module */,
|
|
2531
|
+
connection: "source"
|
|
2532
|
+
}
|
|
2533
|
+
]
|
|
2534
|
+
};
|
|
2535
|
+
};
|
|
2536
|
+
|
|
2537
|
+
// src/templates/generators/noise-perlin-template.ts
|
|
2538
|
+
var import_abstract7 = require("@awesome-flow/core/abstract");
|
|
2539
|
+
var import_system4 = require("@xyflow/system");
|
|
2540
|
+
var NoisePerlinNodeTemplateFactory = class {
|
|
2541
|
+
template = {
|
|
2542
|
+
type: "noise-perlin" /* noisePerlin */,
|
|
2543
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2544
|
+
data: {
|
|
2545
|
+
title: "Perlin Noise",
|
|
2546
|
+
frequency: 0.1,
|
|
2547
|
+
lacunarity: 2,
|
|
2548
|
+
octaves: 5,
|
|
2549
|
+
persistence: 0.5,
|
|
2550
|
+
seed: 0
|
|
2551
|
+
},
|
|
2552
|
+
handles: [
|
|
2553
|
+
{
|
|
2554
|
+
position: import_system4.Position.Left,
|
|
2555
|
+
dataType: import_abstract7.CoreHandleType.variableProperty,
|
|
2556
|
+
connection: "target"
|
|
2557
|
+
},
|
|
2558
|
+
{
|
|
2559
|
+
position: import_system4.Position.Right,
|
|
2560
|
+
dataType: "module" /* module */,
|
|
2561
|
+
connection: "source"
|
|
2562
|
+
}
|
|
2563
|
+
]
|
|
2564
|
+
};
|
|
2565
|
+
};
|
|
2566
|
+
|
|
2567
|
+
// src/templates/generators/noise-ridgedmulti-template.ts
|
|
2568
|
+
var import_abstract8 = require("@awesome-flow/core/abstract");
|
|
2569
|
+
var import_system5 = require("@xyflow/system");
|
|
2570
|
+
var NoiseRidgedMultiNodeTemplateFactory = class {
|
|
2571
|
+
template = {
|
|
2572
|
+
type: "noise-ridged-multi" /* noiseRidgedMulti */,
|
|
2573
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2574
|
+
data: {
|
|
2575
|
+
title: "Ridged Multi Noise",
|
|
2576
|
+
frequency: 0.1,
|
|
2577
|
+
lacunarity: 2,
|
|
2578
|
+
octaves: 6,
|
|
2579
|
+
offset: 1,
|
|
2580
|
+
gain: 2,
|
|
2581
|
+
seed: 0
|
|
2582
|
+
},
|
|
2583
|
+
handles: [
|
|
2584
|
+
{
|
|
2585
|
+
position: import_system5.Position.Left,
|
|
2586
|
+
dataType: import_abstract8.CoreHandleType.variableProperty,
|
|
2587
|
+
connection: "target"
|
|
2588
|
+
},
|
|
2589
|
+
{
|
|
2590
|
+
position: import_system5.Position.Right,
|
|
2591
|
+
dataType: "module" /* module */,
|
|
2592
|
+
connection: "source"
|
|
2593
|
+
}
|
|
2594
|
+
]
|
|
2595
|
+
};
|
|
2596
|
+
};
|
|
2597
|
+
|
|
2598
|
+
// src/templates/generators/noise-simplex-template.ts
|
|
2599
|
+
var import_abstract9 = require("@awesome-flow/core/abstract");
|
|
2600
|
+
var import_system6 = require("@xyflow/system");
|
|
2601
|
+
var NoiseSimplexNodeTemplateFactory = class {
|
|
2602
|
+
template = {
|
|
2603
|
+
type: "noise-simplex" /* noiseSimplex */,
|
|
2604
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2605
|
+
data: {
|
|
2606
|
+
title: "Simplex Noise"
|
|
2607
|
+
},
|
|
2608
|
+
handles: [
|
|
2609
|
+
{
|
|
2610
|
+
position: import_system6.Position.Left,
|
|
2611
|
+
dataType: import_abstract9.CoreHandleType.variableProperty,
|
|
2612
|
+
connection: "target"
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
position: import_system6.Position.Right,
|
|
2616
|
+
dataType: "module" /* module */,
|
|
2617
|
+
connection: "source"
|
|
2618
|
+
}
|
|
2619
|
+
]
|
|
2620
|
+
};
|
|
2621
|
+
};
|
|
2622
|
+
|
|
2623
|
+
// src/templates/generators/noise-spheres-template.ts
|
|
2624
|
+
var import_abstract10 = require("@awesome-flow/core/abstract");
|
|
2625
|
+
var import_system7 = require("@xyflow/system");
|
|
2626
|
+
var NoiseSpheresNodeTemplateFactory = class {
|
|
2627
|
+
template = {
|
|
2628
|
+
type: "noise-spheres" /* noiseSpheres */,
|
|
2629
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2630
|
+
data: {
|
|
2631
|
+
title: "Spheres Noise",
|
|
2632
|
+
frequency: 0.1
|
|
2633
|
+
},
|
|
2634
|
+
handles: [
|
|
2635
|
+
{
|
|
2636
|
+
position: import_system7.Position.Left,
|
|
2637
|
+
dataType: import_abstract10.CoreHandleType.variableProperty,
|
|
2638
|
+
connection: "target"
|
|
2639
|
+
},
|
|
2640
|
+
{
|
|
2641
|
+
position: import_system7.Position.Right,
|
|
2642
|
+
dataType: "module" /* module */,
|
|
2643
|
+
connection: "source"
|
|
2644
|
+
}
|
|
2645
|
+
]
|
|
2646
|
+
};
|
|
2647
|
+
};
|
|
2648
|
+
|
|
2649
|
+
// src/templates/generators/noise-voronoi-template.ts
|
|
2650
|
+
var import_abstract11 = require("@awesome-flow/core/abstract");
|
|
2651
|
+
var import_system8 = require("@xyflow/system");
|
|
2652
|
+
var NoiseVoronoiNodeTemplateFactory = class {
|
|
2653
|
+
template = {
|
|
2654
|
+
type: "noise-voronoi" /* noiseVoronoi */,
|
|
2655
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2656
|
+
data: {
|
|
2657
|
+
title: "Voronoi Noise",
|
|
2658
|
+
frequency: 0.1,
|
|
2659
|
+
displacement: 1,
|
|
2660
|
+
distance: true,
|
|
2661
|
+
seed: 0
|
|
2662
|
+
},
|
|
2663
|
+
handles: [
|
|
2664
|
+
{
|
|
2665
|
+
position: import_system8.Position.Left,
|
|
2666
|
+
dataType: import_abstract11.CoreHandleType.variableProperty,
|
|
2667
|
+
connection: "target"
|
|
2668
|
+
},
|
|
2669
|
+
{
|
|
2670
|
+
position: import_system8.Position.Right,
|
|
2671
|
+
dataType: "module" /* module */,
|
|
2672
|
+
connection: "source"
|
|
2673
|
+
}
|
|
2674
|
+
]
|
|
2675
|
+
};
|
|
2676
|
+
};
|
|
2677
|
+
|
|
2678
|
+
// src/templates/generators/position-const-template.ts
|
|
2679
|
+
var import_system9 = require("@xyflow/system");
|
|
2680
|
+
var PositionConstNodeTemplateFactory = class {
|
|
2681
|
+
template = {
|
|
2682
|
+
type: "position" /* position */,
|
|
2683
|
+
group: "Positions" /* positions */,
|
|
2684
|
+
data: {
|
|
2685
|
+
title: "Position Output",
|
|
2686
|
+
position: { x: 0, y: 0, z: 0 }
|
|
2687
|
+
},
|
|
2688
|
+
handles: [
|
|
2689
|
+
{
|
|
2690
|
+
position: import_system9.Position.Right,
|
|
2691
|
+
dataType: "position" /* position */,
|
|
2692
|
+
connection: "source"
|
|
2693
|
+
}
|
|
2694
|
+
]
|
|
2695
|
+
};
|
|
2696
|
+
};
|
|
2697
|
+
|
|
2698
|
+
// src/templates/generators/position-grid-template.ts
|
|
2699
|
+
var import_system10 = require("@xyflow/system");
|
|
2700
|
+
var PositionGridNodeTemplateFactory = class {
|
|
2701
|
+
template = {
|
|
2702
|
+
type: "grid" /* grid */,
|
|
2703
|
+
group: "Positions" /* positions */,
|
|
2704
|
+
data: {
|
|
2705
|
+
title: "Grid Output",
|
|
2706
|
+
center: { x: 0, y: 0, z: 0 },
|
|
2707
|
+
radius: 1
|
|
2708
|
+
},
|
|
2709
|
+
handles: [
|
|
2710
|
+
{
|
|
2711
|
+
position: import_system10.Position.Right,
|
|
2712
|
+
dataType: "position" /* position */,
|
|
2713
|
+
connection: "source"
|
|
2714
|
+
}
|
|
2715
|
+
]
|
|
2716
|
+
};
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
// src/templates/modifiers/noise-normalize-template.ts
|
|
2720
|
+
var import_utils = require("@awesome-flow/core/utils");
|
|
2721
|
+
var import_system11 = require("@xyflow/system");
|
|
2722
|
+
var NoiseNormalizeNodeTemplateFactory = class {
|
|
2723
|
+
template = {
|
|
2724
|
+
id: import_utils.IDGenerator.template(),
|
|
2725
|
+
type: "noise-normalize" /* noiseNormalize */,
|
|
2726
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2727
|
+
data: {
|
|
2728
|
+
title: "Normalize Noise",
|
|
2729
|
+
intervalStart: -1,
|
|
2730
|
+
intervalEnd: 1
|
|
2731
|
+
},
|
|
2732
|
+
handles: [
|
|
2733
|
+
{
|
|
2734
|
+
position: import_system11.Position.Left,
|
|
2735
|
+
dataType: "module" /* module */,
|
|
2736
|
+
connection: "target",
|
|
2737
|
+
maxConnections: 1
|
|
2738
|
+
},
|
|
2739
|
+
{
|
|
2740
|
+
position: import_system11.Position.Right,
|
|
2741
|
+
dataType: "module" /* module */,
|
|
2742
|
+
connection: "source"
|
|
2743
|
+
}
|
|
2744
|
+
]
|
|
2745
|
+
};
|
|
2746
|
+
};
|
|
2747
|
+
|
|
2748
|
+
// src/templates/output/noise-logger-template.ts
|
|
2749
|
+
var import_system12 = require("@xyflow/system");
|
|
2750
|
+
var NoiseLoggerNodeTemplateFactory = class {
|
|
2751
|
+
template = {
|
|
2752
|
+
type: "noise-logger" /* noiseLogger */,
|
|
2753
|
+
group: "Output" /* output */,
|
|
2754
|
+
data: {
|
|
2755
|
+
title: "Noise Logger"
|
|
2756
|
+
},
|
|
2757
|
+
handles: [
|
|
2758
|
+
{
|
|
2759
|
+
position: import_system12.Position.Left,
|
|
2760
|
+
dataType: "noise" /* noise */,
|
|
2761
|
+
connection: "target"
|
|
2762
|
+
}
|
|
2763
|
+
]
|
|
2764
|
+
};
|
|
2765
|
+
};
|
|
2766
|
+
|
|
2767
|
+
// src/templates/output/noise-raw-texture-template.ts
|
|
2768
|
+
var import_system13 = require("@xyflow/system");
|
|
2769
|
+
var NoiseRawTextureTemplateFactory = class {
|
|
2770
|
+
template = {
|
|
2771
|
+
type: "texture-data" /* textureData */,
|
|
2772
|
+
group: "Output" /* output */,
|
|
2773
|
+
data: {
|
|
2774
|
+
title: "Texture Data"
|
|
2775
|
+
},
|
|
2776
|
+
handles: [
|
|
2777
|
+
{
|
|
2778
|
+
position: import_system13.Position.Left,
|
|
2779
|
+
dataType: "noise" /* noise */,
|
|
2780
|
+
connection: "target",
|
|
2781
|
+
maxConnections: 1
|
|
2782
|
+
},
|
|
2783
|
+
{
|
|
2784
|
+
position: import_system13.Position.Right,
|
|
2785
|
+
dataType: "texture" /* texture */,
|
|
2786
|
+
connection: "source"
|
|
2787
|
+
}
|
|
2788
|
+
]
|
|
2789
|
+
};
|
|
2790
|
+
};
|
|
2791
|
+
|
|
2792
|
+
// src/templates/output/position-logger-template.ts
|
|
2793
|
+
var import_system14 = require("@xyflow/system");
|
|
2794
|
+
var PositionLoggerNodeTemplateFactory = class {
|
|
2795
|
+
template = {
|
|
2796
|
+
type: "position-logger" /* positionLogger */,
|
|
2797
|
+
group: "Positions" /* positions */,
|
|
2798
|
+
data: {
|
|
2799
|
+
title: "Position Logger"
|
|
2800
|
+
},
|
|
2801
|
+
handles: [
|
|
2802
|
+
{
|
|
2803
|
+
position: import_system14.Position.Left,
|
|
2804
|
+
dataType: "position" /* position */,
|
|
2805
|
+
connection: "target"
|
|
2806
|
+
}
|
|
2807
|
+
]
|
|
2808
|
+
};
|
|
2809
|
+
};
|
|
2810
|
+
|
|
2811
|
+
// src/templates/modifiers/noise-combine-template.ts
|
|
2812
|
+
var import_system15 = require("@xyflow/system");
|
|
2813
|
+
var NoiseCombineNodeTemplateFactory = class {
|
|
2814
|
+
template = {
|
|
2815
|
+
type: "noise-combiner" /* noiseCombine */,
|
|
2816
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2817
|
+
data: {
|
|
2818
|
+
title: "Combine Noise",
|
|
2819
|
+
operation: "add" /* add */
|
|
2820
|
+
},
|
|
2821
|
+
handles: [
|
|
2822
|
+
{
|
|
2823
|
+
position: import_system15.Position.Left,
|
|
2824
|
+
dataType: "module" /* module */,
|
|
2825
|
+
connection: "target",
|
|
2826
|
+
maxConnections: 2
|
|
2827
|
+
},
|
|
2828
|
+
{
|
|
2829
|
+
position: import_system15.Position.Right,
|
|
2830
|
+
dataType: "module" /* module */,
|
|
2831
|
+
connection: "source"
|
|
2832
|
+
}
|
|
2833
|
+
]
|
|
2834
|
+
};
|
|
2835
|
+
};
|
|
2836
|
+
|
|
2837
|
+
// src/templates/modifiers/noise-clamp-template.ts
|
|
2838
|
+
var import_system16 = require("@xyflow/system");
|
|
2839
|
+
var NoiseClampNodeTemplateFactory = class {
|
|
2840
|
+
template = {
|
|
2841
|
+
type: "noise-clamp" /* noiseClamp */,
|
|
2842
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2843
|
+
data: {
|
|
2844
|
+
title: "Clamp Noise",
|
|
2845
|
+
lowerBound: -1,
|
|
2846
|
+
upperBound: 1
|
|
2847
|
+
},
|
|
2848
|
+
handles: [
|
|
2849
|
+
{
|
|
2850
|
+
position: import_system16.Position.Left,
|
|
2851
|
+
dataType: "module" /* module */,
|
|
2852
|
+
connection: "target",
|
|
2853
|
+
maxConnections: 1
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
position: import_system16.Position.Right,
|
|
2857
|
+
dataType: "module" /* module */,
|
|
2858
|
+
connection: "source"
|
|
2859
|
+
}
|
|
2860
|
+
]
|
|
2861
|
+
};
|
|
2862
|
+
};
|
|
2863
|
+
|
|
2864
|
+
// src/templates/modifiers/noise-abs-template.ts
|
|
2865
|
+
var import_system17 = require("@xyflow/system");
|
|
2866
|
+
var NoiseAbsNodeTemplateFactory = class {
|
|
2867
|
+
template = {
|
|
2868
|
+
type: "noise-abs" /* noiseAbs */,
|
|
2869
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2870
|
+
data: {
|
|
2871
|
+
title: "Abs Noise"
|
|
2872
|
+
},
|
|
2873
|
+
handles: [
|
|
2874
|
+
{
|
|
2875
|
+
position: import_system17.Position.Left,
|
|
2876
|
+
dataType: "module" /* module */,
|
|
2877
|
+
connection: "target",
|
|
2878
|
+
maxConnections: 1
|
|
2879
|
+
},
|
|
2880
|
+
{
|
|
2881
|
+
position: import_system17.Position.Right,
|
|
2882
|
+
dataType: "module" /* module */,
|
|
2883
|
+
connection: "source"
|
|
2884
|
+
}
|
|
2885
|
+
]
|
|
2886
|
+
};
|
|
2887
|
+
};
|
|
2888
|
+
|
|
2889
|
+
// src/templates/output/noise-output-template.ts
|
|
2890
|
+
var import_system18 = require("@xyflow/system");
|
|
2891
|
+
var NoiseOutputNodeTemplateFactory = class {
|
|
2892
|
+
template = {
|
|
2893
|
+
type: "noise-output" /* noiseOutput */,
|
|
2894
|
+
group: "Output" /* output */,
|
|
2895
|
+
data: {
|
|
2896
|
+
title: "Noise Output"
|
|
2897
|
+
},
|
|
2898
|
+
handles: [
|
|
2899
|
+
{
|
|
2900
|
+
position: import_system18.Position.Left,
|
|
2901
|
+
dataType: "position" /* position */,
|
|
2902
|
+
connection: "target"
|
|
2903
|
+
},
|
|
2904
|
+
{
|
|
2905
|
+
position: import_system18.Position.Left,
|
|
2906
|
+
dataType: "module" /* module */,
|
|
2907
|
+
connection: "target",
|
|
2908
|
+
maxConnections: 1
|
|
2909
|
+
},
|
|
2910
|
+
{
|
|
2911
|
+
position: import_system18.Position.Right,
|
|
2912
|
+
dataType: "noise" /* noise */,
|
|
2913
|
+
connection: "source"
|
|
2914
|
+
}
|
|
2915
|
+
]
|
|
2916
|
+
};
|
|
2917
|
+
};
|
|
2918
|
+
|
|
2919
|
+
// src/templates/modifiers/noise-curve-template.ts
|
|
2920
|
+
var import_abstract20 = require("@awesome-flow/core/abstract");
|
|
2921
|
+
var import_system19 = require("@xyflow/system");
|
|
2922
|
+
var NoiseCurveNodeTemplateFactory = class {
|
|
2923
|
+
template = {
|
|
2924
|
+
type: "noise-curve" /* noiseCurve */,
|
|
2925
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2926
|
+
data: {
|
|
2927
|
+
title: "Noise Curve",
|
|
2928
|
+
points: []
|
|
2929
|
+
},
|
|
2930
|
+
handles: [
|
|
2931
|
+
{
|
|
2932
|
+
position: import_system19.Position.Left,
|
|
2933
|
+
dataType: "module" /* module */,
|
|
2934
|
+
connection: "target",
|
|
2935
|
+
maxConnections: 1
|
|
2936
|
+
},
|
|
2937
|
+
{
|
|
2938
|
+
position: import_system19.Position.Left,
|
|
2939
|
+
dataType: import_abstract20.CoreHandleType.variableProperty,
|
|
2940
|
+
connection: "target"
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
position: import_system19.Position.Right,
|
|
2944
|
+
dataType: "module" /* module */,
|
|
2945
|
+
connection: "source"
|
|
2946
|
+
}
|
|
2947
|
+
]
|
|
2948
|
+
};
|
|
2949
|
+
};
|
|
2950
|
+
|
|
2951
|
+
// src/templates/modifiers/noise-exponent-template.ts
|
|
2952
|
+
var import_system20 = require("@xyflow/system");
|
|
2953
|
+
var NoiseExponentNodeTemplateFactory = class {
|
|
2954
|
+
template = {
|
|
2955
|
+
type: "noise-exponent" /* noiseExponent */,
|
|
2956
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2957
|
+
data: {
|
|
2958
|
+
title: "Noise Exponent",
|
|
2959
|
+
exponent: 1
|
|
2960
|
+
},
|
|
2961
|
+
handles: [
|
|
2962
|
+
{
|
|
2963
|
+
position: import_system20.Position.Left,
|
|
2964
|
+
dataType: "module" /* module */,
|
|
2965
|
+
connection: "target",
|
|
2966
|
+
maxConnections: 1
|
|
2967
|
+
},
|
|
2968
|
+
{
|
|
2969
|
+
position: import_system20.Position.Right,
|
|
2970
|
+
dataType: "module" /* module */,
|
|
2971
|
+
connection: "source"
|
|
2972
|
+
}
|
|
2973
|
+
]
|
|
2974
|
+
};
|
|
2975
|
+
};
|
|
2976
|
+
|
|
2977
|
+
// src/templates/modifiers/noise-invert-template.ts
|
|
2978
|
+
var import_system21 = require("@xyflow/system");
|
|
2979
|
+
var NoiseInvertNodeTemplateFactory = class {
|
|
2980
|
+
template = {
|
|
2981
|
+
type: "noise-invert" /* noiseInvert */,
|
|
2982
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2983
|
+
data: {
|
|
2984
|
+
title: "Invert Noise"
|
|
2985
|
+
},
|
|
2986
|
+
handles: [
|
|
2987
|
+
{
|
|
2988
|
+
position: import_system21.Position.Left,
|
|
2989
|
+
dataType: "module" /* module */,
|
|
2990
|
+
connection: "target",
|
|
2991
|
+
maxConnections: 1
|
|
2992
|
+
},
|
|
2993
|
+
{
|
|
2994
|
+
position: import_system21.Position.Right,
|
|
2995
|
+
dataType: "module" /* module */,
|
|
2996
|
+
connection: "source"
|
|
2997
|
+
}
|
|
2998
|
+
]
|
|
2999
|
+
};
|
|
3000
|
+
};
|
|
3001
|
+
|
|
3002
|
+
// src/templates/modifiers/noise-scalebias-template.ts
|
|
3003
|
+
var import_system22 = require("@xyflow/system");
|
|
3004
|
+
var NoiseScaleBiasNodeTemplateFactory = class {
|
|
3005
|
+
template = {
|
|
3006
|
+
type: "noise-scale-bias" /* noiseScaleBias */,
|
|
3007
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
3008
|
+
data: {
|
|
3009
|
+
title: "Scale/Bias Noise",
|
|
3010
|
+
scale: 1,
|
|
3011
|
+
bias: 0
|
|
3012
|
+
},
|
|
3013
|
+
handles: [
|
|
3014
|
+
{
|
|
3015
|
+
position: import_system22.Position.Left,
|
|
3016
|
+
dataType: "module" /* module */,
|
|
3017
|
+
connection: "target",
|
|
3018
|
+
maxConnections: 1
|
|
3019
|
+
},
|
|
3020
|
+
{
|
|
3021
|
+
position: import_system22.Position.Right,
|
|
3022
|
+
dataType: "module" /* module */,
|
|
3023
|
+
connection: "source"
|
|
3024
|
+
}
|
|
3025
|
+
]
|
|
3026
|
+
};
|
|
3027
|
+
};
|
|
3028
|
+
|
|
3029
|
+
// src/templates/modifiers/noise-terrace-template.ts
|
|
3030
|
+
var import_system23 = require("@xyflow/system");
|
|
3031
|
+
var NoiseTerraceNodeTemplateFactory = class {
|
|
3032
|
+
template = {
|
|
3033
|
+
type: "noise-terrace" /* noiseTerrace */,
|
|
3034
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
3035
|
+
data: {
|
|
3036
|
+
title: "Noise Terrace",
|
|
3037
|
+
points: []
|
|
3038
|
+
},
|
|
3039
|
+
handles: [
|
|
3040
|
+
{
|
|
3041
|
+
position: import_system23.Position.Left,
|
|
3042
|
+
dataType: "module" /* module */,
|
|
3043
|
+
connection: "target",
|
|
3044
|
+
maxConnections: 1
|
|
3045
|
+
},
|
|
3046
|
+
{
|
|
3047
|
+
position: import_system23.Position.Right,
|
|
3048
|
+
dataType: "module" /* module */,
|
|
3049
|
+
connection: "source"
|
|
3050
|
+
}
|
|
3051
|
+
]
|
|
3052
|
+
};
|
|
3053
|
+
};
|
|
3054
|
+
|
|
3055
|
+
// src/templates/selectors/noise-blend-template.ts
|
|
3056
|
+
var import_system24 = require("@xyflow/system");
|
|
3057
|
+
var NoiseBlendNodeTemplateFactory = class {
|
|
3058
|
+
template = {
|
|
3059
|
+
type: "noise-blend" /* noiseBlend */,
|
|
3060
|
+
group: "Noise Selectors" /* noiseSelectors */,
|
|
3061
|
+
data: {
|
|
3062
|
+
title: "Noise Blend"
|
|
3063
|
+
},
|
|
3064
|
+
handles: [
|
|
3065
|
+
{
|
|
3066
|
+
position: import_system24.Position.Left,
|
|
3067
|
+
dataType: "module" /* module */,
|
|
3068
|
+
connection: "target",
|
|
3069
|
+
label: "Source Modules",
|
|
3070
|
+
dataId: "source" /* source */,
|
|
3071
|
+
maxConnections: 2,
|
|
3072
|
+
minConnections: 2
|
|
3073
|
+
},
|
|
3074
|
+
{
|
|
3075
|
+
position: import_system24.Position.Left,
|
|
3076
|
+
dataType: "module" /* module */,
|
|
3077
|
+
dataId: "control" /* control */,
|
|
3078
|
+
connection: "target",
|
|
3079
|
+
label: "Control Module",
|
|
3080
|
+
maxConnections: 1
|
|
3081
|
+
},
|
|
3082
|
+
{
|
|
3083
|
+
position: import_system24.Position.Right,
|
|
3084
|
+
dataType: "module" /* module */,
|
|
3085
|
+
dataId: "output" /* output */,
|
|
3086
|
+
connection: "source"
|
|
3087
|
+
}
|
|
3088
|
+
]
|
|
3089
|
+
};
|
|
3090
|
+
};
|
|
3091
|
+
|
|
3092
|
+
// src/templates/selectors/noise-select-template.ts
|
|
3093
|
+
var import_system25 = require("@xyflow/system");
|
|
3094
|
+
var NoiseSelectNodeTemplateFactory = class {
|
|
3095
|
+
template = {
|
|
3096
|
+
type: "noise-select" /* noiseSelect */,
|
|
3097
|
+
group: "Noise Selectors" /* noiseSelectors */,
|
|
3098
|
+
data: {
|
|
3099
|
+
title: "Noise Select",
|
|
3100
|
+
edgeFalloff: 0,
|
|
3101
|
+
lowerBound: -1,
|
|
3102
|
+
upperBound: 1
|
|
3103
|
+
},
|
|
3104
|
+
handles: [
|
|
3105
|
+
{
|
|
3106
|
+
position: import_system25.Position.Left,
|
|
3107
|
+
dataType: "module" /* module */,
|
|
3108
|
+
dataId: "source" /* source */,
|
|
3109
|
+
connection: "target",
|
|
3110
|
+
label: "Source Modules",
|
|
3111
|
+
maxConnections: 2,
|
|
3112
|
+
minConnections: 2
|
|
3113
|
+
},
|
|
3114
|
+
{
|
|
3115
|
+
position: import_system25.Position.Left,
|
|
3116
|
+
dataType: "module" /* module */,
|
|
3117
|
+
dataId: "control" /* control */,
|
|
3118
|
+
connection: "target",
|
|
3119
|
+
label: "Control Module",
|
|
3120
|
+
maxConnections: 1
|
|
3121
|
+
},
|
|
3122
|
+
{
|
|
3123
|
+
position: import_system25.Position.Right,
|
|
3124
|
+
dataType: "module" /* module */,
|
|
3125
|
+
dataId: "output" /* output */,
|
|
3126
|
+
connection: "source"
|
|
3127
|
+
}
|
|
3128
|
+
]
|
|
3129
|
+
};
|
|
3130
|
+
};
|
|
3131
|
+
|
|
3132
|
+
// src/templates/transformers/noise-displace-template.ts
|
|
3133
|
+
var import_system26 = require("@xyflow/system");
|
|
3134
|
+
var NoiseDisplaceNodeTemplateFactory = class {
|
|
3135
|
+
template = {
|
|
3136
|
+
type: "noise-displace" /* noiseDisplace */,
|
|
3137
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3138
|
+
data: {
|
|
3139
|
+
title: "Noise Displace"
|
|
3140
|
+
},
|
|
3141
|
+
handles: [
|
|
3142
|
+
{
|
|
3143
|
+
position: import_system26.Position.Left,
|
|
3144
|
+
connection: "target",
|
|
3145
|
+
label: "Source Module",
|
|
3146
|
+
dataType: "module" /* module */,
|
|
3147
|
+
dataId: "source" /* sourceModule */,
|
|
3148
|
+
maxConnections: 1
|
|
3149
|
+
},
|
|
3150
|
+
{
|
|
3151
|
+
position: import_system26.Position.Left,
|
|
3152
|
+
connection: "target",
|
|
3153
|
+
label: "X Module",
|
|
3154
|
+
dataType: "module" /* module */,
|
|
3155
|
+
dataId: "x-module" /* xModule */,
|
|
3156
|
+
maxConnections: 1
|
|
3157
|
+
},
|
|
3158
|
+
{
|
|
3159
|
+
position: import_system26.Position.Left,
|
|
3160
|
+
connection: "target",
|
|
3161
|
+
label: "Y Module",
|
|
3162
|
+
dataType: "module" /* module */,
|
|
3163
|
+
dataId: "y-module" /* yModule */,
|
|
3164
|
+
maxConnections: 1
|
|
3165
|
+
},
|
|
3166
|
+
{
|
|
3167
|
+
position: import_system26.Position.Left,
|
|
3168
|
+
connection: "target",
|
|
3169
|
+
label: "Z Module",
|
|
3170
|
+
dataType: "module" /* module */,
|
|
3171
|
+
dataId: "z-module" /* zModule */,
|
|
3172
|
+
maxConnections: 1
|
|
3173
|
+
},
|
|
3174
|
+
{
|
|
3175
|
+
position: import_system26.Position.Right,
|
|
3176
|
+
dataType: "module" /* module */,
|
|
3177
|
+
dataId: "output" /* output */,
|
|
3178
|
+
connection: "source"
|
|
3179
|
+
}
|
|
3180
|
+
]
|
|
3181
|
+
};
|
|
3182
|
+
};
|
|
3183
|
+
|
|
3184
|
+
// src/templates/transformers/noise-rotate-point-template.ts
|
|
3185
|
+
var import_system27 = require("@xyflow/system");
|
|
3186
|
+
var NoiseRotatePointNodeTemplateFactory = class {
|
|
3187
|
+
template = {
|
|
3188
|
+
type: "noise-rotate-point" /* noiseRotatePoint */,
|
|
3189
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3190
|
+
data: {
|
|
3191
|
+
title: "Noise Rotate Point",
|
|
3192
|
+
xAngle: 0,
|
|
3193
|
+
yAngle: 0,
|
|
3194
|
+
zAngle: 0
|
|
3195
|
+
},
|
|
3196
|
+
handles: [
|
|
3197
|
+
{
|
|
3198
|
+
position: import_system27.Position.Left,
|
|
3199
|
+
dataType: "module" /* module */,
|
|
3200
|
+
connection: "target",
|
|
3201
|
+
label: "Source Module",
|
|
3202
|
+
maxConnections: 1
|
|
3203
|
+
},
|
|
3204
|
+
{
|
|
3205
|
+
position: import_system27.Position.Right,
|
|
3206
|
+
dataType: "module" /* module */,
|
|
3207
|
+
connection: "source"
|
|
3208
|
+
}
|
|
3209
|
+
]
|
|
3210
|
+
};
|
|
3211
|
+
};
|
|
3212
|
+
|
|
3213
|
+
// src/templates/transformers/noise-scale-point-template.ts
|
|
3214
|
+
var import_system28 = require("@xyflow/system");
|
|
3215
|
+
var NoiseScalePointNodeTemplateFactory = class {
|
|
3216
|
+
template = {
|
|
3217
|
+
type: "noise-scale-point" /* noiseScalePoint */,
|
|
3218
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3219
|
+
data: {
|
|
3220
|
+
title: "Noise Scale Point",
|
|
3221
|
+
xScale: 1,
|
|
3222
|
+
yScale: 1,
|
|
3223
|
+
zScale: 1
|
|
3224
|
+
},
|
|
3225
|
+
handles: [
|
|
3226
|
+
{
|
|
3227
|
+
position: import_system28.Position.Left,
|
|
3228
|
+
dataType: "module" /* module */,
|
|
3229
|
+
connection: "target",
|
|
3230
|
+
label: "Source Module",
|
|
3231
|
+
maxConnections: 1
|
|
3232
|
+
},
|
|
3233
|
+
{
|
|
3234
|
+
position: import_system28.Position.Right,
|
|
3235
|
+
dataType: "module" /* module */,
|
|
3236
|
+
connection: "source"
|
|
3237
|
+
}
|
|
3238
|
+
]
|
|
3239
|
+
};
|
|
3240
|
+
};
|
|
3241
|
+
|
|
3242
|
+
// src/templates/transformers/noise-translate-point-template.ts
|
|
3243
|
+
var import_system29 = require("@xyflow/system");
|
|
3244
|
+
var NoiseTranslatePointNodeTemplateFactory = class {
|
|
3245
|
+
template = {
|
|
3246
|
+
type: "noise-translate-point" /* noiseTranslatePoint */,
|
|
3247
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3248
|
+
data: {
|
|
3249
|
+
title: "Noise Translate Point",
|
|
3250
|
+
translateX: 0,
|
|
3251
|
+
translateY: 0,
|
|
3252
|
+
translateZ: 0
|
|
3253
|
+
},
|
|
3254
|
+
handles: [
|
|
3255
|
+
{
|
|
3256
|
+
position: import_system29.Position.Left,
|
|
3257
|
+
dataType: "module" /* module */,
|
|
3258
|
+
connection: "target",
|
|
3259
|
+
label: "Source Module",
|
|
3260
|
+
maxConnections: 1
|
|
3261
|
+
},
|
|
3262
|
+
{
|
|
3263
|
+
position: import_system29.Position.Right,
|
|
3264
|
+
dataType: "module" /* module */,
|
|
3265
|
+
connection: "source"
|
|
3266
|
+
}
|
|
3267
|
+
]
|
|
3268
|
+
};
|
|
3269
|
+
};
|
|
3270
|
+
|
|
3271
|
+
// src/templates/transformers/noise-turbulence-template.ts
|
|
3272
|
+
var import_abstract32 = require("@awesome-flow/core/abstract");
|
|
3273
|
+
var import_system30 = require("@xyflow/system");
|
|
3274
|
+
var NoiseTurbulenceNodeTemplateFactory = class {
|
|
3275
|
+
template = {
|
|
3276
|
+
type: "noise-turbulence" /* noiseTurbulence */,
|
|
3277
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3278
|
+
data: {
|
|
3279
|
+
title: "Noise Turbulence",
|
|
3280
|
+
frequency: 1,
|
|
3281
|
+
power: 1,
|
|
3282
|
+
roughness: 1,
|
|
3283
|
+
seed: 0
|
|
3284
|
+
},
|
|
3285
|
+
handles: [
|
|
3286
|
+
{
|
|
3287
|
+
position: import_system30.Position.Left,
|
|
3288
|
+
dataType: "module" /* module */,
|
|
3289
|
+
connection: "target",
|
|
3290
|
+
label: "Source Module",
|
|
3291
|
+
maxConnections: 1
|
|
3292
|
+
},
|
|
3293
|
+
{
|
|
3294
|
+
position: import_system30.Position.Left,
|
|
3295
|
+
dataType: import_abstract32.CoreHandleType.variableProperty,
|
|
3296
|
+
label: "Variable Properties",
|
|
3297
|
+
connection: "target"
|
|
3298
|
+
},
|
|
3299
|
+
{
|
|
3300
|
+
position: import_system30.Position.Right,
|
|
3301
|
+
dataType: "module" /* module */,
|
|
3302
|
+
connection: "source"
|
|
3303
|
+
}
|
|
3304
|
+
]
|
|
3305
|
+
};
|
|
3306
|
+
};
|
|
3307
|
+
|
|
3308
|
+
// src/templates/generators/noise-billow-template.ts
|
|
3309
|
+
var import_abstract34 = require("@awesome-flow/core/abstract");
|
|
3310
|
+
var import_utils2 = require("@awesome-flow/core/utils");
|
|
3311
|
+
var import_system31 = require("@xyflow/system");
|
|
3312
|
+
var NoiseBillowNodeTemplateFactory = class {
|
|
3313
|
+
template = {
|
|
3314
|
+
id: import_utils2.IDGenerator.template(),
|
|
3315
|
+
type: "noise-billow" /* noiseBillow */,
|
|
3316
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
3317
|
+
data: {
|
|
3318
|
+
title: "Billow Noise",
|
|
3319
|
+
frequency: 0.1,
|
|
3320
|
+
lacunarity: 2,
|
|
3321
|
+
octaves: 5,
|
|
3322
|
+
persistence: 0.5,
|
|
3323
|
+
seed: 0
|
|
3324
|
+
},
|
|
3325
|
+
handles: [
|
|
3326
|
+
{
|
|
3327
|
+
position: import_system31.Position.Left,
|
|
3328
|
+
dataType: import_abstract34.CoreHandleType.variableProperty,
|
|
3329
|
+
connection: "target"
|
|
3330
|
+
},
|
|
3331
|
+
{
|
|
3332
|
+
position: import_system31.Position.Right,
|
|
3333
|
+
dataType: "module" /* module */,
|
|
3334
|
+
connection: "source"
|
|
3335
|
+
}
|
|
3336
|
+
]
|
|
3337
|
+
};
|
|
3338
|
+
};
|
|
3339
|
+
|
|
3340
|
+
// src/templates/groups/module-group-template.ts
|
|
3341
|
+
var import_abstract35 = require("@awesome-flow/core/abstract");
|
|
3342
|
+
var import_utils3 = require("@awesome-flow/core/utils");
|
|
3343
|
+
var import_system32 = require("@xyflow/system");
|
|
3344
|
+
var ModuleGroupNodeTemplateFactory = class {
|
|
3345
|
+
template = {
|
|
3346
|
+
id: import_utils3.IDGenerator.template(),
|
|
3347
|
+
type: "group-module" /* groupModule */,
|
|
3348
|
+
group: import_abstract35.CoreTemplateGroup.groups,
|
|
3349
|
+
data: {
|
|
3350
|
+
title: "Modules Group",
|
|
3351
|
+
isGroup: true,
|
|
3352
|
+
initialSize: {
|
|
3353
|
+
width: 300,
|
|
3354
|
+
height: 200
|
|
3355
|
+
},
|
|
3356
|
+
collapsedSize: {
|
|
3357
|
+
width: 300,
|
|
3358
|
+
height: 80
|
|
3359
|
+
}
|
|
3360
|
+
},
|
|
3361
|
+
handles: [
|
|
3362
|
+
{
|
|
3363
|
+
position: import_system32.Position.Bottom,
|
|
3364
|
+
dataType: "module" /* module */,
|
|
3365
|
+
connection: "target",
|
|
3366
|
+
maxConnections: 1,
|
|
3367
|
+
hideOnCollapse: true
|
|
3368
|
+
},
|
|
3369
|
+
{
|
|
3370
|
+
position: import_system32.Position.Right,
|
|
3371
|
+
dataType: "module" /* module */,
|
|
3372
|
+
connection: "source"
|
|
3373
|
+
}
|
|
3374
|
+
]
|
|
3375
|
+
};
|
|
3376
|
+
};
|
|
3377
|
+
|
|
3378
|
+
// src/abstract/node-types.ts
|
|
3379
|
+
var noiseNodeTemplates = {
|
|
3380
|
+
["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
|
|
3381
|
+
["noise-simplex" /* noiseSimplex */]: new NoiseSimplexNodeTemplateFactory(),
|
|
3382
|
+
["noise-billow" /* noiseBillow */]: new NoiseBillowNodeTemplateFactory(),
|
|
3383
|
+
["noise-checkerboard" /* noiseCheckerboard */]: new NoiseCheckerboardNodeTemplateFactory(),
|
|
3384
|
+
["noise-normalize" /* noiseNormalize */]: new NoiseNormalizeNodeTemplateFactory(),
|
|
3385
|
+
["noise-logger" /* noiseLogger */]: new NoiseLoggerNodeTemplateFactory(),
|
|
3386
|
+
["noise-constant" /* noiseConst */]: new NoiseConstNodeTemplateFactory(),
|
|
3387
|
+
["position" /* position */]: new PositionConstNodeTemplateFactory(),
|
|
3388
|
+
["position-logger" /* positionLogger */]: new PositionLoggerNodeTemplateFactory(),
|
|
3389
|
+
["grid" /* grid */]: new PositionGridNodeTemplateFactory(),
|
|
3390
|
+
["texture-data" /* textureData */]: new NoiseRawTextureTemplateFactory(),
|
|
3391
|
+
["noise-cylinders" /* noiseCylinders */]: new NoiseCylindersNodeTemplateFactory(),
|
|
3392
|
+
["noise-perlin" /* noisePerlin */]: new NoisePerlinNodeTemplateFactory(),
|
|
3393
|
+
["noise-ridged-multi" /* noiseRidgedMulti */]: new NoiseRidgedMultiNodeTemplateFactory(),
|
|
3394
|
+
["noise-spheres" /* noiseSpheres */]: new NoiseSpheresNodeTemplateFactory(),
|
|
3395
|
+
["noise-voronoi" /* noiseVoronoi */]: new NoiseVoronoiNodeTemplateFactory(),
|
|
3396
|
+
["noise-combiner" /* noiseCombine */]: new NoiseCombineNodeTemplateFactory(),
|
|
3397
|
+
["noise-clamp" /* noiseClamp */]: new NoiseClampNodeTemplateFactory(),
|
|
3398
|
+
["noise-abs" /* noiseAbs */]: new NoiseAbsNodeTemplateFactory(),
|
|
3399
|
+
["noise-curve" /* noiseCurve */]: new NoiseCurveNodeTemplateFactory(),
|
|
3400
|
+
["noise-exponent" /* noiseExponent */]: new NoiseExponentNodeTemplateFactory(),
|
|
3401
|
+
["noise-invert" /* noiseInvert */]: new NoiseInvertNodeTemplateFactory(),
|
|
3402
|
+
["noise-scale-bias" /* noiseScaleBias */]: new NoiseScaleBiasNodeTemplateFactory(),
|
|
3403
|
+
["noise-terrace" /* noiseTerrace */]: new NoiseTerraceNodeTemplateFactory(),
|
|
3404
|
+
["noise-blend" /* noiseBlend */]: new NoiseBlendNodeTemplateFactory(),
|
|
3405
|
+
["noise-select" /* noiseSelect */]: new NoiseSelectNodeTemplateFactory(),
|
|
3406
|
+
["noise-displace" /* noiseDisplace */]: new NoiseDisplaceNodeTemplateFactory(),
|
|
3407
|
+
["noise-rotate-point" /* noiseRotatePoint */]: new NoiseRotatePointNodeTemplateFactory(),
|
|
3408
|
+
["noise-scale-point" /* noiseScalePoint */]: new NoiseScalePointNodeTemplateFactory(),
|
|
3409
|
+
["noise-translate-point" /* noiseTranslatePoint */]: new NoiseTranslatePointNodeTemplateFactory(),
|
|
3410
|
+
["noise-turbulence" /* noiseTurbulence */]: new NoiseTurbulenceNodeTemplateFactory(),
|
|
3411
|
+
["group-module" /* groupModule */]: new ModuleGroupNodeTemplateFactory()
|
|
3412
|
+
};
|
|
3413
|
+
|
|
3414
|
+
// src/nodes/output/noise-output-node.tsx
|
|
3415
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3416
|
+
function NoiseOutputNode({ id, selected, data, type }) {
|
|
3417
|
+
const [size, setSize] = (0, import_react40.useState)(0);
|
|
3418
|
+
const updateComputedData = (0, import_hooks34.useUpdateNodeComputedData)();
|
|
3419
|
+
const onDataUpdated = (0, import_react40.useCallback)(
|
|
3420
|
+
(handleData) => {
|
|
3421
|
+
const incomingPositions = handleData["position" /* position */];
|
|
3422
|
+
const incomingModule = handleData["module" /* module */];
|
|
3423
|
+
if (incomingPositions?.length && incomingModule?.length && incomingModule[0]?.module) {
|
|
3424
|
+
const { module: module2 } = incomingModule[0];
|
|
3425
|
+
const noise = [];
|
|
3426
|
+
for (const input of incomingPositions) {
|
|
3427
|
+
for (const position of input.positions) {
|
|
3428
|
+
const value = module2.getValue(position.x, position.y, position.z);
|
|
3429
|
+
noise.push({
|
|
3430
|
+
position,
|
|
3431
|
+
value
|
|
3432
|
+
});
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
updateComputedData(id, { noise, module: module2 });
|
|
3436
|
+
setSize(noise.length);
|
|
3437
|
+
}
|
|
3438
|
+
},
|
|
3439
|
+
[]
|
|
3440
|
+
);
|
|
3441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_layout32.NodeContainer, { id, selected, data, type, children: [
|
|
3442
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3443
|
+
import_components11.HandlesIncomingDataStatus,
|
|
3444
|
+
{
|
|
3445
|
+
nodeId: id,
|
|
3446
|
+
handles: data.handles,
|
|
3447
|
+
handleKey: "dataType",
|
|
3448
|
+
onDataUpdated,
|
|
3449
|
+
type: "target",
|
|
3450
|
+
resetComputedData: true
|
|
3451
|
+
}
|
|
3452
|
+
),
|
|
3453
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_core18.Text, { mt: 5, children: [
|
|
3454
|
+
"Noise points: ",
|
|
3455
|
+
size
|
|
3456
|
+
] }),
|
|
3457
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_layout32.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
3458
|
+
] });
|
|
3459
|
+
}
|
|
3460
|
+
var noise_output_node_default = NoiseOutputNode;
|
|
2792
3461
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2793
3462
|
0 && (module.exports = {
|
|
2794
3463
|
ModuleGroupNode,
|
|
@@ -2822,9 +3491,6 @@ var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
|
2822
3491
|
NoiseVoronoiNode,
|
|
2823
3492
|
PositionConstNode,
|
|
2824
3493
|
PositionGridNode,
|
|
2825
|
-
PositionsLoggerNode
|
|
2826
|
-
VariableCombineNode,
|
|
2827
|
-
VariablePropertyNode,
|
|
2828
|
-
VariableValueNode
|
|
3494
|
+
PositionsLoggerNode
|
|
2829
3495
|
});
|
|
2830
3496
|
//# sourceMappingURL=index.cjs.map
|