@griddo/core 11.0.22 → 11.0.23-rc.0
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 +0 -1
- package/dist/autotypes.js +1 -1
- package/dist/autotypes.js.map +1 -1
- package/dist/bin-tools/autotypes/autotypes.d.ts +11 -0
- package/dist/{functions → bin-tools}/autotypes/factories/index.d.ts +3 -1
- package/dist/{functions → bin-tools}/autotypes/factories/names/getComponents.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/names/getDetailTemplates.d.ts +1 -1
- package/dist/bin-tools/autotypes/factories/names/getFormFieldsNames.d.ts +2 -0
- package/dist/bin-tools/autotypes/factories/names/getFormTemplatesNames.d.ts +2 -0
- package/dist/{functions → bin-tools}/autotypes/factories/names/getModules.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/names/getPageData.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/names/getSimpleData.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/names/getTaxonomy.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/names/getTemplates.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/props/getPageData.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/props/getSectionList.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/props/getSimpleData.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/props/getTaxonomyData.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/props/getTypeFromField/index.d.ts +8 -5
- package/dist/{functions → bin-tools}/autotypes/factories/props/getUIAndData/utils.d.ts +3 -3
- package/dist/{functions → bin-tools}/autotypes/factories/schemas/getDataPacks.d.ts +1 -1
- package/dist/{functions/autotypes/factories/schemas/getMenuItems/index.d.ts → bin-tools/autotypes/factories/schemas/getMenuItems.d.ts} +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/schemas/getModuleCategories.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/factories/schemas/getThemes.d.ts +1 -1
- package/dist/{functions → bin-tools}/autotypes/misc/ascii.d.ts +1 -2
- package/dist/bin-tools/autotypes/misc/types.d.ts +79 -0
- package/dist/{functions → bin-tools}/autotypes/misc/utils.d.ts +6 -6
- package/dist/components/CloudinaryImage/index.d.ts +16 -0
- package/dist/components/Component/index.d.ts +15 -9
- package/dist/components/LdJson/index.d.ts +3 -5
- package/dist/components/Link/index.d.ts +4 -0
- package/dist/components/Page/utils.d.ts +24 -0
- package/dist/functions/index.d.ts +3 -7
- package/dist/functions/localeDate/index.d.ts +15 -0
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/useLocaleDate.d.ts +1 -16
- package/dist/index.d.ts +4 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.js +1 -31
- package/dist/react-svg-library.js.map +1 -1
- package/dist/types/api-response-fields/index.d.ts +3 -0
- package/dist/types/core/index.d.ts +2 -2
- package/dist/types/schema-fields/base.d.ts +8 -1
- package/dist/types/schema-fields/props.d.ts +14 -3
- package/dist/types/schema-fields/simple-content-type-fields.d.ts +3 -3
- package/dist/types/schema-fields/ui-fields.d.ts +3 -2
- package/dist/types/schema-fields/ui-form-fields.d.ts +37 -0
- package/dist/types/schema-fields/ui-form-template-fields.d.ts +37 -0
- package/dist/types/schema-fields/ui-template-fields.d.ts +2 -2
- package/dist/types/schemas/FormCategories.d.ts +9 -0
- package/dist/types/schemas/SimpleContentType.d.ts +9 -0
- package/dist/types/schemas/UI.d.ts +40 -3
- package/dist/types/schemas/index.d.ts +3 -2
- package/dist/utils/index.d.ts +20 -0
- package/package.json +2 -2
- package/dist/autotypes-legacy.js +0 -2
- package/dist/autotypes-legacy.js.map +0 -1
- package/dist/constants/cloudinary.d.ts +0 -17
- package/dist/functions/autotypes/factories/schemas/getMenuItems/utils.d.ts +0 -3
- package/dist/functions/autotypes/index.d.ts +0 -2
- package/dist/functions/autotypes/misc/types.d.ts +0 -56
- package/dist/functions/autotypes-legacy/ascii.d.ts +0 -3
- package/dist/functions/autotypes-legacy/constants.d.ts +0 -5
- package/dist/functions/autotypes-legacy/getMenuItemsProps.d.ts +0 -3
- package/dist/functions/autotypes-legacy/getTypeFromField.d.ts +0 -24
- package/dist/functions/autotypes-legacy/getTypesFromSchemas.d.ts +0 -15
- package/dist/functions/autotypes-legacy/index.cjs.d.ts +0 -1
- package/dist/functions/autotypes-legacy/main.d.ts +0 -5
- package/dist/functions/autotypes-legacy/types.d.ts +0 -24
- package/dist/functions/autotypes-legacy/utils.d.ts +0 -92
- package/dist/functions/utils.d.ts +0 -52
- /package/dist/{functions → bin-tools}/autotypes/factories/props/getTypeFromField/utils.d.ts +0 -0
- /package/dist/{functions → bin-tools}/autotypes/factories/props/getUIAndData/index.d.ts +0 -0
- /package/dist/{functions → bin-tools}/autotypes/factories/schemas/getLanguages.d.ts +0 -0
- /package/dist/{functions/autotypes-legacy → bin-tools/autotypes}/index.d.ts +0 -0
- /package/dist/{functions → bin-tools}/react-svg-library/index.d.ts +0 -0
- /package/dist/{functions → bin-tools}/react-svg-library/utils.d.ts +0 -0
- /package/dist/{assets → components/Component/ComponentWrapper}/svg/Delete.d.ts +0 -0
- /package/dist/{assets → components/Component/ComponentWrapper}/svg/Duplicate.d.ts +0 -0
- /package/dist/node/{theme-parser → DEPRECATED-theme-parser}/index.d.ts +0 -0
- /package/dist/node/{theme-parser → DEPRECATED-theme-parser}/utils.d.ts +0 -0
- /package/dist/{functions/image-utils.d.ts → utils/images.d.ts} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConfigFile } from "./misc/types";
|
|
2
|
+
/**
|
|
3
|
+
* Generates the `autotypes.d.ts` file in the root of the instance project using
|
|
4
|
+
* the instance schemas exported in `griddo.config.file`
|
|
5
|
+
* The main usage of this file is for intellisense and autocompletion in the
|
|
6
|
+
* instance when they work with the React components and schemas.
|
|
7
|
+
* @documentation https://www.notion.so/griddoio/AutoTypes-e7420867dd2e489c8da34a493b763cd8?pvs=4
|
|
8
|
+
*
|
|
9
|
+
* @param config The instance `griddo.config.ts` file path.
|
|
10
|
+
*/
|
|
11
|
+
export declare function autotypes(config: ConfigFile, flags?: string): Promise<string>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { getComponentsNames } from "./names/getComponents";
|
|
2
2
|
import { getDetailTemplatesNames } from "./names/getDetailTemplates";
|
|
3
|
+
import { getFormFieldsNames } from "./names/getFormFieldsNames";
|
|
4
|
+
import { getFormTemplatesNames } from "./names/getFormTemplatesNames";
|
|
3
5
|
import { getModulesNames } from "./names/getModules";
|
|
4
6
|
import { getPageDataNames } from "./names/getPageData";
|
|
5
7
|
import { getSimpleDataNames } from "./names/getSimpleData";
|
|
@@ -15,4 +17,4 @@ import { getLanguagesInterface } from "./schemas/getLanguages";
|
|
|
15
17
|
import { getMenuItemsInterface } from "./schemas/getMenuItems";
|
|
16
18
|
import { getModuleCategoriesType } from "./schemas/getModuleCategories";
|
|
17
19
|
import { getThemesType } from "./schemas/getThemes";
|
|
18
|
-
export { getComponentsNames, getDatapacksType, getDetailTemplatesNames, getLanguagesInterface, getMenuItemsInterface, getModuleCategoriesType, getModulesNames, getPageDataNames, getPageDataProps, getSectionListType, getSimpleDataNames, getSimpleDataProps, getTaxonomyDataProps, getTaxonomyNames, getTemplatesProps, getThemesType, getUIAndDataProps, };
|
|
20
|
+
export { getComponentsNames, getDatapacksType, getDetailTemplatesNames, getFormFieldsNames, getFormTemplatesNames, getLanguagesInterface, getMenuItemsInterface, getModuleCategoriesType, getModulesNames, getPageDataNames, getPageDataProps, getSectionListType, getSimpleDataNames, getSimpleDataProps, getTaxonomyDataProps, getTaxonomyNames, getTemplatesProps, getThemesType, getUIAndDataProps, };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getComponentsNames(schemas: Record<string, Schema.Component>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getDetailTemplatesNames(schemas: Record<string, Schema.Template | Schema.ListTemplate | Schema.PaginatedDataTemplate>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getModulesNames(schemas: Record<string, Schema.Module>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getPageDataNames(schemas: Record<string, Schema.PageContentType>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getSimpleDataNames(schemas: Record<string, Schema.SimpleContentType>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getTaxonomyNames(schemas: Record<string, Schema.CategoryContentType>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getTemplatesProps(schemas: Record<string, Schema.Template | Schema.ListTemplate | Schema.PaginatedDataTemplate>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getPageDataProps(schemas: Record<string, Schema.PageContentType>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getSimpleDataProps(schemas: Record<string, Schema.SimpleContentType>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
1
|
+
import type { Schema } from "../../../..";
|
|
2
2
|
export declare function getTaxonomyDataProps(schemas: Record<string, Schema.CategoryContentType>): string;
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import type { PageContentTypeFields } from "../../../../../types/schema-fields/page-content-type-fields";
|
|
2
2
|
import type { SimpleContentTypeFields } from "../../../../../types/schema-fields/simple-content-type-fields";
|
|
3
3
|
import type { UIFields } from "../../../../../types/schema-fields/ui-fields";
|
|
4
|
+
import type { UIFormFields } from "../../../../../types/schema-fields/ui-form-fields";
|
|
4
5
|
import type { UITemplateFields } from "../../../../../types/schema-fields/ui-template-fields";
|
|
6
|
+
import type { Module } from "../../../../../types/schemas";
|
|
5
7
|
import type { KindSchema, SchemaTypeWithComponentProp } from "../../../misc/types";
|
|
6
|
-
import type { Module } from "@schema-types";
|
|
7
8
|
/**
|
|
8
|
-
* Return
|
|
9
|
+
* Return an optional property (the key in some Griddo field) and its value
|
|
10
|
+
* (some Griddo field type) serialized based on a schema field.
|
|
9
11
|
*
|
|
10
12
|
* @param field A Griddo field object
|
|
11
13
|
* @param kind Schema type in order to later do some operations with fields
|
|
12
14
|
* @param options Object options
|
|
13
15
|
* @example
|
|
14
|
-
* { type: 'TextField', key: '
|
|
15
|
-
*
|
|
16
|
+
* getTypeFromField({ type: 'TextField', key: 'cardTitle', ... }, "component")
|
|
17
|
+
* // returns -> "cardTitle?: Fields.Text"
|
|
16
18
|
*/
|
|
17
|
-
export declare function getTypeFromField(field: UIFields | UITemplateFields | SimpleContentTypeFields | PageContentTypeFields, kind: KindSchema, options: {
|
|
19
|
+
export declare function getTypeFromField(field: UIFields | UIFormFields | UITemplateFields | SimpleContentTypeFields | PageContentTypeFields, kind: KindSchema, options: {
|
|
18
20
|
hasDistributorData: boolean;
|
|
19
21
|
getStaticData: boolean;
|
|
20
22
|
moduleSchemas: Array<Module | undefined>;
|
|
21
23
|
schema: SchemaTypeWithComponentProp;
|
|
24
|
+
allSchemas: any;
|
|
22
25
|
}): string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { Schema } from "../../../../..";
|
|
1
2
|
import type { GlobalState, SchemaType, SchemaTypeWithComponentProp } from "../../../misc/types";
|
|
2
|
-
import type { Schema } from "@core-types";
|
|
3
3
|
declare function getExtra(schema: SchemaTypeWithComponentProp): string;
|
|
4
4
|
declare function isUISchema(schema: SchemaTypeWithComponentProp): schema is Schema.Component | Schema.ContentTypeModule | Schema.MultiPageModule | Schema.Module | Schema.Template | Schema.ListTemplate;
|
|
5
5
|
declare function isContentTypeSchema(schema: SchemaTypeWithComponentProp): schema is (Schema.SimpleContentType & {
|
|
@@ -31,8 +31,8 @@ declare function processContentTypeSchema(schema: (Schema.SimpleContentType & {
|
|
|
31
31
|
}) | (Schema.PageContentType & {
|
|
32
32
|
component: string;
|
|
33
33
|
})): GlobalState;
|
|
34
|
-
declare function processUISchema(schema: Schema.Component | Schema.ContentTypeModule | Schema.MultiPageModule | Schema.Module | Schema.Template | Schema.ListTemplate): GlobalState;
|
|
35
|
-
declare function getPropsFromFields(schema: SchemaTypeWithComponentProp, arrayOfSchemaModules: Array<Schema.Module | undefined>, GS: GlobalState): string;
|
|
34
|
+
declare function processUISchema(schema: Schema.Component | Schema.ContentTypeModule | Schema.MultiPageModule | Schema.Module | Schema.Template | Schema.ListTemplate | Schema.FormTemplate): GlobalState;
|
|
35
|
+
declare function getPropsFromFields(schema: SchemaTypeWithComponentProp, arrayOfSchemaModules: Array<Schema.Module | undefined>, allSchemas: any, GS: GlobalState): string;
|
|
36
36
|
declare function getModuleSchemas(schemas: Array<SchemaTypeWithComponentProp>): {
|
|
37
37
|
ARRAY_OF_MODULE_SCHEMAS: (Schema.Module<unknown> | undefined)[];
|
|
38
38
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataPack, DataPackCategory } from "
|
|
1
|
+
import type { DataPack, DataPackCategory } from "../../../../types/schemas";
|
|
2
2
|
export declare function getDatapacksType(schema: Record<string, DataPack>, categoriesSchema: Record<string, DataPackCategory>): {
|
|
3
3
|
DATAPACKS: string;
|
|
4
4
|
DATAPACKS_CATEGORIES: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MenuItemsSchema } from "
|
|
1
|
+
import type { MenuItemsSchema } from "../../misc/types";
|
|
2
2
|
export declare function getMenuItemsInterface(menuItemsSchemas: MenuItemsSchema): string;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
declare const HEAD_DESIGN = "/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-use-before-define */\n//\n//\n// ' ____\n// /\\ \\\n// \u00BA / /\\ \\\n// ' / / \\ _>\n// ' _\\ \\__> \\__\n// ' O ( __;\u00B7;______ ) AutoTypes\n// O \u00BA, | , , \\ \\\\ \u00B7..~~.\u00B7~.\u00B7\n// ,,, /| , , /\\ <\\\\\n// \\''\\-' \u23A9, <\\/\\ \\ \\\n// \\_/ /\\_____\u23A9/ > > >\n// '___' <_(_)__> / \\ <\n// / / \u00B4 \\ | \\___//\\\\\n// / / | / > > \\\\\n// \u00B7 \u00B7\u00B7~~~~\u00B7~\u00B7~~~~~~~\u00B7~\u00B7\u00B7~~~~~\u00B7~\u00B7~~\u00B7~~~~\u00B7~~~~~\u00B7\u00B7 \u00B7 \u00B7\n//\n// Embrace the beauty of effortless typing by indulging in the benefits of them\n// sans the actual typing!\n//\n// Behold! These dynamically generated types were conjured from the schemas\n// nestled within this repository. However, should you yearn to expand upon\n// these types, kindly abstain from doing so in this file, lest AutoTypes'\n// magic shall smite your changes with each schema modification.\n//\n// Check out the details of Griddo AutoTypes in:\n// https://griddoio.notion.site/Griddo-AutoTypes-e7420867dd2e489c8da34a493b763cd8>\n//\n// Happy magic types!\n//\nimport { Core, Fields, Hideable, NonEmptyArray } from \"@griddo/core\"\n//\n";
|
|
2
|
-
|
|
3
|
-
export { HEAD_DESIGN, SUCCESS };
|
|
2
|
+
export { HEAD_DESIGN };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Core, Schema } from "../../..";
|
|
2
|
+
import type * as PageContentType_Fields from "../../../types/schema-fields/page-content-type-fields";
|
|
3
|
+
import type * as SimpleContentType_Fields from "../../../types/schema-fields/simple-content-type-fields";
|
|
4
|
+
import type * as UI_Fields from "../../../types/schema-fields/ui-fields";
|
|
5
|
+
import type * as UIFormTemplate_Fields from "../../../types/schema-fields/ui-form-template-fields";
|
|
6
|
+
import type * as UITemplate_Fields from "../../../types/schema-fields/ui-template-fields";
|
|
7
|
+
import type { AutoTypesConfig, DataPack, DataPackCategory, Module, ModuleCategories, Template, ThemeEntry } from "../../../types/schemas";
|
|
8
|
+
type SchemaFieldTypes = "FormContainer" | "ArrayFieldGroup" | "AsyncCheckGroup" | "AsyncSelect" | "AsyncSelect" | "CheckGroup" | "ColorPicker" | "ComponentArray" | "ComponentContainer" | "ConditionalField" | "DateField" | "FieldGroup" | "FieldsDivider" | "FileField" | "HeadingField" | "ImageField" | "LinkField" | "MultiCheckSelect" | "MultiCheckSelectGroup" | "NoteField" | "NumberField" | "RadioGroup" | "ReferenceField" | "RichText" | "Select" | "SliderField" | "TagsField" | "TextArea" | "TextField" | "TimeField" | "ToggleField" | "UniqueCheck" | "UrlField" | "VisualUniqueSelection" | "Wysiwyg";
|
|
9
|
+
type FieldReturnTypes = "Fields.FormContainer" | "Fields.ArrayFieldGroup" | "Fields.AsyncCheckGroup" | "Fields.AsyncSelect" | "Fields.CheckGroup" | "Fields.ColorPicker" | "Fields.ColorPickerFixed" | "Fields.ComponentArray" | "Fields.ComponentContainer" | "Fields.Conditional" | "Fields.Date" | "Fields.FieldGroup" | "Fields.FieldsDivider" | "Fields.File" | "Fields.Heading" | "Fields.Image" | "Fields.Link" | "Fields.MultiCheckSelect" | "Fields.MultiCheckSelectGroup" | "Fields.Note" | "Fields.Number" | "Fields.RadioGroup" | "Fields.Reference" | "Fields.RichText" | "Fields.Select" | "Fields.Slider" | "Fields.Tags" | "Fields.TextArea" | "Fields.Text" | "Fields.Time" | "Fields.Toggle" | "Fields.UniqueCheck" | "Fields.Url" | "Fields.VisualUniqueSelection" | "Fields.Wysiwyg";
|
|
10
|
+
type SchemaType = Schema.Component | Schema.ContentTypeModule | Schema.MultiPageModule | Schema.Module | Schema.Template | Schema.ListTemplate | Schema.SimpleContentType | Schema.CategoryContentType | Schema.PageContentType | Schema.FormTemplate | Schema.FormComponent;
|
|
11
|
+
type SchemaTypeWithComponentProp = Schema.Component | Schema.ContentTypeModule | Schema.MultiPageModule | Schema.Module | Schema.Template | Schema.ListTemplate | Schema.FormTemplate | Schema.FormComponent | (Schema.CategoryContentType & {
|
|
12
|
+
component: string;
|
|
13
|
+
}) | (Schema.SimpleContentType & {
|
|
14
|
+
component: string;
|
|
15
|
+
}) | (Schema.PageContentType & {
|
|
16
|
+
component: string;
|
|
17
|
+
});
|
|
18
|
+
type Fields = UI_Fields.UIFields | UITemplate_Fields.UITemplateFields | SimpleContentType_Fields.SimpleContentTypeFields | PageContentType_Fields.PageContentTypeFields | UIFormTemplate_Fields.UIFormTemplateFields;
|
|
19
|
+
type KindSchema = "object" | "component" | "module" | "template" | "simpleContentType" | "pageContentType" | "formTemplate";
|
|
20
|
+
interface MenuItemsSchema {
|
|
21
|
+
link: Record<string, SchemaType>;
|
|
22
|
+
group: Record<string, SchemaType>;
|
|
23
|
+
}
|
|
24
|
+
type LanguagesSchema = Record<Core.Locale, {
|
|
25
|
+
name: string;
|
|
26
|
+
label: string;
|
|
27
|
+
}>;
|
|
28
|
+
type GlobalState = {
|
|
29
|
+
kind: KindSchema;
|
|
30
|
+
contentTypeSuffixStr: string;
|
|
31
|
+
contentTypeName: string;
|
|
32
|
+
contentTypeKind: string;
|
|
33
|
+
relatedContentTypeNames: string;
|
|
34
|
+
componentName: string;
|
|
35
|
+
hasDistributorData: boolean;
|
|
36
|
+
getStaticData: boolean;
|
|
37
|
+
interfaceForPublicAPI: string;
|
|
38
|
+
relationsGeneric: string;
|
|
39
|
+
};
|
|
40
|
+
export type { FieldReturnTypes, Fields, GlobalState, KindSchema, LanguagesSchema, MenuItemsSchema, SchemaFieldTypes, SchemaType, SchemaTypeWithComponentProp, };
|
|
41
|
+
export interface MainAutotypesProps {
|
|
42
|
+
categoryContentTypes: Record<string, Schema.CategoryContentType>;
|
|
43
|
+
pageContentTypes: Record<string, Schema.PageContentType>;
|
|
44
|
+
simpleContentTypes: Record<string, Schema.SimpleContentType>;
|
|
45
|
+
componentsSchema: Record<string, Schema.Component>;
|
|
46
|
+
modulesSchema: Record<string, Schema.Module>;
|
|
47
|
+
templatesSchema: Record<string, Schema.Template | Schema.ListTemplate | Schema.PaginatedDataTemplate>;
|
|
48
|
+
structuredDataSchema: Record<string, SchemaType>;
|
|
49
|
+
menuItemsSchemas: MenuItemsSchema;
|
|
50
|
+
languagesSchemas: LanguagesSchema;
|
|
51
|
+
moduleCategoriesSchema: ModuleCategories;
|
|
52
|
+
datapacksSchema: Record<string, DataPack>;
|
|
53
|
+
datapacksCategoriesSchema: Record<string, DataPackCategory>;
|
|
54
|
+
themesSchema: Array<ThemeEntry>;
|
|
55
|
+
subthemesSchema: Array<string>;
|
|
56
|
+
config?: AutoTypesConfig;
|
|
57
|
+
}
|
|
58
|
+
export type ConfigFile = {
|
|
59
|
+
all: {
|
|
60
|
+
modules: Record<string, SchemaType>;
|
|
61
|
+
};
|
|
62
|
+
schemas: {
|
|
63
|
+
modules: Record<string, Module>;
|
|
64
|
+
templates: Record<string, Template>;
|
|
65
|
+
structuredData: Record<string, SchemaType>;
|
|
66
|
+
menuItems: MenuItemsSchema;
|
|
67
|
+
languages: LanguagesSchema;
|
|
68
|
+
dataPacks: Record<string, DataPack>;
|
|
69
|
+
dataPacksCategories: Record<string, DataPackCategory>;
|
|
70
|
+
forms: {
|
|
71
|
+
templates: Record<string, Schema.FormTemplate>;
|
|
72
|
+
fields: Record<string, Schema.FormField>;
|
|
73
|
+
categories: Record<string, Schema.FormCategories>;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
moduleCategories: ModuleCategories;
|
|
77
|
+
themes: Array<ThemeEntry>;
|
|
78
|
+
subthemes: Array<string>;
|
|
79
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { Schema } from "
|
|
2
|
-
import type { AutoTypesConfig } from "
|
|
1
|
+
import type { Schema } from "../../..";
|
|
2
|
+
import type { AutoTypesConfig } from "../../../types/schemas";
|
|
3
3
|
declare function prettify(input: string): Promise<string>;
|
|
4
4
|
/**
|
|
5
5
|
* Returns the instance or monorepo paths.
|
|
6
6
|
*
|
|
7
7
|
* @param customPath The path for the instance components
|
|
8
8
|
*/
|
|
9
|
-
declare function
|
|
10
|
-
declare function
|
|
9
|
+
declare function resolveInstancePath(): string;
|
|
10
|
+
declare function extractMergedSchemas(configFile: any): {
|
|
11
11
|
categoryContentTypes: Record<string, Schema.CategoryContentType>;
|
|
12
12
|
pageContentTypes: Record<string, Schema.PageContentType>;
|
|
13
13
|
simpleContentTypes: Record<string, Schema.SimpleContentType<unknown>>;
|
|
14
|
-
|
|
14
|
+
components: Record<string, Schema.Component<unknown>>;
|
|
15
15
|
};
|
|
16
16
|
declare function readConfig(): AutoTypesConfig;
|
|
17
|
-
export {
|
|
17
|
+
export { extractMergedSchemas, prettify, readConfig, resolveInstancePath };
|
|
@@ -2,6 +2,22 @@ import type { CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveIm
|
|
|
2
2
|
import type { ImageDecoding, ImageLoading } from "../../types/core";
|
|
3
3
|
import type { CSSProperties } from "react";
|
|
4
4
|
import "react-aspect-ratio/aspect-ratio.css";
|
|
5
|
+
export declare const internalDefaults: {
|
|
6
|
+
domain: string;
|
|
7
|
+
uploadFolder: string;
|
|
8
|
+
fallback404ImageId: string;
|
|
9
|
+
quality: number;
|
|
10
|
+
crop: string;
|
|
11
|
+
gravity: string;
|
|
12
|
+
format: string;
|
|
13
|
+
loading: string;
|
|
14
|
+
backgroundLazy: boolean;
|
|
15
|
+
decoding: string;
|
|
16
|
+
responsive: {
|
|
17
|
+
breakpoint: null;
|
|
18
|
+
width: string;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
5
21
|
/**
|
|
6
22
|
* <CloudinaryImage>
|
|
7
23
|
*
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
export interface ComponentProps {
|
|
3
|
+
libComponents: Record<string, any>;
|
|
4
|
+
editorID?: number;
|
|
5
|
+
component: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
parentEditorID?: number;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
|
-
* Griddo core component to render dynamically a component/module (using the
|
|
11
|
+
* Griddo core component to render dynamically a component/module (using the
|
|
12
|
+
* `component` prop) from the `libComponents` (a list of React components) with
|
|
13
|
+
* the props we provide to it
|
|
4
14
|
*
|
|
5
15
|
* @example
|
|
6
16
|
* import Hero from './Hero'
|
|
@@ -14,12 +24,8 @@
|
|
|
14
24
|
* />
|
|
15
25
|
*/
|
|
16
26
|
declare function Component({ libComponents, ...props }: ComponentProps): JSX.Element | null;
|
|
17
|
-
|
|
18
|
-
libComponents: Record<string, any>;
|
|
19
|
-
editorID?: number;
|
|
27
|
+
declare function getComponent(components: Record<string, FC<Omit<ComponentProps, "libComponents">>>, props: {
|
|
20
28
|
component: string;
|
|
21
|
-
type?: string;
|
|
22
|
-
parentEditorID?: number;
|
|
23
29
|
[key: string]: unknown;
|
|
24
|
-
}
|
|
25
|
-
export { Component };
|
|
30
|
+
}): FC<Omit<ComponentProps, "libComponents">> | null;
|
|
31
|
+
export { Component, getComponent };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
/**
|
|
3
|
-
* Inject a google structured data
|
|
3
|
+
* Inject a google structured data with a `script` tag.
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* <LdJson data={schemaData} />
|
|
7
7
|
*/
|
|
8
|
-
declare function LdJson(props:
|
|
9
|
-
interface LdJsonProps {
|
|
8
|
+
export declare function LdJson(props: {
|
|
10
9
|
data: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
|
-
export { LdJson };
|
|
10
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface RecursiveSearchProps {
|
|
2
|
+
obj?: Record<string, string>;
|
|
3
|
+
searchKey?: string;
|
|
4
|
+
resultsBuffer?: Array<string>;
|
|
5
|
+
unique?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* recursiveSearch
|
|
9
|
+
* Devuelve una lista con los valores de una prop dentro de un objeto
|
|
10
|
+
* La búsqueda es recursiva en todo el objeto
|
|
11
|
+
* @param config Un objeto con los parámetros de la función
|
|
12
|
+
* @param config.obj El objeto donde buscar
|
|
13
|
+
* @param config.searchKey El nombre de la propiedad a buscar
|
|
14
|
+
* @param config.results El array de resultados, se van añadiendo recursivamente los resultados.
|
|
15
|
+
* @param config.unique Si es true elimina los resultados repetidos
|
|
16
|
+
* @example
|
|
17
|
+
* Obtiene una lista con los valores de la prop "a"
|
|
18
|
+
* recursiveSearch({ obj: {a: 1, b: {a: "foo"}}, "a"})
|
|
19
|
+
* -> [1, "foo"]
|
|
20
|
+
*
|
|
21
|
+
* @return Un array con los valores de la propiedad `searchValue`
|
|
22
|
+
*/
|
|
23
|
+
declare function recursiveSearch({ obj, searchKey, resultsBuffer, unique, }?: RecursiveSearchProps): string[];
|
|
24
|
+
export { recursiveSearch };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
component: string;
|
|
6
|
-
}) => FC<Omit<ComponentProps, "libComponents">> | null;
|
|
7
|
-
export { getComponent };
|
|
1
|
+
import { griddoAlertRegister, type GriddoAlertRegisterProps } from "./alerts";
|
|
2
|
+
import { formatLocaleDate } from "./localeDate";
|
|
3
|
+
export { formatLocaleDate, griddoAlertRegister, type GriddoAlertRegisterProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Core } from "../..";
|
|
2
|
+
/**
|
|
3
|
+
* Format and translate a string date from a `DateField` (YY/MM/DD) into
|
|
4
|
+
* differentes Locales. You can pass an option object Intl.DateTimeFormatOptions
|
|
5
|
+
* to customize the output.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* formatLocaleDate({ dateString: "2023/08/06", locale: "es-ES"})
|
|
9
|
+
* // { date: "6 Agosto 2023", dateTime: "2023-08-06" }
|
|
10
|
+
*/
|
|
11
|
+
declare function formatLocaleDate(inputDate: string, locale: Core.ISOLocale, options?: Intl.DateTimeFormatOptions): {
|
|
12
|
+
date: string;
|
|
13
|
+
dateTime: string;
|
|
14
|
+
};
|
|
15
|
+
export { formatLocaleDate };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useGlobalTheme } from "./themes/useGlobalTheme";
|
|
2
|
-
import { usePageRelatedContent } from "./usePageRelatedContent";
|
|
3
2
|
import { useTheme } from "./themes/useTheme";
|
|
4
3
|
import { useThemeColors } from "./themes/useThemeColors";
|
|
5
4
|
import { useThemeFont } from "./themes/useThemeFont";
|
|
@@ -19,13 +18,14 @@ import { useIsFirstRender } from "./useIsFirstRender";
|
|
|
19
18
|
import { useLink } from "./useLink";
|
|
20
19
|
import { useList } from "./useList";
|
|
21
20
|
import { useListWithDefaultStaticPage } from "./useListWithDefaultStaticPage";
|
|
22
|
-
import {
|
|
21
|
+
import { useLocaleDate } from "./useLocaleDate";
|
|
23
22
|
import { useNavigation } from "./useNavigation";
|
|
24
23
|
import { usePage } from "./usePage";
|
|
24
|
+
import { usePageRelatedContent } from "./usePageRelatedContent";
|
|
25
25
|
import { useReferenceFieldData } from "./useReferenceFieldData";
|
|
26
26
|
import { useScript } from "./useScript";
|
|
27
27
|
import { useSession } from "./useSession";
|
|
28
28
|
import { useSite } from "./useSite";
|
|
29
29
|
import { useSitemap } from "./useSitemap";
|
|
30
30
|
import { useSSR } from "./useSSR";
|
|
31
|
-
export {
|
|
31
|
+
export { useAiAnswers, useAiSearch, useContentType, useContentTypeNavigation, useDataFilters, useReferenceFieldData as useDistributorData, useFetch, useGlobalTheme, useGriddoImage, useGriddoImageExp, useI18n, useImage, useIsClient, useIsFirstRender, useLink, useList, useListWithDefaultStaticPage, useLocaleDate, useNavigation, usePage, usePageRelatedContent, useReferenceFieldData, useScript, useSession, useSite, useSitemap, useSSR, useTheme, useThemeColors, useThemeFont, useThemePrimitives, };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Core } from "..";
|
|
2
1
|
/**
|
|
3
2
|
* Format and translate a string date from a `DateField` (YY/MM/DD) responding
|
|
4
3
|
* to different Locales from page context. Also support an option object
|
|
@@ -8,24 +7,10 @@ import type { Core } from "..";
|
|
|
8
7
|
* const { date } = useLocaleDate("2023/08/06")
|
|
9
8
|
* // 6 Agosto 2023
|
|
10
9
|
*/
|
|
11
|
-
declare function useLocaleDate(date?: string, options?: Intl.DateTimeFormatOptions): {
|
|
10
|
+
export declare function useLocaleDate(date?: string, options?: Intl.DateTimeFormatOptions): {
|
|
12
11
|
date: string;
|
|
13
12
|
dateTime: string;
|
|
14
13
|
} | {
|
|
15
14
|
date: undefined;
|
|
16
15
|
dateTime: undefined;
|
|
17
16
|
};
|
|
18
|
-
/**
|
|
19
|
-
* Format and translate a string date from a `DateField` (YY/MM/DD) into
|
|
20
|
-
* differentes Locales. You can pass an option object Intl.DateTimeFormatOptions
|
|
21
|
-
* to customize the output.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* formatLocaleDate({ dateString: "2023/08/06", locale: "es-ES"})
|
|
25
|
-
* // { date: "6 Agosto 2023", dateTime: "2023-08-06" }
|
|
26
|
-
*/
|
|
27
|
-
declare function formatLocaleDate(inputDate: string, locale: Core.ISOLocale, options?: Intl.DateTimeFormatOptions): {
|
|
28
|
-
date: string;
|
|
29
|
-
dateTime: string;
|
|
30
|
-
};
|
|
31
|
-
export { formatLocaleDate, useLocaleDate };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudinaryBackgroundImage, CloudinaryImage, Component, GriddoBackgroundImage, GriddoImage, GriddoImageExp, GriddoLink, LdJson, Link, Page, Preview } from "./components";
|
|
2
2
|
import { CloudinaryImageProps } from "./components/CloudinaryImage";
|
|
3
|
-
import { ComponentProps } from "./components/Component";
|
|
3
|
+
import { ComponentProps, getComponent } from "./components/Component";
|
|
4
4
|
import { GriddoImageCommonProps, GriddoImageGif, GriddoImageJpgWebpAvif, GriddoImageProps, GriddoImageSvg } from "./components/GriddoImage";
|
|
5
5
|
import { GriddoLinkProps, HLocation, LinkGetProps, WindowLocation } from "./components/GriddoLink";
|
|
6
6
|
import { ModulePreviewProps } from "./components/ModulePreview";
|
|
@@ -8,19 +8,18 @@ import { PageProps } from "./components/Page";
|
|
|
8
8
|
import { PreviewProps } from "./components/Preview";
|
|
9
9
|
import { PageContext, PageProvider, SessionContext, SessionProvider, SiteContext, SiteProvider } from "./contexts";
|
|
10
10
|
import { SiteProviderProps } from "./contexts/Site";
|
|
11
|
-
import {
|
|
12
|
-
import { GriddoAlertRegisterProps, griddoAlertRegister } from "./functions/alerts";
|
|
13
|
-
import { getLang, getSiteID, getToken } from "./functions/utils";
|
|
14
|
-
import { formatLocaleDate, useAiAnswers, useAiSearch, useContentType, useContentTypeNavigation, useDataFilters, useGlobalTheme, useGriddoImage, useGriddoImageExp, useI18n, useImage, useIsClient, useIsFirstRender, useLink, useList, useListWithDefaultStaticPage, useLocaleDate, useNavigation, usePage, usePageRelatedContent, useReferenceFieldData, useSSR, useScript, useSession, useSite, useSitemap, useTheme, useThemeColors, useThemeFont, useThemePrimitives } from "./hooks";
|
|
11
|
+
import { useAiAnswers, useAiSearch, useContentType, useContentTypeNavigation, useDataFilters, useGlobalTheme, useGriddoImage, useGriddoImageExp, useI18n, useImage, useIsClient, useIsFirstRender, useLink, useList, useListWithDefaultStaticPage, useLocaleDate, useNavigation, usePage, usePageRelatedContent, useReferenceFieldData, useSSR, useScript, useSession, useSite, useSitemap, useTheme, useThemeColors, useThemeFont, useThemePrimitives } from "./hooks";
|
|
15
12
|
import { UseDataFilterSetUrlAction, UseDataFiltersReturn, UseDataFiltersSetQueryProps, UseDataFiltersState } from "./hooks/useDataFilters";
|
|
16
13
|
import { GenerateImageChunkProps, ImageChunk, ImageConfig, UseGriddoImageProps, UseGriddoImageReturn } from "./hooks/useGriddoImage";
|
|
17
14
|
import { GenerateImageChunkPropsExperimental, ImageChunkExperimental, ImageConfigExperimental, UseGriddoImagePropsExperimental, UseGriddoImageReturnExperimental } from "./hooks/useGriddoImageExp";
|
|
15
|
+
import { getLang, getSiteID, getToken } from "./utils";
|
|
18
16
|
import { UseI18nProps } from "./hooks/useI18n";
|
|
19
17
|
import { CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps, UseImageProps } from "./hooks/useImage";
|
|
20
18
|
import { UseListSetQueryProps, UseListSetUrlAction } from "./hooks/useList";
|
|
21
19
|
import { FiltersDataApiQueryResponseProps, HTMLHeadingTag, Hideable, ListApiQueryResponseProps, PickRename, Pretty, SetQueryProps } from "./types/global";
|
|
22
20
|
import { NonEmptyArray } from "./types/utilities";
|
|
23
21
|
import { GriddoImageCommonPropsExperimental, GriddoImageGifExperimental, GriddoImageJpgWebpAvifExperimental, GriddoImagePropsExperimental, GriddoImageSvgExperimental } from "./components/GriddoImageExp/types";
|
|
22
|
+
import { GriddoAlertRegisterProps, formatLocaleDate, griddoAlertRegister } from "./functions";
|
|
24
23
|
import * as Fields from "./types/api-response-fields";
|
|
25
24
|
import * as Core from "./types/core";
|
|
26
25
|
import * as PageContentTypeFields from "./types/schema-fields/page-content-type-fields";
|