{#if uploadingImage && images} { e.forEach((i) => { wrapSelection(`\n\n`, '') }) }} /> {/if} {#if label || customLabel} {#if label} {label} {:else if customLabel} {@render customLabel?.()} {/if} {/if} {#if previewing} {:else} {#if tools} wrapSelection('**', '**')} title="Bold" size="square-md" > wrapSelection('*', '*')} title="Italic" size="square-md" > wrapSelection('[', '](https://example.com)')} title="Link" size="square-md" > wrapSelection('\n# ', '')} title="Header" size="square-md" > wrapSelection('~~', '~~')} title="Strikethrough" size="square-md" > wrapSelection('\n> ', '')} title="Quote" size="square-md" > " wrapSelection('\n- ', '')} title="List" size="square-md" > wrapSelection('`', '`')} title="Code" size="square-md" > wrapSelection('::: spoiler \n', '\n:::')} title="Spoiler" size="square-md" > wrapSelection('~', '~')} title="Subscript" size="square-md" > X 1 wrapSelection('^', '^')} title="Superscript" size="square-md" > X 1 {#if images} (uploadingImage = !uploadingImage)} title="Image" size="square-md" > {/if} {/if} { if (disabled) return if (e.ctrlKey || e.metaKey) { // @ts-ignore let shortcut = shortcuts[e.code] if (shortcut) { e.preventDefault() shortcut?.(e) } } }} oninput={adjustHeight} onpaste={(e) => { if (!e.clipboardData?.files) return const files = Array.from(e.clipboardData.files) if (files[0]?.type.startsWith('image/')) { image = e.clipboardData.files[0] uploadingImage = true } }} {rows} {...rest} /> {/if} {#if previewButton} {#if previewButton} {/if} {@render children?.()} {/if}