@abyss-project/commons-front-core 9.6.0 → 10.1.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.
Files changed (161) hide show
  1. package/README.md +334 -315
  2. package/catalog/catalog-entries.ts +2 -0
  3. package/catalog/pages/MarkdownEditor.tsx +48 -0
  4. package/catalog/pages/PdfEditor.tsx +153 -0
  5. package/catalog/pages/index.ts +4 -0
  6. package/dist/AbyssCloud-IuD91X6C.js +2949 -0
  7. package/dist/{AbyssCookieConsentProvider-D-HRRYCd.js → AbyssCookieConsentProvider-DTHchhfw.js} +2038 -1387
  8. package/dist/{CookieConsentSettings.component-iG_abYsq.js → CookieConsentSettings.component-D13TqxZl.js} +1 -1
  9. package/dist/Tabs-CZQ1JYlW.js +2315 -0
  10. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  11. package/dist/auth/client/web-bridge.d.ts +6 -0
  12. package/dist/auth/components/AuthFlow/AuthFlow.component.d.ts +9 -2
  13. package/dist/auth/components/AuthFlow/auth-flow.types.d.ts +5 -0
  14. package/dist/auth/components/AuthFlow/steps/EmailStep.component.d.ts +4 -1
  15. package/dist/auth/components/index.d.ts +1 -0
  16. package/dist/auth/components/shared/auth-errors.d.ts +1 -0
  17. package/dist/auth-client.js +1 -1
  18. package/dist/components/editors/MarkdownEditor/MarkdownEditor.d.ts +19 -0
  19. package/dist/components/editors/MarkdownEditor/crepe-labels.d.ts +17 -0
  20. package/dist/components/editors/MarkdownEditor/index.d.ts +2 -0
  21. package/dist/components/editors/MarkdownEditor/markdown-theme.d.ts +7 -0
  22. package/dist/components/editors/PdfEditor/PdfEditor.d.ts +9 -0
  23. package/dist/components/editors/PdfEditor/engine/open-pdf-document.d.ts +8 -0
  24. package/dist/components/editors/PdfEditor/engine/operations/redact.spec.d.ts +1 -0
  25. package/dist/components/editors/PdfEditor/engine/operations/reducer.spec.d.ts +1 -0
  26. package/dist/components/editors/PdfEditor/engine/operations/rotate-coords.spec.d.ts +1 -0
  27. package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/types.d.ts +1 -1
  28. package/dist/components/editors/PdfEditor/index.d.ts +3 -0
  29. package/dist/components/editors/PdfEditor/pdf-colors.d.ts +26 -0
  30. package/dist/components/editors/PdfEditor/pdf-colors.spec.d.ts +1 -0
  31. package/dist/components/editors/PdfEditor/signature/SignatureDrawPad.d.ts +15 -0
  32. package/dist/components/editors/PdfEditor/signature/SignaturePicker.d.ts +31 -0
  33. package/dist/components/editors/PdfEditor/signature/SignaturePicker.spec.d.ts +1 -0
  34. package/dist/components/editors/PdfEditor/signature/SignatureSaveButton.d.ts +14 -0
  35. package/dist/components/editors/PdfEditor/signature/SignatureSavedList.d.ts +19 -0
  36. package/dist/components/editors/PdfEditor/signature/SignatureUploadPanel.d.ts +14 -0
  37. package/dist/components/editors/PdfEditor/signature/resolve-asset.d.ts +19 -0
  38. package/dist/components/editors/PdfEditor/signature/resolve-asset.spec.d.ts +1 -0
  39. package/dist/components/editors/PdfEditor/signature/test-support/pdf-editor-test-harness.d.ts +28 -0
  40. package/dist/components/editors/PdfEditor/toolbar/EraserIcon.d.ts +3 -0
  41. package/dist/components/editors/PdfEditor/toolbar/GroupPanel.d.ts +17 -0
  42. package/dist/components/editors/PdfEditor/toolbar/PanelRow.d.ts +14 -0
  43. package/dist/components/editors/PdfEditor/toolbar/PdfToolbar.d.ts +65 -0
  44. package/dist/components/editors/PdfEditor/toolbar/PdfToolbar.spec.d.ts +1 -0
  45. package/dist/components/editors/PdfEditor/toolbar/SavedAssets.d.ts +24 -0
  46. package/dist/components/editors/PdfEditor/toolbar/ToolGroupButton.d.ts +20 -0
  47. package/dist/components/editors/PdfEditor/toolbar/tool-groups.d.ts +34 -0
  48. package/dist/components/editors/PdfEditor/toolbar/tool-options/DrawOptions.d.ts +6 -0
  49. package/dist/components/editors/PdfEditor/toolbar/tool-options/FillFieldsOptions.d.ts +13 -0
  50. package/dist/components/editors/PdfEditor/toolbar/tool-options/HighlightOptions.d.ts +6 -0
  51. package/dist/components/editors/PdfEditor/toolbar/tool-options/RedactOptions.d.ts +6 -0
  52. package/dist/components/editors/PdfEditor/toolbar/tool-options/ShapeOptions.d.ts +6 -0
  53. package/dist/components/editors/PdfEditor/toolbar/tool-options/SignatureOptions.d.ts +5 -0
  54. package/dist/components/editors/PdfEditor/toolbar/tool-options/TextOptions.d.ts +6 -0
  55. package/dist/components/editors/PdfEditor/toolbar/tool-options/ToolOptions.d.ts +14 -0
  56. package/dist/components/editors/PdfEditor/toolbar/tool-options/swatches.d.ts +2 -0
  57. package/dist/components/editors/PdfEditor/toolbar/tool-settings.d.ts +14 -0
  58. package/dist/components/editors/PdfEditor/viewer/InsertPagesButton.d.ts +14 -0
  59. package/dist/components/editors/PdfEditor/viewer/InsertPagesButton.spec.d.ts +1 -0
  60. package/dist/components/editors/PdfEditor/viewer/InsertPagesDialog.d.ts +28 -0
  61. package/dist/components/editors/PdfEditor/viewer/PageOverlay.d.ts +37 -0
  62. package/dist/components/editors/PdfEditor/viewer/PageOverlay.spec.d.ts +1 -0
  63. package/dist/components/editors/PdfEditor/viewer/PageSidebar.d.ts +16 -0
  64. package/dist/components/editors/PdfEditor/viewer/PageSidebar.spec.d.ts +1 -0
  65. package/dist/components/editors/PdfEditor/viewer/PageThumbnail.d.ts +16 -0
  66. package/dist/components/editors/PdfEditor/viewer/PdfCanvas.d.ts +26 -0
  67. package/dist/components/editors/PdfEditor/viewer/PdfCanvas.spec.d.ts +1 -0
  68. package/dist/components/editors/PdfEditor/viewer/ViewerControls.d.ts +21 -0
  69. package/dist/components/editors/PdfEditor/viewer/ViewerControls.spec.d.ts +1 -0
  70. package/dist/components/editors/PdfEditor/viewer/test-support/viewer-test-harness.d.ts +30 -0
  71. package/dist/components/editors/editors-guard.spec.d.ts +1 -0
  72. package/dist/components/editors/index.d.ts +2 -0
  73. package/dist/components/inputs/DropZone/DropZone.d.ts +6 -1
  74. package/dist/components/layers/ProductTour/product-tour-geometry.d.ts +2 -0
  75. package/dist/components/structure/AccountMenu/AccountMenu.d.ts +2 -1
  76. package/dist/components/structure/AppShell/app-shell.types.d.ts +5 -0
  77. package/dist/cookie-consent.js +2 -2
  78. package/dist/{design-theme-Cz9YXXYF.js → design-theme-BGMTwRaP.js} +9279 -12219
  79. package/dist/editors.d.ts +1 -0
  80. package/dist/editors.js +5151 -0
  81. package/dist/hooks/use-rich-intl.hook.d.ts +702 -0
  82. package/dist/{index-C4zd0qai.js → index-40JUFFwY.js} +3 -3
  83. package/dist/{index-hmLJVQI5.js → index-B9pFhQQG.js} +2 -2
  84. package/dist/{index-BmNsW-7e.js → index-BFBonBC2.js} +4 -4
  85. package/dist/{index-CtIh_DWT.js → index-BUqYHWKw.js} +3 -3
  86. package/dist/{index-DP-wuPBm.js → index-BcRgJqSB.js} +2 -2
  87. package/dist/{index-122nruW2.js → index-BlhbGVkk.js} +2 -2
  88. package/dist/{index-uctTt51v.js → index-BsOQZ-n8.js} +2 -2
  89. package/dist/{index-Bx3HHL-R.js → index-CBrydj4V.js} +2 -2
  90. package/dist/{index-Dodsh0PI.js → index-CM-90k5s.js} +3 -3
  91. package/dist/{index-D4RSXnjv.js → index-Cccq9d1E.js} +2 -2
  92. package/dist/{index-D-Sa8nQo.js → index-CdL2MLmd.js} +3 -3
  93. package/dist/{index-71ZKDT76.js → index-D0EC1_iy.js} +4 -4
  94. package/dist/{index-CfMACXTF.js → index-D7AFc1sX.js} +2 -2
  95. package/dist/{index-DIW1zdfO.js → index-Dk1JTU4K.js} +2 -2
  96. package/dist/{index-XQsb7DVh.js → index-Dop3xXC3.js} +1 -1
  97. package/dist/{index-ri1JKKHf.js → index-DqAkOKf8.js} +2 -2
  98. package/dist/{index-D5lR_Znk.js → index-JEsamj6m.js} +2 -2
  99. package/dist/{index-y2047KCu.js → index-kfzQWNLP.js} +2 -2
  100. package/dist/{index-ClFFE5ao.js → index-oBWWShwb.js} +2 -2
  101. package/dist/{index-B1LNfIcu.js → index-s2djh_x_.js} +2 -2
  102. package/dist/{index-BGjmUj-Y.js → index-tN8hz-IX.js} +4 -4
  103. package/dist/index.js +6124 -8229
  104. package/dist/legacy/components/Layouts/AbyssThemeToggle/AbyssThemeToggle.component.d.ts +2 -1
  105. package/dist/legacy/components/Layouts/AbyssThemeToggle/AbyssThemeToggle.component.spec.d.ts +1 -0
  106. package/dist/legacy/components/PdfEditor/PdfEditor.d.ts +1 -1
  107. package/dist/legacy/components/PdfEditor/index.d.ts +2 -2
  108. package/dist/legacy/components/PdfEditor/signature/SignatureDrawCanvas.d.ts +1 -1
  109. package/dist/legacy/components/PdfEditor/signature/SignaturePicker.d.ts +1 -1
  110. package/dist/legacy/components/PdfEditor/signature/SignatureSaveButton.d.ts +1 -1
  111. package/dist/legacy/components/PdfEditor/signature/SignatureSavedList.d.ts +1 -1
  112. package/dist/legacy/components/PdfEditor/signature/SignatureUploadDropzone.d.ts +1 -1
  113. package/dist/legacy/components/PdfEditor/signature/resolve-asset.d.ts +1 -1
  114. package/dist/legacy/components/PdfEditor/tools/FillFieldsTool.d.ts +1 -1
  115. package/dist/legacy/components/PdfEditor/tools/ShapeTool.d.ts +1 -1
  116. package/dist/legacy/components/PdfEditor/tools/SignatureTool.d.ts +1 -1
  117. package/dist/legacy/components/PdfEditor/tools/TextTool.d.ts +1 -1
  118. package/dist/legacy/components/PdfEditor/tools/Toolbar.d.ts +1 -1
  119. package/dist/legacy/components/PdfEditor/viewer/InsertPagesButton.d.ts +1 -1
  120. package/dist/legacy/components/PdfEditor/viewer/PageOverlay.d.ts +1 -1
  121. package/dist/legacy/components/PdfEditor/viewer/PageSidebar.d.ts +2 -2
  122. package/dist/legacy/components/PdfEditor/viewer/PageThumbnail.d.ts +2 -2
  123. package/dist/legacy/components/PdfEditor/viewer/PdfCanvas.d.ts +1 -1
  124. package/dist/legacy.js +26787 -209
  125. package/dist/rum/AbyssRumProvider.d.ts +5 -2
  126. package/dist/rum/abyss-rum-report.context.d.ts +14 -0
  127. package/dist/rum/index.d.ts +1 -0
  128. package/dist/rum/report-locale.d.ts +3 -0
  129. package/dist/rum/report-locale.spec.d.ts +1 -0
  130. package/dist/rum/track-key-action.d.ts +7 -0
  131. package/dist/rum/track-key-action.spec.d.ts +1 -0
  132. package/dist/sortable.esm-DM2HNEC7.js +69322 -0
  133. package/dist/translations/editors-i18n.spec.d.ts +1 -0
  134. package/dist/translations/en.d.ts +327 -0
  135. package/dist/translations/fr.d.ts +327 -0
  136. package/dist/{use-auth.hook-oRxzI95f.js → use-auth.hook-D8vfSYRv.js} +101 -101
  137. package/package.json +16 -9
  138. package/vite.config.ts +4 -0
  139. package/dist/index-DNe1tEo2.js +0 -95914
  140. package/test-results/catalog/.last-run.json +0 -4
  141. /package/dist/{legacy/components/PdfEditor/operations/apply.spec.d.ts → auth/components/shared/auth-errors.spec.d.ts} +0 -0
  142. /package/dist/{legacy/components/PdfEditor/operations/compute-page-order.spec.d.ts → components/editors/MarkdownEditor/MarkdownEditor.spec.d.ts} +0 -0
  143. /package/dist/{legacy/components/PdfEditor/operations/extract.spec.d.ts → components/editors/PdfEditor/PdfEditor.spec.d.ts} +0 -0
  144. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-acro-form-fields.d.ts +0 -0
  145. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-export.d.ts +0 -0
  146. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-page-order.d.ts +0 -0
  147. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-pdf-document.d.ts +0 -0
  148. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-undo-redo.d.ts +0 -0
  149. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/hooks/use-uploaded-docs.d.ts +0 -0
  150. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/actions.d.ts +0 -0
  151. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/apply.d.ts +0 -0
  152. /package/dist/{legacy/components/PdfEditor/operations/redact.spec.d.ts → components/editors/PdfEditor/engine/operations/apply.spec.d.ts} +0 -0
  153. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/compute-page-order.d.ts +0 -0
  154. /package/dist/{legacy/components/PdfEditor/operations/reducer.spec.d.ts → components/editors/PdfEditor/engine/operations/compute-page-order.spec.d.ts} +0 -0
  155. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/extract.d.ts +0 -0
  156. /package/dist/{legacy/components/PdfEditor/operations/rotate-coords.spec.d.ts → components/editors/PdfEditor/engine/operations/extract.spec.d.ts} +0 -0
  157. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/pdf-data-url.d.ts +0 -0
  158. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/rasterize.d.ts +0 -0
  159. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/redact.d.ts +0 -0
  160. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/reducer.d.ts +0 -0
  161. /package/dist/{legacy/components/PdfEditor → components/editors/PdfEditor/engine}/operations/rotate-coords.d.ts +0 -0
