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