@abyss-project/commons-front-core 9.4.0 → 9.4.2

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 (71) hide show
  1. package/README.md +10 -0
  2. package/catalog/captures-plan.ts +5 -1
  3. package/catalog/catalog-entries.ts +7 -1
  4. package/catalog/pages/ExpressionSearch.tsx +65 -0
  5. package/catalog/pages/FacetPanel.tsx +81 -0
  6. package/catalog/pages/PageState.tsx +17 -0
  7. package/catalog/pages/PreviewDrawer.tsx +120 -0
  8. package/catalog/pages/ProductTour.tsx +88 -80
  9. package/catalog/pages/Section.tsx +10 -0
  10. package/catalog/pages/StatTile.tsx +13 -0
  11. package/catalog/pages/ValueMenu.tsx +40 -0
  12. package/catalog/pages/index.ts +8 -0
  13. package/catalog/specs/captures.spec.ts +7 -0
  14. package/catalog/specs/expression-search-scroll.spec.ts +33 -0
  15. package/catalog/specs/preview-drawer-trail.spec.ts +38 -0
  16. package/catalog/specs/write-capture-index.ts +1 -0
  17. package/dist/{AbyssCookieConsentProvider-L42RPb5f.js → AbyssCookieConsentProvider-B0_k-lsA.js} +406 -312
  18. package/dist/{CookieConsentSettings.component-CkhtQuGU.js → CookieConsentSettings.component-DPmXSN1B.js} +1 -1
  19. package/dist/components/data/FacetPanel/FacetPanel.d.ts +30 -0
  20. package/dist/components/data/FacetPanel/FacetPanel.spec.d.ts +1 -0
  21. package/dist/components/data/FacetPanel/facet-terms.d.ts +16 -0
  22. package/dist/components/data/StatTile/StatTile.d.ts +4 -1
  23. package/dist/components/data/chart-value-ticks.d.ts +38 -0
  24. package/dist/components/data/chart-value-ticks.spec.d.ts +1 -0
  25. package/dist/components/data/index.d.ts +1 -0
  26. package/dist/components/inputs/ExpressionSearch/ExpressionSearch.d.ts +30 -0
  27. package/dist/components/inputs/ExpressionSearch/ExpressionSearch.spec.d.ts +1 -0
  28. package/dist/components/inputs/ExpressionSearch/suggestion-context.d.ts +20 -0
  29. package/dist/components/inputs/index.d.ts +1 -0
  30. package/dist/components/layers/PreviewDrawer/PreviewDrawer.d.ts +18 -0
  31. package/dist/components/layers/PreviewDrawer/PreviewDrawer.spec.d.ts +1 -0
  32. package/dist/components/layers/PreviewDrawer/usePreviewStack.d.ts +32 -0
  33. package/dist/components/layers/ProductTour/ProductTour.d.ts +3 -3
  34. package/dist/components/layers/ProductTour/product-tour-geometry.d.ts +9 -3
  35. package/dist/components/layers/index.d.ts +2 -0
  36. package/dist/components/meaning/ValueMenu/ValueMenu.d.ts +25 -0
  37. package/dist/components/meaning/ValueMenu/ValueMenu.spec.d.ts +1 -0
  38. package/dist/components/meaning/index.d.ts +1 -0
  39. package/dist/components/states/PageState/PageState.d.ts +9 -2
  40. package/dist/components/structure/Section/Section.d.ts +3 -1
  41. package/dist/cookie-consent.js +2 -2
  42. package/dist/{design-theme-C3DcD-kA.js → design-theme-BI47S5Y9.js} +1 -1
  43. package/dist/hooks/use-rich-intl.hook.d.ts +96 -2
  44. package/dist/{index-BowQxHAl.js → index-1OsboYW9.js} +2 -2
  45. package/dist/{index-Bi1ITcfD.js → index-B0QTV2Ec.js} +2 -2
  46. package/dist/{index-C0jOpBPq.js → index-B8mXWPXG.js} +2 -2
  47. package/dist/{index-BAO0d8HL.js → index-BICvHJrd.js} +4 -4
  48. package/dist/{index-CMTzmSRJ.js → index-BIJlYkrW.js} +4 -4
  49. package/dist/{index-DrSNFgIl.js → index-BP9uZ3Ld.js} +2 -2
  50. package/dist/{index-DZ5svQvp.js → index-BXceTJm5.js} +2 -2
  51. package/dist/{index-sI8PQFKF.js → index-BclTcBBA.js} +3 -3
  52. package/dist/{index-BhRgGLuD.js → index-CCHQ4bPG.js} +2 -2
  53. package/dist/{index-DXLyOn3D.js → index-CPsEeNaw.js} +3 -3
  54. package/dist/{index-5hIRSHTc.js → index-CYAUKJ3V.js} +2 -2
  55. package/dist/{index-BLN9Vvdr.js → index-Co3DPyY5.js} +2 -2
  56. package/dist/{index-B-D0LQjw.js → index-CorDlbIR.js} +3 -3
  57. package/dist/{index-gVg-FLmC.js → index-CzA0TJ1Y.js} +1 -1
  58. package/dist/{index-DBKoCefj.js → index-DPRuF7Ck.js} +4 -4
  59. package/dist/{index-Cny_hr56.js → index-DYZzZCrS.js} +2 -2
  60. package/dist/{index-DyhinvD5.js → index-Di-F_MA0.js} +3 -3
  61. package/dist/{index-Dyp_SF7H.js → index-DwuRDQtG.js} +2 -2
  62. package/dist/{index-CuOhAUX-.js → index-KRGYLUiH.js} +28 -28
  63. package/dist/{index-Y46rQdc3.js → index-MCJIM7Di.js} +2 -2
  64. package/dist/{index-yTDpH9la.js → index-PVQUqoxX.js} +2 -2
  65. package/dist/{index-CvT5zdz7.js → index-Q-bMUnXP.js} +2 -2
  66. package/dist/index.js +5571 -4543
  67. package/dist/legacy.js +4 -4
  68. package/dist/translations/en.d.ts +48 -1
  69. package/dist/translations/fr.d.ts +48 -1
  70. package/package.json +5 -5
  71. package/test-results/catalog/.last-run.json +0 -4
