Skip to content

v1.1.0 - Source Location for Vanilla HTML

Choose a tag to compare

@nguyenvanduocit nguyenvanduocit released this 23 Jan 09:21
· 114 commits to master since this release

What's New

Source Location Injection for Vanilla HTML 馃幆

Now supports precise line number detection for vanilla HTML/JS projects - no framework required!

How it works:

  1. Vite plugin transforms HTML files during dev
  2. Injects data-source-loc attributes with file:line:column info
  3. Annotator reads these attributes to show exact source location
<!-- Before -->
<div class="container">
  <button>Click me</button>
</div>

<!-- After (dev mode) -->
<div class="container" data-source-loc="src/index.html:5:1">
  <button data-source-loc="src/index.html:6:3">Click me</button>
</div>

Configuration

// vite.config.ts
aiAnnotator({
  injectSourceLoc: true  // default: true
})

Improved Keyboard Handling

  • Follows industry standard patterns (LocatorJS, click-to-component)
  • No longer blocks all keyboard events during inspection
  • Allows typing in comment forms and page shortcuts to work

Dependencies

  • Added magic-string for efficient source transformation

Full Changelog: v1.0.2...v1.1.0