attaform 0.27.6 → 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.
Files changed (192) hide show
  1. package/dist/abstract.d.mts +5 -4
  2. package/dist/abstract.mjs +4 -3
  3. package/dist/chunks/fingerprint.mjs +1 -2
  4. package/dist/chunks/fingerprint2.mjs +2 -3
  5. package/dist/dev/abstract.mjs +4 -0
  6. package/dist/{chunks → dev/chunks}/dev-key-collision-warnings.mjs +0 -1
  7. package/dist/{chunks → dev/chunks}/devtools.mjs +5 -6
  8. package/dist/{chunks/fingerprint.cjs → dev/chunks/fingerprint.mjs} +7 -10
  9. package/dist/{chunks/fingerprint2.cjs → dev/chunks/fingerprint2.mjs} +32 -35
  10. package/dist/dev/directive.mjs +1 -0
  11. package/dist/dev/history.mjs +89 -0
  12. package/dist/dev/index.mjs +5 -0
  13. package/dist/dev/runtime/plugins/attaform.mjs +40 -0
  14. package/dist/dev/shared/attaform-dev.A-TpJW0B.mjs +207 -0
  15. package/dist/dev/shared/attaform-dev.BO-71R54.mjs +820 -0
  16. package/dist/{shared/attaform.D6tk90Rc.cjs → dev/shared/attaform-dev.BgM6FdtA.mjs} +324 -73
  17. package/dist/dev/shared/attaform-dev.ButTkwHd.mjs +375 -0
  18. package/dist/{shared/attaform.BJGA_UOS.mjs → dev/shared/attaform-dev.BxfsuwBR.mjs} +8 -1
  19. package/dist/{shared/attaform.nMaz2C5P.mjs → dev/shared/attaform-dev.D8aoKb89.mjs} +190 -400
  20. package/dist/dev/shared/attaform-dev.DD5m2W51.mjs +220 -0
  21. package/dist/{shared/attaform.CKH2lGdL.mjs → dev/shared/attaform-dev.DHuydLAC.mjs} +3867 -4731
  22. package/dist/{shared/attaform.DYEr28Pt.mjs → dev/shared/attaform-dev.DrzObAZo.mjs} +6 -7
  23. package/dist/{shared/attaform.B1ZYt2Li.mjs → dev/shared/attaform-dev.q6UutkCx.mjs} +274 -672
  24. package/dist/dev/zod-v3.mjs +17 -0
  25. package/dist/dev/zod-v4.mjs +16 -0
  26. package/dist/dev/zod.mjs +5 -0
  27. package/dist/directive.d.mts +20 -0
  28. package/dist/directive.mjs +1 -0
  29. package/dist/esbuild.mjs +0 -1
  30. package/dist/history.d.mts +59 -0
  31. package/dist/history.mjs +89 -0
  32. package/dist/index.d.mts +14 -6
  33. package/dist/index.mjs +5 -4
  34. package/dist/nuxt.d.mts +10 -10
  35. package/dist/nuxt.mjs +5 -2
  36. package/dist/rollup.mjs +0 -1
  37. package/dist/rspack.d.mts +6 -1
  38. package/dist/rspack.mjs +0 -1
  39. package/dist/runtime/components/AttaformDevtoolsPanel.vue +9 -8
  40. package/dist/runtime/plugins/attaform.mjs +1 -2
  41. package/dist/shared/{attaform.CoR4mWfv.mjs → attaform.B0dKL8ST.mjs} +309 -46
  42. package/dist/shared/{attaform.Cs2Rbdlo.mjs → attaform.BK0cgu2K.mjs} +123 -140
  43. package/dist/shared/{attaform.B9Wyhfro.cjs → attaform.BndjUUYX.mjs} +11 -16
  44. package/dist/shared/{attaform.CQN9R62B.cjs → attaform.BxfsuwBR.mjs} +9 -4
  45. package/dist/shared/attaform.C2MVyuxC.mjs +811 -0
  46. package/dist/shared/{attaform.Fp3sCrVs.d.ts → attaform.CIWLMY-R.d.mts} +2 -2
  47. package/dist/shared/attaform.CZMAYwSK.mjs +6383 -0
  48. package/dist/shared/attaform.CZYt_5N_.mjs +207 -0
  49. package/dist/shared/{attaform.DniawQLP.d.cts → attaform.CsoeRi3P.d.mts} +490 -98
  50. package/dist/shared/attaform.Cvao8bW5.mjs +358 -0
  51. package/dist/shared/attaform.D0x-qSXm.mjs +197 -0
  52. package/dist/shared/{attaform.D8kliaKw.cjs → attaform.D1fnTifF.mjs} +279 -692
  53. package/dist/shared/{attaform.CHlJLAiv.d.mts → attaform.DDtqHYv1.d.mts} +155 -184
  54. package/dist/shared/{attaform.Biytrv0-.cjs → attaform.DffRL5pP.mjs} +215 -547
  55. package/dist/shared/attaform.DhnPb6nK.mjs +0 -1
  56. package/dist/shared/attaform.KvlEedlF.mjs +0 -1
  57. package/dist/shared/attaform.axHXVQO7.d.mts +44 -0
  58. package/dist/shared/attaform.v0fQtWyA.mjs +0 -1
  59. package/dist/transforms.d.mts +0 -22
  60. package/dist/transforms.mjs +1 -2
  61. package/dist/vite.d.mts +30 -9
  62. package/dist/vite.mjs +27 -4
  63. package/dist/webpack.d.mts +6 -1
  64. package/dist/webpack.mjs +0 -1
  65. package/dist/zod-v3.d.mts +13 -6
  66. package/dist/zod-v3.mjs +17 -4
  67. package/dist/zod-v4.d.mts +19 -26
  68. package/dist/zod-v4.mjs +16 -4
  69. package/dist/zod.d.mts +4 -3
  70. package/dist/zod.mjs +5 -4
  71. package/package.json +38 -20
  72. package/skills/attaform/SKILL.md +6 -2
  73. package/skills/attaform/references/custom-components.md +7 -2
  74. package/skills/attaform/references/errors.md +8 -3
  75. package/skills/attaform/references/saving.md +77 -0
  76. package/skills/attaform/references/wizards.md +10 -8
  77. package/dist/abstract.cjs +0 -48
  78. package/dist/abstract.cjs.map +0 -1
  79. package/dist/abstract.d.cts +0 -42
  80. package/dist/abstract.d.ts +0 -42
  81. package/dist/abstract.mjs.map +0 -1
  82. package/dist/chunks/dev-key-collision-warnings.cjs +0 -25
  83. package/dist/chunks/dev-key-collision-warnings.cjs.map +0 -1
  84. package/dist/chunks/dev-key-collision-warnings.mjs.map +0 -1
  85. package/dist/chunks/devtools.cjs +0 -157
  86. package/dist/chunks/devtools.cjs.map +0 -1
  87. package/dist/chunks/devtools.mjs.map +0 -1
  88. package/dist/chunks/fingerprint.cjs.map +0 -1
  89. package/dist/chunks/fingerprint.mjs.map +0 -1
  90. package/dist/chunks/fingerprint2.cjs.map +0 -1
  91. package/dist/chunks/fingerprint2.mjs.map +0 -1
  92. package/dist/esbuild.cjs +0 -28
  93. package/dist/esbuild.cjs.map +0 -1
  94. package/dist/esbuild.d.cts +0 -56
  95. package/dist/esbuild.d.ts +0 -56
  96. package/dist/esbuild.mjs.map +0 -1
  97. package/dist/index.cjs +0 -51
  98. package/dist/index.cjs.map +0 -1
  99. package/dist/index.d.cts +0 -249
  100. package/dist/index.d.ts +0 -249
  101. package/dist/index.mjs.map +0 -1
  102. package/dist/nuxt.cjs +0 -84
  103. package/dist/nuxt.cjs.map +0 -1
  104. package/dist/nuxt.d.cts +0 -66
  105. package/dist/nuxt.d.ts +0 -66
  106. package/dist/nuxt.mjs.map +0 -1
  107. package/dist/rollup.cjs +0 -24
  108. package/dist/rollup.cjs.map +0 -1
  109. package/dist/rollup.d.cts +0 -35
  110. package/dist/rollup.d.ts +0 -35
  111. package/dist/rollup.mjs.map +0 -1
  112. package/dist/rspack.cjs +0 -10
  113. package/dist/rspack.cjs.map +0 -1
  114. package/dist/rspack.d.cts +0 -40
  115. package/dist/rspack.d.ts +0 -40
  116. package/dist/rspack.mjs.map +0 -1
  117. package/dist/runtime/components/AttaformDevtoolsPanel.vue.d.ts +0 -7
  118. package/dist/runtime/components/DevtoolsValueTree.vue.d.ts +0 -35
  119. package/dist/runtime/plugins/attaform.cjs +0 -43
  120. package/dist/runtime/plugins/attaform.cjs.map +0 -1
  121. package/dist/runtime/plugins/attaform.d.cts +0 -5
  122. package/dist/runtime/plugins/attaform.d.ts +0 -5
  123. package/dist/runtime/plugins/attaform.mjs.map +0 -1
  124. package/dist/shared/attaform.B1ZYt2Li.mjs.map +0 -1
  125. package/dist/shared/attaform.B9Wyhfro.cjs.map +0 -1
  126. package/dist/shared/attaform.BGDV42hI.d.cts +0 -232
  127. package/dist/shared/attaform.BJGA_UOS.mjs.map +0 -1
  128. package/dist/shared/attaform.Biytrv0-.cjs.map +0 -1
  129. package/dist/shared/attaform.Bn0IzhD_.cjs +0 -800
  130. package/dist/shared/attaform.Bn0IzhD_.cjs.map +0 -1
  131. package/dist/shared/attaform.C9fPTxjB.d.cts +0 -41
  132. package/dist/shared/attaform.C9fPTxjB.d.ts +0 -41
  133. package/dist/shared/attaform.CKH2lGdL.mjs.map +0 -1
  134. package/dist/shared/attaform.CQN9R62B.cjs.map +0 -1
  135. package/dist/shared/attaform.CoR4mWfv.mjs.map +0 -1
  136. package/dist/shared/attaform.Cs2Rbdlo.mjs.map +0 -1
  137. package/dist/shared/attaform.D6tk90Rc.cjs.map +0 -1
  138. package/dist/shared/attaform.D8kliaKw.cjs.map +0 -1
  139. package/dist/shared/attaform.DLknk9nF.d.mts +0 -232
  140. package/dist/shared/attaform.DMxM2kol.mjs +0 -1275
  141. package/dist/shared/attaform.DMxM2kol.mjs.map +0 -1
  142. package/dist/shared/attaform.DRUT703x.d.cts +0 -56
  143. package/dist/shared/attaform.DRUT703x.d.ts +0 -56
  144. package/dist/shared/attaform.DYEr28Pt.mjs.map +0 -1
  145. package/dist/shared/attaform.DdQN7sgN.cjs +0 -1302
  146. package/dist/shared/attaform.DdQN7sgN.cjs.map +0 -1
  147. package/dist/shared/attaform.DhnPb6nK.mjs.map +0 -1
  148. package/dist/shared/attaform.DniawQLP.d.mts +0 -4763
  149. package/dist/shared/attaform.DniawQLP.d.ts +0 -4763
  150. package/dist/shared/attaform.DoQm_Vkd.cjs +0 -58
  151. package/dist/shared/attaform.DoQm_Vkd.cjs.map +0 -1
  152. package/dist/shared/attaform.DrvMscNX.cjs +0 -7697
  153. package/dist/shared/attaform.DrvMscNX.cjs.map +0 -1
  154. package/dist/shared/attaform.F2Q8iv38.d.ts +0 -2494
  155. package/dist/shared/attaform.FmqKO1Ex.d.cts +0 -2494
  156. package/dist/shared/attaform.KvlEedlF.mjs.map +0 -1
  157. package/dist/shared/attaform.RaTzp1WF.cjs +0 -26
  158. package/dist/shared/attaform.RaTzp1WF.cjs.map +0 -1
  159. package/dist/shared/attaform.nMaz2C5P.mjs.map +0 -1
  160. package/dist/shared/attaform.v0fQtWyA.mjs.map +0 -1
  161. package/dist/shared/attaform.yUrz7C2z.cjs +0 -29
  162. package/dist/shared/attaform.yUrz7C2z.cjs.map +0 -1
  163. package/dist/transforms.cjs +0 -12
  164. package/dist/transforms.cjs.map +0 -1
  165. package/dist/transforms.d.cts +0 -73
  166. package/dist/transforms.d.ts +0 -73
  167. package/dist/transforms.mjs.map +0 -1
  168. package/dist/vite.cjs +0 -363
  169. package/dist/vite.cjs.map +0 -1
  170. package/dist/vite.d.cts +0 -133
  171. package/dist/vite.d.ts +0 -133
  172. package/dist/vite.mjs.map +0 -1
  173. package/dist/webpack.cjs +0 -10
  174. package/dist/webpack.cjs.map +0 -1
  175. package/dist/webpack.d.cts +0 -37
  176. package/dist/webpack.d.ts +0 -37
  177. package/dist/webpack.mjs.map +0 -1
  178. package/dist/zod-v3.cjs +0 -53
  179. package/dist/zod-v3.cjs.map +0 -1
  180. package/dist/zod-v3.d.cts +0 -246
  181. package/dist/zod-v3.d.ts +0 -246
  182. package/dist/zod-v3.mjs.map +0 -1
  183. package/dist/zod-v4.cjs +0 -55
  184. package/dist/zod-v4.cjs.map +0 -1
  185. package/dist/zod-v4.d.cts +0 -172
  186. package/dist/zod-v4.d.ts +0 -172
  187. package/dist/zod-v4.mjs.map +0 -1
  188. package/dist/zod.cjs +0 -51
  189. package/dist/zod.cjs.map +0 -1
  190. package/dist/zod.d.cts +0 -7
  191. package/dist/zod.d.ts +0 -7
  192. package/dist/zod.mjs.map +0 -1
@@ -51,4 +51,3 @@ function resolveZodAliasTarget(consumerRootDir, tag, resolveZodAlias, warnState)
51
51
  }
52
52
 
53
53
  export { REWRITABLE_ZOD_SPECIFIER_FILTER as R, isRewritableZodSpecifier as i, resolveZodAliasTarget as r };
54
- //# sourceMappingURL=attaform.DhnPb6nK.mjs.map
@@ -19,4 +19,3 @@ function isTransforming(value) {
19
19
  }
20
20
 
21
21
  export { REGISTER_OWNER_MARKER as R, SSR_COMPONENT_HOST_MODIFIER as S, V_REGISTER_COMPILED_MODIFIER as V, isTransforming as a, V_REGISTER_MARKER as b, isRegisterValue as i };
22
- //# sourceMappingURL=attaform.KvlEedlF.mjs.map
@@ -0,0 +1,44 @@
1
+ import { App } from 'vue';
2
+ import { at as RegisterModelDynamicCustomDirective } from './attaform.CsoeRi3P.mjs';
3
+
4
+ /**
5
+ * The `v-register` directive. Bind a form field to a native input,
6
+ * select, textarea, checkbox, or radio:
7
+ *
8
+ * ```vue
9
+ * <input v-register="form.register('email')" />
10
+ * <select v-register="form.register('country')">
11
+ * <option value="us">US</option>
12
+ * <option value="uk">UK</option>
13
+ * </select>
14
+ * ```
15
+ *
16
+ * The directive picks the right binding strategy automatically based
17
+ * on the element's `tagName` and `type`. Delivered by the Vite / Nuxt
18
+ * plugin's compile-time binding, or by `installVRegister(app)`
19
+ * everywhere else. Most consumers never import it directly, but it's
20
+ * exposed for advanced integrations that wire directives manually.
21
+ */
22
+ declare const vRegister: RegisterModelDynamicCustomDirective;
23
+ /**
24
+ * Register the `v-register` directive app-wide. The one-line setup for
25
+ * apps whose templates are compiled without Attaform's Vite or Nuxt
26
+ * plugin — a webpack-family bundler, a no-build / CDN page, or
27
+ * runtime-compiled templates:
28
+ *
29
+ * ```ts
30
+ * import { createApp } from 'vue'
31
+ * import { installVRegister } from 'attaform/directive'
32
+ *
33
+ * const app = createApp(App)
34
+ * installVRegister(app)
35
+ * ```
36
+ *
37
+ * Vite and Nuxt consumers don't call this: the build plugin binds each
38
+ * template's `v-register` to the directive at compile time. Idempotent —
39
+ * a second call for the same app is a no-op, and an app-level directive
40
+ * a consumer registered under the same name is left in place.
41
+ */
42
+ declare function installVRegister(app: App): void;
43
+
44
+ export { installVRegister as i, vRegister as v };
@@ -21,4 +21,3 @@ function createWebpackFamilyPlugin(tag, options) {
21
21
  }
22
22
 
23
23
  export { createWebpackFamilyPlugin as c };
24
- //# sourceMappingURL=attaform.v0fQtWyA.mjs.map
@@ -1,27 +1,5 @@
1
1
  import { NodeTransform } from '@vue/compiler-core';
2
2
 
3
- /**
4
- * Vue compiler node transform that bridges `v-register` into the
5
- * downstream binding shapes its consumers expect:
6
- *
7
- * - `<select v-register>` — injects `:value` (single-select) and
8
- * per-`<option>` `:selected` so the runtime directive can pre-mark
9
- * selected options at SSR time.
10
- * - `<MyComponent v-register>` and kebab-case custom-element hosts
11
- * — injects a `:registerValue` bridge prop so `useRegister` inside
12
- * the child sees the parent's RegisterValue (the binding the audit
13
- * called out as the transform's "fires on every component" path),
14
- * and marks any parent-authored slotted `<option>`s with `:selected`
15
- * the same way the native path does, so a `<select>` wrapped in a
16
- * styled component keeps its SSR-selected option (#394).
17
- *
18
- * Wired automatically by `attaform/vite` and `attaform/nuxt`. Use
19
- * directly only when integrating with a custom bundler.
20
- *
21
- * Renamed from `selectNodeTransform` (DIR-F6): the original name read
22
- * as a `<select>`-only transform, but the component-bridge path is
23
- * load-bearing for every `useRegister` consumer.
24
- */
25
3
  declare const componentBridgeTransform: NodeTransform;
