pptxgenjs-plus 4.1.19 → 4.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pptxgen.bundle.js +16 -14
- package/dist/pptxgen.cjs.js +109 -28
- package/dist/pptxgen.es.js +109 -28
- package/dist/pptxgen.min.js +29 -27
- package/package.json +4 -2
- package/types/index.d.ts +66 -4
package/dist/pptxgen.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* PptxGenJS 4.1.
|
|
1
|
+
/* PptxGenJS 4.1.20 @ 2026-08-21T04:05:04.745Z */
|
|
2
2
|
|
|
3
3
|
"use strict";
|
|
4
4
|
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
@@ -4120,7 +4120,16 @@ function addImageDefinition(target, opt) {
|
|
|
4120
4120
|
* Adds a Summary Zoom object (MS-PPTX §2.11) — anchors to a section by title, carries layout factors.
|
|
4121
4121
|
*/ function addSummaryZoomDefinition(target, opt) {
|
|
4122
4122
|
pushZoomObject(target, 'summary', opt, (obj)=>{
|
|
4123
|
-
|
|
4123
|
+
var _opt_sectionTitles;
|
|
4124
|
+
const titles = [
|
|
4125
|
+
...opt.sectionTitle ? [
|
|
4126
|
+
opt.sectionTitle
|
|
4127
|
+
] : [],
|
|
4128
|
+
...(_opt_sectionTitles = opt.sectionTitles) !== null && _opt_sectionTitles !== void 0 ? _opt_sectionTitles : []
|
|
4129
|
+
].filter((title, idx, all)=>title && all.indexOf(title) === idx);
|
|
4130
|
+
if (titles.length === 0) throw new Error('addSummaryZoom() error: provide `sectionTitle` or `sectionTitles`');
|
|
4131
|
+
obj.zoomSectionTitle = titles[0];
|
|
4132
|
+
obj.zoomSectionTitles = titles.slice(1);
|
|
4124
4133
|
if (obj.options) {
|
|
4125
4134
|
obj.options.zoomTitle = opt.title;
|
|
4126
4135
|
obj.options.zoomDescr = opt.descr;
|
|
@@ -4382,7 +4391,7 @@ function addShapeDefinition(target, shapeName, opts) {
|
|
|
4382
4391
|
target
|
|
4383
4392
|
] // Create array of Slides as more may be added by auto-paging
|
|
4384
4393
|
;
|
|
4385
|
-
const opt = options && typeof options === 'object' ? options : {};
|
|
4394
|
+
const opt = options && typeof options === 'object' ? gen_objects_object_spread({}, options) : {};
|
|
4386
4395
|
opt.objectName = opt.objectName ? encodeXmlEntities(opt.objectName) : `Table ${target._slideObjects.filter((obj)=>obj._type === (/* inlined export .SLIDE_OBJECT_TYPES.table */"table")).length}`;
|
|
4387
4396
|
// STEP 1: REALITY-CHECK
|
|
4388
4397
|
{
|
|
@@ -5411,12 +5420,14 @@ class Slide {
|
|
|
5411
5420
|
<a:defRPr ${sizeAttr} b="${titleBold}" i="${titleItalic}" u="none" strike="noStrike">
|
|
5412
5421
|
<a:solidFill>${createColorElement(opts.color || (/* inlined export .DEF_FONT_COLOR */"000000"))}</a:solidFill>
|
|
5413
5422
|
<a:latin typeface="${encodeXmlEntities(opts.fontFace) || 'Arial'}"/>
|
|
5423
|
+
<a:ea typeface="${encodeXmlEntities(opts.fontFace) || 'Arial'}"/>
|
|
5414
5424
|
</a:defRPr>
|
|
5415
5425
|
</a:pPr>
|
|
5416
5426
|
<a:r>
|
|
5417
5427
|
<a:rPr ${sizeAttr} b="${titleBold}" i="${titleItalic}" u="none" strike="noStrike">
|
|
5418
5428
|
<a:solidFill>${createColorElement(opts.color || (/* inlined export .DEF_FONT_COLOR */"000000"))}</a:solidFill>
|
|
5419
5429
|
<a:latin typeface="${encodeXmlEntities(opts.fontFace) || 'Arial'}"/>
|
|
5430
|
+
<a:ea typeface="${encodeXmlEntities(opts.fontFace) || 'Arial'}"/>
|
|
5420
5431
|
</a:rPr>
|
|
5421
5432
|
<a:t>${encodeXmlEntities(opts.title) || ''}</a:t>
|
|
5422
5433
|
</a:r>
|
|
@@ -5705,6 +5716,7 @@ function resolveAreaGrouping(barGrouping) {
|
|
|
5705
5716
|
strXml += ` <a:defRPr sz="${Math.round((opts.catAxisLabelFontSize || (/* inlined export .DEF_FONT_SIZE */12)) * 100)}" b="${opts.catAxisLabelFontBold ? 1 : 0}" i="${opts.catAxisLabelFontItalic ? 1 : 0}" u="none" strike="noStrike">`;
|
|
5706
5717
|
strXml += ' <a:solidFill>' + createColorElement(opts.catAxisLabelColor || (/* inlined export .DEF_FONT_COLOR */"000000")) + '</a:solidFill>';
|
|
5707
5718
|
strXml += ' <a:latin typeface="' + (encodeXmlEntities(opts.catAxisLabelFontFace) || 'Arial') + '"/>';
|
|
5719
|
+
strXml += ' <a:ea typeface="' + (encodeXmlEntities(opts.catAxisLabelFontFace) || 'Arial') + '"/>';
|
|
5708
5720
|
strXml += ' </a:defRPr>';
|
|
5709
5721
|
strXml += ' </a:pPr>';
|
|
5710
5722
|
strXml += ' <a:endParaRPr lang="' + (opts.lang || 'en-US') + '"/>';
|
|
@@ -5809,6 +5821,7 @@ function resolveAreaGrouping(barGrouping) {
|
|
|
5809
5821
|
strXml += ` <a:defRPr sz="${Math.round((opts.valAxisLabelFontSize || (/* inlined export .DEF_FONT_SIZE */12)) * 100)}" b="${opts.valAxisLabelFontBold ? 1 : 0}" i="${opts.valAxisLabelFontItalic ? 1 : 0}" u="none" strike="noStrike">`;
|
|
5810
5822
|
strXml += ' <a:solidFill>' + createColorElement(opts.valAxisLabelColor || (/* inlined export .DEF_FONT_COLOR */"000000")) + '</a:solidFill>';
|
|
5811
5823
|
strXml += ' <a:latin typeface="' + (encodeXmlEntities(opts.valAxisLabelFontFace) || 'Arial') + '"/>';
|
|
5824
|
+
strXml += ' <a:ea typeface="' + (encodeXmlEntities(opts.valAxisLabelFontFace) || 'Arial') + '"/>';
|
|
5812
5825
|
strXml += ' </a:defRPr>';
|
|
5813
5826
|
strXml += ' </a:pPr>';
|
|
5814
5827
|
strXml += ' <a:endParaRPr lang="' + (opts.lang || 'en-US') + '"/>';
|
|
@@ -5880,6 +5893,7 @@ function resolveAreaGrouping(barGrouping) {
|
|
|
5880
5893
|
strXml += ` <a:defRPr sz="${Math.round((opts.serAxisLabelFontSize || (/* inlined export .DEF_FONT_SIZE */12)) * 100)}" b="${opts.serAxisLabelFontBold ? '1' : '0'}" i="${opts.serAxisLabelFontItalic ? '1' : '0'}" u="none" strike="noStrike">`;
|
|
5881
5894
|
strXml += ` <a:solidFill>${createColorElement(opts.serAxisLabelColor || (/* inlined export .DEF_FONT_COLOR */"000000"))}</a:solidFill>`;
|
|
5882
5895
|
strXml += ` <a:latin typeface="${encodeXmlEntities(opts.serAxisLabelFontFace) || 'Arial'}"/>`;
|
|
5896
|
+
strXml += ` <a:ea typeface="${encodeXmlEntities(opts.serAxisLabelFontFace) || 'Arial'}"/>`;
|
|
5883
5897
|
strXml += ' </a:defRPr>';
|
|
5884
5898
|
strXml += ' </a:pPr>';
|
|
5885
5899
|
strXml += ' <a:endParaRPr lang="' + (opts.lang || 'en-US') + '"/>';
|
|
@@ -6145,6 +6159,7 @@ function xml_object_spread_props(target, source) {
|
|
|
6145
6159
|
strXml += rel.opts.legendFontSize ? `<a:defRPr sz="${Math.round(Number(rel.opts.legendFontSize) * 100)}">` : '<a:defRPr>';
|
|
6146
6160
|
if (rel.opts.legendColor) strXml += genXmlColorSelection(rel.opts.legendColor);
|
|
6147
6161
|
if (rel.opts.legendFontFace) strXml += '<a:latin typeface="' + encodeXmlEntities(rel.opts.legendFontFace) + '"/>';
|
|
6162
|
+
if (rel.opts.legendFontFace) strXml += '<a:ea typeface="' + encodeXmlEntities(rel.opts.legendFontFace) + '"/>';
|
|
6148
6163
|
if (rel.opts.legendFontFace) strXml += '<a:cs typeface="' + encodeXmlEntities(rel.opts.legendFontFace) + '"/>';
|
|
6149
6164
|
strXml += ' </a:defRPr>';
|
|
6150
6165
|
strXml += ' </a:pPr>';
|
|
@@ -18792,7 +18807,9 @@ function normalizeDir(value) {
|
|
|
18792
18807
|
'fast'
|
|
18793
18808
|
].includes(t.speed) ? t.speed : undefined;
|
|
18794
18809
|
const dur = typeof t.duration === 'number' && t.duration > 0 ? ` p14:dur="${Math.round(t.duration)}"` : '';
|
|
18795
|
-
|
|
18810
|
+
// Fallback must stay in the ECMA-376 attribute set (`spd`); `p14:dur` is Choice-only.
|
|
18811
|
+
const fallbackAttrs = (speed ? ` spd="${speed}"` : '') + (t.advClick === false ? ' advClick="0"' : '') + (typeof t.advTm === 'number' && t.advTm >= 0 ? ` advTm="${Math.round(t.advTm)}"` : '');
|
|
18812
|
+
const attrs = fallbackAttrs + dur;
|
|
18796
18813
|
const type = t.type;
|
|
18797
18814
|
// Modern transition: wrap in mc:AlternateContent with a base-type Fallback.
|
|
18798
18815
|
if (MODERN[type]) {
|
|
@@ -18823,7 +18840,7 @@ function normalizeDir(value) {
|
|
|
18823
18840
|
const fallback = baseInner(fbName, fbKind, {
|
|
18824
18841
|
type: fallbackType
|
|
18825
18842
|
});
|
|
18826
|
-
return `<mc:AlternateContent xmlns:mc="${gen_transition_MC_NS}" xmlns:${prefix}="${ns}">` + `<mc:Choice Requires="${prefix}">` + `<p:transition${attrs}>${inner}</p:transition>` + '</mc:Choice>' + `<mc:Fallback><p:transition${
|
|
18843
|
+
return `<mc:AlternateContent xmlns:mc="${gen_transition_MC_NS}" xmlns:${prefix}="${ns}">` + `<mc:Choice Requires="${prefix}">` + `<p:transition${attrs}>${inner}</p:transition>` + '</mc:Choice>' + `<mc:Fallback><p:transition${fallbackAttrs}>${fallback}</p:transition></mc:Fallback>` + '</mc:AlternateContent>';
|
|
18827
18844
|
}
|
|
18828
18845
|
// Base ECMA-376 transition.
|
|
18829
18846
|
if (BASE[type]) {
|
|
@@ -19363,6 +19380,8 @@ const CHANGES_INFO_NS = 'http://schemas.microsoft.com/office/powerpoint/2013/mai
|
|
|
19363
19380
|
const gen_revision_P14_NS = 'http://schemas.microsoft.com/office/powerpoint/2010/main';
|
|
19364
19381
|
const CREATION_ID_URI = '{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}';
|
|
19365
19382
|
const MOD_ID_URI = '{D42A27DB-BD31-4B8C-83A1-F6EECF244321}';
|
|
19383
|
+
/** Deterministic, unique-per-object `p14:modId` base (MS-PPTX §2.3.1.19). */ const TABLE_MOD_ID_BASE = 1579011935;
|
|
19384
|
+
/** Deterministic `p14:creationId` base when `slide.creationId === true` (MS-PPTX §2.3.1.4). */ const CREATION_ID_BASE = 2147483648;
|
|
19366
19385
|
/** True when the caller opted into the Revision Information part. */ function wantsRevisionInfo(value) {
|
|
19367
19386
|
return value === true || typeof value === 'object' && value !== null;
|
|
19368
19387
|
}
|
|
@@ -19375,9 +19394,25 @@ function unsignedInt(value) {
|
|
|
19375
19394
|
/** `p14:creationId` / `p14:modId` `val` — xsd:unsignedInt. */ function randomIdVal(value) {
|
|
19376
19395
|
return String(unsignedInt(value));
|
|
19377
19396
|
}
|
|
19378
|
-
/**
|
|
19379
|
-
|
|
19380
|
-
|
|
19397
|
+
/**
|
|
19398
|
+
* Resolve `slide.creationId` to an unsigned 32-bit integer, or `undefined` when unset/invalid.
|
|
19399
|
+
* `true` assigns a reproducible id from the slide number so callers can opt in without picking one.
|
|
19400
|
+
*/ function resolveCreationId(creationId, slideNum) {
|
|
19401
|
+
if (creationId === true) return CREATION_ID_BASE + (slideNum !== null && slideNum !== void 0 ? slideNum : 0);
|
|
19402
|
+
if (typeof creationId !== 'number' || !Number.isFinite(creationId)) {
|
|
19403
|
+
if (creationId !== undefined) console.warn(`[pptxgenjs] creationId must be \`true\` or an unsigned 32-bit integer - "${String(creationId)}" ignored`);
|
|
19404
|
+
return undefined;
|
|
19405
|
+
}
|
|
19406
|
+
if (creationId < 0 || creationId > 0xffffffff || Math.floor(creationId) !== creationId) {
|
|
19407
|
+
console.warn(`[pptxgenjs] creationId must be an integer between 0 and 4294967295 - "${String(creationId)}" ignored`);
|
|
19408
|
+
return undefined;
|
|
19409
|
+
}
|
|
19410
|
+
return creationId;
|
|
19411
|
+
}
|
|
19412
|
+
/** `p:ext` wrapper for `p14:creationId` on `cSld` (MS-PPTX §2.2.9 / §2.3.1.4). */ function genXmlCreationIdExt(creationId, slideNum) {
|
|
19413
|
+
const resolved = resolveCreationId(creationId, slideNum);
|
|
19414
|
+
if (resolved === undefined) return '';
|
|
19415
|
+
return `<p:extLst><p:ext uri="${CREATION_ID_URI}"><p14:creationId xmlns:p14="${gen_revision_P14_NS}" val="${randomIdVal(resolved)}"/></p:ext></p:extLst>`;
|
|
19381
19416
|
}
|
|
19382
19417
|
/** `p:ext` wrapper for `p14:modId` on `nvPr` (MS-PPTX §2.2.9 / §2.3.1.19). */ function genXmlModIdExt(modId) {
|
|
19383
19418
|
if (typeof modId !== 'number' || !Number.isFinite(modId)) return '';
|
|
@@ -19819,17 +19854,22 @@ function resolveShapeId(options, idx, usedIds) {
|
|
|
19819
19854
|
* Throws if the named section doesn't exist, since a dangling anchor produces a repair prompt.
|
|
19820
19855
|
*/ function resolveZoomSections(slide, sections) {
|
|
19821
19856
|
var _slide__slideObjects;
|
|
19822
|
-
|
|
19823
|
-
|
|
19824
|
-
if (
|
|
19825
|
-
const sect = (sections !== null && sections !== void 0 ? sections : []).find((s)=>s.title === obj.zoomSectionTitle);
|
|
19826
|
-
if (!sect) throw new Error(`addZoom() error: no section named "${obj.zoomSectionTitle}" — call addSection({ title }) first`);
|
|
19857
|
+
const resolveTitle = (title)=>{
|
|
19858
|
+
const sect = (sections !== null && sections !== void 0 ? sections : []).find((s)=>s.title === title);
|
|
19859
|
+
if (!sect) throw new Error(`addZoom() error: no section named "${title}" — call addSection({ title }) first`);
|
|
19827
19860
|
if (!sect._id) sect._id = getUuid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
19828
|
-
|
|
19861
|
+
return `{${sect._id}}`;
|
|
19862
|
+
};
|
|
19863
|
+
((_slide__slideObjects = slide._slideObjects) !== null && _slide__slideObjects !== void 0 ? _slide__slideObjects : []).forEach((obj)=>{
|
|
19864
|
+
if (obj._type !== (/* inlined export .SLIDE_OBJECT_TYPES.zoom */"zoom") || obj.zoomKind === 'slide') return;
|
|
19865
|
+
if (obj.zoomSectionTitle) obj.zoomSectionId = resolveTitle(obj.zoomSectionTitle);
|
|
19866
|
+
if (obj.zoomSectionTitles && obj.zoomSectionTitles.length > 0) {
|
|
19867
|
+
obj.zoomSectionIds = obj.zoomSectionTitles.map(resolveTitle);
|
|
19868
|
+
}
|
|
19829
19869
|
});
|
|
19830
19870
|
}
|
|
19831
19871
|
function slideObjectToXml(slide) {
|
|
19832
|
-
var _ref;
|
|
19872
|
+
var _ref, _slide__slideNum;
|
|
19833
19873
|
var _slide_background, _slide_background1, _slide_background2, _slide_background_stops;
|
|
19834
19874
|
let strSlideXml = slide._name ? `<p:cSld name="${encodeXmlEntities(slide._name)}">` : '<p:cSld>';
|
|
19835
19875
|
let intTableNum = 1;
|
|
@@ -19963,9 +20003,10 @@ function slideObjectToXml(slide) {
|
|
|
19963
20003
|
strXml = `<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id="${intTableNum * ((_slide__slideNum = slide._slideNum) !== null && _slide__slideNum !== void 0 ? _slide__slideNum : 0) + 1}" name="${slideItemObj.options.objectName}"/>`;
|
|
19964
20004
|
// When the table binds to a master/layout placeholder, emit `<p:ph type="tbl"/>` (ECMA-376 §4.4.1.33, issue #856)
|
|
19965
20005
|
const tblPh = placeholderObj ? genXmlPlaceholder(placeholderObj, slideItemObj.options) : '';
|
|
19966
|
-
|
|
20006
|
+
// MS-PPTX §2.3.1.19: each p14:modId must be unique on the slide (not a constant).
|
|
20007
|
+
const tableModId = typeof slideItemObj.options.modId === 'number' ? slideItemObj.options.modId : TABLE_MOD_ID_BASE + idx;
|
|
19967
20008
|
strXml += '<p:cNvGraphicFramePr><a:graphicFrameLocks noGrp="1"/></p:cNvGraphicFramePr>' + ` ${genXmlNvPr(slideItemObj.options, tblPh, [
|
|
19968
|
-
|
|
20009
|
+
nvPrModIdExt(tableModId)
|
|
19969
20010
|
])}` + '</p:nvGraphicFramePr>';
|
|
19970
20011
|
strXml += `<p:xfrm><a:off x="${x || (x === 0 ? 0 : (/* inlined export .EMU */914400))}" y="${y || (y === 0 ? 0 : (/* inlined export .EMU */914400))}"/><a:ext cx="${cx || (cx === 0 ? 0 : (/* inlined export .EMU */914400))}" cy="${cy || (/* inlined export .EMU */914400)}"/></p:xfrm>`;
|
|
19971
20012
|
strXml += '<a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/table">';
|
|
@@ -20466,12 +20507,14 @@ function slideObjectToXml(slide) {
|
|
|
20466
20507
|
} else if (zKind === 'section') {
|
|
20467
20508
|
strSlideXml += `<p16:sectionZm><p16:sectionZmObj sectionId="${slideItemObj.zoomSectionId}">${zmPr}</p16:sectionZmObj></p16:sectionZm>`;
|
|
20468
20509
|
} else {
|
|
20510
|
+
var _slideItemObj_zoomSectionIds;
|
|
20469
20511
|
// §2.11 CT_SummaryZoom: summaryZmObj(s) + required layout choice (gridLayout/fixedLayout).
|
|
20470
20512
|
const szTitle = zOpts.zoomTitle ? ` title="${encodeXmlEntities(zOpts.zoomTitle)}"` : '';
|
|
20471
20513
|
const szDescr = zOpts.zoomDescr ? ` descr="${encodeXmlEntities(zOpts.zoomDescr)}"` : '';
|
|
20472
20514
|
const szOff = (typeof zOpts.offsetFactorX === 'number' ? ` offsetFactorX="${Math.round(zOpts.offsetFactorX)}"` : '') + (typeof zOpts.offsetFactorY === 'number' ? ` offsetFactorY="${Math.round(zOpts.offsetFactorY)}"` : '');
|
|
20473
20515
|
const szScale = (typeof zOpts.scaleFactorX === 'number' ? ` scaleFactorX="${Math.round(zOpts.scaleFactorX)}"` : '') + (typeof zOpts.scaleFactorY === 'number' ? ` scaleFactorY="${Math.round(zOpts.scaleFactorY)}"` : '');
|
|
20474
|
-
|
|
20516
|
+
const extraZm = ((_slideItemObj_zoomSectionIds = slideItemObj.zoomSectionIds) !== null && _slideItemObj_zoomSectionIds !== void 0 ? _slideItemObj_zoomSectionIds : []).map((id)=>`<p16:summaryZmObj sectionId="${id}">${zmPr}</p16:summaryZmObj>`).join('');
|
|
20517
|
+
strSlideXml += `<p16:summaryZm><p16:summaryZmObj sectionId="${slideItemObj.zoomSectionId}"${szTitle}${szDescr}${szOff}${szScale}>${zmPr}</p16:summaryZmObj>${extraZm}<p16:gridLayout/></p16:summaryZm>`;
|
|
20475
20518
|
}
|
|
20476
20519
|
strSlideXml += '</mc:Choice>';
|
|
20477
20520
|
// Fallback for older readers: pic for slide/section zoom; grpSp for summary zoom (§2.2.15).
|
|
@@ -20625,7 +20668,7 @@ function slideObjectToXml(slide) {
|
|
|
20625
20668
|
}
|
|
20626
20669
|
// STEP 5: Close spTree and finalize slide XML
|
|
20627
20670
|
strSlideXml += '</p:spTree>';
|
|
20628
|
-
strSlideXml += genXmlCreationIdExt('creationId' in slide ? slide.creationId : undefined);
|
|
20671
|
+
strSlideXml += genXmlCreationIdExt('creationId' in slide ? slide.creationId : undefined, (_slide__slideNum = slide._slideNum) !== null && _slide__slideNum !== void 0 ? _slide__slideNum : undefined);
|
|
20629
20672
|
strSlideXml += '</p:cSld>';
|
|
20630
20673
|
// LAST: Return
|
|
20631
20674
|
return strSlideXml;
|
|
@@ -21200,19 +21243,53 @@ const NOTES_GUIDE_URI = '{2D200454-40CA-4A62-9FC3-DE9A4176ACB9}';
|
|
|
21200
21243
|
* Create `ppt/presProps.xml`
|
|
21201
21244
|
* @return {string} XML
|
|
21202
21245
|
*/ function makeXmlPresProps(pres) {
|
|
21203
|
-
//
|
|
21204
|
-
|
|
21246
|
+
// CT_PresentationProperties sequence: showPr then extLst. Opt-in: emit nothing extra unless set.
|
|
21247
|
+
const showPr = makeXmlShowPr(pres);
|
|
21248
|
+
const extLst = makeXmlPresPropsExtLst(pres);
|
|
21249
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>${(/* inlined export .CRLF */"\r\n")}` + '<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">' + `${showPr}${extLst}</p:presentationPr>`;
|
|
21250
|
+
}
|
|
21251
|
+
/**
|
|
21252
|
+
* `p:showPr` for slide-show options, or '' when none are set.
|
|
21253
|
+
* ECMA-376 §19.2.1.30 requires a present/browse/kiosk choice whenever `showPr` is written.
|
|
21254
|
+
*/ function makeXmlShowPr(pres) {
|
|
21255
|
+
var _ref, _show_browseMode, _show_laserColor, _show_mode;
|
|
21256
|
+
const show = (_ref = pres === null || pres === void 0 ? void 0 : pres.slideShow) !== null && _ref !== void 0 ? _ref : {};
|
|
21257
|
+
const browseMode = (_show_browseMode = show.browseMode) !== null && _show_browseMode !== void 0 ? _show_browseMode : pres === null || pres === void 0 ? void 0 : pres.browseMode;
|
|
21258
|
+
const laserColor = (_show_laserColor = show.laserColor) !== null && _show_laserColor !== void 0 ? _show_laserColor : pres === null || pres === void 0 ? void 0 : pres.laserColor;
|
|
21259
|
+
const hasShow = !!(pres === null || pres === void 0 ? void 0 : pres.slideShow) && Object.keys(show).length > 0;
|
|
21260
|
+
const hasExt = typeof browseMode === 'boolean' || !!laserColor;
|
|
21261
|
+
if (!hasShow && !hasExt) return '';
|
|
21262
|
+
const mode = (_show_mode = show.mode) !== null && _show_mode !== void 0 ? _show_mode : 'present';
|
|
21263
|
+
if (show.mode && ![
|
|
21264
|
+
'present',
|
|
21265
|
+
'browse',
|
|
21266
|
+
'kiosk'
|
|
21267
|
+
].includes(show.mode)) {
|
|
21268
|
+
console.warn(`[pptxgenjs] slideShow.mode must be 'present' | 'browse' | 'kiosk' - "${String(show.mode)}" ignored, 'present' used`);
|
|
21269
|
+
}
|
|
21270
|
+
let attrs = '';
|
|
21271
|
+
if (show.loop === true) attrs += ' loop="1"';
|
|
21272
|
+
if (show.showNarration === false) attrs += ' showNarration="0"';
|
|
21273
|
+
if (show.showAnimation === false) attrs += ' showAnimation="0"';
|
|
21274
|
+
if (show.useTimings === false) attrs += ' useTimings="0"';
|
|
21275
|
+
const resolvedMode = [
|
|
21276
|
+
'present',
|
|
21277
|
+
'browse',
|
|
21278
|
+
'kiosk'
|
|
21279
|
+
].includes(mode) ? mode : 'present';
|
|
21280
|
+
const choice = resolvedMode === 'browse' ? `<p:browse${show.showScrollbar === true ? ' showScrollbar="1"' : ''}/>` : resolvedMode === 'kiosk' ? '<p:kiosk/>' : '<p:present/>';
|
|
21205
21281
|
const showExts = [];
|
|
21206
|
-
if (typeof
|
|
21207
|
-
if (
|
|
21208
|
-
|
|
21282
|
+
if (typeof browseMode === 'boolean') showExts.push(`<p:ext uri="${URI_BROWSE_MODE}"><p14:browseMode xmlns:p14="${P14_NS}" showStatus="${browseMode ? '1' : '0'}"/></p:ext>`);
|
|
21283
|
+
if (laserColor) showExts.push(`<p:ext uri="${URI_LASER_CLR}"><p14:laserClr xmlns:p14="${P14_NS}">${createColorElement(laserColor)}</p14:laserClr></p:ext>`);
|
|
21284
|
+
return `<p:showPr${attrs}>${choice}${showExts.length > 0 ? `<p:extLst>${showExts.join('')}</p:extLst>` : ''}</p:showPr>`;
|
|
21285
|
+
}
|
|
21286
|
+
function makeXmlPresPropsExtLst(pres) {
|
|
21209
21287
|
const exts = [];
|
|
21210
|
-
if ((pres === null || pres === void 0 ? void 0 : pres.defaultImageDpi) && pres.defaultImageDpi
|
|
21288
|
+
if (typeof (pres === null || pres === void 0 ? void 0 : pres.defaultImageDpi) === 'number' && Number.isFinite(pres.defaultImageDpi) && pres.defaultImageDpi >= 0) exts.push(`<p:ext uri="${URI_DEFAULT_IMAGE_DPI}"><p14:defaultImageDpi xmlns:p14="${P14_NS}" val="${Math.round(pres.defaultImageDpi)}"/></p:ext>`);
|
|
21211
21289
|
if (pres === null || pres === void 0 ? void 0 : pres.discardImageEditData) exts.push(`<p:ext uri="${URI_DISCARD_IMAGE_EDIT_DATA}"><p14:discardImageEditData xmlns:p14="${P14_NS}" val="1"/></p:ext>`);
|
|
21212
21290
|
if (pres === null || pres === void 0 ? void 0 : pres.readonlyRecommended) exts.push(`<p:ext uri="${URI_READONLY_RECOMMENDED}"><p1710:readonlyRecommended xmlns:p1710="${P1710_NS}" val="1"/></p:ext>`);
|
|
21213
21291
|
if (pres === null || pres === void 0 ? void 0 : pres.chartTrackingRefBased) exts.push('<p:ext uri="{FD5EFAAD-0ECE-453E-9831-46B23BE46B34}"><p15:chartTrackingRefBased xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main" val="1"/></p:ext>');
|
|
21214
|
-
|
|
21215
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>${(/* inlined export .CRLF */"\r\n")}` + '<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">' + `${showPr}${extLst}</p:presentationPr>`;
|
|
21292
|
+
return exts.length > 0 ? `<p:extLst>${exts.join('')}</p:extLst>` : '';
|
|
21216
21293
|
}
|
|
21217
21294
|
/**
|
|
21218
21295
|
* Create `ppt/tableStyles.xml`
|
|
@@ -21749,7 +21826,7 @@ class PptxGenJS {
|
|
|
21749
21826
|
*/ pptxgen_define_property(this, "_layout", void 0);
|
|
21750
21827
|
/**
|
|
21751
21828
|
* PptxGenJS Library Version
|
|
21752
|
-
*/ pptxgen_define_property(this, "_version", (/* inlined export .VERSION */"4.1.
|
|
21829
|
+
*/ pptxgen_define_property(this, "_version", (/* inlined export .VERSION */"4.1.20"));
|
|
21753
21830
|
/**
|
|
21754
21831
|
* @type {string}
|
|
21755
21832
|
*/ pptxgen_define_property(this, "_author", void 0);
|
|
@@ -21804,6 +21881,10 @@ class PptxGenJS {
|
|
|
21804
21881
|
/** Recommend opening read-only. MS-PPTX §2.14.1.1 `p1710:readonlyRecommended`. */ pptxgen_define_property(this, "readonlyRecommended", void 0);
|
|
21805
21882
|
/** Browse-mode status bar. MS-PPTX §2.3.1.2 `p14:browseMode` on `showPr`. */ pptxgen_define_property(this, "browseMode", void 0);
|
|
21806
21883
|
/** Laser-pointer color. MS-PPTX §2.3.1.16 `p14:laserClr` on `showPr`. */ pptxgen_define_property(this, "laserColor", void 0);
|
|
21884
|
+
/**
|
|
21885
|
+
* Slide-show options (`p:showPr`). Opt-in — omitted unless set.
|
|
21886
|
+
* @example pptx.slideShow = { mode: 'kiosk', loop: true }
|
|
21887
|
+
*/ pptxgen_define_property(this, "slideShow", void 0);
|
|
21807
21888
|
/**
|
|
21808
21889
|
* Chart data-point properties and datalabels follow their cell references.
|
|
21809
21890
|
* MS-PPTX §2.4.1.1 `chartTrackingRefBased` on `presentationPr` extLst.
|
package/dist/pptxgen.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* PptxGenJS 4.1.
|
|
1
|
+
/* PptxGenJS 4.1.20 @ 2026-08-21T04:05:04.745Z */
|
|
2
2
|
|
|
3
3
|
import { JSZip } from "@node-projects/jszip";
|
|
4
4
|
import { parseXml } from "@rgrove/parse-xml";
|
|
@@ -4079,7 +4079,16 @@ function addImageDefinition(target, opt) {
|
|
|
4079
4079
|
* Adds a Summary Zoom object (MS-PPTX §2.11) — anchors to a section by title, carries layout factors.
|
|
4080
4080
|
*/ function addSummaryZoomDefinition(target, opt) {
|
|
4081
4081
|
pushZoomObject(target, 'summary', opt, (obj)=>{
|
|
4082
|
-
|
|
4082
|
+
var _opt_sectionTitles;
|
|
4083
|
+
const titles = [
|
|
4084
|
+
...opt.sectionTitle ? [
|
|
4085
|
+
opt.sectionTitle
|
|
4086
|
+
] : [],
|
|
4087
|
+
...(_opt_sectionTitles = opt.sectionTitles) !== null && _opt_sectionTitles !== void 0 ? _opt_sectionTitles : []
|
|
4088
|
+
].filter((title, idx, all)=>title && all.indexOf(title) === idx);
|
|
4089
|
+
if (titles.length === 0) throw new Error('addSummaryZoom() error: provide `sectionTitle` or `sectionTitles`');
|
|
4090
|
+
obj.zoomSectionTitle = titles[0];
|
|
4091
|
+
obj.zoomSectionTitles = titles.slice(1);
|
|
4083
4092
|
if (obj.options) {
|
|
4084
4093
|
obj.options.zoomTitle = opt.title;
|
|
4085
4094
|
obj.options.zoomDescr = opt.descr;
|
|
@@ -4341,7 +4350,7 @@ function addShapeDefinition(target, shapeName, opts) {
|
|
|
4341
4350
|
target
|
|
4342
4351
|
] // Create array of Slides as more may be added by auto-paging
|
|
4343
4352
|
;
|
|
4344
|
-
const opt = options && typeof options === 'object' ? options : {};
|
|
4353
|
+
const opt = options && typeof options === 'object' ? gen_objects_object_spread({}, options) : {};
|
|
4345
4354
|
opt.objectName = opt.objectName ? encodeXmlEntities(opt.objectName) : `Table ${target._slideObjects.filter((obj)=>obj._type === (/* inlined export .SLIDE_OBJECT_TYPES.table */"table")).length}`;
|
|
4346
4355
|
// STEP 1: REALITY-CHECK
|
|
4347
4356
|
{
|
|
@@ -5369,12 +5378,14 @@ class Slide {
|
|
|
5369
5378
|
<a:defRPr ${sizeAttr} b="${titleBold}" i="${titleItalic}" u="none" strike="noStrike">
|
|
5370
5379
|
<a:solidFill>${createColorElement(opts.color || (/* inlined export .DEF_FONT_COLOR */"000000"))}</a:solidFill>
|
|
5371
5380
|
<a:latin typeface="${encodeXmlEntities(opts.fontFace) || 'Arial'}"/>
|
|
5381
|
+
<a:ea typeface="${encodeXmlEntities(opts.fontFace) || 'Arial'}"/>
|
|
5372
5382
|
</a:defRPr>
|
|
5373
5383
|
</a:pPr>
|
|
5374
5384
|
<a:r>
|
|
5375
5385
|
<a:rPr ${sizeAttr} b="${titleBold}" i="${titleItalic}" u="none" strike="noStrike">
|
|
5376
5386
|
<a:solidFill>${createColorElement(opts.color || (/* inlined export .DEF_FONT_COLOR */"000000"))}</a:solidFill>
|
|
5377
5387
|
<a:latin typeface="${encodeXmlEntities(opts.fontFace) || 'Arial'}"/>
|
|
5388
|
+
<a:ea typeface="${encodeXmlEntities(opts.fontFace) || 'Arial'}"/>
|
|
5378
5389
|
</a:rPr>
|
|
5379
5390
|
<a:t>${encodeXmlEntities(opts.title) || ''}</a:t>
|
|
5380
5391
|
</a:r>
|
|
@@ -5661,6 +5672,7 @@ function resolveAreaGrouping(barGrouping) {
|
|
|
5661
5672
|
strXml += ` <a:defRPr sz="${Math.round((opts.catAxisLabelFontSize || (/* inlined export .DEF_FONT_SIZE */12)) * 100)}" b="${opts.catAxisLabelFontBold ? 1 : 0}" i="${opts.catAxisLabelFontItalic ? 1 : 0}" u="none" strike="noStrike">`;
|
|
5662
5673
|
strXml += ' <a:solidFill>' + createColorElement(opts.catAxisLabelColor || (/* inlined export .DEF_FONT_COLOR */"000000")) + '</a:solidFill>';
|
|
5663
5674
|
strXml += ' <a:latin typeface="' + (encodeXmlEntities(opts.catAxisLabelFontFace) || 'Arial') + '"/>';
|
|
5675
|
+
strXml += ' <a:ea typeface="' + (encodeXmlEntities(opts.catAxisLabelFontFace) || 'Arial') + '"/>';
|
|
5664
5676
|
strXml += ' </a:defRPr>';
|
|
5665
5677
|
strXml += ' </a:pPr>';
|
|
5666
5678
|
strXml += ' <a:endParaRPr lang="' + (opts.lang || 'en-US') + '"/>';
|
|
@@ -5765,6 +5777,7 @@ function resolveAreaGrouping(barGrouping) {
|
|
|
5765
5777
|
strXml += ` <a:defRPr sz="${Math.round((opts.valAxisLabelFontSize || (/* inlined export .DEF_FONT_SIZE */12)) * 100)}" b="${opts.valAxisLabelFontBold ? 1 : 0}" i="${opts.valAxisLabelFontItalic ? 1 : 0}" u="none" strike="noStrike">`;
|
|
5766
5778
|
strXml += ' <a:solidFill>' + createColorElement(opts.valAxisLabelColor || (/* inlined export .DEF_FONT_COLOR */"000000")) + '</a:solidFill>';
|
|
5767
5779
|
strXml += ' <a:latin typeface="' + (encodeXmlEntities(opts.valAxisLabelFontFace) || 'Arial') + '"/>';
|
|
5780
|
+
strXml += ' <a:ea typeface="' + (encodeXmlEntities(opts.valAxisLabelFontFace) || 'Arial') + '"/>';
|
|
5768
5781
|
strXml += ' </a:defRPr>';
|
|
5769
5782
|
strXml += ' </a:pPr>';
|
|
5770
5783
|
strXml += ' <a:endParaRPr lang="' + (opts.lang || 'en-US') + '"/>';
|
|
@@ -5836,6 +5849,7 @@ function resolveAreaGrouping(barGrouping) {
|
|
|
5836
5849
|
strXml += ` <a:defRPr sz="${Math.round((opts.serAxisLabelFontSize || (/* inlined export .DEF_FONT_SIZE */12)) * 100)}" b="${opts.serAxisLabelFontBold ? '1' : '0'}" i="${opts.serAxisLabelFontItalic ? '1' : '0'}" u="none" strike="noStrike">`;
|
|
5837
5850
|
strXml += ` <a:solidFill>${createColorElement(opts.serAxisLabelColor || (/* inlined export .DEF_FONT_COLOR */"000000"))}</a:solidFill>`;
|
|
5838
5851
|
strXml += ` <a:latin typeface="${encodeXmlEntities(opts.serAxisLabelFontFace) || 'Arial'}"/>`;
|
|
5852
|
+
strXml += ` <a:ea typeface="${encodeXmlEntities(opts.serAxisLabelFontFace) || 'Arial'}"/>`;
|
|
5839
5853
|
strXml += ' </a:defRPr>';
|
|
5840
5854
|
strXml += ' </a:pPr>';
|
|
5841
5855
|
strXml += ' <a:endParaRPr lang="' + (opts.lang || 'en-US') + '"/>';
|
|
@@ -6100,6 +6114,7 @@ function xml_object_spread_props(target, source) {
|
|
|
6100
6114
|
strXml += rel.opts.legendFontSize ? `<a:defRPr sz="${Math.round(Number(rel.opts.legendFontSize) * 100)}">` : '<a:defRPr>';
|
|
6101
6115
|
if (rel.opts.legendColor) strXml += genXmlColorSelection(rel.opts.legendColor);
|
|
6102
6116
|
if (rel.opts.legendFontFace) strXml += '<a:latin typeface="' + encodeXmlEntities(rel.opts.legendFontFace) + '"/>';
|
|
6117
|
+
if (rel.opts.legendFontFace) strXml += '<a:ea typeface="' + encodeXmlEntities(rel.opts.legendFontFace) + '"/>';
|
|
6103
6118
|
if (rel.opts.legendFontFace) strXml += '<a:cs typeface="' + encodeXmlEntities(rel.opts.legendFontFace) + '"/>';
|
|
6104
6119
|
strXml += ' </a:defRPr>';
|
|
6105
6120
|
strXml += ' </a:pPr>';
|
|
@@ -18673,7 +18688,9 @@ function normalizeDir(value) {
|
|
|
18673
18688
|
'fast'
|
|
18674
18689
|
].includes(t.speed) ? t.speed : undefined;
|
|
18675
18690
|
const dur = typeof t.duration === 'number' && t.duration > 0 ? ` p14:dur="${Math.round(t.duration)}"` : '';
|
|
18676
|
-
|
|
18691
|
+
// Fallback must stay in the ECMA-376 attribute set (`spd`); `p14:dur` is Choice-only.
|
|
18692
|
+
const fallbackAttrs = (speed ? ` spd="${speed}"` : '') + (t.advClick === false ? ' advClick="0"' : '') + (typeof t.advTm === 'number' && t.advTm >= 0 ? ` advTm="${Math.round(t.advTm)}"` : '');
|
|
18693
|
+
const attrs = fallbackAttrs + dur;
|
|
18677
18694
|
const type = t.type;
|
|
18678
18695
|
// Modern transition: wrap in mc:AlternateContent with a base-type Fallback.
|
|
18679
18696
|
if (MODERN[type]) {
|
|
@@ -18704,7 +18721,7 @@ function normalizeDir(value) {
|
|
|
18704
18721
|
const fallback = baseInner(fbName, fbKind, {
|
|
18705
18722
|
type: fallbackType
|
|
18706
18723
|
});
|
|
18707
|
-
return `<mc:AlternateContent xmlns:mc="${gen_transition_MC_NS}" xmlns:${prefix}="${ns}">` + `<mc:Choice Requires="${prefix}">` + `<p:transition${attrs}>${inner}</p:transition>` + '</mc:Choice>' + `<mc:Fallback><p:transition${
|
|
18724
|
+
return `<mc:AlternateContent xmlns:mc="${gen_transition_MC_NS}" xmlns:${prefix}="${ns}">` + `<mc:Choice Requires="${prefix}">` + `<p:transition${attrs}>${inner}</p:transition>` + '</mc:Choice>' + `<mc:Fallback><p:transition${fallbackAttrs}>${fallback}</p:transition></mc:Fallback>` + '</mc:AlternateContent>';
|
|
18708
18725
|
}
|
|
18709
18726
|
// Base ECMA-376 transition.
|
|
18710
18727
|
if (BASE[type]) {
|
|
@@ -19241,6 +19258,8 @@ const CHANGES_INFO_NS = 'http://schemas.microsoft.com/office/powerpoint/2013/mai
|
|
|
19241
19258
|
const gen_revision_P14_NS = 'http://schemas.microsoft.com/office/powerpoint/2010/main';
|
|
19242
19259
|
const CREATION_ID_URI = '{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}';
|
|
19243
19260
|
const MOD_ID_URI = '{D42A27DB-BD31-4B8C-83A1-F6EECF244321}';
|
|
19261
|
+
/** Deterministic, unique-per-object `p14:modId` base (MS-PPTX §2.3.1.19). */ const TABLE_MOD_ID_BASE = 1579011935;
|
|
19262
|
+
/** Deterministic `p14:creationId` base when `slide.creationId === true` (MS-PPTX §2.3.1.4). */ const CREATION_ID_BASE = 2147483648;
|
|
19244
19263
|
/** True when the caller opted into the Revision Information part. */ function wantsRevisionInfo(value) {
|
|
19245
19264
|
return value === true || typeof value === 'object' && value !== null;
|
|
19246
19265
|
}
|
|
@@ -19253,9 +19272,25 @@ function unsignedInt(value) {
|
|
|
19253
19272
|
/** `p14:creationId` / `p14:modId` `val` — xsd:unsignedInt. */ function randomIdVal(value) {
|
|
19254
19273
|
return String(unsignedInt(value));
|
|
19255
19274
|
}
|
|
19256
|
-
/**
|
|
19257
|
-
|
|
19258
|
-
|
|
19275
|
+
/**
|
|
19276
|
+
* Resolve `slide.creationId` to an unsigned 32-bit integer, or `undefined` when unset/invalid.
|
|
19277
|
+
* `true` assigns a reproducible id from the slide number so callers can opt in without picking one.
|
|
19278
|
+
*/ function resolveCreationId(creationId, slideNum) {
|
|
19279
|
+
if (creationId === true) return CREATION_ID_BASE + (slideNum !== null && slideNum !== void 0 ? slideNum : 0);
|
|
19280
|
+
if (typeof creationId !== 'number' || !Number.isFinite(creationId)) {
|
|
19281
|
+
if (creationId !== undefined) console.warn(`[pptxgenjs] creationId must be \`true\` or an unsigned 32-bit integer - "${String(creationId)}" ignored`);
|
|
19282
|
+
return undefined;
|
|
19283
|
+
}
|
|
19284
|
+
if (creationId < 0 || creationId > 0xffffffff || Math.floor(creationId) !== creationId) {
|
|
19285
|
+
console.warn(`[pptxgenjs] creationId must be an integer between 0 and 4294967295 - "${String(creationId)}" ignored`);
|
|
19286
|
+
return undefined;
|
|
19287
|
+
}
|
|
19288
|
+
return creationId;
|
|
19289
|
+
}
|
|
19290
|
+
/** `p:ext` wrapper for `p14:creationId` on `cSld` (MS-PPTX §2.2.9 / §2.3.1.4). */ function genXmlCreationIdExt(creationId, slideNum) {
|
|
19291
|
+
const resolved = resolveCreationId(creationId, slideNum);
|
|
19292
|
+
if (resolved === undefined) return '';
|
|
19293
|
+
return `<p:extLst><p:ext uri="${CREATION_ID_URI}"><p14:creationId xmlns:p14="${gen_revision_P14_NS}" val="${randomIdVal(resolved)}"/></p:ext></p:extLst>`;
|
|
19259
19294
|
}
|
|
19260
19295
|
/** `p:ext` wrapper for `p14:modId` on `nvPr` (MS-PPTX §2.2.9 / §2.3.1.19). */ function genXmlModIdExt(modId) {
|
|
19261
19296
|
if (typeof modId !== 'number' || !Number.isFinite(modId)) return '';
|
|
@@ -19696,17 +19731,22 @@ function resolveShapeId(options, idx, usedIds) {
|
|
|
19696
19731
|
* Throws if the named section doesn't exist, since a dangling anchor produces a repair prompt.
|
|
19697
19732
|
*/ function resolveZoomSections(slide, sections) {
|
|
19698
19733
|
var _slide__slideObjects;
|
|
19699
|
-
|
|
19700
|
-
|
|
19701
|
-
if (
|
|
19702
|
-
const sect = (sections !== null && sections !== void 0 ? sections : []).find((s)=>s.title === obj.zoomSectionTitle);
|
|
19703
|
-
if (!sect) throw new Error(`addZoom() error: no section named "${obj.zoomSectionTitle}" — call addSection({ title }) first`);
|
|
19734
|
+
const resolveTitle = (title)=>{
|
|
19735
|
+
const sect = (sections !== null && sections !== void 0 ? sections : []).find((s)=>s.title === title);
|
|
19736
|
+
if (!sect) throw new Error(`addZoom() error: no section named "${title}" — call addSection({ title }) first`);
|
|
19704
19737
|
if (!sect._id) sect._id = getUuid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
19705
|
-
|
|
19738
|
+
return `{${sect._id}}`;
|
|
19739
|
+
};
|
|
19740
|
+
((_slide__slideObjects = slide._slideObjects) !== null && _slide__slideObjects !== void 0 ? _slide__slideObjects : []).forEach((obj)=>{
|
|
19741
|
+
if (obj._type !== (/* inlined export .SLIDE_OBJECT_TYPES.zoom */"zoom") || obj.zoomKind === 'slide') return;
|
|
19742
|
+
if (obj.zoomSectionTitle) obj.zoomSectionId = resolveTitle(obj.zoomSectionTitle);
|
|
19743
|
+
if (obj.zoomSectionTitles && obj.zoomSectionTitles.length > 0) {
|
|
19744
|
+
obj.zoomSectionIds = obj.zoomSectionTitles.map(resolveTitle);
|
|
19745
|
+
}
|
|
19706
19746
|
});
|
|
19707
19747
|
}
|
|
19708
19748
|
function slideObjectToXml(slide) {
|
|
19709
|
-
var _ref;
|
|
19749
|
+
var _ref, _slide__slideNum;
|
|
19710
19750
|
var _slide_background, _slide_background1, _slide_background2, _slide_background_stops;
|
|
19711
19751
|
let strSlideXml = slide._name ? `<p:cSld name="${encodeXmlEntities(slide._name)}">` : '<p:cSld>';
|
|
19712
19752
|
let intTableNum = 1;
|
|
@@ -19840,9 +19880,10 @@ function slideObjectToXml(slide) {
|
|
|
19840
19880
|
strXml = `<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id="${intTableNum * ((_slide__slideNum = slide._slideNum) !== null && _slide__slideNum !== void 0 ? _slide__slideNum : 0) + 1}" name="${slideItemObj.options.objectName}"/>`;
|
|
19841
19881
|
// When the table binds to a master/layout placeholder, emit `<p:ph type="tbl"/>` (ECMA-376 §4.4.1.33, issue #856)
|
|
19842
19882
|
const tblPh = placeholderObj ? genXmlPlaceholder(placeholderObj, slideItemObj.options) : '';
|
|
19843
|
-
|
|
19883
|
+
// MS-PPTX §2.3.1.19: each p14:modId must be unique on the slide (not a constant).
|
|
19884
|
+
const tableModId = typeof slideItemObj.options.modId === 'number' ? slideItemObj.options.modId : TABLE_MOD_ID_BASE + idx;
|
|
19844
19885
|
strXml += '<p:cNvGraphicFramePr><a:graphicFrameLocks noGrp="1"/></p:cNvGraphicFramePr>' + ` ${genXmlNvPr(slideItemObj.options, tblPh, [
|
|
19845
|
-
|
|
19886
|
+
nvPrModIdExt(tableModId)
|
|
19846
19887
|
])}` + '</p:nvGraphicFramePr>';
|
|
19847
19888
|
strXml += `<p:xfrm><a:off x="${x || (x === 0 ? 0 : (/* inlined export .EMU */914400))}" y="${y || (y === 0 ? 0 : (/* inlined export .EMU */914400))}"/><a:ext cx="${cx || (cx === 0 ? 0 : (/* inlined export .EMU */914400))}" cy="${cy || (/* inlined export .EMU */914400)}"/></p:xfrm>`;
|
|
19848
19889
|
strXml += '<a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/table">';
|
|
@@ -20343,12 +20384,14 @@ function slideObjectToXml(slide) {
|
|
|
20343
20384
|
} else if (zKind === 'section') {
|
|
20344
20385
|
strSlideXml += `<p16:sectionZm><p16:sectionZmObj sectionId="${slideItemObj.zoomSectionId}">${zmPr}</p16:sectionZmObj></p16:sectionZm>`;
|
|
20345
20386
|
} else {
|
|
20387
|
+
var _slideItemObj_zoomSectionIds;
|
|
20346
20388
|
// §2.11 CT_SummaryZoom: summaryZmObj(s) + required layout choice (gridLayout/fixedLayout).
|
|
20347
20389
|
const szTitle = zOpts.zoomTitle ? ` title="${encodeXmlEntities(zOpts.zoomTitle)}"` : '';
|
|
20348
20390
|
const szDescr = zOpts.zoomDescr ? ` descr="${encodeXmlEntities(zOpts.zoomDescr)}"` : '';
|
|
20349
20391
|
const szOff = (typeof zOpts.offsetFactorX === 'number' ? ` offsetFactorX="${Math.round(zOpts.offsetFactorX)}"` : '') + (typeof zOpts.offsetFactorY === 'number' ? ` offsetFactorY="${Math.round(zOpts.offsetFactorY)}"` : '');
|
|
20350
20392
|
const szScale = (typeof zOpts.scaleFactorX === 'number' ? ` scaleFactorX="${Math.round(zOpts.scaleFactorX)}"` : '') + (typeof zOpts.scaleFactorY === 'number' ? ` scaleFactorY="${Math.round(zOpts.scaleFactorY)}"` : '');
|
|
20351
|
-
|
|
20393
|
+
const extraZm = ((_slideItemObj_zoomSectionIds = slideItemObj.zoomSectionIds) !== null && _slideItemObj_zoomSectionIds !== void 0 ? _slideItemObj_zoomSectionIds : []).map((id)=>`<p16:summaryZmObj sectionId="${id}">${zmPr}</p16:summaryZmObj>`).join('');
|
|
20394
|
+
strSlideXml += `<p16:summaryZm><p16:summaryZmObj sectionId="${slideItemObj.zoomSectionId}"${szTitle}${szDescr}${szOff}${szScale}>${zmPr}</p16:summaryZmObj>${extraZm}<p16:gridLayout/></p16:summaryZm>`;
|
|
20352
20395
|
}
|
|
20353
20396
|
strSlideXml += '</mc:Choice>';
|
|
20354
20397
|
// Fallback for older readers: pic for slide/section zoom; grpSp for summary zoom (§2.2.15).
|
|
@@ -20502,7 +20545,7 @@ function slideObjectToXml(slide) {
|
|
|
20502
20545
|
}
|
|
20503
20546
|
// STEP 5: Close spTree and finalize slide XML
|
|
20504
20547
|
strSlideXml += '</p:spTree>';
|
|
20505
|
-
strSlideXml += genXmlCreationIdExt('creationId' in slide ? slide.creationId : undefined);
|
|
20548
|
+
strSlideXml += genXmlCreationIdExt('creationId' in slide ? slide.creationId : undefined, (_slide__slideNum = slide._slideNum) !== null && _slide__slideNum !== void 0 ? _slide__slideNum : undefined);
|
|
20506
20549
|
strSlideXml += '</p:cSld>';
|
|
20507
20550
|
// LAST: Return
|
|
20508
20551
|
return strSlideXml;
|
|
@@ -21076,19 +21119,53 @@ const NOTES_GUIDE_URI = '{2D200454-40CA-4A62-9FC3-DE9A4176ACB9}';
|
|
|
21076
21119
|
* Create `ppt/presProps.xml`
|
|
21077
21120
|
* @return {string} XML
|
|
21078
21121
|
*/ function makeXmlPresProps(pres) {
|
|
21079
|
-
//
|
|
21080
|
-
|
|
21122
|
+
// CT_PresentationProperties sequence: showPr then extLst. Opt-in: emit nothing extra unless set.
|
|
21123
|
+
const showPr = makeXmlShowPr(pres);
|
|
21124
|
+
const extLst = makeXmlPresPropsExtLst(pres);
|
|
21125
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>${(/* inlined export .CRLF */"\r\n")}` + '<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">' + `${showPr}${extLst}</p:presentationPr>`;
|
|
21126
|
+
}
|
|
21127
|
+
/**
|
|
21128
|
+
* `p:showPr` for slide-show options, or '' when none are set.
|
|
21129
|
+
* ECMA-376 §19.2.1.30 requires a present/browse/kiosk choice whenever `showPr` is written.
|
|
21130
|
+
*/ function makeXmlShowPr(pres) {
|
|
21131
|
+
var _ref, _show_browseMode, _show_laserColor, _show_mode;
|
|
21132
|
+
const show = (_ref = pres === null || pres === void 0 ? void 0 : pres.slideShow) !== null && _ref !== void 0 ? _ref : {};
|
|
21133
|
+
const browseMode = (_show_browseMode = show.browseMode) !== null && _show_browseMode !== void 0 ? _show_browseMode : pres === null || pres === void 0 ? void 0 : pres.browseMode;
|
|
21134
|
+
const laserColor = (_show_laserColor = show.laserColor) !== null && _show_laserColor !== void 0 ? _show_laserColor : pres === null || pres === void 0 ? void 0 : pres.laserColor;
|
|
21135
|
+
const hasShow = !!(pres === null || pres === void 0 ? void 0 : pres.slideShow) && Object.keys(show).length > 0;
|
|
21136
|
+
const hasExt = typeof browseMode === 'boolean' || !!laserColor;
|
|
21137
|
+
if (!hasShow && !hasExt) return '';
|
|
21138
|
+
const mode = (_show_mode = show.mode) !== null && _show_mode !== void 0 ? _show_mode : 'present';
|
|
21139
|
+
if (show.mode && ![
|
|
21140
|
+
'present',
|
|
21141
|
+
'browse',
|
|
21142
|
+
'kiosk'
|
|
21143
|
+
].includes(show.mode)) {
|
|
21144
|
+
console.warn(`[pptxgenjs] slideShow.mode must be 'present' | 'browse' | 'kiosk' - "${String(show.mode)}" ignored, 'present' used`);
|
|
21145
|
+
}
|
|
21146
|
+
let attrs = '';
|
|
21147
|
+
if (show.loop === true) attrs += ' loop="1"';
|
|
21148
|
+
if (show.showNarration === false) attrs += ' showNarration="0"';
|
|
21149
|
+
if (show.showAnimation === false) attrs += ' showAnimation="0"';
|
|
21150
|
+
if (show.useTimings === false) attrs += ' useTimings="0"';
|
|
21151
|
+
const resolvedMode = [
|
|
21152
|
+
'present',
|
|
21153
|
+
'browse',
|
|
21154
|
+
'kiosk'
|
|
21155
|
+
].includes(mode) ? mode : 'present';
|
|
21156
|
+
const choice = resolvedMode === 'browse' ? `<p:browse${show.showScrollbar === true ? ' showScrollbar="1"' : ''}/>` : resolvedMode === 'kiosk' ? '<p:kiosk/>' : '<p:present/>';
|
|
21081
21157
|
const showExts = [];
|
|
21082
|
-
if (typeof
|
|
21083
|
-
if (
|
|
21084
|
-
|
|
21158
|
+
if (typeof browseMode === 'boolean') showExts.push(`<p:ext uri="${URI_BROWSE_MODE}"><p14:browseMode xmlns:p14="${P14_NS}" showStatus="${browseMode ? '1' : '0'}"/></p:ext>`);
|
|
21159
|
+
if (laserColor) showExts.push(`<p:ext uri="${URI_LASER_CLR}"><p14:laserClr xmlns:p14="${P14_NS}">${createColorElement(laserColor)}</p14:laserClr></p:ext>`);
|
|
21160
|
+
return `<p:showPr${attrs}>${choice}${showExts.length > 0 ? `<p:extLst>${showExts.join('')}</p:extLst>` : ''}</p:showPr>`;
|
|
21161
|
+
}
|
|
21162
|
+
function makeXmlPresPropsExtLst(pres) {
|
|
21085
21163
|
const exts = [];
|
|
21086
|
-
if ((pres === null || pres === void 0 ? void 0 : pres.defaultImageDpi) && pres.defaultImageDpi
|
|
21164
|
+
if (typeof (pres === null || pres === void 0 ? void 0 : pres.defaultImageDpi) === 'number' && Number.isFinite(pres.defaultImageDpi) && pres.defaultImageDpi >= 0) exts.push(`<p:ext uri="${URI_DEFAULT_IMAGE_DPI}"><p14:defaultImageDpi xmlns:p14="${P14_NS}" val="${Math.round(pres.defaultImageDpi)}"/></p:ext>`);
|
|
21087
21165
|
if (pres === null || pres === void 0 ? void 0 : pres.discardImageEditData) exts.push(`<p:ext uri="${URI_DISCARD_IMAGE_EDIT_DATA}"><p14:discardImageEditData xmlns:p14="${P14_NS}" val="1"/></p:ext>`);
|
|
21088
21166
|
if (pres === null || pres === void 0 ? void 0 : pres.readonlyRecommended) exts.push(`<p:ext uri="${URI_READONLY_RECOMMENDED}"><p1710:readonlyRecommended xmlns:p1710="${P1710_NS}" val="1"/></p:ext>`);
|
|
21089
21167
|
if (pres === null || pres === void 0 ? void 0 : pres.chartTrackingRefBased) exts.push('<p:ext uri="{FD5EFAAD-0ECE-453E-9831-46B23BE46B34}"><p15:chartTrackingRefBased xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main" val="1"/></p:ext>');
|
|
21090
|
-
|
|
21091
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>${(/* inlined export .CRLF */"\r\n")}` + '<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">' + `${showPr}${extLst}</p:presentationPr>`;
|
|
21168
|
+
return exts.length > 0 ? `<p:extLst>${exts.join('')}</p:extLst>` : '';
|
|
21092
21169
|
}
|
|
21093
21170
|
/**
|
|
21094
21171
|
* Create `ppt/tableStyles.xml`
|
|
@@ -21623,7 +21700,7 @@ class PptxGenJS {
|
|
|
21623
21700
|
*/ pptxgen_define_property(this, "_layout", void 0);
|
|
21624
21701
|
/**
|
|
21625
21702
|
* PptxGenJS Library Version
|
|
21626
|
-
*/ pptxgen_define_property(this, "_version", (/* inlined export .VERSION */"4.1.
|
|
21703
|
+
*/ pptxgen_define_property(this, "_version", (/* inlined export .VERSION */"4.1.20"));
|
|
21627
21704
|
/**
|
|
21628
21705
|
* @type {string}
|
|
21629
21706
|
*/ pptxgen_define_property(this, "_author", void 0);
|
|
@@ -21678,6 +21755,10 @@ class PptxGenJS {
|
|
|
21678
21755
|
/** Recommend opening read-only. MS-PPTX §2.14.1.1 `p1710:readonlyRecommended`. */ pptxgen_define_property(this, "readonlyRecommended", void 0);
|
|
21679
21756
|
/** Browse-mode status bar. MS-PPTX §2.3.1.2 `p14:browseMode` on `showPr`. */ pptxgen_define_property(this, "browseMode", void 0);
|
|
21680
21757
|
/** Laser-pointer color. MS-PPTX §2.3.1.16 `p14:laserClr` on `showPr`. */ pptxgen_define_property(this, "laserColor", void 0);
|
|
21758
|
+
/**
|
|
21759
|
+
* Slide-show options (`p:showPr`). Opt-in — omitted unless set.
|
|
21760
|
+
* @example pptx.slideShow = { mode: 'kiosk', loop: true }
|
|
21761
|
+
*/ pptxgen_define_property(this, "slideShow", void 0);
|
|
21681
21762
|
/**
|
|
21682
21763
|
* Chart data-point properties and datalabels follow their cell references.
|
|
21683
21764
|
* MS-PPTX §2.4.1.1 `chartTrackingRefBased` on `presentationPr` extLst.
|