@shbernal/pptxgenjs 5.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,68 @@
1
+ //#region src/inspect.d.ts
2
+ type PptxInspectInputValue = string | number[] | Uint8Array | ArrayBuffer | Blob;
3
+ type PptxInspectInput = PptxInspectInputValue | Promise<PptxInspectInputValue>;
4
+ interface PptxPackageFile {
5
+ async(type: 'string'): Promise<string>;
6
+ }
7
+ interface PptxPackage {
8
+ files: Record<string, unknown>;
9
+ file(path: string): PptxPackageFile | null;
10
+ }
11
+ interface PptxSlideSize {
12
+ widthIn: number;
13
+ heightIn: number;
14
+ }
15
+ interface PptxBox {
16
+ x: number;
17
+ y: number;
18
+ w: number;
19
+ h: number;
20
+ }
21
+ interface PptxTextRun {
22
+ text: string;
23
+ fontSizePt: number | null;
24
+ color: string | null;
25
+ }
26
+ type PptxSlideElementKind = 'text' | 'image' | 'shape';
27
+ interface PptxSlideElement {
28
+ id: string | number;
29
+ name: string;
30
+ kind: PptxSlideElementKind;
31
+ zIndex: number;
32
+ box: PptxBox;
33
+ text: string;
34
+ textWrap: string | null;
35
+ textRuns: PptxTextRun[];
36
+ fontSizes: number[];
37
+ colors: string[];
38
+ fill: string | null;
39
+ line: string | null;
40
+ shapeType: string | null;
41
+ }
42
+ interface PptxSlideInspection {
43
+ index: number;
44
+ name: string;
45
+ path: string;
46
+ size: PptxSlideSize;
47
+ elements: PptxSlideElement[];
48
+ text: string;
49
+ wordCount: number;
50
+ }
51
+ interface PptxInspection {
52
+ slideSize: PptxSlideSize;
53
+ slides: PptxSlideInspection[];
54
+ }
55
+ type PptxBoxAxis = 'x' | 'y';
56
+ type PptxBoxAnchor = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
57
+ declare const DEFAULT_INSPECT_SLIDE_SIZE: PptxSlideSize;
58
+ declare function loadPptxPackage(input: PptxInspectInput): Promise<PptxPackage>;
59
+ declare function listPptxParts(pptxPackage: PptxPackage): string[];
60
+ declare function readPptxTextPart(pptxPackage: PptxPackage, path: string): Promise<string | null>;
61
+ declare function inspectPptx(input: PptxInspectInput): Promise<PptxInspection>;
62
+ declare function readPresentationSize(pptxPackage: PptxPackage, fallback?: PptxSlideSize): Promise<PptxSlideSize>;
63
+ declare function extractSlides(pptxPackage: PptxPackage, size?: PptxSlideSize): Promise<PptxSlideInspection[]>;
64
+ declare function overlapArea(a: PptxBox, b: PptxBox): number;
65
+ declare function boxAnchor(box: PptxBox, anchor: PptxBoxAnchor, axis: PptxBoxAxis): number;
66
+ //#endregion
67
+ export { DEFAULT_INSPECT_SLIDE_SIZE, PptxBox, PptxBoxAnchor, PptxBoxAxis, PptxInspectInput, PptxInspection, PptxPackage, PptxPackageFile, PptxSlideElement, PptxSlideElementKind, PptxSlideInspection, PptxSlideSize, PptxTextRun, boxAnchor, extractSlides, inspectPptx, listPptxParts, loadPptxPackage, overlapArea, readPptxTextPart, readPresentationSize };
68
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.d.ts","names":[],"sources":["../src/inspect.ts"],"mappings":";KAMK,qBAAA,uBAA4C,UAAA,GAAa,WAAA,GAAc,IAAA;AAAA,KAEhE,gBAAA,GAAmB,qBAAA,GAAwB,OAAA,CAAQ,qBAAA;AAAA,UAE9C,eAAA;EAChB,KAAA,CAAM,IAAA,aAAiB,OAAO;AAAA;AAAA,UAGd,WAAA;EAChB,KAAA,EAAO,MAAA;EACP,IAAA,CAAK,IAAA,WAAe,eAAe;AAAA;AAAA,UAGnB,aAAA;EAChB,OAAA;EACA,QAAQ;AAAA;AAAA,UAGQ,OAAA;EAChB,CAAA;EACA,CAAA;EACA,CAAA;EACA,CAAA;AAAA;AAAA,UAGgB,WAAA;EAChB,IAAA;EACA,UAAA;EACA,KAAA;AAAA;AAAA,KAGW,oBAAA;AAAA,UAEK,gBAAA;EAChB,EAAA;EACA,IAAA;EACA,IAAA,EAAM,oBAAA;EACN,MAAA;EACA,GAAA,EAAK,OAAA;EACL,IAAA;EACA,QAAA;EACA,QAAA,EAAU,WAAA;EACV,SAAA;EACA,MAAA;EACA,IAAA;EACA,IAAA;EACA,SAAA;AAAA;AAAA,UAGgB,mBAAA;EAChB,KAAA;EACA,IAAA;EACA,IAAA;EACA,IAAA,EAAM,aAAA;EACN,QAAA,EAAU,gBAAgB;EAC1B,IAAA;EACA,SAAA;AAAA;AAAA,UAGgB,cAAA;EAChB,SAAA,EAAW,aAAA;EACX,MAAA,EAAQ,mBAAmB;AAAA;AAAA,KAGhB,WAAA;AAAA,KACA,aAAA;AAAA,cAEC,0BAAA,EAA4B,aAGvC;AAAA,iBAUoB,eAAA,CAAgB,KAAA,EAAO,gBAAA,GAAmB,OAAA,CAAQ,WAAA;AAAA,iBAIxD,aAAA,CAAc,WAAwB,EAAX,WAAW;AAAA,iBAIhC,gBAAA,CAAiB,WAAA,EAAa,WAAA,EAAa,IAAA,WAAe,OAAO;AAAA,iBAKjE,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAmB,OAAA,CAAQ,cAAA;AAAA,iBAO9C,oBAAA,CACrB,WAAA,EAAa,WAAA,EACb,QAAA,GAAU,aAAA,GACR,OAAA,CAAQ,aAAA;AAAA,iBAiBW,aAAA,CACrB,WAAA,EAAa,WAAA,EACb,IAAA,GAAO,aAAA,GACL,OAAA,CAAQ,mBAAA;AAAA,iBAiCK,WAAA,CAAY,CAAA,EAAG,OAAA,EAAS,CAAA,EAAG,OAAO;AAAA,iBAMlC,SAAA,CAAU,GAAA,EAAK,OAAA,EAAS,MAAA,EAAQ,aAAA,EAAe,IAAA,EAAM,WAAA"}
@@ -0,0 +1,208 @@
1
+ import { a as emuToInches, i as STANDARD_LAYOUTS } from "./units-Bmst2HBb.js";
2
+ import JSZip from "jszip";
3
+ import { XMLParser } from "fast-xml-parser";
4
+ //#region src/inspect.ts
5
+ const DEFAULT_INSPECT_SLIDE_SIZE = Object.freeze({
6
+ widthIn: round(STANDARD_LAYOUTS.LAYOUT_WIDE.widthIn, 3),
7
+ heightIn: STANDARD_LAYOUTS.LAYOUT_WIDE.heightIn
8
+ });
9
+ const parser = new XMLParser({
10
+ ignoreAttributes: false,
11
+ attributeNamePrefix: "",
12
+ allowBooleanAttributes: true,
13
+ parseAttributeValue: true,
14
+ parseTagValue: false
15
+ });
16
+ async function loadPptxPackage(input) {
17
+ return JSZip.loadAsync(input);
18
+ }
19
+ function listPptxParts(pptxPackage) {
20
+ return Object.keys(pptxPackage.files).sort();
21
+ }
22
+ async function readPptxTextPart(pptxPackage, path) {
23
+ const entry = pptxPackage.file(path);
24
+ return entry ? entry.async("string") : null;
25
+ }
26
+ async function inspectPptx(input) {
27
+ const pptxPackage = await loadPptxPackage(input);
28
+ const slideSize = await readPresentationSize(pptxPackage);
29
+ return {
30
+ slideSize,
31
+ slides: await extractSlides(pptxPackage, slideSize)
32
+ };
33
+ }
34
+ async function readPresentationSize(pptxPackage, fallback = DEFAULT_INSPECT_SLIDE_SIZE) {
35
+ const presentationXml = await readPptxTextPart(pptxPackage, "ppt/presentation.xml");
36
+ if (!presentationXml) return fallback;
37
+ const size = nodeChild(nodeChild(asNode(parser.parse(presentationXml)), "p:presentation"), "p:sldSz");
38
+ const cx = numericValue(size?.cx);
39
+ const cy = numericValue(size?.cy);
40
+ if (cx === null || cy === null) return fallback;
41
+ return {
42
+ widthIn: round(emuToInches(cx), 3),
43
+ heightIn: round(emuToInches(cy), 3)
44
+ };
45
+ }
46
+ async function extractSlides(pptxPackage, size) {
47
+ const slideSize = size || await readPresentationSize(pptxPackage);
48
+ const slidePaths = listPptxParts(pptxPackage).filter((path) => /^ppt\/slides\/slide\d+\.xml$/.test(path)).sort((a, b) => slideNumberFromPath(a) - slideNumberFromPath(b));
49
+ const slides = [];
50
+ for (const [index, path] of slidePaths.entries()) {
51
+ const xml = await readPptxTextPart(pptxPackage, path);
52
+ if (!xml) continue;
53
+ const cSld = nodeChild(nodeChild(asNode(parser.parse(xml)), "p:sld"), "p:cSld");
54
+ const elements = collectElements(nodeChild(cSld, "p:spTree")).map((el, zIndex) => normalizeElement(el, zIndex)).filter((element) => Boolean(element));
55
+ const text = elements.map((el) => el.text).filter(Boolean).join(" ");
56
+ slides.push({
57
+ index,
58
+ name: stringValue(cSld?.name) || `Slide ${index + 1}`,
59
+ path,
60
+ size: slideSize,
61
+ elements,
62
+ text,
63
+ wordCount: countWords(text)
64
+ });
65
+ }
66
+ return slides;
67
+ }
68
+ function overlapArea(a, b) {
69
+ return Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y));
70
+ }
71
+ function boxAnchor(box, anchor, axis) {
72
+ if (axis === "x") {
73
+ if (anchor === "left") return box.x;
74
+ if (anchor === "right") return box.x + box.w;
75
+ return box.x + box.w / 2;
76
+ }
77
+ if (anchor === "top") return box.y;
78
+ if (anchor === "bottom") return box.y + box.h;
79
+ return box.y + box.h / 2;
80
+ }
81
+ function slideNumberFromPath(path) {
82
+ return Number(path.match(/slide(\d+)\.xml$/)?.[1] || 0);
83
+ }
84
+ function collectElements(node) {
85
+ const elements = [];
86
+ walk(node, (candidate) => {
87
+ for (const key of [
88
+ "p:sp",
89
+ "p:pic",
90
+ "p:cxnSp"
91
+ ]) for (const child of asArray(candidate[key])) {
92
+ const element = asNode(child);
93
+ if (element) elements.push(element);
94
+ }
95
+ });
96
+ return elements;
97
+ }
98
+ function normalizeElement(node, zIndex) {
99
+ const spPr = nodeChild(node, "p:spPr");
100
+ const box = readBox(nodeChild(spPr, "a:xfrm"));
101
+ if (!box) return null;
102
+ const textBody = nodeChild(node, "p:txBody");
103
+ const textRuns = extractTextRuns(textBody);
104
+ const text = textRuns.map((run) => run.text).join("").replace(/\s+/g, " ").trim();
105
+ const kind = text ? "text" : nodeChild(node, "p:blipFill") ? "image" : "shape";
106
+ return {
107
+ id: stringOrNumberValue(cNvPr(node, "p:nvSpPr")?.id) || stringOrNumberValue(cNvPr(node, "p:nvPicPr")?.id) || stringOrNumberValue(cNvPr(node, "p:nvCxnSpPr")?.id) || zIndex + 1,
108
+ name: stringValue(cNvPr(node, "p:nvSpPr")?.name) || stringValue(cNvPr(node, "p:nvPicPr")?.name) || stringValue(cNvPr(node, "p:nvCxnSpPr")?.name) || `${kind} ${zIndex + 1}`,
109
+ kind,
110
+ zIndex,
111
+ box,
112
+ text,
113
+ textWrap: readTextWrap(textBody),
114
+ textRuns,
115
+ fontSizes: [...new Set(textRuns.map((run) => run.fontSizePt).filter((size) => size !== null))],
116
+ colors: [...new Set(textRuns.map((run) => run.color).filter((color) => Boolean(color)))],
117
+ fill: readFill(spPr),
118
+ line: readLine(spPr),
119
+ shapeType: stringValue(nodeChild(spPr, "a:prstGeom")?.prst)
120
+ };
121
+ }
122
+ function cNvPr(node, parentKey) {
123
+ return nodeChild(nodeChild(node, parentKey), "p:cNvPr");
124
+ }
125
+ function readBox(xfrm) {
126
+ const off = nodeChild(xfrm, "a:off");
127
+ const ext = nodeChild(xfrm, "a:ext");
128
+ if (!off || !ext) return null;
129
+ return {
130
+ x: emuToInches(numericValue(off.x) || 0),
131
+ y: emuToInches(numericValue(off.y) || 0),
132
+ w: emuToInches(numericValue(ext.cx) || 0),
133
+ h: emuToInches(numericValue(ext.cy) || 0)
134
+ };
135
+ }
136
+ function extractTextRuns(textBody) {
137
+ if (!textBody) return [];
138
+ const runs = [];
139
+ walk(textBody, (node) => {
140
+ for (const item of asArray(node["a:r"])) {
141
+ const run = asNode(item);
142
+ if (!run) continue;
143
+ const text = stringValue(run["a:t"]);
144
+ if (text === null) continue;
145
+ const props = nodeChild(run, "a:rPr");
146
+ runs.push({
147
+ text,
148
+ fontSizePt: props?.sz ? Number(props.sz) / 100 : null,
149
+ color: readTextColor(props)
150
+ });
151
+ }
152
+ });
153
+ return runs;
154
+ }
155
+ function readTextColor(props) {
156
+ return stringValue(nodeChild(nodeChild(props, "a:solidFill"), "a:srgbClr")?.val);
157
+ }
158
+ function readFill(spPr) {
159
+ return stringValue(nodeChild(nodeChild(spPr, "a:solidFill"), "a:srgbClr")?.val);
160
+ }
161
+ function readLine(spPr) {
162
+ return stringValue(nodeChild(nodeChild(nodeChild(spPr, "a:ln"), "a:solidFill"), "a:srgbClr")?.val);
163
+ }
164
+ function readTextWrap(textBody) {
165
+ return stringValue(nodeChild(textBody, "a:bodyPr")?.wrap);
166
+ }
167
+ function walk(value, visitor) {
168
+ if (Array.isArray(value)) {
169
+ for (const child of value) walk(child, visitor);
170
+ return;
171
+ }
172
+ const node = asNode(value);
173
+ if (!node) return;
174
+ visitor(node);
175
+ for (const child of Object.values(node)) walk(child, visitor);
176
+ }
177
+ function asArray(value) {
178
+ if (value === void 0 || value === null) return [];
179
+ return Array.isArray(value) ? value : [value];
180
+ }
181
+ function nodeChild(node, key) {
182
+ return asNode(node?.[key]);
183
+ }
184
+ function asNode(value) {
185
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
186
+ }
187
+ function numericValue(value) {
188
+ const number = Number(value);
189
+ return Number.isFinite(number) ? number : null;
190
+ }
191
+ function stringValue(value) {
192
+ return value === void 0 || value === null ? null : String(value);
193
+ }
194
+ function stringOrNumberValue(value) {
195
+ if (typeof value === "number" || typeof value === "string") return value;
196
+ return stringValue(value);
197
+ }
198
+ function countWords(text) {
199
+ return text.split(/\s+/).filter(Boolean).length;
200
+ }
201
+ function round(value, digits) {
202
+ const factor = 10 ** digits;
203
+ return Math.round(value * factor) / factor;
204
+ }
205
+ //#endregion
206
+ export { DEFAULT_INSPECT_SLIDE_SIZE, boxAnchor, extractSlides, inspectPptx, listPptxParts, loadPptxPackage, overlapArea, readPptxTextPart, readPresentationSize };
207
+
208
+ //# sourceMappingURL=inspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.js","names":[],"sources":["../src/inspect.ts"],"sourcesContent":["import JSZip from 'jszip'\nimport { XMLParser } from 'fast-xml-parser'\nimport { STANDARD_LAYOUTS, emuToInches } from './units.js'\n\ntype XmlNode = Record<string, unknown>\n\ntype PptxInspectInputValue = string | number[] | Uint8Array | ArrayBuffer | Blob\n\nexport type PptxInspectInput = PptxInspectInputValue | Promise<PptxInspectInputValue>\n\nexport interface PptxPackageFile {\n\tasync(type: 'string'): Promise<string>\n}\n\nexport interface PptxPackage {\n\tfiles: Record<string, unknown>\n\tfile(path: string): PptxPackageFile | null\n}\n\nexport interface PptxSlideSize {\n\twidthIn: number\n\theightIn: number\n}\n\nexport interface PptxBox {\n\tx: number\n\ty: number\n\tw: number\n\th: number\n}\n\nexport interface PptxTextRun {\n\ttext: string\n\tfontSizePt: number | null\n\tcolor: string | null\n}\n\nexport type PptxSlideElementKind = 'text' | 'image' | 'shape'\n\nexport interface PptxSlideElement {\n\tid: string | number\n\tname: string\n\tkind: PptxSlideElementKind\n\tzIndex: number\n\tbox: PptxBox\n\ttext: string\n\ttextWrap: string | null\n\ttextRuns: PptxTextRun[]\n\tfontSizes: number[]\n\tcolors: string[]\n\tfill: string | null\n\tline: string | null\n\tshapeType: string | null\n}\n\nexport interface PptxSlideInspection {\n\tindex: number\n\tname: string\n\tpath: string\n\tsize: PptxSlideSize\n\telements: PptxSlideElement[]\n\ttext: string\n\twordCount: number\n}\n\nexport interface PptxInspection {\n\tslideSize: PptxSlideSize\n\tslides: PptxSlideInspection[]\n}\n\nexport type PptxBoxAxis = 'x' | 'y'\nexport type PptxBoxAnchor = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom'\n\nexport const DEFAULT_INSPECT_SLIDE_SIZE: PptxSlideSize = Object.freeze({\n\twidthIn: round(STANDARD_LAYOUTS.LAYOUT_WIDE.widthIn, 3),\n\theightIn: STANDARD_LAYOUTS.LAYOUT_WIDE.heightIn,\n})\n\nconst parser = new XMLParser({\n\tignoreAttributes: false,\n\tattributeNamePrefix: '',\n\tallowBooleanAttributes: true,\n\tparseAttributeValue: true,\n\tparseTagValue: false,\n})\n\nexport async function loadPptxPackage(input: PptxInspectInput): Promise<PptxPackage> {\n\treturn JSZip.loadAsync(input)\n}\n\nexport function listPptxParts(pptxPackage: PptxPackage): string[] {\n\treturn Object.keys(pptxPackage.files).sort()\n}\n\nexport async function readPptxTextPart(pptxPackage: PptxPackage, path: string): Promise<string | null> {\n\tconst entry = pptxPackage.file(path)\n\treturn entry ? entry.async('string') : null\n}\n\nexport async function inspectPptx(input: PptxInspectInput): Promise<PptxInspection> {\n\tconst pptxPackage = await loadPptxPackage(input)\n\tconst slideSize = await readPresentationSize(pptxPackage)\n\tconst slides = await extractSlides(pptxPackage, slideSize)\n\treturn { slideSize, slides }\n}\n\nexport async function readPresentationSize(\n\tpptxPackage: PptxPackage,\n\tfallback: PptxSlideSize = DEFAULT_INSPECT_SLIDE_SIZE\n): Promise<PptxSlideSize> {\n\tconst presentationXml = await readPptxTextPart(pptxPackage, 'ppt/presentation.xml')\n\tif (!presentationXml) return fallback\n\n\tconst parsed = asNode(parser.parse(presentationXml))\n\tconst presentation = nodeChild(parsed, 'p:presentation')\n\tconst size = nodeChild(presentation, 'p:sldSz')\n\tconst cx = numericValue(size?.cx)\n\tconst cy = numericValue(size?.cy)\n\tif (cx === null || cy === null) return fallback\n\n\treturn {\n\t\twidthIn: round(emuToInches(cx), 3),\n\t\theightIn: round(emuToInches(cy), 3),\n\t}\n}\n\nexport async function extractSlides(\n\tpptxPackage: PptxPackage,\n\tsize?: PptxSlideSize\n): Promise<PptxSlideInspection[]> {\n\tconst slideSize = size || (await readPresentationSize(pptxPackage))\n\tconst slidePaths = listPptxParts(pptxPackage)\n\t\t.filter(path => /^ppt\\/slides\\/slide\\d+\\.xml$/.test(path))\n\t\t.sort((a, b) => slideNumberFromPath(a) - slideNumberFromPath(b))\n\n\tconst slides: PptxSlideInspection[] = []\n\tfor (const [index, path] of slidePaths.entries()) {\n\t\tconst xml = await readPptxTextPart(pptxPackage, path)\n\t\tif (!xml) continue\n\n\t\tconst parsed = asNode(parser.parse(xml))\n\t\tconst root = nodeChild(parsed, 'p:sld')\n\t\tconst cSld = nodeChild(root, 'p:cSld')\n\t\tconst elements = collectElements(nodeChild(cSld, 'p:spTree'))\n\t\t\t.map((el, zIndex) => normalizeElement(el, zIndex))\n\t\t\t.filter((element): element is PptxSlideElement => Boolean(element))\n\t\tconst text = elements.map(el => el.text).filter(Boolean).join(' ')\n\n\t\tslides.push({\n\t\t\tindex,\n\t\t\tname: stringValue(cSld?.name) || `Slide ${index + 1}`,\n\t\t\tpath,\n\t\t\tsize: slideSize,\n\t\t\telements,\n\t\t\ttext,\n\t\t\twordCount: countWords(text),\n\t\t})\n\t}\n\n\treturn slides\n}\n\nexport function overlapArea(a: PptxBox, b: PptxBox): number {\n\tconst x = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x))\n\tconst y = Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y))\n\treturn x * y\n}\n\nexport function boxAnchor(box: PptxBox, anchor: PptxBoxAnchor, axis: PptxBoxAxis): number {\n\tif (axis === 'x') {\n\t\tif (anchor === 'left') return box.x\n\t\tif (anchor === 'right') return box.x + box.w\n\t\treturn box.x + box.w / 2\n\t}\n\tif (anchor === 'top') return box.y\n\tif (anchor === 'bottom') return box.y + box.h\n\treturn box.y + box.h / 2\n}\n\nfunction slideNumberFromPath(path: string): number {\n\treturn Number(path.match(/slide(\\d+)\\.xml$/)?.[1] || 0)\n}\n\nfunction collectElements(node: XmlNode | null): XmlNode[] {\n\tconst elements: XmlNode[] = []\n\twalk(node, candidate => {\n\t\tfor (const key of ['p:sp', 'p:pic', 'p:cxnSp']) {\n\t\t\tfor (const child of asArray(candidate[key])) {\n\t\t\t\tconst element = asNode(child)\n\t\t\t\tif (element) elements.push(element)\n\t\t\t}\n\t\t}\n\t})\n\treturn elements\n}\n\nfunction normalizeElement(node: XmlNode, zIndex: number): PptxSlideElement | null {\n\tconst spPr = nodeChild(node, 'p:spPr')\n\tconst box = readBox(nodeChild(spPr, 'a:xfrm'))\n\tif (!box) return null\n\n\tconst textBody = nodeChild(node, 'p:txBody')\n\tconst textRuns = extractTextRuns(textBody)\n\tconst text = textRuns.map(run => run.text).join('').replace(/\\s+/g, ' ').trim()\n\tconst kind: PptxSlideElementKind = text ? 'text' : nodeChild(node, 'p:blipFill') ? 'image' : 'shape'\n\n\treturn {\n\t\tid:\n\t\t\tstringOrNumberValue(cNvPr(node, 'p:nvSpPr')?.id) ||\n\t\t\tstringOrNumberValue(cNvPr(node, 'p:nvPicPr')?.id) ||\n\t\t\tstringOrNumberValue(cNvPr(node, 'p:nvCxnSpPr')?.id) ||\n\t\t\tzIndex + 1,\n\t\tname:\n\t\t\tstringValue(cNvPr(node, 'p:nvSpPr')?.name) ||\n\t\t\tstringValue(cNvPr(node, 'p:nvPicPr')?.name) ||\n\t\t\tstringValue(cNvPr(node, 'p:nvCxnSpPr')?.name) ||\n\t\t\t`${kind} ${zIndex + 1}`,\n\t\tkind,\n\t\tzIndex,\n\t\tbox,\n\t\ttext,\n\t\ttextWrap: readTextWrap(textBody),\n\t\ttextRuns,\n\t\tfontSizes: [...new Set(textRuns.map(run => run.fontSizePt).filter((size): size is number => size !== null))],\n\t\tcolors: [...new Set(textRuns.map(run => run.color).filter((color): color is string => Boolean(color)))],\n\t\tfill: readFill(spPr),\n\t\tline: readLine(spPr),\n\t\tshapeType: stringValue(nodeChild(spPr, 'a:prstGeom')?.prst),\n\t}\n}\n\nfunction cNvPr(node: XmlNode, parentKey: string): XmlNode | null {\n\treturn nodeChild(nodeChild(node, parentKey), 'p:cNvPr')\n}\n\nfunction readBox(xfrm: XmlNode | null): PptxBox | null {\n\tconst off = nodeChild(xfrm, 'a:off')\n\tconst ext = nodeChild(xfrm, 'a:ext')\n\tif (!off || !ext) return null\n\treturn {\n\t\tx: emuToInches(numericValue(off.x) || 0),\n\t\ty: emuToInches(numericValue(off.y) || 0),\n\t\tw: emuToInches(numericValue(ext.cx) || 0),\n\t\th: emuToInches(numericValue(ext.cy) || 0),\n\t}\n}\n\nfunction extractTextRuns(textBody: XmlNode | null): PptxTextRun[] {\n\tif (!textBody) return []\n\tconst runs: PptxTextRun[] = []\n\twalk(textBody, node => {\n\t\tfor (const item of asArray(node['a:r'])) {\n\t\t\tconst run = asNode(item)\n\t\t\tif (!run) continue\n\t\t\tconst text = stringValue(run['a:t'])\n\t\t\tif (text === null) continue\n\t\t\tconst props = nodeChild(run, 'a:rPr')\n\t\t\truns.push({\n\t\t\t\ttext,\n\t\t\t\tfontSizePt: props?.sz ? Number(props.sz) / 100 : null,\n\t\t\t\tcolor: readTextColor(props),\n\t\t\t})\n\t\t}\n\t})\n\treturn runs\n}\n\nfunction readTextColor(props: XmlNode | null): string | null {\n\treturn stringValue(nodeChild(nodeChild(props, 'a:solidFill'), 'a:srgbClr')?.val)\n}\n\nfunction readFill(spPr: XmlNode | null): string | null {\n\treturn stringValue(nodeChild(nodeChild(spPr, 'a:solidFill'), 'a:srgbClr')?.val)\n}\n\nfunction readLine(spPr: XmlNode | null): string | null {\n\treturn stringValue(nodeChild(nodeChild(nodeChild(spPr, 'a:ln'), 'a:solidFill'), 'a:srgbClr')?.val)\n}\n\nfunction readTextWrap(textBody: XmlNode | null): string | null {\n\treturn stringValue(nodeChild(textBody, 'a:bodyPr')?.wrap)\n}\n\nfunction walk(value: unknown, visitor: (node: XmlNode) => void): void {\n\tif (Array.isArray(value)) {\n\t\tfor (const child of value) walk(child, visitor)\n\t\treturn\n\t}\n\tconst node = asNode(value)\n\tif (!node) return\n\tvisitor(node)\n\tfor (const child of Object.values(node)) walk(child, visitor)\n}\n\nfunction asArray(value: unknown): unknown[] {\n\tif (value === undefined || value === null) return []\n\treturn Array.isArray(value) ? value : [value]\n}\n\nfunction nodeChild(node: XmlNode | null | undefined, key: string): XmlNode | null {\n\treturn asNode(node?.[key])\n}\n\nfunction asNode(value: unknown): XmlNode | null {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value) ? value as XmlNode : null\n}\n\nfunction numericValue(value: unknown): number | null {\n\tconst number = Number(value)\n\treturn Number.isFinite(number) ? number : null\n}\n\nfunction stringValue(value: unknown): string | null {\n\treturn value === undefined || value === null ? null : String(value)\n}\n\nfunction stringOrNumberValue(value: unknown): string | number | null {\n\tif (typeof value === 'number' || typeof value === 'string') return value\n\treturn stringValue(value)\n}\n\nfunction countWords(text: string): number {\n\treturn text.split(/\\s+/).filter(Boolean).length\n}\n\nfunction round(value: number, digits: number): number {\n\tconst factor = 10 ** digits\n\treturn Math.round(value * factor) / factor\n}\n"],"mappings":";;;;AAyEA,MAAa,6BAA4C,OAAO,OAAO;CACtE,SAAS,MAAM,iBAAiB,YAAY,SAAS,CAAC;CACtD,UAAU,iBAAiB,YAAY;AACxC,CAAC;AAED,MAAM,SAAS,IAAI,UAAU;CAC5B,kBAAkB;CAClB,qBAAqB;CACrB,wBAAwB;CACxB,qBAAqB;CACrB,eAAe;AAChB,CAAC;AAED,eAAsB,gBAAgB,OAA+C;CACpF,OAAO,MAAM,UAAU,KAAK;AAC7B;AAEA,SAAgB,cAAc,aAAoC;CACjE,OAAO,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,KAAK;AAC5C;AAEA,eAAsB,iBAAiB,aAA0B,MAAsC;CACtG,MAAM,QAAQ,YAAY,KAAK,IAAI;CACnC,OAAO,QAAQ,MAAM,MAAM,QAAQ,IAAI;AACxC;AAEA,eAAsB,YAAY,OAAkD;CACnF,MAAM,cAAc,MAAM,gBAAgB,KAAK;CAC/C,MAAM,YAAY,MAAM,qBAAqB,WAAW;CAExD,OAAO;EAAE;EAAW,QAAA,MADC,cAAc,aAAa,SAAS;CAC9B;AAC5B;AAEA,eAAsB,qBACrB,aACA,WAA0B,4BACD;CACzB,MAAM,kBAAkB,MAAM,iBAAiB,aAAa,sBAAsB;CAClF,IAAI,CAAC,iBAAiB,OAAO;CAI7B,MAAM,OAAO,UADQ,UADN,OAAO,OAAO,MAAM,eAAe,CACd,GAAG,gBACL,GAAG,SAAS;CAC9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,MAAM,OAAO,CAAC;CACnD,OAAO,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;AAC7C;AAEA,SAAS,UAAU,MAAkC,KAA6B;CACjF,OAAO,OAAO,OAAO,IAAI;AAC1B;AAEA,SAAS,OAAO,OAAgC;CAC/C,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAmB;AAClG;AAEA,SAAS,aAAa,OAA+B;CACpD,MAAM,SAAS,OAAO,KAAK;CAC3B,OAAO,OAAO,SAAS,MAAM,IAAI,SAAS;AAC3C;AAEA,SAAS,YAAY,OAA+B;CACnD,OAAO,UAAU,KAAA,KAAa,UAAU,OAAO,OAAO,OAAO,KAAK;AACnE;AAEA,SAAS,oBAAoB,OAAwC;CACpE,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU,OAAO;CACnE,OAAO,YAAY,KAAK;AACzB;AAEA,SAAS,WAAW,MAAsB;CACzC,OAAO,KAAK,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C;AAEA,SAAS,MAAM,OAAe,QAAwB;CACrD,MAAM,SAAS,MAAM;CACrB,OAAO,KAAK,MAAM,QAAQ,MAAM,IAAI;AACrC"}
package/dist/node.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { $ as TEXT_HALIGN, $t as SectionProps, A as DEF_TEXT_SHADOW, At as IChartPropsLegend, B as OutputType, Bt as MediaProps, C as DEF_PRES_LAYOUT, Cn as VAlign, Ct as IChartPropsChartDoughnut, D as DEF_SLIDE_BKGD, Dt as IChartPropsDataLabel, E as DEF_SHAPE_SHADOW, En as WriteProps, Et as IChartPropsChartRadar, F as LAYOUT_IDX_SERIES_BASE, Ft as ISlideRel, G as SCHEME_COLORS, Gt as OptsChartGridLine, H as PLACEHOLDER_TYPE, Ht as ObjectNameProps, I as LETTERS, It as ISlideRelChart, J as SHAPE_TYPE, Jt as PresLayout, K as SCHEME_COLOR_NAMES, Kt as PlaceholderProps, L as LINEH_MODIFIER, Lt as ISlideRelMedia, M as IMG_BROKEN, Mt as IOptsChartData, N as IMG_PLAYBTN, Nt as IPresentationProps, O as DEF_SLIDE_MARGIN_IN, Ot as IChartPropsDataTable, P as JSZIP_OUTPUT_TYPE, Pt as ISlideObject, Q as ShapeType, Qt as SectionInternalProps, R as MASTER_OBJECTS, Rt as ImageProps, S as DEF_FONT_TITLE_SIZE, Sn as ThemeProps, St as IChartPropsChartBar, T as DEF_SHAPE_LINE_COLOR, Tn as WriteFileProps, Tt as IChartPropsChartPie, U as PLACEHOLDER_TYPES, Ut as ObjectOptions, V as PIECHART_COLORS, Vt as MediaType, W as REGEX_HEX_COLOR, Wt as OptsChartData, X as SLIDE_OBJECT_TYPES, Xt as PresSlideInternal, Y as SLDNUMFLDID, Yt as PresSlide, Z as SchemeColor, Zt as PresentationProps, _ as DEF_CELL_MARGIN_PT, _n as TextBaseProps, _t as IChartOptsLib, a as AXIS_ID_VALUE_SECONDARY, an as SlideLayout, at as ChartAxisTickMark, b as DEF_FONT_COLOR, bn as TextPropsOptions, bt as IChartPropsAxisVal, c as BARCHART_COLORS, cn as SlideMasterObject, ct as Coord, d as CHART_TYPE, dn as TableCell, dt as HAlign, en as ShadowProps, et as TEXT_VALIGN, f as CRLF, fn as TableCellProps, ft as HexColor, g as DEF_CELL_MARGIN_IN, gn as TableToSlidesProps, gt as IChartOpts, h as DEF_CELL_BORDER, hn as TableRowSlide, ht as IChartMulti, i as AXIS_ID_VALUE_PRIMARY, in as SlideBaseProps, it as BorderProps, j as EMU, jt as IChartPropsTitle, k as DEF_TEXT_GLOW, kt as IChartPropsFillLine, l as BULLET_TYPES, ln as SlideMasterProps, lt as DataOrPathProps, m as DEF_BULLET_MARGIN, mn as TableRow, mt as IChartAreaProps, n as AXIS_ID_CATEGORY_SECONDARY, nn as ShapeLineProps, nt as AddSlideProps, o as AlignH, on as SlideLayoutInternal, ot as ChartLineCap, p as ChartType, pn as TableProps, pt as HyperlinkProps, q as SHAPE_NAME, qt as PositionProps, r as AXIS_ID_SERIES_PRIMARY, rn as ShapeProps, rt as BackgroundProps, s as AlignV, sn as SlideMasterChartProps, st as Color, t as AXIS_ID_CATEGORY_PRIMARY, tn as ShapeFillProps, tt as WRITE_OUTPUT_TYPE, u as CHART_NAME, un as SlideNumberProps, ut as DataOrPathRequiredProps, v as DEF_CHART_BORDER, vn as TextGlowProps, vt as IChartPropsAxisCat, w as DEF_PRES_LAYOUT_NAME, wn as WriteBaseProps, wt as IChartPropsChartLine, x as DEF_FONT_SIZE, xn as ThemeColor, xt as IChartPropsBase, y as DEF_CHART_GRIDLINE, yn as TextProps, yt as IChartPropsAxisSer, z as ONEPT, zt as Margin } from "./core-enums-gPygzzFU.js";
2
- import { t as PptxGenJS$1 } from "./pptxgen-B5ir1ywb.js";
1
+ import { $ as PIECHART_COLORS, $t as LinearGradientFillProps, A as DEF_CHART_BORDER, An as TableRowSlide, At as IChartOpts, B as DEF_SLIDE_MARGIN_IN, Bn as WriteFileProps, Bt as IChartPropsChartRadar, C as CHART_TYPE, Cn as SlideMasterObject, Ct as GradientFillProps, D as DEF_CELL_BORDER, Dn as TableCellProps, Dt as HyperlinkProps, E as DEF_BULLET_MARGIN, En as TableCell, Et as HexColor, F as DEF_PRES_LAYOUT, Fn as TextPropsOptions, Ft as IChartPropsBase, G as IMG_PLAYBTN, Gt as IChartPropsTitle, H as DEF_TEXT_SHADOW, Ht as IChartPropsDataTable, I as DEF_PRES_LAYOUT_NAME, In as ThemeColor, It as IChartPropsChartBar, J as LETTERS, Jt as ISlideObject, K as JSZIP_OUTPUT_TYPE, Kt as IOptsChartData, L as DEF_SHAPE_LINE_COLOR, Ln as ThemeProps, Lt as IChartPropsChartDoughnut, M as DEF_FONT_COLOR, Mn as TextBaseProps, Mt as IChartPropsAxisCat, N as DEF_FONT_SIZE, Nn as TextGlowProps, Nt as IChartPropsAxisSer, O as DEF_CELL_MARGIN_IN, On as TableProps, Ot as IChartAreaProps, P as DEF_FONT_TITLE_SIZE, Pn as TextProps, Pt as IChartPropsAxisVal, Q as OutputType, Qt as ImageProps, R as DEF_SHAPE_SHADOW, Rn as VAlign, Rt as IChartPropsChartLine, S as CHART_NAME, Sn as SlideMasterChartProps, St as DataOrPathRequiredProps, T as ChartType, Tn as SlideNumberProps, Tt as HAlign, U as EMU, Ut as IChartPropsFillLine, V as DEF_TEXT_GLOW, Vn as WriteProps, Vt as IChartPropsDataLabel, W as IMG_BROKEN, Wt as IChartPropsLegend, X as MASTER_OBJECTS, Xt as ISlideRelChart, Y as LINEH_MODIFIER, Yt as ISlideRel, Z as ONEPT, Zt as ISlideRelMedia, _ as AXIS_ID_VALUE_SECONDARY, _n as ShapeLineProps, _t as ChartAxisTickMark, a as StandardLayout, an as OptsChartData, at as SHAPE_NAME, b as BARCHART_COLORS, bn as SlideLayout, bt as Coord, c as emuToPixels, cn as PositionProps, ct as SLIDE_OBJECT_TYPES, d as pixelsToEmu, dn as PresSlideInternal, dt as TEXT_HALIGN, en as Margin, et as PLACEHOLDER_TYPE, f as pointsToEmu, fn as PresentationProps, ft as TEXT_VALIGN, g as AXIS_ID_VALUE_PRIMARY, gn as ShapeFillProps, gt as BorderProps, h as AXIS_ID_SERIES_PRIMARY, hn as ShadowProps, ht as BackgroundProps, i as STANDARD_LAYOUTS, in as ObjectOptions, it as SCHEME_COLOR_NAMES, j as DEF_CHART_GRIDLINE, jn as TableToSlidesProps, jt as IChartOptsLib, k as DEF_CELL_MARGIN_PT, kn as TableRow, kt as IChartMulti, l as emuToPoints, ln as PresLayout, lt as SchemeColor, m as AXIS_ID_CATEGORY_SECONDARY, mn as SectionProps, mt as AddSlideProps, n as EMU_PER_POINT, nn as MediaType, nt as REGEX_HEX_COLOR, o as StandardLayoutName, on as OptsChartGridLine, ot as SHAPE_TYPE, p as AXIS_ID_CATEGORY_PRIMARY, pn as SectionInternalProps, pt as WRITE_OUTPUT_TYPE, q as LAYOUT_IDX_SERIES_BASE, qt as IPresentationProps, r as POINTS_PER_INCH, rn as ObjectNameProps, rt as SCHEME_COLORS, s as emuToInches, sn as PlaceholderProps, st as SLDNUMFLDID, t as EMU_PER_INCH, tn as MediaProps, tt as PLACEHOLDER_TYPES, u as inchesToEmu, un as PresSlide, ut as ShapeType, v as AlignH, vn as ShapeProps, vt as ChartLineCap, w as CRLF, wn as SlideMasterProps, wt as GradientStopProps, x as BULLET_TYPES, xn as SlideLayoutInternal, xt as DataOrPathProps, y as AlignV, yn as SlideBaseProps, yt as Color, z as DEF_SLIDE_BKGD, zn as WriteBaseProps, zt as IChartPropsChartPie } from "./units-CpDIQgsT.js";
2
+ import { t as PptxGenJS$1 } from "./pptxgen-BqDpIYsq.js";
3
3
 
