@sveltia/cms 0.87.1 → 0.87.3
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/README.md +36 -20
- package/dist/sveltia-cms.js +202 -200
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +206 -204
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
- package/schema/sveltia-cms.json +360 -399
- package/types/public.d.ts +136 -85
package/types/public.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type RasterImageTransformationOptions = {
|
|
|
36
36
|
*/
|
|
37
37
|
format?: RasterImageConversionFormat;
|
|
38
38
|
/**
|
|
39
|
-
* Image quality between 0 and 100. Default: 85
|
|
39
|
+
* Image quality between 0 and 100. Default: `85`.
|
|
40
40
|
*/
|
|
41
41
|
quality?: number;
|
|
42
42
|
/**
|
|
@@ -51,7 +51,33 @@ export type RasterImageTransformationOptions = {
|
|
|
51
51
|
/**
|
|
52
52
|
* Raster image transformation option map.
|
|
53
53
|
*/
|
|
54
|
-
export type RasterImageTransformations =
|
|
54
|
+
export type RasterImageTransformations = {
|
|
55
|
+
/**
|
|
56
|
+
* Raster image transformation options
|
|
57
|
+
* that apply to any supported raster image format.
|
|
58
|
+
*/
|
|
59
|
+
raster_image?: RasterImageTransformationOptions;
|
|
60
|
+
/**
|
|
61
|
+
* AVIF image transformation options.
|
|
62
|
+
*/
|
|
63
|
+
avif?: RasterImageTransformationOptions;
|
|
64
|
+
/**
|
|
65
|
+
* GIF image transformation options.
|
|
66
|
+
*/
|
|
67
|
+
gif?: RasterImageTransformationOptions;
|
|
68
|
+
/**
|
|
69
|
+
* JPEG image transformation options.
|
|
70
|
+
*/
|
|
71
|
+
jpeg?: RasterImageTransformationOptions;
|
|
72
|
+
/**
|
|
73
|
+
* PNG image transformation options.
|
|
74
|
+
*/
|
|
75
|
+
png?: RasterImageTransformationOptions;
|
|
76
|
+
/**
|
|
77
|
+
* WebP image transformation options.
|
|
78
|
+
*/
|
|
79
|
+
webp?: RasterImageTransformationOptions;
|
|
80
|
+
};
|
|
55
81
|
/**
|
|
56
82
|
* Vector image transformation option map.
|
|
57
83
|
*/
|
|
@@ -64,7 +90,12 @@ export type VectorImageTransformationOptions = {
|
|
|
64
90
|
/**
|
|
65
91
|
* Vector image transformation option map.
|
|
66
92
|
*/
|
|
67
|
-
export type VectorImageTransformations =
|
|
93
|
+
export type VectorImageTransformations = {
|
|
94
|
+
/**
|
|
95
|
+
* SVG image transformation options.
|
|
96
|
+
*/
|
|
97
|
+
svg?: VectorImageTransformationOptions;
|
|
98
|
+
};
|
|
68
99
|
/**
|
|
69
100
|
* Image transformation option map.
|
|
70
101
|
*/
|
|
@@ -123,7 +154,7 @@ export type CloudinaryMediaLibrary = {
|
|
|
123
154
|
*/
|
|
124
155
|
use_secure_url?: boolean;
|
|
125
156
|
/**
|
|
126
|
-
* Options to be passed to
|
|
157
|
+
* Options to be passed to Cloudinary, such as `multiple`.
|
|
127
158
|
* The `cloud_name` and `api_key` options are required for the global `media_library` option. See
|
|
128
159
|
* https://cloudinary.com/documentation/media_library_widget#2_set_the_configuration_options for a
|
|
129
160
|
* full list of available options.
|
|
@@ -202,9 +233,9 @@ export type MediaLibraries = {
|
|
|
202
233
|
stock_assets?: StockAssetMediaLibrary;
|
|
203
234
|
};
|
|
204
235
|
/**
|
|
205
|
-
*
|
|
236
|
+
* Base field properties that are common to all fields.
|
|
206
237
|
*/
|
|
207
|
-
export type
|
|
238
|
+
export type BaseFieldProps = {
|
|
208
239
|
/**
|
|
209
240
|
* Unique identifier for the field. It cannot include periods and spaces.
|
|
210
241
|
*/
|
|
@@ -219,10 +250,32 @@ export type CommonFieldProps = {
|
|
|
219
250
|
*/
|
|
220
251
|
comment?: string;
|
|
221
252
|
/**
|
|
222
|
-
*
|
|
223
|
-
*
|
|
253
|
+
* Help message to be displayed below the input UI. Limited Markdown
|
|
254
|
+
* formatting is supported: bold, italic, strikethrough and links.
|
|
224
255
|
*/
|
|
225
|
-
|
|
256
|
+
hint?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Whether to show the preview of the field. Default: `true`.
|
|
259
|
+
*/
|
|
260
|
+
preview?: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Whether to enable the editor UI
|
|
263
|
+
* in locales other than the default locale. Default: `false`. `duplicate` disables the UI in
|
|
264
|
+
* non-default like `false` but automatically copies the default locale’s value to other locales.
|
|
265
|
+
* `translate` and `none` are aliases of `true` and `false`, respectively. This option only works
|
|
266
|
+
* when i18n is set up with the global and collection-level `i18n` option.
|
|
267
|
+
*/
|
|
268
|
+
i18n?: boolean | "duplicate" | "translate" | "none";
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Common field properties. We have to allow arbitrary properties because custom widgets can have
|
|
272
|
+
* any properties. This is also required to enable schema autocomplete for the fields in IDEs.
|
|
273
|
+
*/
|
|
274
|
+
export type CommonFieldProps = BaseFieldProps & Record<string, any>;
|
|
275
|
+
/**
|
|
276
|
+
* Standard field properties for a built-in widget.
|
|
277
|
+
*/
|
|
278
|
+
export type StandardFieldProps = {
|
|
226
279
|
/**
|
|
227
280
|
* Whether to make data input on the field required.
|
|
228
281
|
* Default: `true`. This option also affects data output if the `omit_empty_optional_fields` global
|
|
@@ -241,23 +294,6 @@ export type CommonFieldProps = {
|
|
|
241
294
|
* message. This option has no effect on a List or Object field with subfields.
|
|
242
295
|
*/
|
|
243
296
|
pattern?: [string | RegExp, string];
|
|
244
|
-
/**
|
|
245
|
-
* Help message to be displayed below the input UI. Limited Markdown
|
|
246
|
-
* formatting is supported: bold, italic, strikethrough and links.
|
|
247
|
-
*/
|
|
248
|
-
hint?: string;
|
|
249
|
-
/**
|
|
250
|
-
* Whether to show the preview of the field. Default: `true`.
|
|
251
|
-
*/
|
|
252
|
-
preview?: boolean;
|
|
253
|
-
/**
|
|
254
|
-
* Whether to enable the editor UI
|
|
255
|
-
* in locales other than the default locale. Default: `false`. `duplicate` disables the UI in
|
|
256
|
-
* non-default like `false` but automatically copies the default locale’s value to other locales.
|
|
257
|
-
* `translate` and `none` are aliases of `true` and `false`, respectively. This option only works
|
|
258
|
-
* when i18n is set up with the global and collection-level `i18n` option.
|
|
259
|
-
*/
|
|
260
|
-
i18n?: boolean | "duplicate" | "translate" | "none";
|
|
261
297
|
};
|
|
262
298
|
/**
|
|
263
299
|
* Field-level media library options.
|
|
@@ -318,11 +354,11 @@ export type MediaFieldProps = {
|
|
|
318
354
|
*/
|
|
319
355
|
export type MultiValueFieldProps = {
|
|
320
356
|
/**
|
|
321
|
-
* Minimum number of items that can be added. Default: 0
|
|
357
|
+
* Minimum number of items that can be added. Default: `0`.
|
|
322
358
|
*/
|
|
323
359
|
min?: number;
|
|
324
360
|
/**
|
|
325
|
-
* Maximum number of items that can be added. Default:
|
|
361
|
+
* Maximum number of items that can be added. Default: `Infinity`.
|
|
326
362
|
*/
|
|
327
363
|
max?: number;
|
|
328
364
|
};
|
|
@@ -336,17 +372,17 @@ export type MultiOptionFieldProps = {
|
|
|
336
372
|
multiple?: boolean;
|
|
337
373
|
/**
|
|
338
374
|
* Minimum number of items that can be selected. Ignored if `multiple` is
|
|
339
|
-
* `false`. Default: 0
|
|
375
|
+
* `false`. Default: `0`.
|
|
340
376
|
*/
|
|
341
377
|
min?: number;
|
|
342
378
|
/**
|
|
343
379
|
* Maximum number of items that can be selected. Ignored if `multiple` is
|
|
344
|
-
* `false`. Default:
|
|
380
|
+
* `false`. Default: `Infinity`.
|
|
345
381
|
*/
|
|
346
382
|
max?: number;
|
|
347
383
|
/**
|
|
348
384
|
* Maximum number of options to be displayed as radio
|
|
349
|
-
* buttons (single-select) or checkboxes (multi-select) rather than a dropdown list. Default: 5
|
|
385
|
+
* buttons (single-select) or checkboxes (multi-select) rather than a dropdown list. Default: `5`.
|
|
350
386
|
*/
|
|
351
387
|
dropdown_threshold?: number;
|
|
352
388
|
};
|
|
@@ -412,12 +448,12 @@ export type AdjacentLabelProps = {
|
|
|
412
448
|
export type CharCountProps = {
|
|
413
449
|
/**
|
|
414
450
|
* Minimum number of characters that can be entered in the input.
|
|
415
|
-
* Default: 0
|
|
451
|
+
* Default: `0`.
|
|
416
452
|
*/
|
|
417
453
|
minlength?: number;
|
|
418
454
|
/**
|
|
419
455
|
* Maximum number of characters that can be entered in the input.
|
|
420
|
-
* Default:
|
|
456
|
+
* Default: `Infinity`.
|
|
421
457
|
*/
|
|
422
458
|
maxlength?: number;
|
|
423
459
|
};
|
|
@@ -437,7 +473,7 @@ export type BooleanFieldProps = {
|
|
|
437
473
|
/**
|
|
438
474
|
* Boolean field definition.
|
|
439
475
|
*/
|
|
440
|
-
export type BooleanField = CommonFieldProps & BooleanFieldProps & AdjacentLabelProps;
|
|
476
|
+
export type BooleanField = CommonFieldProps & StandardFieldProps & BooleanFieldProps & AdjacentLabelProps;
|
|
441
477
|
/**
|
|
442
478
|
* Code field properties.
|
|
443
479
|
*/
|
|
@@ -478,7 +514,7 @@ export type CodeFieldProps = {
|
|
|
478
514
|
/**
|
|
479
515
|
* Code field definition.
|
|
480
516
|
*/
|
|
481
|
-
export type CodeField = CommonFieldProps & CodeFieldProps;
|
|
517
|
+
export type CodeField = CommonFieldProps & StandardFieldProps & CodeFieldProps;
|
|
482
518
|
/**
|
|
483
519
|
* Color field properties.
|
|
484
520
|
*/
|
|
@@ -505,7 +541,7 @@ export type ColorFieldProps = {
|
|
|
505
541
|
/**
|
|
506
542
|
* Color field definition.
|
|
507
543
|
*/
|
|
508
|
-
export type ColorField = CommonFieldProps & ColorFieldProps;
|
|
544
|
+
export type ColorField = CommonFieldProps & StandardFieldProps & ColorFieldProps;
|
|
509
545
|
/**
|
|
510
546
|
* Compute field properties.
|
|
511
547
|
*/
|
|
@@ -522,7 +558,7 @@ export type ComputeFieldProps = {
|
|
|
522
558
|
/**
|
|
523
559
|
* Compute field definition.
|
|
524
560
|
*/
|
|
525
|
-
export type ComputeField = CommonFieldProps & ComputeFieldProps;
|
|
561
|
+
export type ComputeField = CommonFieldProps & StandardFieldProps & ComputeFieldProps;
|
|
526
562
|
/**
|
|
527
563
|
* DateTime field properties.
|
|
528
564
|
*/
|
|
@@ -561,7 +597,7 @@ export type DateTimeFieldProps = {
|
|
|
561
597
|
/**
|
|
562
598
|
* DateTime field definition.
|
|
563
599
|
*/
|
|
564
|
-
export type DateTimeField = CommonFieldProps & DateTimeFieldProps;
|
|
600
|
+
export type DateTimeField = CommonFieldProps & StandardFieldProps & DateTimeFieldProps;
|
|
565
601
|
/**
|
|
566
602
|
* File field properties.
|
|
567
603
|
*/
|
|
@@ -574,7 +610,7 @@ export type FileFieldProps = {
|
|
|
574
610
|
/**
|
|
575
611
|
* File field definition.
|
|
576
612
|
*/
|
|
577
|
-
export type FileField = CommonFieldProps & MediaFieldProps & FileFieldProps;
|
|
613
|
+
export type FileField = CommonFieldProps & StandardFieldProps & MediaFieldProps & FileFieldProps;
|
|
578
614
|
/**
|
|
579
615
|
* Hidden field properties.
|
|
580
616
|
*/
|
|
@@ -592,7 +628,7 @@ export type HiddenFieldProps = {
|
|
|
592
628
|
/**
|
|
593
629
|
* Hidden field definition.
|
|
594
630
|
*/
|
|
595
|
-
export type HiddenField = CommonFieldProps & HiddenFieldProps;
|
|
631
|
+
export type HiddenField = CommonFieldProps & StandardFieldProps & HiddenFieldProps;
|
|
596
632
|
/**
|
|
597
633
|
* Image field properties.
|
|
598
634
|
*/
|
|
@@ -605,7 +641,7 @@ export type ImageFieldProps = {
|
|
|
605
641
|
/**
|
|
606
642
|
* Image field definition.
|
|
607
643
|
*/
|
|
608
|
-
export type ImageField = CommonFieldProps & MediaFieldProps & ImageFieldProps;
|
|
644
|
+
export type ImageField = CommonFieldProps & StandardFieldProps & MediaFieldProps & ImageFieldProps;
|
|
609
645
|
/**
|
|
610
646
|
* KeyValue field properties.
|
|
611
647
|
*/
|
|
@@ -630,7 +666,7 @@ export type KeyValueFieldProps = {
|
|
|
630
666
|
/**
|
|
631
667
|
* KeyValue field definition.
|
|
632
668
|
*/
|
|
633
|
-
export type KeyValueField = CommonFieldProps & KeyValueFieldProps & MultiValueFieldProps;
|
|
669
|
+
export type KeyValueField = CommonFieldProps & StandardFieldProps & KeyValueFieldProps & MultiValueFieldProps;
|
|
634
670
|
/**
|
|
635
671
|
* List field properties.
|
|
636
672
|
*/
|
|
@@ -694,7 +730,7 @@ export type ListFieldProps = {
|
|
|
694
730
|
/**
|
|
695
731
|
* List field definition.
|
|
696
732
|
*/
|
|
697
|
-
export type ListField = CommonFieldProps & ListFieldProps & MultiValueFieldProps & VariableFieldProps;
|
|
733
|
+
export type ListField = CommonFieldProps & StandardFieldProps & ListFieldProps & MultiValueFieldProps & VariableFieldProps;
|
|
698
734
|
/**
|
|
699
735
|
* Map field properties.
|
|
700
736
|
*/
|
|
@@ -709,18 +745,18 @@ export type MapFieldProps = {
|
|
|
709
745
|
*/
|
|
710
746
|
default?: string;
|
|
711
747
|
/**
|
|
712
|
-
* Precision of coordinates to be saved. Default: 7
|
|
748
|
+
* Precision of coordinates to be saved. Default: `7`.
|
|
713
749
|
*/
|
|
714
750
|
decimals?: number;
|
|
715
751
|
/**
|
|
716
|
-
* Geometry type. Default: Point
|
|
752
|
+
* Geometry type. Default: `Point`.
|
|
717
753
|
*/
|
|
718
754
|
type?: "Point" | "LineString" | "Polygon";
|
|
719
755
|
};
|
|
720
756
|
/**
|
|
721
757
|
* Map field definition.
|
|
722
758
|
*/
|
|
723
|
-
export type MapField = CommonFieldProps & MapFieldProps;
|
|
759
|
+
export type MapField = CommonFieldProps & StandardFieldProps & MapFieldProps;
|
|
724
760
|
/**
|
|
725
761
|
* Supported button name for the rich text editor.
|
|
726
762
|
*/
|
|
@@ -781,7 +817,7 @@ export type MarkdownFieldProps = {
|
|
|
781
817
|
/**
|
|
782
818
|
* Markdown field definition.
|
|
783
819
|
*/
|
|
784
|
-
export type MarkdownField = CommonFieldProps & MarkdownFieldProps;
|
|
820
|
+
export type MarkdownField = CommonFieldProps & StandardFieldProps & MarkdownFieldProps;
|
|
785
821
|
/**
|
|
786
822
|
* Number field properties.
|
|
787
823
|
*/
|
|
@@ -799,22 +835,22 @@ export type NumberFieldProps = {
|
|
|
799
835
|
*/
|
|
800
836
|
value_type?: "int" | "float" | string;
|
|
801
837
|
/**
|
|
802
|
-
* Minimum value that can be entered in the input. Default:
|
|
838
|
+
* Minimum value that can be entered in the input. Default: `-Infinity`.
|
|
803
839
|
*/
|
|
804
840
|
min?: number;
|
|
805
841
|
/**
|
|
806
|
-
* Maximum value that can be entered in the input. Default:
|
|
842
|
+
* Maximum value that can be entered in the input. Default: `Infinity`.
|
|
807
843
|
*/
|
|
808
844
|
max?: number;
|
|
809
845
|
/**
|
|
810
|
-
* Number to increase/decrease with the arrow key/button. Default: 1
|
|
846
|
+
* Number to increase/decrease with the arrow key/button. Default: `1`.
|
|
811
847
|
*/
|
|
812
848
|
step?: number;
|
|
813
849
|
};
|
|
814
850
|
/**
|
|
815
851
|
* Number field definition.
|
|
816
852
|
*/
|
|
817
|
-
export type NumberField = CommonFieldProps & NumberFieldProps & AdjacentLabelProps;
|
|
853
|
+
export type NumberField = CommonFieldProps & StandardFieldProps & NumberFieldProps & AdjacentLabelProps;
|
|
818
854
|
/**
|
|
819
855
|
* Object field properties.
|
|
820
856
|
*/
|
|
@@ -845,7 +881,7 @@ export type ObjectFieldProps = {
|
|
|
845
881
|
/**
|
|
846
882
|
* Object field definition.
|
|
847
883
|
*/
|
|
848
|
-
export type ObjectField = CommonFieldProps & ObjectFieldProps & VariableFieldProps;
|
|
884
|
+
export type ObjectField = CommonFieldProps & StandardFieldProps & ObjectFieldProps & VariableFieldProps;
|
|
849
885
|
/**
|
|
850
886
|
* Entry filter options for a Relation field.
|
|
851
887
|
*/
|
|
@@ -907,7 +943,7 @@ export type RelationFieldProps = {
|
|
|
907
943
|
/**
|
|
908
944
|
* Relation field definition.
|
|
909
945
|
*/
|
|
910
|
-
export type RelationField = CommonFieldProps & RelationFieldProps & MultiOptionFieldProps;
|
|
946
|
+
export type RelationField = CommonFieldProps & StandardFieldProps & RelationFieldProps & MultiOptionFieldProps;
|
|
911
947
|
/**
|
|
912
948
|
* Select field properties.
|
|
913
949
|
*/
|
|
@@ -932,7 +968,7 @@ export type SelectFieldProps = {
|
|
|
932
968
|
/**
|
|
933
969
|
* Select field definition.
|
|
934
970
|
*/
|
|
935
|
-
export type SelectField = CommonFieldProps & SelectFieldProps & MultiOptionFieldProps;
|
|
971
|
+
export type SelectField = CommonFieldProps & StandardFieldProps & SelectFieldProps & MultiOptionFieldProps;
|
|
936
972
|
/**
|
|
937
973
|
* String field properties.
|
|
938
974
|
*/
|
|
@@ -940,14 +976,14 @@ export type StringFieldProps = {
|
|
|
940
976
|
/**
|
|
941
977
|
* Widget name.
|
|
942
978
|
*/
|
|
943
|
-
widget
|
|
979
|
+
widget?: "string";
|
|
944
980
|
/**
|
|
945
981
|
* Default value.
|
|
946
982
|
*/
|
|
947
983
|
default?: string;
|
|
948
984
|
/**
|
|
949
985
|
* Data type. It’s useful when the input value needs a
|
|
950
|
-
* validation. Default: text
|
|
986
|
+
* validation. Default: `text`.
|
|
951
987
|
*/
|
|
952
988
|
type?: "text" | "url" | "email";
|
|
953
989
|
/**
|
|
@@ -962,7 +998,7 @@ export type StringFieldProps = {
|
|
|
962
998
|
/**
|
|
963
999
|
* String field definition.
|
|
964
1000
|
*/
|
|
965
|
-
export type StringField = CommonFieldProps & StringFieldProps & AdjacentLabelProps & CharCountProps;
|
|
1001
|
+
export type StringField = CommonFieldProps & StandardFieldProps & StringFieldProps & AdjacentLabelProps & CharCountProps;
|
|
966
1002
|
/**
|
|
967
1003
|
* Text field properties.
|
|
968
1004
|
*/
|
|
@@ -979,7 +1015,7 @@ export type TextFieldProps = {
|
|
|
979
1015
|
/**
|
|
980
1016
|
* Text field definition.
|
|
981
1017
|
*/
|
|
982
|
-
export type TextField = CommonFieldProps & TextFieldProps & CharCountProps;
|
|
1018
|
+
export type TextField = CommonFieldProps & StandardFieldProps & TextFieldProps & CharCountProps;
|
|
983
1019
|
/**
|
|
984
1020
|
* UUID field properties.
|
|
985
1021
|
*/
|
|
@@ -1008,15 +1044,24 @@ export type UuidFieldProps = {
|
|
|
1008
1044
|
/**
|
|
1009
1045
|
* UUID field definition.
|
|
1010
1046
|
*/
|
|
1011
|
-
export type UuidField = CommonFieldProps & UuidFieldProps;
|
|
1047
|
+
export type UuidField = CommonFieldProps & StandardFieldProps & UuidFieldProps;
|
|
1012
1048
|
/**
|
|
1013
1049
|
* Entry field using a built-in widget.
|
|
1014
1050
|
*/
|
|
1015
1051
|
export type StandardField = BooleanField | CodeField | ColorField | ComputeField | DateTimeField | FileField | HiddenField | ImageField | KeyValueField | ListField | MapField | MarkdownField | NumberField | ObjectField | RelationField | SelectField | StringField | TextField | UuidField;
|
|
1016
1052
|
/**
|
|
1017
|
-
*
|
|
1053
|
+
* Custom field properties.
|
|
1018
1054
|
*/
|
|
1019
|
-
export type
|
|
1055
|
+
export type CustomFieldProps = {
|
|
1056
|
+
/**
|
|
1057
|
+
* Widget name.
|
|
1058
|
+
*/
|
|
1059
|
+
widget: string;
|
|
1060
|
+
};
|
|
1061
|
+
/**
|
|
1062
|
+
* Entry field using a custom widget.
|
|
1063
|
+
*/
|
|
1064
|
+
export type CustomField = CommonFieldProps & CustomFieldProps;
|
|
1020
1065
|
/**
|
|
1021
1066
|
* Entry field.
|
|
1022
1067
|
*/
|
|
@@ -1127,12 +1172,6 @@ export type CollectionFile = {
|
|
|
1127
1172
|
* I18n options. Default: `false`.
|
|
1128
1173
|
*/
|
|
1129
1174
|
i18n?: I18nOptions | boolean;
|
|
1130
|
-
/**
|
|
1131
|
-
* A special option to make this file a divider UI in the singleton
|
|
1132
|
-
* file list. Default: `false`. Not supported in a file collection. If `true`, other options will be
|
|
1133
|
-
* ignored, but you still have to provide a unique `name`.
|
|
1134
|
-
*/
|
|
1135
|
-
divider?: boolean;
|
|
1136
1175
|
/**
|
|
1137
1176
|
* Preview URL path template.
|
|
1138
1177
|
*/
|
|
@@ -1250,7 +1289,7 @@ export type EditorOptions = {
|
|
|
1250
1289
|
export type NestedCollectionOptions = {
|
|
1251
1290
|
/**
|
|
1252
1291
|
* Maximum depth to show nested items in the collection tree. Default:
|
|
1253
|
-
*
|
|
1292
|
+
* `Infinity`.
|
|
1254
1293
|
*/
|
|
1255
1294
|
depth?: number;
|
|
1256
1295
|
/**
|
|
@@ -1313,6 +1352,23 @@ export type CollectionIndexFile = {
|
|
|
1313
1352
|
*/
|
|
1314
1353
|
editor?: EditorOptions;
|
|
1315
1354
|
};
|
|
1355
|
+
/**
|
|
1356
|
+
* A divider in the collection list and singleton list.
|
|
1357
|
+
*/
|
|
1358
|
+
export type CollectionDivider = {
|
|
1359
|
+
/**
|
|
1360
|
+
* Unique identifier for the divider. Can be omitted, but it must be
|
|
1361
|
+
* unique across all the collections and singletons. This property is included here because in the
|
|
1362
|
+
* previous version of Sveltia CMS, a divider was defined as a collection with the `divider` option
|
|
1363
|
+
* set to `true`, and the `name` option was required.
|
|
1364
|
+
*/
|
|
1365
|
+
name?: string;
|
|
1366
|
+
/**
|
|
1367
|
+
* Whether to make this collection a divider UI in the collection list.
|
|
1368
|
+
* It must be `true` to be used as a divider.
|
|
1369
|
+
*/
|
|
1370
|
+
divider: boolean;
|
|
1371
|
+
};
|
|
1316
1372
|
/**
|
|
1317
1373
|
* A raw collection defined in the configuration file. Note: In Sveltia CMS, a folder collection is
|
|
1318
1374
|
* called an entry collection.
|
|
@@ -1417,7 +1473,7 @@ export type Collection = {
|
|
|
1417
1473
|
slug?: string;
|
|
1418
1474
|
/**
|
|
1419
1475
|
* The maximum number of characters allowed for an entry slug.
|
|
1420
|
-
* Entry collection only. Default:
|
|
1476
|
+
* Entry collection only. Default: `Infinity`.
|
|
1421
1477
|
*/
|
|
1422
1478
|
slug_length?: number;
|
|
1423
1479
|
/**
|
|
@@ -1478,12 +1534,6 @@ export type Collection = {
|
|
|
1478
1534
|
* options.
|
|
1479
1535
|
*/
|
|
1480
1536
|
yaml_quote?: boolean;
|
|
1481
|
-
/**
|
|
1482
|
-
* A special option to make this collection a divider UI in the
|
|
1483
|
-
* collection list. Default: `false`. If `true`, other options will be ignored, but you still have
|
|
1484
|
-
* to provide a unique `name`.
|
|
1485
|
-
*/
|
|
1486
|
-
divider?: boolean;
|
|
1487
1537
|
/**
|
|
1488
1538
|
* A field key path to be used to find an
|
|
1489
1539
|
* entry thumbnail displayed on the entry list. A nested field can be specified using dot notation,
|
|
@@ -1494,7 +1544,7 @@ export type Collection = {
|
|
|
1494
1544
|
thumbnail?: FieldKeyPath | FieldKeyPath[];
|
|
1495
1545
|
/**
|
|
1496
1546
|
* The maximum number of entries that can be created in the collection.
|
|
1497
|
-
* Entry collection only. Default:
|
|
1547
|
+
* Entry collection only. Default: `Infinity`.
|
|
1498
1548
|
*/
|
|
1499
1549
|
limit?: number;
|
|
1500
1550
|
};
|
|
@@ -1623,7 +1673,7 @@ export type BackendOptions = {
|
|
|
1623
1673
|
/**
|
|
1624
1674
|
* Whether to enable or disable automatic deployments
|
|
1625
1675
|
* with any connected CI/CD provider, such as GitHub Actions or Cloudflare Pages. If `false`, the
|
|
1626
|
-
* `[skip ci]` prefix will be added to commit messages. Git backends only. Default: undefined
|
|
1676
|
+
* `[skip ci]` prefix will be added to commit messages. Git backends only. Default: `undefined`. See
|
|
1627
1677
|
* https://github.com/sveltia/sveltia-cms#disabling-automatic-deployments for details.
|
|
1628
1678
|
*/
|
|
1629
1679
|
automatic_deployments?: boolean;
|
|
@@ -1663,7 +1713,7 @@ export type JsonFormatOptions = {
|
|
|
1663
1713
|
*/
|
|
1664
1714
|
indent_style?: "space" | "tab";
|
|
1665
1715
|
/**
|
|
1666
|
-
* Indent size. Default: 2
|
|
1716
|
+
* Indent size. Default: `2`.
|
|
1667
1717
|
*/
|
|
1668
1718
|
indent_size?: number;
|
|
1669
1719
|
};
|
|
@@ -1672,7 +1722,7 @@ export type JsonFormatOptions = {
|
|
|
1672
1722
|
*/
|
|
1673
1723
|
export type YamlFormatOptions = {
|
|
1674
1724
|
/**
|
|
1675
|
-
* Indent size. Default: 2
|
|
1725
|
+
* Indent size. Default: `2`.
|
|
1676
1726
|
*/
|
|
1677
1727
|
indent_size?: number;
|
|
1678
1728
|
/**
|
|
@@ -1770,15 +1820,16 @@ export type SiteConfig = {
|
|
|
1770
1820
|
*/
|
|
1771
1821
|
slug?: SlugOptions;
|
|
1772
1822
|
/**
|
|
1773
|
-
* Set of collections.
|
|
1823
|
+
* Set of collections. The list can also
|
|
1824
|
+
* contain dividers, which are used to group collections in the collection list.
|
|
1774
1825
|
*/
|
|
1775
|
-
collections: Collection[];
|
|
1826
|
+
collections: (Collection | CollectionDivider)[];
|
|
1776
1827
|
/**
|
|
1777
|
-
* Set of singleton files, such as
|
|
1778
|
-
* file or the homepage file. They are not part of any collection and can be
|
|
1779
|
-
* through the collection list.
|
|
1828
|
+
* Set of singleton files, such as
|
|
1829
|
+
* the site configuration file or the homepage file. They are not part of any collection and can be
|
|
1830
|
+
* accessed directly through the collection list. The list can also contain dividers.
|
|
1780
1831
|
*/
|
|
1781
|
-
singletons?: CollectionFile[];
|
|
1832
|
+
singletons?: (CollectionFile | CollectionDivider)[];
|
|
1782
1833
|
/**
|
|
1783
1834
|
* Global i18n options.
|
|
1784
1835
|
*/
|