@vaadin/rich-text-editor 24.4.10 → 24.4.11

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": "24.4.10",
3
+ "version": "24.4.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,19 +41,19 @@
41
41
  "dependencies": {
42
42
  "@open-wc/dedupe-mixin": "^1.3.0",
43
43
  "@polymer/polymer": "^3.0.0",
44
- "@vaadin/button": "~24.4.10",
45
- "@vaadin/component-base": "~24.4.10",
46
- "@vaadin/confirm-dialog": "~24.4.10",
47
- "@vaadin/text-field": "~24.4.10",
48
- "@vaadin/tooltip": "~24.4.10",
49
- "@vaadin/vaadin-lumo-styles": "~24.4.10",
50
- "@vaadin/vaadin-material-styles": "~24.4.10",
51
- "@vaadin/vaadin-themable-mixin": "~24.4.10",
44
+ "@vaadin/button": "~24.4.11",
45
+ "@vaadin/component-base": "~24.4.11",
46
+ "@vaadin/confirm-dialog": "~24.4.11",
47
+ "@vaadin/text-field": "~24.4.11",
48
+ "@vaadin/tooltip": "~24.4.11",
49
+ "@vaadin/vaadin-lumo-styles": "~24.4.11",
50
+ "@vaadin/vaadin-material-styles": "~24.4.11",
51
+ "@vaadin/vaadin-themable-mixin": "~24.4.11",
52
52
  "lit": "^3.0.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@esm-bundle/chai": "^4.3.4",
56
- "@vaadin/a11y-base": "~24.4.10",
56
+ "@vaadin/a11y-base": "~24.4.11",
57
57
  "@vaadin/testing-helpers": "^0.6.0",
58
58
  "gulp": "^4.0.2",
59
59
  "gulp-cli": "^2.3.0",
@@ -65,5 +65,5 @@
65
65
  "web-types.json",
66
66
  "web-types.lit.json"
67
67
  ],
68
- "gitHead": "7958b9490f227e72c5457ed3e6c752c6ab2691a4"
68
+ "gitHead": "1312f60a4bb0b3158428171271fb5c0d88a1b61e"
69
69
  }
@@ -703,10 +703,26 @@ export const RichTextEditorMixin = (superClass) =>
703
703
  */
704
704
  dangerouslySetHtmlValue(htmlValue) {
705
705
  if (!this._editor) {
706
- // The editor isn't ready yet, store the value for later
707
- this.__pendingHtmlValue = htmlValue;
708
- // Clear a possible value to prevent it from clearing the pending htmlValue once the editor property is set
709
- this.value = '';
706
+ this.__savePendingHtmlValue(htmlValue);
707
+
708
+ return;
709
+ }
710
+
711
+ // In Firefox, the styles are not properly computed when the element is placed
712
+ // in a Lit component, as the element is first attached to the DOM and then
713
+ // the shadowRoot is initialized. This causes the `hmlValue` to not be correctly
714
+ // parsed into the delta format used by Quill. To work around this, we check
715
+ // if the display property is set and if not, we wait for the element to intersect
716
+ // with the viewport before trying to set the value again.
717
+ if (!getComputedStyle(this).display) {
718
+ this.__savePendingHtmlValue(htmlValue);
719
+ const observer = new IntersectionObserver(() => {
720
+ if (getComputedStyle(this).display) {
721
+ this.__flushPendingHtmlValue();
722
+ observer.disconnect();
723
+ }
724
+ });
725
+ observer.observe(this);
710
726
  return;
711
727
  }
712
728
 
@@ -733,6 +749,14 @@ export const RichTextEditorMixin = (superClass) =>
733
749
  this._editor.setContents(deltaFromHtml, SOURCE.API);
734
750
  }
735
751
 
752
+ /** @private */
753
+ __savePendingHtmlValue(htmlValue) {
754
+ // The editor isn't ready yet, store the value for later
755
+ this.__pendingHtmlValue = htmlValue;
756
+ // Clear a possible value to prevent it from clearing the pending htmlValue once the editor property is set
757
+ this.value = '';
758
+ }
759
+
736
760
  /** @private */
737
761
  __flushPendingHtmlValue() {
738
762
  if (this.__pendingHtmlValue) {
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": "24.4.10",
4
+ "version": "24.4.11",
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": "24.4.10",
4
+ "version": "24.4.11",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {