@abyss-project/commons-front-core 16.2.0 → 17.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 (39) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/catalog/pages/Toast.tsx +5 -5
  3. package/dist/components/layers/Toast/Toast.d.ts +3 -2
  4. package/dist/components/layers/Toast/toast-store.d.ts +11 -8
  5. package/dist/design-system-toasts.spec.d.ts +1 -0
  6. package/dist/{design-theme-B1PgRGnU.js → design-theme-GNwBGEo_.js} +7098 -7010
  7. package/dist/{editors-NTlXfUf3.js → editors-npV-IKED.js} +2263 -2242
  8. package/dist/editors.js +1 -1
  9. package/dist/{index-rHl9uQvG.js → index-4ZuDYpO-.js} +3 -3
  10. package/dist/{index-BIQNTPCh.js → index-B0uq2NNW.js} +2 -2
  11. package/dist/{index-DDsn4UyZ.js → index-B7TpUAN3.js} +2 -2
  12. package/dist/{index-BH6GeV66.js → index-BGhYJfRf.js} +2 -2
  13. package/dist/{index-BKbESj9f.js → index-BP3DenBU.js} +2 -2
  14. package/dist/{index-D-75Bwy8.js → index-BUwk65yN.js} +2 -2
  15. package/dist/{index-Dr3sF4q3.js → index-BtesgJeO.js} +2 -2
  16. package/dist/{index-DmtNuZcU.js → index-C1_3Bq6c.js} +2 -2
  17. package/dist/{index-VntY82At.js → index-C52yVIrz.js} +2 -2
  18. package/dist/{index-C-pVBVRm.js → index-C7tcg6JR.js} +3 -3
  19. package/dist/{index-BHFYCrDl.js → index-C8xWjIs7.js} +4 -4
  20. package/dist/{index-MiIytQo8.js → index-CAyUKp6J.js} +3 -3
  21. package/dist/{index-DGKfXQr5.js → index-CCVhl3JV.js} +2 -2
  22. package/dist/{index-DTfxCpd4.js → index-CboA-nSE.js} +4 -4
  23. package/dist/{index-DXSxiqo1.js → index-Cp4UAUdF.js} +2 -2
  24. package/dist/{index-BEm81V4i.js → index-CqQ3PZ3K.js} +3 -3
  25. package/dist/{index-7ovesCC_.js → index-CtRut8xk.js} +2 -2
  26. package/dist/{index-DloK9ass.js → index-Dd5hKcko.js} +2 -2
  27. package/dist/{index-Bt3EOSkY.js → index-DnFO_WNV.js} +4 -4
  28. package/dist/{index-DeB1ImKD.js → index-bmHi0NgU.js} +2 -2
  29. package/dist/{index-CHsTUwr0.js → index-sK15Uy0d.js} +1 -1
  30. package/dist/index.js +8803 -8635
  31. package/dist/legacy/components/Spotlight/ProjectLinkSelector/ProjectLinkSelector.component.spec.d.ts +1 -0
  32. package/dist/legacy/components/Utils/index.d.ts +0 -1
  33. package/dist/legacy.js +2561 -2697
  34. package/package.json +4 -6
  35. package/scripts/check-auth-entry-isolation.cjs +1 -2
  36. package/vite.config.ts +3 -3
  37. package/dist/legacy/components/Utils/Toast/AbyssToast.component.d.ts +0 -9
  38. package/dist/legacy/components/Utils/Toast/index.d.ts +0 -1
  39. package/scripts/check-external-react-toastify.cjs +0 -104
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog — @abyss-project/commons-front-core
2
2
 
