@griddo/core 1.75.234 → 1.75.236
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/dist/autotypes.cjs.js +1 -1
- package/dist/autotypes.cjs.js.map +1 -1
- package/dist/autotypes.js +1 -1
- package/dist/autotypes.js.map +1 -1
- package/dist/functions/autotypes/getTypeFromField.d.ts +1 -1
- package/dist/functions/autotypes/getTypesFromSchemas.d.ts +8 -0
- package/dist/functions/autotypes/main.d.ts +2 -0
- package/dist/functions/autotypes/types.d.ts +2 -2
- package/dist/functions/autotypes/utils.d.ts +39 -4
- package/dist/types/api-response-fields/index.d.ts +34 -17
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/global.d.ts +18 -0
- package/dist/types/schema-fields/base.d.ts +13 -0
- package/dist/types/schema-fields/page-content-type-fields.d.ts +3 -2
- package/dist/types/schema-fields/props.d.ts +4 -0
- package/dist/types/schema-fields/simple-content-type-fields.d.ts +2 -1
- package/dist/types/schema-fields/ui-fields.d.ts +9 -8
- package/package.json +3 -2
- package/dist/functions/autotypes/common.d.ts +0 -2
- /package/dist/functions/autotypes/{index.es.d.ts → index.d.ts} +0 -0
package/dist/types/global.d.ts
CHANGED
|
@@ -59,8 +59,26 @@ export type FiltersDataApiQueryResponseProps<ContentType> = ContentType extends
|
|
|
59
59
|
items: Array<FilterDataItem>;
|
|
60
60
|
};
|
|
61
61
|
} : never;
|
|
62
|
+
/** Rename a prop in a type while picking it
|
|
63
|
+
* @example
|
|
64
|
+
* // Pick the prop foo from T and rename it to bar
|
|
65
|
+
* PickRename<T, "foo", "bar">
|
|
66
|
+
*/
|
|
62
67
|
export type PickRename<T, K extends keyof T, R extends PropertyKey> = Omit<T, K> & {
|
|
63
68
|
[P in R]: T[K];
|
|
64
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Helper type for autotypes in order to 'manage' hideable state for schemas.
|
|
72
|
+
*/
|
|
65
73
|
export type Hideable<T> = T | null;
|
|
74
|
+
/**
|
|
75
|
+
* Just for use temporally and get full type props information on hover.
|
|
76
|
+
|
|
77
|
+
* @example
|
|
78
|
+
* const myVar = Pretty<SomeType> = ...
|
|
79
|
+
* // ^ hover `myVar` shows full detail of props from `SomeType`
|
|
80
|
+
*/
|
|
81
|
+
export type Pretty<T> = {
|
|
82
|
+
[K in keyof T]: T[K];
|
|
83
|
+
} & {};
|
|
66
84
|
export {};
|
|
@@ -259,6 +259,19 @@ export interface BaseTextField extends GenericField {
|
|
|
259
259
|
/** Text input field. */
|
|
260
260
|
type: "TextField";
|
|
261
261
|
}
|
|
262
|
+
export interface BaseTimeField extends GenericField {
|
|
263
|
+
/**
|
|
264
|
+
* Text input field.
|
|
265
|
+
*
|
|
266
|
+
* xThe default vale must be in the format "00:00 AM/PM".
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* default {
|
|
270
|
+
* timeFieldKey: "12:42 PM"
|
|
271
|
+
* }
|
|
272
|
+
*/
|
|
273
|
+
type: "TimeField";
|
|
274
|
+
}
|
|
262
275
|
export interface BaseToggleField extends GenericField {
|
|
263
276
|
/** A toggle button. */
|
|
264
277
|
type: "ToggleField";
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
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, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
2
|
import { WithIndexable, WithShowList, WithFrom, WithRelations_AutoTypes, WithWhiteList } from "./props";
|
|
3
3
|
type Common = WithFrom & WithIndexable & WithShowList;
|
|
4
4
|
export type ArrayFieldGroup = BaseArrayFieldGroup<PageContentTypeFields> & Common;
|
|
@@ -27,10 +27,11 @@ export type Select = BaseSelect & Common;
|
|
|
27
27
|
export type SliderField = BaseSliderField & Common;
|
|
28
28
|
export type TextArea = BaseTextArea & Common;
|
|
29
29
|
export type TextField = BaseTextField & Common;
|
|
30
|
+
export type TimeField = BaseTimeField & Common;
|
|
30
31
|
export type ToggleField = BaseToggleField & Common;
|
|
31
32
|
export type UniqueCheck = BaseUniqueCheck & Common;
|
|
32
33
|
export type UrlField = BaseUrlField & Common;
|
|
33
34
|
export type VisualUniqueSelection = BaseVisualUniqueSelection & Common;
|
|
34
35
|
export type Wysiwyg = BaseWysiwyg & Common;
|
|
35
|
-
export type PageContentTypeFields<WhiteListElements = unknown> = ArrayFieldGroup | ConditionalField | FieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ComponentArray<WhiteListElements> | ComponentContainer<WhiteListElements> | DateField | FieldsDivider | FileField | HeadingField | ImageField | LinkField<WhiteListElements> | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TextArea | TextField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
|
|
36
|
+
export type PageContentTypeFields<WhiteListElements = unknown> = ArrayFieldGroup | ConditionalField | FieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ComponentArray<WhiteListElements> | ComponentContainer<WhiteListElements> | DateField | FieldsDivider | FileField | HeadingField | ImageField | LinkField<WhiteListElements> | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TextArea | TextField | TimeField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
|
|
36
37
|
export {};
|
|
@@ -22,6 +22,10 @@ export type WithHideable = {
|
|
|
22
22
|
/** If `true` the field can be hidden in the editor. */
|
|
23
23
|
hideable?: boolean;
|
|
24
24
|
};
|
|
25
|
+
export type WithHumanReadable = {
|
|
26
|
+
/** Allows to use this field as natural language. */
|
|
27
|
+
humanReadable?: boolean;
|
|
28
|
+
};
|
|
25
29
|
export type WithIndexable = {
|
|
26
30
|
/** Default is false. If that field is to be used as an index (to be able to sort by that field, etc.) */
|
|
27
31
|
indexable?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
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, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
2
|
import { WithHelpText, WithHideable, WithIndexable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithShowList, WithSlugTo, WithValidators, WithWhiteList } from "./props";
|
|
3
3
|
type Common = WithHideable & WithIndexable & WithShowList & WithHelpText;
|
|
4
4
|
export type ArrayFieldGroup = BaseArrayFieldGroup<SimpleContentTypeFields> & Common;
|
|
@@ -25,6 +25,7 @@ export type Select = BaseSelect & WithValidators & Common & WithPlaceHolder;
|
|
|
25
25
|
export type SliderField = BaseSliderField & WithValidators & Common;
|
|
26
26
|
export type TextArea = BaseTextArea & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
27
27
|
export type TextField = BaseTextField & WithIsMockup & WithValidators & WithReadonly & WithSlugTo & WithPrefix & WithPlaceHolder & Common;
|
|
28
|
+
export type TimeField = BaseTimeField & WithIsMockup & WithReadonly & WithPlaceHolder & Common;
|
|
28
29
|
export type ToggleField = BaseToggleField & Common;
|
|
29
30
|
export type UniqueCheck = BaseUniqueCheck & Common;
|
|
30
31
|
export type UrlField = BaseUrlField & WithValidators & Common & WithPlaceHolder;
|
|
@@ -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, BaseTextArea, BaseTextField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
-
import { WithHelpText, WithHideable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithSlugTo, WithValidators, WithWhiteList } from "./props";
|
|
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, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
+
import { WithHelpText, WithHideable, WithHumanReadable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoTypes, WithSlugTo, WithValidators, WithWhiteList } from "./props";
|
|
3
3
|
export type Common = WithHelpText & WithHideable;
|
|
4
4
|
export type ArrayFieldGroup = BaseArrayFieldGroup<UIFields> & Common;
|
|
5
5
|
export type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
|
|
@@ -13,7 +13,7 @@ export type DateField = BaseDateField & WithValidators & Common & WithPlaceHolde
|
|
|
13
13
|
export type FieldGroup = BaseFieldGroup<UIFields> & Common;
|
|
14
14
|
export type FieldsDivider = BaseFieldsDivider & Common;
|
|
15
15
|
export type FileField = BaseFileField & Common & WithPlaceHolder;
|
|
16
|
-
export type HeadingField = BaseHeadingField & WithIsMockup & WithValidators &
|
|
16
|
+
export type HeadingField = BaseHeadingField & WithIsMockup & WithValidators & WithPlaceHolder & WithHumanReadable & Common;
|
|
17
17
|
export type ImageField = BaseImageField & WithIsMockup & Common;
|
|
18
18
|
export type LinkField<WhiteListElements = unknown> = BaseLinkField & WithWhiteList<WhiteListElements> & Common;
|
|
19
19
|
export type MultiCheckSelect = BaseMultiCheckSelect & WithRelations_AutoTypes & Common;
|
|
@@ -22,14 +22,15 @@ export type NoteField = BaseNoteField & Common;
|
|
|
22
22
|
export type NumberField = BaseNumberField & WithValidators & Common;
|
|
23
23
|
export type RadioGroup = BaseRadioGroup & Common;
|
|
24
24
|
export type ReferenceField = BaseReferenceField & Common;
|
|
25
|
-
export type RichText = BaseRichText & WithIsMockup & WithValidators &
|
|
25
|
+
export type RichText = BaseRichText & WithIsMockup & WithValidators & WithPlaceHolder & WithHumanReadable & Common;
|
|
26
26
|
export type Select = BaseSelect & WithValidators & Common & WithPlaceHolder;
|
|
27
27
|
export type SliderField = BaseSliderField & WithValidators & Common;
|
|
28
|
-
export type TextArea = BaseTextArea & WithIsMockup & WithValidators &
|
|
29
|
-
export type TextField = BaseTextField & WithIsMockup & WithValidators & WithReadonly & WithSlugTo & WithPrefix & WithPlaceHolder & Common;
|
|
28
|
+
export type TextArea = BaseTextArea & WithIsMockup & WithValidators & WithPlaceHolder & WithHumanReadable & Common;
|
|
29
|
+
export type TextField = BaseTextField & WithIsMockup & WithValidators & WithReadonly & WithSlugTo & WithPrefix & WithPlaceHolder & WithHumanReadable & Common;
|
|
30
|
+
export type TimeField = BaseTimeField & WithIsMockup & WithReadonly & Common;
|
|
30
31
|
export type ToggleField = BaseToggleField & Common;
|
|
31
32
|
export type UniqueCheck = BaseUniqueCheck & Common;
|
|
32
33
|
export type UrlField = BaseUrlField & WithValidators & Common & WithPlaceHolder;
|
|
33
34
|
export type VisualUniqueSelection = BaseVisualUniqueSelection & Common;
|
|
34
|
-
export type Wysiwyg = BaseWysiwyg & WithIsMockup & WithValidators &
|
|
35
|
-
export type UIFields<WhiteListElements = unknown> = ArrayFieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ComponentArray<WhiteListElements> | ComponentContainer<WhiteListElements> | ConditionalField | DateField | FieldGroup | FieldsDivider | FileField | HeadingField | ImageField | LinkField<WhiteListElements> | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TextArea | TextField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
|
|
35
|
+
export type Wysiwyg = BaseWysiwyg & WithIsMockup & WithValidators & WithPlaceHolder & WithHumanReadable & Common;
|
|
36
|
+
export type UIFields<WhiteListElements = unknown> = ArrayFieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ComponentArray<WhiteListElements> | ComponentContainer<WhiteListElements> | ConditionalField | DateField | FieldGroup | FieldsDivider | FileField | HeadingField | ImageField | LinkField<WhiteListElements> | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TextArea | TextField | TimeField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@griddo/core",
|
|
3
3
|
"description": "Reload version of Griddo Core",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
-
"version": "1.75.
|
|
5
|
+
"version": "1.75.236",
|
|
6
6
|
"authors": [
|
|
7
7
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
8
8
|
"Diego M. Béjar <diego.bejar@secuoyas.com>",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "rollup -c --sourcemap --bundleConfigAsCjs",
|
|
26
|
+
"watch": "rollup -cw --bundleConfigAsCjs",
|
|
26
27
|
"build-storybook": "build-storybook",
|
|
27
28
|
"clean": "rm -rf ./dist",
|
|
28
29
|
"publish:stable": "yarn build && npm version patch && npm publish",
|
|
@@ -77,5 +78,5 @@
|
|
|
77
78
|
"resolutions": {
|
|
78
79
|
"colors": "1.4.0"
|
|
79
80
|
},
|
|
80
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "2f37300231c7a06193cac411e84898c2f34d3c2f"
|
|
81
82
|
}
|
|
File without changes
|