@cloudcannon/configuration-types 0.0.15 → 0.0.17

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,17 +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> extends BaseInputOptions<EmptyType> {
860
+ export interface SelectInputOptions extends WithPreview, WithPickerPreview {
791
861
  /**
792
862
  * Allows new text values to be created at edit time.
793
863
  *
@@ -804,7 +874,7 @@ export interface SelectInputOptions<EmptyType = EmptyTypeText> extends BaseInput
804
874
  * Defines the values available to choose from. Optional, defaults to fetching values from the
805
875
  * naming convention (e.g. colors or my_colors for data set colors).
806
876
  */
807
- values?: SelectValues;
877
+ values?: string | SelectValues;
808
878
  /**
809
879
  * Defines the key used for mapping between saved values and objects in values. This changes how
810
880
  * the input saves selected values to match. Defaults to checking for "id", "uuid", "path",
@@ -812,34 +882,48 @@ export interface SelectInputOptions<EmptyType = EmptyTypeText> extends BaseInput
812
882
  * instead for objects, and the value itself is used for primitive types.
813
883
  */
814
884
  value_key?: string;
885
+ /**
886
+ * Controls how selected items are rendered.
887
+ */
888
+ view?: 'card' | 'text' | 'gallery' | 'gallery-left';
889
+ /**
890
+ * Controls how selectable options are rendered.
891
+ */
892
+ picker_view?: 'card' | 'text' | 'gallery' | 'gallery-left';
815
893
  }
816
894
 
817
- export interface SelectInput extends BaseInput<SelectInputOptions> {
895
+ export interface SelectInput extends BaseInput {
818
896
  type: 'select';
897
+ /**
898
+ * Options that are specific to this `type` of input.
899
+ */
900
+ options?: SelectInputOptions & WithEmptyTypeText;
819
901
  }
820
902
 
821
- export interface MultiselectInputOptions extends SelectInputOptions<EmptyTypeArray> {}
822
-
823
- export interface MultiselectInput extends BaseInput<MultiselectInputOptions> {
903
+ export interface MultiselectInput extends BaseInput {
824
904
  type: 'multiselect';
825
- }
826
-
827
- export interface ChoiceInputOptions<EmptyType = EmptyTypeText>
828
- extends Omit<SelectInputOptions<EmptyType>, 'allow_create'> {
829
905
  /**
830
- * The preview definition for changing the way selected and available options are displayed.
906
+ * Options that are specific to this `type` of input.
831
907
  */
832
- preview?: SelectPreview;
908
+ options?: SelectInputOptions & WithEmptyTypeArray;
833
909
  }
834
910
 
835
- export interface ChoiceInput extends BaseInput<ChoiceInputOptions> {
911
+ export interface ChoiceInputOptions extends Omit<SelectInputOptions, 'allow_create'> {}
912
+
913
+ export interface ChoiceInput extends BaseInput {
836
914
  type: 'choice';
915
+ /**
916
+ * Options that are specific to this `type` of input.
917
+ */
918
+ options?: ChoiceInputOptions & WithEmptyTypeText;
837
919
  }
838
920
 
839
- export interface MultichoiceInputOptions extends ChoiceInputOptions<EmptyTypeArray> {}
840
-
841
- export interface MultichoiceInput extends BaseInput<MultichoiceInputOptions> {
921
+ export interface MultichoiceInput extends BaseInput {
842
922
  type: 'multichoice';
923
+ /**
924
+ * Options that are specific to this `type` of input.
925
+ */
926
+ options?: ChoiceInputOptions & WithEmptyTypeArray;
843
927
  }
844
928
 
845
929
  export interface ObjectInputGroup {
@@ -850,7 +934,7 @@ export interface ObjectInputGroup {
850
934
  documentation?: Documentation;
851
935
  }
852
936
 
853
- export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject> {
937
+ export interface ObjectInputOptions extends WithEmptyTypeObject, WithPreview {
854
938
  /**
855
939
  * Changes the appearance and behavior of the input.
856
940
  */
@@ -877,12 +961,6 @@ export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject> {
877
961
  */
878
962
  structures?: string | Structure;
879
963
  };
880
- /**
881
- * The preview definition for changing the way data within an object input is previewed before
882
- * being expanded. If the input has `structures`, the preview from the structure value is used
883
- * instead.
884
- */
885
- preview?: ObjectPreview;
886
964
  /**
887
965
  * Provides data formats for value of this object. When choosing an item, team members are
888
966
  * prompted to choose from a number of values you have defined. `structures` applies to the object
@@ -904,19 +982,21 @@ export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject> {
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';
911
- }
912
-
913
- export interface ArrayInputOptions extends BaseInputOptions<EmptyTypeArray> {
914
993
  /**
915
- * The preview definition for changing the way data within an array input's items are previewed
916
- * before being expanded. If the input has structures, the preview from the structure value is
917
- * used instead.
994
+ * Options that are specific to this `type` of input.
918
995
  */
919
- preview?: ObjectPreview;
996
+ options?: ObjectInputOptions;
997
+ }
998
+
999
+ export interface ArrayInputOptions extends WithEmptyTypeArray {
920
1000
  /**
921
1001
  * Provides data formats for value of this object. When choosing an item, team members are
922
1002
  * prompted to choose from a number of values you have defined.
@@ -924,12 +1004,21 @@ export interface ArrayInputOptions extends BaseInputOptions<EmptyTypeArray> {
924
1004
  structures?: string | Structure;
925
1005
  }
926
1006
 
927
- export interface ArrayInput extends BaseInput<ArrayInputOptions> {
1007
+ export interface ArrayInput extends BaseInput {
928
1008
  type: 'array';
1009
+ /**
1010
+ * Options that are specific to this `type` of input.
1011
+ */
1012
+ options?: ArrayInputOptions;
929
1013
  }
930
1014
 
931
- export interface UnknownInput extends BaseInput<BaseInputOptions> {
1015
+ export interface UnknownInput extends BaseInput {
932
1016
  type?: undefined | null;
1017
+
1018
+ /**
1019
+ * Options that are specific to this `type` of input.
1020
+ */
1021
+ options?: WithEmptyTypeText;
933
1022
  }
934
1023
 
935
1024
  export type Input =
@@ -1016,35 +1105,35 @@ interface PreviewKeyEntry {
1016
1105
 
1017
1106
  type PreviewEntry = Array<PreviewKeyEntry | string | boolean> | string | boolean;
1018
1107
 
1019
- interface TextPreviewable {
1108
+ interface WithTextPreview {
1020
1109
  /**
1021
1110
  * Controls the main text shown per item.
1022
1111
  */
1023
1112
  text?: PreviewEntry;
1024
1113
  }
1025
1114
 
1026
- interface ImagePreviewable {
1115
+ interface WithImagePreview {
1027
1116
  /**
1028
1117
  * Controls the image shown per item.
1029
1118
  */
1030
1119
  image?: PreviewEntry;
1031
1120
  }
1032
1121
 
1033
- interface SubtextPreviewable {
1122
+ interface WithSubtextPreview {
1034
1123
  /**
1035
1124
  * Controls the supporting text shown per item.
1036
1125
  */
1037
1126
  subtext?: PreviewEntry;
1038
1127
  }
1039
1128
 
1040
- interface IconPreviewable {
1129
+ interface WithIconPreview {
1041
1130
  /**
1042
1131
  * Controls the icon shown per item. Must result in a Material Icon name.
1043
1132
  */
1044
1133
  icon?: PreviewEntry;
1045
1134
  }
1046
1135
 
1047
- interface IconColorPreviewable {
1136
+ interface WithIconColorPreview {
1048
1137
  /**
1049
1138
  * Controls the color of the icon.
1050
1139
  */
@@ -1052,10 +1141,10 @@ interface IconColorPreviewable {
1052
1141
  }
1053
1142
 
1054
1143
  export interface PreviewGallery
1055
- extends TextPreviewable,
1056
- ImagePreviewable,
1057
- IconPreviewable,
1058
- IconColorPreviewable {
1144
+ extends WithTextPreview,
1145
+ WithImagePreview,
1146
+ WithIconPreview,
1147
+ WithIconColorPreview {
1059
1148
  /**
1060
1149
  * Controls how the gallery image is positioned within the gallery.
1061
1150
  */
@@ -1063,25 +1152,17 @@ export interface PreviewGallery
1063
1152
  }
1064
1153
 
1065
1154
  export interface PreviewMetadata
1066
- extends TextPreviewable,
1067
- ImagePreviewable,
1068
- IconPreviewable,
1069
- IconColorPreviewable {}
1070
-
1071
- export interface ObjectPreview
1072
- extends TextPreviewable,
1073
- ImagePreviewable,
1074
- IconPreviewable,
1075
- SubtextPreviewable {}
1076
-
1077
- export interface SelectPreview extends TextPreviewable, IconPreviewable {}
1155
+ extends WithTextPreview,
1156
+ WithImagePreview,
1157
+ WithIconPreview,
1158
+ WithIconColorPreview {}
1078
1159
 
1079
1160
  export interface Preview
1080
- extends TextPreviewable,
1081
- ImagePreviewable,
1082
- IconPreviewable,
1083
- IconColorPreviewable,
1084
- SubtextPreviewable {
1161
+ extends WithTextPreview,
1162
+ WithImagePreview,
1163
+ WithIconPreview,
1164
+ WithIconColorPreview,
1165
+ WithSubtextPreview {
1085
1166
  /**
1086
1167
  * Defines a list of items that can contain an image, icon, and text.
1087
1168
  */
@@ -1137,21 +1218,44 @@ export interface AddOption {
1137
1218
  href?: string;
1138
1219
  }
1139
1220
 
1140
- interface Previewable {
1221
+ interface WithPreview {
1141
1222
  /**
1142
1223
  * Changes the way items are previewed in the CMS.
1143
1224
  */
1144
1225
  preview?: Preview;
1145
1226
  }
1146
1227
 
1147
- interface PickerPreviewable {
1228
+ interface WithPickerPreview {
1148
1229
  /**
1149
1230
  * Changes the way items are previewed in the CMS while being chosen.
1150
1231
  */
1151
1232
  picker_preview?: Preview;
1152
1233
  }
1153
1234
 
1154
- 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 {
1155
1259
  /**
1156
1260
  * The path to the schema file. Relative to the root folder of the site.
1157
1261
  */
@@ -1162,9 +1266,7 @@ export interface Schema extends Cascade, Previewable, Schemalike {
1162
1266
  name?: string;
1163
1267
  /**
1164
1268
  * Displayed in the add menu when creating new files; also used as the icon for collection files
1165
- * if no other preview is found.
1166
- *
1167
- * @default 'notes'
1269
+ * if no other preview is found. Defaults to notes.
1168
1270
  */
1169
1271
  icon?: Icon;
1170
1272
  /**
@@ -1218,7 +1320,7 @@ export interface Create extends ReducedCascade {
1218
1320
  publish_to?: string;
1219
1321
  }
1220
1322
 
1221
- export interface CollectionConfig extends Cascade, Previewable {
1323
+ export interface CollectionConfig extends Cascade, WithPreview {
1222
1324
  /**
1223
1325
  * The top-most folder where the files in this collection are stored. It is relative to source.
1224
1326
  */
@@ -1335,36 +1437,7 @@ export interface CollectionGroup {
1335
1437
  collections: string[];
1336
1438
  }
1337
1439
 
1338
- interface Schemalike {
1339
- /**
1340
- * If true, inputs are sorted to match when editing. Extra inputs are ordered after expected
1341
- * inputs, unless `remove_extra_inputs` is true.
1342
- *
1343
- * @default true
1344
- */
1345
- reorder_inputs?: boolean;
1346
- /**
1347
- * Hides unexpected inputs when editing. Has no effect if `remove_extra_inputs` is true.
1348
- *
1349
- * @default false
1350
- */
1351
- hide_extra_inputs?: boolean;
1352
- /**
1353
- * If checked, empty inputs are removed from the source file on save. Removed inputs will be
1354
- * available for editing again, provided they are in the matching schema/structure.
1355
- *
1356
- * @default false
1357
- */
1358
- remove_empty_inputs?: boolean;
1359
- /**
1360
- * If checked, extra inputs are removed when editing.
1361
- *
1362
- * @default true
1363
- */
1364
- remove_extra_inputs?: boolean;
1365
- }
1366
-
1367
- export interface Structure extends Schemalike {
1440
+ export interface Structure extends SchemaBase {
1368
1441
  /**
1369
1442
  * Defines what values are available to add when using this structure.
1370
1443
  */
@@ -1381,7 +1454,7 @@ export interface Structure extends Schemalike {
1381
1454
  style?: 'select' | 'modal';
1382
1455
  }
1383
1456
 
1384
- export interface StructureValue extends Previewable, PickerPreviewable, Schemalike {
1457
+ export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBase {
1385
1458
  /**
1386
1459
  * A unique reference value used when referring to this structure value from the Object input's
1387
1460
  * assigned_structures option.
@@ -1412,17 +1485,30 @@ export interface StructureValue extends Previewable, PickerPreviewable, Schemali
1412
1485
  * Used to group and filter items when selecting from a modal.
1413
1486
  */
1414
1487
  tags?: string[];
1488
+ /**
1489
+ * Allows you to group the inputs inside this object together without changing the data structure.
1490
+ */
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;
1415
1500
  /**
1416
1501
  * The actual value used when items are added after selection.
1417
1502
  */
1418
- value: any;
1503
+ value: unknown;
1419
1504
  }
1420
1505
 
1421
1506
  export type SelectValues =
1422
- | string
1423
1507
  | string[]
1508
+ | Record<string, string>[]
1424
1509
  | Record<string, string>
1425
- | Record<string, Record<string, any>>;
1510
+ | Record<string, unknown>[]
1511
+ | Record<string, unknown>;
1426
1512
 
1427
1513
  export interface DataConfigEntry {
1428
1514
  /**