You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
849 B

import { buildPostBodyMarkdownEditorVditorOptions } from './post-body-markdown-editor-vditor-config'
interface BuildQuickNoteVditorOptionsInput {
value: string
onInput: (value: string) => void
onUploadError: () => void
}
const QUICK_NOTE_TOOLBAR: ReadonlyArray<string> = [
'bold',
'italic',
'headings',
'|',
'list',
'ordered-list',
'|',
'link',
'upload',
'code',
]
export function buildQuickNoteEditorVditorOptions(input: BuildQuickNoteVditorOptionsInput): Record<string, unknown> {
const baseOptions = buildPostBodyMarkdownEditorVditorOptions({
value: input.value,
isMobile: true,
onInput: input.onInput,
onUploadError: input.onUploadError,
})
return {
...baseOptions,
height: '100%',
toolbar: QUICK_NOTE_TOOLBAR,
}
}
export const quickNoteEditorToolbarPreset = QUICK_NOTE_TOOLBAR