@silurus/ooxml 0.74.3 → 0.74.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ interface MathRenderer {
29
29
  mathMLToSvg(mathml: string): Promise<MathSvg>;
30
30
  }
31
31
  //#endregion
32
- //#region dist/.types-work/find-match-BE0QHHzK.d.ts
32
+ //#region dist/.types-work/find-highlight-B8ft6Y0g.d.ts
33
33
  //#region packages/core/src/types/math.d.ts
34
34
  type MathStyle = 'roman' | 'italic' | 'bold' | 'boldItalic';
35
35
  interface MathRun {
@@ -1329,7 +1329,22 @@ interface FindMatch<Loc = unknown> {
1329
1329
  location: Loc;
1330
1330
  }
1331
1331
  //#endregion
1332
- //#region dist/.types-work/docx-Cyc_gyvZ.d.ts
1332
+ //#region packages/core/src/search/find-highlight.d.ts
1333
+ /**
1334
+ * CSS colours used by in-document search overlays.
1335
+ *
1336
+ * The values are applied as the overlay backgrounds verbatim. Use an alpha
1337
+ * colour (`rgba(...)`, 8-digit hex, or `color-mix(...)`) when the rendered text
1338
+ * should remain visible through the highlight.
1339
+ */
1340
+ interface FindHighlightColors {
1341
+ /** Background for every match except the active one. */
1342
+ match?: string;
1343
+ /** Background for the match selected by findNext/findPrev. */
1344
+ active?: string;
1345
+ }
1346
+ //#endregion
1347
+ //#region dist/.types-work/docx-BatSd3II.d.ts
1333
1348
  //#region packages/docx/src/types.d.ts
1334
1349
  interface DocxDocumentModel {
1335
1350
  section: SectionProps;
@@ -3072,6 +3087,8 @@ interface DocxViewerOptions extends RenderPageOptions, LoadOptions {
3072
3087
  * browser's native text selection works on document content.
3073
3088
  */
3074
3089
  enableTextSelection?: boolean;
3090
+ /** CSS backgrounds for ordinary and active in-document search matches. */
3091
+ findHighlightColors?: FindHighlightColors;
3075
3092
  /** Called when a page finishes rendering. */
3076
3093
  onPageChange?: (index: number, total: number) => void;
3077
3094
  /** IX9 zoom contract ({@link ZoomableViewer}) — the clamp range for
@@ -3366,12 +3383,21 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
3366
3383
  * shipped back beside the page bitmap, so the overlay is populated identically
3367
3384
  * to main mode (no more empty overlay / one-time warning). */
3368
3385
  enableTextSelection?: boolean;
3386
+ /** CSS backgrounds for ordinary and active in-document search matches. */
3387
+ findHighlightColors?: FindHighlightColors;
3369
3388
  /** Minimum zoom scale (px-per-pt multiplier floor). Default 0.1. */
3370
3389
  zoomMin?: number;
3371
3390
  /** Maximum zoom scale. Default 4. */
3372
3391
  zoomMax?: number;
3373
3392
  /** Enable `Ctrl`/`Cmd`+wheel zoom. Default true. */
3374
3393
  enableZoom?: boolean;
3394
+ /**
3395
+ * Re-fit the document to the container width when the container is resized.
3396
+ * Default true. Set false to preserve the current absolute scale, including
3397
+ * an explicit pre-load `setScale(1)`, independently of the viewport width.
3398
+ * Explicit `fitWidth()` and `fitPage()` calls remain available.
3399
+ */
3400
+ refitOnResize?: boolean;
3375
3401
  /**
3376
3402
  * CSS `background` shorthand for the scroll surface (the "desk") visible
3377
3403
  * behind and between pages — the gray a PDF reader paints around the sheet.
@@ -3410,8 +3436,9 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
3410
3436
  /** IX9 — fires whenever the zoom factor actually changes (`1` = 100% = a page
3411
3437
  * at its natural pt→px size): from {@link DocxScrollViewer.setScale},
3412
3438
  * `zoomIn`/`zoomOut`, `fitWidth`/`fitPage`, a Ctrl/⌘+wheel gesture, or a
3413
- * container-resize re-fit. Named `onScaleChange` to match the single-canvas
3414
- * viewers so all five share one notification shape. */
3439
+ * container-resize re-fit (when `refitOnResize` is enabled). Named
3440
+ * `onScaleChange` to match the single-canvas viewers so all five share one
3441
+ * notification shape. */
3415
3442
  onScaleChange?: (scale: number) => void;
3416
3443
  /** IX1 (design decision — NOT user-confirmed, integrator may veto). Called when
3417
3444
  * a hyperlink run is clicked. When omitted, the default is: external → open in a
@@ -3557,6 +3584,8 @@ declare class DocxScrollViewer implements ZoomableViewer {
3557
3584
  * `_settleSlot`) so a recycled/re-mounted slot and a settle-swapped spare all
3558
3585
  * carry it. */
3559
3586
  private readonly _pageShadow;
3587
+ private readonly _find;
3588
+ private _findActive;
3560
3589
  constructor(container: HTMLElement, opts?: DocxScrollViewerOptions);
3561
3590
  /**
3562
3591
  * Load a DOCX from URL or ArrayBuffer and render the first window.
@@ -3847,6 +3876,20 @@ declare class DocxScrollViewer implements ZoomableViewer {
3847
3876
  scrollToPage(index: number, opts?: {
3848
3877
  behavior?: 'auto' | 'smooth';
3849
3878
  }): void;
3879
+ /** Search the complete document, including pages outside the virtualized
3880
+ * mounted window. Matching is case-insensitive by default. */
3881
+ findText(query: string, opts?: FindMatchesOptions): Promise<FindMatch<DocxMatchLocation>[]>;
3882
+ /** Activate and reveal the next match, wrapping at the end. */
3883
+ findNext(): Promise<FindMatch<DocxMatchLocation> | null>;
3884
+ /** Activate and reveal the previous match, wrapping at the beginning. */
3885
+ findPrev(): Promise<FindMatch<DocxMatchLocation> | null>;
3886
+ /** Clear the current query and every mounted highlight. */
3887
+ clearFind(): void;
3888
+ private _activateMatch;
3889
+ private _collectPageRuns;
3890
+ private _redrawHighlights;
3891
+ private _refreshFindRuns;
3892
+ private _redrawSlotHighlights;
3850
3893
  /**
3851
3894
  * Re-fit the base scale on a container resize while PRESERVING the current zoom
3852
3895
  * multiplier (design §11), then re-anchor + re-render. A `ResizeObserver` fires
@@ -3938,12 +3981,8 @@ interface DocxHighlightMatch {
3938
3981
  slices: MatchRunSlice[];
3939
3982
  active: boolean;
3940
3983
  }
3941
- interface DocxHighlightColors {
3942
- /** Fill for non-active matches. */
3943
- match?: string;
3944
- /** Fill for the active match. */
3945
- active?: string;
3946
- }
3984
+ /** Format-specific compatibility alias for the shared colour contract. */
3985
+ type DocxHighlightColors = FindHighlightColors;
3947
3986
  /**
3948
3987
  * Populate a highlight overlay layer with one box per matched run-slice.
3949
3988
  *
@@ -3965,4 +4004,4 @@ interface DocxHighlightColors {
3965
4004
  */
3966
4005
  declare function buildDocxHighlightLayer(layer: HTMLDivElement, runs: DocxTextRunInfo[], matches: DocxHighlightMatch[], cssWidth: number, cssHeight: number, measureForFont: (font: string) => (s: string) => number, colors?: DocxHighlightColors): void;
3967
4006
  //#endregion
3968
- export { type AnchorHostMetrics, type AutoResizeOptions, type BodyElement, type BorderSpec, type CellBorders, type CellElement, type ChartRun, type ColSpec, type ColumnsSpec, type DocComment, type DocNote, type DocParagraph, type DocRevision, type DocRun, type DocSettings, type DocTable, type DocTableCell, type DocTableRow, DocxDocument, type DocxDocumentModel, type DocxHighlightColors, type DocxHighlightMatch, type DocxMatchLocation, type DocxRunBorder, DocxScrollViewer, type DocxScrollViewerOptions, type DocxTextRun, type DocxTextRunInfo, DocxViewer, type DocxViewerOptions, type EmbeddedFontRef, type FieldRun, type FindMatch, type FindMatchesOptions, type FramePr, type GradientStop, type HeaderFooter, type HeadersFooters, type HyperlinkTarget, type ImageRun, type LineEnd, type LineNumbering, type LineSpacing, type LoadOptions, type NoteRef, type NumberingInfo, OoxmlError, type OoxmlErrorCode, type PTabRun, type PageBorderEdge, type PageBorders, type PageNumType, type ParaBorderEdge, type ParagraphBorders, type PathCmd, type RenderPageOptions, type RenderPageToBitmapOptions, type RubyAnnotation, type RunRevision, type SectionGeom, type SectionProps, type ShapeRun, type ShapeText, type ShapeTextRun, type TabStop, type TableBorders, type TblpPr, type TextPath, type WireRenderPageOptions, autoResize, buildDocxHighlightLayer, buildDocxTextLayer, noteText, openExternalHyperlink };
4007
+ export { type AnchorHostMetrics, type AutoResizeOptions, type BodyElement, type BorderSpec, type CellBorders, type CellElement, type ChartRun, type ColSpec, type ColumnsSpec, type DocComment, type DocNote, type DocParagraph, type DocRevision, type DocRun, type DocSettings, type DocTable, type DocTableCell, type DocTableRow, DocxDocument, type DocxDocumentModel, type DocxHighlightColors, type DocxHighlightMatch, type DocxMatchLocation, type DocxRunBorder, DocxScrollViewer, type DocxScrollViewerOptions, type DocxTextRun, type DocxTextRunInfo, DocxViewer, type DocxViewerOptions, type EmbeddedFontRef, type FieldRun, type FindHighlightColors, type FindMatch, type FindMatchesOptions, type FramePr, type GradientStop, type HeaderFooter, type HeadersFooters, type HyperlinkTarget, type ImageRun, type LineEnd, type LineNumbering, type LineSpacing, type LoadOptions, type NoteRef, type NumberingInfo, OoxmlError, type OoxmlErrorCode, type PTabRun, type PageBorderEdge, type PageBorders, type PageNumType, type ParaBorderEdge, type ParagraphBorders, type PathCmd, type RenderPageOptions, type RenderPageToBitmapOptions, type RubyAnnotation, type RunRevision, type SectionGeom, type SectionProps, type ShapeRun, type ShapeText, type ShapeTextRun, type TabStop, type TableBorders, type TblpPr, type TextPath, type WireRenderPageOptions, autoResize, buildDocxHighlightLayer, buildDocxTextLayer, noteText, openExternalHyperlink };
@@ -29,7 +29,7 @@ interface MathRenderer {
29
29
  mathMLToSvg(mathml: string): Promise<MathSvg>;
30
30
  }
31
31
  //#endregion
32
- //#region dist/.types-work/find-match-BE0QHHzK.d.ts
32
+ //#region dist/.types-work/find-highlight-B8ft6Y0g.d.ts
33
33
  //#region packages/core/src/types/math.d.ts
34
34
  type MathStyle = 'roman' | 'italic' | 'bold' | 'boldItalic';
35
35
  interface MathRun {
@@ -1329,7 +1329,22 @@ interface FindMatch<Loc = unknown> {
1329
1329
  location: Loc;
1330
1330
  }
1331
1331
  //#endregion
1332
- //#region dist/.types-work/docx-Cyc_gyvZ.d.ts
1332
+ //#region packages/core/src/search/find-highlight.d.ts
1333
+ /**
1334
+ * CSS colours used by in-document search overlays.
1335
+ *
1336
+ * The values are applied as the overlay backgrounds verbatim. Use an alpha
1337
+ * colour (`rgba(...)`, 8-digit hex, or `color-mix(...)`) when the rendered text
1338
+ * should remain visible through the highlight.
1339
+ */
1340
+ interface FindHighlightColors {
1341
+ /** Background for every match except the active one. */
1342
+ match?: string;
1343
+ /** Background for the match selected by findNext/findPrev. */
1344
+ active?: string;
1345
+ }
1346
+ //#endregion
1347
+ //#region dist/.types-work/docx-BatSd3II.d.ts
1333
1348
  //#region packages/docx/src/types.d.ts
1334
1349
  interface DocxDocumentModel {
1335
1350
  section: SectionProps;
@@ -3072,6 +3087,8 @@ interface DocxViewerOptions extends RenderPageOptions, LoadOptions$2 {
3072
3087
  * browser's native text selection works on document content.
3073
3088
  */
3074
3089
  enableTextSelection?: boolean;
3090
+ /** CSS backgrounds for ordinary and active in-document search matches. */
3091
+ findHighlightColors?: FindHighlightColors;
3075
3092
  /** Called when a page finishes rendering. */
3076
3093
  onPageChange?: (index: number, total: number) => void;
3077
3094
  /** IX9 zoom contract ({@link ZoomableViewer}) — the clamp range for
@@ -3366,12 +3383,21 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
3366
3383
  * shipped back beside the page bitmap, so the overlay is populated identically
3367
3384
  * to main mode (no more empty overlay / one-time warning). */
3368
3385
  enableTextSelection?: boolean;
3386
+ /** CSS backgrounds for ordinary and active in-document search matches. */
3387
+ findHighlightColors?: FindHighlightColors;
3369
3388
  /** Minimum zoom scale (px-per-pt multiplier floor). Default 0.1. */
3370
3389
  zoomMin?: number;
3371
3390
  /** Maximum zoom scale. Default 4. */
3372
3391
  zoomMax?: number;
3373
3392
  /** Enable `Ctrl`/`Cmd`+wheel zoom. Default true. */
3374
3393
  enableZoom?: boolean;
3394
+ /**
3395
+ * Re-fit the document to the container width when the container is resized.
3396
+ * Default true. Set false to preserve the current absolute scale, including
3397
+ * an explicit pre-load `setScale(1)`, independently of the viewport width.
3398
+ * Explicit `fitWidth()` and `fitPage()` calls remain available.
3399
+ */
3400
+ refitOnResize?: boolean;
3375
3401
  /**
3376
3402
  * CSS `background` shorthand for the scroll surface (the "desk") visible
3377
3403
  * behind and between pages — the gray a PDF reader paints around the sheet.
@@ -3410,8 +3436,9 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
3410
3436
  /** IX9 — fires whenever the zoom factor actually changes (`1` = 100% = a page
3411
3437
  * at its natural pt→px size): from {@link DocxScrollViewer.setScale},
3412
3438
  * `zoomIn`/`zoomOut`, `fitWidth`/`fitPage`, a Ctrl/⌘+wheel gesture, or a
3413
- * container-resize re-fit. Named `onScaleChange` to match the single-canvas
3414
- * viewers so all five share one notification shape. */
3439
+ * container-resize re-fit (when `refitOnResize` is enabled). Named
3440
+ * `onScaleChange` to match the single-canvas viewers so all five share one
3441
+ * notification shape. */
3415
3442
  onScaleChange?: (scale: number) => void;
3416
3443
  /** IX1 (design decision — NOT user-confirmed, integrator may veto). Called when
3417
3444
  * a hyperlink run is clicked. When omitted, the default is: external → open in a
@@ -3557,6 +3584,8 @@ declare class DocxScrollViewer implements ZoomableViewer {
3557
3584
  * `_settleSlot`) so a recycled/re-mounted slot and a settle-swapped spare all
3558
3585
  * carry it. */
3559
3586
  private readonly _pageShadow;
3587
+ private readonly _find;
3588
+ private _findActive;
3560
3589
  constructor(container: HTMLElement, opts?: DocxScrollViewerOptions);
3561
3590
  /**
3562
3591
  * Load a DOCX from URL or ArrayBuffer and render the first window.
@@ -3847,6 +3876,20 @@ declare class DocxScrollViewer implements ZoomableViewer {
3847
3876
  scrollToPage(index: number, opts?: {
3848
3877
  behavior?: 'auto' | 'smooth';
3849
3878
  }): void;
3879
+ /** Search the complete document, including pages outside the virtualized
3880
+ * mounted window. Matching is case-insensitive by default. */
3881
+ findText(query: string, opts?: FindMatchesOptions): Promise<FindMatch<DocxMatchLocation>[]>;
3882
+ /** Activate and reveal the next match, wrapping at the end. */
3883
+ findNext(): Promise<FindMatch<DocxMatchLocation> | null>;
3884
+ /** Activate and reveal the previous match, wrapping at the beginning. */
3885
+ findPrev(): Promise<FindMatch<DocxMatchLocation> | null>;
3886
+ /** Clear the current query and every mounted highlight. */
3887
+ clearFind(): void;
3888
+ private _activateMatch;
3889
+ private _collectPageRuns;
3890
+ private _redrawHighlights;
3891
+ private _refreshFindRuns;
3892
+ private _redrawSlotHighlights;
3850
3893
  /**
3851
3894
  * Re-fit the base scale on a container resize while PRESERVING the current zoom
3852
3895
  * multiplier (design §11), then re-anchor + re-render. A `ResizeObserver` fires
@@ -3938,12 +3981,8 @@ interface DocxHighlightMatch {
3938
3981
  slices: MatchRunSlice[];
3939
3982
  active: boolean;
3940
3983
  }
3941
- interface DocxHighlightColors {
3942
- /** Fill for non-active matches. */
3943
- match?: string;
3944
- /** Fill for the active match. */
3945
- active?: string;
3946
- }
3984
+ /** Format-specific compatibility alias for the shared colour contract. */
3985
+ type DocxHighlightColors = FindHighlightColors;
3947
3986
  /**
3948
3987
  * Populate a highlight overlay layer with one box per matched run-slice.
3949
3988
  *
@@ -3965,10 +4004,10 @@ interface DocxHighlightColors {
3965
4004
  */
3966
4005
  declare function buildDocxHighlightLayer(layer: HTMLDivElement, runs: DocxTextRunInfo[], matches: DocxHighlightMatch[], cssWidth: number, cssHeight: number, measureForFont: (font: string) => (s: string) => number, colors?: DocxHighlightColors): void;
3967
4006
  declare namespace docx_d_exports {
3968
- export { AnchorHostMetrics, AutoResizeOptions, BodyElement, BorderSpec, CellBorders, CellElement, ChartRun, ColSpec, ColumnsSpec, DocComment, DocNote, DocParagraph, DocRevision, DocRun, DocSettings, DocTable, DocTableCell, DocTableRow, DocxDocument, DocxDocumentModel, DocxHighlightColors, DocxHighlightMatch, DocxMatchLocation, DocxRunBorder, DocxScrollViewer, DocxScrollViewerOptions, DocxTextRun, DocxTextRunInfo, DocxViewer, DocxViewerOptions, EmbeddedFontRef, FieldRun, FindMatch, FindMatchesOptions, FramePr, GradientStop$1 as GradientStop, HeaderFooter, HeadersFooters, HyperlinkTarget, ImageRun, LineEnd, LineNumbering, LineSpacing, LoadOptions$2 as LoadOptions, NoteRef, NumberingInfo, OoxmlError, OoxmlErrorCode, PTabRun, PageBorderEdge, PageBorders, PageNumType, ParaBorderEdge, ParagraphBorders, PathCmd$2 as PathCmd, RenderPageOptions, RenderPageToBitmapOptions, RubyAnnotation, RunRevision, SectionGeom, SectionProps, ShapeRun, ShapeText$1 as ShapeText, ShapeTextRun$1 as ShapeTextRun, TabStop$1 as TabStop, TableBorders, TblpPr, TextPath, WireRenderPageOptions, autoResize, buildDocxHighlightLayer, buildDocxTextLayer, noteText, openExternalHyperlink };
4007
+ export { AnchorHostMetrics, AutoResizeOptions, BodyElement, BorderSpec, CellBorders, CellElement, ChartRun, ColSpec, ColumnsSpec, DocComment, DocNote, DocParagraph, DocRevision, DocRun, DocSettings, DocTable, DocTableCell, DocTableRow, DocxDocument, DocxDocumentModel, DocxHighlightColors, DocxHighlightMatch, DocxMatchLocation, DocxRunBorder, DocxScrollViewer, DocxScrollViewerOptions, DocxTextRun, DocxTextRunInfo, DocxViewer, DocxViewerOptions, EmbeddedFontRef, FieldRun, FindHighlightColors, FindMatch, FindMatchesOptions, FramePr, GradientStop$1 as GradientStop, HeaderFooter, HeadersFooters, HyperlinkTarget, ImageRun, LineEnd, LineNumbering, LineSpacing, LoadOptions$2 as LoadOptions, NoteRef, NumberingInfo, OoxmlError, OoxmlErrorCode, PTabRun, PageBorderEdge, PageBorders, PageNumType, ParaBorderEdge, ParagraphBorders, PathCmd$2 as PathCmd, RenderPageOptions, RenderPageToBitmapOptions, RubyAnnotation, RunRevision, SectionGeom, SectionProps, ShapeRun, ShapeText$1 as ShapeText, ShapeTextRun$1 as ShapeTextRun, TabStop$1 as TabStop, TableBorders, TblpPr, TextPath, WireRenderPageOptions, autoResize, buildDocxHighlightLayer, buildDocxTextLayer, noteText, openExternalHyperlink };
3969
4008
  }
3970
4009
  //#endregion
3971
- //#region dist/.types-work/common-5TjSrjhP.d.ts
4010
+ //#region dist/.types-work/common-Bva7_XCn.d.ts
3972
4011
  //#region packages/core/src/types/common.d.ts
3973
4012
  type PathCmd$1 = {
3974
4013
  cmd: 'moveTo';
@@ -4440,7 +4479,7 @@ interface RenderOptions {
4440
4479
  skipMediaControls?: boolean;
4441
4480
  }
4442
4481
  //#endregion
4443
- //#region dist/.types-work/pptx-CJgt70hV.d.ts
4482
+ //#region dist/.types-work/pptx-lmtZXJAj.d.ts
4444
4483
  //#region packages/pptx/src/types.d.ts
4445
4484
  /**
4446
4485
  * Picture bullet — ECMA-376 §21.1.2.4.2 `<a:buBlip><a:blip r:embed>`. The
@@ -5117,6 +5156,11 @@ interface RenderSlideOptions {
5117
5156
  skipMediaControls?: boolean;
5118
5157
  /** Translucent overlay drawn over the finished slide (hidden-slide dimming). */
5119
5158
  dim?: DimOptions;
5159
+ /**
5160
+ * Called for asynchronous embedded-media fetch, decode, and playback
5161
+ * failures created by {@link PptxPresentation.presentSlide}.
5162
+ */
5163
+ onError?: (error: Error) => void;
5120
5164
  }
5121
5165
  /**
5122
5166
  * Headless PPTX rendering engine.
@@ -5312,7 +5356,7 @@ type HiddenSlideMode = 'show' | 'skip' | 'dim';
5312
5356
  interface PptxViewerOptions extends RenderOptions, LoadOptions$1 {
5313
5357
  /** Called when a slide finishes rendering */
5314
5358
  onSlideChange?: (index: number, total: number) => void;
5315
- /** Called on parse or render errors */
5359
+ /** Called on parse, render, or embedded-media playback errors. */
5316
5360
  onError?: (err: Error) => void;
5317
5361
  /** IX9 zoom contract ({@link ZoomableViewer}) — the clamp range for
5318
5362
  * {@link PptxViewer.setScale} / `zoomIn` / `zoomOut` / `fitWidth` / `fitPage`,
@@ -5338,6 +5382,8 @@ interface PptxViewerOptions extends RenderOptions, LoadOptions$1 {
5338
5382
  * browser's native text selection works on slide content.
5339
5383
  */
5340
5384
  enableTextSelection?: boolean;
5385
+ /** CSS backgrounds for ordinary and active in-document search matches. */
5386
+ findHighlightColors?: FindHighlightColors;
5341
5387
  /**
5342
5388
  * How hidden slides (`<p:sld show="0">`, §19.3.1.38) are presented:
5343
5389
  * - `'show'` (default): drawn like any other slide.
@@ -5670,6 +5716,22 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
5670
5716
  * shipped back beside the slide bitmap, so the overlay is populated identically
5671
5717
  * to main mode (no more empty overlay / one-time warning). */
5672
5718
  enableTextSelection?: boolean;
5719
+ /** CSS backgrounds for ordinary and active in-document search matches. */
5720
+ findHighlightColors?: FindHighlightColors;
5721
+ /**
5722
+ * Enable interactive audio/video playback. When true, mounted slides render
5723
+ * through {@link PptxPresentation.presentSlide} only while they are inside the
5724
+ * real viewport plus {@link mediaOverscan}. Other mounted slides retain static
5725
+ * canvases and selectable text without allocating media blobs or RAF loops.
5726
+ * Default false.
5727
+ */
5728
+ enableMediaPlayback?: boolean;
5729
+ /**
5730
+ * Slides beyond the real viewport that may keep interactive media handles.
5731
+ * Independent from {@link overscan}, so an integration may mount every text
5732
+ * overlay for browser-native Find while media resources stay bounded. Default 1.
5733
+ */
5734
+ mediaOverscan?: number;
5673
5735
  /** Minimum zoom scale — a DIMENSIONLESS multiplier over the 96-dpi natural
5674
5736
  * slide size (10% = 0.1), matching `DocxScrollViewer`. Default 0.1. */
5675
5737
  zoomMin?: number;
@@ -5677,6 +5739,13 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
5677
5739
  zoomMax?: number;
5678
5740
  /** Enable `Ctrl`/`Cmd`+wheel zoom. Default true. */
5679
5741
  enableZoom?: boolean;
5742
+ /**
5743
+ * Re-fit the presentation to the container width when the container is
5744
+ * resized. Default true. Set false to preserve the current absolute scale,
5745
+ * including an explicit pre-load `setScale(1)`, independently of the viewport
5746
+ * width. Explicit `fitWidth()` and `fitPage()` calls remain available.
5747
+ */
5748
+ refitOnResize?: boolean;
5680
5749
  /**
5681
5750
  * CSS `background` shorthand for the scroll surface (the "desk") visible
5682
5751
  * behind and between slides — the gray a presentation viewer paints around the
@@ -5715,15 +5784,17 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
5715
5784
  /** IX9 — fires whenever the zoom factor actually changes (`1` = 100% = a slide
5716
5785
  * at its natural EMU→px size): from {@link PptxScrollViewer.setScale},
5717
5786
  * `zoomIn`/`zoomOut`, `fitWidth`/`fitPage`, a Ctrl/⌘+wheel gesture, or a
5718
- * container-resize re-fit. Named `onScaleChange` to match the single-canvas
5719
- * viewers so all five share one notification shape. */
5787
+ * container-resize re-fit (when `refitOnResize` is enabled). Named
5788
+ * `onScaleChange` to match the single-canvas viewers so all five share one
5789
+ * notification shape. */
5720
5790
  onScaleChange?: (scale: number) => void;
5721
5791
  /** Error callback. When set, `load()` invokes it and resolves (otherwise the
5722
5792
  * error is rethrown — shared viewer error contract). It ALSO fires for async
5723
5793
  * per-slot render failures (both main `renderSlide` and worker
5724
- * `renderSlideToBitmap` rejections); a failed slide is left blank rather than
5725
- * crashing the loop. Without an `onError`, render failures are logged via
5726
- * `console.error` so they are never fully silent. */
5794
+ * `renderSlideToBitmap` rejections) and embedded-media fetch/decode/playback
5795
+ * failures. A failed slide is left blank rather than crashing the loop.
5796
+ * Without an `onError`, failures are logged via `console.error` so they are
5797
+ * never fully silent. */
5727
5798
  onError?: (err: Error) => void;
5728
5799
  /**
5729
5800
  * IX1 (design decision — NOT user-confirmed, integrator may veto). Fires on a
@@ -5868,6 +5939,9 @@ declare class PptxScrollViewer implements ZoomableViewer {
5868
5939
  * `_settleSlot`) so a recycled/re-mounted slot and a settle-swapped spare all
5869
5940
  * carry it. */
5870
5941
  private readonly _pageShadow;
5942
+ private readonly _find;
5943
+ private _findActive;
5944
+ private _findMeasureCtx;
5871
5945
  constructor(container: HTMLElement, opts?: PptxScrollViewerOptions);
5872
5946
  /**
5873
5947
  * Load a PPTX from URL or ArrayBuffer and render the first window.
@@ -5913,6 +5987,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
5913
5987
  private _recomputeHeights;
5914
5988
  private _gap;
5915
5989
  private _overscan;
5990
+ /** Media lifecycle window, deliberately independent from text/canvas overscan. */
5991
+ private _mediaOverscan;
5916
5992
  /** Desk padding fed to `computeVisibleRange`: `paddingTop`/`paddingBottom`,
5917
5993
  * each defaulting to `gap` (uniform rhythm). Resolved here (not stored) to
5918
5994
  * mirror `_gap()`/`_overscan()`, and consumed at EVERY `computeVisibleRange`
@@ -5931,6 +6007,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
5931
6007
  * `[0, n-1]`; a `y` below the first slide (inside the leading pad) yields 0. */
5932
6008
  private _slideIndexAtOffset;
5933
6009
  private _range;
6010
+ private _mediaRange;
6011
+ private _rangeContains;
5934
6012
  private _syncSpacer;
5935
6013
  /** Horizontal scroll extent: the (uniform deck-wide) slide width plus both
5936
6014
  * gutters. A spacer NARROWER than the container never creates a scrollbar
@@ -5978,6 +6056,20 @@ declare class PptxScrollViewer implements ZoomableViewer {
5978
6056
  * can pass for an old-epoch resolution). We gate them on the captured epoch.
5979
6057
  */
5980
6058
  private _renderSlot;
6059
+ /**
6060
+ * Render one mounted slot through the stateful media presentation API.
6061
+ *
6062
+ * This path intentionally bypasses bitmaprenderer even for worker-backed
6063
+ * presentations: presentSlide() renders the base off-thread and composites
6064
+ * interactive video on a main-thread 2D canvas. The slot generation closes the
6065
+ * same-index recycle/reload hole that a viewer-wide render epoch cannot detect.
6066
+ */
6067
+ private _renderInteractiveSlot;
6068
+ /**
6069
+ * Reconcile stateful media handles against the small media lifecycle range,
6070
+ * independently from the (potentially whole-deck) mounted text range.
6071
+ */
6072
+ private _syncMediaPlayback;
5981
6073
  /** Route an async render failure to `onError`, or `console.error` when none is
5982
6074
  * set (so failures are never fully silent), and never after teardown. */
5983
6075
  private _reportRenderError;
@@ -6120,6 +6212,12 @@ declare class PptxScrollViewer implements ZoomableViewer {
6120
6212
  * stretched preview until the instant of the swap — blank-free.
6121
6213
  */
6122
6214
  private _settleSlot;
6215
+ /**
6216
+ * Settle an interactive slide onto a spare 2D canvas, then atomically swap it
6217
+ * in and destroy the handle tied to the retired canvas. Pending handles from a
6218
+ * superseded zoom/recycle are destroyed as soon as they resolve.
6219
+ */
6220
+ private _settleInteractiveSlot;
6123
6221
  /**
6124
6222
  * Scroll so slide `index`'s top edge sits at the viewport top. Clamps `index` to
6125
6223
  * `[0, slideCount-1]` (the pager convention) and the resulting scrollTop to
@@ -6142,6 +6240,21 @@ declare class PptxScrollViewer implements ZoomableViewer {
6142
6240
  scrollToSlide(index: number, opts?: {
6143
6241
  behavior?: 'auto' | 'smooth';
6144
6242
  }): void;
6243
+ /** Search the complete presentation, including slides outside the
6244
+ * virtualized mounted window. Matching is case-insensitive by default. */
6245
+ findText(query: string, opts?: FindMatchesOptions): Promise<FindMatch<PptxMatchLocation>[]>;
6246
+ /** Activate and reveal the next match, wrapping at the end. */
6247
+ findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
6248
+ /** Activate and reveal the previous match, wrapping at the beginning. */
6249
+ findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
6250
+ /** Clear the current query and every mounted highlight. */
6251
+ clearFind(): void;
6252
+ private _activateMatch;
6253
+ private _collectSlideRuns;
6254
+ private _redrawHighlights;
6255
+ private _refreshFindRuns;
6256
+ private _redrawSlotHighlights;
6257
+ private _measureForFind;
6145
6258
  /**
6146
6259
  * IX1 hyperlink click dispatch (mirrors {@link PptxViewer._onHyperlinkClick}).
6147
6260
  * When the integrator supplies `opts.onHyperlinkClick` it OWNS the click (no
@@ -6247,10 +6360,8 @@ interface PptxHighlightMatch {
6247
6360
  slices: MatchRunSlice[];
6248
6361
  active: boolean;
6249
6362
  }
6250
- interface PptxHighlightColors {
6251
- match?: string;
6252
- active?: string;
6253
- }
6363
+ /** Format-specific compatibility alias for the shared colour contract. */
6364
+ type PptxHighlightColors = FindHighlightColors;
6254
6365
  /**
6255
6366
  * Populate a highlight overlay layer with a box per matched run-slice, grouped
6256
6367
  * by shape frame (with the shape's rotation) so each box lands on the drawn
@@ -6271,10 +6382,10 @@ interface PptxHighlightColors {
6271
6382
  */
6272
6383
  declare function buildPptxHighlightLayer(layer: HTMLDivElement, runs: PptxTextRunInfo[], matches: PptxHighlightMatch[], cssWidth: number, cssHeight: number, measureForFont: (font: string) => (s: string) => number, colors?: PptxHighlightColors): void;
6273
6384
  declare namespace pptx_d_exports {
6274
- export { AutoResizeOptions, Bevel3d, BlipBullet, Bullet, Camera3d, ChartElement, ChartModel, ChartSeries, DimOptions, Fill, FillRect, FindMatch, FindMatchesOptions, Glow, GradientFill, GradientStop, HiddenSlideMode, HyperlinkTarget, ImageFill, LightRig, LineBreak, LoadOptions$1 as LoadOptions, MediaElement, NoFill, OoxmlError, OoxmlErrorCode, Paragraph, PathCmd$1 as PathCmd, PictureElement, PptxComment, PptxHighlightColors, PptxHighlightMatch, PptxMatchLocation, PptxPresentation, PptxScrollViewer, PptxScrollViewerOptions, PptxTextRunInfo, PptxViewer, PptxViewerOptions, Presentation, PresentationHandle, Reflection, RenderOptions, RenderSlideOptions, RenderSlideToBitmapOptions, Rot3d, Scene3d, Shadow, ShapeElement, Slide, SlideElement, SoftEdge, SolidFill, Sp3d, SpaceLine, Stroke, TabStop, TableCell, TableElement, TableRow, TextBody, TextRect, TextRun, TextRunCallback, TextRunData, TileInfo, autoResize, buildPptxHighlightLayer, buildPptxTextLayer, openExternalHyperlink, renderSlide };
6385
+ export { AutoResizeOptions, Bevel3d, BlipBullet, Bullet, Camera3d, ChartElement, ChartModel, ChartSeries, DimOptions, Fill, FillRect, FindHighlightColors, FindMatch, FindMatchesOptions, Glow, GradientFill, GradientStop, HiddenSlideMode, HyperlinkTarget, ImageFill, LightRig, LineBreak, LoadOptions$1 as LoadOptions, MediaElement, NoFill, OoxmlError, OoxmlErrorCode, Paragraph, PathCmd$1 as PathCmd, PictureElement, PptxComment, PptxHighlightColors, PptxHighlightMatch, PptxMatchLocation, PptxPresentation, PptxScrollViewer, PptxScrollViewerOptions, PptxTextRunInfo, PptxViewer, PptxViewerOptions, Presentation, PresentationHandle, Reflection, RenderOptions, RenderSlideOptions, RenderSlideToBitmapOptions, Rot3d, Scene3d, Shadow, ShapeElement, Slide, SlideElement, SoftEdge, SolidFill, Sp3d, SpaceLine, Stroke, TabStop, TableCell, TableElement, TableRow, TextBody, TextRect, TextRun, TextRunCallback, TextRunData, TileInfo, autoResize, buildPptxHighlightLayer, buildPptxTextLayer, openExternalHyperlink, renderSlide };
6275
6386
  }
6276
6387
  //#endregion
6277
- //#region dist/.types-work/xlsx-1vWbvQcb.d.ts
6388
+ //#region dist/.types-work/xlsx-DAB_laks.d.ts
6278
6389
  //#region packages/xlsx/src/types.d.ts
6279
6390
  interface Workbook {
6280
6391
  sheets: SheetMeta[];
@@ -7662,6 +7773,8 @@ interface XlsxViewerOptions extends LoadOptions$3 {
7662
7773
  * via {@link XlsxViewer.setSelectionColor}.
7663
7774
  */
7664
7775
  selectionColor?: string;
7776
+ /** CSS backgrounds for ordinary and active in-document search matches. */
7777
+ findHighlightColors?: FindHighlightColors;
7665
7778
  /**
7666
7779
  * `'main'` (default): parse in a worker, render on the main thread. `'worker'`:
7667
7780
  * parse AND render entirely inside the worker and paint the returned
@@ -8304,7 +8417,7 @@ declare class XlsxViewer implements ZoomableViewer {
8304
8417
  */
8305
8418
  declare function resolveSharedStrings(ws: Worksheet, sharedStrings: SharedString[]): Worksheet;
8306
8419
  declare namespace xlsx_d_exports {
8307
- export { AutoResizeOptions, Border, BorderEdge, Cell, CellAddress, CellFill, CellFont, CellRange, CellValue, CellXf, CfIcon, CfRule, CfStop, CfValue, ChartAnchor, ChartDataLabelOverride, ChartDataPointOverride, ChartErrBars, ChartManualLayout, ChartModel, ChartSeries, ChartSeriesDataLabels, ConditionalFormat, DataLabelOverride, DataPointOverride, DataValidation, DefinedName, Duotone, Dxf, ErrBars, FindMatch, FindMatchesOptions, GradientFillSpec, HiddenSheetMode, Hyperlink, HyperlinkTarget, ImageAnchor, LegendManualLayout, LoadOptions, ManualLayout, MergeCell, NumFmt, OoxmlError, OoxmlErrorCode, OutlinePr, ParsedWorkbook, PathCmd, PathInfo, PhoneticAlignment, PhoneticProperties, PhoneticRun, PhoneticType, PivotCacheSource, PivotDataField, PivotDiagnostic, PivotLocation, PivotMetadataStatus, PivotPageField, PivotPartialReason, PivotTableMetadata, RenderViewportOptions, ResolvedList, Row, Run, RunFont, SelectionMode, SeriesDataLabels, ShapeAnchor, ShapeGeom, ShapeInfo, ShapeParagraph, ShapeText, ShapeTextRun, SharedString, SheetMeta, SheetVisibility, SlicerAnchor, SlicerElementStyle, SlicerItem, SlicerStyle, Sparkline, SparklineGroup, Styles, TableColumnInfo, TableInfo, ViewportRange, WireRenderViewportOptions, WireSizeOverrides, Workbook, Worksheet, XlsxChartSeries, XlsxComment, XlsxMatchLocation, XlsxTextRunInfo, XlsxViewer, XlsxViewerOptions, XlsxWorkbook, autoResize, openExternalHyperlink, resolveSharedStrings };
8420
+ export { AutoResizeOptions, Border, BorderEdge, Cell, CellAddress, CellFill, CellFont, CellRange, CellValue, CellXf, CfIcon, CfRule, CfStop, CfValue, ChartAnchor, ChartDataLabelOverride, ChartDataPointOverride, ChartErrBars, ChartManualLayout, ChartModel, ChartSeries, ChartSeriesDataLabels, ConditionalFormat, DataLabelOverride, DataPointOverride, DataValidation, DefinedName, Duotone, Dxf, ErrBars, FindHighlightColors, FindMatch, FindMatchesOptions, GradientFillSpec, HiddenSheetMode, Hyperlink, HyperlinkTarget, ImageAnchor, LegendManualLayout, LoadOptions, ManualLayout, MergeCell, NumFmt, OoxmlError, OoxmlErrorCode, OutlinePr, ParsedWorkbook, PathCmd, PathInfo, PhoneticAlignment, PhoneticProperties, PhoneticRun, PhoneticType, PivotCacheSource, PivotDataField, PivotDiagnostic, PivotLocation, PivotMetadataStatus, PivotPageField, PivotPartialReason, PivotTableMetadata, RenderViewportOptions, ResolvedList, Row, Run, RunFont, SelectionMode, SeriesDataLabels, ShapeAnchor, ShapeGeom, ShapeInfo, ShapeParagraph, ShapeText, ShapeTextRun, SharedString, SheetMeta, SheetVisibility, SlicerAnchor, SlicerElementStyle, SlicerItem, SlicerStyle, Sparkline, SparklineGroup, Styles, TableColumnInfo, TableInfo, ViewportRange, WireRenderViewportOptions, WireSizeOverrides, Workbook, Worksheet, XlsxChartSeries, XlsxComment, XlsxMatchLocation, XlsxTextRunInfo, XlsxViewer, XlsxViewerOptions, XlsxWorkbook, autoResize, openExternalHyperlink, resolveSharedStrings };
8308
8421
  }
8309
8422
  //#endregion
8310
8423
  export { docx_d_exports as docx, pptx_d_exports as pptx, xlsx_d_exports as xlsx };