attaform 0.30.1 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/abstract.d.mts +5 -5
  2. package/dist/abstract.mjs +3 -3
  3. package/dist/dev/abstract.mjs +3 -3
  4. package/dist/dev/chunks/devtools.mjs +2 -2
  5. package/dist/dev/directive.mjs +1 -1
  6. package/dist/dev/history.mjs +1 -1
  7. package/dist/dev/index.mjs +4 -4
  8. package/dist/dev/runtime/plugins/attaform.mjs +1 -1
  9. package/dist/dev/shared/{attaform-dev.Chm4D6SJ.mjs → attaform-dev.B1q-x9R9.mjs} +2 -2
  10. package/dist/dev/shared/{attaform-dev.BUIFcTYf.mjs → attaform-dev.Caibt7sb.mjs} +11 -10
  11. package/dist/dev/shared/{attaform-dev.CT7MDjPy.mjs → attaform-dev.CtyqGia7.mjs} +152 -227
  12. package/dist/dev/shared/{attaform-dev.BJK1kqHY.mjs → attaform-dev.DJ3nsWw6.mjs} +74 -110
  13. package/dist/dev/shared/{attaform-dev.DuEE4GU1.mjs → attaform-dev.DlaT4xGd.mjs} +3 -3
  14. package/dist/dev/shared/{attaform-dev.BMQ3GcgD.mjs → attaform-dev.k5X47GMD.mjs} +474 -336
  15. package/dist/dev/shared/{attaform-dev.DxHdkkPG.mjs → attaform-dev.y9x9Vp9F.mjs} +206 -127
  16. package/dist/dev/zod-v3.mjs +5 -5
  17. package/dist/dev/zod-v4.mjs +5 -5
  18. package/dist/dev/zod.mjs +4 -4
  19. package/dist/directive.d.mts +2 -2
  20. package/dist/directive.mjs +1 -1
  21. package/dist/history.d.mts +1 -1
  22. package/dist/history.mjs +1 -1
  23. package/dist/index.d.mts +6 -6
  24. package/dist/index.mjs +4 -4
  25. package/dist/runtime/components/AttaformDevtoolsPanel.vue +3 -3
  26. package/dist/runtime/plugins/attaform.mjs +1 -1
  27. package/dist/shared/{attaform.CO918TdU.mjs → attaform.BWUn8Kjy.mjs} +74 -110
  28. package/dist/shared/{attaform.WiGdIqgx.mjs → attaform.C4shmwyJ.mjs} +2 -2
  29. package/dist/shared/{attaform.2FslhB9R.d.mts → attaform.CRVe8s82.d.mts} +1 -1
  30. package/dist/shared/{attaform.L0kUn3vL.d.mts → attaform.D9RqPgGu.d.mts} +1 -1
  31. package/dist/shared/{attaform.BcQwgWaq.d.mts → attaform.DAo0QBmS.d.mts} +28 -8
  32. package/dist/shared/{attaform.ZYn2ahzJ.mjs → attaform.DBCbxlyk.mjs} +59 -1
  33. package/dist/shared/{attaform.DRsANMok.mjs → attaform.DL2nl_QR.mjs} +11 -10
  34. package/dist/shared/{attaform.BIWicztt.mjs → attaform.DNPJPOO7.mjs} +204 -125
  35. package/dist/shared/{attaform.Br8EBn5B.d.mts → attaform.DZnrDrNb.d.mts} +136 -32
  36. package/dist/shared/{attaform.D_f1WgYf.mjs → attaform.DxKQsqFZ.mjs} +456 -318
  37. package/dist/shared/{attaform.B2iebkPA.mjs → attaform.L011tHgJ.mjs} +3 -3
  38. package/dist/shared/{attaform.D_pt1gOj.mjs → attaform.LUPC-2Qg.mjs} +152 -227
  39. package/dist/transforms.mjs +1 -1
  40. package/dist/vite.mjs +1 -1
  41. package/dist/zod-v3.d.mts +4 -4
  42. package/dist/zod-v3.mjs +5 -5
  43. package/dist/zod-v4.d.mts +13 -11
  44. package/dist/zod-v4.mjs +5 -5
  45. package/dist/zod.d.mts +4 -4
  46. package/dist/zod.mjs +4 -4
  47. package/package.json +1 -1
  48. package/skills/attaform/SKILL.md +1 -1
  49. package/skills/attaform/references/custom-components.md +4 -0
