@abyss-project/commons-front-core 4.1.0 → 5.0.1

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.
Files changed (63) hide show
  1. package/dist/{CookieConsentSettings.component-B06_BnQP.js → CookieConsentSettings.component-B7HoVxDK.js} +957 -988
  2. package/dist/auth/components/SecuritySettings/sections/PasswordSection.component.d.ts +0 -2
  3. package/dist/auth-client.js +1 -1
  4. package/dist/components/Inputs/CloudImport/CloudImport.component.d.ts +8 -21
  5. package/dist/components/Inputs/CloudImport/CloudImport.component.spec.d.ts +1 -0
  6. package/dist/components/Inputs/CloudImport/CloudImportFile.component.spec.d.ts +1 -0
  7. package/dist/components/Inputs/CloudImport/cloud-accept.d.ts +13 -0
  8. package/dist/components/Inputs/CloudImport/cloud-accept.spec.d.ts +1 -0
  9. package/dist/components/Inputs/CloudImport/cloud-picker.types.d.ts +46 -0
  10. package/dist/components/Inputs/CloudImport/index.d.ts +1 -0
  11. package/dist/components/Inputs/DropZone/DropZone.component.d.ts +9 -12
  12. package/dist/components/Inputs/DropZone/DropZone.component.spec.d.ts +1 -0
  13. package/dist/components/Inputs/index.d.ts +0 -1
  14. package/dist/components/Modals/ImportFromCloudModal/ImportFromCloudModal.component.d.ts +4 -18
  15. package/dist/components/Modals/index.d.ts +0 -1
  16. package/dist/components/PdfEditor/types.d.ts +3 -3
  17. package/dist/components/Support/support-status-timeline.logic.d.ts +2 -2
  18. package/dist/components/Support/types.d.ts +12 -22
  19. package/dist/components/Utils/ImportButton/ImportButton.component.d.ts +6 -27
  20. package/dist/cookie-consent.js +1 -1
  21. package/dist/hooks/index.d.ts +1 -1
  22. package/dist/hooks/use-cloud-picker.hook.d.ts +47 -0
  23. package/dist/hooks/use-cloud-picker.hook.spec.d.ts +1 -0
  24. package/dist/hooks/use-rich-intl.hook.d.ts +26 -50
  25. package/dist/{index-Bg9oxmUh.js → index-B9j-3Wv9.js} +2 -2
  26. package/dist/{index-Dn4ti301.js → index-BCNdS_hZ.js} +2 -2
  27. package/dist/{index-Bm40A8HL.js → index-BQJ_IibV.js} +2 -2
  28. package/dist/{index-B2KAC2Gn.js → index-BYFdosUa.js} +3 -3
  29. package/dist/{index-B_66plIg.js → index-BlzK79bL.js} +3 -3
  30. package/dist/{index-D9Gusaap.js → index-C-ryoEBt.js} +2 -2
  31. package/dist/{index-vT5IYPPZ.js → index-CDh8wzu8.js} +3 -3
  32. package/dist/{index-TZCSR5-0.js → index-CMfXPyXq.js} +4 -4
  33. package/dist/{index-CvJNzYLZ.js → index-CuhdwbRD.js} +4 -4
  34. package/dist/{index-CCw90R7H.js → index-D0uOg6A0.js} +4 -4
  35. package/dist/{index-C2f3Sbgw.js → index-DQAX2wNI.js} +2 -2
  36. package/dist/{index-bmaZNPBg.js → index-DZ8YTYOY.js} +2 -2
  37. package/dist/{index-CgKIt_AP.js → index-Db7YwEDm.js} +2 -2
  38. package/dist/{index-Cgoj2A0t.js → index-DnCvSvTf.js} +2 -2
  39. package/dist/{index-VQlFvBeS.js → index-DvjhhENb.js} +2 -2
  40. package/dist/{index-Dtx0T0Bm.js → index-DwOujeYK.js} +2 -2
  41. package/dist/{index-BIKW48BP.js → index-IWLHhMeY.js} +1 -1
  42. package/dist/{index-BDQtV9_z.js → index-LoP5aAOy.js} +2 -2
  43. package/dist/{index-CgrrIrxd.js → index-Pm0jV-Wz.js} +2 -2
  44. package/dist/{index-maNkgZdF.js → index-PxLJ-vzu.js} +2 -2
  45. package/dist/{index-D-BuBFP8.js → index-alA0Reco.js} +3 -3
  46. package/dist/{index-Bx5-VSst.js → index-vc79tKxC.js} +32154 -32919
  47. package/dist/index.js +218 -219
  48. package/dist/internal/lazy-value.d.ts +11 -0
  49. package/dist/internal/lazy-value.spec.d.ts +1 -0
  50. package/dist/lazy-value-Co76vxsM.js +7 -0
  51. package/dist/load-safety.spec.d.ts +1 -0
  52. package/dist/translations/en.d.ts +4 -24
  53. package/dist/translations/fr.d.ts +4 -24
  54. package/dist/{use-auth.hook-BLaU_u8T.js → use-auth.hook-DatVLGxS.js} +103 -100
  55. package/dist/utils/cloud-space-url.utils.d.ts +7 -0
  56. package/dist/utils/cloud-space-url.utils.spec.d.ts +1 -0
  57. package/dist/utils/index.d.ts +1 -0
  58. package/package.json +5 -4
  59. package/dist/components/Inputs/CloudSave/CloudSave.component.d.ts +0 -17
  60. package/dist/components/Inputs/CloudSave/index.d.ts +0 -1
  61. package/dist/components/Modals/SaveCloudModal/SaveCloudModal.component.d.ts +0 -18
  62. package/dist/components/Modals/SaveCloudModal/index.d.ts +0 -1
  63. package/dist/hooks/use-cloud.hook.d.ts +0 -8
