attaform 0.19.0 → 0.20.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.
Files changed (110) hide show
  1. package/dist/chunks/devtools.cjs +1 -1
  2. package/dist/chunks/devtools.mjs +1 -1
  3. package/dist/chunks/indexeddb.cjs +1 -1
  4. package/dist/chunks/indexeddb.mjs +1 -1
  5. package/dist/chunks/local-storage.cjs +1 -1
  6. package/dist/chunks/local-storage.mjs +1 -1
  7. package/dist/chunks/session-storage.cjs +1 -1
  8. package/dist/chunks/session-storage.mjs +1 -1
  9. package/dist/index.cjs +3 -6
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +14 -40
  12. package/dist/index.d.mts +14 -40
  13. package/dist/index.d.ts +14 -40
  14. package/dist/index.mjs +5 -5
  15. package/dist/nuxt.d.cts +1 -1
  16. package/dist/nuxt.d.mts +1 -1
  17. package/dist/nuxt.d.ts +1 -1
  18. package/dist/runtime/components/AttaformDevtoolsPanel.vue +2 -2
  19. package/dist/runtime/components/DevtoolsValueTree.d.vue.ts +1 -3
  20. package/dist/runtime/components/DevtoolsValueTree.vue.d.ts +1 -3
  21. package/dist/runtime/plugins/attaform.cjs +2 -2
  22. package/dist/runtime/plugins/attaform.mjs +2 -2
  23. package/dist/shared/{attaform.CrpjyXdO.mjs → attaform.BKozEdTr.mjs} +275 -266
  24. package/dist/shared/attaform.BKozEdTr.mjs.map +1 -0
  25. package/dist/shared/{attaform.Bubm_slq.cjs → attaform.BM6YD9kZ.cjs} +212 -269
  26. package/dist/shared/attaform.BM6YD9kZ.cjs.map +1 -0
  27. package/dist/shared/{attaform.CoxJ8Qm8.cjs → attaform.BPxsYtTe.cjs} +2 -26
  28. package/dist/shared/attaform.BPxsYtTe.cjs.map +1 -0
  29. package/dist/shared/{attaform.BqEfHpVB.cjs → attaform.BPy-4qRx.cjs} +275 -268
  30. package/dist/shared/attaform.BPy-4qRx.cjs.map +1 -0
  31. package/dist/shared/attaform.BWgAFnsj.mjs +770 -0
  32. package/dist/shared/attaform.BWgAFnsj.mjs.map +1 -0
  33. package/dist/shared/{attaform.BTpuvGec.d.ts → attaform.Bh3ACtts.d.ts} +109 -101
  34. package/dist/shared/{attaform.CXpzmj38.mjs → attaform.BupwXkj_.mjs} +213 -270
  35. package/dist/shared/attaform.BupwXkj_.mjs.map +1 -0
  36. package/dist/shared/{attaform.JBx8cfMA.cjs → attaform.CIn4bMsD.cjs} +263 -799
  37. package/dist/shared/attaform.CIn4bMsD.cjs.map +1 -0
  38. package/dist/shared/{attaform.BTi-PsHr.mjs → attaform.CKFbKFb6.mjs} +1818 -1472
  39. package/dist/shared/attaform.CKFbKFb6.mjs.map +1 -0
  40. package/dist/shared/{attaform.ePUcKxId.d.cts → attaform.D5-1XGQU.d.cts} +109 -101
  41. package/dist/shared/{attaform.a3uBo-gw.mjs → attaform.DEBvCjeH.mjs} +257 -793
  42. package/dist/shared/attaform.DEBvCjeH.mjs.map +1 -0
  43. package/dist/shared/{attaform.C1msmO2v.cjs → attaform.DL4CQ-oW.cjs} +1823 -1477
  44. package/dist/shared/attaform.DL4CQ-oW.cjs.map +1 -0
  45. package/dist/shared/{attaform.D4I63aBV.d.ts → attaform.DSD85fHb.d.cts} +1 -19
  46. package/dist/shared/{attaform.CBjmobqk.d.cts → attaform.DSD85fHb.d.mts} +1 -19
  47. package/dist/shared/{attaform.DXYHL99q.d.mts → attaform.DSD85fHb.d.ts} +1 -19
  48. package/dist/shared/{attaform.B7rzpK1U.d.cts → attaform.DkA5J8NW.d.cts} +1 -17
  49. package/dist/shared/{attaform.B7rzpK1U.d.mts → attaform.DkA5J8NW.d.mts} +1 -17
  50. package/dist/shared/{attaform.B7rzpK1U.d.ts → attaform.DkA5J8NW.d.ts} +1 -17
  51. package/dist/shared/{attaform.CJ-e9gYI.d.ts → attaform.Dl5kDY-A.d.ts} +1 -1
  52. package/dist/shared/attaform.Dmb6itxC.cjs +781 -0
  53. package/dist/shared/attaform.Dmb6itxC.cjs.map +1 -0
  54. package/dist/shared/{attaform.CRNA0vrd.d.mts → attaform.DoKXru-a.d.mts} +1 -1
  55. package/dist/shared/attaform.DvA-CJJW.mjs +1876 -0
  56. package/dist/shared/attaform.DvA-CJJW.mjs.map +1 -0
  57. package/dist/shared/{attaform.BtBmfLQN.d.mts → attaform.EMzJcQci.d.mts} +109 -101
  58. package/dist/shared/attaform.EZG6fOFb.mjs +35 -0
  59. package/dist/shared/attaform.EZG6fOFb.mjs.map +1 -0
  60. package/dist/shared/{attaform.QvygsFGh.d.cts → attaform.GbDo_lJi.d.cts} +1 -1
  61. package/dist/shared/{attaform.C0uGZQ4M.d.ts → attaform.SfhU0OEY.d.cts} +134 -30
  62. package/dist/shared/{attaform.C0uGZQ4M.d.cts → attaform.SfhU0OEY.d.mts} +134 -30
  63. package/dist/shared/{attaform.C0uGZQ4M.d.mts → attaform.SfhU0OEY.d.ts} +134 -30
  64. package/dist/shared/attaform.jgzuNZVC.cjs +1882 -0
  65. package/dist/shared/attaform.jgzuNZVC.cjs.map +1 -0
  66. package/dist/transforms.cjs +2 -2
  67. package/dist/transforms.d.cts +22 -13
  68. package/dist/transforms.d.mts +22 -13
  69. package/dist/transforms.d.ts +22 -13
  70. package/dist/transforms.mjs +1 -1
  71. package/dist/vite.cjs +8 -7
  72. package/dist/vite.cjs.map +1 -1
  73. package/dist/vite.mjs +8 -7
  74. package/dist/vite.mjs.map +1 -1
  75. package/dist/zod-v3.cjs +3 -3
  76. package/dist/zod-v3.d.cts +32 -6
  77. package/dist/zod-v3.d.mts +32 -6
  78. package/dist/zod-v3.d.ts +32 -6
  79. package/dist/zod-v3.mjs +3 -3
  80. package/dist/zod-v4.cjs +3 -3
  81. package/dist/zod-v4.d.cts +12 -8
  82. package/dist/zod-v4.d.mts +12 -8
  83. package/dist/zod-v4.d.ts +12 -8
  84. package/dist/zod-v4.mjs +3 -3
  85. package/dist/zod.cjs +8 -8
  86. package/dist/zod.cjs.map +1 -1
  87. package/dist/zod.d.cts +6 -6
  88. package/dist/zod.d.mts +6 -6
  89. package/dist/zod.d.ts +6 -6
  90. package/dist/zod.mjs +6 -6
  91. package/package.json +1 -1
  92. package/dist/shared/attaform.BTi-PsHr.mjs.map +0 -1
  93. package/dist/shared/attaform.BqEfHpVB.cjs.map +0 -1
  94. package/dist/shared/attaform.Bubm_slq.cjs.map +0 -1
  95. package/dist/shared/attaform.C1msmO2v.cjs.map +0 -1
  96. package/dist/shared/attaform.C8CyvYa_.cjs +0 -36
  97. package/dist/shared/attaform.C8CyvYa_.cjs.map +0 -1
  98. package/dist/shared/attaform.CXpzmj38.mjs.map +0 -1
  99. package/dist/shared/attaform.Cghpuav8.mjs +0 -57
  100. package/dist/shared/attaform.Cghpuav8.mjs.map +0 -1
  101. package/dist/shared/attaform.CiMqJHDm.mjs +0 -1594
  102. package/dist/shared/attaform.CiMqJHDm.mjs.map +0 -1
  103. package/dist/shared/attaform.CoxJ8Qm8.cjs.map +0 -1
  104. package/dist/shared/attaform.CrpjyXdO.mjs.map +0 -1
  105. package/dist/shared/attaform.D13GMFgK.mjs +0 -32
  106. package/dist/shared/attaform.D13GMFgK.mjs.map +0 -1
  107. package/dist/shared/attaform.JBx8cfMA.cjs.map +0 -1
  108. package/dist/shared/attaform.OznWyOPy.cjs +0 -1600
  109. package/dist/shared/attaform.OznWyOPy.cjs.map +0 -1
  110. package/dist/shared/attaform.a3uBo-gw.mjs.map +0 -1
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { t as FormKey, al as ValidateOnConfig, P as OnInvalidSubmitPolicy, V as PersistConfig, y as HistoryConfig, g as CoercionRegistry } from './attaform.C0uGZQ4M.js';
3
2
 
