@abyss-project/commons-front-core 13.1.1 → 13.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 (61) hide show
  1. package/dist/{AbyssCloud-IuD91X6C.js → AbyssCloud-D_AbU9k7.js} +1 -1
  2. package/dist/AbyssCookieConsentProvider-Ds99df0E.js +4562 -0
  3. package/dist/{CookieConsentSettings.component-ZF6umBSH.js → CookieConsentSettings.component-DoWLHqw5.js} +10 -9
  4. package/dist/{Tabs-CYy30PTc.js → Tabs-C1qcQ2i5.js} +1 -1
  5. package/dist/{isSymbol-CubIld3H.js → clsx-D8ItxkrZ.js} +73 -73
  6. package/dist/components/CodeEditor/CodeEditor.component.d.ts +29 -0
  7. package/dist/components/CodeEditor/DataSourceBrowser/path-formatter.utils.d.ts +14 -0
  8. package/dist/components/CodeEditor/DataSourceBrowser/types.d.ts +17 -0
  9. package/dist/components/CodeEditor/ExpressionCodeEditor.component.d.ts +13 -0
  10. package/dist/components/CodeEditor/ExpressionCodeEditor.component.spec.d.ts +1 -0
  11. package/dist/components/CodeEditor/FullScreenMonacoEditor.component.d.ts +13 -0
  12. package/dist/components/CodeEditor/index.d.ts +7 -0
  13. package/dist/components/CodeEditor/monaco-types-generator.d.ts +40 -0
  14. package/dist/components/ScanStatus/InfectedDownloadWarningModal.d.ts +57 -0
  15. package/dist/components/ScanStatus/InfectedDownloadWarningModal.spec.d.ts +1 -0
  16. package/dist/components/ScanStatus/ScanStatusIndicator.d.ts +102 -0
  17. package/dist/components/ScanStatus/ScanStatusIndicator.spec.d.ts +1 -0
  18. package/dist/components/ScanStatus/index.d.ts +6 -0
  19. package/dist/components/ScanStatus/use-infected-download-guard.hook.d.ts +37 -0
  20. package/dist/components/ScanStatus/use-infected-download-guard.hook.spec.d.ts +1 -0
  21. package/dist/components/data/DataTable/data-table.types.d.ts +5 -0
  22. package/dist/components/index.d.ts +1 -0
  23. package/dist/components/inputs/ExpressionSearch/expression-fade.d.ts +6 -0
  24. package/dist/cookie-consent.js +11 -10
  25. package/dist/{design-theme-jAV6pBoh.js → design-theme-CG4Gc105.js} +6118 -6070
  26. package/dist/{editors-Cs01hAfK.js → editors-CUsZNFfw.js} +15755 -15038
  27. package/dist/editors.d.ts +1 -0
  28. package/dist/editors.js +13 -4
  29. package/dist/hooks/use-rich-intl.hook.d.ts +48 -0
  30. package/dist/{index-BLWFMNK1.js → index-BQ4GXlMJ.js} +1 -1
  31. package/dist/{index-CQhfq-e2.js → index-Ba41aBBN.js} +2 -2
  32. package/dist/{index-Bw9dFzxv.js → index-BhFOCfCj.js} +2 -2
  33. package/dist/{index-CgdrkQAf.js → index-Bn4gTAno.js} +2 -2
  34. package/dist/{index-BB97MmlB.js → index-BzoBMWdL.js} +3 -3
  35. package/dist/{index-BQ-RHsS9.js → index-C7a2XXcz.js} +4 -4
  36. package/dist/{index-BSpED9Jn.js → index-CDpC4_po.js} +2 -2
  37. package/dist/{index-BYymsRFa.js → index-CM0x-TnE.js} +2 -2
  38. package/dist/{index-BG_7wul8.js → index-CYUixRIB.js} +2 -2
  39. package/dist/{index-Ce0hJGR7.js → index-CiDg4J7c.js} +4 -4
  40. package/dist/{index-BJ-WRVfA.js → index-CjV5ui_B.js} +2 -2
  41. package/dist/{index-CQIcz4k-.js → index-D1ro2oTw.js} +2 -2
  42. package/dist/{index-BOB-FVdo.js → index-DEBTvCWD.js} +3 -3
  43. package/dist/{index-DfzHovEF.js → index-DErJ9c2q.js} +2 -2
  44. package/dist/{index-CWzTvLyx.js → index-DobX4g2g.js} +2 -2
  45. package/dist/{index-C64fovtn.js → index-DuMzZrqc.js} +2 -2
  46. package/dist/{index-CHGLrOHZ.js → index-GTkZik4b.js} +3 -3
  47. package/dist/{index-B4BTrYji.js → index-Lyt4_W7a.js} +2 -2
  48. package/dist/{index-C918Bygt.js → index-TB7ekLl-.js} +2 -2
  49. package/dist/{index-BxEgyF6L.js → index-YzYX-H93.js} +3 -3
  50. package/dist/{index-YnJVcsc6.js → index-pnfk6VZ7.js} +4 -4
  51. package/dist/index.js +4799 -4255
  52. package/dist/legacy.js +13124 -13123
  53. package/dist/translations/en.d.ts +24 -0
  54. package/dist/translations/fr.d.ts +24 -0
  55. package/dist/{AbyssCookieConsentProvider-DJTKl58k.js → use-rich-intl.hook-BETUyCkW.js} +191 -4693
  56. package/dist/utils/index.d.ts +1 -0
  57. package/dist/utils/table-column-width.d.ts +58 -0
  58. package/dist/utils/table-column-width.spec.d.ts +1 -0
  59. package/package.json +5 -3
  60. package/vite.config.ts +2 -0
  61. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
