pptx-viewer-core 1.1.43 → 1.1.45
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 +6 -0
- package/README.md +1 -5
- package/dist/cli/index.js +0 -0
- package/dist/cli/index.mjs +0 -0
- package/dist/index.js +18 -8
- package/dist/index.mjs +18 -8
- package/dist/signature-node/index.js +6 -0
- package/dist/signature-node/index.mjs +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to this project are documented here.
|
|
|
4
4
|
This file is generated from [Conventional Commits](https://www.conventionalcommits.org)
|
|
5
5
|
by [git-cliff](https://git-cliff.org); do not edit it by hand.
|
|
6
6
|
|
|
7
|
+
## [1.1.43](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.1.43) - 2026-07-02
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **core,angular:** Revert xmldom to 0.8.x and fix shared import specifiers (by @ChristopherVR) ([29eda31](https://github.com/ChristopherVR/pptx-viewer/commit/29eda3119836559b63bc08733dd9dd6398a69c8d))
|
|
12
|
+
|
|
7
13
|
## [1.1.42](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.1.42) - 2026-06-27
|
|
8
14
|
|
|
9
15
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
[](https://github.com/ChristopherVR/pptx-viewer/blob/main/LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/pptx-viewer-core)
|
|
6
6
|
|
|
7
|
-
> **Also published as [`@christophervr/pptx-viewer`](https://www.npmjs.com/package/@christophervr/pptx-viewer)** -- the two package names are identical releases of the same code. Use whichever name you prefer; they are always published together and kept in sync.
|
|
8
|
-
|
|
9
7
|
> A TypeScript library that **reads, creates, edits, and saves** PowerPoint (`.pptx`) files. It runs in the browser and in Node.js, with no native or system dependencies.
|
|
10
8
|
|
|
11
9
|
Hand it the bytes of a `.pptx` file and it gives you back a structured, fully typed object that describes every slide: text, shapes, images, charts, tables, and more. Change anything in that object and write it back to a valid `.pptx`. You can also build new presentations from scratch with a simple chainable API, or turn a deck into Markdown.
|
|
@@ -20,11 +18,9 @@ There is no UI here: this is the engine on its own. Use it directly when you nee
|
|
|
20
18
|
|
|
21
19
|
```bash
|
|
22
20
|
npm install pptx-viewer-core
|
|
23
|
-
# required companions:
|
|
24
|
-
npm install jszip fast-xml-parser
|
|
25
21
|
```
|
|
26
22
|
|
|
27
|
-
>
|
|
23
|
+
> That's it, nothing else to install. **jszip** (a `.pptx` is a ZIP file, and this reads and writes that container) and **fast-xml-parser** (the slides inside are XML, and this reads and writes it) are regular dependencies of `pptx-viewer-core`, so your package manager pulls them in automatically. Password protection and digital signatures need a few extra packages (`node-forge`, `xml-crypto`, `@xmldom/xmldom`), but only if you actually use those features.
|
|
28
24
|
|
|
29
25
|
## What it does
|
|
30
26
|
|
package/dist/cli/index.js
CHANGED
|
Binary file
|
package/dist/cli/index.mjs
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -41796,6 +41796,7 @@ var PptxHandlerRuntime60 = class extends PptxHandlerRuntime59 {
|
|
|
41796
41796
|
if (this.masterCache.has(masterPath)) {
|
|
41797
41797
|
return this.masterCache.get(masterPath);
|
|
41798
41798
|
}
|
|
41799
|
+
const masterToken = masterPath.split("/").pop()?.replace(/\.xml$/u, "") ?? masterPath;
|
|
41799
41800
|
try {
|
|
41800
41801
|
const masterXmlStr = await this.zip.file(masterPath)?.async("string");
|
|
41801
41802
|
if (!masterXmlStr) {
|
|
@@ -41853,11 +41854,15 @@ var PptxHandlerRuntime60 = class extends PptxHandlerRuntime59 {
|
|
|
41853
41854
|
if (spPr?.["a:blipFill"]) {
|
|
41854
41855
|
element = await this.parseShapeWithImageFill(
|
|
41855
41856
|
shape,
|
|
41856
|
-
`master-shape-img-${entry.indexInType}`,
|
|
41857
|
+
`master-shape-img-${masterToken}-${entry.indexInType}`,
|
|
41857
41858
|
masterPath
|
|
41858
41859
|
);
|
|
41859
41860
|
} else {
|
|
41860
|
-
element = this.parseShape(
|
|
41861
|
+
element = this.parseShape(
|
|
41862
|
+
shape,
|
|
41863
|
+
`master-shape-${masterToken}-${entry.indexInType}`,
|
|
41864
|
+
masterPath
|
|
41865
|
+
);
|
|
41861
41866
|
}
|
|
41862
41867
|
if (element) {
|
|
41863
41868
|
element.id = `master-${element.id}`;
|
|
@@ -41871,7 +41876,7 @@ var PptxHandlerRuntime60 = class extends PptxHandlerRuntime59 {
|
|
|
41871
41876
|
}
|
|
41872
41877
|
const element = await this.parsePicture(
|
|
41873
41878
|
pic,
|
|
41874
|
-
`master-pic-${entry.indexInType}`,
|
|
41879
|
+
`master-pic-${masterToken}-${entry.indexInType}`,
|
|
41875
41880
|
masterPath
|
|
41876
41881
|
);
|
|
41877
41882
|
if (element) {
|
|
@@ -41886,7 +41891,7 @@ var PptxHandlerRuntime60 = class extends PptxHandlerRuntime59 {
|
|
|
41886
41891
|
}
|
|
41887
41892
|
const element = this.parseGraphicFrame(
|
|
41888
41893
|
frame2,
|
|
41889
|
-
`master-frame-${entry.indexInType}`,
|
|
41894
|
+
`master-frame-${masterToken}-${entry.indexInType}`,
|
|
41890
41895
|
masterPath
|
|
41891
41896
|
);
|
|
41892
41897
|
if (element) {
|
|
@@ -41925,6 +41930,7 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
|
|
|
41925
41930
|
if (this.layoutCache.has(layoutPath)) {
|
|
41926
41931
|
return this.layoutCache.get(layoutPath);
|
|
41927
41932
|
}
|
|
41933
|
+
const layoutToken = layoutPath.split("/").pop()?.replace(/\.xml$/u, "") ?? layoutPath;
|
|
41928
41934
|
try {
|
|
41929
41935
|
const layoutXmlStr = await this.zip.file(layoutPath)?.async("string");
|
|
41930
41936
|
if (!layoutXmlStr) {
|
|
@@ -41986,11 +41992,15 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
|
|
|
41986
41992
|
if (spPr && xmlChild(spPr, "a:blipFill")) {
|
|
41987
41993
|
element = await this.parseShapeWithImageFill(
|
|
41988
41994
|
shape,
|
|
41989
|
-
`layout-shape-img-${entry.indexInType}`,
|
|
41995
|
+
`layout-shape-img-${layoutToken}-${entry.indexInType}`,
|
|
41990
41996
|
layoutPath
|
|
41991
41997
|
);
|
|
41992
41998
|
} else {
|
|
41993
|
-
element = this.parseShape(
|
|
41999
|
+
element = this.parseShape(
|
|
42000
|
+
shape,
|
|
42001
|
+
`layout-shape-${layoutToken}-${entry.indexInType}`,
|
|
42002
|
+
layoutPath
|
|
42003
|
+
);
|
|
41994
42004
|
}
|
|
41995
42005
|
if (element) {
|
|
41996
42006
|
element.id = `layout-${element.id}`;
|
|
@@ -42004,7 +42014,7 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
|
|
|
42004
42014
|
}
|
|
42005
42015
|
const element = await this.parsePicture(
|
|
42006
42016
|
pic,
|
|
42007
|
-
`layout-pic-${entry.indexInType}`,
|
|
42017
|
+
`layout-pic-${layoutToken}-${entry.indexInType}`,
|
|
42008
42018
|
layoutPath
|
|
42009
42019
|
);
|
|
42010
42020
|
if (element) {
|
|
@@ -42019,7 +42029,7 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
|
|
|
42019
42029
|
}
|
|
42020
42030
|
const element = this.parseGraphicFrame(
|
|
42021
42031
|
frame2,
|
|
42022
|
-
`layout-frame-${entry.indexInType}`,
|
|
42032
|
+
`layout-frame-${layoutToken}-${entry.indexInType}`,
|
|
42023
42033
|
layoutPath
|
|
42024
42034
|
);
|
|
42025
42035
|
if (element) {
|
package/dist/index.mjs
CHANGED
|
@@ -41791,6 +41791,7 @@ var PptxHandlerRuntime60 = class extends PptxHandlerRuntime59 {
|
|
|
41791
41791
|
if (this.masterCache.has(masterPath)) {
|
|
41792
41792
|
return this.masterCache.get(masterPath);
|
|
41793
41793
|
}
|
|
41794
|
+
const masterToken = masterPath.split("/").pop()?.replace(/\.xml$/u, "") ?? masterPath;
|
|
41794
41795
|
try {
|
|
41795
41796
|
const masterXmlStr = await this.zip.file(masterPath)?.async("string");
|
|
41796
41797
|
if (!masterXmlStr) {
|
|
@@ -41848,11 +41849,15 @@ var PptxHandlerRuntime60 = class extends PptxHandlerRuntime59 {
|
|
|
41848
41849
|
if (spPr?.["a:blipFill"]) {
|
|
41849
41850
|
element = await this.parseShapeWithImageFill(
|
|
41850
41851
|
shape,
|
|
41851
|
-
`master-shape-img-${entry.indexInType}`,
|
|
41852
|
+
`master-shape-img-${masterToken}-${entry.indexInType}`,
|
|
41852
41853
|
masterPath
|
|
41853
41854
|
);
|
|
41854
41855
|
} else {
|
|
41855
|
-
element = this.parseShape(
|
|
41856
|
+
element = this.parseShape(
|
|
41857
|
+
shape,
|
|
41858
|
+
`master-shape-${masterToken}-${entry.indexInType}`,
|
|
41859
|
+
masterPath
|
|
41860
|
+
);
|
|
41856
41861
|
}
|
|
41857
41862
|
if (element) {
|
|
41858
41863
|
element.id = `master-${element.id}`;
|
|
@@ -41866,7 +41871,7 @@ var PptxHandlerRuntime60 = class extends PptxHandlerRuntime59 {
|
|
|
41866
41871
|
}
|
|
41867
41872
|
const element = await this.parsePicture(
|
|
41868
41873
|
pic,
|
|
41869
|
-
`master-pic-${entry.indexInType}`,
|
|
41874
|
+
`master-pic-${masterToken}-${entry.indexInType}`,
|
|
41870
41875
|
masterPath
|
|
41871
41876
|
);
|
|
41872
41877
|
if (element) {
|
|
@@ -41881,7 +41886,7 @@ var PptxHandlerRuntime60 = class extends PptxHandlerRuntime59 {
|
|
|
41881
41886
|
}
|
|
41882
41887
|
const element = this.parseGraphicFrame(
|
|
41883
41888
|
frame2,
|
|
41884
|
-
`master-frame-${entry.indexInType}`,
|
|
41889
|
+
`master-frame-${masterToken}-${entry.indexInType}`,
|
|
41885
41890
|
masterPath
|
|
41886
41891
|
);
|
|
41887
41892
|
if (element) {
|
|
@@ -41920,6 +41925,7 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
|
|
|
41920
41925
|
if (this.layoutCache.has(layoutPath)) {
|
|
41921
41926
|
return this.layoutCache.get(layoutPath);
|
|
41922
41927
|
}
|
|
41928
|
+
const layoutToken = layoutPath.split("/").pop()?.replace(/\.xml$/u, "") ?? layoutPath;
|
|
41923
41929
|
try {
|
|
41924
41930
|
const layoutXmlStr = await this.zip.file(layoutPath)?.async("string");
|
|
41925
41931
|
if (!layoutXmlStr) {
|
|
@@ -41981,11 +41987,15 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
|
|
|
41981
41987
|
if (spPr && xmlChild(spPr, "a:blipFill")) {
|
|
41982
41988
|
element = await this.parseShapeWithImageFill(
|
|
41983
41989
|
shape,
|
|
41984
|
-
`layout-shape-img-${entry.indexInType}`,
|
|
41990
|
+
`layout-shape-img-${layoutToken}-${entry.indexInType}`,
|
|
41985
41991
|
layoutPath
|
|
41986
41992
|
);
|
|
41987
41993
|
} else {
|
|
41988
|
-
element = this.parseShape(
|
|
41994
|
+
element = this.parseShape(
|
|
41995
|
+
shape,
|
|
41996
|
+
`layout-shape-${layoutToken}-${entry.indexInType}`,
|
|
41997
|
+
layoutPath
|
|
41998
|
+
);
|
|
41989
41999
|
}
|
|
41990
42000
|
if (element) {
|
|
41991
42001
|
element.id = `layout-${element.id}`;
|
|
@@ -41999,7 +42009,7 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
|
|
|
41999
42009
|
}
|
|
42000
42010
|
const element = await this.parsePicture(
|
|
42001
42011
|
pic,
|
|
42002
|
-
`layout-pic-${entry.indexInType}`,
|
|
42012
|
+
`layout-pic-${layoutToken}-${entry.indexInType}`,
|
|
42003
42013
|
layoutPath
|
|
42004
42014
|
);
|
|
42005
42015
|
if (element) {
|
|
@@ -42014,7 +42024,7 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
|
|
|
42014
42024
|
}
|
|
42015
42025
|
const element = this.parseGraphicFrame(
|
|
42016
42026
|
frame2,
|
|
42017
|
-
`layout-frame-${entry.indexInType}`,
|
|
42027
|
+
`layout-frame-${layoutToken}-${entry.indexInType}`,
|
|
42018
42028
|
layoutPath
|
|
42019
42029
|
);
|
|
42020
42030
|
if (element) {
|
|
@@ -1018,6 +1018,9 @@ async function upsertRootOriginRelationship(zip) {
|
|
|
1018
1018
|
const xml = await zip.file(relsPath)?.async("string") || '<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>';
|
|
1019
1019
|
const doc = parser.parseFromString(xml, "text/xml");
|
|
1020
1020
|
const relationships = doc.documentElement;
|
|
1021
|
+
if (!relationships) {
|
|
1022
|
+
throw new Error("Unable to sign package: invalid _rels/.rels XML.");
|
|
1023
|
+
}
|
|
1021
1024
|
const existing = Array.from(relationships.getElementsByTagName("Relationship")).find(
|
|
1022
1025
|
(node) => node.getAttribute("Type") === DIGITAL_SIGNATURE_ORIGIN_REL_TYPE
|
|
1023
1026
|
);
|
|
@@ -1040,6 +1043,9 @@ async function upsertContentTypesForSignature(zip, signaturePath) {
|
|
|
1040
1043
|
}
|
|
1041
1044
|
const doc = parser.parseFromString(xml, "text/xml");
|
|
1042
1045
|
const types = doc.documentElement;
|
|
1046
|
+
if (!types) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1043
1049
|
const ensureOverride = (partName, contentType) => {
|
|
1044
1050
|
const existing = Array.from(types.getElementsByTagName("Override")).find(
|
|
1045
1051
|
(node) => node.getAttribute("PartName") === partName
|
|
@@ -1005,6 +1005,9 @@ async function upsertRootOriginRelationship(zip) {
|
|
|
1005
1005
|
const xml = await zip.file(relsPath)?.async("string") || '<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>';
|
|
1006
1006
|
const doc = parser.parseFromString(xml, "text/xml");
|
|
1007
1007
|
const relationships = doc.documentElement;
|
|
1008
|
+
if (!relationships) {
|
|
1009
|
+
throw new Error("Unable to sign package: invalid _rels/.rels XML.");
|
|
1010
|
+
}
|
|
1008
1011
|
const existing = Array.from(relationships.getElementsByTagName("Relationship")).find(
|
|
1009
1012
|
(node) => node.getAttribute("Type") === DIGITAL_SIGNATURE_ORIGIN_REL_TYPE
|
|
1010
1013
|
);
|
|
@@ -1027,6 +1030,9 @@ async function upsertContentTypesForSignature(zip, signaturePath) {
|
|
|
1027
1030
|
}
|
|
1028
1031
|
const doc = parser.parseFromString(xml, "text/xml");
|
|
1029
1032
|
const types = doc.documentElement;
|
|
1033
|
+
if (!types) {
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1030
1036
|
const ensureOverride = (partName, contentType) => {
|
|
1031
1037
|
const existing = Array.from(types.getElementsByTagName("Override")).find(
|
|
1032
1038
|
(node) => node.getAttribute("PartName") === partName
|