@awesome-flow/noise 0.4.0 → 0.6.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.
Files changed (65) hide show
  1. package/dist/abstract/index.cjs +42 -42
  2. package/dist/abstract/index.js +59 -54
  3. package/dist/modules/index.cjs +0 -1
  4. package/dist/modules/index.js +0 -1
  5. package/dist/nodes/generators/index.cjs +0 -1
  6. package/dist/nodes/generators/index.js +0 -1
  7. package/dist/nodes/groups/index.cjs +2 -5
  8. package/dist/nodes/groups/index.js +9 -7
  9. package/dist/nodes/index.cjs +68 -68
  10. package/dist/nodes/index.js +59 -54
  11. package/dist/nodes/modifiers/index.cjs +40 -38
  12. package/dist/nodes/modifiers/index.js +50 -48
  13. package/dist/nodes/output/index.cjs +0 -2
  14. package/dist/nodes/output/index.js +7 -4
  15. package/dist/nodes/selectors/index.cjs +0 -2
  16. package/dist/nodes/selectors/index.js +7 -4
  17. package/dist/nodes/transformers/index.cjs +0 -1
  18. package/dist/nodes/transformers/index.js +0 -1
  19. package/dist/templates/generators/index.cjs +2 -4
  20. package/dist/templates/generators/index.js +7 -4
  21. package/dist/templates/groups/index.cjs +2 -4
  22. package/dist/templates/groups/index.js +7 -4
  23. package/dist/templates/index.cjs +2 -4
  24. package/dist/templates/index.js +7 -4
  25. package/dist/templates/modifiers/index.cjs +0 -2
  26. package/dist/templates/modifiers/index.js +7 -4
  27. package/dist/templates/output/index.cjs +0 -2
  28. package/dist/templates/output/index.js +7 -4
  29. package/dist/templates/selectors/index.cjs +0 -2
  30. package/dist/templates/selectors/index.js +7 -4
  31. package/dist/templates/transformers/index.cjs +0 -2
  32. package/dist/templates/transformers/index.js +7 -4
  33. package/package.json +3 -3
  34. package/dist/abstract/index.cjs.map +0 -1
  35. package/dist/abstract/index.js.map +0 -1
  36. package/dist/modules/index.cjs.map +0 -1
  37. package/dist/modules/index.js.map +0 -1
  38. package/dist/nodes/generators/index.cjs.map +0 -1
  39. package/dist/nodes/generators/index.js.map +0 -1
  40. package/dist/nodes/groups/index.cjs.map +0 -1
  41. package/dist/nodes/groups/index.js.map +0 -1
  42. package/dist/nodes/index.cjs.map +0 -1
  43. package/dist/nodes/index.js.map +0 -1
  44. package/dist/nodes/modifiers/index.cjs.map +0 -1
  45. package/dist/nodes/modifiers/index.js.map +0 -1
  46. package/dist/nodes/output/index.cjs.map +0 -1
  47. package/dist/nodes/output/index.js.map +0 -1
  48. package/dist/nodes/selectors/index.cjs.map +0 -1
  49. package/dist/nodes/selectors/index.js.map +0 -1
  50. package/dist/nodes/transformers/index.cjs.map +0 -1
  51. package/dist/nodes/transformers/index.js.map +0 -1
  52. package/dist/templates/generators/index.cjs.map +0 -1
  53. package/dist/templates/generators/index.js.map +0 -1
  54. package/dist/templates/groups/index.cjs.map +0 -1
  55. package/dist/templates/groups/index.js.map +0 -1
  56. package/dist/templates/index.cjs.map +0 -1
  57. package/dist/templates/index.js.map +0 -1
  58. package/dist/templates/modifiers/index.cjs.map +0 -1
  59. package/dist/templates/modifiers/index.js.map +0 -1
  60. package/dist/templates/output/index.cjs.map +0 -1
  61. package/dist/templates/output/index.js.map +0 -1
  62. package/dist/templates/selectors/index.cjs.map +0 -1
  63. package/dist/templates/selectors/index.js.map +0 -1
  64. package/dist/templates/transformers/index.cjs.map +0 -1
  65. package/dist/templates/transformers/index.js.map +0 -1
@@ -24,9 +24,9 @@ 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
32
  if (a === b)
@@ -403,11 +403,15 @@ var position_grid_node_default = PositionGridNode;
403
403
  // src/nodes/groups/module-group-node.tsx
