diff --git a/src/lib/components/chat/ChatControls.svelte b/src/lib/components/chat/ChatControls.svelte index 64fd8d92d3..ef2fea424d 100644 --- a/src/lib/components/chat/ChatControls.svelte +++ b/src/lib/components/chat/ChatControls.svelte @@ -13,7 +13,6 @@ import Overview from './Overview.svelte'; import EllipsisVertical from '../icons/EllipsisVertical.svelte'; import Artifacts from './Artifacts.svelte'; - import { min } from '@floating-ui/utils'; export let history; export let models = []; diff --git a/src/lib/components/common/RichTextInput.svelte b/src/lib/components/common/RichTextInput.svelte index 92cac174c2..6410bb77f4 100644 --- a/src/lib/components/common/RichTextInput.svelte +++ b/src/lib/components/common/RichTextInput.svelte @@ -499,7 +499,9 @@ TaskItem.configure({ nested: true }), - CharacterCount, + CharacterCount.configure({ + mode: 'nodeSize' + }), ...(autocomplete ? [ AIAutocompletion.configure({ diff --git a/src/lib/components/notes/NoteEditor.svelte b/src/lib/components/notes/NoteEditor.svelte index 0833b6a19a..020d14d3be 100644 --- a/src/lib/components/notes/NoteEditor.svelte +++ b/src/lib/components/notes/NoteEditor.svelte @@ -104,6 +104,9 @@ let files = []; let messages = []; + let wordCount = 0; + let charCount = 0; + let versionIdx = null; let selectedModelId = null; @@ -878,12 +881,12 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
{$i18n.t('{{count}} words', { - count: editor.storage.characterCount.words() + count: wordCount })}
{$i18n.t('{{count}} characters', { - count: editor.storage.characterCount.characters() + count: charCount })}
@@ -949,6 +952,11 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings, onChange={(content) => { note.data.content.html = content.html; note.data.content.md = content.md; + + if (editor) { + wordCount = editor.storage.characterCount.words(); + charCount = editor.storage.characterCount.characters(); + } }} />