You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
npm DocxSession find-by surface (issue #171). The TypeScript wrapper at npm/src/session.ts now exposes the six DocxSession methods whose bridge shells landed in #168 but were unreachable from the typed API: exists, findByText, findAllByText, findByRegex, and findByKind (replaceMatch was already present). New FindOptions type in npm/src/types.ts (ignoreCase / ignoreWhitespace / kindFilter / scopes / scopeFilter, matching the .NET FindOptions record), and the corresponding Exists / FindByText / FindAllByText / FindByRegex / FindByKind signatures added to the DocxSessionBridge exports interface. Wire shapes are byte-identical to what tools/python-host consumes, preserving the cross-transport parity invariant. Tests: npm/tests/find-by.spec.ts exercises the typed wrapper (via a new window.Docxodus.openTypedSession harness helper backed by an IIFE-bundled session.ts), covering case-sensitive/insensitive text search, broad-pattern regex, kind+scope filtering, existence probes, and the grep → replaceMatch round-trip.
Fixed
Python FindOptions scope filtering was a silent no-op. In docx_scalpel, FindOptions exposed a single scope_filter: ProjectionScopes field and serialized it as an int under the scopeFilter wire key. But the stdio host (and WASM bridge) parse scopeFilter as a string (a single named part like "hdr1") and read the coarse ProjectionScopes flag set from a separate scopes (number) key — which the wrapper never emitted. The net effect: find_by_text / find_all_by_text / find_by_regex ignored any scope restriction passed from Python and always searched all scopes. FindOptions now mirrors the .NET record's two distinct controls: scopes: ProjectionScopes | None (coarse category flag set → wire scopes, int) and scope_filter: str | None (fine named-part post-filter → wire scopeFilter, string). API change:scope_filter is now a str (was ProjectionScopes); callers that want category filtering should use the new scopes field (e.g. FindOptions(scopes=ProjectionScopes.HEADERS | ProjectionScopes.FOOTERS)). Tests: python/tests/test_find_options_scopes.py pins the wire mapping and verifies scopes=ProjectionScopes.BODY actually drops a footnote-scope hit on HC031.