@cloudcannon/configuration-types 0.0.14 → 0.0.16

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.
@@ -137,11 +137,6 @@
137
137
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
138
138
  "markdownDescription": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values."
139
139
  },
140
- "preview": {
141
- "$ref": "#/definitions/ObjectPreview",
142
- "description": "The preview definition for changing the way data within an array input's items are previewed before being expanded. If the input has structures, the preview from the structure value is used instead.",
143
- "markdownDescription": "The preview definition for changing the way data within an array input's items are previewed\nbefore being expanded. If the input has structures, the preview from the structure value is\nused instead."
144
- },
145
140
  "structures": {
146
141
  "anyOf": [
147
142
  {
@@ -611,10 +606,26 @@
611
606
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
612
607
  "markdownDescription": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values."
613
608
  },
609
+ "picker_preview": {
610
+ "$ref": "#/definitions/Preview",
611
+ "description": "Changes the way items are previewed in the CMS while being chosen.",
612
+ "markdownDescription": "Changes the way items are previewed in the CMS while being chosen."
613
+ },
614
+ "picker_view": {
615
+ "description": "Controls how selectable options are rendered.",
616
+ "enum": [
617
+ "card",
618
+ "text",
619
+ "gallery",
620
+ "gallery-left"
621
+ ],
622
+ "markdownDescription": "Controls how selectable options are rendered.",
623
+ "type": "string"
624
+ },
614
625
  "preview": {
615
- "$ref": "#/definitions/SelectPreview",
616
- "description": "The preview definition for changing the way selected and available options are displayed.",
617
- "markdownDescription": "The preview definition for changing the way selected and available options are displayed."
626
+ "$ref": "#/definitions/Preview",
627
+ "description": "Changes the way items are previewed in the CMS.",
628
+ "markdownDescription": "Changes the way items are previewed in the CMS."
618
629
  },
619
630
  "value_key": {
620
631
  "description": "Defines the key used for mapping between saved values and objects in values. This changes how the input saves selected values to match. Defaults to checking for \"id\", \"uuid\", \"path\", \"title\", then \"name\". Has no effect unless values is an array of objects, the key is used instead for objects, and the value itself is used for primitive types.",
@@ -625,6 +636,17 @@
625
636
  "$ref": "#/definitions/SelectValues",
626
637
  "description": "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).",
627
638
  "markdownDescription": "Defines the values available to choose from. Optional, defaults to fetching values from the\nnaming convention (e.g. colors or my_colors for data set colors)."
639
+ },
640
+ "view": {
641
+ "description": "Controls how selected items are rendered.",
642
+ "enum": [
643
+ "card",
644
+ "text",
645
+ "gallery",
646
+ "gallery-left"
647
+ ],
648
+ "markdownDescription": "Controls how selected items are rendered.",
649
+ "type": "string"
628
650
  }
629
651
  },
630
652
  "type": "object"
@@ -857,7 +879,7 @@
857
879
  },
858
880
  "disable_url": {
859
881
  "description": "Prevents this collection from being assigned output URLs. Doing so will remove the Visual Editor as a possible option, and hide any UI elements referring to the output URL for a file.",
860
- "markdownDescription": "Prevents this collection from being assigned output URLs. Doing so will remove the\nVisual Editor as a possible option, and hide any UI elements referring to the output URL for a file.",
882
+ "markdownDescription": "Prevents this collection from being assigned output URLs. Doing so will remove the Visual\nEditor as a possible option, and hide any UI elements referring to the output URL for a file.",
861
883
  "type": "boolean"
862
884
  },
863
885
  "documentation": {
@@ -885,6 +907,11 @@
885
907
  "description": "Sets an icon to use alongside references to this collection.",
886
908
  "markdownDescription": "Sets an icon to use alongside references to this collection."
887
909
  },
910
+ "include_developer_files": {
911
+ "description": "If set, includes files usually reserved for your SSG and developer tooling as part of this collection. These files can then be filtered with `glob`.",
912
+ "markdownDescription": "If set, includes files usually reserved for your SSG and developer tooling as part of this\ncollection. These files can then be filtered with `glob`.",
913
+ "type": "boolean"
914
+ },
888
915
  "name": {
889
916
  "description": "The display name of this collection. Used in headings and in the context menu for items in the collection. This is optional as CloudCannon auto-generates this from the collection key.",
890
917
  "markdownDescription": "The display name of this collection. Used in headings and in the context menu for items in the\ncollection. This is optional as CloudCannon auto-generates this from the collection key.",
@@ -1332,9 +1359,6 @@
1332
1359
  "type": "string"
1333
1360
  }
