@cloudcannon/configuration-types 0.0.9 → 0.0.11

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.
@@ -9,21 +9,18 @@ import type { Syntax } from './syntax';
9
9
  export type InstanceValue = 'UUID' | 'NOW';
10
10
  export type EditorKey = 'visual' | 'content' | 'data';
11
11
  export type SortOrder = 'ascending' | 'descending' | 'asc' | 'desc';
12
- export type AttributeListPosition = 'none' | 'right' | 'space right' | 'below' | 'newline below';
13
-
14
- export interface MarkdownAttributeElementOptions {
12
+ export type AttributeListPosition =
13
+ | 'none'
14
+ | 'right'
15
+ | 'space right'
16
+ | 'below'
17
+ | 'newline below'
18
+ | 'right-of-prefix';
19
+
20
+ export type MarkdownAttributeElementOptions = {
15
21
  inline?: AttributeListPosition;
16
22
  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
- }
23
+ } & Partial<Record<keyof HTMLElementTagNameMap, AttributeListPosition>>;
27
24
 
28
25
  export interface MarkdownSettings {
29
26
  engine: 'commonmark' | 'kramdown';
@@ -49,7 +46,9 @@ export interface MarkdownSettings {
49
46
  */
50
47
  typographer?: boolean;
51
48
  /**
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).
49
+ * Double + single quotes replacement pairs, when typographer enabled and smartquotes on. For
50
+ * example, you can use '«»„“' for Russian, '„“‚‘' for German, and ['«\xA0', '\xA0»', '‹\xA0',
51
+ * '\xA0›'] for French (including nbsp).
53
52
  */
54
53
  quotes?: string;
55
54
  /**
@@ -100,11 +99,11 @@ export interface MarkdownSettings {
100
99
  * Save element attributes in Markdown format instead of converting to HTML.
101
100
  */
102
101
  attributes?: boolean;
103
- /**
102
+ /**
104
103
  * Define positioning behaviour of Markdown attributes for different elements.
105
- */
104
+ */
106
105
  attribute_elements?: MarkdownAttributeElementOptions;
107
- }
106
+ };
108
107
  }
109
108
 
110
109
  // TODO: use SnippetConfig from @cloudcannon/scrap-booker when ParserConfig issue resolved.
@@ -397,20 +396,20 @@ export interface BlockEditable extends ImageResizeable, TextEditable {
397
396
  table?: boolean;
398
397
  }
399
398
 
400
- interface WithReducedPaths {
399
+ interface WithPaths {
401
400
  /**
402
401
  * Paths to where new asset files are uploaded to. They also set the default path when choosing
403
402
  * existing images, and linking to existing files. Each path is relative to global `source`.
404
403
  * Defaults to the global `paths`.
405
404
  */
406
- paths?: ReducedPaths;
405
+ paths?: Paths;
407
406
  }
408
407
 
409
- export interface ImageEditable extends ImageResizeable, WithReducedPaths {}
408
+ export interface ImageEditable extends ImageResizeable, WithPaths {}
410
409
 
411
- export interface LinkEditable extends WithReducedPaths {}
410
+ export interface LinkEditable extends WithPaths {}
412
411
 
413
- export interface TextEditable extends WithReducedPaths {
412
+ export interface TextEditable extends WithPaths {
414
413
  /**
415
414
  * Enables a control to set selected text to bold.
416
415
  */
@@ -729,7 +728,7 @@ export interface RangeInput extends BaseInput<RangeInputOptions> {
729
728
  type: 'range';
730
729
  }
731
730
 
732
- export interface UrlInputOptions extends BaseInputOptions, WithReducedPaths {}
731
+ export interface UrlInputOptions extends BaseInputOptions, WithPaths {}
733
732
 
734
733
  export interface UrlInput extends BaseInput<UrlInputOptions> {
735
734
  type: 'range';
@@ -762,7 +761,7 @@ export interface DateInput extends BaseInput<DateInputOptions> {
762
761
  type: 'date' | 'datetime';
763
762
  }
764
763
 
765
- export interface FileInputOptions extends BaseInputOptions, WithReducedPaths {
764
+ export interface FileInputOptions extends BaseInputOptions, WithPaths {
766
765
  /**
767
766
  * Restricts which file types are available to select or upload to this input.
768
767
  */
@@ -949,7 +948,7 @@ export type Input =
949
948
  | ObjectInput
950
949
  | ArrayInput;
951
950
 
952
- export interface ReducedPaths {
951
+ export interface Paths {
953
952
  /**
954
953
  * Location of assets that are statically copied to the output site. This prefix will be removed
955
954
  * from the _Uploads_ path when CloudCannon outputs the URL of an asset.
@@ -989,26 +988,6 @@ export interface ReducedPaths {
989
988
  uploads_use_relative_path?: boolean;
990
989
  }
991
990
 
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
991
  export interface Documentation {
1013
992
  /**
1014
993
  * The "href" value of the link.
@@ -1286,11 +1265,6 @@ export interface CollectionConfig extends Cascade, Previewable {
1286
1265
  * collection add menu and file context menu.
1287
1266
  */
1288
1267
  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
1268
  /**
1295
1269
  * Changes the options presented in the add menu in the collection file list. Defaults to an
1296
1270
  * automatically generated list from _Schemas_, or uses the first file in the collection if no
@@ -1440,14 +1414,7 @@ export type SelectValues =
1440
1414
  | Record<string, string>
1441
1415
  | Record<string, Record<string, any>>;
1442
1416
 
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 {
1417
+ export interface DataConfigEntry {
1451
1418
  /**
1452
1419
  * The path to a file or folder of files containing data.
1453
1420
  */
@@ -1532,19 +1499,14 @@ export type SsgKey =
1532
1499
  | 'nuxtjs'
1533
1500
  | 'sphinx'
1534
1501
  | 'static'
1535
- | 'other'
1536
1502
  | 'legacy'
1537
- | 'unknown';
1503
+ | 'other';
1538
1504
 
1539
- export interface Configuration extends Cascade, WithSnippets {
1505
+ export interface Configuration extends Cascade, WithSnippets, WithPaths {
1540
1506
  /**
1541
1507
  * Base path to your site source files, relative to the root folder.
1542
1508
  */
1543
1509
  source?: string;
1544
- /**
1545
- * Global paths to common folders.
1546
- */
1547
- paths?: Paths;
1548
1510
  /**
1549
1511
  * Definitions for your collections, which are the sets of content files for your site grouped by
1550
1512
  * folder. Entries are keyed by a chosen collection key, and contain configuration specific to