@silurus/ooxml 0.81.0 → 0.82.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 +4 -8
- package/dist/assets/render-worker-7-Zr7fSw.js +10 -0
- package/dist/assets/{render-worker-C2ACcLes.js → render-worker-B5gsW6b5.js} +4 -4
- package/dist/assets/{render-worker-DtU8oQZ7.js → render-worker-Dw_wQRIh.js} +1 -1
- package/dist/{canvas-viewer-mechanics-CqxKRGCp.js → canvas-viewer-mechanics-CS_qbr6T.js} +1 -1
- package/dist/chart-ex.mjs +4 -4
- package/dist/comment-occurrence-C34fWs_F.js +6 -0
- package/dist/comment-ui-runtime-BAe30Ct9.js +112 -0
- package/dist/comment-ui-runtime-BUCj4hWn.js +171 -0
- package/dist/comment-ui-runtime-F4a3te6p.js +2 -0
- package/dist/comments-Cf9W7r3M.js +241 -0
- package/dist/{document-pull-client-Ux4a_ax8.js → document-pull-client-BCgmytqI.js} +2205 -2192
- package/dist/{docx-SEyQ4gS-.js → docx-wokGKYfi.js} +674 -249
- package/dist/docx.mjs +6 -5
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/dom-interaction-boundary-C8F6HO5x.js +119 -0
- package/dist/highlight-rect-MaCt0om0.js +13 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-BBGvvwLt.js → line-distribute-iXsUCIH-.js} +2 -2
- package/dist/{line-metrics-Baz31mML.js → line-metrics-B3syvDn2.js} +52 -52
- package/dist/math.mjs +2 -2
- package/dist/node.mjs +10 -10
- package/dist/{plot-area-frame-Dg1VIpUU.js → plot-area-frame-DHV02PJU.js} +591 -590
- package/dist/{pptx-5lQrMvMR.js → pptx-DU8L8I2T.js} +537 -243
- package/dist/pptx.mjs +6 -6
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/read-only-comment-decoration-DcFevX_Q.js +96 -0
- package/dist/read-only-comment-margin-Dn2y55W6.js +189 -0
- package/dist/region-map.mjs +2 -2
- package/dist/{render-DEHjijQD.js → render-CenWM4g1.js} +1 -1
- package/dist/{render-worker-host-Dg_74V64.js → render-worker-host-BNENN3qP.js} +1 -1
- package/dist/{render-worker-host-B1nbV_k7.js → render-worker-host-BmH3kGSj.js} +1 -1
- package/dist/{render-worker-host-Bze5M6k5.js → render-worker-host-CmPBviYJ.js} +1 -1
- package/dist/{renderer-DuopJE1K.js → renderer-CYr9YTXM.js} +436 -435
- package/dist/{resource-measurement-DRLp4nFt.js → resource-measurement-CsW4_eYt.js} +2 -2
- package/dist/{session-CNVc3VJ4.js → session-Cky_swUj.js} +3 -3
- package/dist/{slide-pull-client-CzutXnGc.js → slide-pull-client-CqTVFb3W.js} +490 -383
- package/dist/source-key-BklvnEyQ.js +42 -0
- package/dist/{three-d-BYiWCNlz.js → three-d-7MaVzQuZ.js} +48 -47
- package/dist/three-d.mjs +324 -323
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +181 -19
- package/dist/types/index.d.ts +337 -26
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +84 -10
- package/dist/types/pptx.d.ts +130 -11
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/xlsx.d.ts +76 -10
- package/dist/units-BzZ0gAxs.js +4 -0
- package/dist/{worksheet-pull-client-Cxj3Ej0s.js → worksheet-pull-client-CYtwXP5D.js} +3 -3
- package/dist/{xlsx-Bl3TIEVu.js → xlsx-DlV37-0j.js} +429 -218
- package/dist/xlsx.mjs +6 -6
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-Cx5uR77k.js +0 -10
- package/dist/highlight-rect-BqcZMHUE.js +0 -48
- /package/dist/{mathjax-DJa-Q93p.js → mathjax-DwIrafQ6.js} +0 -0
- /package/dist/{renderer-module-contract-0bO_5SC0.js → renderer-module-contract-DLbb7zY0.js} +0 -0
- /package/dist/{transfer-D0U6Uhn4.js → transfer-R6NjgBKD.js} +0 -0
- /package/dist/{visible-index-DbDuGMCE.js → visible-index-BFE3PWiY.js} +0 -0
package/dist/types/chart-ex.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region dist/.types-work/chart-
|
|
1
|
+
//#region dist/.types-work/chart-qJPl2r8m.d.ts
|
|
2
2
|
interface Duotone {
|
|
3
3
|
clr1: string;
|
|
4
4
|
clr2: string;
|
|
@@ -938,7 +938,7 @@ interface ChartRect {
|
|
|
938
938
|
h: number;
|
|
939
939
|
}
|
|
940
940
|
//#endregion
|
|
941
|
-
//#region dist/.types-work/chart-ex-contract-
|
|
941
|
+
//#region dist/.types-work/chart-ex-contract-Ba0xG5gE.d.ts
|
|
942
942
|
interface ChartExRenderer {
|
|
943
943
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
944
944
|
}
|
package/dist/types/docx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region dist/.types-work/chart-
|
|
1
|
+
//#region dist/.types-work/chart-qJPl2r8m.d.ts
|
|
2
2
|
type MathStyle = 'roman' | 'italic' | 'bold' | 'boldItalic';
|
|
3
3
|
interface MathRun {
|
|
4
4
|
kind: 'run';
|
|
@@ -1042,12 +1042,12 @@ interface ChartRect {
|
|
|
1042
1042
|
h: number;
|
|
1043
1043
|
}
|
|
1044
1044
|
//#endregion
|
|
1045
|
-
//#region dist/.types-work/chart-ex-contract-
|
|
1045
|
+
//#region dist/.types-work/chart-ex-contract-Ba0xG5gE.d.ts
|
|
1046
1046
|
interface ChartExRenderer {
|
|
1047
1047
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
1048
1048
|
}
|
|
1049
1049
|
//#endregion
|
|
1050
|
-
//#region dist/.types-work/mathjax-
|
|
1050
|
+
//#region dist/.types-work/mathjax-DwKoKmdb.d.ts
|
|
1051
1051
|
interface MathSvg {
|
|
1052
1052
|
svg: string;
|
|
1053
1053
|
widthEm: number;
|
|
@@ -1059,17 +1059,17 @@ interface MathRenderer {
|
|
|
1059
1059
|
mathMLToSvg(mathml: string): Promise<MathSvg>;
|
|
1060
1060
|
}
|
|
1061
1061
|
//#endregion
|
|
1062
|
-
//#region dist/.types-work/three-d-contract-
|
|
1062
|
+
//#region dist/.types-work/three-d-contract-D5bEzjMw.d.ts
|
|
1063
1063
|
interface ChartThreeDRenderer {
|
|
1064
1064
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
1065
1065
|
}
|
|
1066
1066
|
//#endregion
|
|
1067
|
-
//#region dist/.types-work/region-map-contract-
|
|
1067
|
+
//#region dist/.types-work/region-map-contract-BFIR10oz.d.ts
|
|
1068
1068
|
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-CZoV-4B8.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 {
|
|
@@ -1175,7 +1175,7 @@ type HyperlinkTarget = {
|
|
|
1175
1175
|
};
|
|
1176
1176
|
declare function openExternalHyperlink(url: string, allowed?: readonly string[], win?: Pick<Window, 'open'> | undefined): boolean;
|
|
1177
1177
|
//#endregion
|
|
1178
|
-
//#region dist/.types-work/find-highlight-
|
|
1178
|
+
//#region dist/.types-work/find-highlight-DdGGQ_H7.d.ts
|
|
1179
1179
|
interface TextSelectionContextOptions {
|
|
1180
1180
|
readonly maxTextCharacters?: number;
|
|
1181
1181
|
readonly maxRunLocators?: number;
|
|
@@ -1184,6 +1184,28 @@ interface ViewerContextMenuEvent<TContext> {
|
|
|
1184
1184
|
readonly originalEvent: MouseEvent;
|
|
1185
1185
|
getContext(): Promise<TContext | null>;
|
|
1186
1186
|
}
|
|
1187
|
+
interface ViewerCommentsOptions {
|
|
1188
|
+
readonly includeResolved?: boolean;
|
|
1189
|
+
}
|
|
1190
|
+
type ViewerCommentConnectorRoute = 'bezier' | 'orthogonal';
|
|
1191
|
+
type ViewerCommentConnectorStroke = 'solid' | 'dashed';
|
|
1192
|
+
interface ViewerCommentConnectorOptions {
|
|
1193
|
+
readonly route?: ViewerCommentConnectorRoute;
|
|
1194
|
+
readonly stroke?: ViewerCommentConnectorStroke;
|
|
1195
|
+
readonly color?: string;
|
|
1196
|
+
readonly activeColor?: string;
|
|
1197
|
+
}
|
|
1198
|
+
interface ViewerCommentMessageContext {
|
|
1199
|
+
readonly id?: string;
|
|
1200
|
+
readonly author?: string;
|
|
1201
|
+
readonly date?: string;
|
|
1202
|
+
readonly text: string;
|
|
1203
|
+
readonly status?: 'active' | 'resolved' | 'closed';
|
|
1204
|
+
}
|
|
1205
|
+
interface ViewerCommentThreadContext {
|
|
1206
|
+
readonly root: ViewerCommentMessageContext;
|
|
1207
|
+
readonly replies: readonly ViewerCommentMessageContext[];
|
|
1208
|
+
}
|
|
1187
1209
|
interface AutoResizeOptions {
|
|
1188
1210
|
pauseWhenHidden?: boolean;
|
|
1189
1211
|
}
|
|
@@ -1214,7 +1236,7 @@ interface FindHighlightColors {
|
|
|
1214
1236
|
active?: string;
|
|
1215
1237
|
}
|
|
1216
1238
|
//#endregion
|
|
1217
|
-
//#region dist/.types-work/docx-
|
|
1239
|
+
//#region dist/.types-work/docx-Cz7hTdgv.d.ts
|
|
1218
1240
|
interface DocxDocumentModel {
|
|
1219
1241
|
section: SectionProps;
|
|
1220
1242
|
body: BodyElement[];
|
|
@@ -1250,7 +1272,8 @@ interface DocSettings {
|
|
|
1250
1272
|
adjustLineHeightInTable?: boolean;
|
|
1251
1273
|
}
|
|
1252
1274
|
interface DocRevision {
|
|
1253
|
-
kind: 'insertion' | 'deletion' | string;
|
|
1275
|
+
kind: 'insertion' | 'deletion' | 'moveFrom' | 'moveTo' | string;
|
|
1276
|
+
id?: string;
|
|
1254
1277
|
author?: string;
|
|
1255
1278
|
date?: string;
|
|
1256
1279
|
text: string;
|
|
@@ -1261,6 +1284,14 @@ interface DocComment {
|
|
|
1261
1284
|
initials?: string;
|
|
1262
1285
|
date?: string;
|
|
1263
1286
|
text: string;
|
|
1287
|
+
parentId?: string;
|
|
1288
|
+
resolved?: boolean;
|
|
1289
|
+
paragraphs?: string[];
|
|
1290
|
+
}
|
|
1291
|
+
interface DocxCommentMark {
|
|
1292
|
+
id: string;
|
|
1293
|
+
kind: 'rangeStart' | 'rangeEnd' | 'reference' | string;
|
|
1294
|
+
runIndex: number;
|
|
1264
1295
|
}
|
|
1265
1296
|
interface DocNote {
|
|
1266
1297
|
id: string;
|
|
@@ -1377,6 +1408,7 @@ interface DocParagraph {
|
|
|
1377
1408
|
tabStops: TabStop[];
|
|
1378
1409
|
runs: DocRun[];
|
|
1379
1410
|
bookmarks?: string[];
|
|
1411
|
+
commentMarks?: DocxCommentMark[];
|
|
1380
1412
|
shading?: string | null;
|
|
1381
1413
|
pageBreakBefore?: boolean;
|
|
1382
1414
|
contextualSpacing?: boolean;
|
|
@@ -1459,7 +1491,7 @@ interface NumberingInfo {
|
|
|
1459
1491
|
picBulletWidthPt?: number;
|
|
1460
1492
|
picBulletHeightPt?: number;
|
|
1461
1493
|
}
|
|
1462
|
-
type
|
|
1494
|
+
type DocRunContent = ({
|
|
1463
1495
|
type: 'text';
|
|
1464
1496
|
} & DocxTextRun) | ({
|
|
1465
1497
|
type: 'anchorHost';
|
|
@@ -1483,6 +1515,9 @@ type DocRun = ({
|
|
|
1483
1515
|
} | ({
|
|
1484
1516
|
type: 'ptab';
|
|
1485
1517
|
} & PTabRun);
|
|
1518
|
+
type DocRun = DocRunContent & {
|
|
1519
|
+
revision?: RunRevision;
|
|
1520
|
+
};
|
|
1486
1521
|
interface ChartRun {
|
|
1487
1522
|
chart: ChartModel;
|
|
1488
1523
|
widthPt: number;
|
|
@@ -1785,7 +1820,8 @@ interface NoteRef {
|
|
|
1785
1820
|
id: string;
|
|
1786
1821
|
}
|
|
1787
1822
|
interface RunRevision {
|
|
1788
|
-
kind: 'insertion' | 'deletion' | string;
|
|
1823
|
+
kind: 'insertion' | 'deletion' | 'moveFrom' | 'moveTo' | string;
|
|
1824
|
+
id?: string;
|
|
1789
1825
|
author?: string;
|
|
1790
1826
|
date?: string;
|
|
1791
1827
|
}
|
|
@@ -1909,18 +1945,27 @@ interface CellBorders {
|
|
|
1909
1945
|
insideH: BorderSpec | null;
|
|
1910
1946
|
insideV: BorderSpec | null;
|
|
1911
1947
|
}
|
|
1948
|
+
interface DocxStorySource {
|
|
1949
|
+
story: 'body' | 'header' | 'footer' | 'footnote' | 'endnote' | 'textbox';
|
|
1950
|
+
storyInstance: string;
|
|
1951
|
+
path: readonly number[];
|
|
1952
|
+
}
|
|
1912
1953
|
interface DocxTextRunInfo {
|
|
1913
|
-
source?: Readonly<
|
|
1914
|
-
story: 'body' | 'header' | 'footer' | 'footnote' | 'endnote' | 'textbox';
|
|
1915
|
-
storyInstance: string;
|
|
1916
|
-
path: readonly number[];
|
|
1917
|
-
}>;
|
|
1954
|
+
source?: Readonly<DocxStorySource>;
|
|
1918
1955
|
paragraphId?: string;
|
|
1956
|
+
sourceRunIndex?: number;
|
|
1957
|
+
direction?: 'ltr' | 'rtl';
|
|
1919
1958
|
text: string;
|
|
1920
1959
|
x: number;
|
|
1921
1960
|
y: number;
|
|
1922
1961
|
w: number;
|
|
1923
1962
|
h: number;
|
|
1963
|
+
highlightBounds?: Readonly<{
|
|
1964
|
+
x: number;
|
|
1965
|
+
y: number;
|
|
1966
|
+
width: number;
|
|
1967
|
+
height: number;
|
|
1968
|
+
}>;
|
|
1924
1969
|
fontSize: number;
|
|
1925
1970
|
font: string;
|
|
1926
1971
|
letterSpacingPx?: number;
|
|
@@ -1935,6 +1980,46 @@ interface RenderPageOptions {
|
|
|
1935
1980
|
onTextRun?: (run: DocxTextRunInfo) => void;
|
|
1936
1981
|
currentDate?: Date | number;
|
|
1937
1982
|
}
|
|
1983
|
+
interface CommentAnchorRange {
|
|
1984
|
+
readonly commentId: string;
|
|
1985
|
+
readonly source: Readonly<DocxStorySource>;
|
|
1986
|
+
readonly startRunIndex: number;
|
|
1987
|
+
readonly endRunIndex: number;
|
|
1988
|
+
readonly reference: CommentAnchorPoint;
|
|
1989
|
+
readonly geometryFallback?: CommentAnchorGeometryFallback;
|
|
1990
|
+
}
|
|
1991
|
+
interface CommentAnchorPoint {
|
|
1992
|
+
readonly source: Readonly<DocxStorySource>;
|
|
1993
|
+
readonly runIndex: number;
|
|
1994
|
+
readonly affinity: 'following' | 'preceding';
|
|
1995
|
+
}
|
|
1996
|
+
interface CommentAnchorGeometryFallback {
|
|
1997
|
+
readonly source: Readonly<DocxStorySource>;
|
|
1998
|
+
readonly sourceRunIndex: number;
|
|
1999
|
+
}
|
|
2000
|
+
type DocxCommentAnchorKind = 'range' | 'point' | 'fallback';
|
|
2001
|
+
interface DocxCommentHighlightRect {
|
|
2002
|
+
readonly x: number;
|
|
2003
|
+
readonly y: number;
|
|
2004
|
+
readonly width: number;
|
|
2005
|
+
readonly height: number;
|
|
2006
|
+
readonly transform?: string;
|
|
2007
|
+
}
|
|
2008
|
+
interface ResolvedDocxCommentAnchor {
|
|
2009
|
+
readonly anchor: Readonly<CommentAnchorRange>;
|
|
2010
|
+
readonly kind: DocxCommentAnchorKind;
|
|
2011
|
+
readonly rects: readonly Readonly<DocxCommentHighlightRect>[];
|
|
2012
|
+
}
|
|
2013
|
+
interface ResolvedDocxCommentThread {
|
|
2014
|
+
readonly root: Readonly<DocComment>;
|
|
2015
|
+
readonly replies: readonly Readonly<DocComment>[];
|
|
2016
|
+
readonly anchors: readonly Readonly<ResolvedDocxCommentAnchor>[];
|
|
2017
|
+
}
|
|
2018
|
+
interface ResolveDocxCommentThreadsOptions {
|
|
2019
|
+
readonly includeResolved?: boolean;
|
|
2020
|
+
}
|
|
2021
|
+
declare function resolveCommentAnchorRuns(anchor: Readonly<CommentAnchorRange>, runs: readonly Readonly<DocxTextRunInfo>[]): readonly Readonly<DocxTextRunInfo>[];
|
|
2022
|
+
declare function resolveDocxCommentThreads(comments: readonly Readonly<DocComment>[], anchors: readonly Readonly<CommentAnchorRange>[], runs: readonly Readonly<DocxTextRunInfo>[], options?: ResolveDocxCommentThreadsOptions): readonly Readonly<ResolvedDocxCommentThread>[];
|
|
1938
2023
|
type DocxSelectionContextOptions = TextSelectionContextOptions;
|
|
1939
2024
|
interface DocxSelectionSourceLocator {
|
|
1940
2025
|
readonly story: 'body' | 'header' | 'footer' | 'footnote' | 'endnote' | 'textbox';
|
|
@@ -1984,17 +2069,42 @@ interface DocxElementContext {
|
|
|
1984
2069
|
readonly textCharacters: number;
|
|
1985
2070
|
readonly maxTextCharacters: number;
|
|
1986
2071
|
}
|
|
1987
|
-
|
|
2072
|
+
interface DocxCommentSelectionContext {
|
|
2073
|
+
readonly format: 'docx';
|
|
2074
|
+
readonly kind: 'comment';
|
|
2075
|
+
readonly pageIndex: number;
|
|
2076
|
+
readonly commentId: string;
|
|
2077
|
+
readonly source?: DocxSelectionSourceLocator;
|
|
2078
|
+
readonly thread: ViewerCommentThreadContext;
|
|
2079
|
+
readonly truncated: boolean;
|
|
2080
|
+
readonly truncationReasons: readonly ('text')[];
|
|
2081
|
+
readonly textCharacters: number;
|
|
2082
|
+
readonly maxTextCharacters: number;
|
|
2083
|
+
}
|
|
2084
|
+
type DocxSelectionContext = DocxTextSelectionContext | DocxElementContext | DocxCommentSelectionContext;
|
|
1988
2085
|
declare function readDocxTextSelectionContext(root: HTMLElement, selection: Selection | null, options?: DocxSelectionContextOptions): DocxTextSelectionContext | null;
|
|
1989
2086
|
interface DocxElementContextOptions {
|
|
1990
2087
|
readonly maxTextCharacters?: number;
|
|
1991
2088
|
readonly currentDate?: Date | number;
|
|
1992
2089
|
}
|
|
2090
|
+
interface RevisionAnchorRange {
|
|
2091
|
+
readonly revisionIndex: number;
|
|
2092
|
+
readonly source: Readonly<DocxStorySource>;
|
|
2093
|
+
readonly startRunIndex: number;
|
|
2094
|
+
readonly endRunIndex: number;
|
|
2095
|
+
readonly geometryFallback?: RevisionAnchorGeometryFallback;
|
|
2096
|
+
}
|
|
2097
|
+
interface RevisionAnchorGeometryFallback {
|
|
2098
|
+
readonly source: Readonly<DocxStorySource>;
|
|
2099
|
+
readonly sourceRunIndex: number;
|
|
2100
|
+
}
|
|
2101
|
+
declare function resolveRevisionAnchorRuns(anchor: Readonly<RevisionAnchorRange>, runs: readonly Readonly<DocxTextRunInfo>[]): readonly Readonly<DocxTextRunInfo>[];
|
|
1993
2102
|
interface LoadOptions extends LoadOptions$1 {
|
|
1994
2103
|
math?: MathRenderer;
|
|
1995
2104
|
mode?: 'main' | 'worker';
|
|
1996
2105
|
}
|
|
1997
2106
|
type CollectPageRunsOptions = Pick<RenderPageOptions, 'width' | 'currentDate'>;
|
|
2107
|
+
interface DocxPageCommentThreadsOptions extends CollectPageRunsOptions, ResolveDocxCommentThreadsOptions {}
|
|
1998
2108
|
type RenderPageToBitmapOptions = Omit<RenderPageOptions, 'onTextRun'> & {
|
|
1999
2109
|
onTextRun?: (run: DocxTextRunInfo) => void;
|
|
2000
2110
|
};
|
|
@@ -2003,7 +2113,11 @@ declare class DocxDocument {
|
|
|
2003
2113
|
private _document;
|
|
2004
2114
|
private _source;
|
|
2005
2115
|
private _meta;
|
|
2116
|
+
private _review;
|
|
2006
2117
|
private _bookmarkPages;
|
|
2118
|
+
private _commentAnchorRanges;
|
|
2119
|
+
private _revisionAnchorRanges;
|
|
2120
|
+
private _reviewTextRunSourceIndex;
|
|
2007
2121
|
private _mode;
|
|
2008
2122
|
private _threeD;
|
|
2009
2123
|
private _regionMap;
|
|
@@ -2027,7 +2141,11 @@ declare class DocxDocument {
|
|
|
2027
2141
|
get pageCount(): number;
|
|
2028
2142
|
get mode(): 'main' | 'worker';
|
|
2029
2143
|
get document(): DocxDocumentModel;
|
|
2030
|
-
get comments(): DocComment[];
|
|
2144
|
+
get comments(): readonly Readonly<DocComment>[];
|
|
2145
|
+
get revisions(): readonly Readonly<DocRevision>[];
|
|
2146
|
+
commentAnchorRanges(): readonly CommentAnchorRange[];
|
|
2147
|
+
revisionAnchorRanges(): readonly RevisionAnchorRange[];
|
|
2148
|
+
private _reviewSnapshot;
|
|
2031
2149
|
get footnotes(): DocNote[];
|
|
2032
2150
|
get endnotes(): DocNote[];
|
|
2033
2151
|
private _getLayout;
|
|
@@ -2040,6 +2158,7 @@ declare class DocxDocument {
|
|
|
2040
2158
|
renderPage(target: HTMLCanvasElement | OffscreenCanvas, pageIndex: number, opts?: RenderPageOptions): Promise<void>;
|
|
2041
2159
|
renderPageToBitmap(pageIndex: number, opts?: RenderPageToBitmapOptions): Promise<ImageBitmap>;
|
|
2042
2160
|
collectPageRuns(pageIndex: number, opts?: CollectPageRunsOptions): Promise<DocxTextRunInfo[]>;
|
|
2161
|
+
getCommentThreads(pageIndex: number, options?: DocxPageCommentThreadsOptions): Promise<readonly Readonly<ResolvedDocxCommentThread>[]>;
|
|
2043
2162
|
getElementContextAt(pageIndex: number, point: DocxPagePoint, opts?: DocxElementContextOptions): Promise<DocxElementContext | null>;
|
|
2044
2163
|
}
|
|
2045
2164
|
interface DocxMatchLocation {
|
|
@@ -2133,6 +2252,12 @@ declare class DocxViewer implements ZoomableViewer {
|
|
|
2133
2252
|
private _buildTextLayer;
|
|
2134
2253
|
private _hyperlinkHandler;
|
|
2135
2254
|
}
|
|
2255
|
+
interface DocxCommentsOptions extends ViewerCommentsOptions {
|
|
2256
|
+
readonly cards?: boolean;
|
|
2257
|
+
readonly side?: 'auto' | 'left' | 'right';
|
|
2258
|
+
readonly markers?: boolean;
|
|
2259
|
+
readonly connectors?: ViewerCommentConnectorOptions;
|
|
2260
|
+
}
|
|
2136
2261
|
interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>, LoadOptions {
|
|
2137
2262
|
width?: number;
|
|
2138
2263
|
gap?: number;
|
|
@@ -2142,6 +2267,7 @@ interface DocxScrollViewerOptions extends Omit<RenderPageOptions, 'onTextRun'>,
|
|
|
2142
2267
|
paddingRight?: number;
|
|
2143
2268
|
overscan?: number;
|
|
2144
2269
|
enableTextSelection?: boolean;
|
|
2270
|
+
comments?: boolean | DocxCommentsOptions;
|
|
2145
2271
|
enableElementSelection?: boolean;
|
|
2146
2272
|
onSelectionContextChange?: (context: DocxSelectionContext | null) => void;
|
|
2147
2273
|
onContextMenu?: (event: ViewerContextMenuEvent<DocxSelectionContext>) => void;
|
|
@@ -2174,6 +2300,7 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2174
2300
|
private readonly _slots;
|
|
2175
2301
|
private readonly _free;
|
|
2176
2302
|
private _heights;
|
|
2303
|
+
private _scrollGeometry;
|
|
2177
2304
|
private _lastRange;
|
|
2178
2305
|
private _lastTopIndex;
|
|
2179
2306
|
private _scrollListener;
|
|
@@ -2181,7 +2308,21 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2181
2308
|
private _selectionContextKey;
|
|
2182
2309
|
private _elementClickListener;
|
|
2183
2310
|
private _contextMenuListener;
|
|
2311
|
+
private _commentOutsidePointerListener;
|
|
2184
2312
|
private _elementContext;
|
|
2313
|
+
private _activeCommentId;
|
|
2314
|
+
private _activeCommentPage;
|
|
2315
|
+
private _commentUi;
|
|
2316
|
+
private readonly _commentPageById;
|
|
2317
|
+
private readonly _commentRunsByPage;
|
|
2318
|
+
private readonly _commentIndexedPages;
|
|
2319
|
+
private _commentScanFrontier;
|
|
2320
|
+
private _commentNavigationGeneration;
|
|
2321
|
+
private _commentAnchorRangesForMargin;
|
|
2322
|
+
private _commentAnchorIds;
|
|
2323
|
+
private _commentGeometryScheduled;
|
|
2324
|
+
private _commentGeometryFrame;
|
|
2325
|
+
private readonly _pendingCommentGeometry;
|
|
2185
2326
|
private _elementHitGeneration;
|
|
2186
2327
|
private _destroyed;
|
|
2187
2328
|
private _measureCtx;
|
|
@@ -2203,6 +2344,14 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2203
2344
|
private _pageWidthPx;
|
|
2204
2345
|
private _pageHeightPx;
|
|
2205
2346
|
private _fitWidthPx;
|
|
2347
|
+
private _hasCommentMargin;
|
|
2348
|
+
private _hasDisplayableComments;
|
|
2349
|
+
private _commentMarginExtent;
|
|
2350
|
+
private _commentZoom;
|
|
2351
|
+
private _commentsEnabled;
|
|
2352
|
+
private _commentsOptions;
|
|
2353
|
+
private _commentSide;
|
|
2354
|
+
private _syncCommentMarginGeometry;
|
|
2206
2355
|
private _baseScale;
|
|
2207
2356
|
relayout(): void;
|
|
2208
2357
|
private _relayout;
|
|
@@ -2243,6 +2392,15 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2243
2392
|
scrollToPage(index: number, opts?: {
|
|
2244
2393
|
behavior?: 'auto' | 'smooth';
|
|
2245
2394
|
}): void;
|
|
2395
|
+
private _scrollToPageTarget;
|
|
2396
|
+
private _resetCommentNavigation;
|
|
2397
|
+
private _advanceCommentScanFrontier;
|
|
2398
|
+
private _indexCommentPages;
|
|
2399
|
+
private _commentRunsForPage;
|
|
2400
|
+
goToComment(commentId: string, opts?: {
|
|
2401
|
+
pageIndex?: number;
|
|
2402
|
+
behavior?: 'auto' | 'smooth';
|
|
2403
|
+
}): Promise<boolean>;
|
|
2246
2404
|
findText(query: string, opts?: FindMatchesOptions): Promise<FindMatch<DocxMatchLocation>[]>;
|
|
2247
2405
|
findNext(): Promise<FindMatch<DocxMatchLocation> | null>;
|
|
2248
2406
|
findPrev(): Promise<FindMatch<DocxMatchLocation> | null>;
|
|
@@ -2251,6 +2409,10 @@ declare class DocxScrollViewer implements ZoomableViewer {
|
|
|
2251
2409
|
private _collectPageRuns;
|
|
2252
2410
|
private _redrawHighlights;
|
|
2253
2411
|
private _refreshFindRuns;
|
|
2412
|
+
private _commitCommentRuns;
|
|
2413
|
+
private _redrawSlotComments;
|
|
2414
|
+
private _redrawSlotCommentConnectors;
|
|
2415
|
+
private _scheduleCommentGeometry;
|
|
2254
2416
|
private _redrawSlotHighlights;
|
|
2255
2417
|
private _onResize;
|
|
2256
2418
|
get topVisiblePage(): number;
|
|
@@ -2274,4 +2436,4 @@ interface DocxHighlightMatch {
|
|
|
2274
2436
|
type DocxHighlightColors = FindHighlightColors;
|
|
2275
2437
|
declare function buildDocxHighlightLayer(layer: HTMLDivElement, runs: DocxTextRunInfo[], matches: DocxHighlightMatch[], cssWidth: number, cssHeight: number, measureForFont: (font: string) => (s: string) => number, colors?: DocxHighlightColors): void;
|
|
2276
2438
|
//#endregion
|
|
2277
|
-
export { type AnchorHostMetrics, type AutoResizeOptions, type BodyElement, type BorderSpec, type CellBorders, type CellElement, type ChartAreaGroupDecorations, type ChartBarGroupDecorations, type ChartDataLabelOverride, type ChartDataPointOverride, type ChartDataTable, type ChartDecorationLineStyle, type ChartDisplayUnits, type ChartDisplayUnitsLabel, type ChartErrBars, type ChartExElementStyle, type ChartExRenderer, type ChartLabelBox, type ChartLegendEntryOverride, type ChartLineDashSegment, type ChartLineGroupDecorations, type ChartManualLayout, type ChartModel, type ChartOfPie, type ChartPlotGroup, type ChartPlotGroupAxisSlot, type ChartPlotGroupKind, type ChartRect, type ChartRegionMapRenderer, type ChartRun, type ChartSeries, type ChartSeriesDataLabels, type ChartStockBarPaint, type ChartStockUpDownBarStyle, type ChartSurfaceBandFormat, type ChartTextBox, type ChartTextParagraph, type ChartTextRun, type ChartThreeD, type ChartThreeDPictureOptions, type ChartThreeDRenderer, type ChartThreeDSeriesAxis, type ChartThreeDSurface, type ChartTrendline, type ChartType, type ChartexBoxSeries, type ChartexBoxWhisker, type ChartexGeography, type ChartexHistogramBinning, type ChartexRegionMap, type ChartexRegionMapColors, type ChartexRegionMapRow, type ChartexSunburst, type ChartexSunburstRow, type ChartexTreemap, type ChartexValueColorStop, type ColSpec, type CollectPageRunsOptions, type ColumnsSpec, type DocComment, type DocNote, type DocParagraph, type DocRevision, type DocRun, type DocSettings, type DocTable, type DocTableCell, type DocTableRow, DocxDocument, type DocxDocumentModel, type DocxElementContext, type DocxElementContextOptions, type DocxHighlightColors, type DocxHighlightMatch, type DocxMatchLocation, type DocxPagePoint, type DocxRunBorder, DocxScrollViewer, type DocxScrollViewerOptions, type DocxSelectionContext, type DocxSelectionContextOptions, type DocxSelectionRunLocator, type DocxSelectionSourceLocator, type DocxTextRun, type DocxTextRunInfo, type DocxTextSelectionContext, DocxViewer, type DocxViewerOptions, type DrawingMLCustomDashSegment, type Duotone, type EmbeddedFontRef, type FieldRun, type FillRect, type FindHighlightColors, type FindMatch, type FindMatchesOptions, type FramePr, type GradientFill, type GradientStop, type HeaderFooter, type HeadersFooters, type HyperlinkTarget, type ImageFill, type ImageRun, type LegendManualLayout, type LineEnd, type LineNumbering, type LineSpacing, type LoadOptions, type MatchRunSlice, type MathAccent, type MathArray, type MathBar, type MathBorderBox, type MathBox, type MathDelimiter, type MathFraction, type MathFunc, type MathGroup, type MathGroupChr, type MathLimit, type MathNary, type MathNode, type MathPhant, type MathRadical, type MathRenderer, type MathRun, type MathSPre, type MathScript, type MathStyle, type MathSvg, type NoFill, type NoteRef, type NumberingInfo, OoxmlDecodedImageLimitError, type OoxmlDecodedImageLimitMetric, OoxmlError, type OoxmlErrorCode, type OoxmlErrorStage, type OoxmlFormat, type OoxmlResourceLimit, OoxmlResourceLimitError, type OoxmlResourceLimitErrorDetails, type OoxmlResourceLimits, type OoxmlResourceMetric, type OoxmlResourceMetrics, type OoxmlResourceMetricsCheckpoint, type OoxmlResourceName, type OoxmlResourcePolicySnapshot, type OoxmlResourceUsageSnapshot, type OoxmlResourceViolation, type PTabRun, type PageBorderEdge, type PageBorders, type PageNumType, type ParaBorderEdge, type ParagraphBorders, type PathCmd, type PatternFill, type RenderPageOptions, type RenderPageToBitmapOptions, type RubyAnnotation, type RunRevision, type SecondaryValueAxis, type SectionGeom, type SectionProps, type ShapeFill, type ShapeRun, type ShapeStrokeFill, type ShapeText, type ShapeTextRun, type SolidFill, type SrcRect, type TabStop, type TableBorders, type TblpPr, type TextPath, type TextSelectionContextOptions, type TileInfo, type ViewerContextMenuEvent, type ZoomableViewer, autoResize, buildDocxHighlightLayer, buildDocxTextLayer, isOoxmlDecodedImageLimitError, noteText, openExternalHyperlink, readDocxTextSelectionContext };
|
|
2439
|
+
export { type AnchorHostMetrics, type AutoResizeOptions, type BodyElement, type BorderSpec, type CellBorders, type CellElement, type ChartAreaGroupDecorations, type ChartBarGroupDecorations, type ChartDataLabelOverride, type ChartDataPointOverride, type ChartDataTable, type ChartDecorationLineStyle, type ChartDisplayUnits, type ChartDisplayUnitsLabel, type ChartErrBars, type ChartExElementStyle, type ChartExRenderer, type ChartLabelBox, type ChartLegendEntryOverride, type ChartLineDashSegment, type ChartLineGroupDecorations, type ChartManualLayout, type ChartModel, type ChartOfPie, type ChartPlotGroup, type ChartPlotGroupAxisSlot, type ChartPlotGroupKind, type ChartRect, type ChartRegionMapRenderer, type ChartRun, type ChartSeries, type ChartSeriesDataLabels, type ChartStockBarPaint, type ChartStockUpDownBarStyle, type ChartSurfaceBandFormat, type ChartTextBox, type ChartTextParagraph, type ChartTextRun, type ChartThreeD, type ChartThreeDPictureOptions, type ChartThreeDRenderer, type ChartThreeDSeriesAxis, type ChartThreeDSurface, type ChartTrendline, type ChartType, type ChartexBoxSeries, type ChartexBoxWhisker, type ChartexGeography, type ChartexHistogramBinning, type ChartexRegionMap, type ChartexRegionMapColors, type ChartexRegionMapRow, type ChartexSunburst, type ChartexSunburstRow, type ChartexTreemap, type ChartexValueColorStop, type ColSpec, type CollectPageRunsOptions, type ColumnsSpec, type CommentAnchorGeometryFallback, type CommentAnchorPoint, type CommentAnchorRange, type DocComment, type DocNote, type DocParagraph, type DocRevision, type DocRun, type DocSettings, type DocTable, type DocTableCell, type DocTableRow, type DocxCommentAnchorKind, type DocxCommentHighlightRect, type DocxCommentMark, type DocxCommentSelectionContext, type DocxCommentsOptions, DocxDocument, type DocxDocumentModel, type DocxElementContext, type DocxElementContextOptions, type DocxHighlightColors, type DocxHighlightMatch, type DocxMatchLocation, type DocxPageCommentThreadsOptions, type DocxPagePoint, type DocxRunBorder, DocxScrollViewer, type DocxScrollViewerOptions, type DocxSelectionContext, type DocxSelectionContextOptions, type DocxSelectionRunLocator, type DocxSelectionSourceLocator, type DocxStorySource, type DocxTextRun, type DocxTextRunInfo, type DocxTextSelectionContext, DocxViewer, type DocxViewerOptions, type DrawingMLCustomDashSegment, type Duotone, type EmbeddedFontRef, type FieldRun, type FillRect, type FindHighlightColors, type FindMatch, type FindMatchesOptions, type FramePr, type GradientFill, type GradientStop, type HeaderFooter, type HeadersFooters, type HyperlinkTarget, type ImageFill, type ImageRun, type LegendManualLayout, type LineEnd, type LineNumbering, type LineSpacing, type LoadOptions, type MatchRunSlice, type MathAccent, type MathArray, type MathBar, type MathBorderBox, type MathBox, type MathDelimiter, type MathFraction, type MathFunc, type MathGroup, type MathGroupChr, type MathLimit, type MathNary, type MathNode, type MathPhant, type MathRadical, type MathRenderer, type MathRun, type MathSPre, type MathScript, type MathStyle, type MathSvg, type NoFill, type NoteRef, type NumberingInfo, OoxmlDecodedImageLimitError, type OoxmlDecodedImageLimitMetric, OoxmlError, type OoxmlErrorCode, type OoxmlErrorStage, type OoxmlFormat, type OoxmlResourceLimit, OoxmlResourceLimitError, type OoxmlResourceLimitErrorDetails, type OoxmlResourceLimits, type OoxmlResourceMetric, type OoxmlResourceMetrics, type OoxmlResourceMetricsCheckpoint, type OoxmlResourceName, type OoxmlResourcePolicySnapshot, type OoxmlResourceUsageSnapshot, type OoxmlResourceViolation, type PTabRun, type PageBorderEdge, type PageBorders, type PageNumType, type ParaBorderEdge, type ParagraphBorders, type PathCmd, type PatternFill, type RenderPageOptions, type RenderPageToBitmapOptions, type ResolveDocxCommentThreadsOptions, type ResolvedDocxCommentAnchor, type ResolvedDocxCommentThread, type RevisionAnchorGeometryFallback, type RevisionAnchorRange, type RubyAnnotation, type RunRevision, type SecondaryValueAxis, type SectionGeom, type SectionProps, type ShapeFill, type ShapeRun, type ShapeStrokeFill, type ShapeText, type ShapeTextRun, type SolidFill, type SrcRect, type TabStop, type TableBorders, type TblpPr, type TextPath, type TextSelectionContextOptions, type TileInfo, type ViewerCommentConnectorOptions, type ViewerCommentConnectorRoute, type ViewerCommentConnectorStroke, type ViewerCommentMessageContext, type ViewerCommentThreadContext, type ViewerContextMenuEvent, type ZoomableViewer, autoResize, buildDocxHighlightLayer, buildDocxTextLayer, isOoxmlDecodedImageLimitError, noteText, openExternalHyperlink, readDocxTextSelectionContext, resolveCommentAnchorRuns, resolveDocxCommentThreads, resolveRevisionAnchorRuns };
|