@json-to-office/shared-docx 0.32.0 → 0.34.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-PVZMPANS.js → chunk-436TK3T4.js} +622 -452
- package/dist/chunk-436TK3T4.js.map +1 -0
- package/dist/{chunk-LQGORQQI.js → chunk-CQHH44HX.js} +29 -23
- package/dist/chunk-CQHH44HX.js.map +1 -0
- package/dist/{chunk-3L66ZGEV.js → chunk-FG6SI4JG.js} +14 -3
- package/dist/chunk-FG6SI4JG.js.map +1 -0
- package/dist/{chunk-UJ35RKLG.js → chunk-K7PV4XUA.js} +2 -2
- package/dist/chunk-K7PV4XUA.js.map +1 -0
- package/dist/{chunk-2LF3CBBU.js → chunk-NJN6UT3A.js} +56 -3
- package/dist/chunk-NJN6UT3A.js.map +1 -0
- package/dist/{chunk-TQYAIC66.js → chunk-PSVJL2G3.js} +2 -2
- package/dist/{chunk-TJFO2OVU.js → chunk-SZCMTHGI.js} +2 -2
- package/dist/{chunk-LRYBZQL2.js → chunk-VRGM2FUX.js} +6 -6
- package/dist/chunk-VRGM2FUX.js.map +1 -0
- package/dist/{chunk-AT7DFVN7.js → chunk-Y2ME2XH6.js} +4 -2
- package/dist/chunk-Y2ME2XH6.js.map +1 -0
- package/dist/{chunk-E4OJPWK4.js → chunk-Z5WQPM4B.js} +7 -4
- package/dist/chunk-Z5WQPM4B.js.map +1 -0
- package/dist/index.d.ts +173 -16
- package/dist/index.js +295 -16
- package/dist/index.js.map +1 -1
- package/dist/schemas/api.d.ts +6 -0
- package/dist/schemas/api.js +5 -5
- package/dist/schemas/component-defaults.d.ts +76 -29
- package/dist/schemas/component-defaults.js +3 -1
- package/dist/schemas/component-registry.js +3 -3
- package/dist/schemas/components.d.ts +354 -29
- package/dist/schemas/components.js +18 -4
- package/dist/schemas/document.js +6 -6
- package/dist/schemas/export.js +4 -4
- package/dist/schemas/generator.js +4 -4
- package/dist/schemas/theme.d.ts +298 -14
- package/dist/schemas/theme.js +2 -2
- package/dist/validation/unified/index.d.ts +192 -23
- package/dist/validation/unified/index.js +8 -6
- package/package.json +5 -4
- package/dist/chunk-2LF3CBBU.js.map +0 -1
- package/dist/chunk-3L66ZGEV.js.map +0 -1
- package/dist/chunk-AT7DFVN7.js.map +0 -1
- package/dist/chunk-E4OJPWK4.js.map +0 -1
- package/dist/chunk-LQGORQQI.js.map +0 -1
- package/dist/chunk-LRYBZQL2.js.map +0 -1
- package/dist/chunk-PVZMPANS.js.map +0 -1
- package/dist/chunk-UJ35RKLG.js.map +0 -1
- /package/dist/{chunk-TQYAIC66.js.map → chunk-PSVJL2G3.js.map} +0 -0
- /package/dist/{chunk-TJFO2OVU.js.map → chunk-SZCMTHGI.js.map} +0 -0
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from "./chunk-7TTAAYQ5.js";
|
|
9
9
|
|
|
10
10
|
// src/schemas/component-defaults.ts
|
|
11
|
-
import { Type as
|
|
11
|
+
import { Type as Type13 } from "@sinclair/typebox";
|
|
12
12
|
|
|
13
13
|
// src/schemas/components/heading.ts
|
|
14
|
-
import { Type as
|
|
14
|
+
import { Type as Type4 } from "@sinclair/typebox";
|
|
15
15
|
|
|
16
16
|
// src/schemas/components/common.ts
|
|
17
17
|
import { Type } from "@sinclair/typebox";
|
|
@@ -489,56 +489,128 @@ var RevisionSchema = Type2.Object(
|
|
|
489
489
|
additionalProperties: false
|
|
490
490
|
}
|
|
491
491
|
);
|
|
492
|
+
var RevisionMarkSchema = Type2.Object(
|
|
493
|
+
{
|
|
494
|
+
type: Type2.Union([Type2.Literal("insert"), Type2.Literal("delete")], {
|
|
495
|
+
description: "Whether the element was inserted or deleted"
|
|
496
|
+
}),
|
|
497
|
+
author: Type2.Optional(
|
|
498
|
+
Type2.String({
|
|
499
|
+
description: 'Revision author shown in Word (default: "json-to-office")'
|
|
500
|
+
})
|
|
501
|
+
),
|
|
502
|
+
date: Type2.Optional(
|
|
503
|
+
Type2.String({
|
|
504
|
+
format: "date-time",
|
|
505
|
+
description: "Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"
|
|
506
|
+
})
|
|
507
|
+
)
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
description: "Structural tracked change: the element itself was inserted or deleted",
|
|
511
|
+
additionalProperties: false
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
|
|
515
|
+
// src/schemas/components/comment.ts
|
|
516
|
+
import { Type as Type3 } from "@sinclair/typebox";
|
|
517
|
+
var CommentBodyFields = {
|
|
518
|
+
text: Type3.String({
|
|
519
|
+
minLength: 1,
|
|
520
|
+
description: "Comment body. Newlines split it into separate paragraphs in the comment pane."
|
|
521
|
+
}),
|
|
522
|
+
author: Type3.Optional(
|
|
523
|
+
Type3.String({
|
|
524
|
+
description: 'Comment author shown in Word (default: "json-to-office")'
|
|
525
|
+
})
|
|
526
|
+
),
|
|
527
|
+
initials: Type3.Optional(
|
|
528
|
+
Type3.String({
|
|
529
|
+
description: "Author initials shown on the comment bubble (derived from the author when omitted)"
|
|
530
|
+
})
|
|
531
|
+
),
|
|
532
|
+
date: Type3.Optional(
|
|
533
|
+
Type3.String({
|
|
534
|
+
format: "date-time",
|
|
535
|
+
description: "Comment timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"
|
|
536
|
+
})
|
|
537
|
+
)
|
|
538
|
+
};
|
|
539
|
+
var CommentReplySchema = Type3.Object(CommentBodyFields, {
|
|
540
|
+
description: "A reply within a comment thread",
|
|
541
|
+
additionalProperties: false
|
|
542
|
+
});
|
|
543
|
+
var CommentSchema = Type3.Object(
|
|
544
|
+
{
|
|
545
|
+
...CommentBodyFields,
|
|
546
|
+
replies: Type3.Optional(
|
|
547
|
+
Type3.Array(CommentReplySchema, {
|
|
548
|
+
minItems: 1,
|
|
549
|
+
description: "Replies, in order. They anchor to the same text and Word shows them as one thread."
|
|
550
|
+
})
|
|
551
|
+
),
|
|
552
|
+
resolved: Type3.Optional(
|
|
553
|
+
Type3.Boolean({
|
|
554
|
+
description: "Mark the whole thread resolved (w15:done). Word writes the thread state only when the document contains at least one reply."
|
|
555
|
+
})
|
|
556
|
+
)
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
description: "A Word review comment anchored to this component's text",
|
|
560
|
+
additionalProperties: false
|
|
561
|
+
}
|
|
562
|
+
);
|
|
492
563
|
|
|
493
564
|
// src/schemas/components/heading.ts
|
|
494
|
-
var HeadingPropsSchema =
|
|
565
|
+
var HeadingPropsSchema = Type4.Object(
|
|
495
566
|
{
|
|
496
|
-
text:
|
|
567
|
+
text: Type4.String({
|
|
497
568
|
description: "Heading text (required)"
|
|
498
569
|
}),
|
|
499
|
-
level:
|
|
570
|
+
level: Type4.Optional(HeadingLevelSchema),
|
|
500
571
|
// Local font override: allows customizing family/size/color/bold/italic/underline
|
|
501
572
|
// without modifying theme styles. Supports partial overrides.
|
|
502
|
-
font:
|
|
573
|
+
font: Type4.Optional(Type4.Partial(FontDefinitionSchema)),
|
|
503
574
|
// Local language override (BCP-47). Falls back to the document default when omitted.
|
|
504
|
-
language:
|
|
575
|
+
language: Type4.Optional(LanguageSchema),
|
|
505
576
|
// Disable spell/grammar checking for this heading's text
|
|
506
|
-
noProof:
|
|
577
|
+
noProof: Type4.Optional(NoProofSchema),
|
|
507
578
|
// Known-words allowlist for this heading (merged with the document list)
|
|
508
|
-
noProofWords:
|
|
509
|
-
alignment:
|
|
510
|
-
spacing:
|
|
579
|
+
noProofWords: Type4.Optional(NoProofWordsSchema),
|
|
580
|
+
alignment: Type4.Optional(JustifiedAlignmentSchema),
|
|
581
|
+
spacing: Type4.Optional(SpacingSchema),
|
|
511
582
|
// Paragraph indentation (w:ind) in twips
|
|
512
|
-
indent:
|
|
513
|
-
lineSpacing:
|
|
514
|
-
|
|
583
|
+
indent: Type4.Optional(ParagraphIndentSchema),
|
|
584
|
+
lineSpacing: Type4.Optional(
|
|
585
|
+
Type4.Union([Type4.Number({ minimum: 0 }), LineSpacingSchema])
|
|
515
586
|
),
|
|
516
|
-
pageBreak:
|
|
517
|
-
|
|
587
|
+
pageBreak: Type4.Optional(
|
|
588
|
+
Type4.Boolean({
|
|
518
589
|
description: "Insert page break before heading"
|
|
519
590
|
})
|
|
520
591
|
),
|
|
521
|
-
columnBreak:
|
|
522
|
-
|
|
592
|
+
columnBreak: Type4.Optional(
|
|
593
|
+
Type4.Boolean({
|
|
523
594
|
description: "Insert column break before heading"
|
|
524
595
|
})
|
|
525
596
|
),
|
|
526
|
-
numbering:
|
|
527
|
-
|
|
597
|
+
numbering: Type4.Optional(
|
|
598
|
+
Type4.Boolean({
|
|
528
599
|
description: "Include in numbering"
|
|
529
600
|
})
|
|
530
601
|
),
|
|
531
|
-
keepNext:
|
|
532
|
-
|
|
602
|
+
keepNext: Type4.Optional(
|
|
603
|
+
Type4.Boolean({
|
|
533
604
|
description: "Keep heading with next paragraph on same page"
|
|
534
605
|
})
|
|
535
606
|
),
|
|
536
|
-
keepLines:
|
|
537
|
-
|
|
607
|
+
keepLines: Type4.Optional(
|
|
608
|
+
Type4.Boolean({
|
|
538
609
|
description: "Keep all lines of heading together on same page"
|
|
539
610
|
})
|
|
540
611
|
),
|
|
541
|
-
revision:
|
|
612
|
+
revision: Type4.Optional(RevisionSchema),
|
|
613
|
+
comment: Type4.Optional(CommentSchema)
|
|
542
614
|
},
|
|
543
615
|
{
|
|
544
616
|
description: "Heading component props",
|
|
@@ -547,63 +619,93 @@ var HeadingPropsSchema = Type3.Object(
|
|
|
547
619
|
);
|
|
548
620
|
|
|
549
621
|
// src/schemas/components/paragraph.ts
|
|
550
|
-
import { Type as
|
|
551
|
-
|
|
622
|
+
import { Type as Type6 } from "@sinclair/typebox";
|
|
623
|
+
|
|
624
|
+
// src/schemas/components/note.ts
|
|
625
|
+
import { Type as Type5 } from "@sinclair/typebox";
|
|
626
|
+
var NoteSchema = Type5.Object(
|
|
627
|
+
{
|
|
628
|
+
id: Type5.String({
|
|
629
|
+
minLength: 1,
|
|
630
|
+
pattern: "^[^\\]\\s]+$",
|
|
631
|
+
description: 'Marker id referenced from the text as `[^id]`. Any characters except whitespace and "]".'
|
|
632
|
+
}),
|
|
633
|
+
text: Type5.String({
|
|
634
|
+
minLength: 1,
|
|
635
|
+
description: "Note body. Newlines split it into separate paragraphs where the note is placed."
|
|
636
|
+
})
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
description: "A note body bound to an inline `[^id]` marker",
|
|
640
|
+
additionalProperties: false
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
var FootnotesSchema = Type5.Array(NoteSchema, {
|
|
644
|
+
description: "Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.",
|
|
645
|
+
minItems: 1
|
|
646
|
+
});
|
|
647
|
+
var EndnotesSchema = Type5.Array(NoteSchema, {
|
|
648
|
+
description: "Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.",
|
|
649
|
+
minItems: 1
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
// src/schemas/components/paragraph.ts
|
|
653
|
+
var FrameWrapTypeSchema = Type6.Union(
|
|
552
654
|
[
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
655
|
+
Type6.Literal("around"),
|
|
656
|
+
Type6.Literal("none"),
|
|
657
|
+
Type6.Literal("notBeside"),
|
|
658
|
+
Type6.Literal("through"),
|
|
659
|
+
Type6.Literal("tight"),
|
|
660
|
+
Type6.Literal("auto")
|
|
559
661
|
],
|
|
560
662
|
{
|
|
561
663
|
description: "Frame text wrapping type"
|
|
562
664
|
}
|
|
563
665
|
);
|
|
564
|
-
var FrameAnchorTypeSchema =
|
|
565
|
-
[
|
|
666
|
+
var FrameAnchorTypeSchema = Type6.Union(
|
|
667
|
+
[Type6.Literal("margin"), Type6.Literal("page"), Type6.Literal("text")],
|
|
566
668
|
{
|
|
567
669
|
description: "Frame anchor type"
|
|
568
670
|
}
|
|
569
671
|
);
|
|
570
|
-
var FrameHorizontalAlignSchema =
|
|
672
|
+
var FrameHorizontalAlignSchema = Type6.Union(
|
|
571
673
|
[
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
674
|
+
Type6.Literal("left"),
|
|
675
|
+
Type6.Literal("center"),
|
|
676
|
+
Type6.Literal("right"),
|
|
677
|
+
Type6.Literal("inside"),
|
|
678
|
+
Type6.Literal("outside")
|
|
577
679
|
],
|
|
578
680
|
{
|
|
579
681
|
description: "Frame horizontal alignment"
|
|
580
682
|
}
|
|
581
683
|
);
|
|
582
|
-
var FrameVerticalAlignSchema =
|
|
684
|
+
var FrameVerticalAlignSchema = Type6.Union(
|
|
583
685
|
[
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
686
|
+
Type6.Literal("top"),
|
|
687
|
+
Type6.Literal("center"),
|
|
688
|
+
Type6.Literal("bottom"),
|
|
689
|
+
Type6.Literal("inside"),
|
|
690
|
+
Type6.Literal("outside")
|
|
589
691
|
],
|
|
590
692
|
{
|
|
591
693
|
description: "Frame vertical alignment"
|
|
592
694
|
}
|
|
593
695
|
);
|
|
594
|
-
var FloatingFramePropertiesSchema =
|
|
696
|
+
var FloatingFramePropertiesSchema = Type6.Object(
|
|
595
697
|
{
|
|
596
|
-
horizontalPosition:
|
|
597
|
-
|
|
698
|
+
horizontalPosition: Type6.Optional(
|
|
699
|
+
Type6.Object(
|
|
598
700
|
{
|
|
599
|
-
relative:
|
|
600
|
-
align:
|
|
601
|
-
offset:
|
|
602
|
-
|
|
603
|
-
|
|
701
|
+
relative: Type6.Optional(FrameAnchorTypeSchema),
|
|
702
|
+
align: Type6.Optional(FrameHorizontalAlignSchema),
|
|
703
|
+
offset: Type6.Optional(
|
|
704
|
+
Type6.Union([
|
|
705
|
+
Type6.Number({
|
|
604
706
|
description: "Horizontal offset in twips (1/20 of a point)"
|
|
605
707
|
}),
|
|
606
|
-
|
|
708
|
+
Type6.String({
|
|
607
709
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
608
710
|
description: 'Horizontal offset as percentage (e.g., "50%") relative to page or margin width'
|
|
609
711
|
})
|
|
@@ -616,17 +718,17 @@ var FloatingFramePropertiesSchema = Type4.Object(
|
|
|
616
718
|
}
|
|
617
719
|
)
|
|
618
720
|
),
|
|
619
|
-
verticalPosition:
|
|
620
|
-
|
|
721
|
+
verticalPosition: Type6.Optional(
|
|
722
|
+
Type6.Object(
|
|
621
723
|
{
|
|
622
|
-
relative:
|
|
623
|
-
align:
|
|
624
|
-
offset:
|
|
625
|
-
|
|
626
|
-
|
|
724
|
+
relative: Type6.Optional(FrameAnchorTypeSchema),
|
|
725
|
+
align: Type6.Optional(FrameVerticalAlignSchema),
|
|
726
|
+
offset: Type6.Optional(
|
|
727
|
+
Type6.Union([
|
|
728
|
+
Type6.Number({
|
|
627
729
|
description: "Vertical offset in twips (1/20 of a point)"
|
|
628
730
|
}),
|
|
629
|
-
|
|
731
|
+
Type6.String({
|
|
630
732
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
631
733
|
description: 'Vertical offset as percentage (e.g., "50%") relative to page or margin height'
|
|
632
734
|
})
|
|
@@ -639,8 +741,8 @@ var FloatingFramePropertiesSchema = Type4.Object(
|
|
|
639
741
|
}
|
|
640
742
|
)
|
|
641
743
|
),
|
|
642
|
-
wrap:
|
|
643
|
-
|
|
744
|
+
wrap: Type6.Optional(
|
|
745
|
+
Type6.Object(
|
|
644
746
|
{
|
|
645
747
|
type: FrameWrapTypeSchema
|
|
646
748
|
},
|
|
@@ -650,19 +752,19 @@ var FloatingFramePropertiesSchema = Type4.Object(
|
|
|
650
752
|
}
|
|
651
753
|
)
|
|
652
754
|
),
|
|
653
|
-
lockAnchor:
|
|
654
|
-
|
|
755
|
+
lockAnchor: Type6.Optional(
|
|
756
|
+
Type6.Boolean({
|
|
655
757
|
description: "Lock the anchor position"
|
|
656
758
|
})
|
|
657
759
|
),
|
|
658
|
-
width:
|
|
659
|
-
|
|
760
|
+
width: Type6.Optional(
|
|
761
|
+
Type6.Number({
|
|
660
762
|
minimum: 1,
|
|
661
763
|
description: "Frame width in twips (DXA units)"
|
|
662
764
|
})
|
|
663
765
|
),
|
|
664
|
-
height:
|
|
665
|
-
|
|
766
|
+
height: Type6.Optional(
|
|
767
|
+
Type6.Number({
|
|
666
768
|
minimum: 1,
|
|
667
769
|
description: "Frame height in twips (DXA units)"
|
|
668
770
|
})
|
|
@@ -673,71 +775,74 @@ var FloatingFramePropertiesSchema = Type4.Object(
|
|
|
673
775
|
additionalProperties: false
|
|
674
776
|
}
|
|
675
777
|
);
|
|
676
|
-
var AlignmentSchema2 =
|
|
778
|
+
var AlignmentSchema2 = Type6.Union(
|
|
677
779
|
[
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
780
|
+
Type6.Literal("left"),
|
|
781
|
+
Type6.Literal("center"),
|
|
782
|
+
Type6.Literal("right"),
|
|
783
|
+
Type6.Literal("justify")
|
|
682
784
|
],
|
|
683
785
|
{
|
|
684
786
|
description: "Paragraph text alignment"
|
|
685
787
|
}
|
|
686
788
|
);
|
|
687
|
-
var ParagraphPropsSchema =
|
|
789
|
+
var ParagraphPropsSchema = Type6.Object(
|
|
688
790
|
{
|
|
689
|
-
text:
|
|
791
|
+
text: Type6.String({
|
|
690
792
|
description: "Text content (required)"
|
|
691
793
|
}),
|
|
692
794
|
// New nested font object, aligned with theme's FontDefinitionSchema
|
|
693
795
|
// Allow partial overrides (family not required when overriding a subset)
|
|
694
|
-
font:
|
|
796
|
+
font: Type6.Optional(Type6.Partial(FontDefinitionSchema)),
|
|
695
797
|
// Optional reference to a named style from theme.styles (e.g., 'heading1', 'normal')
|
|
696
|
-
themeStyle:
|
|
798
|
+
themeStyle: Type6.Optional(Type6.String()),
|
|
697
799
|
// Local language override (BCP-47). Falls back to the document default when omitted.
|
|
698
|
-
language:
|
|
800
|
+
language: Type6.Optional(LanguageSchema),
|
|
699
801
|
// Disable spell/grammar checking for this paragraph's text
|
|
700
|
-
noProof:
|
|
802
|
+
noProof: Type6.Optional(NoProofSchema),
|
|
701
803
|
// Known-words allowlist for this paragraph (merged with the document list)
|
|
702
|
-
noProofWords:
|
|
804
|
+
noProofWords: Type6.Optional(NoProofWordsSchema),
|
|
703
805
|
// Rich-text decoration color for bold segments (kept as top-level behavior
|
|
704
806
|
// option). Same value space as font.color: hex or theme color token.
|
|
705
|
-
boldColor:
|
|
807
|
+
boldColor: Type6.Optional(HexColorSchema),
|
|
706
808
|
// Paragraph spacing (in points) — limited paragraph-level option allowed
|
|
707
|
-
spacing:
|
|
809
|
+
spacing: Type6.Optional(SpacingSchema),
|
|
708
810
|
// Paragraph alignment (moved from font to config level)
|
|
709
|
-
alignment:
|
|
811
|
+
alignment: Type6.Optional(AlignmentSchema2),
|
|
710
812
|
// Paragraph indentation (w:ind) in twips
|
|
711
|
-
indent:
|
|
813
|
+
indent: Type6.Optional(ParagraphIndentSchema),
|
|
712
814
|
// Tab stops (w:tabs); tab characters (\t) in text jump to these positions
|
|
713
|
-
tabStops:
|
|
714
|
-
pageBreak:
|
|
715
|
-
|
|
815
|
+
tabStops: Type6.Optional(TabStopsSchema),
|
|
816
|
+
pageBreak: Type6.Optional(
|
|
817
|
+
Type6.Boolean({
|
|
716
818
|
description: "Insert page break before paragraph"
|
|
717
819
|
})
|
|
718
820
|
),
|
|
719
|
-
columnBreak:
|
|
720
|
-
|
|
821
|
+
columnBreak: Type6.Optional(
|
|
822
|
+
Type6.Boolean({
|
|
721
823
|
description: "Insert column break before paragraph"
|
|
722
824
|
})
|
|
723
825
|
),
|
|
724
|
-
floating:
|
|
725
|
-
keepNext:
|
|
726
|
-
|
|
826
|
+
floating: Type6.Optional(FloatingFramePropertiesSchema),
|
|
827
|
+
keepNext: Type6.Optional(
|
|
828
|
+
Type6.Boolean({
|
|
727
829
|
description: "Keep paragraph with next paragraph on same page"
|
|
728
830
|
})
|
|
729
831
|
),
|
|
730
|
-
keepLines:
|
|
731
|
-
|
|
832
|
+
keepLines: Type6.Optional(
|
|
833
|
+
Type6.Boolean({
|
|
732
834
|
description: "Keep all lines of paragraph together on same page"
|
|
733
835
|
})
|
|
734
836
|
),
|
|
735
|
-
id:
|
|
736
|
-
|
|
837
|
+
id: Type6.Optional(
|
|
838
|
+
Type6.String({
|
|
737
839
|
description: "Unique identifier for internal linking (bookmark anchor)"
|
|
738
840
|
})
|
|
739
841
|
),
|
|
740
|
-
revision:
|
|
842
|
+
revision: Type6.Optional(RevisionSchema),
|
|
843
|
+
comment: Type6.Optional(CommentSchema),
|
|
844
|
+
footnotes: Type6.Optional(FootnotesSchema),
|
|
845
|
+
endnotes: Type6.Optional(EndnotesSchema)
|
|
741
846
|
},
|
|
742
847
|
{
|
|
743
848
|
description: "Paragraph component props (font nested for theme consistency; no flat font properties)",
|
|
@@ -746,37 +851,37 @@ var ParagraphPropsSchema = Type4.Object(
|
|
|
746
851
|
);
|
|
747
852
|
|
|
748
853
|
// src/schemas/components/image.ts
|
|
749
|
-
import { Type as
|
|
750
|
-
var ImagePropsSchema =
|
|
854
|
+
import { Type as Type7 } from "@sinclair/typebox";
|
|
855
|
+
var ImagePropsSchema = Type7.Object(
|
|
751
856
|
{
|
|
752
|
-
path:
|
|
753
|
-
|
|
857
|
+
path: Type7.Optional(
|
|
858
|
+
Type7.String({
|
|
754
859
|
description: "Image source URL or file path (mutually exclusive with base64 and svg)"
|
|
755
860
|
})
|
|
756
861
|
),
|
|
757
|
-
base64:
|
|
758
|
-
|
|
862
|
+
base64: Type7.Optional(
|
|
863
|
+
Type7.String({
|
|
759
864
|
description: 'Base64-encoded image data in data URI format (e.g., "data:image/png;base64,iVBORw0KGgo...") (mutually exclusive with path and svg)'
|
|
760
865
|
})
|
|
761
866
|
),
|
|
762
|
-
svg:
|
|
763
|
-
|
|
867
|
+
svg: Type7.Optional(
|
|
868
|
+
Type7.String({
|
|
764
869
|
description: 'Raw inline SVG markup, e.g. "<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">...</svg>" (mutually exclusive with path and base64). Renders as a vector image (Word 2016+); intrinsic size taken from the SVG viewBox/width/height when width/height omitted.'
|
|
765
870
|
})
|
|
766
871
|
),
|
|
767
|
-
alt:
|
|
768
|
-
|
|
872
|
+
alt: Type7.Optional(
|
|
873
|
+
Type7.String({
|
|
769
874
|
description: "Alternative text for accessibility"
|
|
770
875
|
})
|
|
771
876
|
),
|
|
772
|
-
width:
|
|
773
|
-
|
|
877
|
+
width: Type7.Optional(
|
|
878
|
+
Type7.Union(
|
|
774
879
|
[
|
|
775
|
-
|
|
880
|
+
Type7.Number({
|
|
776
881
|
minimum: 1,
|
|
777
882
|
description: "Image width in pixels"
|
|
778
883
|
}),
|
|
779
|
-
|
|
884
|
+
Type7.String({
|
|
780
885
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
781
886
|
description: 'Image width as percentage (e.g., "90%") relative to widthRelativeTo (defaults to content width)'
|
|
782
887
|
})
|
|
@@ -787,14 +892,14 @@ var ImagePropsSchema = Type5.Object(
|
|
|
787
892
|
}
|
|
788
893
|
)
|
|
789
894
|
),
|
|
790
|
-
height:
|
|
791
|
-
|
|
895
|
+
height: Type7.Optional(
|
|
896
|
+
Type7.Union(
|
|
792
897
|
[
|
|
793
|
-
|
|
898
|
+
Type7.Number({
|
|
794
899
|
minimum: 1,
|
|
795
900
|
description: "Image height in pixels"
|
|
796
901
|
}),
|
|
797
|
-
|
|
902
|
+
Type7.String({
|
|
798
903
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
799
904
|
description: 'Image height as percentage (e.g., "90%") relative to heightRelativeTo (defaults to content height)'
|
|
800
905
|
})
|
|
@@ -804,33 +909,33 @@ var ImagePropsSchema = Type5.Object(
|
|
|
804
909
|
}
|
|
805
910
|
)
|
|
806
911
|
),
|
|
807
|
-
widthRelativeTo:
|
|
808
|
-
|
|
912
|
+
widthRelativeTo: Type7.Optional(
|
|
913
|
+
Type7.Union([Type7.Literal("content"), Type7.Literal("page")], {
|
|
809
914
|
description: "Reference for width percentages: content (page width minus margins) or page (full page width)",
|
|
810
915
|
default: "content"
|
|
811
916
|
})
|
|
812
917
|
),
|
|
813
|
-
heightRelativeTo:
|
|
814
|
-
|
|
918
|
+
heightRelativeTo: Type7.Optional(
|
|
919
|
+
Type7.Union([Type7.Literal("content"), Type7.Literal("page")], {
|
|
815
920
|
description: "Reference for height percentages: content (page height minus margins) or page (full page height)",
|
|
816
921
|
default: "content"
|
|
817
922
|
})
|
|
818
923
|
),
|
|
819
|
-
alignment:
|
|
820
|
-
caption:
|
|
821
|
-
|
|
924
|
+
alignment: Type7.Optional(AlignmentSchema),
|
|
925
|
+
caption: Type7.Optional(
|
|
926
|
+
Type7.String({
|
|
822
927
|
description: "Image caption (supports rich text with **bold**, *italic*, ***both***)"
|
|
823
928
|
})
|
|
824
929
|
),
|
|
825
|
-
spacing:
|
|
826
|
-
floating:
|
|
827
|
-
keepNext:
|
|
828
|
-
|
|
930
|
+
spacing: Type7.Optional(SpacingSchema),
|
|
931
|
+
floating: Type7.Optional(FloatingPropertiesSchema),
|
|
932
|
+
keepNext: Type7.Optional(
|
|
933
|
+
Type7.Boolean({
|
|
829
934
|
description: "Keep paragraph with next paragraph on same page"
|
|
830
935
|
})
|
|
831
936
|
),
|
|
832
|
-
keepLines:
|
|
833
|
-
|
|
937
|
+
keepLines: Type7.Optional(
|
|
938
|
+
Type7.Boolean({
|
|
834
939
|
description: "Keep all lines of paragraph together on same page"
|
|
835
940
|
})
|
|
836
941
|
)
|
|
@@ -842,40 +947,40 @@ var ImagePropsSchema = Type5.Object(
|
|
|
842
947
|
);
|
|
843
948
|
|
|
844
949
|
// src/schemas/components/statistic.ts
|
|
845
|
-
import { Type as
|
|
846
|
-
var StatisticPropsSchema =
|
|
950
|
+
import { Type as Type8 } from "@sinclair/typebox";
|
|
951
|
+
var StatisticPropsSchema = Type8.Object(
|
|
847
952
|
{
|
|
848
|
-
number:
|
|
953
|
+
number: Type8.String({
|
|
849
954
|
description: "Statistic number/value (required)"
|
|
850
955
|
}),
|
|
851
|
-
description:
|
|
956
|
+
description: Type8.String({
|
|
852
957
|
description: "Statistic description (required)"
|
|
853
958
|
}),
|
|
854
|
-
unit:
|
|
855
|
-
|
|
959
|
+
unit: Type8.Optional(
|
|
960
|
+
Type8.String({
|
|
856
961
|
description: "Unit of measurement"
|
|
857
962
|
})
|
|
858
963
|
),
|
|
859
|
-
format:
|
|
860
|
-
|
|
964
|
+
format: Type8.Optional(
|
|
965
|
+
Type8.String({
|
|
861
966
|
description: "Number format pattern"
|
|
862
967
|
})
|
|
863
968
|
),
|
|
864
|
-
trend:
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
969
|
+
trend: Type8.Optional(
|
|
970
|
+
Type8.Union([
|
|
971
|
+
Type8.Literal("up"),
|
|
972
|
+
Type8.Literal("down"),
|
|
973
|
+
Type8.Literal("neutral")
|
|
869
974
|
])
|
|
870
975
|
),
|
|
871
|
-
trendValue:
|
|
872
|
-
alignment:
|
|
873
|
-
spacing:
|
|
874
|
-
size:
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
976
|
+
trendValue: Type8.Optional(Type8.Union([Type8.String(), Type8.Number()])),
|
|
977
|
+
alignment: Type8.Optional(AlignmentSchema),
|
|
978
|
+
spacing: Type8.Optional(SpacingSchema),
|
|
979
|
+
size: Type8.Optional(
|
|
980
|
+
Type8.Union([
|
|
981
|
+
Type8.Literal("small"),
|
|
982
|
+
Type8.Literal("medium"),
|
|
983
|
+
Type8.Literal("large")
|
|
879
984
|
])
|
|
880
985
|
)
|
|
881
986
|
},
|
|
@@ -886,112 +991,112 @@ var StatisticPropsSchema = Type6.Object(
|
|
|
886
991
|
);
|
|
887
992
|
|
|
888
993
|
// src/schemas/components/table.ts
|
|
889
|
-
import { Type as
|
|
890
|
-
var CellContentSchema =
|
|
891
|
-
(This) =>
|
|
892
|
-
|
|
893
|
-
|
|
994
|
+
import { Type as Type9 } from "@sinclair/typebox";
|
|
995
|
+
var CellContentSchema = Type9.Recursive(
|
|
996
|
+
(This) => Type9.Union([
|
|
997
|
+
Type9.String(),
|
|
998
|
+
Type9.Object(
|
|
894
999
|
{
|
|
895
|
-
name:
|
|
896
|
-
props:
|
|
897
|
-
children:
|
|
1000
|
+
name: Type9.String(),
|
|
1001
|
+
props: Type9.Object({}, { additionalProperties: true }),
|
|
1002
|
+
children: Type9.Optional(Type9.Array(This))
|
|
898
1003
|
},
|
|
899
1004
|
{ additionalProperties: false }
|
|
900
1005
|
)
|
|
901
1006
|
])
|
|
902
1007
|
);
|
|
903
|
-
var HorizontalAlignmentSchema =
|
|
1008
|
+
var HorizontalAlignmentSchema = Type9.Union(
|
|
904
1009
|
[
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1010
|
+
Type9.Literal("left"),
|
|
1011
|
+
Type9.Literal("center"),
|
|
1012
|
+
Type9.Literal("right"),
|
|
1013
|
+
Type9.Literal("justify")
|
|
909
1014
|
],
|
|
910
1015
|
{ description: "Horizontal text alignment" }
|
|
911
1016
|
);
|
|
912
|
-
var VerticalAlignmentSchema =
|
|
913
|
-
[
|
|
1017
|
+
var VerticalAlignmentSchema = Type9.Union(
|
|
1018
|
+
[Type9.Literal("top"), Type9.Literal("middle"), Type9.Literal("bottom")],
|
|
914
1019
|
{ description: "Vertical cell alignment" }
|
|
915
1020
|
);
|
|
916
|
-
var FontConfigSchema =
|
|
1021
|
+
var FontConfigSchema = Type9.Object(
|
|
917
1022
|
{
|
|
918
|
-
family:
|
|
919
|
-
size:
|
|
920
|
-
|
|
1023
|
+
family: Type9.Optional(Type9.String({ description: "Font family name" })),
|
|
1024
|
+
size: Type9.Optional(
|
|
1025
|
+
Type9.Number({ minimum: 0, description: "Font size in points" })
|
|
921
1026
|
),
|
|
922
|
-
bold:
|
|
923
|
-
fontWeight:
|
|
924
|
-
|
|
1027
|
+
bold: Type9.Optional(Type9.Boolean({ description: "Bold text" })),
|
|
1028
|
+
fontWeight: Type9.Optional(
|
|
1029
|
+
Type9.Integer({
|
|
925
1030
|
minimum: 100,
|
|
926
1031
|
maximum: 900,
|
|
927
1032
|
description: "Per-cell weight (100\u2013900). Overrides `bold` when set."
|
|
928
1033
|
})
|
|
929
1034
|
),
|
|
930
|
-
italic:
|
|
931
|
-
underline:
|
|
1035
|
+
italic: Type9.Optional(Type9.Boolean({ description: "Italic text" })),
|
|
1036
|
+
underline: Type9.Optional(Type9.Boolean({ description: "Underlined text" }))
|
|
932
1037
|
},
|
|
933
1038
|
{ additionalProperties: false }
|
|
934
1039
|
);
|
|
935
|
-
var BorderColorSchema =
|
|
936
|
-
|
|
937
|
-
|
|
1040
|
+
var BorderColorSchema = Type9.Union([
|
|
1041
|
+
Type9.String({ description: "Border color for all sides (hex without #)" }),
|
|
1042
|
+
Type9.Object(
|
|
938
1043
|
{
|
|
939
|
-
bottom:
|
|
940
|
-
|
|
1044
|
+
bottom: Type9.Optional(
|
|
1045
|
+
Type9.String({ description: "Bottom border color (hex without #)" })
|
|
941
1046
|
),
|
|
942
|
-
top:
|
|
943
|
-
|
|
1047
|
+
top: Type9.Optional(
|
|
1048
|
+
Type9.String({ description: "Top border color (hex without #)" })
|
|
944
1049
|
),
|
|
945
|
-
right:
|
|
946
|
-
|
|
1050
|
+
right: Type9.Optional(
|
|
1051
|
+
Type9.String({ description: "Right border color (hex without #)" })
|
|
947
1052
|
),
|
|
948
|
-
left:
|
|
949
|
-
|
|
1053
|
+
left: Type9.Optional(
|
|
1054
|
+
Type9.String({ description: "Left border color (hex without #)" })
|
|
950
1055
|
)
|
|
951
1056
|
},
|
|
952
1057
|
{ additionalProperties: false }
|
|
953
1058
|
)
|
|
954
1059
|
]);
|
|
955
|
-
var BorderSizeSchema =
|
|
956
|
-
|
|
1060
|
+
var BorderSizeSchema = Type9.Union([
|
|
1061
|
+
Type9.Number({
|
|
957
1062
|
minimum: 0,
|
|
958
1063
|
description: "Border size for all sides in points"
|
|
959
1064
|
}),
|
|
960
|
-
|
|
1065
|
+
Type9.Object(
|
|
961
1066
|
{
|
|
962
|
-
bottom:
|
|
963
|
-
|
|
1067
|
+
bottom: Type9.Optional(
|
|
1068
|
+
Type9.Number({ minimum: 0, description: "Bottom border size in points" })
|
|
964
1069
|
),
|
|
965
|
-
top:
|
|
966
|
-
|
|
1070
|
+
top: Type9.Optional(
|
|
1071
|
+
Type9.Number({ minimum: 0, description: "Top border size in points" })
|
|
967
1072
|
),
|
|
968
|
-
right:
|
|
969
|
-
|
|
1073
|
+
right: Type9.Optional(
|
|
1074
|
+
Type9.Number({ minimum: 0, description: "Right border size in points" })
|
|
970
1075
|
),
|
|
971
|
-
left:
|
|
972
|
-
|
|
1076
|
+
left: Type9.Optional(
|
|
1077
|
+
Type9.Number({ minimum: 0, description: "Left border size in points" })
|
|
973
1078
|
)
|
|
974
1079
|
},
|
|
975
1080
|
{ additionalProperties: false }
|
|
976
1081
|
)
|
|
977
1082
|
]);
|
|
978
|
-
var HideBordersSchema =
|
|
979
|
-
|
|
1083
|
+
var HideBordersSchema = Type9.Union([
|
|
1084
|
+
Type9.Boolean({
|
|
980
1085
|
description: "Hide all borders when true"
|
|
981
1086
|
}),
|
|
982
|
-
|
|
1087
|
+
Type9.Object(
|
|
983
1088
|
{
|
|
984
|
-
bottom:
|
|
985
|
-
|
|
1089
|
+
bottom: Type9.Optional(
|
|
1090
|
+
Type9.Boolean({ description: "Hide bottom border" })
|
|
986
1091
|
),
|
|
987
|
-
top:
|
|
988
|
-
right:
|
|
989
|
-
left:
|
|
990
|
-
insideHorizontal:
|
|
991
|
-
|
|
1092
|
+
top: Type9.Optional(Type9.Boolean({ description: "Hide top border" })),
|
|
1093
|
+
right: Type9.Optional(Type9.Boolean({ description: "Hide right border" })),
|
|
1094
|
+
left: Type9.Optional(Type9.Boolean({ description: "Hide left border" })),
|
|
1095
|
+
insideHorizontal: Type9.Optional(
|
|
1096
|
+
Type9.Boolean({ description: "Hide horizontal borders between rows" })
|
|
992
1097
|
),
|
|
993
|
-
insideVertical:
|
|
994
|
-
|
|
1098
|
+
insideVertical: Type9.Optional(
|
|
1099
|
+
Type9.Boolean({ description: "Hide vertical borders between columns" })
|
|
995
1100
|
)
|
|
996
1101
|
},
|
|
997
1102
|
{
|
|
@@ -1000,121 +1105,146 @@ var HideBordersSchema = Type7.Union([
|
|
|
1000
1105
|
}
|
|
1001
1106
|
)
|
|
1002
1107
|
]);
|
|
1003
|
-
var PaddingSchema =
|
|
1004
|
-
|
|
1005
|
-
|
|
1108
|
+
var PaddingSchema = Type9.Union([
|
|
1109
|
+
Type9.Number({ minimum: 0, description: "Padding for all sides in points" }),
|
|
1110
|
+
Type9.Object(
|
|
1006
1111
|
{
|
|
1007
|
-
bottom:
|
|
1008
|
-
|
|
1112
|
+
bottom: Type9.Optional(
|
|
1113
|
+
Type9.Number({ minimum: 0, description: "Bottom padding in points" })
|
|
1009
1114
|
),
|
|
1010
|
-
top:
|
|
1011
|
-
|
|
1115
|
+
top: Type9.Optional(
|
|
1116
|
+
Type9.Number({ minimum: 0, description: "Top padding in points" })
|
|
1012
1117
|
),
|
|
1013
|
-
right:
|
|
1014
|
-
|
|
1118
|
+
right: Type9.Optional(
|
|
1119
|
+
Type9.Number({ minimum: 0, description: "Right padding in points" })
|
|
1015
1120
|
),
|
|
1016
|
-
left:
|
|
1017
|
-
|
|
1121
|
+
left: Type9.Optional(
|
|
1122
|
+
Type9.Number({ minimum: 0, description: "Left padding in points" })
|
|
1018
1123
|
)
|
|
1019
1124
|
},
|
|
1020
1125
|
{ additionalProperties: false }
|
|
1021
1126
|
)
|
|
1022
1127
|
]);
|
|
1023
|
-
var CellDefaultsSchema =
|
|
1128
|
+
var CellDefaultsSchema = Type9.Object(
|
|
1024
1129
|
{
|
|
1025
|
-
color:
|
|
1026
|
-
backgroundColor:
|
|
1027
|
-
horizontalAlignment:
|
|
1028
|
-
verticalAlignment:
|
|
1029
|
-
font:
|
|
1030
|
-
borderColor:
|
|
1031
|
-
borderSize:
|
|
1032
|
-
padding:
|
|
1033
|
-
height:
|
|
1034
|
-
|
|
1130
|
+
color: Type9.Optional(HexColorSchema),
|
|
1131
|
+
backgroundColor: Type9.Optional(HexColorOrTransparentSchema),
|
|
1132
|
+
horizontalAlignment: Type9.Optional(HorizontalAlignmentSchema),
|
|
1133
|
+
verticalAlignment: Type9.Optional(VerticalAlignmentSchema),
|
|
1134
|
+
font: Type9.Optional(FontConfigSchema),
|
|
1135
|
+
borderColor: Type9.Optional(BorderColorSchema),
|
|
1136
|
+
borderSize: Type9.Optional(BorderSizeSchema),
|
|
1137
|
+
padding: Type9.Optional(PaddingSchema),
|
|
1138
|
+
height: Type9.Optional(
|
|
1139
|
+
Type9.Number({ minimum: 0, description: "Cell height in points" })
|
|
1035
1140
|
)
|
|
1036
1141
|
},
|
|
1037
1142
|
{ additionalProperties: false }
|
|
1038
1143
|
);
|
|
1039
1144
|
function createTablePropsSchema(componentRef) {
|
|
1040
|
-
const cellContent =
|
|
1145
|
+
const cellContent = Type9.Union([Type9.String(), componentRef]);
|
|
1041
1146
|
const cellFields = {
|
|
1042
|
-
color:
|
|
1043
|
-
backgroundColor:
|
|
1044
|
-
horizontalAlignment:
|
|
1045
|
-
verticalAlignment:
|
|
1046
|
-
font:
|
|
1047
|
-
borderColor:
|
|
1048
|
-
borderSize:
|
|
1049
|
-
padding:
|
|
1050
|
-
height:
|
|
1051
|
-
|
|
1052
|
-
)
|
|
1147
|
+
color: Type9.Optional(HexColorSchema),
|
|
1148
|
+
backgroundColor: Type9.Optional(HexColorOrTransparentSchema),
|
|
1149
|
+
horizontalAlignment: Type9.Optional(HorizontalAlignmentSchema),
|
|
1150
|
+
verticalAlignment: Type9.Optional(VerticalAlignmentSchema),
|
|
1151
|
+
font: Type9.Optional(FontConfigSchema),
|
|
1152
|
+
borderColor: Type9.Optional(BorderColorSchema),
|
|
1153
|
+
borderSize: Type9.Optional(BorderSizeSchema),
|
|
1154
|
+
padding: Type9.Optional(PaddingSchema),
|
|
1155
|
+
height: Type9.Optional(
|
|
1156
|
+
Type9.Number({ minimum: 0, description: "Cell height in points" })
|
|
1157
|
+
),
|
|
1158
|
+
comment: Type9.Optional(CommentSchema),
|
|
1159
|
+
revision: Type9.Optional(RevisionSchema)
|
|
1053
1160
|
};
|
|
1054
|
-
const headerSchema =
|
|
1161
|
+
const headerSchema = Type9.Object(
|
|
1055
1162
|
{
|
|
1056
1163
|
...cellFields,
|
|
1057
|
-
content:
|
|
1164
|
+
content: Type9.Optional(cellContent)
|
|
1058
1165
|
},
|
|
1059
1166
|
{ additionalProperties: false }
|
|
1060
1167
|
);
|
|
1061
|
-
const cellSchema =
|
|
1168
|
+
const cellSchema = Type9.Object(
|
|
1062
1169
|
{
|
|
1063
1170
|
...cellFields,
|
|
1064
|
-
content:
|
|
1171
|
+
content: Type9.Optional(cellContent)
|
|
1065
1172
|
},
|
|
1066
1173
|
{ additionalProperties: false }
|
|
1067
1174
|
);
|
|
1068
|
-
const columnSchema =
|
|
1175
|
+
const columnSchema = Type9.Object(
|
|
1069
1176
|
{
|
|
1070
|
-
width:
|
|
1071
|
-
|
|
1072
|
-
|
|
1177
|
+
width: Type9.Optional(
|
|
1178
|
+
Type9.Union([
|
|
1179
|
+
Type9.Number({
|
|
1073
1180
|
minimum: 0,
|
|
1074
1181
|
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."
|
|
1075
1182
|
}),
|
|
1076
|
-
|
|
1183
|
+
Type9.String({
|
|
1077
1184
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
1078
1185
|
description: 'Column width as percentage of available width (e.g., "40%")'
|
|
1079
1186
|
})
|
|
1080
1187
|
])
|
|
1081
1188
|
),
|
|
1082
|
-
cellDefaults:
|
|
1083
|
-
header:
|
|
1084
|
-
cells:
|
|
1189
|
+
cellDefaults: Type9.Optional(CellDefaultsSchema),
|
|
1190
|
+
header: Type9.Optional(headerSchema),
|
|
1191
|
+
cells: Type9.Optional(Type9.Array(cellSchema))
|
|
1085
1192
|
},
|
|
1086
1193
|
{ additionalProperties: false }
|
|
1087
1194
|
);
|
|
1088
|
-
return
|
|
1195
|
+
return Type9.Object(
|
|
1089
1196
|
{
|
|
1090
|
-
borderColor:
|
|
1091
|
-
borderSize:
|
|
1092
|
-
hideBorders:
|
|
1093
|
-
cellDefaults:
|
|
1094
|
-
headerCellDefaults:
|
|
1095
|
-
width:
|
|
1096
|
-
|
|
1197
|
+
borderColor: Type9.Optional(BorderColorSchema),
|
|
1198
|
+
borderSize: Type9.Optional(BorderSizeSchema),
|
|
1199
|
+
hideBorders: Type9.Optional(HideBordersSchema),
|
|
1200
|
+
cellDefaults: Type9.Optional(CellDefaultsSchema),
|
|
1201
|
+
headerCellDefaults: Type9.Optional(CellDefaultsSchema),
|
|
1202
|
+
width: Type9.Optional(
|
|
1203
|
+
Type9.Number({
|
|
1097
1204
|
minimum: 0,
|
|
1098
1205
|
maximum: 100,
|
|
1099
1206
|
description: "Table width in percentage (0-100)"
|
|
1100
1207
|
})
|
|
1101
1208
|
),
|
|
1102
|
-
columns:
|
|
1209
|
+
columns: Type9.Array(columnSchema, {
|
|
1103
1210
|
description: "Table columns with headers and cells",
|
|
1104
1211
|
minItems: 1
|
|
1105
1212
|
}),
|
|
1106
|
-
|
|
1107
|
-
|
|
1213
|
+
rows: Type9.Optional(
|
|
1214
|
+
Type9.Array(
|
|
1215
|
+
Type9.Object(
|
|
1216
|
+
{
|
|
1217
|
+
revision: Type9.Optional(RevisionMarkSchema),
|
|
1218
|
+
cantSplit: Type9.Optional(
|
|
1219
|
+
Type9.Boolean({
|
|
1220
|
+
description: "Keep this row on one page"
|
|
1221
|
+
})
|
|
1222
|
+
),
|
|
1223
|
+
tableHeader: Type9.Optional(
|
|
1224
|
+
Type9.Boolean({
|
|
1225
|
+
description: "Repeat this row as a header on each page"
|
|
1226
|
+
})
|
|
1227
|
+
)
|
|
1228
|
+
},
|
|
1229
|
+
{ additionalProperties: false }
|
|
1230
|
+
),
|
|
1231
|
+
{
|
|
1232
|
+
description: "Row-parallel properties, indexed like `columns[].cells`. The model is column-major, so anything that belongs to a whole row lives here."
|
|
1233
|
+
}
|
|
1234
|
+
)
|
|
1235
|
+
),
|
|
1236
|
+
keepInOnePage: Type9.Optional(
|
|
1237
|
+
Type9.Boolean({
|
|
1108
1238
|
description: "Keep table rows together on the same page by setting keepNext on all paragraphs"
|
|
1109
1239
|
})
|
|
1110
1240
|
),
|
|
1111
|
-
keepNext:
|
|
1112
|
-
|
|
1241
|
+
keepNext: Type9.Optional(
|
|
1242
|
+
Type9.Boolean({
|
|
1113
1243
|
description: "Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false."
|
|
1114
1244
|
})
|
|
1115
1245
|
),
|
|
1116
|
-
repeatHeaderOnPageBreak:
|
|
1117
|
-
|
|
1246
|
+
repeatHeaderOnPageBreak: Type9.Optional(
|
|
1247
|
+
Type9.Boolean({
|
|
1118
1248
|
description: "Repeat the header row on each page when the table spans multiple pages. Defaults to true.",
|
|
1119
1249
|
default: true
|
|
1120
1250
|
})
|
|
@@ -1129,14 +1259,14 @@ function createTablePropsSchema(componentRef) {
|
|
|
1129
1259
|
var TablePropsSchema = createTablePropsSchema(CellContentSchema);
|
|
1130
1260
|
|
|
1131
1261
|
// src/schemas/components/section.ts
|
|
1132
|
-
import { Type as
|
|
1133
|
-
var createSectionPropsSchema = (componentRef) =>
|
|
1262
|
+
import { Type as Type10 } from "@sinclair/typebox";
|
|
1263
|
+
var createSectionPropsSchema = (componentRef) => Type10.Object(
|
|
1134
1264
|
{
|
|
1135
|
-
meta:
|
|
1136
|
-
|
|
1265
|
+
meta: Type10.Optional(
|
|
1266
|
+
Type10.Object(
|
|
1137
1267
|
{
|
|
1138
|
-
title:
|
|
1139
|
-
|
|
1268
|
+
title: Type10.Optional(
|
|
1269
|
+
Type10.String({
|
|
1140
1270
|
description: "Authoring label for this section, shown in editors and outlines. Never rendered \u2014 add a heading child for a visible title."
|
|
1141
1271
|
})
|
|
1142
1272
|
)
|
|
@@ -1147,58 +1277,58 @@ var createSectionPropsSchema = (componentRef) => Type8.Object(
|
|
|
1147
1277
|
}
|
|
1148
1278
|
)
|
|
1149
1279
|
),
|
|
1150
|
-
header:
|
|
1151
|
-
|
|
1152
|
-
|
|
1280
|
+
header: Type10.Optional(
|
|
1281
|
+
Type10.Union([
|
|
1282
|
+
Type10.Array(componentRef || Type10.Any(), {
|
|
1153
1283
|
description: "Section header components"
|
|
1154
1284
|
}),
|
|
1155
|
-
|
|
1285
|
+
Type10.Literal("linkToPrevious", {
|
|
1156
1286
|
description: "Link header to previous section"
|
|
1157
1287
|
})
|
|
1158
1288
|
])
|
|
1159
1289
|
),
|
|
1160
|
-
footer:
|
|
1161
|
-
|
|
1162
|
-
|
|
1290
|
+
footer: Type10.Optional(
|
|
1291
|
+
Type10.Union([
|
|
1292
|
+
Type10.Array(componentRef || Type10.Any(), {
|
|
1163
1293
|
description: "Section footer components"
|
|
1164
1294
|
}),
|
|
1165
|
-
|
|
1295
|
+
Type10.Literal("linkToPrevious", {
|
|
1166
1296
|
description: "Link footer to previous section"
|
|
1167
1297
|
})
|
|
1168
1298
|
])
|
|
1169
1299
|
),
|
|
1170
|
-
pageBreak:
|
|
1171
|
-
|
|
1300
|
+
pageBreak: Type10.Optional(
|
|
1301
|
+
Type10.Boolean({
|
|
1172
1302
|
description: "Insert page break before section",
|
|
1173
1303
|
default: true
|
|
1174
1304
|
})
|
|
1175
1305
|
),
|
|
1176
|
-
spacing:
|
|
1177
|
-
page:
|
|
1178
|
-
|
|
1306
|
+
spacing: Type10.Optional(SpacingSchema),
|
|
1307
|
+
page: Type10.Optional(
|
|
1308
|
+
Type10.Object(
|
|
1179
1309
|
{
|
|
1180
|
-
size:
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
width:
|
|
1188
|
-
height:
|
|
1310
|
+
size: Type10.Optional(
|
|
1311
|
+
Type10.Union([
|
|
1312
|
+
Type10.Literal("A4"),
|
|
1313
|
+
Type10.Literal("A3"),
|
|
1314
|
+
Type10.Literal("LETTER"),
|
|
1315
|
+
Type10.Literal("LEGAL"),
|
|
1316
|
+
Type10.Object({
|
|
1317
|
+
width: Type10.Number({ minimum: 0 }),
|
|
1318
|
+
height: Type10.Number({ minimum: 0 })
|
|
1189
1319
|
})
|
|
1190
1320
|
])
|
|
1191
1321
|
),
|
|
1192
|
-
margins:
|
|
1193
|
-
|
|
1322
|
+
margins: Type10.Optional(
|
|
1323
|
+
Type10.Object(
|
|
1194
1324
|
{
|
|
1195
|
-
top:
|
|
1196
|
-
bottom:
|
|
1197
|
-
left:
|
|
1198
|
-
right:
|
|
1199
|
-
header:
|
|
1200
|
-
footer:
|
|
1201
|
-
gutter:
|
|
1325
|
+
top: Type10.Optional(Type10.Number({ minimum: 0 })),
|
|
1326
|
+
bottom: Type10.Optional(Type10.Number({ minimum: 0 })),
|
|
1327
|
+
left: Type10.Optional(Type10.Number({ minimum: 0 })),
|
|
1328
|
+
right: Type10.Optional(Type10.Number({ minimum: 0 })),
|
|
1329
|
+
header: Type10.Optional(Type10.Number({ minimum: 0 })),
|
|
1330
|
+
footer: Type10.Optional(Type10.Number({ minimum: 0 })),
|
|
1331
|
+
gutter: Type10.Optional(Type10.Number({ minimum: 0 }))
|
|
1202
1332
|
},
|
|
1203
1333
|
{
|
|
1204
1334
|
additionalProperties: false
|
|
@@ -1221,31 +1351,31 @@ var createSectionPropsSchema = (componentRef) => Type8.Object(
|
|
|
1221
1351
|
var SectionPropsSchema = createSectionPropsSchema();
|
|
1222
1352
|
|
|
1223
1353
|
// src/schemas/components/columns.ts
|
|
1224
|
-
import { Type as
|
|
1225
|
-
var ColumnDescriptorSchema =
|
|
1354
|
+
import { Type as Type11 } from "@sinclair/typebox";
|
|
1355
|
+
var ColumnDescriptorSchema = Type11.Object(
|
|
1226
1356
|
{
|
|
1227
|
-
width:
|
|
1228
|
-
|
|
1229
|
-
|
|
1357
|
+
width: Type11.Optional(
|
|
1358
|
+
Type11.Union([
|
|
1359
|
+
Type11.Number({
|
|
1230
1360
|
minimum: 1,
|
|
1231
1361
|
description: "Column width in points"
|
|
1232
1362
|
}),
|
|
1233
|
-
|
|
1363
|
+
Type11.String({
|
|
1234
1364
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
1235
1365
|
description: 'Column width as percentage of available width (e.g., "30%")'
|
|
1236
1366
|
}),
|
|
1237
|
-
|
|
1367
|
+
Type11.Literal("auto", {
|
|
1238
1368
|
description: "Auto width: consume remaining space after fixed widths and gaps"
|
|
1239
1369
|
})
|
|
1240
1370
|
])
|
|
1241
1371
|
),
|
|
1242
|
-
gap:
|
|
1243
|
-
|
|
1244
|
-
|
|
1372
|
+
gap: Type11.Optional(
|
|
1373
|
+
Type11.Union([
|
|
1374
|
+
Type11.Number({
|
|
1245
1375
|
minimum: 0,
|
|
1246
1376
|
description: "Gap after this column in points"
|
|
1247
1377
|
}),
|
|
1248
|
-
|
|
1378
|
+
Type11.String({
|
|
1249
1379
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
1250
1380
|
description: 'Gap after this column as percentage of available width (e.g., "5%")'
|
|
1251
1381
|
})
|
|
@@ -1254,25 +1384,25 @@ var ColumnDescriptorSchema = Type9.Object(
|
|
|
1254
1384
|
},
|
|
1255
1385
|
{ additionalProperties: false }
|
|
1256
1386
|
);
|
|
1257
|
-
var ColumnsPropsSchema =
|
|
1387
|
+
var ColumnsPropsSchema = Type11.Object(
|
|
1258
1388
|
{
|
|
1259
|
-
columns:
|
|
1260
|
-
|
|
1389
|
+
columns: Type11.Union([
|
|
1390
|
+
Type11.Number({
|
|
1261
1391
|
minimum: 1,
|
|
1262
1392
|
description: "Number of equal-width columns (converter will normalize to array)"
|
|
1263
1393
|
}),
|
|
1264
|
-
|
|
1394
|
+
Type11.Array(ColumnDescriptorSchema, {
|
|
1265
1395
|
minItems: 1,
|
|
1266
1396
|
description: "List of columns in order; width and gap can be points, percentages, or auto width"
|
|
1267
1397
|
})
|
|
1268
1398
|
]),
|
|
1269
|
-
gap:
|
|
1270
|
-
|
|
1271
|
-
|
|
1399
|
+
gap: Type11.Optional(
|
|
1400
|
+
Type11.Union([
|
|
1401
|
+
Type11.Number({
|
|
1272
1402
|
minimum: 0,
|
|
1273
1403
|
description: "Default gap applied after each column except the last (points)"
|
|
1274
1404
|
}),
|
|
1275
|
-
|
|
1405
|
+
Type11.String({
|
|
1276
1406
|
pattern: "^\\d+(\\.\\d+)?%$",
|
|
1277
1407
|
description: 'Default gap applied after each column except the last as percentage of available width (e.g., "5%")'
|
|
1278
1408
|
})
|
|
@@ -1286,130 +1416,149 @@ var ColumnsPropsSchema = Type9.Object(
|
|
|
1286
1416
|
);
|
|
1287
1417
|
|
|
1288
1418
|
// src/schemas/components/list.ts
|
|
1289
|
-
import { Type as
|
|
1290
|
-
var LevelFormatSchema =
|
|
1419
|
+
import { Type as Type12 } from "@sinclair/typebox";
|
|
1420
|
+
var LevelFormatSchema = Type12.Union(
|
|
1291
1421
|
[
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1422
|
+
Type12.Literal("decimal"),
|
|
1423
|
+
Type12.Literal("upperRoman"),
|
|
1424
|
+
Type12.Literal("lowerRoman"),
|
|
1425
|
+
Type12.Literal("upperLetter"),
|
|
1426
|
+
Type12.Literal("lowerLetter"),
|
|
1427
|
+
Type12.Literal("bullet"),
|
|
1428
|
+
Type12.Literal("ordinal"),
|
|
1429
|
+
Type12.Literal("cardinalText"),
|
|
1430
|
+
Type12.Literal("ordinalText"),
|
|
1431
|
+
Type12.Literal("hex"),
|
|
1432
|
+
Type12.Literal("chicago"),
|
|
1433
|
+
Type12.Literal("ideographDigital"),
|
|
1434
|
+
Type12.Literal("japaneseCounting"),
|
|
1435
|
+
Type12.Literal("aiueo"),
|
|
1436
|
+
Type12.Literal("iroha"),
|
|
1437
|
+
Type12.Literal("decimalFullWidth"),
|
|
1438
|
+
Type12.Literal("decimalHalfWidth"),
|
|
1439
|
+
Type12.Literal("japaneseLegal"),
|
|
1440
|
+
Type12.Literal("japaneseDigitalTenThousand"),
|
|
1441
|
+
Type12.Literal("decimalEnclosedCircle"),
|
|
1442
|
+
Type12.Literal("decimalFullWidth2"),
|
|
1443
|
+
Type12.Literal("aiueoFullWidth"),
|
|
1444
|
+
Type12.Literal("irohaFullWidth"),
|
|
1445
|
+
Type12.Literal("decimalZero"),
|
|
1446
|
+
Type12.Literal("ganada"),
|
|
1447
|
+
Type12.Literal("chosung"),
|
|
1448
|
+
Type12.Literal("decimalEnclosedFullstop"),
|
|
1449
|
+
Type12.Literal("decimalEnclosedParen"),
|
|
1450
|
+
Type12.Literal("decimalEnclosedCircleChinese"),
|
|
1451
|
+
Type12.Literal("ideographEnclosedCircle"),
|
|
1452
|
+
Type12.Literal("ideographTraditional"),
|
|
1453
|
+
Type12.Literal("ideographZodiac"),
|
|
1454
|
+
Type12.Literal("ideographZodiacTraditional"),
|
|
1455
|
+
Type12.Literal("taiwaneseCounting"),
|
|
1456
|
+
Type12.Literal("ideographLegalTraditional"),
|
|
1457
|
+
Type12.Literal("taiwaneseCountingThousand"),
|
|
1458
|
+
Type12.Literal("taiwaneseDigital"),
|
|
1459
|
+
Type12.Literal("chineseCounting"),
|
|
1460
|
+
Type12.Literal("chineseLegalSimplified"),
|
|
1461
|
+
Type12.Literal("chineseCountingThousand"),
|
|
1462
|
+
Type12.Literal("koreanDigital"),
|
|
1463
|
+
Type12.Literal("koreanCounting"),
|
|
1464
|
+
Type12.Literal("koreanLegal"),
|
|
1465
|
+
Type12.Literal("koreanDigital2"),
|
|
1466
|
+
Type12.Literal("vietnameseCounting"),
|
|
1467
|
+
Type12.Literal("russianLower"),
|
|
1468
|
+
Type12.Literal("russianUpper"),
|
|
1469
|
+
Type12.Literal("none"),
|
|
1470
|
+
Type12.Literal("numberInDash"),
|
|
1471
|
+
Type12.Literal("hebrew1"),
|
|
1472
|
+
Type12.Literal("hebrew2"),
|
|
1473
|
+
Type12.Literal("arabicAlpha"),
|
|
1474
|
+
Type12.Literal("arabicAbjad"),
|
|
1475
|
+
Type12.Literal("hindiVowels"),
|
|
1476
|
+
Type12.Literal("hindiConsonants"),
|
|
1477
|
+
Type12.Literal("hindiNumbers"),
|
|
1478
|
+
Type12.Literal("hindiCounting"),
|
|
1479
|
+
Type12.Literal("thaiLetters"),
|
|
1480
|
+
Type12.Literal("thaiNumbers"),
|
|
1481
|
+
Type12.Literal("thaiCounting")
|
|
1352
1482
|
],
|
|
1353
1483
|
{
|
|
1354
1484
|
description: "Number or bullet format for list levels"
|
|
1355
1485
|
}
|
|
1356
1486
|
);
|
|
1357
|
-
var
|
|
1487
|
+
var ListMarkerFontSchema = Type12.Object(
|
|
1488
|
+
{
|
|
1489
|
+
family: Type12.Optional(Type12.String({ description: "Font family name" })),
|
|
1490
|
+
size: Type12.Optional(
|
|
1491
|
+
Type12.Number({ minimum: 1, description: "Marker size in points" })
|
|
1492
|
+
),
|
|
1493
|
+
color: Type12.Optional(HexColorSchema),
|
|
1494
|
+
bold: Type12.Optional(Type12.Boolean({ description: "Bold marker" })),
|
|
1495
|
+
italic: Type12.Optional(Type12.Boolean({ description: "Italic marker" })),
|
|
1496
|
+
underline: Type12.Optional(
|
|
1497
|
+
Type12.Boolean({ description: "Underlined marker" })
|
|
1498
|
+
)
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
description: "Styling for the number/bullet glyph only. The list text is unaffected.",
|
|
1502
|
+
additionalProperties: false
|
|
1503
|
+
}
|
|
1504
|
+
);
|
|
1505
|
+
var ListLevelPropsSchema = Type12.Object(
|
|
1358
1506
|
{
|
|
1359
|
-
level:
|
|
1507
|
+
level: Type12.Number({
|
|
1360
1508
|
minimum: 0,
|
|
1361
1509
|
maximum: 8,
|
|
1362
1510
|
description: "Nesting level (0 = root, 1 = first sublevel, etc.)"
|
|
1363
1511
|
}),
|
|
1364
|
-
format:
|
|
1365
|
-
text:
|
|
1366
|
-
|
|
1512
|
+
format: Type12.Optional(LevelFormatSchema),
|
|
1513
|
+
text: Type12.Optional(
|
|
1514
|
+
Type12.String({
|
|
1367
1515
|
description: 'Number format string (e.g., "%1." for "1.", "%1)" for "1)", custom bullet character for bullet format)'
|
|
1368
1516
|
})
|
|
1369
1517
|
),
|
|
1370
|
-
alignment:
|
|
1371
|
-
|
|
1518
|
+
alignment: Type12.Optional(
|
|
1519
|
+
Type12.Union(
|
|
1372
1520
|
[
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1521
|
+
Type12.Literal("start"),
|
|
1522
|
+
Type12.Literal("end"),
|
|
1523
|
+
Type12.Literal("left"),
|
|
1524
|
+
Type12.Literal("right"),
|
|
1525
|
+
Type12.Literal("center")
|
|
1378
1526
|
],
|
|
1379
1527
|
{
|
|
1380
1528
|
description: "Alignment of the numbering/bullet"
|
|
1381
1529
|
}
|
|
1382
1530
|
)
|
|
1383
1531
|
),
|
|
1384
|
-
indent:
|
|
1385
|
-
start:
|
|
1386
|
-
|
|
1532
|
+
indent: Type12.Optional(IndentSchema),
|
|
1533
|
+
start: Type12.Optional(
|
|
1534
|
+
Type12.Number({
|
|
1387
1535
|
minimum: 1,
|
|
1388
1536
|
description: "Starting number for this level (default: 1)"
|
|
1389
1537
|
})
|
|
1390
|
-
)
|
|
1538
|
+
),
|
|
1539
|
+
font: Type12.Optional(ListMarkerFontSchema)
|
|
1391
1540
|
},
|
|
1392
1541
|
{
|
|
1393
1542
|
description: "Configuration for a single list level",
|
|
1394
1543
|
additionalProperties: false
|
|
1395
1544
|
}
|
|
1396
1545
|
);
|
|
1397
|
-
var ListPropsSchema =
|
|
1546
|
+
var ListPropsSchema = Type12.Object(
|
|
1398
1547
|
{
|
|
1399
|
-
items:
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1548
|
+
items: Type12.Array(
|
|
1549
|
+
Type12.Union([
|
|
1550
|
+
Type12.String(),
|
|
1551
|
+
Type12.Object(
|
|
1403
1552
|
{
|
|
1404
|
-
text:
|
|
1405
|
-
level:
|
|
1406
|
-
|
|
1553
|
+
text: Type12.String(),
|
|
1554
|
+
level: Type12.Optional(
|
|
1555
|
+
Type12.Number({
|
|
1407
1556
|
minimum: 0,
|
|
1408
1557
|
maximum: 8,
|
|
1409
1558
|
description: "Nesting level for this item"
|
|
1410
1559
|
})
|
|
1411
1560
|
),
|
|
1412
|
-
revision:
|
|
1561
|
+
revision: Type12.Optional(RevisionSchema)
|
|
1413
1562
|
},
|
|
1414
1563
|
{ additionalProperties: false }
|
|
1415
1564
|
)
|
|
@@ -1419,43 +1568,46 @@ var ListPropsSchema = Type10.Object(
|
|
|
1419
1568
|
minItems: 1
|
|
1420
1569
|
}
|
|
1421
1570
|
),
|
|
1422
|
-
reference:
|
|
1423
|
-
|
|
1571
|
+
reference: Type12.Optional(
|
|
1572
|
+
Type12.String({
|
|
1424
1573
|
description: "Unique reference ID for this numbering configuration (auto-generated if not provided)"
|
|
1425
1574
|
})
|
|
1426
1575
|
),
|
|
1427
|
-
levels:
|
|
1428
|
-
|
|
1576
|
+
levels: Type12.Optional(
|
|
1577
|
+
Type12.Array(ListLevelPropsSchema, {
|
|
1429
1578
|
description: "Configuration for each nesting level",
|
|
1430
1579
|
minItems: 1,
|
|
1431
1580
|
maxItems: 9
|
|
1432
1581
|
})
|
|
1433
1582
|
),
|
|
1434
1583
|
// Simplified options for common use cases (when levels not specified)
|
|
1435
|
-
format:
|
|
1436
|
-
|
|
1437
|
-
[LevelFormatSchema,
|
|
1584
|
+
format: Type12.Optional(
|
|
1585
|
+
Type12.Union(
|
|
1586
|
+
[LevelFormatSchema, Type12.Literal("numbered"), Type12.Literal("none")],
|
|
1438
1587
|
{
|
|
1439
1588
|
description: "Format for level 0 (simplified option when levels not specified)"
|
|
1440
1589
|
}
|
|
1441
1590
|
)
|
|
1442
1591
|
),
|
|
1443
|
-
bullet:
|
|
1444
|
-
|
|
1592
|
+
bullet: Type12.Optional(
|
|
1593
|
+
Type12.String({
|
|
1445
1594
|
description: "Custom bullet character (simplified option when levels not specified)"
|
|
1446
1595
|
})
|
|
1447
1596
|
),
|
|
1448
|
-
start:
|
|
1449
|
-
|
|
1597
|
+
start: Type12.Optional(
|
|
1598
|
+
Type12.Number({
|
|
1450
1599
|
minimum: 1,
|
|
1451
|
-
description: "Starting number for level 0
|
|
1600
|
+
description: "Starting number for level 0. Applies whether or not `levels` is given; a `start` on the level itself wins."
|
|
1452
1601
|
})
|
|
1453
1602
|
),
|
|
1454
|
-
spacing:
|
|
1455
|
-
alignment:
|
|
1456
|
-
indent:
|
|
1457
|
-
|
|
1458
|
-
)
|
|
1603
|
+
spacing: Type12.Optional(ListSpacingSchema),
|
|
1604
|
+
alignment: Type12.Optional(JustifiedAlignmentSchema),
|
|
1605
|
+
indent: Type12.Optional(
|
|
1606
|
+
Type12.Union([Type12.Number({ minimum: 0 }), IndentSchema])
|
|
1607
|
+
),
|
|
1608
|
+
// Anchored to the list as a whole: the range opens on the first rendered
|
|
1609
|
+
// item and closes on the last.
|
|
1610
|
+
comment: Type12.Optional(CommentSchema)
|
|
1459
1611
|
},
|
|
1460
1612
|
{
|
|
1461
1613
|
description: "List component props",
|
|
@@ -1464,28 +1616,38 @@ var ListPropsSchema = Type10.Object(
|
|
|
1464
1616
|
);
|
|
1465
1617
|
|
|
1466
1618
|
// src/schemas/component-defaults.ts
|
|
1467
|
-
var
|
|
1468
|
-
|
|
1619
|
+
var PER_INSTANCE_PROPS = [
|
|
1620
|
+
"revision",
|
|
1621
|
+
"comment",
|
|
1622
|
+
"footnotes",
|
|
1623
|
+
"endnotes"
|
|
1624
|
+
];
|
|
1625
|
+
var HeadingComponentDefaultsSchema = Type13.Partial(
|
|
1626
|
+
Type13.Omit(HeadingPropsSchema, PER_INSTANCE_PROPS)
|
|
1627
|
+
);
|
|
1628
|
+
var ParagraphComponentDefaultsSchema = Type13.Partial(
|
|
1629
|
+
Type13.Omit(ParagraphPropsSchema, PER_INSTANCE_PROPS)
|
|
1630
|
+
);
|
|
1631
|
+
var ImageComponentDefaultsSchema = Type13.Partial(ImagePropsSchema);
|
|
1632
|
+
var StatisticComponentDefaultsSchema = Type13.Partial(StatisticPropsSchema);
|
|
1633
|
+
var TableComponentDefaultsSchema = Type13.Partial(
|
|
1634
|
+
Type13.Omit(TablePropsSchema, ["rows"])
|
|
1469
1635
|
);
|
|
1470
|
-
var
|
|
1471
|
-
|
|
1636
|
+
var SectionComponentDefaultsSchema = Type13.Partial(SectionPropsSchema);
|
|
1637
|
+
var ColumnsComponentDefaultsSchema = Type13.Partial(ColumnsPropsSchema);
|
|
1638
|
+
var ListComponentDefaultsSchema = Type13.Partial(
|
|
1639
|
+
Type13.Omit(ListPropsSchema, PER_INSTANCE_PROPS)
|
|
1472
1640
|
);
|
|
1473
|
-
var
|
|
1474
|
-
var StatisticComponentDefaultsSchema = Type11.Partial(StatisticPropsSchema);
|
|
1475
|
-
var TableComponentDefaultsSchema = Type11.Partial(TablePropsSchema);
|
|
1476
|
-
var SectionComponentDefaultsSchema = Type11.Partial(SectionPropsSchema);
|
|
1477
|
-
var ColumnsComponentDefaultsSchema = Type11.Partial(ColumnsPropsSchema);
|
|
1478
|
-
var ListComponentDefaultsSchema = Type11.Partial(ListPropsSchema);
|
|
1479
|
-
var ComponentDefaultsSchema = Type11.Object(
|
|
1641
|
+
var ComponentDefaultsSchema = Type13.Object(
|
|
1480
1642
|
{
|
|
1481
|
-
heading:
|
|
1482
|
-
paragraph:
|
|
1483
|
-
image:
|
|
1484
|
-
statistic:
|
|
1485
|
-
table:
|
|
1486
|
-
section:
|
|
1487
|
-
columns:
|
|
1488
|
-
list:
|
|
1643
|
+
heading: Type13.Optional(HeadingComponentDefaultsSchema),
|
|
1644
|
+
paragraph: Type13.Optional(ParagraphComponentDefaultsSchema),
|
|
1645
|
+
image: Type13.Optional(ImageComponentDefaultsSchema),
|
|
1646
|
+
statistic: Type13.Optional(StatisticComponentDefaultsSchema),
|
|
1647
|
+
table: Type13.Optional(TableComponentDefaultsSchema),
|
|
1648
|
+
section: Type13.Optional(SectionComponentDefaultsSchema),
|
|
1649
|
+
columns: Type13.Optional(ColumnsComponentDefaultsSchema),
|
|
1650
|
+
list: Type13.Optional(ListComponentDefaultsSchema)
|
|
1489
1651
|
},
|
|
1490
1652
|
{ additionalProperties: true }
|
|
1491
1653
|
// TODO: add a way to add strict custom component defaults when the plugin/registry paradigm will be implemented
|
|
@@ -1518,7 +1680,13 @@ export {
|
|
|
1518
1680
|
BaseComponentPropsSchema,
|
|
1519
1681
|
RevisionSegmentSchema,
|
|
1520
1682
|
RevisionSchema,
|
|
1683
|
+
RevisionMarkSchema,
|
|
1684
|
+
CommentReplySchema,
|
|
1685
|
+
CommentSchema,
|
|
1521
1686
|
HeadingPropsSchema,
|
|
1687
|
+
NoteSchema,
|
|
1688
|
+
FootnotesSchema,
|
|
1689
|
+
EndnotesSchema,
|
|
1522
1690
|
ParagraphPropsSchema,
|
|
1523
1691
|
ImagePropsSchema,
|
|
1524
1692
|
StatisticPropsSchema,
|
|
@@ -1528,8 +1696,10 @@ export {
|
|
|
1528
1696
|
SectionPropsSchema,
|
|
1529
1697
|
ColumnsPropsSchema,
|
|
1530
1698
|
LevelFormatSchema,
|
|
1699
|
+
ListMarkerFontSchema,
|
|
1531
1700
|
ListLevelPropsSchema,
|
|
1532
1701
|
ListPropsSchema,
|
|
1702
|
+
PER_INSTANCE_PROPS,
|
|
1533
1703
|
HeadingComponentDefaultsSchema,
|
|
1534
1704
|
ParagraphComponentDefaultsSchema,
|
|
1535
1705
|
ImageComponentDefaultsSchema,
|
|
@@ -1540,4 +1710,4 @@ export {
|
|
|
1540
1710
|
ListComponentDefaultsSchema,
|
|
1541
1711
|
ComponentDefaultsSchema
|
|
1542
1712
|
};
|
|
1543
|
-
//# sourceMappingURL=chunk-
|
|
1713
|
+
//# sourceMappingURL=chunk-436TK3T4.js.map
|