Repository navigation
Releases: nextcloud-libraries/nextcloud-viewer
Releases · nextcloud-libraries/nextcloud-viewer
Release list
v2.0.0-beta.18
2.0.0-beta.18
Breaking
- The viewer tells whoever opened it with events instead of callbacks.
open(),openFolder()andcompare()resolve with aViewerSession, an
EventTargetdispatchingupdate:file,update:editing,closeand
before-download. They replace theonPrev,onNext,onEditingChange
andonCloseoptions.getViewer()dispatches the same events, whoever
opened the viewer (#130) compare(file, base, { view, handlerId })replaces
compare(node1, node2, handlerId). Both handler elements get
files: [base, file]and acomparisonprop, and the older file shows on
the left (#133)- A handler's
canCompareis a function of the files, likeenabled(#133) - The package is ESM only, the CommonJS build is gone. Its styles are no
longer injected from JavaScript: each chunk imports its own stylesheet, so
the app's bundler has to handle CSS imports (#124, #132)
Added
- A handler setting
canShowDifferencescan show what changed between two
files in one view. The viewer then offers a toggle in its header, also on D,
andcompare()can open straight on it withview: 'differences'(#133) - Two versions of a picture show over each other, cut where you drag a
slider (#134) before-downloadalso reaches the handler's element, and
detail.waitUntil()holds the download back, so an editor can save first
(#130)
Changed
v2.0.0-beta.17
2.0.0-beta.17
Added
- Opened from anywhere but the Files app, the viewer offers its own Download
and Delete again, as the viewer app did. With a Files context the Files
actions show instead. Ctrl+S downloads, Ctrl+Delete deletes, Ctrl+E opens
the editor where it is offered, and F toggles full screen
(#95, nextcloud/viewer#406)
Fixed
- A handler asking for the
'default'theme follows the user's theme again,
backdrop and header included, as it did in the viewer app. A handler with no
theme stays dark (#125) - The viewer's dark palette only applies to its own parts on the dark
backdrop, no longer to what a handler shows: a document in Text came out
white on black under a light theme, and printed in grey (#125) - An end-to-end encrypted image, video or sound is fetched from its own URL:
the request went to a wrong address and never reached the file (#98)
Changed
vueand@nextcloud/vueare now dependencies rather than peer
dependencies, so apps still on Vue 2 can use the library (#121)- Node 24 or newer is required
v2.0.0-beta.16
2.0.0-beta.16
Added
- A video shows at its size as soon as that is known, from its server preview,
or from the few bytes of an mp4 or mov that hold it, with its poster while it
buffers. The slideshow holds until it can play (#114, #104)
Fixed
- Preloading the next or previous video no longer reads all of it: an mp4
with its index at the end had the browser fetch the whole file. Box headers
are read to find the index, and a sound's metadata is only read when its
index comes first. Nothing is preloaded with data saver on
(#114, nextcloud/viewer#2284) - The files next to the one shown are preloaded once it has loaded, rather
than competing with it (#114) - An update of the file shown that carries the version already on screen no
longer remounts its element: Text rebuilt its editor on each of its own
saves (#119)
v2.0.0-beta.15
2.0.0-beta.15
Added
onInit()on a handler, called the first time the viewer needs its element,
so the view and what it imports stay out of the registration script that
runs on every page. The viewer waits for the element to be defined before
rendering it. Tag names may now hold an underscore, for app ids like
files_pdfviewer(#76)- A "Start slideshow" Files action on a selection of two files or more that
can all be viewed (#103, nextcloud/viewer#1524) - Full screen and the sidebar are buttons in the header instead of entries
in the menu (#99) - The files next to the one shown are preloaded: the preview a picture will
ask for, and a video or sound's metadata.preloadis given the space the
viewer shows files in as a second argument (#100) - Zooming into a picture goes to its full resolution: the first zoom fetches
the largest preview the server renders and swaps it in once decoded, and
the zoom goes until one of its pixels is four on screen, never less than
five times as before (#88, nextcloud/viewer#2391) canCompareon a handler, andcanCompare(node)for a caller deciding
whether to offer comparing two versions. The image handler sets it (#94)- The elected copy of the library says so in the debug log (#83)
Fixed
- A slideshow skipped videos that were slow to start: stepping to a file now
waits for it to load, and the slideshow holds while it does
(#101, nextcloud/viewer#39) - The image editor's text tool could not be typed in, and the arrow keys
paged away from an unsaved edit: the modal kept the focus from the editor
(#112, nextcloud/viewer#3335) - A file the caller looked up on its own was listed twice:
open()finds it
in the list by its source (#102) - A neighbouring file updated elsewhere kept its old name and source (#100)
- Saving from the image editor could damage a file: it was offered on every
image and wrote PNG over GIF, SVG, BMP or AVIF. It is back to JPEG, PNG and
WebP, on a file that may be downloaded, not while comparing, not on a phone
and not where non-accessible features are turned off (#89) - Images page through videos and sounds again, as before, and a video shows
the picture of the same name beside it as its poster (#86) - Playing a video again no longer downloads it again, and its poster comes
back once it has played (#87, nextcloud/viewer#2585) - A video or sound the browser cannot play says so instead of spinning
forever, and Firefox without an audio device no longer fails every sound
(#77, nextcloud/viewer#2930, nextcloud/viewer#542) - Opening the current file after an older version of it showed the old one
(#85, nextcloud/viewer#3052) - Pictures in subfolders of a public share got no preview (#90)
- Small videos were stretched to fill the viewer, and the speed label went
back to an unlocalised value after a change of speed (#91) - More files are asked for whenever the last one is shown, not only stepping
forward onto it, and deleting the open file keeps the Files URL in step
(#92) - The Files sidebar, when already open as the viewer opens or restored from
the URL, gets room made for it and follows the file shown.
viewer:sidebar:opencarries the whole node again (#93) - With the Files app on another copy of Vue than the elected viewer, the
viewer offered no previous, no next and no slideshow (#93)
v2.0.0-beta.14
2.0.0-beta.14
Breaking
- The handler field
tagnameis nowtagName, the name the files
sidebar tabs and the other registration APIs use. The shared handler
registry moved from_nc_viewer_scope.handlers_v1tohandlers_v2,
so a copy of beta.13 or older on the same page does not share a viewer
with this one: apps and the server have to move to beta.14 together (#81)
Added
- A file that takes more than 5 seconds to load says "Still loading…"
under the spinner, and one that failed to show offers "Try again"
without closing the viewer (#78)
Fixed
- Pictures on a share that forbids downloading showed nothing: their
preview is now fetched with thex-nc-previewheader the server asks
for (#51) - When that preview cannot be loaded either, the viewer says "No preview
available, download is disabled." instead of "Failed to load image." (#79) - Rotate and edit only show once the file is shown, not over the loading
spinner or the error of a file that failed to show (#80)
v2.0.0-beta.13
2.0.0-beta.13
Fixed
- Closing the viewer, then pressing back, opened the file again with the
Files app on vue-router 5. Its navigations land asynchronously, and the
viewer tagged the history entry before the router had created it, so it
found nothing to unwind on close. History changes now wait for the
router's navigation (#74)
v2.0.0-beta.12
2.0.0-beta.12
Changed
- Every
onClosepassed while the viewer is open is called once when it
closes, not only the last one. Opening over a viewer that is still open
used to drop the first opener's, so the Files app never cleaned
openfile=trueout of its URL when a handler handed its file to
another one withopen(). The same function passed twice is still
called once, and one that throws does not stop the others (#66) - The options filled in for a caller that passes none no longer carry
no-op callbacks. The viewer always called them optionally (#66)
Fixed
- Clicking rotate again while the previous turn was still being written
could undo it, and every turn made the picture flash once written.
Writes now wait for each other and build on the bytes just sent, and
the viewer no longer reloads a picture it is already showing turned
(#61) - The right-click menu is refused on a share that hides or forbids
the download: the check read the old viewer's names for those
restrictions, not the ones nodes carry,hide-downloadand
share-attributes(#65) - Registering the same handler twice, as the server's copy and an app's
do with the defaults, no longer warns. Another handler taking an id
that is already used still does (#64) - The header is readable on the dark backdrop (#60)
Documentation
- A tutorial that builds a handler from scratch, and a reference that
lists every option and the whole migration fromOCA.Viewer(#67)
v2.0.0-beta.11
2.0.0-beta.11
Added
- A rotate button, ahead of the edit button, turns the picture at once
and writes the turn to the file about a second later by rewriting its
Exif orientation tag. Nothing is decoded or re-encoded, so the picture
is the same picture however many times it is turned, and the tag is
what the preview generator reads, so the new framing follows the file
into the Files grid and the mobile clients. JPEG only, and only where
the user may write: no other format carries an orientation this stack
honours. Written once the user settles rather than once per click,
since every write makes a version of the file (#49) turnsonViewerProps: the quarter turns the viewer is showing on top
of the file's own orientation, while a rotation is being written. A
handler that can turn its content should honour it; the rest may ignore
it, so this breaks nothing that already exists (#49)- AVIF opens. Every engine the viewer runs in decodes it natively, so it
is shown from the file itself; nothing in Nextcloud previews it, so
listing it as preview-supported would have kept it closed everywhere
(#50) - MusicXML scores open,
.musicxmland the zipped.mxl, drawn with
opensheetmusicdisplay. The renderer is imported inside the component,
so it is fetched the first time somebody opens a score and never for
anyone who only opens photos (#52) - JPEG 2000 opens where the server renders it. Nothing decodes it in the
browser, so it sits with the other formats that depend on a preview
provider, and it needs nextcloud/server#64603, which is in 36 (#53)
Fixed
- A WAV arrives under three different names depending on who wrote it,
and only one of them was listed, so the other two would not open (#45)
v2.0.0-beta.9
2.0.0-beta.9
Added
open(nodes, file, { startSlideshow: true })starts the slideshow, ignored
for a single file and reset on close. Handlers gain a fourth emit,
update:playing, and the slideshow pauses while it is true, so a playing
clip finishes before it moves on; the video and audio players emit it from
the media element. (#39)supportsEndToEndEncryptiononIHandler, carried by the three default
handlers. Absent is the safe default. (#38)
Changed
@nextcloud/vue9.13.0 is the minimum:startSlideshowdrives NcModal's
v-model:slideshow-running, which landed there. Below it the option does
nothing at runtime. (#39)@nextcloud/image-editor1.0.0-beta.4. An edited JPEG is written at the
quality its source was written at rather than the browser's default, and the
decode and the half-size copies the editor draws from happen in a worker: on
a 12 Mpx photo and a phone-class CPU, opening one went from 6.1 s to 0.9 s,
and the longest frame the main thread was held from 5.1 s to 0.4 s. (#41)
Fixed
- An end-to-end encrypted file is no longer offered to a handler that fetches
it through its own endpoint and would get ciphertext. Since Nextcloud 33 the
e2ee app decrypts transparently, but only over WebDAV, so the file is offered
to handlers that say they read it that way. (#38) - The API documentation builds again: typedoc reads the rolled-up declarations
fromdistrather than running tsc over sources it cannot resolve single
file components in. It had failed on every push tomainsince beta.8. (#40)
v2.0.0-beta.10
One fix since beta.9.
Closing the viewer unwinds the history entries it pushed, and until history.go() lands the URL still carries openfile=true, which is the flag the Files list opens a file for. Anything that made the list re-read the route inside that window opened a second viewer over the one that was closing. On a shared CI runner the window is wide enough to hit: three media tests in nextcloud/server#63954 failed their close assertion with two modal containers in the DOM, one per viewer.
The flag now comes off the entry being left before the jump is requested. #43