@abyss-project/commons-front-core 17.2.0 → 18.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/README.md +2 -1
  3. package/catalog/captures-plan.ts +120 -116
  4. package/catalog/catalog-entries.ts +149 -148
  5. package/catalog/pages/AppShell.tsx +18 -9
  6. package/catalog/pages/CookieConsent.tsx +54 -31
  7. package/catalog/pages/DeliveryHistory.tsx +66 -66
  8. package/catalog/pages/DeliverySubscriptions.tsx +110 -110
  9. package/catalog/pages/ScheduledTasks.tsx +117 -117
  10. package/catalog/pages/index.ts +166 -165
  11. package/catalog/playwright.ci.config.ts +4 -3
  12. package/catalog/specs/captures.spec.ts +145 -145
  13. package/catalog/specs/cookie-consent-modal.spec.ts +187 -0
  14. package/catalog/specs/responsive.spec.ts +106 -0
  15. package/catalog/specs/write-capture-index.ts +81 -81
  16. package/dist/CookieConsentSettings-B7HIIzyI.js +595 -0
  17. package/dist/{Surface-BUxzLLhb.js → Surface-dziv23sf.js} +60 -53
  18. package/dist/{Tabs-D7TDtprO.js → Tabs-_onUZBA-.js} +613 -591
  19. package/dist/components/business/CookieConsent/AbyssCookieConsentProvider.d.ts +11 -3
  20. package/dist/components/business/CookieConsent/CookieConsentBanner.d.ts +4 -3
  21. package/dist/components/business/CookieConsent/CookieConsentPreferences.d.ts +12 -0
  22. package/dist/components/business/CookieConsent/index.d.ts +2 -0
  23. package/dist/components/business/CookieConsent/use-banner-portal.d.ts +36 -0
  24. package/dist/components/inputs/NumberField/NumberField.d.ts +18 -2
  25. package/dist/components/layers/Toast/toast-clearance.d.ts +5 -0
  26. package/dist/components/structure/AccountMenu/AccountMenu.d.ts +2 -1
  27. package/dist/components/structure/AppShell/SpaceSwitcher.d.ts +4 -2
  28. package/dist/components/structure/AppShell/app-shell.types.d.ts +5 -1
  29. package/dist/components/structure/FilterBar/FilterBar.d.ts +7 -2
  30. package/dist/cookie-consent.js +26 -17
  31. package/dist/{design-theme-Bc2sMuUP.js → design-theme-B3C3z1gE.js} +1 -1
  32. package/dist/{editors-CGj-vsZu.js → editors-BhQlONOy.js} +27 -27
  33. package/dist/editors.js +1 -1
  34. package/dist/hooks/use-cookie-consent.hook.spec.d.ts +1 -0
  35. package/dist/hooks/use-rich-intl.hook.d.ts +4 -0
  36. package/dist/{index-DOrEPYZN.js → index-B6LMTOKG.js} +3 -3
  37. package/dist/{index-853Jaoqw.js → index-B6w5_TeJ.js} +3 -3
  38. package/dist/{index-BVsU-XEb.js → index-BBF-FvT6.js} +2 -2
  39. package/dist/{index-5lpeThh7.js → index-BGAZK8Vk.js} +2 -2
  40. package/dist/{index-DKMFAW5f.js → index-BGJobvxw.js} +1 -1
  41. package/dist/{index-DvrKcy8f.js → index-BTDlbjWW.js} +2 -2
  42. package/dist/{index-DrgdyC6J.js → index-BcjlG5TB.js} +2 -2
  43. package/dist/{index-CNfYiPB9.js → index-BeMiREqf.js} +2 -2
  44. package/dist/{index-YX_yu3BN.js → index-ByN6DcaL.js} +2 -2
  45. package/dist/{index-_3uQ1KPn.js → index-CJI1dJrw.js} +3 -3
  46. package/dist/{index-BISOeVc7.js → index-D1mQgWN3.js} +2 -2
  47. package/dist/{index-DykCZUJc.js → index-DLlWMDxB.js} +4 -4
  48. package/dist/{index-BS3QPrVM.js → index-DNd8NZnu.js} +4 -4
  49. package/dist/{index-CTsQY6zW.js → index-Dakpr4C1.js} +3 -3
  50. package/dist/{index-B4PJ4K6l.js → index-DkZAsKob.js} +2 -2
  51. package/dist/{index-CYmjv9TK.js → index-DprTO7yi.js} +4 -4
  52. package/dist/{index-a62vDo6s.js → index-N4BwXTyk.js} +2 -2
  53. package/dist/{index-DfnEQYyW.js → index-V4F4Sk7y.js} +2 -2
  54. package/dist/{index-DxZ1bG6u.js → index-y-TnfE6Z.js} +2 -2
  55. package/dist/{index-CONaN903.js → index-yFJTDKIX.js} +2 -2
  56. package/dist/{index-Bxpp4VC9.js → index-ytgNPz5f.js} +2 -2
  57. package/dist/index.js +3482 -3419
  58. package/dist/legacy.js +1728 -1707
  59. package/dist/translations/en.d.ts +2 -0
  60. package/dist/translations/fr.d.ts +2 -0
  61. package/dist/utils/cookie-consent-contract.d.ts +55 -0
  62. package/dist/utils/cookie-consent-contract.spec.d.ts +1 -0
  63. package/dist/utils/cookie-storage.utils.d.ts +1 -8
  64. package/dist/utils/index.d.ts +1 -0
  65. package/package.json +1 -1
  66. package/dist/CookieConsentSettings-DHpcYTa2.js +0 -505
