diff --git a/packages/file-handling/README.md b/packages/file-handling/README.md index 87694b0b44f495ed1f274bbb59e7f57dbfa109c2..30e19ea668de19c90ab6be58cb7d65979c543472 100644 --- a/packages/file-handling/README.md +++ b/packages/file-handling/README.md @@ -95,8 +95,6 @@ files from a [Nextcloud](https://nextcloud.com/) instance or to a dbp-clipboard. This is supported by the provider! Use this object to sync file source and file sink on one page at first time open. - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'my/server/path'}"></dbp-file-source>` - example provider `<dbp-file-source subscribe="initial-file-handling-state"></dbp-file-source>` -- `show-nextcloud-favorites` (optional): Needs to be set to show the favorites icon - - example `show-nextcloud-favorites` ### Emitted attributes @@ -162,9 +160,7 @@ files to a [Nextcloud](https://nextcloud.com/) instance or to a dbp-clipboard. This is supported by the provider! Use this object to sync file source and file sink on one page at first time open. - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'my/server/path'}"></dbp-file-source>` - example provider `<dbp-file-source subscribe="initial-file-handling-state"></dbp-file-source>` -- `show-nextcloud-additional-menu` (optional): Needs to be set to show the additional menu - - example `show-nextcloud-additional-menu` - + ### Emitted attributes The component emits a `dbp-set-property` event for the attribute `initial-file-handling-state`: diff --git a/packages/file-handling/src/nextcloud-file-picker.js b/packages/file-handling/src/nextcloud-file-picker.js index 40afddea1f111129080c687b65c543edeee5cd2c..2143abbbb03df4b0443084878226644c447b6a72 100644 --- a/packages/file-handling/src/nextcloud-file-picker.js +++ b/packages/file-handling/src/nextcloud-file-picker.js @@ -5,8 +5,8 @@ import DBPLitElement from '@dbp-toolkit/common/dbp-lit-element'; import {Icon, MiniSpinner} from '@dbp-toolkit/common'; import * as commonUtils from '@dbp-toolkit/common/utils'; import * as commonStyles from '@dbp-toolkit/common/styles'; +import {createClient, parseXML} from 'webdav/web'; import {classMap} from 'lit/directives/class-map.js'; -import {createClient, parseXML, parseStat} from 'webdav/web'; import {humanFileSize} from '@dbp-toolkit/common/i18next'; import Tabulator from 'tabulator-tables'; import MicroModal from './micromodal.es'; @@ -114,8 +114,6 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { activeDirectoryACL: {type: String, attribute: false}, abortUploadButton: {type: Boolean, attribute: false}, selectBtnDisabled: {type: Boolean, attribute: true}, - showSubmenu: {type: Boolean, attribute: false}, - showAdditionalMenu: { type: Boolean, attribute: 'show-nextcloud-additional-menu' }, userName: { type: Boolean, attribute: false }, storeSession: {type: Boolean, attribute: 'store-nextcloud-session'}, disableRowClick: {type: Boolean, attribute: false }, @@ -2053,7 +2051,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { } #new-folder-row.highlighted { - background: #259207; + background: #259207; color: white; } @@ -2151,6 +2149,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { input[type=text]#tf-new-folder:focus-visible { outline: none; + box-shadow: none; } input[type=text]#tf-new-folder::placeholder { @@ -2184,6 +2183,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { width: 100%; height: 100%; margin-left: -8px; + color: white; } .new-folder-selected::after { @@ -2463,35 +2463,6 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { color: var(--dbp-text-light); } - #submenu { - height: 33px; - width: 33px; - justify-content: center; - display: flex; - align-items: center; - cursor: pointer; - } - - .submenu-icon { - margin-top: -5px; - } - - #submenu-content { - position: absolute; - right: 0px; - top: 33px; - z-index: 1; - } - - #submenu-content button{ - border-radius: 0px; - } - - .menu-buttons { - display: flex; - gap: 1em; - } - .menu-buttons { display: flex; gap: 1em; @@ -2827,42 +2798,13 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ${i18n.t('nextcloud-file-picker.add-folder')} </a> </li> - - <button class="button ${classMap({hidden: this.storeSession})}" - title="${i18n.t('nextcloud-file-picker.add-folder-open')}" - @click="${() => { - this.openAddFolderDialogue(); - }}"> - <dbp-icon name="plus" class="nextcloud-add-folder" id="add-folder-button"></dbp-icon> - </button> <li class="${classMap({hidden: !this.storeSession})}" title="${i18n.t('nextcloud-file-picker.log-out')}"> <a class="" @click="${() => { this.logOut(); this.hideAdditionalMenu(); }}"> ${i18n.t('nextcloud-file-picker.log-out')} </a> </li> - </ul> - -<!-- TODO integrate submenu in additional menu - <div id="submenu" class="${classMap({hidden: !this.storeSession})}" - title="${i18n.t('nextcloud-file-picker.open-submenu')}" - @click="${() => { - this.toggleSubmenu(); - }}"> - <dbp-icon name="menu-dots" class="submenu-icon"></dbp-icon> - <div id="submenu-content" class="${classMap({hidden: !this.showSubmenu})}"> - <button class="button" - title="${i18n.t('nextcloud-file-picker.log-out')}" - @click="${() => { - this.logOut(); - }}"> - ${i18n.t('nextcloud-file-picker.log-out')} - </button> - </div> - </div> ---> - </div> </div> </div> diff --git a/yarn.lock b/yarn.lock index 0bb932efd9e58f1b56b2fe67af5ec20855623cec..398bc045a939e2cdc8d171e3472c370c116647e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -879,7 +879,6 @@ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.5.tgz#7f3e34bf8bdbbadf03fbb7b1ea0d929569c9487a" integrity sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA== dependencies: - core-js-pure "^3.19.0" regenerator-runtime "^0.13.4" "@babel/template@^7.16.0": @@ -2542,10 +2541,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-64@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" - integrity sha1-eAqZyE59YAJgNhURxId2E78k9rs= +base-64@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/base-64/-/base-64-1.0.0.tgz#09d0f2084e32a3fd08c2475b973788eee6ae8f4a" + integrity sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg== base64-arraybuffer@~1.0.1: version "1.0.1" @@ -3972,9 +3971,11 @@ fast-levenshtein@^2.0.6: integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fast-xml-parser@^3.19.0: - version "3.19.0" - resolved "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.19.0.tgz" - integrity sha512-4pXwmBplsCPv8FOY1WRakF970TjNGnGnfbOnLqjlYvMiF1SR3yOHyxMR/YCXpPTOspNF5gwudqktIP4VsWkvBg== + version "3.21.1" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-3.21.1.tgz#152a1d51d445380f7046b304672dd55d15c9e736" + integrity sha512-FTFVjYoBOZTJekiUsawGsSYV9QL0A+zDYCRj7y34IO6Jg+2IMYEtQa+bbictpdpV8dHxXywqU7C0gRDEOFtBFg== + dependencies: + strnum "^1.0.4" fastq@^1.6.0: version "1.13.0" @@ -8420,9 +8421,9 @@ url-join@^4.0.1: integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== url-parse@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b" - integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q== + version "1.5.4" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.4.tgz#e4f645a7e2a0852cc8a66b14b292a3e9a11a97fd" + integrity sha512-ITeAByWWoqutFClc/lRZnFplgXgEZr3WJ6XngMM/N9DMIm4K8zXPCZ1Jdu0rERwO84w1WC5wkle2ubwTA4NTBg== dependencies: querystringify "^2.1.1" requires-port "^1.0.0"