attaform 0.27.2 → 0.27.3

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 (51) hide show
  1. package/dist/abstract.cjs +1 -1
  2. package/dist/abstract.d.cts +2 -2
  3. package/dist/abstract.d.mts +2 -2
  4. package/dist/abstract.d.ts +2 -2
  5. package/dist/abstract.mjs +1 -1
  6. package/dist/chunks/fingerprint2.cjs +1 -1
  7. package/dist/chunks/fingerprint2.mjs +1 -1
  8. package/dist/index.cjs +2 -2
  9. package/dist/index.d.cts +1 -1
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.mjs +2 -2
  13. package/dist/shared/{attaform.BAlfXoAx.mjs → attaform.BKxpBJVF.mjs} +2 -2
  14. package/dist/shared/{attaform.BAlfXoAx.mjs.map → attaform.BKxpBJVF.mjs.map} +1 -1
  15. package/dist/shared/{attaform.CvaPYOZu.cjs → attaform.BOIpRdeG.cjs} +3 -3
  16. package/dist/shared/{attaform.CvaPYOZu.cjs.map → attaform.BOIpRdeG.cjs.map} +1 -1
  17. package/dist/shared/{attaform.DIJTp_Kv.d.cts → attaform.BjGedLx2.d.cts} +21 -9
  18. package/dist/shared/{attaform.DGCijpZT.mjs → attaform.BqkFQ2B9.mjs} +14 -7
  19. package/dist/shared/{attaform.CXHebpij.cjs.map → attaform.BqkFQ2B9.mjs.map} +1 -1
  20. package/dist/shared/{attaform.Dcj-OS43.d.mts → attaform.CEZP3i3I.d.mts} +21 -9
  21. package/dist/shared/{attaform.yOE3udL1.mjs → attaform.DDIn4fv-.mjs} +3 -3
  22. package/dist/shared/{attaform.yOE3udL1.mjs.map → attaform.DDIn4fv-.mjs.map} +1 -1
  23. package/dist/shared/{attaform.6IZBjA1Q.mjs → attaform.DHQjaGMP.mjs} +4 -4
  24. package/dist/shared/{attaform.6IZBjA1Q.mjs.map → attaform.DHQjaGMP.mjs.map} +1 -1
  25. package/dist/shared/{attaform.BF1mYHru.cjs → attaform.DeHCOlC8.cjs} +3 -3
  26. package/dist/shared/{attaform.BF1mYHru.cjs.map → attaform.DeHCOlC8.cjs.map} +1 -1
  27. package/dist/shared/{attaform.gyed1fGh.mjs → attaform.DuVCclwv.mjs} +3 -3
  28. package/dist/shared/{attaform.gyed1fGh.mjs.map → attaform.DuVCclwv.mjs.map} +1 -1
  29. package/dist/shared/{attaform.C1SJy524.cjs → attaform.Mg4g-J0z.cjs} +4 -4
  30. package/dist/shared/{attaform.C1SJy524.cjs.map → attaform.Mg4g-J0z.cjs.map} +1 -1
  31. package/dist/shared/{attaform.CIPwCQe8.cjs → attaform.dX58Auwf.cjs} +2 -2
  32. package/dist/shared/{attaform.CIPwCQe8.cjs.map → attaform.dX58Auwf.cjs.map} +1 -1
  33. package/dist/shared/{attaform.B2d0FszH.d.ts → attaform.gqOCvpSB.d.ts} +21 -9
  34. package/dist/shared/{attaform.CXHebpij.cjs → attaform.ij2W7VTw.cjs} +14 -7
  35. package/dist/shared/{attaform.DGCijpZT.mjs.map → attaform.ij2W7VTw.cjs.map} +1 -1
  36. package/dist/zod-v3.cjs +2 -2
  37. package/dist/zod-v3.d.cts +1 -1
  38. package/dist/zod-v3.d.mts +1 -1
  39. package/dist/zod-v3.d.ts +1 -1
  40. package/dist/zod-v3.mjs +2 -2
  41. package/dist/zod-v4.cjs +2 -2
  42. package/dist/zod-v4.d.cts +2 -2
  43. package/dist/zod-v4.d.mts +2 -2
  44. package/dist/zod-v4.d.ts +2 -2
  45. package/dist/zod-v4.mjs +2 -2
  46. package/dist/zod.cjs +2 -2
  47. package/dist/zod.d.cts +1 -1
  48. package/dist/zod.d.mts +1 -1
  49. package/dist/zod.d.ts +1 -1
  50. package/dist/zod.mjs +2 -2
  51. package/package.json +1 -1
