@cloudcannon/configuration-types 0.0.18 → 0.0.20

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,11 +1,11 @@
1
1
  import type Scrapbooker from '@cloudcannon/snippet-types';
2
2
 
3
3
  import type { Icon } from './icon';
4
- import type { Timezone } from './timezone';
4
+ import type { MarkdownSettings } from './markdown';
5
5
  import type { MimeType } from './mime-type';
6
- import type { Theme } from './theme';
7
6
  import type { Syntax } from './syntax';
8
- import type { MarkdownSettings } from './markdown';
7
+ import type { Theme } from './theme';
8
+ import type { Timezone } from './timezone';
9
9
 
10
10
  export type InstanceValue = 'UUID' | 'NOW';
11
11
  export type EditorKey = 'visual' | 'content' | 'data';
@@ -26,6 +26,10 @@ export interface SnippetConfig extends ReducedCascade, WithPreview, WithPickerPr
26
26
  * this snippet as a block-level element in the content editor.
27
27
  */
28
28
  inline?: boolean;
29
+ /**
30
+ * Controls how selected items are rendered. Defaults to 'card', or 'inline' if `inline` is true.
31
+ */
32
+ view?: 'card' | 'inline' | 'gallery';
29
33
  /**
30
34
  * Whether this snippet treats whitespace as-is or not.
31
35
  */
@@ -33,7 +37,7 @@ export interface SnippetConfig extends ReducedCascade, WithPreview, WithPickerPr
33
37
  /**
34
38
  * The variables required for the selected template.
35
39
  */
36
- definitions?: Record<string, any>;
40
+ definitions?: Record<string, unknown>;
37
41
  /**
38
42
  * Alternate configurations for this snippet.
39
43
  */
@@ -41,7 +45,7 @@ export interface SnippetConfig extends ReducedCascade, WithPreview, WithPickerPr
41
45
  /**
42
46
  * The parameters of this snippet.
43
47
  */
44
- params?: Record<string, any>; // TODO: use ParserConfig from @cloudcannon/scrap-booker.
48
+ params?: Record<string, unknown>; // TODO: use ParserConfig from @cloudcannon/scrap-booker.
45
49
  }
46
50
 
