From 9d8220791967d4ff037ebec00121d9efd3d8c69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Wed, 1 Mar 2023 14:27:39 +0100 Subject: [PATCH] Remove dependency to @nextcloud/vue-richtext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- package-lock.json | 122 ------------------ package.json | 1 - .../NcRichContenteditable.vue | 6 +- src/functions/linkPicker/index.js | 27 ---- 4 files changed, 3 insertions(+), 153 deletions(-) delete mode 100644 src/functions/linkPicker/index.js diff --git a/package-lock.json b/package-lock.json index 31638e3fc9..3c98af4364 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,6 @@ "@nextcloud/l10n": "^2.0.1", "@nextcloud/logger": "^2.2.1", "@nextcloud/router": "^2.0.0", - "@nextcloud/vue-richtext": "^2.1.0-beta.6", "@nextcloud/vue-select": "^3.21.2", "@skjnldsv/sanitize-svg": "^1.0.2", "clone": "^2.1.2", @@ -3159,72 +3158,6 @@ "npm": "^7.0.0 || ^8.0.0" } }, - "node_modules/@nextcloud/vue": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-7.6.1.tgz", - "integrity": "sha512-MKYn72BUR73iZWAYROGbT3Uf1ihlVBS/XxAqQOQEs9oqF4ULdCY0EA+xR43OzGpDOQdgWeW5wt9I59kcC3qbzw==", - "dependencies": { - "@floating-ui/dom": "^1.1.0", - "@nextcloud/auth": "^2.0.0", - "@nextcloud/axios": "^2.0.0", - "@nextcloud/browser-storage": "^0.2.0", - "@nextcloud/calendar-js": "^5.0.3", - "@nextcloud/capabilities": "^1.0.4", - "@nextcloud/dialogs": "^4.0.0", - "@nextcloud/event-bus": "^3.0.0", - "@nextcloud/initial-state": "^2.0.0", - "@nextcloud/l10n": "^2.0.1", - "@nextcloud/logger": "^2.2.1", - "@nextcloud/router": "^2.0.0", - "@nextcloud/vue-select": "^3.21.2", - "@skjnldsv/sanitize-svg": "^1.0.2", - "debounce": "1.2.1", - "emoji-mart-vue-fast": "^12.0.1", - "escape-html": "^1.0.3", - "floating-vue": "^1.0.0-beta.19", - "focus-trap": "^7.1.0", - "hammerjs": "^2.0.8", - "linkify-string": "^4.0.0", - "md5": "^2.3.0", - "node-polyfill-webpack-plugin": "^2.0.1", - "splitpanes": "^2.4.1", - "string-length": "^5.0.1", - "striptags": "^3.2.0", - "tributejs": "^5.1.3", - "v-click-outside": "^3.2.0", - "vue": "^2.7.14", - "vue-color": "^2.8.1", - "vue-material-design-icons": "^5.1.2", - "vue-multiselect": "^2.1.6", - "vue2-datepicker": "^3.11.0" - }, - "engines": { - "node": "^16.0.0", - "npm": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext": { - "version": "2.1.0-beta.6", - "resolved": "https://registry.npmjs.org/@nextcloud/vue-richtext/-/vue-richtext-2.1.0-beta.6.tgz", - "integrity": "sha512-LIhBCpFEfimUCHlPuhRADwTDXwOf4SASaQLYowofwvFfqTBjYi/TZdQfP4UBPaVFP2aKssOxuZ3HT83Z77ROAw==", - "dependencies": { - "@nextcloud/axios": "^2.0.0", - "@nextcloud/event-bus": "^3.0.2", - "@nextcloud/initial-state": "^2.0.0", - "@nextcloud/router": "^2.0.0", - "@nextcloud/vue": "^7.5.0", - "clone": "^2.1.2", - "vue": "^2.7.8", - "vue-material-design-icons": "^5.1.2" - }, - "engines": { - "node": ">=14.0.0", - "npm": ">=7.0.0" - }, - "peerDependencies": { - "vue": "^2.7.8" - } - }, "node_modules/@nextcloud/vue-select": { "version": "3.22.2", "resolved": "https://registry.npmjs.org/@nextcloud/vue-select/-/vue-select-3.22.2.tgz", @@ -29342,61 +29275,6 @@ "@types/jquery": "2.0.60" } }, - "@nextcloud/vue": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-7.6.1.tgz", - "integrity": "sha512-MKYn72BUR73iZWAYROGbT3Uf1ihlVBS/XxAqQOQEs9oqF4ULdCY0EA+xR43OzGpDOQdgWeW5wt9I59kcC3qbzw==", - "requires": { - "@floating-ui/dom": "^1.1.0", - "@nextcloud/auth": "^2.0.0", - "@nextcloud/axios": "^2.0.0", - "@nextcloud/browser-storage": "^0.2.0", - "@nextcloud/calendar-js": "^5.0.3", - "@nextcloud/capabilities": "^1.0.4", - "@nextcloud/dialogs": "^4.0.0", - "@nextcloud/event-bus": "^3.0.0", - "@nextcloud/initial-state": "^2.0.0", - "@nextcloud/l10n": "^2.0.1", - "@nextcloud/logger": "^2.2.1", - "@nextcloud/router": "^2.0.0", - "@nextcloud/vue-select": "^3.21.2", - "@skjnldsv/sanitize-svg": "^1.0.2", - "debounce": "1.2.1", - "emoji-mart-vue-fast": "^12.0.1", - "escape-html": "^1.0.3", - "floating-vue": "^1.0.0-beta.19", - "focus-trap": "^7.1.0", - "hammerjs": "^2.0.8", - "linkify-string": "^4.0.0", - "md5": "^2.3.0", - "node-polyfill-webpack-plugin": "^2.0.1", - "splitpanes": "^2.4.1", - "string-length": "^5.0.1", - "striptags": "^3.2.0", - "tributejs": "^5.1.3", - "v-click-outside": "^3.2.0", - "vue": "^2.7.14", - "vue-color": "^2.8.1", - "vue-material-design-icons": "^5.1.2", - "vue-multiselect": "^2.1.6", - "vue2-datepicker": "^3.11.0" - } - }, - "@nextcloud/vue-richtext": { - "version": "2.1.0-beta.6", - "resolved": "https://registry.npmjs.org/@nextcloud/vue-richtext/-/vue-richtext-2.1.0-beta.6.tgz", - "integrity": "sha512-LIhBCpFEfimUCHlPuhRADwTDXwOf4SASaQLYowofwvFfqTBjYi/TZdQfP4UBPaVFP2aKssOxuZ3HT83Z77ROAw==", - "requires": { - "@nextcloud/axios": "^2.0.0", - "@nextcloud/event-bus": "^3.0.2", - "@nextcloud/initial-state": "^2.0.0", - "@nextcloud/router": "^2.0.0", - "@nextcloud/vue": "^7.5.0", - "clone": "^2.1.2", - "vue": "^2.7.8", - "vue-material-design-icons": "^5.1.2" - } - }, "@nextcloud/vue-select": { "version": "3.22.2", "resolved": "https://registry.npmjs.org/@nextcloud/vue-select/-/vue-select-3.22.2.tgz", diff --git a/package.json b/package.json index 4a706383c6..0451dd9236 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "@nextcloud/l10n": "^2.0.1", "@nextcloud/logger": "^2.2.1", "@nextcloud/router": "^2.0.0", - "@nextcloud/vue-richtext": "^2.1.0-beta.6", "@nextcloud/vue-select": "^3.21.2", "@skjnldsv/sanitize-svg": "^1.0.2", "clone": "^2.1.2", diff --git a/src/components/NcRichContenteditable/NcRichContenteditable.vue b/src/components/NcRichContenteditable/NcRichContenteditable.vue index f2eeb3f323..1bb7880e21 100644 --- a/src/components/NcRichContenteditable/NcRichContenteditable.vue +++ b/src/components/NcRichContenteditable/NcRichContenteditable.vue @@ -148,7 +148,7 @@ import NcAutoCompleteResult from './NcAutoCompleteResult.vue' import richEditor from '../../mixins/richEditor/index.js' import Tooltip from '../../directives/Tooltip/index.js' import { emojiSearch, emojiAddRecent } from '../../functions/emoji/index.js' -import { linkProviderSearch, getLink } from '../../functions/linkPicker/index.js' +import { searchProvider, getLinkWithPicker } from '../NcRichText/index.js' import Tribute from 'tributejs/dist/tribute.esm.js' import debounce from 'debounce' @@ -300,7 +300,7 @@ export default { noMatchTemplate: () => t('No link provider found'), selectTemplate: this.getLink, // Pass the search results as values - values: (text, cb) => cb(linkProviderSearch(text)), + values: (text, cb) => cb(searchProvider(text)), // Class added to the menu container containerClass: 'tribute-container-link', // Class added to each list item @@ -423,7 +423,7 @@ export default { getLink(item) { // there is no way to get a tribute result asynchronously // so we immediately insert a node and replace it when the result comes - getLink(item.original.id) + getLinkWithPicker(item.original.id) .then(link => { // replace dummy temp element by a text node which contains the link const tmpElem = document.getElementById('tmp-link-result-node') diff --git a/src/functions/linkPicker/index.js b/src/functions/linkPicker/index.js deleted file mode 100644 index ee01944e98..0000000000 --- a/src/functions/linkPicker/index.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @copyright Copyright (c) 2023 Julien Veyssier - * - * @author Julien Veyssier - * - * @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 . - * - */ - -import { searchProvider, getLinkWithPicker } from '@nextcloud/vue-richtext' - -export const linkProviderSearch = searchProvider - -export const getLink = getLinkWithPicker