+
{/if}
diff --git a/packages/ui/src/types.ts b/packages/ui/src/types.ts
index 178a4ff5ac..33038525ad 100644
--- a/packages/ui/src/types.ts
+++ b/packages/ui/src/types.ts
@@ -130,6 +130,7 @@ export interface BreadcrumbItem {
icon?: Asset | AnySvelteComponent | ComponentType
iconProps?: any
iconWidth?: string
+ iconMargin?: string
withoutIconBackground?: boolean
label?: IntlString
title?: string
diff --git a/plugins/attachment-assets/lang/en.json b/plugins/attachment-assets/lang/en.json
index c9246ceae1..b36d39f199 100644
--- a/plugins/attachment-assets/lang/en.json
+++ b/plugins/attachment-assets/lang/en.json
@@ -52,6 +52,7 @@
"UnPinAttachment": "Mark less important",
"FilterAttachments": "Attachments",
"RemovedAttachment": "Removed attachment",
- "ContentType": "Content type"
+ "ContentType": "Content type",
+ "OpenInWindow": "Open in window"
}
}
diff --git a/plugins/attachment-assets/lang/es.json b/plugins/attachment-assets/lang/es.json
index acba51f30a..7b151abb49 100644
--- a/plugins/attachment-assets/lang/es.json
+++ b/plugins/attachment-assets/lang/es.json
@@ -52,6 +52,7 @@
"UnPinAttachment": "Marcar como menos importante",
"FilterAttachments": "Adjuntos",
"RemovedAttachment": "Adjunto eliminado",
- "ContentType": "Tipo de contenido"
+ "ContentType": "Tipo de contenido",
+ "OpenInWindow": "Abrir en ventana"
}
}
\ No newline at end of file
diff --git a/plugins/attachment-assets/lang/fr.json b/plugins/attachment-assets/lang/fr.json
index c4bafbfb29..741dfafaf8 100644
--- a/plugins/attachment-assets/lang/fr.json
+++ b/plugins/attachment-assets/lang/fr.json
@@ -52,6 +52,7 @@
"UnPinAttachment": "Marquer comme moins important",
"FilterAttachments": "Pièces jointes",
"RemovedAttachment": "Pièce jointe supprimée",
- "ContentType": "Type de contenu"
+ "ContentType": "Type de contenu",
+ "OpenInWindow": "Ouvrir dans une fenêtre"
}
}
\ No newline at end of file
diff --git a/plugins/attachment-assets/lang/pt.json b/plugins/attachment-assets/lang/pt.json
index 3280ee932b..4988ae655f 100644
--- a/plugins/attachment-assets/lang/pt.json
+++ b/plugins/attachment-assets/lang/pt.json
@@ -52,6 +52,7 @@
"UnPinAttachment": "Marcar como menos importante",
"FilterAttachments": "Anexos",
"RemovedAttachment": "Anexo removido",
- "ContentType": "Tipo de conteúdo"
+ "ContentType": "Tipo de conteúdo",
+ "OpenInWindow": "Abrir numa janela"
}
}
\ No newline at end of file
diff --git a/plugins/attachment-assets/lang/ru.json b/plugins/attachment-assets/lang/ru.json
index a2a6d90ef4..6708b23196 100644
--- a/plugins/attachment-assets/lang/ru.json
+++ b/plugins/attachment-assets/lang/ru.json
@@ -52,6 +52,7 @@
"UnPinAttachment": "Убрать пометку важное",
"FilterAttachments": "Вложения",
"RemovedAttachment": "Удалил(а) вложение",
- "ContentType": "Тип контента"
+ "ContentType": "Тип контента",
+ "OpenInWindow": "Открыть в окне"
}
}
diff --git a/plugins/attachment-assets/lang/zh.json b/plugins/attachment-assets/lang/zh.json
index ab911edc5b..634abd17b5 100644
--- a/plugins/attachment-assets/lang/zh.json
+++ b/plugins/attachment-assets/lang/zh.json
@@ -52,6 +52,7 @@
"UnPinAttachment": "标记为不重要",
"FilterAttachments": "附件",
"RemovedAttachment": "移除附件",
- "ContentType": "内容类型"
+ "ContentType": "内容类型",
+ "OpenInWindow": "在新窗口中打开"
}
}
diff --git a/plugins/attachment-resources/package.json b/plugins/attachment-resources/package.json
index 89da410105..d1226225c7 100644
--- a/plugins/attachment-resources/package.json
+++ b/plugins/attachment-resources/package.json
@@ -38,8 +38,8 @@
"typescript": "^5.3.3"
},
"dependencies": {
- "@hcengineering/analytics": "^0.6.0",
"@hcengineering/activity": "^0.6.0",
+ "@hcengineering/analytics": "^0.6.0",
"@hcengineering/attachment": "^0.6.14",
"@hcengineering/contact": "^0.6.24",
"@hcengineering/core": "^0.6.32",
@@ -55,6 +55,7 @@
"@hcengineering/uploader": "^0.6.0",
"@hcengineering/view": "^0.6.13",
"@hcengineering/view-resources": "^0.6.0",
+ "@hcengineering/workbench": "^0.6.16",
"filesize": "^8.0.3",
"svelte": "^4.2.12"
},
diff --git a/plugins/attachment-resources/src/components/AttachmentActions.svelte b/plugins/attachment-resources/src/components/AttachmentActions.svelte
index 1e8fdc8c80..53c0e9f5f6 100644
--- a/plugins/attachment-resources/src/components/AttachmentActions.svelte
+++ b/plugins/attachment-resources/src/components/AttachmentActions.svelte
@@ -25,10 +25,12 @@
} from '@hcengineering/presentation'
import { IconMoreH, Menu, Action as UIAction, closeTooltip, showPopup, tooltip } from '@hcengineering/ui'
import view, { Action } from '@hcengineering/view'
+ import workbench from '@hcengineering/workbench'
import AttachmentAction from './AttachmentAction.svelte'
import FileDownload from './icons/FileDownload.svelte'
import attachmentPlugin from '../plugin'
+ import { openAttachmentInSidebar } from '../utils'
export let attachment: WithLookup
export let isSaved = false
@@ -95,6 +97,13 @@
if (canPreview) {
actions.push(openAction)
}
+ actions.push({
+ icon: view.icon.DetailsFilled,
+ label: workbench.string.OpenInSidebar,
+ action: async () => {
+ await openAttachmentInSidebar(attachment)
+ }
+ })
actions.push({
label: saveAttachmentAction.label,
icon: saveAttachmentAction.icon,
diff --git a/plugins/attachment-resources/src/components/AttachmentPresenter.svelte b/plugins/attachment-resources/src/components/AttachmentPresenter.svelte
index f2ec4f8149..e68b597293 100644
--- a/plugins/attachment-resources/src/components/AttachmentPresenter.svelte
+++ b/plugins/attachment-resources/src/components/AttachmentPresenter.svelte
@@ -17,11 +17,10 @@
import type { Attachment } from '@hcengineering/attachment'
import core, { type WithLookup } from '@hcengineering/core'
import presentation, {
- FilePreviewPopup,
canPreviewFile,
+ FilePreviewPopup,
getBlobRef,
getFileUrl,
- getPreviewAlignment,
previewTypes,
sizeToWidth
} from '@hcengineering/presentation'
@@ -29,7 +28,7 @@
import { permissionsStore } from '@hcengineering/view-resources'
import filesize from 'filesize'
import { createEventDispatcher } from 'svelte'
- import { getType } from '../utils'
+ import { getType, openAttachmentInSidebar } from '../utils'
import AttachmentName from './AttachmentName.svelte'
@@ -70,7 +69,7 @@
canPreview = false
}
- function clickHandler (e: MouseEvent): void {
+ async function clickHandler (e: MouseEvent): Promise {
if (value === undefined || !canPreview) return
e.preventDefault()
@@ -80,16 +79,20 @@
return
}
closeTooltip()
- showPopup(
- FilePreviewPopup,
- {
- file: value.file,
- contentType: value.type,
- name: value.name,
- metadata: value.metadata
- },
- getPreviewAlignment(value.type)
- )
+ if (value.type.startsWith('image/') || value.type.startsWith('video/') || value.type.startsWith('audio/')) {
+ showPopup(
+ FilePreviewPopup,
+ {
+ file: value.file,
+ contentType: value.type,
+ name: value.name,
+ metadata: value.metadata
+ },
+ 'centered'
+ )
+ } else {
+ await openAttachmentInSidebar(value)
+ }
}
function middleClickHandler (e: MouseEvent): void {
diff --git a/plugins/attachment-resources/src/components/AttachmentPreview.svelte b/plugins/attachment-resources/src/components/AttachmentPreview.svelte
index 9b164c2499..8afc8e0c44 100644
--- a/plugins/attachment-resources/src/components/AttachmentPreview.svelte
+++ b/plugins/attachment-resources/src/components/AttachmentPreview.svelte
@@ -14,13 +14,13 @@
// limitations under the License.
-->
+
+{#if file}
+