@@ -1,51 +1,51 @@
1
- import { SessionPlatform as j, AbyssCore as F, Code as x, AuthResultStatus as Z, MfaFactorType as q } from "@abyss-project/main";
2
- import { l as ee } from "./lazy-value-Co76vxsM.js";
3
- import { browserSupportsWebAuthn as I, startRegistration as te, browserSupportsWebAuthnAutofill as se, startAuthentication as ne, WebAuthnError as oe } from "@simplewebauthn/browser";
4
- import { a as f, A as p, s as re } from "./token-storage-CbWrBeIP.js";
5
- import { createContext as ae, useState as ie, useEffect as ue, useMemo as le, useContext as ce } from "react";
6
- import { jsx as de } from "react/jsx-runtime";
7
- const b = "abyss-login-redirect", fe = 3e5, N = ({
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
- }, xe = (e = window.location) => `${e.pathname}${e.search}`, qe = () => {
15
- const e = window.sessionStorage.getItem(b);
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 < fe ? !0 : (window.sessionStorage.removeItem(b), !1);
20
- }, $e = () => {
21
- window.sessionStorage.removeItem(b);
22
- }, We = (e) => {
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
- }, Ye = (e) => {
25
- window.sessionStorage.setItem(b, String(Date.now())), window.location.assign(N(e));
24
+ }, He = (e) => {
25
+ window.sessionStorage.setItem(k, String(Date.now())), window.location.assign(N(e));
26
26
  };
27
- let z = !1;
28
- const Be = () => z, He = async (e, { abyssSite: s, service: n }) => {
29
- z = !0;
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 pe = /* @__PURE__ */ ((e) => (e.LOADING = "loading", e.ANONYMOUS = "anonymous", e.AUTHENTICATED = "authenticated", e))(pe || {}), he = /* @__PURE__ */ ((e) => (e.PASSKEY = "passkey", e.TOTP = "totp", e.PASSWORD = "password", e.EMAIL_CODE = "email-code", e))(he || {});
37
- const we = 6e4, $ = 3e4, me = [
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
- ], Ee = [
41
+ ], ye = [
42
42
  7500,
43
43
  15e3,
44
44
  22500,
45
45
  27e3
46
- ], W = 3e4, ye = 5e3, Ae = "abyss-auth-refresh", Re = 2147483647, Te = "Token Expired", ge = (e) => typeof e == "object" && e !== null && e.isAxiosError === !0, Y = (e) => {
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 (!ge(e) || e.code === "ERR_CANCELED")
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
- }, _e = ee(
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 = _e().get(n);
77
+ const o = be().get(n);
78
78
  return o ? [o] : [];
79
79
  })
80
80
  } : {};
