frontend for xcvr appview

send after i tab

+6 -9
+4 -3
src/lib/components/AutoGrowTextArea.svelte
··· 5 5 6 6 interface Props { 7 7 onBeforeInput?: (event: InputEvent) => void; 8 - onInput?: (event: InputEvent) => void; 8 + onInputEl?: (el: HTMLTextAreaElement) => void; 9 9 placeholder?: string; 10 10 value?: string; 11 11 maxlength?: number; ··· 18 18 onBeforeInput, 19 19 placeholder, 20 20 value = $bindable(""), 21 - onInput, 21 + onInputEl, 22 22 maxlength, 23 23 bold = false, 24 24 color, ··· 28 28 29 29 let inputEl: HTMLTextAreaElement; 30 30 function adjust(event: Event) { 31 - onInput?.(event as InputEvent); 31 + onInputEl?.(inputEl); 32 32 curemoji = checkAndSearch(); 33 33 } 34 34 ··· 110 110 inputEl.value.slice(0, curemoji[1]) + 111 111 curemoji[0] + 112 112 inputEl.value.slice(curemoji[2]); 113 + onInputEl?.(inputEl); 113 114 return; 114 115 } 115 116 }
+2 -6
src/lib/components/Transmitter.svelte
··· 35 35 }); 36 36 37 37 let color = $derived(numToHex(ctx.color)); 38 - const diffAndSend = (event: InputEvent) => { 39 - const el = event.target as HTMLInputElement; 40 - diffAndSendEl(el); 41 - }; 42 - const diffAndSendEl = (el: HTMLInputElement) => { 38 + const diffAndSendEl = (el: HTMLTextAreaElement) => { 43 39 const result = diff(message, el.value); 44 40 let idx = 0; 45 41 result.forEach((d) => { ··· 119 115 <AutoGrowTextArea 120 116 placeholder="start typing..." 121 117 onBeforeInput={bi} 122 - onInput={diffAndSend} 118 + onInputEl={diffAndSendEl} 123 119 maxlength={65535} 124 120 fs={isDesktop ? "2rem" : "1rem"} 125 121 />