attaform 0.24.0 → 0.24.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 (88) hide show
  1. package/dist/chunks/devtools.cjs +1 -1
  2. package/dist/chunks/devtools.mjs +1 -1
  3. package/dist/chunks/fingerprint2.cjs +1 -1
  4. package/dist/chunks/fingerprint2.mjs +1 -1
  5. package/dist/index.cjs +5 -4
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +4 -4
  8. package/dist/index.d.mts +4 -4
  9. package/dist/index.d.ts +4 -4
  10. package/dist/index.mjs +4 -3
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/nuxt.d.cts +1 -1
  13. package/dist/nuxt.d.mts +1 -1
  14. package/dist/nuxt.d.ts +1 -1
  15. package/dist/runtime/plugins/attaform.cjs +2 -2
  16. package/dist/runtime/plugins/attaform.mjs +2 -2
  17. package/dist/shared/{attaform.CAWKNCzc.mjs → attaform.0-00cYGw.mjs} +2 -2
  18. package/dist/shared/{attaform.CAWKNCzc.mjs.map → attaform.0-00cYGw.mjs.map} +1 -1
  19. package/dist/shared/{attaform.DdUYEhkV.d.cts → attaform.0zueP54D.d.mts} +33 -15
  20. package/dist/shared/{attaform.Z1qTwOYE.cjs → attaform.B57G7ePY.cjs} +4 -4
  21. package/dist/shared/{attaform.BJ_W7q3U.mjs.map → attaform.B57G7ePY.cjs.map} +1 -1
  22. package/dist/shared/{attaform.DwkU0oY9.cjs → attaform.B7UdTs_o.cjs} +79 -75
  23. package/dist/shared/attaform.B7UdTs_o.cjs.map +1 -0
  24. package/dist/shared/{attaform.CuBdtfbe.mjs → attaform.BI7M3wK8.mjs} +88 -16
  25. package/dist/shared/attaform.BI7M3wK8.mjs.map +1 -0
  26. package/dist/shared/{attaform.nycEksJn.cjs → attaform.BOi6n2Pn.cjs} +2 -2
  27. package/dist/shared/{attaform.nycEksJn.cjs.map → attaform.BOi6n2Pn.cjs.map} +1 -1
  28. package/dist/shared/{attaform.BJ_W7q3U.mjs → attaform.B_-nZHtM.mjs} +4 -4
  29. package/dist/shared/{attaform.Z1qTwOYE.cjs.map → attaform.B_-nZHtM.mjs.map} +1 -1
  30. package/dist/shared/{attaform.o95Kjd3U.mjs → attaform.BjUaX7s8.mjs} +3 -3
  31. package/dist/shared/{attaform.o95Kjd3U.mjs.map → attaform.BjUaX7s8.mjs.map} +1 -1
  32. package/dist/shared/{attaform.BNmkKz0q.d.mts → attaform.BjiHiYAZ.d.ts} +3 -2
  33. package/dist/shared/{attaform.C42wL7EJ.cjs → attaform.Bos7wVZw.cjs} +90 -18
  34. package/dist/shared/attaform.Bos7wVZw.cjs.map +1 -0
  35. package/dist/shared/{attaform.CwFZGv5-.d.ts → attaform.Bx6pgrIy.d.cts} +3 -2
  36. package/dist/shared/{attaform.Df-s8j1X.mjs → attaform.C0au8oXd.mjs} +36 -29
  37. package/dist/shared/attaform.C0au8oXd.mjs.map +1 -0
  38. package/dist/shared/attaform.CjdepGnw.cjs +27 -0
  39. package/dist/shared/attaform.CjdepGnw.cjs.map +1 -0
  40. package/dist/shared/{attaform.BnUXV01g.cjs → attaform.D-gYGj5z.cjs} +4 -4
  41. package/dist/shared/{attaform.C-dAB90u.mjs.map → attaform.D-gYGj5z.cjs.map} +1 -1
  42. package/dist/shared/{attaform.C6eE50re.d.ts → attaform.DHjRN5JP.d.cts} +33 -15
  43. package/dist/shared/{attaform.CR6wGvNu.cjs → attaform.DK6_Ctv7.cjs} +10 -4
  44. package/dist/shared/attaform.DK6_Ctv7.cjs.map +1 -0
  45. package/dist/shared/{attaform.GJbSmwLB.d.mts → attaform.DUc6cetN.d.cts} +62 -13
  46. package/dist/shared/{attaform.GJbSmwLB.d.cts → attaform.DUc6cetN.d.mts} +62 -13
  47. package/dist/shared/{attaform.GJbSmwLB.d.ts → attaform.DUc6cetN.d.ts} +62 -13
  48. package/dist/shared/{attaform.BV_HyaMO.cjs → attaform.DdfLrIgM.cjs} +3 -3
  49. package/dist/shared/{attaform.BV_HyaMO.cjs.map → attaform.DdfLrIgM.cjs.map} +1 -1
  50. package/dist/shared/{attaform.K-3glmiT.d.cts → attaform.DvqdxvNU.d.mts} +3 -2
  51. package/dist/shared/{attaform.BFWb6hDk.mjs → attaform.DwCtxauq.mjs} +10 -4
  52. package/dist/shared/attaform.DwCtxauq.mjs.map +1 -0
  53. package/dist/shared/{attaform.C-dAB90u.mjs → attaform.K1MbxmIu.mjs} +4 -4
  54. package/dist/shared/{attaform.BnUXV01g.cjs.map → attaform.K1MbxmIu.mjs.map} +1 -1
  55. package/dist/shared/attaform.WvcckZMD.mjs +21 -0
  56. package/dist/shared/attaform.WvcckZMD.mjs.map +1 -0
  57. package/dist/shared/{attaform.DiWNbKWa.d.mts → attaform.yqcYwt0d.d.ts} +33 -15
  58. package/dist/transforms.cjs +1 -1
  59. package/dist/transforms.d.cts +4 -1
  60. package/dist/transforms.d.mts +4 -1
  61. package/dist/transforms.d.ts +4 -1
  62. package/dist/transforms.mjs +1 -1
  63. package/dist/vite.cjs +1 -1
  64. package/dist/vite.mjs +1 -1
  65. package/dist/zod-v3.cjs +2 -2
  66. package/dist/zod-v3.d.cts +8 -5
  67. package/dist/zod-v3.d.mts +8 -5
  68. package/dist/zod-v3.d.ts +8 -5
  69. package/dist/zod-v3.mjs +2 -2
  70. package/dist/zod-v4.cjs +2 -2
  71. package/dist/zod-v4.d.cts +5 -5
  72. package/dist/zod-v4.d.mts +5 -5
  73. package/dist/zod-v4.d.ts +5 -5
  74. package/dist/zod-v4.mjs +2 -2
  75. package/dist/zod.cjs +5 -5
  76. package/dist/zod.cjs.map +1 -1
  77. package/dist/zod.d.cts +23 -7
  78. package/dist/zod.d.mts +23 -7
  79. package/dist/zod.d.ts +23 -7
  80. package/dist/zod.mjs +5 -5
  81. package/dist/zod.mjs.map +1 -1
  82. package/package.json +1 -1
  83. package/dist/shared/attaform.BFWb6hDk.mjs.map +0 -1
  84. package/dist/shared/attaform.C42wL7EJ.cjs.map +0 -1
  85. package/dist/shared/attaform.CR6wGvNu.cjs.map +0 -1
  86. package/dist/shared/attaform.CuBdtfbe.mjs.map +0 -1
  87. package/dist/shared/attaform.Df-s8j1X.mjs.map +0 -1
  88. package/dist/shared/attaform.DwkU0oY9.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const paths = require('../shared/attaform.DwkU0oY9.cjs');
3
+ const paths = require('../shared/attaform.B7UdTs_o.cjs');
4
4
 
5
5
  const INSPECTOR_ID = "attaform";
6
6
  const TIMELINE_LAYER_ID = "attaform:events";
