mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-16 04:22:36 +00:00
feat: fork ink and make it work nicely
This commit is contained in:
parent
cb79018977
commit
8760faf991
139 changed files with 24952 additions and 140 deletions
23
ui-tui/packages/hermes-ink/src/ink/measure-element.ts
Normal file
23
ui-tui/packages/hermes-ink/src/ink/measure-element.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import type { DOMElement } from './dom.js'
|
||||
|
||||
type Output = {
|
||||
/**
|
||||
* Element width.
|
||||
*/
|
||||
width: number
|
||||
|
||||
/**
|
||||
* Element height.
|
||||
*/
|
||||
height: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Measure the dimensions of a particular `<Box>` element.
|
||||
*/
|
||||
const measureElement = (node: DOMElement): Output => ({
|
||||
width: node.yogaNode?.getComputedWidth() ?? 0,
|
||||
height: node.yogaNode?.getComputedHeight() ?? 0
|
||||
})
|
||||
|
||||
export default measureElement
|
||||
Loading…
Add table
Add a link
Reference in a new issue