@mmlogic/components 0.4.2 → 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 (98) 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} +175 -287
  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 +20 -5
  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 +36 -11
  12. package/dist/collection/components/documents/mrd-document-list/tree-view.js +1 -1
  13. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +3 -44
  14. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +37 -85
  15. package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.css +0 -10
  16. package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.css +0 -7
  17. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.css +0 -11
  18. package/dist/collection/components/fields/mrd-hyperlink-field/mrd-hyperlink-field.css +0 -3
  19. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.css +6 -20
  20. package/dist/collection/components/fields/mrd-list-field/mrd-list-field.css +0 -4
  21. package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.css +0 -1
  22. package/dist/collection/components/fields/mrd-relation-field/mrd-relation-field.css +9 -35
  23. package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.css +0 -9
  24. package/dist/collection/components/form/mrd-field/mrd-field.css +0 -13
  25. package/dist/collection/components/form/mrd-form/mrd-form.css +0 -19
  26. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +3 -58
  27. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +33 -67
  28. package/dist/collection/components/table/mrd-table/mrd-table.css +38 -185
  29. package/dist/collection/components/table/mrd-table/mrd-table.js +20 -6
  30. package/dist/collection/dev/app.js +80 -43
  31. package/dist/collection/index.js +1 -0
  32. package/dist/collection/utils/document-attachments.js +20 -0
  33. package/dist/collection/{components/documents/mrd-file-preview → utils}/file-preview-kind.js +4 -4
  34. package/dist/collection/utils/i18n.js +0 -32
  35. package/dist/collection/utils/query-params.js +0 -4
  36. package/dist/components/document-attachments.js +1 -0
  37. package/dist/components/field-helpers.js +1 -1
  38. package/dist/components/i18n.js +1 -1
  39. package/dist/components/index.js +1 -1
  40. package/dist/components/mrd-document-container2.js +1 -1
  41. package/dist/components/mrd-document-list2.js +1 -1
  42. package/dist/components/mrd-document-view2.js +1 -1
  43. package/dist/components/mrd-email-field2.js +1 -1
  44. package/dist/components/mrd-form.js +1 -1
  45. package/dist/components/mrd-hyperlink-field2.js +1 -1
  46. package/dist/components/mrd-image-field2.js +1 -1
  47. package/dist/components/mrd-layout-section.js +1 -1
  48. package/dist/components/mrd-number-field2.js +1 -1
  49. package/dist/components/mrd-relation-field2.js +1 -1
  50. package/dist/components/mrd-table2.js +1 -1
  51. package/dist/esm/client-layout-DCOAAH92.js +84 -0
  52. package/dist/esm/{index-DiSEJMA8.js → index-DiSe6vjv.js} +36 -9
  53. package/dist/esm/index.js +30 -80
  54. package/dist/esm/loader.js +3 -3
  55. package/dist/esm/mosterdcomponents.js +4 -4
  56. package/dist/esm/{mrd-boolean-field_24.entry.js → mrd-boolean-field_23.entry.js} +85 -196
  57. package/dist/mosterdcomponents/index.esm.js +1 -1
  58. package/dist/mosterdcomponents/mosterdcomponents.css +7 -1
  59. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  60. package/dist/mosterdcomponents/p-DCOAAH92.js +1 -0
  61. package/dist/mosterdcomponents/p-DiSe6vjv.js +2 -0
  62. package/dist/mosterdcomponents/p-b56f9802.entry.js +1 -0
  63. package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +6 -2
  64. package/dist/types/components/documents/mrd-document-list/mrd-document-list.d.ts +13 -2
  65. package/dist/types/components/documents/mrd-document-list/tree-view.d.ts +1 -1
  66. package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +21 -27
  67. package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +14 -15
  68. package/dist/types/components/table/mrd-table/mrd-table.d.ts +8 -2
  69. package/dist/types/components.d.ts +54 -190
  70. package/dist/types/index.d.ts +3 -0
  71. package/dist/types/stencil-public-runtime.d.ts +1 -0
  72. package/dist/types/types/client-layout.d.ts +8 -0
  73. package/dist/types/utils/document-attachments.d.ts +8 -0
  74. package/dist/types/utils/file-preview-kind.d.ts +9 -0
  75. package/dist/types/utils/query-params.d.ts +14 -0
  76. package/package.json +10 -12
  77. package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.css +0 -59
  78. package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.js +0 -212
  79. package/dist/components/mrd-file-preview.d.ts +0 -11
  80. package/dist/components/mrd-file-preview.js +0 -1
  81. package/dist/components/mrd-file-preview2.js +0 -1
  82. package/dist/mosterdcomponents/cell-renderer-PbcEU4ph.js.map +0 -1
  83. package/dist/mosterdcomponents/client-layout-DCOAAH92.js.map +0 -1
  84. package/dist/mosterdcomponents/field-helpers-CASS3akr.js.map +0 -1
  85. package/dist/mosterdcomponents/file-upload-common-D1ndi6cN.js.map +0 -1
  86. package/dist/mosterdcomponents/format-BAfsQfy1.js.map +0 -1
  87. package/dist/mosterdcomponents/i18n-B1IIkRF9.js.map +0 -1
  88. package/dist/mosterdcomponents/index-AokUFVX0.js.map +0 -1
  89. package/dist/mosterdcomponents/index-CprJSlzK.js.map +0 -1
  90. package/dist/mosterdcomponents/index.esm.js.map +0 -1
  91. package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +0 -1
  92. package/dist/mosterdcomponents/p-DiSEJMA8.js +0 -2
  93. package/dist/mosterdcomponents/p-aae8a9dc.entry.js +0 -1
  94. package/dist/mosterdcomponents/query-params-B1HfnMOl.js.map +0 -1
  95. package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +0 -1
  96. package/dist/mosterdcomponents/validation-DbEViuiw.js.map +0 -1
  97. package/dist/types/components/documents/mrd-file-preview/file-preview-kind.d.ts +0 -9
  98. package/dist/types/components/documents/mrd-file-preview/mrd-file-preview.d.ts +0 -41