1334
1361
  },
1335
- "required": [
1336
- "path"
1337
- ],
1338
1362
  "type": "object"
1339
1363
  },
1340
1364
  "DataConfigEntry": {
@@ -5298,10 +5322,26 @@
5298
5322
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
5299
5323
  "markdownDescription": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values."
5300
5324
  },
5325
+ "picker_preview": {
5326
+ "$ref": "#/definitions/Preview",
5327
+ "description": "Changes the way items are previewed in the CMS while being chosen.",
5328
+ "markdownDescription": "Changes the way items are previewed in the CMS while being chosen."
5329
+ },
5330
+ "picker_view": {
5331
+ "description": "Controls how selectable options are rendered.",
5332
+ "enum": [
5333
+ "card",
5334
+ "text",
5335
+ "gallery",
5336
+ "gallery-left"
5337
+ ],
5338
+ "markdownDescription": "Controls how selectable options are rendered.",
5339
+ "type": "string"
5340
+ },
5301
5341
  "preview": {
5302
- "$ref": "#/definitions/SelectPreview",
5303
- "description": "The preview definition for changing the way selected and available options are displayed.",
5304
- "markdownDescription": "The preview definition for changing the way selected and available options are displayed."
5342
+ "$ref": "#/definitions/Preview",
5343
+ "description": "Changes the way items are previewed in the CMS.",
5344
+ "markdownDescription": "Changes the way items are previewed in the CMS."
5305
5345
  },
5306
5346
  "value_key": {
5307
5347
  "description": "Defines the key used for mapping between saved values and objects in values. This changes how the input saves selected values to match. Defaults to checking for \"id\", \"uuid\", \"path\", \"title\", then \"name\". Has no effect unless values is an array of objects, the key is used instead for objects, and the value itself is used for primitive types.",
@@ -5312,6 +5352,17 @@
5312
5352
  "$ref": "#/definitions/SelectValues",
5313
5353
  "description": "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).",
5314
5354
  "markdownDescription": "Defines the values available to choose from. Optional, defaults to fetching values from the\nnaming convention (e.g. colors or my_colors for data set colors)."
5355
+ },
5356
+ "view": {
5357
+ "description": "Controls how selected items are rendered.",
5358
+ "enum": [
5359
+ "card",
5360
+ "text",
5361
+ "gallery",
5362
+ "gallery-left"
5363
+ ],
5364
+ "markdownDescription": "Controls how selected items are rendered.",
5365
+ "type": "string"
5315
5366
  }
5316
5367
  },
5317
5368
  "type": "object"
@@ -5417,6 +5468,27 @@
5417
5468
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
5418
5469
  "markdownDescription": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values."
5419
5470
  },
5471
+ "picker_preview": {
5472
+ "$ref": "#/definitions/Preview",
5473
+ "description": "Changes the way items are previewed in the CMS while being chosen.",
5474
+ "markdownDescription": "Changes the way items are previewed in the CMS while being chosen."
5475
+ },
5476
+ "picker_view": {
5477
+ "description": "Controls how selectable options are rendered.",
5478
+ "enum": [
5479
+ "card",
5480
+ "text",
5481
+ "gallery",
5482
+ "gallery-left"
5483
+ ],
5484
+ "markdownDescription": "Controls how selectable options are rendered.",
5485
+ "type": "string"
5486
+ },
5487
+ "preview": {
5488
+ "$ref": "#/definitions/Preview",
5489
+ "description": "Changes the way items are previewed in the CMS.",
5490
+ "markdownDescription": "Changes the way items are previewed in the CMS."
5491
+ },
5420
5492
  "value_key": {
5421
5493
  "description": "Defines the key used for mapping between saved values and objects in values. This changes how the input saves selected values to match. Defaults to checking for \"id\", \"uuid\", \"path\", \"title\", then \"name\". Has no effect unless values is an array of objects, the key is used instead for objects, and the value itself is used for primitive types.",
5422
5494
  "markdownDescription": "Defines the key used for mapping between saved values and objects in values. This changes how\nthe input saves selected values to match. Defaults to checking for \"id\", \"uuid\", \"path\",\n\"title\", then \"name\". Has no effect unless values is an array of objects, the key is used\ninstead for objects, and the value itself is used for primitive types.",
@@ -5426,6 +5498,17 @@
5426
5498
  "$ref": "#/definitions/SelectValues",
5427
5499
  "description": "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).",
5428
5500
  "markdownDescription": "Defines the values available to choose from. Optional, defaults to fetching values from the\nnaming convention (e.g. colors or my_colors for data set colors)."
5501
+ },
5502
+ "view": {
5503
+ "description": "Controls how selected items are rendered.",
5504
+ "enum": [
5505
+ "card",
5506
+ "text",
5507
+ "gallery",
5508
+ "gallery-left"
5509
+ ],
5510
+ "markdownDescription": "Controls how selected items are rendered.",
5511
+ "type": "string"
5429
5512
  }
