@cloudcannon/configuration-types 0.0.42 → 0.0.44
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 +9677 -0
- package/dist/cloudcannon-config.documentation.schema.json +11087 -0
- package/dist/cloudcannon-config.latest.schema.json +3640 -2288
- package/dist/cloudcannon-config.legacy-eleventy.schema.json +11018 -9663
- package/dist/cloudcannon-config.legacy-hugo.schema.json +3482 -2127
- package/dist/cloudcannon-config.legacy-jekyll.schema.json +11018 -9663
- package/dist/cloudcannon-config.legacy-reader.schema.json +6664 -5314
- package/dist/cloudcannon-editables.schema.json +767 -0
- package/dist/cloudcannon-inputs.schema.json +8713 -0
- package/dist/cloudcannon-schemas.schema.json +9341 -0
- package/dist/cloudcannon-snippets-definitions.schema.json +9 -0
- package/dist/cloudcannon-snippets-imports.schema.json +340 -0
- package/dist/cloudcannon-snippets.schema.json +9960 -0
- package/dist/cloudcannon-structure-value.schema.json +8715 -0
- package/dist/cloudcannon-structures.schema.json +8713 -0
- package/dist/documentation.json +59120 -0
- package/package.json +14 -12
- package/src/build-coupled.ts +3 -6
- package/src/cascade.ts +9 -6
- package/src/collections.ts +262 -0
- package/src/configuration.ts +53 -369
- package/src/documentation.ts +1 -1
- package/src/editables.ts +12 -2
- package/src/icon.ts +1 -1
- package/src/index.ts +17 -16
- package/src/inputs.ts +117 -50
- package/src/markdown.ts +69 -68
- package/src/paths.ts +11 -36
- package/src/preview.ts +51 -116
- package/src/select-values.ts +5 -8
- package/src/snippets.ts +218 -49
- package/src/source-editor.ts +25 -52
- package/src/structures.ts +17 -8
- package/src/syntax.ts +0 -103
- package/src/timezone.ts +1 -5
package/src/configuration.ts
CHANGED
|
@@ -1,309 +1,31 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { CascadeSchema
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { SnippetsImportsSchema } from './snippets';
|
|
11
|
-
import { SourceEditorSchema } from './source-editor';
|
|
12
|
-
import { TimezoneSchema } from './timezone';
|
|
2
|
+
import { CascadeSchema } from './cascade.ts';
|
|
3
|
+
import { CollectionConfigSchema, CollectionGroupSchema } from './collections.ts';
|
|
4
|
+
import { InputsSchema } from './inputs.ts';
|
|
5
|
+
import { MarkdownSettingsSchema } from './markdown.ts';
|
|
6
|
+
import { PathsSchema } from './paths.ts';
|
|
7
|
+
import { SnippetConfigSchema, SnippetsImportsSchema } from './snippets.ts';
|
|
8
|
+
import { SourceEditorSchema } from './source-editor.ts';
|
|
9
|
+
import { TimezoneSchema } from './timezone.ts';
|
|
13
10
|
|
|
14
|
-
export const
|
|
15
|
-
.object({
|
|
16
|
-
name: z.string().optional().meta({
|
|
17
|
-
description: 'The text displayed for the menu item.',
|
|
18
|
-
}),
|
|
19
|
-
icon: IconSchema.default('add').optional().meta({
|
|
20
|
-
description: 'The icon next to the text in the menu item.',
|
|
21
|
-
}),
|
|
22
|
-
href: z.string().meta({
|
|
23
|
-
description:
|
|
24
|
-
'The link that opens when the option is clicked. Can either be an external or internal link. If internal, the link is relative to the current site.',
|
|
25
|
-
}),
|
|
26
|
-
})
|
|
27
|
-
.meta({
|
|
28
|
-
title: 'HREF Add Option',
|
|
29
|
-
description: 'An option for the add menu that opens a link.',
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const AddOptionSchema = z
|
|
33
|
-
.object({
|
|
34
|
-
name: z.string().optional().meta({
|
|
35
|
-
description:
|
|
36
|
-
'The text displayed for the menu item. Defaults to using name from the matching schema if set.',
|
|
37
|
-
}),
|
|
38
|
-
icon: IconSchema.optional().meta({
|
|
39
|
-
description:
|
|
40
|
-
'The icon next to the text in the menu item. Defaults to using icon from the matching schema if set, then falls back to add.',
|
|
41
|
-
}),
|
|
42
|
-
editor: EditorKeySchema.optional().meta({
|
|
43
|
-
description:
|
|
44
|
-
"The editor to open the new file in. Defaults to an appropriate editor for new file's type if possible. If no default editor can be calculated, or the editor does not support the new file type, a warning is shown in place of the editor.",
|
|
45
|
-
}),
|
|
46
|
-
base_path: z.string().optional().meta({
|
|
47
|
-
description:
|
|
48
|
-
'Enforces a path for new files to be created in, regardless of path the user is currently navigated to within the collection file list. Relative to the path of the collection defined in collection. Defaults to the path within the collection the user is currently navigated to.',
|
|
49
|
-
}),
|
|
50
|
-
collection: z.string().optional().meta({
|
|
51
|
-
description:
|
|
52
|
-
'Sets which collection this action is creating a file in. This is used when matching the value for schema. Defaults to the containing collection these `add_options` are configured in.',
|
|
53
|
-
}),
|
|
54
|
-
schema: z.string().optional().meta({
|
|
55
|
-
description:
|
|
56
|
-
'The schema that new files are created from with this action. This schema is not restricted to the containing collection, and is instead relative to the collection specified with collection. Defaults to default if schemas are configured for the collection.',
|
|
57
|
-
}),
|
|
58
|
-
default_content_file: z.string().optional().meta({
|
|
59
|
-
description:
|
|
60
|
-
'The path to a file used to populate the initial contents of a new file if no schemas are configured. We recommend using schemas, and this is ignored if a schema is available.',
|
|
61
|
-
}),
|
|
62
|
-
})
|
|
63
|
-
.meta({
|
|
64
|
-
title: 'Add Option',
|
|
65
|
-
description: 'An option for the add menu.',
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
export const SortSchema = z
|
|
69
|
-
.object({
|
|
70
|
-
key: z.string().meta({
|
|
71
|
-
description:
|
|
72
|
-
"Defines what field contains the value to sort on inside each collection item's data.",
|
|
73
|
-
}),
|
|
74
|
-
order: z.enum(['ascending', 'descending', 'asc', 'desc']).default('ascending').optional().meta({
|
|
75
|
-
description: 'Controls which sort values come first.',
|
|
76
|
-
}),
|
|
77
|
-
})
|
|
78
|
-
.meta({
|
|
79
|
-
title: 'Sort',
|
|
80
|
-
description: 'A sort for a Collection.',
|
|
81
|
-
});
|
|
11
|
+
export const DataConfigEntrySchema = z.object({ path: z.string() }).meta({ id: 'DataConfigEntry' });
|
|
82
12
|
|
|
83
|
-
export const
|
|
84
|
-
.object({
|
|
85
|
-
...SortSchema.shape,
|
|
86
|
-
label: z.string().optional().meta({
|
|
87
|
-
description:
|
|
88
|
-
'The text to display in the sort option list. Defaults to a generated label from key and order.',
|
|
89
|
-
}),
|
|
90
|
-
})
|
|
91
|
-
.meta({
|
|
92
|
-
title: 'SortOption',
|
|
93
|
-
description: 'A sort option for a Collection.',
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
export const CreateSchema = z
|
|
97
|
-
.object({
|
|
98
|
-
...ReducedCascadeSchema.shape,
|
|
99
|
-
path: z.string().optional().meta({
|
|
100
|
-
description:
|
|
101
|
-
"The raw template to be processed when creating files. Relative to the containing collection's path.",
|
|
102
|
-
}),
|
|
103
|
-
extra_data: z.record(z.string(), z.string()).optional().meta({
|
|
104
|
-
description:
|
|
105
|
-
'Adds to the available data placeholders coming from the file. Entry values follow the same format as path, and are processed sequentially before path. These values are not saved back to your file.',
|
|
106
|
-
}),
|
|
107
|
-
publish_to: z.string().optional().meta({
|
|
108
|
-
description:
|
|
109
|
-
"Defines a target collection when publishing. When a file is published, the target collection's create definition is used instead.",
|
|
110
|
-
}),
|
|
111
|
-
})
|
|
112
|
-
.meta({
|
|
113
|
-
id: 'create',
|
|
114
|
-
title: 'Create',
|
|
115
|
-
description: 'Controls where new files are saved.',
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
export const SchemaSchema = z
|
|
119
|
-
.object({
|
|
120
|
-
...CascadeSchema.shape,
|
|
121
|
-
preview: PreviewSchema.optional(),
|
|
122
|
-
path: z.string().meta({
|
|
123
|
-
description: 'The path to the schema file. Relative to the root folder of the site.',
|
|
124
|
-
}),
|
|
125
|
-
name: z.string().optional().meta({
|
|
126
|
-
description:
|
|
127
|
-
'Displayed in the add menu when creating new files. Defaults to a formatted version of the key.',
|
|
128
|
-
}),
|
|
129
|
-
icon: IconSchema.default('notes').optional().meta({
|
|
130
|
-
description:
|
|
131
|
-
'Displayed in the add menu when creating new files; also used as the icon for collection files if no other preview is found. Defaults to notes.',
|
|
132
|
-
}),
|
|
133
|
-
create: CreateSchema.optional(),
|
|
134
|
-
new_preview_url: z.string().optional().meta({
|
|
135
|
-
description:
|
|
136
|
-
"Preview your unbuilt pages (e.g. drafts) to another page's output URL. The Visual Editor will load that URL, where Data Bindings and Previews are available to render your new page without saving.",
|
|
137
|
-
}),
|
|
138
|
-
reorder_inputs: z.boolean().default(true).optional().meta({
|
|
139
|
-
description:
|
|
140
|
-
'If true, inputs are sorted to match when editing. Extra inputs are ordered after expected inputs, unless `remove_extra_inputs` is true. Defaults to true.',
|
|
141
|
-
}),
|
|
142
|
-
hide_extra_inputs: z.boolean().default(false).optional().meta({
|
|
143
|
-
description:
|
|
144
|
-
'Hides unexpected inputs when editing. Has no effect if `remove_extra_inputs` is true. Defaults to false.',
|
|
145
|
-
}),
|
|
146
|
-
remove_empty_inputs: z.boolean().default(false).optional().meta({
|
|
147
|
-
description:
|
|
148
|
-
'If checked, empty inputs are removed from the source file on save. Removed inputs will be available for editing again, provided they are in the matching schema/structure. Defaults to false.',
|
|
149
|
-
}),
|
|
150
|
-
remove_extra_inputs: z.boolean().default(true).optional().meta({
|
|
151
|
-
description: 'If checked, extra inputs are removed when editing. Defaults to true.',
|
|
152
|
-
}),
|
|
153
|
-
})
|
|
154
|
-
.meta({
|
|
155
|
-
title: 'Schema',
|
|
156
|
-
description:
|
|
157
|
-
'Definitions for your schemas, which are the structured data formats for your content files.',
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
export const CollectionConfigSchema = z
|
|
13
|
+
export const FileConfigEntrySchema = z
|
|
161
14
|
.object({
|
|
162
|
-
...CascadeSchema.shape,
|
|
163
|
-
preview: PreviewSchema.optional(),
|
|
164
|
-
path: z.string().meta({
|
|
165
|
-
id: 'path',
|
|
166
|
-
description:
|
|
167
|
-
'This key defines the folder path for the collection key in which it is nested. The value for this key is relative to your Site `source`. Each Collection must have a unique path.',
|
|
168
|
-
}),
|
|
169
15
|
glob: z
|
|
170
|
-
.union([
|
|
171
|
-
|
|
16
|
+
.union([
|
|
17
|
+
z.array(z.string()).meta({ title: 'Glob Array' }),
|
|
18
|
+
z.string().meta({ title: 'Glob' }),
|
|
19
|
+
])
|
|
172
20
|
.meta({
|
|
173
|
-
|
|
174
|
-
description:
|
|
175
|
-
'This key defines globs which filter the files visible in the _Collection browser_ for a given Collection. Values in this array are relative to the Collection `path`.',
|
|
21
|
+
description: 'The glob pattern(s) targeting a path to one or more files.',
|
|
176
22
|
}),
|
|
177
|
-
url: z.string().optional().meta({
|
|
178
|
-
description:
|
|
179
|
-
'This key defines the output URL for files in a given Collection. CloudCannon uses the output URL in the Visual Editor, and when linking to your Testing Domain and Custom Domain.',
|
|
180
|
-
}),
|
|
181
|
-
disable_url: z.boolean().default(false).optional().meta({
|
|
182
|
-
description:
|
|
183
|
-
'This key toggles whether CloudCannon will generate an output URL for a given Collection.',
|
|
184
|
-
}),
|
|
185
|
-
include_developer_files: z.boolean().default(false).optional().meta({
|
|
186
|
-
description:
|
|
187
|
-
'This key toggles whether CloudCannon removes developer files from your _Collection browser_.',
|
|
188
|
-
}),
|
|
189
|
-
name: z.string().optional().meta({
|
|
190
|
-
description:
|
|
191
|
-
'This key defines the display name for a Collection. The name appears in the _Site Navigation_ and at the top of the _Collection browser_.',
|
|
192
|
-
}),
|
|
193
|
-
description: z.string().optional().meta({
|
|
194
|
-
description:
|
|
195
|
-
'This key defines the description text that appears on the _Collection browser_ page. Collection descriptions are useful for adding extra context for your team members.',
|
|
196
|
-
}),
|
|
197
|
-
icon: IconSchema.default('notes').optional().meta({
|
|
198
|
-
description:
|
|
199
|
-
'This key defines the icon for a Collection. Collection icons appear in the _Site Navigation_ and are the default icon for Collection file Cards if you have not defined `preview.icon`.',
|
|
200
|
-
}),
|
|
201
|
-
documentation: DocumentationSchema.optional().meta({
|
|
202
|
-
description:
|
|
203
|
-
'This key defines the documentation link at the top of a _Collection browser_. Collection documentation is useful for assisting your team members.',
|
|
204
|
-
}),
|
|
205
|
-
sort_options: z.array(SortOptionSchema).optional().meta({
|
|
206
|
-
description:
|
|
207
|
-
'This key defines the options for the Sort dropdown in a _Collection browser_. The first option listed is used as the default sort.',
|
|
208
|
-
}),
|
|
209
|
-
view_options: z
|
|
210
|
-
.array(z.enum(['card', 'list', 'gallery']))
|
|
211
|
-
.optional()
|
|
212
|
-
.meta({
|
|
213
|
-
uniqueItems: true,
|
|
214
|
-
description:
|
|
215
|
-
'This key defines the options for the View dropdown in a _Collection browser_. The first option listed is used as the default view.',
|
|
216
|
-
}),
|
|
217
|
-
singular_name: z.string().optional().meta({
|
|
218
|
-
description:
|
|
219
|
-
'This key defines the singular noun for your Collection name. CloudCannon uses the singular noun in the _+ Add_ button in the top right of the _Collection browser_.',
|
|
220
|
-
}),
|
|
221
|
-
add_options: z
|
|
222
|
-
.array(z.union([AddOptionSchema, HrefAddOptionSchema]))
|
|
223
|
-
.optional()
|
|
224
|
-
.meta({
|
|
225
|
-
description:
|
|
226
|
-
'This key defines the options available in the _+ Add_ button dropdown at the top right of your _Collection browser_.',
|
|
227
|
-
}),
|
|
228
|
-
create: CreateSchema.optional(),
|
|
229
|
-
disable_add: z.boolean().optional().meta({
|
|
230
|
-
description:
|
|
231
|
-
'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.',
|
|
232
|
-
}),
|
|
233
|
-
disable_add_folder: z.boolean().optional().meta({
|
|
234
|
-
description:
|
|
235
|
-
'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.',
|
|
236
|
-
}),
|
|
237
|
-
disable_file_actions: z.boolean().optional().meta({
|
|
238
|
-
description:
|
|
239
|
-
'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.',
|
|
240
|
-
}),
|
|
241
|
-
new_preview_url: z.string().optional().meta({
|
|
242
|
-
description:
|
|
243
|
-
'This key defines a new URL for previewing your unbuilt pages in the Visual Editor.',
|
|
244
|
-
}),
|
|
245
|
-
schemas: z.record(z.string(), SchemaSchema).optional().meta({
|
|
246
|
-
description:
|
|
247
|
-
'This key defines which Schemas are available to populate files in this Collection.',
|
|
248
|
-
}),
|
|
249
|
-
schema_key: z.string().optional().meta({
|
|
250
|
-
description:
|
|
251
|
-
'This key defines the name for the structured data key that references the Schema a file uses.',
|
|
252
|
-
}),
|
|
253
|
-
})
|
|
254
|
-
.meta({
|
|
255
|
-
title: 'CollectionConfig',
|
|
256
|
-
description:
|
|
257
|
-
'Definitions for your Collections, which are the sets of content files for your site grouped by folder.',
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
export const CollectionGroupSchema = z
|
|
261
|
-
.object({
|
|
262
|
-
heading: z.string().meta({
|
|
263
|
-
description: 'Short, descriptive label for this group of Collections.',
|
|
264
|
-
}),
|
|
265
|
-
collections: z.array(z.string()).meta({
|
|
266
|
-
description:
|
|
267
|
-
'The collections shown in the sidebar for this group. Collections here are referenced by their key within `collections_config`.',
|
|
268
|
-
}),
|
|
269
|
-
})
|
|
270
|
-
.meta({
|
|
271
|
-
title: 'Collection Group',
|
|
272
|
-
description:
|
|
273
|
-
'Defines which Collections are shown in the Site Navigation and how those Collections are grouped.',
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
export const DataConfigEntrySchema = z
|
|
277
|
-
.object({
|
|
278
|
-
path: z.string().meta({
|
|
279
|
-
id: 'DataConfigEntry.path',
|
|
280
|
-
description: 'The path to a file or folder of files containing data.',
|
|
281
|
-
}),
|
|
282
|
-
})
|
|
283
|
-
.meta({
|
|
284
|
-
id: 'DataConfigEntry',
|
|
285
|
-
title: 'Data Config Entry',
|
|
286
|
-
description: 'Controls what data sets are available to populate select and multiselect inputs.',
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
export const FileConfigEntrySchema = z
|
|
290
|
-
.object({
|
|
291
23
|
...CascadeSchema.shape,
|
|
292
|
-
glob: z.union([z.array(z.string()), z.string()]).meta({
|
|
293
|
-
description: 'The glob pattern(s) targeting a path to one or more files.',
|
|
294
|
-
}),
|
|
295
24
|
})
|
|
296
|
-
.meta({
|
|
297
|
-
title: 'FileConfigEntry',
|
|
298
|
-
description:
|
|
299
|
-
'Provides scope to configure at a file level, without adding configuration to files.',
|
|
300
|
-
});
|
|
25
|
+
.meta({ id: 'FileConfigEntry' });
|
|
301
26
|
|
|
302
27
|
export const EditorSchema = z.object({
|
|
303
|
-
default_path: z.string().default('/').meta({
|
|
304
|
-
description:
|
|
305
|
-
'The URL used for the dashboard screenshot, and where the editor opens to when clicking the dashboard "Edit Home" button.',
|
|
306
|
-
}),
|
|
28
|
+
default_path: z.string().default('/').meta({ id: 'editor.default_path' }),
|
|
307
29
|
});
|
|
308
30
|
|
|
309
31
|
export const CommitTemplateSchema = z
|
|
@@ -320,10 +42,7 @@ export const CommitTemplateSchema = z
|
|
|
320
42
|
description:
|
|
321
43
|
'Sets the path for a file containing your commit template. The file path should be relative to the root directory.',
|
|
322
44
|
}),
|
|
323
|
-
_inputs:
|
|
324
|
-
title: 'Inputs',
|
|
325
|
-
description: 'Define inputs used to populate data placeholders in the commit template.',
|
|
326
|
-
}),
|
|
45
|
+
_inputs: InputsSchema.optional(),
|
|
327
46
|
extra_data: z.record(z.string(), z.string()).optional().meta({
|
|
328
47
|
description: 'Define additional template strings, for building nested templates.',
|
|
329
48
|
}),
|
|
@@ -348,100 +67,65 @@ export const PullRequestTemplateSchema = z.object({
|
|
|
348
67
|
description: 'The default value for the pull request body.',
|
|
349
68
|
}),
|
|
350
69
|
template_path: z.string().optional().meta({
|
|
351
|
-
description:
|
|
352
|
-
|
|
353
|
-
_inputs: z.record(z.string(), InputSchema).optional().meta({
|
|
354
|
-
title: 'Inputs',
|
|
355
|
-
description: 'Define inputs used for the title and body fields of the pull request.',
|
|
70
|
+
description:
|
|
71
|
+
'Used to specify a file on the Site whose contents will be used as the default value for the pull request body. This has no effect if `body` is defined.',
|
|
356
72
|
}),
|
|
73
|
+
_inputs: InputsSchema.optional(),
|
|
357
74
|
});
|
|
358
75
|
|
|
359
76
|
export const ConfigurationSchema = z
|
|
360
77
|
.object({
|
|
361
|
-
...CascadeSchema.shape,
|
|
362
78
|
paths: PathsSchema.optional(),
|
|
363
|
-
version: z.literal('latest').optional().meta({
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
source: z
|
|
368
|
-
.string()
|
|
79
|
+
version: z.literal('latest').optional().meta({ id: 'version', excludeFromDocumentation: true }),
|
|
80
|
+
source: z.string().optional().meta({ id: 'source' }),
|
|
81
|
+
collections_config: z
|
|
82
|
+
.record(z.string(), CollectionConfigSchema)
|
|
369
83
|
.optional()
|
|
370
|
-
.meta({
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
'Definitions for your collections, which are the sets of content files for your site grouped by folder.',
|
|
382
|
-
}),
|
|
383
|
-
collection_groups: z.array(CollectionGroupSchema).optional().meta({
|
|
384
|
-
description:
|
|
385
|
-
'Defines which collections are shown in the site navigation and how those collections are grouped.',
|
|
386
|
-
}),
|
|
387
|
-
base_url: z.string().optional().meta({
|
|
388
|
-
description: 'The subpath where your output files are hosted.',
|
|
389
|
-
}),
|
|
390
|
-
data_config: z.record(z.string(), DataConfigEntrySchema).optional().meta({
|
|
391
|
-
description:
|
|
392
|
-
'Controls what data sets are available to populate select and multiselect inputs.',
|
|
393
|
-
}),
|
|
394
|
-
file_config: z.array(FileConfigEntrySchema).optional().meta({
|
|
395
|
-
description:
|
|
396
|
-
'Provides scope to configure at a file level, without adding configuration to files.',
|
|
397
|
-
}),
|
|
398
|
-
editor: EditorSchema.optional().meta({
|
|
399
|
-
description: 'Contains settings for the default editor actions on your site.',
|
|
400
|
-
}),
|
|
401
|
-
source_editor: SourceEditorSchema.optional().meta({
|
|
402
|
-
title: 'Source Editor',
|
|
403
|
-
description:
|
|
404
|
-
'This key defines the appearance and behavior of the Source Editor. The following nested keys are available:\n\n- `tab_size`\n- `show_gutter`\n- `theme`\n\nThis key has no default.\n\nhttps://cloudcannon.com/documentation/articles/the-source-editor/#source_editor',
|
|
405
|
-
}),
|
|
84
|
+
.meta({ id: 'collections_config' }),
|
|
85
|
+
collections_config_from_glob: z.array(z.string()).optional(),
|
|
86
|
+
collection_groups: z
|
|
87
|
+
.array(CollectionGroupSchema)
|
|
88
|
+
.optional()
|
|
89
|
+
.meta({ id: 'collection_groups', title: 'Collection Groups' }),
|
|
90
|
+
base_url: z.string().optional().meta({ id: 'base_url' }),
|
|
91
|
+
data_config: z.record(z.string(), DataConfigEntrySchema).optional().meta({ id: 'data_config' }),
|
|
92
|
+
file_config: z.array(FileConfigEntrySchema).optional().meta({ id: 'file_config' }),
|
|
93
|
+
editor: EditorSchema.optional().meta({ id: 'editor' }),
|
|
94
|
+
source_editor: SourceEditorSchema.optional().meta({ id: 'source_editor' }),
|
|
406
95
|
pull_request_templates: z.array(PullRequestTemplateSchema).optional().meta({
|
|
407
96
|
description: 'Templates for pull requests.',
|
|
408
97
|
}),
|
|
409
|
-
commit_templates: z.array(CommitTemplateSchema).optional().meta({
|
|
410
|
-
|
|
411
|
-
}),
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}),
|
|
415
|
-
markdown: MarkdownSettingsSchema.optional().meta({
|
|
416
|
-
description: 'Contains settings for various Markdown engines.',
|
|
417
|
-
}),
|
|
418
|
-
timezone: TimezoneSchema.default('Etc/UTC').optional().meta({
|
|
419
|
-
description: 'Specifies the time zone that dates are displayed and edited in.',
|
|
420
|
-
}),
|
|
98
|
+
commit_templates: z.array(CommitTemplateSchema).optional().meta({ id: 'commit_templates' }),
|
|
99
|
+
upstream_commit_template: z.string().optional().meta({ id: 'upstream_commit_template' }),
|
|
100
|
+
markdown: MarkdownSettingsSchema.optional().meta({ id: 'markdown' }),
|
|
101
|
+
timezone: TimezoneSchema.default('Etc/UTC').optional(),
|
|
102
|
+
...CascadeSchema.shape,
|
|
421
103
|
_snippets: z.record(z.string(), SnippetConfigSchema).optional().meta({
|
|
104
|
+
id: 'type._snippets',
|
|
105
|
+
title: 'Snippets',
|
|
422
106
|
description: 'Configuration for custom snippets.',
|
|
423
107
|
}),
|
|
108
|
+
_snippets_from_glob: z.array(z.string()).optional(),
|
|
424
109
|
_snippets_imports: SnippetsImportsSchema.optional(),
|
|
110
|
+
_snippets_imports_from_glob: z.array(z.string()).optional(),
|
|
425
111
|
_snippets_templates: z.record(z.string(), SnippetConfigSchema).optional().meta({
|
|
112
|
+
id: 'type._snippets_templates',
|
|
113
|
+
title: 'Snippets Templates',
|
|
426
114
|
description: 'Extended option used when creating more complex custom snippets.',
|
|
427
115
|
}),
|
|
428
|
-
|
|
116
|
+
_snippets_templates_from_glob: z.array(z.string()).optional(),
|
|
117
|
+
_snippets_definitions: z.record(z.string(), z.unknown()).optional().meta({
|
|
118
|
+
id: 'type._snippets_definitions',
|
|
119
|
+
title: 'Snippets Definitions',
|
|
429
120
|
description: 'Extended option used when creating more complex custom snippets.',
|
|
430
121
|
}),
|
|
122
|
+
_snippets_definitions_from_glob: z.array(z.string()).optional(),
|
|
431
123
|
})
|
|
432
124
|
.meta({
|
|
433
125
|
title: 'Configuration',
|
|
434
|
-
description: 'The main CloudCannon configuration
|
|
126
|
+
description: 'The main CloudCannon configuration.',
|
|
435
127
|
});
|
|
436
128
|
|
|
437
|
-
export type HrefAddOption = z.infer<typeof HrefAddOptionSchema>;
|
|
438
|
-
export type AddOption = z.infer<typeof AddOptionSchema>;
|
|
439
|
-
export type Sort = z.infer<typeof SortSchema>;
|
|
440
|
-
export type SortOption = z.infer<typeof SortOptionSchema>;
|
|
441
|
-
export type Create = z.infer<typeof CreateSchema>;
|
|
442
|
-
export type Schema = z.infer<typeof SchemaSchema>;
|
|
443
|
-
export type CollectionConfig = z.infer<typeof CollectionConfigSchema>;
|
|
444
|
-
export type CollectionGroup = z.infer<typeof CollectionGroupSchema>;
|
|
445
129
|
export type DataConfigEntry = z.infer<typeof DataConfigEntrySchema>;
|
|
446
130
|
export type FileConfigEntry = z.infer<typeof FileConfigEntrySchema>;
|
|
447
131
|
export type Editor = z.infer<typeof EditorSchema>;
|
package/src/documentation.ts
CHANGED
package/src/editables.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { ImageOptionsSchema } from './image-options';
|
|
3
|
-
import { PathsSchema } from './paths';
|
|
2
|
+
import { ImageOptionsSchema } from './image-options.ts';
|
|
3
|
+
import { PathsSchema } from './paths.ts';
|
|
4
4
|
|
|
5
5
|
export const TextEditableSchema = z.object({
|
|
6
6
|
paths: PathsSchema.optional(),
|
|
@@ -215,22 +215,32 @@ export const LinkEditableSchema = z.object({
|
|
|
215
215
|
|
|
216
216
|
export const EditablesSchema = z.object({
|
|
217
217
|
content: BlockEditableSchema.optional().meta({
|
|
218
|
+
id: 'ContentEditable',
|
|
219
|
+
title: 'Content Editable',
|
|
218
220
|
description: 'Contains input options for the Content Editor.',
|
|
219
221
|
}),
|
|
220
222
|
|
|
221
223
|
block: BlockEditableSchema.optional().meta({
|
|
224
|
+
id: 'BlockEditable',
|
|
225
|
+
title: 'Block Editable',
|
|
222
226
|
description: 'Contains input options for block Editable Regions.',
|
|
223
227
|
}),
|
|
224
228
|
|
|
225
229
|
link: LinkEditableSchema.optional().meta({
|
|
230
|
+
id: 'LinkEditable',
|
|
231
|
+
title: 'Link Editable',
|
|
226
232
|
description: 'Contains input options for link Editable Regions.',
|
|
227
233
|
}),
|
|
228
234
|
|
|
229
235
|
image: ImageEditableSchema.optional().meta({
|
|
236
|
+
id: 'ImageEditable',
|
|
237
|
+
title: 'Image Editable',
|
|
230
238
|
description: 'Contains input options for image Editable Regions.',
|
|
231
239
|
}),
|
|
232
240
|
|
|
233
241
|
text: TextEditableSchema.optional().meta({
|
|
242
|
+
id: 'TextEditable',
|
|
243
|
+
title: 'Text Editable',
|
|
234
244
|
description: 'Contains input options for text Editable Regions.',
|
|
235
245
|
}),
|
|
236
246
|
});
|
package/src/icon.ts
CHANGED
|
@@ -3591,7 +3591,7 @@ export const IconSchema = z
|
|
|
3591
3591
|
id: 'icon',
|
|
3592
3592
|
title: 'Icon',
|
|
3593
3593
|
description:
|
|
3594
|
-
'Material
|
|
3594
|
+
'Material Symbol icon names available in CloudCannon for UI elements and content previews.',
|
|
3595
3595
|
});
|
|
3596
3596
|
|
|
3597
3597
|
export type Icon = z.infer<typeof IconSchema>;
|
package/src/index.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
|
|
3
|
-
export * from './build-coupled';
|
|
4
|
-
export * from './cascade';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './
|
|
3
|
+
export * from './build-coupled.ts';
|
|
4
|
+
export * from './cascade.ts';
|
|
5
|
+
export * from './collections.ts';
|
|
6
|
+
export * from './configuration.ts';
|
|
7
|
+
export * from './documentation.ts';
|
|
8
|
+
export * from './editables.ts';
|
|
9
|
+
export * from './icon.ts';
|
|
10
|
+
export * from './image-options.ts';
|
|
11
|
+
export * from './inputs.ts';
|
|
12
|
+
export * from './markdown.ts';
|
|
13
|
+
export * from './paths.ts';
|
|
14
|
+
export * from './preview.ts';
|
|
15
|
+
export * from './select-values.ts';
|
|
16
|
+
export * from './snippets.ts';
|
|
17
|
+
export * from './source-editor.ts';
|
|
18
|
+
export * from './structures.ts';
|
|
19
|
+
export * from './timezone.ts';
|
|
19
20
|
|
|
20
21
|
export const SsgKeySchema = z.enum([
|
|
21
22
|
'hugo',
|