@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
|
@@ -1,47 +1,42 @@
|
|
|
1
1
|
// src/nodes/transformers/noise-displace-node.tsx
|
|
2
2
|
import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
|
|
5
5
|
import { Displace } from "libnoise-ts/module/transformer";
|
|
6
|
-
import {
|
|
6
|
+
import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
9
9
|
const updateComputedData = useUpdateNodeComputedData();
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
}, [id, updateComputedData, sourceModule, xModule, yModule, zModule]);
|
|
30
|
-
const { sourceColor, xColor, yColor, zColor } = useMemo(() => {
|
|
31
|
-
return {
|
|
32
|
-
sourceColor: sourceModule ? "green" : "orange",
|
|
33
|
-
xColor: xModule ? "green" : "orange",
|
|
34
|
-
yColor: yModule ? "green" : "orange",
|
|
35
|
-
zColor: zModule ? "green" : "orange"
|
|
36
|
-
};
|
|
37
|
-
}, [sourceModule, xModule, yModule, zModule]);
|
|
10
|
+
const onDataUpdated = useCallback(
|
|
11
|
+
(handleData) => {
|
|
12
|
+
const sourceModule = handleData["source" /* sourceModule */];
|
|
13
|
+
const xModule = handleData["x-module" /* xModule */];
|
|
14
|
+
const yModule = handleData["y-module" /* yModule */];
|
|
15
|
+
const zModule = handleData["z-module" /* zModule */];
|
|
16
|
+
if (sourceModule && xModule && yModule && zModule) {
|
|
17
|
+
const module = new Displace(
|
|
18
|
+
sourceModule[0].module,
|
|
19
|
+
xModule[0].module,
|
|
20
|
+
yModule[0].module,
|
|
21
|
+
zModule[0].module
|
|
22
|
+
);
|
|
23
|
+
updateComputedData(id, { module });
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
[]
|
|
27
|
+
);
|
|
38
28
|
return /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
HandlesIncomingDataStatus,
|
|
31
|
+
{
|
|
32
|
+
nodeId: id,
|
|
33
|
+
handles: data.handles,
|
|
34
|
+
handleKey: "dataId",
|
|
35
|
+
onDataUpdated,
|
|
36
|
+
type: "target",
|
|
37
|
+
resetComputedData: true
|
|
38
|
+
}
|
|
39
|
+
),
|
|
45
40
|
/* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
46
41
|
] });
|
|
47
42
|
}
|
|
@@ -49,13 +44,13 @@ var noise_displace_node_default = NoiseDisplaceNode;
|
|
|
49
44
|
|
|
50
45
|
// src/nodes/transformers/noise-rotate-point-node.tsx
|
|
51
46
|
import { NodeContainer as NodeContainer2, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
|
|
52
|
-
import { useEffect
|
|
47
|
+
import { useEffect, useState } from "react";
|
|
53
48
|
import {
|
|
54
49
|
useIncomingComputedData,
|
|
55
50
|
useUpdateNodeComputedData as useUpdateNodeComputedData2,
|
|
56
51
|
useUpdateNodeData
|
|
57
52
|
} from "@awesome-flow/core/hooks";
|
|
58
|
-
import { Group, NumberInput, Stack
|
|
53
|
+
import { Group, NumberInput, Stack } from "@mantine/core";
|
|
59
54
|
import { RotatePoint } from "libnoise-ts/module/transformer";
|
|
60
55
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
61
56
|
function NoiseRotatePointNode({
|
|
@@ -70,7 +65,7 @@ function NoiseRotatePointNode({
|
|
|
70
65
|
const incoming = useIncomingComputedData(id);
|
|
71
66
|
const updateNodeData = useUpdateNodeData();
|
|
72
67
|
const updateComputedData = useUpdateNodeComputedData2();
|
|
73
|
-
|
|
68
|
+
useEffect(() => {
|
|
74
69
|
if (incoming?.length) {
|
|
75
70
|
const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
|
|
76
71
|
updateComputedData(id, { module });
|
|
@@ -78,7 +73,7 @@ function NoiseRotatePointNode({
|
|
|
78
73
|
updateNodeData(id, { xAngle, yAngle, zAngle });
|
|
79
74
|
}, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
|
|
80
75
|
return /* @__PURE__ */ jsxs2(NodeContainer2, { id, selected, data, type, children: [
|
|
81
|
-
/* @__PURE__ */ jsxs2(
|
|
76
|
+
/* @__PURE__ */ jsxs2(Stack, { children: [
|
|
82
77
|
/* @__PURE__ */ jsxs2(Group, { children: [
|
|
83
78
|
"X Angle:",
|
|
84
79
|
/* @__PURE__ */ jsx2(
|
|
@@ -126,13 +121,13 @@ var noise_rotate_point_node_default = NoiseRotatePointNode;
|
|
|
126
121
|
|
|
127
122
|
// src/nodes/transformers/noise-scale-point-node.tsx
|
|
128
123
|
import { NodeContainer as NodeContainer3, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
|
|
129
|
-
import { useEffect as
|
|
124
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
130
125
|
import {
|
|
131
126
|
useIncomingComputedData as useIncomingComputedData2,
|
|
132
127
|
useUpdateNodeComputedData as useUpdateNodeComputedData3,
|
|
133
128
|
useUpdateNodeData as useUpdateNodeData2
|
|
134
129
|
} from "@awesome-flow/core/hooks";
|
|
135
|
-
import { Group as Group2, NumberInput as NumberInput2, Stack as
|
|
130
|
+
import { Group as Group2, NumberInput as NumberInput2, Stack as Stack2 } from "@mantine/core";
|
|
136
131
|
import { ScalePoint } from "libnoise-ts/module/transformer";
|
|
137
132
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
138
133
|
function NoiseScalePointNode({
|
|
@@ -147,7 +142,7 @@ function NoiseScalePointNode({
|
|
|
147
142
|
const incoming = useIncomingComputedData2(id);
|
|
148
143
|
const updateNodeData = useUpdateNodeData2();
|
|
149
144
|
const updateComputedData = useUpdateNodeComputedData3();
|
|
150
|
-
|
|
145
|
+
useEffect2(() => {
|
|
151
146
|
if (incoming?.length) {
|
|
152
147
|
const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);
|
|
153
148
|
updateComputedData(id, { module });
|
|
@@ -155,7 +150,7 @@ function NoiseScalePointNode({
|
|
|
155
150
|
updateNodeData(id, { xScale, yScale, zScale });
|
|
156
151
|
}, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
|
|
157
152
|
return /* @__PURE__ */ jsxs3(NodeContainer3, { id, selected, data, type, children: [
|
|
158
|
-
/* @__PURE__ */ jsxs3(
|
|
153
|
+
/* @__PURE__ */ jsxs3(Stack2, { children: [
|
|
159
154
|
/* @__PURE__ */ jsxs3(Group2, { children: [
|
|
160
155
|
"X Scale:",
|
|
161
156
|
/* @__PURE__ */ jsx3(
|
|
@@ -203,13 +198,13 @@ var noise_scale_point_node_default = NoiseScalePointNode;
|
|
|
203
198
|
|
|
204
199
|
// src/nodes/transformers/noise-translate-point-node.tsx
|
|
205
200
|
import { NodeContainer as NodeContainer4, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
|
|
206
|
-
import { useEffect as
|
|
201
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
207
202
|
import {
|
|
208
203
|
useIncomingComputedData as useIncomingComputedData3,
|
|
209
204
|
useUpdateNodeComputedData as useUpdateNodeComputedData4,
|
|
210
205
|
useUpdateNodeData as useUpdateNodeData3
|
|
211
206
|
} from "@awesome-flow/core/hooks";
|
|
212
|
-
import { Group as Group3, NumberInput as NumberInput3, Stack as
|
|
207
|
+
import { Group as Group3, NumberInput as NumberInput3, Stack as Stack3 } from "@mantine/core";
|
|
213
208
|
import { TranslatePoint } from "libnoise-ts/module/transformer";
|
|
214
209
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
215
210
|
function NoiseTranslatePointNode({
|
|
@@ -224,7 +219,7 @@ function NoiseTranslatePointNode({
|
|
|
224
219
|
const incoming = useIncomingComputedData3(id);
|
|
225
220
|
const updateNodeData = useUpdateNodeData3();
|
|
226
221
|
const updateComputedData = useUpdateNodeComputedData4();
|
|
227
|
-
|
|
222
|
+
useEffect3(() => {
|
|
228
223
|
if (incoming?.length) {
|
|
229
224
|
const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
|
|
230
225
|
updateComputedData(id, { module });
|
|
@@ -232,7 +227,7 @@ function NoiseTranslatePointNode({
|
|
|
232
227
|
updateNodeData(id, { translateX, translateY, translateZ });
|
|
233
228
|
}, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
|
|
234
229
|
return /* @__PURE__ */ jsxs4(NodeContainer4, { id, selected, data, type, children: [
|
|
235
|
-
/* @__PURE__ */ jsxs4(
|
|
230
|
+
/* @__PURE__ */ jsxs4(Stack3, { children: [
|
|
236
231
|
/* @__PURE__ */ jsxs4(Group3, { children: [
|
|
237
232
|
"Translate X:",
|
|
238
233
|
/* @__PURE__ */ jsx4(
|
|
@@ -280,159 +275,25 @@ var noise_translate_point_node_default = NoiseTranslatePointNode;
|
|
|
280
275
|
|
|
281
276
|
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
282
277
|
import { NodeContainer as NodeContainer5, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
|
|
283
|
-
import { useCallback as useCallback2, useEffect as
|
|
278
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useState as useState4 } from "react";
|
|
284
279
|
import { useIncomingComputedData as useIncomingComputedData4, useUpdateNodeComputedData as useUpdateNodeComputedData5 } from "@awesome-flow/core/hooks";
|
|
285
280
|
import { Turbulence } from "libnoise-ts/module/transformer";
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
import { useIncomingNodeData, useUpdateNodeData as useUpdateNodeData4 } from "@awesome-flow/core/hooks";
|
|
289
|
-
import { useCallback, useEffect as useEffect5, useMemo as useMemo2, useState as useState4 } from "react";
|
|
290
|
-
import { Group as Group4, Stack as Stack5 } from "@mantine/core";
|
|
291
|
-
import { getObjectKeys } from "@awesome-flow/core/utils";
|
|
292
|
-
import { nodeDataPropertyExcept } from "@awesome-flow/core/abstract";
|
|
293
|
-
|
|
294
|
-
// src/layout/node-value-input.tsx
|
|
295
|
-
import { Input, NumberInput as NumberInput4, Switch } from "@mantine/core";
|
|
296
|
-
import { Fragment, jsx as jsx5 } from "react/jsx-runtime";
|
|
297
|
-
function NodeValueInput({ value, disabled, step, onChange }) {
|
|
298
|
-
if (value === void 0 || value === null) {
|
|
299
|
-
return /* @__PURE__ */ jsx5(Fragment, {});
|
|
300
|
-
}
|
|
301
|
-
switch (typeof value) {
|
|
302
|
-
case "boolean": {
|
|
303
|
-
return /* @__PURE__ */ jsx5(
|
|
304
|
-
Switch,
|
|
305
|
-
{
|
|
306
|
-
checked: value,
|
|
307
|
-
disabled,
|
|
308
|
-
onChange: (e) => onChange(e.currentTarget.checked)
|
|
309
|
-
}
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
case "number": {
|
|
313
|
-
return /* @__PURE__ */ jsx5(NumberInput4, { value, disabled, step, onChange: (e) => onChange(e) });
|
|
314
|
-
}
|
|
315
|
-
case "string": {
|
|
316
|
-
return /* @__PURE__ */ jsx5(
|
|
317
|
-
Input,
|
|
318
|
-
{
|
|
319
|
-
value,
|
|
320
|
-
disabled,
|
|
321
|
-
onChange: (e) => onChange(e.currentTarget.value)
|
|
322
|
-
}
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
default:
|
|
326
|
-
throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
var node_value_input_default = NodeValueInput;
|
|
330
|
-
|
|
331
|
-
// src/layout/node-property-input.tsx
|
|
332
|
-
import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
|
|
333
|
-
function NodePropertyInput({ property, onChange }) {
|
|
334
|
-
if (!property) {
|
|
335
|
-
return /* @__PURE__ */ jsx6(Fragment2, {});
|
|
336
|
-
}
|
|
337
|
-
return /* @__PURE__ */ jsx6(
|
|
338
|
-
node_value_input_default,
|
|
339
|
-
{
|
|
340
|
-
value: property.value,
|
|
341
|
-
disabled: property.disabled,
|
|
342
|
-
step: property.step,
|
|
343
|
-
onChange: (value) => onChange(property.name, value)
|
|
344
|
-
}
|
|
345
|
-
);
|
|
346
|
-
}
|
|
347
|
-
var node_property_input_default = NodePropertyInput;
|
|
348
|
-
|
|
349
|
-
// src/layout/node-property-variables.tsx
|
|
350
|
-
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
351
|
-
function NodePropertyVariables({
|
|
352
|
-
data,
|
|
353
|
-
nodeId,
|
|
354
|
-
onPropertiesChange,
|
|
355
|
-
except = nodeDataPropertyExcept
|
|
356
|
-
}) {
|
|
357
|
-
const [properties, setProperties] = useState4(() => {
|
|
358
|
-
const keys = getObjectKeys(data, except);
|
|
359
|
-
const dataProps = {};
|
|
360
|
-
for (const key of keys) {
|
|
361
|
-
dataProps[key] = {
|
|
362
|
-
name: key,
|
|
363
|
-
value: data[key]
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
return dataProps;
|
|
367
|
-
});
|
|
368
|
-
const updateNodeData = useUpdateNodeData4();
|
|
369
|
-
const incoming = useIncomingNodeData(nodeId);
|
|
370
|
-
const resetAllDisabled = useCallback(() => {
|
|
371
|
-
const keys = Object.keys(properties);
|
|
372
|
-
keys.forEach((k) => {
|
|
373
|
-
properties[k].disabled = false;
|
|
374
|
-
});
|
|
375
|
-
setProperties(properties);
|
|
376
|
-
}, []);
|
|
377
|
-
const updatePropertyValue = useCallback((name, value, disabled) => {
|
|
378
|
-
let property = properties[name];
|
|
379
|
-
if (property) {
|
|
380
|
-
property.value = value;
|
|
381
|
-
} else {
|
|
382
|
-
property = {
|
|
383
|
-
name,
|
|
384
|
-
value
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
property.disabled = disabled;
|
|
388
|
-
setProperties({ ...properties, [name]: property });
|
|
389
|
-
updateNodeData(nodeId, { [name]: value });
|
|
390
|
-
}, []);
|
|
391
|
-
useEffect5(() => {
|
|
392
|
-
resetAllDisabled();
|
|
393
|
-
if (incoming?.length) {
|
|
394
|
-
for (const connection of incoming) {
|
|
395
|
-
if (connection.property && properties[connection.property.name] !== void 0) {
|
|
396
|
-
updatePropertyValue(connection.property.name, connection.property.value, true);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}, [incoming]);
|
|
401
|
-
useEffect5(() => {
|
|
402
|
-
if (onPropertiesChange) {
|
|
403
|
-
onPropertiesChange(properties);
|
|
404
|
-
}
|
|
405
|
-
}, [onPropertiesChange, properties]);
|
|
406
|
-
const nodes = useMemo2(() => {
|
|
407
|
-
return Object.keys(properties).map((key) => {
|
|
408
|
-
const property = properties[key];
|
|
409
|
-
return /* @__PURE__ */ jsxs5(Group4, { children: [
|
|
410
|
-
property.name,
|
|
411
|
-
":",
|
|
412
|
-
/* @__PURE__ */ jsx7(node_property_input_default, { property, onChange: updatePropertyValue })
|
|
413
|
-
] }, key);
|
|
414
|
-
});
|
|
415
|
-
}, [properties, updatePropertyValue]);
|
|
416
|
-
return /* @__PURE__ */ jsx7(Stack5, { children: nodes });
|
|
417
|
-
}
|
|
418
|
-
var node_property_variables_default = NodePropertyVariables;
|
|
419
|
-
|
|
420
|
-
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
421
|
-
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
281
|
+
import { NodePropertyVariables } from "@awesome-flow/core/components";
|
|
282
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
422
283
|
function NoiseTurbulenceNode({
|
|
423
284
|
id,
|
|
424
285
|
selected,
|
|
425
286
|
data,
|
|
426
287
|
type
|
|
427
288
|
}) {
|
|
428
|
-
const [properties, setProperties] =
|
|
289
|
+
const [properties, setProperties] = useState4(null);
|
|
429
290
|
const incoming = useIncomingComputedData4(id);
|
|
430
291
|
const updateComputedData = useUpdateNodeComputedData5();
|
|
431
292
|
const onPropertiesChange = useCallback2((props) => {
|
|
432
293
|
setProperties(props);
|
|
433
294
|
}, []);
|
|
434
|
-
|
|
435
|
-
if (incoming?.length) {
|
|
295
|
+
useEffect4(() => {
|
|
296
|
+
if (incoming?.length && properties) {
|
|
436
297
|
const module = new Turbulence(
|
|
437
298
|
incoming[0].module,
|
|
438
299
|
properties.frequency.value,
|
|
@@ -442,10 +303,10 @@ function NoiseTurbulenceNode({
|
|
|
442
303
|
);
|
|
443
304
|
updateComputedData(id, { module });
|
|
444
305
|
}
|
|
445
|
-
}, [id, incoming, properties
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
306
|
+
}, [id, incoming, properties]);
|
|
307
|
+
return /* @__PURE__ */ jsxs5(NodeContainer5, { id, selected, data, type, children: [
|
|
308
|
+
/* @__PURE__ */ jsx5(NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
309
|
+
/* @__PURE__ */ jsx5(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
|
|
449
310
|
] });
|
|
450
311
|
}
|
|
451
312
|
var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
@@ -456,4 +317,3 @@ export {
|
|
|
456
317
|
noise_translate_point_node_default as NoiseTranslatePointNode,
|
|
457
318
|
noise_turbulence_node_default as NoiseTurbulenceNode
|
|
458
319
|
};
|
|
459
|
-
//# sourceMappingURL=index.js.map
|