@griddo/core 11.0.22 → 11.0.23
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
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { FieldReturnTypes, Fields, SchemaFieldTypes, SchemaType, SchemaTypeWithComponentProp } from "./types";
|
|
2
|
-
import type { AutoTypesConfig } from "../../types/schemas/AutoTypes";
|
|
3
|
-
/** Get all fields from one schema */
|
|
4
|
-
declare function getAllFields(schema: SchemaType): import("../../types/schema-fields/ui-fields").UIFields[] | [import("../../types/schema-fields/base").BaseTextField & import("../../types/schema-fields/props").WithFrom & import("../../types/schema-fields/props").WithIndexable & import("../../types/schema-fields/props").WithShowList & import("../../types/schema-fields/props").WithSearchable & {
|
|
5
|
-
key: "title";
|
|
6
|
-
}, ...import("../../types/schema-fields/page-content-type-fields").PageContentTypeFields[]] | [import("../../types/schema-fields/base").BaseTextField & import("../../types/schema-fields/props").WithSimpleContentTypeComputed<unknown, string> & import("../../types/schema-fields/props").WithIsMockup & import("../../types/schema-fields/props").WithValidators & import("../../types/schema-fields/props").WithReadonly & import("../../types/schema-fields/props").WithSlugTo & import("../../types/schema-fields/props").WithPrefix & import("../../types/schema-fields/props").WithPlaceHolder & import("../../types/schema-fields/props").WithIndexable & import("../../types/schema-fields/props").WithShowList & import("../../types/schema-fields/props").WithHelpText & import("../../types/schema-fields/props").WithHidden & import("../../types/schema-fields/props").WithHumanReadable & import("../../types/schema-fields/props").WithSearchable & {
|
|
7
|
-
key: "title";
|
|
8
|
-
}, ...import("../../types/schema-fields/simple-content-type-fields").SimpleContentTypeFields<unknown>[]];
|
|
9
|
-
/** Build a interface prop based on the field from the schema.
|
|
10
|
-
* Optionally it can receives a custom value for the type and a generic string to use as generic value
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* getInterfacePropType(TextFieldObjectFromSchema)
|
|
14
|
-
* // -> TextFieldObjectFromSchema.key: Fields.TextField
|
|
15
|
-
* getInterfacePropType(TextFieldObjectFromSchema, 'MyCustomValue', 'foo')
|
|
16
|
-
* // -> TextFieldObjectFromSchema.key: MyCustomValue<foo>
|
|
17
|
-
*/
|
|
18
|
-
type GetInterfacePropTypeOptions = {
|
|
19
|
-
returnTypeName?: FieldReturnTypes;
|
|
20
|
-
generic?: string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Return a serialized type from a Griddo schema field.
|
|
24
|
-
*
|
|
25
|
-
* @param Fields A Griddo field object
|
|
26
|
-
* @param options An options object
|
|
27
|
-
* @returns A string that represent a interface prop type.
|
|
28
|
-
* @example
|
|
29
|
-
* interface SomeInterface {
|
|
30
|
-
* prop: boolean; // this function returns a string for this: `prop: boolean`
|
|
31
|
-
* }
|
|
32
|
-
*/
|
|
33
|
-
declare function getInterfacePropType(field: Fields, options?: GetInterfacePropTypeOptions): string;
|
|
34
|
-
/**
|
|
35
|
-
* Return a string separated by the pipe char "|" using the `value` from object array.
|
|
36
|
-
*/
|
|
37
|
-
declare function getGenericFromOptions<T = unknown>(options: Array<{
|
|
38
|
-
value: T;
|
|
39
|
-
}>): string;
|
|
40
|
-
/**
|
|
41
|
-
* Return a string separated by the pipe char "|" using the `name` from object array.
|
|
42
|
-
*/
|
|
43
|
-
declare function getGenericFromCheckBoxOptions<T>(options: Array<{
|
|
44
|
-
name: T;
|
|
45
|
-
}>): string;
|
|
46
|
-
declare function getGenericFromWhitelist(whiteList: Array<string>, config?: AutoTypesConfig): string;
|
|
47
|
-
/**
|
|
48
|
-
* Convert an object of schemas into an array of objects of these schemas.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* input:
|
|
52
|
-
* `schemas` is an object of schemas like so:
|
|
53
|
-
* {
|
|
54
|
-
* BasicContent: {
|
|
55
|
-
* component: "BasicContent",
|
|
56
|
-
* ...
|
|
57
|
-
* },
|
|
58
|
-
* ...
|
|
59
|
-
* }
|
|
60
|
-
*
|
|
61
|
-
* output:
|
|
62
|
-
* [ {component: "BasicContent"}, {component: "NewsTemplate"}, ... ]
|
|
63
|
-
*/
|
|
64
|
-
declare function schemasToArray(objectSchemas: Record<string, SchemaType>): Array<SchemaTypeWithComponentProp>;
|
|
65
|
-
declare function returnType(type: SchemaFieldTypes): FieldReturnTypes;
|
|
66
|
-
declare function extendsType(types: Array<string>): string;
|
|
67
|
-
declare function getPageContentTypesUnionType(schemas: Array<SchemaTypeWithComponentProp>): string;
|
|
68
|
-
declare function getSimpleContentTypeUnionProps(schemas: Array<SchemaTypeWithComponentProp>): string;
|
|
69
|
-
declare function getTaxonomyContentTypesUnionType(schemas: Array<SchemaTypeWithComponentProp>): string;
|
|
70
|
-
/**
|
|
71
|
-
* Get union types for components, modules and tempaltes like so:
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* type Components = "ComponentA" | "ComponentB"
|
|
75
|
-
* type Modules = "ModuleA" | "ModuleB"
|
|
76
|
-
* type Templates = "TemplateA" | "TemplateB"
|
|
77
|
-
*/
|
|
78
|
-
declare function getElementsUnionType(schemas: Array<SchemaType>): string;
|
|
79
|
-
/**
|
|
80
|
-
* Lista de templates y sus secciones
|
|
81
|
-
* Esto es algo que se usa en los schemas de Griddo. Es como el inverso a un
|
|
82
|
-
* whitelist donde indicamos en qué secciones de qué templates puede
|
|
83
|
-
* aparecer un módulo.
|
|
84
|
-
*/
|
|
85
|
-
declare function getSectionList(schemas: Array<SchemaType>): string;
|
|
86
|
-
/**
|
|
87
|
-
* Returns the instance or monorepo paths.
|
|
88
|
-
*
|
|
89
|
-
* @param customPath The path for the instance components
|
|
90
|
-
*/
|
|
91
|
-
declare function resolveComponentsPath(): string;
|
|
92
|
-
export { extendsType, getAllFields, getElementsUnionType, getGenericFromCheckBoxOptions, getGenericFromOptions, getGenericFromWhitelist, getInterfacePropType, getPageContentTypesUnionType, getSectionList, getSimpleContentTypeUnionProps, getTaxonomyContentTypesUnionType, resolveComponentsPath, returnType, schemasToArray, };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export interface GetLinkProps {
|
|
2
|
-
href?: string;
|
|
3
|
-
linkToURL?: string;
|
|
4
|
-
}
|
|
5
|
-
export interface RecursiveSearchProps {
|
|
6
|
-
obj?: Record<string, string>;
|
|
7
|
-
searchKey?: string;
|
|
8
|
-
resultsBuffer?: Array<string>;
|
|
9
|
-
unique?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export type PublicApiOperators = "or" | "and" | "OR" | "AND";
|
|
12
|
-
export interface ConcatParams {
|
|
13
|
-
baseUrl: string;
|
|
14
|
-
params: Record<string, any>;
|
|
15
|
-
}
|
|
16
|
-
declare function getLinks(url?: GetLinkProps): {
|
|
17
|
-
href: string | null | undefined;
|
|
18
|
-
to: string | null | undefined;
|
|
19
|
-
};
|
|
20
|
-
declare function parseAnchor(pageUrl: string, linkUrl: string): string;
|
|
21
|
-
declare function isLocalStorageAvailable(): boolean;
|
|
22
|
-
declare function getToken(): {
|
|
23
|
-
Authorization: string;
|
|
24
|
-
} | null;
|
|
25
|
-
declare function getSiteID(): any;
|
|
26
|
-
declare function getLang(): number | false;
|
|
27
|
-
/**
|
|
28
|
-
* recursiveSearch
|
|
29
|
-
* Devuelve una lista con los valores de una prop dentro de un objeto
|
|
30
|
-
* La búsqueda es recursiva en todo el objeto
|
|
31
|
-
* @param config Un objeto con los parámetros de la función
|
|
32
|
-
* @param config.obj El objeto donde buscar
|
|
33
|
-
* @param config.searchKey El nombre de la propiedad a buscar
|
|
34
|
-
* @param config.results El array de resultados, se van añadiendo recursivamente los resultados.
|
|
35
|
-
* @param config.unique Si es true elimina los resultados repetidos
|
|
36
|
-
* @example
|
|
37
|
-
* Obtiene una lista con los valores de la prop "a"
|
|
38
|
-
* recursiveSearch({ obj: {a: 1, b: {a: "foo"}}, "a"})
|
|
39
|
-
* -> [1, "foo"]
|
|
40
|
-
*
|
|
41
|
-
* @return Un array con los valores de la propiedad `searchValue`
|
|
42
|
-
*/
|
|
43
|
-
declare function recursiveSearch({ obj, searchKey, resultsBuffer, unique, }?: RecursiveSearchProps): string[];
|
|
44
|
-
/**
|
|
45
|
-
* concatParams
|
|
46
|
-
* @param {object} params
|
|
47
|
-
* @param {string} params.baseUrl base url of the api
|
|
48
|
-
* @param {object} params.params object with the params to be sent
|
|
49
|
-
* @returns {string} a string with the params concatenated
|
|
50
|
-
*/
|
|
51
|
-
declare function concatParams({ baseUrl, params }: ConcatParams): string;
|
|
52
|
-
export { getLinks, parseAnchor, getToken, getSiteID, getLang, recursiveSearch, concatParams, isLocalStorageAvailable, };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|