4
3
  /**
5
4
  * v3 mirror of the Zod v4 `StorageShape`. Per top-level key, default
@@ -23,23 +22,6 @@ type StorageShape<S extends z.ZodTypeAny> = S extends z.ZodObject<infer Shape> ?
23
22
  [K in keyof Shape]-?: Shape[K] extends z.ZodEffects<z.ZodTypeAny> | z.ZodPipeline<z.ZodTypeAny, z.ZodTypeAny> ? z.input<Shape[K]> : z.output<Shape[K]>;
24
23
  } : z.input<S>;
25
24
 
26
- /**
27
- * Configuration object for the Zod v3 `useForm` overload. Same
28
- * shape as the schema-agnostic `UseFormConfiguration`, but with
29
- * `schema` constrained to a `z.ZodObject` (or wrapped form).
30
- */
31
- type UseFormConfigurationWithZod<Schema extends z.ZodType<unknown>, DefaultValues, K extends FormKey = FormKey> = ValidateOnConfig & {
32
- /** A Zod v3 `ZodObject` schema (or one wrapped in `.optional()` / `.nullable()` / `.default()` / `.refine()`). */
33
- schema: Schema extends z.ZodType<unknown> ? UnwrapZodObject<Schema> extends z.ZodObject<z.ZodRawShape> ? Schema : never : never;
34
- key?: K;
35
- defaultValues?: DefaultValues | (() => DefaultValues) | (() => Promise<DefaultValues>);
36
- strict?: boolean;
37
- onInvalidSubmit?: OnInvalidSubmitPolicy;
38
- persist?: PersistConfig;
39
- history?: HistoryConfig;
40
- rememberVariants?: boolean;
41
- coerce?: boolean | CoercionRegistry;
42
- };
43
25
  /**
44
26
  * Peel `.optional()` / `.nullable()` / `.default()` / `.refine()` /
45
27
  * `.transform()` wrappers off a Zod v3 schema to reach the inner
@@ -50,4 +32,4 @@ type UseFormConfigurationWithZod<Schema extends z.ZodType<unknown>, DefaultValue
50
32
  */
