@silurus/ooxml 0.74.3 → 0.74.4
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.
- package/README.md +17 -5
- package/dist/{docx-Dmx7JPe8.js → docx-Dv8sdixm.js} +1966 -1903
- package/dist/docx.mjs +1 -1
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +2 -2
- package/dist/{pptx-9C5JKbFv.js → pptx-DkKbei1w.js} +444 -311
- package/dist/pptx.mjs +1 -1
- package/dist/{render-worker-host-GGVmi0tj.js → render-worker-host-C523QxVw.js} +1 -1
- package/dist/types/docx.d.ts +27 -3
- package/dist/types/index.d.ts +94 -6
- package/dist/types/pptx.d.ts +67 -3
- package/package.json +1 -1
package/dist/types/docx.d.ts
CHANGED
|
@@ -1329,7 +1329,7 @@ interface FindMatch<Loc = unknown> {
|
|
|
1329
1329
|
location: Loc;
|
|
1330
1330
|
}
|
|
1331
1331
|
//#endregion
|
|
1332
|
-
//#region dist/.types-work/docx-
|
|
1332
|
+
//#region dist/.types-work/docx-Cc2gf7b0.d.ts
|
|
1333
1333
|
//#region packages/docx/src/types.d.ts
|
|
1334
1334
|
interface DocxDocumentModel {
|
|
1335
1335
|
section: SectionProps;
|
|
@@ -3372,6 +3372,13 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
|
|
|
3372
3372
|
zoomMax?: number;
|
|
3373
3373
|
/** Enable `Ctrl`/`Cmd`+wheel zoom. Default true. */
|
|
3374
3374
|
enableZoom?: boolean;
|
|
3375
|
+
/**
|
|
3376
|
+
* Re-fit the document to the container width when the container is resized.
|
|
3377
|
+
* Default true. Set false to preserve the current absolute scale, including
|
|
3378
|
+
* an explicit pre-load `setScale(1)`, independently of the viewport width.
|
|
3379
|
+
* Explicit `fitWidth()` and `fitPage()` calls remain available.
|
|
3380
|
+
*/
|
|
3381
|
+
refitOnResize?: boolean;
|
|
3375
3382
|
/**
|
|
3376
3383
|
* CSS `background` shorthand for the scroll surface (the "desk") visible
|
|
3377
3384
|
* behind and between pages — the gray a PDF reader paints around the sheet.
|
|
@@ -3410,8 +3417,9 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
|
|
|
3410
3417
|
/** IX9 — fires whenever the zoom factor actually changes (`1` = 100% = a page
|
|
3411
3418
|
* at its natural pt→px size): from {@link DocxScrollViewer.setScale},
|
|
3412
3419
|
* `zoomIn`/`zoomOut`, `fitWidth`/`fitPage`, a Ctrl/⌘+wheel gesture, or a
|
|
3413
|
-
* container-resize re-fit
|
|
3414
|
-
* viewers so all five share one
|
|
3420
|
+
* container-resize re-fit (when `refitOnResize` is enabled). Named
|
|
3421
|
+
* `onScaleChange` to match the single-canvas viewers so all five share one
|
|
3422
|
+
* notification shape. */
|
|
3415
3423
|
onScaleChange?: (scale: number) => void;
|
|
3416
3424
|
/** IX1 (design decision — NOT user-confirmed, integrator may veto). Called when
|
|
3417
3425
|
* a hyperlink run is clicked. When omitted, the default is: external → open in a
|
|
@@ -3557,6 +3565,8 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
3557
3565
|
* `_settleSlot`) so a recycled/re-mounted slot and a settle-swapped spare all
|
|
3558
3566
|
* carry it. */
|
|
3559
3567
|
private readonly _pageShadow;
|
|
3568
|
+
private readonly _find;
|
|
3569
|
+
private _findActive;
|
|
3560
3570
|
constructor(container: HTMLElement, opts?: DocxScrollViewerOptions);
|
|
3561
3571
|
/**
|
|
3562
3572
|
* Load a DOCX from URL or ArrayBuffer and render the first window.
|
|
@@ -3847,6 +3857,20 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
3847
3857
|
scrollToPage(index: number, opts?: {
|
|
3848
3858
|
behavior?: 'auto' | 'smooth';
|
|
3849
3859
|
}): void;
|
|
3860
|
+
/** Search the complete document, including pages outside the virtualized
|
|
3861
|
+
* mounted window. Matching is case-insensitive by default. */
|
|
3862
|
+
findText(query: string, opts?: FindMatchesOptions): Promise<FindMatch<DocxMatchLocation>[]>;
|
|
3863
|
+
/** Activate and reveal the next match, wrapping at the end. */
|
|
3864
|
+
findNext(): Promise<FindMatch<DocxMatchLocation> | null>;
|
|
3865
|
+
/** Activate and reveal the previous match, wrapping at the beginning. */
|
|
3866
|
+
findPrev(): Promise<FindMatch<DocxMatchLocation> | null>;
|
|
3867
|
+
/** Clear the current query and every mounted highlight. */
|
|
3868
|
+
clearFind(): void;
|
|
3869
|
+
private _activateMatch;
|
|
3870
|
+
private _collectPageRuns;
|
|
3871
|
+
private _redrawHighlights;
|
|
3872
|
+
private _refreshFindRuns;
|
|
3873
|
+
private _redrawSlotHighlights;
|
|
3850
3874
|
/**
|
|
3851
3875
|
* Re-fit the base scale on a container resize while PRESERVING the current zoom
|
|
3852
3876
|
* multiplier (design §11), then re-anchor + re-render. A `ResizeObserver` fires
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1329,7 +1329,7 @@ interface FindMatch<Loc = unknown> {
|
|
|
1329
1329
|
location: Loc;
|
|
1330
1330
|
}
|
|
1331
1331
|
//#endregion
|
|
1332
|
-
//#region dist/.types-work/docx-
|
|
1332
|
+
//#region dist/.types-work/docx-Cc2gf7b0.d.ts
|
|
1333
1333
|
//#region packages/docx/src/types.d.ts
|
|
1334
1334
|
interface DocxDocumentModel {
|
|
1335
1335
|
section: SectionProps;
|
|
@@ -3372,6 +3372,13 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
|
|
|
3372
3372
|
zoomMax?: number;
|
|
3373
3373
|
/** Enable `Ctrl`/`Cmd`+wheel zoom. Default true. */
|
|
3374
3374
|
enableZoom?: boolean;
|
|
3375
|
+
/**
|
|
3376
|
+
* Re-fit the document to the container width when the container is resized.
|
|
3377
|
+
* Default true. Set false to preserve the current absolute scale, including
|
|
3378
|
+
* an explicit pre-load `setScale(1)`, independently of the viewport width.
|
|
3379
|
+
* Explicit `fitWidth()` and `fitPage()` calls remain available.
|
|
3380
|
+
*/
|
|
3381
|
+
refitOnResize?: boolean;
|
|
3375
3382
|
/**
|
|
3376
3383
|
* CSS `background` shorthand for the scroll surface (the "desk") visible
|
|
3377
3384
|
* behind and between pages — the gray a PDF reader paints around the sheet.
|
|
@@ -3410,8 +3417,9 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
|
|
|
3410
3417
|
/** IX9 — fires whenever the zoom factor actually changes (`1` = 100% = a page
|
|
3411
3418
|
* at its natural pt→px size): from {@link DocxScrollViewer.setScale},
|
|
3412
3419
|
* `zoomIn`/`zoomOut`, `fitWidth`/`fitPage`, a Ctrl/⌘+wheel gesture, or a
|
|
3413
|
-
* container-resize re-fit
|
|
3414
|
-
* viewers so all five share one
|
|
3420
|
+
* container-resize re-fit (when `refitOnResize` is enabled). Named
|
|
3421
|
+
* `onScaleChange` to match the single-canvas viewers so all five share one
|
|
3422
|
+
* notification shape. */
|
|
3415
3423
|
onScaleChange?: (scale: number) => void;
|
|
3416
3424
|
/** IX1 (design decision — NOT user-confirmed, integrator may veto). Called when
|
|
3417
3425
|
* a hyperlink run is clicked. When omitted, the default is: external → open in a
|
|
@@ -3557,6 +3565,8 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
3557
3565
|
* `_settleSlot`) so a recycled/re-mounted slot and a settle-swapped spare all
|
|
3558
3566
|
* carry it. */
|
|
3559
3567
|
private readonly _pageShadow;
|
|
3568
|
+
private readonly _find;
|
|
3569
|
+
private _findActive;
|
|
3560
3570
|
constructor(container: HTMLElement, opts?: DocxScrollViewerOptions);
|
|
3561
3571
|
/**
|
|
3562
3572
|
* Load a DOCX from URL or ArrayBuffer and render the first window.
|
|
@@ -3847,6 +3857,20 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
3847
3857
|
scrollToPage(index: number, opts?: {
|
|
3848
3858
|
behavior?: 'auto' | 'smooth';
|
|
3849
3859
|
}): void;
|
|
3860
|
+
/** Search the complete document, including pages outside the virtualized
|
|
3861
|
+
* mounted window. Matching is case-insensitive by default. */
|
|
3862
|
+
findText(query: string, opts?: FindMatchesOptions): Promise<FindMatch<DocxMatchLocation>[]>;
|
|
3863
|
+
/** Activate and reveal the next match, wrapping at the end. */
|
|
3864
|
+
findNext(): Promise<FindMatch<DocxMatchLocation> | null>;
|
|
3865
|
+
/** Activate and reveal the previous match, wrapping at the beginning. */
|
|
3866
|
+
findPrev(): Promise<FindMatch<DocxMatchLocation> | null>;
|
|
3867
|
+
/** Clear the current query and every mounted highlight. */
|
|
3868
|
+
clearFind(): void;
|
|
3869
|
+
private _activateMatch;
|
|
3870
|
+
private _collectPageRuns;
|
|
3871
|
+
private _redrawHighlights;
|
|
3872
|
+
private _refreshFindRuns;
|
|
3873
|
+
private _redrawSlotHighlights;
|
|
3850
3874
|
/**
|
|
3851
3875
|
* Re-fit the base scale on a container resize while PRESERVING the current zoom
|
|
3852
3876
|
* multiplier (design §11), then re-anchor + re-render. A `ResizeObserver` fires
|
|
@@ -4440,7 +4464,7 @@ interface RenderOptions {
|
|
|
4440
4464
|
skipMediaControls?: boolean;
|
|
4441
4465
|
}
|
|
4442
4466
|
//#endregion
|
|
4443
|
-
//#region dist/.types-work/pptx-
|
|
4467
|
+
//#region dist/.types-work/pptx-ChHwV9HX.d.ts
|
|
4444
4468
|
//#region packages/pptx/src/types.d.ts
|
|
4445
4469
|
/**
|
|
4446
4470
|
* Picture bullet — ECMA-376 §21.1.2.4.2 `<a:buBlip><a:blip r:embed>`. The
|
|
@@ -5670,6 +5694,20 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
|
|
|
5670
5694
|
* shipped back beside the slide bitmap, so the overlay is populated identically
|
|
5671
5695
|
* to main mode (no more empty overlay / one-time warning). */
|
|
5672
5696
|
enableTextSelection?: boolean;
|
|
5697
|
+
/**
|
|
5698
|
+
* Enable interactive audio/video playback. When true, mounted slides render
|
|
5699
|
+
* through {@link PptxPresentation.presentSlide} only while they are inside the
|
|
5700
|
+
* real viewport plus {@link mediaOverscan}. Other mounted slides retain static
|
|
5701
|
+
* canvases and selectable text without allocating media blobs or RAF loops.
|
|
5702
|
+
* Default false.
|
|
5703
|
+
*/
|
|
5704
|
+
enableMediaPlayback?: boolean;
|
|
5705
|
+
/**
|
|
5706
|
+
* Slides beyond the real viewport that may keep interactive media handles.
|
|
5707
|
+
* Independent from {@link overscan}, so an integration may mount every text
|
|
5708
|
+
* overlay for browser-native Find while media resources stay bounded. Default 1.
|
|
5709
|
+
*/
|
|
5710
|
+
mediaOverscan?: number;
|
|
5673
5711
|
/** Minimum zoom scale — a DIMENSIONLESS multiplier over the 96-dpi natural
|
|
5674
5712
|
* slide size (10% = 0.1), matching `DocxScrollViewer`. Default 0.1. */
|
|
5675
5713
|
zoomMin?: number;
|
|
@@ -5677,6 +5715,13 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
|
|
|
5677
5715
|
zoomMax?: number;
|
|
5678
5716
|
/** Enable `Ctrl`/`Cmd`+wheel zoom. Default true. */
|
|
5679
5717
|
enableZoom?: boolean;
|
|
5718
|
+
/**
|
|
5719
|
+
* Re-fit the presentation to the container width when the container is
|
|
5720
|
+
* resized. Default true. Set false to preserve the current absolute scale,
|
|
5721
|
+
* including an explicit pre-load `setScale(1)`, independently of the viewport
|
|
5722
|
+
* width. Explicit `fitWidth()` and `fitPage()` calls remain available.
|
|
5723
|
+
*/
|
|
5724
|
+
refitOnResize?: boolean;
|
|
5680
5725
|
/**
|
|
5681
5726
|
* CSS `background` shorthand for the scroll surface (the "desk") visible
|
|
5682
5727
|
* behind and between slides — the gray a presentation viewer paints around the
|
|
@@ -5715,8 +5760,9 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
|
|
|
5715
5760
|
/** IX9 — fires whenever the zoom factor actually changes (`1` = 100% = a slide
|
|
5716
5761
|
* at its natural EMU→px size): from {@link PptxScrollViewer.setScale},
|
|
5717
5762
|
* `zoomIn`/`zoomOut`, `fitWidth`/`fitPage`, a Ctrl/⌘+wheel gesture, or a
|
|
5718
|
-
* container-resize re-fit
|
|
5719
|
-
* viewers so all five share one
|
|
5763
|
+
* container-resize re-fit (when `refitOnResize` is enabled). Named
|
|
5764
|
+
* `onScaleChange` to match the single-canvas viewers so all five share one
|
|
5765
|
+
* notification shape. */
|
|
5720
5766
|
onScaleChange?: (scale: number) => void;
|
|
5721
5767
|
/** Error callback. When set, `load()` invokes it and resolves (otherwise the
|
|
5722
5768
|
* error is rethrown — shared viewer error contract). It ALSO fires for async
|
|
@@ -5868,6 +5914,9 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
5868
5914
|
* `_settleSlot`) so a recycled/re-mounted slot and a settle-swapped spare all
|
|
5869
5915
|
* carry it. */
|
|
5870
5916
|
private readonly _pageShadow;
|
|
5917
|
+
private readonly _find;
|
|
5918
|
+
private _findActive;
|
|
5919
|
+
private _findMeasureCtx;
|
|
5871
5920
|
constructor(container: HTMLElement, opts?: PptxScrollViewerOptions);
|
|
5872
5921
|
/**
|
|
5873
5922
|
* Load a PPTX from URL or ArrayBuffer and render the first window.
|
|
@@ -5913,6 +5962,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
5913
5962
|
private _recomputeHeights;
|
|
5914
5963
|
private _gap;
|
|
5915
5964
|
private _overscan;
|
|
5965
|
+
/** Media lifecycle window, deliberately independent from text/canvas overscan. */
|
|
5966
|
+
private _mediaOverscan;
|
|
5916
5967
|
/** Desk padding fed to `computeVisibleRange`: `paddingTop`/`paddingBottom`,
|
|
5917
5968
|
* each defaulting to `gap` (uniform rhythm). Resolved here (not stored) to
|
|
5918
5969
|
* mirror `_gap()`/`_overscan()`, and consumed at EVERY `computeVisibleRange`
|
|
@@ -5931,6 +5982,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
5931
5982
|
* `[0, n-1]`; a `y` below the first slide (inside the leading pad) yields 0. */
|
|
5932
5983
|
private _slideIndexAtOffset;
|
|
5933
5984
|
private _range;
|
|
5985
|
+
private _mediaRange;
|
|
5986
|
+
private _rangeContains;
|
|
5934
5987
|
private _syncSpacer;
|
|
5935
5988
|
/** Horizontal scroll extent: the (uniform deck-wide) slide width plus both
|
|
5936
5989
|
* gutters. A spacer NARROWER than the container never creates a scrollbar
|
|
@@ -5978,6 +6031,20 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
5978
6031
|
* can pass for an old-epoch resolution). We gate them on the captured epoch.
|
|
5979
6032
|
*/
|
|
5980
6033
|
private _renderSlot;
|
|
6034
|
+
/**
|
|
6035
|
+
* Render one mounted slot through the stateful media presentation API.
|
|
6036
|
+
*
|
|
6037
|
+
* This path intentionally bypasses bitmaprenderer even for worker-backed
|
|
6038
|
+
* presentations: presentSlide() renders the base off-thread and composites
|
|
6039
|
+
* interactive video on a main-thread 2D canvas. The slot generation closes the
|
|
6040
|
+
* same-index recycle/reload hole that a viewer-wide render epoch cannot detect.
|
|
6041
|
+
*/
|
|
6042
|
+
private _renderInteractiveSlot;
|
|
6043
|
+
/**
|
|
6044
|
+
* Reconcile stateful media handles against the small media lifecycle range,
|
|
6045
|
+
* independently from the (potentially whole-deck) mounted text range.
|
|
6046
|
+
*/
|
|
6047
|
+
private _syncMediaPlayback;
|
|
5981
6048
|
/** Route an async render failure to `onError`, or `console.error` when none is
|
|
5982
6049
|
* set (so failures are never fully silent), and never after teardown. */
|
|
5983
6050
|
private _reportRenderError;
|
|
@@ -6120,6 +6187,12 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
6120
6187
|
* stretched preview until the instant of the swap — blank-free.
|
|
6121
6188
|
*/
|
|
6122
6189
|
private _settleSlot;
|
|
6190
|
+
/**
|
|
6191
|
+
* Settle an interactive slide onto a spare 2D canvas, then atomically swap it
|
|
6192
|
+
* in and destroy the handle tied to the retired canvas. Pending handles from a
|
|
6193
|
+
* superseded zoom/recycle are destroyed as soon as they resolve.
|
|
6194
|
+
*/
|
|
6195
|
+
private _settleInteractiveSlot;
|
|
6123
6196
|
/**
|
|
6124
6197
|
* Scroll so slide `index`'s top edge sits at the viewport top. Clamps `index` to
|
|
6125
6198
|
* `[0, slideCount-1]` (the pager convention) and the resulting scrollTop to
|
|
@@ -6142,6 +6215,21 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
6142
6215
|
scrollToSlide(index: number, opts?: {
|
|
6143
6216
|
behavior?: 'auto' | 'smooth';
|
|
6144
6217
|
}): void;
|
|
6218
|
+
/** Search the complete presentation, including slides outside the
|
|
6219
|
+
* virtualized mounted window. Matching is case-insensitive by default. */
|
|
6220
|
+
findText(query: string, opts?: FindMatchesOptions): Promise<FindMatch<PptxMatchLocation>[]>;
|
|
6221
|
+
/** Activate and reveal the next match, wrapping at the end. */
|
|
6222
|
+
findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
|
|
6223
|
+
/** Activate and reveal the previous match, wrapping at the beginning. */
|
|
6224
|
+
findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
|
|
6225
|
+
/** Clear the current query and every mounted highlight. */
|
|
6226
|
+
clearFind(): void;
|
|
6227
|
+
private _activateMatch;
|
|
6228
|
+
private _collectSlideRuns;
|
|
6229
|
+
private _redrawHighlights;
|
|
6230
|
+
private _refreshFindRuns;
|
|
6231
|
+
private _redrawSlotHighlights;
|
|
6232
|
+
private _measureForFind;
|
|
6145
6233
|
/**
|
|
6146
6234
|
* IX1 hyperlink click dispatch (mirrors {@link PptxViewer._onHyperlinkClick}).
|
|
6147
6235
|
* When the integrator supplies `opts.onHyperlinkClick` it OWNS the click (no
|
package/dist/types/pptx.d.ts
CHANGED
|
@@ -1801,7 +1801,7 @@ interface RenderOptions {
|
|
|
1801
1801
|
skipMediaControls?: boolean;
|
|
1802
1802
|
}
|
|
1803
1803
|
//#endregion
|
|
1804
|
-
//#region dist/.types-work/pptx-
|
|
1804
|
+
//#region dist/.types-work/pptx-ChHwV9HX.d.ts
|
|
1805
1805
|
//#region packages/pptx/src/types.d.ts
|
|
1806
1806
|
/**
|
|
1807
1807
|
* Picture bullet — ECMA-376 §21.1.2.4.2 `<a:buBlip><a:blip r:embed>`. The
|
|
@@ -3031,6 +3031,20 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
|
|
|
3031
3031
|
* shipped back beside the slide bitmap, so the overlay is populated identically
|
|
3032
3032
|
* to main mode (no more empty overlay / one-time warning). */
|
|
3033
3033
|
enableTextSelection?: boolean;
|
|
3034
|
+
/**
|
|
3035
|
+
* Enable interactive audio/video playback. When true, mounted slides render
|
|
3036
|
+
* through {@link PptxPresentation.presentSlide} only while they are inside the
|
|
3037
|
+
* real viewport plus {@link mediaOverscan}. Other mounted slides retain static
|
|
3038
|
+
* canvases and selectable text without allocating media blobs or RAF loops.
|
|
3039
|
+
* Default false.
|
|
3040
|
+
*/
|
|
3041
|
+
enableMediaPlayback?: boolean;
|
|
3042
|
+
/**
|
|
3043
|
+
* Slides beyond the real viewport that may keep interactive media handles.
|
|
3044
|
+
* Independent from {@link overscan}, so an integration may mount every text
|
|
3045
|
+
* overlay for browser-native Find while media resources stay bounded. Default 1.
|
|
3046
|
+
*/
|
|
3047
|
+
mediaOverscan?: number;
|
|
3034
3048
|
/** Minimum zoom scale — a DIMENSIONLESS multiplier over the 96-dpi natural
|
|
3035
3049
|
* slide size (10% = 0.1), matching `DocxScrollViewer`. Default 0.1. */
|
|
3036
3050
|
zoomMin?: number;
|
|
@@ -3038,6 +3052,13 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
|
|
|
3038
3052
|
zoomMax?: number;
|
|
3039
3053
|
/** Enable `Ctrl`/`Cmd`+wheel zoom. Default true. */
|
|
3040
3054
|
enableZoom?: boolean;
|
|
3055
|
+
/**
|
|
3056
|
+
* Re-fit the presentation to the container width when the container is
|
|
3057
|
+
* resized. Default true. Set false to preserve the current absolute scale,
|
|
3058
|
+
* including an explicit pre-load `setScale(1)`, independently of the viewport
|
|
3059
|
+
* width. Explicit `fitWidth()` and `fitPage()` calls remain available.
|
|
3060
|
+
*/
|
|
3061
|
+
refitOnResize?: boolean;
|
|
3041
3062
|
/**
|
|
3042
3063
|
* CSS `background` shorthand for the scroll surface (the "desk") visible
|
|
3043
3064
|
* behind and between slides — the gray a presentation viewer paints around the
|
|
@@ -3076,8 +3097,9 @@ interface PptxScrollViewerOptions extends Omit<RenderSlideOptions, 'onTextRun'>,
|
|
|
3076
3097
|
/** IX9 — fires whenever the zoom factor actually changes (`1` = 100% = a slide
|
|
3077
3098
|
* at its natural EMU→px size): from {@link PptxScrollViewer.setScale},
|
|
3078
3099
|
* `zoomIn`/`zoomOut`, `fitWidth`/`fitPage`, a Ctrl/⌘+wheel gesture, or a
|
|
3079
|
-
* container-resize re-fit
|
|
3080
|
-
* viewers so all five share one
|
|
3100
|
+
* container-resize re-fit (when `refitOnResize` is enabled). Named
|
|
3101
|
+
* `onScaleChange` to match the single-canvas viewers so all five share one
|
|
3102
|
+
* notification shape. */
|
|
3081
3103
|
onScaleChange?: (scale: number) => void;
|
|
3082
3104
|
/** Error callback. When set, `load()` invokes it and resolves (otherwise the
|
|
3083
3105
|
* error is rethrown — shared viewer error contract). It ALSO fires for async
|
|
@@ -3229,6 +3251,9 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
3229
3251
|
* `_settleSlot`) so a recycled/re-mounted slot and a settle-swapped spare all
|
|
3230
3252
|
* carry it. */
|
|
3231
3253
|
private readonly _pageShadow;
|
|
3254
|
+
private readonly _find;
|
|
3255
|
+
private _findActive;
|
|
3256
|
+
private _findMeasureCtx;
|
|
3232
3257
|
constructor(container: HTMLElement, opts?: PptxScrollViewerOptions);
|
|
3233
3258
|
/**
|
|
3234
3259
|
* Load a PPTX from URL or ArrayBuffer and render the first window.
|
|
@@ -3274,6 +3299,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
3274
3299
|
private _recomputeHeights;
|
|
3275
3300
|
private _gap;
|
|
3276
3301
|
private _overscan;
|
|
3302
|
+
/** Media lifecycle window, deliberately independent from text/canvas overscan. */
|
|
3303
|
+
private _mediaOverscan;
|
|
3277
3304
|
/** Desk padding fed to `computeVisibleRange`: `paddingTop`/`paddingBottom`,
|
|
3278
3305
|
* each defaulting to `gap` (uniform rhythm). Resolved here (not stored) to
|
|
3279
3306
|
* mirror `_gap()`/`_overscan()`, and consumed at EVERY `computeVisibleRange`
|
|
@@ -3292,6 +3319,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
3292
3319
|
* `[0, n-1]`; a `y` below the first slide (inside the leading pad) yields 0. */
|
|
3293
3320
|
private _slideIndexAtOffset;
|
|
3294
3321
|
private _range;
|
|
3322
|
+
private _mediaRange;
|
|
3323
|
+
private _rangeContains;
|
|
3295
3324
|
private _syncSpacer;
|
|
3296
3325
|
/** Horizontal scroll extent: the (uniform deck-wide) slide width plus both
|
|
3297
3326
|
* gutters. A spacer NARROWER than the container never creates a scrollbar
|
|
@@ -3339,6 +3368,20 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
3339
3368
|
* can pass for an old-epoch resolution). We gate them on the captured epoch.
|
|
3340
3369
|
*/
|
|
3341
3370
|
private _renderSlot;
|
|
3371
|
+
/**
|
|
3372
|
+
* Render one mounted slot through the stateful media presentation API.
|
|
3373
|
+
*
|
|
3374
|
+
* This path intentionally bypasses bitmaprenderer even for worker-backed
|
|
3375
|
+
* presentations: presentSlide() renders the base off-thread and composites
|
|
3376
|
+
* interactive video on a main-thread 2D canvas. The slot generation closes the
|
|
3377
|
+
* same-index recycle/reload hole that a viewer-wide render epoch cannot detect.
|
|
3378
|
+
*/
|
|
3379
|
+
private _renderInteractiveSlot;
|
|
3380
|
+
/**
|
|
3381
|
+
* Reconcile stateful media handles against the small media lifecycle range,
|
|
3382
|
+
* independently from the (potentially whole-deck) mounted text range.
|
|
3383
|
+
*/
|
|
3384
|
+
private _syncMediaPlayback;
|
|
3342
3385
|
/** Route an async render failure to `onError`, or `console.error` when none is
|
|
3343
3386
|
* set (so failures are never fully silent), and never after teardown. */
|
|
3344
3387
|
private _reportRenderError;
|
|
@@ -3481,6 +3524,12 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
3481
3524
|
* stretched preview until the instant of the swap — blank-free.
|
|
3482
3525
|
*/
|
|
3483
3526
|
private _settleSlot;
|
|
3527
|
+
/**
|
|
3528
|
+
* Settle an interactive slide onto a spare 2D canvas, then atomically swap it
|
|
3529
|
+
* in and destroy the handle tied to the retired canvas. Pending handles from a
|
|
3530
|
+
* superseded zoom/recycle are destroyed as soon as they resolve.
|
|
3531
|
+
*/
|
|
3532
|
+
private _settleInteractiveSlot;
|
|
3484
3533
|
/**
|
|
3485
3534
|
* Scroll so slide `index`'s top edge sits at the viewport top. Clamps `index` to
|
|
3486
3535
|
* `[0, slideCount-1]` (the pager convention) and the resulting scrollTop to
|
|
@@ -3503,6 +3552,21 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
3503
3552
|
scrollToSlide(index: number, opts?: {
|
|
3504
3553
|
behavior?: 'auto' | 'smooth';
|
|
3505
3554
|
}): void;
|
|
3555
|
+
/** Search the complete presentation, including slides outside the
|
|
3556
|
+
* virtualized mounted window. Matching is case-insensitive by default. */
|
|
3557
|
+
findText(query: string, opts?: FindMatchesOptions): Promise<FindMatch<PptxMatchLocation>[]>;
|
|
3558
|
+
/** Activate and reveal the next match, wrapping at the end. */
|
|
3559
|
+
findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
|
|
3560
|
+
/** Activate and reveal the previous match, wrapping at the beginning. */
|
|
3561
|
+
findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
|
|
3562
|
+
/** Clear the current query and every mounted highlight. */
|
|
3563
|
+
clearFind(): void;
|
|
3564
|
+
private _activateMatch;
|
|
3565
|
+
private _collectSlideRuns;
|
|
3566
|
+
private _redrawHighlights;
|
|
3567
|
+
private _refreshFindRuns;
|
|
3568
|
+
private _redrawSlotHighlights;
|
|
3569
|
+
private _measureForFind;
|
|
3506
3570
|
/**
|
|
3507
3571
|
* IX1 hyperlink click dispatch (mirrors {@link PptxViewer._onHyperlinkClick}).
|
|
3508
3572
|
* When the integrator supplies `opts.onHyperlinkClick` it OWNS the click (no
|
package/package.json
CHANGED