47
51
  export interface SnippetsImports {
@@ -54,6 +58,8 @@ export interface SnippetsImports {
54
58
  /**
55
59
  * The list of excluded snippets. If unset, all snippets are excluded unless defined in
56
60
  * `include`.
61
+ *
62
+ * @uniqueItems
57
63
  */
58
64
  exclude: Array<keyof typeof Scrapbooker.defaults.hugo.snippets>;
59
65
  }
@@ -61,6 +67,8 @@ export interface SnippetsImports {
61
67
  /**
62
68
  * The list of included snippets. If unset, all snippets are included unless defined in
63
69
  * `exclude`.
70
+ *
71
+ * @uniqueItems
64
72
  */
65
73
  include: Array<keyof typeof Scrapbooker.defaults.hugo.snippets>;
66
74
  };
@@ -73,6 +81,8 @@ export interface SnippetsImports {
73
81
  /**
74
82
  * The list of excluded snippets. If unset, all snippets are excluded unless defined in
75
83
  * `include`.
84
+ *
85
+ * @uniqueItems
76
86
  */
77
87
  exclude: Array<keyof typeof Scrapbooker.defaults.jekyll.snippets>;
78
88
  }
@@ -80,6 +90,8 @@ export interface SnippetsImports {
80
90
  /**
81
91
  * The list of included snippets. If unset, all snippets are included unless defined in
82
92
  * `exclude`.
93
+ *
94
+ * @uniqueItems
83
95
  */
84
96
  include: Array<keyof typeof Scrapbooker.defaults.jekyll.snippets>;
85
97
  };
@@ -92,6 +104,8 @@ export interface SnippetsImports {
92
104
  /**
93
105
  * The list of excluded snippets. If unset, all snippets are excluded unless defined in
94
106
  * `include`.
107
+ *
108
+ * @uniqueItems
95
109
  */
96
110
  exclude: Array<keyof typeof Scrapbooker.defaults.mdx.snippets>;
97
111
  }
@@ -99,6 +113,8 @@ export interface SnippetsImports {
99
113
  /**
100
114
  * The list of included snippets. If unset, all snippets are included unless defined in
101
115
  * `exclude`.
116
+ *
117
+ * @uniqueItems
102
118
  */
103
119
  include: Array<keyof typeof Scrapbooker.defaults.mdx.snippets>;
104
120
  };
@@ -111,6 +127,8 @@ export interface SnippetsImports {
111
127
  /**
112
128
  * The list of excluded snippets. If unset, all snippets are excluded unless defined in
113
129
  * `include`.
130
+ *
131
+ * @uniqueItems
114
132
  */
115
133
  exclude: Array<keyof typeof Scrapbooker.defaults.eleventy_liquid.snippets>;
116
134
  }
@@ -118,6 +136,8 @@ export interface SnippetsImports {
118
136
  /**
119
137
  * The list of included snippets. If unset, all snippets are included unless defined in
120
138
  * `exclude`.
139
+ *
140
+ * @uniqueItems
121
141
  */
122
142
  include: Array<keyof typeof Scrapbooker.defaults.eleventy_liquid.snippets>;
123
143
  };
@@ -130,6 +150,8 @@ export interface SnippetsImports {
130
150
  /**
131
151
  * The list of excluded snippets. If unset, all snippets are excluded unless defined in
132
152
  * `include`.
153
+ *
154
+ * @uniqueItems
133
155
  */
134
156
  exclude: Array<keyof typeof Scrapbooker.defaults.eleventy_nunjucks.snippets>;
135
157
  }
@@ -137,6 +159,8 @@ export interface SnippetsImports {
137
159
  /**
138
160
  * The list of included snippets. If unset, all snippets are included unless defined in
139
161
  * `exclude`.
162
+ *
163
+ * @uniqueItems
140
164
  */
141
165
  include: Array<keyof typeof Scrapbooker.defaults.eleventy_nunjucks.snippets>;
142
166
  };
@@ -149,6 +173,8 @@ export interface SnippetsImports {
149
173
  /**
150
174
  * The list of excluded snippets. If unset, all snippets are excluded unless defined in
151
175
  * `include`.
176
+ *
177
+ * @uniqueItems
152
178
  */
153
179
  exclude: Array<keyof typeof Scrapbooker.defaults.markdoc.snippets>;
154
180
  }
@@ -156,6 +182,8 @@ export interface SnippetsImports {
156
182
  /**
157
183
  * The list of included snippets. If unset, all snippets are included unless defined in
158
184
  * `exclude`.
185
+ *
186
+ * @uniqueItems
159
187
  */
160
188
  include: Array<keyof typeof Scrapbooker.defaults.markdoc.snippets>;
161
189
  };
@@ -168,6 +196,8 @@ export interface SnippetsImports {
168
196
  /**
169
197
  * The list of excluded snippets. If unset, all snippets are excluded unless defined in
170
198
  * `include`.
199
+ *
200
+ * @uniqueItems
171
201
  */
172
202
  exclude: Array<keyof typeof Scrapbooker.defaults.python_markdown_extensions.snippets>;
173
203
  }
@@ -175,6 +205,8 @@ export interface SnippetsImports {
175
205
  /**
176
206
  * The list of included snippets. If unset, all snippets are included unless defined in
177
207
  * `exclude`.
208
+ *
209
+ * @uniqueItems
178
210
  */
179
211
  include: Array<keyof typeof Scrapbooker.defaults.python_markdown_extensions.snippets>;
180
212
  };
@@ -187,6 +219,8 @@ export interface SnippetsImports {
187
219
  /**
188
220
  * The list of excluded snippets. If unset, all snippets are excluded unless defined in
189
221
  * `include`.
222
+ *
223
+ * @uniqueItems
190
224
  */
191
225
  exclude: Array<keyof typeof Scrapbooker.defaults.docusaurus_mdx.snippets>;
192
226
  }
@@ -194,30 +228,13 @@ export interface SnippetsImports {
194
228
  /**
195
229
  * The list of included snippets. If unset, all snippets are included unless defined in
196
230
  * `exclude`.
231
+ *
232
+ * @uniqueItems
197
233
  */
198
234
  include: Array<keyof typeof Scrapbooker.defaults.docusaurus_mdx.snippets>;
199
235
  };
200
236
  }
201
237
 
