@abyss-project/commons-front-core 20.0.0 → 20.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.
@@ -1,81 +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
- '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;
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;
@@ -0,0 +1,13 @@
1
+ export interface QuotaReachedDialogProps {
2
+ /**
3
+ * Called after the dialog is hidden, from the upgrade button; the host decides where to send the
4
+ * user. Without it the dialog has no upgrade button.
5
+ */
6
+ onUpgrade?(): void;
7
+ }
8
+ /**
9
+ * The "quota reached" dialog of every Abyss front: mounted once at the app root, it opens when the
10
+ * billing-quota interceptor pushes a payload into `useQuotaDialogStore`, and names the blocked
11
+ * service and metric.
12
+ */
13
+ export declare const QuotaReachedDialog: ({ onUpgrade }: QuotaReachedDialogProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -2,6 +2,7 @@ export * from './InfectedDownloadModal/InfectedDownloadModal';
2
2
  export * from './CloudImport/CloudImport';
3
3
  export * from './ImportFromCloudModal/ImportFromCloudModal';
4
4
  export * from './QRCodeModal/QRCodeModal';
5
+ export * from './QuotaReachedDialog/QuotaReachedDialog';
5
6
  export * from './CookieConsent/AbyssCookieConsentProvider';
6
7
  export * from './CookieConsent/CookieConsentBanner';
7
8
  export * from './CookieConsent/CookieConsentSettings';
@@ -5,6 +5,11 @@ interface CopyFieldBaseProps {
5
5
  onReveal?(): void;
6
6
  /** Label of the copy button, named after what it copies ("Copier la clé"). */
7
7
  copyLabel: string;
8
+ /**
9
+ * Below 768 px, the shown value wraps onto as many lines as it needs instead of being cut by an
10
+ * ellipsis: for an identifier read on a phone to be typed elsewhere. Wider, it stays one line.
11
+ */
12
+ wrapOnPhone?: boolean;
8
13
  }
9
14
  /** The value is known up front. */
10
15
  interface CopyFieldValueProps extends CopyFieldBaseProps {
@@ -31,5 +36,5 @@ export declare const COPY_FEEDBACK_MS = 2000;
31
36
  * a polite live region; a success turns the copy icon into a check mark for a moment, a failure is
32
37
  * also written under the field.
33
38
  */
34
- export declare function CopyField({ value: givenValue, loadValue, masked, onReveal, copyLabel, }: CopyFieldProps): import("react/jsx-runtime").JSX.Element;
39
+ export declare function CopyField({ value: givenValue, loadValue, masked, onReveal, copyLabel, wrapOnPhone, }: CopyFieldProps): import("react/jsx-runtime").JSX.Element;
35
40
  export {};