@abyss-project/commons-front-core 18.1.2 → 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 +29 -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-MVmpclcZ.js → Tabs-CxD9y18t.js} +245 -237
  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-D0JP2AdM.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-CVRa0oBj.js → index-4MsOXuOU.js} +2 -2
  39. package/dist/{index-P3mYGVW9.js → index-5BCfqxIs.js} +2 -2
  40. package/dist/{index-CTbeT-N0.js → index-5HFSSrP-.js} +1 -1
  41. package/dist/{index-tTzlUmYK.js → index-7M2xC_9h.js} +2 -2
  42. package/dist/{index-B7TbdCxd.js → index-8o9jiKS2.js} +2 -2
  43. package/dist/{index-DHwatinf.js → index-B6QYagVk.js} +2 -2
  44. package/dist/{index-DOniqiUF.js → index-BQFouU9U.js} +2 -2
  45. package/dist/{index-BXwVo31B.js → index-BQLAeM_n.js} +2 -2
  46. package/dist/{index-CxQaYgoB.js → index-BbbyRlLu.js} +2 -2
  47. package/dist/{index-BhfgX3oc.js → index-Bbc0SjAt.js} +2 -2
  48. package/dist/{index-CTmmM3bQ.js → index-BcsTtdwQ.js} +4 -4
  49. package/dist/{index-BiBtwp14.js → index-Berc0QsZ.js} +4 -4
  50. package/dist/{index-CorW4VOJ.js → index-ByRUmH_4.js} +3 -3
  51. package/dist/{index-DWOXLAjk.js → index-CXUHmTse.js} +2 -2
  52. package/dist/{index-WnQHBsCS.js → index-Cl1UafyM.js} +2 -2
  53. package/dist/{index-WbhbeBj8.js → index-DQgpUR1S.js} +3 -3
  54. package/dist/{index-DB03r0_G.js → index-Dh1lFi8d.js} +2 -2
  55. package/dist/{index-BgK7ZufI.js → index-Drwqi2Fr.js} +2 -2
  56. package/dist/{index-BTQOcRMg.js → index-Dtfo8fKg.js} +4 -4
  57. package/dist/{index-DS7PaGaq.js → index-VLxkKEWK.js} +3 -3
  58. package/dist/{index-COEwfkxf.js → index-p3G-JM7E.js} +3 -3
  59. package/dist/index.js +5852 -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,117 +1,117 @@
