@vaadin/rich-text-editor 23.4.0-alpha1 → 23.4.0-alpha3
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.4.0-
|
|
3
|
+
"version": "23.4.0-alpha3",
|
|
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.4.0-
|
|
44
|
-
"@vaadin/component-base": "23.4.0-
|
|
45
|
-
"@vaadin/confirm-dialog": "23.4.0-
|
|
46
|
-
"@vaadin/text-field": "23.4.0-
|
|
47
|
-
"@vaadin/tooltip": "23.4.0-
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "23.4.0-
|
|
49
|
-
"@vaadin/vaadin-material-styles": "23.4.0-
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "23.4.0-
|
|
43
|
+
"@vaadin/button": "23.4.0-alpha3",
|
|
44
|
+
"@vaadin/component-base": "23.4.0-alpha3",
|
|
45
|
+
"@vaadin/confirm-dialog": "23.4.0-alpha3",
|
|
46
|
+
"@vaadin/text-field": "23.4.0-alpha3",
|
|
47
|
+
"@vaadin/tooltip": "23.4.0-alpha3",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "23.4.0-alpha3",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "23.4.0-alpha3",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "23.4.0-alpha3"
|
|
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": "
|
|
65
|
+
"gitHead": "2336e451b1971dfb2dc4b601e11d05cafdb91516"
|
|
66
66
|
}
|
|
@@ -641,6 +641,9 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
641
641
|
});
|
|
642
642
|
|
|
643
643
|
this._editor.on('selection-change', this.__announceFormatting.bind(this));
|
|
644
|
+
|
|
645
|
+
// Flush pending htmlValue only once the editor is fully initialized
|
|
646
|
+
this.__flushPendingHtmlValue();
|
|
644
647
|
}
|
|
645
648
|
|
|
646
649
|
/** @protected */
|
|
@@ -987,10 +990,25 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
987
990
|
* @param {string} htmlValue
|
|
988
991
|
*/
|
|
989
992
|
dangerouslySetHtmlValue(htmlValue) {
|
|
993
|
+
if (!this._editor) {
|
|
994
|
+
// The editor isn't ready yet, store the value for later
|
|
995
|
+
this.__pendingHtmlValue = htmlValue;
|
|
996
|
+
// Clear a possible value to prevent it from clearing the pending htmlValue once the editor property is set
|
|
997
|
+
this.value = '';
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
|
|
990
1001
|
const deltaFromHtml = this._editor.clipboard.convert(htmlValue);
|
|
991
1002
|
this._editor.setContents(deltaFromHtml, SOURCE.API);
|
|
992
1003
|
}
|
|
993
1004
|
|
|
1005
|
+
/** @private */
|
|
1006
|
+
__flushPendingHtmlValue() {
|
|
1007
|
+
if (this.__pendingHtmlValue) {
|
|
1008
|
+
this.dangerouslySetHtmlValue(this.__pendingHtmlValue);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
994
1012
|
/** @private */
|
|
995
1013
|
__announceFormatting() {
|
|
996
1014
|
const timeout = 200;
|
|
@@ -1110,6 +1128,11 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
1110
1128
|
|
|
1111
1129
|
/** @private */
|
|
1112
1130
|
_valueChanged(value, editor) {
|
|
1131
|
+
if (value && this.__pendingHtmlValue) {
|
|
1132
|
+
// A non-empty value is set explicitly. Clear pending htmlValue to prevent it from overriding the value.
|
|
1133
|
+
this.__pendingHtmlValue = undefined;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1113
1136
|
if (editor === undefined) {
|
|
1114
1137
|
return;
|
|
1115
1138
|
}
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED