attaform 0.31.0 → 0.31.2

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 (52) hide show
  1. package/dist/abstract.d.mts +5 -5
  2. package/dist/abstract.mjs +5 -4
  3. package/dist/dev/abstract.mjs +5 -4
  4. package/dist/dev/chunks/devtools.mjs +1 -1
  5. package/dist/dev/directive.mjs +1 -1
  6. package/dist/dev/history.mjs +126 -6
  7. package/dist/dev/index.mjs +6 -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.CtyqGia7.mjs → attaform-dev.BKWPjEB2.mjs} +5 -4
  11. package/dist/dev/shared/{attaform-dev.DlaT4xGd.mjs → attaform-dev.BnLLxX2l.mjs} +4 -4
  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.CKSqs_xQ.mjs} +3 -2
  14. package/dist/dev/shared/{attaform-dev.DJ3nsWw6.mjs → attaform-dev.Cf_hZfbT.mjs} +18 -9
  15. package/dist/dev/shared/{attaform-dev.y9x9Vp9F.mjs → attaform-dev.DLk51W7-.mjs} +565 -926
  16. package/dist/dev/shared/attaform-dev.DoG8mZTq.mjs +127 -0
  17. package/dist/dev/shared/attaform-dev.G-3XDl9F.mjs +1192 -0
  18. package/dist/dev/shared/{attaform-dev.Caibt7sb.mjs → attaform-dev.oguHqv1W.mjs} +11 -10
  19. package/dist/dev/zod-v3.mjs +7 -6
  20. package/dist/dev/zod-v4.mjs +7 -6
  21. package/dist/dev/zod.mjs +6 -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 +126 -6
  26. package/dist/index.d.mts +16 -55
  27. package/dist/index.mjs +6 -5
  28. package/dist/runtime/plugins/attaform.mjs +1 -1
  29. package/dist/shared/{attaform.DL2nl_QR.mjs → attaform.3kV6PqVJ.mjs} +11 -10
  30. package/dist/shared/{attaform.L011tHgJ.mjs → attaform.BJeiuJE2.mjs} +4 -4
  31. package/dist/shared/attaform.BNUhW4qC.mjs +103 -0
  32. package/dist/shared/{attaform.CdZIEf7_.mjs → attaform.BhtAZysa.mjs} +3 -2
  33. package/dist/shared/{attaform.BWUn8Kjy.mjs → attaform.BlAmZ-WU.mjs} +18 -9
  34. package/dist/shared/{attaform.LUPC-2Qg.mjs → attaform.CMzc4bPI.mjs} +5 -4
  35. package/dist/shared/{attaform.C4shmwyJ.mjs → attaform.CdA9bfRv.mjs} +1 -1
  36. package/dist/shared/attaform.CgyyJVuq.mjs +1187 -0
  37. package/dist/shared/{attaform.DAo0QBmS.d.mts → attaform.CibLYe9-.d.mts} +214 -173
  38. package/dist/shared/{attaform.DNPJPOO7.mjs → attaform.DCUJCKyG.mjs} +562 -925
  39. package/dist/shared/{attaform.D9RqPgGu.d.mts → attaform.DCyZT7u-.d.mts} +1 -1
  40. package/dist/shared/{attaform.CRVe8s82.d.mts → attaform.DD0Y8krq.d.mts} +43 -19
  41. package/dist/shared/{attaform.DxKQsqFZ.mjs → attaform.T0YjhjPU.mjs} +3 -2
  42. package/dist/shared/{attaform.DZnrDrNb.d.mts → attaform.bI_4nKZp.d.mts} +119 -8
  43. package/dist/zod-v3.d.mts +4 -4
  44. package/dist/zod-v3.mjs +7 -6
  45. package/dist/zod-v4.d.mts +15 -11
  46. package/dist/zod-v4.mjs +7 -6
  47. package/dist/zod.d.mts +4 -4
  48. package/dist/zod.mjs +6 -5
  49. package/package.json +2 -1
  50. package/skills/attaform/SKILL.md +1 -0
  51. package/dist/dev/shared/attaform-dev.CZz4GYZ6.mjs +0 -386
  52. package/dist/shared/attaform.8mfKZCwH.mjs +0 -358
