rme 0.3.0-beta.2 → 0.3.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +66 -1
- package/dist/index.mjs +1695 -600
- package/dist/index.mjs.map +4 -4
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,47 @@ import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
|
19
19
|
|
|
20
20
|
type LoadLanguage = (lang: string) => Promise<LanguageSupport> | LanguageSupport | void;
|
|
21
21
|
|
|
22
|
+
type ClipboardReadFunction = typeof clipboardRead;
|
|
23
|
+
declare function clipboardRead(): Promise<{
|
|
24
|
+
html: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}>;
|
|
27
|
+
|
|
28
|
+
interface CommandKeymapOptions {
|
|
29
|
+
/**
|
|
30
|
+
* Override default keyboard shortcuts
|
|
31
|
+
* @example
|
|
32
|
+
* { toggleStrong: 'mod-shift-b', toggleEmphasis: 'ctrl-i' }
|
|
33
|
+
*/
|
|
34
|
+
overrideShortcutMap?: Partial<Record<CommandName, string>>;
|
|
35
|
+
/**
|
|
36
|
+
* Disable all built-in shortcuts
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
disableAllBuildInShortcuts?: boolean;
|
|
40
|
+
clipboardReadFunction?: ClipboardReadFunction;
|
|
41
|
+
}
|
|
42
|
+
type CommandName = keyof typeof defaultCommandShortcutMap;
|
|
43
|
+
declare const defaultCommandShortcutMap: {
|
|
44
|
+
readonly copy: "mod-c";
|
|
45
|
+
readonly paste: "mod-v";
|
|
46
|
+
readonly undo: "mod-z";
|
|
47
|
+
readonly redo: "mod-shift-z";
|
|
48
|
+
readonly cut: "mod-x";
|
|
49
|
+
readonly toggleH1: "mod-1";
|
|
50
|
+
readonly toggleH2: "mod-2";
|
|
51
|
+
readonly toggleH3: "mod-3";
|
|
52
|
+
readonly toggleH4: "mod-4";
|
|
53
|
+
readonly toggleH5: "mod-5";
|
|
54
|
+
readonly toggleH6: "mod-6";
|
|
55
|
+
readonly toggleStrong: "mod-b";
|
|
56
|
+
readonly toggleEmphasis: "mod-i";
|
|
57
|
+
readonly toggleCodeText: "mod-e";
|
|
58
|
+
readonly toggleDelete: "mod-shift-s";
|
|
59
|
+
readonly insertLink: "mod-k";
|
|
60
|
+
readonly insertImage: "mod-alt-i";
|
|
61
|
+
};
|
|
62
|
+
|
|
22
63
|
type CustomCopyFunction = (code: string) => Promise<boolean> | boolean;
|
|
23
64
|
|
|
24
65
|
declare const changeTheme: (theme: CreateThemeOptions) => void;
|
|
@@ -44,6 +85,10 @@ type CreateCodemirrorOptions = {
|
|
|
44
85
|
*/
|
|
45
86
|
customCopyFunction?: CustomCopyFunction;
|
|
46
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Command keymap options for customizing keyboard shortcuts
|
|
90
|
+
*/
|
|
91
|
+
commandKeymapOptions?: CommandKeymapOptions;
|
|
47
92
|
};
|
|
48
93
|
declare class MfCodemirrorView {
|
|
49
94
|
private readonly view;
|
|
@@ -231,6 +276,18 @@ type EditorContext = ReactFrameworkOutput<Remirror.Extensions>;
|
|
|
231
276
|
type CreateSourceCodeManagerOptions = {
|
|
232
277
|
language?: string;
|
|
233
278
|
onCodemirrorViewLoad: (cm: MfCodemirrorView) => void;
|
|
279
|
+
/**
|
|
280
|
+
* Override default keyboard shortcuts
|
|
281
|
+
* @example
|
|
282
|
+
* { toggleStrong: 'mod-shift-b', toggleEmphasis: 'ctrl-i' }
|
|
283
|
+
*/
|
|
284
|
+
overrideShortcutMap?: Partial<Record<CommandName, string>>;
|
|
285
|
+
/**
|
|
286
|
+
* Disable all built-in shortcuts
|
|
287
|
+
* @default false
|
|
288
|
+
*/
|
|
289
|
+
disableAllBuildInShortcuts?: boolean;
|
|
290
|
+
clipboardReadFunction?: ClipboardReadFunction;
|
|
234
291
|
};
|
|
235
292
|
declare function createSourceCodeManager(options?: CreateSourceCodeManagerOptions): RemirrorManager$1<any>;
|
|
236
293
|
declare const createSourceCodeDelegate: (options?: CreateSourceCodeManagerOptions) => EditorDelegate<any>;
|
|
@@ -250,6 +307,10 @@ interface AIOptions {
|
|
|
250
307
|
}) => Promise<string | null>;
|
|
251
308
|
}
|
|
252
309
|
|
|
310
|
+
type CodemirrorOptions = {
|
|
311
|
+
lineWrapping?: boolean;
|
|
312
|
+
};
|
|
313
|
+
|
|
253
314
|
type MarkdownItToken = string;
|
|
254
315
|
declare enum ParserRuleType {
|
|
255
316
|
text = 1,
|
|
@@ -385,10 +446,12 @@ type ExtensionsOptions = {
|
|
|
385
446
|
disableAllBuildInShortcuts?: boolean;
|
|
386
447
|
handleViewImgSrcUrl?: (src: string) => Promise<string>;
|
|
387
448
|
imageHostingHandler?: (src: string) => Promise<string>;
|
|
388
|
-
|
|
449
|
+
imagePasteHandler?: (src: string) => Promise<string>;
|
|
389
450
|
ai?: AIOptions;
|
|
390
451
|
customCopyFunction?: CustomCopyFunction;
|
|
391
452
|
overrideShortcutMap?: Record<string, string>;
|
|
453
|
+
clipboardReadFunction?: ClipboardReadFunction;
|
|
454
|
+
codemirrorOptions?: CodemirrorOptions;
|
|
392
455
|
};
|
|
393
456
|
declare function extensions(options: ExtensionsOptions): any[];
|
|
394
457
|
|
|
@@ -495,6 +558,7 @@ declare const darkTheme: {
|
|
|
495
558
|
contextMenuBgColorHover: string;
|
|
496
559
|
slashMenuBorderColor: string;
|
|
497
560
|
editorToolbarBgColor: string;
|
|
561
|
+
selectionMatchBgColor: string;
|
|
498
562
|
lineHeightBase: string;
|
|
499
563
|
titleBarHeight: string;
|
|
500
564
|
titleBarControlBtnWidth: string;
|
|
@@ -562,6 +626,7 @@ declare const lightTheme: {
|
|
|
562
626
|
contextMenuBgColorHover: string;
|
|
563
627
|
slashMenuBorderColor: string;
|
|
564
628
|
editorToolbarBgColor: string;
|
|
629
|
+
selectionMatchBgColor: string;
|
|
565
630
|
lineHeightBase: string;
|
|
566
631
|
titleBarHeight: string;
|
|
567
632
|
titleBarControlBtnWidth: string;
|