Skip to content

Commit ce7d640

Browse files
committed
feat: Viewer 7.0.0
Rewrite the viewer to Vue 3 + Vite with a framework-agnostic custom-element handler API (@nextcloud/viewer), a new open/openFolder/compare API and file-action integration. Opening a file, navigating and closing keep the Files router history in sync via an openfile URL: refreshing re-opens the viewer, browser back/forward move between shown files, and closing unwinds the pushed entries. The viewer menu mirrors the Files actions, skipping custom-rendered and label-less entries so no blank items are shown, and renders their icons through NcIconSvgWrapper. Signed-off-by: skjnldsv <skjnldsv@protonmail.com> Assisted-by: ClaudeCode:claude-opus-4-8
1 parent 0520fdb commit ce7d640

62 files changed

Lines changed: 6814 additions & 9560 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

.gitignore

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,18 @@ vendor
2222
.php_cs.cache
2323
.php-cs-fixer.cache
2424

25-
build/
26-
coverage/
27-
*.orig
28-
29-
# We do not ship the Roboto font files (only needed for Playwright) - but we need to ship the other font files
30-
css/fonts/roboto-*
3125
js/*roboto*
3226

3327
# Playwright files
34-
playwright-report/
35-
test-results/
36-
blob-report/
37-
playwright/.cache/
28+
/playwright-report/
29+
/test-results/
30+
/blob-report/
31+
/playwright/.cache/
3832

3933
# RelativeCI webpack bundle stats
4034
webpack-stats.json
35+
*.orig
36+
.php-cs-fixer.cache
37+
38+
# Test coverage
39+
/coverage/

REUSE.toml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ SPDX-FileCopyrightText = "2023 Nextcloud GmbH and Nextcloud contributors"
3636
SPDX-License-Identifier = "AGPL-3.0-or-later"
3737

3838
[[annotations]]
39-
path = [".eslintrc.json"]
39+
path = ["eslint.config.js", "stylelint.config.cjs", "rector.php"]
4040
precedence = "aggregate"
4141
SPDX-FileCopyrightText = "2024 Nextcloud GmbH and Nextcloud contributors"
4242
SPDX-License-Identifier = "AGPL-3.0-or-later"
@@ -83,12 +83,6 @@ precedence = "aggregate"
8383
SPDX-FileCopyrightText = "2012 AnRo0002 <https://commons.wikimedia.org/wiki/User:AnRo0002>"
8484
SPDX-License-Identifier = "CC0-1.0"
8585

86-
[[annotations]]
87-
path = ["playwright/fixtures/test-card.mp4", "playwright/fixtures/test-card.png"]
88-
precedence = "aggregate"
89-
SPDX-FileCopyrightText = "2023 Bulgarian National Television <https://commons.wikimedia.org/wiki/File:Bulgarian_colour_testcard.png>"
90-
SPDX-License-Identifier = "CC0-1.0"
91-
9286
[[annotations]]
9387
path = ["playwright/fixtures/audio.mp3", "playwright/fixtures/audio.ogg"]
9488
precedence = "aggregate"
@@ -102,17 +96,11 @@ SPDX-FileCopyrightText = "2013 Wilfredor <https://commons.wikimedia.org/wiki/Use
10296
SPDX-License-Identifier = "CC0-1.0"
10397

10498
[[annotations]]
105-
path = ["playwright/fixtures/image.bmp", "playwright/fixtures/image.png", "playwright/fixtures/image.webp"]
99+
path = ["playwright/fixtures/image.png", "playwright/fixtures/image.webp"]
106100
precedence = "aggregate"
107101
SPDX-FileCopyrightText = "2024 Master Unknown <https://unsplash.com/@exp00>"
108102
SPDX-License-Identifier = "LicenseRef-Unsplash"
109103

110-
[[annotations]]
111-
path = ["playwright/fixtures/image.heic"]
112-
precedence = "aggregate"
113-
SPDX-FileCopyrightText = "2024 HEIC Digital <https://heic.digital/download-sample/soundboard.heic>"
114-
SPDX-License-Identifier = "CC0-1.0"
115-
116104
[[annotations]]
117105
path = ["img/app.svg"]
118106
precedence = "aggregate"

eslint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { recommended } from '@nextcloud/eslint-config'
2+
3+
export default [
4+
...recommended,
5+
]

lib/Listener/LoadViewerScript.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
class LoadViewerScript implements IEventListener {
2525
private IInitialState $initialStateService;
26+
2627
private IPreview $previewManager;
2728

2829
public function __construct(
@@ -35,14 +36,12 @@ public function __construct(
3536

3637
#[\Override]
3738
public function handle(Event $event): void {
38-
if (!($event instanceof LoadViewer || $event instanceof LoadAdditionalScriptsEvent)) {
39+
if (!$event instanceof LoadViewer && !$event instanceof LoadAdditionalScriptsEvent) {
3940
return;
4041
}
4142

4243
Util::addStyle(Application::APP_ID, 'viewer-init');
43-
Util::addStyle(Application::APP_ID, 'viewer-main');
4444
Util::addInitScript(Application::APP_ID, 'viewer-init');
45-
Util::addScript(Application::APP_ID, 'viewer-main', 'files');
4645
$this->initialStateService->provideInitialState('enabled_preview_providers', array_keys($this->previewManager->getProviders()));
4746
}
4847
}

0 commit comments

Comments
 (0)