chore: update vite.config.ts and IMEditor dependencies

This commit is contained in:
ZhenYi 2026-04-25 20:09:50 +08:00
parent 881fbdb6ea
commit 963e3ee299
2 changed files with 5 additions and 5 deletions

View File

@ -31,6 +31,8 @@ export interface IMEditorProps {
};
onUploadFile?: (file: File) => Promise<{ id: string; url: string }>;
placeholder?: string;
/** Called whenever the editor content changes (on every keystroke) */
onUpdate?: (text: string) => void;
}
export interface IMEditorHandle {
@ -321,7 +323,7 @@ function MentionDropdown({
// ─── Main Component ────────────────────────────────────────────────────────────
export const IMEditor = forwardRef<IMEditorHandle, IMEditorProps>(function IMEditor(
{replyingTo, onCancelReply, onSend, mentionItems, onUploadFile, placeholder = 'Message…'},
{replyingTo, onCancelReply, onSend, mentionItems, onUploadFile, placeholder = 'Message…', onUpdate},
ref,
) {
const {resolvedTheme} = useTheme();
@ -559,6 +561,7 @@ export const IMEditor = forwardRef<IMEditorHandle, IMEditorProps>(function IMEdi
} else {
setMentionOpen(false);
}
onUpdate?.(text);
},
onFocus: () => setFocused(true),
onBlur: () => setFocused(false),

View File

@ -14,9 +14,7 @@ export default defineConfig({
'react-dom',
'react-router-dom',
],
exclude: [
// Exclude local Rust compilation artifacts - not npm packages
]
exclude: []
},
resolve: {
alias: {
@ -26,7 +24,6 @@ export default defineConfig({
build: {
rolldownOptions: {
external: [
// Use forward slashes for cross-platform compatibility
'libs/',
'target/',
],