frontend for xcvr appview

send after i tab

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