overleaf/services/web/frontend/js/shared/context/root-context.jsx
Alf Eaton c2b553e915 [ide-react] Improve file tree and outline components in the editor sidebar (#16225)
* Upgrade react-resizable-panels
* Add FileTreeOpenProvider
* Add OutlineProvider and OutlineContainer
* Convert Outline tests to Cypress

GitOrigin-RevId: afd9ae8190edf37642e36a4ffb331f1182c8982d
2023-12-18 09:03:53 +00:00

59 lines
2.4 KiB
JavaScript

import PropTypes from 'prop-types'
import createSharedContext from 'react2angular-shared-context'
import { UserProvider } from './user-context'
import { IdeAngularProvider } from './ide-angular-provider'
import { EditorProvider } from './editor-context'
import { LocalCompileProvider } from './local-compile-context'
import { DetachCompileProvider } from './detach-compile-context'
import { LayoutProvider } from './layout-context'
import { DetachProvider } from './detach-context'
import { ChatProvider } from '@/features/chat/context/chat-context'
import { ProjectProvider } from './project-context'
import { SplitTestProvider } from './split-test-context'
import { FileTreeDataProvider } from './file-tree-data-context'
import { ProjectSettingsProvider } from '@/features/editor-left-menu/context/project-settings-context'
import { FileTreePathProvider } from '@/features/file-tree/contexts/file-tree-path'
import { UserSettingsProvider } from '@/shared/context/user-settings-context'
import { OutlineProvider } from '@/features/ide-react/context/outline-context'
export function ContextRoot({ children, ide }) {
return (
<SplitTestProvider>
<IdeAngularProvider ide={ide}>
<UserProvider>
<UserSettingsProvider>
<ProjectProvider>
<FileTreeDataProvider>
<FileTreePathProvider>
<DetachProvider>
<EditorProvider>
<ProjectSettingsProvider>
<LayoutProvider>
<LocalCompileProvider>
<DetachCompileProvider>
<ChatProvider>
<OutlineProvider>{children}</OutlineProvider>
</ChatProvider>
</DetachCompileProvider>
</LocalCompileProvider>
</LayoutProvider>
</ProjectSettingsProvider>
</EditorProvider>
</DetachProvider>
</FileTreePathProvider>
</FileTreeDataProvider>
</ProjectProvider>
</UserSettingsProvider>
</UserProvider>
</IdeAngularProvider>
</SplitTestProvider>
)
}
ContextRoot.propTypes = {
children: PropTypes.any,
ide: PropTypes.object,
}
export const rootContext = createSharedContext(ContextRoot)