attaform 0.24.0 → 0.24.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 (83) hide show
  1. package/dist/chunks/devtools.cjs +1 -1
  2. package/dist/chunks/devtools.mjs +1 -1
  3. package/dist/chunks/fingerprint2.cjs +1 -1
  4. package/dist/chunks/fingerprint2.mjs +1 -1
  5. package/dist/index.cjs +5 -4
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +4 -4
  8. package/dist/index.d.mts +4 -4
  9. package/dist/index.d.ts +4 -4
  10. package/dist/index.mjs +4 -3
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/nuxt.d.cts +1 -1
  13. package/dist/nuxt.d.mts +1 -1
  14. package/dist/nuxt.d.ts +1 -1
  15. package/dist/runtime/plugins/attaform.cjs +2 -2
  16. package/dist/runtime/plugins/attaform.mjs +2 -2
  17. package/dist/shared/{attaform.CAWKNCzc.mjs → attaform.0-00cYGw.mjs} +2 -2
  18. package/dist/shared/{attaform.CAWKNCzc.mjs.map → attaform.0-00cYGw.mjs.map} +1 -1
  19. package/dist/shared/{attaform.BNmkKz0q.d.mts → attaform.4zesozTg.d.mts} +1 -1
  20. package/dist/shared/{attaform.DwkU0oY9.cjs → attaform.B7UdTs_o.cjs} +79 -75
  21. package/dist/shared/attaform.B7UdTs_o.cjs.map +1 -0
  22. package/dist/shared/{attaform.nycEksJn.cjs → attaform.BOi6n2Pn.cjs} +2 -2
  23. package/dist/shared/{attaform.nycEksJn.cjs.map → attaform.BOi6n2Pn.cjs.map} +1 -1
  24. package/dist/shared/{attaform.K-3glmiT.d.cts → attaform.Bk7vnQhG.d.cts} +1 -1
  25. package/dist/shared/{attaform.C6eE50re.d.ts → attaform.Bq6Copxn.d.cts} +24 -15
  26. package/dist/shared/{attaform.DdUYEhkV.d.cts → attaform.BrFPMFgi.d.ts} +24 -15
  27. package/dist/shared/{attaform.C-dAB90u.mjs → attaform.BunnTiTw.mjs} +4 -4
  28. package/dist/shared/{attaform.C-dAB90u.mjs.map → attaform.BunnTiTw.mjs.map} +1 -1
  29. package/dist/shared/{attaform.DiWNbKWa.d.mts → attaform.BwAcpoRw.d.mts} +24 -15
  30. package/dist/shared/{attaform.BV_HyaMO.cjs → attaform.C-1W0T1n.cjs} +3 -3
  31. package/dist/shared/{attaform.BV_HyaMO.cjs.map → attaform.C-1W0T1n.cjs.map} +1 -1
  32. package/dist/shared/{attaform.o95Kjd3U.mjs → attaform.C-tQKknW.mjs} +3 -3
  33. package/dist/shared/{attaform.o95Kjd3U.mjs.map → attaform.C-tQKknW.mjs.map} +1 -1
  34. package/dist/shared/{attaform.Df-s8j1X.mjs → attaform.C0au8oXd.mjs} +36 -29
  35. package/dist/shared/attaform.C0au8oXd.mjs.map +1 -0
  36. package/dist/shared/attaform.CjdepGnw.cjs +27 -0
  37. package/dist/shared/attaform.CjdepGnw.cjs.map +1 -0
  38. package/dist/shared/{attaform.Z1qTwOYE.cjs → attaform.Cn6JoG9o.cjs} +4 -4
  39. package/dist/shared/{attaform.Z1qTwOYE.cjs.map → attaform.Cn6JoG9o.cjs.map} +1 -1
  40. package/dist/shared/{attaform.BnUXV01g.cjs → attaform.CrrIaHM8.cjs} +4 -4
  41. package/dist/shared/{attaform.BnUXV01g.cjs.map → attaform.CrrIaHM8.cjs.map} +1 -1
  42. package/dist/shared/{attaform.GJbSmwLB.d.ts → attaform.DBhrKb2j.d.cts} +25 -12
  43. package/dist/shared/{attaform.GJbSmwLB.d.cts → attaform.DBhrKb2j.d.mts} +25 -12
  44. package/dist/shared/{attaform.GJbSmwLB.d.mts → attaform.DBhrKb2j.d.ts} +25 -12
  45. package/dist/shared/{attaform.C42wL7EJ.cjs → attaform.DRQjF16I.cjs} +55 -18
  46. package/dist/shared/attaform.DRQjF16I.cjs.map +1 -0
  47. package/dist/shared/{attaform.CwFZGv5-.d.ts → attaform.Df4xXKbE.d.ts} +1 -1
  48. package/dist/shared/{attaform.BFWb6hDk.mjs → attaform.DhXl0Kdr.mjs} +7 -1
  49. package/dist/shared/attaform.DhXl0Kdr.mjs.map +1 -0
  50. package/dist/shared/{attaform.CR6wGvNu.cjs → attaform.DwLw3Kzv.cjs} +7 -1
  51. package/dist/shared/attaform.DwLw3Kzv.cjs.map +1 -0
  52. package/dist/shared/{attaform.BJ_W7q3U.mjs → attaform.FY5r1BpA.mjs} +4 -4
  53. package/dist/shared/{attaform.BJ_W7q3U.mjs.map → attaform.FY5r1BpA.mjs.map} +1 -1
  54. package/dist/shared/{attaform.CuBdtfbe.mjs → attaform.NWrEGrNo.mjs} +53 -16
  55. package/dist/shared/attaform.NWrEGrNo.mjs.map +1 -0
  56. package/dist/shared/attaform.WvcckZMD.mjs +21 -0
  57. package/dist/shared/attaform.WvcckZMD.mjs.map +1 -0
  58. package/dist/transforms.cjs +1 -1
  59. package/dist/transforms.mjs +1 -1
  60. package/dist/vite.cjs +1 -1
  61. package/dist/vite.mjs +1 -1
  62. package/dist/zod-v3.cjs +2 -2
  63. package/dist/zod-v3.d.cts +3 -3
  64. package/dist/zod-v3.d.mts +3 -3
  65. package/dist/zod-v3.d.ts +3 -3
  66. package/dist/zod-v3.mjs +2 -2
  67. package/dist/zod-v4.cjs +2 -2
  68. package/dist/zod-v4.d.cts +5 -5
  69. package/dist/zod-v4.d.mts +5 -5
  70. package/dist/zod-v4.d.ts +5 -5
  71. package/dist/zod-v4.mjs +2 -2
  72. package/dist/zod.cjs +5 -5
  73. package/dist/zod.d.cts +5 -5
  74. package/dist/zod.d.mts +5 -5
  75. package/dist/zod.d.ts +5 -5
  76. package/dist/zod.mjs +5 -5
  77. package/package.json +1 -1
  78. package/dist/shared/attaform.BFWb6hDk.mjs.map +0 -1
  79. package/dist/shared/attaform.C42wL7EJ.cjs.map +0 -1
  80. package/dist/shared/attaform.CR6wGvNu.cjs.map +0 -1
  81. package/dist/shared/attaform.CuBdtfbe.mjs.map +0 -1
  82. package/dist/shared/attaform.Df-s8j1X.mjs.map +0 -1
  83. package/dist/shared/attaform.DwkU0oY9.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"attaform.nycEksJn.cjs","sources":["../../src/runtime/core/serialize.ts","../../src/runtime/core/devtools-shared.ts"],"sourcesContent":["import type { App } from 'vue'\nimport type { FormKey } from '../types/types-api'\nimport { pathKeyToDotted, type PathKey } from './paths'\nimport { getRegistryFromApp, type SerializedFormData } from './registry'\n\n/**\n * Serialised snapshot of every form in a Vue app, produced by\n * `renderAttaformState` and consumed by `hydrateAttaformState`.\n *\n * JSON-safe — pass to `JSON.stringify`, `devalue`, or any other\n * serialiser before embedding in your SSR payload.\n */\nexport type SerializedAttaformState = {\n /** Tuples of `[formKey, snapshot]` for every form in the app. */\n readonly forms: ReadonlyArray<readonly [FormKey, SerializedFormData]>\n}\n\n/**\n * Snapshot every form on a Vue app for SSR. Call from your server\n * entry after rendering the app:\n *\n * ```ts\n * import { renderToString } from '@vue/server-renderer'\n * import { renderAttaformState, escapeForInlineScript } from 'attaform'\n *\n * const html = await renderToString(app)\n * const state = renderAttaformState(app)\n * const payload = escapeForInlineScript(JSON.stringify(state))\n *\n * return `\n * ${html}\n * <script>window.__ATTAFORM_STATE__ = ${payload}</script>\n * `\n * ```\n *\n * Pair with `hydrateAttaformState` on the client to restore the\n * forms in their server-rendered state. Nuxt users don't need this —\n * `attaform/nuxt` wires SSR automatically.\n */\nexport function renderAttaformState(app: App): SerializedAttaformState {\n const registry = getRegistryFromApp(app)\n const forms: Array<readonly [FormKey, SerializedFormData]> = []\n for (const [key, state] of registry.forms) {\n // Skip the blank field when the set is empty so the\n // wire payload stays minimal for forms that don't use it. The\n // optional shape on the consuming side handles the absence\n // cleanly (defaults to \"no blank paths\"). PathKey → dotted at\n // the boundary so the wire shape matches the rest of the\n // public path notation.\n const transientList: string[] = []\n for (const pk of state.blankPaths) {\n const d = pathKeyToDotted(pk as PathKey)\n if (d !== null) transientList.push(d)\n }\n forms.push([\n key,\n {\n form: state.form.value,\n schemaErrors: Array.from(state.schemaErrors.entries()),\n userErrors: Array.from(state.userErrors.entries()),\n fields: Array.from(state.fields.entries()),\n ...(transientList.length > 0 ? { blankPaths: transientList } : {}),\n },\n ])\n }\n return { forms }\n}\n\n/**\n * Restore forms from a server-rendered snapshot on the client. Call\n * from your client entry before mounting:\n *\n * ```ts\n * import { createApp } from 'vue'\n * import { createAttaform, hydrateAttaformState } from 'attaform'\n *\n * const app = createApp(App).use(createAttaform())\n * hydrateAttaformState(app, window.__ATTAFORM_STATE__)\n * app.mount('#app')\n * ```\n *\n * The next `useForm({ key })` call for each serialised form picks up\n * the snapshot transparently — no further action is required.\n */\nexport function hydrateAttaformState(app: App, payload: SerializedAttaformState): void {\n const registry = getRegistryFromApp(app)\n for (const [key, data] of payload.forms) {\n registry.pendingHydration.set(key, data)\n }\n}\n","/**\n * Shared building blocks for Attaform's two devtools surfaces — the Vue\n * DevTools (Chrome-extension) inspector wired up in `./devtools.ts`, and\n * the Nuxt DevTools (overlay) panel wired up via `../../nuxt.ts` +\n * `../pages/_attaform_devtools.vue`.\n *\n * Houses the window-bridge contract both surfaces consume so a new\n * bridge field lands in one file. Both surfaces render RAW form values\n * by design — DevTools is a dev-only surface, and redaction across every\n * place a value surfaces is impractical security theater rather than a\n * real safeguard.\n */\nimport type { AttaformRegistry } from './registry'\n\n/**\n * Property key on `window` that the Nuxt-side dev plugin attaches the\n * bridge object to. The iframe-mounted overlay panel reads\n * `window.parent[DEVTOOLS_WINDOW_KEY]` to reach the host app's registry.\n *\n * Underscored + namespaced to make accidental collision with consumer\n * globals vanishingly unlikely. Stable across versions — bumping it\n * would silently disconnect older library builds from newer overlay\n * panels in the same browser tab during a library upgrade.\n */\nexport const DEVTOOLS_WINDOW_KEY = '__attaform_devtools__'\n\n/**\n * Shape of the object the host plugin attaches to `window` in dev mode.\n * The iframe overlay panel reads this to discover the live registry and\n * render its forms.\n *\n * Single-registry assumption: the latest `createAttaform()` install\n * wins. Multi-app pages (rare; typically only seen in micro-frontend\n * setups) will only see one app's forms in the panel. Documented but\n * not actively supported — the alternative (a Set of registries with\n * union-rendering) is a future call if a real consumer hits it.\n */\nexport interface AttaformDevtoolsBridge {\n registry: AttaformRegistry\n /**\n * The library version, surfaced in the panel's footer for support /\n * bug-report context. Read from `package.json` at host-plugin init.\n */\n version: string\n}\n\ndeclare global {\n interface Window {\n [DEVTOOLS_WINDOW_KEY]?: AttaformDevtoolsBridge\n }\n}\n"],"names":["getRegistryFromApp","pathKeyToDotted"],"mappings":";;;;AAuCO,SAAS,oBAAoB,GAAA,EAAmC;AACrE,EAAA,MAAM,QAAA,GAAWA,yBAAmB,GAAG,CAAA;AACvC,EAAA,MAAM,QAAuD,EAAC;AAC9D,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,CAAA,IAAK,SAAS,KAAA,EAAO;AAOzC,IAAA,MAAM,gBAA0B,EAAC;AACjC,IAAA,KAAA,MAAW,EAAA,IAAM,MAAM,UAAA,EAAY;AACjC,MAAA,MAAM,CAAA,GAAIC,sBAAgB,EAAa,CAAA;AACvC,MAAA,IAAI,CAAA,KAAM,IAAA,EAAM,aAAA,CAAc,IAAA,CAAK,CAAC,CAAA;AAAA,IACtC;AACA,IAAA,KAAA,CAAM,IAAA,CAAK;AAAA,MACT,GAAA;AAAA,MACA;AAAA,QACE,IAAA,EAAM,MAAM,IAAA,CAAK,KAAA;AAAA,QACjB,cAAc,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,YAAA,CAAa,SAAS,CAAA;AAAA,QACrD,YAAY,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,SAAS,CAAA;AAAA,QACjD,QAAQ,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,SAAS,CAAA;AAAA,QACzC,GAAI,cAAc,MAAA,GAAS,CAAA,GAAI,EAAE,UAAA,EAAY,aAAA,KAAkB;AAAC;AAClE,KACD,CAAA;AAAA,EACH;AACA,EAAA,OAAO,EAAE,KAAA,EAAM;AACjB;AAkBO,SAAS,oBAAA,CAAqB,KAAU,OAAA,EAAwC;AACrF,EAAA,MAAM,QAAA,GAAWD,yBAAmB,GAAG,CAAA;AACvC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,IAAI,CAAA,IAAK,QAAQ,KAAA,EAAO;AACvC,IAAA,QAAA,CAAS,gBAAA,CAAiB,GAAA,CAAI,GAAA,EAAK,IAAI,CAAA;AAAA,EACzC;AACF;;ACjEO,MAAM,mBAAA,GAAsB;;;;;;"}
