@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/inputs.ts
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { DocumentationSchema } from './documentation';
|
|
3
|
-
import { BlockEditableSchema } from './editables';
|
|
4
|
-
import { IconSchema } from './icon';
|
|
5
|
-
import { ImageOptionsSchema } from './image-options';
|
|
6
|
-
import { MimeTypeSchema } from './mimetype';
|
|
7
|
-
import { PathsSchema } from './paths';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from './
|
|
14
|
-
import { SelectDataValuesSchema } from './select-values';
|
|
15
|
-
import { SourceEditorSchema } from './source-editor';
|
|
16
|
-
import { StructureSchema } from './structures';
|
|
17
|
-
import { SyntaxSchema } from './syntax';
|
|
18
|
-
import { TimezoneSchema } from './timezone';
|
|
2
|
+
import { DocumentationSchema } from './documentation.ts';
|
|
3
|
+
import { BlockEditableSchema } from './editables.ts';
|
|
4
|
+
import { IconSchema } from './icon.ts';
|
|
5
|
+
import { ImageOptionsSchema } from './image-options.ts';
|
|
6
|
+
import { MimeTypeSchema } from './mimetype.ts';
|
|
7
|
+
import { PathsSchema } from './paths.ts';
|
|
8
|
+
import { PreviewEntriesSchema, PreviewSchema } from './preview.ts';
|
|
9
|
+
import { SelectDataValuesSchema } from './select-values.ts';
|
|
10
|
+
import { SourceEditorSchema } from './source-editor.ts';
|
|
11
|
+
import { StructureReferenceSchema, StructureSchema } from './structures.ts';
|
|
12
|
+
import { SyntaxSchema } from './syntax.ts';
|
|
13
|
+
import { TimezoneSchema } from './timezone.ts';
|
|
19
14
|
|
|
20
15
|
export const InputTypeSchema = z
|
|
21
16
|
.enum([
|
|
@@ -169,16 +164,16 @@ const ArrayValidationSchema = z.object({
|
|
|
169
164
|
});
|
|
170
165
|
|
|
171
166
|
const ArrayControlOptionsSchema = z.object({
|
|
172
|
-
disable_add: z.boolean().default(false).meta({
|
|
167
|
+
disable_add: z.boolean().default(false).optional().meta({
|
|
173
168
|
id: 'ArrayInput.disable_add',
|
|
174
169
|
description:
|
|
175
170
|
'Hides the add button, and context menu actions on each item for adding new items to this Input.',
|
|
176
171
|
}),
|
|
177
|
-
disable_remove: z.boolean().default(false).meta({
|
|
172
|
+
disable_remove: z.boolean().default(false).optional().meta({
|
|
178
173
|
id: 'disable_remove',
|
|
179
174
|
description: 'Hides the context menu actions on each item for removing them.',
|
|
180
175
|
}),
|
|
181
|
-
disable_reorder: z.boolean().default(false).meta({
|
|
176
|
+
disable_reorder: z.boolean().default(false).optional().meta({
|
|
182
177
|
id: 'disable_reorder',
|
|
183
178
|
description: 'Hides the controls on each item for moving them.',
|
|
184
179
|
}),
|
|
@@ -238,14 +233,22 @@ export const BaseInputSchema = z.object({
|
|
|
238
233
|
id: 'label',
|
|
239
234
|
description: 'Optionally changes the text above this input.',
|
|
240
235
|
}),
|
|
241
|
-
hidden: z
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
236
|
+
hidden: z
|
|
237
|
+
.union([z.boolean().meta({ title: 'Boolean' }), z.string().meta({ title: 'Query String' })])
|
|
238
|
+
.default(false)
|
|
239
|
+
.optional()
|
|
240
|
+
.meta({
|
|
241
|
+
id: 'hidden',
|
|
242
|
+
description: 'Toggles the visibility of this input.',
|
|
243
|
+
}),
|
|
244
|
+
disabled: z
|
|
245
|
+
.union([z.boolean().meta({ title: 'Boolean' }), z.string().meta({ title: 'Query String' })])
|
|
246
|
+
.default(false)
|
|
247
|
+
.optional()
|
|
248
|
+
.meta({
|
|
249
|
+
id: 'disabled',
|
|
250
|
+
description: 'Toggles if this input can be edited.',
|
|
251
|
+
}),
|
|
249
252
|
instance_value: z.enum(['UUID', 'NOW']).optional().meta({
|
|
250
253
|
id: 'instance_value',
|
|
251
254
|
title: 'Instance Value',
|
|
@@ -257,7 +260,7 @@ export const BaseInputSchema = z.object({
|
|
|
257
260
|
description:
|
|
258
261
|
'Prevents the default where inputs configured with an `instance_value` are rehydrated with a new value when duplicated in the CMS.',
|
|
259
262
|
}),
|
|
260
|
-
cascade: z.boolean().default(
|
|
263
|
+
cascade: z.boolean().default(true).optional().meta({
|
|
261
264
|
id: 'cascade',
|
|
262
265
|
description:
|
|
263
266
|
'Specifies whether or not this input configuration should be merged with any matching, less specific configuration.',
|
|
@@ -275,8 +278,8 @@ export const TextInputOptionsSchema = z
|
|
|
275
278
|
icon: IconSchema.optional().meta({
|
|
276
279
|
description: 'Icon shown beside the input.',
|
|
277
280
|
}),
|
|
278
|
-
icon_color:
|
|
279
|
-
icon_background_color:
|
|
281
|
+
icon_color: PreviewEntriesSchema.optional(),
|
|
282
|
+
icon_background_color: PreviewEntriesSchema.optional(),
|
|
280
283
|
})
|
|
281
284
|
.meta({
|
|
282
285
|
description: 'Options that are specific to Text Inputs.',
|
|
@@ -301,6 +304,8 @@ export const TextInputSchema = z
|
|
|
301
304
|
})
|
|
302
305
|
.meta({
|
|
303
306
|
id: 'TextInput',
|
|
307
|
+
title: 'Text Input',
|
|
308
|
+
description: 'Provides a simple editing interface for plain text.',
|
|
304
309
|
});
|
|
305
310
|
|
|
306
311
|
export const TextareaInputOptionsSchema = z
|
|
@@ -327,6 +332,8 @@ export const TextareaInputSchema = z
|
|
|
327
332
|
})
|
|
328
333
|
.meta({
|
|
329
334
|
id: 'TextareaInput',
|
|
335
|
+
title: 'Textarea Input',
|
|
336
|
+
description: 'Provides an editing interface for plain text.',
|
|
330
337
|
});
|
|
331
338
|
|
|
332
339
|
export const CodeInputOptionsSchema = z
|
|
@@ -360,6 +367,8 @@ export const CodeInputSchema = z
|
|
|
360
367
|
})
|
|
361
368
|
.meta({
|
|
362
369
|
id: 'CodeInput',
|
|
370
|
+
title: 'Code Input',
|
|
371
|
+
description: 'Provides an editing interface for code or mono-spaced plain text content.',
|
|
363
372
|
});
|
|
364
373
|
|
|
365
374
|
export const ColorInputOptionsSchema = z
|
|
@@ -388,15 +397,19 @@ export const ColorInputSchema = z
|
|
|
388
397
|
})
|
|
389
398
|
.meta({
|
|
390
399
|
id: 'ColorInput',
|
|
400
|
+
title: 'Color Input',
|
|
401
|
+
description: 'Provides an editing interface for color values.',
|
|
391
402
|
});
|
|
392
403
|
|
|
393
404
|
export const BooleanInputSchema = z
|
|
394
405
|
.object({
|
|
395
406
|
...BaseInputSchema.shape,
|
|
396
|
-
type: z.
|
|
407
|
+
type: z.enum(['checkbox', 'switch']).meta(typeMeta),
|
|
397
408
|
})
|
|
398
409
|
.meta({
|
|
399
410
|
id: 'BooleanInput',
|
|
411
|
+
title: 'Boolean Input',
|
|
412
|
+
description: 'Provides an editing interface for true or false values.',
|
|
400
413
|
});
|
|
401
414
|
|
|
402
415
|
const MinSchema = z.number().meta({
|
|
@@ -445,6 +458,8 @@ export const NumberInputSchema = z
|
|
|
445
458
|
})
|
|
446
459
|
.meta({
|
|
447
460
|
id: 'NumberInput',
|
|
461
|
+
title: 'Number Input',
|
|
462
|
+
description: 'Provides an editing interface for numeric values.',
|
|
448
463
|
});
|
|
449
464
|
|
|
450
465
|
export const RangeInputOptionsSchema = z
|
|
@@ -465,6 +480,8 @@ export const RangeInputSchema = z
|
|
|
465
480
|
})
|
|
466
481
|
.meta({
|
|
467
482
|
id: 'RangeInput',
|
|
483
|
+
title: 'Range Input',
|
|
484
|
+
description: 'Provides a slider interface for selecting a numeric value.',
|
|
468
485
|
});
|
|
469
486
|
|
|
470
487
|
export const RichTextInputOptionsSchema = z
|
|
@@ -493,20 +510,22 @@ export const RichTextInputSchema = z
|
|
|
493
510
|
})
|
|
494
511
|
.meta({
|
|
495
512
|
id: 'RichTextInput',
|
|
513
|
+
title: 'Rich Text Input',
|
|
514
|
+
description: 'Provides an editing interface for HTML markup content.',
|
|
496
515
|
});
|
|
497
516
|
|
|
498
517
|
export const DateInputOptionsSchema = z
|
|
499
518
|
.object({
|
|
500
519
|
...RequiredValidationSchema.shape,
|
|
501
520
|
empty_type: EmptyTypeTextSchema.optional(),
|
|
502
|
-
timezone: TimezoneSchema.optional().
|
|
521
|
+
timezone: TimezoneSchema.optional().meta({
|
|
503
522
|
description:
|
|
504
523
|
'Specifies the time zone that dates are displayed and edited in. Also changes the suffix the date is persisted to the file with. Defaults to the global `timezone`.',
|
|
505
524
|
}),
|
|
506
525
|
start_from: z
|
|
507
526
|
.union([
|
|
508
|
-
z.iso.datetime({ offset: true, local: true }),
|
|
509
|
-
z.coerce.string().meta({ isJsonSchemaAny: true }),
|
|
527
|
+
z.iso.datetime({ offset: true, local: true }).meta({ title: 'ISO8601 String' }),
|
|
528
|
+
z.coerce.string().meta({ isJsonSchemaAny: true, documentationType: 'date', title: 'Date' }),
|
|
510
529
|
])
|
|
511
530
|
.optional()
|
|
512
531
|
.meta({
|
|
@@ -519,8 +538,8 @@ export const DateInputOptionsSchema = z
|
|
|
519
538
|
}),
|
|
520
539
|
end_before: z
|
|
521
540
|
.union([
|
|
522
|
-
z.iso.datetime({ offset: true, local: true }),
|
|
523
|
-
z.coerce.string().meta({ isJsonSchemaAny: true }),
|
|
541
|
+
z.iso.datetime({ offset: true, local: true }).meta({ title: 'ISO8601 String' }),
|
|
542
|
+
z.coerce.string().meta({ isJsonSchemaAny: true, documentationType: 'date', title: 'Date' }),
|
|
524
543
|
])
|
|
525
544
|
.optional()
|
|
526
545
|
.meta({
|
|
@@ -544,6 +563,8 @@ export const DateInputSchema = z
|
|
|
544
563
|
})
|
|
545
564
|
.meta({
|
|
546
565
|
id: 'DateInput',
|
|
566
|
+
title: 'Date Input',
|
|
567
|
+
description: 'Provides an editing interface for date and/or time values.',
|
|
547
568
|
});
|
|
548
569
|
|
|
549
570
|
export const TimeInputOptionsSchema = z
|
|
@@ -563,6 +584,8 @@ export const TimeInputSchema = z
|
|
|
563
584
|
})
|
|
564
585
|
.meta({
|
|
565
586
|
id: 'TimeInput',
|
|
587
|
+
title: 'Time Input',
|
|
588
|
+
description: 'Provides an editing interface for time values only.',
|
|
566
589
|
});
|
|
567
590
|
|
|
568
591
|
export const FileInputOptionsSchema = z
|
|
@@ -573,7 +596,10 @@ export const FileInputOptionsSchema = z
|
|
|
573
596
|
empty_type: EmptyTypeTextSchema.optional(),
|
|
574
597
|
paths: PathsSchema.optional(),
|
|
575
598
|
accepts_mime_types: z
|
|
576
|
-
.union([
|
|
599
|
+
.union([
|
|
600
|
+
z.string().meta({ title: 'Comma Separated' }),
|
|
601
|
+
z.array(MimeTypeSchema).meta({ title: 'Array' }),
|
|
602
|
+
])
|
|
577
603
|
.optional()
|
|
578
604
|
.meta({
|
|
579
605
|
id: 'accepts_mime_types',
|
|
@@ -617,6 +643,9 @@ export const FileInputSchema = z
|
|
|
617
643
|
})
|
|
618
644
|
.meta({
|
|
619
645
|
id: 'FileInput',
|
|
646
|
+
title: 'File Input',
|
|
647
|
+
description:
|
|
648
|
+
'Provides an editing interface for uploading files to your repository or DAM and browsing existing assets.',
|
|
620
649
|
});
|
|
621
650
|
|
|
622
651
|
export const UrlInputOptionsSchema = z
|
|
@@ -651,12 +680,14 @@ export const UrlInputSchema = z
|
|
|
651
680
|
})
|
|
652
681
|
.meta({
|
|
653
682
|
id: 'UrlInput',
|
|
683
|
+
title: 'URL Input',
|
|
684
|
+
description: 'Provides an editing interface for relative, absolute, and fully qualified URLs.',
|
|
654
685
|
});
|
|
655
686
|
|
|
656
687
|
export const SharedSelectInputOptionsSchema = z.object({
|
|
657
688
|
...RequiredValidationSchema.shape,
|
|
658
689
|
preview: PreviewSchema.optional(),
|
|
659
|
-
picker_preview:
|
|
690
|
+
picker_preview: PreviewSchema.optional(),
|
|
660
691
|
allow_create: z.boolean().default(false).optional().meta({
|
|
661
692
|
id: 'allow_create',
|
|
662
693
|
description: 'Allows new text values to be created at edit time.',
|
|
@@ -665,11 +696,17 @@ export const SharedSelectInputOptionsSchema = z.object({
|
|
|
665
696
|
id: 'allow_empty',
|
|
666
697
|
description: 'Provides an empty option alongside the options provided by values.',
|
|
667
698
|
}),
|
|
668
|
-
values: z
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
699
|
+
values: z
|
|
700
|
+
.union([
|
|
701
|
+
z.string().meta({ title: 'Dataset Reference', description: 'Reference to a dataset.' }),
|
|
702
|
+
SelectDataValuesSchema,
|
|
703
|
+
])
|
|
704
|
+
.optional()
|
|
705
|
+
.meta({
|
|
706
|
+
id: 'values',
|
|
707
|
+
description:
|
|
708
|
+
'Defines the values available to choose from. Optional, defaults to fetching values from the naming convention (e.g. colors or my_colors for data set colors).',
|
|
709
|
+
}),
|
|
673
710
|
value_key: z.string().optional().meta({
|
|
674
711
|
id: 'value_key',
|
|
675
712
|
description:
|
|
@@ -703,6 +740,9 @@ export const SelectInputSchema = z
|
|
|
703
740
|
})
|
|
704
741
|
.meta({
|
|
705
742
|
id: 'SelectInput',
|
|
743
|
+
title: 'Select Input',
|
|
744
|
+
description:
|
|
745
|
+
'Provides an editing interface for data with multiple predefined options. Select inputs only allow one value.',
|
|
706
746
|
});
|
|
707
747
|
|
|
708
748
|
export const MultiselectInputOptionsSchema = z
|
|
@@ -723,6 +763,9 @@ export const MultiselectInputSchema = z
|
|
|
723
763
|
})
|
|
724
764
|
.meta({
|
|
725
765
|
id: 'MultiselectInput',
|
|
766
|
+
title: 'Multiselect Input',
|
|
767
|
+
description:
|
|
768
|
+
'Provides an editing interface for data with multiple predefined options. Multiselect inputs allow several values.',
|
|
726
769
|
});
|
|
727
770
|
|
|
728
771
|
export const SharedChoiceInputOptionsSchema = SharedSelectInputOptionsSchema.omit({
|
|
@@ -747,6 +790,9 @@ export const ChoiceInputSchema = z
|
|
|
747
790
|
})
|
|
748
791
|
.meta({
|
|
749
792
|
id: 'ChoiceInput',
|
|
793
|
+
title: 'Choice Input',
|
|
794
|
+
description:
|
|
795
|
+
'Provides an editing interface for data with multiple predefined options. Choice inputs only allow one value.',
|
|
750
796
|
});
|
|
751
797
|
|
|
752
798
|
export const MultichoiceInputOptionsSchema = z
|
|
@@ -767,6 +813,9 @@ export const MultichoiceInputSchema = z
|
|
|
767
813
|
})
|
|
768
814
|
.meta({
|
|
769
815
|
id: 'MultichoiceInput',
|
|
816
|
+
title: 'Multichoice Input',
|
|
817
|
+
description:
|
|
818
|
+
'Provides an editing interface for data with multiple predefined options. Multichoice inputs allow several values.',
|
|
770
819
|
});
|
|
771
820
|
|
|
772
821
|
export const ObjectInputGroupSchema = z.object({
|
|
@@ -808,18 +857,28 @@ export const ObjectInputOptionsSchema = z
|
|
|
808
857
|
'Provides data formats when adding entries to the data within this object input. When adding an entry, team members are prompted to choose from a number of values you have defined. Has no effect if `allow_create` is false. `entries.structures` applies to the entries within the object.',
|
|
809
858
|
}),
|
|
810
859
|
get structures() {
|
|
811
|
-
return z.union([
|
|
860
|
+
return z.union([StructureReferenceSchema, StructureSchema]).optional().meta({
|
|
812
861
|
description:
|
|
813
862
|
'Provides data formats for value of this object. When choosing an item, team members are prompted to choose from a number of values you have defined. `structures` applies to the object itself.',
|
|
814
863
|
});
|
|
815
864
|
},
|
|
865
|
+
comment: z.string().optional().meta({
|
|
866
|
+
id: 'entries_comment',
|
|
867
|
+
description:
|
|
868
|
+
'Used to supply help text above the key input when adding/renaming within a mutable object input. Has no default. Supports a limited set of Markdown: links, bold, italic, subscript, superscript and inline code elements are allowed.',
|
|
869
|
+
}),
|
|
870
|
+
documentation: DocumentationSchema.optional().meta({
|
|
871
|
+
id: 'entries_documentation',
|
|
872
|
+
description:
|
|
873
|
+
'Provides a custom link for documentation for editors shown above the key input when adding/renaming within a mutable object input.',
|
|
874
|
+
}),
|
|
816
875
|
})
|
|
817
876
|
.optional()
|
|
818
877
|
.meta({
|
|
819
878
|
description: 'Contains options for the "mutable" subtype.',
|
|
820
879
|
}),
|
|
821
880
|
get structures() {
|
|
822
|
-
return z.union([
|
|
881
|
+
return z.union([StructureReferenceSchema, StructureSchema]).optional().meta({
|
|
823
882
|
description:
|
|
824
883
|
'Provides data formats for value of this object. When choosing an item, team members are prompted to choose from a number of values you have defined. `structures` applies to the object itself.',
|
|
825
884
|
});
|
|
@@ -850,6 +909,8 @@ export const ObjectInputSchema = z
|
|
|
850
909
|
})
|
|
851
910
|
.meta({
|
|
852
911
|
id: 'ObjectInput',
|
|
912
|
+
title: 'Object Input',
|
|
913
|
+
description: 'Provides a user interface for a group of inputs.',
|
|
853
914
|
});
|
|
854
915
|
|
|
855
916
|
export const ArrayInputOptionsSchema = z
|
|
@@ -859,7 +920,7 @@ export const ArrayInputOptionsSchema = z
|
|
|
859
920
|
...ArrayControlOptionsSchema.shape,
|
|
860
921
|
empty_type: EmptyTypeArraySchema.optional(),
|
|
861
922
|
get structures() {
|
|
862
|
-
return z.union([
|
|
923
|
+
return z.union([StructureReferenceSchema, StructureSchema]).optional().meta({
|
|
863
924
|
description:
|
|
864
925
|
'Provides data formats for value of this object. When choosing an item, team members are prompted to choose from a number of values you have defined.',
|
|
865
926
|
});
|
|
@@ -877,6 +938,8 @@ export const ArrayInputSchema = z
|
|
|
877
938
|
})
|
|
878
939
|
.meta({
|
|
879
940
|
id: 'ArrayInput',
|
|
941
|
+
title: 'Array Input',
|
|
942
|
+
description: 'Provides a user interface for lists of inputs or input groups.',
|
|
880
943
|
});
|
|
881
944
|
|
|
882
945
|
export const AutoInputSchema = z
|
|
@@ -889,6 +952,9 @@ export const AutoInputSchema = z
|
|
|
889
952
|
})
|
|
890
953
|
.meta({
|
|
891
954
|
id: 'AutoInput',
|
|
955
|
+
title: 'Automatic Input',
|
|
956
|
+
description: 'Provides a default user interface based on the data contained.',
|
|
957
|
+
excludeFromDocumentation: true,
|
|
892
958
|
});
|
|
893
959
|
|
|
894
960
|
export const UnknownInputSchema = z
|
|
@@ -901,8 +967,8 @@ export const UnknownInputSchema = z
|
|
|
901
967
|
.meta({
|
|
902
968
|
id: 'UnknownInput',
|
|
903
969
|
title: 'Unknown Input',
|
|
904
|
-
description:
|
|
905
|
-
|
|
970
|
+
description: 'Provides a default user interface based on the data contained.',
|
|
971
|
+
excludeFromDocumentation: true,
|
|
906
972
|
});
|
|
907
973
|
|
|
908
974
|
export const KnownInputSchema = z
|
|
@@ -935,10 +1001,11 @@ export const KnownInputSchema = z
|
|
|
935
1001
|
|
|
936
1002
|
export const InputSchema = z.union([KnownInputSchema, UnknownInputSchema]).meta({
|
|
937
1003
|
id: 'Input',
|
|
1004
|
+
title: 'Input',
|
|
938
1005
|
});
|
|
939
1006
|
|
|
940
1007
|
export const InputsSchema = z.record(z.string(), InputSchema).meta({
|
|
941
|
-
id: '_inputs',
|
|
1008
|
+
id: 'type._inputs',
|
|
942
1009
|
title: 'Inputs',
|
|
943
1010
|
description:
|
|
944
1011
|
'Controls the behavior and appearance of your inputs in all data editing interfaces.',
|
package/src/markdown.ts
CHANGED
|
@@ -9,13 +9,11 @@ export const AttributeListPositionSchema = z
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export const MarkdownAttributeElementOptionsSchema = z
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
z.record(z.string(), AttributeListPositionSchema)
|
|
18
|
-
)
|
|
12
|
+
.object({
|
|
13
|
+
inline: AttributeListPositionSchema.optional(),
|
|
14
|
+
block: AttributeListPositionSchema.optional(),
|
|
15
|
+
})
|
|
16
|
+
.catchall(AttributeListPositionSchema)
|
|
19
17
|
.meta({
|
|
20
18
|
title: 'Markdown Attribute Element Options',
|
|
21
19
|
description: 'Configuration for positioning Markdown attributes on different element types.',
|
|
@@ -23,69 +21,72 @@ export const MarkdownAttributeElementOptionsSchema = z
|
|
|
23
21
|
|
|
24
22
|
export const MarkdownSettingsSchema = z
|
|
25
23
|
.object({
|
|
26
|
-
engine: z.enum(['commonmark', 'kramdown']).default('commonmark').meta({
|
|
24
|
+
engine: z.enum(['commonmark', 'kramdown']).default('commonmark').optional().meta({
|
|
27
25
|
description: 'The flavor of Markdown to use to convert between HTML and Markdown.',
|
|
28
26
|
}),
|
|
29
|
-
options: z
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
27
|
+
options: z
|
|
28
|
+
.object({
|
|
29
|
+
html: z.boolean().optional().meta({
|
|
30
|
+
description: 'Output HTML tags from source.',
|
|
31
|
+
}),
|
|
32
|
+
xhtml: z.boolean().optional().meta({
|
|
33
|
+
description: 'Use `/` to close single tags (e.g. `<br />`).',
|
|
34
|
+
}),
|
|
35
|
+
breaks: z.boolean().optional().meta({
|
|
36
|
+
description: 'Convert `\\n` in paragraphs into `<br>`.',
|
|
37
|
+
}),
|
|
38
|
+
linkify: z.boolean().optional().meta({
|
|
39
|
+
description: 'Autoconvert URL-like text to links.',
|
|
40
|
+
}),
|
|
41
|
+
typographer: z.boolean().optional().meta({
|
|
42
|
+
description:
|
|
43
|
+
'Enable some language-neutral replacement, as well as quotes beautification.',
|
|
44
|
+
}),
|
|
45
|
+
quotes: z.string().optional().meta({
|
|
46
|
+
description:
|
|
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
|
+
}),
|
|
49
|
+
spaced_lists: z.boolean().optional().meta({
|
|
50
|
+
description: 'Output lists with an extra space in Markdown.',
|
|
51
|
+
}),
|
|
52
|
+
sentence_per_line: z.boolean().optional().meta({
|
|
53
|
+
description: 'Add linebreaks between sentences in Markdown.',
|
|
54
|
+
}),
|
|
55
|
+
gfm: z.boolean().optional().meta({
|
|
56
|
+
description: 'Enable GFM mode.',
|
|
57
|
+
}),
|
|
58
|
+
code_block_fences: z.enum(['```', '~~~']).optional().meta({
|
|
59
|
+
description: 'Determines which style of code block fences to use.',
|
|
60
|
+
}),
|
|
61
|
+
treat_indentation_as_code: z.boolean().optional().meta({
|
|
62
|
+
description: 'Determines whether 4 spaces on indentation should be read as a code block.',
|
|
63
|
+
}),
|
|
64
|
+
escape_snippets_in_code_blocks: z.boolean().optional().meta({
|
|
65
|
+
description: 'Render snippets as plain text within code blocks.',
|
|
66
|
+
}),
|
|
67
|
+
table: z.boolean().optional().meta({
|
|
68
|
+
description: 'Output tables in Markdown format.',
|
|
69
|
+
}),
|
|
70
|
+
strikethrough: z.boolean().optional().meta({
|
|
71
|
+
description: 'Output strikes in wrapped in double tildes (e.g. `~~strike~~`).',
|
|
72
|
+
}),
|
|
73
|
+
subscript: z.boolean().optional().meta({
|
|
74
|
+
description: 'Output subscript in wrapped in tildes (e.g. `~sub~`).',
|
|
75
|
+
}),
|
|
76
|
+
superscript: z.boolean().optional().meta({
|
|
77
|
+
description: 'Output superscript in wrapped in carets (e.g. `^super^`).',
|
|
78
|
+
}),
|
|
79
|
+
heading_ids: z.boolean().optional().meta({
|
|
80
|
+
description: 'Generate IDs for headings.',
|
|
81
|
+
}),
|
|
82
|
+
attributes: z.boolean().optional().meta({
|
|
83
|
+
description: 'Save element attributes in Markdown format instead of converting to HTML.',
|
|
84
|
+
}),
|
|
85
|
+
attribute_elements: MarkdownAttributeElementOptionsSchema.optional().meta({
|
|
86
|
+
description: 'Define positioning behavior of Markdown attributes for different elements.',
|
|
87
|
+
}),
|
|
88
|
+
})
|
|
89
|
+
.optional(),
|
|
89
90
|
})
|
|
90
91
|
.meta({
|
|
91
92
|
title: 'Markdown Settings',
|
package/src/paths.ts
CHANGED
|
@@ -2,42 +2,17 @@ import * as z from 'zod';
|
|
|
2
2
|
|
|
3
3
|
export const PathsSchema = z
|
|
4
4
|
.object({
|
|
5
|
-
static: z.string().optional().meta({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
id: 'Paths.uploads_filename',
|
|
16
|
-
description: 'Filename template for newly uploaded site files.',
|
|
17
|
-
}),
|
|
18
|
-
dam_uploads: z.string().optional().meta({
|
|
19
|
-
id: 'Paths.dam_uploads',
|
|
20
|
-
description: 'Default location of newly uploaded DAM files.',
|
|
21
|
-
}),
|
|
22
|
-
dam_uploads_filename: z.string().optional().meta({
|
|
23
|
-
id: 'Paths.dam_uploads_filename',
|
|
24
|
-
description: 'Filename template for newly uploaded DAM files.',
|
|
25
|
-
}),
|
|
26
|
-
dam_static: z.string().optional().meta({
|
|
27
|
-
id: 'Paths.dam_static',
|
|
28
|
-
description:
|
|
29
|
-
'Location of statically copied assets for DAM files. This prefix will be removed from the _DAM Uploads_ path when CloudCannon outputs the URL of an asset.',
|
|
30
|
-
}),
|
|
31
|
-
uploads_use_relative_path: z.boolean().optional().meta({
|
|
32
|
-
id: 'Paths.uploads_use_relative_path',
|
|
33
|
-
description:
|
|
34
|
-
'When set to true, CloudCannon will reference files relative to the path of the file they were uploaded to.',
|
|
35
|
-
}),
|
|
5
|
+
static: z.string().optional().meta({ id: 'paths.static' }),
|
|
6
|
+
uploads: z.string().default('uploads').optional().meta({ id: 'paths.uploads' }),
|
|
7
|
+
uploads_filename: z.string().optional().meta({ id: 'paths.uploads_filename' }),
|
|
8
|
+
dam_uploads: z.string().optional().meta({ id: 'paths.dam_uploads' }),
|
|
9
|
+
dam_uploads_filename: z.string().optional().meta({ id: 'paths.dam_uploads_filename' }),
|
|
10
|
+
dam_static: z.string().optional().meta({ id: 'paths.dam_static' }),
|
|
11
|
+
uploads_use_relative_path: z
|
|
12
|
+
.boolean()
|
|
13
|
+
.optional()
|
|
14
|
+
.meta({ id: 'paths.uploads_use_relative_path' }),
|
|
36
15
|
})
|
|
37
|
-
.meta({
|
|
38
|
-
id: 'paths',
|
|
39
|
-
description:
|
|
40
|
-
'Paths to where new asset files are uploaded to. They also set the default path when choosing existing images, and linking to existing files. Each path is relative to global `source`. Defaults to the global `paths`.',
|
|
41
|
-
});
|
|
16
|
+
.meta({ id: 'type.paths', title: 'Paths' });
|
|
42
17
|
|
|
43
18
|
export type Paths = z.infer<typeof PathsSchema>;
|