@x12i/reportic-render-pptx 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.js +313 -0
- package/dist/index.js.map +1 -0
- package/package.json +30 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Reportic contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @x12i/reportic-render-pptx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
reportic-render-pptx — typed, portable reporting from Markdown and data.
|
|
4
|
+
|
|
5
|
+
ESM package with TypeScript declarations. Requires Node.js 22 or later; Reportic format 0.2 and compatible Reportic 0.2.x workspace packages.
|
|
6
|
+
|
|
7
|
+
See the Reportic workspace README and docs/studio.md for setup, SDK examples, the editor, catalog, host identity integration, CLI, HTTP, MCP, and operational limits.
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
// packages/reportic-render-pptx/src/connectors.ts
|
|
2
|
+
import JSZip from "jszip";
|
|
3
|
+
async function attachConnectors(bytes) {
|
|
4
|
+
const zip = await JSZip.loadAsync(bytes);
|
|
5
|
+
for (const path of Object.keys(zip.files).filter((n) => /^ppt\/slides\/slide\d+\.xml$/.test(n))) {
|
|
6
|
+
let xml = await zip.file(path).async("string");
|
|
7
|
+
xml = xml.replace(/<a:p>([\s\S]*?)<\/a:p>/g, (_whole, body) => {
|
|
8
|
+
let first = true;
|
|
9
|
+
return "<a:p>" + body.replace(/<a:pPr\b[^>]*\/>|<a:pPr\b[^>]*>[\s\S]*?<\/a:pPr>/g, (p) => first ? (first = false, p) : "") + "</a:p>";
|
|
10
|
+
});
|
|
11
|
+
if (!xml.includes("reportic-edge--")) {
|
|
12
|
+
zip.file(path, xml);
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const ids = /* @__PURE__ */ new Map();
|
|
16
|
+
for (const match of xml.matchAll(/<p:cNvPr id="(\d+)" name="reportic-node--([A-Za-z0-9_]+)"/g)) ids.set(match[2], match[1]);
|
|
17
|
+
xml = xml.replace(/<p:sp>[\s\S]*?<\/p:sp>/g, (shape) => {
|
|
18
|
+
const marker = shape.match(/name="reportic-edge--([A-Za-z0-9_]+)--([A-Za-z0-9_]+)"/);
|
|
19
|
+
if (!marker) return shape;
|
|
20
|
+
const from = ids.get(marker[1]), to = ids.get(marker[2]);
|
|
21
|
+
if (!from || !to) throw new Error("A graph connector has no native node.");
|
|
22
|
+
return shape.replace("<p:sp>", "<p:cxnSp>").replace("</p:sp>", "</p:cxnSp>").replace("<p:nvSpPr>", "<p:nvCxnSpPr>").replace("</p:nvSpPr>", "</p:nvCxnSpPr>").replace(/<p:cNvSpPr\s*\/>/, `<p:cNvCxnSpPr><a:stCxn id="${from}" idx="3"/><a:endCxn id="${to}" idx="1"/></p:cNvCxnSpPr>`);
|
|
23
|
+
});
|
|
24
|
+
zip.file(path, xml);
|
|
25
|
+
}
|
|
26
|
+
return zip.generateAsync({ type: "uint8array", compression: "DEFLATE" });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// packages/reportic-render-pptx/src/index.ts
|
|
30
|
+
import pptxgen from "pptxgenjs";
|
|
31
|
+
import sharp from "sharp";
|
|
32
|
+
import { diagramVisuals, chartTable } from "@x12i/reportic-render-html";
|
|
33
|
+
import { themeTokens, fail, formatValue, limitsFor, checkAbort, safeUrl, semanticRule, officeColor } from "@x12i/reportic-core";
|
|
34
|
+
async function renderPptx(report, options = {}) {
|
|
35
|
+
const pptx = new pptxgen();
|
|
36
|
+
pptx.layout = options.pptx?.layout === "standard" ? "LAYOUT_4X3" : "LAYOUT_WIDE";
|
|
37
|
+
pptx.author = "Reportic";
|
|
38
|
+
pptx.subject = "Data-driven report";
|
|
39
|
+
pptx.title = report.title;
|
|
40
|
+
pptx.company = "Reportic";
|
|
41
|
+
const t = themeTokens(options.theme ?? report.theme);
|
|
42
|
+
const c = officeColor;
|
|
43
|
+
const W = options.pptx?.layout === "standard" ? 10 : 13.333, H = 7.5, accent = c(t.accent);
|
|
44
|
+
pptx.theme = { headFontFace: t.headingFont.split(",")[0], bodyFontFace: t.fontFamily.split(",")[0] };
|
|
45
|
+
let activeStyle = {};
|
|
46
|
+
const textStyle = () => ({ ...activeStyle.color ? { color: c(activeStyle.color) } : {}, ...activeStyle.fontSize ? { fontSize: Number(activeStyle.fontSize) * 0.75 } : {}, ...activeStyle.fontFamily ? { fontFace: activeStyle.fontFamily } : {}, ...activeStyle.fontWeight ? { bold: activeStyle.fontWeight === "bold" || Number(activeStyle.fontWeight) >= 600 } : {}, ...activeStyle.textAlign ? { align: activeStyle.textAlign } : {} });
|
|
47
|
+
let slide;
|
|
48
|
+
let y = 1.25;
|
|
49
|
+
let currentTitle = report.title;
|
|
50
|
+
let slideCount = 0;
|
|
51
|
+
const diagrams = await diagramVisuals({ ...report, nodes: report.nodes.filter((n) => n.type !== "diagram" || !n.props.nativeGraph) }, options);
|
|
52
|
+
function newSlide(title = currentTitle) {
|
|
53
|
+
if (++slideCount > limitsFor(options).slides) fail("LIMIT_EXCEEDED", `Presentation exceeds ${limitsFor(options).slides} slides.`, { phase: "render" });
|
|
54
|
+
slide = pptx.addSlide();
|
|
55
|
+
slide.background = { color: c(t.background) };
|
|
56
|
+
slide.addText(title, { x: 0.6, y: 0.35, w: W - 1.2, h: 0.65, fontSize: Math.round(t.headingSize * 2 / 3), fontFace: t.headingFont.split(",")[0], color: c(t.text), bold: false, margin: 0, breakLine: false });
|
|
57
|
+
slide.addShape(pptx.ShapeType.line, { x: 0.6, y: 1.12, w: W - 1.2, h: 0, line: { color: c(t.border), width: 0.7 } });
|
|
58
|
+
slide.addText("REPORTIC / " + report.id.toUpperCase(), { x: 0.6, y: 7.12, w: W - 2, h: 0.18, fontSize: 8, color: c(t.muted), margin: 0 });
|
|
59
|
+
slide.addText(String(slideCount), { x: W - 1, y: 7.12, w: 0.4, h: 0.18, fontSize: 8, color: c(t.muted), align: "right", margin: 0 });
|
|
60
|
+
y = 1.45;
|
|
61
|
+
}
|
|
62
|
+
newSlide();
|
|
63
|
+
function text(text2, opts = {}) {
|
|
64
|
+
const fontSize = opts.fontSize ?? textStyle().fontSize ?? Math.round(t.bodySize * 17 / 14);
|
|
65
|
+
const width = opts.w ?? W - 1.2;
|
|
66
|
+
const chars = Math.floor(width * 9.5 * 17 / fontSize);
|
|
67
|
+
const paragraphs = String(text2).split("\n");
|
|
68
|
+
const lines = [];
|
|
69
|
+
for (const para of paragraphs) {
|
|
70
|
+
let line = "";
|
|
71
|
+
for (const word of para.split(" ")) {
|
|
72
|
+
if ((line + " " + word).length > chars && line) {
|
|
73
|
+
lines.push(line);
|
|
74
|
+
line = word;
|
|
75
|
+
} else line += (line ? " " : "") + word;
|
|
76
|
+
}
|
|
77
|
+
lines.push(line);
|
|
78
|
+
}
|
|
79
|
+
const lineH = fontSize / 72 * 1.38;
|
|
80
|
+
let cursor = 0;
|
|
81
|
+
while (cursor < lines.length) {
|
|
82
|
+
if (y + lineH > 6.83) newSlide(currentTitle + " \xB7 continued");
|
|
83
|
+
const fit = Math.max(1, Math.floor((6.8 - y) / lineH));
|
|
84
|
+
const chunk = lines.slice(cursor, cursor + fit);
|
|
85
|
+
const h = chunk.length * lineH + 0.08;
|
|
86
|
+
slide.addText(chunk.join("\n"), { x: 0.6, y, w: width, h, fontSize, color: c(t.text), fontFace: t.fontFamily.split(",")[0], margin: 0, breakLine: false, valign: "top", ...textStyle(), ...opts });
|
|
87
|
+
y += h + 0.14;
|
|
88
|
+
cursor += fit;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function table(cols, rows) {
|
|
92
|
+
const colWidth = (W - 1.2) / cols.length;
|
|
93
|
+
let i = 0;
|
|
94
|
+
while (i < rows.length || i === 0 && !rows.length) {
|
|
95
|
+
if (y > 5.9) newSlide(currentTitle + " \xB7 continued");
|
|
96
|
+
const batch = [];
|
|
97
|
+
let height = 0.48;
|
|
98
|
+
while (i < rows.length) {
|
|
99
|
+
const row = rows[i];
|
|
100
|
+
const rowH = Math.max(0.4, ...row.map((cell) => Math.ceil(String(cell.text ?? cell).length / Math.max(6, Math.floor(colWidth * 11))) * 0.22 + 0.18));
|
|
101
|
+
if (rowH > 5.1) fail("LAYOUT_OVERFLOW", "A PowerPoint table row is too tall. Split its content.", { phase: "render", format: "pptx" });
|
|
102
|
+
if (y + height + rowH > 6.8) {
|
|
103
|
+
if (!batch.length) {
|
|
104
|
+
newSlide(currentTitle + " \xB7 continued");
|
|
105
|
+
height = 0.48;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
batch.push(row);
|
|
111
|
+
height += rowH;
|
|
112
|
+
i++;
|
|
113
|
+
}
|
|
114
|
+
const headingRow = cols.map((c2) => ({ text: c2.tokens ? richRuns(c2.tokens) : String(c2.label), options: { bold: true, color: "FFFFFF", fill: { color: accent }, align: c2.align ?? "left" } }));
|
|
115
|
+
const body = batch.map((r, ri) => r.map((v, ci) => ({ text: v.tokens ? richRuns(v.tokens) : String(v.text ?? v), options: { align: cols[ci]?.align ?? "left", fill: { color: ri % 2 ? c(t.border) : c(t.background) }, color: c(t.text), ...textStyle() } })));
|
|
116
|
+
slide.addTable([headingRow, ...body], { x: 0.6, y, w: W - 1.2, colW: cols.map(() => colWidth), rowH: 0.4, fontSize: 12, fontFace: t.fontFamily.split(",")[0], ...textStyle(), border: { color: c(t.border), pt: 0.5 }, margin: 0.1, autoPage: false, verbose: false });
|
|
117
|
+
y += height + 0.24;
|
|
118
|
+
if (!rows.length) break;
|
|
119
|
+
if (i < rows.length) newSlide(currentTitle + " \xB7 continued");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function image(bytes, alt, logo = false) {
|
|
123
|
+
const meta = await sharp(bytes).metadata();
|
|
124
|
+
if (!meta.width || !meta.height) fail("ASSET_INVALID", "Cannot read image dimensions.");
|
|
125
|
+
const png = await sharp(bytes).png().toBuffer();
|
|
126
|
+
const maxW = logo ? 1.6 : W - 1.5, maxH = logo ? 0.65 : 4.5;
|
|
127
|
+
const scale = Math.min(maxW / meta.width, maxH / meta.height);
|
|
128
|
+
const w = meta.width * scale, h = meta.height * scale;
|
|
129
|
+
if (y + h > 6.7) newSlide();
|
|
130
|
+
slide.addImage({ data: "data:image/png;base64," + png.toString("base64"), x: 0.65, y, w, h, altText: alt });
|
|
131
|
+
y += h + 0.2;
|
|
132
|
+
}
|
|
133
|
+
function richRuns(tokens, opts = {}) {
|
|
134
|
+
return (tokens ?? []).flatMap((tok) => {
|
|
135
|
+
if (tok.type === "strong" || tok.type === "em") return richRuns(tok.tokens, { ...opts, ...tok.type === "strong" ? { bold: true } : { italic: true } });
|
|
136
|
+
if (tok.type === "link") {
|
|
137
|
+
if (!tok.href.startsWith("#")) safeUrl(tok.href);
|
|
138
|
+
return [{ text: tok.text, options: { ...opts, color: accent, hyperlink: { url: tok.href } } }];
|
|
139
|
+
}
|
|
140
|
+
return [{ text: tok.text ?? tok.raw ?? "", options: { ...opts, ...tok.type === "codespan" ? { fontFace: "Consolas" } : {} } }];
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
async function render(n) {
|
|
144
|
+
const previousStyle = activeStyle;
|
|
145
|
+
activeStyle = semanticRule(options.theme ?? report.theme, n);
|
|
146
|
+
checkAbort(options);
|
|
147
|
+
const p = n.props;
|
|
148
|
+
switch (n.type) {
|
|
149
|
+
case "markdown": {
|
|
150
|
+
const tok = p.token;
|
|
151
|
+
if (tok.type === "heading") {
|
|
152
|
+
if (tok.depth === 1) {
|
|
153
|
+
currentTitle = tok.text;
|
|
154
|
+
slide.addText(tok.text, { x: 0.65, y: 2.15, w: W - 1.4, h: 1.6, fontSize: Math.round(t.headingSize * 46 / 42), fontFace: t.headingFont.split(",")[0], color: c(t.text), margin: 0 });
|
|
155
|
+
y = 4.25;
|
|
156
|
+
} else if (tok.depth === 2) {
|
|
157
|
+
currentTitle = tok.text;
|
|
158
|
+
newSlide();
|
|
159
|
+
} else text(tok.text, { fontSize: 23, bold: true, color: accent });
|
|
160
|
+
} else if (tok.type === "paragraph" || tok.type === "text") {
|
|
161
|
+
const images = tok.tokens?.filter((x) => x.type === "image") ?? [];
|
|
162
|
+
for (const im of images) {
|
|
163
|
+
const a = report.assets.find((a2) => a2.path === im.href);
|
|
164
|
+
if (!a) fail("ASSET_MISSING", "Markdown image needs a registered asset for PowerPoint export.");
|
|
165
|
+
await image(a.bytes, im.text);
|
|
166
|
+
}
|
|
167
|
+
const runs = richRuns(tok.tokens?.filter((x) => x.type !== "image"));
|
|
168
|
+
const flat = runs.map((r) => r.text).join("");
|
|
169
|
+
const lines = Math.ceil(flat.length / Math.floor((W - 1.2) * 9.5));
|
|
170
|
+
if (lines < 10 && flat) {
|
|
171
|
+
const height = Math.max(0.4, lines * 0.32);
|
|
172
|
+
if (y + height > 6.8) newSlide();
|
|
173
|
+
slide.addText(runs, { x: 0.6, y, w: W - 1.2, h: height, fontSize: 17, color: c(t.text), ...textStyle(), margin: 0, valign: "top" });
|
|
174
|
+
y += height + 0.22;
|
|
175
|
+
} else if (flat) text(flat);
|
|
176
|
+
} else if (tok.type === "table") table(tok.header.map((c2, i) => ({ label: c2.text, align: tok.align[i], tokens: c2.tokens })), tok.rows.map((r) => r.map((c2) => ({ text: c2.text, tokens: c2.tokens }))));
|
|
177
|
+
else if (tok.type === "list") tok.items.forEach((item, i) => text(item.text, { bullet: tok.ordered ? { type: "number", numberStartAt: (tok.start ?? 1) + i, indent: 16 } : true, paraSpaceAfterPt: 8 }));
|
|
178
|
+
else if (tok.type === "code") text(tok.text, { fontFace: "Consolas", fontSize: 13 });
|
|
179
|
+
else if (tok.type === "blockquote") text(tok.text, { italic: true, color: accent });
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "metrics": {
|
|
183
|
+
if (y > 4.5) newSlide();
|
|
184
|
+
const width = (W - 1.2) / p.items.length;
|
|
185
|
+
if (width < 1.5) {
|
|
186
|
+
table([{ label: "Metric" }, { label: "Value" }, { label: "Comparison" }], p.items.map((i) => [i.label, i.display, i.comparison ?? ""]));
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
p.items.forEach((i, index) => {
|
|
190
|
+
const x = 0.6 + index * width;
|
|
191
|
+
slide.addText(i.label.toUpperCase(), { x, y, w: width - 0.2, h: 0.3, fontSize: 10, color: c(t.muted), margin: 0 });
|
|
192
|
+
slide.addText(i.display, { x, y: y + 0.4, w: width - 0.2, h: 0.65, fontSize: 30, bold: true, color: accent, margin: 0 });
|
|
193
|
+
if (i.comparison) slide.addText(i.comparison, { x, y: y + 1.15, w: width - 0.2, h: 0.5, fontSize: 10, color: c(t.muted), margin: 0 });
|
|
194
|
+
});
|
|
195
|
+
y += 1.95;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
case "table":
|
|
199
|
+
if (p.rows.length) table(p.columns, p.cells);
|
|
200
|
+
else text(p.empty ?? "No rows to display.");
|
|
201
|
+
break;
|
|
202
|
+
case "chart": {
|
|
203
|
+
if (!p.categories.length) {
|
|
204
|
+
text(p.empty ?? "No data to display.");
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
newSlide(p.title);
|
|
208
|
+
slide.addChart(p.kind === "bar" ? pptx.ChartType.bar : pptx.ChartType.line, p.series.map((s) => ({ name: s.label, labels: p.categories, values: s.values })), { x: 0.6, y: 1.5, w: W - 1.2, h: 4.9, catAxisLabelFontSize: 11, valAxisLabelFontSize: 10, showLegend: true, legendPos: "b", showTitle: false, showValue: false, chartColors: t.chartPalette.map(c), showCatName: false, showCatNameInLegend: false, showSerName: true, showMarker: p.kind === "line", lineSize: 2, showBorder: false, showCatNameInTitle: false, catAxisLineColor: c(t.border), valAxisLineColor: c(t.border), valGridLine: { color: c(t.border), width: 0.5 }, catAxisLabelColor: c(t.muted), valAxisLabelColor: c(t.muted), showShadow: false, showCatNameInDataLabel: false, barDir: "col", altText: p.alt });
|
|
209
|
+
const data = chartTable(n, report);
|
|
210
|
+
newSlide(p.title + " \xB7 data");
|
|
211
|
+
table(data.columns, data.cells);
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
case "diagram": {
|
|
215
|
+
newSlide(p.caption ?? "Workflow");
|
|
216
|
+
if (p.nativeGraph && p.model.nodes.length <= 12) {
|
|
217
|
+
const model = p.model, nodes = model.nodes, cols = Math.min(4, nodes.length), rows = Math.ceil(nodes.length / cols);
|
|
218
|
+
const boxW = (W - 1.7) / cols - 0.3, boxH = Math.min(0.85, 3.4 / rows), gapY = 1.55;
|
|
219
|
+
const pos = /* @__PURE__ */ new Map();
|
|
220
|
+
nodes.forEach((node, i) => pos.set(node.id, { x: 0.7 + i % cols * (boxW + 0.4), y: 2 + Math.floor(i / cols) * gapY }));
|
|
221
|
+
model.edges.forEach((edge) => {
|
|
222
|
+
const a = pos.get(edge.from), b = pos.get(edge.to);
|
|
223
|
+
slide.addShape(pptx.ShapeType.line, { objectName: "reportic-edge--" + edge.from + "--" + edge.to, x: a.x + boxW, y: a.y + boxH / 2, w: b.x - a.x - boxW, h: b.y - a.y, line: { color: "8DA298", width: 1.5, beginArrowType: "none", endArrowType: "triangle" } });
|
|
224
|
+
if (edge.label) slide.addText(edge.label, { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 - 0.3, w: boxW, h: 0.25, fontSize: 10, color: c(t.muted), margin: 0 });
|
|
225
|
+
});
|
|
226
|
+
nodes.forEach((node) => {
|
|
227
|
+
const at = pos.get(node.id);
|
|
228
|
+
slide.addShape(node.shape === "diamond" ? pptx.ShapeType.diamond : node.shape === "rounded" ? pptx.ShapeType.roundRect : pptx.ShapeType.rect, { objectName: "reportic-node--" + node.id, ...at, w: boxW, h: boxH, rectRadius: 0.08, fill: { color: "EFF5F0" }, line: { color: accent, width: 1 } });
|
|
229
|
+
slide.addText(node.label, { ...at, w: boxW, h: boxH, fontSize: 13, color: accent, align: "center", valign: "middle", margin: 0.08 });
|
|
230
|
+
});
|
|
231
|
+
y = 2 + rows * gapY;
|
|
232
|
+
text(p.alt, { fontSize: 12, color: c(t.muted) });
|
|
233
|
+
} else {
|
|
234
|
+
if (p.nativeGraph) fail("LAYOUT_OVERFLOW", "Editable PowerPoint flowcharts support up to 12 nodes per diagram.", { elementId: n.id, phase: "render" });
|
|
235
|
+
const svg = diagrams.get(n.occurrenceId);
|
|
236
|
+
if (!svg) fail("INVALID_DIAGRAM", "Diagram visual is missing.");
|
|
237
|
+
await image(Buffer.from(svg), p.alt);
|
|
238
|
+
text(p.alt, { fontSize: 12, color: c(t.muted) });
|
|
239
|
+
}
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
case "logo":
|
|
243
|
+
case "image": {
|
|
244
|
+
const a = report.assets.find((a2) => a2.path === p.src);
|
|
245
|
+
if (!a) fail("ASSET_MISSING", "Embedded PowerPoint image is unavailable.");
|
|
246
|
+
await image(a.bytes, p.alt, n.type === "logo");
|
|
247
|
+
if (p.caption) text(p.caption, { fontSize: 12 });
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
case "narrative":
|
|
251
|
+
if (p.heading) text(p.heading, { fontSize: 22, bold: true, color: accent });
|
|
252
|
+
text(p.text + (p.citations ?? []).map((x) => ` [${x}]`).join(""));
|
|
253
|
+
break;
|
|
254
|
+
case "list":
|
|
255
|
+
if (p.items.length) p.items.forEach((s, i) => text(s, { bullet: p.ordered ? { type: "number", numberStartAt: i + 1, indent: 16 } : { type: "bullet", indent: 16 }, hanging: 3 }));
|
|
256
|
+
else text(p.empty ?? "No items to display.");
|
|
257
|
+
break;
|
|
258
|
+
case "sources":
|
|
259
|
+
for (const s of p.citations) text(`[${s.number}] ${s.label}`, { fontSize: 13, ...s.url ? { hyperlink: { url: s.url }, color: accent } : {} });
|
|
260
|
+
break;
|
|
261
|
+
case "group":
|
|
262
|
+
if (p.heading) {
|
|
263
|
+
currentTitle = p.heading;
|
|
264
|
+
newSlide();
|
|
265
|
+
}
|
|
266
|
+
for (const child of n.children ?? []) await render(child);
|
|
267
|
+
break;
|
|
268
|
+
case "repeat":
|
|
269
|
+
if (!n.children?.length) text(p.empty ?? "No items to display.");
|
|
270
|
+
for (const child of n.children ?? []) await render(child);
|
|
271
|
+
break;
|
|
272
|
+
case "callout":
|
|
273
|
+
text(p.title, { fontSize: 21, bold: true, color: accent });
|
|
274
|
+
text(p.text);
|
|
275
|
+
break;
|
|
276
|
+
case "progress":
|
|
277
|
+
for (const item of p.items) {
|
|
278
|
+
if (y > 5.5) newSlide();
|
|
279
|
+
text(`${item.label} ${formatValue(item.value, "percent:0", report.locale)}`, { fontSize: 15 });
|
|
280
|
+
slide.addShape(pptx.ShapeType.rect, { x: 0.6, y, w: W - 1.2, h: 0.1, fill: { color: c(t.border) }, line: { color: c(t.border) } });
|
|
281
|
+
if (item.value > 0) slide.addShape(pptx.ShapeType.rect, { x: 0.6, y, w: (W - 1.2) * item.value, h: 0.1, fill: { color: accent }, line: { color: accent } });
|
|
282
|
+
y += 0.27;
|
|
283
|
+
if (item.detail) text(item.detail, { fontSize: 11, color: c(t.muted) });
|
|
284
|
+
}
|
|
285
|
+
break;
|
|
286
|
+
case "timeline":
|
|
287
|
+
for (const item of p.items) {
|
|
288
|
+
text(`${item.date} \xB7 ${item.title}`, { fontSize: 18, bold: true, color: accent });
|
|
289
|
+
if (item.text) text(item.text, { fontSize: 15 });
|
|
290
|
+
}
|
|
291
|
+
break;
|
|
292
|
+
case "comparison":
|
|
293
|
+
table([{ label: "" }, ...p.labels.map((label) => ({ label }))], p.rows.map((r) => [r.label, r.left, r.right]));
|
|
294
|
+
break;
|
|
295
|
+
case "checklist":
|
|
296
|
+
p.items.forEach((item) => text(`[${item.done ? "x" : " "}] ${item.text}${item.owner ? " \xB7 " + item.owner : ""}`, { fontSize: 16 }));
|
|
297
|
+
break;
|
|
298
|
+
case "code":
|
|
299
|
+
text(p.code, { fontFace: "Consolas", fontSize: 13 });
|
|
300
|
+
if (p.caption) text(p.caption, { fontSize: 12 });
|
|
301
|
+
break;
|
|
302
|
+
default:
|
|
303
|
+
fail("RENDERER_UNAVAILABLE", `No PowerPoint representation for ${n.type}.`, { elementId: n.id, phase: "render" });
|
|
304
|
+
}
|
|
305
|
+
activeStyle = previousStyle;
|
|
306
|
+
}
|
|
307
|
+
for (const node of report.nodes) await render(node);
|
|
308
|
+
return attachConnectors(new Uint8Array(await pptx.write({ outputType: "nodebuffer" })));
|
|
309
|
+
}
|
|
310
|
+
export {
|
|
311
|
+
renderPptx
|
|
312
|
+
};
|
|
313
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/connectors.ts","../src/index.ts"],"sourcesContent":["// PptxGenJS emits lines as ordinary shapes. Convert only marked graph edges to\n// real DrawingML connectors attached to their editable node shapes.\nimport JSZip from 'jszip';\nexport async function attachConnectors(bytes:Uint8Array):Promise<Uint8Array>{\n const zip=await JSZip.loadAsync(bytes);\n for(const path of Object.keys(zip.files).filter(n=>/^ppt\\/slides\\/slide\\d+\\.xml$/.test(n))){\n let xml=await zip.file(path)!.async('string');\n // A paragraph has one shared pPr even when rich runs supply repeated options.\n xml=xml.replace(/<a:p>([\\s\\S]*?)<\\/a:p>/g,(_whole,body:string)=>{let first=true;return '<a:p>'+body.replace(/<a:pPr\\b[^>]*\\/>|<a:pPr\\b[^>]*>[\\s\\S]*?<\\/a:pPr>/g,p=>first?(first=false,p):'')+'</a:p>';});\n if(!xml.includes('reportic-edge--')){zip.file(path,xml);continue;}\n const ids=new Map<string,string>();for(const match of xml.matchAll(/<p:cNvPr id=\"(\\d+)\" name=\"reportic-node--([A-Za-z0-9_]+)\"/g))ids.set(match[2],match[1]);\n xml=xml.replace(/<p:sp>[\\s\\S]*?<\\/p:sp>/g,shape=>{\n const marker=shape.match(/name=\"reportic-edge--([A-Za-z0-9_]+)--([A-Za-z0-9_]+)\"/);if(!marker)return shape;\n const from=ids.get(marker[1]),to=ids.get(marker[2]);if(!from||!to)throw new Error('A graph connector has no native node.');\n return shape.replace('<p:sp>','<p:cxnSp>').replace('</p:sp>','</p:cxnSp>').replace('<p:nvSpPr>','<p:nvCxnSpPr>').replace('</p:nvSpPr>','</p:nvCxnSpPr>').replace(/<p:cNvSpPr\\s*\\/>/,`<p:cNvCxnSpPr><a:stCxn id=\"${from}\" idx=\"3\"/><a:endCxn id=\"${to}\" idx=\"1\"/></p:cNvCxnSpPr>`);\n });\n zip.file(path,xml);\n }\n return zip.generateAsync({type:'uint8array',compression:'DEFLATE'});\n}\n","import {attachConnectors} from './connectors.js';\nimport pptxgen from 'pptxgenjs';\nimport sharp from 'sharp';\nimport { diagramVisuals, chartTable } from '@x12i/reportic-render-html';\nimport { themeTokens, fail, formatValue, limitsFor, checkAbort, safeUrl, semanticRule, officeColor } from '@x12i/reportic-core';\nimport type { PreparedReport, ReportOptions, SemanticNode } from '@x12i/reportic-core';\n\nexport async function renderPptx(report:PreparedReport,options:ReportOptions={}):Promise<Uint8Array>{\n const pptx=new pptxgen();pptx.layout=options.pptx?.layout==='standard'?'LAYOUT_4X3':'LAYOUT_WIDE';pptx.author='Reportic';pptx.subject='Data-driven report';pptx.title=report.title;pptx.company='Reportic';\n const t=themeTokens(options.theme ?? report.theme);const c=officeColor;const W=options.pptx?.layout==='standard'?10:13.333,H=7.5,accent=c(t.accent);pptx.theme={headFontFace:t.headingFont.split(',')[0],bodyFontFace:t.fontFamily.split(',')[0]};\n let activeStyle:Record<string,any>={};const textStyle=()=>({...activeStyle.color?{color:c(activeStyle.color)}:{},...activeStyle.fontSize?{fontSize:Number(activeStyle.fontSize)*.75}:{},...activeStyle.fontFamily?{fontFace:activeStyle.fontFamily}:{},...activeStyle.fontWeight?{bold:activeStyle.fontWeight==='bold'||Number(activeStyle.fontWeight)>=600}:{},...activeStyle.textAlign?{align:activeStyle.textAlign}:{} });\n let slide:pptxgen.Slide;let y=1.25;let currentTitle=report.title;let slideCount=0;\n const diagrams=await diagramVisuals({...report,nodes:report.nodes.filter(n=>n.type!=='diagram'||!n.props.nativeGraph)},options);\n function newSlide(title=currentTitle){if(++slideCount>limitsFor(options).slides)fail('LIMIT_EXCEEDED',`Presentation exceeds ${limitsFor(options).slides} slides.`,{phase:'render'});slide=pptx.addSlide();slide.background={color:c(t.background)};slide.addText(title,{x:.6,y:.35,w:W-1.2,h:.65,fontSize:Math.round(t.headingSize*2/3),fontFace:t.headingFont.split(',')[0],color:c(t.text),bold:false,margin:0,breakLine:false});slide.addShape(pptx.ShapeType.line,{x:.6,y:1.12,w:W-1.2,h:0,line:{color:c(t.border),width:.7}});slide.addText('REPORTIC / '+report.id.toUpperCase(),{x:.6,y:7.12,w:W-2,h:.18,fontSize:8,color:c(t.muted),margin:0});slide.addText(String(slideCount),{x:W-1,y:7.12,w:.4,h:.18,fontSize:8,color:c(t.muted),align:'right',margin:0});y=1.45;}\n newSlide();\n function text(text:string,opts:any={}){\n const fontSize=opts.fontSize ?? textStyle().fontSize ?? Math.round(t.bodySize*17/14);const width=opts.w ?? W-1.2;const chars=Math.floor(width*9.5*17/fontSize);const paragraphs=String(text).split('\\n');const lines:string[]=[];\n for(const para of paragraphs){let line='';for(const word of para.split(' ')){if((line+' '+word).length>chars&&line){lines.push(line);line=word;}else line+=(line?' ':'')+word;}lines.push(line);}\n const lineH=fontSize/72*1.38;let cursor=0;\n while(cursor<lines.length){if(y+lineH>6.83)newSlide(currentTitle+' · continued');const fit=Math.max(1,Math.floor((6.8-y)/lineH));const chunk=lines.slice(cursor,cursor+fit);const h=chunk.length*lineH+.08;slide.addText(chunk.join('\\n'),{x:.6,y,w:width,h,fontSize,color:c(t.text),fontFace:t.fontFamily.split(',')[0],margin:0,breakLine:false,valign:'top',...textStyle(),...opts});y+=h+.14;cursor+=fit;}\n }\n function table(cols:any[],rows:any[][]){\n const colWidth=(W-1.2)/cols.length;\n let i=0;\n while(i<rows.length || (i===0&&!rows.length)){\n if(y>5.9)newSlide(currentTitle+' · continued');const batch:any[][]=[];let height=.48;\n while(i<rows.length){const row=rows[i];const rowH=Math.max(.4,...row.map(cell=>Math.ceil(String(cell.text ?? cell).length/Math.max(6,Math.floor(colWidth*11)))*.22+.18));if(rowH>5.1)fail('LAYOUT_OVERFLOW','A PowerPoint table row is too tall. Split its content.',{phase:'render',format:'pptx'});if(y+height+rowH>6.8){if(!batch.length){newSlide(currentTitle+' · continued');height=.48;continue;}break;}batch.push(row);height+=rowH;i++;}\n const headingRow=cols.map(c=>({text:c.tokens?richRuns(c.tokens):String(c.label),options:{bold:true,color:'FFFFFF',fill:{color:accent},align:c.align ?? 'left'}}));\n const body=batch.map((r,ri)=>r.map((v,ci)=>({text:v.tokens?richRuns(v.tokens):String(v.text ?? v),options:{align:cols[ci]?.align ?? 'left',fill:{color:ri%2?c(t.border):c(t.background)},color:c(t.text),...textStyle()}})));\n slide.addTable([headingRow,...body],{x:.6,y,w:W-1.2,colW:cols.map(()=>colWidth),rowH:.4,fontSize:12,fontFace:t.fontFamily.split(',')[0],...textStyle(),border:{color:c(t.border),pt:.5},margin:.1,autoPage:false,verbose:false});y+=height+.24;\n if(!rows.length)break;if(i<rows.length)newSlide(currentTitle+' · continued');\n }\n }\n async function image(bytes:Uint8Array,alt:string,logo=false){const meta=await sharp(bytes).metadata();if(!meta.width||!meta.height)fail('ASSET_INVALID','Cannot read image dimensions.');const png=await sharp(bytes).png().toBuffer();const maxW=logo?1.6:W-1.5,maxH=logo?.65:4.5;const scale=Math.min(maxW/meta.width,maxH/meta.height);const w=meta.width*scale,h=meta.height*scale;if(y+h>6.7)newSlide();slide.addImage({data:'data:image/png;base64,'+png.toString('base64'),x:.65,y,w,h,altText:alt});y+=h+.2;}\n function richRuns(tokens:any[]|undefined,opts:any={}):any[]{return(tokens ?? []).flatMap(tok=>{if(tok.type==='strong'||tok.type==='em')return richRuns(tok.tokens,{...opts,...(tok.type==='strong'?{bold:true}:{italic:true})});if(tok.type==='link'){if(!tok.href.startsWith('#'))safeUrl(tok.href);return[{text:tok.text,options:{...opts,color:accent,hyperlink:{url:tok.href}}}];}return[{text:tok.text ?? tok.raw ?? '',options:{...opts,...(tok.type==='codespan'?{fontFace:'Consolas'}:{})}}];});}\n async function render(n:SemanticNode):Promise<void>{const previousStyle=activeStyle;activeStyle=semanticRule(options.theme ?? report.theme,n);checkAbort(options);const p=n.props;switch(n.type){\n case 'markdown':{const tok=p.token;if(tok.type==='heading'){if(tok.depth===1){currentTitle=tok.text;slide.addText(tok.text,{x:.65,y:2.15,w:W-1.4,h:1.6,fontSize:Math.round(t.headingSize*46/42),fontFace:t.headingFont.split(',')[0],color:c(t.text),margin:0});y=4.25;}else if(tok.depth===2){currentTitle=tok.text;newSlide();}else text(tok.text,{fontSize:23,bold:true,color:accent});}else if(tok.type==='paragraph'||tok.type==='text'){const images=tok.tokens?.filter((x:any)=>x.type==='image') ?? [];for(const im of images){const a=report.assets.find(a=>a.path===im.href);if(!a)fail('ASSET_MISSING','Markdown image needs a registered asset for PowerPoint export.');await image(a.bytes,im.text);}const runs=richRuns(tok.tokens?.filter((x:any)=>x.type!=='image'));const flat=runs.map(r=>r.text).join('');const lines=Math.ceil(flat.length/Math.floor((W-1.2)*9.5));if(lines<10&&flat){const height=Math.max(.4,lines*.32);if(y+height>6.8)newSlide();slide.addText(runs,{x:.6,y,w:W-1.2,h:height,fontSize:17,color:c(t.text),...textStyle(),margin:0,valign:'top'});y+=height+.22;}else if(flat)text(flat);}else if(tok.type==='table')table(tok.header.map((c:any,i:number)=>({label:c.text,align:tok.align[i],tokens:c.tokens})),tok.rows.map((r:any[])=>r.map(c=>({text:c.text,tokens:c.tokens}))));else if(tok.type==='list')tok.items.forEach((item:any,i:number)=>text(item.text,{bullet:tok.ordered?{type:'number',numberStartAt:(tok.start ?? 1)+i,indent:16}:true,paraSpaceAfterPt:8}));else if(tok.type==='code')text(tok.text,{fontFace:'Consolas',fontSize:13});else if(tok.type==='blockquote')text(tok.text,{italic:true,color:accent});break;}\n case 'metrics':{if(y>4.5)newSlide();const width=(W-1.2)/p.items.length;if(width<1.5){table([{label:'Metric'},{label:'Value'},{label:'Comparison'}],p.items.map((i:any)=>[i.label,i.display,i.comparison ?? '']));break;}p.items.forEach((i:any,index:number)=>{const x=.6+index*width;slide.addText(i.label.toUpperCase(),{x,y,w:width-.2,h:.3,fontSize:10,color:c(t.muted),margin:0});slide.addText(i.display,{x,y:y+.4,w:width-.2,h:.65,fontSize:30,bold:true,color:accent,margin:0});if(i.comparison)slide.addText(i.comparison,{x,y:y+1.15,w:width-.2,h:.5,fontSize:10,color:c(t.muted),margin:0});});y+=1.95;break;}\n case 'table':if(p.rows.length)table(p.columns,p.cells);else text(p.empty ?? 'No rows to display.');break;\n case 'chart':{if(!p.categories.length){text(p.empty ?? 'No data to display.');break;}newSlide(p.title);slide.addChart(p.kind==='bar'?pptx.ChartType.bar:pptx.ChartType.line,p.series.map((s:any)=>({name:s.label,labels:p.categories,values:s.values})),{x:.6,y:1.5,w:W-1.2,h:4.9,catAxisLabelFontSize:11,valAxisLabelFontSize:10,showLegend:true,legendPos:'b',showTitle:false,showValue:false,chartColors:t.chartPalette.map(c),showCatName:false,showCatNameInLegend:false,showSerName:true,showMarker:p.kind==='line',lineSize:2,showBorder:false,showCatNameInTitle:false,catAxisLineColor:c(t.border),valAxisLineColor:c(t.border),valGridLine:{color:c(t.border),width:.5},catAxisLabelColor:c(t.muted),valAxisLabelColor:c(t.muted),showShadow:false,showCatNameInDataLabel:false,barDir:'col',altText:p.alt} as any);const data=chartTable(n,report);newSlide(p.title+' · data');table(data.columns,data.cells);break;}\n case 'diagram':{\n newSlide(p.caption ?? 'Workflow');\n if(p.nativeGraph&&p.model.nodes.length<=12){const model=p.model,nodes=model.nodes,cols=Math.min(4,nodes.length),rows=Math.ceil(nodes.length/cols);const boxW=(W-1.7)/cols-.3,boxH=Math.min(.85,3.4/rows),gapY=1.55;const pos=new Map<string,{x:number;y:number}>();nodes.forEach((node:any,i:number)=>pos.set(node.id,{x:.7+(i%cols)*(boxW+.4),y:2+Math.floor(i/cols)*gapY}));model.edges.forEach((edge:any)=>{const a=pos.get(edge.from)!,b=pos.get(edge.to)!;slide.addShape(pptx.ShapeType.line,{objectName:'reportic-edge--'+edge.from+'--'+edge.to,x:a.x+boxW,y:a.y+boxH/2,w:b.x-a.x-boxW,h:b.y-a.y,line:{color:'8DA298',width:1.5,beginArrowType:'none',endArrowType:'triangle'}});if(edge.label)slide.addText(edge.label,{x:(a.x+b.x)/2,y:(a.y+b.y)/2-.3,w:boxW,h:.25,fontSize:10,color:c(t.muted),margin:0});});nodes.forEach((node:any)=>{const at=pos.get(node.id)!;slide.addShape(node.shape==='diamond'?pptx.ShapeType.diamond:node.shape==='rounded'?pptx.ShapeType.roundRect:pptx.ShapeType.rect,{objectName:'reportic-node--'+node.id,...at,w:boxW,h:boxH,rectRadius:.08,fill:{color:'EFF5F0'},line:{color:accent,width:1}});slide.addText(node.label,{...at,w:boxW,h:boxH,fontSize:13,color:accent,align:'center',valign:'middle',margin:.08});});y=2+rows*gapY;text(p.alt,{fontSize:12,color:c(t.muted)});}\n else {if(p.nativeGraph)fail('LAYOUT_OVERFLOW','Editable PowerPoint flowcharts support up to 12 nodes per diagram.',{elementId:n.id,phase:'render'});const svg=diagrams.get(n.occurrenceId);if(!svg)fail('INVALID_DIAGRAM','Diagram visual is missing.');await image(Buffer.from(svg),p.alt);text(p.alt,{fontSize:12,color:c(t.muted)});}break;}\n case 'logo':case 'image':{const a=report.assets.find(a=>a.path===p.src);if(!a)fail('ASSET_MISSING','Embedded PowerPoint image is unavailable.');await image(a.bytes,p.alt,n.type==='logo');if(p.caption)text(p.caption,{fontSize:12});break;}\n case 'narrative':if(p.heading)text(p.heading,{fontSize:22,bold:true,color:accent});text(p.text+(p.citations ?? []).map((x:number)=>` [${x}]`).join(''));break;\n case 'list':if(p.items.length)p.items.forEach((s:string,i:number)=>text(s,{bullet:p.ordered?{type:'number',numberStartAt:i+1,indent:16}:{type:'bullet',indent:16},hanging:3}));else text(p.empty ?? 'No items to display.');break;\n case 'sources':for(const s of p.citations)text(`[${s.number}] ${s.label}`,{fontSize:13,...(s.url?{hyperlink:{url:s.url},color:accent}:{})});break;\n case 'group':if(p.heading){currentTitle=p.heading;newSlide();}for(const child of n.children ?? [])await render(child);break;\n case 'repeat':if(!n.children?.length)text(p.empty ?? 'No items to display.');for(const child of n.children ?? [])await render(child);break;\n case 'callout':text(p.title,{fontSize:21,bold:true,color:accent});text(p.text);break;\n case 'progress':for(const item of p.items){if(y>5.5)newSlide();text(`${item.label} ${formatValue(item.value,'percent:0',report.locale)}`,{fontSize:15});slide.addShape(pptx.ShapeType.rect,{x:.6,y,w:W-1.2,h:.1,fill:{color:c(t.border)},line:{color:c(t.border)}});if(item.value>0)slide.addShape(pptx.ShapeType.rect,{x:.6,y,w:(W-1.2)*item.value,h:.1,fill:{color:accent},line:{color:accent}});y+=.27;if(item.detail)text(item.detail,{fontSize:11,color:c(t.muted)});}break;\n case 'timeline':for(const item of p.items){text(`${item.date} · ${item.title}`,{fontSize:18,bold:true,color:accent});if(item.text)text(item.text,{fontSize:15});}break;\n case 'comparison':table([{label:''},...p.labels.map((label:string)=>({label}))],p.rows.map((r:any)=>[r.label,r.left,r.right]));break;\n case 'checklist':p.items.forEach((item:any)=>text(`[${item.done?'x':' '}] ${item.text}${item.owner?' · '+item.owner:''}`,{fontSize:16}));break;\n case 'code':text(p.code,{fontFace:'Consolas',fontSize:13});if(p.caption)text(p.caption,{fontSize:12});break;\n default:fail('RENDERER_UNAVAILABLE',`No PowerPoint representation for ${n.type}.`,{elementId:n.id,phase:'render'});\n }activeStyle=previousStyle;}\n for(const node of report.nodes)await render(node);\n return attachConnectors(new Uint8Array(await pptx.write({outputType:'nodebuffer'}) as Buffer));\n}\n"],"mappings":";AAEA,OAAO,WAAW;AAClB,eAAsB,iBAAiB,OAAqC;AAC1E,QAAM,MAAI,MAAM,MAAM,UAAU,KAAK;AACrC,aAAU,QAAQ,OAAO,KAAK,IAAI,KAAK,EAAE,OAAO,OAAG,+BAA+B,KAAK,CAAC,CAAC,GAAE;AACzF,QAAI,MAAI,MAAM,IAAI,KAAK,IAAI,EAAG,MAAM,QAAQ;AAE5C,UAAI,IAAI,QAAQ,2BAA0B,CAAC,QAAO,SAAc;AAAC,UAAI,QAAM;AAAK,aAAO,UAAQ,KAAK,QAAQ,qDAAoD,OAAG,SAAO,QAAM,OAAM,KAAG,EAAE,IAAE;AAAA,IAAS,CAAC;AACvM,QAAG,CAAC,IAAI,SA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AAG,KAAK,KAAK,MAAK,KAAK,MAAK,EAAC,UAAS,GAAE,CAAC;AAAA,QAAE;AAAC;AAAA,MACjK,KAAK;AAAa,cAAM,CAAC,EAAC,OAAM,GAAE,GAAE,GAAG,EAAE,OAAO,IAAI,CAAC,WAAgB,EAAC,MAAK,EAAE,CAAC,GAAE,EAAE,KAAK,IAAI,CAAC,MAAQ,CAAC,EAAE,OAAM,EAAE,MAAK,EAAE,KAAK,CAAC,CAAC;AAAE;AAAA,MAC/H,KAAK;AAAY,UAAE,MAAM,QAAQ,CAAC,SAAW,KAAK,IAAI,KAAK,OAAK,MAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,QAAM,WAAM,KAAK,QAAM,EAAE,IAAG,EAAC,UAAS,GAAE,CAAC,CAAC;AAAE;AAAA,MACzI,KAAK;AAAO,aAAK,EAAE,MAAK,EAAC,UAAS,YAAW,UAAS,GAAE,CAAC;AAAE,YAAG,EAAE,QAAQ,MAAK,EAAE,SAAQ,EAAC,UAAS,GAAE,CAAC;AAAE;AAAA,MACtG;AAAQ,aAAK,wBAAuB,oCAAoC,EAAE,IAAI,KAAI,EAAC,WAAU,EAAE,IAAG,OAAM,SAAQ,CAAC;AAAA,IACnH;AAAC,kBAAY;AAAA,EAAc;AAC3B,aAAU,QAAQ,OAAO,MAAM,OAAM,OAAO,IAAI;AAChD,SAAO,iBAAiB,IAAI,WAAW,MAAM,KAAK,MAAM,EAAC,YAAW,aAAY,CAAC,CAAW,CAAC;AAC/F;","names":["text","c","a"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/reportic-render-pptx",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "reportic-render-pptx — typed, portable reporting from Markdown and data",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@x12i/reportic-core": "0.2.0",
|
|
27
|
+
"@x12i/reportic-render-html": "0.2.0",
|
|
28
|
+
"pptxgenjs": "^4.0.1",
|
|
29
|
+
"sharp": "^0.34.0",
|
|
30
|
+
"jszip": "^3.10.1"
|
|
31
|
+
}
|
|
32
|
+
}
|