attaform 0.29.0 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/abstract.d.mts +15 -21
  2. package/dist/abstract.mjs +4 -4
  3. package/dist/dev/abstract.mjs +4 -4
  4. package/dist/dev/chunks/dev-key-collision-warnings.mjs +47 -8
  5. package/dist/dev/chunks/devtools.mjs +2 -2
  6. package/dist/dev/directive.mjs +1 -1
  7. package/dist/dev/history.mjs +1 -2
  8. package/dist/dev/index.mjs +5 -5
  9. package/dist/dev/runtime/plugins/attaform.mjs +3 -3
  10. package/dist/dev/shared/{attaform-dev.BO-71R54.mjs → attaform-dev.BJK1kqHY.mjs} +44 -198
  11. package/dist/dev/shared/{attaform-dev.D8aoKb89.mjs → attaform-dev.BMQ3GcgD.mjs} +51 -64
  12. package/dist/dev/shared/{attaform-dev.BgM6FdtA.mjs → attaform-dev.BUIFcTYf.mjs} +94 -62
  13. package/dist/dev/shared/{attaform-dev.q6UutkCx.mjs → attaform-dev.CT7MDjPy.mjs} +92 -152
  14. package/dist/dev/shared/{attaform-dev.ButTkwHd.mjs → attaform-dev.CZz4GYZ6.mjs} +26 -15
  15. package/dist/dev/shared/{attaform-dev.DD5m2W51.mjs → attaform-dev.Chm4D6SJ.mjs} +2 -4
  16. package/dist/dev/shared/{attaform-dev.DrzObAZo.mjs → attaform-dev.DuEE4GU1.mjs} +4 -4
  17. package/dist/dev/shared/{attaform-dev.DHuydLAC.mjs → attaform-dev.DxHdkkPG.mjs} +674 -734
  18. package/dist/dev/shared/{attaform-dev.A-TpJW0B.mjs → attaform-dev.zlvDr0WB.mjs} +3 -21
  19. package/dist/dev/zod-v3.mjs +6 -6
  20. package/dist/dev/zod-v4.mjs +6 -6
  21. package/dist/dev/zod.mjs +5 -5
  22. package/dist/directive.d.mts +4 -4
  23. package/dist/directive.mjs +1 -1
  24. package/dist/esbuild.d.mts +11 -0
  25. package/dist/esbuild.mjs +1 -1
  26. package/dist/history.d.mts +3 -32
  27. package/dist/history.mjs +1 -2
  28. package/dist/index.d.mts +67 -70
  29. package/dist/index.mjs +5 -5
  30. package/dist/nuxt.d.mts +6 -14
  31. package/dist/nuxt.mjs +3 -7
  32. package/dist/rollup.d.mts +11 -0
  33. package/dist/rollup.mjs +1 -1
  34. package/dist/rspack.d.mts +19 -11
  35. package/dist/rspack.mjs +1 -1
  36. package/dist/runtime/components/AttaformDevtoolsPanel.vue +12 -12
  37. package/dist/runtime/components/DevtoolsValueTree.vue +2 -2
  38. package/dist/runtime/plugins/attaform.mjs +3 -3
  39. package/dist/shared/{attaform.CIWLMY-R.d.mts → attaform.2FslhB9R.d.mts} +83 -95
  40. package/dist/shared/{attaform.Cvao8bW5.mjs → attaform.8mfKZCwH.mjs} +7 -7
  41. package/dist/shared/{attaform.DRUT703x.d.mts → attaform.B-Tb62qV.d.mts} +12 -12
  42. package/dist/shared/{attaform.v0fQtWyA.mjs → attaform.B1rH9ht6.mjs} +1 -1
  43. package/dist/shared/{attaform.BndjUUYX.mjs → attaform.B2iebkPA.mjs} +4 -4
  44. package/dist/shared/{attaform.DhnPb6nK.mjs → attaform.BAf3UNn4.mjs} +1 -1
  45. package/dist/shared/{attaform.CZMAYwSK.mjs → attaform.BIWicztt.mjs} +651 -678
  46. package/dist/shared/attaform.BcQwgWaq.d.mts +2153 -0
  47. package/dist/shared/attaform.Br8EBn5B.d.mts +4553 -0
  48. package/dist/shared/{attaform.C2MVyuxC.mjs → attaform.CO918TdU.mjs} +44 -198
  49. package/dist/shared/{attaform.CZYt_5N_.mjs → attaform.CdZIEf7_.mjs} +1 -19
  50. package/dist/shared/{attaform.B0dKL8ST.mjs → attaform.DRsANMok.mjs} +94 -62
  51. package/dist/shared/{attaform.DffRL5pP.mjs → attaform.D_f1WgYf.mjs} +46 -59
  52. package/dist/shared/{attaform.D1fnTifF.mjs → attaform.D_pt1gOj.mjs} +92 -150
  53. package/dist/shared/attaform.L0kUn3vL.d.mts +42 -0
  54. package/dist/shared/{attaform.D0x-qSXm.mjs → attaform.WiGdIqgx.mjs} +1 -3
  55. package/dist/shared/{attaform.BK0cgu2K.mjs → attaform.ZYn2ahzJ.mjs} +3 -3
  56. package/dist/transforms.d.mts +153 -26
  57. package/dist/transforms.mjs +1 -1
  58. package/dist/vite.d.mts +29 -52
  59. package/dist/vite.mjs +8 -3
  60. package/dist/webpack.d.mts +20 -12
  61. package/dist/webpack.mjs +1 -1
  62. package/dist/zod-v3.d.mts +90 -96
  63. package/dist/zod-v3.mjs +6 -6
  64. package/dist/zod-v4.d.mts +119 -119
  65. package/dist/zod-v4.mjs +6 -6
  66. package/dist/zod.d.mts +5 -5
  67. package/dist/zod.mjs +5 -5
  68. package/package.json +9 -7
  69. package/skills/attaform/SKILL.md +1 -1
  70. package/skills/attaform/references/custom-components.md +1 -1
  71. package/dist/chunks/fingerprint.mjs +0 -183
  72. package/dist/chunks/fingerprint2.mjs +0 -159
  73. package/dist/dev/chunks/fingerprint.mjs +0 -183
  74. package/dist/dev/chunks/fingerprint2.mjs +0 -159
  75. package/dist/dev/shared/attaform-dev.BxfsuwBR.mjs +0 -44
  76. package/dist/shared/attaform.BxfsuwBR.mjs +0 -44
  77. package/dist/shared/attaform.CsoeRi3P.d.mts +0 -5155
  78. package/dist/shared/attaform.DDtqHYv1.d.mts +0 -2465
  79. package/dist/shared/attaform.axHXVQO7.d.mts +0 -44