@@ -27,6 +27,8 @@ import { DateFieldPage } from './DateField';
27
27
  import { DateRangeFieldPage } from './DateRangeField';
28
28
  import { DrawerPage } from './Drawer';
29
29
  import { DropZonePage } from './DropZone';
30
+ import { ExpressionSearchPage } from './ExpressionSearch';
31
+ import { FacetPanelPage } from './FacetPanel';
30
32
  import { FilterBarPage } from './FilterBar';
31
33
  import { FormFieldPage } from './FormField';
32
34
  import { ImportButtonPage } from './ImportButton';
@@ -41,6 +43,7 @@ import { NotificationsMenuPage } from './NotificationsMenu';
41
43
  import { NumberFieldPage } from './NumberField';
42
44
  import { PageHeaderPage } from './PageHeader';
43
45
  import { PageStatePage } from './PageState';
46
+ import { PreviewDrawerPage } from './PreviewDrawer';
44
47
  import { ProductTourPage } from './ProductTour';
45
48
  import { QRCodeModalPage } from './QRCodeModal';
46
49
  import { RichSelectPage } from './RichSelect';
@@ -63,6 +66,7 @@ import { ToastPage } from './Toast';
63
66
  import { ToolbarPage } from './Toolbar';
64
67
  import { ToolIconPage } from './ToolIcon';
65
68
  import { UsageMeterPage } from './UsageMeter';
69
+ import { ValueMenuPage } from './ValueMenu';
66
70
 
67
71
  /** Every catalog page, by the `component` URL parameter (`catalog-entries.ts`). */
68
72
  export const CATALOG_PAGES: Record<string, ComponentType> = {
@@ -94,6 +98,8 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
94
98
  DateRangeField: DateRangeFieldPage,
95
99
  Drawer: DrawerPage,
96
100
  DropZone: DropZonePage,
101
+ ExpressionSearch: ExpressionSearchPage,
102
+ FacetPanel: FacetPanelPage,
97
103
  FilterBar: FilterBarPage,
98
104
  FormField: FormFieldPage,
99
105
  ImportButton: ImportButtonPage,
@@ -108,6 +114,7 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
108
114
  NumberField: NumberFieldPage,
109
115
  PageHeader: PageHeaderPage,
110
116
  PageState: PageStatePage,
117
+ PreviewDrawer: PreviewDrawerPage,
111
118
  ProductTour: ProductTourPage,
112
119
  QRCodeModal: QRCodeModalPage,
113
120
  RichSelect: RichSelectPage,
@@ -130,4 +137,5 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
130
137
  Toolbar: ToolbarPage,
131
138
  ToolIcon: ToolIconPage,
132
139
  UsageMeter: UsageMeterPage,
140
+ ValueMenu: ValueMenuPage,
133
141
  };
