attaform 0.21.2 → 0.23.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.
- package/README.md +7 -10
- package/dist/chunks/dev-key-collision-warnings.cjs +0 -33
- package/dist/chunks/dev-key-collision-warnings.cjs.map +1 -1
- package/dist/chunks/dev-key-collision-warnings.mjs +1 -33
- package/dist/chunks/dev-key-collision-warnings.mjs.map +1 -1
- package/dist/chunks/devtools.cjs +3 -5
- package/dist/chunks/devtools.cjs.map +1 -1
- package/dist/chunks/devtools.mjs +3 -5
- package/dist/chunks/devtools.mjs.map +1 -1
- package/dist/chunks/fingerprint2.cjs +1 -1
- package/dist/chunks/fingerprint2.mjs +1 -1
- package/dist/index.cjs +3 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -41
- package/dist/index.d.mts +6 -41
- package/dist/index.d.ts +6 -41
- package/dist/index.mjs +5 -5
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.mts +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/runtime/components/AttaformDevtoolsPanel.vue +3 -11
- package/dist/runtime/plugins/attaform.cjs +2 -2
- package/dist/runtime/plugins/attaform.mjs +2 -2
- package/dist/shared/{attaform.BGf_J22U.d.ts → attaform.BGMRvckW.d.ts} +11 -70
- package/dist/shared/{attaform.ory-3WhV.d.mts → attaform.BJnNK75Y.d.cts} +41 -491
- package/dist/shared/{attaform.ory-3WhV.d.ts → attaform.BJnNK75Y.d.mts} +41 -491
- package/dist/shared/{attaform.ory-3WhV.d.cts → attaform.BJnNK75Y.d.ts} +41 -491
- package/dist/shared/{attaform.DP-u7_tk.mjs → attaform.BhI9Icek.mjs} +17 -291
- package/dist/shared/attaform.BhI9Icek.mjs.map +1 -0
- package/dist/shared/{attaform.BwLp9KM7.cjs → attaform.BibT5AS_.cjs} +2 -2
- package/dist/shared/{attaform.BwLp9KM7.cjs.map → attaform.BibT5AS_.cjs.map} +1 -1
- package/dist/shared/{attaform.DkA5J8NW.d.cts → attaform.CO0e7YVY.d.cts} +1 -46
- package/dist/shared/{attaform.DkA5J8NW.d.ts → attaform.CO0e7YVY.d.mts} +1 -46
- package/dist/shared/{attaform.DkA5J8NW.d.mts → attaform.CO0e7YVY.d.ts} +1 -46
- package/dist/shared/{attaform.BwrowMp2.cjs → attaform.CaYj3ZfY.cjs} +3 -3
- package/dist/shared/{attaform.BwrowMp2.cjs.map → attaform.CaYj3ZfY.cjs.map} +1 -1
- package/dist/shared/{attaform.BBDIKtKY.cjs → attaform.Cmb_LCie.cjs} +4 -4
- package/dist/shared/{attaform.BVeLgfEh.mjs.map → attaform.Cmb_LCie.cjs.map} +1 -1
- package/dist/shared/{attaform.CTheKoTc.mjs → attaform.CtJOd7ox.mjs} +446 -525
- package/dist/shared/attaform.CtJOd7ox.mjs.map +1 -0
- package/dist/shared/{attaform.CrD73S4m.mjs → attaform.CzVta5o2.mjs} +116 -47
- package/dist/shared/attaform.CzVta5o2.mjs.map +1 -0
- package/dist/shared/{attaform.CnEl--PF.d.mts → attaform.D52oJiYC.d.cts} +1 -1
- package/dist/shared/{attaform.BoY6RZUl.d.cts → attaform.DCkSNnPr.d.mts} +1 -1
- package/dist/shared/{attaform.B5LNzqQh.cjs → attaform.Db4E4IW6.cjs} +18 -297
- package/dist/shared/attaform.Db4E4IW6.cjs.map +1 -0
- package/dist/shared/{attaform.CcnF1AKJ.cjs → attaform.DbyTD8N2.cjs} +116 -47
- package/dist/shared/attaform.DbyTD8N2.cjs.map +1 -0
- package/dist/shared/{attaform.D6GYGshL.mjs → attaform.Dd1Kmmaj.mjs} +3 -3
- package/dist/shared/{attaform.D6GYGshL.mjs.map → attaform.Dd1Kmmaj.mjs.map} +1 -1
- package/dist/shared/{attaform.BCcrLApm.d.mts → attaform.DrY8srOp.d.mts} +11 -70
- package/dist/shared/{attaform.D2ZuIOCf.cjs → attaform.DsQkXE3o.cjs} +445 -534
- package/dist/shared/attaform.DsQkXE3o.cjs.map +1 -0
- package/dist/shared/{attaform.BkjJfMvJ.d.cts → attaform.DuPneYR0.d.cts} +11 -70
- package/dist/shared/{attaform.C41gjp-a.mjs → attaform.Dx9-QQE2.mjs} +2 -2
- package/dist/shared/{attaform.C41gjp-a.mjs.map → attaform.Dx9-QQE2.mjs.map} +1 -1
- package/dist/shared/{attaform.BYgioWLF.d.ts → attaform.WEwfXcHq.d.ts} +1 -1
- package/dist/shared/{attaform.BVeLgfEh.mjs → attaform.alpG7rT7.mjs} +4 -4
- package/dist/shared/{attaform.BBDIKtKY.cjs.map → attaform.alpG7rT7.mjs.map} +1 -1
- package/dist/zod-v3.cjs +2 -2
- package/dist/zod-v3.d.cts +3 -3
- package/dist/zod-v3.d.mts +3 -3
- package/dist/zod-v3.d.ts +3 -3
- package/dist/zod-v3.mjs +2 -2
- package/dist/zod-v4.cjs +2 -2
- package/dist/zod-v4.d.cts +5 -5
- package/dist/zod-v4.d.mts +5 -5
- package/dist/zod-v4.d.ts +5 -5
- package/dist/zod-v4.mjs +2 -2
- package/dist/zod.cjs +5 -5
- package/dist/zod.d.cts +5 -5
- package/dist/zod.d.mts +5 -5
- package/dist/zod.d.ts +5 -5
- package/dist/zod.mjs +5 -5
- package/package.json +2 -2
- package/dist/chunks/indexeddb.cjs +0 -119
- package/dist/chunks/indexeddb.cjs.map +0 -1
- package/dist/chunks/indexeddb.mjs +0 -117
- package/dist/chunks/indexeddb.mjs.map +0 -1
- package/dist/chunks/local-storage.cjs +0 -58
- package/dist/chunks/local-storage.cjs.map +0 -1
- package/dist/chunks/local-storage.mjs +0 -56
- package/dist/chunks/local-storage.mjs.map +0 -1
- package/dist/chunks/multi-tab-sync.cjs +0 -367
- package/dist/chunks/multi-tab-sync.cjs.map +0 -1
- package/dist/chunks/multi-tab-sync.mjs +0 -364
- package/dist/chunks/multi-tab-sync.mjs.map +0 -1
- package/dist/chunks/session-storage.cjs +0 -58
- package/dist/chunks/session-storage.cjs.map +0 -1
- package/dist/chunks/session-storage.mjs +0 -56
- package/dist/chunks/session-storage.mjs.map +0 -1
- package/dist/chunks/wire-persistence.cjs +0 -396
- package/dist/chunks/wire-persistence.cjs.map +0 -1
- package/dist/chunks/wire-persistence.mjs +0 -394
- package/dist/chunks/wire-persistence.mjs.map +0 -1
- package/dist/shared/attaform.B5LNzqQh.cjs.map +0 -1
- package/dist/shared/attaform.CTheKoTc.mjs.map +0 -1
- package/dist/shared/attaform.CcnF1AKJ.cjs.map +0 -1
- package/dist/shared/attaform.CrD73S4m.mjs.map +0 -1
- package/dist/shared/attaform.D2ZuIOCf.cjs.map +0 -1
- package/dist/shared/attaform.DP-u7_tk.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attaform.
|
|
1
|
+
{"version":3,"file":"attaform.BibT5AS_.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;;;;;;"}
|
|
@@ -90,50 +90,5 @@ declare class OutsideSetupError extends AttaformError {
|
|
|
90
90
|
declare class ReservedFormKeyError extends AttaformError {
|
|
91
91
|
constructor(key: string);
|
|
92
92
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Thrown (in dev) when `useForm({ persist: ... })` is configured on
|
|
95
|
-
* an anonymous form (no `key:` provided). The synthetic `__atta:anon:`
|
|
96
|
-
* identity isn't stable across remounts (Vue's `useId()` allocator
|
|
97
|
-
* drifts under HMR, and any sibling `useId()` call shifts subsequent
|
|
98
|
-
* IDs), so the persistence layer can't reliably find the previous
|
|
99
|
-
* mount's draft. Result: stale entries pile up in storage and the
|
|
100
|
-
* user's most recent edit doesn't always come back.
|
|
101
|
-
*
|
|
102
|
-
* Fix: pass an explicit `key` to `useForm()`.
|
|
103
|
-
*
|
|
104
|
-
* In production builds the runtime downgrades this to a one-shot
|
|
105
|
-
* `console.warn` so a deployed third-party app shipping the
|
|
106
|
-
* anti-pattern doesn't hard-crash.
|
|
107
|
-
*/
|
|
108
|
-
/**
|
|
109
|
-
* Thrown when persistence is misconfigured in a way that would either
|
|
110
|
-
* (a) silently drop writes, or (b) namespace storage under a
|
|
111
|
-
* non-deterministic synthetic key — both of which become security bugs
|
|
112
|
-
* the moment encrypted persistence backends are added (the same key
|
|
113
|
-
* may be derived for two unrelated forms).
|
|
114
|
-
*
|
|
115
|
-
* Two `cause` values, one error shape:
|
|
116
|
-
*
|
|
117
|
-
* - `'no-key'` — `useForm({ persist: ... })` called without `key:`.
|
|
118
|
-
* Anonymous keys (`__atta:anon:*`) drift across mounts; persisting
|
|
119
|
-
* to a non-deterministic location is refused outright.
|
|
120
|
-
*
|
|
121
|
-
* - `'register-without-config'` — `register(_, { persist: true })`
|
|
122
|
-
* declared on a form whose `useForm()` options omit `persist:`.
|
|
123
|
-
* The opt-in is recorded but nothing would ever land in storage.
|
|
124
|
-
*
|
|
125
|
-
* Fix: align the two layers — set `persist:` + `key:` on `useForm()`,
|
|
126
|
-
* or remove `{ persist: true }` from the offending `register()` call.
|
|
127
|
-
*/
|
|
128
|
-
declare class AnonPersistError extends AttaformError {
|
|
129
|
-
readonly schemaFields: readonly string[] | undefined;
|
|
130
|
-
readonly callSite: string | undefined;
|
|
131
|
-
readonly cause: 'no-key' | 'register-without-config';
|
|
132
|
-
constructor(opts: {
|
|
133
|
-
schemaFields?: readonly string[] | undefined;
|
|
134
|
-
callSite?: string | undefined;
|
|
135
|
-
cause: 'no-key' | 'register-without-config';
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
93
|
|
|
139
|
-
export {
|
|
94
|
+
export { AttaformError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SubmitErrorHandlerError as S, InvalidUseFormConfigError as a, ReservedFormKeyError as b };
|
|
@@ -90,50 +90,5 @@ declare class OutsideSetupError extends AttaformError {
|
|
|
90
90
|
declare class ReservedFormKeyError extends AttaformError {
|
|
91
91
|
constructor(key: string);
|
|
92
92
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Thrown (in dev) when `useForm({ persist: ... })` is configured on
|
|
95
|
-
* an anonymous form (no `key:` provided). The synthetic `__atta:anon:`
|
|
96
|
-
* identity isn't stable across remounts (Vue's `useId()` allocator
|
|
97
|
-
* drifts under HMR, and any sibling `useId()` call shifts subsequent
|
|
98
|
-
* IDs), so the persistence layer can't reliably find the previous
|
|
99
|
-
* mount's draft. Result: stale entries pile up in storage and the
|
|
100
|
-
* user's most recent edit doesn't always come back.
|
|
101
|
-
*
|
|
102
|
-
* Fix: pass an explicit `key` to `useForm()`.
|
|
103
|
-
*
|
|
104
|
-
* In production builds the runtime downgrades this to a one-shot
|
|
105
|
-
* `console.warn` so a deployed third-party app shipping the
|
|
106
|
-
* anti-pattern doesn't hard-crash.
|
|
107
|
-
*/
|
|
108
|
-
/**
|
|
109
|
-
* Thrown when persistence is misconfigured in a way that would either
|
|
110
|
-
* (a) silently drop writes, or (b) namespace storage under a
|
|
111
|
-
* non-deterministic synthetic key — both of which become security bugs
|
|
112
|
-
* the moment encrypted persistence backends are added (the same key
|
|
113
|
-
* may be derived for two unrelated forms).
|
|
114
|
-
*
|
|
115
|
-
* Two `cause` values, one error shape:
|
|
116
|
-
*
|
|
117
|
-
* - `'no-key'` — `useForm({ persist: ... })` called without `key:`.
|
|
118
|
-
* Anonymous keys (`__atta:anon:*`) drift across mounts; persisting
|
|
119
|
-
* to a non-deterministic location is refused outright.
|
|
120
|
-
*
|
|
121
|
-
* - `'register-without-config'` — `register(_, { persist: true })`
|
|
122
|
-
* declared on a form whose `useForm()` options omit `persist:`.
|
|
123
|
-
* The opt-in is recorded but nothing would ever land in storage.
|
|
124
|
-
*
|
|
125
|
-
* Fix: align the two layers — set `persist:` + `key:` on `useForm()`,
|
|
126
|
-
* or remove `{ persist: true }` from the offending `register()` call.
|
|
127
|
-
*/
|
|
128
|
-
declare class AnonPersistError extends AttaformError {
|
|
129
|
-
readonly schemaFields: readonly string[] | undefined;
|
|
130
|
-
readonly callSite: string | undefined;
|
|
131
|
-
readonly cause: 'no-key' | 'register-without-config';
|
|
132
|
-
constructor(opts: {
|
|
133
|
-
schemaFields?: readonly string[] | undefined;
|
|
134
|
-
callSite?: string | undefined;
|
|
135
|
-
cause: 'no-key' | 'register-without-config';
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
93
|
|
|
139
|
-
export {
|
|
94
|
+
export { AttaformError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SubmitErrorHandlerError as S, InvalidUseFormConfigError as a, ReservedFormKeyError as b };
|
|
@@ -90,50 +90,5 @@ declare class OutsideSetupError extends AttaformError {
|
|
|
90
90
|
declare class ReservedFormKeyError extends AttaformError {
|
|
91
91
|
constructor(key: string);
|
|
92
92
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Thrown (in dev) when `useForm({ persist: ... })` is configured on
|
|
95
|
-
* an anonymous form (no `key:` provided). The synthetic `__atta:anon:`
|
|
96
|
-
* identity isn't stable across remounts (Vue's `useId()` allocator
|
|
97
|
-
* drifts under HMR, and any sibling `useId()` call shifts subsequent
|
|
98
|
-
* IDs), so the persistence layer can't reliably find the previous
|
|
99
|
-
* mount's draft. Result: stale entries pile up in storage and the
|
|
100
|
-
* user's most recent edit doesn't always come back.
|
|
101
|
-
*
|
|
102
|
-
* Fix: pass an explicit `key` to `useForm()`.
|
|
103
|
-
*
|
|
104
|
-
* In production builds the runtime downgrades this to a one-shot
|
|
105
|
-
* `console.warn` so a deployed third-party app shipping the
|
|
106
|
-
* anti-pattern doesn't hard-crash.
|
|
107
|
-
*/
|
|
108
|
-
/**
|
|
109
|
-
* Thrown when persistence is misconfigured in a way that would either
|
|
110
|
-
* (a) silently drop writes, or (b) namespace storage under a
|
|
111
|
-
* non-deterministic synthetic key — both of which become security bugs
|
|
112
|
-
* the moment encrypted persistence backends are added (the same key
|
|
113
|
-
* may be derived for two unrelated forms).
|
|
114
|
-
*
|
|
115
|
-
* Two `cause` values, one error shape:
|
|
116
|
-
*
|
|
117
|
-
* - `'no-key'` — `useForm({ persist: ... })` called without `key:`.
|
|
118
|
-
* Anonymous keys (`__atta:anon:*`) drift across mounts; persisting
|
|
119
|
-
* to a non-deterministic location is refused outright.
|
|
120
|
-
*
|
|
121
|
-
* - `'register-without-config'` — `register(_, { persist: true })`
|
|
122
|
-
* declared on a form whose `useForm()` options omit `persist:`.
|
|
123
|
-
* The opt-in is recorded but nothing would ever land in storage.
|
|
124
|
-
*
|
|
125
|
-
* Fix: align the two layers — set `persist:` + `key:` on `useForm()`,
|
|
126
|
-
* or remove `{ persist: true }` from the offending `register()` call.
|
|
127
|
-
*/
|
|
128
|
-
declare class AnonPersistError extends AttaformError {
|
|
129
|
-
readonly schemaFields: readonly string[] | undefined;
|
|
130
|
-
readonly callSite: string | undefined;
|
|
131
|
-
readonly cause: 'no-key' | 'register-without-config';
|
|
132
|
-
constructor(opts: {
|
|
133
|
-
schemaFields?: readonly string[] | undefined;
|
|
134
|
-
callSite?: string | undefined;
|
|
135
|
-
cause: 'no-key' | 'register-without-config';
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
93
|
|
|
139
|
-
export {
|
|
94
|
+
export { AttaformError as A, InvalidPathError as I, OutsideSetupError as O, RegistryNotInstalledError as R, SubmitErrorHandlerError as S, InvalidUseFormConfigError as a, ReservedFormKeyError as b };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const injectWizard = require('./attaform.
|
|
4
|
-
const paths = require('./attaform.
|
|
3
|
+
const injectWizard = require('./attaform.DsQkXE3o.cjs');
|
|
4
|
+
const paths = require('./attaform.Db4E4IW6.cjs');
|
|
5
5
|
|
|
6
6
|
const PATH_SEPARATOR = ".";
|
|
7
7
|
function createAbstractSchema(rootSchema, intro, services, formKey, options) {
|
|
@@ -914,4 +914,4 @@ exports.mergeDeep = mergeDeep;
|
|
|
914
914
|
exports.peelEmbeddedDefault = peelEmbeddedDefault;
|
|
915
915
|
exports.slimPrimitivesWalk = slimPrimitivesWalk;
|
|
916
916
|
exports.walkPathSegments = walkPathSegments;
|
|
917
|
-
//# sourceMappingURL=attaform.
|
|
917
|
+
//# sourceMappingURL=attaform.CaYj3ZfY.cjs.map
|