mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[WEB] Add TeXGPT button to the main toolbar (#34219)
* feat: add writefull-toolbar-migration split test and sourceEditorToolbarStartButtons slot * feat: add TeXGPT button to main editor toolbar (writefull-toolbar-migration) * removing wrapper div * hide toolbar start buttons from readonly users GitOrigin-RevId: 6bafe3ad3fade98c318ea0d0b2714957c1d2d9b4
This commit is contained in:
@@ -1039,6 +1039,7 @@ module.exports = {
|
||||
diagnosticActions: [],
|
||||
sourceEditorCompletionSources: [],
|
||||
sourceEditorSymbolPalette: [],
|
||||
sourceEditorToolbarStartButtons: [],
|
||||
sourceEditorToolbarButtonGroups: [],
|
||||
sourceEditorToolbarComponents: [],
|
||||
sourceEditorToolbarEndButtons: [],
|
||||
|
||||
@@ -38,6 +38,10 @@ import { useLayoutContext } from '@/shared/context/layout-context'
|
||||
import ReviewPanelHeaderBuffer from '@/features/review-panel/components/review-panel-header-buffer'
|
||||
import { useAreTabsEnabled } from '@/features/ide-react/hooks/use-are-tabs-enabled'
|
||||
|
||||
const sourceEditorToolbarStartButtons = importOverleafModules(
|
||||
'sourceEditorToolbarStartButtons'
|
||||
) as { import: { default: ElementType }; path: string }[]
|
||||
|
||||
const sourceEditorToolbarComponents = importOverleafModules(
|
||||
'sourceEditorToolbarComponents'
|
||||
) as { import: { default: ElementType }; path: string }[]
|
||||
@@ -194,6 +198,12 @@ const Toolbar = memo(function Toolbar() {
|
||||
className="ol-cm-toolbar toolbar-editor"
|
||||
ref={handleToolbar}
|
||||
>
|
||||
{showActions &&
|
||||
sourceEditorToolbarStartButtons.map(
|
||||
({ import: { default: Component }, path }) => (
|
||||
<Component key={path} />
|
||||
)
|
||||
)}
|
||||
{showActions && (
|
||||
<ToolbarItems
|
||||
state={state}
|
||||
|
||||
Reference in New Issue
Block a user