202
- interface WithSnippets {
203
- /**
204
- * Configuration for custom snippets.
205
- */
206
- _snippets?: Record<string, SnippetConfig>;
207
- /**
208
- * Provides control over which snippets are available to use and/or extend within `_snippets`.
209
- */
210
- _snippets_imports?: SnippetsImports;
211
- /**
212
- * Extended option used when creating more complex custom snippets.
213
- */
214
- _snippets_templates?: Record<string, SnippetConfig>;
215
- /**
216
- * Extended option used when creating more complex custom snippets.
217
- */
218
- _snippets_definitions?: Record<string, SnippetConfig>;
219
- }
220
-
221
238
  interface ImageResizeable {
222
239
  /**
223
240
  * Sets the format images are converted to prior to upload. The extension of the file is updated
@@ -310,11 +327,15 @@ export interface Editables {
310
327
  export interface BlockEditable extends ImageResizeable, TextEditable {
311
328
  /**
312
329
  * Enables a control to wrap blocks of text in block quotes.
330
+ *
331
+ * @default true
313
332
  */
314
333
  blockquote?: boolean;
315
334
  /**
316
335
  * Enables a control to insert an unordered list, or to convert selected blocks of text into a
317
336
  * unordered list.
337
+ *
338
+ * @default true
318
339
  */
319
340
  bulletedlist?: boolean;
320
341
  /**
@@ -325,37 +346,53 @@ export interface BlockEditable extends ImageResizeable, TextEditable {
325
346
  center?: string;
326
347
  /**
327
348
  * Enables a control to create an inline code element, containing any selected text.
349
+ *
350
+ * @default false
328
351
  */
329
352
  code_inline?: boolean;
330
353
  /**
331
354
  * Enables a control to insert a code block.
355
+ *
356
+ * @default false
332
357
  */
333
358
  code_block?: boolean;
334
359
  /**
335
360
  * Enables both block and inline code controls: `code_block` and `code_inline`.
361
+ *
362
+ * @default false
336
363
  */
337
364
  code?: boolean;
338
365
  /**
339
366
  * Enables a control to insert a region of raw HTML, including YouTube, Vimeo, Tweets, and other
340
367
  * media. Embedded content is sanitized to mitigate XSS risks, which includes removing style tags.
341
368
  * Embeds containing script tags are not loaded in the editor.
369
+ *
370
+ * @default false
342
371
  */
343
372
  embed?: boolean;
344
373
  /**
345
374
  * Enables a drop down menu for structured text. Has options for "p", "h1", "h2", "h3", "h4",
346
375
  * "h5", "h6". Set as space separated options (e.g. "p h1 h2").
376
+ *
377
+ * @default p h1 h2 h3 h4 h5 h6
347
378
  */
348
379
  format?: string;
349
380
  /**
350
381
  * Enables a control to insert a horizontal rule.
382
+ *
383
+ * @default false
351
384
  */
352
385
  horizontalrule?: boolean;
353
386
  /**
354
387
  * Enables a control to insert an image. The image can be uploaded, existing or an external link.
388
+ *
389
+ * @default true
355
390
  */
356
391
  image?: boolean;
357
392
  /**
358
393
  * Enables a control to increase indentation for numbered and unordered lists.
394
+ *
395
+ * @default false
359
396
  */
360
397
  indent?: boolean;
361
398
  /**
@@ -373,10 +410,14 @@ export interface BlockEditable extends ImageResizeable, TextEditable {
373
410
  /**
374
411
  * Enables a control to insert a numbered list, or to convert selected blocks of text into a
375
412
  * numbered list.
413
+ *
414
+ * @default true
376
415
  */
377
416
  numberedlist?: boolean;
378
417
  /**
379
418
  * Enables a control to reduce indentation for numbered and unordered lists.
419
+ *
420
+ * @default false
380
421
  */
381
422
  outdent?: boolean;
382
423
  /**
@@ -387,6 +428,8 @@ export interface BlockEditable extends ImageResizeable, TextEditable {
387
428
  right?: string;
388
429
  /**
389
430
  * Enables a control to insert snippets, if any are available.
431
+ *
432
+ * @default true
390
433
  */
391
434
  snippet?: boolean;
392
435
  /**
@@ -398,6 +441,8 @@ export interface BlockEditable extends ImageResizeable, TextEditable {
398
441
  /**
399
442
  * Enables a control to insert a table. Further options for table cells are available in the
400
443
  * context menu for cells within the editor.
444
+ *
445
+ * @default false
401
446
  */
402
447
  table?: boolean;
403
448
  }
@@ -411,59 +456,81 @@ interface WithPaths {
411
456
  paths?: Paths;
412
457
  }
413
458
 
414
- export interface ImageEditable extends ImageResizeable, WithPaths {}
459
+ export type ImageEditable = ImageResizeable & WithPaths;
415
460
 
416
- export interface LinkEditable extends WithPaths {}
461
+ export type LinkEditable = WithPaths;
417
462
 
418
463
  export interface TextEditable extends WithPaths {
419
464
  /**
420
465
  * Enables a control to set selected text to bold.
466
+ *
467
+ * @default true
421
468
  */
422
469
  bold?: boolean;
423
470
  /**
424
471
  * Enables a control to copy formatting from text to other text. Only applies to formatting from
425
472
  * `bold`, `italic`, `underline`, `strike`, `subscript`, and `superscript`. Does not copy other
426
473
  * styles or formatting.
474
+ *
475
+ * @default false
427
476
  */
428
477
  copyformatting?: boolean;
429
478
  /**
430
479
  * Enables a control to italicize selected text.
480
+ *
481
+ * @default true
431
482
  */
432
483
  italic?: boolean;
433
484
  /**
434
485
  * Enables a control to create hyperlinks around selected text.
486
+ *
487
+ * @default true
435
488
  */
436
489
  link?: boolean;
437
490
  /**
438
491
  * Enables a control to redo recent edits undone with undo. Redo is always enabled through
439
492
  * standard OS-specific keyboard shortcuts.
493
+ *
494
+ * @default false
440
495
  */
441
496
  redo?: boolean;
442
497
  /**
443
498
  * Enables the control to remove formatting from text. Applies to formatting from `bold`,
444
499
  * `italic`, `underline`, `strike`, `subscript`, and `superscript`. Does not remove other styles
445
500
  * or formatting.
501
+ *
502
+ * @default true
446
503
  */
447
504
  removeformat?: boolean;
448
505
  /**
449
506
  * Enables a control to strike selected text.
507
+ *
508
+ * @default false
450
509
  */
451
510
  strike?: boolean;
452
511
  /**
453
512
  * Enables a control to set selected text to subscript.
513
+ *
514
+ * @default false
454
515
  */
455
516
  subscript?: boolean;
456
517
  /**
457
518
  * Enables a control to set selected text to superscript.
519
+ *
520
+ * @default false
458
521
  */
459
522
  superscript?: boolean;
460
523
  /**
461
524
  * Enables a control to underline selected text.
525
+ *
526
+ * @default false
462
527
  */
463
528
  underline?: boolean;
464
529
  /**
465
530
  * Enables a control to undo recent edits. Undo is always enabled through standard OS-specific
466
531
  * keyboard shortcuts.
532
+ *
533
+ * @default false
467
534
  */
468
535
  undo?: boolean;
469
536
  /**
@@ -508,24 +575,6 @@ export interface Cascade extends ReducedCascade {
508
575
  * Contains input options for Editable Regions and the Content Editor.
509
576
  */
510
577
  _editables?: Editables;
511
- /**
512
- * Now known as _structures.
513
- *
514
- * @deprecated Use _structures instead.
515
- */
516
- _array_structures?: Record<string, unknown>;
517
- /**
518
- * Now part of _inputs.*.comment.
519
- *
520
- * @deprecated Use _inputs instead.
521
- */
522
- _comments?: Record<string, string>;
523
- /**
524
- * Now part of _inputs.*.options.
525
- *
526
- * @deprecated Use _inputs instead.
527
- */
528
- _options?: Record<string, Record<string, unknown>>;
529
578
  }
