2018-05-02 06:09:58 +00:00
|
|
|
// Import React!
|
2023-12-08 09:58:27 +00:00
|
|
|
import React, { Suspense } from 'react';
|
2025-02-14 06:04:25 +00:00
|
|
|
import { createRoot } from 'react-dom/client';
|
2018-05-02 06:09:58 +00:00
|
|
|
import { I18nextProvider } from 'react-i18next';
|
2023-12-08 09:58:27 +00:00
|
|
|
import i18n from './_i18n/i18n-seafile-editor';
|
2022-05-13 03:19:16 +00:00
|
|
|
import MarkdownEditor from './pages/markdown-editor';
|
2023-12-08 09:58:27 +00:00
|
|
|
import Loading from './components/loading';
|
2024-11-22 09:11:55 +00:00
|
|
|
import { MetadataStatusProvider } from './hooks';
|
|
|
|
import { CollaboratorsProvider } from './metadata';
|
2020-12-21 08:21:51 +00:00
|
|
|
|
2018-05-02 06:09:58 +00:00
|
|
|
import './index.css';
|
|
|
|
|
2024-12-07 09:40:43 +00:00
|
|
|
const { repoID, repoEncrypted, filePerm } = window.app.pageOptions;
|
2024-09-27 06:05:45 +00:00
|
|
|
|
2025-02-14 06:04:25 +00:00
|
|
|
const root = createRoot(document.getElementById('root'));
|
|
|
|
root.render(
|
2019-08-31 14:58:38 +00:00
|
|
|
<I18nextProvider i18n={ i18n } >
|
2023-12-08 09:58:27 +00:00
|
|
|
<Suspense fallback={<Loading />}>
|
2024-12-30 11:00:50 +00:00
|
|
|
<MetadataStatusProvider repoID={repoID} repoInfo={{ permission: filePerm, encrypted: repoEncrypted }}>
|
2024-09-27 06:05:45 +00:00
|
|
|
<CollaboratorsProvider repoID={repoID}>
|
|
|
|
<MarkdownEditor />
|
|
|
|
</CollaboratorsProvider>
|
2024-11-22 09:11:55 +00:00
|
|
|
</MetadataStatusProvider>
|
2023-12-08 09:58:27 +00:00
|
|
|
</Suspense>
|
2025-02-14 06:04:25 +00:00
|
|
|
</I18nextProvider>
|
2018-05-02 06:09:58 +00:00
|
|
|
);
|