@vaadin/rich-text-editor 24.3.0-beta1 → 24.3.0-beta2
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 +24 -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.3.0-
|
|
3
|
+
"version": "24.3.0-beta2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -41,18 +41,18 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
43
43
|
"@polymer/polymer": "^3.0.0",
|
|
44
|
-
"@vaadin/button": "24.3.0-
|
|
45
|
-
"@vaadin/component-base": "24.3.0-
|
|
46
|
-
"@vaadin/confirm-dialog": "24.3.0-
|
|
47
|
-
"@vaadin/text-field": "24.3.0-
|
|
48
|
-
"@vaadin/tooltip": "24.3.0-
|
|
49
|
-
"@vaadin/vaadin-lumo-styles": "24.3.0-
|
|
50
|
-
"@vaadin/vaadin-material-styles": "24.3.0-
|
|
51
|
-
"@vaadin/vaadin-themable-mixin": "24.3.0-
|
|
44
|
+
"@vaadin/button": "24.3.0-beta2",
|
|
45
|
+
"@vaadin/component-base": "24.3.0-beta2",
|
|
46
|
+
"@vaadin/confirm-dialog": "24.3.0-beta2",
|
|
47
|
+
"@vaadin/text-field": "24.3.0-beta2",
|
|
48
|
+
"@vaadin/tooltip": "24.3.0-beta2",
|
|
49
|
+
"@vaadin/vaadin-lumo-styles": "24.3.0-beta2",
|
|
50
|
+
"@vaadin/vaadin-material-styles": "24.3.0-beta2",
|
|
51
|
+
"@vaadin/vaadin-themable-mixin": "24.3.0-beta2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@esm-bundle/chai": "^4.3.4",
|
|
55
|
-
"@vaadin/a11y-base": "24.3.0-
|
|
55
|
+
"@vaadin/a11y-base": "24.3.0-beta2",
|
|
56
56
|
"@vaadin/testing-helpers": "^0.6.0",
|
|
57
57
|
"gulp": "^4.0.2",
|
|
58
58
|
"gulp-cli": "^2.3.0",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"web-types.json",
|
|
65
65
|
"web-types.lit.json"
|
|
66
66
|
],
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "0bbfb24cb8dcd6e1dca8ecf2269635efac53e4d0"
|
|
68
68
|
}
|
|
@@ -172,6 +172,7 @@ export const RichTextEditorMixin = (superClass) =>
|
|
|
172
172
|
/** @private */
|
|
173
173
|
_editor: {
|
|
174
174
|
type: Object,
|
|
175
|
+
sync: true,
|
|
175
176
|
},
|
|
176
177
|
|
|
177
178
|
/**
|
|
@@ -345,6 +346,9 @@ export const RichTextEditorMixin = (superClass) =>
|
|
|
345
346
|
});
|
|
346
347
|
|
|
347
348
|
this._editor.on('selection-change', this.__announceFormatting.bind(this));
|
|
349
|
+
|
|
350
|
+
// Flush pending htmlValue only once the editor is fully initialized
|
|
351
|
+
this.__flushPendingHtmlValue();
|
|
348
352
|
}
|
|
349
353
|
|
|
350
354
|
/** @protected */
|
|
@@ -691,6 +695,14 @@ export const RichTextEditorMixin = (superClass) =>
|
|
|
691
695
|
* @param {string} htmlValue
|
|
692
696
|
*/
|
|
693
697
|
dangerouslySetHtmlValue(htmlValue) {
|
|
698
|
+
if (!this._editor) {
|
|
699
|
+
// The editor isn't ready yet, store the value for later
|
|
700
|
+
this.__pendingHtmlValue = htmlValue;
|
|
701
|
+
// Clear a possible value to prevent it from clearing the pending htmlValue once the editor property is set
|
|
702
|
+
this.value = '';
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
|
|
694
706
|
const whitespaceCharacters = {
|
|
695
707
|
'\t': '__VAADIN_RICH_TEXT_EDITOR_TAB',
|
|
696
708
|
' ': '__VAADIN_RICH_TEXT_EDITOR_DOUBLE_SPACE',
|
|
@@ -714,6 +726,13 @@ export const RichTextEditorMixin = (superClass) =>
|
|
|
714
726
|
this._editor.setContents(deltaFromHtml, SOURCE.API);
|
|
715
727
|
}
|
|
716
728
|
|
|
729
|
+
/** @private */
|
|
730
|
+
__flushPendingHtmlValue() {
|
|
731
|
+
if (this.__pendingHtmlValue) {
|
|
732
|
+
this.dangerouslySetHtmlValue(this.__pendingHtmlValue);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
717
736
|
/** @private */
|
|
718
737
|
__announceFormatting() {
|
|
719
738
|
const timeout = 200;
|
|
@@ -826,6 +845,11 @@ export const RichTextEditorMixin = (superClass) =>
|
|
|
826
845
|
|
|
827
846
|
/** @private */
|
|
828
847
|
_valueChanged(value, editor) {
|
|
848
|
+
if (value && this.__pendingHtmlValue) {
|
|
849
|
+
// A non-empty value is set explicitly. Clear pending htmlValue to prevent it from overriding the value.
|
|
850
|
+
this.__pendingHtmlValue = undefined;
|
|
851
|
+
}
|
|
852
|
+
|
|
829
853
|
if (editor === undefined) {
|
|
830
854
|
return;
|
|
831
855
|
}
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED