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'
|
2021-06-16 05:32:38 -04:00
|
|
|
import { IdeProvider } from './ide-context'
|
2020-12-14 06:44:10 -05:00
|
|
|
import { EditorProvider } from './editor-context'
|
2021-04-19 08:38:03 -04:00
|
|
|
import { CompileProvider } from './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'
|
2021-06-03 09:44:23 -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'
|
2020-12-14 06:44:10 -05:00
|
|
|
|
2021-03-10 07:19:54 -05:00
|
|
|
export function ContextRoot({ children, ide, settings }) {
|
2020-12-14 06:44:10 -05:00
|
|
|
return (
|
2021-08-19 11:42:49 -04:00
|
|
|
<SplitTestProvider>
|
|
|
|
<IdeProvider ide={ide}>
|
|
|
|
<UserProvider>
|
|
|
|
<ProjectProvider>
|
2022-01-10 10:47:01 -05:00
|
|
|
<FileTreeDataProvider>
|
|
|
|
<EditorProvider settings={settings}>
|
|
|
|
<DetachProvider>
|
|
|
|
<LayoutProvider>
|
|
|
|
<CompileProvider>
|
|
|
|
<ChatProvider>{children}</ChatProvider>
|
|
|
|
</CompileProvider>
|
|
|
|
</LayoutProvider>
|
|
|
|
</DetachProvider>
|
|
|
|
</EditorProvider>
|
|
|
|
</FileTreeDataProvider>
|
2021-08-19 11:42:49 -04:00
|
|
|
</ProjectProvider>
|
|
|
|
</UserProvider>
|
|
|
|
</IdeProvider>
|
|
|
|
</SplitTestProvider>
|
2020-12-14 06:44:10 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-01-27 05:30:55 -05:00
|
|
|
ContextRoot.propTypes = {
|
|
|
|
children: PropTypes.any,
|
2021-03-10 07:19:54 -05:00
|
|
|
ide: PropTypes.any.isRequired,
|
2021-04-27 03:52:58 -04:00
|
|
|
settings: PropTypes.any.isRequired,
|
2021-01-27 05:30:55 -05:00
|
|
|
}
|
|
|
|
|
2020-12-14 06:44:10 -05:00
|
|
|
export const rootContext = createSharedContext(ContextRoot)
|