ooxml-core 1.27.1 → 1.27.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/dist/{PptxHandler-NHOKKZ4S.cjs → PptxHandler-FRQKHTCM.cjs} +2 -2
- package/dist/{PptxHandler-TZJNIXPX.mjs → PptxHandler-RETSKQ5E.mjs} +1 -1
- package/dist/{PptxHandler-OIR3ZY4Q.mjs → PptxHandler-WRJXTPGV.mjs} +2 -2
- package/dist/{PresentationBuilder-X5WFSHLB.mjs → PresentationBuilder-LWR5X3JA.mjs} +2 -2
- package/dist/{PresentationBuilder-RFTSZUPR.mjs → PresentationBuilder-POXKHTV7.mjs} +1 -1
- package/dist/{PresentationBuilder-EX6DAE5X.cjs → PresentationBuilder-YO5YOTA3.cjs} +4 -4
- package/dist/{chunk-BXZF7H5G.mjs → chunk-3VIPI6IA.mjs} +4 -4
- package/dist/{chunk-5KJAQKZG.mjs → chunk-6LCBTFNL.mjs} +213 -110
- package/dist/{chunk-5NJPYCGO.mjs → chunk-G67MARDL.mjs} +1 -1
- package/dist/{chunk-DMJIDRJE.cjs → chunk-K6DNX3YC.cjs} +212 -109
- package/dist/{chunk-GZ4DIXZZ.mjs → chunk-RNUYMB73.mjs} +212 -109
- package/dist/{chunk-QIMNQDON.mjs → chunk-TIQWSSGI.mjs} +1 -1
- package/dist/{chunk-ZWTXVWMY.mjs → chunk-XW4XB6P4.mjs} +1 -1
- package/dist/pptx/automation/index.cjs +224 -109
- package/dist/pptx/automation/index.d.ts +3 -3
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{index-D4FnOx6x.d.ts → index-CdRlUz-v.d.ts} +2 -2
- package/dist/pptx/chunks/{index-D4FnOx6x.d.ts.map → index-CdRlUz-v.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-D8DNpc1X.d.ts → index-D_d4NTVP.d.ts} +36 -3
- package/dist/pptx/chunks/index-D_d4NTVP.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-GWpMAY-f.d.ts → index-lwMA6pP5.d.ts} +3 -3
- package/dist/pptx/chunks/{index-GWpMAY-f.d.ts.map → index-lwMA6pP5.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +224 -109
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +1 -1
- package/dist/pptx/editor/render/slide-operations.mjs +1 -1
- package/dist/pptx/index.cjs +224 -109
- package/dist/pptx/index.d.ts +3 -3
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/pptx/chunks/index-D8DNpc1X.d.ts.map +0 -1
|
@@ -11894,6 +11894,91 @@ function applyBackground(style, background) {
|
|
|
11894
11894
|
style.fillOpacity = 0;
|
|
11895
11895
|
}
|
|
11896
11896
|
|
|
11897
|
+
// pptx/core/core/runtime/load-part-reader.ts
|
|
11898
|
+
var openReaders = /* @__PURE__ */ new WeakMap();
|
|
11899
|
+
var LoadPartReader = class {
|
|
11900
|
+
constructor(zip) {
|
|
11901
|
+
this.zip = zip;
|
|
11902
|
+
openReaders.set(zip, this);
|
|
11903
|
+
}
|
|
11904
|
+
zip;
|
|
11905
|
+
parts = /* @__PURE__ */ new Map();
|
|
11906
|
+
closed = false;
|
|
11907
|
+
entry(path3) {
|
|
11908
|
+
const file = this.zip.file(path3);
|
|
11909
|
+
if (!file) {
|
|
11910
|
+
this.parts.delete(path3);
|
|
11911
|
+
return void 0;
|
|
11912
|
+
}
|
|
11913
|
+
const previous = this.parts.get(path3);
|
|
11914
|
+
if (previous?.file === file) {
|
|
11915
|
+
return previous;
|
|
11916
|
+
}
|
|
11917
|
+
const entry2 = { file, text: file.async("string"), relationships: /* @__PURE__ */ new Map() };
|
|
11918
|
+
this.parts.set(path3, entry2);
|
|
11919
|
+
entry2.text.catch(() => {
|
|
11920
|
+
if (this.parts.get(path3) === entry2) {
|
|
11921
|
+
this.parts.delete(path3);
|
|
11922
|
+
}
|
|
11923
|
+
});
|
|
11924
|
+
return entry2;
|
|
11925
|
+
}
|
|
11926
|
+
readText(path3) {
|
|
11927
|
+
return this.entry(path3)?.text ?? Promise.resolve(void 0);
|
|
11928
|
+
}
|
|
11929
|
+
async readXml(parser, path3) {
|
|
11930
|
+
const entry2 = this.entry(path3);
|
|
11931
|
+
if (!entry2) {
|
|
11932
|
+
return void 0;
|
|
11933
|
+
}
|
|
11934
|
+
if (!path3.endsWith(".rels")) {
|
|
11935
|
+
return parseText(parser, await entry2.text);
|
|
11936
|
+
}
|
|
11937
|
+
let parsed = entry2.relationships.get(parser);
|
|
11938
|
+
if (!parsed) {
|
|
11939
|
+
const pending = entry2.text.then((text) => parseText(parser, text));
|
|
11940
|
+
entry2.relationships.set(parser, pending);
|
|
11941
|
+
pending.catch(() => {
|
|
11942
|
+
if (entry2.relationships.get(parser) === pending) {
|
|
11943
|
+
entry2.relationships.delete(parser);
|
|
11944
|
+
}
|
|
11945
|
+
});
|
|
11946
|
+
parsed = pending;
|
|
11947
|
+
}
|
|
11948
|
+
return structuredClone(await parsed);
|
|
11949
|
+
}
|
|
11950
|
+
/** Whether this reader still serves reads for its package. */
|
|
11951
|
+
get isOpen() {
|
|
11952
|
+
return !this.closed;
|
|
11953
|
+
}
|
|
11954
|
+
/** Drops every cached read; later reads of the package go to the archive. */
|
|
11955
|
+
close() {
|
|
11956
|
+
this.closed = true;
|
|
11957
|
+
if (openReaders.get(this.zip) === this) {
|
|
11958
|
+
openReaders.delete(this.zip);
|
|
11959
|
+
}
|
|
11960
|
+
this.parts.clear();
|
|
11961
|
+
}
|
|
11962
|
+
};
|
|
11963
|
+
function parseText(parser, text) {
|
|
11964
|
+
return text ? parser.parse(text) : void 0;
|
|
11965
|
+
}
|
|
11966
|
+
function readPartText(zip, path3) {
|
|
11967
|
+
const reader = openReaders.get(zip);
|
|
11968
|
+
if (reader) {
|
|
11969
|
+
return reader.readText(path3);
|
|
11970
|
+
}
|
|
11971
|
+
return zip.file(path3)?.async("string") ?? Promise.resolve(void 0);
|
|
11972
|
+
}
|
|
11973
|
+
async function readPartXml(zip, parser, path3) {
|
|
11974
|
+
const reader = openReaders.get(zip);
|
|
11975
|
+
if (reader) {
|
|
11976
|
+
return reader.readXml(parser, path3);
|
|
11977
|
+
}
|
|
11978
|
+
const text = await zip.file(path3)?.async("string");
|
|
11979
|
+
return text ? parseText(parser, text) : void 0;
|
|
11980
|
+
}
|
|
11981
|
+
|
|
11897
11982
|
// pptx/core/core/builders/element-hidden-flag.ts
|
|
11898
11983
|
var NV_CONTAINERS = [
|
|
11899
11984
|
"p:nvSpPr",
|
|
@@ -11958,11 +12043,10 @@ function flattenElementsDeep(elements2) {
|
|
|
11958
12043
|
// pptx/core/utils/slide-synchronization.ts
|
|
11959
12044
|
var SLIDE_SYNC_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideSyncData+xml";
|
|
11960
12045
|
async function loadSlideSynchronization(input) {
|
|
11961
|
-
const
|
|
11962
|
-
if (!
|
|
12046
|
+
const relsData = await readPartXml(input.zip, input.parser, input.relsPath);
|
|
12047
|
+
if (!relsData) {
|
|
11963
12048
|
return void 0;
|
|
11964
12049
|
}
|
|
11965
|
-
const relsData = input.parser.parse(relsXml);
|
|
11966
12050
|
const relationship2 = findSlideSyncRelationship(relsData);
|
|
11967
12051
|
if (!relationship2) {
|
|
11968
12052
|
return void 0;
|
|
@@ -11972,7 +12056,7 @@ async function loadSlideSynchronization(input) {
|
|
|
11972
12056
|
return void 0;
|
|
11973
12057
|
}
|
|
11974
12058
|
const partPath = resolvePartPath2(input.slidePath, target);
|
|
11975
|
-
const partXml = await input.zip
|
|
12059
|
+
const partXml = await readPartText(input.zip, partPath);
|
|
11976
12060
|
if (!partXml) {
|
|
11977
12061
|
return void 0;
|
|
11978
12062
|
}
|
|
@@ -12101,11 +12185,10 @@ function ensureArray2(value) {
|
|
|
12101
12185
|
}
|
|
12102
12186
|
async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
12103
12187
|
try {
|
|
12104
|
-
const
|
|
12105
|
-
if (!
|
|
12188
|
+
const relsData = await readPartXml(zip, parser, relsPath2);
|
|
12189
|
+
if (!relsData) {
|
|
12106
12190
|
return [];
|
|
12107
12191
|
}
|
|
12108
|
-
const relsData = parser.parse(relsXml);
|
|
12109
12192
|
const relationships2 = ensureArray2(
|
|
12110
12193
|
relsData["Relationships"]?.["Relationship"]
|
|
12111
12194
|
);
|
|
@@ -12128,7 +12211,7 @@ async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
|
12128
12211
|
if (!resolved) {
|
|
12129
12212
|
continue;
|
|
12130
12213
|
}
|
|
12131
|
-
const vmlXml = await zip
|
|
12214
|
+
const vmlXml = await readPartText(zip, resolved);
|
|
12132
12215
|
if (!vmlXml) {
|
|
12133
12216
|
continue;
|
|
12134
12217
|
}
|
|
@@ -14550,11 +14633,14 @@ var PptxSlideLoaderService = class {
|
|
|
14550
14633
|
* @returns Map of relationship ID to target path string.
|
|
14551
14634
|
*/
|
|
14552
14635
|
async loadPresentationSlideRels(params) {
|
|
14553
|
-
const
|
|
14554
|
-
|
|
14636
|
+
const relsData = await readPartXml(
|
|
14637
|
+
params.zip,
|
|
14638
|
+
params.parser,
|
|
14639
|
+
"ppt/_rels/presentation.xml.rels"
|
|
14640
|
+
);
|
|
14641
|
+
if (!relsData) {
|
|
14555
14642
|
return /* @__PURE__ */ new Map();
|
|
14556
14643
|
}
|
|
14557
|
-
const relsData = params.parser.parse(relsXml);
|
|
14558
14644
|
const relationships2 = relsData["Relationships"]?.["Relationship"];
|
|
14559
14645
|
const relNodes = this.toXmlObjectArray(relationships2);
|
|
14560
14646
|
const relsMap = /* @__PURE__ */ new Map();
|
|
@@ -14594,7 +14680,7 @@ var PptxSlideLoaderService = class {
|
|
|
14594
14680
|
if (!params.zip.file(path3)) {
|
|
14595
14681
|
path3 = `ppt/${target}`;
|
|
14596
14682
|
}
|
|
14597
|
-
const slideXmlStr = await params.zip
|
|
14683
|
+
const slideXmlStr = await readPartText(params.zip, path3);
|
|
14598
14684
|
if (!slideXmlStr) {
|
|
14599
14685
|
return void 0;
|
|
14600
14686
|
}
|
|
@@ -38145,6 +38231,7 @@ function collectChartWorkbookWrite(xmlLookupService, container, isNumeric2, valu
|
|
|
38145
38231
|
}
|
|
38146
38232
|
|
|
38147
38233
|
// pptx/core/utils/chart-label-source.ts
|
|
38234
|
+
var relationshipParser = new fastXmlParser.XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
38148
38235
|
function formulaCount(value) {
|
|
38149
38236
|
if (!value || typeof value !== "object") return 0;
|
|
38150
38237
|
if (Array.isArray(value)) return value.reduce((total, item) => total + formulaCount(item), 0);
|
|
@@ -38192,12 +38279,11 @@ async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes,
|
|
|
38192
38279
|
if (!external.targetPath || !external.embeddedWorkbookData) return false;
|
|
38193
38280
|
const target = resolve(chartPartPath, external.targetPath);
|
|
38194
38281
|
let references = 0;
|
|
38195
|
-
const parser = new fastXmlParser.XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
38196
38282
|
try {
|
|
38197
38283
|
for (const path3 of Object.keys(zip.files)) {
|
|
38198
38284
|
if (!path3.endsWith(".rels") || !path3.includes("/_rels/")) continue;
|
|
38199
38285
|
const source = path3.replace("/_rels/", "/").slice(0, -5);
|
|
38200
|
-
const tree =
|
|
38286
|
+
const tree = await readPartXml(zip, relationshipParser, path3);
|
|
38201
38287
|
for (const rel of chunk36TR3PER_cjs.xmlChildren(chunk36TR3PER_cjs.xmlChild(tree, "Relationships"), "Relationship")) {
|
|
38202
38288
|
const relationshipTarget2 = chunk36TR3PER_cjs.xmlAttr(rel, "Target");
|
|
38203
38289
|
if (relationshipTarget2 && chunk36TR3PER_cjs.xmlAttr(rel, "TargetMode") !== "External" && resolve(source, relationshipTarget2) === target)
|
|
@@ -40314,7 +40400,7 @@ function parseChartData(context, element) {
|
|
|
40314
40400
|
}
|
|
40315
40401
|
return out;
|
|
40316
40402
|
}
|
|
40317
|
-
function
|
|
40403
|
+
function parseText2(context, element) {
|
|
40318
40404
|
if (!element) return void 0;
|
|
40319
40405
|
reportUnmodelled2(context, element, /* @__PURE__ */ new Set(["txData", "rich"]));
|
|
40320
40406
|
const data = cxChild(element, "txData");
|
|
@@ -40335,7 +40421,7 @@ function parseTitle2(context, element) {
|
|
|
40335
40421
|
return assignDefined(
|
|
40336
40422
|
{},
|
|
40337
40423
|
{
|
|
40338
|
-
tx:
|
|
40424
|
+
tx: parseText2(context, cxChild(element, "tx")),
|
|
40339
40425
|
spPr: shapeProperties2(element),
|
|
40340
40426
|
txPr: textProperties2(element),
|
|
40341
40427
|
position: attribute(element, "pos"),
|
|
@@ -40588,7 +40674,7 @@ function parseSeries2(context, element) {
|
|
|
40588
40674
|
ownerIndex: numberAttribute(context, element, "ownerIdx"),
|
|
40589
40675
|
uniqueId: attribute(element, "uniqueId"),
|
|
40590
40676
|
formatIndex: numberAttribute(context, element, "formatIdx"),
|
|
40591
|
-
tx:
|
|
40677
|
+
tx: parseText2(context, cxChild(element, "tx")),
|
|
40592
40678
|
spPr: shapeProperties2(element),
|
|
40593
40679
|
txPr: textProperties2(element),
|
|
40594
40680
|
valueColorsXml: rawChild2(element, "valueColors"),
|
|
@@ -52969,8 +53055,8 @@ async function discoverTagCollections(zip, codec) {
|
|
|
52969
53055
|
if (!sourcePartPath) {
|
|
52970
53056
|
continue;
|
|
52971
53057
|
}
|
|
52972
|
-
const data =
|
|
52973
|
-
const root = data["Relationships"];
|
|
53058
|
+
const data = await readPartXml(zip, codec, relFile.name);
|
|
53059
|
+
const root = data?.["Relationships"];
|
|
52974
53060
|
for (const relationship2 of ensureArray10(root?.["Relationship"])) {
|
|
52975
53061
|
if (String(relationship2["@_Type"] ?? "") !== TAG_RELATIONSHIP_TYPE) {
|
|
52976
53062
|
continue;
|
|
@@ -53075,7 +53161,7 @@ async function removeTagContentTypeOverride(zip, codec, path3) {
|
|
|
53075
53161
|
zip.file("[Content_Types].xml", codec.build(data));
|
|
53076
53162
|
}
|
|
53077
53163
|
async function readTagCollection(zip, codec, path3) {
|
|
53078
|
-
const xml = await zip
|
|
53164
|
+
const xml = await readPartText(zip, path3);
|
|
53079
53165
|
if (!xml) {
|
|
53080
53166
|
return void 0;
|
|
53081
53167
|
}
|
|
@@ -58195,6 +58281,30 @@ var TemplateElementBaselineTracker = class {
|
|
|
58195
58281
|
var PptxHandlerRuntime = class {
|
|
58196
58282
|
/** The in-memory ZIP archive representing the OPC (.pptx) package. */
|
|
58197
58283
|
zip;
|
|
58284
|
+
/** Shares part reads within the load in progress; see {@link LoadPartReader}. */
|
|
58285
|
+
loadPartReader;
|
|
58286
|
+
/** Opens a part reader for the current package, closing any earlier one. */
|
|
58287
|
+
beginPartReads() {
|
|
58288
|
+
this.endPartReads();
|
|
58289
|
+
const reader = new LoadPartReader(this.zip);
|
|
58290
|
+
this.loadPartReader = reader;
|
|
58291
|
+
return reader;
|
|
58292
|
+
}
|
|
58293
|
+
/** Closes `reader` (by default the open one) and releases its cached reads. */
|
|
58294
|
+
endPartReads(reader = this.loadPartReader) {
|
|
58295
|
+
reader?.close();
|
|
58296
|
+
if (reader && this.loadPartReader === reader) {
|
|
58297
|
+
this.loadPartReader = void 0;
|
|
58298
|
+
}
|
|
58299
|
+
}
|
|
58300
|
+
/** The text of a package part, shared within a load. */
|
|
58301
|
+
readPartText(path3) {
|
|
58302
|
+
return readPartText(this.zip, path3);
|
|
58303
|
+
}
|
|
58304
|
+
/** A parsed package part; relationship parts are parsed once per load. */
|
|
58305
|
+
readPartXml(path3) {
|
|
58306
|
+
return readPartXml(this.zip, this.parser, path3);
|
|
58307
|
+
}
|
|
58198
58308
|
/** fast-xml-parser instance used to parse XML strings into JS objects. */
|
|
58199
58309
|
parser;
|
|
58200
58310
|
/** fast-xml-parser builder used to serialize JS objects back to XML strings. */
|
|
@@ -58613,11 +58723,11 @@ var PptxHandlerRuntime = class {
|
|
|
58613
58723
|
* @param relsPath - Path of the `.rels` part; derived from `partPath` when omitted.
|
|
58614
58724
|
*/
|
|
58615
58725
|
async loadPartRelationships(partPath, relsPath2) {
|
|
58616
|
-
const
|
|
58617
|
-
|
|
58726
|
+
const path3 = relsPath2 ?? partRelsPath(partPath);
|
|
58727
|
+
const relsData = await this.readPartXml(path3);
|
|
58728
|
+
if (!relsData) {
|
|
58618
58729
|
return;
|
|
58619
58730
|
}
|
|
58620
|
-
const relsData = this.parser.parse(relsXml);
|
|
58621
58731
|
const relationships2 = relsData?.["Relationships"];
|
|
58622
58732
|
const raw2 = relationships2?.["Relationship"];
|
|
58623
58733
|
const entries = Array.isArray(raw2) ? raw2 : raw2 ? [raw2] : [];
|
|
@@ -60063,10 +60173,6 @@ var PptxHandlerRuntime8 = class extends PptxHandlerRuntime7 {
|
|
|
60063
60173
|
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
60064
60174
|
return true;
|
|
60065
60175
|
}
|
|
60066
|
-
/** The text of a package part, or `undefined` when the package has no such part. */
|
|
60067
|
-
async readPartText(path3) {
|
|
60068
|
-
return this.zip.file(path3)?.async("string");
|
|
60069
|
-
}
|
|
60070
60176
|
/**
|
|
60071
60177
|
* Parse extended (application) properties from `docProps/app.xml`.
|
|
60072
60178
|
*/
|
|
@@ -60127,8 +60233,10 @@ var PptxHandlerRuntime8 = class extends PptxHandlerRuntime7 {
|
|
|
60127
60233
|
if (!relsFile) {
|
|
60128
60234
|
return [];
|
|
60129
60235
|
}
|
|
60130
|
-
const
|
|
60131
|
-
|
|
60236
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
60237
|
+
if (!relsData) {
|
|
60238
|
+
return [];
|
|
60239
|
+
}
|
|
60132
60240
|
const relRoot = relsData["Relationships"] || {};
|
|
60133
60241
|
const relationships2 = this.ensureArray(relRoot["Relationship"]);
|
|
60134
60242
|
const relMap = /* @__PURE__ */ new Map();
|
|
@@ -60159,7 +60267,7 @@ var PptxHandlerRuntime8 = class extends PptxHandlerRuntime7 {
|
|
|
60159
60267
|
try {
|
|
60160
60268
|
const file = this.zip.file(resolvedPath);
|
|
60161
60269
|
if (file) {
|
|
60162
|
-
data = await
|
|
60270
|
+
data = await this.readPartText(resolvedPath);
|
|
60163
60271
|
}
|
|
60164
60272
|
} catch {
|
|
60165
60273
|
}
|
|
@@ -60239,9 +60347,7 @@ var PptxHandlerRuntime8 = class extends PptxHandlerRuntime7 {
|
|
|
60239
60347
|
*/
|
|
60240
60348
|
async parseTags() {
|
|
60241
60349
|
try {
|
|
60242
|
-
return await discoverTagCollections(this.zip,
|
|
60243
|
-
parse: (xml) => this.parser.parse(xml)
|
|
60244
|
-
});
|
|
60350
|
+
return await discoverTagCollections(this.zip, this.parser);
|
|
60245
60351
|
} catch (e) {
|
|
60246
60352
|
console.warn("Failed to parse tags:", e);
|
|
60247
60353
|
return [];
|
|
@@ -60365,7 +60471,7 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
60365
60471
|
}
|
|
60366
60472
|
for (const file of masterFiles) {
|
|
60367
60473
|
const path3 = file.name;
|
|
60368
|
-
const xml = await
|
|
60474
|
+
const xml = await this.readPartText(path3) ?? "";
|
|
60369
60475
|
const data = this.parser.parse(xml);
|
|
60370
60476
|
const sldMaster = data?.["p:sldMaster"];
|
|
60371
60477
|
if (!sldMaster) {
|
|
@@ -60390,8 +60496,7 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
60390
60496
|
);
|
|
60391
60497
|
const relsFile = this.zip.file(relsPath2);
|
|
60392
60498
|
if (relsFile) {
|
|
60393
|
-
const
|
|
60394
|
-
const relsData = this.parser.parse(relsXml);
|
|
60499
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
60395
60500
|
const rels = this.ensureArray(
|
|
60396
60501
|
chunk36TR3PER_cjs.xmlChild(relsData, "Relationships")?.["Relationship"]
|
|
60397
60502
|
);
|
|
@@ -60405,8 +60510,7 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
60405
60510
|
}
|
|
60406
60511
|
const layoutPaths = [];
|
|
60407
60512
|
if (relsFile) {
|
|
60408
|
-
const
|
|
60409
|
-
const relsData = this.parser.parse(relsXml);
|
|
60513
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
60410
60514
|
const rels = this.ensureArray(
|
|
60411
60515
|
chunk36TR3PER_cjs.xmlChild(relsData, "Relationships")?.["Relationship"]
|
|
60412
60516
|
);
|
|
@@ -60450,7 +60554,7 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
60450
60554
|
return void 0;
|
|
60451
60555
|
}
|
|
60452
60556
|
const path3 = files[0].name;
|
|
60453
|
-
const xml = await
|
|
60557
|
+
const xml = await this.readPartText(path3) ?? "";
|
|
60454
60558
|
const data = this.parser.parse(xml);
|
|
60455
60559
|
const master = data?.["p:handoutMaster"];
|
|
60456
60560
|
if (!master) {
|
|
@@ -60482,7 +60586,7 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
60482
60586
|
return void 0;
|
|
60483
60587
|
}
|
|
60484
60588
|
const path3 = files[0].name;
|
|
60485
|
-
const xml = await
|
|
60589
|
+
const xml = await this.readPartText(path3) ?? "";
|
|
60486
60590
|
const data = this.parser.parse(xml);
|
|
60487
60591
|
const master = data?.["p:notesMaster"];
|
|
60488
60592
|
if (!master) {
|
|
@@ -60513,7 +60617,7 @@ var PptxHandlerRuntime9 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
60513
60617
|
if (!layoutFile) {
|
|
60514
60618
|
return void 0;
|
|
60515
60619
|
}
|
|
60516
|
-
const xml = await
|
|
60620
|
+
const xml = await this.readPartText(layoutPath) ?? "";
|
|
60517
60621
|
const data = this.parser.parse(xml);
|
|
60518
60622
|
const sldLayout = data?.["p:sldLayout"];
|
|
60519
60623
|
if (!sldLayout) {
|
|
@@ -60607,18 +60711,19 @@ var PptxHandlerRuntime10 = class extends PptxHandlerRuntime9 {
|
|
|
60607
60711
|
*/
|
|
60608
60712
|
async parsePresentationProperties() {
|
|
60609
60713
|
try {
|
|
60610
|
-
const
|
|
60611
|
-
if (!
|
|
60714
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
60715
|
+
if (!relsData) {
|
|
60612
60716
|
return void 0;
|
|
60613
60717
|
}
|
|
60614
|
-
const
|
|
60615
|
-
|
|
60718
|
+
const rels = this.ensureArray(
|
|
60719
|
+
relsData.Relationships?.Relationship
|
|
60720
|
+
);
|
|
60616
60721
|
const prRel = rels.find(
|
|
60617
60722
|
(r) => String(r?.["@_Type"] || "").includes("presProps") || String(r?.["@_Target"] || "").includes("presProps")
|
|
60618
60723
|
);
|
|
60619
60724
|
const prTarget = prRel ? String(prRel["@_Target"] || "") : "presProps.xml";
|
|
60620
60725
|
const prPath = prTarget.startsWith("/") ? prTarget.substring(1) : `ppt/${prTarget}`;
|
|
60621
|
-
const prXmlStr = await this.
|
|
60726
|
+
const prXmlStr = await this.readPartText(prPath);
|
|
60622
60727
|
if (!prXmlStr) {
|
|
60623
60728
|
return void 0;
|
|
60624
60729
|
}
|
|
@@ -60664,7 +60769,7 @@ var PptxHandlerRuntime10 = class extends PptxHandlerRuntime9 {
|
|
|
60664
60769
|
*/
|
|
60665
60770
|
async parseViewProperties() {
|
|
60666
60771
|
try {
|
|
60667
|
-
const viewPropsXml2 = await this.
|
|
60772
|
+
const viewPropsXml2 = await this.readPartText("ppt/viewProps.xml");
|
|
60668
60773
|
if (!viewPropsXml2) {
|
|
60669
60774
|
return void 0;
|
|
60670
60775
|
}
|
|
@@ -64873,7 +64978,7 @@ var PptxHandlerRuntime23 = class extends PptxHandlerRuntime22 {
|
|
|
64873
64978
|
if (existingRel?.target) {
|
|
64874
64979
|
drawingPath = this.resolveImagePath(chartPartPath, existingRel.target);
|
|
64875
64980
|
try {
|
|
64876
|
-
const xml = await this.
|
|
64981
|
+
const xml = await this.readPartText(drawingPath);
|
|
64877
64982
|
if (xml) {
|
|
64878
64983
|
const root = this.parser.parse(xml);
|
|
64879
64984
|
onDisk = chunk36TR3PER_cjs.parseChartUserShapesDrawing(root, this.xmlLookupService, {
|
|
@@ -64924,11 +65029,10 @@ var PptxHandlerRuntime23 = class extends PptxHandlerRuntime22 {
|
|
|
64924
65029
|
const slash = chartPartPath.lastIndexOf("/");
|
|
64925
65030
|
const relsPath2 = `${chartPartPath.slice(0, slash + 1)}_rels/${chartPartPath.slice(slash + 1)}.rels`;
|
|
64926
65031
|
try {
|
|
64927
|
-
const
|
|
64928
|
-
if (!
|
|
65032
|
+
const tree = await this.readPartXml(relsPath2);
|
|
65033
|
+
if (!tree) {
|
|
64929
65034
|
return void 0;
|
|
64930
65035
|
}
|
|
64931
|
-
const tree = this.parser.parse(xml);
|
|
64932
65036
|
const root = tree["Relationships"];
|
|
64933
65037
|
const rels = root?.["Relationship"];
|
|
64934
65038
|
const list2 = rels === void 0 ? [] : Array.isArray(rels) ? rels : [rels];
|
|
@@ -79529,7 +79633,7 @@ var PptxHandlerRuntime71 = class extends PptxHandlerRuntime70 {
|
|
|
79529
79633
|
this.unwrapAlternateContent(spTree);
|
|
79530
79634
|
let rawXmlStr;
|
|
79531
79635
|
try {
|
|
79532
|
-
rawXmlStr = await this.
|
|
79636
|
+
rawXmlStr = await this.readPartText(slidePath);
|
|
79533
79637
|
} catch {
|
|
79534
79638
|
}
|
|
79535
79639
|
const slidePrefix = slidePath ? `${slidePath}-` : "";
|
|
@@ -80082,7 +80186,7 @@ var PptxHandlerRuntime73 = class extends PptxHandlerRuntime72 {
|
|
|
80082
80186
|
if (cached) {
|
|
80083
80187
|
return cached;
|
|
80084
80188
|
}
|
|
80085
|
-
const xml = await this.
|
|
80189
|
+
const xml = await this.readPartText(layoutPath);
|
|
80086
80190
|
if (!xml) {
|
|
80087
80191
|
return void 0;
|
|
80088
80192
|
}
|
|
@@ -80096,7 +80200,7 @@ var PptxHandlerRuntime73 = class extends PptxHandlerRuntime72 {
|
|
|
80096
80200
|
if (cached) {
|
|
80097
80201
|
return cached;
|
|
80098
80202
|
}
|
|
80099
|
-
const xml = await this.
|
|
80203
|
+
const xml = await this.readPartText(masterPath);
|
|
80100
80204
|
if (!xml) {
|
|
80101
80205
|
return void 0;
|
|
80102
80206
|
}
|
|
@@ -80547,7 +80651,7 @@ var PptxHandlerRuntime74 = class extends PptxHandlerRuntime73 {
|
|
|
80547
80651
|
if (!notesPath) {
|
|
80548
80652
|
return {};
|
|
80549
80653
|
}
|
|
80550
|
-
const notesXml = await this.
|
|
80654
|
+
const notesXml = await this.readPartText(notesPath);
|
|
80551
80655
|
if (!notesXml) {
|
|
80552
80656
|
return {};
|
|
80553
80657
|
}
|
|
@@ -81021,7 +81125,7 @@ var PptxHandlerRuntime77 = class extends PptxHandlerRuntime76 {
|
|
|
81021
81125
|
try {
|
|
81022
81126
|
let masterXmlObj = this.masterXmlMap.get(master.path);
|
|
81023
81127
|
if (!masterXmlObj) {
|
|
81024
|
-
const xmlStr = await this.
|
|
81128
|
+
const xmlStr = await this.readPartText(master.path);
|
|
81025
81129
|
if (!xmlStr) {
|
|
81026
81130
|
continue;
|
|
81027
81131
|
}
|
|
@@ -81094,7 +81198,7 @@ var PptxHandlerRuntime77 = class extends PptxHandlerRuntime76 {
|
|
|
81094
81198
|
}
|
|
81095
81199
|
const masterToken = masterPath.split("/").pop()?.replace(/\.xml$/u, "") ?? masterPath;
|
|
81096
81200
|
try {
|
|
81097
|
-
const masterXmlStr = await this.
|
|
81201
|
+
const masterXmlStr = await this.readPartText(masterPath);
|
|
81098
81202
|
if (!masterXmlStr) {
|
|
81099
81203
|
return [];
|
|
81100
81204
|
}
|
|
@@ -81245,7 +81349,7 @@ var PptxHandlerRuntime78 = class extends PptxHandlerRuntime77 {
|
|
|
81245
81349
|
}
|
|
81246
81350
|
const partPath = part.path;
|
|
81247
81351
|
rememberMasterPartBackground(this, partPath, part.backgroundColor);
|
|
81248
|
-
const xml = await this.
|
|
81352
|
+
const xml = await this.readPartText(partPath);
|
|
81249
81353
|
if (!xml) {
|
|
81250
81354
|
return;
|
|
81251
81355
|
}
|
|
@@ -81396,7 +81500,7 @@ var PptxHandlerRuntime79 = class extends PptxHandlerRuntime78 {
|
|
|
81396
81500
|
}
|
|
81397
81501
|
const layoutToken = layoutPath.split("/").pop()?.replace(/\.xml$/u, "") ?? layoutPath;
|
|
81398
81502
|
try {
|
|
81399
|
-
const layoutXmlStr = await this.
|
|
81503
|
+
const layoutXmlStr = await this.readPartText(layoutPath);
|
|
81400
81504
|
if (!layoutXmlStr) {
|
|
81401
81505
|
return [];
|
|
81402
81506
|
}
|
|
@@ -82109,7 +82213,7 @@ var PptxHandlerRuntime82 = class extends PptxHandlerRuntime81 {
|
|
|
82109
82213
|
return cached;
|
|
82110
82214
|
}
|
|
82111
82215
|
try {
|
|
82112
|
-
const overrideXml = await this.
|
|
82216
|
+
const overrideXml = await this.readPartText(overridePath);
|
|
82113
82217
|
if (!overrideXml) {
|
|
82114
82218
|
return null;
|
|
82115
82219
|
}
|
|
@@ -82706,10 +82810,7 @@ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
|
|
|
82706
82810
|
if (!relsXml) {
|
|
82707
82811
|
return void 0;
|
|
82708
82812
|
}
|
|
82709
|
-
const relsData = this.
|
|
82710
|
-
// eslint-disable-next-line no-await-in-loop
|
|
82711
|
-
await relsXml.async("string")
|
|
82712
|
-
);
|
|
82813
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
82713
82814
|
const relNodes = this.ensureArray(
|
|
82714
82815
|
relsData?.Relationships?.Relationship
|
|
82715
82816
|
);
|
|
@@ -82735,7 +82836,7 @@ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
|
|
|
82735
82836
|
const options = [];
|
|
82736
82837
|
for (const file of themeFiles) {
|
|
82737
82838
|
try {
|
|
82738
|
-
const xml = await file.
|
|
82839
|
+
const xml = await this.readPartText(file.name) ?? "";
|
|
82739
82840
|
const data = this.parser.parse(xml);
|
|
82740
82841
|
const root = data["a:theme"];
|
|
82741
82842
|
const name = String(root?.["@_name"] || "").trim();
|
|
@@ -82815,7 +82916,7 @@ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
|
|
|
82815
82916
|
];
|
|
82816
82917
|
for (const file of masterFiles) {
|
|
82817
82918
|
try {
|
|
82818
|
-
const masterXml = await file.
|
|
82919
|
+
const masterXml = await this.readPartText(file.name) ?? "";
|
|
82819
82920
|
const masterData = this.parser.parse(masterXml);
|
|
82820
82921
|
const clrMap = masterData?.["p:sldMaster"]?.["p:clrMap"];
|
|
82821
82922
|
if (!clrMap) {
|
|
@@ -82848,7 +82949,7 @@ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
|
|
|
82848
82949
|
if (!themeFile) {
|
|
82849
82950
|
return null;
|
|
82850
82951
|
}
|
|
82851
|
-
const themeXml3 = await
|
|
82952
|
+
const themeXml3 = await this.readPartText(themePath) ?? "";
|
|
82852
82953
|
const model = this.parseThemePartXml(themeXml3);
|
|
82853
82954
|
this.cacheThemePartModel(themePath, themeXml3, model);
|
|
82854
82955
|
return { colorMap: model.colorMap, fontMap: model.fontMap, formatScheme: model.formatScheme };
|
|
@@ -82883,7 +82984,7 @@ var PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
|
|
|
82883
82984
|
if (!relsXml) {
|
|
82884
82985
|
return void 0;
|
|
82885
82986
|
}
|
|
82886
|
-
const relsData =
|
|
82987
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
82887
82988
|
const relNodes = this.ensureArray(
|
|
82888
82989
|
relsData?.Relationships?.Relationship
|
|
82889
82990
|
);
|
|
@@ -83190,11 +83291,10 @@ var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
83190
83291
|
async extractModernSlideComments(slidePath) {
|
|
83191
83292
|
try {
|
|
83192
83293
|
const relsPath2 = `${slidePath.replace("slides/", "slides/_rels/")}.rels`;
|
|
83193
|
-
const
|
|
83194
|
-
if (!
|
|
83294
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
83295
|
+
if (!relsData) {
|
|
83195
83296
|
return [];
|
|
83196
83297
|
}
|
|
83197
|
-
const relsData = this.parser.parse(relsXml);
|
|
83198
83298
|
const rels = this.ensureArray(
|
|
83199
83299
|
chunk36TR3PER_cjs.xmlChild(relsData, "Relationships")?.Relationship
|
|
83200
83300
|
);
|
|
@@ -83211,7 +83311,7 @@ var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
83211
83311
|
continue;
|
|
83212
83312
|
}
|
|
83213
83313
|
const filePath = this.resolvePath(slidePath, target);
|
|
83214
|
-
const xml = await this.
|
|
83314
|
+
const xml = await this.readPartText(filePath);
|
|
83215
83315
|
if (!xml) {
|
|
83216
83316
|
continue;
|
|
83217
83317
|
}
|
|
@@ -83234,11 +83334,10 @@ var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
83234
83334
|
return [];
|
|
83235
83335
|
}
|
|
83236
83336
|
async loadModernCommentAuthors() {
|
|
83237
|
-
const
|
|
83238
|
-
if (!
|
|
83337
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
83338
|
+
if (!relsData) {
|
|
83239
83339
|
return;
|
|
83240
83340
|
}
|
|
83241
|
-
const relsData = this.parser.parse(relsXml);
|
|
83242
83341
|
const relationships2 = this.ensureArray(
|
|
83243
83342
|
chunk36TR3PER_cjs.xmlChild(relsData, "Relationships")?.Relationship
|
|
83244
83343
|
);
|
|
@@ -83250,7 +83349,7 @@ var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
83250
83349
|
return;
|
|
83251
83350
|
}
|
|
83252
83351
|
const partPath = this.resolvePath("ppt/presentation.xml", target);
|
|
83253
|
-
const xml = await this.
|
|
83352
|
+
const xml = await this.readPartText(partPath);
|
|
83254
83353
|
if (!xml) {
|
|
83255
83354
|
return;
|
|
83256
83355
|
}
|
|
@@ -83276,12 +83375,12 @@ var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
83276
83375
|
}
|
|
83277
83376
|
}
|
|
83278
83377
|
const relsPath2 = `${slidePath.replace("slides/", "slides/_rels/")}.rels`;
|
|
83279
|
-
const relsXml = await this.
|
|
83378
|
+
const relsXml = await this.readPartText(relsPath2);
|
|
83280
83379
|
if (!relsXml) {
|
|
83281
83380
|
return void 0;
|
|
83282
83381
|
}
|
|
83283
83382
|
try {
|
|
83284
|
-
const relsData = this.
|
|
83383
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
83285
83384
|
const rels = this.ensureArray(
|
|
83286
83385
|
chunk36TR3PER_cjs.xmlChild(relsData, "Relationships")?.Relationship
|
|
83287
83386
|
);
|
|
@@ -83320,7 +83419,7 @@ var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
83320
83419
|
return [];
|
|
83321
83420
|
}
|
|
83322
83421
|
const commentsPath = this.resolveImagePath(slidePath, commentTarget);
|
|
83323
|
-
const commentsXml = await this.
|
|
83422
|
+
const commentsXml = await this.readPartText(commentsPath);
|
|
83324
83423
|
if (!commentsXml) {
|
|
83325
83424
|
return [];
|
|
83326
83425
|
}
|
|
@@ -83355,7 +83454,7 @@ var PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
|
|
|
83355
83454
|
}
|
|
83356
83455
|
}
|
|
83357
83456
|
async loadCommentAuthors() {
|
|
83358
|
-
const commentAuthorsXml = await this.
|
|
83457
|
+
const commentAuthorsXml = await this.readPartText("ppt/commentAuthors.xml");
|
|
83359
83458
|
if (!commentAuthorsXml) {
|
|
83360
83459
|
return;
|
|
83361
83460
|
}
|
|
@@ -83417,7 +83516,7 @@ var PptxHandlerRuntime89 = class extends PptxHandlerRuntime88 {
|
|
|
83417
83516
|
return void 0;
|
|
83418
83517
|
}
|
|
83419
83518
|
const partPath = this.resolveImagePath(slidePath, target);
|
|
83420
|
-
const xmlString = await this.
|
|
83519
|
+
const xmlString = await this.readPartText(partPath);
|
|
83421
83520
|
if (!xmlString) {
|
|
83422
83521
|
return void 0;
|
|
83423
83522
|
}
|
|
@@ -85029,9 +85128,8 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
|
|
|
85029
85128
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
85030
85129
|
const chartFileName = chartPartPath.substring(chartPartPath.lastIndexOf("/") + 1);
|
|
85031
85130
|
const chartRelsPath = `${chartDir}_rels/${chartFileName}.rels`;
|
|
85032
|
-
const
|
|
85033
|
-
if (
|
|
85034
|
-
const chartRelsData = this.parser.parse(chartRelsXml);
|
|
85131
|
+
const chartRelsData = await this.readPartXml(chartRelsPath);
|
|
85132
|
+
if (chartRelsData) {
|
|
85035
85133
|
const relsContainer = chartRelsData?.Relationships;
|
|
85036
85134
|
if (relsContainer?.Relationship) {
|
|
85037
85135
|
const rels = Array.isArray(relsContainer.Relationship) ? relsContainer.Relationship : [relsContainer.Relationship];
|
|
@@ -85113,7 +85211,7 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
|
|
|
85113
85211
|
if (drawingPath.length === 0) {
|
|
85114
85212
|
return void 0;
|
|
85115
85213
|
}
|
|
85116
|
-
const drawingXml = await this.
|
|
85214
|
+
const drawingXml = await this.readPartText(drawingPath);
|
|
85117
85215
|
if (!drawingXml) {
|
|
85118
85216
|
return void 0;
|
|
85119
85217
|
}
|
|
@@ -85134,11 +85232,10 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
|
|
|
85134
85232
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
85135
85233
|
const chartFileName = chartPartPath.substring(chartPartPath.lastIndexOf("/") + 1);
|
|
85136
85234
|
const chartRelsPath = `${chartDir}_rels/${chartFileName}.rels`;
|
|
85137
|
-
const
|
|
85138
|
-
if (!
|
|
85235
|
+
const chartRelsData = await this.readPartXml(chartRelsPath);
|
|
85236
|
+
if (!chartRelsData) {
|
|
85139
85237
|
return [];
|
|
85140
85238
|
}
|
|
85141
|
-
const chartRelsData = this.parser.parse(chartRelsXml);
|
|
85142
85239
|
const relsContainer = chartRelsData?.Relationships;
|
|
85143
85240
|
if (!relsContainer?.Relationship) {
|
|
85144
85241
|
return [];
|
|
@@ -85967,11 +86064,10 @@ var PptxHandlerRuntime99 = class extends PptxHandlerRuntime98 {
|
|
|
85967
86064
|
async loadPresentationFontRels() {
|
|
85968
86065
|
const map = /* @__PURE__ */ new Map();
|
|
85969
86066
|
try {
|
|
85970
|
-
const
|
|
85971
|
-
if (!
|
|
86067
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
86068
|
+
if (!relsData) {
|
|
85972
86069
|
return map;
|
|
85973
86070
|
}
|
|
85974
|
-
const relsData = this.parser.parse(relsXml);
|
|
85975
86071
|
const rels = this.ensureArray(
|
|
85976
86072
|
chunk36TR3PER_cjs.xmlChild(relsData, "Relationships")?.Relationship
|
|
85977
86073
|
);
|
|
@@ -86281,13 +86377,13 @@ var PptxHandlerRuntime100 = class _PptxHandlerRuntime extends PptxHandlerRuntime
|
|
|
86281
86377
|
if (!file) {
|
|
86282
86378
|
continue;
|
|
86283
86379
|
}
|
|
86284
|
-
const data = await
|
|
86380
|
+
const data = await this.readPartText(entry2) ?? "";
|
|
86285
86381
|
const propsPath = `customXml/itemProps${itemId}.xml`;
|
|
86286
86382
|
const propsFile = this.zip.file(propsPath);
|
|
86287
86383
|
let properties;
|
|
86288
86384
|
let schemaUri;
|
|
86289
86385
|
if (propsFile) {
|
|
86290
|
-
properties = await
|
|
86386
|
+
properties = await this.readPartText(propsPath) ?? "";
|
|
86291
86387
|
try {
|
|
86292
86388
|
const propsData = this.parser.parse(properties);
|
|
86293
86389
|
const schemaRefs = propsData?.["ds:datastoreItem"]?.["ds:schemaRefs"]?.["ds:schemaRef"];
|
|
@@ -86307,14 +86403,14 @@ var PptxHandlerRuntime100 = class _PptxHandlerRuntime extends PptxHandlerRuntime
|
|
|
86307
86403
|
const relsFile = this.zip.file(relsPath2);
|
|
86308
86404
|
let rels;
|
|
86309
86405
|
if (relsFile) {
|
|
86310
|
-
rels = await
|
|
86406
|
+
rels = await this.readPartText(relsPath2);
|
|
86311
86407
|
}
|
|
86312
86408
|
parts.push({ id: itemId, data, schemaUri, properties, rels });
|
|
86313
86409
|
}
|
|
86314
86410
|
this.customXmlParts = parts;
|
|
86315
86411
|
}
|
|
86316
86412
|
async loadPresentationState() {
|
|
86317
|
-
const presentationXml3 = await this.
|
|
86413
|
+
const presentationXml3 = await this.readPartText("ppt/presentation.xml");
|
|
86318
86414
|
if (!presentationXml3) {
|
|
86319
86415
|
throw new Error("Invalid PPTX: presentation.xml not found");
|
|
86320
86416
|
}
|
|
@@ -86648,6 +86744,7 @@ var PptxHandlerRuntime101 = class extends PptxHandlerRuntime100 {
|
|
|
86648
86744
|
* or resolve images. Create a new `PptxHandler` instance instead.
|
|
86649
86745
|
*/
|
|
86650
86746
|
dispose() {
|
|
86747
|
+
this.endPartReads();
|
|
86651
86748
|
this.revokeBlobUrls();
|
|
86652
86749
|
this.imageDataCache.clear();
|
|
86653
86750
|
this.slideMap.clear();
|
|
@@ -86681,18 +86778,24 @@ var PptxHandlerRuntime101 = class extends PptxHandlerRuntime100 {
|
|
|
86681
86778
|
this.zip = null;
|
|
86682
86779
|
}
|
|
86683
86780
|
async load(data, options = {}) {
|
|
86684
|
-
|
|
86685
|
-
|
|
86686
|
-
|
|
86687
|
-
|
|
86688
|
-
|
|
86689
|
-
|
|
86690
|
-
|
|
86691
|
-
|
|
86692
|
-
|
|
86693
|
-
|
|
86694
|
-
|
|
86695
|
-
|
|
86781
|
+
let reader;
|
|
86782
|
+
try {
|
|
86783
|
+
await this.initializeLoadSession(data, options);
|
|
86784
|
+
reader = this.beginPartReads();
|
|
86785
|
+
await this.detectAndPreserveVbaProject();
|
|
86786
|
+
this.detectDigitalSignatureParts();
|
|
86787
|
+
await this.parseCustomXmlParts();
|
|
86788
|
+
const presentationState = await this.loadPresentationState();
|
|
86789
|
+
const slideMasters = await this.parseSlideMasters();
|
|
86790
|
+
await this.enrichSlideMastersWithTxStyles(slideMasters);
|
|
86791
|
+
const slides = await this.loadSlidesForPresentation(presentationState.sectionBySlideId);
|
|
86792
|
+
const slidesWithWarnings = this.attachSlideWarnings(slides);
|
|
86793
|
+
this.resetElementIdCounter(slides);
|
|
86794
|
+
recordSlideFingerprints(this.savedSlideFingerprints, slidesWithWarnings);
|
|
86795
|
+
return await this.buildLoadData(presentationState, slidesWithWarnings, slideMasters);
|
|
86796
|
+
} finally {
|
|
86797
|
+
this.endPartReads(reader);
|
|
86798
|
+
}
|
|
86696
86799
|
}
|
|
86697
86800
|
/**
|
|
86698
86801
|
* Retrieve the current background colour for a layout or master.
|
|
@@ -86831,7 +86934,7 @@ var PptxHandlerRuntime101 = class extends PptxHandlerRuntime100 {
|
|
|
86831
86934
|
options.push(this.buildLayoutOption(lp, xmlObj));
|
|
86832
86935
|
} else {
|
|
86833
86936
|
try {
|
|
86834
|
-
const layoutXmlStr = await this.
|
|
86937
|
+
const layoutXmlStr = await this.readPartText(lp);
|
|
86835
86938
|
if (layoutXmlStr) {
|
|
86836
86939
|
const layoutXmlObj = this.parser.parse(layoutXmlStr);
|
|
86837
86940
|
this.layoutXmlMap.set(lp, layoutXmlObj);
|
|
@@ -86874,7 +86977,7 @@ var PptxHandlerRuntime101 = class extends PptxHandlerRuntime100 {
|
|
|
86874
86977
|
}
|
|
86875
86978
|
let layoutXml3 = this.layoutXmlMap.get(layoutPath);
|
|
86876
86979
|
if (!layoutXml3) {
|
|
86877
|
-
const layoutXmlStr = await this.
|
|
86980
|
+
const layoutXmlStr = await this.readPartText(layoutPath);
|
|
86878
86981
|
if (!layoutXmlStr) {
|
|
86879
86982
|
throw new Error(`Layout not found: ${layoutPath}`);
|
|
86880
86983
|
}
|