pptx-kit 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +25 -5
- package/dist/index.js.map +1 -1
- package/dist/node.js +25 -5
- package/dist/node.js.map +1 -1
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -1127,6 +1127,7 @@ var VIEW_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.pre
|
|
|
1127
1127
|
var SLIDE_MASTER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml";
|
|
1128
1128
|
var SLIDE_LAYOUT_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
|
|
1129
1129
|
var THEME_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.theme+xml";
|
|
1130
|
+
var TABLE_STYLES_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml";
|
|
1130
1131
|
var CORE_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-package.core-properties+xml";
|
|
1131
1132
|
var EXTENDED_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
|
1132
1133
|
var XML_DECL = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';
|
|
@@ -1140,10 +1141,11 @@ var LAYOUT_OBJ_XML = `${XML_DECL}<p:sldLayout xmlns:a="http://schemas.openxmlfor
|
|
|
1140
1141
|
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
1142
|
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
1143
|
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"/>`;
|
|
1144
|
+
var TABLE_STYLES_XML = `${XML_DECL}<a:tblStyleLst xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" def="{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"/>`;
|
|
1143
1145
|
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
1146
|
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
1147
|
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>`;
|
|
1148
|
+
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"/><Relationship Id="rId5" Type="${RT}/tableStyles" Target="tableStyles.xml"/></Relationships>`;
|
|
1147
1149
|
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
1150
|
var LAYOUT_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>`;
|
|
1149
1151
|
var TEXT_ENCODER2 = new TextEncoder();
|
|
@@ -1161,6 +1163,7 @@ var buildBlankDeck = (aspect) => {
|
|
|
1161
1163
|
add("/ppt/presProps.xml", PRES_PROPS_CONTENT_TYPE, PRES_PROPS_XML);
|
|
1162
1164
|
add("/ppt/viewProps.xml", VIEW_PROPS_CONTENT_TYPE, VIEW_PROPS_XML);
|
|
1163
1165
|
add("/ppt/theme/theme1.xml", THEME_CONTENT_TYPE, THEME_XML);
|
|
1166
|
+
add("/ppt/tableStyles.xml", TABLE_STYLES_CONTENT_TYPE, TABLE_STYLES_XML);
|
|
1164
1167
|
add("/ppt/slideMasters/slideMaster1.xml", SLIDE_MASTER_CONTENT_TYPE, SLIDE_MASTER_XML);
|
|
1165
1168
|
add("/ppt/slideLayouts/slideLayout1.xml", SLIDE_LAYOUT_CONTENT_TYPE, LAYOUT_BLANK_XML);
|
|
1166
1169
|
add("/ppt/slideLayouts/slideLayout2.xml", SLIDE_LAYOUT_CONTENT_TYPE, LAYOUT_TITLE_XML);
|
|
@@ -2929,6 +2932,7 @@ var buildPicture = (opts) => {
|
|
|
2929
2932
|
|
|
2930
2933
|
// src/internal/presentationml/table-builder.ts
|
|
2931
2934
|
var TABLE_URI = "http://schemas.openxmlformats.org/drawingml/2006/table";
|
|
2935
|
+
var DEFAULT_TABLE_STYLE_ID = "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}";
|
|
2932
2936
|
var NAME_GRAPHIC_FRAME = qname("p", "graphicFrame", NS.pml);
|
|
2933
2937
|
var NAME_NV_GRAPHIC_FRAME_PR2 = qname("p", "nvGraphicFramePr", NS.pml);
|
|
2934
2938
|
var NAME_C_NV_PR7 = qname("p", "cNvPr", NS.pml);
|
|
@@ -2942,6 +2946,7 @@ var NAME_GRAPHIC = qname("a", "graphic", NS.dml);
|
|
|
2942
2946
|
var NAME_GRAPHIC_DATA = qname("a", "graphicData", NS.dml);
|
|
2943
2947
|
var NAME_TBL = qname("a", "tbl", NS.dml);
|
|
2944
2948
|
var NAME_TBL_PR = qname("a", "tblPr", NS.dml);
|
|
2949
|
+
var NAME_TABLE_STYLE_ID = qname("a", "tableStyleId", NS.dml);
|
|
2945
2950
|
var NAME_TBL_GRID = qname("a", "tblGrid", NS.dml);
|
|
2946
2951
|
var NAME_GRID_COL = qname("a", "gridCol", NS.dml);
|
|
2947
2952
|
var NAME_TR = qname("a", "tr", NS.dml);
|
|
@@ -3050,11 +3055,15 @@ var buildTable = (opts) => {
|
|
|
3050
3055
|
attrs: [attr(ATTR_CX8, String(Math.round(opts.w))), attr(ATTR_CY8, String(Math.round(opts.h)))]
|
|
3051
3056
|
});
|
|
3052
3057
|
const xfrm = elem(NAME_P_XFRM3, { children: [off, ext] });
|
|
3058
|
+
const tableStyleId = elem(NAME_TABLE_STYLE_ID, {
|
|
3059
|
+
children: [text(opts.styleId ?? DEFAULT_TABLE_STYLE_ID)]
|
|
3060
|
+
});
|
|
3053
3061
|
const tblPr = elem(NAME_TBL_PR, {
|
|
3054
3062
|
attrs: [
|
|
3055
3063
|
attr(ATTR_FIRST_ROW, opts.firstRow ?? true ? "1" : "0"),
|
|
3056
3064
|
attr(ATTR_BAND_ROW, opts.bandRow ?? true ? "1" : "0")
|
|
3057
|
-
]
|
|
3065
|
+
],
|
|
3066
|
+
children: [tableStyleId]
|
|
3058
3067
|
});
|
|
3059
3068
|
const tblGrid = elem(NAME_TBL_GRID, {
|
|
3060
3069
|
children: colWidths.map(
|
|
@@ -4450,7 +4459,7 @@ var seriesElement = (spec, seriesIdx, sheet) => {
|
|
|
4450
4459
|
valNode(c("order"), seriesIdx),
|
|
4451
4460
|
elem(c("tx"), { children: [strRef(headerCellFormula, [series.name])] })
|
|
4452
4461
|
];
|
|
4453
|
-
if (series.lineWidthEmu !== void 0 || series.lineDash !== void 0) {
|
|
4462
|
+
if (spec.kind === "line" || series.lineWidthEmu !== void 0 || series.lineDash !== void 0) {
|
|
4454
4463
|
children.push(seriesSpPr(color, series.lineWidthEmu, series.lineDash));
|
|
4455
4464
|
} else {
|
|
4456
4465
|
children.push(solidFillSpPr(color));
|
|
@@ -4693,7 +4702,7 @@ var buildLineChart = (spec, sheet) => {
|
|
|
4693
4702
|
if (spec.dropLines) children.push(elem(c("dropLines")));
|
|
4694
4703
|
if (spec.hiLowLines) children.push(elem(c("hiLowLines")));
|
|
4695
4704
|
children.push(
|
|
4696
|
-
valNode(c("marker"), "1"),
|
|
4705
|
+
valNode(c("marker"), spec.lineMarkers === false ? "0" : "1"),
|
|
4697
4706
|
valNode(c("axId"), CAT_AX_ID),
|
|
4698
4707
|
valNode(c("axId"), VAL_AX_ID)
|
|
4699
4708
|
);
|
|
@@ -5577,6 +5586,16 @@ var readChartSpec = (root) => {
|
|
|
5577
5586
|
const hiLowLinesEl = firstChildElement(plotted, qname("c", "hiLowLines", NS_C2));
|
|
5578
5587
|
const dropLines = dropLinesEl !== null ? true : void 0;
|
|
5579
5588
|
const hiLowLines = hiLowLinesEl !== null ? true : void 0;
|
|
5589
|
+
let lineMarkers;
|
|
5590
|
+
if (kind === "line") {
|
|
5591
|
+
const markerEl = firstChildElement(plotted, qname("c", "marker", NS_C2));
|
|
5592
|
+
if (markerEl === null) {
|
|
5593
|
+
lineMarkers = false;
|
|
5594
|
+
} else {
|
|
5595
|
+
const v = getAttrValue(markerEl, ATTR_VAL8);
|
|
5596
|
+
lineMarkers = v === null ? true : v === "1" || v === "true";
|
|
5597
|
+
}
|
|
5598
|
+
}
|
|
5580
5599
|
let gapWidthPct;
|
|
5581
5600
|
let overlapPct;
|
|
5582
5601
|
if (kind === "column" || kind === "bar") {
|
|
@@ -5989,6 +6008,7 @@ var readChartSpec = (root) => {
|
|
|
5989
6008
|
...grouping !== void 0 ? { grouping } : {},
|
|
5990
6009
|
...dropLines !== void 0 ? { dropLines } : {},
|
|
5991
6010
|
...hiLowLines !== void 0 ? { hiLowLines } : {},
|
|
6011
|
+
...lineMarkers !== void 0 ? { lineMarkers } : {},
|
|
5992
6012
|
...gapWidthPct !== void 0 ? { gapWidthPct } : {},
|
|
5993
6013
|
...overlapPct !== void 0 ? { overlapPct } : {},
|
|
5994
6014
|
...legend !== void 0 ? { legend } : {},
|
|
@@ -13653,7 +13673,7 @@ var mergePresentations = (targetPres, sourcePres, targetLayout) => {
|
|
|
13653
13673
|
};
|
|
13654
13674
|
|
|
13655
13675
|
// src/api/index.ts
|
|
13656
|
-
var VERSION = "0.6.
|
|
13676
|
+
var VERSION = "0.6.1" ;
|
|
13657
13677
|
|
|
13658
13678
|
// src/node.ts
|
|
13659
13679
|
var loadPresentationFile = async (path) => {
|