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