editor?.chain().focus().toggleBold().run()} class={btnClass(editor?.isActive('bold') ?? false)} title="Bold (Ctrl+B)" data-testid="format-bold" >
editor?.chain().focus().toggleItalic().run()} class={btnClass(editor?.isActive('italic') ?? false)} title="Italic (Ctrl+I)" data-testid="format-italic" >
editor?.chain().focus().toggleStrike().run()} class={btnClass(editor?.isActive('strike') ?? false)} title="Strikethrough (Ctrl+Shift+X)" data-testid="format-strikethrough" >
editor?.chain().focus().toggleUnderline().run()} class={btnClass(editor?.isActive('underline') ?? false)} title="Underline (Ctrl+U)" data-testid="format-underline" >
toggleDropdown('heading')} class={dropdownBtnClass(editor?.isActive('heading') ?? false)} title="Heading" data-testid="format-heading" >
{#if openDropdown === 'heading'}
{ editor?.chain().focus().toggleHeading({ level: 1 }).run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive('heading', { level: 1 }) ?? false)} data-testid="format-h1" >
H1
Heading 1
{ editor?.chain().focus().toggleHeading({ level: 2 }).run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive('heading', { level: 2 }) ?? false)} data-testid="format-h2" >
H2
Heading 2
{ editor?.chain().focus().toggleHeading({ level: 3 }).run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive('heading', { level: 3 }) ?? false)} data-testid="format-h3" >
H3
Heading 3
{/if}
toggleDropdown('list')} class={dropdownBtnClass((editor?.isActive('bulletList') || editor?.isActive('orderedList')) ?? false)} title="Lists" data-testid="format-list" >
{#if openDropdown === 'list'}
{ editor?.chain().focus().toggleBulletList().run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive('bulletList') ?? false)} data-testid="format-bullet-list" >
Bullet list
{ editor?.chain().focus().toggleOrderedList().run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive('orderedList') ?? false)} data-testid="format-ordered-list" >
Ordered list
{/if}
toggleDropdown('link')} class={btnClass(editor?.isActive('link') ?? false)} title="Insert link (Ctrl+K)" data-testid="format-link" >
{#if openDropdown === 'link'}
{ e.preventDefault(); applyLink(); }} >
{/if}
toggleDropdown('more')} class={dropdownBtnClass(false)} title="More options" data-testid="format-more" >
{#if openDropdown === 'more'}
{ editor?.chain().focus().undo().run(); closeDropdowns(); }} disabled={!canUndo()} class={dropdownItemClass()} data-testid="format-undo" >
Undo
{ editor?.chain().focus().redo().run(); closeDropdowns(); }} disabled={!canRedo()} class={dropdownItemClass()} data-testid="format-redo" >
Redo
{ editor?.chain().focus().toggleCode().run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive('code') ?? false)} data-testid="format-code" >
Inline code
{ editor?.chain().focus().toggleBlockquote().run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive('blockquote') ?? false)} data-testid="format-blockquote" >
Blockquote
{ editor?.chain().focus().toggleCodeBlock().run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive('codeBlock') ?? false)} data-testid="format-code-block" >
Code block
{ editor?.chain().focus().setHorizontalRule().run(); closeDropdowns(); }} class={dropdownItemClass()} data-testid="format-hr" >
Divider
{ editor?.chain().focus().setTextAlign('left').run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive({ textAlign: 'left' }) ?? false)} data-testid="format-align-left" >
Align left
{ editor?.chain().focus().setTextAlign('center').run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive({ textAlign: 'center' }) ?? false)} data-testid="format-align-center" >
Align center
{ editor?.chain().focus().setTextAlign('right').run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive({ textAlign: 'right' }) ?? false)} data-testid="format-align-right" >
Align right
{ editor?.chain().focus().setTextAlign('justify').run(); closeDropdowns(); }} class={dropdownItemClass(editor?.isActive({ textAlign: 'justify' }) ?? false)} data-testid="format-align-justify" >
Justify
{/if}