@vaadin/rich-text-editor 24.1.8 → 24.1.10
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 +36 -0
- 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.10",
|
|
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.10",
|
|
44
|
+
"@vaadin/component-base": "~24.1.10",
|
|
45
|
+
"@vaadin/confirm-dialog": "~24.1.10",
|
|
46
|
+
"@vaadin/text-field": "~24.1.10",
|
|
47
|
+
"@vaadin/tooltip": "~24.1.10",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "~24.1.10",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "~24.1.10",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "~24.1.10"
|
|
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.10",
|
|
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": "d0d07a263af46425a3b1db115115782c7835270b"
|
|
67
67
|
}
|
|
@@ -26,6 +26,35 @@ registerStyles('vaadin-rich-text-editor', richTextEditorStyles, { moduleId: 'vaa
|
|
|
26
26
|
|
|
27
27
|
const Quill = window.Quill;
|
|
28
28
|
|
|
29
|
+
// Workaround for text disappearing when accepting spellcheck suggestion
|
|
30
|
+
// See https://github.com/quilljs/quill/issues/2096#issuecomment-399576957
|
|
31
|
+
const Inline = Quill.import('blots/inline');
|
|
32
|
+
|
|
33
|
+
class CustomColor extends Inline {
|
|
34
|
+
constructor(domNode, value) {
|
|
35
|
+
super(domNode, value);
|
|
36
|
+
|
|
37
|
+
// Map <font> properties
|
|
38
|
+
domNode.style.color = domNode.color;
|
|
39
|
+
|
|
40
|
+
const span = this.replaceWith(new Inline(Inline.create()));
|
|
41
|
+
|
|
42
|
+
span.children.forEach((child) => {
|
|
43
|
+
if (child.attributes) child.attributes.copy(span);
|
|
44
|
+
if (child.unwrap) child.unwrap();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
this.remove();
|
|
48
|
+
|
|
49
|
+
return span; // eslint-disable-line no-constructor-return
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
CustomColor.blotName = 'customColor';
|
|
54
|
+
CustomColor.tagName = 'FONT';
|
|
55
|
+
|
|
56
|
+
Quill.register(CustomColor, true);
|
|
57
|
+
|
|
29
58
|
const HANDLERS = [
|
|
30
59
|
'bold',
|
|
31
60
|
'italic',
|
|
@@ -536,6 +565,13 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
536
565
|
/** @protected */
|
|
537
566
|
disconnectedCallback() {
|
|
538
567
|
super.disconnectedCallback();
|
|
568
|
+
|
|
569
|
+
// Ensure that htmlValue property set before attach
|
|
570
|
+
// gets applied in case of detach and re-attach.
|
|
571
|
+
if (this.__debounceSetValue && this.__debounceSetValue.isActive()) {
|
|
572
|
+
this.__debounceSetValue.flush();
|
|
573
|
+
}
|
|
574
|
+
|
|
539
575
|
this._editor.emitter.removeAllListeners();
|
|
540
576
|
this._editor.emitter.listeners = {};
|
|
541
577
|
}
|
package/web-types.json
CHANGED