npm / @embedpdf/plugin-selection
@embedpdf/plugin-selection
What changed in @embedpdf/plugin-selection 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-06.
17 breaking26 new APIs and options5 behavior and defaults1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@embedpdf/plugin-selection 349 changes
Breaking changes 17
Renames the drag setting to specify its unit in pixels.
Replaces menuAnchor with getAnchor and renames SelectionMenuAnchor to SelectionAnchor.
Replaces snapshot and now returns a reference-stable snapshot.
Replaces rectsForPage with listRects.
Replaces segmentsForPage with listSegments.
Replaces selectedPages with listSelectedPages.
Methods that return promises reject with not-ready when no document is available, consistently across frameworks.
Selection methods and related snapshots, endpoints, ranges, anchors, pointers, and selected-page results use page references.
Selection writes without doc.text.select now reject with permission-denied; unknown pages return not-found.
Requires doc.text.copy permission whether or not text is selected; a signal cancels the read immediately, while started page text is kept for the next read.
Requires its own doc.text.copy permission; a signal cancels the read immediately.
Replaces the abbreviated …Geom type names with SelectionHandleGeometry.
Replaces the abbreviated …Geom function names with selectionHandleGeometry().
Replaces beginAt with beginGestureAt.
Replaces ensurePage with ensureLoaded(page): Promise<void>.
The host gesture-state method is replaced as the public state API by isSelecting().
Pages now carries segments only; boxes are available as derived views through segment.rect and rectsForPage().
New APIs and options 26
Adds handle-arming behavior that records the grabbed point and starts the drag from the opposite end.
Adds a public geometry export for selection page geometry.
Adds a live selection color setting; null follows the viewer accent, with selected text shown at 35%.
Adds a public geometry export for converting a content point to PDF coordinates.
Adds a bundle-safe public contract entry for sibling features to use selection protocols without plugin wiring.
Adds a bundle-safe host contract entry for selection protocols.
Adds text selection independent of a framework, using engine text geometry and exposing highlight geometry through the shared interaction system.
Adds access to the selection range.
Adds access to current selection settings.
Adds live handle settings, including color and shadow.
Adds a kernel event hook emitted at gesture end and carrying the range.
Adds an event hook for selection setting changes.
Adds text extraction for a specified range.
Adds an API to reset selection settings.
The plugin is rewritten around the kernel create() controller hook and exposes a public contract and host lens.
Adds a configurable drag threshold in place of the hard-coded threshold.
Returns both selection endpoints or null.
Adds a handle view over a Stage.
Accepts configuration and registers live settings over SELECTION_DEFAULTS.
Declares selection state across frameworks with hasSelection, isSelecting, range, and pages.
Adds a named type for the selection state returned by the state hook.
Adds an API to select a page.
Adds a public geometry export for content segments.
Adds a public geometry export for content text quads.
Adds an API to update live selection settings across documents.
Returns the named SelectionState type.
Behavior and default changes 5
Makes selection extension available publicly; it was previously host-only.
Adds framework-independent handle geometry and drag policies that account for rotated text, rotated pages, and RTL selection boundaries.
Makes line-at-point selection available publicly; it was previously host-only.
Makes word-at-point selection available publicly; it was previously host-only.
Routes touch long-press selection through explicit gesture metadata, reports whether word or line selection succeeded, and supports optional feedback without swallowing unhandled gestures.
Fixes and other changes 1
Re-reads a page's text geometry after an annotation is flattened into it, making text added by a flattened free-text note selectable.