unstale

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

@unstale/cli on npm

@embedpdf/plugin-search 345 changes

Breaking changes 15

  • Replaces activeIndex as the state field for the active hit index.

    3.0.0release notes

  • The state field is now named activeHitIndex.

    3.0.0release notes

  • highlight.blendMode uses engine-core's BlendMode instead of the SearchBlendMode copy.

    3.0.0release notes

  • findAll refuses a snippets request with permission-denied naming doc.text.copy, without asking the engine; search and findAll also require doc.text.search.

    3.0.0release notes

  • Lists pages with hits in document order, which changes when a page is moved.

    3.0.0release notes

  • Token methods that return promises reject with not-ready in every framework when no document is open, instead of throwing.

    3.0.0release notes

  • The progress event is now named onProgressChanged.

    3.0.0release notes

  • Replaces onProgress and carries hitCount, pagesSearched, and pageCount whenever progress changes.

    3.0.0release notes

  • refresh replaces rerun and resolves nothing; callers read results from state and events.

    3.0.0release notes

  • The search operation formerly named rerun is now named refresh.

    3.0.0release notes

  • search is awaitable and resolves with status and hitCount; it accepts a signal and a from page, and refuses without doc.text.search permission.

    3.0.0release notes

  • The duplicate type is gone; highlight.blendMode uses engine-core's BlendMode.

    3.0.0release notes

  • Replaces SearchPluginConfig as the search configuration type.

    3.0.0release notes

  • The configuration type is now named SearchConfig.

    3.0.0release notes

  • Declares search state for every framework, with activeHitIndex replacing activeIndex.

    3.0.0release notes

Security 2

  • Lets hosts gate search and snippet controls using the session's text-search and text-copy permissions.

    3.0.0release notes

  • Callers can request snippets with a boolean option; permission checks match whether result text will be returned.

    3.0.0release notes

New APIs and options 22

  • Search results expose a precomputed envelope that reveal passes directly to the stage.

    3.0.0release notes

  • Cancels search while keeping the hits found so far.

    3.0.0release notes

  • A bundle-safe entry exposes search token, query validation, results, and capability types without scan, effect, or plugin wiring.

    3.0.0release notes

  • Selects the starting page; it accepts a PageRef or index, and a page absent from the document causes search to reject with not-found.

    3.0.0release notes

  • Returns the hit count, optionally for a page identified by PageRef or index.

    3.0.0release notes

  • Reads live search settings.

    3.0.0release notes

  • 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.

    3.0.0release notes

  • Search live settings include highlight options color, activeColor, and blendMode.

    3.0.0release notes

  • Progress reports the total page count.

    3.0.0release notes

  • Search hits carry a PageRef, and hitsForPage and startPage take a PageRef.

    3.0.0release notes

  • Progress reports the number of pages searched.

    3.0.0release notes

  • Resets live search settings.

    3.0.0release notes

  • Search live settings include reveal options anchor and behavior.

    3.0.0release notes

  • Provides defaults over which searchPlugin registers live settings.

    3.0.0release notes

  • SearchMode is exported as a search type.

    3.0.0release notes

  • Registers live search settings over SEARCH_DEFAULTS, available before any document opens.

    3.0.0release notes

  • Names the search state type used by searchState and returned by useSearchState().

    3.0.0release notes

  • Search-hit geometry is represented as canonical TextSegment ranges, alongside a precomputed bounds envelope.

    3.0.0release notes

  • search, refresh, and findAll accept an AbortSignal; cancellation stops engine work on the running slice.

    3.0.0release notes

  • Search-hit ranges are exposed as start and count.

    3.0.0release notes

  • TextSegment is exported as a search type.

    3.0.0release notes

  • Updates live search settings across every document; reveal changes apply to the next nextHit().

    3.0.0release notes

Behavior and default changes 3

  • A search without from starts at the Stage's current page through its PageRef.

    3.0.0release notes

  • The rebuilt plugin uses budgeted engine search, converts result geometry to viewer coordinates, prioritizes visible pages, and reveals the active result through the stage.

    3.0.0release notes

  • Lists hits with an optional filter; a page argument can be a PageRef or index, and a deleted page returns an empty list.

    3.0.0release notes

Fixes and other changes 3

  • Search result character ranges can be passed to selection and markup flows without offset drift.

    3.0.0release notes

  • 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.

    3.0.0release notes

  • Search follows the stage contract and reveals with reveal(ref).

    3.0.0release notes