@griddo/core 10.7.9 → 11.0.2
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/assets/svg/Delete.d.ts +2 -2
- package/dist/assets/svg/Duplicate.d.ts +2 -2
- package/dist/autotypes.js +1 -1
- package/dist/autotypes.js.map +1 -1
- package/dist/components/CloudinaryBackgroundImage/index.d.ts +0 -2
- package/dist/components/CloudinaryImage/index.d.ts +5 -5
- package/dist/components/Component/ComponentWrapper/index.d.ts +1 -1
- package/dist/components/Component/index.d.ts +0 -2
- package/dist/components/GriddoBackgroundImage/index.d.ts +3 -2
- package/dist/components/GriddoImage/index.d.ts +1 -3
- package/dist/components/GriddoImageExp/types.d.ts +9 -8
- package/dist/components/GriddoImageExp/utils.d.ts +3 -3
- package/dist/components/GriddoLink/index.d.ts +8 -10
- package/dist/components/GriddoLink/utils.d.ts +6 -5
- package/dist/components/LdJson/index.d.ts +0 -2
- package/dist/components/Link/index.d.ts +1 -3
- package/dist/components/ModulePreview/index.d.ts +5 -5
- package/dist/components/Page/index.d.ts +6 -6
- package/dist/components/Preview/index.d.ts +3 -3
- package/dist/contexts/I18n/index.d.ts +1 -3
- package/dist/contexts/Navigation/index.d.ts +3 -3
- package/dist/contexts/Page/index.d.ts +1 -1
- package/dist/contexts/Session/index.d.ts +2 -2
- package/dist/contexts/Site/index.d.ts +6 -6
- package/dist/functions/autotypes/ascii.d.ts +3 -2
- package/dist/functions/autotypes/getTypeFromField.d.ts +3 -2
- package/dist/functions/autotypes/main.d.ts +2 -2
- package/dist/functions/autotypes/types.d.ts +9 -8
- package/dist/functions/image-utils.d.ts +5 -5
- package/dist/functions/index.d.ts +4 -4
- package/dist/functions/utils.d.ts +6 -6
- package/dist/hooks/__mocks__/page-provider-props.d.ts +1 -1
- package/dist/hooks/__mocks__/site-provider-props.d.ts +1 -1
- package/dist/hooks/themes/useGlobalTheme.d.ts +1 -1
- package/dist/hooks/themes/useTheme.d.ts +2 -2
- package/dist/hooks/themes/useThemeColors.d.ts +2 -2
- package/dist/hooks/themes/useThemeFont.d.ts +2 -2
- package/dist/hooks/themes/useThemePrimitives.d.ts +2 -2
- package/dist/hooks/themes/utils.d.ts +1 -1
- package/dist/hooks/useContentType.d.ts +1 -1
- package/dist/hooks/useContentTypeNavigation.d.ts +1 -1
- package/dist/hooks/useDataFilters.d.ts +2 -2
- package/dist/hooks/useGriddoImage.d.ts +1 -1
- package/dist/hooks/useGriddoImageExp.d.ts +1 -1
- package/dist/hooks/useI18n.d.ts +1 -1
- package/dist/hooks/useImage.d.ts +1 -1
- package/dist/hooks/useList.d.ts +4 -4
- package/dist/hooks/useListWithDefaultStaticPage.d.ts +3 -3
- package/dist/hooks/useLocaleDate.d.ts +1 -1
- package/dist/hooks/usePage.d.ts +1 -1
- package/dist/hooks/useReferenceFieldData.d.ts +1 -1
- package/dist/hooks/useSite.d.ts +1 -1
- package/dist/hooks/utils.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/node/index.js +4 -4
- package/dist/types/api-response-fields/index.d.ts +57 -57
- package/dist/types/core/index.d.ts +37 -37
- package/dist/types/global.d.ts +25 -15
- package/dist/types/schema-fields/base.d.ts +4 -4
- package/dist/types/schema-fields/page-content-type-fields.d.ts +37 -37
- package/dist/types/schema-fields/props.d.ts +37 -36
- package/dist/types/schema-fields/simple-content-type-fields.d.ts +3 -3
- package/dist/types/schema-fields/ui-fields.d.ts +2 -2
- package/dist/types/schema-fields/ui-template-fields.d.ts +3 -3
- package/dist/types/schemas/AutoTypes.d.ts +2 -1
- package/dist/types/schemas/Categories.d.ts +4 -3
- package/dist/types/schemas/ContentType.d.ts +4 -4
- package/dist/types/schemas/DamDefaults.d.ts +3 -2
- package/dist/types/schemas/DataPack.d.ts +3 -2
- package/dist/types/schemas/HeaderFooter.d.ts +5 -5
- package/dist/types/schemas/Languages.d.ts +3 -3
- package/dist/types/schemas/Menu.d.ts +5 -5
- package/dist/types/schemas/ModuleCategories.d.ts +3 -2
- package/dist/types/schemas/PageContentType.d.ts +6 -6
- package/dist/types/schemas/RichTextConfig.d.ts +2 -1
- package/dist/types/schemas/SimpleContentType.d.ts +6 -6
- package/dist/types/schemas/Themes.d.ts +4 -4
- package/dist/types/schemas/Translations.d.ts +3 -2
- package/dist/types/schemas/UI.d.ts +27 -19
- package/dist/types/schemas/base.d.ts +3 -3
- package/dist/types/schemas/index.d.ts +14 -14
- package/dist/types/schemas/props.d.ts +4 -4
- package/dist/types/theme/index.d.ts +10 -10
- package/dist/types/utilities.d.ts +7 -6
- package/package.json +32 -15
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps } from "../../hooks/useImage";
|
|
2
|
+
import type { ImageDecoding, ImageLoading } from "../../types/core";
|
|
3
|
+
import type { CSSProperties } from "react";
|
|
2
4
|
import "react-aspect-ratio/aspect-ratio.css";
|
|
3
|
-
import { CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps } from "../../hooks/useImage";
|
|
4
|
-
import { ImageDecoding, ImageLoading } from "../../types/core";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* <CloudinaryImage>
|
|
7
7
|
*
|
|
8
8
|
* @deprecated This component will be removed from Griddo in the future.
|
|
9
9
|
*/
|
|
@@ -16,7 +16,7 @@ export interface CloudinaryImageProps {
|
|
|
16
16
|
fixed?: boolean;
|
|
17
17
|
publicId?: string;
|
|
18
18
|
src?: string;
|
|
19
|
-
objectFit?:
|
|
19
|
+
objectFit?: CSSProperties["objectFit"];
|
|
20
20
|
quality?: number;
|
|
21
21
|
crop?: CloudinaryImageCrop;
|
|
22
22
|
gravity?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { Core } from "../..";
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import { Core } from "../..";
|
|
3
3
|
import "./styles.css";
|
|
4
4
|
export interface GriddoBackgroundImageProps {
|
|
5
5
|
format?: Core.ImageFormats;
|
|
@@ -18,9 +18,10 @@ export interface GriddoBackgroundImageProps {
|
|
|
18
18
|
loading?: Core.ImageLoading;
|
|
19
19
|
children?: React.ReactNode | Array<React.ReactNode>;
|
|
20
20
|
className?: string;
|
|
21
|
+
style?: React.CSSProperties;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* <GriddoBackgroundImage>
|
|
24
25
|
*/
|
|
25
26
|
declare const GriddoBackgroundImage: React.ForwardRefExoticComponent<GriddoBackgroundImageProps & React.RefAttributes<unknown>>;
|
|
26
27
|
export { GriddoBackgroundImage };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import type { FetchPriority, ImageCropType, ImageDecoding, ImageLoading, ImagePosition, ImageTransform, ResponsiveImageProps } from "../../types/core";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import "react-aspect-ratio/aspect-ratio.css";
|
|
3
|
-
import { FetchPriority, ImageCropType, ImageDecoding, ImageLoading, ImagePosition, ImageTransform, ResponsiveImageProps } from "../../types/core";
|
|
4
4
|
import "./styles.css";
|
|
5
5
|
/**
|
|
6
|
-
* `<GriddoImage>`
|
|
7
|
-
*
|
|
8
6
|
* Renders an image from the **Griddo** cdn.
|
|
9
7
|
* Also return a ref with the `<picture>` tag.
|
|
10
8
|
* @see [Documentation](https://www.notion.so/griddoio/GriddoImage-a3973298b4e7447884f29185dae2d07e)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Fields } from "../..";
|
|
2
|
-
import { FetchPriority, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform } from "../../types/core";
|
|
3
|
-
|
|
1
|
+
import type { Fields } from "../..";
|
|
2
|
+
import type { FetchPriority, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform } from "../../types/core";
|
|
3
|
+
interface Source {
|
|
4
4
|
sizes?: string;
|
|
5
5
|
media?: string;
|
|
6
6
|
width?: string;
|
|
@@ -11,7 +11,7 @@ export interface Source {
|
|
|
11
11
|
crop?: ImageCropType;
|
|
12
12
|
image?: Fields.Image;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
interface GriddoImageCommonPropsExperimental extends Omit<React.ComponentPropsWithRef<"img">, "src" | "srcSet" | "width" | "height"> {
|
|
15
15
|
crop?: ImageCropType;
|
|
16
16
|
fetchpriority?: FetchPriority;
|
|
17
17
|
/** @deprecated `<GriddoImageExp>` uses `position` from the `image` prop. */
|
|
@@ -33,22 +33,23 @@ export interface GriddoImageCommonPropsExperimental extends Omit<React.Component
|
|
|
33
33
|
/** Griddo ImageField */
|
|
34
34
|
image?: Fields.Image;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
interface GriddoImageSvgExperimental extends GriddoImageCommonPropsExperimental {
|
|
37
37
|
format?: "svg";
|
|
38
38
|
responsive?: never;
|
|
39
39
|
quality?: never;
|
|
40
40
|
formats?: never;
|
|
41
41
|
transforms?: never;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
interface GriddoImageGifExperimental extends GriddoImageCommonPropsExperimental {
|
|
44
44
|
format?: "gif";
|
|
45
45
|
responsive?: never;
|
|
46
46
|
quality?: never;
|
|
47
47
|
formats?: never;
|
|
48
48
|
transforms?: never;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
interface GriddoImageJpgWebpAvifExperimental extends GriddoImageCommonPropsExperimental {
|
|
51
51
|
/** Format is set automatically based on formats prop */
|
|
52
52
|
format?: never;
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
type GriddoImagePropsExperimental = GriddoImageJpgWebpAvifExperimental | GriddoImageGifExperimental | GriddoImageSvgExperimental;
|
|
55
|
+
export type { GriddoImageCommonPropsExperimental, GriddoImageGifExperimental, GriddoImageJpgWebpAvifExperimental, GriddoImagePropsExperimental, GriddoImageSvgExperimental, Source, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Source } from "./types";
|
|
2
|
-
import { Core, Fields } from "../..";
|
|
3
|
-
import { GriddoDamDefaults, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform } from "../../types/core";
|
|
1
|
+
import type { Source } from "./types";
|
|
2
|
+
import type { Core, Fields } from "../..";
|
|
3
|
+
import type { GriddoDamDefaults, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform } from "../../types/core";
|
|
4
4
|
interface GetGriddoArtDirectionImage {
|
|
5
5
|
sources: Array<Source>;
|
|
6
6
|
width?: string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { Url } from "../../types/api-response-fields";
|
|
2
|
+
import type { ComponentPropsWithoutRef, CSSProperties, MouseEvent, ReactNode, Ref } from "react";
|
|
3
3
|
/**
|
|
4
|
-
* <`GriddoLink>`
|
|
5
|
-
*
|
|
6
4
|
* Renders a router component from internal/external Griddo link.
|
|
7
5
|
* You may want to use `<GriddoLink>` instead of an `<a>` tag for internal Griddo pages.
|
|
8
6
|
* @see [Documentation](https://www.notion.so/griddoio/GriddoLink-bc4f7cddd1484648b024d4bebe4b74c3)
|
|
@@ -32,7 +30,7 @@ export interface LinkGetProps {
|
|
|
32
30
|
/** The app’s location. */
|
|
33
31
|
location: WindowLocation;
|
|
34
32
|
}
|
|
35
|
-
export interface GriddoLinkProps extends Omit<
|
|
33
|
+
export interface GriddoLinkProps extends Omit<ComponentPropsWithoutRef<"a">, "href"> {
|
|
36
34
|
/** Griddo Url with the link data */
|
|
37
35
|
url?: Url;
|
|
38
36
|
/** Calls up to you to get props for the underlying anchor element. Useful for styling the anchor as active. */
|
|
@@ -40,7 +38,7 @@ export interface GriddoLinkProps extends Omit<React.ComponentPropsWithoutRef<"a"
|
|
|
40
38
|
/** A class name that will be applied the current item is active. */
|
|
41
39
|
activeClassName?: string;
|
|
42
40
|
/** A style object that will be applied when the current item is active. */
|
|
43
|
-
activeStyle?:
|
|
41
|
+
activeStyle?: CSSProperties;
|
|
44
42
|
/** Whether partial URLs are considered active (e.g. /blog#hello-world matches <Link to="/blog"> if partiallyActive is true). */
|
|
45
43
|
partiallyActive?: boolean;
|
|
46
44
|
/** If `true`, the latest entry on the history stack will be replaced with a new one. Use this when you don’t want the previous page to show up when the user clicks the back button. */
|
|
@@ -49,11 +47,11 @@ export interface GriddoLinkProps extends Omit<React.ComponentPropsWithoutRef<"a"
|
|
|
49
47
|
* The linked page will have a `location` prop containing a nested `state` object structure containing the passed data. */
|
|
50
48
|
state?: Record<string, unknown>;
|
|
51
49
|
/** @deprecated If using React >= 16.4, use ref instead. */
|
|
52
|
-
innerRef?:
|
|
50
|
+
innerRef?: Ref<HTMLAnchorElement> | undefined;
|
|
53
51
|
/** If using React >=16.4, Link will forward its ref to you. */
|
|
54
|
-
ref?: (node: HTMLAnchorElement | null) =>
|
|
52
|
+
ref?: (node: HTMLAnchorElement | null) => ReactNode;
|
|
55
53
|
/** onCLick event */
|
|
56
|
-
onClick?: (event:
|
|
57
|
-
children?:
|
|
54
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
55
|
+
children?: ReactNode;
|
|
58
56
|
}
|
|
59
57
|
export { GriddoLink };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { FullPath } from "../../types/core";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { FullPath } from "../../types/core";
|
|
2
|
+
declare function getEnvironment(fullPath?: FullPath): "pre" | "pro";
|
|
3
|
+
declare function getRel(newTab: boolean, noFollow: boolean): string;
|
|
4
|
+
declare function getTarget(newTab: boolean): "_blank" | "_self";
|
|
5
|
+
declare function getRelativeToRootPath({ env, fullPath, to, }: {
|
|
6
6
|
env: string;
|
|
7
7
|
fullPath: FullPath;
|
|
8
8
|
to?: string;
|
|
9
9
|
}): string | undefined;
|
|
10
|
+
export { getEnvironment, getRel, getRelativeToRootPath, getTarget };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Url } from "../../types/api-response-fields";
|
|
1
|
+
import type { Url } from "../../types/api-response-fields";
|
|
2
2
|
/**
|
|
3
|
-
* `<Link>`
|
|
4
|
-
*
|
|
5
3
|
* @deprecated This component will be removed from Griddo in the future.
|
|
6
4
|
*/
|
|
7
5
|
declare function Link(props: LinkProps): JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentProps } from "../Component";
|
|
1
|
+
import type { Page } from "../../types/core";
|
|
2
|
+
import type { FC } from "react";
|
|
3
|
+
import { type ComponentProps } from "../Component";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* <ModulePreview>
|
|
6
6
|
*/
|
|
7
7
|
declare function ModulePreview(props: ModulePreviewProps): JSX.Element | null;
|
|
8
8
|
export interface ModulePreviewProps {
|
|
9
9
|
component: string;
|
|
10
10
|
content: Pick<Page, "title" | "breadcrumb" | "fullPath" | "fullUrl" | "siteSlug" | "template" | "origin" | "site" | "modified" | "published" | "structuredData" | "structuredDataContent" | "dimensions" | "isHome">;
|
|
11
11
|
library: {
|
|
12
|
-
components: Record<string,
|
|
12
|
+
components: Record<string, FC<Omit<ComponentProps, "libComponents">>>;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
export { ModulePreview };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentProps } from "../Component";
|
|
1
|
+
import type { Page } from "../../types/core";
|
|
2
|
+
import type { FC } from "react";
|
|
3
|
+
import { type ComponentProps } from "../Component";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* <PageComponent>
|
|
6
6
|
*/
|
|
7
7
|
declare function PageComponent(props: PageProps): JSX.Element;
|
|
8
8
|
export interface PageProps extends Pick<Page, "apiUrl" | "footer" | "header" | "languageId" | "pageLanguages" | "siteMetadata"> {
|
|
9
9
|
content: Pick<Page, "breadcrumb" | "canonicalURL" | "dimensions" | "footerTheme" | "fullPath" | "fullUrl" | "headerTheme" | "isHome" | "isIndexed" | "metaDescription" | "metasAdvanced" | "metaTitle" | "modified" | "origin" | "published" | "site" | "siteSlug" | "socialDescription" | "socialImage" | "socialTitle" | "structuredData" | "structuredDataContent" | "template" | "theme" | "title">;
|
|
10
10
|
library: {
|
|
11
|
-
components: Record<string,
|
|
12
|
-
templates: Record<string,
|
|
11
|
+
components: Record<string, FC<Omit<ComponentProps, "libComponents">>>;
|
|
12
|
+
templates: Record<string, FC<Omit<ComponentProps, "libComponents">>>;
|
|
13
13
|
};
|
|
14
14
|
children?: JSX.Element;
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ModulePreviewProps } from "../ModulePreview";
|
|
2
|
-
import { PageProps } from "../Page";
|
|
1
|
+
import { type ModulePreviewProps } from "../ModulePreview";
|
|
2
|
+
import { type PageProps } from "../Page";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* <Preview>
|
|
5
5
|
*/
|
|
6
6
|
declare function Preview(props: PreviewProps): JSX.Element;
|
|
7
7
|
export type PreviewProps = {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import type { LocaleTranslations } from "../../types/core";
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import { LocaleTranslations } from "../../types/core";
|
|
3
3
|
declare const I18nContext: React.Context<I18nContextProps>;
|
|
4
4
|
/**
|
|
5
|
-
* `<I18nProvider>`
|
|
6
|
-
*
|
|
7
5
|
* This provider component inject the `translation` object in the context of the site. Then you can retrieve the translation based on the page language using the `useI18n()` hook.
|
|
8
6
|
*/
|
|
9
7
|
declare function I18nProvider(props: I18nProviderProps): JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
declare const NavigationContext: React.Context<NavigationContextProps | null>;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* <NavigationProvider>
|
|
5
5
|
*/
|
|
6
6
|
declare function NavigationProvider(props: NavigationProviderProps): JSX.Element;
|
|
7
|
-
|
|
7
|
+
interface NavigationContextProps {
|
|
8
8
|
isNavigation: true;
|
|
9
9
|
}
|
|
10
10
|
interface NavigationProviderProps {
|
|
11
11
|
children: JSX.Element;
|
|
12
12
|
}
|
|
13
|
-
export { NavigationContext, NavigationProvider };
|
|
13
|
+
export { NavigationContext, NavigationProvider, type NavigationContextProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
declare const SessionContext: React.Context<ProviderValue>;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* <SessionProvider>
|
|
5
5
|
*/
|
|
6
6
|
declare const SessionProvider: (props: ProviderProps) => JSX.Element;
|
|
7
7
|
interface ProviderProps {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { GriddoLinkProps } from "../../components/GriddoLink";
|
|
2
|
+
import type { Site } from "../../types/core";
|
|
1
3
|
import * as React from "react";
|
|
2
|
-
import { GriddoLinkProps } from "../../components/GriddoLink";
|
|
3
|
-
import { Site } from "../../types/core";
|
|
4
4
|
declare const SiteContext: React.Context<SiteContextProps>;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* <SiteProvider>
|
|
7
7
|
*/
|
|
8
8
|
declare function SiteProvider(props: SiteProviderProps): JSX.Element;
|
|
9
|
-
|
|
9
|
+
interface SiteContextProps extends Site {
|
|
10
10
|
[key: string]: unknown;
|
|
11
11
|
linkComponent: (props: GriddoLinkProps) => JSX.Element;
|
|
12
12
|
navigate: () => null;
|
|
@@ -22,7 +22,7 @@ export interface SiteContextProps extends Site {
|
|
|
22
22
|
duplicateModuleAction: (editorID: number) => void;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
interface SiteProviderProps extends Site {
|
|
26
26
|
children: JSX.Element;
|
|
27
27
|
}
|
|
28
|
-
export { SiteContext, SiteProvider };
|
|
28
|
+
export { SiteContext, SiteProvider, type SiteContextProps, type SiteProviderProps, };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
declare const FOOTER_DESIGN = "\n//\n// . + . . . . . . . ..\n// . . . *\n// . * . . . . . . + . +\n// . . . . + . . .\n// . . . . . . .\n// . . . . . +. + . *\n// + . . . .\n// . . . * . . . . + . .\n// + . . . + . .\n// . . + .+. . .\n// . . . + . . . . .\n// . . . . . . . . ! / +\n// * . . . + . . - O -\n// . . . + . . * . . / | . .\n// . + . . . .. + .\n// . . . . * . * . +.. . * +\n// . . . . . . . . + . . +\n//\n//\n// The beauty of a living thing is not the atoms that go into it,\n// but the way those atoms are put together\n//\n// Carl Sagan\n//\n";
|
|
3
|
+
export { FOOTER_DESIGN, HEAD_DESIGN };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { KindSchema, SchemaTypeWithComponentProp } from "./types";
|
|
2
|
+
import type { PageContentTypeFields } from "../../types/schema-fields/page-content-type-fields";
|
|
3
|
+
import type { SimpleContentTypeFields } from "../../types/schema-fields/simple-content-type-fields";
|
|
2
4
|
import type { UIFields } from "../../types/schema-fields/ui-fields";
|
|
3
5
|
import type { UITemplateFields } from "../../types/schema-fields/ui-template-fields";
|
|
4
6
|
import type { Module } from "../../types/schemas";
|
|
5
7
|
import type { AutoTypesConfig } from "../../types/schemas/AutoTypes";
|
|
6
|
-
import { PageContentTypeFields } from "../../types/schema-fields/page-content-type-fields";
|
|
7
|
-
import { SimpleContentTypeFields } from "../../types/schema-fields/simple-content-type-fields";
|
|
8
8
|
/**
|
|
9
9
|
* Return a property with a Griddo type (serialized) based on a schema field.
|
|
10
10
|
*
|
|
@@ -17,6 +17,7 @@ import { SimpleContentTypeFields } from "../../types/schema-fields/simple-conten
|
|
|
17
17
|
*/
|
|
18
18
|
declare function getTypeFromField(field: UIFields | UITemplateFields | SimpleContentTypeFields | PageContentTypeFields, kind: KindSchema, options: {
|
|
19
19
|
hasDistributorData: boolean;
|
|
20
|
+
getStaticData: boolean;
|
|
20
21
|
moduleSchemas: Array<Module | undefined>;
|
|
21
22
|
schema: SchemaTypeWithComponentProp;
|
|
22
23
|
}, config?: AutoTypesConfig): string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LanguagesSchema, MenuItemsSchema, SchemaType } from "./types";
|
|
2
|
+
import type { DataPack, DataPackCategory, ModuleCategories } from "../../types/schemas";
|
|
2
3
|
import type { AutoTypesConfig } from "../../types/schemas/AutoTypes";
|
|
3
|
-
import {
|
|
4
|
-
import { ThemeEntry } from "../../types/schemas/Themes";
|
|
4
|
+
import type { ThemeEntry } from "../../types/schemas/Themes";
|
|
5
5
|
export declare function main(inputSchemas: Record<string, SchemaType>, menuItemsSchemas: MenuItemsSchema, languagesSchemas: LanguagesSchema, moduleCategoriesSchema: ModuleCategories, datapacksSchema: Record<string, DataPack>, datapacksCategoriesSchema: Record<string, DataPackCategory>, themesSchema: Array<ThemeEntry>, subthemesSchema: Array<string>, config?: AutoTypesConfig): Promise<void>;
|
|
@@ -3,21 +3,22 @@ import type * as PageContentType_Fields from "../../types/schema-fields/page-con
|
|
|
3
3
|
import type * as SimpleContentType_Fields from "../../types/schema-fields/simple-content-type-fields";
|
|
4
4
|
import type * as UI_Fields from "../../types/schema-fields/ui-fields";
|
|
5
5
|
import type * as UITemplate_Fields from "../../types/schema-fields/ui-template-fields";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type SchemaFieldTypes = "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";
|
|
7
|
+
type FieldReturnTypes = "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";
|
|
8
|
+
type SchemaType = Schema.Component | Schema.ContentTypeModule | Schema.MultiPageModule | Schema.Module | Schema.Template | Schema.ListTemplate | Schema.SimpleContentType | Schema.PageContentType;
|
|
9
|
+
type SchemaTypeWithComponentProp = Schema.Component | Schema.ContentTypeModule | Schema.MultiPageModule | Schema.Module | Schema.Template | Schema.ListTemplate | (Schema.SimpleContentType & {
|
|
10
10
|
component: string;
|
|
11
11
|
}) | (Schema.PageContentType & {
|
|
12
12
|
component: string;
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
type Fields = UI_Fields.UIFields | UITemplate_Fields.UITemplateFields | SimpleContentType_Fields.SimpleContentTypeFields | PageContentType_Fields.PageContentTypeFields;
|
|
15
|
+
type KindSchema = "object" | "component" | "module" | "template" | "simpleContentType" | "pageContentType";
|
|
16
|
+
interface MenuItemsSchema {
|
|
17
17
|
link: Record<string, SchemaType>;
|
|
18
18
|
group: Record<string, SchemaType>;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
type LanguagesSchema = Record<Core.Locale, {
|
|
21
21
|
name: string;
|
|
22
22
|
label: string;
|
|
23
23
|
}>;
|
|
24
|
+
export type { FieldReturnTypes, Fields, KindSchema, LanguagesSchema, MenuItemsSchema, SchemaFieldTypes, SchemaType, SchemaTypeWithComponentProp, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ImageConfig } from "../hooks/useGriddoImage";
|
|
2
|
-
import { CloudinaryResponsiveImageProps } from "../hooks/useImage";
|
|
3
|
-
import { Core } from "../index";
|
|
4
|
-
import { ResponsiveImageProps } from "../types/core";
|
|
1
|
+
import type { ImageConfig } from "../hooks/useGriddoImage";
|
|
2
|
+
import type { CloudinaryResponsiveImageProps } from "../hooks/useImage";
|
|
3
|
+
import type { Core } from "../index";
|
|
4
|
+
import type { ResponsiveImageProps } from "../types/core";
|
|
5
5
|
declare function rearrangeResponsiveArray(arr: Array<ResponsiveImageProps>): Core.ResponsiveImageProps[];
|
|
6
6
|
declare function cloudinaryRearrangeResponsiveArray(arr?: Array<CloudinaryResponsiveImageProps>): CloudinaryResponsiveImageProps[];
|
|
7
7
|
declare function fillIntArray(n: number, from?: number): number[];
|
|
@@ -41,4 +41,4 @@ interface GetGriddoDamURIWithParamsProps {
|
|
|
41
41
|
imageConfig: ImageConfig;
|
|
42
42
|
[key: string]: unknown;
|
|
43
43
|
}
|
|
44
|
-
export {
|
|
44
|
+
export { cleanCloudinaryURI, cloudinaryRearrangeResponsiveArray, fillIntArray, getDamIdFromDamUrl, getDomainFromDamUrl, getGriddoDamURIWithParams, mergeObjects, rearrangeResponsiveArray, removeUnit, rndHash, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
declare const getComponent: (components: Record<string,
|
|
1
|
+
import type { ComponentProps } from "../components/Component";
|
|
2
|
+
import type { FC } from "react";
|
|
3
|
+
declare const getComponent: (components: Record<string, FC<Omit<ComponentProps, "libComponents">>>, props: {
|
|
4
4
|
component: string;
|
|
5
5
|
[key: string]: unknown;
|
|
6
|
-
}) =>
|
|
6
|
+
}) => FC<Omit<ComponentProps, "libComponents">> | null;
|
|
7
7
|
export { getComponent };
|
|
@@ -28,17 +28,17 @@ declare function getLang(): number | false;
|
|
|
28
28
|
* recursiveSearch
|
|
29
29
|
* Devuelve una lista con los valores de una prop dentro de un objeto
|
|
30
30
|
* La búsqueda es recursiva en todo el objeto
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
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
36
|
* @example
|
|
37
37
|
* Obtiene una lista con los valores de la prop "a"
|
|
38
38
|
* recursiveSearch({ obj: {a: 1, b: {a: "foo"}}, "a"})
|
|
39
39
|
* -> [1, "foo"]
|
|
40
40
|
*
|
|
41
|
-
* @return
|
|
41
|
+
* @return Un array con los valores de la propiedad `searchValue`
|
|
42
42
|
*/
|
|
43
43
|
declare function recursiveSearch({ obj, searchKey, resultsBuffer, unique, }?: RecursiveSearchProps): string[];
|
|
44
44
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SiteProviderProps } from "../../contexts/Site";
|
|
1
|
+
import type { SiteProviderProps } from "../../contexts/Site";
|
|
2
2
|
export declare const siteProviderProps: () => SiteProviderProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Theme } from "../..";
|
|
1
|
+
import type { Theme } from "../..";
|
|
2
2
|
export declare const filterThemePrimitivesByType: (themes: Array<Theme.GlobalTheme | Theme.Theme>, primitives: string | Array<string>, subtheme?: string) => ({
|
|
3
3
|
primitives: Theme.Primitives;
|
|
4
4
|
subthemes: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { FiltersDataApiQueryResponseProps, PickRename, SetQueryProps } from "../types/global";
|
|
2
|
+
import { type UseFetchStateProps } from "./useFetch";
|
|
3
3
|
/**
|
|
4
4
|
* `useDataFilters()`
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform, ResponsiveImageProps } from "../types/core";
|
|
1
|
+
import type { ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform, ResponsiveImageProps } from "../types/core";
|
|
2
2
|
/**
|
|
3
3
|
* `useGriddoImage()`
|
|
4
4
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform } from "../types/core";
|
|
1
|
+
import type { ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform } from "../types/core";
|
|
2
2
|
/**
|
|
3
3
|
* `useGriddoImage()`
|
|
4
4
|
*/
|
package/dist/hooks/useI18n.d.ts
CHANGED
package/dist/hooks/useImage.d.ts
CHANGED