@silurus/ooxml 0.82.1 → 0.83.1
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 +74 -5
- package/dist/assets/render-worker-4GSYWsM3.js +11 -0
- package/dist/assets/{render-worker-Cy-QsDge.js → render-worker-DwFpY197.js} +4 -4
- package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
- package/dist/{comment-ui-runtime-C1RV_3iu.js → comment-ui-runtime-BelHJt73.js} +2 -2
- package/dist/{comment-ui-runtime-DgCZpPR0.js → comment-ui-runtime-DD5a3x3k.js} +2 -2
- package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
- package/dist/{document-pull-client-B1WOjA0z.js → document-pull-client-DSx36ZsB.js} +4519 -3952
- package/dist/docx-BF-WKW73.js +2784 -0
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/dom-interaction-boundary-CepOlXt6.js +217 -0
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-D7A_wnJg.js +1003 -0
- package/dist/{line-metrics-B3syvDn2.js → line-metrics-Bpn7OeZD.js} +616 -616
- package/dist/node.mjs +308 -308
- package/dist/pptx-CA-Q09yW.js +3010 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-BC8p7vZQ.js → render-DtbFbO5c.js} +1 -1
- package/dist/{render-worker-host-BNnXCtAu.js → render-worker-host-D1jcACJV.js} +1 -1
- package/dist/{render-worker-host-DhnkTyjj.js → render-worker-host-DCLyw6UR.js} +1 -1
- package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
- package/dist/{session-Da7LEQUB.js → session-CxT-t0BX.js} +107 -94
- package/dist/{slide-pull-client-Bg9DusLX.js → slide-pull-client-B9rcJdO4.js} +1190 -937
- package/dist/types/docx.d.ts +103 -8
- package/dist/types/index.d.ts +195 -13
- package/dist/types/node.d.ts +2 -2
- package/dist/types/pptx.d.ts +100 -5
- package/dist/types/xlsx.d.ts +2 -2
- package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
- package/dist/{xlsx-DMWeXT-c.js → xlsx-BibrHQ52.js} +476 -476
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +3 -1
- package/dist/assets/render-worker-aHayzR7v.js +0 -11
- package/dist/docx-HoZXZUPA.js +0 -2162
- package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
- package/dist/line-distribute-iXsUCIH-.js +0 -1003
- package/dist/pptx-DEUP4Yq5.js +0 -2432
- /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-X54si2ob.js} +0 -0
- /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-Hes0z_Mj.js} +0 -0
package/dist/types/docx.d.ts
CHANGED
|
@@ -1069,7 +1069,7 @@ interface ChartRegionMapRenderer {
|
|
|
1069
1069
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
1070
1070
|
}
|
|
1071
1071
|
//#endregion
|
|
1072
|
-
//#region dist/.types-work/hyperlink-
|
|
1072
|
+
//#region dist/.types-work/hyperlink-Bk5fiM_m.d.ts
|
|
1073
1073
|
type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
|
|
1074
1074
|
type OoxmlErrorStage = 'container' | 'decompression' | 'parsing' | 'serialization' | 'layout' | 'rendering' | 'worker';
|
|
1075
1075
|
declare class OoxmlError extends Error {
|
|
@@ -1142,6 +1142,14 @@ interface OoxmlResourceLimits {
|
|
|
1142
1142
|
maxTotalInflatedBytes?: OoxmlResourceLimit;
|
|
1143
1143
|
maxArchiveEntries?: OoxmlResourceLimit;
|
|
1144
1144
|
}
|
|
1145
|
+
interface ProgressiveLayoutProgress {
|
|
1146
|
+
committedUnits: number;
|
|
1147
|
+
}
|
|
1148
|
+
interface ProgressiveLayoutPartial {
|
|
1149
|
+
availableUnits: number;
|
|
1150
|
+
totalUnits?: number;
|
|
1151
|
+
exact: boolean;
|
|
1152
|
+
}
|
|
1145
1153
|
interface LoadOptions$1 {
|
|
1146
1154
|
useGoogleFonts?: boolean;
|
|
1147
1155
|
password?: string;
|
|
@@ -1236,7 +1244,7 @@ interface FindHighlightColors {
|
|
|
1236
1244
|
active?: string;
|
|
1237
1245
|
}
|
|
1238
1246
|
//#endregion
|
|
1239
|
-
//#region dist/.types-work/types-
|
|
1247
|
+
//#region dist/.types-work/types-B2UaFocY.d.ts
|
|
1240
1248
|
interface DocxDocumentModel {
|
|
1241
1249
|
section: SectionProps;
|
|
1242
1250
|
body: BodyElement[];
|
|
@@ -1979,9 +1987,10 @@ interface RenderPageOptions {
|
|
|
1979
1987
|
defaultTextColor?: string;
|
|
1980
1988
|
onTextRun?: (run: DocxTextRunInfo) => void;
|
|
1981
1989
|
currentDate?: Date | number;
|
|
1990
|
+
showTrackedChanges?: boolean;
|
|
1982
1991
|
}
|
|
1983
1992
|
//#endregion
|
|
1984
|
-
//#region dist/.types-work/docx-
|
|
1993
|
+
//#region dist/.types-work/docx-CyuBv4wv.d.ts
|
|
1985
1994
|
interface CommentAnchorRange {
|
|
1986
1995
|
readonly commentId: string;
|
|
1987
1996
|
readonly source: Readonly<DocxStorySource>;
|
|
@@ -2088,6 +2097,7 @@ declare function readDocxTextSelectionContext(root: HTMLElement, selection: Sele
|
|
|
2088
2097
|
interface DocxElementContextOptions {
|
|
2089
2098
|
readonly maxTextCharacters?: number;
|
|
2090
2099
|
readonly currentDate?: Date | number;
|
|
2100
|
+
readonly showTrackedChanges?: boolean;
|
|
2091
2101
|
}
|
|
2092
2102
|
interface RevisionAnchorRange {
|
|
2093
2103
|
readonly revisionIndex: number;
|
|
@@ -2104,8 +2114,15 @@ declare function resolveRevisionAnchorRuns(anchor: Readonly<RevisionAnchorRange>
|
|
|
2104
2114
|
interface LoadOptions extends LoadOptions$1 {
|
|
2105
2115
|
math?: MathRenderer;
|
|
2106
2116
|
mode?: 'main' | 'worker';
|
|
2117
|
+
sliceLayout?: boolean;
|
|
2118
|
+
onLayoutProgress?: (progress: Readonly<ProgressiveLayoutProgress>) => void;
|
|
2119
|
+
progressiveLayout?: boolean;
|
|
2120
|
+
onLayoutComplete?: (error?: unknown) => void;
|
|
2121
|
+
onLayoutPartial?: (progress: Readonly<ProgressiveLayoutPartial>) => void;
|
|
2122
|
+
showTrackedChanges?: boolean;
|
|
2123
|
+
currentDate?: Date | number;
|
|
2107
2124
|
}
|
|
2108
|
-
type CollectPageRunsOptions = Pick<RenderPageOptions, 'width' | 'currentDate'>;
|
|
2125
|
+
type CollectPageRunsOptions = Pick<RenderPageOptions, 'width' | 'currentDate' | 'showTrackedChanges'>;
|
|
2109
2126
|
interface DocxPageCommentThreadsOptions extends CollectPageRunsOptions, ResolveDocxCommentThreadsOptions {}
|
|
2110
2127
|
type RenderPageToBitmapOptions = Omit<RenderPageOptions, 'onTextRun'> & {
|
|
2111
2128
|
onTextRun?: (run: DocxTextRunInfo) => void;
|
|
@@ -2116,10 +2133,19 @@ declare class DocxDocument {
|
|
|
2116
2133
|
private _source;
|
|
2117
2134
|
private _meta;
|
|
2118
2135
|
private _review;
|
|
2136
|
+
private readonly _layoutLifecycle;
|
|
2137
|
+
private readonly _layoutObservers;
|
|
2138
|
+
private _layoutCompletion;
|
|
2139
|
+
private _layoutAbort;
|
|
2119
2140
|
private _bookmarkPages;
|
|
2120
2141
|
private _commentAnchorRanges;
|
|
2121
2142
|
private _revisionAnchorRanges;
|
|
2122
|
-
private
|
|
2143
|
+
private _reviewProjectionIndex;
|
|
2144
|
+
private _parseRequestId;
|
|
2145
|
+
private _progressive;
|
|
2146
|
+
private _parseWatchdog;
|
|
2147
|
+
private _parseWatchdogMs;
|
|
2148
|
+
private _layoutViewGeneration;
|
|
2123
2149
|
private _mode;
|
|
2124
2150
|
private _threeD;
|
|
2125
2151
|
private _regionMap;
|
|
@@ -2134,6 +2160,18 @@ declare class DocxDocument {
|
|
|
2134
2160
|
private constructor();
|
|
2135
2161
|
static load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<DocxDocument>;
|
|
2136
2162
|
private _parse;
|
|
2163
|
+
private _onWorkerLayoutPush;
|
|
2164
|
+
private _applyLayoutPartial;
|
|
2165
|
+
private _onAuthoritativeMeta;
|
|
2166
|
+
private _invalidateLayoutDerivedCaches;
|
|
2167
|
+
private _replaceMainLayoutPublication;
|
|
2168
|
+
private _isLayoutViewActive;
|
|
2169
|
+
private _rearmParseWatchdog;
|
|
2170
|
+
private _clearParseWatchdog;
|
|
2171
|
+
private _onParseWentSilent;
|
|
2172
|
+
private _failWorkerProgressive;
|
|
2173
|
+
private _parseViewFields;
|
|
2174
|
+
private _parseProgressively;
|
|
2137
2175
|
destroy(): void;
|
|
2138
2176
|
getImage(imagePath: string, mimeType: string): Promise<Blob>;
|
|
2139
2177
|
getFontBytes(partPath: string): Promise<Uint8Array>;
|
|
@@ -2141,6 +2179,8 @@ declare class DocxDocument {
|
|
|
2141
2179
|
getResourceMetrics(): Promise<OoxmlResourceMetrics>;
|
|
2142
2180
|
toMarkdown(): Promise<string>;
|
|
2143
2181
|
get pageCount(): number;
|
|
2182
|
+
get layoutComplete(): boolean;
|
|
2183
|
+
waitUntilLayoutComplete(): Promise<void>;
|
|
2144
2184
|
get mode(): 'main' | 'worker';
|
|
2145
2185
|
get document(): DocxDocumentModel;
|
|
2146
2186
|
get comments(): readonly Readonly<DocComment>[];
|
|
@@ -2151,12 +2191,17 @@ declare class DocxDocument {
|
|
|
2151
2191
|
get footnotes(): DocNote[];
|
|
2152
2192
|
get endnotes(): DocNote[];
|
|
2153
2193
|
private _getLayout;
|
|
2194
|
+
setLayoutView(view?: Readonly<{
|
|
2195
|
+
showTrackedChanges?: boolean;
|
|
2196
|
+
currentDate?: Date | number;
|
|
2197
|
+
}>): Promise<void>;
|
|
2154
2198
|
private _getBookmarkPages;
|
|
2155
2199
|
getBookmarkPage(bookmarkName: string): number | undefined;
|
|
2156
2200
|
pageSize(pageIndex: number): {
|
|
2157
2201
|
widthPt: number;
|
|
2158
2202
|
heightPt: number;
|
|
2159
2203
|
};
|
|
2204
|
+
private _withActiveView;
|
|
2160
2205
|
renderPage(target: HTMLCanvasElement | OffscreenCanvas, pageIndex: number, opts?: RenderPageOptions): Promise<void>;
|
|
2161
2206
|
renderPageToBitmap(pageIndex: number, opts?: RenderPageToBitmapOptions): Promise<ImageBitmap>;
|
|
2162
2207
|
collectPageRuns(pageIndex: number, opts?: CollectPageRunsOptions): Promise<DocxTextRunInfo[]>;
|
|
@@ -2173,7 +2218,7 @@ interface DocxViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>, LoadOp
|
|
|
2173
2218
|
onSelectionContextChange?: (context: DocxSelectionContext | null) => void;
|
|
2174
2219
|
onContextMenu?: (event: ViewerContextMenuEvent<DocxSelectionContext>) => void;
|
|
2175
2220
|
findHighlightColors?: FindHighlightColors;
|
|
2176
|
-
onPageChange?: (index: number, total: number) => void;
|
|
2221
|
+
onPageChange?: (index: number, total: number, layoutComplete: boolean) => void;
|
|
2177
2222
|
zoomMin?: number;
|
|
2178
2223
|
zoomMax?: number;
|
|
2179
2224
|
onScaleChange?: (scale: number) => void;
|
|
@@ -2195,6 +2240,7 @@ declare class DocxViewer implements ZoomableViewer {
|
|
|
2195
2240
|
private _highlightLayer;
|
|
2196
2241
|
private _elementLayer;
|
|
2197
2242
|
private _find;
|
|
2243
|
+
private _findRequestGeneration;
|
|
2198
2244
|
private _measureCtx;
|
|
2199
2245
|
private _opts;
|
|
2200
2246
|
private readonly _mode;
|
|
@@ -2205,6 +2251,14 @@ declare class DocxViewer implements ZoomableViewer {
|
|
|
2205
2251
|
private _selectionContextKey;
|
|
2206
2252
|
private _elementContext;
|
|
2207
2253
|
private _elementHitGeneration;
|
|
2254
|
+
private _layoutViewGeneration;
|
|
2255
|
+
private _layoutViewPublicationGeneration;
|
|
2256
|
+
private _navigationGeneration;
|
|
2257
|
+
private _layoutUnsubscribe;
|
|
2258
|
+
private _internalHyperlinkGeneration;
|
|
2259
|
+
private readonly _layoutWaiters;
|
|
2260
|
+
private _layoutFailed;
|
|
2261
|
+
private readonly _loadingLayer;
|
|
2208
2262
|
private _elementClickListener;
|
|
2209
2263
|
private _contextMenuListener;
|
|
2210
2264
|
static fromDocument(canvas: HTMLCanvasElement, document: DocxDocument, opts?: Omit<DocxViewerOptions, keyof LoadOptions>): Omit<DocxViewer, 'load'>;
|
|
@@ -2212,6 +2266,8 @@ declare class DocxViewer implements ZoomableViewer {
|
|
|
2212
2266
|
load(source: string | ArrayBuffer): Promise<void>;
|
|
2213
2267
|
get pageCount(): number;
|
|
2214
2268
|
get currentPage(): number;
|
|
2269
|
+
get layoutComplete(): boolean;
|
|
2270
|
+
waitUntilLayoutComplete(): Promise<void>;
|
|
2215
2271
|
get canvasElement(): HTMLCanvasElement;
|
|
2216
2272
|
goToPage(index: number): Promise<void>;
|
|
2217
2273
|
nextPage(): Promise<void>;
|
|
@@ -2247,12 +2303,22 @@ declare class DocxViewer implements ZoomableViewer {
|
|
|
2247
2303
|
private _render;
|
|
2248
2304
|
private _reportRenderError;
|
|
2249
2305
|
private _renderPage;
|
|
2306
|
+
private _bindLayoutDocument;
|
|
2307
|
+
private _unbindLayoutDocument;
|
|
2308
|
+
private _onLayoutPublication;
|
|
2309
|
+
private _onLayoutViewPublication;
|
|
2310
|
+
private _waitForPage;
|
|
2311
|
+
private _wakeLayoutWaiters;
|
|
2312
|
+
private _cancelPendingNavigation;
|
|
2313
|
+
private _setLoading;
|
|
2314
|
+
setShowTrackedChanges(value: boolean): Promise<void>;
|
|
2250
2315
|
private _buildHighlightLayer;
|
|
2251
2316
|
private _canvasCssPx;
|
|
2252
2317
|
private _measureForFont;
|
|
2253
2318
|
private _collectPageRuns;
|
|
2254
2319
|
private _buildTextLayer;
|
|
2255
2320
|
private _hyperlinkHandler;
|
|
2321
|
+
private _navigateInternalHyperlink;
|
|
2256
2322
|
}
|
|
2257
2323
|
interface DocxCommentsOptions extends ViewerCommentsOptions {
|
|
2258
2324
|
readonly cards?: boolean;
|
|
@@ -2268,6 +2334,8 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
|
|
|
2268
2334
|
paddingLeft?: number;
|
|
2269
2335
|
paddingRight?: number;
|
|
2270
2336
|
overscan?: number;
|
|
2337
|
+
progressiveLayout?: boolean;
|
|
2338
|
+
sliceLayout?: boolean;
|
|
2271
2339
|
enableTextSelection?: boolean;
|
|
2272
2340
|
comments?: boolean | DocxCommentsOptions;
|
|
2273
2341
|
enableElementSelection?: boolean;
|
|
@@ -2280,7 +2348,7 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
|
|
|
2280
2348
|
refitOnResize?: boolean;
|
|
2281
2349
|
background?: string;
|
|
2282
2350
|
pageShadow?: string | false;
|
|
2283
|
-
onVisiblePageChange?: (topIndex: number, total: number) => void;
|
|
2351
|
+
onVisiblePageChange?: (topIndex: number, total: number, layoutComplete: boolean) => void;
|
|
2284
2352
|
onScaleChange?: (scale: number) => void;
|
|
2285
2353
|
onHyperlinkClick?: (target: HyperlinkTarget) => void;
|
|
2286
2354
|
enableHyperlinks?: boolean;
|
|
@@ -2291,6 +2359,7 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2291
2359
|
private get _doc();
|
|
2292
2360
|
private readonly _borrowed;
|
|
2293
2361
|
private readonly _opts;
|
|
2362
|
+
private readonly _errorRouter;
|
|
2294
2363
|
private readonly _container;
|
|
2295
2364
|
private readonly _wrapper;
|
|
2296
2365
|
private readonly _scrollHost;
|
|
@@ -2305,6 +2374,11 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2305
2374
|
private _scrollGeometry;
|
|
2306
2375
|
private _lastRange;
|
|
2307
2376
|
private _lastTopIndex;
|
|
2377
|
+
private _lastReportedTotal;
|
|
2378
|
+
private _lastReportedLayoutComplete;
|
|
2379
|
+
private _layoutUnsubscribe;
|
|
2380
|
+
private _presentedPageCount;
|
|
2381
|
+
private _pendingLayoutPublication;
|
|
2308
2382
|
private _scrollListener;
|
|
2309
2383
|
private _selectionChangeListener;
|
|
2310
2384
|
private _selectionContextKey;
|
|
@@ -2320,8 +2394,10 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2320
2394
|
private readonly _commentIndexedPages;
|
|
2321
2395
|
private _commentScanFrontier;
|
|
2322
2396
|
private _commentNavigationGeneration;
|
|
2397
|
+
private _internalHyperlinkGeneration;
|
|
2323
2398
|
private _commentAnchorRangesForMargin;
|
|
2324
2399
|
private _commentAnchorIds;
|
|
2400
|
+
private _reviewOriginPx;
|
|
2325
2401
|
private _commentGeometryScheduled;
|
|
2326
2402
|
private _commentGeometryFrame;
|
|
2327
2403
|
private readonly _pendingCommentGeometry;
|
|
@@ -2339,10 +2415,25 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2339
2415
|
private readonly _pageShadow;
|
|
2340
2416
|
private readonly _find;
|
|
2341
2417
|
private _findActive;
|
|
2418
|
+
private _findRequestGeneration;
|
|
2419
|
+
private _showTrackedChanges;
|
|
2420
|
+
private _currentDate;
|
|
2421
|
+
private _layoutViewGeneration;
|
|
2422
|
+
private _layoutViewPublicationGeneration;
|
|
2342
2423
|
static fromDocument(container: HTMLElement, document: DocxDocument, opts?: Omit<DocxScrollViewerOptions, keyof LoadOptions>): Omit<DocxScrollViewer, 'load'>;
|
|
2343
2424
|
constructor(container: HTMLElement, opts?: DocxScrollViewerOptions);
|
|
2344
2425
|
load(source: string | ArrayBuffer): Promise<void>;
|
|
2345
2426
|
get pageCount(): number;
|
|
2427
|
+
get layoutComplete(): boolean;
|
|
2428
|
+
waitUntilLayoutComplete(): Promise<void>;
|
|
2429
|
+
private _bindLayoutDocument;
|
|
2430
|
+
private _unbindLayoutDocument;
|
|
2431
|
+
private _onLayoutPublication;
|
|
2432
|
+
private _onLayoutViewPublication;
|
|
2433
|
+
private _refreshCommentSurface;
|
|
2434
|
+
private _applyLayoutPublication;
|
|
2435
|
+
private _revealPendingLayoutAtPresentedTail;
|
|
2436
|
+
private _revealPendingLayoutThroughPage;
|
|
2346
2437
|
private _pageWidthPx;
|
|
2347
2438
|
private _pageHeightPx;
|
|
2348
2439
|
private _fitWidthPx;
|
|
@@ -2368,6 +2459,7 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2368
2459
|
private _syncSpacerWidth;
|
|
2369
2460
|
private _onScroll;
|
|
2370
2461
|
private _mountVisible;
|
|
2462
|
+
private _emitVisiblePageChange;
|
|
2371
2463
|
private _applyPageShadow;
|
|
2372
2464
|
private _acquireSlot;
|
|
2373
2465
|
private _recycleSlot;
|
|
@@ -2375,6 +2467,7 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2375
2467
|
private _dpr;
|
|
2376
2468
|
private _renderSlot;
|
|
2377
2469
|
private _hyperlinkHandler;
|
|
2470
|
+
private _navigateInternalHyperlink;
|
|
2378
2471
|
private _measureForFont;
|
|
2379
2472
|
private _canvasCssPx;
|
|
2380
2473
|
private _reportRenderError;
|
|
@@ -2388,9 +2481,11 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2388
2481
|
private _fit;
|
|
2389
2482
|
private _previewVisible;
|
|
2390
2483
|
private _previewSlot;
|
|
2484
|
+
private _clearTextLayerPreview;
|
|
2391
2485
|
private _scheduleSettle;
|
|
2392
2486
|
private _settleRender;
|
|
2393
|
-
private
|
|
2487
|
+
private _refreshSlotAtomically;
|
|
2488
|
+
setShowTrackedChanges(value: boolean): Promise<void>;
|
|
2394
2489
|
scrollToPage(index: number, opts?: {
|
|
2395
2490
|
behavior?: 'auto' | 'smooth';
|
|
2396
2491
|
}): void;
|