530
579
 
531
580
  export type InputType =
@@ -558,43 +607,46 @@ export type InputType =
558
607
  | 'choice'
559
608
  | 'multichoice'
560
609
  | 'object'
561
- | 'array';
562
-
563
- export type EmptyTypeText = 'null' | 'string';
564
- export type EmptyTypeNumber = 'null' | 'number';
565
- export type EmptyTypeArray = 'null' | 'array';
566
- export type EmptyTypeObject = 'null' | 'object';
610
+ | 'array'
611
+ | 'auto';
567
612
 
568
613
  interface WithEmptyTypeText {
569
614
  /**
570
615
  * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
571
616
  */
572
- empty_type?: EmptyTypeText;
617
+ empty_type?: 'null' | 'string';
573
618
  }
574
619
 
575
620
  interface WithEmptyTypeNumber {
576
621
  /**
577
622
  * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
578
623
  */
579
- empty_type?: EmptyTypeNumber;
624
+ empty_type?: 'null' | 'number';
580
625
  }
581
626
 
582
627
  interface WithEmptyTypeObject {
583
628
  /**
584
629
  * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
585
630
  */
586
- empty_type?: EmptyTypeObject;
631
+ empty_type?: 'null' | 'object';
587
632
  }
588
633
 
589
634
  interface WithEmptyTypeArray {
590
635
  /**
591
636
  * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
592
637
  */
593
- empty_type?: EmptyTypeArray;
638
+ empty_type?: 'null' | 'array';
594
639
  }
595
640
 
596
641
  export interface BaseInput {
597
- type?: InputType | undefined | null;
642
+ /**
643
+ * Sets an input type, which controls how this input appears and behaves.
644
+ */
645
+ type?: InputType;
646
+ /**
647
+ * Options that are specific to this `type` of input.
648
+ */
649
+ options?: WithEmptyTypeText | WithEmptyTypeNumber | WithEmptyTypeObject | WithEmptyTypeArray;
598
650
  /**
599
651
  * Changes the subtext below the _Label_. Has no default. Supports a limited set of Markdown:
600
652
  * links, bold, italic, subscript, superscript, and inline code elements are allowed.
@@ -643,8 +695,6 @@ export interface BaseInput {
643
695
  /**
644
696
  * Specifies whether or not this input configuration should be merged with any matching, less
645
697
  * specific configuration.
646
- *
647
- * @default true
648
698
  */
649
699
  cascade?: boolean;
650
700
  }
