anki/ts/editor/base.ts
Henrik Giesel f534dbb8e5
Separate input components into their own directories / Remove WithShortcut (#1613)
* Put PlainTextInput into its own directory

* Create a directory for RichTextInput

* Create editor-toolbar directory

* Move PreviewButton into editor-toolbar

* The time to refactor this is not quite yet here

* Create tag-editor directory

* Remove some of the uses of WithShortcut

* Remove all uses of WithShortcut from editor package

* Remove last uses of WithShortcut

* Fix typo
2022-01-24 11:43:09 +10:00

48 lines
1.2 KiB
TypeScript

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
/**
* Code that is shared among all entry points in /ts/editor
*/
import "./legacy.css";
import "./editor-base.css";
import "../lib/register-package";
import "../sveltelib/export-runtime";
declare global {
interface Selection {
modify(s: string, t: string, u: string): void;
addRange(r: Range): void;
removeAllRanges(): void;
getRangeAt(n: number): Range;
}
}
import { ModuleName } from "../lib/i18n";
export const editorModules = [
ModuleName.EDITING,
ModuleName.KEYBOARD,
ModuleName.ACTIONS,
ModuleName.BROWSING,
];
import IconButton from "../components/IconButton.svelte";
import LabelButton from "../components/LabelButton.svelte";
import WithContext from "../components/WithContext.svelte";
import WithState from "../components/WithState.svelte";
import * as contextKeys from "../components/context-keys";
import * as editorContextKeys from "./NoteEditor.svelte";
export const components = {
IconButton,
LabelButton,
WithContext,
WithState,
contextKeys: { ...contextKeys, ...editorContextKeys },
};
export { editorToolbar } from "./editor-toolbar";