matcha-components 20.249.0 → 20.251.0
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.
|
@@ -14790,7 +14790,7 @@ class MatchaTextEditorComponent {
|
|
|
14790
14790
|
const v = value || '';
|
|
14791
14791
|
this._isSettingValue = true;
|
|
14792
14792
|
if (this._editor && this._editorReady) {
|
|
14793
|
-
this.
|
|
14793
|
+
this._setEditorHtml(v);
|
|
14794
14794
|
}
|
|
14795
14795
|
else {
|
|
14796
14796
|
this._pendingValue = v;
|
|
@@ -14810,7 +14810,19 @@ class MatchaTextEditorComponent {
|
|
|
14810
14810
|
isDisabled ? this._editor.toolbar.disable() : this._editor.toolbar.enable();
|
|
14811
14811
|
}
|
|
14812
14812
|
insertHtml(html) {
|
|
14813
|
-
this._editor
|
|
14813
|
+
this._editor?.$.html.insert(html);
|
|
14814
|
+
}
|
|
14815
|
+
_setEditorHtml(value) {
|
|
14816
|
+
try {
|
|
14817
|
+
this._editor.$.html.set(value);
|
|
14818
|
+
}
|
|
14819
|
+
catch {
|
|
14820
|
+
// SunEditor's html.clean() crashes on certain figure structures (v3.1.2 bug).
|
|
14821
|
+
// Fall back to directly setting the wysiwyg innerHTML.
|
|
14822
|
+
const wysiwyg = this._editor.$.frameContext?.get('wysiwyg');
|
|
14823
|
+
if (wysiwyg)
|
|
14824
|
+
wysiwyg.innerHTML = value;
|
|
14825
|
+
}
|
|
14814
14826
|
}
|
|
14815
14827
|
// Private
|
|
14816
14828
|
_injectScript(id, url) {
|
|
@@ -14865,7 +14877,7 @@ class MatchaTextEditorComponent {
|
|
|
14865
14877
|
await this._injectScript('suneditor-lang-ptbr', `${CDN_BASE}/langs/pt-br.js`);
|
|
14866
14878
|
}
|
|
14867
14879
|
_reloadEditor() {
|
|
14868
|
-
const content = this._editor
|
|
14880
|
+
const content = this._editor?.$.html.get() ?? '';
|
|
14869
14881
|
this._editor?.destroy();
|
|
14870
14882
|
this._editor = null;
|
|
14871
14883
|
this._editorReady = false;
|
|
@@ -14917,7 +14929,7 @@ class MatchaTextEditorComponent {
|
|
|
14917
14929
|
this._editorReady = true;
|
|
14918
14930
|
if (this._pendingValue) {
|
|
14919
14931
|
this._isSettingValue = true;
|
|
14920
|
-
this.
|
|
14932
|
+
this._setEditorHtml(this._pendingValue);
|
|
14921
14933
|
this._pendingValue = '';
|
|
14922
14934
|
setTimeout(() => { this._isSettingValue = false; }, 0);
|
|
14923
14935
|
}
|