@cloudcannon/configuration-types 0.0.8 → 0.0.10

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,6 +9,94 @@ 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' | 'right-of-prefix';
13
+
14
+ export type MarkdownAttributeElementOptions = {
15
+ inline?: AttributeListPosition;
16
+ block?: AttributeListPosition;
17
+ } & Partial<Record<keyof HTMLElementTagNameMap, AttributeListPosition>>;
18
+
19
+ export interface MarkdownSettings {
20
+ engine: 'commonmark' | 'kramdown';
21
+ options: {
22
+ /**
23
+ * Output HTML tags from source.
24
+ */
25
+ html?: boolean;
26
+ /**
27
+ * Use '/' to close single tags (<br />).
28
+ */
29
+ xhtml?: boolean;
30
+ /**
31
+ * Convert '\n' in paragraphs into <br>.
32
+ */
33
+ breaks?: boolean;
34
+ /**
35
+ * Autoconvert URL-like text to links.
36
+ */
37
+ linkify?: boolean;
38
+ /**
39
+ * Enable some language-neutral replacement + quotes beautification.
40
+ */
41
+ typographer?: boolean;
42
+ /**
43
+ * 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).
44
+ */
45
+ quotes?: string;
46
+ /**
47
+ * Output lists with an extra space in Markdown.
48
+ */
49
+ spaced_lists?: boolean;
50
+ /**
51
+ * Add linebreaks between sentences in Markdown.
52
+ */
53
+ sentence_per_line?: boolean;
54
+ /**
55
+ * Enable GFM mode.
56
+ */
57
+ gfm?: boolean;
58
+ /**
59
+ * Determines which style of code block fences to use.
60
+ */
61
+ code_block_fences?: '```' | '~~~';
62
+ /**
63
+ * Determines whether 4 spaces on indentation should be read as a code block.
64
+ */
65
+ treat_indentation_as_code?: boolean;
66
+ /**
67
+ * Render snippets as plain text within code blocks.
68
+ */
69
+ escape_snippets_in_code_blocks?: boolean;
70
+ /**
71
+ * Output tables in Markdown format.
72
+ */
73
+ table?: boolean;
74
+ /**
75
+ * Output strikes in wrapped in double tildes (e.g. ~~strike~~)
76
+ */
77
+ strikethrough?: boolean;
78
+ /**
79
+ * Output subscript in wrapped in tildes (e.g. ~sub~)
80
+ */
81
+ subscript?: boolean;
82
+ /**
83
+ * Output superscript in wrapped in carets (e.g. ^super^)
84
+ */
85
+ superscript?: boolean;
86
+ /**
87
+ * Generate IDs for headings
88
+ */
89
+ heading_ids?: boolean;
90
+ /**
91
+ * Save element attributes in Markdown format instead of converting to HTML.
92
+ */
93
+ attributes?: boolean;
94
+ /**
95
+ * Define positioning behaviour of Markdown attributes for different elements.
96
+ */
97
+ attribute_elements?: MarkdownAttributeElementOptions;
98
+ }
99
+ }
12
100
 
13
101
  // TODO: use SnippetConfig from @cloudcannon/scrap-booker when ParserConfig issue resolved.
14
102
  export interface SnippetConfig extends ReducedCascade, Previewable, PickerPreviewable {
@@ -121,14 +209,7 @@ interface ImageResizeable {
121
209
  * Sets the format images are converted to prior to upload. The extension of the file is updated
122
210
  * to match. Defaults to keeping the mime type of the uploaded file.
123
211
  */
124
- mime_type?: 'image/jpeg' | 'image/png';
125
- /**
126
- * Controls whether or not the JPEG headers defining how an image should be rotated before being
127
- * displayed is baked into images prior to upload.
128
- *
129
- * @default true
130
- */
131
- correct_orientation?: boolean;
212
+ mime_type?: 'image/jpeg' | 'image/png' | 'image/webp';
132
213
  /**
133
214
  * Sets how uploaded image files are resized with a bounding box defined by width and height prior
134
215
  * to upload. Has no effect when selecting existing images, or if width and height are unset.
@@ -1493,37 +1574,7 @@ export interface Configuration extends Cascade, WithSnippets {
1493
1574
  /**
1494
1575
  * Contains settings for various Markdown engines.
1495
1576
  */
1496
- generator?: {
1497
- /**
1498
- * Settings for various Markdown engines.
1499
- */
1500
- metadata?: {
1501
- /**
1502
- * The Markdown engine used on your site.
1503
- */
1504
- markdown: 'kramdown' | 'commonmark' | 'commonmarkghpages' | 'goldmark' | 'markdown-it';
1505
- /**
1506
- * Markdown options specific used when markdown is set to "kramdown".
1507
- */
1508
- kramdown?: Record<string, any>;
1509
- /**
1510
- * Markdown options specific used when markdown is set to "commonmark".
1511
- */
1512
- commonmark?: Record<string, any>;
1513
- /**
1514
- * Markdown options specific used when markdown is set to "commonmarkghpages".
1515
- */
1516
- commonmarkghpages?: Record<string, any>;
1517
- /**
1518
- * Markdown options specific used when markdown is set to "goldmark".
1519
- */
1520
- goldmark?: Record<string, any>;
1521
- /**
1522
- * Markdown options specific used when markdown is set to "markdown-it".
1523
- */
1524
- 'markdown-it'?: Record<string, any>;
1525
- };
1526
- };
1577
+ markdown?: MarkdownSettings;
1527
1578
  /**
1528
1579
  * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
1529
1580
  * date is persisted to the file with.