Skip to content

Commit

Permalink
fix: misssing part of paid plugin configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Clary committed Dec 11, 2023
1 parent 1c9771b commit b0ca07d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/editors/data/constants/tinyMCE.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export const plugins = listKeyStore([
'imagetools',
'quickbars',
'a11ychecker',
'a11ycheckerCss',
'powerpaste',
]);

Expand Down
3 changes: 2 additions & 1 deletion src/editors/sharedComponents/TinyMceWidget/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
13 changes: 9 additions & 4 deletions src/editors/sharedComponents/TinyMceWidget/pluginConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const pluginConfig = ({ isLibrary, placeholder, editorType }) => {
image,
imageTools,
quickToolbar,
plugins.a11ychecker,
plugins.powerpaste,
].join(' '),
menubar: false,
toolbar: toolbar ? mapToolbars([
Expand All @@ -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],
Expand All @@ -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],
Expand All @@ -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,
Expand All @@ -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',
},
})
);
Expand Down
4 changes: 3 additions & 1 deletion src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
}));

0 comments on commit b0ca07d

Please sign in to comment.