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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptxgenjs-plus",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "author": {
5
5
  "name": "Brent Ely",
6
6
  "url": "https://github.com/gitbrent/"
package/types/index.d.ts CHANGED
@@ -318,10 +318,10 @@ declare enum ChartType {
318
318
  declare type ClassificationOutcome = 'none' | 'hdr' | 'ftr' | 'watermark';
319
319
 
320
320
  /**
321
- * Color value: hex RGB, scheme token, or a scheme/hex color with OOXML transforms
322
- * (selective port of rafalBujok/define_color_theme + allow_modified_color_theme)
321
+ * Color value: hex RGB, scheme token, `ModifiedThemeColor`, or a DrawingML color object
322
+ * (`{ hex }`, `{ scheme }`, `{ system }`, `{ preset }`, `{ hsl }`, `{ scrgb }`)
323
323
  */
324
- declare type Color = HexColor | ThemeColor | ModifiedThemeColor;
324
+ declare type Color = HexColor | ThemeColor | ModifiedThemeColor | ColorProps;
325
325
 
326
326
  declare interface ColorAnimationConfig extends BaseAnimationConfig {
327
327
  type: 'colorpulse' | 'objectcolor' | 'linecolor' | 'fillcolor';
@@ -350,11 +350,95 @@ declare interface ColorMapOverrideProps {
350
350
  folHlink?: ColorSchemeIndex;
351
351
  }
352
352
 
353
+ /**
354
+ * A color given as an object so the non-hex DrawingML color kinds are reachable
355
+ * - exactly one specification field identifies the color; that is what distinguishes a color
356
+ * object from a fill object at runtime
357
+ * @example { hex: 'FF0000', alpha: 50 }
358
+ * @example { scheme: 'accent1', lumMod: 60, lumOff: 40 }
359
+ * @example { preset: 'cornflowerBlue' }
360
+ * @example { hsl: { hue: 210, sat: 80, lum: 50 }, shade: 25 }
361
+ */
362
+ declare type ColorProps =
363
+ /** 6-digit hex (`a:srgbClr`) */
364
+ ({
365
+ hex: HexColor;
366
+ } & ColorTransformProps)
367
+ /** theme slot (`a:schemeClr`) */
368
+ | ({
369
+ scheme: SchemeColorValue;
370
+ } & ColorTransformProps)
371
+ /** system color such as `windowText`, with an optional last-known value (`a:sysClr`) */
372
+ | ({
373
+ system: string;
374
+ lastColor?: HexColor;
375
+ } & ColorTransformProps)
376
+ /** one of the 140 preset color names (`a:prstClr`) */
377
+ | ({
378
+ preset: string;
379
+ } & ColorTransformProps)
380
+ /** hue/saturation/luminance; hue in degrees, the rest percent (`a:hslClr`) */
381
+ | ({
382
+ hsl: {
383
+ hue: number;
384
+ sat: number;
385
+ lum: number;
386
+ };
387
+ } & ColorTransformProps)
388
+ /** linear-gamma RGB percentages (`a:scrgbClr`) */
389
+ | ({
390
+ scrgb: {
391
+ r: number;
392
+ g: number;
393
+ b: number;
394
+ };
395
+ } & ColorTransformProps);
396
+
353
397
  /**
354
398
  * ECMA-376 20.1.10.14 ST_ColorSchemeIndex - a slot in the theme's colour scheme
355
399
  */
356
400
  declare type ColorSchemeIndex = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink';
357
401
 
402
+ /**
403
+ * Color transforms on a `ColorProps` object (ECMA-376 20.1.2.3, `EG_ColorTransform`)
404
+ * - `tint`/`shade`/`alpha` are 0-100; `*Off` are -100-100; `*Mod` are unbounded scales
405
+ * - `hueOff` is in degrees
406
+ */
407
+ declare interface ColorTransformProps {
408
+ /** lighten toward white (percent) */
409
+ tint?: number;
410
+ /** darken toward black (percent) */
411
+ shade?: number;
412
+ /** opacity (percent); 100 is opaque */
413
+ alpha?: number;
414
+ /** shift opacity (percent, -100 to 100) */
415
+ alphaOff?: number;
416
+ /** scale opacity (percent) */
417
+ alphaMod?: number;
418
+ /** scale luminance (percent) */
419
+ lumMod?: number;
420
+ /** shift luminance (percent, -100 to 100) */
421
+ lumOff?: number;
422
+ /** scale saturation (percent) */
423
+ satMod?: number;
424
+ /** shift saturation (percent, -100 to 100) */
425
+ satOff?: number;
426
+ /** scale hue (percent) */
427
+ hueMod?: number;
428
+ /** shift hue (degrees, -360 to 360) */
429
+ hueOff?: number;
430
+ /** use the complement */
431
+ complement?: boolean;
432
+ /** use the inverse */
433
+ inverse?: boolean;
434
+ /** convert to grayscale */
435
+ grayscale?: boolean;
436
+ /** apply gamma */
437
+ gamma?: boolean;
438
+ /** apply inverse gamma */
439
+ inverseGamma?: boolean;
440
+ }
441
+
358
442
  /** A modern-comment author. MS-PPTX §2.16.3.1 `CT_Author`. */
359
443
  declare interface CommentAuthorProps {
360
444
  /** Author display name (required). */
@@ -1716,6 +1800,9 @@ declare interface LaserTracePoint {
1716
1800
  y: number;
1717
1801
  }
1718
1802
 
1803
+ /** ECMA-376 ST_LineEndWidth / ST_LineEndLength */
1804
+ declare type LineArrowSize = 'sm' | 'med' | 'lg';
1805
+
1719
1806
  declare type Margin = number | [number, number, number, number];
1720
1807
 
1721
1808
  /**
@@ -2161,6 +2248,42 @@ declare enum OutputType {
2161
2248
  'uint8array' = "uint8array"
2162
2249
  }
2163
2250
 
2251
+ /**
2252
+ * Paragraph attributes beyond margins/alignment (`a:pPr`, ECMA-376 21.1.2.2.7)
2253
+ */
2254
+ declare interface ParagraphProps {
2255
+ /**
2256
+ * Right margin in inches (`a:pPr@marR`)
2257
+ */
2258
+ marR?: number;
2259
+ /**
2260
+ * Default tab stop interval in inches (`a:pPr@defTabSz`)
2261
+ */
2262
+ defTabSz?: number;
2263
+ /**
2264
+ * Baseline alignment of glyphs within the line (`a:pPr@fontAlgn`)
2265
+ */
2266
+ fontAlgn?: 'auto' | 't' | 'ctr' | 'base' | 'b';
2267
+ /**
2268
+ * Apply East Asian line-breaking rules (`a:pPr@eaLnBrk`)
2269
+ * - schema default is true; written only when turned off
2270
+ * @default true
2271
+ */
2272
+ eaLnBrk?: boolean;
2273
+ /**
2274
+ * Allow Latin words to break across lines (`a:pPr@latinLnBrk`)
2275
+ * - schema default is true; written only when turned off
2276
+ * @default true
2277
+ */
2278
+ latinLnBrk?: boolean;
2279
+ /**
2280
+ * Apply hanging punctuation (`a:pPr@hangingPunct`)
2281
+ * - schema default is true; written only when turned off
2282
+ * @default true
2283
+ */
2284
+ hangingPunct?: boolean;
2285
+ }
2286
+
2164
2287
  declare type PathAnimation = 'pathdown' | 'patharcdown' | 'pathturnright' | 'pathcircle' | 'pathzigzag';
2165
2288
 
2166
2289
  /**
@@ -2967,9 +3090,19 @@ declare enum SchemeColor {
2967
3090
  'accent3' = "accent3",
2968
3091
  'accent4' = "accent4",
2969
3092
  'accent5' = "accent5",
2970
- 'accent6' = "accent6"
3093
+ 'accent6' = "accent6",
3094
+ 'dk1' = "dk1",
3095
+ 'lt1' = "lt1",
3096
+ 'dk2' = "dk2",
3097
+ 'lt2' = "lt2",
3098
+ 'hlink' = "hlink",
3099
+ 'folHlink' = "folHlink",
3100
+ 'phClr' = "phClr"
2971
3101
  }
2972
3102
 
3103
+ /** Every `a:schemeClr@val` slot (ECMA-376 20.1.10.51 ST_SchemeColorVal) */
3104
+ declare type SchemeColorValue = ThemeColor;
3105
+
2973
3106
  declare interface SectionProps {
2974
3107
  /** @internal managed by the library; consumers only pass `{ title, order? }` */
2975
3108
  _type?: 'user' | 'default';
@@ -3513,6 +3646,45 @@ declare interface ShapeLineProps extends ShapeFillProps {
3513
3646
  _sourceName?: string;
3514
3647
  /** `objectName` of the end shape (resolved to `targetId` at emit) @internal */
3515
3648
  _targetName?: string;
3649
+ /**
3650
+ * Compound line type (`a:ln@cmpd`)
3651
+ * @default 'sng'
3652
+ */
3653
+ compound?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
3654
+ /**
3655
+ * How line segments join at a corner (`a:round` / `a:bevel` / `a:miter`)
3656
+ */
3657
+ join?: 'round' | 'bevel' | 'miter';
3658
+ /**
3659
+ * `join: 'miter'` only: how far the miter may extend, as a percent of line width (`a:miter@lim`)
3660
+ * @default 800
3661
+ */
3662
+ miterLimit?: number;
3663
+ /**
3664
+ * Custom dash pattern (`a:custDash`), overriding `dashType`
3665
+ * - each stop is a dash length and the gap after it, as a percent of line width
3666
+ * @example [{ dash: 400, space: 300 }, { dash: 100, space: 300 }]
3667
+ */
3668
+ custDash?: Array<{
3669
+ dash: number;
3670
+ space: number;
3671
+ }>;
3672
+ /**
3673
+ * Arrow head size (`a:headEnd@w` / `@len`)
3674
+ * - `beginArrowType` selects the shape; this sizes it
3675
+ * - a string applies to both width and length
3676
+ */
3677
+ beginArrowSize?: LineArrowSize | {
3678
+ width?: LineArrowSize;
3679
+ length?: LineArrowSize;
3680
+ };
3681
+ /**
3682
+ * Arrow tail size (`a:tailEnd@w` / `@len`)
3683
+ */
3684
+ endArrowSize?: LineArrowSize | {
3685
+ width?: LineArrowSize;
3686
+ length?: LineArrowSize;
3687
+ };
3516
3688
  /**
3517
3689
  * Dash type
3518
3690
  * @deprecated v3.3.0 - use `dashType`
@@ -4860,6 +5032,11 @@ declare interface TextBaseProps {
4860
5032
  * @example 'Arial'
4861
5033
  */
4862
5034
  fontFaceCs?: string;
5035
+ /**
5036
+ * Symbol typeface (`a:sym`), for Wingdings-style glyphs
5037
+ * @example 'Wingdings'
5038
+ */
5039
+ fontFaceSym?: string;
4863
5040
  /**
4864
5041
  * Gradient text fill (`a:gradFill` on `a:rPr`). When set, overrides solid `color`.
4865
5042
  * @example { type:'linear', angle:45, stops:[{ pos:0, color:'FF0000' }, { pos:100, color:'0000FF' }] }
@@ -4934,6 +5111,44 @@ declare interface TextBaseProps {
4934
5111
  valign?: VAlign;
4935
5112
  }
4936
5113
 
5114
+ /**
5115
+ * Text-body attributes beyond wrap/insets/anchor (`a:bodyPr`, ECMA-376 21.1.2.1.1)
5116
+ * - omitted unless set, so default output does not change
5117
+ * - overflow uses the existing `vertOverflow` / `horzOverflow` options
5118
+ */
5119
+ declare interface TextBodyProps {
5120
+ /**
5121
+ * Keep text upright when the shape is rotated (`a:bodyPr@upright`)
5122
+ * @default false
5123
+ */
5124
+ upright?: boolean;
5125
+ /**
5126
+ * Rotate the text body independently of the shape, in degrees (`a:bodyPr@rot`)
5127
+ * - distinct from the shape's own `rotate`
5128
+ */
5129
+ textRotate?: number;
5130
+ /**
5131
+ * Center the anchor point as well as the text (`a:bodyPr@anchorCtr`)
5132
+ * @default false
5133
+ */
5134
+ anchorCtr?: boolean;
5135
+ /**
5136
+ * Respect paragraph spacing before the first and after the last line (`a:bodyPr@spcFirstLastPara`)
5137
+ * @default false
5138
+ */
5139
+ spcFirstLastPara?: boolean;
5140
+ /**
5141
+ * Use legacy line-spacing rules (`a:bodyPr@compatLnSpc`)
5142
+ * @default false
5143
+ */
5144
+ compatLnSpc?: boolean;
5145
+ /**
5146
+ * Force anti-aliasing regardless of size (`a:bodyPr@forceAA`)
5147
+ * @default false
5148
+ */
5149
+ forceAA?: boolean;
5150
+ }
5151
+
4937
5152
  /**
4938
5153
  * Refreshable text-run field type (`a:fld@type`, ECMA-376 21.1.2.2.4)
4939
5154
  */
@@ -4962,7 +5177,7 @@ declare interface TextProps {
4962
5177
  options?: TextPropsOptions;
4963
5178
  }
4964
5179
 
4965
- declare interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps, ObjectNameProps, AppearOnClickProps, NvPrExtensionProps {
5180
+ declare interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps, ObjectNameProps, AppearOnClickProps, NvPrExtensionProps, TextBodyProps, ParagraphProps, TextRunProps {
4966
5181
  _bodyProp?: {
4967
5182
  autoFit?: boolean;
4968
5183
  align?: TEXT_HALIGN;
@@ -5239,13 +5454,41 @@ declare interface TextPropsOptions extends PositionProps, DataOrPathProps, TextB
5239
5454
  animation?: string | AnimationConfig;
5240
5455
  }
5241
5456
 
5457
+ /**
5458
+ * Run attributes beyond bold/italic/size (`a:rPr`, ECMA-376 21.1.2.3.9)
5459
+ * - `caps` lives on `TextPropsOptions` (already present)
5460
+ */
5461
+ declare interface TextRunProps {
5462
+ /**
5463
+ * Normalise glyph heights (`a:rPr@normalizeH`)
5464
+ * @default false
5465
+ */
5466
+ normalizeH?: boolean;
5467
+ /**
5468
+ * Exclude the run from spelling and grammar checking (`a:rPr@noProof`)
5469
+ * @default false
5470
+ */
5471
+ noProof?: boolean;
5472
+ /**
5473
+ * Mark the run as needing re-inspection (`a:rPr@dirty`)
5474
+ * - previously hardcoded to `0`
5475
+ * @default false
5476
+ */
5477
+ dirty?: boolean;
5478
+ /**
5479
+ * Underline line properties (`a:uLn`), distinct from the underline colour
5480
+ * - pass `'text'` to follow the run's own line (`a:uLnTx`)
5481
+ */
5482
+ underlineLine?: 'text' | ShapeLineProps;
5483
+ }
5484
+
5242
5485
  /**
5243
5486
  * WordArt / preset text warp (`a:prstTxWarp@prst`, ECMA-376 `ST_TextShapeType`)
5244
5487
  * @see standards/ecma/part-22_drawingml-reference-material-drawingml-main.txt §5.1.12.76
5245
5488
  */
5246
5489
  declare type TextShapeType = 'textNoShape' | 'textPlain' | 'textStop' | 'textTriangle' | 'textTriangleInverted' | 'textChevron' | 'textChevronInverted' | 'textRingInside' | 'textRingOutside' | 'textArchUp' | 'textArchDown' | 'textCircle' | 'textButton' | 'textArchUpPour' | 'textArchDownPour' | 'textCirclePour' | 'textButtonPour' | 'textCurveUp' | 'textCurveDown' | 'textCanUp' | 'textCanDown' | 'textWave1' | 'textWave2' | 'textDoubleWave1' | 'textWave4' | 'textInflate' | 'textDeflate' | 'textInflateBottom' | 'textDeflateBottom' | 'textInflateTop' | 'textDeflateTop' | 'textDeflateInflate' | 'textDeflateInflateDeflate' | 'textFadeRight' | 'textFadeLeft' | 'textFadeUp' | 'textFadeDown' | 'textSlantUp' | 'textSlantDown' | 'textCascadeUp' | 'textCascadeDown';
5247
5490
 
5248
- declare type ThemeColor = 'tx1' | 'tx2' | 'bg1' | 'bg2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6';
5491
+ declare type ThemeColor = 'tx1' | 'tx2' | 'bg1' | 'bg2' | 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'phClr';
5249
5492
 
5250
5493
  declare interface ThemeProps {
5251
5494
  /**
@@ -5453,6 +5696,7 @@ declare interface ZoomProps extends ZoomBaseProps {
5453
5696
  export { }
5454
5697
 
5455
5698
  export { ANCHOR }
5699
+ export { ARROW_SIZES }
5456
5700
  export { AXIS_ID_CATEGORY_PRIMARY }
5457
5701
  export { AXIS_ID_CATEGORY_SECONDARY }
5458
5702
  export { AXIS_ID_SERIES_PRIMARY }
@@ -5480,6 +5724,7 @@ export { CHARTEX_NAME }
5480
5724
  export { CHART_NAME }
5481
5725
  export { CHART_STYLE }
5482
5726
  export { CHART_TYPE }
5727
+ export { COMPOUND_TYPES }
5483
5728
  export { CRLF }
5484
5729
  export { Cell3DProps }
5485
5730
  export { CellBevelProps }
@@ -5493,7 +5738,9 @@ export { ClassificationOutcome }
5493
5738
  export { Color }
5494
5739
  export { ColorAnimationConfig }
5495
5740
  export { ColorMapOverrideProps }
5741
+ export { ColorProps }
5496
5742
  export { ColorSchemeIndex }
5743
+ export { ColorTransformProps }
5497
5744
  export { CommentAuthorProps }
5498
5745
  export { CommentAuthorRef }
5499
5746
  export { CommentChangeBit }
@@ -5595,6 +5842,7 @@ export { LAYOUT_IDX_SERIES_BASE }
5595
5842
  export { LETTERS }
5596
5843
  export { LINEH_MODIFIER }
5597
5844
  export { LaserTracePoint }
5845
+ export { LineArrowSize }
5598
5846
  export { MASTER_OBJECTS }
5599
5847
  export { Margin }
5600
5848
  export { MediaOnError }
@@ -5617,6 +5865,8 @@ export { OutputType }
5617
5865
  export { PIECHART_COLORS }
5618
5866
  export { PLACEHOLDER_TYPE }
5619
5867
  export { PLACEHOLDER_TYPES }
5868
+ export { PRESET_COLOR_VALUES }
5869
+ export { ParagraphProps }
5620
5870
  export { PathAnimation }
5621
5871
  export { PhotoAlbumProps }
5622
5872
  export { PlaceholderProps }
@@ -5634,11 +5884,14 @@ export { RevisionClientProps }
5634
5884
  export { RevisionInfoProps }
5635
5885
  export { SCHEME_COLORS }
5636
5886
  export { SCHEME_COLOR_NAMES }
5887
+ export { SCHEME_COLOR_VALUES }
5637
5888
  export { SHAPE_NAME }
5638
5889
  export { SHAPE_TYPE }
5639
5890
  export { SLDNUMFLDID }
5640
5891
  export { SLIDE_OBJECT_TYPES }
5892
+ export { SYSTEM_COLOR_VALUES }
5641
5893
  export { SchemeColor }
5894
+ export { SchemeColorValue }
5642
5895
  export { SectionProps }
5643
5896
  export { SectionZoomProps }
5644
5897
  export { ShadowProps }
@@ -5690,10 +5943,12 @@ export { TableStylePartProps }
5690
5943
  export { TableStyleProps }
5691
5944
  export { TableToSlidesProps }
5692
5945
  export { TextBaseProps }
5946
+ export { TextBodyProps }
5693
5947
  export { TextFieldType }
5694
5948
  export { TextGlowProps }
5695
5949
  export { TextProps }
5696
5950
  export { TextPropsOptions }
5951
+ export { TextRunProps }
5697
5952
  export { TextShapeType }
5698
5953
  export { ThemeColor }
5699
5954
  export { ThemeProps }
@@ -5720,6 +5975,7 @@ export as namespace PptxGenJS
5720
5975
 
5721
5976
  declare namespace PptxGenJS {
5722
5977
  export { ANCHOR }
5978
+ export { ARROW_SIZES }
5723
5979
  export { AXIS_ID_CATEGORY_PRIMARY }
5724
5980
  export { AXIS_ID_CATEGORY_SECONDARY }
5725
5981
  export { AXIS_ID_SERIES_PRIMARY }
@@ -5747,6 +6003,7 @@ declare namespace PptxGenJS {
5747
6003
  export { CHART_NAME }
5748
6004
  export { CHART_STYLE }
5749
6005
  export { CHART_TYPE }
6006
+ export { COMPOUND_TYPES }
5750
6007
  export { CRLF }
5751
6008
  export { Cell3DProps }
5752
6009
  export { CellBevelProps }
@@ -5760,7 +6017,9 @@ declare namespace PptxGenJS {
5760
6017
  export { Color }
5761
6018
  export { ColorAnimationConfig }
5762
6019
  export { ColorMapOverrideProps }
6020
+ export { ColorProps }
5763
6021
  export { ColorSchemeIndex }
6022
+ export { ColorTransformProps }
5764
6023
  export { CommentAuthorProps }
5765
6024
  export { CommentAuthorRef }
5766
6025
  export { CommentChangeBit }
@@ -5862,6 +6121,7 @@ declare namespace PptxGenJS {
5862
6121
  export { LETTERS }
5863
6122
  export { LINEH_MODIFIER }
5864
6123
  export { LaserTracePoint }
6124
+ export { LineArrowSize }
5865
6125
  export { MASTER_OBJECTS }
5866
6126
  export { Margin }
5867
6127
  export { MediaOnError }
@@ -5884,6 +6144,8 @@ declare namespace PptxGenJS {
5884
6144
  export { PIECHART_COLORS }
5885
6145
  export { PLACEHOLDER_TYPE }
5886
6146
  export { PLACEHOLDER_TYPES }
6147
+ export { PRESET_COLOR_VALUES }
6148
+ export { ParagraphProps }
5887
6149
  export { PathAnimation }
5888
6150
  export { PhotoAlbumProps }
5889
6151
  export { PlaceholderProps }
@@ -5901,11 +6163,14 @@ declare namespace PptxGenJS {
5901
6163
  export { RevisionInfoProps }
5902
6164
  export { SCHEME_COLORS }
5903
6165
  export { SCHEME_COLOR_NAMES }
6166
+ export { SCHEME_COLOR_VALUES }
5904
6167
  export { SHAPE_NAME }
5905
6168
  export { SHAPE_TYPE }
5906
6169
  export { SLDNUMFLDID }
5907
6170
  export { SLIDE_OBJECT_TYPES }
6171
+ export { SYSTEM_COLOR_VALUES }
5908
6172
  export { SchemeColor }
6173
+ export { SchemeColorValue }
5909
6174
  export { SectionProps }
5910
6175
  export { SectionZoomProps }
5911
6176
  export { ShadowProps }
@@ -5957,10 +6222,12 @@ declare namespace PptxGenJS {
5957
6222
  export { TableStyleProps }
5958
6223
  export { TableToSlidesProps }
5959
6224
  export { TextBaseProps }
6225
+ export { TextBodyProps }
5960
6226
  export { TextFieldType }
5961
6227
  export { TextGlowProps }
5962
6228
  export { TextProps }
5963
6229
  export { TextPropsOptions }
6230
+ export { TextRunProps }
5964
6231
  export { TextShapeType }
5965
6232
  export { ThemeColor }
5966
6233
  export { ThemeProps }