attaform 0.27.3 → 0.27.4
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/dist/abstract.cjs +1 -1
- package/dist/abstract.d.cts +2 -2
- package/dist/abstract.d.mts +2 -2
- package/dist/abstract.d.ts +2 -2
- package/dist/abstract.mjs +1 -1
- package/dist/chunks/fingerprint2.cjs +1 -1
- package/dist/chunks/fingerprint2.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/shared/{attaform.DeHCOlC8.cjs → attaform.B3spfqIA.cjs} +3 -3
- package/dist/shared/{attaform.DeHCOlC8.cjs.map → attaform.B3spfqIA.cjs.map} +1 -1
- package/dist/shared/{attaform.DuVCclwv.mjs → attaform.BrVzB14N.mjs} +3 -3
- package/dist/shared/{attaform.DuVCclwv.mjs.map → attaform.BrVzB14N.mjs.map} +1 -1
- package/dist/shared/{attaform.Mg4g-J0z.cjs → attaform.C9arOC5p.cjs} +4 -4
- package/dist/shared/{attaform.Mg4g-J0z.cjs.map → attaform.C9arOC5p.cjs.map} +1 -1
- package/dist/shared/{attaform.DHQjaGMP.mjs → attaform.CC4KCx_q.mjs} +4 -4
- package/dist/shared/{attaform.DHQjaGMP.mjs.map → attaform.CC4KCx_q.mjs.map} +1 -1
- package/dist/shared/{attaform.dX58Auwf.cjs → attaform.CX2NHAFs.cjs} +2 -2
- package/dist/shared/{attaform.dX58Auwf.cjs.map → attaform.CX2NHAFs.cjs.map} +1 -1
- package/dist/shared/{attaform.BjGedLx2.d.cts → attaform.Cjh6b6xU.d.cts} +50 -14
- package/dist/shared/{attaform.BqkFQ2B9.mjs → attaform.CuUx4jWI.mjs} +41 -25
- package/dist/shared/{attaform.ij2W7VTw.cjs.map → attaform.CuUx4jWI.mjs.map} +1 -1
- package/dist/shared/{attaform.gqOCvpSB.d.ts → attaform.DKtXMaJB.d.ts} +50 -14
- package/dist/shared/{attaform.BOIpRdeG.cjs → attaform.DXwJVUNS.cjs} +3 -3
- package/dist/shared/{attaform.BOIpRdeG.cjs.map → attaform.DXwJVUNS.cjs.map} +1 -1
- package/dist/shared/{attaform.ij2W7VTw.cjs → attaform.Ib2seKUE.cjs} +41 -25
- package/dist/shared/{attaform.BqkFQ2B9.mjs.map → attaform.Ib2seKUE.cjs.map} +1 -1
- package/dist/shared/{attaform.BKxpBJVF.mjs → attaform.a1GnhjVk.mjs} +2 -2
- package/dist/shared/{attaform.BKxpBJVF.mjs.map → attaform.a1GnhjVk.mjs.map} +1 -1
- package/dist/shared/{attaform.CEZP3i3I.d.mts → attaform.gj8dtOlx.d.mts} +50 -14
- package/dist/shared/{attaform.DDIn4fv-.mjs → attaform.shkNCMEz.mjs} +3 -3
- package/dist/shared/{attaform.DDIn4fv-.mjs.map → attaform.shkNCMEz.mjs.map} +1 -1
- package/dist/zod-v3.cjs +2 -2
- package/dist/zod-v3.d.cts +1 -1
- package/dist/zod-v3.d.mts +1 -1
- package/dist/zod-v3.d.ts +1 -1
- package/dist/zod-v3.mjs +2 -2
- package/dist/zod-v4.cjs +2 -2
- package/dist/zod-v4.d.cts +2 -2
- package/dist/zod-v4.d.mts +2 -2
- package/dist/zod-v4.d.ts +2 -2
- package/dist/zod-v4.mjs +2 -2
- package/dist/zod.cjs +2 -2
- package/dist/zod.d.cts +1 -1
- package/dist/zod.d.mts +1 -1
- package/dist/zod.d.ts +1 -1
- package/dist/zod.mjs +2 -2
- package/package.json +1 -1
|
@@ -1036,9 +1036,9 @@ type AnyForm = {
|
|
|
1036
1036
|
* - `gate`: this step's own role as a hard prerequisite. `null` when the
|
|
1037
1037
|
* step is not a `gate()`; `'uncleared'` while its member form is
|
|
1038
1038
|
* unconfirmed (so it seals every later step); `'cleared'` once
|
|
1039
|
-
* confirmed by a clean member submit or
|
|
1040
|
-
*
|
|
1041
|
-
* that a function slot drops resolves to `null`.
|
|
1039
|
+
* confirmed by a clean member submit or seeded cleared via
|
|
1040
|
+
* `defaultStatuses`. Reflects the live compiled shape, so a conditional
|
|
1041
|
+
* `gate()` that a function slot drops resolves to `null`.
|
|
1042
1042
|
*
|
|
1043
1043
|
* Noop forms generated for string slots surface as default-valid
|
|
1044
1044
|
* (`{ valid: true, dirty: false, submitted: false, errorCount: 0, locked: false, gate: null }`),
|
|
@@ -1054,12 +1054,27 @@ type FormStatus = {
|
|
|
1054
1054
|
readonly gate: 'cleared' | 'uncleared' | null;
|
|
1055
1055
|
};
|
|
1056
1056
|
/**
|
|
1057
|
-
* Seed shape accepted by `useWizard({ defaultStatuses })`.
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
|
|
1062
|
-
|
|
1057
|
+
* Seed shape accepted by `useWizard({ defaultStatuses })`. Every field is
|
|
1058
|
+
* optional; an omitted meta field falls back to the pending sentinel on
|
|
1059
|
+
* read.
|
|
1060
|
+
*
|
|
1061
|
+
* `locked` is never accepted: it is purely live-derived (sealed behind an
|
|
1062
|
+
* earlier uncleared gate) and overlaid on every status read, so a seeded
|
|
1063
|
+
* value would be ignored.
|
|
1064
|
+
*
|
|
1065
|
+
* `gate` is a WRITE-only seed, not a status field echoed back on read. A
|
|
1066
|
+
* seed of `'cleared'` latches the gate's cleared state once at construction
|
|
1067
|
+
* (an SSR restore of a confirmed prerequisite); the live `gate` overlay
|
|
1068
|
+
* then owns the read. `'uncleared'` is the default and seeds nothing. Only
|
|
1069
|
+
* a step that compiles to a `gate()` honors it — other keys ignore it.
|
|
1070
|
+
*/
|
|
1071
|
+
type FormStatusSeed = {
|
|
1072
|
+
readonly valid?: boolean;
|
|
1073
|
+
readonly dirty?: boolean;
|
|
1074
|
+
readonly submitted?: boolean;
|
|
1075
|
+
readonly errorCount?: number;
|
|
1076
|
+
readonly gate?: 'cleared' | 'uncleared';
|
|
1077
|
+
};
|
|
1063
1078
|
/**
|
|
1064
1079
|
* Flat error shape returned per form by `wizard.allErrors[key]`. Each
|
|
1065
1080
|
* entry carries the formKey + path tuple so consumers can route to the
|
|
@@ -1314,12 +1329,20 @@ type WizardOptions = {
|
|
|
1314
1329
|
* Status resolution priority per form:
|
|
1315
1330
|
* 1. `store.defaultsResolved === true` → derive from `form.meta`
|
|
1316
1331
|
* 2. else noop form → built-in always-valid status
|
|
1317
|
-
* 3. else seed value for this key →
|
|
1332
|
+
* 3. else seed value for this key → seed over the pending sentinel
|
|
1318
1333
|
* 4. else → pending sentinel
|
|
1319
1334
|
*
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1322
|
-
*
|
|
1335
|
+
* `locked` is never seeded: it is computed live from the wizard's gates
|
|
1336
|
+
* and overlaid on every status read. `gate: 'cleared'` IS honored, but as
|
|
1337
|
+
* a one-shot seed of the gate's cleared latch at construction (an SSR
|
|
1338
|
+
* restore of a confirmed prerequisite), not as a status field echoed on
|
|
1339
|
+
* read — the live `gate` overlay owns the read. Only a step that compiles
|
|
1340
|
+
* to a `gate()` honors it. See `FormStatusSeed`.
|
|
1341
|
+
*
|
|
1342
|
+
* SSR note: the async factory resolves after hydration (client-only), so
|
|
1343
|
+
* a gate seeded through it clears post-hydration. For a gate that must
|
|
1344
|
+
* render open on the first server byte, use the plain or sync-factory
|
|
1345
|
+
* form (resolve server truth in the page's `setup` await).
|
|
1323
1346
|
*
|
|
1324
1347
|
* Unknown keys in the seed object dev-warn so a stale resume payload
|
|
1325
1348
|
* surfaces at construction.
|
|
@@ -1559,7 +1582,19 @@ type WizardForms<S> = FormsRecordOf<S> & Readonly<Record<FormKey, AnyForm>>;
|
|
|
1559
1582
|
* - `reset()` — zeros wizard lifecycle (`submissionAttempts`,
|
|
1560
1583
|
* `visited`), resets every form, returns
|
|
1561
1584
|
* `currentStep` to `steps[0].key`, and invokes
|
|
1562
|
-
* `persist` with the cleared state.
|
|
1585
|
+
* `persist` with the cleared state. Re-applies the
|
|
1586
|
+
* `defaultStatuses` gate seed, so a reboot returns to
|
|
1587
|
+
* the seeded initial clearance, not fully sealed.
|
|
1588
|
+
* - `relock(key, commit)` — re-seal a cleared gate, contingent on
|
|
1589
|
+
* `commit`. Awaits `commit` (a server-side revoke) and
|
|
1590
|
+
* re-seals only if it resolves clean, so the gate reflects
|
|
1591
|
+
* server-confirmed truth the same way a clearing submit
|
|
1592
|
+
* does; a thrown `commit` leaves it as-is. Seal-only (never
|
|
1593
|
+
* opens a gate), so it cannot become the leading-signal
|
|
1594
|
+
* foot-gun `gate()` exists to prevent. `commit` is required
|
|
1595
|
+
* (pass `() => {}` for a deliberate client-only re-seal).
|
|
1596
|
+
* Resolves whether the gate ended up sealed; never rejects.
|
|
1597
|
+
* Resolves `false` (dev-warn) on a non-gate key.
|
|
1563
1598
|
*/
|
|
1564
1599
|
type UseWizardReturnType<S extends ReadonlyArray<StepSlot> = ReadonlyArray<StepSlot>> = {
|
|
1565
1600
|
readonly key: string;
|
|
@@ -1588,6 +1623,7 @@ type UseWizardReturnType<S extends ReadonlyArray<StepSlot> = ReadonlyArray<StepS
|
|
|
1588
1623
|
readonly tryNext: () => Promise<boolean>;
|
|
1589
1624
|
readonly handleSubmit: (onSubmit: WizardOnSubmit, onError?: WizardOnError) => (event?: Event) => Promise<void>;
|
|
1590
1625
|
readonly reset: () => void;
|
|
1626
|
+
readonly relock: (key: FormKey, commit: () => void | Promise<void>) => Promise<boolean>;
|
|
1591
1627
|
};
|
|
1592
1628
|
|
|
1593
1629
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const serializeScript = require('./attaform.
|
|
3
|
+
const serializeScript = require('./attaform.Ib2seKUE.cjs');
|
|
4
4
|
const devtoolsShared = require('./attaform.BBaMFa-k.cjs');
|
|
5
|
-
const walkFieldMeta = require('./attaform.
|
|
5
|
+
const walkFieldMeta = require('./attaform.CX2NHAFs.cjs');
|
|
6
6
|
const zod = require('zod');
|
|
7
7
|
|
|
8
8
|
const fieldMeta = walkFieldMeta.fieldMetaStore;
|
|
@@ -1299,4 +1299,4 @@ exports.unwrapPipe = unwrapPipe;
|
|
|
1299
1299
|
exports.useForm = useForm;
|
|
1300
1300
|
exports.withMeta = withMeta;
|
|
1301
1301
|
exports.zodV4Adapter = zodV4Adapter;
|
|
1302
|
-
//# sourceMappingURL=attaform.
|
|
1302
|
+
//# sourceMappingURL=attaform.DXwJVUNS.cjs.map
|