4
4
  //#region src/node.d.ts
5
5
  declare class PptxGenJS extends PptxGenJS$1 {
6
6
  constructor();
7
7
  }
8
8
  //#endregion
9
- export { AXIS_ID_CATEGORY_PRIMARY, AXIS_ID_CATEGORY_SECONDARY, AXIS_ID_SERIES_PRIMARY, AXIS_ID_VALUE_PRIMARY, AXIS_ID_VALUE_SECONDARY, type AddSlideProps, AlignH, AlignV, BARCHART_COLORS, BULLET_TYPES, type BackgroundProps, type BorderProps, CHART_NAME, CHART_TYPE, CRLF, type ChartAxisTickMark, type ChartLineCap, ChartType, type Color, type Coord, DEF_BULLET_MARGIN, DEF_CELL_BORDER, DEF_CELL_MARGIN_IN, DEF_CELL_MARGIN_PT, DEF_CHART_BORDER, DEF_CHART_GRIDLINE, DEF_FONT_COLOR, DEF_FONT_SIZE, DEF_FONT_TITLE_SIZE, DEF_PRES_LAYOUT, DEF_PRES_LAYOUT_NAME, DEF_SHAPE_LINE_COLOR, DEF_SHAPE_SHADOW, DEF_SLIDE_BKGD, DEF_SLIDE_MARGIN_IN, DEF_TEXT_GLOW, DEF_TEXT_SHADOW, type DataOrPathProps, type DataOrPathRequiredProps, EMU, type HAlign, type HexColor, type HyperlinkProps, type IChartAreaProps, type IChartMulti, type IChartOpts, type IChartOptsLib, type IChartPropsAxisCat, type IChartPropsAxisSer, type IChartPropsAxisVal, type IChartPropsBase, type IChartPropsChartBar, type IChartPropsChartDoughnut, type IChartPropsChartLine, type IChartPropsChartPie, type IChartPropsChartRadar, type IChartPropsDataLabel, type IChartPropsDataTable, type IChartPropsFillLine, type IChartPropsLegend, type IChartPropsTitle, IMG_BROKEN, IMG_PLAYBTN, type IOptsChartData, type IPresentationProps, type ISlideObject, type ISlideRel, type ISlideRelChart, type ISlideRelMedia, type ImageProps, JSZIP_OUTPUT_TYPE, LAYOUT_IDX_SERIES_BASE, LETTERS, LINEH_MODIFIER, MASTER_OBJECTS, type Margin, type MediaProps, type MediaType, ONEPT, type ObjectNameProps, type ObjectOptions, type OptsChartData, type OptsChartGridLine, OutputType, PIECHART_COLORS, PLACEHOLDER_TYPE, PLACEHOLDER_TYPES, type PlaceholderProps, type PositionProps, PptxGenJS, PptxGenJS as Presentation, PptxGenJS as default, type PresLayout, type PresSlide, type PresSlide as Slide, type PresSlideInternal, type PresentationProps, REGEX_HEX_COLOR, SCHEME_COLORS, SCHEME_COLOR_NAMES, SHAPE_NAME, SHAPE_TYPE, SLDNUMFLDID, SLIDE_OBJECT_TYPES, SchemeColor, type SectionInternalProps, type SectionProps, type ShadowProps, type ShapeFillProps, type ShapeLineProps, type ShapeProps, ShapeType, type SlideBaseProps, type SlideLayout, type SlideLayoutInternal, type SlideMasterChartProps, type SlideMasterObject, type SlideMasterProps, type SlideNumberProps, TEXT_HALIGN, TEXT_VALIGN, type TableCell, type TableCellProps, type TableProps, type TableRow, type TableRowSlide, type TableToSlidesProps, type TextBaseProps, type TextGlowProps, type TextProps, type TextPropsOptions, type ThemeColor, type ThemeProps, type VAlign, WRITE_OUTPUT_TYPE, type WriteBaseProps, type WriteFileProps, type WriteProps };
9
+ export { AXIS_ID_CATEGORY_PRIMARY, AXIS_ID_CATEGORY_SECONDARY, AXIS_ID_SERIES_PRIMARY, AXIS_ID_VALUE_PRIMARY, AXIS_ID_VALUE_SECONDARY, type AddSlideProps, AlignH, AlignV, BARCHART_COLORS, BULLET_TYPES, type BackgroundProps, type BorderProps, CHART_NAME, CHART_TYPE, CRLF, type ChartAxisTickMark, type ChartLineCap, ChartType, type Color, type Coord, DEF_BULLET_MARGIN, DEF_CELL_BORDER, DEF_CELL_MARGIN_IN, DEF_CELL_MARGIN_PT, DEF_CHART_BORDER, DEF_CHART_GRIDLINE, DEF_FONT_COLOR, DEF_FONT_SIZE, DEF_FONT_TITLE_SIZE, DEF_PRES_LAYOUT, DEF_PRES_LAYOUT_NAME, DEF_SHAPE_LINE_COLOR, DEF_SHAPE_SHADOW, DEF_SLIDE_BKGD, DEF_SLIDE_MARGIN_IN, DEF_TEXT_GLOW, DEF_TEXT_SHADOW, type DataOrPathProps, type DataOrPathRequiredProps, EMU, EMU_PER_INCH, EMU_PER_POINT, type GradientFillProps, type GradientStopProps, type HAlign, type HexColor, type HyperlinkProps, type IChartAreaProps, type IChartMulti, type IChartOpts, type IChartOptsLib, type IChartPropsAxisCat, type IChartPropsAxisSer, type IChartPropsAxisVal, type IChartPropsBase, type IChartPropsChartBar, type IChartPropsChartDoughnut, type IChartPropsChartLine, type IChartPropsChartPie, type IChartPropsChartRadar, type IChartPropsDataLabel, type IChartPropsDataTable, type IChartPropsFillLine, type IChartPropsLegend, type IChartPropsTitle, IMG_BROKEN, IMG_PLAYBTN, type IOptsChartData, type IPresentationProps, type ISlideObject, type ISlideRel, type ISlideRelChart, type ISlideRelMedia, type ImageProps, JSZIP_OUTPUT_TYPE, LAYOUT_IDX_SERIES_BASE, LETTERS, LINEH_MODIFIER, type LinearGradientFillProps, MASTER_OBJECTS, type Margin, type MediaProps, type MediaType, ONEPT, type ObjectNameProps, type ObjectOptions, type OptsChartData, type OptsChartGridLine, OutputType, PIECHART_COLORS, PLACEHOLDER_TYPE, PLACEHOLDER_TYPES, POINTS_PER_INCH, type PlaceholderProps, type PositionProps, PptxGenJS, PptxGenJS as Presentation, PptxGenJS as default, type PresLayout, type PresSlide, type PresSlide as Slide, type PresSlideInternal, type PresentationProps, REGEX_HEX_COLOR, SCHEME_COLORS, SCHEME_COLOR_NAMES, SHAPE_NAME, SHAPE_TYPE, SLDNUMFLDID, SLIDE_OBJECT_TYPES, STANDARD_LAYOUTS, SchemeColor, type SectionInternalProps, type SectionProps, type ShadowProps, type ShapeFillProps, type ShapeLineProps, type ShapeProps, ShapeType, type SlideBaseProps, type SlideLayout, type SlideLayoutInternal, type SlideMasterChartProps, type SlideMasterObject, type SlideMasterProps, type SlideNumberProps, StandardLayout, StandardLayoutName, TEXT_HALIGN, TEXT_VALIGN, type TableCell, type TableCellProps, type TableProps, type TableRow, type TableRowSlide, type TableToSlidesProps, type TextBaseProps, type TextGlowProps, type TextProps, type TextPropsOptions, type ThemeColor, type ThemeProps, type VAlign, WRITE_OUTPUT_TYPE, type WriteBaseProps, type WriteFileProps, type WriteProps, emuToInches, emuToPixels, emuToPoints, inchesToEmu, pixelsToEmu, pointsToEmu };
10
10
  //# sourceMappingURL=node.d.ts.map
package/dist/node.js CHANGED
@@ -1,5 +1,6 @@
1
- import { A as EMU, B as PLACEHOLDER_TYPES, C as DEF_PRES_LAYOUT_NAME, D as DEF_SLIDE_MARGIN_IN, E as DEF_SLIDE_BKGD, F as LINEH_MODIFIER, G as SLIDE_OBJECT_TYPES, H as SCHEME_COLOR_NAMES, I as MASTER_OBJECTS, J as TEXT_HALIGN, K as SchemeColor, L as ONEPT, M as IMG_PLAYBTN, N as LAYOUT_IDX_SERIES_BASE, O as DEF_TEXT_GLOW, P as LETTERS, R as OutputType, S as DEF_PRES_LAYOUT, T as DEF_SHAPE_SHADOW, U as SHAPE_TYPE, V as REGEX_HEX_COLOR, W as SLDNUMFLDID, Y as TEXT_VALIGN, _ as DEF_CHART_BORDER, a as AXIS_ID_VALUE_SECONDARY, b as DEF_FONT_SIZE, c as BARCHART_COLORS, d as CRLF, f as ChartType, g as DEF_CELL_MARGIN_PT, h as DEF_CELL_MARGIN_IN, i as AXIS_ID_VALUE_PRIMARY, j as IMG_BROKEN, k as DEF_TEXT_SHADOW, l as BULLET_TYPES, m as DEF_CELL_BORDER, n as AXIS_ID_CATEGORY_SECONDARY, o as AlignH, p as DEF_BULLET_MARGIN, q as ShapeType, r as AXIS_ID_SERIES_PRIMARY, s as AlignV, t as AXIS_ID_CATEGORY_PRIMARY, u as CHART_TYPE, v as DEF_CHART_GRIDLINE, w as DEF_SHAPE_LINE_COLOR, x as DEF_FONT_TITLE_SIZE, y as DEF_FONT_COLOR, z as PIECHART_COLORS } from "./core-enums-BkfumA6H.js";
2
- import { t as PptxGenJS$1 } from "./pptxgen-DwD2UwDn.js";
1
+ import { a as emuToInches, c as inchesToEmu, i as STANDARD_LAYOUTS, l as pixelsToEmu, n as EMU_PER_POINT, o as emuToPixels, r as POINTS_PER_INCH, s as emuToPoints, t as EMU_PER_INCH, u as pointsToEmu } from "./units-Bmst2HBb.js";
2
+ import { A as EMU, B as PLACEHOLDER_TYPES, C as DEF_PRES_LAYOUT_NAME, D as DEF_SLIDE_MARGIN_IN, E as DEF_SLIDE_BKGD, F as LINEH_MODIFIER, G as SLIDE_OBJECT_TYPES, H as SCHEME_COLOR_NAMES, I as MASTER_OBJECTS, J as TEXT_HALIGN, K as SchemeColor, L as ONEPT, M as IMG_PLAYBTN, N as LAYOUT_IDX_SERIES_BASE, O as DEF_TEXT_GLOW, P as LETTERS, R as OutputType, S as DEF_PRES_LAYOUT, T as DEF_SHAPE_SHADOW, U as SHAPE_TYPE, V as REGEX_HEX_COLOR, W as SLDNUMFLDID, Y as TEXT_VALIGN, _ as DEF_CHART_BORDER, a as AXIS_ID_VALUE_SECONDARY, b as DEF_FONT_SIZE, c as BARCHART_COLORS, d as CRLF, f as ChartType, g as DEF_CELL_MARGIN_PT, h as DEF_CELL_MARGIN_IN, i as AXIS_ID_VALUE_PRIMARY, j as IMG_BROKEN, k as DEF_TEXT_SHADOW, l as BULLET_TYPES, m as DEF_CELL_BORDER, n as AXIS_ID_CATEGORY_SECONDARY, o as AlignH, p as DEF_BULLET_MARGIN, q as ShapeType, r as AXIS_ID_SERIES_PRIMARY, s as AlignV, t as AXIS_ID_CATEGORY_PRIMARY, u as CHART_TYPE, v as DEF_CHART_GRIDLINE, w as DEF_SHAPE_LINE_COLOR, x as DEF_FONT_TITLE_SIZE, y as DEF_FONT_COLOR, z as PIECHART_COLORS } from "./core-enums-CZn5br4v.js";
3
+ import { t as PptxGenJS$1 } from "./pptxgen-1VITjpGE.js";
3
4
  import { Buffer } from "node:buffer";