1
+ {"version":3,"file":"attaform.BOi6n2Pn.cjs","sources":["../../src/runtime/core/serialize.ts","../../src/runtime/core/devtools-shared.ts"],"sourcesContent":["import type { App } from 'vue'\nimport type { FormKey } from '../types/types-api'\nimport { pathKeyToDotted, type PathKey } from './paths'\nimport { getRegistryFromApp, type SerializedFormData } from './registry'\n\n/**\n * Serialised snapshot of every form in a Vue app, produced by\n * `renderAttaformState` and consumed by `hydrateAttaformState`.\n *\n * JSON-safe — pass to `JSON.stringify`, `devalue`, or any other\n * serialiser before embedding in your SSR payload.\n */\nexport type SerializedAttaformState = {\n /** Tuples of `[formKey, snapshot]` for every form in the app. */\n readonly forms: ReadonlyArray<readonly [FormKey, SerializedFormData]>\n}\n\n/**\n * Snapshot every form on a Vue app for SSR. Call from your server\n * entry after rendering the app:\n *\n * ```ts\n * import { renderToString } from '@vue/server-renderer'\n * import { renderAttaformState, escapeForInlineScript } from 'attaform'\n *\n * const html = await renderToString(app)\n * const state = renderAttaformState(app)\n * const payload = escapeForInlineScript(JSON.stringify(state))\n *\n * return `\n * ${html}\n * <script>window.__ATTAFORM_STATE__ = ${payload}</script>\n * `\n * ```\n *\n * Pair with `hydrateAttaformState` on the client to restore the\n * forms in their server-rendered state. Nuxt users don't need this —\n * `attaform/nuxt` wires SSR automatically.\n */\nexport function renderAttaformState(app: App): SerializedAttaformState {\n const registry = getRegistryFromApp(app)\n const forms: Array<readonly [FormKey, SerializedFormData]> = []\n for (const [key, state] of registry.forms) {\n // Skip the blank field when the set is empty so the\n // wire payload stays minimal for forms that don't use it. The\n // optional shape on the consuming side handles the absence\n // cleanly (defaults to \"no blank paths\"). PathKey → dotted at\n // the boundary so the wire shape matches the rest of the\n // public path notation.\n const transientList: string[] = []\n for (const pk of state.blankPaths) {\n const d = pathKeyToDotted(pk as PathKey)\n if (d !== null) transientList.push(d)\n }\n forms.push([\n key,\n {\n form: state.form.value,\n schemaErrors: Array.from(state.schemaErrors.entries()),\n userErrors: Array.from(state.userErrors.entries()),\n fields: Array.from(state.fields.entries()),\n ...(transientList.length > 0 ? { blankPaths: transientList } : {}),\n },\n ])\n }\n return { forms }\n}\n\n/**\n * Restore forms from a server-rendered snapshot on the client. Call\n * from your client entry before mounting:\n *\n * ```ts\n * import { createApp } from 'vue'\n * import { createAttaform, hydrateAttaformState } from 'attaform'\n *\n * const app = createApp(App).use(createAttaform())\n * hydrateAttaformState(app, window.__ATTAFORM_STATE__)\n * app.mount('#app')\n * ```\n *\n * The next `useForm({ key })` call for each serialised form picks up\n * the snapshot transparently — no further action is required.\n */\nexport function hydrateAttaformState(app: App, payload: SerializedAttaformState): void {\n const registry = getRegistryFromApp(app)\n for (const [key, data] of payload.forms) {\n registry.pendingHydration.set(key, data)\n }\n}\n","/**\n * Shared building blocks for Attaform's two devtools surfaces — the Vue\n * DevTools (Chrome-extension) inspector wired up in `./devtools.ts`, and\n * the Nuxt DevTools (overlay) panel wired up via `../../nuxt.ts` +\n * `../pages/_attaform_devtools.vue`.\n *\n * Houses the window-bridge contract both surfaces consume so a new\n * bridge field lands in one file. Both surfaces render RAW form values\n * by design — DevTools is a dev-only surface, and redaction across every\n * place a value surfaces is impractical security theater rather than a\n * real safeguard.\n */\nimport type { AttaformRegistry } from './registry'\n\n/**\n * Property key on `window` that the Nuxt-side dev plugin attaches the\n * bridge object to. The iframe-mounted overlay panel reads\n * `window.parent[DEVTOOLS_WINDOW_KEY]` to reach the host app's registry.\n *\n * Underscored + namespaced to make accidental collision with consumer\n * globals vanishingly unlikely. Stable across versions — bumping it\n * would silently disconnect older library builds from newer overlay\n * panels in the same browser tab during a library upgrade.\n */\nexport const DEVTOOLS_WINDOW_KEY = '__attaform_devtools__'\n\n/**\n * Shape of the object the host plugin attaches to `window` in dev mode.\n * The iframe overlay panel reads this to discover the live registry and\n * render its forms.\n *\n * Single-registry assumption: the latest `createAttaform()` install\n * wins. Multi-app pages (rare; typically only seen in micro-frontend\n * setups) will only see one app's forms in the panel. Documented but\n * not actively supported — the alternative (a Set of registries with\n * union-rendering) is a future call if a real consumer hits it.\n */\nexport interface AttaformDevtoolsBridge {\n registry: AttaformRegistry\n /**\n * The library version, surfaced in the panel's footer for support /\n * bug-report context. Read from `package.json` at host-plugin init.\n */\n version: string\n}\n\ndeclare global {\n interface Window {\n [DEVTOOLS_WINDOW_KEY]?: AttaformDevtoolsBridge\n }\n}\n"],"names":["getRegistryFromApp","pathKeyToDotted"],"mappings":";;;;AAuCO,SAAS,oBAAoB,GAAA,EAAmC;AACrE,EAAA,MAAM,QAAA,GAAWA,yBAAmB,GAAG,CAAA;AACvC,EAAA,MAAM,QAAuD,EAAC;AAC9D,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,CAAA,IAAK,SAAS,KAAA,EAAO;AAOzC,IAAA,MAAM,gBAA0B,EAAC;AACjC,IAAA,KAAA,MAAW,EAAA,IAAM,MAAM,UAAA,EAAY;AACjC,MAAA,MAAM,CAAA,GAAIC,sBAAgB,EAAa,CAAA;AACvC,MAAA,IAAI,CAAA,KAAM,IAAA,EAAM,aAAA,CAAc,IAAA,CAAK,CAAC,CAAA;AAAA,IACtC;AACA,IAAA,KAAA,CAAM,IAAA,CAAK;AAAA,MACT,GAAA;AAAA,MACA;AAAA,QACE,IAAA,EAAM,MAAM,IAAA,CAAK,KAAA;AAAA,QACjB,cAAc,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,YAAA,CAAa,SAAS,CAAA;AAAA,QACrD,YAAY,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,SAAS,CAAA;AAAA,QACjD,QAAQ,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,SAAS,CAAA;AAAA,QACzC,GAAI,cAAc,MAAA,GAAS,CAAA,GAAI,EAAE,UAAA,EAAY,aAAA,KAAkB;AAAC;AAClE,KACD,CAAA;AAAA,EACH;AACA,EAAA,OAAO,EAAE,KAAA,EAAM;AACjB;AAkBO,SAAS,oBAAA,CAAqB,KAAU,OAAA,EAAwC;AACrF,EAAA,MAAM,QAAA,GAAWD,yBAAmB,GAAG,CAAA;AACvC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,IAAI,CAAA,IAAK,QAAQ,KAAA,EAAO;AACvC,IAAA,QAAA,CAAS,gBAAA,CAAiB,GAAA,CAAI,GAAA,EAAK,IAAI,CAAA;AAAA,EACzC;AACF;;ACjEO,MAAM,mBAAA,GAAsB;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { G as GenericForm, u as FlatPath, O as NestedType, F as FormKey, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, af as ValidateOnConfig, b as UseFormReturnType } from './attaform.GJbSmwLB.cjs';
2
+ import { G as GenericForm, u as FlatPath, O as NestedType, F as FormKey, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, af as ValidateOnConfig, b as UseFormReturnType } from './attaform.DBhrKb2j.cjs';
3
3
 
4
4
  /**
5
5
  * The shape `form.values.<key>` returns at runtime.
@@ -1,4 +1,4 @@
1
- import { F as FormKey, W as PathKey, m as DisplayCtx, d as GetDisplayState, n as DisplayMachine, V as Path, aa as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, ag as ValidationError, a as AbstractSchema, ak as WriteMeta, j as DeepPartial, al as WriteShape, as as TransformAbortHolder, ae as ValidateOn, A as AttaformDefaults, b as UseFormReturnType, c as RegisterValue } from './attaform.GJbSmwLB.js';
1
+ import { F as FormKey, W as PathKey, m as DisplayCtx, d as GetDisplayState, n as DisplayMachine, V as Path, aa as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, ag as ValidationError, a as AbstractSchema, ak as WriteMeta, j as DeepPartial, al as WriteShape, as as TransformAbortHolder, ae as ValidateOn, A as AttaformDefaults, b as UseFormReturnType, c as RegisterValue } from './attaform.DBhrKb2j.cjs';
2
2
  import { Ref, ComputedRef, App, InjectionKey } from 'vue';
3
3
 
4
4
  /**
@@ -209,9 +209,11 @@ type WizardSubmitContext = {
209
209
  type WizardOnSubmit = (ctx: WizardSubmitContext) => void | Promise<void>;
210
210
  /**
211
211
  * Optional `onError` callback registered via `wizard.handleSubmit`.
212
- * Receives the aggregate error list entries originate from per-form
213
- * validation and activation failures (`atta:activation-failed`). Sync
214
- * or async; the returned promise gates `wizard.submitting`.
212
+ * Receives the aggregate error list. Entries originate from per-form
213
+ * validation, activation failures (`atta:activation-failed`), and a
214
+ * submit callback that left errors on a processed step (the
215
+ * `setErrors(...); return` server-rejection path). Sync or async; the
216
+ * returned promise gates `wizard.submitting`.
215
217
  */
216
218
  type WizardOnError = (errors: readonly WizardAggregateError[]) => void | Promise<void>;
217
219
  /**
@@ -402,25 +404,32 @@ type WizardForms<S> = FormsRecordOf<S> & Readonly<Record<FormKey, AnyForm>>;
402
404
  * Forward-looking; reactive to current form
403
405
  * validity. Gates "Finish button enable" style UI.
404
406
  * - `done` — monotonic latch: flips `true` the first time a
405
- * final-step `handleSubmit` resolves without
406
- * throwing, and stays `true` through subsequent
407
- * edits or invalidations. Only `reset()` flips it
408
- * back. Gates "show success card" style UI that
409
- * should reflect submission history rather than
410
- * current validity.
407
+ * final-step `handleSubmit` resolves without throwing
408
+ * AND leaves no errors set on any step, and stays
409
+ * `true` through subsequent edits or invalidations. A
410
+ * callback that calls `setErrors` and returns (the
411
+ * documented server-rejection path) is a failed submit,
412
+ * so it does not flip `done`. Only `reset()` flips it
413
+ * back. Gates "show success card" style UI that should
414
+ * reflect submission history rather than current
415
+ * validity.
411
416
  * - `submitting` — `true` while a `wizard.handleSubmit` call is in
412
417
  * flight. Global re-entrance guard: every
413
418
  * navigation method also refuses while this is on.
414
419
  * - `submissionAttempts` — count of `wizard.handleSubmit` invocations
415
420
  * (success or failure). Always bumps, including on
416
421
  * noop-form steps.
417
- * - `submitError` — the error thrown by the most recent
422
+ * - `submitError` — the error THROWN by the most recent
418
423
  * `wizard.handleSubmit` callback (or its `onError`),
419
424
  * coerced to a real `Error`. Mirrors
420
- * `form.meta.submitError`: cleared at submit entry and
421
- * by `reset()`, parked here rather than re-thrown, so
422
- * the handler resolves and never manufactures a
423
- * `window` unhandledrejection. `null` on success.
425
+ * `form.meta.submitError`: this is the unexpected-throw
426
+ * channel, so an expected rejection handled via
427
+ * `setErrors` (no throw) surfaces through the error
428
+ * surface and `onError` instead, leaving this `null`.
429
+ * Cleared at submit entry and by `reset()`, parked here
430
+ * rather than re-thrown, so the handler resolves and
431
+ * never manufactures a `window` unhandledrejection.
432
+ * `null` on success.
424
433
  * - `visited` — append-only breadcrumb of navigated step keys.
425
434
  * `back()` does not pop; the trail is the audit
426
435
  * log, not the back-stack.
@@ -1,4 +1,4 @@
1
- import { F as FormKey, W as PathKey, m as DisplayCtx, d as GetDisplayState, n as DisplayMachine, V as Path, aa as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, ag as ValidationError, a as AbstractSchema, ak as WriteMeta, j as DeepPartial, al as WriteShape, as as TransformAbortHolder, ae as ValidateOn, A as AttaformDefaults, b as UseFormReturnType, c as RegisterValue } from './attaform.GJbSmwLB.cjs';
1
+ import { F as FormKey, W as PathKey, m as DisplayCtx, d as GetDisplayState, n as DisplayMachine, V as Path, aa as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, ag as ValidationError, a as AbstractSchema, ak as WriteMeta, j as DeepPartial, al as WriteShape, as as TransformAbortHolder, ae as ValidateOn, A as AttaformDefaults, b as UseFormReturnType, c as RegisterValue } from './attaform.DBhrKb2j.js';
2
2
  import { Ref, ComputedRef, App, InjectionKey } from 'vue';
3
3
 
4
4
  /**
@@ -209,9 +209,11 @@ type WizardSubmitContext = {
209
209
  type WizardOnSubmit = (ctx: WizardSubmitContext) => void | Promise<void>;
210
210
  /**
211
211
  * Optional `onError` callback registered via `wizard.handleSubmit`.
212
- * Receives the aggregate error list entries originate from per-form
213
- * validation and activation failures (`atta:activation-failed`). Sync
214
- * or async; the returned promise gates `wizard.submitting`.
212
+ * Receives the aggregate error list. Entries originate from per-form
213
+ * validation, activation failures (`atta:activation-failed`), and a
214
+ * submit callback that left errors on a processed step (the
215
+ * `setErrors(...); return` server-rejection path). Sync or async; the
216
+ * returned promise gates `wizard.submitting`.
215
217
  */
216
218
  type WizardOnError = (errors: readonly WizardAggregateError[]) => void | Promise<void>;
217
219
  /**
@@ -402,25 +404,32 @@ type WizardForms<S> = FormsRecordOf<S> & Readonly<Record<FormKey, AnyForm>>;
402
404
  * Forward-looking; reactive to current form
403
405
  * validity. Gates "Finish button enable" style UI.
404
406
  * - `done` — monotonic latch: flips `true` the first time a
405
- * final-step `handleSubmit` resolves without
406
- * throwing, and stays `true` through subsequent
407
- * edits or invalidations. Only `reset()` flips it
408
- * back. Gates "show success card" style UI that
409
- * should reflect submission history rather than
410
- * current validity.
407
+ * final-step `handleSubmit` resolves without throwing
408
+ * AND leaves no errors set on any step, and stays
409
+ * `true` through subsequent edits or invalidations. A
410
+ * callback that calls `setErrors` and returns (the
411
+ * documented server-rejection path) is a failed submit,
412
+ * so it does not flip `done`. Only `reset()` flips it
413
+ * back. Gates "show success card" style UI that should
414
+ * reflect submission history rather than current
415
+ * validity.
411
416
  * - `submitting` — `true` while a `wizard.handleSubmit` call is in
412
417
  * flight. Global re-entrance guard: every
413
418
  * navigation method also refuses while this is on.
414
419
  * - `submissionAttempts` — count of `wizard.handleSubmit` invocations
415
420
  * (success or failure). Always bumps, including on
416
421
  * noop-form steps.
417
- * - `submitError` — the error thrown by the most recent
422
+ * - `submitError` — the error THROWN by the most recent
418
423
  * `wizard.handleSubmit` callback (or its `onError`),
419
424
  * coerced to a real `Error`. Mirrors
420
- * `form.meta.submitError`: cleared at submit entry and
421
- * by `reset()`, parked here rather than re-thrown, so
422
- * the handler resolves and never manufactures a
423
- * `window` unhandledrejection. `null` on success.
425
+ * `form.meta.submitError`: this is the unexpected-throw
426
+ * channel, so an expected rejection handled via
427
+ * `setErrors` (no throw) surfaces through the error
428
+ * surface and `onError` instead, leaving this `null`.
429
+ * Cleared at submit entry and by `reset()`, parked here
430
+ * rather than re-thrown, so the handler resolves and
431
+ * never manufactures a `window` unhandledrejection.
432
+ * `null` on success.
424
433
  * - `visited` — append-only breadcrumb of navigated step keys.
425
434
  * `back()` does not pop; the trail is the audit
426
435
  * log, not the back-stack.
@@ -1,6 +1,6 @@
1
- import { p as getAtPath, n as slimKindOf, q as setAtPath, o as humanize, h as useAbstractForm } from './attaform.CuBdtfbe.mjs';
2
- import { A as AttaformError, _ as __DEV__, f as canonicalizePath, a as InvalidUseFormConfigError } from './attaform.Df-s8j1X.mjs';
3
- import { f as fieldMetaStore, g as getFieldMetaForSchema, a as getFieldMetaListForSchema, s as slimPrimitivesWalk, w as walkPathSegments, d as deriveDefaultWalk, m as mergeDeep, c as createAbstractSchema, b as getFieldMetaPathMap } from './attaform.o95Kjd3U.mjs';
1
+ import { p as getAtPath, n as slimKindOf, q as setAtPath, o as humanize, h as useAbstractForm } from './attaform.NWrEGrNo.mjs';
2
+ import { A as AttaformError, _ as __DEV__, f as canonicalizePath, a as InvalidUseFormConfigError } from './attaform.C0au8oXd.mjs';
3
+ import { f as fieldMetaStore, g as getFieldMetaForSchema, a as getFieldMetaListForSchema, s as slimPrimitivesWalk, w as walkPathSegments, d as deriveDefaultWalk, m as mergeDeep, c as createAbstractSchema, b as getFieldMetaPathMap } from './attaform.C-tQKknW.mjs';
4
4
  import { z } from 'zod';
5
5
 
6
6
  const fieldMeta = fieldMetaStore;
@@ -1272,4 +1272,4 @@ function useForm(configuration) {
1272
1272
  }
1273
1273
 
1274
1274
  export { UnsupportedSchemaError as U, assertZodVersion as a, getIntersectionRight as b, unwrapLazy as c, unwrapInner as d, unwrapPipe as e, fieldMeta as f, getIntersectionLeft as g, getDiscriminator as h, getDiscriminatedOptions as i, getUnionOptions as j, kindOf as k, getRecordKeyType as l, getRecordValueType as m, getTupleItems as n, getSetValueType as o, getArrayElement as p, getObjectShape as q, getEnumValues as r, getLiteralValues as s, getChecks as t, useForm as u, getCatchDefault as v, withMeta as w, getDefaultValue as x, zodV4Adapter as z };
1275
- //# sourceMappingURL=attaform.C-dAB90u.mjs.map
1275
+ //# sourceMappingURL=attaform.BunnTiTw.mjs.map