81
- }, be = (e) => new Promise((s) => setTimeout(s, e)), Se = () => typeof navigator > "u" || navigator.onLine !== !1, Le = () => typeof navigator > "u" ? null : navigator.locks ?? null, Ke = (e) => {
82
- const s = e.bridge.platform === j.WEB, n = e.isOnline ?? Se;
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
- }, k = () => {
91
+ }, b = () => {
92
92
  w && (clearTimeout(w), w = null), m && (clearTimeout(m), m = null);
93
- }, X = (t) => {
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 - we - Date.now(), 0),
99
- Re
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
- k(), t.refreshToken && await e.storage.setRefreshToken(t.refreshToken), C(t.accessToken), a = t.user, (i = e.onPersistUser) == null || i.call(e, t.user), S({
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
- }), X(t.accessTokenExpiresAt);
111
+ }), J(t.accessTokenExpiresAt);
112
112
  }, O = async () => {
113
113
  var t;
114
- T += 1, k(), d = null, await e.storage.setRefreshToken(null), C(null), a = null, (t = e.onPersistUser) == null || t.call(e, null), S({
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
- }, V = () => {
118
+ }, X = () => {
119
119
  if (d === null)
120
- return W;
121
- const t = Date.now() - d, i = Ee.find(
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, W) : i - t;
125
- }, Q = () => {
126
- k();
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
- }, V());
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
- ye
146
+ Ae
147
147
  );
