diff --git a/lib/Listener/LoadViewerListener.php b/lib/Listener/LoadViewerListener.php index 0a76ecdae4..7e11bbd177 100644 --- a/lib/Listener/LoadViewerListener.php +++ b/lib/Listener/LoadViewerListener.php @@ -11,6 +11,7 @@ namespace OCA\Richdocuments\Listener; +use OCA\Richdocuments\AppInfo\Application; use OCA\Richdocuments\PermissionManager; use OCA\Richdocuments\Service\InitialStateService; use OCA\Viewer\Event\LoadViewer; @@ -36,7 +37,8 @@ public function handle(Event $event): void { } if ($this->permissionManager->isEnabledForUser() && $this->userId !== null) { $this->initialStateService->provideCapabilities(); - Util::addScript('richdocuments', 'richdocuments-viewer', 'viewer'); + Util::addInitScript(Application::APPNAME, Application::APPNAME . '-init-viewer'); + Util::addScript(Application::APPNAME, Application::APPNAME . '-viewer', 'viewer'); $this->eventDispatcher->dispatchTyped(new RenderReferenceEvent()); } } diff --git a/lib/Listener/ShareLinkListener.php b/lib/Listener/ShareLinkListener.php index b4346c923f..97edfdfbc8 100644 --- a/lib/Listener/ShareLinkListener.php +++ b/lib/Listener/ShareLinkListener.php @@ -12,6 +12,7 @@ namespace OCA\Richdocuments\Listener; use OCA\Files_Sharing\Event\ShareLinkAccessedEvent; +use OCA\Richdocuments\AppInfo\Application; use OCA\Richdocuments\PermissionManager; use OCA\Richdocuments\Service\InitialStateService; use OCP\EventDispatcher\Event; @@ -41,8 +42,9 @@ public function handle(Event $event): void { $this->initialStateService->prepareParams(['userId' => $loggedInUser]); $this->initialStateService->provideCapabilities(); - Util::addScript('richdocuments', 'richdocuments-viewer', 'viewer'); - Util::addScript('richdocuments', 'richdocuments-public', 'viewer'); + Util::addInitScript(Application::APPNAME, Application::APPNAME . '-init-viewer'); + Util::addScript(Application::APPNAME, Application::APPNAME . '-viewer', 'viewer'); + Util::addScript(Application::APPNAME, Application::APPNAME . '-public', 'viewer'); } } } diff --git a/package-lock.json b/package-lock.json index 537ab13867..8fb63b0831 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,8 @@ "@nextcloud/paths": "^2.2.2", "@nextcloud/router": "^3.0.1", "@nextcloud/sharing": "^0.2.5", - "@nextcloud/vue": "^8.27.0", + "@nextcloud/viewer": "^1.0.0", + "@nextcloud/vue": "^8.36.0", "vue": "^2.7.16", "vue-material-design-icons": "^5.3.1" }, @@ -3516,18 +3517,6 @@ "stylelint-config-recommended-vue": "^1.5.0" } }, - "node_modules/@nextcloud/timezones": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/timezones/-/timezones-0.2.0.tgz", - "integrity": "sha512-1mwQ+asTFOgv9rxPoAMEbDF8JfnenIa2EGNS+8MATCyi6WXxYh0Lhkaq1d3l2+xNbUPHgMnk4cRYsvIo319lkA==", - "license": "AGPL-3.0-or-later", - "dependencies": { - "ical.js": "^2.1.0" - }, - "engines": { - "node": "^20 || ^22" - } - }, "node_modules/@nextcloud/typings": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@nextcloud/typings/-/typings-1.10.0.tgz", @@ -3539,36 +3528,44 @@ "node": "^20.0.0 || ^22.0.0 || ^24.0.0" } }, + "node_modules/@nextcloud/viewer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/viewer/-/viewer-1.0.0.tgz", + "integrity": "sha512-AaVXh+KyJ0q28AaqjBwDjjEuVB+v1GarIuuLCO2nfpkg/ekngQw25rmb4PzKVvbN8N35nb92GpQXBpG1ZtBrzg==", + "license": "AGPL-3.0-or-later", + "peerDependencies": { + "vue": "^2.7.16" + } + }, "node_modules/@nextcloud/vue": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.34.0.tgz", - "integrity": "sha512-zUmInTvT4NgbRjWJZbw8nA+h4EqitYKfoCTj3h3Xr930sQZcczQatPtSo5Sps8RAh+JJz3iiAqAawYqS9jvBdA==", + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.36.0.tgz", + "integrity": "sha512-x1MEh4nvCrD1zoJ3ybhtbSDox+1wyHRP7st95Uu14Wm630quRrfXGaQ1bxqaZ7en/wqaihR0NPyQKfmjrPmseg==", "license": "AGPL-3.0-or-later", "dependencies": { - "@floating-ui/dom": "^1.7.4", + "@floating-ui/dom": "^1.7.5", "@linusborg/vue-simple-portal": "^0.1.5", "@nextcloud/auth": "^2.5.3", "@nextcloud/axios": "^2.5.2", "@nextcloud/browser-storage": "^0.5.0", - "@nextcloud/capabilities": "^1.2.0", - "@nextcloud/event-bus": "^3.3.2", + "@nextcloud/capabilities": "^1.2.1", + "@nextcloud/event-bus": "^3.3.3", "@nextcloud/initial-state": "^2.2.0", - "@nextcloud/l10n": "^3.4.0", - "@nextcloud/logger": "^3.0.2", - "@nextcloud/router": "^3.0.1", + "@nextcloud/l10n": "^3.4.1", + "@nextcloud/logger": "^3.0.3", + "@nextcloud/router": "^3.1.0", "@nextcloud/sharing": "^0.3.0", - "@nextcloud/timezones": "^0.2.0", "@nextcloud/vue-select": "^3.26.0", "@vueuse/components": "^11.0.0", "@vueuse/core": "^11.0.0", "blurhash": "^2.0.5", "clone": "^2.1.2", "debounce": "^2.2.0", - "dompurify": "^3.3.0", + "dompurify": "^3.3.1", "emoji-mart-vue-fast": "^15.0.5", "escape-html": "^1.0.3", "floating-vue": "^1.0.0-beta.19", - "focus-trap": "^7.6.6", + "focus-trap": "^7.8.0", "linkify-string": "^4.3.2", "md5": "^2.3.0", "p-queue": "^8.1.1", @@ -3582,11 +3579,11 @@ "splitpanes": "^2.4.1", "string-length": "^5.0.1", "striptags": "^3.2.0", - "tabbable": "^6.3.0", + "tabbable": "^6.4.0", "tributejs": "^5.1.3", "unified": "^11.0.1", "unist-builder": "^4.0.0", - "unist-util-visit": "^5.0.0", + "unist-util-visit": "^5.1.0", "vue": "^2.7.16", "vue-color": "^2.8.1", "vue-frag": "^1.4.3", @@ -3610,21 +3607,21 @@ } }, "node_modules/@nextcloud/vue/node_modules/@floating-ui/core": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", - "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.4.tgz", + "integrity": "sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==", "license": "MIT", "dependencies": { "@floating-ui/utils": "^0.2.10" } }, "node_modules/@nextcloud/vue/node_modules/@floating-ui/dom": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz", - "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.5.tgz", + "integrity": "sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg==", "license": "MIT", "dependencies": { - "@floating-ui/core": "^1.7.3", + "@floating-ui/core": "^1.7.4", "@floating-ui/utils": "^0.2.10" } }, @@ -8878,9 +8875,9 @@ } }, "node_modules/dompurify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.0.tgz", - "integrity": "sha512-r+f6MYR1gGN1eJv0TVQbhA7if/U7P87cdPl3HN5rikqaBSBxLiCb/b9O+2eG0cxz0ghyU+mU1QkbsOwERMYlWQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.1.tgz", + "integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==", "license": "(MPL-2.0 OR Apache-2.0)", "optionalDependencies": { "@types/trusted-types": "^2.0.7" @@ -10936,12 +10933,12 @@ } }, "node_modules/focus-trap": { - "version": "7.6.6", - "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.6.6.tgz", - "integrity": "sha512-v/Z8bvMCajtx4mEXmOo7QEsIzlIOqRXTIwgUfsFOF9gEsespdbD0AkPIka1bSXZ8Y8oZ+2IVDQZePkTfEHZl7Q==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.8.0.tgz", + "integrity": "sha512-/yNdlIkpWbM0ptxno3ONTuf+2g318kh2ez3KSeZN5dZ8YC6AAmgeWz+GasYYiBJPFaYcSAPeu4GfhUaChzIJXA==", "license": "MIT", "dependencies": { - "tabbable": "^6.3.0" + "tabbable": "^6.4.0" } }, "node_modules/follow-redirects": { @@ -11918,12 +11915,6 @@ "node": ">=10.18" } }, - "node_modules/ical.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-2.1.0.tgz", - "integrity": "sha512-BOVfrH55xQ6kpS3muGvIXIg2l7p+eoe12/oS7R5yrO3TL/j/bLsR0PR+tYQESFbyTbvGgPHn9zQ6tI4FWyuSaQ==", - "license": "MPL-2.0" - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -18487,9 +18478,9 @@ } }, "node_modules/tabbable": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.3.0.tgz", - "integrity": "sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.4.0.tgz", + "integrity": "sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==", "license": "MIT" }, "node_modules/table": { @@ -19466,9 +19457,10 @@ } }, "node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", @@ -23000,14 +22992,6 @@ "stylelint-use-logical": "^2.1.2" } }, - "@nextcloud/timezones": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/timezones/-/timezones-0.2.0.tgz", - "integrity": "sha512-1mwQ+asTFOgv9rxPoAMEbDF8JfnenIa2EGNS+8MATCyi6WXxYh0Lhkaq1d3l2+xNbUPHgMnk4cRYsvIo319lkA==", - "requires": { - "ical.js": "^2.1.0" - } - }, "@nextcloud/typings": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@nextcloud/typings/-/typings-1.10.0.tgz", @@ -23016,35 +23000,40 @@ "@types/jquery": "3.5.16" } }, + "@nextcloud/viewer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/viewer/-/viewer-1.0.0.tgz", + "integrity": "sha512-AaVXh+KyJ0q28AaqjBwDjjEuVB+v1GarIuuLCO2nfpkg/ekngQw25rmb4PzKVvbN8N35nb92GpQXBpG1ZtBrzg==", + "requires": {} + }, "@nextcloud/vue": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.34.0.tgz", - "integrity": "sha512-zUmInTvT4NgbRjWJZbw8nA+h4EqitYKfoCTj3h3Xr930sQZcczQatPtSo5Sps8RAh+JJz3iiAqAawYqS9jvBdA==", + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.36.0.tgz", + "integrity": "sha512-x1MEh4nvCrD1zoJ3ybhtbSDox+1wyHRP7st95Uu14Wm630quRrfXGaQ1bxqaZ7en/wqaihR0NPyQKfmjrPmseg==", "requires": { - "@floating-ui/dom": "^1.7.4", + "@floating-ui/dom": "^1.7.5", "@linusborg/vue-simple-portal": "^0.1.5", "@nextcloud/auth": "^2.5.3", "@nextcloud/axios": "^2.5.2", "@nextcloud/browser-storage": "^0.5.0", - "@nextcloud/capabilities": "^1.2.0", - "@nextcloud/event-bus": "^3.3.2", + "@nextcloud/capabilities": "^1.2.1", + "@nextcloud/event-bus": "^3.3.3", "@nextcloud/initial-state": "^2.2.0", - "@nextcloud/l10n": "^3.4.0", - "@nextcloud/logger": "^3.0.2", - "@nextcloud/router": "^3.0.1", + "@nextcloud/l10n": "^3.4.1", + "@nextcloud/logger": "^3.0.3", + "@nextcloud/router": "^3.1.0", "@nextcloud/sharing": "^0.3.0", - "@nextcloud/timezones": "^0.2.0", "@nextcloud/vue-select": "^3.26.0", "@vueuse/components": "^11.0.0", "@vueuse/core": "^11.0.0", "blurhash": "^2.0.5", "clone": "^2.1.2", "debounce": "^2.2.0", - "dompurify": "^3.3.0", + "dompurify": "^3.3.1", "emoji-mart-vue-fast": "^15.0.5", "escape-html": "^1.0.3", "floating-vue": "^1.0.0-beta.19", - "focus-trap": "^7.6.6", + "focus-trap": "^7.8.0", "linkify-string": "^4.3.2", "md5": "^2.3.0", "p-queue": "^8.1.1", @@ -23058,11 +23047,11 @@ "splitpanes": "^2.4.1", "string-length": "^5.0.1", "striptags": "^3.2.0", - "tabbable": "^6.3.0", + "tabbable": "^6.4.0", "tributejs": "^5.1.3", "unified": "^11.0.1", "unist-builder": "^4.0.0", - "unist-util-visit": "^5.0.0", + "unist-util-visit": "^5.1.0", "vue": "^2.7.16", "vue-color": "^2.8.1", "vue-frag": "^1.4.3", @@ -23071,19 +23060,19 @@ }, "dependencies": { "@floating-ui/core": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", - "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.4.tgz", + "integrity": "sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==", "requires": { "@floating-ui/utils": "^0.2.10" } }, "@floating-ui/dom": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz", - "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.5.tgz", + "integrity": "sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg==", "requires": { - "@floating-ui/core": "^1.7.3", + "@floating-ui/core": "^1.7.4", "@floating-ui/utils": "^0.2.10" } }, @@ -26910,9 +26899,9 @@ } }, "dompurify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.0.tgz", - "integrity": "sha512-r+f6MYR1gGN1eJv0TVQbhA7if/U7P87cdPl3HN5rikqaBSBxLiCb/b9O+2eG0cxz0ghyU+mU1QkbsOwERMYlWQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.1.tgz", + "integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==", "requires": { "@types/trusted-types": "^2.0.7" } @@ -28432,11 +28421,11 @@ } }, "focus-trap": { - "version": "7.6.6", - "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.6.6.tgz", - "integrity": "sha512-v/Z8bvMCajtx4mEXmOo7QEsIzlIOqRXTIwgUfsFOF9gEsespdbD0AkPIka1bSXZ8Y8oZ+2IVDQZePkTfEHZl7Q==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.8.0.tgz", + "integrity": "sha512-/yNdlIkpWbM0ptxno3ONTuf+2g318kh2ez3KSeZN5dZ8YC6AAmgeWz+GasYYiBJPFaYcSAPeu4GfhUaChzIJXA==", "requires": { - "tabbable": "^6.3.0" + "tabbable": "^6.4.0" } }, "follow-redirects": { @@ -29147,11 +29136,6 @@ "dev": true, "peer": true }, - "ical.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-2.1.0.tgz", - "integrity": "sha512-BOVfrH55xQ6kpS3muGvIXIg2l7p+eoe12/oS7R5yrO3TL/j/bLsR0PR+tYQESFbyTbvGgPHn9zQ6tI4FWyuSaQ==" - }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -33763,9 +33747,9 @@ } }, "tabbable": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.3.0.tgz", - "integrity": "sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ==" + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.4.0.tgz", + "integrity": "sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==" }, "table": { "version": "6.9.0", @@ -34462,9 +34446,9 @@ } }, "unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", "requires": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", diff --git a/package.json b/package.json index a261a7933f..e708def056 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,9 @@ "@nextcloud/moment": "^1.3.5", "@nextcloud/paths": "^2.2.2", "@nextcloud/router": "^3.0.1", - "@nextcloud/vue": "^8.27.0", "@nextcloud/sharing": "^0.2.5", + "@nextcloud/viewer": "^1.0.0", + "@nextcloud/vue": "^8.36.0", "vue": "^2.7.16", "vue-material-design-icons": "^5.3.1" }, diff --git a/src/init-viewer.js b/src/init-viewer.js new file mode 100644 index 0000000000..391035c969 --- /dev/null +++ b/src/init-viewer.js @@ -0,0 +1,23 @@ +/*! + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import './init-shared.js' + +import { getCapabilities } from './services/capabilities.ts' +import { registerHandler } from '@nextcloud/viewer' + +const supportedMimes = getCapabilities().mimetypes +const AsyncViewerComponent = () => import('./view/Viewer.vue') + +const viewerHandler = { + id: 'richdocuments', + group: null, + mimes: supportedMimes, + component: AsyncViewerComponent, + theme: 'default', + canCompare: true, +} + +registerHandler(viewerHandler) diff --git a/src/viewer.js b/src/viewer.js index abdfd1c25b..672d160c4e 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -6,23 +6,6 @@ import './init-shared.js' import '../css/filetypes.scss' -import { getCapabilities } from './services/capabilities.ts' import { autoSetupBuiltInCodeServerIfNeeded } from './services/builtInCode.ts' -const supportedMimes = getCapabilities().mimetypes -const AsyncViewerComponent = () => import('./view/Viewer.vue') - -if (OCA.Viewer) { - OCA.Viewer.registerHandler({ - id: 'richdocuments', - group: null, - mimes: supportedMimes, - component: AsyncViewerComponent, - theme: 'default', - canCompare: true, - }) -} else { - console.error('Unable to register viewer handler') -} - autoSetupBuiltInCodeServerIfNeeded() diff --git a/webpack.js b/webpack.js index 12a2010ecd..c2d77b49ae 100644 --- a/webpack.js +++ b/webpack.js @@ -10,6 +10,7 @@ const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-m webpackConfig.entry = { viewer: path.join(__dirname, 'src', 'viewer.js'), + 'init-viewer': path.join(__dirname, 'src', 'init-viewer.js'), fileActions: path.join(__dirname, 'src', 'file-actions.js'), document: path.join(__dirname, 'src', 'document.js'), admin: path.join(__dirname, 'src', 'admin.js'),