@vaadin/rich-text-editor 24.3.0-beta1 → 24.3.0-rc1

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.3.0-beta1",
3
+ "version": "24.3.0-rc1",
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-beta1",
45
- "@vaadin/component-base": "24.3.0-beta1",
46
- "@vaadin/confirm-dialog": "24.3.0-beta1",
47
- "@vaadin/text-field": "24.3.0-beta1",
48
- "@vaadin/tooltip": "24.3.0-beta1",
49
- "@vaadin/vaadin-lumo-styles": "24.3.0-beta1",
50
- "@vaadin/vaadin-material-styles": "24.3.0-beta1",
51
- "@vaadin/vaadin-themable-mixin": "24.3.0-beta1"
44
+ "@vaadin/button": "24.3.0-rc1",
45
+ "@vaadin/component-base": "24.3.0-rc1",
46
+ "@vaadin/confirm-dialog": "24.3.0-rc1",
47
+ "@vaadin/text-field": "24.3.0-rc1",
48
+ "@vaadin/tooltip": "24.3.0-rc1",
49
+ "@vaadin/vaadin-lumo-styles": "24.3.0-rc1",
50
+ "@vaadin/vaadin-material-styles": "24.3.0-rc1",
51
+ "@vaadin/vaadin-themable-mixin": "24.3.0-rc1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@esm-bundle/chai": "^4.3.4",
55
- "@vaadin/a11y-base": "24.3.0-beta1",
55
+ "@vaadin/a11y-base": "24.3.0-rc1",
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": "a197041861e1bbf8d3e966d893648f5dd462b036"
67
+ "gitHead": "54430cfc0f52bb6fc17b0fc325b0d62e0e49c700"
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
@@ -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.3.0-beta1",
4
+ "version": "24.3.0-rc1",
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.3.0-beta1",
4
+ "version": "24.3.0-rc1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {