@vaadin/rich-text-editor 24.1.6 → 24.1.8
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/package.json +11 -11
- package/src/vaadin-rich-text-editor.js +27 -12
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/rich-text-editor",
|
|
3
|
-
"version": "24.1.
|
|
3
|
+
"version": "24.1.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@polymer/polymer": "^3.0.0",
|
|
43
|
-
"@vaadin/button": "~24.1.
|
|
44
|
-
"@vaadin/component-base": "~24.1.
|
|
45
|
-
"@vaadin/confirm-dialog": "~24.1.
|
|
46
|
-
"@vaadin/text-field": "~24.1.
|
|
47
|
-
"@vaadin/tooltip": "~24.1.
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "~24.1.
|
|
49
|
-
"@vaadin/vaadin-material-styles": "~24.1.
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "~24.1.
|
|
43
|
+
"@vaadin/button": "~24.1.8",
|
|
44
|
+
"@vaadin/component-base": "~24.1.8",
|
|
45
|
+
"@vaadin/confirm-dialog": "~24.1.8",
|
|
46
|
+
"@vaadin/text-field": "~24.1.8",
|
|
47
|
+
"@vaadin/tooltip": "~24.1.8",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "~24.1.8",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "~24.1.8",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "~24.1.8"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@esm-bundle/chai": "^4.3.4",
|
|
54
|
-
"@vaadin/a11y-base": "~24.1.
|
|
54
|
+
"@vaadin/a11y-base": "~24.1.8",
|
|
55
55
|
"@vaadin/testing-helpers": "^0.4.2",
|
|
56
56
|
"gulp": "^4.0.2",
|
|
57
57
|
"gulp-cli": "^2.3.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"web-types.json",
|
|
64
64
|
"web-types.lit.json"
|
|
65
65
|
],
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "7dd501f5c346495cb34bc34e06e186bbcde2aa49"
|
|
67
67
|
}
|
|
@@ -159,7 +159,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
159
159
|
|
|
160
160
|
<div class="vaadin-rich-text-editor-container">
|
|
161
161
|
<!-- Create toolbar container -->
|
|
162
|
-
<div part="toolbar">
|
|
162
|
+
<div part="toolbar" role="toolbar">
|
|
163
163
|
<span part="toolbar-group toolbar-group-history">
|
|
164
164
|
<!-- Undo and Redo -->
|
|
165
165
|
<button id="btn-undo" type="button" part="toolbar-button toolbar-button-undo" on-click="_undo"></button>
|
|
@@ -533,6 +533,13 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
+
/** @protected */
|
|
537
|
+
disconnectedCallback() {
|
|
538
|
+
super.disconnectedCallback();
|
|
539
|
+
this._editor.emitter.removeAllListeners();
|
|
540
|
+
this._editor.emitter.listeners = {};
|
|
541
|
+
}
|
|
542
|
+
|
|
536
543
|
/** @private */
|
|
537
544
|
__setDirection(dir) {
|
|
538
545
|
// Needed for proper `ql-align` class to be set and activate the toolbar align button
|
|
@@ -554,18 +561,14 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
554
561
|
}
|
|
555
562
|
|
|
556
563
|
/** @protected */
|
|
557
|
-
|
|
558
|
-
super.
|
|
564
|
+
connectedCallback() {
|
|
565
|
+
super.connectedCallback();
|
|
559
566
|
|
|
560
567
|
const editor = this.shadowRoot.querySelector('[part="content"]');
|
|
561
|
-
const toolbarConfig = this._prepareToolbar();
|
|
562
|
-
this._toolbar = toolbarConfig.container;
|
|
563
|
-
|
|
564
|
-
this._addToolbarListeners();
|
|
565
568
|
|
|
566
569
|
this._editor = new Quill(editor, {
|
|
567
570
|
modules: {
|
|
568
|
-
toolbar:
|
|
571
|
+
toolbar: this._toolbarConfig,
|
|
569
572
|
},
|
|
570
573
|
});
|
|
571
574
|
|
|
@@ -577,10 +580,6 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
577
580
|
this.__patchFirefoxFocus();
|
|
578
581
|
}
|
|
579
582
|
|
|
580
|
-
this.$.linkDialog.$.dialog.$.overlay.addEventListener('vaadin-overlay-open', () => {
|
|
581
|
-
this.$.linkUrl.focus();
|
|
582
|
-
});
|
|
583
|
-
|
|
584
583
|
const editorContent = editor.querySelector('.ql-editor');
|
|
585
584
|
|
|
586
585
|
editorContent.setAttribute('role', 'textbox');
|
|
@@ -632,6 +631,20 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
632
631
|
this._editor.on('selection-change', this.__announceFormatting.bind(this));
|
|
633
632
|
}
|
|
634
633
|
|
|
634
|
+
/** @protected */
|
|
635
|
+
ready() {
|
|
636
|
+
super.ready();
|
|
637
|
+
|
|
638
|
+
this._toolbarConfig = this._prepareToolbar();
|
|
639
|
+
this._toolbar = this._toolbarConfig.container;
|
|
640
|
+
|
|
641
|
+
this._addToolbarListeners();
|
|
642
|
+
|
|
643
|
+
this.$.linkDialog.$.dialog.$.overlay.addEventListener('vaadin-overlay-open', () => {
|
|
644
|
+
this.$.linkUrl.focus();
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
|
|
635
648
|
/** @private */
|
|
636
649
|
_prepareToolbar() {
|
|
637
650
|
const clean = Quill.imports['modules/toolbar'].DEFAULTS.handlers.clean;
|
|
@@ -935,6 +948,8 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
935
948
|
|
|
936
949
|
// Remove Quill classes, e.g. ql-syntax, except for align
|
|
937
950
|
content = content.replace(/\s*ql-(?!align)[\w-]*\s*/gu, '');
|
|
951
|
+
// Remove meta spans, e.g. cursor which are empty after Quill classes removed
|
|
952
|
+
content = content.replace(/<\/?span[^>]*>/gu, '');
|
|
938
953
|
|
|
939
954
|
// Replace Quill align classes with inline styles
|
|
940
955
|
[this.__dir === 'rtl' ? 'left' : 'right', 'center', 'justify'].forEach((align) => {
|
package/web-types.json
CHANGED