@json-to-office/shared 0.22.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,9 +123,80 @@ var GridPositionSchema = Type2.Object(
123
123
  );
124
124
 
125
125
  // src/schemas/slide-content/text.ts
126
+ var TextRunSchema = Type3.Object(
127
+ {
128
+ text: Type3.String({ description: "Run text content" }),
129
+ color: Type3.Optional(
130
+ Type3.String({
131
+ description: "Run color (hex without # or semantic theme name)"
132
+ })
133
+ ),
134
+ bold: Type3.Optional(Type3.Boolean({ description: "Bold run" })),
135
+ fontWeight: Type3.Optional(
136
+ Type3.Integer({
137
+ minimum: 100,
138
+ maximum: 900,
139
+ description: "Per-run weight (100\u2013900). Overrides `bold` when set \u2014 renderer picks the closest embedded variant via CSS font-matching."
140
+ })
141
+ ),
142
+ italic: Type3.Optional(Type3.Boolean({ description: "Italic run" })),
143
+ underline: Type3.Optional(
144
+ Type3.Union([
145
+ Type3.Boolean({ description: "Simple underline toggle" }),
146
+ Type3.Object(
147
+ {
148
+ style: Type3.Optional(
149
+ Type3.Union([
150
+ Type3.Literal("sng"),
151
+ Type3.Literal("dbl"),
152
+ Type3.Literal("dash"),
153
+ Type3.Literal("dotted")
154
+ ])
155
+ ),
156
+ color: Type3.Optional(
157
+ Type3.String({ description: "Underline color (hex)" })
158
+ )
159
+ },
160
+ { additionalProperties: false }
161
+ )
162
+ ])
163
+ ),
164
+ strike: Type3.Optional(Type3.Boolean({ description: "Strikethrough run" })),
165
+ fontSize: Type3.Optional(
166
+ Type3.Number({ minimum: 1, description: "Run font size in points" })
167
+ ),
168
+ fontFace: Type3.Optional(Type3.String({ description: "Run font family" })),
169
+ superscript: Type3.Optional(
170
+ Type3.Boolean({ description: "Render run as superscript" })
171
+ ),
172
+ subscript: Type3.Optional(
173
+ Type3.Boolean({ description: "Render run as subscript" })
174
+ ),
175
+ charSpacing: Type3.Optional(
176
+ Type3.Number({ description: "Character spacing in points" })
177
+ ),
178
+ breakLine: Type3.Optional(
179
+ Type3.Boolean({ description: "Insert line break after this run" })
180
+ )
181
+ },
182
+ {
183
+ description: "A styled text run. Run options override component-level defaults.",
184
+ additionalProperties: false
185
+ }
186
+ );
126
187
  var TextPropsSchema = Type3.Object(
127
188
  {
128
- text: Type3.String({ description: "Text content to display" }),
189
+ text: Type3.Optional(
190
+ Type3.String({
191
+ description: "Text content to display. Mutually exclusive with `runs` \u2014 set exactly one of the two."
192
+ })
193
+ ),
194
+ runs: Type3.Optional(
195
+ Type3.Array(TextRunSchema, {
196
+ minItems: 1,
197
+ description: "Rich text runs with per-run styling, rendered as one text block. Mutually exclusive with `text` \u2014 set exactly one of the two. Component-level props (align, valign, fill, lineSpacing, position\u2026) still apply to the whole block."
198
+ })
199
+ ),
129
200
  x: Type3.Optional(
130
201
  Type3.Union([
131
202
  Type3.Number({ description: "X position in inches" }),
@@ -277,6 +348,13 @@ var TextPropsSchema = Type3.Object(
277
348
  lineSpacing: Type3.Optional(
278
349
  Type3.Number({ description: "Line spacing in points" })
279
350
  ),
351
+ lineSpacingMultiple: Type3.Optional(
352
+ Type3.Number({
353
+ minimum: 0.1,
354
+ maximum: 10,
355
+ description: "Line spacing as a multiple of the font size (e.g. 0.9 = 90%). Takes precedence over lineSpacing."
356
+ })
357
+ ),
280
358
  charSpacing: Type3.Optional(
281
359
  Type3.Number({
282
360
  description: "Character spacing in points (positive = wider, negative = tighter)"
@@ -419,6 +497,10 @@ var ShapeTypeSchema = Type5.Union(
419
497
  Type5.Literal("star5"),
420
498
  Type5.Literal("star6"),
421
499
  Type5.Literal("line"),
500
+ Type5.Literal("arc"),
501
+ Type5.Literal("pie"),
502
+ Type5.Literal("blockArc"),
503
+ Type5.Literal("chord"),
422
504
  Type5.Literal("arrow"),
423
505
  Type5.Literal("chevron"),
424
506
  Type5.Literal("cloud"),
@@ -461,6 +543,130 @@ var TextSegmentSchema = Type5.Object(
461
543
  },
462
544
  { additionalProperties: false }
463
545
  );
546
+ var PATTERN_FILL_PRESETS = [
547
+ "pct5",
548
+ "pct10",
549
+ "pct20",
550
+ "pct25",
551
+ "pct30",
552
+ "pct40",
553
+ "pct50",
554
+ "pct60",
555
+ "pct70",
556
+ "pct75",
557
+ "pct80",
558
+ "pct90",
559
+ "horz",
560
+ "vert",
561
+ "ltHorz",
562
+ "ltVert",
563
+ "dkHorz",
564
+ "dkVert",
565
+ "narHorz",
566
+ "narVert",
567
+ "dashHorz",
568
+ "dashVert",
569
+ "cross",
570
+ "dnDiag",
571
+ "upDiag",
572
+ "ltDnDiag",
573
+ "ltUpDiag",
574
+ "dkDnDiag",
575
+ "dkUpDiag",
576
+ "wdDnDiag",
577
+ "wdUpDiag",
578
+ "dashDnDiag",
579
+ "dashUpDiag",
580
+ "diagCross",
581
+ "smCheck",
582
+ "lgCheck",
583
+ "smGrid",
584
+ "lgGrid",
585
+ "dotGrid",
586
+ "smConfetti",
587
+ "lgConfetti",
588
+ "horzBrick",
589
+ "diagBrick",
590
+ "solidDmnd",
591
+ "openDmnd",
592
+ "dotDmnd",
593
+ "plaid",
594
+ "sphere",
595
+ "weave",
596
+ "divot",
597
+ "shingle",
598
+ "wave",
599
+ "trellis",
600
+ "zigZag"
601
+ ];
602
+ var GradientStopSchema = Type5.Object(
603
+ {
604
+ color: Type5.String({
605
+ description: "Stop color (hex without # or semantic theme name)"
606
+ }),
607
+ pos: Type5.Number({
608
+ minimum: 0,
609
+ maximum: 100,
610
+ description: "Stop position along the gradient (0-100)"
611
+ }),
612
+ transparency: Type5.Optional(
613
+ Type5.Number({
614
+ minimum: 0,
615
+ maximum: 100,
616
+ description: "Stop transparency (0-100)"
617
+ })
618
+ )
619
+ },
620
+ { additionalProperties: false, description: "Gradient color stop" }
621
+ );
622
+ var GradientFillSchema = Type5.Object(
623
+ {
624
+ type: Type5.Union([Type5.Literal("linear"), Type5.Literal("radial")], {
625
+ description: "Gradient type"
626
+ }),
627
+ angle: Type5.Optional(
628
+ Type5.Number({
629
+ minimum: 0,
630
+ maximum: 360,
631
+ description: "Gradient angle in degrees for linear gradients (0 = left\u2192right, 90 = top\u2192bottom). Default: 0."
632
+ })
633
+ ),
634
+ stops: Type5.Array(GradientStopSchema, {
635
+ minItems: 2,
636
+ description: "Gradient color stops (at least 2)"
637
+ }),
638
+ focus: Type5.Optional(
639
+ Type5.Union(
640
+ [
641
+ Type5.Literal("center"),
642
+ Type5.Literal("topLeft"),
643
+ Type5.Literal("topRight"),
644
+ Type5.Literal("bottomLeft"),
645
+ Type5.Literal("bottomRight")
646
+ ],
647
+ {
648
+ description: 'Focus point for radial gradients (default: "center")'
649
+ }
650
+ )
651
+ )
652
+ },
653
+ { additionalProperties: false, description: "Gradient fill configuration" }
654
+ );
655
+ var PatternFillSchema = Type5.Object(
656
+ {
657
+ preset: Type5.Union(
658
+ PATTERN_FILL_PRESETS.map((p) => Type5.Literal(p)),
659
+ { description: "OOXML pattern preset name (a:pattFill prst value)" }
660
+ ),
661
+ foreground: Type5.String({
662
+ description: "Pattern foreground color (hex without # or semantic name)"
663
+ }),
664
+ background: Type5.String({
665
+ description: "Pattern background color (hex without # or semantic name)"
666
+ })
667
+ },
668
+ { additionalProperties: false, description: "Pattern fill configuration" }
669
+ );
464
670
  var ShapePropsSchema = Type5.Object(
465
671
  {
466
672
  type: ShapeTypeSchema,
@@ -503,14 +709,18 @@ var ShapePropsSchema = Type5.Object(
503
709
  fill: Type5.Optional(
504
710
  Type5.Object(
505
711
  {
506
- color: Type5.String({ description: "Fill color (hex without #)" }),
712
+ color: Type5.Optional(
713
+ Type5.String({ description: "Fill color (hex without #)" })
714
+ ),
507
715
  transparency: Type5.Optional(
508
716
  Type5.Number({
509
717
  minimum: 0,
510
718
  maximum: 100,
511
719
  description: "Fill transparency (0-100)"
512
720
  })
513
- )
721
+ ),
722
+ gradient: Type5.Optional(GradientFillSchema),
723
+ pattern: Type5.Optional(PatternFillSchema)
514
724
  },
515
725
  { additionalProperties: false }
516
726
  )
@@ -573,6 +783,19 @@ var ShapePropsSchema = Type5.Object(
573
783
  rotate: Type5.Optional(
574
784
  Type5.Number({ description: "Rotation angle in degrees" })
575
785
  ),
786
+ angleRange: Type5.Optional(
787
+ Type5.Array(Type5.Number(), {
788
+ minItems: 2,
789
+ maxItems: 2,
790
+ description: "Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)"
791
+ })
792
+ ),
793
+ flipH: Type5.Optional(
794
+ Type5.Boolean({ description: "Flip shape horizontally" })
795
+ ),
796
+ flipV: Type5.Optional(
797
+ Type5.Boolean({ description: "Flip shape vertically" })
798
+ ),
576
799
  shadow: Type5.Optional(ShadowSchema),
577
800
  rectRadius: Type5.Optional(
578
801
  Type5.Number({
@@ -870,6 +1093,28 @@ var ChartDataSeriesSchema = Type8.Object(
870
1093
  },
871
1094
  { additionalProperties: false }
872
1095
  );
1096
+ var ChartGridLineSchema = Type8.Object(
1097
+ {
1098
+ style: Type8.Optional(
1099
+ Type8.Union(
1100
+ [
1101
+ Type8.Literal("solid"),
1102
+ Type8.Literal("dash"),
1103
+ Type8.Literal("dot"),
1104
+ Type8.Literal("none")
1105
+ ],
1106
+ { description: "Grid line style" }
1107
+ )
1108
+ ),
1109
+ size: Type8.Optional(
1110
+ Type8.Number({ minimum: 0, description: "Grid line width (points)" })
1111
+ ),
1112
+ color: Type8.Optional(
1113
+ Type8.String({ description: "Grid line color (hex or semantic)" })
1114
+ )
1115
+ },
1116
+ { additionalProperties: false, description: "Axis grid line styling" }
1117
+ );
873
1118
  var PptxChartPropsSchema = Type8.Object(
874
1119
  {
875
1120
  type: ChartTypeSchema,
@@ -909,6 +1154,24 @@ var PptxChartPropsSchema = Type8.Object(
909
1154
  description: "Series colors (hex or semantic theme names). Defaults to theme palette."
910
1155
  })
911
1156
  ),
1157
+ // Data element border (bars/slices/areas)
1158
+ dataBorder: Type8.Optional(
1159
+ Type8.Object(
1160
+ {
1161
+ pt: Type8.Number({
1162
+ minimum: 0,
1163
+ description: "Border width (points)"
1164
+ }),
1165
+ color: Type8.String({
1166
+ description: "Border color (hex or semantic)"
1167
+ })
1168
+ },
1169
+ {
1170
+ additionalProperties: false,
1171
+ description: "Outline on data elements (bars, slices, areas)"
1172
+ }
1173
+ )
1174
+ ),
912
1175
  // Legend
913
1176
  legendPos: Type8.Optional(
914
1177
  Type8.Union(
@@ -949,6 +1212,10 @@ var PptxChartPropsSchema = Type8.Object(
949
1212
  description: "Category axis label color (hex or semantic)"
950
1213
  })
951
1214
  ),
1215
+ catAxisLabelFontFace: Type8.Optional(
1216
+ Type8.String({ description: "Category axis label font face" })
1217
+ ),
1218
+ catGridLine: Type8.Optional(ChartGridLineSchema),
952
1219
  // Value axis
953
1220
  valAxisTitle: Type8.Optional(
954
1221
  Type8.String({ description: "Value axis title" })
@@ -973,6 +1240,19 @@ var PptxChartPropsSchema = Type8.Object(
973
1240
  valAxisLabelColor: Type8.Optional(
974
1241
  Type8.String({ description: "Value axis label color (hex or semantic)" })
975
1242
  ),
1243
+ valAxisLabelFontFace: Type8.Optional(
1244
+ Type8.String({ description: "Value axis label font face" })
1245
+ ),
1246
+ valAxisLabelFontSize: Type8.Optional(
1247
+ Type8.Number({ description: "Value axis label font size" })
1248
+ ),
1249
+ valGridLine: Type8.Optional(ChartGridLineSchema),
1250
+ catAxisLineShow: Type8.Optional(
1251
+ Type8.Boolean({ description: "Show the category axis line" })
1252
+ ),
1253
+ valAxisLineShow: Type8.Optional(
1254
+ Type8.Boolean({ description: "Show the value axis line" })
1255
+ ),
976
1256
  // Bar-specific
977
1257
  barDir: Type8.Optional(
978
1258
  Type8.Union([Type8.Literal("bar"), Type8.Literal("col")], {
@@ -996,6 +1276,13 @@ var PptxChartPropsSchema = Type8.Object(
996
1276
  description: "Bar gap width (0-500%)"
997
1277
  })
998
1278
  ),
1279
+ barOverlapPct: Type8.Optional(
1280
+ Type8.Number({
1281
+ minimum: -100,
1282
+ maximum: 100,
1283
+ description: "Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap."
1284
+ })
1285
+ ),
999
1286
  // Line-specific
1000
1287
  lineSmooth: Type8.Optional(Type8.Boolean({ description: "Smooth lines" })),
1001
1288
  lineDataSymbol: Type8.Optional(
@@ -1015,6 +1302,13 @@ var PptxChartPropsSchema = Type8.Object(
1015
1302
  lineSize: Type8.Optional(
1016
1303
  Type8.Number({ description: "Line width (points)" })
1017
1304
  ),
1305
+ lineDataSymbolSize: Type8.Optional(
1306
+ Type8.Number({
1307
+ minimum: 2,
1308
+ maximum: 72,
1309
+ description: "Line data point marker size (points)"
1310
+ })
1311
+ ),
1018
1312
  // Pie/doughnut-specific
1019
1313
  firstSliceAng: Type8.Optional(
1020
1314
  Type8.Number({
@@ -1160,8 +1454,12 @@ var PptxSlideContentSchema = Type9.Union(
1160
1454
  );
1161
1455
  export {
1162
1456
  ColorValueSchema,
1457
+ GradientFillSchema,
1458
+ GradientStopSchema,
1163
1459
  GridPositionSchema,
1460
+ PATTERN_FILL_PRESETS,
1164
1461
  PPTX_SLIDE_CONTENT_COMPONENTS,
1462
+ PatternFillSchema,
1165
1463
  PptxAlignmentSchema,
1166
1464
  PptxChartPropsSchema,
1167
1465
  PptxHighchartsPropsSchema,
@@ -1176,6 +1474,7 @@ export {
1176
1474
  ShapeTypeSchema,
1177
1475
  StyleNameSchema,
1178
1476
  TextPropsSchema,
1477
+ TextRunSchema,
1179
1478
  TextSegmentSchema,
1180
1479
  VerticalAlignmentSchema
1181
1480
  };