@abyss-project/commons-front-core 17.1.0 → 17.2.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 (59) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/catalog/captures-plan.ts +116 -103
  3. package/catalog/catalog-entries.ts +148 -140
  4. package/catalog/pages/DeliveryHistory.tsx +66 -0
  5. package/catalog/pages/DeliverySubscriptions.tsx +110 -0
  6. package/catalog/pages/ScheduledTasks.tsx +117 -0
  7. package/catalog/pages/index.ts +165 -159
  8. package/catalog/specs/captures.spec.ts +145 -91
  9. package/catalog/specs/write-capture-index.ts +81 -76
  10. package/dist/{CookieConsentSettings-CTAyLGkm.js → CookieConsentSettings-DHpcYTa2.js} +1 -1
  11. package/dist/{Surface-76bwVL_Z.js → Surface-BUxzLLhb.js} +500 -90
  12. package/dist/{Tabs-D2bdAWGo.js → Tabs-D7TDtprO.js} +99 -99
  13. package/dist/components/business/Deliveries/DeliveryHistory.component.d.ts +8 -0
  14. package/dist/components/business/Deliveries/DeliveryHistory.component.spec.d.ts +1 -0
  15. package/dist/components/business/Deliveries/DeliverySubscriptionForm.d.ts +23 -0
  16. package/dist/components/business/Deliveries/DeliverySubscriptions.component.d.ts +9 -0
  17. package/dist/components/business/Deliveries/DeliverySubscriptions.component.spec.d.ts +1 -0
  18. package/dist/components/business/Deliveries/ScheduledTaskForm.d.ts +21 -0
  19. package/dist/components/business/Deliveries/ScheduledTasks.component.d.ts +9 -0
  20. package/dist/components/business/Deliveries/ScheduledTasks.component.spec.d.ts +1 -0
  21. package/dist/components/business/Deliveries/deliveries.logic.d.ts +35 -0
  22. package/dist/components/business/Deliveries/deliveries.logic.spec.d.ts +1 -0
  23. package/dist/components/business/Deliveries/deliveries.types.d.ts +65 -0
  24. package/dist/components/business/Deliveries/test-support/deliveries.fixtures.d.ts +19 -0
  25. package/dist/components/business/Deliveries/test-support/row-menu.d.ts +4 -0
  26. package/dist/components/business/Deliveries/use-paged-list.hook.d.ts +25 -0
  27. package/dist/components/business/index.d.ts +4 -0
  28. package/dist/cookie-consent.js +2 -2
  29. package/dist/{design-theme-GNwBGEo_.js → design-theme-Bc2sMuUP.js} +1 -1
  30. package/dist/{editors-npV-IKED.js → editors-CGj-vsZu.js} +27 -27
  31. package/dist/editors.js +1 -1
  32. package/dist/hooks/use-rich-intl.hook.d.ts +432 -18
  33. package/dist/{index-BUwk65yN.js → index-5lpeThh7.js} +2 -2
  34. package/dist/{index-CqQ3PZ3K.js → index-853Jaoqw.js} +3 -3
  35. package/dist/{index-BGhYJfRf.js → index-B4PJ4K6l.js} +2 -2
  36. package/dist/{index-B7TpUAN3.js → index-BISOeVc7.js} +2 -2
  37. package/dist/{index-DnFO_WNV.js → index-BS3QPrVM.js} +4 -4
  38. package/dist/{index-C1_3Bq6c.js → index-BVsU-XEb.js} +2 -2
  39. package/dist/{index-C52yVIrz.js → index-Bxpp4VC9.js} +2 -2
  40. package/dist/{index-Dd5hKcko.js → index-CNfYiPB9.js} +2 -2
  41. package/dist/{index-B0uq2NNW.js → index-CONaN903.js} +2 -2
  42. package/dist/{index-C7tcg6JR.js → index-CTsQY6zW.js} +3 -3
  43. package/dist/{index-CboA-nSE.js → index-CYmjv9TK.js} +4 -4
  44. package/dist/{index-sK15Uy0d.js → index-DKMFAW5f.js} +1 -1
  45. package/dist/{index-CAyUKp6J.js → index-DOrEPYZN.js} +3 -3
  46. package/dist/{index-CCVhl3JV.js → index-DfnEQYyW.js} +2 -2
  47. package/dist/{index-bmHi0NgU.js → index-DrgdyC6J.js} +2 -2
  48. package/dist/{index-Cp4UAUdF.js → index-DvrKcy8f.js} +2 -2
  49. package/dist/{index-CtRut8xk.js → index-DxZ1bG6u.js} +2 -2
  50. package/dist/{index-C8xWjIs7.js → index-DykCZUJc.js} +4 -4
  51. package/dist/{index-BtesgJeO.js → index-YX_yu3BN.js} +2 -2
  52. package/dist/{index-4ZuDYpO-.js → index-_3uQ1KPn.js} +3 -3
  53. package/dist/{index-BP3DenBU.js → index-a62vDo6s.js} +2 -2
  54. package/dist/index.js +10831 -9213
  55. package/dist/legacy.js +5 -5
  56. package/dist/translations/en.d.ts +206 -1
  57. package/dist/translations/fr.d.ts +206 -1
  58. package/package.json +8 -3
  59. package/test-results/catalog/.last-run.json +4 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog — @abyss-project/commons-front-core
