pptx-kit 0.2.0 → 0.4.0
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 +69 -0
- package/README.md +70 -34
- package/dist/index.d.ts +88 -6
- package/dist/index.js +336 -73
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +336 -73
- package/dist/node.js.map +1 -1
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -853,6 +853,50 @@ var detectImageFormat = (bytes) => {
|
|
|
853
853
|
if (/<svg[\s>]/.test(head)) return "svg";
|
|
854
854
|
return null;
|
|
855
855
|
};
|
|
856
|
+
var readUint16Be = (bytes, at) => bytes[at] << 8 | bytes[at + 1];
|
|
857
|
+
var readUint32Be = (bytes, at) => (
|
|
858
|
+
// `>>> 0` keeps the result an unsigned 32-bit int (a 4-byte PNG dimension
|
|
859
|
+
// with the high bit set would otherwise read as negative).
|
|
860
|
+
(bytes[at] << 24 | bytes[at + 1] << 16 | bytes[at + 2] << 8 | bytes[at + 3]) >>> 0
|
|
861
|
+
);
|
|
862
|
+
var pngSize = (bytes) => {
|
|
863
|
+
if (bytes.length < 24) return null;
|
|
864
|
+
const width = readUint32Be(bytes, 16);
|
|
865
|
+
const height = readUint32Be(bytes, 20);
|
|
866
|
+
if (width <= 0 || height <= 0) return null;
|
|
867
|
+
return { width, height };
|
|
868
|
+
};
|
|
869
|
+
var JPEG_SOF_EXCLUDED = /* @__PURE__ */ new Set([196, 200, 204]);
|
|
870
|
+
var jpegSize = (bytes) => {
|
|
871
|
+
let offset = 2;
|
|
872
|
+
while (offset + 9 < bytes.length) {
|
|
873
|
+
if (bytes[offset] !== 255) {
|
|
874
|
+
offset++;
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
const marker = bytes[offset + 1];
|
|
878
|
+
if (marker === 255 || marker >= 208 && marker <= 217 || marker === 1) {
|
|
879
|
+
offset += 2;
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
const segmentLength = readUint16Be(bytes, offset + 2);
|
|
883
|
+
if (segmentLength < 2) return null;
|
|
884
|
+
if (marker >= 192 && marker <= 207 && !JPEG_SOF_EXCLUDED.has(marker)) {
|
|
885
|
+
const height = readUint16Be(bytes, offset + 5);
|
|
886
|
+
const width = readUint16Be(bytes, offset + 7);
|
|
887
|
+
if (width <= 0 || height <= 0) return null;
|
|
888
|
+
return { width, height };
|
|
889
|
+
}
|
|
890
|
+
offset += 2 + segmentLength;
|
|
891
|
+
}
|
|
892
|
+
return null;
|
|
893
|
+
};
|
|
894
|
+
var readImagePixelSize = (bytes) => {
|
|
895
|
+
const format = detectImageFormat(bytes);
|
|
896
|
+
if (format === "png") return pngSize(bytes);
|
|
897
|
+
if (format === "jpeg") return jpegSize(bytes);
|
|
898
|
+
return null;
|
|
899
|
+
};
|
|
856
900
|
var extensionForFormat = (format) => {
|
|
857
901
|
switch (format) {
|
|
858
902
|
case "jpeg":
|
|
@@ -1071,6 +1115,67 @@ var OpcPackage = class _OpcPackage {
|
|
|
1071
1115
|
}
|
|
1072
1116
|
};
|
|
1073
1117
|
|
|
1118
|
+
// src/internal/parts/blank-deck.ts
|
|
1119
|
+
var SLIDE_SIZE = {
|
|
1120
|
+
"16:9": { cx: 12192e3, cy: 6858e3, type: "screen16x9" },
|
|
1121
|
+
"4:3": { cx: 9144e3, cy: 6858e3, type: "screen4x3" }
|
|
1122
|
+
};
|
|
1123
|
+
var RELS_CONTENT_TYPE = "application/vnd.openxmlformats-package.relationships+xml";
|
|
1124
|
+
var PRESENTATION_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
|
|
1125
|
+
var PRES_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.presProps+xml";
|
|
1126
|
+
var VIEW_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml";
|
|
1127
|
+
var SLIDE_MASTER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml";
|
|
1128
|
+
var SLIDE_LAYOUT_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
|
|
1129
|
+
var THEME_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.theme+xml";
|
|
1130
|
+
var CORE_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-package.core-properties+xml";
|
|
1131
|
+
var EXTENDED_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
|
1132
|
+
var XML_DECL = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';
|
|
1133
|
+
var RT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
1134
|
+
var RT_PACKAGE = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
1135
|
+
var THEME_XML = `${XML_DECL}<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="1F497D"/></a:dk2><a:lt2><a:srgbClr val="EEECE1"/></a:lt2><a:accent1><a:srgbClr val="4F81BD"/></a:accent1><a:accent2><a:srgbClr val="C0504D"/></a:accent2><a:accent3><a:srgbClr val="9BBB59"/></a:accent3><a:accent4><a:srgbClr val="8064A2"/></a:accent4><a:accent5><a:srgbClr val="4BACC6"/></a:accent5><a:accent6><a:srgbClr val="F79646"/></a:accent6><a:hlink><a:srgbClr val="0000FF"/></a:hlink><a:folHlink><a:srgbClr val="800080"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/></a:theme>`;
|
|
1136
|
+
var SLIDE_MASTER_XML = `${XML_DECL}<p:sldMaster xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:bg><p:bgRef idx="1001"><a:schemeClr val="bg1"/></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="274638"/><a:ext cx="8229600" cy="1143000"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"><a:normAutofit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1600200"/><a:ext cx="8229600" cy="4525963"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0"><a:normAutofit/></a:bodyPr><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/><p:sldLayoutIdLst><p:sldLayoutId id="2147483649" r:id="rId1"/><p:sldLayoutId id="2147483650" r:id="rId2"/><p:sldLayoutId id="2147483651" r:id="rId3"/></p:sldLayoutIdLst><p:txStyles><p:titleStyle><a:lvl1pPr algn="ctr" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="0"/></a:spcBef><a:buNone/><a:defRPr sz="4400" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mj-lt"/><a:ea typeface="+mj-ea"/><a:cs typeface="+mj-cs"/></a:defRPr></a:lvl1pPr></p:titleStyle><p:bodyStyle><a:lvl1pPr marL="342900" indent="-342900" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\u2022"/><a:defRPr sz="3200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="742950" indent="-285750" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\u2013"/><a:defRPr sz="2800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="1143000" indent="-228600" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\u2022"/><a:defRPr sz="2400" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1600200" indent="-228600" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\u2013"/><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="2057400" indent="-228600" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\xBB"/><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl5pPr></p:bodyStyle><p:otherStyle><a:defPPr><a:defRPr lang="en-US"/></a:defPPr><a:lvl1pPr marL="0" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl1pPr></p:otherStyle></p:txStyles></p:sldMaster>`;
|
|
1137
|
+
var LAYOUT_BLANK_XML = `${XML_DECL}<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="blank" preserve="1"><p:cSld name="Blank"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;
|
|
1138
|
+
var LAYOUT_TITLE_XML = `${XML_DECL}<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="title" preserve="1"><p:cSld name="Title Slide"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ctrTitle"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="2130425"/><a:ext cx="7772400" cy="1470025"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Subtitle 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="subTitle" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1371600" y="3886200"/><a:ext cx="6400800" cy="1752600"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master subtitle style</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;
|
|
1139
|
+
var LAYOUT_OBJ_XML = `${XML_DECL}<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="obj" preserve="1"><p:cSld name="Title and Content"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;
|
|
1140
|
+
var buildPresentationXml = (size) => `${XML_DECL}<p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" saveSubsetFonts="1"><p:sldMasterIdLst><p:sldMasterId id="2147483648" r:id="rId1"/></p:sldMasterIdLst><p:sldSz cx="${size.cx}" cy="${size.cy}" type="${size.type}"/><p:notesSz cx="6858000" cy="9144000"/></p:presentation>`;
|
|
1141
|
+
var PRES_PROPS_XML = `${XML_DECL}<p:presentationPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"/>`;
|
|
1142
|
+
var VIEW_PROPS_XML = `${XML_DECL}<p:viewPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"/>`;
|
|
1143
|
+
var CORE_PROPS_XML = `${XML_DECL}<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title></dc:title><dc:creator>pptx-kit</dc:creator><cp:lastModifiedBy>pptx-kit</cp:lastModifiedBy></cp:coreProperties>`;
|
|
1144
|
+
var EXTENDED_PROPS_XML = `${XML_DECL}<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>pptx-kit</Application></Properties>`;
|
|
1145
|
+
var ROOT_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/officeDocument" Target="ppt/presentation.xml"/><Relationship Id="rId2" Type="${RT_PACKAGE}/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId3" Type="${RT}/extended-properties" Target="docProps/app.xml"/></Relationships>`;
|
|
1146
|
+
var PRES_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/slideMaster" Target="slideMasters/slideMaster1.xml"/><Relationship Id="rId2" Type="${RT}/theme" Target="theme/theme1.xml"/><Relationship Id="rId3" Type="${RT}/presProps" Target="presProps.xml"/><Relationship Id="rId4" Type="${RT}/viewProps" Target="viewProps.xml"/></Relationships>`;
|
|
1147
|
+
var MASTER_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/slideLayout" Target="../slideLayouts/slideLayout1.xml"/><Relationship Id="rId2" Type="${RT}/slideLayout" Target="../slideLayouts/slideLayout2.xml"/><Relationship Id="rId3" Type="${RT}/slideLayout" Target="../slideLayouts/slideLayout3.xml"/><Relationship Id="rId4" Type="${RT}/theme" Target="../theme/theme1.xml"/></Relationships>`;
|
|
1148
|
+
var LAYOUT_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>`;
|
|
1149
|
+
var TEXT_ENCODER2 = new TextEncoder();
|
|
1150
|
+
var encode2 = (s) => TEXT_ENCODER2.encode(s);
|
|
1151
|
+
var buildBlankDeck = (aspect) => {
|
|
1152
|
+
const pkg = OpcPackage.empty();
|
|
1153
|
+
const size = SLIDE_SIZE[aspect];
|
|
1154
|
+
const add = (name, contentType, xml) => {
|
|
1155
|
+
pkg.addPart(partName(name), contentType, encode2(xml));
|
|
1156
|
+
};
|
|
1157
|
+
const addRels = (name, xml) => {
|
|
1158
|
+
pkg.addPart(partName(name), RELS_CONTENT_TYPE, encode2(xml));
|
|
1159
|
+
};
|
|
1160
|
+
add("/ppt/presentation.xml", PRESENTATION_CONTENT_TYPE, buildPresentationXml(size));
|
|
1161
|
+
add("/ppt/presProps.xml", PRES_PROPS_CONTENT_TYPE, PRES_PROPS_XML);
|
|
1162
|
+
add("/ppt/viewProps.xml", VIEW_PROPS_CONTENT_TYPE, VIEW_PROPS_XML);
|
|
1163
|
+
add("/ppt/theme/theme1.xml", THEME_CONTENT_TYPE, THEME_XML);
|
|
1164
|
+
add("/ppt/slideMasters/slideMaster1.xml", SLIDE_MASTER_CONTENT_TYPE, SLIDE_MASTER_XML);
|
|
1165
|
+
add("/ppt/slideLayouts/slideLayout1.xml", SLIDE_LAYOUT_CONTENT_TYPE, LAYOUT_BLANK_XML);
|
|
1166
|
+
add("/ppt/slideLayouts/slideLayout2.xml", SLIDE_LAYOUT_CONTENT_TYPE, LAYOUT_TITLE_XML);
|
|
1167
|
+
add("/ppt/slideLayouts/slideLayout3.xml", SLIDE_LAYOUT_CONTENT_TYPE, LAYOUT_OBJ_XML);
|
|
1168
|
+
add("/docProps/core.xml", CORE_PROPS_CONTENT_TYPE, CORE_PROPS_XML);
|
|
1169
|
+
add("/docProps/app.xml", EXTENDED_PROPS_CONTENT_TYPE, EXTENDED_PROPS_XML);
|
|
1170
|
+
addRels("/_rels/.rels", ROOT_RELS_XML);
|
|
1171
|
+
addRels("/ppt/_rels/presentation.xml.rels", PRES_RELS_XML);
|
|
1172
|
+
addRels("/ppt/slideMasters/_rels/slideMaster1.xml.rels", MASTER_RELS_XML);
|
|
1173
|
+
addRels("/ppt/slideLayouts/_rels/slideLayout1.xml.rels", LAYOUT_RELS_XML);
|
|
1174
|
+
addRels("/ppt/slideLayouts/_rels/slideLayout2.xml.rels", LAYOUT_RELS_XML);
|
|
1175
|
+
addRels("/ppt/slideLayouts/_rels/slideLayout3.xml.rels", LAYOUT_RELS_XML);
|
|
1176
|
+
return pkg;
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1074
1179
|
// src/api/_internal-symbols.ts
|
|
1075
1180
|
var INTERNAL_PACKAGE = /* @__PURE__ */ Symbol.for("pptx-kit.package");
|
|
1076
1181
|
var SLIDE_PART_NAME = /* @__PURE__ */ Symbol.for("pptx-kit.slide.partName");
|
|
@@ -1103,8 +1208,9 @@ var loadPresentation = async (input) => {
|
|
|
1103
1208
|
const pkg = OpcPackage.load(bytes);
|
|
1104
1209
|
return { [INTERNAL_PACKAGE]: pkg, _slidesCache: null };
|
|
1105
1210
|
};
|
|
1106
|
-
var createPresentation = () => {
|
|
1107
|
-
const
|
|
1211
|
+
var createPresentation = (options = {}) => {
|
|
1212
|
+
const aspect = options.size ?? "16:9";
|
|
1213
|
+
const pkg = buildBlankDeck(aspect);
|
|
1108
1214
|
return { [INTERNAL_PACKAGE]: pkg, _slidesCache: null };
|
|
1109
1215
|
};
|
|
1110
1216
|
var savePresentation = (pres) => {
|
|
@@ -1598,6 +1704,10 @@ var parseColor2 = (value) => {
|
|
|
1598
1704
|
if (/^[0-9A-Fa-f]{6}$/.test(hex)) return { kind: "srgb", hex: hex.toUpperCase() };
|
|
1599
1705
|
return null;
|
|
1600
1706
|
};
|
|
1707
|
+
var parseSrgbHex = (value) => {
|
|
1708
|
+
const hex = value.startsWith("#") ? value.slice(1) : value;
|
|
1709
|
+
return /^[0-9A-Fa-f]{6}$/.test(hex) ? hex.toUpperCase() : null;
|
|
1710
|
+
};
|
|
1601
1711
|
var buildColorElement = (value) => {
|
|
1602
1712
|
const parsed = parseColor2(value);
|
|
1603
1713
|
if (parsed === null) throw new Error(`unrecognized color: ${value}`);
|
|
@@ -2881,26 +2991,28 @@ var equalShares = (total, n) => {
|
|
|
2881
2991
|
};
|
|
2882
2992
|
var buildTable = (opts) => {
|
|
2883
2993
|
const rows = opts.rows;
|
|
2884
|
-
if (rows.length === 0) throw new Error("
|
|
2994
|
+
if (rows.length === 0) throw new Error("addSlideTable: at least one row is required");
|
|
2885
2995
|
const colCount = rows[0]?.length ?? 0;
|
|
2886
|
-
if (colCount === 0) throw new Error("
|
|
2996
|
+
if (colCount === 0) throw new Error("addSlideTable: at least one column is required");
|
|
2887
2997
|
for (let i = 0; i < rows.length; i++) {
|
|
2888
2998
|
const r2 = rows[i];
|
|
2889
|
-
if (!r2) throw new Error(`
|
|
2999
|
+
if (!r2) throw new Error(`addSlideTable: row ${i} is missing`);
|
|
2890
3000
|
if (r2.length !== colCount) {
|
|
2891
3001
|
throw new Error(
|
|
2892
|
-
`
|
|
3002
|
+
`addSlideTable: row ${i} has ${r2.length} cells; expected ${colCount} to match row 0`
|
|
2893
3003
|
);
|
|
2894
3004
|
}
|
|
2895
3005
|
}
|
|
2896
3006
|
const colWidths = opts.colWidths ?? equalShares(opts.w, colCount);
|
|
2897
3007
|
if (colWidths.length !== colCount) {
|
|
2898
|
-
throw new Error(
|
|
3008
|
+
throw new Error(
|
|
3009
|
+
`addSlideTable: colWidths has ${colWidths.length} entries; expected ${colCount}`
|
|
3010
|
+
);
|
|
2899
3011
|
}
|
|
2900
3012
|
const rowHeights = opts.rowHeights ?? equalShares(opts.h, rows.length);
|
|
2901
3013
|
if (rowHeights.length !== rows.length) {
|
|
2902
3014
|
throw new Error(
|
|
2903
|
-
`
|
|
3015
|
+
`addSlideTable: rowHeights has ${rowHeights.length} entries; expected ${rows.length}`
|
|
2904
3016
|
);
|
|
2905
3017
|
}
|
|
2906
3018
|
const name = opts.name ?? `Table ${opts.id}`;
|
|
@@ -3425,10 +3537,10 @@ var buildCommentListDoc = (comments) => {
|
|
|
3425
3537
|
|
|
3426
3538
|
// src/api/fn/_helpers.ts
|
|
3427
3539
|
var TEXT_DECODER2 = new TextDecoder();
|
|
3428
|
-
var
|
|
3540
|
+
var TEXT_ENCODER3 = new TextEncoder();
|
|
3429
3541
|
var decode2 = (b) => TEXT_DECODER2.decode(b);
|
|
3430
|
-
var
|
|
3431
|
-
var
|
|
3542
|
+
var encode3 = (s) => TEXT_ENCODER3.encode(s);
|
|
3543
|
+
var SLIDE_LAYOUT_CONTENT_TYPE2 = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
|
|
3432
3544
|
var SLIDE_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml";
|
|
3433
3545
|
var PRES_PART_NAME = partName("/ppt/presentation.xml");
|
|
3434
3546
|
var NAME_PRESENTATION2 = qname("p", "presentation", NS.pml);
|
|
@@ -3445,7 +3557,7 @@ var commitSlideData = (slide) => {
|
|
|
3445
3557
|
const xml = serializeXml(slide[SLIDE_DOCUMENT]);
|
|
3446
3558
|
const part = slide[INTERNAL_PACKAGE].getPart(slide[SLIDE_PART_NAME]);
|
|
3447
3559
|
if (!part) throw new Error(`slide part missing: ${slide[SLIDE_PART_NAME]}`);
|
|
3448
|
-
part.data =
|
|
3560
|
+
part.data = encode3(xml);
|
|
3449
3561
|
};
|
|
3450
3562
|
var refreshSlideData = (slide) => {
|
|
3451
3563
|
const fresh = readSlidePart(slide[SLIDE_DOCUMENT].root);
|
|
@@ -3533,7 +3645,7 @@ var setOpcDefault = (pkg, extension, contentType) => {
|
|
|
3533
3645
|
};
|
|
3534
3646
|
|
|
3535
3647
|
// src/api/fn/theme.ts
|
|
3536
|
-
var
|
|
3648
|
+
var THEME_CONTENT_TYPE2 = "application/vnd.openxmlformats-officedocument.theme+xml";
|
|
3537
3649
|
var NAME_THEME_ELEMENTS = qname("a", "themeElements", NS.dml);
|
|
3538
3650
|
var NAME_CLR_SCHEME = qname("a", "clrScheme", NS.dml);
|
|
3539
3651
|
var NAME_SRGB_CLR3 = qname("a", "srgbClr", NS.dml);
|
|
@@ -3555,7 +3667,7 @@ var readSchemeSlot = (parent, local) => {
|
|
|
3555
3667
|
};
|
|
3556
3668
|
var getPresentationTheme = (pres) => {
|
|
3557
3669
|
const pkg = pres[INTERNAL_PACKAGE];
|
|
3558
|
-
const themePart = pkg.parts.filter((p) => p.contentType ===
|
|
3670
|
+
const themePart = pkg.parts.filter((p) => p.contentType === THEME_CONTENT_TYPE2).sort((a2, b) => a2.name.localeCompare(b.name))[0];
|
|
3559
3671
|
if (!themePart) return null;
|
|
3560
3672
|
const root = parseXml(decode2(themePart.data)).root;
|
|
3561
3673
|
const themeElements = firstChildElement(root, NAME_THEME_ELEMENTS);
|
|
@@ -3588,7 +3700,7 @@ var readTypeface = (parent, local) => {
|
|
|
3588
3700
|
};
|
|
3589
3701
|
var getPresentationFonts = (pres) => {
|
|
3590
3702
|
const pkg = pres[INTERNAL_PACKAGE];
|
|
3591
|
-
const themePart = pkg.parts.filter((p) => p.contentType ===
|
|
3703
|
+
const themePart = pkg.parts.filter((p) => p.contentType === THEME_CONTENT_TYPE2).sort((a2, b) => a2.name.localeCompare(b.name))[0];
|
|
3592
3704
|
if (!themePart) return null;
|
|
3593
3705
|
const root = parseXml(decode2(themePart.data)).root;
|
|
3594
3706
|
const themeElements = firstChildElement(root, NAME_THEME_ELEMENTS);
|
|
@@ -3630,7 +3742,7 @@ var loadAuthorList = (pkg) => {
|
|
|
3630
3742
|
};
|
|
3631
3743
|
var writeAuthorList = (pkg, authors) => {
|
|
3632
3744
|
const doc = buildCommentAuthorListDoc(authors);
|
|
3633
|
-
const bytes =
|
|
3745
|
+
const bytes = encode3(serializeXml(doc));
|
|
3634
3746
|
const existing = pkg.getPart(COMMENT_AUTHORS_PART_NAME);
|
|
3635
3747
|
if (existing !== null) {
|
|
3636
3748
|
existing.data = bytes;
|
|
@@ -3677,7 +3789,7 @@ var writeCommentsForSlide = (slide, comments) => {
|
|
|
3677
3789
|
return;
|
|
3678
3790
|
}
|
|
3679
3791
|
const doc = buildCommentListDoc(comments);
|
|
3680
|
-
const bytes =
|
|
3792
|
+
const bytes = encode3(serializeXml(doc));
|
|
3681
3793
|
const existing = pkg.getPart(commentsName);
|
|
3682
3794
|
if (existing !== null) {
|
|
3683
3795
|
existing.data = bytes;
|
|
@@ -3907,6 +4019,15 @@ var getCommentPosition = (comment2) => comment2[COMMENT_SNAPSHOT].position;
|
|
|
3907
4019
|
var getCommentSlide = (comment2) => comment2[COMMENT_SLIDE];
|
|
3908
4020
|
|
|
3909
4021
|
// src/api/fn/shape-image.ts
|
|
4022
|
+
var fitImageRect = (box, fit, naturalSize) => {
|
|
4023
|
+
if (fit === "fill" || naturalSize === null) return box;
|
|
4024
|
+
const scale = Math.min(box.w / naturalSize.width, box.h / naturalSize.height);
|
|
4025
|
+
const w = Math.round(naturalSize.width * scale);
|
|
4026
|
+
const h = Math.round(naturalSize.height * scale);
|
|
4027
|
+
const x = box.x + Math.round((box.w - w) / 2);
|
|
4028
|
+
const y = box.y + Math.round((box.h - h) / 2);
|
|
4029
|
+
return { x, y, w, h };
|
|
4030
|
+
};
|
|
3910
4031
|
var setShapeImage = (shape, bytes, options = {}) => {
|
|
3911
4032
|
if (shape[SHAPE_SNAPSHOT].kind !== "picture") {
|
|
3912
4033
|
throw new Error(
|
|
@@ -3939,27 +4060,43 @@ var setShapeImage = (shape, bytes, options = {}) => {
|
|
|
3939
4060
|
if (!part) throw new Error(`media part missing: ${mediaName}`);
|
|
3940
4061
|
part.data = bytes;
|
|
3941
4062
|
part.contentType = newContentType;
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
4063
|
+
} else {
|
|
4064
|
+
let nextN = 1;
|
|
4065
|
+
const mediaPathRegex = /^\/ppt\/media\/image(\d+)\./;
|
|
4066
|
+
for (const p of pkg.parts) {
|
|
4067
|
+
const m = p.name.match(mediaPathRegex);
|
|
4068
|
+
if (m?.[1] !== void 0) {
|
|
4069
|
+
const num = Number.parseInt(m[1], 10);
|
|
4070
|
+
if (Number.isFinite(num) && num >= nextN) nextN = num + 1;
|
|
4071
|
+
}
|
|
4072
|
+
}
|
|
4073
|
+
const newPartName = partName(`/ppt/media/image${nextN}.${newExtension}`);
|
|
4074
|
+
const hasDefault = pkg.contentTypes.defaults.some(
|
|
4075
|
+
(d) => d.extension.toLowerCase() === newExtension
|
|
4076
|
+
);
|
|
4077
|
+
if (!hasDefault) {
|
|
4078
|
+
pkg.contentTypes.defaults.push({ extension: newExtension, contentType: newContentType });
|
|
4079
|
+
}
|
|
4080
|
+
pkg.addPart(newPartName, newContentType, bytes);
|
|
4081
|
+
rel.target = `../media/image${nextN}.${newExtension}`;
|
|
4082
|
+
pkg.setRels(slide[SLIDE_PART_NAME], rels);
|
|
4083
|
+
}
|
|
4084
|
+
if (options.fit === "contain") {
|
|
4085
|
+
const pos = readPosition(shape[SHAPE_ELEMENT], "picture");
|
|
4086
|
+
const size = readSize2(shape[SHAPE_ELEMENT], "picture");
|
|
4087
|
+
const natural = readImagePixelSize(bytes);
|
|
4088
|
+
if (pos !== null && size !== null && natural !== null) {
|
|
4089
|
+
const fitted = fitImageRect(
|
|
4090
|
+
{ x: pos.x, y: pos.y, w: size.w, h: size.h },
|
|
4091
|
+
"contain",
|
|
4092
|
+
natural
|
|
4093
|
+
);
|
|
4094
|
+
setPosition(shape[SHAPE_ELEMENT], "picture", fitted.x, fitted.y);
|
|
4095
|
+
setSize(shape[SHAPE_ELEMENT], "picture", fitted.w, fitted.h);
|
|
4096
|
+
commitSlideData(slide);
|
|
4097
|
+
refreshSlideData(slide);
|
|
3951
4098
|
}
|
|
3952
4099
|
}
|
|
3953
|
-
const newPartName = partName(`/ppt/media/image${nextN}.${newExtension}`);
|
|
3954
|
-
const hasDefault = pkg.contentTypes.defaults.some(
|
|
3955
|
-
(d) => d.extension.toLowerCase() === newExtension
|
|
3956
|
-
);
|
|
3957
|
-
if (!hasDefault) {
|
|
3958
|
-
pkg.contentTypes.defaults.push({ extension: newExtension, contentType: newContentType });
|
|
3959
|
-
}
|
|
3960
|
-
pkg.addPart(newPartName, newContentType, bytes);
|
|
3961
|
-
rel.target = `../media/image${nextN}.${newExtension}`;
|
|
3962
|
-
pkg.setRels(slide[SLIDE_PART_NAME], rels);
|
|
3963
4100
|
};
|
|
3964
4101
|
|
|
3965
4102
|
// src/api/fn/shape-click-action.ts
|
|
@@ -4601,6 +4738,11 @@ var rPrAttrsFromStyle = (style) => {
|
|
|
4601
4738
|
})
|
|
4602
4739
|
);
|
|
4603
4740
|
}
|
|
4741
|
+
if (style?.font !== void 0) {
|
|
4742
|
+
const typeface = attr(qname("", "typeface", ""), style.font);
|
|
4743
|
+
children.push(elem(a("latin"), { attrs: [typeface] }));
|
|
4744
|
+
children.push(elem(a("ea"), { attrs: [typeface] }));
|
|
4745
|
+
}
|
|
4604
4746
|
return { attrs, children };
|
|
4605
4747
|
};
|
|
4606
4748
|
var titleElement = (title, style, rotationDeg) => {
|
|
@@ -5083,7 +5225,10 @@ var NAME_A_RPR = qname("a", "rPr", NS_A2);
|
|
|
5083
5225
|
var NAME_A_DEF_RPR = qname("a", "defRPr", NS_A2);
|
|
5084
5226
|
var NAME_A_PPR = qname("a", "pPr", NS_A2);
|
|
5085
5227
|
var NAME_A_SRGB = qname("a", "srgbClr", NS_A2);
|
|
5228
|
+
var NAME_A_LATIN = qname("a", "latin", NS_A2);
|
|
5229
|
+
var ATTR_TYPEFACE2 = qname("", "typeface", "");
|
|
5086
5230
|
var readRunStyle = (rPr) => {
|
|
5231
|
+
let font;
|
|
5087
5232
|
let sizePt;
|
|
5088
5233
|
let bold;
|
|
5089
5234
|
let italic;
|
|
@@ -5105,10 +5250,16 @@ var readRunStyle = (rPr) => {
|
|
|
5105
5250
|
if (v !== null) color = `#${v.toUpperCase()}`;
|
|
5106
5251
|
}
|
|
5107
5252
|
}
|
|
5108
|
-
|
|
5253
|
+
const latin = firstChildElement(rPr, NAME_A_LATIN);
|
|
5254
|
+
if (latin) {
|
|
5255
|
+
const tf = getAttrValue(latin, ATTR_TYPEFACE2);
|
|
5256
|
+
if (tf !== null && tf !== "") font = tf;
|
|
5257
|
+
}
|
|
5258
|
+
if (font === void 0 && sizePt === void 0 && bold === void 0 && italic === void 0 && color === void 0) {
|
|
5109
5259
|
return void 0;
|
|
5110
5260
|
}
|
|
5111
5261
|
return {
|
|
5262
|
+
...font !== void 0 ? { font } : {},
|
|
5112
5263
|
...sizePt !== void 0 ? { sizePt } : {},
|
|
5113
5264
|
...bold !== void 0 ? { bold } : {},
|
|
5114
5265
|
...italic !== void 0 ? { italic } : {},
|
|
@@ -5882,8 +6033,8 @@ var readChartSpec = (root) => {
|
|
|
5882
6033
|
};
|
|
5883
6034
|
|
|
5884
6035
|
// src/internal/chartml/embedded-xlsx.ts
|
|
5885
|
-
var
|
|
5886
|
-
var
|
|
6036
|
+
var TEXT_ENCODER4 = new TextEncoder();
|
|
6037
|
+
var encode4 = (s) => TEXT_ENCODER4.encode(s);
|
|
5887
6038
|
var xmlEscape = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
5888
6039
|
var colLetter = (col) => {
|
|
5889
6040
|
let n = col;
|
|
@@ -5931,11 +6082,11 @@ var buildEmbeddedXlsx = (seriesNames, rows) => {
|
|
|
5931
6082
|
const rootRelsXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>';
|
|
5932
6083
|
const contentTypesXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/></Types>';
|
|
5933
6084
|
return writeZip([
|
|
5934
|
-
{ name: "[Content_Types].xml", data:
|
|
5935
|
-
{ name: "_rels/.rels", data:
|
|
5936
|
-
{ name: "xl/workbook.xml", data:
|
|
5937
|
-
{ name: "xl/_rels/workbook.xml.rels", data:
|
|
5938
|
-
{ name: "xl/worksheets/sheet1.xml", data:
|
|
6085
|
+
{ name: "[Content_Types].xml", data: encode4(contentTypesXml) },
|
|
6086
|
+
{ name: "_rels/.rels", data: encode4(rootRelsXml) },
|
|
6087
|
+
{ name: "xl/workbook.xml", data: encode4(workbookXml) },
|
|
6088
|
+
{ name: "xl/_rels/workbook.xml.rels", data: encode4(workbookRelsXml) },
|
|
6089
|
+
{ name: "xl/worksheets/sheet1.xml", data: encode4(sheetXml) }
|
|
5939
6090
|
]);
|
|
5940
6091
|
};
|
|
5941
6092
|
|
|
@@ -5993,7 +6144,41 @@ var buildChartGraphicFrame = (opts) => {
|
|
|
5993
6144
|
const graphic = elem(NAME_GRAPHIC2, { children: [graphicData] });
|
|
5994
6145
|
return elem(NAME_GRAPHIC_FRAME2, { children: [nvGraphicFramePr, xfrm, graphic] });
|
|
5995
6146
|
};
|
|
6147
|
+
var checkChartColor = (value, label) => {
|
|
6148
|
+
if (value === null || value === void 0) return;
|
|
6149
|
+
if (parseSrgbHex(value) === null) {
|
|
6150
|
+
throw new Error(
|
|
6151
|
+
`${label}: invalid chart color ${JSON.stringify(value)} \u2014 expected an sRGB hex like "#4472C4" or "4472C4"`
|
|
6152
|
+
);
|
|
6153
|
+
}
|
|
6154
|
+
};
|
|
6155
|
+
var validateChartSpecColors = (spec) => {
|
|
6156
|
+
checkChartColor(spec.plotAreaFill, "addSlideChart: plotAreaFill");
|
|
6157
|
+
checkChartColor(spec.plotAreaStrokeColor, "addSlideChart: plotAreaStrokeColor");
|
|
6158
|
+
checkChartColor(spec.chartAreaFill, "addSlideChart: chartAreaFill");
|
|
6159
|
+
checkChartColor(spec.chartAreaStrokeColor, "addSlideChart: chartAreaStrokeColor");
|
|
6160
|
+
checkChartColor(spec.valueAxisMajorGridlineColor, "addSlideChart: valueAxisMajorGridlineColor");
|
|
6161
|
+
checkChartColor(spec.valueAxisMinorGridlineColor, "addSlideChart: valueAxisMinorGridlineColor");
|
|
6162
|
+
checkChartColor(
|
|
6163
|
+
spec.categoryAxisMajorGridlineColor,
|
|
6164
|
+
"addSlideChart: categoryAxisMajorGridlineColor"
|
|
6165
|
+
);
|
|
6166
|
+
checkChartColor(
|
|
6167
|
+
spec.categoryAxisMinorGridlineColor,
|
|
6168
|
+
"addSlideChart: categoryAxisMinorGridlineColor"
|
|
6169
|
+
);
|
|
6170
|
+
checkChartColor(spec.valueAxisLineColor, "addSlideChart: valueAxisLineColor");
|
|
6171
|
+
checkChartColor(spec.categoryAxisLineColor, "addSlideChart: categoryAxisLineColor");
|
|
6172
|
+
spec.series.forEach((series, i) => {
|
|
6173
|
+
checkChartColor(series.color, `addSlideChart: series[${i}].color`);
|
|
6174
|
+
checkChartColor(series.trendline?.color, `addSlideChart: series[${i}].trendline.color`);
|
|
6175
|
+
series.pointColors?.forEach((c2, j) => {
|
|
6176
|
+
checkChartColor(c2, `addSlideChart: series[${i}].pointColors[${j}]`);
|
|
6177
|
+
});
|
|
6178
|
+
});
|
|
6179
|
+
};
|
|
5996
6180
|
var addSlideChart = (slide, opts) => {
|
|
6181
|
+
validateChartSpecColors(opts.spec);
|
|
5997
6182
|
const pkg = slide[INTERNAL_PACKAGE];
|
|
5998
6183
|
const chartN = allocateChartIndex(pkg);
|
|
5999
6184
|
const chartPartName = partName(`/ppt/charts/chart${chartN}.xml`);
|
|
@@ -6007,7 +6192,7 @@ var addSlideChart = (slide, opts) => {
|
|
|
6007
6192
|
xlsxRows
|
|
6008
6193
|
);
|
|
6009
6194
|
const chartDoc = buildChartSpaceDoc(opts.spec);
|
|
6010
|
-
const chartBytes =
|
|
6195
|
+
const chartBytes = encode3(serializeXml(chartDoc));
|
|
6011
6196
|
pkg.addPart(chartPartName, CHART_CONTENT_TYPE, chartBytes);
|
|
6012
6197
|
pkg.addPart(xlsxPartName, EMBEDDED_XLSX_CONTENT_TYPE, xlsxBytes);
|
|
6013
6198
|
setOpcDefault(pkg, "rels", "application/vnd.openxmlformats-package.relationships+xml");
|
|
@@ -6060,6 +6245,7 @@ var resolveChartPartName = (slide, shape) => {
|
|
|
6060
6245
|
return { partName: partNameValue, rId };
|
|
6061
6246
|
};
|
|
6062
6247
|
var setChartSpec = (chart, spec) => {
|
|
6248
|
+
validateChartSpecColors(spec);
|
|
6063
6249
|
const slide = chart.shape[SHAPE_SLIDE];
|
|
6064
6250
|
const pkg = slide[INTERNAL_PACKAGE];
|
|
6065
6251
|
const resolved = resolveChartPartName(slide, chart.shape);
|
|
@@ -6067,7 +6253,7 @@ var setChartSpec = (chart, spec) => {
|
|
|
6067
6253
|
throw new Error("setChartSpec: shape is not a chart graphic frame");
|
|
6068
6254
|
}
|
|
6069
6255
|
const doc = buildChartSpaceDoc(spec);
|
|
6070
|
-
const chartBytes =
|
|
6256
|
+
const chartBytes = encode3(serializeXml(doc));
|
|
6071
6257
|
const chartPart = pkg.getPart(resolved.partName);
|
|
6072
6258
|
if (!chartPart) {
|
|
6073
6259
|
throw new Error(`setChartSpec: chart part ${resolved.partName} not found`);
|
|
@@ -6656,7 +6842,7 @@ var getSlideLayouts = (pres) => {
|
|
|
6656
6842
|
const pkg = pres[INTERNAL_PACKAGE];
|
|
6657
6843
|
const out = [];
|
|
6658
6844
|
for (const part of pkg.parts) {
|
|
6659
|
-
if (part.contentType !==
|
|
6845
|
+
if (part.contentType !== SLIDE_LAYOUT_CONTENT_TYPE2) continue;
|
|
6660
6846
|
const root = parseXml(decode2(part.data)).root;
|
|
6661
6847
|
out.push({
|
|
6662
6848
|
[LAYOUT_PART_NAME]: part.name,
|
|
@@ -6750,7 +6936,7 @@ var getCoreProperties = (pres) => {
|
|
|
6750
6936
|
category: read(NS_CORE_PROPS, "category")
|
|
6751
6937
|
};
|
|
6752
6938
|
};
|
|
6753
|
-
var
|
|
6939
|
+
var CORE_PROPS_CONTENT_TYPE2 = "application/vnd.openxmlformats-package.core-properties+xml";
|
|
6754
6940
|
var CORE_PROP_FIELDS = [
|
|
6755
6941
|
{ key: "title", uri: NS_DC, prefix: "dc", local: "title" },
|
|
6756
6942
|
{ key: "subject", uri: NS_DC, prefix: "dc", local: "subject" },
|
|
@@ -6806,16 +6992,16 @@ var setCoreProperties = (pres, values) => {
|
|
|
6806
6992
|
root.children.push(elem(name, { children: [text(value)] }));
|
|
6807
6993
|
}
|
|
6808
6994
|
}
|
|
6809
|
-
const bytes =
|
|
6995
|
+
const bytes = encode3(serializeXml(doc));
|
|
6810
6996
|
if (part) {
|
|
6811
6997
|
part.data = bytes;
|
|
6812
6998
|
return;
|
|
6813
6999
|
}
|
|
6814
7000
|
pkg.contentTypes.overrides.push({
|
|
6815
7001
|
partName: CORE_PROPS_PART_NAME,
|
|
6816
|
-
contentType:
|
|
7002
|
+
contentType: CORE_PROPS_CONTENT_TYPE2
|
|
6817
7003
|
});
|
|
6818
|
-
pkg.addPart(CORE_PROPS_PART_NAME,
|
|
7004
|
+
pkg.addPart(CORE_PROPS_PART_NAME, CORE_PROPS_CONTENT_TYPE2, bytes);
|
|
6819
7005
|
const rootRels = pkg.rootRels() ?? emptyRels();
|
|
6820
7006
|
const rId = nextRelId(rootRels.items.map((r2) => r2.id));
|
|
6821
7007
|
rootRels.items.push({
|
|
@@ -6879,7 +7065,7 @@ var setExtendedProperties = (pres, values) => {
|
|
|
6879
7065
|
doc.root.children.push(elem(name, { children: [text(value)] }));
|
|
6880
7066
|
}
|
|
6881
7067
|
}
|
|
6882
|
-
part.data =
|
|
7068
|
+
part.data = encode3(serializeXml(doc));
|
|
6883
7069
|
};
|
|
6884
7070
|
|
|
6885
7071
|
// src/api/fn/thumbnail.ts
|
|
@@ -7209,6 +7395,78 @@ var getTableCellSpan = (cell) => {
|
|
|
7209
7395
|
vMerge: vm === "1" || vm === "true"
|
|
7210
7396
|
};
|
|
7211
7397
|
};
|
|
7398
|
+
var ATTR_GRID_SPAN = qname("", "gridSpan", "");
|
|
7399
|
+
var ATTR_ROW_SPAN = qname("", "rowSpan", "");
|
|
7400
|
+
var ATTR_H_MERGE = qname("", "hMerge", "");
|
|
7401
|
+
var ATTR_V_MERGE = qname("", "vMerge", "");
|
|
7402
|
+
var setSpanAttr = (tc, name, value) => {
|
|
7403
|
+
tc.attrs = tc.attrs.filter(
|
|
7404
|
+
(a2) => !(a2.name.namespaceURI === "" && a2.name.localName === name.localName)
|
|
7405
|
+
);
|
|
7406
|
+
tc.attrs.push(attr(name, value));
|
|
7407
|
+
};
|
|
7408
|
+
var cellIsMergedAlready = (tc) => {
|
|
7409
|
+
const gs = getAttrValue(tc, ATTR_GRID_SPAN);
|
|
7410
|
+
const rs = getAttrValue(tc, ATTR_ROW_SPAN);
|
|
7411
|
+
const hm = getAttrValue(tc, ATTR_H_MERGE);
|
|
7412
|
+
const vm = getAttrValue(tc, ATTR_V_MERGE);
|
|
7413
|
+
return gs !== null && Number.parseInt(gs, 10) > 1 || rs !== null && Number.parseInt(rs, 10) > 1 || hm === "1" || hm === "true" || vm === "1" || vm === "true";
|
|
7414
|
+
};
|
|
7415
|
+
var mergeTableCells = (table, block) => {
|
|
7416
|
+
const { row, col, rowSpan, colSpan } = block;
|
|
7417
|
+
if (!Number.isInteger(rowSpan) || !Number.isInteger(colSpan) || rowSpan < 1 || colSpan < 1) {
|
|
7418
|
+
throw new RangeError(
|
|
7419
|
+
`mergeTableCells: rowSpan / colSpan must be integers \u2265 1 (got ${rowSpan} \xD7 ${colSpan})`
|
|
7420
|
+
);
|
|
7421
|
+
}
|
|
7422
|
+
if (rowSpan === 1 && colSpan === 1) {
|
|
7423
|
+
throw new RangeError("mergeTableCells: a 1\xD71 block is not a merge");
|
|
7424
|
+
}
|
|
7425
|
+
if (!Number.isInteger(row) || !Number.isInteger(col) || row < 0 || col < 0) {
|
|
7426
|
+
throw new RangeError(
|
|
7427
|
+
`mergeTableCells: row / col must be non-negative integers (got ${row}, ${col})`
|
|
7428
|
+
);
|
|
7429
|
+
}
|
|
7430
|
+
const cells = getTableCells(table);
|
|
7431
|
+
const lastRow = row + rowSpan - 1;
|
|
7432
|
+
const lastCol = col + colSpan - 1;
|
|
7433
|
+
if (lastRow >= cells.length) {
|
|
7434
|
+
throw new RangeError(
|
|
7435
|
+
`mergeTableCells: block rows ${row}..${lastRow} exceed table height ${cells.length}`
|
|
7436
|
+
);
|
|
7437
|
+
}
|
|
7438
|
+
for (let r2 = row; r2 <= lastRow; r2++) {
|
|
7439
|
+
const rowCellsArr = cells[r2];
|
|
7440
|
+
if (lastCol >= rowCellsArr.length) {
|
|
7441
|
+
throw new RangeError(
|
|
7442
|
+
`mergeTableCells: block cols ${col}..${lastCol} exceed row ${r2} width ${rowCellsArr.length}`
|
|
7443
|
+
);
|
|
7444
|
+
}
|
|
7445
|
+
}
|
|
7446
|
+
for (let r2 = row; r2 <= lastRow; r2++) {
|
|
7447
|
+
for (let c2 = col; c2 <= lastCol; c2++) {
|
|
7448
|
+
if (cellIsMergedAlready(cells[r2][c2][CELL_ELEMENT])) {
|
|
7449
|
+
throw new Error(
|
|
7450
|
+
`mergeTableCells: cell (${r2}, ${c2}) is already part of a merge; split it before re-merging`
|
|
7451
|
+
);
|
|
7452
|
+
}
|
|
7453
|
+
}
|
|
7454
|
+
}
|
|
7455
|
+
for (let r2 = row; r2 <= lastRow; r2++) {
|
|
7456
|
+
for (let c2 = col; c2 <= lastCol; c2++) {
|
|
7457
|
+
const tc = cells[r2][c2][CELL_ELEMENT];
|
|
7458
|
+
if (r2 === row && c2 === col) {
|
|
7459
|
+
if (colSpan > 1) setSpanAttr(tc, ATTR_GRID_SPAN, String(colSpan));
|
|
7460
|
+
if (rowSpan > 1) setSpanAttr(tc, ATTR_ROW_SPAN, String(rowSpan));
|
|
7461
|
+
continue;
|
|
7462
|
+
}
|
|
7463
|
+
if (c2 > col) setSpanAttr(tc, ATTR_H_MERGE, "1");
|
|
7464
|
+
if (r2 > row) setSpanAttr(tc, ATTR_V_MERGE, "1");
|
|
7465
|
+
}
|
|
7466
|
+
}
|
|
7467
|
+
commitSlideData(table[SHAPE_SLIDE]);
|
|
7468
|
+
refreshSlideData(table[SHAPE_SLIDE]);
|
|
7469
|
+
};
|
|
7212
7470
|
var getTableCellBorders = (pres, cell) => {
|
|
7213
7471
|
const tcPr = firstChildElement(cell[CELL_ELEMENT], NAME_A_TC_PR);
|
|
7214
7472
|
const theme = getPresentationTheme(pres);
|
|
@@ -9049,7 +9307,7 @@ var setSlideNotes = (slide, value) => {
|
|
|
9049
9307
|
const txBody = firstChildElement(child, qname("p", "txBody", NS.pml));
|
|
9050
9308
|
if (!txBody) continue;
|
|
9051
9309
|
setTextBody(txBody, value);
|
|
9052
|
-
part.data =
|
|
9310
|
+
part.data = encode3(serializeXml(doc2));
|
|
9053
9311
|
return;
|
|
9054
9312
|
}
|
|
9055
9313
|
throw new Error("notesSlide has no body placeholder to fill");
|
|
@@ -9069,7 +9327,7 @@ var setSlideNotes = (slide, value) => {
|
|
|
9069
9327
|
pkg.addPart(
|
|
9070
9328
|
notesName,
|
|
9071
9329
|
"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",
|
|
9072
|
-
|
|
9330
|
+
encode3(serializeXml(doc))
|
|
9073
9331
|
);
|
|
9074
9332
|
const notesRels = emptyRels();
|
|
9075
9333
|
const slideBase = slide[SLIDE_PART_NAME].split("/").pop() ?? "slide.xml";
|
|
@@ -9159,7 +9417,7 @@ var setSlideSize = (pres, opts) => {
|
|
|
9159
9417
|
}
|
|
9160
9418
|
sldSz.attrs = [attr(ATTR_CX9, String(opts.width)), attr(ATTR_CY9, String(opts.height))];
|
|
9161
9419
|
if (opts.type !== void 0) sldSz.attrs.push(attr(ATTR_TYPE8, opts.type));
|
|
9162
|
-
presPart.data =
|
|
9420
|
+
presPart.data = encode3(serializeXml(doc));
|
|
9163
9421
|
};
|
|
9164
9422
|
var SLIDE_SIZE_4_3 = {
|
|
9165
9423
|
width: emu(9144e3),
|
|
@@ -12413,14 +12671,19 @@ var addSlideImage = (slide, bytes, opts) => {
|
|
|
12413
12671
|
targetMode: "Internal"
|
|
12414
12672
|
});
|
|
12415
12673
|
pkg.setRels(slide[SLIDE_PART_NAME], rels);
|
|
12674
|
+
const rect = fitImageRect(
|
|
12675
|
+
{ x: opts.x, y: opts.y, w: opts.w, h: opts.h },
|
|
12676
|
+
opts.fit ?? "fill",
|
|
12677
|
+
readImagePixelSize(bytes)
|
|
12678
|
+
);
|
|
12416
12679
|
const pic = buildPicture({
|
|
12417
12680
|
id: nextShapeId(slide),
|
|
12418
12681
|
...opts.name !== void 0 ? { name: opts.name } : {},
|
|
12419
12682
|
rEmbed: newRId,
|
|
12420
|
-
x:
|
|
12421
|
-
y:
|
|
12422
|
-
w:
|
|
12423
|
-
h:
|
|
12683
|
+
x: rect.x,
|
|
12684
|
+
y: rect.y,
|
|
12685
|
+
w: rect.w,
|
|
12686
|
+
h: rect.h
|
|
12424
12687
|
});
|
|
12425
12688
|
return appendAndReturnNewShape(slide, pic);
|
|
12426
12689
|
};
|
|
@@ -12461,7 +12724,7 @@ var getSlideLayoutCount = (pres) => {
|
|
|
12461
12724
|
const pkg = pres[INTERNAL_PACKAGE];
|
|
12462
12725
|
let n = 0;
|
|
12463
12726
|
for (const part of pkg.parts) {
|
|
12464
|
-
if (part.contentType ===
|
|
12727
|
+
if (part.contentType === SLIDE_LAYOUT_CONTENT_TYPE2) n++;
|
|
12465
12728
|
}
|
|
12466
12729
|
return n;
|
|
12467
12730
|
};
|
|
@@ -12684,7 +12947,7 @@ var replaceTokensInPresentation = (pres, tokens) => {
|
|
|
12684
12947
|
const doc = parseXml(decode2(part.data));
|
|
12685
12948
|
const n = replaceTokensInTree(doc.root, tokens);
|
|
12686
12949
|
if (n > 0) {
|
|
12687
|
-
part.data =
|
|
12950
|
+
part.data = encode3(serializeXml(doc));
|
|
12688
12951
|
count += n;
|
|
12689
12952
|
}
|
|
12690
12953
|
}
|
|
@@ -12699,7 +12962,7 @@ var replaceTextInPresentation = (pres, from, to) => {
|
|
|
12699
12962
|
const doc = parseXml(decode2(part.data));
|
|
12700
12963
|
const n = replaceTextInTree(doc.root, from, to);
|
|
12701
12964
|
if (n > 0) {
|
|
12702
|
-
part.data =
|
|
12965
|
+
part.data = encode3(serializeXml(doc));
|
|
12703
12966
|
count += n;
|
|
12704
12967
|
}
|
|
12705
12968
|
}
|
|
@@ -12836,7 +13099,7 @@ var setSlideSections = (pres, sections) => {
|
|
|
12836
13099
|
doc.root.children = doc.root.children.filter((c2) => c2 !== extLst);
|
|
12837
13100
|
}
|
|
12838
13101
|
}
|
|
12839
|
-
presPart.data =
|
|
13102
|
+
presPart.data = encode3(serializeXml(doc));
|
|
12840
13103
|
return;
|
|
12841
13104
|
}
|
|
12842
13105
|
const sectionLst = ensureSectionLst(doc.root);
|
|
@@ -12855,7 +13118,7 @@ var setSlideSections = (pres, sections) => {
|
|
|
12855
13118
|
children: [elem(NAME_P14_SLD_ID_LST, { children: sldIds })]
|
|
12856
13119
|
});
|
|
12857
13120
|
});
|
|
12858
|
-
presPart.data =
|
|
13121
|
+
presPart.data = encode3(serializeXml(doc));
|
|
12859
13122
|
};
|
|
12860
13123
|
|
|
12861
13124
|
// src/api/fn/slide-deck.ts
|
|
@@ -12964,7 +13227,7 @@ var addSlide = (pres, options) => {
|
|
|
12964
13227
|
const layoutSpTree = firstChildElement(layoutCsld, NAME_SP_TREE4);
|
|
12965
13228
|
if (!layoutSpTree) throw new Error(`layout ${layoutPartName} missing <p:spTree>`);
|
|
12966
13229
|
const slideDoc = buildSlideFromLayout(layoutSpTree);
|
|
12967
|
-
const slideBytes =
|
|
13230
|
+
const slideBytes = encode3(serializeXml(slideDoc));
|
|
12968
13231
|
pkg.addPart(newSlidePartName, SLIDE_CONTENT_TYPE, slideBytes);
|
|
12969
13232
|
const slideRels = emptyRels();
|
|
12970
13233
|
slideRels.items.push({
|
|
@@ -12988,7 +13251,7 @@ var addSlide = (pres, options) => {
|
|
|
12988
13251
|
attrs: [attr(ATTR_ID13, String(newSldId)), attr(ATTR_R_ID3, newRId)]
|
|
12989
13252
|
})
|
|
12990
13253
|
);
|
|
12991
|
-
presPart.data =
|
|
13254
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
12992
13255
|
pres._slidesCache = null;
|
|
12993
13256
|
const slides = getSlides(pres);
|
|
12994
13257
|
const last = slides[slides.length - 1];
|
|
@@ -13023,7 +13286,7 @@ var removeSlide = (pres, slide) => {
|
|
|
13023
13286
|
return getAttrValue(c2, ATTR_R_ID3) !== removedRel.id;
|
|
13024
13287
|
});
|
|
13025
13288
|
}
|
|
13026
|
-
presPart.data =
|
|
13289
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
13027
13290
|
pkg.removePart(relsPartNameFor(slidePartName));
|
|
13028
13291
|
pkg.removePart(slidePartName);
|
|
13029
13292
|
pres._slidesCache = null;
|
|
@@ -13066,7 +13329,7 @@ var sortSlides = (pres, compareFn) => {
|
|
|
13066
13329
|
(c2) => !(c2.kind === "element" && c2.name.namespaceURI === NS.pml && c2.name.localName === "sldId")
|
|
13067
13330
|
);
|
|
13068
13331
|
sldIdLst.children = [...nonSldIdChildren, ...newOrder];
|
|
13069
|
-
presPart.data =
|
|
13332
|
+
presPart.data = encode3(serializeXml(doc));
|
|
13070
13333
|
pres._slidesCache = null;
|
|
13071
13334
|
};
|
|
13072
13335
|
var reverseSlides = (pres) => {
|
|
@@ -13118,7 +13381,7 @@ var moveSlide = (pres, slide, toIndex) => {
|
|
|
13118
13381
|
remaining.splice(insertAt, 0, target);
|
|
13119
13382
|
}
|
|
13120
13383
|
sldIdLst.children = remaining;
|
|
13121
|
-
presPart.data =
|
|
13384
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
13122
13385
|
pres._slidesCache = null;
|
|
13123
13386
|
};
|
|
13124
13387
|
var duplicateSlide = (pres, slide) => {
|
|
@@ -13152,7 +13415,7 @@ var duplicateSlide = (pres, slide) => {
|
|
|
13152
13415
|
attrs: [attr(ATTR_ID13, String(newSldId)), attr(ATTR_R_ID3, newRId)]
|
|
13153
13416
|
})
|
|
13154
13417
|
);
|
|
13155
|
-
presPart.data =
|
|
13418
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
13156
13419
|
pres._slidesCache = null;
|
|
13157
13420
|
const slides = getSlides(pres);
|
|
13158
13421
|
const dup = slides[slides.length - 1];
|
|
@@ -13250,7 +13513,7 @@ var importSlide = (targetPres, sourceSlide, targetLayout) => {
|
|
|
13250
13513
|
attrs: [attr(ATTR_ID13, String(newSldId)), attr(ATTR_R_ID3, newRId)]
|
|
13251
13514
|
})
|
|
13252
13515
|
);
|
|
13253
|
-
presPart.data =
|
|
13516
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
13254
13517
|
targetPres._slidesCache = null;
|
|
13255
13518
|
const slides = getSlides(targetPres);
|
|
13256
13519
|
const last = slides[slides.length - 1];
|
|
@@ -13270,7 +13533,7 @@ var mergePresentations = (targetPres, sourcePres, targetLayout) => {
|
|
|
13270
13533
|
};
|
|
13271
13534
|
|
|
13272
13535
|
// src/api/index.ts
|
|
13273
|
-
var VERSION = "0.
|
|
13536
|
+
var VERSION = "0.4.0" ;
|
|
13274
13537
|
|
|
13275
13538
|
// src/node.ts
|
|
13276
13539
|
var loadPresentationFile = async (path) => {
|
|
@@ -13281,6 +13544,6 @@ var savePresentationToFile = async (pres, path) => {
|
|
|
13281
13544
|
await writeFile(path, await savePresentation(pres));
|
|
13282
13545
|
};
|
|
13283
13546
|
|
|
13284
|
-
export { SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, VERSION, _internalPackageOf, addBlankSlide, addContentSlide, addSectionHeaderSlide, addSlide, addSlideAt, addSlideChart, addSlideComment, addSlideImage, addSlideLine, addSlideShape, addSlideTable, addSlideTextBox, addTitleSlide, appendShapeText, appendSlideNotes, bringShapeForward, bringShapeToFront, centerShapeOnSlide, clearAllHyperlinks, clearAllSlideComments, clearAllSlideNotes, clearShapeEffects, clearShapeFill, clearShapeStroke, clearSlideAnimations, clearSlideBackground, clearSlideComments, clearSlideHyperlinks, clearSlideShapes, clearSlideTransition, clearTableCellFill, cm, compactPackage, copyShape, createPresentation, duplicateSlide, duplicateSlideAt, emu, findChartByKind, findChartsBySeriesName, findChartsWithDataLabels, findChartsWithTrendlines, findCommentAuthorByName, findCommentsAfter, findCommentsBefore, findCommentsByAuthor, findCommentsByText, findEmptyPlaceholders, findFlippedShapes, findLayoutsWithPlaceholderType, findOverlappingShapePairs, findShapeById, findShapeByName, findShapeByText, findShapeInPresentation, findShapesAtPoint, findShapesByEffect, findShapesByHyperlink, findShapesByKind, findShapesByName, findShapesByPreset, findShapesByText, findShapesInRect, findShapesOutsideCanvas, findShapesWithAnimation, findShapesWithHyperlinks, findSlideByPartName, findSlideByText, findSlideByTitle, findSlideLayout, findSlideLayoutByPartName, findSlideLayoutByType, findSlidePlaceholder, findSlidePlaceholderByIdx, findSlidePlaceholders, findSlidesByHyperlink, findSlidesByLayoutName, findSlidesByLayoutPartName, findSlidesByLayoutType, findSlidesByNotes, findSlidesByText, findSlidesWithChartKind, findSlidesWithChartTrendlines, findSlidesWithCommentsByAuthor, getAllCharts, getAllComments, getAllHyperlinks, getAllImages, getAllNotes, getAllShapes, getAllTables, getCommentAuthor, getCommentAuthors, getCommentDate, getCommentPosition, getCommentSlide, getCommentText, getCommentsSortedByDate, getCoreProperties, getDistinctHyperlinkUrls, getEmptySlides, getExtendedProperties, getGroupChildren, getGroupTransform, getHiddenSlides, getMaxShapeId, getMaxShapeIdInPresentation, getMediaParts, getOrphanMediaPartNames, getOutlineText, getPackageSize, getParagraphAlignment, getParagraphBullet, getParagraphBulletImageBytes, getParagraphBulletStyle, getParagraphIndent, getParagraphLevel, getParagraphLineSpacing, getParagraphPropertiesEffective, getParagraphSpacing, getPresentationChartCountsBySlide, getPresentationChartKindCounts, getPresentationCommentCountsByAuthor, getPresentationCommentCountsBySlide, getPresentationCommenters, getPresentationCreated, getPresentationFonts, getPresentationHyperlinkCountsBySlide, getPresentationImageCountsBySlide, getPresentationModified, getPresentationNotesLength, getPresentationNotesLengthsBySlide, getPresentationNotesText, getPresentationShapeCountsBySlide, getPresentationSummary, getPresentationTableCountsBySlide, getPresentationText, getPresentationTextLength, getPresentationTextLengthsBySlide, getPresentationTheme, getShapeAdjustValues, getShapeAltTitle, getShapeAnimation, getShapeAt, getShapeBodyPrEffective, getShapeBounds, getShapeBoundsResolved, getShapeCenter, getShapeChartCategories, getShapeChartKind, getShapeChartSeriesNames, getShapeChartSeriesValues, getShapeChartSpec, getShapeClickAction, getShapeCustomGeometry, getShapeDescription, getShapeEffect, getShapeEffects, getShapeEffectsEffective, getShapeFill, getShapeFillColor, getShapeFillColorResolved, getShapeFillEffective, getShapeFlip, getShapeGradientFill, getShapeGradientFillEffective, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeId, getShapeImageBiLevelThreshold, getShapeImageBrightness, getShapeImageBytes, getShapeImageContrast, getShapeImageCrop, getShapeImageDuotone, getShapeImageFillBytes, getShapeImageFormat, getShapeImageLinkUrl, getShapeImageOpacity, getShapeImagePartName, getShapeIndex, getShapeKind, getShapeName, getShapeParagraphCount, getShapeParagraphElements, getShapePatternFill, getShapePlaceholderIdx, getShapePlaceholderType, getShapePosition, getShapePreset, getShapeRotation, getShapeRunClickAction, getShapeRunCount, getShapeRunFormat, getShapeRunFormatEffective, getShapeRunHyperlink, getShapeRunHyperlinkTooltip, getShapeRunText, getShapeSize, getShapeSlide, getShapeStroke, getShapeStrokeArrow, getShapeStrokeCap, getShapeStrokeColor, getShapeStrokeColorResolved, getShapeStrokeCompound, getShapeStrokeDash, getShapeStrokeEffective, getShapeStrokeJoin, getShapeStrokeWidth, getShapeText, getShapeTextAnchor, getShapeTextAutoFit, getShapeTextAutoFitParams, getShapeTextBodyRotationDeg, getShapeTextColumns, getShapeTextDirection, getShapeTextMargins, getShapeTextWrap, getShapeXmlString, getShapeZIndex, getShapesBounds, getSlideAt, getSlideBackground, getSlideBackgroundGradientFill, getSlideBackgroundImageBytes, getSlideBackgroundPatternFill, getSlideBody, getSlideCharts, getSlideColorMapOverride, getSlideCommentAuthors, getSlideComments, getSlideCount, getSlideIndex, getSlideInfo, getSlideLayout, getSlideLayoutBackground, getSlideLayoutBackgroundGradientFill, getSlideLayoutBackgroundImageBytes, getSlideLayoutBackgroundPatternFill, getSlideLayoutBackgroundShapes, getSlideLayoutCount, getSlideLayoutName, getSlideLayoutPartName, getSlideLayoutPlaceholders, getSlideLayoutShapes, getSlideLayoutType, getSlideLayoutUsageCounts, getSlideLayoutUsageCountsByType, getSlideLayouts, getSlideMasterBackground, getSlideMasterBackgroundGradientFill, getSlideMasterBackgroundImageBytes, getSlideMasterBackgroundPatternFill, getSlideMasterCount, getSlideMasterPartName, getSlideMasterPartNames, getSlideMasterShapes, getSlideMasterUsageCounts, getSlideMediaPartNames, getSlideNotes, getSlideNotesLength, getSlideOutline, getSlidePartName, getSlideSections, getSlideShapes, getSlideSize, getSlideTables, getSlideText, getSlideTextLength, getSlideTitle, getSlideTransition, getSlideXmlString, getSlides, getSlidesByLayout, getSlidesWithCharts, getSlidesWithComments, getSlidesWithEmptyPlaceholders, getSlidesWithHyperlinks, getSlidesWithImages, getSlidesWithNotes, getSlidesWithOverlap, getSlidesWithTables, getTableCell, getTableCellAlignment, getTableCellAnchor, getTableCellBorders, getTableCellFill, getTableCellMargins, getTableCellParagraphs, getTableCellPosition, getTableCellSpan, getTableCellText, getTableCellTextDirection, getTableCells, getTableColumnWidths, getTableDimensions, getTableRowHeights, getTableSize, getTableStyleFlags, getTableStyleId, getThumbnail, getUnusedSlideLayouts, getUnusedSlideMasters, getVisibleSlides, hasShapeImage, hasShapeText, hasSlideNotes, importSlide, inches, incrementRevision, insertTableColumn, insertTableRow, isChartShape, isParagraphBulletPicture, isShapeHidden, isShapeImageGrayscale, isShapePlaceholder, isShapeTextBox, isSlideHidden, isTableShape, listPackageParts, loadPresentation, loadPresentationFile, mergePresentations, mm, moveSlide, pointInShape, pt, readPackagePart, removeShape, removeSlide, removeSlideComment, removeSlideNotes, removeTableColumn, removeTableRow, removeThumbnail, renameShape, replaceHyperlink, replaceTextInNotes, replaceTextInPresentation, replaceTextInSlide, replaceTextInSlideNotes, replaceTokensInPresentation, replaceTokensInSlide, resolveDrawingColor, reverseSlides, savePresentation, savePresentationToFile, searchSlides, sendShapeBackward, sendShapeToBack, setChartSpec, setCoreProperties, setExtendedProperties, setMediaPartBytes, setParagraphAlignment, setParagraphBullet, setParagraphLevel, setParagraphSpacing, setShapeAlignment, setShapeAltTitle, setShapeAnimation, setShapeBounds, setShapeBullets, setShapeClickAction, setShapeDescription, setShapeFill, setShapeFlip, setShapeGlow, setShapeGradientFill, setShapeHidden, setShapeHyperlink, setShapeImage, setShapeImageBrightness, setShapeImageContrast, setShapeImageCrop, setShapeImageFill, setShapeImageOpacity, setShapeNoFill, setShapeNoStroke, setShapePatternFill, setShapePosition, setShapeRotation, setShapeRunFormat, setShapeRunHyperlink, setShapeRunText, setShapeShadow, setShapeSize, setShapeStroke, setShapeStrokeArrow, setShapeStrokeCap, setShapeStrokeCompound, setShapeStrokeDash, setShapeStrokeJoin, setShapeText, setShapeTextAnchor, setShapeTextAutoFit, setShapeTextBodyRotationDeg, setShapeTextColumns, setShapeTextDirection, setShapeTextFormat, setShapeTextMargins, setShapeTextWrap, setShapeZIndex, setSlideBackground, setSlideBackgroundImage, setSlideBody, setSlideHidden, setSlideLayout, setSlideNotes, setSlidePlaceholders, setSlideSections, setSlideSize, setSlideTitle, setSlideTransition, setTableCellAlignment, setTableCellAnchor, setTableCellBorders, setTableCellFill, setTableCellMargins, setTableCellText, setTableCellTextDirection, setTableCellTextFormat, setTableColumnWidth, setTableRowHeight, setTableStyleFlags, setTableStyleId, setThumbnail, shapesOverlap, slideHasAnimations, slidesUsingMediaPart, sortSlides, swapSlides, touchModified, translateShapes, validatePresentation };
|
|
13547
|
+
export { SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, VERSION, _internalPackageOf, addBlankSlide, addContentSlide, addSectionHeaderSlide, addSlide, addSlideAt, addSlideChart, addSlideComment, addSlideImage, addSlideLine, addSlideShape, addSlideTable, addSlideTextBox, addTitleSlide, appendShapeText, appendSlideNotes, bringShapeForward, bringShapeToFront, centerShapeOnSlide, clearAllHyperlinks, clearAllSlideComments, clearAllSlideNotes, clearShapeEffects, clearShapeFill, clearShapeStroke, clearSlideAnimations, clearSlideBackground, clearSlideComments, clearSlideHyperlinks, clearSlideShapes, clearSlideTransition, clearTableCellFill, cm, compactPackage, copyShape, createPresentation, duplicateSlide, duplicateSlideAt, emu, findChartByKind, findChartsBySeriesName, findChartsWithDataLabels, findChartsWithTrendlines, findCommentAuthorByName, findCommentsAfter, findCommentsBefore, findCommentsByAuthor, findCommentsByText, findEmptyPlaceholders, findFlippedShapes, findLayoutsWithPlaceholderType, findOverlappingShapePairs, findShapeById, findShapeByName, findShapeByText, findShapeInPresentation, findShapesAtPoint, findShapesByEffect, findShapesByHyperlink, findShapesByKind, findShapesByName, findShapesByPreset, findShapesByText, findShapesInRect, findShapesOutsideCanvas, findShapesWithAnimation, findShapesWithHyperlinks, findSlideByPartName, findSlideByText, findSlideByTitle, findSlideLayout, findSlideLayoutByPartName, findSlideLayoutByType, findSlidePlaceholder, findSlidePlaceholderByIdx, findSlidePlaceholders, findSlidesByHyperlink, findSlidesByLayoutName, findSlidesByLayoutPartName, findSlidesByLayoutType, findSlidesByNotes, findSlidesByText, findSlidesWithChartKind, findSlidesWithChartTrendlines, findSlidesWithCommentsByAuthor, getAllCharts, getAllComments, getAllHyperlinks, getAllImages, getAllNotes, getAllShapes, getAllTables, getCommentAuthor, getCommentAuthors, getCommentDate, getCommentPosition, getCommentSlide, getCommentText, getCommentsSortedByDate, getCoreProperties, getDistinctHyperlinkUrls, getEmptySlides, getExtendedProperties, getGroupChildren, getGroupTransform, getHiddenSlides, getMaxShapeId, getMaxShapeIdInPresentation, getMediaParts, getOrphanMediaPartNames, getOutlineText, getPackageSize, getParagraphAlignment, getParagraphBullet, getParagraphBulletImageBytes, getParagraphBulletStyle, getParagraphIndent, getParagraphLevel, getParagraphLineSpacing, getParagraphPropertiesEffective, getParagraphSpacing, getPresentationChartCountsBySlide, getPresentationChartKindCounts, getPresentationCommentCountsByAuthor, getPresentationCommentCountsBySlide, getPresentationCommenters, getPresentationCreated, getPresentationFonts, getPresentationHyperlinkCountsBySlide, getPresentationImageCountsBySlide, getPresentationModified, getPresentationNotesLength, getPresentationNotesLengthsBySlide, getPresentationNotesText, getPresentationShapeCountsBySlide, getPresentationSummary, getPresentationTableCountsBySlide, getPresentationText, getPresentationTextLength, getPresentationTextLengthsBySlide, getPresentationTheme, getShapeAdjustValues, getShapeAltTitle, getShapeAnimation, getShapeAt, getShapeBodyPrEffective, getShapeBounds, getShapeBoundsResolved, getShapeCenter, getShapeChartCategories, getShapeChartKind, getShapeChartSeriesNames, getShapeChartSeriesValues, getShapeChartSpec, getShapeClickAction, getShapeCustomGeometry, getShapeDescription, getShapeEffect, getShapeEffects, getShapeEffectsEffective, getShapeFill, getShapeFillColor, getShapeFillColorResolved, getShapeFillEffective, getShapeFlip, getShapeGradientFill, getShapeGradientFillEffective, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeId, getShapeImageBiLevelThreshold, getShapeImageBrightness, getShapeImageBytes, getShapeImageContrast, getShapeImageCrop, getShapeImageDuotone, getShapeImageFillBytes, getShapeImageFormat, getShapeImageLinkUrl, getShapeImageOpacity, getShapeImagePartName, getShapeIndex, getShapeKind, getShapeName, getShapeParagraphCount, getShapeParagraphElements, getShapePatternFill, getShapePlaceholderIdx, getShapePlaceholderType, getShapePosition, getShapePreset, getShapeRotation, getShapeRunClickAction, getShapeRunCount, getShapeRunFormat, getShapeRunFormatEffective, getShapeRunHyperlink, getShapeRunHyperlinkTooltip, getShapeRunText, getShapeSize, getShapeSlide, getShapeStroke, getShapeStrokeArrow, getShapeStrokeCap, getShapeStrokeColor, getShapeStrokeColorResolved, getShapeStrokeCompound, getShapeStrokeDash, getShapeStrokeEffective, getShapeStrokeJoin, getShapeStrokeWidth, getShapeText, getShapeTextAnchor, getShapeTextAutoFit, getShapeTextAutoFitParams, getShapeTextBodyRotationDeg, getShapeTextColumns, getShapeTextDirection, getShapeTextMargins, getShapeTextWrap, getShapeXmlString, getShapeZIndex, getShapesBounds, getSlideAt, getSlideBackground, getSlideBackgroundGradientFill, getSlideBackgroundImageBytes, getSlideBackgroundPatternFill, getSlideBody, getSlideCharts, getSlideColorMapOverride, getSlideCommentAuthors, getSlideComments, getSlideCount, getSlideIndex, getSlideInfo, getSlideLayout, getSlideLayoutBackground, getSlideLayoutBackgroundGradientFill, getSlideLayoutBackgroundImageBytes, getSlideLayoutBackgroundPatternFill, getSlideLayoutBackgroundShapes, getSlideLayoutCount, getSlideLayoutName, getSlideLayoutPartName, getSlideLayoutPlaceholders, getSlideLayoutShapes, getSlideLayoutType, getSlideLayoutUsageCounts, getSlideLayoutUsageCountsByType, getSlideLayouts, getSlideMasterBackground, getSlideMasterBackgroundGradientFill, getSlideMasterBackgroundImageBytes, getSlideMasterBackgroundPatternFill, getSlideMasterCount, getSlideMasterPartName, getSlideMasterPartNames, getSlideMasterShapes, getSlideMasterUsageCounts, getSlideMediaPartNames, getSlideNotes, getSlideNotesLength, getSlideOutline, getSlidePartName, getSlideSections, getSlideShapes, getSlideSize, getSlideTables, getSlideText, getSlideTextLength, getSlideTitle, getSlideTransition, getSlideXmlString, getSlides, getSlidesByLayout, getSlidesWithCharts, getSlidesWithComments, getSlidesWithEmptyPlaceholders, getSlidesWithHyperlinks, getSlidesWithImages, getSlidesWithNotes, getSlidesWithOverlap, getSlidesWithTables, getTableCell, getTableCellAlignment, getTableCellAnchor, getTableCellBorders, getTableCellFill, getTableCellMargins, getTableCellParagraphs, getTableCellPosition, getTableCellSpan, getTableCellText, getTableCellTextDirection, getTableCells, getTableColumnWidths, getTableDimensions, getTableRowHeights, getTableSize, getTableStyleFlags, getTableStyleId, getThumbnail, getUnusedSlideLayouts, getUnusedSlideMasters, getVisibleSlides, hasShapeImage, hasShapeText, hasSlideNotes, importSlide, inches, incrementRevision, insertTableColumn, insertTableRow, isChartShape, isParagraphBulletPicture, isShapeHidden, isShapeImageGrayscale, isShapePlaceholder, isShapeTextBox, isSlideHidden, isTableShape, listPackageParts, loadPresentation, loadPresentationFile, mergePresentations, mergeTableCells, mm, moveSlide, pointInShape, pt, readPackagePart, removeShape, removeSlide, removeSlideComment, removeSlideNotes, removeTableColumn, removeTableRow, removeThumbnail, renameShape, replaceHyperlink, replaceTextInNotes, replaceTextInPresentation, replaceTextInSlide, replaceTextInSlideNotes, replaceTokensInPresentation, replaceTokensInSlide, resolveDrawingColor, reverseSlides, savePresentation, savePresentationToFile, searchSlides, sendShapeBackward, sendShapeToBack, setChartSpec, setCoreProperties, setExtendedProperties, setMediaPartBytes, setParagraphAlignment, setParagraphBullet, setParagraphLevel, setParagraphSpacing, setShapeAlignment, setShapeAltTitle, setShapeAnimation, setShapeBounds, setShapeBullets, setShapeClickAction, setShapeDescription, setShapeFill, setShapeFlip, setShapeGlow, setShapeGradientFill, setShapeHidden, setShapeHyperlink, setShapeImage, setShapeImageBrightness, setShapeImageContrast, setShapeImageCrop, setShapeImageFill, setShapeImageOpacity, setShapeNoFill, setShapeNoStroke, setShapePatternFill, setShapePosition, setShapeRotation, setShapeRunFormat, setShapeRunHyperlink, setShapeRunText, setShapeShadow, setShapeSize, setShapeStroke, setShapeStrokeArrow, setShapeStrokeCap, setShapeStrokeCompound, setShapeStrokeDash, setShapeStrokeJoin, setShapeText, setShapeTextAnchor, setShapeTextAutoFit, setShapeTextBodyRotationDeg, setShapeTextColumns, setShapeTextDirection, setShapeTextFormat, setShapeTextMargins, setShapeTextWrap, setShapeZIndex, setSlideBackground, setSlideBackgroundImage, setSlideBody, setSlideHidden, setSlideLayout, setSlideNotes, setSlidePlaceholders, setSlideSections, setSlideSize, setSlideTitle, setSlideTransition, setTableCellAlignment, setTableCellAnchor, setTableCellBorders, setTableCellFill, setTableCellMargins, setTableCellText, setTableCellTextDirection, setTableCellTextFormat, setTableColumnWidth, setTableRowHeight, setTableStyleFlags, setTableStyleId, setThumbnail, shapesOverlap, slideHasAnimations, slidesUsingMediaPart, sortSlides, swapSlides, touchModified, translateShapes, validatePresentation };
|
|
13285
13548
|
//# sourceMappingURL=node.js.map
|
|
13286
13549
|
//# sourceMappingURL=node.js.map
|