@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.js
CHANGED
|
@@ -71,150 +71,15 @@ var require_fast_deep_equal = __commonJS({
|
|
|
71
71
|
|
|
72
72
|
// src/nodes/generators/noise-billow-node.tsx
|
|
73
73
|
import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
|
|
74
|
-
import { useCallback
|
|
74
|
+
import { useCallback, useMemo } from "react";
|
|
75
75
|
import { Billow } from "libnoise-ts/module/generator";
|
|
76
76
|
import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
|
|
77
|
-
import {
|
|
78
|
-
|
|
79
|
-
// src/layout/node-property-variables.tsx
|
|
80
|
-
import { useIncomingNodeData, useUpdateNodeData } from "@awesome-flow/core/hooks";
|
|
81
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
82
|
-
import { Group, Stack } from "@mantine/core";
|
|
83
|
-
import { getObjectKeys } from "@awesome-flow/core/utils";
|
|
84
|
-
import { nodeDataPropertyExcept } from "@awesome-flow/core/abstract";
|
|
85
|
-
|
|
86
|
-
// src/layout/node-value-input.tsx
|
|
87
|
-
import { Input, NumberInput, Switch } from "@mantine/core";
|
|
88
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
89
|
-
function NodeValueInput({ value, disabled, step, onChange }) {
|
|
90
|
-
if (value === void 0 || value === null) {
|
|
91
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
92
|
-
}
|
|
93
|
-
switch (typeof value) {
|
|
94
|
-
case "boolean": {
|
|
95
|
-
return /* @__PURE__ */ jsx(
|
|
96
|
-
Switch,
|
|
97
|
-
{
|
|
98
|
-
checked: value,
|
|
99
|
-
disabled,
|
|
100
|
-
onChange: (e) => onChange(e.currentTarget.checked)
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
case "number": {
|
|
105
|
-
return /* @__PURE__ */ jsx(NumberInput, { value, disabled, step, onChange: (e) => onChange(e) });
|
|
106
|
-
}
|
|
107
|
-
case "string": {
|
|
108
|
-
return /* @__PURE__ */ jsx(
|
|
109
|
-
Input,
|
|
110
|
-
{
|
|
111
|
-
value,
|
|
112
|
-
disabled,
|
|
113
|
-
onChange: (e) => onChange(e.currentTarget.value)
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
default:
|
|
118
|
-
throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
var node_value_input_default = NodeValueInput;
|
|
122
|
-
|
|
123
|
-
// src/layout/node-property-input.tsx
|
|
124
|
-
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
125
|
-
function NodePropertyInput({ property, onChange }) {
|
|
126
|
-
if (!property) {
|
|
127
|
-
return /* @__PURE__ */ jsx2(Fragment2, {});
|
|
128
|
-
}
|
|
129
|
-
return /* @__PURE__ */ jsx2(
|
|
130
|
-
node_value_input_default,
|
|
131
|
-
{
|
|
132
|
-
value: property.value,
|
|
133
|
-
disabled: property.disabled,
|
|
134
|
-
step: property.step,
|
|
135
|
-
onChange: (value) => onChange(property.name, value)
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
var node_property_input_default = NodePropertyInput;
|
|
140
|
-
|
|
141
|
-
// src/layout/node-property-variables.tsx
|
|
142
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
143
|
-
function NodePropertyVariables({
|
|
144
|
-
data,
|
|
145
|
-
nodeId,
|
|
146
|
-
onPropertiesChange,
|
|
147
|
-
except = nodeDataPropertyExcept
|
|
148
|
-
}) {
|
|
149
|
-
const [properties, setProperties] = useState(() => {
|
|
150
|
-
const keys = getObjectKeys(data, except);
|
|
151
|
-
const dataProps = {};
|
|
152
|
-
for (const key of keys) {
|
|
153
|
-
dataProps[key] = {
|
|
154
|
-
name: key,
|
|
155
|
-
value: data[key]
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
return dataProps;
|
|
159
|
-
});
|
|
160
|
-
const updateNodeData = useUpdateNodeData();
|
|
161
|
-
const incoming = useIncomingNodeData(nodeId);
|
|
162
|
-
const resetAllDisabled = useCallback(() => {
|
|
163
|
-
const keys = Object.keys(properties);
|
|
164
|
-
keys.forEach((k) => {
|
|
165
|
-
properties[k].disabled = false;
|
|
166
|
-
});
|
|
167
|
-
setProperties(properties);
|
|
168
|
-
}, []);
|
|
169
|
-
const updatePropertyValue = useCallback((name, value, disabled) => {
|
|
170
|
-
let property = properties[name];
|
|
171
|
-
if (property) {
|
|
172
|
-
property.value = value;
|
|
173
|
-
} else {
|
|
174
|
-
property = {
|
|
175
|
-
name,
|
|
176
|
-
value
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
property.disabled = disabled;
|
|
180
|
-
setProperties({ ...properties, [name]: property });
|
|
181
|
-
updateNodeData(nodeId, { [name]: value });
|
|
182
|
-
}, []);
|
|
183
|
-
useEffect(() => {
|
|
184
|
-
resetAllDisabled();
|
|
185
|
-
if (incoming?.length) {
|
|
186
|
-
for (const connection of incoming) {
|
|
187
|
-
if (connection.property && properties[connection.property.name] !== void 0) {
|
|
188
|
-
updatePropertyValue(connection.property.name, connection.property.value, true);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}, [incoming]);
|
|
193
|
-
useEffect(() => {
|
|
194
|
-
if (onPropertiesChange) {
|
|
195
|
-
onPropertiesChange(properties);
|
|
196
|
-
}
|
|
197
|
-
}, [onPropertiesChange, properties]);
|
|
198
|
-
const nodes = useMemo(() => {
|
|
199
|
-
return Object.keys(properties).map((key) => {
|
|
200
|
-
const property = properties[key];
|
|
201
|
-
return /* @__PURE__ */ jsxs(Group, { children: [
|
|
202
|
-
property.name,
|
|
203
|
-
":",
|
|
204
|
-
/* @__PURE__ */ jsx3(node_property_input_default, { property, onChange: updatePropertyValue })
|
|
205
|
-
] }, key);
|
|
206
|
-
});
|
|
207
|
-
}, [properties, updatePropertyValue]);
|
|
208
|
-
return /* @__PURE__ */ jsx3(Stack, { children: nodes });
|
|
209
|
-
}
|
|
210
|
-
var node_property_variables_default = NodePropertyVariables;
|
|
211
|
-
|
|
212
|
-
// src/nodes/generators/noise-billow-node.tsx
|
|
213
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
77
|
+
import { NodePropertyVariables } from "@awesome-flow/core/components";
|
|
78
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
214
79
|
function NoiseBillowNode({ id, selected, data, type }) {
|
|
215
80
|
const updateComputedData = useUpdateNodeComputedData();
|
|
216
|
-
const module =
|
|
217
|
-
const onPropertiesChange =
|
|
81
|
+
const module = useMemo(() => new Billow(), []);
|
|
82
|
+
const onPropertiesChange = useCallback(
|
|
218
83
|
(properties) => {
|
|
219
84
|
Object.keys(properties).forEach((k) => {
|
|
220
85
|
module[k] = properties[k].value;
|
|
@@ -223,65 +88,57 @@ function NoiseBillowNode({ id, selected, data, type }) {
|
|
|
223
88
|
},
|
|
224
89
|
[id, module, updateComputedData]
|
|
225
90
|
);
|
|
226
|
-
return /* @__PURE__ */
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
|
|
229
|
-
{
|
|
230
|
-
data,
|
|
231
|
-
except: nodeDataPropertyExcept2,
|
|
232
|
-
nodeId: id,
|
|
233
|
-
onPropertiesChange
|
|
234
|
-
}
|
|
235
|
-
),
|
|
236
|
-
/* @__PURE__ */ jsx4(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
91
|
+
return /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
|
|
92
|
+
/* @__PURE__ */ jsx(NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
93
|
+
/* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
237
94
|
] });
|
|
238
95
|
}
|
|
239
96
|
var noise_billow_node_default = NoiseBillowNode;
|
|
240
97
|
|
|
241
98
|
// src/nodes/generators/noise-checkerboard-node.tsx
|
|
242
99
|
import { NodeContainer as NodeContainer2 } from "@awesome-flow/core/layout";
|
|
243
|
-
import { useEffect
|
|
100
|
+
import { useEffect, useMemo as useMemo2 } from "react";
|
|
244
101
|
import { Checkerboard } from "libnoise-ts/module/generator";
|
|
245
102
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData2 } from "@awesome-flow/core/hooks";
|
|
246
|
-
import { jsx as
|
|
103
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
247
104
|
function NoiseCheckerboardNode({ id, selected, data, type }) {
|
|
248
105
|
const updateComputedData = useUpdateNodeComputedData2();
|
|
249
|
-
const module =
|
|
250
|
-
|
|
106
|
+
const module = useMemo2(() => new Checkerboard(), []);
|
|
107
|
+
useEffect(() => {
|
|
251
108
|
updateComputedData(id, { module });
|
|
252
109
|
}, [id, module, updateComputedData]);
|
|
253
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ jsx2(NodeContainer2, { id, selected, data, type });
|
|
254
111
|
}
|
|
255
112
|
var noise_checkerboard_node_default = NoiseCheckerboardNode;
|
|
256
113
|
|
|
257
114
|
// src/nodes/generators/noise-const-node.tsx
|
|
258
115
|
import { NodeContainer as NodeContainer3 } from "@awesome-flow/core/layout";
|
|
259
|
-
import { useEffect as
|
|
260
|
-
import { Group
|
|
261
|
-
import { useUpdateNodeComputedData as useUpdateNodeComputedData3, useUpdateNodeData
|
|
116
|
+
import { useEffect as useEffect2, useMemo as useMemo3, useState } from "react";
|
|
117
|
+
import { Group, NumberInput, Stack } from "@mantine/core";
|
|
118
|
+
import { useUpdateNodeComputedData as useUpdateNodeComputedData3, useUpdateNodeData } from "@awesome-flow/core/hooks";
|
|
262
119
|
import { Const } from "libnoise-ts/module/generator";
|
|
263
|
-
import { jsx as
|
|
120
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
264
121
|
function NoiseConstNode({ id, selected, data, type }) {
|
|
265
|
-
const [min, setMin] =
|
|
266
|
-
const [max, setMax] =
|
|
267
|
-
const [noise, setNoise] =
|
|
268
|
-
const updateNodeData =
|
|
122
|
+
const [min, setMin] = useState(data.min);
|
|
123
|
+
const [max, setMax] = useState(data.max);
|
|
124
|
+
const [noise, setNoise] = useState(data.noise);
|
|
125
|
+
const updateNodeData = useUpdateNodeData();
|
|
269
126
|
const updateComputedData = useUpdateNodeComputedData3();
|
|
270
|
-
const module =
|
|
271
|
-
|
|
127
|
+
const module = useMemo3(() => new Const(), []);
|
|
128
|
+
useEffect2(() => {
|
|
272
129
|
module.value = noise;
|
|
273
130
|
updateNodeData(id, { noise, min, max });
|
|
274
131
|
updateComputedData(id, { module });
|
|
275
132
|
}, [noise, min, max, module, updateNodeData, id, updateComputedData]);
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
133
|
+
return /* @__PURE__ */ jsx3(NodeContainer3, { id, selected, data, type, children: /* @__PURE__ */ jsxs2(Stack, { children: [
|
|
134
|
+
/* @__PURE__ */ jsxs2(Group, { children: [
|
|
135
|
+
/* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: min, onChange: (e) => setMin(Number(e)) }),
|
|
136
|
+
/* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: max, onChange: (e) => setMax(Number(e)) })
|
|
280
137
|
] }),
|
|
281
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ jsxs2(Group, { children: [
|
|
282
139
|
"noise:",
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
|
|
140
|
+
/* @__PURE__ */ jsx3(
|
|
141
|
+
NumberInput,
|
|
285
142
|
{
|
|
286
143
|
size: "xs",
|
|
287
144
|
value: noise,
|
|
@@ -298,14 +155,15 @@ var noise_const_node_default = NoiseConstNode;
|
|
|
298
155
|
|
|
299
156
|
// src/nodes/generators/noise-cylinders-node.tsx
|
|
300
157
|
import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
|
|
301
|
-
import { useCallback as
|
|
158
|
+
import { useCallback as useCallback2, useMemo as useMemo4 } from "react";
|
|
302
159
|
import { Cylinders } from "libnoise-ts/module/generator";
|
|
303
160
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData4 } from "@awesome-flow/core/hooks";
|
|
304
|
-
import {
|
|
161
|
+
import { NodePropertyVariables as NodePropertyVariables2 } from "@awesome-flow/core/components";
|
|
162
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
305
163
|
function NoiseCylindersNode({ id, selected, data, type }) {
|
|
306
164
|
const updateComputedData = useUpdateNodeComputedData4();
|
|
307
|
-
const module =
|
|
308
|
-
const onPropertiesChange =
|
|
165
|
+
const module = useMemo4(() => new Cylinders(), []);
|
|
166
|
+
const onPropertiesChange = useCallback2(
|
|
309
167
|
(properties) => {
|
|
310
168
|
Object.keys(properties).forEach((k) => {
|
|
311
169
|
module[k] = properties[k].value;
|
|
@@ -314,23 +172,24 @@ function NoiseCylindersNode({ id, selected, data, type }) {
|
|
|
314
172
|
},
|
|
315
173
|
[id, module, updateComputedData]
|
|
316
174
|
);
|
|
317
|
-
return /* @__PURE__ */
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ jsxs3(NodeContainer4, { id, selected, data, type, children: [
|
|
176
|
+
/* @__PURE__ */ jsx4(NodePropertyVariables2, { data, nodeId: id, onPropertiesChange }),
|
|
177
|
+
/* @__PURE__ */ jsx4(NodeTrackConnections2, { handles: data.handles, nodeId: id, type: "target" })
|
|
320
178
|
] });
|
|
321
179
|
}
|
|
322
180
|
var noise_cylinders_node_default = NoiseCylindersNode;
|
|
323
181
|
|
|
324
182
|
// src/nodes/generators/noise-perlin-node.tsx
|
|
325
183
|
import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
|
|
326
|
-
import { useCallback as
|
|
184
|
+
import { useCallback as useCallback3, useMemo as useMemo5 } from "react";
|
|
327
185
|
import { Perlin } from "libnoise-ts/module/generator";
|
|
328
186
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData5 } from "@awesome-flow/core/hooks";
|
|
329
|
-
import {
|
|
187
|
+
import { NodePropertyVariables as NodePropertyVariables3 } from "@awesome-flow/core/components";
|
|
188
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
330
189
|
function NoisePerlinNode({ id, selected, data, type }) {
|
|
331
190
|
const updateComputedData = useUpdateNodeComputedData5();
|
|
332
|
-
const module =
|
|
333
|
-
const onPropertiesChange =
|
|
191
|
+
const module = useMemo5(() => new Perlin(), []);
|
|
192
|
+
const onPropertiesChange = useCallback3(
|
|
334
193
|
(properties) => {
|
|
335
194
|
Object.keys(properties).forEach((k) => {
|
|
336
195
|
module[k] = properties[k].value;
|
|
@@ -339,36 +198,37 @@ function NoisePerlinNode({ id, selected, data, type }) {
|
|
|
339
198
|
},
|
|
340
199
|
[id, module, updateComputedData]
|
|
341
200
|
);
|
|
342
|
-
return /* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
201
|
+
return /* @__PURE__ */ jsxs4(NodeContainer5, { id, selected, data, type, children: [
|
|
202
|
+
/* @__PURE__ */ jsx5(NodePropertyVariables3, { data, nodeId: id, onPropertiesChange }),
|
|
203
|
+
/* @__PURE__ */ jsx5(NodeTrackConnections3, { handles: data.handles, nodeId: id, type: "target" })
|
|
345
204
|
] });
|
|
346
205
|
}
|
|
347
206
|
var noise_perlin_node_default = NoisePerlinNode;
|
|
348
207
|
|
|
349
208
|
// src/nodes/generators/noise-ridgedmulti-node.tsx
|
|
350
209
|
import { NodeContainer as NodeContainer6, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
|
|
351
|
-
import { useCallback as
|
|
210
|
+
import { useCallback as useCallback4, useMemo as useMemo6 } from "react";
|
|
352
211
|
import { RidgedMulti } from "libnoise-ts/module/generator";
|
|
353
212
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData6 } from "@awesome-flow/core/hooks";
|
|
354
|
-
import {
|
|
213
|
+
import { NodePropertyVariables as NodePropertyVariables4 } from "@awesome-flow/core/components";
|
|
214
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
355
215
|
function NoiseRidgedMultiNode({ id, selected, data, type }) {
|
|
356
216
|
const updateComputedData = useUpdateNodeComputedData6();
|
|
357
|
-
const module =
|
|
358
|
-
const onPropertiesChange =
|
|
217
|
+
const module = useMemo6(() => new RidgedMulti(), []);
|
|
218
|
+
const onPropertiesChange = useCallback4((properties) => {
|
|
359
219
|
Object.keys(properties).forEach((k) => module[k] = properties[k].value);
|
|
360
220
|
updateComputedData(id, { module });
|
|
361
221
|
}, []);
|
|
362
|
-
return /* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
222
|
+
return /* @__PURE__ */ jsxs5(NodeContainer6, { id, selected, data, type, children: [
|
|
223
|
+
/* @__PURE__ */ jsx6(NodePropertyVariables4, { data, nodeId: id, onPropertiesChange }),
|
|
224
|
+
/* @__PURE__ */ jsx6(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" })
|
|
365
225
|
] });
|
|
366
226
|
}
|
|
367
227
|
var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
|
|
368
228
|
|
|
369
229
|
// src/nodes/generators/noise-simplex-node.tsx
|
|
370
230
|
import { NodeContainer as NodeContainer7 } from "@awesome-flow/core/layout";
|
|
371
|
-
import { useEffect as
|
|
231
|
+
import { useEffect as useEffect3, useMemo as useMemo7 } from "react";
|
|
372
232
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData7 } from "@awesome-flow/core/hooks";
|
|
373
233
|
|
|
374
234
|
// src/modules/simplex-module.ts
|
|
@@ -386,46 +246,48 @@ var SimplexModule = class extends Module {
|
|
|
386
246
|
};
|
|
387
247
|
|
|
388
248
|
// src/nodes/generators/noise-simplex-node.tsx
|
|
389
|
-
import { jsx as
|
|
249
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
390
250
|
function NoiseSimplexNode({ id, selected, data, type }) {
|
|
391
251
|
const updateComputedData = useUpdateNodeComputedData7();
|
|
392
|
-
const module =
|
|
393
|
-
|
|
252
|
+
const module = useMemo7(() => new SimplexModule(), []);
|
|
253
|
+
useEffect3(() => {
|
|
394
254
|
updateComputedData(id, { module });
|
|
395
255
|
}, []);
|
|
396
|
-
return /* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ jsx7(NodeContainer7, { id, selected, data, type });
|
|
397
257
|
}
|
|
398
258
|
var noise_simplex_node_default = NoiseSimplexNode;
|
|
399
259
|
|
|
400
260
|
// src/nodes/generators/noise-spheres-node.tsx
|
|
401
261
|
import { NodeContainer as NodeContainer8, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
|
|
402
|
-
import { useCallback as
|
|
262
|
+
import { useCallback as useCallback5, useMemo as useMemo8 } from "react";
|
|
403
263
|
import { Spheres } from "libnoise-ts/module/generator";
|
|
404
264
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData8 } from "@awesome-flow/core/hooks";
|
|
405
|
-
import {
|
|
265
|
+
import { NodePropertyVariables as NodePropertyVariables5 } from "@awesome-flow/core/components";
|
|
266
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
406
267
|
function NoiseSpheresNode({ id, selected, data, type }) {
|
|
407
268
|
const updateComputedData = useUpdateNodeComputedData8();
|
|
408
|
-
const module =
|
|
409
|
-
const onPropertiesChange =
|
|
269
|
+
const module = useMemo8(() => new Spheres(), []);
|
|
270
|
+
const onPropertiesChange = useCallback5((properties) => {
|
|
410
271
|
Object.keys(properties).forEach((k) => module[k] = properties[k].value);
|
|
411
272
|
updateComputedData(id, { module });
|
|
412
273
|
}, []);
|
|
413
|
-
return /* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ jsxs6(NodeContainer8, { id, selected, data, type, children: [
|
|
275
|
+
/* @__PURE__ */ jsx8(NodePropertyVariables5, { data, nodeId: id, onPropertiesChange }),
|
|
276
|
+
/* @__PURE__ */ jsx8(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
|
|
416
277
|
] });
|
|
417
278
|
}
|
|
418
279
|
var noise_spheres_node_default = NoiseSpheresNode;
|
|
419
280
|
|
|
420
281
|
// src/nodes/generators/noise-voronoi-node.tsx
|
|
421
282
|
import { NodeContainer as NodeContainer9, NodeTrackConnections as NodeTrackConnections6 } from "@awesome-flow/core/layout";
|
|
422
|
-
import { useCallback as
|
|
283
|
+
import { useCallback as useCallback6 } from "react";
|
|
423
284
|
import { Voronoi } from "libnoise-ts/module/generator";
|
|
424
285
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData9 } from "@awesome-flow/core/hooks";
|
|
425
|
-
import {
|
|
286
|
+
import { NodePropertyVariables as NodePropertyVariables6 } from "@awesome-flow/core/components";
|
|
287
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
426
288
|
function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
427
289
|
const updateComputedData = useUpdateNodeComputedData9();
|
|
428
|
-
const onPropertiesChange =
|
|
290
|
+
const onPropertiesChange = useCallback6(
|
|
429
291
|
(properties) => {
|
|
430
292
|
const module = new Voronoi(
|
|
431
293
|
properties.frequency.value,
|
|
@@ -437,27 +299,27 @@ function NoiseVoronoiNode({ id, selected, data, type }) {
|
|
|
437
299
|
},
|
|
438
300
|
[]
|
|
439
301
|
);
|
|
440
|
-
return /* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */
|
|
302
|
+
return /* @__PURE__ */ jsxs7(NodeContainer9, { id, selected, data, type, children: [
|
|
303
|
+
/* @__PURE__ */ jsx9(NodePropertyVariables6, { data, nodeId: id, onPropertiesChange }),
|
|
304
|
+
/* @__PURE__ */ jsx9(NodeTrackConnections6, { handles: data.handles, nodeId: id, type: "target" })
|
|
443
305
|
] });
|
|
444
306
|
}
|
|
445
307
|
var noise_voronoi_node_default = NoiseVoronoiNode;
|
|
446
308
|
|
|
447
309
|
// src/nodes/generators/position-const-node.tsx
|
|
448
310
|
import { NodeContainer as NodeContainer10 } from "@awesome-flow/core/layout";
|
|
449
|
-
import { useEffect as
|
|
450
|
-
import { Group as
|
|
451
|
-
import { useUpdateNodeComputedData as useUpdateNodeComputedData10, useUpdateNodeData as
|
|
452
|
-
import { jsx as
|
|
311
|
+
import { useEffect as useEffect4, useState as useState2 } from "react";
|
|
312
|
+
import { Group as Group2, NumberInput as NumberInput2, Stack as Stack2 } from "@mantine/core";
|
|
313
|
+
import { useUpdateNodeComputedData as useUpdateNodeComputedData10, useUpdateNodeData as useUpdateNodeData2 } from "@awesome-flow/core/hooks";
|
|
314
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
453
315
|
function PositionConstNode({ id, selected, data, type }) {
|
|
454
316
|
const position = data.position ?? { x: 0, y: 0, z: 0 };
|
|
455
|
-
const [x, setX] =
|
|
456
|
-
const [y, setY] =
|
|
457
|
-
const [z, setZ] =
|
|
458
|
-
const updateNodeData =
|
|
317
|
+
const [x, setX] = useState2(position.x);
|
|
318
|
+
const [y, setY] = useState2(position.y);
|
|
319
|
+
const [z, setZ] = useState2(position.z);
|
|
320
|
+
const updateNodeData = useUpdateNodeData2();
|
|
459
321
|
const updateComputedData = useUpdateNodeComputedData10();
|
|
460
|
-
|
|
322
|
+
useEffect4(() => {
|
|
461
323
|
const position2 = { x, y, z };
|
|
462
324
|
updateNodeData(id, {
|
|
463
325
|
position: position2
|
|
@@ -466,18 +328,18 @@ function PositionConstNode({ id, selected, data, type }) {
|
|
|
466
328
|
positions: [position2]
|
|
467
329
|
});
|
|
468
330
|
}, [x, y, z]);
|
|
469
|
-
return /* @__PURE__ */
|
|
470
|
-
/* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ jsx10(NodeContainer10, { id, selected, data, type, children: /* @__PURE__ */ jsxs8(Stack2, { children: [
|
|
332
|
+
/* @__PURE__ */ jsxs8(Group2, { children: [
|
|
471
333
|
"x: ",
|
|
472
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ jsx10(NumberInput2, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
473
335
|
] }),
|
|
474
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ jsxs8(Group2, { children: [
|
|
475
337
|
"y: ",
|
|
476
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ jsx10(NumberInput2, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
477
339
|
] }),
|
|
478
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ jsxs8(Group2, { children: [
|
|
479
341
|
"z: ",
|
|
480
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ jsx10(NumberInput2, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
481
343
|
] })
|
|
482
344
|
] }) });
|
|
483
345
|
}
|
|
@@ -485,28 +347,28 @@ var position_const_node_default = PositionConstNode;
|
|
|
485
347
|
|
|
486
348
|
// src/nodes/generators/position-grid-node.tsx
|
|
487
349
|
import { NodeContainer as NodeContainer11 } from "@awesome-flow/core/layout";
|
|
488
|
-
import { useEffect as
|
|
489
|
-
import { Group as
|
|
490
|
-
import { useUpdateNodeComputedData as useUpdateNodeComputedData11, useUpdateNodeData as
|
|
491
|
-
import { jsx as
|
|
350
|
+
import { useEffect as useEffect5, useState as useState3 } from "react";
|
|
351
|
+
import { Group as Group3, NumberInput as NumberInput3, Stack as Stack3 } from "@mantine/core";
|
|
352
|
+
import { useUpdateNodeComputedData as useUpdateNodeComputedData11, useUpdateNodeData as useUpdateNodeData3 } from "@awesome-flow/core/hooks";
|
|
353
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
492
354
|
function PositionGridNode({ id, selected, data, type }) {
|
|
493
|
-
const [x, setX] =
|
|
494
|
-
const [y, setY] =
|
|
495
|
-
const [z, setZ] =
|
|
496
|
-
const [radius, setRadius] =
|
|
497
|
-
const updateNodeData =
|
|
355
|
+
const [x, setX] = useState3(data.center?.x);
|
|
356
|
+
const [y, setY] = useState3(data.center?.y);
|
|
357
|
+
const [z, setZ] = useState3(data.center?.z);
|
|
358
|
+
const [radius, setRadius] = useState3(data.radius);
|
|
359
|
+
const updateNodeData = useUpdateNodeData3();
|
|
498
360
|
const updateComputedData = useUpdateNodeComputedData11();
|
|
499
|
-
|
|
361
|
+
useEffect5(() => {
|
|
500
362
|
updateNodeData(id, {
|
|
501
363
|
center: { x, y, z }
|
|
502
364
|
});
|
|
503
365
|
}, [x, y, z]);
|
|
504
|
-
|
|
366
|
+
useEffect5(() => {
|
|
505
367
|
updateNodeData(id, {
|
|
506
368
|
radius
|
|
507
369
|
});
|
|
508
370
|
}, [radius]);
|
|
509
|
-
|
|
371
|
+
useEffect5(() => {
|
|
510
372
|
const positions = [];
|
|
511
373
|
for (let i = -radius; i < radius; i++) {
|
|
512
374
|
for (let j = -radius; j < radius; j++) {
|
|
@@ -517,143 +379,40 @@ function PositionGridNode({ id, selected, data, type }) {
|
|
|
517
379
|
positions
|
|
518
380
|
});
|
|
519
381
|
}, [x, y, z, radius]);
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
382
|
+
return /* @__PURE__ */ jsx11(NodeContainer11, { id, selected, data, type, children: /* @__PURE__ */ jsxs9(Stack3, { children: [
|
|
383
|
+
/* @__PURE__ */ jsxs9(Group3, { children: [
|
|
522
384
|
"x: ",
|
|
523
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ jsx11(NumberInput3, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
|
|
524
386
|
] }),
|
|
525
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ jsxs9(Group3, { children: [
|
|
526
388
|
"y: ",
|
|
527
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ jsx11(NumberInput3, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
|
|
528
390
|
] }),
|
|
529
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ jsxs9(Group3, { children: [
|
|
530
392
|
"z: ",
|
|
531
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ jsx11(NumberInput3, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
|
|
532
394
|
] }),
|
|
533
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ jsxs9(Group3, { children: [
|
|
534
396
|
"r: ",
|
|
535
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ jsx11(NumberInput3, { size: "xs", w: 100, value: radius, onChange: (e) => setRadius(Number(e)) })
|
|
536
398
|
] })
|
|
537
399
|
] }) });
|
|
538
400
|
}
|
|
539
401
|
var position_grid_node_default = PositionGridNode;
|
|
540
402
|
|
|
541
|
-
// src/nodes/
|
|
542
|
-
import {
|
|
543
|
-
import { useCallback as useCallback8, useEffect as useEffect7, useState as useState5 } from "react";
|
|
544
|
-
import { Stack as Stack5 } from "@mantine/core";
|
|
545
|
-
import { useIncomingNodeData as useIncomingNodeData2, useOutgoingNodes, useUpdateNodeData as useUpdateNodeData5 } from "@awesome-flow/core/hooks";
|
|
546
|
-
import { getObjectPropertyMap } from "@awesome-flow/core/utils";
|
|
547
|
-
import { nodeDataPropertyExcept as nodeDataPropertyExcept3 } from "@awesome-flow/core/abstract";
|
|
548
|
-
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
549
|
-
function VariablePropertyNode({
|
|
550
|
-
id,
|
|
551
|
-
selected,
|
|
552
|
-
data,
|
|
553
|
-
type
|
|
554
|
-
}) {
|
|
555
|
-
const [options3, setOptions] = useState5({});
|
|
556
|
-
const [selectedProperty, setSelectedProperty] = useState5(data.property);
|
|
557
|
-
const updateNodeData = useUpdateNodeData5();
|
|
558
|
-
const outgoing = useOutgoingNodes(id);
|
|
559
|
-
const incoming = useIncomingNodeData2(id);
|
|
560
|
-
useEffect7(() => {
|
|
561
|
-
if (outgoing?.length) {
|
|
562
|
-
const { data: data2 } = outgoing[0];
|
|
563
|
-
const properties = getObjectPropertyMap(data2, nodeDataPropertyExcept3);
|
|
564
|
-
setOptions(properties);
|
|
565
|
-
if (!selectedProperty) {
|
|
566
|
-
const keys = Object.keys(properties);
|
|
567
|
-
if (keys.length) {
|
|
568
|
-
setSelectedProperty({
|
|
569
|
-
name: keys[0],
|
|
570
|
-
value: properties[keys[0]]
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
} else {
|
|
575
|
-
setSelectedProperty(null);
|
|
576
|
-
}
|
|
577
|
-
}, [outgoing]);
|
|
578
|
-
useEffect7(() => {
|
|
579
|
-
if (!incoming?.length && selectedProperty?.disabled) {
|
|
580
|
-
setSelectedProperty({ ...selectedProperty, disabled: false });
|
|
581
|
-
} else if (incoming?.length && selectedProperty) {
|
|
582
|
-
const incomingValue = incoming[0].value;
|
|
583
|
-
if (incomingValue !== void 0 && incomingValue !== null) {
|
|
584
|
-
setSelectedProperty({
|
|
585
|
-
name: selectedProperty.name,
|
|
586
|
-
value: incomingValue,
|
|
587
|
-
disabled: true
|
|
588
|
-
});
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}, [incoming]);
|
|
592
|
-
useEffect7(() => {
|
|
593
|
-
if (selectedProperty) {
|
|
594
|
-
updateNodeData(id, { property: selectedProperty });
|
|
595
|
-
}
|
|
596
|
-
}, [selectedProperty]);
|
|
597
|
-
const onPropertyChange = useCallback8(
|
|
598
|
-
(selected2) => {
|
|
599
|
-
setSelectedProperty({
|
|
600
|
-
name: selected2,
|
|
601
|
-
value: options3[selected2]
|
|
602
|
-
});
|
|
603
|
-
},
|
|
604
|
-
[options3]
|
|
605
|
-
);
|
|
606
|
-
const onValueChange = useCallback8((name, value) => {
|
|
607
|
-
setSelectedProperty({
|
|
608
|
-
name,
|
|
609
|
-
value
|
|
610
|
-
});
|
|
611
|
-
}, []);
|
|
612
|
-
return /* @__PURE__ */ jsxs11(NodeContainer12, { id, selected, data, type, children: [
|
|
613
|
-
/* @__PURE__ */ jsxs11(Stack5, { align: "center", children: [
|
|
614
|
-
/* @__PURE__ */ jsx15(
|
|
615
|
-
NodeCombobox,
|
|
616
|
-
{
|
|
617
|
-
options: options3,
|
|
618
|
-
onChange: onPropertyChange,
|
|
619
|
-
selected: selectedProperty?.name,
|
|
620
|
-
hideListValues: true
|
|
621
|
-
}
|
|
622
|
-
),
|
|
623
|
-
/* @__PURE__ */ jsx15(node_property_input_default, { property: selectedProperty, onChange: onValueChange })
|
|
624
|
-
] }),
|
|
625
|
-
/* @__PURE__ */ jsx15(NodeTrackConnections7, { handles: data.handles, nodeId: id })
|
|
626
|
-
] });
|
|
627
|
-
}
|
|
628
|
-
var variable_property_node_default = VariablePropertyNode;
|
|
629
|
-
|
|
630
|
-
// src/nodes/generators/variable-value-node.tsx
|
|
631
|
-
import { NodeContainer as NodeContainer13, NodeTrackConnections as NodeTrackConnections8 } from "@awesome-flow/core/layout";
|
|
632
|
-
import { useCallback as useCallback9, useState as useState6 } from "react";
|
|
633
|
-
import { useUpdateNodeData as useUpdateNodeData6 } from "@awesome-flow/core/hooks";
|
|
634
|
-
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
635
|
-
function VariableValueNode({ id, selected, data, type }) {
|
|
636
|
-
const [value, setValue] = useState6(data.value || 0);
|
|
637
|
-
const updateNodeData = useUpdateNodeData6();
|
|
638
|
-
const onValueChange = useCallback9((newValue) => {
|
|
639
|
-
updateNodeData(id, { value: newValue });
|
|
640
|
-
setValue(newValue);
|
|
641
|
-
}, []);
|
|
642
|
-
return /* @__PURE__ */ jsxs12(NodeContainer13, { id, selected, data, type, children: [
|
|
643
|
-
/* @__PURE__ */ jsx16(node_value_input_default, { value, onChange: onValueChange }),
|
|
644
|
-
/* @__PURE__ */ jsx16(NodeTrackConnections8, { handles: data.handles, nodeId: id, type: "source" })
|
|
645
|
-
] });
|
|
646
|
-
}
|
|
647
|
-
var variable_value_node_default = VariableValueNode;
|
|
648
|
-
|
|
649
|
-
// src/nodes/groups/node-module-group.tsx
|
|
650
|
-
import { NodeContainer as NodeContainer14, NodeCollapse } from "@awesome-flow/core/layout";
|
|
403
|
+
// src/nodes/groups/module-group-node.tsx
|
|
404
|
+
import { NodeContainer as NodeContainer12, NodeCollapse, NodeTrackConnections as NodeTrackConnections7 } from "@awesome-flow/core/layout";
|
|
651
405
|
import { NodeResizer, useStore, useUpdateNodeInternals } from "@xyflow/react";
|
|
652
|
-
import {
|
|
653
|
-
import { useCallback as useCallback10, useContext, useEffect as useEffect8, useMemo as useMemo10 } from "react";
|
|
406
|
+
import { useCallback as useCallback7, useEffect as useEffect6, useMemo as useMemo9 } from "react";
|
|
654
407
|
import { shallow } from "zustand/shallow";
|
|
655
|
-
import { Badge, Group as
|
|
656
|
-
import {
|
|
408
|
+
import { Badge, Group as Group4 } from "@mantine/core";
|
|
409
|
+
import {
|
|
410
|
+
useFlowStore,
|
|
411
|
+
useIncomingComputedData,
|
|
412
|
+
useInteractiveStore,
|
|
413
|
+
useUpdateNodeComputedData as useUpdateNodeComputedData12
|
|
414
|
+
} from "@awesome-flow/core/hooks";
|
|
415
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
657
416
|
function ModuleGroupNode({
|
|
658
417
|
id,
|
|
659
418
|
selected,
|
|
@@ -662,23 +421,22 @@ function ModuleGroupNode({
|
|
|
662
421
|
width,
|
|
663
422
|
height
|
|
664
423
|
}) {
|
|
665
|
-
const context = useContext(FlowContext);
|
|
666
424
|
const updateNodeInternals = useUpdateNodeInternals();
|
|
667
425
|
const triggerNodeChanges = useStore((s) => s.triggerNodeChanges);
|
|
668
|
-
const { groupNodes, setGroupCollapsed } =
|
|
669
|
-
|
|
426
|
+
const { groupNodes, setGroupCollapsed } = useFlowStore(
|
|
427
|
+
useCallback7(
|
|
670
428
|
(state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
|
|
671
429
|
[]
|
|
672
430
|
)
|
|
673
431
|
);
|
|
674
|
-
const intersectingNode =
|
|
675
|
-
|
|
432
|
+
const intersectingNode = useInteractiveStore(
|
|
433
|
+
useCallback7((state) => state.nodeIntersectionTargets[id], [id]),
|
|
676
434
|
shallow
|
|
677
435
|
);
|
|
678
|
-
|
|
436
|
+
useEffect6(() => {
|
|
679
437
|
updateNodeInternals(id);
|
|
680
438
|
}, [width, height]);
|
|
681
|
-
|
|
439
|
+
useEffect6(() => {
|
|
682
440
|
triggerNodeChanges([
|
|
683
441
|
{
|
|
684
442
|
id,
|
|
@@ -687,87 +445,98 @@ function ModuleGroupNode({
|
|
|
687
445
|
}
|
|
688
446
|
]);
|
|
689
447
|
}, [intersectingNode]);
|
|
690
|
-
const onCollapsed =
|
|
448
|
+
const onCollapsed = useCallback7((collapsed) => {
|
|
691
449
|
setGroupCollapsed(id, collapsed);
|
|
692
450
|
}, []);
|
|
693
|
-
const size =
|
|
451
|
+
const size = useMemo9(() => {
|
|
694
452
|
return {
|
|
695
453
|
width: data.initialSize?.width || 100,
|
|
696
454
|
height: data.initialSize?.height || 50
|
|
697
455
|
};
|
|
698
456
|
}, [data.initialSize]);
|
|
699
|
-
|
|
700
|
-
|
|
457
|
+
const incomingModules = useIncomingComputedData(id);
|
|
458
|
+
const updateComputedData = useUpdateNodeComputedData12();
|
|
459
|
+
useEffect6(() => {
|
|
460
|
+
if (incomingModules?.length) {
|
|
461
|
+
const { module } = incomingModules[0];
|
|
462
|
+
updateComputedData(id, { module });
|
|
463
|
+
}
|
|
464
|
+
}, [incomingModules]);
|
|
465
|
+
return /* @__PURE__ */ jsxs10(
|
|
466
|
+
NodeContainer12,
|
|
701
467
|
{
|
|
702
468
|
id,
|
|
703
469
|
selected,
|
|
704
470
|
data,
|
|
705
|
-
title: /* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
471
|
+
title: /* @__PURE__ */ jsx12(Group4, { justify: "space-between", children: /* @__PURE__ */ jsxs10(Group4, { gap: "xs", children: [
|
|
472
|
+
/* @__PURE__ */ jsx12(Badge, { size: "xs", variant: "outline", radius: "xs", color: "gray", children: groupNodes?.length || 0 }),
|
|
473
|
+
/* @__PURE__ */ jsx12(NodeCollapse, { nodeId: id, isCollapsed: data.isCollapsed, onCollapsed })
|
|
708
474
|
] }) }),
|
|
709
475
|
type,
|
|
710
|
-
children:
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
476
|
+
children: [
|
|
477
|
+
/* @__PURE__ */ jsx12(
|
|
478
|
+
NodeResizer,
|
|
479
|
+
{
|
|
480
|
+
nodeId: id,
|
|
481
|
+
minWidth: size.width,
|
|
482
|
+
minHeight: size.height,
|
|
483
|
+
isVisible: selected && !data.isCollapsed
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
/* @__PURE__ */ jsx12(NodeTrackConnections7, { handles: data.handles, nodeId: id, type: "target" })
|
|
487
|
+
]
|
|
719
488
|
}
|
|
720
489
|
);
|
|
721
490
|
}
|
|
722
|
-
var
|
|
491
|
+
var module_group_node_default = ModuleGroupNode;
|
|
723
492
|
|
|
724
493
|
// src/nodes/modifiers/noise-abs-node.tsx
|
|
725
|
-
import { NodeContainer as
|
|
726
|
-
import { useEffect as
|
|
727
|
-
import { useIncomingComputedData, useUpdateNodeComputedData as
|
|
494
|
+
import { NodeContainer as NodeContainer13, NodeTrackConnections as NodeTrackConnections8 } from "@awesome-flow/core/layout";
|
|
495
|
+
import { useEffect as useEffect7 } from "react";
|
|
496
|
+
import { useIncomingComputedData as useIncomingComputedData2, useUpdateNodeComputedData as useUpdateNodeComputedData13 } from "@awesome-flow/core/hooks";
|
|
728
497
|
import { Abs } from "libnoise-ts/module/modifier";
|
|
729
|
-
import { jsx as
|
|
498
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
730
499
|
function NoiseAbsNode({ id, selected, data, type }) {
|
|
731
|
-
const incoming =
|
|
732
|
-
const updateComputedData =
|
|
733
|
-
|
|
500
|
+
const incoming = useIncomingComputedData2(id);
|
|
501
|
+
const updateComputedData = useUpdateNodeComputedData13();
|
|
502
|
+
useEffect7(() => {
|
|
734
503
|
if (incoming?.length > 0) {
|
|
735
504
|
const module = new Abs(incoming[0].module);
|
|
736
505
|
updateComputedData(id, { module });
|
|
737
506
|
}
|
|
738
507
|
}, [incoming]);
|
|
739
|
-
return /* @__PURE__ */
|
|
508
|
+
return /* @__PURE__ */ jsx13(NodeContainer13, { id, selected, data, type, children: /* @__PURE__ */ jsx13(NodeTrackConnections8, { handles: data.handles, nodeId: id, type: "target" }) });
|
|
740
509
|
}
|
|
741
510
|
var noise_abs_node_default = NoiseAbsNode;
|
|
742
511
|
|
|
743
512
|
// src/nodes/modifiers/noise-clamp-node.tsx
|
|
744
|
-
import { NodeContainer as
|
|
745
|
-
import { useEffect as
|
|
746
|
-
import { Group as
|
|
513
|
+
import { NodeContainer as NodeContainer14, NodeTrackConnections as NodeTrackConnections9 } from "@awesome-flow/core/layout";
|
|
514
|
+
import { useEffect as useEffect8, useState as useState4 } from "react";
|
|
515
|
+
import { Group as Group5, NumberInput as NumberInput4, Stack as Stack4 } from "@mantine/core";
|
|
747
516
|
import {
|
|
748
|
-
useIncomingComputedData as
|
|
749
|
-
useUpdateNodeComputedData as
|
|
750
|
-
useUpdateNodeData as
|
|
517
|
+
useIncomingComputedData as useIncomingComputedData3,
|
|
518
|
+
useUpdateNodeComputedData as useUpdateNodeComputedData14,
|
|
519
|
+
useUpdateNodeData as useUpdateNodeData4
|
|
751
520
|
} from "@awesome-flow/core/hooks";
|
|
752
521
|
import { Clamp } from "libnoise-ts/module/modifier";
|
|
753
|
-
import { jsx as
|
|
522
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
754
523
|
function NoiseClampNode({ id, selected, data, type }) {
|
|
755
|
-
const [lowerBound, setLowerBound] =
|
|
756
|
-
const [upperBound, setUpperBound] =
|
|
757
|
-
const incoming =
|
|
758
|
-
const updateNodeData =
|
|
759
|
-
const updateComputedData =
|
|
760
|
-
|
|
524
|
+
const [lowerBound, setLowerBound] = useState4(data.lowerBound);
|
|
525
|
+
const [upperBound, setUpperBound] = useState4(data.upperBound);
|
|
526
|
+
const incoming = useIncomingComputedData3(id);
|
|
527
|
+
const updateNodeData = useUpdateNodeData4();
|
|
528
|
+
const updateComputedData = useUpdateNodeComputedData14();
|
|
529
|
+
useEffect8(() => {
|
|
761
530
|
if (incoming?.length) {
|
|
762
531
|
const module = new Clamp(incoming[0].module, lowerBound, upperBound);
|
|
763
532
|
updateComputedData(id, { module });
|
|
764
533
|
}
|
|
765
534
|
updateNodeData(id, { lowerBound, upperBound });
|
|
766
535
|
}, [incoming, lowerBound, upperBound]);
|
|
767
|
-
return /* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
770
|
-
|
|
536
|
+
return /* @__PURE__ */ jsxs11(NodeContainer14, { id, selected, data, type, children: [
|
|
537
|
+
/* @__PURE__ */ jsx14(Stack4, { children: /* @__PURE__ */ jsxs11(Group5, { children: [
|
|
538
|
+
/* @__PURE__ */ jsx14(
|
|
539
|
+
NumberInput4,
|
|
771
540
|
{
|
|
772
541
|
size: "xs",
|
|
773
542
|
w: 100,
|
|
@@ -776,8 +545,8 @@ function NoiseClampNode({ id, selected, data, type }) {
|
|
|
776
545
|
step: 0.1
|
|
777
546
|
}
|
|
778
547
|
),
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
|
|
548
|
+
/* @__PURE__ */ jsx14(
|
|
549
|
+
NumberInput4,
|
|
781
550
|
{
|
|
782
551
|
size: "xs",
|
|
783
552
|
w: 100,
|
|
@@ -787,18 +556,18 @@ function NoiseClampNode({ id, selected, data, type }) {
|
|
|
787
556
|
}
|
|
788
557
|
)
|
|
789
558
|
] }) }),
|
|
790
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ jsx14(NodeTrackConnections9, { handles: data.handles, nodeId: id, type: "target" })
|
|
791
560
|
] });
|
|
792
561
|
}
|
|
793
562
|
var noise_clamp_node_default = NoiseClampNode;
|
|
794
563
|
|
|
795
564
|
// src/nodes/modifiers/noise-combine-node.tsx
|
|
796
|
-
import { NodeCombobox
|
|
797
|
-
import { useCallback as
|
|
565
|
+
import { NodeCombobox, NodeContainer as NodeContainer15, NodeTrackConnections as NodeTrackConnections10 } from "@awesome-flow/core/layout";
|
|
566
|
+
import { useCallback as useCallback8, useEffect as useEffect9 } from "react";
|
|
798
567
|
import {
|
|
799
|
-
useIncomingComputedData as
|
|
800
|
-
useUpdateNodeComputedData as
|
|
801
|
-
useUpdateNodeData as
|
|
568
|
+
useIncomingComputedData as useIncomingComputedData4,
|
|
569
|
+
useUpdateNodeComputedData as useUpdateNodeComputedData15,
|
|
570
|
+
useUpdateNodeData as useUpdateNodeData5
|
|
802
571
|
} from "@awesome-flow/core/hooks";
|
|
803
572
|
import {
|
|
804
573
|
IconAsterisk,
|
|
@@ -819,49 +588,49 @@ var noiseCombineModuleMap = {
|
|
|
819
588
|
};
|
|
820
589
|
|
|
821
590
|
// src/nodes/modifiers/noise-combine-node.tsx
|
|
822
|
-
import { jsx as
|
|
591
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
823
592
|
var options = {
|
|
824
|
-
add: /* @__PURE__ */
|
|
825
|
-
min: /* @__PURE__ */
|
|
826
|
-
max: /* @__PURE__ */
|
|
827
|
-
multiply: /* @__PURE__ */
|
|
828
|
-
power: /* @__PURE__ */
|
|
593
|
+
add: /* @__PURE__ */ jsx15(IconPlus, {}),
|
|
594
|
+
min: /* @__PURE__ */ jsx15(IconChevronLeft, {}),
|
|
595
|
+
max: /* @__PURE__ */ jsx15(IconChevronRight, {}),
|
|
596
|
+
multiply: /* @__PURE__ */ jsx15(IconAsterisk, {}),
|
|
597
|
+
power: /* @__PURE__ */ jsx15(IconChevronUp, {})
|
|
829
598
|
};
|
|
830
599
|
function NoiseCombineNode({ id, selected, data, type }) {
|
|
831
|
-
const updateNodeData =
|
|
832
|
-
const updateComputedData =
|
|
833
|
-
const incoming =
|
|
834
|
-
|
|
600
|
+
const updateNodeData = useUpdateNodeData5();
|
|
601
|
+
const updateComputedData = useUpdateNodeComputedData15();
|
|
602
|
+
const incoming = useIncomingComputedData4(id);
|
|
603
|
+
useEffect9(() => {
|
|
835
604
|
const ModuleFactory = noiseCombineModuleMap[data.operation];
|
|
836
605
|
if (incoming?.length > 1) {
|
|
837
606
|
const module = new ModuleFactory(incoming[0].module, incoming[1].module);
|
|
838
607
|
updateComputedData(id, { module });
|
|
839
608
|
}
|
|
840
609
|
}, [data.operation, incoming]);
|
|
841
|
-
const onChange =
|
|
610
|
+
const onChange = useCallback8((operation) => {
|
|
842
611
|
updateNodeData(id, { operation });
|
|
843
612
|
}, []);
|
|
844
|
-
return /* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ jsxs12(NodeContainer15, { id, selected, data, type, children: [
|
|
614
|
+
/* @__PURE__ */ jsx15(NodeCombobox, { options, selected: data.operation, onChange, width: 150 }),
|
|
615
|
+
/* @__PURE__ */ jsx15(NodeTrackConnections10, { handles: data.handles, nodeId: id, type: "target" })
|
|
847
616
|
] });
|
|
848
617
|
}
|
|
849
618
|
var noise_combine_node_default = NoiseCombineNode;
|
|
850
619
|
|
|
851
620
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
852
|
-
import { NodeContainer as
|
|
853
|
-
import { ActionIcon, Button, Group as
|
|
621
|
+
import { NodeContainer as NodeContainer16, NodeTrackConnections as NodeTrackConnections11 } from "@awesome-flow/core/layout";
|
|
622
|
+
import { ActionIcon, Button, Group as Group6, NumberInput as NumberInput5, Space } from "@mantine/core";
|
|
854
623
|
import {
|
|
855
|
-
useIncomingComputedData as
|
|
856
|
-
useUpdateNodeComputedData as
|
|
857
|
-
useUpdateNodeData as
|
|
624
|
+
useIncomingComputedData as useIncomingComputedData5,
|
|
625
|
+
useUpdateNodeComputedData as useUpdateNodeComputedData16,
|
|
626
|
+
useUpdateNodeData as useUpdateNodeData6
|
|
858
627
|
} from "@awesome-flow/core/hooks";
|
|
859
628
|
|
|
860
629
|
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
861
|
-
import { useState as
|
|
630
|
+
import { useState as useState8, useCallback as useCallback14 } from "react";
|
|
862
631
|
|
|
863
632
|
// ../../node_modules/@mantine/form/esm/actions/actions.mjs
|
|
864
|
-
import { useLayoutEffect, useEffect as
|
|
633
|
+
import { useLayoutEffect, useEffect as useEffect10 } from "react";
|
|
865
634
|
function validateFormName(name) {
|
|
866
635
|
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
867
636
|
throw new Error(
|
|
@@ -869,7 +638,7 @@ function validateFormName(name) {
|
|
|
869
638
|
);
|
|
870
639
|
}
|
|
871
640
|
}
|
|
872
|
-
var useIsomorphicEffect = typeof window !== "undefined" ? useLayoutEffect :
|
|
641
|
+
var useIsomorphicEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect10;
|
|
873
642
|
function useFormEvent(eventKey, handler) {
|
|
874
643
|
useIsomorphicEffect(() => {
|
|
875
644
|
if (eventKey) {
|
|
@@ -966,7 +735,7 @@ function getInputOnChange(setValue) {
|
|
|
966
735
|
}
|
|
967
736
|
|
|
968
737
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
969
|
-
import { useState as
|
|
738
|
+
import { useState as useState5, useCallback as useCallback9 } from "react";
|
|
970
739
|
|
|
971
740
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
972
741
|
function filterErrors(errors) {
|
|
@@ -984,14 +753,14 @@ function filterErrors(errors) {
|
|
|
984
753
|
|
|
985
754
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
986
755
|
function useFormErrors(initialErrors) {
|
|
987
|
-
const [errorsState, setErrorsState] =
|
|
988
|
-
const setErrors =
|
|
756
|
+
const [errorsState, setErrorsState] = useState5(filterErrors(initialErrors));
|
|
757
|
+
const setErrors = useCallback9((errors) => {
|
|
989
758
|
setErrorsState(
|
|
990
759
|
(current) => filterErrors(typeof errors === "function" ? errors(current) : errors)
|
|
991
760
|
);
|
|
992
761
|
}, []);
|
|
993
|
-
const clearErrors =
|
|
994
|
-
const clearFieldError =
|
|
762
|
+
const clearErrors = useCallback9(() => setErrorsState({}), []);
|
|
763
|
+
const clearFieldError = useCallback9(
|
|
995
764
|
(path) => {
|
|
996
765
|
if (errorsState[path] === void 0) {
|
|
997
766
|
return;
|
|
@@ -1004,7 +773,7 @@ function useFormErrors(initialErrors) {
|
|
|
1004
773
|
},
|
|
1005
774
|
[errorsState]
|
|
1006
775
|
);
|
|
1007
|
-
const setFieldError =
|
|
776
|
+
const setFieldError = useCallback9(
|
|
1008
777
|
(path, error) => {
|
|
1009
778
|
if (error == null || error === false) {
|
|
1010
779
|
clearFieldError(path);
|
|
@@ -1024,7 +793,7 @@ function useFormErrors(initialErrors) {
|
|
|
1024
793
|
}
|
|
1025
794
|
|
|
1026
795
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
1027
|
-
import { useCallback as
|
|
796
|
+
import { useCallback as useCallback10 } from "react";
|
|
1028
797
|
|
|
1029
798
|
// ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
1030
799
|
function clearListState(field, state) {
|
|
@@ -1248,7 +1017,7 @@ function useFormList({
|
|
|
1248
1017
|
$errors,
|
|
1249
1018
|
$status
|
|
1250
1019
|
}) {
|
|
1251
|
-
const reorderListItem =
|
|
1020
|
+
const reorderListItem = useCallback10((path, payload) => {
|
|
1252
1021
|
$status.clearFieldDirty(path);
|
|
1253
1022
|
$errors.setErrors((errs) => reorderErrors(path, payload, errs));
|
|
1254
1023
|
$values.setValues({
|
|
@@ -1256,7 +1025,7 @@ function useFormList({
|
|
|
1256
1025
|
updateState: true
|
|
1257
1026
|
});
|
|
1258
1027
|
}, []);
|
|
1259
|
-
const removeListItem =
|
|
1028
|
+
const removeListItem = useCallback10((path, index) => {
|
|
1260
1029
|
$status.clearFieldDirty(path);
|
|
1261
1030
|
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));
|
|
1262
1031
|
$values.setValues({
|
|
@@ -1264,7 +1033,7 @@ function useFormList({
|
|
|
1264
1033
|
updateState: true
|
|
1265
1034
|
});
|
|
1266
1035
|
}, []);
|
|
1267
|
-
const insertListItem =
|
|
1036
|
+
const insertListItem = useCallback10((path, item, index) => {
|
|
1268
1037
|
$status.clearFieldDirty(path);
|
|
1269
1038
|
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));
|
|
1270
1039
|
$values.setValues({
|
|
@@ -1277,7 +1046,7 @@ function useFormList({
|
|
|
1277
1046
|
|
|
1278
1047
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
1279
1048
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
1280
|
-
import { useState as
|
|
1049
|
+
import { useState as useState6, useRef, useCallback as useCallback11 } from "react";
|
|
1281
1050
|
|
|
1282
1051
|
// ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
1283
1052
|
function getStatus(status, path) {
|
|
@@ -1296,31 +1065,31 @@ function useFormStatus({
|
|
|
1296
1065
|
mode,
|
|
1297
1066
|
$values
|
|
1298
1067
|
}) {
|
|
1299
|
-
const [touchedState, setTouchedState] =
|
|
1300
|
-
const [dirtyState, setDirtyState] =
|
|
1068
|
+
const [touchedState, setTouchedState] = useState6(initialTouched);
|
|
1069
|
+
const [dirtyState, setDirtyState] = useState6(initialDirty);
|
|
1301
1070
|
const touchedRef = useRef(initialTouched);
|
|
1302
1071
|
const dirtyRef = useRef(initialDirty);
|
|
1303
|
-
const setTouched =
|
|
1072
|
+
const setTouched = useCallback11((values) => {
|
|
1304
1073
|
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
1305
1074
|
touchedRef.current = resolvedValues;
|
|
1306
1075
|
if (mode === "controlled") {
|
|
1307
1076
|
setTouchedState(resolvedValues);
|
|
1308
1077
|
}
|
|
1309
1078
|
}, []);
|
|
1310
|
-
const setDirty =
|
|
1079
|
+
const setDirty = useCallback11((values) => {
|
|
1311
1080
|
const resolvedValues = typeof values === "function" ? values(dirtyRef.current) : values;
|
|
1312
1081
|
dirtyRef.current = resolvedValues;
|
|
1313
1082
|
if (mode === "controlled") {
|
|
1314
1083
|
setDirtyState(resolvedValues);
|
|
1315
1084
|
}
|
|
1316
1085
|
}, []);
|
|
1317
|
-
const resetTouched =
|
|
1086
|
+
const resetTouched = useCallback11(() => setTouched({}), []);
|
|
1318
1087
|
const resetDirty = (values) => {
|
|
1319
1088
|
const newSnapshot = values ? { ...values, ...$values.refValues.current } : $values.refValues.current;
|
|
1320
1089
|
$values.setValuesSnapshot(newSnapshot);
|
|
1321
1090
|
setDirty({});
|
|
1322
1091
|
};
|
|
1323
|
-
const setFieldTouched =
|
|
1092
|
+
const setFieldTouched = useCallback11((path, touched) => {
|
|
1324
1093
|
setTouched((currentTouched) => {
|
|
1325
1094
|
if (getStatus(currentTouched, path) === touched) {
|
|
1326
1095
|
return currentTouched;
|
|
@@ -1328,7 +1097,7 @@ function useFormStatus({
|
|
|
1328
1097
|
return { ...currentTouched, [path]: touched };
|
|
1329
1098
|
});
|
|
1330
1099
|
}, []);
|
|
1331
|
-
const setFieldDirty =
|
|
1100
|
+
const setFieldDirty = useCallback11((path, dirty) => {
|
|
1332
1101
|
setDirty((currentDirty) => {
|
|
1333
1102
|
if (getStatus(currentDirty, path) === dirty) {
|
|
1334
1103
|
return currentDirty;
|
|
@@ -1336,11 +1105,11 @@ function useFormStatus({
|
|
|
1336
1105
|
return { ...currentDirty, [path]: dirty };
|
|
1337
1106
|
});
|
|
1338
1107
|
}, []);
|
|
1339
|
-
const isTouched =
|
|
1108
|
+
const isTouched = useCallback11(
|
|
1340
1109
|
(path) => getStatus(touchedRef.current, path),
|
|
1341
1110
|
[]
|
|
1342
1111
|
);
|
|
1343
|
-
const clearFieldDirty =
|
|
1112
|
+
const clearFieldDirty = useCallback11(
|
|
1344
1113
|
(path) => setDirty((current) => {
|
|
1345
1114
|
if (typeof path !== "string") {
|
|
1346
1115
|
return current;
|
|
@@ -1354,7 +1123,7 @@ function useFormStatus({
|
|
|
1354
1123
|
}),
|
|
1355
1124
|
[]
|
|
1356
1125
|
);
|
|
1357
|
-
const isDirty =
|
|
1126
|
+
const isDirty = useCallback11((path) => {
|
|
1358
1127
|
if (path) {
|
|
1359
1128
|
const overriddenValue = getPath(path, dirtyRef.current);
|
|
1360
1129
|
if (typeof overriddenValue === "boolean") {
|
|
@@ -1370,8 +1139,8 @@ function useFormStatus({
|
|
|
1370
1139
|
}
|
|
1371
1140
|
return !(0, import_fast_deep_equal.default)($values.refValues.current, $values.valuesSnapshot.current);
|
|
1372
1141
|
}, []);
|
|
1373
|
-
const getDirty =
|
|
1374
|
-
const getTouched =
|
|
1142
|
+
const getDirty = useCallback11(() => dirtyRef.current, []);
|
|
1143
|
+
const getTouched = useCallback11(() => touchedRef.current, []);
|
|
1375
1144
|
return {
|
|
1376
1145
|
touchedState,
|
|
1377
1146
|
dirtyState,
|
|
@@ -1394,17 +1163,17 @@ function useFormStatus({
|
|
|
1394
1163
|
}
|
|
1395
1164
|
|
|
1396
1165
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
1397
|
-
import { useRef as useRef2, useState as
|
|
1166
|
+
import { useRef as useRef2, useState as useState7, useCallback as useCallback12 } from "react";
|
|
1398
1167
|
function useFormValues({
|
|
1399
1168
|
initialValues,
|
|
1400
1169
|
onValuesChange,
|
|
1401
1170
|
mode
|
|
1402
1171
|
}) {
|
|
1403
1172
|
const initialized = useRef2(false);
|
|
1404
|
-
const [stateValues, setStateValues] =
|
|
1173
|
+
const [stateValues, setStateValues] = useState7(initialValues || {});
|
|
1405
1174
|
const refValues = useRef2(stateValues);
|
|
1406
1175
|
const valuesSnapshot = useRef2(stateValues);
|
|
1407
|
-
const setValues =
|
|
1176
|
+
const setValues = useCallback12(
|
|
1408
1177
|
({
|
|
1409
1178
|
values,
|
|
1410
1179
|
subscribers,
|
|
@@ -1421,7 +1190,7 @@ function useFormValues({
|
|
|
1421
1190
|
},
|
|
1422
1191
|
[onValuesChange]
|
|
1423
1192
|
);
|
|
1424
|
-
const setFieldValue =
|
|
1193
|
+
const setFieldValue = useCallback12((payload) => {
|
|
1425
1194
|
const currentValue = getPath(payload.path, refValues.current);
|
|
1426
1195
|
const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;
|
|
1427
1196
|
if (currentValue !== updatedValue) {
|
|
@@ -1433,10 +1202,10 @@ function useFormValues({
|
|
|
1433
1202
|
);
|
|
1434
1203
|
}
|
|
1435
1204
|
}, []);
|
|
1436
|
-
const setValuesSnapshot =
|
|
1205
|
+
const setValuesSnapshot = useCallback12((payload) => {
|
|
1437
1206
|
valuesSnapshot.current = payload;
|
|
1438
1207
|
}, []);
|
|
1439
|
-
const initialize =
|
|
1208
|
+
const initialize = useCallback12((values, onInitialize) => {
|
|
1440
1209
|
if (!initialized.current) {
|
|
1441
1210
|
initialized.current = true;
|
|
1442
1211
|
setValues({ values, updateState: mode === "controlled" });
|
|
@@ -1444,14 +1213,14 @@ function useFormValues({
|
|
|
1444
1213
|
onInitialize();
|
|
1445
1214
|
}
|
|
1446
1215
|
}, []);
|
|
1447
|
-
const resetValues =
|
|
1216
|
+
const resetValues = useCallback12(() => {
|
|
1448
1217
|
setValues({
|
|
1449
1218
|
values: valuesSnapshot.current,
|
|
1450
1219
|
updateState: true,
|
|
1451
1220
|
mergeWithPreviousValues: false
|
|
1452
1221
|
});
|
|
1453
1222
|
}, []);
|
|
1454
|
-
const getValues =
|
|
1223
|
+
const getValues = useCallback12(() => refValues.current, []);
|
|
1455
1224
|
return {
|
|
1456
1225
|
initialized,
|
|
1457
1226
|
stateValues,
|
|
@@ -1467,15 +1236,15 @@ function useFormValues({
|
|
|
1467
1236
|
}
|
|
1468
1237
|
|
|
1469
1238
|
// ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
1470
|
-
import { useRef as useRef3, useCallback as
|
|
1239
|
+
import { useRef as useRef3, useCallback as useCallback13, useEffect as useEffect11 } from "react";
|
|
1471
1240
|
function useFormWatch({
|
|
1472
1241
|
$status
|
|
1473
1242
|
}) {
|
|
1474
1243
|
const subscribers = useRef3(
|
|
1475
1244
|
{}
|
|
1476
1245
|
);
|
|
1477
|
-
const watch =
|
|
1478
|
-
|
|
1246
|
+
const watch = useCallback13((path, callback) => {
|
|
1247
|
+
useEffect11(() => {
|
|
1479
1248
|
subscribers.current[path] = subscribers.current[path] || [];
|
|
1480
1249
|
subscribers.current[path].push(callback);
|
|
1481
1250
|
return () => {
|
|
@@ -1483,7 +1252,7 @@ function useFormWatch({
|
|
|
1483
1252
|
};
|
|
1484
1253
|
}, [callback]);
|
|
1485
1254
|
}, []);
|
|
1486
|
-
const getFieldSubscribers =
|
|
1255
|
+
const getFieldSubscribers = useCallback13((path) => {
|
|
1487
1256
|
if (!subscribers.current[path]) {
|
|
1488
1257
|
return [];
|
|
1489
1258
|
}
|
|
@@ -1503,6 +1272,11 @@ function useFormWatch({
|
|
|
1503
1272
|
};
|
|
1504
1273
|
}
|
|
1505
1274
|
|
|
1275
|
+
// ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
1276
|
+
function getDataPath(formName, fieldPath) {
|
|
1277
|
+
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1506
1280
|
// ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
1507
1281
|
function getValidationResults(errors) {
|
|
1508
1282
|
const filteredErrors = filterErrors(errors);
|
|
@@ -1591,20 +1365,20 @@ function useForm({
|
|
|
1591
1365
|
const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });
|
|
1592
1366
|
const $list = useFormList({ $values, $errors, $status });
|
|
1593
1367
|
const $watch = useFormWatch({ $status });
|
|
1594
|
-
const [formKey, setFormKey] =
|
|
1595
|
-
const [fieldKeys, setFieldKeys] =
|
|
1596
|
-
const reset =
|
|
1368
|
+
const [formKey, setFormKey] = useState8(0);
|
|
1369
|
+
const [fieldKeys, setFieldKeys] = useState8({});
|
|
1370
|
+
const reset = useCallback14(() => {
|
|
1597
1371
|
$values.resetValues();
|
|
1598
1372
|
$errors.clearErrors();
|
|
1599
1373
|
$status.resetDirty();
|
|
1600
1374
|
$status.resetTouched();
|
|
1601
1375
|
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
1602
1376
|
}, []);
|
|
1603
|
-
const initialize =
|
|
1377
|
+
const initialize = useCallback14((values) => {
|
|
1604
1378
|
$values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
|
|
1605
1379
|
}, []);
|
|
1606
|
-
const setFieldValue =
|
|
1607
|
-
(path, value,
|
|
1380
|
+
const setFieldValue = useCallback14(
|
|
1381
|
+
(path, value, options2) => {
|
|
1608
1382
|
const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
|
|
1609
1383
|
$status.clearFieldDirty(path);
|
|
1610
1384
|
$status.setFieldTouched(path, true);
|
|
@@ -1619,7 +1393,7 @@ function useForm({
|
|
|
1619
1393
|
const validationResults = validateFieldValue(path, rules, payload.updatedValues);
|
|
1620
1394
|
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
1621
1395
|
} : null,
|
|
1622
|
-
|
|
1396
|
+
options2?.forceUpdate !== false && mode !== "controlled" ? () => setFieldKeys((keys) => ({
|
|
1623
1397
|
...keys,
|
|
1624
1398
|
[path]: (keys[path] || 0) + 1
|
|
1625
1399
|
})) : null
|
|
@@ -1628,7 +1402,7 @@ function useForm({
|
|
|
1628
1402
|
},
|
|
1629
1403
|
[onValuesChange, rules]
|
|
1630
1404
|
);
|
|
1631
|
-
const setValues =
|
|
1405
|
+
const setValues = useCallback14(
|
|
1632
1406
|
(values) => {
|
|
1633
1407
|
const previousValues = $values.refValues.current;
|
|
1634
1408
|
$values.setValues({ values, updateState: mode === "controlled" });
|
|
@@ -1644,12 +1418,12 @@ function useForm({
|
|
|
1644
1418
|
},
|
|
1645
1419
|
[onValuesChange, clearInputErrorOnChange]
|
|
1646
1420
|
);
|
|
1647
|
-
const validate =
|
|
1421
|
+
const validate = useCallback14(() => {
|
|
1648
1422
|
const results = validateValues(rules, $values.refValues.current);
|
|
1649
1423
|
$errors.setErrors(results.errors);
|
|
1650
1424
|
return results;
|
|
1651
1425
|
}, [rules]);
|
|
1652
|
-
const validateField =
|
|
1426
|
+
const validateField = useCallback14(
|
|
1653
1427
|
(path) => {
|
|
1654
1428
|
const results = validateFieldValue(path, rules, $values.refValues.current);
|
|
1655
1429
|
results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);
|
|
@@ -1661,7 +1435,7 @@ function useForm({
|
|
|
1661
1435
|
const onChange = getInputOnChange(
|
|
1662
1436
|
(value) => setFieldValue(path, value, { forceUpdate: false })
|
|
1663
1437
|
);
|
|
1664
|
-
const payload = { onChange };
|
|
1438
|
+
const payload = { onChange, "data-path": getDataPath(name, path) };
|
|
1665
1439
|
if (withError) {
|
|
1666
1440
|
payload.error = $errors.errorsState[path];
|
|
1667
1441
|
}
|
|
@@ -1705,15 +1479,19 @@ function useForm({
|
|
|
1705
1479
|
}
|
|
1706
1480
|
};
|
|
1707
1481
|
const getTransformedValues = (input) => transformValues(input || $values.refValues.current);
|
|
1708
|
-
const onReset =
|
|
1482
|
+
const onReset = useCallback14((event) => {
|
|
1709
1483
|
event.preventDefault();
|
|
1710
1484
|
reset();
|
|
1711
1485
|
}, []);
|
|
1712
|
-
const isValid =
|
|
1486
|
+
const isValid = useCallback14(
|
|
1713
1487
|
(path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,
|
|
1714
1488
|
[rules]
|
|
1715
1489
|
);
|
|
1716
1490
|
const key = (path) => `${formKey}-${path}-${fieldKeys[path] || 0}`;
|
|
1491
|
+
const getInputNode = useCallback14(
|
|
1492
|
+
(path) => document.querySelector(`[data-path="${getDataPath(name, path)}"]`),
|
|
1493
|
+
[]
|
|
1494
|
+
);
|
|
1717
1495
|
const form = {
|
|
1718
1496
|
watch: $watch.watch,
|
|
1719
1497
|
initialized: $values.initialized.current,
|
|
@@ -1747,25 +1525,26 @@ function useForm({
|
|
|
1747
1525
|
onReset,
|
|
1748
1526
|
isValid,
|
|
1749
1527
|
getTransformedValues,
|
|
1750
|
-
key
|
|
1528
|
+
key,
|
|
1529
|
+
getInputNode
|
|
1751
1530
|
};
|
|
1752
1531
|
useFormActions(name, form);
|
|
1753
1532
|
return form;
|
|
1754
1533
|
}
|
|
1755
1534
|
|
|
1756
1535
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
1757
|
-
import { useCallback as
|
|
1536
|
+
import { useCallback as useCallback15, useEffect as useEffect12, useState as useState9 } from "react";
|
|
1758
1537
|
import { Curve } from "libnoise-ts/module/modifier";
|
|
1759
1538
|
import { Tuple } from "libnoise-ts/util";
|
|
1760
1539
|
import { IconX } from "@tabler/icons-react";
|
|
1761
1540
|
import { randomId } from "@mantine/hooks";
|
|
1762
1541
|
import { NodeState } from "@awesome-flow/core/abstract";
|
|
1763
|
-
import { Fragment
|
|
1542
|
+
import { Fragment, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1764
1543
|
function NoiseCurveNode({ id, selected, data, type }) {
|
|
1765
|
-
const incoming =
|
|
1766
|
-
const updateNodeData =
|
|
1767
|
-
const updateComputedData =
|
|
1768
|
-
const [values, setValues] =
|
|
1544
|
+
const incoming = useIncomingComputedData5(id);
|
|
1545
|
+
const updateNodeData = useUpdateNodeData6();
|
|
1546
|
+
const updateComputedData = useUpdateNodeComputedData16();
|
|
1547
|
+
const [values, setValues] = useState9([]);
|
|
1769
1548
|
const form = useForm({
|
|
1770
1549
|
mode: "uncontrolled",
|
|
1771
1550
|
initialValues: {
|
|
@@ -1784,7 +1563,7 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1784
1563
|
}
|
|
1785
1564
|
}
|
|
1786
1565
|
},
|
|
1787
|
-
onValuesChange:
|
|
1566
|
+
onValuesChange: useCallback15((values2) => {
|
|
1788
1567
|
if (form.isValid()) {
|
|
1789
1568
|
const points = values2.points.map((v) => ({ input: v.input, output: v.output }));
|
|
1790
1569
|
setValues(points);
|
|
@@ -1793,11 +1572,11 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1793
1572
|
form.validate();
|
|
1794
1573
|
}, [])
|
|
1795
1574
|
});
|
|
1796
|
-
|
|
1575
|
+
useEffect12(() => {
|
|
1797
1576
|
const points = data.points?.length ? data.points.map((v) => ({ input: v.input, output: v.output, key: randomId() })) : [1, 2, 3, 4].map(() => ({ input: 0, output: 0, key: randomId() }));
|
|
1798
1577
|
form.initialize({ points });
|
|
1799
1578
|
}, []);
|
|
1800
|
-
|
|
1579
|
+
useEffect12(() => {
|
|
1801
1580
|
if (incoming?.length && values?.length >= 4) {
|
|
1802
1581
|
const module = new Curve(
|
|
1803
1582
|
incoming[0].module,
|
|
@@ -1806,9 +1585,9 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1806
1585
|
updateComputedData(id, { module });
|
|
1807
1586
|
}
|
|
1808
1587
|
}, [values, incoming]);
|
|
1809
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
|
|
1588
|
+
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ jsxs13(Group6, { mt: "xs", children: [
|
|
1589
|
+
/* @__PURE__ */ jsx16(
|
|
1590
|
+
NumberInput5,
|
|
1812
1591
|
{
|
|
1813
1592
|
size: "xs",
|
|
1814
1593
|
w: 100,
|
|
@@ -1818,8 +1597,8 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1818
1597
|
},
|
|
1819
1598
|
form.key(`points.${index}.input`)
|
|
1820
1599
|
),
|
|
1821
|
-
/* @__PURE__ */
|
|
1822
|
-
|
|
1600
|
+
/* @__PURE__ */ jsx16(
|
|
1601
|
+
NumberInput5,
|
|
1823
1602
|
{
|
|
1824
1603
|
size: "xs",
|
|
1825
1604
|
w: 100,
|
|
@@ -1829,22 +1608,22 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1829
1608
|
},
|
|
1830
1609
|
form.key(`points.${index}.output`)
|
|
1831
1610
|
),
|
|
1832
|
-
data.state === NodeState.edit && values.length > 4 && /* @__PURE__ */
|
|
1611
|
+
data.state === NodeState.edit && values.length > 4 && /* @__PURE__ */ jsx16(
|
|
1833
1612
|
ActionIcon,
|
|
1834
1613
|
{
|
|
1835
1614
|
color: "red",
|
|
1836
1615
|
variant: "outline",
|
|
1837
1616
|
size: "sm",
|
|
1838
1617
|
onClick: () => form.removeListItem("points", index),
|
|
1839
|
-
children: /* @__PURE__ */
|
|
1618
|
+
children: /* @__PURE__ */ jsx16(IconX, { size: "1rem" })
|
|
1840
1619
|
}
|
|
1841
1620
|
)
|
|
1842
1621
|
] }, item.key));
|
|
1843
|
-
return /* @__PURE__ */
|
|
1622
|
+
return /* @__PURE__ */ jsxs13(NodeContainer16, { id, selected, type, data, children: [
|
|
1844
1623
|
fields,
|
|
1845
|
-
data.state === NodeState.edit && /* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1624
|
+
data.state === NodeState.edit && /* @__PURE__ */ jsxs13(Fragment, { children: [
|
|
1625
|
+
/* @__PURE__ */ jsx16(Space, { h: 10 }),
|
|
1626
|
+
/* @__PURE__ */ jsx16(
|
|
1848
1627
|
Button,
|
|
1849
1628
|
{
|
|
1850
1629
|
variant: "outline",
|
|
@@ -1855,39 +1634,39 @@ function NoiseCurveNode({ id, selected, data, type }) {
|
|
|
1855
1634
|
}
|
|
1856
1635
|
)
|
|
1857
1636
|
] }),
|
|
1858
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ jsx16(NodeTrackConnections11, { handles: data.handles, nodeId: id, type: "target" })
|
|
1859
1638
|
] });
|
|
1860
1639
|
}
|
|
1861
1640
|
var noise_curve_node_default = NoiseCurveNode;
|
|
1862
1641
|
|
|
1863
1642
|
// src/nodes/modifiers/noise-exponent-node.tsx
|
|
1864
|
-
import { NodeContainer as
|
|
1865
|
-
import { useEffect as
|
|
1866
|
-
import { Group as
|
|
1643
|
+
import { NodeContainer as NodeContainer17, NodeTrackConnections as NodeTrackConnections12 } from "@awesome-flow/core/layout";
|
|
1644
|
+
import { useEffect as useEffect13, useState as useState10 } from "react";
|
|
1645
|
+
import { Group as Group7, NumberInput as NumberInput6, Stack as Stack5 } from "@mantine/core";
|
|
1867
1646
|
import {
|
|
1868
|
-
useIncomingComputedData as
|
|
1869
|
-
useUpdateNodeComputedData as
|
|
1870
|
-
useUpdateNodeData as
|
|
1647
|
+
useIncomingComputedData as useIncomingComputedData6,
|
|
1648
|
+
useUpdateNodeComputedData as useUpdateNodeComputedData17,
|
|
1649
|
+
useUpdateNodeData as useUpdateNodeData7
|
|
1871
1650
|
} from "@awesome-flow/core/hooks";
|
|
1872
1651
|
import { Exponent } from "libnoise-ts/module/modifier";
|
|
1873
|
-
import { jsx as
|
|
1652
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1874
1653
|
function NoiseExponentNode({ id, selected, data, type }) {
|
|
1875
|
-
const [exponent, setExponent] =
|
|
1876
|
-
const incoming =
|
|
1877
|
-
const updateNodeData =
|
|
1878
|
-
const updateComputedData =
|
|
1879
|
-
|
|
1654
|
+
const [exponent, setExponent] = useState10(data.exponent);
|
|
1655
|
+
const incoming = useIncomingComputedData6(id);
|
|
1656
|
+
const updateNodeData = useUpdateNodeData7();
|
|
1657
|
+
const updateComputedData = useUpdateNodeComputedData17();
|
|
1658
|
+
useEffect13(() => {
|
|
1880
1659
|
if (incoming?.length > 0) {
|
|
1881
1660
|
const module = new Exponent(incoming[0].module, exponent);
|
|
1882
1661
|
updateComputedData(id, { module });
|
|
1883
1662
|
}
|
|
1884
1663
|
updateNodeData(id, { exponent });
|
|
1885
1664
|
}, [incoming, exponent]);
|
|
1886
|
-
return /* @__PURE__ */
|
|
1887
|
-
/* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsxs14(NodeContainer17, { id, selected, data, type, children: [
|
|
1666
|
+
/* @__PURE__ */ jsx17(Stack5, { children: /* @__PURE__ */ jsxs14(Group7, { children: [
|
|
1888
1667
|
"Exponent:",
|
|
1889
|
-
/* @__PURE__ */
|
|
1890
|
-
|
|
1668
|
+
/* @__PURE__ */ jsx17(
|
|
1669
|
+
NumberInput6,
|
|
1891
1670
|
{
|
|
1892
1671
|
size: "xs",
|
|
1893
1672
|
value: exponent,
|
|
@@ -1896,38 +1675,38 @@ function NoiseExponentNode({ id, selected, data, type }) {
|
|
|
1896
1675
|
}
|
|
1897
1676
|
)
|
|
1898
1677
|
] }) }),
|
|
1899
|
-
/* @__PURE__ */
|
|
1678
|
+
/* @__PURE__ */ jsx17(NodeTrackConnections12, { handles: data.handles, nodeId: id, type: "target" })
|
|
1900
1679
|
] });
|
|
1901
1680
|
}
|
|
1902
1681
|
var noise_exponent_node_default = NoiseExponentNode;
|
|
1903
1682
|
|
|
1904
1683
|
// src/nodes/modifiers/noise-invert-node.tsx
|
|
1905
|
-
import { NodeContainer as
|
|
1906
|
-
import { useEffect as
|
|
1907
|
-
import { useIncomingComputedData as
|
|
1684
|
+
import { NodeContainer as NodeContainer18, NodeTrackConnections as NodeTrackConnections13 } from "@awesome-flow/core/layout";
|
|
1685
|
+
import { useEffect as useEffect14 } from "react";
|
|
1686
|
+
import { useIncomingComputedData as useIncomingComputedData7, useUpdateNodeComputedData as useUpdateNodeComputedData18 } from "@awesome-flow/core/hooks";
|
|
1908
1687
|
import { Invert } from "libnoise-ts/module/modifier";
|
|
1909
|
-
import { jsx as
|
|
1688
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1910
1689
|
function NoiseInvertNode({ id, selected, data, type }) {
|
|
1911
|
-
const incoming =
|
|
1912
|
-
const updateComputedData =
|
|
1913
|
-
|
|
1690
|
+
const incoming = useIncomingComputedData7(id);
|
|
1691
|
+
const updateComputedData = useUpdateNodeComputedData18();
|
|
1692
|
+
useEffect14(() => {
|
|
1914
1693
|
if (incoming?.length > 0) {
|
|
1915
1694
|
const module = new Invert(incoming[0].module);
|
|
1916
1695
|
updateComputedData(id, { module });
|
|
1917
1696
|
}
|
|
1918
1697
|
}, [incoming]);
|
|
1919
|
-
return /* @__PURE__ */
|
|
1698
|
+
return /* @__PURE__ */ jsx18(NodeContainer18, { id, selected, data, type, children: /* @__PURE__ */ jsx18(NodeTrackConnections13, { handles: data.handles, nodeId: id, type: "target" }) });
|
|
1920
1699
|
}
|
|
1921
1700
|
var noise_invert_node_default = NoiseInvertNode;
|
|
1922
1701
|
|
|
1923
1702
|
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
1924
|
-
import { NodeContainer as
|
|
1925
|
-
import { useEffect as
|
|
1926
|
-
import { Group as
|
|
1703
|
+
import { NodeContainer as NodeContainer19, NodeTrackConnections as NodeTrackConnections14 } from "@awesome-flow/core/layout";
|
|
1704
|
+
import { useEffect as useEffect15, useState as useState11 } from "react";
|
|
1705
|
+
import { Group as Group8, NumberInput as NumberInput7, Stack as Stack6 } from "@mantine/core";
|
|
1927
1706
|
import {
|
|
1928
|
-
useIncomingComputedData as
|
|
1929
|
-
useUpdateNodeComputedData as
|
|
1930
|
-
useUpdateNodeData as
|
|
1707
|
+
useIncomingComputedData as useIncomingComputedData8,
|
|
1708
|
+
useUpdateNodeComputedData as useUpdateNodeComputedData19,
|
|
1709
|
+
useUpdateNodeData as useUpdateNodeData8
|
|
1931
1710
|
} from "@awesome-flow/core/hooks";
|
|
1932
1711
|
|
|
1933
1712
|
// src/modules/normalize-noise-module.ts
|
|
@@ -1947,14 +1726,14 @@ function normalize(value, min, max) {
|
|
|
1947
1726
|
}
|
|
1948
1727
|
|
|
1949
1728
|
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
1950
|
-
import { jsx as
|
|
1729
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1951
1730
|
function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
1952
|
-
const [intervalStart, setIntervalStart] =
|
|
1953
|
-
const [intervalEnd, setIntervalEnd] =
|
|
1954
|
-
const incoming =
|
|
1955
|
-
const updateNodeData =
|
|
1956
|
-
const updateComputedData =
|
|
1957
|
-
|
|
1731
|
+
const [intervalStart, setIntervalStart] = useState11(data.intervalStart);
|
|
1732
|
+
const [intervalEnd, setIntervalEnd] = useState11(data.intervalEnd);
|
|
1733
|
+
const incoming = useIncomingComputedData8(id);
|
|
1734
|
+
const updateNodeData = useUpdateNodeData8();
|
|
1735
|
+
const updateComputedData = useUpdateNodeComputedData19();
|
|
1736
|
+
useEffect15(() => {
|
|
1958
1737
|
if (incoming?.length) {
|
|
1959
1738
|
const source = incoming[0].module;
|
|
1960
1739
|
const module = new NormalizeNoiseModule(source, intervalStart, intervalEnd);
|
|
@@ -1962,10 +1741,10 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
1962
1741
|
}
|
|
1963
1742
|
updateNodeData(id, { intervalStart, intervalEnd });
|
|
1964
1743
|
}, [incoming, intervalStart, intervalEnd]);
|
|
1965
|
-
return /* @__PURE__ */
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
|
|
1744
|
+
return /* @__PURE__ */ jsxs15(NodeContainer19, { id, selected, data, type, children: [
|
|
1745
|
+
/* @__PURE__ */ jsx19(Stack6, { children: /* @__PURE__ */ jsxs15(Group8, { children: [
|
|
1746
|
+
/* @__PURE__ */ jsx19(
|
|
1747
|
+
NumberInput7,
|
|
1969
1748
|
{
|
|
1970
1749
|
size: "xs",
|
|
1971
1750
|
w: 100,
|
|
@@ -1973,8 +1752,8 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
1973
1752
|
onChange: (e) => setIntervalStart(Number(e))
|
|
1974
1753
|
}
|
|
1975
1754
|
),
|
|
1976
|
-
/* @__PURE__ */
|
|
1977
|
-
|
|
1755
|
+
/* @__PURE__ */ jsx19(
|
|
1756
|
+
NumberInput7,
|
|
1978
1757
|
{
|
|
1979
1758
|
size: "xs",
|
|
1980
1759
|
w: 100,
|
|
@@ -1983,41 +1762,41 @@ function NoiseNormalizeNode({ id, selected, data, type }) {
|
|
|
1983
1762
|
}
|
|
1984
1763
|
)
|
|
1985
1764
|
] }) }),
|
|
1986
|
-
/* @__PURE__ */
|
|
1765
|
+
/* @__PURE__ */ jsx19(NodeTrackConnections14, { handles: data.handles, nodeId: id, type: "target" })
|
|
1987
1766
|
] });
|
|
1988
1767
|
}
|
|
1989
1768
|
var noise_normalize_node_default = NoiseNormalizeNode;
|
|
1990
1769
|
|
|
1991
1770
|
// src/nodes/modifiers/noise-scale-bias-node.tsx
|
|
1992
|
-
import { NodeContainer as
|
|
1993
|
-
import { useEffect as
|
|
1994
|
-
import { Group as
|
|
1771
|
+
import { NodeContainer as NodeContainer20, NodeTrackConnections as NodeTrackConnections15 } from "@awesome-flow/core/layout";
|
|
1772
|
+
import { useEffect as useEffect16, useState as useState12 } from "react";
|
|
1773
|
+
import { Group as Group9, NumberInput as NumberInput8, Stack as Stack7 } from "@mantine/core";
|
|
1995
1774
|
import {
|
|
1996
|
-
useIncomingComputedData as
|
|
1997
|
-
useUpdateNodeComputedData as
|
|
1998
|
-
useUpdateNodeData as
|
|
1775
|
+
useIncomingComputedData as useIncomingComputedData9,
|
|
1776
|
+
useUpdateNodeComputedData as useUpdateNodeComputedData20,
|
|
1777
|
+
useUpdateNodeData as useUpdateNodeData9
|
|
1999
1778
|
} from "@awesome-flow/core/hooks";
|
|
2000
1779
|
import { ScaleBias } from "libnoise-ts/module/modifier";
|
|
2001
|
-
import { jsx as
|
|
1780
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2002
1781
|
function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
2003
|
-
const [scale, setScale] =
|
|
2004
|
-
const [bias, setBias] =
|
|
2005
|
-
const incoming =
|
|
2006
|
-
const updateNodeData =
|
|
2007
|
-
const updateComputedData =
|
|
2008
|
-
|
|
1782
|
+
const [scale, setScale] = useState12(data.scale);
|
|
1783
|
+
const [bias, setBias] = useState12(data.bias);
|
|
1784
|
+
const incoming = useIncomingComputedData9(id);
|
|
1785
|
+
const updateNodeData = useUpdateNodeData9();
|
|
1786
|
+
const updateComputedData = useUpdateNodeComputedData20();
|
|
1787
|
+
useEffect16(() => {
|
|
2009
1788
|
if (incoming?.length > 0) {
|
|
2010
1789
|
const module = new ScaleBias(incoming[0].module, scale, bias);
|
|
2011
1790
|
updateComputedData(id, { module });
|
|
2012
1791
|
}
|
|
2013
1792
|
updateNodeData(id, { scale, bias });
|
|
2014
1793
|
}, [incoming, scale, bias]);
|
|
2015
|
-
return /* @__PURE__ */
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ jsxs16(NodeContainer20, { id, selected, data, type, children: [
|
|
1795
|
+
/* @__PURE__ */ jsxs16(Stack7, { children: [
|
|
1796
|
+
/* @__PURE__ */ jsxs16(Group9, { children: [
|
|
2018
1797
|
"Scale:",
|
|
2019
|
-
/* @__PURE__ */
|
|
2020
|
-
|
|
1798
|
+
/* @__PURE__ */ jsx20(
|
|
1799
|
+
NumberInput8,
|
|
2021
1800
|
{
|
|
2022
1801
|
size: "xs",
|
|
2023
1802
|
w: 100,
|
|
@@ -2027,10 +1806,10 @@ function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
|
2027
1806
|
}
|
|
2028
1807
|
)
|
|
2029
1808
|
] }),
|
|
2030
|
-
/* @__PURE__ */
|
|
1809
|
+
/* @__PURE__ */ jsxs16(Group9, { children: [
|
|
2031
1810
|
"Bias:",
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
|
|
1811
|
+
/* @__PURE__ */ jsx20(
|
|
1812
|
+
NumberInput8,
|
|
2034
1813
|
{
|
|
2035
1814
|
size: "xs",
|
|
2036
1815
|
w: 100,
|
|
@@ -2041,30 +1820,30 @@ function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
|
2041
1820
|
)
|
|
2042
1821
|
] })
|
|
2043
1822
|
] }),
|
|
2044
|
-
/* @__PURE__ */
|
|
1823
|
+
/* @__PURE__ */ jsx20(NodeTrackConnections15, { handles: data.handles, nodeId: id, type: "target" })
|
|
2045
1824
|
] });
|
|
2046
1825
|
}
|
|
2047
1826
|
var noise_scale_bias_node_default = NoiseScaleBiasNode;
|
|
2048
1827
|
|
|
2049
1828
|
// src/nodes/modifiers/noise-terrace-node.tsx
|
|
2050
|
-
import { NodeContainer as
|
|
2051
|
-
import { ActionIcon as ActionIcon2, Button as Button2, Group as
|
|
1829
|
+
import { NodeContainer as NodeContainer21, NodeTrackConnections as NodeTrackConnections16 } from "@awesome-flow/core/layout";
|
|
1830
|
+
import { ActionIcon as ActionIcon2, Button as Button2, Group as Group10, NumberInput as NumberInput9, Space as Space2 } from "@mantine/core";
|
|
2052
1831
|
import {
|
|
2053
|
-
useIncomingComputedData as
|
|
2054
|
-
useUpdateNodeComputedData as
|
|
2055
|
-
useUpdateNodeData as
|
|
1832
|
+
useIncomingComputedData as useIncomingComputedData10,
|
|
1833
|
+
useUpdateNodeComputedData as useUpdateNodeComputedData21,
|
|
1834
|
+
useUpdateNodeData as useUpdateNodeData10
|
|
2056
1835
|
} from "@awesome-flow/core/hooks";
|
|
2057
|
-
import { useCallback as
|
|
1836
|
+
import { useCallback as useCallback16, useEffect as useEffect17, useState as useState13 } from "react";
|
|
2058
1837
|
import { Terrace } from "libnoise-ts/module/modifier";
|
|
2059
1838
|
import { IconX as IconX2 } from "@tabler/icons-react";
|
|
2060
1839
|
import { randomId as randomId2 } from "@mantine/hooks";
|
|
2061
1840
|
import { NodeState as NodeState2 } from "@awesome-flow/core/abstract";
|
|
2062
|
-
import { Fragment as
|
|
1841
|
+
import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2063
1842
|
function NoiseTerraceNode({ id, selected, data, type }) {
|
|
2064
|
-
const incoming =
|
|
2065
|
-
const updateNodeData =
|
|
2066
|
-
const updateComputedData =
|
|
2067
|
-
const [values, setValues] =
|
|
1843
|
+
const incoming = useIncomingComputedData10(id);
|
|
1844
|
+
const updateNodeData = useUpdateNodeData10();
|
|
1845
|
+
const updateComputedData = useUpdateNodeComputedData21();
|
|
1846
|
+
const [values, setValues] = useState13([]);
|
|
2068
1847
|
const form = useForm({
|
|
2069
1848
|
mode: "uncontrolled",
|
|
2070
1849
|
initialValues: {
|
|
@@ -2072,7 +1851,7 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
2072
1851
|
},
|
|
2073
1852
|
validateInputOnChange: [`points.${FORM_INDEX}.input`],
|
|
2074
1853
|
clearInputErrorOnChange: true,
|
|
2075
|
-
onValuesChange:
|
|
1854
|
+
onValuesChange: useCallback16((values2) => {
|
|
2076
1855
|
if (form.isValid()) {
|
|
2077
1856
|
const points = values2.points.map((v) => v.value);
|
|
2078
1857
|
setValues(points);
|
|
@@ -2081,19 +1860,19 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
2081
1860
|
form.validate();
|
|
2082
1861
|
}, [])
|
|
2083
1862
|
});
|
|
2084
|
-
|
|
1863
|
+
useEffect17(() => {
|
|
2085
1864
|
const points = data.points?.length ? data.points.map((v) => ({ value: v, key: randomId2() })) : [1, 2].map(() => ({ value: 0, key: randomId2() }));
|
|
2086
1865
|
form.initialize({ points });
|
|
2087
1866
|
}, []);
|
|
2088
|
-
|
|
1867
|
+
useEffect17(() => {
|
|
2089
1868
|
if (incoming?.length && values?.length >= 2) {
|
|
2090
1869
|
const module = new Terrace(incoming[0].module, values);
|
|
2091
1870
|
updateComputedData(id, { module });
|
|
2092
1871
|
}
|
|
2093
1872
|
}, [values, incoming]);
|
|
2094
|
-
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2096
|
-
|
|
1873
|
+
const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ jsxs17(Group10, { mt: "xs", children: [
|
|
1874
|
+
/* @__PURE__ */ jsx21(
|
|
1875
|
+
NumberInput9,
|
|
2097
1876
|
{
|
|
2098
1877
|
size: "xs",
|
|
2099
1878
|
placeholder: "Input Value",
|
|
@@ -2102,22 +1881,22 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
2102
1881
|
},
|
|
2103
1882
|
form.key(`points.${index}.value`)
|
|
2104
1883
|
),
|
|
2105
|
-
data.state === NodeState2.edit && values.length > 2 && /* @__PURE__ */
|
|
1884
|
+
data.state === NodeState2.edit && values.length > 2 && /* @__PURE__ */ jsx21(
|
|
2106
1885
|
ActionIcon2,
|
|
2107
1886
|
{
|
|
2108
1887
|
color: "red",
|
|
2109
1888
|
variant: "outline",
|
|
2110
1889
|
size: "sm",
|
|
2111
1890
|
onClick: () => form.removeListItem("points", index),
|
|
2112
|
-
children: /* @__PURE__ */
|
|
1891
|
+
children: /* @__PURE__ */ jsx21(IconX2, { size: "1rem" })
|
|
2113
1892
|
}
|
|
2114
1893
|
)
|
|
2115
1894
|
] }, item.key));
|
|
2116
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ jsxs17(NodeContainer21, { id, selected, type, data, children: [
|
|
2117
1896
|
fields,
|
|
2118
|
-
data.state === NodeState2.edit && /* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
/* @__PURE__ */
|
|
1897
|
+
data.state === NodeState2.edit && /* @__PURE__ */ jsxs17(Fragment2, { children: [
|
|
1898
|
+
/* @__PURE__ */ jsx21(Space2, { h: 10 }),
|
|
1899
|
+
/* @__PURE__ */ jsx21(
|
|
2121
1900
|
Button2,
|
|
2122
1901
|
{
|
|
2123
1902
|
variant: "outline",
|
|
@@ -2128,94 +1907,27 @@ function NoiseTerraceNode({ id, selected, data, type }) {
|
|
|
2128
1907
|
}
|
|
2129
1908
|
)
|
|
2130
1909
|
] }),
|
|
2131
|
-
/* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ jsx21(NodeTrackConnections16, { handles: data.handles, nodeId: id, type: "target" })
|
|
2132
1911
|
] });
|
|
2133
1912
|
}
|
|
2134
1913
|
var noise_terrace_node_default = NoiseTerraceNode;
|
|
2135
1914
|
|
|
2136
|
-
// src/nodes/modifiers/variable-combine-node.tsx
|
|
2137
|
-
import { NodeCombobox as NodeCombobox3, NodeContainer as NodeContainer24, NodeTrackConnections as NodeTrackConnections18 } from "@awesome-flow/core/layout";
|
|
2138
|
-
import { useCallback as useCallback20, useEffect as useEffect20, useState as useState17 } from "react";
|
|
2139
|
-
import { useIncomingNodeData as useIncomingNodeData3, useUpdateNodeData as useUpdateNodeData14 } from "@awesome-flow/core/hooks";
|
|
2140
|
-
import {
|
|
2141
|
-
IconAsterisk as IconAsterisk2,
|
|
2142
|
-
IconChevronLeft as IconChevronLeft2,
|
|
2143
|
-
IconChevronRight as IconChevronRight2,
|
|
2144
|
-
IconChevronUp as IconChevronUp2,
|
|
2145
|
-
IconDivide,
|
|
2146
|
-
IconPlus as IconPlus2
|
|
2147
|
-
} from "@tabler/icons-react";
|
|
2148
|
-
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2149
|
-
var options2 = {
|
|
2150
|
-
add: /* @__PURE__ */ jsx27(IconPlus2, {}),
|
|
2151
|
-
divide: /* @__PURE__ */ jsx27(IconDivide, {}),
|
|
2152
|
-
min: /* @__PURE__ */ jsx27(IconChevronLeft2, {}),
|
|
2153
|
-
max: /* @__PURE__ */ jsx27(IconChevronRight2, {}),
|
|
2154
|
-
multiply: /* @__PURE__ */ jsx27(IconAsterisk2, {}),
|
|
2155
|
-
power: /* @__PURE__ */ jsx27(IconChevronUp2, {})
|
|
2156
|
-
};
|
|
2157
|
-
function VariableCombineNode({
|
|
2158
|
-
id,
|
|
2159
|
-
selected,
|
|
2160
|
-
data,
|
|
2161
|
-
type
|
|
2162
|
-
}) {
|
|
2163
|
-
const [operation, setOperation] = useState17(data.operation);
|
|
2164
|
-
const [value, setValue] = useState17(data.value);
|
|
2165
|
-
const updateNodeData = useUpdateNodeData14();
|
|
2166
|
-
const incoming = useIncomingNodeData3(id);
|
|
2167
|
-
useEffect20(() => {
|
|
2168
|
-
if (incoming?.length > 1) {
|
|
2169
|
-
const result = getOperationResult(operation, incoming[0].value, incoming[1].value);
|
|
2170
|
-
setValue(result);
|
|
2171
|
-
updateNodeData(id, { value: result });
|
|
2172
|
-
}
|
|
2173
|
-
}, [operation, incoming]);
|
|
2174
|
-
const onChange = useCallback20((op) => {
|
|
2175
|
-
updateNodeData(id, { operation: op });
|
|
2176
|
-
setOperation(op);
|
|
2177
|
-
}, []);
|
|
2178
|
-
return /* @__PURE__ */ jsxs21(NodeContainer24, { id, selected, data, type, children: [
|
|
2179
|
-
/* @__PURE__ */ jsx27(NodeCombobox3, { options: options2, selected: operation, onChange }),
|
|
2180
|
-
/* @__PURE__ */ jsx27(node_value_input_default, { value, onChange: () => {
|
|
2181
|
-
}, disabled: true }),
|
|
2182
|
-
/* @__PURE__ */ jsx27(NodeTrackConnections18, { handles: data.handles, nodeId: id, type: "target" })
|
|
2183
|
-
] });
|
|
2184
|
-
}
|
|
2185
|
-
function getOperationResult(operation, value1, value2) {
|
|
2186
|
-
switch (operation) {
|
|
2187
|
-
case "add" /* add */:
|
|
2188
|
-
return Number(value1) + Number(value2);
|
|
2189
|
-
case "divide" /* divide */:
|
|
2190
|
-
return Number(value1) / (Number(value2) || 1);
|
|
2191
|
-
case "max" /* max */:
|
|
2192
|
-
return Number(value1) > Number(value2) ? value1 : value2;
|
|
2193
|
-
case "min" /* min */:
|
|
2194
|
-
return Number(value1) < Number(value2) ? value1 : value2;
|
|
2195
|
-
case "multiply" /* multiply */:
|
|
2196
|
-
return Number(value1) * Number(value2);
|
|
2197
|
-
case "power" /* power */:
|
|
2198
|
-
return Number(value1) ** Number(value2);
|
|
2199
|
-
}
|
|
2200
|
-
}
|
|
2201
|
-
var variable_combine_node_default = VariableCombineNode;
|
|
2202
|
-
|
|
2203
1915
|
// src/nodes/output/noise-logger-node.tsx
|
|
2204
|
-
import { NodeContainer as
|
|
2205
|
-
import { useMemo as
|
|
2206
|
-
import { Divider, Stack as
|
|
2207
|
-
import { useIncomingComputedData as
|
|
2208
|
-
import { jsx as
|
|
1916
|
+
import { NodeContainer as NodeContainer22, NodeTrackConnections as NodeTrackConnections17 } from "@awesome-flow/core/layout";
|
|
1917
|
+
import { useMemo as useMemo10 } from "react";
|
|
1918
|
+
import { Divider, Stack as Stack8, Text } from "@mantine/core";
|
|
1919
|
+
import { useIncomingComputedData as useIncomingComputedData11 } from "@awesome-flow/core/hooks";
|
|
1920
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2209
1921
|
function NoiseLoggerNode({ id, selected, data, type }) {
|
|
2210
|
-
const incoming =
|
|
2211
|
-
const noise =
|
|
2212
|
-
return /* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
1922
|
+
const incoming = useIncomingComputedData11(id);
|
|
1923
|
+
const noise = useMemo10(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
1924
|
+
return /* @__PURE__ */ jsxs18(NodeContainer22, { id, selected, data, type, children: [
|
|
1925
|
+
/* @__PURE__ */ jsxs18(Text, { children: [
|
|
2214
1926
|
"Size: ",
|
|
2215
1927
|
noise?.length || 0
|
|
2216
1928
|
] }),
|
|
2217
|
-
/* @__PURE__ */
|
|
2218
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ jsx22(Divider, { h: 5 }),
|
|
1930
|
+
/* @__PURE__ */ jsx22(Stack8, { children: noise?.map((v, i) => /* @__PURE__ */ jsxs18(Text, { children: [
|
|
2219
1931
|
v.position?.x,
|
|
2220
1932
|
":",
|
|
2221
1933
|
v.position?.y,
|
|
@@ -2224,92 +1936,31 @@ function NoiseLoggerNode({ id, selected, data, type }) {
|
|
|
2224
1936
|
": ",
|
|
2225
1937
|
v.value
|
|
2226
1938
|
] }, i)) }),
|
|
2227
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ jsx22(NodeTrackConnections17, { handles: data.handles, nodeId: id, type: "target" })
|
|
2228
1940
|
] });
|
|
2229
1941
|
}
|
|
2230
1942
|
var noise_logger_node_default = NoiseLoggerNode;
|
|
2231
1943
|
|
|
2232
1944
|
// src/nodes/output/noise-output-node.tsx
|
|
2233
|
-
import { NodeContainer as
|
|
2234
|
-
import {
|
|
2235
|
-
import {
|
|
2236
|
-
import {
|
|
2237
|
-
import {
|
|
2238
|
-
function NoiseOutputNode({ id, selected, data, type }) {
|
|
2239
|
-
const [generating, setGenerating] = useState18(false);
|
|
2240
|
-
const updateComputedData = useUpdateNodeComputedData21();
|
|
2241
|
-
const incomingModules = useIncomingComputedData11(id, 8 /* module */);
|
|
2242
|
-
const incomingPositions = useIncomingComputedData11(
|
|
2243
|
-
id,
|
|
2244
|
-
4 /* position */
|
|
2245
|
-
);
|
|
2246
|
-
useEffect21(() => {
|
|
2247
|
-
if (incomingPositions?.length && incomingModules?.length) {
|
|
2248
|
-
const { module } = incomingModules[0];
|
|
2249
|
-
if (module) {
|
|
2250
|
-
setGenerating(true);
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
|
-
}, [incomingModules, incomingPositions]);
|
|
2254
|
-
useEffect21(() => {
|
|
2255
|
-
if (incomingPositions?.length && incomingModules?.length) {
|
|
2256
|
-
const { module } = incomingModules[0];
|
|
2257
|
-
if (module && generating) {
|
|
2258
|
-
const noise = [];
|
|
2259
|
-
for (const input of incomingPositions) {
|
|
2260
|
-
for (const position of input.positions) {
|
|
2261
|
-
const value = module.getValue(position.x, position.y, position.z);
|
|
2262
|
-
noise.push({
|
|
2263
|
-
position,
|
|
2264
|
-
value
|
|
2265
|
-
});
|
|
2266
|
-
}
|
|
2267
|
-
}
|
|
2268
|
-
console.log("SET COMPUTED DATA");
|
|
2269
|
-
updateComputedData(id, { noise, module });
|
|
2270
|
-
setGenerating(false);
|
|
2271
|
-
}
|
|
2272
|
-
}
|
|
2273
|
-
}, [generating]);
|
|
2274
|
-
return /* @__PURE__ */ jsxs23(NodeContainer26, { id, selected, data, type, children: [
|
|
2275
|
-
/* @__PURE__ */ jsxs23(Box, { pos: "relative", children: [
|
|
2276
|
-
/* @__PURE__ */ jsx29(
|
|
2277
|
-
LoadingOverlay,
|
|
2278
|
-
{
|
|
2279
|
-
visible: generating,
|
|
2280
|
-
zIndex: 1e3,
|
|
2281
|
-
overlayProps: { radius: "sm", blur: 2 }
|
|
2282
|
-
}
|
|
2283
|
-
),
|
|
2284
|
-
/* @__PURE__ */ jsxs23(Stack11, { children: [
|
|
2285
|
-
/* @__PURE__ */ jsxs23(Group12, { children: [
|
|
2286
|
-
"Position Inputs: ",
|
|
2287
|
-
incomingPositions?.length
|
|
2288
|
-
] }),
|
|
2289
|
-
/* @__PURE__ */ jsxs23(Group12, { children: [
|
|
2290
|
-
"Module Inputs: ",
|
|
2291
|
-
incomingModules?.length
|
|
2292
|
-
] })
|
|
2293
|
-
] })
|
|
2294
|
-
] }),
|
|
2295
|
-
/* @__PURE__ */ jsx29(NodeTrackConnections20, { handles: data.handles, nodeId: id, type: "target" })
|
|
2296
|
-
] });
|
|
2297
|
-
}
|
|
2298
|
-
var noise_output_node_default = NoiseOutputNode;
|
|
1945
|
+
import { NodeContainer as NodeContainer32, NodeTrackConnections as NodeTrackConnections27 } from "@awesome-flow/core/layout";
|
|
1946
|
+
import { useCallback as useCallback21, useState as useState20 } from "react";
|
|
1947
|
+
import { useUpdateNodeComputedData as useUpdateNodeComputedData30 } from "@awesome-flow/core/hooks";
|
|
1948
|
+
import { HandlesIncomingDataStatus as HandlesIncomingDataStatus4 } from "@awesome-flow/core/components";
|
|
1949
|
+
import { Text as Text3 } from "@mantine/core";
|
|
2299
1950
|
|
|
2300
1951
|
// src/nodes/output/noise-raw-texture-node.tsx
|
|
2301
|
-
import { NodeContainer as
|
|
2302
|
-
import { useEffect as
|
|
1952
|
+
import { NodeContainer as NodeContainer23, NodeTrackConnections as NodeTrackConnections18 } from "@awesome-flow/core/layout";
|
|
1953
|
+
import { useEffect as useEffect18, useMemo as useMemo11, useState as useState14 } from "react";
|
|
2303
1954
|
import { useIncomingComputedData as useIncomingComputedData12, useUpdateNodeComputedData as useUpdateNodeComputedData22 } from "@awesome-flow/core/hooks";
|
|
2304
|
-
import { Group as
|
|
2305
|
-
import { jsx as
|
|
1955
|
+
import { Group as Group11, Stack as Stack9 } from "@mantine/core";
|
|
1956
|
+
import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2306
1957
|
function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
2307
1958
|
const updateComputedData = useUpdateNodeComputedData22();
|
|
2308
|
-
const [dataLength, setDataLength] =
|
|
2309
|
-
const [resolution, setResolution] =
|
|
1959
|
+
const [dataLength, setDataLength] = useState14(0);
|
|
1960
|
+
const [resolution, setResolution] = useState14(0);
|
|
2310
1961
|
const incoming = useIncomingComputedData12(id);
|
|
2311
|
-
const noise =
|
|
2312
|
-
|
|
1962
|
+
const noise = useMemo11(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
1963
|
+
useEffect18(() => {
|
|
2313
1964
|
if (noise?.length) {
|
|
2314
1965
|
const size = Math.ceil(Math.sqrt(noise.length));
|
|
2315
1966
|
const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
|
|
@@ -2320,19 +1971,19 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
2320
1971
|
updateComputedData(id, { textureData: dataArray, textureResolution: size });
|
|
2321
1972
|
}
|
|
2322
1973
|
}, [noise]);
|
|
2323
|
-
return /* @__PURE__ */
|
|
2324
|
-
/* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */
|
|
1974
|
+
return /* @__PURE__ */ jsxs19(NodeContainer23, { id, selected, data, type, children: [
|
|
1975
|
+
/* @__PURE__ */ jsxs19(Stack9, { children: [
|
|
1976
|
+
/* @__PURE__ */ jsxs19(Group11, { children: [
|
|
2326
1977
|
"Resolution: ",
|
|
2327
1978
|
resolution,
|
|
2328
1979
|
"x",
|
|
2329
1980
|
resolution
|
|
2330
1981
|
] }),
|
|
2331
|
-
/* @__PURE__ */
|
|
1982
|
+
/* @__PURE__ */ jsxs19(Group11, { children: [
|
|
2332
1983
|
"Input Length: ",
|
|
2333
1984
|
noise?.length || 0
|
|
2334
1985
|
] }),
|
|
2335
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ jsxs19(Group11, { children: [
|
|
2336
1987
|
"Output Length (",
|
|
2337
1988
|
resolution,
|
|
2338
1989
|
"*",
|
|
@@ -2341,104 +1992,122 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
2341
1992
|
dataLength
|
|
2342
1993
|
] })
|
|
2343
1994
|
] }),
|
|
2344
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ jsx23(NodeTrackConnections18, { handles: data.handles, nodeId: id, type: "target" })
|
|
2345
1996
|
] });
|
|
2346
1997
|
}
|
|
2347
1998
|
var noise_raw_texture_node_default = NoiseRawTextureNode;
|
|
2348
1999
|
|
|
2349
2000
|
// src/nodes/output/positions-logger-node.tsx
|
|
2350
|
-
import { NodeContainer as
|
|
2351
|
-
import { useMemo as
|
|
2352
|
-
import { Divider as Divider2, Stack as
|
|
2001
|
+
import { NodeContainer as NodeContainer24, NodeTrackConnections as NodeTrackConnections19 } from "@awesome-flow/core/layout";
|
|
2002
|
+
import { useMemo as useMemo12 } from "react";
|
|
2003
|
+
import { Divider as Divider2, Stack as Stack10, Text as Text2 } from "@mantine/core";
|
|
2353
2004
|
import { useIncomingComputedData as useIncomingComputedData13 } from "@awesome-flow/core/hooks";
|
|
2354
|
-
import { jsx as
|
|
2005
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2355
2006
|
function PositionsLoggerNode({ id, selected, data, type }) {
|
|
2356
2007
|
const incoming = useIncomingComputedData13(id);
|
|
2357
|
-
const positions =
|
|
2008
|
+
const positions = useMemo12(() => {
|
|
2358
2009
|
return incoming?.map((p) => p.positions).flat();
|
|
2359
2010
|
}, [incoming]);
|
|
2360
|
-
return /* @__PURE__ */
|
|
2361
|
-
/* @__PURE__ */
|
|
2011
|
+
return /* @__PURE__ */ jsxs20(NodeContainer24, { id, selected, data, type, children: [
|
|
2012
|
+
/* @__PURE__ */ jsxs20(Text2, { children: [
|
|
2362
2013
|
"Size: ",
|
|
2363
2014
|
positions?.length || 0
|
|
2364
2015
|
] }),
|
|
2365
|
-
/* @__PURE__ */
|
|
2366
|
-
/* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ jsx24(Divider2, { h: 5 }),
|
|
2017
|
+
/* @__PURE__ */ jsx24(Stack10, { children: positions?.map((v, i) => /* @__PURE__ */ jsxs20(Text2, { children: [
|
|
2367
2018
|
v.x,
|
|
2368
2019
|
":",
|
|
2369
2020
|
v.y,
|
|
2370
2021
|
":",
|
|
2371
2022
|
v.z
|
|
2372
2023
|
] }, i)) }),
|
|
2373
|
-
/* @__PURE__ */
|
|
2024
|
+
/* @__PURE__ */ jsx24(NodeTrackConnections19, { handles: data.handles, nodeId: id, type: "target" })
|
|
2374
2025
|
] });
|
|
2375
2026
|
}
|
|
2376
2027
|
var positions_logger_node_default = PositionsLoggerNode;
|
|
2377
2028
|
|
|
2378
2029
|
// src/nodes/selectors/noise-blend-node.tsx
|
|
2379
|
-
import { NodeContainer as
|
|
2380
|
-
import {
|
|
2381
|
-
import {
|
|
2030
|
+
import { NodeContainer as NodeContainer25, NodeTrackConnections as NodeTrackConnections20 } from "@awesome-flow/core/layout";
|
|
2031
|
+
import { useCallback as useCallback17 } from "react";
|
|
2032
|
+
import { useUpdateNodeComputedData as useUpdateNodeComputedData23 } from "@awesome-flow/core/hooks";
|
|
2382
2033
|
import { Blend } from "libnoise-ts/module/selector";
|
|
2383
|
-
import {
|
|
2384
|
-
import { jsx as
|
|
2034
|
+
import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
|
|
2035
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2385
2036
|
function NoiseBlendNode({ id, selected, data, type }) {
|
|
2386
|
-
const incoming = useIncomingComputedData14(id);
|
|
2387
2037
|
const updateComputedData = useUpdateNodeComputedData23();
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
const
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2038
|
+
const onDataUpdated = useCallback17(
|
|
2039
|
+
(incomingData) => {
|
|
2040
|
+
const incomingSources = incomingData["source" /* source */];
|
|
2041
|
+
const incomingControl = incomingData["control" /* control */];
|
|
2042
|
+
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2043
|
+
const module = new Blend(
|
|
2044
|
+
incomingSources[0].module,
|
|
2045
|
+
incomingSources[1].module,
|
|
2046
|
+
incomingControl[0].module
|
|
2047
|
+
);
|
|
2048
|
+
updateComputedData(id, { module });
|
|
2049
|
+
}
|
|
2050
|
+
},
|
|
2051
|
+
[]
|
|
2052
|
+
);
|
|
2053
|
+
return /* @__PURE__ */ jsxs21(NodeContainer25, { id, selected, data, type, children: [
|
|
2054
|
+
/* @__PURE__ */ jsx25(
|
|
2055
|
+
HandlesIncomingDataStatus,
|
|
2056
|
+
{
|
|
2057
|
+
nodeId: id,
|
|
2058
|
+
handles: data.handles,
|
|
2059
|
+
handleKey: "dataId",
|
|
2060
|
+
onDataUpdated,
|
|
2061
|
+
type: "target",
|
|
2062
|
+
resetComputedData: true
|
|
2063
|
+
}
|
|
2064
|
+
),
|
|
2065
|
+
/* @__PURE__ */ jsx25(NodeTrackConnections20, { handles: data.handles, nodeId: id, type: "target" })
|
|
2400
2066
|
] });
|
|
2401
2067
|
}
|
|
2402
2068
|
var noise_blend_node_default = NoiseBlendNode;
|
|
2403
2069
|
|
|
2404
2070
|
// src/nodes/selectors/noise-select-node.tsx
|
|
2405
|
-
import { NodeContainer as
|
|
2406
|
-
import { useEffect as
|
|
2407
|
-
import {
|
|
2408
|
-
useIncomingComputedData as useIncomingComputedData15,
|
|
2409
|
-
useUpdateNodeComputedData as useUpdateNodeComputedData24,
|
|
2410
|
-
useUpdateNodeData as useUpdateNodeData15
|
|
2411
|
-
} from "@awesome-flow/core/hooks";
|
|
2071
|
+
import { NodeContainer as NodeContainer26, NodeTrackConnections as NodeTrackConnections21 } from "@awesome-flow/core/layout";
|
|
2072
|
+
import { useCallback as useCallback18, useEffect as useEffect19, useState as useState15 } from "react";
|
|
2073
|
+
import { useUpdateNodeComputedData as useUpdateNodeComputedData24, useUpdateNodeData as useUpdateNodeData11 } from "@awesome-flow/core/hooks";
|
|
2412
2074
|
import { Select } from "libnoise-ts/module/selector";
|
|
2413
|
-
import { Group as
|
|
2414
|
-
import {
|
|
2075
|
+
import { Group as Group12, NumberInput as NumberInput10, Stack as Stack11 } from "@mantine/core";
|
|
2076
|
+
import { HandlesIncomingDataStatus as HandlesIncomingDataStatus2 } from "@awesome-flow/core/components";
|
|
2077
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2415
2078
|
function NoiseSelectNode({ id, selected, data, type }) {
|
|
2416
|
-
const [edgeFalloff, setEdgeFalloff] =
|
|
2417
|
-
const [lowerBound, setLowerBound] =
|
|
2418
|
-
const [upperBound, setUpperBound] =
|
|
2419
|
-
const
|
|
2420
|
-
const updateNodeData = useUpdateNodeData15();
|
|
2079
|
+
const [edgeFalloff, setEdgeFalloff] = useState15(data.edgeFalloff);
|
|
2080
|
+
const [lowerBound, setLowerBound] = useState15(data.lowerBound);
|
|
2081
|
+
const [upperBound, setUpperBound] = useState15(data.upperBound);
|
|
2082
|
+
const updateNodeData = useUpdateNodeData11();
|
|
2421
2083
|
const updateComputedData = useUpdateNodeComputedData24();
|
|
2422
|
-
|
|
2423
|
-
if (incoming?.length > 2) {
|
|
2424
|
-
const module = new Select(
|
|
2425
|
-
incoming[0].module,
|
|
2426
|
-
incoming[1].module,
|
|
2427
|
-
incoming[2].module,
|
|
2428
|
-
edgeFalloff,
|
|
2429
|
-
lowerBound,
|
|
2430
|
-
upperBound
|
|
2431
|
-
);
|
|
2432
|
-
updateComputedData(id, { module });
|
|
2433
|
-
}
|
|
2084
|
+
useEffect19(() => {
|
|
2434
2085
|
updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
|
|
2435
|
-
}, [
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2086
|
+
}, [edgeFalloff, lowerBound, upperBound]);
|
|
2087
|
+
const onDataUpdated = useCallback18(
|
|
2088
|
+
(incomingData) => {
|
|
2089
|
+
const incomingSources = incomingData["source" /* source */];
|
|
2090
|
+
const incomingControl = incomingData["control" /* control */];
|
|
2091
|
+
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
2092
|
+
const module = new Select(
|
|
2093
|
+
incomingSources[0].module,
|
|
2094
|
+
incomingSources[1].module,
|
|
2095
|
+
incomingControl[0].module,
|
|
2096
|
+
edgeFalloff,
|
|
2097
|
+
lowerBound,
|
|
2098
|
+
upperBound
|
|
2099
|
+
);
|
|
2100
|
+
updateComputedData(id, { module });
|
|
2101
|
+
}
|
|
2102
|
+
},
|
|
2103
|
+
[]
|
|
2104
|
+
);
|
|
2105
|
+
return /* @__PURE__ */ jsxs22(NodeContainer26, { id, selected, data, type, children: [
|
|
2106
|
+
/* @__PURE__ */ jsxs22(Stack11, { children: [
|
|
2107
|
+
/* @__PURE__ */ jsxs22(Group12, { children: [
|
|
2439
2108
|
"Edge Falloff:",
|
|
2440
|
-
/* @__PURE__ */
|
|
2441
|
-
|
|
2109
|
+
/* @__PURE__ */ jsx26(
|
|
2110
|
+
NumberInput10,
|
|
2442
2111
|
{
|
|
2443
2112
|
size: "xs",
|
|
2444
2113
|
w: 100,
|
|
@@ -2448,10 +2117,10 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2448
2117
|
}
|
|
2449
2118
|
)
|
|
2450
2119
|
] }),
|
|
2451
|
-
/* @__PURE__ */
|
|
2120
|
+
/* @__PURE__ */ jsxs22(Group12, { children: [
|
|
2452
2121
|
"Lower Bound:",
|
|
2453
|
-
/* @__PURE__ */
|
|
2454
|
-
|
|
2122
|
+
/* @__PURE__ */ jsx26(
|
|
2123
|
+
NumberInput10,
|
|
2455
2124
|
{
|
|
2456
2125
|
size: "xs",
|
|
2457
2126
|
w: 100,
|
|
@@ -2461,10 +2130,10 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2461
2130
|
}
|
|
2462
2131
|
)
|
|
2463
2132
|
] }),
|
|
2464
|
-
/* @__PURE__ */
|
|
2133
|
+
/* @__PURE__ */ jsxs22(Group12, { children: [
|
|
2465
2134
|
"Upper Bound:",
|
|
2466
|
-
/* @__PURE__ */
|
|
2467
|
-
|
|
2135
|
+
/* @__PURE__ */ jsx26(
|
|
2136
|
+
NumberInput10,
|
|
2468
2137
|
{
|
|
2469
2138
|
size: "xs",
|
|
2470
2139
|
w: 100,
|
|
@@ -2474,101 +2143,103 @@ function NoiseSelectNode({ id, selected, data, type }) {
|
|
|
2474
2143
|
}
|
|
2475
2144
|
)
|
|
2476
2145
|
] }),
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2146
|
+
/* @__PURE__ */ jsx26(
|
|
2147
|
+
HandlesIncomingDataStatus2,
|
|
2148
|
+
{
|
|
2149
|
+
nodeId: id,
|
|
2150
|
+
handles: data.handles,
|
|
2151
|
+
handleKey: "dataId",
|
|
2152
|
+
onDataUpdated,
|
|
2153
|
+
type: "target",
|
|
2154
|
+
resetComputedData: true
|
|
2155
|
+
}
|
|
2156
|
+
)
|
|
2481
2157
|
] }),
|
|
2482
|
-
/* @__PURE__ */
|
|
2158
|
+
/* @__PURE__ */ jsx26(NodeTrackConnections21, { handles: data.handles, nodeId: id, type: "target" })
|
|
2483
2159
|
] });
|
|
2484
2160
|
}
|
|
2485
2161
|
var noise_select_node_default = NoiseSelectNode;
|
|
2486
2162
|
|
|
2487
2163
|
// src/nodes/transformers/noise-displace-node.tsx
|
|
2488
|
-
import { NodeContainer as
|
|
2489
|
-
import {
|
|
2490
|
-
import {
|
|
2164
|
+
import { NodeContainer as NodeContainer27, NodeTrackConnections as NodeTrackConnections22 } from "@awesome-flow/core/layout";
|
|
2165
|
+
import { useCallback as useCallback19 } from "react";
|
|
2166
|
+
import { useUpdateNodeComputedData as useUpdateNodeComputedData25 } from "@awesome-flow/core/hooks";
|
|
2491
2167
|
import { Displace } from "libnoise-ts/module/transformer";
|
|
2492
|
-
import {
|
|
2493
|
-
import { jsx as
|
|
2168
|
+
import { HandlesIncomingDataStatus as HandlesIncomingDataStatus3 } from "@awesome-flow/core/components";
|
|
2169
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2494
2170
|
function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
2495
2171
|
const updateComputedData = useUpdateNodeComputedData25();
|
|
2496
|
-
const
|
|
2497
|
-
|
|
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
|
-
/* @__PURE__ */ jsx34(Badge2, { color: xColor, children: "X Module" }),
|
|
2528
|
-
/* @__PURE__ */ jsx34(Badge2, { color: yColor, children: "Y Module" }),
|
|
2529
|
-
/* @__PURE__ */ jsx34(Badge2, { color: zColor, children: "Z Module" })
|
|
2530
|
-
] }),
|
|
2531
|
-
/* @__PURE__ */ jsx34(NodeTrackConnections25, { handles: data.handles, nodeId: id, type: "target" })
|
|
2172
|
+
const onDataUpdated = useCallback19(
|
|
2173
|
+
(handleData) => {
|
|
2174
|
+
const sourceModule = handleData["source" /* sourceModule */];
|
|
2175
|
+
const xModule = handleData["x-module" /* xModule */];
|
|
2176
|
+
const yModule = handleData["y-module" /* yModule */];
|
|
2177
|
+
const zModule = handleData["z-module" /* zModule */];
|
|
2178
|
+
if (sourceModule && xModule && yModule && zModule) {
|
|
2179
|
+
const module = new Displace(
|
|
2180
|
+
sourceModule[0].module,
|
|
2181
|
+
xModule[0].module,
|
|
2182
|
+
yModule[0].module,
|
|
2183
|
+
zModule[0].module
|
|
2184
|
+
);
|
|
2185
|
+
updateComputedData(id, { module });
|
|
2186
|
+
}
|
|
2187
|
+
},
|
|
2188
|
+
[]
|
|
2189
|
+
);
|
|
2190
|
+
return /* @__PURE__ */ jsxs23(NodeContainer27, { id, selected, data, type, children: [
|
|
2191
|
+
/* @__PURE__ */ jsx27(
|
|
2192
|
+
HandlesIncomingDataStatus3,
|
|
2193
|
+
{
|
|
2194
|
+
nodeId: id,
|
|
2195
|
+
handles: data.handles,
|
|
2196
|
+
handleKey: "dataId",
|
|
2197
|
+
onDataUpdated,
|
|
2198
|
+
type: "target",
|
|
2199
|
+
resetComputedData: true
|
|
2200
|
+
}
|
|
2201
|
+
),
|
|
2202
|
+
/* @__PURE__ */ jsx27(NodeTrackConnections22, { handles: data.handles, nodeId: id, type: "target" })
|
|
2532
2203
|
] });
|
|
2533
2204
|
}
|
|
2534
2205
|
var noise_displace_node_default = NoiseDisplaceNode;
|
|
2535
2206
|
|
|
2536
2207
|
// src/nodes/transformers/noise-rotate-point-node.tsx
|
|
2537
|
-
import { NodeContainer as
|
|
2538
|
-
import { useEffect as
|
|
2208
|
+
import { NodeContainer as NodeContainer28, NodeTrackConnections as NodeTrackConnections23 } from "@awesome-flow/core/layout";
|
|
2209
|
+
import { useEffect as useEffect20, useState as useState16 } from "react";
|
|
2539
2210
|
import {
|
|
2540
|
-
useIncomingComputedData as
|
|
2211
|
+
useIncomingComputedData as useIncomingComputedData14,
|
|
2541
2212
|
useUpdateNodeComputedData as useUpdateNodeComputedData26,
|
|
2542
|
-
useUpdateNodeData as
|
|
2213
|
+
useUpdateNodeData as useUpdateNodeData12
|
|
2543
2214
|
} from "@awesome-flow/core/hooks";
|
|
2544
|
-
import { Group as
|
|
2215
|
+
import { Group as Group13, NumberInput as NumberInput11, Stack as Stack12 } from "@mantine/core";
|
|
2545
2216
|
import { RotatePoint } from "libnoise-ts/module/transformer";
|
|
2546
|
-
import { jsx as
|
|
2217
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2547
2218
|
function NoiseRotatePointNode({
|
|
2548
2219
|
id,
|
|
2549
2220
|
selected,
|
|
2550
2221
|
data,
|
|
2551
2222
|
type
|
|
2552
2223
|
}) {
|
|
2553
|
-
const [xAngle, setXAngle] =
|
|
2554
|
-
const [yAngle, setYAngle] =
|
|
2555
|
-
const [zAngle, setZAngle] =
|
|
2556
|
-
const incoming =
|
|
2557
|
-
const updateNodeData =
|
|
2224
|
+
const [xAngle, setXAngle] = useState16(data.xAngle);
|
|
2225
|
+
const [yAngle, setYAngle] = useState16(data.yAngle);
|
|
2226
|
+
const [zAngle, setZAngle] = useState16(data.zAngle);
|
|
2227
|
+
const incoming = useIncomingComputedData14(id);
|
|
2228
|
+
const updateNodeData = useUpdateNodeData12();
|
|
2558
2229
|
const updateComputedData = useUpdateNodeComputedData26();
|
|
2559
|
-
|
|
2230
|
+
useEffect20(() => {
|
|
2560
2231
|
if (incoming?.length) {
|
|
2561
2232
|
const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
|
|
2562
2233
|
updateComputedData(id, { module });
|
|
2563
2234
|
}
|
|
2564
2235
|
updateNodeData(id, { xAngle, yAngle, zAngle });
|
|
2565
2236
|
}, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
|
|
2566
|
-
return /* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
/* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ jsxs24(NodeContainer28, { id, selected, data, type, children: [
|
|
2238
|
+
/* @__PURE__ */ jsxs24(Stack12, { children: [
|
|
2239
|
+
/* @__PURE__ */ jsxs24(Group13, { children: [
|
|
2569
2240
|
"X Angle:",
|
|
2570
|
-
/* @__PURE__ */
|
|
2571
|
-
|
|
2241
|
+
/* @__PURE__ */ jsx28(
|
|
2242
|
+
NumberInput11,
|
|
2572
2243
|
{
|
|
2573
2244
|
size: "xs",
|
|
2574
2245
|
w: 100,
|
|
@@ -2578,10 +2249,10 @@ function NoiseRotatePointNode({
|
|
|
2578
2249
|
}
|
|
2579
2250
|
)
|
|
2580
2251
|
] }),
|
|
2581
|
-
/* @__PURE__ */
|
|
2252
|
+
/* @__PURE__ */ jsxs24(Group13, { children: [
|
|
2582
2253
|
"Y Angle:",
|
|
2583
|
-
/* @__PURE__ */
|
|
2584
|
-
|
|
2254
|
+
/* @__PURE__ */ jsx28(
|
|
2255
|
+
NumberInput11,
|
|
2585
2256
|
{
|
|
2586
2257
|
size: "xs",
|
|
2587
2258
|
w: 100,
|
|
@@ -2591,10 +2262,10 @@ function NoiseRotatePointNode({
|
|
|
2591
2262
|
}
|
|
2592
2263
|
)
|
|
2593
2264
|
] }),
|
|
2594
|
-
/* @__PURE__ */
|
|
2265
|
+
/* @__PURE__ */ jsxs24(Group13, { children: [
|
|
2595
2266
|
"Z Angle:",
|
|
2596
|
-
/* @__PURE__ */
|
|
2597
|
-
|
|
2267
|
+
/* @__PURE__ */ jsx28(
|
|
2268
|
+
NumberInput11,
|
|
2598
2269
|
{
|
|
2599
2270
|
size: "xs",
|
|
2600
2271
|
w: 100,
|
|
@@ -2605,47 +2276,47 @@ function NoiseRotatePointNode({
|
|
|
2605
2276
|
)
|
|
2606
2277
|
] })
|
|
2607
2278
|
] }),
|
|
2608
|
-
/* @__PURE__ */
|
|
2279
|
+
/* @__PURE__ */ jsx28(NodeTrackConnections23, { handles: data.handles, nodeId: id, type: "target" })
|
|
2609
2280
|
] });
|
|
2610
2281
|
}
|
|
2611
2282
|
var noise_rotate_point_node_default = NoiseRotatePointNode;
|
|
2612
2283
|
|
|
2613
2284
|
// src/nodes/transformers/noise-scale-point-node.tsx
|
|
2614
|
-
import { NodeContainer as
|
|
2615
|
-
import { useEffect as
|
|
2285
|
+
import { NodeContainer as NodeContainer29, NodeTrackConnections as NodeTrackConnections24 } from "@awesome-flow/core/layout";
|
|
2286
|
+
import { useEffect as useEffect21, useState as useState17 } from "react";
|
|
2616
2287
|
import {
|
|
2617
|
-
useIncomingComputedData as
|
|
2288
|
+
useIncomingComputedData as useIncomingComputedData15,
|
|
2618
2289
|
useUpdateNodeComputedData as useUpdateNodeComputedData27,
|
|
2619
|
-
useUpdateNodeData as
|
|
2290
|
+
useUpdateNodeData as useUpdateNodeData13
|
|
2620
2291
|
} from "@awesome-flow/core/hooks";
|
|
2621
|
-
import { Group as
|
|
2292
|
+
import { Group as Group14, NumberInput as NumberInput12, Stack as Stack13 } from "@mantine/core";
|
|
2622
2293
|
import { ScalePoint } from "libnoise-ts/module/transformer";
|
|
2623
|
-
import { jsx as
|
|
2294
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2624
2295
|
function NoiseScalePointNode({
|
|
2625
2296
|
id,
|
|
2626
2297
|
selected,
|
|
2627
2298
|
data,
|
|
2628
2299
|
type
|
|
2629
2300
|
}) {
|
|
2630
|
-
const [xScale, setXScale] =
|
|
2631
|
-
const [yScale, setYScale] =
|
|
2632
|
-
const [zScale, setZScale] =
|
|
2633
|
-
const incoming =
|
|
2634
|
-
const updateNodeData =
|
|
2301
|
+
const [xScale, setXScale] = useState17(data.xScale);
|
|
2302
|
+
const [yScale, setYScale] = useState17(data.yScale);
|
|
2303
|
+
const [zScale, setZScale] = useState17(data.zScale);
|
|
2304
|
+
const incoming = useIncomingComputedData15(id);
|
|
2305
|
+
const updateNodeData = useUpdateNodeData13();
|
|
2635
2306
|
const updateComputedData = useUpdateNodeComputedData27();
|
|
2636
|
-
|
|
2307
|
+
useEffect21(() => {
|
|
2637
2308
|
if (incoming?.length) {
|
|
2638
2309
|
const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);
|
|
2639
2310
|
updateComputedData(id, { module });
|
|
2640
2311
|
}
|
|
2641
2312
|
updateNodeData(id, { xScale, yScale, zScale });
|
|
2642
2313
|
}, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
|
|
2643
|
-
return /* @__PURE__ */
|
|
2644
|
-
/* @__PURE__ */
|
|
2645
|
-
/* @__PURE__ */
|
|
2314
|
+
return /* @__PURE__ */ jsxs25(NodeContainer29, { id, selected, data, type, children: [
|
|
2315
|
+
/* @__PURE__ */ jsxs25(Stack13, { children: [
|
|
2316
|
+
/* @__PURE__ */ jsxs25(Group14, { children: [
|
|
2646
2317
|
"X Scale:",
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
|
|
2318
|
+
/* @__PURE__ */ jsx29(
|
|
2319
|
+
NumberInput12,
|
|
2649
2320
|
{
|
|
2650
2321
|
size: "xs",
|
|
2651
2322
|
w: 100,
|
|
@@ -2655,10 +2326,10 @@ function NoiseScalePointNode({
|
|
|
2655
2326
|
}
|
|
2656
2327
|
)
|
|
2657
2328
|
] }),
|
|
2658
|
-
/* @__PURE__ */
|
|
2329
|
+
/* @__PURE__ */ jsxs25(Group14, { children: [
|
|
2659
2330
|
"Y Scale:",
|
|
2660
|
-
/* @__PURE__ */
|
|
2661
|
-
|
|
2331
|
+
/* @__PURE__ */ jsx29(
|
|
2332
|
+
NumberInput12,
|
|
2662
2333
|
{
|
|
2663
2334
|
size: "xs",
|
|
2664
2335
|
w: 100,
|
|
@@ -2668,10 +2339,10 @@ function NoiseScalePointNode({
|
|
|
2668
2339
|
}
|
|
2669
2340
|
)
|
|
2670
2341
|
] }),
|
|
2671
|
-
/* @__PURE__ */
|
|
2342
|
+
/* @__PURE__ */ jsxs25(Group14, { children: [
|
|
2672
2343
|
"Z Scale:",
|
|
2673
|
-
/* @__PURE__ */
|
|
2674
|
-
|
|
2344
|
+
/* @__PURE__ */ jsx29(
|
|
2345
|
+
NumberInput12,
|
|
2675
2346
|
{
|
|
2676
2347
|
size: "xs",
|
|
2677
2348
|
w: 100,
|
|
@@ -2682,47 +2353,47 @@ function NoiseScalePointNode({
|
|
|
2682
2353
|
)
|
|
2683
2354
|
] })
|
|
2684
2355
|
] }),
|
|
2685
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ jsx29(NodeTrackConnections24, { handles: data.handles, nodeId: id, type: "target" })
|
|
2686
2357
|
] });
|
|
2687
2358
|
}
|
|
2688
2359
|
var noise_scale_point_node_default = NoiseScalePointNode;
|
|
2689
2360
|
|
|
2690
2361
|
// src/nodes/transformers/noise-translate-point-node.tsx
|
|
2691
|
-
import { NodeContainer as
|
|
2692
|
-
import { useEffect as
|
|
2362
|
+
import { NodeContainer as NodeContainer30, NodeTrackConnections as NodeTrackConnections25 } from "@awesome-flow/core/layout";
|
|
2363
|
+
import { useEffect as useEffect22, useState as useState18 } from "react";
|
|
2693
2364
|
import {
|
|
2694
|
-
useIncomingComputedData as
|
|
2365
|
+
useIncomingComputedData as useIncomingComputedData16,
|
|
2695
2366
|
useUpdateNodeComputedData as useUpdateNodeComputedData28,
|
|
2696
|
-
useUpdateNodeData as
|
|
2367
|
+
useUpdateNodeData as useUpdateNodeData14
|
|
2697
2368
|
} from "@awesome-flow/core/hooks";
|
|
2698
|
-
import { Group as
|
|
2369
|
+
import { Group as Group15, NumberInput as NumberInput13, Stack as Stack14 } from "@mantine/core";
|
|
2699
2370
|
import { TranslatePoint } from "libnoise-ts/module/transformer";
|
|
2700
|
-
import { jsx as
|
|
2371
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2701
2372
|
function NoiseTranslatePointNode({
|
|
2702
2373
|
id,
|
|
2703
2374
|
selected,
|
|
2704
2375
|
data,
|
|
2705
2376
|
type
|
|
2706
2377
|
}) {
|
|
2707
|
-
const [translateX, setTranslateX] =
|
|
2708
|
-
const [translateY, setTranslateY] =
|
|
2709
|
-
const [translateZ, setTranslateZ] =
|
|
2710
|
-
const incoming =
|
|
2711
|
-
const updateNodeData =
|
|
2378
|
+
const [translateX, setTranslateX] = useState18(data.translateX);
|
|
2379
|
+
const [translateY, setTranslateY] = useState18(data.translateY);
|
|
2380
|
+
const [translateZ, setTranslateZ] = useState18(data.translateZ);
|
|
2381
|
+
const incoming = useIncomingComputedData16(id);
|
|
2382
|
+
const updateNodeData = useUpdateNodeData14();
|
|
2712
2383
|
const updateComputedData = useUpdateNodeComputedData28();
|
|
2713
|
-
|
|
2384
|
+
useEffect22(() => {
|
|
2714
2385
|
if (incoming?.length) {
|
|
2715
2386
|
const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
|
|
2716
2387
|
updateComputedData(id, { module });
|
|
2717
2388
|
}
|
|
2718
2389
|
updateNodeData(id, { translateX, translateY, translateZ });
|
|
2719
2390
|
}, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
|
|
2720
|
-
return /* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2722
|
-
/* @__PURE__ */
|
|
2391
|
+
return /* @__PURE__ */ jsxs26(NodeContainer30, { id, selected, data, type, children: [
|
|
2392
|
+
/* @__PURE__ */ jsxs26(Stack14, { children: [
|
|
2393
|
+
/* @__PURE__ */ jsxs26(Group15, { children: [
|
|
2723
2394
|
"Translate X:",
|
|
2724
|
-
/* @__PURE__ */
|
|
2725
|
-
|
|
2395
|
+
/* @__PURE__ */ jsx30(
|
|
2396
|
+
NumberInput13,
|
|
2726
2397
|
{
|
|
2727
2398
|
size: "xs",
|
|
2728
2399
|
w: 100,
|
|
@@ -2732,10 +2403,10 @@ function NoiseTranslatePointNode({
|
|
|
2732
2403
|
}
|
|
2733
2404
|
)
|
|
2734
2405
|
] }),
|
|
2735
|
-
/* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ jsxs26(Group15, { children: [
|
|
2736
2407
|
"Translate Y:",
|
|
2737
|
-
/* @__PURE__ */
|
|
2738
|
-
|
|
2408
|
+
/* @__PURE__ */ jsx30(
|
|
2409
|
+
NumberInput13,
|
|
2739
2410
|
{
|
|
2740
2411
|
size: "xs",
|
|
2741
2412
|
w: 100,
|
|
@@ -2745,10 +2416,10 @@ function NoiseTranslatePointNode({
|
|
|
2745
2416
|
}
|
|
2746
2417
|
)
|
|
2747
2418
|
] }),
|
|
2748
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ jsxs26(Group15, { children: [
|
|
2749
2420
|
"Translate Z:",
|
|
2750
|
-
/* @__PURE__ */
|
|
2751
|
-
|
|
2421
|
+
/* @__PURE__ */ jsx30(
|
|
2422
|
+
NumberInput13,
|
|
2752
2423
|
{
|
|
2753
2424
|
size: "xs",
|
|
2754
2425
|
w: 100,
|
|
@@ -2759,31 +2430,32 @@ function NoiseTranslatePointNode({
|
|
|
2759
2430
|
)
|
|
2760
2431
|
] })
|
|
2761
2432
|
] }),
|
|
2762
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ jsx30(NodeTrackConnections25, { handles: data.handles, nodeId: id, type: "target" })
|
|
2763
2434
|
] });
|
|
2764
2435
|
}
|
|
2765
2436
|
var noise_translate_point_node_default = NoiseTranslatePointNode;
|
|
2766
2437
|
|
|
2767
2438
|
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
2768
|
-
import { NodeContainer as
|
|
2769
|
-
import { useCallback as
|
|
2770
|
-
import { useIncomingComputedData as
|
|
2439
|
+
import { NodeContainer as NodeContainer31, NodeTrackConnections as NodeTrackConnections26 } from "@awesome-flow/core/layout";
|
|
2440
|
+
import { useCallback as useCallback20, useEffect as useEffect23, useState as useState19 } from "react";
|
|
2441
|
+
import { useIncomingComputedData as useIncomingComputedData17, useUpdateNodeComputedData as useUpdateNodeComputedData29 } from "@awesome-flow/core/hooks";
|
|
2771
2442
|
import { Turbulence } from "libnoise-ts/module/transformer";
|
|
2772
|
-
import {
|
|
2443
|
+
import { NodePropertyVariables as NodePropertyVariables7 } from "@awesome-flow/core/components";
|
|
2444
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2773
2445
|
function NoiseTurbulenceNode({
|
|
2774
2446
|
id,
|
|
2775
2447
|
selected,
|
|
2776
2448
|
data,
|
|
2777
2449
|
type
|
|
2778
2450
|
}) {
|
|
2779
|
-
const [properties, setProperties] =
|
|
2780
|
-
const incoming =
|
|
2451
|
+
const [properties, setProperties] = useState19(null);
|
|
2452
|
+
const incoming = useIncomingComputedData17(id);
|
|
2781
2453
|
const updateComputedData = useUpdateNodeComputedData29();
|
|
2782
|
-
const onPropertiesChange =
|
|
2454
|
+
const onPropertiesChange = useCallback20((props) => {
|
|
2783
2455
|
setProperties(props);
|
|
2784
2456
|
}, []);
|
|
2785
|
-
|
|
2786
|
-
if (incoming?.length) {
|
|
2457
|
+
useEffect23(() => {
|
|
2458
|
+
if (incoming?.length && properties) {
|
|
2787
2459
|
const module = new Turbulence(
|
|
2788
2460
|
incoming[0].module,
|
|
2789
2461
|
properties.frequency.value,
|
|
@@ -2793,15 +2465,1011 @@ function NoiseTurbulenceNode({
|
|
|
2793
2465
|
);
|
|
2794
2466
|
updateComputedData(id, { module });
|
|
2795
2467
|
}
|
|
2796
|
-
}, [id, incoming, properties
|
|
2797
|
-
return /* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
/* @__PURE__ */
|
|
2468
|
+
}, [id, incoming, properties]);
|
|
2469
|
+
return /* @__PURE__ */ jsxs27(NodeContainer31, { id, selected, data, type, children: [
|
|
2470
|
+
/* @__PURE__ */ jsx31(NodePropertyVariables7, { data, nodeId: id, onPropertiesChange }),
|
|
2471
|
+
/* @__PURE__ */ jsx31(NodeTrackConnections26, { handles: data.handles, nodeId: id, type: "target" })
|
|
2800
2472
|
] });
|
|
2801
2473
|
}
|
|
2802
2474
|
var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
2475
|
+
|
|
2476
|
+
// src/templates/generators/noise-checkerboard-template.ts
|
|
2477
|
+
import { Position } from "@xyflow/system";
|
|
2478
|
+
var NoiseCheckerboardNodeTemplateFactory = class {
|
|
2479
|
+
template = {
|
|
2480
|
+
type: "noise-checkerboard" /* noiseCheckerboard */,
|
|
2481
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2482
|
+
data: {
|
|
2483
|
+
title: "Checkerboard Noise"
|
|
2484
|
+
},
|
|
2485
|
+
handles: [
|
|
2486
|
+
{
|
|
2487
|
+
position: Position.Right,
|
|
2488
|
+
dataType: "module" /* module */,
|
|
2489
|
+
connection: "source"
|
|
2490
|
+
}
|
|
2491
|
+
]
|
|
2492
|
+
};
|
|
2493
|
+
};
|
|
2494
|
+
|
|
2495
|
+
// src/templates/generators/noise-const-template.ts
|
|
2496
|
+
import { Position as Position2 } from "@xyflow/system";
|
|
2497
|
+
var NoiseConstNodeTemplateFactory = class {
|
|
2498
|
+
template = {
|
|
2499
|
+
type: "noise-constant" /* noiseConst */,
|
|
2500
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2501
|
+
data: {
|
|
2502
|
+
title: "Const Value Noise",
|
|
2503
|
+
noise: 0,
|
|
2504
|
+
min: -1,
|
|
2505
|
+
max: 1
|
|
2506
|
+
},
|
|
2507
|
+
handles: [
|
|
2508
|
+
{
|
|
2509
|
+
position: Position2.Right,
|
|
2510
|
+
dataType: "module" /* module */,
|
|
2511
|
+
connection: "source"
|
|
2512
|
+
}
|
|
2513
|
+
]
|
|
2514
|
+
};
|
|
2515
|
+
};
|
|
2516
|
+
|
|
2517
|
+
// src/templates/generators/noise-cylinders-template.ts
|
|
2518
|
+
import { CoreHandleType } from "@awesome-flow/core/abstract";
|
|
2519
|
+
import { Position as Position3 } from "@xyflow/system";
|
|
2520
|
+
var NoiseCylindersNodeTemplateFactory = class {
|
|
2521
|
+
template = {
|
|
2522
|
+
type: "noise-cylinders" /* noiseCylinders */,
|
|
2523
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2524
|
+
data: {
|
|
2525
|
+
title: "Cylinders Noise",
|
|
2526
|
+
frequency: 0.1
|
|
2527
|
+
},
|
|
2528
|
+
handles: [
|
|
2529
|
+
{
|
|
2530
|
+
position: Position3.Left,
|
|
2531
|
+
dataType: CoreHandleType.variableProperty,
|
|
2532
|
+
connection: "target"
|
|
2533
|
+
},
|
|
2534
|
+
{
|
|
2535
|
+
position: Position3.Right,
|
|
2536
|
+
dataType: "module" /* module */,
|
|
2537
|
+
connection: "source"
|
|
2538
|
+
}
|
|
2539
|
+
]
|
|
2540
|
+
};
|
|
2541
|
+
};
|
|
2542
|
+
|
|
2543
|
+
// src/templates/generators/noise-perlin-template.ts
|
|
2544
|
+
import { CoreHandleType as CoreHandleType2 } from "@awesome-flow/core/abstract";
|
|
2545
|
+
import { Position as Position4 } from "@xyflow/system";
|
|
2546
|
+
var NoisePerlinNodeTemplateFactory = class {
|
|
2547
|
+
template = {
|
|
2548
|
+
type: "noise-perlin" /* noisePerlin */,
|
|
2549
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2550
|
+
data: {
|
|
2551
|
+
title: "Perlin Noise",
|
|
2552
|
+
frequency: 0.1,
|
|
2553
|
+
lacunarity: 2,
|
|
2554
|
+
octaves: 5,
|
|
2555
|
+
persistence: 0.5,
|
|
2556
|
+
seed: 0
|
|
2557
|
+
},
|
|
2558
|
+
handles: [
|
|
2559
|
+
{
|
|
2560
|
+
position: Position4.Left,
|
|
2561
|
+
dataType: CoreHandleType2.variableProperty,
|
|
2562
|
+
connection: "target"
|
|
2563
|
+
},
|
|
2564
|
+
{
|
|
2565
|
+
position: Position4.Right,
|
|
2566
|
+
dataType: "module" /* module */,
|
|
2567
|
+
connection: "source"
|
|
2568
|
+
}
|
|
2569
|
+
]
|
|
2570
|
+
};
|
|
2571
|
+
};
|
|
2572
|
+
|
|
2573
|
+
// src/templates/generators/noise-ridgedmulti-template.ts
|
|
2574
|
+
import { CoreHandleType as CoreHandleType3 } from "@awesome-flow/core/abstract";
|
|
2575
|
+
import { Position as Position5 } from "@xyflow/system";
|
|
2576
|
+
var NoiseRidgedMultiNodeTemplateFactory = class {
|
|
2577
|
+
template = {
|
|
2578
|
+
type: "noise-ridged-multi" /* noiseRidgedMulti */,
|
|
2579
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2580
|
+
data: {
|
|
2581
|
+
title: "Ridged Multi Noise",
|
|
2582
|
+
frequency: 0.1,
|
|
2583
|
+
lacunarity: 2,
|
|
2584
|
+
octaves: 6,
|
|
2585
|
+
offset: 1,
|
|
2586
|
+
gain: 2,
|
|
2587
|
+
seed: 0
|
|
2588
|
+
},
|
|
2589
|
+
handles: [
|
|
2590
|
+
{
|
|
2591
|
+
position: Position5.Left,
|
|
2592
|
+
dataType: CoreHandleType3.variableProperty,
|
|
2593
|
+
connection: "target"
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
position: Position5.Right,
|
|
2597
|
+
dataType: "module" /* module */,
|
|
2598
|
+
connection: "source"
|
|
2599
|
+
}
|
|
2600
|
+
]
|
|
2601
|
+
};
|
|
2602
|
+
};
|
|
2603
|
+
|
|
2604
|
+
// src/templates/generators/noise-simplex-template.ts
|
|
2605
|
+
import {
|
|
2606
|
+
CoreHandleType as CoreHandleType4
|
|
2607
|
+
} from "@awesome-flow/core/abstract";
|
|
2608
|
+
import { Position as Position6 } from "@xyflow/system";
|
|
2609
|
+
var NoiseSimplexNodeTemplateFactory = class {
|
|
2610
|
+
template = {
|
|
2611
|
+
type: "noise-simplex" /* noiseSimplex */,
|
|
2612
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2613
|
+
data: {
|
|
2614
|
+
title: "Simplex Noise"
|
|
2615
|
+
},
|
|
2616
|
+
handles: [
|
|
2617
|
+
{
|
|
2618
|
+
position: Position6.Left,
|
|
2619
|
+
dataType: CoreHandleType4.variableProperty,
|
|
2620
|
+
connection: "target"
|
|
2621
|
+
},
|
|
2622
|
+
{
|
|
2623
|
+
position: Position6.Right,
|
|
2624
|
+
dataType: "module" /* module */,
|
|
2625
|
+
connection: "source"
|
|
2626
|
+
}
|
|
2627
|
+
]
|
|
2628
|
+
};
|
|
2629
|
+
};
|
|
2630
|
+
|
|
2631
|
+
// src/templates/generators/noise-spheres-template.ts
|
|
2632
|
+
import { CoreHandleType as CoreHandleType5 } from "@awesome-flow/core/abstract";
|
|
2633
|
+
import { Position as Position7 } from "@xyflow/system";
|
|
2634
|
+
var NoiseSpheresNodeTemplateFactory = class {
|
|
2635
|
+
template = {
|
|
2636
|
+
type: "noise-spheres" /* noiseSpheres */,
|
|
2637
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2638
|
+
data: {
|
|
2639
|
+
title: "Spheres Noise",
|
|
2640
|
+
frequency: 0.1
|
|
2641
|
+
},
|
|
2642
|
+
handles: [
|
|
2643
|
+
{
|
|
2644
|
+
position: Position7.Left,
|
|
2645
|
+
dataType: CoreHandleType5.variableProperty,
|
|
2646
|
+
connection: "target"
|
|
2647
|
+
},
|
|
2648
|
+
{
|
|
2649
|
+
position: Position7.Right,
|
|
2650
|
+
dataType: "module" /* module */,
|
|
2651
|
+
connection: "source"
|
|
2652
|
+
}
|
|
2653
|
+
]
|
|
2654
|
+
};
|
|
2655
|
+
};
|
|
2656
|
+
|
|
2657
|
+
// src/templates/generators/noise-voronoi-template.ts
|
|
2658
|
+
import { CoreHandleType as CoreHandleType6 } from "@awesome-flow/core/abstract";
|
|
2659
|
+
import { Position as Position8 } from "@xyflow/system";
|
|
2660
|
+
var NoiseVoronoiNodeTemplateFactory = class {
|
|
2661
|
+
template = {
|
|
2662
|
+
type: "noise-voronoi" /* noiseVoronoi */,
|
|
2663
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
2664
|
+
data: {
|
|
2665
|
+
title: "Voronoi Noise",
|
|
2666
|
+
frequency: 0.1,
|
|
2667
|
+
displacement: 1,
|
|
2668
|
+
distance: true,
|
|
2669
|
+
seed: 0
|
|
2670
|
+
},
|
|
2671
|
+
handles: [
|
|
2672
|
+
{
|
|
2673
|
+
position: Position8.Left,
|
|
2674
|
+
dataType: CoreHandleType6.variableProperty,
|
|
2675
|
+
connection: "target"
|
|
2676
|
+
},
|
|
2677
|
+
{
|
|
2678
|
+
position: Position8.Right,
|
|
2679
|
+
dataType: "module" /* module */,
|
|
2680
|
+
connection: "source"
|
|
2681
|
+
}
|
|
2682
|
+
]
|
|
2683
|
+
};
|
|
2684
|
+
};
|
|
2685
|
+
|
|
2686
|
+
// src/templates/generators/position-const-template.ts
|
|
2687
|
+
import { Position as Position9 } from "@xyflow/system";
|
|
2688
|
+
var PositionConstNodeTemplateFactory = class {
|
|
2689
|
+
template = {
|
|
2690
|
+
type: "position" /* position */,
|
|
2691
|
+
group: "Positions" /* positions */,
|
|
2692
|
+
data: {
|
|
2693
|
+
title: "Position Output",
|
|
2694
|
+
position: { x: 0, y: 0, z: 0 }
|
|
2695
|
+
},
|
|
2696
|
+
handles: [
|
|
2697
|
+
{
|
|
2698
|
+
position: Position9.Right,
|
|
2699
|
+
dataType: "position" /* position */,
|
|
2700
|
+
connection: "source"
|
|
2701
|
+
}
|
|
2702
|
+
]
|
|
2703
|
+
};
|
|
2704
|
+
};
|
|
2705
|
+
|
|
2706
|
+
// src/templates/generators/position-grid-template.ts
|
|
2707
|
+
import { Position as Position10 } from "@xyflow/system";
|
|
2708
|
+
var PositionGridNodeTemplateFactory = class {
|
|
2709
|
+
template = {
|
|
2710
|
+
type: "grid" /* grid */,
|
|
2711
|
+
group: "Positions" /* positions */,
|
|
2712
|
+
data: {
|
|
2713
|
+
title: "Grid Output",
|
|
2714
|
+
center: { x: 0, y: 0, z: 0 },
|
|
2715
|
+
radius: 1
|
|
2716
|
+
},
|
|
2717
|
+
handles: [
|
|
2718
|
+
{
|
|
2719
|
+
position: Position10.Right,
|
|
2720
|
+
dataType: "position" /* position */,
|
|
2721
|
+
connection: "source"
|
|
2722
|
+
}
|
|
2723
|
+
]
|
|
2724
|
+
};
|
|
2725
|
+
};
|
|
2726
|
+
|
|
2727
|
+
// src/templates/modifiers/noise-normalize-template.ts
|
|
2728
|
+
import { IDGenerator } from "@awesome-flow/core/utils";
|
|
2729
|
+
import { Position as Position11 } from "@xyflow/system";
|
|
2730
|
+
var NoiseNormalizeNodeTemplateFactory = class {
|
|
2731
|
+
template = {
|
|
2732
|
+
id: IDGenerator.template(),
|
|
2733
|
+
type: "noise-normalize" /* noiseNormalize */,
|
|
2734
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2735
|
+
data: {
|
|
2736
|
+
title: "Normalize Noise",
|
|
2737
|
+
intervalStart: -1,
|
|
2738
|
+
intervalEnd: 1
|
|
2739
|
+
},
|
|
2740
|
+
handles: [
|
|
2741
|
+
{
|
|
2742
|
+
position: Position11.Left,
|
|
2743
|
+
dataType: "module" /* module */,
|
|
2744
|
+
connection: "target",
|
|
2745
|
+
maxConnections: 1
|
|
2746
|
+
},
|
|
2747
|
+
{
|
|
2748
|
+
position: Position11.Right,
|
|
2749
|
+
dataType: "module" /* module */,
|
|
2750
|
+
connection: "source"
|
|
2751
|
+
}
|
|
2752
|
+
]
|
|
2753
|
+
};
|
|
2754
|
+
};
|
|
2755
|
+
|
|
2756
|
+
// src/templates/output/noise-logger-template.ts
|
|
2757
|
+
import { Position as Position12 } from "@xyflow/system";
|
|
2758
|
+
var NoiseLoggerNodeTemplateFactory = class {
|
|
2759
|
+
template = {
|
|
2760
|
+
type: "noise-logger" /* noiseLogger */,
|
|
2761
|
+
group: "Output" /* output */,
|
|
2762
|
+
data: {
|
|
2763
|
+
title: "Noise Logger"
|
|
2764
|
+
},
|
|
2765
|
+
handles: [
|
|
2766
|
+
{
|
|
2767
|
+
position: Position12.Left,
|
|
2768
|
+
dataType: "noise" /* noise */,
|
|
2769
|
+
connection: "target"
|
|
2770
|
+
}
|
|
2771
|
+
]
|
|
2772
|
+
};
|
|
2773
|
+
};
|
|
2774
|
+
|
|
2775
|
+
// src/templates/output/noise-raw-texture-template.ts
|
|
2776
|
+
import { Position as Position13 } from "@xyflow/system";
|
|
2777
|
+
var NoiseRawTextureTemplateFactory = class {
|
|
2778
|
+
template = {
|
|
2779
|
+
type: "texture-data" /* textureData */,
|
|
2780
|
+
group: "Output" /* output */,
|
|
2781
|
+
data: {
|
|
2782
|
+
title: "Texture Data"
|
|
2783
|
+
},
|
|
2784
|
+
handles: [
|
|
2785
|
+
{
|
|
2786
|
+
position: Position13.Left,
|
|
2787
|
+
dataType: "noise" /* noise */,
|
|
2788
|
+
connection: "target",
|
|
2789
|
+
maxConnections: 1
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
position: Position13.Right,
|
|
2793
|
+
dataType: "texture" /* texture */,
|
|
2794
|
+
connection: "source"
|
|
2795
|
+
}
|
|
2796
|
+
]
|
|
2797
|
+
};
|
|
2798
|
+
};
|
|
2799
|
+
|
|
2800
|
+
// src/templates/output/position-logger-template.ts
|
|
2801
|
+
import { Position as Position14 } from "@xyflow/system";
|
|
2802
|
+
var PositionLoggerNodeTemplateFactory = class {
|
|
2803
|
+
template = {
|
|
2804
|
+
type: "position-logger" /* positionLogger */,
|
|
2805
|
+
group: "Positions" /* positions */,
|
|
2806
|
+
data: {
|
|
2807
|
+
title: "Position Logger"
|
|
2808
|
+
},
|
|
2809
|
+
handles: [
|
|
2810
|
+
{
|
|
2811
|
+
position: Position14.Left,
|
|
2812
|
+
dataType: "position" /* position */,
|
|
2813
|
+
connection: "target"
|
|
2814
|
+
}
|
|
2815
|
+
]
|
|
2816
|
+
};
|
|
2817
|
+
};
|
|
2818
|
+
|
|
2819
|
+
// src/templates/modifiers/noise-combine-template.ts
|
|
2820
|
+
import { Position as Position15 } from "@xyflow/system";
|
|
2821
|
+
var NoiseCombineNodeTemplateFactory = class {
|
|
2822
|
+
template = {
|
|
2823
|
+
type: "noise-combiner" /* noiseCombine */,
|
|
2824
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2825
|
+
data: {
|
|
2826
|
+
title: "Combine Noise",
|
|
2827
|
+
operation: "add" /* add */
|
|
2828
|
+
},
|
|
2829
|
+
handles: [
|
|
2830
|
+
{
|
|
2831
|
+
position: Position15.Left,
|
|
2832
|
+
dataType: "module" /* module */,
|
|
2833
|
+
connection: "target",
|
|
2834
|
+
maxConnections: 2
|
|
2835
|
+
},
|
|
2836
|
+
{
|
|
2837
|
+
position: Position15.Right,
|
|
2838
|
+
dataType: "module" /* module */,
|
|
2839
|
+
connection: "source"
|
|
2840
|
+
}
|
|
2841
|
+
]
|
|
2842
|
+
};
|
|
2843
|
+
};
|
|
2844
|
+
|
|
2845
|
+
// src/templates/modifiers/noise-clamp-template.ts
|
|
2846
|
+
import { Position as Position16 } from "@xyflow/system";
|
|
2847
|
+
var NoiseClampNodeTemplateFactory = class {
|
|
2848
|
+
template = {
|
|
2849
|
+
type: "noise-clamp" /* noiseClamp */,
|
|
2850
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2851
|
+
data: {
|
|
2852
|
+
title: "Clamp Noise",
|
|
2853
|
+
lowerBound: -1,
|
|
2854
|
+
upperBound: 1
|
|
2855
|
+
},
|
|
2856
|
+
handles: [
|
|
2857
|
+
{
|
|
2858
|
+
position: Position16.Left,
|
|
2859
|
+
dataType: "module" /* module */,
|
|
2860
|
+
connection: "target",
|
|
2861
|
+
maxConnections: 1
|
|
2862
|
+
},
|
|
2863
|
+
{
|
|
2864
|
+
position: Position16.Right,
|
|
2865
|
+
dataType: "module" /* module */,
|
|
2866
|
+
connection: "source"
|
|
2867
|
+
}
|
|
2868
|
+
]
|
|
2869
|
+
};
|
|
2870
|
+
};
|
|
2871
|
+
|
|
2872
|
+
// src/templates/modifiers/noise-abs-template.ts
|
|
2873
|
+
import { Position as Position17 } from "@xyflow/system";
|
|
2874
|
+
var NoiseAbsNodeTemplateFactory = class {
|
|
2875
|
+
template = {
|
|
2876
|
+
type: "noise-abs" /* noiseAbs */,
|
|
2877
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2878
|
+
data: {
|
|
2879
|
+
title: "Abs Noise"
|
|
2880
|
+
},
|
|
2881
|
+
handles: [
|
|
2882
|
+
{
|
|
2883
|
+
position: Position17.Left,
|
|
2884
|
+
dataType: "module" /* module */,
|
|
2885
|
+
connection: "target",
|
|
2886
|
+
maxConnections: 1
|
|
2887
|
+
},
|
|
2888
|
+
{
|
|
2889
|
+
position: Position17.Right,
|
|
2890
|
+
dataType: "module" /* module */,
|
|
2891
|
+
connection: "source"
|
|
2892
|
+
}
|
|
2893
|
+
]
|
|
2894
|
+
};
|
|
2895
|
+
};
|
|
2896
|
+
|
|
2897
|
+
// src/templates/output/noise-output-template.ts
|
|
2898
|
+
import { Position as Position18 } from "@xyflow/system";
|
|
2899
|
+
var NoiseOutputNodeTemplateFactory = class {
|
|
2900
|
+
template = {
|
|
2901
|
+
type: "noise-output" /* noiseOutput */,
|
|
2902
|
+
group: "Output" /* output */,
|
|
2903
|
+
data: {
|
|
2904
|
+
title: "Noise Output"
|
|
2905
|
+
},
|
|
2906
|
+
handles: [
|
|
2907
|
+
{
|
|
2908
|
+
position: Position18.Left,
|
|
2909
|
+
dataType: "position" /* position */,
|
|
2910
|
+
connection: "target"
|
|
2911
|
+
},
|
|
2912
|
+
{
|
|
2913
|
+
position: Position18.Left,
|
|
2914
|
+
dataType: "module" /* module */,
|
|
2915
|
+
connection: "target",
|
|
2916
|
+
maxConnections: 1
|
|
2917
|
+
},
|
|
2918
|
+
{
|
|
2919
|
+
position: Position18.Right,
|
|
2920
|
+
dataType: "noise" /* noise */,
|
|
2921
|
+
connection: "source"
|
|
2922
|
+
}
|
|
2923
|
+
]
|
|
2924
|
+
};
|
|
2925
|
+
};
|
|
2926
|
+
|
|
2927
|
+
// src/templates/modifiers/noise-curve-template.ts
|
|
2928
|
+
import { CoreHandleType as CoreHandleType7 } from "@awesome-flow/core/abstract";
|
|
2929
|
+
import { Position as Position19 } from "@xyflow/system";
|
|
2930
|
+
var NoiseCurveNodeTemplateFactory = class {
|
|
2931
|
+
template = {
|
|
2932
|
+
type: "noise-curve" /* noiseCurve */,
|
|
2933
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2934
|
+
data: {
|
|
2935
|
+
title: "Noise Curve",
|
|
2936
|
+
points: []
|
|
2937
|
+
},
|
|
2938
|
+
handles: [
|
|
2939
|
+
{
|
|
2940
|
+
position: Position19.Left,
|
|
2941
|
+
dataType: "module" /* module */,
|
|
2942
|
+
connection: "target",
|
|
2943
|
+
maxConnections: 1
|
|
2944
|
+
},
|
|
2945
|
+
{
|
|
2946
|
+
position: Position19.Left,
|
|
2947
|
+
dataType: CoreHandleType7.variableProperty,
|
|
2948
|
+
connection: "target"
|
|
2949
|
+
},
|
|
2950
|
+
{
|
|
2951
|
+
position: Position19.Right,
|
|
2952
|
+
dataType: "module" /* module */,
|
|
2953
|
+
connection: "source"
|
|
2954
|
+
}
|
|
2955
|
+
]
|
|
2956
|
+
};
|
|
2957
|
+
};
|
|
2958
|
+
|
|
2959
|
+
// src/templates/modifiers/noise-exponent-template.ts
|
|
2960
|
+
import { Position as Position20 } from "@xyflow/system";
|
|
2961
|
+
var NoiseExponentNodeTemplateFactory = class {
|
|
2962
|
+
template = {
|
|
2963
|
+
type: "noise-exponent" /* noiseExponent */,
|
|
2964
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2965
|
+
data: {
|
|
2966
|
+
title: "Noise Exponent",
|
|
2967
|
+
exponent: 1
|
|
2968
|
+
},
|
|
2969
|
+
handles: [
|
|
2970
|
+
{
|
|
2971
|
+
position: Position20.Left,
|
|
2972
|
+
dataType: "module" /* module */,
|
|
2973
|
+
connection: "target",
|
|
2974
|
+
maxConnections: 1
|
|
2975
|
+
},
|
|
2976
|
+
{
|
|
2977
|
+
position: Position20.Right,
|
|
2978
|
+
dataType: "module" /* module */,
|
|
2979
|
+
connection: "source"
|
|
2980
|
+
}
|
|
2981
|
+
]
|
|
2982
|
+
};
|
|
2983
|
+
};
|
|
2984
|
+
|
|
2985
|
+
// src/templates/modifiers/noise-invert-template.ts
|
|
2986
|
+
import { Position as Position21 } from "@xyflow/system";
|
|
2987
|
+
var NoiseInvertNodeTemplateFactory = class {
|
|
2988
|
+
template = {
|
|
2989
|
+
type: "noise-invert" /* noiseInvert */,
|
|
2990
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
2991
|
+
data: {
|
|
2992
|
+
title: "Invert Noise"
|
|
2993
|
+
},
|
|
2994
|
+
handles: [
|
|
2995
|
+
{
|
|
2996
|
+
position: Position21.Left,
|
|
2997
|
+
dataType: "module" /* module */,
|
|
2998
|
+
connection: "target",
|
|
2999
|
+
maxConnections: 1
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
position: Position21.Right,
|
|
3003
|
+
dataType: "module" /* module */,
|
|
3004
|
+
connection: "source"
|
|
3005
|
+
}
|
|
3006
|
+
]
|
|
3007
|
+
};
|
|
3008
|
+
};
|
|
3009
|
+
|
|
3010
|
+
// src/templates/modifiers/noise-scalebias-template.ts
|
|
3011
|
+
import { Position as Position22 } from "@xyflow/system";
|
|
3012
|
+
var NoiseScaleBiasNodeTemplateFactory = class {
|
|
3013
|
+
template = {
|
|
3014
|
+
type: "noise-scale-bias" /* noiseScaleBias */,
|
|
3015
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
3016
|
+
data: {
|
|
3017
|
+
title: "Scale/Bias Noise",
|
|
3018
|
+
scale: 1,
|
|
3019
|
+
bias: 0
|
|
3020
|
+
},
|
|
3021
|
+
handles: [
|
|
3022
|
+
{
|
|
3023
|
+
position: Position22.Left,
|
|
3024
|
+
dataType: "module" /* module */,
|
|
3025
|
+
connection: "target",
|
|
3026
|
+
maxConnections: 1
|
|
3027
|
+
},
|
|
3028
|
+
{
|
|
3029
|
+
position: Position22.Right,
|
|
3030
|
+
dataType: "module" /* module */,
|
|
3031
|
+
connection: "source"
|
|
3032
|
+
}
|
|
3033
|
+
]
|
|
3034
|
+
};
|
|
3035
|
+
};
|
|
3036
|
+
|
|
3037
|
+
// src/templates/modifiers/noise-terrace-template.ts
|
|
3038
|
+
import { Position as Position23 } from "@xyflow/system";
|
|
3039
|
+
var NoiseTerraceNodeTemplateFactory = class {
|
|
3040
|
+
template = {
|
|
3041
|
+
type: "noise-terrace" /* noiseTerrace */,
|
|
3042
|
+
group: "Noise Modifiers" /* noiseModifiers */,
|
|
3043
|
+
data: {
|
|
3044
|
+
title: "Noise Terrace",
|
|
3045
|
+
points: []
|
|
3046
|
+
},
|
|
3047
|
+
handles: [
|
|
3048
|
+
{
|
|
3049
|
+
position: Position23.Left,
|
|
3050
|
+
dataType: "module" /* module */,
|
|
3051
|
+
connection: "target",
|
|
3052
|
+
maxConnections: 1
|
|
3053
|
+
},
|
|
3054
|
+
{
|
|
3055
|
+
position: Position23.Right,
|
|
3056
|
+
dataType: "module" /* module */,
|
|
3057
|
+
connection: "source"
|
|
3058
|
+
}
|
|
3059
|
+
]
|
|
3060
|
+
};
|
|
3061
|
+
};
|
|
3062
|
+
|
|
3063
|
+
// src/templates/selectors/noise-blend-template.ts
|
|
3064
|
+
import { Position as Position24 } from "@xyflow/system";
|
|
3065
|
+
var NoiseBlendNodeTemplateFactory = class {
|
|
3066
|
+
template = {
|
|
3067
|
+
type: "noise-blend" /* noiseBlend */,
|
|
3068
|
+
group: "Noise Selectors" /* noiseSelectors */,
|
|
3069
|
+
data: {
|
|
3070
|
+
title: "Noise Blend"
|
|
3071
|
+
},
|
|
3072
|
+
handles: [
|
|
3073
|
+
{
|
|
3074
|
+
position: Position24.Left,
|
|
3075
|
+
dataType: "module" /* module */,
|
|
3076
|
+
connection: "target",
|
|
3077
|
+
label: "Source Modules",
|
|
3078
|
+
dataId: "source" /* source */,
|
|
3079
|
+
maxConnections: 2,
|
|
3080
|
+
minConnections: 2
|
|
3081
|
+
},
|
|
3082
|
+
{
|
|
3083
|
+
position: Position24.Left,
|
|
3084
|
+
dataType: "module" /* module */,
|
|
3085
|
+
dataId: "control" /* control */,
|
|
3086
|
+
connection: "target",
|
|
3087
|
+
label: "Control Module",
|
|
3088
|
+
maxConnections: 1
|
|
3089
|
+
},
|
|
3090
|
+
{
|
|
3091
|
+
position: Position24.Right,
|
|
3092
|
+
dataType: "module" /* module */,
|
|
3093
|
+
dataId: "output" /* output */,
|
|
3094
|
+
connection: "source"
|
|
3095
|
+
}
|
|
3096
|
+
]
|
|
3097
|
+
};
|
|
3098
|
+
};
|
|
3099
|
+
|
|
3100
|
+
// src/templates/selectors/noise-select-template.ts
|
|
3101
|
+
import { Position as Position25 } from "@xyflow/system";
|
|
3102
|
+
var NoiseSelectNodeTemplateFactory = class {
|
|
3103
|
+
template = {
|
|
3104
|
+
type: "noise-select" /* noiseSelect */,
|
|
3105
|
+
group: "Noise Selectors" /* noiseSelectors */,
|
|
3106
|
+
data: {
|
|
3107
|
+
title: "Noise Select",
|
|
3108
|
+
edgeFalloff: 0,
|
|
3109
|
+
lowerBound: -1,
|
|
3110
|
+
upperBound: 1
|
|
3111
|
+
},
|
|
3112
|
+
handles: [
|
|
3113
|
+
{
|
|
3114
|
+
position: Position25.Left,
|
|
3115
|
+
dataType: "module" /* module */,
|
|
3116
|
+
dataId: "source" /* source */,
|
|
3117
|
+
connection: "target",
|
|
3118
|
+
label: "Source Modules",
|
|
3119
|
+
maxConnections: 2,
|
|
3120
|
+
minConnections: 2
|
|
3121
|
+
},
|
|
3122
|
+
{
|
|
3123
|
+
position: Position25.Left,
|
|
3124
|
+
dataType: "module" /* module */,
|
|
3125
|
+
dataId: "control" /* control */,
|
|
3126
|
+
connection: "target",
|
|
3127
|
+
label: "Control Module",
|
|
3128
|
+
maxConnections: 1
|
|
3129
|
+
},
|
|
3130
|
+
{
|
|
3131
|
+
position: Position25.Right,
|
|
3132
|
+
dataType: "module" /* module */,
|
|
3133
|
+
dataId: "output" /* output */,
|
|
3134
|
+
connection: "source"
|
|
3135
|
+
}
|
|
3136
|
+
]
|
|
3137
|
+
};
|
|
3138
|
+
};
|
|
3139
|
+
|
|
3140
|
+
// src/templates/transformers/noise-displace-template.ts
|
|
3141
|
+
import { Position as Position26 } from "@xyflow/system";
|
|
3142
|
+
var NoiseDisplaceNodeTemplateFactory = class {
|
|
3143
|
+
template = {
|
|
3144
|
+
type: "noise-displace" /* noiseDisplace */,
|
|
3145
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3146
|
+
data: {
|
|
3147
|
+
title: "Noise Displace"
|
|
3148
|
+
},
|
|
3149
|
+
handles: [
|
|
3150
|
+
{
|
|
3151
|
+
position: Position26.Left,
|
|
3152
|
+
connection: "target",
|
|
3153
|
+
label: "Source Module",
|
|
3154
|
+
dataType: "module" /* module */,
|
|
3155
|
+
dataId: "source" /* sourceModule */,
|
|
3156
|
+
maxConnections: 1
|
|
3157
|
+
},
|
|
3158
|
+
{
|
|
3159
|
+
position: Position26.Left,
|
|
3160
|
+
connection: "target",
|
|
3161
|
+
label: "X Module",
|
|
3162
|
+
dataType: "module" /* module */,
|
|
3163
|
+
dataId: "x-module" /* xModule */,
|
|
3164
|
+
maxConnections: 1
|
|
3165
|
+
},
|
|
3166
|
+
{
|
|
3167
|
+
position: Position26.Left,
|
|
3168
|
+
connection: "target",
|
|
3169
|
+
label: "Y Module",
|
|
3170
|
+
dataType: "module" /* module */,
|
|
3171
|
+
dataId: "y-module" /* yModule */,
|
|
3172
|
+
maxConnections: 1
|
|
3173
|
+
},
|
|
3174
|
+
{
|
|
3175
|
+
position: Position26.Left,
|
|
3176
|
+
connection: "target",
|
|
3177
|
+
label: "Z Module",
|
|
3178
|
+
dataType: "module" /* module */,
|
|
3179
|
+
dataId: "z-module" /* zModule */,
|
|
3180
|
+
maxConnections: 1
|
|
3181
|
+
},
|
|
3182
|
+
{
|
|
3183
|
+
position: Position26.Right,
|
|
3184
|
+
dataType: "module" /* module */,
|
|
3185
|
+
dataId: "output" /* output */,
|
|
3186
|
+
connection: "source"
|
|
3187
|
+
}
|
|
3188
|
+
]
|
|
3189
|
+
};
|
|
3190
|
+
};
|
|
3191
|
+
|
|
3192
|
+
// src/templates/transformers/noise-rotate-point-template.ts
|
|
3193
|
+
import { Position as Position27 } from "@xyflow/system";
|
|
3194
|
+
var NoiseRotatePointNodeTemplateFactory = class {
|
|
3195
|
+
template = {
|
|
3196
|
+
type: "noise-rotate-point" /* noiseRotatePoint */,
|
|
3197
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3198
|
+
data: {
|
|
3199
|
+
title: "Noise Rotate Point",
|
|
3200
|
+
xAngle: 0,
|
|
3201
|
+
yAngle: 0,
|
|
3202
|
+
zAngle: 0
|
|
3203
|
+
},
|
|
3204
|
+
handles: [
|
|
3205
|
+
{
|
|
3206
|
+
position: Position27.Left,
|
|
3207
|
+
dataType: "module" /* module */,
|
|
3208
|
+
connection: "target",
|
|
3209
|
+
label: "Source Module",
|
|
3210
|
+
maxConnections: 1
|
|
3211
|
+
},
|
|
3212
|
+
{
|
|
3213
|
+
position: Position27.Right,
|
|
3214
|
+
dataType: "module" /* module */,
|
|
3215
|
+
connection: "source"
|
|
3216
|
+
}
|
|
3217
|
+
]
|
|
3218
|
+
};
|
|
3219
|
+
};
|
|
3220
|
+
|
|
3221
|
+
// src/templates/transformers/noise-scale-point-template.ts
|
|
3222
|
+
import { Position as Position28 } from "@xyflow/system";
|
|
3223
|
+
var NoiseScalePointNodeTemplateFactory = class {
|
|
3224
|
+
template = {
|
|
3225
|
+
type: "noise-scale-point" /* noiseScalePoint */,
|
|
3226
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3227
|
+
data: {
|
|
3228
|
+
title: "Noise Scale Point",
|
|
3229
|
+
xScale: 1,
|
|
3230
|
+
yScale: 1,
|
|
3231
|
+
zScale: 1
|
|
3232
|
+
},
|
|
3233
|
+
handles: [
|
|
3234
|
+
{
|
|
3235
|
+
position: Position28.Left,
|
|
3236
|
+
dataType: "module" /* module */,
|
|
3237
|
+
connection: "target",
|
|
3238
|
+
label: "Source Module",
|
|
3239
|
+
maxConnections: 1
|
|
3240
|
+
},
|
|
3241
|
+
{
|
|
3242
|
+
position: Position28.Right,
|
|
3243
|
+
dataType: "module" /* module */,
|
|
3244
|
+
connection: "source"
|
|
3245
|
+
}
|
|
3246
|
+
]
|
|
3247
|
+
};
|
|
3248
|
+
};
|
|
3249
|
+
|
|
3250
|
+
// src/templates/transformers/noise-translate-point-template.ts
|
|
3251
|
+
import { Position as Position29 } from "@xyflow/system";
|
|
3252
|
+
var NoiseTranslatePointNodeTemplateFactory = class {
|
|
3253
|
+
template = {
|
|
3254
|
+
type: "noise-translate-point" /* noiseTranslatePoint */,
|
|
3255
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3256
|
+
data: {
|
|
3257
|
+
title: "Noise Translate Point",
|
|
3258
|
+
translateX: 0,
|
|
3259
|
+
translateY: 0,
|
|
3260
|
+
translateZ: 0
|
|
3261
|
+
},
|
|
3262
|
+
handles: [
|
|
3263
|
+
{
|
|
3264
|
+
position: Position29.Left,
|
|
3265
|
+
dataType: "module" /* module */,
|
|
3266
|
+
connection: "target",
|
|
3267
|
+
label: "Source Module",
|
|
3268
|
+
maxConnections: 1
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
position: Position29.Right,
|
|
3272
|
+
dataType: "module" /* module */,
|
|
3273
|
+
connection: "source"
|
|
3274
|
+
}
|
|
3275
|
+
]
|
|
3276
|
+
};
|
|
3277
|
+
};
|
|
3278
|
+
|
|
3279
|
+
// src/templates/transformers/noise-turbulence-template.ts
|
|
3280
|
+
import { CoreHandleType as CoreHandleType8 } from "@awesome-flow/core/abstract";
|
|
3281
|
+
import { Position as Position30 } from "@xyflow/system";
|
|
3282
|
+
var NoiseTurbulenceNodeTemplateFactory = class {
|
|
3283
|
+
template = {
|
|
3284
|
+
type: "noise-turbulence" /* noiseTurbulence */,
|
|
3285
|
+
group: "Noise Transformers" /* noiseTransformers */,
|
|
3286
|
+
data: {
|
|
3287
|
+
title: "Noise Turbulence",
|
|
3288
|
+
frequency: 1,
|
|
3289
|
+
power: 1,
|
|
3290
|
+
roughness: 1,
|
|
3291
|
+
seed: 0
|
|
3292
|
+
},
|
|
3293
|
+
handles: [
|
|
3294
|
+
{
|
|
3295
|
+
position: Position30.Left,
|
|
3296
|
+
dataType: "module" /* module */,
|
|
3297
|
+
connection: "target",
|
|
3298
|
+
label: "Source Module",
|
|
3299
|
+
maxConnections: 1
|
|
3300
|
+
},
|
|
3301
|
+
{
|
|
3302
|
+
position: Position30.Left,
|
|
3303
|
+
dataType: CoreHandleType8.variableProperty,
|
|
3304
|
+
label: "Variable Properties",
|
|
3305
|
+
connection: "target"
|
|
3306
|
+
},
|
|
3307
|
+
{
|
|
3308
|
+
position: Position30.Right,
|
|
3309
|
+
dataType: "module" /* module */,
|
|
3310
|
+
connection: "source"
|
|
3311
|
+
}
|
|
3312
|
+
]
|
|
3313
|
+
};
|
|
3314
|
+
};
|
|
3315
|
+
|
|
3316
|
+
// src/templates/generators/noise-billow-template.ts
|
|
3317
|
+
import { CoreHandleType as CoreHandleType9 } from "@awesome-flow/core/abstract";
|
|
3318
|
+
import { IDGenerator as IDGenerator2 } from "@awesome-flow/core/utils";
|
|
3319
|
+
import { Position as Position31 } from "@xyflow/system";
|
|
3320
|
+
var NoiseBillowNodeTemplateFactory = class {
|
|
3321
|
+
template = {
|
|
3322
|
+
id: IDGenerator2.template(),
|
|
3323
|
+
type: "noise-billow" /* noiseBillow */,
|
|
3324
|
+
group: "Noise Generators" /* noiseGenerators */,
|
|
3325
|
+
data: {
|
|
3326
|
+
title: "Billow Noise",
|
|
3327
|
+
frequency: 0.1,
|
|
3328
|
+
lacunarity: 2,
|
|
3329
|
+
octaves: 5,
|
|
3330
|
+
persistence: 0.5,
|
|
3331
|
+
seed: 0
|
|
3332
|
+
},
|
|
3333
|
+
handles: [
|
|
3334
|
+
{
|
|
3335
|
+
position: Position31.Left,
|
|
3336
|
+
dataType: CoreHandleType9.variableProperty,
|
|
3337
|
+
connection: "target"
|
|
3338
|
+
},
|
|
3339
|
+
{
|
|
3340
|
+
position: Position31.Right,
|
|
3341
|
+
dataType: "module" /* module */,
|
|
3342
|
+
connection: "source"
|
|
3343
|
+
}
|
|
3344
|
+
]
|
|
3345
|
+
};
|
|
3346
|
+
};
|
|
3347
|
+
|
|
3348
|
+
// src/templates/groups/module-group-template.ts
|
|
3349
|
+
import {
|
|
3350
|
+
CoreTemplateGroup
|
|
3351
|
+
} from "@awesome-flow/core/abstract";
|
|
3352
|
+
import { IDGenerator as IDGenerator3 } from "@awesome-flow/core/utils";
|
|
3353
|
+
import { Position as Position32 } from "@xyflow/system";
|
|
3354
|
+
var ModuleGroupNodeTemplateFactory = class {
|
|
3355
|
+
template = {
|
|
3356
|
+
id: IDGenerator3.template(),
|
|
3357
|
+
type: "group-module" /* groupModule */,
|
|
3358
|
+
group: CoreTemplateGroup.groups,
|
|
3359
|
+
data: {
|
|
3360
|
+
title: "Modules Group",
|
|
3361
|
+
isGroup: true,
|
|
3362
|
+
initialSize: {
|
|
3363
|
+
width: 300,
|
|
3364
|
+
height: 200
|
|
3365
|
+
},
|
|
3366
|
+
collapsedSize: {
|
|
3367
|
+
width: 300,
|
|
3368
|
+
height: 80
|
|
3369
|
+
}
|
|
3370
|
+
},
|
|
3371
|
+
handles: [
|
|
3372
|
+
{
|
|
3373
|
+
position: Position32.Bottom,
|
|
3374
|
+
dataType: "module" /* module */,
|
|
3375
|
+
connection: "target",
|
|
3376
|
+
maxConnections: 1,
|
|
3377
|
+
hideOnCollapse: true
|
|
3378
|
+
},
|
|
3379
|
+
{
|
|
3380
|
+
position: Position32.Right,
|
|
3381
|
+
dataType: "module" /* module */,
|
|
3382
|
+
connection: "source"
|
|
3383
|
+
}
|
|
3384
|
+
]
|
|
3385
|
+
};
|
|
3386
|
+
};
|
|
3387
|
+
|
|
3388
|
+
// src/abstract/node-types.ts
|
|
3389
|
+
var noiseNodeTemplates = {
|
|
3390
|
+
["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
|
|
3391
|
+
["noise-simplex" /* noiseSimplex */]: new NoiseSimplexNodeTemplateFactory(),
|
|
3392
|
+
["noise-billow" /* noiseBillow */]: new NoiseBillowNodeTemplateFactory(),
|
|
3393
|
+
["noise-checkerboard" /* noiseCheckerboard */]: new NoiseCheckerboardNodeTemplateFactory(),
|
|
3394
|
+
["noise-normalize" /* noiseNormalize */]: new NoiseNormalizeNodeTemplateFactory(),
|
|
3395
|
+
["noise-logger" /* noiseLogger */]: new NoiseLoggerNodeTemplateFactory(),
|
|
3396
|
+
["noise-constant" /* noiseConst */]: new NoiseConstNodeTemplateFactory(),
|
|
3397
|
+
["position" /* position */]: new PositionConstNodeTemplateFactory(),
|
|
3398
|
+
["position-logger" /* positionLogger */]: new PositionLoggerNodeTemplateFactory(),
|
|
3399
|
+
["grid" /* grid */]: new PositionGridNodeTemplateFactory(),
|
|
3400
|
+
["texture-data" /* textureData */]: new NoiseRawTextureTemplateFactory(),
|
|
3401
|
+
["noise-cylinders" /* noiseCylinders */]: new NoiseCylindersNodeTemplateFactory(),
|
|
3402
|
+
["noise-perlin" /* noisePerlin */]: new NoisePerlinNodeTemplateFactory(),
|
|
3403
|
+
["noise-ridged-multi" /* noiseRidgedMulti */]: new NoiseRidgedMultiNodeTemplateFactory(),
|
|
3404
|
+
["noise-spheres" /* noiseSpheres */]: new NoiseSpheresNodeTemplateFactory(),
|
|
3405
|
+
["noise-voronoi" /* noiseVoronoi */]: new NoiseVoronoiNodeTemplateFactory(),
|
|
3406
|
+
["noise-combiner" /* noiseCombine */]: new NoiseCombineNodeTemplateFactory(),
|
|
3407
|
+
["noise-clamp" /* noiseClamp */]: new NoiseClampNodeTemplateFactory(),
|
|
3408
|
+
["noise-abs" /* noiseAbs */]: new NoiseAbsNodeTemplateFactory(),
|
|
3409
|
+
["noise-curve" /* noiseCurve */]: new NoiseCurveNodeTemplateFactory(),
|
|
3410
|
+
["noise-exponent" /* noiseExponent */]: new NoiseExponentNodeTemplateFactory(),
|
|
3411
|
+
["noise-invert" /* noiseInvert */]: new NoiseInvertNodeTemplateFactory(),
|
|
3412
|
+
["noise-scale-bias" /* noiseScaleBias */]: new NoiseScaleBiasNodeTemplateFactory(),
|
|
3413
|
+
["noise-terrace" /* noiseTerrace */]: new NoiseTerraceNodeTemplateFactory(),
|
|
3414
|
+
["noise-blend" /* noiseBlend */]: new NoiseBlendNodeTemplateFactory(),
|
|
3415
|
+
["noise-select" /* noiseSelect */]: new NoiseSelectNodeTemplateFactory(),
|
|
3416
|
+
["noise-displace" /* noiseDisplace */]: new NoiseDisplaceNodeTemplateFactory(),
|
|
3417
|
+
["noise-rotate-point" /* noiseRotatePoint */]: new NoiseRotatePointNodeTemplateFactory(),
|
|
3418
|
+
["noise-scale-point" /* noiseScalePoint */]: new NoiseScalePointNodeTemplateFactory(),
|
|
3419
|
+
["noise-translate-point" /* noiseTranslatePoint */]: new NoiseTranslatePointNodeTemplateFactory(),
|
|
3420
|
+
["noise-turbulence" /* noiseTurbulence */]: new NoiseTurbulenceNodeTemplateFactory(),
|
|
3421
|
+
["group-module" /* groupModule */]: new ModuleGroupNodeTemplateFactory()
|
|
3422
|
+
};
|
|
3423
|
+
|
|
3424
|
+
// src/nodes/output/noise-output-node.tsx
|
|
3425
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3426
|
+
function NoiseOutputNode({ id, selected, data, type }) {
|
|
3427
|
+
const [size, setSize] = useState20(0);
|
|
3428
|
+
const updateComputedData = useUpdateNodeComputedData30();
|
|
3429
|
+
const onDataUpdated = useCallback21(
|
|
3430
|
+
(handleData) => {
|
|
3431
|
+
const incomingPositions = handleData["position" /* position */];
|
|
3432
|
+
const incomingModule = handleData["module" /* module */];
|
|
3433
|
+
if (incomingPositions?.length && incomingModule?.length && incomingModule[0]?.module) {
|
|
3434
|
+
const { module } = incomingModule[0];
|
|
3435
|
+
const noise = [];
|
|
3436
|
+
for (const input of incomingPositions) {
|
|
3437
|
+
for (const position of input.positions) {
|
|
3438
|
+
const value = module.getValue(position.x, position.y, position.z);
|
|
3439
|
+
noise.push({
|
|
3440
|
+
position,
|
|
3441
|
+
value
|
|
3442
|
+
});
|
|
3443
|
+
}
|
|
3444
|
+
}
|
|
3445
|
+
updateComputedData(id, { noise, module });
|
|
3446
|
+
setSize(noise.length);
|
|
3447
|
+
}
|
|
3448
|
+
},
|
|
3449
|
+
[]
|
|
3450
|
+
);
|
|
3451
|
+
return /* @__PURE__ */ jsxs28(NodeContainer32, { id, selected, data, type, children: [
|
|
3452
|
+
/* @__PURE__ */ jsx32(
|
|
3453
|
+
HandlesIncomingDataStatus4,
|
|
3454
|
+
{
|
|
3455
|
+
nodeId: id,
|
|
3456
|
+
handles: data.handles,
|
|
3457
|
+
handleKey: "dataType",
|
|
3458
|
+
onDataUpdated,
|
|
3459
|
+
type: "target",
|
|
3460
|
+
resetComputedData: true
|
|
3461
|
+
}
|
|
3462
|
+
),
|
|
3463
|
+
/* @__PURE__ */ jsxs28(Text3, { mt: 5, children: [
|
|
3464
|
+
"Noise points: ",
|
|
3465
|
+
size
|
|
3466
|
+
] }),
|
|
3467
|
+
/* @__PURE__ */ jsx32(NodeTrackConnections27, { handles: data.handles, nodeId: id, type: "target" })
|
|
3468
|
+
] });
|
|
3469
|
+
}
|
|
3470
|
+
var noise_output_node_default = NoiseOutputNode;
|
|
2803
3471
|
export {
|
|
2804
|
-
|
|
3472
|
+
module_group_node_default as ModuleGroupNode,
|
|
2805
3473
|
noise_abs_node_default as NoiseAbsNode,
|
|
2806
3474
|
noise_billow_node_default as NoiseBillowNode,
|
|
2807
3475
|
noise_blend_node_default as NoiseBlendNode,
|
|
@@ -2832,9 +3500,5 @@ export {
|
|
|
2832
3500
|
noise_voronoi_node_default as NoiseVoronoiNode,
|
|
2833
3501
|
position_const_node_default as PositionConstNode,
|
|
2834
3502
|
position_grid_node_default as PositionGridNode,
|
|
2835
|
-
positions_logger_node_default as PositionsLoggerNode
|
|
2836
|
-
variable_combine_node_default as VariableCombineNode,
|
|
2837
|
-
variable_property_node_default as VariablePropertyNode,
|
|
2838
|
-
variable_value_node_default as VariableValueNode
|
|
3503
|
+
positions_logger_node_default as PositionsLoggerNode
|
|
2839
3504
|
};
|
|
2840
|
-
//# sourceMappingURL=index.js.map
|