@cloudcannon/configuration-types 0.0.15 → 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"
@@ -5300,10 +5322,26 @@
5300
5322
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
5301
5323
  "markdownDescription": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values."
5302
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
+ },
5303
5341
  "preview": {
5304
- "$ref": "#/definitions/SelectPreview",
5305
- "description": "The preview definition for changing the way selected and available options are displayed.",
5306
- "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."
5307
5345
  },
5308
5346
  "value_key": {
5309
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.",
@@ -5314,6 +5352,17 @@
5314
5352
  "$ref": "#/definitions/SelectValues",
5315
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).",
5316
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"
5317
5366
  }
5318
5367
  },
5319
5368
  "type": "object"
@@ -5419,6 +5468,27 @@
5419
5468
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
5420
5469
  "markdownDescription": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values."
5421
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
+ },
5422
5492
  "value_key": {
5423
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.",
5424
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.",
@@ -5428,6 +5498,17 @@
5428
5498
  "$ref": "#/definitions/SelectValues",
5429
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).",
5430
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"
5431
5512
  }
5432
5513
  },
5433
5514
  "type": "object"
@@ -5710,9 +5791,9 @@
5710
5791
  "type": "boolean"
5711
5792
  },
5712
5793
  "preview": {
5713
- "$ref": "#/definitions/ObjectPreview",
5714
- "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.",
5715
- "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."
5716
5797
  },
5717
5798
  "structures": {
5718
5799
  "anyOf": [
@@ -5739,32 +5820,6 @@
5739
5820
  },
5740
5821
  "type": "object"
5741
5822
  },
5742
- "ObjectPreview": {
5743
- "additionalProperties": false,
5744
- "properties": {
5745
- "icon": {
5746
- "$ref": "#/definitions/PreviewEntry",
5747
- "description": "Controls the icon shown per item. Must result in a Material Icon name.",
5748
- "markdownDescription": "Controls the icon shown per item. Must result in a Material Icon name."
5749
- },
5750
- "image": {
5751
- "$ref": "#/definitions/PreviewEntry",
5752
- "description": "Controls the image shown per item.",
5753
- "markdownDescription": "Controls the image shown per item."
5754
- },
5755
- "subtext": {
5756
- "$ref": "#/definitions/PreviewEntry",
5757
- "description": "Controls the supporting text shown per item.",
5758
- "markdownDescription": "Controls the supporting text shown per item."
5759
- },
5760
- "text": {
5761
- "$ref": "#/definitions/PreviewEntry",
5762
- "description": "Controls the main text shown per item.",
5763
- "markdownDescription": "Controls the main text shown per item."
5764
- }
5765
- },
5766
- "type": "object"
5767
- },
5768
5823
  "Paths": {
5769
5824
  "additionalProperties": false,
5770
5825
  "properties": {
@@ -6648,6 +6703,27 @@
6648
6703
  "description": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values.",
6649
6704
  "markdownDescription": "Set how an ‘empty’ value will be saved. Does not apply to existing empty values."
6650
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
+ },
6651
6727
  "value_key": {
6652
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.",
6653
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.",
@@ -6657,22 +6733,17 @@
6657
6733
  "$ref": "#/definitions/SelectValues",
6658
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).",
6659
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)."
6660
- }
6661
- },
6662
- "type": "object"
6663
- },
6664
- "SelectPreview": {
6665
- "additionalProperties": false,
6666
- "properties": {
6667
- "icon": {
6668
- "$ref": "#/definitions/PreviewEntry",
6669
- "description": "Controls the icon shown per item. Must result in a Material Icon name.",
6670
- "markdownDescription": "Controls the icon shown per item. Must result in a Material Icon name."
6671
6736
  },
6672
- "text": {
6673
- "$ref": "#/definitions/PreviewEntry",
6674
- "description": "Controls the main text shown per item.",
6675
- "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"
6676
6747
  }
6677
6748
  },
6678
6749
  "type": "object"
@@ -7371,6 +7442,14 @@
7371
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.",
7372
7443
  "type": "boolean"
7373
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
+ },
7374
7453
  "hide_extra_inputs": {
7375
7454
  "default": false,
7376
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.15",
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,
@@ -1412,6 +1399,10 @@ export interface StructureValue extends Previewable, PickerPreviewable, Schemali
1412
1399
  * Used to group and filter items when selecting from a modal.
1413
1400
  */
1414
1401
  tags?: string[];
1402
+ /**
1403
+ * Allows you to group the inputs inside this object together without changing the data structure.
1404
+ */
1405
+ groups?: ObjectInputGroup[];
1415
1406
  /**
1416
1407
  * The actual value used when items are added after selection.
1417
1408
  */