diff --git a/packages/ckeditor5-html-embed/src/htmlembedediting.js b/packages/ckeditor5-html-embed/src/htmlembedediting.js index 11c9ebb9ea4..3833e2474a0 100644 --- a/packages/ckeditor5-html-embed/src/htmlembedediting.js +++ b/packages/ckeditor5-html-embed/src/htmlembedediting.js @@ -20,7 +20,7 @@ import eyeIcon from '../theme/icons/eye.svg'; import '../theme/htmlembed.css'; -const DISPLAY_PREVIEW_CLASS = 'raw-html--display-preview'; +const DISPLAY_PREVIEW_CLASS = 'raw-html_preview_visible'; /** * The HTML embed editing feature. @@ -160,7 +160,7 @@ export default class HtmlEmbedEditing extends Plugin { } ); const buttonAttributes = { - class: 'ck ck-button ck-on raw-html__switch-mode' + class: 'ck ck-button ck-on raw-html__mode-toggle-button' }; // The switch button between preview and editing HTML. @@ -201,7 +201,7 @@ export default class HtmlEmbedEditing extends Plugin { // The container that renders the HTML should be created only when `htmlEmbed.showPreviews=true` in the config. if ( htmlEmbedConfig.showPreviews ) { - writer.addClass( [ 'raw-html--preview-enabled', DISPLAY_PREVIEW_CLASS ], widgetView ); + writer.addClass( [ 'raw-html_preview_enabled', DISPLAY_PREVIEW_CLASS ], widgetView ); const previewContainer = writer.createRawElement( 'div', { class: 'raw-html__preview' }, function( domElement ) { writer.setCustomProperty( 'domElement', domElement, previewContainer ); diff --git a/packages/ckeditor5-html-embed/tests/htmlembedediting.js b/packages/ckeditor5-html-embed/tests/htmlembedediting.js index 62995c059bb..b2068b0345d 100644 --- a/packages/ckeditor5-html-embed/tests/htmlembedediting.js +++ b/packages/ckeditor5-html-embed/tests/htmlembedediting.js @@ -247,7 +247,7 @@ describe( 'HtmlEmbedEditing', () => { const widget = viewDocument.getRoot().getChild( 0 ); - expect( widget.hasClass( 'raw-html--preview-enabled' ) ).to.equal( false ); + expect( widget.hasClass( 'raw-html_preview_enabled' ) ).to.equal( false ); } ); it( 'should render the toggle button and edit source elements', () => { @@ -474,7 +474,7 @@ describe( 'HtmlEmbedEditing', () => { const widget = viewDocument.getRoot().getChild( 0 ); - expect( widget.hasClass( 'raw-html--preview-enabled' ) ).to.equal( true ); + expect( widget.hasClass( 'raw-html_preview_enabled' ) ).to.equal( true ); } ); it( 'should render the toggle button, edit source and preview container elements', () => { @@ -526,7 +526,7 @@ describe( 'HtmlEmbedEditing', () => { const widget = viewDocument.getRoot().getChild( 0 ); - expect( widget.hasClass( 'raw-html--display-preview' ) ).to.equal( true ); + expect( widget.hasClass( 'raw-html_preview_visible' ) ).to.equal( true ); const viewHtmlContainer = widget.getChild( 0 ); const sourceElement = viewHtmlContainer.getChild( 1 ); @@ -603,7 +603,7 @@ describe( 'HtmlEmbedEditing', () => { expect( sourceElement.getCustomProperty( 'domElement' ).disabled ).to.equal( false ); - expect( widget.hasClass( 'raw-html--display-preview' ) ).to.equal( false ); + expect( widget.hasClass( 'raw-html_preview_visible' ) ).to.equal( false ); } ); it( 'should display preview element after clicking the toggle button when displaying edit source mode', () => { @@ -620,7 +620,7 @@ describe( 'HtmlEmbedEditing', () => { // Switch to preview mode. toggleButton.click(); - expect( widget.hasClass( 'raw-html--display-preview' ) ).to.equal( true ); + expect( widget.hasClass( 'raw-html_preview_visible' ) ).to.equal( true ); expect( viewHtmlContainer.getChild( 1 ).getCustomProperty( 'domElement' ).disabled ).to.equal( true ); } ); } ); diff --git a/packages/ckeditor5-theme-lark/theme/ckeditor5-html-embed/htmlembed.css b/packages/ckeditor5-theme-lark/theme/ckeditor5-html-embed/htmlembed.css index 416f2e427ae..fc5f8180534 100644 --- a/packages/ckeditor5-theme-lark/theme/ckeditor5-html-embed/htmlembed.css +++ b/packages/ckeditor5-theme-lark/theme/ckeditor5-html-embed/htmlembed.css @@ -11,7 +11,7 @@ padding: var(--ck-spacing-standard); /* The switch mode button. */ - & .raw-html__switch-mode { + & .raw-html__mode-toggle-button { position: absolute; top: var(--ck-spacing-standard); right: var(--ck-spacing-standard); @@ -31,7 +31,7 @@ } /* Using the feature with enabled previews in data. */ - & .raw-html--preview-enabled { + & .raw-html_preview_enabled { /* The preview data container. */ & .raw-html__preview { box-sizing: border-box; @@ -45,7 +45,7 @@ } /* Mode: preview the HTML. */ - &.raw-html--display-preview { + &.raw-html_preview_visible { background-color: var(--ck-color-base-foreground); background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuNDI0IDkuNzc3YS4yMi4yMiAwIDAgMCAuMTYuMDc0Yy4wNTggMCAuMTEtLjAyNS4xNTktLjA3NGEuMjI4LjIyOCAwIDAgMCAuMDY2LS4xNTguNzIxLjcyMSAwIDAgMC0uMDUyLS4yNTNsLS45NTQtMi41ODggMi41NzguOTY0YS42OC42OCAwIDAgMCAuMjUuMDU1LjIzMi4yMzIgMCAwIDAgLjE2MS0uMDcuMjEuMjEgMCAwIDAgLjA3LS4xNTMuMjI4LjIyOCAwIDAgMC0uMDc3LS4xNTguNDE0LjQxNCAwIDAgMC0uMDkzLS4wNjYgMS4wNDggMS4wNDggMCAwIDAtLjE1Ni0uMDY3bC0yLjgwMy0xLjA0Yy0uMDEtLjAwMi0uMDI1LS4wMDctLjA0NC0uMDE0LS4yMS0uMDgtLjM1NC0uMDgtLjQzNSAwLS4wOC4wODEtLjA4LjIzIDAgLjQ0NS4wMDUuMDE1LjAxLjAyNi4wMTQuMDM0bDEuMDI1IDIuODE4Yy4wMjYuMDc0LjA0OS4xMjkuMDY4LjE2NC4wMi4wMzYuMDQuMDY1LjA2My4wODd6bTEuMTYgMS44NDJjLjExNC4xMTQuMi4xNzYuMjYuMTg1LjA1OC4wMDkuMTItLjAyLjE4Ny0uMDg2LjA2LS4wNi4wODMtLjEyMi4wNy0uMTg2LS4wMTMtLjA2NC0uMDY3LS4xNDQtLjE2Mi0uMjRsLS4xNjItLjE2MSAxLjAwNi0xLjAwNiAxLjE1NyAxLjE1OC0xLjAwNSAxLjAwNS0uMTE5LS4xMThjLS4xM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jA4Ny4xNzRsMi4yNTcgMi4yNTd6bTEuMDU5LjM3N2EuNzQ3Ljc0NyAwIDAgMCAuMjQuMTI5bC4wMTQuMDA0IDIuODE4IDEuMDI1Yy4wMS4wMDMuMDI1LjAxLjA0OC4wMi4yMDguMDc1LjM1MS4wNzQuNDMtLjAwNS4wOC0uMDgxLjA4LS4yMjYgMC0uNDM1bC0uMDA4LS4wMjYtLjAwNi0uMDE4LTEuMDQtMi44MDRhMS4yMjMgMS4yMjMgMCAwIDAtLjA2Ny0uMTU3LjQwNi40MDYgMCAwIDAtLjA2OC0uMDk0LjIyMy4yMjMgMCAwIDAtLjE1Ni0uMDc0LjIxLjIxIDAgMCAwLS4xNTMuMDcuMjI4LjIyOCAwIDAgMC0uMDY3LjE1OC43MS43MSAwIDAgMCAuMDU3LjI1N2wuOTYgMi41NzQtMi41ODQtLjk1YS43MS43MSAwIDAgMC0uMjU3LS4wNTcuMjI4LjIyOCAwIDAgMC0uMTU5LjA2Ny4yMjUuMjI1IDAgMCAwLS4wNzQuMTU4YzAgLjA1Ny4wMjMuMTEuMDcyLjE1OHoiIG9wYWNpdHk9Ii4wNDYiLz48L3N2Zz4="); background-repeat: repeat; @@ -61,13 +61,13 @@ } /* Mode: edit the HTML source. */ - &:not(.raw-html--display-preview) .raw-html__preview { + &:not(.raw-html_preview_visible) .raw-html__preview { display: none; } } /* Disable all mouse interaction as long as the editor is not read–only. */ - &:not(.ck-read-only) .raw-html--preview-enabled .raw-html__preview { + &:not(.ck-read-only) .raw-html_preview_enabled .raw-html__preview { pointer-events: none; } }