@json-to-office/shared-pptx 0.3.0 → 0.8.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.
@@ -0,0 +1,982 @@
1
+ // src/schemas/component-defaults.ts
2
+ import { Type as Type9 } from "@sinclair/typebox";
3
+
4
+ // src/schemas/components/text.ts
5
+ import { Type as Type3 } from "@sinclair/typebox";
6
+
7
+ // src/schemas/components/common.ts
8
+ import { Type as Type2 } from "@sinclair/typebox";
9
+
10
+ // src/schemas/theme.ts
11
+ import { Type } from "@sinclair/typebox";
12
+ var GridMarginSchema = Type.Union(
13
+ [
14
+ Type.Number({ description: "Margin in inches (all sides)" }),
15
+ Type.Object(
16
+ {
17
+ top: Type.Number({ description: "Top margin in inches" }),
18
+ right: Type.Number({ description: "Right margin in inches" }),
19
+ bottom: Type.Number({ description: "Bottom margin in inches" }),
20
+ left: Type.Number({ description: "Left margin in inches" })
21
+ },
22
+ { additionalProperties: false }
23
+ )
24
+ ],
25
+ { description: "Slide margins in inches" }
26
+ );
27
+ var GridGutterSchema = Type.Union(
28
+ [
29
+ Type.Number({ description: "Gutter in inches (both axes)" }),
30
+ Type.Object(
31
+ {
32
+ column: Type.Number({ description: "Column gutter in inches" }),
33
+ row: Type.Number({ description: "Row gutter in inches" })
34
+ },
35
+ { additionalProperties: false }
36
+ )
37
+ ],
38
+ { description: "Gaps between grid tracks in inches" }
39
+ );
40
+ var GridConfigSchema = Type.Object(
41
+ {
42
+ columns: Type.Optional(Type.Number({ minimum: 1, description: "Number of columns (default: 12)" })),
43
+ rows: Type.Optional(Type.Number({ minimum: 1, description: "Number of rows (default: 6)" })),
44
+ margin: Type.Optional(GridMarginSchema),
45
+ gutter: Type.Optional(GridGutterSchema)
46
+ },
47
+ { additionalProperties: false, description: "Grid layout configuration" }
48
+ );
49
+ var HexColorSchema = Type.String({ pattern: "^#?[0-9A-Fa-f]{6}$", description: "Hex color (e.g. #FF0000)" });
50
+ var SEMANTIC_COLOR_NAMES = [
51
+ "primary",
52
+ "secondary",
53
+ "accent",
54
+ "background",
55
+ "text",
56
+ "text2",
57
+ "background2",
58
+ "accent4",
59
+ "accent5",
60
+ "accent6"
61
+ ];
62
+ var SEMANTIC_COLOR_ALIASES = [
63
+ "accent1",
64
+ "accent2",
65
+ "accent3",
66
+ "tx1",
67
+ "tx2",
68
+ "bg1",
69
+ "bg2"
70
+ ];
71
+ var ColorValueSchema = Type.Union([
72
+ HexColorSchema,
73
+ ...SEMANTIC_COLOR_NAMES.map((n) => Type.Literal(n)),
74
+ ...SEMANTIC_COLOR_ALIASES.map((n) => Type.Literal(n))
75
+ ], { description: "Hex color or semantic theme color name" });
76
+ var STYLE_NAMES = [
77
+ "title",
78
+ "subtitle",
79
+ "heading1",
80
+ "heading2",
81
+ "heading3",
82
+ "body",
83
+ "caption"
84
+ ];
85
+ var StyleNameSchema = Type.Union(
86
+ STYLE_NAMES.map((n) => Type.Literal(n)),
87
+ { description: "Predefined style name" }
88
+ );
89
+ var TextStyleSchema = Type.Object({
90
+ fontSize: Type.Optional(Type.Number()),
91
+ fontFace: Type.Optional(Type.String()),
92
+ fontColor: Type.Optional(ColorValueSchema),
93
+ bold: Type.Optional(Type.Boolean()),
94
+ italic: Type.Optional(Type.Boolean()),
95
+ align: Type.Optional(Type.Union([
96
+ Type.Literal("left"),
97
+ Type.Literal("center"),
98
+ Type.Literal("right"),
99
+ Type.Literal("justify")
100
+ ])),
101
+ lineSpacing: Type.Optional(Type.Number()),
102
+ charSpacing: Type.Optional(Type.Number()),
103
+ paraSpaceAfter: Type.Optional(Type.Number())
104
+ }, { additionalProperties: false, description: "Text style preset" });
105
+ var ThemeConfigSchema = Type.Object(
106
+ {
107
+ name: Type.String({ description: "Theme name" }),
108
+ colors: Type.Object(
109
+ {
110
+ primary: HexColorSchema,
111
+ secondary: HexColorSchema,
112
+ accent: HexColorSchema,
113
+ background: HexColorSchema,
114
+ text: HexColorSchema,
115
+ text2: Type.Optional(HexColorSchema),
116
+ background2: Type.Optional(HexColorSchema),
117
+ accent4: Type.Optional(HexColorSchema),
118
+ accent5: Type.Optional(HexColorSchema),
119
+ accent6: Type.Optional(HexColorSchema)
120
+ },
121
+ { additionalProperties: false, description: "Theme color palette (10-slot scheme)" }
122
+ ),
123
+ fonts: Type.Object(
124
+ {
125
+ heading: Type.String({ description: "Heading font family" }),
126
+ body: Type.String({ description: "Body font family" })
127
+ },
128
+ { additionalProperties: false, description: "Font families" }
129
+ ),
130
+ defaults: Type.Object(
131
+ {
132
+ fontSize: Type.Number({ description: "Default font size in points" }),
133
+ fontColor: HexColorSchema
134
+ },
135
+ { additionalProperties: false, description: "Default text styling" }
136
+ ),
137
+ styles: Type.Optional(Type.Partial(
138
+ Type.Object(Object.fromEntries(
139
+ STYLE_NAMES.map((n) => [n, TextStyleSchema])
140
+ )),
141
+ { additionalProperties: false, description: "Named text style presets" }
142
+ )),
143
+ componentDefaults: Type.Optional(PptxComponentDefaultsSchema)
144
+ },
145
+ { additionalProperties: false, description: "Presentation theme configuration" }
146
+ );
147
+ function isValidThemeConfig(data) {
148
+ return typeof data === "object" && data !== null;
149
+ }
150
+
151
+ // src/schemas/components/common.ts
152
+ var PositionSchema = Type2.Object(
153
+ {
154
+ x: Type2.Optional(
155
+ Type2.Union([
156
+ Type2.Number({ description: "X position in inches" }),
157
+ Type2.String({
158
+ pattern: "^\\d+(\\.\\d+)?%$",
159
+ description: 'X position as percentage (e.g., "10%")'
160
+ })
161
+ ])
162
+ ),
163
+ y: Type2.Optional(
164
+ Type2.Union([
165
+ Type2.Number({ description: "Y position in inches" }),
166
+ Type2.String({
167
+ pattern: "^\\d+(\\.\\d+)?%$",
168
+ description: 'Y position as percentage (e.g., "10%")'
169
+ })
170
+ ])
171
+ ),
172
+ w: Type2.Optional(
173
+ Type2.Union([
174
+ Type2.Number({ description: "Width in inches" }),
175
+ Type2.String({
176
+ pattern: "^\\d+(\\.\\d+)?%$",
177
+ description: 'Width as percentage (e.g., "80%")'
178
+ })
179
+ ])
180
+ ),
181
+ h: Type2.Optional(
182
+ Type2.Union([
183
+ Type2.Number({ description: "Height in inches" }),
184
+ Type2.String({
185
+ pattern: "^\\d+(\\.\\d+)?%$",
186
+ description: 'Height as percentage (e.g., "20%")'
187
+ })
188
+ ])
189
+ )
190
+ },
191
+ {
192
+ description: "Position and size in inches or percentages",
193
+ additionalProperties: false
194
+ }
195
+ );
196
+ var SlideBackgroundSchema = Type2.Object(
197
+ {
198
+ color: Type2.Optional(ColorValueSchema),
199
+ image: Type2.Optional(
200
+ Type2.Object(
201
+ {
202
+ path: Type2.Optional(Type2.String({ description: "Image file path or URL" })),
203
+ base64: Type2.Optional(
204
+ Type2.String({ description: "Base64-encoded image data" })
205
+ )
206
+ },
207
+ { description: "Background image", additionalProperties: false }
208
+ )
209
+ )
210
+ },
211
+ {
212
+ description: "Slide background configuration",
213
+ additionalProperties: false
214
+ }
215
+ );
216
+ var TransitionSchema = Type2.Object(
217
+ {
218
+ type: Type2.Optional(
219
+ Type2.Union(
220
+ [
221
+ Type2.Literal("fade"),
222
+ Type2.Literal("push"),
223
+ Type2.Literal("wipe"),
224
+ Type2.Literal("zoom"),
225
+ Type2.Literal("none")
226
+ ],
227
+ { description: "Transition effect type" }
228
+ )
229
+ ),
230
+ speed: Type2.Optional(
231
+ Type2.Union(
232
+ [Type2.Literal("slow"), Type2.Literal("medium"), Type2.Literal("fast")],
233
+ { description: "Transition speed" }
234
+ )
235
+ )
236
+ },
237
+ {
238
+ description: "Slide transition configuration",
239
+ additionalProperties: false
240
+ }
241
+ );
242
+ var PptxAlignmentSchema = Type2.Union(
243
+ [Type2.Literal("left"), Type2.Literal("center"), Type2.Literal("right")],
244
+ { description: "Horizontal alignment options" }
245
+ );
246
+ var VerticalAlignmentSchema = Type2.Union(
247
+ [Type2.Literal("top"), Type2.Literal("middle"), Type2.Literal("bottom")],
248
+ { description: "Vertical alignment options" }
249
+ );
250
+ var ShadowSchema = Type2.Object(
251
+ {
252
+ type: Type2.Optional(
253
+ Type2.Union([Type2.Literal("outer"), Type2.Literal("inner")], {
254
+ description: "Shadow type"
255
+ })
256
+ ),
257
+ color: Type2.Optional(ColorValueSchema),
258
+ blur: Type2.Optional(Type2.Number({ description: "Shadow blur radius in points" })),
259
+ offset: Type2.Optional(Type2.Number({ description: "Shadow offset in points" })),
260
+ angle: Type2.Optional(Type2.Number({ description: "Shadow angle in degrees" })),
261
+ opacity: Type2.Optional(
262
+ Type2.Number({
263
+ minimum: 0,
264
+ maximum: 1,
265
+ description: "Shadow opacity (0-1)"
266
+ })
267
+ )
268
+ },
269
+ {
270
+ description: "Shadow configuration",
271
+ additionalProperties: false
272
+ }
273
+ );
274
+ var GridPositionSchema = Type2.Object(
275
+ {
276
+ column: Type2.Number({ minimum: 0, description: "Starting column (0-indexed)" }),
277
+ row: Type2.Number({ minimum: 0, description: "Starting row (0-indexed)" }),
278
+ columnSpan: Type2.Optional(Type2.Number({ minimum: 1, description: "Number of columns to span (default: 1)" })),
279
+ rowSpan: Type2.Optional(Type2.Number({ minimum: 1, description: "Number of rows to span (default: 1)" }))
280
+ },
281
+ { additionalProperties: false, description: "Grid-based positioning" }
282
+ );
283
+
284
+ // src/schemas/components/text.ts
285
+ var TextPropsSchema = Type3.Object(
286
+ {
287
+ text: Type3.String({ description: "Text content to display" }),
288
+ x: Type3.Optional(
289
+ Type3.Union([
290
+ Type3.Number({ description: "X position in inches" }),
291
+ Type3.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "X as percentage" })
292
+ ])
293
+ ),
294
+ y: Type3.Optional(
295
+ Type3.Union([
296
+ Type3.Number({ description: "Y position in inches" }),
297
+ Type3.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Y as percentage" })
298
+ ])
299
+ ),
300
+ w: Type3.Optional(
301
+ Type3.Union([
302
+ Type3.Number({ description: "Width in inches" }),
303
+ Type3.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Width as percentage" })
304
+ ])
305
+ ),
306
+ h: Type3.Optional(
307
+ Type3.Union([
308
+ Type3.Number({ description: "Height in inches" }),
309
+ Type3.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Height as percentage" })
310
+ ])
311
+ ),
312
+ fontSize: Type3.Optional(
313
+ Type3.Number({ minimum: 1, description: "Font size in points" })
314
+ ),
315
+ fontFace: Type3.Optional(Type3.String({ description: "Font family name" })),
316
+ color: Type3.Optional(
317
+ Type3.String({ description: 'Text color (hex without #, e.g., "FF0000")' })
318
+ ),
319
+ bold: Type3.Optional(Type3.Boolean({ description: "Bold text" })),
320
+ italic: Type3.Optional(Type3.Boolean({ description: "Italic text" })),
321
+ underline: Type3.Optional(
322
+ Type3.Union([
323
+ Type3.Boolean({ description: "Simple underline toggle" }),
324
+ Type3.Object(
325
+ {
326
+ style: Type3.Optional(
327
+ Type3.Union([
328
+ Type3.Literal("sng"),
329
+ Type3.Literal("dbl"),
330
+ Type3.Literal("dash"),
331
+ Type3.Literal("dotted")
332
+ ])
333
+ ),
334
+ color: Type3.Optional(Type3.String({ description: "Underline color (hex)" }))
335
+ },
336
+ { additionalProperties: false }
337
+ )
338
+ ])
339
+ ),
340
+ strike: Type3.Optional(Type3.Boolean({ description: "Strikethrough text" })),
341
+ align: Type3.Optional(PptxAlignmentSchema),
342
+ valign: Type3.Optional(VerticalAlignmentSchema),
343
+ breakLine: Type3.Optional(
344
+ Type3.Boolean({ description: "Add line break after text" })
345
+ ),
346
+ bullet: Type3.Optional(
347
+ Type3.Union([
348
+ Type3.Boolean({ description: "Enable default bullet" }),
349
+ Type3.Object(
350
+ {
351
+ type: Type3.Optional(
352
+ Type3.Union([Type3.Literal("bullet"), Type3.Literal("number")])
353
+ ),
354
+ style: Type3.Optional(Type3.String({ description: "Bullet character or style" })),
355
+ startAt: Type3.Optional(Type3.Number({ description: "Starting number for numbered lists" }))
356
+ },
357
+ { additionalProperties: false }
358
+ )
359
+ ])
360
+ ),
361
+ margin: Type3.Optional(
362
+ Type3.Union([
363
+ Type3.Number({ description: "Margin in points (all sides)" }),
364
+ Type3.Array(Type3.Number(), {
365
+ description: "Margins as [top, right, bottom, left] in points",
366
+ minItems: 4,
367
+ maxItems: 4
368
+ })
369
+ ])
370
+ ),
371
+ rotate: Type3.Optional(Type3.Number({ description: "Rotation angle in degrees" })),
372
+ shadow: Type3.Optional(ShadowSchema),
373
+ fill: Type3.Optional(
374
+ Type3.Object(
375
+ {
376
+ color: Type3.String({ description: "Fill color (hex without #)" }),
377
+ transparency: Type3.Optional(
378
+ Type3.Number({ minimum: 0, maximum: 100, description: "Fill transparency (0-100)" })
379
+ )
380
+ },
381
+ { additionalProperties: false }
382
+ )
383
+ ),
384
+ hyperlink: Type3.Optional(
385
+ Type3.Object(
386
+ {
387
+ url: Type3.Optional(Type3.String({ description: "Hyperlink URL" })),
388
+ slide: Type3.Optional(Type3.Number({ description: "Slide number to link to" })),
389
+ tooltip: Type3.Optional(Type3.String({ description: "Hyperlink tooltip" }))
390
+ },
391
+ { additionalProperties: false }
392
+ )
393
+ ),
394
+ lineSpacing: Type3.Optional(Type3.Number({ description: "Line spacing in points" })),
395
+ charSpacing: Type3.Optional(Type3.Number({ description: "Character spacing in points (positive = wider, negative = tighter)" })),
396
+ paraSpaceBefore: Type3.Optional(Type3.Number({ description: "Space before paragraph in points" })),
397
+ paraSpaceAfter: Type3.Optional(Type3.Number({ description: "Space after paragraph in points" })),
398
+ grid: Type3.Optional(GridPositionSchema),
399
+ style: Type3.Optional(StyleNameSchema)
400
+ },
401
+ {
402
+ description: "Text component props",
403
+ additionalProperties: false
404
+ }
405
+ );
406
+
407
+ // src/schemas/components/image.ts
408
+ import { Type as Type4 } from "@sinclair/typebox";
409
+ var PptxImagePropsSchema = Type4.Object(
410
+ {
411
+ path: Type4.Optional(
412
+ Type4.String({
413
+ description: "Image file path or URL (mutually exclusive with base64)"
414
+ })
415
+ ),
416
+ base64: Type4.Optional(
417
+ Type4.String({
418
+ description: "Base64-encoded image data in data URI format (mutually exclusive with path)"
419
+ })
420
+ ),
421
+ x: Type4.Optional(
422
+ Type4.Union([
423
+ Type4.Number({ description: "X position in inches" }),
424
+ Type4.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "X as percentage" })
425
+ ])
426
+ ),
427
+ y: Type4.Optional(
428
+ Type4.Union([
429
+ Type4.Number({ description: "Y position in inches" }),
430
+ Type4.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Y as percentage" })
431
+ ])
432
+ ),
433
+ w: Type4.Optional(
434
+ Type4.Union([
435
+ Type4.Number({ description: "Width in inches" }),
436
+ Type4.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Width as percentage" })
437
+ ])
438
+ ),
439
+ h: Type4.Optional(
440
+ Type4.Union([
441
+ Type4.Number({ description: "Height in inches" }),
442
+ Type4.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Height as percentage" })
443
+ ])
444
+ ),
445
+ sizing: Type4.Optional(
446
+ Type4.Object(
447
+ {
448
+ type: Type4.Union(
449
+ [
450
+ Type4.Literal("contain"),
451
+ Type4.Literal("cover"),
452
+ Type4.Literal("crop")
453
+ ],
454
+ { description: "Image sizing strategy" }
455
+ ),
456
+ w: Type4.Optional(Type4.Number({ description: "Target width in inches" })),
457
+ h: Type4.Optional(Type4.Number({ description: "Target height in inches" }))
458
+ },
459
+ { description: "Image sizing options", additionalProperties: false }
460
+ )
461
+ ),
462
+ rotate: Type4.Optional(
463
+ Type4.Number({ description: "Rotation angle in degrees" })
464
+ ),
465
+ rounding: Type4.Optional(
466
+ Type4.Boolean({ description: "Apply rounded corners to image" })
467
+ ),
468
+ shadow: Type4.Optional(ShadowSchema),
469
+ hyperlink: Type4.Optional(
470
+ Type4.Object(
471
+ {
472
+ url: Type4.Optional(Type4.String({ description: "Hyperlink URL" })),
473
+ slide: Type4.Optional(Type4.Number({ description: "Slide number to link to" })),
474
+ tooltip: Type4.Optional(Type4.String({ description: "Hyperlink tooltip" }))
475
+ },
476
+ { additionalProperties: false }
477
+ )
478
+ ),
479
+ alt: Type4.Optional(
480
+ Type4.String({ description: "Alternative text for accessibility" })
481
+ ),
482
+ grid: Type4.Optional(GridPositionSchema)
483
+ },
484
+ {
485
+ description: "PPTX image component props",
486
+ additionalProperties: false
487
+ }
488
+ );
489
+
490
+ // src/schemas/components/shape.ts
491
+ import { Type as Type5 } from "@sinclair/typebox";
492
+ var ShapeTypeSchema = Type5.Union(
493
+ [
494
+ Type5.Literal("rect"),
495
+ Type5.Literal("roundRect"),
496
+ Type5.Literal("ellipse"),
497
+ Type5.Literal("triangle"),
498
+ Type5.Literal("diamond"),
499
+ Type5.Literal("pentagon"),
500
+ Type5.Literal("hexagon"),
501
+ Type5.Literal("star5"),
502
+ Type5.Literal("star6"),
503
+ Type5.Literal("line"),
504
+ Type5.Literal("arrow"),
505
+ Type5.Literal("chevron"),
506
+ Type5.Literal("cloud"),
507
+ Type5.Literal("heart"),
508
+ Type5.Literal("lightning")
509
+ ],
510
+ { description: "Shape type" }
511
+ );
512
+ var TextSegmentSchema = Type5.Object(
513
+ {
514
+ text: Type5.String(),
515
+ fontSize: Type5.Optional(Type5.Number({ minimum: 1 })),
516
+ fontFace: Type5.Optional(Type5.String()),
517
+ color: Type5.Optional(Type5.String({ description: "Segment color (hex without # or semantic name)" })),
518
+ bold: Type5.Optional(Type5.Boolean()),
519
+ italic: Type5.Optional(Type5.Boolean()),
520
+ breakLine: Type5.Optional(Type5.Boolean({ description: "Insert line break after this segment" })),
521
+ spaceBefore: Type5.Optional(Type5.Number({ minimum: 0, description: "Space before paragraph in points" })),
522
+ spaceAfter: Type5.Optional(Type5.Number({ minimum: 0, description: "Space after paragraph in points" })),
523
+ charSpacing: Type5.Optional(Type5.Number({ description: "Character spacing in points" }))
524
+ },
525
+ { additionalProperties: false }
526
+ );
527
+ var ShapePropsSchema = Type5.Object(
528
+ {
529
+ type: ShapeTypeSchema,
530
+ x: Type5.Optional(
531
+ Type5.Union([
532
+ Type5.Number({ description: "X position in inches" }),
533
+ Type5.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "X as percentage" })
534
+ ])
535
+ ),
536
+ y: Type5.Optional(
537
+ Type5.Union([
538
+ Type5.Number({ description: "Y position in inches" }),
539
+ Type5.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Y as percentage" })
540
+ ])
541
+ ),
542
+ w: Type5.Optional(
543
+ Type5.Union([
544
+ Type5.Number({ description: "Width in inches" }),
545
+ Type5.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Width as percentage" })
546
+ ])
547
+ ),
548
+ h: Type5.Optional(
549
+ Type5.Union([
550
+ Type5.Number({ description: "Height in inches" }),
551
+ Type5.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Height as percentage" })
552
+ ])
553
+ ),
554
+ fill: Type5.Optional(
555
+ Type5.Object(
556
+ {
557
+ color: Type5.String({ description: "Fill color (hex without #)" }),
558
+ transparency: Type5.Optional(
559
+ Type5.Number({ minimum: 0, maximum: 100, description: "Fill transparency (0-100)" })
560
+ )
561
+ },
562
+ { additionalProperties: false }
563
+ )
564
+ ),
565
+ line: Type5.Optional(
566
+ Type5.Object(
567
+ {
568
+ color: Type5.Optional(Type5.String({ description: "Line color (hex without #)" })),
569
+ width: Type5.Optional(Type5.Number({ minimum: 0, description: "Line width in points" })),
570
+ dashType: Type5.Optional(
571
+ Type5.Union([
572
+ Type5.Literal("solid"),
573
+ Type5.Literal("dash"),
574
+ Type5.Literal("dot"),
575
+ Type5.Literal("dashDot")
576
+ ])
577
+ )
578
+ },
579
+ { additionalProperties: false }
580
+ )
581
+ ),
582
+ text: Type5.Optional(Type5.Union([
583
+ Type5.String({ description: "Plain text" }),
584
+ Type5.Array(TextSegmentSchema, { description: "Rich text segments with per-segment formatting" })
585
+ ], { description: "Text content inside the shape" })),
586
+ fontSize: Type5.Optional(Type5.Number({ minimum: 1, description: "Font size for shape text" })),
587
+ fontFace: Type5.Optional(Type5.String({ description: "Font family for shape text" })),
588
+ fontColor: Type5.Optional(Type5.String({ description: "Font color for shape text (hex without #)" })),
589
+ charSpacing: Type5.Optional(Type5.Number({ description: "Character spacing in points for shape text" })),
590
+ bold: Type5.Optional(Type5.Boolean({ description: "Bold shape text" })),
591
+ italic: Type5.Optional(Type5.Boolean({ description: "Italic shape text" })),
592
+ align: Type5.Optional(PptxAlignmentSchema),
593
+ valign: Type5.Optional(VerticalAlignmentSchema),
594
+ rotate: Type5.Optional(Type5.Number({ description: "Rotation angle in degrees" })),
595
+ shadow: Type5.Optional(ShadowSchema),
596
+ rectRadius: Type5.Optional(
597
+ Type5.Number({
598
+ minimum: 0,
599
+ description: "Corner radius for roundRect shape in inches"
600
+ })
601
+ ),
602
+ grid: Type5.Optional(GridPositionSchema),
603
+ style: Type5.Optional(StyleNameSchema)
604
+ },
605
+ {
606
+ description: "Shape component props",
607
+ additionalProperties: false
608
+ }
609
+ );
610
+
611
+ // src/schemas/components/table.ts
612
+ import { Type as Type6 } from "@sinclair/typebox";
613
+ var PptxTableCellSchema = Type6.Union([
614
+ Type6.String({ description: "Simple text cell" }),
615
+ Type6.Object(
616
+ {
617
+ text: Type6.String({ description: "Cell text content" }),
618
+ color: Type6.Optional(Type6.String({ description: "Text color (hex without #)" })),
619
+ fill: Type6.Optional(Type6.String({ description: "Cell background color (hex without #)" })),
620
+ fontSize: Type6.Optional(Type6.Number({ description: "Font size in points" })),
621
+ fontFace: Type6.Optional(Type6.String({ description: "Font family" })),
622
+ bold: Type6.Optional(Type6.Boolean({ description: "Bold text" })),
623
+ italic: Type6.Optional(Type6.Boolean({ description: "Italic text" })),
624
+ align: Type6.Optional(PptxAlignmentSchema),
625
+ valign: Type6.Optional(VerticalAlignmentSchema),
626
+ colspan: Type6.Optional(Type6.Number({ minimum: 1, description: "Column span" })),
627
+ rowspan: Type6.Optional(Type6.Number({ minimum: 1, description: "Row span" })),
628
+ margin: Type6.Optional(
629
+ Type6.Union([
630
+ Type6.Number({ description: "Margin in points (all sides)" }),
631
+ Type6.Array(Type6.Number(), { minItems: 4, maxItems: 4 })
632
+ ])
633
+ )
634
+ },
635
+ { additionalProperties: false }
636
+ )
637
+ ]);
638
+ var PptxTablePropsSchema = Type6.Object(
639
+ {
640
+ rows: Type6.Array(
641
+ Type6.Array(PptxTableCellSchema, { description: "Row of cells" }),
642
+ { description: "Table rows (array of arrays)", minItems: 1 }
643
+ ),
644
+ x: Type6.Optional(
645
+ Type6.Union([
646
+ Type6.Number({ description: "X position in inches" }),
647
+ Type6.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "X as percentage" })
648
+ ])
649
+ ),
650
+ y: Type6.Optional(
651
+ Type6.Union([
652
+ Type6.Number({ description: "Y position in inches" }),
653
+ Type6.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Y as percentage" })
654
+ ])
655
+ ),
656
+ w: Type6.Optional(
657
+ Type6.Union([
658
+ Type6.Number({ description: "Width in inches" }),
659
+ Type6.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Width as percentage" })
660
+ ])
661
+ ),
662
+ h: Type6.Optional(
663
+ Type6.Union([
664
+ Type6.Number({ description: "Height in inches" }),
665
+ Type6.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Height as percentage" })
666
+ ])
667
+ ),
668
+ colW: Type6.Optional(
669
+ Type6.Union([
670
+ Type6.Number({ description: "Uniform column width in inches" }),
671
+ Type6.Array(Type6.Number(), { description: "Individual column widths in inches" })
672
+ ])
673
+ ),
674
+ rowH: Type6.Optional(
675
+ Type6.Union([
676
+ Type6.Number({ description: "Uniform row height in inches" }),
677
+ Type6.Array(Type6.Number(), { description: "Individual row heights in inches" })
678
+ ])
679
+ ),
680
+ border: Type6.Optional(
681
+ Type6.Object(
682
+ {
683
+ type: Type6.Optional(
684
+ Type6.Union([
685
+ Type6.Literal("solid"),
686
+ Type6.Literal("dash"),
687
+ Type6.Literal("dot"),
688
+ Type6.Literal("none")
689
+ ])
690
+ ),
691
+ pt: Type6.Optional(Type6.Number({ minimum: 0, description: "Border width in points" })),
692
+ color: Type6.Optional(Type6.String({ description: "Border color (hex without #)" }))
693
+ },
694
+ { additionalProperties: false }
695
+ )
696
+ ),
697
+ fill: Type6.Optional(Type6.String({ description: "Table background color (hex without #)" })),
698
+ fontSize: Type6.Optional(Type6.Number({ minimum: 1, description: "Default font size for all cells" })),
699
+ fontFace: Type6.Optional(Type6.String({ description: "Default font family for all cells" })),
700
+ color: Type6.Optional(Type6.String({ description: "Default text color for all cells (hex without #)" })),
701
+ align: Type6.Optional(PptxAlignmentSchema),
702
+ valign: Type6.Optional(VerticalAlignmentSchema),
703
+ autoPage: Type6.Optional(
704
+ Type6.Boolean({ description: "Auto-paginate table across multiple slides when content overflows" })
705
+ ),
706
+ autoPageRepeatHeader: Type6.Optional(
707
+ Type6.Boolean({ description: "Repeat first row as header on each auto-paged slide" })
708
+ ),
709
+ margin: Type6.Optional(
710
+ Type6.Union([
711
+ Type6.Number({ description: "Cell margin in points (all sides)" }),
712
+ Type6.Array(Type6.Number(), { minItems: 4, maxItems: 4 })
713
+ ])
714
+ ),
715
+ borderRadius: Type6.Optional(
716
+ Type6.Number({ minimum: 0, description: "Rounded corner radius in inches. Renders a roundRect shape behind the table." })
717
+ ),
718
+ grid: Type6.Optional(GridPositionSchema)
719
+ },
720
+ {
721
+ description: "PPTX table component props",
722
+ additionalProperties: false
723
+ }
724
+ );
725
+
726
+ // src/schemas/components/highcharts.ts
727
+ import { Type as Type7 } from "@sinclair/typebox";
728
+ var PptxHighchartsPropsSchema = Type7.Object(
729
+ {
730
+ options: Type7.Intersect([
731
+ Type7.Record(Type7.String(), Type7.Unknown()),
732
+ Type7.Object({
733
+ chart: Type7.Object({
734
+ width: Type7.Number(),
735
+ height: Type7.Number()
736
+ })
737
+ })
738
+ ]),
739
+ scale: Type7.Optional(Type7.Number()),
740
+ serverUrl: Type7.Optional(Type7.String({ description: "Highcharts Export Server URL (default: http://localhost:7801)" })),
741
+ x: Type7.Optional(
742
+ Type7.Union([
743
+ Type7.Number({ description: "X position in inches" }),
744
+ Type7.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "X as percentage" })
745
+ ])
746
+ ),
747
+ y: Type7.Optional(
748
+ Type7.Union([
749
+ Type7.Number({ description: "Y position in inches" }),
750
+ Type7.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Y as percentage" })
751
+ ])
752
+ ),
753
+ w: Type7.Optional(
754
+ Type7.Union([
755
+ Type7.Number({ description: "Width in inches" }),
756
+ Type7.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Width as percentage" })
757
+ ])
758
+ ),
759
+ h: Type7.Optional(
760
+ Type7.Union([
761
+ Type7.Number({ description: "Height in inches" }),
762
+ Type7.String({ pattern: "^\\d+(\\.\\d+)?%$", description: "Height as percentage" })
763
+ ])
764
+ ),
765
+ grid: Type7.Optional(GridPositionSchema)
766
+ },
767
+ {
768
+ description: "PPTX Highcharts component props",
769
+ additionalProperties: false
770
+ }
771
+ );
772
+
773
+ // src/schemas/components/chart.ts
774
+ import { Type as Type8 } from "@sinclair/typebox";
775
+ var PositionValue = Type8.Union([
776
+ Type8.Number(),
777
+ Type8.String({ pattern: "^\\d+(\\.\\d+)?%$" })
778
+ ]);
779
+ var ChartTypeSchema = Type8.Union(
780
+ [
781
+ Type8.Literal("area"),
782
+ Type8.Literal("bar"),
783
+ Type8.Literal("bar3D"),
784
+ Type8.Literal("bubble"),
785
+ Type8.Literal("doughnut"),
786
+ Type8.Literal("line"),
787
+ Type8.Literal("pie"),
788
+ Type8.Literal("radar"),
789
+ Type8.Literal("scatter")
790
+ ],
791
+ { description: "Chart type" }
792
+ );
793
+ var ChartDataSeriesSchema = Type8.Object(
794
+ {
795
+ name: Type8.Optional(Type8.String({ description: "Series name" })),
796
+ labels: Type8.Optional(Type8.Array(Type8.String(), { description: "Category labels" })),
797
+ values: Type8.Optional(Type8.Array(Type8.Number(), { description: "Data values" })),
798
+ sizes: Type8.Optional(Type8.Array(Type8.Number(), { description: "Bubble sizes (bubble charts only)" }))
799
+ },
800
+ { additionalProperties: false }
801
+ );
802
+ var PptxChartPropsSchema = Type8.Object(
803
+ {
804
+ type: ChartTypeSchema,
805
+ data: Type8.Array(ChartDataSeriesSchema, {
806
+ description: "Chart data series",
807
+ minItems: 1
808
+ }),
809
+ // Display toggles
810
+ showLegend: Type8.Optional(Type8.Boolean({ description: "Show chart legend" })),
811
+ showTitle: Type8.Optional(Type8.Boolean({ description: "Show chart title" })),
812
+ showValue: Type8.Optional(Type8.Boolean({ description: "Show data values" })),
813
+ showPercent: Type8.Optional(Type8.Boolean({ description: "Show percentages (pie/doughnut)" })),
814
+ showLabel: Type8.Optional(Type8.Boolean({ description: "Show category labels on data points" })),
815
+ showSerName: Type8.Optional(Type8.Boolean({ description: "Show series name on data points" })),
816
+ // Title
817
+ title: Type8.Optional(Type8.String({ description: "Chart title text" })),
818
+ titleFontSize: Type8.Optional(Type8.Number({ description: "Title font size (points)" })),
819
+ titleColor: Type8.Optional(Type8.String({ description: "Title color (hex or semantic)" })),
820
+ titleFontFace: Type8.Optional(Type8.String({ description: "Title font face" })),
821
+ // Chart colors
822
+ chartColors: Type8.Optional(
823
+ Type8.Array(Type8.String(), {
824
+ description: "Series colors (hex or semantic theme names). Defaults to theme palette."
825
+ })
826
+ ),
827
+ // Legend
828
+ legendPos: Type8.Optional(
829
+ Type8.Union(
830
+ [Type8.Literal("b"), Type8.Literal("l"), Type8.Literal("r"), Type8.Literal("t"), Type8.Literal("tr")],
831
+ { description: "Legend position" }
832
+ )
833
+ ),
834
+ legendFontSize: Type8.Optional(Type8.Number({ description: "Legend font size" })),
835
+ legendFontFace: Type8.Optional(Type8.String({ description: "Legend font face" })),
836
+ legendColor: Type8.Optional(Type8.String({ description: "Legend text color" })),
837
+ // Category axis
838
+ catAxisTitle: Type8.Optional(Type8.String({ description: "Category axis title" })),
839
+ catAxisHidden: Type8.Optional(Type8.Boolean({ description: "Hide category axis" })),
840
+ catAxisLabelRotate: Type8.Optional(Type8.Number({ description: "Category axis label rotation (degrees)" })),
841
+ catAxisLabelFontSize: Type8.Optional(Type8.Number({ description: "Category axis label font size" })),
842
+ catAxisLabelColor: Type8.Optional(Type8.String({ description: "Category axis label color (hex or semantic)" })),
843
+ // Value axis
844
+ valAxisTitle: Type8.Optional(Type8.String({ description: "Value axis title" })),
845
+ valAxisHidden: Type8.Optional(Type8.Boolean({ description: "Hide value axis" })),
846
+ valAxisMinVal: Type8.Optional(Type8.Number({ description: "Value axis minimum" })),
847
+ valAxisMaxVal: Type8.Optional(Type8.Number({ description: "Value axis maximum" })),
848
+ valAxisLabelFormatCode: Type8.Optional(Type8.String({ description: 'Value axis label format (e.g. "$0.00", "#%")' })),
849
+ valAxisMajorUnit: Type8.Optional(Type8.Number({ description: "Value axis major unit / tick interval" })),
850
+ valAxisLabelColor: Type8.Optional(Type8.String({ description: "Value axis label color (hex or semantic)" })),
851
+ // Bar-specific
852
+ barDir: Type8.Optional(
853
+ Type8.Union([Type8.Literal("bar"), Type8.Literal("col")], {
854
+ description: 'Bar direction: "bar" (horizontal) or "col" (vertical, default)'
855
+ })
856
+ ),
857
+ barGrouping: Type8.Optional(
858
+ Type8.Union(
859
+ [Type8.Literal("clustered"), Type8.Literal("stacked"), Type8.Literal("percentStacked")],
860
+ { description: "Bar grouping style" }
861
+ )
862
+ ),
863
+ barGapWidthPct: Type8.Optional(
864
+ Type8.Number({ minimum: 0, maximum: 500, description: "Bar gap width (0-500%)" })
865
+ ),
866
+ // Line-specific
867
+ lineSmooth: Type8.Optional(Type8.Boolean({ description: "Smooth lines" })),
868
+ lineDataSymbol: Type8.Optional(
869
+ Type8.Union(
870
+ [
871
+ Type8.Literal("circle"),
872
+ Type8.Literal("dash"),
873
+ Type8.Literal("diamond"),
874
+ Type8.Literal("dot"),
875
+ Type8.Literal("none"),
876
+ Type8.Literal("square"),
877
+ Type8.Literal("triangle")
878
+ ],
879
+ { description: "Line data point marker symbol" }
880
+ )
881
+ ),
882
+ lineSize: Type8.Optional(Type8.Number({ description: "Line width (points)" })),
883
+ // Pie/doughnut-specific
884
+ firstSliceAng: Type8.Optional(Type8.Number({ minimum: 0, maximum: 359, description: "Angle of first slice (degrees)" })),
885
+ holeSize: Type8.Optional(Type8.Number({ minimum: 10, maximum: 90, description: "Doughnut hole size (%)" })),
886
+ // Radar-specific
887
+ radarStyle: Type8.Optional(
888
+ Type8.Union(
889
+ [Type8.Literal("standard"), Type8.Literal("marker"), Type8.Literal("filled")],
890
+ { description: "Radar chart style" }
891
+ )
892
+ ),
893
+ // Data labels
894
+ dataLabelColor: Type8.Optional(Type8.String({ description: "Data label text color" })),
895
+ dataLabelFontSize: Type8.Optional(Type8.Number({ description: "Data label font size" })),
896
+ dataLabelFontFace: Type8.Optional(Type8.String({ description: "Data label font face" })),
897
+ dataLabelFontBold: Type8.Optional(Type8.Boolean({ description: "Bold data labels" })),
898
+ dataLabelPosition: Type8.Optional(
899
+ Type8.Union(
900
+ [
901
+ Type8.Literal("b"),
902
+ Type8.Literal("bestFit"),
903
+ Type8.Literal("ctr"),
904
+ Type8.Literal("l"),
905
+ Type8.Literal("r"),
906
+ Type8.Literal("t"),
907
+ Type8.Literal("inEnd"),
908
+ Type8.Literal("outEnd")
909
+ ],
910
+ { description: "Data label position" }
911
+ )
912
+ ),
913
+ // Positioning
914
+ x: Type8.Optional(PositionValue),
915
+ y: Type8.Optional(PositionValue),
916
+ w: Type8.Optional(PositionValue),
917
+ h: Type8.Optional(PositionValue),
918
+ grid: Type8.Optional(GridPositionSchema)
919
+ },
920
+ {
921
+ description: "Native PowerPoint chart component props",
922
+ additionalProperties: false
923
+ }
924
+ );
925
+
926
+ // src/schemas/component-defaults.ts
927
+ var TextComponentDefaultsSchema = Type9.Partial(TextPropsSchema);
928
+ var ImageComponentDefaultsSchema = Type9.Partial(PptxImagePropsSchema);
929
+ var ShapeComponentDefaultsSchema = Type9.Partial(ShapePropsSchema);
930
+ var TableComponentDefaultsSchema = Type9.Partial(PptxTablePropsSchema);
931
+ var HighchartsComponentDefaultsSchema = Type9.Partial(
932
+ PptxHighchartsPropsSchema
933
+ );
934
+ var ChartComponentDefaultsSchema = Type9.Partial(PptxChartPropsSchema);
935
+ var PptxComponentDefaultsSchema = Type9.Object(
936
+ {
937
+ text: Type9.Optional(TextComponentDefaultsSchema),
938
+ image: Type9.Optional(ImageComponentDefaultsSchema),
939
+ shape: Type9.Optional(ShapeComponentDefaultsSchema),
940
+ table: Type9.Optional(TableComponentDefaultsSchema),
941
+ highcharts: Type9.Optional(HighchartsComponentDefaultsSchema),
942
+ chart: Type9.Optional(ChartComponentDefaultsSchema)
943
+ },
944
+ { additionalProperties: true }
945
+ );
946
+
947
+ export {
948
+ TextPropsSchema,
949
+ PptxImagePropsSchema,
950
+ ShapeTypeSchema,
951
+ TextSegmentSchema,
952
+ ShapePropsSchema,
953
+ PptxTablePropsSchema,
954
+ PptxHighchartsPropsSchema,
955
+ PptxChartPropsSchema,
956
+ TextComponentDefaultsSchema,
957
+ ImageComponentDefaultsSchema,
958
+ ShapeComponentDefaultsSchema,
959
+ TableComponentDefaultsSchema,
960
+ HighchartsComponentDefaultsSchema,
961
+ ChartComponentDefaultsSchema,
962
+ PptxComponentDefaultsSchema,
963
+ GridMarginSchema,
964
+ GridGutterSchema,
965
+ GridConfigSchema,
966
+ SEMANTIC_COLOR_NAMES,
967
+ SEMANTIC_COLOR_ALIASES,
968
+ ColorValueSchema,
969
+ STYLE_NAMES,
970
+ StyleNameSchema,
971
+ TextStyleSchema,
972
+ ThemeConfigSchema,
973
+ isValidThemeConfig,
974
+ PositionSchema,
975
+ SlideBackgroundSchema,
976
+ TransitionSchema,
977
+ PptxAlignmentSchema,
978
+ VerticalAlignmentSchema,
979
+ ShadowSchema,
980
+ GridPositionSchema
981
+ };
982
+ //# sourceMappingURL=chunk-OJMLZFHW.js.map