@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
|
@@ -0,0 +1,911 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkUNMRBZ5Xcjs = require('./chunk-UNMRBZ5X.cjs');
|
|
4
|
+
|
|
5
|
+
// src/nodes/modifiers/noise-abs-node.tsx
|
|
6
|
+
var _compilerruntime = require('react/compiler-runtime');
|
|
7
|
+
var _hooks = require('@awesome-flow/core/hooks');
|
|
8
|
+
var _layout = require('@awesome-flow/core/layout');
|
|
9
|
+
var _libnoisesimplexts = require('libnoise-simplex-ts');
|
|
10
|
+
var _react = require('react');
|
|
11
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
12
|
+
function NoiseAbsNode(t0) {
|
|
13
|
+
const $ = _compilerruntime.c.call(void 0, 10);
|
|
14
|
+
const {
|
|
15
|
+
id,
|
|
16
|
+
selected,
|
|
17
|
+
data,
|
|
18
|
+
type
|
|
19
|
+
} = t0;
|
|
20
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
21
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
22
|
+
let t1;
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[0] !== id || $[1] !== incoming || $[2] !== updateComputedData) {
|
|
25
|
+
t1 = () => {
|
|
26
|
+
if (_optionalChain([incoming, 'optionalAccess', _2 => _2.length]) > 0) {
|
|
27
|
+
const module = new (0, _libnoisesimplexts.Abs)(incoming[0].module);
|
|
28
|
+
updateComputedData(id, {
|
|
29
|
+
module
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
t2 = [incoming, id, updateComputedData];
|
|
34
|
+
$[0] = id;
|
|
35
|
+
$[1] = incoming;
|
|
36
|
+
$[2] = updateComputedData;
|
|
37
|
+
$[3] = t1;
|
|
38
|
+
$[4] = t2;
|
|
39
|
+
} else {
|
|
40
|
+
t1 = $[3];
|
|
41
|
+
t2 = $[4];
|
|
42
|
+
}
|
|
43
|
+
_react.useEffect.call(void 0, t1, t2);
|
|
44
|
+
let t3;
|
|
45
|
+
if ($[5] !== data || $[6] !== id || $[7] !== selected || $[8] !== type) {
|
|
46
|
+
t3 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type });
|
|
47
|
+
$[5] = data;
|
|
48
|
+
$[6] = id;
|
|
49
|
+
$[7] = selected;
|
|
50
|
+
$[8] = type;
|
|
51
|
+
$[9] = t3;
|
|
52
|
+
} else {
|
|
53
|
+
t3 = $[9];
|
|
54
|
+
}
|
|
55
|
+
return t3;
|
|
56
|
+
}
|
|
57
|
+
var noise_abs_node_default = NoiseAbsNode;
|
|
58
|
+
|
|
59
|
+
// src/nodes/modifiers/noise-clamp-node.tsx
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
var _core = require('@mantine/core');
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
function NoiseClampNode(t0) {
|
|
68
|
+
const $ = _compilerruntime.c.call(void 0, 23);
|
|
69
|
+
const {
|
|
70
|
+
id,
|
|
71
|
+
selected,
|
|
72
|
+
data,
|
|
73
|
+
type
|
|
74
|
+
} = t0;
|
|
75
|
+
const [lowerBound, setLowerBound] = _react.useState.call(void 0, data.lowerBound);
|
|
76
|
+
const [upperBound, setUpperBound] = _react.useState.call(void 0, data.upperBound);
|
|
77
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
78
|
+
const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
|
|
79
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
80
|
+
let t1;
|
|
81
|
+
let t2;
|
|
82
|
+
if ($[0] !== id || $[1] !== incoming || $[2] !== lowerBound || $[3] !== updateComputedData || $[4] !== updateNodeData || $[5] !== upperBound) {
|
|
83
|
+
t1 = () => {
|
|
84
|
+
if (_optionalChain([incoming, 'optionalAccess', _3 => _3.length])) {
|
|
85
|
+
const module = new (0, _libnoisesimplexts.Clamp)(incoming[0].module, lowerBound, upperBound);
|
|
86
|
+
updateComputedData(id, {
|
|
87
|
+
module
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
updateNodeData(id, {
|
|
91
|
+
lowerBound,
|
|
92
|
+
upperBound
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
t2 = [incoming, lowerBound, upperBound, id, updateComputedData, updateNodeData];
|
|
96
|
+
$[0] = id;
|
|
97
|
+
$[1] = incoming;
|
|
98
|
+
$[2] = lowerBound;
|
|
99
|
+
$[3] = updateComputedData;
|
|
100
|
+
$[4] = updateNodeData;
|
|
101
|
+
$[5] = upperBound;
|
|
102
|
+
$[6] = t1;
|
|
103
|
+
$[7] = t2;
|
|
104
|
+
} else {
|
|
105
|
+
t1 = $[6];
|
|
106
|
+
t2 = $[7];
|
|
107
|
+
}
|
|
108
|
+
_react.useEffect.call(void 0, t1, t2);
|
|
109
|
+
let t3;
|
|
110
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
+
t3 = (e) => setLowerBound(Number(e));
|
|
112
|
+
$[8] = t3;
|
|
113
|
+
} else {
|
|
114
|
+
t3 = $[8];
|
|
115
|
+
}
|
|
116
|
+
let t4;
|
|
117
|
+
if ($[9] !== lowerBound) {
|
|
118
|
+
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: lowerBound, onChange: t3, step: 0.1 });
|
|
119
|
+
$[9] = lowerBound;
|
|
120
|
+
$[10] = t4;
|
|
121
|
+
} else {
|
|
122
|
+
t4 = $[10];
|
|
123
|
+
}
|
|
124
|
+
let t5;
|
|
125
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
126
|
+
t5 = (e_0) => setUpperBound(Number(e_0));
|
|
127
|
+
$[11] = t5;
|
|
128
|
+
} else {
|
|
129
|
+
t5 = $[11];
|
|
130
|
+
}
|
|
131
|
+
let t6;
|
|
132
|
+
if ($[12] !== upperBound) {
|
|
133
|
+
t6 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: upperBound, onChange: t5, step: 0.1 });
|
|
134
|
+
$[12] = upperBound;
|
|
135
|
+
$[13] = t6;
|
|
136
|
+
} else {
|
|
137
|
+
t6 = $[13];
|
|
138
|
+
}
|
|
139
|
+
let t7;
|
|
140
|
+
if ($[14] !== t4 || $[15] !== t6) {
|
|
141
|
+
t7 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
|
|
142
|
+
t4,
|
|
143
|
+
t6
|
|
144
|
+
] }) });
|
|
145
|
+
$[14] = t4;
|
|
146
|
+
$[15] = t6;
|
|
147
|
+
$[16] = t7;
|
|
148
|
+
} else {
|
|
149
|
+
t7 = $[16];
|
|
150
|
+
}
|
|
151
|
+
let t8;
|
|
152
|
+
if ($[17] !== data || $[18] !== id || $[19] !== selected || $[20] !== t7 || $[21] !== type) {
|
|
153
|
+
t8 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: t7 });
|
|
154
|
+
$[17] = data;
|
|
155
|
+
$[18] = id;
|
|
156
|
+
$[19] = selected;
|
|
157
|
+
$[20] = t7;
|
|
158
|
+
$[21] = type;
|
|
159
|
+
$[22] = t8;
|
|
160
|
+
} else {
|
|
161
|
+
t8 = $[22];
|
|
162
|
+
}
|
|
163
|
+
return t8;
|
|
164
|
+
}
|
|
165
|
+
var noise_clamp_node_default = NoiseClampNode;
|
|
166
|
+
|
|
167
|
+
// src/nodes/modifiers/noise-combine-node.tsx
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
var _iconsreact = require('@tabler/icons-react');
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
// src/abstract/operations.ts
|
|
175
|
+
|
|
176
|
+
var NoiseCombineType = /* @__PURE__ */ ((NoiseCombineType3) => {
|
|
177
|
+
NoiseCombineType3["add"] = "add";
|
|
178
|
+
NoiseCombineType3["max"] = "max";
|
|
179
|
+
NoiseCombineType3["min"] = "min";
|
|
180
|
+
NoiseCombineType3["multiply"] = "multiply";
|
|
181
|
+
NoiseCombineType3["power"] = "power";
|
|
182
|
+
return NoiseCombineType3;
|
|
183
|
+
})(NoiseCombineType || {});
|
|
184
|
+
var noiseCombineModuleMap = {
|
|
185
|
+
["add" /* add */]: _libnoisesimplexts.Add,
|
|
186
|
+
["max" /* max */]: _libnoisesimplexts.Max,
|
|
187
|
+
["min" /* min */]: _libnoisesimplexts.Min,
|
|
188
|
+
["multiply" /* multiply */]: _libnoisesimplexts.Multiply,
|
|
189
|
+
["power" /* power */]: _libnoisesimplexts.Power
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// src/nodes/modifiers/noise-combine-node.tsx
|
|
193
|
+
|
|
194
|
+
var options = {
|
|
195
|
+
add: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconPlus, {}),
|
|
196
|
+
min: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconChevronLeft, {}),
|
|
197
|
+
max: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconChevronRight, {}),
|
|
198
|
+
multiply: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconAsterisk, {}),
|
|
199
|
+
power: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconChevronUp, {})
|
|
200
|
+
};
|
|
201
|
+
function NoiseCombineNode(t0) {
|
|
202
|
+
const $ = _compilerruntime.c.call(void 0, 18);
|
|
203
|
+
const {
|
|
204
|
+
id,
|
|
205
|
+
selected,
|
|
206
|
+
data,
|
|
207
|
+
type
|
|
208
|
+
} = t0;
|
|
209
|
+
const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
|
|
210
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
211
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
212
|
+
let t1;
|
|
213
|
+
let t2;
|
|
214
|
+
if ($[0] !== data.operation || $[1] !== id || $[2] !== incoming || $[3] !== updateComputedData) {
|
|
215
|
+
t1 = () => {
|
|
216
|
+
const ModuleFactory = noiseCombineModuleMap[data.operation];
|
|
217
|
+
if (_optionalChain([incoming, 'optionalAccess', _4 => _4.length]) > 1) {
|
|
218
|
+
const module = new ModuleFactory(incoming[0].module, incoming[1].module);
|
|
219
|
+
updateComputedData(id, {
|
|
220
|
+
module
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
t2 = [data.operation, incoming, id, updateComputedData];
|
|
225
|
+
$[0] = data.operation;
|
|
226
|
+
$[1] = id;
|
|
227
|
+
$[2] = incoming;
|
|
228
|
+
$[3] = updateComputedData;
|
|
229
|
+
$[4] = t1;
|
|
230
|
+
$[5] = t2;
|
|
231
|
+
} else {
|
|
232
|
+
t1 = $[4];
|
|
233
|
+
t2 = $[5];
|
|
234
|
+
}
|
|
235
|
+
_react.useEffect.call(void 0, t1, t2);
|
|
236
|
+
let t3;
|
|
237
|
+
if ($[6] !== id || $[7] !== updateNodeData) {
|
|
238
|
+
t3 = (operation) => {
|
|
239
|
+
updateNodeData(id, {
|
|
240
|
+
operation
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
$[6] = id;
|
|
244
|
+
$[7] = updateNodeData;
|
|
245
|
+
$[8] = t3;
|
|
246
|
+
} else {
|
|
247
|
+
t3 = $[8];
|
|
248
|
+
}
|
|
249
|
+
const onChange = t3;
|
|
250
|
+
let t4;
|
|
251
|
+
if ($[9] !== data.operation || $[10] !== onChange) {
|
|
252
|
+
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeCombobox, { options, selected: data.operation, onChange, width: 150 });
|
|
253
|
+
$[9] = data.operation;
|
|
254
|
+
$[10] = onChange;
|
|
255
|
+
$[11] = t4;
|
|
256
|
+
} else {
|
|
257
|
+
t4 = $[11];
|
|
258
|
+
}
|
|
259
|
+
let t5;
|
|
260
|
+
if ($[12] !== data || $[13] !== id || $[14] !== selected || $[15] !== t4 || $[16] !== type) {
|
|
261
|
+
t5 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: t4 });
|
|
262
|
+
$[12] = data;
|
|
263
|
+
$[13] = id;
|
|
264
|
+
$[14] = selected;
|
|
265
|
+
$[15] = t4;
|
|
266
|
+
$[16] = type;
|
|
267
|
+
$[17] = t5;
|
|
268
|
+
} else {
|
|
269
|
+
t5 = $[17];
|
|
270
|
+
}
|
|
271
|
+
return t5;
|
|
272
|
+
}
|
|
273
|
+
var noise_combine_node_default = NoiseCombineNode;
|
|
274
|
+
|
|
275
|
+
// src/nodes/modifiers/noise-curve-node.tsx
|
|
276
|
+
var _abstract = require('@awesome-flow/core/abstract');
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
var _form = require('@mantine/form');
|
|
281
|
+
var _hooks3 = require('@mantine/hooks');
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
function NoiseCurveNode({
|
|
287
|
+
id,
|
|
288
|
+
selected,
|
|
289
|
+
data,
|
|
290
|
+
type
|
|
291
|
+
}) {
|
|
292
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
293
|
+
const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
|
|
294
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
295
|
+
const [values, setValues] = _react.useState.call(void 0, []);
|
|
296
|
+
const initialValues = _react.useMemo.call(void 0, () => {
|
|
297
|
+
return _optionalChain([data, 'access', _5 => _5.points, 'optionalAccess', _6 => _6.length]) ? data.points.map((v) => ({
|
|
298
|
+
input: v.input,
|
|
299
|
+
output: v.output,
|
|
300
|
+
key: _hooks3.randomId.call(void 0, )
|
|
301
|
+
})) : [1, 2, 3, 4].map(() => ({
|
|
302
|
+
input: 0,
|
|
303
|
+
output: 0,
|
|
304
|
+
key: _hooks3.randomId.call(void 0, )
|
|
305
|
+
}));
|
|
306
|
+
}, [data.points]);
|
|
307
|
+
const form = _form.useForm.call(void 0, {
|
|
308
|
+
mode: "uncontrolled",
|
|
309
|
+
initialValues: {
|
|
310
|
+
points: initialValues
|
|
311
|
+
},
|
|
312
|
+
validateInputOnChange: [`points.${_form.FORM_INDEX}.input`],
|
|
313
|
+
clearInputErrorOnChange: true,
|
|
314
|
+
validate: {
|
|
315
|
+
points: {
|
|
316
|
+
input: (value, values2) => {
|
|
317
|
+
const counts = {};
|
|
318
|
+
values2.points.forEach((x) => {
|
|
319
|
+
counts[x.input] = (counts[x.input] || 0) + 1;
|
|
320
|
+
});
|
|
321
|
+
return counts[value] > 1;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
onValuesChange: _react.useCallback.call(void 0,
|
|
326
|
+
(values2) => {
|
|
327
|
+
form.validate();
|
|
328
|
+
if (form.isValid()) {
|
|
329
|
+
const points = values2.points.map((v) => ({
|
|
330
|
+
input: v.input,
|
|
331
|
+
output: v.output
|
|
332
|
+
}));
|
|
333
|
+
setValues(points);
|
|
334
|
+
updateNodeData(id, {
|
|
335
|
+
points
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
340
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
341
|
+
[id, updateNodeData]
|
|
342
|
+
)
|
|
343
|
+
});
|
|
344
|
+
_react.useEffect.call(void 0, () => {
|
|
345
|
+
if (_optionalChain([incoming, 'optionalAccess', _7 => _7.length]) && _optionalChain([values, 'optionalAccess', _8 => _8.length]) >= 4) {
|
|
346
|
+
const module = new (0, _libnoisesimplexts.Curve)(incoming[0].module, values.map((p) => new (0, _libnoisesimplexts.Tuple)(p.input, p.output)));
|
|
347
|
+
updateComputedData(id, {
|
|
348
|
+
module
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}, [id, values, incoming, updateComputedData]);
|
|
352
|
+
const fields = _react.useMemo.call(void 0, () => values.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { mt: "xs", children: [
|
|
353
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, placeholder: "Input Value", ...form.getInputProps(`points.${index}.input`), step: 0.1 }, form.key(`points.${index}.input`)),
|
|
354
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, placeholder: "Output Value", ...form.getInputProps(`points.${index}.output`), step: 0.1 }, form.key(`points.${index}.output`)),
|
|
355
|
+
data.state === _abstract.NodeState.edit && values.length > 4 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.ActionIcon, { color: "red", variant: "outline", size: "sm", onClick: () => form.removeListItem("points", index), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconX, { size: "1rem" }) })
|
|
356
|
+
] }, item.key)), [data.state, values, form]);
|
|
357
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, type, data, children: [
|
|
358
|
+
fields,
|
|
359
|
+
data.state === _abstract.NodeState.edit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
360
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Space, { h: 10 }),
|
|
361
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Button, { variant: "outline", size: "xs", fullWidth: true, onClick: () => form.insertListItem("points", {
|
|
362
|
+
input: 0,
|
|
363
|
+
output: 0,
|
|
364
|
+
key: _hooks3.randomId.call(void 0, )
|
|
365
|
+
}), children: "Add control point" })
|
|
366
|
+
] })
|
|
367
|
+
] });
|
|
368
|
+
}
|
|
369
|
+
var noise_curve_node_default = NoiseCurveNode;
|
|
370
|
+
|
|
371
|
+
// src/nodes/modifiers/noise-exponent-node.tsx
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
function NoiseExponentNode(t0) {
|
|
380
|
+
const $ = _compilerruntime.c.call(void 0, 16);
|
|
381
|
+
const {
|
|
382
|
+
id,
|
|
383
|
+
selected,
|
|
384
|
+
data,
|
|
385
|
+
type
|
|
386
|
+
} = t0;
|
|
387
|
+
const [exponent, setExponent] = _react.useState.call(void 0, data.exponent);
|
|
388
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
389
|
+
const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
|
|
390
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
391
|
+
let t1;
|
|
392
|
+
let t2;
|
|
393
|
+
if ($[0] !== exponent || $[1] !== id || $[2] !== incoming || $[3] !== updateComputedData || $[4] !== updateNodeData) {
|
|
394
|
+
t1 = () => {
|
|
395
|
+
if (_optionalChain([incoming, 'optionalAccess', _9 => _9.length]) > 0) {
|
|
396
|
+
const module = new (0, _libnoisesimplexts.Exponent)(incoming[0].module, exponent);
|
|
397
|
+
updateComputedData(id, {
|
|
398
|
+
module
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
updateNodeData(id, {
|
|
402
|
+
exponent
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
t2 = [id, incoming, exponent, updateComputedData, updateNodeData];
|
|
406
|
+
$[0] = exponent;
|
|
407
|
+
$[1] = id;
|
|
408
|
+
$[2] = incoming;
|
|
409
|
+
$[3] = updateComputedData;
|
|
410
|
+
$[4] = updateNodeData;
|
|
411
|
+
$[5] = t1;
|
|
412
|
+
$[6] = t2;
|
|
413
|
+
} else {
|
|
414
|
+
t1 = $[5];
|
|
415
|
+
t2 = $[6];
|
|
416
|
+
}
|
|
417
|
+
_react.useEffect.call(void 0, t1, t2);
|
|
418
|
+
let t3;
|
|
419
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
420
|
+
t3 = (e) => setExponent(Number(e));
|
|
421
|
+
$[7] = t3;
|
|
422
|
+
} else {
|
|
423
|
+
t3 = $[7];
|
|
424
|
+
}
|
|
425
|
+
let t4;
|
|
426
|
+
if ($[8] !== exponent) {
|
|
427
|
+
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
|
|
428
|
+
"Exponent:",
|
|
429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", value: exponent, onChange: t3, step: 0.1 })
|
|
430
|
+
] }) });
|
|
431
|
+
$[8] = exponent;
|
|
432
|
+
$[9] = t4;
|
|
433
|
+
} else {
|
|
434
|
+
t4 = $[9];
|
|
435
|
+
}
|
|
436
|
+
let t5;
|
|
437
|
+
if ($[10] !== data || $[11] !== id || $[12] !== selected || $[13] !== t4 || $[14] !== type) {
|
|
438
|
+
t5 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: t4 });
|
|
439
|
+
$[10] = data;
|
|
440
|
+
$[11] = id;
|
|
441
|
+
$[12] = selected;
|
|
442
|
+
$[13] = t4;
|
|
443
|
+
$[14] = type;
|
|
444
|
+
$[15] = t5;
|
|
445
|
+
} else {
|
|
446
|
+
t5 = $[15];
|
|
447
|
+
}
|
|
448
|
+
return t5;
|
|
449
|
+
}
|
|
450
|
+
var noise_exponent_node_default = NoiseExponentNode;
|
|
451
|
+
|
|
452
|
+
// src/nodes/modifiers/noise-invert-node.tsx
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
function NoiseInvertNode(t0) {
|
|
460
|
+
const $ = _compilerruntime.c.call(void 0, 10);
|
|
461
|
+
const {
|
|
462
|
+
id,
|
|
463
|
+
selected,
|
|
464
|
+
data,
|
|
465
|
+
type
|
|
466
|
+
} = t0;
|
|
467
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
468
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
469
|
+
let t1;
|
|
470
|
+
let t2;
|
|
471
|
+
if ($[0] !== id || $[1] !== incoming || $[2] !== updateComputedData) {
|
|
472
|
+
t1 = () => {
|
|
473
|
+
if (_optionalChain([incoming, 'optionalAccess', _10 => _10.length]) > 0) {
|
|
474
|
+
const module = new (0, _libnoisesimplexts.Invert)(incoming[0].module);
|
|
475
|
+
updateComputedData(id, {
|
|
476
|
+
module
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
t2 = [id, incoming, updateComputedData];
|
|
481
|
+
$[0] = id;
|
|
482
|
+
$[1] = incoming;
|
|
483
|
+
$[2] = updateComputedData;
|
|
484
|
+
$[3] = t1;
|
|
485
|
+
$[4] = t2;
|
|
486
|
+
} else {
|
|
487
|
+
t1 = $[3];
|
|
488
|
+
t2 = $[4];
|
|
489
|
+
}
|
|
490
|
+
_react.useEffect.call(void 0, t1, t2);
|
|
491
|
+
let t3;
|
|
492
|
+
if ($[5] !== data || $[6] !== id || $[7] !== selected || $[8] !== type) {
|
|
493
|
+
t3 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type });
|
|
494
|
+
$[5] = data;
|
|
495
|
+
$[6] = id;
|
|
496
|
+
$[7] = selected;
|
|
497
|
+
$[8] = type;
|
|
498
|
+
$[9] = t3;
|
|
499
|
+
} else {
|
|
500
|
+
t3 = $[9];
|
|
501
|
+
}
|
|
502
|
+
return t3;
|
|
503
|
+
}
|
|
504
|
+
var noise_invert_node_default = NoiseInvertNode;
|
|
505
|
+
|
|
506
|
+
// src/nodes/modifiers/noise-normalize-node.tsx
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
function NoiseNormalizeNode(t0) {
|
|
514
|
+
const $ = _compilerruntime.c.call(void 0, 23);
|
|
515
|
+
const {
|
|
516
|
+
id,
|
|
517
|
+
selected,
|
|
518
|
+
data,
|
|
519
|
+
type
|
|
520
|
+
} = t0;
|
|
521
|
+
const [intervalStart, setIntervalStart] = _react.useState.call(void 0, data.intervalStart);
|
|
522
|
+
const [intervalEnd, setIntervalEnd] = _react.useState.call(void 0, data.intervalEnd);
|
|
523
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
524
|
+
const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
|
|
525
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
526
|
+
let t1;
|
|
527
|
+
let t2;
|
|
528
|
+
if ($[0] !== id || $[1] !== incoming || $[2] !== intervalEnd || $[3] !== intervalStart || $[4] !== updateComputedData || $[5] !== updateNodeData) {
|
|
529
|
+
t1 = () => {
|
|
530
|
+
if (_optionalChain([incoming, 'optionalAccess', _11 => _11.length])) {
|
|
531
|
+
const source = incoming[0].module;
|
|
532
|
+
const module = new (0, _chunkUNMRBZ5Xcjs.NormalizeNoiseModule)(source, intervalStart, intervalEnd);
|
|
533
|
+
updateComputedData(id, {
|
|
534
|
+
module
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
updateNodeData(id, {
|
|
538
|
+
intervalStart,
|
|
539
|
+
intervalEnd
|
|
540
|
+
});
|
|
541
|
+
};
|
|
542
|
+
t2 = [id, incoming, intervalStart, intervalEnd, updateComputedData, updateNodeData];
|
|
543
|
+
$[0] = id;
|
|
544
|
+
$[1] = incoming;
|
|
545
|
+
$[2] = intervalEnd;
|
|
546
|
+
$[3] = intervalStart;
|
|
547
|
+
$[4] = updateComputedData;
|
|
548
|
+
$[5] = updateNodeData;
|
|
549
|
+
$[6] = t1;
|
|
550
|
+
$[7] = t2;
|
|
551
|
+
} else {
|
|
552
|
+
t1 = $[6];
|
|
553
|
+
t2 = $[7];
|
|
554
|
+
}
|
|
555
|
+
_react.useEffect.call(void 0, t1, t2);
|
|
556
|
+
let t3;
|
|
557
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
558
|
+
t3 = (e) => setIntervalStart(Number(e));
|
|
559
|
+
$[8] = t3;
|
|
560
|
+
} else {
|
|
561
|
+
t3 = $[8];
|
|
562
|
+
}
|
|
563
|
+
let t4;
|
|
564
|
+
if ($[9] !== intervalStart) {
|
|
565
|
+
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: intervalStart, onChange: t3 });
|
|
566
|
+
$[9] = intervalStart;
|
|
567
|
+
$[10] = t4;
|
|
568
|
+
} else {
|
|
569
|
+
t4 = $[10];
|
|
570
|
+
}
|
|
571
|
+
let t5;
|
|
572
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
573
|
+
t5 = (e_0) => setIntervalEnd(Number(e_0));
|
|
574
|
+
$[11] = t5;
|
|
575
|
+
} else {
|
|
576
|
+
t5 = $[11];
|
|
577
|
+
}
|
|
578
|
+
let t6;
|
|
579
|
+
if ($[12] !== intervalEnd) {
|
|
580
|
+
t6 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: intervalEnd, onChange: t5 });
|
|
581
|
+
$[12] = intervalEnd;
|
|
582
|
+
$[13] = t6;
|
|
583
|
+
} else {
|
|
584
|
+
t6 = $[13];
|
|
585
|
+
}
|
|
586
|
+
let t7;
|
|
587
|
+
if ($[14] !== t4 || $[15] !== t6) {
|
|
588
|
+
t7 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
|
|
589
|
+
t4,
|
|
590
|
+
t6
|
|
591
|
+
] }) });
|
|
592
|
+
$[14] = t4;
|
|
593
|
+
$[15] = t6;
|
|
594
|
+
$[16] = t7;
|
|
595
|
+
} else {
|
|
596
|
+
t7 = $[16];
|
|
597
|
+
}
|
|
598
|
+
let t8;
|
|
599
|
+
if ($[17] !== data || $[18] !== id || $[19] !== selected || $[20] !== t7 || $[21] !== type) {
|
|
600
|
+
t8 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: t7 });
|
|
601
|
+
$[17] = data;
|
|
602
|
+
$[18] = id;
|
|
603
|
+
$[19] = selected;
|
|
604
|
+
$[20] = t7;
|
|
605
|
+
$[21] = type;
|
|
606
|
+
$[22] = t8;
|
|
607
|
+
} else {
|
|
608
|
+
t8 = $[22];
|
|
609
|
+
}
|
|
610
|
+
return t8;
|
|
611
|
+
}
|
|
612
|
+
var noise_normalize_node_default = NoiseNormalizeNode;
|
|
613
|
+
|
|
614
|
+
// src/nodes/modifiers/noise-scale-bias-node.tsx
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
function NoiseScaleBiasNode(t0) {
|
|
623
|
+
const $ = _compilerruntime.c.call(void 0, 23);
|
|
624
|
+
const {
|
|
625
|
+
id,
|
|
626
|
+
selected,
|
|
627
|
+
data,
|
|
628
|
+
type
|
|
629
|
+
} = t0;
|
|
630
|
+
const [scale, setScale] = _react.useState.call(void 0, data.scale);
|
|
631
|
+
const [bias, setBias] = _react.useState.call(void 0, data.bias);
|
|
632
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
633
|
+
const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
|
|
634
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
635
|
+
let t1;
|
|
636
|
+
let t2;
|
|
637
|
+
if ($[0] !== bias || $[1] !== id || $[2] !== incoming || $[3] !== scale || $[4] !== updateComputedData || $[5] !== updateNodeData) {
|
|
638
|
+
t1 = () => {
|
|
639
|
+
if (_optionalChain([incoming, 'optionalAccess', _12 => _12.length]) > 0) {
|
|
640
|
+
const module = new (0, _libnoisesimplexts.ScaleBias)(incoming[0].module, scale, bias);
|
|
641
|
+
updateComputedData(id, {
|
|
642
|
+
module
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
updateNodeData(id, {
|
|
646
|
+
scale,
|
|
647
|
+
bias
|
|
648
|
+
});
|
|
649
|
+
};
|
|
650
|
+
t2 = [id, incoming, scale, bias, updateComputedData, updateNodeData];
|
|
651
|
+
$[0] = bias;
|
|
652
|
+
$[1] = id;
|
|
653
|
+
$[2] = incoming;
|
|
654
|
+
$[3] = scale;
|
|
655
|
+
$[4] = updateComputedData;
|
|
656
|
+
$[5] = updateNodeData;
|
|
657
|
+
$[6] = t1;
|
|
658
|
+
$[7] = t2;
|
|
659
|
+
} else {
|
|
660
|
+
t1 = $[6];
|
|
661
|
+
t2 = $[7];
|
|
662
|
+
}
|
|
663
|
+
_react.useEffect.call(void 0, t1, t2);
|
|
664
|
+
let t3;
|
|
665
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
666
|
+
t3 = (e) => setScale(Number(e));
|
|
667
|
+
$[8] = t3;
|
|
668
|
+
} else {
|
|
669
|
+
t3 = $[8];
|
|
670
|
+
}
|
|
671
|
+
let t4;
|
|
672
|
+
if ($[9] !== scale) {
|
|
673
|
+
t4 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
|
|
674
|
+
"Scale:",
|
|
675
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: scale, onChange: t3, step: 0.1 })
|
|
676
|
+
] });
|
|
677
|
+
$[9] = scale;
|
|
678
|
+
$[10] = t4;
|
|
679
|
+
} else {
|
|
680
|
+
t4 = $[10];
|
|
681
|
+
}
|
|
682
|
+
let t5;
|
|
683
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
684
|
+
t5 = (e_0) => setBias(Number(e_0));
|
|
685
|
+
$[11] = t5;
|
|
686
|
+
} else {
|
|
687
|
+
t5 = $[11];
|
|
688
|
+
}
|
|
689
|
+
let t6;
|
|
690
|
+
if ($[12] !== bias) {
|
|
691
|
+
t6 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
|
|
692
|
+
"Bias:",
|
|
693
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", w: 100, value: bias, onChange: t5, step: 0.1 })
|
|
694
|
+
] });
|
|
695
|
+
$[12] = bias;
|
|
696
|
+
$[13] = t6;
|
|
697
|
+
} else {
|
|
698
|
+
t6 = $[13];
|
|
699
|
+
}
|
|
700
|
+
let t7;
|
|
701
|
+
if ($[14] !== t4 || $[15] !== t6) {
|
|
702
|
+
t7 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
|
|
703
|
+
t4,
|
|
704
|
+
t6
|
|
705
|
+
] });
|
|
706
|
+
$[14] = t4;
|
|
707
|
+
$[15] = t6;
|
|
708
|
+
$[16] = t7;
|
|
709
|
+
} else {
|
|
710
|
+
t7 = $[16];
|
|
711
|
+
}
|
|
712
|
+
let t8;
|
|
713
|
+
if ($[17] !== data || $[18] !== id || $[19] !== selected || $[20] !== t7 || $[21] !== type) {
|
|
714
|
+
t8 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: t7 });
|
|
715
|
+
$[17] = data;
|
|
716
|
+
$[18] = id;
|
|
717
|
+
$[19] = selected;
|
|
718
|
+
$[20] = t7;
|
|
719
|
+
$[21] = type;
|
|
720
|
+
$[22] = t8;
|
|
721
|
+
} else {
|
|
722
|
+
t8 = $[22];
|
|
723
|
+
}
|
|
724
|
+
return t8;
|
|
725
|
+
}
|
|
726
|
+
var noise_scale_bias_node_default = _react.memo.call(void 0, NoiseScaleBiasNode);
|
|
727
|
+
|
|
728
|
+
// src/nodes/modifiers/noise-terrace-node.tsx
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
function NoiseTerraceNode(t0) {
|
|
741
|
+
const $ = _compilerruntime.c.call(void 0, 27);
|
|
742
|
+
const {
|
|
743
|
+
id,
|
|
744
|
+
selected,
|
|
745
|
+
data,
|
|
746
|
+
type
|
|
747
|
+
} = t0;
|
|
748
|
+
const incoming = _hooks.useIncomingComputedData.call(void 0, id);
|
|
749
|
+
const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
|
|
750
|
+
const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
|
|
751
|
+
let t1;
|
|
752
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
753
|
+
t1 = [];
|
|
754
|
+
$[0] = t1;
|
|
755
|
+
} else {
|
|
756
|
+
t1 = $[0];
|
|
757
|
+
}
|
|
758
|
+
const [values, setValues] = _react.useState.call(void 0, t1);
|
|
759
|
+
let t2;
|
|
760
|
+
let t3;
|
|
761
|
+
if ($[1] !== data.points) {
|
|
762
|
+
t3 = _optionalChain([data, 'access', _13 => _13.points, 'optionalAccess', _14 => _14.length]) ? data.points.map(_temp) : [1, 2].map(_temp2);
|
|
763
|
+
$[1] = data.points;
|
|
764
|
+
$[2] = t3;
|
|
765
|
+
} else {
|
|
766
|
+
t3 = $[2];
|
|
767
|
+
}
|
|
768
|
+
t2 = t3;
|
|
769
|
+
const initialValues = t2;
|
|
770
|
+
let t4;
|
|
771
|
+
if ($[3] !== initialValues) {
|
|
772
|
+
t4 = {
|
|
773
|
+
points: initialValues
|
|
774
|
+
};
|
|
775
|
+
$[3] = initialValues;
|
|
776
|
+
$[4] = t4;
|
|
777
|
+
} else {
|
|
778
|
+
t4 = $[4];
|
|
779
|
+
}
|
|
780
|
+
let t5;
|
|
781
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
782
|
+
t5 = [`points.${_form.FORM_INDEX}.input`];
|
|
783
|
+
$[5] = t5;
|
|
784
|
+
} else {
|
|
785
|
+
t5 = $[5];
|
|
786
|
+
}
|
|
787
|
+
let t6;
|
|
788
|
+
if ($[6] !== t4) {
|
|
789
|
+
t6 = {
|
|
790
|
+
mode: "uncontrolled",
|
|
791
|
+
initialValues: t4,
|
|
792
|
+
validateInputOnChange: t5,
|
|
793
|
+
clearInputErrorOnChange: true
|
|
794
|
+
};
|
|
795
|
+
$[6] = t4;
|
|
796
|
+
$[7] = t6;
|
|
797
|
+
} else {
|
|
798
|
+
t6 = $[7];
|
|
799
|
+
}
|
|
800
|
+
const form = _form.useForm.call(void 0, t6);
|
|
801
|
+
form.watch("points", (values_0) => {
|
|
802
|
+
if (form.isValid()) {
|
|
803
|
+
const points = values_0.value.map(_temp3);
|
|
804
|
+
setValues(points);
|
|
805
|
+
updateNodeData(id, {
|
|
806
|
+
points
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
form.validate();
|
|
810
|
+
});
|
|
811
|
+
let t7;
|
|
812
|
+
let t8;
|
|
813
|
+
if ($[8] !== id || $[9] !== incoming || $[10] !== updateComputedData || $[11] !== values) {
|
|
814
|
+
t7 = () => {
|
|
815
|
+
if (_optionalChain([incoming, 'optionalAccess', _15 => _15.length]) && _optionalChain([values, 'optionalAccess', _16 => _16.length]) >= 2) {
|
|
816
|
+
const module = new (0, _libnoisesimplexts.Terrace)(incoming[0].module, values);
|
|
817
|
+
updateComputedData(id, {
|
|
818
|
+
module
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
t8 = [id, values, incoming, updateComputedData];
|
|
823
|
+
$[8] = id;
|
|
824
|
+
$[9] = incoming;
|
|
825
|
+
$[10] = updateComputedData;
|
|
826
|
+
$[11] = values;
|
|
827
|
+
$[12] = t7;
|
|
828
|
+
$[13] = t8;
|
|
829
|
+
} else {
|
|
830
|
+
t7 = $[12];
|
|
831
|
+
t8 = $[13];
|
|
832
|
+
}
|
|
833
|
+
_react.useEffect.call(void 0, t7, t8);
|
|
834
|
+
let t9;
|
|
835
|
+
let t10;
|
|
836
|
+
if ($[14] !== data.state || $[15] !== form) {
|
|
837
|
+
t10 = form.values.points.map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { mt: "xs", children: [
|
|
838
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.NumberInput, { size: "xs", placeholder: "Input Value", ...form.getInputProps(`points.${index}.value`), step: 0.1 }, form.key(`points.${index}.value`)),
|
|
839
|
+
data.state === _abstract.NodeState.edit && form.values.points.length > 2 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.ActionIcon, { color: "red", variant: "outline", size: "sm", onClick: () => form.removeListItem("points", index), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsreact.IconX, { size: "1rem" }) })
|
|
840
|
+
] }, index));
|
|
841
|
+
$[14] = data.state;
|
|
842
|
+
$[15] = form;
|
|
843
|
+
$[16] = t10;
|
|
844
|
+
} else {
|
|
845
|
+
t10 = $[16];
|
|
846
|
+
}
|
|
847
|
+
t9 = t10;
|
|
848
|
+
const fields = t9;
|
|
849
|
+
let t11;
|
|
850
|
+
if ($[17] !== data.state || $[18] !== form) {
|
|
851
|
+
t11 = data.state === _abstract.NodeState.edit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
852
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Space, { h: 10 }),
|
|
853
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Button, { variant: "outline", size: "xs", fullWidth: true, onClick: () => form.insertListItem("points", {
|
|
854
|
+
value: 0,
|
|
855
|
+
key: _hooks3.randomId.call(void 0, )
|
|
856
|
+
}), children: "Add control point" })
|
|
857
|
+
] });
|
|
858
|
+
$[17] = data.state;
|
|
859
|
+
$[18] = form;
|
|
860
|
+
$[19] = t11;
|
|
861
|
+
} else {
|
|
862
|
+
t11 = $[19];
|
|
863
|
+
}
|
|
864
|
+
let t12;
|
|
865
|
+
if ($[20] !== data || $[21] !== fields || $[22] !== id || $[23] !== selected || $[24] !== t11 || $[25] !== type) {
|
|
866
|
+
t12 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, type, data, children: [
|
|
867
|
+
fields,
|
|
868
|
+
t11
|
|
869
|
+
] }) });
|
|
870
|
+
$[20] = data;
|
|
871
|
+
$[21] = fields;
|
|
872
|
+
$[22] = id;
|
|
873
|
+
$[23] = selected;
|
|
874
|
+
$[24] = t11;
|
|
875
|
+
$[25] = type;
|
|
876
|
+
$[26] = t12;
|
|
877
|
+
} else {
|
|
878
|
+
t12 = $[26];
|
|
879
|
+
}
|
|
880
|
+
return t12;
|
|
881
|
+
}
|
|
882
|
+
function _temp3(v_0) {
|
|
883
|
+
return v_0.value;
|
|
884
|
+
}
|
|
885
|
+
function _temp2() {
|
|
886
|
+
return {
|
|
887
|
+
value: 0,
|
|
888
|
+
key: _hooks3.randomId.call(void 0, )
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
function _temp(v) {
|
|
892
|
+
return {
|
|
893
|
+
value: v,
|
|
894
|
+
key: _hooks3.randomId.call(void 0, )
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
var noise_terrace_node_default = NoiseTerraceNode;
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
exports.noise_abs_node_default = noise_abs_node_default; exports.noise_clamp_node_default = noise_clamp_node_default; exports.NoiseCombineType = NoiseCombineType; exports.noiseCombineModuleMap = noiseCombineModuleMap; exports.noise_combine_node_default = noise_combine_node_default; exports.noise_curve_node_default = noise_curve_node_default; exports.noise_exponent_node_default = noise_exponent_node_default; exports.noise_invert_node_default = noise_invert_node_default; exports.noise_normalize_node_default = noise_normalize_node_default; exports.noise_scale_bias_node_default = noise_scale_bias_node_default; exports.noise_terrace_node_default = noise_terrace_node_default;
|