
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
@pie-players/pie-tool-annotation-toolbar
Advanced tools
Text annotation toolbar with highlighting and underlining for PIE assessment player
A text selection toolbar for highlighting and annotating text in the PIEoneer assessment player. Uses modern CSS Custom Highlight API for zero DOM mutation and optimal performance.
<span> wrappers)<script>
// Imports and registers <pie-tool-annotation-toolbar>.
import '@pie-players/pie-tool-annotation-toolbar';
</script>
<!-- Toolbar appears automatically when text is selected -->
<pie-tool-annotation-toolbar />
This component doesn't take props - it automatically shows when text is selected and hides when selection is cleared or Escape is pressed.
Text-to-Speech (Read Aloud) button does not emit an event - it directly uses the TTS service to read the selected text.
The annotation toolbar integrates with PIE's shared highlight infrastructure:
Requires CSS Custom Highlight API support:
For unsupported browsers, the component gracefully degrades (no highlights shown).
Annotations are automatically saved to sessionStorage and restored on page load. The storage key includes the current URL path to scope annotations to specific content.
Storage format:
{
"annotation-highlight-yellow-1234567890": {
startContainer: ["body", "div", "p", "#text"],
startOffset: 10,
endContainer: ["body", "div", "p", "#text"],
endOffset: 20,
text: "highlighted text"
}
}
Annotations are automatically cleared when:
The annotation toolbar includes a "Read" button that uses the TTS service to read selected text aloud with word-level highlighting.
The toolbar uses ttsService.speakRange() instead of ttsService.speak() to ensure accurate word highlighting:
// speakRange() calculates text offset for accurate highlighting
await ttsService.speakRange(selectedRange, {
rate: 1.0,
highlightWords: true
}, {
onEnd: () => ttsSpeaking = false,
onError: (err) => ttsSpeaking = false
});
Why this matters:
speak(text) would highlight from the beginning of the container (wrong)speakRange(range) highlights the exact selected text (correct)This implementation is inspired by production annotation toolbar patterns but uses modern 2025 web standards:
FAQs
Text annotation toolbar with highlighting and underlining for PIE assessment player
We found that @pie-players/pie-tool-annotation-toolbar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.