attaform 0.30.1 → 0.31.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.d.mts +5 -5
- package/dist/abstract.mjs +3 -3
- package/dist/dev/abstract.mjs +3 -3
- package/dist/dev/chunks/devtools.mjs +2 -2
- package/dist/dev/directive.mjs +1 -1
- package/dist/dev/history.mjs +1 -1
- package/dist/dev/index.mjs +4 -4
- package/dist/dev/runtime/plugins/attaform.mjs +1 -1
- package/dist/dev/shared/{attaform-dev.Chm4D6SJ.mjs → attaform-dev.B1q-x9R9.mjs} +2 -2
- package/dist/dev/shared/{attaform-dev.BUIFcTYf.mjs → attaform-dev.Caibt7sb.mjs} +11 -10
- package/dist/dev/shared/{attaform-dev.CT7MDjPy.mjs → attaform-dev.CtyqGia7.mjs} +152 -227
- package/dist/dev/shared/{attaform-dev.BJK1kqHY.mjs → attaform-dev.DJ3nsWw6.mjs} +74 -110
- package/dist/dev/shared/{attaform-dev.DuEE4GU1.mjs → attaform-dev.DlaT4xGd.mjs} +3 -3
- package/dist/dev/shared/{attaform-dev.BMQ3GcgD.mjs → attaform-dev.k5X47GMD.mjs} +474 -336
- package/dist/dev/shared/{attaform-dev.DxHdkkPG.mjs → attaform-dev.y9x9Vp9F.mjs} +206 -127
- package/dist/dev/zod-v3.mjs +5 -5
- package/dist/dev/zod-v4.mjs +5 -5
- package/dist/dev/zod.mjs +4 -4
- package/dist/directive.d.mts +2 -2
- package/dist/directive.mjs +1 -1
- package/dist/history.d.mts +1 -1
- package/dist/history.mjs +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +4 -4
- package/dist/runtime/components/AttaformDevtoolsPanel.vue +3 -3
- package/dist/runtime/plugins/attaform.mjs +1 -1
- package/dist/shared/{attaform.CO918TdU.mjs → attaform.BWUn8Kjy.mjs} +74 -110
- package/dist/shared/{attaform.WiGdIqgx.mjs → attaform.C4shmwyJ.mjs} +2 -2
- package/dist/shared/{attaform.2FslhB9R.d.mts → attaform.CRVe8s82.d.mts} +1 -1
- package/dist/shared/{attaform.L0kUn3vL.d.mts → attaform.D9RqPgGu.d.mts} +1 -1
- package/dist/shared/{attaform.BcQwgWaq.d.mts → attaform.DAo0QBmS.d.mts} +28 -8
- package/dist/shared/{attaform.ZYn2ahzJ.mjs → attaform.DBCbxlyk.mjs} +59 -1
- package/dist/shared/{attaform.DRsANMok.mjs → attaform.DL2nl_QR.mjs} +11 -10
- package/dist/shared/{attaform.BIWicztt.mjs → attaform.DNPJPOO7.mjs} +204 -125
- package/dist/shared/{attaform.Br8EBn5B.d.mts → attaform.DZnrDrNb.d.mts} +136 -32
- package/dist/shared/{attaform.D_f1WgYf.mjs → attaform.DxKQsqFZ.mjs} +456 -318
- package/dist/shared/{attaform.B2iebkPA.mjs → attaform.L011tHgJ.mjs} +3 -3
- package/dist/shared/{attaform.D_pt1gOj.mjs → attaform.LUPC-2Qg.mjs} +152 -227
- package/dist/transforms.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/zod-v3.d.mts +4 -4
- package/dist/zod-v3.mjs +5 -5
- package/dist/zod-v4.d.mts +13 -11
- package/dist/zod-v4.mjs +5 -5
- package/dist/zod.d.mts +4 -4
- package/dist/zod.mjs +4 -4
- package/package.json +1 -1
- package/skills/attaform/SKILL.md +1 -1
- package/skills/attaform/references/custom-components.md +4 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as InvalidUseFormConfigError } from './attaform.CdZIEf7_.mjs';
|
|
2
|
-
import { u as useForm$2 } from './attaform.
|
|
3
|
-
import { u as useForm$1 } from './attaform.
|
|
4
|
-
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './attaform.
|
|
2
|
+
import { u as useForm$2 } from './attaform.LUPC-2Qg.mjs';
|
|
3
|
+
import { u as useForm$1 } from './attaform.BWUn8Kjy.mjs';
|
|
4
|
+
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './attaform.DL2nl_QR.mjs';
|
|
5
5
|
|
|
6
6
|
function isZodV4SchemaShape(value) {
|
|
7
7
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { w as walkPathSegments, s as slimPrimitivesWalk, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, g as getFieldMetaForSchema, f as fixStructuralDefaults, m as mergeDeep, d as deriveDefaultWalk, e as getFieldMetaListForSchema } from './attaform.
|
|
2
|
-
import { h as getAtPath, j as humanize, c as useAbstractForm } from './attaform.
|
|
1
|
+
import { w as walkPathSegments, s as slimPrimitivesWalk, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, g as getFieldMetaForSchema, f as fixStructuralDefaults, m as mergeDeep, d as deriveDefaultWalk, e as getFieldMetaListForSchema } from './attaform.DL2nl_QR.mjs';
|
|
2
|
+
import { h as getAtPath, j as humanize, c as useAbstractForm } from './attaform.DNPJPOO7.mjs';
|
|
3
3
|
import { c as callConsumerFn } from './attaform.8mfKZCwH.mjs';
|
|
4
4
|
import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform.CdZIEf7_.mjs';
|
|
5
5
|
|
|
@@ -196,104 +196,6 @@ function isAsyncEffect(schema) {
|
|
|
196
196
|
if (typeof fn !== "function") return false;
|
|
197
197
|
return fn.constructor.name === "AsyncFunction";
|
|
198
198
|
}
|
|
199
|
-
function containsAsyncRefine(schema, seen) {
|
|
200
|
-
return walkForTarget(schema, "refinement", seen ?? /* @__PURE__ */ new WeakSet());
|
|
201
|
-
}
|
|
202
|
-
function containsMapOrSet(schema, seen) {
|
|
203
|
-
return walkForTarget(schema, "map-or-set", /* @__PURE__ */ new WeakSet());
|
|
204
|
-
}
|
|
205
|
-
function containsDiscriminatedUnion(schema, seen) {
|
|
206
|
-
return walkForTarget(schema, "discriminated-union", seen ?? /* @__PURE__ */ new WeakSet());
|
|
207
|
-
}
|
|
208
|
-
function containsAsyncTransform(schema, seen) {
|
|
209
|
-
return walkForTarget(schema, "transform-or-preprocess", seen ?? /* @__PURE__ */ new WeakSet());
|
|
210
|
-
}
|
|
211
|
-
function walkForTarget(schema, target, visited) {
|
|
212
|
-
const candidate = schema;
|
|
213
|
-
if (typeof candidate !== "object" || candidate === null) return false;
|
|
214
|
-
if (visited.has(candidate)) return false;
|
|
215
|
-
visited.add(candidate);
|
|
216
|
-
if (isZodSchemaType(schema, "ZodEffects")) {
|
|
217
|
-
const kind = getEffectsKind(schema);
|
|
218
|
-
if (target === "refinement" && kind === "refinement") return true;
|
|
219
|
-
if (target === "transform-or-preprocess" && (kind === "transform" || kind === "preprocess") && isAsyncEffect(schema)) {
|
|
220
|
-
return true;
|
|
221
|
-
}
|
|
222
|
-
const inner = unwrapEffectsSource(schema);
|
|
223
|
-
return inner !== void 0 && walkForTarget(inner, target, visited);
|
|
224
|
-
}
|
|
225
|
-
if (isZodSchemaType(schema, "ZodOptional") || isZodSchemaType(schema, "ZodNullable") || isZodSchemaType(schema, "ZodDefault") || isZodSchemaType(schema, "ZodCatch") || isZodSchemaType(schema, "ZodReadonly")) {
|
|
226
|
-
const inner = unwrapInner(schema);
|
|
227
|
-
return inner !== void 0 && walkForTarget(inner, target, visited);
|
|
228
|
-
}
|
|
229
|
-
if (isZodSchemaType(schema, "ZodBranded")) {
|
|
230
|
-
const inner = unwrapBranded(schema);
|
|
231
|
-
return inner !== void 0 && walkForTarget(inner, target, visited);
|
|
232
|
-
}
|
|
233
|
-
if (isZodSchemaType(schema, "ZodLazy")) {
|
|
234
|
-
const inner = unwrapLazy(schema);
|
|
235
|
-
return inner !== void 0 && walkForTarget(inner, target, visited);
|
|
236
|
-
}
|
|
237
|
-
if (isZodSchemaType(schema, "ZodPipeline")) {
|
|
238
|
-
const inSide = unwrapPipeIn(schema);
|
|
239
|
-
if (inSide !== void 0 && walkForTarget(inSide, target, visited)) return true;
|
|
240
|
-
const outSide = unwrapPipeOut(schema);
|
|
241
|
-
if (outSide !== void 0 && walkForTarget(outSide, target, visited)) return true;
|
|
242
|
-
return false;
|
|
243
|
-
}
|
|
244
|
-
if (isZodSchemaType(schema, "ZodObject")) {
|
|
245
|
-
for (const sub of Object.values(getObjectShape(schema))) {
|
|
246
|
-
if (walkForTarget(sub, target, visited)) return true;
|
|
247
|
-
}
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
if (isZodSchemaType(schema, "ZodArray")) {
|
|
251
|
-
const elem = getArrayElement(schema);
|
|
252
|
-
return elem !== void 0 && walkForTarget(elem, target, visited);
|
|
253
|
-
}
|
|
254
|
-
if (isZodSchemaType(schema, "ZodTuple")) {
|
|
255
|
-
for (const it of getTupleItems(schema)) {
|
|
256
|
-
if (walkForTarget(it, target, visited)) return true;
|
|
257
|
-
}
|
|
258
|
-
return false;
|
|
259
|
-
}
|
|
260
|
-
if (isZodSchemaType(schema, "ZodUnion") || isZodSchemaType(schema, "ZodDiscriminatedUnion")) {
|
|
261
|
-
if (target === "discriminated-union" && isZodSchemaType(schema, "ZodDiscriminatedUnion")) {
|
|
262
|
-
return true;
|
|
263
|
-
}
|
|
264
|
-
for (const opt of getUnionOptions(schema)) {
|
|
265
|
-
if (walkForTarget(opt, target, visited)) return true;
|
|
266
|
-
}
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
269
|
-
if (isZodSchemaType(schema, "ZodIntersection")) {
|
|
270
|
-
const left = getIntersectionLeft(schema);
|
|
271
|
-
if (left !== void 0 && walkForTarget(left, target, visited)) return true;
|
|
272
|
-
const right = getIntersectionRight(schema);
|
|
273
|
-
if (right !== void 0 && walkForTarget(right, target, visited)) return true;
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
if (isZodSchemaType(schema, "ZodRecord")) {
|
|
277
|
-
const keyType = getRecordKeyType(schema);
|
|
278
|
-
if (keyType !== void 0 && walkForTarget(keyType, target, visited)) return true;
|
|
279
|
-
const valueType = getRecordValueType(schema);
|
|
280
|
-
if (valueType !== void 0 && walkForTarget(valueType, target, visited)) return true;
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
if (isZodSchemaType(schema, "ZodSet")) {
|
|
284
|
-
if (target === "map-or-set") return true;
|
|
285
|
-
const elem = getSetValueType(schema);
|
|
286
|
-
return elem !== void 0 && walkForTarget(elem, target, visited);
|
|
287
|
-
}
|
|
288
|
-
if (isZodSchemaType(schema, "ZodMap")) {
|
|
289
|
-
if (target === "map-or-set") return true;
|
|
290
|
-
const keyType = getMapKeyType(schema);
|
|
291
|
-
if (keyType !== void 0 && walkForTarget(keyType, target, visited)) return true;
|
|
292
|
-
const valueType = getMapValueType(schema);
|
|
293
|
-
return valueType !== void 0 && walkForTarget(valueType, target, visited);
|
|
294
|
-
}
|
|
295
|
-
return false;
|
|
296
|
-
}
|
|
297
199
|
function unwrapPipeIn(schema) {
|
|
298
200
|
const def = readDef(schema);
|
|
299
201
|
return def?.in;
|
|
@@ -335,99 +237,136 @@ function hasCatchValue(schema) {
|
|
|
335
237
|
const def = readDef(schema);
|
|
336
238
|
return typeof def?.catchValue === "function";
|
|
337
239
|
}
|
|
338
|
-
|
|
339
|
-
|
|
240
|
+
const capabilityMemo = /* @__PURE__ */ new WeakMap();
|
|
241
|
+
function capabilitiesOf(schema) {
|
|
242
|
+
let capabilities = capabilityMemo.get(schema);
|
|
243
|
+
if (capabilities === void 0) {
|
|
244
|
+
capabilities = scanCapabilities(schema);
|
|
245
|
+
const key = schema;
|
|
246
|
+
if (typeof key === "object" && key !== null) capabilityMemo.set(key, capabilities);
|
|
247
|
+
}
|
|
248
|
+
return capabilities;
|
|
249
|
+
}
|
|
250
|
+
function scanCapabilities(schema) {
|
|
251
|
+
const capabilities = {
|
|
252
|
+
asyncRefine: false,
|
|
253
|
+
asyncTransform: false,
|
|
254
|
+
discriminatedUnion: false,
|
|
255
|
+
containerOrRootRefine: false,
|
|
256
|
+
preprocessOrCoerce: false,
|
|
257
|
+
mapOrSet: false
|
|
258
|
+
};
|
|
259
|
+
walkCapabilities(schema, capabilities, /* @__PURE__ */ new WeakSet());
|
|
260
|
+
return capabilities;
|
|
261
|
+
}
|
|
262
|
+
function walkCapabilities(schema, capabilities, visited) {
|
|
263
|
+
if (schema === void 0) return;
|
|
340
264
|
const candidate = schema;
|
|
341
|
-
if (typeof candidate !== "object" || candidate === null) return
|
|
342
|
-
if (visited.has(candidate)) return false;
|
|
265
|
+
if (typeof candidate !== "object" || candidate === null || visited.has(candidate)) return;
|
|
343
266
|
visited.add(candidate);
|
|
344
|
-
if (
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
return inner !== void 0 && hasContainerOrRootRefine(inner, visited);
|
|
361
|
-
}
|
|
362
|
-
if (isZodSchemaType(schema, "ZodPipeline")) {
|
|
363
|
-
const inSide = unwrapPipeIn(schema);
|
|
364
|
-
if (inSide !== void 0 && hasContainerOrRootRefine(inSide, visited)) return true;
|
|
365
|
-
const outSide = unwrapPipeOut(schema);
|
|
366
|
-
if (outSide !== void 0 && hasContainerOrRootRefine(outSide, visited)) return true;
|
|
367
|
-
return false;
|
|
368
|
-
}
|
|
369
|
-
if (isZodSchemaType(schema, "ZodObject")) {
|
|
370
|
-
for (const sub of Object.values(getObjectShape(schema))) {
|
|
371
|
-
if (hasContainerOrRootRefine(sub, visited)) return true;
|
|
372
|
-
}
|
|
373
|
-
return false;
|
|
374
|
-
}
|
|
375
|
-
if (isZodSchemaType(schema, "ZodArray")) {
|
|
376
|
-
const elem = getArrayElement(schema);
|
|
377
|
-
return elem !== void 0 && hasContainerOrRootRefine(elem, visited);
|
|
378
|
-
}
|
|
379
|
-
if (isZodSchemaType(schema, "ZodTuple")) {
|
|
380
|
-
for (const it of getTupleItems(schema)) {
|
|
381
|
-
if (hasContainerOrRootRefine(it, visited)) return true;
|
|
382
|
-
}
|
|
383
|
-
return false;
|
|
384
|
-
}
|
|
385
|
-
if (isZodSchemaType(schema, "ZodUnion") || isZodSchemaType(schema, "ZodDiscriminatedUnion")) {
|
|
386
|
-
for (const opt of getUnionOptions(schema)) {
|
|
387
|
-
if (hasContainerOrRootRefine(opt, visited)) return true;
|
|
267
|
+
if (isCoercePrimitive(schema)) capabilities.preprocessOrCoerce = true;
|
|
268
|
+
const typeName = getTypeName(schema) ?? "";
|
|
269
|
+
switch (typeName) {
|
|
270
|
+
case "ZodEffects": {
|
|
271
|
+
const kind = getEffectsKind(schema);
|
|
272
|
+
if (kind === "refinement") capabilities.asyncRefine = true;
|
|
273
|
+
else if ((kind === "transform" || kind === "preprocess") && isAsyncEffect(schema)) {
|
|
274
|
+
capabilities.asyncTransform = true;
|
|
275
|
+
}
|
|
276
|
+
if (kind === "preprocess") capabilities.preprocessOrCoerce = true;
|
|
277
|
+
const inner = unwrapEffectsSource(schema);
|
|
278
|
+
if (!capabilities.containerOrRootRefine && inner !== void 0 && isContainerAfterWrapperPeel(inner)) {
|
|
279
|
+
capabilities.containerOrRootRefine = true;
|
|
280
|
+
}
|
|
281
|
+
walkCapabilities(inner, capabilities, visited);
|
|
282
|
+
return;
|
|
388
283
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
284
|
+
case "ZodOptional":
|
|
285
|
+
case "ZodNullable":
|
|
286
|
+
case "ZodDefault":
|
|
287
|
+
case "ZodCatch":
|
|
288
|
+
case "ZodReadonly":
|
|
289
|
+
walkCapabilities(unwrapInner(schema), capabilities, visited);
|
|
290
|
+
return;
|
|
291
|
+
case "ZodBranded":
|
|
292
|
+
walkCapabilities(unwrapBranded(schema), capabilities, visited);
|
|
293
|
+
return;
|
|
294
|
+
case "ZodLazy":
|
|
295
|
+
walkCapabilities(unwrapLazy(schema), capabilities, visited);
|
|
296
|
+
return;
|
|
297
|
+
case "ZodPipeline":
|
|
298
|
+
walkCapabilities(unwrapPipeIn(schema), capabilities, visited);
|
|
299
|
+
walkCapabilities(unwrapPipeOut(schema), capabilities, visited);
|
|
300
|
+
return;
|
|
301
|
+
case "ZodObject":
|
|
302
|
+
for (const sub of Object.values(getObjectShape(schema))) {
|
|
303
|
+
walkCapabilities(sub, capabilities, visited);
|
|
304
|
+
}
|
|
305
|
+
return;
|
|
306
|
+
case "ZodArray":
|
|
307
|
+
walkCapabilities(getArrayElement(schema), capabilities, visited);
|
|
308
|
+
return;
|
|
309
|
+
case "ZodTuple":
|
|
310
|
+
for (const item of getTupleItems(schema)) walkCapabilities(item, capabilities, visited);
|
|
311
|
+
return;
|
|
312
|
+
case "ZodUnion":
|
|
313
|
+
case "ZodDiscriminatedUnion":
|
|
314
|
+
if (typeName === "ZodDiscriminatedUnion") capabilities.discriminatedUnion = true;
|
|
315
|
+
for (const option of getUnionOptions(schema)) walkCapabilities(option, capabilities, visited);
|
|
316
|
+
return;
|
|
317
|
+
case "ZodIntersection":
|
|
318
|
+
walkCapabilities(getIntersectionLeft(schema), capabilities, visited);
|
|
319
|
+
walkCapabilities(getIntersectionRight(schema), capabilities, visited);
|
|
320
|
+
return;
|
|
321
|
+
case "ZodRecord":
|
|
322
|
+
walkCapabilities(getRecordKeyType(schema), capabilities, visited);
|
|
323
|
+
walkCapabilities(getRecordValueType(schema), capabilities, visited);
|
|
324
|
+
return;
|
|
325
|
+
case "ZodSet":
|
|
326
|
+
capabilities.mapOrSet = true;
|
|
327
|
+
walkCapabilities(getSetValueType(schema), capabilities, visited);
|
|
328
|
+
return;
|
|
329
|
+
case "ZodMap":
|
|
330
|
+
capabilities.mapOrSet = true;
|
|
331
|
+
walkCapabilities(getMapKeyType(schema), capabilities, visited);
|
|
332
|
+
walkCapabilities(getMapValueType(schema), capabilities, visited);
|
|
333
|
+
return;
|
|
408
334
|
}
|
|
409
|
-
return false;
|
|
410
335
|
}
|
|
336
|
+
const CONTAINER_TYPE_NAMES = /* @__PURE__ */ new Set([
|
|
337
|
+
"ZodObject",
|
|
338
|
+
"ZodArray",
|
|
339
|
+
"ZodTuple",
|
|
340
|
+
"ZodIntersection",
|
|
341
|
+
"ZodUnion",
|
|
342
|
+
"ZodDiscriminatedUnion",
|
|
343
|
+
"ZodRecord",
|
|
344
|
+
"ZodMap",
|
|
345
|
+
"ZodSet"
|
|
346
|
+
]);
|
|
411
347
|
function isContainerAfterWrapperPeel(schema) {
|
|
412
348
|
let cur = schema;
|
|
413
|
-
for (let i = 0; i < MAX_UNWRAP_STEPS$1; i++) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
349
|
+
for (let i = 0; i < MAX_UNWRAP_STEPS$1 && cur !== void 0; i++) {
|
|
350
|
+
const typeName = getTypeName(cur) ?? "";
|
|
351
|
+
switch (typeName) {
|
|
352
|
+
case "ZodOptional":
|
|
353
|
+
case "ZodNullable":
|
|
354
|
+
case "ZodDefault":
|
|
355
|
+
case "ZodCatch":
|
|
356
|
+
case "ZodReadonly":
|
|
357
|
+
cur = unwrapInner(cur);
|
|
358
|
+
break;
|
|
359
|
+
case "ZodBranded":
|
|
360
|
+
cur = unwrapBranded(cur);
|
|
361
|
+
break;
|
|
362
|
+
case "ZodLazy":
|
|
363
|
+
cur = unwrapLazy(cur);
|
|
364
|
+
break;
|
|
365
|
+
default:
|
|
366
|
+
return CONTAINER_TYPE_NAMES.has(typeName);
|
|
428
367
|
}
|
|
429
368
|
}
|
|
430
|
-
return
|
|
369
|
+
return false;
|
|
431
370
|
}
|
|
432
371
|
|
|
433
372
|
const V3_INTROSPECTOR = {
|
|
@@ -439,10 +378,7 @@ const V3_INTROSPECTOR = {
|
|
|
439
378
|
getLiteralValues,
|
|
440
379
|
isPreprocessNode,
|
|
441
380
|
isCoercePrimitive,
|
|
442
|
-
|
|
443
|
-
containsAsyncTransform,
|
|
444
|
-
containsDiscriminatedUnion,
|
|
445
|
-
hasContainerOrRootRefine,
|
|
381
|
+
capabilitiesOf,
|
|
446
382
|
// Walker accessors (D2 / D3 / D5).
|
|
447
383
|
getArrayElement,
|
|
448
384
|
getSetValueType,
|
|
@@ -467,6 +403,10 @@ const V3_INTROSPECTOR = {
|
|
|
467
403
|
getCatchDefault,
|
|
468
404
|
hasCatchValue
|
|
469
405
|
};
|
|
406
|
+
const V3_SUB_SCHEMA_INTROSPECTOR = {
|
|
407
|
+
...V3_INTROSPECTOR,
|
|
408
|
+
capabilitiesOf: scanCapabilities
|
|
409
|
+
};
|
|
470
410
|
|
|
471
411
|
function mapKeyAt(value, index) {
|
|
472
412
|
if (!(value instanceof Map)) return void 0;
|
|
@@ -534,7 +474,7 @@ function normalizeOne(path, rootSchema, data, maxRecursionDepth, peel) {
|
|
|
534
474
|
}
|
|
535
475
|
|
|
536
476
|
function slimPrimitivesV3(schema) {
|
|
537
|
-
return
|
|
477
|
+
return slimPrimitivesWalk(schema, V3_INTROSPECTOR, 64);
|
|
538
478
|
}
|
|
539
479
|
|
|
540
480
|
function rebuildWithDef(original, defPatch) {
|
|
@@ -603,6 +543,9 @@ function rebuildDiscriminatedUnion(original, options) {
|
|
|
603
543
|
}
|
|
604
544
|
return rebuildWithDef(original, { options, optionsMap });
|
|
605
545
|
}
|
|
546
|
+
function rebuildPipeline(original, inSide, outSide) {
|
|
547
|
+
return rebuildWithDef(original, { in: inSide, out: outSide });
|
|
548
|
+
}
|
|
606
549
|
function rebuildEffects(original, source, effect) {
|
|
607
550
|
return rebuildWithDef(original, { schema: source, effect });
|
|
608
551
|
}
|
|
@@ -678,7 +621,9 @@ function walkEffects(schema) {
|
|
|
678
621
|
}
|
|
679
622
|
if (isZodSchemaType(s, "ZodPipeline")) {
|
|
680
623
|
const inSide = unwrapPipeIn(s);
|
|
681
|
-
|
|
624
|
+
const outSide = unwrapPipeOut(s);
|
|
625
|
+
if (inSide === void 0 || outSide === void 0) return s;
|
|
626
|
+
return rebuildPipeline(s, recurse(inSide), recurse(outSide));
|
|
682
627
|
}
|
|
683
628
|
if (isZodSchemaType(s, "ZodObject")) {
|
|
684
629
|
const shape = getObjectShape(s);
|
|
@@ -816,16 +761,22 @@ function syncSafe(schema) {
|
|
|
816
761
|
return wrapped;
|
|
817
762
|
}
|
|
818
763
|
function buildV3Services(maxRecursionDepth) {
|
|
819
|
-
const mapOrSetBySchema = /* @__PURE__ */ new WeakMap();
|
|
820
764
|
const refileIssues = (schema, data, issues) => {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
hasMapOrSet = containsMapOrSet(schema);
|
|
824
|
-
mapOrSetBySchema.set(schema, hasMapOrSet);
|
|
765
|
+
if (!issues.some((issue) => issue.path.some((segment) => typeof segment === "number"))) {
|
|
766
|
+
return issues;
|
|
825
767
|
}
|
|
826
|
-
if (!
|
|
768
|
+
if (!capabilitiesOf(schema).mapOrSet) return issues;
|
|
827
769
|
return normalizeIssuePaths(issues, schema, data, maxRecursionDepth, peelAllV3Wrappers);
|
|
828
770
|
};
|
|
771
|
+
const validateSync = (schema, data) => {
|
|
772
|
+
if (capabilitiesOf(schema).asyncTransform) return [];
|
|
773
|
+
try {
|
|
774
|
+
const result = syncSafe(schema).safeParse(data);
|
|
775
|
+
return result.success ? [] : zodIssuesToValidationErrors(refileIssues(schema, data, result.error.issues));
|
|
776
|
+
} catch {
|
|
777
|
+
return [];
|
|
778
|
+
}
|
|
779
|
+
};
|
|
829
780
|
return {
|
|
830
781
|
getNestedSchemasAtPath: (schema, path, maxRecursionDepth2) => getNestedZodSchemasAtPath(schema, path, maxRecursionDepth2),
|
|
831
782
|
// The shared path walker peels wrappers and effects inline, so the
|
|
@@ -835,6 +786,7 @@ function buildV3Services(maxRecursionDepth) {
|
|
|
835
786
|
slimPrimitivesOf: (schema, _maxRecursionDepth) => slimPrimitivesV3(schema),
|
|
836
787
|
deriveDefault: (schema, useDefault) => getDefaultValuesFromZodSchema(schema, useDefault),
|
|
837
788
|
runGetDefaults: (schema, config, maxRecursionDepth2) => runGetDefaultsV3(schema, config, maxRecursionDepth2),
|
|
789
|
+
validateSync,
|
|
838
790
|
unwrapStructuralWrappers: (schema) => unwrapStructuralLeafV3(schema),
|
|
839
791
|
unwrapToDiscriminatedUnion: (schema) => unwrapToDiscriminatedUnion(schema),
|
|
840
792
|
peelAllWrappers: (schema) => peelAllV3Wrappers(schema),
|
|
@@ -852,10 +804,10 @@ function buildV3Services(maxRecursionDepth) {
|
|
|
852
804
|
// A `getSchemasAtPath` consumer may probe any method on the result,
|
|
853
805
|
// so a sub-schema comes back as a full recursive AbstractSchema: the
|
|
854
806
|
// factory call rebuilds the whole surface against it, with its own
|
|
855
|
-
// per-form caches.
|
|
807
|
+
// per-form caches, and walks its capabilities without the memo.
|
|
856
808
|
makeSubSchema: (sub, maxRecursionDepth2) => createAbstractSchema(
|
|
857
809
|
sub,
|
|
858
|
-
|
|
810
|
+
V3_SUB_SCHEMA_INTROSPECTOR,
|
|
859
811
|
buildV3Services(maxRecursionDepth2),
|
|
860
812
|
{ maxRecursionDepth: maxRecursionDepth2 }
|
|
861
813
|
)
|
|
@@ -1105,7 +1057,8 @@ function runGetDefaultsV3(rootSchema, config, maxRecursionDepth) {
|
|
|
1105
1057
|
rootSchema,
|
|
1106
1058
|
config.useDefaultSchemaValues
|
|
1107
1059
|
);
|
|
1108
|
-
|
|
1060
|
+
if (config.constraints === void 0) return defaultValuesWithoutConstraints;
|
|
1061
|
+
return fixStructuralDefaults(
|
|
1109
1062
|
rootSchema,
|
|
1110
1063
|
mergeDeep(defaultValuesWithoutConstraints, config.constraints),
|
|
1111
1064
|
config.useDefaultSchemaValues,
|
|
@@ -1117,34 +1070,6 @@ function runGetDefaultsV3(rootSchema, config, maxRecursionDepth) {
|
|
|
1117
1070
|
unwrapToDiscriminatedUnion: (s) => unwrapToDiscriminatedUnion(s)
|
|
1118
1071
|
}
|
|
1119
1072
|
).data;
|
|
1120
|
-
if (containsAsyncTransform(rootSchema)) {
|
|
1121
|
-
return {
|
|
1122
|
-
data: rawDefaultValues,
|
|
1123
|
-
errors: void 0,
|
|
1124
|
-
success: true
|
|
1125
|
-
};
|
|
1126
|
-
}
|
|
1127
|
-
try {
|
|
1128
|
-
const parseResult = syncSafe(rootSchema).safeParse(rawDefaultValues);
|
|
1129
|
-
if (parseResult.success) {
|
|
1130
|
-
return {
|
|
1131
|
-
data: rawDefaultValues,
|
|
1132
|
-
errors: void 0,
|
|
1133
|
-
success: true
|
|
1134
|
-
};
|
|
1135
|
-
}
|
|
1136
|
-
return {
|
|
1137
|
-
data: rawDefaultValues,
|
|
1138
|
-
errors: zodIssuesToValidationErrors(parseResult.error.issues),
|
|
1139
|
-
success: false
|
|
1140
|
-
};
|
|
1141
|
-
} catch {
|
|
1142
|
-
return {
|
|
1143
|
-
data: rawDefaultValues,
|
|
1144
|
-
errors: void 0,
|
|
1145
|
-
success: true
|
|
1146
|
-
};
|
|
1147
|
-
}
|
|
1148
1073
|
}
|
|
1149
1074
|
|
|
1150
1075
|
function useForm(configuration) {
|
package/dist/transforms.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as componentBridgeTransform, i as inputTextAreaNodeTransform, r as redundantBindingWarnTransform, v as vRegisterHintTransform, a as vRegisterPreambleTransform } from './shared/attaform.
|
|
1
|
+
export { c as componentBridgeTransform, i as inputTextAreaNodeTransform, r as redundantBindingWarnTransform, v as vRegisterHintTransform, a as vRegisterPreambleTransform } from './shared/attaform.DBCbxlyk.mjs';
|
package/dist/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as resolveZodAliasTarget, i as isRewritableZodSpecifier } from './shared/attaform.BAf3UNn4.mjs';
|
|
2
|
-
import { a as vRegisterPreambleTransform, r as redundantBindingWarnTransform, c as componentBridgeTransform, i as inputTextAreaNodeTransform, v as vRegisterHintTransform } from './shared/attaform.
|
|
2
|
+
import { a as vRegisterPreambleTransform, r as redundantBindingWarnTransform, c as componentBridgeTransform, i as inputTextAreaNodeTransform, v as vRegisterHintTransform } from './shared/attaform.DBCbxlyk.mjs';
|
|
3
3
|
import { parse, babelParse } from '@vue/compiler-sfc';
|
|
4
4
|
import { NodeTypes } from '@vue/compiler-core';
|
|
5
5
|
|
package/dist/zod-v3.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GenericForm, F as FormKey, U as UseFormConfiguration,
|
|
2
|
+
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, ap as AcceptableDefaults, a as UseFormReturnType, ab as ValidateOnConfig, ao as SchemaFactoryOptions, h as FieldMetaPayload } from './shared/attaform.DZnrDrNb.mjs';
|
|
3
3
|
import { AbstractSchema } from './abstract.mjs';
|
|
4
|
-
export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, D as DefaultValuesInput, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, o as FormMeta, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as
|
|
4
|
+
export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, D as DefaultValuesInput, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, o as FormMeta, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as SchemaParseErrorWithData, a0 as SchemaParseErrorWithoutData, a1 as SchemaParseResult, a2 as SchemaParseSuccess, a3 as Segment, a4 as SetValueCallback, a5 as SetValuePayload, a6 as SettledValidationStatus, a7 as SlimPrimitiveKind, a8 as SubmitHandler, a9 as Unset, aa as ValidateOn, ac as ValidationError, ad as ValidationResponse, ae as ValidationResponseWithoutValue, af as ValueOfUnion, ag as WriteMeta, ah as WriteShape, ai as canonicalizePath, aj as isPathPrefix, ak as isUnset, al as parseDottedPath, am as unset } from './shared/attaform.DZnrDrNb.mjs';
|
|
5
5
|
import { S as SupportedRootSchema, U as UnwrapZodRoot, a as StorageShape } from './shared/attaform.B-Tb62qV.mjs';
|
|
6
|
-
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.
|
|
7
|
-
export { v as vRegister } from './shared/attaform.
|
|
6
|
+
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.DAo0QBmS.mjs';
|
|
7
|
+
export { v as vRegister } from './shared/attaform.D9RqPgGu.mjs';
|
|
8
8
|
import 'vue';
|
|
9
9
|
|
|
10
10
|
/**
|
package/dist/zod-v3.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { i as isZodSchemaType, u as useForm, z as zodAdapter } from './shared/attaform.
|
|
2
|
-
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.
|
|
1
|
+
export { i as isZodSchemaType, u as useForm, z as zodAdapter } from './shared/attaform.LUPC-2Qg.mjs';
|
|
2
|
+
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.DL2nl_QR.mjs';
|
|
3
3
|
export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform.CdZIEf7_.mjs';
|
|
4
|
-
export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, d as useRegister, f as useWizard } from './shared/attaform.
|
|
5
|
-
export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.
|
|
6
|
-
export { a as assignKey, v as vRegister } from './shared/attaform.
|
|
4
|
+
export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, d as useRegister, f as useWizard } from './shared/attaform.DNPJPOO7.mjs';
|
|
5
|
+
export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.C4shmwyJ.mjs';
|
|
6
|
+
export { a as assignKey, v as vRegister } from './shared/attaform.DxKQsqFZ.mjs';
|
|
7
7
|
export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
|
|
8
8
|
|
|
9
9
|
const fieldMeta = installingFieldMetaStore;
|
package/dist/zod-v4.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { S as SupportedRootSchema } from './shared/attaform.
|
|
2
|
-
export { P as PathInput, a as PathOutput, u as useForm } from './shared/attaform.
|
|
3
|
-
|
|
4
|
-
import { F as FormKey, ap as SchemaFactoryOptions, h as FieldMetaPayload } from './shared/attaform.Br8EBn5B.mjs';
|
|
1
|
+
import { S as SupportedRootSchema } from './shared/attaform.CRVe8s82.mjs';
|
|
2
|
+
export { P as PathInput, a as PathOutput, u as useForm } from './shared/attaform.CRVe8s82.mjs';
|
|
3
|
+
import { F as FormKey, ao as SchemaFactoryOptions, h as FieldMetaPayload } from './shared/attaform.DZnrDrNb.mjs';
|
|
5
4
|
import { AbstractSchema } from './abstract.mjs';
|
|
6
|
-
export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, D as DefaultValuesInput, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, o as FormMeta, G as GenericForm, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as
|
|
7
|
-
export { v as
|
|
5
|
+
export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, D as DefaultValuesInput, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, o as FormMeta, G as GenericForm, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as SchemaParseErrorWithData, a0 as SchemaParseErrorWithoutData, a1 as SchemaParseResult, a2 as SchemaParseSuccess, a3 as Segment, a4 as SetValueCallback, a5 as SetValuePayload, a6 as SettledValidationStatus, a7 as SlimPrimitiveKind, a8 as SubmitHandler, a9 as Unset, U as UseFormConfiguration, a as UseFormReturnType, aa as ValidateOn, ab as ValidateOnConfig, ac as ValidationError, ad as ValidationResponse, ae as ValidationResponseWithoutValue, af as ValueOfUnion, ag as WriteMeta, ah as WriteShape, ai as canonicalizePath, aj as isPathPrefix, ak as isUnset, al as parseDottedPath, am as unset } from './shared/attaform.DZnrDrNb.mjs';
|
|
6
|
+
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.DAo0QBmS.mjs';
|
|
7
|
+
export { v as vRegister } from './shared/attaform.D9RqPgGu.mjs';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import 'vue';
|
|
10
10
|
|
|
@@ -15,11 +15,13 @@ import 'vue';
|
|
|
15
15
|
* path-walker, discriminator, errors), leaving this file as the wiring
|
|
16
16
|
* between them and the `AbstractSchema` contract.
|
|
17
17
|
*
|
|
18
|
-
* It holds parity with the v3 adapter on
|
|
19
|
-
* `getDefaultValues`'
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* It holds parity with the v3 adapter on four fronts:
|
|
19
|
+
* `getDefaultValues`' derivation, delegated to `default-values.ts`
|
|
20
|
+
* (the default walk, then the DU-aware structural repair walk when
|
|
21
|
+
* constraints are supplied, parsing nothing); `validateSync`'s one
|
|
22
|
+
* synchronous parse of the real schema for the construction verdict;
|
|
23
|
+
* `getSchemasAtPath`' DU-aware path walk; and `validateAtPath`'s
|
|
24
|
+
* per-branch parse with aggregated errors.
|
|
23
25
|
*/
|
|
24
26
|
|
|
25
27
|
/**
|
package/dist/zod-v4.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { a as assertZodVersion, k as kindOf, u as useForm, z as zodAdapter } from './shared/attaform.
|
|
2
|
-
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.
|
|
1
|
+
export { a as assertZodVersion, k as kindOf, u as useForm, z as zodAdapter } from './shared/attaform.BWUn8Kjy.mjs';
|
|
2
|
+
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.DL2nl_QR.mjs';
|
|
3
3
|
export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform.CdZIEf7_.mjs';
|
|
4
|
-
export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, d as useRegister, f as useWizard } from './shared/attaform.
|
|
5
|
-
export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.
|
|
6
|
-
export { a as assignKey, v as vRegister } from './shared/attaform.
|
|
4
|
+
export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, d as useRegister, f as useWizard } from './shared/attaform.DNPJPOO7.mjs';
|
|
5
|
+
export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.C4shmwyJ.mjs';
|
|
6
|
+
export { a as assignKey, v as vRegister } from './shared/attaform.DxKQsqFZ.mjs';
|
|
7
7
|
export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
|
|
8
8
|
|
|
9
9
|
const fieldMeta = installingFieldMetaStore;
|
package/dist/zod.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.
|
|
2
|
-
export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, D as DefaultValuesInput, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, h as FieldMetaPayload, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, F as FormKey, o as FormMeta, G as GenericForm, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as
|
|
3
|
-
export { v as vRegister } from './shared/attaform.
|
|
1
|
+
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.DAo0QBmS.mjs';
|
|
2
|
+
export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, D as DefaultValuesInput, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, h as FieldMetaPayload, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, F as FormKey, o as FormMeta, G as GenericForm, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as SchemaParseErrorWithData, a0 as SchemaParseErrorWithoutData, a1 as SchemaParseResult, a2 as SchemaParseSuccess, a3 as Segment, a4 as SetValueCallback, a5 as SetValuePayload, a6 as SettledValidationStatus, a7 as SlimPrimitiveKind, a8 as SubmitHandler, a9 as Unset, U as UseFormConfiguration, a as UseFormReturnType, aa as ValidateOn, ab as ValidateOnConfig, ac as ValidationError, ad as ValidationResponse, ae as ValidationResponseWithoutValue, af as ValueOfUnion, ag as WriteMeta, ah as WriteShape, ai as canonicalizePath, aj as isPathPrefix, ak as isUnset, al as parseDottedPath, am as unset } from './shared/attaform.DZnrDrNb.mjs';
|
|
3
|
+
export { v as vRegister } from './shared/attaform.D9RqPgGu.mjs';
|
|
4
4
|
export { UseFormConfig, UseFormConfigV3, UseFormConfigV4, UseFormReturn, UseFormReturnV3, UseFormReturnV4, fieldMeta, useForm, withMeta } from './index.mjs';
|
|
5
|
-
export { P as PathInput, a as PathOutput } from './shared/attaform.
|
|
5
|
+
export { P as PathInput, a as PathOutput } from './shared/attaform.CRVe8s82.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
import './shared/attaform.B-Tb62qV.mjs';
|
|
8
8
|
import 'zod';
|