pptx-viewer-core 1.2.0 → 1.2.2

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.1](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.2.1) - 2026-07-06
8
+
9
+ ## [1.2.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.2.0) - 2026-07-05
10
+
11
+ ### Features
12
+
13
+ - **core,cli:** Add react, angular, vue to npm keywords (by @ChristopherVR) ([528ec61](https://github.com/ChristopherVR/pptx-viewer/commit/528ec6182bb77c07444dd0e93560b65e604b9524))
14
+
7
15
  ## [1.1.48](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.1.48) - 2026-07-04
8
16
 
9
17
  ## [1.1.43](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.1.43) - 2026-07-02
package/dist/cli/index.js CHANGED
Binary file
Binary file
package/dist/index.js CHANGED
@@ -41506,7 +41506,7 @@ var PptxHandlerRuntime57 = class extends PptxHandlerRuntime56 {
41506
41506
  for (const [, target] of layoutRels.entries()) {
41507
41507
  if (target.includes("slideMaster")) {
41508
41508
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
41509
- const masterPath = target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41509
+ const masterPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41510
41510
  try {
41511
41511
  const masterXmlStr = await this.zip.file(masterPath)?.async("string");
41512
41512
  if (masterXmlStr) {
@@ -41530,7 +41530,7 @@ var PptxHandlerRuntime57 = class extends PptxHandlerRuntime56 {
41530
41530
  for (const [, target] of slideRels.entries()) {
41531
41531
  if (target.includes("slideLayout")) {
41532
41532
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
41533
- const layoutPath = target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41533
+ const layoutPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41534
41534
  try {
41535
41535
  const layoutXmlStr = await this.zip.file(layoutPath)?.async("string");
41536
41536
  if (layoutXmlStr) {
@@ -41558,7 +41558,7 @@ var PptxHandlerRuntime57 = class extends PptxHandlerRuntime56 {
41558
41558
  for (const [, target] of slideRels.entries()) {
41559
41559
  if (target.includes("slideLayout")) {
41560
41560
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
41561
- const layoutPath = target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41561
+ const layoutPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41562
41562
  try {
41563
41563
  const layoutXmlStr = await this.zip.file(layoutPath)?.async("string");
41564
41564
  if (layoutXmlStr) {
@@ -41587,7 +41587,7 @@ var PptxHandlerRuntime57 = class extends PptxHandlerRuntime56 {
41587
41587
  for (const [, target] of layoutRels.entries()) {
41588
41588
  if (target.includes("slideMaster")) {
41589
41589
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
41590
- const masterPath = target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41590
+ const masterPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41591
41591
  try {
41592
41592
  const masterXmlStr = await this.zip.file(masterPath)?.async("string");
41593
41593
  if (masterXmlStr) {
@@ -41616,7 +41616,7 @@ var PptxHandlerRuntime58 = class extends PptxHandlerRuntime57 {
41616
41616
  for (const [, target] of slideRels.entries()) {
41617
41617
  if (target.includes("slideLayout")) {
41618
41618
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
41619
- const layoutPath = target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41619
+ const layoutPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41620
41620
  try {
41621
41621
  const layoutXmlStr = await this.zip.file(layoutPath)?.async("string");
41622
41622
  if (layoutXmlStr) {
@@ -41645,7 +41645,7 @@ var PptxHandlerRuntime58 = class extends PptxHandlerRuntime57 {
41645
41645
  for (const [, target] of layoutRels.entries()) {
41646
41646
  if (target.includes("slideMaster")) {
41647
41647
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
41648
- const masterPath = target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41648
+ const masterPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41649
41649
  try {
41650
41650
  const masterXmlStr = await this.zip.file(masterPath)?.async("string");
41651
41651
  if (masterXmlStr) {
@@ -41670,7 +41670,7 @@ var PptxHandlerRuntime58 = class extends PptxHandlerRuntime57 {
41670
41670
  for (const [, target] of slideRels.entries()) {
41671
41671
  if (target.includes("slideLayout")) {
41672
41672
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
41673
- return target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41673
+ return target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41674
41674
  }
41675
41675
  }
41676
41676
  return void 0;
@@ -41686,7 +41686,7 @@ var PptxHandlerRuntime58 = class extends PptxHandlerRuntime57 {
41686
41686
  for (const [, target] of layoutRels.entries()) {
41687
41687
  if (target.includes("slideMaster")) {
41688
41688
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
41689
- return target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41689
+ return target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41690
41690
  }
41691
41691
  }
41692
41692
  return void 0;
@@ -42330,7 +42330,7 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
42330
42330
  for (const [, target] of layoutRels.entries()) {
42331
42331
  if (target.includes("slideMaster")) {
42332
42332
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
42333
- masterPath = target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
42333
+ masterPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
42334
42334
  break;
42335
42335
  }
42336
42336
  }
@@ -42464,7 +42464,7 @@ var PptxHandlerRuntime62 = class extends PptxHandlerRuntime61 {
42464
42464
  for (const [, target] of slideRels.entries()) {
42465
42465
  if (target.includes("slideLayout")) {
42466
42466
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
42467
- layoutPath = target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
42467
+ layoutPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
42468
42468
  break;
42469
42469
  }
42470
42470
  }
@@ -46761,7 +46761,7 @@ var PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
46761
46761
  for (const [, target] of layoutRels.entries()) {
46762
46762
  if (target.includes("slideMaster")) {
46763
46763
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
46764
- return target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
46764
+ return target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
46765
46765
  }
46766
46766
  }
46767
46767
  return void 0;
@@ -46830,7 +46830,7 @@ var PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
46830
46830
  for (const [, target] of masterRels.entries()) {
46831
46831
  if (target.includes("slideLayout")) {
46832
46832
  const masterDir = masterPath.substring(0, masterPath.lastIndexOf("/") + 1);
46833
- const resolved = target.startsWith("..") ? this.resolvePath(masterDir, target) : `ppt/${target.replace("../", "")}`;
46833
+ const resolved = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(masterDir, target) : `ppt/${target.replace("../", "")}`;
46834
46834
  masterLayoutPaths.add(resolved);
46835
46835
  }
46836
46836
  }
package/dist/index.mjs CHANGED
@@ -41501,7 +41501,7 @@ var PptxHandlerRuntime57 = class extends PptxHandlerRuntime56 {
41501
41501
  for (const [, target] of layoutRels.entries()) {
41502
41502
  if (target.includes("slideMaster")) {
41503
41503
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
41504
- const masterPath = target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41504
+ const masterPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41505
41505
  try {
41506
41506
  const masterXmlStr = await this.zip.file(masterPath)?.async("string");
41507
41507
  if (masterXmlStr) {
@@ -41525,7 +41525,7 @@ var PptxHandlerRuntime57 = class extends PptxHandlerRuntime56 {
41525
41525
  for (const [, target] of slideRels.entries()) {
41526
41526
  if (target.includes("slideLayout")) {
41527
41527
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
41528
- const layoutPath = target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41528
+ const layoutPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41529
41529
  try {
41530
41530
  const layoutXmlStr = await this.zip.file(layoutPath)?.async("string");
41531
41531
  if (layoutXmlStr) {
@@ -41553,7 +41553,7 @@ var PptxHandlerRuntime57 = class extends PptxHandlerRuntime56 {
41553
41553
  for (const [, target] of slideRels.entries()) {
41554
41554
  if (target.includes("slideLayout")) {
41555
41555
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
41556
- const layoutPath = target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41556
+ const layoutPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41557
41557
  try {
41558
41558
  const layoutXmlStr = await this.zip.file(layoutPath)?.async("string");
41559
41559
  if (layoutXmlStr) {
@@ -41582,7 +41582,7 @@ var PptxHandlerRuntime57 = class extends PptxHandlerRuntime56 {
41582
41582
  for (const [, target] of layoutRels.entries()) {
41583
41583
  if (target.includes("slideMaster")) {
41584
41584
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
41585
- const masterPath = target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41585
+ const masterPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41586
41586
  try {
41587
41587
  const masterXmlStr = await this.zip.file(masterPath)?.async("string");
41588
41588
  if (masterXmlStr) {
@@ -41611,7 +41611,7 @@ var PptxHandlerRuntime58 = class extends PptxHandlerRuntime57 {
41611
41611
  for (const [, target] of slideRels.entries()) {
41612
41612
  if (target.includes("slideLayout")) {
41613
41613
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
41614
- const layoutPath = target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41614
+ const layoutPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41615
41615
  try {
41616
41616
  const layoutXmlStr = await this.zip.file(layoutPath)?.async("string");
41617
41617
  if (layoutXmlStr) {
@@ -41640,7 +41640,7 @@ var PptxHandlerRuntime58 = class extends PptxHandlerRuntime57 {
41640
41640
  for (const [, target] of layoutRels.entries()) {
41641
41641
  if (target.includes("slideMaster")) {
41642
41642
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
41643
- const masterPath = target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41643
+ const masterPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41644
41644
  try {
41645
41645
  const masterXmlStr = await this.zip.file(masterPath)?.async("string");
41646
41646
  if (masterXmlStr) {
@@ -41665,7 +41665,7 @@ var PptxHandlerRuntime58 = class extends PptxHandlerRuntime57 {
41665
41665
  for (const [, target] of slideRels.entries()) {
41666
41666
  if (target.includes("slideLayout")) {
41667
41667
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
41668
- return target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41668
+ return target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
41669
41669
  }
41670
41670
  }
41671
41671
  return void 0;
@@ -41681,7 +41681,7 @@ var PptxHandlerRuntime58 = class extends PptxHandlerRuntime57 {
41681
41681
  for (const [, target] of layoutRels.entries()) {
41682
41682
  if (target.includes("slideMaster")) {
41683
41683
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
41684
- return target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41684
+ return target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
41685
41685
  }
41686
41686
  }
41687
41687
  return void 0;
@@ -42325,7 +42325,7 @@ var PptxHandlerRuntime61 = class extends PptxHandlerRuntime60 {
42325
42325
  for (const [, target] of layoutRels.entries()) {
42326
42326
  if (target.includes("slideMaster")) {
42327
42327
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
42328
- masterPath = target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
42328
+ masterPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
42329
42329
  break;
42330
42330
  }
42331
42331
  }
@@ -42459,7 +42459,7 @@ var PptxHandlerRuntime62 = class extends PptxHandlerRuntime61 {
42459
42459
  for (const [, target] of slideRels.entries()) {
42460
42460
  if (target.includes("slideLayout")) {
42461
42461
  const slideDir = slidePath.substring(0, slidePath.lastIndexOf("/") + 1);
42462
- layoutPath = target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
42462
+ layoutPath = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(slideDir, target) : `ppt/${target.replace("../", "")}`;
42463
42463
  break;
42464
42464
  }
42465
42465
  }
@@ -46756,7 +46756,7 @@ var PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
46756
46756
  for (const [, target] of layoutRels.entries()) {
46757
46757
  if (target.includes("slideMaster")) {
46758
46758
  const layoutDir = layoutPath.substring(0, layoutPath.lastIndexOf("/") + 1);
46759
- return target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
46759
+ return target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(layoutDir, target) : `ppt/${target.replace("../", "")}`;
46760
46760
  }
46761
46761
  }
46762
46762
  return void 0;
@@ -46825,7 +46825,7 @@ var PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
46825
46825
  for (const [, target] of masterRels.entries()) {
46826
46826
  if (target.includes("slideLayout")) {
46827
46827
  const masterDir = masterPath.substring(0, masterPath.lastIndexOf("/") + 1);
46828
- const resolved = target.startsWith("..") ? this.resolvePath(masterDir, target) : `ppt/${target.replace("../", "")}`;
46828
+ const resolved = target.startsWith("/") ? target.substring(1) : target.startsWith("..") ? this.resolvePath(masterDir, target) : `ppt/${target.replace("../", "")}`;
46829
46829
  masterLayoutPaths.add(resolved);
46830
46830
  }
46831
46831
  }
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-viewer-core",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "PowerPoint PPTX engine: parse, edit, serialize, and convert .pptx files. Framework-agnostic TypeScript SDK.",
5
5
  "keywords": [
6
6
  "angular",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "devDependencies": {
85
85
  "@types/node-forge": "^1.3.14",
86
- "@xmldom/xmldom": "^0.8.13",
86
+ "@xmldom/xmldom": "^0.9.10",
87
87
  "node-forge": "^1.4.0",
88
88
  "tsup": "^8.5.1",
89
89
  "typescript": "^6.0.3",