@griddo/core 1.73.29 → 1.74.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.
- package/README.md +1 -0
- package/dist/index.d.ts +6 -69
- package/dist/index.js +1 -1
- package/dist/src/functions/create-schemas/index.d.ts +69 -0
- package/dist/{utils.d.ts → src/functions/create-schemas/utils.d.ts} +2 -2
- package/dist/src/types/core.d.ts +419 -0
- package/dist/src/types/fields.d.ts +7 -0
- package/dist/src/types/schema-functions/fields/base.d.ts +272 -0
- package/dist/src/types/schema-functions/fields/page-data-fields.d.ts +36 -0
- package/dist/src/types/schema-functions/fields/props.d.ts +131 -0
- package/dist/src/types/schema-functions/fields/pure-data-fields.d.ts +34 -0
- package/dist/src/types/schema-functions/fields/ui-fields.d.ts +35 -0
- package/dist/src/types/schema-functions/schemas/CategoriesSchema.d.ts +13 -0
- package/dist/{types → src/types/schema-functions}/schemas/DamDefaultsSchema.d.ts +3 -1
- package/dist/{types → src/types/schema-functions}/schemas/DataPackCategoriesSchema.d.ts +1 -1
- package/dist/src/types/schema-functions/schemas/DataPackSchema.d.ts +13 -0
- package/dist/src/types/schema-functions/schemas/HeaderFooterSchema.d.ts +35 -0
- package/dist/{types → src/types/schema-functions}/schemas/LanguagesSchema.d.ts +2 -2
- package/dist/src/types/schema-functions/schemas/MenuSchema.d.ts +8 -0
- package/dist/{types → src/types/schema-functions}/schemas/ModuleCategoriesSchema.d.ts +1 -1
- package/dist/src/types/schema-functions/schemas/PageDataSchema.d.ts +20 -0
- package/dist/{types → src/types/schema-functions}/schemas/PureDataSchema.d.ts +4 -4
- package/dist/src/types/schema-functions/schemas/ThemesSchema.d.ts +11 -0
- package/dist/{types → src/types/schema-functions}/schemas/TranslationsSchema.d.ts +0 -0
- package/dist/src/types/schema-functions/schemas/UISchema.d.ts +47 -0
- package/dist/src/types/schema-functions/schemas/base.d.ts +71 -0
- package/dist/{types → src/types/schema-functions}/schemas/index.d.ts +1 -1
- package/dist/src/types/schema-functions/schemas/props.d.ts +33 -0
- package/dist/src/types/schema.d.ts +1 -0
- package/dist/src/types/theme.d.ts +57 -0
- package/package.json +2 -2
- package/dist/types/fields/base.d.ts +0 -257
- package/dist/types/fields/page-data-fields.d.ts +0 -36
- package/dist/types/fields/props.d.ts +0 -120
- package/dist/types/fields/pure-data-fields.d.ts +0 -34
- package/dist/types/fields/ui-fields.d.ts +0 -35
- package/dist/types/schemas/CategoriesSchema.d.ts +0 -13
- package/dist/types/schemas/DataPackSchema.d.ts +0 -12
- package/dist/types/schemas/HeaderFooterSchema.d.ts +0 -28
- package/dist/types/schemas/MenuSchema.d.ts +0 -8
- package/dist/types/schemas/PageDataSchema.d.ts +0 -20
- package/dist/types/schemas/ThemesSchema.d.ts +0 -9
- package/dist/types/schemas/UISchema.d.ts +0 -39
- package/dist/types/schemas/base.d.ts +0 -58
- package/dist/types/schemas/props.d.ts +0 -32
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { WithDisabled, WithEntity, WithGroup, HTMLTag, Option, WithSource, ThemeColors, ThemeFixedColors, ThemeVisualUniqueSelection, ThumbnailOption } from "./props";
|
|
2
|
+
export declare type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
3
|
+
interface GenericField {
|
|
4
|
+
/** Sets the field type */
|
|
5
|
+
type: string;
|
|
6
|
+
/** Value with which the field will be identified in the API. Use camelCase. */
|
|
7
|
+
key: string;
|
|
8
|
+
/** Label of the field that will appear in the form. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** If the field is required. */
|
|
11
|
+
mandatory?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface GenericComponentField extends GenericField {
|
|
14
|
+
/** Forces all elements of the Array to be of the same type. If this option is
|
|
15
|
+
* enabled the schema should include a `VisualUniqueSelection` to choose the
|
|
16
|
+
* type. */
|
|
17
|
+
elementUniqueSelection?: boolean;
|
|
18
|
+
/** Maximum number of components that can be added. */
|
|
19
|
+
maxItems?: number | null;
|
|
20
|
+
}
|
|
21
|
+
interface GenericArrayFieldGroup extends GenericField {
|
|
22
|
+
/** Name of the item to be repeated. */
|
|
23
|
+
name: string;
|
|
24
|
+
/** Add a FieldsDivider field as a header. */
|
|
25
|
+
divider?: FieldsDividerData;
|
|
26
|
+
/** The two ways to display the array of items, with the fields collapsed
|
|
27
|
+
* (dropdown) or visible (inline). */
|
|
28
|
+
arrayType: string;
|
|
29
|
+
/** Fields template to be repeated in each item. */
|
|
30
|
+
fields: Array<unknown>;
|
|
31
|
+
}
|
|
32
|
+
export interface BaseArrayFieldGroup<FieldsType> extends GenericArrayFieldGroup {
|
|
33
|
+
type: "ArrayFieldGroup";
|
|
34
|
+
arrayType: "inline" | "dropDown";
|
|
35
|
+
fields: Array<FieldsType & {
|
|
36
|
+
isTitle?: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export interface BaseAsyncCheckGroup extends GenericField, WithDisabled, WithSource {
|
|
40
|
+
/** List of checkboxes that load the options of a database entity. */
|
|
41
|
+
type: "AsyncCheckGroup";
|
|
42
|
+
}
|
|
43
|
+
interface ExclusiveSource extends Partial<WithSource> {
|
|
44
|
+
entity?: never;
|
|
45
|
+
}
|
|
46
|
+
interface ExclusiveEntity extends Partial<WithEntity> {
|
|
47
|
+
source?: never;
|
|
48
|
+
}
|
|
49
|
+
declare type SourceOrEntity = ExclusiveSource | ExclusiveEntity;
|
|
50
|
+
export declare type BaseAsyncSelect = GenericField & WithDisabled & SourceOrEntity & {
|
|
51
|
+
type: "AsyncSelect";
|
|
52
|
+
};
|
|
53
|
+
export interface BaseCheckGroup extends GenericField, WithGroup {
|
|
54
|
+
/** Agrupación de Check Fields. */
|
|
55
|
+
type: "CheckGroup";
|
|
56
|
+
}
|
|
57
|
+
interface GenericColorPicker extends GenericField {
|
|
58
|
+
/** Texfield that allows to display a modal to choose a color. */
|
|
59
|
+
type: "ColorPicker";
|
|
60
|
+
/** If `true` (only fixed colors are used) the text field is disabled and the
|
|
61
|
+
* name value is stored, which will be common to all theme options. In this
|
|
62
|
+
* case, the scheme colors must be declared as an array of objects. */
|
|
63
|
+
onlyFixedColors?: boolean;
|
|
64
|
+
}
|
|
65
|
+
interface DynamicColorPicker extends GenericColorPicker {
|
|
66
|
+
onlyFixedColors?: false;
|
|
67
|
+
/** Array of hexadecimal codes of the colors that will appear by default. It is
|
|
68
|
+
* also possible to specify a theme to customize the colors. */
|
|
69
|
+
colors: Array<string> | Array<ThemeColors>;
|
|
70
|
+
}
|
|
71
|
+
interface FixedColorPicker extends GenericColorPicker {
|
|
72
|
+
onlyFixedColors?: true;
|
|
73
|
+
/** Array of objects with { name: 'primitiveName', hex: '#xxxxxx' } */
|
|
74
|
+
colors: Array<ThemeFixedColors>;
|
|
75
|
+
}
|
|
76
|
+
export declare type BaseColorPicker = DynamicColorPicker | FixedColorPicker;
|
|
77
|
+
export interface BaseComponentArray extends GenericComponentField {
|
|
78
|
+
/** Campo para añadir múltiples componentes a un módulo. */
|
|
79
|
+
type: "ComponentArray";
|
|
80
|
+
}
|
|
81
|
+
export interface BaseComponentContainer extends GenericComponentField {
|
|
82
|
+
/** Field to add a single component to a module. */
|
|
83
|
+
type: "ComponentContainer";
|
|
84
|
+
}
|
|
85
|
+
export interface BaseConditionalField<FieldsType> extends GenericField {
|
|
86
|
+
/** Set of radio buttons to show or hide different fields according to the
|
|
87
|
+
* chosen value. The fields inside fields must have the key condition with one
|
|
88
|
+
* of the options values to show the field when the value of the radio button
|
|
89
|
+
* matches the condition. */
|
|
90
|
+
type: "ConditionalField";
|
|
91
|
+
/** Array of options (radio buttons). */
|
|
92
|
+
options: Array<Option>;
|
|
93
|
+
/** Array of fields for the conditional. */
|
|
94
|
+
fields: Array<FieldsType & {
|
|
95
|
+
condition: unknown;
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
export interface BaseDateField extends GenericField {
|
|
99
|
+
/** Field for dates. The date can be typed or chosen from a calendar. */
|
|
100
|
+
type: "DateField";
|
|
101
|
+
/** Enables the selection of a date range. Default: false. */
|
|
102
|
+
selectsRange?: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface BaseFieldGroup<FieldsType> extends GenericField {
|
|
105
|
+
type: "FieldGroup";
|
|
106
|
+
/** Array of fields belonging to the group. */
|
|
107
|
+
fields: Array<FieldsType>;
|
|
108
|
+
}
|
|
109
|
+
interface FieldsDividerData {
|
|
110
|
+
title: string;
|
|
111
|
+
text: string;
|
|
112
|
+
}
|
|
113
|
+
export interface BaseFieldsDivider extends GenericField {
|
|
114
|
+
/** Field to add a "divider" component between fields. */
|
|
115
|
+
type: "FieldsDivider";
|
|
116
|
+
/** Object with title and text fields (strings). */
|
|
117
|
+
data: FieldsDividerData;
|
|
118
|
+
}
|
|
119
|
+
export interface BaseFileField extends GenericField {
|
|
120
|
+
/** Field for uploading files. */
|
|
121
|
+
type: "FileField";
|
|
122
|
+
}
|
|
123
|
+
export interface BaseHeadingField extends GenericField {
|
|
124
|
+
/** Field with TextField + Select. Select is hidden by default. */
|
|
125
|
+
type: "HeadingField";
|
|
126
|
+
/** Required property to display the option to display the field. */
|
|
127
|
+
advanced?: boolean;
|
|
128
|
+
/** Field defaults. */
|
|
129
|
+
default: {
|
|
130
|
+
tag: HTMLTag;
|
|
131
|
+
content: string;
|
|
132
|
+
};
|
|
133
|
+
/** Array of options that will appear in the Select. */
|
|
134
|
+
options: Array<{
|
|
135
|
+
value: HTMLTag;
|
|
136
|
+
label: string;
|
|
137
|
+
}>;
|
|
138
|
+
}
|
|
139
|
+
export interface BaseImageField extends GenericField {
|
|
140
|
+
/** Allows the user to upload an image */
|
|
141
|
+
type: "ImageField";
|
|
142
|
+
/** If true crops the preview, if `false` scales the preview. Default: `false` */
|
|
143
|
+
cropPreview?: boolean;
|
|
144
|
+
}
|
|
145
|
+
export interface BaseLinkField extends GenericField {
|
|
146
|
+
/** Campo que combina `TextField` + `ConditionalField` (`UrlField` o
|
|
147
|
+
* `ComponentContainer`) */
|
|
148
|
+
type: "LinkField";
|
|
149
|
+
}
|
|
150
|
+
export interface BaseMultiCheckSelect extends GenericField, WithSource {
|
|
151
|
+
/** Campo que permite renderizar un AsyncCheckGroup dentro de una lista desplegable. */
|
|
152
|
+
type: "MultiCheckSelect";
|
|
153
|
+
}
|
|
154
|
+
export interface BaseMultiCheckSelectGroup extends GenericField {
|
|
155
|
+
/** Field to render multiple MultiCheckSelect. */
|
|
156
|
+
type: "MultiCheckSelectGroup";
|
|
157
|
+
/** `NoteField` with help text appearing under the label */
|
|
158
|
+
note?: string;
|
|
159
|
+
/** Array with the data from the different `MultiCheckSelect` */
|
|
160
|
+
elements: Array<DistributiveOmit<BaseMultiCheckSelect, "type">>;
|
|
161
|
+
/** If filled is `true` the field will have a white background. Default: false */
|
|
162
|
+
filled?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export interface BaseNoteField extends GenericField {
|
|
165
|
+
/** Field to add a highlighted text. */
|
|
166
|
+
type: "NoteField";
|
|
167
|
+
/** Default value for NoteField */
|
|
168
|
+
value?: {
|
|
169
|
+
title: string;
|
|
170
|
+
text: string;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export interface BaseNumberField extends Omit<BaseSliderField, "type" | "step"> {
|
|
174
|
+
/** Field for numbers. Includes buttons to increment or decrement the value of
|
|
175
|
+
* the field. */
|
|
176
|
+
type: "NumberField";
|
|
177
|
+
/** Min value */
|
|
178
|
+
minValue?: number;
|
|
179
|
+
/** Max value */
|
|
180
|
+
maxValue?: number;
|
|
181
|
+
}
|
|
182
|
+
export interface BaseRadioGroup extends GenericField, WithGroup {
|
|
183
|
+
/** Radio Fields Grouping. */
|
|
184
|
+
type: "RadioGroup";
|
|
185
|
+
}
|
|
186
|
+
export interface BaseReferenceField extends GenericField {
|
|
187
|
+
/** Field that loads Structured Data (usually pure) from the database. It is
|
|
188
|
+
* usually used in distributor modules. */
|
|
189
|
+
type: "ReferenceField";
|
|
190
|
+
/** Selection types: manual, automatic or both. Default: ["auto", "manual"]. */
|
|
191
|
+
selectionType?: Array<"auto" | "manual">;
|
|
192
|
+
/** Only manual mode. */
|
|
193
|
+
maxItems?: number;
|
|
194
|
+
/** Array with the structured data types that the field has to load. */
|
|
195
|
+
source: Array<string>;
|
|
196
|
+
}
|
|
197
|
+
export interface BaseRichText extends GenericField {
|
|
198
|
+
/** TextArea with simple editor that exports to markdown or html. Uses the
|
|
199
|
+
* draft.js and react-draft-wysiwyg.js libraries */
|
|
200
|
+
type: "RichText";
|
|
201
|
+
/** If true export to `html` instead of `markdown`. Default: `false`. */
|
|
202
|
+
html?: boolean;
|
|
203
|
+
}
|
|
204
|
+
export interface BaseSelect extends GenericField, WithDisabled {
|
|
205
|
+
/** Drop-down list. */
|
|
206
|
+
type: "Select";
|
|
207
|
+
/** Array of select options. */
|
|
208
|
+
options: Array<{
|
|
209
|
+
value: any;
|
|
210
|
+
label: string;
|
|
211
|
+
}>;
|
|
212
|
+
}
|
|
213
|
+
export interface BaseSliderField extends GenericField {
|
|
214
|
+
/** Field to render a slider. Returns a number. */
|
|
215
|
+
type: "SliderField";
|
|
216
|
+
/** Increment with each slider step. Default: `1` */
|
|
217
|
+
step?: 0.1 | 1 | 2 | 5 | 10 | (number & {});
|
|
218
|
+
/** Minimum slider value. Default: `1` */
|
|
219
|
+
min?: number;
|
|
220
|
+
/** Maximum slider value. Default: `100` */
|
|
221
|
+
max?: number;
|
|
222
|
+
/** String to display in front of the value in the slider tooltip. */
|
|
223
|
+
prefix?: string;
|
|
224
|
+
/** String to display after the value in the slider tooltip. */
|
|
225
|
+
suffix?: string;
|
|
226
|
+
/** Default value of the slider. Default is the minimum value. */
|
|
227
|
+
defaultValue?: number;
|
|
228
|
+
}
|
|
229
|
+
export interface BaseTextArea extends GenericField {
|
|
230
|
+
/** Text area input field. */
|
|
231
|
+
type: "TextArea";
|
|
232
|
+
}
|
|
233
|
+
export interface BaseTextField extends GenericField {
|
|
234
|
+
/** Text input field. */
|
|
235
|
+
type: "TextField";
|
|
236
|
+
}
|
|
237
|
+
export interface BaseToggleField extends GenericField {
|
|
238
|
+
/** A toggle button. */
|
|
239
|
+
type: "ToggleField";
|
|
240
|
+
}
|
|
241
|
+
export interface BaseUniqueCheck extends GenericField {
|
|
242
|
+
/** A single check field. */
|
|
243
|
+
type: "UniqueCheck";
|
|
244
|
+
/** Array with a single object with the text (label) of the check. */
|
|
245
|
+
options: Array<{
|
|
246
|
+
title: string;
|
|
247
|
+
}>;
|
|
248
|
+
}
|
|
249
|
+
export interface BaseUrlField extends GenericField {
|
|
250
|
+
/** `TextField` to link external pages or urls. Display two checkboxes for
|
|
251
|
+
* `nofollow` and open in a new tab: `newTab` */
|
|
252
|
+
type: "UrlField";
|
|
253
|
+
/** Enables to display checks. Default: `false`. */
|
|
254
|
+
advanced?: boolean;
|
|
255
|
+
}
|
|
256
|
+
export interface BaseVisualUniqueSelection extends GenericField {
|
|
257
|
+
/** Works as a `RadioGroup` but the options are images. */
|
|
258
|
+
type: "VisualUniqueSelection";
|
|
259
|
+
/** Width to distribute the options. */
|
|
260
|
+
columns?: number;
|
|
261
|
+
/** Array of radii to be displayed. */
|
|
262
|
+
options: Array<ThumbnailOption | ThemeVisualUniqueSelection>;
|
|
263
|
+
}
|
|
264
|
+
export interface BaseWysiwyg extends GenericField {
|
|
265
|
+
/** `TextArea` with Froala editor. */
|
|
266
|
+
type: "Wysiwyg";
|
|
267
|
+
/** Option to show the full version of the toolbar with all buttons. Default:
|
|
268
|
+
* `true`. */
|
|
269
|
+
full?: boolean;
|
|
270
|
+
}
|
|
271
|
+
export declare type BaseFields<T> = BaseArrayFieldGroup<T> | BaseAsyncCheckGroup | BaseAsyncSelect | BaseCheckGroup | BaseColorPicker | BaseComponentArray | BaseComponentContainer | BaseConditionalField<T> | BaseDateField | BaseFieldGroup<T> | BaseFieldsDivider | BaseFileField | BaseHeadingField | BaseImageField | BaseLinkField | BaseMultiCheckSelect | BaseMultiCheckSelectGroup | BaseNoteField | BaseNumberField | BaseRadioGroup | BaseReferenceField | BaseRichText | BaseSelect | BaseSliderField | BaseTextArea | BaseTextField | BaseToggleField | BaseUniqueCheck | BaseUrlField | BaseVisualUniqueSelection | BaseWysiwyg;
|
|
272
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
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, BaseTextArea, BaseTextField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
+
import { WithIndexable, WithSearchable, WithShowList, WithFrom } from "./props";
|
|
3
|
+
declare type Common = WithFrom & WithIndexable & WithSearchable & WithShowList;
|
|
4
|
+
export declare type ArrayFieldGroup = BaseArrayFieldGroup<PageDataFieldsSchema> & Common;
|
|
5
|
+
export declare type ConditionalField = BaseConditionalField<PageDataFieldsSchema> & Common;
|
|
6
|
+
export declare type FieldGroup = BaseFieldGroup<PageDataFieldsSchema> & Common;
|
|
7
|
+
export declare type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
|
|
8
|
+
export declare type AsyncSelect = BaseAsyncSelect & Common;
|
|
9
|
+
export declare type CheckGroup = BaseCheckGroup & Common;
|
|
10
|
+
export declare type ColorPicker = BaseColorPicker & Common;
|
|
11
|
+
export declare type ComponentArray = BaseComponentArray & Common;
|
|
12
|
+
export declare type ComponentContainer = BaseComponentContainer & Common;
|
|
13
|
+
export declare type DateField = BaseDateField & Common;
|
|
14
|
+
export declare type FieldsDivider = BaseFieldsDivider & Common;
|
|
15
|
+
export declare type FileField = BaseFileField & Common;
|
|
16
|
+
export declare type HeadingField = BaseHeadingField & Common;
|
|
17
|
+
export declare type ImageField = BaseImageField & Common;
|
|
18
|
+
export declare type LinkField = BaseLinkField & Common;
|
|
19
|
+
export declare type MultiCheckSelect = BaseMultiCheckSelect & Common;
|
|
20
|
+
export declare type MultiCheckSelectGroup = BaseMultiCheckSelectGroup & Common;
|
|
21
|
+
export declare type NoteField = BaseNoteField & Common;
|
|
22
|
+
export declare type NumberField = BaseNumberField & Common;
|
|
23
|
+
export declare type RadioGroup = BaseRadioGroup & Common;
|
|
24
|
+
export declare type ReferenceField = BaseReferenceField & Common;
|
|
25
|
+
export declare type RichText = BaseRichText & Common;
|
|
26
|
+
export declare type Select = BaseSelect & Common;
|
|
27
|
+
export declare type SliderField = BaseSliderField & Common;
|
|
28
|
+
export declare type TextArea = BaseTextArea & Common;
|
|
29
|
+
export declare type TextField = BaseTextField & Common;
|
|
30
|
+
export declare type ToggleField = BaseToggleField & Common;
|
|
31
|
+
export declare type UniqueCheck = BaseUniqueCheck & Common;
|
|
32
|
+
export declare type UrlField = BaseUrlField & Common;
|
|
33
|
+
export declare type VisualUniqueSelection = BaseVisualUniqueSelection & Common;
|
|
34
|
+
export declare type Wysiwyg = BaseWysiwyg & Common;
|
|
35
|
+
export declare type PageDataFieldsSchema = ArrayFieldGroup | ConditionalField | FieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ComponentArray | ComponentContainer | DateField | FieldsDivider | FileField | HeadingField | ImageField | LinkField | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TextArea | TextField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export declare type WithDisabled = {
|
|
2
|
+
/** If select is disabled. Default: `false`. */
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare type WithEntity = {
|
|
6
|
+
/** Type of entity from which you have to load the options. */
|
|
7
|
+
entity: "menu_containers" | "pages" | "categories";
|
|
8
|
+
};
|
|
9
|
+
export declare type WithFrom = {
|
|
10
|
+
/** The property of the page template from which the value of that field should
|
|
11
|
+
* be extracted. */
|
|
12
|
+
from: string;
|
|
13
|
+
};
|
|
14
|
+
export declare type WithGroup = {
|
|
15
|
+
/** Array of elements to be displayed */
|
|
16
|
+
options: Array<Option>;
|
|
17
|
+
};
|
|
18
|
+
export declare type WithHelpText = {
|
|
19
|
+
/** Help text that appears below the field. */
|
|
20
|
+
helptext?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare type WithHideable = {
|
|
23
|
+
/** If `true` the field can be hidden in the editor. */
|
|
24
|
+
hideable?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare type HTMLTag = "h1" | "h2" | "h3" | "h4" | "span" | (string & {});
|
|
27
|
+
export declare type WithIndexable = {
|
|
28
|
+
/** Default is false. If that field is to be used as an index (to be able to
|
|
29
|
+
* sort by that field, etc.) */
|
|
30
|
+
indexable?: boolean;
|
|
31
|
+
};
|
|
32
|
+
/** Por defecto es false. Si ese campo se va a utilizar como índice (para poder
|
|
33
|
+
* ordenar por ese campo, etc.) */
|
|
34
|
+
export declare type WithIsMockup = {
|
|
35
|
+
/** Mark the content of the default field as dummy content which forces the
|
|
36
|
+
* user editor to change it. Otherwise when trying to publish the Griddo
|
|
37
|
+
* editor will warn us to change it. */
|
|
38
|
+
isMockup?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export declare type Option = {
|
|
41
|
+
/** Label that will appear in the form. */
|
|
42
|
+
title: string;
|
|
43
|
+
/** Field name. */
|
|
44
|
+
name: string;
|
|
45
|
+
/** Value to be sent to the API. */
|
|
46
|
+
value: unknown;
|
|
47
|
+
/** If the option is disabled. */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export declare type WithPlaceHolder = {
|
|
51
|
+
/** Sample content text. */
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
};
|
|
54
|
+
export declare type WithPrefix = {
|
|
55
|
+
/** Fixed string to appear and be included in the field value. */
|
|
56
|
+
prefix?: "#" | (string & {});
|
|
57
|
+
};
|
|
58
|
+
export declare type WithReadonly = {
|
|
59
|
+
/** If the field is read-only. */
|
|
60
|
+
readonly?: boolean;
|
|
61
|
+
};
|
|
62
|
+
export declare type WithSearchable = {
|
|
63
|
+
/** Only for the field with key "title". If set to false, this title will not
|
|
64
|
+
* be used in searches. */
|
|
65
|
+
searchable?: boolean;
|
|
66
|
+
};
|
|
67
|
+
export declare type SearchFrom = {
|
|
68
|
+
/** An array of `keys` representing the fields by which a search can be
|
|
69
|
+
* performed. */
|
|
70
|
+
searchFrom?: Array<string>;
|
|
71
|
+
};
|
|
72
|
+
export declare type WithShowList = {
|
|
73
|
+
/** Default is false. If in the lists this field must be included as another
|
|
74
|
+
* data. WARNING: normally if it is showList it must also be indexable. */
|
|
75
|
+
showList?: boolean;
|
|
76
|
+
};
|
|
77
|
+
export declare type WithSlugTo = {
|
|
78
|
+
/** If a key is specified, the value of this field will appear in the text
|
|
79
|
+
* field that has that key in slug format. */
|
|
80
|
+
slugTo?: string;
|
|
81
|
+
};
|
|
82
|
+
export declare type WithSource = {
|
|
83
|
+
/** Structured data type from which you have to load the options. */
|
|
84
|
+
source: string;
|
|
85
|
+
};
|
|
86
|
+
export declare type ThemeColors = {
|
|
87
|
+
theme: string;
|
|
88
|
+
options: Array<string>;
|
|
89
|
+
};
|
|
90
|
+
export declare type ThemeFixedColors = {
|
|
91
|
+
theme: string;
|
|
92
|
+
options: Array<{
|
|
93
|
+
name: string;
|
|
94
|
+
hex: string;
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
97
|
+
export declare type ThemeVisualUniqueSelection = {
|
|
98
|
+
theme: string;
|
|
99
|
+
options: Array<ThumbnailOption>;
|
|
100
|
+
};
|
|
101
|
+
export declare type ThumbnailOption = {
|
|
102
|
+
value: unknown;
|
|
103
|
+
img: string;
|
|
104
|
+
};
|
|
105
|
+
export declare type WithValidators = {
|
|
106
|
+
/** Validation of `string`, `number` and `date` type fields. */
|
|
107
|
+
validators?: {
|
|
108
|
+
/** Validates the minimum length of a string. */
|
|
109
|
+
minChar?: number;
|
|
110
|
+
/** Validates the maximum length of a string. */
|
|
111
|
+
maxChar?: number;
|
|
112
|
+
/** Validates the minimum value of a number. */
|
|
113
|
+
minValue?: number;
|
|
114
|
+
/** Validates the maximum value of a number. */
|
|
115
|
+
maxValue?: number;
|
|
116
|
+
/** Validates that the content of the field complies with a specific format. */
|
|
117
|
+
format?: "email" | "URL" | "phone";
|
|
118
|
+
/** Validates that the date is in the future or past according to the current
|
|
119
|
+
* day. */
|
|
120
|
+
dateFormat?: "futureDate" | "pastDate";
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
export declare type WithValue = {
|
|
124
|
+
/** Default value of the field. */
|
|
125
|
+
value?: unknown;
|
|
126
|
+
};
|
|
127
|
+
export declare type WithWhiteList = {
|
|
128
|
+
/** Array of strings with the names of the modules or components that can be
|
|
129
|
+
* added. */
|
|
130
|
+
whiteList: Array<string>;
|
|
131
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTextArea, BaseTextField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
+
import { WithHelpText, WithHideable, WithIndexable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithSearchable, WithShowList, WithSlugTo, WithValidators } from "./props";
|
|
3
|
+
declare type Common = WithHideable & WithIndexable & WithSearchable & WithShowList & WithHelpText;
|
|
4
|
+
export declare type ArrayFieldGroup = BaseArrayFieldGroup<PureDataFieldsSchema> & Common;
|
|
5
|
+
export declare type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
|
|
6
|
+
export declare type AsyncSelect = BaseAsyncSelect & Common & WithPlaceHolder;
|
|
7
|
+
export declare type CheckGroup = BaseCheckGroup & Common;
|
|
8
|
+
export declare type ColorPicker = BaseColorPicker & Common;
|
|
9
|
+
export declare type ConditionalField = BaseConditionalField<PureDataFieldsSchema> & Common;
|
|
10
|
+
export declare type DateField = BaseDateField & WithValidators & Common & WithPlaceHolder;
|
|
11
|
+
export declare type FieldGroup = BaseFieldGroup<PureDataFieldsSchema> & Common;
|
|
12
|
+
export declare type FieldsDivider = BaseFieldsDivider & Common;
|
|
13
|
+
export declare type FileField = BaseFileField & Common & WithPlaceHolder;
|
|
14
|
+
export declare type HeadingField = BaseHeadingField & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
15
|
+
export declare type ImageField = BaseImageField & WithIsMockup & Common;
|
|
16
|
+
export declare type LinkField = BaseLinkField & Common;
|
|
17
|
+
export declare type MultiCheckSelect = BaseMultiCheckSelect & Common;
|
|
18
|
+
export declare type MultiCheckSelectGroup = BaseMultiCheckSelectGroup & Common;
|
|
19
|
+
export declare type NoteField = BaseNoteField & Common;
|
|
20
|
+
export declare type NumberField = BaseNumberField & WithValidators & Common & WithPlaceHolder;
|
|
21
|
+
export declare type RadioGroup = BaseRadioGroup & Common;
|
|
22
|
+
export declare type ReferenceField = BaseReferenceField & Common;
|
|
23
|
+
export declare type RichText = BaseRichText & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
24
|
+
export declare type Select = BaseSelect & WithValidators & Common & WithPlaceHolder;
|
|
25
|
+
export declare type SliderField = BaseSliderField & WithValidators & Common;
|
|
26
|
+
export declare type TextArea = BaseTextArea & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
27
|
+
export declare type TextField = BaseTextField & WithIsMockup & WithValidators & WithReadonly & WithSlugTo & WithPrefix & WithPlaceHolder & Common;
|
|
28
|
+
export declare type ToggleField = BaseToggleField & Common;
|
|
29
|
+
export declare type UniqueCheck = BaseUniqueCheck & Common;
|
|
30
|
+
export declare type UrlField = BaseUrlField & WithValidators & Common & WithPlaceHolder;
|
|
31
|
+
export declare type VisualUniqueSelection = BaseVisualUniqueSelection & Common;
|
|
32
|
+
export declare type Wysiwyg = BaseWysiwyg & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
33
|
+
export declare type PureDataFieldsSchema = ArrayFieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ConditionalField | DateField | FieldGroup | FieldsDivider | FileField | HeadingField | ImageField | LinkField | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TextArea | TextField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
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, BaseTextArea, BaseTextField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
+
import { WithHelpText, WithHideable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithSlugTo, WithValidators, WithValue, WithWhiteList } from "./props";
|
|
3
|
+
export declare type Common = WithHelpText & WithHideable & WithValue;
|
|
4
|
+
export declare type ArrayFieldGroup = BaseArrayFieldGroup<UIFieldsSchema> & Common;
|
|
5
|
+
export declare type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
|
|
6
|
+
export declare type AsyncSelect = BaseAsyncSelect & Common & WithPlaceHolder;
|
|
7
|
+
export declare type CheckGroup = BaseCheckGroup & Common;
|
|
8
|
+
export declare type ColorPicker = BaseColorPicker & Common;
|
|
9
|
+
export declare type ComponentArray = BaseComponentArray & WithWhiteList & Common;
|
|
10
|
+
export declare type ComponentContainer = BaseComponentContainer & WithWhiteList & Common;
|
|
11
|
+
export declare type ConditionalField = BaseConditionalField<UIFieldsSchema> & Common;
|
|
12
|
+
export declare type DateField = BaseDateField & WithValidators & Common & WithPlaceHolder;
|
|
13
|
+
export declare type FieldGroup = BaseFieldGroup<UIFieldsSchema> & Common;
|
|
14
|
+
export declare type FieldsDivider = BaseFieldsDivider & Common;
|
|
15
|
+
export declare type FileField = BaseFileField & Common & WithPlaceHolder;
|
|
16
|
+
export declare type HeadingField = BaseHeadingField & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
17
|
+
export declare type ImageField = BaseImageField & WithIsMockup & Common;
|
|
18
|
+
export declare type LinkField = BaseLinkField & WithWhiteList & Common;
|
|
19
|
+
export declare type MultiCheckSelect = BaseMultiCheckSelect & Common;
|
|
20
|
+
export declare type MultiCheckSelectGroup = BaseMultiCheckSelectGroup & Common;
|
|
21
|
+
export declare type NoteField = BaseNoteField & Common;
|
|
22
|
+
export declare type NumberField = BaseNumberField & WithValidators & Common;
|
|
23
|
+
export declare type RadioGroup = BaseRadioGroup & Common;
|
|
24
|
+
export declare type ReferenceField = BaseReferenceField & Common;
|
|
25
|
+
export declare type RichText = BaseRichText & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
26
|
+
export declare type Select = BaseSelect & WithValidators & Common & WithPlaceHolder;
|
|
27
|
+
export declare type SliderField = BaseSliderField & WithValidators & Common;
|
|
28
|
+
export declare type TextArea = BaseTextArea & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
29
|
+
export declare type TextField = BaseTextField & WithIsMockup & WithValidators & WithReadonly & WithSlugTo & WithPrefix & WithPlaceHolder & Common;
|
|
30
|
+
export declare type ToggleField = BaseToggleField & Common;
|
|
31
|
+
export declare type UniqueCheck = BaseUniqueCheck & Common;
|
|
32
|
+
export declare type UrlField = BaseUrlField & WithValidators & Common & WithPlaceHolder;
|
|
33
|
+
export declare type VisualUniqueSelection = BaseVisualUniqueSelection & Common;
|
|
34
|
+
export declare type Wysiwyg = BaseWysiwyg & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
35
|
+
export declare type UIFieldsSchema = ArrayFieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ComponentArray | ComponentContainer | ConditionalField | DateField | FieldGroup | FieldsDivider | FileField | HeadingField | ImageField | LinkField | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TextArea | TextField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataPacks } from "./props";
|
|
2
|
+
import { BaseDataSchema } from "./base";
|
|
3
|
+
export interface CategoriesSchema extends BaseDataSchema, Required<DataPacks> {
|
|
4
|
+
/** Indicates that it is a category, must always be `true` */
|
|
5
|
+
taxonomy: true;
|
|
6
|
+
/** It is not necessary to indicate `fromPage` in the categories as they must
|
|
7
|
+
* always be `false`.
|
|
8
|
+
* @deprecated */
|
|
9
|
+
fromPage?: false;
|
|
10
|
+
/** It is not necessary to indicate `schema` in the categories.
|
|
11
|
+
* @deprecated */
|
|
12
|
+
schema?: never;
|
|
13
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export interface DamDefaultsSchema {
|
|
2
|
+
/** Quality compression for the jpeg, webp and avif formats */
|
|
2
3
|
quality?: number;
|
|
4
|
+
/** Kind of crop of Griddo DAM */
|
|
3
5
|
crop?: "cover" | "contain" | "fill" | "inside" | "outside";
|
|
4
6
|
loading?: "eager" | "lazy";
|
|
5
7
|
decoding?: "auto" | "async" | "sync";
|
|
6
|
-
formats?:
|
|
8
|
+
formats?: Array<"webp" | "avif">;
|
|
7
9
|
blurSize?: string;
|
|
8
10
|
blurCSSTransition?: string;
|
|
9
11
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface DataPackSchema {
|
|
2
|
+
/** Title of the Data Pack that will appear in the Griddo editor. */
|
|
3
|
+
title: string;
|
|
4
|
+
/** Data Pack Category */
|
|
5
|
+
category: string;
|
|
6
|
+
/** Description of the Data Pack that will appear in the Griddo editor. */
|
|
7
|
+
description: string;
|
|
8
|
+
/** Thumbnail of the Data Pack that will appear in the Griddo editor. It can be
|
|
9
|
+
* an image or an object representing an image for each teheme. */
|
|
10
|
+
image?: {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
} | string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ConfigTabs, Thumbnails } from "./props";
|
|
2
|
+
export interface HeaderFooterSchema {
|
|
3
|
+
schemaType: "module";
|
|
4
|
+
/** Indicates whether a module is treated as footer or header. If specified, it
|
|
5
|
+
* will be mandatory to specify if it is the default module with the
|
|
6
|
+
* `defaultNavigation` prop. */
|
|
7
|
+
type: "footer" | "header";
|
|
8
|
+
/** Name of the React component for the schema */
|
|
9
|
+
component: string;
|
|
10
|
+
/** Indica si este módulo será el seleccionado por defecto */
|
|
11
|
+
defaultNavigation?: boolean;
|
|
12
|
+
/** Name to represent the component, module or template in the Griddo editor
|
|
13
|
+
* interface. */
|
|
14
|
+
displayName: string;
|
|
15
|
+
/** Array of objects representing each of the tabs of the component, module or
|
|
16
|
+
* template in the Griddo editor where the form fields for data entry will be
|
|
17
|
+
* displayed. */
|
|
18
|
+
configTabs: Array<ConfigTabs>;
|
|
19
|
+
/** Object to set default values for schema keys. */
|
|
20
|
+
default: {
|
|
21
|
+
/** Name of the component or module of this schema */
|
|
22
|
+
component: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
/** Images to use as thumbnail (as in the `VisualUniqueSelection`) in the
|
|
26
|
+
* selection of styles of a menu item */
|
|
27
|
+
styles?: {
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
};
|
|
30
|
+
/** Images that represent the component, module or template in the Griddo
|
|
31
|
+
* editor. */
|
|
32
|
+
thumbnails?: Thumbnails | {
|
|
33
|
+
[key: string]: Thumbnails;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SearchFrom } from "../fields/props";
|
|
2
|
+
import { PageDataFieldsSchema } from "../fields/page-data-fields";
|
|
3
|
+
import { DataPacks, ExpirationData } from "./props";
|
|
4
|
+
import { BaseDataSchema } from "./base";
|
|
5
|
+
declare type PageDataSchemaProp = SearchFrom & {
|
|
6
|
+
/** The name of the Reacttemplates to use with the page type Schema. */
|
|
7
|
+
templates: Array<string>;
|
|
8
|
+
/** An array of Griddo fields. */
|
|
9
|
+
fields: Array<PageDataFieldsSchema>;
|
|
10
|
+
};
|
|
11
|
+
export interface PageDataSchema extends BaseDataSchema, DataPacks, ExpirationData {
|
|
12
|
+
/** It is not necessary to specify the `taxonomy` prop because it will always
|
|
13
|
+
* be `false`. @deprecated */
|
|
14
|
+
taxonomy?: false;
|
|
15
|
+
/** Indicates that the data is of type page. Must always be `true`. */
|
|
16
|
+
fromPage: true;
|
|
17
|
+
/** Schema for data. */
|
|
18
|
+
schema: PageDataSchemaProp | null;
|
|
19
|
+
}
|
|
20
|
+
export {};
|