2
2
 
3
+ ## 17.2.0
4
+
5
+ Additions only (P5 #792, ADR-0257 decision 10). No export removed, no signature changed.
6
+
7
+ - `DeliverySubscriptions`, `DeliveryHistory` and `ScheduledTasks` (`business`, `components/business/Deliveries/README.md`): the delivery subscriptions, the delivery history (detail and replay) and the scheduled tasks of AbyssFlow, fed by props that return promises. Translations `deliveries.*` (FR and EN).
8
+ - `@abyss-project/flow` becomes an optional peer dependency (`^1.2.0`, the version that ships the delivery models), imported as types only: a host that does not use these components does not install it.
9
+ - `@abyss-project/main` is resolved to 32.0.0 (P5 #792: Flow permissions, webhook delivery metric, signature helper).
10
+
3
11
  ## 17.1.0
4
12
 
5
13
  No export removed, no signature changed (card #286, toasts of the satellites).
@@ -1,103 +1,116 @@
1
- import { dirname, resolve } from 'path';
2
- import { fileURLToPath } from 'url';
3
- import { CATALOG_ENTRIES, CATALOG_THEMES } from './catalog-entries';
4
- import type { CatalogEntry, CatalogTheme } from './catalog-entries';
5
-
6
- // The package is an ES module: no `__dirname`.
7
- const catalogDir = dirname(fileURLToPath(import.meta.url));
8
-
9
- // Which screenshots the catalog produces, shared by `specs/captures.spec.ts` (takes them) and
10
- // `specs/write-capture-index.ts` (lists them in `index.md`).
11
-
12
- export const CAPTURES_DIR = resolve(
13
- catalogDir,
14
- '../../../e2e/screenshots/286/core',
15
- );
16
-
17
- export const DESKTOP_WIDTH = 1440;
18
- export const TABLET_WIDTH = 768;
19
- export const PHONE_WIDTH = 390;
20
-
21
- /** Viewport height per width: a laptop screen, a tablet held in portrait, a phone. */
22
- export const VIEWPORT_HEIGHT: Record<number, number> = {
23
- [DESKTOP_WIDTH]: 900,
24
- [TABLET_WIDTH]: 1024,
25
- [PHONE_WIDTH]: 844,
26
- };
27
-
28
- /** The pages also shown at tablet width: the shell turns into an icon rail there. */
29
- const TABLET_CAPTURES = new Set(['SceneDesktop', 'AppShell']);
30
-
31
- /** A state reached after arrival, captured under its own name. */
32
- export type CaptureState =
33
- | 'arrival'
34
- | 'sheet-open'
35
- | 'list-open'
36
- | 'calendar-open'
37
- | 'panel-open'
38
- | 'menu-open'
39
- | 'settings-open';
40
-
41
- /** File name suffix of each state. */
42
- const STATE_SUFFIX: Record<CaptureState, string> = {
43
- arrival: '',
44
- 'sheet-open': '-feuille',
45
- 'list-open': '-liste',
46
- 'calendar-open': '-calendrier',
47
- 'panel-open': '-ouvert',
48
- 'menu-open': '-ouvert',
49
- 'settings-open': '-reglages',
50
- };
51
-
52
- /** The states shown beyond arrival: what a closed control hides (options, calendar, sheet). */
53
- const EXTRA_STATES: Record<string, CaptureState> = {
54
- SceneMobile: 'sheet-open',
55
- RichSelect: 'list-open',
56
- ComboboxField: 'list-open',
57
- ExpressionSearch: 'list-open',
58
- DateField: 'calendar-open',
59
- NotificationsMenu: 'panel-open',
60
- AccountMenu: 'panel-open',
61
- ValueMenu: 'menu-open',
62
- CookieConsent: 'settings-open',
63
- };
64
-
65
- export interface Capture {
66
- entry: CatalogEntry;
67
- theme: CatalogTheme;
68
- width: number;
69
- state: CaptureState;
70
- file: string;
71
- }
72
-
73
- const widthsOf = (entry: CatalogEntry): number[] => [
74
- DESKTOP_WIDTH,
75
- ...(TABLET_CAPTURES.has(entry.name) ? [TABLET_WIDTH] : []),
76
- ...(entry.mobileCapture ? [PHONE_WIDTH] : []),
77
- ];
78
-
79
- const statesOf = (entry: CatalogEntry): CaptureState[] => {
80
- const extra = EXTRA_STATES[entry.name];
81
- return extra === undefined ? ['arrival'] : ['arrival', extra];
82
- };
83
-
84
- const fileName = (
85
- entry: CatalogEntry,
86
- theme: CatalogTheme,
87
- width: number,
88
- state: CaptureState,
89
- ) => `${entry.slug}${STATE_SUFFIX[state]}-${theme}-${width}.png`;
90
-
91
- export const CAPTURES: Capture[] = CATALOG_ENTRIES.flatMap((entry) =>
92
- statesOf(entry).flatMap((state) =>
93
- CATALOG_THEMES.flatMap((theme) =>
94
- widthsOf(entry).map((width) => ({
95
- entry,
96
- theme,
97
- width,
98
- state,
99
- file: fileName(entry, theme, width, state),
100
- })),
101
- ),
102
- ),
103
- );
1
+ import { dirname, resolve } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ import { CATALOG_ENTRIES, CATALOG_THEMES } from './catalog-entries';
4
+ import type { CatalogEntry, CatalogTheme } from './catalog-entries';
5
+
6
+ // The package is an ES module: no `__dirname`.
7
+ const catalogDir = dirname(fileURLToPath(import.meta.url));
8
+
9
+ // Which screenshots the catalog produces, shared by `specs/captures.spec.ts` (takes them) and
10
+ // `specs/write-capture-index.ts` (lists them in `index.md`).
11
+
12
+ export const CAPTURES_DIR = resolve(
13
+ catalogDir,
14
+ '../../../e2e/screenshots/286/core',
15
+ );
16
+
17
+ export const DESKTOP_WIDTH = 1440;
18
+ export const TABLET_WIDTH = 768;
19
+ export const PHONE_WIDTH = 390;
20
+
21
+ /** Viewport height per width: a laptop screen, a tablet held in portrait, a phone. */
22
+ export const VIEWPORT_HEIGHT: Record<number, number> = {
23
+ [DESKTOP_WIDTH]: 900,
24
+ [TABLET_WIDTH]: 1024,
25
+ [PHONE_WIDTH]: 844,
26
+ };
27
+
28
+ /** The pages also shown at tablet width: the shell turns into an icon rail there. */
29
+ const TABLET_CAPTURES = new Set(['SceneDesktop', 'AppShell']);
30
+
31
+ /** A state reached after arrival, captured under its own name. */
32
+ export type CaptureState =
33
+ | 'arrival'
34
+ | 'sheet-open'
35
+ | 'list-open'
36
+ | 'calendar-open'
37
+ | 'panel-open'
38
+ | 'menu-open'
39
+ | 'settings-open'
40
+ | 'form-open'
41
+ | 'secret-shown'
42
+ | 'delete-confirm'
43
+ | 'detail-open'
44
+ | 'runs-open';
45
+
46
+ /** File name suffix of each state. */
47
+ const STATE_SUFFIX: Record<CaptureState, string> = {
48
+ arrival: '',
49
+ 'sheet-open': '-feuille',
50
+ 'list-open': '-liste',
51
+ 'calendar-open': '-calendrier',
52
+ 'panel-open': '-ouvert',
53
+ 'menu-open': '-ouvert',
54
+ 'settings-open': '-reglages',
55
+ 'form-open': '-formulaire',
56
+ 'secret-shown': '-secret',
57
+ 'delete-confirm': '-suppression',
58
+ 'detail-open': '-detail',
59
+ 'runs-open': '-executions',
60
+ };
61
+
62
+ /** The states shown beyond arrival: what a closed control hides (options, calendar, sheet). */
63
+ const EXTRA_STATES: Record<string, CaptureState[]> = {
64
+ SceneMobile: ['sheet-open'],
65
+ RichSelect: ['list-open'],
66
+ ComboboxField: ['list-open'],
67
+ ExpressionSearch: ['list-open'],
68
+ DateField: ['calendar-open'],
69
+ NotificationsMenu: ['panel-open'],
70
+ AccountMenu: ['panel-open'],
71
+ ValueMenu: ['menu-open'],
72
+ CookieConsent: ['settings-open'],
73
+ // The panels of the delivery components: forms, secret shown once, confirms, detail, run history.
74
+ DeliverySubscriptions: ['form-open', 'secret-shown', 'delete-confirm'],
75
+ DeliveryHistory: ['detail-open'],
76
+ ScheduledTasks: ['form-open', 'secret-shown', 'delete-confirm', 'runs-open'],
77
+ };
78
+
79
+ export interface Capture {
80
+ entry: CatalogEntry;
81
+ theme: CatalogTheme;
82
+ width: number;
83
+ state: CaptureState;
84
+ file: string;
85
+ }
86
+
87
+ const widthsOf = (entry: CatalogEntry): number[] => [
88
+ DESKTOP_WIDTH,
89
+ ...(TABLET_CAPTURES.has(entry.name) ? [TABLET_WIDTH] : []),
90
+ ...(entry.mobileCapture ? [PHONE_WIDTH] : []),
91
+ ];
92
+
93
+ const statesOf = (entry: CatalogEntry): CaptureState[] => {
94
+ return ['arrival', ...(EXTRA_STATES[entry.name] ?? [])];
95
+ };
96
+
97
+ const fileName = (
98
+ entry: CatalogEntry,
99
+ theme: CatalogTheme,
100
+ width: number,
101
+ state: CaptureState,
102
+ ) => `${entry.slug}${STATE_SUFFIX[state]}-${theme}-${width}.png`;
103
+
104
+ export const CAPTURES: Capture[] = CATALOG_ENTRIES.flatMap((entry) =>
105
+ statesOf(entry).flatMap((state) =>
106
+ CATALOG_THEMES.flatMap((theme) =>
107
+ widthsOf(entry).map((width) => ({
108
+ entry,
109
+ theme,
110
+ width,
111
+ state,
112
+ file: fileName(entry, theme, width, state),
113
+ })),
114
+ ),
115
+ ),
116
+ );
@@ -1,140 +1,148 @@
1
- import { ThemeMode } from '../src/theme/tokens/primitives';
2
-
3
- // The catalog pages, as plain data: read by the browser entry (`main.tsx`) and by the Playwright
4
- // specs, which run in Node and must not load React or MUI.
5
-
6
- export type CatalogFamily =
7
- | 'scenes'
8
- | 'structure'
9
- | 'mobile'
10
- | 'states'
11
- | 'data'
12
- | 'meaning'
13
- | 'business'
14
- | 'layers'
15
- | 'navigation'
16
- | 'inputs';
17
-
18
- export interface CatalogEntry {
19
- /** Value of the `component` URL parameter. */
20
- name: string;
21
- family: CatalogFamily;
22
- /** Base name of the screenshots: `<slug>-<theme>-<width>.png`. */
23
- slug: string;
24
- /** Checked by `responsive.spec.ts` at 360, 768 and 1440 px: the pages that change form below 768 px. */
25
- responsive: boolean;
26
- /** Also captured at 390 px: the page changes form below 768 px. */
27
- mobileCapture: boolean;
28
- }
29
-
30
- const entry = (
31
- name: string,
32
- family: CatalogFamily,
33
- slug: string,
34
- options: { responsive?: boolean; mobileCapture?: boolean } = {},
35
- ): CatalogEntry => ({
36
- name,
37
- family,
38
- slug,
39
- responsive: options.responsive ?? false,
40
- mobileCapture: options.mobileCapture ?? false,
41
- });
42
-
43
- const RESPONSIVE = { responsive: true, mobileCapture: true };
44
-
45
- export const CATALOG_ENTRIES: CatalogEntry[] = [
46
- entry('SceneDesktop', 'scenes', 'scene-bureau', RESPONSIVE),
47
- entry('SceneMobile', 'scenes', 'scene-mobile', RESPONSIVE),
48
- entry('AppShell', 'structure', 'app-shell', RESPONSIVE),
49
- entry('PageHeader', 'structure', 'page-header', RESPONSIVE),
50
- entry('Section', 'structure', 'section', RESPONSIVE),
51
- entry('Surface', 'structure', 'surface', RESPONSIVE),
52
- entry('Toolbar', 'structure', 'toolbar', RESPONSIVE),
53
- entry('FilterBar', 'structure', 'filter-bar', RESPONSIVE),
54
- entry('SplitView', 'structure', 'split-view', RESPONSIVE),
55
- entry('Tabs', 'structure', 'tabs', RESPONSIVE),
56
- entry('Accordion', 'structure', 'accordion', RESPONSIVE),
57
- entry('AmbientBackground', 'structure', 'ambient-background', {
58
- mobileCapture: true,
59
- }),
60
- entry('NotificationsMenu', 'structure', 'notifications-menu', {
61
- mobileCapture: true,
62
- }),
63
- entry('AccountMenu', 'structure', 'account-menu'),
64
- entry('Breadcrumbs', 'navigation', 'breadcrumbs', RESPONSIVE),
65
- entry('MobileShell', 'mobile', 'mobile-shell', RESPONSIVE),
66
- entry('BottomSheet', 'mobile', 'bottom-sheet', RESPONSIVE),
67
- entry('ActionBar', 'mobile', 'action-bar', RESPONSIVE),
68
- entry('SwipeDeck', 'mobile', 'swipe-deck', RESPONSIVE),
69
- entry('PageState', 'states', 'page-state', { mobileCapture: true }),
70
- entry('Callout', 'states', 'callout', RESPONSIVE),
71
- entry('ErrorBoundary', 'states', 'error-boundary', { mobileCapture: true }),
72
- entry('DataTable', 'data', 'data-table', RESPONSIVE),
73
- entry('KeyValueList', 'data', 'key-value-list'),
74
- entry('StatTile', 'data', 'stat-tile'),
75
- entry('Sparkline', 'data', 'sparkline'),
76
- entry('Pagination', 'data', 'pagination', RESPONSIVE),
77
- entry('LineChart', 'data', 'line-chart'),
78
- entry('BarChart', 'data', 'bar-chart'),
79
- entry('ChartTheme', 'data', 'chart-theme'),
80
- entry('UsageMeter', 'data', 'usage-meter'),
81
- entry('FacetPanel', 'data', 'facet-panel', { mobileCapture: true }),
82
- entry('StatusBadge', 'meaning', 'status-badge'),
83
- entry('MethodBadge', 'meaning', 'method-badge'),
84
- entry('SeverityBadge', 'meaning', 'severity-badge'),
85
- entry('ScanBadge', 'meaning', 'scan-badge'),
86
- entry('RoleBadge', 'meaning', 'role-badge'),
87
- entry('ToolIcon', 'meaning', 'tool-icon'),
88
- entry('ValueMenu', 'meaning', 'value-menu', { mobileCapture: true }),
89
- entry('Avatar', 'meaning', 'avatar'),
90
- entry('AvatarGroup', 'meaning', 'avatar-group'),
91
- entry('TeamAvatar', 'meaning', 'team-avatar'),
92
- entry('InfectedDownloadModal', 'business', 'infected-download-modal'),
93
- entry('CloudImport', 'business', 'cloud-import', RESPONSIVE),
94
- entry('ImportFromCloudModal', 'business', 'import-from-cloud-modal', {
95
- mobileCapture: true,
96
- }),
97
- entry('QRCodeModal', 'business', 'qr-code-modal', { mobileCapture: true }),
98
- entry('CookieConsent', 'business', 'cookie-consent', {
99
- mobileCapture: true,
100
- }),
101
- entry('Modal', 'layers', 'modal', { mobileCapture: true }),
102
- entry('ConfirmDialog', 'layers', 'confirm-dialog'),
103
- entry('ConfirmDialogWarning', 'layers', 'confirm-dialog-warning'),
104
- entry('Drawer', 'layers', 'drawer'),
105
- entry('PreviewDrawer', 'layers', 'preview-drawer', { mobileCapture: true }),
106
- entry('Menu', 'layers', 'menu'),
107
- entry('AnchoredPanel', 'layers', 'anchored-panel', { mobileCapture: true }),
108
- entry('Toast', 'layers', 'toast', { mobileCapture: true }),
109
- entry('CommandPalette', 'layers', 'command-palette'),
110
- entry('ProductTour', 'layers', 'product-tour', { mobileCapture: true }),
111
- entry('RichSelect', 'inputs', 'rich-select'),
112
- entry('DateField', 'inputs', 'date-field'),
113
- entry('DateRangeField', 'inputs', 'date-range-field'),
114
- entry('ColorField', 'inputs', 'color-field'),
115
- entry('SegmentedControl', 'inputs', 'segmented-control'),
116
- entry('FormField', 'inputs', 'form-field'),
117
- entry('PasswordField', 'inputs', 'password-field', RESPONSIVE),
118
- entry('NumberField', 'inputs', 'number-field'),
119
- entry('SettingsRow', 'inputs', 'settings-row', RESPONSIVE),
120
- entry('CopyField', 'inputs', 'copy-field', RESPONSIVE),
121
- entry('ComboboxField', 'inputs', 'combobox-field', RESPONSIVE),
122
- entry('UserPicker', 'inputs', 'user-picker', RESPONSIVE),
123
- entry('CompanySearchField', 'inputs', 'company-search-field', RESPONSIVE),
124
- entry('EntityImageField', 'inputs', 'entity-image-field', RESPONSIVE),
125
- entry('ContextSelector', 'inputs', 'context-selector', RESPONSIVE),
126
- entry('DropZone', 'inputs', 'drop-zone', RESPONSIVE),
127
- entry('ImportButton', 'inputs', 'import-button'),
128
- entry('MarkdownEditor', 'inputs', 'markdown-editor', RESPONSIVE),
129
- entry('PdfEditor', 'inputs', 'pdf-editor', RESPONSIVE),
130
- entry('ExpressionSearch', 'inputs', 'expression-search', {
131
- mobileCapture: true,
132
- }),
133
- ];
134
-
135
- export const CATALOG_THEMES = [ThemeMode.Dark, ThemeMode.Light] as const;
136
- export type CatalogTheme = (typeof CATALOG_THEMES)[number];
137
-
138
- /** Path of a catalog page, relative to the catalog server. */
139
- export const catalogPath = (name: string, theme: CatalogTheme): string =>
140
- `/?component=${encodeURIComponent(name)}&theme=${theme}`;
1
+ import { ThemeMode } from '../src/theme/tokens/primitives';
2
+
3
+ // The catalog pages, as plain data: read by the browser entry (`main.tsx`) and by the Playwright
4
+ // specs, which run in Node and must not load React or MUI.
5
+
6
+ export type CatalogFamily =
7
+ | 'scenes'
8
+ | 'structure'
9
+ | 'mobile'
10
+ | 'states'
11
+ | 'data'
12
+ | 'meaning'
13
+ | 'business'
14
+ | 'layers'
15
+ | 'navigation'
16
+ | 'inputs';
17
+
18
+ export interface CatalogEntry {
19
+ /** Value of the `component` URL parameter. */
20
+ name: string;
21
+ family: CatalogFamily;
22
+ /** Base name of the screenshots: `<slug>-<theme>-<width>.png`. */
23
+ slug: string;
24
+ /** Checked by `responsive.spec.ts` at 360, 768 and 1440 px: the pages that change form below 768 px. */
25
+ responsive: boolean;
26
+ /** Also captured at 390 px: the page changes form below 768 px. */
27
+ mobileCapture: boolean;
28
+ }
29
+
30
+ const entry = (
31
+ name: string,
32
+ family: CatalogFamily,
33
+ slug: string,
34
+ options: { responsive?: boolean; mobileCapture?: boolean } = {},
35
+ ): CatalogEntry => ({
36
+ name,
37
+ family,
38
+ slug,
39
+ responsive: options.responsive ?? false,
40
+ mobileCapture: options.mobileCapture ?? false,
41
+ });
42
+
43
+ const RESPONSIVE = { responsive: true, mobileCapture: true };
44
+
45
+ export const CATALOG_ENTRIES: CatalogEntry[] = [
46
+ entry('SceneDesktop', 'scenes', 'scene-bureau', RESPONSIVE),
47
+ entry('SceneMobile', 'scenes', 'scene-mobile', RESPONSIVE),
48
+ entry('AppShell', 'structure', 'app-shell', RESPONSIVE),
49
+ entry('PageHeader', 'structure', 'page-header', RESPONSIVE),
50
+ entry('Section', 'structure', 'section', RESPONSIVE),
51
+ entry('Surface', 'structure', 'surface', RESPONSIVE),
52
+ entry('Toolbar', 'structure', 'toolbar', RESPONSIVE),
53
+ entry('FilterBar', 'structure', 'filter-bar', RESPONSIVE),
54
+ entry('SplitView', 'structure', 'split-view', RESPONSIVE),
55
+ entry('Tabs', 'structure', 'tabs', RESPONSIVE),
56
+ entry('Accordion', 'structure', 'accordion', RESPONSIVE),
57
+ entry('AmbientBackground', 'structure', 'ambient-background', {
58
+ mobileCapture: true,
59
+ }),
60
+ entry('NotificationsMenu', 'structure', 'notifications-menu', {
61
+ mobileCapture: true,
62
+ }),
63
+ entry('AccountMenu', 'structure', 'account-menu'),
64
+ entry('Breadcrumbs', 'navigation', 'breadcrumbs', RESPONSIVE),
65
+ entry('MobileShell', 'mobile', 'mobile-shell', RESPONSIVE),
66
+ entry('BottomSheet', 'mobile', 'bottom-sheet', RESPONSIVE),
67
+ entry('ActionBar', 'mobile', 'action-bar', RESPONSIVE),
68
+ entry('SwipeDeck', 'mobile', 'swipe-deck', RESPONSIVE),
69
+ entry('PageState', 'states', 'page-state', { mobileCapture: true }),
70
+ entry('Callout', 'states', 'callout', RESPONSIVE),
71
+ entry('ErrorBoundary', 'states', 'error-boundary', { mobileCapture: true }),
72
+ entry('DataTable', 'data', 'data-table', RESPONSIVE),
73
+ entry('KeyValueList', 'data', 'key-value-list'),
74
+ entry('StatTile', 'data', 'stat-tile'),
75
+ entry('Sparkline', 'data', 'sparkline'),
76
+ entry('Pagination', 'data', 'pagination', RESPONSIVE),
77
+ entry('LineChart', 'data', 'line-chart'),
78
+ entry('BarChart', 'data', 'bar-chart'),
79
+ entry('ChartTheme', 'data', 'chart-theme'),
80
+ entry('UsageMeter', 'data', 'usage-meter'),
81
+ entry('FacetPanel', 'data', 'facet-panel', { mobileCapture: true }),
82
+ entry('StatusBadge', 'meaning', 'status-badge'),
83
+ entry('MethodBadge', 'meaning', 'method-badge'),
84
+ entry('SeverityBadge', 'meaning', 'severity-badge'),
85
+ entry('ScanBadge', 'meaning', 'scan-badge'),
86
+ entry('RoleBadge', 'meaning', 'role-badge'),
87
+ entry('ToolIcon', 'meaning', 'tool-icon'),
88
+ entry('ValueMenu', 'meaning', 'value-menu', { mobileCapture: true }),
89
+ entry('Avatar', 'meaning', 'avatar'),
90
+ entry('AvatarGroup', 'meaning', 'avatar-group'),
91
+ entry('TeamAvatar', 'meaning', 'team-avatar'),
92
+ entry('InfectedDownloadModal', 'business', 'infected-download-modal'),
93
+ entry('CloudImport', 'business', 'cloud-import', RESPONSIVE),
94
+ entry(
95
+ 'DeliverySubscriptions',
96
+ 'business',
97
+ 'delivery-subscriptions',
98
+ RESPONSIVE,
99
+ ),
100
+ entry('DeliveryHistory', 'business', 'delivery-history', RESPONSIVE),
101
+ entry('ScheduledTasks', 'business', 'scheduled-tasks', RESPONSIVE),
102
+ entry('ImportFromCloudModal', 'business', 'import-from-cloud-modal', {
103
+ mobileCapture: true,
104
+ }),
105
+ entry('QRCodeModal', 'business', 'qr-code-modal', { mobileCapture: true }),
106
+ entry('CookieConsent', 'business', 'cookie-consent', {
107
+ mobileCapture: true,
108
+ }),
109
+ entry('Modal', 'layers', 'modal', { mobileCapture: true }),
110
+ entry('ConfirmDialog', 'layers', 'confirm-dialog'),
111
+ entry('ConfirmDialogWarning', 'layers', 'confirm-dialog-warning'),
112
+ entry('Drawer', 'layers', 'drawer'),
113
+ entry('PreviewDrawer', 'layers', 'preview-drawer', { mobileCapture: true }),
114
+ entry('Menu', 'layers', 'menu'),
115
+ entry('AnchoredPanel', 'layers', 'anchored-panel', { mobileCapture: true }),
116
+ entry('Toast', 'layers', 'toast', { mobileCapture: true }),
117
+ entry('CommandPalette', 'layers', 'command-palette'),
118
+ entry('ProductTour', 'layers', 'product-tour', { mobileCapture: true }),
119
+ entry('RichSelect', 'inputs', 'rich-select'),
120
+ entry('DateField', 'inputs', 'date-field'),
121
+ entry('DateRangeField', 'inputs', 'date-range-field'),
122
+ entry('ColorField', 'inputs', 'color-field'),
123
+ entry('SegmentedControl', 'inputs', 'segmented-control'),
124
+ entry('FormField', 'inputs', 'form-field'),
125
+ entry('PasswordField', 'inputs', 'password-field', RESPONSIVE),
126
+ entry('NumberField', 'inputs', 'number-field'),
127
+ entry('SettingsRow', 'inputs', 'settings-row', RESPONSIVE),
128
+ entry('CopyField', 'inputs', 'copy-field', RESPONSIVE),
129
+ entry('ComboboxField', 'inputs', 'combobox-field', RESPONSIVE),
130
+ entry('UserPicker', 'inputs', 'user-picker', RESPONSIVE),
131
+ entry('CompanySearchField', 'inputs', 'company-search-field', RESPONSIVE),
132
+ entry('EntityImageField', 'inputs', 'entity-image-field', RESPONSIVE),
133
+ entry('ContextSelector', 'inputs', 'context-selector', RESPONSIVE),
134
+ entry('DropZone', 'inputs', 'drop-zone', RESPONSIVE),
135
+ entry('ImportButton', 'inputs', 'import-button'),
136
+ entry('MarkdownEditor', 'inputs', 'markdown-editor', RESPONSIVE),
137
+ entry('PdfEditor', 'inputs', 'pdf-editor', RESPONSIVE),
138
+ entry('ExpressionSearch', 'inputs', 'expression-search', {
139
+ mobileCapture: true,
140
+ }),
141
+ ];
142
+
143
+ export const CATALOG_THEMES = [ThemeMode.Dark, ThemeMode.Light] as const;
144
+ export type CatalogTheme = (typeof CATALOG_THEMES)[number];
145
+
146
+ /** Path of a catalog page, relative to the catalog server. */
147
+ export const catalogPath = (name: string, theme: CatalogTheme): string =>
148
+ `/?component=${encodeURIComponent(name)}&theme=${theme}`;
@@ -0,0 +1,66 @@
1
+ import { DeliveryHistory } from '../../src/components/business/Deliveries/DeliveryHistory.component';
2
+ import type { DeliveryHistoryProps } from '../../src/components/business/Deliveries/deliveries.types';
3
+ import {
4
+ delivery,
5
+ deliveryStatus,
6
+ failedDelivery,
7
+ page,
8
+ } from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
9
+ import { Example, LastEvent, Showcase, useEventLog } from '../frame';
10
+
11
+ const POPULATED = [
12
+ delivery(),
13
+ failedDelivery(),
14
+ delivery({
15
+ id: 'delivery-3',
16
+ eventKey: 'event-3',
17
+ deliveryId: 'sub-1:event-3',
18
+ status: deliveryStatus('RETRYING'),
19
+ attemptCount: 2,
20
+ lastResponseCode: 502,
21
+ lastResponseBody: null,
22
+ lastError: 'HTTP 502',
23
+ deliveredAt: null,
24
+ nextAttemptAt: new Date('2026-11-03T10:15:00Z'),
25
+ }),
26
+ ];
27
+
28
+ export const DeliveryHistoryPage = () => {
29
+ const { log } = useEventLog();
30
+ const base = (list: DeliveryHistoryProps['list']): DeliveryHistoryProps => ({
31
+ list,
32
+ get: async (id) => POPULATED.find((row) => row.id === id) ?? delivery(),
33
+ replayDelivery: async (id) => log(`rejouer ${id}`),
34
+ canReplay: true,
35
+ flowUrl: 'https://flow.abyss.example/deliveries',
36
+ });
37
+ return (
38
+ <Showcase
39
+ family="Métier"
40
+ name="DeliveryHistory"
41
+ description="L'historique des livraisons : filtre de statut, détail en panneau (corps, en-têtes envoyés, réponse, déroulé) et rejeu d'une livraison terminée."
42
+ >
43
+ <Example title="Peuplé" maxWidth={1100}>
44
+ <DeliveryHistory {...base(async () => page(POPULATED))} />
45
+ </Example>
46
+ <Example title="Vide" maxWidth={1100}>
47
+ <DeliveryHistory {...base(async () => page([]))} />
48
+ </Example>
49
+ <Example title="En cours de chargement" maxWidth={1100}>
50
+ <DeliveryHistory {...base(() => new Promise(() => undefined))} />
51
+ </Example>
52
+ <Example title="Le chargement a échoué" maxWidth={1100}>
53
+ <DeliveryHistory
54
+ {...base(() => Promise.reject(new Error('Flow indisponible')))}
55
+ />
56
+ </Example>
57
+ <Example title="Sans droit de rejeu" maxWidth={1100}>
58
+ <DeliveryHistory
59
+ {...base(async () => page(POPULATED))}
60
+ canReplay={false}
61
+ />
62
+ </Example>
63
+ <LastEvent />
64
+ </Showcase>
65
+ );
66
+ };