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
@@ -6348,14 +6348,16 @@ const PENDING_STATUS = {
6348
6348
  dirty: false,
6349
6349
  submitted: false,
6350
6350
  errorCount: 0,
6351
- locked: false
6351
+ locked: false,
6352
+ gate: null
6352
6353
  };
6353
6354
  const NOOP_VALID_STATUS = {
6354
6355
  valid: true,
6355
6356
  dirty: false,
6356
6357
  submitted: false,
6357
6358
  errorCount: 0,
6358
- locked: false
6359
+ locked: false,
6360
+ gate: null
6359
6361
  };
6360
6362
  const EMPTY_LOCK_SET = /* @__PURE__ */ new Set();
6361
6363
  function asStatusSource(form) {
@@ -6837,6 +6839,10 @@ function useWizard(options) {
6837
6839
  const source = asStatusSource(form);
6838
6840
  const computedStatus = vue.computed(() => {
6839
6841
  const locked = navLockSet.value.has(form.key);
6842
+ let gate = null;
6843
+ if (gatePositions.value.includes(form.key)) {
6844
+ gate = clearedGates.has(form.key) ? "cleared" : "uncleared";
6845
+ }
6840
6846
  if (isFormReady(form.key)) {
6841
6847
  const meta = source.meta;
6842
6848
  if (meta !== void 0 && meta !== null) {
@@ -6845,16 +6851,17 @@ function useWizard(options) {
6845
6851
  dirty: meta.dirty,
6846
6852
  submitted: meta.submitted,
6847
6853
  errorCount: meta.errorCount,
6848
- locked
6854
+ locked,
6855
+ gate
6849
6856
  };
6850
6857
  }
6851
6858
  }
6852
6859
  if (noopForms.has(form.key)) {
6853
- return locked ? { ...NOOP_VALID_STATUS, locked: true } : NOOP_VALID_STATUS;
6860
+ return locked || gate !== null ? { ...NOOP_VALID_STATUS, locked, gate } : NOOP_VALID_STATUS;
6854
6861
  }
6855
6862
  const seed = seedRef.value?.[form.key];
6856
- if (seed !== void 0) return { ...seed, locked };
6857
- return locked ? { ...PENDING_STATUS, locked: true } : PENDING_STATUS;
6863
+ if (seed !== void 0) return { ...seed, locked, gate };
6864
+ return locked || gate !== null ? { ...PENDING_STATUS, locked, gate } : PENDING_STATUS;
6858
6865
  });
6859
6866
  statusCache.set(form.key, computedStatus);
6860
6867
  return computedStatus;
@@ -7590,4 +7597,4 @@ exports.unset = unset;
7590
7597
  exports.useAbstractForm = useAbstractForm;
7591
7598
  exports.useRegister = useRegister;
7592
7599
  exports.useWizard = useWizard;
7593
- //# sourceMappingURL=attaform.CXHebpij.cjs.map
7600
+ //# sourceMappingURL=attaform.ij2W7VTw.cjs.map