@abyss-project/commons-front-core 17.2.1 → 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 (65) hide show
  1. package/CHANGELOG.md +16 -0
  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/write-capture-index.ts +81 -81
  15. package/dist/CookieConsentSettings-B7HIIzyI.js +595 -0
  16. package/dist/{Surface-BDfRxVLj.js → Surface-dziv23sf.js} +56 -51
  17. package/dist/{Tabs-DEY2HEqj.js → Tabs-_onUZBA-.js} +613 -591
  18. package/dist/components/business/CookieConsent/AbyssCookieConsentProvider.d.ts +11 -3
  19. package/dist/components/business/CookieConsent/CookieConsentBanner.d.ts +4 -3
  20. package/dist/components/business/CookieConsent/CookieConsentPreferences.d.ts +12 -0
  21. package/dist/components/business/CookieConsent/index.d.ts +2 -0
  22. package/dist/components/business/CookieConsent/use-banner-portal.d.ts +36 -0
  23. package/dist/components/inputs/NumberField/NumberField.d.ts +18 -2
  24. package/dist/components/layers/Toast/toast-clearance.d.ts +5 -0
  25. package/dist/components/structure/AccountMenu/AccountMenu.d.ts +2 -1
  26. package/dist/components/structure/AppShell/SpaceSwitcher.d.ts +4 -2
  27. package/dist/components/structure/AppShell/app-shell.types.d.ts +5 -1
  28. package/dist/components/structure/FilterBar/FilterBar.d.ts +7 -2
  29. package/dist/cookie-consent.js +26 -17
  30. package/dist/{design-theme-Bd0pEPei.js → design-theme-B3C3z1gE.js} +1 -1
  31. package/dist/{editors-CtkDomwX.js → editors-BhQlONOy.js} +27 -27
  32. package/dist/editors.js +1 -1
  33. package/dist/hooks/use-cookie-consent.hook.spec.d.ts +1 -0
  34. package/dist/hooks/use-rich-intl.hook.d.ts +2 -0
  35. package/dist/{index-DKsvuaEj.js → index-B6LMTOKG.js} +3 -3
  36. package/dist/{index-B9avfa3r.js → index-B6w5_TeJ.js} +3 -3
  37. package/dist/{index-Ch8JqU5w.js → index-BBF-FvT6.js} +2 -2
  38. package/dist/{index-CqgMX8kF.js → index-BGAZK8Vk.js} +2 -2
  39. package/dist/{index-DnQguWf1.js → index-BGJobvxw.js} +1 -1
  40. package/dist/{index-SN7FZBya.js → index-BTDlbjWW.js} +2 -2
  41. package/dist/{index-Cl3hwdsZ.js → index-BcjlG5TB.js} +2 -2
  42. package/dist/{index-CSdO6zlX.js → index-BeMiREqf.js} +2 -2
  43. package/dist/{index-psJ1Q-lU.js → index-ByN6DcaL.js} +2 -2
  44. package/dist/{index-DtpGwH5a.js → index-CJI1dJrw.js} +3 -3
  45. package/dist/{index-CEjiERmo.js → index-D1mQgWN3.js} +2 -2
  46. package/dist/{index-BcXqvMY8.js → index-DLlWMDxB.js} +4 -4
  47. package/dist/{index-DFZlN4E3.js → index-DNd8NZnu.js} +4 -4
  48. package/dist/{index-mUtvzoSi.js → index-Dakpr4C1.js} +3 -3
  49. package/dist/{index-D0EF36wh.js → index-DkZAsKob.js} +2 -2
  50. package/dist/{index-FUuoLSZ0.js → index-DprTO7yi.js} +4 -4
  51. package/dist/{index-DZbCUZUp.js → index-N4BwXTyk.js} +2 -2
  52. package/dist/{index-IVjoNq-p.js → index-V4F4Sk7y.js} +2 -2
  53. package/dist/{index-DcV2fWbx.js → index-y-TnfE6Z.js} +2 -2
  54. package/dist/{index-DtncSsmw.js → index-yFJTDKIX.js} +2 -2
  55. package/dist/{index-DVBqUPxf.js → index-ytgNPz5f.js} +2 -2
  56. package/dist/index.js +3480 -3417
  57. package/dist/legacy.js +1728 -1707
  58. package/dist/translations/en.d.ts +1 -0
  59. package/dist/translations/fr.d.ts +1 -0
  60. package/dist/utils/cookie-consent-contract.d.ts +55 -0
  61. package/dist/utils/cookie-consent-contract.spec.d.ts +1 -0
  62. package/dist/utils/cookie-storage.utils.d.ts +1 -8
  63. package/dist/utils/index.d.ts +1 -0
  64. package/package.json +1 -1
  65. package/dist/CookieConsentSettings-CtLrSfve.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",
