@vaadin/rich-text-editor 24.4.10 → 24.4.12
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-mixin.js +28 -4
- 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.4.
|
|
3
|
+
"version": "24.4.12",
|
|
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.
|
|
45
|
-
"@vaadin/component-base": "~24.4.
|
|
46
|
-
"@vaadin/confirm-dialog": "~24.4.
|
|
47
|
-
"@vaadin/text-field": "~24.4.
|
|
48
|
-
"@vaadin/tooltip": "~24.4.
|
|
49
|
-
"@vaadin/vaadin-lumo-styles": "~24.4.
|
|
50
|
-
"@vaadin/vaadin-material-styles": "~24.4.
|
|
51
|
-
"@vaadin/vaadin-themable-mixin": "~24.4.
|
|
44
|
+
"@vaadin/button": "~24.4.12",
|
|
45
|
+
"@vaadin/component-base": "~24.4.12",
|
|
46
|
+
"@vaadin/confirm-dialog": "~24.4.12",
|
|
47
|
+
"@vaadin/text-field": "~24.4.12",
|
|
48
|
+
"@vaadin/tooltip": "~24.4.12",
|
|
49
|
+
"@vaadin/vaadin-lumo-styles": "~24.4.12",
|
|
50
|
+
"@vaadin/vaadin-material-styles": "~24.4.12",
|
|
51
|
+
"@vaadin/vaadin-themable-mixin": "~24.4.12",
|
|
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.
|
|
56
|
+
"@vaadin/a11y-base": "~24.4.12",
|
|
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": "
|
|
68
|
+
"gitHead": "be0dfd37106dd06e9a55869bd4a3bbdc77c0e277"
|
|
69
69
|
}
|
|
@@ -703,10 +703,26 @@ export const RichTextEditorMixin = (superClass) =>
|
|
|
703
703
|
*/
|
|
704
704
|
dangerouslySetHtmlValue(htmlValue) {
|
|
705
705
|
if (!this._editor) {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
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