diff --git a/src/editors/data/constants/tinyMCE.js b/src/editors/data/constants/tinyMCE.js index a14bc0e58..f98333580 100644 --- a/src/editors/data/constants/tinyMCE.js +++ b/src/editors/data/constants/tinyMCE.js @@ -68,7 +68,6 @@ export const plugins = listKeyStore([ 'imagetools', 'quickbars', 'a11ychecker', - 'a11ycheckerCss', 'powerpaste', ]); diff --git a/src/editors/sharedComponents/TinyMceWidget/hooks.js b/src/editors/sharedComponents/TinyMceWidget/hooks.js index 70763d352..e47e6281a 100644 --- a/src/editors/sharedComponents/TinyMceWidget/hooks.js +++ b/src/editors/sharedComponents/TinyMceWidget/hooks.js @@ -4,6 +4,7 @@ import { useCallback, useEffect, } from 'react'; +import { a11ycheckerCss } from 'frontend-components-tinymce-advanced-plugins'; import tinyMCEStyles from '../../data/constants/tinyMCEStyles'; import { StrictDict } from '../../utils'; import pluginConfig from './pluginConfig'; @@ -250,7 +251,7 @@ export const editorConfig = ({ ...config, skin: false, content_css: false, - content_style: tinyMCEStyles, + content_style: tinyMCEStyles + a11ycheckerCss, min_height: minHeight, contextmenu: 'link table', document_base_url: lmsEndpointUrl, diff --git a/src/editors/sharedComponents/TinyMceWidget/pluginConfig.js b/src/editors/sharedComponents/TinyMceWidget/pluginConfig.js index 72b2d2ce6..509fcd9b7 100644 --- a/src/editors/sharedComponents/TinyMceWidget/pluginConfig.js +++ b/src/editors/sharedComponents/TinyMceWidget/pluginConfig.js @@ -31,6 +31,8 @@ const pluginConfig = ({ isLibrary, placeholder, editorType }) => { image, imageTools, quickToolbar, + plugins.a11ychecker, + plugins.powerpaste, ].join(' '), menubar: false, toolbar: toolbar ? mapToolbars([ @@ -52,8 +54,7 @@ const pluginConfig = ({ isLibrary, placeholder, editorType }) => { ], [imageUploadButton, buttons.link, buttons.unlink, buttons.blockQuote, buttons.codeBlock], [buttons.table, buttons.emoticons, buttons.charmap, buttons.hr], - [buttons.removeFormat, codeButton], - [buttons.a11ycheck], + [buttons.removeFormat, codeButton, buttons.a11ycheck], ]) : false, imageToolbar: mapToolbars([ // [buttons.rotate.left, buttons.rotate.right], @@ -70,7 +71,7 @@ const pluginConfig = ({ isLibrary, placeholder, editorType }) => { buttons.numlist, ], [imageUploadButton, buttons.blockQuote, buttons.codeBlock], - [buttons.table, buttons.emoticons, buttons.charmap, buttons.removeFormat], + [buttons.table, buttons.emoticons, buttons.charmap, buttons.removeFormat, buttons.a11ycheck], ]), quickbarsSelectionToolbar: toolbar ? false : mapToolbars([ [buttons.undo, buttons.redo], @@ -82,7 +83,7 @@ const pluginConfig = ({ isLibrary, placeholder, editorType }) => { buttons.numlist, ], [imageUploadButton, buttons.blockQuote, buttons.codeBlock], - [buttons.table, buttons.emoticons, buttons.charmap, buttons.removeFormat], + [buttons.table, buttons.emoticons, buttons.charmap, buttons.removeFormat, buttons.a11ycheck], ]), config: { branding: false, @@ -97,6 +98,10 @@ const pluginConfig = ({ isLibrary, placeholder, editorType }) => { inline, block_formats: 'Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6;Div=div;Paragraph=p;Preformatted=pre', forced_root_block: defaultFormat, + powerpaste_allow_local_images: true, + powerpaste_word_import: 'prompt', + powerpaste_html_import: 'prompt', + powerpaste_googledoc_import: 'prompt', }, }) ); diff --git a/src/setupTest.js b/src/setupTest.js index 30ac1d414..0fca3d8e1 100644 --- a/src/setupTest.js +++ b/src/setupTest.js @@ -154,4 +154,6 @@ jest.mock('react-redux', () => { }); // Mock the plugins repo so jest will stop complaining about ES6 syntax -jest.mock('frontend-components-tinymce-advanced-plugins', () => {}); +jest.mock('frontend-components-tinymce-advanced-plugins', () => ({ + a11ycheckerCss: '', +}));