@awesome-flow/noise 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract/index.cjs +1405 -2078
- package/dist/abstract/index.cjs.map +1 -1
- package/dist/abstract/index.d.cts +23 -25
- package/dist/abstract/index.d.ts +23 -25
- package/dist/abstract/index.js +1315 -1996
- package/dist/abstract/index.js.map +1 -1
- package/dist/index-BungWYrh.d.cts +49 -0
- package/dist/index-DsQSjZC5.d.ts +49 -0
- package/dist/{node-props-CeZ8Oshz.d.ts → node-props-BbqbXDXn.d.cts} +2 -22
- package/dist/{node-props-hKW-_KOU.d.cts → node-props-BbqbXDXn.d.ts} +2 -22
- package/dist/nodes/generators/index.cjs +130 -380
- package/dist/nodes/generators/index.cjs.map +1 -1
- package/dist/nodes/generators/index.d.cts +2 -8
- package/dist/nodes/generators/index.d.ts +2 -8
- package/dist/nodes/generators/index.js +112 -360
- package/dist/nodes/generators/index.js.map +1 -1
- package/dist/nodes/groups/index.cjs +25 -13
- package/dist/nodes/groups/index.cjs.map +1 -1
- package/dist/nodes/groups/index.js +26 -14
- package/dist/nodes/groups/index.js.map +1 -1
- package/dist/nodes/index.cjs +1654 -988
- package/dist/nodes/index.cjs.map +1 -1
- package/dist/nodes/index.d.cts +3 -5
- package/dist/nodes/index.d.ts +3 -5
- package/dist/nodes/index.js +1622 -960
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/modifiers/index.cjs +17 -119
- package/dist/nodes/modifiers/index.cjs.map +1 -1
- package/dist/nodes/modifiers/index.d.cts +2 -6
- package/dist/nodes/modifiers/index.d.ts +2 -6
- package/dist/nodes/modifiers/index.js +16 -124
- package/dist/nodes/modifiers/index.js.map +1 -1
- package/dist/nodes/output/index.cjs +1271 -89
- package/dist/nodes/output/index.cjs.map +1 -1
- package/dist/nodes/output/index.js +1314 -92
- package/dist/nodes/output/index.js.map +1 -1
- package/dist/nodes/selectors/index.cjs +1296 -58
- package/dist/nodes/selectors/index.cjs.map +1 -1
- package/dist/nodes/selectors/index.d.cts +1 -3
- package/dist/nodes/selectors/index.d.ts +1 -3
- package/dist/nodes/selectors/index.js +1339 -65
- package/dist/nodes/selectors/index.js.map +1 -1
- package/dist/nodes/transformers/index.cjs +67 -206
- package/dist/nodes/transformers/index.cjs.map +1 -1
- package/dist/nodes/transformers/index.d.cts +3 -5
- package/dist/nodes/transformers/index.d.ts +3 -5
- package/dist/nodes/transformers/index.js +54 -193
- package/dist/nodes/transformers/index.js.map +1 -1
- package/dist/templates/generators/index.cjs +839 -1278
- package/dist/templates/generators/index.cjs.map +1 -1
- package/dist/templates/generators/index.d.cts +13 -50
- package/dist/templates/generators/index.d.ts +13 -50
- package/dist/templates/generators/index.js +836 -1280
- package/dist/templates/generators/index.js.map +1 -1
- package/dist/templates/groups/index.cjs +837 -1272
- package/dist/templates/groups/index.cjs.map +1 -1
- package/dist/templates/groups/index.d.cts +1 -5
- package/dist/templates/groups/index.d.ts +1 -5
- package/dist/templates/groups/index.js +835 -1277
- package/dist/templates/groups/index.js.map +1 -1
- package/dist/templates/index.cjs +839 -1280
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +4 -7
- package/dist/templates/index.d.ts +4 -7
- package/dist/templates/index.js +836 -1281
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/modifiers/index.cjs +841 -1278
- package/dist/templates/modifiers/index.cjs.map +1 -1
- package/dist/templates/modifiers/index.d.cts +11 -38
- package/dist/templates/modifiers/index.d.ts +11 -38
- package/dist/templates/modifiers/index.js +838 -1281
- package/dist/templates/modifiers/index.js.map +1 -1
- package/dist/templates/output/index.cjs +839 -1274
- package/dist/templates/output/index.cjs.map +1 -1
- package/dist/templates/output/index.d.cts +4 -14
- package/dist/templates/output/index.d.ts +4 -14
- package/dist/templates/output/index.js +837 -1279
- package/dist/templates/output/index.js.map +1 -1
- package/dist/templates/selectors/index.cjs +839 -1274
- package/dist/templates/selectors/index.cjs.map +1 -1
- package/dist/templates/selectors/index.d.cts +3 -9
- package/dist/templates/selectors/index.d.ts +3 -9
- package/dist/templates/selectors/index.js +837 -1279
- package/dist/templates/selectors/index.js.map +1 -1
- package/dist/templates/transformers/index.cjs +839 -1274
- package/dist/templates/transformers/index.cjs.map +1 -1
- package/dist/templates/transformers/index.d.cts +3 -36
- package/dist/templates/transformers/index.d.ts +3 -36
- package/dist/templates/transformers/index.js +837 -1279
- package/dist/templates/transformers/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/handle-types-D-v5S53h.d.cts +0 -22
- package/dist/handle-types-D-v5S53h.d.ts +0 -22
- package/dist/layout/index.cjs +0 -164
- package/dist/layout/index.cjs.map +0 -1
- package/dist/layout/index.d.cts +0 -26
- package/dist/layout/index.d.ts +0 -26
- package/dist/layout/index.js +0 -136
- package/dist/layout/index.js.map +0 -1
- package/dist/properties-BxwtU6i9.d.cts +0 -9
- package/dist/properties-BxwtU6i9.d.ts +0 -9
|
@@ -32,45 +32,40 @@ var import_layout = require("@awesome-flow/core/layout");
|
|
|
32
32
|
var import_react = require("react");
|
|
33
33
|
var import_hooks = require("@awesome-flow/core/hooks");
|
|
34
34
|
var import_transformer = require("libnoise-ts/module/transformer");
|
|
35
|
-
var
|
|
35
|
+
var import_components = require("@awesome-flow/core/components");
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
function NoiseDisplaceNode({ id, selected, data, type }) {
|
|
38
38
|
const updateComputedData = (0, import_hooks.useUpdateNodeComputedData)();
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}, [id, updateComputedData, sourceModule, xModule, yModule, zModule]);
|
|
59
|
-
const { sourceColor, xColor, yColor, zColor } = (0, import_react.useMemo)(() => {
|
|
60
|
-
return {
|
|
61
|
-
sourceColor: sourceModule ? "green" : "orange",
|
|
62
|
-
xColor: xModule ? "green" : "orange",
|
|
63
|
-
yColor: yModule ? "green" : "orange",
|
|
64
|
-
zColor: zModule ? "green" : "orange"
|
|
65
|
-
};
|
|
66
|
-
}, [sourceModule, xModule, yModule, zModule]);
|
|
39
|
+
const onDataUpdated = (0, import_react.useCallback)(
|
|
40
|
+
(handleData) => {
|
|
41
|
+
const sourceModule = handleData["source" /* sourceModule */];
|
|
42
|
+
const xModule = handleData["x-module" /* xModule */];
|
|
43
|
+
const yModule = handleData["y-module" /* yModule */];
|
|
44
|
+
const zModule = handleData["z-module" /* zModule */];
|
|
45
|
+
if (sourceModule && xModule && yModule && zModule) {
|
|
46
|
+
const module2 = new import_transformer.Displace(
|
|
47
|
+
sourceModule[0].module,
|
|
48
|
+
xModule[0].module,
|
|
49
|
+
yModule[0].module,
|
|
50
|
+
zModule[0].module
|
|
51
|
+
);
|
|
52
|
+
updateComputedData(id, { module: module2 });
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
[]
|
|
56
|
+
);
|
|
67
57
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_layout.NodeContainer, { id, selected, data, type, children: [
|
|
68
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
import_components.HandlesIncomingDataStatus,
|
|
60
|
+
{
|
|
61
|
+
nodeId: id,
|
|
62
|
+
handles: data.handles,
|
|
63
|
+
handleKey: "dataId",
|
|
64
|
+
onDataUpdated,
|
|
65
|
+
type: "target",
|
|
66
|
+
resetComputedData: true
|
|
67
|
+
}
|
|
68
|
+
),
|
|
74
69
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
75
70
|
] });
|
|
76
71
|
}
|
|
@@ -80,7 +75,7 @@ var noise_displace_node_default = NoiseDisplaceNode;
|
|
|
80
75
|
var import_layout2 = require("@awesome-flow/core/layout");
|
|
81
76
|
var import_react2 = require("react");
|
|
82
77
|
var import_hooks2 = require("@awesome-flow/core/hooks");
|
|
83
|
-
var
|
|
78
|
+
var import_core = require("@mantine/core");
|
|
84
79
|
var import_transformer2 = require("libnoise-ts/module/transformer");
|
|
85
80
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
86
81
|
function NoiseRotatePointNode({
|
|
@@ -103,11 +98,11 @@ function NoiseRotatePointNode({
|
|
|
103
98
|
updateNodeData(id, { xAngle, yAngle, zAngle });
|
|
104
99
|
}, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
|
|
105
100
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_layout2.NodeContainer, { id, selected, data, type, children: [
|
|
106
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
107
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core.Stack, { children: [
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core.Group, { children: [
|
|
108
103
|
"X Angle:",
|
|
109
104
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
110
|
-
|
|
105
|
+
import_core.NumberInput,
|
|
111
106
|
{
|
|
112
107
|
size: "xs",
|
|
113
108
|
w: 100,
|
|
@@ -117,10 +112,10 @@ function NoiseRotatePointNode({
|
|
|
117
112
|
}
|
|
118
113
|
)
|
|
119
114
|
] }),
|
|
120
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core.Group, { children: [
|
|
121
116
|
"Y Angle:",
|
|
122
117
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
123
|
-
|
|
118
|
+
import_core.NumberInput,
|
|
124
119
|
{
|
|
125
120
|
size: "xs",
|
|
126
121
|
w: 100,
|
|
@@ -130,10 +125,10 @@ function NoiseRotatePointNode({
|
|
|
130
125
|
}
|
|
131
126
|
)
|
|
132
127
|
] }),
|
|
133
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core.Group, { children: [
|
|
134
129
|
"Z Angle:",
|
|
135
130
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
136
|
-
|
|
131
|
+
import_core.NumberInput,
|
|
137
132
|
{
|
|
138
133
|
size: "xs",
|
|
139
134
|
w: 100,
|
|
@@ -153,7 +148,7 @@ var noise_rotate_point_node_default = NoiseRotatePointNode;
|
|
|
153
148
|
var import_layout3 = require("@awesome-flow/core/layout");
|
|
154
149
|
var import_react3 = require("react");
|
|
155
150
|
var import_hooks3 = require("@awesome-flow/core/hooks");
|
|
156
|
-
var
|
|
151
|
+
var import_core2 = require("@mantine/core");
|
|
157
152
|
var import_transformer3 = require("libnoise-ts/module/transformer");
|
|
158
153
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
159
154
|
function NoiseScalePointNode({
|
|
@@ -176,11 +171,11 @@ function NoiseScalePointNode({
|
|
|
176
171
|
updateNodeData(id, { xScale, yScale, zScale });
|
|
177
172
|
}, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
|
|
178
173
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_layout3.NodeContainer, { id, selected, data, type, children: [
|
|
179
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
180
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core2.Stack, { children: [
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core2.Group, { children: [
|
|
181
176
|
"X Scale:",
|
|
182
177
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
183
|
-
|
|
178
|
+
import_core2.NumberInput,
|
|
184
179
|
{
|
|
185
180
|
size: "xs",
|
|
186
181
|
w: 100,
|
|
@@ -190,10 +185,10 @@ function NoiseScalePointNode({
|
|
|
190
185
|
}
|
|
191
186
|
)
|
|
192
187
|
] }),
|
|
193
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core2.Group, { children: [
|
|
194
189
|
"Y Scale:",
|
|
195
190
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
196
|
-
|
|
191
|
+
import_core2.NumberInput,
|
|
197
192
|
{
|
|
198
193
|
size: "xs",
|
|
199
194
|
w: 100,
|
|
@@ -203,10 +198,10 @@ function NoiseScalePointNode({
|
|
|
203
198
|
}
|
|
204
199
|
)
|
|
205
200
|
] }),
|
|
206
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core2.Group, { children: [
|
|
207
202
|
"Z Scale:",
|
|
208
203
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
209
|
-
|
|
204
|
+
import_core2.NumberInput,
|
|
210
205
|
{
|
|
211
206
|
size: "xs",
|
|
212
207
|
w: 100,
|
|
@@ -226,7 +221,7 @@ var noise_scale_point_node_default = NoiseScalePointNode;
|
|
|
226
221
|
var import_layout4 = require("@awesome-flow/core/layout");
|
|
227
222
|
var import_react4 = require("react");
|
|
228
223
|
var import_hooks4 = require("@awesome-flow/core/hooks");
|
|
229
|
-
var
|
|
224
|
+
var import_core3 = require("@mantine/core");
|
|
230
225
|
var import_transformer4 = require("libnoise-ts/module/transformer");
|
|
231
226
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
232
227
|
function NoiseTranslatePointNode({
|
|
@@ -249,11 +244,11 @@ function NoiseTranslatePointNode({
|
|
|
249
244
|
updateNodeData(id, { translateX, translateY, translateZ });
|
|
250
245
|
}, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
|
|
251
246
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_layout4.NodeContainer, { id, selected, data, type, children: [
|
|
252
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
253
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
247
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core3.Stack, { children: [
|
|
248
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core3.Group, { children: [
|
|
254
249
|
"Translate X:",
|
|
255
250
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
256
|
-
|
|
251
|
+
import_core3.NumberInput,
|
|
257
252
|
{
|
|
258
253
|
size: "xs",
|
|
259
254
|
w: 100,
|
|
@@ -263,10 +258,10 @@ function NoiseTranslatePointNode({
|
|
|
263
258
|
}
|
|
264
259
|
)
|
|
265
260
|
] }),
|
|
266
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core3.Group, { children: [
|
|
267
262
|
"Translate Y:",
|
|
268
263
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
269
|
-
|
|
264
|
+
import_core3.NumberInput,
|
|
270
265
|
{
|
|
271
266
|
size: "xs",
|
|
272
267
|
w: 100,
|
|
@@ -276,10 +271,10 @@ function NoiseTranslatePointNode({
|
|
|
276
271
|
}
|
|
277
272
|
)
|
|
278
273
|
] }),
|
|
279
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core3.Group, { children: [
|
|
280
275
|
"Translate Z:",
|
|
281
276
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
282
|
-
|
|
277
|
+
import_core3.NumberInput,
|
|
283
278
|
{
|
|
284
279
|
size: "xs",
|
|
285
280
|
w: 100,
|
|
@@ -297,159 +292,25 @@ var noise_translate_point_node_default = NoiseTranslatePointNode;
|
|
|
297
292
|
|
|
298
293
|
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
299
294
|
var import_layout5 = require("@awesome-flow/core/layout");
|
|
300
|
-
var import_react6 = require("react");
|
|
301
|
-
var import_hooks6 = require("@awesome-flow/core/hooks");
|
|
302
|
-
var import_transformer5 = require("libnoise-ts/module/transformer");
|
|
303
|
-
|
|
304
|
-
// src/layout/node-property-variables.tsx
|
|
305
|
-
var import_hooks5 = require("@awesome-flow/core/hooks");
|
|
306
295
|
var import_react5 = require("react");
|
|
307
|
-
var
|
|
308
|
-
var
|
|
309
|
-
var
|
|
310
|
-
|
|
311
|
-
// src/layout/node-value-input.tsx
|
|
312
|
-
var import_core5 = require("@mantine/core");
|
|
296
|
+
var import_hooks5 = require("@awesome-flow/core/hooks");
|
|
297
|
+
var import_transformer5 = require("libnoise-ts/module/transformer");
|
|
298
|
+
var import_components2 = require("@awesome-flow/core/components");
|
|
313
299
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
314
|
-
function NodeValueInput({ value, disabled, step, onChange }) {
|
|
315
|
-
if (value === void 0 || value === null) {
|
|
316
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, {});
|
|
317
|
-
}
|
|
318
|
-
switch (typeof value) {
|
|
319
|
-
case "boolean": {
|
|
320
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
321
|
-
import_core5.Switch,
|
|
322
|
-
{
|
|
323
|
-
checked: value,
|
|
324
|
-
disabled,
|
|
325
|
-
onChange: (e) => onChange(e.currentTarget.checked)
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
case "number": {
|
|
330
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core5.NumberInput, { value, disabled, step, onChange: (e) => onChange(e) });
|
|
331
|
-
}
|
|
332
|
-
case "string": {
|
|
333
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
334
|
-
import_core5.Input,
|
|
335
|
-
{
|
|
336
|
-
value,
|
|
337
|
-
disabled,
|
|
338
|
-
onChange: (e) => onChange(e.currentTarget.value)
|
|
339
|
-
}
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
default:
|
|
343
|
-
throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
var node_value_input_default = NodeValueInput;
|
|
347
|
-
|
|
348
|
-
// src/layout/node-property-input.tsx
|
|
349
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
350
|
-
function NodePropertyInput({ property, onChange }) {
|
|
351
|
-
if (!property) {
|
|
352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {});
|
|
353
|
-
}
|
|
354
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
355
|
-
node_value_input_default,
|
|
356
|
-
{
|
|
357
|
-
value: property.value,
|
|
358
|
-
disabled: property.disabled,
|
|
359
|
-
step: property.step,
|
|
360
|
-
onChange: (value) => onChange(property.name, value)
|
|
361
|
-
}
|
|
362
|
-
);
|
|
363
|
-
}
|
|
364
|
-
var node_property_input_default = NodePropertyInput;
|
|
365
|
-
|
|
366
|
-
// src/layout/node-property-variables.tsx
|
|
367
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
368
|
-
function NodePropertyVariables({
|
|
369
|
-
data,
|
|
370
|
-
nodeId,
|
|
371
|
-
onPropertiesChange,
|
|
372
|
-
except = import_abstract.nodeDataPropertyExcept
|
|
373
|
-
}) {
|
|
374
|
-
const [properties, setProperties] = (0, import_react5.useState)(() => {
|
|
375
|
-
const keys = (0, import_utils.getObjectKeys)(data, except);
|
|
376
|
-
const dataProps = {};
|
|
377
|
-
for (const key of keys) {
|
|
378
|
-
dataProps[key] = {
|
|
379
|
-
name: key,
|
|
380
|
-
value: data[key]
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
return dataProps;
|
|
384
|
-
});
|
|
385
|
-
const updateNodeData = (0, import_hooks5.useUpdateNodeData)();
|
|
386
|
-
const incoming = (0, import_hooks5.useIncomingNodeData)(nodeId);
|
|
387
|
-
const resetAllDisabled = (0, import_react5.useCallback)(() => {
|
|
388
|
-
const keys = Object.keys(properties);
|
|
389
|
-
keys.forEach((k) => {
|
|
390
|
-
properties[k].disabled = false;
|
|
391
|
-
});
|
|
392
|
-
setProperties(properties);
|
|
393
|
-
}, []);
|
|
394
|
-
const updatePropertyValue = (0, import_react5.useCallback)((name, value, disabled) => {
|
|
395
|
-
let property = properties[name];
|
|
396
|
-
if (property) {
|
|
397
|
-
property.value = value;
|
|
398
|
-
} else {
|
|
399
|
-
property = {
|
|
400
|
-
name,
|
|
401
|
-
value
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
property.disabled = disabled;
|
|
405
|
-
setProperties({ ...properties, [name]: property });
|
|
406
|
-
updateNodeData(nodeId, { [name]: value });
|
|
407
|
-
}, []);
|
|
408
|
-
(0, import_react5.useEffect)(() => {
|
|
409
|
-
resetAllDisabled();
|
|
410
|
-
if (incoming?.length) {
|
|
411
|
-
for (const connection of incoming) {
|
|
412
|
-
if (connection.property && properties[connection.property.name] !== void 0) {
|
|
413
|
-
updatePropertyValue(connection.property.name, connection.property.value, true);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}, [incoming]);
|
|
418
|
-
(0, import_react5.useEffect)(() => {
|
|
419
|
-
if (onPropertiesChange) {
|
|
420
|
-
onPropertiesChange(properties);
|
|
421
|
-
}
|
|
422
|
-
}, [onPropertiesChange, properties]);
|
|
423
|
-
const nodes = (0, import_react5.useMemo)(() => {
|
|
424
|
-
return Object.keys(properties).map((key) => {
|
|
425
|
-
const property = properties[key];
|
|
426
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.Group, { children: [
|
|
427
|
-
property.name,
|
|
428
|
-
":",
|
|
429
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(node_property_input_default, { property, onChange: updatePropertyValue })
|
|
430
|
-
] }, key);
|
|
431
|
-
});
|
|
432
|
-
}, [properties, updatePropertyValue]);
|
|
433
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.Stack, { children: nodes });
|
|
434
|
-
}
|
|
435
|
-
var node_property_variables_default = NodePropertyVariables;
|
|
436
|
-
|
|
437
|
-
// src/nodes/transformers/noise-turbulence-node .tsx
|
|
438
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
439
300
|
function NoiseTurbulenceNode({
|
|
440
301
|
id,
|
|
441
302
|
selected,
|
|
442
303
|
data,
|
|
443
304
|
type
|
|
444
305
|
}) {
|
|
445
|
-
const [properties, setProperties] = (0,
|
|
446
|
-
const incoming = (0,
|
|
447
|
-
const updateComputedData = (0,
|
|
448
|
-
const onPropertiesChange = (0,
|
|
306
|
+
const [properties, setProperties] = (0, import_react5.useState)(null);
|
|
307
|
+
const incoming = (0, import_hooks5.useIncomingComputedData)(id);
|
|
308
|
+
const updateComputedData = (0, import_hooks5.useUpdateNodeComputedData)();
|
|
309
|
+
const onPropertiesChange = (0, import_react5.useCallback)((props) => {
|
|
449
310
|
setProperties(props);
|
|
450
311
|
}, []);
|
|
451
|
-
(0,
|
|
452
|
-
if (incoming?.length) {
|
|
312
|
+
(0, import_react5.useEffect)(() => {
|
|
313
|
+
if (incoming?.length && properties) {
|
|
453
314
|
const module2 = new import_transformer5.Turbulence(
|
|
454
315
|
incoming[0].module,
|
|
455
316
|
properties.frequency.value,
|
|
@@ -459,10 +320,10 @@ function NoiseTurbulenceNode({
|
|
|
459
320
|
);
|
|
460
321
|
updateComputedData(id, { module: module2 });
|
|
461
322
|
}
|
|
462
|
-
}, [id, incoming, properties
|
|
463
|
-
return /* @__PURE__ */ (0,
|
|
464
|
-
/* @__PURE__ */ (0,
|
|
465
|
-
/* @__PURE__ */ (0,
|
|
323
|
+
}, [id, incoming, properties]);
|
|
324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_layout5.NodeContainer, { id, selected, data, type, children: [
|
|
325
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components2.NodePropertyVariables, { data, nodeId: id, onPropertiesChange }),
|
|
326
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_layout5.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
466
327
|
] });
|
|
467
328
|
}
|
|
468
329
|
var noise_turbulence_node_default = NoiseTurbulenceNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/nodes/transformers/index.ts","../../../src/nodes/transformers/noise-displace-node.tsx","../../../src/nodes/transformers/noise-rotate-point-node.tsx","../../../src/nodes/transformers/noise-scale-point-node.tsx","../../../src/nodes/transformers/noise-translate-point-node.tsx","../../../src/nodes/transformers/noise-turbulence-node .tsx","../../../src/layout/node-property-variables.tsx","../../../src/layout/node-value-input.tsx","../../../src/layout/node-property-input.tsx"],"sourcesContent":["export { default as NoiseDisplaceNode } from './noise-displace-node';\nexport { default as NoiseRotatePointNode } from './noise-rotate-point-node';\nexport { default as NoiseScalePointNode } from './noise-scale-point-node';\nexport { default as NoiseTranslatePointNode } from './noise-translate-point-node';\nexport { default as NoiseTurbulenceNode } from './noise-turbulence-node ';\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useMemo } from 'react';\nimport { useIncomingHandleData, useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Displace } from 'libnoise-ts/module/transformer';\nimport { Badge, Stack } from '@mantine/core';\nimport { ComputedModuleData, NodeDisplaceNoiseData } from '../../abstract/node-props';\nimport { DisplacementModule } from '../../abstract/handle-types';\n\nfunction NoiseDisplaceNode({ id, selected, data, type }: NodeProps<Node<NodeDisplaceNoiseData>>) {\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n const incomingHandleData = useIncomingHandleData<ComputedModuleData>(id, data.handles);\n\n const { sourceModule, xModule, yModule, zModule } = useMemo(() => {\n return {\n sourceModule: incomingHandleData[DisplacementModule.sourceModule],\n xModule: incomingHandleData[DisplacementModule.xModule],\n yModule: incomingHandleData[DisplacementModule.yModule],\n zModule: incomingHandleData[DisplacementModule.zModule],\n };\n }, [incomingHandleData]);\n\n useEffect(() => {\n if (sourceModule && xModule && yModule && zModule) {\n const module = new Displace(\n sourceModule[0].module,\n xModule[0].module,\n yModule[0].module,\n zModule[0].module\n );\n\n updateComputedData(id, { module });\n }\n }, [id, updateComputedData, sourceModule, xModule, yModule, zModule]);\n\n const { sourceColor, xColor, yColor, zColor } = useMemo(() => {\n return {\n sourceColor: sourceModule ? 'green' : 'orange',\n xColor: xModule ? 'green' : 'orange',\n yColor: yModule ? 'green' : 'orange',\n zColor: zModule ? 'green' : 'orange',\n };\n }, [sourceModule, xModule, yModule, zModule]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack align=\"center\">\n <Badge color={sourceColor}>Source Module</Badge>\n <Badge color={xColor}>X Module</Badge>\n <Badge color={yColor}>Y Module</Badge>\n <Badge color={zColor}>Z Module</Badge>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseDisplaceNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { RotatePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeRotatePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseRotatePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeRotatePointNoiseData>>) {\n const [xAngle, setXAngle] = useState(data.xAngle);\n const [yAngle, setYAngle] = useState(data.yAngle);\n const [zAngle, setZAngle] = useState(data.zAngle);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeRotatePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { xAngle, yAngle, zAngle });\n }, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n X Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={xAngle}\n onChange={(e) => setXAngle(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Y Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={yAngle}\n onChange={(e) => setYAngle(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Z Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={zAngle}\n onChange={(e) => setZAngle(Number(e))}\n step={0.01}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseRotatePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { ScalePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeScalePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseScalePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeScalePointNoiseData>>) {\n const [xScale, setXScale] = useState(data.xScale);\n const [yScale, setYScale] = useState(data.yScale);\n const [zScale, setZScale] = useState(data.zScale);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeScalePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { xScale, yScale, zScale });\n }, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n X Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={xScale}\n onChange={(e) => setXScale(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Y Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={yScale}\n onChange={(e) => setYScale(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Z Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={zScale}\n onChange={(e) => setZScale(Number(e))}\n step={0.01}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseScalePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { TranslatePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeTranslatePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseTranslatePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeTranslatePointNoiseData>>) {\n const [translateX, setTranslateX] = useState(data.translateX);\n const [translateY, setTranslateY] = useState(data.translateY);\n const [translateZ, setTranslateZ] = useState(data.translateZ);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeTranslatePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { translateX, translateY, translateZ });\n }, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n Translate X:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateX}\n onChange={(e) => setTranslateX(Number(e))}\n step={1}\n />\n </Group>\n <Group>\n Translate Y:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateY}\n onChange={(e) => setTranslateY(Number(e))}\n step={1}\n />\n </Group>\n <Group>\n Translate Z:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateZ}\n onChange={(e) => setTranslateZ(Number(e))}\n step={1}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTranslatePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useCallback, useEffect, useState } from 'react';\nimport { useIncomingComputedData, useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Turbulence } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeTurbulenceNoiseData } from '../../abstract/node-props';\nimport { PropertyValue } from '../../abstract/properties';\nimport NodePropertyVariables from '../../layout/node-property-variables';\n\nfunction NoiseTurbulenceNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeTurbulenceNoiseData>>) {\n const [properties, setProperties] = useState(null);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const onPropertiesChange = useCallback((props: Record<string, PropertyValue<number>>) => {\n setProperties(props);\n }, []);\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new Turbulence(\n incoming[0].module,\n properties.frequency.value,\n properties.power.value,\n properties.roughness.value,\n properties.seed.value\n );\n updateComputedData(id, { module });\n }\n }, [id, incoming, properties, updateComputedData]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <NodePropertyVariables data={data} nodeId={id} onPropertiesChange={onPropertiesChange} />\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTurbulenceNode;\n","import { useIncomingNodeData, useUpdateNodeData } from '@awesome-flow/core/hooks';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { Group, Stack } from '@mantine/core';\nimport { getObjectKeys } from '@awesome-flow/core/utils';\nimport { nodeDataPropertyExcept } from '@awesome-flow/core/abstract';\nimport { NodeVariablePropertyData } from '../abstract/node-props';\nimport { PropertyValue, ValueType } from '../abstract/properties';\nimport NodePropertyInput from './node-property-input';\n\nexport type NodeTrackVariablesProps = {\n nodeId: string;\n data: Record<string, any>;\n except?: Set<string>;\n onPropertiesChange?: (properties: Record<string, PropertyValue>) => void;\n};\n\nfunction NodePropertyVariables({\n data,\n nodeId,\n onPropertiesChange,\n except = nodeDataPropertyExcept,\n}: Readonly<NodeTrackVariablesProps>) {\n const [properties, setProperties] = useState<Record<string, PropertyValue>>(() => {\n const keys = getObjectKeys(data, except);\n\n const dataProps = {};\n\n for (const key of keys) {\n dataProps[key] = {\n name: key,\n value: data[key],\n } satisfies PropertyValue;\n }\n\n return dataProps;\n });\n\n const updateNodeData = useUpdateNodeData();\n const incoming = useIncomingNodeData<NodeVariablePropertyData>(nodeId);\n\n const resetAllDisabled = useCallback(() => {\n const keys = Object.keys(properties);\n\n keys.forEach((k) => {\n properties[k].disabled = false;\n });\n\n setProperties(properties);\n }, []);\n\n const updatePropertyValue = useCallback((name: string, value: ValueType, disabled?: boolean) => {\n let property = properties[name];\n\n if (property) {\n property.value = value;\n } else {\n property = {\n name,\n value,\n };\n }\n\n property.disabled = disabled;\n\n setProperties({ ...properties, [name]: property });\n updateNodeData(nodeId, { [name]: value });\n }, []);\n\n useEffect(() => {\n resetAllDisabled();\n\n if (incoming?.length) {\n for (const connection of incoming) {\n if (connection.property && properties[connection.property.name] !== undefined) {\n updatePropertyValue(connection.property.name, connection.property.value, true);\n }\n }\n }\n }, [incoming]);\n\n useEffect(() => {\n if (onPropertiesChange) {\n onPropertiesChange(properties);\n }\n }, [onPropertiesChange, properties]);\n\n const nodes = useMemo(() => {\n return Object.keys(properties).map((key) => {\n const property = properties[key];\n\n return (\n <Group key={key}>\n {property.name}:<NodePropertyInput property={property} onChange={updatePropertyValue} />\n </Group>\n );\n });\n }, [properties, updatePropertyValue]);\n\n return <Stack>{nodes}</Stack>;\n}\n\nexport default NodePropertyVariables;\n","import { Input, NumberInput, Switch } from '@mantine/core';\nimport { ValueType } from '../abstract/properties';\n\nexport type NodeValueInputProps = {\n value: ValueType;\n disabled?: boolean;\n step?: number;\n onChange: (value: ValueType) => void;\n};\n\nfunction NodeValueInput({ value, disabled, step, onChange }: Readonly<NodeValueInputProps>) {\n if (value === undefined || value === null) {\n return <></>;\n }\n\n switch (typeof value) {\n case 'boolean': {\n return (\n <Switch\n checked={value}\n disabled={disabled}\n onChange={(e) => onChange(e.currentTarget.checked)}\n />\n );\n }\n\n case 'number': {\n return (\n <NumberInput value={value} disabled={disabled} step={step} onChange={(e) => onChange(e)} />\n );\n }\n\n case 'string': {\n return (\n <Input\n value={value}\n disabled={disabled}\n onChange={(e) => onChange(e.currentTarget.value)}\n />\n );\n }\n\n default:\n throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);\n }\n}\n\nexport default NodeValueInput;\n","import { ValueType, PropertyValue } from '../abstract/properties';\nimport NodeValueInput from './node-value-input';\n\nexport type NodePropertyInputProps = {\n property: PropertyValue;\n onChange: (name: string, value: ValueType) => void;\n};\n\nfunction NodePropertyInput({ property, onChange }: Readonly<NodePropertyInputProps>) {\n if (!property) {\n return <></>;\n }\n\n return (\n <NodeValueInput\n value={property.value}\n disabled={property.disabled}\n step={property.step}\n onChange={(value) => onChange(property.name, value)}\n />\n );\n}\n\nexport default NodePropertyInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAAoD;AAEpD,mBAAmC;AACnC,mBAAiE;AACjE,yBAAyB;AACzB,kBAA6B;AAyCvB;AArCN,SAAS,kBAAkB,EAAE,IAAI,UAAU,MAAM,KAAK,GAA2C;AAC/F,QAAM,yBAAqB,wCAA8C;AACzE,QAAM,yBAAqB,oCAA0C,IAAI,KAAK,OAAO;AAErF,QAAM,EAAE,cAAc,SAAS,SAAS,QAAQ,QAAI,sBAAQ,MAAM;AAChE,WAAO;AAAA,MACL,cAAc,8CAAkD;AAAA,MAChE,SAAS,2CAA6C;AAAA,MACtD,SAAS,2CAA6C;AAAA,MACtD,SAAS,2CAA6C;AAAA,IACxD;AAAA,EACF,GAAG,CAAC,kBAAkB,CAAC;AAEvB,8BAAU,MAAM;AACd,QAAI,gBAAgB,WAAW,WAAW,SAAS;AACjD,YAAMA,UAAS,IAAI;AAAA,QACjB,aAAa,CAAC,EAAE;AAAA,QAChB,QAAQ,CAAC,EAAE;AAAA,QACX,QAAQ,CAAC,EAAE;AAAA,QACX,QAAQ,CAAC,EAAE;AAAA,MACb;AAEA,yBAAmB,IAAI,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7BJ,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA6C;AAC3C,QAAM,CAAC,YAAY,aAAa,QAAI,wBAAS,IAAI;AAEjD,QAAM,eAAW,uCAA4C,EAAE;AAC/D,QAAM,yBAAqB,yCAA8C;AAEzE,QAAM,yBAAqB,2BAAY,CAAC,UAAiD;AACvF,kBAAc,KAAK;AAAA,EACrB,GAAG,CAAC,CAAC;AAEL,+BAAU,MAAM;AACd,QAAI,UAAU,QAAQ;AACpB,YAAMC,UAAS,IAAI;AAAA,QACjB,SAAS,CAAC,EAAE;AAAA,QACZ,WAAW,UAAU;AAAA,QACrB,WAAW,MAAM;AAAA,QACjB,WAAW,UAAU;AAAA,QACrB,WAAW,KAAK;AAAA,MAClB;AACA,yBAAmB,IAAI,EAAE,QAAAA,QAAO,CAAC;AAAA,IACnC;AAAA,EACF,GAAG,CAAC,IAAI,UAAU,YAAY,kBAAkB,CAAC;AAEjD,SACE,8CAAC,gCAAc,IAAQ,UAAoB,MAAY,MACrD;AAAA,iDAAC,mCAAsB,MAAY,QAAQ,IAAI,oBAAwC;AAAA,IACvF,6CAAC,uCAAqB,SAAS,KAAK,SAAS,QAAQ,IAAI,MAAK,UAAS;AAAA,KACzE;AAEJ;AAEA,IAAO,gCAAQ;","names":["module","import_layout","import_react","import_hooks","import_core","import_transformer","import_jsx_runtime","module","import_layout","import_react","import_hooks","import_core","import_transformer","import_jsx_runtime","module","import_layout","import_react","import_hooks","import_core","import_transformer","import_jsx_runtime","module","import_layout","import_react","import_hooks","import_transformer","import_hooks","import_react","import_core","import_core","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","module"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/nodes/transformers/index.ts","../../../src/nodes/transformers/noise-displace-node.tsx","../../../src/nodes/transformers/noise-rotate-point-node.tsx","../../../src/nodes/transformers/noise-scale-point-node.tsx","../../../src/nodes/transformers/noise-translate-point-node.tsx","../../../src/nodes/transformers/noise-turbulence-node .tsx"],"sourcesContent":["export { default as NoiseDisplaceNode } from './noise-displace-node';\nexport { default as NoiseRotatePointNode } from './noise-rotate-point-node';\nexport { default as NoiseScalePointNode } from './noise-scale-point-node';\nexport { default as NoiseTranslatePointNode } from './noise-translate-point-node';\nexport { default as NoiseTurbulenceNode } from './noise-turbulence-node ';\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useCallback } from 'react';\nimport { useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Displace } from 'libnoise-ts/module/transformer';\nimport { HandlesIncomingDataStatus } from '@awesome-flow/core/components';\nimport { BasicNodeData } from '@awesome-flow/core/abstract';\nimport { ComputedModuleData } from '../../abstract/node-props';\nimport { DisplacementHandle } from '../../abstract/handle-types';\n\nfunction NoiseDisplaceNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>) {\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const onDataUpdated = useCallback(\n (handleData: Record<DisplacementHandle, ComputedModuleData>) => {\n const sourceModule = handleData[DisplacementHandle.sourceModule];\n const xModule = handleData[DisplacementHandle.xModule];\n const yModule = handleData[DisplacementHandle.yModule];\n const zModule = handleData[DisplacementHandle.zModule];\n\n if (sourceModule && xModule && yModule && zModule) {\n const module = new Displace(\n sourceModule[0].module,\n xModule[0].module,\n yModule[0].module,\n zModule[0].module\n );\n\n updateComputedData(id, { module });\n }\n },\n []\n );\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <HandlesIncomingDataStatus\n nodeId={id}\n handles={data.handles}\n handleKey=\"dataId\"\n onDataUpdated={onDataUpdated}\n type=\"target\"\n resetComputedData\n />\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseDisplaceNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { RotatePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeRotatePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseRotatePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeRotatePointNoiseData>>) {\n const [xAngle, setXAngle] = useState(data.xAngle);\n const [yAngle, setYAngle] = useState(data.yAngle);\n const [zAngle, setZAngle] = useState(data.zAngle);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeRotatePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { xAngle, yAngle, zAngle });\n }, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n X Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={xAngle}\n onChange={(e) => setXAngle(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Y Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={yAngle}\n onChange={(e) => setYAngle(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Z Angle:\n <NumberInput\n size=\"xs\"\n w={100}\n value={zAngle}\n onChange={(e) => setZAngle(Number(e))}\n step={0.01}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseRotatePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { ScalePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeScalePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseScalePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeScalePointNoiseData>>) {\n const [xScale, setXScale] = useState(data.xScale);\n const [yScale, setYScale] = useState(data.yScale);\n const [zScale, setZScale] = useState(data.zScale);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeScalePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { xScale, yScale, zScale });\n }, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n X Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={xScale}\n onChange={(e) => setXScale(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Y Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={yScale}\n onChange={(e) => setYScale(Number(e))}\n step={0.01}\n />\n </Group>\n <Group>\n Z Scale:\n <NumberInput\n size=\"xs\"\n w={100}\n value={zScale}\n onChange={(e) => setZScale(Number(e))}\n step={0.01}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseScalePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useEffect, useState } from 'react';\nimport {\n useIncomingComputedData,\n useUpdateNodeComputedData,\n useUpdateNodeData,\n} from '@awesome-flow/core/hooks';\nimport { Group, NumberInput, Stack } from '@mantine/core';\nimport { TranslatePoint } from 'libnoise-ts/module/transformer';\nimport { ComputedModuleData, NodeTranslatePointNoiseData } from '../../abstract/node-props';\n\nfunction NoiseTranslatePointNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeTranslatePointNoiseData>>) {\n const [translateX, setTranslateX] = useState(data.translateX);\n const [translateY, setTranslateY] = useState(data.translateY);\n const [translateZ, setTranslateZ] = useState(data.translateZ);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n\n const updateNodeData = useUpdateNodeData<NodeTranslatePointNoiseData>();\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n useEffect(() => {\n if (incoming?.length) {\n const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);\n updateComputedData(id, { module });\n }\n\n updateNodeData(id, { translateX, translateY, translateZ });\n }, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <Stack>\n <Group>\n Translate X:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateX}\n onChange={(e) => setTranslateX(Number(e))}\n step={1}\n />\n </Group>\n <Group>\n Translate Y:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateY}\n onChange={(e) => setTranslateY(Number(e))}\n step={1}\n />\n </Group>\n <Group>\n Translate Z:\n <NumberInput\n size=\"xs\"\n w={100}\n value={translateZ}\n onChange={(e) => setTranslateZ(Number(e))}\n step={1}\n />\n </Group>\n </Stack>\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTranslatePointNode;\n","import { NodeContainer, NodeTrackConnections } from '@awesome-flow/core/layout';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useCallback, useEffect, useState } from 'react';\nimport { useIncomingComputedData, useUpdateNodeComputedData } from '@awesome-flow/core/hooks';\nimport { Turbulence } from 'libnoise-ts/module/transformer';\nimport { PropertyValue } from '@awesome-flow/core/abstract';\nimport { NodePropertyVariables } from '@awesome-flow/core/components';\nimport { ComputedModuleData, NodeTurbulenceNoiseData } from '../../abstract/node-props';\n\nfunction NoiseTurbulenceNode({\n id,\n selected,\n data,\n type,\n}: NodeProps<Node<NodeTurbulenceNoiseData>>) {\n const [properties, setProperties] = useState(null);\n\n const incoming = useIncomingComputedData<ComputedModuleData>(id);\n const updateComputedData = useUpdateNodeComputedData<ComputedModuleData>();\n\n const onPropertiesChange = useCallback((props: Record<string, PropertyValue<number>>) => {\n setProperties(props);\n }, []);\n\n useEffect(() => {\n if (incoming?.length && properties) {\n const module = new Turbulence(\n incoming[0].module,\n properties.frequency.value,\n properties.power.value,\n properties.roughness.value,\n properties.seed.value\n );\n updateComputedData(id, { module });\n }\n }, [id, incoming, properties]);\n\n return (\n <NodeContainer id={id} selected={selected} data={data} type={type}>\n <NodePropertyVariables data={data} nodeId={id} onPropertiesChange={onPropertiesChange} />\n <NodeTrackConnections handles={data.handles} nodeId={id} type=\"target\" />\n </NodeContainer>\n );\n}\n\nexport default NoiseTurbulenceNode;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAAoD;AAEpD,mBAA4B;AAC5B,mBAA0C;AAC1C,yBAAyB;AACzB,wBAA0C;AA8BtC;AAzBJ,SAAS,kBAAkB,EAAE,IAAI,UAAU,MAAM,KAAK,GAAmC;AACvF,QAAM,yBAAqB,wCAA8C;AAEzE,QAAM,oBAAgB;AAAA,IACpB,CAAC,eAA+D;AAC9D,YAAM,eAAe,sCAA0C;AAC/D,YAAM,UAAU,mCAAqC;AACrD,YAAM,UAAU,mCAAqC;AACrD,YAAM,UAAU,mCAAqC;AAErD,UAAI,gBAAgB,WAAW,WAAW,SAAS;AACjD,cAAMA,UAAS,IAAI;AAAA,UACjB,aAAa,CAAC,EAAE;AAAA,UAChB,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CAAC,uCAAqB,SAAS,KAAK,SAAS,QAAQ,IAAI,MAAK,UAAS;AAAA,KACzE;AAEJ;AAEA,IAAO,gCAAQ;","names":["module","import_layout","import_react","import_hooks","import_transformer","import_jsx_runtime","module","import_layout","import_react","import_hooks","import_core","import_transformer","import_jsx_runtime","module","import_layout","import_react","import_hooks","import_core","import_transformer","import_jsx_runtime","module","import_layout","import_react","import_hooks","import_transformer","import_components","import_jsx_runtime","module"]}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { NodeProps, Node } from '@xyflow/react';
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
3
|
+
import { BasicNodeData } from '@awesome-flow/core/abstract';
|
|
4
|
+
import { u as NodeRotatePointNoiseData, v as NodeScalePointNoiseData, w as NodeTranslatePointNoiseData, x as NodeTurbulenceNoiseData } from '../../node-props-BbqbXDXn.cjs';
|
|
5
5
|
import 'libnoise-ts/module/generator';
|
|
6
6
|
import 'libnoise-ts/noisegen';
|
|
7
7
|
import 'libnoise-ts/module/Module';
|
|
8
|
-
import '../../handle-types-D-v5S53h.cjs';
|
|
9
8
|
import 'libnoise-ts/module/combiner';
|
|
10
|
-
import '../../properties-BxwtU6i9.cjs';
|
|
11
9
|
|
|
12
|
-
declare function NoiseDisplaceNode({ id, selected, data, type }: NodeProps<Node<
|
|
10
|
+
declare function NoiseDisplaceNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>): react_jsx_runtime.JSX.Element;
|
|
13
11
|
|
|
14
12
|
declare function NoiseRotatePointNode({ id, selected, data, type, }: NodeProps<Node<NodeRotatePointNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
15
13
|
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { NodeProps, Node } from '@xyflow/react';
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
3
|
+
import { BasicNodeData } from '@awesome-flow/core/abstract';
|
|
4
|
+
import { u as NodeRotatePointNoiseData, v as NodeScalePointNoiseData, w as NodeTranslatePointNoiseData, x as NodeTurbulenceNoiseData } from '../../node-props-BbqbXDXn.js';
|
|
5
5
|
import 'libnoise-ts/module/generator';
|
|
6
6
|
import 'libnoise-ts/noisegen';
|
|
7
7
|
import 'libnoise-ts/module/Module';
|
|
8
|
-
import '../../handle-types-D-v5S53h.js';
|
|
9
8
|
import 'libnoise-ts/module/combiner';
|
|
10
|
-
import '../../properties-BxwtU6i9.js';
|
|
11
9
|
|
|
12
|
-
declare function NoiseDisplaceNode({ id, selected, data, type }: NodeProps<Node<
|
|
10
|
+
declare function NoiseDisplaceNode({ id, selected, data, type }: NodeProps<Node<BasicNodeData>>): react_jsx_runtime.JSX.Element;
|
|
13
11
|
|
|
14
12
|
declare function NoiseRotatePointNode({ id, selected, data, type, }: NodeProps<Node<NodeRotatePointNoiseData>>): react_jsx_runtime.JSX.Element;
|
|
15
13
|
|