diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index ffd23cea7a..15168f4ebb 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -862,6 +862,7 @@ module.exports = { sourceEditorComponents: [], sourceEditorCompletionSources: [], sourceEditorSymbolPalette: [], + sourceEditorToolbarComponents: [], writefullEditorPromotion: [], langFeedbackLinkingWidgets: [], integrationLinkingWidgets: [], diff --git a/services/web/frontend/js/features/source-editor/components/codemirror-editor.tsx b/services/web/frontend/js/features/source-editor/components/codemirror-editor.tsx index dc4967723d..f58396f040 100644 --- a/services/web/frontend/js/features/source-editor/components/codemirror-editor.tsx +++ b/services/web/frontend/js/features/source-editor/components/codemirror-editor.tsx @@ -24,6 +24,10 @@ const sourceEditorComponents = importOverleafModules( 'sourceEditorComponents' ) as { import: { default: ElementType }; path: string }[] +const sourceEditorToolbarComponents = importOverleafModules( + 'sourceEditorToolbarComponents' +) as { import: { default: ElementType }; path: string }[] + function CodeMirrorEditor() { // create the initial state const [state, setState] = useState(() => { @@ -59,6 +63,11 @@ function CodeMirrorEditor() { + {sourceEditorToolbarComponents.map( + ({ import: { default: Component }, path }) => ( + + ) + )} {sourceEditorComponents.map(