attaform 0.31.0 → 0.31.1

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 (50) hide show
  1. package/dist/abstract.d.mts +5 -5
  2. package/dist/abstract.mjs +4 -4
  3. package/dist/dev/abstract.mjs +4 -4
  4. package/dist/dev/chunks/devtools.mjs +1 -1
  5. package/dist/dev/directive.mjs +1 -1
  6. package/dist/dev/history.mjs +15 -2
  7. package/dist/dev/index.mjs +5 -5
  8. package/dist/dev/runtime/plugins/attaform.mjs +1 -1
  9. package/dist/dev/shared/{attaform-dev.zlvDr0WB.mjs → attaform-dev.04aupFBW.mjs} +3 -2
  10. package/dist/dev/shared/{attaform-dev.y9x9Vp9F.mjs → attaform-dev.3uTCYwy8.mjs} +572 -135
  11. package/dist/dev/shared/{attaform-dev.DJ3nsWw6.mjs → attaform-dev.BpVGFSFa.mjs} +18 -9
  12. package/dist/dev/shared/{attaform-dev.B1q-x9R9.mjs → attaform-dev.Bu6wgrA5.mjs} +1 -1
  13. package/dist/dev/shared/{attaform-dev.k5X47GMD.mjs → attaform-dev.Cbx0AiQF.mjs} +3 -2
  14. package/dist/dev/shared/attaform-dev.CwYTWyPX.mjs +120 -0
  15. package/dist/dev/shared/{attaform-dev.DlaT4xGd.mjs → attaform-dev.D7lKyM_7.mjs} +4 -4
  16. package/dist/dev/shared/{attaform-dev.CtyqGia7.mjs → attaform-dev.OceE0X3v.mjs} +4 -4
  17. package/dist/dev/shared/{attaform-dev.Caibt7sb.mjs → attaform-dev.PTGM9KE1.mjs} +6 -6
  18. package/dist/{shared/attaform.8mfKZCwH.mjs → dev/shared/attaform-dev.n6n00owJ.mjs} +49 -128
  19. package/dist/dev/zod-v3.mjs +6 -6
  20. package/dist/dev/zod-v4.mjs +6 -6
  21. package/dist/dev/zod.mjs +5 -5
  22. package/dist/directive.d.mts +2 -2
  23. package/dist/directive.mjs +1 -1
  24. package/dist/history.d.mts +1 -1
  25. package/dist/history.mjs +15 -2
  26. package/dist/index.d.mts +16 -55
  27. package/dist/index.mjs +5 -5
  28. package/dist/runtime/plugins/attaform.mjs +1 -1
  29. package/dist/shared/{attaform.BWUn8Kjy.mjs → attaform.B5b-HmhH.mjs} +18 -9
  30. package/dist/shared/{attaform.CRVe8s82.d.mts → attaform.B9PYKlhB.d.mts} +43 -19
  31. package/dist/shared/{attaform.DxKQsqFZ.mjs → attaform.BPMOl562.mjs} +3 -2
  32. package/dist/{dev/shared/attaform-dev.CZz4GYZ6.mjs → shared/attaform.BPSqtU7a.mjs} +44 -156
  33. package/dist/shared/{attaform.CdZIEf7_.mjs → attaform.BhtAZysa.mjs} +3 -2
  34. package/dist/shared/{attaform.DAo0QBmS.d.mts → attaform.CYlF4P6X.d.mts} +31 -10
  35. package/dist/shared/{attaform.C4shmwyJ.mjs → attaform.CdA9bfRv.mjs} +1 -1
  36. package/dist/shared/{attaform.DNPJPOO7.mjs → attaform.DAf4ehIe.mjs} +569 -134
  37. package/dist/shared/{attaform.D9RqPgGu.d.mts → attaform.DZOynI6c.d.mts} +1 -1
  38. package/dist/shared/{attaform.L011tHgJ.mjs → attaform.KEfNRDot.mjs} +4 -4
  39. package/dist/shared/attaform._1Zp3mDG.mjs +96 -0
  40. package/dist/shared/{attaform.DZnrDrNb.d.mts → attaform.i13OEHJF.d.mts} +60 -7
  41. package/dist/shared/{attaform.DL2nl_QR.mjs → attaform.j9xI_ObC.mjs} +6 -6
  42. package/dist/shared/{attaform.LUPC-2Qg.mjs → attaform.u6jfHoed.mjs} +4 -4
  43. package/dist/zod-v3.d.mts +4 -4
  44. package/dist/zod-v3.mjs +6 -6
  45. package/dist/zod-v4.d.mts +15 -11
  46. package/dist/zod-v4.mjs +6 -6
  47. package/dist/zod.d.mts +4 -4
  48. package/dist/zod.mjs +5 -5
  49. package/package.json +2 -1
  50. package/skills/attaform/SKILL.md +1 -0
