attaform 0.23.0 → 0.24.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 (85) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/devtools.cjs +1 -1
  3. package/dist/chunks/devtools.mjs +1 -1
  4. package/dist/chunks/fingerprint2.cjs +1 -1
  5. package/dist/chunks/fingerprint2.mjs +1 -1
  6. package/dist/index.cjs +3 -149
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +6 -132
  9. package/dist/index.d.mts +6 -132
  10. package/dist/index.d.ts +6 -132
  11. package/dist/index.mjs +4 -150
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/nuxt.d.cts +1 -1
  14. package/dist/nuxt.d.mts +1 -1
  15. package/dist/nuxt.d.ts +1 -1
  16. package/dist/runtime/components/AttaformDevtoolsPanel.vue +2 -2
  17. package/dist/runtime/plugins/attaform.cjs +2 -2
  18. package/dist/runtime/plugins/attaform.mjs +2 -2
  19. package/dist/shared/{attaform.CzVta5o2.mjs → attaform.BJ_W7q3U.mjs} +8 -6
  20. package/dist/shared/attaform.BJ_W7q3U.mjs.map +1 -0
  21. package/dist/shared/{attaform.D52oJiYC.d.cts → attaform.BNmkKz0q.d.mts} +38 -6
  22. package/dist/shared/{attaform.CaYj3ZfY.cjs → attaform.BV_HyaMO.cjs} +6 -4
  23. package/dist/shared/attaform.BV_HyaMO.cjs.map +1 -0
  24. package/dist/shared/{attaform.Cmb_LCie.cjs → attaform.BnUXV01g.cjs} +4 -4
  25. package/dist/shared/attaform.BnUXV01g.cjs.map +1 -0
  26. package/dist/shared/{attaform.alpG7rT7.mjs → attaform.C-dAB90u.mjs} +4 -4
  27. package/dist/shared/attaform.C-dAB90u.mjs.map +1 -0
  28. package/dist/shared/{attaform.DsQkXE3o.cjs → attaform.C42wL7EJ.cjs} +195 -179
  29. package/dist/shared/attaform.C42wL7EJ.cjs.map +1 -0
  30. package/dist/shared/{attaform.BGMRvckW.d.ts → attaform.C6eE50re.d.ts} +18 -11
  31. package/dist/shared/{attaform.Dx9-QQE2.mjs → attaform.CAWKNCzc.mjs} +2 -2
  32. package/dist/shared/{attaform.Dx9-QQE2.mjs.map → attaform.CAWKNCzc.mjs.map} +1 -1
  33. package/dist/shared/{attaform.CtJOd7ox.mjs → attaform.CuBdtfbe.mjs} +196 -179
  34. package/dist/shared/attaform.CuBdtfbe.mjs.map +1 -0
  35. package/dist/shared/{attaform.WEwfXcHq.d.ts → attaform.CwFZGv5-.d.ts} +38 -6
  36. package/dist/shared/{attaform.DuPneYR0.d.cts → attaform.DdUYEhkV.d.cts} +18 -11
  37. package/dist/shared/attaform.DdjDqTah.d.cts +56 -0
  38. package/dist/shared/attaform.DdjDqTah.d.mts +56 -0
  39. package/dist/shared/attaform.DdjDqTah.d.ts +56 -0
  40. package/dist/shared/{attaform.BhI9Icek.mjs → attaform.Df-s8j1X.mjs} +2 -4
  41. package/dist/shared/attaform.Df-s8j1X.mjs.map +1 -0
  42. package/dist/shared/{attaform.DrY8srOp.d.mts → attaform.DiWNbKWa.d.mts} +18 -11
  43. package/dist/shared/{attaform.Db4E4IW6.cjs → attaform.DwkU0oY9.cjs} +1 -5
  44. package/dist/shared/attaform.DwkU0oY9.cjs.map +1 -0
  45. package/dist/shared/{attaform.BJnNK75Y.d.cts → attaform.GJbSmwLB.d.cts} +181 -156
  46. package/dist/shared/{attaform.BJnNK75Y.d.mts → attaform.GJbSmwLB.d.mts} +181 -156
  47. package/dist/shared/{attaform.BJnNK75Y.d.ts → attaform.GJbSmwLB.d.ts} +181 -156
  48. package/dist/shared/{attaform.DCkSNnPr.d.mts → attaform.K-3glmiT.d.cts} +38 -6
  49. package/dist/shared/{attaform.DbyTD8N2.cjs → attaform.Z1qTwOYE.cjs} +8 -6
  50. package/dist/shared/attaform.Z1qTwOYE.cjs.map +1 -0
  51. package/dist/shared/{attaform.BibT5AS_.cjs → attaform.nycEksJn.cjs} +2 -2
  52. package/dist/shared/{attaform.BibT5AS_.cjs.map → attaform.nycEksJn.cjs.map} +1 -1
  53. package/dist/shared/{attaform.Dd1Kmmaj.mjs → attaform.o95Kjd3U.mjs} +6 -4
  54. package/dist/shared/attaform.o95Kjd3U.mjs.map +1 -0
  55. package/dist/zod-v3.cjs +2 -2
  56. package/dist/zod-v3.d.cts +12 -11
  57. package/dist/zod-v3.d.mts +12 -11
  58. package/dist/zod-v3.d.ts +12 -11
  59. package/dist/zod-v3.mjs +2 -2
  60. package/dist/zod-v4.cjs +2 -2
  61. package/dist/zod-v4.d.cts +6 -5
  62. package/dist/zod-v4.d.mts +6 -5
  63. package/dist/zod-v4.d.ts +6 -5
  64. package/dist/zod-v4.mjs +2 -2
  65. package/dist/zod.cjs +5 -5
  66. package/dist/zod.cjs.map +1 -1
  67. package/dist/zod.d.cts +21 -52
  68. package/dist/zod.d.mts +21 -52
  69. package/dist/zod.d.ts +21 -52
  70. package/dist/zod.mjs +5 -5
  71. package/dist/zod.mjs.map +1 -1
  72. package/package.json +1 -1
  73. package/dist/shared/attaform.BhI9Icek.mjs.map +0 -1
  74. package/dist/shared/attaform.CaYj3ZfY.cjs.map +0 -1
  75. package/dist/shared/attaform.Cmb_LCie.cjs.map +0 -1
  76. package/dist/shared/attaform.CtJOd7ox.mjs.map +0 -1
  77. package/dist/shared/attaform.CzVta5o2.mjs.map +0 -1
  78. package/dist/shared/attaform.Db4E4IW6.cjs.map +0 -1
  79. package/dist/shared/attaform.DbyTD8N2.cjs.map +0 -1
  80. package/dist/shared/attaform.Dd1Kmmaj.mjs.map +0 -1
  81. package/dist/shared/attaform.DsQkXE3o.cjs.map +0 -1
  82. package/dist/shared/attaform.alpG7rT7.mjs.map +0 -1
  83. package/dist/shared/attaform.nf83TIR5.d.cts +0 -35
  84. package/dist/shared/attaform.nf83TIR5.d.mts +0 -35
  85. package/dist/shared/attaform.nf83TIR5.d.ts +0 -35