1
- import { ScheduledTasks } from '../../src/components/business/Deliveries/ScheduledTasks.component';
2
- import type { ScheduledTasksProps } from '../../src/components/business/Deliveries/deliveries.types';
3
- import {
4
- page,
5
- runStatus,
6
- scheduledTask,
7
- taskRun,
8
- } from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
9
- import { Example, LastEvent, Showcase, useEventLog } from '../frame';
10
-
11
- const PERMISSIONS = {
12
- canCreate: true,
13
- canUpdate: true,
14
- canDelete: true,
15
- canRegenerateSecret: true,
16
- canTrigger: true,
17
- };
18
-
19
- const POPULATED = [
20
- scheduledTask(),
21
- scheduledTask({
22
- id: 'task-2',
23
- name: 'Rapport hebdomadaire',
24
- schedule: '@weekly',
25
- isEnabled: false,
26
- lastRunAt: null,
27
- }),
28
- scheduledTask({
29
- id: 'task-3',
30
- name: 'Synchronisation des factures',
31
- schedule: '*/15 * * * *',
32
- consecutiveFailures: 4,
33
- }),
34
- ];
35
-
36
- const RUNS = [
37
- taskRun(),
38
- taskRun({
39
- id: 'run-2',
40
- scheduledFor: new Date('2026-11-01T03:00:00Z'),
41
- status: runStatus('FAILED'),
42
- responseCode: 500,
43
- durationMs: 1204,
44
- }),
45
- taskRun({
46
- id: 'run-3',
47
- scheduledFor: new Date('2026-10-31T03:00:00Z'),
48
- status: runStatus('TIMED_OUT'),
49
- responseCode: null,
50
- durationMs: 30000,
51
- }),
52
- ];
53
-
54
- export const ScheduledTasksPage = () => {
55
- const { log } = useEventLog();
56
- const base = (list: ScheduledTasksProps['list']): ScheduledTasksProps => ({
57
- list,
58
- create: async (body) => {
59
- log(`créer ${body.name}`);
60
- return {
61
- scheduledTask: scheduledTask({ id: 'task-new', isEnabled: false }),
62
- secret: 'cron_catalog_new_do-not-use',
63
- };
64
- },
65
- update: async (id, body) => {
66
- log(`modifier ${id}`);
67
- return scheduledTask({ id, ...body });
68
- },
69
- remove: async (id) => log(`supprimer ${id}`),
70
- regenerateSecret: async (id) => {
71
- log(`secret ${id}`);
72
- return {
73
- scheduledTask: scheduledTask({ id }),
74
- secret: 'cron_catalog_regenerated_do-not-use',
75
- };
76
- },
77
- trigger: async (id) => log(`lancer ${id}`),
78
- listRuns: async () => page(RUNS),
79
- permissions: PERMISSIONS,
80
- flowUrl: 'https://flow.abyss.example/scheduled-tasks',
81
- });
82
- return (
83
- <Showcase
84
- family="Métier"
85
- name="ScheduledTasks"
86
- description="Les tâches planifiées d'un périmètre : liste, création et édition en panneau, « lancer maintenant », secret affiché une seule fois et historique des exécutions."
87
- >
88
- <Example title="Peuplé" maxWidth={1100}>
89
- <ScheduledTasks {...base(async () => page(POPULATED))} />
90
- </Example>
91
- <Example title="Vide" maxWidth={1100}>
92
- <ScheduledTasks {...base(async () => page([]))} />
93
- </Example>
94
- <Example title="En cours de chargement" maxWidth={1100}>
95
- <ScheduledTasks {...base(() => new Promise(() => undefined))} />
96
- </Example>
97
- <Example title="Le chargement a échoué" maxWidth={1100}>
98
- <ScheduledTasks
99
- {...base(() => Promise.reject(new Error('Flow indisponible')))}
100
- />
101
- </Example>
102
- <Example title="Lecture seule" maxWidth={1100}>
103
- <ScheduledTasks
104
- {...base(async () => page(POPULATED))}
105
- permissions={{
106
- canCreate: false,
107
- canUpdate: false,
108
- canDelete: false,
109
- canRegenerateSecret: false,
110
- canTrigger: false,
111
- }}
112
- />
113
- </Example>
114
- <LastEvent />
115
- </Showcase>
116
- );
117
- };
1
+ import { ScheduledTasks } from '../../src/components/business/Deliveries/ScheduledTasks.component';
2
+ import type { ScheduledTasksProps } from '../../src/components/business/Deliveries/deliveries.types';
3
+ import {
4
+ page,
5
+ runStatus,
6
+ scheduledTask,
7
+ taskRun,
8
+ } from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
9
+ import { Example, LastEvent, Showcase, useEventLog } from '../frame';
10
+
11
+ const PERMISSIONS = {
12
+ canCreate: true,
13
+ canUpdate: true,
14
+ canDelete: true,
15
+ canRegenerateSecret: true,
16
+ canTrigger: true,
17
+ };
18
+
19
+ const POPULATED = [
20
+ scheduledTask(),
21
+ scheduledTask({
22
+ id: 'task-2',
23
+ name: 'Rapport hebdomadaire',
24
+ schedule: '@weekly',
25
+ isEnabled: false,
26
+ lastRunAt: null,
27
+ }),
28
+ scheduledTask({
29
+ id: 'task-3',
30
+ name: 'Synchronisation des factures',
31
+ schedule: '*/15 * * * *',
32
+ consecutiveFailures: 4,
33
+ }),
34
+ ];
35
+
36
+ const RUNS = [
37
+ taskRun(),
38
+ taskRun({
39
+ id: 'run-2',
40
+ scheduledFor: new Date('2026-11-01T03:00:00Z'),
41
+ status: runStatus('FAILED'),
42
+ responseCode: 500,
43
+ durationMs: 1204,
44
+ }),
45
+ taskRun({
46
+ id: 'run-3',
47
+ scheduledFor: new Date('2026-10-31T03:00:00Z'),
48
+ status: runStatus('TIMED_OUT'),
49
+ responseCode: null,
50
+ durationMs: 30000,
51
+ }),
52
+ ];
53
+
54
+ export const ScheduledTasksPage = () => {
55
+ const { log } = useEventLog();
56
+ const base = (list: ScheduledTasksProps['list']): ScheduledTasksProps => ({
57
+ list,
58
+ create: async (body) => {
59
+ log(`créer ${body.name}`);
60
+ return {
61
+ scheduledTask: scheduledTask({ id: 'task-new', isEnabled: false }),
62
+ secret: 'cron_catalog_new_do-not-use',
63
+ };
64
+ },
65
+ update: async (id, body) => {
66
+ log(`modifier ${id}`);
67
+ return scheduledTask({ id, ...body });
68
+ },
69
+ remove: async (id) => log(`supprimer ${id}`),
70
+ regenerateSecret: async (id) => {
71
+ log(`secret ${id}`);
72
+ return {
73
+ scheduledTask: scheduledTask({ id }),
74
+ secret: 'cron_catalog_regenerated_do-not-use',
75
+ };
76
+ },
77
+ trigger: async (id) => log(`lancer ${id}`),
78
+ listRuns: async () => page(RUNS),
79
+ permissions: PERMISSIONS,
80
+ flowUrl: 'https://flow.abyss.example/scheduled-tasks',
81
+ });
82
+ return (
83
+ <Showcase
84
+ family="Métier"
85
+ name="ScheduledTasks"
86
+ description="Les tâches planifiées d'un périmètre : liste, création et édition en panneau, « lancer maintenant », secret affiché une seule fois et historique des exécutions."
87
+ >
88
+ <Example title="Peuplé" maxWidth={1100}>
89
+ <ScheduledTasks {...base(async () => page(POPULATED))} />
90
+ </Example>
91
+ <Example title="Vide" maxWidth={1100}>
92
+ <ScheduledTasks {...base(async () => page([]))} />
93
+ </Example>
94
+ <Example title="En cours de chargement" maxWidth={1100}>
95
+ <ScheduledTasks {...base(() => new Promise(() => undefined))} />
96
+ </Example>
97
+ <Example title="Le chargement a échoué" maxWidth={1100}>
98
+ <ScheduledTasks
99
+ {...base(() => Promise.reject(new Error('Flow indisponible')))}
100
+ />
101
+ </Example>
102
+ <Example title="Lecture seule" maxWidth={1100}>
103
+ <ScheduledTasks
104
+ {...base(async () => page(POPULATED))}
105
+ permissions={{
106
+ canCreate: false,
107
+ canUpdate: false,
108
+ canDelete: false,
109
+ canRegenerateSecret: false,
110
+ canTrigger: false,
111
+ }}
112
+ />
113
+ </Example>
114
+ <LastEvent />
115
+ </Showcase>
116
+ );
117
+ };
@@ -0,0 +1,20 @@
1
+ import { AbyssService } from '@abyss-project/main';
2
+ import {
3
+ SessionErrorReason,
4
+ SessionErrorScreen,
5
+ } from '../../src/auth/components/SessionErrorScreen/SessionErrorScreen.component';
6
+ import { useEventLog } from '../frame';
7
+
8
+ /** A full page: the terminal screen of a satellite's session, with all its actions. */
9
+ export const SessionErrorScreenPage = () => {
10
+ const { log } = useEventLog();
11
+ return (
12
+ <SessionErrorScreen
13
+ reason={SessionErrorReason.PREPARE_FAILED}
14
+ service={AbyssService.ABYSS_FORM}
15
+ onRetry={() => log('réessayer')}
16
+ onSignIn={() => log('se connecter')}
17
+ onSignOut={() => log('se déconnecter')}
18
+ />
19
+ );
20
+ };
@@ -1,11 +1,16 @@
1
- import { useEffect, useMemo, useRef } from 'react';
1
+ import { useEffect, useMemo, useRef, useState } from 'react';
2
2
  import Button from '@mui/material/Button';
