From dc15f7d2ccb7d4b5e46bac2ed7c2e3858674d28a Mon Sep 17 00:00:00 2001 From: Pedro Pinto Silva Date: Wed, 8 Apr 2026 14:07:35 +0200 Subject: [PATCH] feat(web-app-external): handle Collabora UI_InsertGraphic and UI_InsertFile postMessages Add frontend handling for Collabora's remote file insertion and document comparison features. When oCIS sets EnableInsertRemoteFile and EnableInsertRemoteImage in the WOPI CheckFileInfo response, Collabora shows new menu items that send UI_InsertGraphic and UI_InsertFile postMessages to the parent window. - Add Host_PostmessageReady handshake: reply to App_LoadingStatus with Host_PostmessageReady so Collabora accepts Action postMessages. - Handle UI_InsertGraphic: open a file picker modal filtered to image MIME types, resolve the selected file to a signed WebDAV download URL, and send Action_InsertGraphic back to the Collabora iframe. - Handle UI_InsertFile: read callback and mimeTypeFilter from the Collabora message, open the file picker accordingly, and send back the appropriate Action (Action_InsertMultimedia or Action_CompareDocuments). - Create InsertRemoteFileModal.vue: new modal component that embeds the oCIS file browser in embed mode, resolves the picked file to a download URL via clientService.webdav.getFileUrl(), and calls back with { filename, url }. - Replace catchClickMicrosoftEdit with a unified handleAppMessage listener that handles all app iframe postMessages (UI_Edit, App_LoadingStatus, UI_InsertGraphic, UI_InsertFile). Companion server-side PR: owncloud/ocis#12192 Signed-off-by: Pedro Pinto Silva --- ...nhancement-collabora-insert-remote-file.md | 12 ++ packages/web-app-external/src/App.vue | 120 +++++++++++++-- .../src/components/InsertRemoteFileModal.vue | 141 ++++++++++++++++++ 3 files changed, 263 insertions(+), 10 deletions(-) create mode 100644 changelog/unreleased/enhancement-collabora-insert-remote-file.md create mode 100644 packages/web-app-external/src/components/InsertRemoteFileModal.vue diff --git a/changelog/unreleased/enhancement-collabora-insert-remote-file.md b/changelog/unreleased/enhancement-collabora-insert-remote-file.md new file mode 100644 index 00000000000..00c85941cef --- /dev/null +++ b/changelog/unreleased/enhancement-collabora-insert-remote-file.md @@ -0,0 +1,12 @@ +Enhancement: Handle Collabora insert remote file and image postMessages + +Handle UI_InsertGraphic and UI_InsertFile postMessages from Collabora Online, +enabling remote image insertion, multimedia insertion, and document comparison +features. Opens a file picker modal, resolves the selected file to a download +URL, and sends the result back to Collabora. Also adds the Host_PostmessageReady +handshake required by Collabora before it accepts Action postMessages. + +Requires Collabora Online >= 24.04.10 for multimedia insertion, >= 25.04.9.1 +for document comparison. Companion server-side PR: owncloud/ocis#12192. + +https://github.com/owncloud/web/pull/13658 diff --git a/packages/web-app-external/src/App.vue b/packages/web-app-external/src/App.vue index 97402a17c4d..15eb3f626ee 100644 --- a/packages/web-app-external/src/App.vue +++ b/packages/web-app-external/src/App.vue @@ -1,6 +1,7 @@ + + + + +