pptx-react-viewer 1.1.3 → 1.1.5

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.
Files changed (39) hide show
  1. package/dist/index.js +1099 -384
  2. package/dist/index.mjs +1099 -385
  3. package/dist/pptx-viewer.css +1 -1
  4. package/dist/viewer/index.js +1117 -390
  5. package/dist/viewer/index.mjs +1117 -391
  6. package/node_modules/emf-converter/dist/index.d.mts +2 -2
  7. package/node_modules/emf-converter/dist/index.d.ts +2 -2
  8. package/node_modules/emf-converter/dist/index.js +91 -33
  9. package/node_modules/emf-converter/dist/index.mjs +91 -33
  10. package/node_modules/emf-converter/package.json +2 -2
  11. package/node_modules/mtx-decompressor/dist/index.js +39 -9
  12. package/node_modules/mtx-decompressor/dist/index.mjs +39 -9
  13. package/node_modules/mtx-decompressor/package.json +2 -2
  14. package/node_modules/pptx-viewer-core/dist/{SvgExporter-BMjoxMDV.d.ts → SvgExporter-0TxiiorD.d.ts} +1 -1
  15. package/node_modules/pptx-viewer-core/dist/{SvgExporter-z6AbXRQg.d.mts → SvgExporter-BQ4KbRO9.d.mts} +1 -1
  16. package/node_modules/pptx-viewer-core/dist/cli/index.d.mts +2 -2
  17. package/node_modules/pptx-viewer-core/dist/cli/index.d.ts +2 -2
  18. package/node_modules/pptx-viewer-core/dist/cli/index.js +0 -0
  19. package/node_modules/pptx-viewer-core/dist/cli/index.mjs +0 -0
  20. package/node_modules/pptx-viewer-core/dist/converter/index.d.mts +3 -3
  21. package/node_modules/pptx-viewer-core/dist/converter/index.d.ts +3 -3
  22. package/node_modules/pptx-viewer-core/dist/converter/index.js +0 -0
  23. package/node_modules/pptx-viewer-core/dist/converter/index.mjs +0 -0
  24. package/node_modules/pptx-viewer-core/dist/index.d.mts +786 -54
  25. package/node_modules/pptx-viewer-core/dist/index.d.ts +786 -54
  26. package/node_modules/pptx-viewer-core/dist/index.js +3589 -630
  27. package/node_modules/pptx-viewer-core/dist/index.mjs +3575 -630
  28. package/node_modules/pptx-viewer-core/dist/{presentation-CchuDGfU.d.mts → presentation-ArhfImJ5.d.mts} +225 -8
  29. package/node_modules/pptx-viewer-core/dist/{presentation-CchuDGfU.d.ts → presentation-ArhfImJ5.d.ts} +225 -8
  30. package/node_modules/pptx-viewer-core/dist/{signature-inspection-status-BcJSdOvb.d.mts → signature-inspection-status-BCUpfCQh.d.mts} +13 -2
  31. package/node_modules/pptx-viewer-core/dist/{signature-inspection-status-BcJSdOvb.d.ts → signature-inspection-status-BCUpfCQh.d.ts} +13 -2
  32. package/node_modules/pptx-viewer-core/dist/signature-node/index.d.mts +2 -2
  33. package/node_modules/pptx-viewer-core/dist/signature-node/index.d.ts +2 -2
  34. package/node_modules/pptx-viewer-core/dist/signature-node/index.js +17 -3
  35. package/node_modules/pptx-viewer-core/dist/signature-node/index.mjs +16 -4
  36. package/node_modules/pptx-viewer-core/dist/{text-operations-CeukUztU.d.mts → text-operations-CLj-sJyk.d.mts} +1 -1
  37. package/node_modules/pptx-viewer-core/dist/{text-operations-e7JxgI5l.d.ts → text-operations-rhJV-A_W.d.ts} +1 -1
  38. package/node_modules/pptx-viewer-core/package.json +5 -5
  39. package/package.json +22 -20
