attaform 0.22.0 → 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.BGwNZ9GV.d.cts → attaform.BGMRvckW.d.ts} +10 -77
- package/dist/shared/{attaform.DvUH4a3o.d.ts → attaform.BJnNK75Y.d.cts} +45 -670
- package/dist/shared/{attaform.DvUH4a3o.d.mts → attaform.BJnNK75Y.d.mts} +45 -670
- package/dist/shared/{attaform.DvUH4a3o.d.cts → attaform.BJnNK75Y.d.ts} +45 -670
- package/dist/shared/{attaform.BKFwekY2.mjs → attaform.BhI9Icek.mjs} +3 -287
- package/dist/shared/attaform.BhI9Icek.mjs.map +1 -0
- package/dist/shared/{attaform.CRzpFCjV.cjs → attaform.BibT5AS_.cjs} +2 -2
- package/dist/shared/{attaform.CRzpFCjV.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.Q3eAD2wD.cjs → attaform.CaYj3ZfY.cjs} +3 -3
- package/dist/shared/{attaform.Q3eAD2wD.cjs.map → attaform.CaYj3ZfY.cjs.map} +1 -1
- package/dist/shared/{attaform.AyujQoHp.cjs → attaform.Cmb_LCie.cjs} +4 -4
- package/dist/shared/{attaform.DNuiFCXG.mjs.map → attaform.Cmb_LCie.cjs.map} +1 -1
- package/dist/shared/{attaform.CsB-iKbU.mjs → attaform.CtJOd7ox.mjs} +81 -591
- package/dist/shared/attaform.CtJOd7ox.mjs.map +1 -0
- package/dist/shared/{attaform.DgCfLqay.mjs → attaform.CzVta5o2.mjs} +4 -4
- package/dist/shared/attaform.CzVta5o2.mjs.map +1 -0
- package/dist/shared/{attaform.FN0vaQAg.d.mts → attaform.D52oJiYC.d.cts} +1 -1
- package/dist/shared/{attaform.aekT7mMx.d.cts → attaform.DCkSNnPr.d.mts} +1 -1
- package/dist/shared/{attaform.01iKS_lz.cjs → attaform.Db4E4IW6.cjs} +2 -294
- package/dist/shared/attaform.Db4E4IW6.cjs.map +1 -0
- package/dist/shared/{attaform.C-RtnCJM.cjs → attaform.DbyTD8N2.cjs} +4 -4
- package/dist/shared/attaform.DbyTD8N2.cjs.map +1 -0
- package/dist/shared/{attaform.DCjgGir_.mjs → attaform.Dd1Kmmaj.mjs} +3 -3
- package/dist/shared/{attaform.DCjgGir_.mjs.map → attaform.Dd1Kmmaj.mjs.map} +1 -1
- package/dist/shared/{attaform.D4XYaasQ.d.ts → attaform.DrY8srOp.d.mts} +10 -77
- package/dist/shared/{attaform.CjMcwV7W.cjs → attaform.DsQkXE3o.cjs} +79 -599
- package/dist/shared/attaform.DsQkXE3o.cjs.map +1 -0
- package/dist/shared/{attaform.CCCeEPwa.d.mts → attaform.DuPneYR0.d.cts} +10 -77
- package/dist/shared/{attaform.6xE0Lcfd.mjs → attaform.Dx9-QQE2.mjs} +2 -2
- package/dist/shared/{attaform.6xE0Lcfd.mjs.map → attaform.Dx9-QQE2.mjs.map} +1 -1
- package/dist/shared/{attaform.DUMWQefY.d.ts → attaform.WEwfXcHq.d.ts} +1 -1
- package/dist/shared/{attaform.DNuiFCXG.mjs → attaform.alpG7rT7.mjs} +4 -4
- package/dist/shared/{attaform.AyujQoHp.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 +1 -1
- 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.01iKS_lz.cjs.map +0 -1
- package/dist/shared/attaform.BKFwekY2.mjs.map +0 -1
- package/dist/shared/attaform.C-RtnCJM.cjs.map +0 -1
- package/dist/shared/attaform.CjMcwV7W.cjs.map +0 -1
- package/dist/shared/attaform.CsB-iKbU.mjs.map +0 -1
- package/dist/shared/attaform.DgCfLqay.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FormKey,
|
|
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.mjs';
|
|
2
2
|
import { Ref, ComputedRef, App, InjectionKey } from 'vue';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -967,17 +967,13 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
967
967
|
/**
|
|
968
968
|
* Replace the form value wholesale. Optional `meta` is forwarded to
|
|
969
969
|
* every `onFormChange` listener so they can decide whether THIS write
|
|
970
|
-
* is one they care about
|
|
971
|
-
* only writes when `meta?.persist === true`. Internal callers that
|
|
972
|
-
* don't pass meta default to no-persist.
|
|
970
|
+
* is one they care about (e.g. history tagging a hydration replay).
|
|
973
971
|
*/
|
|
974
972
|
applyFormReplacement(next: F, meta?: WriteMeta): void;
|
|
975
973
|
/**
|
|
976
974
|
* Set a single path's value. `meta` is forwarded to listeners via
|
|
977
|
-
* `applyFormReplacement` (see above).
|
|
978
|
-
*
|
|
979
|
-
* internal call sites pass `meta.persist = hasAnyOptInForPath(path)`.
|
|
980
|
-
* Public `form.setValue` passes no meta.
|
|
975
|
+
* `applyFormReplacement` (see above). Public `form.setValue` passes no
|
|
976
|
+
* meta.
|
|
981
977
|
*
|
|
982
978
|
* Returns `false` when the slim-primitive gate rejects the write
|
|
983
979
|
* (the value's primitive shape doesn't match the schema's slim
|
|
@@ -1191,28 +1187,17 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
1191
1187
|
/**
|
|
1192
1188
|
* Subscribe to every `applyFormReplacement`. Fires synchronously
|
|
1193
1189
|
* after `form.value` has been swapped to `next` and all field /
|
|
1194
|
-
* originals bookkeeping has run. Used by
|
|
1195
|
-
*
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
* about meta can ignore the parameter. Returns an unsubscribe
|
|
1199
|
-
* function.
|
|
1190
|
+
* originals bookkeeping has run. Used by undo/redo to hook the single
|
|
1191
|
+
* mutation funnel. The optional `meta` carries the originating call
|
|
1192
|
+
* site's intent; subscribers that don't care about meta can ignore the
|
|
1193
|
+
* parameter. Returns an unsubscribe function.
|
|
1200
1194
|
*/
|
|
1201
1195
|
onFormChange(listener: (next: F, meta?: WriteMeta) => void): () => void;
|
|
1202
|
-
/**
|
|
1203
|
-
* Register a `form.onChange` side-channel handler. `source === undefined`
|
|
1204
|
-
* is the whole form (root); `getForm` lazily resolves the public form
|
|
1205
|
-
* handle for `ctx.form`. Returns an idempotent `stop()`. A no-op on SSR.
|
|
1206
|
-
* The public `form.onChange` overloads and `useForm({ onChange })` wire
|
|
1207
|
-
* through here; dispatch happens in `commitWritePatches`.
|
|
1208
|
-
*/
|
|
1209
|
-
registerOnChange(source: OnChangeSource | undefined, handler: OnChangeHandler, options: OnChangeOptions | undefined, getForm: () => unknown): () => void;
|
|
1210
1196
|
/**
|
|
1211
1197
|
* Subscribe to successful submissions. Fires after the consumer's
|
|
1212
1198
|
* `onSubmit` callback has resolved — not on validation failure,
|
|
1213
|
-
* not on callback throw.
|
|
1214
|
-
*
|
|
1215
|
-
* server round-trip. Returns an unsubscribe function.
|
|
1199
|
+
* not on callback throw. The DevTools panel rides this to surface a
|
|
1200
|
+
* submit event. Returns an unsubscribe function.
|
|
1216
1201
|
*/
|
|
1217
1202
|
onSubmitSuccess(listener: () => void): () => void;
|
|
1218
1203
|
/**
|
|
@@ -1258,58 +1243,6 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
1258
1243
|
* owned by the caller (e.g. `'history'`).
|
|
1259
1244
|
*/
|
|
1260
1245
|
readonly modules: Map<string, unknown>;
|
|
1261
|
-
/**
|
|
1262
|
-
* Per-element persistence opt-in tracker. Empty by default; the
|
|
1263
|
-
* `v-register` directive populates entries on `mount` for each binding
|
|
1264
|
-
* that passed `register('foo', { persist: true })` and clears them on
|
|
1265
|
-
* `beforeUnmount`. Two SFCs sharing a key share this registry — opt-ins
|
|
1266
|
-
* are per-DOM-element, not per-component. Internal to the persistence
|
|
1267
|
-
* subsystem; not part of the consumer API surface.
|
|
1268
|
-
*/
|
|
1269
|
-
readonly persistOptIns: PersistOptInRegistry;
|
|
1270
|
-
/**
|
|
1271
|
-
* Resolved sensitive-path predicate for THIS form. Honors the
|
|
1272
|
-
* cascade (`useForm({ sensitiveNames })` > global default >
|
|
1273
|
-
* library `DEFAULT_SENSITIVE_NAMES`). Used by:
|
|
1274
|
-
* - the persistence opt-in gate (`allowSensitivePersist`);
|
|
1275
|
-
* - the multi-tab sync module (outbound strip + inbound reject);
|
|
1276
|
-
* - DevTools edit rejection;
|
|
1277
|
-
* - any future surface that needs to flag "this path holds
|
|
1278
|
-
* sensitive data."
|
|
1279
|
-
*
|
|
1280
|
-
* Frozen at FormStore construction. Two callsites sharing a key
|
|
1281
|
-
* share the predicate — consistent with the rest of the per-form
|
|
1282
|
-
* resolved-config surface.
|
|
1283
|
-
*/
|
|
1284
|
-
readonly isSensitivePath: (path: Path | PathKey | string) => boolean;
|
|
1285
|
-
/**
|
|
1286
|
-
* Canonical path keys explicitly opted OUT of multi-tab sync by
|
|
1287
|
-
* `register(path, { multiTab: false })`. The sync module's outbound
|
|
1288
|
-
* broadcaster strips patches at these paths AND the inbound listener
|
|
1289
|
-
* rejects them — symmetric tab-local behaviour for selected fields.
|
|
1290
|
-
*
|
|
1291
|
-
* Read-only Set view; mutate via `incrementNoSyncOptOut` /
|
|
1292
|
-
* `decrementNoSyncOptOut` which maintain a per-path ref count so
|
|
1293
|
-
* multiple bindings on the same path balance correctly across
|
|
1294
|
-
* dynamic conditional renders. Empty by default.
|
|
1295
|
-
*/
|
|
1296
|
-
readonly noSyncPaths: ReadonlySet<PathKey>;
|
|
1297
|
-
/**
|
|
1298
|
-
* Ref-counted "this path is tab-local" registration. Called by
|
|
1299
|
-
* `v-register`'s `created` hook for any binding that declared
|
|
1300
|
-
* `register('x', { multiTab: false })`. The first call for a given
|
|
1301
|
-
* path adds it to `noSyncPaths`; subsequent calls just bump the
|
|
1302
|
-
* ref count. Pair with `decrementNoSyncOptOut`.
|
|
1303
|
-
*/
|
|
1304
|
-
incrementNoSyncOptOut(path: PathKey): void;
|
|
1305
|
-
/**
|
|
1306
|
-
* Symmetric companion to `incrementNoSyncOptOut`. Called by
|
|
1307
|
-
* `v-register`'s `beforeUnmount` hook. When the ref count for a
|
|
1308
|
-
* path drops to zero, the path is removed from `noSyncPaths` —
|
|
1309
|
-
* dynamic toggling (the binding rendered conditionally) restores
|
|
1310
|
-
* full sync to the path when the last opt-out unmounts.
|
|
1311
|
-
*/
|
|
1312
|
-
decrementNoSyncOptOut(path: PathKey): void;
|
|
1313
1246
|
/**
|
|
1314
1247
|
* Resolved schema-coercion index — the merged config from
|
|
1315
1248
|
* `createAttaform({ defaults: { coerce } })` ∪ `useForm({ coerce })`,
|