From 363e890894a829c97a4dafa7eabd8a75e24c7b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 1 Sep 2022 20:09:33 +0200 Subject: [PATCH] Implement file reference wiget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .../composer/composer/autoload_classmap.php | 1 + .../composer/composer/autoload_static.php | 1 + apps/files/lib/AppInfo/Application.php | 3 + .../Listener/RenderReferenceEventListener.php | 39 ++++ apps/files/src/reference-files.js | 44 +++++ apps/files/src/views/ReferenceFileWidget.vue | 175 ++++++++++++++++++ dist/files-reference-files.js | 3 + dist/files-reference-files.js.LICENSE.txt | 20 ++ dist/files-reference-files.js.map | 1 + .../Reference/File/FileReferenceProvider.php | 3 +- lib/public/RichObjectStrings/Definitions.php | 6 + package-lock.json | 145 +++++++++++++++ package.json | 1 + webpack.modules.js | 1 + 14 files changed, 442 insertions(+), 1 deletion(-) create mode 100644 apps/files/lib/Listener/RenderReferenceEventListener.php create mode 100644 apps/files/src/reference-files.js create mode 100644 apps/files/src/views/ReferenceFileWidget.vue create mode 100644 dist/files-reference-files.js create mode 100644 dist/files-reference-files.js.LICENSE.txt create mode 100644 dist/files-reference-files.js.map diff --git a/apps/files/composer/composer/autoload_classmap.php b/apps/files/composer/composer/autoload_classmap.php index 46da43165b982..28e58839505bc 100644 --- a/apps/files/composer/composer/autoload_classmap.php +++ b/apps/files/composer/composer/autoload_classmap.php @@ -47,6 +47,7 @@ 'OCA\\Files\\Helper' => $baseDir . '/../lib/Helper.php', 'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => $baseDir . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php', 'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir . '/../lib/Listener/LoadSidebarListener.php', + 'OCA\\Files\\Listener\\RenderReferenceEventListener' => $baseDir . '/../lib/Listener/RenderReferenceEventListener.php', 'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir . '/../lib/Migration/Version11301Date20191205150729.php', 'OCA\\Files\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', 'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir . '/../lib/Search/FilesSearchProvider.php', diff --git a/apps/files/composer/composer/autoload_static.php b/apps/files/composer/composer/autoload_static.php index ea9d9715fd3b0..ba080ca521908 100644 --- a/apps/files/composer/composer/autoload_static.php +++ b/apps/files/composer/composer/autoload_static.php @@ -62,6 +62,7 @@ class ComposerStaticInitFiles 'OCA\\Files\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php', 'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => __DIR__ . '/..' . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php', 'OCA\\Files\\Listener\\LoadSidebarListener' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarListener.php', + 'OCA\\Files\\Listener\\RenderReferenceEventListener' => __DIR__ . '/..' . '/../lib/Listener/RenderReferenceEventListener.php', 'OCA\\Files\\Migration\\Version11301Date20191205150729' => __DIR__ . '/..' . '/../lib/Migration/Version11301Date20191205150729.php', 'OCA\\Files\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', 'OCA\\Files\\Search\\FilesSearchProvider' => __DIR__ . '/..' . '/../lib/Search/FilesSearchProvider.php', diff --git a/apps/files/lib/AppInfo/Application.php b/apps/files/lib/AppInfo/Application.php index 2662f2d6e9b48..8163a370e42ed 100644 --- a/apps/files/lib/AppInfo/Application.php +++ b/apps/files/lib/AppInfo/Application.php @@ -44,6 +44,7 @@ use OCA\Files\Event\LoadSidebar; use OCA\Files\Listener\LegacyLoadAdditionalScriptsAdapter; use OCA\Files\Listener\LoadSidebarListener; +use OCA\Files\Listener\RenderReferenceEventListener; use OCA\Files\Notification\Notifier; use OCA\Files\Search\FilesSearchProvider; use OCA\Files\Service\TagService; @@ -52,6 +53,7 @@ use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\Collaboration\Reference\RenderReferenceEvent; use OCP\Collaboration\Resources\IProviderManager; use OCP\IConfig; use OCP\IL10N; @@ -116,6 +118,7 @@ public function register(IRegistrationContext $context): void { $context->registerEventListener(LoadAdditionalScriptsEvent::class, LegacyLoadAdditionalScriptsAdapter::class); $context->registerEventListener(LoadSidebar::class, LoadSidebarListener::class); + $context->registerEventListener(RenderReferenceEvent::class, RenderReferenceEventListener::class); $context->registerSearchProvider(FilesSearchProvider::class); diff --git a/apps/files/lib/Listener/RenderReferenceEventListener.php b/apps/files/lib/Listener/RenderReferenceEventListener.php new file mode 100644 index 0000000000000..121ff74506549 --- /dev/null +++ b/apps/files/lib/Listener/RenderReferenceEventListener.php @@ -0,0 +1,39 @@ + + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * 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 . + */ + +namespace OCA\Files\Listener; + +use OCP\Collaboration\Reference\RenderReferenceEvent; +use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IEventListener; + +class RenderReferenceEventListener implements IEventListener { + public function handle(Event $event): void { + if (!$event instanceof RenderReferenceEvent) { + return; + } + + \OCP\Util::addScript('files', 'reference-files'); + } +} diff --git a/apps/files/src/reference-files.js b/apps/files/src/reference-files.js new file mode 100644 index 0000000000000..deb7fe82ab50a --- /dev/null +++ b/apps/files/src/reference-files.js @@ -0,0 +1,44 @@ +/** + * @copyright Copyright (c) 2022 Julius Härtl + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * 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 . + */ + +import Vue from 'vue' +import { translate as t } from '@nextcloud/l10n' + +import { registerWidget } from '@nextcloud/vue-richtext' + +import FileWidget from './views/ReferenceFileWidget.vue' + +Vue.mixin({ + methods: { + t, + }, +}) + +registerWidget('file', (el, { richObjectType, richObject, accessible }) => { + const Widget = Vue.extend(FileWidget) + new Widget({ + propsData: { + richObjectType, + richObject, + accessible, + }, + }).$mount(el) +}) diff --git a/apps/files/src/views/ReferenceFileWidget.vue b/apps/files/src/views/ReferenceFileWidget.vue new file mode 100644 index 0000000000000..596ec5407c7b3 --- /dev/null +++ b/apps/files/src/views/ReferenceFileWidget.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/dist/files-reference-files.js b/dist/files-reference-files.js new file mode 100644 index 0000000000000..0e04e65f06dd4 --- /dev/null +++ b/dist/files-reference-files.js @@ -0,0 +1,3 @@ +/*! For license information please see files-reference-files.js.LICENSE.txt */ +!function(){"use strict";var e,n={29345:function(e,n,t){var i=t(20144),r=t(9944),o=t(70105),l=t(79753),a=t(62520),c=t.n(a),s={name:"ReferenceFileWidget",props:{richObject:{type:Object,required:!0},accessible:{type:Boolean,default:!0}},data:function(){return{previewUrl:window.OC.MimeType.getIconUrl(this.richObject.mimetype)}},computed:{fileSize:function(){return window.OC.Util.humanFileSize(this.richObject.size)},fileMtime:function(){return window.OC.Util.relativeModifiedDate(1e3*this.richObject.mtime)},filePath:function(){return c().dirname(this.richObject.path)},filePreview:function(){return this.previewUrl?{backgroundImage:"url("+this.previewUrl+")"}:{backgroundImage:"url("+window.OC.MimeType.getIconUrl(this.richObject.mimetype)+")"}},filePreviewClass:function(){return this.previewUrl?"widget-file--image--preview":"widget-file--image--icon"}},mounted:function(){var e=this;if(this.richObject["preview-available"]){var n=(0,l.generateUrl)("/core/preview?fileId={fileId}&x=250&y=250",{fileId:this.richObject.id}),t=new Image;t.onload=function(){e.previewUrl=n},t.onerror=function(e){console.error("could not load recommendation preview",e)},t.src=n}},methods:{navigate:function(){OCA.Viewer&&-1!==OCA.Viewer.mimetypes.indexOf(this.richObject.mimetype)?OCA.Viewer.open({path:this.richObject.path}):window.location=(0,l.generateUrl)("/f/"+this.id)}}},d=t(93379),A=t.n(d),f=t(7795),u=t.n(f),p=t(90569),w=t.n(p),g=t(3565),v=t.n(g),C=t(19216),h=t.n(C),m=t(44589),b=t.n(m),x=t(36460),O={};O.styleTagTransform=b(),O.setAttributes=v(),O.insert=w().bind(null,"head"),O.domAPI=u(),O.insertStyleElement=h(),A()(x.Z,O),x.Z&&x.Z.locals&&x.Z.locals;var y=(0,t(51900).Z)(s,(function(){var e=this,n=e.$createElement,t=e._self._c||n;return e.accessible?t("a",{staticClass:"widget-file",attrs:{href:e.richObject.link},on:{click:function(n){return n.preventDefault(),e.navigate.apply(null,arguments)}}},[t("div",{staticClass:"widget-file--image",class:e.filePreviewClass,style:e.filePreview}),e._v(" "),t("div",{staticClass:"widget-file--details"},[t("p",{staticClass:"widget-file--title"},[e._v(e._s(e.richObject.name))]),e._v(" "),t("p",{staticClass:"widget-file--description"},[e._v(e._s(e.fileSize)),t("br"),e._v(e._s(e.fileMtime))]),e._v(" "),t("p",{staticClass:"widget-file--link"},[e._v(e._s(e.filePath))])])]):t("div",{staticClass:"widget-file widget-file--no-access"},[t("div",{staticClass:"widget-file--image widget-file--image--icon icon-folder"}),e._v(" "),t("div",{staticClass:"widget-file--details"},[t("p",{staticClass:"widget-file--title"},[e._v(e._s(e.t("files","File cannot be accessed")))]),e._v(" "),t("p",{staticClass:"widget-file--description"},[e._v(e._s(e.t("files","You might not have have permissions to view it, ask the sender to share it")))])])])}),[],!1,null,"29961252",null),k=y.exports;i.ZP.mixin({methods:{t:r.translate}}),(0,o.jC)("file",(function(e,n){var t=n.richObjectType,r=n.richObject,o=n.accessible;new(i.ZP.extend(k))({propsData:{richObjectType:t,richObject:r,accessible:o}}).$mount(e)}))},36460:function(e,n,t){var i=t(87537),r=t.n(i),o=t(23645),l=t.n(o)()(r());l.push([e.id,".widget-file[data-v-29961252]{display:flex}.widget-file--image[data-v-29961252]{min-width:40%;background-position:center;background-size:cover;background-repeat:no-repeat}.widget-file--image.widget-file--image--icon[data-v-29961252]{min-width:88px;background-size:44px}.widget-file--title[data-v-29961252]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:bold}.widget-file--details[data-v-29961252]{padding:12px;flex-grow:1;display:flex;flex-direction:column}.widget-file--details p[data-v-29961252]{margin:0;padding:0}.widget-file--description[data-v-29961252]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical}.widget-file--link[data-v-29961252]{color:var(--color-text-maxcontrast)}.widget-file.widget-file--no-access[data-v-29961252]{padding:12px}.widget-file.widget-file--no-access .widget-file--details[data-v-29961252]{padding:0}","",{version:3,sources:["webpack://./apps/files/src/views/ReferenceFileWidget.vue"],names:[],mappings:"AAuHA,8BACC,YAAA,CAEA,qCACC,aAAA,CACA,0BAAA,CACA,qBAAA,CACA,2BAAA,CAEA,8DACC,cAAA,CACA,oBAAA,CAIF,qCACC,eAAA,CACA,sBAAA,CACA,kBAAA,CACA,gBAAA,CAGD,uCACC,YAAA,CACA,WAAA,CACA,YAAA,CACA,qBAAA,CAEA,yCACC,QAAA,CACA,SAAA,CAIF,2CACC,eAAA,CACA,sBAAA,CACA,mBAAA,CACA,oBAAA,CACA,YAAA,CACA,2BAAA,CAGD,oCACC,mCAAA,CAGD,qDACC,YAAA,CAEA,2EACC,SAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.widget-file {\n\tdisplay: flex;\n\n\t&--image {\n\t\tmin-width: 40%;\n\t\tbackground-position: center;\n\t\tbackground-size: cover;\n\t\tbackground-repeat: no-repeat;\n\n\t\t&.widget-file--image--icon {\n\t\t\tmin-width: 88px;\n\t\t\tbackground-size: 44px;\n\t\t}\n\t}\n\n\t&--title {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tfont-weight: bold;\n\t}\n\n\t&--details {\n\t\tpadding: 12px;\n\t\tflex-grow: 1;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\tp {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t&--description {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tdisplay: -webkit-box;\n\t\t-webkit-line-clamp: 3;\n\t\tline-clamp: 3;\n\t\t-webkit-box-orient: vertical;\n\t}\n\n\t&--link {\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t&.widget-file--no-access {\n\t\tpadding: 12px;\n\n\t\t.widget-file--details {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]),n.Z=l}},t={};function i(e){var r=t[e];if(void 0!==r)return r.exports;var o=t[e]={id:e,loaded:!1,exports:{}};return n[e].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=n,i.amdD=function(){throw new Error("define cannot be used indirect")},i.amdO={},e=[],i.O=function(n,t,r,o){if(!t){var l=1/0;for(d=0;d=o)&&Object.keys(i.O).every((function(e){return i.O[e](t[c])}))?t.splice(c--,1):(a=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[t,r,o]},i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,{a:n}),n},i.d=function(e,n){for(var t in n)i.o(n,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},i.j=9098,function(){i.b=document.baseURI||self.location.href;var e={9098:0};i.O.j=function(n){return 0===e[n]};var n=function(n,t){var r,o,l=t[0],a=t[1],c=t[2],s=0;if(l.some((function(n){return 0!==e[n]}))){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);if(c)var d=c(i)}for(n&&n(t);s + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * 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 . + */ diff --git a/dist/files-reference-files.js.map b/dist/files-reference-files.js.map new file mode 100644 index 0000000000000..628224405f25a --- /dev/null +++ b/dist/files-reference-files.js.map @@ -0,0 +1 @@ +{"version":3,"file":"files-reference-files.js?v=bed01ffb7348341e2dc6","mappings":";6BAAIA,8FCA4L,EC6ChM,CACA,2BACA,OACA,YACA,YACA,aAEA,YACA,aACA,aAGA,KAZA,WAaA,OACA,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,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAO7D,EAAoBY,EAAEC,IAG1BuD,EAAqBX,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FW,EAAmBC,QAAQP,EAAqBQ,KAAK,KAAM,IAC3DF,EAAmBxE,KAAOkE,EAAqBQ,KAAK,KAAMF,EAAmBxE,KAAK0E,KAAKF,OClDvFpE,EAAoBuE,QAAKpE,ECGzB,IAAIqE,EAAsBxE,EAAoBY,OAAET,EAAW,CAAC,OAAO,WAAa,OAAOH,EAAoB,UAC3GwE,EAAsBxE,EAAoBY,EAAE4D","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/apps/files/src/views/ReferenceFileWidget.vue?vue&type=script&lang=js&","webpack:///nextcloud/apps/files/src/views/ReferenceFileWidget.vue","webpack://nextcloud/./apps/files/src/views/ReferenceFileWidget.vue?09c5","webpack://nextcloud/./apps/files/src/views/ReferenceFileWidget.vue?1c02","webpack:///nextcloud/apps/files/src/views/ReferenceFileWidget.vue?vue&type=template&id=29961252&scoped=true&","webpack:///nextcloud/apps/files/src/reference-files.js","webpack:///nextcloud/apps/files/src/views/ReferenceFileWidget.vue?vue&type=style&index=0&id=29961252&lang=scss&scoped=true&","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/amd define","webpack:///nextcloud/webpack/runtime/amd options","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReferenceFileWidget.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReferenceFileWidget.vue?vue&type=script&lang=js&\"","\n\n\n\n\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReferenceFileWidget.vue?vue&type=style&index=0&id=29961252&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReferenceFileWidget.vue?vue&type=style&index=0&id=29961252&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./ReferenceFileWidget.vue?vue&type=template&id=29961252&scoped=true&\"\nimport script from \"./ReferenceFileWidget.vue?vue&type=script&lang=js&\"\nexport * from \"./ReferenceFileWidget.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ReferenceFileWidget.vue?vue&type=style&index=0&id=29961252&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"29961252\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.accessible)?_c('div',{staticClass:\"widget-file widget-file--no-access\"},[_c('div',{staticClass:\"widget-file--image widget-file--image--icon icon-folder\"}),_vm._v(\" \"),_c('div',{staticClass:\"widget-file--details\"},[_c('p',{staticClass:\"widget-file--title\"},[_vm._v(_vm._s(_vm.t('files', 'File cannot be accessed')))]),_vm._v(\" \"),_c('p',{staticClass:\"widget-file--description\"},[_vm._v(_vm._s(_vm.t('files', 'You might not have have permissions to view it, ask the sender to share it')))])])]):_c('a',{staticClass:\"widget-file\",attrs:{\"href\":_vm.richObject.link},on:{\"click\":function($event){$event.preventDefault();return _vm.navigate.apply(null, arguments)}}},[_c('div',{staticClass:\"widget-file--image\",class:_vm.filePreviewClass,style:(_vm.filePreview)}),_vm._v(\" \"),_c('div',{staticClass:\"widget-file--details\"},[_c('p',{staticClass:\"widget-file--title\"},[_vm._v(_vm._s(_vm.richObject.name))]),_vm._v(\" \"),_c('p',{staticClass:\"widget-file--description\"},[_vm._v(_vm._s(_vm.fileSize)),_c('br'),_vm._v(_vm._s(_vm.fileMtime))]),_vm._v(\" \"),_c('p',{staticClass:\"widget-file--link\"},[_vm._v(_vm._s(_vm.filePath))])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright Copyright (c) 2022 Julius Härtl \n *\n * @author Julius Härtl \n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport Vue from 'vue'\nimport { translate as t } from '@nextcloud/l10n'\n\nimport { registerWidget } from '@nextcloud/vue-richtext'\n\nimport FileWidget from './views/ReferenceFileWidget.vue'\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nregisterWidget('file', (el, { richObjectType, richObject, accessible }) => {\n\tconst Widget = Vue.extend(FileWidget)\n\tnew Widget({\n\t\tpropsData: {\n\t\t\trichObjectType,\n\t\t\trichObject,\n\t\t\taccessible,\n\t\t},\n\t}).$mount(el)\n})\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".widget-file[data-v-29961252]{display:flex}.widget-file--image[data-v-29961252]{min-width:40%;background-position:center;background-size:cover;background-repeat:no-repeat}.widget-file--image.widget-file--image--icon[data-v-29961252]{min-width:88px;background-size:44px}.widget-file--title[data-v-29961252]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:bold}.widget-file--details[data-v-29961252]{padding:12px;flex-grow:1;display:flex;flex-direction:column}.widget-file--details p[data-v-29961252]{margin:0;padding:0}.widget-file--description[data-v-29961252]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical}.widget-file--link[data-v-29961252]{color:var(--color-text-maxcontrast)}.widget-file.widget-file--no-access[data-v-29961252]{padding:12px}.widget-file.widget-file--no-access .widget-file--details[data-v-29961252]{padding:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/views/ReferenceFileWidget.vue\"],\"names\":[],\"mappings\":\"AAuHA,8BACC,YAAA,CAEA,qCACC,aAAA,CACA,0BAAA,CACA,qBAAA,CACA,2BAAA,CAEA,8DACC,cAAA,CACA,oBAAA,CAIF,qCACC,eAAA,CACA,sBAAA,CACA,kBAAA,CACA,gBAAA,CAGD,uCACC,YAAA,CACA,WAAA,CACA,YAAA,CACA,qBAAA,CAEA,yCACC,QAAA,CACA,SAAA,CAIF,2CACC,eAAA,CACA,sBAAA,CACA,mBAAA,CACA,oBAAA,CACA,YAAA,CACA,2BAAA,CAGD,oCACC,mCAAA,CAGD,qDACC,YAAA,CAEA,2EACC,SAAA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.widget-file {\\n\\tdisplay: flex;\\n\\n\\t&--image {\\n\\t\\tmin-width: 40%;\\n\\t\\tbackground-position: center;\\n\\t\\tbackground-size: cover;\\n\\t\\tbackground-repeat: no-repeat;\\n\\n\\t\\t&.widget-file--image--icon {\\n\\t\\t\\tmin-width: 88px;\\n\\t\\t\\tbackground-size: 44px;\\n\\t\\t}\\n\\t}\\n\\n\\t&--title {\\n\\t\\toverflow: hidden;\\n\\t\\ttext-overflow: ellipsis;\\n\\t\\twhite-space: nowrap;\\n\\t\\tfont-weight: bold;\\n\\t}\\n\\n\\t&--details {\\n\\t\\tpadding: 12px;\\n\\t\\tflex-grow: 1;\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\n\\t\\tp {\\n\\t\\t\\tmargin: 0;\\n\\t\\t\\tpadding: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t&--description {\\n\\t\\toverflow: hidden;\\n\\t\\ttext-overflow: ellipsis;\\n\\t\\tdisplay: -webkit-box;\\n\\t\\t-webkit-line-clamp: 3;\\n\\t\\tline-clamp: 3;\\n\\t\\t-webkit-box-orient: vertical;\\n\\t}\\n\\n\\t&--link {\\n\\t\\tcolor: var(--color-text-maxcontrast);\\n\\t}\\n\\n\\t&.widget-file--no-access {\\n\\t\\tpadding: 12px;\\n\\n\\t\\t.widget-file--details {\\n\\t\\t\\tpadding: 0;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdD = function () {\n\tthrow new Error('define cannot be used indirect');\n};","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 9098;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t9098: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], function() { return __webpack_require__(29345); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","component","_vm","this","_h","$createElement","_c","_self","accessible","staticClass","attrs","richObject","link","on","$event","preventDefault","navigate","apply","arguments","class","filePreviewClass","style","_v","_s","name","fileSize","fileMtime","filePath","t","Vue","methods","registerWidget","el","richObjectType","FileWidget","propsData","$mount","___CSS_LOADER_EXPORT___","push","module","id","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","loaded","__webpack_modules__","call","m","amdD","Error","amdO","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","value","nmd","paths","children","b","document","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","forEach","bind","nc","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/private/Collaboration/Reference/File/FileReferenceProvider.php b/lib/private/Collaboration/Reference/File/FileReferenceProvider.php index 39cdb62b09ad0..c4100aa0f2490 100644 --- a/lib/private/Collaboration/Reference/File/FileReferenceProvider.php +++ b/lib/private/Collaboration/Reference/File/FileReferenceProvider.php @@ -133,9 +133,10 @@ private function fetchReference(Reference $reference): void { 'id' => $file->getId(), 'name' => $file->getName(), 'size' => $file->getSize(), - 'path' => $file->getPath(), + 'path' => $userFolder->getRelativePath($file->getPath()), 'link' => $reference->getUrl(), 'mimetype' => $file->getMimetype(), + 'mtime' => $file->getMTime(), 'preview-available' => $this->previewManager->isAvailable($file) ]); } catch (InvalidPathException|NotFoundException|NotPermittedException|NoUserException $e) { diff --git a/lib/public/RichObjectStrings/Definitions.php b/lib/public/RichObjectStrings/Definitions.php index 383d626c155fc..57da9f4eb3026 100644 --- a/lib/public/RichObjectStrings/Definitions.php +++ b/lib/public/RichObjectStrings/Definitions.php @@ -347,6 +347,12 @@ class Definitions { 'description' => 'Whether or not a preview is available. If `no` the mimetype icon should be used', 'example' => 'yes', ], + 'mtime' => [ + 'since' => '25.0.0', + 'required' => false, + 'description' => 'The mtime of the file/folder as unix timestamp', + 'example' => '1661854213', + ], ], ], 'forms-form' => [ diff --git a/package-lock.json b/package-lock.json index 539851056f00c..aa4377a140e4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@nextcloud/sharing": "^0.1.0", "@nextcloud/vue": "^7.0.0-beta.4", "@nextcloud/vue-dashboard": "^2.0.1", + "@nextcloud/vue-richtext": "^2.0.1", "@vue/cli-plugin-unit-jest": "^4.5.15", "autosize": "^5.0.1", "backbone": "^1.4.1", @@ -3520,6 +3521,89 @@ "webpack": "^4.0.0 || ^5.0.0" } }, + "node_modules/@nextcloud/vue-richtext": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nextcloud/vue-richtext/-/vue-richtext-2.0.1.tgz", + "integrity": "sha512-/44HTGBqokWXyRQJyh2YJgnJK7xv0nKdHxwHqvVAmcnsp7tipc6C1aPRJeHGXgbHoo+DbdpVp4l3+hlVqeUkFA==", + "dependencies": { + "@nextcloud/axios": "^2.0.0", + "@nextcloud/router": "^2.0.0", + "clone": "^2.1.2", + "vue": "^2.7.8" + }, + "engines": { + "node": ">=14.0.0", + "npm": ">=7.0.0" + }, + "peerDependencies": { + "vue": "^2.7.8" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/auth": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/auth/-/auth-2.0.0.tgz", + "integrity": "sha512-v8K8tvjkOsGt1+gKydVeMiEwWLXlfPWSptXnMqP21Xd6pFAQxNuNNCY679XKU4MNaKzpZqLstCCxv/KrjeQv8A==", + "dependencies": { + "@nextcloud/event-bus": "^3.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/axios": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/axios/-/axios-2.0.0.tgz", + "integrity": "sha512-Pgg0QtA+phxYbe3kMWwhN03ltMZU3x2SfPLRbOPJGP29DgULKBS6YH3U4ev2M8T0drrwCcRnB7esb+FSrW+D5g==", + "dependencies": { + "@nextcloud/auth": "^2.0.0", + "axios": "^0.27.2", + "tslib": "^2.4.0" + }, + "engines": { + "node": "^16.0.0", + "npm": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/event-bus": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nextcloud/event-bus/-/event-bus-3.0.2.tgz", + "integrity": "sha512-svXCZa4UkoZKsBiGzTi0cVcbPFUOhCm7pMKjGumRwBvHywX+8by478IQ8Grw75PFHxajMJZ0KrOTTM8WnzzEAw==", + "dependencies": { + "semver": "^7.3.7" + }, + "engines": { + "node": "^16.0.0", + "npm": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@nextcloud/vue/node_modules/@babel/polyfill": { "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.12.1.tgz", @@ -34846,6 +34930,67 @@ } } }, + "@nextcloud/vue-richtext": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nextcloud/vue-richtext/-/vue-richtext-2.0.1.tgz", + "integrity": "sha512-/44HTGBqokWXyRQJyh2YJgnJK7xv0nKdHxwHqvVAmcnsp7tipc6C1aPRJeHGXgbHoo+DbdpVp4l3+hlVqeUkFA==", + "requires": { + "@nextcloud/axios": "^2.0.0", + "@nextcloud/router": "^2.0.0", + "clone": "^2.1.2", + "vue": "^2.7.8" + }, + "dependencies": { + "@nextcloud/auth": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/auth/-/auth-2.0.0.tgz", + "integrity": "sha512-v8K8tvjkOsGt1+gKydVeMiEwWLXlfPWSptXnMqP21Xd6pFAQxNuNNCY679XKU4MNaKzpZqLstCCxv/KrjeQv8A==", + "requires": { + "@nextcloud/event-bus": "^3.0.0" + } + }, + "@nextcloud/axios": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/axios/-/axios-2.0.0.tgz", + "integrity": "sha512-Pgg0QtA+phxYbe3kMWwhN03ltMZU3x2SfPLRbOPJGP29DgULKBS6YH3U4ev2M8T0drrwCcRnB7esb+FSrW+D5g==", + "requires": { + "@nextcloud/auth": "^2.0.0", + "axios": "^0.27.2", + "tslib": "^2.4.0" + } + }, + "@nextcloud/event-bus": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nextcloud/event-bus/-/event-bus-3.0.2.tgz", + "integrity": "sha512-svXCZa4UkoZKsBiGzTi0cVcbPFUOhCm7pMKjGumRwBvHywX+8by478IQ8Grw75PFHxajMJZ0KrOTTM8WnzzEAw==", + "requires": { + "semver": "^7.3.7" + } + }, + "axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "requires": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==" + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, "@node-ipc/js-queue": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@node-ipc/js-queue/-/js-queue-2.0.3.tgz", diff --git a/package.json b/package.json index c63c1bbd29beb..7cfb28648fbf4 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "@nextcloud/sharing": "^0.1.0", "@nextcloud/vue": "^7.0.0-beta.4", "@nextcloud/vue-dashboard": "^2.0.1", + "@nextcloud/vue-richtext": "^2.0.1", "@vue/cli-plugin-unit-jest": "^4.5.15", "autosize": "^5.0.1", "backbone": "^1.4.1", diff --git a/webpack.modules.js b/webpack.modules.js index 25982e9623dd9..3fc895312b73a 100644 --- a/webpack.modules.js +++ b/webpack.modules.js @@ -50,6 +50,7 @@ module.exports = { sidebar: path.join(__dirname, 'apps/files/src', 'sidebar.js'), main: path.join(__dirname, 'apps/files/src', 'main.js'), 'personal-settings': path.join(__dirname, 'apps/files/src', 'main-personal-settings.js'), + 'reference-files': path.join(__dirname, 'apps/files/src', 'reference-files.js'), }, files_sharing: { additionalScripts: path.join(__dirname, 'apps/files_sharing/src', 'additionalScripts.js'),