Feat: add word and sentence counts for selected text

This commit is contained in:
hnd0hng
2026-09-27 18:11:27 +02:00
committed by yu-i-i
parent 79b145a852
commit f0ac2f4051
13 changed files with 1739 additions and 1 deletions
@@ -68,7 +68,17 @@ export const ToolbarMenuBar = () => {
type: 'command',
label: t('word_count_lower'),
disabled: !wordCountEnabled,
handler: () => {
handler: ({ location }) => {
if (location === 'menu-bar') {
const event = new Event('word-count:open-requested', {
cancelable: true,
})
if (!window.dispatchEvent(event)) {
return
}
}
setShowWordCountModal(true)
},
id: 'word_count',