@cloudcannon/configuration-types 0.0.4 → 0.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcannon/configuration-types",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
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",
package/src/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export type EditorKey = 'visual' | 'content' | 'data';
12
12
  export type SortOrder = 'ascending' | 'descending' | 'asc' | 'desc';
13
13
 
14
14
  // TODO: use SnippetConfig from @cloudcannon/scrap-booker when ParserConfig issue resolved.
15
- interface SnippetConfig extends ReducedCascade, Previewable, PickerPreviewable {
15
+ export interface SnippetConfig extends ReducedCascade, Previewable, PickerPreviewable {
16
16
  /**
17
17
  * Name of the snippet.
18
18
  */
@@ -184,12 +184,12 @@ interface ImageResizeable {
184
184
  * A number suffixed with "x" (relative size) or "w" (fixed width) for setting the dimensions of
185
185
  * the image (e.g. 2x, 3x, 100w, 360w).
186
186
  */
187
- size: 'string';
187
+ size: string;
188
188
  /**
189
189
  * A reference to another input that is given the path to this additional image file.
190
190
  */
191
- target?: 'string';
192
- };
191
+ target?: string;
192
+ }[];
193
193
  }
194
194
 
195
195
  export interface Editables {
@@ -466,10 +466,7 @@ export interface BaseInputOptions<EmptyType = EmptyTypeText> {
466
466
  }
467
467
 
468
468
  export interface BaseInput<InputOptions = BaseInputOptions> {
469
- /**
470
- * Controls the type of input, changing how it is displayed and interacted with.
471
- */
472
- type?: InputType;
469
+ type?: InputType | undefined | null;
473
470
  /**
474
471
  * Changes the subtext below the _Label_. Has no default. Supports a limited set of Markdown:
475
472
  * links, bold, italic, subscript, superscript, and inline code elements are allowed.
@@ -670,6 +667,11 @@ export interface FileInputOptions extends BaseInputOptions, WithReducedPaths {
670
667
  * Restricts which file types are available to select or upload to this input.
671
668
  */
672
669
  accepts_mime_types?: MimeType[] | '*';
670
+ /**
671
+ * If you have one or more DAMs connected to your site, you can use this key to list which asset
672
+ * sources can be uploaded to and selected from.
673
+ */
674
+ allowed_sources?: string[];
673
675
  }
674
676
 
675
677
  export interface FileInput extends BaseInput<FileInputOptions> {
@@ -737,6 +739,14 @@ export interface MultichoiceInput extends BaseInput<MultichoiceInputOptions> {
737
739
  type: 'multichoice';
738
740
  }
739
741
 
742
+ export interface ObjectInputGroup {
743
+ heading?: string;
744
+ comment?: string;
745
+ collapsed?: boolean;
746
+ inputs?: string[];
747
+ documentation?: Documentation;
748
+ }
749
+
740
750
  export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject> {
741
751
  /**
742
752
  * Changes the appearance and behavior of the input.
@@ -776,6 +786,21 @@ export interface ObjectInputOptions extends BaseInputOptions<EmptyTypeObject> {
776
786
  * itself.
777
787
  */
778
788
  structures?: string | Structure;
789
+
790
+ /**
791
+ * Allows you to group the inputs inside this object together without changing the data structure.
792
+ */
793
+ groups?: ObjectInputGroup[];
794
+
795
+ /**
796
+ * Controls which order input groups and ungrouped inputs appear in.
797
+ */
798
+ place_groups_below?: boolean;
799
+
800
+ /**
801
+ * Controls whether or not labels on mutable object entries are formatted.
802
+ */
803
+ allow_label_formatting?: boolean;
779
804
  }
780
805
 
781
806
  export interface ObjectInput extends BaseInput<ObjectInputOptions> {
@@ -800,8 +825,13 @@ export interface ArrayInput extends BaseInput<ArrayInputOptions> {
800
825
  type: 'array';
801
826
  }
802
827
 
828
+ export interface UnknownInput extends BaseInput<BaseInputOptions> {
829
+ type?: undefined | null;
830
+ }
831
+
803
832
  export type Input =
804
833
  | BaseInput
834
+ | UnknownInput
805
835
  | TextInput
806
836
  | CodeInput
807
837
  | ColorInput
@@ -852,6 +882,10 @@ export interface ReducedPaths {
852
882
  * @default ''
853
883
  */
854
884
  dam_static?: string;
885
+ /**
886
+ * When set to true, CloudCannon will reference files relative to the path of the file they were uploaded to.
887
+ */
888
+ uploads_use_relative_path?: boolean;
855
889
  }
856
890
 
857
891
  export interface Paths extends ReducedPaths {