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'
|
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'
|
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>
|
2022-05-20 04:15:49 -04:00
|
|
|
<DetachProvider>
|
|
|
|
<EditorProvider settings={settings}>
|
2022-01-10 10:47:01 -05:00
|
|
|
<LayoutProvider>
|
2022-03-31 07:22:36 -04:00
|
|
|
<LocalCompileProvider>
|
|
|
|
<DetachCompileProvider>
|
|
|
|
<ChatProvider>{children}</ChatProvider>
|
|
|
|
</DetachCompileProvider>
|
|
|
|
</LocalCompileProvider>
|
2022-01-10 10:47:01 -05:00
|
|
|
</LayoutProvider>
|
2022-05-20 04:15:49 -04:00
|
|
|
</EditorProvider>
|
|
|
|
</DetachProvider>
|
2022-01-10 10:47:01 -05:00
|
|
|
</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,
|
2022-03-31 07:22:36 -04:00
|
|
|
ide: PropTypes.object,
|
|
|
|
settings: PropTypes.object,
|
2021-01-27 05:30:55 -05:00
|
|
|
}
|
|
|
|
|
2020-12-14 06:44:10 -05:00
|
|
|
export const rootContext = createSharedContext(ContextRoot)
|