attaform 0.30.0 → 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 +15 -21
- package/dist/abstract.mjs +3 -3
- package/dist/dev/abstract.mjs +4 -4
- package/dist/dev/chunks/devtools.mjs +4 -4
- package/dist/dev/directive.mjs +1 -1
- package/dist/dev/history.mjs +2 -2
- package/dist/dev/index.mjs +5 -5
- package/dist/dev/runtime/plugins/attaform.mjs +1 -1
- package/dist/dev/shared/{attaform-dev.DUZckyV8.mjs → attaform-dev.B1q-x9R9.mjs} +4 -4
- package/dist/dev/shared/{attaform-dev.BcYT6tFh.mjs → attaform-dev.CZz4GYZ6.mjs} +21 -9
- package/dist/dev/shared/{attaform-dev.BisFstxh.mjs → attaform-dev.Caibt7sb.mjs} +16 -15
- package/dist/dev/shared/{attaform-dev.DTrHonpc.mjs → attaform-dev.CtyqGia7.mjs} +176 -260
- package/dist/dev/shared/{attaform-dev.BK6Ge2qR.mjs → attaform-dev.DJ3nsWw6.mjs} +86 -122
- package/dist/dev/shared/{attaform-dev.BcNtyOmf.mjs → attaform-dev.DlaT4xGd.mjs} +4 -4
- package/dist/dev/shared/{attaform-dev.D6CLvaQT.mjs → attaform-dev.k5X47GMD.mjs} +520 -395
- package/dist/dev/shared/{attaform-dev.CQ2rJiAX.mjs → attaform-dev.y9x9Vp9F.mjs} +324 -234
- package/dist/dev/shared/{attaform-dev.BQc5QV3Y.mjs → attaform-dev.zlvDr0WB.mjs} +2 -2
- 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 +4 -4
- package/dist/directive.mjs +1 -1
- package/dist/esbuild.d.mts +11 -0
- package/dist/esbuild.mjs +1 -1
- package/dist/history.d.mts +3 -32
- package/dist/history.mjs +2 -2
- package/dist/index.d.mts +67 -70
- package/dist/index.mjs +4 -4
- package/dist/nuxt.d.mts +4 -3
- package/dist/nuxt.mjs +3 -6
- package/dist/rollup.d.mts +11 -0
- package/dist/rollup.mjs +1 -1
- package/dist/rspack.d.mts +19 -11
- package/dist/rspack.mjs +1 -1
- package/dist/runtime/components/AttaformDevtoolsPanel.vue +15 -15
- package/dist/runtime/components/DevtoolsValueTree.vue +2 -2
- package/dist/runtime/plugins/attaform.mjs +1 -1
- package/dist/shared/{attaform.BRDDQeHV.mjs → attaform.8mfKZCwH.mjs} +2 -2
- package/dist/shared/{attaform.DRUT703x.d.mts → attaform.B-Tb62qV.d.mts} +12 -12
- package/dist/shared/{attaform.v0fQtWyA.mjs → attaform.B1rH9ht6.mjs} +1 -1
- package/dist/shared/{attaform.DhnPb6nK.mjs → attaform.BAf3UNn4.mjs} +1 -1
- package/dist/shared/{attaform.BXneBxEj.mjs → attaform.BWUn8Kjy.mjs} +85 -121
- package/dist/shared/{attaform.WiGdIqgx.mjs → attaform.C4shmwyJ.mjs} +2 -2
- package/dist/shared/{attaform.Rc9u4Vfw.d.mts → attaform.CRVe8s82.d.mts} +83 -95
- package/dist/shared/attaform.D9RqPgGu.d.mts +42 -0
- package/dist/shared/attaform.DAo0QBmS.d.mts +2173 -0
- package/dist/shared/{attaform.BK0cgu2K.mjs → attaform.DBCbxlyk.mjs} +62 -4
- package/dist/shared/{attaform.CUfrMK7t.mjs → attaform.DL2nl_QR.mjs} +15 -14
- package/dist/shared/{attaform.DNJOWjQw.mjs → attaform.DNPJPOO7.mjs} +299 -218
- package/dist/shared/attaform.DZnrDrNb.d.mts +4657 -0
- package/dist/shared/{attaform.B3resMQ1.mjs → attaform.DxKQsqFZ.mjs} +496 -371
- package/dist/shared/{attaform.ByWP6kSx.mjs → attaform.L011tHgJ.mjs} +3 -3
- package/dist/shared/{attaform.CJ8DpRGj.mjs → attaform.LUPC-2Qg.mjs} +175 -257
- package/dist/transforms.d.mts +153 -26
- package/dist/transforms.mjs +1 -1
- package/dist/vite.d.mts +29 -52
- package/dist/vite.mjs +3 -3
- package/dist/webpack.d.mts +20 -12
- package/dist/webpack.mjs +1 -1
- package/dist/zod-v3.d.mts +90 -96
- package/dist/zod-v3.mjs +5 -5
- package/dist/zod-v4.d.mts +120 -118
- package/dist/zod-v4.mjs +5 -5
- package/dist/zod.d.mts +5 -5
- package/dist/zod.mjs +4 -4
- package/package.json +7 -6
- package/skills/attaform/SKILL.md +1 -1
- package/skills/attaform/references/custom-components.md +4 -0
- package/dist/shared/attaform.Clz0ArIi.d.mts +0 -44
- package/dist/shared/attaform.UGyOK83T.d.mts +0 -2366
- package/dist/shared/attaform.bKLzMU0o.d.mts +0 -4761
package/dist/abstract.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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 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.
|
|
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, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, 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, 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
|
|
5
|
-
export { v as vRegister } from './shared/attaform.
|
|
1
|
+
import { A as AttaformRegistry } from './shared/attaform.DAo0QBmS.mjs';
|
|
2
|
+
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, 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';
|
|
3
|
+
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.DZnrDrNb.mjs';
|
|
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, h as FieldMetaPayload, 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, 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';
|
|
5
|
+
export { v as vRegister } from './shared/attaform.D9RqPgGu.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Schema-agnostic `useForm
|
|
10
|
-
* `AbstractSchema
|
|
11
|
-
*
|
|
9
|
+
* Schema-agnostic `useForm`, accepting anything that implements
|
|
10
|
+
* `AbstractSchema`. Reach for it when integrating a custom adapter or a
|
|
11
|
+
* validation library Attaform ships no adapter for.
|
|
12
12
|
*
|
|
13
13
|
* ```ts
|
|
14
14
|
* import { useForm } from 'attaform'
|
|
@@ -19,22 +19,16 @@ import 'vue';
|
|
|
19
19
|
* })
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* Returns the same form API as the typed entry points; see
|
|
27
|
-
* `UseFormReturnType` for the full surface.
|
|
22
|
+
* The return is the same form the typed entry points hand back; see
|
|
23
|
+
* `UseFormReturnType`. Most consumers want one of those instead, since
|
|
24
|
+
* they attach the matching adapter for you.
|
|
28
25
|
*/
|
|
29
26
|
declare function useAbstractForm<Form extends GenericForm, GetValueFormType extends GenericForm = Form, ReadForm extends GenericForm = Form, K extends FormKey = FormKey>(configuration: UseFormConfiguration<Form, GetValueFormType, AbstractSchema<Form, GetValueFormType>, DefaultValuesInput<Form>, K>,
|
|
30
27
|
/**
|
|
31
|
-
* Internal escape hatch for
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* call; everything else (FormStore allocation, registry presence,
|
|
36
|
-
* consumer ref-counting via `onScopeDispose`) goes through the same
|
|
37
|
-
* path eager calls follow. Not part of the public surface.
|
|
28
|
+
* Internal escape hatch for a caller that already holds a registry and
|
|
29
|
+
* has to build a form outside Vue's setup context, such as the
|
|
30
|
+
* wizard's lazy noop builder running inside a `computed` re-eval. It
|
|
31
|
+
* skips the strict `useRegistry()` call and nothing else. Not public.
|
|
38
32
|
*/
|
|
39
33
|
options?: {
|
|
40
34
|
readonly registry?: AttaformRegistry;
|
package/dist/abstract.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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, c as useAbstractForm, d as useRegister, f as useWizard } from './shared/attaform.
|
|
1
|
+
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, c as useAbstractForm, d as useRegister, f as useWizard } from './shared/attaform.DNPJPOO7.mjs';
|
|
2
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.CdZIEf7_.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.
|
|
4
|
-
export { a as assignKey, v as vRegister } 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.C4shmwyJ.mjs';
|
|
4
|
+
export { a as assignKey, v as vRegister } from './shared/attaform.DxKQsqFZ.mjs';
|
|
5
5
|
export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
|
package/dist/dev/abstract.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, c as useAbstractForm, d as useRegister, f 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, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, c as useAbstractForm, d as useRegister, f as useWizard } from './shared/attaform-dev.y9x9Vp9F.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.zlvDr0WB.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.B1q-x9R9.mjs';
|
|
4
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.k5X47GMD.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as canonicalizePath } from '../shared/attaform-dev.
|
|
1
|
+
import { e as canonicalizePath } from '../shared/attaform-dev.zlvDr0WB.mjs';
|
|
2
2
|
|
|
3
3
|
const INSPECTOR_ID = "attaform";
|
|
4
4
|
const TIMELINE_LAYER_ID = "attaform:events";
|
|
@@ -44,7 +44,7 @@ function wire(api, app, registry) {
|
|
|
44
44
|
time: Date.now(),
|
|
45
45
|
title: "form.change",
|
|
46
46
|
subtitle: state.formKey,
|
|
47
|
-
// Devtools is dev-only
|
|
47
|
+
// Devtools is dev-only, so emit raw values. Consumers worried
|
|
48
48
|
// about screen-share leaks should close the panel before
|
|
49
49
|
// sharing, same as they would for the browser DevTools
|
|
50
50
|
// console.
|
|
@@ -114,13 +114,13 @@ function wire(api, app, registry) {
|
|
|
114
114
|
}
|
|
115
115
|
];
|
|
116
116
|
payload.state["Schema Errors"] = [
|
|
117
|
-
...[...state.errorCells.entries()].filter(([, cell]) => cell.schema.length > 0).map(([k, cell]) => ({
|
|
117
|
+
...[...state.errorCells().entries()].filter(([, cell]) => cell.schema.length > 0).map(([k, cell]) => ({
|
|
118
118
|
key: String(k),
|
|
119
119
|
value: cell.schema
|
|
120
120
|
}))
|
|
121
121
|
];
|
|
122
122
|
payload.state["User Errors"] = [
|
|
123
|
-
...[...state.errorCells.entries()].filter(([, cell]) => cell.user.length > 0).map(([k, cell]) => ({
|
|
123
|
+
...[...state.errorCells().entries()].filter(([, cell]) => cell.user.length > 0).map(([k, cell]) => ({
|
|
124
124
|
key: String(k),
|
|
125
125
|
value: cell.user
|
|
126
126
|
}))
|
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.k5X47GMD.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.CZz4GYZ6.mjs';
|
|
3
3
|
|
|
4
4
|
function captureErrorCells(map) {
|
|
5
5
|
const out = [];
|
|
@@ -14,7 +14,7 @@ function createHistoryRuntime(kernel, max) {
|
|
|
14
14
|
return {
|
|
15
15
|
form: structuralSnapshot(kernel.form.value),
|
|
16
16
|
blankPaths: [...kernel.blankPaths],
|
|
17
|
-
errorCells: captureErrorCells(kernel.errorCells)
|
|
17
|
+
errorCells: captureErrorCells(kernel.errorCells())
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
const positions = shallowRef([captureSnapshot()]);
|
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, 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.
|
|
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.zlvDr0WB.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.y9x9Vp9F.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.B1q-x9R9.mjs';
|
|
4
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.k5X47GMD.mjs';
|
|
5
|
+
export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.DlaT4xGd.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.B1q-x9R9.mjs';
|
|
3
3
|
|
|
4
4
|
var attaform_default = defineNuxtPlugin({
|
|
5
5
|
// `enforce: 'pre'` makes the "we run before any component's setup" claim
|
|
@@ -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.zlvDr0WB.mjs';
|
|
2
2
|
import { shallowReactive, getCurrentInstance, inject } from 'vue';
|
|
3
3
|
|
|
4
4
|
function detectSSR(options = {}) {
|
|
@@ -182,8 +182,8 @@ function renderAttaformState(app) {
|
|
|
182
182
|
// The wire shape stays two per-source arrays; the tagged store
|
|
183
183
|
// splits at the boundary and the client replays each side into
|
|
184
184
|
// its cell half.
|
|
185
|
-
schemaErrors: [...state.errorCells.entries()].filter(([, cell]) => cell.schema.length > 0).map(([key2, cell]) => [key2, cell.schema]),
|
|
186
|
-
userErrors: [...state.errorCells.entries()].filter(([, cell]) => cell.user.length > 0).map(([key2, cell]) => [key2, cell.user]),
|
|
185
|
+
schemaErrors: [...state.errorCells().entries()].filter(([, cell]) => cell.schema.length > 0).map(([key2, cell]) => [key2, cell.schema]),
|
|
186
|
+
userErrors: [...state.errorCells().entries()].filter(([, cell]) => cell.user.length > 0).map(([key2, cell]) => [key2, cell.user]),
|
|
187
187
|
fields: Array.from(state.fields.entries()),
|
|
188
188
|
...transientList.length > 0 ? { blankPaths: transientList } : {}
|
|
189
189
|
}
|
|
@@ -199,7 +199,7 @@ function hydrateAttaformState(app, payload) {
|
|
|
199
199
|
got = "v" in payload ? payload.v : void 0;
|
|
200
200
|
}
|
|
201
201
|
console.warn(
|
|
202
|
-
`[attaform] hydrateAttaformState: payload version mismatch (expected ${ATTAFORM_STATE_VERSION}, got ${String(got)}). Skipping hydration
|
|
202
|
+
`[attaform] hydrateAttaformState: payload version mismatch (expected ${ATTAFORM_STATE_VERSION}, got ${String(got)}). Skipping hydration; forms will construct fresh. This usually means the SSR bundle is on a different attaform version than the client (rolling deploy / stale cache).`
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
205
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as mapSegmentKeys, f as pathsEqual, i as isPathPrefix } from './attaform-dev.
|
|
1
|
+
import { m as mapSegmentKeys, f as pathsEqual, i as isPathPrefix } from './attaform-dev.zlvDr0WB.mjs';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_FIELD_VALIDATION_DEBOUNCE_MS = 0;
|
|
4
4
|
const DEFAULT_HISTORY_MAX_SNAPSHOTS = 128;
|
|
@@ -27,20 +27,32 @@ function pickDefined(bag) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const reported = /* @__PURE__ */ new Set() ;
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
reported.
|
|
33
|
-
|
|
30
|
+
function reportConsumerThrow(site, detail, err) {
|
|
31
|
+
const key = detail === void 0 ? site : `${site}|${detail}`;
|
|
32
|
+
if (reported === null || reported.has(key)) return;
|
|
33
|
+
reported.add(key);
|
|
34
|
+
const at = detail === void 0 ? "" : ` at \`${detail}\``;
|
|
35
|
+
const advice = {
|
|
36
|
+
"default-factory": "a `.default(() => ...)` factory threw. Attaform used `undefined` for that field's initial value.",
|
|
37
|
+
"catch-factory": "a `.catch(() => ...)` fallback threw. Attaform used `undefined` for that value.",
|
|
38
|
+
"lazy-getter": "a `z.lazy(() => ...)` factory threw. Attaform stopped descending at that node, so paths below it will not resolve.",
|
|
39
|
+
"wizard-slot": `a function step slot threw${at}. Attaform dropped that step from the compiled list; the rest of the flow still navigates.`,
|
|
40
|
+
"wizard-lazy-slot": `a \`lazy()\` step resolver threw${at}. Attaform dropped that step from the compiled list until the resolver's own dependencies change.`,
|
|
41
|
+
"wizard-progress": "a `useWizard({ progress })` override threw. Attaform fell back to its own valid-step ratio.",
|
|
42
|
+
"wizard-restore": "a `useWizard({ restore })` callback threw. Attaform read no step from it, so the wizard stays where it is.",
|
|
43
|
+
"wizard-persist": "a `useWizard({ persist })` callback threw. Attaform navigated anyway, so the step is live but unrecorded.",
|
|
44
|
+
"wizard-default-statuses": "a `useWizard({ defaultStatuses })` factory threw or rejected. Attaform seeded no statuses, the same as omitting the option."
|
|
45
|
+
};
|
|
34
46
|
console.error(
|
|
35
|
-
`[attaform] ${advice}
|
|
47
|
+
`[attaform] ${advice[site]} Attaform has nowhere to surface this, so it must not throw; wrap your own try/catch if the failure is recoverable. Original error:`,
|
|
36
48
|
err
|
|
37
49
|
);
|
|
38
50
|
}
|
|
39
|
-
function
|
|
51
|
+
function callConsumerFn(fn, fallback, site, detail) {
|
|
40
52
|
try {
|
|
41
53
|
return fn();
|
|
42
54
|
} catch (err) {
|
|
43
|
-
|
|
55
|
+
reportConsumerThrow(site, detail, err);
|
|
44
56
|
return fallback;
|
|
45
57
|
}
|
|
46
58
|
}
|
|
@@ -371,4 +383,4 @@ function structuralSnapshot(value) {
|
|
|
371
383
|
return out;
|
|
372
384
|
}
|
|
373
385
|
|
|
374
|
-
export { ANONYMOUS_FORM_KEY_PREFIX as A, DEFAULT_HISTORY_MAX_SNAPSHOTS as D, RESERVED_KEY_PREFIX as R, safeOwnRead as a, safeAssign as b,
|
|
386
|
+
export { ANONYMOUS_FORM_KEY_PREFIX as A, DEFAULT_HISTORY_MAX_SNAPSHOTS as D, RESERVED_KEY_PREFIX as R, safeOwnRead as a, safeAssign as b, callConsumerFn as c, safeOwnHas as d, consumerHas as e, spreadConsumerRecord as f, copyConsumerArray as g, consumerKeys as h, isShadowedKey as i, readConsumerProp as j, diffAndApply as k, DEFAULT_FIELD_VALIDATION_DEBOUNCE_MS as l, consumerSymbolKeys as m, normalizeNumericOption as n, applyChangedKeys as o, pickDefined as p, DEFAULT_MAX_RECURSION_DEPTH as q, readConsumerIndex as r, structuralSnapshot as s, reportConsumerThrow as t, ANONYMOUS_WIZARD_KEY_PREFIX as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AttaformErrorCode, k as isPlainRecord, s as slimKindOf } from './attaform-dev.
|
|
2
|
-
import { e as canonicalizePath, h as SET_MEMBER_SEGMENT } from './attaform-dev.
|
|
3
|
-
import { a as safeOwnRead, b as safeAssign } from './attaform-dev.
|
|
1
|
+
import { A as AttaformErrorCode, k as isPlainRecord, s as slimKindOf } from './attaform-dev.y9x9Vp9F.mjs';
|
|
2
|
+
import { e as canonicalizePath, h as SET_MEMBER_SEGMENT } from './attaform-dev.zlvDr0WB.mjs';
|
|
3
|
+
import { a as safeOwnRead, b as safeAssign } from './attaform-dev.CZz4GYZ6.mjs';
|
|
4
4
|
|
|
5
5
|
const PATH_SEPARATOR = ".";
|
|
6
6
|
function isOpaqueKind(kind) {
|
|
@@ -37,9 +37,6 @@ function createAbstractSchema(rootSchema, intro, services, options) {
|
|
|
37
37
|
const discriminatorCache = /* @__PURE__ */ new Map();
|
|
38
38
|
const entryKeyKindCache = /* @__PURE__ */ new Map();
|
|
39
39
|
const slimKindsCache = /* @__PURE__ */ new Map();
|
|
40
|
-
let asyncValidationFlag = null;
|
|
41
|
-
let containerRefineFlag = null;
|
|
42
|
-
let discriminatedUnionFlag = null;
|
|
43
40
|
function mapKeySegmentKind(schema) {
|
|
44
41
|
const keyType = intro.getMapKeyType(schema);
|
|
45
42
|
if (keyType === void 0) return void 0;
|
|
@@ -92,20 +89,24 @@ function createAbstractSchema(rootSchema, intro, services, options) {
|
|
|
92
89
|
}
|
|
93
90
|
const abstractSchema = {
|
|
94
91
|
needsAsyncValidation() {
|
|
95
|
-
|
|
96
|
-
return
|
|
92
|
+
const { asyncRefine, asyncTransform } = intro.capabilitiesOf(rootSchema);
|
|
93
|
+
return asyncRefine || asyncTransform;
|
|
97
94
|
},
|
|
98
95
|
hasContainerOrRootRefine() {
|
|
99
|
-
|
|
100
|
-
return containerRefineFlag;
|
|
96
|
+
return intro.capabilitiesOf(rootSchema).containerOrRootRefine;
|
|
101
97
|
},
|
|
102
98
|
hasDiscriminatedUnions() {
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
return intro.capabilitiesOf(rootSchema).discriminatedUnion;
|
|
100
|
+
},
|
|
101
|
+
hasPreprocessOrCoerce() {
|
|
102
|
+
return intro.capabilitiesOf(rootSchema).preprocessOrCoerce;
|
|
105
103
|
},
|
|
106
104
|
getDefaultValues(config) {
|
|
107
105
|
return services.runGetDefaults(rootSchema, config, maxRecursionDepth);
|
|
108
106
|
},
|
|
107
|
+
validateSync(data) {
|
|
108
|
+
return services.validateSync(rootSchema, data);
|
|
109
|
+
},
|
|
109
110
|
getDefaultAtPath(path) {
|
|
110
111
|
if (path.length === 0) {
|
|
111
112
|
return services.deriveDefault(rootSchema, true, maxRecursionDepth);
|
|
@@ -425,8 +426,8 @@ function walkPathSegments(schema, segments, intro, maxDepth, lazyDepth) {
|
|
|
425
426
|
const rightResults = right === void 0 ? [] : walkPathSegments(right, segments, intro, maxDepth, lazyDepth);
|
|
426
427
|
return [...leftResults, ...rightResults];
|
|
427
428
|
}
|
|
428
|
-
// Leaves
|
|
429
|
-
// `unknown` / `custom`)
|
|
429
|
+
// Leaves, with nothing further to descend. An opaque leaf (`any` /
|
|
430
|
+
// `unknown` / `custom`) lands here too and `[]` is the truthful
|
|
430
431
|
// answer: the schema declares no sub-paths under them, so none are
|
|
431
432
|
// fabricated. `symbol` / `function` / `promise` hold a value
|
|
432
433
|
// without declaring anything inside it and land here for the same
|
|
@@ -1017,7 +1018,7 @@ function slimPrimitivesWalk(schema, intro, maxDepth, lazyDepth = 0) {
|
|
|
1017
1018
|
case "unknown":
|
|
1018
1019
|
case "custom":
|
|
1019
1020
|
return PERMISSIVE_SLIM_KINDS;
|
|
1020
|
-
// A kind this walker has no case for
|
|
1021
|
+
// A kind this walker has no case for, in practice one a newer
|
|
1021
1022
|
// Zod introduced. Be permissive rather than reject: the adapter
|
|
1022
1023
|
// carries the value opaquely and the schema's own parse is what
|
|
1023
1024
|
// decides whether it was legal.
|