pptxgenjs-plus 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /* PptxGenJS 4.2.0 @ 2026-08-24T12:56:09.653Z */
1
+ /* PptxGenJS 4.2.1 @ 2026-08-24T13:58:39.969Z */
2
2
 
3
3
  "use strict";
4
4
  const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
@@ -153,6 +153,261 @@ const AXIS_ID_VALUE_SECONDARY = '2094734553';
153
153
  const AXIS_ID_CATEGORY_PRIMARY = '2094734554';
154
154
  const AXIS_ID_CATEGORY_SECONDARY = '2094734555';
155
155
  const AXIS_ID_SERIES_PRIMARY = '2094734556';
156
+ /** ECMA-376 20.1.10.51 ST_SchemeColorVal - every slot `a:schemeClr@val` accepts */ const SCHEME_COLOR_VALUES = new Set([
157
+ 'bg1',
158
+ 'tx1',
159
+ 'bg2',
160
+ 'tx2',
161
+ 'dk1',
162
+ 'lt1',
163
+ 'dk2',
164
+ 'lt2',
165
+ 'accent1',
166
+ 'accent2',
167
+ 'accent3',
168
+ 'accent4',
169
+ 'accent5',
170
+ 'accent6',
171
+ 'hlink',
172
+ 'folHlink',
173
+ 'phClr'
174
+ ]);
175
+ /** ECMA-376 20.1.10.58 ST_SystemColorVal - `a:sysClr@val` */ const SYSTEM_COLOR_VALUES = new Set([
176
+ 'scrollBar',
177
+ 'background',
178
+ 'activeCaption',
179
+ 'inactiveCaption',
180
+ 'menu',
181
+ 'window',
182
+ 'windowFrame',
183
+ 'menuText',
184
+ 'windowText',
185
+ 'captionText',
186
+ 'activeBorder',
187
+ 'inactiveBorder',
188
+ 'appWorkspace',
189
+ 'highlight',
190
+ 'highlightText',
191
+ 'btnFace',
192
+ 'btnShadow',
193
+ 'grayText',
194
+ 'btnText',
195
+ 'inactiveCaptionText',
196
+ 'btnHighlight',
197
+ '3dDkShadow',
198
+ '3dLight',
199
+ 'infoText',
200
+ 'infoBk',
201
+ 'hotLight',
202
+ 'gradientActiveCaption',
203
+ 'gradientInactiveCaption',
204
+ 'menuHighlight',
205
+ 'menuBar'
206
+ ]);
207
+ /** ECMA-376 20.1.10.48 ST_PresetColorVal - the 140 named preset colors for `a:prstClr@val` */ const PRESET_COLOR_VALUES = new Set([
208
+ 'aliceBlue',
209
+ 'antiqueWhite',
210
+ 'aqua',
211
+ 'aquamarine',
212
+ 'azure',
213
+ 'beige',
214
+ 'bisque',
215
+ 'black',
216
+ 'blanchedAlmond',
217
+ 'blue',
218
+ 'blueViolet',
219
+ 'brown',
220
+ 'burlyWood',
221
+ 'cadetBlue',
222
+ 'chartreuse',
223
+ 'chocolate',
224
+ 'coral',
225
+ 'cornflowerBlue',
226
+ 'cornsilk',
227
+ 'crimson',
228
+ 'cyan',
229
+ 'darkBlue',
230
+ 'darkCyan',
231
+ 'darkGoldenrod',
232
+ 'darkGray',
233
+ 'darkGrey',
234
+ 'darkGreen',
235
+ 'darkKhaki',
236
+ 'darkMagenta',
237
+ 'darkOliveGreen',
238
+ 'darkOrange',
239
+ 'darkOrchid',
240
+ 'darkRed',
241
+ 'darkSalmon',
242
+ 'darkSeaGreen',
243
+ 'darkSlateBlue',
244
+ 'darkSlateGray',
245
+ 'darkSlateGrey',
246
+ 'darkTurquoise',
247
+ 'darkViolet',
248
+ 'deepPink',
249
+ 'deepSkyBlue',
250
+ 'dimGray',
251
+ 'dimGrey',
252
+ 'dkBlue',
253
+ 'dkCyan',
254
+ 'dkGoldenrod',
255
+ 'dkGray',
256
+ 'dkGrey',
257
+ 'dkGreen',
258
+ 'dkKhaki',
259
+ 'dkMagenta',
260
+ 'dkOliveGreen',
261
+ 'dkOrange',
262
+ 'dkOrchid',
263
+ 'dkRed',
264
+ 'dkSalmon',
265
+ 'dkSeaGreen',
266
+ 'dkSlateBlue',
267
+ 'dkSlateGray',
268
+ 'dkSlateGrey',
269
+ 'dkTurquoise',
270
+ 'dkViolet',
271
+ 'dodgerBlue',
272
+ 'firebrick',
273
+ 'floralWhite',
274
+ 'forestGreen',
275
+ 'fuchsia',
276
+ 'gainsboro',
277
+ 'ghostWhite',
278
+ 'gold',
279
+ 'goldenrod',
280
+ 'gray',
281
+ 'grey',
282
+ 'green',
283
+ 'greenYellow',
284
+ 'honeydew',
285
+ 'hotPink',
286
+ 'indianRed',
287
+ 'indigo',
288
+ 'ivory',
289
+ 'khaki',
290
+ 'lavender',
291
+ 'lavenderBlush',
292
+ 'lawnGreen',
293
+ 'lemonChiffon',
294
+ 'lightBlue',
295
+ 'lightCoral',
296
+ 'lightCyan',
297
+ 'lightGoldenrodYellow',
298
+ 'lightGray',
299
+ 'lightGrey',
300
+ 'lightGreen',
301
+ 'lightPink',
302
+ 'lightSalmon',
303
+ 'lightSeaGreen',
304
+ 'lightSkyBlue',
305
+ 'lightSlateGray',
306
+ 'lightSlateGrey',
307
+ 'lightSteelBlue',
308
+ 'lightYellow',
309
+ 'lime',
310
+ 'limeGreen',
311
+ 'linen',
312
+ 'ltBlue',
313
+ 'ltCoral',
314
+ 'ltCyan',
315
+ 'ltGoldenrodYellow',
316
+ 'ltGray',
317
+ 'ltGrey',
318
+ 'ltGreen',
319
+ 'ltPink',
320
+ 'ltSalmon',
321
+ 'ltSeaGreen',
322
+ 'ltSkyBlue',
323
+ 'ltSlateGray',
324
+ 'ltSlateGrey',
325
+ 'ltSteelBlue',
326
+ 'ltYellow',
327
+ 'magenta',
328
+ 'maroon',
329
+ 'medAquamarine',
330
+ 'medBlue',
331
+ 'medOrchid',
332
+ 'medPurple',
333
+ 'medSeaGreen',
334
+ 'medSlateBlue',
335
+ 'medSpringGreen',
336
+ 'medTurquoise',
337
+ 'medVioletRed',
338
+ 'mediumAquamarine',
339
+ 'mediumBlue',
340
+ 'mediumOrchid',
341
+ 'mediumPurple',
342
+ 'mediumSeaGreen',
343
+ 'mediumSlateBlue',
344
+ 'mediumSpringGreen',
345
+ 'mediumTurquoise',
346
+ 'mediumVioletRed',
347
+ 'midnightBlue',
348
+ 'mintCream',
349
+ 'mistyRose',
350
+ 'moccasin',
351
+ 'navajoWhite',
352
+ 'navy',
353
+ 'oldLace',
354
+ 'olive',
355
+ 'oliveDrab',
356
+ 'orange',
357
+ 'orangeRed',
358
+ 'orchid',
359
+ 'paleGoldenrod',
360
+ 'paleGreen',
361
+ 'paleTurquoise',
362
+ 'paleVioletRed',
363
+ 'papayaWhip',
364
+ 'peachPuff',
365
+ 'peru',
366
+ 'pink',
367
+ 'plum',
368
+ 'powderBlue',
369
+ 'purple',
370
+ 'red',
371
+ 'rosyBrown',
372
+ 'royalBlue',
373
+ 'saddleBrown',
374
+ 'salmon',
375
+ 'sandyBrown',
376
+ 'seaGreen',
377
+ 'seaShell',
378
+ 'sienna',
379
+ 'silver',
380
+ 'skyBlue',
381
+ 'slateBlue',
382
+ 'slateGray',
383
+ 'slateGrey',
384
+ 'snow',
385
+ 'springGreen',
386
+ 'steelBlue',
387
+ 'tan',
388
+ 'teal',
389
+ 'thistle',
390
+ 'tomato',
391
+ 'turquoise',
392
+ 'violet',
393
+ 'wheat',
394
+ 'white',
395
+ 'whiteSmoke',
396
+ 'yellow',
397
+ 'yellowGreen'
398
+ ]);
399
+ /** ECMA-376 20.1.10.23 ST_CompoundLine - `a:ln@cmpd` */ const COMPOUND_TYPES = new Set([
400
+ 'sng',
401
+ 'dbl',
402
+ 'thickThin',
403
+ 'thinThick',
404
+ 'tri'
405
+ ]);
406
+ /** ECMA-376 20.1.10.34/35 ST_LineEndWidth and ST_LineEndLength - arrow sizing */ const ARROW_SIZES = new Set([
407
+ 'sm',
408
+ 'med',
409
+ 'lg'
410
+ ]);
156
411
  /**
157
412
  * Chart style and chart colour-style parts (MS-ODRAWXML)
158
413
  * - verified against Microsoft's own `ChartStylePart`/`ChartColorStylePart` definitions in
@@ -574,6 +829,13 @@ var core_enums_ShapeType = /*#__PURE__*/ function(ShapeType) {
574
829
  SchemeColor["accent4"] = "accent4";
575
830
  SchemeColor["accent5"] = "accent5";
576
831
  SchemeColor["accent6"] = "accent6";
832
+ SchemeColor["dk1"] = "dk1";
833
+ SchemeColor["lt1"] = "lt1";
834
+ SchemeColor["dk2"] = "dk2";
835
+ SchemeColor["lt2"] = "lt2";
836
+ SchemeColor["hlink"] = "hlink";
837
+ SchemeColor["folHlink"] = "folHlink";
838
+ SchemeColor["phClr"] = "phClr";
577
839
  return SchemeColor;
578
840
  }({});
