{#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} {#if features.mediaLibrary}
{/if} {#if colorCommands.length > 0} { 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} {#if editor} {#if features.tables} {/if} {/if} {#if !editor}
Loading...
{/if}
focusEditor(editor, event)} onkeydown={(event) => { if (event.key === 'Enter' || event.key === ' ') { focusEditor(editor, event) } }} class="edra-editor" class:with-toolbar={showToolbar} style={`min-height: ${minHeight}px`} >
{#if editor} {/if}
{#if showMediaDropdown && features.mediaLibrary}
{/if} {#if showTextStyleDropdown} {/if} {#if showUrlConvertDropdown && features.urlEmbed} { showUrlConvertDropdown = false urlConvertPos = null }} /> {/if} {#if showLinkContextMenu && linkContextUrl} { showLinkContextMenu = false linkContextPos = null linkContextUrl = null }} /> {/if} {#if showLinkEditDialog} { showLinkEditDialog = false linkEditPos = null linkEditUrl = '' }} /> {/if} {#if mediaSelectionState.isOpen} {/if}