pptx-viewer-core 1.2.8 → 1.3.1
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/CHANGELOG.md +8 -0
- package/dist/{SvgExporter-CG73UVb9.d.ts → SvgExporter-C6DiFjN8.d.ts} +1 -1
- package/dist/{SvgExporter-BKbDaGaC.d.mts → SvgExporter-Hv9ofMZv.d.mts} +1 -1
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +0 -0
- package/dist/cli/index.mjs +0 -0
- package/dist/converter/index.d.mts +3 -3
- package/dist/converter/index.d.ts +3 -3
- package/dist/converter/index.js +0 -0
- package/dist/converter/index.mjs +0 -0
- package/dist/index.d.mts +45 -7
- package/dist/index.d.ts +45 -7
- package/dist/index.js +194 -32
- package/dist/index.mjs +193 -33
- package/dist/{presentation-CLc4eS3z.d.mts → presentation-BfnrtJV1.d.mts} +3242 -3242
- package/dist/{presentation-CLc4eS3z.d.ts → presentation-BfnrtJV1.d.ts} +3242 -3242
- package/dist/{text-operations-oN04X1yi.d.ts → text-operations-BjPf391u.d.ts} +1 -1
- package/dist/{text-operations-CCKEVX_5.d.mts → text-operations-DMQi9vpL.d.mts} +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -254,6 +254,178 @@ var THEME_PRESETS = [
|
|
|
254
254
|
METROPOLITAN_PRESET
|
|
255
255
|
];
|
|
256
256
|
|
|
257
|
+
// src/core/types/collaboration-field-schema.ts
|
|
258
|
+
var ELEMENT_FIELD_KIND = {
|
|
259
|
+
// PptxElementBase
|
|
260
|
+
id: "scalar",
|
|
261
|
+
shapeId: "scalar",
|
|
262
|
+
name: "scalar",
|
|
263
|
+
x: "scalar",
|
|
264
|
+
y: "scalar",
|
|
265
|
+
width: "scalar",
|
|
266
|
+
height: "scalar",
|
|
267
|
+
rotation: "scalar",
|
|
268
|
+
skewX: "scalar",
|
|
269
|
+
skewY: "scalar",
|
|
270
|
+
flipHorizontal: "scalar",
|
|
271
|
+
flipVertical: "scalar",
|
|
272
|
+
hidden: "scalar",
|
|
273
|
+
opacity: "scalar",
|
|
274
|
+
rawXml: "complex",
|
|
275
|
+
actionClick: "complex",
|
|
276
|
+
actionHover: "complex",
|
|
277
|
+
locks: "complex",
|
|
278
|
+
extLstXml: "complex",
|
|
279
|
+
// discriminant
|
|
280
|
+
type: "scalar",
|
|
281
|
+
// PptxTextProperties
|
|
282
|
+
text: "scalar",
|
|
283
|
+
textStyle: "complex",
|
|
284
|
+
textSegments: "text",
|
|
285
|
+
paragraphIndents: "complex",
|
|
286
|
+
promptText: "scalar",
|
|
287
|
+
linkedTxbxId: "scalar",
|
|
288
|
+
linkedTxbxSeq: "scalar",
|
|
289
|
+
// PptxShapeProperties
|
|
290
|
+
shapeStyle: "complex",
|
|
291
|
+
shapeType: "scalar",
|
|
292
|
+
shapeAdjustments: "complex",
|
|
293
|
+
adjustmentHandles: "complex",
|
|
294
|
+
// PptxCustomPathProperties
|
|
295
|
+
pathData: "scalar",
|
|
296
|
+
pathWidth: "scalar",
|
|
297
|
+
pathHeight: "scalar",
|
|
298
|
+
customGeometryPaths: "complex",
|
|
299
|
+
customGeometryRawData: "complex",
|
|
300
|
+
customGeometryAdjustHandlesXY: "complex",
|
|
301
|
+
customGeometryAdjustHandlesPolar: "complex",
|
|
302
|
+
customGeometryConnectionSites: "complex",
|
|
303
|
+
customGeometryTextRect: "complex",
|
|
304
|
+
// PptxImageProperties
|
|
305
|
+
imageData: "scalar",
|
|
306
|
+
imagePath: "scalar",
|
|
307
|
+
svgData: "scalar",
|
|
308
|
+
svgPath: "scalar",
|
|
309
|
+
altText: "scalar",
|
|
310
|
+
cropLeft: "scalar",
|
|
311
|
+
cropTop: "scalar",
|
|
312
|
+
cropRight: "scalar",
|
|
313
|
+
cropBottom: "scalar",
|
|
314
|
+
tileOffsetX: "scalar",
|
|
315
|
+
tileOffsetY: "scalar",
|
|
316
|
+
tileScaleX: "scalar",
|
|
317
|
+
tileScaleY: "scalar",
|
|
318
|
+
tileFlip: "scalar",
|
|
319
|
+
tileAlignment: "scalar",
|
|
320
|
+
imageEffects: "complex",
|
|
321
|
+
cropShape: "complex",
|
|
322
|
+
// TablePptxElement / ChartPptxElement / SmartArtPptxElement
|
|
323
|
+
tableData: "complex",
|
|
324
|
+
chartData: "complex",
|
|
325
|
+
smartArtData: "complex",
|
|
326
|
+
extensionXml: "complex",
|
|
327
|
+
// OlePptxElement
|
|
328
|
+
oleTarget: "scalar",
|
|
329
|
+
oleProgId: "scalar",
|
|
330
|
+
oleName: "scalar",
|
|
331
|
+
oleClsId: "scalar",
|
|
332
|
+
oleObjectType: "scalar",
|
|
333
|
+
oleFileExtension: "scalar",
|
|
334
|
+
fileName: "scalar",
|
|
335
|
+
isLinked: "scalar",
|
|
336
|
+
externalPath: "scalar",
|
|
337
|
+
previewImage: "scalar",
|
|
338
|
+
previewImageData: "asset",
|
|
339
|
+
oleShowAsIcon: "scalar",
|
|
340
|
+
oleImgW: "scalar",
|
|
341
|
+
oleImgH: "scalar",
|
|
342
|
+
oleEmbeddedData: "asset",
|
|
343
|
+
oleEmbeddedFileName: "scalar",
|
|
344
|
+
oleEmbeddedMimeType: "scalar",
|
|
345
|
+
oleEmbeddedByteSize: "scalar",
|
|
346
|
+
// MediaPptxElement
|
|
347
|
+
mediaType: "scalar",
|
|
348
|
+
mediaPath: "scalar",
|
|
349
|
+
mediaData: "asset",
|
|
350
|
+
mediaMimeType: "scalar",
|
|
351
|
+
trimStartMs: "scalar",
|
|
352
|
+
trimEndMs: "scalar",
|
|
353
|
+
posterFramePath: "scalar",
|
|
354
|
+
posterFrameData: "asset",
|
|
355
|
+
fullScreen: "scalar",
|
|
356
|
+
loop: "scalar",
|
|
357
|
+
fadeInDuration: "scalar",
|
|
358
|
+
fadeOutDuration: "scalar",
|
|
359
|
+
volume: "scalar",
|
|
360
|
+
autoPlay: "scalar",
|
|
361
|
+
playAcrossSlides: "scalar",
|
|
362
|
+
hideWhenNotPlaying: "scalar",
|
|
363
|
+
bookmarks: "complex",
|
|
364
|
+
playbackSpeed: "scalar",
|
|
365
|
+
metadata: "complex",
|
|
366
|
+
captionTracks: "complex",
|
|
367
|
+
mediaMissing: "scalar",
|
|
368
|
+
// GroupPptxElement
|
|
369
|
+
children: "complex",
|
|
370
|
+
groupFill: "complex",
|
|
371
|
+
// InkPptxElement
|
|
372
|
+
inkPaths: "scalar",
|
|
373
|
+
inkColors: "scalar",
|
|
374
|
+
inkWidths: "scalar",
|
|
375
|
+
inkOpacities: "scalar",
|
|
376
|
+
inkTool: "scalar",
|
|
377
|
+
inkPointPressures: "complex",
|
|
378
|
+
// ContentPartPptxElement
|
|
379
|
+
inkStrokes: "complex",
|
|
380
|
+
// ZoomPptxElement
|
|
381
|
+
zoomType: "scalar",
|
|
382
|
+
targetSlideIndex: "scalar",
|
|
383
|
+
targetSectionId: "scalar",
|
|
384
|
+
// Model3DPptxElement
|
|
385
|
+
modelPath: "scalar",
|
|
386
|
+
modelData: "asset",
|
|
387
|
+
modelMimeType: "scalar",
|
|
388
|
+
posterImage: "scalar"
|
|
389
|
+
};
|
|
390
|
+
var SLIDE_FIELD_KIND = {
|
|
391
|
+
id: "scalar",
|
|
392
|
+
rId: "scalar",
|
|
393
|
+
sourceSlideId: "scalar",
|
|
394
|
+
name: "scalar",
|
|
395
|
+
layoutPath: "scalar",
|
|
396
|
+
layoutName: "scalar",
|
|
397
|
+
slideNumber: "scalar",
|
|
398
|
+
hidden: "scalar",
|
|
399
|
+
sectionName: "scalar",
|
|
400
|
+
sectionId: "scalar",
|
|
401
|
+
elements: "nested",
|
|
402
|
+
backgroundColor: "scalar",
|
|
403
|
+
backgroundImage: "scalar",
|
|
404
|
+
backgroundGradient: "scalar",
|
|
405
|
+
backgroundPattern: "complex",
|
|
406
|
+
backgroundShadeToTitle: "scalar",
|
|
407
|
+
transition: "complex",
|
|
408
|
+
animations: "complex",
|
|
409
|
+
nativeAnimations: "complex",
|
|
410
|
+
rawTiming: "complex",
|
|
411
|
+
notes: "scalar",
|
|
412
|
+
notesSegments: "complex",
|
|
413
|
+
notesShapes: "complex",
|
|
414
|
+
notesClrMapOverride: "complex",
|
|
415
|
+
notesCSldName: "scalar",
|
|
416
|
+
comments: "complex",
|
|
417
|
+
warnings: "complex",
|
|
418
|
+
rawXml: "complex",
|
|
419
|
+
clrMapOverride: "complex",
|
|
420
|
+
backgroundShowAnimation: "scalar",
|
|
421
|
+
showMasterShapes: "scalar",
|
|
422
|
+
guides: "complex",
|
|
423
|
+
isDirty: "scalar",
|
|
424
|
+
customerData: "complex",
|
|
425
|
+
activeXControls: "complex",
|
|
426
|
+
headerFooterFlags: "complex"
|
|
427
|
+
};
|
|
428
|
+
|
|
257
429
|
// src/core/geometry/guide-formula-eval.ts
|
|
258
430
|
var ANGLE_SCALE = 6e4;
|
|
259
431
|
function angleToRadians(ooxmlAngle) {
|
|
@@ -12629,7 +12801,7 @@ function stripParentDirSegments(path) {
|
|
|
12629
12801
|
}
|
|
12630
12802
|
|
|
12631
12803
|
// src/core/utils/ole2-parser-types.ts
|
|
12632
|
-
var OLE_MAGIC = new Uint8Array([208, 207, 17, 224, 161,
|
|
12804
|
+
var OLE_MAGIC = new Uint8Array([208, 207, 17, 224, 161, 177, 26, 225]);
|
|
12633
12805
|
var ENDOFCHAIN = 4294967294;
|
|
12634
12806
|
var FREESECT = 4294967295;
|
|
12635
12807
|
var FATSECT = 4294967293;
|
|
@@ -19161,7 +19333,7 @@ function resolveLayoutCategory(layoutType) {
|
|
|
19161
19333
|
}
|
|
19162
19334
|
|
|
19163
19335
|
// src/core/utils/encryption-detection.ts
|
|
19164
|
-
var OLE_MAGIC2 = new Uint8Array([208, 207, 17, 224, 161,
|
|
19336
|
+
var OLE_MAGIC2 = new Uint8Array([208, 207, 17, 224, 161, 177, 26, 225]);
|
|
19165
19337
|
var ZIP_MAGIC = new Uint8Array([80, 75]);
|
|
19166
19338
|
function detectFileFormat(data) {
|
|
19167
19339
|
if (data.byteLength < 8) {
|
|
@@ -19855,15 +20027,9 @@ async function verifyAgilePassword(info, password) {
|
|
|
19855
20027
|
pke.keyBits,
|
|
19856
20028
|
pke.hashSize
|
|
19857
20029
|
);
|
|
19858
|
-
const iv1 = generateIV(
|
|
19859
|
-
pke.hashAlgorithm,
|
|
19860
|
-
pke.saltValue,
|
|
19861
|
-
BLOCK_KEYS.verifierHashInput,
|
|
19862
|
-
pke.blockSize
|
|
19863
|
-
);
|
|
19864
20030
|
const verifierHashInput = await aesCbcDecryptRaw(
|
|
19865
20031
|
verifierInputKey,
|
|
19866
|
-
|
|
20032
|
+
pke.saltValue,
|
|
19867
20033
|
pke.encryptedVerifierHashInput
|
|
19868
20034
|
);
|
|
19869
20035
|
const verifierHashKey = await deriveAgileKey(
|
|
@@ -19875,15 +20041,9 @@ async function verifyAgilePassword(info, password) {
|
|
|
19875
20041
|
pke.keyBits,
|
|
19876
20042
|
pke.hashSize
|
|
19877
20043
|
);
|
|
19878
|
-
const iv2 = generateIV(
|
|
19879
|
-
pke.hashAlgorithm,
|
|
19880
|
-
pke.saltValue,
|
|
19881
|
-
BLOCK_KEYS.verifierHashValue,
|
|
19882
|
-
pke.blockSize
|
|
19883
|
-
);
|
|
19884
20044
|
const verifierHashValue = await aesCbcDecryptRaw(
|
|
19885
20045
|
verifierHashKey,
|
|
19886
|
-
|
|
20046
|
+
pke.saltValue,
|
|
19887
20047
|
pke.encryptedVerifierHashValue
|
|
19888
20048
|
);
|
|
19889
20049
|
const computedHash = await hash(pke.hashAlgorithm, verifierHashInput.subarray(0, pke.saltSize));
|
|
@@ -19908,13 +20068,7 @@ async function verifyAgilePassword(info, password) {
|
|
|
19908
20068
|
pke.keyBits,
|
|
19909
20069
|
pke.hashSize
|
|
19910
20070
|
);
|
|
19911
|
-
const
|
|
19912
|
-
pke.hashAlgorithm,
|
|
19913
|
-
pke.saltValue,
|
|
19914
|
-
BLOCK_KEYS.encryptedKeyValue,
|
|
19915
|
-
pke.blockSize
|
|
19916
|
-
);
|
|
19917
|
-
const decryptedKey = await aesCbcDecryptRaw(encKeyKey, iv3, pke.encryptedKeyValue);
|
|
20071
|
+
const decryptedKey = await aesCbcDecryptRaw(encKeyKey, pke.saltValue, pke.encryptedKeyValue);
|
|
19918
20072
|
return decryptedKey.subarray(0, info.keyData.keyBits / 8);
|
|
19919
20073
|
}
|
|
19920
20074
|
async function verifyStandardPassword(info, password) {
|
|
@@ -19967,8 +20121,7 @@ async function verifyAgileDataIntegrity(info, key, encryptedPackage) {
|
|
|
19967
20121
|
info.dataIntegrity.encryptedHmacValue
|
|
19968
20122
|
);
|
|
19969
20123
|
const expectedHmac = decryptedHmacValue.subarray(0, keyData.hashSize);
|
|
19970
|
-
const
|
|
19971
|
-
const computedHmac = await hmac(keyData.hashAlgorithm, hmacKey, encryptedContent);
|
|
20124
|
+
const computedHmac = await hmac(keyData.hashAlgorithm, hmacKey, encryptedPackage);
|
|
19972
20125
|
let match = true;
|
|
19973
20126
|
if (computedHmac.length < keyData.hashSize) {
|
|
19974
20127
|
match = false;
|
|
@@ -20122,14 +20275,13 @@ async function encryptPptx(pptxBuffer, password, options) {
|
|
|
20122
20275
|
keyBits,
|
|
20123
20276
|
hashSize
|
|
20124
20277
|
);
|
|
20125
|
-
const iv1 = await generateIV(hashAlgorithm, pkeSalt, BLOCK_KEYS.verifierHashInput, blockSize);
|
|
20126
20278
|
const paddedVerifierInput = new Uint8Array(
|
|
20127
20279
|
Math.ceil(verifierHashInput.length / blockSize) * blockSize
|
|
20128
20280
|
);
|
|
20129
20281
|
paddedVerifierInput.set(verifierHashInput);
|
|
20130
20282
|
const encryptedVerifierHashInput = await aesCbcEncryptNoPad(
|
|
20131
20283
|
verifierInputKey,
|
|
20132
|
-
|
|
20284
|
+
pkeSalt,
|
|
20133
20285
|
paddedVerifierInput
|
|
20134
20286
|
);
|
|
20135
20287
|
const verifierHashKey = await deriveAgileKey(
|
|
@@ -20141,12 +20293,11 @@ async function encryptPptx(pptxBuffer, password, options) {
|
|
|
20141
20293
|
keyBits,
|
|
20142
20294
|
hashSize
|
|
20143
20295
|
);
|
|
20144
|
-
const iv2 = await generateIV(hashAlgorithm, pkeSalt, BLOCK_KEYS.verifierHashValue, blockSize);
|
|
20145
20296
|
const paddedVerifierHash = new Uint8Array(Math.ceil(verifierHash.length / blockSize) * blockSize);
|
|
20146
20297
|
paddedVerifierHash.set(verifierHash);
|
|
20147
20298
|
const encryptedVerifierHashValue = await aesCbcEncryptNoPad(
|
|
20148
20299
|
verifierHashKey,
|
|
20149
|
-
|
|
20300
|
+
pkeSalt,
|
|
20150
20301
|
paddedVerifierHash
|
|
20151
20302
|
);
|
|
20152
20303
|
const encKeyKey = await deriveAgileKey(
|
|
@@ -20158,10 +20309,9 @@ async function encryptPptx(pptxBuffer, password, options) {
|
|
|
20158
20309
|
keyBits,
|
|
20159
20310
|
hashSize
|
|
20160
20311
|
);
|
|
20161
|
-
const iv3 = await generateIV(hashAlgorithm, pkeSalt, BLOCK_KEYS.encryptedKeyValue, blockSize);
|
|
20162
20312
|
const paddedDocumentKey = new Uint8Array(Math.ceil(documentKey.length / blockSize) * blockSize);
|
|
20163
20313
|
paddedDocumentKey.set(documentKey);
|
|
20164
|
-
const encryptedKeyValue = await aesCbcEncryptNoPad(encKeyKey,
|
|
20314
|
+
const encryptedKeyValue = await aesCbcEncryptNoPad(encKeyKey, pkeSalt, paddedDocumentKey);
|
|
20165
20315
|
const encInfo = {
|
|
20166
20316
|
keyData: {
|
|
20167
20317
|
saltSize: 16,
|
|
@@ -20197,7 +20347,7 @@ async function encryptPptx(pptxBuffer, password, options) {
|
|
|
20197
20347
|
const encryptedPackage = await encryptAgilePackage(packageData, documentKey, encInfo);
|
|
20198
20348
|
const hmacKeyRandom = new Uint8Array(hashSize);
|
|
20199
20349
|
crypto2.getRandomValues(hmacKeyRandom);
|
|
20200
|
-
const hmacValue = await hmac(hashAlgorithm, hmacKeyRandom, encryptedPackage
|
|
20350
|
+
const hmacValue = await hmac(hashAlgorithm, hmacKeyRandom, encryptedPackage);
|
|
20201
20351
|
const hmacKeyIV = await generateIV(
|
|
20202
20352
|
hashAlgorithm,
|
|
20203
20353
|
keyDataSalt,
|
|
@@ -61621,6 +61771,8 @@ var MediaContext = class {
|
|
|
61621
61771
|
this.fs = fs;
|
|
61622
61772
|
this.resolvedMediaDir = `${outputDir}/${this.folderName}`;
|
|
61623
61773
|
}
|
|
61774
|
+
folderName;
|
|
61775
|
+
fs;
|
|
61624
61776
|
/** Running counter used to assign unique sequential filenames. */
|
|
61625
61777
|
imageIndex = 0;
|
|
61626
61778
|
/** Whether the media output directory has been created yet. */
|
|
@@ -61746,6 +61898,9 @@ var DocumentConverter = class {
|
|
|
61746
61898
|
this.fs = fs;
|
|
61747
61899
|
this.mediaContext = new MediaContext(outputDir, options.mediaFolderName, fs);
|
|
61748
61900
|
}
|
|
61901
|
+
outputDir;
|
|
61902
|
+
options;
|
|
61903
|
+
fs;
|
|
61749
61904
|
/** Shared context for extracting and saving media (images) during conversion. */
|
|
61750
61905
|
mediaContext;
|
|
61751
61906
|
/**
|
|
@@ -63110,6 +63265,7 @@ var TextElementProcessor = class {
|
|
|
63110
63265
|
constructor(textRenderer) {
|
|
63111
63266
|
this.textRenderer = textRenderer;
|
|
63112
63267
|
}
|
|
63268
|
+
textRenderer;
|
|
63113
63269
|
supportedTypes = ["text", "shape", "connector"];
|
|
63114
63270
|
async process(element, ctx) {
|
|
63115
63271
|
if (!hasTextProperties(element)) {
|
|
@@ -63306,6 +63462,7 @@ var SlideMetadataRenderer = class {
|
|
|
63306
63462
|
constructor(textRenderer) {
|
|
63307
63463
|
this.textRenderer = textRenderer;
|
|
63308
63464
|
}
|
|
63465
|
+
textRenderer;
|
|
63309
63466
|
/**
|
|
63310
63467
|
* Renders the slide transition effect as a short metadata line.
|
|
63311
63468
|
*/
|
|
@@ -63494,6 +63651,9 @@ var SlideProcessor = class {
|
|
|
63494
63651
|
this.textRenderer = textRenderer;
|
|
63495
63652
|
this.metadataRenderer = new SlideMetadataRenderer(textRenderer);
|
|
63496
63653
|
}
|
|
63654
|
+
registry;
|
|
63655
|
+
mediaContext;
|
|
63656
|
+
textRenderer;
|
|
63497
63657
|
/** Delegate for rendering slide-level metadata sections. */
|
|
63498
63658
|
metadataRenderer;
|
|
63499
63659
|
/** Processes a slide into a complete Markdown section. */
|
|
@@ -65470,6 +65630,7 @@ exports.DIGITAL_SIGNATURE_REL_TYPE = DIGITAL_SIGNATURE_REL_TYPE;
|
|
|
65470
65630
|
exports.DataIntegrityError = DataIntegrityError;
|
|
65471
65631
|
exports.DocumentConverter = DocumentConverter;
|
|
65472
65632
|
exports.EFFECT_LST_ORDER = EFFECT_LST_ORDER;
|
|
65633
|
+
exports.ELEMENT_FIELD_KIND = ELEMENT_FIELD_KIND;
|
|
65473
65634
|
exports.EMPHASIS_PRESETS = EMPHASIS_PRESETS;
|
|
65474
65635
|
exports.EMU_PER_INCH = EMU_PER_INCH;
|
|
65475
65636
|
exports.EMU_PER_PIXEL = EMU_PER_PIXEL2;
|
|
@@ -65564,6 +65725,7 @@ exports.PptxXmlLookupService = PptxXmlLookupService;
|
|
|
65564
65725
|
exports.Presentation = Presentation;
|
|
65565
65726
|
exports.PresentationBuilder = PresentationBuilder;
|
|
65566
65727
|
exports.SHAPE_TREE_ELEMENT_TAGS = SHAPE_TREE_ELEMENT_TAGS;
|
|
65728
|
+
exports.SLIDE_FIELD_KIND = SLIDE_FIELD_KIND;
|
|
65567
65729
|
exports.SP_PR_ORDER = SP_PR_ORDER;
|
|
65568
65730
|
exports.STROKE_DASH_OPTIONS = STROKE_DASH_OPTIONS;
|
|
65569
65731
|
exports.SUPPORTED_XML_CANON_TRANSFORMS = SUPPORTED_XML_CANON_TRANSFORMS;
|