@abyss-project/commons-front-core 9.5.1 → 10.0.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/README.md +20 -1
- package/dist/{AbyssCookieConsentProvider-jMv5bvVK.js → AbyssCookieConsentProvider-BypueFP-.js} +804 -684
- package/dist/{CookieConsentSettings.component-B6i65LtJ.js → CookieConsentSettings.component-CYmew9vg.js} +1 -1
- package/dist/auth/client/web-bridge.d.ts +6 -0
- package/dist/auth/components/AuthFlow/AuthFlow.component.d.ts +9 -2
- package/dist/auth/components/AuthFlow/auth-flow.types.d.ts +5 -0
- package/dist/auth/components/AuthFlow/steps/EmailStep.component.d.ts +4 -1
- package/dist/auth/components/index.d.ts +1 -0
- package/dist/auth/components/shared/auth-errors.d.ts +1 -0
- package/dist/auth/components/shared/auth-errors.spec.d.ts +1 -0
- package/dist/auth-client.js +1 -1
- package/dist/components/data/InvoiceDetailView/InvoiceDetailView.d.ts +37 -0
- package/dist/components/data/InvoiceDetailView/InvoiceDetailView.spec.d.ts +1 -0
- package/dist/components/data/InvoiceDetailView/InvoiceStatusBadge.d.ts +15 -0
- package/dist/components/data/InvoiceDetailView/invoice-display.d.ts +11 -0
- package/dist/components/data/InvoiceDetailView/invoice-line-label.d.ts +13 -0
- package/dist/components/data/InvoiceDetailView/invoice-line-label.spec.d.ts +1 -0
- package/dist/components/data/index.d.ts +3 -0
- package/dist/components/inputs/DropZone/DropZone.d.ts +6 -1
- package/dist/components/layers/ProductTour/product-tour-geometry.d.ts +2 -0
- package/dist/components/structure/AccountMenu/AccountMenu.d.ts +2 -1
- package/dist/components/structure/AppShell/app-shell.types.d.ts +5 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-CykIb-Gz.js → design-theme-uRG0VfEo.js} +2020 -2018
- package/dist/hooks/theme-transition/bubble-field.d.ts +35 -0
- package/dist/hooks/theme-transition/bubble-field.spec.d.ts +1 -0
- package/dist/hooks/theme-transition/bubble-overlay.d.ts +19 -0
- package/dist/hooks/use-rich-intl.hook.d.ts +192 -0
- package/dist/hooks/use-theme-transition.hook.d.ts +7 -4
- package/dist/hooks/use-theme-transition.hook.spec.d.ts +1 -0
- package/dist/{index-B9kzX70T.js → index-1XaO6yqN.js} +2 -2
- package/dist/{index-Cy8fNdNL.js → index-B-gziyiQ.js} +2 -2
- package/dist/{index-BS7CgEyj.js → index-B-o5nMSp.js} +2 -2
- package/dist/{index-BEQgBOwt.js → index-B2hC6MII.js} +2 -2
- package/dist/{index-CLxMgDwa.js → index-BGFuwS_Q.js} +2 -2
- package/dist/{index-Cqn_LfL2.js → index-BWlJEtPU.js} +2 -2
- package/dist/{index-IhTCIvj6.js → index-BXr7rmpX.js} +3 -3
- package/dist/{index-BOm9JgH7.js → index-BlOn2KR_.js} +2 -2
- package/dist/{index-mNiLojvx.js → index-BqwZB633.js} +4 -4
- package/dist/{index-BveBtqZP.js → index-Bzvs4paS.js} +4 -4
- package/dist/{index-BPGHypMd.js → index-C7vs9FFj.js} +2 -2
- package/dist/{index-7S_OHK4f.js → index-Cn4VznqA.js} +3 -3
- package/dist/{index-Bgrp5kC3.js → index-CxRoV826.js} +2 -2
- package/dist/{index-rfJiqJxI.js → index-D6SwHpGJ.js} +3 -3
- package/dist/{index-f_oWcs8w.js → index-DMm4DUwE.js} +4 -4
- package/dist/{index-DXYvHlFM.js → index-DSxaBHTZ.js} +2 -2
- package/dist/{index-Lub7dhvT.js → index-DXsaB2jy.js} +6496 -6481
- package/dist/{index-Bd0oB0x3.js → index-D_FaSb6y.js} +2 -2
- package/dist/{index-DebUlRoE.js → index-QOUuevuY.js} +2 -2
- package/dist/{index-B4xjMC7O.js → index-cCCQwSgM.js} +2 -2
- package/dist/{index-_nt9c97v.js → index-eDLp-yzn.js} +3 -3
- package/dist/{index-CKD84DUx.js → index-oTUDJjQw.js} +1 -1
- package/dist/index.js +7184 -6590
- package/dist/legacy/components/Layouts/AbyssThemeToggle/AbyssThemeToggle.component.d.ts +2 -1
- package/dist/legacy/components/Layouts/AbyssThemeToggle/AbyssThemeToggle.component.spec.d.ts +1 -0
- package/dist/legacy.js +19 -19
- package/dist/rum/AbyssRumProvider.d.ts +5 -2
- package/dist/rum/abyss-rum-report.context.d.ts +14 -0
- package/dist/rum/index.d.ts +1 -0
- package/dist/rum/report-locale.d.ts +3 -0
- package/dist/rum/report-locale.spec.d.ts +1 -0
- package/dist/rum/track-key-action.d.ts +7 -0
- package/dist/rum/track-key-action.spec.d.ts +1 -0
- package/dist/theme/components/shared.d.ts +6 -0
- package/dist/translations/en.d.ts +60 -0
- package/dist/translations/fr.d.ts +60 -0
- package/dist/{use-auth.hook-oRxzI95f.js → use-auth.hook-D8vfSYRv.js} +101 -101
- package/package.json +10 -10
- package/test-results/catalog/.last-run.json +0 -4
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as
|
|
3
|
-
import { browserSupportsWebAuthn as I, startRegistration as
|
|
4
|
-
import { a as f, A as p, s as
|
|
5
|
-
import { createContext as
|
|
6
|
-
import { jsx as
|
|
7
|
-
const
|
|
1
|
+
import { isBrowserSessionPlatform as Q, AbyssCore as F, Code as x, AuthResultStatus as Z, MfaFactorType as q, SessionPlatform as ee } from "@abyss-project/main";
|
|
2
|
+
import { l as te } from "./lazy-value-Co76vxsM.js";
|
|
3
|
+
import { browserSupportsWebAuthn as I, startRegistration as se, browserSupportsWebAuthnAutofill as ne, startAuthentication as oe, WebAuthnError as re } from "@simplewebauthn/browser";
|
|
4
|
+
import { a as f, A as p, s as ae } from "./token-storage-CbWrBeIP.js";
|
|
5
|
+
import { createContext as ie, useState as ue, useEffect as le, useMemo as ce, useContext as de } from "react";
|
|
6
|
+
import { jsx as fe } from "react/jsx-runtime";
|
|
7
|
+
const k = "abyss-login-redirect", pe = 3e5, N = ({
|
|
8
8
|
abyssSite: e,
|
|
9
9
|
service: s,
|
|
10
10
|
redirectPath: n
|
|
11
11
|
}) => {
|
|
12
12
|
const o = e.replace(/\/+$/, ""), r = [`abyss_service=${encodeURIComponent(s)}`];
|
|
13
13
|
return n && r.push(`redirect_path=${encodeURIComponent(n)}`), `${o}/auth/login?${r.join("&")}`;
|
|
14
|
-
},
|
|
15
|
-
const e = window.sessionStorage.getItem(
|
|
14
|
+
}, qe = (e = window.location) => `${e.pathname}${e.search}`, $e = () => {
|
|
15
|
+
const e = window.sessionStorage.getItem(k);
|
|
16
16
|
if (e === null)
|
|
17
17
|
return !1;
|
|
18
18
|
const s = Number(e), n = Date.now() - s;
|
|
19
|
-
return Number.isFinite(s) && n >= 0 && n <
|
|
20
|
-
},
|
|
21
|
-
window.sessionStorage.removeItem(
|
|
22
|
-
},
|
|
19
|
+
return Number.isFinite(s) && n >= 0 && n < pe ? !0 : (window.sessionStorage.removeItem(k), !1);
|
|
20
|
+
}, Ye = () => {
|
|
21
|
+
window.sessionStorage.removeItem(k);
|
|
22
|
+
}, Be = (e) => {
|
|
23
23
|
window.location.assign(N(e));
|
|
24
|
-
},
|
|
25
|
-
window.sessionStorage.setItem(
|
|
24
|
+
}, He = (e) => {
|
|
25
|
+
window.sessionStorage.setItem(k, String(Date.now())), window.location.assign(N(e));
|
|
26
26
|
};
|
|
27
|
-
let
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
let j = !1;
|
|
28
|
+
const We = () => j, Ke = async (e, { abyssSite: s, service: n }) => {
|
|
29
|
+
j = !0;
|
|
30
30
|
try {
|
|
31
31
|
await e.logout();
|
|
32
32
|
} finally {
|
|
33
33
|
window.location.assign(N({ abyssSite: s, service: n }));
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
var
|
|
37
|
-
const
|
|
36
|
+
var he = /* @__PURE__ */ ((e) => (e.LOADING = "loading", e.ANONYMOUS = "anonymous", e.AUTHENTICATED = "authenticated", e))(he || {}), we = /* @__PURE__ */ ((e) => (e.PASSKEY = "passkey", e.TOTP = "totp", e.PASSWORD = "password", e.EMAIL_CODE = "email-code", e))(we || {});
|
|
37
|
+
const me = 6e4, $ = 3e4, Ee = [
|
|
38
38
|
500,
|
|
39
39
|
1e3,
|
|
40
40
|
2e3
|
|
41
|
-
],
|
|
41
|
+
], ye = [
|
|
42
42
|
7500,
|
|
43
43
|
15e3,
|
|
44
44
|
22500,
|
|
45
45
|
27e3
|
|
46
|
-
],
|
|
46
|
+
], Y = 3e4, Ae = 5e3, Re = "abyss-auth-refresh", Te = 2147483647, ge = "Token Expired", _e = (e) => typeof e == "object" && e !== null && e.isAxiosError === !0, B = (e) => {
|
|
47
47
|
var n;
|
|
48
|
-
if (!
|
|
48
|
+
if (!_e(e) || e.code === "ERR_CANCELED")
|
|
49
49
|
return { kind: "other" };
|
|
50
50
|
if (!e.response)
|
|
51
51
|
return { kind: "network" };
|
|
@@ -57,7 +57,7 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
57
57
|
message: s == null ? void 0 : s.message,
|
|
58
58
|
params: s == null ? void 0 : s.params
|
|
59
59
|
};
|
|
60
|
-
},
|
|
60
|
+
}, be = te(
|
|
61
61
|
() => /* @__PURE__ */ new Map([
|
|
62
62
|
[
|
|
63
63
|
q.TOTP,
|
|
@@ -74,12 +74,12 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
74
74
|
const s = e == null ? void 0 : e.methods;
|
|
75
75
|
return Array.isArray(s) ? {
|
|
76
76
|
methods: s.flatMap((n) => {
|
|
77
|
-
const o =
|
|
77
|
+
const o = be().get(n);
|
|
78
78
|
return o ? [o] : [];
|
|
79
79
|
})
|
|
80
80
|
} : {};
|
|
81
|
-
},
|
|
82
|
-
const s = e.bridge.platform
|
|
81
|
+
}, Se = (e) => new Promise((s) => setTimeout(s, e)), Le = () => typeof navigator > "u" || navigator.onLine !== !1, Ie = () => typeof navigator > "u" ? null : navigator.locks ?? null, je = (e) => {
|
|
82
|
+
const s = Q(e.bridge.platform), n = e.isOnline ?? Le;
|
|
83
83
|
let o = {
|
|
84
84
|
status: "loading"
|
|
85
85
|
/* LOADING */
|
|
@@ -88,42 +88,42 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
88
88
|
o = t, g.forEach((i) => i(o));
|
|
89
89
|
}, C = (t) => {
|
|
90
90
|
r = t, e.applyToken(t), _.forEach((i) => i(t));
|
|
91
|
-
},
|
|
91
|
+
}, b = () => {
|
|
92
92
|
w && (clearTimeout(w), w = null), m && (clearTimeout(m), m = null);
|
|
93
|
-
},
|
|
93
|
+
}, J = (t) => {
|
|
94
94
|
const i = Date.parse(t);
|
|
95
95
|
if (!Number.isFinite(i))
|
|
96
96
|
return;
|
|
97
97
|
const c = Math.min(
|
|
98
|
-
Math.max(i -
|
|
99
|
-
|
|
98
|
+
Math.max(i - me - Date.now(), 0),
|
|
99
|
+
Te
|
|
100
100
|
);
|
|
101
101
|
w = setTimeout(() => {
|
|
102
102
|
w = null, E.refresh();
|
|
103
103
|
}, c);
|
|
104
104
|
}, P = async (t) => {
|
|
105
105
|
var i;
|
|
106
|
-
|
|
106
|
+
b(), t.refreshToken && await e.storage.setRefreshToken(t.refreshToken), C(t.accessToken), a = t.user, (i = e.onPersistUser) == null || i.call(e, t.user), S({
|
|
107
107
|
status: "authenticated",
|
|
108
108
|
user: t.user,
|
|
109
109
|
mfaEnrollmentRequired: t.mfaEnrollmentRequired,
|
|
110
110
|
offline: !1
|
|
111
|
-
}),
|
|
111
|
+
}), J(t.accessTokenExpiresAt);
|
|
112
112
|
}, O = async () => {
|
|
113
113
|
var t;
|
|
114
|
-
T += 1,
|
|
114
|
+
T += 1, b(), d = null, await e.storage.setRefreshToken(null), C(null), a = null, (t = e.onPersistUser) == null || t.call(e, null), S({
|
|
115
115
|
status: "anonymous"
|
|
116
116
|
/* ANONYMOUS */
|
|
117
117
|
});
|
|
118
|
-
},
|
|
118
|
+
}, X = () => {
|
|
119
119
|
if (d === null)
|
|
120
|
-
return
|
|
121
|
-
const t = Date.now() - d, i =
|
|
120
|
+
return Y;
|
|
121
|
+
const t = Date.now() - d, i = ye.find(
|
|
122
122
|
(c) => c > t && c < $
|
|
123
123
|
);
|
|
124
|
-
return i === void 0 ? (d = null,
|
|
125
|
-
},
|
|
126
|
-
|
|
124
|
+
return i === void 0 ? (d = null, Y) : i - t;
|
|
125
|
+
}, V = () => {
|
|
126
|
+
b();
|
|
127
127
|
const t = o.user ?? a;
|
|
128
128
|
S(
|
|
129
129
|
t ? {
|
|
@@ -134,7 +134,7 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
134
134
|
} : { status: "anonymous", offline: !0 }
|
|
135
135
|
), m = setTimeout(() => {
|
|
136
136
|
m = null, E.refresh();
|
|
137
|
-
},
|
|
137
|
+
}, X());
|
|
138
138
|
}, M = async () => {
|
|
139
139
|
const t = s ? null : await e.storage.getRefreshToken();
|
|
140
140
|
if (!s && !t)
|
|
@@ -143,18 +143,18 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
143
143
|
return { kind: "offline" };
|
|
144
144
|
const i = Date.now(), c = new AbortController(), h = setTimeout(
|
|
145
145
|
() => c.abort(),
|
|
146
|
-
|
|
146
|
+
Ae
|
|
147
147
|
);
|
|
148
148
|
try {
|
|
149
149
|
const A = await F.sdk.auth.refresh(
|
|
150
|
-
t ? { refreshToken: t } :
|
|
150
|
+
t ? { refreshToken: t } : { platform: e.bridge.platform },
|
|
151
151
|
{ signal: c.signal }
|
|
152
152
|
);
|
|
153
153
|
return A.error ? { kind: "unreachable", sentAt: i } : { kind: "session", session: A.data };
|
|
154
154
|
} catch (A) {
|
|
155
155
|
if (c.signal.aborted)
|
|
156
156
|
return { kind: "unreachable", sentAt: i };
|
|
157
|
-
const R =
|
|
157
|
+
const R = B(A);
|
|
158
158
|
if (R.kind === "other")
|
|
159
159
|
throw A;
|
|
160
160
|
return R.kind === "http" && R.status === 401 ? { kind: "revoked" } : R.kind === "http" && R.status === 403 && R.code === x.originRefused ? { kind: "revoked" } : { kind: "unreachable", sentAt: i };
|
|
@@ -165,9 +165,9 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
165
165
|
const t = T;
|
|
166
166
|
d !== null && Date.now() - d >= $ && (d = null);
|
|
167
167
|
let i = await M();
|
|
168
|
-
const c = d === null ?
|
|
168
|
+
const c = d === null ? Ee : [];
|
|
169
169
|
for (const h of c) {
|
|
170
|
-
if (i.kind !== "unreachable" || t !== T || (d = d ?? i.sentAt, await
|
|
170
|
+
if (i.kind !== "unreachable" || t !== T || (d = d ?? i.sentAt, await Se(h), t !== T))
|
|
171
171
|
break;
|
|
172
172
|
i = await M();
|
|
173
173
|
}
|
|
@@ -184,7 +184,7 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
184
184
|
return;
|
|
185
185
|
case "offline":
|
|
186
186
|
case "unreachable":
|
|
187
|
-
|
|
187
|
+
V();
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
}, L = () => {
|
|
@@ -210,8 +210,8 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
210
210
|
handleResult: async (t) => (t.status === Z.AUTHENTICATED && await P(t.session), t),
|
|
211
211
|
refresh: () => {
|
|
212
212
|
if (!l) {
|
|
213
|
-
const t = s ?
|
|
214
|
-
l = (t ? t.request(
|
|
213
|
+
const t = s ? Ie() : null;
|
|
214
|
+
l = (t ? t.request(Re, U) : U()).finally(() => {
|
|
215
215
|
l = null;
|
|
216
216
|
});
|
|
217
217
|
}
|
|
@@ -222,10 +222,10 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
222
222
|
try {
|
|
223
223
|
return await t();
|
|
224
224
|
} catch (c) {
|
|
225
|
-
const h =
|
|
225
|
+
const h = B(c);
|
|
226
226
|
if (h.kind !== "http")
|
|
227
227
|
throw c;
|
|
228
|
-
if (h.status === 401 && h.message ===
|
|
228
|
+
if (h.status === 401 && h.message === ge) {
|
|
229
229
|
if (r === i && await E.refresh(), o.status !== "authenticated" || r === null || r === i)
|
|
230
230
|
throw c;
|
|
231
231
|
return t();
|
|
@@ -249,11 +249,11 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
249
249
|
}
|
|
250
250
|
},
|
|
251
251
|
dispose: () => {
|
|
252
|
-
|
|
252
|
+
b(), g.clear(), _.clear(), typeof window < "u" && window.removeEventListener("online", L), typeof document < "u" && document.removeEventListener("visibilitychange", G);
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
255
|
return E;
|
|
256
|
-
},
|
|
256
|
+
}, ve = "Token Expired", De = /(^|\/)auth\//, ze = (e, s) => {
|
|
257
257
|
const n = s.map((o) => ({
|
|
258
258
|
instance: o,
|
|
259
259
|
id: o.interceptors.response.use(
|
|
@@ -261,7 +261,7 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
261
261
|
async (r) => {
|
|
262
262
|
var l, y, w;
|
|
263
263
|
const a = r == null ? void 0 : r.config;
|
|
264
|
-
if (((l = r == null ? void 0 : r.response) == null ? void 0 : l.status) !== 401 || ((w = (y = r.response.data) == null ? void 0 : y.error) == null ? void 0 : w.message) !==
|
|
264
|
+
if (((l = r == null ? void 0 : r.response) == null ? void 0 : l.status) !== 401 || ((w = (y = r.response.data) == null ? void 0 : y.error) == null ? void 0 : w.message) !== ve || !a || a.abyssAuthReplayed || De.test(a.url ?? ""))
|
|
265
265
|
throw r;
|
|
266
266
|
await e.refresh();
|
|
267
267
|
const u = e.accessToken();
|
|
@@ -279,7 +279,7 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
279
279
|
({ instance: o, id: r }) => o.interceptors.response.eject(r)
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
|
-
},
|
|
282
|
+
}, Ne = "https://accounts.google.com/gsi/client", Ce = "https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1.0/en_US/appleid.auth.js", v = /* @__PURE__ */ new Map(), H = (e) => {
|
|
283
283
|
const s = v.get(e);
|
|
284
284
|
if (s)
|
|
285
285
|
return s;
|
|
@@ -295,52 +295,52 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
295
295
|
}, document.head.appendChild(a);
|
|
296
296
|
});
|
|
297
297
|
return v.set(e, n), n;
|
|
298
|
-
},
|
|
298
|
+
}, Pe = [
|
|
299
299
|
"popup_closed_by_user",
|
|
300
300
|
"user_cancelled_authorize"
|
|
301
|
-
],
|
|
301
|
+
], W = (e) => {
|
|
302
302
|
const { name: s, message: n } = e ?? {}, o = typeof n == "string" ? n : "Passkey ceremony failed";
|
|
303
|
-
return s === "NotAllowedError" || s === "AbortError" || e instanceof
|
|
303
|
+
return s === "NotAllowedError" || s === "AbortError" || e instanceof re && e.code === "ERROR_CEREMONY_ABORTED" ? new f(p.CANCELLED, o, e) : new f(p.FAILED, o, e);
|
|
304
304
|
}, D = (e) => new f(
|
|
305
305
|
p.UNSUPPORTED,
|
|
306
306
|
`${e} is not supported by this browser`
|
|
307
307
|
), K = (e) => new f(
|
|
308
308
|
p.UNSUPPORTED,
|
|
309
309
|
`${e} sign-in is not configured on this site`
|
|
310
|
-
),
|
|
311
|
-
platform:
|
|
310
|
+
), Je = (e) => ({
|
|
311
|
+
platform: e.platform ?? ee.WEB,
|
|
312
312
|
passkeySupported: async () => I(),
|
|
313
313
|
getPasskey: async (s, n = !1) => {
|
|
314
314
|
if (!I())
|
|
315
315
|
throw D("WebAuthn");
|
|
316
|
-
if (n && !await
|
|
316
|
+
if (n && !await ne())
|
|
317
317
|
throw D("Passkey autofill");
|
|
318
318
|
try {
|
|
319
|
-
return await
|
|
319
|
+
return await oe({
|
|
320
320
|
// abyss-main's options are the WebAuthn JSON this call reads (base64url binary fields).
|
|
321
321
|
optionsJSON: s,
|
|
322
322
|
useBrowserAutofill: n
|
|
323
323
|
});
|
|
324
324
|
} catch (o) {
|
|
325
|
-
throw
|
|
325
|
+
throw W(o);
|
|
326
326
|
}
|
|
327
327
|
},
|
|
328
328
|
createPasskey: async (s) => {
|
|
329
329
|
if (!I())
|
|
330
330
|
throw D("WebAuthn");
|
|
331
331
|
try {
|
|
332
|
-
return await
|
|
332
|
+
return await se({
|
|
333
333
|
optionsJSON: s
|
|
334
334
|
});
|
|
335
335
|
} catch (n) {
|
|
336
|
-
throw
|
|
336
|
+
throw W(n);
|
|
337
337
|
}
|
|
338
338
|
},
|
|
339
339
|
google: async (s) => {
|
|
340
340
|
const n = e.googleClientId;
|
|
341
341
|
if (!n)
|
|
342
342
|
throw K("Google");
|
|
343
|
-
await
|
|
343
|
+
await H(Ne);
|
|
344
344
|
const o = window.google;
|
|
345
345
|
if (!o)
|
|
346
346
|
throw new f(
|
|
@@ -392,7 +392,7 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
392
392
|
const { appleServiceId: n, appleRedirectUri: o } = e;
|
|
393
393
|
if (!n || !o)
|
|
394
394
|
throw K("Apple");
|
|
395
|
-
await
|
|
395
|
+
await H(Ce);
|
|
396
396
|
const r = window.AppleID;
|
|
397
397
|
if (!r)
|
|
398
398
|
throw new f(
|
|
@@ -405,7 +405,7 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
405
405
|
redirectURI: o,
|
|
406
406
|
usePopup: !0,
|
|
407
407
|
// Apple carries what it is given; abyss-main compares it with SHA-256(raw nonce) in hex.
|
|
408
|
-
nonce: await
|
|
408
|
+
nonce: await ae(s)
|
|
409
409
|
});
|
|
410
410
|
try {
|
|
411
411
|
const u = await r.auth.signIn(), l = (a = u.user) == null ? void 0 : a.name;
|
|
@@ -416,54 +416,54 @@ const we = 6e4, $ = 3e4, me = [
|
|
|
416
416
|
};
|
|
417
417
|
} catch (u) {
|
|
418
418
|
const l = u == null ? void 0 : u.error;
|
|
419
|
-
throw typeof l == "string" &&
|
|
419
|
+
throw typeof l == "string" && Pe.includes(l) ? new f(p.CANCELLED, l, u) : new f(
|
|
420
420
|
p.FAILED,
|
|
421
421
|
typeof l == "string" ? l : "Sign in with Apple failed",
|
|
422
422
|
u
|
|
423
423
|
);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
}),
|
|
427
|
-
const [n, o] =
|
|
428
|
-
|
|
426
|
+
}), z = ie(null), Xe = ({ client: e, children: s }) => {
|
|
427
|
+
const [n, o] = ue(() => e.state());
|
|
428
|
+
le(() => {
|
|
429
429
|
o(e.state());
|
|
430
430
|
const a = e.subscribe(o);
|
|
431
431
|
return e.bootstrap(), a;
|
|
432
432
|
}, [e]);
|
|
433
|
-
const r =
|
|
434
|
-
return /* @__PURE__ */
|
|
435
|
-
},
|
|
436
|
-
const e =
|
|
433
|
+
const r = ce(() => ({ state: n, client: e }), [n, e]);
|
|
434
|
+
return /* @__PURE__ */ fe(z.Provider, { value: r, children: s });
|
|
435
|
+
}, Ve = () => {
|
|
436
|
+
const e = de(z);
|
|
437
437
|
if (!e)
|
|
438
438
|
throw new Error("useAuth() must be called inside <AuthProvider>");
|
|
439
439
|
return e;
|
|
440
440
|
};
|
|
441
441
|
export {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
442
|
+
he as A,
|
|
443
|
+
Ne as G,
|
|
444
|
+
k as L,
|
|
445
|
+
we as R,
|
|
446
|
+
Y as U,
|
|
447
|
+
pe as a,
|
|
448
448
|
N as b,
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
449
|
+
qe as c,
|
|
450
|
+
Ye as d,
|
|
451
|
+
Be as e,
|
|
452
|
+
He as f,
|
|
453
|
+
me as g,
|
|
454
454
|
$ as h,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
455
|
+
We as i,
|
|
456
|
+
Ee as j,
|
|
457
|
+
ye as k,
|
|
458
|
+
Ke as l,
|
|
459
|
+
Ae as m,
|
|
460
|
+
Re as n,
|
|
461
|
+
je as o,
|
|
462
|
+
ze as p,
|
|
463
|
+
Ce as q,
|
|
464
|
+
$e as r,
|
|
465
|
+
Je as s,
|
|
466
|
+
z as t,
|
|
467
|
+
Xe as u,
|
|
468
|
+
Ve as v
|
|
469
469
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/commons-front-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Front Core package of AbyssProject",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@abyss-project/capacitor-auth": "^1.0.0",
|
|
62
62
|
"@abyss-project/cloud": "^2.4.0",
|
|
63
|
-
"@abyss-project/console": "^
|
|
64
|
-
"@abyss-project/monitor-browser": "^
|
|
63
|
+
"@abyss-project/console": "^14.1.0",
|
|
64
|
+
"@abyss-project/monitor-browser": "^2.0.0",
|
|
65
65
|
"@dnd-kit/core": "^6.0.0",
|
|
66
66
|
"@dnd-kit/sortable": "^9.0.0",
|
|
67
67
|
"@dnd-kit/utilities": "^3.0.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-is": "^18.0.0 || ^19.0.0",
|
|
81
81
|
"react-router-dom": "^6.15.0",
|
|
82
82
|
"zustand": "^5.0.0",
|
|
83
|
-
"@abyss-project/main": "
|
|
83
|
+
"@abyss-project/main": "23.0.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
86
86
|
"@abyss-project/capacitor-auth": {
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"@abyss-project/crypt": "^1.0.9",
|
|
93
93
|
"@abyss-project/form": "^1.0.13",
|
|
94
94
|
"@abyss-project/memories": "^1.0.12",
|
|
95
|
-
"@abyss-project/monitor": "^
|
|
96
|
-
"@abyss-project/spotlight": "^1.
|
|
97
|
-
"@abyss-project/storage": "^1.0
|
|
95
|
+
"@abyss-project/monitor": "^16.2.0",
|
|
96
|
+
"@abyss-project/spotlight": "^1.4.0",
|
|
97
|
+
"@abyss-project/storage": "^3.1.0",
|
|
98
98
|
"@capacitor/clipboard": "^7.0.1",
|
|
99
99
|
"@capacitor/core": "^7.4.0",
|
|
100
100
|
"@capacitor/share": "^7.0.1",
|
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
"use-debounce": "^10.0.5",
|
|
131
131
|
"uuid": "^9.0.0",
|
|
132
132
|
"yup": "^0.32.11",
|
|
133
|
-
"@abyss-project/main": "
|
|
133
|
+
"@abyss-project/main": "23.0.0"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
136
|
"@abyss-project/cloud": "^2.4.0",
|
|
137
|
-
"@abyss-project/console": "^
|
|
138
|
-
"@abyss-project/monitor-browser": "^
|
|
137
|
+
"@abyss-project/console": "^14.1.0",
|
|
138
|
+
"@abyss-project/monitor-browser": "^2.0.0",
|
|
139
139
|
"@playwright/test": "^1.52.0",
|
|
140
140
|
"@testing-library/react": "^16.3.2",
|
|
141
141
|
"@types/byte-size": "^8.1.0",
|