pptx-viewer-core 1.1.48 → 1.2.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 CHANGED
@@ -4,6 +4,14 @@ 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.2.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.2.0) - 2026-07-05
8
+
9
+ ### Features
10
+
11
+ - **core,cli:** Add react, angular, vue to npm keywords (by @ChristopherVR) ([528ec61](https://github.com/ChristopherVR/pptx-viewer/commit/528ec6182bb77c07444dd0e93560b65e604b9524))
12
+
13
+ ## [1.1.48](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.1.48) - 2026-07-04
14
+
7
15
  ## [1.1.43](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.1.43) - 2026-07-02
8
16
 
9
17
  ### Bug Fixes
@@ -6,19 +6,54 @@ import JSZip from 'jszip';
6
6
  * XML canonicalization and DOM navigation utilities for digital signatures.
7
7
  *
8
8
  * Node-only — depends on `@xmldom/xmldom` and `xml-crypto`.
9
- */
9
+ *
10
+ * All public functions use minimal structural (duck-typed) interfaces instead
11
+ * of the standard lib.dom.d.ts types. @xmldom/xmldom's Document/Element/Node
12
+ * types do not extend the standard DOM interfaces in TypeScript 6 (the old DOM
13
+ * lib baked into @xmldom/xmldom's .d.ts predates properties like
14
+ * activeViewTransition), so using the standard types causes TS2345 errors in
15
+ * the DTS build. These structural interfaces are satisfied by both xmldom and
16
+ * standard DOM objects at runtime.
17
+ */
18
+ /** A DOM element-like collection returned by getElementsByTagName. */
19
+ interface XmlElementCollection {
20
+ readonly length: number;
21
+ item(index: number): XmlElement | null;
22
+ [index: number]: XmlElement;
23
+ [Symbol.iterator](): Iterator<XmlElement>;
24
+ }
25
+ /** Structural interface covering the @xmldom/xmldom Element operations used here. */
26
+ interface XmlElement {
27
+ readonly nodeName: string;
28
+ readonly localName?: string | null;
29
+ readonly textContent: string | null;
30
+ readonly parentNode: {
31
+ removeChild(child: XmlElement): XmlElement;
32
+ } | null;
33
+ getAttribute(name: string): string | null;
34
+ getElementsByTagName(localName: string): XmlElementCollection;
35
+ getElementsByTagNameNS(namespaceURI: string | null, localName: string): XmlElementCollection;
36
+ }
37
+ /** Structural interface covering @xmldom/xmldom Document operations used here. */
38
+ interface XmlDocument {
39
+ readonly documentElement: XmlElement | null;
40
+ getElementsByTagName(localName: string): XmlElementCollection;
41
+ getElementsByTagNameNS(namespaceURI: string | null, localName: string): XmlElementCollection;
42
+ }
10
43
  /** Get the local name of a DOM node, stripping any namespace prefix. */
11
- declare function getNodeLocalName(node: Node): string;
44
+ declare function getNodeLocalName(node: XmlElement): string;
12
45
  /**
13
46
  * Find the first descendant element matching a local name,
14
47
  * ignoring namespace prefixes.
15
48
  */
16
- declare function getFirstDescendantElementByLocalName(parent: Document | Element, localName: string): Element | undefined;
49
+ declare function getFirstDescendantElementByLocalName(parent: XmlDocument | XmlElement, localName: string): XmlElement | undefined;
17
50
  /**
18
51
  * Canonicalize a DOM node using the specified canonicalization algorithm.
19
52
  * Delegates to xml-crypto's C14N implementation.
53
+ * Accepts `any` because @xmldom/xmldom nodes are not assignable to
54
+ * lib.dom.d.ts Node in TypeScript 6.
20
55
  */
21
- declare function canonicalizeNode(node: Node, algorithm: string): string;
56
+ declare function canonicalizeNode(node: any, algorithm: string): string;
22
57
  /**
23
58
  * Canonicalize a `<SignedInfo>` XML fragment for signature verification.
24
59
  * Uses Exclusive XML Canonicalization (exc-c14n#).
@@ -108,7 +143,7 @@ declare function getSignatureValidationPolicy(): SignatureValidationPolicy;
108
143
  /**
109
144
  * Parse `<ds:Transform>` elements from a `<ds:Reference>` node.
110
145
  */
111
- declare function extractReferenceTransforms(referenceNode: Element): ParsedReferenceTransform[];
146
+ declare function extractReferenceTransforms(referenceNode: XmlElement): ParsedReferenceTransform[];
112
147
  /**
113
148
  * Apply a chain of transforms to binary part data.
114
149
  * Supports OPC Relationship Transform and XML canonicalization algorithms.
@@ -6,19 +6,54 @@ import JSZip from 'jszip';
6
6
  * XML canonicalization and DOM navigation utilities for digital signatures.
7
7
  *
8
8
  * Node-only — depends on `@xmldom/xmldom` and `xml-crypto`.
9
- */
9
+ *
10
+ * All public functions use minimal structural (duck-typed) interfaces instead
11
+ * of the standard lib.dom.d.ts types. @xmldom/xmldom's Document/Element/Node
12
+ * types do not extend the standard DOM interfaces in TypeScript 6 (the old DOM
13
+ * lib baked into @xmldom/xmldom's .d.ts predates properties like
14
+ * activeViewTransition), so using the standard types causes TS2345 errors in
15
+ * the DTS build. These structural interfaces are satisfied by both xmldom and
16
+ * standard DOM objects at runtime.
17
+ */
18
+ /** A DOM element-like collection returned by getElementsByTagName. */
19
+ interface XmlElementCollection {
20
+ readonly length: number;
21
+ item(index: number): XmlElement | null;
22
+ [index: number]: XmlElement;
23
+ [Symbol.iterator](): Iterator<XmlElement>;
24
+ }
25
+ /** Structural interface covering the @xmldom/xmldom Element operations used here. */
26
+ interface XmlElement {
27
+ readonly nodeName: string;
28
+ readonly localName?: string | null;
29
+ readonly textContent: string | null;
30
+ readonly parentNode: {
31
+ removeChild(child: XmlElement): XmlElement;
32
+ } | null;
33
+ getAttribute(name: string): string | null;
34
+ getElementsByTagName(localName: string): XmlElementCollection;
35
+ getElementsByTagNameNS(namespaceURI: string | null, localName: string): XmlElementCollection;
36
+ }
37
+ /** Structural interface covering @xmldom/xmldom Document operations used here. */
38
+ interface XmlDocument {
39
+ readonly documentElement: XmlElement | null;
40
+ getElementsByTagName(localName: string): XmlElementCollection;
41
+ getElementsByTagNameNS(namespaceURI: string | null, localName: string): XmlElementCollection;
42
+ }
10
43
  /** Get the local name of a DOM node, stripping any namespace prefix. */
11
- declare function getNodeLocalName(node: Node): string;
44
+ declare function getNodeLocalName(node: XmlElement): string;
12
45
  /**
13
46
  * Find the first descendant element matching a local name,
14
47
  * ignoring namespace prefixes.
15
48
  */
16
- declare function getFirstDescendantElementByLocalName(parent: Document | Element, localName: string): Element | undefined;
49
+ declare function getFirstDescendantElementByLocalName(parent: XmlDocument | XmlElement, localName: string): XmlElement | undefined;
17
50
  /**
18
51
  * Canonicalize a DOM node using the specified canonicalization algorithm.
19
52
  * Delegates to xml-crypto's C14N implementation.
53
+ * Accepts `any` because @xmldom/xmldom nodes are not assignable to
54
+ * lib.dom.d.ts Node in TypeScript 6.
20
55
  */
21
- declare function canonicalizeNode(node: Node, algorithm: string): string;
56
+ declare function canonicalizeNode(node: any, algorithm: string): string;
22
57
  /**
23
58
  * Canonicalize a `<SignedInfo>` XML fragment for signature verification.
24
59
  * Uses Exclusive XML Canonicalization (exc-c14n#).
@@ -108,7 +143,7 @@ declare function getSignatureValidationPolicy(): SignatureValidationPolicy;
108
143
  /**
109
144
  * Parse `<ds:Transform>` elements from a `<ds:Reference>` node.
110
145
  */
111
- declare function extractReferenceTransforms(referenceNode: Element): ParsedReferenceTransform[];
146
+ declare function extractReferenceTransforms(referenceNode: XmlElement): ParsedReferenceTransform[];
112
147
  /**
113
148
  * Apply a chain of transforms to binary part data.
114
149
  * Supports OPC Relationship Transform and XML canonicalization algorithms.
@@ -187,9 +187,8 @@ function computeVerificationStatus(details) {
187
187
  return hasInvalidSignature ? "signature-invalid" : hasRevoked ? "certificate-revoked" : hasTimestampInvalid ? "timestamp-invalid" : hasTimestampUntrusted ? "timestamp-untrusted" : hasMissing ? "reference-missing" : hasMismatch ? "digest-mismatch" : allVerified ? "verified-trusted" : hasUntrusted ? "verified-untrusted" : "present-not-verified";
188
188
  }
189
189
  function getNodeLocalName(node) {
190
- const localNameNode = node;
191
- if (localNameNode.localName) {
192
- return localNameNode.localName;
190
+ if (node.localName) {
191
+ return node.localName;
193
192
  }
194
193
  const nodeName = node.nodeName || "";
195
194
  const sep = nodeName.indexOf(":");
@@ -174,9 +174,8 @@ function computeVerificationStatus(details) {
174
174
  return hasInvalidSignature ? "signature-invalid" : hasRevoked ? "certificate-revoked" : hasTimestampInvalid ? "timestamp-invalid" : hasTimestampUntrusted ? "timestamp-untrusted" : hasMissing ? "reference-missing" : hasMismatch ? "digest-mismatch" : allVerified ? "verified-trusted" : hasUntrusted ? "verified-untrusted" : "present-not-verified";
175
175
  }
176
176
  function getNodeLocalName(node) {
177
- const localNameNode = node;
178
- if (localNameNode.localName) {
179
- return localNameNode.localName;
177
+ if (node.localName) {
178
+ return node.localName;
180
179
  }
181
180
  const nodeName = node.nodeName || "";
182
181
  const sep = nodeName.indexOf(":");
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "pptx-viewer-core",
3
- "version": "1.1.48",
3
+ "version": "1.2.1",
4
4
  "description": "PowerPoint PPTX engine: parse, edit, serialize, and convert .pptx files. Framework-agnostic TypeScript SDK.",
5
5
  "keywords": [
6
+ "angular",
6
7
  "converter",
7
8
  "markdown",
8
9
  "office",
@@ -13,10 +14,12 @@
13
14
  "ppt",
14
15
  "pptx",
15
16
  "presentation",
17
+ "react",
16
18
  "sdk",
17
19
  "serializer",
18
20
  "slides",
19
- "typescript"
21
+ "typescript",
22
+ "vue"
20
23
  ],
21
24
  "homepage": "https://github.com/ChristopherVR/pptx-viewer",
22
25
  "bugs": {
@@ -80,7 +83,7 @@
80
83
  },
81
84
  "devDependencies": {
82
85
  "@types/node-forge": "^1.3.14",
83
- "@xmldom/xmldom": "^0.8.13",
86
+ "@xmldom/xmldom": "^0.9.10",
84
87
  "node-forge": "^1.4.0",
85
88
  "tsup": "^8.5.1",
86
89
  "typescript": "^6.0.3",