@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
@@ -1,91 +1,145 @@
1
- import { resolve } from 'path';
2
- import { expect, test } from '@playwright/test';
3
- import type { Page } from '@playwright/test';
4
- import { CAPTURES, CAPTURES_DIR, VIEWPORT_HEIGHT } from '../captures-plan';
5
- import type { CaptureState } from '../captures-plan';
6
- import { openCatalogPage, settle } from './catalog-page';
7
-
8
- // Criterion 13: one PNG per component in light and dark at 1440 px, plus 390 px for the
9
- // components that change form below 768 px, and the two composed scenes at 1440 and 390 px.
10
-
11
- /** How each state beyond arrival is reached, and what proves it is shown. */
12
- const REACH: Record<
13
- Exclude<CaptureState, 'arrival'>,
14
- (page: Page) => Promise<void>
15
- > = {
16
- 'sheet-open': async (page) => {
17
- await page
18
- .getByRole('button', { name: /avis-imposition-2026\.pdf/ })
19
- .click();
20
- await expect(
21
- page.getByRole('dialog', { name: 'avis-imposition-2026.pdf' }),
22
- ).toBeVisible();
23
- },
24
- 'list-open': async (page) => {
25
- await page.getByRole('combobox').first().click();
26
- await expect(page.getByRole('listbox')).toBeVisible();
27
- },
28
- 'calendar-open': async (page) => {
29
- await page
30
- .getByRole('button', { name: /Choisir une date/ })
31
- .first()
32
- .click();
33
- await expect(page.getByRole('dialog')).toBeVisible();
34
- },
35
- // The value of a list (six actions): the menu lists every action with its label.
36
- 'menu-open': async (page) => {
37
- await page.getByRole('button', { name: /Actions sur requestId/ }).click();
38
- const menu = page.getByRole('menu').or(page.getByRole('dialog'));
39
- await expect(menu).toBeVisible();
40
- await expect(menu.getByRole('menuitem')).toHaveCount(6);
41
- },
42
- // The cookie banner's settings: the banner leaves while the sheet is open.
43
- 'settings-open': async (page) => {
44
- await page.getByRole('button', { name: 'Personnaliser' }).click();
45
- await expect(
46
- page.getByRole('dialog', { name: 'Personnaliser mes cookies' }),
47
- ).toBeVisible();
48
- await expect(
49
- page.getByRole('dialog', { name: 'Vos préférences de cookies' }),
50
- ).toHaveCount(0);
51
- },
52
- // The first top bar trigger of the page: the notifications bell or the account avatar.
53
- 'panel-open': async (page) => {
54
- await page.locator('[aria-haspopup]').first().click();
55
- await expect(
56
- page.getByRole('dialog').or(page.getByRole('menu')),
57
- ).toBeVisible();
58
- },
59
- };
60
-
61
- for (const capture of CAPTURES) {
62
- test(`capture ${capture.file}`, async ({ page }) => {
63
- await openCatalogPage(page, capture.entry.name, capture.theme, {
64
- width: capture.width,
65
- height: VIEWPORT_HEIGHT[capture.width],
66
- });
67
-
68
- if (capture.state !== 'arrival') {
69
- await REACH[capture.state](page);
70
- await settle(page);
71
- }
72
-
73
- // A taller window rather than `fullPage`: the sticky sidebar (`100vh`) then spans the whole
74
- // page, as it does on screen while scrolling. A mobile frame (`100dvh`) is never taller.
75
- const documentHeight = await page.evaluate(
76
- () => document.documentElement.scrollHeight,
77
- );
78
- if (documentHeight > VIEWPORT_HEIGHT[capture.width]) {
79
- await page.setViewportSize({
80
- width: capture.width,
81
- height: documentHeight,
82
- });
83
- await settle(page);
84
- }
85
-
86
- await page.screenshot({
87
- path: resolve(CAPTURES_DIR, capture.file),
88
- animations: 'disabled',
89
- });
90
- });
91
- }
1
+ import { resolve } from 'path';
2
+ import { expect, test } from '@playwright/test';
3
+ import type { Page } from '@playwright/test';
4
+ import { CAPTURES, CAPTURES_DIR, VIEWPORT_HEIGHT } from '../captures-plan';
5
+ import type { CaptureState } from '../captures-plan';
6
+ import { openCatalogPage, settle } from './catalog-page';
7
+
8
+ // Criterion 13: one PNG per component in light and dark at 1440 px, plus 390 px for the
9
+ // components that change form below 768 px, and the two composed scenes at 1440 and 390 px.
10
+
11
+ /** Opens the « Actions » menu of the first row of the page and picks the item named `item`. */
12
+ const chooseRowAction = async (
13
+ page: Page,
14
+ item: string | RegExp,
15
+ ): Promise<void> => {
16
+ await page
17
+ .getByRole('button', { name: /^Actions de / })
18
+ .first()
19
+ .click();
20
+ await page.getByRole('menuitem', { name: item }).click();
21
+ };
22
+
23
+ /** How each state beyond arrival is reached, and what proves it is shown. */
24
+ const REACH: Record<
25
+ Exclude<CaptureState, 'arrival'>,
26
+ (page: Page) => Promise<void>
27
+ > = {
28
+ 'sheet-open': async (page) => {
29
+ await page
30
+ .getByRole('button', { name: /avis-imposition-2026\.pdf/ })
31
+ .click();
32
+ await expect(
33
+ page.getByRole('dialog', { name: 'avis-imposition-2026.pdf' }),
34
+ ).toBeVisible();
35
+ },
36
+ 'list-open': async (page) => {
37
+ await page.getByRole('combobox').first().click();
38
+ await expect(page.getByRole('listbox')).toBeVisible();
39
+ },
40
+ 'calendar-open': async (page) => {
41
+ await page
42
+ .getByRole('button', { name: /Choisir une date/ })
43
+ .first()
44
+ .click();
45
+ await expect(page.getByRole('dialog')).toBeVisible();
46
+ },
47
+ // The value of a list (six actions): the menu lists every action with its label.
48
+ 'menu-open': async (page) => {
49
+ await page.getByRole('button', { name: /Actions sur requestId/ }).click();
50
+ const menu = page.getByRole('menu').or(page.getByRole('dialog'));
51
+ await expect(menu).toBeVisible();
52
+ await expect(menu.getByRole('menuitem')).toHaveCount(6);
53
+ },
54
+ // The delivery components: the first row's « Actions » menu, then the panel an action opens.
55
+ 'form-open': async (page) => {
56
+ await page
57
+ .getByRole('button', { name: /^Nouvel(le)? (abonnement|tâche)$/ })
58
+ .first()
59
+ .click();
60
+ await expect(
61
+ page.getByRole('dialog', {
62
+ name: /^Nouvel abonnement$|^Nouvelle tâche planifiée$/,
63
+ }),
64
+ ).toBeVisible();
65
+ },
66
+ 'secret-shown': async (page) => {
67
+ await chooseRowAction(page, /Réinitialiser le secret|Régénérer le secret/);
68
+ await page
69
+ .getByRole('dialog')
70
+ .getByRole('button', { name: /^(Réinitialiser|Régénérer)$/ })
71
+ .click();
72
+ await expect(
73
+ page.getByText(/Ce secret n’est affiché qu’une seule fois/),
74
+ ).toBeVisible();
75
+ },
76
+ 'delete-confirm': async (page) => {
77
+ await chooseRowAction(page, 'Supprimer');
78
+ await expect(
79
+ page.getByRole('dialog', { name: /^Supprimer cet(te)? / }),
80
+ ).toBeVisible();
81
+ },
82
+ 'detail-open': async (page) => {
83
+ await chooseRowAction(page, 'Détail de la livraison');
84
+ await expect(
85
+ page.getByRole('dialog', { name: 'Détail de la livraison' }),
86
+ ).toBeVisible();
87
+ await expect(page.getByText('x-abyss-delivery-id').first()).toBeVisible();
88
+ },
89
+ 'runs-open': async (page) => {
90
+ await chooseRowAction(page, 'Exécutions');
91
+ await expect(
92
+ page.getByRole('dialog', { name: /^Exécutions de / }),
93
+ ).toBeVisible();
94
+ await expect(page.getByText('Réussie').first()).toBeVisible();
95
+ },
96
+ // The cookie banner's settings: the banner leaves while the sheet is open.
97
+ 'settings-open': async (page) => {
98
+ await page.getByRole('button', { name: 'Personnaliser' }).click();
99
+ await expect(
100
+ page.getByRole('dialog', { name: 'Personnaliser mes cookies' }),
101
+ ).toBeVisible();
102
+ await expect(
103
+ page.getByRole('dialog', { name: 'Vos préférences de cookies' }),
104
+ ).toHaveCount(0);
105
+ },
106
+ // The first top bar trigger of the page: the notifications bell or the account avatar.
107
+ 'panel-open': async (page) => {
108
+ await page.locator('[aria-haspopup]').first().click();
109
+ await expect(
110
+ page.getByRole('dialog').or(page.getByRole('menu')),
111
+ ).toBeVisible();
112
+ },
113
+ };
114
+
115
+ for (const capture of CAPTURES) {
116
+ test(`capture ${capture.file}`, async ({ page }) => {
117
+ await openCatalogPage(page, capture.entry.name, capture.theme, {
118
+ width: capture.width,
119
+ height: VIEWPORT_HEIGHT[capture.width],
120
+ });
121
+
122
+ if (capture.state !== 'arrival') {
123
+ await REACH[capture.state](page);
124
+ await settle(page);
125
+ }
126
+
127
+ // A taller window rather than `fullPage`: the sticky sidebar (`100vh`) then spans the whole
128
+ // page, as it does on screen while scrolling. A mobile frame (`100dvh`) is never taller.
129
+ const documentHeight = await page.evaluate(
130
+ () => document.documentElement.scrollHeight,
131
+ );
132
+ if (documentHeight > VIEWPORT_HEIGHT[capture.width]) {
133
+ await page.setViewportSize({
134
+ width: capture.width,
135
+ height: documentHeight,
136
+ });
137
+ await settle(page);
138
+ }
139
+
140
+ await page.screenshot({
141
+ path: resolve(CAPTURES_DIR, capture.file),
142
+ animations: 'disabled',
143
+ });
144
+ });
145
+ }
@@ -1,76 +1,81 @@
1
- import { existsSync, mkdirSync, writeFileSync } from 'fs';
2
- import { resolve } from 'path';
3
- import { CAPTURES, CAPTURES_DIR } from '../captures-plan';
4
- import type { Capture, CaptureState } from '../captures-plan';
5
- import type { CatalogFamily } from '../catalog-entries';
6
-
7
- // Global teardown of the catalog run: writes `index.md` next to the screenshots, from the capture
8
- // plan, listing only the files present on disk.
9
-
10
- const FAMILY_TITLES: Record<CatalogFamily, string> = {
11
- scenes: 'Scènes composées (à regarder en premier)',
12
- structure: 'Structure',
13
- mobile: 'Mobile',
14
- states: 'États',
15
- data: 'Données',
16
- meaning: 'Sens',
17
- business: 'Métier',
18
- layers: 'Couches',
19
- navigation: 'Navigation',
20
- inputs: 'Saisie',
21
- };
22
-
23
- const STATE_LABEL: Record<CaptureState, string> = {
24
- arrival: '',
25
- 'sheet-open': ', feuille ouverte',
26
- 'list-open': ', liste ouverte',
27
- 'calendar-open': ', calendrier ouvert',
28
- 'panel-open': ', panneau ouvert',
29
- 'menu-open': ', menu ouvert',
30
- 'settings-open': ', réglages ouverts',
31
- };
32
-
33
- const describe = (capture: Capture): string =>
34
- `${capture.theme === 'dark' ? 'sombre' : 'clair'}, ${capture.width} px${
35
- STATE_LABEL[capture.state]
36
- }`;
37
-
38
- const writeCaptureIndex = (): void => {
39
- mkdirSync(CAPTURES_DIR, { recursive: true });
40
- const present = CAPTURES.filter((capture) =>
41
- existsSync(resolve(CAPTURES_DIR, capture.file)),
42
- );
43
- const families = Object.keys(FAMILY_TITLES) as CatalogFamily[];
44
- const sections = families
45
- .map((family) => {
46
- const lines = present
47
- .filter((capture) => capture.entry.family === family)
48
- .map(
49
- (capture) =>
50
- `- \`${capture.file}\` : ${capture.entry.name}, ${describe(
51
- capture,
52
- )}`,
53
- );
54
- return lines.length === 0
55
- ? ''
56
- : `## ${FAMILY_TITLES[family]}\n\n${lines.join('\n')}\n`;
57
- })
58
- .filter((section) => section !== '');
59
- const missing = CAPTURES.length - present.length;
60
- const content = [
61
- '# Captures du catalogue du core (#286)',
62
- '',
63
- 'Produites par `pnpm --filter @abyss-project/commons-front-core catalog:test` (`catalog/specs/captures.spec.ts`).',
64
- 'Chaque composant en clair et en sombre à 1440 px ; à 390 px aussi ceux qui changent de forme sous 768 px ;',
65
- 'le shell et la scène bureau aussi à 768 px (rail d’icônes).',
66
- '',
67
- `${present.length} fichiers${
68
- missing > 0 ? `, ${missing} manquants (lancement partiel)` : ''
69
- }.`,
70
- '',
71
- ...sections,
72
- ].join('\n');
73
- writeFileSync(resolve(CAPTURES_DIR, 'index.md'), content);
74
- };
75
-
76
- export default writeCaptureIndex;
1
+ import { existsSync, mkdirSync, writeFileSync } from 'fs';
2
+ import { resolve } from 'path';
3
+ import { CAPTURES, CAPTURES_DIR } from '../captures-plan';
4
+ import type { Capture, CaptureState } from '../captures-plan';
5
+ import type { CatalogFamily } from '../catalog-entries';
6
+
7
+ // Global teardown of the catalog run: writes `index.md` next to the screenshots, from the capture
8
+ // plan, listing only the files present on disk.
9
+
10
+ const FAMILY_TITLES: Record<CatalogFamily, string> = {
11
+ scenes: 'Scènes composées (à regarder en premier)',
12
+ structure: 'Structure',
13
+ mobile: 'Mobile',
14
+ states: 'États',
15
+ data: 'Données',
16
+ meaning: 'Sens',
17
+ business: 'Métier',
18
+ layers: 'Couches',
19
+ navigation: 'Navigation',
20
+ inputs: 'Saisie',
21
+ };
22
+
23
+ const STATE_LABEL: Record<CaptureState, string> = {
24
+ arrival: '',
25
+ 'sheet-open': ', feuille ouverte',
26
+ 'list-open': ', liste ouverte',
27
+ 'calendar-open': ', calendrier ouvert',
28
+ 'panel-open': ', panneau ouvert',
29
+ 'menu-open': ', menu ouvert',
30
+ 'settings-open': ', réglages ouverts',
31
+ 'form-open': ', formulaire ouvert',
32
+ 'secret-shown': ', secret affiché une fois',
33
+ 'delete-confirm': ', confirmation de suppression',
34
+ 'detail-open': ', détail ouvert',
35
+ 'runs-open': ', exécutions ouvertes',
36
+ };
37
+
38
+ const describe = (capture: Capture): string =>
39
+ `${capture.theme === 'dark' ? 'sombre' : 'clair'}, ${capture.width} px${
40
+ STATE_LABEL[capture.state]
41
+ }`;
42
+
43
+ const writeCaptureIndex = (): void => {
44
+ mkdirSync(CAPTURES_DIR, { recursive: true });
45
+ const present = CAPTURES.filter((capture) =>
46
+ existsSync(resolve(CAPTURES_DIR, capture.file)),
47
+ );
48
+ const families = Object.keys(FAMILY_TITLES) as CatalogFamily[];
49
+ const sections = families
50
+ .map((family) => {
51
+ const lines = present
52
+ .filter((capture) => capture.entry.family === family)
53
+ .map(
54
+ (capture) =>
55
+ `- \`${capture.file}\` : ${capture.entry.name}, ${describe(
56
+ capture,
57
+ )}`,
58
+ );
59
+ return lines.length === 0
60
+ ? ''
61
+ : `## ${FAMILY_TITLES[family]}\n\n${lines.join('\n')}\n`;
62
+ })
63
+ .filter((section) => section !== '');
64
+ const missing = CAPTURES.length - present.length;
65
+ const content = [
66
+ '# Captures du catalogue du core (#286)',
67
+ '',
68
+ 'Produites par `pnpm --filter @abyss-project/commons-front-core catalog:test` (`catalog/specs/captures.spec.ts`).',
69
+ 'Chaque composant en clair et en sombre à 1440 px ; à 390 px aussi ceux qui changent de forme sous 768 px ;',
70
+ 'le shell et la scène bureau aussi à 768 px (rail d’icônes).',
71
+ '',
72
+ `${present.length} fichiers${
73
+ missing > 0 ? `, ${missing} manquants (lancement partiel)` : ''
74
+ }.`,
75
+ '',
76
+ ...sections,
77
+ ].join('\n');
78
+ writeFileSync(resolve(CAPTURES_DIR, 'index.md'), content);
79
+ };
80
+
81
+ export default writeCaptureIndex;
@@ -3,7 +3,7 @@ import { useState as y, useCallback as p, useEffect as T, useId as h, useRef as
3
3
  import I from "@mui/material/Button";
4
4
  import H from "@mui/material/Switch";
5
5
  import { styled as d } from "@mui/material/styles";
6
- import { p as o, h as ee, d as D, D as O, a as $, t as V, u as A, S as Y, M as te, b as ne } from "./Surface-76bwVL_Z.js";
6
+ import { p as o, h as ee, d as D, D as O, a as $, t as V, u as A, S as Y, M as te, b as ne } from "./Surface-BUxzLLhb.js";
7
7
  import { useQuery as ie, useMutation as oe } from "@tanstack/react-query";
8
8
  import { AbyssCore as W } from "@abyss-project/main";
9
9
  import se from "@mui/material/Link";