attaform 0.20.1 → 0.20.2

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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/devtools.cjs +2 -2
  3. package/dist/chunks/devtools.cjs.map +1 -1
  4. package/dist/chunks/devtools.mjs +2 -2
  5. package/dist/chunks/devtools.mjs.map +1 -1
  6. package/dist/chunks/indexeddb.cjs +1 -1
  7. package/dist/chunks/indexeddb.mjs +1 -1
  8. package/dist/chunks/local-storage.cjs +1 -1
  9. package/dist/chunks/local-storage.mjs +1 -1
  10. package/dist/chunks/session-storage.cjs +1 -1
  11. package/dist/chunks/session-storage.mjs +1 -1
  12. package/dist/index.cjs +3 -3
  13. package/dist/index.d.cts +4 -4
  14. package/dist/index.d.mts +4 -4
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.mjs +5 -5
  17. package/dist/nuxt.d.cts +1 -1
  18. package/dist/nuxt.d.mts +1 -1
  19. package/dist/nuxt.d.ts +1 -1
  20. package/dist/runtime/plugins/attaform.cjs +2 -2
  21. package/dist/runtime/plugins/attaform.mjs +2 -2
  22. package/dist/shared/{attaform.SfhU0OEY.d.cts → attaform.99cfHcIt.d.cts} +26 -9
  23. package/dist/shared/{attaform.SfhU0OEY.d.mts → attaform.99cfHcIt.d.mts} +26 -9
  24. package/dist/shared/{attaform.SfhU0OEY.d.ts → attaform.99cfHcIt.d.ts} +26 -9
  25. package/dist/shared/{attaform.tVkmQh5w.mjs → attaform.BGk8cfw2.mjs} +3 -3
  26. package/dist/shared/{attaform.tVkmQh5w.mjs.map → attaform.BGk8cfw2.mjs.map} +1 -1
  27. package/dist/shared/{attaform.GbDo_lJi.d.cts → attaform.BXinSW2T.d.mts} +1 -1
  28. package/dist/shared/{attaform.DHRWn-cu.cjs → attaform.B_hph5AE.cjs} +3 -3
  29. package/dist/shared/{attaform.DHRWn-cu.cjs.map → attaform.B_hph5AE.cjs.map} +1 -1
  30. package/dist/shared/{attaform.iWo9soNX.mjs → attaform.C5aYC_T8.mjs} +4 -4
  31. package/dist/shared/{attaform.iWo9soNX.mjs.map → attaform.C5aYC_T8.mjs.map} +1 -1
  32. package/dist/shared/{attaform.BrrXNmfK.cjs → attaform.Cd4AOfwu.cjs} +4 -4
  33. package/dist/shared/{attaform.BrrXNmfK.cjs.map → attaform.Cd4AOfwu.cjs.map} +1 -1
  34. package/dist/shared/{attaform.EZG6fOFb.mjs → attaform.CnrxbkB6.mjs} +2 -2
  35. package/dist/shared/{attaform.EZG6fOFb.mjs.map → attaform.CnrxbkB6.mjs.map} +1 -1
  36. package/dist/shared/{attaform.DLnE5bZa.cjs → attaform.CwLjUqmQ.cjs} +7 -3
  37. package/dist/shared/attaform.CwLjUqmQ.cjs.map +1 -0
  38. package/dist/shared/{attaform.DoKXru-a.d.mts → attaform.CywE4y8x.d.cts} +1 -1
  39. package/dist/shared/{attaform.BPxsYtTe.cjs → attaform.D2SCCd4O.cjs} +2 -2
  40. package/dist/shared/{attaform.BPxsYtTe.cjs.map → attaform.D2SCCd4O.cjs.map} +1 -1
  41. package/dist/shared/{attaform.BCBxTyMC.cjs → attaform.DAKrGhxc.cjs} +4 -4
  42. package/dist/shared/{attaform.BCBxTyMC.cjs.map → attaform.DAKrGhxc.cjs.map} +1 -1
  43. package/dist/shared/{attaform.Dl5kDY-A.d.ts → attaform.DN5CvZrg.d.ts} +1 -1
  44. package/dist/shared/{attaform.D5-1XGQU.d.cts → attaform.DbRgDFa7.d.cts} +1 -1
  45. package/dist/shared/{attaform.D6CwqkPx.mjs → attaform.Dt7dEcHk.mjs} +4 -4
  46. package/dist/shared/{attaform.D6CwqkPx.mjs.map → attaform.Dt7dEcHk.mjs.map} +1 -1
  47. package/dist/shared/{attaform.BKozEdTr.mjs → attaform.QG5TG8lB.mjs} +51 -35
  48. package/dist/shared/attaform.QG5TG8lB.mjs.map +1 -0
  49. package/dist/shared/{attaform.EMzJcQci.d.mts → attaform.ceGEAEMk.d.ts} +1 -1
  50. package/dist/shared/{attaform.Bh3ACtts.d.ts → attaform.sWm8B15V.d.mts} +1 -1
  51. package/dist/shared/{attaform.BqZuwLTK.mjs → attaform.tiWEVznj.mjs} +7 -3
  52. package/dist/shared/attaform.tiWEVznj.mjs.map +1 -0
  53. package/dist/shared/{attaform.BPy-4qRx.cjs → attaform.z5j3LwJz.cjs} +51 -34
  54. package/dist/shared/attaform.z5j3LwJz.cjs.map +1 -0
  55. package/dist/zod-v3.cjs +3 -3
  56. package/dist/zod-v3.d.cts +3 -3
  57. package/dist/zod-v3.d.mts +3 -3
  58. package/dist/zod-v3.d.ts +3 -3
  59. package/dist/zod-v3.mjs +3 -3
  60. package/dist/zod-v4.cjs +3 -3
  61. package/dist/zod-v4.d.cts +4 -4
  62. package/dist/zod-v4.d.mts +4 -4
  63. package/dist/zod-v4.d.ts +4 -4
  64. package/dist/zod-v4.mjs +3 -3
  65. package/dist/zod.cjs +5 -5
  66. package/dist/zod.d.cts +5 -5
  67. package/dist/zod.d.mts +5 -5
  68. package/dist/zod.d.ts +5 -5
  69. package/dist/zod.mjs +6 -6
  70. package/package.json +3 -3
  71. package/dist/shared/attaform.BKozEdTr.mjs.map +0 -1
  72. package/dist/shared/attaform.BPy-4qRx.cjs.map +0 -1
  73. package/dist/shared/attaform.BqZuwLTK.mjs.map +0 -1
  74. package/dist/shared/attaform.DLnE5bZa.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { r as getRegistryFromApp, C as pathKeyToDotted } from './attaform.BKozEdTr.mjs';
