attaform 0.28.0 → 0.30.0
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.
- package/dist/abstract.d.mts +5 -5
- package/dist/abstract.mjs +4 -4
- package/dist/dev/abstract.mjs +4 -4
- package/dist/dev/chunks/dev-key-collision-warnings.mjs +47 -8
- package/dist/dev/chunks/devtools.mjs +1 -1
- package/dist/dev/directive.mjs +1 -1
- package/dist/dev/history.mjs +1 -2
- package/dist/dev/index.mjs +5 -5
- package/dist/dev/runtime/plugins/attaform.mjs +3 -3
- package/dist/dev/shared/{attaform-dev.oYrkP9dj.mjs → attaform-dev.BK6Ge2qR.mjs} +80 -341
- package/dist/dev/shared/{attaform-dev.Dr2YzS5B.mjs → attaform-dev.BQc5QV3Y.mjs} +11 -19
- package/dist/dev/shared/{attaform-dev.BR8u0YOZ.mjs → attaform-dev.BcNtyOmf.mjs} +4 -4
- package/dist/{shared/attaform.h0i6LijT.mjs → dev/shared/attaform-dev.BcYT6tFh.mjs} +152 -20
- package/dist/dev/shared/{attaform-dev.6qxD-Yqo.mjs → attaform-dev.BisFstxh.mjs} +227 -88
- package/dist/dev/shared/{attaform-dev.WmuhD_CZ.mjs → attaform-dev.CQ2rJiAX.mjs} +833 -656
- package/dist/dev/shared/{attaform-dev.P7cseiEG.mjs → attaform-dev.D6CLvaQT.mjs} +20 -11
- package/dist/dev/shared/{attaform-dev.D2I8e_Mm.mjs → attaform-dev.DTrHonpc.mjs} +225 -238
- package/dist/dev/shared/{attaform-dev.BXE2cr0L.mjs → attaform-dev.DUZckyV8.mjs} +1 -3
- package/dist/dev/zod-v3.mjs +6 -6
- package/dist/dev/zod-v4.mjs +6 -6
- package/dist/dev/zod.mjs +5 -5
- package/dist/directive.d.mts +2 -2
- package/dist/directive.mjs +1 -1
- package/dist/history.d.mts +1 -1
- package/dist/history.mjs +1 -2
- package/dist/index.d.mts +9 -7
- package/dist/index.mjs +5 -5
- package/dist/nuxt.d.mts +11 -20
- package/dist/nuxt.mjs +0 -1
- package/dist/runtime/plugins/attaform.mjs +3 -3
- package/dist/shared/{attaform.uLbun31C.mjs → attaform.B3resMQ1.mjs} +19 -11
- package/dist/shared/{attaform.Cs2Rbdlo.mjs → attaform.BK0cgu2K.mjs} +123 -139
- package/dist/{dev/shared/attaform-dev.By4PRjt0.mjs → shared/attaform.BRDDQeHV.mjs} +136 -26
- package/dist/shared/{attaform.NLmerepI.mjs → attaform.BXneBxEj.mjs} +71 -334
- package/dist/shared/{attaform.D6DCnnQu.mjs → attaform.ByWP6kSx.mjs} +4 -4
- package/dist/shared/{attaform.CJP3RkGa.mjs → attaform.CJ8DpRGj.mjs} +223 -238
- package/dist/shared/{attaform.C09fpdLS.mjs → attaform.CUfrMK7t.mjs} +227 -88
- package/dist/shared/{attaform.wfY8XFvm.mjs → attaform.CdZIEf7_.mjs} +11 -19
- package/dist/shared/{attaform.JfSWdEcb.d.mts → attaform.Clz0ArIi.d.mts} +1 -1
- package/dist/shared/{attaform.B8k8JrmK.mjs → attaform.DNJOWjQw.mjs} +826 -612
- package/dist/shared/{attaform.B4VkS43-.d.mts → attaform.Rc9u4Vfw.d.mts} +1 -1
- package/dist/shared/{attaform.D5V4tZWq.d.mts → attaform.UGyOK83T.d.mts} +200 -218
- package/dist/shared/{attaform.Dq4vWxuG.mjs → attaform.WiGdIqgx.mjs} +1 -3
- package/dist/shared/{attaform.Cgu-hdSb.d.mts → attaform.bKLzMU0o.d.mts} +321 -523
- package/dist/transforms.d.mts +0 -22
- package/dist/transforms.mjs +1 -1
- package/dist/vite.d.mts +13 -4
- package/dist/vite.mjs +8 -2
- package/dist/zod-v3.d.mts +6 -4
- package/dist/zod-v3.mjs +6 -6
- package/dist/zod-v4.d.mts +18 -31
- package/dist/zod-v4.mjs +6 -6
- package/dist/zod.d.mts +4 -4
- package/dist/zod.mjs +5 -5
- package/package.json +19 -15
- package/skills/attaform/SKILL.md +6 -3
- package/skills/attaform/references/custom-components.md +8 -3
- package/skills/attaform/references/errors.md +8 -3
- package/skills/attaform/references/saving.md +77 -0
- package/skills/attaform/references/wizards.md +10 -8
- package/dist/chunks/fingerprint.mjs +0 -183
- package/dist/chunks/fingerprint2.mjs +0 -159
- package/dist/dev/chunks/fingerprint.mjs +0 -183
- package/dist/dev/chunks/fingerprint2.mjs +0 -159
- package/dist/dev/shared/attaform-dev.BJGA_UOS.mjs +0 -36
- package/dist/shared/attaform.BJGA_UOS.mjs +0 -36
package/dist/abstract.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as AttaformRegistry } from './shared/attaform.
|
|
2
|
-
export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, C as CompiledStep, D as
|
|
3
|
-
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.
|
|
4
|
-
export { b as ArrayItem, c as ArrayPath,
|
|
5
|
-
export { v as vRegister } from './shared/attaform.
|
|
1
|
+
import { A as AttaformRegistry } from './shared/attaform.UGyOK83T.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.UGyOK83T.mjs';
|
|
3
|
+
import { G as GenericForm, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, D as DefaultValuesInput, a as UseFormReturnType } from './shared/attaform.bKLzMU0o.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 SchemaDefaultsResult, a0 as SchemaParseErrorWithData, a1 as SchemaParseErrorWithoutData, a2 as SchemaParseResult, a3 as SchemaParseSuccess, a4 as Segment, a5 as SetValueCallback, a6 as SetValuePayload, a7 as SettledValidationStatus, a8 as SlimPrimitiveKind, a9 as SubmitHandler, aa as Unset, ab as ValidateOn, ac as ValidateOnConfig, ad as ValidationError, ae as ValidationResponse, af as ValidationResponseWithoutValue, ag as ValueOfUnion, ah as WriteMeta, ai as WriteShape, aj as canonicalizePath, ak as isPathPrefix, al as isUnset, am as parseDottedPath, an as unset } from './shared/attaform.bKLzMU0o.mjs';
|
|
5
|
+
export { v as vRegister } from './shared/attaform.Clz0ArIi.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/abstract.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AttaformErrorCode,
|
|
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.
|
|
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.
|
|
4
|
-
export { a as assignKey, v as vRegister } from './shared/attaform.
|
|
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.DNJOWjQw.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.WiGdIqgx.mjs';
|
|
4
|
+
export { a as assignKey, v as vRegister } from './shared/attaform.B3resMQ1.mjs';
|
|
5
5
|
export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
|
package/dist/dev/abstract.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AttaformErrorCode,
|
|
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.
|
|
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.
|
|
4
|
-
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.
|
|
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.CQ2rJiAX.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.BQc5QV3Y.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.DUZckyV8.mjs';
|
|
4
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.D6CLvaQT.mjs';
|
|
@@ -1,22 +1,61 @@
|
|
|
1
|
+
const MAX_SKETCH_DEPTH = 6;
|
|
2
|
+
const MAX_SKETCH_NODES = 400;
|
|
3
|
+
function describePath(schema, path) {
|
|
4
|
+
const kinds = [...schema.getSlimPrimitiveTypesAtPath(path)].sort().join("|");
|
|
5
|
+
const arity = schema.arrayShapeAtPath(path);
|
|
6
|
+
return [
|
|
7
|
+
kinds,
|
|
8
|
+
schema.isRequiredAtPath(path) ? "req" : "opt",
|
|
9
|
+
schema.isLeafAtPath(path) ? "leaf" : "node",
|
|
10
|
+
arity === null ? "" : `[${arity}]`
|
|
11
|
+
].join(",");
|
|
12
|
+
}
|
|
13
|
+
function sketchSchema(schema) {
|
|
14
|
+
const lines = [];
|
|
15
|
+
let budget = MAX_SKETCH_NODES;
|
|
16
|
+
const visit = (value, path) => {
|
|
17
|
+
if (budget <= 0) return;
|
|
18
|
+
budget -= 1;
|
|
19
|
+
lines.push(`${path.join(".")}=${describePath(schema, path)}`);
|
|
20
|
+
if (path.length >= MAX_SKETCH_DEPTH) return;
|
|
21
|
+
if (Array.isArray(value)) {
|
|
22
|
+
if (value.length > 0) visit(value[0], [...path, 0]);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (value === null || typeof value !== "object") return;
|
|
26
|
+
for (const childKey of Object.keys(value).sort()) {
|
|
27
|
+
visit(value[childKey], [...path, childKey]);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
visit(schema.getDefaultAtPath([]), []);
|
|
31
|
+
return lines.join("\n");
|
|
32
|
+
}
|
|
1
33
|
async function warnOnSchemaFingerprintMismatch(key, existing, incoming) {
|
|
2
|
-
|
|
3
|
-
|
|
34
|
+
await Promise.resolve();
|
|
35
|
+
if (existing === incoming) return;
|
|
36
|
+
let existingSketch;
|
|
37
|
+
let incomingSketch;
|
|
4
38
|
try {
|
|
5
|
-
|
|
6
|
-
|
|
39
|
+
existingSketch = sketchSchema(existing);
|
|
40
|
+
incomingSketch = sketchSchema(incoming);
|
|
7
41
|
} catch (error) {
|
|
8
42
|
console.error(
|
|
9
|
-
`[attaform]
|
|
43
|
+
`[attaform] could not compare schemas for key "${key}"; skipping mismatch check.`,
|
|
10
44
|
error
|
|
11
45
|
);
|
|
12
46
|
return;
|
|
13
47
|
}
|
|
14
|
-
if (
|
|
48
|
+
if (existingSketch === incomingSketch) return;
|
|
15
49
|
console.warn(
|
|
16
50
|
`[attaform] useForm() calls with key "${key}" use different schemas; first wins, second is ignored. Use identical schemas or unique keys.
|
|
17
|
-
existing:
|
|
18
|
-
|
|
51
|
+
existing:
|
|
52
|
+
${indent(existingSketch)}
|
|
53
|
+
incoming:
|
|
54
|
+
${indent(incomingSketch)}`
|
|
19
55
|
);
|
|
20
56
|
}
|
|
57
|
+
function indent(sketch) {
|
|
58
|
+
return sketch.split("\n").map((line) => ` ${line}`).join("\n");
|
|
59
|
+
}
|
|
21
60
|
|
|
22
61
|
export { warnOnSchemaFingerprintMismatch };
|
package/dist/dev/directive.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { b as installVRegister, v as vRegister, c as vRegisterFile } from './shared/attaform-dev.
|
|
1
|
+
export { b as installVRegister, v as vRegister, c as vRegisterFile } from './shared/attaform-dev.D6CLvaQT.mjs';
|
package/dist/dev/history.mjs
CHANGED
|
@@ -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.
|
|
2
|
+
import { n as normalizeNumericOption, D as DEFAULT_HISTORY_MAX_SNAPSHOTS, s as structuralSnapshot } from './shared/attaform-dev.BcYT6tFh.mjs';
|
|
3
3
|
|
|
4
4
|
function captureErrorCells(map) {
|
|
5
5
|
const out = [];
|
|
@@ -77,7 +77,6 @@ function historyPlugin(options) {
|
|
|
77
77
|
const max = normalizeNumericOption({
|
|
78
78
|
value: options?.max ?? DEFAULT_HISTORY_MAX_SNAPSHOTS,
|
|
79
79
|
source: "historyPlugin({ max })",
|
|
80
|
-
allowInfinity: false,
|
|
81
80
|
min: 0,
|
|
82
81
|
defaultValue: DEFAULT_HISTORY_MAX_SNAPSHOTS
|
|
83
82
|
});
|
package/dist/dev/index.mjs
CHANGED
|
@@ -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.
|
|
2
|
-
export { A as AttaformErrorCode,
|
|
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.
|
|
4
|
-
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.
|
|
5
|
-
export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.
|
|
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.BQc5QV3Y.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.CQ2rJiAX.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.DUZckyV8.mjs';
|
|
4
|
+
export { a as assignKey, i as isRegisterValue, v as vRegister } from './shared/attaform-dev.D6CLvaQT.mjs';
|
|
5
|
+
export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform-dev.BcNtyOmf.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.
|
|
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.DUZckyV8.mjs';
|
|
3
3
|
|
|
4
4
|
var attaform_default = defineNuxtPlugin({
|
|
5
5
|
// `enforce: 'pre'` makes the "we run before any component's setup" claim
|
|
@@ -11,8 +11,8 @@ var attaform_default = defineNuxtPlugin({
|
|
|
11
11
|
setup(nuxtApp) {
|
|
12
12
|
const isServer = import.meta.server;
|
|
13
13
|
const config = useRuntimeConfig().public;
|
|
14
|
-
const {
|
|
15
|
-
nuxtApp.vueApp.use(createAttaform({ ssr: isServer
|
|
14
|
+
const { version } = config.attaform;
|
|
15
|
+
nuxtApp.vueApp.use(createAttaform({ ssr: isServer }));
|
|
16
16
|
nuxtApp.vueApp.provide(kAttaformWizardActiveStepResolver, (param) => {
|
|
17
17
|
const value = useRoute().query[param];
|
|
18
18
|
if (typeof value === "string") return value;
|