@abyss-project/commons-front-core 18.1.3 → 18.1.4

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 (64) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +4 -0
  3. package/catalog/catalog-entries.ts +4 -0
  4. package/catalog/pages/Callout.tsx +9 -0
  5. package/catalog/pages/CodeEditor.tsx +52 -0
  6. package/catalog/pages/DeliveryHistory.tsx +79 -79
  7. package/catalog/pages/DeliverySubscriptions.tsx +127 -127
  8. package/catalog/pages/LineChart.tsx +21 -0
  9. package/catalog/pages/MarkdownEditor.tsx +1 -1
  10. package/catalog/pages/ScheduledTasks.tsx +117 -117
  11. package/catalog/pages/SessionErrorScreen.tsx +20 -0
  12. package/catalog/pages/Toast.tsx +59 -1
  13. package/catalog/pages/index.ts +4 -0
  14. package/catalog/playwright.ci.config.ts +2 -2
  15. package/catalog/specs/captures.spec.ts +145 -145
  16. package/catalog/specs/global-review-captures.spec.ts +154 -0
  17. package/catalog/specs/markdown-editor.spec.ts +107 -0
  18. package/catalog/specs/toast-dialog-foot.spec.ts +83 -0
  19. package/catalog/specs/write-capture-index.ts +81 -81
  20. package/dist/{CookieConsentSettings-CLB1Mlv5.js → CookieConsentSettings-D97TY138.js} +53 -53
  21. package/dist/{Surface-B_wIEB3b.js → Surface-CN1zQYLJ.js} +144 -121
  22. package/dist/{Tabs-g7OaInVW.js → Tabs-CxD9y18t.js} +235 -229
  23. package/dist/components/CodeEditor/CodeEditor.component.spec.d.ts +1 -0
  24. package/dist/components/business/CookieConsent/use-banner-portal.d.ts +0 -17
  25. package/dist/components/data/LineChart/LineChart.d.ts +21 -2
  26. package/dist/components/data/LineChart/line-chart-ticks.d.ts +5 -2
  27. package/dist/components/editors/MarkdownEditor/crepe-styles.d.ts +7 -0
  28. package/dist/components/editors/MarkdownEditor/crepe-styles.spec.d.ts +1 -0
  29. package/dist/components/layers/Modal/active-modal.d.ts +14 -0
  30. package/dist/components/layers/Toast/Toast.d.ts +1 -0
  31. package/dist/components/layers/Toast/dialog-foot-clearance.d.ts +19 -0
  32. package/dist/components/layers/Toast/toast-clearance.d.ts +11 -0
  33. package/dist/cookie-consent.js +2 -2
  34. package/dist/{design-theme-Bcu3EMIB.js → design-theme-GGVSCauN.js} +1 -1
  35. package/dist/{editors-DdGMdSh2.js → editors-CJ_6PXoL.js} +30129 -30094
  36. package/dist/editors.js +1 -1
  37. package/dist/hooks/use-rich-intl.hook.d.ts +18 -0
  38. package/dist/{index-cA9H4vaN.js → index-4MsOXuOU.js} +2 -2
  39. package/dist/{index-CNjQ-GTe.js → index-5BCfqxIs.js} +2 -2
  40. package/dist/{index-Be4u6vqC.js → index-5HFSSrP-.js} +1 -1
  41. package/dist/{index-CH4DiDpu.js → index-7M2xC_9h.js} +2 -2
  42. package/dist/{index-DBctH8lu.js → index-8o9jiKS2.js} +2 -2
  43. package/dist/{index-DMAlgOv6.js → index-B6QYagVk.js} +2 -2
  44. package/dist/{index-CYGd_IjS.js → index-BQFouU9U.js} +2 -2
  45. package/dist/{index-8LPOJLO8.js → index-BQLAeM_n.js} +2 -2
  46. package/dist/{index-CNx-Ok-t.js → index-BbbyRlLu.js} +2 -2
  47. package/dist/{index-BFZvgteF.js → index-Bbc0SjAt.js} +2 -2
  48. package/dist/{index-Cwo-CFS8.js → index-BcsTtdwQ.js} +4 -4
  49. package/dist/{index-DSIctaR0.js → index-Berc0QsZ.js} +4 -4
  50. package/dist/{index-DfGQhHnK.js → index-ByRUmH_4.js} +3 -3
  51. package/dist/{index-CH67WfFq.js → index-CXUHmTse.js} +2 -2
  52. package/dist/{index-zu64GUZu.js → index-Cl1UafyM.js} +2 -2
  53. package/dist/{index-BPF_Eb0U.js → index-DQgpUR1S.js} +3 -3
  54. package/dist/{index-CbH8XAvZ.js → index-Dh1lFi8d.js} +2 -2
  55. package/dist/{index-_7HwdzPE.js → index-Drwqi2Fr.js} +2 -2
  56. package/dist/{index-B12llGmk.js → index-Dtfo8fKg.js} +4 -4
  57. package/dist/{index-Vgp_uo0Y.js → index-VLxkKEWK.js} +3 -3
  58. package/dist/{index-CJ4-H8Ku.js → index-p3G-JM7E.js} +3 -3
  59. package/dist/index.js +5850 -5767
  60. package/dist/legacy.js +6 -6
  61. package/dist/translations/en.d.ts +9 -0
  62. package/dist/translations/fr.d.ts +9 -0
  63. package/package.json +1 -1
  64. package/dist/commons-front-core.css +0 -1
