@silurus/ooxml 0.56.0 → 0.57.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 +8 -5
- package/dist/docx-BWAno6Ct.js +1661 -0
- package/dist/docx.mjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/pptx-5Y2LWU2Z.js +1614 -0
- package/dist/pptx.mjs +2 -2
- package/dist/src-BM-QyfQO.js +29312 -0
- package/dist/types/docx.d.ts +21 -21
- package/dist/types/index.d.ts +465 -11
- package/dist/types/pptx.d.ts +351 -24
- package/dist/types/xlsx.d.ts +83 -38
- package/dist/xlsx-qDuC11Rx.js +3502 -0
- package/dist/xlsx.mjs +2 -2
- package/package.json +1 -1
- package/dist/docx-g-cBdnSQ.js +0 -1661
- package/dist/pptx-DkKGg5bQ.js +0 -23667
- package/dist/src-CFPOemuW.js +0 -6810
- package/dist/xlsx-Bx216pgL.js +0 -3483
package/dist/types/xlsx.d.ts
CHANGED
|
@@ -131,12 +131,12 @@ export declare interface CellXf {
|
|
|
131
131
|
readingOrder?: number;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
declare interface CfIcon {
|
|
134
|
+
export declare interface CfIcon {
|
|
135
135
|
iconSet: string;
|
|
136
136
|
iconId: number;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
declare type CfRule = {
|
|
139
|
+
export declare type CfRule = {
|
|
140
140
|
type: 'cellIs';
|
|
141
141
|
operator: string;
|
|
142
142
|
formulas: string[];
|
|
@@ -184,18 +184,18 @@ declare type CfRule = {
|
|
|
184
184
|
priority: number;
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
-
declare interface CfStop {
|
|
187
|
+
export declare interface CfStop {
|
|
188
188
|
kind: string;
|
|
189
189
|
value: string | null;
|
|
190
190
|
color: string;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
declare interface CfValue {
|
|
193
|
+
export declare interface CfValue {
|
|
194
194
|
kind: string;
|
|
195
195
|
value: string | null;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
declare interface ChartAnchor {
|
|
198
|
+
export declare interface ChartAnchor {
|
|
199
199
|
fromCol: number;
|
|
200
200
|
fromColOff: number;
|
|
201
201
|
fromRow: number;
|
|
@@ -212,7 +212,7 @@ declare interface ChartAnchor {
|
|
|
212
212
|
* which the renderer combines into a canonical `ChartModel.chartType` (e.g.
|
|
213
213
|
* `clusteredBarH`, `stackedBarPct`) at render time.
|
|
214
214
|
*/
|
|
215
|
-
declare interface ChartData {
|
|
215
|
+
export declare interface ChartData {
|
|
216
216
|
/** Primary chart type: "bar"|"line"|"area"|"pie"|"doughnut"|"radar"|"scatter" */
|
|
217
217
|
chartType: string;
|
|
218
218
|
/** "col" (vertical bars) | "row" (horizontal bars) */
|
|
@@ -321,12 +321,12 @@ declare interface ChartData {
|
|
|
321
321
|
plotAreaManualLayout?: ManualLayout;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
declare interface ConditionalFormat {
|
|
324
|
+
export declare interface ConditionalFormat {
|
|
325
325
|
sqref: CellRange_2[];
|
|
326
326
|
rules: CfRule[];
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
declare interface DataLabelOverride {
|
|
329
|
+
export declare interface DataLabelOverride {
|
|
330
330
|
idx: number;
|
|
331
331
|
text: string;
|
|
332
332
|
/** "l"|"r"|"t"|"b"|"ctr"|"outEnd"|"bestFit" or undefined → inherit. */
|
|
@@ -336,7 +336,7 @@ declare interface DataLabelOverride {
|
|
|
336
336
|
fontBold?: boolean;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
declare interface DataPointOverride {
|
|
339
|
+
export declare interface DataPointOverride {
|
|
340
340
|
idx: number;
|
|
341
341
|
color?: string;
|
|
342
342
|
markerSymbol?: string;
|
|
@@ -345,12 +345,12 @@ declare interface DataPointOverride {
|
|
|
345
345
|
markerLine?: string;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
declare interface DefinedName {
|
|
348
|
+
export declare interface DefinedName {
|
|
349
349
|
name: string;
|
|
350
350
|
formula: string;
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
declare interface Dxf {
|
|
353
|
+
export declare interface Dxf {
|
|
354
354
|
font: CellFont | null;
|
|
355
355
|
fill: CellFill | null;
|
|
356
356
|
border: Border | null;
|
|
@@ -361,7 +361,7 @@ declare interface Dxf {
|
|
|
361
361
|
numFmt?: NumFmt | null;
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
declare interface ErrBars {
|
|
364
|
+
export declare interface ErrBars {
|
|
365
365
|
/** "x" | "y". */
|
|
366
366
|
dir: string;
|
|
367
367
|
/** "plus" | "minus" | "both". */
|
|
@@ -375,7 +375,7 @@ declare interface ErrBars {
|
|
|
375
375
|
dash?: string;
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
declare interface GradientFillSpec {
|
|
378
|
+
export declare interface GradientFillSpec {
|
|
379
379
|
/** "linear" (default) or "path". */
|
|
380
380
|
gradientType: string;
|
|
381
381
|
/** Rotation in degrees for linear gradients (0 = left→right). */
|
|
@@ -391,7 +391,7 @@ declare interface GradientFillSpec {
|
|
|
391
391
|
}[];
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
-
declare interface Hyperlink {
|
|
394
|
+
export declare interface Hyperlink {
|
|
395
395
|
col: number;
|
|
396
396
|
row: number;
|
|
397
397
|
url: string | null;
|
|
@@ -401,7 +401,7 @@ declare interface Hyperlink {
|
|
|
401
401
|
* Image anchored to a rectangle of cells (EMU offsets within the anchor cells).
|
|
402
402
|
* 914400 EMU = 1 inch, 9525 EMU = 1 px @ 96 DPI.
|
|
403
403
|
*/
|
|
404
|
-
declare interface ImageAnchor {
|
|
404
|
+
export declare interface ImageAnchor {
|
|
405
405
|
fromCol: number;
|
|
406
406
|
fromColOff: number;
|
|
407
407
|
fromRow: number;
|
|
@@ -423,7 +423,7 @@ declare interface ImageAnchor {
|
|
|
423
423
|
dataUrl: string;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
declare interface LegendManualLayout {
|
|
426
|
+
export declare interface LegendManualLayout {
|
|
427
427
|
xMode: string;
|
|
428
428
|
yMode: string;
|
|
429
429
|
x: number;
|
|
@@ -476,7 +476,7 @@ declare interface LoadOptions_2 {
|
|
|
476
476
|
math?: MathRenderer;
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
-
declare interface ManualLayout {
|
|
479
|
+
export declare interface ManualLayout {
|
|
480
480
|
xMode: string;
|
|
481
481
|
yMode: string;
|
|
482
482
|
layoutTarget?: string;
|
|
@@ -637,7 +637,7 @@ export declare interface ParsedWorkbook {
|
|
|
637
637
|
sharedStrings: SharedString[];
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
-
declare type PathCmd = {
|
|
640
|
+
export declare type PathCmd = {
|
|
641
641
|
op: 'moveTo';
|
|
642
642
|
x: number;
|
|
643
643
|
y: number;
|
|
@@ -672,7 +672,7 @@ declare type PathCmd = {
|
|
|
672
672
|
op: 'close';
|
|
673
673
|
};
|
|
674
674
|
|
|
675
|
-
declare interface PathInfo {
|
|
675
|
+
export declare interface PathInfo {
|
|
676
676
|
w: number;
|
|
677
677
|
h: number;
|
|
678
678
|
commands: PathCmd[];
|
|
@@ -716,12 +716,12 @@ export declare interface Row {
|
|
|
716
716
|
cells: Cell[];
|
|
717
717
|
}
|
|
718
718
|
|
|
719
|
-
declare interface Run {
|
|
719
|
+
export declare interface Run {
|
|
720
720
|
text: string;
|
|
721
721
|
font?: RunFont;
|
|
722
722
|
}
|
|
723
723
|
|
|
724
|
-
declare interface RunFont {
|
|
724
|
+
export declare interface RunFont {
|
|
725
725
|
bold: boolean;
|
|
726
726
|
italic: boolean;
|
|
727
727
|
underline: boolean;
|
|
@@ -745,7 +745,7 @@ declare interface RunFont {
|
|
|
745
745
|
declare type SelectionMode_2 = 'cells' | 'rows' | 'cols' | 'all';
|
|
746
746
|
export { SelectionMode_2 as SelectionMode }
|
|
747
747
|
|
|
748
|
-
declare interface SeriesDataLabels {
|
|
748
|
+
export declare interface SeriesDataLabels {
|
|
749
749
|
showVal: boolean;
|
|
750
750
|
showCatName: boolean;
|
|
751
751
|
showSerName: boolean;
|
|
@@ -757,7 +757,7 @@ declare interface SeriesDataLabels {
|
|
|
757
757
|
fontSizeHpt?: number;
|
|
758
758
|
}
|
|
759
759
|
|
|
760
|
-
declare interface ShapeAnchor {
|
|
760
|
+
export declare interface ShapeAnchor {
|
|
761
761
|
fromCol: number;
|
|
762
762
|
fromColOff: number;
|
|
763
763
|
fromRow: number;
|
|
@@ -778,9 +778,14 @@ declare interface ShapeAnchor {
|
|
|
778
778
|
shapes: ShapeInfo[];
|
|
779
779
|
}
|
|
780
780
|
|
|
781
|
-
declare type ShapeGeom = {
|
|
781
|
+
export declare type ShapeGeom = {
|
|
782
782
|
type: 'preset';
|
|
783
783
|
name: string;
|
|
784
|
+
/** Adjust handles from `<a:avLst><a:gd>` in `adj1..adj8` order
|
|
785
|
+
* (ECMA-376 §19.5.31.3 / §20.1.9.5). `null` entries mean "use the
|
|
786
|
+
* preset's declared default". Omitted entirely when the shape has no
|
|
787
|
+
* `<a:avLst>`. Consumed by the shared `renderPresetShape` engine. */
|
|
788
|
+
adj?: (number | null)[];
|
|
784
789
|
} | {
|
|
785
790
|
type: 'custom';
|
|
786
791
|
paths: PathInfo[];
|
|
@@ -793,7 +798,7 @@ declare type ShapeGeom = {
|
|
|
793
798
|
dataUrl: string;
|
|
794
799
|
};
|
|
795
800
|
|
|
796
|
-
declare interface ShapeInfo {
|
|
801
|
+
export declare interface ShapeInfo {
|
|
797
802
|
/** Normalized [0,1] position/size relative to the anchor rect. */
|
|
798
803
|
x: number;
|
|
799
804
|
y: number;
|
|
@@ -811,7 +816,7 @@ declare interface ShapeInfo {
|
|
|
811
816
|
text?: ShapeText;
|
|
812
817
|
}
|
|
813
818
|
|
|
814
|
-
declare interface ShapeParagraph {
|
|
819
|
+
export declare interface ShapeParagraph {
|
|
815
820
|
/** `<a:pPr@algn>` — `l` (default) | `ctr` | `r` | `just` | `dist`. */
|
|
816
821
|
align: string;
|
|
817
822
|
/** `<a:pPr@rtl>` — whether the paragraph reads right-to-left
|
|
@@ -820,7 +825,7 @@ declare interface ShapeParagraph {
|
|
|
820
825
|
runs: ShapeTextRun[];
|
|
821
826
|
}
|
|
822
827
|
|
|
823
|
-
declare interface ShapeText {
|
|
828
|
+
export declare interface ShapeText {
|
|
824
829
|
/** `<a:bodyPr@anchor>` — vertical alignment of the text block within the
|
|
825
830
|
* shape rect. `t` (top, default), `ctr` (middle), `b` (bottom). */
|
|
826
831
|
anchor: string;
|
|
@@ -833,7 +838,7 @@ declare interface ShapeText {
|
|
|
833
838
|
* (matches the pptx `TextRun` shape): styled text, a soft line break, or an
|
|
834
839
|
* OMML equation. Excel stores "Insert > Equation" as OMML inside the shared
|
|
835
840
|
* DrawingML `<xdr:txBody>` grammar (ECMA-376 §22.1), like PowerPoint. */
|
|
836
|
-
declare type ShapeTextRun = {
|
|
841
|
+
export declare type ShapeTextRun = {
|
|
837
842
|
type: 'text';
|
|
838
843
|
text: string;
|
|
839
844
|
bold: boolean;
|
|
@@ -856,7 +861,7 @@ declare type ShapeTextRun = {
|
|
|
856
861
|
color?: string;
|
|
857
862
|
};
|
|
858
863
|
|
|
859
|
-
declare interface SharedString {
|
|
864
|
+
export declare interface SharedString {
|
|
860
865
|
text: string;
|
|
861
866
|
runs?: Run[];
|
|
862
867
|
}
|
|
@@ -871,7 +876,7 @@ export declare interface SheetMeta {
|
|
|
871
876
|
tabColor?: string | null;
|
|
872
877
|
}
|
|
873
878
|
|
|
874
|
-
declare interface SlicerAnchor {
|
|
879
|
+
export declare interface SlicerAnchor {
|
|
875
880
|
fromCol: number;
|
|
876
881
|
fromColOff: number;
|
|
877
882
|
fromRow: number;
|
|
@@ -884,12 +889,12 @@ declare interface SlicerAnchor {
|
|
|
884
889
|
items: SlicerItem[];
|
|
885
890
|
}
|
|
886
891
|
|
|
887
|
-
declare interface SlicerItem {
|
|
892
|
+
export declare interface SlicerItem {
|
|
888
893
|
name: string;
|
|
889
894
|
selected: boolean;
|
|
890
895
|
}
|
|
891
896
|
|
|
892
|
-
declare interface Sparkline {
|
|
897
|
+
export declare interface Sparkline {
|
|
893
898
|
/** 1-based row of the destination cell (`<xm:sqref>`). */
|
|
894
899
|
row: number;
|
|
895
900
|
/** 1-based column of the destination cell. */
|
|
@@ -899,7 +904,7 @@ declare interface Sparkline {
|
|
|
899
904
|
values: (number | null)[];
|
|
900
905
|
}
|
|
901
906
|
|
|
902
|
-
declare interface SparklineGroup {
|
|
907
|
+
export declare interface SparklineGroup {
|
|
903
908
|
/** `line` (default) | `column` | `stem` (win-loss). */
|
|
904
909
|
kind: 'line' | 'column' | 'stem';
|
|
905
910
|
markers: boolean;
|
|
@@ -942,7 +947,7 @@ export declare interface Styles {
|
|
|
942
947
|
|
|
943
948
|
/** Per-column DXF references inside a `<table>` element
|
|
944
949
|
* (ECMA-376 §18.5.1.3 `tableColumn`). */
|
|
945
|
-
declare interface TableColumnInfo {
|
|
950
|
+
export declare interface TableColumnInfo {
|
|
946
951
|
/** `<tableColumn dataDxfId>` — applied to data cells in this column. */
|
|
947
952
|
dataDxfId?: number;
|
|
948
953
|
/** `<tableColumn headerRowDxfId>` — applied to the header cell of this column. */
|
|
@@ -951,7 +956,7 @@ declare interface TableColumnInfo {
|
|
|
951
956
|
totalsRowDxfId?: number;
|
|
952
957
|
}
|
|
953
958
|
|
|
954
|
-
declare interface TableInfo {
|
|
959
|
+
export declare interface TableInfo {
|
|
955
960
|
range: CellRange_2;
|
|
956
961
|
styleName: string;
|
|
957
962
|
headerRowCount: number;
|
|
@@ -963,13 +968,29 @@ declare interface TableInfo {
|
|
|
963
968
|
/** Accent color resolved by the parser from the built-in style name against
|
|
964
969
|
* the file's theme accents (e.g. `TableStyleLight18` → accent3). */
|
|
965
970
|
accentColor: string;
|
|
971
|
+
/** `true` when `styleName` is defined in the file's `<tableStyles>` block,
|
|
972
|
+
* i.e. a *custom* style (ECMA-376 §18.5.1.2). The renderer draws such tables
|
|
973
|
+
* strictly from their declared element dxfs and must NOT apply the accent
|
|
974
|
+
* approximation (banding / synthesized rules / header) reserved for built-in
|
|
975
|
+
* style names whose definitions are absent from the file. */
|
|
976
|
+
isCustom?: boolean;
|
|
966
977
|
/** Dxf index for the `wholeTable` element of a custom `<tableStyle>`
|
|
967
|
-
* (ECMA-376 §18.8.
|
|
978
|
+
* (ECMA-376 §18.8.83). When set, its border/fill apply to every cell of
|
|
968
979
|
* the table as a base layer. Undefined for built-in style names. */
|
|
969
980
|
wholeTableDxf?: number;
|
|
970
981
|
/** Dxf index for the `headerRow` element of a custom `<tableStyle>` —
|
|
971
982
|
* provides header background, font color/weight, and vertical separators. */
|
|
972
983
|
headerRowDxf?: number;
|
|
984
|
+
/** Dxf index for the `totalRow` element (ECMA-376 §18.18.93). */
|
|
985
|
+
totalRowDxf?: number;
|
|
986
|
+
/** Dxf index for the `firstColumn` element. */
|
|
987
|
+
firstColumnDxf?: number;
|
|
988
|
+
/** Dxf index for the `lastColumn` element. */
|
|
989
|
+
lastColumnDxf?: number;
|
|
990
|
+
/** Dxf index for `firstRowStripe` (band1 horizontal) — odd banded-row stripe. */
|
|
991
|
+
band1HorizontalDxf?: number;
|
|
992
|
+
/** Dxf index for `secondRowStripe` (band2 horizontal) — even banded-row stripe. */
|
|
993
|
+
band2HorizontalDxf?: number;
|
|
973
994
|
/** Per-column DXF references (ECMA-376 §18.5.1.3 `tableColumn`). Index by
|
|
974
995
|
* `cellCol - range.left`. The renderer can use these to apply column-level
|
|
975
996
|
* overlays for named-style tables; for files where Excel pre-bakes the
|
|
@@ -1054,7 +1075,7 @@ export declare interface Worksheet {
|
|
|
1054
1075
|
* XLSX parser's raw chart series (includes XLSX-only `seriesType` for mixed
|
|
1055
1076
|
* charts). Adapted to `ChartSeries` from @silurus/ooxml-core before rendering.
|
|
1056
1077
|
*/
|
|
1057
|
-
declare interface XlsxChartSeries {
|
|
1078
|
+
export declare interface XlsxChartSeries {
|
|
1058
1079
|
name: string;
|
|
1059
1080
|
/** Chart sub-type for this series (allows mixed charts). */
|
|
1060
1081
|
seriesType: string;
|
|
@@ -1132,6 +1153,17 @@ export declare class XlsxViewer {
|
|
|
1132
1153
|
private currentWorksheet;
|
|
1133
1154
|
private opts;
|
|
1134
1155
|
private resizeObserver;
|
|
1156
|
+
/**
|
|
1157
|
+
* Start-anchored horizontal scroll position (the {@link effectiveScrollLeft}
|
|
1158
|
+
* value last produced by a real user scroll or a programmatic reset), kept
|
|
1159
|
+
* as the source of truth across container size changes. The native
|
|
1160
|
+
* `scrollLeft` cannot serve that role for RTL sheets (ECMA-376 §18.3.1.87):
|
|
1161
|
+
* it is the *inverse* of the start-anchored offset, and the browser clamps
|
|
1162
|
+
* any assignment to 0 while the host is unlaid-out (`display:none` mount —
|
|
1163
|
+
* e.g. a host revealed only after `load()` resolves), which would otherwise
|
|
1164
|
+
* strand the view at the sheet's far end once the host gains its real size.
|
|
1165
|
+
*/
|
|
1166
|
+
private effectiveH;
|
|
1135
1167
|
private anchorCell;
|
|
1136
1168
|
private activeCell;
|
|
1137
1169
|
private selectionMode;
|
|
@@ -1185,6 +1217,11 @@ export declare class XlsxViewer {
|
|
|
1185
1217
|
/** Park the scrollbar at the sheet's natural start: scrollLeft=0 for LTR,
|
|
1186
1218
|
* the right end for RTL (so col A shows first). */
|
|
1187
1219
|
private resetHorizontalScroll;
|
|
1220
|
+
/** Re-derive the native scrollLeft from the tracked start-anchored
|
|
1221
|
+
* position after the scroll host's size changes. Only RTL needs this:
|
|
1222
|
+
* for LTR the native scrollLeft *is* start-anchored and the browser
|
|
1223
|
+
* already clamps it sensibly on resize. */
|
|
1224
|
+
private reanchorHorizontalScroll;
|
|
1188
1225
|
/** 0-based index of the currently displayed sheet. */
|
|
1189
1226
|
get sheetIndex(): number;
|
|
1190
1227
|
/** Total number of sheets in the loaded workbook. */
|
|
@@ -1258,7 +1295,15 @@ export declare interface XlsxViewerOptions {
|
|
|
1258
1295
|
zoomMin?: number;
|
|
1259
1296
|
zoomMax?: number;
|
|
1260
1297
|
onReady?: (sheetNames: string[]) => void;
|
|
1261
|
-
|
|
1298
|
+
/**
|
|
1299
|
+
* Called when the active sheet changes, with the new sheet's zero-based
|
|
1300
|
+
* `index` and the `total` number of sheets in the workbook. This mirrors the
|
|
1301
|
+
* docx `onPageChange` and pptx `onSlideChange` contracts so all three viewers
|
|
1302
|
+
* share one callback shape. To get the sheet *name*, look it up by index from
|
|
1303
|
+
* `viewer.sheetNames[index]` (or the `sheetNames` array delivered to
|
|
1304
|
+
* `onReady`).
|
|
1305
|
+
*/
|
|
1306
|
+
onSheetChange?: (index: number, total: number) => void;
|
|
1262
1307
|
onError?: (err: Error) => void;
|
|
1263
1308
|
/** Called when the selected cell range changes. null means no selection. */
|
|
1264
1309
|
onSelectionChange?: (selection: CellRange | null) => void;
|