@@ -1026,13 +1026,24 @@ type AnyForm = {
1026
1026
  * `submissionAttempts > 0` is the "user has tried" signal.
1027
1027
  * - `errorCount` — `form.meta.errorCount`. Count of active validation
1028
1028
  * errors (zero when valid).
1029
- * - `locked`: `true` when this step sits after an uncleared `gate()`
1030
- * (see `gate`). Its member form is frozen (data writes no-op) and
1031
- * navigation to it is refused, so a stepper can render it as an
1032
- * unreachable gate. `false` when no gate seals it.
1029
+ * - `locked`: `true` when this step sits after an uncleared gate. Its
1030
+ * member form is frozen (data writes no-op) and navigation to it is
1031
+ * refused, so a stepper can render it as an unreachable step. `false`
1032
+ * when no gate seals it. Orthogonal to `gate`: the first uncleared
1033
+ * gate reads `locked: false` (you must reach it to clear it), while a
1034
+ * later gate sealed behind it reads both `gate: 'uncleared'` and
1035
+ * `locked: true`.
1036
+ * - `gate`: this step's own role as a hard prerequisite. `null` when the
1037
+ * step is not a `gate()`; `'uncleared'` while its member form is
1038
+ * unconfirmed (so it seals every later step); `'cleared'` once
1039
+ * confirmed by a clean member submit or a seeded-valid form gate at
1040
+ * mount. Reflects the live compiled shape, so a conditional `gate()`
1041
+ * that a function slot drops resolves to `null`.
1033
1042
  *
1034
1043
  * Noop forms generated for string slots surface as default-valid
1035
- * (`{ valid: true, dirty: false, submitted: false, errorCount: 0, locked: false }`).
1044
+ * (`{ valid: true, dirty: false, submitted: false, errorCount: 0, locked: false, gate: null }`),
1045
+ * unless the string slot is a `gate('...')`, whose `gate` tracks the
1046
+ * in-session acknowledgment.
1036
1047
  */
1037
1048
  type FormStatus = {
1038
1049
  readonly valid: boolean;
@@ -1040,14 +1051,15 @@ type FormStatus = {
1040
1051
  readonly submitted: boolean;
1041
1052
  readonly errorCount: number;
1042
1053
  readonly locked: boolean;
1054
+ readonly gate: 'cleared' | 'uncleared' | null;
1043
1055
  };
1044
1056
  /**
1045
1057
  * Seed shape accepted by `useWizard({ defaultStatuses })`. Mirrors
1046
- * `FormStatus` minus `locked`: the lock flag is computed live from the
1047
- * wizard's gates and overlaid on every status read, so a seed never
1048
- * carries it (a seeded value would be ignored).
1058
+ * `FormStatus` minus its two live-computed flags, `locked` and `gate`:
1059
+ * both are derived from the wizard's gates and overlaid on every status
1060
+ * read, so a seed never carries them (a seeded value would be ignored).
1049
1061
  */
1050
- type FormStatusSeed = Omit<FormStatus, 'locked'>;
1062
+ type FormStatusSeed = Omit<FormStatus, 'locked' | 'gate'>;
1051
1063
  /**
1052
1064
  * Flat error shape returned per form by `wizard.allErrors[key]`. Each
1053
1065
  * entry carries the formKey + path tuple so consumers can route to the
@@ -6346,14 +6346,16 @@ const PENDING_STATUS = {
6346
6346
  dirty: false,
6347
6347
  submitted: false,
6348
6348
  errorCount: 0,
6349
- locked: false
6349
+ locked: false,
6350
+ gate: null
6350
6351
  };
6351
6352
  const NOOP_VALID_STATUS = {
6352
6353
  valid: true,
6353
6354
  dirty: false,
6354
6355
  submitted: false,
6355
6356
  errorCount: 0,
6356
- locked: false
6357
+ locked: false,
6358
+ gate: null
6357
6359
  };
6358
6360
  const EMPTY_LOCK_SET = /* @__PURE__ */ new Set();
6359
6361
  function asStatusSource(form) {
@@ -6835,6 +6837,10 @@ function useWizard(options) {
6835
6837
  const source = asStatusSource(form);
6836
6838
  const computedStatus = computed(() => {
6837
6839
  const locked = navLockSet.value.has(form.key);
6840
+ let gate = null;
6841
+ if (gatePositions.value.includes(form.key)) {
6842
+ gate = clearedGates.has(form.key) ? "cleared" : "uncleared";
6843
+ }
6838
6844
  if (isFormReady(form.key)) {
6839
6845
  const meta = source.meta;
6840
6846
  if (meta !== void 0 && meta !== null) {
@@ -6843,16 +6849,17 @@ function useWizard(options) {
6843
6849
  dirty: meta.dirty,
6844
6850
  submitted: meta.submitted,
6845
6851
  errorCount: meta.errorCount,
6846
- locked
6852
+ locked,
6853
+ gate
6847
6854
  };
6848
6855
  }
6849
6856
  }
6850
6857
  if (noopForms.has(form.key)) {
6851
- return locked ? { ...NOOP_VALID_STATUS, locked: true } : NOOP_VALID_STATUS;
6858
+ return locked || gate !== null ? { ...NOOP_VALID_STATUS, locked, gate } : NOOP_VALID_STATUS;
6852
6859
  }
6853
6860
  const seed = seedRef.value?.[form.key];
6854
- if (seed !== void 0) return { ...seed, locked };
6855
- return locked ? { ...PENDING_STATUS, locked: true } : PENDING_STATUS;
6861
+ if (seed !== void 0) return { ...seed, locked, gate };
6862
+ return locked || gate !== null ? { ...PENDING_STATUS, locked, gate } : PENDING_STATUS;
6856
6863
  });
6857
6864
  statusCache.set(form.key, computedStatus);
6858
6865
  return computedStatus;
@@ -7566,4 +7573,4 @@ function escapeForInlineScript(json) {
7566
7573
  }
7567
7574
 
7568
7575
  export { AttaformErrorCode as A, DEFAULT_TIMINGS as D, defaultDisplayState as a, defineCoercion as b, injectWizard as c, defaultCoercionRules as d, escapeForInlineScript as e, isUnset as f, gate as g, useAbstractForm as h, injectForm as i, useRegister as j, useWizard as k, lazy as l, makeDefaultDisplayState as m, isPlainRecord as n, safeAssign as o, slimKindOf as p, humanize as q, getAtPath as r, safeOwnRead as s, setAtPath as t, unset as u };
7569
- //# sourceMappingURL=attaform.DGCijpZT.mjs.map
7576
+ //# sourceMappingURL=attaform.BqkFQ2B9.mjs.map