@@ -1,22 +1,5 @@
1
1
  /** Set on the modal that currently hosts the banner, so a global rule can make it stop above the banner. */
2
2
  export declare const MODAL_HOST_ATTRIBUTE = "data-abyss-cookie-banner-host";
3
- export interface ActiveModal {
4
- /** The MUI modal root, a child of `body`. */
5
- host: HTMLElement;
6
- /**
7
- * The `aria-modal` surface of the modal (the dialog, the sheet, the drawer). MUI's focus trap
8
- * pulls the focus back inside the modal, and the readers that honour `aria-modal` (WebKit,
9
- * VoiceOver) read the surface only: the banner is heard and reached from within.
10
- */
11
- surface: HTMLElement;
12
- }
13
- /**
14
- * The open modal on top of the page, if any: the last `body` child that is a MUI modal root holding
15
- * an `aria-modal` surface (a dialog, a sheet, a drawer), still shown. A popover or an anchored panel
16
- * is not one, though its surface is `aria-modal` too: it is gone as soon as the visitor picks
17
- * something, and the banner has no reason to follow it into a box that clips what is fixed in it.
18
- */
19
- export declare const findActiveModal: () => ActiveModal | null;
20
3
  export interface BannerPortal {
21
4
  /** Where to render the banner; `null` until the browser can host it (server render). */
22
5
  container: HTMLElement | null;
@@ -1,5 +1,21 @@
1
1
  import { ChartSeriesTone } from '../chart-series-tone';
2
2
  export type LineChartX = Date | number;
3
+ /** A marker color that is no status: the marks take the color of the line they sit on. */
4
+ export declare enum LineChartMarkerTone {
5
+ Series = "series"
6
+ }
7
+ /** The room around the plot of a `LineChart`, in px. */
8
+ export interface LineChartPlotMargin {
9
+ top: number;
10
+ right: number;
11
+ bottom: number;
12
+ left: number;
13
+ }
14
+ /**
15
+ * The room a `LineChart` leaves around its plot, from the `space` scale of the theme: what a host
16
+ * that maps a pointer onto the plot (a brush) subtracts from the width of the figure.
17
+ */
18
+ export declare const lineChartPlotMargin: (space: readonly number[]) => LineChartPlotMargin;
3
19
  export interface LineChartPoint {
4
20
  x: LineChartX;
5
21
  /**
@@ -21,12 +37,15 @@ export interface LineChartSeries {
21
37
  */
22
38
  tone?: ChartSeriesTone;
23
39
  /**
24
- * Points of the series to mark (an anomaly, an event): a dot in the `status.danger` color on the
25
- * line at each listed x that has a value. `label` names the marks in the legend.
40
+ * Points of the series to mark (an anomaly, an event): a dot on the line at each listed x that has
41
+ * a value. `label` names the marks in the legend. `tone` is what the marks mean, `Danger` by
42
+ * default; `LineChartMarkerTone.Series` gives them the color of the line when they mean nothing
43
+ * good or bad.
26
44
  */
27
45
  markers?: {
28
46
  label: string;
29
47
  xs: LineChartX[];
48
+ tone?: ChartSeriesTone | LineChartMarkerTone;
30
49
  };
31
50
  }
32
51
  /** One x of a band: the values it spans, `null` on both where the band has none (it breaks there). */
@@ -25,7 +25,10 @@ export interface XTickLayout {
25
25
  * least one) and whose plot is `layout.plotWidth` px wide: the finest nice step (on the local clock
26
26
  * for time), never finer than the closest two values, whose labels (`labelOf`), as wide as
27
27
  * `tickLabelWidth` says, keep `TICK_LABEL_GAP` between neighbors. A label that would spill past the
28
- * margins is dropped. Without room for two labels, a single one is kept; a plot without width gets
29
- * none.
28
+ * margins is dropped. When that leaves fewer than two labels, the axis is labeled at its two ends
29
+ * instead: the first and the last tick of the coarsest crowded step that stay inside the margins,
30
+ * else the first and the last such value. Without room for two labels, a single one is kept, so the
31
+ * band reserved under the plot is never left empty; a plot without width gets none, nor does a label
32
+ * wider than the whole figure.
30
33
  */
31
34
  export declare function xTickValues(values: number[], kind: XScaleKind, labelOf: (value: number) => string, layout: XTickLayout): number[];
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Puts Crepe's stylesheet in the page, once. The build of this package extracts an imported
3
+ * stylesheet into a file that no chunk imports and `exports` does not expose: a consumer built on the
4
+ * published package would get an editor without it. First in `head`, so the styles of the editor and
5
+ * of the host, on the same specificity, keep winning.
6
+ */
7
+ export declare const ensureCrepeStyles: () => void;
@@ -0,0 +1,14 @@
1
+ export interface ActiveModal {
2
+ /** The MUI modal root, a child of `body`. */
3
+ host: HTMLElement;
4
+ /** The `aria-modal` surface of the modal: the dialog, the sheet, the drawer. */
5
+ surface: HTMLElement;
6
+ }
7
+ /**
8
+ * The open modal on top of the page, if any: the last `body` child that is a MUI modal root holding
9
+ * an `aria-modal` surface (a dialog, a sheet, a drawer), still shown. A popover or an anchored panel
10
+ * is not one, though its surface is `aria-modal` too: it is gone as soon as the visitor picks
11
+ * something, and what lies under it is what the page is about. Read by the cookie banner, which
12
+ * moves into that surface (#747), and by the toast region, which keeps above its foot.
13
+ */
14
+ export declare const findActiveModal: () => ActiveModal | null;
@@ -13,6 +13,7 @@ export declare const TOAST_DURATION = 5000;
13
13
  /**
14
14
  * Holds the toasts of the application and renders them in a live region at the bottom right (full
15
15
  * width below `md`), on the `overlay` elevation, the most recent on top (first in the DOM too).
16
+ * Below `md` the region keeps above the foot of a dialog that reaches the bottom edge.
16
17
  * Mount it once, inside the theme and the messages.
17
18
  */
18
19
  export declare function ToastProvider({ children }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Distance from the bottom of the viewport up to the top of the foot of the open dialog, in px, 0
3
+ * when no foot is in the way: no modal surface, no foot, a dialog that stops short of the bottom
4
+ * edge, a foot scrolled out of its surface, or a foot the region would not reach from where it rests
5
+ * (a full-screen dialog with short content has its foot high up: raising the toast there would cover
6
+ * the fields). `restingTop` is the top of the region without this clearance. A dialog that stops
7
+ * short gets no room on purpose: the region stays in its corner, and a tall one (`AbyssModal`
8
+ * between `sm` and `md`, not full screen, 32 px from the edge) can have its foot under a toast
9
+ * (README). Read from the live boxes, so a surface shortened by the cookie banner (#747) or one still
10
+ * sliding in needs no special case.
11
+ */
12
+ export declare const dialogFootClearance: (restingTop: number) => number;
13
+ /**
14
+ * While `active`, keeps `DIALOG_FOOT_CLEARANCE_VAR` on the toast region up to date. The variable
15
+ * lives on the region alone: `--abyss-toast-clearance` and the modal clearance belong to the cookie
16
+ * banner, which removes them when it leaves. The region stays a child of `body`, so nothing here
17
+ * depends on what the surface's style does to `position: fixed`.
18
+ */
19
+ export declare const useDialogFootClearance: (region: HTMLElement | null, active: boolean) => void;
@@ -9,3 +9,14 @@ export declare const TOAST_CLEARANCE_VAR = "--abyss-toast-clearance";
9
9
  * the banner never covers its actions (#747). Unset otherwise.
10
10
  */
11
11
  export declare const MODAL_CLEARANCE_VAR = "--abyss-cookie-banner-modal-clearance";
12
+ /**
13
+ * The distance from the bottom of the viewport up to the foot of a dialog that reaches the bottom
14
+ * edge, below `md`: the toast region, full width there, keeps above it so a notification never covers
15
+ * « Annuler / Créer ». Written on the region itself, only while a toast is shown.
16
+ */
17
+ export declare const DIALOG_FOOT_CLEARANCE_VAR = "--abyss-toast-dialog-foot-clearance";
18
+ /**
19
+ * Marks the actions of a `Modal` shown as a sheet as the foot of its surface, for the toast region.
20
+ * MUI's `DialogActions` is recognized by itself. Internal to the core.
21
+ */
22
+ export declare const DIALOG_FOOT_ATTRIBUTE = "data-abyss-dialog-foot";
@@ -1,5 +1,5 @@
1
- import { A as o, g as a, h as n, e as C, i as t, f as i, j as r, k as A, C as E, b as O, c as S, D as _, R as k, o as I, m as c, l as d, n as N, r as T, p as l, u as f, d as D, a as R, w as V } from "./CookieConsentSettings-CLB1Mlv5.js";
2
- import { f as p } from "./Surface-B_wIEB3b.js";
1
+ import { A as o, g as a, h as n, e as C, i as t, f as i, j as r, k as A, C as E, b as O, c as S, D as _, R as k, o as I, m as c, l as d, n as N, r as T, p as l, u as f, d as D, a as R, w as V } from "./CookieConsentSettings-D97TY138.js";
2
+ import { f as p } from "./Surface-CN1zQYLJ.js";
3
3
  export {
4
4
  o as AbyssCookieConsentProvider,
5
5
  a as CONSENT_VALIDITY_DAYS,
@@ -2,7 +2,7 @@ import { B as Mt, C as DW, D as PW, F as KW, f as WW, m as af, n as b3, G as BW,
2
2
  import { W as JW, r as zW, C as ZW } from "./index-D7cgykJH.js";
3
3
  import * as ga from "react";
4
4
  import PT, { useRef as gt, useEffect as xr, useState as Pr, useCallback as xe, useMemo as Ye, useLayoutEffect as fE, createContext as no, forwardRef as ms, createElement as Tr, useContext as ji, memo as Kt, cloneElement as $W, Component as dE, Fragment as t2, isValidElement as eB } from "react";
5
- import { u as tB, T as qc, v as rB, H as hE, l as gE, r as pE, q as vE, y as mE, z as bE, J as nB, K as iB, I as aB, o as oB } from "./Surface-B_wIEB3b.js";
5
+ import { u as tB, l as qc, y as rB, L as hE, n as gE, x as pE, v as vE, E as mE, F as bE, O as nB, P as iB, N as aB, r as oB } from "./Surface-CN1zQYLJ.js";
6
6
  import KT from "@mui/icons-material/InsertDriveFile";
7
7
  import sB from "@mui/icons-material/Image";
8
8
  import uB from "@mui/icons-material/PictureAsPdf";