Files
media_viewer/src/integrations.ts
T
2026-06-17 23:14:59 -04:00

63 lines
1.6 KiB
TypeScript

import type { ModuleIntegrations } from '@KTXC/types/moduleTypes'
/**
* The media viewer registers:
*
* - leaf viewers at the generic `media_viewer_format` integration point, resolved by
* MIME type. Each declares `meta.mode` ('gallery' | 'standalone') and
* `meta.popover` (whether it may be shown in the hover popover surface).
* - the shell dialog at the `media_viewer` integration point (`id: 'dialog'`),
* so host modules (Documents, Mail, …) can resolve and mount it without
* importing this module's source.
*
* Leaf viewer prop contract:
* {
* url: string,
* mime: string,
* title?: string,
* item?: MediaItem | null
* }.
*/
const integrations: ModuleIntegrations = {
media_viewer_format: [
{
id: 'image',
label: 'Image Viewer',
priority: 10,
meta: {
mimePatterns: ['image/*'],
mode: 'gallery',
popover: true,
},
component: () => import('./components/ImageViewer.vue'),
},
{
id: 'video',
label: 'Video Viewer',
priority: 10,
meta: {
mimePatterns: ['video/*'],
mode: 'gallery',
popover: true,
},
component: () => import('./components/VideoViewer.vue'),
},
],
media_viewer: [
{
id: 'dialog',
label: 'Media Viewer Dialog',
priority: 10,
component: () => import('./components/MediaViewerDialog.vue'),
},
{
id: 'popover',
label: 'Media Viewer Popover',
priority: 10,
component: () => import('./components/MediaViewerPopover.vue'),
},
],
}
export default integrations