Skip to content
Open
72 changes: 72 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"electron-squirrel-startup": "^1.0.1",
"howler": "^2.2.4",
"mri": "^1.2.0",
"panzoom": "^9.4.4",
"pinia": "^3.0.4",
"semver": "^7.7.4",
"unzip-crx-3": "^0.2.0",
Expand Down
12 changes: 12 additions & 0 deletions src/talk/renderer/Viewer/ViewerApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { translate as t } from '@nextcloud/l10n'
import { generateUrl } from '@nextcloud/router'
import { computed, ref } from 'vue'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcActionLink from '@nextcloud/vue/components/NcActionLink'
import NcModal from '@nextcloud/vue/components/NcModal'
import IconOpenInNew from 'vue-material-design-icons/OpenInNew.vue'
Expand All @@ -19,6 +20,7 @@ function noop() {}
const isOpen = ref(false)
const onClose = ref(noop)
const file = ref(null)
const viewerRef = ref(null)

const viewComponent = computed(() => file.value && window.OCA.Viewer.availableHandlers.find((handler) => handler.mimes.includes(file.value.mime))?.component)

Expand Down Expand Up @@ -67,9 +69,19 @@ defineExpose({
<component
:is="viewComponent"
v-if="viewComponent"
ref="viewerRef"
:file="file" />

<template #actions>
<NcActionButton
v-for="action in (viewerRef?.actions ?? [])"
:key="action.key"
@click="action.onClick()">
<template #icon>
<component :is="action.icon" :size="20" />
</template>
{{ action.label }}
</NcActionButton>
<NcActionLink :href="link">
<template #icon>
<IconOpenInNew :size="20" />
Expand Down
Loading