3beea5e1e4
* Forbid inserting object and iframe tags via PlainTextInput * Add optional browserMode parameter to Editor * Create new ts modules for three editor instances - note-creator for AddCards - browser-editor for the editor in the Browser - reviewer-editor for the EditCurrent * Revert "Forbid inserting object and iframe tags via PlainTextInput" This reverts commit ab90ae8194494d883a1863126496e2d8f332509e. * Refactor browserMode to editorMode * Move new editor variants inside /ts/editor directory * Fix typo
28 lines
666 B
TypeScript
28 lines
666 B
TypeScript
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
import { i18n } from ".";
|
|
import BrowserEditor from "./BrowserEditor.svelte";
|
|
import { promiseWithResolver } from "../lib/promise";
|
|
import { globalExport } from "../lib/globals";
|
|
|
|
const [uiPromise, uiResolve] = promiseWithResolver();
|
|
|
|
async function setupBrowserEditor(): Promise<void> {
|
|
await i18n;
|
|
|
|
new BrowserEditor({
|
|
target: document.body,
|
|
props: { uiResolve },
|
|
});
|
|
}
|
|
|
|
setupBrowserEditor();
|
|
|
|
import * as editor from ".";
|
|
|
|
globalExport({
|
|
...editor,
|
|
uiPromise,
|
|
noteEditorPromise: uiPromise,
|
|
});
|