@@ -1,11 +1,11 @@
1
1
  import { jsx as d, jsxs as C } from "react/jsx-runtime";
2
- import { useId as x, useRef as Y, useState as H, useCallback as X, useMemo as re, forwardRef as ae } from "react";
2
+ import { useId as x, useRef as Y, useState as V, useCallback as X, useMemo as re, forwardRef as ae } from "react";
3
3
  import { useIntl as G } from "react-intl";
4
4
  import ne from "@mui/material/Dialog";
5
5
  import J from "@mui/material/IconButton";
6
6
  import { alpha as se, styled as g, useTheme as le } from "@mui/material/styles";
7
7
  import $ from "@mui/icons-material/Close";
8
- import V from "@mui/material/useMediaQuery";
8
+ import H from "@mui/material/useMediaQuery";
9
9
  import ce from "@mui/material/Modal";
10
10
  import de from "@mui/material/Slide";
11
11
  import { enTranslation as ue, frTranslation as pe } from "@abyss-project/main";
@@ -62,11 +62,11 @@ const ge = 266, c = (e, t) => ({ l: e, c: t, h: ge }), mt = {
62
62
  sm: 4,
63
63
  md: 6,
64
64
  lg: 12
65
- }, vt = {
65
+ }, yt = {
66
66
  fast: 120,
67
67
  base: 180,
68
68
  slow: 260
69
- }, yt = {
69
+ }, vt = {
70
70
  standard: "cubic-bezier(0.2, 0, 0, 1)",
71
71
  sheet: "cubic-bezier(0.32, 0.72, 0, 1)"
72
72
  }, j = {
@@ -119,17 +119,17 @@ const ee = {
119
119
  [w.down(R.Tablet)]: {
120
120
  minHeight: a(e.design.densityValues.touchTarget)
121
121
  }
122
- }), ve = (e) => ({
122
+ }), ye = (e) => ({
123
123
  [w.down(R.Tablet)]: {
124
124
  minWidth: a(e.design.densityValues.touchTarget),
125
125
  minHeight: a(e.design.densityValues.touchTarget)
126
126
  }
127
- }), ye = (e, t, o = "fast") => t.map(
127
+ }), ve = (e, t, o = "fast") => t.map(
128
128
  (i) => `${i} ${e.design.durations[o]}ms ${e.design.easings.standard}`
129
129
  ).join(", "), Ee = () => {
130
- const e = V(w.up(R.Desktop), {
130
+ const e = H(w.up(R.Desktop), {
131
131
  noSsr: !0
132
- }), t = V(w.down(R.Tablet), {
132
+ }), t = H(w.down(R.Tablet), {
133
133
  noSsr: !0
134
134
  });
135
135
  return e ? R.Desktop : t ? R.Mobile : R.Tablet;
@@ -170,7 +170,7 @@ const P = (e, t) => `calc(${a(t)} + env(safe-area-inset-${e}))`, be = 0.3, Se =
170
170
  position: "absolute",
171
171
  top: a(e.design.space[1]),
172
172
  right: P(_.Right, e.design.space[2]),
173
- ...ve(e)
173
+ ...ye(e)
174
174
  })), Re = g("div")(({ theme: e }) => {
175
175
  const { space: t, densityValues: o } = e.design;
176
176
  return {
@@ -222,7 +222,7 @@ function De({
222
222
  closeLabel: r,
223
223
  children: n
224
224
  }) {
225
- const h = le(), v = G(), y = x(), f = Y(null), A = Y(null), [E, N] = H(0), [u, l] = H(!1), s = (T) => {
225
+ const h = le(), y = G(), v = x(), f = Y(null), A = Y(null), [E, N] = V(0), [u, l] = V(!1), s = (T) => {
226
226
  T.currentTarget.setPointerCapture(T.pointerId), A.current = T.clientY, l(!0);
227
227
  }, p = (T) => {
228
228
  A.current !== null && N(Math.max(0, T.clientY - A.current));
@@ -248,11 +248,14 @@ function De({
248
248
  ref: f,
249
249
  role: "dialog",
250
250
  "aria-modal": "true",
251
- "aria-labelledby": o ? y : void 0,
252
- "aria-label": o ? void 0 : v.formatMessage({ id: "ds.mobile.bottom-sheet.label" }),
251
+ "aria-labelledby": o ? v : void 0,
252
+ "aria-label": o ? void 0 : y.formatMessage({ id: "ds.mobile.bottom-sheet.label" }),
253
253
  tabIndex: -1,
254
254
  style: {
255
- transform: `translateY(${a(E)})`,
255
+ // No transform at rest: a transformed panel is the containing block of whatever is
256
+ // `position: fixed` inside it (the cookie banner hosted by the sheet), and would anchor it to
257
+ // the panel instead of the viewport.
258
+ transform: E === 0 && !u ? "none" : `translateY(${a(E)})`,
256
259
  transition: u ? "none" : `transform ${h.design.durations.base}ms ${h.design.easings.sheet}`
257
260
  },
258
261
  children: [
@@ -266,7 +269,7 @@ function De({
266
269
  onPointerCancel: S,
267
270
  children: [
268
271
  /* @__PURE__ */ d(Ce, { "aria-hidden": "true" }),
269
- o ? /* @__PURE__ */ C(Ie, { id: y, besideClose: r !== void 0, children: [
272
+ o ? /* @__PURE__ */ C(Ie, { id: v, besideClose: r !== void 0, children: [
270
273
  i !== void 0 && /* @__PURE__ */ d(Oe, { "aria-hidden": "true", children: i }),
271
274
  o
272
275
  ] }) : null
@@ -367,9 +370,9 @@ function Rt({
367
370
  description: r,
368
371
  size: n = "md",
369
372
  actions: h,
370
- children: v
373
+ children: y
371
374
  }) {
372
- const y = G(), f = Ee() === R.Mobile, A = x(), E = x();
375
+ const v = G(), f = Ee() === R.Mobile, A = x(), E = x();
373
376
  return f ? /* @__PURE__ */ C(
374
377
  De,
375
378
  {
@@ -377,10 +380,10 @@ function Rt({
377
380
  onClose: t,
378
381
  title: o,
379
382
  titleIcon: i,
380
- closeLabel: y.formatMessage({ id: "ds.layers.modal.close" }),
383
+ closeLabel: v.formatMessage({ id: "ds.layers.modal.close" }),
381
384
  children: [
382
385
  r !== void 0 && /* @__PURE__ */ d(ze, { children: r }),
383
- v,
386
+ y,
384
387
  h !== void 0 && /* @__PURE__ */ d(Ye, { children: h })
385
388
  ]
386
389
  }
@@ -405,13 +408,13 @@ function Rt({
405
408
  /* @__PURE__ */ d(
406
409
  J,
407
410
  {
408
- "aria-label": y.formatMessage({ id: "ds.layers.modal.close" }),
411
+ "aria-label": v.formatMessage({ id: "ds.layers.modal.close" }),
409
412
  onClick: t,
410
413
  children: /* @__PURE__ */ d($, { "aria-hidden": !0 })
411
414
  }
412
415
  )
413
416
  ] }),
414
- /* @__PURE__ */ d(Ge, { children: v }),
417
+ /* @__PURE__ */ d(Ge, { children: y }),
415
418
  h !== void 0 && /* @__PURE__ */ d(Be, { children: h })
416
419
  ]
417
420
  }
@@ -540,19 +543,19 @@ const q = (e) => e, te = {
540
543
  })
541
544
  };
542
545
  var D = /* @__PURE__ */ ((e) => (e.FREEMIUM = "FREEMIUM", e.DEFAULT = "DEFAULT", e.CUSTOM = "CUSTOM", e.SYSTEM = "SYSTEM", e))(D || {}), O = /* @__PURE__ */ ((e) => (e.FREEMIUM = "freemium", e.STARTER = "starter", e.PRO = "pro", e.ENTERPRISE = "enterprise", e.CUSTOM = "custom", e.INTERNAL = "internal", e.FAMILY_FREE = "family-free", e.FAMILY_PAID = "family-paid", e.DEMO = "demo", e))(O || {});
543
- const He = {
546
+ const Ve = {
544
547
  [D.FREEMIUM]: O.FREEMIUM,
545
548
  [D.DEFAULT]: "paid",
546
549
  [D.SYSTEM]: O.INTERNAL,
547
550
  [D.CUSTOM]: O.CUSTOM
548
- }, Ve = new Set(Object.values(O)), U = (e) => e ? e.tier === D.CUSTOM ? O.CUSTOM : e.catalogKey && Ve.has(e.catalogKey) ? e.catalogKey : He[e.tier] ?? "paid" : O.FREEMIUM, Ct = (e, t) => {
549
- const o = (v) => {
550
- const y = e[`${v}Tier`];
551
- if (typeof y != "string")
551
+ }, He = new Set(Object.values(O)), U = (e) => e ? e.tier === D.CUSTOM ? O.CUSTOM : e.catalogKey && He.has(e.catalogKey) ? e.catalogKey : Ve[e.tier] ?? "paid" : O.FREEMIUM, Ct = (e, t) => {
552
+ const o = (y) => {
553
+ const v = e[`${y}Tier`];
554
+ if (typeof v != "string")
552
555
  return null;
553
- const f = e[`${v}CatalogKey`];
556
+ const f = e[`${y}CatalogKey`];
554
557
  return {
555
- tier: y,
558
+ tier: v,
556
559
  catalogKey: typeof f == "string" ? f : null
557
560
  };
558
561
  }, i = {}, r = o("plan"), n = o("oldPlan"), h = o("newPlan");
@@ -722,13 +725,14 @@ const He = {
722
725
  cookies: {
723
726
  banner: {
724
727
  title: "Vos préférences de cookies",
725
- description: "Nous utilisons des cookies pour faire fonctionner notre service, mesurer son audience et améliorer votre expérience. Vous pouvez accepter, refuser ou personnaliser à tout moment.",
728
+ description: "Nous utilisons des cookies pour faire fonctionner notre service et, avec votre accord, mesurer son audience avec le suivi d'usage d'Abyss. Votre choix est conservé six mois et vous pouvez le modifier à tout moment.",
726
729
  "privacy-link": "En savoir plus"
727
730
  },
728
731
  action: {
729
732
  "accept-all": "Tout accepter",
730
733
  "reject-all": "Tout refuser",
731
734
  configure: "Personnaliser",
735
+ manage: "Gérer les cookies",
732
736
  cancel: "Annuler",
733
737
  save: "Enregistrer mes choix"
734
738
  },
@@ -743,7 +747,7 @@ const He = {
743
747
  },
744
748
  analytics: {
745
749
  title: "Mesure d'audience",
746
- description: "Nous aident à comprendre l'usage de l'application pour l'améliorer."
750
+ description: "Le suivi d'usage d'Abyss (parcours, performances, erreurs, relecture de session) nous aide à améliorer l'application."
747
751
  },
748
752
  marketing: {
749
753
  title: "Marketing",
@@ -1469,7 +1473,7 @@ const He = {
1469
1473
  JSON: "JSON",
1470
1474
  DISCORD: "Discord"
1471
1475
  },
1472
- "duration-ms": "{value} ms",
1476
+ "duration-ms": "{value, number} ms",
1473
1477
  subscriptions: {
1474
1478
  label: "Abonnements de livraison",
1475
1479
  pagination: "Pages des abonnements",
@@ -1540,6 +1544,7 @@ const He = {
1540
1544
  headers: "En-têtes envoyés",
1541
1545
  response: "Réponse",
1542
1546
  "response-code": "Code de réponse",
1547
+ duration: "Durée",
1543
1548
  "response-body": "Extrait de la réponse",
1544
1549
  error: "Dernière erreur",
1545
1550
  timeline: "Déroulé",
@@ -3134,13 +3139,14 @@ const He = {
3134
3139
  cookies: {
3135
3140
  banner: {
3136
3141
  title: "Your cookie preferences",
3137
- description: "We use cookies to run our service, measure audience, and improve your experience. You can accept, reject, or customise at any time.",
3142
+ description: "We use cookies to run our service and, with your agreement, to measure its audience with Abyss usage tracking. Your choice is kept for six months and you can change it at any time.",
3138
3143
  "privacy-link": "Learn more"
3139
3144
  },
3140
3145
  action: {
3141
3146
  "accept-all": "Accept all",
3142
3147
  "reject-all": "Reject all",
3143
3148
  configure: "Customise",
3149
+ manage: "Manage cookies",
3144
3150
  cancel: "Cancel",
3145
3151
  save: "Save my choices"
3146
3152
  },
@@ -3155,7 +3161,7 @@ const He = {
3155
3161
  },
3156
3162
  analytics: {
3157
3163
  title: "Analytics",
3158
- description: "Help us understand how the app is used so we can improve it."
3164
+ description: "Abyss usage tracking (journeys, performance, errors, session replay) helps us improve the app."
3159
3165
  },
3160
3166
  marketing: {
3161
3167
  title: "Marketing",
@@ -3862,7 +3868,7 @@ const He = {
3862
3868
  JSON: "JSON",
3863
3869
  DISCORD: "Discord"
3864
3870
  },
3865
- "duration-ms": "{value} ms",
3871
+ "duration-ms": "{value, number} ms",
3866
3872
  subscriptions: {
3867
3873
  label: "Delivery subscriptions",
3868
3874
  pagination: "Subscription pages",
@@ -3933,6 +3939,7 @@ const He = {
3933
3939
  headers: "Headers sent",
3934
3940
  response: "Response",
3935
3941
  "response-code": "Response code",
3942
+ duration: "Duration",
3936
3943
  "response-body": "Response excerpt",
3937
3944
  error: "Last error",
3938
3945
  timeline: "Timeline",
@@ -5419,11 +5426,11 @@ function Xe() {
5419
5426
  }
5420
5427
  function o(r, n) {
5421
5428
  n = n || {};
5422
- const h = n.delimiter || ".", v = n.maxDepth, y = n.transformKey || t, f = {};
5429
+ const h = n.delimiter || ".", y = n.maxDepth, v = n.transformKey || t, f = {};
5423
5430
  function A(E, N, u) {
5424
5431
  u = u || 1, Object.keys(E).forEach(function(l) {
5425
- const s = E[l], p = n.safe && Array.isArray(s), b = Object.prototype.toString.call(s), S = e(s), T = b === "[object Object]" || b === "[object Array]", I = N ? N + h + y(l) : y(l);
5426
- if (!p && !S && T && Object.keys(s).length && (!n.maxDepth || u < v))
5432
+ const s = E[l], p = n.safe && Array.isArray(s), b = Object.prototype.toString.call(s), S = e(s), T = b === "[object Object]" || b === "[object Array]", I = N ? N + h + v(l) : v(l);
5433
+ if (!p && !S && T && Object.keys(s).length && (!n.maxDepth || u < y))
5427
5434
  return A(s, I, u + 1);
5428
5435
  f[I] = s;
5429
5436
  });
@@ -5432,7 +5439,7 @@ function Xe() {
5432
5439
  }
5433
5440
  function i(r, n) {
5434
5441
  n = n || {};
5435
- const h = n.delimiter || ".", v = n.overwrite || !1, y = n.transformKey || t, f = {};
5442
+ const h = n.delimiter || ".", y = n.overwrite || !1, v = n.transformKey || t, f = {};
5436
5443
  if (e(r) || Object.prototype.toString.call(r) !== "[object Object]")
5437
5444
  return r;
5438
5445
  function E(l) {
@@ -5461,15 +5468,15 @@ function Xe() {
5461
5468
  o(r[s], n)
5462
5469
  );
5463
5470
  }, {}), Object.keys(r).forEach(function(l) {
5464
- const s = l.split(h).map(y);
5471
+ const s = l.split(h).map(v);
5465
5472
  let p = E(s.shift()), b = E(s[0]), S = f;
5466
5473
  for (; b !== void 0; ) {
5467
5474
  if (p === "__proto__")
5468
5475
  return;
5469
5476
  const T = Object.prototype.toString.call(S[p]), I = T === "[object Object]" || T === "[object Array]";
5470
- if (!v && !I && typeof S[p] < "u")
5477
+ if (!y && !I && typeof S[p] < "u")
5471
5478
  return;
5472
- (v && !I || !v && S[p] == null) && (S[p] = typeof b == "number" && !n.object ? [] : {}), S = S[p], s.length > 0 && (p = E(s.shift()), b = E(s[0]));
5479
+ (y && !I || !y && S[p] == null) && (S[p] = typeof b == "number" && !n.object ? [] : {}), S = S[p], s.length > 0 && (p = E(s.shift()), b = E(s[0]));
5473
5480
  }
5474
5481
  S[p] = i(r[l], n);
5475
5482
  }), f;
@@ -5528,7 +5535,7 @@ const ie = {
5528
5535
  font: "inherit",
5529
5536
  textAlign: "inherit",
5530
5537
  textDecoration: "none",
5531
- transition: ye(e, ["border-color"]),
5538
+ transition: ve(e, ["border-color"]),
5532
5539
  "&:hover": { borderColor: o["border.strong"] },
5533
5540
  "&:focus-visible": Ae(e)
5534
5541
  }
@@ -5540,8 +5547,8 @@ const ie = {
5540
5547
  children: r,
5541
5548
  onKeyDown: n,
5542
5549
  role: h,
5543
- tabIndex: v,
5544
- ...y
5550
+ tabIndex: y,
5551
+ ...v
5545
5552
  }, f) {
5546
5553
  const A = t && typeof i == "string" && !Ze.has(i), E = X(
5547
5554
  (u) => {
@@ -5556,11 +5563,11 @@ const ie = {
5556
5563
  as: i,
5557
5564
  ownerState: { interactive: t, padding: o },
5558
5565
  role: h ?? (A ? "button" : void 0),
5559
- tabIndex: v ?? (A ? 0 : void 0),
5566
+ tabIndex: y ?? (A ? 0 : void 0),
5560
5567
  onKeyDown: (u) => {
5561
5568
  n == null || n(u), A && !u.defaultPrevented && u.target === u.currentTarget && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.currentTarget.click());
5562
5569
  },
5563
- ...y,
5570
+ ...v,
5564
5571
  children: r
5565
5572
  }
5566
5573
  );
@@ -5579,18 +5586,18 @@ export {
5579
5586
  Ct as K,
5580
5587
  Rt as M,
5581
5588
  Qe as R,
5582
- _t as S,
5589
+ _ as S,
5583
5590
  me as T,
5584
5591
  Z as a,
5585
- Pe as b,
5586
- ve as c,
5592
+ _t as b,
5593
+ Pe as c,
5587
5594
  w as d,
5588
5595
  ye as e,
5589
5596
  It as f,
5590
- Ae as g,
5597
+ ve as g,
5591
5598
  L as h,
5592
- Ee as i,
5593
- _ as j,
5599
+ Ae as i,
5600
+ Ee as j,
5594
5601
  be as k,
5595
5602
  ft as l,
5596
5603
  St as m,
@@ -5605,6 +5612,6 @@ export {
5605
5612
  fe as v,
5606
5613
  P as w,
5607
5614
  Tt as x,
5608
- vt as y,
5609
- yt as z
5615
+ yt as y,
5616
+ vt as z
5610
5617
  };