@vaadin/rich-text-editor 24.2.4 → 24.2.6
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 +23 -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.2.
|
|
3
|
+
"version": "24.2.6",
|
|
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.2.
|
|
44
|
-
"@vaadin/component-base": "~24.2.
|
|
45
|
-
"@vaadin/confirm-dialog": "~24.2.
|
|
46
|
-
"@vaadin/text-field": "~24.2.
|
|
47
|
-
"@vaadin/tooltip": "~24.2.
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "~24.2.
|
|
49
|
-
"@vaadin/vaadin-material-styles": "~24.2.
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "~24.2.
|
|
43
|
+
"@vaadin/button": "~24.2.6",
|
|
44
|
+
"@vaadin/component-base": "~24.2.6",
|
|
45
|
+
"@vaadin/confirm-dialog": "~24.2.6",
|
|
46
|
+
"@vaadin/text-field": "~24.2.6",
|
|
47
|
+
"@vaadin/tooltip": "~24.2.6",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "~24.2.6",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "~24.2.6",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "~24.2.6"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@esm-bundle/chai": "^4.3.4",
|
|
54
|
-
"@vaadin/a11y-base": "~24.2.
|
|
54
|
+
"@vaadin/a11y-base": "~24.2.6",
|
|
55
55
|
"@vaadin/testing-helpers": "^0.5.0",
|
|
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": "0d105dd0eff818ab9c82c8443b92a1e15ac0e41a"
|
|
67
67
|
}
|
|
@@ -667,6 +667,9 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
667
667
|
});
|
|
668
668
|
|
|
669
669
|
this._editor.on('selection-change', this.__announceFormatting.bind(this));
|
|
670
|
+
|
|
671
|
+
// Flush pending htmlValue only once the editor is fully initialized
|
|
672
|
+
this.__flushPendingHtmlValue();
|
|
670
673
|
}
|
|
671
674
|
|
|
672
675
|
/** @protected */
|
|
@@ -1013,6 +1016,14 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
1013
1016
|
* @param {string} htmlValue
|
|
1014
1017
|
*/
|
|
1015
1018
|
dangerouslySetHtmlValue(htmlValue) {
|
|
1019
|
+
if (!this._editor) {
|
|
1020
|
+
// The editor isn't ready yet, store the value for later
|
|
1021
|
+
this.__pendingHtmlValue = htmlValue;
|
|
1022
|
+
// Clear a possible value to prevent it from clearing the pending htmlValue once the editor property is set
|
|
1023
|
+
this.value = '';
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1016
1027
|
const whitespaceCharacters = {
|
|
1017
1028
|
'\t': '__VAADIN_RICH_TEXT_EDITOR_TAB',
|
|
1018
1029
|
' ': '__VAADIN_RICH_TEXT_EDITOR_DOUBLE_SPACE',
|
|
@@ -1036,6 +1047,13 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
1036
1047
|
this._editor.setContents(deltaFromHtml, SOURCE.API);
|
|
1037
1048
|
}
|
|
1038
1049
|
|
|
1050
|
+
/** @private */
|
|
1051
|
+
__flushPendingHtmlValue() {
|
|
1052
|
+
if (this.__pendingHtmlValue) {
|
|
1053
|
+
this.dangerouslySetHtmlValue(this.__pendingHtmlValue);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1039
1057
|
/** @private */
|
|
1040
1058
|
__announceFormatting() {
|
|
1041
1059
|
const timeout = 200;
|
|
@@ -1148,6 +1166,11 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
1148
1166
|
|
|
1149
1167
|
/** @private */
|
|
1150
1168
|
_valueChanged(value, editor) {
|
|
1169
|
+
if (value && this.__pendingHtmlValue) {
|
|
1170
|
+
// A non-empty value is set explicitly. Clear pending htmlValue to prevent it from overriding the value.
|
|
1171
|
+
this.__pendingHtmlValue = undefined;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1151
1174
|
if (editor === undefined) {
|
|
1152
1175
|
return;
|
|
1153
1176
|
}
|
package/web-types.json
CHANGED