package/dist/zod.mjs CHANGED
@@ -1,6 +1,6 @@
1
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.CdZIEf7_.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.BIWicztt.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
- export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.B2iebkPA.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.DNPJPOO7.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.C4shmwyJ.mjs';
4
+ export { a as assignKey, v as vRegister } from './shared/attaform.DxKQsqFZ.mjs';
5
+ export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.L011tHgJ.mjs';
6
6
  export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attaform",
3
- "version": "0.30.1",
3
+ "version": "0.31.0",
4
4
  "types": "./dist/index.d.mts",
5
5
  "files": [
6
6
  "dist",
@@ -119,7 +119,7 @@ Load one when the task reaches its area:
119
119
 
120
120
  - **`references/wizards.md`**: multistep flows. The declarative step registry, `tryNext` vs `handleSubmit`, using a wizard as a flat multi-form coordinator, and how keyed `injectForm` / `injectWizard` resolve.
121
121
  - **`references/errors.md`**: routing server and API errors. The `ValidationError` envelope, `setErrors` / `clearErrors`, the own-vs-subtree error axis, banners, and the one-normalizer pattern.
122
- - **`references/custom-components.md`**: wrapping an input or binding a third-party component. `useRegister`, the three orthogonal primitives, attribute fallthrough, and the optional `form-key` prop.
122
+ - **`references/custom-components.md`**: wrapping an input or binding a third-party component, with its modifiers and live values. `useRegister`, the three orthogonal primitives, attribute fallthrough, and the optional `form-key` prop.
123
123
  - **`references/ssr.md`**: debugging SSR and hydration. Why the value injection is a build-time transform, how to confirm it faithfully, and the test traps to avoid.
124
124
  - **`references/validation.md`**: designing the schema. Client-is-UX / server-is-truth, keeping closed sets in sync, and why a clearable edit field is a required string.
125
125
  - **`references/saving.md`**: persisting each decision as it is made. Choosing between an observing listener and a `watch`, the ordering that makes a listener safe, and the four things a production autosave adds.
@@ -43,6 +43,8 @@ The parent binds with `v-register`; the wrapper re-forwards that same instance a
43
43
 
44
44
  `rv` and `field` may be `undefined` until the parent directive attaches, so defend every read with `?.`. `rv.path`, `rv.segments`, and `rv.formKey` pierce directly in script setup without `.value`.
45
45
 
46
+ Modifiers the parent writes reach the inner control: `<UiTextField v-register.trim="...">` trims at the inner `<input v-register="rv">`. Modifiers on the inner binding still apply, and the two sets combine. Do not add a prop to pass `.trim` or `.lazy` through by hand.
47
+
46
48
  For a **compound** component that binds _multiple_ paths (a date range exposing start and end, an address subform), skip `useRegister` (it assumes a single binding) and reach for `injectForm<Form>()`, then call `form.register(path)` for each field.
47
49
 
48
50
  ## Let Attaform own display and ARIA
@@ -58,6 +60,8 @@ For a **compound** component that binds _multiple_ paths (a date range exposing
58
60
 
59
61
  When the component renders exactly one real form control and forwards attributes to it, that control becomes the field's anchor: focus and blur tracking, ARIA, and the invalid-submit focus target all land on it. A **composite** widget (a PIN input of several boxes) or a **control-less** one (a slider built from `<div>`s) binds too; the directive declines the single-element latch and tracks focus at the widget root instead. Do not reach for an escape hatch on account of either.
60
62
 
63
+ Every value the component writes back follows the native input's rules. `.lazy`, `.trim`, and `.number` work on it (`.lazy` and `.trim` commit when focus leaves the component), and register `transforms` plus schema coercion run on each write, so a text component can back a `z.number()` leaf. A component that reports keystrokes through an `input` emit carrying `{ value }` (PrimeVue `InputNumber`) updates the form as the user types, not only when it commits on blur. None of this needs a `v-model`, an `@update:modelValue` handler, or a `modelModifiers` prop; adding one stacks a second writer.
64
+
61
65
  The one shape that loses the directive half is a component whose root is a **fragment**, because Vue hands a runtime directive only to a single-element root. The value channel still works there; wrap it in an element you control to get the rest back.
62
66
 
63
67
  ## Do not re-declare native attributes as props