@@ -1,8 +1,8 @@
1
- import { A as AttaformRegistry } from './shared/attaform.DAo0QBmS.mjs';
2
- export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.DAo0QBmS.mjs';
3
- import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.DZnrDrNb.mjs';
4
- export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, h as FieldMetaPayload, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, o as FormMeta, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as SchemaParseErrorWithData, a0 as SchemaParseErrorWithoutData, a1 as SchemaParseResult, a2 as SchemaParseSuccess, a3 as Segment, a4 as SetValueCallback, a5 as SetValuePayload, a6 as SettledValidationStatus, a7 as SlimPrimitiveKind, a8 as SubmitHandler, a9 as Unset, aa as ValidateOn, ab as ValidateOnConfig, ac as ValidationError, ad as ValidationResponse, ae as ValidationResponseWithoutValue, af as ValueOfUnion, ag as WriteMeta, ah as WriteShape, ai as canonicalizePath, aj as isPathPrefix, ak as isUnset, al as parseDottedPath, am as unset } from './shared/attaform.DZnrDrNb.mjs';
5
- export { v as vRegister } from './shared/attaform.D9RqPgGu.mjs';
1
+ import { A as AttaformRegistry } from './shared/attaform.CibLYe9-.mjs';
2
+ export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.CibLYe9-.mjs';
3
+ import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.bI_4nKZp.mjs';
4
+ export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, h as FieldMetaPayload, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, o as FormMeta, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as SchemaParseErrorWithData, a0 as SchemaParseErrorWithoutData, a1 as SchemaParseResult, a2 as SchemaParseSuccess, a3 as Segment, a4 as SetValueCallback, a5 as SetValuePayload, a6 as SettledValidationStatus, a7 as SlimPrimitiveKind, a8 as SubmitHandler, a9 as Unset, aa as ValidateOn, ab as ValidateOnConfig, ac as ValidationError, ad as ValidationResponse, ae as ValidationResponseWithoutValue, af as ValueOfUnion, ag as WriteMeta, ah as WriteShape, ai as canonicalizePath, aj as isPathPrefix, ak as isUnset, al as parseDottedPath, am as unset } from './shared/attaform.bI_4nKZp.mjs';
5
+ export { v as vRegister } from './shared/attaform.DCyZT7u-.mjs';
6
6
  import 'vue';
7
7
 
