Files
open-webui-custom/src/lib/components/common/RichTextInput/commands.ts
Timothy Jaeryang Baek 6b69c4da0f refac/enh: commands ui
2025-09-12 20:31:57 +04:00

27 lines
434 B
TypeScript

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
})
];
}
});