@@ -1,4 +1,4 @@
1
- import { F as FormKey, Y as PathKey, p as DisplayCtx, d as GetDisplayState, q as DisplayMachine, X as Path, ac as SlimPrimitiveKind, C as CoercionEntry, j as CoercionRegistry, G as GenericForm, V as ValidationError, a as AbstractSchema, al as WriteMeta, m as DeepPartial, am as WriteShape, at as TransformAbortHolder, ag as ValidateOn, A as AttaformDefaults, b as UseFormReturnType, c as RegisterValue } from './attaform.BJnNK75Y.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.GJbSmwLB.js';
2
2
  import { Ref, ComputedRef, App, InjectionKey } from 'vue';
3
3
 
4
4
  /**
@@ -643,12 +643,12 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
643
643
  * Schema-driven errors. Written ONLY by the schema validation pipeline:
644
644
  * `scheduleFieldValidation`, `handleSubmit`, the construction-time seed,
645
645
  * history restore, and hydration. Cleared by `reset` / `resetField` and by
646
- * a successful submit. `setFieldErrors*` APIs do NOT touch this Map.
646
+ * a successful submit. `setErrors` / `clearErrors` do NOT touch this Map.
647
647
  */
648
648
  readonly schemaErrors: Map<PathKey, ValidationError[]>;
649
649
  /**
650
- * User-injected errors. Written ONLY by the `setFieldErrors*` API surfaces
651
- * (and history / hydration replay). Survives schema revalidation and
650
+ * User-injected errors. Written ONLY by the `setErrors` / `clearErrors`
651
+ * API surface (and history / hydration replay). Survives schema revalidation and
652
652
  * successful submits — the consumer owns its lifetime explicitly.
653
653
  */
654
654
  readonly userErrors: Map<PathKey, ValidationError[]>;
@@ -1005,7 +1005,7 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
1005
1005
  */