@@ -3135,13 +3139,14 @@ const He = {
3135
3139
  cookies: {
3136
3140
  banner: {
3137
3141
  title: "Your cookie preferences",
3138
- 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.",
3139
3143
  "privacy-link": "Learn more"
3140
3144
  },
3141
3145
  action: {
3142
3146
  "accept-all": "Accept all",
3143
3147
  "reject-all": "Reject all",
3144
3148
  configure: "Customise",
3149
+ manage: "Manage cookies",
3145
3150
  cancel: "Cancel",
3146
3151
  save: "Save my choices"
3147
3152
  },
@@ -3156,7 +3161,7 @@ const He = {
3156
3161
  },
3157
3162
  analytics: {
3158
3163
  title: "Analytics",
3159
- 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."
3160
3165
  },
3161
3166
  marketing: {
3162
3167
  title: "Marketing",
@@ -5421,11 +5426,11 @@ function Xe() {
5421
5426
  }
5422
5427
  function o(r, n) {
5423
5428
  n = n || {};
5424
- 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 = {};
5425
5430
  function A(E, N, u) {
5426
5431
  u = u || 1, Object.keys(E).forEach(function(l) {
5427
- 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);
5428
- 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))
5429
5434
  return A(s, I, u + 1);
5430
5435
  f[I] = s;
5431
5436
  });
@@ -5434,7 +5439,7 @@ function Xe() {
5434
5439
  }
5435
5440
  function i(r, n) {
5436
5441
  n = n || {};
5437
- 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 = {};
5438
5443
  if (e(r) || Object.prototype.toString.call(r) !== "[object Object]")
5439
5444
  return r;
5440
5445
  function E(l) {
@@ -5463,15 +5468,15 @@ function Xe() {
5463
5468
  o(r[s], n)
5464
5469
  );
5465
5470
  }, {}), Object.keys(r).forEach(function(l) {
5466
- const s = l.split(h).map(y);
5471
+ const s = l.split(h).map(v);
5467
5472
  let p = E(s.shift()), b = E(s[0]), S = f;
5468
5473
  for (; b !== void 0; ) {
5469
5474
  if (p === "__proto__")
5470
5475
  return;
5471
5476
  const T = Object.prototype.toString.call(S[p]), I = T === "[object Object]" || T === "[object Array]";
5472
- if (!v && !I && typeof S[p] < "u")
5477
+ if (!y && !I && typeof S[p] < "u")
5473
5478
  return;
5474
- (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]));
5475
5480
  }
5476
5481
  S[p] = i(r[l], n);
5477
5482
  }), f;
@@ -5530,7 +5535,7 @@ const ie = {
5530
5535
  font: "inherit",
5531
5536
  textAlign: "inherit",
5532
5537
  textDecoration: "none",
5533
- transition: ye(e, ["border-color"]),
5538
+ transition: ve(e, ["border-color"]),
5534
5539
  "&:hover": { borderColor: o["border.strong"] },
5535
5540
  "&:focus-visible": Ae(e)
5536
5541
  }
@@ -5542,8 +5547,8 @@ const ie = {
5542
5547
  children: r,
5543
5548
  onKeyDown: n,
5544
5549
  role: h,
5545
- tabIndex: v,
5546
- ...y
5550
+ tabIndex: y,
5551
+ ...v
5547
5552
  }, f) {
5548
5553
  const A = t && typeof i == "string" && !Ze.has(i), E = X(
5549
5554
  (u) => {
@@ -5558,11 +5563,11 @@ const ie = {
5558
5563
  as: i,
5559
5564
  ownerState: { interactive: t, padding: o },
5560
5565
  role: h ?? (A ? "button" : void 0),
5561
- tabIndex: v ?? (A ? 0 : void 0),
5566
+ tabIndex: y ?? (A ? 0 : void 0),
5562
5567
  onKeyDown: (u) => {
5563
5568
  n == null || n(u), A && !u.defaultPrevented && u.target === u.currentTarget && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.currentTarget.click());
5564
5569
  },
5565
- ...y,
5570
+ ...v,
5566
5571
  children: r
5567
5572
  }
5568
5573
  );
@@ -5581,18 +5586,18 @@ export {
5581
5586
  Ct as K,
5582
5587
  Rt as M,
5583
5588
  Qe as R,
5584
- _t as S,
5589
+ _ as S,
5585
5590
  me as T,
5586
5591
  Z as a,
5587
- Pe as b,
5588
- ve as c,
5592
+ _t as b,
5593
+ Pe as c,
5589
5594
  w as d,
5590
5595
  ye as e,
5591
5596
  It as f,
5592
- Ae as g,
5597
+ ve as g,
5593
5598
  L as h,
5594
- Ee as i,
5595
- _ as j,
5599
+ Ae as i,
5600
+ Ee as j,
5596
5601
  be as k,
5597
5602
  ft as l,
5598
5603
  St as m,
@@ -5607,6 +5612,6 @@ export {
5607
5612
  fe as v,
5608
5613
  P as w,
5609
5614
  Tt as x,
5610
- vt as y,
5611
- yt as z
5615
+ yt as y,
5616
+ vt as z
5612
5617
  };