reamkit 1.32.1 → 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 +8 -7
- 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 +24 -6
- package/dist/esm/core/drawingml/chart-geometry.js +905 -208
- package/dist/esm/core/drawingml/chart-parser.d.ts +5 -1
- package/dist/esm/core/drawingml/chart-parser.js +275 -19
- 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.js +4 -6
- 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/xml-entities.js +1 -1
- 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 +8 -4
- 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 +4 -4
- 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 +2 -2
- 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 +17 -4
- 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 +103 -31
- package/dist/esm/layout/turned-section.js +2 -2
- package/dist/esm/markdown/markdown-writer.js +1 -1
- 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 +3 -3
- 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 +3 -3
- 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 +12 -9
- 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 +26 -21
- package/dist/esm/word/docx-reader.js +2 -2
- package/dist/esm/word/docx-to-pdf.js +3 -3
- 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 +1 -1
- package/dist/esm/word/index.js +6 -5
- package/dist/esm/word/numbering-parser.js +4 -3
- 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 +8 -2
|
@@ -333,15 +333,16 @@ var MQDecoder = class {
|
|
|
333
333
|
}
|
|
334
334
|
/** BYTEIN (§E.3.4) — 0xFF is the marker escape, so it feeds a shorter byte. */
|
|
335
335
|
byteIn() {
|
|
336
|
-
if (this.byteAt(this.bp) === 255)
|
|
337
|
-
this.
|
|
338
|
-
|
|
336
|
+
if (this.byteAt(this.bp) === 255) {
|
|
337
|
+
if (this.byteAt(this.bp + 1) > 143) {
|
|
338
|
+
this.c = this.c + 65280 >>> 0;
|
|
339
|
+
this.ct = 8;
|
|
340
|
+
} else {
|
|
341
|
+
this.bp++;
|
|
342
|
+
this.c = this.c + (this.byteAt(this.bp) << 9) >>> 0;
|
|
343
|
+
this.ct = 7;
|
|
344
|
+
}
|
|
339
345
|
} else {
|
|
340
|
-
this.bp++;
|
|
341
|
-
this.c = this.c + (this.byteAt(this.bp) << 9) >>> 0;
|
|
342
|
-
this.ct = 7;
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
346
|
this.bp++;
|
|
346
347
|
this.c = this.c + (this.byteAt(this.bp) << 8) >>> 0;
|
|
347
348
|
this.ct = 8;
|
|
@@ -359,17 +360,18 @@ var MQDecoder = class {
|
|
|
359
360
|
const [qe, nmps, nlps, sw] = QE[i] ?? QE[0];
|
|
360
361
|
let d;
|
|
361
362
|
this.a = this.a - qe & 65535;
|
|
362
|
-
if ((this.c >>> 16 & 65535) < qe)
|
|
363
|
-
this.a
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
if ((this.c >>> 16 & 65535) < qe) {
|
|
364
|
+
if (this.a < qe) {
|
|
365
|
+
this.a = qe;
|
|
366
|
+
d = mps;
|
|
367
|
+
i = nmps;
|
|
368
|
+
} else {
|
|
369
|
+
this.a = qe;
|
|
370
|
+
d = 1 - mps;
|
|
371
|
+
if (sw === 1) mps = 1 - mps;
|
|
372
|
+
i = nlps;
|
|
373
|
+
}
|
|
366
374
|
} else {
|
|
367
|
-
this.a = qe;
|
|
368
|
-
d = 1 - mps;
|
|
369
|
-
if (sw === 1) mps = 1 - mps;
|
|
370
|
-
i = nlps;
|
|
371
|
-
}
|
|
372
|
-
else {
|
|
373
375
|
this.c = this.c - (qe << 16) >>> 0;
|
|
374
376
|
if ((this.a & 32768) !== 0) return mps;
|
|
375
377
|
if (this.a < qe) {
|
|
@@ -474,9 +476,7 @@ function decodeGenericRegion(mq, cx, width, height, template, at, tpgdon, skip)
|
|
|
474
476
|
case 2:
|
|
475
477
|
ctx = px(x - 1, y) << 0 | px(x - 2, y) << 1 | px(x + (a[0]?.x ?? 2), y + (a[0]?.y ?? -1)) << 2 | px(x + 1, y - 1) << 3 | px(x, y - 1) << 4 | px(x - 1, y - 1) << 5 | px(x - 2, y - 1) << 6 | px(x + 1, y - 2) << 7 | px(x, y - 2) << 8 | px(x - 1, y - 2) << 9;
|
|
476
478
|
break;
|
|
477
|
-
default:
|
|
478
|
-
ctx = px(x - 1, y) << 0 | px(x - 2, y) << 1 | px(x - 3, y) << 2 | px(x - 4, y) << 3 | px(x + (a[0]?.x ?? 2), y + (a[0]?.y ?? -1)) << 4 | px(x + 1, y - 1) << 5 | px(x, y - 1) << 6 | px(x - 1, y - 1) << 7 | px(x - 2, y - 1) << 8 | px(x - 3, y - 1) << 9;
|
|
479
|
-
break;
|
|
479
|
+
default: ctx = px(x - 1, y) << 0 | px(x - 2, y) << 1 | px(x - 3, y) << 2 | px(x - 4, y) << 3 | px(x + (a[0]?.x ?? 2), y + (a[0]?.y ?? -1)) << 4 | px(x + 1, y - 1) << 5 | px(x, y - 1) << 6 | px(x - 1, y - 1) << 7 | px(x - 2, y - 1) << 8 | px(x - 3, y - 1) << 9;
|
|
480
480
|
}
|
|
481
481
|
bmp.data[y * width + x] = mq.decode(cx, ctx);
|
|
482
482
|
}
|
|
@@ -669,6 +669,7 @@ function buildHuffTable(lines) {
|
|
|
669
669
|
}
|
|
670
670
|
/** A most-significant-bit-first reader over a segment's data. */
|
|
671
671
|
var BitReader = class {
|
|
672
|
+
d;
|
|
672
673
|
pos = 0;
|
|
673
674
|
bit = 0;
|
|
674
675
|
constructor(d) {
|
|
@@ -1755,6 +1756,7 @@ var OOB = Symbol("OOB");
|
|
|
1755
1756
|
* needs a context set of its own.
|
|
1756
1757
|
*/
|
|
1757
1758
|
var IntDecoder = class {
|
|
1759
|
+
mq;
|
|
1758
1760
|
cx = newContexts(512);
|
|
1759
1761
|
constructor(mq) {
|
|
1760
1762
|
this.mq = mq;
|
|
@@ -1787,6 +1789,8 @@ var IntDecoder = class {
|
|
|
1787
1789
|
};
|
|
1788
1790
|
/** §A.3 — the symbol ID decoder, a fixed-width code down its own context tree. */
|
|
1789
1791
|
var IdDecoder = class {
|
|
1792
|
+
mq;
|
|
1793
|
+
codeLen;
|
|
1790
1794
|
cx;
|
|
1791
1795
|
constructor(mq, codeLen) {
|
|
1792
1796
|
this.mq = mq;
|
|
@@ -1799,14 +1803,6 @@ var IdDecoder = class {
|
|
|
1799
1803
|
return prev - (1 << this.codeLen);
|
|
1800
1804
|
}
|
|
1801
1805
|
};
|
|
1802
|
-
/** How a text region places each instance against the point it names (§6.4.5). */
|
|
1803
|
-
var Corner = /* @__PURE__ */ function(Corner) {
|
|
1804
|
-
Corner[Corner["BottomLeft"] = 0] = "BottomLeft";
|
|
1805
|
-
Corner[Corner["TopLeft"] = 1] = "TopLeft";
|
|
1806
|
-
Corner[Corner["BottomRight"] = 2] = "BottomRight";
|
|
1807
|
-
Corner[Corner["TopRight"] = 3] = "TopRight";
|
|
1808
|
-
return Corner;
|
|
1809
|
-
}(Corner || {});
|
|
1810
1806
|
/**
|
|
1811
1807
|
* §6.4.5 — draw a text region: a run of strips, each holding instances of the
|
|
1812
1808
|
* symbols in `symbols`, placed by running coordinates rather than absolute ones.
|
|
@@ -1875,12 +1871,12 @@ function decodeTextRegion(mq, symbols, p, stripsLog, lent) {
|
|
|
1875
1871
|
if (p.transposed) {
|
|
1876
1872
|
x = tt;
|
|
1877
1873
|
y = curS;
|
|
1878
|
-
if (p.refCorner ===
|
|
1879
|
-
if (p.refCorner ===
|
|
1874
|
+
if (p.refCorner === 0 || p.refCorner === 2) {}
|
|
1875
|
+
if (p.refCorner === 3 || p.refCorner === 2) x = tt - sw + 1;
|
|
1880
1876
|
} else {
|
|
1881
1877
|
x = curS;
|
|
1882
1878
|
y = tt;
|
|
1883
|
-
if (p.refCorner ===
|
|
1879
|
+
if (p.refCorner === 0 || p.refCorner === 2) y = tt - sh + 1;
|
|
1884
1880
|
}
|
|
1885
1881
|
compose(bmp, sym, x, y, p.combOp);
|
|
1886
1882
|
curS += (p.transposed ? sh : sw) - 1;
|
|
@@ -1959,7 +1955,7 @@ function decodeSymbolDictionary(mq, input, newCount, exportCount, template, at,
|
|
|
1959
1955
|
height,
|
|
1960
1956
|
instances,
|
|
1961
1957
|
stripT: 0,
|
|
1962
|
-
refCorner:
|
|
1958
|
+
refCorner: 1,
|
|
1963
1959
|
transposed: false,
|
|
1964
1960
|
combOp: 0,
|
|
1965
1961
|
defPixel: 0,
|
|
@@ -2069,11 +2065,11 @@ function decodeTextRegionHuff(bits, data, symbols, p, stripsLog, t) {
|
|
|
2069
2065
|
if (p.transposed) {
|
|
2070
2066
|
x = tt;
|
|
2071
2067
|
y = curS;
|
|
2072
|
-
if (p.refCorner ===
|
|
2068
|
+
if (p.refCorner === 3 || p.refCorner === 2) x = tt - sw + 1;
|
|
2073
2069
|
} else {
|
|
2074
2070
|
x = curS;
|
|
2075
2071
|
y = tt;
|
|
2076
|
-
if (p.refCorner ===
|
|
2072
|
+
if (p.refCorner === 0 || p.refCorner === 2) y = tt - sh + 1;
|
|
2077
2073
|
}
|
|
2078
2074
|
compose(bmp, sym, x, y, p.combOp);
|
|
2079
2075
|
curS += (p.transposed ? sh : sw) - 1;
|
|
@@ -2114,7 +2110,7 @@ function aggregateSymbolHuff(bits, data, symbols, width, height, codeLen, refine
|
|
|
2114
2110
|
height,
|
|
2115
2111
|
instances: Math.max(1, instances),
|
|
2116
2112
|
stripT: 0,
|
|
2117
|
-
refCorner:
|
|
2113
|
+
refCorner: 1,
|
|
2118
2114
|
transposed: false,
|
|
2119
2115
|
combOp: 0,
|
|
2120
2116
|
defPixel: 0,
|
|
@@ -2307,6 +2303,7 @@ function decodeGrayScale(mq, data, mmr, template, at, width, height, bits, skip)
|
|
|
2307
2303
|
return values;
|
|
2308
2304
|
}
|
|
2309
2305
|
var Reader = class {
|
|
2306
|
+
d;
|
|
2310
2307
|
pos = 0;
|
|
2311
2308
|
constructor(d) {
|
|
2312
2309
|
this.d = d;
|
|
@@ -2462,7 +2459,8 @@ function decodeJbig2(data, globals, width, height) {
|
|
|
2462
2459
|
const flags = r.u8();
|
|
2463
2460
|
page.defPixel = flags >> 2 & 1;
|
|
2464
2461
|
page.defCombOp = flags >> 3 & 3;
|
|
2465
|
-
|
|
2462
|
+
const striping = r.u16();
|
|
2463
|
+
page.striped = (striping & 32768) !== 0;
|
|
2466
2464
|
if (pw > 0 && pw !== 4294967295 && ph > 0 && ph !== 4294967295) {
|
|
2467
2465
|
page.width = Math.min(pw, width);
|
|
2468
2466
|
page.height = Math.min(ph, height);
|
|
@@ -2750,4 +2748,4 @@ function decodeJbig2(data, globals, width, height) {
|
|
|
2750
2748
|
return packed;
|
|
2751
2749
|
}
|
|
2752
2750
|
//#endregion
|
|
2753
|
-
export { decodeJbig2 };
|
|
2751
|
+
export { MQDecoder, decodeGenericRegion, decodeJbig2, decodeRefinement, newContexts, startingContexts, symbolCodeLength };
|
|
@@ -138,7 +138,6 @@ function decode(bytes) {
|
|
|
138
138
|
p = decodeScan(bytes, segEnd, frame, scanComps, dcTables, acTables, quant, restartInterval);
|
|
139
139
|
continue;
|
|
140
140
|
}
|
|
141
|
-
default: break;
|
|
142
141
|
}
|
|
143
142
|
p = segEnd;
|
|
144
143
|
}
|
|
@@ -172,7 +171,7 @@ function readFrame(bytes, p) {
|
|
|
172
171
|
pred: 0,
|
|
173
172
|
blocksPerLine: 0,
|
|
174
173
|
blocksPerCol: 0,
|
|
175
|
-
plane: new Uint8ClampedArray(0),
|
|
174
|
+
plane: /* @__PURE__ */ new Uint8ClampedArray(0),
|
|
176
175
|
stride: 0
|
|
177
176
|
});
|
|
178
177
|
}
|
|
@@ -211,7 +210,7 @@ function readQuantTables(bytes, p, end, into) {
|
|
|
211
210
|
const pq = bytes[p] >> 4;
|
|
212
211
|
const tq = bytes[p] & 15;
|
|
213
212
|
p++;
|
|
214
|
-
const table = new Int32Array(64);
|
|
213
|
+
const table = /* @__PURE__ */ new Int32Array(64);
|
|
215
214
|
for (let i = 0; i < 64; i++) table[ZIGZAG[i]] = pq === 0 ? bytes[p + i] : be16(bytes, p + i * 2);
|
|
216
215
|
p += pq === 0 ? 64 : 128;
|
|
217
216
|
into[tq] = table;
|
|
@@ -235,9 +234,9 @@ function readHuffTables(bytes, p, end, dc, ac) {
|
|
|
235
234
|
}
|
|
236
235
|
/** §F.2.2.3 — the decoding tables, built from BITS and HUFFVAL. */
|
|
237
236
|
function buildHuffTable(counts, values) {
|
|
238
|
-
const maxcode = new Int32Array(18).fill(-1);
|
|
239
|
-
const mincode = new Int32Array(18);
|
|
240
|
-
const valptr = new Int32Array(18);
|
|
237
|
+
const maxcode = (/* @__PURE__ */ new Int32Array(18)).fill(-1);
|
|
238
|
+
const mincode = /* @__PURE__ */ new Int32Array(18);
|
|
239
|
+
const valptr = /* @__PURE__ */ new Int32Array(18);
|
|
241
240
|
let code = 0;
|
|
242
241
|
let k = 0;
|
|
243
242
|
for (let l = 1; l <= 16; l++) {
|
|
@@ -271,10 +270,12 @@ function decodeScan(bytes, start, frame, scan, dcTables, acTables, quant, restar
|
|
|
271
270
|
const nextBit = () => {
|
|
272
271
|
if (bitCount === 0) {
|
|
273
272
|
let b = bytes[at++] ?? 0;
|
|
274
|
-
if (b === 255)
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
273
|
+
if (b === 255) {
|
|
274
|
+
if ((bytes[at] ?? 0) === 0) at++;
|
|
275
|
+
else {
|
|
276
|
+
at--;
|
|
277
|
+
b = 0;
|
|
278
|
+
}
|
|
278
279
|
}
|
|
279
280
|
bitBuf = b;
|
|
280
281
|
bitCount = 8;
|
|
@@ -299,7 +300,7 @@ function decodeScan(bytes, start, frame, scan, dcTables, acTables, quant, restar
|
|
|
299
300
|
for (let i = 0; i < s; i++) v = v << 1 | nextBit();
|
|
300
301
|
return v < 1 << s - 1 ? v - (1 << s) + 1 : v;
|
|
301
302
|
};
|
|
302
|
-
const block = new Int32Array(64);
|
|
303
|
+
const block = /* @__PURE__ */ new Int32Array(64);
|
|
303
304
|
const decodeBlock = (comp, row, col) => {
|
|
304
305
|
block.fill(0);
|
|
305
306
|
const q = quant[comp.tq];
|
|
@@ -352,7 +353,7 @@ function decodeScan(bytes, start, frame, scan, dcTables, acTables, quant, restar
|
|
|
352
353
|
}
|
|
353
354
|
/** §A.3.3 — cos((2x+1)uπ/16) · C(u)/2, precomputed. */
|
|
354
355
|
var COS = (() => {
|
|
355
|
-
const t = new Float32Array(64);
|
|
356
|
+
const t = /* @__PURE__ */ new Float32Array(64);
|
|
356
357
|
for (let u = 0; u < 8; u++) {
|
|
357
358
|
const c = u === 0 ? Math.SQRT1_2 : 1;
|
|
358
359
|
for (let x = 0; x < 8; x++) t[u * 8 + x] = c * Math.cos((2 * x + 1) * u * Math.PI / 16) / 2;
|
|
@@ -361,7 +362,7 @@ var COS = (() => {
|
|
|
361
362
|
})();
|
|
362
363
|
/** The separable 2-D inverse DCT of one block, levelshifted into `out`. */
|
|
363
364
|
function idctBlock(block, out, offset, stride) {
|
|
364
|
-
const rows = new Float32Array(64);
|
|
365
|
+
const rows = /* @__PURE__ */ new Float32Array(64);
|
|
365
366
|
for (let y = 0; y < 8; y++) for (let x = 0; x < 8; x++) {
|
|
366
367
|
let sum = 0;
|
|
367
368
|
for (let u = 0; u < 8; u++) sum += COS[u * 8 + x] * block[y * 8 + u];
|
|
@@ -65,12 +65,13 @@ function reconstructByLayout(file, mode = "flow") {
|
|
|
65
65
|
const art = pages.map((page, i) => {
|
|
66
66
|
const raw = collectPageImages(file, page);
|
|
67
67
|
const images = placeImages(raw.images, shown[i]);
|
|
68
|
-
const
|
|
68
|
+
const covered = images.map((img) => ({
|
|
69
69
|
minX: img.x,
|
|
70
70
|
minY: img.y,
|
|
71
71
|
maxX: img.x + img.widthPt,
|
|
72
72
|
maxY: img.y + img.heightPt
|
|
73
|
-
}))
|
|
73
|
+
}));
|
|
74
|
+
const lifted = collectPageVectors(file, page, covered);
|
|
74
75
|
return {
|
|
75
76
|
images,
|
|
76
77
|
imageLosses: raw.losses,
|
|
@@ -252,7 +253,8 @@ function reconstructByLayout(file, mode = "flow") {
|
|
|
252
253
|
};
|
|
253
254
|
/** A figure's parts in the order the page painted them, its words over its drawing. */
|
|
254
255
|
const figureMembers = (figure) => {
|
|
255
|
-
const
|
|
256
|
+
const painted = [...figure.vectors].sort((a, b) => compareOrder(a.orderKey, b.orderKey));
|
|
257
|
+
const drawn = [...joinLetters(painted).map((v) => ({
|
|
256
258
|
key: v.orderKey,
|
|
257
259
|
member: vectorMember(v)
|
|
258
260
|
})), ...figure.images.map((img) => ({
|
|
@@ -366,7 +368,7 @@ function reconstructByLayout(file, mode = "flow") {
|
|
|
366
368
|
if (cells.some((c) => c.lines.length === 0)) return void 0;
|
|
367
369
|
const top = Math.max(...cells.map((c) => c.lines[0].y));
|
|
368
370
|
const edge = above ?? {
|
|
369
|
-
y: Math.max(...cells.map((c) => c.lines[0].y + .
|
|
371
|
+
y: Math.max(...cells.map((c) => c.lines[0].y + .96 * c.lines[0].fontSize)),
|
|
370
372
|
lineHeight: 0
|
|
371
373
|
};
|
|
372
374
|
const starts = cells.map((c, k) => k === 0 ? left : c.cell.from);
|
|
@@ -1850,7 +1852,7 @@ function continuesLeader(prev, run, fontSize) {
|
|
|
1850
1852
|
const dots = prev.text.endsWith(".") && run.text.startsWith(".");
|
|
1851
1853
|
return (isLeader(prev.text) && prev.text === run.text || dots) && run.x - prev.endX < (run.fontSizePt || fontSize) * CELL_GAP_EM;
|
|
1852
1854
|
}
|
|
1853
|
-
var LEADER_CHARS = new Set([
|
|
1855
|
+
var LEADER_CHARS = /* @__PURE__ */ new Set([
|
|
1854
1856
|
".",
|
|
1855
1857
|
"·",
|
|
1856
1858
|
"_",
|
|
@@ -2332,13 +2334,13 @@ function joinLines(lines) {
|
|
|
2332
2334
|
/** §17.3.3.29 — the hyphen that is a PLACE a word may break, not a hyphen. */
|
|
2333
2335
|
var SOFT_HYPHEN = "";
|
|
2334
2336
|
/** The hyphens that belong to the word they end. */
|
|
2335
|
-
var HYPHENS = new Set([
|
|
2337
|
+
var HYPHENS = /* @__PURE__ */ new Set([
|
|
2336
2338
|
"-",
|
|
2337
2339
|
"‐",
|
|
2338
2340
|
"‑"
|
|
2339
2341
|
]);
|
|
2340
2342
|
/** The dashes, en and em, that belong to the words either side where closed up to them. */
|
|
2341
|
-
var DASHES = new Set(["–", "—"]);
|
|
2343
|
+
var DASHES = /* @__PURE__ */ new Set(["–", "—"]);
|
|
2342
2344
|
/** How many lines' worth of indent still reads as a first line, not a placement. */
|
|
2343
2345
|
var INDENT_LINES = 3;
|
|
2344
2346
|
/** Where in the run of line starts the column's own left edge is looked for. */
|
|
@@ -3917,8 +3919,9 @@ function tableFrom(runs, gutters, edges, stepped) {
|
|
|
3917
3919
|
};
|
|
3918
3920
|
return [...above.map((row) => {
|
|
3919
3921
|
const y = Math.max(...row.map((r) => r.y));
|
|
3922
|
+
const size = Math.max(...row.map((r) => r.fontSizePt || fontSize));
|
|
3920
3923
|
return {
|
|
3921
|
-
el: paragraphFromRuns(lineOf(row, y,
|
|
3924
|
+
el: paragraphFromRuns(lineOf(row, y, size, stepped).spans),
|
|
3922
3925
|
top: y
|
|
3923
3926
|
};
|
|
3924
3927
|
}), {
|
|
@@ -4002,4 +4005,4 @@ var TABLE_ALIGNED_SHARE = .6;
|
|
|
4002
4005
|
*/
|
|
4003
4006
|
var TABLE_CELL_FILL = .65;
|
|
4004
4007
|
//#endregion
|
|
4005
|
-
export { FOOTER_PART, HEADER_PART, endedParagraph, footerBand, numberedFrom, numberingOf, pageTextEdges, reconstructByLayout, runningFoot, stepsBetweenWords };
|
|
4008
|
+
export { EVEN_FOOTER_PART, FOOTER_PART, HEADER_PART, drawnWords, endedParagraph, footerBand, numberedFrom, numberingOf, pageTextEdges, reconstructByLayout, runningFoot, stepsBetweenWords };
|
|
@@ -21,6 +21,7 @@ function hexVal(b) {
|
|
|
21
21
|
* read and assign it directly.
|
|
22
22
|
*/
|
|
23
23
|
var Lexer = class {
|
|
24
|
+
buf;
|
|
24
25
|
pos;
|
|
25
26
|
/**
|
|
26
27
|
* @param buf The PDF byte buffer to tokenize.
|
|
@@ -306,4 +307,4 @@ function latin1(bytes) {
|
|
|
306
307
|
return s;
|
|
307
308
|
}
|
|
308
309
|
//#endregion
|
|
309
|
-
export { Lexer };
|
|
310
|
+
export { Lexer, latin1 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/pdf-reader/math-rows.ts
|
|
2
2
|
/** The brackets a matrix may be written in, opening → closing. */
|
|
3
|
-
var BRACKETS = new Map([
|
|
3
|
+
var BRACKETS = /* @__PURE__ */ new Map([
|
|
4
4
|
["(", ")"],
|
|
5
5
|
["[", "]"],
|
|
6
6
|
["{", "}"],
|
|
@@ -94,7 +94,7 @@ function matrixFrom(cluster) {
|
|
|
94
94
|
endChr: pair.close.text.trim(),
|
|
95
95
|
children: [inside.matrix]
|
|
96
96
|
});
|
|
97
|
-
used = new Set([
|
|
97
|
+
used = /* @__PURE__ */ new Set([
|
|
98
98
|
...used,
|
|
99
99
|
...inside.used,
|
|
100
100
|
pair.open,
|
|
@@ -106,7 +106,7 @@ function sample(marks, cell) {
|
|
|
106
106
|
if (flat.some((m) => covers(m, px, py))) hit++;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
return hit /
|
|
109
|
+
return hit / 2304;
|
|
110
110
|
}
|
|
111
111
|
/** Whether one mark paints the point — inside its outline, or under its pen. */
|
|
112
112
|
function covers(mark, px, py) {
|
|
@@ -182,7 +182,6 @@ function flatten(segs) {
|
|
|
182
182
|
]);
|
|
183
183
|
cx = sx;
|
|
184
184
|
cy = sy;
|
|
185
|
-
break;
|
|
186
185
|
}
|
|
187
186
|
return out;
|
|
188
187
|
}
|
|
@@ -151,7 +151,7 @@ function readingOf(file) {
|
|
|
151
151
|
var pdfReader = {
|
|
152
152
|
id: "pdf",
|
|
153
153
|
produces: "flow",
|
|
154
|
-
supports: new Set([
|
|
154
|
+
supports: /* @__PURE__ */ new Set([
|
|
155
155
|
FEATURES.text,
|
|
156
156
|
FEATURES.tables,
|
|
157
157
|
FEATURES.lists,
|
|
@@ -165,4 +165,4 @@ function isFilters(value) {
|
|
|
165
165
|
return typeof value === "object" && value !== null;
|
|
166
166
|
}
|
|
167
167
|
//#endregion
|
|
168
|
-
export { pdfReader };
|
|
168
|
+
export { pdfReader, readPdf };
|
|
@@ -123,7 +123,7 @@ function allMcids(node) {
|
|
|
123
123
|
* `Sub`), a formula (§14.8.4.5.5, which is set in a line as often as out of
|
|
124
124
|
* one), and a list label, which is the start of its item's line.
|
|
125
125
|
*/
|
|
126
|
-
var INLINE = new Set([
|
|
126
|
+
var INLINE = /* @__PURE__ */ new Set([
|
|
127
127
|
"Span",
|
|
128
128
|
"Quote",
|
|
129
129
|
"Reference",
|
|
@@ -43,12 +43,13 @@ function reconstructTaggedPdf(file) {
|
|
|
43
43
|
const placedRuns = turned ? extracted.map((runs, i) => placeRuns(runs, shown[i])) : onSheets;
|
|
44
44
|
const vectorLosses = [];
|
|
45
45
|
const pageVectors = pages.map((page, i) => {
|
|
46
|
-
const
|
|
46
|
+
const covered = collectPageImages(file, page).images.map((img) => ({
|
|
47
47
|
minX: img.x,
|
|
48
48
|
minY: img.y,
|
|
49
49
|
maxX: img.x + img.widthPt,
|
|
50
50
|
maxY: img.y + img.heightPt
|
|
51
|
-
}))
|
|
51
|
+
}));
|
|
52
|
+
const lifted = collectPageVectors(file, page, covered);
|
|
52
53
|
vectorLosses.push(...lifted.losses);
|
|
53
54
|
return placeVectors(lifted.vectors, shown[i]);
|
|
54
55
|
});
|
|
@@ -26,7 +26,7 @@ function extractPageText(file, page, painted) {
|
|
|
26
26
|
const runs = [];
|
|
27
27
|
collectRuns(file, page.resources, file.pageContent(page), IDENTITY, 0, /* @__PURE__ */ new Set(), runs, painted);
|
|
28
28
|
const own = runs.length;
|
|
29
|
-
for (const appearance of collectPageAppearances(file, page)) collectRuns(file, appearance.resources ?? page.resources, appearanceContent(file, appearance), appearance.ctm, 1, new Set([appearance.stream]), runs, painted);
|
|
29
|
+
for (const appearance of collectPageAppearances(file, page)) collectRuns(file, appearance.resources ?? page.resources, appearanceContent(file, appearance), appearance.ctm, 1, /* @__PURE__ */ new Set([appearance.stream]), runs, painted);
|
|
30
30
|
for (let i = own; i < runs.length; i++) runs[i] = {
|
|
31
31
|
...runs[i],
|
|
32
32
|
annotation: true
|
|
@@ -238,7 +238,7 @@ var ACCENT_LIFT_EM = .6;
|
|
|
238
238
|
/** How far, in ems, an accent must overlap its letter to stand over it. */
|
|
239
239
|
var ACCENT_OVERLAP_EM = .05;
|
|
240
240
|
/** The spacing accents TeX strikes over a letter, and the combining marks they are. */
|
|
241
|
-
var ACCENTS = new Map([
|
|
241
|
+
var ACCENTS = /* @__PURE__ */ new Map([
|
|
242
242
|
["`", "̀"],
|
|
243
243
|
["´", "́"],
|
|
244
244
|
["ˆ", "̂"],
|
|
@@ -9,13 +9,11 @@ var VARIANTS = [
|
|
|
9
9
|
["p:italic", "italic"],
|
|
10
10
|
["p:boldItalic", "boldItalic"]
|
|
11
11
|
];
|
|
12
|
-
var EOT_VERSIONS = new Set([
|
|
12
|
+
var EOT_VERSIONS = /* @__PURE__ */ new Set([
|
|
13
13
|
65536,
|
|
14
14
|
131073,
|
|
15
15
|
131074
|
|
16
16
|
]);
|
|
17
|
-
var TTEMBED_TTCOMPRESSED = 4;
|
|
18
|
-
var TTEMBED_XORENCRYPTDATA = 268435456;
|
|
19
17
|
/**
|
|
20
18
|
* Read one `fntdata` part: the font itself when the container stores it
|
|
21
19
|
* plainly, and what stopped it otherwise.
|
|
@@ -33,7 +31,7 @@ function readFntData(data) {
|
|
|
33
31
|
const version = v.getUint32(8, true);
|
|
34
32
|
const flags = v.getUint32(12, true);
|
|
35
33
|
if (eotSize !== data.length || !EOT_VERSIONS.has(version)) return { kind: "unreadable" };
|
|
36
|
-
if ((flags &
|
|
34
|
+
if ((flags & 268435460) !== 0) return { kind: "compressed" };
|
|
37
35
|
let at = 82;
|
|
38
36
|
for (let i = 0; i < 4; i++) {
|
|
39
37
|
if (at + 2 > data.length) return { kind: "unreadable" };
|
|
@@ -101,4 +99,4 @@ function isSfnt(data) {
|
|
|
101
99
|
return sig === 65536 || sig === 1330926671 || sig === 1953658213 || sig === 1953784678;
|
|
102
100
|
}
|
|
103
101
|
//#endregion
|
|
104
|
-
export { loadPptxEmbeddedFonts };
|
|
102
|
+
export { loadPptxEmbeddedFonts, readFntData };
|
|
@@ -317,4 +317,4 @@ function collectTxStyles(masterTree, colors, themeFonts) {
|
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
//#endregion
|
|
320
|
-
export { buildPlaceholderCascade, lineSpacing, parseBullet, parseLevelStyles, spacingFractions, spacingFromLineFraction };
|
|
320
|
+
export { buildPlaceholderCascade, lineSpacing, pPrToParagraphProps, parseBullet, parseLevelStyles, spacingFractions, spacingFromLineFraction };
|
|
@@ -48,10 +48,11 @@ function readPpt(bytes) {
|
|
|
48
48
|
const width = pt(content.slideWidthPt ?? DEFAULT_SLIDE_W);
|
|
49
49
|
const height = pt(content.slideHeightPt ?? DEFAULT_SLIDE_H);
|
|
50
50
|
const resources = new ResourceStore();
|
|
51
|
+
const body = buildBody(content, resources, width, height);
|
|
51
52
|
return {
|
|
52
53
|
doc: {
|
|
53
54
|
kind: "flow",
|
|
54
|
-
body: resolveBodyStyles(
|
|
55
|
+
body: resolveBodyStyles(body, EMPTY_STYLE_SHEET),
|
|
55
56
|
sections: [],
|
|
56
57
|
section: {
|
|
57
58
|
pageSize: {
|
|
@@ -249,7 +250,7 @@ function positionedImage(rect, image, resources) {
|
|
|
249
250
|
}
|
|
250
251
|
};
|
|
251
252
|
}
|
|
252
|
-
var SHAPE_PRESETS = new Map([
|
|
253
|
+
var SHAPE_PRESETS = /* @__PURE__ */ new Map([
|
|
253
254
|
[1, "rect"],
|
|
254
255
|
[2, "roundRect"],
|
|
255
256
|
[3, "ellipse"],
|
|
@@ -523,9 +524,9 @@ function anchorParagraph(breakBefore) {
|
|
|
523
524
|
var pptReader = {
|
|
524
525
|
id: "ppt",
|
|
525
526
|
produces: "flow",
|
|
526
|
-
supports: new Set([FEATURES.text]),
|
|
527
|
+
supports: /* @__PURE__ */ new Set([FEATURES.text]),
|
|
527
528
|
sniff: looksLikePpt,
|
|
528
529
|
read: (bytes) => readPpt(bytes)
|
|
529
530
|
};
|
|
530
531
|
//#endregion
|
|
531
|
-
export { pptReader };
|
|
532
|
+
export { pptReader, readPpt };
|
|
@@ -84,7 +84,6 @@ var SLIDE_FLAG_MASTER_SCHEME = 2;
|
|
|
84
84
|
var COLORREF_SCHEME_INDEX = 8;
|
|
85
85
|
var COLORREF_SYS_INDEX = 16;
|
|
86
86
|
var FBSE_FODELAY_OFFSET = 28;
|
|
87
|
-
var FSP_FLAG_PATRIARCH = 4;
|
|
88
87
|
var FSP_FLAG_BACKGROUND = 1024;
|
|
89
88
|
var TOKEN_ENCRYPTED = 4090610911;
|
|
90
89
|
var SLWT_INSTANCE_SLIDES = 0;
|
|
@@ -157,7 +156,7 @@ function extractPptContent(bytes) {
|
|
|
157
156
|
const docRec = docOffset !== void 0 ? recordAt(stream, docOffset) : findDocument(stream);
|
|
158
157
|
const noImages = {
|
|
159
158
|
foDelays: [],
|
|
160
|
-
pictures: new Uint8Array(0)
|
|
159
|
+
pictures: /* @__PURE__ */ new Uint8Array(0)
|
|
161
160
|
};
|
|
162
161
|
if (!docRec || docRec.type !== RT_DOCUMENT) return {
|
|
163
162
|
slides: slidesByScan(stream, noImages),
|
|
@@ -165,7 +164,7 @@ function extractPptContent(bytes) {
|
|
|
165
164
|
};
|
|
166
165
|
const img = {
|
|
167
166
|
foDelays: parseFbseStore(docRec.data),
|
|
168
|
-
pictures: cfb.readStream("Pictures") ?? new Uint8Array(0)
|
|
167
|
+
pictures: cfb.readStream("Pictures") ?? /* @__PURE__ */ new Uint8Array(0)
|
|
169
168
|
};
|
|
170
169
|
const slides = readSlideList(stream, docRec.data, persist, img);
|
|
171
170
|
const hasContent = slides.some(slideHasContent);
|
|
@@ -369,7 +368,7 @@ function parseFbseStore(docData) {
|
|
|
369
368
|
const store = findDescendantContainer(group, FBT_BSTORE_CONTAINER, 0);
|
|
370
369
|
if (!store) return [];
|
|
371
370
|
const foDelays = [];
|
|
372
|
-
for (const r of records(store)) if (r.type === FBT_BSE) foDelays.push(r.data.length >=
|
|
371
|
+
for (const r of records(store)) if (r.type === FBT_BSE) foDelays.push(r.data.length >= 32 ? u32(r.data, FBSE_FODELAY_OFFSET) : 0);
|
|
373
372
|
return foDelays;
|
|
374
373
|
}
|
|
375
374
|
function findDescendantContainer(d, type, depth) {
|
|
@@ -464,7 +463,7 @@ function collectShapeContainers(d, img, out, depth, env, outline, defaults, grou
|
|
|
464
463
|
...pictureTransparentHex !== void 0 ? { transparentHex: pictureTransparentHex } : {}
|
|
465
464
|
} : void 0;
|
|
466
465
|
const textParas = gtext ?? (paragraphs?.some((p) => paragraphText(p).length > 0) === true ? paragraphs : void 0) ? gtext ? [gtext] : paragraphs : void 0;
|
|
467
|
-
const decorative = (fspFlags &
|
|
466
|
+
const decorative = (fspFlags & 1029) === 0;
|
|
468
467
|
const autoShape = !gtext && !image && rectPt && (shapeType > 0 || geometry) && decorative && (fillColorHex || lineColorHex || fillImage) ? {
|
|
469
468
|
shapeType,
|
|
470
469
|
...fillColorHex ? { fillColorHex } : {},
|
|
@@ -567,7 +566,7 @@ function readMasterLevels(d, levels, prefix, fonts) {
|
|
|
567
566
|
off
|
|
568
567
|
};
|
|
569
568
|
}
|
|
570
|
-
var TEXT_TYPE_FALLBACK = new Map([
|
|
569
|
+
var TEXT_TYPE_FALLBACK = /* @__PURE__ */ new Map([
|
|
571
570
|
[5, 1],
|
|
572
571
|
[6, 0],
|
|
573
572
|
[7, 1],
|
|
@@ -813,8 +812,8 @@ function inlineBlip(blob) {
|
|
|
813
812
|
return bytes ? { bytes } : void 0;
|
|
814
813
|
}
|
|
815
814
|
var PATTERN_TILE_PT = {
|
|
816
|
-
widthPt:
|
|
817
|
-
heightPt:
|
|
815
|
+
widthPt: 6,
|
|
816
|
+
heightPt: 6
|
|
818
817
|
};
|
|
819
818
|
/**
|
|
820
819
|
* §2.3.7.1 MSOFILLTYPE 1 — the picture a PATTERN fill repeats.
|
|
@@ -952,7 +951,7 @@ function optComplex(d, count, wantId) {
|
|
|
952
951
|
offset += len;
|
|
953
952
|
}
|
|
954
953
|
}
|
|
955
|
-
var ARRAY_PROPS = new Set([
|
|
954
|
+
var ARRAY_PROPS = /* @__PURE__ */ new Set([
|
|
956
955
|
325,
|
|
957
956
|
326,
|
|
958
957
|
327,
|
|
@@ -1077,7 +1076,7 @@ function parseFreeformGeometry(d, count) {
|
|
|
1077
1076
|
commands
|
|
1078
1077
|
} : void 0;
|
|
1079
1078
|
}
|
|
1080
|
-
var SYS_COLORS = new Map([
|
|
1079
|
+
var SYS_COLORS = /* @__PURE__ */ new Map([
|
|
1081
1080
|
[5, "FFFFFF"],
|
|
1082
1081
|
[6, "000000"],
|
|
1083
1082
|
[7, "000000"],
|
|
@@ -6,9 +6,9 @@ import "../core/style-cascade/index.js";
|
|
|
6
6
|
import { poAttr, poChildren, poFindDescendant, poIntAttr, poIs } from "../core/po-helpers.js";
|
|
7
7
|
import { cachedDiagramTree, laidOutDiagramTree } from "../core/drawingml/diagram/run.js";
|
|
8
8
|
import { packageHasPart } from "../core/bytes.js";
|
|
9
|
+
import { parseTheme, parseThemeBgFillStyles, parseThemeFillStyles, parseThemeFonts, parseThemeLineWidths } from "../core/drawingml/theme-parser.js";
|
|
9
10
|
import { DEFAULT_SCHEME_ALIAS, DEFAULT_THEME_PALETTE, defaultColorResolver, makeColorResolver } from "../core/drawingml/colors.js";
|
|
10
11
|
import { parseChart, withChartColorStyle } from "../core/drawingml/chart-parser.js";
|
|
11
|
-
import { parseTheme, parseThemeBgFillStyles, parseThemeFillStyles, parseThemeFonts, parseThemeLineWidths } from "../core/drawingml/theme-parser.js";
|
|
12
12
|
import { OpcPackage } from "../core/opc/package.js";
|
|
13
13
|
import "../core/opc/index.js";
|
|
14
14
|
import { loadPptxEmbeddedFonts } from "./embedded-fonts.js";
|
|
@@ -497,7 +497,7 @@ function partShapes(pkg, path, tree, root, deps) {
|
|
|
497
497
|
const cSld = part ? poChildren(part).find((c) => poIs(c, "p:cSld")) : void 0;
|
|
498
498
|
const spTree = cSld ? poChildren(cSld).find((c) => poIs(c, "p:spTree")) : void 0;
|
|
499
499
|
if (!spTree) return [];
|
|
500
|
-
|
|
500
|
+
const ctx = {
|
|
501
501
|
colors: deps.colors,
|
|
502
502
|
...deps.themeFills ? { themeFills: deps.themeFills } : {},
|
|
503
503
|
...deps.themeLineWidths ? { themeLineWidths: deps.themeLineWidths } : {},
|
|
@@ -508,7 +508,8 @@ function partShapes(pkg, path, tree, root, deps) {
|
|
|
508
508
|
resolveHyperlink: makeHyperlinkResolver(pkg, path),
|
|
509
509
|
resolveDiagram: makeSlideDiagramResolver(pkg, path),
|
|
510
510
|
onLoss: deps.onLoss
|
|
511
|
-
}
|
|
511
|
+
};
|
|
512
|
+
return parseSlideShapes(spTree, ctx, void 0, true);
|
|
512
513
|
}
|
|
513
514
|
/**
|
|
514
515
|
* §19.3.1.38/§19.3.1.39 `@showMasterSp` — whether this part draws the shapes it
|
|
@@ -574,7 +575,7 @@ function themePart(pkg, masterPath) {
|
|
|
574
575
|
var pptxReader = {
|
|
575
576
|
id: "pptx",
|
|
576
577
|
produces: "flow",
|
|
577
|
-
supports: new Set([
|
|
578
|
+
supports: /* @__PURE__ */ new Set([
|
|
578
579
|
FEATURES.text,
|
|
579
580
|
FEATURES.images,
|
|
580
581
|
FEATURES.shapes,
|
|
@@ -585,4 +586,4 @@ var pptxReader = {
|
|
|
585
586
|
read: (bytes) => readPptx(bytes)
|
|
586
587
|
};
|
|
587
588
|
//#endregion
|
|
588
|
-
export { parseXml, pptxReader };
|
|
589
|
+
export { parseXml, pptxReader, readPptx };
|