MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / element

Function element

graph-ui/src/galaxy/path-layer.test.ts:15–21  ·  view source on GitHub ↗
(host: HTMLElement, html: string, rect: ScreenRect)

Source from the content-addressed store, hash-verified

13
14const overlaps = (a: ScreenRect, b: ScreenRect) => !(a.right <= b.left || b.right <= a.left || a.bottom <= b.top || b.bottom <= a.top);
15function element(host: HTMLElement, html: string, rect: ScreenRect): HTMLElement {
16 host.insertAdjacentHTML('beforeend', html);
17 const added = host.lastElementChild as HTMLElement;
18 const target = added.querySelector('b') ?? added;
19 target.getBoundingClientRect = () => ({ ...rect, x: rect.left, y: rect.top, width: rect.right - rect.left, height: rect.bottom - rect.top, toJSON: () => ({}) });
20 return target;
21}
22
23afterEach(() => { document.body.innerHTML = ''; });
24

Callers 1

path-layer.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected