2021-01-27 05:30:55 -05:00
|
|
|
import PropTypes from 'prop-types'
|
2021-06-03 09:44:23 -04:00
|
|
|
import createSharedContext from 'react2angular-shared-context'
|
|
|
|
|
2021-06-25 04:14:07 -04:00
|
|
|
import { UserProvider } from './user-context'
|
2023-10-24 10:57:17 -04:00
|
|
|
import { IdeAngularProvider } from './ide-angular-provider'
|
2020-12-14 06:44:10 -05:00
|
|
|
import { EditorProvider } from './editor-context'
|
2022-03-31 07:22:36 -04:00
|
|
|
import { LocalCompileProvider } from './local-compile-context'
|
|
|
|
import { DetachCompileProvider } from './detach-compile-context'
|
2021-06-03 09:44:23 -04:00
|
|
|
import { LayoutProvider } from './layout-context'
|
2021-11-15 11:33:57 -05:00
|
|
|
import { DetachProvider } from './detach-context'
|
2023-10-16 07:10:43 -04:00
|
|
|
import { ChatProvider } from '@/features/chat/context/chat-context'
|
2021-06-25 04:13:17 -04:00
|
|
|
import { ProjectProvider } from './project-context'
|
2021-08-19 11:42:49 -04:00
|
|
|
import { SplitTestProvider } from './split-test-context'
|
2022-01-10 10:47:01 -05:00
|
|
|
import { FileTreeDataProvider } from './file-tree-data-context'
|
2023-10-16 07:10:43 -04:00
|
|
|
import { ProjectSettingsProvider } from '@/features/editor-left-menu/context/project-settings-context'
|
2023-10-26 06:01:08 -04:00
|
|
|
import { FileTreePathProvider } from '@/features/file-tree/contexts/file-tree-path'
|
2023-11-21 09:29:44 -05:00
|
|
|
import { UserSettingsProvider } from '@/shared/context/user-settings-context'
|
2023-12-15 04:19:42 -05:00
|
|
|
import { OutlineProvider } from '@/features/ide-react/context/outline-context'
|
2020-12-14 06:44:10 -05:00
|
|
|
|
2023-09-28 12:36:08 -04:00
|
|
|
export function ContextRoot({ children, ide }) {
|
2020-12-14 06:44:10 -05:00
|
|
|
return (
|
2021-08-19 11:42:49 -04:00
|
|
|
<SplitTestProvider>
|
2023-10-24 10:57:17 -04:00
|
|
|
<IdeAngularProvider ide={ide}>
|
2021-08-19 11:42:49 -04:00
|
|
|
<UserProvider>
|
2023-11-21 09:29:44 -05:00
|
|
|
<UserSettingsProvider>
|
|
|
|
<ProjectProvider>
|
|
|
|
<FileTreeDataProvider>
|
|
|
|
<FileTreePathProvider>
|
|
|
|
<DetachProvider>
|
|
|
|
<EditorProvider>
|
|
|
|
<ProjectSettingsProvider>
|
|
|
|
<LayoutProvider>
|
|
|
|
<LocalCompileProvider>
|
|
|
|
<DetachCompileProvider>
|
2023-12-15 04:19:42 -05:00
|
|
|
<ChatProvider>
|
|
|
|
<OutlineProvider>{children}</OutlineProvider>
|
|
|
|
</ChatProvider>
|
2023-11-21 09:29:44 -05:00
|
|
|
</DetachCompileProvider>
|
|
|
|
</LocalCompileProvider>
|
|
|
|
</LayoutProvider>
|
|
|
|
</ProjectSettingsProvider>
|
|
|
|
</EditorProvider>
|
|
|
|
</DetachProvider>
|
|
|
|
</FileTreePathProvider>
|
|
|
|
</FileTreeDataProvider>
|
|
|
|
</ProjectProvider>
|
|
|
|
</UserSettingsProvider>
|
2021-08-19 11:42:49 -04:00
|
|
|
</UserProvider>
|
2023-10-24 10:57:17 -04:00
|
|
|
</IdeAngularProvider>
|
2021-08-19 11:42:49 -04:00
|
|
|
</SplitTestProvider>
|
2020-12-14 06:44:10 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-01-27 05:30:55 -05:00
|
|
|
ContextRoot.propTypes = {
|
|
|
|
children: PropTypes.any,
|
2022-03-31 07:22:36 -04:00
|
|
|
ide: PropTypes.object,
|
2021-01-27 05:30:55 -05:00
|
|
|
}
|
|
|
|
|
2020-12-14 06:44:10 -05:00
|
|
|
export const rootContext = createSharedContext(ContextRoot)
|