4
5
  import fs from "node:fs/promises";
5
6
  //#region src/runtime/node.ts
@@ -39,6 +40,6 @@ var PptxGenJS = class extends PptxGenJS$1 {
39
40
  }
40
41
  };
41
42
  //#endregion
42
- export { AXIS_ID_CATEGORY_PRIMARY, AXIS_ID_CATEGORY_SECONDARY, AXIS_ID_SERIES_PRIMARY, AXIS_ID_VALUE_PRIMARY, AXIS_ID_VALUE_SECONDARY, AlignH, AlignV, BARCHART_COLORS, BULLET_TYPES, CHART_TYPE, CRLF, ChartType, DEF_BULLET_MARGIN, DEF_CELL_BORDER, DEF_CELL_MARGIN_IN, DEF_CELL_MARGIN_PT, DEF_CHART_BORDER, DEF_CHART_GRIDLINE, DEF_FONT_COLOR, DEF_FONT_SIZE, DEF_FONT_TITLE_SIZE, DEF_PRES_LAYOUT, DEF_PRES_LAYOUT_NAME, DEF_SHAPE_LINE_COLOR, DEF_SHAPE_SHADOW, DEF_SLIDE_BKGD, DEF_SLIDE_MARGIN_IN, DEF_TEXT_GLOW, DEF_TEXT_SHADOW, EMU, IMG_BROKEN, IMG_PLAYBTN, LAYOUT_IDX_SERIES_BASE, LETTERS, LINEH_MODIFIER, MASTER_OBJECTS, ONEPT, OutputType, PIECHART_COLORS, PLACEHOLDER_TYPES, PptxGenJS, PptxGenJS as Presentation, PptxGenJS as default, REGEX_HEX_COLOR, SCHEME_COLOR_NAMES, SHAPE_TYPE, SLDNUMFLDID, SLIDE_OBJECT_TYPES, SchemeColor, ShapeType, TEXT_HALIGN, TEXT_VALIGN };
43
+ export { AXIS_ID_CATEGORY_PRIMARY, AXIS_ID_CATEGORY_SECONDARY, AXIS_ID_SERIES_PRIMARY, AXIS_ID_VALUE_PRIMARY, AXIS_ID_VALUE_SECONDARY, AlignH, AlignV, BARCHART_COLORS, BULLET_TYPES, CHART_TYPE, CRLF, ChartType, DEF_BULLET_MARGIN, DEF_CELL_BORDER, DEF_CELL_MARGIN_IN, DEF_CELL_MARGIN_PT, DEF_CHART_BORDER, DEF_CHART_GRIDLINE, DEF_FONT_COLOR, DEF_FONT_SIZE, DEF_FONT_TITLE_SIZE, DEF_PRES_LAYOUT, DEF_PRES_LAYOUT_NAME, DEF_SHAPE_LINE_COLOR, DEF_SHAPE_SHADOW, DEF_SLIDE_BKGD, DEF_SLIDE_MARGIN_IN, DEF_TEXT_GLOW, DEF_TEXT_SHADOW, EMU, EMU_PER_INCH, EMU_PER_POINT, IMG_BROKEN, IMG_PLAYBTN, LAYOUT_IDX_SERIES_BASE, LETTERS, LINEH_MODIFIER, MASTER_OBJECTS, ONEPT, OutputType, PIECHART_COLORS, PLACEHOLDER_TYPES, POINTS_PER_INCH, PptxGenJS, PptxGenJS as Presentation, PptxGenJS as default, REGEX_HEX_COLOR, SCHEME_COLOR_NAMES, SHAPE_TYPE, SLDNUMFLDID, SLIDE_OBJECT_TYPES, STANDARD_LAYOUTS, SchemeColor, ShapeType, TEXT_HALIGN, TEXT_VALIGN, emuToInches, emuToPixels, emuToPoints, inchesToEmu, pixelsToEmu, pointsToEmu };
43
44
 
