@abyss-project/commons-front-core 17.1.0 → 17.2.1
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.
- package/CHANGELOG.md +17 -0
- package/catalog/captures-plan.ts +116 -103
- package/catalog/catalog-entries.ts +148 -140
- package/catalog/pages/DeliveryHistory.tsx +66 -0
- package/catalog/pages/DeliverySubscriptions.tsx +110 -0
- package/catalog/pages/ScheduledTasks.tsx +117 -0
- package/catalog/pages/index.ts +165 -159
- package/catalog/specs/captures.spec.ts +145 -91
- package/catalog/specs/responsive.spec.ts +106 -0
- package/catalog/specs/write-capture-index.ts +81 -76
- package/dist/{CookieConsentSettings-CTAyLGkm.js → CookieConsentSettings-CtLrSfve.js} +1 -1
- package/dist/{Surface-76bwVL_Z.js → Surface-BDfRxVLj.js} +502 -90
- package/dist/{Tabs-D2bdAWGo.js → Tabs-DEY2HEqj.js} +99 -99
- package/dist/components/business/Deliveries/DeliveryHistory.component.d.ts +8 -0
- package/dist/components/business/Deliveries/DeliveryHistory.component.spec.d.ts +1 -0
- package/dist/components/business/Deliveries/DeliverySubscriptionForm.d.ts +23 -0
- package/dist/components/business/Deliveries/DeliverySubscriptions.component.d.ts +9 -0
- package/dist/components/business/Deliveries/DeliverySubscriptions.component.spec.d.ts +1 -0
- package/dist/components/business/Deliveries/ScheduledTaskForm.d.ts +21 -0
- package/dist/components/business/Deliveries/ScheduledTasks.component.d.ts +9 -0
- package/dist/components/business/Deliveries/ScheduledTasks.component.spec.d.ts +1 -0
- package/dist/components/business/Deliveries/deliveries.logic.d.ts +35 -0
- package/dist/components/business/Deliveries/deliveries.logic.spec.d.ts +1 -0
- package/dist/components/business/Deliveries/deliveries.types.d.ts +65 -0
- package/dist/components/business/Deliveries/test-support/deliveries.fixtures.d.ts +19 -0
- package/dist/components/business/Deliveries/test-support/row-menu.d.ts +4 -0
- package/dist/components/business/Deliveries/use-paged-list.hook.d.ts +25 -0
- package/dist/components/business/index.d.ts +4 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-GNwBGEo_.js → design-theme-Bd0pEPei.js} +1 -1
- package/dist/{editors-npV-IKED.js → editors-CtkDomwX.js} +27 -27
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +434 -18
- package/dist/{index-CqQ3PZ3K.js → index-B9avfa3r.js} +3 -3
- package/dist/{index-C8xWjIs7.js → index-BcXqvMY8.js} +4 -4
- package/dist/{index-B7TpUAN3.js → index-CEjiERmo.js} +2 -2
- package/dist/{index-Dd5hKcko.js → index-CSdO6zlX.js} +2 -2
- package/dist/{index-C1_3Bq6c.js → index-Ch8JqU5w.js} +2 -2
- package/dist/{index-bmHi0NgU.js → index-Cl3hwdsZ.js} +2 -2
- package/dist/{index-BUwk65yN.js → index-CqgMX8kF.js} +2 -2
- package/dist/{index-BGhYJfRf.js → index-D0EF36wh.js} +2 -2
- package/dist/{index-DnFO_WNV.js → index-DFZlN4E3.js} +4 -4
- package/dist/{index-CAyUKp6J.js → index-DKsvuaEj.js} +3 -3
- package/dist/{index-C52yVIrz.js → index-DVBqUPxf.js} +2 -2
- package/dist/{index-BP3DenBU.js → index-DZbCUZUp.js} +2 -2
- package/dist/{index-CtRut8xk.js → index-DcV2fWbx.js} +2 -2
- package/dist/{index-sK15Uy0d.js → index-DnQguWf1.js} +1 -1
- package/dist/{index-B0uq2NNW.js → index-DtncSsmw.js} +2 -2
- package/dist/{index-4ZuDYpO-.js → index-DtpGwH5a.js} +3 -3
- package/dist/{index-CboA-nSE.js → index-FUuoLSZ0.js} +4 -4
- package/dist/{index-CCVhl3JV.js → index-IVjoNq-p.js} +2 -2
- package/dist/{index-Cp4UAUdF.js → index-SN7FZBya.js} +2 -2
- package/dist/{index-C7tcg6JR.js → index-mUtvzoSi.js} +3 -3
- package/dist/{index-BtesgJeO.js → index-psJ1Q-lU.js} +2 -2
- package/dist/index.js +10831 -9213
- package/dist/legacy.js +5 -5
- package/dist/translations/en.d.ts +207 -1
- package/dist/translations/fr.d.ts +207 -1
- package/package.json +8 -3
- 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
|
-
/**
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'
|
|
29
|
-
await page
|
|
30
|
-
.getByRole('button', { name: /
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
await page.getByRole('
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
await expect(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
).
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
+
}
|
|
@@ -197,6 +197,112 @@ for (const entry of CATALOG_ENTRIES.filter(
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
+
/** The three Deliveries pages and the widths at which their rows must stay whole. */
|
|
201
|
+
const DELIVERY_PAGES = [
|
|
202
|
+
'DeliverySubscriptions',
|
|
203
|
+
'DeliveryHistory',
|
|
204
|
+
'ScheduledTasks',
|
|
205
|
+
];
|
|
206
|
+
const DELIVERY_WIDTHS = [1440, 390];
|
|
207
|
+
const PIXEL_TOLERANCE = 0.5;
|
|
208
|
+
|
|
209
|
+
interface RowFit {
|
|
210
|
+
rows: number;
|
|
211
|
+
actions: number;
|
|
212
|
+
badges: number;
|
|
213
|
+
clipped: string[];
|
|
214
|
+
overflowing: string[];
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* For every table or list of the page (`role="grid"`; the frame around a table, the list itself on
|
|
219
|
+
* a phone): the « Actions de ... » button and the state badge of each row lie fully inside the
|
|
220
|
+
* bounding box of that container, and the text of each badge is no wider than its background.
|
|
221
|
+
*/
|
|
222
|
+
const rowsFit = (page: Page): Promise<RowFit> =>
|
|
223
|
+
page.evaluate((tolerance) => {
|
|
224
|
+
const result: RowFit = {
|
|
225
|
+
rows: 0,
|
|
226
|
+
actions: 0,
|
|
227
|
+
badges: 0,
|
|
228
|
+
clipped: [],
|
|
229
|
+
overflowing: [],
|
|
230
|
+
};
|
|
231
|
+
const grids = document.querySelectorAll('[role="grid"]');
|
|
232
|
+
grids.forEach((grid) => {
|
|
233
|
+
const container =
|
|
234
|
+
grid.tagName === 'TABLE' ? grid.parentElement ?? grid : grid;
|
|
235
|
+
const frame = container.getBoundingClientRect();
|
|
236
|
+
const inside = (box: DOMRect): boolean =>
|
|
237
|
+
box.left >= frame.left - tolerance &&
|
|
238
|
+
box.right <= frame.right + tolerance &&
|
|
239
|
+
box.top >= frame.top - tolerance &&
|
|
240
|
+
box.bottom <= frame.bottom + tolerance;
|
|
241
|
+
result.rows += grid.querySelectorAll('tbody tr, [role="row"]').length;
|
|
242
|
+
grid
|
|
243
|
+
.querySelectorAll('button[aria-label^="Actions de "]')
|
|
244
|
+
.forEach((button) => {
|
|
245
|
+
result.actions += 1;
|
|
246
|
+
if (!inside(button.getBoundingClientRect())) {
|
|
247
|
+
result.clipped.push(
|
|
248
|
+
`${button.getAttribute('aria-label')} (button)`,
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
grid.querySelectorAll('[data-testid="status-dot"]').forEach((dot) => {
|
|
253
|
+
const badge = dot.parentElement;
|
|
254
|
+
if (badge === null) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
result.badges += 1;
|
|
258
|
+
const name = (badge.textContent ?? '').trim();
|
|
259
|
+
const box = badge.getBoundingClientRect();
|
|
260
|
+
if (!inside(box)) {
|
|
261
|
+
result.clipped.push(`${name} (badge)`);
|
|
262
|
+
}
|
|
263
|
+
const walker = document.createTreeWalker(badge, NodeFilter.SHOW_TEXT);
|
|
264
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
265
|
+
const range = document.createRange();
|
|
266
|
+
range.selectNodeContents(node);
|
|
267
|
+
const text = range.getBoundingClientRect();
|
|
268
|
+
if (
|
|
269
|
+
text.width > 0 &&
|
|
270
|
+
(text.right > box.right + tolerance ||
|
|
271
|
+
text.left < box.left - tolerance)
|
|
272
|
+
) {
|
|
273
|
+
result.overflowing.push(
|
|
274
|
+
`${name} (text ${Math.round(
|
|
275
|
+
text.width,
|
|
276
|
+
)} px in a badge of ${Math.round(box.width)} px)`,
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
return result;
|
|
283
|
+
}, PIXEL_TOLERANCE);
|
|
284
|
+
|
|
285
|
+
for (const name of DELIVERY_PAGES) {
|
|
286
|
+
for (const width of DELIVERY_WIDTHS) {
|
|
287
|
+
test(`${name} at ${width} px: the actions button and the state badge of every row fit their container`, async ({
|
|
288
|
+
page,
|
|
289
|
+
}) => {
|
|
290
|
+
await openCatalogPage(page, name, ThemeMode.Dark, {
|
|
291
|
+
width,
|
|
292
|
+
height: HEIGHT,
|
|
293
|
+
});
|
|
294
|
+
const fit = await rowsFit(page);
|
|
295
|
+
expect(fit.rows, 'rows drawn').toBeGreaterThan(0);
|
|
296
|
+
expect(fit.actions, 'actions buttons found').toBeGreaterThan(0);
|
|
297
|
+
expect(fit.badges, 'state badges found').toBeGreaterThan(0);
|
|
298
|
+
expect(fit.clipped, 'clipped by the container').toEqual([]);
|
|
299
|
+
expect(fit.overflowing, 'badge text wider than its background').toEqual(
|
|
300
|
+
[],
|
|
301
|
+
);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
200
306
|
// Criterion C3: on a 360 px phone the action bar shows each label whole, under its icon, on two
|
|
201
307
|
// lines at most; past three actions it keeps two and a « Plus » button.
|
|
202
308
|
test('ActionBar at 360 px: whole labels, two lines at most, « Plus » past three actions', async ({
|
|
@@ -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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
'',
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
'',
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
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-
|
|
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-BDfRxVLj.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";
|