51
33
  type UnwrapZodObject<T> = T extends z.ZodEffects<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodOptional<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodNullable<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodDefault<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodObject<infer Shape> ? z.ZodObject<Shape> : never;
52
34
 
53
- export type { StorageShape as S, UnwrapZodObject as U, UseFormConfigurationWithZod as a };
35
+ export type { StorageShape as S, UnwrapZodObject as U };
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { t as FormKey, al as ValidateOnConfig, P as OnInvalidSubmitPolicy, V as PersistConfig, y as HistoryConfig, g as CoercionRegistry } from './attaform.C0uGZQ4M.cjs';
3
2
 
4
3
  /**
5
4
  * v3 mirror of the Zod v4 `StorageShape`. Per top-level key, default
@@ -23,23 +22,6 @@ type StorageShape<S extends z.ZodTypeAny> = S extends z.ZodObject<infer Shape> ?
23
22
  [K in keyof Shape]-?: Shape[K] extends z.ZodEffects<z.ZodTypeAny> | z.ZodPipeline<z.ZodTypeAny, z.ZodTypeAny> ? z.input<Shape[K]> : z.output<Shape[K]>;
24
23
  } : z.input<S>;
25
24
 
26
- /**
27
- * Configuration object for the Zod v3 `useForm` overload. Same
28
- * shape as the schema-agnostic `UseFormConfiguration`, but with
29
- * `schema` constrained to a `z.ZodObject` (or wrapped form).
30
- */
31
- type UseFormConfigurationWithZod<Schema extends z.ZodType<unknown>, DefaultValues, K extends FormKey = FormKey> = ValidateOnConfig & {
32
- /** A Zod v3 `ZodObject` schema (or one wrapped in `.optional()` / `.nullable()` / `.default()` / `.refine()`). */
33
- schema: Schema extends z.ZodType<unknown> ? UnwrapZodObject<Schema> extends z.ZodObject<z.ZodRawShape> ? Schema : never : never;
34
- key?: K;
35
- defaultValues?: DefaultValues | (() => DefaultValues) | (() => Promise<DefaultValues>);
36
- strict?: boolean;
37
- onInvalidSubmit?: OnInvalidSubmitPolicy;
38
- persist?: PersistConfig;
39
- history?: HistoryConfig;
40
- rememberVariants?: boolean;
41
- coerce?: boolean | CoercionRegistry;
42
- };
43
25
  /**
44
26
  * Peel `.optional()` / `.nullable()` / `.default()` / `.refine()` /
45
27
  * `.transform()` wrappers off a Zod v3 schema to reach the inner
@@ -50,4 +32,4 @@ type UseFormConfigurationWithZod<Schema extends z.ZodType<unknown>, DefaultValue
50
32
  */
