Skip to content

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 02 Oct 05:36
· 168 commits to main since this release

Patch Changes

  • Security & accessibility hardening — all improvements are backwards-compatible.

    Security

    • ReDoS fix: SVG attribute reading now uses pre-compiled RegExp objects instead of runtime-constructed ones — eliminates catastrophic backtracking risk on untrusted SVG markup
    • Resource leak fix: withDeadline (SVG/DOM capture) now aborts its internal AbortController on task completion, stopping downstream cooperative work from running after the result is already settled
    • Async source guard: passing an async function (returning a Promise) as the copy source now fails immediately with a clear invalid-payload error instead of silently breaking the user-gesture window required for clipboard writes

    Accessibility (WCAG)

    • Live region role: LiveRegion now uses role="status" for all politeness levels instead of role="alert" for assertive — role="alert" interrupts any sentence currently being spoken, which is inappropriate for copy feedback (WCAG 4.1.3)
    • Mount-safe announcements: the live region no longer writes its initial message as React children — it writes imperatively via a ref after mount, preventing spurious announcements on SSR hydration and strict-mode double-mounts in JAWS / NVDA
    • Non-text payload labels: CopyField.Value now renders a human-readable description for non-text payloads so screen-reader users know what will be copied: html → "Rich text", image → "Image", json → "JSON data", multi → "Mixed content"
    • Accessible name guard: CopyField.Trigger now guarantees a non-empty aria-label even if a custom triggerLabel message returns an empty string

    Robustness

    • Ghost state eliminated: in PasteMachine, option-resolution errors now transition directly to error without briefly passing through reading — observers no longer see a spurious intermediate state

    Performance

    • useMediaQuery caching: the MediaQueryList object is now cached in a ref and reused across renders; matchMedia() is called only when the query string changes, avoiding repeated parse/layout work on every render