@mmlogic/components 0.4.3 → 0.5.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 (80) hide show
  1. package/dist/cjs/client-layout-RZ3Ix-4a.js +87 -0
  2. package/dist/cjs/{index-CAzwGt9u.js → index-DzRfoAPz.js} +36 -9
  3. package/dist/cjs/index.cjs.js +56 -81
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/mosterdcomponents.cjs.js +3 -3
  6. package/dist/cjs/{mrd-boolean-field_24.cjs.entry.js → mrd-boolean-field_23.cjs.entry.js} +146 -274
  7. package/dist/collection/collection-manifest.json +1 -2
  8. package/dist/collection/components/documents/mrd-document-container/mrd-document-container.css +0 -17
  9. package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +12 -4
  10. package/dist/collection/components/documents/mrd-document-list/mrd-document-list.css +9 -43
  11. package/dist/collection/components/documents/mrd-document-list/mrd-document-list.js +14 -6
  12. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +3 -44
  13. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +37 -85
  14. package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.css +0 -10
  15. package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.css +0 -7
  16. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.css +0 -11
  17. package/dist/collection/components/fields/mrd-hyperlink-field/mrd-hyperlink-field.css +0 -3
  18. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.css +6 -20
  19. package/dist/collection/components/fields/mrd-list-field/mrd-list-field.css +0 -4
  20. package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.css +0 -1
  21. package/dist/collection/components/fields/mrd-relation-field/mrd-relation-field.css +9 -35
  22. package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.css +0 -9
  23. package/dist/collection/components/form/mrd-field/mrd-field.css +0 -13
  24. package/dist/collection/components/form/mrd-form/mrd-form.css +0 -19
  25. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +3 -58
  26. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +25 -66
  27. package/dist/collection/components/table/mrd-table/mrd-table.css +38 -185
  28. package/dist/collection/components/table/mrd-table/mrd-table.js +1 -1
  29. package/dist/collection/dev/app.js +76 -40
  30. package/dist/collection/index.js +1 -0
  31. package/dist/collection/utils/document-attachments.js +20 -0
  32. package/dist/collection/{components/documents/mrd-file-preview → utils}/file-preview-kind.js +4 -4
  33. package/dist/collection/utils/i18n.js +0 -32
  34. package/dist/components/document-attachments.js +1 -0
  35. package/dist/components/field-helpers.js +1 -1
  36. package/dist/components/i18n.js +1 -1
  37. package/dist/components/index.js +1 -1
  38. package/dist/components/mrd-document-container2.js +1 -1
  39. package/dist/components/mrd-document-list2.js +1 -1
  40. package/dist/components/mrd-document-view2.js +1 -1
  41. package/dist/components/mrd-email-field2.js +1 -1
  42. package/dist/components/mrd-form.js +1 -1
  43. package/dist/components/mrd-hyperlink-field2.js +1 -1
  44. package/dist/components/mrd-image-field2.js +1 -1
  45. package/dist/components/mrd-layout-section.js +1 -1
  46. package/dist/components/mrd-number-field2.js +1 -1
  47. package/dist/components/mrd-relation-field2.js +1 -1
  48. package/dist/components/mrd-table2.js +1 -1
  49. package/dist/esm/client-layout-DCOAAH92.js +84 -0
  50. package/dist/esm/{index-DiSEJMA8.js → index-DiSe6vjv.js} +36 -9
  51. package/dist/esm/index.js +30 -80
  52. package/dist/esm/loader.js +3 -3
  53. package/dist/esm/mosterdcomponents.js +4 -4
  54. package/dist/esm/{mrd-boolean-field_24.entry.js → mrd-boolean-field_23.entry.js} +56 -183
  55. package/dist/mosterdcomponents/index.esm.js +1 -1
  56. package/dist/mosterdcomponents/mosterdcomponents.css +7 -1
  57. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  58. package/dist/mosterdcomponents/p-DCOAAH92.js +1 -0
  59. package/dist/mosterdcomponents/p-DiSe6vjv.js +2 -0
  60. package/dist/mosterdcomponents/p-b56f9802.entry.js +1 -0
  61. package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +4 -2
  62. package/dist/types/components/documents/mrd-document-list/mrd-document-list.d.ts +6 -2
  63. package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +21 -27
  64. package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +12 -15
  65. package/dist/types/components.d.ts +49 -187
  66. package/dist/types/index.d.ts +2 -0
  67. package/dist/types/stencil-public-runtime.d.ts +1 -0
  68. package/dist/types/types/client-layout.d.ts +8 -0
  69. package/dist/types/utils/document-attachments.d.ts +8 -0
  70. package/dist/types/utils/file-preview-kind.d.ts +9 -0
  71. package/package.json +10 -12
  72. package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.css +0 -59
  73. package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.js +0 -212
  74. package/dist/components/mrd-file-preview.d.ts +0 -11
  75. package/dist/components/mrd-file-preview.js +0 -1
  76. package/dist/components/mrd-file-preview2.js +0 -1
  77. package/dist/mosterdcomponents/p-DiSEJMA8.js +0 -2
  78. package/dist/mosterdcomponents/p-e816d459.entry.js +0 -1
  79. package/dist/types/components/documents/mrd-file-preview/file-preview-kind.d.ts +0 -9
  80. package/dist/types/components/documents/mrd-file-preview/mrd-file-preview.d.ts +0 -41
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
9
- import { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
9
+ import { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, DocumentAttachment, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
10
10
  import { ListNavigationContext } from "./utils/query-params";
11
11
  import { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
12
12
  export { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
13
- export { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
13
+ export { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, DocumentAttachment, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
14
14
  export { ListNavigationContext } from "./utils/query-params";
15
15
  export { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
16
16
  export namespace Components {
@@ -226,12 +226,17 @@ export namespace Components {
226
226
  }
227
227
  /**
228
228
  * Archetype-driven single-document view. Given a `commons.document` binding and a
229
- * data record, renders the document recognisably — title, file preview/download,
229
+ * data record, renders the document recognisably — title, filename/download,
230
230
  * summary and date — plus a navigation link to the container (the dossier),
231
231
  * instead of a generic field form.
232
232
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
233
233
  * value slots read `data[field]`; the `container` relation slot reads
234
234
  * `data._links[field]` (`{ href, name }`). Empty slots are omitted.
235
+ * This component never renders the file itself (no iframe/image preview) — it
236
+ * only ever exposes the file reference via `mrdAttachments`. The host resolves
237
+ * the href and decides how (or whether) to show it inline, so the preview can
238
+ * live anywhere in the host's own layout instead of being boxed into this
239
+ * component's DOM (see TASK-0165 / FINDING-0111).
235
240
  */
236
241
  interface MrdDocumentView {
237
242
  /**
@@ -247,16 +252,6 @@ export namespace Components {
247
252
  * @default navigator.language
248
253
  */
249
254
  "locale": string;
250
- /**
251
- * Minimum height (px) of the inline preview area — it stretches to fill the available row height in the wide side-by-side layout (see mrd-document-view.scss), and falls back to this height when stacked. Overlay hosts typically pass a smaller value than the full-page default to fit available chrome.
252
- * @default 640
253
- */
254
- "previewHeight": number;
255
- /**
256
- * Signed URL for the file's inline preview (mrd-file-preview), resolved by the host in response to mrdLoadPreview. Empty while unresolved — the preview area shows a loading state until the host injects a value.
257
- * @default ''
258
- */
259
- "previewUrl": string;
260
255
  }
261
256
  interface MrdEmailField {
262
257
  /**
@@ -330,40 +325,6 @@ export namespace Components {
330
325
  */
331
326
  "value": unknown;
332
327
  }
333
- /**
334
- * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
335
- * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
336
- * presentational: the signed URL is used directly as element `src` — a
337
- * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
338
- * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
339
- * `setImagePreview` on mrd-layout-section.
340
- */
341
- interface MrdFilePreview {
342
- /**
343
- * Original file name — used for extension-based detection when `mimeType` is absent, and as alt/title text.
344
- * @default ''
345
- */
346
- "fileName": string;
347
- /**
348
- * The file's own reference href (not the signed preview URL in `src`). When set, an unsupported type falls back to the same download button used elsewhere in the library, so hosts need no new wiring.
349
- * @default ''
350
- */
351
- "href": string;
352
- /**
353
- * @default navigator.language
354
- */
355
- "locale": string;
356
- /**
357
- * Declared mime type (e.g. 'application/pdf', 'image/png'), when known. Authoritative over `fileName` when present.
358
- * @default ''
359
- */
360
- "mimeType": string;
361
- /**
362
- * Signed URL to render.
363
- * @default ''
364
- */
365
- "src": string;
366
- }
367
328
  interface MrdForm {
368
329
  "layout": ClientLayout;
369
330
  /**
@@ -471,11 +432,6 @@ export namespace Components {
471
432
  * @default {}
472
433
  */
473
434
  "data": Record<string, unknown>;
474
- /**
475
- * Minimum height (px) of the commons.document inline file preview — it stretches taller in the wide side-by-side layout. Pass a smaller value when embedding the record in an overlay with limited height.
476
- * @default 640
477
- */
478
- "documentPreviewHeight": number;
479
435
  /**
480
436
  * Items from one layout entry in ClientDashboardMetadata.layouts[].
481
437
  * @default []
@@ -494,10 +450,6 @@ export namespace Components {
494
450
  * Open the lightbox directly with a URL (e.g. after mrdDownload on a FILE field).
495
451
  */
496
452
  "openImagePreview": (url: string) => Promise<void>;
497
- /**
498
- * Provide a resolved signed URL for the commons.document archetype's inline file preview, in response to mrdLoadDocumentPreview.
499
- */
500
- "setDocumentPreviewUrl": (url: string) => Promise<void>;
501
453
  /**
502
454
  * Provide a resolved URL for an IMAGE field. Shows as thumbnail; clicking opens the lightbox.
503
455
  */
@@ -744,7 +696,7 @@ export namespace Components {
744
696
  "parentId": string;
745
697
  /**
746
698
  * Time (ms) to wait for setPage() before retrying a page request; after MAX_RETRY_ATTEMPTS retries the page is marked failed (see failedPages).
747
- * @default REQUEST_TIMEOUT_MS
699
+ * @default 15000
748
700
  */
749
701
  "requestTimeoutMs": number;
750
702
  /**
@@ -903,10 +855,6 @@ export interface MrdFileFieldCustomEvent<T> extends CustomEvent<T> {
903
855
  detail: T;
904
856
  target: HTMLMrdFileFieldElement;
905
857
  }
906
- export interface MrdFilePreviewCustomEvent<T> extends CustomEvent<T> {
907
- detail: T;
908
- target: HTMLMrdFilePreviewElement;
909
- }
910
858
  export interface MrdFormCustomEvent<T> extends CustomEvent<T> {
911
859
  detail: T;
912
860
  target: HTMLMrdFormElement;
@@ -1036,7 +984,7 @@ declare global {
1036
984
  "mrdLoadPage": { page: number; sort: string; path: string; qs: string; nodeId?: string };
1037
985
  "mrdLoadDistinct": { nodeId: string; distinct: string; path: string; qs: string };
1038
986
  "mrdLoadAggregations": { path: string; qs: string; aggQs: string };
1039
- "mrdNavigate": { href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext };
987
+ "mrdNavigate": { href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
1040
988
  "mrdAction": { action: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string };
1041
989
  "mrdUpdateObject": { href: string; values: Record<string, unknown> };
1042
990
  "mrdUpload": { file: File };
@@ -1070,7 +1018,7 @@ declare global {
1070
1018
  interface HTMLMrdDocumentListElementEventMap {
1071
1019
  "mrdLoadDistinct": { nodeId: string; distinct: string; path: string; qs: string };
1072
1020
  "mrdLoadPage": { nodeId: string; page: number; sort: string; path: string; qs: string };
1073
- "mrdNavigate": { href?: string; label: string; listContext?: ListNavigationContext };
1021
+ "mrdNavigate": { href?: string; label: string; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
1074
1022
  "mrdCanCreate": boolean;
1075
1023
  "mrdUpdateObject": { href: string; values: Record<string, unknown> };
1076
1024
  "mrdUpload": { file: File };
@@ -1108,16 +1056,21 @@ declare global {
1108
1056
  interface HTMLMrdDocumentViewElementEventMap {
1109
1057
  "mrdNavigate": { href?: string; label: string };
1110
1058
  "mrdDownload": { href: string; fileName: string };
1111
- "mrdLoadPreview": { href: string };
1059
+ "mrdAttachments": { attachments: DocumentAttachment[] };
1112
1060
  }
1113
1061
  /**
1114
1062
  * Archetype-driven single-document view. Given a `commons.document` binding and a
1115
- * data record, renders the document recognisably — title, file preview/download,
1063
+ * data record, renders the document recognisably — title, filename/download,
1116
1064
  * summary and date — plus a navigation link to the container (the dossier),
1117
1065
  * instead of a generic field form.
1118
1066
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
1119
1067
  * value slots read `data[field]`; the `container` relation slot reads
1120
1068
  * `data._links[field]` (`{ href, name }`). Empty slots are omitted.
1069
+ * This component never renders the file itself (no iframe/image preview) — it
1070
+ * only ever exposes the file reference via `mrdAttachments`. The host resolves
1071
+ * the href and decides how (or whether) to show it inline, so the preview can
1072
+ * live anywhere in the host's own layout instead of being boxed into this
1073
+ * component's DOM (see TASK-0165 / FINDING-0111).
1121
1074
  */
1122
1075
  interface HTMLMrdDocumentViewElement extends Components.MrdDocumentView, HTMLStencilElement {
1123
1076
  addEventListener<K extends keyof HTMLMrdDocumentViewElementEventMap>(type: K, listener: (this: HTMLMrdDocumentViewElement, ev: MrdDocumentViewCustomEvent<HTMLMrdDocumentViewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -1191,32 +1144,6 @@ declare global {
1191
1144
  prototype: HTMLMrdFileFieldElement;
1192
1145
  new (): HTMLMrdFileFieldElement;
1193
1146
  };
1194
- interface HTMLMrdFilePreviewElementEventMap {
1195
- "mrdPreviewReload": void;
1196
- "mrdDownload": { href: string; fileName: string };
1197
- }
1198
- /**
1199
- * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
1200
- * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
1201
- * presentational: the signed URL is used directly as element `src` — a
1202
- * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
1203
- * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
1204
- * `setImagePreview` on mrd-layout-section.
1205
- */
1206
- interface HTMLMrdFilePreviewElement extends Components.MrdFilePreview, HTMLStencilElement {
1207
- addEventListener<K extends keyof HTMLMrdFilePreviewElementEventMap>(type: K, listener: (this: HTMLMrdFilePreviewElement, ev: MrdFilePreviewCustomEvent<HTMLMrdFilePreviewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
1208
- addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1209
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1210
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1211
- removeEventListener<K extends keyof HTMLMrdFilePreviewElementEventMap>(type: K, listener: (this: HTMLMrdFilePreviewElement, ev: MrdFilePreviewCustomEvent<HTMLMrdFilePreviewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
1212
- removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1213
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1214
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1215
- }
1216
- var HTMLMrdFilePreviewElement: {
1217
- prototype: HTMLMrdFilePreviewElement;
1218
- new (): HTMLMrdFilePreviewElement;
1219
- };
1220
1147
  interface HTMLMrdFormElementEventMap {
1221
1148
  "mrdSubmit": Record<string, unknown>;
1222
1149
  "mrdCancel": void;
@@ -1276,12 +1203,12 @@ declare global {
1276
1203
  new (): HTMLMrdImageFieldElement;
1277
1204
  };
1278
1205
  interface HTMLMrdLayoutSectionElementEventMap {
1279
- "mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext };
1206
+ "mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
1280
1207
  "mrdSearch": { query: string; dataClass: string };
1281
1208
  "mrdDownload": { href: string; fileName: string };
1282
1209
  "mrdLoadViewPage": { name: string; page: number; sort: string; path: string; qs: string; nodeId?: string };
1283
1210
  "mrdLoadImage": { fieldName: string; href: string };
1284
- "mrdLoadDocumentPreview": { href: string };
1211
+ "mrdAttachments": { attachments: DocumentAttachment[] };
1285
1212
  "mrdViewAction": { name: string; action: string; dataClass: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string };
1286
1213
  "mrdLoadViewAggregations": { name: string; dataClass: string; path: string; qs: string; aggQs: string };
1287
1214
  "mrdLoadViewDistinct": { name: string; nodeId: string; distinct: string; path: string; qs: string };
@@ -1482,7 +1409,6 @@ declare global {
1482
1409
  "mrd-email-field": HTMLMrdEmailFieldElement;
1483
1410
  "mrd-field": HTMLMrdFieldElement;
1484
1411
  "mrd-file-field": HTMLMrdFileFieldElement;
1485
- "mrd-file-preview": HTMLMrdFilePreviewElement;
1486
1412
  "mrd-form": HTMLMrdFormElement;
1487
1413
  "mrd-hyperlink-field": HTMLMrdHyperlinkFieldElement;
1488
1414
  "mrd-image-field": HTMLMrdImageFieldElement;
@@ -1667,9 +1593,9 @@ declare namespace LocalJSX {
1667
1593
  */
1668
1594
  "onMrdLoadPage"?: (event: MrdDocumentContainerCustomEvent<{ page: number; sort: string; path: string; qs: string; nodeId?: string }>) => void;
1669
1595
  /**
1670
- * A row / document was activated. Host routes to the object page. Documents are always the "quick look" use case, so navigateBehaviour is hardcoded to OVERLAY_PAGE here — unlike the generic VIEW/RELATED_VIEW table path in mrd-layout-section, which takes it from the item's configuration.
1596
+ * A row / document was activated. Host routes to the object page. Documents are always the "quick look" use case, so navigateBehaviour is hardcoded to OVERLAY_PAGE here — unlike the generic VIEW/RELATED_VIEW table path in mrd-layout-section, which takes it from the item's configuration. `attachments` prefetches the clicked row's file slot (see TASK-0169).
1671
1597
  */
1672
- "onMrdNavigate"?: (event: MrdDocumentContainerCustomEvent<{ href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext }>) => void;
1598
+ "onMrdNavigate"?: (event: MrdDocumentContainerCustomEvent<{ href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] }>) => void;
1673
1599
  /**
1674
1600
  * Generic "update an existing object" request, re-emitted from the folder tree (a document was dragged into another folder/container).
1675
1601
  */
@@ -1740,9 +1666,9 @@ declare namespace LocalJSX {
1740
1666
  */
1741
1667
  "onMrdLoadPage"?: (event: MrdDocumentListCustomEvent<{ nodeId: string; page: number; sort: string; path: string; qs: string }>) => void;
1742
1668
  /**
1743
- * A document row was clicked. Host routes to the document object page. `listContext` can be used to re-fetch this exact record (or its neighbours) via `{path}?{qs}&page={index}&size=1`.
1669
+ * A document row was clicked. Host routes to the document object page. `listContext` can be used to re-fetch this exact record (or its neighbours) via `{path}?{qs}&page={index}&size=1`. `attachments` is a prefetch of the clicked row's own file slot (derived from `archetype`) so the host can render a preview immediately, without waiting for the navigated-to page's own mrdAttachments — see TASK-0169 / FINDING-0111.
1744
1670
  */
1745
- "onMrdNavigate"?: (event: MrdDocumentListCustomEvent<{ href?: string; label: string; listContext?: ListNavigationContext }>) => void;
1671
+ "onMrdNavigate"?: (event: MrdDocumentListCustomEvent<{ href?: string; label: string; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] }>) => void;
1746
1672
  /**
1747
1673
  * Generic "update an existing object" request — fired when a document is dragged into another folder/container. Host PATCHes `href` with `values` (no move/folder knowledge needed). `values` carries the new folder string (or null for the container root) and, on a cross-container move, the new container relation href.
1748
1674
  */
@@ -1759,12 +1685,17 @@ declare namespace LocalJSX {
1759
1685
  }
1760
1686
  /**
1761
1687
  * Archetype-driven single-document view. Given a `commons.document` binding and a
1762
- * data record, renders the document recognisably — title, file preview/download,
1688
+ * data record, renders the document recognisably — title, filename/download,
1763
1689
  * summary and date — plus a navigation link to the container (the dossier),
1764
1690
  * instead of a generic field form.
1765
1691
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
1766
1692
  * value slots read `data[field]`; the `container` relation slot reads
1767
1693
  * `data._links[field]` (`{ href, name }`). Empty slots are omitted.
1694
+ * This component never renders the file itself (no iframe/image preview) — it
1695
+ * only ever exposes the file reference via `mrdAttachments`. The host resolves
1696
+ * the href and decides how (or whether) to show it inline, so the preview can
1697
+ * live anywhere in the host's own layout instead of being boxed into this
1698
+ * component's DOM (see TASK-0165 / FINDING-0111).
1768
1699
  */
1769
1700
  interface MrdDocumentView {
1770
1701
  /**
@@ -1781,27 +1712,17 @@ declare namespace LocalJSX {
1781
1712
  */
1782
1713
  "locale"?: string;
1783
1714
  /**
1784
- * Download the document file. Host resolves the href to a signed URL.
1715
+ * The file(s) belonging to this document, fired once on load and again whenever the file slot's value changes (e.g. the overlay is reused for a different document via prev/next). The host resolves the href(s) itself and decides whether/how to render them (e.g. pdf.js next to the layout) — this component does not fetch or preview the file.
1785
1716
  */
1786
- "onMrdDownload"?: (event: MrdDocumentViewCustomEvent<{ href: string; fileName: string }>) => void;
1717
+ "onMrdAttachments"?: (event: MrdDocumentViewCustomEvent<{ attachments: DocumentAttachment[] }>) => void;
1787
1718
  /**
1788
- * The file slot has an href and needs a signed URL for inline preview. Fired once on load and again whenever the file href changes (e.g. the overlay is reused for a different document via prev/next). Host resolves it and calls back with `previewUrl` — the same pattern as mrdLoadImage / setImagePreview on mrd-layout-section.
1719
+ * Download the document file. Host resolves the href to a signed URL.
1789
1720
  */
1790
- "onMrdLoadPreview"?: (event: MrdDocumentViewCustomEvent<{ href: string }>) => void;
1721
+ "onMrdDownload"?: (event: MrdDocumentViewCustomEvent<{ href: string; fileName: string }>) => void;
1791
1722
  /**
1792
1723
  * Navigate to the container (dossier). Host resolves the href and routes.
1793
1724
  */
1794
1725
  "onMrdNavigate"?: (event: MrdDocumentViewCustomEvent<{ href?: string; label: string }>) => void;
1795
- /**
1796
- * Minimum height (px) of the inline preview area — it stretches to fill the available row height in the wide side-by-side layout (see mrd-document-view.scss), and falls back to this height when stacked. Overlay hosts typically pass a smaller value than the full-page default to fit available chrome.
1797
- * @default 640
1798
- */
1799
- "previewHeight"?: number;
1800
- /**
1801
- * Signed URL for the file's inline preview (mrd-file-preview), resolved by the host in response to mrdLoadPreview. Empty while unresolved — the preview area shows a loading state until the host injects a value.
1802
- * @default ''
1803
- */
1804
- "previewUrl"?: string;
1805
1726
  }
1806
1727
  interface MrdEmailField {
1807
1728
  /**
@@ -1888,48 +1809,6 @@ declare namespace LocalJSX {
1888
1809
  */
1889
1810
  "value"?: unknown;
1890
1811
  }
1891
- /**
1892
- * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
1893
- * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
1894
- * presentational: the signed URL is used directly as element `src` — a
1895
- * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
1896
- * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
1897
- * `setImagePreview` on mrd-layout-section.
1898
- */
1899
- interface MrdFilePreview {
1900
- /**
1901
- * Original file name — used for extension-based detection when `mimeType` is absent, and as alt/title text.
1902
- * @default ''
1903
- */
1904
- "fileName"?: string;
1905
- /**
1906
- * The file's own reference href (not the signed preview URL in `src`). When set, an unsupported type falls back to the same download button used elsewhere in the library, so hosts need no new wiring.
1907
- * @default ''
1908
- */
1909
- "href"?: string;
1910
- /**
1911
- * @default navigator.language
1912
- */
1913
- "locale"?: string;
1914
- /**
1915
- * Declared mime type (e.g. 'application/pdf', 'image/png'), when known. Authoritative over `fileName` when present.
1916
- * @default ''
1917
- */
1918
- "mimeType"?: string;
1919
- /**
1920
- * Download the file. Same shape as mrd-document-view / mrd-layout-section's mrdDownload — host resolves `href` to a signed URL.
1921
- */
1922
- "onMrdDownload"?: (event: MrdFilePreviewCustomEvent<{ href: string; fileName: string }>) => void;
1923
- /**
1924
- * The image failed to load — most likely an expired signed URL. Host should fetch a fresh signed URL and update `src`. Note: this is only raised for images. Browsers don't reliably surface HTTP-level failures (e.g. a 403 on an expired URL) through an iframe's load/error events, so the same detection isn't available for PDFs.
1925
- */
1926
- "onMrdPreviewReload"?: (event: MrdFilePreviewCustomEvent<void>) => void;
1927
- /**
1928
- * Signed URL to render.
1929
- * @default ''
1930
- */
1931
- "src"?: string;
1932
- }
1933
1812
  interface MrdForm {
1934
1813
  "layout": ClientLayout;
1935
1814
  /**
@@ -2049,11 +1928,6 @@ declare namespace LocalJSX {
2049
1928
  * @default {}
2050
1929
  */
2051
1930
  "data"?: Record<string, unknown>;
2052
- /**
2053
- * Minimum height (px) of the commons.document inline file preview — it stretches taller in the wide side-by-side layout. Pass a smaller value when embedding the record in an overlay with limited height.
2054
- * @default 640
2055
- */
2056
- "documentPreviewHeight"?: number;
2057
1931
  /**
2058
1932
  * Items from one layout entry in ClientDashboardMetadata.layouts[].
2059
1933
  * @default []
@@ -2068,15 +1942,15 @@ declare namespace LocalJSX {
2068
1942
  * @default navigator.language
2069
1943
  */
2070
1944
  "locale"?: string;
1945
+ /**
1946
+ * Re-emitted from an embedded mrd-document-view (commons.document single-object view) whenever its file slot's value changes. The component never renders the file itself — the host resolves the href(s) and decides how/whether to show them, e.g. in a panel next to this mrd-layout-section.
1947
+ */
1948
+ "onMrdAttachments"?: (event: MrdLayoutSectionCustomEvent<{ attachments: DocumentAttachment[] }>) => void;
2071
1949
  /**
2072
1950
  * Create a new document from an uploaded file; host POSTs `values` to `path`, then calls setViewCreatedObject(name, href) with the new object's href.
2073
1951
  */
2074
1952
  "onMrdCreateObject"?: (event: MrdLayoutSectionCustomEvent<{ name: string; path: string; values: Record<string, unknown> }>) => void;
2075
1953
  "onMrdDownload"?: (event: MrdLayoutSectionCustomEvent<{ href: string; fileName: string }>) => void;
2076
- /**
2077
- * Re-emitted from an embedded mrd-document-view's mrdLoadPreview (commons.document single-object view); host resolves the file href to a signed URL and calls setDocumentPreviewUrl().
2078
- */
2079
- "onMrdLoadDocumentPreview"?: (event: MrdLayoutSectionCustomEvent<{ href: string }>) => void;
2080
1954
  /**
2081
1955
  * Fired once on load for each IMAGE field that has an href; host resolves the URL and calls setImagePreview().
2082
1956
  */
@@ -2093,7 +1967,10 @@ declare namespace LocalJSX {
2093
1967
  * Re-emitted from an embedded mrd-table's or mrd-document-list's mrdLoadPage; host fetches the rows and calls setViewPage(). `nodeId` is present for a document-list folder load.
2094
1968
  */
2095
1969
  "onMrdLoadViewPage"?: (event: MrdLayoutSectionCustomEvent<{ name: string; page: number; sort: string; path: string; qs: string; nodeId?: string }>) => void;
2096
- "onMrdNavigate"?: (event: MrdLayoutSectionCustomEvent<{ href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext }>) => void;
1970
+ /**
1971
+ * `attachments`, when present, prefetches the clicked document row's file slot (see TASK-0169 / FINDING-0111) so the host can render a preview immediately, without waiting for the navigated-to page's own mrdAttachments. Only set for commons.document rows opened from an embedded document view.
1972
+ */
1973
+ "onMrdNavigate"?: (event: MrdLayoutSectionCustomEvent<{ href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] }>) => void;
2097
1974
  "onMrdSearch"?: (event: MrdLayoutSectionCustomEvent<{ query: string; dataClass: string }>) => void;
2098
1975
  /**
2099
1976
  * Generic "update an existing object" request from an embedded document view (a document dragged into another folder). Host PATCHes `href` with `values`.
@@ -2354,7 +2231,7 @@ declare namespace LocalJSX {
2354
2231
  "parentId"?: string;
2355
2232
  /**
2356
2233
  * Time (ms) to wait for setPage() before retrying a page request; after MAX_RETRY_ATTEMPTS retries the page is marked failed (see failedPages).
2357
- * @default REQUEST_TIMEOUT_MS
2234
+ * @default 15000
2358
2235
  */
2359
2236
  "requestTimeoutMs"?: number;
2360
2237
  /**
@@ -2516,8 +2393,6 @@ declare namespace LocalJSX {
2516
2393
  }
2517
2394
  interface MrdDocumentViewAttributes {
2518
2395
  "locale": string;
2519
- "previewUrl": string;
2520
- "previewHeight": number;
2521
2396
  }
2522
2397
  interface MrdEmailFieldAttributes {
2523
2398
  "name": string;
@@ -2540,13 +2415,6 @@ declare namespace LocalJSX {
2540
2415
  "accept": string;
2541
2416
  "maxSize": number;
2542
2417
  }
2543
- interface MrdFilePreviewAttributes {
2544
- "src": string;
2545
- "mimeType": string;
2546
- "fileName": string;
2547
- "href": string;
2548
- "locale": string;
2549
- }
2550
2418
  interface MrdFormAttributes {
2551
2419
  "locale": string;
2552
2420
  "referenceHref": string;
@@ -2573,7 +2441,6 @@ declare namespace LocalJSX {
2573
2441
  }
2574
2442
  interface MrdLayoutSectionAttributes {
2575
2443
  "locale": string;
2576
- "documentPreviewHeight": number;
2577
2444
  }
2578
2445
  interface MrdListFieldAttributes {
2579
2446
  "name": string;
@@ -2674,7 +2541,6 @@ declare namespace LocalJSX {
2674
2541
  "mrd-email-field": Omit<MrdEmailField, keyof MrdEmailFieldAttributes> & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes]?: MrdEmailField[K] } & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes as `attr:${K}`]?: MrdEmailFieldAttributes[K] } & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes as `prop:${K}`]?: MrdEmailField[K] };
2675
2542
  "mrd-field": Omit<MrdField, keyof MrdFieldAttributes> & { [K in keyof MrdField & keyof MrdFieldAttributes]?: MrdField[K] } & { [K in keyof MrdField & keyof MrdFieldAttributes as `attr:${K}`]?: MrdFieldAttributes[K] } & { [K in keyof MrdField & keyof MrdFieldAttributes as `prop:${K}`]?: MrdField[K] };
2676
2543
  "mrd-file-field": Omit<MrdFileField, keyof MrdFileFieldAttributes> & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes]?: MrdFileField[K] } & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes as `attr:${K}`]?: MrdFileFieldAttributes[K] } & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes as `prop:${K}`]?: MrdFileField[K] };
2677
- "mrd-file-preview": Omit<MrdFilePreview, keyof MrdFilePreviewAttributes> & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes]?: MrdFilePreview[K] } & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes as `attr:${K}`]?: MrdFilePreviewAttributes[K] } & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes as `prop:${K}`]?: MrdFilePreview[K] };
2678
2544
  "mrd-form": Omit<MrdForm, keyof MrdFormAttributes> & { [K in keyof MrdForm & keyof MrdFormAttributes]?: MrdForm[K] } & { [K in keyof MrdForm & keyof MrdFormAttributes as `attr:${K}`]?: MrdFormAttributes[K] } & { [K in keyof MrdForm & keyof MrdFormAttributes as `prop:${K}`]?: MrdForm[K] };
2679
2545
  "mrd-hyperlink-field": Omit<MrdHyperlinkField, keyof MrdHyperlinkFieldAttributes> & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes]?: MrdHyperlinkField[K] } & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes as `attr:${K}`]?: MrdHyperlinkFieldAttributes[K] } & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes as `prop:${K}`]?: MrdHyperlinkField[K] };
2680
2546
  "mrd-image-field": Omit<MrdImageField, keyof MrdImageFieldAttributes> & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes]?: MrdImageField[K] } & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes as `attr:${K}`]?: MrdImageFieldAttributes[K] } & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes as `prop:${K}`]?: MrdImageField[K] };
@@ -2728,26 +2594,22 @@ declare module "@stencil/core" {
2728
2594
  "mrd-document-list": LocalJSX.IntrinsicElements["mrd-document-list"] & JSXBase.HTMLAttributes<HTMLMrdDocumentListElement>;
2729
2595
  /**
2730
2596
  * Archetype-driven single-document view. Given a `commons.document` binding and a
2731
- * data record, renders the document recognisably — title, file preview/download,
2597
+ * data record, renders the document recognisably — title, filename/download,
2732
2598
  * summary and date — plus a navigation link to the container (the dossier),
2733
2599
  * instead of a generic field form.
2734
2600
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
2735
2601
  * value slots read `data[field]`; the `container` relation slot reads
2736
2602
  * `data._links[field]` (`{ href, name }`). Empty slots are omitted.
2603
+ * This component never renders the file itself (no iframe/image preview) — it
2604
+ * only ever exposes the file reference via `mrdAttachments`. The host resolves
2605
+ * the href and decides how (or whether) to show it inline, so the preview can
2606
+ * live anywhere in the host's own layout instead of being boxed into this
2607
+ * component's DOM (see TASK-0165 / FINDING-0111).
2737
2608
  */
2738
2609
  "mrd-document-view": LocalJSX.IntrinsicElements["mrd-document-view"] & JSXBase.HTMLAttributes<HTMLMrdDocumentViewElement>;
2739
2610
  "mrd-email-field": LocalJSX.IntrinsicElements["mrd-email-field"] & JSXBase.HTMLAttributes<HTMLMrdEmailFieldElement>;
2740
2611
  "mrd-field": LocalJSX.IntrinsicElements["mrd-field"] & JSXBase.HTMLAttributes<HTMLMrdFieldElement>;
2741
2612
  "mrd-file-field": LocalJSX.IntrinsicElements["mrd-file-field"] & JSXBase.HTMLAttributes<HTMLMrdFileFieldElement>;
2742
- /**
2743
- * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
2744
- * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
2745
- * presentational: the signed URL is used directly as element `src` — a
2746
- * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
2747
- * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
2748
- * `setImagePreview` on mrd-layout-section.
2749
- */
2750
- "mrd-file-preview": LocalJSX.IntrinsicElements["mrd-file-preview"] & JSXBase.HTMLAttributes<HTMLMrdFilePreviewElement>;
2751
2613
  "mrd-form": LocalJSX.IntrinsicElements["mrd-form"] & JSXBase.HTMLAttributes<HTMLMrdFormElement>;
2752
2614
  "mrd-hyperlink-field": LocalJSX.IntrinsicElements["mrd-hyperlink-field"] & JSXBase.HTMLAttributes<HTMLMrdHyperlinkFieldElement>;
2753
2615
  "mrd-image-field": LocalJSX.IntrinsicElements["mrd-image-field"] & JSXBase.HTMLAttributes<HTMLMrdImageFieldElement>;
@@ -1,3 +1,5 @@
1
1
  export * from './types';
2
2
  export type { AlternativeView, ColumnFilter, TableAction, TableColumn } from './utils/cell-renderer';
3
3
  export type { ListNavigationContext } from './utils/query-params';
4
+ export { detectPreviewKind } from './utils/file-preview-kind';
5
+ export type { FilePreviewKind } from './utils/file-preview-kind';
@@ -1070,6 +1070,7 @@ export declare namespace JSXBase {
1070
1070
  importance?: 'low' | 'auto' | 'high';
1071
1071
  height?: number | string;
1072
1072
  loading?: 'lazy' | 'auto' | 'eager';
1073
+ referrerPolicy?: ReferrerPolicy;
1073
1074
  sizes?: string;
1074
1075
  src?: string;
1075
1076
  srcSet?: string;
@@ -87,6 +87,14 @@ export interface RelationSearchResult {
87
87
  label: string;
88
88
  description?: string;
89
89
  }
90
+ /** A single file belonging to a `commons.document`-archetype record. The host
91
+ * resolves `href` to a signed URL and decides how (or whether) to render it
92
+ * inline — the component only ever hands over the reference. */
93
+ export interface DocumentAttachment {
94
+ href: string;
95
+ fileName: string;
96
+ mimeType?: string;
97
+ }
90
98
  /**
91
99
  * A resolved archetype binding as published on a dashboard.
92
100
  * `archetype` is the platform-defined id (e.g. `commons.document`); `slots` maps
@@ -0,0 +1,8 @@
1
+ import { ClientArchetype, DocumentAttachment } from '../types/client-layout';
2
+ /**
3
+ * Extract the `commons.document` archetype's file slot from a data record as a
4
+ * `DocumentAttachment[]` — empty when the slot is unmapped or has no value.
5
+ * Shared by mrd-document-view (on load/data-change) and mrd-document-container
6
+ * (row-click prefetch on mrdNavigate), so both report the exact same shape.
7
+ */
8
+ export declare function attachmentsFromRecord(archetype: ClientArchetype | null | undefined, record: Record<string, unknown> | null | undefined): DocumentAttachment[];
@@ -0,0 +1,9 @@
1
+ /** Pure classification logic for deciding whether a file can be shown inline. */
2
+ export type FilePreviewKind = 'pdf' | 'image' | 'unsupported';
3
+ /**
4
+ * Decide how a file could be rendered given its declared mime type and/or file
5
+ * name. A declared mime type is authoritative when present (a mismatched file
6
+ * name extension is ignored); the file name extension is only consulted as a
7
+ * fallback when no mime type is known.
8
+ */
9
+ export declare function detectPreviewKind(mimeType?: string | null, fileName?: string | null): FilePreviewKind;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmlogic/components",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "description": "Stencil.js web component library for dynamic forms and virtual-scroll data tables",
5
5
  "license": "MIT",
6
6
  "author": "Mosterd",
@@ -34,26 +34,24 @@
34
34
  "scripts": {
35
35
  "build": "stencil build --docs",
36
36
  "start": "stencil build --dev --watch --serve",
37
- "test": "stencil test --spec --e2e",
38
- "test.watch": "stencil test --spec --e2e --watchAll",
37
+ "test": "vitest run",
38
+ "test.watch": "vitest",
39
39
  "generate": "stencil generate"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
44
  "dependencies": {
45
- "@stencil/core": "^4.22.0",
45
+ "@stencil/core": "^4.43.5",
46
46
  "quill": "^2.0.3"
47
47
  },
48
48
  "devDependencies": {
49
- "@stencil/angular-output-target": "^1.3.0",
50
- "@stencil/sass": "^3.2.3",
51
- "@types/jest": "^29.5.14",
49
+ "@stencil/angular-output-target": "^1.4.0",
50
+ "@stencil/sass": "3.2.3",
51
+ "@stencil/vitest": "^1.13.3",
52
52
  "@types/quill": "^2.0.14",
53
- "jest": "^29.7.0",
54
- "jest-cli": "^29.7.0",
55
- "puppeteer": "^21.11.0",
56
- "sass": "^1.69.7",
57
- "typescript": "^5.3.3"
53
+ "sass": "^1.101.0",
54
+ "typescript": "^6.0.3",
55
+ "vitest": "^4.1.10"
58
56
  }
59
57
  }
@@ -1,59 +0,0 @@
1
- :host {
2
- display: block;
3
- width: 100%;
4
- height: 100%;
5
- }
6
-
7
- .mrd-file-preview__frame {
8
- display: block;
9
- width: 100%;
10
- height: 100%;
11
- border: none;
12
- }
13
- .mrd-file-preview__image {
14
- display: block;
15
- max-width: 100%;
16
- max-height: 100%;
17
- margin: 0 auto;
18
- object-fit: contain;
19
- }
20
- .mrd-file-preview__error, .mrd-file-preview__unsupported {
21
- display: flex;
22
- flex-direction: column;
23
- align-items: center;
24
- justify-content: center;
25
- gap: var(--mrd-space-3);
26
- width: 100%;
27
- height: 100%;
28
- min-height: 8rem;
29
- padding: var(--mrd-space-6);
30
- color: var(--mrd-color-neutral-500);
31
- font-size: var(--mrd-font-size-sm);
32
- text-align: center;
33
- }
34
- .mrd-file-preview__error-text {
35
- color: var(--mrd-color-danger);
36
- }
37
- .mrd-file-preview__retry, .mrd-file-preview__download {
38
- display: inline-flex;
39
- align-items: center;
40
- gap: var(--mrd-space-2);
41
- height: 2rem;
42
- padding: 0 var(--mrd-space-3);
43
- border: var(--mrd-border-width) solid var(--mrd-color-neutral-300);
44
- border-radius: var(--mrd-border-radius);
45
- background: var(--mrd-color-white);
46
- color: var(--mrd-color-neutral-700);
47
- font-family: var(--mrd-font-family);
48
- font-size: var(--mrd-font-size-sm);
49
- font-weight: var(--mrd-font-weight-medium);
50
- cursor: pointer;
51
- }
52
- .mrd-file-preview__retry:hover, .mrd-file-preview__download:hover {
53
- background: var(--mrd-color-neutral-100);
54
- color: var(--mrd-color-neutral-900);
55
- }
56
- .mrd-file-preview__download svg {
57
- width: 0.9375rem;
58
- height: 0.9375rem;
59
- }