@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.
@@ -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 & Common & WithPlaceHolder;
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 & Common & WithPlaceHolder;
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 & Common & WithPlaceHolder;
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 & Common & WithPlaceHolder;
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.234",
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": "72fa813b334bd08b6eb55a3f26c8629e752ae39c"
81
+ "gitHead": "2f37300231c7a06193cac411e84898c2f34d3c2f"
81
82
  }
@@ -1,2 +0,0 @@
1
- import type { SchemaType } from "./types";
2
- export declare function main(schemas: Record<string, SchemaType>): Promise<void>;