@awesome-flow/noise 0.9.0 → 0.9.2
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 +6 -6
- package/dist/abstract/index.d.cts +10 -8
- package/dist/abstract/index.d.ts +10 -8
- package/dist/abstract/index.js +5 -5
- package/dist/chunk-36USJJC4.cjs +576 -0
- package/dist/chunk-DQE5NXY7.cjs +911 -0
- package/dist/chunk-FMJZTXJQ.js +576 -0
- package/dist/chunk-LKDSXT7I.cjs +896 -0
- package/dist/chunk-M26CSOHC.js +911 -0
- package/dist/chunk-NUA3VGOA.js +896 -0
- package/dist/{chunk-ACWBUUZ7.cjs → chunk-OLJKWO2H.cjs} +419 -204
- package/dist/chunk-R6TU3SBX.js +49 -0
- package/dist/{chunk-BG6U3TYO.js → chunk-W4T6Q7A5.js} +411 -196
- package/dist/chunk-XC7VF5YC.cjs +49 -0
- package/dist/{index-mlK0X4O1.d.ts → index-BZr1EROK.d.cts} +2 -2
- package/dist/{index-CfiOpOzX.d.cts → index-DzD3jbPF.d.ts} +2 -2
- package/dist/{node-props-CAV2WNDN.d.ts → node-props-D8SnrgWa.d.cts} +1 -1
- package/dist/{node-props-CAV2WNDN.d.cts → node-props-D8SnrgWa.d.ts} +1 -1
- package/dist/nodes/generators/index.cjs +2 -2
- package/dist/nodes/generators/index.d.cts +1 -1
- package/dist/nodes/generators/index.d.ts +1 -1
- package/dist/nodes/generators/index.js +1 -1
- package/dist/nodes/groups/index.cjs +2 -2
- package/dist/nodes/groups/index.d.cts +1 -1
- package/dist/nodes/groups/index.d.ts +1 -1
- package/dist/nodes/groups/index.js +1 -1
- package/dist/nodes/index.cjs +6 -6
- package/dist/nodes/index.d.cts +4 -2
- package/dist/nodes/index.d.ts +4 -2
- package/dist/nodes/index.js +5 -5
- package/dist/nodes/modifiers/index.cjs +2 -2
- package/dist/nodes/modifiers/index.d.cts +6 -19
- package/dist/nodes/modifiers/index.d.ts +6 -19
- package/dist/nodes/modifiers/index.js +1 -1
- package/dist/nodes/output/index.cjs +6 -6
- package/dist/nodes/output/index.js +5 -5
- package/dist/nodes/selectors/index.cjs +6 -6
- package/dist/nodes/selectors/index.d.cts +1 -1
- package/dist/nodes/selectors/index.d.ts +1 -1
- package/dist/nodes/selectors/index.js +5 -5
- package/dist/nodes/transformers/index.cjs +2 -2
- package/dist/nodes/transformers/index.d.cts +1 -1
- package/dist/nodes/transformers/index.d.ts +1 -1
- package/dist/nodes/transformers/index.js +1 -1
- package/dist/noise-terrace-node-D2ezdTnC.d.cts +22 -0
- package/dist/noise-terrace-node-DW81ZQk6.d.ts +22 -0
- package/dist/templates/generators/index.cjs +6 -6
- package/dist/templates/generators/index.d.cts +1 -1
- package/dist/templates/generators/index.d.ts +1 -1
- package/dist/templates/generators/index.js +5 -5
- package/dist/templates/groups/index.cjs +6 -6
- package/dist/templates/groups/index.js +5 -5
- package/dist/templates/index.cjs +6 -6
- package/dist/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- package/dist/templates/index.js +5 -5
- package/dist/templates/modifiers/index.cjs +6 -6
- package/dist/templates/modifiers/index.d.cts +1 -1
- package/dist/templates/modifiers/index.d.ts +1 -1
- package/dist/templates/modifiers/index.js +5 -5
- package/dist/templates/output/index.cjs +6 -6
- package/dist/templates/output/index.js +5 -5
- package/dist/templates/selectors/index.cjs +6 -6
- package/dist/templates/selectors/index.d.cts +1 -1
- package/dist/templates/selectors/index.d.ts +1 -1
- package/dist/templates/selectors/index.js +5 -5
- package/dist/templates/transformers/index.cjs +6 -6
- package/dist/templates/transformers/index.d.cts +2 -2
- package/dist/templates/transformers/index.d.ts +2 -2
- package/dist/templates/transformers/index.js +5 -5
- package/package.json +13 -12
- package/dist/chunk-D5JM4EYQ.cjs +0 -305
- package/dist/chunk-DWSACR65.js +0 -305
- package/dist/chunk-KHIIB5TH.js +0 -93
- package/dist/chunk-M67JHEU2.cjs +0 -93
- package/dist/chunk-PS5VUND5.js +0 -348
- package/dist/chunk-RDQ4BOOV.js +0 -522
- package/dist/chunk-RKTZQUWR.cjs +0 -348
- package/dist/chunk-TZCT2GZV.cjs +0 -522
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
noise_scale_point_node_default,
|
|
5
5
|
noise_translate_point_node_default,
|
|
6
6
|
noise_turbulence_node_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FMJZTXJQ.js";
|
|
8
8
|
import {
|
|
9
9
|
noise_billow_node_default,
|
|
10
10
|
noise_checkerboard_node_default,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
noise_voronoi_node_default,
|
|
17
17
|
position_const_node_default,
|
|
18
18
|
position_grid_node_default
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NUA3VGOA.js";
|
|
20
20
|
import {
|
|
21
21
|
module_group_node_default
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-R6TU3SBX.js";
|
|
23
23
|
import {
|
|
24
24
|
noise_abs_node_default,
|
|
25
25
|
noise_clamp_node_default,
|
|
@@ -30,15 +30,20 @@ import {
|
|
|
30
30
|
noise_normalize_node_default,
|
|
31
31
|
noise_scale_bias_node_default,
|
|
32
32
|
noise_terrace_node_default
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-M26CSOHC.js";
|
|
34
34
|
|
|
35
35
|
// src/nodes/output/noise-logger-node.tsx
|
|
36
36
|
import { useIncomingComputedData } from "@awesome-flow/core/hooks";
|
|
37
|
-
import { NodeContainer
|
|
37
|
+
import { NodeContainer } from "@awesome-flow/core/layout";
|
|
38
38
|
import { Divider, Stack, Text } from "@mantine/core";
|
|
39
39
|
import { useMemo } from "react";
|
|
40
40
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
41
|
-
function NoiseLoggerNode({
|
|
41
|
+
function NoiseLoggerNode({
|
|
42
|
+
id,
|
|
43
|
+
selected,
|
|
44
|
+
data,
|
|
45
|
+
type
|
|
46
|
+
}) {
|
|
42
47
|
const incoming = useIncomingComputedData(id);
|
|
43
48
|
const noise = useMemo(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
44
49
|
return /* @__PURE__ */ jsxs(NodeContainer, { id, selected, data, type, children: [
|
|
@@ -55,231 +60,408 @@ function NoiseLoggerNode({ id, selected, data, type }) {
|
|
|
55
60
|
v.position?.z,
|
|
56
61
|
": ",
|
|
57
62
|
v.value
|
|
58
|
-
] }, i)) })
|
|
59
|
-
/* @__PURE__ */ jsx(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
|
|
63
|
+
] }, i)) })
|
|
60
64
|
] });
|
|
61
65
|
}
|
|
62
66
|
var noise_logger_node_default = NoiseLoggerNode;
|
|
63
67
|
|
|
64
68
|
// src/nodes/output/noise-output-node.tsx
|
|
69
|
+
import { c as _c4 } from "react/compiler-runtime";
|
|
65
70
|
import { HandlesIncomingDataStatus as HandlesIncomingDataStatus3 } from "@awesome-flow/core/components";
|
|
66
71
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData4 } from "@awesome-flow/core/hooks";
|
|
67
|
-
import { NodeContainer as NodeContainer6
|
|
72
|
+
import { NodeContainer as NodeContainer6 } from "@awesome-flow/core/layout";
|
|
68
73
|
import { Text as Text3 } from "@mantine/core";
|
|
69
|
-
import {
|
|
74
|
+
import { useState as useState3 } from "react";
|
|
70
75
|
|
|
71
76
|
// src/nodes/selectors/noise-blend-node.tsx
|
|
77
|
+
import { c as _c } from "react/compiler-runtime";
|
|
72
78
|
import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
|
|
73
79
|
import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
|
|
74
|
-
import { NodeContainer as NodeContainer2
|
|
80
|
+
import { NodeContainer as NodeContainer2 } from "@awesome-flow/core/layout";
|
|
75
81
|
import { Blend } from "libnoise-simplex-ts";
|
|
76
|
-
import {
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
83
|
+
function NoiseBlendNode(t0) {
|
|
84
|
+
const $ = _c(13);
|
|
85
|
+
const {
|
|
86
|
+
id,
|
|
87
|
+
selected,
|
|
88
|
+
data,
|
|
89
|
+
type
|
|
90
|
+
} = t0;
|
|
79
91
|
const updateComputedData = useUpdateNodeComputedData();
|
|
80
|
-
|
|
81
|
-
|
|
92
|
+
let t1;
|
|
93
|
+
if ($[0] !== id || $[1] !== updateComputedData) {
|
|
94
|
+
t1 = (incomingData) => {
|
|
82
95
|
const incomingSources = incomingData["source" /* source */];
|
|
83
96
|
const incomingControl = incomingData["control" /* control */];
|
|
84
97
|
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
85
|
-
const module = new Blend(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
);
|
|
90
|
-
updateComputedData(id, { module });
|
|
98
|
+
const module = new Blend(incomingSources[0].module, incomingSources[1].module, incomingControl[0].module);
|
|
99
|
+
updateComputedData(id, {
|
|
100
|
+
module
|
|
101
|
+
});
|
|
91
102
|
}
|
|
92
|
-
}
|
|
93
|
-
[]
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
};
|
|
104
|
+
$[0] = id;
|
|
105
|
+
$[1] = updateComputedData;
|
|
106
|
+
$[2] = t1;
|
|
107
|
+
} else {
|
|
108
|
+
t1 = $[2];
|
|
109
|
+
}
|
|
110
|
+
const onDataUpdated = t1;
|
|
111
|
+
let t2;
|
|
112
|
+
if ($[3] !== data.handles || $[4] !== id || $[5] !== onDataUpdated) {
|
|
113
|
+
t2 = /* @__PURE__ */ jsx2(HandlesIncomingDataStatus, { nodeId: id, handles: data.handles, groupBy: "dataId", onDataUpdated, type: "target", resetComputedData: true });
|
|
114
|
+
$[3] = data.handles;
|
|
115
|
+
$[4] = id;
|
|
116
|
+
$[5] = onDataUpdated;
|
|
117
|
+
$[6] = t2;
|
|
118
|
+
} else {
|
|
119
|
+
t2 = $[6];
|
|
120
|
+
}
|
|
121
|
+
let t3;
|
|
122
|
+
if ($[7] !== data || $[8] !== id || $[9] !== selected || $[10] !== t2 || $[11] !== type) {
|
|
123
|
+
t3 = /* @__PURE__ */ jsx2(NodeContainer2, { id, selected, data, type, children: t2 });
|
|
124
|
+
$[7] = data;
|
|
125
|
+
$[8] = id;
|
|
126
|
+
$[9] = selected;
|
|
127
|
+
$[10] = t2;
|
|
128
|
+
$[11] = type;
|
|
129
|
+
$[12] = t3;
|
|
130
|
+
} else {
|
|
131
|
+
t3 = $[12];
|
|
132
|
+
}
|
|
133
|
+
return t3;
|
|
109
134
|
}
|
|
110
135
|
var noise_blend_node_default = NoiseBlendNode;
|
|
111
136
|
|
|
112
137
|
// src/nodes/selectors/noise-select-node.tsx
|
|
138
|
+
import { c as _c2 } from "react/compiler-runtime";
|
|
113
139
|
import { HandlesIncomingDataStatus as HandlesIncomingDataStatus2 } from "@awesome-flow/core/components";
|
|
114
140
|
import { useUpdateNodeComputedData as useUpdateNodeComputedData2, useUpdateNodeData } from "@awesome-flow/core/hooks";
|
|
115
|
-
import { NodeContainer as NodeContainer3
|
|
141
|
+
import { NodeContainer as NodeContainer3 } from "@awesome-flow/core/layout";
|
|
116
142
|
import { Group, NumberInput, Stack as Stack2 } from "@mantine/core";
|
|
117
143
|
import { Select } from "libnoise-simplex-ts";
|
|
118
|
-
import {
|
|
119
|
-
import { jsx as jsx3, jsxs as
|
|
120
|
-
function NoiseSelectNode(
|
|
144
|
+
import { useEffect, useState } from "react";
|
|
145
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
146
|
+
function NoiseSelectNode(t0) {
|
|
147
|
+
const $ = _c2(37);
|
|
148
|
+
const {
|
|
149
|
+
id,
|
|
150
|
+
selected,
|
|
151
|
+
data,
|
|
152
|
+
type
|
|
153
|
+
} = t0;
|
|
121
154
|
const [edgeFalloff, setEdgeFalloff] = useState(data.edgeFalloff);
|
|
122
155
|
const [lowerBound, setLowerBound] = useState(data.lowerBound);
|
|
123
156
|
const [upperBound, setUpperBound] = useState(data.upperBound);
|
|
124
157
|
const updateNodeData = useUpdateNodeData();
|
|
125
158
|
const updateComputedData = useUpdateNodeComputedData2();
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
159
|
+
let t1;
|
|
160
|
+
let t2;
|
|
161
|
+
if ($[0] !== edgeFalloff || $[1] !== id || $[2] !== lowerBound || $[3] !== updateNodeData || $[4] !== upperBound) {
|
|
162
|
+
t1 = () => {
|
|
163
|
+
updateNodeData(id, {
|
|
164
|
+
edgeFalloff,
|
|
165
|
+
lowerBound,
|
|
166
|
+
upperBound
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
t2 = [edgeFalloff, lowerBound, upperBound, id, updateNodeData];
|
|
170
|
+
$[0] = edgeFalloff;
|
|
171
|
+
$[1] = id;
|
|
172
|
+
$[2] = lowerBound;
|
|
173
|
+
$[3] = updateNodeData;
|
|
174
|
+
$[4] = upperBound;
|
|
175
|
+
$[5] = t1;
|
|
176
|
+
$[6] = t2;
|
|
177
|
+
} else {
|
|
178
|
+
t1 = $[5];
|
|
179
|
+
t2 = $[6];
|
|
180
|
+
}
|
|
181
|
+
useEffect(t1, t2);
|
|
182
|
+
let t3;
|
|
183
|
+
if ($[7] !== edgeFalloff || $[8] !== id || $[9] !== lowerBound || $[10] !== updateComputedData || $[11] !== upperBound) {
|
|
184
|
+
t3 = (incomingData) => {
|
|
131
185
|
const incomingSources = incomingData["source" /* source */];
|
|
132
186
|
const incomingControl = incomingData["control" /* control */];
|
|
133
187
|
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
134
|
-
const module = new Select(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
edgeFalloff,
|
|
139
|
-
lowerBound,
|
|
140
|
-
upperBound
|
|
141
|
-
);
|
|
142
|
-
updateComputedData(id, { module });
|
|
188
|
+
const module = new Select(incomingSources[0].module, incomingSources[1].module, incomingControl[0].module, edgeFalloff, lowerBound, upperBound);
|
|
189
|
+
updateComputedData(id, {
|
|
190
|
+
module
|
|
191
|
+
});
|
|
143
192
|
}
|
|
144
|
-
}
|
|
145
|
-
[]
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
|
|
193
|
+
};
|
|
194
|
+
$[7] = edgeFalloff;
|
|
195
|
+
$[8] = id;
|
|
196
|
+
$[9] = lowerBound;
|
|
197
|
+
$[10] = updateComputedData;
|
|
198
|
+
$[11] = upperBound;
|
|
199
|
+
$[12] = t3;
|
|
200
|
+
} else {
|
|
201
|
+
t3 = $[12];
|
|
202
|
+
}
|
|
203
|
+
const onDataUpdated = t3;
|
|
204
|
+
let t4;
|
|
205
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
206
|
+
t4 = (e) => setEdgeFalloff(Number(e));
|
|
207
|
+
$[13] = t4;
|
|
208
|
+
} else {
|
|
209
|
+
t4 = $[13];
|
|
210
|
+
}
|
|
211
|
+
let t5;
|
|
212
|
+
if ($[14] !== edgeFalloff) {
|
|
213
|
+
t5 = /* @__PURE__ */ jsxs2(Group, { children: [
|
|
214
|
+
"Edge Falloff:",
|
|
215
|
+
/* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: edgeFalloff, onChange: t4, step: 0.1 })
|
|
216
|
+
] });
|
|
217
|
+
$[14] = edgeFalloff;
|
|
218
|
+
$[15] = t5;
|
|
219
|
+
} else {
|
|
220
|
+
t5 = $[15];
|
|
221
|
+
}
|
|
222
|
+
let t6;
|
|
223
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
224
|
+
t6 = (e_0) => setLowerBound(Number(e_0));
|
|
225
|
+
$[16] = t6;
|
|
226
|
+
} else {
|
|
227
|
+
t6 = $[16];
|
|
228
|
+
}
|
|
229
|
+
let t7;
|
|
230
|
+
if ($[17] !== lowerBound) {
|
|
231
|
+
t7 = /* @__PURE__ */ jsxs2(Group, { children: [
|
|
232
|
+
"Lower Bound:",
|
|
233
|
+
/* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: lowerBound, onChange: t6, step: 0.1 })
|
|
234
|
+
] });
|
|
235
|
+
$[17] = lowerBound;
|
|
236
|
+
$[18] = t7;
|
|
237
|
+
} else {
|
|
238
|
+
t7 = $[18];
|
|
239
|
+
}
|
|
240
|
+
let t8;
|
|
241
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
242
|
+
t8 = (e_1) => setUpperBound(Number(e_1));
|
|
243
|
+
$[19] = t8;
|
|
244
|
+
} else {
|
|
245
|
+
t8 = $[19];
|
|
246
|
+
}
|
|
247
|
+
let t9;
|
|
248
|
+
if ($[20] !== upperBound) {
|
|
249
|
+
t9 = /* @__PURE__ */ jsxs2(Group, { children: [
|
|
250
|
+
"Upper Bound:",
|
|
251
|
+
/* @__PURE__ */ jsx3(NumberInput, { size: "xs", w: 100, value: upperBound, onChange: t8, step: 0.1 })
|
|
252
|
+
] });
|
|
253
|
+
$[20] = upperBound;
|
|
254
|
+
$[21] = t9;
|
|
255
|
+
} else {
|
|
256
|
+
t9 = $[21];
|
|
257
|
+
}
|
|
258
|
+
let t10;
|
|
259
|
+
if ($[22] !== data.handles || $[23] !== id || $[24] !== onDataUpdated) {
|
|
260
|
+
t10 = /* @__PURE__ */ jsx3(HandlesIncomingDataStatus2, { nodeId: id, handles: data.handles, groupBy: "dataId", onDataUpdated, type: "target", resetComputedData: true });
|
|
261
|
+
$[22] = data.handles;
|
|
262
|
+
$[23] = id;
|
|
263
|
+
$[24] = onDataUpdated;
|
|
264
|
+
$[25] = t10;
|
|
265
|
+
} else {
|
|
266
|
+
t10 = $[25];
|
|
267
|
+
}
|
|
268
|
+
let t11;
|
|
269
|
+
if ($[26] !== t10 || $[27] !== t5 || $[28] !== t7 || $[29] !== t9) {
|
|
270
|
+
t11 = /* @__PURE__ */ jsxs2(Stack2, { children: [
|
|
271
|
+
t5,
|
|
272
|
+
t7,
|
|
273
|
+
t9,
|
|
274
|
+
t10
|
|
275
|
+
] });
|
|
276
|
+
$[26] = t10;
|
|
277
|
+
$[27] = t5;
|
|
278
|
+
$[28] = t7;
|
|
279
|
+
$[29] = t9;
|
|
280
|
+
$[30] = t11;
|
|
281
|
+
} else {
|
|
282
|
+
t11 = $[30];
|
|
283
|
+
}
|
|
284
|
+
let t12;
|
|
285
|
+
if ($[31] !== data || $[32] !== id || $[33] !== selected || $[34] !== t11 || $[35] !== type) {
|
|
286
|
+
t12 = /* @__PURE__ */ jsx3(NodeContainer3, { id, selected, data, type, children: t11 });
|
|
287
|
+
$[31] = data;
|
|
288
|
+
$[32] = id;
|
|
289
|
+
$[33] = selected;
|
|
290
|
+
$[34] = t11;
|
|
291
|
+
$[35] = type;
|
|
292
|
+
$[36] = t12;
|
|
293
|
+
} else {
|
|
294
|
+
t12 = $[36];
|
|
295
|
+
}
|
|
296
|
+
return t12;
|
|
202
297
|
}
|
|
203
298
|
var noise_select_node_default = NoiseSelectNode;
|
|
204
299
|
|
|
205
300
|
// src/nodes/output/noise-raw-texture-node.tsx
|
|
301
|
+
import { c as _c3 } from "react/compiler-runtime";
|
|
206
302
|
import { useIncomingComputedData as useIncomingComputedData2, useUpdateNodeComputedData as useUpdateNodeComputedData3 } from "@awesome-flow/core/hooks";
|
|
207
|
-
import { NodeContainer as NodeContainer4
|
|
303
|
+
import { NodeContainer as NodeContainer4 } from "@awesome-flow/core/layout";
|
|
208
304
|
import { Group as Group2, Stack as Stack3 } from "@mantine/core";
|
|
209
|
-
import { useEffect as useEffect2,
|
|
210
|
-
import { jsx as jsx4, jsxs as
|
|
211
|
-
function NoiseRawTextureNode(
|
|
305
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
306
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
307
|
+
function NoiseRawTextureNode(t0) {
|
|
308
|
+
const $ = _c3(24);
|
|
309
|
+
const {
|
|
310
|
+
id,
|
|
311
|
+
selected,
|
|
312
|
+
data,
|
|
313
|
+
type
|
|
314
|
+
} = t0;
|
|
212
315
|
const updateComputedData = useUpdateNodeComputedData3();
|
|
213
316
|
const [dataLength, setDataLength] = useState2(0);
|
|
214
317
|
const [resolution, setResolution] = useState2(0);
|
|
215
318
|
const incoming = useIncomingComputedData2(id);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
]
|
|
253
|
-
|
|
254
|
-
|
|
319
|
+
let t1;
|
|
320
|
+
let t2;
|
|
321
|
+
if ($[0] !== incoming) {
|
|
322
|
+
t2 = incoming?.map(_temp).flat();
|
|
323
|
+
$[0] = incoming;
|
|
324
|
+
$[1] = t2;
|
|
325
|
+
} else {
|
|
326
|
+
t2 = $[1];
|
|
327
|
+
}
|
|
328
|
+
t1 = t2;
|
|
329
|
+
const noise = t1;
|
|
330
|
+
let t3;
|
|
331
|
+
let t4;
|
|
332
|
+
if ($[2] !== id || $[3] !== noise || $[4] !== updateComputedData) {
|
|
333
|
+
t3 = () => {
|
|
334
|
+
if (noise?.length) {
|
|
335
|
+
const size = Math.ceil(Math.sqrt(noise.length));
|
|
336
|
+
const colors = noise.map(_temp2).flat();
|
|
337
|
+
const dataArray = new Uint8Array(size * size * 4);
|
|
338
|
+
dataArray.set(colors);
|
|
339
|
+
setResolution(size);
|
|
340
|
+
setDataLength(dataArray.length);
|
|
341
|
+
updateComputedData(id, {
|
|
342
|
+
textureData: dataArray,
|
|
343
|
+
textureResolutionX: size,
|
|
344
|
+
textureResolutionY: size
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
t4 = [noise, updateComputedData, id];
|
|
349
|
+
$[2] = id;
|
|
350
|
+
$[3] = noise;
|
|
351
|
+
$[4] = updateComputedData;
|
|
352
|
+
$[5] = t3;
|
|
353
|
+
$[6] = t4;
|
|
354
|
+
} else {
|
|
355
|
+
t3 = $[5];
|
|
356
|
+
t4 = $[6];
|
|
357
|
+
}
|
|
358
|
+
useEffect2(t3, t4);
|
|
359
|
+
let t5;
|
|
360
|
+
if ($[7] !== resolution) {
|
|
361
|
+
t5 = /* @__PURE__ */ jsxs3(Group2, { children: [
|
|
362
|
+
"Resolution: ",
|
|
363
|
+
resolution,
|
|
364
|
+
"x",
|
|
365
|
+
resolution
|
|
366
|
+
] });
|
|
367
|
+
$[7] = resolution;
|
|
368
|
+
$[8] = t5;
|
|
369
|
+
} else {
|
|
370
|
+
t5 = $[8];
|
|
371
|
+
}
|
|
372
|
+
const t6 = noise?.length || 0;
|
|
373
|
+
let t7;
|
|
374
|
+
if ($[9] !== t6) {
|
|
375
|
+
t7 = /* @__PURE__ */ jsxs3(Group2, { children: [
|
|
376
|
+
"Input Length: ",
|
|
377
|
+
t6
|
|
378
|
+
] });
|
|
379
|
+
$[9] = t6;
|
|
380
|
+
$[10] = t7;
|
|
381
|
+
} else {
|
|
382
|
+
t7 = $[10];
|
|
383
|
+
}
|
|
384
|
+
let t8;
|
|
385
|
+
if ($[11] !== dataLength || $[12] !== resolution) {
|
|
386
|
+
t8 = /* @__PURE__ */ jsxs3(Group2, { children: [
|
|
387
|
+
"Output Length (",
|
|
388
|
+
resolution,
|
|
389
|
+
"*",
|
|
390
|
+
resolution,
|
|
391
|
+
"*4): ",
|
|
392
|
+
dataLength
|
|
393
|
+
] });
|
|
394
|
+
$[11] = dataLength;
|
|
395
|
+
$[12] = resolution;
|
|
396
|
+
$[13] = t8;
|
|
397
|
+
} else {
|
|
398
|
+
t8 = $[13];
|
|
399
|
+
}
|
|
400
|
+
let t9;
|
|
401
|
+
if ($[14] !== t5 || $[15] !== t7 || $[16] !== t8) {
|
|
402
|
+
t9 = /* @__PURE__ */ jsxs3(Stack3, { children: [
|
|
403
|
+
t5,
|
|
404
|
+
t7,
|
|
405
|
+
t8
|
|
406
|
+
] });
|
|
407
|
+
$[14] = t5;
|
|
408
|
+
$[15] = t7;
|
|
409
|
+
$[16] = t8;
|
|
410
|
+
$[17] = t9;
|
|
411
|
+
} else {
|
|
412
|
+
t9 = $[17];
|
|
413
|
+
}
|
|
414
|
+
let t10;
|
|
415
|
+
if ($[18] !== data || $[19] !== id || $[20] !== selected || $[21] !== t9 || $[22] !== type) {
|
|
416
|
+
t10 = /* @__PURE__ */ jsx4(NodeContainer4, { id, selected, data, type, children: t9 });
|
|
417
|
+
$[18] = data;
|
|
418
|
+
$[19] = id;
|
|
419
|
+
$[20] = selected;
|
|
420
|
+
$[21] = t9;
|
|
421
|
+
$[22] = type;
|
|
422
|
+
$[23] = t10;
|
|
423
|
+
} else {
|
|
424
|
+
t10 = $[23];
|
|
425
|
+
}
|
|
426
|
+
return t10;
|
|
427
|
+
}
|
|
428
|
+
function _temp2(n) {
|
|
429
|
+
return [n.value * 255, n.value * 255, n.value * 255, 255];
|
|
430
|
+
}
|
|
431
|
+
function _temp(p) {
|
|
432
|
+
return p.noise;
|
|
255
433
|
}
|
|
256
434
|
var noise_raw_texture_node_default = NoiseRawTextureNode;
|
|
257
435
|
|
|
258
436
|
// src/nodes/output/positions-logger-node.tsx
|
|
259
437
|
import { useIncomingComputedData as useIncomingComputedData3 } from "@awesome-flow/core/hooks";
|
|
260
|
-
import { NodeContainer as NodeContainer5
|
|
438
|
+
import { NodeContainer as NodeContainer5 } from "@awesome-flow/core/layout";
|
|
261
439
|
import { Divider as Divider2, Stack as Stack4, Text as Text2 } from "@mantine/core";
|
|
262
440
|
import { useMemo as useMemo3 } from "react";
|
|
263
|
-
import { jsx as jsx5, jsxs as
|
|
264
|
-
function PositionsLoggerNode({
|
|
441
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
442
|
+
function PositionsLoggerNode({
|
|
443
|
+
id,
|
|
444
|
+
selected,
|
|
445
|
+
data,
|
|
446
|
+
type
|
|
447
|
+
}) {
|
|
265
448
|
const incoming = useIncomingComputedData3(id);
|
|
266
449
|
const positions = useMemo3(() => {
|
|
267
450
|
return incoming?.map((p) => p.positions).flat();
|
|
268
451
|
}, [incoming]);
|
|
269
|
-
return /* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ jsxs4(NodeContainer5, { id, selected, data, type, children: [
|
|
453
|
+
/* @__PURE__ */ jsxs4(Text2, { children: [
|
|
271
454
|
"Size: ",
|
|
272
455
|
positions?.length || 0
|
|
273
456
|
] }),
|
|
274
457
|
/* @__PURE__ */ jsx5(Divider2, { h: 5 }),
|
|
275
|
-
/* @__PURE__ */ jsx5(Stack4, { children: positions?.map((v, i) => /* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ jsx5(Stack4, { children: positions?.map((v, i) => /* @__PURE__ */ jsxs4(Text2, { children: [
|
|
276
459
|
v.x,
|
|
277
460
|
":",
|
|
278
461
|
v.y,
|
|
279
462
|
":",
|
|
280
463
|
v.z
|
|
281
|
-
] }, i)) })
|
|
282
|
-
/* @__PURE__ */ jsx5(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
|
|
464
|
+
] }, i)) })
|
|
283
465
|
] });
|
|
284
466
|
}
|
|
285
467
|
var positions_logger_node_default = PositionsLoggerNode;
|
|
@@ -688,11 +870,6 @@ var NoiseCurveNodeTemplateFactory = class {
|
|
|
688
870
|
connection: "target",
|
|
689
871
|
maxConnections: 1
|
|
690
872
|
},
|
|
691
|
-
// {
|
|
692
|
-
// position: Position.Left,
|
|
693
|
-
// dataType: CoreHandleType.variableProperty,
|
|
694
|
-
// connection: 'target',
|
|
695
|
-
// },
|
|
696
873
|
{
|
|
697
874
|
position: Position15.Right,
|
|
698
875
|
dataType: "module" /* module */,
|
|
@@ -1284,16 +1461,26 @@ var noiseNodeTemplates = {
|
|
|
1284
1461
|
};
|
|
1285
1462
|
|
|
1286
1463
|
// src/nodes/output/noise-output-node.tsx
|
|
1287
|
-
import { jsx as jsx6, jsxs as
|
|
1288
|
-
function NoiseOutputNode(
|
|
1464
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1465
|
+
function NoiseOutputNode(t0) {
|
|
1466
|
+
const $ = _c4(16);
|
|
1467
|
+
const {
|
|
1468
|
+
id,
|
|
1469
|
+
selected,
|
|
1470
|
+
data,
|
|
1471
|
+
type
|
|
1472
|
+
} = t0;
|
|
1289
1473
|
const [size, setSize] = useState3(0);
|
|
1290
1474
|
const updateComputedData = useUpdateNodeComputedData4();
|
|
1291
|
-
|
|
1292
|
-
|
|
1475
|
+
let t1;
|
|
1476
|
+
if ($[0] !== id || $[1] !== updateComputedData) {
|
|
1477
|
+
t1 = (handleData) => {
|
|
1293
1478
|
const incomingPositions = handleData["position" /* position */];
|
|
1294
1479
|
const incomingModule = handleData["module" /* module */];
|
|
1295
1480
|
if (incomingPositions?.length && incomingModule?.length && incomingModule[0]?.module) {
|
|
1296
|
-
const {
|
|
1481
|
+
const {
|
|
1482
|
+
module
|
|
1483
|
+
} = incomingModule[0];
|
|
1297
1484
|
const noise = [];
|
|
1298
1485
|
for (const input of incomingPositions) {
|
|
1299
1486
|
for (const position of input.positions) {
|
|
@@ -1304,30 +1491,58 @@ function NoiseOutputNode({ id, selected, data, type }) {
|
|
|
1304
1491
|
});
|
|
1305
1492
|
}
|
|
1306
1493
|
}
|
|
1307
|
-
updateComputedData(id, {
|
|
1494
|
+
updateComputedData(id, {
|
|
1495
|
+
noise,
|
|
1496
|
+
module
|
|
1497
|
+
});
|
|
1308
1498
|
setSize(noise.length);
|
|
1309
1499
|
}
|
|
1310
|
-
}
|
|
1311
|
-
[]
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1500
|
+
};
|
|
1501
|
+
$[0] = id;
|
|
1502
|
+
$[1] = updateComputedData;
|
|
1503
|
+
$[2] = t1;
|
|
1504
|
+
} else {
|
|
1505
|
+
t1 = $[2];
|
|
1506
|
+
}
|
|
1507
|
+
const onDataUpdated = t1;
|
|
1508
|
+
let t2;
|
|
1509
|
+
if ($[3] !== data.handles || $[4] !== id || $[5] !== onDataUpdated) {
|
|
1510
|
+
t2 = /* @__PURE__ */ jsx6(HandlesIncomingDataStatus3, { nodeId: id, handles: data.handles, groupBy: "dataType", onDataUpdated, type: "target", resetComputedData: true });
|
|
1511
|
+
$[3] = data.handles;
|
|
1512
|
+
$[4] = id;
|
|
1513
|
+
$[5] = onDataUpdated;
|
|
1514
|
+
$[6] = t2;
|
|
1515
|
+
} else {
|
|
1516
|
+
t2 = $[6];
|
|
1517
|
+
}
|
|
1518
|
+
let t3;
|
|
1519
|
+
if ($[7] !== size) {
|
|
1520
|
+
t3 = /* @__PURE__ */ jsxs5(Text3, { mt: 5, children: [
|
|
1326
1521
|
"Noise points: ",
|
|
1327
1522
|
size
|
|
1328
|
-
] })
|
|
1329
|
-
|
|
1330
|
-
|
|
1523
|
+
] });
|
|
1524
|
+
$[7] = size;
|
|
1525
|
+
$[8] = t3;
|
|
1526
|
+
} else {
|
|
1527
|
+
t3 = $[8];
|
|
1528
|
+
}
|
|
1529
|
+
let t4;
|
|
1530
|
+
if ($[9] !== data || $[10] !== id || $[11] !== selected || $[12] !== t2 || $[13] !== t3 || $[14] !== type) {
|
|
1531
|
+
t4 = /* @__PURE__ */ jsxs5(NodeContainer6, { id, selected, data, type, children: [
|
|
1532
|
+
t2,
|
|
1533
|
+
t3
|
|
1534
|
+
] });
|
|
1535
|
+
$[9] = data;
|
|
1536
|
+
$[10] = id;
|
|
1537
|
+
$[11] = selected;
|
|
1538
|
+
$[12] = t2;
|
|
1539
|
+
$[13] = t3;
|
|
1540
|
+
$[14] = type;
|
|
1541
|
+
$[15] = t4;
|
|
1542
|
+
} else {
|
|
1543
|
+
t4 = $[15];
|
|
1544
|
+
}
|
|
1545
|
+
return t4;
|
|
1331
1546
|
}
|
|
1332
1547
|
var noise_output_node_default = NoiseOutputNode;
|
|
1333
1548
|
|