@@ -32,6 +32,13 @@ const REACH: Record<
32
32
  .click();
33
33
  await expect(page.getByRole('dialog')).toBeVisible();
34
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
+ },
35
42
  // The first top bar trigger of the page: the notifications bell or the account avatar.
36
43
  'panel-open': async (page) => {
37
44
  await page.locator('[aria-haspopup]').first().click();
@@ -0,0 +1,33 @@
1
+ import { expect, test } from '@playwright/test';
2
+ import { ThemeMode } from '../../src/theme/tokens/primitives';
3
+ import { openCatalogPage } from './catalog-page';
4
+
5
+ // ExpressionSearch in a narrow field: the underlined character of a syntax error must be inside
6
+ // the visible part of the field when the error appears (jsdom has no layout, so this is checked
7
+ // in a real browser).
8
+
9
+ const PHONE = { width: 390, height: 844 };
10
+
11
+ test('the underlined error character is in view in a 390 px field', async ({
12
+ page,
13
+ }) => {
14
+ await openCatalogPage(page, 'ExpressionSearch', ThemeMode.Light, PHONE);
15
+ const mark = page.locator('[data-expression-error]').first();
16
+ const input = page.getByRole('combobox').nth(1);
17
+ await expect(mark).toBeAttached();
18
+
19
+ const box = async (locator: typeof mark) => {
20
+ const rect = await locator.evaluate((element) => {
21
+ const { left, right } = element.getBoundingClientRect();
22
+ return { left, right };
23
+ });
24
+ return rect;
25
+ };
26
+ const markBox = await box(mark);
27
+ const inputBox = await box(input);
28
+ expect(await input.evaluate((element) => element.scrollLeft)).toBeGreaterThan(
29
+ 0,
30
+ );
31
+ expect(markBox.left).toBeGreaterThanOrEqual(inputBox.left - 1);
32
+ expect(markBox.right).toBeLessThanOrEqual(inputBox.right + 1);
33
+ });
@@ -0,0 +1,38 @@
1
+ import { expect, test } from '@playwright/test';
2
+ import { ThemeMode } from '../../src/theme/tokens/primitives';
3
+ import { openCatalogPage } from './catalog-page';
4
+
5
+ // PreviewDrawer: the catalog opens four levels on arrival (request, session, log, release). The
6
+ // trail lists all four on a desktop and folds to « … » and the last two on a phone.
7
+
8
+ const trailItems = (page: Parameters<typeof openCatalogPage>[0]) =>
9
+ page
10
+ .getByRole('navigation', { name: 'Fil des aperçus' })
11
+ .getByRole('listitem');
12
+
13
+ test('the trail lists the four levels at 1440 px', async ({ page }) => {
14
+ await openCatalogPage(page, 'PreviewDrawer', ThemeMode.Light, {
15
+ width: 1440,
16
+ height: 900,
17
+ });
18
+ await expect(trailItems(page)).toHaveText([
19
+ 'GET /api/invoices',
20
+ 'Session b41d07ce',
21
+ 'Log e7a90b14',
22
+ 'Version 2.14.0',
23
+ ]);
24
+ });
25
+
26
+ test('the trail folds to an ellipsis and the last two levels at 390 px', async ({
27
+ page,
28
+ }) => {
29
+ await openCatalogPage(page, 'PreviewDrawer', ThemeMode.Light, {
30
+ width: 390,
31
+ height: 844,
32
+ });
33
+ await expect(trailItems(page)).toHaveText([
34
+ '…',
35
+ 'Log e7a90b14',
36
+ 'Version 2.14.0',
37
+ ]);
38
+ });
@@ -25,6 +25,7 @@ const STATE_LABEL: Record<CaptureState, string> = {
25
25
  'list-open': ', liste ouverte',
26
26
  'calendar-open': ', calendrier ouvert',
27
27
  'panel-open': ', panneau ouvert',
28
+ 'menu-open': ', menu ouvert',
28
29
  };
29
30
 
30
31
  const describe = (capture: Capture): string =>