{"repo":"aidenybai/element-source","free":true,"listed":false,"github":"https://github.com/aidenybai/element-source","clone":"git clone https://github.com/aidenybai/element-source.git","description":"Get the source file location of any DOM element. Works with React, Vue, Svelte, Solid, Preact","language":"TypeScript","stars":445,"topics":["react","solid","source","svelte","vue","element-source"],"license":"MIT","category":"ui-components","readme_excerpt":"element-source Get the source file location of any DOM element. Works with React, Preact, Vue, Svelte, and Solid. I originally built this to power React Grab, a way to select elements in the browser and give the source as context to coding agents. Agents are incredibly good and token efficient at using file sources. Now anyone can use what makes React Grab possible. Installation If you're using Preact, import preact/debug in development so owner stacks and source locations are available. Quick Start Pass any DOM element to resolveElementInfo to get its source file location, component name, and full component stack. API resolveElementInfo(node: object): Promise Returns complete metadata: tag name, component name, source location, and full stack. resolveSource(node: object): Promise Returns the primary source location. resolveStack(node: object): Promise Returns the full stack of source frames (React + framework combined). resolveComponentName(node: object): Promise Returns the nearest user-defined component name. createSourceResolver(options?: ResolverOptions) Creates a resolver with custom framework resolvers. formatStackFrame(frame: ElementSourceInfo): string Formats a single source frame as a stack-trace-style string. formatStack(stack: ElementSourceInfo[], maxLines?: number): string Formats an array of source frames. getTagName(node: object): string Returns the tag name from any host instance. Handles DOM Element.tagName , Ink nodeName , and falls back to \"\" .","default_branch":null,"files":null,"tree":[],"storefront":"/r/aidenybai","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/aidenybai/element-source/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}