npm / @embedpdf/plugin-search
@embedpdf/plugin-search
What changed in @embedpdf/plugin-search 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-07.
15 breaking2 security22 new APIs and options3 behavior and defaults3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@embedpdf/plugin-search 345 changes
Breaking changes 15
Replaces activeIndex as the state field for the active hit index.
The state field is now named activeHitIndex.
highlight.blendMode uses engine-core's BlendMode instead of the SearchBlendMode copy.
findAll refuses a snippets request with permission-denied naming doc.text.copy, without asking the engine; search and findAll also require doc.text.search.
Lists pages with hits in document order, which changes when a page is moved.
Token methods that return promises reject with not-ready in every framework when no document is open, instead of throwing.
The progress event is now named onProgressChanged.
Replaces onProgress and carries hitCount, pagesSearched, and pageCount whenever progress changes.
refresh replaces rerun and resolves nothing; callers read results from state and events.
The search operation formerly named rerun is now named refresh.
search is awaitable and resolves with status and hitCount; it accepts a signal and a from page, and refuses without doc.text.search permission.
The duplicate type is gone; highlight.blendMode uses engine-core's BlendMode.
Replaces SearchPluginConfig as the search configuration type.
The configuration type is now named SearchConfig.
Declares search state for every framework, with activeHitIndex replacing activeIndex.
Security 2
Lets hosts gate search and snippet controls using the session's text-search and text-copy permissions.
Callers can request snippets with a boolean option; permission checks match whether result text will be returned.
New APIs and options 22
Search results expose a precomputed envelope that reveal passes directly to the stage.
Cancels search while keeping the hits found so far.
A bundle-safe entry exposes search token, query validation, results, and capability types without scan, effect, or plugin wiring.
Selects the starting page; it accepts a PageRef or index, and a page absent from the document causes search to reject with not-found.
Returns the hit count, optionally for a page identified by PageRef or index.
Reads live search settings.
Accepts a hit itself as well as its index; stale hits are matched by covered characters, while hits absent from current results return null without changing state.
Search live settings include highlight options color, activeColor, and blendMode.
Progress reports the total page count.
Search hits carry a PageRef, and hitsForPage and startPage take a PageRef.
Progress reports the number of pages searched.
Resets live search settings.
Search live settings include reveal options anchor and behavior.
Provides defaults over which searchPlugin registers live settings.
SearchMode is exported as a search type.
Registers live search settings over SEARCH_DEFAULTS, available before any document opens.
Names the search state type used by searchState and returned by useSearchState().
Search-hit geometry is represented as canonical TextSegment ranges, alongside a precomputed bounds envelope.
search, refresh, and findAll accept an AbortSignal; cancellation stops engine work on the running slice.
Search-hit ranges are exposed as start and count.
TextSegment is exported as a search type.
Updates live search settings across every document; reveal changes apply to the next nextHit().
Behavior and default changes 3
A search without from starts at the Stage's current page through its PageRef.
The rebuilt plugin uses budgeted engine search, converts result geometry to viewer coordinates, prioritizes visible pages, and reveals the active result through the stage.
Lists hits with an optional filter; a page argument can be a PageRef or index, and a deleted page returns an empty list.
Fixes and other changes 3
Search result character ranges can be passed to selection and markup flows without offset drift.
Search result character offsets stay aligned with selection character space for non-printing and supplementary-plane characters, avoiding offset drift in selection and markup flows.
Search follows the stage contract and reveals with reveal(ref).