{ if (inputFiles && inputFiles.length > 0) { inputFilesHandler(Array.from(inputFiles)); } else { toast.error($i18n.t(`File not found.`)); } filesInputElement.value = ''; }} />
{#if scrollEnd === false}
{/if}
{#if typingUsers.length > 0}
{typingUsers.map((user) => user.name).join(', ')} {$i18n.t('is typing...')}
{/if}
{#if recording} { recording = false; await tick(); document.getElementById(`chat-input-${id}`)?.focus(); }} on:confirm={async (e) => { const { text, filename } = e.detail; content = `${content}${text} `; recording = false; await tick(); document.getElementById(`chat-input-${id}`)?.focus(); }} /> {:else}
{ submitHandler(); }} >
{#if files.length > 0}
{#each files as file, fileIdx} {#if file.type === 'image'}
input
{:else} { files.splice(fileIdx, 1); files = files; }} on:click={() => { console.log(file); }} /> {/if} {/each}
{/if}
{ filesInputElement.click(); }} >
0 || navigator.msMaxTouchPoints > 0 )} {placeholder} largeTextAsFile={$settings?.largeTextAsFile ?? false} on:keydown={async (e) => { e = e.detail.event; const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac if ( !$mobile || !( 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 ) ) { // Prevent Enter key from creating a new line // Uses keyCode '13' for Enter key for chinese/japanese keyboards if (e.keyCode === 13 && !e.shiftKey) { e.preventDefault(); } // Submit the content when Enter key is pressed if (content !== '' && e.keyCode === 13 && !e.shiftKey) { submitHandler(); } } if (e.key === 'Escape') { console.log('Escape'); } }} on:paste={async (e) => { e = e.detail.event; console.log(e); }} />
{#if content === ''} {/if}
{/if}