26
4
 
27
5
  /**
@@ -1,2 +1 @@
1
- export { c as componentBridgeTransform, i as inputTextAreaNodeTransform, r as redundantBindingWarnTransform, v as vRegisterHintTransform, a as vRegisterPreambleTransform } from './shared/attaform.Cs2Rbdlo.mjs';
2
- //# sourceMappingURL=transforms.mjs.map
1
+ export { c as componentBridgeTransform, i as inputTextAreaNodeTransform, r as redundantBindingWarnTransform, v as vRegisterHintTransform, a as vRegisterPreambleTransform } from './shared/attaform.BK0cgu2K.mjs';
package/dist/vite.d.mts CHANGED
@@ -21,16 +21,25 @@ import { Plugin } from 'vite';
21
21
  * the auto-imports at `/zod` costs the consumer nothing and earns the
22
22
  * lean bundle for free.
23
23
  *
24
+ * The bar for a slot: a form author calls it directly from inside a
25
+ * component's `setup`. That is why `useRegister` is here. It is the only
26
+ * way to write a custom input wrapper, and it opens with
27
+ * `getCurrentInstance()`, so a component's `setup` is the one place it
28
+ * can be called at all.
29
+ *
24
30
  * Deliberately absent (reach for these with an explicit import):
25
31
  * - `useAbstractForm` — the schema-agnostic escape hatch on
26
32
  * `attaform/abstract`, an advanced surface, not the default form.
27
33
  * - `createAttaform` — the plugin install, a setup-level one-liner that
28
34
  * belongs beside the app bootstrap, not in every component's scope.
29
- * - `useRegister` and the serialize helpers — low-level plumbing.
35
+ * - `unset` / `isUnset` and the serialize helpers: plain values and
36
+ * functions with no component affinity, equally at home in a store, a
37
+ * util module, or a server route. `unset` is also too generic a name
38
+ * to spend on every app's global scope.
30
39
  *
31
- * A name earns a slot here only if a form author calls it directly on a
32
- * normal page. The manifest test pins the set so a casual addition of a
33
- * setup-level symbol to the global scope fails loudly.
40
+ * The manifest test pins the set so a casual addition of a setup-level
41
+ * symbol to the global scope fails loudly, and `auto-import-docs.test.ts`
42
+ * pins the prose that enumerates it.
34
43
  */
35
44
  /**
36
45
  * One auto-imported binding: the exported `name` and the module it is
@@ -55,7 +64,9 @@ declare const attaformAutoImportsMap: Record<string, string[]>;
55
64
 
56
65
  /**
57
66
  * `attaform/vite` — Vite plugin that wires the compile-time node
58
- * transforms with @vitejs/plugin-vue AND rewrites `attaform` and
67
+ * transforms with @vitejs/plugin-vue, binds `v-register` into each
68
+ * compiled template that uses it (so no app-level directive
69
+ * registration exists or is needed), AND rewrites `attaform` and
59
70
  * `attaform/zod` imports to either `attaform/zod-v3` or `attaform/zod-v4`
60
71
  * at build time, based on the consumer's installed Zod major. The result
61
72
  * is one Zod adapter shipped per bundle, with no manual subpath choice.
@@ -110,9 +121,11 @@ interface AttaformVitePluginOptions {
110
121
  }
111
122
  /**
112
123
  * Vite plugin that wires the form library's compile-time template
113
- * transforms into `@vitejs/plugin-vue` and rewrites the bare `attaform`
114
- * barrel and the unified `attaform/zod` import to the matching adapter
115
- * subpath. Required for SSR and for hydration accuracy under bare Vue 3.
124
+ * transforms into `@vitejs/plugin-vue`, binds the `v-register`
125
+ * directive into each compiled template that uses it, and rewrites the
126
+ * bare `attaform` barrel and the unified `attaform/zod` import to the
127
+ * matching adapter subpath. Required for SSR and for hydration
128
+ * accuracy under bare Vue 3.
116
129
  *
117
130
  * ```ts
118
131
  * // vite.config.ts
@@ -126,8 +139,16 @@ interface AttaformVitePluginOptions {
126
139
  *
127
140
  * Place the call after `vue()` in the plugins array. Nuxt projects
128
141
  * don't need this — `attaform/nuxt` handles it.
142
+ *
143
+ * Returns a two-plugin array (Vite flattens nested plugin arrays): the
144
+ * main pre-plugin above, plus a post-plugin that rewrites each compiled
145
+ * SFC's `resolveDirective("register")` to a static import from
146
+ * `attaform/directive`. The rewrite is why no app-level directive
147
+ * registration exists or is needed here — see
148
+ * `runtime/lib/core/transforms/directive-delivery-transform.ts` for the
149
+ * mechanism and its scope.
129
150
  */
130
- declare function attaform(options?: AttaformVitePluginOptions): Plugin;
151
+ declare function attaform(options?: AttaformVitePluginOptions): Plugin[];
131
152
 
132
153
  export { attaform, attaformAutoImports, attaformAutoImportsMap };
133
154
  export type { AttaformAutoImport, AttaformVitePluginOptions };
package/dist/vite.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { r as resolveZodAliasTarget, i as isRewritableZodSpecifier } from './shared/attaform.DhnPb6nK.mjs';
2
- import { a as vRegisterPreambleTransform, r as redundantBindingWarnTransform, c as componentBridgeTransform, i as inputTextAreaNodeTransform, v as vRegisterHintTransform } from './shared/attaform.Cs2Rbdlo.mjs';
2
+ import { a as vRegisterPreambleTransform, r as redundantBindingWarnTransform, c as componentBridgeTransform, i as inputTextAreaNodeTransform, v as vRegisterHintTransform } from './shared/attaform.BK0cgu2K.mjs';
3
3
  import { parse, babelParse } from '@vue/compiler-sfc';