@@ -0,0 +1,102 @@
1
+ import { default as React } from 'react';
2
+ import { SxProps, Theme } from '@mui/material';
3
+ /**
4
+ * Shared AbyssProbe scan-status indicator for every hub tool surface (board
5
+ * card documents, atlas documents, extract files, console ticket
6
+ * attachments) — the abyss-main equivalent of AbyssBeam's BeamFileScanChip
7
+ * (apps/front/src/features/tools/beam/components) and abyss-cloud's
8
+ * GalleryFileScanChip, restyled to the same AbyssProbe consumer design so a
9
+ * scanned file reads identically everywhere in the product.
10
+ *
11
+ * Kept decoupled from any one SDK: `@abyss-project/workspace` and
12
+ * `@abyss-project/console` each expose `scanStatus` typed as their own
13
+ * `FileScanStatus`, a structurally identical literal union to
14
+ * `ScanStatusValue` below (verified against both packages' published
15
+ * `.d.ts`), so any DTO's `scanStatus` is directly assignable here without a
16
+ * dependency on either SDK's runtime export (`workspace`' `FileScanStatus` is a
17
+ * type-only alias — it has no runtime object to import).
18
+ *
19
+ * Only two verdicts render anything:
20
+ * - PENDING_SCAN: "en analyse" badge/chip (warning) + rich tooltip, and the
21
+ * thumbnail (where the surface shows one) renders BLURRED — see
22
+ * isScanBlurred.
23
+ * - INFECTED: "Infecté" badge/chip (error) + rich tooltip. The thumbnail
24
+ * stays SHARP: the verdict is already final, so blurring the derived
25
+ * preview adds no protection — only this badge/chip needs to communicate
26
+ * it (mirrors GalleryFileScanChip's isGalleryFileScanGated/
27
+ * isGalleryFileScanBlurred split).
28
+ * CLEAN / SKIPPED / ERROR / null / undefined render nothing — a normal file.
29
+ *
30
+ * **Two visual variants (v2 refinement — "hyper compact" ask).** Default
31
+ * (`compact` unset) renders the full MUI `Chip` (icon + text label) — for
32
+ * roomy surfaces (board card modal document rows, atlas documents panel).
33
+ * `compact` renders an ICON-ONLY badge (no text label) for dense/tight
34
+ * surfaces (console attachment rows, the extract files table) where the
35
+ * full chip visibly overflowed/wrapped. Both variants carry the exact same
36
+ * rich tooltip (title + explanatory body — see `ScanStatusTooltipContent`)
37
+ * on hover/focus; the compact badge relies on it entirely since it drops
38
+ * the text label.
39
+ *
40
+ * Deliberately does not gate/disable any action (download, open, delete...)
41
+ * BY ITSELF: that was the superseded pre-AbyssProbe design's assumption
42
+ * (files were server-side locked while pending and purged once infected, so
43
+ * the UI had to disable dead controls). Neither assumption holds here — this
44
+ * component is a pure visual signal, nothing more. A DELIBERATE download/open
45
+ * of a PENDING or INFECTED file is instead gated by the companion
46
+ * `InfectedDownloadWarningModal` + `useInfectedDownloadGuard`
47
+ * (same directory) — a surface wraps its existing handler with the guard
48
+ * hook rather than this component doing anything itself. See
49
+ * `docs/internal/reviews/2026-07-08-storage-upload-antivirus-analysis.md`
50
+ * §6/§7 (D1/D8) for which hub surfaces are wired.
51
+ */
52
+ export type ScanStatusValue = 'pending_scan' | 'clean' | 'infected' | 'skipped' | 'error';
53
+ /**
54
+ * The 2 verdicts a deliberate download/open action is ever gated behind
55
+ * (see `useInfectedDownloadGuard`) — always kept a subset of
56
+ * `ScanStatusValue` rather than a standalone union so the two can never
57
+ * drift apart.
58
+ */
59
+ export type ScanDownloadGatedStatus = Extract<ScanStatusValue, 'pending_scan' | 'infected'>;
60
+ /** True only for PENDING_SCAN — the sole verdict still being analysed. */
61
+ export declare const isScanPending: (scanStatus: ScanStatusValue | null | undefined) => boolean;
62
+ /** True only for INFECTED — the sole verdict confirmed malicious. */
63
+ export declare const isScanInfected: (scanStatus: ScanStatusValue | null | undefined) => boolean;
64
+ /**
65
+ * True only while pending — the sole verdict whose thumbnail/preview should
66
+ * render BLURRED (see component doc). Always mirrors isScanPending today;
67
+ * kept as its own named helper (rather than reusing isScanPending at call
68
+ * sites) so a surface's blur decision reads intent-first, matching
69
+ * GalleryFileScanChip's isGalleryFileScanBlurred.
70
+ */
71
+ export declare const isScanBlurred: (scanStatus: ScanStatusValue | null | undefined) => boolean;
72
+ /**
73
+ * Inline blur treatment for a thumbnail/preview element mid AV-scan. Plain
74
+ * `CSSProperties` (not `SxProps`) so it merges into either a raw `style=`
75
+ * (e.g. a bare `<img>`) or an MUI `sx=` prop unchanged — the 3 surfaces with
76
+ * an actual image preview (board, atlas, console) render an identical blur
77
+ * instead of three ad-hoc filters.
78
+ */
79
+ export declare const SCAN_PENDING_BLUR_STYLE: React.CSSProperties;
80
+ export interface ScanStatusChipProps {
81
+ status: ScanStatusValue | null | undefined;
82
+ size?: 'small' | 'medium';
83
+ /**
84
+ * Icon-only badge, no text label (B) — for dense/tight surfaces (console
85
+ * attachment rows, the extract files table) where the full chip visibly
86
+ * overflowed ("badge trop long, rend très mal"). The rich tooltip (C)
87
+ * carries all the detail on hover/focus. Leave unset (default) on roomy
88
+ * surfaces (board card modal, atlas documents panel), which keep the
89
+ * full icon+text chip.
90
+ */
91
+ compact?: boolean;
92
+ sx?: SxProps<Theme>;
93
+ }
94
+ /**
95
+ * The per-file AV verdict indicator. Renders the "en analyse" (pending) or
96
+ * "Infecté" (infected) chip/badge with a rich tooltip; renders nothing for
97
+ * every other status. Always safe to render unconditionally — callers don't
98
+ * need to guard with isScanPending/isScanInfected first (mirrors
99
+ * BeamFileScanChip).
100
+ */
101
+ export declare const ScanStatusChip: React.FC<ScanStatusChipProps>;
102
+ export default ScanStatusChip;
@@ -0,0 +1,6 @@
1
+ export { ScanStatusChip, SCAN_PENDING_BLUR_STYLE, isScanBlurred, isScanInfected, isScanPending, } from './ScanStatusIndicator';
2
+ export type { ScanDownloadGatedStatus, ScanStatusChipProps, ScanStatusValue, } from './ScanStatusIndicator';
3
+ export { InfectedDownloadWarningModal } from './InfectedDownloadWarningModal';
4
+ export type { InfectedDownloadWarningModalProps } from './InfectedDownloadWarningModal';
5
+ export { useInfectedDownloadGuard } from './use-infected-download-guard.hook';
6
+ export type { UseInfectedDownloadGuardResult } from './use-infected-download-guard.hook';
@@ -0,0 +1,37 @@
1
+ import { default as React } from 'react';
2
+ import { ScanStatusValue } from './ScanStatusIndicator';
3
+ export interface UseInfectedDownloadGuardResult {
4
+ /**
5
+ * Wrap a download/open action with the scan-status download policy (A):
6
+ * when `scanStatus` is INFECTED or PENDING_SCAN, defers `action` behind
7
+ * the warning modal (resolved only once the user retypes the confirm
8
+ * phrase, with status-appropriate copy/color); for every other status —
9
+ * clean/skipped/error/null/undefined — `action` runs immediately,
10
+ * unchanged. An authenticated owner is allowed to deliberately download
11
+ * BOTH a still-analysing and a confirmed-infected file, each behind the
12
+ * same type-to-confirm gate — only the warning text differs.
13
+ */
14
+ guardDownload: (scanStatus: ScanStatusValue | null | undefined, fileName: string, action: () => void | Promise<void>) => void;
15
+ /** Render this once per surface (anywhere in the tree — it's a portal-based
16
+ * dialog), alongside the surface's other modals. */
17
+ infectedDownloadModal: React.ReactNode;
18
+ }
19
+ /**
20
+ * Companion hook for `InfectedDownloadWarningModal` — see that file for the
21
+ * policy this implements. Keeps the "is this download gated, and by which
22
+ * verdict?" branch and the modal's open/pending state in one place so a hub
23
+ * surface only has to wrap its existing handler, e.g.:
24
+ *
25
+ * ```tsx
26
+ * const { guardDownload, infectedDownloadModal } = useInfectedDownloadGuard();
27
+ * // ...
28
+ * <IconButton onClick={() =>
29
+ * guardDownload(document.scanStatus, document.name, () => handleDownload(document))
30
+ * }>
31
+ * <Download />
32
+ * </IconButton>
33
+ * // ...
34
+ * {infectedDownloadModal}
35
+ * ```
36
+ */
37
+ export declare const useInfectedDownloadGuard: () => UseInfectedDownloadGuardResult;
@@ -23,6 +23,11 @@ export interface DataColumn<T> {
23
23
  text?(row: T): string;
24
24
  /** Column width (`120`, `'20%'`); the columns without one share the rest. */
25
25
  width?: number | string;
26
+ /**
27
+ * For a column without `width`, in px: the narrowest it is laid out. When the columns shown do
28
+ * not fit with it, the table keeps it and scrolls sideways in its frame.
29
+ */
30
+ minWidth?: number;
26
31
  align?: ColumnAlign;
27
32
  sortable?: boolean;
28
33
  /** Sets the cells in the mono family (amounts, identifiers, dates). */
@@ -6,3 +6,4 @@ export * from './meaning';
6
6
  export * from './mobile';
7
7
  export * from './states';
8
8
  export * from './structure';
9
+ export * from './ScanStatus';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The mask over the edges of the expression field that hide a part of a long expression: the text
3
+ * runs on past a faded edge, and scrolls into view. `width` is the length of each fade; the mask
4
+ * only reads the alpha of its colours.
5
+ */
6
+ export declare const fadeMask: (start: boolean, end: boolean, width: string) => string;
@@ -1,19 +1,20 @@
1
- import { A as e, c as a, C as n, D as C, R as i, V as t, d as r, f as A, r as k, e as c, u as l, b, a as f, w as u } from "./AbyssCookieConsentProvider-DJTKl58k.js";
2
- import { C as E } from "./CookieConsentSettings.component-ZF6umBSH.js";
1
+ import { A as s, c as a, C as n, D as C, R as i, V as t, d as r, r as A, e as k, u as c, b as l, a as f, w as b } from "./AbyssCookieConsentProvider-Ds99df0E.js";
2
+ import { C as u } from "./CookieConsentSettings.component-DoWLHqw5.js";
3
+ import { f as E } from "./use-rich-intl.hook-BETUyCkW.js";
3
4
  export {
4
- e as AbyssCookieConsentProvider,
5
+ s as AbyssCookieConsentProvider,
5
6
  a as COOKIE_NAME,
6
7
  n as CookieConsentBanner,
7
- E as CookieConsentSettings,
8
+ u as CookieConsentSettings,
8
9
  C as DEFAULT_PRIVACY_HREF,
9
10
  i as ReconcileAction,
10
11
  t as VALIDITY_DAYS,
11
12
  r as clearCookie,
12
- A as flattenTranslations,
13
- k as readCookie,
14
- c as reconcile,
15
- l as useAbyssCookieConsent,
16
- b as useCookieConsent,
13
+ E as flattenTranslations,
14
+ A as readCookie,
15
+ k as reconcile,
16
+ c as useAbyssCookieConsent,
17
+ l as useCookieConsent,
17
18
  f as useOptionalAbyssCookieConsent,
18
- u as writeCookie
19
+ b as writeCookie
19
20
  };