reamkit 1.15.4 → 1.17.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/dist/esm/core/bidi/segments.js +1 -2
- package/dist/esm/core/converter/facade.d.ts +5 -0
- package/dist/esm/core/converter/project.js +5 -1
- package/dist/esm/core/converter/ream.d.ts +6 -0
- package/dist/esm/core/converter/ream.js +34 -8
- package/dist/esm/core/document-model/index.d.ts +1 -1
- package/dist/esm/core/document-model/types.d.ts +659 -7
- package/dist/esm/core/drawingml/chart-geometry.d.ts +34 -10
- package/dist/esm/core/drawingml/chart-geometry.js +424 -92
- package/dist/esm/core/drawingml/chart-parser.js +301 -11
- package/dist/esm/core/drawingml/colors.d.ts +7 -7
- package/dist/esm/core/drawingml/colors.js +84 -18
- package/dist/esm/core/drawingml/preset-geometry.js +240 -6
- package/dist/esm/core/drawingml/shape-render.d.ts +12 -0
- package/dist/esm/core/drawingml/shape-render.js +116 -3
- package/dist/esm/core/drawingml/sparkline-geometry.js +6 -4
- package/dist/esm/core/drawingml/theme-parser.d.ts +51 -0
- package/dist/esm/core/drawingml/theme-parser.js +92 -1
- package/dist/esm/core/font/measure.d.ts +5 -0
- package/dist/esm/core/font/measure.js +21 -1
- package/dist/esm/core/font/ttf-subset.js +26 -1
- package/dist/esm/core/images.d.ts +2 -2
- package/dist/esm/core/images.js +353 -43
- package/dist/esm/core/indexed-colors.d.ts +11 -0
- package/dist/esm/core/indexed-colors.js +81 -0
- package/dist/esm/core/ir/flow.d.ts +23 -1
- package/dist/esm/core/ir/sheet.d.ts +61 -0
- package/dist/esm/{excel → core}/number-format.d.ts +37 -0
- package/dist/esm/core/number-format.js +800 -0
- package/dist/esm/core/numbering/apply.d.ts +5 -3
- package/dist/esm/core/numbering/apply.js +42 -11
- package/dist/esm/core/numbering/index.js +2 -0
- package/dist/esm/core/numbering/state.d.ts +13 -1
- package/dist/esm/core/numbering/state.js +256 -15
- package/dist/esm/core/opc/alternate-content.d.ts +13 -0
- package/dist/esm/core/opc/alternate-content.js +72 -0
- package/dist/esm/core/opc/core-properties.js +1 -0
- package/dist/esm/core/opc/package.d.ts +14 -1
- package/dist/esm/core/opc/package.js +43 -4
- package/dist/esm/core/opc/relationships.js +1 -0
- package/dist/esm/core/opc/xml-entities.d.ts +12 -0
- package/dist/esm/core/opc/xml-entities.js +91 -0
- package/dist/esm/core/po-helpers.js +16 -1
- package/dist/esm/core/spreadsheet-model/index.d.ts +1 -1
- package/dist/esm/core/spreadsheet-model/types.d.ts +137 -0
- package/dist/esm/core/style-cascade/resolver.js +66 -11
- package/dist/esm/core/style-cascade/table.js +35 -11
- package/dist/esm/core/style-cascade/types.d.ts +42 -1
- package/dist/esm/core/style-cascade/types.js +4 -0
- package/dist/esm/core/vector.d.ts +30 -0
- package/dist/esm/excel/activex-parser.js +1 -0
- package/dist/esm/excel/column-bands.d.ts +26 -1
- package/dist/esm/excel/column-bands.js +156 -20
- package/dist/esm/excel/comments-parser.js +5 -3
- package/dist/esm/excel/conditional-format.d.ts +25 -2
- package/dist/esm/excel/conditional-format.js +63 -19
- package/dist/esm/excel/escaped-text.d.ts +9 -0
- package/dist/esm/excel/escaped-text.js +20 -0
- package/dist/esm/excel/form-control-parser.js +1 -0
- package/dist/esm/excel/formula/dates.js +1 -1
- package/dist/esm/excel/header-footer.d.ts +9 -1
- package/dist/esm/excel/header-footer.js +162 -14
- package/dist/esm/excel/index.d.ts +1 -1
- package/dist/esm/excel/index.js +2 -2
- package/dist/esm/excel/pivot-table-parser.js +1 -0
- package/dist/esm/excel/print-model.d.ts +75 -0
- package/dist/esm/excel/print-model.js +899 -77
- package/dist/esm/excel/printer-settings.d.ts +16 -0
- package/dist/esm/excel/printer-settings.js +36 -0
- package/dist/esm/excel/rich-value.d.ts +13 -0
- package/dist/esm/excel/rich-value.js +120 -0
- package/dist/esm/excel/shared-strings-parser.js +11 -7
- package/dist/esm/excel/sheet-drawing.d.ts +11 -0
- package/dist/esm/excel/sheet-drawing.js +26 -3
- package/dist/esm/excel/sheet-shape-parser.d.ts +53 -1
- package/dist/esm/excel/sheet-shape-parser.js +461 -32
- package/dist/esm/excel/sheet-to-flow.d.ts +23 -2
- package/dist/esm/excel/sheet-to-flow.js +553 -36
- package/dist/esm/excel/slicer-parser.js +1 -0
- package/dist/esm/excel/styles-parser.d.ts +30 -2
- package/dist/esm/excel/styles-parser.js +177 -40
- package/dist/esm/excel/table-parser.js +1 -0
- package/dist/esm/excel/vml-drawing.d.ts +68 -0
- package/dist/esm/excel/vml-drawing.js +158 -0
- package/dist/esm/excel/workbook-parser.d.ts +5 -0
- package/dist/esm/excel/workbook-parser.js +5 -1
- package/dist/esm/excel/worksheet-parser.d.ts +2 -1
- package/dist/esm/excel/worksheet-parser.js +150 -61
- package/dist/esm/excel/xlsx-reader.js +242 -11
- package/dist/esm/excel/xlsx-to-pdf.js +12 -1
- package/dist/esm/html/html-writer.js +29 -6
- package/dist/esm/layout/page-doc.d.ts +87 -1
- package/dist/esm/layout/styled-layout.d.ts +46 -2
- package/dist/esm/layout/styled-layout.js +2345 -274
- package/dist/esm/pdf/cid-font.js +20 -9
- package/dist/esm/pdf/objects.d.ts +13 -0
- package/dist/esm/pdf/objects.js +18 -1
- package/dist/esm/pdf/shading.js +76 -6
- package/dist/esm/pdf/styled-page-emitter.js +355 -49
- package/dist/esm/pdf/text-page-renderer.js +1 -0
- package/dist/esm/pdf/vector-graphics.d.ts +31 -2
- package/dist/esm/pdf/vector-graphics.js +103 -3
- package/dist/esm/pptx/pptx-reader.js +2 -0
- package/dist/esm/pptx/slide-parser.d.ts +21 -4
- package/dist/esm/pptx/slide-parser.js +98 -24
- package/dist/esm/svg/svg-writer.js +23 -4
- package/dist/esm/word/document-parser.d.ts +96 -7
- package/dist/esm/word/document-parser.js +538 -116
- package/dist/esm/word/docx-reader.js +135 -43
- package/dist/esm/word/docx-writer.js +6 -1
- package/dist/esm/word/drawing-parser.d.ts +86 -5
- package/dist/esm/word/drawing-parser.js +1590 -54
- package/dist/esm/word/index.d.ts +4 -4
- package/dist/esm/word/numbering-parser.d.ts +2 -1
- package/dist/esm/word/numbering-parser.js +108 -21
- package/dist/esm/word/paragraph-properties.d.ts +11 -1
- package/dist/esm/word/paragraph-properties.js +219 -10
- package/dist/esm/word/run-properties.js +45 -1
- package/dist/esm/word/settings-parser.d.ts +24 -0
- package/dist/esm/word/settings-parser.js +32 -5
- package/dist/esm/word/shading.d.ts +11 -0
- package/dist/esm/word/shading.js +64 -0
- package/dist/esm/word/styles-parser.js +9 -2
- package/dist/esm/word/table-parser.d.ts +9 -1
- package/dist/esm/word/table-parser.js +182 -30
- package/package.json +7 -3
- package/dist/esm/excel/number-format.js +0 -476
|
@@ -10,6 +10,9 @@ export interface SheetChartRef {
|
|
|
10
10
|
readonly chartPartPath: string;
|
|
11
11
|
readonly widthPt: number;
|
|
12
12
|
readonly heightPt: number;
|
|
13
|
+
/** Where the anchor puts it, in points from the grid's top-left. */
|
|
14
|
+
readonly xPt?: number;
|
|
15
|
+
readonly yPt?: number;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* §20.5.2.1 xdr:pic — a picture anchored over a sheet's grid, sized from its
|
|
@@ -20,6 +23,9 @@ export interface SheetImageRef {
|
|
|
20
23
|
readonly resourceId: ResourceId;
|
|
21
24
|
readonly widthPt: number;
|
|
22
25
|
readonly heightPt: number;
|
|
26
|
+
/** Where the anchor puts it, in points from the grid's top-left. */
|
|
27
|
+
readonly xPt?: number;
|
|
28
|
+
readonly yPt?: number;
|
|
23
29
|
}
|
|
24
30
|
/** One item (label + selection state) in a {@link SheetSlicer}. */
|
|
25
31
|
export interface SheetSlicerItem {
|
|
@@ -73,10 +79,38 @@ export interface SheetComment {
|
|
|
73
79
|
* spin/scroll/list controls. Render-only.
|
|
74
80
|
*/
|
|
75
81
|
export interface SheetFormControl {
|
|
82
|
+
/**
|
|
83
|
+
* §18.3.1.19 `<control name>` — the shape's NAME, an identifier like
|
|
84
|
+
* "CheckBox28". Excel shows it in the name box, never on the page; it is what
|
|
85
|
+
* the after-the-grid listing calls a control that has no geometry.
|
|
86
|
+
*/
|
|
76
87
|
readonly name?: string;
|
|
88
|
+
/**
|
|
89
|
+
* The visible label, from the control's legacy VML `<v:textbox>`. A control
|
|
90
|
+
* drawn in place draws THIS beside its widget — never {@link name}, which is
|
|
91
|
+
* an internal id: 45540_form_Header.xlsx has forty captionless check boxes
|
|
92
|
+
* and printing their names put "CheckBox28" across the form's own text.
|
|
93
|
+
*/
|
|
94
|
+
readonly caption?: string;
|
|
77
95
|
readonly objectType?: string;
|
|
78
96
|
readonly checked?: boolean;
|
|
79
97
|
readonly value?: number;
|
|
98
|
+
/** Where the control sits on the sheet, in points from the grid's origin. */
|
|
99
|
+
readonly box?: SheetControlBox;
|
|
100
|
+
/** The caption's declared size, when the shape names one. */
|
|
101
|
+
readonly fontSizePt?: number;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A control's rectangle on the sheet, in points from the grid's top-left — read
|
|
105
|
+
* from its legacy VML shape, the only part that says where a control goes.
|
|
106
|
+
* Absent when the drawing carries no geometry, in which case the control is
|
|
107
|
+
* listed after the grid rather than drawn in place.
|
|
108
|
+
*/
|
|
109
|
+
export interface SheetControlBox {
|
|
110
|
+
readonly xPt: number;
|
|
111
|
+
readonly yPt: number;
|
|
112
|
+
readonly widthPt: number;
|
|
113
|
+
readonly heightPt: number;
|
|
80
114
|
}
|
|
81
115
|
/**
|
|
82
116
|
* An ActiveX control resolved against its activeX part (E-SHEET W10): the control
|
|
@@ -87,6 +121,8 @@ export interface SheetFormControl {
|
|
|
87
121
|
*/
|
|
88
122
|
export interface SheetActiveXControl {
|
|
89
123
|
readonly type: string;
|
|
124
|
+
/** Where the control sits on the sheet — from the VML shape sharing its `shapeId`. */
|
|
125
|
+
readonly box?: SheetControlBox;
|
|
90
126
|
/** §18.3.1.19 `<control name>` — the control's identifier, when it came that way. */
|
|
91
127
|
readonly name?: string;
|
|
92
128
|
readonly caption?: string;
|
|
@@ -97,6 +133,12 @@ export interface SheetActiveXControl {
|
|
|
97
133
|
export interface Sheet {
|
|
98
134
|
/** The sheet (tab) name. */
|
|
99
135
|
readonly name: string;
|
|
136
|
+
/**
|
|
137
|
+
* §18.2.19 `<sheet @state>` — the tab is `hidden` or `veryHidden`. Carried
|
|
138
|
+
* because a consumer that shows the workbook (the HTML writer) may still want
|
|
139
|
+
* it; the paginated projection skips it, as Excel and LibreOffice do.
|
|
140
|
+
*/
|
|
141
|
+
readonly hidden?: boolean;
|
|
100
142
|
/**
|
|
101
143
|
* The grid + per-sheet geometry exactly as parsed: cells, columns, rows,
|
|
102
144
|
* merges, dimensions, pageSetup/printOptions, manual breaks, drawingRelId.
|
|
@@ -165,4 +207,23 @@ export interface SheetDoc {
|
|
|
165
207
|
readonly resources: ResourceStore;
|
|
166
208
|
/** Document metadata from docProps/core.xml. */
|
|
167
209
|
readonly info?: DocumentInfo;
|
|
210
|
+
/**
|
|
211
|
+
* §20.1.6.2 the workbook theme's colour scheme, slot name → 6-hex. Cell
|
|
212
|
+
* colours are resolved against it at parse time; a header/footer's `&K` theme
|
|
213
|
+
* reference is resolved at projection time, which is why the palette travels.
|
|
214
|
+
*/
|
|
215
|
+
readonly themePalette?: ReadonlyMap<string, string>;
|
|
216
|
+
/**
|
|
217
|
+
* §18.3.* — how many embedded objects (`<oleObject progId="Package">` and the
|
|
218
|
+
* like) the workbook carries. They print as an icon and a caption in Excel
|
|
219
|
+
* and Calc, both of which live in a metafile; the projection reports them.
|
|
220
|
+
*/
|
|
221
|
+
readonly embeddedObjects?: number;
|
|
222
|
+
/**
|
|
223
|
+
* §20.5.2.x — how many anchored pictures are a metafile (WMF / EMF / PICT)
|
|
224
|
+
* rather than a raster. They keep their anchor and their box, and draw
|
|
225
|
+
* nothing: replaying a metafile is a different feature from embedding an
|
|
226
|
+
* image. The projection reports them.
|
|
227
|
+
*/
|
|
228
|
+
readonly metafilePictures?: number;
|
|
168
229
|
}
|
|
@@ -13,6 +13,20 @@
|
|
|
13
13
|
* @returns The formatted display string.
|
|
14
14
|
*/
|
|
15
15
|
export declare function applyNumberFormat(rawValue: string, numFmtId: number, customFormats: ReadonlyMap<number, string>, date1904?: boolean): string;
|
|
16
|
+
/**
|
|
17
|
+
* The colour a number format paints its cell in (§18.8.31), as a 6-digit RRGGBB,
|
|
18
|
+
* or undefined when the section that applies declares none.
|
|
19
|
+
*
|
|
20
|
+
* A `[Red]` at the head of a section is part of the format, not decoration: the
|
|
21
|
+
* accounting codes write the negative section as `[Red]-#,##0.00`, and rendering
|
|
22
|
+
* it in the cell's own font colour loses the one signal the format exists for.
|
|
23
|
+
* `[Color 12]` indexes the same legacy palette a `<color indexed>` does.
|
|
24
|
+
*
|
|
25
|
+
* @param rawValue The cell's raw stored value — it selects the section.
|
|
26
|
+
* @param numFmtId The number-format id from the cell's `cellXf`.
|
|
27
|
+
* @param customFormats Custom format codes by id (from `<numFmts>`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function numberFormatColorHex(rawValue: string, numFmtId: number, customFormats: ReadonlyMap<number, string>): string | undefined;
|
|
16
30
|
/**
|
|
17
31
|
* Excel serial date → JS `Date`. The default 1900 epoch uses 1899-12-30 as day 0
|
|
18
32
|
* (so serial 1 is 1900-01-01) and inherits the Lotus 1-2-3 leap-year bug: serial 60
|
|
@@ -35,3 +49,26 @@ export declare function excelSerialToDate(serial: number, date1904: boolean): Da
|
|
|
35
49
|
* @param month0 The 0-indexed month (0 = January).
|
|
36
50
|
*/
|
|
37
51
|
export declare function excelSerialFromUtcParts(year: number, month0: number, day: number, date1904: boolean): number;
|
|
52
|
+
/**
|
|
53
|
+
* A General number rounded to the decimals that fit `maxChars` characters.
|
|
54
|
+
*
|
|
55
|
+
* General is not a fixed format: a spreadsheet shows as many decimal places as
|
|
56
|
+
* the column has room for and ROUNDS to that, so 4.3900875881221957 in a
|
|
57
|
+
* column eight characters wide reads 4.390088. We rendered every stored digit
|
|
58
|
+
* and let the cell clip it, which turns the same value into 4.390087 — off by
|
|
59
|
+
* one in the last place shown, with nothing to say a digit was cut.
|
|
60
|
+
*
|
|
61
|
+
* The integer part is never dropped: a number too wide even without decimals
|
|
62
|
+
* keeps them all and the cell says so its own way (see hashOnOverflow).
|
|
63
|
+
*
|
|
64
|
+
* `fits` decides, and it must measure in the face this will be DRAWN in rather
|
|
65
|
+
* than count characters against the column's width in the document's unit.
|
|
66
|
+
* Counted that way we produced nine digits for a column that holds nine of
|
|
67
|
+
* Excel's and eight of ours, and the layout clipped the ninth — the very
|
|
68
|
+
* truncation this exists to prevent. Fewer digits than the reference shows is a
|
|
69
|
+
* coarser number; a clipped one is a different number.
|
|
70
|
+
*
|
|
71
|
+
* @param rawValue The cell's stored value.
|
|
72
|
+
* @param fits Whether a rendering will fit the cell.
|
|
73
|
+
*/
|
|
74
|
+
export declare function generalToWidth(rawValue: string, fits: (text: string) => boolean): string;
|