4
4
  import { NodeTypes } from '@vue/compiler-core';
5
5
 
@@ -11,7 +11,8 @@ const attaformAutoImports = [
11
11
  { name: "fieldMeta", from: "attaform/zod" },
12
12
  { name: "withMeta", from: "attaform/zod" },
13
13
  { name: "lazy", from: "attaform/zod" },
14
- { name: "gate", from: "attaform/zod" }
14
+ { name: "gate", from: "attaform/zod" },
15
+ { name: "useRegister", from: "attaform/zod" }
15
16
  ];
16
17
  const attaformAutoImportsMap = attaformAutoImports.reduce((map, entry) => {
17
18
  const names = map[entry.from] ?? [];
@@ -20,6 +21,20 @@ const attaformAutoImportsMap = attaformAutoImports.reduce((map, entry) => {
20
21
  return map;
21
22
  }, {});
22
23
 
24
+ const RESOLVE_CALL = '_resolveDirective("register")';
25
+ const LOCAL_ID = "__attaformVRegister";
26
+ const PADDED_LOCAL_ID = LOCAL_ID.padEnd(RESOLVE_CALL.length, " ");
27
+ const IMPORT_LINE = `
28
+ import { vRegister as ${LOCAL_ID} } from "attaform/directive";
29
+ `;
30
+ function rewriteDirectiveDelivery(code, id) {
31
+ if (id.includes("/node_modules/")) return null;
32
+ const file = id.split("?", 1)[0];
33
+ if (file === void 0 || !file.endsWith(".vue")) return null;
34
+ if (!code.includes(RESOLVE_CALL)) return null;
35
+ return code.split(RESOLVE_CALL).join(PADDED_LOCAL_ID) + IMPORT_LINE;
36
+ }
37
+
23
38
  var __defProp = Object.defineProperty;
24
39
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
25
40
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -207,7 +222,7 @@ function attaform(options = {}) {
207
222
  const resolveZodAlias = options.resolveZodAlias !== false;
208
223
  let aliasTarget = null;
209
224
  const warnState = { warned: false };
210
- return {
225
+ const main = {
211
226
  name: "attaform",
212
227
  enforce: "pre",
213
228
  configResolved(resolved) {
@@ -353,7 +368,15 @@ function attaform(options = {}) {
353
368
  return transformSsrAccessed(code, id);
354
369
  }
355
370
  };
371
+ const delivery = {
372
+ name: "attaform:directive-delivery",
373
+ enforce: "post",
374
+ transform(code, id) {
375
+ const rewritten = rewriteDirectiveDelivery(code, id);
376
+ return rewritten === null ? null : { code: rewritten, map: null };
377
+ }
378
+ };
379
+ return [main, delivery];
356
380
  }
357
381
 
358
382
  export { attaform, attaformAutoImports, attaformAutoImportsMap };
359
- //# sourceMappingURL=vite.mjs.map
@@ -20,7 +20,12 @@ import { W as WebpackFamilyPlugin, a as WebpackFamilyPluginOptions } from './sha
20
20
  * transforms that `attaform/vite` wires (load-bearing for SSR initial
21
21
  * render) are `@vitejs/plugin-vue`-specific and do not transfer; a
22
22
  * non-Vite consumer that needs them wires `attaform/transforms` into
23
- * their Vue compiler separately.
23
+ * their Vue compiler separately. The `v-register` directive itself is
24
+ * also delivered by the Vite plugin's compile-time binding, so outside
25
+ * that pipeline register it once per app:
26
+ *
27
+ * import { installVRegister } from 'attaform/directive'
28
+ * installVRegister(app)
24
29
  *
25
30
  * Zero-dep: the plugin imports nothing from `webpack` (it taps the resolve
26
31
  * hook the compiler injects at the consumer's build). Shares its body with
package/dist/webpack.mjs CHANGED
@@ -5,4 +5,3 @@ function attaform(options = {}) {
5
5
  }
6
6
 
7
7
  export { attaform };
8
- //# sourceMappingURL=webpack.mjs.map
package/dist/zod-v3.d.mts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, aq as AcceptableDefaults, a as UseFormReturnType, ae as ValidateOnConfig, ar as SchemaFactoryOptions, o as FieldMetaPayload } from './shared/attaform.DniawQLP.mjs';
3
- 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, D as DefaultValuesInput, i as DefaultValuesResponse, j as DefaultValuesShape, k as DisplayCtx, l as DisplayMachine, m as DisplayState, E as ErrorInput, n as ErrorsProxyShape, 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 HistoryConfig, 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 PartialFlatPath, S as Path, T as PathKey, V as PendingValidationStatus, W as Primitive, X as ROOT_PATH, Y as ROOT_PATH_KEY, Z as ReactiveValidationStatus, _ as RegisterDirective, $ as RegisterFlatPath, a0 as RegisterOptions, a1 as RegisterSelectModifier, a2 as RegisterTextModifier, a3 as RegisterTransform, a4 as RegisterValue, a5 as Segment, a6 as SetValueCallback, a7 as SetValuePayload, a8 as SettledValidationStatus, a9 as SlimPrimitiveKind, aa as SlimRuntimeOf, ab as SubmitHandler, ac as Unset, ad as ValidateOn, af as ValidationError, ag as ValidationResponse, ah as ValidationResponseWithoutValue, ai as ValueOfUnion, aj as WriteMeta, ak as WriteShape, al as canonicalizePath, am as isPathPrefix, an as isUnset, ao as parseDottedPath, ap as unset } from './shared/attaform.DniawQLP.mjs';
2
+ import { G as GenericForm, F as FormKey, U as UseFormConfiguration, av as AcceptableDefaults, a as UseFormReturnType, ah as ValidateOnConfig, au as SchemaFactoryOptions, o as FieldMetaPayload } from './shared/attaform.CsoeRi3P.mjs';
3
+ import { AbstractSchema } from './abstract.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, D as DefaultValuesInput, i as DefaultValuesResponse, j as DefaultValuesShape, k as DisplayCtx, l as DisplayMachine, m as DisplayState, E as ErrorInput, n as ErrorsProxyShape, 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, 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';
4
5
  import { S as SupportedRootSchema, U as UnwrapZodRoot, a as StorageShape } from './shared/attaform.DRUT703x.mjs';
5
- export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, 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 UseRegisterReturn, o as UseWizardReturnType, W as WizardAggregateError, p as WizardCtx, q as WizardCtxForm, r as WizardOnError, s as WizardOnSubmit, t as WizardOptions, u as WizardPersistFn, v as WizardRestoreFn, w as WizardRestoreState, x as WizardStatusesProxy, y as WizardSubmitContext, z as assignKey, B as createAttaform, E as createRegistry, H as defaultCoercionRules, J as defaultDisplayState, K as defineCoercion, M as escapeForInlineScript, N as gate, P as getRegistryFromApp, Q as hydrateAttaformState, T as injectForm, V as injectWizard, X as isRegisterValue, Y as kAttaformRegistry, Z as lazy, _ as makeDefaultDisplayState, $ as renderAttaformState, a0 as useRegister, a1 as useRegistry, a2 as useWizard, a3 as vRegister } from './shared/attaform.CHlJLAiv.mjs';
6
+ export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, 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';
7
+ export { v as vRegister } from './shared/attaform.axHXVQO7.mjs';
6
8
  import 'vue';
7
9
 
8
10
  /**
@@ -113,6 +115,7 @@ type ZodTypeMap = {
113
115
  ]>;
114
116
  ZodArray: z.ZodArray<z.ZodTypeAny>;
115
117
  ZodSet: z.ZodSet<z.ZodTypeAny>;
118
+ ZodMap: z.ZodMap<z.ZodTypeAny, z.ZodTypeAny>;
116
119
  ZodRecord: z.ZodRecord<z.ZodTypeAny, z.ZodTypeAny>;
117
120
  ZodDefault: z.ZodDefault<z.ZodTypeAny>;
118
121
  ZodOptional: z.ZodOptional<z.ZodTypeAny>;
@@ -190,9 +193,13 @@ declare function isZodSchemaType<K extends keyof ZodTypeMap>(schema: unknown, ex
190
193
 
191
194
  /**
192
195
  * The shared registry every Attaform-aware Zod 3 schema can register
193
- * field metadata against. Backed by the cross-adapter
194
- * `fieldMetaStore` — a payload registered here is visible to the v4
195
- * adapter and the unified `attaform/zod` entry, and vice versa.
196
+ * field metadata against. Backed by the cross-adapter store — a
197
+ * payload registered here is visible to the v4 adapter and the
198
+ * unified `attaform/zod` entry, and vice versa. Every `add` also
199
+ * installs the path-walking resolver into the shared store's builder
200
+ * slot, so the walk's bytes ride this module's import instead of the
201
+ * adapter — a consumer that never registers metadata never ships the
202
+ * walk.
196
203
  */
197
204
  type FieldMetaRegistryV3 = {
198
205
  /**
package/dist/zod-v3.mjs CHANGED
@@ -1,5 +1,18 @@
1
- export { f as fieldMeta, i as isZodSchemaType, u as useForm, w as withMeta, z as zodAdapter } from './shared/attaform.B1ZYt2Li.mjs';
2
- export { A as AttaformError, D as DEVTOOLS_WINDOW_KEY, 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 assignKey, f as canonicalizePath, g as createAttaform, h as createRegistry, i as getRegistryFromApp, j as hydrateAttaformState, k as isPathPrefix, l as kAttaformRegistry, p as parseDottedPath, r as renderAttaformState, u as useRegistry, v as vRegister } from './shared/attaform.nMaz2C5P.mjs';
3
- 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.CKH2lGdL.mjs';
1
+ export { i as isZodSchemaType, u as useForm, z as zodAdapter } from './shared/attaform.D1fnTifF.mjs';
2
+ import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.B0dKL8ST.mjs';
3
+ export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform.CZYt_5N_.mjs';
4
+ 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.CZMAYwSK.mjs';
5
+ export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.D0x-qSXm.mjs';
6
+ export { a as assignKey, v as vRegister } from './shared/attaform.DffRL5pP.mjs';
4
7
  export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
5
- //# sourceMappingURL=zod-v3.mjs.map
8
+
9
+ const fieldMeta = installingFieldMetaStore;
10
+ function withMeta(schema, payload) {
11
+ const existing = getFieldMetaForSchema(schema) ?? {};
12
+ const Ctor = schema.constructor;
13
+ const cloned = new Ctor(schema._def);
14
+ installingFieldMetaStore.add(cloned, { ...existing, ...payload });
15
+ return cloned;
16
+ }
17
+
18
+ export { fieldMeta, withMeta };
package/dist/zod-v4.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { S as SupportedRootSchema } from './shared/attaform.DLknk9nF.mjs';
2
- export { P as PathInput, a as PathOutput, u as useForm } from './shared/attaform.DLknk9nF.mjs';
3
- import { c as AttaformError } from './shared/attaform.CHlJLAiv.mjs';
4
- export { a as AnyForm, b as AttaformDevtoolsBridge, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, 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 UseRegisterReturn, o as UseWizardReturnType, W as WizardAggregateError, p as WizardCtx, q as WizardCtxForm, r as WizardOnError, s as WizardOnSubmit, t as WizardOptions, u as WizardPersistFn, v as WizardRestoreFn, w as WizardRestoreState, x as WizardStatusesProxy, y as WizardSubmitContext, z as assignKey, B as createAttaform, E as createRegistry, H as defaultCoercionRules, J as defaultDisplayState, K as defineCoercion, M as escapeForInlineScript, N as gate, P as getRegistryFromApp, Q as hydrateAttaformState, T as injectForm, V as injectWizard, X as isRegisterValue, Y as kAttaformRegistry, Z as lazy, _ as makeDefaultDisplayState, $ as renderAttaformState, a0 as useRegister, a1 as useRegistry, a2 as useWizard, a3 as vRegister } from './shared/attaform.CHlJLAiv.mjs';
5
- import { F as FormKey, ar as SchemaFactoryOptions, A as AbstractSchema, o as FieldMetaPayload } from './shared/attaform.DniawQLP.mjs';
6
- 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, D as DefaultValuesInput, i as DefaultValuesResponse, j as DefaultValuesShape, k as DisplayCtx, l as DisplayMachine, m as DisplayState, E as ErrorInput, n as ErrorsProxyShape, p as FieldState, q as FieldStateMap, r as FieldStateMapEntry, s as FlatPath, t as FormErrorRecord, u as FormErrorsSurface, v as FormMeta, G as GenericForm, w as GetDisplayState, H as HandleSubmit, x as HistoryConfig, 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 PartialFlatPath, S as Path, T as PathKey, V as PendingValidationStatus, W as Primitive, X as ROOT_PATH, Y as ROOT_PATH_KEY, Z as ReactiveValidationStatus, _ as RegisterDirective, $ as RegisterFlatPath, a0 as RegisterOptions, a1 as RegisterSelectModifier, a2 as RegisterTextModifier, a3 as RegisterTransform, a4 as RegisterValue, a5 as Segment, a6 as SetValueCallback, a7 as SetValuePayload, a8 as SettledValidationStatus, a9 as SlimPrimitiveKind, aa as SlimRuntimeOf, ab as SubmitHandler, ac as Unset, U as UseFormConfiguration, a as UseFormReturnType, ad as ValidateOn, ae as ValidateOnConfig, af as ValidationError, ag as ValidationResponse, ah as ValidationResponseWithoutValue, ai as ValueOfUnion, aj as WriteMeta, ak as WriteShape, al as canonicalizePath, am as isPathPrefix, an as isUnset, ao as parseDottedPath, ap as unset } from './shared/attaform.DniawQLP.mjs';
1
+ import { S as SupportedRootSchema } from './shared/attaform.CIWLMY-R.mjs';
2
+ export { P as PathInput, a as PathOutput, u as useForm } from './shared/attaform.CIWLMY-R.mjs';
3
+ export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, 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';
4
+ import { F as FormKey, au as SchemaFactoryOptions, o as FieldMetaPayload } from './shared/attaform.CsoeRi3P.mjs';
5
+ import { AbstractSchema } from './abstract.mjs';
6
+ 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, D as DefaultValuesInput, i as DefaultValuesResponse, j as DefaultValuesShape, k as DisplayCtx, l as DisplayMachine, m as DisplayState, E as ErrorInput, n as ErrorsProxyShape, p as FieldState, q as FieldStateMap, r as FieldStateMapEntry, s as FlatPath, t as FormErrorRecord, u as FormErrorsSurface, v as FormMeta, G as GenericForm, 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, U as UseFormConfiguration, a as UseFormReturnType, 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';
7
+ export { v as vRegister } from './shared/attaform.axHXVQO7.mjs';
7
8
  import { z } from 'zod';
8
9
  import 'vue';
9
10
 
@@ -21,28 +22,15 @@ import 'vue';
21
22
  * downstream walk so a per-form override can lift the cap without
22
23
  * touching the app-level default.
23
24
  *
24
- * Throws if the schema isn't Zod v4 or contains kinds the adapter
25
- * cannot represent (`z.promise`, `z.custom`, `z.templateLiteral`).
26
- * Recursive `z.lazy(...)` is supported — the runtime walks bound their
27
- * descent via `maxRecursionDepth`.
25
+ * Throws if the schema isn't Zod v4, or if its root is not a shape
26
+ * that can hold keys. No kind is refused anywhere BELOW the root: a
27
+ * leaf the walkers have no case for is carried opaquely rather than
28
+ * rejected, so a schema a newer Zod can parse is one Attaform can
29
+ * mount. Recursive `z.lazy(...)` is supported — the runtime walks
30
+ * bound their descent via `maxRecursionDepth`.
28
31
  */
29
32
  declare function zodV4Adapter<FormSchema extends SupportedRootSchema, Form extends z.input<FormSchema>, GetValueFormType extends z.output<FormSchema> = z.output<FormSchema>>(rootSchema: FormSchema): (formKey: FormKey, options: SchemaFactoryOptions) => AbstractSchema<Form, GetValueFormType>;
30
33
 
31
- /**
32
- * Thrown when a Zod schema includes a kind the form library cannot
33
- * represent: `z.promise`, `z.custom`, or `z.templateLiteral`.
34
- *
35
- * The error message includes the dotted path of the offending node
36
- * so you can locate it without traversing the whole schema.
37
- *
38
- * Recursive `z.lazy(...)` is supported, not unsupported: the
39
- * construction-time walk stops descending on the second encounter
40
- * of the same getter, and downstream walks cap their descent via
41
- * `maxRecursionDepth`.
42
- */
43
- declare class UnsupportedSchemaError extends AttaformError {
44
- }
45
-
46
34
  /**
47
35
  * The single file that reads Zod v4's internal `def` shape. Every other
48
36
  * file in the zod-v4 adapter uses these public-shaped accessors — future
@@ -148,6 +136,11 @@ type ZodFieldMetaRegistry = ReturnType<typeof z.registry<FieldMetaPayload>>;
148
136
  * `schema.register(fieldMeta, payload)` chains type-check at the call
149
137
  * site — Zod 4's `.register()` only calls `.add(this, payload)`
150
138
  * structurally, so the cast is sound at runtime.
139
+ *
140
+ * Backed by `installingFieldMetaStore`: every `add` also installs the
141
+ * path-walking resolver into the shared store's builder slot, so the
142
+ * walk's bytes ride this module's import instead of the adapter. A
143
+ * consumer that never registers metadata never ships the walk.
151
144
  */
152
145
  declare const fieldMeta: ZodFieldMetaRegistry;
153
146
  /**
@@ -168,5 +161,5 @@ declare const fieldMeta: ZodFieldMetaRegistry;
168
161
  */
169
162
  declare function withMeta<S extends z.ZodType>(schema: S, payload: FieldMetaPayload): S;
170
163
 
171
- export { AttaformError, FieldMetaPayload, FormKey, UnsupportedSchemaError, assertZodVersion, fieldMeta, kindOf, withMeta, zodV4Adapter as zodAdapter };
164
+ export { FieldMetaPayload, FormKey, assertZodVersion, fieldMeta, kindOf, withMeta, zodV4Adapter as zodAdapter };
172
165
  export type { ZodKind };
package/dist/zod-v4.mjs CHANGED
@@ -1,5 +1,17 @@
1
- export { U as UnsupportedSchemaError, a as assertZodVersion, f as fieldMeta, k as kindOf, u as useForm, w as withMeta, z as zodAdapter } from './shared/attaform.DMxM2kol.mjs';
2
- export { A as AttaformError, D as DEVTOOLS_WINDOW_KEY, 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 assignKey, f as canonicalizePath, g as createAttaform, h as createRegistry, i as getRegistryFromApp, j as hydrateAttaformState, k as isPathPrefix, l as kAttaformRegistry, p as parseDottedPath, r as renderAttaformState, u as useRegistry, v as vRegister } from './shared/attaform.nMaz2C5P.mjs';
3
- 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.CKH2lGdL.mjs';
1
+ export { a as assertZodVersion, k as kindOf, u as useForm, z as zodAdapter } from './shared/attaform.C2MVyuxC.mjs';
2
+ import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.B0dKL8ST.mjs';
3
+ export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform.CZYt_5N_.mjs';
4
+ 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.CZMAYwSK.mjs';
5
+ export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.D0x-qSXm.mjs';
6
+ export { a as assignKey, v as vRegister } from './shared/attaform.DffRL5pP.mjs';
4
7
  export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
5
- //# sourceMappingURL=zod-v4.mjs.map
8
+
9
+ const fieldMeta = installingFieldMetaStore;
10
+ function withMeta(schema, payload) {
11
+ const existing = getFieldMetaForSchema(schema) ?? {};
12
+ const cloned = schema.clone();
13
+ installingFieldMetaStore.add(cloned, { ...existing, ...payload });
14
+ return cloned;
15
+ }
16
+
17
+ export { fieldMeta, withMeta };
package/dist/zod.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as 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 UseRegisterReturn, o as UseWizardReturnType, W as WizardAggregateError, p as WizardCtx, q as WizardCtxForm, r as WizardOnError, s as WizardOnSubmit, t as WizardOptions, u as WizardPersistFn, v as WizardRestoreFn, w as WizardRestoreState, x as WizardStatusesProxy, y as WizardSubmitContext, z as assignKey, B as createAttaform, E as createRegistry, H as defaultCoercionRules, J as defaultDisplayState, K as defineCoercion, M as escapeForInlineScript, N as gate, P as getRegistryFromApp, Q as hydrateAttaformState, T as injectForm, V as injectWizard, X as isRegisterValue, Y as kAttaformRegistry, Z as lazy, _ as makeDefaultDisplayState, $ as renderAttaformState, a0 as useRegister, a1 as useRegistry, a2 as useWizard, a3 as vRegister } from './shared/attaform.CHlJLAiv.mjs';
2
- 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, D as DefaultValuesInput, 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, F as FormKey, v as FormMeta, G as GenericForm, w as GetDisplayState, H as HandleSubmit, x as HistoryConfig, 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 PartialFlatPath, S as Path, T as PathKey, V as PendingValidationStatus, W as Primitive, X as ROOT_PATH, Y as ROOT_PATH_KEY, Z as ReactiveValidationStatus, _ as RegisterDirective, $ as RegisterFlatPath, a0 as RegisterOptions, a1 as RegisterSelectModifier, a2 as RegisterTextModifier, a3 as RegisterTransform, a4 as RegisterValue, a5 as Segment, a6 as SetValueCallback, a7 as SetValuePayload, a8 as SettledValidationStatus, a9 as SlimPrimitiveKind, aa as SlimRuntimeOf, ab as SubmitHandler, ac as Unset, U as UseFormConfiguration, a as UseFormReturnType, ad as ValidateOn, ae as ValidateOnConfig, af as ValidationError, ag as ValidationResponse, ah as ValidationResponseWithoutValue, ai as ValueOfUnion, aj as WriteMeta, ak as WriteShape, al as canonicalizePath, am as isPathPrefix, an as isUnset, ao as parseDottedPath, ap as unset } from './shared/attaform.DniawQLP.mjs';
1
+ export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as 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';
2
+ 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, D as DefaultValuesInput, 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, F as FormKey, v as FormMeta, G as GenericForm, 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, U as UseFormConfiguration, a as UseFormReturnType, 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';
3
+ export { v as vRegister } from './shared/attaform.axHXVQO7.mjs';
3
4
  export { UseFormConfig, UseFormConfigV3, UseFormConfigV4, UseFormReturn, UseFormReturnV3, UseFormReturnV4, fieldMeta, useForm, withMeta } from './index.mjs';
4
- export { P as PathInput, a as PathOutput } from './shared/attaform.DLknk9nF.mjs';
5
+ export { P as PathInput, a as PathOutput } from './shared/attaform.CIWLMY-R.mjs';
5
6
  import 'vue';
6
7
  import './shared/attaform.DRUT703x.mjs';
7
8
  import 'zod';
package/dist/zod.mjs CHANGED
@@ -1,5 +1,6 @@
1
- export { A as AttaformError, D as DEVTOOLS_WINDOW_KEY, 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 assignKey, f as canonicalizePath, g as createAttaform, h as createRegistry, i as getRegistryFromApp, j as hydrateAttaformState, k as isPathPrefix, l as kAttaformRegistry, p as parseDottedPath, r as renderAttaformState, u as useRegistry, v as vRegister } from './shared/attaform.nMaz2C5P.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.CKH2lGdL.mjs';
3
- export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.DYEr28Pt.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.CZYt_5N_.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.CZMAYwSK.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
+ export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.BndjUUYX.mjs';
4
6
  export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
5
- //# sourceMappingURL=zod.mjs.map