@animaapp/anima-sdk-react 0.2.2 → 0.2.4
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/.turbo/turbo-build.log +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +101 -101
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/useAnimaCodegen.ts +2 -3
package/dist/index.js
CHANGED
|
@@ -935,7 +935,7 @@ const rs = {
|
|
|
935
935
|
l.data
|
|
936
936
|
);
|
|
937
937
|
v.payload.status === "success" && (b.files = v.payload.files), r((m) => {
|
|
938
|
-
m.tasks.codeGeneration.progress = v.payload.progress;
|
|
938
|
+
m.tasks.codeGeneration.progress = v.payload.progress, m.tasks.codeGeneration.status = "running";
|
|
939
939
|
});
|
|
940
940
|
}), o.addEventListener("codegen_completed", () => {
|
|
941
941
|
r((l) => {
|
|
@@ -969,9 +969,7 @@ const rs = {
|
|
|
969
969
|
error: new Error("HTTP error: " + l.message)
|
|
970
970
|
});
|
|
971
971
|
}), o.addEventListener("done", (l) => {
|
|
972
|
-
const v = JSON.parse(
|
|
973
|
-
l.data
|
|
974
|
-
);
|
|
972
|
+
const v = JSON.parse(l.data);
|
|
975
973
|
b.tokenUsage = v.payload.tokenUsage, r((m) => {
|
|
976
974
|
m.status = "success", m.result = b;
|
|
977
975
|
}), g({ result: b, error: null });
|
|
@@ -1158,10 +1156,10 @@ function or(t, e) {
|
|
|
1158
1156
|
return t !== t && e !== e;
|
|
1159
1157
|
}
|
|
1160
1158
|
const Pe = /* @__PURE__ */ new WeakMap(), De = () => {
|
|
1161
|
-
},
|
|
1159
|
+
}, ee = (
|
|
1162
1160
|
/*#__NOINLINE__*/
|
|
1163
1161
|
De()
|
|
1164
|
-
), ur = Object, N = (t) => t ===
|
|
1162
|
+
), ur = Object, N = (t) => t === ee, be = (t) => typeof t == "function", Me = (t, e) => Ue(Ue({}, t), e), Zs = (t) => be(t.then), Mn = {}, rn = {}, Nr = "undefined", Jt = typeof window != Nr, cr = typeof document != Nr, Fa = Jt && "Deno" in window, Wa = () => Jt && typeof window.requestAnimationFrame != Nr, Ds = (t, e) => {
|
|
1165
1163
|
const n = Pe.get(t);
|
|
1166
1164
|
return [
|
|
1167
1165
|
// Getter
|
|
@@ -1300,25 +1298,25 @@ function Ms(...t) {
|
|
|
1300
1298
|
return D;
|
|
1301
1299
|
} else B && $ && c(B) && (i = !0, l({
|
|
1302
1300
|
data: ze,
|
|
1303
|
-
_c:
|
|
1301
|
+
_c: ee
|
|
1304
1302
|
}));
|
|
1305
1303
|
if (i && !B)
|
|
1306
1304
|
if (be(i)) {
|
|
1307
1305
|
const le = i(D, ze);
|
|
1308
1306
|
l({
|
|
1309
1307
|
data: le,
|
|
1310
|
-
error:
|
|
1311
|
-
_c:
|
|
1308
|
+
error: ee,
|
|
1309
|
+
_c: ee
|
|
1312
1310
|
});
|
|
1313
1311
|
} else
|
|
1314
1312
|
l({
|
|
1315
1313
|
data: D,
|
|
1316
|
-
error:
|
|
1317
|
-
_c:
|
|
1314
|
+
error: ee,
|
|
1315
|
+
_c: ee
|
|
1318
1316
|
});
|
|
1319
1317
|
if (m[g][1] = pr(), Promise.resolve(q()).then(() => {
|
|
1320
1318
|
l({
|
|
1321
|
-
_c:
|
|
1319
|
+
_c: ee
|
|
1322
1320
|
});
|
|
1323
1321
|
}), B) {
|
|
1324
1322
|
if (h) throw B;
|
|
@@ -1334,7 +1332,7 @@ const fs = (t, e) => {
|
|
|
1334
1332
|
t[n][0] && t[n][0](e);
|
|
1335
1333
|
}, Xa = (t, e) => {
|
|
1336
1334
|
if (!Pe.has(t)) {
|
|
1337
|
-
const n = Me(Ka, e), r = {}, s = Ms.bind(
|
|
1335
|
+
const n = Me(Ka, e), r = {}, s = Ms.bind(ee, t);
|
|
1338
1336
|
let a = De;
|
|
1339
1337
|
const i = {}, o = (h, p) => {
|
|
1340
1338
|
const k = i[h] || [];
|
|
@@ -1355,7 +1353,7 @@ const fs = (t, e) => {
|
|
|
1355
1353
|
u,
|
|
1356
1354
|
o
|
|
1357
1355
|
]), !Zt)) {
|
|
1358
|
-
const h = n.initFocus(setTimeout.bind(
|
|
1356
|
+
const h = n.initFocus(setTimeout.bind(ee, fs.bind(ee, r, Rs))), p = n.initReconnect(setTimeout.bind(ee, fs.bind(ee, r, js)));
|
|
1359
1357
|
a = () => {
|
|
1360
1358
|
h && h(), p && p(), Pe.delete(t);
|
|
1361
1359
|
};
|
|
@@ -1462,7 +1460,7 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1462
1460
|
}), zn = {
|
|
1463
1461
|
dedupe: !0
|
|
1464
1462
|
}, hi = (t, e, n) => {
|
|
1465
|
-
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, l, v] = Pe.get(r), [m, z] = Pr(t), R = qe(!1), q = qe(!1), D = qe(m), B = qe(e), j = qe(n), $ = () => j.current, Se = () => $().isVisible() && $().isOnline(), [M, rt, ze, le] = Ds(r, m), st = qe({}).current, Yt = N(i) ? N(n.fallback) ?
|
|
1463
|
+
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, l, v] = Pe.get(r), [m, z] = Pr(t), R = qe(!1), q = qe(!1), D = qe(m), B = qe(e), j = qe(n), $ = () => j.current, Se = () => $().isVisible() && $().isOnline(), [M, rt, ze, le] = Ds(r, m), st = qe({}).current, Yt = N(i) ? N(n.fallback) ? ee : n.fallback[m] : i, Dr = (I, Z) => {
|
|
1466
1464
|
for (const H in st) {
|
|
1467
1465
|
const W = H;
|
|
1468
1466
|
if (W === "data") {
|
|
@@ -1473,8 +1471,8 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1473
1471
|
}
|
|
1474
1472
|
return !0;
|
|
1475
1473
|
}, Mr = pa(() => {
|
|
1476
|
-
const I = !m || !e ? !1 : N(o) ? $().isPaused() || a ? !1 : u !== !1 : o, Z = (
|
|
1477
|
-
const Oe = Me(
|
|
1474
|
+
const I = !m || !e ? !1 : N(o) ? $().isPaused() || a ? !1 : u !== !1 : o, Z = (Y) => {
|
|
1475
|
+
const Oe = Me(Y);
|
|
1478
1476
|
return delete Oe._k, I ? Ue({
|
|
1479
1477
|
isValidating: !0,
|
|
1480
1478
|
isLoading: !0
|
|
@@ -1483,8 +1481,8 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1483
1481
|
let K = ye;
|
|
1484
1482
|
return [
|
|
1485
1483
|
() => {
|
|
1486
|
-
const
|
|
1487
|
-
return Dr(
|
|
1484
|
+
const Y = Z(M());
|
|
1485
|
+
return Dr(Y, K) ? (K.data = Y.data, K.isLoading = Y.isLoading, K.isValidating = Y.isValidating, K.error = Y.error, K) : (K = Y, Y);
|
|
1488
1486
|
},
|
|
1489
1487
|
() => ot
|
|
1490
1488
|
];
|
|
@@ -1506,7 +1504,7 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1506
1504
|
if (!m || !Z || q.current || $().isPaused())
|
|
1507
1505
|
return !1;
|
|
1508
1506
|
let H, W, ye = !0;
|
|
1509
|
-
const ot = I || {}, K = !l[m] || !ot.dedupe,
|
|
1507
|
+
const ot = I || {}, K = !l[m] || !ot.dedupe, Y = () => ds ? !q.current && m === D.current && R.current : m === D.current, Oe = {
|
|
1510
1508
|
isValidating: !1,
|
|
1511
1509
|
isLoading: !1
|
|
1512
1510
|
}, zr = () => {
|
|
@@ -1520,25 +1518,25 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1520
1518
|
N(M().data) && (Ur.isLoading = !0);
|
|
1521
1519
|
try {
|
|
1522
1520
|
if (K && (rt(Ur), n.loadingTimeout && N(M().data) && setTimeout(() => {
|
|
1523
|
-
ye &&
|
|
1521
|
+
ye && Y() && $().onLoadingSlow(m, n);
|
|
1524
1522
|
}, n.loadingTimeout), l[m] = [
|
|
1525
1523
|
Z(z),
|
|
1526
1524
|
pr()
|
|
1527
1525
|
]), [H, W] = l[m], H = yield H, K && setTimeout(Vr, n.dedupingInterval), !l[m] || l[m][1] !== W)
|
|
1528
|
-
return K &&
|
|
1529
|
-
Oe.error =
|
|
1526
|
+
return K && Y() && $().onDiscarded(m), !1;
|
|
1527
|
+
Oe.error = ee;
|
|
1530
1528
|
const ce = b[m];
|
|
1531
1529
|
if (!N(ce) && // case 1
|
|
1532
1530
|
(W <= ce[0] || // case 2
|
|
1533
1531
|
W <= ce[1] || // case 3
|
|
1534
1532
|
ce[1] === 0))
|
|
1535
|
-
return zr(), K &&
|
|
1533
|
+
return zr(), K && Y() && $().onDiscarded(m), !1;
|
|
1536
1534
|
const Te = M().data;
|
|
1537
|
-
Oe.data = s(Te, H) ? Te : H, K &&
|
|
1535
|
+
Oe.data = s(Te, H) ? Te : H, K && Y() && $().onSuccess(H, m, n);
|
|
1538
1536
|
} catch (ce) {
|
|
1539
1537
|
Vr();
|
|
1540
1538
|
const Te = $(), { shouldRetryOnError: Nn } = Te;
|
|
1541
|
-
Te.isPaused() || (Oe.error = ce, K &&
|
|
1539
|
+
Te.isPaused() || (Oe.error = ce, K && Y() && (Te.onError(ce, m, Te), (Nn === !0 || be(Nn) && Nn(ce)) && (!$().revalidateOnFocus || !$().revalidateOnReconnect || Se()) && Te.onErrorRetry(ce, m, Te, (ra) => {
|
|
1542
1540
|
const Pn = g[m];
|
|
1543
1541
|
Pn && Pn[0] && Pn[0](us, ra);
|
|
1544
1542
|
}, {
|
|
@@ -1573,7 +1571,7 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1573
1571
|
B.current = e, j.current = n, N(it) || (Cn.current = it);
|
|
1574
1572
|
}), Ln(() => {
|
|
1575
1573
|
if (!m) return;
|
|
1576
|
-
const I = wt.bind(
|
|
1574
|
+
const I = wt.bind(ee, zn);
|
|
1577
1575
|
let Z = 0;
|
|
1578
1576
|
const W = fi(m, g, (ye, ot = {}) => {
|
|
1579
1577
|
if (ye == Rs) {
|
|
@@ -1924,7 +1922,7 @@ function y(t, e) {
|
|
|
1924
1922
|
});
|
|
1925
1923
|
t.common.issues.push(r);
|
|
1926
1924
|
}
|
|
1927
|
-
class
|
|
1925
|
+
class X {
|
|
1928
1926
|
constructor() {
|
|
1929
1927
|
this.value = "valid";
|
|
1930
1928
|
}
|
|
@@ -1953,7 +1951,7 @@ class J {
|
|
|
1953
1951
|
value: i
|
|
1954
1952
|
});
|
|
1955
1953
|
}
|
|
1956
|
-
return
|
|
1954
|
+
return X.mergeObjectSync(e, r);
|
|
1957
1955
|
});
|
|
1958
1956
|
}
|
|
1959
1957
|
static mergeObjectSync(e, n) {
|
|
@@ -1969,7 +1967,7 @@ class J {
|
|
|
1969
1967
|
}
|
|
1970
1968
|
const S = Object.freeze({
|
|
1971
1969
|
status: "aborted"
|
|
1972
|
-
}), _n = (t) => ({ status: "dirty", value: t }),
|
|
1970
|
+
}), _n = (t) => ({ status: "dirty", value: t }), te = (t) => ({ status: "valid", value: t }), yr = (t) => t.status === "aborted", gr = (t) => t.status === "dirty", et = (t) => t.status === "valid", Dt = (t) => typeof Promise != "undefined" && t instanceof Promise;
|
|
1973
1971
|
function vn(t, e, n, r) {
|
|
1974
1972
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1975
1973
|
return e.get(t);
|
|
@@ -2037,7 +2035,7 @@ class T {
|
|
|
2037
2035
|
}
|
|
2038
2036
|
_processInputParams(e) {
|
|
2039
2037
|
return {
|
|
2040
|
-
status: new
|
|
2038
|
+
status: new X(),
|
|
2041
2039
|
ctx: {
|
|
2042
2040
|
common: e.parent.common,
|
|
2043
2041
|
data: e.data,
|
|
@@ -2277,7 +2275,7 @@ class he extends T {
|
|
|
2277
2275
|
received: s.parsedType
|
|
2278
2276
|
}), S;
|
|
2279
2277
|
}
|
|
2280
|
-
const n = new
|
|
2278
|
+
const n = new X();
|
|
2281
2279
|
let r;
|
|
2282
2280
|
for (const s of this._def.checks)
|
|
2283
2281
|
if (s.kind === "min")
|
|
@@ -2656,7 +2654,7 @@ class Le extends T {
|
|
|
2656
2654
|
}), S;
|
|
2657
2655
|
}
|
|
2658
2656
|
let n;
|
|
2659
|
-
const r = new
|
|
2657
|
+
const r = new X();
|
|
2660
2658
|
for (const s of this._def.checks)
|
|
2661
2659
|
s.kind === "int" ? C.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2662
2660
|
code: f.invalid_type,
|
|
@@ -2825,7 +2823,7 @@ class $e extends T {
|
|
|
2825
2823
|
if (this._getType(e) !== _.bigint)
|
|
2826
2824
|
return this._getInvalidInput(e);
|
|
2827
2825
|
let n;
|
|
2828
|
-
const r = new
|
|
2826
|
+
const r = new X();
|
|
2829
2827
|
for (const s of this._def.checks)
|
|
2830
2828
|
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2831
2829
|
code: f.too_small,
|
|
@@ -2954,7 +2952,7 @@ class Mt extends T {
|
|
|
2954
2952
|
received: n.parsedType
|
|
2955
2953
|
}), S;
|
|
2956
2954
|
}
|
|
2957
|
-
return
|
|
2955
|
+
return te(e.data);
|
|
2958
2956
|
}
|
|
2959
2957
|
}
|
|
2960
2958
|
Mt.create = (t) => new Mt(d({
|
|
@@ -2977,7 +2975,7 @@ class tt extends T {
|
|
|
2977
2975
|
code: f.invalid_date
|
|
2978
2976
|
}), S;
|
|
2979
2977
|
}
|
|
2980
|
-
const n = new
|
|
2978
|
+
const n = new X();
|
|
2981
2979
|
let r;
|
|
2982
2980
|
for (const s of this._def.checks)
|
|
2983
2981
|
s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), y(r, {
|
|
@@ -3047,7 +3045,7 @@ class bn extends T {
|
|
|
3047
3045
|
received: n.parsedType
|
|
3048
3046
|
}), S;
|
|
3049
3047
|
}
|
|
3050
|
-
return
|
|
3048
|
+
return te(e.data);
|
|
3051
3049
|
}
|
|
3052
3050
|
}
|
|
3053
3051
|
bn.create = (t) => new bn(d({
|
|
@@ -3063,7 +3061,7 @@ class Lt extends T {
|
|
|
3063
3061
|
received: n.parsedType
|
|
3064
3062
|
}), S;
|
|
3065
3063
|
}
|
|
3066
|
-
return
|
|
3064
|
+
return te(e.data);
|
|
3067
3065
|
}
|
|
3068
3066
|
}
|
|
3069
3067
|
Lt.create = (t) => new Lt(d({
|
|
@@ -3079,7 +3077,7 @@ class $t extends T {
|
|
|
3079
3077
|
received: n.parsedType
|
|
3080
3078
|
}), S;
|
|
3081
3079
|
}
|
|
3082
|
-
return
|
|
3080
|
+
return te(e.data);
|
|
3083
3081
|
}
|
|
3084
3082
|
}
|
|
3085
3083
|
$t.create = (t) => new $t(d({
|
|
@@ -3090,7 +3088,7 @@ class _t extends T {
|
|
|
3090
3088
|
super(...arguments), this._any = !0;
|
|
3091
3089
|
}
|
|
3092
3090
|
_parse(e) {
|
|
3093
|
-
return
|
|
3091
|
+
return te(e.data);
|
|
3094
3092
|
}
|
|
3095
3093
|
}
|
|
3096
3094
|
_t.create = (t) => new _t(d({
|
|
@@ -3101,7 +3099,7 @@ class Xe extends T {
|
|
|
3101
3099
|
super(...arguments), this._unknown = !0;
|
|
3102
3100
|
}
|
|
3103
3101
|
_parse(e) {
|
|
3104
|
-
return
|
|
3102
|
+
return te(e.data);
|
|
3105
3103
|
}
|
|
3106
3104
|
}
|
|
3107
3105
|
Xe.create = (t) => new Xe(d({
|
|
@@ -3130,7 +3128,7 @@ class wn extends T {
|
|
|
3130
3128
|
received: n.parsedType
|
|
3131
3129
|
}), S;
|
|
3132
3130
|
}
|
|
3133
|
-
return
|
|
3131
|
+
return te(e.data);
|
|
3134
3132
|
}
|
|
3135
3133
|
}
|
|
3136
3134
|
wn.create = (t) => new wn(d({
|
|
@@ -3172,9 +3170,9 @@ class pe extends T {
|
|
|
3172
3170
|
exact: !1,
|
|
3173
3171
|
message: s.maxLength.message
|
|
3174
3172
|
}), r.dirty()), n.common.async)
|
|
3175
|
-
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new Ee(n, i, n.path, o)))).then((i) =>
|
|
3173
|
+
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new Ee(n, i, n.path, o)))).then((i) => X.mergeArray(r, i));
|
|
3176
3174
|
const a = [...n.data].map((i, o) => s.type._parseSync(new Ee(n, i, n.path, o)));
|
|
3177
|
-
return
|
|
3175
|
+
return X.mergeArray(r, a);
|
|
3178
3176
|
}
|
|
3179
3177
|
get element() {
|
|
3180
3178
|
return this._def.type;
|
|
@@ -3290,7 +3288,7 @@ class F extends T {
|
|
|
3290
3288
|
});
|
|
3291
3289
|
}
|
|
3292
3290
|
return u;
|
|
3293
|
-
})).then((u) =>
|
|
3291
|
+
})).then((u) => X.mergeObjectSync(n, u)) : X.mergeObjectSync(n, o);
|
|
3294
3292
|
}
|
|
3295
3293
|
get shape() {
|
|
3296
3294
|
return this._def.shape();
|
|
@@ -3708,7 +3706,7 @@ class xe extends T {
|
|
|
3708
3706
|
const o = this._def.items[i] || this._def.rest;
|
|
3709
3707
|
return o ? o._parse(new Ee(r, a, r.path, i)) : null;
|
|
3710
3708
|
}).filter((a) => !!a);
|
|
3711
|
-
return r.common.async ? Promise.all(s).then((a) =>
|
|
3709
|
+
return r.common.async ? Promise.all(s).then((a) => X.mergeArray(n, a)) : X.mergeArray(n, s);
|
|
3712
3710
|
}
|
|
3713
3711
|
get items() {
|
|
3714
3712
|
return this._def.items;
|
|
@@ -3750,7 +3748,7 @@ class zt extends T {
|
|
|
3750
3748
|
value: i._parse(new Ee(r, r.data[o], r.path, o)),
|
|
3751
3749
|
alwaysSet: o in r.data
|
|
3752
3750
|
});
|
|
3753
|
-
return r.common.async ?
|
|
3751
|
+
return r.common.async ? X.mergeObjectAsync(n, s) : X.mergeObjectSync(n, s);
|
|
3754
3752
|
}
|
|
3755
3753
|
get element() {
|
|
3756
3754
|
return this._def.valueType;
|
|
@@ -3922,7 +3920,7 @@ class pt extends T {
|
|
|
3922
3920
|
const a = { errorMap: n.common.contextualErrorMap }, i = n.data;
|
|
3923
3921
|
if (this._def.returns instanceof vt) {
|
|
3924
3922
|
const o = this;
|
|
3925
|
-
return
|
|
3923
|
+
return te(function(...u) {
|
|
3926
3924
|
return ke(this, null, function* () {
|
|
3927
3925
|
const c = new ie([]), h = yield o._def.args.parseAsync(u, a).catch((k) => {
|
|
3928
3926
|
throw c.addIssue(r(u, k)), c;
|
|
@@ -3934,7 +3932,7 @@ class pt extends T {
|
|
|
3934
3932
|
});
|
|
3935
3933
|
} else {
|
|
3936
3934
|
const o = this;
|
|
3937
|
-
return
|
|
3935
|
+
return te(function(...u) {
|
|
3938
3936
|
const c = o._def.args.safeParse(u, a);
|
|
3939
3937
|
if (!c.success)
|
|
3940
3938
|
throw new ie([r(u, c.error)]);
|
|
@@ -4035,7 +4033,7 @@ class Fe extends T {
|
|
|
4035
4033
|
options: r
|
|
4036
4034
|
}), S;
|
|
4037
4035
|
}
|
|
4038
|
-
return
|
|
4036
|
+
return te(e.data);
|
|
4039
4037
|
}
|
|
4040
4038
|
get options() {
|
|
4041
4039
|
return this._def.values;
|
|
@@ -4089,7 +4087,7 @@ class Bt extends T {
|
|
|
4089
4087
|
options: s
|
|
4090
4088
|
}), S;
|
|
4091
4089
|
}
|
|
4092
|
-
return
|
|
4090
|
+
return te(e.data);
|
|
4093
4091
|
}
|
|
4094
4092
|
get enum() {
|
|
4095
4093
|
return this._def.values;
|
|
@@ -4113,7 +4111,7 @@ class vt extends T {
|
|
|
4113
4111
|
received: n.parsedType
|
|
4114
4112
|
}), S;
|
|
4115
4113
|
const r = n.parsedType === _.promise ? n.data : Promise.resolve(n.data);
|
|
4116
|
-
return
|
|
4114
|
+
return te(r.then((s) => this._def.type.parseAsync(s, {
|
|
4117
4115
|
path: n.path,
|
|
4118
4116
|
errorMap: n.common.contextualErrorMap
|
|
4119
4117
|
})));
|
|
@@ -4212,7 +4210,7 @@ me.createWithPreprocess = (t, e, n) => new me(d({
|
|
|
4212
4210
|
}, O(n)));
|
|
4213
4211
|
class we extends T {
|
|
4214
4212
|
_parse(e) {
|
|
4215
|
-
return this._getType(e) === _.undefined ?
|
|
4213
|
+
return this._getType(e) === _.undefined ? te(void 0) : this._def.innerType._parse(e);
|
|
4216
4214
|
}
|
|
4217
4215
|
unwrap() {
|
|
4218
4216
|
return this._def.innerType;
|
|
@@ -4224,7 +4222,7 @@ we.create = (t, e) => new we(d({
|
|
|
4224
4222
|
}, O(e)));
|
|
4225
4223
|
class We extends T {
|
|
4226
4224
|
_parse(e) {
|
|
4227
|
-
return this._getType(e) === _.null ?
|
|
4225
|
+
return this._getType(e) === _.null ? te(null) : this._def.innerType._parse(e);
|
|
4228
4226
|
}
|
|
4229
4227
|
unwrap() {
|
|
4230
4228
|
return this._def.innerType;
|
|
@@ -4401,7 +4399,7 @@ const qi = (t, e = {
|
|
|
4401
4399
|
bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
|
|
4402
4400
|
date: (t) => tt.create(x(d({}, t), { coerce: !0 }))
|
|
4403
4401
|
}, Ao = S;
|
|
4404
|
-
var
|
|
4402
|
+
var G = /* @__PURE__ */ Object.freeze({
|
|
4405
4403
|
__proto__: null,
|
|
4406
4404
|
defaultErrorMap: gt,
|
|
4407
4405
|
setErrorMap: wi,
|
|
@@ -4409,10 +4407,10 @@ var te = /* @__PURE__ */ Object.freeze({
|
|
|
4409
4407
|
makeIssue: gn,
|
|
4410
4408
|
EMPTY_PATH: ki,
|
|
4411
4409
|
addIssueToContext: y,
|
|
4412
|
-
ParseStatus:
|
|
4410
|
+
ParseStatus: X,
|
|
4413
4411
|
INVALID: S,
|
|
4414
4412
|
DIRTY: _n,
|
|
4415
|
-
OK:
|
|
4413
|
+
OK: te,
|
|
4416
4414
|
isAborted: yr,
|
|
4417
4415
|
isDirty: gr,
|
|
4418
4416
|
isValid: et,
|
|
@@ -4517,14 +4515,14 @@ var te = /* @__PURE__ */ Object.freeze({
|
|
|
4517
4515
|
quotelessJson: bi,
|
|
4518
4516
|
ZodError: ie
|
|
4519
4517
|
});
|
|
4520
|
-
|
|
4521
|
-
language:
|
|
4518
|
+
G.object({
|
|
4519
|
+
language: G.enum(["typescript", "javascript"]).optional()
|
|
4522
4520
|
}).and(
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
framework:
|
|
4526
|
-
model:
|
|
4527
|
-
styling:
|
|
4521
|
+
G.union([
|
|
4522
|
+
G.object({
|
|
4523
|
+
framework: G.literal("react"),
|
|
4524
|
+
model: G.string().optional(),
|
|
4525
|
+
styling: G.enum([
|
|
4528
4526
|
"plain_css",
|
|
4529
4527
|
"css_modules",
|
|
4530
4528
|
"styled_components",
|
|
@@ -4533,14 +4531,16 @@ te.object({
|
|
|
4533
4531
|
"scss",
|
|
4534
4532
|
"inline_styles"
|
|
4535
4533
|
]),
|
|
4536
|
-
uiLibrary:
|
|
4537
|
-
enableUILibraryTheming:
|
|
4538
|
-
enableCompactStructure:
|
|
4534
|
+
uiLibrary: G.enum(["mui", "antd", "radix", "shadcn"]).optional(),
|
|
4535
|
+
enableUILibraryTheming: G.boolean().optional(),
|
|
4536
|
+
enableCompactStructure: G.boolean().optional(),
|
|
4537
|
+
enableAutoSplit: G.boolean().optional(),
|
|
4538
|
+
autoSplitThreshold: G.number().optional()
|
|
4539
4539
|
}),
|
|
4540
|
-
|
|
4541
|
-
framework:
|
|
4542
|
-
styling:
|
|
4543
|
-
enableTranslation:
|
|
4540
|
+
G.object({
|
|
4541
|
+
framework: G.literal("html"),
|
|
4542
|
+
styling: G.enum(["plain_css", "inline_styles"]),
|
|
4543
|
+
enableTranslation: G.boolean().optional()
|
|
4544
4544
|
})
|
|
4545
4545
|
])
|
|
4546
4546
|
);
|
|
@@ -4553,7 +4553,7 @@ var Co = Object.defineProperty, No = Object.defineProperties, Po = Object.getOwn
|
|
|
4553
4553
|
for (var n of gs(e))
|
|
4554
4554
|
jo.call(e, n) && vs(t, n, e[n]);
|
|
4555
4555
|
return t;
|
|
4556
|
-
}, jr = (t, e) => No(t, Po(e)), Ir = (t, e, n) => e.has(t) || Js("Cannot " + n), P = (t, e, n) => (Ir(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Js("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n),
|
|
4556
|
+
}, jr = (t, e) => No(t, Po(e)), Ir = (t, e, n) => e.has(t) || Js("Cannot " + n), P = (t, e, n) => (Ir(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Js("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), J = (t, e, n, r) => (Ir(t, e, "write to private field"), e.set(t, n), n), ve = (t, e, n) => (Ir(t, e, "access private method"), n), V = (t, e, n) => new Promise((r, s) => {
|
|
4557
4557
|
var a = (u) => {
|
|
4558
4558
|
try {
|
|
4559
4559
|
o(n.next(u));
|
|
@@ -4745,7 +4745,7 @@ function nu(t) {
|
|
|
4745
4745
|
function Ae(t, e) {
|
|
4746
4746
|
return Un[e].from ? Un[e].from(t) : new Un[e](t);
|
|
4747
4747
|
}
|
|
4748
|
-
function
|
|
4748
|
+
function Q(t) {
|
|
4749
4749
|
return t;
|
|
4750
4750
|
}
|
|
4751
4751
|
function ks() {
|
|
@@ -4782,23 +4782,23 @@ const iu = /* @__PURE__ */ new Map([
|
|
|
4782
4782
|
["Uint8Array", Ae],
|
|
4783
4783
|
["Uint8ClampedArray", Ae],
|
|
4784
4784
|
// shallow copy
|
|
4785
|
-
["Array Iterator",
|
|
4786
|
-
["Map Iterator",
|
|
4787
|
-
["Promise",
|
|
4788
|
-
["Set Iterator",
|
|
4789
|
-
["String Iterator",
|
|
4790
|
-
["function",
|
|
4791
|
-
["global",
|
|
4785
|
+
["Array Iterator", Q],
|
|
4786
|
+
["Map Iterator", Q],
|
|
4787
|
+
["Promise", Q],
|
|
4788
|
+
["Set Iterator", Q],
|
|
4789
|
+
["String Iterator", Q],
|
|
4790
|
+
["function", Q],
|
|
4791
|
+
["global", Q],
|
|
4792
4792
|
// NOTE: WeakMap and WeakSet cannot get entries
|
|
4793
|
-
["WeakMap",
|
|
4794
|
-
["WeakSet",
|
|
4793
|
+
["WeakMap", Q],
|
|
4794
|
+
["WeakSet", Q],
|
|
4795
4795
|
// primitives
|
|
4796
|
-
["boolean",
|
|
4797
|
-
["null",
|
|
4798
|
-
["number",
|
|
4799
|
-
["string",
|
|
4800
|
-
["symbol",
|
|
4801
|
-
["undefined",
|
|
4796
|
+
["boolean", Q],
|
|
4797
|
+
["null", Q],
|
|
4798
|
+
["number", Q],
|
|
4799
|
+
["string", Q],
|
|
4800
|
+
["symbol", Q],
|
|
4801
|
+
["undefined", Q],
|
|
4802
4802
|
// collections
|
|
4803
4803
|
// NOTE: return empty value, because recursively copy later.
|
|
4804
4804
|
["Arguments", ks],
|
|
@@ -4887,14 +4887,14 @@ const uu = (t) => new Promise((e) => setTimeout(e, t));
|
|
|
4887
4887
|
var cn, Ge, dn, Er, Xs;
|
|
4888
4888
|
class cu {
|
|
4889
4889
|
constructor({ maxAttempts: e = 3, func: n }) {
|
|
4890
|
-
de(this, Er), de(this, cn), de(this, Ge), de(this, dn),
|
|
4890
|
+
de(this, Er), de(this, cn), de(this, Ge), de(this, dn), J(this, cn, e), J(this, dn, n), J(this, Ge, 0);
|
|
4891
4891
|
}
|
|
4892
4892
|
run() {
|
|
4893
4893
|
return V(this, null, function* () {
|
|
4894
4894
|
try {
|
|
4895
4895
|
return yield P(this, dn).call(this);
|
|
4896
4896
|
} catch (e) {
|
|
4897
|
-
if (
|
|
4897
|
+
if (J(this, Ge, P(this, Ge) + 1), P(this, Ge) > P(this, cn))
|
|
4898
4898
|
throw console.error("Max attempts reached"), e;
|
|
4899
4899
|
const n = ve(this, Er, Xs).call(this);
|
|
4900
4900
|
return yield uu(n), yield this.run();
|
|
@@ -4997,7 +4997,7 @@ const mu = 5 * 60 * 1e3, yu = 1 * 1e3;
|
|
|
4997
4997
|
var Je, ne, ge, Sr, Or, At;
|
|
4998
4998
|
class gu {
|
|
4999
4999
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
|
|
5000
|
-
de(this, ge), de(this, Je), de(this, ne), this.baseAddress = n,
|
|
5000
|
+
de(this, ge), de(this, Je), de(this, ne), this.baseAddress = n, J(this, Je, e), J(this, ne, {}), this.plugins = [];
|
|
5001
5001
|
}
|
|
5002
5002
|
get headers() {
|
|
5003
5003
|
throw new Error("Missing implementation");
|
|
@@ -5009,38 +5009,38 @@ class gu {
|
|
|
5009
5009
|
this.plugins = this.plugins.filter((n) => n.name !== e);
|
|
5010
5010
|
}
|
|
5011
5011
|
withOptions(e = {}) {
|
|
5012
|
-
return
|
|
5012
|
+
return J(this, ne, e), this;
|
|
5013
5013
|
}
|
|
5014
5014
|
get(e) {
|
|
5015
5015
|
return V(this, arguments, function* (n, r = {}) {
|
|
5016
5016
|
const { overrideBaseAddress: s, overrideDefaultHeaders: a } = r, i = s != null ? s : this.baseAddress;
|
|
5017
5017
|
let o = a != null ? a : this.headers;
|
|
5018
5018
|
const u = kt(P(this, ne));
|
|
5019
|
-
return
|
|
5019
|
+
return J(this, ne, {}), u.extraHeaders && (o = ae(ae({}, o), u.extraHeaders)), u.requestValidation && (o = jr(ae({}, o), { "X-Request-Nonce": Ys(), "X-Request-Timestamp": xr() })), u.async ? yield ve(this, ge, Or).call(this, `${i}${n}`, u.async, { headers: o }) : yield ve(this, ge, Sr).call(this, `${i}${n}`, u, { headers: o });
|
|
5020
5020
|
});
|
|
5021
5021
|
}
|
|
5022
5022
|
post(e, n) {
|
|
5023
5023
|
return V(this, arguments, function* (r, s, a = {}) {
|
|
5024
5024
|
const i = kt(P(this, ne));
|
|
5025
|
-
return
|
|
5025
|
+
return J(this, ne, {}), ve(this, ge, At).call(this, r, "POST", s, a, i);
|
|
5026
5026
|
});
|
|
5027
5027
|
}
|
|
5028
5028
|
put(e, n) {
|
|
5029
5029
|
return V(this, arguments, function* (r, s, a = {}) {
|
|
5030
5030
|
const i = kt(P(this, ne));
|
|
5031
|
-
return
|
|
5031
|
+
return J(this, ne, {}), ve(this, ge, At).call(this, r, "PUT", s, a, i);
|
|
5032
5032
|
});
|
|
5033
5033
|
}
|
|
5034
5034
|
delete(e, n) {
|
|
5035
5035
|
return V(this, arguments, function* (r, s, a = {}) {
|
|
5036
5036
|
const i = kt(P(this, ne));
|
|
5037
|
-
return
|
|
5037
|
+
return J(this, ne, {}), ve(this, ge, At).call(this, r, "DELETE", s, a, i);
|
|
5038
5038
|
});
|
|
5039
5039
|
}
|
|
5040
5040
|
patch(e, n) {
|
|
5041
5041
|
return V(this, arguments, function* (r, s, a = {}) {
|
|
5042
5042
|
const i = kt(P(this, ne));
|
|
5043
|
-
return
|
|
5043
|
+
return J(this, ne, {}), ve(this, ge, At).call(this, r, "PATCH", s, a, i);
|
|
5044
5044
|
});
|
|
5045
5045
|
}
|
|
5046
5046
|
}
|
|
@@ -5196,7 +5196,7 @@ const xs = (t, e, n, r) => t instanceof Tt ? t : new hu({ resource: e, api: Stri
|
|
|
5196
5196
|
var Ct;
|
|
5197
5197
|
class _u {
|
|
5198
5198
|
constructor(e) {
|
|
5199
|
-
de(this, Ct), this.resourceName = "Files",
|
|
5199
|
+
de(this, Ct), this.resourceName = "Files", J(this, Ct, e);
|
|
5200
5200
|
}
|
|
5201
5201
|
get(e) {
|
|
5202
5202
|
return V(this, arguments, function* ({ fileKey: n, params: r = {} }) {
|
|
@@ -5222,7 +5222,7 @@ const vu = (t, e, n) => {
|
|
|
5222
5222
|
var _e, Tr, Qs;
|
|
5223
5223
|
class wu {
|
|
5224
5224
|
constructor(e) {
|
|
5225
|
-
de(this, Tr), de(this, _e), this.resourceName = "Images",
|
|
5225
|
+
de(this, Tr), de(this, _e), this.resourceName = "Images", J(this, _e, e);
|
|
5226
5226
|
}
|
|
5227
5227
|
/**
|
|
5228
5228
|
* Return the URL for the _layer_ images for the given nodes.
|
|
@@ -5261,7 +5261,7 @@ _e = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakSet(), Qs = fun
|
|
|
5261
5261
|
var ln;
|
|
5262
5262
|
class ku {
|
|
5263
5263
|
constructor(e) {
|
|
5264
|
-
de(this, ln), this.resourceName = "Nodes",
|
|
5264
|
+
de(this, ln), this.resourceName = "Nodes", J(this, ln, e);
|
|
5265
5265
|
}
|
|
5266
5266
|
get(e) {
|
|
5267
5267
|
return V(this, arguments, function* ({ fileKey: n, nodeIds: r, params: s = {} }) {
|
|
@@ -5291,7 +5291,7 @@ class Eu extends gu {
|
|
|
5291
5291
|
set token(e) {
|
|
5292
5292
|
if (!e.startsWith("figd_") && !e.startsWith("figu_"))
|
|
5293
5293
|
throw new Error("Invalid Figma access token");
|
|
5294
|
-
|
|
5294
|
+
J(this, Ie, e);
|
|
5295
5295
|
}
|
|
5296
5296
|
get token() {
|
|
5297
5297
|
return P(this, Ie);
|