Skip to content

Commit 54ecb1e

Browse files
committed
MC-3908: Dragging a text content block into the stage causes global styles to be changed and fonts to flash
- Fix slide in animation - Remove content_css within adapter rather than texts implementation
1 parent bd67270 commit 54ecb1e

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/_inline-wysiwyg.less

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
min-height: 20px;
1515
vertical-align: baseline;
1616
}
17-
&.mce-edit-focus {
18-
outline: none;
19-
}
2017
~ .mce-tinymce-inline {
2118
display: block !important;
2219
height: auto !important;
@@ -38,9 +35,11 @@
3835
.mce-abs-layout-item {
3936
position: static;
4037
}
38+
}
39+
&.mce-edit-focus {
40+
outline: none;
4141

42-
// Targeting focused editor (there aren't any classes to hook into for this)
43-
&:not([style*='display: none;']) {
42+
~ .mce-tinymce-inline {
4443
opacity: 1;
4544
pointer-events: all;
4645
transform: translateY(-100%);

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/text/preview.js

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/wysiwyg/tinymce4.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/text/preview.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import $ from "jquery";
77
import events from "Magento_PageBuilder/js/events";
8-
import {Settings} from "tinymce";
8+
import {Editor, Settings} from "tinymce";
99
import Config from "../../config";
1010
import ContentTypeDroppedCreateEventParamsInterface from "../content-type-dropped-create-event-params";
1111
import ContentTypeMountEventParamsInterface from "../content-type-mount-event-params";
@@ -50,15 +50,6 @@ export default class Preview extends BasePreview {
5050
element.id = this.parent.id + "-editor";
5151

5252
const wysiwygConfig = this.config.additional_data.wysiwygConfig.wysiwygConfigData;
53-
54-
/**
55-
* Don't include content_css within the inline mode of TinyMCE, if any stylesheets are included here they're
56-
* appended to the head of the main page, and thus cause other styles to be modified.
57-
*
58-
* The styles for typography in the inline editor are scoped within _typography.less
59-
*/
60-
wysiwygConfig.adapter.tinymce4.content_css = [];
61-
6253
if (this.parent.dropped) {
6354
wysiwygConfig.adapter.settings.auto_focus = element.id;
6455
}

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/wysiwyg/tinymce4.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ export default class Wysiwyg implements WysiwygInterface {
6969
this.config = config;
7070
this.dataStore = dataStore;
7171

72+
if (this.config.adapter_config.mode === "inline") {
73+
/**
74+
* Don't include content_css within the inline mode of TinyMCE, if any stylesheets are included here they're
75+
* appended to the head of the main page, and thus cause other styles to be modified.
76+
*
77+
* The styles for typography in the inline editor are scoped within _typography.less
78+
*/
79+
this.config.adapter.tinymce4.content_css = [];
80+
}
81+
7282
const wysiwygSetup = new WysiwygSetup(this.elementId, this.config.adapter);
7383

7484
wysiwygSetup.setup(this.config.adapter_config.mode);

0 commit comments

Comments
 (0)