{#if showToolbar && editor && !isLoading}
{#each Object.keys(filteredCommands).filter((key) => !excludedCommands.includes(key)) as keys} {@const groups = filteredCommands[keys].commands} {#each groups as command} {/each} {/each}
{ const color = editor.getAttributes('textStyle').color; const hasColor = editor.isActive('textStyle', { color }); if (hasColor) { editor.chain().focus().unsetColor().run(); } else { const color = prompt('Enter the color of the text:'); if (color !== null) { editor.chain().focus().setColor(color).run(); } } }} /> { const hasHightlight = editor.isActive('highlight'); if (hasHightlight) { editor.chain().focus().unsetHighlight().run(); } else { const color = prompt('Enter the color of the highlight:'); if (color !== null) { editor.chain().focus().setHighlight({ color }).run(); } } }} />
{/if} {#if editor} {#if showLinkBubbleMenu} {/if} {#if showTableBubbleMenu} {/if} {/if} {#if !editor}
Loading...
{/if}
focusEditor(editor, event)} onkeydown={(event) => { if (event.key === 'Enter' || event.key === ' ') { focusEditor(editor, event) } }} class="edra-editor" >
{#if showMediaDropdown}
{/if} {#if showTextStyleDropdown} {/if}