@silurus/ooxml 0.82.0 → 0.83.0
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 +72 -3
- package/dist/assets/{render-worker-7-Zr7fSw.js → render-worker-Bu31cf1J.js} +4 -4
- package/dist/assets/render-worker-DuztdEcX.js +11 -0
- package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
- package/dist/{comment-ui-runtime-BAe30Ct9.js → comment-ui-runtime-BelHJt73.js} +3 -3
- package/dist/{comment-ui-runtime-BUCj4hWn.js → comment-ui-runtime-DD5a3x3k.js} +3 -3
- package/dist/comment-ui-runtime-DTGN3Vyy.js +2 -0
- package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
- package/dist/{document-pull-client-BCgmytqI.js → document-pull-client-BAhqoTmm.js} +4509 -3953
- package/dist/docx-Dg73PGgC.js +2707 -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-BcUCETmQ.js +2990 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{read-only-comment-margin-Dn2y55W6.js → read-only-comment-margin-DrUX-YrP.js} +1 -1
- package/dist/{render-CenWM4g1.js → render-CL-7V3E8.js} +1 -1
- package/dist/{render-worker-host-BNENN3qP.js → render-worker-host-DDZo0feh.js} +1 -1
- package/dist/{render-worker-host-BmH3kGSj.js → render-worker-host-FJ19-fUI.js} +1 -1
- package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
- package/dist/{session-Cky_swUj.js → session-BjydZEDF.js} +107 -94
- package/dist/{slide-pull-client-CqTVFb3W.js → slide-pull-client-CwvvncPA.js} +1199 -970
- package/dist/types/docx.d.ts +99 -7
- package/dist/types/index.d.ts +189 -12
- package/dist/types/node.d.ts +385 -379
- package/dist/types/pptx.d.ts +96 -5
- package/dist/types/xlsx.d.ts +4 -2
- package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
- package/dist/{xlsx-DlV37-0j.js → xlsx-BibrHQ52.js} +477 -477
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +4 -1
- package/dist/assets/render-worker-B5gsW6b5.js +0 -11
- package/dist/comment-ui-runtime-F4a3te6p.js +0 -2
- package/dist/docx-wokGKYfi.js +0 -2162
- package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
- package/dist/line-distribute-iXsUCIH-.js +0 -1003
- package/dist/pptx-DU8L8I2T.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/pptx.d.ts
CHANGED
|
@@ -1275,7 +1275,7 @@ interface ChartRegionMapRenderer {
|
|
|
1275
1275
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
1276
1276
|
}
|
|
1277
1277
|
//#endregion
|
|
1278
|
-
//#region dist/.types-work/hyperlink-
|
|
1278
|
+
//#region dist/.types-work/hyperlink-Bk5fiM_m.d.ts
|
|
1279
1279
|
type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
|
|
1280
1280
|
type OoxmlErrorStage = 'container' | 'decompression' | 'parsing' | 'serialization' | 'layout' | 'rendering' | 'worker';
|
|
1281
1281
|
declare class OoxmlError extends Error {
|
|
@@ -1348,6 +1348,14 @@ interface OoxmlResourceLimits {
|
|
|
1348
1348
|
maxTotalInflatedBytes?: OoxmlResourceLimit;
|
|
1349
1349
|
maxArchiveEntries?: OoxmlResourceLimit;
|
|
1350
1350
|
}
|
|
1351
|
+
interface ProgressiveLayoutProgress {
|
|
1352
|
+
committedUnits: number;
|
|
1353
|
+
}
|
|
1354
|
+
interface ProgressiveLayoutPartial {
|
|
1355
|
+
availableUnits: number;
|
|
1356
|
+
totalUnits?: number;
|
|
1357
|
+
exact: boolean;
|
|
1358
|
+
}
|
|
1351
1359
|
interface LoadOptions$1 {
|
|
1352
1360
|
useGoogleFonts?: boolean;
|
|
1353
1361
|
password?: string;
|
|
@@ -1442,7 +1450,7 @@ interface FindHighlightColors {
|
|
|
1442
1450
|
active?: string;
|
|
1443
1451
|
}
|
|
1444
1452
|
//#endregion
|
|
1445
|
-
//#region dist/.types-work/
|
|
1453
|
+
//#region dist/.types-work/types-PWBS8kGC.d.ts
|
|
1446
1454
|
interface BlipBullet {
|
|
1447
1455
|
type: 'blip';
|
|
1448
1456
|
imagePath: string;
|
|
@@ -1703,6 +1711,8 @@ interface PictureElement {
|
|
|
1703
1711
|
scene3d?: Scene3d;
|
|
1704
1712
|
sp3d?: Sp3d;
|
|
1705
1713
|
}
|
|
1714
|
+
//#endregion
|
|
1715
|
+
//#region dist/.types-work/pptx-Btl3_eEe.d.ts
|
|
1706
1716
|
interface PptxTextRunInfo {
|
|
1707
1717
|
elementIndex?: number;
|
|
1708
1718
|
origin?: SlideElementOrigin;
|
|
@@ -1827,6 +1837,10 @@ interface PptxElementBounds {
|
|
|
1827
1837
|
type PptxSelectionContext = PptxTextSelectionContext | PptxCommentSelectionContext | PptxElementContext;
|
|
1828
1838
|
type LoadOptions = LoadOptions$1 & {
|
|
1829
1839
|
mode?: 'main' | 'worker';
|
|
1840
|
+
progressiveLayout?: boolean;
|
|
1841
|
+
onLayoutProgress?: (progress: Readonly<ProgressiveLayoutProgress>) => void;
|
|
1842
|
+
onLayoutPartial?: (progress: Readonly<ProgressiveLayoutPartial>) => void;
|
|
1843
|
+
onLayoutComplete?: (error?: unknown) => void;
|
|
1830
1844
|
};
|
|
1831
1845
|
interface RenderSlideToBitmapOptions {
|
|
1832
1846
|
width?: number;
|
|
@@ -1849,13 +1863,27 @@ declare class PptxPresentation {
|
|
|
1849
1863
|
private readonly _worker;
|
|
1850
1864
|
private readonly _bridge;
|
|
1851
1865
|
private _mode;
|
|
1866
|
+
private _bootstrap;
|
|
1852
1867
|
private _preflight;
|
|
1868
|
+
private _availableSlideCount;
|
|
1869
|
+
private readonly _layoutLifecycle;
|
|
1870
|
+
private readonly _layoutObservers;
|
|
1871
|
+
private _layoutCompletion;
|
|
1872
|
+
private _parseRequestId;
|
|
1873
|
+
private _progressive;
|
|
1874
|
+
private _progressiveWatchdog;
|
|
1875
|
+
private _progressiveWatchdogMs;
|
|
1876
|
+
private readonly _layoutWaiters;
|
|
1853
1877
|
private _slides;
|
|
1854
1878
|
private _slidePullClient;
|
|
1855
1879
|
private _resourceFailure;
|
|
1856
1880
|
private _slidePartIndex;
|
|
1857
1881
|
private readonly _rawParts;
|
|
1858
1882
|
private _googleFontFaces;
|
|
1883
|
+
private _embeddedFontFaces;
|
|
1884
|
+
private _embeddedFontAliases;
|
|
1885
|
+
private _embeddedFontAuthoredFamilies;
|
|
1886
|
+
private _destroyed;
|
|
1859
1887
|
private readonly _fetchImage;
|
|
1860
1888
|
private readonly _fetchMedia;
|
|
1861
1889
|
private _math;
|
|
@@ -1867,7 +1895,22 @@ declare class PptxPresentation {
|
|
|
1867
1895
|
private _rethrowWithResourceFailure;
|
|
1868
1896
|
static load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<PptxPresentation>;
|
|
1869
1897
|
private _parse;
|
|
1898
|
+
private _parseMainProgressively;
|
|
1899
|
+
private _parseWorkerProgressively;
|
|
1900
|
+
private _createSlidePullClient;
|
|
1901
|
+
private _onWorkerLayoutPush;
|
|
1902
|
+
private _applyProgressivePrefix;
|
|
1903
|
+
private _finishProgressiveLayout;
|
|
1904
|
+
private _failProgressiveLayout;
|
|
1905
|
+
private _wakeLayoutWaiters;
|
|
1906
|
+
private _rearmProgressiveWatchdog;
|
|
1907
|
+
private _clearProgressiveWatchdog;
|
|
1908
|
+
private _waitForSlide;
|
|
1909
|
+
private _assertSlideIndex;
|
|
1870
1910
|
get slideCount(): number;
|
|
1911
|
+
get availableSlideCount(): number;
|
|
1912
|
+
get layoutComplete(): boolean;
|
|
1913
|
+
waitUntilLayoutComplete(): Promise<void>;
|
|
1871
1914
|
get slideWidth(): number;
|
|
1872
1915
|
get slideHeight(): number;
|
|
1873
1916
|
get mode(): 'main' | 'worker';
|
|
@@ -1886,6 +1929,7 @@ declare class PptxPresentation {
|
|
|
1886
1929
|
getMedia(mediaPath: string): Promise<Blob>;
|
|
1887
1930
|
private _findMimeTypeForPath;
|
|
1888
1931
|
getImage(imagePath: string, mimeType: string): Promise<Blob>;
|
|
1932
|
+
private getFontBytes;
|
|
1889
1933
|
getResourceMetrics(): Promise<OoxmlResourceMetrics>;
|
|
1890
1934
|
toMarkdown(): Promise<string>;
|
|
1891
1935
|
presentSlide(canvas: HTMLCanvasElement, slideIndex: number, opts?: PresentSlideOptions): Promise<PresentationHandle>;
|
|
@@ -1893,7 +1937,7 @@ declare class PptxPresentation {
|
|
|
1893
1937
|
}
|
|
1894
1938
|
type HiddenSlideMode = 'show' | 'skip' | 'dim';
|
|
1895
1939
|
interface PptxViewerOptions extends Pick<RenderOptions, 'width' | 'dpr'>, LoadOptions {
|
|
1896
|
-
onSlideChange?: (index: number, total: number) => void;
|
|
1940
|
+
onSlideChange?: (index: number, total: number, layoutComplete: boolean) => void;
|
|
1897
1941
|
onError?: (err: Error) => void;
|
|
1898
1942
|
zoomMin?: number;
|
|
1899
1943
|
zoomMax?: number;
|
|
@@ -1919,6 +1963,7 @@ declare class PptxViewer implements ZoomableViewer {
|
|
|
1919
1963
|
private highlightLayer;
|
|
1920
1964
|
private elementLayer;
|
|
1921
1965
|
private _find;
|
|
1966
|
+
private _findGeneration;
|
|
1922
1967
|
private _measureCtx;
|
|
1923
1968
|
private readonly presentationOwner;
|
|
1924
1969
|
private get engine();
|
|
@@ -1926,6 +1971,7 @@ declare class PptxViewer implements ZoomableViewer {
|
|
|
1926
1971
|
private readonly hostWindow;
|
|
1927
1972
|
private readonly opts;
|
|
1928
1973
|
private currentSlide;
|
|
1974
|
+
private _renderedSlide;
|
|
1929
1975
|
private _hiddenMode;
|
|
1930
1976
|
private handle;
|
|
1931
1977
|
private readonly _mode;
|
|
@@ -1939,10 +1985,21 @@ declare class PptxViewer implements ZoomableViewer {
|
|
|
1939
1985
|
private elementContext;
|
|
1940
1986
|
private elementHitGeneration;
|
|
1941
1987
|
private readonly elementHitTolerance;
|
|
1988
|
+
private readonly _loadingLayer;
|
|
1989
|
+
private _layoutUnsubscribe;
|
|
1990
|
+
private readonly _layoutWaiters;
|
|
1991
|
+
private _layoutFailed;
|
|
1992
|
+
private _navigationGeneration;
|
|
1993
|
+
private _renderProgressGeneration;
|
|
1994
|
+
private _lastReportedSlide;
|
|
1995
|
+
private _lastReportedTotal;
|
|
1996
|
+
private _lastReportedAvailable;
|
|
1997
|
+
private _lastReportedLayoutComplete;
|
|
1942
1998
|
static fromPresentation(canvas: HTMLCanvasElement, presentation: PptxPresentation, opts?: Omit<PptxViewerOptions, keyof LoadOptions>): Omit<PptxViewer, 'load'>;
|
|
1943
1999
|
constructor(canvas: HTMLCanvasElement, opts?: PptxViewerOptions);
|
|
1944
2000
|
load(source: string | ArrayBuffer): Promise<void>;
|
|
1945
2001
|
goToSlide(index: number): Promise<void>;
|
|
2002
|
+
private _goToSlide;
|
|
1946
2003
|
nextSlide(): Promise<void>;
|
|
1947
2004
|
prevSlide(): Promise<void>;
|
|
1948
2005
|
private _step;
|
|
@@ -1953,6 +2010,9 @@ declare class PptxViewer implements ZoomableViewer {
|
|
|
1953
2010
|
get visibleSlideCount(): number;
|
|
1954
2011
|
get slideIndex(): number;
|
|
1955
2012
|
get slideCount(): number;
|
|
2013
|
+
get availableSlideCount(): number;
|
|
2014
|
+
get layoutComplete(): boolean;
|
|
2015
|
+
waitUntilLayoutComplete(): Promise<void>;
|
|
1956
2016
|
getNotes(slideIndex: number): string | null;
|
|
1957
2017
|
get canvasElement(): HTMLCanvasElement;
|
|
1958
2018
|
private _naturalWidthPx;
|
|
@@ -1967,6 +2027,14 @@ declare class PptxViewer implements ZoomableViewer {
|
|
|
1967
2027
|
fitPage(): Promise<void>;
|
|
1968
2028
|
private _fit;
|
|
1969
2029
|
private renderCurrentSlide;
|
|
2030
|
+
private _bindLayoutPresentation;
|
|
2031
|
+
private _unbindLayoutPresentation;
|
|
2032
|
+
private _beginNavigation;
|
|
2033
|
+
private _onLayoutPublication;
|
|
2034
|
+
private _waitForSlide;
|
|
2035
|
+
private _wakeLayoutWaiters;
|
|
2036
|
+
private _emitSlideChange;
|
|
2037
|
+
private _setLoading;
|
|
1970
2038
|
private _buildHighlightLayer;
|
|
1971
2039
|
private _measureForFont;
|
|
1972
2040
|
private _collectSlideRuns;
|
|
@@ -1974,6 +2042,7 @@ declare class PptxViewer implements ZoomableViewer {
|
|
|
1974
2042
|
findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
|
|
1975
2043
|
findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
|
|
1976
2044
|
clearFind(): void;
|
|
2045
|
+
private _invalidateFind;
|
|
1977
2046
|
private _activateMatch;
|
|
1978
2047
|
private _redrawHighlights;
|
|
1979
2048
|
private _buildTextLayer;
|
|
@@ -2021,7 +2090,7 @@ interface PptxScrollViewerOptions extends Pick<RenderSlideOptions, 'width' | 'dp
|
|
|
2021
2090
|
refitOnResize?: boolean;
|
|
2022
2091
|
background?: string;
|
|
2023
2092
|
pageShadow?: string | false;
|
|
2024
|
-
onVisibleSlideChange?: (topIndex: number, total: number) => void;
|
|
2093
|
+
onVisibleSlideChange?: (topIndex: number, total: number, layoutComplete: boolean) => void;
|
|
2025
2094
|
onScaleChange?: (scale: number) => void;
|
|
2026
2095
|
onError?: (err: Error) => void;
|
|
2027
2096
|
onHyperlinkClick?: (target: HyperlinkTarget) => void;
|
|
@@ -2032,6 +2101,7 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
2032
2101
|
private get _pres();
|
|
2033
2102
|
private readonly _borrowed;
|
|
2034
2103
|
private readonly _opts;
|
|
2104
|
+
private readonly _errorRouter;
|
|
2035
2105
|
private readonly _container;
|
|
2036
2106
|
private readonly _wrapper;
|
|
2037
2107
|
private readonly _scrollHost;
|
|
@@ -2045,6 +2115,9 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
2045
2115
|
private _uniformSlideHeight;
|
|
2046
2116
|
private _lastRange;
|
|
2047
2117
|
private _lastTopIndex;
|
|
2118
|
+
private _lastReportedTotal;
|
|
2119
|
+
private _lastReportedLayoutComplete;
|
|
2120
|
+
private _layoutUnsubscribe;
|
|
2048
2121
|
private _scrollListener;
|
|
2049
2122
|
private _selectionChangeListener;
|
|
2050
2123
|
private _selectionContextKey;
|
|
@@ -2060,6 +2133,10 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
2060
2133
|
private _commentGeometryFrame;
|
|
2061
2134
|
private readonly _pendingCommentGeometry;
|
|
2062
2135
|
private _hasComments;
|
|
2136
|
+
private _reviewOriginPx;
|
|
2137
|
+
private _commentScanFrontier;
|
|
2138
|
+
private readonly _layoutWaiters;
|
|
2139
|
+
private _layoutFailed;
|
|
2063
2140
|
private _elementHitGeneration;
|
|
2064
2141
|
private readonly _elementHitTolerance;
|
|
2065
2142
|
private _destroyed;
|
|
@@ -2073,12 +2150,16 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
2073
2150
|
private _lastFitWidth;
|
|
2074
2151
|
private readonly _pageShadow;
|
|
2075
2152
|
private readonly _find;
|
|
2153
|
+
private _findGeneration;
|
|
2076
2154
|
private _findActive;
|
|
2077
2155
|
private _findMeasureCtx;
|
|
2078
2156
|
static fromPresentation(container: HTMLElement, presentation: PptxPresentation, opts?: Omit<PptxScrollViewerOptions, keyof LoadOptions>): Omit<PptxScrollViewer, 'load'>;
|
|
2079
2157
|
constructor(container: HTMLElement, opts?: PptxScrollViewerOptions);
|
|
2080
2158
|
load(source: string | ArrayBuffer): Promise<void>;
|
|
2081
2159
|
get slideCount(): number;
|
|
2160
|
+
get availableSlideCount(): number;
|
|
2161
|
+
get layoutComplete(): boolean;
|
|
2162
|
+
waitUntilLayoutComplete(): Promise<void>;
|
|
2082
2163
|
private _slideWidthPx;
|
|
2083
2164
|
private _slideHeightPx;
|
|
2084
2165
|
private _fitWidthPx;
|
|
@@ -2089,7 +2170,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
2089
2170
|
private _commentsOptions;
|
|
2090
2171
|
private _commentSide;
|
|
2091
2172
|
private _syncCommentMarginGeometry;
|
|
2092
|
-
private
|
|
2173
|
+
private _scanAvailableComments;
|
|
2174
|
+
private _refreshDiscoveredComments;
|
|
2093
2175
|
private _baseScale;
|
|
2094
2176
|
relayout(): void;
|
|
2095
2177
|
private _relayout;
|
|
@@ -2115,6 +2197,14 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
2115
2197
|
private _positionSlot;
|
|
2116
2198
|
private _dpr;
|
|
2117
2199
|
private _renderSlot;
|
|
2200
|
+
private _trackSlotLoading;
|
|
2201
|
+
private _bindLayoutPresentation;
|
|
2202
|
+
private _unbindLayoutPresentation;
|
|
2203
|
+
private _onLayoutPublication;
|
|
2204
|
+
private _wakeLayoutWaiters;
|
|
2205
|
+
private _beginCommentNavigation;
|
|
2206
|
+
private _waitForSlideMetadata;
|
|
2207
|
+
private _emitVisibleSlideChange;
|
|
2118
2208
|
private _renderInteractiveSlot;
|
|
2119
2209
|
private _syncMediaPlayback;
|
|
2120
2210
|
private _reportRenderError;
|
|
@@ -2144,6 +2234,7 @@ declare class PptxScrollViewer implements ZoomableViewer {
|
|
|
2144
2234
|
findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
|
|
2145
2235
|
findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
|
|
2146
2236
|
clearFind(): void;
|
|
2237
|
+
private _invalidateFind;
|
|
2147
2238
|
private _activateMatch;
|
|
2148
2239
|
private _collectSlideRuns;
|
|
2149
2240
|
private _redrawHighlights;
|
package/dist/types/xlsx.d.ts
CHANGED
|
@@ -1081,7 +1081,7 @@ interface ChartRegionMapRenderer {
|
|
|
1081
1081
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
1082
1082
|
}
|
|
1083
1083
|
//#endregion
|
|
1084
|
-
//#region dist/.types-work/hyperlink-
|
|
1084
|
+
//#region dist/.types-work/hyperlink-Bk5fiM_m.d.ts
|
|
1085
1085
|
type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
|
|
1086
1086
|
type OoxmlErrorStage = 'container' | 'decompression' | 'parsing' | 'serialization' | 'layout' | 'rendering' | 'worker';
|
|
1087
1087
|
declare class OoxmlError extends Error {
|
|
@@ -1231,7 +1231,7 @@ interface FindHighlightColors {
|
|
|
1231
1231
|
active?: string;
|
|
1232
1232
|
}
|
|
1233
1233
|
//#endregion
|
|
1234
|
-
//#region dist/.types-work/
|
|
1234
|
+
//#region dist/.types-work/types-Dktpy0kq.d.ts
|
|
1235
1235
|
type ShapeFill = Exclude<Fill, {
|
|
1236
1236
|
fillType: 'image';
|
|
1237
1237
|
} | {
|
|
@@ -1983,6 +1983,8 @@ interface XlsxRenderViewportOptions {
|
|
|
1983
1983
|
strong: boolean;
|
|
1984
1984
|
} | null;
|
|
1985
1985
|
}
|
|
1986
|
+
//#endregion
|
|
1987
|
+
//#region dist/.types-work/xlsx-BjLUPERo.d.ts
|
|
1986
1988
|
type ResolvedList = {
|
|
1987
1989
|
kind: 'values';
|
|
1988
1990
|
values: string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as h, r as g, t as _ } from "./resource-measurement-
|
|
1
|
+
import { F as e, Gt as t, I as n, Jt as r, K as i, Kt as a, N as o, P as s, Qt as c, U as l, Ut as u, Wt as d, Xt as f, Yt as p, qt as m } from "./line-metrics-Bpn7OeZD.js";
|
|
2
|
+
import { n as h, r as g, t as _ } from "./resource-measurement-DuiFWzam.js";
|
|
3
3
|
import { t as v } from "./transfer-R6NjgBKD.js";
|
|
4
4
|
//#region packages/xlsx/src/worksheet-resource-limits.ts
|
|
5
|
-
var y =
|
|
5
|
+
var y = f, b = m, x = r, S = p, C = a, w = u, T = d, E = t, D = Object.freeze({
|
|
6
6
|
archiveEntryCount: 0,
|
|
7
7
|
declaredInflatedBytes: 0,
|
|
8
8
|
distinctInflatedBytes: 0,
|
|
@@ -159,7 +159,7 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
159
159
|
get pendingOpenCount() {
|
|
160
160
|
return this.pendingOpens.size;
|
|
161
161
|
}
|
|
162
|
-
async open(
|
|
162
|
+
async open(t, n, r) {
|
|
163
163
|
if (this.resourceFailure) throw this.resourceFailure;
|
|
164
164
|
let i = this.pendingOpens.get(r.sessionId);
|
|
165
165
|
if (!i || i.identity.operationId !== r.operationId || i.identity.generation !== r.generation) throw Error("worksheet pull session open reservation is stale or missing");
|
|
@@ -167,12 +167,12 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
167
167
|
a = e;
|
|
168
168
|
}), s = this.operationTail.then(() => this.coordinator.enqueue(async () => {
|
|
169
169
|
if (i.canceled) throw Error("worksheet pull session open was canceled");
|
|
170
|
-
this.executeArchive((
|
|
170
|
+
this.executeArchive((e) => e.open_sheet_cursor(t, n));
|
|
171
171
|
let o = [], s = {
|
|
172
172
|
rows: 0,
|
|
173
173
|
cells: 0,
|
|
174
174
|
ownedUtf8Bytes: 0
|
|
175
|
-
}, l, u = !1, d = new
|
|
175
|
+
}, l, u = !1, d = new e({
|
|
176
176
|
...r,
|
|
177
177
|
maxByteCredit: z,
|
|
178
178
|
coordinator: this.coordinator,
|
|
@@ -202,7 +202,7 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
202
202
|
measureChunk: ({ payload: e }) => e.byteLength,
|
|
203
203
|
acknowledge: () => {
|
|
204
204
|
if (!u) return;
|
|
205
|
-
let
|
|
205
|
+
let e, n;
|
|
206
206
|
try {
|
|
207
207
|
if (this.acceptWorksheet) {
|
|
208
208
|
if (!l) throw Error("worksheet terminal payload is missing");
|
|
@@ -213,12 +213,12 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
213
213
|
ownedUtf8Bytes: 0
|
|
214
214
|
} : s, i = k(l, r), a = this.readResourceUsage();
|
|
215
215
|
N(i, "get-worksheet-worker", void 0, a), P(i.jsonBytes, "get-worksheet-worker", void 0, a);
|
|
216
|
-
let c = this.acceptWorksheet(
|
|
217
|
-
typeof c == "function" ?
|
|
216
|
+
let c = this.acceptWorksheet(t, l, i, a);
|
|
217
|
+
typeof c == "function" ? e = c : c && ({rollback: e, commit: n} = c);
|
|
218
218
|
}
|
|
219
219
|
this.executeArchive((e) => e.acknowledge_sheet_cursor_terminal()), n?.();
|
|
220
|
-
} catch (
|
|
221
|
-
throw
|
|
220
|
+
} catch (t) {
|
|
221
|
+
throw e?.(), t instanceof c && (this.resourceFailure ??= t), t;
|
|
222
222
|
}
|
|
223
223
|
u = !1, this.sessions.delete(r.sessionId), a();
|
|
224
224
|
},
|
|
@@ -268,7 +268,7 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
268
268
|
if (r && (e.kind === "cancel" || e.kind === "close")) {
|
|
269
269
|
let n = r.identity.operationId === e.operationId && r.identity.generation === e.generation;
|
|
270
270
|
return n && (r.canceled = !0), t(n ? {
|
|
271
|
-
protocol:
|
|
271
|
+
protocol: s,
|
|
272
272
|
kind: "accepted",
|
|
273
273
|
sessionId: e.sessionId,
|
|
274
274
|
operationId: e.operationId,
|
|
@@ -276,7 +276,7 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
276
276
|
requestId: e.requestId,
|
|
277
277
|
command: e.kind
|
|
278
278
|
} : {
|
|
279
|
-
protocol:
|
|
279
|
+
protocol: s,
|
|
280
280
|
kind: "error",
|
|
281
281
|
sessionId: e.sessionId,
|
|
282
282
|
operationId: e.operationId,
|
|
@@ -290,7 +290,7 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
290
290
|
}), Promise.resolve();
|
|
291
291
|
}
|
|
292
292
|
return e.kind === "cancel" || e.kind === "close" ? (t({
|
|
293
|
-
protocol:
|
|
293
|
+
protocol: s,
|
|
294
294
|
kind: "accepted",
|
|
295
295
|
sessionId: e.sessionId,
|
|
296
296
|
operationId: e.operationId,
|
|
@@ -298,13 +298,13 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
298
298
|
requestId: e.requestId,
|
|
299
299
|
command: e.kind
|
|
300
300
|
}), Promise.resolve()) : (t({
|
|
301
|
-
protocol:
|
|
301
|
+
protocol: s,
|
|
302
302
|
kind: "error",
|
|
303
303
|
sessionId: e.sessionId,
|
|
304
304
|
operationId: e.operationId,
|
|
305
305
|
generation: e.generation,
|
|
306
306
|
requestId: e.requestId,
|
|
307
|
-
error:
|
|
307
|
+
error: i(/* @__PURE__ */ Error("worksheet pull session is not open"))
|
|
308
308
|
}), Promise.resolve());
|
|
309
309
|
}
|
|
310
310
|
async dispatchSafely(e, t) {
|
|
@@ -313,13 +313,13 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
313
313
|
} catch (n) {
|
|
314
314
|
try {
|
|
315
315
|
t({
|
|
316
|
-
protocol:
|
|
316
|
+
protocol: s,
|
|
317
317
|
kind: "error",
|
|
318
318
|
sessionId: e.sessionId,
|
|
319
319
|
operationId: e.operationId,
|
|
320
320
|
generation: e.generation,
|
|
321
321
|
requestId: e.requestId,
|
|
322
|
-
error:
|
|
322
|
+
error: i(n)
|
|
323
323
|
});
|
|
324
324
|
} catch {}
|
|
325
325
|
}
|
|
@@ -337,7 +337,7 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
337
337
|
for (let e of this.pendingOpens.values()) e.canceled = !0;
|
|
338
338
|
let e = 1;
|
|
339
339
|
for (let { host: t, identity: n } of [...this.sessions.values()]) await t.dispatch({
|
|
340
|
-
protocol:
|
|
340
|
+
protocol: s,
|
|
341
341
|
kind: "close",
|
|
342
342
|
...n,
|
|
343
343
|
requestId: e++
|
|
@@ -353,7 +353,7 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
353
353
|
let t = this.sessions.get(e.sessionId);
|
|
354
354
|
if (t) {
|
|
355
355
|
await t.host.dispatch({
|
|
356
|
-
protocol:
|
|
356
|
+
protocol: s,
|
|
357
357
|
kind: "close",
|
|
358
358
|
...e,
|
|
359
359
|
requestId: 1
|
|
@@ -365,7 +365,7 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
365
365
|
}
|
|
366
366
|
readResourceUsage() {
|
|
367
367
|
try {
|
|
368
|
-
return
|
|
368
|
+
return l(this.executeArchive((e) => e.sheet_cursor_resource_usage()));
|
|
369
369
|
} catch (e) {
|
|
370
370
|
if (String(e).includes("worksheet cursor usage is unavailable")) return;
|
|
371
371
|
throw e;
|
|
@@ -381,24 +381,24 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
381
381
|
if (!Number.isSafeInteger(e) || e < 0) throw RangeError("sheetIndex must be a non-negative safe integer");
|
|
382
382
|
if (!t) throw TypeError("sheetName must be non-empty");
|
|
383
383
|
W(n);
|
|
384
|
-
let
|
|
385
|
-
sessionId:
|
|
386
|
-
operationId:
|
|
384
|
+
let r = this.nextSessionId++, i = {
|
|
385
|
+
sessionId: r,
|
|
386
|
+
operationId: r,
|
|
387
387
|
generation: this.options.generation ?? 1
|
|
388
|
-
},
|
|
389
|
-
...
|
|
388
|
+
}, a = new o(this.options.transport, {
|
|
389
|
+
...i,
|
|
390
390
|
maxByteCredit: z,
|
|
391
391
|
timeoutMs: this.options.timeoutMs,
|
|
392
392
|
disposeTransferred: this.options.disposeTransferred
|
|
393
393
|
});
|
|
394
|
-
this.active.add(
|
|
394
|
+
this.active.add(a);
|
|
395
395
|
let s = !1, c;
|
|
396
396
|
try {
|
|
397
|
-
for (await this.options.open(e, t,
|
|
397
|
+
for (await this.options.open(e, t, i, this.options.timeoutMs);;) {
|
|
398
398
|
W(n);
|
|
399
|
-
let e = await
|
|
399
|
+
let e = await a.pull(z, { signal: n });
|
|
400
400
|
try {
|
|
401
|
-
let t = e.usage ??
|
|
401
|
+
let t = e.usage ?? a.usageCheckpoint;
|
|
402
402
|
t && this.options.onUsage?.(t);
|
|
403
403
|
let r = R(e.payload, e.done, this.options.sharedStrings);
|
|
404
404
|
if (yield r.kind === "rows" ? {
|
|
@@ -426,11 +426,11 @@ var z = 64 * 1024 * 1024, B = class {
|
|
|
426
426
|
} finally {
|
|
427
427
|
let e;
|
|
428
428
|
try {
|
|
429
|
-
s || await
|
|
429
|
+
s || await a.cancel(U(c));
|
|
430
430
|
} catch (t) {
|
|
431
431
|
e = t;
|
|
432
432
|
} finally {
|
|
433
|
-
this.active.delete(
|
|
433
|
+
this.active.delete(a);
|
|
434
434
|
}
|
|
435
435
|
if (c === void 0 && e !== void 0) throw e;
|
|
436
436
|
}
|