1006
1006
  applySchemaErrorsForSubtree(path: Path, errors: ValidationError[]): void;
1007
1007
  setAllUserErrors(errors: readonly ValidationError[]): void;
1008
- addUserErrors(errors: readonly ValidationError[]): void;
1008
+ setUserErrorsForPath(path: Path, errors: readonly ValidationError[]): void;
1009
1009
  clearUserErrors(path?: Path): void;
1010
1010
  /**
1011
1011
  * Merged read — returns `[...schemaErrors[path], ...userErrors[path]]`.
@@ -1311,9 +1311,8 @@ type SerializedFormData = {
1311
1311
  */
1312
1312
  readonly schemaErrors: ReadonlyArray<readonly [string, unknown]>;
1313
1313
  /**
1314
- * Errors set explicitly via `setFieldErrors` / `addFieldErrors`
1315
- * (typically from a server response parsed via `parseApiErrors`)
1316
- * at snapshot time. Replayed at hydration; persists across
1314
+ * Errors set explicitly via `setErrors` (typically a server
1315
+ * response) at snapshot time. Replayed at hydration; persists across
1317
1316
  * client-side re-validation.
1318
1317
  */
1319
1318
  readonly userErrors: ReadonlyArray<readonly [string, unknown]>;
@@ -1741,9 +1740,9 @@ declare function lazy<Ctx = WizardCtx>(resolve: (ctx: Ctx) => AnyForm | string |
1741
1740
  * `issue.code` (e.g. `zod:too_small`). No enum here because
1742
1741
  * Zod's code list evolves.
1743
1742
  * - consumer-defined — anything the consumer's backend / app stamps
1744
- * onto a `ValidationError` (via the `parseApiErrors` wire payload
1745
- * or `setFieldErrors` directly). Pick a scope (`api:`, `auth:`,
1746
- * etc.) and stay consistent.
1743
+ * onto a `ValidationError` (a server response handed to `setErrors`,
1744
+ * or a code passed inline). Pick a scope (`api:`, `auth:`, etc.) and
1745
+ * stay consistent.
1747
1746
  *
1748
1747
  * Use these constants in tests and error-routing UI:
1749
1748
  *
@@ -1787,6 +1786,14 @@ declare const AttaformErrorCode: {
1787
1786
  * `form.hydrateError` for retry UX.
1788
1787
  */
1789
1788
  readonly ActivationFailed: "atta:activation-failed";
1789
+ /**
1790
+ * Default code stamped on a manual error set through `form.setErrors`
1791
+ * when the caller omits an explicit `code`. The `setErrors` input is
1792
+ * lenient (`code` optional), so this is the fallback that keeps every
1793
+ * produced `ValidationError` carrying a stable, branchable identifier.
1794
+ * Override it per error by passing your own `code` (`api:…`, `auth:…`).
1795
+ */
1796
+ readonly UserError: "atta:user-error";
1790
1797
  };
1791
1798
  type AttaformErrorCode = (typeof AttaformErrorCode)[keyof typeof AttaformErrorCode];
1792
1799
 
@@ -1,4 +1,4 @@
1
- import { g as getRegistryFromApp, n as pathKeyToDotted } from './attaform.BhI9Icek.mjs';
1
+ import { i as getRegistryFromApp, n as pathKeyToDotted } from './attaform.Df-s8j1X.mjs';
2
2
 
3
3
  function renderAttaformState(app) {
4
4
  const registry = getRegistryFromApp(app);
@@ -32,4 +32,4 @@ function hydrateAttaformState(app, payload) {
32
32
  const DEVTOOLS_WINDOW_KEY = "__attaform_devtools__";
33
33
 
34
34
  export { DEVTOOLS_WINDOW_KEY as D, hydrateAttaformState as h, renderAttaformState as r };
35
- //# sourceMappingURL=attaform.Dx9-QQE2.mjs.map
35
+ //# sourceMappingURL=attaform.CAWKNCzc.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"attaform.Dx9-QQE2.mjs","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":[],"mappings":";;AAuCO,SAAS,oBAAoB,GAAA,EAAmC;AACrE,EAAA,MAAM,QAAA,GAAW,mBAAmB,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,GAAI,gBAAgB,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,GAAW,mBAAmB,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.CAWKNCzc.mjs","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":[],"mappings":";;AAuCO,SAAS,oBAAoB,GAAA,EAAmC;AACrE,EAAA,MAAM,QAAA,GAAW,mBAAmB,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,GAAI,gBAAgB,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,GAAW,mBAAmB,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;;;;"}