@cloudcannon/configuration-types 0.0.19 → 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,42 @@ 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;
598
646
  /**
599
647
  * Options that are specific to this `type` of input.
600
648
  */
@@ -647,8 +695,6 @@ export interface BaseInput {
647
695
  /**
648
696
  * Specifies whether or not this input configuration should be merged with any matching, less
649
697
  * specific configuration.
650
- *
651
- * @default true
652
698
  */
653
699
  cascade?: boolean;
654
700
  }
@@ -684,6 +730,8 @@ export interface TextInput extends BaseInput {
684
730
  export interface TextareaInputOptions extends TextInputOptions {
685
731
  /**
686
732
  * Shows a character counter below the input if enabled.
733
+ *
734
+ * @default false
687
735
  */
688
736
  show_count?: boolean;
689
737
  }
@@ -773,9 +821,25 @@ export interface NumberInput extends BaseInput {
773
821
  }
774
822
 
775
823
  export interface RangeInputOptions extends NumberInputOptions {
776
- min: number;
777
- max: number;
778
- 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;
779
843
  }
780
844
 
781
845
  export interface RangeInput extends BaseInput {
@@ -799,10 +863,14 @@ export interface UrlInput extends BaseInput {
799
863
  export interface RichTextInputOptions extends WithEmptyTypeText, ImageResizeable, BlockEditable {
800
864
  /**
801
865
  * Shows or hides the resize handler to vertically resize the input.
866
+ *
867
+ * @default false
802
868
  */
803
869
  allow_resize?: boolean;
804
870
  /**
805
871
  * Defines the initial height of this input in pixels (px).
872
+ *
873
+ * @default 320
806
874
  */
807
875
  initial_height?: number;
808
876
  }
@@ -819,6 +887,8 @@ export interface DateInputOptions extends WithEmptyTypeText {
819
887
  /**
820
888
  * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
821
889
  * date is persisted to the file with. Defaults to the global `timezone`.
890
+ *
891
+ * @default Etc/UTC
822
892
  */
823
893
  timezone?: Timezone;
824
894
  }
@@ -826,16 +896,18 @@ export interface DateInputOptions extends WithEmptyTypeText {
826
896
  export interface DateInput extends BaseInput {
827
897
  type: 'date' | 'datetime';
828
898
  /**
829
- * Options that are specific to this `type` of input.
899
+ * Options that are specific to Date inputs.
830
900
  */
831
901
  options?: DateInputOptions;
832
902
  }
833
903
 
834
904
  export interface FileInputOptions extends WithEmptyTypeText, WithPaths {
835
905
  /**
836
- * 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.
837
909
  */
838
- accepts_mime_types?: MimeType[] | '*';
910
+ accepts_mime_types?: MimeType[] | string;
839
911
  /**
840
912
  * If you have one or more DAMs connected to your site, you can use this key to list which asset
841
913
  * sources can be uploaded to and selected from.
@@ -846,17 +918,17 @@ export interface FileInputOptions extends WithEmptyTypeText, WithPaths {
846
918
  export interface FileInput extends BaseInput {
847
919
  type: 'file' | 'document';
848
920
  /**
849
- * Options that are specific to this `type` of input.
921
+ * Options that are specific to File inputs.
850
922
  */
851
923
  options?: FileInputOptions;
852
924
  }
853
925
 
854
- export interface ImageInputOptions extends FileInputOptions, ImageResizeable {}
926
+ export type ImageInputOptions = FileInputOptions & ImageResizeable;
855
927
 
856
928
  export interface ImageInput extends BaseInput {
857
929
  type: 'image';
858
930
  /**
859
- * Options that are specific to this `type` of input.
931
+ * Options that are specific to Image inputs.
860
932
  */
861
933
  options?: ImageInputOptions;
862
934
  }
@@ -931,16 +1003,36 @@ export interface MultichoiceInput extends BaseInput {
931
1003
  }
932
1004
 
933
1005
  export interface ObjectInputGroup {
1006
+ /**
1007
+ * The main text for the group shown when collapsed or expanded.
1008
+ */
934
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
+ */
935
1014
  comment?: string;
1015
+ /**
1016
+ * Controls if this group is collapsed or expanded when first viewed.
1017
+ *
1018
+ * @default false
1019
+ */
936
1020
  collapsed?: boolean;
1021
+ /**
1022
+ * The keys of each input in this group.
1023
+ */
937
1024
  inputs?: string[];
1025
+ /**
1026
+ * Provides a custom link for documentation for editors shown above the collection file list.
1027
+ */
938
1028
  documentation?: Documentation;
939
1029
  }
940
1030
 
941
1031
  export interface ObjectInputOptions extends WithEmptyTypeObject, WithPreview {
942
1032
  /**
943
1033
  * Changes the appearance and behavior of the input.
1034
+ *
1035
+ * @default object
944
1036
  */
945
1037
  subtype?: 'object' | 'mutable' | 'tabbed';
946
1038
  /**
@@ -971,19 +1063,20 @@ export interface ObjectInputOptions extends WithEmptyTypeObject, WithPreview {
971
1063
  * itself.
972
1064
  */
973
1065
  structures?: string | Structure;
974
-
975
1066
  /**
976
1067
  * Allows you to group the inputs inside this object together without changing the data structure.
977
1068
  */
978
1069
  groups?: ObjectInputGroup[];
979
-
980
1070
  /**
981
1071
  * Controls which order input groups and ungrouped inputs appear in.
1072
+ *
1073
+ * @default false
982
1074
  */
983
1075
  place_groups_below?: boolean;
984
-
985
1076
  /**
986
1077
  * Controls whether or not labels on mutable object entries are formatted.
1078
+ *
1079
+ * @default false
987
1080
  */
988
1081
  allow_label_formatting?: boolean;
989
1082
  /**
@@ -1017,8 +1110,7 @@ export interface ArrayInput extends BaseInput {
1017
1110
  }
1018
1111
 
1019
1112
  export interface UnknownInput extends BaseInput {
1020
- type?: undefined | null;
1021
-
1113
+ type?: 'auto' | undefined;
1022
1114
  /**
1023
1115
  * Options that are specific to this `type` of input.
1024
1116
  */
@@ -1054,7 +1146,7 @@ export interface Paths {
1054
1146
  /**
1055
1147
  * Default location of newly uploaded site files.
1056
1148
  *
1057
- * @default 'uploads'
1149
+ * @default uploads
1058
1150
  */
1059
1151
  uploads?: string;
1060
1152
  /**
@@ -1063,8 +1155,6 @@ export interface Paths {
1063
1155
  uploads_filename?: string;
1064
1156
  /**
1065
1157
  * Default location of newly uploaded DAM files.
1066
- *
1067
- * @default ''
1068
1158
  */
1069
1159
  dam_uploads?: string;
1070
1160
  /**
@@ -1074,8 +1164,6 @@ export interface Paths {
1074
1164
  /**
1075
1165
  * Location of statically copied assets for DAM files. This prefix will be removed from the _DAM
1076
1166
  * Uploads_ path when CloudCannon outputs the URL of an asset.
1077
- *
1078
- * @default ''
1079
1167
  */
1080
1168
  dam_static?: string;
1081
1169
  /**
@@ -1096,6 +1184,8 @@ export interface Documentation {
1096
1184
  text?: string;
1097
1185
  /**
1098
1186
  * The icon displayed next to the link.
1187
+ *
1188
+ * @default auto_stories
1099
1189
  */
1100
1190
  icon?: Icon;
1101
1191
  }
@@ -1151,6 +1241,8 @@ export interface PreviewGallery
1151
1241
  WithIconColorPreview {
1152
1242
  /**
1153
1243
  * Controls how the gallery image is positioned within the gallery.
1244
+ *
1245
+ * @default padded
1154
1246
  */
1155
1247
  fit?: 'padded' | 'cover' | 'contain' | 'cover-top';
1156
1248
  }
@@ -1177,50 +1269,56 @@ export interface Preview
1177
1269
  gallery?: PreviewGallery;
1178
1270
  }
1179
1271
 
1180
- export interface AddOption {
1181
- /**
1182
- * The text displayed for the menu item. Defaults to using name from the matching schema if set.
1183
- */
1184
- name?: string;
1185
- /**
1186
- * The icon next to the text in the menu item. Defaults to using icon from the matching schema if
1187
- * set, then falls back to add.
1188
- */
1189
- icon?: Icon;
1190
- /**
1191
- * The editor to open the new file in. Defaults to an appropriate editor for new file's type if
1192
- * possible. If no default editor can be calculated, or the editor does not support the new file
1193
- * type, a warning is shown in place of the editor.
1194
- */
1195
- editor?: EditorKey;
1196
- /**
1197
- * Enforces a path for new files to be created in, regardless of path the user is currently
1198
- * navigated to within the collection file list. Relative to the path of the collection defined in
1199
- * collection. Defaults to the path within the collection the user is currently navigated to.
1200
- */
1201
- base_path?: string;
1202
- /**
1203
- * Sets which collection this action is creating a file in. This is used when matching the value
1204
- * for schema. Defaults to the containing collection these `add_options` are configured in.
1205
- */
1206
- collection?: string;
1207
- /**
1208
- * The schema that new files are created from with this action. This schema is not restricted to
1209
- * the containing collection, and is instead relative to the collection specified with collection.
1210
- * Defaults to default if schemas are configured for the collection.
1211
- */
1212
- schema?: string;
1213
- /**
1214
- * The path to a file used to populate the initial contents of a new file if no schemas are
1215
- * configured. We recommend using schemas, and this is ignored if a schema is available.
1216
- */
1217
- default_content_file?: string;
1218
- /**
1219
- * The link that opens when the option is clicked. Can either be an external or internal link. If
1220
- * internal, the link is relative to the current site.
1221
- */
1222
- href?: string;
1223
- }
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
+ };
1224
1322
 
1225
1323
  interface WithPreview {
1226
1324
  /**
@@ -1271,6 +1369,8 @@ export interface Schema extends Cascade, WithPreview, SchemaBase {
1271
1369
  /**
1272
1370
  * Displayed in the add menu when creating new files; also used as the icon for collection files
1273
1371
  * if no other preview is found. Defaults to notes.
1372
+ *
1373
+ * @default notes
1274
1374
  */
1275
1375
  icon?: Icon;
1276
1376
  /**
@@ -1326,9 +1426,9 @@ export interface Create extends ReducedCascade {
1326
1426
 
1327
1427
  export interface CollectionConfig extends Cascade, WithPreview {
1328
1428
  /**
1329
- * 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`.
1330
1430
  */
1331
- path?: string;
1431
+ path: string;
1332
1432
  /**
1333
1433
  * Glob pattern(s) to include or exclude files from this collection. It is relative to `path`.
1334
1434
  */
@@ -1359,6 +1459,8 @@ export interface CollectionConfig extends Cascade, WithPreview {
1359
1459
  description?: string;
1360
1460
  /**
1361
1461
  * Sets an icon to use alongside references to this collection.
1462
+ *
1463
+ * @default notes
1362
1464
  */
1363
1465
  icon?: Icon;
1364
1466
  /**
@@ -1454,11 +1556,13 @@ export interface Structure extends SchemaBase {
1454
1556
  /**
1455
1557
  * Defines whether options are shown to your editors in a select menu (select, default) or a modal
1456
1558
  * pop up window (modal) when adding a new item.
1559
+ *
1560
+ * @default select
1457
1561
  */
1458
1562
  style?: 'select' | 'modal';
1459
1563
  }
1460
1564
 
1461
- export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBase {
1565
+ export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBase, Cascade {
1462
1566
  /**
1463
1567
  * A unique reference value used when referring to this structure value from the Object input's
1464
1568
  * assigned_structures option.
@@ -1469,6 +1573,8 @@ export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBa
1469
1573
  * of a value within a structure cannot be inferred based on its id_key or matching fields, then
1470
1574
  * it will fall back to this item. If multiple items have default set to true, only the first item
1471
1575
  * will be used.
1576
+ *
1577
+ * @default false
1472
1578
  */
1473
1579
  default?: boolean;
1474
1580
  /**
@@ -1495,16 +1601,31 @@ export interface StructureValue extends WithPreview, WithPickerPreview, SchemaBa
1495
1601
  groups?: ObjectInputGroup[];
1496
1602
  /**
1497
1603
  * Controls which order input groups and ungrouped inputs appear in.
1604
+ *
1605
+ * @default false
1498
1606
  */
1499
1607
  place_groups_below?: boolean;
1500
1608
  /**
1501
1609
  * Show nested objects as tabs. Requires all top-level keys to be objects.
1610
+ *
1611
+ * @default false
1502
1612
  */
1503
1613
  tabbed?: boolean;
1504
1614
  /**
1505
1615
  * The actual value used when items are added after selection.
1506
1616
  */
1507
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;
1508
1629
  }
1509
1630
 
1510
1631
  export type SelectValues =
@@ -1565,7 +1686,7 @@ export interface CommitTemplate {
1565
1686
  */
1566
1687
  label?: string;
1567
1688
  /**
1568
- * 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.
1569
1690
  */
1570
1691
  template_string?: string;
1571
1692
  /**
@@ -1583,77 +1704,108 @@ export interface CommitTemplate {
1583
1704
  extra_data?: Record<string, string>;
1584
1705
  }
1585
1706
 
1586
- export type SsgKey =
1587
- | 'hugo'
1588
- | 'jekyll'
1589
- | 'eleventy'
1590
- | 'astro'
1591
- | 'lume'
1592
- | 'mkdocs'
1593
- | 'nextjs'
1594
- | 'sveltekit'
1595
- | 'bridgetown'
1596
- | 'docusaurus'
1597
- | 'gatsby'
1598
- | 'hexo'
1599
- | 'nuxtjs'
1600
- | 'sphinx'
1601
- | 'static'
1602
- | 'legacy'
1603
- | 'other';
1604
-
1605
1707
  /**
1606
1708
  * The base format for the configuration file.
1607
1709
  */
1608
- export interface Configuration extends Cascade, WithSnippets, WithPaths {
1710
+ export interface Configuration extends Cascade, WithPaths {
1609
1711
  /**
1610
- * 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
1611
1719
  */
1612
1720
  source?: string;
1613
1721
  /**
1614
1722
  * Definitions for your collections, which are the sets of content files for your site grouped by
1615
1723
  * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
1616
1724
  * that collection.
1725
+ *
1726
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_config
1617
1727
  */
1618
1728
  collections_config?: Record<string, CollectionConfig>;
1619
1729
  /**
1620
1730
  * Defines which collections are shown in the site navigation and how those collections are
1621
1731
  * grouped.
1732
+ *
1733
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_groups
1622
1734
  */
1623
1735
  collection_groups?: CollectionGroup[];
1624
1736
  /**
1625
1737
  * The subpath where your output files are hosted.
1738
+ *
1739
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#base_url
1626
1740
  */
1627
1741
  base_url?: string;
1628
1742
  /**
1629
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
1630
1746
  */
1631
1747
  data_config?: Record<string, DataConfigEntry>;
1632
1748
  /**
1633
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
1634
1752
  */
1635
- file_config?: Record<string, FileConfigEntry>;
1753
+ file_config?: FileConfigEntry[];
1636
1754
  /**
1637
1755
  * Contains settings for the default editor actions on your site.
1756
+ *
1757
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#editor.default_path
1638
1758
  */
1639
1759
  editor?: Editor;
1640
1760
  /**
1641
1761
  * Settings for the behavior and appearance of the Source Editor.
1762
+ *
1763
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#source_editor
1642
1764
  */
1643
1765
  source_editor?: SourceEditor;
1644
1766
  /**
1645
1767
  * Templates for commit messages when saving changes.
1768
+ *
1769
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#commit_templates
1646
1770
  */
1647
1771
  commit_templates?: CommitTemplate[];
1648
1772
  /**
1649
1773
  * Contains settings for various Markdown engines.
1774
+ *
1775
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#markdown
1650
1776
  */
1651
1777
  markdown?: MarkdownSettings;
1652
1778
  /**
1653
1779
  * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
1654
1780
  * date is persisted to the file with.
1655
1781
  *
1782
+ * https://cloudcannon.com/documentation/articles/configuration-file-reference/#timezone
1783
+ *
1656
1784
  * @default Etc/UTC
1657
1785
  */
1658
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>;
1659
1811
  }