mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Move Writefull toolbar loading/initialisation into a React component (#16546)
GitOrigin-RevId: 1cb6efa7cab2babb33800fef9469fca3addbdaf5
This commit is contained in:
parent
7c3c3047fe
commit
22b5828b3d
2 changed files with 10 additions and 0 deletions
|
@ -862,6 +862,7 @@ module.exports = {
|
||||||
sourceEditorComponents: [],
|
sourceEditorComponents: [],
|
||||||
sourceEditorCompletionSources: [],
|
sourceEditorCompletionSources: [],
|
||||||
sourceEditorSymbolPalette: [],
|
sourceEditorSymbolPalette: [],
|
||||||
|
sourceEditorToolbarComponents: [],
|
||||||
writefullEditorPromotion: [],
|
writefullEditorPromotion: [],
|
||||||
langFeedbackLinkingWidgets: [],
|
langFeedbackLinkingWidgets: [],
|
||||||
integrationLinkingWidgets: [],
|
integrationLinkingWidgets: [],
|
||||||
|
|
|
@ -24,6 +24,10 @@ const sourceEditorComponents = importOverleafModules(
|
||||||
'sourceEditorComponents'
|
'sourceEditorComponents'
|
||||||
) as { import: { default: ElementType }; path: string }[]
|
) as { import: { default: ElementType }; path: string }[]
|
||||||
|
|
||||||
|
const sourceEditorToolbarComponents = importOverleafModules(
|
||||||
|
'sourceEditorToolbarComponents'
|
||||||
|
) as { import: { default: ElementType }; path: string }[]
|
||||||
|
|
||||||
function CodeMirrorEditor() {
|
function CodeMirrorEditor() {
|
||||||
// create the initial state
|
// create the initial state
|
||||||
const [state, setState] = useState(() => {
|
const [state, setState] = useState(() => {
|
||||||
|
@ -59,6 +63,11 @@ function CodeMirrorEditor() {
|
||||||
<FigureModal />
|
<FigureModal />
|
||||||
<CodeMirrorSearch />
|
<CodeMirrorSearch />
|
||||||
<CodeMirrorToolbar />
|
<CodeMirrorToolbar />
|
||||||
|
{sourceEditorToolbarComponents.map(
|
||||||
|
({ import: { default: Component }, path }) => (
|
||||||
|
<Component key={path} />
|
||||||
|
)
|
||||||
|
)}
|
||||||
<CodeMirrorCommandTooltip />
|
<CodeMirrorCommandTooltip />
|
||||||
<ReviewPanel />
|
<ReviewPanel />
|
||||||
{sourceEditorComponents.map(
|
{sourceEditorComponents.map(
|
||||||
|
|
Loading…
Reference in a new issue