Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(editor): add ReactMentionPlugin to ChatInput for mention node rendering (#13415)

Innei7097167613af
diff --git a/src/features/ChatInput/InputEditor/plugins.ts b/src/features/ChatInput/InputEditor/plugins.ts
index f2942c9f25e..09c021da35f 100644
--- a/src/features/ChatInput/InputEditor/plugins.ts
+++ b/src/features/ChatInput/InputEditor/plugins.ts
@@ -5,6 +5,7 @@ import {
ReactLinkHighlightPlugin,
ReactListPlugin,
ReactMathPlugin,
+ ReactMentionPlugin,
ReactVirtualBlockPlugin,
} from '@lobehub/editor';
import { type Editor } from '@lobehub/editor/react';
@@ -22,6 +23,7 @@ interface CreateChatInputRichPluginsOptions {
export const CHAT_INPUT_EMBED_PLUGINS: EditorPlugins = [
ReactActionTagPlugin,
ReactReferTopicPlugin,
+ ReactMentionPlugin,
];
export const createChatInputRichPlugins = ({
diff --git a/src/features/EditorModal/EditorCanvas.tsx b/src/features/EditorModal/EditorCanvas.tsx
index 6be65103f0b..8bf7cf234d0 100644
--- a/src/features/EditorModal/EditorCanvas.tsx
+++ b/src/features/EditorModal/EditorCanvas.tsx
@@ -1,5 +1,5 @@
import { type IEditor } from '@lobehub/editor';
-import { ReactLinkPlugin, ReactMentionPlugin, ReactTablePlugin } from '@lobehub/editor';
+import { ReactLinkPlugin, ReactTablePlugin } from '@lobehub/editor';
import { Editor } from '@lobehub/editor/react';
import { Flexbox } from '@lobehub/ui';
import { type FC, useMemo } from 'react';
@@ -17,7 +17,6 @@ interface EditorCanvasProps {
const EDITOR_PLUGINS = [
...createChatInputRichPlugins({ linkPlugin: ReactLinkPlugin }),
ReactTablePlugin,
- ReactMentionPlugin,
];
const EditorCanvas: FC<EditorCanvasProps> = ({ defaultValue, editor, editorData }) => {