pptx-react-viewer 1.1.4 → 1.1.6
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/index.js +865 -159
- package/dist/index.mjs +866 -161
- package/dist/viewer/index.js +883 -165
- package/dist/viewer/index.mjs +884 -167
- package/node_modules/emf-converter/dist/index.d.mts +2 -2
- package/node_modules/emf-converter/dist/index.d.ts +2 -2
- package/node_modules/emf-converter/dist/index.js +91 -33
- package/node_modules/emf-converter/dist/index.mjs +91 -33
- package/node_modules/emf-converter/package.json +1 -1
- package/node_modules/mtx-decompressor/dist/index.js +39 -9
- package/node_modules/mtx-decompressor/dist/index.mjs +39 -9
- package/node_modules/mtx-decompressor/package.json +1 -1
- package/node_modules/pptx-viewer-core/dist/{SvgExporter-BQ4KbRO9.d.mts → SvgExporter-BTkk4oNQ.d.mts} +1 -1
- package/node_modules/pptx-viewer-core/dist/{SvgExporter-0TxiiorD.d.ts → SvgExporter-CTDG-t_z.d.ts} +1 -1
- package/node_modules/pptx-viewer-core/dist/cli/index.d.mts +2 -2
- package/node_modules/pptx-viewer-core/dist/cli/index.d.ts +2 -2
- package/node_modules/pptx-viewer-core/dist/cli/index.js +0 -0
- package/node_modules/pptx-viewer-core/dist/cli/index.mjs +0 -0
- package/node_modules/pptx-viewer-core/dist/converter/index.d.mts +3 -3
- package/node_modules/pptx-viewer-core/dist/converter/index.d.ts +3 -3
- package/node_modules/pptx-viewer-core/dist/converter/index.js +0 -0
- package/node_modules/pptx-viewer-core/dist/converter/index.mjs +0 -0
- package/node_modules/pptx-viewer-core/dist/index.d.mts +961 -59
- package/node_modules/pptx-viewer-core/dist/index.d.ts +961 -59
- package/node_modules/pptx-viewer-core/dist/index.js +29880 -16692
- package/node_modules/pptx-viewer-core/dist/index.mjs +29859 -16692
- package/node_modules/pptx-viewer-core/dist/{presentation-ArhfImJ5.d.mts → presentation-4fhI3din.d.mts} +835 -26
- package/node_modules/pptx-viewer-core/dist/{presentation-ArhfImJ5.d.ts → presentation-4fhI3din.d.ts} +835 -26
- package/node_modules/pptx-viewer-core/dist/{signature-inspection-status-BcJSdOvb.d.mts → signature-inspection-status-BCUpfCQh.d.mts} +13 -2
- package/node_modules/pptx-viewer-core/dist/{signature-inspection-status-BcJSdOvb.d.ts → signature-inspection-status-BCUpfCQh.d.ts} +13 -2
- package/node_modules/pptx-viewer-core/dist/signature-node/index.d.mts +2 -2
- package/node_modules/pptx-viewer-core/dist/signature-node/index.d.ts +2 -2
- package/node_modules/pptx-viewer-core/dist/signature-node/index.js +17 -3
- package/node_modules/pptx-viewer-core/dist/signature-node/index.mjs +16 -4
- package/node_modules/pptx-viewer-core/dist/{text-operations-rhJV-A_W.d.ts → text-operations-B9EwbptL.d.ts} +1 -1
- package/node_modules/pptx-viewer-core/dist/{text-operations-CLj-sJyk.d.mts → text-operations-C89Jn6S0.d.mts} +1 -1
- package/node_modules/pptx-viewer-core/package.json +1 -1
- package/package.json +6 -4
|
@@ -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
|
-
|
|
595
|
-
|
|
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 = [
|
|
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++) {
|
package/node_modules/pptx-viewer-core/dist/{SvgExporter-BQ4KbRO9.d.mts → SvgExporter-BTkk4oNQ.d.mts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as PptxData, P as PptxElement,
|
|
1
|
+
import { m as PptxData, P as PptxElement, N as TextSegment, l as PptxSlide } from './presentation-4fhI3din.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Platform adapter for file system operations.
|
package/node_modules/pptx-viewer-core/dist/{SvgExporter-0TxiiorD.d.ts → SvgExporter-CTDG-t_z.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as PptxData, P as PptxElement,
|
|
1
|
+
import { m as PptxData, P as PptxElement, N as TextSegment, l as PptxSlide } from './presentation-4fhI3din.js';
|
|
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-
|
|
3
|
-
import '../presentation-
|
|
2
|
+
import { F as FindResult, M as MergeOptions } from '../text-operations-C89Jn6S0.mjs';
|
|
3
|
+
import '../presentation-4fhI3din.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-
|
|
3
|
-
import '../presentation-
|
|
2
|
+
import { F as FindResult, M as MergeOptions } from '../text-operations-B9EwbptL.js';
|
|
3
|
+
import '../presentation-4fhI3din.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* CLI command handlers for pptx-cli.
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TextSegmentRenderer } from '../SvgExporter-
|
|
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-
|
|
3
|
-
import { l as PptxSlide } from '../presentation-
|
|
1
|
+
import { T as TextSegmentRenderer } from '../SvgExporter-BTkk4oNQ.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-BTkk4oNQ.mjs';
|
|
3
|
+
import { l as PptxSlide } from '../presentation-4fhI3din.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-
|
|
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-
|
|
3
|
-
import { l as PptxSlide } from '../presentation-
|
|
1
|
+
import { T as TextSegmentRenderer } from '../SvgExporter-CTDG-t_z.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-CTDG-t_z.js';
|
|
3
|
+
import { l as PptxSlide } from '../presentation-4fhI3din.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Renders slide-level metadata sections (transition, animations,
|
|
Binary file
|
|
Binary file
|