@cloudcannon/configuration-types 0.0.7 → 0.0.9

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.
@@ -0,0 +1,1594 @@
1
+ import Scrapbooker from '@cloudcannon/snippet-types';
2
+
3
+ import type { Icon } from './icon';
4
+ import type { Timezone } from './timezone';
5
+ import type { MimeType } from './mime-type';
6
+ import type { Theme } from './theme';
7
+ import type { Syntax } from './syntax';
8
+
9
+ export type InstanceValue = 'UUID' | 'NOW';
10
+ export type EditorKey = 'visual' | 'content' | 'data';
11
+ export type SortOrder = 'ascending' | 'descending' | 'asc' | 'desc';
12
+ export type AttributeListPosition = 'none' | 'right' | 'space right' | 'below' | 'newline below';
13
+
14
+ export interface MarkdownAttributeElementOptions {
15
+ inline?: AttributeListPosition;
16
+ block?: AttributeListPosition;
17
+ ul?: AttributeListPosition;
18
+ ol?: AttributeListPosition;
19
+ li?: AttributeListPosition;
20
+ table?: AttributeListPosition;
21
+ tr?: AttributeListPosition;
22
+ td?: AttributeListPosition;
23
+ blockquote?: AttributeListPosition;
24
+ img?: AttributeListPosition;
25
+
26
+ }
27
+
28
+ export interface MarkdownSettings {
29
+ engine: 'commonmark' | 'kramdown';
30
+ options: {
31
+ /**
32
+ * Output HTML tags from source.
33
+ */
34
+ html?: boolean;
35
+ /**
36
+ * Use '/' to close single tags (<br />).
37
+ */
38
+ xhtml?: boolean;
39
+ /**
40
+ * Convert '\n' in paragraphs into <br>.
41
+ */
42
+ breaks?: boolean;
43
+ /**
44
+ * Autoconvert URL-like text to links.
45
+ */
46
+ linkify?: boolean;
47
+ /**
48
+ * Enable some language-neutral replacement + quotes beautification.
49
+ */
50
+ typographer?: boolean;
51
+ /**
52
+ * Double + single quotes replacement pairs, when typographer enabled and smartquotes on. For example, you can use '«»„“' for Russian, '„“‚‘' for German, and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
53
+ */
54
+ quotes?: string;
55
+ /**
56
+ * Output lists with an extra space in Markdown.
57
+ */
58
+ spaced_lists?: boolean;
59
+ /**
60
+ * Add linebreaks between sentences in Markdown.
61
+ */
62
+ sentence_per_line?: boolean;
63
+ /**
64
+ * Enable GFM mode.
65
+ */
66
+ gfm?: boolean;
67
+ /**
68
+ * Determines which style of code block fences to use.
69
+ */
70
+ code_block_fences?: '```' | '~~~';
71
+ /**
72
+ * Determines whether 4 spaces on indentation should be read as a code block.
73
+ */
74
+ treat_indentation_as_code?: boolean;
75
+ /**
76
+ * Render snippets as plain text within code blocks.
77
+ */
78
+ escape_snippets_in_code_blocks?: boolean;
79
+ /**
80
+ * Output tables in Markdown format.
81
+ */
82
+ table?: boolean;
83
+ /**
84
+ * Output strikes in wrapped in double tildes (e.g. ~~strike~~)
85
+ */
86
+ strikethrough?: boolean;
87
+ /**
88
+ * Output subscript in wrapped in tildes (e.g. ~sub~)
89
+ */
90
+ subscript?: boolean;
91
+ /**
92
+ * Output superscript in wrapped in carets (e.g. ^super^)
93
+ */
94
+ superscript?: boolean;
95
+ /**
96
+ * Generate IDs for headings
97
+ */
98
+ heading_ids?: boolean;
99
+ /**
100
+ * Save element attributes in Markdown format instead of converting to HTML.
101
+ */
102
+ attributes?: boolean;
103
+ /**
104
+ * Define positioning behaviour of Markdown attributes for different elements.
105
+ */
106
+ attribute_elements?: MarkdownAttributeElementOptions;
107
+ }
108
+ }
109
+
110
+ // TODO: use SnippetConfig from @cloudcannon/scrap-booker when ParserConfig issue resolved.
111
+ export interface SnippetConfig extends ReducedCascade, Previewable, PickerPreviewable {
112
+ /**
113
+ * Name of the snippet.
114
+ */
115
+ snippet?: string;
116
+ /**
117
+ * The template that this snippet should inherit, out of the available Shortcode Templates.
118
+ */
119
+ template?: string;
120
+ /**
121
+ * Whether this snippet can appear inline (within a sentence). Defaults to false, which will treat
122
+ * this snippet as a block-level element in the content editor.
123
+ */
124
+ inline?: boolean;
125
+ /**
126
+ * Whether this snippet treats whitespace as-is or not.
127
+ */
128
+ strict_whitespace?: boolean;
129
+ /**
130
+ * The variables required for the selected template.
131
+ */
132
+ definitions?: Record<string, any>;
133
+ /**
134
+ * Alternate configurations for this snippet.
135
+ */
136
+ alternate_formats?: SnippetConfig[];
137
+ /**
138
+ * The parameters of this snippet.
139
+ */
140
+ params?: Record<string, any>; // TODO: use ParserConfig from @cloudcannon/scrap-booker.
141
+ }
142
+
143
+ interface SnippetsImport<T> {
144
+ /**
145
+ * The list of excluded snippets. If unset, all snippets are excluded unless defined in `include`.
146
+ */
147
+ exclude?: T[];
148
+ /**
149
+ * The list of included snippets. If unset, all snippets are included unless defined in `exclude`.
150
+ */
151
+ include?: T[];
152
+ }
153
+
154
+ export interface SnippetsImports {
155
+ /**
156
+ * Default snippets for Hugo SSG.
157
+ */
158
+ hugo?: boolean | SnippetsImport<keyof typeof Scrapbooker.defaults.hugo.snippets>;
159
+ /**
160
+ * Default snippets for Jekyll SSG.
161
+ */
162
+ jekyll?: boolean | SnippetsImport<keyof typeof Scrapbooker.defaults.jekyll.snippets>;
163
+ /**
164
+ * Default snippets for MDX-based content.
165
+ */
166
+ mdx?: boolean | SnippetsImport<keyof typeof Scrapbooker.defaults.mdx.snippets>;
167
+ /**
168
+ * Default snippets for Eleventy SSG Liquid files.
169
+ */
170
+ eleventy_liquid?:
171
+ | boolean
172
+ | SnippetsImport<keyof typeof Scrapbooker.defaults.eleventy_liquid.snippets>;
173
+ /**
174
+ * Default snippets for Eleventy SSG Nunjucks files.
175
+ */
176
+ eleventy_nunjucks?:
177
+ | boolean
178
+ | SnippetsImport<keyof typeof Scrapbooker.defaults.eleventy_nunjucks.snippets>;
179
+ /**
180
+ * Default snippets for Markdoc-based content.
181
+ */
182
+ markdoc?: boolean | SnippetsImport<keyof typeof Scrapbooker.defaults.markdoc.snippets>;
183
+ /**
184
+ * Default snippets for content using Python markdown extensions.
185
+ */
186
+ python_markdown_extensions?:
187
+ | boolean
188
+ | SnippetsImport<keyof typeof Scrapbooker.defaults.python_markdown_extensions.snippets>;
189
+ /**
190
+ * Default snippets for Docusaurus SSG.
191
+ */
192
+ docusaurus_mdx?:
193
+ | boolean
194
+ | SnippetsImport<keyof typeof Scrapbooker.defaults.docusaurus_mdx.snippets>;
195
+ }
196
+
197
+ interface WithSnippets {
198
+ /**
199
+ * Configuration for custom snippets.
200
+ */
201
+ _snippets?: Record<string, SnippetConfig>;
202
+ /**
203
+ * Provides control over which snippets are available to use and/or extend within `_snippets`.
204
+ */
205
+ _snippets_imports?: SnippetsImports;
206
+ /**
207
+ * Extended option used when creating more complex custom snippets.
208
+ */
209
+ _snippets_templates?: Record<string, SnippetConfig>;
210
+ /**
211
+ * Extended option used when creating more complex custom snippets.
212
+ */
213
+ _snippets_definitions?: Record<string, SnippetConfig>;
214
+ }
215
+
216
+ interface ImageResizeable {
217
+ /**
218
+ * Sets the format images are converted to prior to upload. The extension of the file is updated
219
+ * to match. Defaults to keeping the mime type of the uploaded file.
220
+ */
221
+ mime_type?: 'image/jpeg' | 'image/png' | 'image/webp';
222
+ /**
223
+ * Sets how uploaded image files are resized with a bounding box defined by width and height prior
224
+ * to upload. Has no effect when selecting existing images, or if width and height are unset.
225
+ *
226
+ * @default 'contain'
227
+ */
228
+ resize_style?: 'cover' | 'contain' | 'stretch' | 'crop';
229
+ /**
230
+ * Defines the width of the bounding box used in the image resizing process defined with
231
+ * resize_style.
232
+ */
233
+ width?: number;
234
+ /**
235
+ * Defines the height of the bounding box used in the image resizing process defined with
236
+ * resize_style.
237
+ */
238
+ height?: number;
239
+ /**
240
+ * Controls whether or not images can be upscaled to fit the bounding box during resize prior to
241
+ * upload. Has no effect if files are not resized.
242
+ *
243
+ * @default false
244
+ */
245
+ expandable?: boolean;
246
+ /**
247
+ * Instructs the editor to save `width` and `height` attributes on the image elements. This can
248
+ * prevent pop-in as a page loads.
249
+ *
250
+ * @default true
251
+ */
252
+ image_size_attributes?: boolean;
253
+ /**
254
+ * If you have one or more DAMs connected to your site, you can use this key to list which asset
255
+ * sources can be uploaded to and selected from.
256
+ */
257
+ allowed_sources?: string[];
258
+ /**
259
+ * Enable to skip the image resizing process configured for this input when selecting existing
260
+ * images.
261
+ *
262
+ * @default false
263
+ */
264
+ prevent_resize_existing_files?: boolean;
265
+ /**
266
+ * Definitions for creating additional images of different sizes when uploading or selecting
267
+ * existing files.
268
+ */
269
+ sizes?: {
270
+ /**
271
+ * A number suffixed with "x" (relative size) or "w" (fixed width) for setting the dimensions of
272
+ * the image (e.g. 2x, 3x, 100w, 360w).
273
+ */
274
+ size: string;
275
+ /**
276
+ * A reference to another input that is given the path to this additional image file.
277
+ */
278
+ target?: string;
279
+ }[];
280
+ }
281
+
282
+ export interface Editables {
283
+ /**
284
+ * Contains input options for the Content Editor.
285
+ */
286
+ content?: BlockEditable;
287
+ /**
288
+ * Contains input options for block Editable Regions.
289
+ */
290
+ block?: BlockEditable;
291
+ /**
292
+ * Contains input options for link Editable Regions.
293
+ */
294
+ link?: LinkEditable;
295
+ /**
296
+ * Contains input options for image Editable Regions.
297
+ */
298
+ image?: ImageEditable;
299
+ /**
300
+ * Contains input options for text Editable Regions.
301
+ */
302
+ text?: TextEditable;
303
+ }
304
+
305
+ export interface BlockEditable extends ImageResizeable, TextEditable {
306
+ /**
307
+ * Enables a control to wrap blocks of text in block quotes.
308
+ */
309
+ blockquote?: boolean;
310
+ /**
311
+ * Enables a control to insert an unordered list, or to convert selected blocks of text into a
312
+ * unordered list.
313
+ */
314
+ bulletedlist?: boolean;
315
+ /**
316
+ * Enables a control to center align text by toggling a class name for a block of text. The value
317
+ * is the class name the editor should add to align the text. The styles for this class need to be
318
+ * listed in the `styles` file to take effect outside of the input.
319
+ */
320
+ center?: string;
321
+ /**
322
+ * Enables a control to create an inline code element, containing any selected text.
323
+ */
324
+ code_inline?: boolean;
325
+ /**
326
+ * Enables a control to insert a code block.
327
+ */
328
+ code_block?: boolean;
329
+ /**
330
+ * Enables both block and inline code controls: `code_block` and `code_inline`.
331
+ */
332
+ code?: boolean;
333
+ /**
334
+ * Enables a control to insert a region of raw HTML, including YouTube, Vimeo, Tweets, and other
335
+ * media. Embedded content is sanitized to mitigate XSS risks, which includes removing style tags.
336
+ * Embeds containing script tags are not loaded in the editor.
337
+ */
338
+ embed?: boolean;
339
+ /**
340
+ * Enables a drop down menu for structured text. Has options for "p", "h1", "h2", "h3", "h4",
341
+ * "h5", "h6". Set as space separated options (e.g. "p h1 h2").
342
+ */
343
+ format?: string;
344
+ /**
345
+ * Enables a control to insert a horizontal rule.
346
+ */
347
+ horizontalrule?: boolean;
348
+ /**
349
+ * Enables a control to insert an image. The image can be uploaded, existing or an external link.
350
+ */
351
+ image?: boolean;
352
+ /**
353
+ * Enables a control to increase indentation for numbered and unordered lists.
354
+ */
355
+ indent?: boolean;
356
+ /**
357
+ * Enables a control to justify text by toggling a class name for a block of text. The value is
358
+ * the class name the editor should add to justify the text. The styles for this class need to be
359
+ * listed in the `styles` file to take effect outside of the input.
360
+ */
361
+ justify?: string;
362
+ /**
363
+ * Enables a control to left align text by toggling a class name for a block of text. The value is
364
+ * the class name the editor should add to align the text. The styles for this class need to be
365
+ * listed in the `styles` file to take effect outside of the input.
366
+ */
367
+ left?: string;
368
+ /**
369
+ * Enables a control to insert a numbered list, or to convert selected blocks of text into a
370
+ * numbered list.
371
+ */
372
+ numberedlist?: boolean;
373
+ /**
374
+ * Enables a control to reduce indentation for numbered and unordered lists.
375
+ */
376
+ outdent?: boolean;
377
+ /**
378
+ * Enables a control to right align text by toggling a class name for a block of text. The value
379
+ * is the class name the editor should add to align the text. The styles for this class need to be
380
+ * listed in the `styles` file to take effect outside of the input.
381
+ */
382
+ right?: string;
383
+ /**
384
+ * Enables a control to insert snippets, if any are available.
385
+ */
386
+ snippet?: boolean;
387
+ /**
388
+ * Enables a drop down menu for editors to style selected text or blocks or text. Styles are the
389
+ * combination of an element and class name. The value for this option is the path (either source
390
+ * or build output) to the CSS file containing the styles.
391
+ */
392
+ styles?: string;
393
+ /**
394
+ * Enables a control to insert a table. Further options for table cells are available in the
395
+ * context menu for cells within the editor.
396
+ */
397
+ table?: boolean;
398
+ }
399
+
400
+ interface WithReducedPaths {
401
+ /**
402
+ * Paths to where new asset files are uploaded to. They also set the default path when choosing
403
+ * existing images, and linking to existing files. Each path is relative to global `source`.
404
+ * Defaults to the global `paths`.
405
+ */
406
+ paths?: ReducedPaths;
407
+ }
408
+
409
+ export interface ImageEditable extends ImageResizeable, WithReducedPaths {}
410
+
411
+ export interface LinkEditable extends WithReducedPaths {}
412
+
413
+ export interface TextEditable extends WithReducedPaths {
414
+ /**
415
+ * Enables a control to set selected text to bold.
416
+ */
417
+ bold?: boolean;
418
+ /**
419
+ * Enables a control to copy formatting from text to other text. Only applies to formatting from
420
+ * `bold`, `italic`, `underline`, `strike`, `subscript`, and `superscript`. Does not copy other
421
+ * styles or formatting.
422
+ */
423
+ copyformatting?: boolean;
424
+ /**
425
+ * Enables a control to italicize selected text.
426
+ */
427
+ italic?: boolean;
428
+ /**
429
+ * Enables a control to create hyperlinks around selected text.
430
+ */
431
+ link?: boolean;
432
+ /**
433
+ * Enables a control to redo recent edits undone with undo. Redo is always enabled through
434
+ * standard OS-specific keyboard shortcuts.
435
+ */
436
+ redo?: boolean;
437
+ /**
438
+ * Enables the control to remove formatting from text. Applies to formatting from `bold`,
439
+ * `italic`, `underline`, `strike`, `subscript`, and `superscript`. Does not remove other styles
440
+ * or formatting.
441
+ */
442
+ removeformat?: boolean;
443
+ /**
444
+ * Enables a control to strike selected text.
445
+ */
446
+ strike?: boolean;
447
+ /**
448
+ * Enables a control to set selected text to subscript.
449
+ */
450
+ subscript?: boolean;
451
+ /**
452
+ * Enables a control to set selected text to superscript.
453
+ */
454
+ superscript?: boolean;
455
+ /**
456
+ * Enables a control to underline selected text.
457
+ */
458
+ underline?: boolean;
459
+ /**
460
+ * Enables a control to undo recent edits. Undo is always enabled through standard OS-specific
461
+ * keyboard shortcuts.
462
+ */
463
+ undo?: boolean;
464
+ /**
465
+ * Defines if the content should be stripped of "custom markup". It is recommended to have this
466
+ * option turned on once you have all of your rich text options configured. Having
467
+ * `allow_custom_markup` turned on disables this option. Defaults to false.
468
+ */
469
+ remove_custom_markup?: boolean;
470
+ /**
471
+ * Defines if the content can contain "custom markup". It is not recommended to have this option
472
+ * turned on. Defaults to true for non-content editable regions, false otherwise.
473
+ */
474
+ allow_custom_markup?: boolean;
475
+ }
476
+
477
+ export interface ReducedCascade {
478
+ /**
479
+ * Controls the behavior and appearance of your inputs in all data editing interfaces.
480
+ */
481
+ _inputs?: Record<string, Input>;
482
+ /**
483
+ * Fixed datasets that can be referenced by the _Values_ configuration for _Select_ and
484
+ * _Multiselect_ inputs.
485
+ */
486
+ _select_data?: Record<string, SelectValues>;
487
+ /**
488
+ * Structured values for editors adding new items to arrays and objects. Entries here can be
489
+ * referenced in the configuration for `array` or `object` inputs.
490
+ */
491
+ _structures?: Record<string, Structure>;
492
+ }
493
+
494
+ export interface Cascade extends ReducedCascade {
495
+ /**
496
+ * Set a preferred editor and/or disable the others. The first value sets which editor opens by
497
+ * default, and the following values specify which editors are accessible.
498
+ */
499
+ _enabled_editors?: EditorKey[];
500
+ /**
501
+ * Contains input options for Editable Regions and the Content Editor.
502
+ */
503
+ _editables?: Editables;
504
+ /**
505
+ * Now known as _structures.
506
+ *
507
+ * @deprecated Use _structures instead.
508
+ */
509
+ _array_structures?: Record<string, unknown>;
510
+ /**
511
+ * Now part of _inputs.*.comment.
512
+ *
513
+ * @deprecated Use _inputs instead.
514
+ */
515
+ _comments?: Record<string, string>;
516
+ /**
517
+ * Now part of _inputs.*.options.
518
+ *
519
+ * @deprecated Use _inputs instead.
520
+ */
521
+ _options?: Record<string, Record<string, unknown>>;
522
+ }
523
+
524
+ export type InputType =
525
+ | 'text'
526
+ | 'textarea'
527
+ | 'email'
528
+ | 'disabled'
529
+ | 'pinterest'
530
+ | 'facebook'
531
+ | 'twitter'
532
+ | 'github'
533
+ | 'instagram'
534
+ | 'code'
535
+ | 'checkbox'
536
+ | 'switch'
537
+ | 'color'
538
+ | 'number'
539
+ | 'range'
540
+ | 'url'
541
+ | 'html'
542
+ | 'markdown'
543
+ | 'date'
544
+ | 'datetime'
545
+ | 'time'
546
+ | 'file'
547
+ | 'image'
548
+ | 'document'
549
+ | 'select'
550
+ | 'multiselect'
551
+ | 'choice'
552
+ | 'multichoice'
553
+ | 'object'
554
+ | 'array';
555
+
556
+ export type EmptyTypeText = 'null' | 'string';
557
+ export type EmptyTypeNumber = 'null' | 'number';
558
+ export type EmptyTypeArray = 'null' | 'array';
559
+ export type EmptyTypeObject = 'null' | 'object';
560
+
561
+ export interface BaseInputOptions<EmptyType = EmptyTypeText> {
562
+ /**
563
+ * Set how an ‘empty’ value will be saved. Does not apply to existing empty values.
564
+ */
565
+ empty_type?: EmptyType;
566
+ }
567
+
568
+ export interface BaseInput<InputOptions = BaseInputOptions> {
569
+ type?: InputType | undefined | null;
570
+ /**
571
+ * Changes the subtext below the _Label_. Has no default. Supports a limited set of Markdown:
572
+ * links, bold, italic, subscript, superscript, and inline code elements are allowed.
573
+ */
574
+ comment?: string;
575
+ /**
576
+ * Adds an expandable section of rich text below the input.
577
+ */
578
+ context?: {
579
+ /**
580
+ * The rich text content shown when opened. Supports a limited set of Markdown.
581
+ */
582
+ content?: string;
583
+ /**
584
+ * Makes the content visible initially.
585
+ */
586
+ open?: boolean;
587
+ /**
588
+ * The text shown when not open. Defaults to "Context" if unset.
589
+ */
590
+ title?: string;
591
+ /**
592
+ * The icon shown when not open.
593
+ */
594
+ icon?: Icon;
595
+ };
596
+ /**
597
+ * Provides a custom link for documentation for editors shown above input.
598
+ */
599
+ documentation?: Documentation;
600
+ /**
601
+ * Optionally changes the text above this input.
602
+ */
603
+ label?: string;
604
+ /**
605
+ * Toggles the visibility of this input.
606
+ *
607
+ * @default false
608
+ */
609
+ hidden?: boolean | string;
610
+ /**
611
+ * Controls if and how the value of this input is instantiated when created. This occurs when
612
+ * creating files, or adding array items containing the configured input.
613
+ */
614
+ instance_value?: InstanceValue;
615
+ /**
616
+ * Specifies whether or not this input configuration should be merged with any matching, less
617
+ * specific configuration.
618
+ *
619
+ * @default true
620
+ */
621
+ cascade?: boolean;
622
+ /**
623
+ * Options that are specific to this `type` of input.
624
+ */
625
+ options?: InputOptions;
626
+ }
627
+
628
+ export interface TextInputOptions extends BaseInputOptions {
629
+ /**
630
+ * Text shown when this input has no value.
631
+ */
632
+ placeholder?: string;
633
+ }
634
+
635
+ export interface TextInput extends BaseInput<TextInputOptions> {
636
+ type:
637
+ | 'text'
638
+ | 'email'
639
+ | 'disabled'
640
+ | 'pinterest'
641
+ | 'facebook'
642
+ | 'twitter'
643
+ | 'github'
644
+ | 'instagram';
645
+ }
646
+
647
+ export interface TextareaInputOptions extends TextInputOptions {
648
+ /**
649
+ * Shows a character counter below the input if enabled.
650
+ */
651
+ show_count?: boolean;
652
+ }
653
+
654
+ export interface TextareaInput extends BaseInput<TextareaInputOptions> {
655
+ type: 'textarea';
656
+ }
657
+
658
+ export interface CodeInputOptions extends BaseInputOptions, SourceEditor {
659
+ /**
660
+ * Sets the maximum number of visible lines for this input, effectively controlling maximum
661
+ * height. When the containing text exceeds this number, the input becomes a scroll area.
662
+ *
663
+ * @default 30
664
+ */
665
+ max_visible_lines?: number;
666
+ /**
667
+ * Sets the minimum number of visible lines for this input, effectively controlling initial
668
+ * height. When the containing text exceeds this number, the input grows line by line to the lines
669
+ * defined by `max_visible_lines`.
670
+ *
671
+ * @default 10
672
+ */
673
+ min_visible_lines?: number;
674
+ /**
675
+ * Changes how the editor parses your content for syntax highlighting. Should be set to the
676
+ * language of the code going into the input.
677
+ */
678
+ syntax?: Syntax;
679
+ }
680
+
681
+ export interface CodeInput extends BaseInput<CodeInputOptions> {
682
+ type: 'code';
683
+ }
684
+
685
+ export interface ColorInputOptions extends BaseInputOptions {
686
+ /**
687
+ * Sets what format the color value is saved as. Defaults to the naming convention, or HEX if that
688
+ * is unset.
689
+ */
690
+ format?: 'rgb' | 'hex' | 'hsl' | 'hsv';
691
+ /**
692
+ * Toggles showing a control for adjusting the transparency of the selected color. Defaults to
693
+ * using the naming convention, enabled if the input key ends with "a".
694
+ */
695
+ alpha?: boolean;
696
+ }
697
+
698
+ export interface ColorInput extends BaseInput<ColorInputOptions> {
699
+ type: 'color';
700
+ }
701
+
702
+ export interface NumberInputOptions extends BaseInputOptions<EmptyTypeNumber> {
703
+ /**
704
+ * The lowest value in the range of permitted values.
705
+ */
706
+ min?: number;
707
+ /**
708
+ * The greatest value in the range of permitted values.
709
+ */
710
+ max?: number;
711
+ /**
712
+ * A number that specifies the granularity that the value must adhere to, or the special value
713
+ * any, which allows any decimal value between `max` and `min`.
714
+ */
715
+ step?: number;
716
+ }
717
+
718
+ export interface NumberInput extends BaseInput<NumberInputOptions> {
719
+ type: 'number';
720
+ }
721
+
722
+ export interface RangeInputOptions extends NumberInputOptions {
723
+ min: number;
724
+ max: number;
725
+ step: number;
726
+ }
727
+
728
+ export interface RangeInput extends BaseInput<RangeInputOptions> {
729
+ type: 'range';
730
+ }
731
+
732
+ export interface UrlInputOptions extends BaseInputOptions, WithReducedPaths {}
733
+
734
+ export interface UrlInput extends BaseInput<UrlInputOptions> {
735
+ type: 'range';
736
+ }
737
+
738
+ export interface RichTextInputOptions extends BaseInputOptions, ImageResizeable, BlockEditable {
739
+ /**
740
+ * Shows or hides the resize handler to vertically resize the input.
741
+ */
742
+ allow_resize?: boolean;
743
+ /**
744
+ * Defines the initial height of this input in pixels (px).
745
+ */
746
+ initial_height?: number;
747
+ }
748
+
749
+ export interface RichTextInput extends BaseInput<RichTextInputOptions> {
750
+ type: 'html' | 'markdown';
751
+ }
752
+
753
+ export interface DateInputOptions extends BaseInputOptions {
754
+ /**
755
+ * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
756
+ * date is persisted to the file with. Defaults to the global `timezone`.
757
+ */
758
+ timezone?: Timezone;
759
+ }
760
+
761
+ export interface DateInput extends BaseInput<DateInputOptions> {
762
+ type: 'date' | 'datetime';
763
+ }
764
+
765
+ export interface FileInputOptions extends BaseInputOptions, WithReducedPaths {
766
+ /**
767
+ * Restricts which file types are available to select or upload to this input.
768
+ */
769
+ accepts_mime_types?: MimeType[] | '*';
770
+ /**
771
+ * If you have one or more DAMs connected to your site, you can use this key to list which asset
772
+ * sources can be uploaded to and selected from.
773
+ */
774
+ allowed_sources?: string[];
775
+ }
776
+
777
+ export interface FileInput extends BaseInput<FileInputOptions> {
778
+ type: 'file' | 'document';
779
+ }
780
+
781
+ export interface ImageInputOptions extends FileInputOptions, ImageResizeable {}
782
+
783
+ export interface ImageInput extends BaseInput<ImageInputOptions> {
784
+ type: 'image';
785
+ }
786
+
787
+ export interface SelectInputOptions<EmptyType = EmptyTypeText> extends BaseInputOptions<EmptyType> {
788
+ /**
789
+ * Allows new text values to be created at edit time.
790
+ *
791
+ * @default false
792
+ */
793
+ allow_create?: boolean;
794
+ /**
795
+ * Provides an empty option alongside the options provided by values.
796
+ *
797
+ * @default true
798
+ */
799
+ allow_empty?: boolean;
800
+ /**
801
+ * Defines the values available to choose from. Optional, defaults to fetching values from the
802
+ * naming convention (e.g. colors or my_colors for data set colors).
803
+ */
804
+ values?: SelectValues;
805
+ /**
806
+ * Defines the key used for mapping between saved values and objects in values. This changes how
807
+ * the input saves selected values to match. Defaults to checking for "id", "uuid", "path",
808
+ * "title", then "name". Has no effect unless values is an array of objects, the key is used
809
+ * instead for objects, and the value itself is used for primitive types.
810
+ */
811
+ value_key?: string;
812
+ }
813
+
814
+ export interface SelectInput extends BaseInput<SelectInputOptions> {
815
+ type: 'select';
816
+ }
817
+
818
+ export interface MultiselectInputOptions extends SelectInputOptions<EmptyTypeArray> {}
819
+
820
+ export interface MultiselectInput extends BaseInput<MultiselectInputOptions> {
821
+ type: 'multiselect';
822
+ }
823
+
824
+ export interface ChoiceInputOptions<EmptyType = EmptyTypeText>
825
+ extends Omit<SelectInputOptions<EmptyType>, 'allow_create'> {
826
+ /**
827
+ * The preview definition for changing the way selected and available options are displayed.
828
+ */
829
+ preview?: SelectPreview;
830
+ }
831
+
832
+ export interface ChoiceInput extends BaseInput<ChoiceInputOptions> {
833
+ type: 'choice';
834
+ }
835
+
836
+ export interface MultichoiceInputOptions extends ChoiceInputOptions<EmptyTypeArray> {}
837
+
838
+ export interface MultichoiceInput extends BaseInput<MultichoiceInputOptions> {
839
+ type: 'multichoice';
840
+ }
841
+
842
+ export interface ObjectInputGroup {
843
+ heading?: string;
844
+ comment?: string;
845
+ collapsed?: boolean;
846
+ inputs?: string[];
847
+ documentation?: Documentation;
848
+ }
849
+
850
+ export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject> {
851
+ /**
852
+ * Changes the appearance and behavior of the input.
853
+ */
854
+ subtype?: 'object' | 'mutable';
855
+ /**
856
+ * Contains options for the "mutable" subtype.
857
+ */
858
+ entries?: {
859
+ /**
860
+ * Defines a limited set of keys that can exist on the data within an object input. This set is
861
+ * used when entries are added and renamed with `allow_create` enabled. Has no effect if
862
+ * `allow_create` is not enabled.
863
+ */
864
+ allowed_keys?: string[];
865
+ /**
866
+ * Limits available structures to specified keys.
867
+ */
868
+ assigned_structures?: Record<string, string[]>;
869
+ /**
870
+ * Provides data formats when adding entries to the data within this object input. When adding
871
+ * an entry, team members are prompted to choose from a number of values you have defined. Has
872
+ * no effect if `allow_create` is false. `entries.structures` applies to the entries within the
873
+ * object.
874
+ */
875
+ structures?: string | Structure;
876
+ };
877
+ /**
878
+ * The preview definition for changing the way data within an object input is previewed before
879
+ * being expanded. If the input has `structures`, the preview from the structure value is used
880
+ * instead.
881
+ */
882
+ preview?: ObjectPreview;
883
+ /**
884
+ * Provides data formats for value of this object. When choosing an item, team members are
885
+ * prompted to choose from a number of values you have defined. `structures` applies to the object
886
+ * itself.
887
+ */
888
+ structures?: string | Structure;
889
+
890
+ /**
891
+ * Allows you to group the inputs inside this object together without changing the data structure.
892
+ */
893
+ groups?: ObjectInputGroup[];
894
+
895
+ /**
896
+ * Controls which order input groups and ungrouped inputs appear in.
897
+ */
898
+ place_groups_below?: boolean;
899
+
900
+ /**
901
+ * Controls whether or not labels on mutable object entries are formatted.
902
+ */
903
+ allow_label_formatting?: boolean;
904
+ }
905
+
906
+ export interface ObjectInput extends BaseInput<ObjectInputOptions> {
907
+ type: 'object';
908
+ }
909
+
910
+ export interface ArrayInputOptions extends BaseInputOptions<EmptyTypeArray> {
911
+ /**
912
+ * The preview definition for changing the way data within an array input's items are previewed
913
+ * before being expanded. If the input has structures, the preview from the structure value is
914
+ * used instead.
915
+ */
916
+ preview?: ObjectPreview;
917
+ /**
918
+ * Provides data formats for value of this object. When choosing an item, team members are
919
+ * prompted to choose from a number of values you have defined.
920
+ */
921
+ structures?: string | Structure;
922
+ }
923
+
924
+ export interface ArrayInput extends BaseInput<ArrayInputOptions> {
925
+ type: 'array';
926
+ }
927
+
928
+ export interface UnknownInput extends BaseInput<BaseInputOptions> {
929
+ type?: undefined | null;
930
+ }
931
+
932
+ export type Input =
933
+ | BaseInput
934
+ | UnknownInput
935
+ | TextInput
936
+ | CodeInput
937
+ | ColorInput
938
+ | NumberInput
939
+ | RangeInput
940
+ | UrlInput
941
+ | RichTextInput
942
+ | DateInput
943
+ | FileInput
944
+ | ImageInput
945
+ | SelectInput
946
+ | MultiselectInput
947
+ | ChoiceInput
948
+ | MultichoiceInput
949
+ | ObjectInput
950
+ | ArrayInput;
951
+
952
+ export interface ReducedPaths {
953
+ /**
954
+ * Location of assets that are statically copied to the output site. This prefix will be removed
955
+ * from the _Uploads_ path when CloudCannon outputs the URL of an asset.
956
+ */
957
+ static?: string;
958
+ /**
959
+ * Default location of newly uploaded site files.
960
+ *
961
+ * @default 'uploads'
962
+ */
963
+ uploads?: string;
964
+ /**
965
+ * Filename template for newly uploaded site files.
966
+ */
967
+ uploads_filename?: string;
968
+ /**
969
+ * Default location of newly uploaded DAM files.
970
+ *
971
+ * @default ''
972
+ */
973
+ dam_uploads?: string;
974
+ /**
975
+ * Filename template for newly uploaded DAM files.
976
+ */
977
+ dam_uploads_filename?: string;
978
+ /**
979
+ * Location of statically copied assets for DAM files. This prefix will be removed from the _DAM
980
+ * Uploads_ path when CloudCannon outputs the URL of an asset.
981
+ *
982
+ * @default ''
983
+ */
984
+ dam_static?: string;
985
+ /**
986
+ * When set to true, CloudCannon will reference files relative to the path of the file they were
987
+ * uploaded to.
988
+ */
989
+ uploads_use_relative_path?: boolean;
990
+ }
991
+
992
+ export interface Paths extends ReducedPaths {
993
+ /**
994
+ * Parent folder of all collections.
995
+ */
996
+ collections?: string;
997
+ /**
998
+ * Parent folder of all site data files.
999
+ */
1000
+ data?: string;
1001
+ /**
1002
+ * Parent folder of all site layout files. _Only applies to Jekyll, Hugo, and Eleventy sites_.
1003
+ */
1004
+ layouts?: string;
1005
+ /**
1006
+ * Parent folder of all includes, partials, or shortcode files. _Only applies to Jekyll, Hugo, and
1007
+ * Eleventy sites_.
1008
+ */
1009
+ includes?: string;
1010
+ }
1011
+
1012
+ export interface Documentation {
1013
+ /**
1014
+ * The "href" value of the link.
1015
+ */
1016
+ url: string;
1017
+ /**
1018
+ * The visible text used in the link.
1019
+ */
1020
+ text?: string;
1021
+ /**
1022
+ * The icon displayed next to the link.
1023
+ */
1024
+ icon?: Icon;
1025
+ }
1026
+
1027
+ interface PreviewKeyEntry {
1028
+ /**
1029
+ * The key used to access the value used for the preview.
1030
+ */
1031
+ key: string;
1032
+ }
1033
+
1034
+ type PreviewEntry = Array<PreviewKeyEntry | string | boolean> | string | boolean;
1035
+
1036
+ interface TextPreviewable {
1037
+ /**
1038
+ * Controls the main text shown per item.
1039
+ */
1040
+ text?: PreviewEntry;
1041
+ }
1042
+
1043
+ interface ImagePreviewable {
1044
+ /**
1045
+ * Controls the image shown per item.
1046
+ */
1047
+ image?: PreviewEntry;
1048
+ }
1049
+
1050
+ interface SubtextPreviewable {
1051
+ /**
1052
+ * Controls the supporting text shown per item.
1053
+ */
1054
+ subtext?: PreviewEntry;
1055
+ }
1056
+
1057
+ interface IconPreviewable {
1058
+ /**
1059
+ * Controls the icon shown per item. Must result in a Material Icon name.
1060
+ */
1061
+ icon?: PreviewEntry;
1062
+ }
1063
+
1064
+ interface IconColorPreviewable {
1065
+ /**
1066
+ * Controls the color of the icon.
1067
+ */
1068
+ icon_color?: string;
1069
+ }
1070
+
1071
+ export interface PreviewGallery
1072
+ extends TextPreviewable,
1073
+ ImagePreviewable,
1074
+ IconPreviewable,
1075
+ IconColorPreviewable {
1076
+ /**
1077
+ * Controls how the gallery image is positioned within the gallery.
1078
+ */
1079
+ fit?: 'padded' | 'cover' | 'contain' | 'cover-top';
1080
+ }
1081
+
1082
+ export interface PreviewMetadata
1083
+ extends TextPreviewable,
1084
+ ImagePreviewable,
1085
+ IconPreviewable,
1086
+ IconColorPreviewable {}
1087
+
1088
+ export interface ObjectPreview
1089
+ extends TextPreviewable,
1090
+ ImagePreviewable,
1091
+ IconPreviewable,
1092
+ SubtextPreviewable {}
1093
+
1094
+ export interface SelectPreview extends TextPreviewable, IconPreviewable {}
1095
+
1096
+ export interface Preview
1097
+ extends TextPreviewable,
1098
+ ImagePreviewable,
1099
+ IconPreviewable,
1100
+ IconColorPreviewable,
1101
+ SubtextPreviewable {
1102
+ /**
1103
+ * Defines a list of items that can contain an image, icon, and text.
1104
+ */
1105
+ metadata?: PreviewMetadata[];
1106
+ /**
1107
+ * Details for large image/icon preview per item.
1108
+ */
1109
+ gallery?: PreviewGallery;
1110
+ }
1111
+
1112
+ export interface AddOption {
1113
+ /**
1114
+ * The text displayed for the menu item. Defaults to using name from the matching schema if set.
1115
+ */
1116
+ name?: string;
1117
+ /**
1118
+ * The icon next to the text in the menu item. Defaults to using icon from the matching schema if
1119
+ * set, then falls back to add.
1120
+ */
1121
+ icon?: Icon;
1122
+ /**
1123
+ * The editor to open the new file in. Defaults to an appropriate editor for new file's type if
1124
+ * possible. If no default editor can be calculated, or the editor does not support the new file
1125
+ * type, a warning is shown in place of the editor.
1126
+ */
1127
+ editor?: EditorKey;
1128
+ /**
1129
+ * Enforces a path for new files to be created in, regardless of path the user is currently
1130
+ * navigated to within the collection file list. Relative to the path of the collection defined in
1131
+ * collection. Defaults to the path within the collection the user is currently navigated to.
1132
+ */
1133
+ base_path?: string;
1134
+ /**
1135
+ * Sets which collection this action is creating a file in. This is used when matching the value
1136
+ * for schema. Defaults to the containing collection these `add_options` are configured in.
1137
+ */
1138
+ collection?: string;
1139
+ /**
1140
+ * The schema that new files are created from with this action. This schema is not restricted to
1141
+ * the containing collection, and is instead relative to the collection specified with collection.
1142
+ * Defaults to default if schemas are configured for the collection.
1143
+ */
1144
+ schema?: string;
1145
+ /**
1146
+ * The path to a file used to populate the initial contents of a new file if no schemas are
1147
+ * configured. We recommend using schemas, and this is ignored if a schema is available.
1148
+ */
1149
+ default_content_file?: string;
1150
+ /**
1151
+ * The link that opens when the option is clicked. Can either be an external or internal link. If
1152
+ * internal, the link is relative to the current site.
1153
+ */
1154
+ href?: string;
1155
+ }
1156
+
1157
+ interface Previewable {
1158
+ /**
1159
+ * Changes the way items are previewed in the CMS.
1160
+ */
1161
+ preview?: Preview;
1162
+ }
1163
+
1164
+ interface PickerPreviewable {
1165
+ /**
1166
+ * Changes the way items are previewed in the CMS while being chosen.
1167
+ */
1168
+ picker_preview?: Preview;
1169
+ }
1170
+
1171
+ export interface Schema extends Cascade, Previewable, Schemalike {
1172
+ /**
1173
+ * The path to the schema file. Relative to the root folder of the site.
1174
+ */
1175
+ path: string;
1176
+ /**
1177
+ * Displayed in the add menu when creating new files. Defaults to a formatted version of the key.
1178
+ */
1179
+ name?: string;
1180
+ /**
1181
+ * Displayed in the add menu when creating new files; also used as the icon for collection files
1182
+ * if no other preview is found.
1183
+ *
1184
+ * @default 'notes'
1185
+ */
1186
+ icon?: Icon;
1187
+ /**
1188
+ * Controls where new files are saved.
1189
+ */
1190
+ create?: Create;
1191
+ /**
1192
+ * Preview your unbuilt pages (e.g. drafts) to another page's output URL. The Visual Editor will
1193
+ * load that URL, where Data Bindings and Previews are available to render your new page without
1194
+ * saving.
1195
+ */
1196
+ new_preview_url?: string;
1197
+ }
1198
+
1199
+ export interface Sort {
1200
+ /**
1201
+ * Defines what field contains the value to sort on inside each collection item's data.
1202
+ */
1203
+ key: string;
1204
+ /**
1205
+ * Controls which sort values come first.
1206
+ *
1207
+ * @default ascending
1208
+ */
1209
+ order?: SortOrder;
1210
+ }
1211
+
1212
+ export interface SortOption extends Sort {
1213
+ /**
1214
+ * The text to display in the sort option list. Defaults to a generated label from key and order.
1215
+ */
1216
+ label?: string;
1217
+ }
1218
+
1219
+ export interface Create extends ReducedCascade {
1220
+ /**
1221
+ * The raw template to be processed when creating files. Relative to the containing collection's
1222
+ * path.
1223
+ */
1224
+ path: string;
1225
+ /**
1226
+ * Adds to the available data placeholders coming from the file. Entry values follow the same
1227
+ * format as path, and are processed sequentially before path. These values are not saved back to
1228
+ * your file.
1229
+ */
1230
+ extra_data?: Record<string, string>;
1231
+ /**
1232
+ * Defines a target collection when publishing. When a file is published, the target collection's
1233
+ * create definition is used instead.
1234
+ */
1235
+ publish_to?: string;
1236
+ }
1237
+
1238
+ export interface CollectionConfig extends Cascade, Previewable {
1239
+ /**
1240
+ * The top-most folder where the files in this collection are stored. It is relative to source.
1241
+ */
1242
+ path?: string;
1243
+ /**
1244
+ * Glob pattern(s) to include or exclude files from this collection. It is relative to `path`.
1245
+ */
1246
+ glob?: string[] | string;
1247
+ /**
1248
+ * Whether or not files in this collection produce files in the build output.
1249
+ */
1250
+ output?: boolean;
1251
+ /**
1252
+ * Used to build the url field for items in the collection. Similar to permalink in many SSGs.
1253
+ * Defaults to ''
1254
+ */
1255
+ url?: string;
1256
+ /**
1257
+ * The display name of this collection. Used in headings and in the context menu for items in the
1258
+ * collection. This is optional as CloudCannon auto-generates this from the collection key.
1259
+ */
1260
+ name?: string;
1261
+ /**
1262
+ * Text or Markdown to show above the collection file list.
1263
+ */
1264
+ description?: string;
1265
+ /**
1266
+ * Sets an icon to use alongside references to this collection.
1267
+ */
1268
+ icon?: Icon;
1269
+ /**
1270
+ * Provides a custom link for documentation for editors shown above the collection file list.
1271
+ */
1272
+ documentation?: Documentation;
1273
+ /**
1274
+ * Sets the default sorting for the collection file list. Defaults to the first option in
1275
+ * sort_options, then falls back descending path. As an exception, defaults to descending date for
1276
+ * blog-like collections.
1277
+ */
1278
+ sort?: Sort;
1279
+ /**
1280
+ * Controls the available options in the sort menu. Defaults to generating the options from the
1281
+ * first item in the collection, falling back to ascending path and descending path.
1282
+ */
1283
+ sort_options?: SortOption[];
1284
+ /**
1285
+ * Overrides the default singular display name of the collection. This is displayed in the
1286
+ * collection add menu and file context menu.
1287
+ */
1288
+ singular_name?: string;
1289
+ /**
1290
+ * Overrides the default singular input key of the collection. This is used for naming conventions
1291
+ * for select and multiselect inputs.
1292
+ */
1293
+ singular_key?: string;
1294
+ /**
1295
+ * Changes the options presented in the add menu in the collection file list. Defaults to an
1296
+ * automatically generated list from _Schemas_, or uses the first file in the collection if no
1297
+ * schemas are configured.
1298
+ */
1299
+ add_options?: AddOption[];
1300
+ /**
1301
+ * The create path definition to control where new files are saved to inside this collection.
1302
+ * Defaults to [relative_base_path]/{title|slugify}.md.
1303
+ */
1304
+ create?: Create;
1305
+ /**
1306
+ * Prevents users from adding new files in the collection file list if true.
1307
+ */
1308
+ disable_add?: boolean;
1309
+ /**
1310
+ * Prevents users from adding new folders in the collection file list if true.
1311
+ */
1312
+ disable_add_folder?: boolean;
1313
+ /**
1314
+ * Prevents users from renaming, moving and deleting files in the collection file list if true.
1315
+ */
1316
+ disable_file_actions?: boolean;
1317
+ /**
1318
+ * Preview your unbuilt pages (e.g. drafts) to another page’s output URL. The Visual Editor will
1319
+ * load that set preview URL and use the Data Bindings and Previews to render your new page
1320
+ * without saving.
1321
+ *
1322
+ * For example new_preview_url: /about/ will load the /about/ URL on new or unbuilt pages in the
1323
+ * Visual Editor.
1324
+ */
1325
+ new_preview_url?: string;
1326
+ /**
1327
+ * The set of schemas for this collection. Schemas are used when creating and editing files in
1328
+ * this collection. Each entry corresponds to a schema that describes a data structure for this
1329
+ * collection.
1330
+ *
1331
+ * The keys in this object should match the values used for schema_key inside each of this
1332
+ * collection's files. default is a special entry and is used when a file has no schema.
1333
+ */
1334
+ schemas?: Record<string, Schema>;
1335
+ /**
1336
+ * The key used in each file to identify the schema that file uses. The value this key represents
1337
+ * in each of this collection's files should match the keys in schemas. Defaults to _schema.
1338
+ */
1339
+ schema_key?: string;
1340
+ }
1341
+
1342
+ export interface CollectionGroup {
1343
+ /**
1344
+ * Short, descriptive label for this group of collections.
1345
+ */
1346
+ heading: string;
1347
+ /**
1348
+ * The collections shown in the sidebar for this group. Collections here are referenced by their
1349
+ * key within `collections_config`.
1350
+ */
1351
+ collections: string[];
1352
+ }
1353
+
1354
+ interface Schemalike {
1355
+ /**
1356
+ * If true, inputs are sorted to match when editing. Extra inputs are ordered after expected
1357
+ * inputs, unless `remove_extra_inputs` is true.
1358
+ *
1359
+ * @default true
1360
+ */
1361
+ reorder_inputs?: boolean;
1362
+ /**
1363
+ * Hides unexpected inputs when editing. Has no effect if `remove_extra_inputs` is true.
1364
+ *
1365
+ * @default false
1366
+ */
1367
+ hide_extra_inputs?: boolean;
1368
+ /**
1369
+ * If checked, empty inputs are removed from the source file on save. Removed inputs will be
1370
+ * available for editing again, provided they are in the matching schema/structure.
1371
+ *
1372
+ * @default false
1373
+ */
1374
+ remove_empty_inputs?: boolean;
1375
+ /**
1376
+ * If checked, extra inputs are removed when editing.
1377
+ *
1378
+ * @default true
1379
+ */
1380
+ remove_extra_inputs?: boolean;
1381
+ }
1382
+
1383
+ export interface Structure extends Schemalike {
1384
+ /**
1385
+ * Defines what values are available to add when using this structure.
1386
+ */
1387
+ values: StructureValue[];
1388
+ /**
1389
+ * Defines what key should be used to detect which structure an item is. If this key is not found
1390
+ * in the existing structure, a comparison of key names is used. Defaults to "_type".
1391
+ */
1392
+ id_key?: string;
1393
+ /**
1394
+ * Defines whether options are shown to your editors in a select menu (select, default) or a modal
1395
+ * pop up window (modal) when adding a new item.
1396
+ */
1397
+ style?: 'select' | 'modal';
1398
+ }
1399
+
1400
+ export interface StructureValue extends Previewable, PickerPreviewable, Schemalike {
1401
+ /**
1402
+ * A unique reference value used when referring to this structure value from the Object input's
1403
+ * assigned_structures option.
1404
+ */
1405
+ id?: string;
1406
+ /**
1407
+ * If set to true, this item will be considered the default type for this structure. If the type
1408
+ * of a value within a structure cannot be inferred based on its id_key or matching fields, then
1409
+ * it will fall back to this item. If multiple items have default set to true, only the first item
1410
+ * will be used.
1411
+ */
1412
+ default?: boolean;
1413
+ /**
1414
+ * An icon used when displaying the structure (defaults to either format_list_bulleted for items
1415
+ * in arrays, or notes otherwise).
1416
+ */
1417
+ icon?: Icon;
1418
+ /**
1419
+ * Path to an image in your source files used when displaying the structure. Can be either a
1420
+ * source (has priority) or output path.
1421
+ */
1422
+ image?: string;
1423
+ /**
1424
+ * Used as the main text in the interface for this value.
1425
+ */
1426
+ label?: string;
1427
+ /**
1428
+ * Used to group and filter items when selecting from a modal.
1429
+ */
1430
+ tags?: string[];
1431
+ /**
1432
+ * The actual value used when items are added after selection.
1433
+ */
1434
+ value: any;
1435
+ }
1436
+
1437
+ export type SelectValues =
1438
+ | string
1439
+ | string[]
1440
+ | Record<string, string>
1441
+ | Record<string, Record<string, any>>;
1442
+
1443
+ export interface Parseable {
1444
+ /**
1445
+ * Overrides the format files are read. Detected automatically from file extension if unset.
1446
+ */
1447
+ parser?: 'csv' | 'front-matter' | 'json' | 'properties' | 'toml' | 'yaml';
1448
+ }
1449
+
1450
+ export interface DataConfigEntry extends Parseable {
1451
+ /**
1452
+ * The path to a file or folder of files containing data.
1453
+ */
1454
+ path: string;
1455
+ }
1456
+
1457
+ export interface FileConfigEntry extends Cascade {
1458
+ /**
1459
+ * The glob pattern(s) targeting a path to one or more files.
1460
+ */
1461
+ glob: string[] | string;
1462
+ }
1463
+
1464
+ export interface Editor {
1465
+ /**
1466
+ * The URL used for the dashboard screenshot, and where the editor opens to when clicking the
1467
+ * dashboard "Edit Home" button.
1468
+ *
1469
+ * @default /
1470
+ */
1471
+ default_path: string;
1472
+ }
1473
+
1474
+ export interface SourceEditor {
1475
+ /**
1476
+ * Defines how many spaces lines are auto indented by, and/or how many spaces tabs are shown as.
1477
+ *
1478
+ * @default 2
1479
+ */
1480
+ tab_size?: number;
1481
+ /**
1482
+ * Changes the color scheme for syntax highlighting in the editor.
1483
+ *
1484
+ * @default monokai
1485
+ */
1486
+ theme?: Theme;
1487
+ /**
1488
+ * Toggles displaying line numbers and code folding controls in the editor.
1489
+ *
1490
+ * @default true
1491
+ */
1492
+ show_gutter?: boolean;
1493
+ }
1494
+
1495
+ export interface CommitTemplate {
1496
+ /**
1497
+ * Used to identify a commit template when multiple commit templates are available.
1498
+ */
1499
+ label?: string;
1500
+ /**
1501
+ * Set the string for the commit template. This will only be used if template_path is not set.
1502
+ */
1503
+ template_string?: string;
1504
+ /**
1505
+ * Sets the path for a file containing your commit template. The file path should be relative to
1506
+ * the root directory.
1507
+ */
1508
+ template_path?: string;
1509
+ /**
1510
+ * Define inputs used to populate data placeholders in the commit template.
1511
+ */
1512
+ _inputs?: Record<string, Input>;
1513
+ /**
1514
+ * Define additional template strings, for building nested templates.
1515
+ */
1516
+ extra_data?: Record<string, string>;
1517
+ }
1518
+
1519
+ export type SsgKey =
1520
+ | 'hugo'
1521
+ | 'jekyll'
1522
+ | 'eleventy'
1523
+ | 'astro'
1524
+ | 'lume'
1525
+ | 'mkdocs'
1526
+ | 'nextjs'
1527
+ | 'sveltekit'
1528
+ | 'bridgetown'
1529
+ | 'docusaurus'
1530
+ | 'gatsby'
1531
+ | 'hexo'
1532
+ | 'nuxtjs'
1533
+ | 'sphinx'
1534
+ | 'static'
1535
+ | 'other'
1536
+ | 'legacy'
1537
+ | 'unknown';
1538
+
1539
+ export interface Configuration extends Cascade, WithSnippets {
1540
+ /**
1541
+ * Base path to your site source files, relative to the root folder.
1542
+ */
1543
+ source?: string;
1544
+ /**
1545
+ * Global paths to common folders.
1546
+ */
1547
+ paths?: Paths;
1548
+ /**
1549
+ * Definitions for your collections, which are the sets of content files for your site grouped by
1550
+ * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
1551
+ * that collection.
1552
+ */
1553
+ collections_config?: Record<string, CollectionConfig>;
1554
+ /**
1555
+ * Defines which collections are shown in the site navigation and how those collections are
1556
+ * grouped.
1557
+ */
1558
+ collection_groups?: CollectionGroup[];
1559
+ /**
1560
+ * The subpath where your output files are hosted.
1561
+ */
1562
+ base_url?: string;
1563
+ /**
1564
+ * Controls what data sets are available to populate select and multiselect inputs.
1565
+ */
1566
+ data_config?: Record<string, DataConfigEntry>;
1567
+ /**
1568
+ * Provides scope to configure at a file level, without adding configuration to files.
1569
+ */
1570
+ file_config?: Record<string, FileConfigEntry>;
1571
+ /**
1572
+ * Contains settings for the default editor actions on your site.
1573
+ */
1574
+ editor?: Editor;
1575
+ /**
1576
+ * Settings for the behavior and appearance of the Source Editor.
1577
+ */
1578
+ source_editor?: SourceEditor;
1579
+ /**
1580
+ * Templates for commit messages when saving changes.
1581
+ */
1582
+ commit_templates?: CommitTemplate[];
1583
+ /**
1584
+ * Contains settings for various Markdown engines.
1585
+ */
1586
+ markdown?: MarkdownSettings;
1587
+ /**
1588
+ * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
1589
+ * date is persisted to the file with.
1590
+ *
1591
+ * @default Etc/UTC
1592
+ */
1593
+ timezone?: Timezone;
1594
+ }