@vaadin/rich-text-editor 23.3.23 → 23.3.25

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/rich-text-editor",
3
- "version": "23.3.23",
3
+ "version": "23.3.25",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -40,14 +40,14 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@polymer/polymer": "^3.0.0",
43
- "@vaadin/button": "~23.3.23",
44
- "@vaadin/component-base": "~23.3.23",
45
- "@vaadin/confirm-dialog": "~23.3.23",
46
- "@vaadin/text-field": "~23.3.23",
47
- "@vaadin/tooltip": "~23.3.23",
48
- "@vaadin/vaadin-lumo-styles": "~23.3.23",
49
- "@vaadin/vaadin-material-styles": "~23.3.23",
50
- "@vaadin/vaadin-themable-mixin": "~23.3.23"
43
+ "@vaadin/button": "~23.3.25",
44
+ "@vaadin/component-base": "~23.3.25",
45
+ "@vaadin/confirm-dialog": "~23.3.25",
46
+ "@vaadin/text-field": "~23.3.25",
47
+ "@vaadin/tooltip": "~23.3.25",
48
+ "@vaadin/vaadin-lumo-styles": "~23.3.25",
49
+ "@vaadin/vaadin-material-styles": "~23.3.25",
50
+ "@vaadin/vaadin-themable-mixin": "~23.3.25"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@esm-bundle/chai": "^4.3.4",
@@ -62,5 +62,5 @@
62
62
  "web-types.json",
63
63
  "web-types.lit.json"
64
64
  ],
65
- "gitHead": "0027e59e0405f668a089c10e75bb488da9a665b8"
65
+ "gitHead": "61b55b7a7e925aa853530b363bfa3549e44c661c"
66
66
  }
@@ -26,6 +26,39 @@ 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) {
44
+ child.attributes.copy(span);
45
+ }
46
+ if (child.unwrap) {
47
+ child.unwrap();
48
+ }
49
+ });
50
+
51
+ this.remove();
52
+
53
+ return span; // eslint-disable-line no-constructor-return
54
+ }
55
+ }
56
+
57
+ CustomColor.blotName = 'customColor';
58
+ CustomColor.tagName = 'FONT';
59
+
60
+ Quill.register(CustomColor, true);
61
+
29
62
  const HANDLERS = [
30
63
  'bold',
31
64
  'italic',
@@ -529,6 +562,13 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
529
562
  /** @protected */
530
563
  disconnectedCallback() {
531
564
  super.disconnectedCallback();
565
+
566
+ // Ensure that htmlValue property set before attach
567
+ // gets applied in case of detach and re-attach.
568
+ if (this.__debounceSetValue && this.__debounceSetValue.isActive()) {
569
+ this.__debounceSetValue.flush();
570
+ }
571
+
532
572
  this._editor.emitter.removeAllListeners();
533
573
  this._editor.emitter.listeners = {};
534
574
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/rich-text-editor",
4
- "version": "23.3.23",
4
+ "version": "23.3.25",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/rich-text-editor",
4
- "version": "23.3.23",
4
+ "version": "23.3.25",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {