@cloudcannon/configuration-types 0.0.46 → 0.0.48
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.
- package/dist/cloudcannon-collections.schema.json +41 -16
- package/dist/cloudcannon-config.documentation.schema.json +56 -16
- package/dist/cloudcannon-config.latest.schema.json +57 -17
- package/dist/cloudcannon-config.legacy-eleventy.schema.json +58 -17
- package/dist/cloudcannon-config.legacy-hugo.schema.json +59 -17
- package/dist/cloudcannon-config.legacy-jekyll.schema.json +58 -17
- package/dist/cloudcannon-config.legacy-reader.schema.json +57 -17
- package/dist/cloudcannon-editables.schema.json +1 -0
- package/dist/cloudcannon-inputs.schema.json +38 -16
- package/dist/cloudcannon-schemas.schema.json +38 -16
- package/dist/cloudcannon-snippets.schema.json +39 -17
- package/dist/cloudcannon-structure-value.schema.json +38 -16
- package/dist/cloudcannon-structures.schema.json +38 -16
- package/dist/documentation.json +10395 -1730
- package/package.json +1 -1
- package/src/build-coupled.ts +2 -2
- package/src/collections.ts +3 -3
- package/src/inputs.ts +10 -8
- package/src/markdown.ts +15 -15
- package/src/paths.ts +1 -0
- package/src/preview.ts +40 -28
- package/src/snippets.ts +2 -2
- package/src/structures.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcannon/configuration-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
|
|
6
6
|
"author": "CloudCannon <support@cloudcannon.com>",
|
package/src/build-coupled.ts
CHANGED
|
@@ -97,7 +97,7 @@ export const ReaderCollectionConfigSchema = z.object({
|
|
|
97
97
|
|
|
98
98
|
export const HugoCollectionConfigSchema = z.object({
|
|
99
99
|
...BuildCoupledCollectionConfigSchema.shape,
|
|
100
|
-
parse_branch_index: z.boolean().optional().meta({
|
|
100
|
+
parse_branch_index: z.boolean().default(false).optional().meta({
|
|
101
101
|
description:
|
|
102
102
|
'Controls whether branch index files (e.g. `_index.md`) are assigned to this collection or not. The "pages" collection defaults this to true, and false otherwise.',
|
|
103
103
|
}),
|
|
@@ -105,7 +105,7 @@ export const HugoCollectionConfigSchema = z.object({
|
|
|
105
105
|
|
|
106
106
|
export const BuildCoupledConfigurationSchema = z.object({
|
|
107
107
|
...ConfigurationSchema.omit({ version: true }).shape,
|
|
108
|
-
collections_config_override: z.boolean().optional().meta({
|
|
108
|
+
collections_config_override: z.boolean().default(false).optional().meta({
|
|
109
109
|
id: 'collections_config_override',
|
|
110
110
|
description:
|
|
111
111
|
'Prevents CloudCannon from automatically discovering collections for supported SSGs if true. Defaults to false.',
|
package/src/collections.ts
CHANGED
|
@@ -211,15 +211,15 @@ export const CollectionConfigSchema = z
|
|
|
211
211
|
'This key defines the options available in the _+ Add_ button dropdown at the top right of your _Collection browser_.',
|
|
212
212
|
}),
|
|
213
213
|
create: CreateSchema.optional(),
|
|
214
|
-
disable_add: z.boolean().optional().meta({
|
|
214
|
+
disable_add: z.boolean().default(false).optional().meta({
|
|
215
215
|
description:
|
|
216
216
|
'This key toggles whether team members can use the _+ Add_ button in the top right of the _Collection browser_ to add files to a Collection.',
|
|
217
217
|
}),
|
|
218
|
-
disable_add_folder: z.boolean().optional().meta({
|
|
218
|
+
disable_add_folder: z.boolean().default(false).optional().meta({
|
|
219
219
|
description:
|
|
220
220
|
'This key toggles whether team members can use the _+ Add_ button in the top right of the _Collection browser_ to add subfolders to a Collection.',
|
|
221
221
|
}),
|
|
222
|
-
disable_file_actions: z.boolean().optional().meta({
|
|
222
|
+
disable_file_actions: z.boolean().default(false).optional().meta({
|
|
223
223
|
description:
|
|
224
224
|
'This key toggles whether team members can use the _+ Add_ button in the top right of the _Collection browser_ to add files to a Collection.',
|
|
225
225
|
}),
|
package/src/inputs.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IconSchema } from './icon.ts';
|
|
|
5
5
|
import { ImageOptionsSchema } from './image-options.ts';
|
|
6
6
|
import { MimeTypeSchema } from './mimetype.ts';
|
|
7
7
|
import { PathsSchema } from './paths.ts';
|
|
8
|
-
import { PreviewEntriesSchema, PreviewSchema } from './preview.ts';
|
|
8
|
+
import { PickerPreviewSchema, PreviewEntriesSchema, PreviewSchema } from './preview.ts';
|
|
9
9
|
import { SelectDataValuesSchema } from './select-values.ts';
|
|
10
10
|
import { SourceEditorSchema } from './source-editor.ts';
|
|
11
11
|
import { StructureReferenceSchema, StructureSchema } from './structures.ts';
|
|
@@ -102,23 +102,23 @@ const TextValidationSchema = z.object({
|
|
|
102
102
|
}),
|
|
103
103
|
pattern_flags: z
|
|
104
104
|
.object({
|
|
105
|
-
global: z.boolean().optional().meta({
|
|
105
|
+
global: z.boolean().default(false).optional().meta({
|
|
106
106
|
description: '`g` - Search globally.',
|
|
107
107
|
}),
|
|
108
|
-
ignore_case: z.boolean().optional().meta({
|
|
108
|
+
ignore_case: z.boolean().default(false).optional().meta({
|
|
109
109
|
description: '`i` - Case-insensitive.',
|
|
110
110
|
}),
|
|
111
|
-
multiline: z.boolean().optional().meta({
|
|
111
|
+
multiline: z.boolean().default(false).optional().meta({
|
|
112
112
|
description:
|
|
113
113
|
'`m` - `^` and `$` match the start and end of each line rather than the entire string.',
|
|
114
114
|
}),
|
|
115
|
-
dot_all: z.boolean().optional().meta({
|
|
115
|
+
dot_all: z.boolean().default(false).optional().meta({
|
|
116
116
|
description: '`s` - `.` matches newline characters.',
|
|
117
117
|
}),
|
|
118
|
-
unicode: z.boolean().optional().meta({
|
|
118
|
+
unicode: z.boolean().default(false).optional().meta({
|
|
119
119
|
description: '`u` - Pattern is treated as a sequence of Unicode code points.',
|
|
120
120
|
}),
|
|
121
|
-
unicode_sets: z.boolean().optional().meta({
|
|
121
|
+
unicode_sets: z.boolean().default(false).optional().meta({
|
|
122
122
|
description: '`v` - Extended `unicode` mode.',
|
|
123
123
|
}),
|
|
124
124
|
})
|
|
@@ -384,6 +384,8 @@ export const ColorInputOptionsSchema = z
|
|
|
384
384
|
description:
|
|
385
385
|
'Toggles showing a control for adjusting the transparency of the selected color. Defaults to using the naming convention, enabled if the input key ends with "a".',
|
|
386
386
|
}),
|
|
387
|
+
palette: z.array(z.string()).optional(),
|
|
388
|
+
hide_picker: z.boolean().default(false).optional(),
|
|
387
389
|
})
|
|
388
390
|
.meta({
|
|
389
391
|
description: 'Options that are specific to Color Inputs.',
|
|
@@ -687,7 +689,7 @@ export const UrlInputSchema = z
|
|
|
687
689
|
export const SharedSelectInputOptionsSchema = z.object({
|
|
688
690
|
...RequiredValidationSchema.shape,
|
|
689
691
|
preview: PreviewSchema.optional(),
|
|
690
|
-
picker_preview:
|
|
692
|
+
picker_preview: PickerPreviewSchema.optional(),
|
|
691
693
|
allow_create: z.boolean().default(false).optional().meta({
|
|
692
694
|
id: 'type._inputs.*.options.allow_create',
|
|
693
695
|
description: 'Allows new text values to be created at edit time.',
|
package/src/markdown.ts
CHANGED
|
@@ -26,19 +26,19 @@ export const MarkdownSettingsSchema = z
|
|
|
26
26
|
}),
|
|
27
27
|
options: z
|
|
28
28
|
.object({
|
|
29
|
-
html: z.boolean().optional().meta({
|
|
29
|
+
html: z.boolean().default(false).optional().meta({
|
|
30
30
|
description: 'Output HTML tags from source.',
|
|
31
31
|
}),
|
|
32
|
-
xhtml: z.boolean().optional().meta({
|
|
32
|
+
xhtml: z.boolean().default(false).optional().meta({
|
|
33
33
|
description: 'Use `/` to close single tags (e.g. `<br />`).',
|
|
34
34
|
}),
|
|
35
|
-
breaks: z.boolean().optional().meta({
|
|
35
|
+
breaks: z.boolean().default(false).optional().meta({
|
|
36
36
|
description: 'Convert `\\n` in paragraphs into `<br>`.',
|
|
37
37
|
}),
|
|
38
|
-
linkify: z.boolean().optional().meta({
|
|
38
|
+
linkify: z.boolean().default(false).optional().meta({
|
|
39
39
|
description: 'Autoconvert URL-like text to links.',
|
|
40
40
|
}),
|
|
41
|
-
typographer: z.boolean().optional().meta({
|
|
41
|
+
typographer: z.boolean().default(false).optional().meta({
|
|
42
42
|
description:
|
|
43
43
|
'Enable some language-neutral replacement, as well as quotes beautification.',
|
|
44
44
|
}),
|
|
@@ -46,10 +46,10 @@ export const MarkdownSettingsSchema = z
|
|
|
46
46
|
description:
|
|
47
47
|
'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`).',
|
|
48
48
|
}),
|
|
49
|
-
spaced_lists: z.boolean().optional().meta({
|
|
49
|
+
spaced_lists: z.boolean().default(false).optional().meta({
|
|
50
50
|
description: 'Output lists with an extra space in Markdown.',
|
|
51
51
|
}),
|
|
52
|
-
sentence_per_line: z.boolean().optional().meta({
|
|
52
|
+
sentence_per_line: z.boolean().default(false).optional().meta({
|
|
53
53
|
description: 'Add linebreaks between sentences in Markdown.',
|
|
54
54
|
}),
|
|
55
55
|
gfm: z.boolean().optional().meta({
|
|
@@ -58,28 +58,28 @@ export const MarkdownSettingsSchema = z
|
|
|
58
58
|
code_block_fences: z.enum(['```', '~~~']).optional().meta({
|
|
59
59
|
description: 'Determines which style of code block fences to use.',
|
|
60
60
|
}),
|
|
61
|
-
treat_indentation_as_code: z.boolean().optional().meta({
|
|
61
|
+
treat_indentation_as_code: z.boolean().default(false).optional().meta({
|
|
62
62
|
description: 'Determines whether 4 spaces on indentation should be read as a code block.',
|
|
63
63
|
}),
|
|
64
|
-
escape_snippets_in_code_blocks: z.boolean().optional().meta({
|
|
64
|
+
escape_snippets_in_code_blocks: z.boolean().default(false).optional().meta({
|
|
65
65
|
description: 'Render snippets as plain text within code blocks.',
|
|
66
66
|
}),
|
|
67
|
-
table: z.boolean().optional().meta({
|
|
67
|
+
table: z.boolean().default(false).optional().meta({
|
|
68
68
|
description: 'Output tables in Markdown format.',
|
|
69
69
|
}),
|
|
70
|
-
strikethrough: z.boolean().optional().meta({
|
|
70
|
+
strikethrough: z.boolean().default(false).optional().meta({
|
|
71
71
|
description: 'Output strikes in wrapped in double tildes (e.g. `~~strike~~`).',
|
|
72
72
|
}),
|
|
73
|
-
subscript: z.boolean().optional().meta({
|
|
73
|
+
subscript: z.boolean().default(false).optional().meta({
|
|
74
74
|
description: 'Output subscript in wrapped in tildes (e.g. `~sub~`).',
|
|
75
75
|
}),
|
|
76
|
-
superscript: z.boolean().optional().meta({
|
|
76
|
+
superscript: z.boolean().default(false).optional().meta({
|
|
77
77
|
description: 'Output superscript in wrapped in carets (e.g. `^super^`).',
|
|
78
78
|
}),
|
|
79
|
-
heading_ids: z.boolean().optional().meta({
|
|
79
|
+
heading_ids: z.boolean().default(false).optional().meta({
|
|
80
80
|
description: 'Generate IDs for headings.',
|
|
81
81
|
}),
|
|
82
|
-
attributes: z.boolean().optional().meta({
|
|
82
|
+
attributes: z.boolean().default(false).optional().meta({
|
|
83
83
|
description: 'Save element attributes in Markdown format instead of converting to HTML.',
|
|
84
84
|
}),
|
|
85
85
|
attribute_elements: MarkdownAttributeElementOptionsSchema.optional().meta({
|
package/src/paths.ts
CHANGED
package/src/preview.ts
CHANGED
|
@@ -51,28 +51,29 @@ export const PreviewEntriesSchema = z
|
|
|
51
51
|
])
|
|
52
52
|
.meta({ id: 'PreviewEntries' });
|
|
53
53
|
|
|
54
|
-
const
|
|
55
|
-
const
|
|
54
|
+
const PreviewTextSchema = PreviewEntriesSchema.optional().meta({ id: 'type.preview.text' });
|
|
55
|
+
const PreviewSubtextSchema = PreviewEntriesSchema.optional().meta({
|
|
56
56
|
id: 'type.preview.subtext',
|
|
57
57
|
});
|
|
58
|
-
const
|
|
58
|
+
const PreviewImageSchema = PreviewEntriesSchema.optional().meta({
|
|
59
59
|
id: 'type.preview.image',
|
|
60
60
|
});
|
|
61
|
-
const
|
|
62
|
-
const
|
|
61
|
+
const PreviewIconSchema = PreviewEntriesSchema.optional().meta({ id: 'type.preview.icon' });
|
|
62
|
+
const PreviewIconColorSchema = PreviewEntriesSchema.optional().meta({
|
|
63
63
|
id: 'type.preview.icon_color',
|
|
64
64
|
});
|
|
65
|
-
const
|
|
65
|
+
const PreviewIconBackgroundColorSchema = PreviewEntriesSchema.optional().meta({
|
|
66
66
|
id: 'type.preview.icon_background_color',
|
|
67
67
|
});
|
|
68
|
+
const TagsPreviewEntriesSchema = z.array(z.string()).optional().meta({ id: 'type.preview.tags' });
|
|
68
69
|
|
|
69
70
|
export const PreviewGallerySchema = z
|
|
70
71
|
.object({
|
|
71
|
-
text:
|
|
72
|
-
image:
|
|
73
|
-
icon:
|
|
74
|
-
icon_color:
|
|
75
|
-
icon_background_color:
|
|
72
|
+
text: PreviewTextSchema,
|
|
73
|
+
image: PreviewImageSchema,
|
|
74
|
+
icon: PreviewIconSchema,
|
|
75
|
+
icon_color: PreviewIconColorSchema,
|
|
76
|
+
icon_background_color: PreviewIconBackgroundColorSchema,
|
|
76
77
|
fit: z
|
|
77
78
|
.enum(['padded', 'cover', 'contain', 'cover-top'])
|
|
78
79
|
.default('padded')
|
|
@@ -82,33 +83,44 @@ export const PreviewGallerySchema = z
|
|
|
82
83
|
id: 'type.preview.gallery.background_color',
|
|
83
84
|
}),
|
|
84
85
|
})
|
|
85
|
-
.
|
|
86
|
+
.optional()
|
|
87
|
+
.meta({ id: 'type.preview.gallery' });
|
|
86
88
|
|
|
87
|
-
const
|
|
89
|
+
const MetadataPreviewEntrySchema = z
|
|
88
90
|
.object({
|
|
89
|
-
text:
|
|
90
|
-
image:
|
|
91
|
-
icon:
|
|
92
|
-
icon_color:
|
|
93
|
-
icon_background_color:
|
|
91
|
+
text: PreviewTextSchema,
|
|
92
|
+
image: PreviewImageSchema,
|
|
93
|
+
icon: PreviewIconSchema,
|
|
94
|
+
icon_color: PreviewIconColorSchema,
|
|
95
|
+
icon_background_color: PreviewIconBackgroundColorSchema,
|
|
94
96
|
})
|
|
95
97
|
.meta({ id: 'PreviewMetadataEntry' });
|
|
96
98
|
|
|
99
|
+
const PreviewMetadataSchema = z
|
|
100
|
+
.array(MetadataPreviewEntrySchema)
|
|
101
|
+
.optional()
|
|
102
|
+
.meta({ id: 'type.preview.metadata' });
|
|
103
|
+
|
|
97
104
|
export const PreviewSchema = z
|
|
98
105
|
.object({
|
|
99
|
-
text:
|
|
100
|
-
subtext:
|
|
101
|
-
image:
|
|
102
|
-
icon:
|
|
103
|
-
icon_color:
|
|
104
|
-
icon_background_color:
|
|
105
|
-
tags:
|
|
106
|
-
metadata:
|
|
107
|
-
gallery: PreviewGallerySchema
|
|
106
|
+
text: PreviewTextSchema,
|
|
107
|
+
subtext: PreviewSubtextSchema,
|
|
108
|
+
image: PreviewImageSchema,
|
|
109
|
+
icon: PreviewIconSchema,
|
|
110
|
+
icon_color: PreviewIconColorSchema,
|
|
111
|
+
icon_background_color: PreviewIconBackgroundColorSchema,
|
|
112
|
+
tags: TagsPreviewEntriesSchema,
|
|
113
|
+
metadata: PreviewMetadataSchema,
|
|
114
|
+
gallery: PreviewGallerySchema,
|
|
108
115
|
})
|
|
109
116
|
.meta({ id: 'type.preview', title: 'Preview' });
|
|
110
117
|
|
|
118
|
+
export const PickerPreviewSchema = PreviewSchema.meta({
|
|
119
|
+
id: 'type.picker_preview',
|
|
120
|
+
title: 'Picker Preview',
|
|
121
|
+
});
|
|
122
|
+
|
|
111
123
|
export type PreviewEntry = z.infer<typeof PreviewEntrySchema>;
|
|
112
124
|
export type PreviewEntries = z.infer<typeof PreviewEntriesSchema>;
|
|
113
|
-
export type PreviewGallery = z.infer<typeof PreviewGallerySchema
|
|
125
|
+
export type PreviewGallery = NonNullable<z.infer<typeof PreviewGallerySchema>>;
|
|
114
126
|
export type Preview = z.infer<typeof PreviewSchema>;
|
package/src/snippets.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { ReducedCascadeSchema } from './cascade.ts';
|
|
3
|
-
import { PreviewSchema } from './preview.ts';
|
|
3
|
+
import { PickerPreviewSchema, PreviewSchema } from './preview.ts';
|
|
4
4
|
|
|
5
5
|
export const ParserModelSchema = z
|
|
6
6
|
.object({
|
|
@@ -188,7 +188,7 @@ export const SnippetConfigSchema = z
|
|
|
188
188
|
.object({
|
|
189
189
|
...ReducedCascadeSchema.shape,
|
|
190
190
|
preview: PreviewSchema.optional(),
|
|
191
|
-
picker_preview:
|
|
191
|
+
picker_preview: PickerPreviewSchema.optional(),
|
|
192
192
|
})
|
|
193
193
|
.extend({
|
|
194
194
|
snippet: z.string().optional().meta({
|
package/src/structures.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as z from 'zod';
|
|
|
2
2
|
import { DocumentationSchema } from './documentation.ts';
|
|
3
3
|
import { IconSchema } from './icon.ts';
|
|
4
4
|
import { InputsFromGlobSchema, InputsSchema, ObjectInputGroupSchema } from './inputs.ts';
|
|
5
|
-
import { PreviewSchema } from './preview.ts';
|
|
5
|
+
import { PickerPreviewSchema, PreviewSchema } from './preview.ts';
|
|
6
6
|
import { SelectDataSchema } from './select-values.ts';
|
|
7
7
|
|
|
8
8
|
export const StructureReferenceSchema = z.string().meta({
|
|
@@ -35,7 +35,7 @@ export const StructuresFromGlobSchema = z.array(z.string()).meta({
|
|
|
35
35
|
|
|
36
36
|
export const StructureValueSchema = StructureBaseSchema.extend({
|
|
37
37
|
preview: PreviewSchema.optional(),
|
|
38
|
-
picker_preview:
|
|
38
|
+
picker_preview: PickerPreviewSchema.optional(),
|
|
39
39
|
|
|
40
40
|
// This is the ReducedCascadeSchema - can't seem to reuse it due to Zod's limitations.
|
|
41
41
|
get _inputs() {
|
|
@@ -87,7 +87,7 @@ export const StructureValueSchema = StructureBaseSchema.extend({
|
|
|
87
87
|
value: z.unknown().meta({
|
|
88
88
|
description: 'The actual value used when items are added after selection.',
|
|
89
89
|
}),
|
|
90
|
-
|
|
90
|
+
description: z.string().optional().meta({
|
|
91
91
|
description:
|
|
92
92
|
'Provides short descriptive text for editors shown in the Data Editor for expanded values matching this Structure value. Has no default. Supports a limited set of Markdown: links, bold, italic, subscript, superscript, and inline code elements are allowed.',
|
|
93
93
|
}),
|