attaform 0.21.2 → 0.22.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 (79) hide show
  1. package/dist/chunks/dev-key-collision-warnings.cjs +1 -1
  2. package/dist/chunks/dev-key-collision-warnings.mjs +1 -1
  3. package/dist/chunks/devtools.cjs +1 -1
  4. package/dist/chunks/devtools.mjs +1 -1
  5. package/dist/chunks/fingerprint2.cjs +1 -1
  6. package/dist/chunks/fingerprint2.mjs +1 -1
  7. package/dist/chunks/indexeddb.cjs +1 -1
  8. package/dist/chunks/indexeddb.mjs +1 -1
  9. package/dist/chunks/local-storage.cjs +1 -1
  10. package/dist/chunks/local-storage.mjs +1 -1
  11. package/dist/chunks/multi-tab-sync.cjs +2 -2
  12. package/dist/chunks/multi-tab-sync.mjs +2 -2
  13. package/dist/chunks/session-storage.cjs +1 -1
  14. package/dist/chunks/session-storage.mjs +1 -1
  15. package/dist/chunks/wire-persistence.cjs +2 -2
  16. package/dist/chunks/wire-persistence.mjs +2 -2
  17. package/dist/index.cjs +3 -3
  18. package/dist/index.d.cts +4 -4
  19. package/dist/index.d.mts +4 -4
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.mjs +5 -5
  22. package/dist/nuxt.d.cts +1 -1
  23. package/dist/nuxt.d.mts +1 -1
  24. package/dist/nuxt.d.ts +1 -1
  25. package/dist/runtime/plugins/attaform.cjs +2 -2
  26. package/dist/runtime/plugins/attaform.mjs +2 -2
  27. package/dist/shared/{attaform.B5LNzqQh.cjs → attaform.01iKS_lz.cjs} +18 -5
  28. package/dist/shared/{attaform.DP-u7_tk.mjs.map → attaform.01iKS_lz.cjs.map} +1 -1
  29. package/dist/shared/{attaform.C41gjp-a.mjs → attaform.6xE0Lcfd.mjs} +2 -2
  30. package/dist/shared/{attaform.C41gjp-a.mjs.map → attaform.6xE0Lcfd.mjs.map} +1 -1
  31. package/dist/shared/{attaform.BBDIKtKY.cjs → attaform.AyujQoHp.cjs} +4 -4
  32. package/dist/shared/{attaform.BBDIKtKY.cjs.map → attaform.AyujQoHp.cjs.map} +1 -1
  33. package/dist/shared/{attaform.BGf_J22U.d.ts → attaform.BGwNZ9GV.d.cts} +10 -2
  34. package/dist/shared/{attaform.DP-u7_tk.mjs → attaform.BKFwekY2.mjs} +16 -6
  35. package/dist/shared/{attaform.B5LNzqQh.cjs.map → attaform.BKFwekY2.mjs.map} +1 -1
  36. package/dist/shared/{attaform.CcnF1AKJ.cjs → attaform.C-RtnCJM.cjs} +116 -47
  37. package/dist/shared/attaform.C-RtnCJM.cjs.map +1 -0
  38. package/dist/shared/{attaform.BkjJfMvJ.d.cts → attaform.CCCeEPwa.d.mts} +10 -2
  39. package/dist/shared/{attaform.BwLp9KM7.cjs → attaform.CRzpFCjV.cjs} +2 -2
  40. package/dist/shared/{attaform.BwLp9KM7.cjs.map → attaform.CRzpFCjV.cjs.map} +1 -1
  41. package/dist/shared/{attaform.D2ZuIOCf.cjs → attaform.CjMcwV7W.cjs} +557 -126
  42. package/dist/shared/attaform.CjMcwV7W.cjs.map +1 -0
  43. package/dist/shared/{attaform.CTheKoTc.mjs → attaform.CsB-iKbU.mjs} +557 -126
  44. package/dist/shared/attaform.CsB-iKbU.mjs.map +1 -0
  45. package/dist/shared/{attaform.BCcrLApm.d.mts → attaform.D4XYaasQ.d.ts} +10 -2
  46. package/dist/shared/{attaform.D6GYGshL.mjs → attaform.DCjgGir_.mjs} +3 -3
  47. package/dist/shared/{attaform.D6GYGshL.mjs.map → attaform.DCjgGir_.mjs.map} +1 -1
  48. package/dist/shared/{attaform.BVeLgfEh.mjs → attaform.DNuiFCXG.mjs} +4 -4
  49. package/dist/shared/{attaform.BVeLgfEh.mjs.map → attaform.DNuiFCXG.mjs.map} +1 -1
  50. package/dist/shared/{attaform.BYgioWLF.d.ts → attaform.DUMWQefY.d.ts} +1 -1
  51. package/dist/shared/{attaform.CrD73S4m.mjs → attaform.DgCfLqay.mjs} +116 -47
  52. package/dist/shared/attaform.DgCfLqay.mjs.map +1 -0
  53. package/dist/shared/{attaform.ory-3WhV.d.ts → attaform.DvUH4a3o.d.cts} +181 -6
  54. package/dist/shared/{attaform.ory-3WhV.d.cts → attaform.DvUH4a3o.d.mts} +181 -6
  55. package/dist/shared/{attaform.ory-3WhV.d.mts → attaform.DvUH4a3o.d.ts} +181 -6
  56. package/dist/shared/{attaform.BoY6RZUl.d.cts → attaform.FN0vaQAg.d.mts} +1 -1
  57. package/dist/shared/{attaform.BwrowMp2.cjs → attaform.Q3eAD2wD.cjs} +3 -3
  58. package/dist/shared/{attaform.BwrowMp2.cjs.map → attaform.Q3eAD2wD.cjs.map} +1 -1
  59. package/dist/shared/{attaform.CnEl--PF.d.mts → attaform.aekT7mMx.d.cts} +1 -1
  60. package/dist/zod-v3.cjs +2 -2
  61. package/dist/zod-v3.d.cts +3 -3
  62. package/dist/zod-v3.d.mts +3 -3
  63. package/dist/zod-v3.d.ts +3 -3
  64. package/dist/zod-v3.mjs +2 -2
  65. package/dist/zod-v4.cjs +2 -2
  66. package/dist/zod-v4.d.cts +4 -4
  67. package/dist/zod-v4.d.mts +4 -4
  68. package/dist/zod-v4.d.ts +4 -4
  69. package/dist/zod-v4.mjs +2 -2
  70. package/dist/zod.cjs +5 -5
  71. package/dist/zod.d.cts +5 -5
  72. package/dist/zod.d.mts +5 -5
  73. package/dist/zod.d.ts +5 -5
  74. package/dist/zod.mjs +5 -5
  75. package/package.json +2 -2
  76. package/dist/shared/attaform.CTheKoTc.mjs.map +0 -1
  77. package/dist/shared/attaform.CcnF1AKJ.cjs.map +0 -1
  78. package/dist/shared/attaform.CrD73S4m.mjs.map +0 -1
  79. package/dist/shared/attaform.D2ZuIOCf.cjs.map +0 -1