51
33
  type UnwrapZodObject<T> = T extends z.ZodEffects<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodOptional<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodNullable<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodDefault<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodObject<infer Shape> ? z.ZodObject<Shape> : never;
52
34
 
53
- export type { StorageShape as S, UnwrapZodObject as U, UseFormConfigurationWithZod as a };
35
+ export type { StorageShape as S, UnwrapZodObject as U };
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { t as FormKey, al as ValidateOnConfig, P as OnInvalidSubmitPolicy, V as PersistConfig, y as HistoryConfig, g as CoercionRegistry } from './attaform.C0uGZQ4M.mjs';
3
2
 
4
3
  /**
5
4
  * v3 mirror of the Zod v4 `StorageShape`. Per top-level key, default
@@ -23,23 +22,6 @@ type StorageShape<S extends z.ZodTypeAny> = S extends z.ZodObject<infer Shape> ?
23
22
  [K in keyof Shape]-?: Shape[K] extends z.ZodEffects<z.ZodTypeAny> | z.ZodPipeline<z.ZodTypeAny, z.ZodTypeAny> ? z.input<Shape[K]> : z.output<Shape[K]>;
24
23
  } : z.input<S>;
25
24
 
26
- /**
27
- * Configuration object for the Zod v3 `useForm` overload. Same
28
- * shape as the schema-agnostic `UseFormConfiguration`, but with
29
- * `schema` constrained to a `z.ZodObject` (or wrapped form).
30
- */
31
- type UseFormConfigurationWithZod<Schema extends z.ZodType<unknown>, DefaultValues, K extends FormKey = FormKey> = ValidateOnConfig & {
32
- /** A Zod v3 `ZodObject` schema (or one wrapped in `.optional()` / `.nullable()` / `.default()` / `.refine()`). */
33
- schema: Schema extends z.ZodType<unknown> ? UnwrapZodObject<Schema> extends z.ZodObject<z.ZodRawShape> ? Schema : never : never;
34
- key?: K;
35
- defaultValues?: DefaultValues | (() => DefaultValues) | (() => Promise<DefaultValues>);
36
- strict?: boolean;
37
- onInvalidSubmit?: OnInvalidSubmitPolicy;
38
- persist?: PersistConfig;
39
- history?: HistoryConfig;
40
- rememberVariants?: boolean;
41
- coerce?: boolean | CoercionRegistry;
42
- };
43
25
  /**
44
26
  * Peel `.optional()` / `.nullable()` / `.default()` / `.refine()` /
45
27
  * `.transform()` wrappers off a Zod v3 schema to reach the inner
@@ -50,4 +32,4 @@ type UseFormConfigurationWithZod<Schema extends z.ZodType<unknown>, DefaultValue
50
32
  */
