@awesome-flow/noise 0.5.0 → 0.7.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 +701 -769
- package/dist/abstract/index.d.cts +6 -12
- package/dist/abstract/index.d.ts +6 -12
- package/dist/abstract/index.js +498 -568
- package/dist/{index-BungWYrh.d.cts → index-CfiOpOzX.d.cts} +1 -1
- package/dist/{index-DsQSjZC5.d.ts → index-mlK0X4O1.d.ts} +1 -1
- package/dist/modules/index.cjs +4 -30
- package/dist/modules/index.d.cts +2 -10
- package/dist/modules/index.d.ts +2 -10
- package/dist/modules/index.js +2 -17
- package/dist/{node-props-BbqbXDXn.d.cts → node-props-CAV2WNDN.d.cts} +3 -7
- package/dist/{node-props-BbqbXDXn.d.ts → node-props-CAV2WNDN.d.ts} +3 -7
- package/dist/nodes/generators/index.cjs +71 -114
- package/dist/nodes/generators/index.d.cts +3 -8
- package/dist/nodes/generators/index.d.ts +3 -8
- package/dist/nodes/generators/index.js +47 -79
- package/dist/nodes/index.cjs +642 -710
- package/dist/nodes/index.d.cts +3 -6
- package/dist/nodes/index.d.ts +3 -6
- package/dist/nodes/index.js +443 -512
- package/dist/nodes/modifiers/index.cjs +77 -89
- package/dist/nodes/modifiers/index.d.cts +2 -5
- package/dist/nodes/modifiers/index.d.ts +2 -5
- package/dist/nodes/modifiers/index.js +73 -85
- package/dist/nodes/output/index.cjs +239 -285
- package/dist/nodes/output/index.js +252 -290
- package/dist/nodes/selectors/index.cjs +230 -280
- package/dist/nodes/selectors/index.d.cts +2 -5
- package/dist/nodes/selectors/index.d.ts +2 -5
- package/dist/nodes/selectors/index.js +248 -290
- package/dist/nodes/transformers/index.cjs +10 -10
- package/dist/nodes/transformers/index.d.cts +2 -5
- package/dist/nodes/transformers/index.d.ts +2 -5
- package/dist/nodes/transformers/index.js +5 -5
- package/dist/templates/generators/index.cjs +201 -253
- package/dist/templates/generators/index.d.cts +3 -10
- package/dist/templates/generators/index.d.ts +3 -10
- package/dist/templates/generators/index.js +236 -279
- package/dist/templates/groups/index.cjs +201 -251
- package/dist/templates/groups/index.js +236 -278
- package/dist/templates/index.cjs +201 -253
- package/dist/templates/index.d.cts +4 -7
- package/dist/templates/index.d.ts +4 -7
- package/dist/templates/index.js +236 -279
- package/dist/templates/modifiers/index.cjs +201 -251
- package/dist/templates/modifiers/index.d.cts +2 -5
- package/dist/templates/modifiers/index.d.ts +2 -5
- package/dist/templates/modifiers/index.js +236 -278
- package/dist/templates/output/index.cjs +201 -251
- package/dist/templates/output/index.js +236 -278
- package/dist/templates/selectors/index.cjs +201 -251
- package/dist/templates/selectors/index.d.cts +2 -5
- package/dist/templates/selectors/index.d.ts +2 -5
- package/dist/templates/selectors/index.js +236 -278
- package/dist/templates/transformers/index.cjs +201 -251
- package/dist/templates/transformers/index.d.cts +3 -6
- package/dist/templates/transformers/index.d.ts +3 -6
- package/dist/templates/transformers/index.js +236 -278
- package/package.json +6 -4
|
@@ -24,43 +24,33 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
mod
|
|
25
25
|
));
|
|
26
26
|
|
|
27
|
-
// ../../node_modules/fast-deep-equal/index.js
|
|
27
|
+
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
28
28
|
var require_fast_deep_equal = __commonJS({
|
|
29
|
-
"../../node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
29
|
+
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
30
30
|
"use strict";
|
|
31
31
|
module.exports = function equal(a, b) {
|
|
32
|
-
if (a === b)
|
|
33
|
-
return true;
|
|
32
|
+
if (a === b) return true;
|
|
34
33
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
35
|
-
if (a.constructor !== b.constructor)
|
|
36
|
-
return false;
|
|
34
|
+
if (a.constructor !== b.constructor) return false;
|
|
37
35
|
var length, i, keys;
|
|
38
36
|
if (Array.isArray(a)) {
|
|
39
37
|
length = a.length;
|
|
40
|
-
if (length != b.length)
|
|
41
|
-
return false;
|
|
38
|
+
if (length != b.length) return false;
|
|
42
39
|
for (i = length; i-- !== 0; )
|
|
43
|
-
if (!equal(a[i], b[i]))
|
|
44
|
-
return false;
|
|
40
|
+
if (!equal(a[i], b[i])) return false;
|
|
45
41
|
return true;
|
|
46
42
|
}
|
|
47
|
-
if (a.constructor === RegExp)
|
|
48
|
-
|
|
49
|
-
if (a.
|
|
50
|
-
return a.valueOf() === b.valueOf();
|
|
51
|
-
if (a.toString !== Object.prototype.toString)
|
|
52
|
-
return a.toString() === b.toString();
|
|
43
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
44
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
45
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
53
46
|
keys = Object.keys(a);
|
|
54
47
|
length = keys.length;
|
|
55
|
-
if (length !== Object.keys(b).length)
|
|
56
|
-
return false;
|
|
48
|
+
if (length !== Object.keys(b).length) return false;
|
|
57
49
|
for (i = length; i-- !== 0; )
|
|
58
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
59
|
-
return false;
|
|
50
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
60
51
|
for (i = length; i-- !== 0; ) {
|
|
61
52
|
var key = keys[i];
|
|
62
|
-
if (!equal(a[key], b[key]))
|
|
63
|
-
return false;
|
|
53
|
+
if (!equal(a[key], b[key])) return false;
|
|
64
54
|
}
|
|
65
55
|
return true;
|
|
66
56
|
}
|
|
@@ -73,7 +63,7 @@ var require_fast_deep_equal = __commonJS({
|
|
|
73
63
|
import { NodeContainer, NodeTrackConnections } from "@awesome-flow/core/layout";
|
|
74
64
|
import { useEffect } from "react";
|
|
75
65
|
import { useIncomingComputedData, useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
|
|
76
|
-
import { Abs } from "libnoise-ts
|
|
66
|
+
import { Abs } from "libnoise-simplex-ts";
|
|
77
67
|
import { jsx } from "react/jsx-runtime";
|
|
78
68
|
function NoiseAbsNode({ id, selected, data, type }) {
|
|
79
69
|
const incoming = useIncomingComputedData(id);
|
|
@@ -97,7 +87,7 @@ import {
|
|
|
97
87
|
useUpdateNodeComputedData as useUpdateNodeComputedData2,
|
|
98
88
|
useUpdateNodeData
|
|
99
89
|
} from "@awesome-flow/core/hooks";
|
|
100
|
-
import { Clamp } from "libnoise-ts
|
|
90
|
+
import { Clamp } from "libnoise-simplex-ts";
|
|
101
91
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
102
92
|
function NoiseClampNode({ id, selected, data, type }) {
|
|
103
93
|
const [lowerBound, setLowerBound] = useState(data.lowerBound);
|
|
@@ -157,7 +147,7 @@ import {
|
|
|
157
147
|
} from "@tabler/icons-react";
|
|
158
148
|
|
|
159
149
|
// src/abstract/operations.ts
|
|
160
|
-
import { Add, Max, Min, Multiply, Power } from "libnoise-ts
|
|
150
|
+
import { Add, Max, Min, Multiply, Power } from "libnoise-simplex-ts";
|
|
161
151
|
var noiseCombineModuleMap = {
|
|
162
152
|
["add" /* add */]: Add,
|
|
163
153
|
["max" /* max */]: Max,
|
|
@@ -205,10 +195,10 @@ import {
|
|
|
205
195
|
useUpdateNodeData as useUpdateNodeData3
|
|
206
196
|
} from "@awesome-flow/core/hooks";
|
|
207
197
|
|
|
208
|
-
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
198
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
209
199
|
import { useState as useState5, useCallback as useCallback7 } from "react";
|
|
210
200
|
|
|
211
|
-
// ../../node_modules/@mantine/form/esm/actions/actions.mjs
|
|
201
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/actions/actions.mjs
|
|
212
202
|
import { useLayoutEffect, useEffect as useEffect4 } from "react";
|
|
213
203
|
function validateFormName(name) {
|
|
214
204
|
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
@@ -289,7 +279,7 @@ function useFormActions(name, form) {
|
|
|
289
279
|
useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
|
|
290
280
|
}
|
|
291
281
|
|
|
292
|
-
// ../../node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
|
|
282
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
|
|
293
283
|
function getInputOnChange(setValue) {
|
|
294
284
|
return (val) => {
|
|
295
285
|
if (!val) {
|
|
@@ -313,10 +303,10 @@ function getInputOnChange(setValue) {
|
|
|
313
303
|
};
|
|
314
304
|
}
|
|
315
305
|
|
|
316
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
317
|
-
import { useState as useState2, useCallback as useCallback2 } from "react";
|
|
306
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
307
|
+
import { useState as useState2, useRef, useCallback as useCallback2 } from "react";
|
|
318
308
|
|
|
319
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
309
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
|
|
320
310
|
function filterErrors(errors) {
|
|
321
311
|
if (errors === null || typeof errors !== "object") {
|
|
322
312
|
return {};
|
|
@@ -330,18 +320,21 @@ function filterErrors(errors) {
|
|
|
330
320
|
}, {});
|
|
331
321
|
}
|
|
332
322
|
|
|
333
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
323
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
|
|
334
324
|
function useFormErrors(initialErrors) {
|
|
335
325
|
const [errorsState, setErrorsState] = useState2(filterErrors(initialErrors));
|
|
326
|
+
const errorsRef = useRef(errorsState);
|
|
336
327
|
const setErrors = useCallback2((errors) => {
|
|
337
|
-
setErrorsState(
|
|
338
|
-
|
|
339
|
-
|
|
328
|
+
setErrorsState((current) => {
|
|
329
|
+
const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
|
|
330
|
+
errorsRef.current = newErrors;
|
|
331
|
+
return newErrors;
|
|
332
|
+
});
|
|
340
333
|
}, []);
|
|
341
|
-
const clearErrors = useCallback2(() =>
|
|
334
|
+
const clearErrors = useCallback2(() => setErrors({}), []);
|
|
342
335
|
const clearFieldError = useCallback2(
|
|
343
336
|
(path) => {
|
|
344
|
-
if (
|
|
337
|
+
if (errorsRef.current[path] === void 0) {
|
|
345
338
|
return;
|
|
346
339
|
}
|
|
347
340
|
setErrors((current) => {
|
|
@@ -356,7 +349,7 @@ function useFormErrors(initialErrors) {
|
|
|
356
349
|
(path, error) => {
|
|
357
350
|
if (error == null || error === false) {
|
|
358
351
|
clearFieldError(path);
|
|
359
|
-
} else if (
|
|
352
|
+
} else if (errorsRef.current[path] !== error) {
|
|
360
353
|
setErrors((current) => ({ ...current, [path]: error }));
|
|
361
354
|
}
|
|
362
355
|
},
|
|
@@ -371,10 +364,10 @@ function useFormErrors(initialErrors) {
|
|
|
371
364
|
};
|
|
372
365
|
}
|
|
373
366
|
|
|
374
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
367
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
375
368
|
import { useCallback as useCallback3 } from "react";
|
|
376
369
|
|
|
377
|
-
// ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
370
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/clear-list-state.mjs
|
|
378
371
|
function clearListState(field, state) {
|
|
379
372
|
if (state === null || typeof state !== "object") {
|
|
380
373
|
return {};
|
|
@@ -388,7 +381,7 @@ function clearListState(field, state) {
|
|
|
388
381
|
return clone;
|
|
389
382
|
}
|
|
390
383
|
|
|
391
|
-
// ../../node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
384
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/change-error-indices.mjs
|
|
392
385
|
function getIndexFromKeyAfterPath(key, path) {
|
|
393
386
|
const split = key.substring(path.length + 1).split(".")[0];
|
|
394
387
|
return parseInt(split, 10);
|
|
@@ -428,7 +421,7 @@ function changeErrorIndices(path, index, errors, change) {
|
|
|
428
421
|
return cloned;
|
|
429
422
|
}
|
|
430
423
|
|
|
431
|
-
// ../../node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
424
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/reorder-errors.mjs
|
|
432
425
|
function reorderErrors(path, { from, to }, errors) {
|
|
433
426
|
const oldKeyStart = `${path}.${from}`;
|
|
434
427
|
const newKeyStart = `${path}.${to}`;
|
|
@@ -456,18 +449,15 @@ function reorderErrors(path, { from, to }, errors) {
|
|
|
456
449
|
return clone;
|
|
457
450
|
}
|
|
458
451
|
|
|
459
|
-
// ../../node_modules/klona/full/index.mjs
|
|
452
|
+
// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
|
|
460
453
|
function set(obj, key, val) {
|
|
461
|
-
if (typeof val.value === "object")
|
|
462
|
-
val.value = klona(val.value);
|
|
454
|
+
if (typeof val.value === "object") val.value = klona(val.value);
|
|
463
455
|
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === "__proto__") {
|
|
464
456
|
Object.defineProperty(obj, key, val);
|
|
465
|
-
} else
|
|
466
|
-
obj[key] = val.value;
|
|
457
|
+
} else obj[key] = val.value;
|
|
467
458
|
}
|
|
468
459
|
function klona(x) {
|
|
469
|
-
if (typeof x !== "object")
|
|
470
|
-
return x;
|
|
460
|
+
if (typeof x !== "object") return x;
|
|
471
461
|
var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);
|
|
472
462
|
if (str === "[object Object]") {
|
|
473
463
|
tmp = Object.create(x.__proto__ || null);
|
|
@@ -499,15 +489,14 @@ function klona(x) {
|
|
|
499
489
|
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
500
490
|
}
|
|
501
491
|
for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
502
|
-
if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k])
|
|
503
|
-
continue;
|
|
492
|
+
if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k]) continue;
|
|
504
493
|
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
505
494
|
}
|
|
506
495
|
}
|
|
507
496
|
return tmp || x;
|
|
508
497
|
}
|
|
509
498
|
|
|
510
|
-
// ../../node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
499
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
|
|
511
500
|
function getSplittedPath(path) {
|
|
512
501
|
if (typeof path !== "string") {
|
|
513
502
|
return [];
|
|
@@ -515,7 +504,7 @@ function getSplittedPath(path) {
|
|
|
515
504
|
return path.split(".");
|
|
516
505
|
}
|
|
517
506
|
|
|
518
|
-
// ../../node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
507
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-path.mjs
|
|
519
508
|
function getPath(path, values) {
|
|
520
509
|
const splittedPath = getSplittedPath(path);
|
|
521
510
|
if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
|
|
@@ -531,7 +520,7 @@ function getPath(path, values) {
|
|
|
531
520
|
return value;
|
|
532
521
|
}
|
|
533
522
|
|
|
534
|
-
// ../../node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
523
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/set-path.mjs
|
|
535
524
|
function setPath(path, value, values) {
|
|
536
525
|
const splittedPath = getSplittedPath(path);
|
|
537
526
|
if (splittedPath.length === 0) {
|
|
@@ -553,7 +542,7 @@ function setPath(path, value, values) {
|
|
|
553
542
|
return cloned;
|
|
554
543
|
}
|
|
555
544
|
|
|
556
|
-
// ../../node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
545
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/reorder-path.mjs
|
|
557
546
|
function reorderPath(path, { from, to }, values) {
|
|
558
547
|
const currentValue = getPath(path, values);
|
|
559
548
|
if (!Array.isArray(currentValue)) {
|
|
@@ -566,7 +555,7 @@ function reorderPath(path, { from, to }, values) {
|
|
|
566
555
|
return setPath(path, cloned, values);
|
|
567
556
|
}
|
|
568
557
|
|
|
569
|
-
// ../../node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
558
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/insert-path.mjs
|
|
570
559
|
function insertPath(path, value, index, values) {
|
|
571
560
|
const currentValue = getPath(path, values);
|
|
572
561
|
if (!Array.isArray(currentValue)) {
|
|
@@ -577,7 +566,7 @@ function insertPath(path, value, index, values) {
|
|
|
577
566
|
return setPath(path, cloned, values);
|
|
578
567
|
}
|
|
579
568
|
|
|
580
|
-
// ../../node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
569
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/remove-path.mjs
|
|
581
570
|
function removePath(path, index, values) {
|
|
582
571
|
const currentValue = getPath(path, values);
|
|
583
572
|
if (!Array.isArray(currentValue)) {
|
|
@@ -590,7 +579,7 @@ function removePath(path, index, values) {
|
|
|
590
579
|
);
|
|
591
580
|
}
|
|
592
581
|
|
|
593
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
582
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
|
|
594
583
|
function useFormList({
|
|
595
584
|
$values,
|
|
596
585
|
$errors,
|
|
@@ -623,11 +612,11 @@ function useFormList({
|
|
|
623
612
|
return { reorderListItem, removeListItem, insertListItem };
|
|
624
613
|
}
|
|
625
614
|
|
|
626
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
615
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
627
616
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
628
|
-
import { useState as useState3, useRef, useCallback as useCallback4 } from "react";
|
|
617
|
+
import { useState as useState3, useRef as useRef2, useCallback as useCallback4 } from "react";
|
|
629
618
|
|
|
630
|
-
// ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
619
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-status/get-status.mjs
|
|
631
620
|
function getStatus(status, path) {
|
|
632
621
|
const paths = Object.keys(status);
|
|
633
622
|
if (typeof path === "string") {
|
|
@@ -637,7 +626,7 @@ function getStatus(status, path) {
|
|
|
637
626
|
return paths.some((statusPath) => status[statusPath]);
|
|
638
627
|
}
|
|
639
628
|
|
|
640
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
629
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
|
|
641
630
|
function useFormStatus({
|
|
642
631
|
initialDirty,
|
|
643
632
|
initialTouched,
|
|
@@ -646,8 +635,8 @@ function useFormStatus({
|
|
|
646
635
|
}) {
|
|
647
636
|
const [touchedState, setTouchedState] = useState3(initialTouched);
|
|
648
637
|
const [dirtyState, setDirtyState] = useState3(initialDirty);
|
|
649
|
-
const touchedRef =
|
|
650
|
-
const dirtyRef =
|
|
638
|
+
const touchedRef = useRef2(initialTouched);
|
|
639
|
+
const dirtyRef = useRef2(initialDirty);
|
|
651
640
|
const setTouched = useCallback4((values) => {
|
|
652
641
|
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
653
642
|
touchedRef.current = resolvedValues;
|
|
@@ -741,17 +730,17 @@ function useFormStatus({
|
|
|
741
730
|
};
|
|
742
731
|
}
|
|
743
732
|
|
|
744
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
745
|
-
import { useRef as
|
|
733
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
|
|
734
|
+
import { useRef as useRef3, useState as useState4, useCallback as useCallback5 } from "react";
|
|
746
735
|
function useFormValues({
|
|
747
736
|
initialValues,
|
|
748
737
|
onValuesChange,
|
|
749
738
|
mode
|
|
750
739
|
}) {
|
|
751
|
-
const initialized =
|
|
740
|
+
const initialized = useRef3(false);
|
|
752
741
|
const [stateValues, setStateValues] = useState4(initialValues || {});
|
|
753
|
-
const refValues =
|
|
754
|
-
const valuesSnapshot =
|
|
742
|
+
const refValues = useRef3(stateValues);
|
|
743
|
+
const valuesSnapshot = useRef3(stateValues);
|
|
755
744
|
const setValues = useCallback5(
|
|
756
745
|
({
|
|
757
746
|
values,
|
|
@@ -814,12 +803,12 @@ function useFormValues({
|
|
|
814
803
|
};
|
|
815
804
|
}
|
|
816
805
|
|
|
817
|
-
// ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
818
|
-
import { useRef as
|
|
806
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
|
|
807
|
+
import { useRef as useRef4, useCallback as useCallback6, useEffect as useEffect5 } from "react";
|
|
819
808
|
function useFormWatch({
|
|
820
809
|
$status
|
|
821
810
|
}) {
|
|
822
|
-
const subscribers =
|
|
811
|
+
const subscribers = useRef4(
|
|
823
812
|
{}
|
|
824
813
|
);
|
|
825
814
|
const watch = useCallback6((path, callback) => {
|
|
@@ -851,12 +840,12 @@ function useFormWatch({
|
|
|
851
840
|
};
|
|
852
841
|
}
|
|
853
842
|
|
|
854
|
-
// ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
843
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-data-path.mjs
|
|
855
844
|
function getDataPath(formName, fieldPath) {
|
|
856
845
|
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
857
846
|
}
|
|
858
847
|
|
|
859
|
-
// ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
848
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-values.mjs
|
|
860
849
|
function getValidationResults(errors) {
|
|
861
850
|
const filteredErrors = filterErrors(errors);
|
|
862
851
|
return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
|
|
@@ -894,7 +883,7 @@ function validateValues(validate, values) {
|
|
|
894
883
|
return getValidationResults(validateRulesRecord(validate, values));
|
|
895
884
|
}
|
|
896
885
|
|
|
897
|
-
// ../../node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
886
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-field-value.mjs
|
|
898
887
|
function validateFieldValue(path, rules, values) {
|
|
899
888
|
if (typeof path !== "string") {
|
|
900
889
|
return { hasError: false, error: null };
|
|
@@ -906,10 +895,10 @@ function validateFieldValue(path, rules, values) {
|
|
|
906
895
|
return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
|
|
907
896
|
}
|
|
908
897
|
|
|
909
|
-
// ../../node_modules/@mantine/form/esm/form-index.mjs
|
|
898
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/form-index.mjs
|
|
910
899
|
var FORM_INDEX = "__MANTINE_FORM_INDEX__";
|
|
911
900
|
|
|
912
|
-
// ../../node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
901
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
|
|
913
902
|
function shouldValidateOnChange(path, validateInputOnChange) {
|
|
914
903
|
if (!validateInputOnChange) {
|
|
915
904
|
return false;
|
|
@@ -923,7 +912,7 @@ function shouldValidateOnChange(path, validateInputOnChange) {
|
|
|
923
912
|
return false;
|
|
924
913
|
}
|
|
925
914
|
|
|
926
|
-
// ../../node_modules/@mantine/form/esm/use-form.mjs
|
|
915
|
+
// ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
|
|
927
916
|
function useForm({
|
|
928
917
|
name,
|
|
929
918
|
mode = "controlled",
|
|
@@ -1113,8 +1102,7 @@ function useForm({
|
|
|
1113
1102
|
|
|
1114
1103
|
// src/nodes/modifiers/noise-curve-node.tsx
|
|
1115
1104
|
import { useCallback as useCallback8, useEffect as useEffect6, useState as useState6 } from "react";
|
|
1116
|
-
import { Curve } from "libnoise-ts
|
|
1117
|
-
import { Tuple } from "libnoise-ts/util";
|
|
1105
|
+
import { Curve, Tuple } from "libnoise-simplex-ts";
|
|
1118
1106
|
import { IconX } from "@tabler/icons-react";
|
|
1119
1107
|
import { randomId } from "@mantine/hooks";
|
|
1120
1108
|
import { NodeState } from "@awesome-flow/core/abstract";
|
|
@@ -1227,7 +1215,7 @@ import {
|
|
|
1227
1215
|
useUpdateNodeComputedData as useUpdateNodeComputedData5,
|
|
1228
1216
|
useUpdateNodeData as useUpdateNodeData4
|
|
1229
1217
|
} from "@awesome-flow/core/hooks";
|
|
1230
|
-
import { Exponent } from "libnoise-ts
|
|
1218
|
+
import { Exponent } from "libnoise-simplex-ts";
|
|
1231
1219
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1232
1220
|
function NoiseExponentNode({ id, selected, data, type }) {
|
|
1233
1221
|
const [exponent, setExponent] = useState7(data.exponent);
|
|
@@ -1263,7 +1251,7 @@ var noise_exponent_node_default = NoiseExponentNode;
|
|
|
1263
1251
|
import { NodeContainer as NodeContainer6, NodeTrackConnections as NodeTrackConnections6 } from "@awesome-flow/core/layout";
|
|
1264
1252
|
import { useEffect as useEffect8 } from "react";
|
|
1265
1253
|
import { useIncomingComputedData as useIncomingComputedData6, useUpdateNodeComputedData as useUpdateNodeComputedData6 } from "@awesome-flow/core/hooks";
|
|
1266
|
-
import { Invert } from "libnoise-ts
|
|
1254
|
+
import { Invert } from "libnoise-simplex-ts";
|
|
1267
1255
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1268
1256
|
function NoiseInvertNode({ id, selected, data, type }) {
|
|
1269
1257
|
const incoming = useIncomingComputedData6(id);
|
|
@@ -1289,7 +1277,7 @@ import {
|
|
|
1289
1277
|
} from "@awesome-flow/core/hooks";
|
|
1290
1278
|
|
|
1291
1279
|
// src/modules/normalize-noise-module.ts
|
|
1292
|
-
import ModifierModule from "libnoise-ts
|
|
1280
|
+
import { ModifierModule } from "libnoise-simplex-ts";
|
|
1293
1281
|
var NormalizeNoiseModule = class extends ModifierModule {
|
|
1294
1282
|
constructor(source, lowerBound, upperBound) {
|
|
1295
1283
|
super(source);
|
|
@@ -1355,7 +1343,7 @@ import {
|
|
|
1355
1343
|
useUpdateNodeComputedData as useUpdateNodeComputedData8,
|
|
1356
1344
|
useUpdateNodeData as useUpdateNodeData6
|
|
1357
1345
|
} from "@awesome-flow/core/hooks";
|
|
1358
|
-
import { ScaleBias } from "libnoise-ts
|
|
1346
|
+
import { ScaleBias } from "libnoise-simplex-ts";
|
|
1359
1347
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1360
1348
|
function NoiseScaleBiasNode({ id, selected, data, type }) {
|
|
1361
1349
|
const [scale, setScale] = useState9(data.scale);
|
|
@@ -1413,7 +1401,7 @@ import {
|
|
|
1413
1401
|
useUpdateNodeData as useUpdateNodeData7
|
|
1414
1402
|
} from "@awesome-flow/core/hooks";
|
|
1415
1403
|
import { useCallback as useCallback9, useEffect as useEffect11, useState as useState10 } from "react";
|
|
1416
|
-
import { Terrace } from "libnoise-ts
|
|
1404
|
+
import { Terrace } from "libnoise-simplex-ts";
|
|
1417
1405
|
import { IconX as IconX2 } from "@tabler/icons-react";
|
|
1418
1406
|
import { randomId as randomId2 } from "@mantine/hooks";
|
|
1419
1407
|
import { NodeState as NodeState2 } from "@awesome-flow/core/abstract";
|