@@ -1,14 +1,14 @@
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';
1
+ import { A as AttaformRegistry } from './shared/attaform.BcQwgWaq.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.BcQwgWaq.mjs';
3
+ import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.Br8EBn5B.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 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, ac as ValidateOnConfig, 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.Br8EBn5B.mjs';
5
+ export { v as vRegister } from './shared/attaform.L0kUn3vL.mjs';
6
6
  import 'vue';
7
7
 
8
8
  /**
9
- * Schema-agnostic `useForm`. Accepts any object that implements
10
- * `AbstractSchema` — useful when integrating a custom schema
11
- * adapter or a third-party validation library.
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
- * Most consumers prefer a typed entry point that wraps the underlying
23
- * library's schema with the matching adapter automatically; see the
24
- * subpath documentation for the available adapters.
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 callers that already hold a registry
32
- * reference and need to construct a form outside Vue's setup context
33
- * (e.g. the wizard's lazy noop builder, which runs inside a
34
- * `computed` re-eval). Passing this skips the strict `useRegistry()`
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, 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';
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.BIWicztt.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.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.WiGdIqgx.mjs';
4
+ export { a as assignKey, v as vRegister } from './shared/attaform.D_f1WgYf.mjs';
5
5
  export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
@@ -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.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
+ 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.DxHdkkPG.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.Chm4D6SJ.mjs';
4
+ export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.BMQ3GcgD.mjs';
@@ -1,22 +1,61 @@
1
+ const MAX_SKETCH_DEPTH = 6;
2
+ const MAX_SKETCH_NODES = 400;
3
+ function describePath(schema, path) {
4
+ const kinds = [...schema.getSlimPrimitiveTypesAtPath(path)].sort().join("|");
5
+ const arity = schema.arrayShapeAtPath(path);
6
+ return [
7
+ kinds,
8
+ schema.isRequiredAtPath(path) ? "req" : "opt",
9
+ schema.isLeafAtPath(path) ? "leaf" : "node",
10
+ arity === null ? "" : `[${arity}]`
11
+ ].join(",");
12
+ }
13
+ function sketchSchema(schema) {
14
+ const lines = [];
15
+ let budget = MAX_SKETCH_NODES;
16
+ const visit = (value, path) => {
17
+ if (budget <= 0) return;
18
+ budget -= 1;
19
+ lines.push(`${path.join(".")}=${describePath(schema, path)}`);
20
+ if (path.length >= MAX_SKETCH_DEPTH) return;
21
+ if (Array.isArray(value)) {
22
+ if (value.length > 0) visit(value[0], [...path, 0]);
23
+ return;
24
+ }
25
+ if (value === null || typeof value !== "object") return;
26
+ for (const childKey of Object.keys(value).sort()) {
27
+ visit(value[childKey], [...path, childKey]);
28
+ }
29
+ };
30
+ visit(schema.getDefaultAtPath([]), []);
31
+ return lines.join("\n");
32
+ }
1
33
  async function warnOnSchemaFingerprintMismatch(key, existing, incoming) {
2
- let existingFp;
3
- let incomingFp;
34
+ await Promise.resolve();
35
+ if (existing === incoming) return;
36
+ let existingSketch;
37
+ let incomingSketch;
4
38
  try {
5
- existingFp = await existing.fingerprint();
6
- incomingFp = await incoming.fingerprint();
39
+ existingSketch = sketchSchema(existing);
40
+ incomingSketch = sketchSchema(incoming);
7
41
  } catch (error) {
8
42
  console.error(
9
- `[attaform] fingerprint() rejected for key "${key}"; skipping mismatch check.`,
43
+ `[attaform] could not compare schemas for key "${key}"; skipping mismatch check.`,
10
44
  error
11
45
  );
12
46
  return;
13
47
  }
14
- if (existingFp === incomingFp) return;
48
+ if (existingSketch === incomingSketch) return;
15
49
  console.warn(
16
50
  `[attaform] useForm() calls with key "${key}" use different schemas; first wins, second is ignored. Use identical schemas or unique keys.
17
- existing: ${existingFp}
18
- incoming: ${incomingFp}`
51
+ existing:
52
+ ${indent(existingSketch)}
53
+ incoming:
54
+ ${indent(incomingSketch)}`
19
55
  );
20
56
  }
57
+ function indent(sketch) {
58
+ return sketch.split("\n").map((line) => ` ${line}`).join("\n");
59
+ }
21
60
 
22
61
  export { warnOnSchemaFingerprintMismatch };
@@ -1,4 +1,4 @@
1
- import { e as canonicalizePath } from '../shared/attaform-dev.A-TpJW0B.mjs';
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 — emit raw values. Consumers worried
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.
@@ -1 +1 @@
1
- export { b as installVRegister, v as vRegister, c as vRegisterFile } from './shared/attaform-dev.D8aoKb89.mjs';
1
+ export { b as installVRegister, v as vRegister, c as vRegisterFile } from './shared/attaform-dev.BMQ3GcgD.mjs';
@@ -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.ButTkwHd.mjs';
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 = [];
@@ -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
  });
@@ -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.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
+ 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.DxHdkkPG.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.Chm4D6SJ.mjs';
4
+ export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.BMQ3GcgD.mjs';
5
+ export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.DuEE4GU1.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.DD5m2W51.mjs';
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.Chm4D6SJ.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 { defaults, version } = config.attaform;
15
- nuxtApp.vueApp.use(createAttaform({ ssr: isServer, defaults }));
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;
@@ -1,8 +1,7 @@
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';
5
- import { z } from 'zod';
1
+ import { j as humanize, c as useAbstractForm } from './attaform-dev.DxHdkkPG.mjs';
2
+ import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.zlvDr0WB.mjs';
3
+ import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, e as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform-dev.BUIFcTYf.mjs';
4
+ import { c as callConsumerFn } from './attaform-dev.CZz4GYZ6.mjs';
6
5
 
7
6
  function readDef(schema) {
8
7
  if (schema === null || typeof schema !== "object") return void 0;
@@ -49,7 +48,9 @@ const IDENTITY_KINDS = /* @__PURE__ */ new Set([
49
48
  "file",
50
49
  "map",
51
50
  "symbol",
52
- "function"
51
+ "function",
52
+ "nonoptional",
53
+ "success"
53
54
  ]);
