From 007c26fae19c8f73474d85c49313fc8dff7c18a0 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 9 Sep 2024 12:55:40 +0200 Subject: [PATCH] fix: Make loading the viewer an init script test: Adjust Cypress to use stable28 as base branch Signed-off-by: Ferdinand Thiessen --- cypress.config.ts | 2 +- lib/Listener/LoadViewerScript.php | 1 + package-lock.json | 619 +++++++++++++++++++++++------ package.json | 8 +- src/files_actions/viewerAction.ts | 73 ++++ src/global.d.ts | 20 + src/init.ts | 14 + src/main.js | 7 - src/services/FilesActionHandler.js | 58 --- src/services/Viewer.js | 9 +- src/shims.d.ts | 14 + src/views/Viewer.vue | 45 +-- 12 files changed, 640 insertions(+), 230 deletions(-) create mode 100644 src/files_actions/viewerAction.ts create mode 100644 src/global.d.ts create mode 100644 src/init.ts delete mode 100644 src/services/FilesActionHandler.js create mode 100644 src/shims.d.ts diff --git a/cypress.config.ts b/cypress.config.ts index 44d456e26..dea5f193d 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -70,7 +70,7 @@ export default defineConfig({ // Before the browser launches // starting Nextcloud testing container - return startNextcloud(process.env.BRANCH) + return startNextcloud(process.env.BRANCH ?? 'stable28') .then((ip) => { // Setting container's IP as base Url config.baseUrl = `http://${ip}/index.php` diff --git a/lib/Listener/LoadViewerScript.php b/lib/Listener/LoadViewerScript.php index 46f239e08..d1fa24df6 100644 --- a/lib/Listener/LoadViewerScript.php +++ b/lib/Listener/LoadViewerScript.php @@ -54,6 +54,7 @@ public function handle(Event $event): void { return; } + Util::addInitScript(Application::APP_ID, 'viewer-init'); Util::addScript(Application::APP_ID, 'viewer-main', 'files'); $this->initialStateService->provideInitialState('enabled_preview_providers', array_keys($this->previewManager->getProviders())); } diff --git a/package-lock.json b/package-lock.json index e94da22e3..c618ad442 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,15 +9,15 @@ "version": "2.2.0", "license": "agpl", "dependencies": { - "@fontsource/roboto": "^5.0.12", + "@fontsource/roboto": "^5.0.15", "@mdi/svg": "^7.4.47", "@nextcloud/auth": "^2.2.1", "@nextcloud/axios": "^2.4.0", "@nextcloud/dialogs": "^5.2.0", "@nextcloud/event-bus": "^3.1.0", - "@nextcloud/files": "^3.1.0", + "@nextcloud/files": "^3.9.0", "@nextcloud/initial-state": "^2.1.0", - "@nextcloud/l10n": "^2.2.0", + "@nextcloud/l10n": "^3.1.0", "@nextcloud/logger": "^2.7.0", "@nextcloud/paths": "^2.1.0", "@nextcloud/router": "^3.0.0", @@ -57,7 +57,7 @@ }, "engines": { "node": "^20.0.0", - "npm": "^9.0.0" + "npm": "^10.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -2732,9 +2732,9 @@ "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" }, "node_modules/@fontsource/roboto": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.0.12.tgz", - "integrity": "sha512-x0o17jvgoSSbS9OZnUX2+xJmVRvVCfeaYJjkS7w62iN7CuJWtMf5vJj8LqgC7ibqIkitOHVW+XssRjgrcHn62g==" + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.0.15.tgz", + "integrity": "sha512-352XiID9jfwmYaHpdmS3ocGJi3PA+vOm4HzJIRfSyPEyLP6dZN8iiEKUbdAfB5YXQO3YxO2KZpR+R28q2zMiYw==" }, "node_modules/@hapi/hoek": { "version": "9.3.0", @@ -3762,15 +3762,28 @@ "integrity": "sha512-WQ2gDll12T9WD34fdRFgQVgO8bag3gavrAgJ0frN4phlwdJARpE6gO1YvLEMJR0KKgoc+/Ea/A0Pp11I00xBvw==" }, "node_modules/@nextcloud/auth": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@nextcloud/auth/-/auth-2.2.1.tgz", - "integrity": "sha512-zYtgrg9NMZfN8kmL5JPCsh5jDhpTCEslhnZWMvbhTiQ7hrOnji/67ok6VMK0CTJ1a92Vr67Ow72lW7YRX69zEA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@nextcloud/auth/-/auth-2.4.0.tgz", + "integrity": "sha512-T5OFltKd0O9Hfj47VrzE7TVjCwqOMHH9JLyjjLUR3pu2MaTY9WL6AjL79sHbFTXUaIkftZgJKu12lHYmqXnL2Q==", "dependencies": { - "@nextcloud/event-bus": "^3.1.0" + "@nextcloud/browser-storage": "^0.4.0", + "@nextcloud/event-bus": "^3.3.1" }, "engines": { "node": "^20.0.0", - "npm": "^9.0.0" + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/auth/node_modules/@nextcloud/browser-storage": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nextcloud/browser-storage/-/browser-storage-0.4.0.tgz", + "integrity": "sha512-D6XxznxCYmJ3oBCC3p0JB6GZJ2RZ9dgbB1UqtTePXrIvHUMBAeF/YkiGKYxLAVZCZb+NSNZXgAYHm/3LnIUbDg==", + "dependencies": { + "core-js": "3.37.0" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, "node_modules/@nextcloud/axios": { @@ -3918,6 +3931,35 @@ "vue": "^2.7.16" } }, + "node_modules/@nextcloud/dialogs/node_modules/@nextcloud/l10n": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-2.2.0.tgz", + "integrity": "sha512-UAM2NJcl/NR46MANSF7Gr7q8/Up672zRyGrxLpN3k4URNmWQM9upkbRME+1K3T29wPrUyOIbQu710ZjvZafqFA==", + "dependencies": { + "@nextcloud/router": "^2.1.2", + "@nextcloud/typings": "^1.7.0", + "dompurify": "^3.0.3", + "escape-html": "^1.0.3", + "node-gettext": "^3.0.0" + }, + "engines": { + "node": "^20.0.0", + "npm": "^9.0.0" + } + }, + "node_modules/@nextcloud/dialogs/node_modules/@nextcloud/l10n/node_modules/@nextcloud/router": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.1.tgz", + "integrity": "sha512-ZRc/WI0RaksEJMz08H/6LimIdP+1A1xTHThCYEghs7VgAKNp5917vT2OKSpG0cMRbIwk0ongFVt5FB5qjy/iFg==", + "dependencies": { + "@nextcloud/typings": "^1.7.0", + "core-js": "^3.6.4" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, "node_modules/@nextcloud/eslint-config": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-8.3.0.tgz", @@ -3963,35 +4005,22 @@ } }, "node_modules/@nextcloud/event-bus": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@nextcloud/event-bus/-/event-bus-3.1.0.tgz", - "integrity": "sha512-purXQsXbhbmpcDsbDuR0i7vwUgOsqnIUa7QAD3lV/UZUkUT94SmxBM5LgQ8iV8TQBWWleEwQHy5kYfHeTGF9wg==", - "dependencies": { - "semver": "^7.5.1" - }, - "engines": { - "node": "^16.0.0", - "npm": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/@nextcloud/event-bus/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@nextcloud/event-bus/-/event-bus-3.3.1.tgz", + "integrity": "sha512-VBYJspOVk5aZopgZwCUoMKFqcTLCNel2TLvtu0HMPV2gR5ZLPiPAKbkyKkYTh+Sd5QB1gR6l3STTv1gyal0soQ==", "dependencies": { - "yallist": "^4.0.0" + "@types/node": "^20.12.12", + "semver": "^7.6.2" }, "engines": { - "node": ">=10" + "node": "^20.0.0", + "npm": "^10.0.0" } }, "node_modules/@nextcloud/event-bus/node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -3999,78 +4028,66 @@ "node": ">=10" } }, - "node_modules/@nextcloud/event-bus/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/@nextcloud/files": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@nextcloud/files/-/files-3.1.0.tgz", - "integrity": "sha512-i0g9L5HRBJ2vr/gXYb0Gtg379u6nYZJFL30W50OV0F0qlf8OtkAlNpfOVOg3sJf9zklARE2lVY9g2Y9sv/iQ3g==", - "dependencies": { - "@nextcloud/auth": "^2.2.1", - "@nextcloud/l10n": "^2.2.0", - "@nextcloud/logger": "^2.7.0", - "@nextcloud/paths": "^2.1.0", - "@nextcloud/router": "^2.2.0", - "is-svg": "^5.0.0", - "webdav": "^5.3.1" + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@nextcloud/files/-/files-3.9.0.tgz", + "integrity": "sha512-GKlD8PESRgpP3Rz7xgLbRPXvk1EKStkN8zwM3/L2Dl70g2qkUh1IdEAPZO2KlCdJPD8QxcdK4ib0KClk/ounpA==", + "dependencies": { + "@nextcloud/auth": "^2.4.0", + "@nextcloud/capabilities": "^1.2.0", + "@nextcloud/l10n": "^3.1.0", + "@nextcloud/logger": "^3.0.2", + "@nextcloud/paths": "^2.2.1", + "@nextcloud/router": "^3.0.1", + "@nextcloud/sharing": "^0.2.3", + "cancelable-promise": "^4.3.1", + "is-svg": "^5.1.0", + "typedoc-plugin-missing-exports": "^3.0.0", + "typescript-event-target": "^1.1.1", + "webdav": "^5.7.1" }, "engines": { "node": "^20.0.0", - "npm": "^9.0.0" + "npm": "^10.0.0" } }, - "node_modules/@nextcloud/files/node_modules/@nextcloud/router": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.0.tgz", - "integrity": "sha512-M4AVGnB5tt3MYO5RpH/R2jq7z/nW05AmRhk4Lh68krVwRIYGo8pgNikKrPGogHd2Q3UgzF5Py1drHz3uuV99bQ==", + "node_modules/@nextcloud/files/node_modules/@nextcloud/logger": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nextcloud/logger/-/logger-3.0.2.tgz", + "integrity": "sha512-wByt0R0/6QC44RBpaJr1MWghjjOxk/pRbACHo/ZWWKht1qYbJRHB4GtEi+35KEIHY07ZpqxiDk6dIRuN7sXYWQ==", "dependencies": { - "@nextcloud/typings": "^1.7.0", - "core-js": "^3.6.4" + "@nextcloud/auth": "^2.3.0" }, "engines": { "node": "^20.0.0", - "npm": "^9.0.0" + "npm": "^10.0.0" } }, "node_modules/@nextcloud/initial-state": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.1.0.tgz", - "integrity": "sha512-b92X/GvUPGQJpUQwauyG3D3dHsWowViVLnTtFPSMUc0rXtvYR5CvhkqJRfPC7O7W4VC7+V3q+FWeA+mQWMxN2Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.2.0.tgz", + "integrity": "sha512-cDW98L5KGGgpS8pzd+05304/p80cyu8U2xSDQGa+kGPTpUFmCbv2qnO5WrwwGTauyjYijCal2bmw82VddSH+Pg==", "engines": { "node": "^20.0.0", - "npm": "^9.0.0" + "npm": "^10.0.0" } }, "node_modules/@nextcloud/l10n": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-2.2.0.tgz", - "integrity": "sha512-UAM2NJcl/NR46MANSF7Gr7q8/Up672zRyGrxLpN3k4URNmWQM9upkbRME+1K3T29wPrUyOIbQu710ZjvZafqFA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-3.1.0.tgz", + "integrity": "sha512-unciqr8QSJ29vFBw9S1bquyoj1PTWHszNL8tcUNuxUAYpq0hX+8o7rpB5gimELA4sj4m9+VCJwgLtBZd1Yj0lg==", "dependencies": { - "@nextcloud/router": "^2.1.2", - "@nextcloud/typings": "^1.7.0", - "dompurify": "^3.0.3", + "@nextcloud/router": "^3.0.1", + "@nextcloud/typings": "^1.8.0", + "@types/dompurify": "^3.0.5", + "@types/escape-html": "^1.0.4", + "dompurify": "^3.1.2", "escape-html": "^1.0.3", "node-gettext": "^3.0.0" }, "engines": { "node": "^20.0.0", - "npm": "^9.0.0" - } - }, - "node_modules/@nextcloud/l10n/node_modules/@nextcloud/router": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.0.tgz", - "integrity": "sha512-M4AVGnB5tt3MYO5RpH/R2jq7z/nW05AmRhk4Lh68krVwRIYGo8pgNikKrPGogHd2Q3UgzF5Py1drHz3uuV99bQ==", - "dependencies": { - "@nextcloud/typings": "^1.7.0", - "core-js": "^3.6.4" - }, - "engines": { - "node": "^20.0.0", - "npm": "^9.0.0" + "npm": "^10.0.0" } }, "node_modules/@nextcloud/logger": { @@ -4087,17 +4104,18 @@ } }, "node_modules/@nextcloud/paths": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.1.0.tgz", - "integrity": "sha512-8wX0gqwez0bTuAS8A0OEiqbbp0ZsqLr07zSErmS6OYhh9KZcSt/kO6lQV5tnrFqIqJVsxwz4kHUjtZXh6DSf9Q==", - "dependencies": { - "core-js": "^3.6.4" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.2.1.tgz", + "integrity": "sha512-M3ShLjrxR7B48eKThLMoqbxTqTKyQXcwf9TgeXQGbCIhiHoXU6as5j8l5qNv/uZlANokVdowpuWHBi3b2+YNNA==", + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, "node_modules/@nextcloud/router": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-3.0.0.tgz", - "integrity": "sha512-RlPrOPw94yT9rmt3+2sUs2cmWzqhX5eFW+i/EHymJEKgURVtnqCcXjIcAiLTfgsCCdAS1hGapBL8j8rhHk1FHQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-3.0.1.tgz", + "integrity": "sha512-Ci/uD3x8OKHdxSqXL6gRJ+mGJOEXjeiHjj7hqsZqVTsT7kOrCjDf0/J8z5RyLlokKZ0IpSe+hGxgi3YB7Gpw3Q==", "dependencies": { "@nextcloud/typings": "^1.7.0" }, @@ -4106,6 +4124,18 @@ "npm": "^10.0.0" } }, + "node_modules/@nextcloud/sharing": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@nextcloud/sharing/-/sharing-0.2.3.tgz", + "integrity": "sha512-hxQFOBBahbJkcmAGZFVS3943pQGSafNF6LMHmgcj0JPqExu1DWKuZvsCXZnGkaRJVcewHnZFcLAhpOf+VfcZmA==", + "dependencies": { + "@nextcloud/initial-state": "^2.2.0" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, "node_modules/@nextcloud/stylelint-config": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@nextcloud/stylelint-config/-/stylelint-config-2.4.0.tgz", @@ -4198,6 +4228,35 @@ "vue": "2.x" } }, + "node_modules/@nextcloud/vue/node_modules/@nextcloud/l10n": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-2.2.0.tgz", + "integrity": "sha512-UAM2NJcl/NR46MANSF7Gr7q8/Up672zRyGrxLpN3k4URNmWQM9upkbRME+1K3T29wPrUyOIbQu710ZjvZafqFA==", + "dependencies": { + "@nextcloud/router": "^2.1.2", + "@nextcloud/typings": "^1.7.0", + "dompurify": "^3.0.3", + "escape-html": "^1.0.3", + "node-gettext": "^3.0.0" + }, + "engines": { + "node": "^20.0.0", + "npm": "^9.0.0" + } + }, + "node_modules/@nextcloud/vue/node_modules/@nextcloud/l10n/node_modules/@nextcloud/router": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.1.tgz", + "integrity": "sha512-ZRc/WI0RaksEJMz08H/6LimIdP+1A1xTHThCYEghs7VgAKNp5917vT2OKSpG0cMRbIwk0ongFVt5FB5qjy/iFg==", + "dependencies": { + "@nextcloud/typings": "^1.7.0", + "core-js": "^3.6.4" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, "node_modules/@nextcloud/vue/node_modules/debounce": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/debounce/-/debounce-2.0.0.tgz", @@ -4328,6 +4387,57 @@ "styled-components": "^5.1.0" } }, + "node_modules/@shikijs/core": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.17.0.tgz", + "integrity": "sha512-Mkk4Mp4bNnW1kytU8I7S5PK5teNSe0iKlfqxPss4sdwnlcU8a2N62Z3te2gVmZfU9t1HF6L3wyWuM43IvEeEsg==", + "peer": true, + "dependencies": { + "@shikijs/engine-javascript": "1.17.0", + "@shikijs/engine-oniguruma": "1.17.0", + "@shikijs/types": "1.17.0", + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.2" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.17.0.tgz", + "integrity": "sha512-EiBVlxmzJZdC2ypzn8k+vxLngbBNgHLS4RilwrFOABGRc72kUZubbD/6Chrq2RcVtD3yq1GtiiIdFMGd9BTX3Q==", + "peer": true, + "dependencies": { + "@shikijs/types": "1.17.0", + "oniguruma-to-js": "0.3.3", + "regex": "4.3.2" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.17.0.tgz", + "integrity": "sha512-nsXzJGLQ0fhKmA4Gwt1cF7vC8VuZ1HSDrTRuj48h/qDeX/TzmOlTDXQ3uPtyuhyg/2rbZRzNhN8UFU4fSnQfXg==", + "peer": true, + "dependencies": { + "@shikijs/types": "1.17.0", + "@shikijs/vscode-textmate": "^9.2.2" + } + }, + "node_modules/@shikijs/types": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.17.0.tgz", + "integrity": "sha512-Tvu2pA69lbpXB+MmgIaROP1tio8y0uYvKb5Foh3q0TJBTAJuaoa5eDEtS/0LquyveacsiVrYF4uEZILju+7Ybg==", + "peer": true, + "dependencies": { + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.2.2.tgz", + "integrity": "sha512-TMp15K+GGYrWlZM8+Lnj9EaHEFmOen0WJBrfa17hF7taDOYthuPPV0GWzfd/9iMij0akS/8Yw2ikquH7uVi/fg==", + "peer": true + }, "node_modules/@sideway/address": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", @@ -4589,6 +4699,19 @@ "@types/node": "*" } }, + "node_modules/@types/dompurify": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-3.0.5.tgz", + "integrity": "sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg==", + "dependencies": { + "@types/trusted-types": "*" + } + }, + "node_modules/@types/escape-html": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/escape-html/-/escape-html-1.0.4.tgz", + "integrity": "sha512-qZ72SFTgUAZ5a7Tj6kf2SHLetiH5S6f8G5frB2SPQ3EyF02kxdyBFf4Tz4banE3xCgGnKgWLt//a6VuYHKYJTg==" + }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -4734,12 +4857,11 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", - "dev": true, + "version": "20.16.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", + "integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/node-forge": { @@ -4752,6 +4874,11 @@ "@types/node": "*" } }, + "node_modules/@types/node/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", @@ -4899,6 +5026,11 @@ "resolved": "https://registry.npmjs.org/@types/toastify-js/-/toastify-js-1.12.3.tgz", "integrity": "sha512-9RjLlbAHMSaae/KZNHGv19VG4gcLIm3YjvacCXBtfMfYn26h76YP5oxXI8k26q4iKXCB9LNfv18lsoS0JnFPTg==" }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" + }, "node_modules/@types/unist": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", @@ -7274,6 +7406,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/cancelable-promise": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/cancelable-promise/-/cancelable-promise-4.3.1.tgz", + "integrity": "sha512-A/8PwLk/T7IJDfUdQ68NR24QHa8rIlnN/stiJEBo6dmVUkD4K14LswG0w3VwdeK/o7qOwRUR1k2MhK5Rpy2m7A==" + }, "node_modules/caniuse-lite": { "version": "1.0.30001596", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001596.tgz", @@ -7347,6 +7484,26 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", @@ -7804,9 +7961,9 @@ "peer": true }, "node_modules/core-js": { - "version": "3.36.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.36.0.tgz", - "integrity": "sha512-mt7+TUBbTFg5+GngsAxeKBTl5/VS0guFeJacYge9OmHb+m058UwwIm41SE9T4Den7ClatV57B6TYTuJ0CX1MAw==", + "version": "3.37.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.0.tgz", + "integrity": "sha512-fu5vHevQ8ZG4og+LXug8ulUtVxjOcEYvifJr7L5Bfq9GOztVqsKd9/59hUk2ZSbCrS3BqUr3EpaYGIYzq7g3Ug==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -9312,9 +9469,9 @@ } }, "node_modules/dompurify": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.9.tgz", - "integrity": "sha512-uyb4NDIvQ3hRn6NiC+SIFaP4mJ/MdXlvtunaqK9Bn6dD3RuB/1S/gasEjDHD8eiaqdSael2vBv+hOs7Y+jhYOQ==" + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.6.tgz", + "integrity": "sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==" }, "node_modules/domutils": { "version": "3.1.0", @@ -12175,6 +12332,42 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-to-html": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.2.tgz", + "integrity": "sha512-RP5wNpj5nm1Z8cloDv4Sl4RS8jH5HYa0v93YB6Wb4poEzgMo/dAAL0KcT4974dCjcNG5pkLqTImeFHHCwwfY3g==", + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-html/node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hast-util-whitespace": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", @@ -12347,6 +12540,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/htmlparser2": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", @@ -13142,11 +13345,11 @@ } }, "node_modules/is-svg": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-5.0.0.tgz", - "integrity": "sha512-sRl7J0oX9yUNamSdc8cwgzh9KBLnQXNzGmW0RVHwg/jEYjGNYHC6UvnYD8+hAeut9WwxRvhG9biK7g/wDGxcMw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-5.1.0.tgz", + "integrity": "sha512-uVg5yifaTxHoefNf5Jcx+i9RZe2OBYd/UStp1umx+EERa4xGRa3LLGXjoEph43qUORC0qkafUgrXZ6zzK89yGA==", "dependencies": { - "fast-xml-parser": "^4.1.3" + "fast-xml-parser": "^4.4.1" }, "engines": { "node": ">=14.16" @@ -15481,9 +15684,9 @@ } }, "node_modules/layerr": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/layerr/-/layerr-2.0.1.tgz", - "integrity": "sha512-z0730CwG/JO24evdORnyDkwG1Q7b7mF2Tp1qRQ0YvrMMARbt1DFG694SOv439Gm7hYKolyZyaB49YIrYIfZBdg==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/layerr/-/layerr-3.0.0.tgz", + "integrity": "sha512-tv754Ki2dXpPVApOrjTyRo4/QegVb9eVFq4mjqp4+NM5NaX7syQvN5BBNfV/ZpAHCEHV24XdUVrBAoka4jt3pA==" }, "node_modules/lazy-ass": { "version": "1.6.0", @@ -15525,6 +15728,15 @@ "dev": true, "peer": true }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "peer": true, + "dependencies": { + "uc.micro": "^2.0.0" + } + }, "node_modules/linkify-string": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/linkify-string/-/linkify-string-4.1.3.tgz", @@ -15866,6 +16078,12 @@ "yallist": "^3.0.2" } }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "peer": true + }, "node_modules/magic-string": { "version": "0.30.10", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", @@ -15903,6 +16121,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "peer": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "node_modules/markdown-it/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "peer": true + }, "node_modules/markdown-table": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", @@ -16178,6 +16419,12 @@ "dev": true, "peer": true }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "peer": true + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -17506,6 +17753,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/oniguruma-to-js": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.3.3.tgz", + "integrity": "sha512-m90/WEhgs8g4BxG37+Nu3YrMfJDs2YXtYtIllhsEPR+wP3+K4EZk6dDUvy2v2K4MNFDDOYKL4/yqYPXDqyozTQ==", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/open": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", @@ -18454,6 +18710,15 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/pure-rand": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", @@ -18952,6 +19217,12 @@ "@babel/runtime": "^7.8.4" } }, + "node_modules/regex": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/regex/-/regex-4.3.2.tgz", + "integrity": "sha512-kK/AA3A9K6q2js89+VMymcboLOlF5lZRCYJv3gzszXFHBr6kO6qLGzbm+UIugBEV8SMMKCTR59txoY6ctRHYVw==", + "peer": true + }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -19999,6 +20270,18 @@ "node": ">=4" } }, + "node_modules/shiki": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.17.0.tgz", + "integrity": "sha512-VZf8cPShRwfzPcaswv81+YP7qJEoFwRT+Ehy6bizim7M0zG9bk8Egug550C+xS9g7rKIOPhzAlp2uEyuCxbk/A==", + "peer": true, + "dependencies": { + "@shikijs/core": "1.17.0", + "@shikijs/types": "1.17.0", + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4" + } + }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", @@ -20480,6 +20763,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "peer": true, + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/stringify-object": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", @@ -21848,11 +22145,55 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typedoc": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.7.tgz", + "integrity": "sha512-gUeI/Wk99vjXXMi8kanwzyhmeFEGv1LTdTQsiyIsmSYsBebvFxhbcyAx7Zjo4cMbpLGxM4Uz3jVIjksu/I2v6Q==", + "peer": true, + "dependencies": { + "lunr": "^2.3.9", + "markdown-it": "^14.1.0", + "minimatch": "^9.0.5", + "shiki": "^1.16.2", + "yaml": "^2.5.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x" + } + }, + "node_modules/typedoc-plugin-missing-exports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-3.0.0.tgz", + "integrity": "sha512-R7D8fYrK34mBFZSlF1EqJxfqiUSlQSmyrCiQgTQD52nNm6+kUtqwiaqaNkuJ2rA2wBgWFecUA8JzHT7x2r7ePg==", + "peerDependencies": { + "typedoc": "0.26.x" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "peer": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/typescript": { "version": "5.5.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", - "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -21861,6 +22202,17 @@ "node": ">=14.17" } }, + "node_modules/typescript-event-target": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/typescript-event-target/-/typescript-event-target-1.1.1.tgz", + "integrity": "sha512-dFSOFBKV6uwaloBCCUhxlD3Pr/P1a/tJdcmPrTXCHlEFD3faj0mztjcGn6VBAhQ0/Bdy8K3VWrrqwbt/ffsYsg==" + }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "peer": true + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -22679,19 +23031,19 @@ } }, "node_modules/webdav": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/webdav/-/webdav-5.6.0.tgz", - "integrity": "sha512-1zpC9T+nZAEz3hHrEdis3gybiwoR5LillHmFiylhYWAsGU0bGlWlRZtK5NJ3bTr2wCoKABrRGGqLk24+UxF4Gg==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/webdav/-/webdav-5.7.1.tgz", + "integrity": "sha512-JVPn3nLxXJfHSRvennHsOrDYjFLkilZ1Qlw8Ff6hpqp6AvkgF7a//aOh5wA4rMp+sLZ1Km0V+iv0LyO1FIwtXg==", "dependencies": { "@buttercup/fetch": "^0.2.1", "base-64": "^1.0.0", "byte-length": "^1.0.2", - "entities": "^4.5.0", - "fast-xml-parser": "^4.2.4", - "hot-patcher": "^2.0.0", - "layerr": "^2.0.1", + "entities": "^5.0.0", + "fast-xml-parser": "^4.4.1", + "hot-patcher": "^2.0.1", + "layerr": "^3.0.0", "md5": "^2.3.0", - "minimatch": "^7.4.6", + "minimatch": "^9.0.5", "nested-property": "^4.0.0", "node-fetch": "^3.3.2", "path-posix": "^1.0.0", @@ -22702,15 +23054,26 @@ "node": ">=16" } }, + "node_modules/webdav/node_modules/entities": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-5.0.0.tgz", + "integrity": "sha512-BeJFvFRJddxobhvEdm5GqHzRV/X+ACeuw0/BuuxsCh1EUZcAIz8+kYmBp/LrQuloy6K1f3a0M7+IhmZ7QnkISA==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/webdav/node_modules/minimatch": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", - "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -23198,6 +23561,18 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "peer": true }, + "node_modules/yaml": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", + "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "peer": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 2f9aa4c32..19c5aa332 100644 --- a/package.json +++ b/package.json @@ -41,15 +41,15 @@ "cypress:update-snapshots": "npm run cypress:pre-snapshots && cypress run --env type=base --spec cypress/e2e/visual-regression.cy.js --config screenshotsFolder=cypress/snapshots/base" }, "dependencies": { - "@fontsource/roboto": "^5.0.12", + "@fontsource/roboto": "^5.0.15", "@mdi/svg": "^7.4.47", "@nextcloud/auth": "^2.2.1", "@nextcloud/axios": "^2.4.0", "@nextcloud/dialogs": "^5.2.0", "@nextcloud/event-bus": "^3.1.0", - "@nextcloud/files": "^3.1.0", + "@nextcloud/files": "^3.9.0", "@nextcloud/initial-state": "^2.1.0", - "@nextcloud/l10n": "^2.2.0", + "@nextcloud/l10n": "^3.1.0", "@nextcloud/logger": "^2.7.0", "@nextcloud/paths": "^2.1.0", "@nextcloud/router": "^3.0.0", @@ -71,7 +71,7 @@ ], "engines": { "node": "^20.0.0", - "npm": "^9.0.0" + "npm": "^10.0.0" }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.18.6", diff --git a/src/files_actions/viewerAction.ts b/src/files_actions/viewerAction.ts new file mode 100644 index 000000000..23e818ab2 --- /dev/null +++ b/src/files_actions/viewerAction.ts @@ -0,0 +1,73 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +import type { Node, View } from '@nextcloud/files' + +import { DefaultType, FileAction, Permission, registerFileAction } from '@nextcloud/files' +import { t } from '@nextcloud/l10n' +import svgEye from '@mdi/svg/svg/eye.svg?raw' + +/** + * @param node The file to open + * @param view any The files view + * @param dir the directory path + */ +function pushToHistory(node: Node, view: View, dir: string) { + window.OCP.Files.Router.goToRoute( + null, + { view: view.id, fileid: String(node.fileid) }, + { dir, openfile: 'true' }, + true, + ) +} + +/** + * Execute the viewer files action + * @param node The active node + * @param view The current view + * @param dir The current path + */ +async function execAction(node: Node, view: View, dir: string): Promise { + const oldRoute = [ + window.OCP.Files.Router.name, + { ...window.OCP.Files.Router.params }, + { ...window.OCP.Files.Router.query } as Record, + true, + ] as const + + const onClose = () => { + // This can sometime be called with the openfile set to true already. But we don't want to keep openfile when closing the viewer. + delete oldRoute[2].openfile + window.OCP.Files.Router.goToRoute(...oldRoute) + } + + pushToHistory(node, view, dir) + window.OCA.Viewer.open({ path: node.path, onPrev: pushToHistory, onNext: pushToHistory, onClose }) + + return null +} + +/** + * Register the viewer action on the files API + */ +export function registerViewerAction() { + registerFileAction(new FileAction({ + id: 'view', + displayName: () => t('viewer', 'View'), + iconSvgInline: () => svgEye, + default: DefaultType.DEFAULT, + enabled: (nodes) => { + // Disable if not located in user root + if (nodes.some(node => !(node.isDavRessource && node.root?.startsWith('/files')))) { + return false + } + + return nodes.every((node) => + Boolean(node.permissions & Permission.READ) + && window.OCA.Viewer.mimetypes.includes(node.mime), + ) + }, + exec: execAction, + })) +} diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 000000000..68fddca37 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,20 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +/// + +import type Viewer from './services/Viewer.js' + +declare global { + interface Window { + OCA: { + Viewer: Viewer + } + OCP: Nextcloud.v29.OCP + } + + const appVersion: string +} + +export {} diff --git a/src/init.ts b/src/init.ts new file mode 100644 index 000000000..ba1efb614 --- /dev/null +++ b/src/init.ts @@ -0,0 +1,14 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +import { registerViewerAction } from './files_actions/viewerAction' +import ViewerService from './services/Viewer.js' + +// Register the files action +registerViewerAction() + +// Init Viewer Service +window.OCA = window.OCA ?? {} +window.OCA.Viewer = new ViewerService() +window.OCA.Viewer.version = appVersion diff --git a/src/main.js b/src/main.js index b23977390..bc17fe2dd 100644 --- a/src/main.js +++ b/src/main.js @@ -21,7 +21,6 @@ */ import Vue from 'vue' import ViewerComponent from './views/Viewer.vue' -import ViewerService from './services/Viewer.js' import { translate as t } from '@nextcloud/l10n' import { generateFilePath } from '@nextcloud/router' @@ -52,12 +51,6 @@ __webpack_nonce__ = btoa(OC.requestToken) // eslint-disable-next-line __webpack_public_path__ = generateFilePath('viewer', '', 'js/') -// Init Viewer Service -if (window.OCA) { - Object.assign(window.OCA, { Viewer: new ViewerService() }) - OCA.Viewer.version = appVersion -} - // Create document root const ViewerRoot = document.createElement('div') ViewerRoot.id = 'viewer' diff --git a/src/services/FilesActionHandler.js b/src/services/FilesActionHandler.js deleted file mode 100644 index 429772278..000000000 --- a/src/services/FilesActionHandler.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @copyright Copyright (c) 2020 Azul - * - * @author Azul - * - * @license AGPL-3.0-or-later - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/** - * @param {Node} node The file to open - * @param {any} view any The files view - * @param {string} dir the directory path - */ -export default function(node, view, dir) { - // replace potential leading double slashes - const path = `${node.dirname}/${node.basename}`.replace(/^\/\//, '/') - const oldRoute = [ - window.OCP.Files.Router.name, - { ...window.OCP.Files.Router.params }, - { ...window.OCP.Files.Router.query }, - true, - ] - const onClose = () => { - // This can sometime be called with the openfile set to true already. But we don't want to keep openfile when closing the viewer. - delete oldRoute[2].openfile - window.OCP.Files.Router.goToRoute(...oldRoute) - } - pushToHistory(node, view, dir) - OCA.Viewer.open({ path, onPrev: pushToHistory, onNext: pushToHistory, onClose }) -} - -/** - * @param {Node} node The file to open - * @param {any} view any The files view - * @param {string} dir the directory path - */ -function pushToHistory(node, view, dir) { - window.OCP.Files.Router.goToRoute( - null, - { view: view.id, fileid: node.fileid }, - { dir, openfile: true }, - true, - ) -} diff --git a/src/services/Viewer.js b/src/services/Viewer.js index 55e51e31c..71cd44870 100644 --- a/src/services/Viewer.js +++ b/src/services/Viewer.js @@ -23,6 +23,7 @@ import Images from '../models/images.js' import Videos from '../models/videos.js' import Audios from '../models/audios.js' +import logger from './logger.js' /** * Handler type definition @@ -78,7 +79,7 @@ export default class Viewer { this.registerHandler(Videos) this.registerHandler(Audios) - console.debug('OCA.Viewer initialized') + logger.debug('OCA.Viewer initialized') } /** @@ -99,6 +100,12 @@ export default class Viewer { * @param {Handler} handler a new unregistered handler */ registerHandler(handler) { + const error = this.validateHandler(handler) + if (error) { + logger.error('Could not register handler', { error, handler }) + return + } + this._state.handlers.push(handler) const handledMimes = [ ...handler.mimes, diff --git a/src/shims.d.ts b/src/shims.d.ts new file mode 100644 index 000000000..b6084120f --- /dev/null +++ b/src/shims.d.ts @@ -0,0 +1,14 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +declare module '*.svg' { + const content: string + export default content +} + +declare module '*.svg?raw' { + const content: string + export default content +} diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index 202603364..3e09a4a78 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -193,7 +193,8 @@ import Vue from 'vue' import axios from '@nextcloud/axios' import { showError } from '@nextcloud/dialogs' import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus' -import { registerFileAction, FileAction, Permission, DefaultType } from '@nextcloud/files' +import { Node } from '@nextcloud/files' +import { loadState } from '@nextcloud/initial-state' import getSortingConfig from '../services/FileSortingConfig.ts' import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen.js' @@ -205,7 +206,6 @@ import canDownload from '../utils/canDownload.js' import cancelableRequest from '../utils/CancelableRequest.js' import Error from '../components/Error.vue' import File from '../models/file.js' -import filesActionHandler from '../services/FilesActionHandler.js' import legacyFilesActionHandler from '../services/LegacyFilesActionHandler.js' import getFileInfo from '../services/FileInfo.ts' import getFileList from '../services/FileList.ts' @@ -214,11 +214,9 @@ import logger from '../services/logger.js' import Delete from 'vue-material-design-icons/Delete.vue' import Download from 'vue-material-design-icons/Download.vue' -import EyeSvg from '@mdi/svg/svg/eye.svg?raw' import Fullscreen from 'vue-material-design-icons/Fullscreen.vue' import FullscreenExit from 'vue-material-design-icons/FullscreenExit.vue' import Pencil from 'vue-material-design-icons/Pencil.vue' -import { loadState } from '@nextcloud/initial-state' // Dynamic loading const NcModal = () => import( @@ -286,8 +284,7 @@ export default { isSidebarShown: false, isFullscreenMode: false, canSwipe: true, - // TODO: remove OCA?.Files?.fileActions when public Files is Vue - isStandalone: OCP?.Files === undefined && OCA?.Files?.fileActions === undefined, + isStandalone: false, theme: null, root: getRootPath(), handlerId: '', @@ -523,6 +520,11 @@ export default { }, beforeMount() { + this.isStandalone = window.OCP?.Files === undefined + if (this.isStandalone) { + logger.info('No OCP.Files app found, viewer is now in standalone mode') + } + // register on load document.addEventListener('DOMContentLoaded', () => { // register all primary components mimes @@ -542,16 +544,10 @@ export default { this.Sidebar = OCA.Files.Sidebar.state } - this.registerFileActions() - logger.info(`${this.handlers.length} viewer handlers registered`, { handlers: this.handlers }) }) window.addEventListener('resize', this.onResize) - - if (this.isStandalone) { - logger.info('No OCP.Files app found, viewer is now in standalone mode') - } }, mounted() { @@ -932,31 +928,6 @@ export default { } }, - registerFileActions() { - if (!this.isStandalone) { - registerFileAction(new FileAction({ - id: 'view', - displayName() { - return t('viewer', 'View') - }, - iconSvgInline: () => EyeSvg, - default: DefaultType.DEFAULT, - enabled: (nodes) => { - // Disable if not located in user root - if (nodes.some(node => !(node.isDavRessource && node.root?.startsWith('/files')))) { - return false - } - // Faster to check if at least one node doesn't match the requirements - return !nodes.some(node => ( - (node.permissions & Permission.READ) === 0 - || !this.Viewer.mimetypes.includes(node.mime) - )) - }, - exec: filesActionHandler, - })) - } - }, - /** * Close the viewer */