@vaadin/rich-text-editor 23.1.0-beta1 → 23.1.0-beta4
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 +10 -9
- package/src/vaadin-rich-text-editor.js +15 -11
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/rich-text-editor",
|
|
3
|
-
"version": "23.1.0-
|
|
3
|
+
"version": "23.1.0-beta4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"description": "vaadin-rich-text-editor",
|
|
8
8
|
"license": "https://raw.githubusercontent.com/vaadin/web-components/master/packages/rich-text-editor/LICENSE",
|
|
9
|
+
"cvdlName": "vaadin-rich-text-editor",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
12
|
"url": "https://github.com/vaadin/web-components.git",
|
|
@@ -38,14 +39,14 @@
|
|
|
38
39
|
],
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/button": "23.1.0-
|
|
42
|
-
"@vaadin/component-base": "23.1.0-
|
|
43
|
-
"@vaadin/confirm-dialog": "23.1.0-
|
|
44
|
-
"@vaadin/text-field": "23.1.0-
|
|
42
|
+
"@vaadin/button": "23.1.0-beta4",
|
|
43
|
+
"@vaadin/component-base": "23.1.0-beta4",
|
|
44
|
+
"@vaadin/confirm-dialog": "23.1.0-beta4",
|
|
45
|
+
"@vaadin/text-field": "23.1.0-beta4",
|
|
45
46
|
"@vaadin/vaadin-license-checker": "^2.1.0",
|
|
46
|
-
"@vaadin/vaadin-lumo-styles": "23.1.0-
|
|
47
|
-
"@vaadin/vaadin-material-styles": "23.1.0-
|
|
48
|
-
"@vaadin/vaadin-themable-mixin": "23.1.0-
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "23.1.0-beta4",
|
|
48
|
+
"@vaadin/vaadin-material-styles": "23.1.0-beta4",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "23.1.0-beta4"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -55,5 +56,5 @@
|
|
|
55
56
|
"gulp-iconfont": "^11.0.0",
|
|
56
57
|
"sinon": "^13.0.2"
|
|
57
58
|
},
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "06e283473964ecb3085aacf3eddb5333d052a045"
|
|
59
60
|
}
|
|
@@ -362,6 +362,10 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
362
362
|
return 'vaadin-rich-text-editor';
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
+
static get cvdlName() {
|
|
366
|
+
return 'vaadin-rich-text-editor';
|
|
367
|
+
}
|
|
368
|
+
|
|
365
369
|
static get properties() {
|
|
366
370
|
return {
|
|
367
371
|
/**
|
|
@@ -595,7 +599,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
595
599
|
});
|
|
596
600
|
|
|
597
601
|
editorContent.addEventListener('focus', () => {
|
|
598
|
-
//
|
|
602
|
+
// Format changed, but no value changed happened
|
|
599
603
|
if (this._toolbarState === STATE.CLICKED) {
|
|
600
604
|
this._cleanToolbarState();
|
|
601
605
|
}
|
|
@@ -613,7 +617,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
613
617
|
const toolbar = {
|
|
614
618
|
container: this.shadowRoot.querySelector('[part="toolbar"]'),
|
|
615
619
|
handlers: {
|
|
616
|
-
clean
|
|
620
|
+
clean() {
|
|
617
621
|
self._markToolbarClicked();
|
|
618
622
|
clean.call(this);
|
|
619
623
|
},
|
|
@@ -662,7 +666,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
662
666
|
}
|
|
663
667
|
});
|
|
664
668
|
|
|
665
|
-
//
|
|
669
|
+
// Mousedown happens before editor focusout
|
|
666
670
|
toolbar.addEventListener('mousedown', (e) => {
|
|
667
671
|
if (buttons.indexOf(e.composedPath()[0]) > -1) {
|
|
668
672
|
this._markToolbarFocused();
|
|
@@ -704,7 +708,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
704
708
|
|
|
705
709
|
/** @private */
|
|
706
710
|
__patchFirefoxFocus() {
|
|
707
|
-
//
|
|
711
|
+
// In Firefox 63+ with native Shadow DOM, when moving focus out of
|
|
708
712
|
// contenteditable and back again within same shadow root, cursor
|
|
709
713
|
// disappears. See https://bugzilla.mozilla.org/show_bug.cgi?id=1496769
|
|
710
714
|
const editorContent = this.shadowRoot.querySelector('.ql-editor');
|
|
@@ -714,7 +718,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
714
718
|
isFake = true;
|
|
715
719
|
this.__fakeTarget = this.__createFakeFocusTarget();
|
|
716
720
|
document.body.appendChild(this.__fakeTarget);
|
|
717
|
-
//
|
|
721
|
+
// Let the focus step out of shadow root!
|
|
718
722
|
this.__fakeTarget.focus();
|
|
719
723
|
return new Promise((resolve) => {
|
|
720
724
|
setTimeout(resolve);
|
|
@@ -753,7 +757,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
753
757
|
const toolbar = this._editor.getModule('toolbar');
|
|
754
758
|
const update = toolbar.update;
|
|
755
759
|
|
|
756
|
-
//
|
|
760
|
+
// Add custom link button to toggle state attribute
|
|
757
761
|
toolbar.controls.push(['link', this.shadowRoot.querySelector('[part~="toolbar-button-link"]')]);
|
|
758
762
|
|
|
759
763
|
toolbar.update = function (range) {
|
|
@@ -780,7 +784,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
780
784
|
const keyboard = this._editor.getModule('keyboard');
|
|
781
785
|
const bindings = keyboard.bindings[TAB_KEY];
|
|
782
786
|
|
|
783
|
-
//
|
|
787
|
+
// Exclude Quill shift-tab bindings, except for code block,
|
|
784
788
|
// as some of those are breaking when on a newline in the list
|
|
785
789
|
// https://github.com/vaadin/vaadin-rich-text-editor/issues/67
|
|
786
790
|
const originalBindings = bindings.filter((b) => !b.shiftKey || (b.format && b.format['code-block']));
|
|
@@ -788,7 +792,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
788
792
|
|
|
789
793
|
keyboard.bindings[TAB_KEY] = [...originalBindings, moveFocusBinding];
|
|
790
794
|
|
|
791
|
-
//
|
|
795
|
+
// Alt-f10 focuses a toolbar button
|
|
792
796
|
keyboard.addBinding({ key: 121, altKey: true, handler: focusToolbar });
|
|
793
797
|
}
|
|
794
798
|
|
|
@@ -814,7 +818,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
814
818
|
const LinkBlot = Quill.imports['formats/link'];
|
|
815
819
|
const [link, offset] = this._editor.scroll.descendant(LinkBlot, range.index);
|
|
816
820
|
if (link != null) {
|
|
817
|
-
//
|
|
821
|
+
// Existing link
|
|
818
822
|
this._linkRange = { index: range.index - offset, length: link.length() };
|
|
819
823
|
this._linkUrl = LinkBlot.formats(link.domNode);
|
|
820
824
|
} else if (range.length === 0) {
|
|
@@ -1081,7 +1085,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
1081
1085
|
return;
|
|
1082
1086
|
}
|
|
1083
1087
|
const delta = new Quill.imports.delta(parsedValue);
|
|
1084
|
-
//
|
|
1088
|
+
// Suppress text-change event to prevent infinite loop
|
|
1085
1089
|
if (JSON.stringify(editor.getContents()) !== JSON.stringify(delta)) {
|
|
1086
1090
|
editor.setContents(delta, SOURCE.SILENT);
|
|
1087
1091
|
}
|
|
@@ -1091,7 +1095,7 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
1091
1095
|
this._cleanToolbarState();
|
|
1092
1096
|
this.__emitChangeEvent();
|
|
1093
1097
|
} else if (!this._editor.hasFocus()) {
|
|
1094
|
-
//
|
|
1098
|
+
// Value changed from outside
|
|
1095
1099
|
this.__lastCommittedChange = this.value;
|
|
1096
1100
|
}
|
|
1097
1101
|
}
|