2022-01-12 05:51:43 +01:00
|
|
|
// Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
import BrowserEditor from "./BrowserEditor.svelte";
|
2022-01-16 06:05:35 +01:00
|
|
|
import { editorModules } from "./base";
|
2022-01-12 05:51:43 +01:00
|
|
|
import { promiseWithResolver } from "../lib/promise";
|
|
|
|
import { globalExport } from "../lib/globals";
|
2022-01-16 06:05:35 +01:00
|
|
|
import { setupI18n } from "../lib/i18n";
|
2022-01-12 05:51:43 +01:00
|
|
|
|
|
|
|
const [uiPromise, uiResolve] = promiseWithResolver();
|
|
|
|
|
|
|
|
async function setupBrowserEditor(): Promise<void> {
|
2022-01-16 06:05:35 +01:00
|
|
|
await setupI18n({ modules: editorModules });
|
2022-01-12 05:51:43 +01:00
|
|
|
|
|
|
|
new BrowserEditor({
|
|
|
|
target: document.body,
|
|
|
|
props: { uiResolve },
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
setupBrowserEditor();
|
|
|
|
|
2022-01-16 06:05:35 +01:00
|
|
|
import * as base from "./base";
|
2022-01-12 05:51:43 +01:00
|
|
|
|
|
|
|
globalExport({
|
2022-01-16 06:05:35 +01:00
|
|
|
...base,
|
2022-01-12 05:51:43 +01:00
|
|
|
uiPromise,
|
|
|
|
noteEditorPromise: uiPromise,
|
|
|
|
});
|