@@ -680,6 +730,8 @@ export interface TextInput extends BaseInput {
680
730
  export interface TextareaInputOptions extends TextInputOptions {
681
731
  /**
682
732
  * Shows a character counter below the input if enabled.
733
+ *
734
+ * @default false
683
735
  */
684
736
  show_count?: boolean;
685
737
  }
@@ -769,9 +821,25 @@ export interface NumberInput extends BaseInput {
769
821
  }
770
822
 
771
823
  export interface RangeInputOptions extends NumberInputOptions {
772
- min: number;
773
- max: number;
774
- step: number;
824
+ /**
825
+ * The lowest value in the range of permitted values.
826
+ *
827
+ * @default 0
828
+ */
829
+ min?: number;
830
+ /**
831
+ * The greatest value in the range of permitted values.
832
+ *
833
+ * @default 10
834
+ */
835
+ max?: number;
836
+ /**
837
+ * A number that specifies the granularity that the value must adhere to, or the special value
838
+ * any, which allows any decimal value between `max` and `min`.
839
+ *
840
+ * @default 1
841
+ */
842
+ step?: number;
775
843
  }
776
844
 
777
845
  export interface RangeInput extends BaseInput {
@@ -795,10 +863,14 @@ export interface UrlInput extends BaseInput {
795
863
  export interface RichTextInputOptions extends WithEmptyTypeText, ImageResizeable, BlockEditable {
796
864
  /**
797
865
  * Shows or hides the resize handler to vertically resize the input.
866
+ *
867
+ * @default false
798
868
  */
799
869
  allow_resize?: boolean;
800
870
  /**
801
871
  * Defines the initial height of this input in pixels (px).
872
+ *
873
+ * @default 320
802
874
  */
803
875
  initial_height?: number;
804
876
  }
@@ -815,6 +887,8 @@ export interface DateInputOptions extends WithEmptyTypeText {
815
887
  /**
816
888
  * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
817
889
  * date is persisted to the file with. Defaults to the global `timezone`.
890
+ *
891
+ * @default Etc/UTC
818
892
  */
819
893
  timezone?: Timezone;
820
894
  }
@@ -822,16 +896,18 @@ export interface DateInputOptions extends WithEmptyTypeText {
822
896
  export interface DateInput extends BaseInput {
823
897
  type: 'date' | 'datetime';
824
898
  /**
825
- * Options that are specific to this `type` of input.
899
+ * Options that are specific to Date inputs.
826
900
  */
827
901
  options?: DateInputOptions;
828
902
  }
829
903
 
830
904
  export interface FileInputOptions extends WithEmptyTypeText, WithPaths {
831
905
  /**
832
- * Restricts which file types are available to select or upload to this input.
906
+ * Restricts which file types are available to select or upload to this input. Accepted format is
907
+ * an array or comma-separated string of MIME types. The special value '*' means any type is
908
+ * accepted.
833
909
  */
834
- accepts_mime_types?: MimeType[] | '*';
910
+ accepts_mime_types?: MimeType[] | string;
835
911
  /**
836
912
  * If you have one or more DAMs connected to your site, you can use this key to list which asset
837
913
  * sources can be uploaded to and selected from.
@@ -842,17 +918,17 @@ export interface FileInputOptions extends WithEmptyTypeText, WithPaths {
842
918
  export interface FileInput extends BaseInput {
843
919
  type: 'file' | 'document';
844
920
  /**
845
- * Options that are specific to this `type` of input.
921
+ * Options that are specific to File inputs.
846
922
  */
847
923
  options?: FileInputOptions;
848
924
  }
849
925
 
850
- export interface ImageInputOptions extends FileInputOptions, ImageResizeable {}
926
+ export type ImageInputOptions = FileInputOptions & ImageResizeable;
851
927
 
852
928
  export interface ImageInput extends BaseInput {
853
929
  type: 'image';
854
930
  /**
855
- * Options that are specific to this `type` of input.
931
+ * Options that are specific to Image inputs.
856
932
  */
857
933
  options?: ImageInputOptions;
858
934
  }
@@ -927,16 +1003,36 @@ export interface MultichoiceInput extends BaseInput {
927
1003
  }
928
1004
 
929
1005
  export interface ObjectInputGroup {
1006
+ /**
1007
+ * The main text for the group shown when collapsed or expanded.
1008
+ */
930
1009
  heading?: string;
1010
+ /**
1011
+ * Changes the subtext below the `heading`. Has no default. Supports a limited set of Markdown:
1012
+ * links, bold, italic, subscript, superscript, and inline code elements are allowed.
1013
+ */
931
1014
  comment?: string;
1015
+ /**
1016
+ * Controls if this group is collapsed or expanded when first viewed.
1017
+ *
1018
+ * @default false
1019
+ */
932
1020
  collapsed?: boolean;
1021
+ /**
1022
+ * The keys of each input in this group.
1023
+ */
933
1024
  inputs?: string[];
1025
+ /**
1026
+ * Provides a custom link for documentation for editors shown above the collection file list.
1027
+ */
934
1028
  documentation?: Documentation;
935
1029
  }
936
1030
 
937
1031
  export interface ObjectInputOptions extends WithEmptyTypeObject, WithPreview {
938
1032
  /**
939
1033
  * Changes the appearance and behavior of the input.
1034
+ *
1035
+ * @default object
940
1036
  */
941
1037
  subtype?: 'object' | 'mutable' | 'tabbed';
942
1038
  /**
@@ -967,19 +1063,20 @@ export interface ObjectInputOptions extends WithEmptyTypeObject, WithPreview {
967
1063
  * itself.
968
1064
  */
969
1065
  structures?: string | Structure;
970
-
971
1066
  /**
972
1067
  * Allows you to group the inputs inside this object together without changing the data structure.
973
1068
  */
974
1069
  groups?: ObjectInputGroup[];
975
-
976
1070
  /**
977
1071
  * Controls which order input groups and ungrouped inputs appear in.
1072
+ *
1073
+ * @default false
978
1074
  */
979
1075
  place_groups_below?: boolean;
980
-
981
1076
  /**
982
1077
  * Controls whether or not labels on mutable object entries are formatted.
1078
+ *
1079
+ * @default false
983
1080
  */
984
1081
  allow_label_formatting?: boolean;
985
1082
  /**
@@ -1013,8 +1110,7 @@ export interface ArrayInput extends BaseInput {
1013
1110
  }
1014
1111
 
1015
1112
  export interface UnknownInput extends BaseInput {
1016
- type?: undefined | null;
1017
-
1113
+ type?: 'auto' | undefined;
1018
1114
  /**
1019
1115
  * Options that are specific to this `type` of input.
1020
1116
  */
@@ -1050,7 +1146,7 @@ export interface Paths {
1050
1146
  /**
1051
1147
  * Default location of newly uploaded site files.
1052
1148
  *
1053
- * @default 'uploads'
1149
+ * @default uploads
1054
1150
  */
1055
1151
  uploads?: string;
1056
1152
  /**
@@ -1059,8 +1155,6 @@ export interface Paths {
1059
1155
  uploads_filename?: string;
1060
1156
  /**
1061
1157
  * Default location of newly uploaded DAM files.
1062
- *
1063
- * @default ''
1064
1158
  */
1065
1159
  dam_uploads?: string;
1066
1160
  /**
@@ -1070,8 +1164,6 @@ export interface Paths {
1070
1164
  /**
1071
1165
  * Location of statically copied assets for DAM files. This prefix will be removed from the _DAM
1072
1166
  * Uploads_ path when CloudCannon outputs the URL of an asset.
1073
- *
1074
- * @default ''
1075
1167
  */
1076
1168
  dam_static?: string;
1077
1169
  /**
@@ -1092,6 +1184,8 @@ export interface Documentation {
1092
1184
  text?: string;
1093
1185
  /**
1094
1186
  * The icon displayed next to the link.
1187
+ *
1188
+ * @default auto_stories
1095
1189
  */
1096
1190
  icon?: Icon;
1097
1191
  }
@@ -1147,6 +1241,8 @@ export interface PreviewGallery
1147
1241
  WithIconColorPreview {
1148
1242
  /**
1149
1243
  * Controls how the gallery image is positioned within the gallery.
1244
+ *
1245
+ * @default padded
1150
1246
  */
1151
1247
  fit?: 'padded' | 'cover' | 'contain' | 'cover-top';
1152
1248
  }
@@ -1173,50 +1269,56 @@ export interface Preview
1173
1269
  gallery?: PreviewGallery;
1174
1270
  }
1175
1271
 
1176
- export interface AddOption {
1177
- /**
1178
- * The text displayed for the menu item. Defaults to using name from the matching schema if set.
1179
- */
1180
- name?: string;
1181
- /**
1182
- * The icon next to the text in the menu item. Defaults to using icon from the matching schema if
1183
- * set, then falls back to add.
1184
- */
1185
- icon?: Icon;
1186
- /**
1187
- * The editor to open the new file in. Defaults to an appropriate editor for new file's type if
1188
- * possible. If no default editor can be calculated, or the editor does not support the new file
1189
- * type, a warning is shown in place of the editor.
1190
- */
1191
- editor?: EditorKey;
1192
- /**
1193
- * Enforces a path for new files to be created in, regardless of path the user is currently
1194
- * navigated to within the collection file list. Relative to the path of the collection defined in
1195
- * collection. Defaults to the path within the collection the user is currently navigated to.
1196
- */
1197
- base_path?: string;
1198
- /**
1199
- * Sets which collection this action is creating a file in. This is used when matching the value
1200
- * for schema. Defaults to the containing collection these `add_options` are configured in.
1201
- */
1202
- collection?: string;
1203
- /**
1204
- * The schema that new files are created from with this action. This schema is not restricted to
1205
- * the containing collection, and is instead relative to the collection specified with collection.
1206
- * Defaults to default if schemas are configured for the collection.
1207
- */
1208
- schema?: string;
1209
- /**
1210
- * The path to a file used to populate the initial contents of a new file if no schemas are
1211
- * configured. We recommend using schemas, and this is ignored if a schema is available.
1212
- */
1213
- default_content_file?: string;
1214
- /**
1215
- * The link that opens when the option is clicked. Can either be an external or internal link. If
1216
- * internal, the link is relative to the current site.
1217
- */
1218
- href?: string;
1219
- }
1272
+ export type AddOption =
1273
+ | {
1274
+ /**
1275
+ * The text displayed for the menu item. Defaults to using name from the matching schema if
1276
+ * set.
1277
+ */
1278
+ name?: string;
1279
+ /**
1280
+ * The icon next to the text in the menu item. Defaults to using icon from the matching schema
1281
+ * if set, then falls back to add.
1282
+ */
1283
+ icon?: Icon;
1284
+ /**
1285
+ * The editor to open the new file in. Defaults to an appropriate editor for new file's type
1286
+ * if possible. If no default editor can be calculated, or the editor does not support the new
1287
+ * file type, a warning is shown in place of the editor.
1288
+ */
1289
+ editor?: EditorKey;
1290
+ /**
1291
+ * Enforces a path for new files to be created in, regardless of path the user is currently
1292
+ * navigated to within the collection file list. Relative to the path of the collection
1293
+ * defined in collection. Defaults to the path within the collection the user is currently
1294
+ * navigated to.
1295
+ */
1296
+ base_path?: string;
1297
+ /**
1298
+ * Sets which collection this action is creating a file in. This is used when matching the
1299
+ * value for schema. Defaults to the containing collection these `add_options` are configured
1300
+ * in.
1301
+ */
1302
+ collection?: string;
1303
+ /**
1304
+ * The schema that new files are created from with this action. This schema is not restricted
1305
+ * to the containing collection, and is instead relative to the collection specified with
1306
+ * collection. Defaults to default if schemas are configured for the collection.
1307
+ */
1308
+ schema?: string;
1309
+ /**
1310
+ * The path to a file used to populate the initial contents of a new file if no schemas are
1311
+ * configured. We recommend using schemas, and this is ignored if a schema is available.
1312
+ */
1313
+ default_content_file?: string;
1314
+ }
1315
+ | {
1316
+ /**
1317
+ * The link that opens when the option is clicked. Can either be an external or internal link.
1318
+ * If internal, the link is relative to the current site.
1319
+ */
1320
+ href: string;
1321
+ };
1220
1322
 
1221
1323
  interface WithPreview {
1222
1324
  /**
@@ -1267,6 +1369,8 @@ export interface Schema extends Cascade, WithPreview, SchemaBase {
1267
1369
  /**
1268
1370
  * Displayed in the add menu when creating new files; also used as the icon for collection files
1269
1371
  * if no other preview is found. Defaults to notes.
1372
+ *
1373
+ * @default notes
1270
1374
  */
1271
1375
  icon?: Icon;
1272
1376
  /**
@@ -1322,9 +1426,9 @@ export interface Create extends ReducedCascade {
1322
1426
 
1323
1427
  export interface CollectionConfig extends Cascade, WithPreview {
1324
1428
  /**
1325
- * The top-most folder where the files in this collection are stored. It is relative to source.
1429
+ * The top-most folder where the files in this collection are stored. It is relative to `source`.
1326
1430
  */
1327
- path?: string;
1431
+ path: string;
1328
1432
  /**
1329
1433
  * Glob pattern(s) to include or exclude files from this collection. It is relative to `path`.
1330
1434
  */
@@ -1355,6 +1459,8 @@ export interface CollectionConfig extends Cascade, WithPreview {
1355
1459
  description?: string;
1356
1460
  /**
1357
1461
  * Sets an icon to use alongside references to this collection.
1462
+ *
1463
+ * @default notes
1358
1464
  */
1359
1465
  icon?: Icon;
1360
1466
  /**
@@ -1450,11 +1556,13 @@ export interface Structure extends SchemaBase {
1450
1556
  /**
1451
1557
  * Defines whether options are shown to your editors in a select menu (select, default) or a modal
1452
1558
  * pop up window (modal) when adding a new item.
1559
+ *
1560
+ * @default select
1453
1561
  */
1454
1562
  style?: 'select' | 'modal';
1455
1563
  }
1456
1564
 
1457
- export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBase {
1565
+ export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBase, Cascade {
1458
1566
  /**
1459
1567
  * A unique reference value used when referring to this structure value from the Object input's
1460
1568
  * assigned_structures option.
@@ -1465,6 +1573,8 @@ export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBa
1465
1573
  * of a value within a structure cannot be inferred based on its id_key or matching fields, then
1466
1574
  * it will fall back to this item. If multiple items have default set to true, only the first item
1467
1575
  * will be used.
1576
+ *
1577
+ * @default false
1468
1578
  */
1469
1579
  default?: boolean;
1470
1580
  /**
@@ -1491,16 +1601,31 @@ export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBa
1491
1601
  groups?: ObjectInputGroup[];
1492
1602
  /**
1493
1603
  * Controls which order input groups and ungrouped inputs appear in.
1604
+ *
1605
+ * @default false
1494
1606
  */
1495
1607
  place_groups_below?: boolean;
1496
1608
  /**
1497
1609
  * Show nested objects as tabs. Requires all top-level keys to be objects.
1610
+ *
1611
+ * @default false
1498
1612
  */
1499
1613
  tabbed?: boolean;
1500
1614
  /**
1501
1615
  * The actual value used when items are added after selection.
1502
1616
  */
1503
1617
  value: unknown;
1618
+ /**
1619
+ * Provides short descriptive text for editors shown in the Data Editor for expanded values
1620
+ * matching this Structure value. Has no default. Supports a limited set of Markdown: links, bold,
1621
+ * italic, subscript, superscript, and inline code elements are allowed.
1622
+ */
1623
+ comment?: string;
1624
+ /**
1625
+ * Provides a custom link for documentation for editors shown in the Data Editor for expanded
1626
+ * values matching this Structure value. Has no default.
1627
+ */
1628
+ documentation?: Documentation;
1504
1629
  }
1505
1630
 
1506
1631
  export type SelectValues =
@@ -1561,7 +1686,7 @@ export interface CommitTemplate {
1561
1686
  */
1562
1687
  label?: string;
1563
1688
  /**
1564
- * Set the string for the commit template. This will only be used if template_path is not set.
1689
+ * Set the string for the commit template. This will only be used if `template_path` is not set.
1565
1690
  */
1566
1691
  template_string?: string;
1567
1692
  /**
@@ -1579,77 +1704,108 @@ export interface CommitTemplate {
1579
1704
  extra_data?: Record<string, string>;
1580
1705
  }
1581
1706
 
1582
- export type SsgKey =
1583
- | 'hugo'
1584
- | 'jekyll'
1585
- | 'eleventy'
1586
- | 'astro'
1587
- | 'lume'
1588
- | 'mkdocs'
1589
- | 'nextjs'
1590
- | 'sveltekit'
1591
- | 'bridgetown'
1592
- | 'docusaurus'
1593
- | 'gatsby'
1594
- | 'hexo'
1595
- | 'nuxtjs'
1596
- | 'sphinx'
1597
- | 'static'
1598
- | 'legacy'
1599
- | 'other';
1600
-
1601
1707
  /**
1602
1708
  * The base format for the configuration file.
1603
1709
  */
1604
- export interface Configuration extends Cascade, WithSnippets, WithPaths {
1710
+ export interface Configuration extends Cascade, WithPaths {
1605
1711
  /**
1606
- * Base path to your site source files, relative to the root folder.
1712
+ * This key defines the base path for your source files, relative to the root folder of your
1713
+ * repository. Unless you use a nested folder as the source for your Site you can leave this key
1714
+ * empty or set it to `/`.
1715
+ *
1716
+ * By default, this key is empty.
1717
+ *
1718
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#source
1607
1719
  */
1608
1720
  source?: string;
1609
1721
  /**
1610
1722
  * Definitions for your collections, which are the sets of content files for your site grouped by
1611
1723
  * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
1612
1724
  * that collection.
1725
+ *
1726
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_config
1613
1727
  */
1614
1728
  collections_config?: Record<string, CollectionConfig>;
1615
1729
  /**
1616
1730
  * Defines which collections are shown in the site navigation and how those collections are
1617
1731
  * grouped.
1732
+ *
1733
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_groups
1618
1734
  */
1619
1735
  collection_groups?: CollectionGroup[];
1620
1736
  /**
1621
1737
  * The subpath where your output files are hosted.
1738
+ *
1739
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#base_url
1622
1740
  */
1623
1741
  base_url?: string;
1624
1742
  /**
1625
1743
  * Controls what data sets are available to populate select and multiselect inputs.
1744
+ *
1745
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#data_config
1626
1746
  */
1627
1747
  data_config?: Record<string, DataConfigEntry>;
1628
1748
  /**
1629
1749
  * Provides scope to configure at a file level, without adding configuration to files.
1750
+ *
1751
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#file_config
1630
1752
  */
1631
- file_config?: Record<string, FileConfigEntry>;
1753
+ file_config?: FileConfigEntry[];
1632
1754
  /**
1633
1755
  * Contains settings for the default editor actions on your site.
1756
+ *
1757
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#editor.default_path
1634
1758
  */
1635
1759
  editor?: Editor;
1636
1760
  /**
1637
1761
  * Settings for the behavior and appearance of the Source Editor.
1762
+ *
1763
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#source_editor
1638
1764
  */
1639
1765
  source_editor?: SourceEditor;
1640
1766
  /**
1641
1767
  * Templates for commit messages when saving changes.
1768
+ *
1769
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#commit_templates
1642
1770
  */
1643
1771
  commit_templates?: CommitTemplate[];
1644
1772
  /**
1645
1773
  * Contains settings for various Markdown engines.
1774
+ *
1775
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#markdown
1646
1776
  */
1647
1777
  markdown?: MarkdownSettings;
1648
1778
  /**
1649
1779
  * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
1650
1780
  * date is persisted to the file with.
1651
1781
  *
1782
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#timezone
1783
+ *
1652
1784
  * @default Etc/UTC
1653
1785
  */
1654
1786
  timezone?: Timezone;
1787
+ /**
1788
+ * Configuration for custom snippets.
1789
+ *
1790
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#_snippets
1791
+ */
1792
+ _snippets?: Record<string, SnippetConfig>;
1793
+ /**
1794
+ * Provides control over which snippets are available to use and/or extend within `_snippets`.
1795
+ *
1796
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#_snippets_imports
1797
+ */
1798
+ _snippets_imports?: SnippetsImports;
1799
+ /**
1800
+ * Extended option used when creating more complex custom snippets.
1801
+ *
1802
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#_snippets_templates
1803
+ */
1804
+ _snippets_templates?: Record<string, SnippetConfig>;
1805
+ /**
1806
+ * Extended option used when creating more complex custom snippets.
1807
+ *
1808
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#_snippets_definitions
1809
+ */
1810
+ _snippets_definitions?: Record<string, SnippetConfig>;
1655
1811
  }