@griddo/core 10.7.9 → 11.0.1

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.
Files changed (86) hide show
  1. package/dist/assets/svg/Delete.d.ts +2 -2
  2. package/dist/assets/svg/Duplicate.d.ts +2 -2
  3. package/dist/autotypes.js +1 -1
  4. package/dist/autotypes.js.map +1 -1
  5. package/dist/components/CloudinaryBackgroundImage/index.d.ts +0 -2
  6. package/dist/components/CloudinaryImage/index.d.ts +5 -5
  7. package/dist/components/Component/ComponentWrapper/index.d.ts +1 -1
  8. package/dist/components/Component/index.d.ts +0 -2
  9. package/dist/components/GriddoBackgroundImage/index.d.ts +3 -2
  10. package/dist/components/GriddoImage/index.d.ts +1 -3
  11. package/dist/components/GriddoImageExp/types.d.ts +9 -8
  12. package/dist/components/GriddoImageExp/utils.d.ts +3 -3
  13. package/dist/components/GriddoLink/index.d.ts +8 -10
  14. package/dist/components/GriddoLink/utils.d.ts +6 -5
  15. package/dist/components/LdJson/index.d.ts +0 -2
  16. package/dist/components/Link/index.d.ts +1 -3
  17. package/dist/components/ModulePreview/index.d.ts +5 -5
  18. package/dist/components/Page/index.d.ts +6 -6
  19. package/dist/components/Preview/index.d.ts +3 -3
  20. package/dist/contexts/I18n/index.d.ts +1 -3
  21. package/dist/contexts/Navigation/index.d.ts +3 -3
  22. package/dist/contexts/Page/index.d.ts +1 -1
  23. package/dist/contexts/Session/index.d.ts +2 -2
  24. package/dist/contexts/Site/index.d.ts +6 -6
  25. package/dist/functions/autotypes/ascii.d.ts +3 -2
  26. package/dist/functions/autotypes/getTypeFromField.d.ts +3 -2
  27. package/dist/functions/autotypes/main.d.ts +2 -2
  28. package/dist/functions/autotypes/types.d.ts +9 -8
  29. package/dist/functions/image-utils.d.ts +5 -5
  30. package/dist/functions/index.d.ts +4 -4
  31. package/dist/functions/utils.d.ts +6 -6
  32. package/dist/hooks/__mocks__/page-provider-props.d.ts +1 -1
  33. package/dist/hooks/__mocks__/site-provider-props.d.ts +1 -1
  34. package/dist/hooks/themes/useGlobalTheme.d.ts +1 -1
  35. package/dist/hooks/themes/useTheme.d.ts +2 -2
  36. package/dist/hooks/themes/useThemeColors.d.ts +2 -2
  37. package/dist/hooks/themes/useThemeFont.d.ts +2 -2
  38. package/dist/hooks/themes/useThemePrimitives.d.ts +2 -2
  39. package/dist/hooks/themes/utils.d.ts +1 -1
  40. package/dist/hooks/useContentType.d.ts +1 -1
  41. package/dist/hooks/useContentTypeNavigation.d.ts +1 -1
  42. package/dist/hooks/useDataFilters.d.ts +2 -2
  43. package/dist/hooks/useGriddoImage.d.ts +1 -1
  44. package/dist/hooks/useGriddoImageExp.d.ts +1 -1
  45. package/dist/hooks/useI18n.d.ts +1 -1
  46. package/dist/hooks/useImage.d.ts +1 -1
  47. package/dist/hooks/useList.d.ts +4 -4
  48. package/dist/hooks/useListWithDefaultStaticPage.d.ts +3 -3
  49. package/dist/hooks/useLocaleDate.d.ts +1 -1
  50. package/dist/hooks/usePage.d.ts +1 -1
  51. package/dist/hooks/useReferenceFieldData.d.ts +1 -1
  52. package/dist/hooks/useSite.d.ts +1 -1
  53. package/dist/hooks/utils.d.ts +3 -3
  54. package/dist/index.js +1 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/node/index.js +4 -4
  57. package/dist/types/api-response-fields/index.d.ts +57 -57
  58. package/dist/types/core/index.d.ts +37 -37
  59. package/dist/types/global.d.ts +25 -15
  60. package/dist/types/schema-fields/base.d.ts +4 -4
  61. package/dist/types/schema-fields/page-content-type-fields.d.ts +37 -37
  62. package/dist/types/schema-fields/props.d.ts +37 -36
  63. package/dist/types/schema-fields/simple-content-type-fields.d.ts +3 -3
  64. package/dist/types/schema-fields/ui-fields.d.ts +2 -2
  65. package/dist/types/schema-fields/ui-template-fields.d.ts +3 -3
  66. package/dist/types/schemas/AutoTypes.d.ts +2 -1
  67. package/dist/types/schemas/Categories.d.ts +4 -3
  68. package/dist/types/schemas/ContentType.d.ts +4 -4
  69. package/dist/types/schemas/DamDefaults.d.ts +3 -2
  70. package/dist/types/schemas/DataPack.d.ts +3 -2
  71. package/dist/types/schemas/HeaderFooter.d.ts +5 -5
  72. package/dist/types/schemas/Languages.d.ts +3 -3
  73. package/dist/types/schemas/Menu.d.ts +5 -5
  74. package/dist/types/schemas/ModuleCategories.d.ts +3 -2
  75. package/dist/types/schemas/PageContentType.d.ts +6 -6
  76. package/dist/types/schemas/RichTextConfig.d.ts +2 -1
  77. package/dist/types/schemas/SimpleContentType.d.ts +6 -6
  78. package/dist/types/schemas/Themes.d.ts +4 -4
  79. package/dist/types/schemas/Translations.d.ts +3 -2
  80. package/dist/types/schemas/UI.d.ts +27 -19
  81. package/dist/types/schemas/base.d.ts +3 -3
  82. package/dist/types/schemas/index.d.ts +14 -14
  83. package/dist/types/schemas/props.d.ts +4 -4
  84. package/dist/types/theme/index.d.ts +10 -10
  85. package/dist/types/utilities.d.ts +7 -6
  86. package/package.json +32 -15