@@ -1,9 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const zod = require('zod');
4
- const walkFieldMeta = require('./attaform.BwrowMp2.cjs');
5
- const injectWizard = require('./attaform.D2ZuIOCf.cjs');
6
- const paths = require('./attaform.B5LNzqQh.cjs');
3
+ const walkFieldMeta = require('./attaform.Q3eAD2wD.cjs');
4
+ const injectWizard = require('./attaform.CjMcwV7W.cjs');
5
+ const paths = require('./attaform.01iKS_lz.cjs');
7
6
 
8
7
  const fieldMeta = walkFieldMeta.fieldMetaStore;
9
8
  function withMeta(schema, payload) {
@@ -56,9 +55,6 @@ function clone(value, seen) {
56
55
  return copy;
57
56
  }
58
57
 
59
- class UnsupportedSchemaError extends paths.AttaformError {
60
- }
61
-
62
58
  function isZodSchemaType(schema, expectedType) {
63
59
  if (typeof schema !== "object" || schema === null) return false;
64
60
  const maybeDef = schema._def;
@@ -193,6 +189,10 @@ function getDiscriminator(schema) {
193
189
  const def = readDef(schema);
194
190
  return def?.discriminator;
195
191
  }
192
+ function getDiscriminatedOptionsMap(schema) {
193
+ const map = readDef(schema)?.optionsMap;
194
+ return map instanceof Map ? map : void 0;
195
+ }
196
196
  function getIntersectionLeft(schema) {
197
197
  const def = readDef(schema);
198
198
  return def?.left;
@@ -473,6 +473,71 @@ function isContainerAfterWrapperPeel(schema) {
473
473
  return isZodSchemaType(cur, "ZodObject") || isZodSchemaType(cur, "ZodArray") || isZodSchemaType(cur, "ZodTuple") || isZodSchemaType(cur, "ZodIntersection") || isZodSchemaType(cur, "ZodUnion") || isZodSchemaType(cur, "ZodDiscriminatedUnion") || isZodSchemaType(cur, "ZodRecord") || isZodSchemaType(cur, "ZodSet");
474
474
  }
475
475
 
476
+ function rebuildWithDef(original, defPatch) {
477
+ const node = Object.create(Object.getPrototypeOf(original));
478
+ node._def = { ...original._def, ...defPatch };
479
+ return node;
480
+ }
481
+ function rebuildObject(original, shape) {
482
+ const node = rebuildWithDef(original, { shape: () => shape, unknownKeys: "strip" });
483
+ node._cached = null;
484
+ return node;
485
+ }
486
+ function rebuildArray(original, element) {
487
+ return rebuildWithDef(original, {
488
+ type: element,
489
+ minLength: null,
490
+ maxLength: null,
491
+ exactLength: null
492
+ });
493
+ }
494
+ function rebuildSet(original, valueType) {
495
+ return rebuildWithDef(original, {
496
+ valueType,
497
+ minSize: null,
498
+ maxSize: null
499
+ });
500
+ }
501
+ function rebuildRecord(original, valueType, keyType) {
502
+ const patch = { valueType };
503
+ if (keyType !== void 0) patch["keyType"] = keyType;
504
+ return rebuildWithDef(original, patch);
505
+ }
506
+ function rebuildTuple(original, items) {
507
+ return rebuildWithDef(original, { items, rest: null });
508
+ }
509
+ function rebuildUnion(original, options) {
510
+ return rebuildWithDef(original, { options });
511
+ }
512
+ function rebuildIntersection(original, left, right) {
513
+ return rebuildWithDef(original, { left, right });
514
+ }
515
+ function rebuildWrapperInner(original, inner) {
516
+ return rebuildWithDef(original, { innerType: inner });
517
+ }
518
+ function rebuildLazy(original, target) {
519
+ return rebuildWithDef(original, { getter: () => target });
520
+ }
521
+ function stripLeafChecks(original) {
522
+ return rebuildWithDef(original, { checks: [] });
523
+ }
524
+ function rebuildDiscriminatedUnion(original, options) {
525
+ const originalOptions = getDiscriminatedOptions(original);
526
+ const originalMap = getDiscriminatedOptionsMap(original);
527
+ const optionsMap = /* @__PURE__ */ new Map();
528
+ if (originalMap !== void 0) {
529
+ for (const [value, originalOption] of originalMap) {
530
+ const index = originalOptions.indexOf(originalOption);
531
+ const replacement = index >= 0 ? options[index] : void 0;
532
+ if (replacement !== void 0) optionsMap.set(value, replacement);
533
+ }
534
+ }
535
+ return rebuildWithDef(original, { options, optionsMap });
536
+ }
537
+
538
+ class UnsupportedSchemaError extends paths.AttaformError {
539
+ }
540
+
476
541
  const UNSUPPORTED_TYPE_NAMES = /* @__PURE__ */ new Set(["ZodPromise", "ZodFunction", "ZodMap", "ZodSymbol"]);
477
542
  function labelPath(path) {
478
543
  return path.length === 0 ? "<root>" : path.join(".");
@@ -616,11 +681,11 @@ function stripAsyncChecks(schema) {
616
681
  }
617
682
  if (isZodSchemaType(s, "ZodOptional")) {
618
683
  const inner = unwrapInner(s);
619
- return inner === void 0 ? s : zod.z.optional(recurse(inner));
684
+ return inner === void 0 ? s : rebuildWrapperInner(s, recurse(inner));
620
685
  }
621
686
  if (isZodSchemaType(s, "ZodNullable")) {
622
687
  const inner = unwrapInner(s);
623
- return inner === void 0 ? s : zod.z.nullable(recurse(inner));
688
+ return inner === void 0 ? s : rebuildWrapperInner(s, recurse(inner));
624
689
  }
625
690
  if (isZodSchemaType(s, "ZodDefault")) {
626
691
  const inner = unwrapInner(s);
@@ -646,7 +711,7 @@ function stripAsyncChecks(schema) {
646
711
  const inner = unwrapLazy(s);
647
712
  if (inner === void 0) return s;
648
713
  const stripped = recurse(inner);
649
- return zod.z.lazy(() => stripped);
714
+ return rebuildLazy(s, stripped);
650
715
  }
651
716
  if (isZodSchemaType(s, "ZodPipeline")) {
652
717
  const inSide = unwrapPipeIn(s);
@@ -658,33 +723,32 @@ function stripAsyncChecks(schema) {
658
723
  for (const [k, v] of Object.entries(shape)) {
659
724
  next[k] = recurse(v);
660
725
  }
661
- return carryObjectChecks(zod.z.object(next), s);
726
+ return carryObjectChecks(rebuildObject(s, next), s);
662
727
  }
663
728
  if (isZodSchemaType(s, "ZodArray")) {
664
729
  const element = getArrayElement(s);
665
730
  if (element === void 0) return s;
666
- return carryArrayChecks(zod.z.array(recurse(element)), s);
731
+ return carryArrayChecks(rebuildArray(s, recurse(element)), s);
667
732
  }
668
733
  if (isZodSchemaType(s, "ZodSet")) {
669
734
  const valueType = getSetValueType(s);
670
735
  if (valueType === void 0) return s;
671
- return carrySetChecks(zod.z.set(recurse(valueType)), s);
736
+ return carrySetChecks(rebuildSet(s, recurse(valueType)), s);
672
737
  }
673
738
  if (isZodSchemaType(s, "ZodTuple")) {
674
739
  const items = getTupleItems(s).map(recurse);
675
- const rebuilt = zod.z.tuple(items);
676
- return rebuilt;
740
+ return rebuildTuple(s, items);
677
741
  }
678
742
  if (isZodSchemaType(s, "ZodRecord")) {
679
743
  const keyType = getRecordKeyType(s);
680
744
  const valueType = getRecordValueType(s);
681
745
  if (valueType === void 0) return s;
682
746
  const next = recurse(valueType);
683
- return keyType === void 0 ? zod.z.record(next) : zod.z.record(keyType, next);
747
+ return keyType === void 0 ? rebuildRecord(s, next) : rebuildRecord(s, next, keyType);
684
748
  }
685
749
  if (isZodSchemaType(s, "ZodUnion")) {
686
750
  const options = getUnionOptions(s).map(recurse);
687
- return zod.z.union(options);
751
+ return rebuildUnion(s, options);
688
752
  }
689
753
  if (isZodSchemaType(s, "ZodDiscriminatedUnion")) {
690
754
  const discKey = getDiscriminator(s);
@@ -692,16 +756,13 @@ function stripAsyncChecks(schema) {
692
756
  (o) => recurse(o)
693
757
  );
694
758
  if (discKey === void 0 || options.length === 0) return s;
695
- return zod.z.discriminatedUnion(
696
- discKey,
697
- options
698
- );
759
+ return rebuildDiscriminatedUnion(s, options);
699
760
  }
700
761
  if (isZodSchemaType(s, "ZodIntersection")) {
701
762
  const left = getIntersectionLeft(s);
702
763
  const right = getIntersectionRight(s);
703
764
  if (left === void 0 || right === void 0) return s;
704
- return zod.z.intersection(recurse(left), recurse(right));
765
+ return rebuildIntersection(s, recurse(left), recurse(right));
705
766
  }
706
767
  return s;
707
768
  }
@@ -1100,15 +1161,15 @@ function stripRefinements(schema) {
1100
1161
  function _stripRefinements(_schema, depth) {
1101
1162
  if (depth >= MAX_UNWRAP_STEPS) return _schema;
1102
1163
  if (isZodSchemaType(_schema, "ZodString") && hasChecks(_schema)) {
1103
- return zod.z.string();
1164
+ return stripLeafChecks(_schema);
1104
1165
  }
1105
1166
  if (isZodSchemaType(_schema, "ZodNumber") && hasChecks(_schema)) {
1106
- return zod.z.number();
1167
+ return stripLeafChecks(_schema);
1107
1168
  }
1108
1169
  if (isZodSchemaType(_schema, "ZodArray")) {
1109
1170
  const inner = getArrayElement(_schema);
1110
1171
  if (!inner) return _schema;
1111
- return zod.z.array(_stripRefinements(inner, depth + 1));
1172
+ return rebuildArray(_schema, _stripRefinements(inner, depth + 1));
1112
1173
  }
1113
1174
  if (isZodSchemaType(_schema, "ZodObject")) {
1114
1175
  const strippedShape = Object.fromEntries(
@@ -1117,7 +1178,7 @@ function stripRefinements(schema) {
1117
1178
  _stripRefinements(value, depth + 1)
1118
1179
  ])
1119
1180
  );
1120
- return zod.z.object(strippedShape);
1181
+ return rebuildObject(_schema, strippedShape);
1121
1182
  }
1122
1183
  if (isZodSchemaType(_schema, "ZodEffects")) {
1123
1184
  const inner = unwrapEffectsSource(_schema);
@@ -1127,12 +1188,12 @@ function stripRefinements(schema) {
1127
1188
  if (isZodSchemaType(_schema, "ZodOptional")) {
1128
1189
  const inner = unwrapInner(_schema);
1129
1190
  if (!inner) return _schema;
1130
- return zod.z.optional(_stripRefinements(inner, depth + 1));
1191
+ return rebuildWrapperInner(_schema, _stripRefinements(inner, depth + 1));
1131
1192
  }
1132
1193
  if (isZodSchemaType(_schema, "ZodNullable")) {
1133
1194
  const inner = unwrapInner(_schema);
1134
1195
  if (!inner) return _schema;
1135
- return zod.z.nullable(_stripRefinements(inner, depth + 1));
1196
+ return rebuildWrapperInner(_schema, _stripRefinements(inner, depth + 1));
1136
1197
  }
1137
1198
  if (isZodSchemaType(_schema, "ZodReadonly")) {
1138
1199
  const inner = unwrapInner(_schema);
@@ -1152,13 +1213,13 @@ function stripRefinements(schema) {
1152
1213
  if (isZodSchemaType(_schema, "ZodSet")) {
1153
1214
  const valueType = getSetValueType(_schema);
1154
1215
  if (!valueType) return _schema;
1155
- return zod.z.set(_stripRefinements(valueType, depth + 1));
1216
+ return rebuildSet(_schema, _stripRefinements(valueType, depth + 1));
1156
1217
  }
1157
1218
  if (isZodSchemaType(_schema, "ZodTuple")) {
1158
1219
  const items = getTupleItems(_schema);
1159
1220
  if (items.length === 0) return _schema;
1160
1221
  const stripped = items.map((it) => _stripRefinements(it, depth + 1));
1161
- return zod.z.tuple(stripped);
1222
+ return rebuildTuple(_schema, stripped);
1162
1223
  }
1163
1224
  if (isZodSchemaType(_schema, "ZodRecord")) {
1164
1225
  const valueType = getRecordValueType(_schema);
@@ -1166,15 +1227,15 @@ function stripRefinements(schema) {
1166
1227
  const value = _stripRefinements(valueType, depth + 1);
1167
1228
  const keyType = getRecordKeyType(_schema);
1168
1229
  if (keyType) {
1169
- return zod.z.record(keyType, value);
1230
+ return rebuildRecord(_schema, value, keyType);
1170
1231
  }
1171
- return zod.z.record(value);
1232
+ return rebuildRecord(_schema, value);
1172
1233
  }
1173
1234
  if (isZodSchemaType(_schema, "ZodUnion")) {
1174
1235
  const options = getUnionOptions(_schema);
1175
1236
  if (options.length === 0) return _schema;
1176
1237
  const stripped = options.map((o) => _stripRefinements(o, depth + 1));
1177
- return zod.z.union(stripped);
1238
+ return rebuildUnion(_schema, stripped);
1178
1239
  }
1179
1240
  if (isZodSchemaType(_schema, "ZodDiscriminatedUnion")) {
1180
1241
  const discKey = getDiscriminator(_schema);
@@ -1183,22 +1244,23 @@ function stripRefinements(schema) {
1183
1244
  const stripped = options.map(
1184
1245
  (o) => _stripRefinements(o, depth + 1)
1185
1246
  );
1186
- return zod.z.discriminatedUnion(
1187
- discKey,
1188
- stripped
1189
- );
1247
+ return rebuildDiscriminatedUnion(_schema, stripped);
1190
1248
  }
1191
1249
  if (isZodSchemaType(_schema, "ZodIntersection")) {
1192
1250
  const left = getIntersectionLeft(_schema);
1193
1251
  const right = getIntersectionRight(_schema);
1194
1252
  if (!left || !right) return _schema;
1195
- return zod.z.intersection(_stripRefinements(left, depth + 1), _stripRefinements(right, depth + 1));
1253
+ return rebuildIntersection(
1254
+ _schema,
1255
+ _stripRefinements(left, depth + 1),
1256
+ _stripRefinements(right, depth + 1)
1257
+ );
1196
1258
  }
1197
1259
  if (isZodSchemaType(_schema, "ZodLazy")) {
1198
1260
  const inner = unwrapLazy(_schema);
1199
1261
  if (!inner) return _schema;
1200
1262
  const stripped = _stripRefinements(inner, depth + 1);
1201
- return zod.z.lazy(() => stripped);
1263
+ return rebuildLazy(_schema, stripped);
1202
1264
  }
1203
1265
  return _schema;
1204
1266
  }
@@ -1238,12 +1300,12 @@ function getSlimSchema(config) {
1238
1300
  for (const [key, value] of Object.entries(getObjectShape(_schema))) {
1239
1301
  newShape[key] = _getSlimSchema(value);
1240
1302
  }
1241
- return zod.z.object(newShape);
1303
+ return rebuildObject(_schema, newShape);
1242
1304
  }
1243
1305
  if (isZodSchemaType(_schema, "ZodArray")) {
1244
1306
  const inner = getArrayElement(_schema);
1245
1307
  if (!inner) return _schema;
1246
- return zod.z.array(_getSlimSchema(inner));
1308
+ return rebuildArray(_schema, _getSlimSchema(inner));
1247
1309
  }
1248
1310
  if (isZodSchemaType(_schema, "ZodRecord")) {
1249
1311
  const keyType = getRecordKeyType(_schema);
@@ -1251,7 +1313,7 @@ function getSlimSchema(config) {
1251
1313
  if (!keyType || !valueType) return _schema;
1252
1314
  const key = _getSlimSchema(keyType);
1253
1315
  const value = _getSlimSchema(valueType);
1254
- return zod.z.record(key, value);
1316
+ return rebuildRecord(_schema, value, key);
1255
1317
  }
1256
1318
  if (isZodSchemaType(_schema, "ZodDiscriminatedUnion")) {
1257
1319
  const slimmedSchemas = [];
@@ -1262,8 +1324,8 @@ function getSlimSchema(config) {
1262
1324
  const deepCloneSlimmedSchema = cloneSchemaDeep(slimmedSchema);
1263
1325
  slimmedSchemas.push(deepCloneSlimmedSchema);
1264
1326
  }
1265
- return zod.z.discriminatedUnion(
1266
- discKey,
1327
+ return rebuildDiscriminatedUnion(
1328
+ _schema,
1267
1329
  slimmedSchemas
1268
1330
  );
1269
1331
  }
@@ -1528,7 +1590,10 @@ function runStrictGetDefaultsV3(rootSchema, config, formKey, maxRecursionDepth)
1528
1590
  formKey
1529
1591
  };
1530
1592
  }
1531
- function getNestedSchemasInSlimModeV3(rootSchema, path, maxRecursionDepth) {
1593
+ const slimRootCacheV3 = /* @__PURE__ */ new WeakMap();
1594
+ function getSlimRootV3(rootSchema) {
1595
+ const cached = slimRootCacheV3.get(rootSchema);
1596
+ if (cached !== void 0) return cached;
1532
1597
  const [strippedSchema] = stripRootSchema(rootSchema, {
1533
1598
  stripDefaultValues: true,
1534
1599
  stripNullable: true,
@@ -1539,7 +1604,11 @@ function getNestedSchemasInSlimModeV3(rootSchema, path, maxRecursionDepth) {
1539
1604
  schema: strippedSchema,
1540
1605
  stripConfig: { stripDefaultValues: true, stripZodEffects: true }
1541
1606
  });
1542
- return getNestedZodSchemasAtPath(slimSchema, path, maxRecursionDepth);
1607
+ slimRootCacheV3.set(rootSchema, slimSchema);
1608
+ return slimSchema;
1609
+ }
1610
+ function getNestedSchemasInSlimModeV3(rootSchema, path, maxRecursionDepth) {
1611
+ return getNestedZodSchemasAtPath(getSlimRootV3(rootSchema), path, maxRecursionDepth);
1543
1612
  }
1544
1613
 
1545
1614
  function useForm(configuration) {
@@ -1563,4 +1632,4 @@ exports.isZodSchemaType = isZodSchemaType;
1563
1632
  exports.useForm = useForm;
1564
1633
  exports.withMeta = withMeta;
1565
1634
  exports.zodAdapter = zodAdapter;
1566
- //# sourceMappingURL=attaform.CcnF1AKJ.cjs.map
1635
+ //# sourceMappingURL=attaform.C-RtnCJM.cjs.map