@@ -591,14 +591,8 @@ function decodeSimpleGlyph(numContours, streams, out, calcBBox, minX, minY, maxX
591
591
  const flag = flagBytes[i];
592
592
  onCurve[i] = flag & 128 ? 0 : 1;
593
593
  const enc = TRIPLET_ENCODINGS[flag & 127];
594
- const extraBytes = enc.byteCount - 1;
595
- const subBuf = new Uint8Array(extraBytes);
596
- for (let b = 0; b < extraBytes; b++) {
597
- subBuf[b] = sGlyph.readU8();
598
- }
599
- const sub = new Stream(subBuf, extraBytes);
600
- let dx = sub.readNBits(enc.xBits) + enc.deltaX;
601
- let dy = sub.readNBits(enc.yBits) + enc.deltaY;
594
+ let dx = sGlyph.readNBits(enc.xBits) + enc.deltaX;
595
+ let dy = sGlyph.readNBits(enc.yBits) + enc.deltaY;
602
596
  if (enc.xSign !== 0) {
603
597
  dx *= enc.xSign;
604
598
  }
@@ -1156,6 +1150,8 @@ var MAX_2BYTE_DIST = 512;
1156
1150
  var PRELOAD_SIZE = 2 * 32 * 96 + 4 * 256;
1157
1151
  var LEN_MIN = 2;
1158
1152
  var DIST_MIN = 1;
1153
+ var MAX_OUT_LEN = 4 * 1024 * 1024;
1154
+ var MAX_OUT = 16 * 1024 * 1024;
1159
1155
  var RLE_INITIAL = 0;
1160
1156
  var RLE_NORMAL = 1;
1161
1157
  var RLE_SEEN_ESCAPE = 2;
@@ -1165,6 +1161,9 @@ function setDistRange(length) {
1165
1161
  let distMax = DIST_MIN + ((1 << DIST_WIDTH * numDistRanges) - 1);
1166
1162
  while (distMax < length) {
1167
1163
  numDistRanges++;
1164
+ if (numDistRanges > 8) {
1165
+ throw new Error("LZCOMP setDistRange: numDistRanges exceeds bound (8)");
1166
+ }
1168
1167
  distMax = DIST_MIN + ((1 << DIST_WIDTH * numDistRanges) - 1);
1169
1168
  }
1170
1169
  const DUP2 = 256 + (1 << LEN_WIDTH) * numDistRanges;
@@ -1195,7 +1194,11 @@ function decodeLength(lenEcoder, symbol, numDistRangesOut) {
1195
1194
  let firstTime = true;
1196
1195
  let value = 0;
1197
1196
  let done;
1197
+ let iters = 0;
1198
1198
  do {
1199
+ if (++iters > 16) {
1200
+ throw new Error("LZCOMP decodeLength: iteration cap exceeded");
1201
+ }
1199
1202
  let bits;
1200
1203
  if (firstTime) {
1201
1204
  bits = symbol - 256;
@@ -1234,6 +1237,9 @@ function lzcompDecompress(data, size, version) {
1234
1237
  const distEcoder = new AHuff(bio, 1 << DIST_WIDTH);
1235
1238
  const lenEcoder = new AHuff(bio, 1 << LEN_WIDTH);
1236
1239
  const outLen = bio.readValue(24);
1240
+ if (outLen > MAX_OUT_LEN) {
1241
+ throw new Error(`LZCOMP outLen ${outLen} exceeds maximum (${MAX_OUT_LEN})`);
1242
+ }
1237
1243
  const { DUP2, DUP4, DUP6, NUM_SYMS } = setDistRange(outLen);
1238
1244
  const symEcoder = new AHuff(bio, NUM_SYMS);
1239
1245
  const windowSize = PRELOAD_SIZE + outLen;
@@ -1250,6 +1256,9 @@ function lzcompDecompress(data, size, version) {
1250
1256
  if (!usingRunLength) {
1251
1257
  if (outIdx >= outBufSize) {
1252
1258
  outBufSize += outBufSize >>> 1;
1259
+ if (outBufSize > MAX_OUT) {
1260
+ throw new Error("LZCOMP output exceeds maximum size budget");
1261
+ }
1253
1262
  const tmp = new Uint8Array(outBufSize);
1254
1263
  tmp.set(outBuf);
1255
1264
  outBuf = tmp;
@@ -1268,6 +1277,9 @@ function lzcompDecompress(data, size, version) {
1268
1277
  } else {
1269
1278
  if (outIdx >= outBufSize) {
1270
1279
  outBufSize += outBufSize >>> 1;
1280
+ if (outBufSize > MAX_OUT) {
1281
+ throw new Error("LZCOMP output exceeds maximum size budget");
1282
+ }
1271
1283
  const tmp = new Uint8Array(outBufSize);
1272
1284
  tmp.set(outBuf);
1273
1285
  outBuf = tmp;
@@ -1280,6 +1292,9 @@ function lzcompDecompress(data, size, version) {
1280
1292
  if (rleCount === 0) {
1281
1293
  if (outIdx >= outBufSize) {
1282
1294
  outBufSize += outBufSize >>> 1;
1295
+ if (outBufSize > MAX_OUT) {
1296
+ throw new Error("LZCOMP output exceeds maximum size budget");
1297
+ }
1283
1298
  const tmp = new Uint8Array(outBufSize);
1284
1299
  tmp.set(outBuf);
1285
1300
  outBuf = tmp;
@@ -1293,6 +1308,9 @@ function lzcompDecompress(data, size, version) {
1293
1308
  case RLE_NEED_BYTE: {
1294
1309
  if (outIdx + rleCount > outBufSize) {
1295
1310
  outBufSize = outIdx + rleCount + (outBufSize >>> 1);
1311
+ if (outBufSize > MAX_OUT) {
1312
+ throw new Error("LZCOMP output exceeds maximum size budget");
1313
+ }
1296
1314
  const tmp = new Uint8Array(outBufSize);
1297
1315
  tmp.set(outBuf);
1298
1316
  outBuf = tmp;
@@ -1456,11 +1474,23 @@ function dumpContainer(ctr) {
1456
1474
  // src/mtx-decompress.ts
1457
1475
  var ENCRYPTION_KEY = 80;
1458
1476
  function unpackMtx(data, size) {
1477
+ if (size < 10 || data.length < 10) {
1478
+ throw new Error("MTX data too small: header requires at least 10 bytes");
1479
+ }
1459
1480
  const versionMagic = data[0];
1460
1481
  const offset2 = data[4] << 16 | data[5] << 8 | data[6];
1461
1482
  const offset3 = data[7] << 16 | data[8] << 8 | data[9];
1483
+ if (offset2 < 10 || offset3 < offset2 || offset3 > size) {
1484
+ throw new Error(
1485
+ `MTX header offsets out of bounds: offset2=${offset2}, offset3=${offset3}, size=${size}`
1486
+ );
1487
+ }
1462
1488
  const offsets = [10, offset2, offset3];
1463
- const blockSizes = [offset2 - 10, offset3 - offset2, size - offset3];
1489
+ const blockSizes = [
1490
+ Math.max(0, offset2 - 10),
1491
+ Math.max(0, offset3 - offset2),
1492
+ Math.max(0, size - offset3)
1493
+ ];
1464
1494
  const streams = [];
1465
1495
  const decompressedSizes = [];
1466
1496
  for (let i = 0; i < 3; i++) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mtx-decompressor",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "MicroType Express (MTX) font decompressor — extracts TTF/OTF from compressed EOT containers.",
5
5
  "homepage": "https://github.com/ChristopherVR/pptx-viewer",
6
6
  "bugs": {
@@ -39,6 +39,6 @@
39
39
  "devDependencies": {
40
40
  "tsup": "^8.5.1",
41
41
  "typescript": "^5.9.3",
42
- "vitest": "^4.1.0"
42
+ "vitest": "^4.1.5"
43
43
  }
44
44
  }
@@ -1,4 +1,4 @@
1
- import { m as PptxData, P as PptxElement, K as TextSegment, l as PptxSlide } from './presentation-CchuDGfU.js';
1
+ import { m as PptxData, P as PptxElement, K as TextSegment, l as PptxSlide } from './presentation-ArhfImJ5.js';
2
2
 
3
3
  /**
4
4
  * Platform adapter for file system operations.
@@ -1,4 +1,4 @@
1
- import { m as PptxData, P as PptxElement, K as TextSegment, l as PptxSlide } from './presentation-CchuDGfU.mjs';
1
+ import { m as PptxData, P as PptxElement, K as TextSegment, l as PptxSlide } from './presentation-ArhfImJ5.mjs';
2
2
 
3
3
  /**
4
4
  * Platform adapter for file system operations.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { F as FindResult, M as MergeOptions } from '../text-operations-CeukUztU.mjs';
3
- import '../presentation-CchuDGfU.mjs';
2
+ import { F as FindResult, M as MergeOptions } from '../text-operations-CLj-sJyk.mjs';
3
+ import '../presentation-ArhfImJ5.mjs';
4
4
 
5
5
  /**
6
6
  * CLI command handlers for pptx-cli.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { F as FindResult, M as MergeOptions } from '../text-operations-e7JxgI5l.js';
3
- import '../presentation-CchuDGfU.js';
2
+ import { F as FindResult, M as MergeOptions } from '../text-operations-rhJV-A_W.js';
3
+ import '../presentation-ArhfImJ5.js';
4
4
 
5
5
  /**
6
6
  * CLI command handlers for pptx-cli.
@@ -1,6 +1,6 @@
1
- import { T as TextSegmentRenderer } from '../SvgExporter-z6AbXRQg.mjs';
2
- export { C as ConversionOptions, a as ConversionResult, D as DocumentConverter, F as FileSystemAdapter, M as MediaContext, P as PptxConverterOptions, b as PptxMarkdownConverter, S as SlideProcessor, c as SlideProcessorOptions, d as SvgExportOptions, e as SvgExporter, f as dataUrlToMediaBytes, g as deriveOutputPath, h as generateMediaFilename, i as getDirectory, n as normalizePath } from '../SvgExporter-z6AbXRQg.mjs';
3
- import { l as PptxSlide } from '../presentation-CchuDGfU.mjs';
1
+ import { T as TextSegmentRenderer } from '../SvgExporter-BQ4KbRO9.mjs';
2
+ export { C as ConversionOptions, a as ConversionResult, D as DocumentConverter, F as FileSystemAdapter, M as MediaContext, P as PptxConverterOptions, b as PptxMarkdownConverter, S as SlideProcessor, c as SlideProcessorOptions, d as SvgExportOptions, e as SvgExporter, f as dataUrlToMediaBytes, g as deriveOutputPath, h as generateMediaFilename, i as getDirectory, n as normalizePath } from '../SvgExporter-BQ4KbRO9.mjs';
3
+ import { l as PptxSlide } from '../presentation-ArhfImJ5.mjs';
4
4
 
5
5
  /**
6
6
  * Renders slide-level metadata sections (transition, animations,
@@ -1,6 +1,6 @@
1
- import { T as TextSegmentRenderer } from '../SvgExporter-BMjoxMDV.js';
2
- export { C as ConversionOptions, a as ConversionResult, D as DocumentConverter, F as FileSystemAdapter, M as MediaContext, P as PptxConverterOptions, b as PptxMarkdownConverter, S as SlideProcessor, c as SlideProcessorOptions, d as SvgExportOptions, e as SvgExporter, f as dataUrlToMediaBytes, g as deriveOutputPath, h as generateMediaFilename, i as getDirectory, n as normalizePath } from '../SvgExporter-BMjoxMDV.js';
3
- import { l as PptxSlide } from '../presentation-CchuDGfU.js';
1
+ import { T as TextSegmentRenderer } from '../SvgExporter-0TxiiorD.js';
2
+ export { C as ConversionOptions, a as ConversionResult, D as DocumentConverter, F as FileSystemAdapter, M as MediaContext, P as PptxConverterOptions, b as PptxMarkdownConverter, S as SlideProcessor, c as SlideProcessorOptions, d as SvgExportOptions, e as SvgExporter, f as dataUrlToMediaBytes, g as deriveOutputPath, h as generateMediaFilename, i as getDirectory, n as normalizePath } from '../SvgExporter-0TxiiorD.js';
3
+ import { l as PptxSlide } from '../presentation-ArhfImJ5.js';
4
4
 
5
5
  /**
6
6
  * Renders slide-level metadata sections (transition, animations,