1
+ import { s as getRegistryFromApp, E as pathKeyToDotted } from './attaform.QG5TG8lB.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.EZG6fOFb.mjs.map
35
+ //# sourceMappingURL=attaform.CnrxbkB6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"attaform.EZG6fOFb.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.CnrxbkB6.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,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const paths = require('./attaform.BPy-4qRx.cjs');
4
+ const paths = require('./attaform.z5j3LwJz.cjs');
5
5
 
6
6
  function safeAssign(target, key, value) {
7
7
  if (key === "__proto__") {
@@ -2308,6 +2308,7 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2308
2308
  const isRequired = state.schema.isRequiredAtPath(segments);
2309
2309
  const ariaEnabled = options?.autoAria ?? formAutoAria;
2310
2310
  const ariaDisplayState = getDisplayStateAt !== void 0 ? vue.computed(() => getDisplayStateAt(segments)) : void 0;
2311
+ let boundElement = null;
2311
2312
  const internalRv = {
2312
2313
  innerRef,
2313
2314
  displayValue,
@@ -2326,6 +2327,7 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2326
2327
  state.markInteracted(segments);
2327
2328
  },
2328
2329
  registerElement: (element) => {
2330
+ boundElement = element;
2329
2331
  if (!paths.INTERACTIVE_TAG_NAMES.has(element.tagName)) return;
2330
2332
  const added = state.registerElement(segments, element, formInstanceId);
2331
2333
  if (added) attachFocusListeners(state, segments, element, instanceMeta);
@@ -2333,9 +2335,11 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2333
2335
  deregisterElement: (element) => {
2334
2336
  detachFocusListeners(element);
2335
2337
  state.deregisterElement(segments, element);
2338
+ if (boundElement === element) boundElement = null;
2336
2339
  },
2337
2340
  setValueWithInternalPath: (value, meta) => {
2338
- return state.setValueAtPath(segments, value, withInstanceMeta(meta));
2341
+ const resolvedMeta = meta === void 0 && boundElement !== null ? { persist: state.persistOptIns.hasOptIn(paths.getOrAssignElementId(boundElement), pathKey) } : meta;
2342
+ return state.setValueAtPath(segments, value, withInstanceMeta(resolvedMeta));
2339
2343
  },
2340
2344
  // Called by the `vRegisterHint` compile-time transform's wrapping
2341
2345
  // IIFE on every server-side render of `<element v-register="…">`.
@@ -7223,4 +7227,4 @@ exports.slimKindOf = slimKindOf;
7223
7227
  exports.unset = unset;
7224
7228
  exports.useAbstractForm = useAbstractForm;
7225
7229
  exports.useWizard = useWizard;
7226
- //# sourceMappingURL=attaform.DLnE5bZa.cjs.map
7230
+ //# sourceMappingURL=attaform.CwLjUqmQ.cjs.map