reamkit 1.32.0 → 1.33.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 +5 -4
- package/dist/esm/core/bidi/algorithm.js +2 -2
- package/dist/esm/core/bidi/char-types.js +1 -1
- package/dist/esm/core/bidi/index.js +3 -3
- package/dist/esm/core/bytes.js +1 -1
- package/dist/esm/core/converter/facade.js +3 -2
- package/dist/esm/core/converter/ream.js +12 -5
- package/dist/esm/core/crypto/asn1.js +2 -2
- package/dist/esm/core/crypto/cms.js +5 -3
- package/dist/esm/core/crypto/index.js +2 -1
- package/dist/esm/core/crypto/offcrypto.js +64 -19
- package/dist/esm/core/crypto/primitives.js +16 -16
- package/dist/esm/core/document-model/index.d.ts +1 -1
- package/dist/esm/core/document-model/types.d.ts +174 -2
- package/dist/esm/core/drawingml/chart-geometry.d.ts +45 -17
- package/dist/esm/core/drawingml/chart-geometry.js +1090 -257
- package/dist/esm/core/drawingml/chart-parser.d.ts +24 -1
- package/dist/esm/core/drawingml/chart-parser.js +334 -41
- package/dist/esm/core/drawingml/chart-text.d.ts +41 -0
- package/dist/esm/core/drawingml/chart-text.js +93 -0
- package/dist/esm/core/drawingml/colors.js +5 -5
- package/dist/esm/core/drawingml/diagram/layout-engine.js +1 -4
- package/dist/esm/core/drawingml/diagram/run.js +2 -1
- package/dist/esm/core/drawingml/preset-geometry.js +4 -6
- package/dist/esm/core/drawingml/shape-render.js +1 -1
- package/dist/esm/core/drawingml/text-warp.js +4 -16
- package/dist/esm/core/drawingml/theme-parser.js +14 -8
- package/dist/esm/core/font/arabic-joining.js +2 -2
- package/dist/esm/core/font/binary-reader.js +2 -0
- package/dist/esm/core/font/font-registry.js +1 -0
- package/dist/esm/core/font/ligatures.js +1 -1
- package/dist/esm/core/font/opentype-layout.js +11 -5
- package/dist/esm/core/font/ttf-build.js +6 -10
- package/dist/esm/core/font/ttf-parser.js +2 -1
- package/dist/esm/core/font/ttf-subset.js +8 -8
- package/dist/esm/core/fonts/families.js +1 -1
- package/dist/esm/core/fonts/remote-fonts.js +4 -4
- package/dist/esm/core/hyphenation/index.js +1 -1
- package/dist/esm/core/images.js +8 -8
- package/dist/esm/core/ir/loss.js +1 -0
- package/dist/esm/core/line-breaker/cjk.js +1 -1
- package/dist/esm/core/line-breaker/index.js +4 -3
- package/dist/esm/core/links.js +1 -1
- package/dist/esm/core/lzw.js +1 -1
- package/dist/esm/core/metafile/blit.js +1 -1
- package/dist/esm/core/metafile/emf.js +5 -7
- package/dist/esm/core/metafile/picture.js +1 -1
- package/dist/esm/core/metafile/symbol-fonts.js +7 -7
- package/dist/esm/core/metafile/wmf.js +5 -7
- package/dist/esm/core/number-format.d.ts +40 -15
- package/dist/esm/core/number-format.js +284 -79
- package/dist/esm/core/numbering/index.js +3 -2
- package/dist/esm/core/ole/cfb.js +4 -4
- package/dist/esm/core/ole/escher-blip.js +1 -1
- package/dist/esm/core/opc/index.js +5 -4
- package/dist/esm/core/opc/package.js +3 -1
- package/dist/esm/core/opc/tag-scan.d.ts +15 -0
- package/dist/esm/core/opc/tag-scan.js +41 -0
- package/dist/esm/core/opc/xml-entities.js +40 -3
- package/dist/esm/core/outline.js +1 -1
- package/dist/esm/core/png-encode.js +3 -3
- package/dist/esm/core/po-helpers.js +1 -1
- package/dist/esm/core/spreadsheet-model/types.d.ts +6 -0
- package/dist/esm/core/style-cascade/index.js +4 -3
- package/dist/esm/core/tiff.js +3 -1
- package/dist/esm/excel/activex-parser.js +1 -1
- package/dist/esm/excel/conditional-format.js +7 -7
- package/dist/esm/excel/formula/functions.js +45 -18
- package/dist/esm/excel/formula/index.js +3 -3
- package/dist/esm/excel/formula/lexer.js +2 -2
- package/dist/esm/excel/formula/parser.js +4 -3
- package/dist/esm/excel/formula/value.js +1 -1
- package/dist/esm/excel/index.js +7 -6
- package/dist/esm/excel/print-model.js +18 -7
- package/dist/esm/excel/printer-settings.js +6 -7
- package/dist/esm/excel/rich-value.js +1 -1
- package/dist/esm/excel/sheet-shape-parser.js +4 -2
- package/dist/esm/excel/sheet-to-flow.js +13 -11
- package/dist/esm/excel/styles-parser.js +5 -3
- package/dist/esm/excel/tint.js +5 -5
- package/dist/esm/excel/vml-drawing.js +3 -3
- package/dist/esm/excel/worksheet-parser.js +5 -5
- package/dist/esm/excel/xls/biff-chart.js +1 -3
- package/dist/esm/excel/xls/biff-reader.js +10 -11
- package/dist/esm/excel/xls/xls-reader.js +1 -1
- package/dist/esm/excel/xlsx-reader.js +56 -9
- package/dist/esm/excel/xlsx-to-pdf.js +1 -1
- package/dist/esm/excel/xlsx-writer.js +2 -2
- package/dist/esm/html/html-writer.js +18 -10
- package/dist/esm/layout/line-paint.js +1 -1
- package/dist/esm/layout/math-layout.js +5 -8
- package/dist/esm/layout/styled-layout.js +104 -32
- package/dist/esm/layout/turned-section.js +2 -2
- package/dist/esm/markdown/markdown-writer.js +59 -8
- package/dist/esm/pdf/encryption.js +9 -9
- package/dist/esm/pdf/icc-profile.js +2 -2
- package/dist/esm/pdf/index.js +3 -2
- package/dist/esm/pdf/objects.js +7 -0
- package/dist/esm/pdf/serialize.js +1 -1
- package/dist/esm/pdf/struct-tree.js +3 -1
- package/dist/esm/pdf/styled-page-emitter.js +23 -15
- package/dist/esm/pdf/styled-page-renderer.js +9 -5
- package/dist/esm/pdf-reader/annot-draw.js +5 -5
- package/dist/esm/pdf-reader/annots.js +3 -1
- package/dist/esm/pdf-reader/ccitt.js +2 -1
- package/dist/esm/pdf-reader/cff-outline.js +1 -4
- package/dist/esm/pdf-reader/content.js +13 -15
- package/dist/esm/pdf-reader/decrypt.js +5 -4
- package/dist/esm/pdf-reader/document.js +6 -2
- package/dist/esm/pdf-reader/encodings.js +1 -1
- package/dist/esm/pdf-reader/flow-build.js +4 -6
- package/dist/esm/pdf-reader/font.js +4 -4
- package/dist/esm/pdf-reader/function.js +8 -7
- package/dist/esm/pdf-reader/icc.js +1 -1
- package/dist/esm/pdf-reader/images.js +1 -1
- package/dist/esm/pdf-reader/jbig2.js +36 -38
- package/dist/esm/pdf-reader/jpeg.js +14 -13
- package/dist/esm/pdf-reader/layout.js +13 -10
- package/dist/esm/pdf-reader/lexer.js +2 -1
- package/dist/esm/pdf-reader/math-rows.js +2 -2
- package/dist/esm/pdf-reader/optional-content.js +1 -1
- package/dist/esm/pdf-reader/page-numbers.js +1 -1
- package/dist/esm/pdf-reader/pattern-tint.js +1 -2
- package/dist/esm/pdf-reader/reader.js +2 -2
- package/dist/esm/pdf-reader/struct-tree.js +1 -1
- package/dist/esm/pdf-reader/tagged.js +3 -2
- package/dist/esm/pdf-reader/text.js +2 -2
- package/dist/esm/pdf-reader/type1-outline.js +1 -3
- package/dist/esm/pptx/embedded-fonts.js +3 -5
- package/dist/esm/pptx/placeholder-cascade.js +1 -1
- package/dist/esm/pptx/ppt/ppt-reader.js +5 -4
- package/dist/esm/pptx/ppt/ppt-text.js +9 -10
- package/dist/esm/pptx/pptx-reader.js +6 -5
- package/dist/esm/pptx/preset-table-styles.js +1 -1
- package/dist/esm/pptx/slide-parser.js +6 -4
- package/dist/esm/pptx/sp-helpers.js +1 -1
- package/dist/esm/pptx/table-style.js +2 -1
- package/dist/esm/svg/svg-writer.js +1 -1
- package/dist/esm/word/doc/doc-reader.js +2 -2
- package/dist/esm/word/doc/doc-text.js +20 -22
- package/dist/esm/word/document-parser.js +27 -22
- package/dist/esm/word/docx-reader.js +15 -10
- package/dist/esm/word/docx-to-pdf.js +6 -6
- package/dist/esm/word/docx-writer.js +10 -6
- package/dist/esm/word/drawing-parser.js +18 -18
- package/dist/esm/word/font-table.js +90 -11
- package/dist/esm/word/index.js +6 -5
- package/dist/esm/word/numbering-parser.js +5 -4
- package/dist/esm/word/omml-parser.js +1 -1
- package/dist/esm/word/paragraph-properties.js +11 -10
- package/dist/esm/word/run-properties.js +4 -4
- package/dist/esm/word/settings-parser.js +2 -1
- package/dist/esm/word/shading.js +1 -1
- package/dist/esm/word/styles-parser.js +5 -4
- package/dist/esm/word/table-parser.js +4 -4
- package/dist/esm/word/theme-fonts.js +1 -1
- package/package.json +10 -4
package/dist/esm/core/lzw.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
function lzwDecodeMsb(data, options) {
|
|
9
9
|
const earlyChange = options.earlyChange ?? 1;
|
|
10
|
-
let out = new Uint8Array(4096);
|
|
10
|
+
let out = /* @__PURE__ */ new Uint8Array(4096);
|
|
11
11
|
let outLen = 0;
|
|
12
12
|
const emit = (e) => {
|
|
13
13
|
if (outLen + e.length > options.limit) return false;
|
|
@@ -10,7 +10,7 @@ function isEmf(bytes) {
|
|
|
10
10
|
const v = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
11
11
|
return v.getUint32(0, true) === 1 && v.getUint32(40, true) === 1179469088;
|
|
12
12
|
}
|
|
13
|
-
var RECORD_NAMES = new Map([
|
|
13
|
+
var RECORD_NAMES = /* @__PURE__ */ new Map([
|
|
14
14
|
[48, "palette"],
|
|
15
15
|
[49, "palette"],
|
|
16
16
|
[50, "palette"],
|
|
@@ -576,12 +576,10 @@ function readEmf(bytes) {
|
|
|
576
576
|
rop: 13369376
|
|
577
577
|
});
|
|
578
578
|
break;
|
|
579
|
-
default:
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
break;
|
|
579
|
+
default: {
|
|
580
|
+
const name = RECORD_NAMES.get(type);
|
|
581
|
+
if (name) skipped.add(name);
|
|
582
|
+
}
|
|
585
583
|
}
|
|
586
584
|
off += size;
|
|
587
585
|
}
|
|
@@ -121,4 +121,4 @@ function applyTransform(t, x, y) {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
|
-
export { applyTransform, clippedAway, cloneDc, colorRef, intersectClip, newDeviceContext, primBounds };
|
|
124
|
+
export { DEFAULT_BRUSH, DEFAULT_PEN, applyTransform, clippedAway, cloneDc, colorRef, intersectClip, newDeviceContext, primBounds };
|
|
@@ -64,7 +64,7 @@ function fromSymbolFont(text, family) {
|
|
|
64
64
|
function normalize(family) {
|
|
65
65
|
return family.trim().toLowerCase();
|
|
66
66
|
}
|
|
67
|
-
var WINGDINGS = new Map([
|
|
67
|
+
var WINGDINGS = /* @__PURE__ */ new Map([
|
|
68
68
|
[108, "●"],
|
|
69
69
|
[109, "❍"],
|
|
70
70
|
[110, "■"],
|
|
@@ -85,7 +85,7 @@ var WINGDINGS = new Map([
|
|
|
85
85
|
[254, "☑"],
|
|
86
86
|
[255, "☒"]
|
|
87
87
|
]);
|
|
88
|
-
var WEBDINGS = new Map([
|
|
88
|
+
var WEBDINGS = /* @__PURE__ */ new Map([
|
|
89
89
|
[103, "■"],
|
|
90
90
|
[108, "■"],
|
|
91
91
|
[110, "●"],
|
|
@@ -96,7 +96,7 @@ var WEBDINGS = new Map([
|
|
|
96
96
|
[116, "▼"],
|
|
97
97
|
[161, "●"]
|
|
98
98
|
]);
|
|
99
|
-
var SYMBOL = new Map([
|
|
99
|
+
var SYMBOL = /* @__PURE__ */ new Map([
|
|
100
100
|
[97, "α"],
|
|
101
101
|
[98, "β"],
|
|
102
102
|
[99, "χ"],
|
|
@@ -120,7 +120,7 @@ var SYMBOL = new Map([
|
|
|
120
120
|
[185, "≠"],
|
|
121
121
|
[187, "≈"]
|
|
122
122
|
]);
|
|
123
|
-
var WINGDINGS_GEOMETRY = new Map([
|
|
123
|
+
var WINGDINGS_GEOMETRY = /* @__PURE__ */ new Map([
|
|
124
124
|
[108, "circle"],
|
|
125
125
|
[110, "square"],
|
|
126
126
|
[111, "square"],
|
|
@@ -129,11 +129,11 @@ var WINGDINGS_GEOMETRY = new Map([
|
|
|
129
129
|
[117, "diamond"],
|
|
130
130
|
[119, "diamond"]
|
|
131
131
|
]);
|
|
132
|
-
var GEOMETRY_TABLES = new Map([
|
|
132
|
+
var GEOMETRY_TABLES = /* @__PURE__ */ new Map([
|
|
133
133
|
["wingdings", WINGDINGS_GEOMETRY],
|
|
134
134
|
["wingdings 2", WINGDINGS_GEOMETRY],
|
|
135
135
|
["wingdings 3", WINGDINGS_GEOMETRY],
|
|
136
|
-
["webdings", new Map([
|
|
136
|
+
["webdings", /* @__PURE__ */ new Map([
|
|
137
137
|
[103, "square"],
|
|
138
138
|
[108, "square"],
|
|
139
139
|
[110, "circle"]
|
|
@@ -141,7 +141,7 @@ var GEOMETRY_TABLES = new Map([
|
|
|
141
141
|
["monotype sorts", WINGDINGS_GEOMETRY],
|
|
142
142
|
["zapfdingbats", WINGDINGS_GEOMETRY]
|
|
143
143
|
]);
|
|
144
|
-
var SYMBOL_TABLES = new Map([
|
|
144
|
+
var SYMBOL_TABLES = /* @__PURE__ */ new Map([
|
|
145
145
|
["wingdings", WINGDINGS],
|
|
146
146
|
["wingdings 2", WINGDINGS],
|
|
147
147
|
["wingdings 3", WINGDINGS],
|
|
@@ -15,7 +15,7 @@ function isWmf(bytes) {
|
|
|
15
15
|
const headerWords = v.getUint16(2, true);
|
|
16
16
|
return (type === 1 || type === 2) && headerWords === 9;
|
|
17
17
|
}
|
|
18
|
-
var RECORD_NAMES = new Map([
|
|
18
|
+
var RECORD_NAMES = /* @__PURE__ */ new Map([
|
|
19
19
|
[2338, "pie"],
|
|
20
20
|
[2096, "chord"],
|
|
21
21
|
[2071, "arc"],
|
|
@@ -385,12 +385,10 @@ function readWmf(bytes) {
|
|
|
385
385
|
pushText(emit, dc, text, x, y);
|
|
386
386
|
}
|
|
387
387
|
break;
|
|
388
|
-
default:
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
break;
|
|
388
|
+
default: {
|
|
389
|
+
const name = RECORD_NAMES.get(fn);
|
|
390
|
+
if (name) skipped.add(name);
|
|
391
|
+
}
|
|
394
392
|
}
|
|
395
393
|
off += size * 2;
|
|
396
394
|
}
|
|
@@ -50,25 +50,50 @@ export declare function excelSerialToDate(serial: number, date1904: boolean): Da
|
|
|
50
50
|
*/
|
|
51
51
|
export declare function excelSerialFromUtcParts(year: number, month0: number, day: number, date1904: boolean): number;
|
|
52
52
|
/**
|
|
53
|
-
* A General number
|
|
53
|
+
* A General number in its column: the most precise of the ways General may
|
|
54
|
+
* write it ({@link generalRenderings}) that `fits`.
|
|
54
55
|
*
|
|
55
|
-
* General is not a fixed format: a spreadsheet shows as many
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
56
|
+
* General is not a fixed format: a spreadsheet shows as many places as the
|
|
57
|
+
* column has room for and ROUNDS to that, so 4.3900875881221957 in a column
|
|
58
|
+
* eight characters wide reads 4.390088. We rendered every stored digit and let
|
|
59
|
+
* the cell clip it, which turns the same value into 4.390087 — off by one in
|
|
60
|
+
* the last place shown, with nothing to say a digit was cut. A number too wide
|
|
61
|
+
* for every way of writing it comes back in its finest, and the cell fills
|
|
62
|
+
* with `#` (CellProperties.hashOnOverflow); one under 1 always fits as `0` or
|
|
63
|
+
* `-0`, which is what Excel prints in a column too narrow for anything else.
|
|
60
64
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
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.
|
|
65
|
+
* `fits` decides whether a rendering has room. The print model asks it in the
|
|
66
|
+
* document's own terms — the column's width less the padding it carries, in
|
|
67
|
+
* the font's widest digits — because that is the room Excel gives up places
|
|
68
|
+
* against, whatever face the page is drawn in.
|
|
70
69
|
*
|
|
71
70
|
* @param rawValue The cell's stored value.
|
|
72
71
|
* @param fits Whether a rendering will fit the cell.
|
|
73
72
|
*/
|
|
74
73
|
export declare function generalToWidth(rawValue: string, fits: (text: string) => boolean): string;
|
|
74
|
+
/**
|
|
75
|
+
* Every way General may write `value` in `chars` characters, the most precise
|
|
76
|
+
* first. One rule, measured in Excel's own PDF on chart axes, which give it
|
|
77
|
+
* nine characters with the sign among them, and in cells, eleven with the
|
|
78
|
+
* sign apart (2026-10-01/02):
|
|
79
|
+
*
|
|
80
|
+
* - the number as it is, its first 15 significant digits, where that fits:
|
|
81
|
+
* 0.000012345, 0.0000003, 12345678901;
|
|
82
|
+
* - else rounded to fewer places or written in scientific notation, whichever
|
|
83
|
+
* keeps the finer last digit — 0.123456789, not 1.23457E-01; 1.23457E-10,
|
|
84
|
+
* not 0; 4E-04, not 0, in a column five characters wide — and of two as
|
|
85
|
+
* fine, the plain one down to 0.0001 and the scientific one below it: 0.0001
|
|
86
|
+
* for 0.000123456 but 1E-05 for 1.00049E-05;
|
|
87
|
+
* - a whole part longer than the room only in scientific notation, and never
|
|
88
|
+
* with the zeros a mantissa or a fraction ends in: 1E+10, 2.5E+12.
|
|
89
|
+
*
|
|
90
|
+
* The digits are the 15 of {@link decimalOf}, rounded half away from zero, so
|
|
91
|
+
* 1.2345E-05 is 1.235E-05, where `toExponential` rounded the binary double
|
|
92
|
+
* down to 1.234E-05.
|
|
93
|
+
*
|
|
94
|
+
* @param value The number.
|
|
95
|
+
* @param chars How many characters General has.
|
|
96
|
+
* @param signCounts Whether a minus sign takes one of them.
|
|
97
|
+
* @returns The renderings, sign included, finest first.
|
|
98
|
+
*/
|
|
99
|
+
export declare function generalRenderings(value: number, chars: number, signCounts?: boolean): Generator<string, void, undefined>;
|