attaform 0.29.0 → 0.30.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 +4 -4
- package/dist/dev/abstract.mjs +4 -4
- package/dist/dev/chunks/dev-key-collision-warnings.mjs +47 -8
- package/dist/dev/chunks/devtools.mjs +1 -1
- package/dist/dev/directive.mjs +1 -1
- package/dist/dev/history.mjs +1 -2
- package/dist/dev/index.mjs +5 -5
- package/dist/dev/runtime/plugins/attaform.mjs +3 -3
- package/dist/dev/shared/{attaform-dev.BO-71R54.mjs → attaform-dev.BK6Ge2qR.mjs} +34 -188
- package/dist/dev/shared/{attaform-dev.A-TpJW0B.mjs → attaform-dev.BQc5QV3Y.mjs} +1 -19
- package/dist/dev/shared/{attaform-dev.DrzObAZo.mjs → attaform-dev.BcNtyOmf.mjs} +4 -4
- package/dist/dev/shared/{attaform-dev.ButTkwHd.mjs → attaform-dev.BcYT6tFh.mjs} +7 -8
- package/dist/dev/shared/{attaform-dev.BgM6FdtA.mjs → attaform-dev.BisFstxh.mjs} +91 -59
- package/dist/dev/shared/{attaform-dev.DHuydLAC.mjs → attaform-dev.CQ2rJiAX.mjs} +560 -631
- package/dist/dev/shared/{attaform-dev.D8aoKb89.mjs → attaform-dev.D6CLvaQT.mjs} +8 -8
- package/dist/dev/shared/{attaform-dev.q6UutkCx.mjs → attaform-dev.DTrHonpc.mjs} +69 -120
- package/dist/dev/shared/{attaform-dev.DD5m2W51.mjs → attaform-dev.DUZckyV8.mjs} +1 -3
- package/dist/dev/zod-v3.mjs +6 -6
- package/dist/dev/zod-v4.mjs +6 -6
- package/dist/dev/zod.mjs +5 -5
- 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 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +5 -5
- package/dist/nuxt.d.mts +2 -11
- package/dist/nuxt.mjs +0 -1
- package/dist/runtime/plugins/attaform.mjs +3 -3
- package/dist/shared/{attaform.DffRL5pP.mjs → attaform.B3resMQ1.mjs} +8 -8
- package/dist/shared/{attaform.Cvao8bW5.mjs → attaform.BRDDQeHV.mjs} +6 -6
- package/dist/shared/{attaform.C2MVyuxC.mjs → attaform.BXneBxEj.mjs} +34 -188
- package/dist/shared/{attaform.BndjUUYX.mjs → attaform.ByWP6kSx.mjs} +4 -4
- package/dist/shared/{attaform.D1fnTifF.mjs → attaform.CJ8DpRGj.mjs} +69 -120
- package/dist/shared/{attaform.B0dKL8ST.mjs → attaform.CUfrMK7t.mjs} +91 -59
- package/dist/shared/{attaform.CZYt_5N_.mjs → attaform.CdZIEf7_.mjs} +1 -19
- package/dist/shared/{attaform.axHXVQO7.d.mts → attaform.Clz0ArIi.d.mts} +1 -1
- package/dist/shared/{attaform.CZMAYwSK.mjs → attaform.DNJOWjQw.mjs} +559 -588
- package/dist/shared/{attaform.CIWLMY-R.d.mts → attaform.Rc9u4Vfw.d.mts} +1 -1
- package/dist/shared/{attaform.DDtqHYv1.d.mts → attaform.UGyOK83T.d.mts} +115 -214
- package/dist/shared/{attaform.D0x-qSXm.mjs → attaform.WiGdIqgx.mjs} +1 -3
- package/dist/shared/{attaform.CsoeRi3P.d.mts → attaform.bKLzMU0o.d.mts} +99 -493
- package/dist/vite.mjs +5 -0
- package/dist/zod-v3.d.mts +4 -4
- package/dist/zod-v3.mjs +6 -6
- package/dist/zod-v4.d.mts +9 -9
- package/dist/zod-v4.mjs +6 -6
- package/dist/zod.d.mts +4 -4
- package/dist/zod.mjs +5 -5
- package/package.json +3 -2
- package/skills/attaform/SKILL.md +1 -1
- package/skills/attaform/references/custom-components.md +1 -1
- package/dist/chunks/fingerprint.mjs +0 -183
- package/dist/chunks/fingerprint2.mjs +0 -159
- package/dist/dev/chunks/fingerprint.mjs +0 -183
- package/dist/dev/chunks/fingerprint2.mjs +0 -159
- package/dist/dev/shared/attaform-dev.BxfsuwBR.mjs +0 -44
- package/dist/shared/attaform.BxfsuwBR.mjs +0 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { reactive, markRaw, isRef, effectScope, watch, warn, nextTick } from 'vue';
|
|
2
|
-
import { e as canonicalizePath } from './attaform-dev.
|
|
2
|
+
import { e as canonicalizePath } from './attaform-dev.BQc5QV3Y.mjs';
|
|
3
3
|
|
|
4
4
|
const INTERACTIVE_TAG_NAMES = /* @__PURE__ */ new Set(["INPUT", "SELECT", "TEXTAREA"]);
|
|
5
5
|
|
|
@@ -288,7 +288,7 @@ function isCheckboxInput(tagName, type) {
|
|
|
288
288
|
return tagName === "INPUT" && typeof type === "string" && type.toLowerCase() === "checkbox";
|
|
289
289
|
}
|
|
290
290
|
function applyAria(el, rv, vnode) {
|
|
291
|
-
if (rv.
|
|
291
|
+
if (rv.ariaDisplayState === void 0) return;
|
|
292
292
|
if (!INTERACTIVE_TAG_NAMES.has(el.tagName)) return;
|
|
293
293
|
const locks = el[ariaLockKey] ?? EMPTY_ARIA_LOCKS;
|
|
294
294
|
const ds = rv.ariaDisplayState.value;
|
|
@@ -303,7 +303,7 @@ function applyAria(el, rv, vnode) {
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
function setupAria(el, rv, vnode) {
|
|
306
|
-
if (rv.
|
|
306
|
+
if (rv.ariaDisplayState === void 0) return;
|
|
307
307
|
if (!INTERACTIVE_TAG_NAMES.has(el.tagName)) return;
|
|
308
308
|
mergeAriaLocks(el, vnode);
|
|
309
309
|
applyAria(el, rv, vnode);
|
|
@@ -325,7 +325,7 @@ function seedLocksFromDom(el) {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
function setupAriaLive(el, rv) {
|
|
328
|
-
if (rv.
|
|
328
|
+
if (rv.ariaDisplayState === void 0) return;
|
|
329
329
|
if (!INTERACTIVE_TAG_NAMES.has(el.tagName)) return;
|
|
330
330
|
seedLocksFromDom(el);
|
|
331
331
|
applyAria(el, rv, null);
|
|
@@ -337,7 +337,7 @@ function setupAriaLive(el, rv) {
|
|
|
337
337
|
el[ariaScopeKey] = () => scope.stop();
|
|
338
338
|
}
|
|
339
339
|
function getSSRAriaProps(rv, vnode) {
|
|
340
|
-
if (rv.
|
|
340
|
+
if (rv.ariaDisplayState === void 0) return void 0;
|
|
341
341
|
const props = vnode?.props ?? null;
|
|
342
342
|
const ds = rv.ariaDisplayState.value;
|
|
343
343
|
const tagName = typeof vnode?.type === "string" ? vnode.type.toUpperCase() : "";
|
|
@@ -1327,7 +1327,7 @@ const vRegisterDynamic = {
|
|
|
1327
1327
|
callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
|
|
1328
1328
|
const ariaEl = el;
|
|
1329
1329
|
const value = binding.value;
|
|
1330
|
-
if (!isRegisterValue(value) || value.
|
|
1330
|
+
if (!isRegisterValue(value) || value.ariaDisplayState === void 0) {
|
|
1331
1331
|
teardownAria(ariaEl);
|
|
1332
1332
|
} else {
|
|
1333
1333
|
const old = binding.oldValue;
|
|
@@ -1372,8 +1372,8 @@ const vRegisterDynamic = {
|
|
|
1372
1372
|
// The lifecycle hooks above don't run on the server (Vue skips
|
|
1373
1373
|
// directive lifecycle during SSR), so emit the same aria attributes
|
|
1374
1374
|
// here from the SSR-time gated display state. Honors authored attrs
|
|
1375
|
-
// (vnode-level lockout)
|
|
1376
|
-
//
|
|
1375
|
+
// (vnode-level lockout), touches no DOM, and shares
|
|
1376
|
+
// `resolveAriaValue` with the client path. Ids are SSR-stable
|
|
1377
1377
|
// (formInstanceId derives from Vue's useId), so a server-rendered
|
|
1378
1378
|
// describedby matches the client after hydration.
|
|
1379
1379
|
getSSRProps(binding, vnode) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { w as walkPathSegments, s as slimPrimitivesWalk, c as createAbstractSchema, b as buildFieldMetaPathMap, g as getFieldMetaForSchema,
|
|
2
|
-
import {
|
|
3
|
-
import { c as callConsumerSchemaFn } from './attaform-dev.
|
|
4
|
-
import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.
|
|
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-dev.BisFstxh.mjs';
|
|
2
|
+
import { h as getAtPath, j as humanize, c as useAbstractForm } from './attaform-dev.CQ2rJiAX.mjs';
|
|
3
|
+
import { c as callConsumerSchemaFn } from './attaform-dev.BcYT6tFh.mjs';
|
|
4
|
+
import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.BQc5QV3Y.mjs';
|
|
5
5
|
|
|
6
6
|
function isZodSchemaType(schema, expectedType) {
|
|
7
7
|
if (typeof schema !== "object" || schema === null) return false;
|
|
@@ -127,22 +127,29 @@ function getTupleItems(schema) {
|
|
|
127
127
|
const def = readDef(schema);
|
|
128
128
|
return def?.items ?? [];
|
|
129
129
|
}
|
|
130
|
+
function readOptionList(options) {
|
|
131
|
+
if (options === void 0) return [];
|
|
132
|
+
if (options instanceof Map) return [...options.values()];
|
|
133
|
+
return [...options];
|
|
134
|
+
}
|
|
130
135
|
function getUnionOptions(schema) {
|
|
131
|
-
|
|
132
|
-
return def?.options ?? [];
|
|
136
|
+
return readOptionList(readDef(schema)?.options);
|
|
133
137
|
}
|
|
134
138
|
function getDiscriminatedOptions(schema) {
|
|
135
|
-
|
|
136
|
-
return def?.options ?? [];
|
|
139
|
+
return readOptionList(readDef(schema)?.options);
|
|
137
140
|
}
|
|
138
141
|
function getDiscriminator(schema) {
|
|
139
142
|
const def = readDef(schema);
|
|
140
143
|
return def?.discriminator;
|
|
141
144
|
}
|
|
142
145
|
function getDiscriminatedOptionsMap(schema) {
|
|
143
|
-
const
|
|
146
|
+
const def = readDef(schema);
|
|
147
|
+
const map = def?.optionsMap ?? def?.options;
|
|
144
148
|
return map instanceof Map ? map : void 0;
|
|
145
149
|
}
|
|
150
|
+
function discriminatedOptionsAreMapped(schema) {
|
|
151
|
+
return readDef(schema)?.options instanceof Map;
|
|
152
|
+
}
|
|
146
153
|
function getIntersectionLeft(schema) {
|
|
147
154
|
const def = readDef(schema);
|
|
148
155
|
return def?.left;
|
|
@@ -301,10 +308,6 @@ function unwrapLazy(schema) {
|
|
|
301
308
|
if (typeof getter !== "function") return void 0;
|
|
302
309
|
return callConsumerSchemaFn(() => getter(), void 0, "lazy-getter");
|
|
303
310
|
}
|
|
304
|
-
function getLazyGetter(schema) {
|
|
305
|
-
const def = readDef(schema);
|
|
306
|
-
return typeof def?.getter === "function" ? def.getter : void 0;
|
|
307
|
-
}
|
|
308
311
|
function getLiteralValues(schema) {
|
|
309
312
|
const def = readDef(schema);
|
|
310
313
|
const v = def?.value;
|
|
@@ -447,7 +450,6 @@ const V3_INTROSPECTOR = {
|
|
|
447
450
|
// Walker accessors (D2 / D3 / D5).
|
|
448
451
|
getArrayElement,
|
|
449
452
|
getSetValueType,
|
|
450
|
-
getRecordKeyType,
|
|
451
453
|
getRecordValueType,
|
|
452
454
|
getMapKeyType: (schema) => kindOf(schema) === "map" ? getMapKeyType(schema) : void 0,
|
|
453
455
|
getMapValueType: (schema) => kindOf(schema) === "map" ? getMapValueType(schema) : void 0,
|
|
@@ -465,7 +467,6 @@ const V3_INTROSPECTOR = {
|
|
|
465
467
|
unwrapPipeIn,
|
|
466
468
|
unwrapPipeOut,
|
|
467
469
|
unwrapLazy,
|
|
468
|
-
getLazyGetter,
|
|
469
470
|
getDefaultValue,
|
|
470
471
|
getCatchDefault,
|
|
471
472
|
hasCatchValue
|
|
@@ -601,22 +602,22 @@ function rebuildDiscriminatedUnion(original, options) {
|
|
|
601
602
|
if (replacement !== void 0) optionsMap.set(value, replacement);
|
|
602
603
|
}
|
|
603
604
|
}
|
|
605
|
+
if (discriminatedOptionsAreMapped(original)) {
|
|
606
|
+
return rebuildWithDef(original, { options: optionsMap });
|
|
607
|
+
}
|
|
604
608
|
return rebuildWithDef(original, { options, optionsMap });
|
|
605
609
|
}
|
|
606
610
|
function rebuildEffects(original, source, effect) {
|
|
607
611
|
return rebuildWithDef(original, { schema: source, effect });
|
|
608
612
|
}
|
|
609
613
|
|
|
610
|
-
function stripAsyncChecks(schema) {
|
|
611
|
-
return walkEffects(schema, "strip");
|
|
612
|
-
}
|
|
613
614
|
function wrapAsyncSafeRefinements(schema) {
|
|
614
|
-
return walkEffects(schema
|
|
615
|
+
return walkEffects(schema);
|
|
615
616
|
}
|
|
616
617
|
function isThenable(value) {
|
|
617
618
|
return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
618
619
|
}
|
|
619
|
-
function walkEffects(schema
|
|
620
|
+
function walkEffects(schema) {
|
|
620
621
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
621
622
|
function recurse(s) {
|
|
622
623
|
const candidate = s;
|
|
@@ -626,7 +627,6 @@ function walkEffects(schema, policy) {
|
|
|
626
627
|
if (isZodSchemaType(s, "ZodEffects")) {
|
|
627
628
|
const inner = unwrapEffectsSource(s);
|
|
628
629
|
if (inner === void 0) return s;
|
|
629
|
-
if (policy === "strip") return recurse(inner);
|
|
630
630
|
const effect = getEffect(s);
|
|
631
631
|
const rebuiltInner = recurse(inner);
|
|
632
632
|
const original = effect?.["refinement"];
|
|
@@ -800,18 +800,18 @@ function zodAdapter(zodSchema) {
|
|
|
800
800
|
`[attaform/zod-v3] useForm schema root must be a ZodObject, ZodRecord, or ZodDiscriminatedUnion (got '${name}'). Wrap other shapes under a key.`
|
|
801
801
|
);
|
|
802
802
|
}
|
|
803
|
-
return (
|
|
803
|
+
return (_formKey, options) => sharedV3Schemas(
|
|
804
804
|
zodSchema,
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
805
|
+
options.maxRecursionDepth,
|
|
806
|
+
() => createAbstractSchema(
|
|
807
|
+
zodSchema,
|
|
808
|
+
V3_INTROSPECTOR,
|
|
809
|
+
buildV3Services(options.maxRecursionDepth),
|
|
810
|
+
options
|
|
811
|
+
)
|
|
809
812
|
);
|
|
810
813
|
}
|
|
811
|
-
|
|
812
|
-
const { fingerprintZodSchema } = await import('../chunks/fingerprint.mjs');
|
|
813
|
-
return fingerprintZodSchema(schema);
|
|
814
|
-
}
|
|
814
|
+
const sharedV3Schemas = createSharedSchemaStore();
|
|
815
815
|
const syncSafeCache = /* @__PURE__ */ new WeakMap();
|
|
816
816
|
function syncSafe(schema) {
|
|
817
817
|
const cached = syncSafeCache.get(schema);
|
|
@@ -832,7 +832,6 @@ function buildV3Services(maxRecursionDepth) {
|
|
|
832
832
|
return normalizeIssuePaths(issues, schema, data, maxRecursionDepth, peelAllV3Wrappers);
|
|
833
833
|
};
|
|
834
834
|
return {
|
|
835
|
-
fingerprint: (schema) => lazyFingerprint(schema),
|
|
836
835
|
getNestedSchemasAtPath: (schema, path, maxRecursionDepth2) => getNestedZodSchemasAtPath(schema, path, maxRecursionDepth2),
|
|
837
836
|
// v3 pre-strips refinements / defaults / wrappers off the root for
|
|
838
837
|
// slim-mode walks — `getSlimPrimitiveTypesAtPath` and
|
|
@@ -843,8 +842,8 @@ function buildV3Services(maxRecursionDepth) {
|
|
|
843
842
|
// unstripped walks coincide — same aliasing v4 always had.
|
|
844
843
|
getNestedSchemasInSlimMode: (schema, path, maxRecursionDepth2) => getNestedZodSchemasAtPath(schema, path, maxRecursionDepth2),
|
|
845
844
|
slimPrimitivesOf: (schema, _maxRecursionDepth) => slimPrimitivesV3(schema),
|
|
846
|
-
deriveDefault: (schema, useDefault
|
|
847
|
-
|
|
845
|
+
deriveDefault: (schema, useDefault) => getDefaultValuesFromZodSchema(schema, useDefault),
|
|
846
|
+
runGetDefaults: (schema, config, maxRecursionDepth2) => runGetDefaultsV3(schema, config, maxRecursionDepth2),
|
|
848
847
|
unwrapStructuralWrappers: (schema) => unwrapStructuralLeafV3(schema),
|
|
849
848
|
unwrapToDiscriminatedUnion: (schema) => unwrapToDiscriminatedUnion(schema),
|
|
850
849
|
peelAllWrappers: (schema) => peelAllV3Wrappers(schema),
|
|
@@ -863,11 +862,10 @@ function buildV3Services(maxRecursionDepth) {
|
|
|
863
862
|
// historical shape) — `getSchemasAtPath` consumers may probe any
|
|
864
863
|
// method on the result. The factory call rebuilds the full surface
|
|
865
864
|
// against the sub-schema with its own per-form caches.
|
|
866
|
-
makeSubSchema: (sub,
|
|
865
|
+
makeSubSchema: (sub, maxRecursionDepth2) => createAbstractSchema(
|
|
867
866
|
sub,
|
|
868
867
|
V3_INTROSPECTOR,
|
|
869
868
|
buildV3Services(maxRecursionDepth2),
|
|
870
|
-
formKey,
|
|
871
869
|
{ maxRecursionDepth: maxRecursionDepth2 }
|
|
872
870
|
)
|
|
873
871
|
};
|
|
@@ -1086,16 +1084,8 @@ function peelAllV3Wrappers(schema) {
|
|
|
1086
1084
|
}
|
|
1087
1085
|
return current;
|
|
1088
1086
|
}
|
|
1089
|
-
function getDefaultValuesFromZodSchema(formSchema, useDefaultSchemaValues
|
|
1090
|
-
return deriveDefaultWalk(formSchema, useDefaultSchemaValues, V3_INTROSPECTOR, 64
|
|
1091
|
-
unsupportedKindFallback: (schema) => {
|
|
1092
|
-
const kindName = schema.constructor?.name ?? "unknown";
|
|
1093
|
-
console.warn(
|
|
1094
|
-
`[attaform] zod-v3 adapter: unsupported schema kind '${kindName}' on form '${formKey}'. Defaulting the field to null. Use a supported zod kind (object/array/record/string/number/etc.) at this path.`
|
|
1095
|
-
);
|
|
1096
|
-
return null;
|
|
1097
|
-
}
|
|
1098
|
-
});
|
|
1087
|
+
function getDefaultValuesFromZodSchema(formSchema, useDefaultSchemaValues) {
|
|
1088
|
+
return deriveDefaultWalk(formSchema, useDefaultSchemaValues, V3_INTROSPECTOR, 64);
|
|
1099
1089
|
}
|
|
1100
1090
|
function resolveFieldMetaAtPathV3(rootSchema, path, maxRecursionDepth) {
|
|
1101
1091
|
const lastSegment = path.length === 0 ? "" : path[path.length - 1];
|
|
@@ -1126,92 +1116,51 @@ function resolveFieldMetaAtPathV3(rootSchema, path, maxRecursionDepth) {
|
|
|
1126
1116
|
meta: Object.freeze({ ...payload ?? {} })
|
|
1127
1117
|
};
|
|
1128
1118
|
}
|
|
1129
|
-
function
|
|
1119
|
+
function runGetDefaultsV3(rootSchema, config, maxRecursionDepth) {
|
|
1130
1120
|
const defaultValuesWithoutConstraints = getDefaultValuesFromZodSchema(
|
|
1131
1121
|
rootSchema,
|
|
1132
|
-
config.useDefaultSchemaValues
|
|
1133
|
-
formKey
|
|
1122
|
+
config.useDefaultSchemaValues
|
|
1134
1123
|
);
|
|
1135
|
-
const rawDefaultValues =
|
|
1136
|
-
if ((config.strict ?? true) !== false) {
|
|
1137
|
-
if (containsAsyncTransform(rootSchema)) {
|
|
1138
|
-
return {
|
|
1139
|
-
data: rawDefaultValues,
|
|
1140
|
-
errors: void 0,
|
|
1141
|
-
success: true,
|
|
1142
|
-
formKey
|
|
1143
|
-
};
|
|
1144
|
-
}
|
|
1145
|
-
try {
|
|
1146
|
-
const strictResult = syncSafe(rootSchema).safeParse(rawDefaultValues);
|
|
1147
|
-
if (strictResult.success) {
|
|
1148
|
-
return {
|
|
1149
|
-
data: rawDefaultValues,
|
|
1150
|
-
errors: void 0,
|
|
1151
|
-
success: true,
|
|
1152
|
-
formKey
|
|
1153
|
-
};
|
|
1154
|
-
}
|
|
1155
|
-
return {
|
|
1156
|
-
data: rawDefaultValues,
|
|
1157
|
-
errors: zodIssuesToValidationErrors(strictResult.error.issues),
|
|
1158
|
-
success: false,
|
|
1159
|
-
formKey
|
|
1160
|
-
};
|
|
1161
|
-
} catch (err) {
|
|
1162
|
-
const isAsyncDetect = err instanceof Error && err.message.includes("Async refinement encountered");
|
|
1163
|
-
if (isAsyncDetect) {
|
|
1164
|
-
try {
|
|
1165
|
-
const strippedResult = syncSafe(stripAsyncChecks(rootSchema)).safeParse(rawDefaultValues);
|
|
1166
|
-
if (strippedResult.success) {
|
|
1167
|
-
return {
|
|
1168
|
-
data: rawDefaultValues,
|
|
1169
|
-
errors: void 0,
|
|
1170
|
-
success: true,
|
|
1171
|
-
formKey
|
|
1172
|
-
};
|
|
1173
|
-
}
|
|
1174
|
-
return {
|
|
1175
|
-
data: rawDefaultValues,
|
|
1176
|
-
errors: zodIssuesToValidationErrors(strippedResult.error.issues),
|
|
1177
|
-
success: false,
|
|
1178
|
-
formKey
|
|
1179
|
-
};
|
|
1180
|
-
} catch {
|
|
1181
|
-
return {
|
|
1182
|
-
data: rawDefaultValues,
|
|
1183
|
-
errors: void 0,
|
|
1184
|
-
success: true,
|
|
1185
|
-
formKey
|
|
1186
|
-
};
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
return {
|
|
1190
|
-
data: rawDefaultValues,
|
|
1191
|
-
errors: void 0,
|
|
1192
|
-
success: true,
|
|
1193
|
-
formKey
|
|
1194
|
-
};
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
const fixed = fixStructuralDefaults(
|
|
1124
|
+
const rawDefaultValues = config.constraints === void 0 ? defaultValuesWithoutConstraints : fixStructuralDefaults(
|
|
1198
1125
|
rootSchema,
|
|
1199
|
-
|
|
1126
|
+
mergeDeep(defaultValuesWithoutConstraints, config.constraints),
|
|
1200
1127
|
config.useDefaultSchemaValues,
|
|
1201
1128
|
maxRecursionDepth,
|
|
1202
1129
|
{
|
|
1203
1130
|
intro: V3_INTROSPECTOR,
|
|
1204
1131
|
slimPrimitivesOf: (s) => slimPrimitivesV3(s),
|
|
1205
|
-
deriveDefault: (s, useDefault) => getDefaultValuesFromZodSchema(s, useDefault
|
|
1132
|
+
deriveDefault: (s, useDefault) => getDefaultValuesFromZodSchema(s, useDefault),
|
|
1206
1133
|
unwrapToDiscriminatedUnion: (s) => unwrapToDiscriminatedUnion(s)
|
|
1207
1134
|
}
|
|
1208
|
-
);
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1135
|
+
).data;
|
|
1136
|
+
if (containsAsyncTransform(rootSchema)) {
|
|
1137
|
+
return {
|
|
1138
|
+
data: rawDefaultValues,
|
|
1139
|
+
errors: void 0,
|
|
1140
|
+
success: true
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
try {
|
|
1144
|
+
const parseResult = syncSafe(rootSchema).safeParse(rawDefaultValues);
|
|
1145
|
+
if (parseResult.success) {
|
|
1146
|
+
return {
|
|
1147
|
+
data: rawDefaultValues,
|
|
1148
|
+
errors: void 0,
|
|
1149
|
+
success: true
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
return {
|
|
1153
|
+
data: rawDefaultValues,
|
|
1154
|
+
errors: zodIssuesToValidationErrors(parseResult.error.issues),
|
|
1155
|
+
success: false
|
|
1156
|
+
};
|
|
1157
|
+
} catch {
|
|
1158
|
+
return {
|
|
1159
|
+
data: rawDefaultValues,
|
|
1160
|
+
errors: void 0,
|
|
1161
|
+
success: true
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1215
1164
|
}
|
|
1216
1165
|
|
|
1217
1166
|
function useForm(configuration) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as RegistryNotInstalledError, O as OutsideSetupError, g as pathKeyToDotted } from './attaform-dev.
|
|
1
|
+
import { c as RegistryNotInstalledError, O as OutsideSetupError, g as pathKeyToDotted } from './attaform-dev.BQc5QV3Y.mjs';
|
|
2
2
|
import { shallowReactive, getCurrentInstance, inject } from 'vue';
|
|
3
3
|
|
|
4
4
|
function detectSSR(options = {}) {
|
|
@@ -17,7 +17,6 @@ const kFormContext = /* @__PURE__ */ Symbol.for("attaform:form-context");
|
|
|
17
17
|
const kFormInstanceId = /* @__PURE__ */ Symbol.for("attaform:form-instance-id");
|
|
18
18
|
function createRegistry(options = {}) {
|
|
19
19
|
const ssr = detectSSR(options);
|
|
20
|
-
const defaults = Object.freeze({ ...options.defaults ?? {} });
|
|
21
20
|
const forms = shallowReactive(/* @__PURE__ */ new Map());
|
|
22
21
|
const wizards = shallowReactive(/* @__PURE__ */ new Map());
|
|
23
22
|
const pendingHydration = shallowReactive(/* @__PURE__ */ new Map());
|
|
@@ -102,7 +101,6 @@ function createRegistry(options = {}) {
|
|
|
102
101
|
wizards,
|
|
103
102
|
pendingHydration,
|
|
104
103
|
ssr,
|
|
105
|
-
defaults,
|
|
106
104
|
trackConsumer,
|
|
107
105
|
trackWizardConsumer,
|
|
108
106
|
enqueuePrefetch,
|
package/dist/dev/zod-v3.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { i as isZodSchemaType, u as useForm, z as zodAdapter } from './shared/attaform-dev.
|
|
2
|
-
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform-dev.
|
|
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-dev.
|
|
4
|
-
export { A as AttaformErrorCode,
|
|
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-dev.
|
|
6
|
-
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.
|
|
1
|
+
export { i as isZodSchemaType, u as useForm, z as zodAdapter } from './shared/attaform-dev.DTrHonpc.mjs';
|
|
2
|
+
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform-dev.BisFstxh.mjs';
|
|
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-dev.BQc5QV3Y.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-dev.CQ2rJiAX.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-dev.DUZckyV8.mjs';
|
|
6
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.D6CLvaQT.mjs';
|
|
7
7
|
|
|
8
8
|
const fieldMeta = installingFieldMetaStore;
|
|
9
9
|
function withMeta(schema, payload) {
|
package/dist/dev/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-dev.
|
|
2
|
-
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform-dev.
|
|
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-dev.
|
|
4
|
-
export { A as AttaformErrorCode,
|
|
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-dev.
|
|
6
|
-
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.
|
|
1
|
+
export { a as assertZodVersion, k as kindOf, u as useForm, z as zodAdapter } from './shared/attaform-dev.BK6Ge2qR.mjs';
|
|
2
|
+
import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform-dev.BisFstxh.mjs';
|
|
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-dev.BQc5QV3Y.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-dev.CQ2rJiAX.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-dev.DUZckyV8.mjs';
|
|
6
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.D6CLvaQT.mjs';
|
|
7
7
|
|
|
8
8
|
const fieldMeta = installingFieldMetaStore;
|
|
9
9
|
function withMeta(schema, payload) {
|
package/dist/dev/zod.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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-dev.
|
|
2
|
-
export { A as AttaformErrorCode,
|
|
3
|
-
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-dev.
|
|
4
|
-
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.
|
|
5
|
-
export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.
|
|
1
|
+
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-dev.BQc5QV3Y.mjs';
|
|
2
|
+
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-dev.CQ2rJiAX.mjs';
|
|
3
|
+
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-dev.DUZckyV8.mjs';
|
|
4
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.D6CLvaQT.mjs';
|
|
5
|
+
export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.BcNtyOmf.mjs';
|
package/dist/directive.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { i as installVRegister, v as vRegister } from './shared/attaform.
|
|
2
|
-
import {
|
|
1
|
+
export { i as installVRegister, v as vRegister } from './shared/attaform.Clz0ArIi.mjs';
|
|
2
|
+
import { ao as RegisterModelDynamicCustomDirective } from './shared/attaform.bKLzMU0o.mjs';
|
|
3
3
|
import 'vue';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/directive.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { i as installVRegister, v as vRegister, b as vRegisterFile } from './shared/attaform.
|
|
1
|
+
export { i as installVRegister, v as vRegister, b as vRegisterFile } from './shared/attaform.B3resMQ1.mjs';
|
package/dist/history.d.mts
CHANGED
package/dist/history.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowRef, computed } from 'vue';
|
|
2
|
-
import { n as normalizeNumericOption, D as DEFAULT_HISTORY_MAX_SNAPSHOTS, s as structuralSnapshot } from './shared/attaform.
|
|
2
|
+
import { n as normalizeNumericOption, D as DEFAULT_HISTORY_MAX_SNAPSHOTS, s as structuralSnapshot } from './shared/attaform.BRDDQeHV.mjs';
|
|
3
3
|
|
|
4
4
|
function captureErrorCells(map) {
|
|
5
5
|
const out = [];
|
|
@@ -77,7 +77,6 @@ function historyPlugin(options) {
|
|
|
77
77
|
const max = normalizeNumericOption({
|
|
78
78
|
value: options?.max ?? DEFAULT_HISTORY_MAX_SNAPSHOTS,
|
|
79
79
|
source: "historyPlugin({ max })",
|
|
80
|
-
allowInfinity: false,
|
|
81
80
|
min: 0,
|
|
82
81
|
defaultValue: DEFAULT_HISTORY_MAX_SNAPSHOTS
|
|
83
82
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
|
|
2
|
-
import { G as GenericForm, F as FormKey, U as UseFormConfiguration,
|
|
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.UGyOK83T.mjs';
|
|
2
|
+
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, aq as AcceptableDefaults, ac as ValidateOnConfig, a as UseFormReturnType, D as DefaultValuesInput, h as FieldMetaPayload } from './shared/attaform.bKLzMU0o.mjs';
|
|
3
3
|
import { AbstractSchema } from './abstract.mjs';
|
|
4
|
-
export { b as ArrayItem, c as ArrayPath,
|
|
5
|
-
export { v as vRegister } from './shared/attaform.
|
|
6
|
-
import { S as SupportedRootSchema, b as StorageShape } from './shared/attaform.
|
|
7
|
-
export { P as PathInput, a as PathOutput } from './shared/attaform.
|
|
4
|
+
export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, 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 SchemaDefaultsResult, a0 as SchemaParseErrorWithData, a1 as SchemaParseErrorWithoutData, a2 as SchemaParseResult, a3 as SchemaParseSuccess, a4 as Segment, a5 as SetValueCallback, a6 as SetValuePayload, a7 as SettledValidationStatus, a8 as SlimPrimitiveKind, a9 as SubmitHandler, aa as Unset, ab as ValidateOn, ad as ValidationError, ae as ValidationResponse, af as ValidationResponseWithoutValue, ag as ValueOfUnion, ah as WriteMeta, ai as WriteShape, aj as canonicalizePath, ak as isPathPrefix, al as isUnset, am as parseDottedPath, an as unset } from './shared/attaform.bKLzMU0o.mjs';
|
|
5
|
+
export { v as vRegister } from './shared/attaform.Clz0ArIi.mjs';
|
|
6
|
+
import { S as SupportedRootSchema, b as StorageShape } from './shared/attaform.Rc9u4Vfw.mjs';
|
|
7
|
+
export { P as PathInput, a as PathOutput } from './shared/attaform.Rc9u4Vfw.mjs';
|
|
8
8
|
import { S as SupportedRootSchema$1, a as StorageShape$1 } from './shared/attaform.DRUT703x.mjs';
|
|
9
9
|
import { UnwrapZodRoot } from './zod-v3.mjs';
|
|
10
10
|
import { z } from 'zod';
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
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.
|
|
2
|
-
export { A as AttaformErrorCode,
|
|
3
|
-
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.
|
|
4
|
-
export { a as assignKey, v as vRegister } from './shared/attaform.
|
|
5
|
-
export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.
|
|
1
|
+
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';
|
|
2
|
+
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.DNJOWjQw.mjs';
|
|
3
|
+
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.WiGdIqgx.mjs';
|
|
4
|
+
export { a as assignKey, v as vRegister } from './shared/attaform.B3resMQ1.mjs';
|
|
5
|
+
export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.ByWP6kSx.mjs';
|
|
6
6
|
export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
|
package/dist/nuxt.d.mts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { AttaformDefaults } from './abstract.mjs';
|
|
3
|
-
import 'vue';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* Options accepted by `attaform/nuxt` under the `attaform`
|
|
@@ -11,18 +9,12 @@ import 'vue';
|
|
|
11
9
|
* export default defineNuxtConfig({
|
|
12
10
|
* modules: ['attaform/nuxt'],
|
|
13
11
|
* attaform: {
|
|
14
|
-
*
|
|
12
|
+
* autoImports: false,
|
|
15
13
|
* },
|
|
16
14
|
* })
|
|
17
15
|
* ```
|
|
18
16
|
*/
|
|
19
17
|
interface AttaformModuleOptions {
|
|
20
|
-
/**
|
|
21
|
-
* App-level defaults applied to every `useForm` call. Per-form
|
|
22
|
-
* options always win. See `AttaformDefaults` for the
|
|
23
|
-
* supported option set and merge rules.
|
|
24
|
-
*/
|
|
25
|
-
defaults?: AttaformDefaults;
|
|
26
18
|
/**
|
|
27
19
|
* Forwarded to `attaform/vite`'s `resolveZodAlias` option.
|
|
28
20
|
* Default `true` — `attaform` and `attaform/zod` imports are rewritten
|
|
@@ -48,10 +40,9 @@ interface AttaformModuleOptions {
|
|
|
48
40
|
/**
|
|
49
41
|
* Shape of the Nuxt public runtime-config slot the module populates.
|
|
50
42
|
* Reach it via `useRuntimeConfig().public.attaform` if you need to
|
|
51
|
-
* read the
|
|
43
|
+
* read the library version outside the form library itself.
|
|
52
44
|
*/
|
|
53
45
|
type AttaformRuntimeConfig = {
|
|
54
|
-
defaults: AttaformDefaults;
|
|
55
46
|
/**
|
|
56
47
|
* Library version, read from the package's own `package.json` at
|
|
57
48
|
* module setup. Surfaced to the runtime plugin so the DevTools
|
package/dist/nuxt.mjs
CHANGED
|
@@ -34,7 +34,6 @@ var nuxt_default = defineNuxtModule({
|
|
|
34
34
|
addVitePlugin(attaform({ resolveZodAlias: _options.resolveZodAlias !== false }));
|
|
35
35
|
const runtimePublic = nuxt.options.runtimeConfig.public;
|
|
36
36
|
runtimePublic["attaform"] = {
|
|
37
|
-
defaults: _options.defaults ?? {},
|
|
38
37
|
version: pkgVersion
|
|
39
38
|
};
|
|
40
39
|
(_a = nuxt.options.vite).optimizeDeps ?? (_a.optimizeDeps = {});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRuntimeConfig, useRoute } from 'nuxt/app';
|
|
2
|
-
import { c as createAttaform, b as kAttaformWizardActiveStepResolver, r as renderAttaformState, h as hydrateAttaformState, g as getRegistryFromApp, D as DEVTOOLS_WINDOW_KEY } from '../../shared/attaform.
|
|
2
|
+
import { c as createAttaform, b as kAttaformWizardActiveStepResolver, r as renderAttaformState, h as hydrateAttaformState, g as getRegistryFromApp, D as DEVTOOLS_WINDOW_KEY } from '../../shared/attaform.WiGdIqgx.mjs';
|
|
3
3
|
|
|
4
4
|
var attaform_default = defineNuxtPlugin({
|
|
5
5
|
// `enforce: 'pre'` makes the "we run before any component's setup" claim
|
|
@@ -11,8 +11,8 @@ var attaform_default = defineNuxtPlugin({
|
|
|
11
11
|
setup(nuxtApp) {
|
|
12
12
|
const isServer = import.meta.server;
|
|
13
13
|
const config = useRuntimeConfig().public;
|
|
14
|
-
const {
|
|
15
|
-
nuxtApp.vueApp.use(createAttaform({ ssr: isServer
|
|
14
|
+
const { version } = config.attaform;
|
|
15
|
+
nuxtApp.vueApp.use(createAttaform({ ssr: isServer }));
|
|
16
16
|
nuxtApp.vueApp.provide(kAttaformWizardActiveStepResolver, (param) => {
|
|
17
17
|
const value = useRoute().query[param];
|
|
18
18
|
if (typeof value === "string") return value;
|