44
45
  //# sourceMappingURL=node.js.map
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","names":["PresentationCore"],"sources":["../src/runtime/node.ts","../src/node.ts"],"sourcesContent":["import { Buffer } from 'node:buffer'\nimport fs from 'node:fs/promises'\nimport { IMG_BROKEN } from '../core-enums.js'\nimport type { ISlideRelMedia } from '../core-interfaces.js'\nimport type { RuntimeAdapter } from './types.js'\n\nexport function createNodeRuntime(): RuntimeAdapter {\n\treturn {\n\t\twriteFileOutputType: 'nodebuffer',\n\t\tloadMedia,\n\t\tcreateSvgPngPreview,\n\t\twriteFile,\n\t}\n}\n\nasync function loadMedia(rel: ISlideRelMedia & { path: string }): Promise<string> {\n\tif (rel.path.startsWith('http')) {\n\t\tconst response = await fetch(rel.path)\n\t\tif (!response.ok) throw new Error(`ERROR! Unable to load image (fetch): ${rel.path}`)\n\t\treturn Buffer.from(await response.arrayBuffer()).toString('base64')\n\t}\n\n\ttry {\n\t\treturn Buffer.from(await fs.readFile(rel.path)).toString('base64')\n\t} catch (ex) {\n\t\tthrow new Error(`ERROR: Unable to read media: \"${rel.path}\"\\n${String(ex)}`, { cause: ex })\n\t}\n}\n\nasync function createSvgPngPreview(rel: ISlideRelMedia): Promise<string> {\n\trel.data = IMG_BROKEN\n\treturn 'done'\n}\n\nasync function writeFile(fileName: string, data: string | ArrayBuffer | Blob | Uint8Array): Promise<string> {\n\tawait fs.writeFile(fileName, data as string | Uint8Array)\n\treturn fileName\n}\n","import PresentationCore from './pptxgen.js'\nimport { createNodeRuntime } from './runtime/node.js'\n\nexport class PptxGenJS extends PresentationCore {\n\tconstructor() {\n\t\tsuper(createNodeRuntime())\n\t}\n}\n\nexport { PptxGenJS as Presentation, PptxGenJS as default }\nexport * from './core-enums.js'\nexport type * from './core-interfaces.js'\nexport type { PresSlide as Slide } from './core-interfaces.js'\n"],"mappings":";;;;;AAMA,SAAgB,oBAAoC;CACnD,OAAO;EACN,qBAAqB;EACrB;EACA;EACA;CACD;AACD;AAEA,eAAe,UAAU,KAAyD;CACjF,IAAI,IAAI,KAAK,WAAW,MAAM,GAAG;EAChC,MAAM,WAAW,MAAM,MAAM,IAAI,IAAI;EACrC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,wCAAwC,IAAI,MAAM;EACpF,OAAO,OAAO,KAAK,MAAM,SAAS,YAAY,CAAC,CAAC,CAAC,SAAS,QAAQ;CACnE;CAEA,IAAI;EACH,OAAO,OAAO,KAAK,MAAM,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,QAAQ;CAClE,SAAS,IAAI;EACZ,MAAM,IAAI,MAAM,iCAAiC,IAAI,KAAK,KAAK,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC;CAC3F;AACD;AAEA,eAAe,oBAAoB,KAAsC;CACxE,IAAI,OAAO;CACX,OAAO;AACR;AAEA,eAAe,UAAU,UAAkB,MAAiE;CAC3G,MAAM,GAAG,UAAU,UAAU,IAA2B;CACxD,OAAO;AACR;;;AClCA,IAAa,YAAb,cAA+BA,YAAiB;CAC/C,cAAc;EACb,MAAM,kBAAkB,CAAC;CAC1B;AACD"}
1
+ {"version":3,"file":"node.js","names":["PresentationCore"],"sources":["../src/runtime/node.ts","../src/node.ts"],"sourcesContent":["import { Buffer } from 'node:buffer'\nimport fs from 'node:fs/promises'\nimport { IMG_BROKEN } from '../core-enums.js'\nimport type { ISlideRelMedia } from '../core-interfaces.js'\nimport type { RuntimeAdapter } from './types.js'\n\nexport function createNodeRuntime(): RuntimeAdapter {\n\treturn {\n\t\twriteFileOutputType: 'nodebuffer',\n\t\tloadMedia,\n\t\tcreateSvgPngPreview,\n\t\twriteFile,\n\t}\n}\n\nasync function loadMedia(rel: ISlideRelMedia & { path: string }): Promise<string> {\n\tif (rel.path.startsWith('http')) {\n\t\tconst response = await fetch(rel.path)\n\t\tif (!response.ok) throw new Error(`ERROR! Unable to load image (fetch): ${rel.path}`)\n\t\treturn Buffer.from(await response.arrayBuffer()).toString('base64')\n\t}\n\n\ttry {\n\t\treturn Buffer.from(await fs.readFile(rel.path)).toString('base64')\n\t} catch (ex) {\n\t\tthrow new Error(`ERROR: Unable to read media: \"${rel.path}\"\\n${String(ex)}`, { cause: ex })\n\t}\n}\n\nasync function createSvgPngPreview(rel: ISlideRelMedia): Promise<string> {\n\trel.data = IMG_BROKEN\n\treturn 'done'\n}\n\nasync function writeFile(fileName: string, data: string | ArrayBuffer | Blob | Uint8Array): Promise<string> {\n\tawait fs.writeFile(fileName, data as string | Uint8Array)\n\treturn fileName\n}\n","import PresentationCore from './pptxgen.js'\nimport { createNodeRuntime } from './runtime/node.js'\n\nexport class PptxGenJS extends PresentationCore {\n\tconstructor() {\n\t\tsuper(createNodeRuntime())\n\t}\n}\n\nexport { PptxGenJS as Presentation, PptxGenJS as default }\nexport * from './core-enums.js'\nexport * from './units.js'\nexport type * from './core-interfaces.js'\nexport type { PresSlide as Slide } from './core-interfaces.js'\n"],"mappings":";;;;;;AAMA,SAAgB,oBAAoC;CACnD,OAAO;EACN,qBAAqB;EACrB;EACA;EACA;CACD;AACD;AAEA,eAAe,UAAU,KAAyD;CACjF,IAAI,IAAI,KAAK,WAAW,MAAM,GAAG;EAChC,MAAM,WAAW,MAAM,MAAM,IAAI,IAAI;EACrC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,wCAAwC,IAAI,MAAM;EACpF,OAAO,OAAO,KAAK,MAAM,SAAS,YAAY,CAAC,CAAC,CAAC,SAAS,QAAQ;CACnE;CAEA,IAAI;EACH,OAAO,OAAO,KAAK,MAAM,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,QAAQ;CAClE,SAAS,IAAI;EACZ,MAAM,IAAI,MAAM,iCAAiC,IAAI,KAAK,KAAK,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC;CAC3F;AACD;AAEA,eAAe,oBAAoB,KAAsC;CACxE,IAAI,OAAO;CACX,OAAO;AACR;AAEA,eAAe,UAAU,UAAkB,MAAiE;CAC3G,MAAM,GAAG,UAAU,UAAU,IAA2B;CACxD,OAAO;AACR;;;AClCA,IAAa,YAAb,cAA+BA,YAAiB;CAC/C,cAAc;EACb,MAAM,kBAAkB,CAAC;CAC1B;AACD"}