@griddo/core 10.2.6 → 10.2.8

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.
@@ -63,7 +63,7 @@ declare function getGenericFromWhitelist(whiteList: Array<string>, config?: Auto
63
63
  * [ {component: "BasicContent"}, {component: "NewsTemplate"}, ... ]
64
64
  */
65
65
  declare function schemasToArray(objectSchemas: Record<string, SchemaType>): ({
66
- component: string;
66
+ component: Capitalize<string>;
67
67
  taxonomy: false;
68
68
  fromPage: true;
69
69
  schema: import("../../types/schema-fields/props").SearchFrom & {
@@ -93,11 +93,11 @@ declare function schemasToArray(objectSchemas: Record<string, SchemaType>): ({
93
93
  _autoType?: {
94
94
  relations?: boolean | "off" | "simple" | "full" | undefined;
95
95
  } | undefined;
96
- dataPacks?: string[] | null | undefined;
96
+ dataPacks?: [__AT__.Datapacks, ...__AT__.Datapacks[]] | null | undefined;
97
97
  expirationDateField?: string | undefined;
98
98
  expirationDateOffset?: number | undefined;
99
99
  } | {
100
- component: string;
100
+ component: Capitalize<string>;
101
101
  fromPage: false;
102
102
  schema: import("../../types/schema-fields/props").SearchFrom & {
103
103
  fields: [import("../../types/schema-fields/base").BaseTextField & import("../../types/schema-fields/props").WithIsMockup & import("../../types/schema-fields/props").WithValidators & import("../../types/schema-fields/props").WithReadonly & import("../../types/schema-fields/props").WithSlugTo & import("../../types/schema-fields/props").WithPrefix & import("../../types/schema-fields/props").WithPlaceHolder & import("../../types/schema-fields/props").WithIndexable & import("../../types/schema-fields/props").WithShowList & import("../../types/schema-fields/props").WithHelpText & import("../../types/schema-fields/props").WithHumanReadable & import("../../types/schema-fields/props").WithSearchable & {
@@ -126,34 +126,43 @@ declare function schemasToArray(objectSchemas: Record<string, SchemaType>): ({
126
126
  _autoType?: {
127
127
  relations?: boolean | "off" | "simple" | "full" | undefined;
128
128
  } | undefined;
129
- dataPacks?: string[] | null | undefined;
129
+ dataPacks?: [__AT__.Datapacks, ...__AT__.Datapacks[]] | null | undefined;
130
130
  expirationDateField?: string | undefined;
131
131
  expirationDateOffset?: number | undefined;
132
132
  } | {
133
- component: string;
133
+ component: Capitalize<string>;
134
134
  schemaType: "component";
135
135
  default: {
136
136
  [key: string]: any;
137
- component: string;
137
+ component: Capitalize<string>;
138
138
  };
139
139
  configTabs: import("../../types/schemas/props").ConfigTabs[];
140
+ /**
141
+ * Return a serialized type from a Griddo schema field.
142
+ *
143
+ * @param Fields A Griddo field object
144
+ * @param options An options object
145
+ * @returns A string that represent a interface prop type.
146
+ * @example
147
+ * interface SomeInterface {
148
+ * prop: boolean; // this function returns a string for this: `prop: boolean`
149
+ * }
150
+ */
140
151
  singleInstance?: boolean | undefined;
141
- category?: string | undefined;
152
+ category?: any;
142
153
  displayName: string;
143
- sectionList?: Record<string, string[]> | undefined;
144
- thumbnails?: import("../../types/schemas/props").Thumbnails | {
145
- [key: string]: import("../../types/schemas/props").Thumbnails;
146
- } | undefined;
147
- dataPacks?: string[] | null | undefined;
154
+ sectionList?: any;
155
+ thumbnails?: import("../../types/schemas/props").Thumbnails | Record<__AT__.Themes, import("../../types/schemas/props").Thumbnails> | undefined;
156
+ dataPacks?: [__AT__.Datapacks, ...__AT__.Datapacks[]] | null | undefined;
148
157
  _autoType?: {
149
158
  relations?: boolean | "off" | "simple" | "full" | undefined;
150
159
  } | undefined;
151
160
  } | {
152
- component: string;
161
+ component: Capitalize<string>;
153
162
  schemaType: "module";
154
163
  default: {
155
164
  [key: string]: any;
156
- component: string;
165
+ component: Capitalize<string>;
157
166
  hasDistributorData: true;
158
167
  data: Omit<import("../../types/api-response-fields").Reference<unknown>, "source" | "mode"> & {
159
168
  mode: "auto" | "manual";
@@ -161,59 +170,86 @@ declare function schemasToArray(objectSchemas: Record<string, SchemaType>): ({
161
170
  };
162
171
  };
163
172
  configTabs: import("../../types/schemas/props").ConfigTabs[];
173
+ /**
174
+ * Return a serialized type from a Griddo schema field.
175
+ *
176
+ * @param Fields A Griddo field object
177
+ * @param options An options object
178
+ * @returns A string that represent a interface prop type.
179
+ * @example
180
+ * interface SomeInterface {
181
+ * prop: boolean; // this function returns a string for this: `prop: boolean`
182
+ * }
183
+ */
164
184
  singleInstance?: boolean | undefined;
165
- category?: string | undefined;
185
+ category?: any;
166
186
  displayName: string;
167
- sectionList?: Record<string, string[]> | undefined;
168
- thumbnails?: import("../../types/schemas/props").Thumbnails | {
169
- [key: string]: import("../../types/schemas/props").Thumbnails;
170
- } | undefined;
171
- dataPacks?: string[] | null | undefined;
187
+ sectionList?: any;
188
+ thumbnails?: import("../../types/schemas/props").Thumbnails | Record<__AT__.Themes, import("../../types/schemas/props").Thumbnails> | undefined;
189
+ dataPacks?: [__AT__.Datapacks, ...__AT__.Datapacks[]] | null | undefined;
172
190
  _autoType?: {
173
191
  relations?: boolean | "off" | "simple" | "full" | undefined;
174
192
  } | undefined;
175
193
  } | {
176
- component: string;
194
+ component: Capitalize<string>;
177
195
  schemaType: "module";
178
196
  default: {
179
197
  [key: string]: any;
180
- component: string;
198
+ component: Capitalize<string>;
181
199
  hasGriddoMultiPage: true;
182
200
  elements: unknown[];
183
201
  };
184
202
  configTabs: import("../../types/schemas/props").ConfigTabs[];
203
+ /**
204
+ * Return a serialized type from a Griddo schema field.
205
+ *
206
+ * @param Fields A Griddo field object
207
+ * @param options An options object
208
+ * @returns A string that represent a interface prop type.
209
+ * @example
210
+ * interface SomeInterface {
211
+ * prop: boolean; // this function returns a string for this: `prop: boolean`
212
+ * }
213
+ */
185
214
  singleInstance?: boolean | undefined;
186
- category?: string | undefined;
215
+ category?: any;
187
216
  displayName: string;
188
- sectionList?: Record<string, string[]> | undefined;
189
- thumbnails?: import("../../types/schemas/props").Thumbnails | {
190
- [key: string]: import("../../types/schemas/props").Thumbnails;
191
- } | undefined;
192
- dataPacks?: string[] | null | undefined;
217
+ sectionList?: any;
218
+ thumbnails?: import("../../types/schemas/props").Thumbnails | Record<__AT__.Themes, import("../../types/schemas/props").Thumbnails> | undefined;
219
+ dataPacks?: [__AT__.Datapacks, ...__AT__.Datapacks[]] | null | undefined;
193
220
  _autoType?: {
194
221
  relations?: boolean | "off" | "simple" | "full" | undefined;
195
222
  } | undefined;
196
223
  } | {
197
- component: string;
224
+ component: Capitalize<string>;
198
225
  schemaType: "module";
199
226
  default: {
200
227
  [key: string]: any;
201
- component: string;
228
+ component: Capitalize<string>;
202
229
  };
203
230
  configTabs: import("../../types/schemas/props").ConfigTabs[];
231
+ /**
232
+ * Return a serialized type from a Griddo schema field.
233
+ *
234
+ * @param Fields A Griddo field object
235
+ * @param options An options object
236
+ * @returns A string that represent a interface prop type.
237
+ * @example
238
+ * interface SomeInterface {
239
+ * prop: boolean; // this function returns a string for this: `prop: boolean`
240
+ * }
241
+ */
204
242
  singleInstance?: boolean | undefined;
205
- category?: string | undefined;
243
+ category?: any;
206
244
  displayName: string;
207
- sectionList?: Record<string, string[]> | undefined;
208
- thumbnails?: import("../../types/schemas/props").Thumbnails | {
209
- [key: string]: import("../../types/schemas/props").Thumbnails;
210
- } | undefined;
211
- dataPacks?: string[] | null | undefined;
245
+ sectionList?: any;
246
+ thumbnails?: import("../../types/schemas/props").Thumbnails | Record<__AT__.Themes, import("../../types/schemas/props").Thumbnails> | undefined;
247
+ dataPacks?: [__AT__.Datapacks, ...__AT__.Datapacks[]] | null | undefined;
212
248
  _autoType?: {
213
249
  relations?: boolean | "off" | "simple" | "full" | undefined;
214
250
  } | undefined;
215
251
  } | {
216
- component: string;
252
+ component: Capitalize<string>;
217
253
  default: {
218
254
  [key: string]: any;
219
255
  type: "template";
@@ -229,19 +265,28 @@ declare function schemasToArray(objectSchemas: Record<string, SchemaType>): ({
229
265
  dimensions?: import("../../types/schemas/props").Dimension[] | undefined;
230
266
  content: UIFields[];
231
267
  config?: UIFields[] | undefined;
268
+ /**
269
+ * Return a serialized type from a Griddo schema field.
270
+ *
271
+ * @param Fields A Griddo field object
272
+ * @param options An options object
273
+ * @returns A string that represent a interface prop type.
274
+ * @example
275
+ * interface SomeInterface {
276
+ * prop: boolean; // this function returns a string for this: `prop: boolean`
277
+ * }
278
+ */
232
279
  singleInstance?: boolean | undefined;
233
- category?: string | undefined;
280
+ category?: any;
234
281
  displayName: string;
235
- sectionList?: Record<string, string[]> | undefined;
236
- thumbnails?: import("../../types/schemas/props").Thumbnails | {
237
- [key: string]: import("../../types/schemas/props").Thumbnails;
238
- } | undefined;
239
- dataPacks?: string[] | null | undefined;
282
+ sectionList?: any;
283
+ thumbnails?: import("../../types/schemas/props").Thumbnails | Record<__AT__.Themes, import("../../types/schemas/props").Thumbnails> | undefined;
284
+ dataPacks?: [__AT__.Datapacks, ...__AT__.Datapacks[]] | null | undefined;
240
285
  _autoType?: {
241
286
  relations?: boolean | "off" | "simple" | "full" | undefined;
242
287
  } | undefined;
243
288
  } | {
244
- component: string;
289
+ component: Capitalize<string>;
245
290
  default: {
246
291
  [key: string]: any;
247
292
  type: "template";
@@ -260,14 +305,23 @@ declare function schemasToArray(objectSchemas: Record<string, SchemaType>): ({
260
305
  dimensions?: import("../../types/schemas/props").Dimension[] | undefined;
261
306
  content: UIFields[];
262
307
  config?: UIFields[] | undefined;
308
+ /**
309
+ * Return a serialized type from a Griddo schema field.
310
+ *
311
+ * @param Fields A Griddo field object
312
+ * @param options An options object
313
+ * @returns A string that represent a interface prop type.
314
+ * @example
315
+ * interface SomeInterface {
316
+ * prop: boolean; // this function returns a string for this: `prop: boolean`
317
+ * }
318
+ */
263
319
  singleInstance?: boolean | undefined;
264
- category?: string | undefined;
320
+ category?: any;
265
321
  displayName: string;
266
- sectionList?: Record<string, string[]> | undefined;
267
- thumbnails?: import("../../types/schemas/props").Thumbnails | {
268
- [key: string]: import("../../types/schemas/props").Thumbnails;
269
- } | undefined;
270
- dataPacks?: string[] | null | undefined;
322
+ sectionList?: any;
323
+ thumbnails?: import("../../types/schemas/props").Thumbnails | Record<__AT__.Themes, import("../../types/schemas/props").Thumbnails> | undefined;
324
+ dataPacks?: [__AT__.Datapacks, ...__AT__.Datapacks[]] | null | undefined;
271
325
  _autoType?: {
272
326
  relations?: boolean | "off" | "simple" | "full" | undefined;
273
327
  } | undefined;
@@ -24,7 +24,7 @@ declare function useThemeColors(themeFile: Theme.GriddoTheme, props?: UseThemeCo
24
24
  description?: string | undefined;
25
25
  })[];
26
26
  preferColorScheme: true;
27
- id: "global";
27
+ id: string;
28
28
  name: string;
29
29
  selector: ":root";
30
30
  description?: string | undefined;
@@ -49,7 +49,7 @@ declare function useThemeColors(themeFile: Theme.GriddoTheme, props?: UseThemeCo
49
49
  description?: string | undefined;
50
50
  })[];
51
51
  preferColorScheme?: false | undefined;
52
- id: "global";
52
+ id: string;
53
53
  name: string;
54
54
  selector: ":root";
55
55
  description?: string | undefined;
@@ -24,7 +24,7 @@ declare function useThemeFont(themeFile: Theme.GriddoTheme, props?: UseThemeFont
24
24
  description?: string | undefined;
25
25
  })[];
26
26
  preferColorScheme: true;
27
- id: "global";
27
+ id: string;
28
28
  name: string;
29
29
  selector: ":root";
30
30
  description?: string | undefined;
@@ -49,7 +49,7 @@ declare function useThemeFont(themeFile: Theme.GriddoTheme, props?: UseThemeFont
49
49
  description?: string | undefined;
50
50
  })[];
51
51
  preferColorScheme?: false | undefined;
52
- id: "global";
52
+ id: string;
53
53
  name: string;
54
54
  selector: ":root";
55
55
  description?: string | undefined;
@@ -24,7 +24,7 @@ declare function useThemePrimitives(themeFile: Theme.GriddoTheme, props: UseThem
24
24
  description?: string | undefined;
25
25
  })[];
26
26
  preferColorScheme: true;
27
- id: "global";
27
+ id: string;
28
28
  name: string;
29
29
  selector: ":root";
30
30
  description?: string | undefined;
@@ -49,7 +49,7 @@ declare function useThemePrimitives(themeFile: Theme.GriddoTheme, props: UseThem
49
49
  description?: string | undefined;
50
50
  })[];
51
51
  preferColorScheme?: false | undefined;
52
- id: "global";
52
+ id: string;
53
53
  name: string;
54
54
  selector: ":root";
55
55
  description?: string | undefined;
@@ -17,7 +17,7 @@ export declare const filterThemePrimitivesByType: (themes: Array<Theme.GlobalThe
17
17
  description?: string | undefined;
18
18
  })[];
19
19
  preferColorScheme: true;
20
- id: "global";
20
+ id: string;
21
21
  name: string;
22
22
  selector: ":root";
23
23
  description?: string | undefined;
@@ -42,7 +42,7 @@ export declare const filterThemePrimitivesByType: (themes: Array<Theme.GlobalThe
42
42
  description?: string | undefined;
43
43
  })[];
44
44
  preferColorScheme?: false | undefined;
45
- id: "global";
45
+ id: string;
46
46
  name: string;
47
47
  selector: ":root";
48
48
  description?: string | undefined;
@@ -112,7 +112,7 @@ export declare const filterThemePrimitivesByColor: (themes: Array<Theme.GlobalTh
112
112
  description?: string | undefined;
113
113
  })[];
114
114
  preferColorScheme: true;
115
- id: "global";
115
+ id: string;
116
116
  name: string;
117
117
  selector: ":root";
118
118
  description?: string | undefined;
@@ -137,7 +137,7 @@ export declare const filterThemePrimitivesByColor: (themes: Array<Theme.GlobalTh
137
137
  description?: string | undefined;
138
138
  })[];
139
139
  preferColorScheme?: false | undefined;
140
- id: "global";
140
+ id: string;
141
141
  name: string;
142
142
  selector: ":root";
143
143
  description?: string | undefined;
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ import { UseI18nProps } from "./hooks/useI18n";
19
19
  import { CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps, UseImageProps } from "./hooks/useImage";
20
20
  import { UseListSetQueryProps, UseListSetUrlAction } from "./hooks/useList";
21
21
  import { Hideable, FiltersDataApiQueryResponseProps, HTMLHeadingTag, ListApiQueryResponseProps, PickRename, Pretty, SetQueryProps } from "./types/global";
22
+ import { NonEmptyArray } from "./types/utilities";
22
23
  import * as Fields from "./types/api-response-fields";
23
24
  import * as Core from "./types/core";
24
25
  import * as PageContentTypeFields from "./types/schema-fields/page-content-type-fields";
@@ -26,4 +27,4 @@ import * as SimpleContentTypeFields from "./types/schema-fields/simple-content-t
26
27
  import * as UIFields from "./types/schema-fields/ui-fields";
27
28
  import * as Schema from "./types/schemas";
28
29
  import * as Theme from "./types/theme";
29
- export { PageContext, PageProvider, SiteContext, SiteProvider, SessionContext, SessionProvider, SiteProviderProps, CloudinaryBackgroundImage, CloudinaryImage, Component, GriddoBackgroundImage, GriddoImage, GriddoLink, LdJson, Link, Page, Preview, UseDataFilterSetUrlAction, UseDataFiltersReturn, UseDataFiltersSetQueryProps, UseDataFiltersState, UseListSetQueryProps, CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps, GenerateImageChunkProps, ImageChunk, ImageConfig, UseListSetUrlAction, UseGriddoImageProps, GriddoImageCommonProps, GriddoImageGif, GriddoImageJpgWebpAvif, GriddoImageSvg, UseGriddoImageReturn, UseI18nProps, UseImageProps, useContentType, useDataFilters, useGlobalTheme, useGriddoImage, useI18n, useImage, useIsClient, useIsFirstRender, useLink, useList, useNavigation, usePage, useReferenceFieldData as useDistributorData, useReferenceFieldData, useContentTypeNavigation, useScript, useSession, useSite, useSitemap, useSSR, useTheme, useThemeColors, useThemeFont, useThemePrimitives, useListWithDefaultStaticPage, getLang, getSiteID, getToken, getComponent, griddoAlertRegister, GriddoAlertRegisterProps, createCategoryContentTypeSchema, createComponentSchema, createDamDefaultsSchema, createDataPackCategorySchema, createDataPackSchema, createFooterSchema, createHeaderSchema, createLanguagesSchema, createMenuSchema, createModuleCategoriesSchema, createModuleSchema, createPageContentTypeSchema, createSimpleContentTypeSchema, createTemplateSchema, createThemesSchema, createTranslationsSchema, Core, Fields, Schema, Theme, UIFields, SimpleContentTypeFields, PageContentTypeFields, CloudinaryImageProps, ComponentProps, GriddoImageProps, GriddoLinkProps, HLocation, LinkGetProps, ModulePreviewProps, PageProps, PreviewProps, WindowLocation, Hideable, FiltersDataApiQueryResponseProps, HTMLHeadingTag, ListApiQueryResponseProps, PickRename, Pretty, SetQueryProps, };
30
+ export { PageContext, PageProvider, SiteContext, SiteProvider, SessionContext, SessionProvider, SiteProviderProps, CloudinaryBackgroundImage, CloudinaryImage, Component, GriddoBackgroundImage, GriddoImage, GriddoLink, LdJson, Link, Page, Preview, UseDataFilterSetUrlAction, UseDataFiltersReturn, UseDataFiltersSetQueryProps, UseDataFiltersState, UseListSetQueryProps, CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps, GenerateImageChunkProps, ImageChunk, ImageConfig, UseListSetUrlAction, UseGriddoImageProps, GriddoImageCommonProps, GriddoImageGif, GriddoImageJpgWebpAvif, GriddoImageSvg, UseGriddoImageReturn, UseI18nProps, UseImageProps, useContentType, useDataFilters, useGlobalTheme, useGriddoImage, useI18n, useImage, useIsClient, useIsFirstRender, useLink, useList, useNavigation, usePage, useReferenceFieldData as useDistributorData, useReferenceFieldData, useContentTypeNavigation, useScript, useSession, useSite, useSitemap, useSSR, useTheme, useThemeColors, useThemeFont, useThemePrimitives, useListWithDefaultStaticPage, getLang, getSiteID, getToken, getComponent, griddoAlertRegister, GriddoAlertRegisterProps, createCategoryContentTypeSchema, createComponentSchema, createDamDefaultsSchema, createDataPackCategorySchema, createDataPackSchema, createFooterSchema, createHeaderSchema, createLanguagesSchema, createMenuSchema, createModuleCategoriesSchema, createModuleSchema, createPageContentTypeSchema, createSimpleContentTypeSchema, createTemplateSchema, createThemesSchema, createTranslationsSchema, Core, Fields, Schema, Theme, UIFields, SimpleContentTypeFields, PageContentTypeFields, CloudinaryImageProps, ComponentProps, GriddoImageProps, GriddoLinkProps, HLocation, LinkGetProps, ModulePreviewProps, PageProps, PreviewProps, WindowLocation, Hideable, FiltersDataApiQueryResponseProps, HTMLHeadingTag, ListApiQueryResponseProps, PickRename, Pretty, SetQueryProps, NonEmptyArray, };
@@ -237,7 +237,11 @@ export type TemplateSection<GriddoModule> = {
237
237
  name: string;
238
238
  modules: Array<GriddoModule>;
239
239
  };
240
- export interface SimpleContentType<ContentType> {
240
+ /**
241
+ * Base ContentType interface to extends from in SimpleContentType and
242
+ * PageContentType types.
243
+ */
244
+ export interface BaseContentType<ContentType> {
241
245
  /** Item Id */
242
246
  id?: number;
243
247
  /** ContentType content */
@@ -246,16 +250,28 @@ export interface SimpleContentType<ContentType> {
246
250
  structuredData?: ContentType extends {
247
251
  __contentTypeName: unknown;
248
252
  } ? ContentType["__contentTypeName"] : never;
253
+ dataLanguages?: Array<{
254
+ id: number;
255
+ site: number | null;
256
+ page: number;
257
+ language: number;
258
+ }>;
249
259
  }
250
- export interface PageContentType<ContentType> extends SimpleContentType<ContentType> {
260
+ export type SimpleContentType<ContentType> = BaseContentType<ContentType>;
261
+ export interface PageContentType<ContentType> extends BaseContentType<ContentType> {
251
262
  relatedPage?: {
252
263
  pageId: number;
253
264
  url?: string;
265
+ urlCanonical?: string;
254
266
  origin?: string;
255
267
  availableSites?: Array<{
256
268
  id?: number;
257
269
  name?: string;
258
270
  }>;
271
+ editable: boolean;
272
+ manuallyImported: boolean;
273
+ originalPageId: number;
274
+ originalStructuredDataId: number;
259
275
  };
260
276
  }
261
277
  type ExtraContentTypePropsInAutoType = "__contentTypeKind";
@@ -267,7 +267,7 @@ export type BackgroundImageSizesProps = {
267
267
  export type ImagePosition = "attention" | "bottom" | "center" | "entropy" | "left-bottom" | "left-top" | "left" | "right-bottom" | "right-top" | "right" | "top";
268
268
  /** Type definition for a Griddo component or a module */
269
269
  export interface LibraryComponentProps {
270
- component: string;
270
+ component: Capitalize<string>;
271
271
  [key: string]: unknown;
272
272
  }
273
273
  /** Custom object with value/keys containing static translations */
@@ -1,4 +1,5 @@
1
1
  import { WithDisabled, WithEntity, WithGroup, Option, WithSource, ThemeColors, ThemeFixedColors, ThemeVisualUniqueSelection, ThumbnailOption } from "./props";
2
+ import __AT__ from "../../../../../../autotypes";
2
3
  import { HTMLHeadingTag } from "../global";
3
4
  import { DistributiveOmit } from "../utilities";
4
5
  /** Type generator options */
@@ -86,8 +87,9 @@ interface GenericColorPicker extends GenericField {
86
87
  }
87
88
  interface DynamicColorPicker extends GenericColorPicker {
88
89
  isThemePalette?: false;
89
- /** Array of hexadecimal codes of the colors that will appear by default. It is also possible to specify a theme to customize the colors. */
90
- colors: Array<string> | Array<ThemeColors>;
90
+ /** Array of hexadecimal codes of the colors that will appear by default. It
91
+ * is also possible to specify a theme to customize the colors. */
92
+ colors: Array<`#${string}`> | Array<ThemeColors>;
91
93
  }
92
94
  interface FixedColorPicker extends GenericColorPicker {
93
95
  isThemePalette?: true;
@@ -217,7 +219,7 @@ export interface BaseReferenceField extends GenericField {
217
219
  /** Only manual mode. */
218
220
  maxItems?: number;
219
221
  /** Array with the structured data types that the field has to load. */
220
- source: Array<string>;
222
+ source: Array<__AT__.PageContentTypes | __AT__.SimpleContentTypes | __AT__.TaxonomyContentTypes>;
221
223
  }
222
224
  export interface BaseRichText extends GenericField {
223
225
  /** TextArea with simple editor that exports to markdown or html. Uses the draft.js and react-draft-wysiwyg.js libraries. */
@@ -1,3 +1,4 @@
1
+ import __AT__ from "../../../../../../autotypes";
1
2
  export type WithAuxText = {
2
3
  /** Sets a label text to show besides the toggle field control */
3
4
  auxText?: string;
@@ -87,25 +88,28 @@ export type WithSlugTo = {
87
88
  };
88
89
  export type WithSource = {
89
90
  /** Structured data type from which you have to load the options. */
90
- source: string;
91
+ source: __AT__.PageContentTypes | __AT__.SimpleContentTypes | __AT__.TaxonomyContentTypes;
91
92
  };
92
93
  export type ThemeColors = {
93
- theme: string;
94
- options: Array<string>;
94
+ theme: __AT__.Subthemes;
95
+ options: Array<`#${string}`>;
95
96
  };
96
97
  export type ThemeFixedColors = {
97
- theme: string;
98
+ theme: __AT__.Subthemes;
98
99
  options: Array<{
99
100
  name: string;
100
- hex: string;
101
+ hex: `#${string}`;
101
102
  }>;
102
103
  };
103
104
  export type ThemeVisualUniqueSelection = {
104
- theme: string;
105
- options: Array<ThumbnailOption>;
105
+ theme: __AT__.Themes;
106
+ options: Array<{
107
+ value: __AT__.Subthemes;
108
+ img: string;
109
+ }>;
106
110
  };
107
111
  export type ThumbnailOption = {
108
- value: unknown;
112
+ value: string;
109
113
  img: string;
110
114
  };
111
115
  export type WithValidators = {
@@ -127,7 +131,7 @@ export type WithValidators = {
127
131
  };
128
132
  export type WithWhiteList = {
129
133
  /** Array of strings with the names of the modules or components that can be added. */
130
- whiteList: Array<string>;
134
+ whiteList: Array<__AT__.Modules | __AT__.Components>;
131
135
  };
132
136
  export type WithRelations_AutoTypes = {
133
137
  _autoType?: {
@@ -1,5 +1,4 @@
1
1
  export interface AutoTypesConfig {
2
- typeFileName?: `${string}.d.ts`;
3
2
  interfaceSuffix?: `${Capitalize<string>}`;
4
3
  contentTypeSuffix?: `${Capitalize<string>}`;
5
4
  publicApiSuffix?: `${Capitalize<string>}`;
@@ -1,13 +1,13 @@
1
1
  import { ImageCropType, ImageDecoding, ImageLoading } from "../core";
2
2
  export interface DamDefaults {
3
3
  /** Quality compression for the jpeg, webp and avif formats. */
4
- quality?: number;
4
+ readonly quality?: number;
5
5
  /** Kind of crop of Griddo DAM. */
6
- crop?: ImageCropType;
6
+ readonly crop?: ImageCropType;
7
7
  /** Kind of loading for the browser. */
8
- loading?: ImageLoading;
8
+ readonly loading?: ImageLoading;
9
9
  /** Kind of decoding for the browser. */
10
- decoding?: ImageDecoding;
10
+ readonly decoding?: ImageDecoding;
11
11
  /** Griddo cdn formats. */
12
- formats?: Array<"webp" | "avif">;
12
+ readonly formats?: Array<"webp" | "avif">;
13
13
  }
@@ -4,7 +4,7 @@ export interface HeaderFooter {
4
4
  /** Indicates whether a module is treated as footer or header. If specified, it will be mandatory to specify if it is the default module with the `defaultNavigation` prop. */
5
5
  type: "footer" | "header";
6
6
  /** Name of the React component for the schema. */
7
- component: string;
7
+ component: Capitalize<string>;
8
8
  /** If true, set this module as default navigation module. */
9
9
  defaultNavigation?: boolean;
10
10
  /** Name to represent the component, module or template in the Griddo editor interface. */
@@ -21,14 +21,14 @@ export interface HeaderFooter {
21
21
  };
22
22
  }
23
23
  type TypedOrNotHeaderFooterDefault<T> = T extends {
24
- component: string;
24
+ component: Capitalize<string>;
25
25
  } ? T : Record<string, unknown>;
26
26
  export type Header<T = unknown> = HeaderFooter & {
27
27
  type: "header";
28
28
  /** Object to set default values for schema keys. */
29
29
  default: {
30
30
  /** Name of the component or module of this schema. */
31
- component: string;
31
+ component: Capitalize<string>;
32
32
  /** Internal type id */
33
33
  type: "header";
34
34
  } & TypedOrNotHeaderFooterDefault<T>;
@@ -38,7 +38,7 @@ export type Footer<T = unknown> = HeaderFooter & {
38
38
  /** Object to set default values for schema keys. */
39
39
  default: {
40
40
  /** Name of the component or module of this schema. */
41
- component: string;
41
+ component: Capitalize<string>;
42
42
  /** Internal type id */
43
43
  type: "footer";
44
44
  } & TypedOrNotHeaderFooterDefault<T>;
@@ -6,4 +6,4 @@ export interface ModuleCategoryEntry {
6
6
  /** Internal value for the category. */
7
7
  value: string;
8
8
  }
9
- export type ModuleCategories = Array<ModuleCategoryEntry>;
9
+ export type ModuleCategories = ReadonlyArray<ModuleCategoryEntry>;
@@ -11,7 +11,7 @@ export interface ComponentAndModuleBase extends BaseUI {
11
11
  export interface Component<ComponentProps = unknown> extends ComponentAndModuleBase {
12
12
  schemaType: "component";
13
13
  default: {
14
- component: string;
14
+ component: Capitalize<string>;
15
15
  [key: string]: any;
16
16
  } & ComponentProps;
17
17
  }
@@ -19,7 +19,7 @@ export interface MultiPageComponent<MultiPageComponentProps = unknown> extends C
19
19
  schemaType: "component";
20
20
  default: {
21
21
  /** Component or module name of this schema. */
22
- component: string;
22
+ component: Capitalize<string>;
23
23
  /** ComponentArray required prop for Multipage Modules */
24
24
  title: Fields.Text;
25
25
  sectionSlug: Fields.Text;
@@ -31,7 +31,7 @@ export interface MultiPageComponent<MultiPageComponentProps = unknown> extends C
31
31
  export interface Module<ModuleProps = unknown> extends ComponentAndModuleBase {
32
32
  schemaType: "module";
33
33
  default: {
34
- component: string;
34
+ component: Capitalize<string>;
35
35
  [key: string]: any;
36
36
  } & ModuleProps;
37
37
  }
@@ -39,7 +39,7 @@ export interface MultiPageModule<MultiPageModuleProps = unknown> extends Compone
39
39
  schemaType: "module";
40
40
  default: {
41
41
  /** Component or module name of this schema. */
42
- component: string;
42
+ component: Capitalize<string>;
43
43
  /** Required prop as `true` for MultiPage Modules */
44
44
  hasGriddoMultiPage: true;
45
45
  /** ComponentArray required prop for Multipage Modules */
@@ -51,7 +51,7 @@ export interface ContentTypeModule<ContentTypeModuleProps = unknown> extends Com
51
51
  schemaType: "module";
52
52
  default: {
53
53
  /** Component or module name of this schema. */
54
- component: string;
54
+ component: Capitalize<string>;
55
55
  /** Required prop as `true` for ContentType Modules */
56
56
  hasDistributorData: true;
57
57
  /** `data` prop requierd for ContentType modules */
@@ -89,7 +89,7 @@ export interface Template<TemplateProps = any> extends TemplateBase {
89
89
  default: {
90
90
  type: "template";
91
91
  templateType: TemplateProps extends {
92
- component: string;
92
+ component: Capitalize<string>;
93
93
  } ? TemplateProps["component"] : string;
94
94
  [key: string]: any;
95
95
  } & Omit<TemplateProps, "component">;
@@ -98,7 +98,7 @@ export interface ListTemplate<TemplateProps = any> extends TemplateBase {
98
98
  default: {
99
99
  type: "template";
100
100
  templateType: TemplateProps extends {
101
- component: string;
101
+ component: Capitalize<string>;
102
102
  } ? TemplateProps["component"] : string;
103
103
  hasDistributorData: true;
104
104
  itemsPerPage: number;