({ elem, model }: { elem: VDomElem; model: TsunamiModel })
| 294 | } |
| 295 | |
| 296 | function WaveTerm({ elem, model }: { elem: VDomElem; model: TsunamiModel }) { |
| 297 | const props = useVDom(model, elem); |
| 298 | const hasOnData = props.onData != null; |
| 299 | const onData = React.useCallback( |
| 300 | (data: string | null, termsize: VDomTermSize | null) => { |
| 301 | const terminput: VDomTermInputData = {}; |
| 302 | if (data != null) { |
| 303 | terminput.data = data; |
| 304 | } |
| 305 | if (termsize != null) { |
| 306 | terminput.termsize = termsize; |
| 307 | } |
| 308 | const event: VDomEvent = { |
| 309 | waveid: elem.waveid, |
| 310 | eventtype: "onData", |
| 311 | terminput: terminput, |
| 312 | }; |
| 313 | sendTermInputEvent(event).catch((error) => { |
| 314 | console.error("Failed to send terminal input:", error); |
| 315 | }); |
| 316 | }, |
| 317 | [elem.waveid] |
| 318 | ); |
| 319 | const termProps = { ...props, onData: hasOnData ? onData : undefined }; |
| 320 | return <TsunamiTerm {...termProps} />; |
| 321 | } |
| 322 | |
| 323 | function StyleTag({ elem, model }: { elem: VDomElem; model: TsunamiModel }) { |
| 324 | const styleText = getTextChildren(elem); |
nothing calls this directly
no test coverage detected