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,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.CYlF4P6X.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.CYlF4P6X.mjs';
3
+ import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.i13OEHJF.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.i13OEHJF.mjs';
5
+ export { v as vRegister } from './shared/attaform.DZOynI6c.mjs';
6
6
  import 'vue';
7
7
 
8
8
  /**
package/dist/abstract.mjs CHANGED
@@ -1,5 +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.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 { 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.DAf4ehIe.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 { 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';
4
+ export { a as assignKey, v as vRegister } from './shared/attaform.BPMOl562.mjs';
5
5
  export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
@@ -1,4 +1,4 @@
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 { 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.3uTCYwy8.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 { 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.Cbx0AiQF.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.Cbx0AiQF.mjs';
@@ -1,5 +1,5 @@
1
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';
2
+ import { n as normalizeNumericOption, D as DEFAULT_HISTORY_MAX_SNAPSHOTS, s as structuralSnapshot } from './shared/attaform-dev.n6n00owJ.mjs';
3
3
 
4
4
  function captureErrorCells(map) {
5
5
  const out = [];
@@ -10,11 +10,14 @@ function captureErrorCells(map) {
10
10
  }
11
11
  function createHistoryRuntime(kernel, max) {
12
12
  const capacity = Math.max(1, max);
13
+ let generation = 0;
13
14
  function captureSnapshot() {
14
15
  return {
15
16
  form: structuralSnapshot(kernel.form.value),
16
17
  blankPaths: [...kernel.blankPaths],
17
- errorCells: captureErrorCells(kernel.errorCells())
18
+ errorCells: captureErrorCells(kernel.errorCells()),
19
+ structure: kernel.captureStructure(),
20
+ generation
18
21
  };
19
22
  }
20
23
  const positions = shallowRef([captureSnapshot()]);
@@ -35,7 +38,16 @@ function createHistoryRuntime(kernel, max) {
35
38
  positions.value = next;
36
39
  cursor.value = next.length - 1;
37
40
  });
41
+ const unsubscribeReset = kernel.onReset(() => {
42
+ generation += 1;
43
+ const current = positions.value[cursor.value];
44
+ if (current === void 0) return;
45
+ const next = [...positions.value];
46
+ next[cursor.value] = { ...current, structure: kernel.captureStructure(), generation };
47
+ positions.value = next;
48
+ });
38
49
  function restorePosition(snap) {
50
+ if (snap.generation === generation) kernel.restoreStructure(snap.structure);
39
51
  suppressNext = true;
40
52
  kernel.blankPaths.clear();
41
53
  for (const key of snap.blankPaths) kernel.blankPaths.add(key);
@@ -68,6 +80,7 @@ function createHistoryRuntime(kernel, max) {
68
80
  historySize: computed(() => positions.value.length),
69
81
  dispose() {
70
82
  unsubscribeChange();
83
+ unsubscribeReset();
71
84
  positions.value = positions.value.slice(cursor.value, cursor.value + 1);
72
85
  cursor.value = 0;
73
86
  }
@@ -1,5 +1,5 @@
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, 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.3uTCYwy8.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.Cbx0AiQF.mjs';
5
+ export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.D7lKyM_7.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 };