54
55
  function kindOf(schema) {
55
56
  const def = readDef(schema);
@@ -130,11 +131,7 @@ function unwrapLazy(schema) {
130
131
  const def = readDef(schema);
131
132
  const getter = def?.getter;
132
133
  if (typeof getter !== "function") return void 0;
133
- return callConsumerSchemaFn(() => getter(), void 0, "lazy-getter");
134
- }
135
- function getLazyGetter(schema) {
136
- const def = readDef(schema);
137
- return typeof def?.getter === "function" ? def.getter : void 0;
134
+ return callConsumerFn(() => getter(), void 0, "lazy-getter");
138
135
  }
139
136
  function getIntersectionLeft(schema) {
140
137
  const def = readDef(schema);
@@ -148,7 +145,7 @@ function getCatchDefault(schema) {
148
145
  const def = readDef(schema);
149
146
  const cv = def?.catchValue;
150
147
  if (typeof cv !== "function") return void 0;
151
- return callConsumerSchemaFn(
148
+ return callConsumerFn(
152
149
  () => cv({ error: new Error("atta:default-values"), input: void 0 }),
153
150
  void 0,
154
151
  "catch-factory"
@@ -160,7 +157,7 @@ function hasCatchValue(schema) {
160
157
  }
161
158
  function getDefaultValue(schema) {
162
159
  const def = readDef(schema);
163
- return callConsumerSchemaFn(() => def?.defaultValue, void 0, "default-factory");
160
+ return callConsumerFn(() => def?.defaultValue, void 0, "default-factory");
164
161
  }
165
162
  function getNativeEnumValues(_schema) {
166
163
  return void 0;
@@ -171,11 +168,6 @@ function unwrapEffectsSource(_schema) {
171
168
  function unwrapBranded(_schema) {
172
169
  return void 0;
173
170
  }
174
- function hasChecks(schema) {
175
- const def = readDef(schema);
176
- const checks = def?.checks;
177
- return Array.isArray(checks) && checks.length > 0;
178
- }
179
171
  function getChecks(schema) {
180
172
  const def = readDef(schema);
181
173
  const checks = def?.checks;
@@ -352,10 +344,10 @@ function zodIssuesToValidationErrors(issues) {
352
344
  }
353
345
  return {
354
346
  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.
347
+ // Adapter-side paths stay schema-RELATIVE: the validation pipeline
348
+ // in `core/create-form-store.ts` prepends the parent path to
349
+ // absolutise, then routes form-level entries, those whose absolute
350
+ // path is empty, to the empty-string bucket at storage time.
359
351
  path: issue.path.map((seg) => typeof seg === "number" ? seg : String(seg)),
360
352
  code
361
353
  };
@@ -381,7 +373,6 @@ const V4_INTROSPECTOR = {
381
373
  return getArrayElement(schema);
382
374
  },
383
375
  getSetValueType: (schema) => kindOf(schema) === "set" ? getSetValueType(schema) : void 0,
384
- getRecordKeyType: (schema) => kindOf(schema) === "record" ? getRecordKeyType(schema) : void 0,
385
376
  getRecordValueType: (schema) => kindOf(schema) === "record" ? getRecordValueType(schema) : void 0,
386
377
  getMapKeyType: (schema) => kindOf(schema) === "map" ? getMapKeyType(schema) : void 0,
387
378
  getMapValueType: (schema) => kindOf(schema) === "map" ? getMapValueType(schema) : void 0,
@@ -396,7 +387,6 @@ const V4_INTROSPECTOR = {
396
387
  unwrapPipeIn,
397
388
  unwrapPipeOut,
398
389
  unwrapLazy,
399
- getLazyGetter,
400
390
  getDefaultValue,
401
391
  getCatchDefault,
402
392
  hasCatchValue
@@ -407,15 +397,12 @@ function slimPrimitivesOf(schema, maxRecursionDepth) {
407
397
  }
408
398
 
409
399
  function deriveDefault(schema, useDefault, maxRecursionDepth) {
410
- return deriveDefaultWalk(schema, useDefault, V4_INTROSPECTOR, maxRecursionDepth, {
411
- // v4 has an exhaustive switch against `SchemaIntrospector.kindOf`;
412
- // unknown kinds genuinely shouldn't appear, so return undefined.
413
- unsupportedKindFallback: () => void 0
414
- });
400
+ return deriveDefaultWalk(schema, useDefault, V4_INTROSPECTOR, maxRecursionDepth);
415
401
  }
416
402
  function getDefaultValuesFromZodSchema(opts) {
417
403
  const { schema, useDefaultSchemaValues, constraints, maxRecursionDepth } = opts;
418
404
  const initial = deriveDefault(schema, useDefaultSchemaValues, maxRecursionDepth);
405
+ if (constraints === void 0) return { data: initial, success: true };
419
406
  const merged = mergeDeep(initial, constraints);
420
407
  return fixStructuralDefaults(
421
408
  schema,
@@ -447,137 +434,6 @@ function getNestedZodSchemasAtPath(schema, path, maxRecursionDepth) {
447
434
  );
448
435
  }
449
436
 
450
- function carrySyncChecks(rebuilt, original) {
451
- if (!hasChecks(original)) return rebuilt;
452
- const checks = getChecks(original).filter((c) => !isAsyncCheck(c));
453
- if (checks.length === 0) return rebuilt;
454
- return rebuilt.check(
455
- ...checks
456
- );
457
- }
458
- function stripAsyncChecks(schema) {
459
- const seen = /* @__PURE__ */ new WeakSet();
460
- function recurse(s) {
461
- if (seen.has(s)) return s;
462
- seen.add(s);
463
- const kind = kindOf(s);
464
- switch (kind) {
465
- case "string":
466
- return hasChecks(s) ? carrySyncChecks(z.string(), s) : s;
467
- case "number":
468
- return hasChecks(s) ? carrySyncChecks(z.number(), s) : s;
469
- case "bigint":
470
- return hasChecks(s) ? carrySyncChecks(z.bigint(), s) : s;
471
- case "array": {
472
- const element = getArrayElement(s);
473
- return carrySyncChecks(z.array(recurse(element)), s);
474
- }
475
- case "set": {
476
- return carrySyncChecks(z.set(recurse(getSetValueType(s))), s);
477
- }
478
- case "tuple": {
479
- const items = getTupleItems(s).map(recurse);
480
- const rebuilt = z.tuple(
481
- items
482
- );
483
- return carrySyncChecks(rebuilt, s);
484
- }
485
- case "object": {
486
- const shape = getObjectShape(s);
487
- const next = {};
488
- for (const [k, v] of Object.entries(shape)) {
489
- next[k] = recurse(v);
490
- }
491
- return carrySyncChecks(z.object(next), s);
492
- }
493
- case "record": {
494
- const keyType = getRecordKeyType(s);
495
- const valueType = recurse(getRecordValueType(s));
496
- return carrySyncChecks(
497
- z.record(keyType, valueType),
498
- s
499
- );
500
- }
501
- case "union": {
502
- const options = getUnionOptions(s).map(recurse);
503
- return carrySyncChecks(
504
- z.union(options),
505
- s
506
- );
507
- }
508
- case "discriminated-union": {
509
- const options = getDiscriminatedOptions(s).map((opt) => recurse(opt));
510
- const discriminator = getDiscriminator(s);
511
- if (discriminator === void 0) return s;
512
- return z.discriminatedUnion(
513
- discriminator,
514
- options
515
- );
516
- }
517
- case "optional": {
518
- const inner = unwrapInner(s);
519
- return inner === void 0 ? s : recurse(inner).optional();
520
- }
521
- case "nullable": {
522
- const inner = unwrapInner(s);
523
- return inner === void 0 ? s : recurse(inner).nullable();
524
- }
525
- case "default": {
526
- const inner = unwrapInner(s);
527
- if (inner === void 0) return s;
528
- return recurse(inner).default(getDefaultValue(s));
529
- }
530
- case "readonly": {
531
- const inner = unwrapInner(s);
532
- return inner === void 0 ? s : recurse(inner).readonly();
533
- }
534
- case "lazy": {
535
- const inner = unwrapLazy(s);
536
- if (inner === void 0) return s;
537
- const stripped = recurse(inner);
538
- return z.lazy(() => stripped);
539
- }
540
- case "intersection": {
541
- const left = getIntersectionLeft(s);
542
- const right = getIntersectionRight(s);
543
- if (left === void 0 || right === void 0) return s;
544
- return z.intersection(recurse(left), recurse(right));
545
- }
546
- case "catch": {
547
- const inner = unwrapInner(s);
548
- if (inner === void 0) return s;
549
- return recurse(inner).catch(getCatchDefault(s));
550
- }
551
- // Pipes pass through (see the docblock); the rest are leaves
552
- // whose checks the strip walker deliberately leaves in place —
553
- // an async check on one of these still poisons the sync parse
554
- // and the callers' defensive catch owns that case.
555
- case "pipe":
556
- case "boolean":
557
- case "date":
558
- case "enum":
559
- case "literal":
560
- case "null":
561
- case "undefined":
562
- case "any":
563
- case "unknown":
564
- case "nan":
565
- case "void":
566
- case "never":
567
- case "promise":
568
- case "custom":
569
- case "template-literal":
570
- case "transform":
571
- case "file":
572
- case "map":
573
- case "symbol":
574
- case "function":
575
- return s;
576
- }
577
- }
578
- return recurse(schema);
579
- }
580
-
581
437
  function unwrapStructuralWrappers(schema) {
582
438
  let current = schema;
583
439
  for (let i = 0; i < 64; i++) {
@@ -671,29 +527,28 @@ function isLeafRequired(schema, depth = 0) {
671
527
  function zodV4Adapter(rootSchema) {
672
528
  assertZodVersion(rootSchema);
673
529
  assertKeyedRoot(rootSchema);
674
- return (formKey, options) => createAbstractSchema(
530
+ return (_formKey, options) => sharedV4Schemas(
675
531
  rootSchema,
676
- V4_INTROSPECTOR,
677
- buildV4Services(),
678
- formKey,
679
- options
532
+ options.maxRecursionDepth,
533
+ () => createAbstractSchema(
534
+ rootSchema,
535
+ V4_INTROSPECTOR,
536
+ buildV4Services(),
537
+ options
538
+ )
680
539
  );
681
540
  }
682
- async function lazyFingerprint(schema) {
683
- const { fingerprintZodSchema } = await import('../chunks/fingerprint2.mjs');
684
- return fingerprintZodSchema(schema);
685
- }
541
+ const sharedV4Schemas = createSharedSchemaStore();
686
542
  function buildV4Services() {
687
543
  return {
688
- fingerprint: (schema) => lazyFingerprint(schema),
689
544
  getNestedSchemasAtPath: (schema, path, maxRecursionDepth) => getNestedZodSchemasAtPath(schema, path, maxRecursionDepth),
690
- // v4 doesn't pre-strip for the slim-mode walk — its path walker
691
- // already peels every transparent wrapper inline, so the slim and
692
- // unstripped walks coincide.
545
+ // No pre-strip for the slim-mode walk: the path walker peels every
546
+ // transparent wrapper inline, so the slim and unstripped walks
547
+ // coincide.
693
548
  getNestedSchemasInSlimMode: (schema, path, maxRecursionDepth) => getNestedZodSchemasAtPath(schema, path, maxRecursionDepth),
694
549
  slimPrimitivesOf: (schema, maxRecursionDepth) => slimPrimitivesOf(schema, maxRecursionDepth),
695
550
  deriveDefault: (schema, useDefault, maxRecursionDepth) => deriveDefault(schema, useDefault, maxRecursionDepth),
696
- runStrictGetDefaults: (schema, config, fk, maxRecursionDepth) => runStrictGetDefaultsV4(schema, config, fk, maxRecursionDepth),
551
+ runGetDefaults: (schema, config, maxRecursionDepth) => runGetDefaultsV4(schema, config, maxRecursionDepth),
697
552
  unwrapStructuralWrappers: (schema) => unwrapStructuralWrappers(schema),
698
553
  unwrapToDiscriminatedUnion: (schema) => unwrapToDiscriminatedUnion(schema),
699
554
  peelAllWrappers: (schema) => peelAllWrappers(schema),
@@ -708,47 +563,40 @@ function buildV4Services() {
708
563
  const result = await schema.safeParseAsync(data);
709
564
  return result.success ? { success: true, data: result.data } : { success: false, issues: result.error.issues };
710
565
  },
711
- makeSubSchema: (schema, fk, maxRecursionDepth) => buildSubSchemaStubV4(schema, fk, maxRecursionDepth)
566
+ makeSubSchema: (schema, maxRecursionDepth) => buildSubSchemaStubV4(schema, maxRecursionDepth)
712
567
  };
713
568
  }
714
- function runStrictGetDefaultsV4(rootSchema, config, formKey, maxRecursionDepth) {
569
+ function runGetDefaultsV4(rootSchema, config, maxRecursionDepth) {
715
570
  const { data } = getDefaultValuesFromZodSchema({
716
571
  schema: rootSchema,
717
572
  useDefaultSchemaValues: config.useDefaultSchemaValues,
718
573
  constraints: config.constraints,
719
574
  maxRecursionDepth
720
575
  });
721
- if (config.strict === false) {
722
- return { data, errors: void 0, success: true, formKey };
723
- }
724
- if (containsAsyncTransform(rootSchema)) {
725
- return { data, errors: void 0, success: true, formKey };
576
+ if (containsAsyncTransform(rootSchema) || containsAsyncRefine(rootSchema)) {
577
+ return { data, errors: void 0, success: true };
726
578
  }
727
- const parseTarget = containsAsyncRefine(rootSchema) ? stripAsyncChecks(rootSchema) : rootSchema;
728
579
  try {
729
- const strictResult = parseTarget.safeParse(data);
730
- if (strictResult.success) {
731
- return { data, errors: void 0, success: true, formKey };
580
+ const parseResult = rootSchema.safeParse(data);
581
+ if (parseResult.success) {
582
+ return { data, errors: void 0, success: true };
732
583
  }
733
584
  return {
734
585
  data,
735
- errors: zodIssuesToValidationErrors(strictResult.error.issues),
736
- success: false,
737
- formKey
586
+ errors: zodIssuesToValidationErrors(parseResult.error.issues),
587
+ success: false
738
588
  };
739
589
  } catch {
740
- return { data, errors: void 0, success: true, formKey };
590
+ return { data, errors: void 0, success: true };
741
591
  }
742
592
  }
743
- function buildSubSchemaStubV4(schema, formKey, maxRecursionDepth) {
593
+ function buildSubSchemaStubV4(schema, maxRecursionDepth) {
744
594
  return {
745
- fingerprint: () => lazyFingerprint(schema),
746
595
  needsAsyncValidation: () => containsAsyncRefine(schema),
747
596
  getDefaultValues: () => ({
748
597
  data: deriveDefault(schema, true, maxRecursionDepth),
749
598
  errors: void 0,
750
- success: true,
751
- formKey
599
+ success: true
752
600
  }),
753
601
  getSchemasAtPath: () => [],
754
602
  validateAtPath: async (data) => {
@@ -757,15 +605,13 @@ function buildSubSchemaStubV4(schema, formKey, maxRecursionDepth) {
757
605
  return {
758
606
  data: result.data,
759
607
  errors: void 0,
760
- success: true,
761
- formKey
608
+ success: true
762
609
  };
763
610
  }
764
611
  return {
765
612
  data: void 0,
766
613
  errors: zodIssuesToValidationErrors(result.error.issues),
767
- success: false,
768
- formKey
614
+ success: false
769
615
  };
770
616
  }
771
617
  };
@@ -817,4 +663,4 @@ function useForm(configuration) {
817
663
  });
818
664
  }
819
665
 
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 };
666
+ export { assertZodVersion as a, kindOf as k, useForm as u, zodV4Adapter as z };