@@ -1,56 +1,56 @@
1
- import __AT__ from "@autoTypes";
2
- import { Core } from "../..";
3
- import { SimpleContentType, Source } from "../api-response-fields";
4
- export type WithAuxText = {
1
+ import type { Core } from "../..";
2
+ import type { SimpleContentType, Source } from "../api-response-fields";
3
+ import type __AT__ from "@autoTypes";
4
+ type WithAuxText = {
5
5
  /** Sets a label text to show besides the toggle field control */
6
6
  auxText?: string;
7
7
  };
8
- export type WithBackground = {
8
+ type WithBackground = {
9
9
  /** Sets a light dark background for the field */
10
10
  background?: boolean;
11
11
  };
12
- export type WithDisabled = {
12
+ type WithDisabled = {
13
13
  /** If select is disabled. Default: `false`. */
14
14
  disabled?: boolean;
15
15
  };
16
- export type WithEntity = {
16
+ type WithEntity = {
17
17
  /** Type of entity from which you have to load the options. */
18
18
  entity: "menu_containers" | "pages" | "categories" | "sites";
19
19
  };
20
- export type WithFrom = {
20
+ type WithFrom = {
21
21
  /** The property of the page template from which the value of that field should be extracted. */
22
22
  from: string;
23
23
  };
24
- export type WithFullWidth = {
24
+ type WithFullWidth = {
25
25
  /** Sets the width of the field to the maximum of its parent container */
26
26
  fullWidth?: boolean;
27
27
  };
28
- export type WithGroup = {
28
+ type WithGroup = {
29
29
  /** Array of elements to be displayed */
30
30
  options: Array<Option>;
31
31
  };
32
- export type WithHelpText = {
32
+ type WithHelpText = {
33
33
  /** Help text that appears below the field. */
34
34
  helptext?: string;
35
35
  };
36
- export type WithHideable = {
36
+ type WithHideable = {
37
37
  /** If `true` the field can be hidden in the editor. */
38
38
  hideable?: boolean;
39
39
  };
40
- export type WithHumanReadable = {
40
+ type WithHumanReadable = {
41
41
  /** Allows to use this field as natural language. */
42
42
  humanReadable?: boolean;
43
43
  };
44
- export type WithIndexable = {
44
+ type WithIndexable = {
45
45
  /** Default is false. If that field is to be used as an index (to be able to sort by that field, etc.) */
46
46
  indexable?: boolean;
47
47
  };
48
48
  /** Por defecto es false. Si ese campo se va a utilizar como índice (para poder ordenar por ese campo, etc.) */
49
- export type WithIsMockup = {
49
+ type WithIsMockup = {
50
50
  /** Marks the content of the default field as dummy content which forces the user editor to change it. Otherwise when trying to publish the Griddo editor will warn us to change it. */
51
51
  isMockup?: boolean;
52
52
  };
53
- export type Option = {
53
+ type Option = {
54
54
  /** Label that will appear in the form. */
55
55
  title: string;
56
56
  /** Field name. */
@@ -60,65 +60,65 @@ export type Option = {
60
60
  /** If the option is disabled. */
61
61
  disabled?: boolean;
62
62
  };
63
- export type WithPlaceHolder = {
63
+ type WithPlaceHolder = {
64
64
  /** Sample content text. */
65
65
  placeholder?: string;
66
66
  };
67
- export type WithPrefix = {
67
+ type WithPrefix = {
68
68
  /** Fixed string to appear and be included in the field value. */
69
69
  prefix?: "#" | (string & {});
70
70
  };
71
- export type WithReadonly = {
71
+ type WithReadonly = {
72
72
  /** If the field is read-only. */
73
73
  readonly?: boolean;
74
74
  };
75
- export type WithSearchable = {
75
+ type WithSearchable = {
76
76
  /** Only for the field with key "title". If set to false, this title will not be used in searches. */
77
77
  searchable?: boolean;
78
78
  };
79
- export type SearchFrom = {
79
+ type SearchFrom = {
80
80
  /** An array of `keys` representing the fields by which a search can be performed. */
81
81
  searchFrom?: Array<string>;
82
82
  };
83
- export type WithShowList = {
83
+ type WithShowList = {
84
84
  /** Default is false. If in the lists this field must be included as another data. WARNING: normally if it is showList it must also be indexable. */
85
85
  showList?: boolean;
86
86
  };
87
- export type WithSlugTo = {
87
+ type WithSlugTo = {
88
88
  /** If a key is specified, the value of this field will appear in the text field that has that key in slug format. */
89
89
  slugTo?: string;
90
90
  };
91
- export type WithSource = {
91
+ type WithSource = {
92
92
  /** Structured data from which the options must be loaded. */
93
93
  source: __AT__.PageContentTypes | __AT__.SimpleContentTypes | __AT__.TaxonomyContentTypes;
94
94
  };
95
- export type WithSources<ContentType = unknown> = {
95
+ type WithSources<ContentType = unknown> = {
96
96
  /** Structured data object from which the options must be loaded. */
97
97
  sources: Array<Source<ContentType>>;
98
98
  };
99
- export type ThemeColors = {
99
+ type ThemeColors = {
100
100
  theme: __AT__.Subthemes;
101
101
  options: Array<`#${string}`>;
102
102
  };
103
- export type ThemeFixedColors = {
103
+ type ThemeFixedColors = {
104
104
  theme: __AT__.Subthemes;
105
105
  options: Array<{
106
106
  name: string;
107
107
  hex: `#${string}`;
108
108
  }>;
109
109
  };
110
- export type ThemeVisualUniqueSelection = {
110
+ type ThemeVisualUniqueSelection = {
111
111
  theme: __AT__.Themes;
112
112
  options: Array<{
113
113
  value: __AT__.Subthemes;
114
114
  img: string;
115
115
  }>;
116
116
  };
117
- export type ThumbnailOption = {
117
+ type ThumbnailOption = {
118
118
  value: string;
119
119
  img: string;
120
120
  };
121
- export type WithValidators = {
121
+ type WithValidators = {
122
122
  /** Validation of `string`, `number` and `date` type fields. */
123
123
  validators?: {
124
124
  /** Validates the minimum length of a string. */
@@ -135,28 +135,29 @@ export type WithValidators = {
135
135
  dateFormat?: "futureDate" | "pastDate";
136
136
  };
137
137
  };
138
- export type WithWhiteList = {
138
+ type WithWhiteList = {
139
139
  /** Array of strings with the names of the modules or components that can be added. */
140
140
  whiteList: Array<__AT__.Modules | __AT__.Components>;
141
141
  };
142
- export type WithRelations_AutoTypes = {
142
+ type WithRelations_AutoTypes = {
143
143
  _autoType?: {
144
144
  relations?: boolean | "off" | "simple" | "full";
145
145
  };
146
146
  };
147
- export type WithDataSources = {
147
+ type WithDataSources = {
148
148
  /** Array with the structured data types that the field has to load. */
149
149
  sources: Array<Source<__AT__.PageContentTypes | __AT__.SimpleContentTypes | __AT__.TaxonomyContentTypes>>;
150
150
  };
151
- export type WithComputed<ReturnType> = {
151
+ type WithComputed<ReturnType> = {
152
152
  /** Computed prop callback for UI Templates */
153
153
  computed?: (page: Core.Page) => ReturnType;
154
154
  };
155
- export type WithSimpleContentTypeComputed<ContentType, ReturnType> = {
155
+ type WithSimpleContentTypeComputed<ContentType, ReturnType> = {
156
156
  /** Computed prop callback for Simple Content Type */
157
157
  computed?: (page: SimpleContentType<Omit<ContentType, "__contentTypeName" | "__contentTypeKind" | "__relatedContentTypeNames">>["content"]) => ReturnType;
158
158
  };
159
- export type WithHidden = {
159
+ type WithHidden = {
160
160
  /** Hides the field in the Griddo editor, useful when use computed fields */
161
161
  hidden?: boolean;
162
162
  };
163
+ export type { Option, SearchFrom, ThemeColors, ThemeFixedColors, ThemeVisualUniqueSelection, ThumbnailOption, WithAuxText, WithBackground, WithComputed, WithDataSources, WithDisabled, WithEntity, WithFrom, WithFullWidth, WithGroup, WithHelpText, WithHidden, WithHideable, WithHumanReadable, WithIndexable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithSearchable, WithShowList, WithSimpleContentTypeComputed, WithSlugTo, WithSource, WithSources, WithValidators, WithWhiteList, };
@@ -1,6 +1,6 @@
1
- import { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTagsField, BaseTextArea, BaseTextField, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
2
- import { WithAuxText, WithBackground, WithDataSources, WithFullWidth, WithHelpText, WithHidden, WithHumanReadable, WithIndexable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithShowList, WithSimpleContentTypeComputed, WithSlugTo, WithValidators, WithWhiteList } from "./props";
3
- import { Fields } from "../..";
1
+ import type { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTagsField, BaseTextArea, BaseTextField, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
2
+ import type { WithAuxText, WithBackground, WithDataSources, WithFullWidth, WithHelpText, WithHidden, WithHumanReadable, WithIndexable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithShowList, WithSimpleContentTypeComputed, WithSlugTo, WithValidators, WithWhiteList } from "./props";
3
+ import type { Fields } from "../..";
4
4
  type Common = WithIndexable & WithShowList & WithHelpText & WithHidden;
5
5
  export type ArrayFieldGroup = BaseArrayFieldGroup<SimpleContentTypeFields> & Common;
6
6
  export type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
@@ -1,5 +1,5 @@
1
- import { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseComponentArray, BaseComponentContainer, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTagsField, BaseTextArea, BaseTextField, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
2
- import { WithAuxText, WithBackground, WithDataSources, WithFullWidth, WithHelpText, WithHidden, WithHideable, WithHumanReadable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithSlugTo, WithValidators, WithWhiteList } from "./props";
1
+ import type { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseComponentArray, BaseComponentContainer, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTagsField, BaseTextArea, BaseTextField, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
2
+ import type { WithAuxText, WithBackground, WithDataSources, WithFullWidth, WithHelpText, WithHidden, WithHideable, WithHumanReadable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithSlugTo, WithValidators, WithWhiteList } from "./props";
3
3
  export type ArrayFieldGroup = BaseArrayFieldGroup<UIFields> & WithHelpText & WithHideable & WithHidden;
4
4
  export type AsyncCheckGroup = BaseAsyncCheckGroup & WithHelpText & WithHideable & WithHidden;
5
5
  export type AsyncSelect = BaseAsyncSelect & WithHelpText & WithHideable & WithPlaceHolder & WithHidden;
@@ -1,6 +1,6 @@
1
- import { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseComponentArray, BaseComponentContainer, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTagsField, BaseTextArea, BaseTextField, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
2
- import { WithAuxText, WithBackground, WithComputed, WithDataSources, WithFullWidth, WithHelpText, WithHidden, WithHideable, WithHumanReadable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithSlugTo, WithValidators, WithWhiteList } from "./props";
3
- import { Fields } from "../..";
1
+ import type { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseComponentArray, BaseComponentContainer, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTagsField, BaseTextArea, BaseTextField, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
2
+ import type { WithAuxText, WithBackground, WithComputed, WithDataSources, WithFullWidth, WithHelpText, WithHidden, WithHideable, WithHumanReadable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithSlugTo, WithValidators, WithWhiteList } from "./props";
3
+ import type { Fields } from "../..";
4
4
  export type ArrayFieldGroup = BaseArrayFieldGroup<UITemplateFields> & WithHelpText & WithHideable & WithHidden;
5
5
  export type AsyncCheckGroup = BaseAsyncCheckGroup & WithHelpText & WithHideable & WithHidden;
6
6
  export type AsyncSelect = BaseAsyncSelect & WithHelpText & WithHideable & WithPlaceHolder & WithHidden;
@@ -1,5 +1,6 @@
1
- export interface AutoTypesConfig {
1
+ interface AutoTypesConfig {
2
2
  interfaceSuffix?: `${Capitalize<string>}`;
3
3
  contentTypeSuffix?: `${Capitalize<string>}`;
4
4
  publicApiSuffix?: `${Capitalize<string>}`;
5
5
  }
6
+ export type { AutoTypesConfig };
@@ -1,6 +1,6 @@
1
- import { BaseContentType } from "./base";
2
- import { DataPacks } from "./props";
3
- export interface Categories extends BaseContentType, Required<DataPacks> {
1
+ import type { BaseContentType } from "./base";
2
+ import type { DataPacks } from "./props";
3
+ interface Categories extends BaseContentType, Required<DataPacks> {
4
4
  /** Indicates that it is a category, must always be `true`. */
5
5
  taxonomy: true;
6
6
  /** Indicates that the data is of type simple/category. Must always be `false`. */
@@ -8,3 +8,4 @@ export interface Categories extends BaseContentType, Required<DataPacks> {
8
8
  /** It is not necessary to indicate `schema` in the categories. */
9
9
  schema?: never;
10
10
  }
11
+ export type { Categories };
@@ -1,4 +1,4 @@
1
- import { Categories } from "./Categories";
2
- import { PageContentType } from "./PageContentType";
3
- import { SimpleContentType } from "./SimpleContentType";
4
- export { PageContentType, SimpleContentType, Categories as CategoryContentType, };
1
+ import type { Categories } from "./Categories";
2
+ import type { PageContentType } from "./PageContentType";
3
+ import type { SimpleContentType } from "./SimpleContentType";
4
+ export type { PageContentType, SimpleContentType, Categories as CategoryContentType, };
@@ -1,5 +1,5 @@
1
- import { ImageCropType, ImageDecoding, ImageLoading } from "../core";
2
- export interface DamDefaults {
1
+ import type { ImageCropType, ImageDecoding, ImageLoading } from "../core";
2
+ interface DamDefaults {
3
3
  /** Quality compression for the jpeg, webp and avif formats. */
4
4
  readonly quality?: number;
5
5
  /** Kind of crop of Griddo DAM. */
@@ -13,3 +13,4 @@ export interface DamDefaults {
13
13
  /** Default widths for the srcset generation. */
14
14
  readonly widths?: Array<string>;
15
15
  }
16
+ export type { DamDefaults };
@@ -1,5 +1,5 @@
1
- import __AT__ from "@autoTypes";
2
- export interface DataPack {
1
+ import type __AT__ from "@autoTypes";
2
+ interface DataPack {
3
3
  /** Title of the Data Pack that will appear in the Griddo editor. */
4
4
  title: string;
5
5
  /** Data Pack Category. */
@@ -11,3 +11,4 @@ export interface DataPack {
11
11
  [key: string]: unknown;
12
12
  } | string;
13
13
  }
14
+ export type { DataPack };
@@ -1,5 +1,5 @@
1
- import { ConfigTabs, Thumbnails } from "./props";
2
- export interface HeaderFooter {
1
+ import type { ConfigTabs, Thumbnails } from "./props";
2
+ interface HeaderFooter {
3
3
  schemaType: "module";
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";
@@ -23,7 +23,7 @@ export interface HeaderFooter {
23
23
  type TypedOrNotHeaderFooterDefault<T> = T extends {
24
24
  component: Capitalize<string>;
25
25
  } ? T : Record<string, unknown>;
26
- export type Header<T = unknown> = HeaderFooter & {
26
+ type Header<T = unknown> = HeaderFooter & {
27
27
  type: "header";
28
28
  /** Object to set default values for schema keys. */
29
29
  default: {
@@ -33,7 +33,7 @@ export type Header<T = unknown> = HeaderFooter & {
33
33
  type: "header";
34
34
  } & TypedOrNotHeaderFooterDefault<T>;
35
35
  };
36
- export type Footer<T = unknown> = HeaderFooter & {
36
+ type Footer<T = unknown> = HeaderFooter & {
37
37
  type: "footer";
38
38
  /** Object to set default values for schema keys. */
39
39
  default: {
@@ -43,4 +43,4 @@ export type Footer<T = unknown> = HeaderFooter & {
43
43
  type: "footer";
44
44
  } & TypedOrNotHeaderFooterDefault<T>;
45
45
  };
46
- export {};
46
+ export type { HeaderFooter, Header, Footer };
@@ -1,4 +1,4 @@
1
- import { Locale } from "../core";
1
+ import type { Locale } from "../core";
2
2
  interface LanguageEntry {
3
3
  /** Internal name for API. */
4
4
  name: string;
@@ -7,5 +7,5 @@ interface LanguageEntry {
7
7
  /** Alias for the locale in case you need to modify it. */
8
8
  alias?: Array<Locale>;
9
9
  }
10
- export type Languages = Partial<Record<Locale, LanguageEntry>>;
11
- export {};
10
+ type Languages = Partial<Record<Locale, LanguageEntry>>;
11
+ export type { LanguageEntry, Languages };
@@ -1,12 +1,12 @@
1
- import { UIFields } from "../schema-fields/ui-fields";
1
+ import type { UIFields } from "../schema-fields/ui-fields";
2
2
  interface MenuEntry {
3
3
  /** Internal name for API. */
4
4
  key: string;
5
5
  /** Name displayed in the Griddo editor. */
6
6
  display: string;
7
7
  }
8
- export type MenuFields = Exclude<UIFields, "ComponentArray" | "ComponentContainer" | "ReferenceField">;
9
- export interface MenuItem {
8
+ type MenuFields = Exclude<UIFields, "ComponentArray" | "ComponentContainer" | "ReferenceField">;
9
+ interface MenuItem {
10
10
  /** Schema fields for the Griddo menu Link */
11
11
  link: {
12
12
  fields: Array<MenuFields>;
@@ -16,5 +16,5 @@ export interface MenuItem {
16
16
  fields: Array<MenuFields>;
17
17
  };
18
18
  }
19
- export type Menu = Array<MenuEntry>;
20
- export {};
19
+ type Menu = Array<MenuEntry>;
20
+ export type { MenuEntry, MenuFields, MenuItem, Menu };
@@ -1,4 +1,4 @@
1
- export interface ModuleCategoryEntry {
1
+ interface ModuleCategoryEntry {
2
2
  /** If true the categorie will be highligted in the Griddo editor. */
3
3
  featured?: boolean;
4
4
  /** Visible text for the category. */
@@ -6,4 +6,5 @@ export interface ModuleCategoryEntry {
6
6
  /** Internal value for the category. */
7
7
  value: string;
8
8
  }
9
- export type ModuleCategories = ReadonlyArray<ModuleCategoryEntry>;
9
+ type ModuleCategories = ReadonlyArray<ModuleCategoryEntry>;
10
+ export type { ModuleCategories, ModuleCategoryEntry };
@@ -1,7 +1,7 @@
1
- import { BaseContentType } from "./base";
2
- import { DataPacks, ExpirationData } from "./props";
3
- import { PageContentTypeFields, TextField } from "../schema-fields/page-content-type-fields";
4
- import { SearchFrom, WithSearchable } from "../schema-fields/props";
1
+ import type { BaseContentType } from "./base";
2
+ import type { DataPacks, ExpirationData } from "./props";
3
+ import type { PageContentTypeFields, TextField } from "../schema-fields/page-content-type-fields";
4
+ import type { SearchFrom, WithSearchable } from "../schema-fields/props";
5
5
  type PageContentTypeProp = SearchFrom & {
6
6
  /** The name of the Reacttemplates to use with the page type Schema. */
7
7
  templates: Array<string>;
@@ -13,7 +13,7 @@ type PageContentTypeProp = SearchFrom & {
13
13
  ...PageContentTypeFields[]
14
14
  ];
15
15
  };
16
- export interface PageContentType extends BaseContentType, DataPacks, ExpirationData {
16
+ interface PageContentType extends BaseContentType, DataPacks, ExpirationData {
17
17
  /** Indicates that is a taxonomy. In this case must be `false`.*/
18
18
  taxonomy: false;
19
19
  /** xIndicates that the data is of type page. Must always be `true`. */
@@ -21,4 +21,4 @@ export interface PageContentType extends BaseContentType, DataPacks, ExpirationD
21
21
  /** Schema for the page content type. */
22
22
  schema: PageContentTypeProp;
23
23
  }
24
- export {};
24
+ export type { PageContentType };
@@ -1,4 +1,4 @@
1
- export interface RichTextConfig {
1
+ interface RichTextConfig {
2
2
  /** Class names configuration for the paragraph options */
3
3
  paragraphStyles?: Array<{
4
4
  /** The label that appears in the Griddo rich-text editor */
@@ -33,3 +33,4 @@ export interface RichTextConfig {
33
33
  className: string;
34
34
  }>;
35
35
  }
36
+ export type { RichTextConfig };
@@ -1,7 +1,7 @@
1
- import { BaseContentType } from "./base";
2
- import { DataPacks, ExpirationData } from "./props";
3
- import { SearchFrom, WithSearchable } from "../schema-fields/props";
4
- import { SimpleContentTypeFields, TextField } from "../schema-fields/simple-content-type-fields";
1
+ import type { BaseContentType } from "./base";
2
+ import type { DataPacks, ExpirationData } from "./props";
3
+ import type { SearchFrom, WithSearchable } from "../schema-fields/props";
4
+ import type { SimpleContentTypeFields, TextField } from "../schema-fields/simple-content-type-fields";
5
5
  type SimpleContentTypeProp<ContentType> = SearchFrom & {
6
6
  /** An array of Griddo fields. */
7
7
  fields: [
@@ -11,7 +11,7 @@ type SimpleContentTypeProp<ContentType> = SearchFrom & {
11
11
  ...SimpleContentTypeFields<ContentType>[]
12
12
  ];
13
13
  };
14
- export interface SimpleContentType<ContentType = unknown> extends BaseContentType, DataPacks, ExpirationData {
14
+ interface SimpleContentType<ContentType = unknown> extends BaseContentType, DataPacks, ExpirationData {
15
15
  /** Indicates that the data is of type simple/category. Must always be `false`. */
16
16
  fromPage: false;
17
17
  /** Schema for the simple content type. */
@@ -21,4 +21,4 @@ export interface SimpleContentType<ContentType = unknown> extends BaseContentTyp
21
21
  /** Set if ContentType is exportable */
22
22
  exportable?: boolean;
23
23
  }
24
- export {};
24
+ export type { SimpleContentType, SimpleContentTypeProp };
@@ -1,4 +1,4 @@
1
- import __AT__ from "@autoTypes";
1
+ import type __AT__ from "@autoTypes";
2
2
  interface ThemeElements {
3
3
  datapacks?: Array<__AT__.Datapacks>;
4
4
  templates?: Array<Exclude<__AT__.Templates, "BasicTemplate">>;
@@ -15,7 +15,7 @@ interface IncludeElements {
15
15
  exclude?: never;
16
16
  }
17
17
  type ElementsSet = IncludeElements | ExcludedElements;
18
- export interface ThemeEntry {
18
+ interface ThemeEntry {
19
19
  /** Text with which the theme will be shown in the selector. */
20
20
  label: string;
21
21
  /** Value equivalent to the id of the theme within the instance. */
@@ -25,5 +25,5 @@ export interface ThemeEntry {
25
25
  /** Indicates which elements from the entire design system are included or excluded theme */
26
26
  elements?: ElementsSet;
27
27
  }
28
- export type Themes = Array<ThemeEntry>;
29
- export {};
28
+ type Themes = Array<ThemeEntry>;
29
+ export type { ElementsSet, ExcludedElements, IncludeElements, ThemeElements, ThemeEntry, Themes, };
@@ -1,2 +1,3 @@
1
- import { LocaleTranslations } from "../core";
2
- export type Translations = LocaleTranslations;
1
+ import type { LocaleTranslations } from "../core";
2
+ type Translations = LocaleTranslations;
3
+ export type { Translations };
@@ -1,22 +1,22 @@
1
- import { BaseUI } from "./base";
2
- import { ConfigTabs, Dimension } from "./props";
3
- import { Fields } from "../..";
4
- import { Source } from "../api-response-fields";
5
- import { UITemplateFields } from "../schema-fields/ui-template-fields";
6
- export interface ComponentAndModuleBase extends BaseUI {
1
+ import type { BaseUI } from "./base";
2
+ import type { ConfigTabs, Dimension } from "./props";
3
+ import type { Fields } from "../..";
4
+ import type { Source } from "../api-response-fields";
5
+ import type { UITemplateFields } from "../schema-fields/ui-template-fields";
6
+ interface ComponentAndModuleBase extends BaseUI {
7
7
  /** Type of schema. */
8
8
  schemaType: "component" | "module" | "template";
9
9
  /** 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. */
10
10
  configTabs: Array<ConfigTabs>;
11
11
  }
12
- export interface Component<ComponentProps = unknown> extends ComponentAndModuleBase {
12
+ interface Component<ComponentProps = unknown> extends ComponentAndModuleBase {
13
13
  schemaType: "component";
14
14
  default: {
15
15
  component: Capitalize<string>;
16
16
  [key: string]: any;
17
17
  } & ComponentProps;
18
18
  }
19
- export interface MultiPageComponent<MultiPageComponentProps = unknown> extends ComponentAndModuleBase {
19
+ interface MultiPageComponent<MultiPageComponentProps = unknown> extends ComponentAndModuleBase {
20
20
  schemaType: "component";
21
21
  default: {
22
22
  /** Component or module name of this schema. */
@@ -29,14 +29,14 @@ export interface MultiPageComponent<MultiPageComponentProps = unknown> extends C
29
29
  [key: string]: any;
30
30
  } & MultiPageComponentProps;
31
31
  }
32
- export interface Module<ModuleProps = unknown> extends ComponentAndModuleBase {
32
+ interface Module<ModuleProps = unknown> extends ComponentAndModuleBase {
33
33
  schemaType: "module";
34
34
  default: {
35
35
  component: Capitalize<string>;
36
36
  [key: string]: any;
37
37
  } & ModuleProps;
38
38
  }
39
- export interface MultiPageModule<MultiPageModuleProps = unknown> extends ComponentAndModuleBase {
39
+ interface MultiPageModule<MultiPageModuleProps = unknown> extends ComponentAndModuleBase {
40
40
  schemaType: "module";
41
41
  default: {
42
42
  /** Component or module name of this schema. */
@@ -48,13 +48,21 @@ export interface MultiPageModule<MultiPageModuleProps = unknown> extends Compone
48
48
  [key: string]: any;
49
49
  } & MultiPageModuleProps;
50
50
  }
51
- export interface ContentTypeModule<ContentTypeModuleProps = unknown> extends ComponentAndModuleBase {
51
+ /** Required prop as `true` for ContentType Modules */
52
+ type RequestForDataLegacy = {
53
+ hasDistributorData: true;
54
+ getStaticData?: never;
55
+ };
56
+ /** Required prop as `true` for ContentType Modules */
57
+ type RequestForData = {
58
+ hasDistributorData?: never;
59
+ getStaticData: boolean;
60
+ };
61
+ interface ContentTypeModule<ContentTypeModuleProps = unknown> extends ComponentAndModuleBase {
52
62
  schemaType: "module";
53
63
  default: {
54
64
  /** Component or module name of this schema. */
55
65
  component: Capitalize<string>;
56
- /** Required prop as `true` for ContentType Modules */
57
- hasDistributorData: true;
58
66
  /** `data` prop for ContentType modules */
59
67
  data?: ContentTypeModuleProps extends {
60
68
  data?: any;
@@ -63,9 +71,9 @@ export interface ContentTypeModule<ContentTypeModuleProps = unknown> extends Com
63
71
  sources?: Array<Source<unknown>>;
64
72
  };
65
73
  [key: string]: any;
66
- } & ContentTypeModuleProps;
74
+ } & ContentTypeModuleProps & (RequestForData | RequestForDataLegacy);
67
75
  }
68
- export interface TemplateBase extends BaseUI {
76
+ interface TemplateBase extends BaseUI {
69
77
  /** Template Schema. */
70
78
  schemaType: "template";
71
79
  /** Indicates the type of Schema for the template: List, Detail, 404, etc. */
@@ -86,7 +94,7 @@ export interface TemplateBase extends BaseUI {
86
94
  /** Array of fields for the config tab. */
87
95
  config?: Array<UITemplateFields>;
88
96
  }
89
- export interface Template<TemplateProps = any> extends TemplateBase {
97
+ interface Template<TemplateProps = any> extends TemplateBase {
90
98
  default: {
91
99
  type: "template";
92
100
  templateType: TemplateProps extends {
@@ -95,15 +103,15 @@ export interface Template<TemplateProps = any> extends TemplateBase {
95
103
  [key: string]: any;
96
104
  } & Omit<TemplateProps, "component">;
97
105
  }
98
- export interface ListTemplate<TemplateProps = any> extends TemplateBase {
106
+ interface ListTemplate<TemplateProps = any> extends TemplateBase {
99
107
  default: {
100
108
  type: "template";
101
109
  templateType: TemplateProps extends {
102
110
  component: Capitalize<string>;
103
111
  } ? TemplateProps["component"] : string;
104
- hasDistributorData: true;
105
112
  itemsPerPage: number;
106
113
  activePage: number;
107
114
  [key: string]: any;
108
- } & Omit<TemplateProps, "component">;
115
+ } & Omit<TemplateProps, "component"> & (RequestForData | RequestForDataLegacy);
109
116
  }
117
+ export type { Component, ComponentAndModuleBase, ContentTypeModule, ListTemplate, Module, MultiPageComponent, MultiPageModule, Template, TemplateBase, };
@@ -1,5 +1,5 @@
1
- import __AT__ from "@autoTypes";
2
- import { DataPacks, Thumbnails, _AutoTypes } from "./props";
1
+ import type { DataPacks, Thumbnails, _AutoTypes } from "./props";
2
+ import type __AT__ from "@autoTypes";
3
3
  interface BaseContentType extends _AutoTypes {
4
4
  /** Title for the Content Type */
5
5
  title: string;
@@ -46,4 +46,4 @@ interface BaseUI extends DataPacks, _AutoTypes {
46
46
  /** Images that represent the component, module or template in the Griddo editor. */
47
47
  thumbnails?: Thumbnails | Record<__AT__.Themes, Thumbnails>;
48
48
  }
49
- export { BaseContentType, BaseUI };
49
+ export type { BaseContentType, BaseUI };
@@ -1,14 +1,14 @@
1
- import { AutoTypesConfig } from "./AutoTypes";
2
- import { CategoryContentType, PageContentType, SimpleContentType } from "./ContentType";
3
- import { DamDefaults } from "./DamDefaults";
4
- import { DataPack } from "./DataPack";
5
- import { DataPackCategory } from "./DataPackCategory";
6
- import { Footer, Header } from "./HeaderFooter";
7
- import { Languages } from "./Languages";
8
- import { Menu, MenuItem } from "./Menu";
9
- import { ModuleCategories } from "./ModuleCategories";
10
- import { RichTextConfig } from "./RichTextConfig";
11
- import { Themes } from "./Themes";
12
- import { Translations } from "./Translations";
13
- import { Component, ContentTypeModule, ListTemplate, Module, MultiPageComponent, MultiPageModule, Template } from "./UI";
14
- export { AutoTypesConfig, CategoryContentType, Component, ContentTypeModule, DamDefaults, DataPack, DataPackCategory, Footer, Header, Languages, ListTemplate, Menu, MenuItem, Module, ModuleCategories, MultiPageComponent, MultiPageModule, PageContentType, RichTextConfig, SimpleContentType, Template, Themes, Translations, };
1
+ import type { AutoTypesConfig } from "./AutoTypes";
2
+ import type { CategoryContentType, PageContentType, SimpleContentType } from "./ContentType";
3
+ import type { DamDefaults } from "./DamDefaults";
4
+ import type { DataPack } from "./DataPack";
5
+ import type { DataPackCategory } from "./DataPackCategory";
6
+ import type { Footer, Header } from "./HeaderFooter";
7
+ import type { Languages } from "./Languages";
8
+ import type { Menu, MenuItem } from "./Menu";
9
+ import type { ModuleCategories } from "./ModuleCategories";
10
+ import type { RichTextConfig } from "./RichTextConfig";
11
+ import type { Themes } from "./Themes";
12
+ import type { Translations } from "./Translations";
13
+ import type { Component, ContentTypeModule, ListTemplate, Module, MultiPageComponent, MultiPageModule, Template } from "./UI";
14
+ export type { AutoTypesConfig, CategoryContentType, Component, ContentTypeModule, DamDefaults, DataPack, DataPackCategory, Footer, Header, Languages, ListTemplate, Menu, MenuItem, Module, ModuleCategories, MultiPageComponent, MultiPageModule, PageContentType, RichTextConfig, SimpleContentType, Template, Themes, Translations, };