From e4319d3f7f4df7256c337d15d37e26ab2eccb1c8 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Mon, 13 Mar 2023 14:50:47 +0100 Subject: [PATCH 01/13] emit an event in RichContentEditable when getting a link to let the upper context prevent text insertion Signed-off-by: Julien Veyssier --- .../NcRichContenteditable.vue | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/components/NcRichContenteditable/NcRichContenteditable.vue b/src/components/NcRichContenteditable/NcRichContenteditable.vue index 66641d4f5f..2892920be4 100644 --- a/src/components/NcRichContenteditable/NcRichContenteditable.vue +++ b/src/components/NcRichContenteditable/NcRichContenteditable.vue @@ -337,6 +337,7 @@ export default { 'submit', 'paste', 'update:value', + 'smart-picker-submit', ], data() { @@ -585,21 +586,30 @@ export default { // there is no way to get a tribute result asynchronously // so we immediately insert a node and replace it when the result comes 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') - const newElem = document.createTextNode(link) - tmpElem.replaceWith(newElem) - this.setCursorAfter(newElem) - this.updateValue(this.$refs.contenteditable.innerHTML) + .then(result => { + // replace dummy temp element by a text node which contains the picker result + const tmpElem = document.getElementById('tmp-smart-picker-result-node') + const eventData = { + result, + insertText: true, + } + this.$emit('smart-picker-submit', eventData) + if (eventData.insertText) { + const newElem = document.createTextNode(result) + tmpElem.replaceWith(newElem) + this.setCursorAfter(newElem) + this.updateValue(this.$refs.contenteditable.innerHTML) + } else { + tmpElem.remove() + } }) .catch((error) => { console.debug('Smart picker promise rejected:', error) - const tmpElem = document.getElementById('tmp-link-result-node') + const tmpElem = document.getElementById('tmp-smart-picker-result-node') this.setCursorAfter(tmpElem) tmpElem.remove() }) - return '' + return '' }, setCursorAfter(element) { const range = document.createRange() From 48b0c373ce64afbf4638bdb9b3c28637b2f52791 Mon Sep 17 00:00:00 2001 From: Jonas Date: Sun, 29 Oct 2023 00:11:08 +0200 Subject: [PATCH 02/13] fix(NcAppContent): Set normal scrollbar width on resizeable NcAppContentList When `NcAppContentList` is resizeable, a thin scrollbar is hard to catch with the mouse. Set scrollbar width to auto in this case. Fixes: #4706 Signed-off-by: Jonas --- src/components/NcAppContent/NcAppContent.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/NcAppContent/NcAppContent.vue b/src/components/NcAppContent/NcAppContent.vue index 725886192f..a232b536b2 100644 --- a/src/components/NcAppContent/NcAppContent.vue +++ b/src/components/NcAppContent/NcAppContent.vue @@ -388,6 +388,8 @@ export default { :deep(.splitpanes.default-theme) { .app-content-list { max-width: none; + /* Thin scrollbar is hard to catch on resizable columns */ + scrollbar-width: auto; } .splitpanes__pane { From 5c82b004520b7cc089544153e8b8864cc6fd1264 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Mon, 30 Oct 2023 16:29:28 -0700 Subject: [PATCH 03/13] fix(NcActions): Detect navigation menu links correctly Signed-off-by: Christopher Ng --- src/components/NcActions/NcActions.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/NcActions/NcActions.vue b/src/components/NcActions/NcActions.vue index d5090c39f5..929d3c4d93 100644 --- a/src/components/NcActions/NcActions.vue +++ b/src/components/NcActions/NcActions.vue @@ -979,9 +979,11 @@ export default { const isNavLink = (action) => { const componentName = action?.componentOptions?.Ctor?.extendOptions?.name ?? action?.componentOptions?.tag + const href = action?.componentOptions?.propsData?.href return ( componentName === 'NcActionLink' - && action?.componentOptions?.propsData?.href?.startsWith(window.location.origin) + && !href?.startsWith('#') + && new URL(href, window.location.origin).origin === window.location.origin ) } // Automatically detect whether all actions are website navigation links From 40dcf81875878881c69778b13c1235006ea66ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Tue, 31 Oct 2023 10:35:33 +0100 Subject: [PATCH 04/13] fix(actions): long text wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- src/assets/action.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/action.scss b/src/assets/action.scss index ef6bb27ccf..ed22e6c4b4 100644 --- a/src/assets/action.scss +++ b/src/assets/action.scss @@ -115,7 +115,7 @@ &__longtext { cursor: pointer; // allow the use of `\n` - white-space: pre-wrap; + white-space: pre-wrap !important; } &__name { From 03cecfbcd7c544e68be8c9b2c182d2cda72e83ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Tue, 31 Oct 2023 10:47:31 +0100 Subject: [PATCH 05/13] feat(NcActionButton): support menu styling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- src/assets/action.scss | 8 ++ .../NcActionButton/NcActionButton.vue | 75 +++++++++++-------- 2 files changed, 51 insertions(+), 32 deletions(-) diff --git a/src/assets/action.scss b/src/assets/action.scss index ed22e6c4b4..67b75a0228 100644 --- a/src/assets/action.scss +++ b/src/assets/action.scss @@ -126,5 +126,13 @@ max-width: 100%; display: inline-block; } + + &__menu-icon { + // Push to the right + margin-left: auto; + // Align with right end of the button + // This is the padding-right + margin-right: -$icon-margin; + } } } diff --git a/src/components/NcActionButton/NcActionButton.vue b/src/components/NcActionButton/NcActionButton.vue index 328ed52ad0..8148669749 100644 --- a/src/components/NcActionButton/NcActionButton.vue +++ b/src/components/NcActionButton/NcActionButton.vue @@ -26,35 +26,32 @@ This component is made to be used inside of the [NcActions](#NcActions) componen ```vue @@ -217,6 +211,9 @@ export default { {{ text }} + + + @@ -224,6 +221,7 @@ export default {