@@ -6,10 +6,12 @@
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
+ import { ListNavigationContext } from "./utils/query-params";
10
11
  import { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
11
12
  export { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
12
- 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
+ export { ListNavigationContext } from "./utils/query-params";
13
15
  export { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
14
16
  export namespace Components {
15
17
  interface MrdBooleanField {
@@ -224,12 +226,17 @@ export namespace Components {
224
226
  }
225
227
  /**
226
228
  * Archetype-driven single-document view. Given a `commons.document` binding and a
227
- * data record, renders the document recognisably — title, file preview/download,
229
+ * data record, renders the document recognisably — title, filename/download,
228
230
  * summary and date — plus a navigation link to the container (the dossier),
229
231
  * instead of a generic field form.
230
232
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
231
233
  * value slots read `data[field]`; the `container` relation slot reads
232
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).
233
240
  */
234
241
  interface MrdDocumentView {
235
242
  /**
@@ -245,16 +252,6 @@ export namespace Components {
245
252
  * @default navigator.language
246
253
  */
247
254
  "locale": string;
248
- /**
249
- * 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.
250
- * @default 640
251
- */
252
- "previewHeight": number;
253
- /**
254
- * 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.
255
- * @default ''
256
- */
257
- "previewUrl": string;
258
255
  }
259
256
  interface MrdEmailField {
260
257
  /**
@@ -328,40 +325,6 @@ export namespace Components {
328
325
  */
329
326
  "value": unknown;
330
327
  }
331
- /**
332
- * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
333
- * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
334
- * presentational: the signed URL is used directly as element `src` — a
335
- * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
336
- * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
337
- * `setImagePreview` on mrd-layout-section.
338
- */
339
- interface MrdFilePreview {
340
- /**
341
- * Original file name — used for extension-based detection when `mimeType` is absent, and as alt/title text.
342
- * @default ''
343
- */
344
- "fileName": string;
345
- /**
346
- * 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.
347
- * @default ''
348
- */
349
- "href": string;
350
- /**
351
- * @default navigator.language
352
- */
353
- "locale": string;
354
- /**
355
- * Declared mime type (e.g. 'application/pdf', 'image/png'), when known. Authoritative over `fileName` when present.
356
- * @default ''
357
- */
358
- "mimeType": string;
359
- /**
360
- * Signed URL to render.
361
- * @default ''
362
- */
363
- "src": string;
364
- }
365
328
  interface MrdForm {
366
329
  "layout": ClientLayout;
367
330
  /**
@@ -469,11 +432,6 @@ export namespace Components {
469
432
  * @default {}
470
433
  */
471
434
  "data": Record<string, unknown>;
472
- /**
473
- * 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.
474
- * @default 640
475
- */
476
- "documentPreviewHeight": number;
477
435
  /**
478
436
  * Items from one layout entry in ClientDashboardMetadata.layouts[].
479
437
  * @default []
@@ -492,10 +450,6 @@ export namespace Components {
492
450
  * Open the lightbox directly with a URL (e.g. after mrdDownload on a FILE field).
493
451
  */
494
452
  "openImagePreview": (url: string) => Promise<void>;
495
- /**
496
- * Provide a resolved signed URL for the commons.document archetype's inline file preview, in response to mrdLoadDocumentPreview.
497
- */
498
- "setDocumentPreviewUrl": (url: string) => Promise<void>;
499
453
  /**
500
454
  * Provide a resolved URL for an IMAGE field. Shows as thumbnail; clicking opens the lightbox.
501
455
  */
@@ -742,7 +696,7 @@ export namespace Components {
742
696
  "parentId": string;
743
697
  /**
744
698
  * Time (ms) to wait for setPage() before retrying a page request; after MAX_RETRY_ATTEMPTS retries the page is marked failed (see failedPages).
745
- * @default REQUEST_TIMEOUT_MS
699
+ * @default 15000
746
700
  */
747
701
  "requestTimeoutMs": number;
748
702
  /**
@@ -901,10 +855,6 @@ export interface MrdFileFieldCustomEvent<T> extends CustomEvent<T> {
901
855
  detail: T;
902
856
  target: HTMLMrdFileFieldElement;
903
857
  }
904
- export interface MrdFilePreviewCustomEvent<T> extends CustomEvent<T> {
905
- detail: T;
906
- target: HTMLMrdFilePreviewElement;
907
- }
908
858
  export interface MrdFormCustomEvent<T> extends CustomEvent<T> {
909
859
  detail: T;
910
860
  target: HTMLMrdFormElement;
@@ -1034,7 +984,7 @@ declare global {
1034
984
  "mrdLoadPage": { page: number; sort: string; path: string; qs: string; nodeId?: string };
1035
985
  "mrdLoadDistinct": { nodeId: string; distinct: string; path: string; qs: string };
1036
986
  "mrdLoadAggregations": { path: string; qs: string; aggQs: string };
1037
- "mrdNavigate": { href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour };
987
+ "mrdNavigate": { href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
1038
988
  "mrdAction": { action: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string };
1039
989
  "mrdUpdateObject": { href: string; values: Record<string, unknown> };
1040
990
  "mrdUpload": { file: File };
@@ -1068,7 +1018,7 @@ declare global {
1068
1018
  interface HTMLMrdDocumentListElementEventMap {
1069
1019
  "mrdLoadDistinct": { nodeId: string; distinct: string; path: string; qs: string };
1070
1020
  "mrdLoadPage": { nodeId: string; page: number; sort: string; path: string; qs: string };
1071
- "mrdNavigate": { href?: string; label: string };
1021
+ "mrdNavigate": { href?: string; label: string; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
1072
1022
  "mrdCanCreate": boolean;
1073
1023
  "mrdUpdateObject": { href: string; values: Record<string, unknown> };
1074
1024
  "mrdUpload": { file: File };
@@ -1106,16 +1056,21 @@ declare global {
1106
1056
  interface HTMLMrdDocumentViewElementEventMap {
1107
1057
  "mrdNavigate": { href?: string; label: string };
1108
1058
  "mrdDownload": { href: string; fileName: string };
1109
- "mrdLoadPreview": { href: string };
1059
+ "mrdAttachments": { attachments: DocumentAttachment[] };
1110
1060
  }
1111
1061
  /**
1112
1062
  * Archetype-driven single-document view. Given a `commons.document` binding and a
1113
- * data record, renders the document recognisably — title, file preview/download,
1063
+ * data record, renders the document recognisably — title, filename/download,
1114
1064
  * summary and date — plus a navigation link to the container (the dossier),
1115
1065
  * instead of a generic field form.
1116
1066
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
1117
1067
  * value slots read `data[field]`; the `container` relation slot reads
1118
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).
1119
1074
  */
1120
1075
  interface HTMLMrdDocumentViewElement extends Components.MrdDocumentView, HTMLStencilElement {
1121
1076
  addEventListener<K extends keyof HTMLMrdDocumentViewElementEventMap>(type: K, listener: (this: HTMLMrdDocumentViewElement, ev: MrdDocumentViewCustomEvent<HTMLMrdDocumentViewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -1189,32 +1144,6 @@ declare global {
1189
1144
  prototype: HTMLMrdFileFieldElement;
1190
1145
  new (): HTMLMrdFileFieldElement;
1191
1146
  };
1192
- interface HTMLMrdFilePreviewElementEventMap {
1193
- "mrdPreviewReload": void;
1194
- "mrdDownload": { href: string; fileName: string };
1195
- }
1196
- /**
1197
- * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
1198
- * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
1199
- * presentational: the signed URL is used directly as element `src` — a
1200
- * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
1201
- * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
1202
- * `setImagePreview` on mrd-layout-section.
1203
- */
1204
- interface HTMLMrdFilePreviewElement extends Components.MrdFilePreview, HTMLStencilElement {
1205
- addEventListener<K extends keyof HTMLMrdFilePreviewElementEventMap>(type: K, listener: (this: HTMLMrdFilePreviewElement, ev: MrdFilePreviewCustomEvent<HTMLMrdFilePreviewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
1206
- addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1207
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1208
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1209
- removeEventListener<K extends keyof HTMLMrdFilePreviewElementEventMap>(type: K, listener: (this: HTMLMrdFilePreviewElement, ev: MrdFilePreviewCustomEvent<HTMLMrdFilePreviewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
1210
- removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1211
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1212
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1213
- }
1214
- var HTMLMrdFilePreviewElement: {
1215
- prototype: HTMLMrdFilePreviewElement;
1216
- new (): HTMLMrdFilePreviewElement;
1217
- };
1218
1147
  interface HTMLMrdFormElementEventMap {
1219
1148
  "mrdSubmit": Record<string, unknown>;
1220
1149
  "mrdCancel": void;
@@ -1274,12 +1203,12 @@ declare global {
1274
1203
  new (): HTMLMrdImageFieldElement;
1275
1204
  };
1276
1205
  interface HTMLMrdLayoutSectionElementEventMap {
1277
- "mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour };
1206
+ "mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
1278
1207
  "mrdSearch": { query: string; dataClass: string };
1279
1208
  "mrdDownload": { href: string; fileName: string };
1280
1209
  "mrdLoadViewPage": { name: string; page: number; sort: string; path: string; qs: string; nodeId?: string };
1281
1210
  "mrdLoadImage": { fieldName: string; href: string };
1282
- "mrdLoadDocumentPreview": { href: string };
1211
+ "mrdAttachments": { attachments: DocumentAttachment[] };
1283
1212
  "mrdViewAction": { name: string; action: string; dataClass: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string };
1284
1213
  "mrdLoadViewAggregations": { name: string; dataClass: string; path: string; qs: string; aggQs: string };
1285
1214
  "mrdLoadViewDistinct": { name: string; nodeId: string; distinct: string; path: string; qs: string };
@@ -1396,7 +1325,7 @@ declare global {
1396
1325
  interface HTMLMrdTableElementEventMap {
1397
1326
  "mrdLoadPage": { page: number; sort: string; path: string; qs: string };
1398
1327
  "mrdPageError": { page: number };
1399
- "mrdRowClick": Record<string, any>;
1328
+ "mrdRowClick": { row: Record<string, any>; listContext?: ListNavigationContext };
1400
1329
  "mrdAction": { action: string; path?: string; qs?: string; dataClass?: string; parentPath?: string | null; basicType?: string };
1401
1330
  "mrdDownload": { href: string; fileName: string };
1402
1331
  "mrdLoadAggregations": { path: string; qs: string; aggQs: string };
@@ -1480,7 +1409,6 @@ declare global {
1480
1409
  "mrd-email-field": HTMLMrdEmailFieldElement;
1481
1410
  "mrd-field": HTMLMrdFieldElement;
1482
1411
  "mrd-file-field": HTMLMrdFileFieldElement;
1483
- "mrd-file-preview": HTMLMrdFilePreviewElement;
1484
1412
  "mrd-form": HTMLMrdFormElement;
1485
1413
  "mrd-hyperlink-field": HTMLMrdHyperlinkFieldElement;
1486
1414
  "mrd-image-field": HTMLMrdImageFieldElement;
@@ -1665,9 +1593,9 @@ declare namespace LocalJSX {
1665
1593
  */
1666
1594
  "onMrdLoadPage"?: (event: MrdDocumentContainerCustomEvent<{ page: number; sort: string; path: string; qs: string; nodeId?: string }>) => void;
1667
1595
  /**
1668
- * 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).
1669
1597
  */
1670
- "onMrdNavigate"?: (event: MrdDocumentContainerCustomEvent<{ href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour }>) => void;
1598
+ "onMrdNavigate"?: (event: MrdDocumentContainerCustomEvent<{ href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] }>) => void;
1671
1599
  /**
1672
1600
  * Generic "update an existing object" request, re-emitted from the folder tree (a document was dragged into another folder/container).
1673
1601
  */
@@ -1738,9 +1666,9 @@ declare namespace LocalJSX {
1738
1666
  */
1739
1667
  "onMrdLoadPage"?: (event: MrdDocumentListCustomEvent<{ nodeId: string; page: number; sort: string; path: string; qs: string }>) => void;
1740
1668
  /**
1741
- * A document row was clicked. Host routes to the document object page.
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.
1742
1670
  */
1743
- "onMrdNavigate"?: (event: MrdDocumentListCustomEvent<{ href?: string; label: string }>) => void;
1671
+ "onMrdNavigate"?: (event: MrdDocumentListCustomEvent<{ href?: string; label: string; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] }>) => void;
1744
1672
  /**
1745
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.
1746
1674
  */
@@ -1757,12 +1685,17 @@ declare namespace LocalJSX {
1757
1685
  }
1758
1686
  /**
1759
1687
  * Archetype-driven single-document view. Given a `commons.document` binding and a
1760
- * data record, renders the document recognisably — title, file preview/download,
1688
+ * data record, renders the document recognisably — title, filename/download,
1761
1689
  * summary and date — plus a navigation link to the container (the dossier),
1762
1690
  * instead of a generic field form.
1763
1691
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
1764
1692
  * value slots read `data[field]`; the `container` relation slot reads
1765
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).
1766
1699
  */
1767
1700
  interface MrdDocumentView {
1768
1701
  /**
@@ -1779,27 +1712,17 @@ declare namespace LocalJSX {
1779
1712
  */
1780
1713
  "locale"?: string;
1781
1714
  /**
1782
- * 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.
1783
1716
  */
1784
- "onMrdDownload"?: (event: MrdDocumentViewCustomEvent<{ href: string; fileName: string }>) => void;
1717
+ "onMrdAttachments"?: (event: MrdDocumentViewCustomEvent<{ attachments: DocumentAttachment[] }>) => void;
1785
1718
  /**
1786
- * 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.
1787
1720
  */
1788
- "onMrdLoadPreview"?: (event: MrdDocumentViewCustomEvent<{ href: string }>) => void;
1721
+ "onMrdDownload"?: (event: MrdDocumentViewCustomEvent<{ href: string; fileName: string }>) => void;
1789
1722
  /**
1790
1723
  * Navigate to the container (dossier). Host resolves the href and routes.
1791
1724
  */
1792
1725
  "onMrdNavigate"?: (event: MrdDocumentViewCustomEvent<{ href?: string; label: string }>) => void;
1793
- /**
1794
- * 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.
1795
- * @default 640
1796
- */
1797
- "previewHeight"?: number;
1798
- /**
1799
- * 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.
1800
- * @default ''
1801
- */
1802
- "previewUrl"?: string;
1803
1726
  }
1804
1727
  interface MrdEmailField {
1805
1728
  /**
@@ -1886,48 +1809,6 @@ declare namespace LocalJSX {
1886
1809
  */
1887
1810
  "value"?: unknown;
1888
1811
  }
1889
- /**
1890
- * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
1891
- * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
1892
- * presentational: the signed URL is used directly as element `src` — a
1893
- * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
1894
- * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
1895
- * `setImagePreview` on mrd-layout-section.
1896
- */
1897
- interface MrdFilePreview {
1898
- /**
1899
- * Original file name — used for extension-based detection when `mimeType` is absent, and as alt/title text.
1900
- * @default ''
1901
- */
1902
- "fileName"?: string;
1903
- /**
1904
- * 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.
1905
- * @default ''
1906
- */
1907
- "href"?: string;
1908
- /**
1909
- * @default navigator.language
1910
- */
1911
- "locale"?: string;
1912
- /**
1913
- * Declared mime type (e.g. 'application/pdf', 'image/png'), when known. Authoritative over `fileName` when present.
1914
- * @default ''
1915
- */
1916
- "mimeType"?: string;
1917
- /**
1918
- * Download the file. Same shape as mrd-document-view / mrd-layout-section's mrdDownload — host resolves `href` to a signed URL.
1919
- */
1920
- "onMrdDownload"?: (event: MrdFilePreviewCustomEvent<{ href: string; fileName: string }>) => void;
1921
- /**
1922
- * 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.
1923
- */
1924
- "onMrdPreviewReload"?: (event: MrdFilePreviewCustomEvent<void>) => void;
1925
- /**
1926
- * Signed URL to render.
1927
- * @default ''
1928
- */
1929
- "src"?: string;
1930
- }
1931
1812
  interface MrdForm {
1932
1813
  "layout": ClientLayout;
1933
1814
  /**
@@ -2047,11 +1928,6 @@ declare namespace LocalJSX {
2047
1928
  * @default {}
2048
1929
  */
2049
1930
  "data"?: Record<string, unknown>;
2050
- /**
2051
- * 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.
2052
- * @default 640
2053
- */
2054
- "documentPreviewHeight"?: number;
2055
1931
  /**
2056
1932
  * Items from one layout entry in ClientDashboardMetadata.layouts[].
2057
1933
  * @default []
@@ -2066,15 +1942,15 @@ declare namespace LocalJSX {
2066
1942
  * @default navigator.language
2067
1943
  */
2068
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;
2069
1949
  /**
2070
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.
2071
1951
  */
2072
1952
  "onMrdCreateObject"?: (event: MrdLayoutSectionCustomEvent<{ name: string; path: string; values: Record<string, unknown> }>) => void;
2073
1953
  "onMrdDownload"?: (event: MrdLayoutSectionCustomEvent<{ href: string; fileName: string }>) => void;
2074
- /**
2075
- * 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().
2076
- */
2077
- "onMrdLoadDocumentPreview"?: (event: MrdLayoutSectionCustomEvent<{ href: string }>) => void;
2078
1954
  /**
2079
1955
  * Fired once on load for each IMAGE field that has an href; host resolves the URL and calls setImagePreview().
2080
1956
  */
@@ -2091,7 +1967,10 @@ declare namespace LocalJSX {
2091
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.
2092
1968
  */
2093
1969
  "onMrdLoadViewPage"?: (event: MrdLayoutSectionCustomEvent<{ name: string; page: number; sort: string; path: string; qs: string; nodeId?: string }>) => void;
2094
- "onMrdNavigate"?: (event: MrdLayoutSectionCustomEvent<{ href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour }>) => 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;
2095
1974
  "onMrdSearch"?: (event: MrdLayoutSectionCustomEvent<{ query: string; dataClass: string }>) => void;
2096
1975
  /**
2097
1976
  * Generic "update an existing object" request from an embedded document view (a document dragged into another folder). Host PATCHes `href` with `values`.
@@ -2337,9 +2216,9 @@ declare namespace LocalJSX {
2337
2216
  */
2338
2217
  "onMrdPageError"?: (event: MrdTableCustomEvent<{ page: number }>) => void;
2339
2218
  /**
2340
- * Fired when a data row is clicked. Detail is the full row object including _links.
2219
+ * Fired when a data row is clicked. `listContext` is included in paginated mode and can be used to re-fetch this exact record (or its neighbours) via `{path}?{qs}&page={index}&size=1` — omitted in non-paginated (`rows` prop) mode since the host already holds the full array.
2341
2220
  */
2342
- "onMrdRowClick"?: (event: MrdTableCustomEvent<Record<string, any>>) => void;
2221
+ "onMrdRowClick"?: (event: MrdTableCustomEvent<{ row: Record<string, any>; listContext?: ListNavigationContext }>) => void;
2343
2222
  /**
2344
2223
  * Records per page (must match the API page size).
2345
2224
  * @default 20
@@ -2352,7 +2231,7 @@ declare namespace LocalJSX {
2352
2231
  "parentId"?: string;
2353
2232
  /**
2354
2233
  * Time (ms) to wait for setPage() before retrying a page request; after MAX_RETRY_ATTEMPTS retries the page is marked failed (see failedPages).
2355
- * @default REQUEST_TIMEOUT_MS
2234
+ * @default 15000
2356
2235
  */
2357
2236
  "requestTimeoutMs"?: number;
2358
2237
  /**
@@ -2514,8 +2393,6 @@ declare namespace LocalJSX {
2514
2393
  }
2515
2394
  interface MrdDocumentViewAttributes {
2516
2395
  "locale": string;
2517
- "previewUrl": string;
2518
- "previewHeight": number;
2519
2396
  }
2520
2397
  interface MrdEmailFieldAttributes {
2521
2398
  "name": string;
@@ -2538,13 +2415,6 @@ declare namespace LocalJSX {
2538
2415
  "accept": string;
2539
2416
  "maxSize": number;
2540
2417
  }
2541
- interface MrdFilePreviewAttributes {
2542
- "src": string;
2543
- "mimeType": string;
2544
- "fileName": string;
2545
- "href": string;
2546
- "locale": string;
2547
- }
2548
2418
  interface MrdFormAttributes {
2549
2419
  "locale": string;
2550
2420
  "referenceHref": string;
@@ -2571,7 +2441,6 @@ declare namespace LocalJSX {
2571
2441
  }
2572
2442
  interface MrdLayoutSectionAttributes {
2573
2443
  "locale": string;
2574
- "documentPreviewHeight": number;
2575
2444
  }
2576
2445
  interface MrdListFieldAttributes {
2577
2446
  "name": string;
@@ -2672,7 +2541,6 @@ declare namespace LocalJSX {
2672
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] };
2673
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] };
2674
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] };
2675
- "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] };
2676
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] };
2677
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] };
2678
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] };
@@ -2726,26 +2594,22 @@ declare module "@stencil/core" {
2726
2594
  "mrd-document-list": LocalJSX.IntrinsicElements["mrd-document-list"] & JSXBase.HTMLAttributes<HTMLMrdDocumentListElement>;
2727
2595
  /**
2728
2596
  * Archetype-driven single-document view. Given a `commons.document` binding and a
2729
- * data record, renders the document recognisably — title, file preview/download,
2597
+ * data record, renders the document recognisably — title, filename/download,
2730
2598
  * summary and date — plus a navigation link to the container (the dossier),
2731
2599
  * instead of a generic field form.
2732
2600
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
2733
2601
  * value slots read `data[field]`; the `container` relation slot reads
2734
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).
2735
2608
  */
2736
2609
  "mrd-document-view": LocalJSX.IntrinsicElements["mrd-document-view"] & JSXBase.HTMLAttributes<HTMLMrdDocumentViewElement>;
2737
2610
  "mrd-email-field": LocalJSX.IntrinsicElements["mrd-email-field"] & JSXBase.HTMLAttributes<HTMLMrdEmailFieldElement>;
2738
2611
  "mrd-field": LocalJSX.IntrinsicElements["mrd-field"] & JSXBase.HTMLAttributes<HTMLMrdFieldElement>;
2739
2612
  "mrd-file-field": LocalJSX.IntrinsicElements["mrd-file-field"] & JSXBase.HTMLAttributes<HTMLMrdFileFieldElement>;
2740
- /**
2741
- * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
2742
- * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
2743
- * presentational: the signed URL is used directly as element `src` — a
2744
- * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
2745
- * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
2746
- * `setImagePreview` on mrd-layout-section.
2747
- */
2748
- "mrd-file-preview": LocalJSX.IntrinsicElements["mrd-file-preview"] & JSXBase.HTMLAttributes<HTMLMrdFilePreviewElement>;
2749
2613
  "mrd-form": LocalJSX.IntrinsicElements["mrd-form"] & JSXBase.HTMLAttributes<HTMLMrdFormElement>;
2750
2614
  "mrd-hyperlink-field": LocalJSX.IntrinsicElements["mrd-hyperlink-field"] & JSXBase.HTMLAttributes<HTMLMrdHyperlinkFieldElement>;
2751
2615
  "mrd-image-field": LocalJSX.IntrinsicElements["mrd-image-field"] & JSXBase.HTMLAttributes<HTMLMrdImageFieldElement>;
@@ -1,2 +1,5 @@
1
1
  export * from './types';
2
2
  export type { AlternativeView, ColumnFilter, TableAction, TableColumn } from './utils/cell-renderer';
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;
@@ -3,6 +3,20 @@ import { ViewFilter } from '../types/client-layout';
3
3
  * Shared path/query-param conventions for list requests,
4
4
  * used by mrd-table and mrd-document-list.
5
5
  */
6
+ /** Enough context to re-fetch one specific record from the query that produced a list,
7
+ * via `{path}?{qs}&page={index}&size=1` — used to drive prev/next navigation in a host
8
+ * overlay. `qs` deliberately excludes the `page` param since it is page-independent
9
+ * (filters/sort apply uniformly across all pages of the same query). */
10
+ export interface ListNavigationContext {
11
+ /** Absolute position of the record within the query's result set. */
12
+ index: number;
13
+ /** Raw sort param value, e.g. "name,desc" or "" when unsorted. */
14
+ sort: string;
15
+ /** Relative data path (VIEW: /{dataClass}; RELATED_VIEW: /{fromClass}/{parentId}/{dataClass}). */
16
+ path: string;
17
+ /** Filter/type/view-filter/sort query string, without `page`. */
18
+ qs: string;
19
+ }
6
20
  /** Applies the view-level static filters to `params` using the API operator conventions. */
7
21
  export declare function applyViewFilters(params: URLSearchParams, filters: ViewFilter[] | null | undefined): void;
8
22
  /** VIEW: `/{dataClass}`; RELATED_VIEW: `/{fromClass}/{parentId}/{dataClass}`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmlogic/components",
3
- "version": "0.4.2",
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
  }