Spaces:
Paused
Paused
Download src/lib/components/common/RichTextInput/commands.ts from arcticaurora/ai: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/spaces/arcticaurora/ai/resolve/main/src/lib/components/common/RichTextInput/commands.ts
- Command line
-
hf download hf://spaces/arcticaurora/ai/src/lib/components/common/RichTextInput/commands.ts
-
curl -L -o commands.ts https://huggingface.co/spaces/arcticaurora/ai/resolve/main/src/lib/components/common/RichTextInput/commands.ts
434 Bytes
| import { Extension } from '@tiptap/core'; | |
| import Suggestion from '@tiptap/suggestion'; | |
| export default Extension.create({ | |
| name: 'commands', | |
| addOptions() { | |
| return { | |
| suggestion: { | |
| char: '/', | |
| command: ({ editor, range, props }) => { | |
| props.command({ editor, range }); | |
| } | |
| } | |
| }; | |
| }, | |
| addProseMirrorPlugins() { | |
| return [ | |
| Suggestion({ | |
| editor: this.editor, | |
| ...this.options.suggestion | |
| }) | |
| ]; | |
| } | |
| }); | |