@json-to-office/shared-docx 0.13.1 → 0.16.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.
- package/dist/{chunk-CIBMJ7QA.js → chunk-5C7XT6LW.js} +6 -2
- package/dist/{chunk-CIBMJ7QA.js.map → chunk-5C7XT6LW.js.map} +1 -1
- package/dist/{chunk-YUV5CJMG.js → chunk-CGMJ665Z.js} +488 -436
- package/dist/chunk-CGMJ665Z.js.map +1 -0
- package/dist/{chunk-ZQNAWKEI.js → chunk-M6LVAHZB.js} +2 -2
- package/dist/chunk-M6LVAHZB.js.map +1 -0
- package/dist/{chunk-TPA2QVQD.js → chunk-NZKLNPBZ.js} +6 -6
- package/dist/{chunk-UTOSZI5Q.js → chunk-P4CGTP5W.js} +4 -4
- package/dist/chunk-P4CGTP5W.js.map +1 -0
- package/dist/{chunk-IHZIO72A.js → chunk-PVQV2RS4.js} +2 -2
- package/dist/{chunk-VBZC5WT6.js → chunk-SMIG3LSE.js} +2 -2
- package/dist/{chunk-YK2UUG65.js → chunk-X2B5OVWA.js} +2 -2
- package/dist/{chunk-25SAKHVN.js → chunk-YRRBEJPB.js} +2 -2
- package/dist/{chunk-BFJJ5HYD.js → chunk-YZYUY2VH.js} +153 -11
- package/dist/chunk-YZYUY2VH.js.map +1 -0
- package/dist/index.d.ts +158 -21
- package/dist/index.js +701 -12
- package/dist/index.js.map +1 -1
- package/dist/schemas/api.js +4 -4
- package/dist/schemas/component-defaults.d.ts +48 -32
- package/dist/schemas/component-defaults.js +1 -1
- package/dist/schemas/component-registry.js +2 -2
- package/dist/schemas/components.d.ts +178 -33
- package/dist/schemas/components.js +13 -3
- package/dist/schemas/document.js +5 -5
- package/dist/schemas/export.js +3 -3
- package/dist/schemas/generator.js +3 -3
- package/dist/schemas/theme.d.ts +24 -16
- package/dist/schemas/theme.js +2 -2
- package/dist/validation/unified/index.d.ts +51 -18
- package/dist/validation/unified/index.js +6 -6
- package/package.json +3 -2
- package/dist/chunk-BFJJ5HYD.js.map +0 -1
- package/dist/chunk-UTOSZI5Q.js.map +0 -1
- package/dist/chunk-YUV5CJMG.js.map +0 -1
- package/dist/chunk-ZQNAWKEI.js.map +0 -1
- /package/dist/{chunk-TPA2QVQD.js.map → chunk-NZKLNPBZ.js.map} +0 -0
- /package/dist/{chunk-IHZIO72A.js.map → chunk-PVQV2RS4.js.map} +0 -0
- /package/dist/{chunk-VBZC5WT6.js.map → chunk-SMIG3LSE.js.map} +0 -0
- /package/dist/{chunk-YK2UUG65.js.map → chunk-X2B5OVWA.js.map} +0 -0
- /package/dist/{chunk-25SAKHVN.js.map → chunk-YRRBEJPB.js.map} +0 -0
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-H56RLQOF.js";
|
|
6
6
|
|
|
7
7
|
// src/schemas/component-defaults.ts
|
|
8
|
-
import { Type as
|
|
8
|
+
import { Type as Type11 } from "@sinclair/typebox";
|
|
9
9
|
|
|
10
10
|
// src/schemas/components/heading.ts
|
|
11
|
-
import { Type as
|
|
11
|
+
import { Type as Type3 } from "@sinclair/typebox";
|
|
12
12
|
|
|
13
13
|
// src/schemas/components/common.ts
|
|
14
14
|
import { Type } from "@sinclair/typebox";
|
|
@@ -369,46 +369,90 @@ var BaseComponentPropsSchema = Type.Object(BaseComponentFields, {
|
|
|
369
369
|
additionalProperties: true
|
|
370
370
|
});
|
|
371
371
|
|
|
372
|
-
// src/schemas/components/
|
|
373
|
-
|
|
372
|
+
// src/schemas/components/revision.ts
|
|
373
|
+
import { Type as Type2 } from "@sinclair/typebox";
|
|
374
|
+
var RevisionSegmentSchema = Type2.Object(
|
|
374
375
|
{
|
|
376
|
+
type: Type2.Union(
|
|
377
|
+
[Type2.Literal("equal"), Type2.Literal("insert"), Type2.Literal("delete")],
|
|
378
|
+
{
|
|
379
|
+
description: "Segment kind: 'equal' renders as normal text, 'insert' as a tracked insertion, 'delete' as a tracked deletion"
|
|
380
|
+
}
|
|
381
|
+
),
|
|
375
382
|
text: Type2.String({
|
|
383
|
+
description: "Literal text of this segment (rendered without markdown)"
|
|
384
|
+
})
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
description: "A contiguous run of text sharing one revision state",
|
|
388
|
+
additionalProperties: false
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
var RevisionSchema = Type2.Object(
|
|
392
|
+
{
|
|
393
|
+
author: Type2.Optional(
|
|
394
|
+
Type2.String({
|
|
395
|
+
description: 'Revision author shown in Word (default: "json-to-office")'
|
|
396
|
+
})
|
|
397
|
+
),
|
|
398
|
+
date: Type2.Optional(
|
|
399
|
+
Type2.String({
|
|
400
|
+
format: "date-time",
|
|
401
|
+
description: "Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"
|
|
402
|
+
})
|
|
403
|
+
),
|
|
404
|
+
segments: Type2.Array(RevisionSegmentSchema, {
|
|
405
|
+
minItems: 1,
|
|
406
|
+
description: "Ordered text segments; concatenating equal+insert segments yields the new text, equal+delete the old text"
|
|
407
|
+
})
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
description: "Tracked-change data: renders the component text as native Word revisions (accept/reject in Word)",
|
|
411
|
+
additionalProperties: false
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
// src/schemas/components/heading.ts
|
|
416
|
+
var HeadingPropsSchema = Type3.Object(
|
|
417
|
+
{
|
|
418
|
+
text: Type3.String({
|
|
376
419
|
description: "Heading text (required)"
|
|
377
420
|
}),
|
|
378
|
-
level:
|
|
421
|
+
level: Type3.Optional(HeadingLevelSchema),
|
|
379
422
|
// Local font override: allows customizing family/size/color/bold/italic/underline
|
|
380
423
|
// without modifying theme styles. Supports partial overrides.
|
|
381
|
-
font:
|
|
382
|
-
alignment:
|
|
383
|
-
spacing:
|
|
384
|
-
lineSpacing:
|
|
385
|
-
|
|
386
|
-
),
|
|
387
|
-
pageBreak:
|
|
388
|
-
|
|
424
|
+
font: Type3.Optional(Type3.Partial(FontDefinitionSchema)),
|
|
425
|
+
alignment: Type3.Optional(JustifiedAlignmentSchema),
|
|
426
|
+
spacing: Type3.Optional(SpacingSchema),
|
|
427
|
+
lineSpacing: Type3.Optional(
|
|
428
|
+
Type3.Union([Type3.Number({ minimum: 0 }), LineSpacingSchema])
|
|
429
|
+
),
|
|
430
|
+
pageBreak: Type3.Optional(
|
|
431
|
+
Type3.Boolean({
|
|
389
432
|
description: "Insert page break before heading"
|
|
390
433
|
})
|
|
391
434
|
),
|
|
392
|
-
columnBreak:
|
|
393
|
-
|
|
435
|
+
columnBreak: Type3.Optional(
|
|
436
|
+
Type3.Boolean({
|
|
394
437
|
description: "Insert column break before heading"
|
|
395
438
|
})
|
|
396
439
|
),
|
|
397
|
-
numbering:
|
|
398
|
-
|
|
440
|
+
numbering: Type3.Optional(
|
|
441
|
+
Type3.Boolean({
|
|
399
442
|
description: "Include in numbering"
|
|
400
443
|
})
|
|
401
444
|
),
|
|
402
|
-
keepNext:
|
|
403
|
-
|
|
445
|
+
keepNext: Type3.Optional(
|
|
446
|
+
Type3.Boolean({
|
|
404
447
|
description: "Keep heading with next paragraph on same page"
|
|
405
448
|
})
|
|
406
449
|
),
|
|
407
|
-
keepLines:
|
|
408
|
-
|
|
450
|
+
keepLines: Type3.Optional(
|
|
451
|
+
Type3.Boolean({
|
|
409
452
|
description: "Keep all lines of heading together on same page"
|
|
410
453
|
})
|
|
411
|
-
)
|
|
454
|
+
),
|
|
455
|
+
revision: Type3.Optional(RevisionSchema)
|
|
412
456
|
},
|
|
413
457
|
{
|
|
414
458
|
description: "Heading component props",
|
|
@@ -417,63 +461,63 @@ var HeadingPropsSchema = Type2.Object(
|
|
|
417
461
|
);
|
|
418
462
|
|
|
419
463
|
// src/schemas/components/paragraph.ts
|
|
420
|
-
import { Type as
|
|
421
|
-
var FrameWrapTypeSchema =
|
|
464
|
+
import { Type as Type4 } from "@sinclair/typebox";
|
|
465
|
+
var FrameWrapTypeSchema = Type4.Union(
|
|
422
466
|
[
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
467
|
+
Type4.Literal("around"),
|
|
468
|
+
Type4.Literal("none"),
|
|
469
|
+
Type4.Literal("notBeside"),
|
|
470
|
+
Type4.Literal("through"),
|
|
471
|
+
Type4.Literal("tight"),
|
|
472
|
+
Type4.Literal("auto")
|
|
429
473
|
],
|
|
430
474
|
{
|
|
431
475
|
description: "Frame text wrapping type"
|
|
432
476
|
}
|
|
433
477
|
);
|
|
434
|
-
var FrameAnchorTypeSchema =
|
|
435
|
-
[
|
|
478
|
+
var FrameAnchorTypeSchema = Type4.Union(
|
|
479
|
+
[Type4.Literal("margin"), Type4.Literal("page"), Type4.Literal("text")],
|
|
436
480
|
{
|
|
437
481
|
description: "Frame anchor type"
|
|
438
482
|
}
|
|
439
483
|
);
|
|
440
|
-
var FrameHorizontalAlignSchema =
|
|
484
|
+
var FrameHorizontalAlignSchema = Type4.Union(
|
|
441
485
|
[
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
486
|
+
Type4.Literal("left"),
|
|
487
|
+
Type4.Literal("center"),
|
|
488
|
+
Type4.Literal("right"),
|
|
489
|
+
Type4.Literal("inside"),
|
|
490
|
+
Type4.Literal("outside")
|
|
447
491
|
],
|
|
448
492
|
{
|
|
449
493
|
description: "Frame horizontal alignment"
|
|
450
494
|
}
|
|
451
495
|
);
|
|
452
|
-
var FrameVerticalAlignSchema =
|
|
496
|
+
var FrameVerticalAlignSchema = Type4.Union(
|
|
453
497
|
[
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
498
|
+
Type4.Literal("top"),
|
|
499
|
+
Type4.Literal("center"),
|
|
500
|
+
Type4.Literal("bottom"),
|
|
501
|
+
Type4.Literal("inside"),
|
|
502
|
+
Type4.Literal("outside")
|
|
459
503
|
],
|
|
460
504
|
{
|
|
461
505
|
description: "Frame vertical alignment"
|
|
462
506
|
}
|
|
463
507
|
);
|
|
464
|
-
var FloatingFramePropertiesSchema =
|
|
508
|
+
var FloatingFramePropertiesSchema = Type4.Object(
|
|
465
509
|
{
|
|
466
|
-
horizontalPosition:
|
|
467
|
-
|
|
510
|
+
horizontalPosition: Type4.Optional(
|
|
511
|
+
Type4.Object(
|
|
468
512
|
{
|
|
469
|
-
relative:
|
|
470
|
-
align:
|
|
471
|
-
offset:
|
|
472
|
-
|
|
473
|
-
|
|
513
|
+
relative: Type4.Optional(FrameAnchorTypeSchema),
|
|
514
|
+
align: Type4.Optional(FrameHorizontalAlignSchema),
|
|
515
|
+
offset: Type4.Optional(
|
|
516
|
+
Type4.Union([
|
|
517
|
+
Type4.Number({
|
|
474
518
|
description: "Horizontal offset in twips (1/20 of a point)"
|
|
475
519
|
}),
|
|
476
|
-
|
|
520
|
+
Type4.String({
|
|
477
521
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
478
522
|
description: 'Horizontal offset as percentage (e.g., "50%") relative to page or margin width'
|
|
479
523
|
})
|
|
@@ -485,17 +529,17 @@ var FloatingFramePropertiesSchema = Type3.Object(
|
|
|
485
529
|
}
|
|
486
530
|
)
|
|
487
531
|
),
|
|
488
|
-
verticalPosition:
|
|
489
|
-
|
|
532
|
+
verticalPosition: Type4.Optional(
|
|
533
|
+
Type4.Object(
|
|
490
534
|
{
|
|
491
|
-
relative:
|
|
492
|
-
align:
|
|
493
|
-
offset:
|
|
494
|
-
|
|
495
|
-
|
|
535
|
+
relative: Type4.Optional(FrameAnchorTypeSchema),
|
|
536
|
+
align: Type4.Optional(FrameVerticalAlignSchema),
|
|
537
|
+
offset: Type4.Optional(
|
|
538
|
+
Type4.Union([
|
|
539
|
+
Type4.Number({
|
|
496
540
|
description: "Vertical offset in twips (1/20 of a point)"
|
|
497
541
|
}),
|
|
498
|
-
|
|
542
|
+
Type4.String({
|
|
499
543
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
500
544
|
description: 'Vertical offset as percentage (e.g., "50%") relative to page or margin height'
|
|
501
545
|
})
|
|
@@ -507,8 +551,8 @@ var FloatingFramePropertiesSchema = Type3.Object(
|
|
|
507
551
|
}
|
|
508
552
|
)
|
|
509
553
|
),
|
|
510
|
-
wrap:
|
|
511
|
-
|
|
554
|
+
wrap: Type4.Optional(
|
|
555
|
+
Type4.Object(
|
|
512
556
|
{
|
|
513
557
|
type: FrameWrapTypeSchema
|
|
514
558
|
},
|
|
@@ -517,19 +561,19 @@ var FloatingFramePropertiesSchema = Type3.Object(
|
|
|
517
561
|
}
|
|
518
562
|
)
|
|
519
563
|
),
|
|
520
|
-
lockAnchor:
|
|
521
|
-
|
|
564
|
+
lockAnchor: Type4.Optional(
|
|
565
|
+
Type4.Boolean({
|
|
522
566
|
description: "Lock the anchor position"
|
|
523
567
|
})
|
|
524
568
|
),
|
|
525
|
-
width:
|
|
526
|
-
|
|
569
|
+
width: Type4.Optional(
|
|
570
|
+
Type4.Number({
|
|
527
571
|
minimum: 1,
|
|
528
572
|
description: "Frame width in twips (DXA units)"
|
|
529
573
|
})
|
|
530
574
|
),
|
|
531
|
-
height:
|
|
532
|
-
|
|
575
|
+
height: Type4.Optional(
|
|
576
|
+
Type4.Number({
|
|
533
577
|
minimum: 1,
|
|
534
578
|
description: "Frame height in twips (DXA units)"
|
|
535
579
|
})
|
|
@@ -539,59 +583,60 @@ var FloatingFramePropertiesSchema = Type3.Object(
|
|
|
539
583
|
description: "Floating text frame properties"
|
|
540
584
|
}
|
|
541
585
|
);
|
|
542
|
-
var AlignmentSchema2 =
|
|
586
|
+
var AlignmentSchema2 = Type4.Union(
|
|
543
587
|
[
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
588
|
+
Type4.Literal("left"),
|
|
589
|
+
Type4.Literal("center"),
|
|
590
|
+
Type4.Literal("right"),
|
|
591
|
+
Type4.Literal("justify")
|
|
548
592
|
],
|
|
549
593
|
{
|
|
550
594
|
description: "Paragraph text alignment"
|
|
551
595
|
}
|
|
552
596
|
);
|
|
553
|
-
var ParagraphPropsSchema =
|
|
597
|
+
var ParagraphPropsSchema = Type4.Object(
|
|
554
598
|
{
|
|
555
|
-
text:
|
|
599
|
+
text: Type4.String({
|
|
556
600
|
description: "Text content (required)"
|
|
557
601
|
}),
|
|
558
602
|
// New nested font object, aligned with theme's FontDefinitionSchema
|
|
559
603
|
// Allow partial overrides (family not required when overriding a subset)
|
|
560
|
-
font:
|
|
604
|
+
font: Type4.Optional(Type4.Partial(FontDefinitionSchema)),
|
|
561
605
|
// Optional reference to a named style from theme.styles (e.g., 'heading1', 'normal')
|
|
562
|
-
themeStyle:
|
|
606
|
+
themeStyle: Type4.Optional(Type4.String()),
|
|
563
607
|
// Rich-text decoration color for bold segments (kept as top-level behavior option)
|
|
564
|
-
boldColor:
|
|
608
|
+
boldColor: Type4.Optional(Type4.String()),
|
|
565
609
|
// Paragraph spacing (in points) — limited paragraph-level option allowed
|
|
566
|
-
spacing:
|
|
610
|
+
spacing: Type4.Optional(SpacingSchema),
|
|
567
611
|
// Paragraph alignment (moved from font to config level)
|
|
568
|
-
alignment:
|
|
569
|
-
pageBreak:
|
|
570
|
-
|
|
612
|
+
alignment: Type4.Optional(AlignmentSchema2),
|
|
613
|
+
pageBreak: Type4.Optional(
|
|
614
|
+
Type4.Boolean({
|
|
571
615
|
description: "Insert page break before paragraph"
|
|
572
616
|
})
|
|
573
617
|
),
|
|
574
|
-
columnBreak:
|
|
575
|
-
|
|
618
|
+
columnBreak: Type4.Optional(
|
|
619
|
+
Type4.Boolean({
|
|
576
620
|
description: "Insert column break before paragraph"
|
|
577
621
|
})
|
|
578
622
|
),
|
|
579
|
-
floating:
|
|
580
|
-
keepNext:
|
|
581
|
-
|
|
623
|
+
floating: Type4.Optional(FloatingFramePropertiesSchema),
|
|
624
|
+
keepNext: Type4.Optional(
|
|
625
|
+
Type4.Boolean({
|
|
582
626
|
description: "Keep paragraph with next paragraph on same page"
|
|
583
627
|
})
|
|
584
628
|
),
|
|
585
|
-
keepLines:
|
|
586
|
-
|
|
629
|
+
keepLines: Type4.Optional(
|
|
630
|
+
Type4.Boolean({
|
|
587
631
|
description: "Keep all lines of paragraph together on same page"
|
|
588
632
|
})
|
|
589
633
|
),
|
|
590
|
-
id:
|
|
591
|
-
|
|
634
|
+
id: Type4.Optional(
|
|
635
|
+
Type4.String({
|
|
592
636
|
description: "Unique identifier for internal linking (bookmark anchor)"
|
|
593
637
|
})
|
|
594
|
-
)
|
|
638
|
+
),
|
|
639
|
+
revision: Type4.Optional(RevisionSchema)
|
|
595
640
|
},
|
|
596
641
|
{
|
|
597
642
|
description: "Paragraph component props (font nested for theme consistency; no flat font properties)",
|
|
@@ -600,32 +645,32 @@ var ParagraphPropsSchema = Type3.Object(
|
|
|
600
645
|
);
|
|
601
646
|
|
|
602
647
|
// src/schemas/components/image.ts
|
|
603
|
-
import { Type as
|
|
604
|
-
var ImagePropsSchema =
|
|
648
|
+
import { Type as Type5 } from "@sinclair/typebox";
|
|
649
|
+
var ImagePropsSchema = Type5.Object(
|
|
605
650
|
{
|
|
606
|
-
path:
|
|
607
|
-
|
|
651
|
+
path: Type5.Optional(
|
|
652
|
+
Type5.String({
|
|
608
653
|
description: "Image source URL or file path (mutually exclusive with base64)"
|
|
609
654
|
})
|
|
610
655
|
),
|
|
611
|
-
base64:
|
|
612
|
-
|
|
656
|
+
base64: Type5.Optional(
|
|
657
|
+
Type5.String({
|
|
613
658
|
description: 'Base64-encoded image data in data URI format (e.g., "data:image/png;base64,iVBORw0KGgo...") (mutually exclusive with path)'
|
|
614
659
|
})
|
|
615
660
|
),
|
|
616
|
-
alt:
|
|
617
|
-
|
|
661
|
+
alt: Type5.Optional(
|
|
662
|
+
Type5.String({
|
|
618
663
|
description: "Alternative text for accessibility"
|
|
619
664
|
})
|
|
620
665
|
),
|
|
621
|
-
width:
|
|
622
|
-
|
|
666
|
+
width: Type5.Optional(
|
|
667
|
+
Type5.Union(
|
|
623
668
|
[
|
|
624
|
-
|
|
669
|
+
Type5.Number({
|
|
625
670
|
minimum: 1,
|
|
626
671
|
description: "Image width in pixels"
|
|
627
672
|
}),
|
|
628
|
-
|
|
673
|
+
Type5.String({
|
|
629
674
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
630
675
|
description: 'Image width as percentage (e.g., "90%") relative to widthRelativeTo (defaults to content width)'
|
|
631
676
|
})
|
|
@@ -636,14 +681,14 @@ var ImagePropsSchema = Type4.Object(
|
|
|
636
681
|
}
|
|
637
682
|
)
|
|
638
683
|
),
|
|
639
|
-
height:
|
|
640
|
-
|
|
684
|
+
height: Type5.Optional(
|
|
685
|
+
Type5.Union(
|
|
641
686
|
[
|
|
642
|
-
|
|
687
|
+
Type5.Number({
|
|
643
688
|
minimum: 1,
|
|
644
689
|
description: "Image height in pixels"
|
|
645
690
|
}),
|
|
646
|
-
|
|
691
|
+
Type5.String({
|
|
647
692
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
648
693
|
description: 'Image height as percentage (e.g., "90%") relative to heightRelativeTo (defaults to content height)'
|
|
649
694
|
})
|
|
@@ -653,33 +698,33 @@ var ImagePropsSchema = Type4.Object(
|
|
|
653
698
|
}
|
|
654
699
|
)
|
|
655
700
|
),
|
|
656
|
-
widthRelativeTo:
|
|
657
|
-
|
|
701
|
+
widthRelativeTo: Type5.Optional(
|
|
702
|
+
Type5.Union([Type5.Literal("content"), Type5.Literal("page")], {
|
|
658
703
|
description: "Reference for width percentages: content (page width minus margins) or page (full page width)",
|
|
659
704
|
default: "content"
|
|
660
705
|
})
|
|
661
706
|
),
|
|
662
|
-
heightRelativeTo:
|
|
663
|
-
|
|
707
|
+
heightRelativeTo: Type5.Optional(
|
|
708
|
+
Type5.Union([Type5.Literal("content"), Type5.Literal("page")], {
|
|
664
709
|
description: "Reference for height percentages: content (page height minus margins) or page (full page height)",
|
|
665
710
|
default: "content"
|
|
666
711
|
})
|
|
667
712
|
),
|
|
668
|
-
alignment:
|
|
669
|
-
caption:
|
|
670
|
-
|
|
713
|
+
alignment: Type5.Optional(AlignmentSchema),
|
|
714
|
+
caption: Type5.Optional(
|
|
715
|
+
Type5.String({
|
|
671
716
|
description: "Image caption (supports rich text with **bold**, *italic*, ***both***)"
|
|
672
717
|
})
|
|
673
718
|
),
|
|
674
|
-
spacing:
|
|
675
|
-
floating:
|
|
676
|
-
keepNext:
|
|
677
|
-
|
|
719
|
+
spacing: Type5.Optional(SpacingSchema),
|
|
720
|
+
floating: Type5.Optional(FloatingPropertiesSchema),
|
|
721
|
+
keepNext: Type5.Optional(
|
|
722
|
+
Type5.Boolean({
|
|
678
723
|
description: "Keep paragraph with next paragraph on same page"
|
|
679
724
|
})
|
|
680
725
|
),
|
|
681
|
-
keepLines:
|
|
682
|
-
|
|
726
|
+
keepLines: Type5.Optional(
|
|
727
|
+
Type5.Boolean({
|
|
683
728
|
description: "Keep all lines of paragraph together on same page"
|
|
684
729
|
})
|
|
685
730
|
)
|
|
@@ -691,40 +736,40 @@ var ImagePropsSchema = Type4.Object(
|
|
|
691
736
|
);
|
|
692
737
|
|
|
693
738
|
// src/schemas/components/statistic.ts
|
|
694
|
-
import { Type as
|
|
695
|
-
var StatisticPropsSchema =
|
|
739
|
+
import { Type as Type6 } from "@sinclair/typebox";
|
|
740
|
+
var StatisticPropsSchema = Type6.Object(
|
|
696
741
|
{
|
|
697
|
-
number:
|
|
742
|
+
number: Type6.String({
|
|
698
743
|
description: "Statistic number/value (required)"
|
|
699
744
|
}),
|
|
700
|
-
description:
|
|
745
|
+
description: Type6.String({
|
|
701
746
|
description: "Statistic description (required)"
|
|
702
747
|
}),
|
|
703
|
-
unit:
|
|
704
|
-
|
|
748
|
+
unit: Type6.Optional(
|
|
749
|
+
Type6.String({
|
|
705
750
|
description: "Unit of measurement"
|
|
706
751
|
})
|
|
707
752
|
),
|
|
708
|
-
format:
|
|
709
|
-
|
|
753
|
+
format: Type6.Optional(
|
|
754
|
+
Type6.String({
|
|
710
755
|
description: "Number format pattern"
|
|
711
756
|
})
|
|
712
757
|
),
|
|
713
|
-
trend:
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
758
|
+
trend: Type6.Optional(
|
|
759
|
+
Type6.Union([
|
|
760
|
+
Type6.Literal("up"),
|
|
761
|
+
Type6.Literal("down"),
|
|
762
|
+
Type6.Literal("neutral")
|
|
718
763
|
])
|
|
719
764
|
),
|
|
720
|
-
trendValue:
|
|
721
|
-
alignment:
|
|
722
|
-
spacing:
|
|
723
|
-
size:
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
765
|
+
trendValue: Type6.Optional(Type6.Union([Type6.String(), Type6.Number()])),
|
|
766
|
+
alignment: Type6.Optional(AlignmentSchema),
|
|
767
|
+
spacing: Type6.Optional(SpacingSchema),
|
|
768
|
+
size: Type6.Optional(
|
|
769
|
+
Type6.Union([
|
|
770
|
+
Type6.Literal("small"),
|
|
771
|
+
Type6.Literal("medium"),
|
|
772
|
+
Type6.Literal("large")
|
|
728
773
|
])
|
|
729
774
|
)
|
|
730
775
|
},
|
|
@@ -735,208 +780,208 @@ var StatisticPropsSchema = Type5.Object(
|
|
|
735
780
|
);
|
|
736
781
|
|
|
737
782
|
// src/schemas/components/table.ts
|
|
738
|
-
import { Type as
|
|
739
|
-
var CellContentSchema =
|
|
740
|
-
(This) =>
|
|
741
|
-
|
|
742
|
-
|
|
783
|
+
import { Type as Type7 } from "@sinclair/typebox";
|
|
784
|
+
var CellContentSchema = Type7.Recursive(
|
|
785
|
+
(This) => Type7.Union([
|
|
786
|
+
Type7.String(),
|
|
787
|
+
Type7.Object(
|
|
743
788
|
{
|
|
744
|
-
name:
|
|
745
|
-
props:
|
|
746
|
-
children:
|
|
789
|
+
name: Type7.String(),
|
|
790
|
+
props: Type7.Object({}, { additionalProperties: true }),
|
|
791
|
+
children: Type7.Optional(Type7.Array(This))
|
|
747
792
|
},
|
|
748
793
|
{ additionalProperties: false }
|
|
749
794
|
)
|
|
750
795
|
])
|
|
751
796
|
);
|
|
752
|
-
var HorizontalAlignmentSchema =
|
|
797
|
+
var HorizontalAlignmentSchema = Type7.Union(
|
|
753
798
|
[
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
799
|
+
Type7.Literal("left"),
|
|
800
|
+
Type7.Literal("center"),
|
|
801
|
+
Type7.Literal("right"),
|
|
802
|
+
Type7.Literal("justify")
|
|
758
803
|
],
|
|
759
804
|
{ description: "Horizontal text alignment" }
|
|
760
805
|
);
|
|
761
|
-
var VerticalAlignmentSchema =
|
|
762
|
-
[
|
|
806
|
+
var VerticalAlignmentSchema = Type7.Union(
|
|
807
|
+
[Type7.Literal("top"), Type7.Literal("middle"), Type7.Literal("bottom")],
|
|
763
808
|
{ description: "Vertical cell alignment" }
|
|
764
809
|
);
|
|
765
|
-
var FontConfigSchema =
|
|
766
|
-
family:
|
|
767
|
-
size:
|
|
768
|
-
|
|
810
|
+
var FontConfigSchema = Type7.Object({
|
|
811
|
+
family: Type7.Optional(Type7.String({ description: "Font family name" })),
|
|
812
|
+
size: Type7.Optional(
|
|
813
|
+
Type7.Number({ minimum: 0, description: "Font size in points" })
|
|
769
814
|
),
|
|
770
|
-
bold:
|
|
771
|
-
fontWeight:
|
|
772
|
-
|
|
815
|
+
bold: Type7.Optional(Type7.Boolean({ description: "Bold text" })),
|
|
816
|
+
fontWeight: Type7.Optional(
|
|
817
|
+
Type7.Integer({
|
|
773
818
|
minimum: 100,
|
|
774
819
|
maximum: 900,
|
|
775
820
|
description: "Per-cell weight (100\u2013900). Overrides `bold` when set."
|
|
776
821
|
})
|
|
777
822
|
),
|
|
778
|
-
italic:
|
|
779
|
-
underline:
|
|
823
|
+
italic: Type7.Optional(Type7.Boolean({ description: "Italic text" })),
|
|
824
|
+
underline: Type7.Optional(Type7.Boolean({ description: "Underlined text" }))
|
|
780
825
|
});
|
|
781
|
-
var BorderColorSchema =
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
bottom:
|
|
785
|
-
|
|
826
|
+
var BorderColorSchema = Type7.Union([
|
|
827
|
+
Type7.String({ description: "Border color for all sides (hex without #)" }),
|
|
828
|
+
Type7.Object({
|
|
829
|
+
bottom: Type7.Optional(
|
|
830
|
+
Type7.String({ description: "Bottom border color (hex without #)" })
|
|
786
831
|
),
|
|
787
|
-
top:
|
|
788
|
-
|
|
832
|
+
top: Type7.Optional(
|
|
833
|
+
Type7.String({ description: "Top border color (hex without #)" })
|
|
789
834
|
),
|
|
790
|
-
right:
|
|
791
|
-
|
|
835
|
+
right: Type7.Optional(
|
|
836
|
+
Type7.String({ description: "Right border color (hex without #)" })
|
|
792
837
|
),
|
|
793
|
-
left:
|
|
794
|
-
|
|
838
|
+
left: Type7.Optional(
|
|
839
|
+
Type7.String({ description: "Left border color (hex without #)" })
|
|
795
840
|
)
|
|
796
841
|
})
|
|
797
842
|
]);
|
|
798
|
-
var BorderSizeSchema =
|
|
799
|
-
|
|
843
|
+
var BorderSizeSchema = Type7.Union([
|
|
844
|
+
Type7.Number({
|
|
800
845
|
minimum: 0,
|
|
801
846
|
description: "Border size for all sides in points"
|
|
802
847
|
}),
|
|
803
|
-
|
|
804
|
-
bottom:
|
|
805
|
-
|
|
848
|
+
Type7.Object({
|
|
849
|
+
bottom: Type7.Optional(
|
|
850
|
+
Type7.Number({ minimum: 0, description: "Bottom border size in points" })
|
|
806
851
|
),
|
|
807
|
-
top:
|
|
808
|
-
|
|
852
|
+
top: Type7.Optional(
|
|
853
|
+
Type7.Number({ minimum: 0, description: "Top border size in points" })
|
|
809
854
|
),
|
|
810
|
-
right:
|
|
811
|
-
|
|
855
|
+
right: Type7.Optional(
|
|
856
|
+
Type7.Number({ minimum: 0, description: "Right border size in points" })
|
|
812
857
|
),
|
|
813
|
-
left:
|
|
814
|
-
|
|
858
|
+
left: Type7.Optional(
|
|
859
|
+
Type7.Number({ minimum: 0, description: "Left border size in points" })
|
|
815
860
|
)
|
|
816
861
|
})
|
|
817
862
|
]);
|
|
818
|
-
var HideBordersSchema =
|
|
819
|
-
|
|
863
|
+
var HideBordersSchema = Type7.Union([
|
|
864
|
+
Type7.Boolean({
|
|
820
865
|
description: "Hide all borders when true"
|
|
821
866
|
}),
|
|
822
|
-
|
|
867
|
+
Type7.Object(
|
|
823
868
|
{
|
|
824
|
-
bottom:
|
|
825
|
-
|
|
869
|
+
bottom: Type7.Optional(
|
|
870
|
+
Type7.Boolean({ description: "Hide bottom border" })
|
|
826
871
|
),
|
|
827
|
-
top:
|
|
828
|
-
right:
|
|
829
|
-
left:
|
|
830
|
-
insideHorizontal:
|
|
831
|
-
|
|
872
|
+
top: Type7.Optional(Type7.Boolean({ description: "Hide top border" })),
|
|
873
|
+
right: Type7.Optional(Type7.Boolean({ description: "Hide right border" })),
|
|
874
|
+
left: Type7.Optional(Type7.Boolean({ description: "Hide left border" })),
|
|
875
|
+
insideHorizontal: Type7.Optional(
|
|
876
|
+
Type7.Boolean({ description: "Hide horizontal borders between rows" })
|
|
832
877
|
),
|
|
833
|
-
insideVertical:
|
|
834
|
-
|
|
878
|
+
insideVertical: Type7.Optional(
|
|
879
|
+
Type7.Boolean({ description: "Hide vertical borders between columns" })
|
|
835
880
|
)
|
|
836
881
|
},
|
|
837
882
|
{ description: "Selectively hide specific borders" }
|
|
838
883
|
)
|
|
839
884
|
]);
|
|
840
|
-
var PaddingSchema =
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
bottom:
|
|
844
|
-
|
|
885
|
+
var PaddingSchema = Type7.Union([
|
|
886
|
+
Type7.Number({ minimum: 0, description: "Padding for all sides in points" }),
|
|
887
|
+
Type7.Object({
|
|
888
|
+
bottom: Type7.Optional(
|
|
889
|
+
Type7.Number({ minimum: 0, description: "Bottom padding in points" })
|
|
845
890
|
),
|
|
846
|
-
top:
|
|
847
|
-
|
|
891
|
+
top: Type7.Optional(
|
|
892
|
+
Type7.Number({ minimum: 0, description: "Top padding in points" })
|
|
848
893
|
),
|
|
849
|
-
right:
|
|
850
|
-
|
|
894
|
+
right: Type7.Optional(
|
|
895
|
+
Type7.Number({ minimum: 0, description: "Right padding in points" })
|
|
851
896
|
),
|
|
852
|
-
left:
|
|
853
|
-
|
|
897
|
+
left: Type7.Optional(
|
|
898
|
+
Type7.Number({ minimum: 0, description: "Left padding in points" })
|
|
854
899
|
)
|
|
855
900
|
})
|
|
856
901
|
]);
|
|
857
|
-
var CellDefaultsSchema =
|
|
858
|
-
color:
|
|
859
|
-
backgroundColor:
|
|
860
|
-
horizontalAlignment:
|
|
861
|
-
verticalAlignment:
|
|
862
|
-
font:
|
|
863
|
-
borderColor:
|
|
864
|
-
borderSize:
|
|
865
|
-
padding:
|
|
866
|
-
height:
|
|
867
|
-
|
|
902
|
+
var CellDefaultsSchema = Type7.Object({
|
|
903
|
+
color: Type7.Optional(HexColorSchema),
|
|
904
|
+
backgroundColor: Type7.Optional(HexColorOrTransparentSchema),
|
|
905
|
+
horizontalAlignment: Type7.Optional(HorizontalAlignmentSchema),
|
|
906
|
+
verticalAlignment: Type7.Optional(VerticalAlignmentSchema),
|
|
907
|
+
font: Type7.Optional(FontConfigSchema),
|
|
908
|
+
borderColor: Type7.Optional(BorderColorSchema),
|
|
909
|
+
borderSize: Type7.Optional(BorderSizeSchema),
|
|
910
|
+
padding: Type7.Optional(PaddingSchema),
|
|
911
|
+
height: Type7.Optional(
|
|
912
|
+
Type7.Number({ minimum: 0, description: "Cell height in points" })
|
|
868
913
|
)
|
|
869
914
|
});
|
|
870
915
|
function createTablePropsSchema(componentRef) {
|
|
871
|
-
const cellContent =
|
|
916
|
+
const cellContent = Type7.Union([Type7.String(), componentRef]);
|
|
872
917
|
const cellFields = {
|
|
873
|
-
color:
|
|
874
|
-
backgroundColor:
|
|
875
|
-
horizontalAlignment:
|
|
876
|
-
verticalAlignment:
|
|
877
|
-
font:
|
|
878
|
-
borderColor:
|
|
879
|
-
borderSize:
|
|
880
|
-
padding:
|
|
881
|
-
height:
|
|
882
|
-
|
|
918
|
+
color: Type7.Optional(HexColorSchema),
|
|
919
|
+
backgroundColor: Type7.Optional(HexColorOrTransparentSchema),
|
|
920
|
+
horizontalAlignment: Type7.Optional(HorizontalAlignmentSchema),
|
|
921
|
+
verticalAlignment: Type7.Optional(VerticalAlignmentSchema),
|
|
922
|
+
font: Type7.Optional(FontConfigSchema),
|
|
923
|
+
borderColor: Type7.Optional(BorderColorSchema),
|
|
924
|
+
borderSize: Type7.Optional(BorderSizeSchema),
|
|
925
|
+
padding: Type7.Optional(PaddingSchema),
|
|
926
|
+
height: Type7.Optional(
|
|
927
|
+
Type7.Number({ minimum: 0, description: "Cell height in points" })
|
|
883
928
|
)
|
|
884
929
|
};
|
|
885
|
-
const headerSchema =
|
|
930
|
+
const headerSchema = Type7.Object({
|
|
886
931
|
...cellFields,
|
|
887
|
-
content:
|
|
932
|
+
content: Type7.Optional(cellContent)
|
|
888
933
|
});
|
|
889
|
-
const cellSchema =
|
|
934
|
+
const cellSchema = Type7.Object({
|
|
890
935
|
...cellFields,
|
|
891
|
-
content:
|
|
936
|
+
content: Type7.Optional(cellContent)
|
|
892
937
|
});
|
|
893
|
-
const columnSchema =
|
|
894
|
-
width:
|
|
895
|
-
|
|
896
|
-
|
|
938
|
+
const columnSchema = Type7.Object({
|
|
939
|
+
width: Type7.Optional(
|
|
940
|
+
Type7.Union([
|
|
941
|
+
Type7.Number({
|
|
897
942
|
minimum: 0,
|
|
898
943
|
description: "Column width in points. When set on some columns, remaining columns will automatically share the leftover table space equally. Leave undefined to distribute space evenly among unspecified columns."
|
|
899
944
|
}),
|
|
900
|
-
|
|
945
|
+
Type7.String({
|
|
901
946
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
902
947
|
description: 'Column width as percentage of available width (e.g., "40%")'
|
|
903
948
|
})
|
|
904
949
|
])
|
|
905
950
|
),
|
|
906
|
-
cellDefaults:
|
|
907
|
-
header:
|
|
908
|
-
cells:
|
|
951
|
+
cellDefaults: Type7.Optional(CellDefaultsSchema),
|
|
952
|
+
header: Type7.Optional(headerSchema),
|
|
953
|
+
cells: Type7.Optional(Type7.Array(cellSchema))
|
|
909
954
|
});
|
|
910
|
-
return
|
|
955
|
+
return Type7.Object(
|
|
911
956
|
{
|
|
912
|
-
borderColor:
|
|
913
|
-
borderSize:
|
|
914
|
-
hideBorders:
|
|
915
|
-
cellDefaults:
|
|
916
|
-
headerCellDefaults:
|
|
917
|
-
width:
|
|
918
|
-
|
|
957
|
+
borderColor: Type7.Optional(BorderColorSchema),
|
|
958
|
+
borderSize: Type7.Optional(BorderSizeSchema),
|
|
959
|
+
hideBorders: Type7.Optional(HideBordersSchema),
|
|
960
|
+
cellDefaults: Type7.Optional(CellDefaultsSchema),
|
|
961
|
+
headerCellDefaults: Type7.Optional(CellDefaultsSchema),
|
|
962
|
+
width: Type7.Optional(
|
|
963
|
+
Type7.Number({
|
|
919
964
|
minimum: 0,
|
|
920
965
|
maximum: 100,
|
|
921
966
|
description: "Table width in percentage (0-100)"
|
|
922
967
|
})
|
|
923
968
|
),
|
|
924
|
-
columns:
|
|
969
|
+
columns: Type7.Array(columnSchema, {
|
|
925
970
|
description: "Table columns with headers and cells",
|
|
926
971
|
minItems: 1
|
|
927
972
|
}),
|
|
928
|
-
keepInOnePage:
|
|
929
|
-
|
|
973
|
+
keepInOnePage: Type7.Optional(
|
|
974
|
+
Type7.Boolean({
|
|
930
975
|
description: "Keep table rows together on the same page by setting keepNext on all paragraphs"
|
|
931
976
|
})
|
|
932
977
|
),
|
|
933
|
-
keepNext:
|
|
934
|
-
|
|
978
|
+
keepNext: Type7.Optional(
|
|
979
|
+
Type7.Boolean({
|
|
935
980
|
description: "Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false."
|
|
936
981
|
})
|
|
937
982
|
),
|
|
938
|
-
repeatHeaderOnPageBreak:
|
|
939
|
-
|
|
983
|
+
repeatHeaderOnPageBreak: Type7.Optional(
|
|
984
|
+
Type7.Boolean({
|
|
940
985
|
description: "Repeat the header row on each page when the table spans multiple pages. Defaults to false.",
|
|
941
986
|
default: true
|
|
942
987
|
})
|
|
@@ -950,74 +995,74 @@ function createTablePropsSchema(componentRef) {
|
|
|
950
995
|
var TablePropsSchema = createTablePropsSchema(CellContentSchema);
|
|
951
996
|
|
|
952
997
|
// src/schemas/components/section.ts
|
|
953
|
-
import { Type as
|
|
954
|
-
var createSectionPropsSchema = (moduleRef) =>
|
|
998
|
+
import { Type as Type8 } from "@sinclair/typebox";
|
|
999
|
+
var createSectionPropsSchema = (moduleRef) => Type8.Object(
|
|
955
1000
|
{
|
|
956
|
-
title:
|
|
957
|
-
|
|
1001
|
+
title: Type8.Optional(
|
|
1002
|
+
Type8.String({
|
|
958
1003
|
description: "Section title (optional)"
|
|
959
1004
|
})
|
|
960
1005
|
),
|
|
961
|
-
level:
|
|
962
|
-
|
|
1006
|
+
level: Type8.Optional(
|
|
1007
|
+
Type8.Number({
|
|
963
1008
|
minimum: 1,
|
|
964
1009
|
maximum: 9,
|
|
965
1010
|
description: "Heading level for section title (1-9)",
|
|
966
1011
|
default: 1
|
|
967
1012
|
})
|
|
968
1013
|
),
|
|
969
|
-
header:
|
|
970
|
-
|
|
971
|
-
|
|
1014
|
+
header: Type8.Optional(
|
|
1015
|
+
Type8.Union([
|
|
1016
|
+
Type8.Array(moduleRef || Type8.Any(), {
|
|
972
1017
|
description: "Section header modules"
|
|
973
1018
|
}),
|
|
974
|
-
|
|
1019
|
+
Type8.Literal("linkToPrevious", {
|
|
975
1020
|
description: "Link header to previous section"
|
|
976
1021
|
})
|
|
977
1022
|
])
|
|
978
1023
|
),
|
|
979
|
-
footer:
|
|
980
|
-
|
|
981
|
-
|
|
1024
|
+
footer: Type8.Optional(
|
|
1025
|
+
Type8.Union([
|
|
1026
|
+
Type8.Array(moduleRef || Type8.Any(), {
|
|
982
1027
|
description: "Section footer modules"
|
|
983
1028
|
}),
|
|
984
|
-
|
|
1029
|
+
Type8.Literal("linkToPrevious", {
|
|
985
1030
|
description: "Link footer to previous section"
|
|
986
1031
|
})
|
|
987
1032
|
])
|
|
988
1033
|
),
|
|
989
|
-
pageBreak:
|
|
990
|
-
|
|
1034
|
+
pageBreak: Type8.Optional(
|
|
1035
|
+
Type8.Boolean({
|
|
991
1036
|
description: "Insert page break before section",
|
|
992
1037
|
default: true
|
|
993
1038
|
})
|
|
994
1039
|
),
|
|
995
|
-
spacing:
|
|
996
|
-
page:
|
|
997
|
-
|
|
1040
|
+
spacing: Type8.Optional(SpacingSchema),
|
|
1041
|
+
page: Type8.Optional(
|
|
1042
|
+
Type8.Object(
|
|
998
1043
|
{
|
|
999
|
-
size:
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
width:
|
|
1007
|
-
height:
|
|
1044
|
+
size: Type8.Optional(
|
|
1045
|
+
Type8.Union([
|
|
1046
|
+
Type8.Literal("A4"),
|
|
1047
|
+
Type8.Literal("A3"),
|
|
1048
|
+
Type8.Literal("LETTER"),
|
|
1049
|
+
Type8.Literal("LEGAL"),
|
|
1050
|
+
Type8.Object({
|
|
1051
|
+
width: Type8.Number({ minimum: 0 }),
|
|
1052
|
+
height: Type8.Number({ minimum: 0 })
|
|
1008
1053
|
})
|
|
1009
1054
|
])
|
|
1010
1055
|
),
|
|
1011
|
-
margins:
|
|
1012
|
-
|
|
1056
|
+
margins: Type8.Optional(
|
|
1057
|
+
Type8.Object(
|
|
1013
1058
|
{
|
|
1014
|
-
top:
|
|
1015
|
-
bottom:
|
|
1016
|
-
left:
|
|
1017
|
-
right:
|
|
1018
|
-
header:
|
|
1019
|
-
footer:
|
|
1020
|
-
gutter:
|
|
1059
|
+
top: Type8.Optional(Type8.Number({ minimum: 0 })),
|
|
1060
|
+
bottom: Type8.Optional(Type8.Number({ minimum: 0 })),
|
|
1061
|
+
left: Type8.Optional(Type8.Number({ minimum: 0 })),
|
|
1062
|
+
right: Type8.Optional(Type8.Number({ minimum: 0 })),
|
|
1063
|
+
header: Type8.Optional(Type8.Number({ minimum: 0 })),
|
|
1064
|
+
footer: Type8.Optional(Type8.Number({ minimum: 0 })),
|
|
1065
|
+
gutter: Type8.Optional(Type8.Number({ minimum: 0 }))
|
|
1021
1066
|
},
|
|
1022
1067
|
{
|
|
1023
1068
|
additionalProperties: false
|
|
@@ -1040,31 +1085,31 @@ var createSectionPropsSchema = (moduleRef) => Type7.Object(
|
|
|
1040
1085
|
var SectionPropsSchema = createSectionPropsSchema();
|
|
1041
1086
|
|
|
1042
1087
|
// src/schemas/components/columns.ts
|
|
1043
|
-
import { Type as
|
|
1044
|
-
var ColumnDescriptorSchema =
|
|
1088
|
+
import { Type as Type9 } from "@sinclair/typebox";
|
|
1089
|
+
var ColumnDescriptorSchema = Type9.Object(
|
|
1045
1090
|
{
|
|
1046
|
-
width:
|
|
1047
|
-
|
|
1048
|
-
|
|
1091
|
+
width: Type9.Optional(
|
|
1092
|
+
Type9.Union([
|
|
1093
|
+
Type9.Number({
|
|
1049
1094
|
minimum: 1,
|
|
1050
1095
|
description: "Column width in points"
|
|
1051
1096
|
}),
|
|
1052
|
-
|
|
1097
|
+
Type9.String({
|
|
1053
1098
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
1054
1099
|
description: 'Column width as percentage of available width (e.g., "30%")'
|
|
1055
1100
|
}),
|
|
1056
|
-
|
|
1101
|
+
Type9.Literal("auto", {
|
|
1057
1102
|
description: "Auto width: consume remaining space after fixed widths and gaps"
|
|
1058
1103
|
})
|
|
1059
1104
|
])
|
|
1060
1105
|
),
|
|
1061
|
-
gap:
|
|
1062
|
-
|
|
1063
|
-
|
|
1106
|
+
gap: Type9.Optional(
|
|
1107
|
+
Type9.Union([
|
|
1108
|
+
Type9.Number({
|
|
1064
1109
|
minimum: 0,
|
|
1065
1110
|
description: "Gap after this column in points"
|
|
1066
1111
|
}),
|
|
1067
|
-
|
|
1112
|
+
Type9.String({
|
|
1068
1113
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
1069
1114
|
description: 'Gap after this column as percentage of available width (e.g., "5%")'
|
|
1070
1115
|
})
|
|
@@ -1073,25 +1118,25 @@ var ColumnDescriptorSchema = Type8.Object(
|
|
|
1073
1118
|
},
|
|
1074
1119
|
{ additionalProperties: false }
|
|
1075
1120
|
);
|
|
1076
|
-
var ColumnsPropsSchema =
|
|
1121
|
+
var ColumnsPropsSchema = Type9.Object(
|
|
1077
1122
|
{
|
|
1078
|
-
columns:
|
|
1079
|
-
|
|
1123
|
+
columns: Type9.Union([
|
|
1124
|
+
Type9.Number({
|
|
1080
1125
|
minimum: 1,
|
|
1081
1126
|
description: "Number of equal-width columns (converter will normalize to array)"
|
|
1082
1127
|
}),
|
|
1083
|
-
|
|
1128
|
+
Type9.Array(ColumnDescriptorSchema, {
|
|
1084
1129
|
minItems: 1,
|
|
1085
1130
|
description: "List of columns in order; width and gap can be points, percentages, or auto width"
|
|
1086
1131
|
})
|
|
1087
1132
|
]),
|
|
1088
|
-
gap:
|
|
1089
|
-
|
|
1090
|
-
|
|
1133
|
+
gap: Type9.Optional(
|
|
1134
|
+
Type9.Union([
|
|
1135
|
+
Type9.Number({
|
|
1091
1136
|
minimum: 0,
|
|
1092
1137
|
description: "Default gap applied after each column except the last (points)"
|
|
1093
1138
|
}),
|
|
1094
|
-
|
|
1139
|
+
Type9.String({
|
|
1095
1140
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
1096
1141
|
description: 'Default gap applied after each column except the last as percentage of available width (e.g., "5%")'
|
|
1097
1142
|
})
|
|
@@ -1105,104 +1150,104 @@ var ColumnsPropsSchema = Type8.Object(
|
|
|
1105
1150
|
);
|
|
1106
1151
|
|
|
1107
1152
|
// src/schemas/components/list.ts
|
|
1108
|
-
import { Type as
|
|
1109
|
-
var LevelFormatSchema =
|
|
1153
|
+
import { Type as Type10 } from "@sinclair/typebox";
|
|
1154
|
+
var LevelFormatSchema = Type10.Union(
|
|
1110
1155
|
[
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1156
|
+
Type10.Literal("decimal"),
|
|
1157
|
+
Type10.Literal("upperRoman"),
|
|
1158
|
+
Type10.Literal("lowerRoman"),
|
|
1159
|
+
Type10.Literal("upperLetter"),
|
|
1160
|
+
Type10.Literal("lowerLetter"),
|
|
1161
|
+
Type10.Literal("bullet"),
|
|
1162
|
+
Type10.Literal("ordinal"),
|
|
1163
|
+
Type10.Literal("cardinalText"),
|
|
1164
|
+
Type10.Literal("ordinalText"),
|
|
1165
|
+
Type10.Literal("hex"),
|
|
1166
|
+
Type10.Literal("chicago"),
|
|
1167
|
+
Type10.Literal("ideographDigital"),
|
|
1168
|
+
Type10.Literal("japaneseCounting"),
|
|
1169
|
+
Type10.Literal("aiueo"),
|
|
1170
|
+
Type10.Literal("iroha"),
|
|
1171
|
+
Type10.Literal("decimalFullWidth"),
|
|
1172
|
+
Type10.Literal("decimalHalfWidth"),
|
|
1173
|
+
Type10.Literal("japaneseLegal"),
|
|
1174
|
+
Type10.Literal("japaneseDigitalTenThousand"),
|
|
1175
|
+
Type10.Literal("decimalEnclosedCircle"),
|
|
1176
|
+
Type10.Literal("decimalFullWidth2"),
|
|
1177
|
+
Type10.Literal("aiueoFullWidth"),
|
|
1178
|
+
Type10.Literal("irohaFullWidth"),
|
|
1179
|
+
Type10.Literal("decimalZero"),
|
|
1180
|
+
Type10.Literal("ganada"),
|
|
1181
|
+
Type10.Literal("chosung"),
|
|
1182
|
+
Type10.Literal("decimalEnclosedFullstop"),
|
|
1183
|
+
Type10.Literal("decimalEnclosedParen"),
|
|
1184
|
+
Type10.Literal("decimalEnclosedCircleChinese"),
|
|
1185
|
+
Type10.Literal("ideographEnclosedCircle"),
|
|
1186
|
+
Type10.Literal("ideographTraditional"),
|
|
1187
|
+
Type10.Literal("ideographZodiac"),
|
|
1188
|
+
Type10.Literal("ideographZodiacTraditional"),
|
|
1189
|
+
Type10.Literal("taiwaneseCounting"),
|
|
1190
|
+
Type10.Literal("ideographLegalTraditional"),
|
|
1191
|
+
Type10.Literal("taiwaneseCountingThousand"),
|
|
1192
|
+
Type10.Literal("taiwaneseDigital"),
|
|
1193
|
+
Type10.Literal("chineseCounting"),
|
|
1194
|
+
Type10.Literal("chineseLegalSimplified"),
|
|
1195
|
+
Type10.Literal("chineseCountingThousand"),
|
|
1196
|
+
Type10.Literal("koreanDigital"),
|
|
1197
|
+
Type10.Literal("koreanCounting"),
|
|
1198
|
+
Type10.Literal("koreanLegal"),
|
|
1199
|
+
Type10.Literal("koreanDigital2"),
|
|
1200
|
+
Type10.Literal("vietnameseCounting"),
|
|
1201
|
+
Type10.Literal("russianLower"),
|
|
1202
|
+
Type10.Literal("russianUpper"),
|
|
1203
|
+
Type10.Literal("none"),
|
|
1204
|
+
Type10.Literal("numberInDash"),
|
|
1205
|
+
Type10.Literal("hebrew1"),
|
|
1206
|
+
Type10.Literal("hebrew2"),
|
|
1207
|
+
Type10.Literal("arabicAlpha"),
|
|
1208
|
+
Type10.Literal("arabicAbjad"),
|
|
1209
|
+
Type10.Literal("hindiVowels"),
|
|
1210
|
+
Type10.Literal("hindiConsonants"),
|
|
1211
|
+
Type10.Literal("hindiNumbers"),
|
|
1212
|
+
Type10.Literal("hindiCounting"),
|
|
1213
|
+
Type10.Literal("thaiLetters"),
|
|
1214
|
+
Type10.Literal("thaiNumbers"),
|
|
1215
|
+
Type10.Literal("thaiCounting")
|
|
1171
1216
|
],
|
|
1172
1217
|
{
|
|
1173
1218
|
description: "Number or bullet format for list levels"
|
|
1174
1219
|
}
|
|
1175
1220
|
);
|
|
1176
|
-
var ListLevelPropsSchema =
|
|
1221
|
+
var ListLevelPropsSchema = Type10.Object(
|
|
1177
1222
|
{
|
|
1178
|
-
level:
|
|
1223
|
+
level: Type10.Number({
|
|
1179
1224
|
minimum: 0,
|
|
1180
1225
|
maximum: 8,
|
|
1181
1226
|
description: "Nesting level (0 = root, 1 = first sublevel, etc.)"
|
|
1182
1227
|
}),
|
|
1183
|
-
format:
|
|
1184
|
-
text:
|
|
1185
|
-
|
|
1228
|
+
format: Type10.Optional(LevelFormatSchema),
|
|
1229
|
+
text: Type10.Optional(
|
|
1230
|
+
Type10.String({
|
|
1186
1231
|
description: 'Number format string (e.g., "%1." for "1.", "%1)" for "1)", custom bullet character for bullet format)'
|
|
1187
1232
|
})
|
|
1188
1233
|
),
|
|
1189
|
-
alignment:
|
|
1190
|
-
|
|
1234
|
+
alignment: Type10.Optional(
|
|
1235
|
+
Type10.Union(
|
|
1191
1236
|
[
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1237
|
+
Type10.Literal("start"),
|
|
1238
|
+
Type10.Literal("end"),
|
|
1239
|
+
Type10.Literal("left"),
|
|
1240
|
+
Type10.Literal("right"),
|
|
1241
|
+
Type10.Literal("center")
|
|
1197
1242
|
],
|
|
1198
1243
|
{
|
|
1199
1244
|
description: "Alignment of the numbering/bullet"
|
|
1200
1245
|
}
|
|
1201
1246
|
)
|
|
1202
1247
|
),
|
|
1203
|
-
indent:
|
|
1204
|
-
start:
|
|
1205
|
-
|
|
1248
|
+
indent: Type10.Optional(IndentSchema),
|
|
1249
|
+
start: Type10.Optional(
|
|
1250
|
+
Type10.Number({
|
|
1206
1251
|
minimum: 1,
|
|
1207
1252
|
description: "Starting number for this level (default: 1)"
|
|
1208
1253
|
})
|
|
@@ -1212,20 +1257,21 @@ var ListLevelPropsSchema = Type9.Object(
|
|
|
1212
1257
|
description: "Configuration for a single list level"
|
|
1213
1258
|
}
|
|
1214
1259
|
);
|
|
1215
|
-
var ListPropsSchema =
|
|
1260
|
+
var ListPropsSchema = Type10.Object(
|
|
1216
1261
|
{
|
|
1217
|
-
items:
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
text:
|
|
1222
|
-
level:
|
|
1223
|
-
|
|
1262
|
+
items: Type10.Array(
|
|
1263
|
+
Type10.Union([
|
|
1264
|
+
Type10.String(),
|
|
1265
|
+
Type10.Object({
|
|
1266
|
+
text: Type10.String(),
|
|
1267
|
+
level: Type10.Optional(
|
|
1268
|
+
Type10.Number({
|
|
1224
1269
|
minimum: 0,
|
|
1225
1270
|
maximum: 8,
|
|
1226
1271
|
description: "Nesting level for this item"
|
|
1227
1272
|
})
|
|
1228
|
-
)
|
|
1273
|
+
),
|
|
1274
|
+
revision: Type10.Optional(RevisionSchema)
|
|
1229
1275
|
})
|
|
1230
1276
|
]),
|
|
1231
1277
|
{
|
|
@@ -1233,42 +1279,42 @@ var ListPropsSchema = Type9.Object(
|
|
|
1233
1279
|
minItems: 1
|
|
1234
1280
|
}
|
|
1235
1281
|
),
|
|
1236
|
-
reference:
|
|
1237
|
-
|
|
1282
|
+
reference: Type10.Optional(
|
|
1283
|
+
Type10.String({
|
|
1238
1284
|
description: "Unique reference ID for this numbering configuration (auto-generated if not provided)"
|
|
1239
1285
|
})
|
|
1240
1286
|
),
|
|
1241
|
-
levels:
|
|
1242
|
-
|
|
1287
|
+
levels: Type10.Optional(
|
|
1288
|
+
Type10.Array(ListLevelPropsSchema, {
|
|
1243
1289
|
description: "Configuration for each nesting level",
|
|
1244
1290
|
minItems: 1,
|
|
1245
1291
|
maxItems: 9
|
|
1246
1292
|
})
|
|
1247
1293
|
),
|
|
1248
1294
|
// Simplified options for common use cases (when levels not specified)
|
|
1249
|
-
format:
|
|
1250
|
-
|
|
1251
|
-
[LevelFormatSchema,
|
|
1295
|
+
format: Type10.Optional(
|
|
1296
|
+
Type10.Union(
|
|
1297
|
+
[LevelFormatSchema, Type10.Literal("numbered"), Type10.Literal("none")],
|
|
1252
1298
|
{
|
|
1253
1299
|
description: "Format for level 0 (simplified option when levels not specified)"
|
|
1254
1300
|
}
|
|
1255
1301
|
)
|
|
1256
1302
|
),
|
|
1257
|
-
bullet:
|
|
1258
|
-
|
|
1303
|
+
bullet: Type10.Optional(
|
|
1304
|
+
Type10.String({
|
|
1259
1305
|
description: "Custom bullet character (simplified option when levels not specified)"
|
|
1260
1306
|
})
|
|
1261
1307
|
),
|
|
1262
|
-
start:
|
|
1263
|
-
|
|
1308
|
+
start: Type10.Optional(
|
|
1309
|
+
Type10.Number({
|
|
1264
1310
|
minimum: 1,
|
|
1265
1311
|
description: "Starting number for level 0 (simplified option when levels not specified)"
|
|
1266
1312
|
})
|
|
1267
1313
|
),
|
|
1268
|
-
spacing:
|
|
1269
|
-
alignment:
|
|
1270
|
-
indent:
|
|
1271
|
-
|
|
1314
|
+
spacing: Type10.Optional(ListSpacingSchema),
|
|
1315
|
+
alignment: Type10.Optional(JustifiedAlignmentSchema),
|
|
1316
|
+
indent: Type10.Optional(
|
|
1317
|
+
Type10.Union([Type10.Number({ minimum: 0 }), IndentSchema])
|
|
1272
1318
|
)
|
|
1273
1319
|
},
|
|
1274
1320
|
{
|
|
@@ -1278,24 +1324,28 @@ var ListPropsSchema = Type9.Object(
|
|
|
1278
1324
|
);
|
|
1279
1325
|
|
|
1280
1326
|
// src/schemas/component-defaults.ts
|
|
1281
|
-
var HeadingComponentDefaultsSchema =
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
var
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
var
|
|
1288
|
-
var
|
|
1289
|
-
var
|
|
1327
|
+
var HeadingComponentDefaultsSchema = Type11.Partial(
|
|
1328
|
+
Type11.Omit(HeadingPropsSchema, ["revision"])
|
|
1329
|
+
);
|
|
1330
|
+
var ParagraphComponentDefaultsSchema = Type11.Partial(
|
|
1331
|
+
Type11.Omit(ParagraphPropsSchema, ["revision"])
|
|
1332
|
+
);
|
|
1333
|
+
var ImageComponentDefaultsSchema = Type11.Partial(ImagePropsSchema);
|
|
1334
|
+
var StatisticComponentDefaultsSchema = Type11.Partial(StatisticPropsSchema);
|
|
1335
|
+
var TableComponentDefaultsSchema = Type11.Partial(TablePropsSchema);
|
|
1336
|
+
var SectionComponentDefaultsSchema = Type11.Partial(SectionPropsSchema);
|
|
1337
|
+
var ColumnsComponentDefaultsSchema = Type11.Partial(ColumnsPropsSchema);
|
|
1338
|
+
var ListComponentDefaultsSchema = Type11.Partial(ListPropsSchema);
|
|
1339
|
+
var ComponentDefaultsSchema = Type11.Object(
|
|
1290
1340
|
{
|
|
1291
|
-
heading:
|
|
1292
|
-
paragraph:
|
|
1293
|
-
image:
|
|
1294
|
-
statistic:
|
|
1295
|
-
table:
|
|
1296
|
-
section:
|
|
1297
|
-
columns:
|
|
1298
|
-
list:
|
|
1341
|
+
heading: Type11.Optional(HeadingComponentDefaultsSchema),
|
|
1342
|
+
paragraph: Type11.Optional(ParagraphComponentDefaultsSchema),
|
|
1343
|
+
image: Type11.Optional(ImageComponentDefaultsSchema),
|
|
1344
|
+
statistic: Type11.Optional(StatisticComponentDefaultsSchema),
|
|
1345
|
+
table: Type11.Optional(TableComponentDefaultsSchema),
|
|
1346
|
+
section: Type11.Optional(SectionComponentDefaultsSchema),
|
|
1347
|
+
columns: Type11.Optional(ColumnsComponentDefaultsSchema),
|
|
1348
|
+
list: Type11.Optional(ListComponentDefaultsSchema)
|
|
1299
1349
|
},
|
|
1300
1350
|
{ additionalProperties: true }
|
|
1301
1351
|
// TODO: add a way to add strict custom component defaults when the plugin/registry paradigm will be implemented
|
|
@@ -1321,6 +1371,8 @@ export {
|
|
|
1321
1371
|
NumberingSchema,
|
|
1322
1372
|
BaseComponentFields,
|
|
1323
1373
|
BaseComponentPropsSchema,
|
|
1374
|
+
RevisionSegmentSchema,
|
|
1375
|
+
RevisionSchema,
|
|
1324
1376
|
HeadingPropsSchema,
|
|
1325
1377
|
ParagraphPropsSchema,
|
|
1326
1378
|
ImagePropsSchema,
|
|
@@ -1343,4 +1395,4 @@ export {
|
|
|
1343
1395
|
ListComponentDefaultsSchema,
|
|
1344
1396
|
ComponentDefaultsSchema
|
|
1345
1397
|
};
|
|
1346
|
-
//# sourceMappingURL=chunk-
|
|
1398
|
+
//# sourceMappingURL=chunk-CGMJ665Z.js.map
|