@cloudcannon/configuration-types 0.0.16 → 0.0.18

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.
@@ -1,113 +1,18 @@
1
- import Scrapbooker from '@cloudcannon/snippet-types';
1
+ import type Scrapbooker from '@cloudcannon/snippet-types';
2
2
 
3
3
  import type { Icon } from './icon';
4
4
  import type { Timezone } from './timezone';
5
5
  import type { MimeType } from './mime-type';
6
6
  import type { Theme } from './theme';
7
7
  import type { Syntax } from './syntax';
8
+ import type { MarkdownSettings } from './markdown';
8
9
 
9
10
  export type InstanceValue = 'UUID' | 'NOW';
10
11
  export type EditorKey = 'visual' | 'content' | 'data';
11
12
  export type SortOrder = 'ascending' | 'descending' | 'asc' | 'desc';
12
- export type AttributeListPosition =
13
- | 'none'
14
- | 'right'
15
- | 'space right'
16
- | 'below'
17
- | 'newline below'
18
- | 'right-of-prefix';
19
-
20
- export type MarkdownAttributeElementOptions = {
21
- inline?: AttributeListPosition;
22
- block?: AttributeListPosition;
23
- } & Partial<Record<keyof HTMLElementTagNameMap, AttributeListPosition>>;
24
-
25
- export interface MarkdownSettings {
26
- engine: 'commonmark' | 'kramdown';
27
- options: {
28
- /**
29
- * Output HTML tags from source.
30
- */
31
- html?: boolean;
32
- /**
33
- * Use '/' to close single tags (<br />).
34
- */
35
- xhtml?: boolean;
36
- /**
37
- * Convert '\n' in paragraphs into <br>.
38
- */
39
- breaks?: boolean;
40
- /**
41
- * Autoconvert URL-like text to links.
42
- */
43
- linkify?: boolean;
44
- /**
45
- * Enable some language-neutral replacement + quotes beautification.
46
- */
47
- typographer?: boolean;
48
- /**
49
- * Double + single quotes replacement pairs, when typographer enabled and smartquotes on. For
50
- * example, you can use '«»„“' for Russian, '„“‚‘' for German, and ['«\xA0', '\xA0»', '‹\xA0',
51
- * '\xA0›'] for French (including nbsp).
52
- */
53
- quotes?: string;
54
- /**
55
- * Output lists with an extra space in Markdown.
56
- */
57
- spaced_lists?: boolean;
58
- /**
59
- * Add linebreaks between sentences in Markdown.
60
- */
61
- sentence_per_line?: boolean;
62
- /**
63
- * Enable GFM mode.
64
- */
65
- gfm?: boolean;
66
- /**
67
- * Determines which style of code block fences to use.
68
- */
69
- code_block_fences?: '```' | '~~~';
70
- /**
71
- * Determines whether 4 spaces on indentation should be read as a code block.
72
- */
73
- treat_indentation_as_code?: boolean;
74
- /**
75
- * Render snippets as plain text within code blocks.
76
- */
77
- escape_snippets_in_code_blocks?: boolean;
78
- /**
79
- * Output tables in Markdown format.
80
- */
81
- table?: boolean;
82
- /**
83
- * Output strikes in wrapped in double tildes (e.g. ~~strike~~)
84
- */
85
- strikethrough?: boolean;
86
- /**
87
- * Output subscript in wrapped in tildes (e.g. ~sub~)
88
- */
89
- subscript?: boolean;
90
- /**
91
- * Output superscript in wrapped in carets (e.g. ^super^)
92
- */
93
- superscript?: boolean;
94
- /**
95
- * Generate IDs for headings
96
- */
97
- heading_ids?: boolean;
98
- /**
99
- * Save element attributes in Markdown format instead of converting to HTML.
100
- */
101
- attributes?: boolean;
102
- /**
103
- * Define positioning behaviour of Markdown attributes for different elements.
104
- */
105
- attribute_elements?: MarkdownAttributeElementOptions;
106
- };
107
- }
108
13
 
109
14
  // TODO: use SnippetConfig from @cloudcannon/scrap-booker when ParserConfig issue resolved.
110
- export interface SnippetConfig extends ReducedCascade, Previewable, PickerPreviewable {
15
+ export interface SnippetConfig extends ReducedCascade, WithPreview, WithPickerPreview {
111
16
  /**
112
17
  * Name of the snippet.
113
18
  */
@@ -139,58 +44,159 @@ export interface SnippetConfig extends ReducedCascade, Previewable, PickerPrevie
139
44
  params?: Record<string, any>; // TODO: use ParserConfig from @cloudcannon/scrap-booker.
140
45
  }
141
46
 
142
- interface SnippetsImport<T> {
143
- /**
144
- * The list of excluded snippets. If unset, all snippets are excluded unless defined in `include`.
145
- */
146
- exclude?: T[];
147
- /**
148
- * The list of included snippets. If unset, all snippets are included unless defined in `exclude`.
149
- */
150
- include?: T[];
151
- }
152
-
153
47
  export interface SnippetsImports {
154
48
  /**
155
49
  * Default snippets for Hugo SSG.
156
50
  */
157
- hugo?: boolean | SnippetsImport<keyof typeof Scrapbooker.defaults.hugo.snippets>;
51
+ hugo?:
52
+ | boolean
53
+ | {
54
+ /**
55
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in
56
+ * `include`.
57
+ */
58
+ exclude: Array<keyof typeof Scrapbooker.defaults.hugo.snippets>;
59
+ }
60
+ | {
61
+ /**
62
+ * The list of included snippets. If unset, all snippets are included unless defined in
63
+ * `exclude`.
64
+ */
65
+ include: Array<keyof typeof Scrapbooker.defaults.hugo.snippets>;
66
+ };
158
67
  /**
159
68
  * Default snippets for Jekyll SSG.
160
69
  */
161
- jekyll?: boolean | SnippetsImport<keyof typeof Scrapbooker.defaults.jekyll.snippets>;
70
+ jekyll?:
71
+ | boolean
72
+ | {
73
+ /**
74
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in
75
+ * `include`.
76
+ */
77
+ exclude: Array<keyof typeof Scrapbooker.defaults.jekyll.snippets>;
78
+ }
79
+ | {
80
+ /**
81
+ * The list of included snippets. If unset, all snippets are included unless defined in
82
+ * `exclude`.
83
+ */
84
+ include: Array<keyof typeof Scrapbooker.defaults.jekyll.snippets>;
85
+ };
162
86
  /**
163
87
  * Default snippets for MDX-based content.
164
88
  */
165
- mdx?: boolean | SnippetsImport<keyof typeof Scrapbooker.defaults.mdx.snippets>;
89
+ mdx?:
90
+ | boolean
91
+ | {
92
+ /**
93
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in
94
+ * `include`.
95
+ */
96
+ exclude: Array<keyof typeof Scrapbooker.defaults.mdx.snippets>;
97
+ }
98
+ | {
99
+ /**
100
+ * The list of included snippets. If unset, all snippets are included unless defined in
101
+ * `exclude`.
102
+ */
103
+ include: Array<keyof typeof Scrapbooker.defaults.mdx.snippets>;
104
+ };
166
105
  /**
167
106
  * Default snippets for Eleventy SSG Liquid files.
168
107
  */
169
108
  eleventy_liquid?:
170
109
  | boolean
171
- | SnippetsImport<keyof typeof Scrapbooker.defaults.eleventy_liquid.snippets>;
110
+ | {
111
+ /**
112
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in
113
+ * `include`.
114
+ */
115
+ exclude: Array<keyof typeof Scrapbooker.defaults.eleventy_liquid.snippets>;
116
+ }
117
+ | {
118
+ /**
119
+ * The list of included snippets. If unset, all snippets are included unless defined in
120
+ * `exclude`.
121
+ */
122
+ include: Array<keyof typeof Scrapbooker.defaults.eleventy_liquid.snippets>;
123
+ };
172
124
  /**
173
125
  * Default snippets for Eleventy SSG Nunjucks files.
174
126
  */
175
127
  eleventy_nunjucks?:
176
128
  | boolean
177
- | SnippetsImport<keyof typeof Scrapbooker.defaults.eleventy_nunjucks.snippets>;
129
+ | {
130
+ /**
131
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in
132
+ * `include`.
133
+ */
134
+ exclude: Array<keyof typeof Scrapbooker.defaults.eleventy_nunjucks.snippets>;
135
+ }
136
+ | {
137
+ /**
138
+ * The list of included snippets. If unset, all snippets are included unless defined in
139
+ * `exclude`.
140
+ */
141
+ include: Array<keyof typeof Scrapbooker.defaults.eleventy_nunjucks.snippets>;
142
+ };
178
143
  /**
179
144
  * Default snippets for Markdoc-based content.
180
145
  */
181
- markdoc?: boolean | SnippetsImport<keyof typeof Scrapbooker.defaults.markdoc.snippets>;
146
+ markdoc?:
147
+ | boolean
148
+ | {
149
+ /**
150
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in
151
+ * `include`.
152
+ */
153
+ exclude: Array<keyof typeof Scrapbooker.defaults.markdoc.snippets>;
154
+ }
155
+ | {
156
+ /**
157
+ * The list of included snippets. If unset, all snippets are included unless defined in
158
+ * `exclude`.
159
+ */
160
+ include: Array<keyof typeof Scrapbooker.defaults.markdoc.snippets>;
161
+ };
182
162
  /**
183
163
  * Default snippets for content using Python markdown extensions.
184
164
  */
185
165
  python_markdown_extensions?:
186
166
  | boolean
187
- | SnippetsImport<keyof typeof Scrapbooker.defaults.python_markdown_extensions.snippets>;
167
+ | {
168
+ /**
169
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in
170
+ * `include`.
171
+ */
172
+ exclude: Array<keyof typeof Scrapbooker.defaults.python_markdown_extensions.snippets>;
173
+ }
174
+ | {
175
+ /**
176
+ * The list of included snippets. If unset, all snippets are included unless defined in
177
+ * `exclude`.
178
+ */
179
+ include: Array<keyof typeof Scrapbooker.defaults.python_markdown_extensions.snippets>;
180
+ };
188
181
  /**
189
182
  * Default snippets for Docusaurus SSG.
190
183
  */
191
184
  docusaurus_mdx?:
192
185
  | boolean
193
- | SnippetsImport<keyof typeof Scrapbooker.defaults.docusaurus_mdx.snippets>;
186
+ | {
187
+ /**
188
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in
189
+ * `include`.
190
+ */
191
+ exclude: Array<keyof typeof Scrapbooker.defaults.docusaurus_mdx.snippets>;
192
+ }
193
+ | {
194
+ /**
195
+ * The list of included snippets. If unset, all snippets are included unless defined in
196
+ * `exclude`.
197
+ */
198
+ include: Array<keyof typeof Scrapbooker.defaults.docusaurus_mdx.snippets>;
199
+ };
194
200
  }
195
201
 
196
202
  interface WithSnippets {
@@ -222,7 +228,7 @@ interface ImageResizeable {
222
228
  * Sets how uploaded image files are resized with a bounding box defined by width and height prior
223
229
  * to upload. Has no effect when selecting existing images, or if width and height are unset.
224
230
  *
225
- * @default 'contain'
231
+ * @default contain
226
232
  */
227
233
  resize_style?: 'cover' | 'contain' | 'stretch' | 'crop';
228
234
  /**
@@ -494,6 +500,8 @@ export interface Cascade extends ReducedCascade {
494
500
  /**
495
501
  * Set a preferred editor and/or disable the others. The first value sets which editor opens by
496
502
  * default, and the following values specify which editors are accessible.
503
+ *
504
+ * @uniqueItems
497
505
  */
498
506
  _enabled_editors?: EditorKey[];
499
507
  /**
@@ -557,14 +565,35 @@ export type EmptyTypeNumber = 'null' | 'number';
557
565
  export type EmptyTypeArray = 'null' | 'array';
558
566
  export type EmptyTypeObject = 'null' | 'object';
559
567
 
560
- export interface BaseInputOptions<EmptyType = EmptyTypeText> {
568
+ interface WithEmptyTypeText {
569
+ /**
570
+ * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
571
+ */
572
+ empty_type?: EmptyTypeText;
573
+ }
574
+
575
+ interface WithEmptyTypeNumber {
576
+ /**
577
+ * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
578
+ */
579
+ empty_type?: EmptyTypeNumber;
580
+ }
581
+
582
+ interface WithEmptyTypeObject {
583
+ /**
584
+ * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
585
+ */
586
+ empty_type?: EmptyTypeObject;
587
+ }
588
+
589
+ interface WithEmptyTypeArray {
561
590
  /**
562
591
  * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
563
592
  */
564
- empty_type?: EmptyType;
593
+ empty_type?: EmptyTypeArray;
565
594
  }
566
595
 
567
- export interface BaseInput<InputOptions = BaseInputOptions> {
596
+ export interface BaseInput {
568
597
  type?: InputType | undefined | null;
569
598
  /**
570
599
  * Changes the subtext below the _Label_. Has no default. Supports a limited set of Markdown:
@@ -618,13 +647,9 @@ export interface BaseInput<InputOptions = BaseInputOptions> {
618
647
  * @default true
619
648
  */
620
649
  cascade?: boolean;
621
- /**
622
- * Options that are specific to this `type` of input.
623
- */
624
- options?: InputOptions;
625
650
  }
626
651
 
627
- export interface TextInputOptions extends BaseInputOptions {
652
+ export interface TextInputOptions extends WithEmptyTypeText {
628
653
  /**
629
654
  * Text shown when this input has no value.
630
655
  */
@@ -635,7 +660,7 @@ export interface TextInputOptions extends BaseInputOptions {
635
660
  icon?: Icon;
636
661
  }
637
662
 
638
- export interface TextInput extends BaseInput<TextInputOptions> {
663
+ export interface TextInput extends BaseInput {
639
664
  type:
640
665
  | 'text'
641
666
  | 'email'
@@ -645,6 +670,11 @@ export interface TextInput extends BaseInput<TextInputOptions> {
645
670
  | 'twitter'
646
671
  | 'github'
647
672
  | 'instagram';
673
+
674
+ /**
675
+ * Options that are specific to this `type` of input.
676
+ */
677
+ options?: TextInputOptions;
648
678
  }
649
679
 
650
680
  export interface TextareaInputOptions extends TextInputOptions {
@@ -654,11 +684,15 @@ export interface TextareaInputOptions extends TextInputOptions {
654
684
  show_count?: boolean;
655
685
  }
656
686
 
657
- export interface TextareaInput extends BaseInput<TextareaInputOptions> {
687
+ export interface TextareaInput extends BaseInput {
658
688
  type: 'textarea';
689
+ /**
690
+ * Options that are specific to this `type` of input.
691
+ */
692
+ options?: TextareaInputOptions;
659
693
  }
660
694
 
661
- export interface CodeInputOptions extends BaseInputOptions, SourceEditor {
695
+ export interface CodeInputOptions extends WithEmptyTypeText, SourceEditor {
662
696
  /**
663
697
  * Sets the maximum number of visible lines for this input, effectively controlling maximum
664
698
  * height. When the containing text exceeds this number, the input becomes a scroll area.
@@ -681,11 +715,15 @@ export interface CodeInputOptions extends BaseInputOptions, SourceEditor {
681
715
  syntax?: Syntax;
682
716
  }
683
717
 
684
- export interface CodeInput extends BaseInput<CodeInputOptions> {
718
+ export interface CodeInput extends BaseInput {
685
719
  type: 'code';
720
+ /**
721
+ * Options that are specific to this `type` of input.
722
+ */
723
+ options?: CodeInputOptions;
686
724
  }
687
725
 
688
- export interface ColorInputOptions extends BaseInputOptions {
726
+ export interface ColorInputOptions extends WithEmptyTypeText {
689
727
  /**
690
728
  * Sets what format the color value is saved as. Defaults to the naming convention, or HEX if that
691
729
  * is unset.
@@ -698,11 +736,15 @@ export interface ColorInputOptions extends BaseInputOptions {
698
736
  alpha?: boolean;
699
737
  }
700
738
 
701
- export interface ColorInput extends BaseInput<ColorInputOptions> {
739
+ export interface ColorInput extends BaseInput {
702
740
  type: 'color';
741
+ /**
742
+ * Options that are specific to this `type` of input.
743
+ */
744
+ options?: ColorInputOptions;
703
745
  }
704
746
 
705
- export interface NumberInputOptions extends BaseInputOptions<EmptyTypeNumber> {
747
+ export interface NumberInputOptions extends WithEmptyTypeNumber {
706
748
  /**
707
749
  * The lowest value in the range of permitted values.
708
750
  */
@@ -718,8 +760,12 @@ export interface NumberInputOptions extends BaseInputOptions<EmptyTypeNumber> {
718
760
  step?: number;
719
761
  }
720
762
 
721
- export interface NumberInput extends BaseInput<NumberInputOptions> {
763
+ export interface NumberInput extends BaseInput {
722
764
  type: 'number';
765
+ /**
766
+ * Options that are specific to this `type` of input.
767
+ */
768
+ options?: NumberInputOptions;
723
769
  }
724
770
 
725
771
  export interface RangeInputOptions extends NumberInputOptions {
@@ -728,17 +774,25 @@ export interface RangeInputOptions extends NumberInputOptions {
728
774
  step: number;
729
775
  }
730
776
 
731
- export interface RangeInput extends BaseInput<RangeInputOptions> {
777
+ export interface RangeInput extends BaseInput {
732
778
  type: 'range';
779
+ /**
780
+ * Options that are specific to this `type` of input.
781
+ */
782
+ options?: RangeInputOptions;
733
783
  }
734
784
 
735
- export interface UrlInputOptions extends BaseInputOptions, WithPaths {}
785
+ export interface UrlInputOptions extends WithEmptyTypeText, WithPaths {}
736
786
 
737
- export interface UrlInput extends BaseInput<UrlInputOptions> {
787
+ export interface UrlInput extends BaseInput {
738
788
  type: 'range';
789
+ /**
790
+ * Options that are specific to this `type` of input.
791
+ */
792
+ options?: UrlInputOptions;
739
793
  }
740
794
 
741
- export interface RichTextInputOptions extends BaseInputOptions, ImageResizeable, BlockEditable {
795
+ export interface RichTextInputOptions extends WithEmptyTypeText, ImageResizeable, BlockEditable {
742
796
  /**
743
797
  * Shows or hides the resize handler to vertically resize the input.
744
798
  */
@@ -749,11 +803,15 @@ export interface RichTextInputOptions extends BaseInputOptions, ImageResizeable,
749
803
  initial_height?: number;
750
804
  }
751
805
 
752
- export interface RichTextInput extends BaseInput<RichTextInputOptions> {
806
+ export interface RichTextInput extends BaseInput {
753
807
  type: 'html' | 'markdown';
808
+ /**
809
+ * Options that are specific to this `type` of input.
810
+ */
811
+ options?: RichTextInputOptions;
754
812
  }
755
813
 
756
- export interface DateInputOptions extends BaseInputOptions {
814
+ export interface DateInputOptions extends WithEmptyTypeText {
757
815
  /**
758
816
  * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
759
817
  * date is persisted to the file with. Defaults to the global `timezone`.
@@ -761,11 +819,15 @@ export interface DateInputOptions extends BaseInputOptions {
761
819
  timezone?: Timezone;
762
820
  }
763
821
 
764
- export interface DateInput extends BaseInput<DateInputOptions> {
822
+ export interface DateInput extends BaseInput {
765
823
  type: 'date' | 'datetime';
824
+ /**
825
+ * Options that are specific to this `type` of input.
826
+ */
827
+ options?: DateInputOptions;
766
828
  }
767
829
 
768
- export interface FileInputOptions extends BaseInputOptions, WithPaths {
830
+ export interface FileInputOptions extends WithEmptyTypeText, WithPaths {
769
831
  /**
770
832
  * Restricts which file types are available to select or upload to this input.
771
833
  */
@@ -777,20 +839,25 @@ export interface FileInputOptions extends BaseInputOptions, WithPaths {
777
839
  allowed_sources?: string[];
778
840
  }
779
841
 
780
- export interface FileInput extends BaseInput<FileInputOptions> {
842
+ export interface FileInput extends BaseInput {
781
843
  type: 'file' | 'document';
844
+ /**
845
+ * Options that are specific to this `type` of input.
846
+ */
847
+ options?: FileInputOptions;
782
848
  }
783
849
 
784
850
  export interface ImageInputOptions extends FileInputOptions, ImageResizeable {}
785
851
 
786
- export interface ImageInput extends BaseInput<ImageInputOptions> {
852
+ export interface ImageInput extends BaseInput {
787
853
  type: 'image';
854
+ /**
855
+ * Options that are specific to this `type` of input.
856
+ */
857
+ options?: ImageInputOptions;
788
858
  }
789
859
 
790
- export interface SelectInputOptions<EmptyType = EmptyTypeText>
791
- extends BaseInputOptions<EmptyType>,
792
- Previewable,
793
- PickerPreviewable {
860
+ export interface SelectInputOptions extends WithPreview, WithPickerPreview {
794
861
  /**
795
862
  * Allows new text values to be created at edit time.
796
863
  *
@@ -807,7 +874,7 @@ export interface SelectInputOptions<EmptyType = EmptyTypeText>
807
874
  * Defines the values available to choose from. Optional, defaults to fetching values from the
808
875
  * naming convention (e.g. colors or my_colors for data set colors).
809
876
  */
810
- values?: SelectValues;
877
+ values?: string | SelectValues;
811
878
  /**
812
879
  * Defines the key used for mapping between saved values and objects in values. This changes how
813
880
  * the input saves selected values to match. Defaults to checking for "id", "uuid", "path",
@@ -825,27 +892,38 @@ export interface SelectInputOptions<EmptyType = EmptyTypeText>
825
892
  picker_view?: 'card' | 'text' | 'gallery' | 'gallery-left';
826
893
  }
827
894
 
828
- export interface SelectInput extends BaseInput<SelectInputOptions> {
895
+ export interface SelectInput extends BaseInput {
829
896
  type: 'select';
897
+ /**
898
+ * Options that are specific to this `type` of input.
899
+ */
900
+ options?: SelectInputOptions & WithEmptyTypeText;
830
901
  }
831
902
 
832
- export interface MultiselectInputOptions extends SelectInputOptions<EmptyTypeArray> {}
833
-
834
- export interface MultiselectInput extends BaseInput<MultiselectInputOptions> {
903
+ export interface MultiselectInput extends BaseInput {
835
904
  type: 'multiselect';
905
+ /**
906
+ * Options that are specific to this `type` of input.
907
+ */
908
+ options?: SelectInputOptions & WithEmptyTypeArray;
836
909
  }
837
910
 
838
- export interface ChoiceInputOptions<EmptyType = EmptyTypeText>
839
- extends Omit<SelectInputOptions<EmptyType>, 'allow_create'> {}
911
+ export interface ChoiceInputOptions extends Omit<SelectInputOptions, 'allow_create'> {}
840
912
 
841
- export interface ChoiceInput extends BaseInput<ChoiceInputOptions> {
913
+ export interface ChoiceInput extends BaseInput {
842
914
  type: 'choice';
915
+ /**
916
+ * Options that are specific to this `type` of input.
917
+ */
918
+ options?: ChoiceInputOptions & WithEmptyTypeText;
843
919
  }
844
920
 
845
- export interface MultichoiceInputOptions extends ChoiceInputOptions<EmptyTypeArray> {}
846
-
847
- export interface MultichoiceInput extends BaseInput<MultichoiceInputOptions> {
921
+ export interface MultichoiceInput extends BaseInput {
848
922
  type: 'multichoice';
923
+ /**
924
+ * Options that are specific to this `type` of input.
925
+ */
926
+ options?: ChoiceInputOptions & WithEmptyTypeArray;
849
927
  }
850
928
 
851
929
  export interface ObjectInputGroup {
@@ -856,7 +934,7 @@ export interface ObjectInputGroup {
856
934
  documentation?: Documentation;
857
935
  }
858
936
 
859
- export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject>, Previewable {
937
+ export interface ObjectInputOptions extends WithEmptyTypeObject, WithPreview {
860
938
  /**
861
939
  * Changes the appearance and behavior of the input.
862
940
  */
@@ -904,13 +982,21 @@ export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject>, P
904
982
  * Controls whether or not labels on mutable object entries are formatted.
905
983
  */
906
984
  allow_label_formatting?: boolean;
985
+ /**
986
+ * Controls how object previews are rendered.
987
+ */
988
+ view?: 'card' | 'gallery' | 'gallery-left';
907
989
  }
908
990
 
909
- export interface ObjectInput extends BaseInput<ObjectInputOptions> {
991
+ export interface ObjectInput extends BaseInput {
910
992
  type: 'object';
993
+ /**
994
+ * Options that are specific to this `type` of input.
995
+ */
996
+ options?: ObjectInputOptions;
911
997
  }
912
998
 
913
- export interface ArrayInputOptions extends BaseInputOptions<EmptyTypeArray> {
999
+ export interface ArrayInputOptions extends WithEmptyTypeArray {
914
1000
  /**
915
1001
  * Provides data formats for value of this object. When choosing an item, team members are
916
1002
  * prompted to choose from a number of values you have defined.
@@ -918,12 +1004,21 @@ export interface ArrayInputOptions extends BaseInputOptions<EmptyTypeArray> {
918
1004
  structures?: string | Structure;
919
1005
  }
920
1006
 
921
- export interface ArrayInput extends BaseInput<ArrayInputOptions> {
1007
+ export interface ArrayInput extends BaseInput {
922
1008
  type: 'array';
1009
+ /**
1010
+ * Options that are specific to this `type` of input.
1011
+ */
1012
+ options?: ArrayInputOptions;
923
1013
  }
924
1014
 
925
- export interface UnknownInput extends BaseInput<BaseInputOptions> {
1015
+ export interface UnknownInput extends BaseInput {
926
1016
  type?: undefined | null;
1017
+
1018
+ /**
1019
+ * Options that are specific to this `type` of input.
1020
+ */
1021
+ options?: WithEmptyTypeText;
927
1022
  }
928
1023
 
929
1024
  export type Input =
@@ -1010,35 +1105,35 @@ interface PreviewKeyEntry {
1010
1105
 
1011
1106
  type PreviewEntry = Array<PreviewKeyEntry | string | boolean> | string | boolean;
1012
1107
 
1013
- interface TextPreviewable {
1108
+ interface WithTextPreview {
1014
1109
  /**
1015
1110
  * Controls the main text shown per item.
1016
1111
  */
1017
1112
  text?: PreviewEntry;
1018
1113
  }
1019
1114
 
1020
- interface ImagePreviewable {
1115
+ interface WithImagePreview {
1021
1116
  /**
1022
1117
  * Controls the image shown per item.
1023
1118
  */
1024
1119
  image?: PreviewEntry;
1025
1120
  }
1026
1121
 
1027
- interface SubtextPreviewable {
1122
+ interface WithSubtextPreview {
1028
1123
  /**
1029
1124
  * Controls the supporting text shown per item.
1030
1125
  */
1031
1126
  subtext?: PreviewEntry;
1032
1127
  }
1033
1128
 
1034
- interface IconPreviewable {
1129
+ interface WithIconPreview {
1035
1130
  /**
1036
1131
  * Controls the icon shown per item. Must result in a Material Icon name.
1037
1132
  */
1038
1133
  icon?: PreviewEntry;
1039
1134
  }
1040
1135
 
1041
- interface IconColorPreviewable {
1136
+ interface WithIconColorPreview {
1042
1137
  /**
1043
1138
  * Controls the color of the icon.
1044
1139
  */
@@ -1046,11 +1141,10 @@ interface IconColorPreviewable {
1046
1141
  }
1047
1142
 
1048
1143
  export interface PreviewGallery
1049
- extends TextPreviewable,
1050
- ImagePreviewable,
1051
- IconPreviewable,
1052
- IconColorPreviewable,
1053
- IconColorPreviewable {
1144
+ extends WithTextPreview,
1145
+ WithImagePreview,
1146
+ WithIconPreview,
1147
+ WithIconColorPreview {
1054
1148
  /**
1055
1149
  * Controls how the gallery image is positioned within the gallery.
1056
1150
  */
@@ -1058,17 +1152,17 @@ export interface PreviewGallery
1058
1152
  }
1059
1153
 
1060
1154
  export interface PreviewMetadata
1061
- extends TextPreviewable,
1062
- ImagePreviewable,
1063
- IconPreviewable,
1064
- IconColorPreviewable {}
1155
+ extends WithTextPreview,
1156
+ WithImagePreview,
1157
+ WithIconPreview,
1158
+ WithIconColorPreview {}
1065
1159
 
1066
1160
  export interface Preview
1067
- extends TextPreviewable,
1068
- ImagePreviewable,
1069
- IconPreviewable,
1070
- IconColorPreviewable,
1071
- SubtextPreviewable {
1161
+ extends WithTextPreview,
1162
+ WithImagePreview,
1163
+ WithIconPreview,
1164
+ WithIconColorPreview,
1165
+ WithSubtextPreview {
1072
1166
  /**
1073
1167
  * Defines a list of items that can contain an image, icon, and text.
1074
1168
  */
@@ -1124,21 +1218,44 @@ export interface AddOption {
1124
1218
  href?: string;
1125
1219
  }
1126
1220
 
1127
- interface Previewable {
1221
+ interface WithPreview {
1128
1222
  /**
1129
1223
  * Changes the way items are previewed in the CMS.
1130
1224
  */
1131
1225
  preview?: Preview;
1132
1226
  }
1133
1227
 
1134
- interface PickerPreviewable {
1228
+ interface WithPickerPreview {
1135
1229
  /**
1136
1230
  * Changes the way items are previewed in the CMS while being chosen.
1137
1231
  */
1138
1232
  picker_preview?: Preview;
1139
1233
  }
1140
1234
 
1141
- export interface Schema extends Cascade, Previewable, Schemalike {
1235
+ interface SchemaBase {
1236
+ /**
1237
+ * If true, inputs are sorted to match when editing. Extra inputs are ordered after expected
1238
+ * inputs, unless `remove_extra_inputs` is true. Defaults to true.
1239
+ */
1240
+ reorder_inputs?: boolean;
1241
+ /**
1242
+ * Hides unexpected inputs when editing. Has no effect if `remove_extra_inputs` is true. Defaults
1243
+ * to false.
1244
+ */
1245
+ hide_extra_inputs?: boolean;
1246
+ /**
1247
+ * If checked, empty inputs are removed from the source file on save. Removed inputs will be
1248
+ * available for editing again, provided they are in the matching schema/structure. Defaults to
1249
+ * false.
1250
+ */
1251
+ remove_empty_inputs?: boolean;
1252
+ /**
1253
+ * If checked, extra inputs are removed when editing. Defaults to true.
1254
+ */
1255
+ remove_extra_inputs?: boolean;
1256
+ }
1257
+
1258
+ export interface Schema extends Cascade, WithPreview, SchemaBase {
1142
1259
  /**
1143
1260
  * The path to the schema file. Relative to the root folder of the site.
1144
1261
  */
@@ -1149,9 +1266,7 @@ export interface Schema extends Cascade, Previewable, Schemalike {
1149
1266
  name?: string;
1150
1267
  /**
1151
1268
  * Displayed in the add menu when creating new files; also used as the icon for collection files
1152
- * if no other preview is found.
1153
- *
1154
- * @default 'notes'
1269
+ * if no other preview is found. Defaults to notes.
1155
1270
  */
1156
1271
  icon?: Icon;
1157
1272
  /**
@@ -1205,7 +1320,7 @@ export interface Create extends ReducedCascade {
1205
1320
  publish_to?: string;
1206
1321
  }
1207
1322
 
1208
- export interface CollectionConfig extends Cascade, Previewable {
1323
+ export interface CollectionConfig extends Cascade, WithPreview {
1209
1324
  /**
1210
1325
  * The top-most folder where the files in this collection are stored. It is relative to source.
1211
1326
  */
@@ -1322,36 +1437,7 @@ export interface CollectionGroup {
1322
1437
  collections: string[];
1323
1438
  }
1324
1439
 
1325
- interface Schemalike {
1326
- /**
1327
- * If true, inputs are sorted to match when editing. Extra inputs are ordered after expected
1328
- * inputs, unless `remove_extra_inputs` is true.
1329
- *
1330
- * @default true
1331
- */
1332
- reorder_inputs?: boolean;
1333
- /**
1334
- * Hides unexpected inputs when editing. Has no effect if `remove_extra_inputs` is true.
1335
- *
1336
- * @default false
1337
- */
1338
- hide_extra_inputs?: boolean;
1339
- /**
1340
- * If checked, empty inputs are removed from the source file on save. Removed inputs will be
1341
- * available for editing again, provided they are in the matching schema/structure.
1342
- *
1343
- * @default false
1344
- */
1345
- remove_empty_inputs?: boolean;
1346
- /**
1347
- * If checked, extra inputs are removed when editing.
1348
- *
1349
- * @default true
1350
- */
1351
- remove_extra_inputs?: boolean;
1352
- }
1353
-
1354
- export interface Structure extends Schemalike {
1440
+ export interface Structure extends SchemaBase {
1355
1441
  /**
1356
1442
  * Defines what values are available to add when using this structure.
1357
1443
  */
@@ -1368,7 +1454,7 @@ export interface Structure extends Schemalike {
1368
1454
  style?: 'select' | 'modal';
1369
1455
  }
1370
1456
 
1371
- export interface StructureValue extends Previewable, PickerPreviewable, Schemalike {
1457
+ export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBase {
1372
1458
  /**
1373
1459
  * A unique reference value used when referring to this structure value from the Object input's
1374
1460
  * assigned_structures option.
@@ -1403,17 +1489,26 @@ export interface StructureValue extends Previewable, PickerPreviewable, Schemali
1403
1489
  * Allows you to group the inputs inside this object together without changing the data structure.
1404
1490
  */
1405
1491
  groups?: ObjectInputGroup[];
1492
+ /**
1493
+ * Controls which order input groups and ungrouped inputs appear in.
1494
+ */
1495
+ place_groups_below?: boolean;
1496
+ /**
1497
+ * Show nested objects as tabs. Requires all top-level keys to be objects.
1498
+ */
1499
+ tabbed?: boolean;
1406
1500
  /**
1407
1501
  * The actual value used when items are added after selection.
1408
1502
  */
1409
- value: any;
1503
+ value: unknown;
1410
1504
  }
1411
1505
 
1412
1506
  export type SelectValues =
1413
- | string
1414
1507
  | string[]
1508
+ | Record<string, string>[]
1415
1509
  | Record<string, string>
1416
- | Record<string, Record<string, any>>;
1510
+ | Record<string, unknown>[]
1511
+ | Record<string, unknown>;
1417
1512
 
1418
1513
  export interface DataConfigEntry {
1419
1514
  /**
@@ -1503,6 +1598,9 @@ export type SsgKey =
1503
1598
  | 'legacy'
1504
1599
  | 'other';
1505
1600
 
1601
+ /**
1602
+ * The base format for the configuration file.
1603
+ */
1506
1604
  export interface Configuration extends Cascade, WithSnippets, WithPaths {
1507
1605
  /**
1508
1606
  * Base path to your site source files, relative to the root folder.