404
404
  import { NodeContainer as NodeContainer12, NodeCollapse, NodeTrackConnections as NodeTrackConnections7 } from "@awesome-flow/core/layout";
405
405
  import { NodeResizer, useStore, useUpdateNodeInternals } from "@xyflow/react";
406
- import { FlowContext } from "@awesome-flow/core/abstract";
407
- import { useCallback as useCallback7, useContext, useEffect as useEffect6, useMemo as useMemo9 } from "react";
406
+ import { useCallback as useCallback7, useEffect as useEffect6, useMemo as useMemo9 } from "react";
408
407
  import { shallow } from "zustand/shallow";
409
408
  import { Badge, Group as Group4 } from "@mantine/core";
410
- import { useIncomingComputedData, useUpdateNodeComputedData as useUpdateNodeComputedData12 } from "@awesome-flow/core/hooks";
409
+ import {
410
+ useFlowStore,
411
+ useIncomingComputedData,
412
+ useInteractiveStore,
413
+ useUpdateNodeComputedData as useUpdateNodeComputedData12
414
+ } from "@awesome-flow/core/hooks";
411
415
  import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
412
416
  function ModuleGroupNode({
413
417
  id,
@@ -417,16 +421,15 @@ function ModuleGroupNode({
417
421
  width,
418
422
  height
419
423
  }) {
420
- const context = useContext(FlowContext);
421
424
  const updateNodeInternals = useUpdateNodeInternals();
422
425
  const triggerNodeChanges = useStore((s) => s.triggerNodeChanges);
423
- const { groupNodes, setGroupCollapsed } = context.useFlowStore(
426
+ const { groupNodes, setGroupCollapsed } = useFlowStore(
424
427
  useCallback7(
425
428
  (state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
426
429
  []
427
430
  )
428
431
  );
429
- const intersectingNode = context.useInteractivityStore(
432
+ const intersectingNode = useInteractiveStore(
430
433
  useCallback7((state) => state.nodeIntersectionTargets[id], [id]),
431
434
  shallow
432
435
  );
@@ -623,10 +626,10 @@ import {
623
626
  useUpdateNodeData as useUpdateNodeData6
624
627
  } from "@awesome-flow/core/hooks";
625
628
 
626
- // ../../node_modules/@mantine/form/esm/use-form.mjs
629
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
627
630
  import { useState as useState8, useCallback as useCallback14 } from "react";
628
631
 
629
- // ../../node_modules/@mantine/form/esm/actions/actions.mjs
632
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/actions/actions.mjs
630
633
  import { useLayoutEffect, useEffect as useEffect10 } from "react";
631
634
  function validateFormName(name) {
632
635
  if (!/^[0-9a-zA-Z-]+$/.test(name)) {
@@ -707,7 +710,7 @@ function useFormActions(name, form) {
707
710
  useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
708
711
  }
709
712
 
710
- // ../../node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
713
+ // ../../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
711
714
  function getInputOnChange(setValue) {
712
715
  return (val) => {
713
716
  if (!val) {
@@ -731,10 +734,10 @@ function getInputOnChange(setValue) {
731
734
  };
732
735
  }
733
736
 
734
- // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
735
- import { useState as useState5, useCallback as useCallback9 } from "react";
737
+ // ../../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
738
+ import { useState as useState5, useRef, useCallback as useCallback9 } from "react";
736
739
 
737
- // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
740
+ // ../../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
738
741
  function filterErrors(errors) {
739
742
  if (errors === null || typeof errors !== "object") {
740
743
  return {};
@@ -748,18 +751,21 @@ function filterErrors(errors) {
748
751
  }, {});
749
752
  }
750
753
 
751
- // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
754
+ // ../../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
752
755
  function useFormErrors(initialErrors) {
753
756
  const [errorsState, setErrorsState] = useState5(filterErrors(initialErrors));
757
+ const errorsRef = useRef(errorsState);
754
758
  const setErrors = useCallback9((errors) => {
755
- setErrorsState(
756
- (current) => filterErrors(typeof errors === "function" ? errors(current) : errors)
757
- );
759
+ setErrorsState((current) => {
760
+ const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
761
+ errorsRef.current = newErrors;
762
+ return newErrors;
763
+ });
758
764
  }, []);
759
- const clearErrors = useCallback9(() => setErrorsState({}), []);
765
+ const clearErrors = useCallback9(() => setErrors({}), []);
760
766
  const clearFieldError = useCallback9(
761
767
  (path) => {
762
- if (errorsState[path] === void 0) {
768
+ if (errorsRef.current[path] === void 0) {
763
769
  return;
764
770
  }
765
771
  setErrors((current) => {
@@ -774,7 +780,7 @@ function useFormErrors(initialErrors) {
774
780
  (path, error) => {
775
781
  if (error == null || error === false) {
776
782
  clearFieldError(path);
777
- } else if (errorsState[path] !== error) {
783
+ } else if (errorsRef.current[path] !== error) {
778
784
  setErrors((current) => ({ ...current, [path]: error }));
779
785
  }
780
786
  },
@@ -789,10 +795,10 @@ function useFormErrors(initialErrors) {
789
795
  };
790
796
  }
791
797
 
792
- // ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
798
+ // ../../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
793
799
  import { useCallback as useCallback10 } from "react";
794
800
 
795
- // ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
801
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/clear-list-state.mjs
796
802
  function clearListState(field, state) {
797
803
  if (state === null || typeof state !== "object") {
798
804
  return {};
@@ -806,7 +812,7 @@ function clearListState(field, state) {
806
812
  return clone;
807
813
  }
808
814
 
809
- // ../../node_modules/@mantine/form/esm/lists/change-error-indices.mjs
815
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/change-error-indices.mjs
810
816
  function getIndexFromKeyAfterPath(key, path) {
811
817
  const split = key.substring(path.length + 1).split(".")[0];
812
818
  return parseInt(split, 10);
@@ -846,7 +852,7 @@ function changeErrorIndices(path, index, errors, change) {
846
852
  return cloned;
847
853
  }
848
854
 
849
- // ../../node_modules/@mantine/form/esm/lists/reorder-errors.mjs
855
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/reorder-errors.mjs
850
856
  function reorderErrors(path, { from, to }, errors) {
851
857
  const oldKeyStart = `${path}.${from}`;
852
858
  const newKeyStart = `${path}.${to}`;
@@ -874,7 +880,7 @@ function reorderErrors(path, { from, to }, errors) {
874
880
  return clone;
875
881
  }
876
882
 
877
- // ../../node_modules/klona/full/index.mjs
883
+ // ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
878
884
  function set(obj, key, val) {
879
885
  if (typeof val.value === "object")
880
886
  val.value = klona(val.value);
@@ -925,7 +931,7 @@ function klona(x) {
925
931
  return tmp || x;
926
932
  }
927
933
 
928
- // ../../node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
934
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
929
935
  function getSplittedPath(path) {
930
936
  if (typeof path !== "string") {
931
937
  return [];
@@ -933,7 +939,7 @@ function getSplittedPath(path) {
933
939
  return path.split(".");
934
940
  }
935
941
 
936
- // ../../node_modules/@mantine/form/esm/paths/get-path.mjs
942
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-path.mjs
937
943
  function getPath(path, values) {
938
944
  const splittedPath = getSplittedPath(path);
939
945
  if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
@@ -949,7 +955,7 @@ function getPath(path, values) {
949
955
  return value;
950
956
  }
951
957
 
952
- // ../../node_modules/@mantine/form/esm/paths/set-path.mjs
958
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/set-path.mjs
953
959
  function setPath(path, value, values) {
954
960
  const splittedPath = getSplittedPath(path);
955
961
  if (splittedPath.length === 0) {
@@ -971,7 +977,7 @@ function setPath(path, value, values) {
971
977
  return cloned;
972
978
  }
973
979
 
974
- // ../../node_modules/@mantine/form/esm/paths/reorder-path.mjs
980
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/reorder-path.mjs
975
981
  function reorderPath(path, { from, to }, values) {
976
982
  const currentValue = getPath(path, values);
977
983
  if (!Array.isArray(currentValue)) {
@@ -984,7 +990,7 @@ function reorderPath(path, { from, to }, values) {
984
990
  return setPath(path, cloned, values);
985
991
  }
986
992
 
987
- // ../../node_modules/@mantine/form/esm/paths/insert-path.mjs
993
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/insert-path.mjs
988
994
  function insertPath(path, value, index, values) {
989
995
  const currentValue = getPath(path, values);
990
996
  if (!Array.isArray(currentValue)) {
@@ -995,7 +1001,7 @@ function insertPath(path, value, index, values) {
995
1001
  return setPath(path, cloned, values);
996
1002
  }
997
1003
 
998
- // ../../node_modules/@mantine/form/esm/paths/remove-path.mjs
1004
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/remove-path.mjs
999
1005
  function removePath(path, index, values) {
1000
1006
  const currentValue = getPath(path, values);
1001
1007
  if (!Array.isArray(currentValue)) {
@@ -1008,7 +1014,7 @@ function removePath(path, index, values) {
1008
1014
  );
1009
1015
  }
1010
1016
 
1011
- // ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
1017
+ // ../../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
1012
1018
  function useFormList({
1013
1019
  $values,
1014
1020
  $errors,
@@ -1041,11 +1047,11 @@ function useFormList({
1041
1047
  return { reorderListItem, removeListItem, insertListItem };
1042
1048
  }
1043
1049
 
1044
- // ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
1050
+ // ../../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
1045
1051
  var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
1046
- import { useState as useState6, useRef, useCallback as useCallback11 } from "react";
1052
+ import { useState as useState6, useRef as useRef2, useCallback as useCallback11 } from "react";
1047
1053
 
1048
- // ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
1054
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-status/get-status.mjs
1049
1055
  function getStatus(status, path) {
1050
1056
  const paths = Object.keys(status);
1051
1057
  if (typeof path === "string") {
@@ -1055,7 +1061,7 @@ function getStatus(status, path) {
1055
1061
  return paths.some((statusPath) => status[statusPath]);
1056
1062
  }
1057
1063
 
1058
- // ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
1064
+ // ../../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
1059
1065
  function useFormStatus({
1060
1066
  initialDirty,
1061
1067
  initialTouched,
@@ -1064,8 +1070,8 @@ function useFormStatus({
1064
1070
  }) {
1065
1071
  const [touchedState, setTouchedState] = useState6(initialTouched);
1066
1072
  const [dirtyState, setDirtyState] = useState6(initialDirty);
1067
- const touchedRef = useRef(initialTouched);
1068
- const dirtyRef = useRef(initialDirty);
1073
+ const touchedRef = useRef2(initialTouched);
1074
+ const dirtyRef = useRef2(initialDirty);
1069
1075
  const setTouched = useCallback11((values) => {
1070
1076
  const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
1071
1077
  touchedRef.current = resolvedValues;
@@ -1159,17 +1165,17 @@ function useFormStatus({
1159
1165
  };
1160
1166
  }
1161
1167
 
1162
- // ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
1163
- import { useRef as useRef2, useState as useState7, useCallback as useCallback12 } from "react";
1168
+ // ../../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
1169
+ import { useRef as useRef3, useState as useState7, useCallback as useCallback12 } from "react";
1164
1170
  function useFormValues({
1165
1171
  initialValues,
1166
1172
  onValuesChange,
1167
1173
  mode
1168
1174
  }) {
1169
- const initialized = useRef2(false);
1175
+ const initialized = useRef3(false);
1170
1176
  const [stateValues, setStateValues] = useState7(initialValues || {});
1171
- const refValues = useRef2(stateValues);
1172
- const valuesSnapshot = useRef2(stateValues);
1177
+ const refValues = useRef3(stateValues);
1178
+ const valuesSnapshot = useRef3(stateValues);
1173
1179
  const setValues = useCallback12(
1174
1180
  ({
1175
1181
  values,
@@ -1232,12 +1238,12 @@ function useFormValues({
1232
1238
  };
1233
1239
  }
1234
1240
 
1235
- // ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
1236
- import { useRef as useRef3, useCallback as useCallback13, useEffect as useEffect11 } from "react";
1241
+ // ../../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
1242
+ import { useRef as useRef4, useCallback as useCallback13, useEffect as useEffect11 } from "react";
1237
1243
  function useFormWatch({
1238
1244
  $status
1239
1245
  }) {
1240
- const subscribers = useRef3(
1246
+ const subscribers = useRef4(
1241
1247
  {}
1242
1248
  );
1243
1249
  const watch = useCallback13((path, callback) => {
@@ -1269,12 +1275,12 @@ function useFormWatch({
1269
1275
  };
1270
1276
  }
1271
1277
 
1272
- // ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
1278
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-data-path.mjs
1273
1279
  function getDataPath(formName, fieldPath) {
1274
1280
  return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
1275
1281
  }
1276
1282
 
1277
- // ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
1283
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-values.mjs
1278
1284
  function getValidationResults(errors) {
1279
1285
  const filteredErrors = filterErrors(errors);
1280
1286
  return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
@@ -1312,7 +1318,7 @@ function validateValues(validate, values) {
1312
1318
  return getValidationResults(validateRulesRecord(validate, values));
1313
1319
  }
1314
1320
 
1315
- // ../../node_modules/@mantine/form/esm/validate/validate-field-value.mjs
1321
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-field-value.mjs
1316
1322
  function validateFieldValue(path, rules, values) {
1317
1323
  if (typeof path !== "string") {
1318
1324
  return { hasError: false, error: null };
@@ -1324,10 +1330,10 @@ function validateFieldValue(path, rules, values) {
1324
1330
  return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
1325
1331
  }
1326
1332
 
1327
- // ../../node_modules/@mantine/form/esm/form-index.mjs
1333
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/form-index.mjs
1328
1334
  var FORM_INDEX = "__MANTINE_FORM_INDEX__";
1329
1335
 
1330
- // ../../node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
1336
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
1331
1337
  function shouldValidateOnChange(path, validateInputOnChange) {
1332
1338
  if (!validateInputOnChange) {
1333
1339
  return false;
@@ -1341,7 +1347,7 @@ function shouldValidateOnChange(path, validateInputOnChange) {
1341
1347
  return false;
1342
1348
  }
1343
1349
 
1344
- // ../../node_modules/@mantine/form/esm/use-form.mjs
1350
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
1345
1351
  function useForm({
1346
1352
  name,
1347
1353
  mode = "controlled",
@@ -3499,4 +3505,3 @@ export {
3499
3505
  position_grid_node_default as PositionGridNode,
3500
3506
  positions_logger_node_default as PositionsLoggerNode
3501
3507
  };
3502
- //# sourceMappingURL=index.js.map
@@ -29,9 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  ));
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
- // ../../node_modules/fast-deep-equal/index.js
32
+ // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
33
33
  var require_fast_deep_equal = __commonJS({
34
- "../../node_modules/fast-deep-equal/index.js"(exports2, module2) {
34
+ "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports2, module2) {
35
35
  "use strict";
36
36
  module2.exports = function equal(a, b) {
37
37
  if (a === b)
@@ -207,10 +207,10 @@ var import_layout4 = require("@awesome-flow/core/layout");
207
207
  var import_core2 = require("@mantine/core");
208
208
  var import_hooks4 = require("@awesome-flow/core/hooks");
209
209
 
210
- // ../../node_modules/@mantine/form/esm/use-form.mjs
210
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
211
211
  var import_react10 = require("react");
212
212
 
213
- // ../../node_modules/@mantine/form/esm/actions/actions.mjs
213
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/actions/actions.mjs
214
214
  var import_react4 = require("react");
215
215
  function validateFormName(name) {
216
216
  if (!/^[0-9a-zA-Z-]+$/.test(name)) {
@@ -291,7 +291,7 @@ function useFormActions(name, form) {
291
291
  useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
292
292
  }
293
293
 
294
- // ../../node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
294
+ // ../../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
295
295
  function getInputOnChange(setValue) {
296
296
  return (val) => {
297
297
  if (!val) {
@@ -315,10 +315,10 @@ function getInputOnChange(setValue) {
315
315
  };
316
316
  }
317
317
 
318
- // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
318
+ // ../../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
319
319
  var import_react5 = require("react");
320
320
 
321
- // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
321
+ // ../../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
322
322
  function filterErrors(errors) {
323
323
  if (errors === null || typeof errors !== "object") {
324
324
  return {};
@@ -332,18 +332,21 @@ function filterErrors(errors) {
332
332
  }, {});
333
333
  }
334
334
 
335
- // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
335
+ // ../../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
336
336
  function useFormErrors(initialErrors) {
337
337
  const [errorsState, setErrorsState] = (0, import_react5.useState)(filterErrors(initialErrors));
338
+ const errorsRef = (0, import_react5.useRef)(errorsState);
338
339
  const setErrors = (0, import_react5.useCallback)((errors) => {
339
- setErrorsState(
340
- (current) => filterErrors(typeof errors === "function" ? errors(current) : errors)
341
- );
340
+ setErrorsState((current) => {
341
+ const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
342
+ errorsRef.current = newErrors;
343
+ return newErrors;
344
+ });
342
345
  }, []);
343
- const clearErrors = (0, import_react5.useCallback)(() => setErrorsState({}), []);
346
+ const clearErrors = (0, import_react5.useCallback)(() => setErrors({}), []);
344
347
  const clearFieldError = (0, import_react5.useCallback)(
345
348
  (path) => {
346
- if (errorsState[path] === void 0) {
349
+ if (errorsRef.current[path] === void 0) {
347
350
  return;
348
351
  }
349
352
  setErrors((current) => {
@@ -358,7 +361,7 @@ function useFormErrors(initialErrors) {
358
361
  (path, error) => {
359
362
  if (error == null || error === false) {
360
363
  clearFieldError(path);
361
- } else if (errorsState[path] !== error) {
364
+ } else if (errorsRef.current[path] !== error) {
362
365
  setErrors((current) => ({ ...current, [path]: error }));
363
366
  }
364
367
  },
@@ -373,10 +376,10 @@ function useFormErrors(initialErrors) {
373
376
  };
374
377
  }
375
378
 
376
- // ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
379
+ // ../../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
377
380
  var import_react6 = require("react");
378
381
 
379
- // ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
382
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/clear-list-state.mjs
380
383
  function clearListState(field, state) {
381
384
  if (state === null || typeof state !== "object") {
382
385
  return {};
@@ -390,7 +393,7 @@ function clearListState(field, state) {
390
393
  return clone;
391
394
  }
392
395
 
393
- // ../../node_modules/@mantine/form/esm/lists/change-error-indices.mjs
396
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/change-error-indices.mjs
394
397
  function getIndexFromKeyAfterPath(key, path) {
395
398
  const split = key.substring(path.length + 1).split(".")[0];
396
399
  return parseInt(split, 10);
@@ -430,7 +433,7 @@ function changeErrorIndices(path, index, errors, change) {
430
433
  return cloned;
431
434
  }
432
435
 
433
- // ../../node_modules/@mantine/form/esm/lists/reorder-errors.mjs
436
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/lists/reorder-errors.mjs
434
437
  function reorderErrors(path, { from, to }, errors) {
435
438
  const oldKeyStart = `${path}.${from}`;
436
439
  const newKeyStart = `${path}.${to}`;
@@ -458,7 +461,7 @@ function reorderErrors(path, { from, to }, errors) {
458
461
  return clone;
459
462
  }
460
463
 
461
- // ../../node_modules/klona/full/index.mjs
464
+ // ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
462
465
  function set(obj, key, val) {
463
466
  if (typeof val.value === "object")
464
467
  val.value = klona(val.value);
@@ -509,7 +512,7 @@ function klona(x) {
509
512
  return tmp || x;
510
513
  }
511
514
 
512
- // ../../node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
515
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
513
516
  function getSplittedPath(path) {
514
517
  if (typeof path !== "string") {
515
518
  return [];
@@ -517,7 +520,7 @@ function getSplittedPath(path) {
517
520
  return path.split(".");
518
521
  }
519
522
 
520
- // ../../node_modules/@mantine/form/esm/paths/get-path.mjs
523
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-path.mjs
521
524
  function getPath(path, values) {
522
525
  const splittedPath = getSplittedPath(path);
523
526
  if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
@@ -533,7 +536,7 @@ function getPath(path, values) {
533
536
  return value;
534
537
  }
535
538
 
536
- // ../../node_modules/@mantine/form/esm/paths/set-path.mjs
539
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/set-path.mjs
537
540
  function setPath(path, value, values) {
538
541
  const splittedPath = getSplittedPath(path);
539
542
  if (splittedPath.length === 0) {
@@ -555,7 +558,7 @@ function setPath(path, value, values) {
555
558
  return cloned;
556
559
  }
557
560
 
558
- // ../../node_modules/@mantine/form/esm/paths/reorder-path.mjs
561
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/reorder-path.mjs
559
562
  function reorderPath(path, { from, to }, values) {
560
563
  const currentValue = getPath(path, values);
561
564
  if (!Array.isArray(currentValue)) {
@@ -568,7 +571,7 @@ function reorderPath(path, { from, to }, values) {
568
571
  return setPath(path, cloned, values);
569
572
  }
570
573
 
571
- // ../../node_modules/@mantine/form/esm/paths/insert-path.mjs
574
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/insert-path.mjs
572
575
  function insertPath(path, value, index, values) {
573
576
  const currentValue = getPath(path, values);
574
577
  if (!Array.isArray(currentValue)) {
@@ -579,7 +582,7 @@ function insertPath(path, value, index, values) {
579
582
  return setPath(path, cloned, values);
580
583
  }
581
584
 
582
- // ../../node_modules/@mantine/form/esm/paths/remove-path.mjs
585
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/remove-path.mjs
583
586
  function removePath(path, index, values) {
584
587
  const currentValue = getPath(path, values);
585
588
  if (!Array.isArray(currentValue)) {
@@ -592,7 +595,7 @@ function removePath(path, index, values) {
592
595
  );
593
596
  }
594
597
 
595
- // ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
598
+ // ../../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
596
599
  function useFormList({
597
600
  $values,
598
601
  $errors,
@@ -625,11 +628,11 @@ function useFormList({
625
628
  return { reorderListItem, removeListItem, insertListItem };
626
629
  }
627
630
 
628
- // ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
631
+ // ../../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
629
632
  var import_react7 = require("react");
630
633
  var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
631
634
 
632
- // ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
635
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/get-status/get-status.mjs
633
636
  function getStatus(status, path) {
634
637
  const paths = Object.keys(status);
635
638
  if (typeof path === "string") {
@@ -639,7 +642,7 @@ function getStatus(status, path) {
639
642
  return paths.some((statusPath) => status[statusPath]);
640
643
  }
641
644
 
642
- // ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
645
+ // ../../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
643
646
  function useFormStatus({
644
647
  initialDirty,
645
648
  initialTouched,
@@ -743,7 +746,7 @@ function useFormStatus({
743
746
  };
744
747
  }
745
748
 
746
- // ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
749
+ // ../../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
747
750
  var import_react8 = require("react");
748
751
  function useFormValues({
749
752
  initialValues,
@@ -816,7 +819,7 @@ function useFormValues({
816
819
  };
817
820
  }
818
821
 
819
- // ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
822
+ // ../../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
820
823
  var import_react9 = require("react");
821
824
  function useFormWatch({
822
825
  $status
@@ -853,12 +856,12 @@ function useFormWatch({
853
856
  };
854
857
  }
855
858
 
856
- // ../../node_modules/@mantine/form/esm/paths/get-data-path.mjs
859
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/paths/get-data-path.mjs
857
860
  function getDataPath(formName, fieldPath) {
858
861
  return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
859
862
  }
860
863
 
861
- // ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
864
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-values.mjs
862
865
  function getValidationResults(errors) {
863
866
  const filteredErrors = filterErrors(errors);
864
867
  return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
@@ -896,7 +899,7 @@ function validateValues(validate, values) {
896
899
  return getValidationResults(validateRulesRecord(validate, values));
897
900
  }
898
901
 
899
- // ../../node_modules/@mantine/form/esm/validate/validate-field-value.mjs
902
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/validate-field-value.mjs
900
903
  function validateFieldValue(path, rules, values) {
901
904
  if (typeof path !== "string") {
902
905
  return { hasError: false, error: null };
@@ -908,10 +911,10 @@ function validateFieldValue(path, rules, values) {
908
911
  return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
909
912
  }
910
913
 
911
- // ../../node_modules/@mantine/form/esm/form-index.mjs
914
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/form-index.mjs
912
915
  var FORM_INDEX = "__MANTINE_FORM_INDEX__";
913
916
 
914
- // ../../node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
917
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
915
918
  function shouldValidateOnChange(path, validateInputOnChange) {
916
919
  if (!validateInputOnChange) {
917
920
  return false;
@@ -925,7 +928,7 @@ function shouldValidateOnChange(path, validateInputOnChange) {
925
928
  return false;
926
929
  }
927
930
 
928
- // ../../node_modules/@mantine/form/esm/use-form.mjs
931
+ // ../../node_modules/.pnpm/@mantine+form@7.10.1_react@18.3.1/node_modules/@mantine/form/esm/use-form.mjs
929
932
  function useForm({
930
933
  name,
931
934
  mode = "controlled",
@@ -1488,4 +1491,3 @@ var noise_terrace_node_default = NoiseTerraceNode;
1488
1491
  NoiseScaleBiasNode,
1489
1492
  NoiseTerraceNode
1490
1493
  });
1491
- //# sourceMappingURL=index.cjs.map