2020-11-01 07:16:28 +08:00
|
|
|
import Dropcursor from '@tiptap/extension-dropcursor'
|
|
|
|
import Gapcursor from '@tiptap/extension-gapcursor'
|
2020-03-28 05:04:02 +08:00
|
|
|
import Document from '@tiptap/extension-document'
|
|
|
|
import Paragraph from '@tiptap/extension-paragraph'
|
|
|
|
import Text from '@tiptap/extension-text'
|
2020-11-11 17:21:25 +08:00
|
|
|
import History, { HistoryOptions } from '@tiptap/extension-history'
|
2020-04-17 02:03:15 +08:00
|
|
|
import Bold from '@tiptap/extension-bold'
|
|
|
|
import Italic from '@tiptap/extension-italic'
|
|
|
|
import Code from '@tiptap/extension-code'
|
2020-11-11 17:21:25 +08:00
|
|
|
import CodeBlock, { CodeBlockOptions } from '@tiptap/extension-code-block'
|
|
|
|
import Heading, { HeadingOptions } from '@tiptap/extension-heading'
|
2020-09-10 17:50:34 +08:00
|
|
|
import HardBreak from '@tiptap/extension-hard-break'
|
2020-09-10 17:43:09 +08:00
|
|
|
import Strike from '@tiptap/extension-strike'
|
2020-09-10 18:10:24 +08:00
|
|
|
import Blockquote from '@tiptap/extension-blockquote'
|
2020-09-10 18:28:14 +08:00
|
|
|
import HorizontalRule from '@tiptap/extension-horizontal-rule'
|
2020-09-11 04:29:15 +08:00
|
|
|
import BulletList from '@tiptap/extension-bullet-list'
|
2020-09-23 03:54:52 +08:00
|
|
|
import OrderedList from '@tiptap/extension-ordered-list'
|
2020-09-11 04:29:15 +08:00
|
|
|
import ListItem from '@tiptap/extension-list-item'
|
2020-03-06 19:18:20 +08:00
|
|
|
|
2020-11-11 17:21:25 +08:00
|
|
|
export function defaultExtensions(options: {
|
|
|
|
history: HistoryOptions,
|
|
|
|
codeBlock: CodeBlockOptions,
|
|
|
|
heading: HeadingOptions,
|
|
|
|
}) {
|
2020-03-06 19:18:20 +08:00
|
|
|
return [
|
2020-11-16 06:25:25 +08:00
|
|
|
Dropcursor,
|
|
|
|
Gapcursor,
|
|
|
|
Document,
|
|
|
|
History.set(options?.history),
|
|
|
|
Paragraph,
|
|
|
|
Text,
|
|
|
|
Bold,
|
|
|
|
Italic,
|
|
|
|
Code,
|
|
|
|
CodeBlock.set(options?.codeBlock),
|
|
|
|
Heading.set(options?.heading),
|
|
|
|
HardBreak,
|
|
|
|
Strike,
|
|
|
|
Blockquote,
|
|
|
|
HorizontalRule,
|
|
|
|
BulletList,
|
|
|
|
OrderedList,
|
|
|
|
ListItem,
|
2020-03-06 19:18:20 +08:00
|
|
|
]
|
2020-09-24 06:29:05 +08:00
|
|
|
}
|