ooxml-core 1.19.0 → 1.19.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-5GBBVJCR.mjs → PptxHandler-2V4PQL6O.mjs} +2 -2
- package/dist/{PptxHandler-ZHPGBSAF.cjs → PptxHandler-6TNIQ7S5.cjs} +2 -2
- package/dist/{PptxHandler-H43MAMTO.mjs → PptxHandler-HSPKEP5E.mjs} +1 -1
- package/dist/{PresentationBuilder-7ZSUKCX5.mjs → PresentationBuilder-G7MPEGXJ.mjs} +1 -1
- package/dist/{PresentationBuilder-IJW42L3R.mjs → PresentationBuilder-HQ6C7L4V.mjs} +2 -2
- package/dist/{PresentationBuilder-O4H4MMWB.cjs → PresentationBuilder-RM52LCVN.cjs} +4 -4
- package/dist/automation/index.cjs +167 -60
- package/dist/automation/index.mjs +167 -60
- package/dist/automation/node.cjs +2 -1
- package/dist/automation/node.d.ts.map +1 -1
- package/dist/automation/node.mjs +2 -1
- package/dist/{chunk-D4GBMBG6.mjs → chunk-365VXA3X.mjs} +1 -1
- package/dist/{chunk-3XFPCZKB.mjs → chunk-4FTUAD2B.mjs} +20 -5
- package/dist/{chunk-PLWRGPRH.mjs → chunk-4YDPRQRH.mjs} +145 -96
- package/dist/{chunk-QXDWDDLN.mjs → chunk-6UV3JVB3.mjs} +1 -1
- package/dist/{chunk-3ATTMOYZ.mjs → chunk-7FPQ7LGN.mjs} +1 -1
- package/dist/{chunk-7WCCQKV2.mjs → chunk-7I7CMDUZ.mjs} +1 -1
- package/dist/{chunk-KZ6UTEES.mjs → chunk-E6WNB3JX.mjs} +1 -1
- package/dist/{chunk-SPG7WICG.mjs → chunk-EDRS3OSM.mjs} +1 -1
- package/dist/{chunk-VXLBSKZ6.mjs → chunk-GKLDCQLY.mjs} +1 -1
- package/dist/{chunk-ITQNJLJW.mjs → chunk-ILG6NKXV.mjs} +1 -1
- package/dist/{chunk-OXZUJR7O.mjs → chunk-J3PD5JWS.mjs} +1 -1
- package/dist/{chunk-QBJRB6WW.mjs → chunk-JUABSM7C.mjs} +1 -1
- package/dist/{chunk-5GBNB7VU.mjs → chunk-LMDNFNZJ.mjs} +1 -1
- package/dist/{chunk-BIVNVDAH.mjs → chunk-M6GDBVQ7.mjs} +1 -1
- package/dist/{chunk-4SMQRUUE.mjs → chunk-MZP6H7QY.mjs} +1 -1
- package/dist/{chunk-KCALUCYU.mjs → chunk-NIGOXRUP.mjs} +1 -1
- package/dist/{chunk-VB7NKWZH.mjs → chunk-P37EWZBC.mjs} +1 -1
- package/dist/{chunk-VD3XNFJH.mjs → chunk-PIOG7ZFF.mjs} +1 -1
- package/dist/{chunk-MHMVD23Y.cjs → chunk-R5FIHHGB.cjs} +33 -13
- package/dist/{chunk-4EUHK4OA.mjs → chunk-RRQFRNPQ.mjs} +1 -1
- package/dist/{chunk-AXDQEOYK.mjs → chunk-S3E6XBOU.mjs} +1 -1
- package/dist/{chunk-RUZEMWDI.mjs → chunk-SLNQNVQM.mjs} +1 -1
- package/dist/{chunk-75GLSRZE.mjs → chunk-TJPUAUWL.mjs} +4 -4
- package/dist/{chunk-53GW7NSV.mjs → chunk-UFZZESXL.mjs} +1 -1
- package/dist/{chunk-4JGKTRLH.mjs → chunk-X45XTEMI.mjs} +1 -1
- package/dist/{chunk-DUSAQQTU.mjs → chunk-YIXIC3TR.mjs} +1 -1
- package/dist/{chunk-YSKKMXDL.mjs → chunk-ZDD2RZGB.mjs} +1 -1
- package/dist/{chunk-H6TNNXJK.mjs → chunk-ZJ2OKIJN.mjs} +33 -13
- package/dist/docx/embedded.cjs +4 -1
- package/dist/docx/embedded.mjs +4 -1
- package/dist/docx/index.cjs +4 -1
- package/dist/docx/index.mjs +4 -1
- package/dist/docx/load/index.cjs +4 -1
- package/dist/docx/load/index.mjs +4 -1
- package/dist/docx/write-table.d.ts.map +1 -1
- package/dist/pptx/automation/index.cjs +35 -14
- package/dist/pptx/automation/index.d.ts +2 -2
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/automation/schemas/chart-formatting-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-formatting-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/chart-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/chart-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/element-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/element-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/element-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/element-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/export-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/export-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/export-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/export-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/geometry-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/hyperlink-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/index.cjs +145 -96
- package/dist/pptx/automation/schemas/index.mjs +21 -21
- package/dist/pptx/automation/schemas/json-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/json-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/json-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/json-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/layout-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/layout-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/lock-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/lock-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/metadata-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/ole-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/ole-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/presentation-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/section-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/section-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/section-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/section-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/slide-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/slide-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/smartart-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/table-style-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/template-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/template-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/template-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/template-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/theme-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/theme-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/validation-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/validation-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.mjs +2 -2
- package/dist/pptx/chunks/{index-CiyTR6mm.d.ts → index-B9x557hr.d.ts} +3 -2
- package/dist/pptx/chunks/{index-CiyTR6mm.d.ts.map → index-B9x557hr.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-BWHNCVNC.d.ts → index-Bqm-jFG-.d.ts} +3 -4
- package/dist/pptx/chunks/{index-BWHNCVNC.d.ts.map → index-Bqm-jFG-.d.ts.map} +1 -1
- package/dist/pptx/chunks/schemas-CWr181Wx.d.ts +2186 -0
- package/dist/pptx/chunks/schemas-CWr181Wx.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +35 -14
- 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/loader/table-style-image-paths.d.ts +1 -0
- package/dist/pptx/editor/render/collaboration-text-native-edit.d.ts +1 -0
- package/dist/pptx/editor/render/collaboration-text-session-paragraph.d.ts +1 -0
- package/dist/pptx/editor/render/collaboration-text-snapshot-positions.d.ts.map +1 -1
- 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 +30 -6
- package/dist/pptx/index.d.ts +2 -2
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/ui/index.d.ts +1 -0
- package/dist/xlsx/edit/row-autofit.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +145 -38
- package/dist/xlsx/index.mjs +145 -38
- package/dist/xlsx/layout/merge-sweep.d.ts +36 -0
- package/dist/xlsx/layout/merge-sweep.d.ts.map +1 -0
- package/dist/xlsx/layout/metrics.d.ts +5 -0
- package/dist/xlsx/layout/metrics.d.ts.map +1 -1
- package/dist/xlsx/layout/row-autofit.d.ts +6 -0
- package/dist/xlsx/layout/row-autofit.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +143 -39
- package/dist/xlsx/ui/index.mjs +143 -39
- package/package.json +9 -9
- package/dist/pptx/chunks/external-DQ3B4V-o.d.ts +0 -4275
- package/dist/pptx/chunks/external-DQ3B4V-o.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasTextProperties, isImageLikeElement, blobUrlToDataUrl, getSubstituteFontFamily, stripXmlOrderSuffix } from './chunk-
|
|
1
|
+
import { hasTextProperties, isImageLikeElement, blobUrlToDataUrl, getSubstituteFontFamily, stripXmlOrderSuffix } from './chunk-SLNQNVQM.mjs';
|
|
2
2
|
|
|
3
3
|
// pptx/converter/media-context.ts
|
|
4
4
|
var MIME_TO_EXT = {
|
|
@@ -894,6 +894,11 @@ function relationshipsPartFor(partName) {
|
|
|
894
894
|
const slash = partName.lastIndexOf("/");
|
|
895
895
|
return `${partName.slice(0, slash + 1)}_rels/${partName.slice(slash + 1)}.rels`;
|
|
896
896
|
}
|
|
897
|
+
function nextRelationshipId(used) {
|
|
898
|
+
let index = 1;
|
|
899
|
+
while (used.has(`rId${index}`)) index++;
|
|
900
|
+
return `rId${index}`;
|
|
901
|
+
}
|
|
897
902
|
|
|
898
903
|
// opc/content-types.ts
|
|
899
904
|
function parseContentTypes(xml) {
|
|
@@ -3493,7 +3498,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
3493
3498
|
}
|
|
3494
3499
|
staticRelationships.push(relationship);
|
|
3495
3500
|
}
|
|
3496
|
-
const
|
|
3501
|
+
const nextRelationshipId5 = () => {
|
|
3497
3502
|
let index = 1;
|
|
3498
3503
|
while (usedRIds.has(`rId${index}`)) {
|
|
3499
3504
|
index += 1;
|
|
@@ -3537,7 +3542,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
3537
3542
|
const existingSlideXml = input.slideMap.get(slide.id);
|
|
3538
3543
|
if (existingSlideXml) {
|
|
3539
3544
|
if (!slide.rId || slide.rId.length === 0 || !slideTargetByRid.has(slide.rId)) {
|
|
3540
|
-
slide.rId =
|
|
3545
|
+
slide.rId = nextRelationshipId5();
|
|
3541
3546
|
} else {
|
|
3542
3547
|
usedRIds.add(slide.rId);
|
|
3543
3548
|
}
|
|
@@ -3556,7 +3561,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
3556
3561
|
sourceSlidePath,
|
|
3557
3562
|
usedRIds,
|
|
3558
3563
|
slideTargetByRid,
|
|
3559
|
-
nextRelationshipId:
|
|
3564
|
+
nextRelationshipId: nextRelationshipId5
|
|
3560
3565
|
});
|
|
3561
3566
|
attachedPaths.set(originalId, slide.id);
|
|
3562
3567
|
}
|
|
@@ -43486,7 +43491,7 @@ function saveModernSlideComments(init) {
|
|
|
43486
43491
|
rawXml: init.slide.modernCommentPart?.rawXml
|
|
43487
43492
|
};
|
|
43488
43493
|
}
|
|
43489
|
-
var
|
|
43494
|
+
var nextRelationshipId2 = (relationships2) => {
|
|
43490
43495
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] || "")));
|
|
43491
43496
|
let index = 1;
|
|
43492
43497
|
while (used.has(`rId${index}`)) {
|
|
@@ -43529,7 +43534,7 @@ async function persistModernCommentPackage(init) {
|
|
|
43529
43534
|
authorPath,
|
|
43530
43535
|
init.xmlBuilder.build(buildModernAuthorPart(init.authors, init.authorRoot))
|
|
43531
43536
|
);
|
|
43532
|
-
relationshipId = init.authorRelationshipId || String(existing?.["@_Id"] || "") ||
|
|
43537
|
+
relationshipId = init.authorRelationshipId || String(existing?.["@_Id"] || "") || nextRelationshipId2(retained);
|
|
43533
43538
|
retained.push({
|
|
43534
43539
|
...existing || {},
|
|
43535
43540
|
"@_Id": relationshipId,
|
|
@@ -50819,7 +50824,7 @@ function upsertRelationship(relationships2, entry2, target) {
|
|
|
50819
50824
|
(item) => String(item["@_Id"] ?? "") === entry2.relId && isCustomXmlRelationship(item["@_Type"])
|
|
50820
50825
|
);
|
|
50821
50826
|
if (!relationship) {
|
|
50822
|
-
entry2.relId =
|
|
50827
|
+
entry2.relId = nextRelationshipId3(relationships2);
|
|
50823
50828
|
relationship = {};
|
|
50824
50829
|
relationships2.push(relationship);
|
|
50825
50830
|
}
|
|
@@ -50887,7 +50892,7 @@ function relativeTarget2(source, target) {
|
|
|
50887
50892
|
}
|
|
50888
50893
|
return [...from.map(() => ".."), ...to].join("/");
|
|
50889
50894
|
}
|
|
50890
|
-
function
|
|
50895
|
+
function nextRelationshipId3(relationships2) {
|
|
50891
50896
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] ?? "")));
|
|
50892
50897
|
let index = 1;
|
|
50893
50898
|
while (used.has(`rId${index}`)) {
|
|
@@ -51133,7 +51138,7 @@ async function upsertTagRelationship(zip, codec, collection) {
|
|
|
51133
51138
|
(entry2) => String(entry2["@_Id"] ?? "") === collection.relationshipId && String(entry2["@_Type"] ?? "") === TAG_RELATIONSHIP_TYPE
|
|
51134
51139
|
);
|
|
51135
51140
|
if (!relationship) {
|
|
51136
|
-
collection.relationshipId =
|
|
51141
|
+
collection.relationshipId = nextRelationshipId4(relationships2);
|
|
51137
51142
|
relationship = {};
|
|
51138
51143
|
relationships2.push(relationship);
|
|
51139
51144
|
}
|
|
@@ -51192,7 +51197,7 @@ function relativeTarget3(source, target) {
|
|
|
51192
51197
|
}
|
|
51193
51198
|
return [...from.map(() => ".."), ...to].join("/");
|
|
51194
51199
|
}
|
|
51195
|
-
function
|
|
51200
|
+
function nextRelationshipId4(relationships2) {
|
|
51196
51201
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] ?? "")));
|
|
51197
51202
|
let index = 1;
|
|
51198
51203
|
while (used.has(`rId${index}`)) {
|
|
@@ -73102,8 +73107,11 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
73102
73107
|
);
|
|
73103
73108
|
} else if (!keepSourceAuthors) {
|
|
73104
73109
|
this.zip.remove("ppt/commentAuthors.xml");
|
|
73105
|
-
await this.stripPresentationCommentAuthorsRelationship();
|
|
73106
73110
|
}
|
|
73111
|
+
await this.updatePresentationCommentAuthorsRelationship(
|
|
73112
|
+
hasCommentAuthors,
|
|
73113
|
+
slideRelationshipType.replace(/\/slide$/, "/commentAuthors")
|
|
73114
|
+
);
|
|
73107
73115
|
const contentTypesXmlAfterComments = await this.zip.file("[Content_Types].xml")?.async("string");
|
|
73108
73116
|
if (contentTypesXmlAfterComments) {
|
|
73109
73117
|
const contentTypesData = this.parser.parse(contentTypesXmlAfterComments);
|
|
@@ -73289,10 +73297,9 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
73289
73297
|
}
|
|
73290
73298
|
}
|
|
73291
73299
|
/**
|
|
73292
|
-
*
|
|
73293
|
-
* the Transitional or Strict commentAuthors relationship URI.
|
|
73300
|
+
* Keep the authors part linked, or remove its relationship with the part.
|
|
73294
73301
|
*/
|
|
73295
|
-
async
|
|
73302
|
+
async updatePresentationCommentAuthorsRelationship(hasAuthors, relationshipType) {
|
|
73296
73303
|
const relsPath2 = "ppt/_rels/presentation.xml.rels";
|
|
73297
73304
|
const relsXml = await this.zip.file(relsPath2)?.async("string");
|
|
73298
73305
|
if (!relsXml) {
|
|
@@ -73308,6 +73315,19 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
73308
73315
|
const type = String(relationship?.["@_Type"] ?? "");
|
|
73309
73316
|
return type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors" && type !== "http://purl.oclc.org/ooxml/officeDocument/relationships/commentAuthors";
|
|
73310
73317
|
});
|
|
73318
|
+
if (hasAuthors) {
|
|
73319
|
+
if (filtered.length === relationships2.length) {
|
|
73320
|
+
const usedIds = new Set(relationships2.map((rel) => String(rel["@_Id"] ?? "")));
|
|
73321
|
+
relationships2.push({
|
|
73322
|
+
"@_Id": nextRelationshipId(usedIds),
|
|
73323
|
+
"@_Type": relationshipType,
|
|
73324
|
+
"@_Target": "commentAuthors.xml"
|
|
73325
|
+
});
|
|
73326
|
+
root["Relationship"] = relationships2;
|
|
73327
|
+
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
73328
|
+
}
|
|
73329
|
+
return;
|
|
73330
|
+
}
|
|
73311
73331
|
if (filtered.length === relationships2.length) {
|
|
73312
73332
|
return;
|
|
73313
73333
|
}
|
|
@@ -21818,7 +21818,7 @@ function findTextBearingElementById(elements3, elementId) {
|
|
|
21818
21818
|
}
|
|
21819
21819
|
async function loadNestedDeck(pptxBytes) {
|
|
21820
21820
|
try {
|
|
21821
|
-
const { PptxHandler } = await import('./PptxHandler-
|
|
21821
|
+
const { PptxHandler } = await import('./PptxHandler-2V4PQL6O.mjs');
|
|
21822
21822
|
const handler = new PptxHandler();
|
|
21823
21823
|
const data = await handler.load(pptxBytes.buffer.slice(0));
|
|
21824
21824
|
return { handler, slides: data.slides };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-
|
|
2
|
-
import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, isLineDrawnChartType, chartFormatTargetKey, applyChartGroupOptionsInput, STANDARD_LAYOUTS, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, relationshipsPartFor, parseRelationships, resolvePartPath, clonePartGraph, buildRelationshipsXml, buildBlankPresentationArchive, nextRelationshipId, relativePartTarget, PptxXmlBuilder } from './chunk-
|
|
3
|
-
import { escAttr, EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, elements, buildXml, bytesToBase64, base64ToBytes, hasTextProperties } from './chunk-
|
|
1
|
+
import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-JUABSM7C.mjs';
|
|
2
|
+
import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, isLineDrawnChartType, chartFormatTargetKey, applyChartGroupOptionsInput, STANDARD_LAYOUTS, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, relationshipsPartFor, parseRelationships, resolvePartPath, clonePartGraph, buildRelationshipsXml, buildBlankPresentationArchive, nextRelationshipId, relativePartTarget, PptxXmlBuilder } from './chunk-4FTUAD2B.mjs';
|
|
3
|
+
import { escAttr, EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, elements, buildXml, bytesToBase64, base64ToBytes, hasTextProperties } from './chunk-SLNQNVQM.mjs';
|
|
4
4
|
import { openPptxZip } from './chunk-M4XLF4R7.mjs';
|
|
5
5
|
import { cloneSlide, cloneElement } from './chunk-54S5A5PZ.mjs';
|
|
6
6
|
|
|
@@ -14957,7 +14957,7 @@ async function setPresentationRunText(bytes, slideIndex, elementId, runIndex, te
|
|
|
14957
14957
|
async function createPresentationFromOutline(slides, options = {}) {
|
|
14958
14958
|
if (!(slides instanceof Array) || !slides.length || slides.length > 200)
|
|
14959
14959
|
throw new Error("A presentation outline has 1 to 200 slides");
|
|
14960
|
-
const { PresentationBuilder: PresentationBuilder2 } = await import('./PresentationBuilder-
|
|
14960
|
+
const { PresentationBuilder: PresentationBuilder2 } = await import('./PresentationBuilder-HQ6C7L4V.mjs');
|
|
14961
14961
|
const { handler, data, createSlide } = await PresentationBuilder2.create({
|
|
14962
14962
|
...options.title ? { title: options.title } : {}
|
|
14963
14963
|
});
|
|
@@ -888,6 +888,11 @@ function relationshipsPartFor(partName) {
|
|
|
888
888
|
const slash = partName.lastIndexOf("/");
|
|
889
889
|
return `${partName.slice(0, slash + 1)}_rels/${partName.slice(slash + 1)}.rels`;
|
|
890
890
|
}
|
|
891
|
+
function nextRelationshipId(used) {
|
|
892
|
+
let index = 1;
|
|
893
|
+
while (used.has(`rId${index}`)) index++;
|
|
894
|
+
return `rId${index}`;
|
|
895
|
+
}
|
|
891
896
|
|
|
892
897
|
// opc/content-types.ts
|
|
893
898
|
function parseContentTypes(xml) {
|
|
@@ -3487,7 +3492,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
3487
3492
|
}
|
|
3488
3493
|
staticRelationships.push(relationship);
|
|
3489
3494
|
}
|
|
3490
|
-
const
|
|
3495
|
+
const nextRelationshipId5 = () => {
|
|
3491
3496
|
let index = 1;
|
|
3492
3497
|
while (usedRIds.has(`rId${index}`)) {
|
|
3493
3498
|
index += 1;
|
|
@@ -3531,7 +3536,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
3531
3536
|
const existingSlideXml = input.slideMap.get(slide.id);
|
|
3532
3537
|
if (existingSlideXml) {
|
|
3533
3538
|
if (!slide.rId || slide.rId.length === 0 || !slideTargetByRid.has(slide.rId)) {
|
|
3534
|
-
slide.rId =
|
|
3539
|
+
slide.rId = nextRelationshipId5();
|
|
3535
3540
|
} else {
|
|
3536
3541
|
usedRIds.add(slide.rId);
|
|
3537
3542
|
}
|
|
@@ -3550,7 +3555,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
3550
3555
|
sourceSlidePath,
|
|
3551
3556
|
usedRIds,
|
|
3552
3557
|
slideTargetByRid,
|
|
3553
|
-
nextRelationshipId:
|
|
3558
|
+
nextRelationshipId: nextRelationshipId5
|
|
3554
3559
|
});
|
|
3555
3560
|
attachedPaths.set(originalId, slide.id);
|
|
3556
3561
|
}
|
|
@@ -43480,7 +43485,7 @@ function saveModernSlideComments(init) {
|
|
|
43480
43485
|
rawXml: init.slide.modernCommentPart?.rawXml
|
|
43481
43486
|
};
|
|
43482
43487
|
}
|
|
43483
|
-
var
|
|
43488
|
+
var nextRelationshipId2 = (relationships2) => {
|
|
43484
43489
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] || "")));
|
|
43485
43490
|
let index = 1;
|
|
43486
43491
|
while (used.has(`rId${index}`)) {
|
|
@@ -43523,7 +43528,7 @@ async function persistModernCommentPackage(init) {
|
|
|
43523
43528
|
authorPath,
|
|
43524
43529
|
init.xmlBuilder.build(buildModernAuthorPart(init.authors, init.authorRoot))
|
|
43525
43530
|
);
|
|
43526
|
-
relationshipId = init.authorRelationshipId || String(existing?.["@_Id"] || "") ||
|
|
43531
|
+
relationshipId = init.authorRelationshipId || String(existing?.["@_Id"] || "") || nextRelationshipId2(retained);
|
|
43527
43532
|
retained.push({
|
|
43528
43533
|
...existing || {},
|
|
43529
43534
|
"@_Id": relationshipId,
|
|
@@ -50813,7 +50818,7 @@ function upsertRelationship(relationships2, entry2, target) {
|
|
|
50813
50818
|
(item) => String(item["@_Id"] ?? "") === entry2.relId && isCustomXmlRelationship(item["@_Type"])
|
|
50814
50819
|
);
|
|
50815
50820
|
if (!relationship) {
|
|
50816
|
-
entry2.relId =
|
|
50821
|
+
entry2.relId = nextRelationshipId3(relationships2);
|
|
50817
50822
|
relationship = {};
|
|
50818
50823
|
relationships2.push(relationship);
|
|
50819
50824
|
}
|
|
@@ -50881,7 +50886,7 @@ function relativeTarget2(source, target) {
|
|
|
50881
50886
|
}
|
|
50882
50887
|
return [...from.map(() => ".."), ...to].join("/");
|
|
50883
50888
|
}
|
|
50884
|
-
function
|
|
50889
|
+
function nextRelationshipId3(relationships2) {
|
|
50885
50890
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] ?? "")));
|
|
50886
50891
|
let index = 1;
|
|
50887
50892
|
while (used.has(`rId${index}`)) {
|
|
@@ -51127,7 +51132,7 @@ async function upsertTagRelationship(zip, codec, collection) {
|
|
|
51127
51132
|
(entry2) => String(entry2["@_Id"] ?? "") === collection.relationshipId && String(entry2["@_Type"] ?? "") === TAG_RELATIONSHIP_TYPE
|
|
51128
51133
|
);
|
|
51129
51134
|
if (!relationship) {
|
|
51130
|
-
collection.relationshipId =
|
|
51135
|
+
collection.relationshipId = nextRelationshipId4(relationships2);
|
|
51131
51136
|
relationship = {};
|
|
51132
51137
|
relationships2.push(relationship);
|
|
51133
51138
|
}
|
|
@@ -51186,7 +51191,7 @@ function relativeTarget3(source, target) {
|
|
|
51186
51191
|
}
|
|
51187
51192
|
return [...from.map(() => ".."), ...to].join("/");
|
|
51188
51193
|
}
|
|
51189
|
-
function
|
|
51194
|
+
function nextRelationshipId4(relationships2) {
|
|
51190
51195
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] ?? "")));
|
|
51191
51196
|
let index = 1;
|
|
51192
51197
|
while (used.has(`rId${index}`)) {
|
|
@@ -73096,8 +73101,11 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
73096
73101
|
);
|
|
73097
73102
|
} else if (!keepSourceAuthors) {
|
|
73098
73103
|
this.zip.remove("ppt/commentAuthors.xml");
|
|
73099
|
-
await this.stripPresentationCommentAuthorsRelationship();
|
|
73100
73104
|
}
|
|
73105
|
+
await this.updatePresentationCommentAuthorsRelationship(
|
|
73106
|
+
hasCommentAuthors,
|
|
73107
|
+
slideRelationshipType.replace(/\/slide$/, "/commentAuthors")
|
|
73108
|
+
);
|
|
73101
73109
|
const contentTypesXmlAfterComments = await this.zip.file("[Content_Types].xml")?.async("string");
|
|
73102
73110
|
if (contentTypesXmlAfterComments) {
|
|
73103
73111
|
const contentTypesData = this.parser.parse(contentTypesXmlAfterComments);
|
|
@@ -73283,10 +73291,9 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
73283
73291
|
}
|
|
73284
73292
|
}
|
|
73285
73293
|
/**
|
|
73286
|
-
*
|
|
73287
|
-
* the Transitional or Strict commentAuthors relationship URI.
|
|
73294
|
+
* Keep the authors part linked, or remove its relationship with the part.
|
|
73288
73295
|
*/
|
|
73289
|
-
async
|
|
73296
|
+
async updatePresentationCommentAuthorsRelationship(hasAuthors, relationshipType) {
|
|
73290
73297
|
const relsPath2 = "ppt/_rels/presentation.xml.rels";
|
|
73291
73298
|
const relsXml = await this.zip.file(relsPath2)?.async("string");
|
|
73292
73299
|
if (!relsXml) {
|
|
@@ -73302,6 +73309,19 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
73302
73309
|
const type = String(relationship?.["@_Type"] ?? "");
|
|
73303
73310
|
return type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors" && type !== "http://purl.oclc.org/ooxml/officeDocument/relationships/commentAuthors";
|
|
73304
73311
|
});
|
|
73312
|
+
if (hasAuthors) {
|
|
73313
|
+
if (filtered.length === relationships2.length) {
|
|
73314
|
+
const usedIds = new Set(relationships2.map((rel) => String(rel["@_Id"] ?? "")));
|
|
73315
|
+
relationships2.push({
|
|
73316
|
+
"@_Id": nextRelationshipId(usedIds),
|
|
73317
|
+
"@_Type": relationshipType,
|
|
73318
|
+
"@_Target": "commentAuthors.xml"
|
|
73319
|
+
});
|
|
73320
|
+
root["Relationship"] = relationships2;
|
|
73321
|
+
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
73322
|
+
}
|
|
73323
|
+
return;
|
|
73324
|
+
}
|
|
73305
73325
|
if (filtered.length === relationships2.length) {
|
|
73306
73326
|
return;
|
|
73307
73327
|
}
|
package/dist/docx/embedded.cjs
CHANGED
|
@@ -2833,7 +2833,10 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
|
|
|
2833
2833
|
"Cannot change the structure of a merged, nested, or complex table. The original DOCX package remains unchanged."
|
|
2834
2834
|
);
|
|
2835
2835
|
const width = table.rows[0]?.length ?? 0;
|
|
2836
|
-
|
|
2836
|
+
const reshaped = structural || !base;
|
|
2837
|
+
if (!width || table.rows.some(
|
|
2838
|
+
(row) => reshaped && row.length !== width || row.some((cell) => !cell.paragraphs.length)
|
|
2839
|
+
))
|
|
2837
2840
|
throw new Error("Tables must contain rectangular rows and at least one paragraph per cell.");
|
|
2838
2841
|
const oldRows = flatRows(node).map((entry2) => entry2.element);
|
|
2839
2842
|
const sourceById = /* @__PURE__ */ new Map();
|
package/dist/docx/embedded.mjs
CHANGED
|
@@ -2827,7 +2827,10 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
|
|
|
2827
2827
|
"Cannot change the structure of a merged, nested, or complex table. The original DOCX package remains unchanged."
|
|
2828
2828
|
);
|
|
2829
2829
|
const width = table.rows[0]?.length ?? 0;
|
|
2830
|
-
|
|
2830
|
+
const reshaped = structural || !base;
|
|
2831
|
+
if (!width || table.rows.some(
|
|
2832
|
+
(row) => reshaped && row.length !== width || row.some((cell) => !cell.paragraphs.length)
|
|
2833
|
+
))
|
|
2831
2834
|
throw new Error("Tables must contain rectangular rows and at least one paragraph per cell.");
|
|
2832
2835
|
const oldRows = flatRows(node).map((entry2) => entry2.element);
|
|
2833
2836
|
const sourceById = /* @__PURE__ */ new Map();
|
package/dist/docx/index.cjs
CHANGED
|
@@ -4088,7 +4088,10 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
|
|
|
4088
4088
|
"Cannot change the structure of a merged, nested, or complex table. The original DOCX package remains unchanged."
|
|
4089
4089
|
);
|
|
4090
4090
|
const width = table.rows[0]?.length ?? 0;
|
|
4091
|
-
|
|
4091
|
+
const reshaped = structural || !base;
|
|
4092
|
+
if (!width || table.rows.some(
|
|
4093
|
+
(row) => reshaped && row.length !== width || row.some((cell) => !cell.paragraphs.length)
|
|
4094
|
+
))
|
|
4092
4095
|
throw new Error("Tables must contain rectangular rows and at least one paragraph per cell.");
|
|
4093
4096
|
const oldRows = flatRows(node).map((entry2) => entry2.element);
|
|
4094
4097
|
const sourceById = /* @__PURE__ */ new Map();
|
package/dist/docx/index.mjs
CHANGED
|
@@ -4082,7 +4082,10 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
|
|
|
4082
4082
|
"Cannot change the structure of a merged, nested, or complex table. The original DOCX package remains unchanged."
|
|
4083
4083
|
);
|
|
4084
4084
|
const width = table.rows[0]?.length ?? 0;
|
|
4085
|
-
|
|
4085
|
+
const reshaped = structural || !base;
|
|
4086
|
+
if (!width || table.rows.some(
|
|
4087
|
+
(row) => reshaped && row.length !== width || row.some((cell) => !cell.paragraphs.length)
|
|
4088
|
+
))
|
|
4086
4089
|
throw new Error("Tables must contain rectangular rows and at least one paragraph per cell.");
|
|
4087
4090
|
const oldRows = flatRows(node).map((entry2) => entry2.element);
|
|
4088
4091
|
const sourceById = /* @__PURE__ */ new Map();
|
package/dist/docx/load/index.cjs
CHANGED
|
@@ -5417,7 +5417,10 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
|
|
|
5417
5417
|
"Cannot change the structure of a merged, nested, or complex table. The original DOCX package remains unchanged."
|
|
5418
5418
|
);
|
|
5419
5419
|
const width = table.rows[0]?.length ?? 0;
|
|
5420
|
-
|
|
5420
|
+
const reshaped = structural || !base;
|
|
5421
|
+
if (!width || table.rows.some(
|
|
5422
|
+
(row) => reshaped && row.length !== width || row.some((cell) => !cell.paragraphs.length)
|
|
5423
|
+
))
|
|
5421
5424
|
throw new Error("Tables must contain rectangular rows and at least one paragraph per cell.");
|
|
5422
5425
|
const oldRows = flatRows(node).map((entry2) => entry2.element);
|
|
5423
5426
|
const sourceById = /* @__PURE__ */ new Map();
|
package/dist/docx/load/index.mjs
CHANGED
|
@@ -5411,7 +5411,10 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
|
|
|
5411
5411
|
"Cannot change the structure of a merged, nested, or complex table. The original DOCX package remains unchanged."
|
|
5412
5412
|
);
|
|
5413
5413
|
const width = table.rows[0]?.length ?? 0;
|
|
5414
|
-
|
|
5414
|
+
const reshaped = structural || !base;
|
|
5415
|
+
if (!width || table.rows.some(
|
|
5416
|
+
(row) => reshaped && row.length !== width || row.some((cell) => !cell.paragraphs.length)
|
|
5417
|
+
))
|
|
5415
5418
|
throw new Error("Tables must contain rectangular rows and at least one paragraph per cell.");
|
|
5416
5419
|
const oldRows = flatRows(node).map((entry2) => entry2.element);
|
|
5417
5420
|
const sourceById = /* @__PURE__ */ new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-table.d.ts","sourceRoot":"","sources":["../../docx/write-table.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,SAAS,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AASlE,OAAO,EAA4C,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAEpG,KAAK,eAAe,GAAG,CACtB,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,SAAS,KACZ,UAAU,CAAC;AAChB,KAAK,WAAW,GAAG,CAClB,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,UAAU,EAAE,EACjB,IAAI,EAAE,UAAU,EAAE,KACd,IAAI,CAAC;AAEV,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAiChE;AA6ED,wBAAgB,UAAU,CACzB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,KAAK,GAAG,SAAS,EACvB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,WAAW,GACvB,UAAU,
|
|
1
|
+
{"version":3,"file":"write-table.d.ts","sourceRoot":"","sources":["../../docx/write-table.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,SAAS,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AASlE,OAAO,EAA4C,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAEpG,KAAK,eAAe,GAAG,CACtB,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,SAAS,KACZ,UAAU,CAAC;AAChB,KAAK,WAAW,GAAG,CAClB,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,UAAU,EAAE,EACjB,IAAI,EAAE,UAAU,EAAE,KACd,IAAI,CAAC;AAEV,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAiChE;AA6ED,wBAAgB,UAAU,CACzB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,KAAK,GAAG,SAAS,EACvB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,WAAW,GACvB,UAAU,CA+HZ"}
|