3
+ import Dialog from '@mui/material/Dialog';
4
+ import DialogActions from '@mui/material/DialogActions';
5
+ import DialogContent from '@mui/material/DialogContent';
6
+ import DialogTitle from '@mui/material/DialogTitle';
3
7
  import {
4
8
  ToastProvider,
5
9
  toast,
6
10
  useToast,
7
11
  ToastTone,
8
12
  } from '../../src/components/layers/Toast/Toast';
13
+ import { Modal } from '../../src/components/layers/Modal/Modal';
9
14
  import type { ToastOptions } from '../../src/components/layers/Toast/Toast';
10
15
  import { Example, LastEvent, Row, Showcase, useEventLog } from '../frame';
11
16
 
@@ -87,6 +92,56 @@ const ToastDemo = () => {
87
92
  );
88
93
  };
89
94
 
95
+ const showFailure = () => toast.error('Création impossible : délai dépassé.');
96
+
97
+ /** Below `md` a failure stays above the foot of the dialog: the case of a form that is refused. */
98
+ const DialogFootDemo = () => {
99
+ const [open, setOpen] = useState<'dialog' | 'modal' | null>(null);
100
+ const close = () => setOpen(null);
101
+ return (
102
+ <Row>
103
+ <Button variant="outlined" onClick={() => setOpen('dialog')}>
104
+ Dialogue plein écran
105
+ </Button>
106
+ <Button variant="outlined" onClick={() => setOpen('modal')}>
107
+ Modal
108
+ </Button>
109
+ <Dialog
110
+ fullScreen
111
+ open={open === 'dialog'}
112
+ onClose={close}
113
+ aria-labelledby="toast-demo-dialog"
114
+ >
115
+ <DialogTitle id="toast-demo-dialog">Nouvel événement</DialogTitle>
116
+ <DialogContent>Le formulaire de l’événement.</DialogContent>
117
+ <DialogActions>
118
+ <Button onClick={close}>Annuler</Button>
119
+ <Button variant="contained" onClick={showFailure}>
120
+ Créer
121
+ </Button>
122
+ </DialogActions>
123
+ </Dialog>
124
+ <Modal
125
+ open={open === 'modal'}
126
+ onClose={close}
127
+ title="Nouveau projet"
128
+ actions={
129
+ <>
130
+ <Button variant="outlined" onClick={close}>
131
+ Annuler
132
+ </Button>
133
+ <Button variant="contained" onClick={showFailure}>
134
+ Créer
135
+ </Button>
136
+ </>
137
+ }
138
+ >
139
+ Le formulaire du projet.
140
+ </Modal>
141
+ </Row>
142
+ );
143
+ };
144
+
90
145
  export const ToastPage = () => (
91
146
  <ToastProvider>
92
147
  <Showcase
@@ -97,6 +152,9 @@ export const ToastPage = () => (
97
152
  <Example title="Les quatre tons, deux avec action ; la progression se déclenche au bouton">
98
153
  <ToastDemo />
99
154
  </Example>
155
+ <Example title="Au-dessus du pied d’un dialogue, sous 768 px">
156
+ <DialogFootDemo />
157
+ </Example>
100
158
  <LastEvent />
101
159
  </Showcase>
102
160
  </ToastProvider>
@@ -10,6 +10,7 @@ import { BarChartPage } from './BarChart';
10
10
  import { BottomSheetPage } from './BottomSheet';
11
11
  import { BreadcrumbsPage } from './Breadcrumbs';
12
12
  import { CalloutPage } from './Callout';
13
+ import { CodeEditorPage } from './CodeEditor';
13
14
  import { ChartThemePage } from './ChartTheme';
14
15
  import { CloudImportPage } from './CloudImport';
15
16
  import { ColorFieldPage } from './ColorField';
@@ -74,6 +75,7 @@ import { StatusBadgePage } from './StatusBadge';
74
75
  import { SurfacePage } from './Surface';
75
76
  import { SwipeDeckPage } from './SwipeDeck';
76
77
  import { TabsPage } from './Tabs';
78
+ import { SessionErrorScreenPage } from './SessionErrorScreen';
77
79
  import { ToastPage } from './Toast';
78
80
  import { ToolbarPage } from './Toolbar';
79
81
  import { ToolIconPage } from './ToolIcon';
@@ -94,6 +96,7 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
94
96
  BottomSheet: BottomSheetPage,
95
97
  Breadcrumbs: BreadcrumbsPage,
96
98
  Callout: CalloutPage,
99
+ CodeEditor: CodeEditorPage,
97
100
  ChartTheme: ChartThemePage,
98
101
  CloudImport: CloudImportPage,
99
102
  DeliveryHistory: DeliveryHistoryPage,
@@ -159,6 +162,7 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
159
162
  SwipeDeck: SwipeDeckPage,
160
163
  Tabs: TabsPage,
161
164
  Toast: ToastPage,
165
+ SessionErrorScreen: SessionErrorScreenPage,
162
166
  Toolbar: ToolbarPage,
163
167
  ToolIcon: ToolIconPage,
164
168
  UsageMeter: UsageMeterPage,
@@ -7,7 +7,7 @@ import { catalogPort } from './catalog-port';
7
7
  // CI run of the catalog checks (`catalog:test:ci`, job `front-core-catalog`): the built catalog
8
8
  // (`catalog-dist/`, built by the script just before) served by `vite preview`, instead of the dev
9
9
  // server, which transforms every module on demand and makes a shared runner miss its timeouts.
10
- // Every spec runs but the captures: responsive and mobile-shell (criteria 15 and 16), the specs of
10
+ // Every spec runs but the captures (and the global review's, whose editors load Monaco from its CDN): responsive and mobile-shell (criteria 15 and 16), the specs of
11
11
  // one component (expression-search-scroll, preview-drawer-trail) and cookie-consent-modal (#747).
12
12
  // The captures are a human review, produced locally by `catalog:test`, so neither their spec nor the
13
13
  // teardown that indexes them runs here.
@@ -16,7 +16,7 @@ const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
16
16
 
17
17
  export default defineConfig({
18
18
  ...baseConfig,
19
- testIgnore: ['**/captures.spec.ts'],
19
+ testIgnore: ['**/captures.spec.ts', '**/global-review-captures.spec.ts'],
20
20
  globalTeardown: undefined,
21
21
  workers: 4,
22
22
  webServer: {