Browse Source

add paste-mode to editor-settings

reiji-h 1 year ago
parent
commit
1669409729

+ 2 - 0
packages/editor/src/consts/editor-settings.ts

@@ -1,9 +1,11 @@
 import type { EditorTheme } from './editor-themes';
 import type { KeyMapMode } from './keymaps';
+import type { PasteMode } from './paste-mode';
 
 export interface EditorSettings {
   theme: undefined | EditorTheme,
   keymapMode: undefined | KeyMapMode,
+  pasteMode: undefined | PasteMode,
   styleActiveLine: boolean,
   autoFormatMarkdownTable: boolean,
 }

+ 1 - 0
packages/editor/src/consts/index.ts

@@ -3,3 +3,4 @@ export * from './ydoc-awareness-user-color';
 export * from './editor-settings';
 export * from './editor-themes';
 export * from './keymaps';
+export * from './paste-mode';

+ 10 - 0
packages/editor/src/consts/paste-mode.ts

@@ -0,0 +1,10 @@
+
+const PasteMode = {
+  both: 'both',
+  text: 'text',
+  file: 'file',
+} as const;
+
+export const DEFAULT_PASTE_MODE = 'both';
+export const AllPasteMode = Object.values(PasteMode);
+export type PasteMode = typeof PasteMode[keyof typeof PasteMode];