3
+ ## 17.1.0
4
+
5
+ No export removed, no signature changed (card #286, toasts of the satellites).
6
+
7
+ **Migration required.** A consumer that keeps the react-toastify `ToastContainer` and does not mount the core's `ToastProvider` no longer sees the errors of `toastErrorUnlessQuotaRefusal`, `toastErrorUnlessAnyQuotaRefusal`, `CloudImport`, `DropZone` and `ProjectLinkSelector`: they now go to the core's `toast`, which only a mounted `ToastProvider` displays. Mount `ToastProvider` and move your own calls to the core's `toast`.
8
+
9
+ - `toastErrorUnlessQuotaRefusal`, `toastErrorUnlessAnyQuotaRefusal` and the legacy `CloudImport`, `DropZone` and `ProjectLinkSelector` show their errors through the core's `toast`: they appear in the mounted `ToastProvider`, no longer in a react-toastify `ToastContainer`.
10
+ - `react-toastify` is no longer a peer dependency (nor external in the build): nothing in the package imports it any more. A consumer that mounts `ToastProvider` and no longer imports it can drop it from its `package.json`. A guard (`src/design-system-toasts.spec.ts`) keeps it out of `src/` and `catalog/`.
11
+
12
+ ## 17.0.0
13
+
14
+ Breaking (card #286 M6): `AbyssToast` is removed from `./legacy`. Mount `ToastProvider` and call the core's `toast`. `react-toastify` stays a peer dependency while the satellites use it. In 17.0.x, a satellite that moves without migrating keeps its react-toastify `ToastContainer` and only loses the `AbyssToast` styling; from 17.1.0 it must mount `ToastProvider` (see below).
15
+
16
+ - `@abyss-project/main` is resolved to 31.1.0 (P4b #783, workflows in AbyssFlow).
17
+
3
18
  ## 16.1.1
4
19
 
5
20
  No export or signature changed (card #782).
@@ -17,7 +17,7 @@ const TONE_LABELS: Record<ToastTone, string> = {
17
17
  [ToastTone.Danger]: 'erreur',
18
18
  };
19
19
 
20
- /** A progress notification, shown at 40 %: the page shows it next to the four tones. */
20
+ /** A progress notification, shown at 40 %: a button of the page, apart from the four tones of the stack. */
21
21
  const showProgress = () => {
22
22
  const id = toast.progress('Envoi de 12 fichiers…');
23
23
  toast.update(id, { progress: 0.4 });
@@ -59,14 +59,14 @@ const ToastDemo = () => {
59
59
  [log],
60
60
  );
61
61
 
62
- // Shown on arrival, so the page shows the stack without a click; once, despite StrictMode.
62
+ // The four tones are shown on arrival, so the page shows the stack without a click; once, despite
63
+ // StrictMode. The progress is not: it would hold a place of the stack and push a tone out.
63
64
  useEffect(() => {
64
65
  if (shown.current) {
65
66
  return;
66
67
  }
67
68
  shown.current = true;
68
69
  samples.forEach((sample) => toasts.show(sample));
69
- showProgress();
70
70
  }, [samples, toasts]);
71
71
 
72
72
  return (
@@ -92,9 +92,9 @@ export const ToastPage = () => (
92
92
  <Showcase
93
93
  family="Couches"
94
94
  name="Toast"
95
- description="Notification passagère en bas à droite, au-dessus du bandeau de cookies quand il est là : quatre tons, une action facultative, retenue au survol ou au focus, et une notification de progression."
95
+ description="Notification passagère en bas à droite, au-dessus du bandeau de cookies quand il est là : quatre tons, une action facultative, retenue au survol ou au focus, et une notification de progression à la demande."
96
96
  >
97
- <Example title="Les quatre tons, deux avec action, et une progression">
97
+ <Example title="Les quatre tons, deux avec action ; la progression se déclenche au bouton">
98
98
  <ToastDemo />
99
99
  </Example>
100
100
  <LastEvent />
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ToastApi } from './toast-store';
3
- export { toast, ToastTone } from './toast-store';
3
+ export { toast, TOAST_LIMIT, ToastTone } from './toast-store';
4
4
  export type { ToastAction, ToastApi, ToastCallOptions, ToastOptions, ToastProgressOptions, ToastUpdate, } from './toast-store';
5
5
  export interface ToastProviderProps {
6
6
  children: ReactNode;
@@ -12,7 +12,8 @@ export interface ToastProviderProps {
12
12
  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
- * width below `md`), on the `overlay` elevation. Mount it once, inside the theme and the messages.
15
+ * width below `md`), on the `overlay` elevation, the most recent on top (first in the DOM too).
16
+ * Mount it once, inside the theme and the messages.
16
17
  */
17
18
  export declare function ToastProvider({ children }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
18
19
  /** Shows toasts from any component below a `ToastProvider`. */
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export declare enum ToastTone {
2
3
  Success = "success",
3
4
  Warning = "warning",
@@ -10,7 +11,7 @@ export interface ToastAction {
10
11
  }
11
12
  export interface ToastOptions {
12
13
  tone: ToastTone;
13
- message: string;
14
+ message: ReactNode;
14
15
  action?: ToastAction;
15
16
  }
16
17
  /** Options of `toast.success`, `toast.error`, `toast.info` and `toast.warning`. */
@@ -27,7 +28,7 @@ export interface ToastProgressOptions {
27
28
  export interface ToastUpdate {
28
29
  /** A tone ends the progress: the notification then leaves like any other. */
29
30
  tone?: ToastTone;
30
- message?: string;
31
+ message?: ReactNode;
31
32
  /** Between 0 and 1; shown while the notification has no final tone. */
32
33
  progress?: number;
33
34
  }
@@ -35,7 +36,7 @@ export interface ToastUpdate {
35
36
  export interface ToastItem {
36
37
  id: string;
37
38
  tone: ToastTone;
38
- message: string;
39
+ message: ReactNode;
39
40
  action?: ToastAction;
40
41
  durationMs?: number;
41
42
  /** True for a progress notification that has not received its final tone yet. */
@@ -47,6 +48,8 @@ export interface ToastApi {
47
48
  show(toast: ToastOptions): void;
48
49
  }
49
50
  type Listener = () => void;
51
+ /** Most notifications held at once; a new one beyond it pushes out the oldest one that is neither pending nor itself. */
52
+ export declare const TOAST_LIMIT = 4;
50
53
  /**
51
54
  * Store read by the mounted `ToastProvider`. Calls made before it mounts are kept and shown when
52
55
  * it does.
@@ -62,12 +65,12 @@ export declare const toastStore: {
62
65
  * mounted `ToastProvider`. Every call returns the id of its notification.
63
66
  */
64
67
  export declare const toast: {
65
- success: (message: string, options?: ToastCallOptions) => string;
66
- error: (message: string, options?: ToastCallOptions) => string;
67
- info: (message: string, options?: ToastCallOptions) => string;
68
- warning: (message: string, options?: ToastCallOptions) => string;
68
+ success: (message: ReactNode, options?: ToastCallOptions) => string;
69
+ error: (message: ReactNode, options?: ToastCallOptions) => string;
70
+ info: (message: ReactNode, options?: ToastCallOptions) => string;
71
+ warning: (message: ReactNode, options?: ToastCallOptions) => string;
69
72
  /** A persistent notification, ended with `toast.update(id, { tone })`. */
70
- progress(message: string, options?: ToastProgressOptions): string;
73
+ progress(message: ReactNode, options?: ToastProgressOptions): string;
71
74
  /** Does nothing when the notification has already left. */
72
75
  update(id: string, changes: ToastUpdate): void;
73
76
  /** Removes one notification, or all of them without an id. */
@@ -0,0 +1 @@
1
+ export {};