@cloudcannon/configuration-types 0.0.8 → 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.
@@ -157,6 +157,16 @@
157
157
  },
158
158
  "type": "object"
159
159
  },
160
+ "AttributeListPosition": {
161
+ "enum": [
162
+ "none",
163
+ "right",
164
+ "space right",
165
+ "below",
166
+ "newline below"
167
+ ],
168
+ "type": "string"
169
+ },
160
170
  "BaseInput": {
161
171
  "additionalProperties": false,
162
172
  "properties": {
@@ -308,12 +318,6 @@
308
318
  "markdownDescription": "Enables a control to copy formatting from text to other text. Only applies to formatting from\n`bold`, `italic`, `underline`, `strike`, `subscript`, and `superscript`. Does not copy other\nstyles or formatting.",
309
319
  "type": "boolean"
310
320
  },
311
- "correct_orientation": {
312
- "default": true,
313
- "description": "Controls whether or not the JPEG headers defining how an image should be rotated before being displayed is baked into images prior to upload.",
314
- "markdownDescription": "Controls whether or not the JPEG headers defining how an image should be rotated before being\ndisplayed is baked into images prior to upload.",
315
- "type": "boolean"
316
- },
317
321
  "embed": {
318
322
  "description": "Enables a control to insert a region of raw HTML, including YouTube, Vimeo, Tweets, and other media. Embedded content is sanitized to mitigate XSS risks, which includes removing style tags. Embeds containing script tags are not loaded in the editor.",
319
323
  "markdownDescription": "Enables a control to insert a region of raw HTML, including YouTube, Vimeo, Tweets, and other\nmedia. Embedded content is sanitized to mitigate XSS risks, which includes removing style tags.\nEmbeds containing script tags are not loaded in the editor.",
@@ -380,7 +384,8 @@
380
384
  "description": "Sets the format images are converted to prior to upload. The extension of the file is updated to match. Defaults to keeping the mime type of the uploaded file.",
381
385
  "enum": [
382
386
  "image/jpeg",
383
- "image/png"
387
+ "image/png",
388
+ "image/webp"
384
389
  ],
385
390
  "markdownDescription": "Sets the format images are converted to prior to upload. The extension of the file is updated\nto match. Defaults to keeping the mime type of the uploaded file.",
386
391
  "type": "string"
@@ -1256,61 +1261,10 @@
1256
1261
  "markdownDescription": "Provides scope to configure at a file level, without adding configuration to files.",
1257
1262
  "type": "object"
1258
1263
  },
1259
- "generator": {
1260
- "additionalProperties": false,
1264
+ "markdown": {
1265
+ "$ref": "#/definitions/MarkdownSettings",
1261
1266
  "description": "Contains settings for various Markdown engines.",
1262
- "markdownDescription": "Contains settings for various Markdown engines.",
1263
- "properties": {
1264
- "metadata": {
1265
- "additionalProperties": false,
1266
- "description": "Settings for various Markdown engines.",
1267
- "markdownDescription": "Settings for various Markdown engines.",
1268
- "properties": {
1269
- "commonmark": {
1270
- "description": "Markdown options specific used when markdown is set to \"commonmark\".",
1271
- "markdownDescription": "Markdown options specific used when markdown is set to \"commonmark\".",
1272
- "type": "object"
1273
- },
1274
- "commonmarkghpages": {
1275
- "description": "Markdown options specific used when markdown is set to \"commonmarkghpages\".",
1276
- "markdownDescription": "Markdown options specific used when markdown is set to \"commonmarkghpages\".",
1277
- "type": "object"
1278
- },
1279
- "goldmark": {
1280
- "description": "Markdown options specific used when markdown is set to \"goldmark\".",
1281
- "markdownDescription": "Markdown options specific used when markdown is set to \"goldmark\".",
1282
- "type": "object"
1283
- },
1284
- "kramdown": {
1285
- "description": "Markdown options specific used when markdown is set to \"kramdown\".",
1286
- "markdownDescription": "Markdown options specific used when markdown is set to \"kramdown\".",
1287
- "type": "object"
1288
- },
1289
- "markdown": {
1290
- "description": "The Markdown engine used on your site.",
1291
- "enum": [
1292
- "kramdown",
1293
- "commonmark",
1294
- "commonmarkghpages",
1295
- "goldmark",
1296
- "markdown-it"
1297
- ],
1298
- "markdownDescription": "The Markdown engine used on your site.",
1299
- "type": "string"
1300
- },
1301
- "markdown-it": {
1302
- "description": "Markdown options specific used when markdown is set to \"markdown-it\".",
1303
- "markdownDescription": "Markdown options specific used when markdown is set to \"markdown-it\".",
1304
- "type": "object"
1305
- }
1306
- },
1307
- "required": [
1308
- "markdown"
1309
- ],
1310
- "type": "object"
1311
- }
1312
- },
1313
- "type": "object"
1267
+ "markdownDescription": "Contains settings for various Markdown engines."
1314
1268
  },
1315
1269
  "paths": {
1316
1270
  "$ref": "#/definitions/Paths",
@@ -3970,12 +3924,6 @@
3970
3924
  "markdownDescription": "If you have one or more DAMs connected to your site, you can use this key to list which asset\nsources can be uploaded to and selected from.",
3971
3925
  "type": "array"
3972
3926
  },
3973
- "correct_orientation": {
3974
- "default": true,
3975
- "description": "Controls whether or not the JPEG headers defining how an image should be rotated before being displayed is baked into images prior to upload.",
3976
- "markdownDescription": "Controls whether or not the JPEG headers defining how an image should be rotated before being\ndisplayed is baked into images prior to upload.",
3977
- "type": "boolean"
3978
- },
3979
3927
  "expandable": {
3980
3928
  "default": false,
3981
3929
  "description": "Controls whether or not images can be upscaled to fit the bounding box during resize prior to upload. Has no effect if files are not resized.",
@@ -3997,7 +3945,8 @@
3997
3945
  "description": "Sets the format images are converted to prior to upload. The extension of the file is updated to match. Defaults to keeping the mime type of the uploaded file.",
3998
3946
  "enum": [
3999
3947
  "image/jpeg",
4000
- "image/png"
3948
+ "image/png",
3949
+ "image/webp"
4001
3950
  ],
4002
3951
  "markdownDescription": "Sets the format images are converted to prior to upload. The extension of the file is updated\nto match. Defaults to keeping the mime type of the uploaded file.",
4003
3952
  "type": "string"
@@ -4165,12 +4114,6 @@
4165
4114
  "markdownDescription": "If you have one or more DAMs connected to your site, you can use this key to list which asset\nsources can be uploaded to and selected from.",
4166
4115
  "type": "array"
4167
4116
  },
4168
- "correct_orientation": {
4169
- "default": true,
4170
- "description": "Controls whether or not the JPEG headers defining how an image should be rotated before being displayed is baked into images prior to upload.",
4171
- "markdownDescription": "Controls whether or not the JPEG headers defining how an image should be rotated before being\ndisplayed is baked into images prior to upload.",
4172
- "type": "boolean"
4173
- },
4174
4117
  "empty_type": {
4175
4118
  "$ref": "#/definitions/EmptyTypeText",
4176
4119
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
@@ -4197,7 +4140,8 @@
4197
4140
  "description": "Sets the format images are converted to prior to upload. The extension of the file is updated to match. Defaults to keeping the mime type of the uploaded file.",
4198
4141
  "enum": [
4199
4142
  "image/jpeg",
4200
- "image/png"
4143
+ "image/png",
4144
+ "image/webp"
4201
4145
  ],
4202
4146
  "markdownDescription": "Sets the format images are converted to prior to upload. The extension of the file is updated\nto match. Defaults to keeping the mime type of the uploaded file.",
4203
4147
  "type": "string"
@@ -4368,6 +4312,164 @@
4368
4312
  },
4369
4313
  "type": "object"
4370
4314
  },
4315
+ "MarkdownAttributeElementOptions": {
4316
+ "additionalProperties": false,
4317
+ "properties": {
4318
+ "block": {
4319
+ "$ref": "#/definitions/AttributeListPosition"
4320
+ },
4321
+ "blockquote": {
4322
+ "$ref": "#/definitions/AttributeListPosition"
4323
+ },
4324
+ "img": {
4325
+ "$ref": "#/definitions/AttributeListPosition"
4326
+ },
4327
+ "inline": {
4328
+ "$ref": "#/definitions/AttributeListPosition"
4329
+ },
4330
+ "li": {
4331
+ "$ref": "#/definitions/AttributeListPosition"
4332
+ },
4333
+ "ol": {
4334
+ "$ref": "#/definitions/AttributeListPosition"
4335
+ },
4336
+ "table": {
4337
+ "$ref": "#/definitions/AttributeListPosition"
4338
+ },
4339
+ "td": {
4340
+ "$ref": "#/definitions/AttributeListPosition"
4341
+ },
4342
+ "tr": {
4343
+ "$ref": "#/definitions/AttributeListPosition"
4344
+ },
4345
+ "ul": {
4346
+ "$ref": "#/definitions/AttributeListPosition"
4347
+ }
4348
+ },
4349
+ "type": "object"
4350
+ },
4351
+ "MarkdownSettings": {
4352
+ "additionalProperties": false,
4353
+ "properties": {
4354
+ "engine": {
4355
+ "enum": [
4356
+ "commonmark",
4357
+ "kramdown"
4358
+ ],
4359
+ "type": "string"
4360
+ },
4361
+ "options": {
4362
+ "additionalProperties": false,
4363
+ "properties": {
4364
+ "attribute_elements": {
4365
+ "$ref": "#/definitions/MarkdownAttributeElementOptions",
4366
+ "description": "Define positioning behaviour of Markdown attributes for different elements.",
4367
+ "markdownDescription": "Define positioning behaviour of Markdown attributes for different elements."
4368
+ },
4369
+ "attributes": {
4370
+ "description": "Save element attributes in Markdown format instead of converting to HTML.",
4371
+ "markdownDescription": "Save element attributes in Markdown format instead of converting to HTML.",
4372
+ "type": "boolean"
4373
+ },
4374
+ "breaks": {
4375
+ "description": "Convert '\\n' in paragraphs into <br>.",
4376
+ "markdownDescription": "Convert '\\n' in paragraphs into <br>.",
4377
+ "type": "boolean"
4378
+ },
4379
+ "code_block_fences": {
4380
+ "description": "Determines which style of code block fences to use.",
4381
+ "enum": [
4382
+ "```",
4383
+ "~~~"
4384
+ ],
4385
+ "markdownDescription": "Determines which style of code block fences to use.",
4386
+ "type": "string"
4387
+ },
4388
+ "escape_snippets_in_code_blocks": {
4389
+ "description": "Render snippets as plain text within code blocks.",
4390
+ "markdownDescription": "Render snippets as plain text within code blocks.",
4391
+ "type": "boolean"
4392
+ },
4393
+ "gfm": {
4394
+ "description": "Enable GFM mode.",
4395
+ "markdownDescription": "Enable GFM mode.",
4396
+ "type": "boolean"
4397
+ },
4398
+ "heading_ids": {
4399
+ "description": "Generate IDs for headings",
4400
+ "markdownDescription": "Generate IDs for headings",
4401
+ "type": "boolean"
4402
+ },
4403
+ "html": {
4404
+ "description": "Output HTML tags from source.",
4405
+ "markdownDescription": "Output HTML tags from source.",
4406
+ "type": "boolean"
4407
+ },
4408
+ "linkify": {
4409
+ "description": "Autoconvert URL-like text to links.",
4410
+ "markdownDescription": "Autoconvert URL-like text to links.",
4411
+ "type": "boolean"
4412
+ },
4413
+ "quotes": {
4414
+ "description": "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).",
4415
+ "markdownDescription": "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).",
4416
+ "type": "string"
4417
+ },
4418
+ "sentence_per_line": {
4419
+ "description": "Add linebreaks between sentences in Markdown.",
4420
+ "markdownDescription": "Add linebreaks between sentences in Markdown.",
4421
+ "type": "boolean"
4422
+ },
4423
+ "spaced_lists": {
4424
+ "description": "Output lists with an extra space in Markdown.",
4425
+ "markdownDescription": "Output lists with an extra space in Markdown.",
4426
+ "type": "boolean"
4427
+ },
4428
+ "strikethrough": {
4429
+ "description": "Output strikes in wrapped in double tildes (e.g. ~~strike~~)",
4430
+ "markdownDescription": "Output strikes in wrapped in double tildes (e.g. ~~strike~~)",
4431
+ "type": "boolean"
4432
+ },
4433
+ "subscript": {
4434
+ "description": "Output subscript in wrapped in tildes (e.g. ~sub~)",
4435
+ "markdownDescription": "Output subscript in wrapped in tildes (e.g. ~sub~)",
4436
+ "type": "boolean"
4437
+ },
4438
+ "superscript": {
4439
+ "description": "Output superscript in wrapped in carets (e.g. ^super^)",
4440
+ "markdownDescription": "Output superscript in wrapped in carets (e.g. ^super^)",
4441
+ "type": "boolean"
4442
+ },
4443
+ "table": {
4444
+ "description": "Output tables in Markdown format.",
4445
+ "markdownDescription": "Output tables in Markdown format.",
4446
+ "type": "boolean"
4447
+ },
4448
+ "treat_indentation_as_code": {
4449
+ "description": "Determines whether 4 spaces on indentation should be read as a code block.",
4450
+ "markdownDescription": "Determines whether 4 spaces on indentation should be read as a code block.",
4451
+ "type": "boolean"
4452
+ },
4453
+ "typographer": {
4454
+ "description": "Enable some language-neutral replacement + quotes beautification.",
4455
+ "markdownDescription": "Enable some language-neutral replacement + quotes beautification.",
4456
+ "type": "boolean"
4457
+ },
4458
+ "xhtml": {
4459
+ "description": "Use '/' to close single tags (<br />).",
4460
+ "markdownDescription": "Use '/' to close single tags (<br />).",
4461
+ "type": "boolean"
4462
+ }
4463
+ },
4464
+ "type": "object"
4465
+ }
4466
+ },
4467
+ "required": [
4468
+ "engine",
4469
+ "options"
4470
+ ],
4471
+ "type": "object"
4472
+ },
4371
4473
  "MimeType": {
4372
4474
  "enum": [
4373
4475
  "x-world/x-3dmf",
@@ -5877,12 +5979,6 @@
5877
5979
  "markdownDescription": "Enables a control to copy formatting from text to other text. Only applies to formatting from\n`bold`, `italic`, `underline`, `strike`, `subscript`, and `superscript`. Does not copy other\nstyles or formatting.",
5878
5980
  "type": "boolean"
5879
5981
  },
5880
- "correct_orientation": {
5881
- "default": true,
5882
- "description": "Controls whether or not the JPEG headers defining how an image should be rotated before being displayed is baked into images prior to upload.",
5883
- "markdownDescription": "Controls whether or not the JPEG headers defining how an image should be rotated before being\ndisplayed is baked into images prior to upload.",
5884
- "type": "boolean"
5885
- },
5886
5982
  "embed": {
5887
5983
  "description": "Enables a control to insert a region of raw HTML, including YouTube, Vimeo, Tweets, and other media. Embedded content is sanitized to mitigate XSS risks, which includes removing style tags. Embeds containing script tags are not loaded in the editor.",
5888
5984
  "markdownDescription": "Enables a control to insert a region of raw HTML, including YouTube, Vimeo, Tweets, and other\nmedia. Embedded content is sanitized to mitigate XSS risks, which includes removing style tags.\nEmbeds containing script tags are not loaded in the editor.",
@@ -5959,7 +6055,8 @@
5959
6055
  "description": "Sets the format images are converted to prior to upload. The extension of the file is updated to match. Defaults to keeping the mime type of the uploaded file.",
5960
6056
  "enum": [
5961
6057
  "image/jpeg",
5962
- "image/png"
6058
+ "image/png",
6059
+ "image/webp"
5963
6060
  ],
5964
6061
  "markdownDescription": "Sets the format images are converted to prior to upload. The extension of the file is updated\nto match. Defaults to keeping the mime type of the uploaded file.",
5965
6062
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcannon/configuration-types",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
5
5
  "author": "CloudCannon <support@cloudcannon.com>",
6
6
  "license": "MIT",
@@ -9,6 +9,103 @@ 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 {
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
+ }
12
109
 
13
110
  // TODO: use SnippetConfig from @cloudcannon/scrap-booker when ParserConfig issue resolved.
14
111
  export interface SnippetConfig extends ReducedCascade, Previewable, PickerPreviewable {
@@ -121,14 +218,7 @@ interface ImageResizeable {
121
218
  * Sets the format images are converted to prior to upload. The extension of the file is updated
122
219
  * to match. Defaults to keeping the mime type of the uploaded file.
123
220
  */
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;
221
+ mime_type?: 'image/jpeg' | 'image/png' | 'image/webp';
132
222
  /**
133
223
  * Sets how uploaded image files are resized with a bounding box defined by width and height prior
134
224
  * to upload. Has no effect when selecting existing images, or if width and height are unset.
@@ -1493,37 +1583,7 @@ export interface Configuration extends Cascade, WithSnippets {
1493
1583
  /**
1494
1584
  * Contains settings for various Markdown engines.
1495
1585
  */
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
- };
1586
+ markdown?: MarkdownSettings;
1527
1587
  /**
1528
1588
  * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
1529
1589
  * date is persisted to the file with.