attaform 0.28.0 → 0.29.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/chunks/fingerprint.mjs +1 -1
- package/dist/chunks/fingerprint2.mjs +2 -2
- package/dist/dev/abstract.mjs +4 -4
- package/dist/dev/chunks/devtools.mjs +1 -1
- package/dist/dev/chunks/fingerprint.mjs +1 -1
- package/dist/dev/chunks/fingerprint2.mjs +2 -2
- package/dist/dev/directive.mjs +1 -1
- package/dist/dev/history.mjs +1 -1
- package/dist/dev/index.mjs +5 -5
- package/dist/dev/runtime/plugins/attaform.mjs +1 -1
- package/dist/dev/shared/{attaform-dev.Dr2YzS5B.mjs → attaform-dev.A-TpJW0B.mjs} +11 -1
- package/dist/dev/shared/{attaform-dev.oYrkP9dj.mjs → attaform-dev.BO-71R54.mjs} +51 -158
- package/dist/dev/shared/{attaform-dev.6qxD-Yqo.mjs → attaform-dev.BgM6FdtA.mjs} +143 -36
- package/dist/{shared/attaform.h0i6LijT.mjs → dev/shared/attaform-dev.ButTkwHd.mjs} +149 -16
- package/dist/{shared/attaform.BJGA_UOS.mjs → dev/shared/attaform-dev.BxfsuwBR.mjs} +8 -0
- package/dist/dev/shared/{attaform-dev.P7cseiEG.mjs → attaform-dev.D8aoKb89.mjs} +13 -4
- package/dist/dev/shared/{attaform-dev.BXE2cr0L.mjs → attaform-dev.DD5m2W51.mjs} +1 -1
- package/dist/dev/shared/{attaform-dev.WmuhD_CZ.mjs → attaform-dev.DHuydLAC.mjs} +344 -96
- package/dist/dev/shared/{attaform-dev.BR8u0YOZ.mjs → attaform-dev.DrzObAZo.mjs} +4 -4
- package/dist/dev/shared/{attaform-dev.D2I8e_Mm.mjs → attaform-dev.q6UutkCx.mjs} +170 -132
- 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 -1
- package/dist/index.d.mts +9 -7
- package/dist/index.mjs +5 -5
- package/dist/nuxt.d.mts +10 -10
- package/dist/runtime/plugins/attaform.mjs +1 -1
- package/dist/shared/{attaform.C09fpdLS.mjs → attaform.B0dKL8ST.mjs} +143 -36
- package/dist/shared/{attaform.Cs2Rbdlo.mjs → attaform.BK0cgu2K.mjs} +123 -139
- package/dist/shared/{attaform.D6DCnnQu.mjs → attaform.BndjUUYX.mjs} +4 -4
- package/dist/{dev/shared/attaform-dev.BJGA_UOS.mjs → shared/attaform.BxfsuwBR.mjs} +8 -0
- package/dist/shared/{attaform.NLmerepI.mjs → attaform.C2MVyuxC.mjs} +42 -151
- package/dist/shared/{attaform.B4VkS43-.d.mts → attaform.CIWLMY-R.d.mts} +1 -1
- package/dist/shared/{attaform.B8k8JrmK.mjs → attaform.CZMAYwSK.mjs} +338 -95
- package/dist/shared/{attaform.wfY8XFvm.mjs → attaform.CZYt_5N_.mjs} +11 -1
- package/dist/shared/{attaform.Cgu-hdSb.d.mts → attaform.CsoeRi3P.d.mts} +224 -32
- package/dist/{dev/shared/attaform-dev.By4PRjt0.mjs → shared/attaform.Cvao8bW5.mjs} +132 -22
- package/dist/shared/{attaform.Dq4vWxuG.mjs → attaform.D0x-qSXm.mjs} +1 -1
- package/dist/shared/{attaform.CJP3RkGa.mjs → attaform.D1fnTifF.mjs} +168 -132
- package/dist/shared/{attaform.D5V4tZWq.d.mts → attaform.DDtqHYv1.d.mts} +88 -7
- package/dist/shared/{attaform.uLbun31C.mjs → attaform.DffRL5pP.mjs} +12 -4
- package/dist/shared/{attaform.JfSWdEcb.d.mts → attaform.axHXVQO7.d.mts} +1 -1
- package/dist/transforms.d.mts +0 -22
- package/dist/transforms.mjs +1 -1
- package/dist/vite.d.mts +13 -4
- package/dist/vite.mjs +3 -2
- package/dist/zod-v3.d.mts +6 -4
- package/dist/zod-v3.mjs +6 -6
- package/dist/zod-v4.d.mts +14 -27
- package/dist/zod-v4.mjs +6 -6
- package/dist/zod.d.mts +4 -4
- package/dist/zod.mjs +5 -5
- package/package.json +17 -14
- package/skills/attaform/SKILL.md +5 -2
- package/skills/attaform/references/custom-components.md +7 -2
- package/skills/attaform/references/errors.md +8 -3
- package/skills/attaform/references/saving.md +77 -0
- package/skills/attaform/references/wizards.md +10 -8
package/dist/abstract.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as AttaformRegistry } from './shared/attaform.
|
|
2
|
-
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, C as CompiledStep, D as DEFAULT_TIMINGS, f as DEVTOOLS_WINDOW_KEY, g as DisplayTimings, F as FormStatus, h as FormStatusSeed, G as GateMarker, I as InjectWizardInput, i as InvalidPathError, j as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, k as ReservedFormKeyError, S as SerializedAttaformState, l as SerializedFormData, m as StepSlot, n as SubmitErrorHandlerError, U as
|
|
3
|
-
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.
|
|
4
|
-
export { b as ArrayItem, c as ArrayPath, d as AttaformDefaults, C as CoercionEntry, e as CoercionRegistry, f as CoercionResult, g as CustomDirectiveRegisterAssignerFn, h as DeepPartial, i as DefaultValuesResponse, j as DefaultValuesShape, k as DisplayCtx, l as DisplayMachine, m as DisplayState, E as ErrorInput, n as ErrorsProxyShape, o as FieldMetaPayload, p as FieldState, q as FieldStateMap, r as FieldStateMapEntry, s as FlatPath, t as FormErrorRecord, u as FormErrorsSurface, v as FormMeta, w as GetDisplayState, H as HandleSubmit, x as HistoryPlugin, I as IsTuple, y as IsUnion, J as JoinSegments, z as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, B as NestedType, O as OnError, P as OnInvalidSubmitPolicy, Q as OnSubmit, R as ParseOptions, S as PartialFlatPath, T as Path, V as PathKey, W as PendingValidationStatus, X as Primitive, Y as ROOT_PATH, Z as ROOT_PATH_KEY, _ as ReactiveValidationStatus, $ as
|
|
5
|
-
export { v as vRegister } from './shared/attaform.
|
|
1
|
+
import { A as AttaformRegistry } from './shared/attaform.DDtqHYv1.mjs';
|
|
2
|
+
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, C as CompiledStep, D as DEFAULT_TIMINGS, f as DEVTOOLS_WINDOW_KEY, g as DisplayTimings, F as FormStatus, h as FormStatusSeed, G as GateMarker, I as InjectWizardInput, i as InvalidPathError, j as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, k as ReservedFormKeyError, S as SerializedAttaformState, l as SerializedFormData, m as StepSlot, n as SubmitErrorHandlerError, U as UseRegisterOptions, o as UseRegisterReturn, p as UseWizardReturnType, W as WizardAggregateError, q as WizardCtx, r as WizardCtxForm, s as WizardOnError, t as WizardOnSubmit, u as WizardOptions, v as WizardPersistFn, w as WizardRestoreFn, x as WizardRestoreState, y as WizardStatusesProxy, z as WizardSubmitContext, B as assignKey, E as createAttaform, H as createRegistry, J as defaultCoercionRules, K as defaultDisplayState, M as defineCoercion, N as escapeForInlineScript, P as gate, Q as getRegistryFromApp, T as hydrateAttaformState, V as injectForm, X as injectWizard, Y as isRegisterValue, Z as kAttaformRegistry, _ as lazy, $ as makeDefaultDisplayState, a0 as renderAttaformState, a1 as useRegister, a2 as useRegistry, a3 as useWizard } from './shared/attaform.DDtqHYv1.mjs';
|
|
3
|
+
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.CsoeRi3P.mjs';
|
|
4
|
+
export { b as ArrayItem, c as ArrayPath, d as AttaformDefaults, C as CoercionEntry, e as CoercionRegistry, f as CoercionResult, g as CustomDirectiveRegisterAssignerFn, h as DeepPartial, i as DefaultValuesResponse, j as DefaultValuesShape, k as DisplayCtx, l as DisplayMachine, m as DisplayState, E as ErrorInput, n as ErrorsProxyShape, o as FieldMetaPayload, p as FieldState, q as FieldStateMap, r as FieldStateMapEntry, s as FlatPath, t as FormErrorRecord, u as FormErrorsSurface, v as FormMeta, w as GetDisplayState, H as HandleSubmit, x as HistoryPlugin, I as IsTuple, y as IsUnion, J as JoinSegments, z as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, B as NestedType, O as OnError, P as OnInvalidSubmitPolicy, Q as OnSubmit, R as ParseOptions, S as PartialFlatPath, T as Path, V as PathKey, W as PendingValidationStatus, X as Primitive, Y as ROOT_PATH, Z as ROOT_PATH_KEY, _ as ReactiveValidationStatus, $ as RecordPath, a0 as RecordValue, a1 as RegisterDirective, a2 as RegisterFlatPath, a3 as RegisterOptions, a4 as RegisterSelectModifier, a5 as RegisterTextModifier, a6 as RegisterTransform, a7 as RegisterValue, a8 as Segment, a9 as SetValueCallback, aa as SetValuePayload, ab as SettledValidationStatus, ac as SlimPrimitiveKind, ad as SlimRuntimeOf, ae as SubmitHandler, af as Unset, ag as ValidateOn, ah as ValidateOnConfig, ai as ValidationError, aj as ValidationResponse, ak as ValidationResponseWithoutValue, al as ValueOfUnion, am as WriteMeta, an as WriteShape, ao as canonicalizePath, ap as isPathPrefix, aq as isUnset, ar as parseDottedPath, as as unset } from './shared/attaform.CsoeRi3P.mjs';
|
|
5
|
+
export { v as vRegister } from './shared/attaform.axHXVQO7.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/abstract.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AttaformErrorCode, D as DEFAULT_TIMINGS, d as defaultCoercionRules, a as defaultDisplayState, b as defineCoercion, e as escapeForInlineScript, g as gate, i as injectForm, c as injectWizard, f as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, h as useAbstractForm, j as useRegister, k as useWizard } from './shared/attaform.
|
|
2
|
-
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.
|
|
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.
|
|
1
|
+
export { A as AttaformErrorCode, D as DEFAULT_TIMINGS, d as defaultCoercionRules, a as defaultDisplayState, b as defineCoercion, e as escapeForInlineScript, g as gate, i as injectForm, c as injectWizard, f as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, h as useAbstractForm, j as useRegister, k as useWizard } from './shared/attaform.CZMAYwSK.mjs';
|
|
2
|
+
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.CZYt_5N_.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.D0x-qSXm.mjs';
|
|
4
|
+
export { a as assignKey, v as vRegister } from './shared/attaform.DffRL5pP.mjs';
|
|
5
5
|
export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as canonicalStringify } from '../shared/attaform.
|
|
2
|
-
import { k as kindOf, g as getIntersectionLeft, b as getIntersectionRight, c as unwrapLazy, d as unwrapInner, e as unwrapPipe, f as getDiscriminator, h as getDiscriminatedOptions, i as getUnionOptions, j as getRecordKeyType, l as getRecordValueType, m as getTupleItems, n as getSetValueType, o as getArrayElement, p as getObjectShape, q as getEnumValues, r as getLiteralValues, s as getChecks, t as getCatchDefault, v as getDefaultValue } from '../shared/attaform.
|
|
1
|
+
import { c as canonicalStringify } from '../shared/attaform.BxfsuwBR.mjs';
|
|
2
|
+
import { k as kindOf, g as getIntersectionLeft, b as getIntersectionRight, c as unwrapLazy, d as unwrapInner, e as unwrapPipe, f as getDiscriminator, h as getDiscriminatedOptions, i as getUnionOptions, j as getRecordKeyType, l as getRecordValueType, m as getTupleItems, n as getSetValueType, o as getArrayElement, p as getObjectShape, q as getEnumValues, r as getLiteralValues, s as getChecks, t as getCatchDefault, v as getDefaultValue } from '../shared/attaform.C2MVyuxC.mjs';
|
|
3
3
|
|
|
4
4
|
const cyclicSentinel = "<cyclic>";
|
|
5
5
|
function fingerprintZodSchema(schema) {
|
package/dist/dev/abstract.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AttaformErrorCode, D as DEFAULT_TIMINGS, d as defaultCoercionRules, a as defaultDisplayState, b as defineCoercion, e as escapeForInlineScript, g as gate, i as injectForm, c as injectWizard, f as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, h as useAbstractForm, j as useRegister, k as useWizard } from './shared/attaform-dev.
|
|
2
|
-
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.
|
|
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.
|
|
1
|
+
export { A as AttaformErrorCode, D as DEFAULT_TIMINGS, d as defaultCoercionRules, a as defaultDisplayState, b as defineCoercion, e as escapeForInlineScript, g as gate, i as injectForm, c as injectWizard, f as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, h as useAbstractForm, j as useRegister, k as useWizard } from './shared/attaform-dev.DHuydLAC.mjs';
|
|
2
|
+
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.A-TpJW0B.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.DD5m2W51.mjs';
|
|
4
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.D8aoKb89.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as canonicalStringify } from '../shared/attaform-dev.
|
|
2
|
-
import { k as kindOf, g as getIntersectionLeft, b as getIntersectionRight, c as unwrapLazy, d as unwrapInner, e as unwrapPipe, f as getDiscriminator, h as getDiscriminatedOptions, i as getUnionOptions, j as getRecordKeyType, l as getRecordValueType, m as getTupleItems, n as getSetValueType, o as getArrayElement, p as getObjectShape, q as getEnumValues, r as getLiteralValues, s as getChecks, t as getCatchDefault, v as getDefaultValue } from '../shared/attaform-dev.
|
|
1
|
+
import { c as canonicalStringify } from '../shared/attaform-dev.BxfsuwBR.mjs';
|
|
2
|
+
import { k as kindOf, g as getIntersectionLeft, b as getIntersectionRight, c as unwrapLazy, d as unwrapInner, e as unwrapPipe, f as getDiscriminator, h as getDiscriminatedOptions, i as getUnionOptions, j as getRecordKeyType, l as getRecordValueType, m as getTupleItems, n as getSetValueType, o as getArrayElement, p as getObjectShape, q as getEnumValues, r as getLiteralValues, s as getChecks, t as getCatchDefault, v as getDefaultValue } from '../shared/attaform-dev.BO-71R54.mjs';
|
|
3
3
|
|
|
4
4
|
const cyclicSentinel = "<cyclic>";
|
|
5
5
|
function fingerprintZodSchema(schema) {
|
package/dist/dev/directive.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { b as installVRegister, v as vRegister, c as vRegisterFile } from './shared/attaform-dev.
|
|
1
|
+
export { b as installVRegister, v as vRegister, c as vRegisterFile } from './shared/attaform-dev.D8aoKb89.mjs';
|
package/dist/dev/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-dev.
|
|
2
|
+
import { n as normalizeNumericOption, D as DEFAULT_HISTORY_MAX_SNAPSHOTS, s as structuralSnapshot } from './shared/attaform-dev.ButTkwHd.mjs';
|
|
3
3
|
|
|
4
4
|
function captureErrorCells(map) {
|
|
5
5
|
const out = [];
|
package/dist/dev/index.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, D as DEFAULT_TIMINGS, d as defaultCoercionRules, a as defaultDisplayState, b as defineCoercion, e as escapeForInlineScript, g as gate, i as injectForm, c as injectWizard, f as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, j as useRegister, k as useWizard } from './shared/attaform-dev.
|
|
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.A-TpJW0B.mjs';
|
|
2
|
+
export { A as AttaformErrorCode, D as DEFAULT_TIMINGS, d as defaultCoercionRules, a as defaultDisplayState, b as defineCoercion, e as escapeForInlineScript, g as gate, i as injectForm, c as injectWizard, f as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, j as useRegister, k as useWizard } from './shared/attaform-dev.DHuydLAC.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.DD5m2W51.mjs';
|
|
4
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.D8aoKb89.mjs';
|
|
5
|
+
export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.DrzObAZo.mjs';
|
|
@@ -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-dev.
|
|
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-dev.DD5m2W51.mjs';
|
|
3
3
|
|
|
4
4
|
var attaform_default = defineNuxtPlugin({
|
|
5
5
|
// `enforce: 'pre'` makes the "we run before any component's setup" claim
|
|
@@ -79,6 +79,16 @@ function groupErrorsByKey(entries) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
const INTEGER_SEGMENT = /^(?:0|[1-9]\d*)$/;
|
|
82
|
+
const SET_MEMBER_SEGMENT = "__atta:member";
|
|
83
|
+
function mapSegmentKeys(value) {
|
|
84
|
+
const keys = [];
|
|
85
|
+
for (const key of value.keys()) {
|
|
86
|
+
if (typeof key === "string") keys.push(key);
|
|
87
|
+
else if (typeof key === "number" && Number.isInteger(key) && key >= 0) keys.push(key);
|
|
88
|
+
else return null;
|
|
89
|
+
}
|
|
90
|
+
return keys;
|
|
91
|
+
}
|
|
82
92
|
function normalizeSegment(raw) {
|
|
83
93
|
if (typeof raw === "number") {
|
|
84
94
|
if (!Number.isInteger(raw) || raw < 0) {
|
|
@@ -194,4 +204,4 @@ function pathsEqual(a, b) {
|
|
|
194
204
|
return true;
|
|
195
205
|
}
|
|
196
206
|
|
|
197
|
-
export { AttaformError as A, InvalidPathError as I, OutsideSetupError as O, ROOT_PATH as R, SubmitErrorHandlerError as S, InvalidUseFormConfigError as a, ROOT_PATH_KEY as b, RegistryNotInstalledError as c, ReservedFormKeyError as d, canonicalizePath as e, pathsEqual as f, pathKeyToDotted as g,
|
|
207
|
+
export { AttaformError as A, InvalidPathError as I, OutsideSetupError as O, ROOT_PATH as R, SubmitErrorHandlerError as S, InvalidUseFormConfigError as a, ROOT_PATH_KEY as b, RegistryNotInstalledError as c, ReservedFormKeyError as d, canonicalizePath as e, pathsEqual as f, pathKeyToDotted as g, SET_MEMBER_SEGMENT as h, isPathPrefix as i, cellEntriesFor as j, keyForSegments as k, groupErrorsByKey as l, mapSegmentKeys as m, normalizeErrorInput as n, normalizeErrorInputs as o, parseDottedPath as p, coerceToPathKey as q, segmentsForPathKey as s, toError as t };
|
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.
|
|
3
|
-
import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, b as buildFieldMetaPathMap, a as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform-dev.
|
|
1
|
+
import { q as humanize, h as useAbstractForm } from './attaform-dev.DHuydLAC.mjs';
|
|
2
|
+
import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.A-TpJW0B.mjs';
|
|
3
|
+
import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, b as buildFieldMetaPathMap, a as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform-dev.BgM6FdtA.mjs';
|
|
4
|
+
import { c as callConsumerSchemaFn } from './attaform-dev.ButTkwHd.mjs';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
|
|
6
|
-
let warnedZodCodeMissing = false;
|
|
7
|
-
function zodIssuesToValidationErrors(issues) {
|
|
8
|
-
return issues.map((issue) => {
|
|
9
|
-
let code;
|
|
10
|
-
if (typeof issue.code === "string" && issue.code.length > 0) {
|
|
11
|
-
code = `zod:${issue.code}`;
|
|
12
|
-
} else {
|
|
13
|
-
code = "zod:unknown";
|
|
14
|
-
if (!warnedZodCodeMissing) {
|
|
15
|
-
warnedZodCodeMissing = true;
|
|
16
|
-
console.warn(
|
|
17
|
-
"[attaform] zod-v4 adapter received an issue with no string `code`; stamping `'zod:unknown'`. This usually means a custom Zod plugin emitted an issue without the standard code field."
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
message: issue.message,
|
|
23
|
-
// Adapter-side paths stay schema-relative — the validation
|
|
24
|
-
// pipeline in `create-form-store.ts` prepends the parent path
|
|
25
|
-
// to absolutise, then routes form-level (absolute path length 0)
|
|
26
|
-
// entries to the empty-string bucket at storage time.
|
|
27
|
-
path: issue.path.map((seg) => typeof seg === "number" ? seg : String(seg)),
|
|
28
|
-
code
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
class UnsupportedSchemaError extends AttaformError {
|
|
33
|
-
}
|
|
34
|
-
|
|
35
7
|
function readDef(schema) {
|
|
36
8
|
if (schema === null || typeof schema !== "object") return void 0;
|
|
37
9
|
return schema.def;
|
|
@@ -110,6 +82,8 @@ function getRecordValueType(schema) {
|
|
|
110
82
|
const def = readDef(schema);
|
|
111
83
|
return def?.valueType;
|
|
112
84
|
}
|
|
85
|
+
const getMapKeyType = getRecordKeyType;
|
|
86
|
+
const getMapValueType = getRecordValueType;
|
|
113
87
|
function getTupleItems(schema) {
|
|
114
88
|
const def = readDef(schema);
|
|
115
89
|
return def?.items ?? [];
|
|
@@ -156,7 +130,7 @@ function unwrapLazy(schema) {
|
|
|
156
130
|
const def = readDef(schema);
|
|
157
131
|
const getter = def?.getter;
|
|
158
132
|
if (typeof getter !== "function") return void 0;
|
|
159
|
-
return getter();
|
|
133
|
+
return callConsumerSchemaFn(() => getter(), void 0, "lazy-getter");
|
|
160
134
|
}
|
|
161
135
|
function getLazyGetter(schema) {
|
|
162
136
|
const def = readDef(schema);
|
|
@@ -174,11 +148,11 @@ function getCatchDefault(schema) {
|
|
|
174
148
|
const def = readDef(schema);
|
|
175
149
|
const cv = def?.catchValue;
|
|
176
150
|
if (typeof cv !== "function") return void 0;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
151
|
+
return callConsumerSchemaFn(
|
|
152
|
+
() => cv({ error: new Error("atta:default-values"), input: void 0 }),
|
|
153
|
+
void 0,
|
|
154
|
+
"catch-factory"
|
|
155
|
+
);
|
|
182
156
|
}
|
|
183
157
|
function hasCatchValue(schema) {
|
|
184
158
|
const def = readDef(schema);
|
|
@@ -186,7 +160,7 @@ function hasCatchValue(schema) {
|
|
|
186
160
|
}
|
|
187
161
|
function getDefaultValue(schema) {
|
|
188
162
|
const def = readDef(schema);
|
|
189
|
-
return def?.defaultValue;
|
|
163
|
+
return callConsumerSchemaFn(() => def?.defaultValue, void 0, "default-factory");
|
|
190
164
|
}
|
|
191
165
|
function getNativeEnumValues(_schema) {
|
|
192
166
|
return void 0;
|
|
@@ -335,123 +309,6 @@ function isAsyncCheck(check) {
|
|
|
335
309
|
return fn.constructor.name === "AsyncFunction";
|
|
336
310
|
}
|
|
337
311
|
|
|
338
|
-
const UNSUPPORTED = [
|
|
339
|
-
"promise",
|
|
340
|
-
"custom",
|
|
341
|
-
"template-literal",
|
|
342
|
-
"map",
|
|
343
|
-
"symbol",
|
|
344
|
-
"function"
|
|
345
|
-
];
|
|
346
|
-
function labelPath(path) {
|
|
347
|
-
return path.length === 0 ? "<root>" : path.join(".");
|
|
348
|
-
}
|
|
349
|
-
function assertSupportedKinds(schema, path = [], lazyGetters = []) {
|
|
350
|
-
const kind = kindOf(schema);
|
|
351
|
-
if (UNSUPPORTED.includes(kind)) {
|
|
352
|
-
throw new UnsupportedSchemaError(
|
|
353
|
-
`[attaform/zod] unsupported kind '${kind}' at '${labelPath(path)}'`
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
switch (kind) {
|
|
357
|
-
case "object": {
|
|
358
|
-
const shape = getObjectShape(schema);
|
|
359
|
-
for (const [key, sub] of Object.entries(shape)) {
|
|
360
|
-
assertSupportedKinds(sub, [...path, key], lazyGetters);
|
|
361
|
-
}
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
case "array":
|
|
365
|
-
assertSupportedKinds(getArrayElement(schema), [...path, "*"], lazyGetters);
|
|
366
|
-
return;
|
|
367
|
-
case "set":
|
|
368
|
-
assertSupportedKinds(getSetValueType(schema), [...path, "*"], lazyGetters);
|
|
369
|
-
return;
|
|
370
|
-
case "record":
|
|
371
|
-
assertSupportedKinds(getRecordValueType(schema), [...path, "*"], lazyGetters);
|
|
372
|
-
return;
|
|
373
|
-
case "tuple": {
|
|
374
|
-
const items = getTupleItems(schema);
|
|
375
|
-
items.forEach((item, i) => assertSupportedKinds(item, [...path, String(i)], lazyGetters));
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
case "union": {
|
|
379
|
-
const options = getUnionOptions(schema);
|
|
380
|
-
options.forEach((opt, i) => assertSupportedKinds(opt, [...path, `|${i}`], lazyGetters));
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
case "discriminated-union": {
|
|
384
|
-
const options = getDiscriminatedOptions(schema);
|
|
385
|
-
options.forEach((opt, i) => assertSupportedKinds(opt, [...path, `|${i}`], lazyGetters));
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
case "optional":
|
|
389
|
-
case "nullable":
|
|
390
|
-
case "default":
|
|
391
|
-
case "readonly":
|
|
392
|
-
case "catch": {
|
|
393
|
-
const inner = unwrapInner(schema);
|
|
394
|
-
if (inner !== void 0) assertSupportedKinds(inner, path, lazyGetters);
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
case "pipe": {
|
|
398
|
-
const inner = unwrapPipe(schema);
|
|
399
|
-
if (inner !== void 0) assertSupportedKinds(inner, path, lazyGetters);
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
case "lazy": {
|
|
403
|
-
const getter = getLazyGetter(schema);
|
|
404
|
-
if (getter !== void 0 && lazyGetters.includes(getter)) return;
|
|
405
|
-
const inner = unwrapLazy(schema);
|
|
406
|
-
if (inner !== void 0) {
|
|
407
|
-
assertSupportedKinds(
|
|
408
|
-
inner,
|
|
409
|
-
path,
|
|
410
|
-
getter === void 0 ? lazyGetters : [...lazyGetters, getter]
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
case "intersection": {
|
|
416
|
-
const left = getIntersectionLeft(schema);
|
|
417
|
-
const right = getIntersectionRight(schema);
|
|
418
|
-
if (left !== void 0) assertSupportedKinds(left, [...path, "left"], lazyGetters);
|
|
419
|
-
if (right !== void 0) assertSupportedKinds(right, [...path, "right"], lazyGetters);
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
// Leaves: nothing to descend into.
|
|
423
|
-
case "string":
|
|
424
|
-
case "number":
|
|
425
|
-
case "boolean":
|
|
426
|
-
case "bigint":
|
|
427
|
-
case "date":
|
|
428
|
-
case "enum":
|
|
429
|
-
case "literal":
|
|
430
|
-
case "null":
|
|
431
|
-
case "undefined":
|
|
432
|
-
case "nan":
|
|
433
|
-
case "any":
|
|
434
|
-
case "unknown":
|
|
435
|
-
case "void":
|
|
436
|
-
case "never":
|
|
437
|
-
case "promise":
|
|
438
|
-
case "custom":
|
|
439
|
-
case "template-literal":
|
|
440
|
-
case "transform":
|
|
441
|
-
case "file":
|
|
442
|
-
case "map":
|
|
443
|
-
case "symbol":
|
|
444
|
-
case "function":
|
|
445
|
-
return;
|
|
446
|
-
default: {
|
|
447
|
-
const _exhaustive = kind;
|
|
448
|
-
throw new Error(
|
|
449
|
-
`assertSupportedKinds: unhandled ZodKind '${_exhaustive}'`
|
|
450
|
-
);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
|
|
455
312
|
function unwrapToDiscriminatedUnion(schema) {
|
|
456
313
|
let current = schema;
|
|
457
314
|
for (let i = 0; i < 64; i++) {
|
|
@@ -478,6 +335,33 @@ function unwrapToDiscriminatedUnion(schema) {
|
|
|
478
335
|
return void 0;
|
|
479
336
|
}
|
|
480
337
|
|
|
338
|
+
let warnedZodCodeMissing = false;
|
|
339
|
+
function zodIssuesToValidationErrors(issues) {
|
|
340
|
+
return issues.map((issue) => {
|
|
341
|
+
let code;
|
|
342
|
+
if (typeof issue.code === "string" && issue.code.length > 0) {
|
|
343
|
+
code = `zod:${issue.code}`;
|
|
344
|
+
} else {
|
|
345
|
+
code = "zod:unknown";
|
|
346
|
+
if (!warnedZodCodeMissing) {
|
|
347
|
+
warnedZodCodeMissing = true;
|
|
348
|
+
console.warn(
|
|
349
|
+
"[attaform] zod-v4 adapter received an issue with no string `code`; stamping `'zod:unknown'`. This usually means a custom Zod plugin emitted an issue without the standard code field."
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
message: issue.message,
|
|
355
|
+
// Adapter-side paths stay schema-relative — the validation
|
|
356
|
+
// pipeline in `create-form-store.ts` prepends the parent path
|
|
357
|
+
// to absolutise, then routes form-level (absolute path length 0)
|
|
358
|
+
// entries to the empty-string bucket at storage time.
|
|
359
|
+
path: issue.path.map((seg) => typeof seg === "number" ? seg : String(seg)),
|
|
360
|
+
code
|
|
361
|
+
};
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
481
365
|
const V4_INTROSPECTOR = {
|
|
482
366
|
kindOf: (schema) => kindOf(schema),
|
|
483
367
|
getObjectShape: (schema) => getObjectShape(schema),
|
|
@@ -499,6 +383,8 @@ const V4_INTROSPECTOR = {
|
|
|
499
383
|
getSetValueType: (schema) => kindOf(schema) === "set" ? getSetValueType(schema) : void 0,
|
|
500
384
|
getRecordKeyType: (schema) => kindOf(schema) === "record" ? getRecordKeyType(schema) : void 0,
|
|
501
385
|
getRecordValueType: (schema) => kindOf(schema) === "record" ? getRecordValueType(schema) : void 0,
|
|
386
|
+
getMapKeyType: (schema) => kindOf(schema) === "map" ? getMapKeyType(schema) : void 0,
|
|
387
|
+
getMapValueType: (schema) => kindOf(schema) === "map" ? getMapValueType(schema) : void 0,
|
|
502
388
|
getUnionOptions,
|
|
503
389
|
getIntersectionLeft,
|
|
504
390
|
getIntersectionRight,
|
|
@@ -704,6 +590,13 @@ function unwrapStructuralWrappers(schema) {
|
|
|
704
590
|
}
|
|
705
591
|
return current;
|
|
706
592
|
}
|
|
593
|
+
function assertKeyedRoot(rootSchema) {
|
|
594
|
+
const kind = kindOf(peelAllWrappers(rootSchema));
|
|
595
|
+
if (kind === "object" || kind === "record" || kind === "discriminated-union") return;
|
|
596
|
+
throw new AttaformError(
|
|
597
|
+
`[attaform/zod] useForm schema root must be a ZodObject, ZodRecord, or ZodDiscriminatedUnion (got '${kind}'). Wrap other shapes under a key.`
|
|
598
|
+
);
|
|
599
|
+
}
|
|
707
600
|
function peelAllWrappers(schema) {
|
|
708
601
|
let current = schema;
|
|
709
602
|
for (let i = 0; i < 64; i++) {
|
|
@@ -777,7 +670,7 @@ function isLeafRequired(schema, depth = 0) {
|
|
|
777
670
|
}
|
|
778
671
|
function zodV4Adapter(rootSchema) {
|
|
779
672
|
assertZodVersion(rootSchema);
|
|
780
|
-
|
|
673
|
+
assertKeyedRoot(rootSchema);
|
|
781
674
|
return (formKey, options) => createAbstractSchema(
|
|
782
675
|
rootSchema,
|
|
783
676
|
V4_INTROSPECTOR,
|
|
@@ -924,4 +817,4 @@ function useForm(configuration) {
|
|
|
924
817
|
});
|
|
925
818
|
}
|
|
926
819
|
|
|
927
|
-
export {
|
|
820
|
+
export { assertZodVersion as a, getIntersectionRight as b, unwrapLazy as c, unwrapInner as d, unwrapPipe as e, getDiscriminator as f, getIntersectionLeft as g, getDiscriminatedOptions as h, getUnionOptions as i, getRecordKeyType as j, kindOf as k, getRecordValueType as l, getTupleItems as m, getSetValueType as n, getArrayElement as o, getObjectShape as p, getEnumValues as q, getLiteralValues as r, getChecks as s, getCatchDefault as t, useForm as u, getDefaultValue as v, zodV4Adapter as z };
|