148
148
  try {
149
149
  const A = await F.sdk.auth.refresh(
150
- t ? { refreshToken: t } : void 0,
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 = Y(A);
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 ? me : [];
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 be(h), t !== T))
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
- Q();
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 ? Le() : null;
214
- l = (t ? t.request(Ae, U) : U()).finally(() => {
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 = Y(c);
225
+ const h = B(c);
226
226
  if (h.kind !== "http")
227
227
  throw c;
228
- if (h.status === 401 && h.message === Te) {
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
- k(), g.clear(), _.clear(), typeof window < "u" && window.removeEventListener("online", L), typeof document < "u" && document.removeEventListener("visibilitychange", G);
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
- }, Ie = "Token Expired", ve = /(^|\/)auth\//, je = (e, s) => {
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) !== Ie || !a || a.abyssAuthReplayed || ve.test(a.url ?? ""))
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
- }, De = "https://accounts.google.com/gsi/client", Ne = "https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1.0/en_US/appleid.auth.js", v = /* @__PURE__ */ new Map(), B = (e) => {
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
- }, Ce = [
298
+ }, Pe = [
299
299
  "popup_closed_by_user",
300
300
  "user_cancelled_authorize"
301
- ], H = (e) => {
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 oe && e.code === "ERROR_CEREMONY_ABORTED" ? new f(p.CANCELLED, o, e) : new f(p.FAILED, o, e);
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
- ), ze = (e) => ({
311
- platform: j.WEB,
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 se())
316
+ if (n && !await ne())
317
317
  throw D("Passkey autofill");
318
318
  try {
319
- return await ne({
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 H(o);
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 te({
332
+ return await se({
333
333
  optionsJSON: s
334
334
  });
335
335
  } catch (n) {
336
- throw H(n);
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 B(De);
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 B(Ne);
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 re(s)
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" && Ce.includes(l) ? new f(p.CANCELLED, l, u) : new f(
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
- }), J = ae(null), Je = ({ client: e, children: s }) => {
427
- const [n, o] = ie(() => e.state());
428
- ue(() => {
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 = le(() => ({ state: n, client: e }), [n, e]);
434
- return /* @__PURE__ */ de(J.Provider, { value: r, children: s });
435
- }, Xe = () => {
436
- const e = ce(J);
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
- pe as A,
443
- De as G,
444
- b as L,
445
- he as R,
446
- W as U,
447
- fe as a,
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
- xe as c,
450
- $e as d,
451
- We as e,
452
- Ye as f,
453
- we as g,
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
- Be as i,
456
- me as j,
457
- Ee as k,
458
- He as l,
459
- ye as m,
460
- Ae as n,
461
- Ke as o,
462
- je as p,
463
- Ne as q,
464
- qe as r,
465
- ze as s,
466
- J as t,
467
- Je as u,
468
- Xe as v
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": "9.6.0",
3
+ "version": "10.1.0",
4
4
  "description": "Front Core package of AbyssProject",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -26,6 +26,10 @@
26
26
  "import": "./dist/legacy.js",
27
27
  "types": "./dist/legacy.d.ts"
28
28
  },
29
+ "./editors": {
30
+ "import": "./dist/editors.js",
31
+ "types": "./dist/editors.d.ts"
32
+ },
29
33
  "./fonts.css": "./dist/fonts.css",
30
34
  "./legacy/fonts.css": "./dist/legacy/fonts.css"
31
35
  },
@@ -42,6 +46,9 @@
42
46
  ],
43
47
  "legacy": [
44
48
  "./dist/legacy.d.ts"
49
+ ],
50
+ "editors": [
51
+ "./dist/editors.d.ts"
45
52
  ]
46
53
  }
47
54
  },
@@ -60,8 +67,8 @@
60
67
  "peerDependencies": {
61
68
  "@abyss-project/capacitor-auth": "^1.0.0",
62
69
  "@abyss-project/cloud": "^2.4.0",
63
- "@abyss-project/console": "^13.0.0",
64
- "@abyss-project/monitor-browser": "^1.3.2",
70
+ "@abyss-project/console": "^14.1.0",
71
+ "@abyss-project/monitor-browser": "^2.0.0",
65
72
  "@dnd-kit/core": "^6.0.0",
66
73
  "@dnd-kit/sortable": "^9.0.0",
67
74
  "@dnd-kit/utilities": "^3.0.0",
@@ -80,7 +87,7 @@
80
87
  "react-is": "^18.0.0 || ^19.0.0",
81
88
  "react-router-dom": "^6.15.0",
82
89
  "zustand": "^5.0.0",
83
- "@abyss-project/main": "19.0.0"
90
+ "@abyss-project/main": "23.0.0"
84
91
  },
85
92
  "peerDependenciesMeta": {
86
93
  "@abyss-project/capacitor-auth": {
@@ -92,9 +99,9 @@
92
99
  "@abyss-project/crypt": "^1.0.9",
93
100
  "@abyss-project/form": "^1.0.13",
94
101
  "@abyss-project/memories": "^1.0.12",
95
- "@abyss-project/monitor": "^10.0.0",
102
+ "@abyss-project/monitor": "^16.2.0",
96
103
  "@abyss-project/spotlight": "^1.4.0",
97
- "@abyss-project/storage": "^1.0.30",
104
+ "@abyss-project/storage": "^3.1.0",
98
105
  "@capacitor/clipboard": "^7.0.1",
99
106
  "@capacitor/core": "^7.4.0",
100
107
  "@capacitor/share": "^7.0.1",
@@ -130,12 +137,12 @@
130
137
  "use-debounce": "^10.0.5",
131
138
  "uuid": "^9.0.0",
132
139
  "yup": "^0.32.11",
133
- "@abyss-project/main": "19.0.0"
140
+ "@abyss-project/main": "23.0.0"
134
141
  },
135
142
  "devDependencies": {
136
143
  "@abyss-project/cloud": "^2.4.0",
137
- "@abyss-project/console": "^13.0.0",
138
- "@abyss-project/monitor-browser": "^1.3.2",
144
+ "@abyss-project/console": "^14.1.0",
145
+ "@abyss-project/monitor-browser": "^2.0.0",
139
146
  "@playwright/test": "^1.52.0",
140
147
  "@testing-library/react": "^16.3.2",
141
148
  "@types/byte-size": "^8.1.0",
package/vite.config.ts CHANGED
@@ -79,6 +79,10 @@ export default defineConfig({
79
79
  // The previous design system (theme, visual components, their visual utils and hooks),
80
80
  // isolated until every app has migrated off it (ADR-0174 §2). Public subpath `./legacy`.
81
81
  legacy: resolve(__dirname, 'src/legacy/index.ts'),
82
+ // The editors (Markdown, PDF), out of the main barrel: they carry Milkdown Crepe, pdf.js
83
+ // and pdf-lib, which an app that imports anything from the root would otherwise ship.
84
+ // Public subpath `./editors`.
85
+ editors: resolve(__dirname, 'src/editors.ts'),
82
86
  },
83
87
  formats: ['es'],
84
88
  fileName: (_format, entryName) => `${entryName}.js`,