@@ -1,19 +1,20 @@
1
- import { MfaFactorType as U, SessionPlatform as B, AbyssCore as F, Code as J, AuthResultStatus as X } from "@abyss-project/main";
2
- import { browserSupportsWebAuthn as g, startRegistration as $, browserSupportsWebAuthnAutofill as V, startAuthentication as Q, WebAuthnError as Z } from "@simplewebauthn/browser";
3
- import { a as c, A as d, s as ee } from "./token-storage-CbWrBeIP.js";
4
- import { createContext as te, useState as ne, useEffect as se, useMemo as re, useContext as oe } from "react";
5
- import { jsx as ae } from "react/jsx-runtime";
6
- var ie = /* @__PURE__ */ ((e) => (e.LOADING = "loading", e.ANONYMOUS = "anonymous", e.AUTHENTICATED = "authenticated", e))(ie || {}), ue = /* @__PURE__ */ ((e) => (e.PASSKEY = "passkey", e.TOTP = "totp", e.PASSWORD = "password", e.EMAIL_CODE = "email-code", e))(ue || {});
7
- const le = 6e4, x = 3e4, ce = [
1
+ import { SessionPlatform as H, AbyssCore as U, Code as J, AuthResultStatus as V, MfaFactorType as x } from "@abyss-project/main";
2
+ import { l as X } from "./lazy-value-Co76vxsM.js";
3
+ import { browserSupportsWebAuthn as g, startRegistration as $, browserSupportsWebAuthnAutofill as Q, startAuthentication as Z, WebAuthnError as ee } from "@simplewebauthn/browser";
4
+ import { a as c, A as d, s as te } from "./token-storage-CbWrBeIP.js";
5
+ import { createContext as ne, useState as se, useEffect as re, useMemo as oe, useContext as ae } from "react";
6
+ import { jsx as ie } from "react/jsx-runtime";
7
+ var ue = /* @__PURE__ */ ((e) => (e.LOADING = "loading", e.ANONYMOUS = "anonymous", e.AUTHENTICATED = "authenticated", e))(ue || {}), le = /* @__PURE__ */ ((e) => (e.PASSKEY = "passkey", e.TOTP = "totp", e.PASSWORD = "password", e.EMAIL_CODE = "email-code", e))(le || {});
8
+ const ce = 6e4, F = 3e4, de = [
8
9
  500,
9
10
  1e3,
10
11
  2e3
11
- ], de = [
12
+ ], fe = [
12
13
  7500,
13
14
  15e3,
14
15
  22500,
15
16
  27e3
16
- ], G = 3e4, fe = 5e3, pe = "abyss-auth-refresh", he = 2147483647, we = "Token Expired", Ee = (e) => typeof e == "object" && e !== null && e.isAxiosError === !0, H = (e) => {
17
+ ], G = 3e4, pe = 5e3, he = "abyss-auth-refresh", we = 2147483647, me = "Token Expired", Ee = (e) => typeof e == "object" && e !== null && e.isAxiosError === !0, W = (e) => {
17
18
  var r;
18
19
  if (!Ee(e) || e.code === "ERR_CANCELED")
19
20
  return { kind: "other" };
@@ -27,71 +28,73 @@ const le = 6e4, x = 3e4, ce = [
27
28
  message: s == null ? void 0 : s.message,
28
29
  params: s == null ? void 0 : s.params
29
30
  };
30
- }, me = /* @__PURE__ */ new Map([
31
- [
32
- U.TOTP,
33
- "totp"
34
- /* TOTP */
35
- ],
36
- [
37
- U.PASSKEY,
38
- "passkey"
39
- /* PASSKEY */
40
- ]
41
- ]), Ae = (e) => {
31
+ }, Ae = X(
32
+ () => /* @__PURE__ */ new Map([
33
+ [
34
+ x.TOTP,
35
+ "totp"
36
+ /* TOTP */
37
+ ],
38
+ [
39
+ x.PASSKEY,
40
+ "passkey"
41
+ /* PASSKEY */
42
+ ]
43
+ ])
44
+ ), ye = (e) => {
42
45
  const s = e == null ? void 0 : e.methods;
43
46
  return Array.isArray(s) ? {
44
47
  methods: s.flatMap((r) => {
45
- const i = me.get(r);
48
+ const i = Ae().get(r);
46
49
  return i ? [i] : [];
47
50
  })
48
51
  } : {};
49
- }, ye = (e) => new Promise((s) => setTimeout(s, e)), Re = () => typeof navigator > "u" || navigator.onLine !== !1, Te = () => typeof navigator > "u" ? null : navigator.locks ?? null, De = (e) => {
50
- const s = e.bridge.platform === B.WEB, r = e.isOnline ?? Re;
52
+ }, Re = (e) => new Promise((s) => setTimeout(s, e)), ke = () => typeof navigator > "u" || navigator.onLine !== !1, Te = () => typeof navigator > "u" ? null : navigator.locks ?? null, Ne = (e) => {
53
+ const s = e.bridge.platform === H.WEB, r = e.isOnline ?? ke;
51
54
  let i = {
52
55
  status: "loading"
53
56
  /* LOADING */
54
- }, a = null, n = null, E = null, y = null, _ = null, m = null, p = null, l = null, A = 0;
55
- const R = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set(), S = (t) => {
57
+ }, a = null, n = null, m = null, y = null, _ = null, E = null, p = null, l = null, A = 0;
58
+ const R = /* @__PURE__ */ new Set(), k = /* @__PURE__ */ new Set(), S = (t) => {
56
59
  i = t, R.forEach((o) => o(i));
57
- }, D = (t) => {
58
- a = t, e.applyToken(t), T.forEach((o) => o(t));
59
- }, k = () => {
60
- m && (clearTimeout(m), m = null), p && (clearTimeout(p), p = null);
61
- }, K = (t) => {
60
+ }, P = (t) => {
61
+ a = t, e.applyToken(t), k.forEach((o) => o(t));
62
+ }, T = () => {
63
+ E && (clearTimeout(E), E = null), p && (clearTimeout(p), p = null);
64
+ }, z = (t) => {
62
65
  const o = Date.parse(t);
63
66
  if (!Number.isFinite(o))
64
67
  return;
65
68
  const u = Math.min(
66
- Math.max(o - le - Date.now(), 0),
67
- he
69
+ Math.max(o - ce - Date.now(), 0),
70
+ we
68
71
  );
69
- m = setTimeout(() => {
70
- m = null, h.refresh();
72
+ E = setTimeout(() => {
73
+ E = null, h.refresh();
71
74
  }, u);
72
- }, P = async (t) => {
75
+ }, D = async (t) => {
73
76
  var o;
74
- k(), t.refreshToken && await e.storage.setRefreshToken(t.refreshToken), D(t.accessToken), n = t.user, (o = e.onPersistUser) == null || o.call(e, t.user), S({
77
+ T(), t.refreshToken && await e.storage.setRefreshToken(t.refreshToken), P(t.accessToken), n = t.user, (o = e.onPersistUser) == null || o.call(e, t.user), S({
75
78
  status: "authenticated",
76
79
  user: t.user,
77
80
  mfaEnrollmentRequired: t.mfaEnrollmentRequired,
78
81
  offline: !1
79
- }), K(t.accessTokenExpiresAt);
82
+ }), z(t.accessTokenExpiresAt);
80
83
  }, N = async () => {
81
84
  var t;
82
- A += 1, k(), l = null, await e.storage.setRefreshToken(null), D(null), n = null, (t = e.onPersistUser) == null || t.call(e, null), S({
85
+ A += 1, T(), l = null, await e.storage.setRefreshToken(null), P(null), n = null, (t = e.onPersistUser) == null || t.call(e, null), S({
83
86
  status: "anonymous"
84
87
  /* ANONYMOUS */
85
88
  });
86
- }, j = () => {
89
+ }, K = () => {
87
90
  if (l === null)
88
91
  return G;
89
- const t = Date.now() - l, o = de.find(
90
- (u) => u > t && u < x
92
+ const t = Date.now() - l, o = fe.find(
93
+ (u) => u > t && u < F
91
94
  );
92
95
  return o === void 0 ? (l = null, G) : o - t;
93
- }, z = () => {
94
- k();
96
+ }, j = () => {
97
+ T();
95
98
  const t = i.user ?? n;
96
99
  S(
97
100
  t ? {
@@ -102,7 +105,7 @@ const le = 6e4, x = 3e4, ce = [
102
105
  } : { status: "anonymous", offline: !0 }
103
106
  ), p = setTimeout(() => {
104
107
  p = null, h.refresh();
105
- }, j());
108
+ }, K());
106
109
  }, I = async () => {
107
110
  const t = s ? null : await e.storage.getRefreshToken();
108
111
  if (!s && !t)
@@ -111,10 +114,10 @@ const le = 6e4, x = 3e4, ce = [
111
114
  return { kind: "offline" };
112
115
  const o = Date.now(), u = new AbortController(), f = setTimeout(
113
116
  () => u.abort(),
114
- fe
117
+ pe
115
118
  );
116
119
  try {
117
- const w = await F.sdk.auth.refresh(
120
+ const w = await U.sdk.auth.refresh(
118
121
  t ? { refreshToken: t } : void 0,
119
122
  { signal: u.signal }
120
123
  );
@@ -122,7 +125,7 @@ const le = 6e4, x = 3e4, ce = [
122
125
  } catch (w) {
123
126
  if (u.signal.aborted)
124
127
  return { kind: "unreachable", sentAt: o };
125
- const L = H(w);
128
+ const L = W(w);
126
129
  if (L.kind === "other")
127
130
  throw w;
128
131
  return L.kind === "http" && L.status === 401 ? { kind: "revoked" } : { kind: "unreachable", sentAt: o };
@@ -131,11 +134,11 @@ const le = 6e4, x = 3e4, ce = [
131
134
  }
132
135
  }, O = async () => {
133
136
  const t = A;
134
- l !== null && Date.now() - l >= x && (l = null);
137
+ l !== null && Date.now() - l >= F && (l = null);
135
138
  let o = await I();
136
- const u = l === null ? ce : [];
139
+ const u = l === null ? de : [];
137
140
  for (const f of u) {
138
- if (o.kind !== "unreachable" || t !== A || (l = l ?? o.sentAt, await ye(f), t !== A))
141
+ if (o.kind !== "unreachable" || t !== A || (l = l ?? o.sentAt, await Re(f), t !== A))
139
142
  break;
140
143
  o = await I();
141
144
  }
@@ -145,14 +148,14 @@ const le = 6e4, x = 3e4, ce = [
145
148
  }
146
149
  switch (o.kind) {
147
150
  case "session":
148
- await P(o.session);
151
+ await D(o.session);
149
152
  return;
150
153
  case "revoked":
151
154
  await N();
152
155
  return;
153
156
  case "offline":
154
157
  case "unreachable":
155
- z();
158
+ j();
156
159
  return;
157
160
  }
158
161
  }, b = () => {
@@ -168,18 +171,18 @@ const le = 6e4, x = 3e4, ce = [
168
171
  R.delete(t);
169
172
  }),
170
173
  accessToken: () => a,
171
- subscribeToken: (t) => (T.add(t), t(a), () => {
172
- T.delete(t);
174
+ subscribeToken: (t) => (k.add(t), t(a), () => {
175
+ k.delete(t);
173
176
  }),
174
177
  bootstrap: () => (_ || (_ = (async () => {
175
178
  var t;
176
179
  n = await ((t = e.restoreUser) == null ? void 0 : t.call(e)) ?? null, await h.refresh();
177
180
  })()), _),
178
- handleResult: async (t) => (t.status === X.AUTHENTICATED && await P(t.session), t),
181
+ handleResult: async (t) => (t.status === V.AUTHENTICATED && await D(t.session), t),
179
182
  refresh: () => {
180
183
  if (!y) {
181
184
  const t = s ? Te() : null;
182
- y = (t ? t.request(pe, O) : O()).finally(() => {
185
+ y = (t ? t.request(he, O) : O()).finally(() => {
183
186
  y = null;
184
187
  });
185
188
  }
@@ -190,38 +193,38 @@ const le = 6e4, x = 3e4, ce = [
190
193
  try {
191
194
  return await t();
192
195
  } catch (u) {
193
- const f = H(u);
196
+ const f = W(u);
194
197
  if (f.kind !== "http")
195
198
  throw u;
196
- if (f.status === 401 && f.message === we) {
199
+ if (f.status === 401 && f.message === me) {
197
200
  if (a === o && await h.refresh(), i.status !== "authenticated" || a === null || a === o)
198
201
  throw u;
199
202
  return t();
200
203
  }
201
- if (f.status === 403 && f.code === J.reauthRequired && E) {
202
- if (!await E(Ae(f.params)))
204
+ if (f.status === 403 && f.code === J.reauthRequired && m) {
205
+ if (!await m(ye(f.params)))
203
206
  throw u;
204
207
  return t();
205
208
  }
206
209
  throw u;
207
210
  }
208
211
  },
209
- onReauthRequired: (t) => (E = t, () => {
210
- E === t && (E = null);
212
+ onReauthRequired: (t) => (m = t, () => {
213
+ m === t && (m = null);
211
214
  }),
212
215
  logout: async () => {
213
216
  try {
214
- i.status === "authenticated" && a === null && await h.refresh(), a !== null && await h.withAuthRetry(() => F.sdk.auth.logout());
217
+ i.status === "authenticated" && a === null && await h.refresh(), a !== null && await h.withAuthRetry(() => U.sdk.auth.logout());
215
218
  } finally {
216
219
  await N();
217
220
  }
218
221
  },
219
222
  dispose: () => {
220
- k(), R.clear(), T.clear(), typeof window < "u" && window.removeEventListener("online", b), typeof document < "u" && document.removeEventListener("visibilitychange", M);
223
+ T(), R.clear(), k.clear(), typeof window < "u" && window.removeEventListener("online", b), typeof document < "u" && document.removeEventListener("visibilitychange", M);
221
224
  }
222
225
  };
223
226
  return h;
224
- }, ke = "https://accounts.google.com/gsi/client", _e = "https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1.0/en_US/appleid.auth.js", v = /* @__PURE__ */ new Map(), W = (e) => {
227
+ }, _e = "https://accounts.google.com/gsi/client", Se = "https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1.0/en_US/appleid.auth.js", v = /* @__PURE__ */ new Map(), Y = (e) => {
225
228
  const s = v.get(e);
226
229
  if (s)
227
230
  return s;
@@ -237,31 +240,31 @@ const le = 6e4, x = 3e4, ce = [
237
240
  }, document.head.appendChild(n);
238
241
  });
239
242
  return v.set(e, r), r;
240
- }, Se = [
243
+ }, be = [
241
244
  "popup_closed_by_user",
242
245
  "user_cancelled_authorize"
243
- ], Y = (e) => {
246
+ ], B = (e) => {
244
247
  const { name: s, message: r } = e ?? {}, i = typeof r == "string" ? r : "Passkey ceremony failed";
245
- return s === "NotAllowedError" || s === "AbortError" || e instanceof Z && e.code === "ERROR_CEREMONY_ABORTED" ? new c(d.CANCELLED, i, e) : new c(d.FAILED, i, e);
248
+ return s === "NotAllowedError" || s === "AbortError" || e instanceof ee && e.code === "ERROR_CEREMONY_ABORTED" ? new c(d.CANCELLED, i, e) : new c(d.FAILED, i, e);
246
249
  }, C = (e) => new c(
247
250
  d.UNSUPPORTED,
248
251
  `${e} is not supported by this browser`
249
- ), Pe = (e) => ({
250
- platform: B.WEB,
252
+ ), Ie = (e) => ({
253
+ platform: H.WEB,
251
254
  passkeySupported: async () => g(),
252
255
  getPasskey: async (s, r = !1) => {
253
256
  if (!g())
254
257
  throw C("WebAuthn");
255
- if (r && !await V())
258
+ if (r && !await Q())
256
259
  throw C("Passkey autofill");
257
260
  try {
258
- return await Q({
261
+ return await Z({
259
262
  // abyss-main's options are the WebAuthn JSON this call reads (base64url binary fields).
260
263
  optionsJSON: s,
261
264
  useBrowserAutofill: r
262
265
  });
263
266
  } catch (i) {
264
- throw Y(i);
267
+ throw B(i);
265
268
  }
266
269
  },
267
270
  createPasskey: async (s) => {
@@ -272,11 +275,11 @@ const le = 6e4, x = 3e4, ce = [
272
275
  optionsJSON: s
273
276
  });
274
277
  } catch (r) {
275
- throw Y(r);
278
+ throw B(r);
276
279
  }
277
280
  },
278
281
  google: async (s) => {
279
- await W(ke);
282
+ await Y(_e);
280
283
  const r = window.google;
281
284
  if (!r)
282
285
  throw new c(
@@ -325,7 +328,7 @@ const le = 6e4, x = 3e4, ce = [
325
328
  },
326
329
  apple: async (s) => {
327
330
  var i;
328
- await W(_e);
331
+ await Y(Se);
329
332
  const r = window.AppleID;
330
333
  if (!r)
331
334
  throw new c(
@@ -338,7 +341,7 @@ const le = 6e4, x = 3e4, ce = [
338
341
  redirectURI: e.appleRedirectUri,
339
342
  usePopup: !0,
340
343
  // Apple carries what it is given; abyss-main compares it with SHA-256(raw nonce) in hex.
341
- nonce: await ee(s)
344
+ nonce: await te(s)
342
345
  });
343
346
  try {
344
347
  const a = await r.auth.signIn(), n = (i = a.user) == null ? void 0 : i.name;
@@ -349,43 +352,43 @@ const le = 6e4, x = 3e4, ce = [
349
352
  };
350
353
  } catch (a) {
351
354
  const n = a == null ? void 0 : a.error;
352
- throw typeof n == "string" && Se.includes(n) ? new c(d.CANCELLED, n, a) : new c(
355
+ throw typeof n == "string" && be.includes(n) ? new c(d.CANCELLED, n, a) : new c(
353
356
  d.FAILED,
354
357
  typeof n == "string" ? n : "Sign in with Apple failed",
355
358
  a
356
359
  );
357
360
  }
358
361
  }
359
- }), q = te(null), Ne = ({ client: e, children: s }) => {
360
- const [r, i] = ne(() => e.state());
361
- se(() => {
362
+ }), q = ne(null), Oe = ({ client: e, children: s }) => {
363
+ const [r, i] = se(() => e.state());
364
+ re(() => {
362
365
  i(e.state());
363
366
  const n = e.subscribe(i);
364
367
  return e.bootstrap(), n;
365
368
  }, [e]);
366
- const a = re(() => ({ state: r, client: e }), [r, e]);
367
- return /* @__PURE__ */ ae(q.Provider, { value: a, children: s });
368
- }, Ie = () => {
369
- const e = oe(q);
369
+ const a = oe(() => ({ state: r, client: e }), [r, e]);
370
+ return /* @__PURE__ */ ie(q.Provider, { value: a, children: s });
371
+ }, Me = () => {
372
+ const e = ae(q);
370
373
  if (!e)
371
374
  throw new Error("useAuth() must be called inside <AuthProvider>");
372
375
  return e;
373
376
  };
374
377
  export {
375
- ie as A,
376
- ke as G,
377
- ce as L,
378
- ue as R,
378
+ ue as A,
379
+ _e as G,
380
+ de as L,
381
+ le as R,
379
382
  G as U,
380
- le as a,
381
- x as b,
382
- de as c,
383
- fe as d,
384
- pe as e,
385
- De as f,
386
- _e as g,
387
- Pe as h,
383
+ ce as a,
384
+ F as b,
385
+ fe as c,
386
+ pe as d,
387
+ he as e,
388
+ Ne as f,
389
+ Se as g,
390
+ Ie as h,
388
391
  q as i,
389
- Ne as j,
390
- Ie as u
392
+ Oe as j,
393
+ Me as u
391
394
  };
@@ -0,0 +1,7 @@
1
+ import { ISpace } from '@abyss-project/cloud';
2
+ /**
3
+ * URL of a Space in the AbyssCloud front. The cloud front routes a Space by
4
+ * its scope (abyss-cloud `apps/front/src/routes.ts`), not by its id; a Space
5
+ * shared with the user is reached through the "Shared with me" page.
6
+ */
7
+ export declare const buildCloudSpaceUrl: (abyssCloudUrl: string, space: Pick<ISpace, "userId" | "organizationId" | "projectId"> | null, isSharedWithMe: boolean) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -8,3 +8,4 @@ export * from './project-link-wording.utils';
8
8
  export * from './locale.utils';
9
9
  export * from './share-notification.utils';
10
10
  export * from './space-display-name.utils';
11
+ export * from './cloud-space-url.utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/commons-front-core",
3
- "version": "4.1.0",
3
+ "version": "5.0.1",
4
4
  "description": "Front Core package of AbyssProject",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -50,6 +50,7 @@
50
50
  "homepage": "https://gitlab.com/abyss-group",
51
51
  "peerDependencies": {
52
52
  "@abyss-project/capacitor-auth": "^1.0.0",
53
+ "@abyss-project/cloud": "^2.4.0",
53
54
  "@dnd-kit/core": "^6.0.0",
54
55
  "@dnd-kit/sortable": "^9.0.0",
55
56
  "@dnd-kit/utilities": "^3.0.0",
@@ -68,7 +69,7 @@
68
69
  "react-is": "^18.0.0 || ^19.0.0",
69
70
  "react-router-dom": "^6.15.0",
70
71
  "zustand": "^5.0.0",
71
- "@abyss-project/main": "13.2.0"
72
+ "@abyss-project/main": "13.4.0"
72
73
  },
73
74
  "peerDependenciesMeta": {
74
75
  "@abyss-project/capacitor-auth": {
@@ -77,7 +78,6 @@
77
78
  },
78
79
  "dependencies": {
79
80
  "@abyss-project/banking": "^1.1.0",
80
- "@abyss-project/cloud": "^2.3.0",
81
81
  "@abyss-project/crypt": "^1.0.9",
82
82
  "@abyss-project/form": "^1.0.13",
83
83
  "@abyss-project/memories": "^1.0.12",
@@ -116,9 +116,10 @@
116
116
  "use-debounce": "^10.0.5",
117
117
  "uuid": "^9.0.0",
118
118
  "yup": "^0.32.11",
119
- "@abyss-project/main": "13.2.0"
119
+ "@abyss-project/main": "13.4.0"
120
120
  },
121
121
  "devDependencies": {
122
+ "@abyss-project/cloud": "^2.4.0",
122
123
  "@testing-library/react": "^16.3.2",
123
124
  "@types/byte-size": "^8.1.0",
124
125
  "@types/flat": "^5.0.5",
@@ -1,17 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ISpace, IFolder, IGetRepositoryCloudData } from '@abyss-project/cloud';
3
- type Props = {
4
- onConfirm: (cloud: ISpace, folder: IFolder | null) => Promise<void>;
5
- isCloudEnabled?: boolean;
6
- abyssCloudUrl: string;
7
- getFileThumbnailUrl: (id: string) => string;
8
- clouds: ISpace[] | null;
9
- cloudShares: ISpace[] | null;
10
- isLoadingClouds?: boolean;
11
- onRefreshClouds: () => Promise<void>;
12
- fetchCloudRepository: (cloudId: string) => Promise<IGetRepositoryCloudData>;
13
- onActivateService: () => Promise<void>;
14
- onCreateCloud: (name: string) => Promise<void>;
15
- };
16
- declare const CloudSave: React.FC<Props>;
17
- export default CloudSave;
@@ -1 +0,0 @@
1
- export { default as CloudSave } from './CloudSave.component';
@@ -1,18 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ISpace, IFolder, IGetRepositoryCloudData } from '@abyss-project/cloud';
3
- type Props = {
4
- isOpen: boolean;
5
- onCancel: () => Promise<void>;
6
- onConfirm: (cloud: ISpace, folder: IFolder | null) => Promise<void>;
7
- abyssCloudUrl: string;
8
- getFileThumbnailUrl: (id: string) => string;
9
- clouds: ISpace[] | null;
10
- cloudShares: ISpace[] | null;
11
- isLoadingClouds?: boolean;
12
- onRefreshClouds: () => Promise<void>;
13
- fetchCloudRepository: (cloudId: string) => Promise<IGetRepositoryCloudData>;
14
- onActivateService: () => Promise<void>;
15
- onCreateCloud: (name: string) => Promise<void>;
16
- };
17
- declare const SaveCloudModal: React.FC<Props>;
18
- export default SaveCloudModal;
@@ -1 +0,0 @@
1
- export { default as SaveCloudModal } from './SaveCloudModal.component';
@@ -1,8 +0,0 @@
1
- import { ISpace, IPaginateCloudItem } from '@abyss-project/cloud';
2
- export declare const useFetchClouds: () => {
3
- isLoading: boolean;
4
- fetch: () => Promise<{
5
- clouds: IPaginateCloudItem[];
6
- cloudShares: ISpace[];
7
- }>;
8
- };