@@ -1,4 +1,4 @@
1
- import { G as GenericForm, F as FormKey, a as UseFormReturnType, _ as RegisterValue, v as Path, w as PathKey, aq as DisplayCtx, ar as GetDisplayState, as as DisplayMachine, at as FieldRecord, au as ErrorCell, ac as ValidationError, av as OriginalsRecord, A as AbstractSchema, ag as WriteMeta, d as DeepPartial, ah as WriteShape, aw as AttaformDomBinding, ax as TransformAbortHolder } from './attaform.DZnrDrNb.mjs';
1
+ import { G as GenericForm, F as FormKey, a as UseFormReturnType, _ as RegisterValue, v as Path, w as PathKey, aq as DisplayCtx, ar as GetDisplayState, as as DisplayMachine, at as FieldRecord, au as ErrorCell, ac as ValidationError, av as OriginalsRecord, A as AbstractSchema, ag as WriteMeta, d as DeepPartial, ah as WriteShape, aw as StructureSnapshot, ax as AttaformDomBinding, ay as TransformAbortHolder } from './attaform.i13OEHJF.mjs';
2
2
  import { Ref, ComputedRef, ShallowRef, App, InjectionKey, Plugin } from 'vue';
3
3
 
4
4
  /** Options accepted by `injectForm` in place of a bare key string. */
@@ -286,6 +286,13 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
286
286
  readonly pathSweep: DynamicPathSweep;
287
287
  readonly formKey: FormKey;
288
288
  readonly form: Ref<F>;
289
+ /**
290
+ * Per-path field records: one per leaf from construction, and one per
291
+ * container, the root (`[]`) included, once a directive binds to it or a
292
+ * write takes leaves away beneath it. A container's own record holds the
293
+ * stamp of that write and the interaction history of the descendants it
294
+ * took; see `stampContainers` and `foldInteractionHistory`.
295
+ */
289
296
  readonly fields: Map<PathKey, FieldRecord>;
290
297
  /**
291
298
  * The tagged error store: one cell per error-bearing path, each segregating
@@ -641,6 +648,19 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
641
648
  * empty is skipped.
642
649
  */
643
650
  restoreErrorCells(entries: ReadonlyArray<readonly [PathKey, ErrorCell]>): void;
651
+ /**
652
+ * The per-element bookkeeping as it stands, for a history position to put
653
+ * back with its value (see `StructureSnapshot`). The entries are copied,
654
+ * and the records they hold are never mutated in place, so the snapshot
655
+ * stays detached from the live store.
656
+ */
657
+ captureStructure(): StructureSnapshot;
658
+ /**
659
+ * Put a `captureStructure()` back, before the value it was taken with is
660
+ * restored, so the write that restores it compares each row against its
661
+ * own baseline. Every reading it can change is woken.
662
+ */
663
+ restoreStructure(snapshot: StructureSnapshot): void;
644
664
  /**
645
665
  * Merged read of the cell at `path`, in schema -> blank -> user order:
646
666
  * structural validation first, the synthesized blank entry between, user
@@ -729,18 +749,19 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
729
749
  * insert or removal) against its construction / reset baseline. The
730
750
  * structural half of `dirty`: per-element baselines travel with their
731
751
  * element across a mutation, so a positional value comparison alone cannot
732
- * see the shape change.
752
+ * see the shape change. `key` is the canonical key of `path`.
733
753
  */
734
- hasStructuralChangeUnder(path: Path): boolean;
754
+ hasStructuralChangeUnder(path: Path, key: PathKey): boolean;
735
755
  /**
736
- * Whether a baseline-present container under `path` was replaced wholesale
737
- * by a non-container (`setValue('profile', undefined)` and the like) and is
738
- * still absent. The other half of removal-driven `dirty`: every leaf in such
739
- * a subtree vanishes at once, so neither the present-leaf walk nor the array
740
- * tracker sees the loss. Self-filters by current liveness, so a refilled
741
- * path stops counting.
756
+ * Whether a path under `path` that held a real baseline value was removed
757
+ * and is still absent: a dropped key, an emptied container, a row a
758
+ * wholesale write took away. The other half of removal-driven `dirty`: the
759
+ * present-leaf walk never visits an absent leaf, and the array tracker
760
+ * follows only array lengths and orders. A path a later write brought back
761
+ * stops counting, and the present-leaf walk judges it instead. `key` is the
762
+ * canonical key of `path`.
742
763
  */
743
- hasRemovedSubtreeUnder(path: Path): boolean;
764
+ hasRemovedSubtreeUnder(path: Path, key: PathKey): boolean;
744
765
  getFieldRecord(path: Path): FieldRecord | undefined;
745
766
  /**
746
767
  * Cancel every in-flight field-level validation run: clear the timers of
@@ -1,4 +1,4 @@
1
- import { c as RegistryNotInstalledError, O as OutsideSetupError, g as pathKeyToDotted } from './attaform.CdZIEf7_.mjs';
1
+ import { c as RegistryNotInstalledError, O as OutsideSetupError, g as pathKeyToDotted } from './attaform.BhtAZysa.mjs';
2
2
  import { shallowReactive, getCurrentInstance, inject } from 'vue';
3
3
 
4
4
  function detectSSR(options = {}) {