5430
5513
  },
5431
5514
  "type": "object"
@@ -5708,9 +5791,9 @@
5708
5791
  "type": "boolean"
5709
5792
  },
5710
5793
  "preview": {
5711
- "$ref": "#/definitions/ObjectPreview",
5712
- "description": "The preview definition for changing the way data within an object input is previewed before being expanded. If the input has `structures`, the preview from the structure value is used instead.",
5713
- "markdownDescription": "The preview definition for changing the way data within an object input is previewed before\nbeing expanded. If the input has `structures`, the preview from the structure value is used\ninstead."
5794
+ "$ref": "#/definitions/Preview",
5795
+ "description": "Changes the way items are previewed in the CMS.",
5796
+ "markdownDescription": "Changes the way items are previewed in the CMS."
5714
5797
  },
5715
5798
  "structures": {
5716
5799
  "anyOf": [
@@ -5737,32 +5820,6 @@
5737
5820
  },
5738
5821
  "type": "object"
5739
5822
  },
5740
- "ObjectPreview": {
5741
- "additionalProperties": false,
5742
- "properties": {
5743
- "icon": {
5744
- "$ref": "#/definitions/PreviewEntry",
5745
- "description": "Controls the icon shown per item. Must result in a Material Icon name.",
5746
- "markdownDescription": "Controls the icon shown per item. Must result in a Material Icon name."
5747
- },
5748
- "image": {
5749
- "$ref": "#/definitions/PreviewEntry",
5750
- "description": "Controls the image shown per item.",
5751
- "markdownDescription": "Controls the image shown per item."
5752
- },
5753
- "subtext": {
5754
- "$ref": "#/definitions/PreviewEntry",
5755
- "description": "Controls the supporting text shown per item.",
5756
- "markdownDescription": "Controls the supporting text shown per item."
5757
- },
5758
- "text": {
5759
- "$ref": "#/definitions/PreviewEntry",
5760
- "description": "Controls the main text shown per item.",
5761
- "markdownDescription": "Controls the main text shown per item."
5762
- }
5763
- },
5764
- "type": "object"
5765
- },
5766
5823
  "Paths": {
5767
5824
  "additionalProperties": false,
5768
5825
  "properties": {
@@ -6646,6 +6703,27 @@
6646
6703
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
6647
6704
  "markdownDescription": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values."
6648
6705
  },
6706
+ "picker_preview": {
6707
+ "$ref": "#/definitions/Preview",
6708
+ "description": "Changes the way items are previewed in the CMS while being chosen.",
6709
+ "markdownDescription": "Changes the way items are previewed in the CMS while being chosen."
6710
+ },
6711
+ "picker_view": {
6712
+ "description": "Controls how selectable options are rendered.",
6713
+ "enum": [
6714
+ "card",
6715
+ "text",
6716
+ "gallery",
6717
+ "gallery-left"
6718
+ ],
6719
+ "markdownDescription": "Controls how selectable options are rendered.",
6720
+ "type": "string"
6721
+ },
6722
+ "preview": {
6723
+ "$ref": "#/definitions/Preview",
6724
+ "description": "Changes the way items are previewed in the CMS.",
6725
+ "markdownDescription": "Changes the way items are previewed in the CMS."
6726
+ },
6649
6727
  "value_key": {
6650
6728
  "description": "Defines the key used for mapping between saved values and objects in values. This changes how the input saves selected values to match. Defaults to checking for \"id\", \"uuid\", \"path\", \"title\", then \"name\". Has no effect unless values is an array of objects, the key is used instead for objects, and the value itself is used for primitive types.",
6651
6729
  "markdownDescription": "Defines the key used for mapping between saved values and objects in values. This changes how\nthe input saves selected values to match. Defaults to checking for \"id\", \"uuid\", \"path\",\n\"title\", then \"name\". Has no effect unless values is an array of objects, the key is used\ninstead for objects, and the value itself is used for primitive types.",
@@ -6655,22 +6733,17 @@
6655
6733
  "$ref": "#/definitions/SelectValues",
6656
6734
  "description": "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).",
6657
6735
  "markdownDescription": "Defines the values available to choose from. Optional, defaults to fetching values from the\nnaming convention (e.g. colors or my_colors for data set colors)."
6658
- }
6659
- },
6660
- "type": "object"
6661
- },
6662
- "SelectPreview": {
6663
- "additionalProperties": false,
6664
- "properties": {
6665
- "icon": {
6666
- "$ref": "#/definitions/PreviewEntry",
6667
- "description": "Controls the icon shown per item. Must result in a Material Icon name.",
6668
- "markdownDescription": "Controls the icon shown per item. Must result in a Material Icon name."
6669
6736
  },
6670
- "text": {
6671
- "$ref": "#/definitions/PreviewEntry",
6672
- "description": "Controls the main text shown per item.",
6673
- "markdownDescription": "Controls the main text shown per item."
6737
+ "view": {
6738
+ "description": "Controls how selected items are rendered.",
6739
+ "enum": [
6740
+ "card",
6741
+ "text",
6742
+ "gallery",
6743
+ "gallery-left"
6744
+ ],
6745
+ "markdownDescription": "Controls how selected items are rendered.",
6746
+ "type": "string"
6674
6747
  }
6675
6748
  },
6676
6749
  "type": "object"
@@ -7369,6 +7442,14 @@
7369
7442
  "markdownDescription": "If set to true, this item will be considered the default type for this structure. If the type\nof a value within a structure cannot be inferred based on its id_key or matching fields, then\nit will fall back to this item. If multiple items have default set to true, only the first item\nwill be used.",
7370
7443
  "type": "boolean"
7371
7444
  },
7445
+ "groups": {
7446
+ "description": "Allows you to group the inputs inside this object together without changing the data structure.",
7447
+ "items": {
7448
+ "$ref": "#/definitions/ObjectInputGroup"
7449
+ },
7450
+ "markdownDescription": "Allows you to group the inputs inside this object together without changing the data structure.",
7451
+ "type": "array"
7452
+ },
7372
7453
  "hide_extra_inputs": {
7373
7454
  "default": false,
7374
7455
  "description": "Hides unexpected inputs when editing. Has no effect if `remove_extra_inputs` is true.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcannon/configuration-types",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
5
5
  "author": "CloudCannon <support@cloudcannon.com>",
6
6
  "license": "MIT",
@@ -787,7 +787,10 @@ export interface ImageInput extends BaseInput<ImageInputOptions> {
787
787
  type: 'image';
788
788
  }
789
789
 
790
- export interface SelectInputOptions<EmptyType = EmptyTypeText> extends BaseInputOptions<EmptyType> {
790
+ export interface SelectInputOptions<EmptyType = EmptyTypeText>
791
+ extends BaseInputOptions<EmptyType>,
792
+ Previewable,
793
+ PickerPreviewable {
791
794
  /**
792
795
  * Allows new text values to be created at edit time.
793
796
  *
@@ -812,6 +815,14 @@ export interface SelectInputOptions<EmptyType = EmptyTypeText> extends BaseInput
812
815
  * instead for objects, and the value itself is used for primitive types.
813
816
  */
814
817
  value_key?: string;
818
+ /**
819
+ * Controls how selected items are rendered.
820
+ */
821
+ view?: 'card' | 'text' | 'gallery' | 'gallery-left';
822
+ /**
823
+ * Controls how selectable options are rendered.
824
+ */
825
+ picker_view?: 'card' | 'text' | 'gallery' | 'gallery-left';
815
826
  }
816
827
 
817
828
  export interface SelectInput extends BaseInput<SelectInputOptions> {
@@ -825,12 +836,7 @@ export interface MultiselectInput extends BaseInput<MultiselectInputOptions> {
825
836
  }
826
837
 
827
838
  export interface ChoiceInputOptions<EmptyType = EmptyTypeText>
828
- extends Omit<SelectInputOptions<EmptyType>, 'allow_create'> {
829
- /**
830
- * The preview definition for changing the way selected and available options are displayed.
831
- */
832
- preview?: SelectPreview;
833
- }
839
+ extends Omit<SelectInputOptions<EmptyType>, 'allow_create'> {}
834
840
 
835
841
  export interface ChoiceInput extends BaseInput<ChoiceInputOptions> {
836
842
  type: 'choice';
@@ -850,7 +856,7 @@ export interface ObjectInputGroup {
850
856
  documentation?: Documentation;
851
857
  }
852
858
 
853
- export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject> {
859
+ export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject>, Previewable {
854
860
  /**
855
861
  * Changes the appearance and behavior of the input.
856
862
  */
@@ -877,12 +883,6 @@ export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject> {
877
883
  */
878
884
  structures?: string | Structure;
879
885
  };
880
- /**
881
- * The preview definition for changing the way data within an object input is previewed before
882
- * being expanded. If the input has `structures`, the preview from the structure value is used
883
- * instead.
884
- */
885
- preview?: ObjectPreview;
886
886
  /**
887
887
  * Provides data formats for value of this object. When choosing an item, team members are
888
888
  * prompted to choose from a number of values you have defined. `structures` applies to the object
@@ -911,12 +911,6 @@ export interface ObjectInput extends BaseInput<ObjectInputOptions> {
911
911
  }
912
912
 
913
913
  export interface ArrayInputOptions extends BaseInputOptions<EmptyTypeArray> {
914
- /**
915
- * The preview definition for changing the way data within an array input's items are previewed
916
- * before being expanded. If the input has structures, the preview from the structure value is
917
- * used instead.
918
- */
919
- preview?: ObjectPreview;
920
914
  /**
921
915
  * Provides data formats for value of this object. When choosing an item, team members are
922
916
  * prompted to choose from a number of values you have defined.
@@ -1055,6 +1049,7 @@ export interface PreviewGallery
1055
1049
  extends TextPreviewable,
1056
1050
  ImagePreviewable,
1057
1051
  IconPreviewable,
1052
+ IconColorPreviewable,
1058
1053
  IconColorPreviewable {
1059
1054
  /**
1060
1055
  * Controls how the gallery image is positioned within the gallery.
@@ -1068,14 +1063,6 @@ export interface PreviewMetadata
1068
1063
  IconPreviewable,
1069
1064
  IconColorPreviewable {}
1070
1065
 
1071
- export interface ObjectPreview
1072
- extends TextPreviewable,
1073
- ImagePreviewable,
1074
- IconPreviewable,
1075
- SubtextPreviewable {}
1076
-
1077
- export interface SelectPreview extends TextPreviewable, IconPreviewable {}
1078
-
1079
1066
  export interface Preview
1080
1067
  extends TextPreviewable,
1081
1068
  ImagePreviewable,
@@ -1204,7 +1191,7 @@ export interface Create extends ReducedCascade {
1204
1191
  * The raw template to be processed when creating files. Relative to the containing collection's
1205
1192
  * path.
1206
1193
  */
1207
- path: string;
1194
+ path?: string;
1208
1195
  /**
1209
1196
  * Adds to the available data placeholders coming from the file. Entry values follow the same
1210
1197
  * format as path, and are processed sequentially before path. These values are not saved back to
@@ -1233,10 +1220,15 @@ export interface CollectionConfig extends Cascade, Previewable {
1233
1220
  */
1234
1221
  url?: string;
1235
1222
  /**
1236
- * Prevents this collection from being assigned output URLs. Doing so will remove the
1237
- * Visual Editor as a possible option, and hide any UI elements referring to the output URL for a file.
1223
+ * Prevents this collection from being assigned output URLs. Doing so will remove the Visual
1224
+ * Editor as a possible option, and hide any UI elements referring to the output URL for a file.
1238
1225
  */
1239
1226
  disable_url?: boolean;
1227
+ /**
1228
+ * If set, includes files usually reserved for your SSG and developer tooling as part of this
1229
+ * collection. These files can then be filtered with `glob`.
1230
+ */
1231
+ include_developer_files?: boolean;
1240
1232
  /**
1241
1233
  * The display name of this collection. Used in headings and in the context menu for items in the
1242
1234
  * collection. This is optional as CloudCannon auto-generates this from the collection key.
@@ -1407,6 +1399,10 @@ export interface StructureValue extends Previewable, PickerPreviewable, Schemali
1407
1399
  * Used to group and filter items when selecting from a modal.
1408
1400
  */
1409
1401
  tags?: string[];
1402
+ /**
1403
+ * Allows you to group the inputs inside this object together without changing the data structure.
1404
+ */
1405
+ groups?: ObjectInputGroup[];
1410
1406
  /**
1411
1407
  * The actual value used when items are added after selection.
1412
1408
  */