attaform 0.31.0 → 0.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract.d.mts +5 -5
- package/dist/abstract.mjs +5 -4
- package/dist/dev/abstract.mjs +5 -4
- package/dist/dev/chunks/devtools.mjs +1 -1
- package/dist/dev/directive.mjs +1 -1
- package/dist/dev/history.mjs +126 -6
- package/dist/dev/index.mjs +6 -5
- package/dist/dev/runtime/plugins/attaform.mjs +1 -1
- package/dist/dev/shared/{attaform-dev.zlvDr0WB.mjs → attaform-dev.04aupFBW.mjs} +3 -2
- package/dist/dev/shared/{attaform-dev.CtyqGia7.mjs → attaform-dev.BKWPjEB2.mjs} +5 -4
- package/dist/dev/shared/{attaform-dev.DlaT4xGd.mjs → attaform-dev.BnLLxX2l.mjs} +4 -4
- package/dist/dev/shared/{attaform-dev.B1q-x9R9.mjs → attaform-dev.Bu6wgrA5.mjs} +1 -1
- package/dist/dev/shared/{attaform-dev.k5X47GMD.mjs → attaform-dev.CKSqs_xQ.mjs} +3 -2
- package/dist/dev/shared/{attaform-dev.DJ3nsWw6.mjs → attaform-dev.Cf_hZfbT.mjs} +18 -9
- package/dist/dev/shared/{attaform-dev.y9x9Vp9F.mjs → attaform-dev.DLk51W7-.mjs} +565 -926
- package/dist/dev/shared/attaform-dev.DoG8mZTq.mjs +127 -0
- package/dist/dev/shared/attaform-dev.G-3XDl9F.mjs +1192 -0
- package/dist/dev/shared/{attaform-dev.Caibt7sb.mjs → attaform-dev.oguHqv1W.mjs} +11 -10
- package/dist/dev/zod-v3.mjs +7 -6
- package/dist/dev/zod-v4.mjs +7 -6
- package/dist/dev/zod.mjs +6 -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 +126 -6
- package/dist/index.d.mts +16 -55
- package/dist/index.mjs +6 -5
- package/dist/runtime/plugins/attaform.mjs +1 -1
- package/dist/shared/{attaform.DL2nl_QR.mjs → attaform.3kV6PqVJ.mjs} +11 -10
- package/dist/shared/{attaform.L011tHgJ.mjs → attaform.BJeiuJE2.mjs} +4 -4
- package/dist/shared/attaform.BNUhW4qC.mjs +103 -0
- package/dist/shared/{attaform.CdZIEf7_.mjs → attaform.BhtAZysa.mjs} +3 -2
- package/dist/shared/{attaform.BWUn8Kjy.mjs → attaform.BlAmZ-WU.mjs} +18 -9
- package/dist/shared/{attaform.LUPC-2Qg.mjs → attaform.CMzc4bPI.mjs} +5 -4
- package/dist/shared/{attaform.C4shmwyJ.mjs → attaform.CdA9bfRv.mjs} +1 -1
- package/dist/shared/attaform.CgyyJVuq.mjs +1187 -0
- package/dist/shared/{attaform.DAo0QBmS.d.mts → attaform.CibLYe9-.d.mts} +214 -173
- package/dist/shared/{attaform.DNPJPOO7.mjs → attaform.DCUJCKyG.mjs} +562 -925
- package/dist/shared/{attaform.D9RqPgGu.d.mts → attaform.DCyZT7u-.d.mts} +1 -1
- package/dist/shared/{attaform.CRVe8s82.d.mts → attaform.DD0Y8krq.d.mts} +43 -19
- package/dist/shared/{attaform.DxKQsqFZ.mjs → attaform.T0YjhjPU.mjs} +3 -2
- package/dist/shared/{attaform.DZnrDrNb.d.mts → attaform.bI_4nKZp.d.mts} +119 -8
- package/dist/zod-v3.d.mts +4 -4
- package/dist/zod-v3.mjs +7 -6
- package/dist/zod-v4.d.mts +15 -11
- package/dist/zod-v4.mjs +7 -6
- package/dist/zod.d.mts +4 -4
- package/dist/zod.mjs +6 -5
- package/package.json +2 -1
- package/skills/attaform/SKILL.md +1 -0
- package/dist/dev/shared/attaform-dev.CZz4GYZ6.mjs +0 -386
- package/dist/shared/attaform.8mfKZCwH.mjs +0 -358
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
const reported = /* @__PURE__ */ new Set() ;
|
|
2
|
+
function reportConsumerThrow(site, detail, err) {
|
|
3
|
+
const key = detail === void 0 ? site : `${site}|${detail}`;
|
|
4
|
+
if (reported === null || reported.has(key)) return;
|
|
5
|
+
reported.add(key);
|
|
6
|
+
const at = detail === void 0 ? "" : ` at \`${detail}\``;
|
|
7
|
+
const advice = {
|
|
8
|
+
"default-factory": "a `.default(() => ...)` factory threw. Attaform used `undefined` for that field's initial value.",
|
|
9
|
+
"catch-factory": "a `.catch(() => ...)` fallback threw. Attaform used `undefined` for that value.",
|
|
10
|
+
"lazy-getter": "a `z.lazy(() => ...)` factory threw. Attaform stopped descending at that node, so paths below it will not resolve.",
|
|
11
|
+
"wizard-slot": `a function step slot threw${at}. Attaform dropped that step from the compiled list; the rest of the flow still navigates.`,
|
|
12
|
+
"wizard-lazy-slot": `a \`lazy()\` step resolver threw${at}. Attaform dropped that step from the compiled list until the resolver's own dependencies change.`,
|
|
13
|
+
"wizard-progress": "a `useWizard({ progress })` override threw. Attaform fell back to its own valid-step ratio.",
|
|
14
|
+
"wizard-restore": "a `useWizard({ restore })` callback threw. Attaform read no step from it, so the wizard stays where it is.",
|
|
15
|
+
"wizard-persist": "a `useWizard({ persist })` callback threw. Attaform navigated anyway, so the step is live but unrecorded.",
|
|
16
|
+
"wizard-default-statuses": "a `useWizard({ defaultStatuses })` factory threw or rejected. Attaform seeded no statuses, the same as omitting the option.",
|
|
17
|
+
"stored-value": "a written value threw as Vue read it to store it (a Proxy whose `get` trap throws). Attaform skipped that write, so the form keeps the value it had."
|
|
18
|
+
};
|
|
19
|
+
console.error(
|
|
20
|
+
`[attaform] ${advice[site]} Attaform has nowhere to surface this, so it must not throw; wrap your own try/catch if the failure is recoverable. Original error:`,
|
|
21
|
+
err
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function callConsumerFn(fn, fallback, site, detail) {
|
|
25
|
+
try {
|
|
26
|
+
return fn();
|
|
27
|
+
} catch (err) {
|
|
28
|
+
reportConsumerThrow(site, detail, err);
|
|
29
|
+
return fallback;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function readConsumerProp(obj, key) {
|
|
33
|
+
try {
|
|
34
|
+
return obj[key];
|
|
35
|
+
} catch {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function consumerKeys(obj) {
|
|
40
|
+
try {
|
|
41
|
+
return Object.keys(obj);
|
|
42
|
+
} catch {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function readConsumerIndex(arr, i) {
|
|
47
|
+
try {
|
|
48
|
+
return arr[i];
|
|
49
|
+
} catch {
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function consumerSymbolKeys(obj) {
|
|
54
|
+
try {
|
|
55
|
+
return Object.getOwnPropertySymbols(obj);
|
|
56
|
+
} catch {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function consumerHas(obj, key) {
|
|
61
|
+
try {
|
|
62
|
+
return key in obj;
|
|
63
|
+
} catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function consumerExtensible(obj) {
|
|
68
|
+
try {
|
|
69
|
+
return Object.isExtensible(obj);
|
|
70
|
+
} catch {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function safeAssign(target, key, value) {
|
|
76
|
+
if (key === "__proto__") {
|
|
77
|
+
Object.defineProperty(target, key, {
|
|
78
|
+
value,
|
|
79
|
+
writable: true,
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true
|
|
82
|
+
});
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
target[key] = value;
|
|
86
|
+
}
|
|
87
|
+
const SHADOWED_KEYS = new Set(Object.getOwnPropertyNames(Object.prototype));
|
|
88
|
+
function isShadowedKey(key) {
|
|
89
|
+
return SHADOWED_KEYS.has(key);
|
|
90
|
+
}
|
|
91
|
+
function safeOwnRead(target, key) {
|
|
92
|
+
if (isShadowedKey(key)) {
|
|
93
|
+
const desc = Object.getOwnPropertyDescriptor(target, key);
|
|
94
|
+
if (desc === void 0) return void 0;
|
|
95
|
+
return "value" in desc ? desc.value : readConsumerProp(target, key);
|
|
96
|
+
}
|
|
97
|
+
return readConsumerProp(target, key);
|
|
98
|
+
}
|
|
99
|
+
function safeOwnHas(target, key) {
|
|
100
|
+
try {
|
|
101
|
+
return Object.prototype.hasOwnProperty.call(target, key);
|
|
102
|
+
} catch {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function spreadConsumerRecord(src) {
|
|
107
|
+
try {
|
|
108
|
+
return { ...src };
|
|
109
|
+
} catch {
|
|
110
|
+
const out = {};
|
|
111
|
+
for (const key of Object.keys(src)) {
|
|
112
|
+
safeAssign(out, key, readConsumerProp(src, key));
|
|
113
|
+
}
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function copyConsumerArray(src) {
|
|
118
|
+
try {
|
|
119
|
+
return src.slice();
|
|
120
|
+
} catch {
|
|
121
|
+
const out = new Array(src.length);
|
|
122
|
+
for (let i = 0; i < src.length; i++) out[i] = readConsumerIndex(src, i);
|
|
123
|
+
return out;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { safeOwnRead as a, readConsumerProp as b, consumerKeys as c, safeOwnHas as d, consumerHas as e, spreadConsumerRecord as f, copyConsumerArray as g, callConsumerFn as h, isShadowedKey as i, consumerExtensible as j, consumerSymbolKeys as k, reportConsumerThrow as l, readConsumerIndex as r, safeAssign as s };
|