@griddo/core 1.75.249 → 1.75.251

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.
@@ -2,66 +2,69 @@ import { BaseUI } from "./base";
2
2
  import { ConfigTabs, Dimension } from "./props";
3
3
  import { Fields } from "../..";
4
4
  import { UIFields } from "../schema-fields/ui-fields";
5
- export interface BaseDefault {
6
- /** Component or module name of this schema. */
7
- component: string;
8
- [key: string]: unknown;
9
- }
10
- export interface MultiPageModuleDefault extends BaseDefault {
11
- /** Required prop as `true` for MultiPage Modules */
12
- hasGriddoMultiPage: true;
13
- /** ComponentArray required prop for Multipage Modules */
14
- elements: Array<unknown>;
15
- }
16
- export interface MultiPageComponentDefault extends BaseDefault {
17
- /** ComponentArray required prop for Multipage Modules */
18
- title: Fields.Text;
19
- sectionSlug: Fields.Text;
20
- metaTitle: Fields.Text;
21
- metaDescription: Fields.Text;
22
- }
23
- export interface ContentTypeModuleDefault extends BaseDefault {
24
- /** Required prop as `true` for ContentType Modules */
25
- hasDistributorData: true;
26
- /** `data` prop requierd for ContentType modules */
27
- data: {
28
- /** Array with the structured data types that the field has to load. */
29
- source: Array<string>;
30
- /** Default selection type for the reference field */
31
- mode: "auto" | "manual";
32
- /** Default Order criteria */
33
- order: string;
34
- /** Default Item quantity */
35
- quantity: number;
36
- };
37
- }
38
- export interface ComponentAndModuleBase<WhiteListElements, SectionList> extends BaseUI<SectionList> {
5
+ export interface ComponentAndModuleBase extends BaseUI {
39
6
  /** Type of schema. */
40
7
  schemaType: "component" | "module" | "template";
41
8
  /** Array of objects that represent each of the tabs of the component, module or template in the Griddo editor where the form fields for data entry will be displayed. */
42
- configTabs: Array<ConfigTabs<WhiteListElements>>;
9
+ configTabs: Array<ConfigTabs>;
43
10
  }
44
- export interface Component<WhiteListElements = unknown> extends ComponentAndModuleBase<WhiteListElements, unknown> {
11
+ export interface Component<ComponentProps = unknown> extends ComponentAndModuleBase {
45
12
  schemaType: "component";
46
- default: BaseDefault;
13
+ default: {
14
+ component: string;
15
+ [key: string]: any;
16
+ } & ComponentProps;
47
17
  }
48
- export interface MultiPageComponent<WhiteListElements = unknown> extends ComponentAndModuleBase<WhiteListElements, unknown> {
18
+ export interface MultiPageComponent<MultiPageComponentProps = unknown> extends ComponentAndModuleBase {
49
19
  schemaType: "component";
50
- default: MultiPageComponentDefault;
20
+ default: {
21
+ /** Component or module name of this schema. */
22
+ component: string;
23
+ /** ComponentArray required prop for Multipage Modules */
24
+ title: Fields.Text;
25
+ sectionSlug: Fields.Text;
26
+ metaTitle: Fields.Text;
27
+ metaDescription: Fields.Text;
28
+ [key: string]: any;
29
+ } & MultiPageComponentProps;
51
30
  }
52
- export interface Module<WhiteListElements = unknown, SectionList = unknown> extends ComponentAndModuleBase<WhiteListElements, SectionList> {
31
+ export interface Module<ModuleProps = unknown> extends ComponentAndModuleBase {
53
32
  schemaType: "module";
54
- default: BaseDefault;
33
+ default: {
34
+ component: string;
35
+ [key: string]: any;
36
+ } & ModuleProps;
55
37
  }
56
- export interface MultiPageModule<WhiteListElements = unknown, SectionList = unknown> extends ComponentAndModuleBase<WhiteListElements, SectionList> {
38
+ export interface MultiPageModule<MultiPageModuleProps = unknown> extends ComponentAndModuleBase {
57
39
  schemaType: "module";
58
- default: MultiPageModuleDefault;
40
+ default: {
41
+ /** Component or module name of this schema. */
42
+ component: string;
43
+ /** Required prop as `true` for MultiPage Modules */
44
+ hasGriddoMultiPage: true;
45
+ /** ComponentArray required prop for Multipage Modules */
46
+ elements: Array<unknown>;
47
+ [key: string]: any;
48
+ } & MultiPageModuleProps;
59
49
  }
60
- export interface ContentTypeModule<WhiteListElements = unknown, SectionList = unknown> extends ComponentAndModuleBase<WhiteListElements, SectionList> {
50
+ export interface ContentTypeModule<ContentTypeModuleProps = unknown> extends ComponentAndModuleBase {
61
51
  schemaType: "module";
62
- default: ContentTypeModuleDefault;
52
+ default: {
53
+ /** Component or module name of this schema. */
54
+ component: string;
55
+ /** Required prop as `true` for ContentType Modules */
56
+ hasDistributorData: true;
57
+ /** `data` prop requierd for ContentType modules */
58
+ data: ContentTypeModuleProps extends {
59
+ data?: any;
60
+ } ? ContentTypeModuleProps["data"] : Omit<Fields.Reference<unknown>, "source" | "mode"> & {
61
+ mode: "auto" | "manual";
62
+ source?: Array<string>;
63
+ };
64
+ [key: string]: any;
65
+ } & ContentTypeModuleProps;
63
66
  }
64
- export interface TemplateBase<WhiteListElements = unknown> extends BaseUI {
67
+ export interface TemplateBase extends BaseUI {
65
68
  /** Template Schema. */
66
69
  schemaType: "template";
67
70
  /** Indicates the type of Schema for the template: List, Detail, 404, etc. */
@@ -78,23 +81,28 @@ export interface TemplateBase<WhiteListElements = unknown> extends BaseUI {
78
81
  /** Array of key-values that are bound to a page and used to be sent to the dataLayer (Analytics) when the page loads. */
79
82
  dimensions?: Array<Dimension>;
80
83
  /** Array of fields for the content tab. */
81
- content: Array<UIFields<WhiteListElements>>;
84
+ content: Array<UIFields>;
82
85
  /** Array of fields for the config tab. */
83
- config?: Array<UIFields<WhiteListElements>>;
84
- }
85
- export interface TemplateDefaultBase {
86
- type: "template";
87
- templateType: string;
88
- [key: string]: unknown;
89
- }
90
- export interface ListTemplateDefault extends TemplateDefaultBase {
91
- hasDistributorData: true;
92
- itemsPerPage: number;
93
- activePage: number;
86
+ config?: Array<UIFields>;
94
87
  }
95
- export interface Template<WhiteListElements = unknown> extends TemplateBase<WhiteListElements> {
96
- default: TemplateDefaultBase;
88
+ export interface Template<TemplateProps = any> extends TemplateBase {
89
+ default: {
90
+ type: "template";
91
+ templateType: TemplateProps extends {
92
+ component: string;
93
+ } ? TemplateProps["component"] : string;
94
+ [key: string]: any;
95
+ } & Omit<TemplateProps, "component">;
97
96
  }
98
- export interface ListTemplate<WhiteListElements = unknown> extends TemplateBase<WhiteListElements> {
99
- default: ListTemplateDefault;
97
+ export interface ListTemplate<TemplateProps = any> extends TemplateBase {
98
+ default: {
99
+ type: "template";
100
+ templateType: TemplateProps extends {
101
+ component: string;
102
+ } ? TemplateProps["component"] : string;
103
+ hasDistributorData: true;
104
+ itemsPerPage: number;
105
+ activePage: number;
106
+ [key: string]: any;
107
+ } & Omit<TemplateProps, "component">;
100
108
  }
@@ -29,8 +29,7 @@ interface BaseContentType extends _AutoTypes {
29
29
  /** Field default values. */
30
30
  defaultValues?: unknown;
31
31
  }
32
- type BaseSectionList = Record<string, Array<string>>;
33
- interface BaseUI<SectionList = BaseSectionList> extends DataPacks, _AutoTypes {
32
+ interface BaseUI extends DataPacks, _AutoTypes {
34
33
  /** Sets the schema type. For internal use. */
35
34
  schemaType: string;
36
35
  /** If `true` it will only be possible to create one page of this type of template. */
@@ -42,7 +41,7 @@ interface BaseUI<SectionList = BaseSectionList> extends DataPacks, _AutoTypes {
42
41
  /** Name to represent the component, module or template in the Griddo editor interface. */
43
42
  displayName: string;
44
43
  /** WhiteList indicating which section of a template a module may appear. You may want to use this prop if the module is related to a DataPack. */
45
- sectionList?: SectionList;
44
+ sectionList?: Record<string, Array<string>>;
46
45
  /** Images that represent the component, module or template in the Griddo editor. */
47
46
  thumbnails?: Thumbnails | {
48
47
  [key: string]: Thumbnails;
@@ -23,11 +23,11 @@ type Thumbnails = {
23
23
  /** Thumbnail for 2x density screens. */
24
24
  "2x"?: unknown;
25
25
  };
26
- interface ConfigTabs<WhiteListElements = unknown> {
26
+ interface ConfigTabs {
27
27
  /** Title that will appear on the tab in the Griddo editor. */
28
28
  title: "content" | "config" | (string & {});
29
29
  /** Array of Griddo fields. */
30
- fields: Array<UIFields<WhiteListElements>>;
30
+ fields: Array<UIFields>;
31
31
  }
32
32
  interface _AutoTypes {
33
33
  _autoType?: {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@griddo/core",
3
3
  "description": "Reload version of Griddo Core",
4
4
  "license": "UNLICENSED",
5
- "version": "1.75.249",
5
+ "version": "1.75.251",
6
6
  "authors": [
7
7
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
8
8
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -78,5 +78,5 @@
78
78
  "resolutions": {
79
79
  "colors": "1.4.0"
80
80
  },
81
- "gitHead": "eb9aac88a24fb9f2a38c305c175adb7dc76d04d0"
81
+ "gitHead": "1f3a11d826a73aa9eb045a272caf9967feec0348"
82
82
  }