579
841
  var core_enums_AlignH = /*#__PURE__*/ function(AlignH) {
@@ -1332,6 +1594,20 @@ function _object_spread_props(target, source) {
1332
1594
  function isModifiedThemeColor(value) {
1333
1595
  return typeof value === 'object' && value !== null && 'baseColor' in value;
1334
1596
  }
1597
+ /**
1598
+ * Whether a value is a DrawingML color object rather than a fill object
1599
+ * - the six specification fields are unique to `ColorProps`
1600
+ */ function isColorProps(value) {
1601
+ if (!value || typeof value !== 'object') return false;
1602
+ return [
1603
+ 'hex',
1604
+ 'scheme',
1605
+ 'system',
1606
+ 'preset',
1607
+ 'hsl',
1608
+ 'scrgb'
1609
+ ].some((key)=>key in value);
1610
+ }
1335
1611
  /** Percent-based OOXML color transforms (0-100 → val*1000) */ const PERCENT_COLOR_MODIFIERS = [
1336
1612
  'alpha',
1337
1613
  'alphaMod',
@@ -1393,11 +1669,86 @@ const FLAG_COLOR_MODIFIERS = [
1393
1669
  * @example [gen-charts.tx] `strXml += '<a:solidFill>' + createColorElement(seriesColor, `<a:alpha val="${Math.round(opts.chartColorsOpacity * 1000)}"/>`) + '</a:solidFill>'`
1394
1670
  * Thi sis wrong. We s/b calling `genXmlColorSelection()` instead as it returns `<a:solidfill>BLAH</a:solidFill>`!!
1395
1671
  */ /**
1672
+ * DrawingML stores percentages in 1000ths of a percent
1673
+ * - `CT_PositiveFixedPercentage` (tint, shade, alpha) is 0-100
1674
+ * - `CT_FixedPercentage` (the `*Off` transforms) is -100 to 100
1675
+ * - `CT_PositivePercentage` (the `*Mod` transforms) is a *scale* and is unbounded above
1676
+ */ function gen_utils_pct(value, min = 0, max = 100) {
1677
+ const clamped = Math.min(max, Math.max(min, isFinite(value) ? value : 0));
1678
+ return String(Math.round(clamped * 1000));
1679
+ }
1680
+ /**
1681
+ * Create the color transform children shared by every ColorProps element (ECMA-376 20.1.2.3)
1682
+ */ function createColorTransforms(props) {
1683
+ let xml = '';
1684
+ if (typeof props.tint === 'number') xml += `<a:tint val="${gen_utils_pct(props.tint)}"/>`;
1685
+ if (typeof props.shade === 'number') xml += `<a:shade val="${gen_utils_pct(props.shade)}"/>`;
1686
+ if (props.inverse === true) xml += '<a:inv/>';
1687
+ if (props.grayscale === true) xml += '<a:gray/>';
1688
+ if (typeof props.alpha === 'number') xml += `<a:alpha val="${gen_utils_pct(props.alpha)}"/>`;
1689
+ if (typeof props.alphaOff === 'number') xml += `<a:alphaOff val="${gen_utils_pct(props.alphaOff, -100, 100)}"/>`;
1690
+ if (typeof props.alphaMod === 'number') xml += `<a:alphaMod val="${gen_utils_pct(props.alphaMod, 0, Number.MAX_SAFE_INTEGER)}"/>`;
1691
+ if (typeof props.hueMod === 'number') xml += `<a:hueMod val="${gen_utils_pct(props.hueMod, 0, Number.MAX_SAFE_INTEGER)}"/>`;
1692
+ if (typeof props.hueOff === 'number') xml += `<a:hueOff val="${Math.round(Math.min(360, Math.max(-360, isFinite(props.hueOff) ? props.hueOff : 0)) * 60000)}"/>`;
1693
+ if (typeof props.satMod === 'number') xml += `<a:satMod val="${gen_utils_pct(props.satMod, 0, Number.MAX_SAFE_INTEGER)}"/>`;
1694
+ if (typeof props.satOff === 'number') xml += `<a:satOff val="${gen_utils_pct(props.satOff, -100, 100)}"/>`;
1695
+ if (typeof props.lumMod === 'number') xml += `<a:lumMod val="${gen_utils_pct(props.lumMod, 0, Number.MAX_SAFE_INTEGER)}"/>`;
1696
+ if (typeof props.lumOff === 'number') xml += `<a:lumOff val="${gen_utils_pct(props.lumOff, -100, 100)}"/>`;
1697
+ if (props.complement === true) xml += '<a:comp/>';
1698
+ if (props.gamma === true) xml += '<a:gamma/>';
1699
+ if (props.inverseGamma === true) xml += '<a:invGamma/>';
1700
+ return xml;
1701
+ }
1702
+ /**
1703
+ * Create the color element for a `ColorProps` object
1704
+ */ function createColorPropsElement(props, extra) {
1705
+ const inner = createColorTransforms(props) + extra;
1706
+ const wrap = (tag, attrs)=>inner ? `<a:${tag} ${attrs}>${inner}</a:${tag}>` : `<a:${tag} ${attrs}/>`;
1707
+ if ('hex' in props) {
1708
+ var _props_hex;
1709
+ const hex = String((_props_hex = props.hex) !== null && _props_hex !== void 0 ? _props_hex : '').replace('#', '');
1710
+ if (!REGEX_HEX_COLOR.test(hex)) {
1711
+ console.warn(`[pptxgenjs] "${hex}" is not a 6-digit hex color - "${(/* inlined export .DEF_FONT_COLOR */"000000")}" used instead`);
1712
+ return wrap('srgbClr', `val="${(/* inlined export .DEF_FONT_COLOR */"000000")}"`);
1713
+ }
1714
+ return wrap('srgbClr', `val="${hex.toUpperCase()}"`);
1715
+ }
1716
+ if ('scheme' in props) {
1717
+ if (!SCHEME_COLOR_VALUES.has(props.scheme)) {
1718
+ console.warn(`[pptxgenjs] "${String(props.scheme)}" is not a theme color slot - "${(/* inlined export .DEF_FONT_COLOR */"000000")}" used instead`);
1719
+ return wrap('srgbClr', `val="${(/* inlined export .DEF_FONT_COLOR */"000000")}"`);
1720
+ }
1721
+ return wrap('schemeClr', `val="${props.scheme}"`);
1722
+ }
1723
+ if ('system' in props) {
1724
+ if (!SYSTEM_COLOR_VALUES.has(props.system)) {
1725
+ console.warn(`[pptxgenjs] "${String(props.system)}" is not a system color - "${(/* inlined export .DEF_FONT_COLOR */"000000")}" used instead`);
1726
+ return wrap('srgbClr', `val="${(/* inlined export .DEF_FONT_COLOR */"000000")}"`);
1727
+ }
1728
+ const last = props.lastColor && REGEX_HEX_COLOR.test(props.lastColor.replace('#', '')) ? ` lastClr="${props.lastColor.replace('#', '').toUpperCase()}"` : '';
1729
+ return wrap('sysClr', `val="${props.system}"${last}`);
1730
+ }
1731
+ if ('preset' in props) {
1732
+ if (!PRESET_COLOR_VALUES.has(props.preset)) {
1733
+ console.warn(`[pptxgenjs] "${String(props.preset)}" is not a preset color name - "${(/* inlined export .DEF_FONT_COLOR */"000000")}" used instead`);
1734
+ return wrap('srgbClr', `val="${(/* inlined export .DEF_FONT_COLOR */"000000")}"`);
1735
+ }
1736
+ return wrap('prstClr', `val="${props.preset}"`);
1737
+ }
1738
+ if ('hsl' in props) {
1739
+ const hue = Math.round(((props.hsl.hue % 360 + 360) % 360 || 0) * 60000);
1740
+ return wrap('hslClr', `hue="${isFinite(hue) ? hue : 0}" sat="${gen_utils_pct(props.hsl.sat)}" lum="${gen_utils_pct(props.hsl.lum)}"`);
1741
+ }
1742
+ return wrap('scrgbClr', `r="${gen_utils_pct(props.scrgb.r)}" g="${gen_utils_pct(props.scrgb.g)}" b="${gen_utils_pct(props.scrgb.b)}"`);
1743
+ }
1744
+ /**
1396
1745
  * Create either a `a:schemeClr` - (scheme color) or `a:srgbClr` (hexa representation).
1397
- * @param {Color|SCHEME_COLORS} colorInput - hex, scheme token, or ModifiedThemeColor
1746
+ * Object forms (`ColorProps`, `ModifiedThemeColor`) reach the rest of the DrawingML color model.
1747
+ * @param {Color|SCHEME_COLORS} colorInput - hex, scheme token, ModifiedThemeColor, or ColorProps
1398
1748
  * @param {string} innerElements - additional elements that adjust the color and are enclosed by the color element
1399
1749
  * @returns {string} XML string
1400
1750
  */ function createColorElement(colorInput, innerElements) {
1751
+ if (isColorProps(colorInput)) return createColorPropsElement(colorInput, innerElements !== null && innerElements !== void 0 ? innerElements : '');
1401
1752
  const base = isModifiedThemeColor(colorInput) ? colorInput.baseColor : colorInput;
1402
1753
  const colorStr = typeof base === 'string' ? base : (/* inlined export .DEF_FONT_COLOR */"000000");
1403
1754
  let colorVal = (colorStr || '').replace('#', '');
@@ -1405,7 +1756,7 @@ const FLAG_COLOR_MODIFIERS = [
1405
1756
  if (isModifiedThemeColor(colorInput)) {
1406
1757
  kids += handleModifiedColorProps(colorInput);
1407
1758
  }
1408
- if (!REGEX_HEX_COLOR.test(colorVal) && colorVal !== core_enums_SchemeColor.background1 && colorVal !== core_enums_SchemeColor.background2 && colorVal !== core_enums_SchemeColor.text1 && colorVal !== core_enums_SchemeColor.text2 && colorVal !== core_enums_SchemeColor.accent1 && colorVal !== core_enums_SchemeColor.accent2 && colorVal !== core_enums_SchemeColor.accent3 && colorVal !== core_enums_SchemeColor.accent4 && colorVal !== core_enums_SchemeColor.accent5 && colorVal !== core_enums_SchemeColor.accent6) {
1759
+ if (!REGEX_HEX_COLOR.test(colorVal) && !SCHEME_COLOR_VALUES.has(colorVal)) {
1409
1760
  console.warn(`"${colorVal}" is not a valid scheme color or hex RGB! "${(/* inlined export .DEF_FONT_COLOR */"000000")}" used instead. Only provide 6-digit RGB or 'pptx.SchemeColor' values!`);
1410
1761
  colorVal = (/* inlined export .DEF_FONT_COLOR */"000000");
1411
1762
  }
@@ -1552,10 +1903,10 @@ function createGlowElement(glow) {
1552
1903
  let internalElements = '';
1553
1904
  let outText = '';
1554
1905
  if (props) {
1555
- // ModifiedThemeColor as a bare Color value (must not be treated as ShapeFillProps)
1906
+ // A bare color - string, ModifiedThemeColor, or ColorProps - is a solid fill of that color
1556
1907
  if (typeof props === 'string') {
1557
1908
  colorVal = props;
1558
- } else if (isModifiedThemeColor(props)) {
1909
+ } else if (isModifiedThemeColor(props) || isColorProps(props)) {
1559
1910
  colorVal = props;
1560
1911
  } else {
1561
1912
  var _props_image;
@@ -1565,22 +1916,23 @@ function createGlowElement(glow) {
1565
1916
  if (props.alpha) internalElements += `<a:alpha val="${Math.round((100 - props.alpha) * 1000)}"/>`; // DEPRECATED: @deprecated v3.3.0
1566
1917
  if (props.transparency) internalElements += `<a:alpha val="${Math.round((100 - props.transparency) * 1000)}"/>`;
1567
1918
  }
1919
+ const isBareColor = typeof props === 'string' || isModifiedThemeColor(props) || isColorProps(props);
1568
1920
  switch(fillType){
1569
1921
  case 'solid':
1570
1922
  outText += `<a:solidFill>${createColorElement(colorVal, internalElements)}</a:solidFill>`;
1571
1923
  break;
1572
1924
  case 'gradient':
1573
1925
  case 'linearGradient':
1574
- outText += createGradientFillElement(typeof props === 'string' || isModifiedThemeColor(props) ? undefined : resolveGradientProps(props), colorVal || '', internalElements);
1926
+ outText += createGradientFillElement(isBareColor ? undefined : resolveGradientProps(props), colorVal || '', internalElements);
1575
1927
  break;
1576
1928
  case 'pattern':
1577
- outText += createPatternFillElement(typeof props === 'string' || isModifiedThemeColor(props) ? undefined : props.pattern, typeof colorVal === 'string' ? colorVal : String(colorVal.baseColor));
1929
+ outText += createPatternFillElement(isBareColor ? undefined : props.pattern, typeof colorVal === 'string' ? colorVal : isModifiedThemeColor(colorVal) ? String(colorVal.baseColor) : (/* inlined export .DEF_FONT_COLOR */"000000"));
1578
1930
  break;
1579
1931
  case 'image':
1580
1932
  {
1581
1933
  var _ref;
1582
- const image = typeof props === 'string' || isModifiedThemeColor(props) ? undefined : props.image;
1583
- const rId = (_ref = image === null || image === void 0 ? void 0 : image._rId) !== null && _ref !== void 0 ? _ref : typeof props === 'string' || isModifiedThemeColor(props) ? undefined : props._rId;
1934
+ const image = isBareColor ? undefined : props.image;
1935
+ const rId = (_ref = image === null || image === void 0 ? void 0 : image._rId) !== null && _ref !== void 0 ? _ref : isBareColor ? undefined : props._rId;
1584
1936
  if (rId) {
1585
1937
  outText += createImageFillElement(image !== null && image !== void 0 ? image : {}, rId);
1586
1938
  } else {
@@ -2567,6 +2919,138 @@ function gen_tables_object_spread(target) {
2567
2919
  return `<a:snd r:embed="rId${link.sound._sndRId}" name="${encodeXmlEntities((_link_sound_name = link.sound.name) !== null && _link_sound_name !== void 0 ? _link_sound_name : 'sound.wav')}"/>`;
2568
2920
  }
2569
2921
 
2922
+ ;// CONCATENATED MODULE: ./src/xml/line.ts
2923
+ function line_define_property(obj, key, value) {
2924
+ if (key in obj) {
2925
+ Object.defineProperty(obj, key, {
2926
+ value: value,
2927
+ enumerable: true,
2928
+ configurable: true,
2929
+ writable: true
2930
+ });
2931
+ } else obj[key] = value;
2932
+ return obj;
2933
+ }
2934
+ function line_object_spread(target) {
2935
+ for(var i = 1; i < arguments.length; i++){
2936
+ var source = arguments[i] != null ? arguments[i] : {};
2937
+ var ownKeys = Object.keys(source);
2938
+ if (typeof Object.getOwnPropertySymbols === "function") {
2939
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
2940
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
2941
+ }));
2942
+ }
2943
+ ownKeys.forEach(function(key) {
2944
+ line_define_property(target, key, source[key]);
2945
+ });
2946
+ }
2947
+ return target;
2948
+ }
2949
+ function line_ownKeys(object, enumerableOnly) {
2950
+ var keys = Object.keys(object);
2951
+ if (Object.getOwnPropertySymbols) {
2952
+ var symbols = Object.getOwnPropertySymbols(object);
2953
+ if (enumerableOnly) {
2954
+ symbols = symbols.filter(function(sym) {
2955
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2956
+ });
2957
+ }
2958
+ keys.push.apply(keys, symbols);
2959
+ }
2960
+ return keys;
2961
+ }
2962
+ function line_object_spread_props(target, source) {
2963
+ source = source != null ? source : {};
2964
+ if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2965
+ else {
2966
+ line_ownKeys(Object(source)).forEach(function(key) {
2967
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2968
+ });
2969
+ }
2970
+ return target;
2971
+ }
2972
+ /**
2973
+ * PptxGenJS: Line properties (`a:ln` and its aliases)
2974
+ *
2975
+ * The same `CT_LineProperties` content model is used by shape outlines (`a:ln`), underlines
2976
+ * (`a:uLn`), and table cell borders, so the element name is a parameter rather than baked in.
2977
+ */
2978
+
2979
+ /**
2980
+ * Create a line element
2981
+ * @param {ShapeLineProps} line - line options
2982
+ * @param {string} tag - element name; `a:ln` for a shape outline, `a:uLn` for an underline
2983
+ * @return {string} XML
2984
+ */ function genXmlLine(line, tag = 'a:ln') {
2985
+ // ECMA-376 §5.1.2.1.34: `<a:ln>` carries `w`, `cap`, and `cmpd` attributes
2986
+ const cap = line.cap && [
2987
+ 'flat',
2988
+ 'sq',
2989
+ 'rnd'
2990
+ ].includes(line.cap) ? ` cap="${line.cap}"` : '';
2991
+ const compound = COMPOUND_TYPES.has(String(line.compound)) ? ` cmpd="${String(line.compound)}"` : '';
2992
+ if (line.compound && !COMPOUND_TYPES.has(String(line.compound))) {
2993
+ console.warn(`[pptxgenjs] line \`compound\` must be one of ${[
2994
+ ...COMPOUND_TYPES
2995
+ ].join(', ')} - "${String(line.compound)}" ignored`);
2996
+ }
2997
+ const attrs = (line.width ? ` w="${valToPts(line.width)}"` : '') + cap + compound;
2998
+ let xml = `<${tag}${attrs}>`;
2999
+ const hasGrad = !!(line.gradient || line.type === 'gradient' || line.type === 'linearGradient');
3000
+ if (line.type !== 'none' && (line.color || hasGrad)) {
3001
+ xml += genXmlColorSelection(hasGrad && !line.type ? line_object_spread_props(line_object_spread({}, line), {
3002
+ type: 'gradient'
3003
+ }) : line);
3004
+ }
3005
+ // CT_LineProperties sequence: fill, dash, join, headEnd, tailEnd. A custom pattern replaces
3006
+ // the preset one - emitting both would be ambiguous, since `a:custDash` is the same choice.
3007
+ xml += genXmlDash(line);
3008
+ xml += genXmlJoin(line);
3009
+ xml += genXmlArrow('a:headEnd', line.beginArrowType, line.beginArrowSize);
3010
+ xml += genXmlArrow('a:tailEnd', line.endArrowType, line.endArrowSize);
3011
+ xml += `</${tag}>`;
3012
+ return xml;
3013
+ }
3014
+ /** The dash choice: a custom pattern when given, otherwise the preset */ function genXmlDash(line) {
3015
+ var _line_custDash;
3016
+ const stops = ((_line_custDash = line.custDash) !== null && _line_custDash !== void 0 ? _line_custDash : []).filter((stop)=>{
3017
+ const ok = typeof (stop === null || stop === void 0 ? void 0 : stop.dash) === 'number' && isFinite(stop.dash) && stop.dash > 0 && typeof stop.space === 'number' && isFinite(stop.space) && stop.space >= 0;
3018
+ if (!ok) console.warn('[pptxgenjs] each `custDash` stop needs a positive `dash` and a non-negative `space` (percent of line width) - stop ignored');
3019
+ return ok;
3020
+ });
3021
+ if (stops.length > 0) {
3022
+ const items = stops.map((stop)=>`<a:ds d="${Math.round(stop.dash * 1000)}" sp="${Math.round(stop.space * 1000)}"/>`).join('');
3023
+ return `<a:custDash>${items}</a:custDash>`;
3024
+ }
3025
+ return line.dashType ? `<a:prstDash val="${line.dashType}"/>` : '';
3026
+ }
3027
+ /** The join choice: `a:round`, `a:bevel`, or `a:miter` with its limit */ function genXmlJoin(line) {
3028
+ if (!line.join) return '';
3029
+ if (line.join === 'round') return '<a:round/>';
3030
+ if (line.join === 'bevel') return '<a:bevel/>';
3031
+ if (line.join === 'miter') {
3032
+ const lim = typeof line.miterLimit === 'number' && isFinite(line.miterLimit) && line.miterLimit >= 0 ? line.miterLimit : 800;
3033
+ return `<a:miter lim="${Math.round(lim * 1000)}"/>`;
3034
+ }
3035
+ console.warn(`[pptxgenjs] line \`join\` must be 'round' | 'bevel' | 'miter' - "${String(line.join)}" ignored`);
3036
+ return '';
3037
+ }
3038
+ function resolveArrowSize(size) {
3039
+ if (!size) return undefined;
3040
+ if (typeof size === 'string') return {
3041
+ width: size,
3042
+ length: size
3043
+ };
3044
+ return size;
3045
+ }
3046
+ /** An arrow end with its optional sizing */ function genXmlArrow(tag, type, size) {
3047
+ if (!type) return '';
3048
+ const resolved = resolveArrowSize(size);
3049
+ const w = ARROW_SIZES.has(String(resolved === null || resolved === void 0 ? void 0 : resolved.width)) ? ` w="${String(resolved === null || resolved === void 0 ? void 0 : resolved.width)}"` : '';
3050
+ const len = ARROW_SIZES.has(String(resolved === null || resolved === void 0 ? void 0 : resolved.length)) ? ` len="${String(resolved === null || resolved === void 0 ? void 0 : resolved.length)}"` : '';
3051
+ return `<${tag} type="${type}"${w}${len}/>`;
3052
+ }
3053
+
2570
3054
  ;// CONCATENATED MODULE: ./src/xml/text.ts
2571
3055
  function text_define_property(obj, key, value) {
2572
3056
  if (key in obj) {
@@ -2665,6 +3149,7 @@ function text_object_spread_props(target, source) {
2665
3149
  'textCascadeDown'
2666
3150
  ]);
2667
3151
 
3152
+
2668
3153
  /**
2669
3154
  * Build the `a:buClr` / `a:buSzPct` / `a:buSzPts` / `a:buFont` prefix shared by every bullet kind
2670
3155
  * - the size defaults to 100% because that is what every branch emitted before
@@ -2730,6 +3215,21 @@ function text_object_spread_props(target, source) {
2730
3215
  if (options.indentLevel && !isNaN(Number(options.indentLevel)) && options.indentLevel > 0) {
2731
3216
  paragraphPropXml += ` lvl="${options.indentLevel}"`;
2732
3217
  }
3218
+ // Remaining CT_TextParagraphProperties attributes - omitted unless set
3219
+ const para = options;
3220
+ if (typeof para.marR === 'number' && isFinite(para.marR) && para.marR >= 0) paragraphPropXml += ` marR="${inch2Emu(para.marR)}"`;
3221
+ if (typeof para.defTabSz === 'number' && isFinite(para.defTabSz) && para.defTabSz > 0) paragraphPropXml += ` defTabSz="${inch2Emu(para.defTabSz)}"`;
3222
+ if ([
3223
+ 'auto',
3224
+ 't',
3225
+ 'ctr',
3226
+ 'base',
3227
+ 'b'
3228
+ ].includes(String(para.fontAlgn))) paragraphPropXml += ` fontAlgn="${String(para.fontAlgn)}"`;
3229
+ // these three default to true in the schema, so only write them when turned off
3230
+ if (para.eaLnBrk === false) paragraphPropXml += ' eaLnBrk="0"';
3231
+ if (para.latinLnBrk === false) paragraphPropXml += ' latinLnBrk="0"';
3232
+ if (para.hangingPunct === false) paragraphPropXml += ' hangingPunct="0"';
2733
3233
  // OPTION: Paragraph Spacing: Before/After
2734
3234
  if (options.paraSpaceBefore && !isNaN(Number(options.paraSpaceBefore)) && options.paraSpaceBefore > 0) {
2735
3235
  strXmlParaSpc += `<a:spcBef><a:spcPts val="${Math.round(options.paraSpaceBefore * 100)}"/></a:spcBef>`;
@@ -2837,9 +3337,13 @@ function text_object_spread_props(target, source) {
2837
3337
  'all'
2838
3338
  ].includes(opts.caps) ? ` cap="${opts.caps}"` : '';
2839
3339
  if (opts.kumimoji === true) runProps += ' kumimoji="1"';
2840
- runProps += ' dirty="0">';
2841
- // Color / Font / Highlight / Outline are children of <a:rPr>, so add them now before closing the runProperties tag
2842
- if (opts.color || opts.gradient || opts.fontFace || opts.fontFaceEa || opts.fontFaceCs || opts.outline || typeof opts.underline === 'object' && opts.underline.color) {
3340
+ const run = opts;
3341
+ if (run.normalizeH === true) runProps += ' normalizeH="1"';
3342
+ if (run.noProof === true) runProps += ' noProof="1"';
3343
+ // `dirty` was hardcoded to 0; it stays the default so existing output does not change
3344
+ runProps += ` dirty="${run.dirty === true ? '1' : '0'}">`;
3345
+ // CT_TextCharacterProperties child order: ln, fill, effect, highlight, uLn, uFill, latin, ea, cs, sym
3346
+ if (opts.color || opts.gradient || opts.fontFace || opts.fontFaceEa || opts.fontFaceCs || opts.fontFaceSym || opts.outline || opts.glow || opts.highlight || run.underlineLine || typeof opts.underline === 'object' && opts.underline.color) {
2843
3347
  if (opts.outline && typeof opts.outline === 'object') {
2844
3348
  runProps += `<a:ln w="${valToPts(opts.outline.size || 0.75)}">${genXmlColorSelection({
2845
3349
  color: opts.outline.color || 'FFFFFF',
@@ -2856,10 +3360,12 @@ function text_object_spread_props(target, source) {
2856
3360
  color: opts.color,
2857
3361
  transparency: opts.transparency
2858
3362
  });
2859
- if (opts.highlight) runProps += `<a:highlight>${createColorElement(opts.highlight)}</a:highlight>`;
2860
- if (typeof opts.underline === 'object' && opts.underline.color) runProps += `<a:uFill>${genXmlColorSelection(opts.underline.color)}</a:uFill>`;
2861
3363
  const resolvedGlow = resolveGlowOptions(opts.glow);
2862
3364
  if (resolvedGlow) runProps += `<a:effectLst>${createGlowElement(resolvedGlow)}</a:effectLst>`;
3365
+ if (opts.highlight) runProps += `<a:highlight>${createColorElement(opts.highlight)}</a:highlight>`;
3366
+ if (run.underlineLine === 'text') runProps += '<a:uLnTx/>';
3367
+ else if (run.underlineLine && typeof run.underlineLine === 'object') runProps += genXmlLine(run.underlineLine, 'a:uLn');
3368
+ if (typeof opts.underline === 'object' && opts.underline.color) runProps += `<a:uFill>${genXmlColorSelection(opts.underline.color)}</a:uFill>`;
2863
3369
  const latin = opts.fontFace;
2864
3370
  const ea = opts.fontFaceEa || opts.fontFace;
2865
3371
  const cs = opts.fontFaceCs || opts.fontFace;
@@ -2869,6 +3375,7 @@ function text_object_spread_props(target, source) {
2869
3375
  if (ea) runProps += `<a:ea typeface="${encodeXmlEntities(ea)}" pitchFamily="34" charset="-122"/>`;
2870
3376
  if (cs) runProps += `<a:cs typeface="${encodeXmlEntities(cs)}" pitchFamily="34" charset="-120"/>`;
2871
3377
  }
3378
+ if (opts.fontFaceSym) runProps += `<a:sym typeface="${encodeXmlEntities(opts.fontFaceSym)}"/>`;
2872
3379
  }
2873
3380
  // Hyperlink support
2874
3381
  if (opts.hyperlink) {
@@ -3001,6 +3508,14 @@ function genXmlTextRun(textObj) {
3001
3508
  if (slideObject.options._bodyProp.tIns || slideObject.options._bodyProp.tIns === 0) bodyProperties += ` tIns="${slideObject.options._bodyProp.tIns}"`;
3002
3509
  if (slideObject.options._bodyProp.rIns || slideObject.options._bodyProp.rIns === 0) bodyProperties += ` rIns="${slideObject.options._bodyProp.rIns}"`;
3003
3510
  if (slideObject.options._bodyProp.bIns || slideObject.options._bodyProp.bIns === 0) bodyProperties += ` bIns="${slideObject.options._bodyProp.bIns}"`;
3511
+ // Remaining CT_TextBodyProperties attributes - each omitted unless asked for
3512
+ const body = slideObject.options;
3513
+ if (body.upright === true) bodyProperties += ' upright="1"';
3514
+ if (typeof body.textRotate === 'number' && isFinite(body.textRotate)) bodyProperties += ` rot="${convertRotationDegrees(body.textRotate)}"`;
3515
+ if (body.anchorCtr === true) bodyProperties += ' anchorCtr="1"';
3516
+ if (body.spcFirstLastPara === true) bodyProperties += ' spcFirstLastPara="1"';
3517
+ if (body.compatLnSpc === true) bodyProperties += ' compatLnSpc="1"';
3518
+ if (body.forceAA === true) bodyProperties += ' forceAA="1"';
3004
3519
  // Text columns — ECMA-376 §5.1.5.1.4 CT_TextBodyProperties@numCol/@spcCol (issue #1320)
3005
3520
  if (slideObject.options._bodyProp.numCol && slideObject.options._bodyProp.numCol > 1) {
3006
3521
  bodyProperties += ` numCol="${slideObject.options._bodyProp.numCol}"`;
@@ -4904,7 +5419,7 @@ function addShapeDefinition(target, shapeName, opts) {
4904
5419
  }
4905
5420
  // 1: ShapeLineProps defaults
4906
5421
  const hasConnectorEnds = options.line.sourceId != null || options.line.targetId != null;
4907
- const newLineOpts = {
5422
+ const newLineOpts = gen_objects_object_spread_props(gen_objects_object_spread({}, options.line), {
4908
5423
  type: options.line.type || (options.line.gradient ? 'gradient' : 'solid'),
4909
5424
  color: options.line.color || (/* inlined export .DEF_SHAPE_LINE_COLOR */"333333"),
4910
5425
  transparency: options.line.transparency || 0,
@@ -4923,7 +5438,7 @@ function addShapeDefinition(target, shapeName, opts) {
4923
5438
  curveadjust: options.line.curveadjust,
4924
5439
  _sourceName: options.line._sourceName,
4925
5440
  _targetName: options.line._targetName
4926
- };
5441
+ });
4927
5442
  if (typeof options.line === 'object' && options.line.type !== 'none') options.line = newLineOpts;
4928
5443
  // 2: Set options defaults
4929
5444
  const shapeOpts = options;
@@ -5316,7 +5831,7 @@ function addShapeDefinition(target, shapeName, opts) {
5316
5831
  if (itemOpts.shape === core_enums_SHAPE_TYPE.LINE) {
5317
5832
  var _itemOpts_line, _itemOpts_line1, _itemOpts_line2, _itemOpts_line3, _itemOpts_line4, _itemOpts_line5, _itemOpts_line6, _itemOpts_line7, _itemOpts_line8, _itemOpts_line9;
5318
5833
  // ShapeLineProps defaults
5319
- const newLineOpts = {
5834
+ const newLineOpts = gen_objects_object_spread_props(gen_objects_object_spread({}, itemOpts.line), {
5320
5835
  type: ((_itemOpts_line = itemOpts.line) === null || _itemOpts_line === void 0 ? void 0 : _itemOpts_line.type) || (((_itemOpts_line1 = itemOpts.line) === null || _itemOpts_line1 === void 0 ? void 0 : _itemOpts_line1.gradient) ? 'gradient' : 'solid'),
5321
5836
  color: ((_itemOpts_line2 = itemOpts.line) === null || _itemOpts_line2 === void 0 ? void 0 : _itemOpts_line2.color) || (/* inlined export .DEF_SHAPE_LINE_COLOR */"333333"),
5322
5837
  transparency: ((_itemOpts_line3 = itemOpts.line) === null || _itemOpts_line3 === void 0 ? void 0 : _itemOpts_line3.transparency) || 0,
@@ -5326,7 +5841,7 @@ function addShapeDefinition(target, shapeName, opts) {
5326
5841
  cap: (_itemOpts_line7 = itemOpts.line) === null || _itemOpts_line7 === void 0 ? void 0 : _itemOpts_line7.cap,
5327
5842
  beginArrowType: ((_itemOpts_line8 = itemOpts.line) === null || _itemOpts_line8 === void 0 ? void 0 : _itemOpts_line8.beginArrowType) || undefined,
5328
5843
  endArrowType: ((_itemOpts_line9 = itemOpts.line) === null || _itemOpts_line9 === void 0 ? void 0 : _itemOpts_line9.endArrowType) || undefined
5329
- };
5844
+ });
5330
5845
  if (typeof itemOpts.line === 'object') itemOpts.line = newLineOpts;
5331
5846
  // 3: Handle line (lots of deprecated opts)
5332
5847
  normalizeDeprecatedLineProps(itemOpts, newLineOpts);
@@ -20577,6 +21092,7 @@ function slide_object_spread_props(target, source) {
20577
21092
 
20578
21093
 
20579
21094
 
21095
+
20580
21096
  function nvPrModIdExt(modId) {
20581
21097
  return genXmlModIdExt(modId).replace(/^<p:extLst>|<\/p:extLst>$/g, '');
20582
21098
  }
@@ -20714,31 +21230,6 @@ const ImageSizingXml = {
20714
21230
  const time = typeof (point === null || point === void 0 ? void 0 : point.time) === 'number' && isFinite(point.time) && point.time > 0 ? ` time="${Math.round(point.time)}"` : '';
20715
21231
  return `<${tag} track="${track}"${time}/>`;
20716
21232
  }
20717
- /**
20718
- * Create the `a:ln` outline block for a shape/image
20719
- * @param {ShapeLineProps} line - line options
20720
- * @return {string} XML
20721
- */ function genXmlLine(line) {
20722
- // ECMA-376 §5.1.2.1.34: `<a:ln>` carries `w` and `cap` attributes (cap = line ending style, issue #782)
20723
- const attrs = (line.width ? ` w="${valToPts(line.width)}"` : '') + (line.cap && [
20724
- 'flat',
20725
- 'sq',
20726
- 'rnd'
20727
- ].includes(line.cap) ? ` cap="${line.cap}"` : '');
20728
- let xml = `<a:ln${attrs}>`;
20729
- const hasGrad = !!(line.gradient || line.type === 'gradient' || line.type === 'linearGradient');
20730
- if (line.type !== 'none' && (line.color || hasGrad)) {
20731
- xml += genXmlColorSelection(hasGrad && !line.type ? slide_object_spread_props(xml_slide_object_spread({}, line), {
20732
- type: 'gradient'
20733
- }) : line);
20734
- }
20735
- if (line.dashType) xml += `<a:prstDash val="${line.dashType}"/>`;
20736
- if (line.beginArrowType) xml += `<a:headEnd type="${line.beginArrowType}"/>`;
20737
- if (line.endArrowType) xml += `<a:tailEnd type="${line.endArrowType}"/>`;
20738
- // FUTURE: `endArrowSize` < a: headEnd type = "arrow" w = "lg" len = "lg" /> 'sm' | 'med' | 'lg'(values are 1 - 9, making a 3x3 grid of w / len possibilities)
20739
- xml += '</a:ln>';
20740
- return xml;
20741
- }
20742
21233
  /**
20743
21234
  * Create a single `a:outerShdw` / `a:innerShdw` element (no `effectLst` wrapper).
20744
21235
  * @note pure - unit conversion must NOT mutate the caller's options (issue #20)
@@ -22000,6 +22491,7 @@ function package_object_spread(target) {
22000
22491
 
22001
22492
 
22002
22493
 
22494
+
22003
22495
  /**
22004
22496
  * Content-type overrides a chart needs: the chart itself plus, when requested, its style and colour-style parts.
22005
22497
  * - one helper because charts appear on slides, layouts and the master, and a part with no declared
@@ -22833,6 +23325,7 @@ function makeXmlPresPropsExtLst(pres) {
22833
23325
 
22834
23326
 
22835
23327
 
23328
+
22836
23329
  ;// CONCATENATED MODULE: ./src/pptxgen.ts
22837
23330
  function pptxgen_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
22838
23331
  try {
@@ -23361,7 +23854,7 @@ class PptxGenJS {
23361
23854
  */ pptxgen_define_property(this, "_layout", void 0);
23362
23855
  /**
23363
23856
  * PptxGenJS Library Version
23364
- */ pptxgen_define_property(this, "_version", (/* inlined export .VERSION */"4.2.0"));
23857
+ */ pptxgen_define_property(this, "_version", (/* inlined export .VERSION */"4.2.1"));
23365
23858
  /**
23366
23859
  * @type {string}
23367
23860
  */ pptxgen_define_property(this, "_author", void 0);