51
33
  type UnwrapZodObject<T> = T extends z.ZodEffects<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodOptional<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodNullable<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodDefault<infer Inner> ? UnwrapZodObject<Inner> : T extends z.ZodObject<infer Shape> ? z.ZodObject<Shape> : never;
52
34
 
53
- export type { StorageShape as S, UnwrapZodObject as U, UseFormConfigurationWithZod as a };
35
+ export type { StorageShape as S, UnwrapZodObject as U };
@@ -105,22 +105,6 @@ declare class ReservedFormKeyError extends AttaformError {
105
105
  * `console.warn` so a deployed third-party app shipping the
106
106
  * anti-pattern doesn't hard-crash.
107
107
  */
108
- /**
109
- * Thrown when `register(path, { persist: true })` or `form.persist(path)`
110
- * targets a path whose name matches a sensitive-data heuristic
111
- * (password, cvv, ssn, token, etc.) without an explicit
112
- * `acknowledgeSensitive: true` override.
113
- *
114
- * Sensitive data in client-side storage (localStorage, sessionStorage,
115
- * IndexedDB) is a compliance risk — it survives logouts, is readable
116
- * by any same-origin script, and is unencrypted at rest.
117
- *
118
- * Fix: pass `acknowledgeSensitive: true` to confirm the persistence
119
- * is intentional, or persist the data server-side instead.
120
- */
121
- declare class SensitivePersistFieldError extends AttaformError {
122
- constructor(path: ReadonlyArray<string | number> | string);
123
- }
124
108
  /**
125
109
  * Thrown when persistence is misconfigured in a way that would either
126
110
  * (a) silently drop writes, or (b) namespace storage under a
@@ -152,4 +136,4 @@ declare class AnonPersistError extends AttaformError {
152
136
  });
153
137
  }
154
138
 
155
- export { AnonPersistError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SensitivePersistFieldError as S, AttaformError as a, InvalidUseFormConfigError as b, ReservedFormKeyError as c, SubmitErrorHandlerError as d };
139
+ export { AnonPersistError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SubmitErrorHandlerError as S, AttaformError as a, InvalidUseFormConfigError as b, ReservedFormKeyError as c };
@@ -105,22 +105,6 @@ declare class ReservedFormKeyError extends AttaformError {
105
105
  * `console.warn` so a deployed third-party app shipping the
106
106
  * anti-pattern doesn't hard-crash.
107
107
  */
108
- /**
109
- * Thrown when `register(path, { persist: true })` or `form.persist(path)`
110
- * targets a path whose name matches a sensitive-data heuristic
111
- * (password, cvv, ssn, token, etc.) without an explicit
112
- * `acknowledgeSensitive: true` override.
113
- *
114
- * Sensitive data in client-side storage (localStorage, sessionStorage,
115
- * IndexedDB) is a compliance risk — it survives logouts, is readable
116
- * by any same-origin script, and is unencrypted at rest.
117
- *
118
- * Fix: pass `acknowledgeSensitive: true` to confirm the persistence
119
- * is intentional, or persist the data server-side instead.
120
- */
121
- declare class SensitivePersistFieldError extends AttaformError {
122
- constructor(path: ReadonlyArray<string | number> | string);
123
- }
124
108
  /**
125
109
  * Thrown when persistence is misconfigured in a way that would either
126
110
  * (a) silently drop writes, or (b) namespace storage under a
@@ -152,4 +136,4 @@ declare class AnonPersistError extends AttaformError {
152
136
  });
153
137
  }
154
138
 
155
- export { AnonPersistError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SensitivePersistFieldError as S, AttaformError as a, InvalidUseFormConfigError as b, ReservedFormKeyError as c, SubmitErrorHandlerError as d };
139
+ export { AnonPersistError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SubmitErrorHandlerError as S, AttaformError as a, InvalidUseFormConfigError as b, ReservedFormKeyError as c };
@@ -105,22 +105,6 @@ declare class ReservedFormKeyError extends AttaformError {
105
105
  * `console.warn` so a deployed third-party app shipping the
106
106
  * anti-pattern doesn't hard-crash.
107
107
  */
108
- /**
109
- * Thrown when `register(path, { persist: true })` or `form.persist(path)`
110
- * targets a path whose name matches a sensitive-data heuristic
111
- * (password, cvv, ssn, token, etc.) without an explicit
112
- * `acknowledgeSensitive: true` override.
113
- *
114
- * Sensitive data in client-side storage (localStorage, sessionStorage,
115
- * IndexedDB) is a compliance risk — it survives logouts, is readable
116
- * by any same-origin script, and is unencrypted at rest.
117
- *
118
- * Fix: pass `acknowledgeSensitive: true` to confirm the persistence
119
- * is intentional, or persist the data server-side instead.
120
- */
121
- declare class SensitivePersistFieldError extends AttaformError {
122
- constructor(path: ReadonlyArray<string | number> | string);
123
- }
124
108
  /**
125
109
  * Thrown when persistence is misconfigured in a way that would either
126
110
  * (a) silently drop writes, or (b) namespace storage under a
@@ -152,4 +136,4 @@ declare class AnonPersistError extends AttaformError {
152
136
  });
153
137
  }
154
138
 
155
- export { AnonPersistError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SensitivePersistFieldError as S, AttaformError as a, InvalidUseFormConfigError as b, ReservedFormKeyError as c, SubmitErrorHandlerError as d };
139
+ export { AnonPersistError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SubmitErrorHandlerError as S, AttaformError as a, InvalidUseFormConfigError as b, ReservedFormKeyError as c };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { G as GenericForm, q as FlatPath, B as NestedType, t as FormKey, ai as UseFormConfiguration, A as AbstractSchema, j as DefaultValuesInput, al as ValidateOnConfig, aj as UseFormReturnType } from './attaform.C0uGZQ4M.js';
2
+ import { G as GenericForm, q as FlatPath, B as NestedType, t as FormKey, ai as UseFormConfiguration, A as AbstractSchema, j as DefaultValuesInput, al as ValidateOnConfig, aj as UseFormReturnType } from './attaform.SfhU0OEY.js';
3
3
 
4
4
  /**
5
5
  * The shape `form.values.<key>` returns at runtime.