@@ -1,4 +1,4 @@
1
- import { f as canonicalizePath } from '../shared/attaform.Df-s8j1X.mjs';
1
+ import { f as canonicalizePath } from '../shared/attaform.C0au8oXd.mjs';
2
2
 
3
3
  const INSPECTOR_ID = "attaform";
4
4
  const TIMELINE_LAYER_ID = "attaform:events";
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const canonicalStringify = require('../shared/attaform.CQN9R62B.cjs');
4
- const index = require('../shared/attaform.BnUXV01g.cjs');
4
+ const index = require('../shared/attaform.D-gYGj5z.cjs');
5
5
 
6
6
  const cyclicSentinel = "<cyclic>";
7
7
  function fingerprintZodSchema(schema) {
@@ -1,5 +1,5 @@
1
1
  import { c as canonicalStringify } from '../shared/attaform.BJGA_UOS.mjs';
2
- import { k as kindOf, g as getIntersectionLeft, b as getIntersectionRight, c as unwrapLazy, d as unwrapInner, e as unwrapPipe, h as getDiscriminator, i as getDiscriminatedOptions, j as getUnionOptions, l as getRecordKeyType, m as getRecordValueType, n as getTupleItems, o as getSetValueType, p as getArrayElement, q as getObjectShape, r as getEnumValues, s as getLiteralValues, t as getChecks, v as getCatchDefault, x as getDefaultValue } from '../shared/attaform.C-dAB90u.mjs';
2
+ import { k as kindOf, g as getIntersectionLeft, b as getIntersectionRight, c as unwrapLazy, d as unwrapInner, e as unwrapPipe, h as getDiscriminator, i as getDiscriminatedOptions, j as getUnionOptions, l as getRecordKeyType, m as getRecordValueType, n as getTupleItems, o as getSetValueType, p as getArrayElement, q as getObjectShape, r as getEnumValues, s as getLiteralValues, t as getChecks, v as getCatchDefault, x as getDefaultValue } from '../shared/attaform.K1MbxmIu.mjs';
3
3
 
4
4
  const cyclicSentinel = "<cyclic>";
5
5
  function fingerprintZodSchema(schema) {
package/dist/index.cjs CHANGED
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const paths = require('./shared/attaform.DwkU0oY9.cjs');
4
- const devtoolsShared = require('./shared/attaform.nycEksJn.cjs');
5
- const injectWizard = require('./shared/attaform.C42wL7EJ.cjs');
3
+ const paths = require('./shared/attaform.B7UdTs_o.cjs');
4
+ const devtoolsShared = require('./shared/attaform.BOi6n2Pn.cjs');
5
+ const injectWizard = require('./shared/attaform.Bos7wVZw.cjs');
6
+ const registerProtocol = require('./shared/attaform.CjdepGnw.cjs');
6
7
 
7
8
  function escapeForInlineScript(json) {
8
9
  return json.replace(/[<>&\u2028\u2029]/g, (char) => {
@@ -38,7 +39,6 @@ exports.createAttaform = paths.createAttaform;
38
39
  exports.createRegistry = paths.createRegistry;
39
40
  exports.getRegistryFromApp = paths.getRegistryFromApp;
40
41
  exports.isPathPrefix = paths.isPathPrefix;
41
- exports.isRegisterValue = paths.isRegisterValue;
42
42
  exports.kAttaformRegistry = paths.kAttaformRegistry;
43
43
  exports.parseDottedPath = paths.parseDottedPath;
44
44
  exports.useRegistry = paths.useRegistry;
@@ -60,5 +60,6 @@ exports.unset = injectWizard.unset;
60
60
  exports.useForm = injectWizard.useAbstractForm;
61
61
  exports.useRegister = injectWizard.useRegister;
62
62
  exports.useWizard = injectWizard.useWizard;
63
+ exports.isRegisterValue = registerProtocol.isRegisterValue;
63
64
  exports.escapeForInlineScript = escapeForInlineScript;
64
65
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/runtime/core/serialize-script.ts"],"sourcesContent":["/**\n * Escape a JSON string so it's safe to embed inside an inline\n * `<script>` tag during SSR. Plain `JSON.stringify` is not safe — a\n * form value containing the literal substring `</script>` would\n * break out of the script tag.\n *\n * ```ts\n * const payload = escapeForInlineScript(JSON.stringify(renderAttaformState(app)))\n * // `<script>window.__ATTAFORM_STATE__ = ${payload}</script>` is safe.\n * ```\n *\n * Output remains valid JSON — `JSON.parse` round-trips back to the\n * original value on the client.\n */\nexport function escapeForInlineScript(json: string): string {\n return json.replace(/[<>&\\u2028\\u2029]/g, (char) => {\n switch (char) {\n case '<':\n return '\\\\u003c'\n case '>':\n return '\\\\u003e'\n case '&':\n return '\\\\u0026'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return char\n }\n })\n}\n"],"names":[],"mappings":";;;;;;AAcO,SAAS,sBAAsB,IAAA,EAAsB;AAC1D,EAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,oBAAA,EAAsB,CAAC,IAAA,KAAS;AAClD,IAAA,QAAQ,IAAA;AAAM,MACZ,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,QAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,QAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT;AACE,QAAA,OAAO,IAAA;AAAA;AACX,EACF,CAAC,CAAA;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/runtime/core/serialize-script.ts"],"sourcesContent":["/**\n * Escape a JSON string so it's safe to embed inside an inline\n * `<script>` tag during SSR. Plain `JSON.stringify` is not safe — a\n * form value containing the literal substring `</script>` would\n * break out of the script tag.\n *\n * ```ts\n * const payload = escapeForInlineScript(JSON.stringify(renderAttaformState(app)))\n * // `<script>window.__ATTAFORM_STATE__ = ${payload}</script>` is safe.\n * ```\n *\n * Output remains valid JSON — `JSON.parse` round-trips back to the\n * original value on the client.\n */\nexport function escapeForInlineScript(json: string): string {\n return json.replace(/[<>&\\u2028\\u2029]/g, (char) => {\n switch (char) {\n case '<':\n return '\\\\u003c'\n case '>':\n return '\\\\u003e'\n case '&':\n return '\\\\u0026'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return char\n }\n })\n}\n"],"names":[],"mappings":";;;;;;;AAcO,SAAS,sBAAsB,IAAA,EAAsB;AAC1D,EAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,oBAAA,EAAsB,CAAC,IAAA,KAAS;AAClD,IAAA,QAAQ,IAAA;AAAM,MACZ,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,QAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,QAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT;AACE,QAAA,OAAO,IAAA;AAAA;AACX,EACF,CAAC,CAAA;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Plugin, App } from 'vue';
2
- import { S as SSRDetectOptions, a as SerializedFormData, A as AttaformRegistry } from './shared/attaform.DdUYEhkV.cjs';
3
- export { b as AnyForm, c as AttaformErrorCode, C as CompiledStep, F as FormStatus, I as InjectWizardInput, L as LazyMarker, d as StepSlot, U as UseRegisterReturn, e as UseWizardReturnType, W as WizardAggregateError, f as WizardCtx, g as WizardCtxForm, h as WizardOnError, i as WizardOnSubmit, j as WizardOptions, k as WizardPersistFn, l as WizardRestoreFn, m as WizardRestoreState, n as WizardStatusesProxy, o as WizardSubmitContext, p as createRegistry, q as defaultCoercionRules, r as defineCoercion, s as getRegistryFromApp, t as injectForm, u as injectWizard, v as kAttaformRegistry, w as lazy, x as useRegister, y as useRegistry, z as useWizard } from './shared/attaform.DdUYEhkV.cjs';
4
- import { A as AttaformDefaults, F as FormKey, G as GenericForm, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, b as UseFormReturnType, R as RegisterModelDynamicCustomDirective, c as RegisterValue, d as GetDisplayState } from './shared/attaform.GJbSmwLB.cjs';
5
- export { e as ArrayItem, f as ArrayPath, C as CoercionEntry, g as CoercionRegistry, h as CoercionResult, i as CustomDirectiveRegisterAssignerFn, j as DeepPartial, k as DefaultValuesResponse, l as DefaultValuesShape, m as DisplayCtx, n as DisplayMachine, o as DisplayState, E as ErrorInput, p as ErrorsProxyShape, q as FieldMetaPayload, r as FieldState, s as FieldStateMap, t as FieldStateMapEntry, u as FlatPath, v as FormErrorRecord, w as FormErrorsSurface, x as FormMeta, H as HandleSubmit, y as HistoryConfig, I as IsTuple, z as IsUnion, J as JoinSegments, B as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, O as NestedType, P as OnError, Q as OnInvalidSubmitPolicy, S as OnSubmit, T as PartialFlatPath, V as Path, W as PathKey, X as PendingValidationStatus, Y as Primitive, Z as ROOT_PATH, _ as ROOT_PATH_KEY, $ as ReactiveValidationStatus, a0 as RegisterDirective, a1 as RegisterFlatPath, a2 as RegisterOptions, a3 as RegisterSelectModifier, a4 as RegisterTextModifier, a5 as RegisterTransform, a6 as Segment, a7 as SetValueCallback, a8 as SetValuePayload, a9 as SettledValidationStatus, aa as SlimPrimitiveKind, ab as SlimRuntimeOf, ac as SubmitHandler, ad as Unset, ae as ValidateOn, af as ValidateOnConfig, ag as ValidationError, ah as ValidationResponse, ai as ValidationResponseWithoutValue, aj as ValueOfUnion, ak as WriteMeta, al as WriteShape, am as canonicalizePath, an as isPathPrefix, ao as isUnset, ap as parseDottedPath, aq as unset } from './shared/attaform.GJbSmwLB.cjs';
2
+ import { S as SSRDetectOptions, a as SerializedFormData, A as AttaformRegistry } from './shared/attaform.DHjRN5JP.cjs';
3
+ export { b as AnyForm, c as AttaformErrorCode, C as CompiledStep, F as FormStatus, I as InjectWizardInput, L as LazyMarker, d as StepSlot, U as UseRegisterReturn, e as UseWizardReturnType, W as WizardAggregateError, f as WizardCtx, g as WizardCtxForm, h as WizardOnError, i as WizardOnSubmit, j as WizardOptions, k as WizardPersistFn, l as WizardRestoreFn, m as WizardRestoreState, n as WizardStatusesProxy, o as WizardSubmitContext, p as createRegistry, q as defaultCoercionRules, r as defineCoercion, s as getRegistryFromApp, t as injectForm, u as injectWizard, v as kAttaformRegistry, w as lazy, x as useRegister, y as useRegistry, z as useWizard } from './shared/attaform.DHjRN5JP.cjs';
4
+ import { A as AttaformDefaults, F as FormKey, G as GenericForm, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, b as UseFormReturnType, R as RegisterModelDynamicCustomDirective, c as RegisterValue, d as GetDisplayState } from './shared/attaform.DUc6cetN.cjs';
5
+ export { e as ArrayItem, f as ArrayPath, C as CoercionEntry, g as CoercionRegistry, h as CoercionResult, i as CustomDirectiveRegisterAssignerFn, j as DeepPartial, k as DefaultValuesResponse, l as DefaultValuesShape, m as DisplayCtx, n as DisplayMachine, o as DisplayState, E as ErrorInput, p as ErrorsProxyShape, q as FieldMetaPayload, r as FieldState, s as FieldStateMap, t as FieldStateMapEntry, u as FlatPath, v as FormErrorRecord, w as FormErrorsSurface, x as FormMeta, H as HandleSubmit, y as HistoryConfig, I as IsTuple, z as IsUnion, J as JoinSegments, B as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, O as NestedType, P as OnError, Q as OnInvalidSubmitPolicy, S as OnSubmit, T as PartialFlatPath, V as Path, W as PathKey, X as PendingValidationStatus, Y as Primitive, Z as ROOT_PATH, _ as ROOT_PATH_KEY, $ as ReactiveValidationStatus, a0 as RegisterDirective, a1 as RegisterFlatPath, a2 as RegisterOptions, a3 as RegisterSelectModifier, a4 as RegisterTextModifier, a5 as RegisterTransform, a6 as Segment, a7 as SetValueCallback, a8 as SetValuePayload, a9 as SettledValidationStatus, aa as SlimPrimitiveKind, ab as SlimRuntimeOf, ac as SubmitHandler, ad as Unset, ae as ValidateOn, af as ValidateOnConfig, ag as ValidationError, ah as ValidationResponse, ai as ValidationResponseWithoutValue, aj as ValueOfUnion, ak as WriteMeta, al as WriteShape, am as canonicalizePath, an as isPathPrefix, ao as isUnset, ap as parseDottedPath, aq as unset } from './shared/attaform.DUc6cetN.cjs';
6
6
  export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as RegistryNotInstalledError, b as ReservedFormKeyError, S as SubmitErrorHandlerError } from './shared/attaform.CO0e7YVY.cjs';
7
7
 
8
8
  /**
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Plugin, App } from 'vue';
2
- import { S as SSRDetectOptions, a as SerializedFormData, A as AttaformRegistry } from './shared/attaform.DiWNbKWa.mjs';
3
- export { b as AnyForm, c as AttaformErrorCode, C as CompiledStep, F as FormStatus, I as InjectWizardInput, L as LazyMarker, d as StepSlot, U as UseRegisterReturn, e as UseWizardReturnType, W as WizardAggregateError, f as WizardCtx, g as WizardCtxForm, h as WizardOnError, i as WizardOnSubmit, j as WizardOptions, k as WizardPersistFn, l as WizardRestoreFn, m as WizardRestoreState, n as WizardStatusesProxy, o as WizardSubmitContext, p as createRegistry, q as defaultCoercionRules, r as defineCoercion, s as getRegistryFromApp, t as injectForm, u as injectWizard, v as kAttaformRegistry, w as lazy, x as useRegister, y as useRegistry, z as useWizard } from './shared/attaform.DiWNbKWa.mjs';
4
- import { A as AttaformDefaults, F as FormKey, G as GenericForm, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, b as UseFormReturnType, R as RegisterModelDynamicCustomDirective, c as RegisterValue, d as GetDisplayState } from './shared/attaform.GJbSmwLB.mjs';
5
- export { e as ArrayItem, f as ArrayPath, C as CoercionEntry, g as CoercionRegistry, h as CoercionResult, i as CustomDirectiveRegisterAssignerFn, j as DeepPartial, k as DefaultValuesResponse, l as DefaultValuesShape, m as DisplayCtx, n as DisplayMachine, o as DisplayState, E as ErrorInput, p as ErrorsProxyShape, q as FieldMetaPayload, r as FieldState, s as FieldStateMap, t as FieldStateMapEntry, u as FlatPath, v as FormErrorRecord, w as FormErrorsSurface, x as FormMeta, H as HandleSubmit, y as HistoryConfig, I as IsTuple, z as IsUnion, J as JoinSegments, B as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, O as NestedType, P as OnError, Q as OnInvalidSubmitPolicy, S as OnSubmit, T as PartialFlatPath, V as Path, W as PathKey, X as PendingValidationStatus, Y as Primitive, Z as ROOT_PATH, _ as ROOT_PATH_KEY, $ as ReactiveValidationStatus, a0 as RegisterDirective, a1 as RegisterFlatPath, a2 as RegisterOptions, a3 as RegisterSelectModifier, a4 as RegisterTextModifier, a5 as RegisterTransform, a6 as Segment, a7 as SetValueCallback, a8 as SetValuePayload, a9 as SettledValidationStatus, aa as SlimPrimitiveKind, ab as SlimRuntimeOf, ac as SubmitHandler, ad as Unset, ae as ValidateOn, af as ValidateOnConfig, ag as ValidationError, ah as ValidationResponse, ai as ValidationResponseWithoutValue, aj as ValueOfUnion, ak as WriteMeta, al as WriteShape, am as canonicalizePath, an as isPathPrefix, ao as isUnset, ap as parseDottedPath, aq as unset } from './shared/attaform.GJbSmwLB.mjs';
2
+ import { S as SSRDetectOptions, a as SerializedFormData, A as AttaformRegistry } from './shared/attaform.0zueP54D.mjs';
3
+ export { b as AnyForm, c as AttaformErrorCode, C as CompiledStep, F as FormStatus, I as InjectWizardInput, L as LazyMarker, d as StepSlot, U as UseRegisterReturn, e as UseWizardReturnType, W as WizardAggregateError, f as WizardCtx, g as WizardCtxForm, h as WizardOnError, i as WizardOnSubmit, j as WizardOptions, k as WizardPersistFn, l as WizardRestoreFn, m as WizardRestoreState, n as WizardStatusesProxy, o as WizardSubmitContext, p as createRegistry, q as defaultCoercionRules, r as defineCoercion, s as getRegistryFromApp, t as injectForm, u as injectWizard, v as kAttaformRegistry, w as lazy, x as useRegister, y as useRegistry, z as useWizard } from './shared/attaform.0zueP54D.mjs';
4
+ import { A as AttaformDefaults, F as FormKey, G as GenericForm, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, b as UseFormReturnType, R as RegisterModelDynamicCustomDirective, c as RegisterValue, d as GetDisplayState } from './shared/attaform.DUc6cetN.mjs';
5
+ export { e as ArrayItem, f as ArrayPath, C as CoercionEntry, g as CoercionRegistry, h as CoercionResult, i as CustomDirectiveRegisterAssignerFn, j as DeepPartial, k as DefaultValuesResponse, l as DefaultValuesShape, m as DisplayCtx, n as DisplayMachine, o as DisplayState, E as ErrorInput, p as ErrorsProxyShape, q as FieldMetaPayload, r as FieldState, s as FieldStateMap, t as FieldStateMapEntry, u as FlatPath, v as FormErrorRecord, w as FormErrorsSurface, x as FormMeta, H as HandleSubmit, y as HistoryConfig, I as IsTuple, z as IsUnion, J as JoinSegments, B as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, O as NestedType, P as OnError, Q as OnInvalidSubmitPolicy, S as OnSubmit, T as PartialFlatPath, V as Path, W as PathKey, X as PendingValidationStatus, Y as Primitive, Z as ROOT_PATH, _ as ROOT_PATH_KEY, $ as ReactiveValidationStatus, a0 as RegisterDirective, a1 as RegisterFlatPath, a2 as RegisterOptions, a3 as RegisterSelectModifier, a4 as RegisterTextModifier, a5 as RegisterTransform, a6 as Segment, a7 as SetValueCallback, a8 as SetValuePayload, a9 as SettledValidationStatus, aa as SlimPrimitiveKind, ab as SlimRuntimeOf, ac as SubmitHandler, ad as Unset, ae as ValidateOn, af as ValidateOnConfig, ag as ValidationError, ah as ValidationResponse, ai as ValidationResponseWithoutValue, aj as ValueOfUnion, ak as WriteMeta, al as WriteShape, am as canonicalizePath, an as isPathPrefix, ao as isUnset, ap as parseDottedPath, aq as unset } from './shared/attaform.DUc6cetN.mjs';
6
6
  export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as RegistryNotInstalledError, b as ReservedFormKeyError, S as SubmitErrorHandlerError } from './shared/attaform.CO0e7YVY.mjs';
7
7
 
8
8
  /**
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Plugin, App } from 'vue';
2
- import { S as SSRDetectOptions, a as SerializedFormData, A as AttaformRegistry } from './shared/attaform.C6eE50re.js';
3
- export { b as AnyForm, c as AttaformErrorCode, C as CompiledStep, F as FormStatus, I as InjectWizardInput, L as LazyMarker, d as StepSlot, U as UseRegisterReturn, e as UseWizardReturnType, W as WizardAggregateError, f as WizardCtx, g as WizardCtxForm, h as WizardOnError, i as WizardOnSubmit, j as WizardOptions, k as WizardPersistFn, l as WizardRestoreFn, m as WizardRestoreState, n as WizardStatusesProxy, o as WizardSubmitContext, p as createRegistry, q as defaultCoercionRules, r as defineCoercion, s as getRegistryFromApp, t as injectForm, u as injectWizard, v as kAttaformRegistry, w as lazy, x as useRegister, y as useRegistry, z as useWizard } from './shared/attaform.C6eE50re.js';
4
- import { A as AttaformDefaults, F as FormKey, G as GenericForm, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, b as UseFormReturnType, R as RegisterModelDynamicCustomDirective, c as RegisterValue, d as GetDisplayState } from './shared/attaform.GJbSmwLB.js';
5
- export { e as ArrayItem, f as ArrayPath, C as CoercionEntry, g as CoercionRegistry, h as CoercionResult, i as CustomDirectiveRegisterAssignerFn, j as DeepPartial, k as DefaultValuesResponse, l as DefaultValuesShape, m as DisplayCtx, n as DisplayMachine, o as DisplayState, E as ErrorInput, p as ErrorsProxyShape, q as FieldMetaPayload, r as FieldState, s as FieldStateMap, t as FieldStateMapEntry, u as FlatPath, v as FormErrorRecord, w as FormErrorsSurface, x as FormMeta, H as HandleSubmit, y as HistoryConfig, I as IsTuple, z as IsUnion, J as JoinSegments, B as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, O as NestedType, P as OnError, Q as OnInvalidSubmitPolicy, S as OnSubmit, T as PartialFlatPath, V as Path, W as PathKey, X as PendingValidationStatus, Y as Primitive, Z as ROOT_PATH, _ as ROOT_PATH_KEY, $ as ReactiveValidationStatus, a0 as RegisterDirective, a1 as RegisterFlatPath, a2 as RegisterOptions, a3 as RegisterSelectModifier, a4 as RegisterTextModifier, a5 as RegisterTransform, a6 as Segment, a7 as SetValueCallback, a8 as SetValuePayload, a9 as SettledValidationStatus, aa as SlimPrimitiveKind, ab as SlimRuntimeOf, ac as SubmitHandler, ad as Unset, ae as ValidateOn, af as ValidateOnConfig, ag as ValidationError, ah as ValidationResponse, ai as ValidationResponseWithoutValue, aj as ValueOfUnion, ak as WriteMeta, al as WriteShape, am as canonicalizePath, an as isPathPrefix, ao as isUnset, ap as parseDottedPath, aq as unset } from './shared/attaform.GJbSmwLB.js';
2
+ import { S as SSRDetectOptions, a as SerializedFormData, A as AttaformRegistry } from './shared/attaform.yqcYwt0d.js';
3
+ export { b as AnyForm, c as AttaformErrorCode, C as CompiledStep, F as FormStatus, I as InjectWizardInput, L as LazyMarker, d as StepSlot, U as UseRegisterReturn, e as UseWizardReturnType, W as WizardAggregateError, f as WizardCtx, g as WizardCtxForm, h as WizardOnError, i as WizardOnSubmit, j as WizardOptions, k as WizardPersistFn, l as WizardRestoreFn, m as WizardRestoreState, n as WizardStatusesProxy, o as WizardSubmitContext, p as createRegistry, q as defaultCoercionRules, r as defineCoercion, s as getRegistryFromApp, t as injectForm, u as injectWizard, v as kAttaformRegistry, w as lazy, x as useRegister, y as useRegistry, z as useWizard } from './shared/attaform.yqcYwt0d.js';
4
+ import { A as AttaformDefaults, F as FormKey, G as GenericForm, U as UseFormConfiguration, a as AbstractSchema, D as DefaultValuesInput, b as UseFormReturnType, R as RegisterModelDynamicCustomDirective, c as RegisterValue, d as GetDisplayState } from './shared/attaform.DUc6cetN.js';
5
+ export { e as ArrayItem, f as ArrayPath, C as CoercionEntry, g as CoercionRegistry, h as CoercionResult, i as CustomDirectiveRegisterAssignerFn, j as DeepPartial, k as DefaultValuesResponse, l as DefaultValuesShape, m as DisplayCtx, n as DisplayMachine, o as DisplayState, E as ErrorInput, p as ErrorsProxyShape, q as FieldMetaPayload, r as FieldState, s as FieldStateMap, t as FieldStateMapEntry, u as FlatPath, v as FormErrorRecord, w as FormErrorsSurface, x as FormMeta, H as HandleSubmit, y as HistoryConfig, I as IsTuple, z as IsUnion, J as JoinSegments, B as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, O as NestedType, P as OnError, Q as OnInvalidSubmitPolicy, S as OnSubmit, T as PartialFlatPath, V as Path, W as PathKey, X as PendingValidationStatus, Y as Primitive, Z as ROOT_PATH, _ as ROOT_PATH_KEY, $ as ReactiveValidationStatus, a0 as RegisterDirective, a1 as RegisterFlatPath, a2 as RegisterOptions, a3 as RegisterSelectModifier, a4 as RegisterTextModifier, a5 as RegisterTransform, a6 as Segment, a7 as SetValueCallback, a8 as SetValuePayload, a9 as SettledValidationStatus, aa as SlimPrimitiveKind, ab as SlimRuntimeOf, ac as SubmitHandler, ad as Unset, ae as ValidateOn, af as ValidateOnConfig, ag as ValidationError, ah as ValidationResponse, ai as ValidationResponseWithoutValue, aj as ValueOfUnion, ak as WriteMeta, al as WriteShape, am as canonicalizePath, an as isPathPrefix, ao as isUnset, ap as parseDottedPath, aq as unset } from './shared/attaform.DUc6cetN.js';
6
6
  export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as RegistryNotInstalledError, b as ReservedFormKeyError, S as SubmitErrorHandlerError } from './shared/attaform.CO0e7YVY.js';
7
7
 
8
8
  /**
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
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 assignKey, f as canonicalizePath, g as createAttaform, h as createRegistry, i as getRegistryFromApp, j as isPathPrefix, k as isRegisterValue, l as kAttaformRegistry, p as parseDottedPath, u as useRegistry, v as vRegister } from './shared/attaform.Df-s8j1X.mjs';
2
- export { D as DEVTOOLS_WINDOW_KEY, h as hydrateAttaformState, r as renderAttaformState } from './shared/attaform.CAWKNCzc.mjs';
3
- export { A as AttaformErrorCode, D as DEFAULT_TIMINGS, e as defaultCoercionRules, f as defaultDisplayState, g as defineCoercion, i as injectForm, a as injectWizard, b as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, h as useForm, c as useRegister, d as useWizard } from './shared/attaform.CuBdtfbe.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 assignKey, f as canonicalizePath, g as createAttaform, h as createRegistry, i as getRegistryFromApp, j as isPathPrefix, k as kAttaformRegistry, p as parseDottedPath, u as useRegistry, v as vRegister } from './shared/attaform.C0au8oXd.mjs';
2
+ export { D as DEVTOOLS_WINDOW_KEY, h as hydrateAttaformState, r as renderAttaformState } from './shared/attaform.0-00cYGw.mjs';
3
+ export { A as AttaformErrorCode, D as DEFAULT_TIMINGS, e as defaultCoercionRules, f as defaultDisplayState, g as defineCoercion, i as injectForm, a as injectWizard, b as isUnset, l as lazy, m as makeDefaultDisplayState, u as unset, h as useForm, c as useRegister, d as useWizard } from './shared/attaform.BI7M3wK8.mjs';
4
+ export { i as isRegisterValue } from './shared/attaform.WvcckZMD.mjs';
4
5
 
5
6
  function escapeForInlineScript(json) {
6
7
  return json.replace(/[<>&\u2028\u2029]/g, (char) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/runtime/core/serialize-script.ts"],"sourcesContent":["/**\n * Escape a JSON string so it's safe to embed inside an inline\n * `<script>` tag during SSR. Plain `JSON.stringify` is not safe — a\n * form value containing the literal substring `</script>` would\n * break out of the script tag.\n *\n * ```ts\n * const payload = escapeForInlineScript(JSON.stringify(renderAttaformState(app)))\n * // `<script>window.__ATTAFORM_STATE__ = ${payload}</script>` is safe.\n * ```\n *\n * Output remains valid JSON — `JSON.parse` round-trips back to the\n * original value on the client.\n */\nexport function escapeForInlineScript(json: string): string {\n return json.replace(/[<>&\\u2028\\u2029]/g, (char) => {\n switch (char) {\n case '<':\n return '\\\\u003c'\n case '>':\n return '\\\\u003e'\n case '&':\n return '\\\\u0026'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return char\n }\n })\n}\n"],"names":[],"mappings":";;;;AAcO,SAAS,sBAAsB,IAAA,EAAsB;AAC1D,EAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,oBAAA,EAAsB,CAAC,IAAA,KAAS;AAClD,IAAA,QAAQ,IAAA;AAAM,MACZ,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,QAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,QAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT;AACE,QAAA,OAAO,IAAA;AAAA;AACX,EACF,CAAC,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/runtime/core/serialize-script.ts"],"sourcesContent":["/**\n * Escape a JSON string so it's safe to embed inside an inline\n * `<script>` tag during SSR. Plain `JSON.stringify` is not safe — a\n * form value containing the literal substring `</script>` would\n * break out of the script tag.\n *\n * ```ts\n * const payload = escapeForInlineScript(JSON.stringify(renderAttaformState(app)))\n * // `<script>window.__ATTAFORM_STATE__ = ${payload}</script>` is safe.\n * ```\n *\n * Output remains valid JSON — `JSON.parse` round-trips back to the\n * original value on the client.\n */\nexport function escapeForInlineScript(json: string): string {\n return json.replace(/[<>&\\u2028\\u2029]/g, (char) => {\n switch (char) {\n case '<':\n return '\\\\u003c'\n case '>':\n return '\\\\u003e'\n case '&':\n return '\\\\u0026'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return char\n }\n })\n}\n"],"names":[],"mappings":";;;;;AAcO,SAAS,sBAAsB,IAAA,EAAsB;AAC1D,EAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,oBAAA,EAAsB,CAAC,IAAA,KAAS;AAClD,IAAA,QAAQ,IAAA;AAAM,MACZ,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,GAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,QAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,QAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT;AACE,QAAA,OAAO,IAAA;AAAA;AACX,EACF,CAAC,CAAA;AACH;;;;"}
package/dist/nuxt.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { A as AttaformDefaults } from './shared/attaform.GJbSmwLB.cjs';
2
+ import { A as AttaformDefaults } from './shared/attaform.DUc6cetN.cjs';
3
3
  import 'vue';
4
4
 
5
5
  /**
package/dist/nuxt.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { A as AttaformDefaults } from './shared/attaform.GJbSmwLB.mjs';
2
+ import { A as AttaformDefaults } from './shared/attaform.DUc6cetN.mjs';
3
3
  import 'vue';
4
4
 
5
5
  /**
package/dist/nuxt.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { A as AttaformDefaults } from './shared/attaform.GJbSmwLB.js';
2
+ import { A as AttaformDefaults } from './shared/attaform.DUc6cetN.js';
3
3
  import 'vue';
4
4
 
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const app = require('nuxt/app');
4
- const devtoolsShared = require('../../shared/attaform.nycEksJn.cjs');
5
- const paths = require('../../shared/attaform.DwkU0oY9.cjs');
4
+ const devtoolsShared = require('../../shared/attaform.BOi6n2Pn.cjs');
5
+ const paths = require('../../shared/attaform.B7UdTs_o.cjs');
6
6
 
7
7
  var attaform_default = app.defineNuxtPlugin({
8
8
  // `enforce: 'pre'` makes the "we run before any component's setup" claim
@@ -1,6 +1,6 @@
1
1
  import { defineNuxtPlugin, useRuntimeConfig, useRoute } from 'nuxt/app';
2
- import { r as renderAttaformState, h as hydrateAttaformState, D as DEVTOOLS_WINDOW_KEY } from '../../shared/attaform.CAWKNCzc.mjs';
3
- import { g as createAttaform, m as kAttaformWizardActiveStepResolver, i as getRegistryFromApp } from '../../shared/attaform.Df-s8j1X.mjs';
2
+ import { r as renderAttaformState, h as hydrateAttaformState, D as DEVTOOLS_WINDOW_KEY } from '../../shared/attaform.0-00cYGw.mjs';
3
+ import { g as createAttaform, l as kAttaformWizardActiveStepResolver, i as getRegistryFromApp } from '../../shared/attaform.C0au8oXd.mjs';
4
4
 
5
5
  var attaform_default = defineNuxtPlugin({
6
6
  // `enforce: 'pre'` makes the "we run before any component's setup" claim
@@ -1,4 +1,4 @@
1
- import { i as getRegistryFromApp, n as pathKeyToDotted } from './attaform.Df-s8j1X.mjs';
1
+ import { i as getRegistryFromApp, m as pathKeyToDotted } from './attaform.C0au8oXd.mjs';
2
2
 
3
3
  function renderAttaformState(app) {
4
4
  const registry = getRegistryFromApp(app);
@@ -32,4 +32,4 @@ function hydrateAttaformState(app, payload) {
32
32
  const DEVTOOLS_WINDOW_KEY = "__attaform_devtools__";
33
33
 
34
34
  export { DEVTOOLS_WINDOW_KEY as D, hydrateAttaformState as h, renderAttaformState as r };
35
- //# sourceMappingURL=attaform.CAWKNCzc.mjs.map
35
+ //# sourceMappingURL=attaform.0-00cYGw.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"attaform.CAWKNCzc.mjs","sources":["../../src/runtime/core/serialize.ts","../../src/runtime/core/devtools-shared.ts"],"sourcesContent":["import type { App } from 'vue'\nimport type { FormKey } from '../types/types-api'\nimport { pathKeyToDotted, type PathKey } from './paths'\nimport { getRegistryFromApp, type SerializedFormData } from './registry'\n\n/**\n * Serialised snapshot of every form in a Vue app, produced by\n * `renderAttaformState` and consumed by `hydrateAttaformState`.\n *\n * JSON-safe — pass to `JSON.stringify`, `devalue`, or any other\n * serialiser before embedding in your SSR payload.\n */\nexport type SerializedAttaformState = {\n /** Tuples of `[formKey, snapshot]` for every form in the app. */\n readonly forms: ReadonlyArray<readonly [FormKey, SerializedFormData]>\n}\n\n/**\n * Snapshot every form on a Vue app for SSR. Call from your server\n * entry after rendering the app:\n *\n * ```ts\n * import { renderToString } from '@vue/server-renderer'\n * import { renderAttaformState, escapeForInlineScript } from 'attaform'\n *\n * const html = await renderToString(app)\n * const state = renderAttaformState(app)\n * const payload = escapeForInlineScript(JSON.stringify(state))\n *\n * return `\n * ${html}\n * <script>window.__ATTAFORM_STATE__ = ${payload}</script>\n * `\n * ```\n *\n * Pair with `hydrateAttaformState` on the client to restore the\n * forms in their server-rendered state. Nuxt users don't need this —\n * `attaform/nuxt` wires SSR automatically.\n */\nexport function renderAttaformState(app: App): SerializedAttaformState {\n const registry = getRegistryFromApp(app)\n const forms: Array<readonly [FormKey, SerializedFormData]> = []\n for (const [key, state] of registry.forms) {\n // Skip the blank field when the set is empty so the\n // wire payload stays minimal for forms that don't use it. The\n // optional shape on the consuming side handles the absence\n // cleanly (defaults to \"no blank paths\"). PathKey → dotted at\n // the boundary so the wire shape matches the rest of the\n // public path notation.\n const transientList: string[] = []\n for (const pk of state.blankPaths) {\n const d = pathKeyToDotted(pk as PathKey)\n if (d !== null) transientList.push(d)\n }\n forms.push([\n key,\n {\n form: state.form.value,\n schemaErrors: Array.from(state.schemaErrors.entries()),\n userErrors: Array.from(state.userErrors.entries()),\n fields: Array.from(state.fields.entries()),\n ...(transientList.length > 0 ? { blankPaths: transientList } : {}),\n },\n ])\n }\n return { forms }\n}\n\n/**\n * Restore forms from a server-rendered snapshot on the client. Call\n * from your client entry before mounting:\n *\n * ```ts\n * import { createApp } from 'vue'\n * import { createAttaform, hydrateAttaformState } from 'attaform'\n *\n * const app = createApp(App).use(createAttaform())\n * hydrateAttaformState(app, window.__ATTAFORM_STATE__)\n * app.mount('#app')\n * ```\n *\n * The next `useForm({ key })` call for each serialised form picks up\n * the snapshot transparently — no further action is required.\n */\nexport function hydrateAttaformState(app: App, payload: SerializedAttaformState): void {\n const registry = getRegistryFromApp(app)\n for (const [key, data] of payload.forms) {\n registry.pendingHydration.set(key, data)\n }\n}\n","/**\n * Shared building blocks for Attaform's two devtools surfaces — the Vue\n * DevTools (Chrome-extension) inspector wired up in `./devtools.ts`, and\n * the Nuxt DevTools (overlay) panel wired up via `../../nuxt.ts` +\n * `../pages/_attaform_devtools.vue`.\n *\n * Houses the window-bridge contract both surfaces consume so a new\n * bridge field lands in one file. Both surfaces render RAW form values\n * by design — DevTools is a dev-only surface, and redaction across every\n * place a value surfaces is impractical security theater rather than a\n * real safeguard.\n */\nimport type { AttaformRegistry } from './registry'\n\n/**\n * Property key on `window` that the Nuxt-side dev plugin attaches the\n * bridge object to. The iframe-mounted overlay panel reads\n * `window.parent[DEVTOOLS_WINDOW_KEY]` to reach the host app's registry.\n *\n * Underscored + namespaced to make accidental collision with consumer\n * globals vanishingly unlikely. Stable across versions — bumping it\n * would silently disconnect older library builds from newer overlay\n * panels in the same browser tab during a library upgrade.\n */\nexport const DEVTOOLS_WINDOW_KEY = '__attaform_devtools__'\n\n/**\n * Shape of the object the host plugin attaches to `window` in dev mode.\n * The iframe overlay panel reads this to discover the live registry and\n * render its forms.\n *\n * Single-registry assumption: the latest `createAttaform()` install\n * wins. Multi-app pages (rare; typically only seen in micro-frontend\n * setups) will only see one app's forms in the panel. Documented but\n * not actively supported — the alternative (a Set of registries with\n * union-rendering) is a future call if a real consumer hits it.\n */\nexport interface AttaformDevtoolsBridge {\n registry: AttaformRegistry\n /**\n * The library version, surfaced in the panel's footer for support /\n * bug-report context. Read from `package.json` at host-plugin init.\n */\n version: string\n}\n\ndeclare global {\n interface Window {\n [DEVTOOLS_WINDOW_KEY]?: AttaformDevtoolsBridge\n }\n}\n"],"names":[],"mappings":";;AAuCO,SAAS,oBAAoB,GAAA,EAAmC;AACrE,EAAA,MAAM,QAAA,GAAW,mBAAmB,GAAG,CAAA;AACvC,EAAA,MAAM,QAAuD,EAAC;AAC9D,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,CAAA,IAAK,SAAS,KAAA,EAAO;AAOzC,IAAA,MAAM,gBAA0B,EAAC;AACjC,IAAA,KAAA,MAAW,EAAA,IAAM,MAAM,UAAA,EAAY;AACjC,MAAA,MAAM,CAAA,GAAI,gBAAgB,EAAa,CAAA;AACvC,MAAA,IAAI,CAAA,KAAM,IAAA,EAAM,aAAA,CAAc,IAAA,CAAK,CAAC,CAAA;AAAA,IACtC;AACA,IAAA,KAAA,CAAM,IAAA,CAAK;AAAA,MACT,GAAA;AAAA,MACA;AAAA,QACE,IAAA,EAAM,MAAM,IAAA,CAAK,KAAA;AAAA,QACjB,cAAc,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,YAAA,CAAa,SAAS,CAAA;AAAA,QACrD,YAAY,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,SAAS,CAAA;AAAA,QACjD,QAAQ,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,SAAS,CAAA;AAAA,QACzC,GAAI,cAAc,MAAA,GAAS,CAAA,GAAI,EAAE,UAAA,EAAY,aAAA,KAAkB;AAAC;AAClE,KACD,CAAA;AAAA,EACH;AACA,EAAA,OAAO,EAAE,KAAA,EAAM;AACjB;AAkBO,SAAS,oBAAA,CAAqB,KAAU,OAAA,EAAwC;AACrF,EAAA,MAAM,QAAA,GAAW,mBAAmB,GAAG,CAAA;AACvC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,IAAI,CAAA,IAAK,QAAQ,KAAA,EAAO;AACvC,IAAA,QAAA,CAAS,gBAAA,CAAiB,GAAA,CAAI,GAAA,EAAK,IAAI,CAAA;AAAA,EACzC;AACF;;ACjEO,MAAM,mBAAA,GAAsB;;;;"}
1
+ {"version":3,"file":"attaform.0-00cYGw.mjs","sources":["../../src/runtime/core/serialize.ts","../../src/runtime/core/devtools-shared.ts"],"sourcesContent":["import type { App } from 'vue'\nimport type { FormKey } from '../types/types-api'\nimport { pathKeyToDotted, type PathKey } from './paths'\nimport { getRegistryFromApp, type SerializedFormData } from './registry'\n\n/**\n * Serialised snapshot of every form in a Vue app, produced by\n * `renderAttaformState` and consumed by `hydrateAttaformState`.\n *\n * JSON-safe — pass to `JSON.stringify`, `devalue`, or any other\n * serialiser before embedding in your SSR payload.\n */\nexport type SerializedAttaformState = {\n /** Tuples of `[formKey, snapshot]` for every form in the app. */\n readonly forms: ReadonlyArray<readonly [FormKey, SerializedFormData]>\n}\n\n/**\n * Snapshot every form on a Vue app for SSR. Call from your server\n * entry after rendering the app:\n *\n * ```ts\n * import { renderToString } from '@vue/server-renderer'\n * import { renderAttaformState, escapeForInlineScript } from 'attaform'\n *\n * const html = await renderToString(app)\n * const state = renderAttaformState(app)\n * const payload = escapeForInlineScript(JSON.stringify(state))\n *\n * return `\n * ${html}\n * <script>window.__ATTAFORM_STATE__ = ${payload}</script>\n * `\n * ```\n *\n * Pair with `hydrateAttaformState` on the client to restore the\n * forms in their server-rendered state. Nuxt users don't need this —\n * `attaform/nuxt` wires SSR automatically.\n */\nexport function renderAttaformState(app: App): SerializedAttaformState {\n const registry = getRegistryFromApp(app)\n const forms: Array<readonly [FormKey, SerializedFormData]> = []\n for (const [key, state] of registry.forms) {\n // Skip the blank field when the set is empty so the\n // wire payload stays minimal for forms that don't use it. The\n // optional shape on the consuming side handles the absence\n // cleanly (defaults to \"no blank paths\"). PathKey → dotted at\n // the boundary so the wire shape matches the rest of the\n // public path notation.\n const transientList: string[] = []\n for (const pk of state.blankPaths) {\n const d = pathKeyToDotted(pk as PathKey)\n if (d !== null) transientList.push(d)\n }\n forms.push([\n key,\n {\n form: state.form.value,\n schemaErrors: Array.from(state.schemaErrors.entries()),\n userErrors: Array.from(state.userErrors.entries()),\n fields: Array.from(state.fields.entries()),\n ...(transientList.length > 0 ? { blankPaths: transientList } : {}),\n },\n ])\n }\n return { forms }\n}\n\n/**\n * Restore forms from a server-rendered snapshot on the client. Call\n * from your client entry before mounting:\n *\n * ```ts\n * import { createApp } from 'vue'\n * import { createAttaform, hydrateAttaformState } from 'attaform'\n *\n * const app = createApp(App).use(createAttaform())\n * hydrateAttaformState(app, window.__ATTAFORM_STATE__)\n * app.mount('#app')\n * ```\n *\n * The next `useForm({ key })` call for each serialised form picks up\n * the snapshot transparently — no further action is required.\n */\nexport function hydrateAttaformState(app: App, payload: SerializedAttaformState): void {\n const registry = getRegistryFromApp(app)\n for (const [key, data] of payload.forms) {\n registry.pendingHydration.set(key, data)\n }\n}\n","/**\n * Shared building blocks for Attaform's two devtools surfaces — the Vue\n * DevTools (Chrome-extension) inspector wired up in `./devtools.ts`, and\n * the Nuxt DevTools (overlay) panel wired up via `../../nuxt.ts` +\n * `../pages/_attaform_devtools.vue`.\n *\n * Houses the window-bridge contract both surfaces consume so a new\n * bridge field lands in one file. Both surfaces render RAW form values\n * by design — DevTools is a dev-only surface, and redaction across every\n * place a value surfaces is impractical security theater rather than a\n * real safeguard.\n */\nimport type { AttaformRegistry } from './registry'\n\n/**\n * Property key on `window` that the Nuxt-side dev plugin attaches the\n * bridge object to. The iframe-mounted overlay panel reads\n * `window.parent[DEVTOOLS_WINDOW_KEY]` to reach the host app's registry.\n *\n * Underscored + namespaced to make accidental collision with consumer\n * globals vanishingly unlikely. Stable across versions — bumping it\n * would silently disconnect older library builds from newer overlay\n * panels in the same browser tab during a library upgrade.\n */\nexport const DEVTOOLS_WINDOW_KEY = '__attaform_devtools__'\n\n/**\n * Shape of the object the host plugin attaches to `window` in dev mode.\n * The iframe overlay panel reads this to discover the live registry and\n * render its forms.\n *\n * Single-registry assumption: the latest `createAttaform()` install\n * wins. Multi-app pages (rare; typically only seen in micro-frontend\n * setups) will only see one app's forms in the panel. Documented but\n * not actively supported — the alternative (a Set of registries with\n * union-rendering) is a future call if a real consumer hits it.\n */\nexport interface AttaformDevtoolsBridge {\n registry: AttaformRegistry\n /**\n * The library version, surfaced in the panel's footer for support /\n * bug-report context. Read from `package.json` at host-plugin init.\n */\n version: string\n}\n\ndeclare global {\n interface Window {\n [DEVTOOLS_WINDOW_KEY]?: AttaformDevtoolsBridge\n }\n}\n"],"names":[],"mappings":";;AAuCO,SAAS,oBAAoB,GAAA,EAAmC;AACrE,EAAA,MAAM,QAAA,GAAW,mBAAmB,GAAG,CAAA;AACvC,EAAA,MAAM,QAAuD,EAAC;AAC9D,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,CAAA,IAAK,SAAS,KAAA,EAAO;AAOzC,IAAA,MAAM,gBAA0B,EAAC;AACjC,IAAA,KAAA,MAAW,EAAA,IAAM,MAAM,UAAA,EAAY;AACjC,MAAA,MAAM,CAAA,GAAI,gBAAgB,EAAa,CAAA;AACvC,MAAA,IAAI,CAAA,KAAM,IAAA,EAAM,aAAA,CAAc,IAAA,CAAK,CAAC,CAAA;AAAA,IACtC;AACA,IAAA,KAAA,CAAM,IAAA,CAAK;AAAA,MACT,GAAA;AAAA,MACA;AAAA,QACE,IAAA,EAAM,MAAM,IAAA,CAAK,KAAA;AAAA,QACjB,cAAc,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,YAAA,CAAa,SAAS,CAAA;AAAA,QACrD,YAAY,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,SAAS,CAAA;AAAA,QACjD,QAAQ,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,SAAS,CAAA;AAAA,QACzC,GAAI,cAAc,MAAA,GAAS,CAAA,GAAI,EAAE,UAAA,EAAY,aAAA,KAAkB;AAAC;AAClE,KACD,CAAA;AAAA,EACH;AACA,EAAA,OAAO,EAAE,KAAA,EAAM;AACjB;AAkBO,SAAS,oBAAA,CAAqB,KAAU,OAAA,EAAwC;AACrF,EAAA,MAAM,QAAA,GAAW,mBAAmB,GAAG,CAAA;AACvC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,IAAI,CAAA,IAAK,QAAQ,KAAA,EAAO;AACvC,IAAA,QAAA,CAAS,gBAAA,CAAiB,GAAA,CAAI,GAAA,EAAK,IAAI,CAAA;AAAA,EACzC;AACF;;ACjEO,MAAM,mBAAA,GAAsB;;;;"}
@@ -1,4 +1,4 @@
1
- import { F as FormKey, W as PathKey, m as DisplayCtx, d as GetDisplayState, n as DisplayMachine, V as Path, aa as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, ag as ValidationError, a as AbstractSchema, ak as WriteMeta, j as DeepPartial, al as WriteShape, as as TransformAbortHolder, ae as ValidateOn, A as AttaformDefaults, b as UseFormReturnType, c as RegisterValue } from './attaform.GJbSmwLB.cjs';
1
+ import { F as FormKey, W as PathKey, m as DisplayCtx, d as GetDisplayState, n as DisplayMachine, V as Path, aa as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, ag as ValidationError, a as AbstractSchema, ak as WriteMeta, j as DeepPartial, al as WriteShape, at as TransformAbortHolder, ae as ValidateOn, A as AttaformDefaults, b as UseFormReturnType, c as RegisterValue } from './attaform.DUc6cetN.mjs';
2
2
  import { Ref, ComputedRef, App, InjectionKey } from 'vue';
3
3
 
4
4
  /**
@@ -209,9 +209,11 @@ type WizardSubmitContext = {
209
209
  type WizardOnSubmit = (ctx: WizardSubmitContext) => void | Promise<void>;
210
210
  /**
211
211
  * Optional `onError` callback registered via `wizard.handleSubmit`.
212
- * Receives the aggregate error list entries originate from per-form
213
- * validation and activation failures (`atta:activation-failed`). Sync
214
- * or async; the returned promise gates `wizard.submitting`.
212
+ * Receives the aggregate error list. Entries originate from per-form
213
+ * validation, activation failures (`atta:activation-failed`), and a
214
+ * submit callback that left errors on a processed step (the
215
+ * `setErrors(...); return` server-rejection path). Sync or async; the
216
+ * returned promise gates `wizard.submitting`.
215
217
  */
216
218
  type WizardOnError = (errors: readonly WizardAggregateError[]) => void | Promise<void>;
217
219
  /**
@@ -402,25 +404,32 @@ type WizardForms<S> = FormsRecordOf<S> & Readonly<Record<FormKey, AnyForm>>;
402
404
  * Forward-looking; reactive to current form
403
405
  * validity. Gates "Finish button enable" style UI.
404
406
  * - `done` — monotonic latch: flips `true` the first time a
405
- * final-step `handleSubmit` resolves without
406
- * throwing, and stays `true` through subsequent
407
- * edits or invalidations. Only `reset()` flips it
408
- * back. Gates "show success card" style UI that
409
- * should reflect submission history rather than
410
- * current validity.
407
+ * final-step `handleSubmit` resolves without throwing
408
+ * AND leaves no errors set on any step, and stays
409
+ * `true` through subsequent edits or invalidations. A
410
+ * callback that calls `setErrors` and returns (the
411
+ * documented server-rejection path) is a failed submit,
412
+ * so it does not flip `done`. Only `reset()` flips it
413
+ * back. Gates "show success card" style UI that should
414
+ * reflect submission history rather than current
415
+ * validity.
411
416
  * - `submitting` — `true` while a `wizard.handleSubmit` call is in
412
417
  * flight. Global re-entrance guard: every
413
418
  * navigation method also refuses while this is on.
414
419
  * - `submissionAttempts` — count of `wizard.handleSubmit` invocations
415
420
  * (success or failure). Always bumps, including on
416
421
  * noop-form steps.
417
- * - `submitError` — the error thrown by the most recent
422
+ * - `submitError` — the error THROWN by the most recent
418
423
  * `wizard.handleSubmit` callback (or its `onError`),
419
424
  * coerced to a real `Error`. Mirrors
420
- * `form.meta.submitError`: cleared at submit entry and
421
- * by `reset()`, parked here rather than re-thrown, so
422
- * the handler resolves and never manufactures a
423
- * `window` unhandledrejection. `null` on success.
425
+ * `form.meta.submitError`: this is the unexpected-throw
426
+ * channel, so an expected rejection handled via
427
+ * `setErrors` (no throw) surfaces through the error
428
+ * surface and `onError` instead, leaving this `null`.
429
+ * Cleared at submit entry and by `reset()`, parked here
430
+ * rather than re-thrown, so the handler resolves and
431
+ * never manufactures a `window` unhandledrejection.
432
+ * `null` on success.
424
433
  * - `visited` — append-only breadcrumb of navigated step keys.
425
434
  * `back()` does not pop; the trail is the audit
426
435
  * log, not the back-stack.
@@ -1091,6 +1100,15 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
1091
1100
  * no longer see the shape change.
1092
1101
  */
1093
1102
  hasStructuralChangeUnder(path: Path): boolean;
1103
+ /**
1104
+ * Whether a baseline-present container under `path` was replaced wholesale by
1105
+ * a non-container (e.g. `setValue('profile', undefined)`) and is still absent.
1106
+ * The other half of removal-driven `dirty`: such a subtree's leaves vanish
1107
+ * from the live value, so neither the present-leaf walk nor the array tracker
1108
+ * can see the loss. Self-filters by current liveness, so a refilled path stops
1109
+ * counting.
1110
+ */
1111
+ hasRemovedSubtreeUnder(path: Path): boolean;
1094
1112
  getFieldRecord(path: Path): FieldRecord | undefined;
1095
1113
  getOriginalAtPath(path: Path): unknown;
1096
1114
  /**
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const walkFieldMeta = require('./attaform.BV_HyaMO.cjs');
4
- const injectWizard = require('./attaform.C42wL7EJ.cjs');
5
- const paths = require('./attaform.DwkU0oY9.cjs');
3
+ const walkFieldMeta = require('./attaform.DdfLrIgM.cjs');
4
+ const injectWizard = require('./attaform.Bos7wVZw.cjs');
5
+ const paths = require('./attaform.B7UdTs_o.cjs');
6
6
 
7
7
  const fieldMeta = walkFieldMeta.fieldMetaStore;
8
8
  function withMeta(schema, payload) {
@@ -1634,4 +1634,4 @@ exports.isZodSchemaType = isZodSchemaType;
1634
1634
  exports.useForm = useForm;
1635
1635
  exports.withMeta = withMeta;
1636
1636
  exports.zodAdapter = zodAdapter;
1637
- //# sourceMappingURL=attaform.Z1qTwOYE.cjs.map
1637
+ //# sourceMappingURL=attaform.B57G7ePY.cjs.map