diff --git a/package-lock.json b/package-lock.json index dabc8baae..a544d4bf0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@nextcloud/capabilities": "^1.1.0", "@nextcloud/event-bus": "^3.1.0", "@nextcloud/l10n": "^2.2.0", - "@nextcloud/vue": "^8.0.0-beta.10", + "@nextcloud/vue": "^8.0.1", "core-js": "^3.33.2", "electron-squirrel-startup": "^1.0.0", "floating-vue": "^1.0.0-beta.19", @@ -4039,9 +4039,9 @@ } }, "node_modules/@nextcloud/vue": { - "version": "8.0.0-beta.10", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.0.0-beta.10.tgz", - "integrity": "sha512-vyNq8dZE3QkIYOyumT+JX6YkAJYZpLcFdpwIiqeteAyELTAWzprFaPRUuC9yLI/b+HHv8IKeWQ/7nQcKWijUyQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.0.1.tgz", + "integrity": "sha512-x2RqRb+/hB94mkZ465zWct0a3A5m5KQniIO4RuwtBssMwlJdyv0MXZF3k7iE3omwChkbgNOkFDiZ/Ch+pfMm1g==", "dependencies": { "@floating-ui/dom": "^1.1.0", "@nextcloud/auth": "^2.0.0", @@ -4082,7 +4082,6 @@ "vue": "^2.7.14", "vue-color": "^2.8.1", "vue-frag": "^1.4.3", - "vue-material-design-icons": "^5.1.2", "vue2-datepicker": "^3.11.0" }, "engines": { @@ -22280,9 +22279,9 @@ } }, "@nextcloud/vue": { - "version": "8.0.0-beta.10", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.0.0-beta.10.tgz", - "integrity": "sha512-vyNq8dZE3QkIYOyumT+JX6YkAJYZpLcFdpwIiqeteAyELTAWzprFaPRUuC9yLI/b+HHv8IKeWQ/7nQcKWijUyQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.0.1.tgz", + "integrity": "sha512-x2RqRb+/hB94mkZ465zWct0a3A5m5KQniIO4RuwtBssMwlJdyv0MXZF3k7iE3omwChkbgNOkFDiZ/Ch+pfMm1g==", "requires": { "@floating-ui/dom": "^1.1.0", "@nextcloud/auth": "^2.0.0", @@ -22323,7 +22322,6 @@ "vue": "^2.7.14", "vue-color": "^2.8.1", "vue-frag": "^1.4.3", - "vue-material-design-icons": "^5.1.2", "vue2-datepicker": "^3.11.0" }, "dependencies": { diff --git a/package.json b/package.json index 3958c3d4d..07073d903 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@nextcloud/capabilities": "^1.1.0", "@nextcloud/event-bus": "^3.1.0", "@nextcloud/l10n": "^2.2.0", - "@nextcloud/vue": "^8.0.0-beta.10", + "@nextcloud/vue": "^8.0.1", "core-js": "^3.33.2", "electron-squirrel-startup": "^1.0.0", "floating-vue": "^1.0.0-beta.19", diff --git a/src/patchers/OC/OcDialogsAdapter.vue b/src/patchers/OC/OcDialogsAdapter.vue new file mode 100644 index 000000000..d14602839 --- /dev/null +++ b/src/patchers/OC/OcDialogsAdapter.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/src/patchers/OC/dialogs.js b/src/patchers/OC/dialogs.js new file mode 100644 index 000000000..4114fb1e7 --- /dev/null +++ b/src/patchers/OC/dialogs.js @@ -0,0 +1,40 @@ +/* + * @copyright Copyright (c) 2023 Grigorii Shartsev + * + * @author Grigorii Shartsev + * + * @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 Vue from 'vue' + +let ocDialogsAdapter = null + +document.addEventListener('DOMContentLoaded', async () => { + const { default: OcDialogsAdapter } = await import('./OcDialogsAdapter.vue') + + const container = document.body.appendChild(document.createElement('oc-dialog-wrapper')) + + ocDialogsAdapter = new Vue(OcDialogsAdapter).$mount(container) +}) + +export const dialogs = { + YES_NO_BUTTONS: 70, + OK_BUTTONS: 71, + alert: (...args) => ocDialogsAdapter.alert(...args), + confirm: (...args) => ocDialogsAdapter.confirm(...args), + confirmDestructive: (...args) => ocDialogsAdapter.confirmDestructive(...args), +} diff --git a/src/patchers/globals.js b/src/patchers/globals.js index cde65f216..66f949aa2 100644 --- a/src/patchers/globals.js +++ b/src/patchers/globals.js @@ -21,6 +21,7 @@ import { loadState } from '@nextcloud/initial-state' import { appData } from '../app/AppData.js' +import { dialogs } from './OC/dialogs.js' export const OC = { // Constant from: https://github.com/nextcloud/server/blob/master/core/src/OC/constants.js @@ -53,17 +54,7 @@ export const OC = { modRewriteWorking: false, }, - dialogs: { - confirm(text, title, callback) { - callback(confirm(text)) - }, - confirmDestructive(text, title, options, callback) { - callback(confirm(text)) - }, - filepicker() { - alert('Unfortunately, Share from Nextcloud is not supported by Nextcloud Talk Preview') - }, - }, + dialogs, theme: { get productName() {