@madgex/design-system-ce 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +9 -2
- package/CHANGELOG.md +27 -0
- package/components/text-editor/TextEditor.ce.vue +16 -13
- package/components/text-editor/TextEditorContent.vue +8 -1
- package/components/text-editor/TextEditorPopover.vue +113 -0
- package/components/text-editor/TextEditorPopoverLink.vue +100 -0
- package/components/text-editor/TextEditorToolbar.vue +37 -8
- package/components/text-editor/apply-missing-protocol.js +7 -0
- package/dist/custom-elements/mds-text-editor.js +19 -17
- package/index-dev.js +2 -0
- package/package.json +6 -4
package/.eslintrc.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
extends: ['plugin:vue/essential', '@vue/prettier'],
|
|
3
|
-
rules: {},
|
|
4
2
|
env: {
|
|
5
3
|
browser: true,
|
|
6
4
|
},
|
|
5
|
+
extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', 'prettier'],
|
|
6
|
+
rules: {
|
|
7
|
+
'vue/no-v-html': 0,
|
|
8
|
+
'no-debugger': 0,
|
|
9
|
+
'vue/singleline-html-element-content-newline': 'off',
|
|
10
|
+
'vue/multiline-html-element-content-newline': 'off',
|
|
11
|
+
'vue/html-indent': 'off',
|
|
12
|
+
'vue/html-self-closing': ['error', { html: { void: 'any' } }],
|
|
13
|
+
},
|
|
7
14
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.3.0](https://github.com/projects/MDS/repos/mds-branding/compare/diff?targetBranch=refs/tags/@madgex/design-system-ce@5.2.0&sourceBranch=refs/tags/@madgex/design-system-ce@5.3.0) (2022-11-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add link for text editor ([288ad29](https://github.com/projects/MDS/repos/mds-branding/commits/288ad2988076cebddeebab420e3e5438a5d2f818))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* automatically apply protocol to textEditor link ([fee5fc7](https://github.com/projects/MDS/repos/mds-branding/commits/fee5fc760d7fc3e01f3bff56022b5fd942cb6d44))
|
|
17
|
+
* remove link editor popover/button ([db6c5f8](https://github.com/projects/MDS/repos/mds-branding/commits/db6c5f8bb64d2a2d44a5ce13b7f4d943664a7aad))
|
|
18
|
+
* remove link editor popover/button ([0b263f8](https://github.com/projects/MDS/repos/mds-branding/commits/0b263f824e7deebd74655aa990e5c1c9e771b831))
|
|
19
|
+
* remove unused code ([b29e960](https://github.com/projects/MDS/repos/mds-branding/commits/b29e96030d7f53242d65335022a2b0af49fff733))
|
|
20
|
+
* texteditor anchor validation ([5e40b46](https://github.com/projects/MDS/repos/mds-branding/commits/5e40b462974a26473d36c2b033de4d1eb606c368))
|
|
21
|
+
* texteditor applyMissingProtocol mailto ([af94428](https://github.com/projects/MDS/repos/mds-branding/commits/af944282bc8f2aa239031a09310112cf0d153924))
|
|
22
|
+
* textEditor link enabled if valid selection ([654dc8d](https://github.com/projects/MDS/repos/mds-branding/commits/654dc8d61d1846e684d3c3cd3b88b84d011cbc87))
|
|
23
|
+
* textEditor link popover spacing ([2236c64](https://github.com/projects/MDS/repos/mds-branding/commits/2236c6442261f05dee13ab82319bc503d9262832))
|
|
24
|
+
* textEditor links always underline ([d7851e3](https://github.com/projects/MDS/repos/mds-branding/commits/d7851e355b1e8dcbbf4c75c6ad8eac8b6c60ed44))
|
|
25
|
+
* textEditor linkUrl i18n, for/id couple ([2cdad01](https://github.com/projects/MDS/repos/mds-branding/commits/2cdad0129cbc5354441ebf1830a7324559386533))
|
|
26
|
+
* textEditor remove auto-focus on open link editor ([1c42419](https://github.com/projects/MDS/repos/mds-branding/commits/1c42419ced20efe5bb0cb1e80221eab509b29645))
|
|
27
|
+
* textEditori18n ([6bf5d03](https://github.com/projects/MDS/repos/mds-branding/commits/6bf5d0352ce1ec77908c03a9e597d8ddbc7f3ba9))
|
|
28
|
+
* textEdtorPopover ([13c39be](https://github.com/projects/MDS/repos/mds-branding/commits/13c39bee9c0d676fa87bf815c64873b92ba9ee7e))
|
|
29
|
+
* tweak text editor link ([32e3992](https://github.com/projects/MDS/repos/mds-branding/commits/32e399236782169c3075a4a2ebc853c6a690f966))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [5.2.0](https://github.com/projects/MDS/repos/mds-branding/compare/diff?targetBranch=refs/tags/@madgex/design-system-ce@5.1.2&sourceBranch=refs/tags/@madgex/design-system-ce@5.2.0) (2022-08-18)
|
|
7
34
|
|
|
8
35
|
|
|
@@ -13,6 +13,14 @@ export default {
|
|
|
13
13
|
components: {
|
|
14
14
|
TextEditorContent,
|
|
15
15
|
},
|
|
16
|
+
provide() {
|
|
17
|
+
return {
|
|
18
|
+
iconPath: this.iconpath,
|
|
19
|
+
id: this.editorid,
|
|
20
|
+
customMenuButtons: this.customMenuButtons,
|
|
21
|
+
i18nText: this.i18nText,
|
|
22
|
+
};
|
|
23
|
+
},
|
|
16
24
|
props: {
|
|
17
25
|
editorid: {
|
|
18
26
|
type: String,
|
|
@@ -45,21 +53,16 @@ export default {
|
|
|
45
53
|
return this.menuButtons ? JSON.parse(this.menuButtons) : null;
|
|
46
54
|
},
|
|
47
55
|
i18nText() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
:
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
const parsedI18n = this.i18n ? JSON.parse(this.i18n) : {};
|
|
57
|
+
return {
|
|
58
|
+
toolbarLabel: 'Text formatting',
|
|
59
|
+
addLink: 'Add link',
|
|
60
|
+
removeLink: 'Remove link',
|
|
61
|
+
visuallyHiddenLinkUrlLabel: 'Link url',
|
|
62
|
+
...parsedI18n,
|
|
63
|
+
};
|
|
53
64
|
},
|
|
54
65
|
},
|
|
55
|
-
provide() {
|
|
56
|
-
return {
|
|
57
|
-
iconPath: this.iconpath,
|
|
58
|
-
id: this.editorid,
|
|
59
|
-
customMenuButtons: this.customMenuButtons,
|
|
60
|
-
i18nText: this.i18nText,
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
66
|
mounted() {
|
|
64
67
|
const fallback = document.querySelector(`#text-editor-fallback-${this.editorid}`);
|
|
65
68
|
if (fallback) fallback.remove();
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
<script>
|
|
9
9
|
import StarterKit from '@tiptap/starter-kit';
|
|
10
10
|
import { Editor, EditorContent } from '@tiptap/vue-3';
|
|
11
|
+
import Link from '@tiptap/extension-link';
|
|
11
12
|
import TextEditorToolbar from './TextEditorToolbar.vue';
|
|
12
13
|
|
|
13
14
|
export default {
|
|
@@ -46,7 +47,13 @@ export default {
|
|
|
46
47
|
|
|
47
48
|
mounted() {
|
|
48
49
|
this.editor = new Editor({
|
|
49
|
-
extensions: [
|
|
50
|
+
extensions: [
|
|
51
|
+
StarterKit,
|
|
52
|
+
Link.configure({
|
|
53
|
+
protocols: ['http', 'https', 'mailto'], // automatically create links of text with these protocols
|
|
54
|
+
openOnClick: false,
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
50
57
|
editorProps: {
|
|
51
58
|
attributes: {
|
|
52
59
|
class: 'mds-text-editor__content mds-edited-text',
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="popperRef" class="mds-popover" :class="{ 'mds-popover--active': visible }" :aria-hidden="!visible">
|
|
3
|
+
<div class="mds-popover__arrow" data-popper-arrow />
|
|
4
|
+
<div class="mds-tooltip__inner">
|
|
5
|
+
<slot />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
|
12
|
+
import { createPopper } from '@popperjs/core';
|
|
13
|
+
import { isNodeSelection, posToDOMRect } from '@tiptap/core';
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line no-undef
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
editor: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
id: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
visible: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line no-undef
|
|
32
|
+
const emit = defineEmits(['update:visible']);
|
|
33
|
+
|
|
34
|
+
const popperRef = ref(null);
|
|
35
|
+
const instance = ref(undefined);
|
|
36
|
+
|
|
37
|
+
const baseSize = 4;
|
|
38
|
+
|
|
39
|
+
const destroy = () => {
|
|
40
|
+
instance.value?.destroy();
|
|
41
|
+
instance.value = undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const virtualElement = {
|
|
45
|
+
getBoundingClientRect: () => {
|
|
46
|
+
const { view, state } = props.editor;
|
|
47
|
+
const { ranges } = state.selection;
|
|
48
|
+
const from = Math.min(...ranges.map((range) => range.$from.pos));
|
|
49
|
+
const to = Math.max(...ranges.map((range) => range.$to.pos));
|
|
50
|
+
if (isNodeSelection(state.selection)) {
|
|
51
|
+
const node = view.nodeDOM(from);
|
|
52
|
+
if (node) return node.getBoundingClientRect();
|
|
53
|
+
}
|
|
54
|
+
return posToDOMRect(view, from, to);
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const initPopper = () => {
|
|
59
|
+
if (instance.value) destroy();
|
|
60
|
+
if (!popperRef.value) return;
|
|
61
|
+
instance.value = createPopper(virtualElement, popperRef.value, {
|
|
62
|
+
placement: 'bottom',
|
|
63
|
+
strategy: 'fixed',
|
|
64
|
+
modifiers: [
|
|
65
|
+
{ name: 'offset', options: { offset: [0, baseSize * 3] } },
|
|
66
|
+
// arrow will always be at least 5px away from the edge
|
|
67
|
+
{ name: 'arrow', options: { padding: 5 } },
|
|
68
|
+
],
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const hideMouseDown = (event) => {
|
|
73
|
+
if (!popperRef.value?.contains(event.target) && props.visible) {
|
|
74
|
+
console.log('visiblevisible');
|
|
75
|
+
|
|
76
|
+
emit('update:visible', false);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const hideKeyDown = (event) => {
|
|
80
|
+
if (event.keyCode === 27) {
|
|
81
|
+
emit('update:visible', false);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const updateInstance = () => instance.value?.update();
|
|
86
|
+
const onEditorFocus = () => {
|
|
87
|
+
emit('update:visible', false);
|
|
88
|
+
};
|
|
89
|
+
watch(
|
|
90
|
+
() => props.visible,
|
|
91
|
+
(val) => {
|
|
92
|
+
if (val) {
|
|
93
|
+
updateInstance();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
onMounted(() => {
|
|
99
|
+
initPopper();
|
|
100
|
+
props.editor.on('focus', onEditorFocus);
|
|
101
|
+
props.editor.on('blur', updateInstance);
|
|
102
|
+
document.addEventListener('mousedown', hideMouseDown);
|
|
103
|
+
document.addEventListener('keydown', hideKeyDown);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
onUnmounted(() => {
|
|
107
|
+
props.editor.off('focus', onEditorFocus);
|
|
108
|
+
props.editor.off('blur', updateInstance);
|
|
109
|
+
document.removeEventListener('mousedown', hideMouseDown);
|
|
110
|
+
document.removeEventListener('keydown', hideKeyDown);
|
|
111
|
+
destroy();
|
|
112
|
+
});
|
|
113
|
+
</script>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TextEditorPopover id="link-editor" v-model:visible="visibleModel" :editor="editor">
|
|
3
|
+
<div class="mds-grid">
|
|
4
|
+
<div class="mds-grid-row">
|
|
5
|
+
<span class="mds-grid-col mds-grid-fit-content">
|
|
6
|
+
<label class="mds-visually-hidden" for="link-url">{{ i18nText.visuallyHiddenLinkUrlLabel }}</label>
|
|
7
|
+
<input
|
|
8
|
+
id="link-url"
|
|
9
|
+
ref="linkInput"
|
|
10
|
+
v-model="linkUrlModel"
|
|
11
|
+
class="mds-form-control"
|
|
12
|
+
placeholder="example.com"
|
|
13
|
+
/>
|
|
14
|
+
</span>
|
|
15
|
+
<span class="mds-grid-col">
|
|
16
|
+
<button class="mds-button mds-width-full" @click="setLink">{{ i18nText.addLink }}</button>
|
|
17
|
+
<button class="mds-button mds-button--plain mds-width-full" @click="removeLink">
|
|
18
|
+
{{ i18nText.removeLink }}
|
|
19
|
+
</button>
|
|
20
|
+
</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</TextEditorPopover>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup>
|
|
27
|
+
import { computed, inject } from 'vue';
|
|
28
|
+
import TextEditorPopover from './TextEditorPopover.vue';
|
|
29
|
+
import { applyMissingProtocol } from './apply-missing-protocol';
|
|
30
|
+
import { nextTick } from 'process';
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line no-undef
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
visible: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
linkUrl: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '',
|
|
41
|
+
},
|
|
42
|
+
editor: {
|
|
43
|
+
type: Object,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
// eslint-disable-next-line no-undef
|
|
48
|
+
const emit = defineEmits(['update:visible', 'update:linkUrl']);
|
|
49
|
+
|
|
50
|
+
const i18nText = inject('i18nText');
|
|
51
|
+
|
|
52
|
+
const visibleModel = computed({
|
|
53
|
+
get() {
|
|
54
|
+
return props.visible;
|
|
55
|
+
},
|
|
56
|
+
set(val) {
|
|
57
|
+
emit('update:visible', val);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const linkUrlModel = computed({
|
|
61
|
+
get() {
|
|
62
|
+
return props.linkUrl;
|
|
63
|
+
},
|
|
64
|
+
set(val) {
|
|
65
|
+
emit('update:linkUrl', val);
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const setLink = () => {
|
|
70
|
+
// cancelled
|
|
71
|
+
if (linkUrlModel.value === null) {
|
|
72
|
+
visibleModel.value = false;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// unset link if empty
|
|
77
|
+
if (linkUrlModel.value?.trim() === '') {
|
|
78
|
+
props.editor.chain().focus().extendMarkRange('link').unsetLink().run();
|
|
79
|
+
visibleModel.value = false;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
linkUrlModel.value = applyMissingProtocol(linkUrlModel.value);
|
|
83
|
+
|
|
84
|
+
// update link
|
|
85
|
+
nextTick(() => {
|
|
86
|
+
props.editor
|
|
87
|
+
.chain()
|
|
88
|
+
.focus()
|
|
89
|
+
.extendMarkRange('link')
|
|
90
|
+
.setLink({ href: linkUrlModel.value })
|
|
91
|
+
.setTextSelection(0)
|
|
92
|
+
.run();
|
|
93
|
+
visibleModel.value = false;
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const removeLink = () => {
|
|
97
|
+
props.editor.chain().focus().extendMarkRange('link').unsetLink().run();
|
|
98
|
+
linkUrlModel.value = false;
|
|
99
|
+
};
|
|
100
|
+
</script>
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="mds-text-editor__menu" role="toolbar" :aria-label="i18nText.toolbarLabel" :aria-controls="id">
|
|
3
3
|
<TextEditorButton
|
|
4
|
-
ref="menuButton"
|
|
5
4
|
v-for="button in menuButtons"
|
|
6
|
-
:key="button.id"
|
|
7
5
|
:id="button.id"
|
|
6
|
+
ref="menuButton"
|
|
7
|
+
:key="button.id"
|
|
8
8
|
:label="button.label"
|
|
9
9
|
:icon-name="button.iconName"
|
|
10
|
-
:
|
|
10
|
+
:is-active="button.isActive?.(editor)"
|
|
11
11
|
:disabled="button.isDisabled?.(editor)"
|
|
12
|
-
:
|
|
12
|
+
:initial-tabindex="firstFocusableButton.id === button.id ? 0 : -1"
|
|
13
13
|
:aria-pressed="button.id === 'undo' || button.id === 'redo' ? null : button.isActive?.(editor)"
|
|
14
|
+
:aria-expanded="button.ariaExpanded?.()"
|
|
14
15
|
@click="button.onClick(editor)"
|
|
15
16
|
@keyup.left="setFocusToSibling('previous', $event)"
|
|
16
17
|
@keyup.up="setFocusToSibling('previous', $event)"
|
|
@@ -18,19 +19,24 @@
|
|
|
18
19
|
@keyup.down="setFocusToSibling('next', $event)"
|
|
19
20
|
@update-tab-index="updateTabIndex"
|
|
20
21
|
/>
|
|
22
|
+
<!-- <TextEditorPopoverLink v-if="editor" v-model:linkUrl="linkUrl" v-model:visible="showLinkEditor" :editor="editor" /> -->
|
|
21
23
|
</div>
|
|
22
24
|
</template>
|
|
23
25
|
|
|
24
26
|
<script>
|
|
25
27
|
import TextEditorButton from './TextEditorButton.vue';
|
|
28
|
+
// import TextEditorPopoverLink from './TextEditorPopoverLink.vue';
|
|
26
29
|
|
|
27
30
|
export default {
|
|
28
31
|
name: 'TextEditorToolbar',
|
|
29
32
|
|
|
30
33
|
components: {
|
|
31
34
|
TextEditorButton,
|
|
35
|
+
// TextEditorPopoverLink,
|
|
32
36
|
},
|
|
33
37
|
|
|
38
|
+
inject: ['id', 'customMenuButtons', 'i18nText'],
|
|
39
|
+
|
|
34
40
|
props: {
|
|
35
41
|
editor: {
|
|
36
42
|
type: Object,
|
|
@@ -38,8 +44,6 @@ export default {
|
|
|
38
44
|
},
|
|
39
45
|
},
|
|
40
46
|
|
|
41
|
-
inject: ['id', 'customMenuButtons', 'i18nText'],
|
|
42
|
-
|
|
43
47
|
data() {
|
|
44
48
|
return {
|
|
45
49
|
defaultMenuButtons: [
|
|
@@ -78,6 +82,25 @@ export default {
|
|
|
78
82
|
onClick: (editor) => editor.commands.toggleOrderedList(),
|
|
79
83
|
isActive: (editor) => editor.isActive('orderedList'),
|
|
80
84
|
},
|
|
85
|
+
/* {
|
|
86
|
+
id: 'link',
|
|
87
|
+
label: 'Link',
|
|
88
|
+
iconName: 'text-link',
|
|
89
|
+
ariaExpanded: () => this.showLinkEditor,
|
|
90
|
+
onClick: (editor) => {
|
|
91
|
+
if (this.shouldShowLinkEditor()) {
|
|
92
|
+
// only show the bubble menu for links
|
|
93
|
+
this.showLinkEditor = true;
|
|
94
|
+
// update link in text input if we should show it
|
|
95
|
+
const previousUrl = editor.getAttributes('link').href;
|
|
96
|
+
this.linkUrl = previousUrl ?? '';
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
isActive: (editor) => editor.isActive('link'),
|
|
100
|
+
isDisabled: () => {
|
|
101
|
+
return !this.shouldShowLinkEditor();
|
|
102
|
+
},
|
|
103
|
+
}, */
|
|
81
104
|
{
|
|
82
105
|
id: 'undo',
|
|
83
106
|
label: 'Undo',
|
|
@@ -93,9 +116,10 @@ export default {
|
|
|
93
116
|
isDisabled: (editor) => !editor.can().redo(),
|
|
94
117
|
},
|
|
95
118
|
],
|
|
119
|
+
// showLinkEditor: false,
|
|
120
|
+
// linkUrl: '',
|
|
96
121
|
};
|
|
97
122
|
},
|
|
98
|
-
|
|
99
123
|
computed: {
|
|
100
124
|
menuButtons() {
|
|
101
125
|
if (this.customMenuButtons?.length) {
|
|
@@ -115,7 +139,6 @@ export default {
|
|
|
115
139
|
return this.menuButtons.find((button) => !button.isDisabled?.(this.editor));
|
|
116
140
|
},
|
|
117
141
|
},
|
|
118
|
-
|
|
119
142
|
methods: {
|
|
120
143
|
findSiblings(currentElement, position) {
|
|
121
144
|
let sibling = position === 'previous' ? currentElement.previousElementSibling : currentElement.nextElementSibling;
|
|
@@ -144,6 +167,12 @@ export default {
|
|
|
144
167
|
}
|
|
145
168
|
});
|
|
146
169
|
},
|
|
170
|
+
/* shouldShowLinkEditor() {
|
|
171
|
+
// no selection, so cant open link editor
|
|
172
|
+
const hasSelection = this.editor.state.selection.$from.pos !== this.editor.state.selection.$to.pos;
|
|
173
|
+
const cursorIsAtLink = this.editor.isActive('link');
|
|
174
|
+
return hasSelection || cursorIsAtLink;
|
|
175
|
+
}, */
|
|
147
176
|
},
|
|
148
177
|
};
|
|
149
178
|
</script>
|