8
8
  /**
package/dist/abstract.mjs CHANGED
@@ -1,5 +1,6 @@
1
- export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, c as useAbstractForm, d as useRegister, f as useWizard } from './shared/attaform.DNPJPOO7.mjs';
2
- export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform.CdZIEf7_.mjs';
3
- export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.C4shmwyJ.mjs';
4
- export { a as assignKey, v as vRegister } from './shared/attaform.DxKQsqFZ.mjs';
1
+ export { e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, c as useAbstractForm, d as useRegister, f as useWizard } from './shared/attaform.DCUJCKyG.mjs';
2
+ export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform.BhtAZysa.mjs';
3
+ export { A as AttaformErrorCode } from './shared/attaform.CgyyJVuq.mjs';
4
+ export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.CdA9bfRv.mjs';
5
+ export { a as assignKey, v as vRegister } from './shared/attaform.T0YjhjPU.mjs';
5
6
  export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
@@ -1,4 +1,5 @@
1
- export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, c as useAbstractForm, d as useRegister, f as useWizard } from './shared/attaform-dev.y9x9Vp9F.mjs';
2
- export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform-dev.zlvDr0WB.mjs';
3
- export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform-dev.B1q-x9R9.mjs';
4
- export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.k5X47GMD.mjs';
1
+ export { e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, c as useAbstractForm, d as useRegister, f as useWizard } from './shared/attaform-dev.DLk51W7-.mjs';
2
+ export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform-dev.04aupFBW.mjs';
3
+ export { A as AttaformErrorCode } from './shared/attaform-dev.G-3XDl9F.mjs';
4
+ export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform-dev.Bu6wgrA5.mjs';
5
+ export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.CKSqs_xQ.mjs';
@@ -1,4 +1,4 @@
1
- import { e as canonicalizePath } from '../shared/attaform-dev.zlvDr0WB.mjs';
1
+ import { e as canonicalizePath } from '../shared/attaform-dev.04aupFBW.mjs';
2
2
 
3
3
  const INSPECTOR_ID = "attaform";
4
4
  const TIMELINE_LAYER_ID = "attaform:events";
@@ -1 +1 @@
1
- export { b as installVRegister, v as vRegister, c as vRegisterFile } from './shared/attaform-dev.k5X47GMD.mjs';
1
+ export { b as installVRegister, v as vRegister, c as vRegisterFile } from './shared/attaform-dev.CKSqs_xQ.mjs';
@@ -1,6 +1,72 @@
1
- import { shallowRef, computed } from 'vue';
2
- import { n as normalizeNumericOption, D as DEFAULT_HISTORY_MAX_SNAPSHOTS, s as structuralSnapshot } from './shared/attaform-dev.CZz4GYZ6.mjs';
1
+ import { shallowRef, computed, toRaw } from 'vue';
2
+ import { n as normalizeNumericOption, D as DEFAULT_HISTORY_MAX_SNAPSHOTS, s as structuralSnapshot, m as migrateMapSubtree, g as getAtPath } from './shared/attaform-dev.G-3XDl9F.mjs';
3
+ import { e as canonicalizePath, s as segmentsForPathKey } from './shared/attaform-dev.04aupFBW.mjs';
3
4
 
5
+ const flagged = (record) => record.touched || record.interacted || record.blurredAfterInteraction;
6
+ function captureRecords(fields) {
7
+ const out = [];
8
+ for (const record of toRaw(fields).values()) {
9
+ if (flagged(record) && record.path.some((segment) => typeof segment === "number")) {
10
+ out.push(record);
11
+ }
12
+ }
13
+ return out;
14
+ }
15
+ function underIndexIn(path, indices) {
16
+ for (let i = 0; i < path.length; i++) {
17
+ const segment = path[i];
18
+ if (typeof segment === "number" && indices.get(canonicalizePath(path.slice(0, i)).key)?.has(segment) === true) {
19
+ return true;
20
+ }
21
+ }
22
+ return false;
23
+ }
24
+ function planOrders(current, target, holdsList) {
25
+ const live = new Map(current.tokens);
26
+ const liveBaselines = new Map(current.baselines);
27
+ const tokens = new Map(target.tokens);
28
+ const baselines = new Map(target.baselines);
29
+ const remaps = [];
30
+ const depths = /* @__PURE__ */ new Set();
31
+ for (const key of live.keys()) depths.add(segmentsForPathKey(key)?.length ?? 0);
32
+ for (const depth of [...depths].sort((a, b) => a - b)) {
33
+ for (const [key, ids] of [...live]) {
34
+ const segs = segmentsForPathKey(key);
35
+ if (segs?.length !== depth) continue;
36
+ let order = tokens.get(key);
37
+ const baseline = liveBaselines.get(key);
38
+ if (order === void 0) {
39
+ if (baseline === void 0 || !holdsList(segs)) continue;
40
+ order = baseline;
41
+ tokens.set(key, order);
42
+ baselines.set(key, baseline);
43
+ }
44
+ const remap = remapBetween(ids, order);
45
+ if (remap === null) continue;
46
+ remaps.push([segs, remap]);
47
+ migrateMapSubtree(live, segs, remap, (value) => value);
48
+ migrateMapSubtree(liveBaselines, segs, remap, (value) => value);
49
+ }
50
+ }
51
+ return { orders: { tokens, baselines }, remaps };
52
+ }
53
+ function remapBetween(from, to) {
54
+ const slots = new Map(to.map((id, i) => [id, i]));
55
+ const kept = new Set(from);
56
+ const moved = /* @__PURE__ */ new Map();
57
+ const vacated = /* @__PURE__ */ new Set();
58
+ const fresh = /* @__PURE__ */ new Set();
59
+ from.forEach((id, i) => {
60
+ const at = slots.get(id);
61
+ if (at === void 0) vacated.add(i);
62
+ else if (at !== i) moved.set(i, at);
63
+ });
64
+ to.forEach((id, i) => {
65
+ if (!kept.has(id)) fresh.add(i);
66
+ });
67
+ if (moved.size === 0 && vacated.size === 0 && fresh.size === 0) return null;
68
+ return { moved, vacated, fresh, oldLen: from.length, newLen: to.length };
69
+ }
4
70
  function captureErrorCells(map) {
5
71
  const out = [];
6
72
  for (const [k, cell] of map) {
@@ -10,32 +76,81 @@ function captureErrorCells(map) {
10
76
  }
11
77
  function createHistoryRuntime(kernel, max) {
12
78
  const capacity = Math.max(1, max);
79
+ let generation = 0;
13
80
  function captureSnapshot() {
14
81
  return {
15
82
  form: structuralSnapshot(kernel.form.value),
16
83
  blankPaths: [...kernel.blankPaths],
17
- errorCells: captureErrorCells(kernel.errorCells())
84
+ errorCells: captureErrorCells(kernel.errorCells()),
85
+ structure: kernel.captureStructure(),
86
+ records: captureRecords(kernel.fields),
87
+ generation
18
88
  };
19
89
  }
20
90
  const positions = shallowRef([captureSnapshot()]);
21
91
  const cursor = shallowRef(0);
22
92
  let suppressNext = false;
93
+ let disposed = false;
94
+ let released = [];
95
+ kernel.noteReleased = (records) => {
96
+ for (const record of records) if (flagged(record)) released.push(record);
97
+ };
23
98
  const unsubscribeChange = kernel.onFormChange((_next, meta) => {
99
+ const left = released;
100
+ released = [];
24
101
  if (suppressNext) {
25
102
  suppressNext = false;
26
103
  return;
27
104
  }
28
105
  if (meta?.hydration === true) {
29
- clear();
106
+ queueMicrotask(() => {
107
+ if (!disposed) clear();
108
+ });
30
109
  return;
31
110
  }
32
111
  const next = positions.value.slice(0, cursor.value + 1);
112
+ const before = next[next.length - 1];
113
+ if (left.length > 0 && before !== void 0) {
114
+ next[next.length - 1] = { ...before, records: [...before.records, ...left] };
115
+ }
33
116
  next.push(captureSnapshot());
34
117
  while (next.length > capacity) next.shift();
35
118
  positions.value = next;
36
119
  cursor.value = next.length - 1;
37
120
  });
38
- function restorePosition(snap) {
121
+ function retake() {
122
+ const structure = kernel.captureStructure();
123
+ const current = positions.value[cursor.value];
124
+ if (current !== void 0) {
125
+ const next = [...positions.value];
126
+ next[cursor.value] = {
127
+ ...current,
128
+ structure,
129
+ records: captureRecords(kernel.fields),
130
+ generation
131
+ };
132
+ positions.value = next;
133
+ }
134
+ return structure;
135
+ }
136
+ const unsubscribeReset = kernel.onReset(() => {
137
+ generation += 1;
138
+ retake();
139
+ });
140
+ function restorePosition(snap, live) {
141
+ if (snap.generation === generation) {
142
+ const { orders, remaps } = planOrders(
143
+ live.identity,
144
+ snap.structure.identity,
145
+ (segments) => Array.isArray(getAtPath(snap.form, segments))
146
+ );
147
+ const fresh = /* @__PURE__ */ new Map();
148
+ for (const [segments, remap] of remaps) {
149
+ if (remap.fresh.size > 0) fresh.set(canonicalizePath(segments).key, remap.fresh);
150
+ }
151
+ const returning = fresh.size === 0 ? [] : snap.records.filter((record) => underIndexIn(record.path, fresh));
152
+ kernel.restoreStructure({ ...snap.structure, identity: orders }, remaps, returning);
153
+ }
39
154
  suppressNext = true;
40
155
  kernel.blankPaths.clear();
41
156
  for (const key of snap.blankPaths) kernel.blankPaths.add(key);
@@ -45,8 +160,10 @@ function createHistoryRuntime(kernel, max) {
45
160
  function stepTo(nextCursor) {
46
161
  const snap = positions.value[nextCursor];
47
162
  if (snap === void 0) return false;
163
+ const live = retake();
48
164
  cursor.value = nextCursor;
49
- restorePosition(snap);
165
+ restorePosition(snap, live);
166
+ released = [];
50
167
  return true;
51
168
  }
52
169
  function undo() {
@@ -67,7 +184,10 @@ function createHistoryRuntime(kernel, max) {
67
184
  canRedo: computed(() => cursor.value < positions.value.length - 1),
68
185
  historySize: computed(() => positions.value.length),
69
186
  dispose() {
187
+ disposed = true;
188
+ kernel.noteReleased = void 0;
70
189
  unsubscribeChange();
190
+ unsubscribeReset();
71
191
  positions.value = positions.value.slice(cursor.value, cursor.value + 1);
72
192
  cursor.value = 0;
73
193
  }
@@ -1,5 +1,6 @@
1
- export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform-dev.zlvDr0WB.mjs';
2
- export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, d as useRegister, f as useWizard } from './shared/attaform-dev.y9x9Vp9F.mjs';
3
- export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform-dev.B1q-x9R9.mjs';
4
- export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.k5X47GMD.mjs';
5
- export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.DlaT4xGd.mjs';
1
+ export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform-dev.04aupFBW.mjs';
2
+ export { A as AttaformErrorCode } from './shared/attaform-dev.G-3XDl9F.mjs';
3
+ export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform-dev.Bu6wgrA5.mjs';
4
+ export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.CKSqs_xQ.mjs';
5
+ export { e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, d as useRegister, f as useWizard } from './shared/attaform-dev.DLk51W7-.mjs';
6
+ export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.BnLLxX2l.mjs';
@@ -1,5 +1,5 @@
1
1
  import { defineNuxtPlugin, useRuntimeConfig, useRoute } from 'nuxt/app';
2
- import { c as createAttaform, b as kAttaformWizardActiveStepResolver, r as renderAttaformState, h as hydrateAttaformState, g as getRegistryFromApp, D as DEVTOOLS_WINDOW_KEY } from '../../shared/attaform-dev.B1q-x9R9.mjs';
2
+ import { c as createAttaform, b as kAttaformWizardActiveStepResolver, r as renderAttaformState, h as hydrateAttaformState, g as getRegistryFromApp, D as DEVTOOLS_WINDOW_KEY } from '../../shared/attaform-dev.Bu6wgrA5.mjs';
3
3
 
4
4
  var attaform_default = defineNuxtPlugin({
5
5
  // `enforce: 'pre'` makes the "we run before any component's setup" claim
@@ -114,7 +114,8 @@ const canonicalStringCache = /* @__PURE__ */ new Map();
114
114
  const PATHKEY_TO_SEGMENTS_MAX = 4096;
115
115
  const pathKeyToSegments = /* @__PURE__ */ new Map();
116
116
  function rememberSegmentsForPathKey(key, segments) {
117
- if (!pathKeyToSegments.has(key) && pathKeyToSegments.size >= PATHKEY_TO_SEGMENTS_MAX) {
117
+ if (pathKeyToSegments.has(key)) return;
118
+ if (pathKeyToSegments.size >= PATHKEY_TO_SEGMENTS_MAX) {
118
119
  const oldest = pathKeyToSegments.keys().next().value;
119
120
  if (oldest !== void 0) pathKeyToSegments.delete(oldest);
120
121
  }
@@ -156,7 +157,7 @@ function canonicalizePath(input) {
156
157
  return keyForSegments(input);
157
158
  }
158
159
  function keyForSegments(input) {
159
- const segments = Array.from(input).map(normalizeSegment);
160
+ const segments = input.map(normalizeSegment);
160
161
  const key = JSON.stringify(segments);
161
162
  rememberSegmentsForPathKey(key, segments);
162
163
  return { segments, key };
@@ -1,7 +1,8 @@
1
- import { w as walkPathSegments, s as slimPrimitivesWalk, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, g as getFieldMetaForSchema, f as fixStructuralDefaults, m as mergeDeep, d as deriveDefaultWalk, e as getFieldMetaListForSchema } from './attaform-dev.Caibt7sb.mjs';
2
- import { h as getAtPath, j as humanize, c as useAbstractForm } from './attaform-dev.y9x9Vp9F.mjs';
3
- import { c as callConsumerFn } from './attaform-dev.CZz4GYZ6.mjs';
4
- import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.zlvDr0WB.mjs';
1
+ import { w as walkPathSegments, s as slimPrimitivesWalk, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, g as getFieldMetaForSchema, f as fixStructuralDefaults, m as mergeDeep, d as deriveDefaultWalk, e as getFieldMetaListForSchema } from './attaform-dev.oguHqv1W.mjs';
2
+ import { g as getAtPath } from './attaform-dev.G-3XDl9F.mjs';
3
+ import { h as callConsumerFn } from './attaform-dev.DoG8mZTq.mjs';
4
+ import { h as humanize, c as useAbstractForm } from './attaform-dev.DLk51W7-.mjs';
5
+ import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.04aupFBW.mjs';
5
6
 
6
7
  function isZodSchemaType(schema, expectedType) {
7
8
  if (typeof schema !== "object" || schema === null) return false;
@@ -1,7 +1,7 @@
1
- import { a as InvalidUseFormConfigError } from './attaform-dev.zlvDr0WB.mjs';
2
- import { u as useForm$2 } from './attaform-dev.CtyqGia7.mjs';
3
- import { u as useForm$1 } from './attaform-dev.DJ3nsWw6.mjs';
4
- import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './attaform-dev.Caibt7sb.mjs';
1
+ import { a as InvalidUseFormConfigError } from './attaform-dev.04aupFBW.mjs';
2
+ import { u as useForm$2 } from './attaform-dev.BKWPjEB2.mjs';
3
+ import { u as useForm$1 } from './attaform-dev.Cf_hZfbT.mjs';
4
+ import { i as installingFieldMetaStore, g as getFieldMetaForSchema } from './attaform-dev.oguHqv1W.mjs';
5
5
 
6
6
  function isZodV4SchemaShape(value) {
7
7
  if (typeof value !== "object" || value === null) return false;
@@ -1,4 +1,4 @@
1
- import { c as RegistryNotInstalledError, O as OutsideSetupError, g as pathKeyToDotted } from './attaform-dev.zlvDr0WB.mjs';
1
+ import { c as RegistryNotInstalledError, O as OutsideSetupError, g as pathKeyToDotted } from './attaform-dev.04aupFBW.mjs';
2
2
  import { shallowReactive, getCurrentInstance, inject } from 'vue';
3
3
 
4
4
  function detectSSR(options = {}) {
@@ -1,5 +1,6 @@
1
1
  import { isRef, warn, toRaw, reactive, markRaw, effectScope, watch, nextTick } from 'vue';
2
- import { e as canonicalizePath } from './attaform-dev.zlvDr0WB.mjs';
2
+ import { e as canonicalizePath } from './attaform-dev.04aupFBW.mjs';
3
+ import { d as safeOwnHas } from './attaform-dev.DoG8mZTq.mjs';
3
4
 
4
5
  function activeElementOf(node) {
5
6
  const rootNode = node.getRootNode();
@@ -330,7 +331,7 @@ function createHostChannel() {
330
331
  return commit(rv, value, modifiers);
331
332
  },
332
333
  writeInput(rv, payload, modifiers) {
333
- if (typeof payload !== "object" || payload === null || payload instanceof Event || !("value" in payload) || !Object.hasOwn(payload, "value")) {
334
+ if (typeof payload !== "object" || payload === null || payload instanceof Event || !("value" in payload) || !safeOwnHas(payload, "value")) {
334
335
  return false;
335
336
  }
336
337
  return rv.setValueFromHost(payload.value, modifiers);
@@ -1,7 +1,7 @@
1
- import { j as humanize, c as useAbstractForm } from './attaform-dev.y9x9Vp9F.mjs';
2
- import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.zlvDr0WB.mjs';
3
- import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, e as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform-dev.Caibt7sb.mjs';
4
- import { c as callConsumerFn } from './attaform-dev.CZz4GYZ6.mjs';
1
+ import { h as humanize, c as useAbstractForm } from './attaform-dev.DLk51W7-.mjs';
2
+ import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform-dev.04aupFBW.mjs';
3
+ import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, e as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform-dev.oguHqv1W.mjs';
4
+ import { h as callConsumerFn } from './attaform-dev.DoG8mZTq.mjs';
5
5
 
6
6
  function readDef(schema) {
7
7
  if (schema === null || typeof schema !== "object") return void 0;
@@ -181,6 +181,9 @@ function getDiscriminatedOptions(schema) {
181
181
  return Array.isArray(options) ? options : [];
182
182
  }
183
183
  function assertZodVersion(schema) {
184
+ assertZodV4Node(schema);
185
+ }
186
+ function assertZodV4Node(schema) {
184
187
  const def = readDef(schema);
185
188
  if (def?.type === void 0) {
186
189
  throw new Error(
@@ -239,7 +242,7 @@ function walkCapabilities(node, capabilities, visited) {
239
242
  if (def === void 0) return;
240
243
  const checks = getChecks(node);
241
244
  if (checks.some(isAsyncCheck)) capabilities.asyncRefine = true;
242
- if (checks.length > 0 && CONTAINER_SLOTS.some((key) => def[key] !== void 0)) {
245
+ if (checks.some(isVerdictCheck) && CONTAINER_SLOTS.some((key) => def[key] !== void 0)) {
243
246
  capabilities.containerOrRootRefine = true;
244
247
  }
245
248
  if (typeof def.transform === "function" && def.transform.constructor.name === "AsyncFunction") {
@@ -261,6 +264,11 @@ function walkCapabilities(node, capabilities, visited) {
261
264
  }
262
265
  }
263
266
  }
267
+ function isVerdictCheck(check) {
268
+ if (typeof check !== "object" || check === null) return true;
269
+ const kind = check._zod?.def?.check;
270
+ return kind !== "describe" && kind !== "meta";
271
+ }
264
272
  function isAsyncCheck(check) {
265
273
  if (typeof check !== "object" || check === null) return false;
266
274
  const c = check;
@@ -324,9 +332,9 @@ function zodIssuesToValidationErrors(issues) {
324
332
 
325
333
  const V4_INTROSPECTOR = {
326
334
  kindOf: (schema) => kindOf(schema),
327
- getObjectShape: (schema) => getObjectShape(schema),
335
+ getObjectShape,
328
336
  getTupleItems,
329
- getDiscriminatedOptions: (schema) => getDiscriminatedOptions(schema),
337
+ getDiscriminatedOptions,
330
338
  getDiscriminator,
331
339
  getLiteralValues,
332
340
  isPreprocessNode,
@@ -490,7 +498,7 @@ function isLeafRequired(schema, depth = 0) {
490
498
  return true;
491
499
  }
492
500
  function zodV4Adapter(rootSchema) {
493
- assertZodVersion(rootSchema);
501
+ assertZodV4Node(rootSchema);
494
502
  assertKeyedRoot(rootSchema);
495
503
  return (_formKey, options) => sharedV4Schemas(
496
504
  rootSchema,
@@ -611,7 +619,8 @@ function resolveFieldMetaAtPath(rootSchema, path, maxRecursionDepth) {
611
619
  };
612
620
  }
613
621
  function readDescription(schema) {
614
- const candidate = schema.description;
622
+ const scope = globalThis;
623
+ const candidate = scope.__zod_globalRegistry?.get(schema)?.description ?? schema.description;
615
624
  return typeof candidate === "string" ? candidate : void 0;
616
625
  }
617
626