@griddo/core 1.74.37 → 1.75.1
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 +60 -66
- package/dist/assets/svg/Delete.d.ts +3 -0
- package/dist/assets/svg/Duplicate.d.ts +3 -0
- package/dist/components/CloudinaryBackgroundImage/index.d.ts +23 -0
- package/dist/components/CloudinaryImage/index.d.ts +30 -0
- package/dist/components/Component/ComponentWrapper/index.d.ts +16 -0
- package/dist/components/Component/index.d.ts +27 -0
- package/dist/components/GriddoBackgroundImage/index.d.ts +7 -0
- package/dist/components/GriddoImage/index.d.ts +57 -0
- package/dist/components/GriddoLink/index.d.ts +59 -0
- package/dist/components/GriddoLink/utils.d.ts +9 -0
- package/dist/components/LdJson/index.d.ts +14 -0
- package/dist/components/Link/index.d.ts +15 -0
- package/dist/components/ModulePreview/index.d.ts +15 -0
- package/dist/components/Page/index.d.ts +16 -0
- package/dist/components/Preview/index.d.ts +11 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/constants/cloudinary.d.ts +17 -0
- package/dist/contexts/I18n/index.d.ts +24 -0
- package/dist/contexts/Navigation/index.d.ts +13 -0
- package/dist/contexts/Page/index.d.ts +15 -0
- package/dist/contexts/Site/index.d.ts +27 -0
- package/dist/contexts/index.d.ts +4 -0
- package/dist/functions/create-schemas/index.d.ts +18 -0
- package/dist/functions/image-utils.d.ts +43 -0
- package/dist/functions/index.d.ts +7 -0
- package/dist/functions/utils.d.ts +74 -0
- package/dist/hooks/index.d.ts +18 -0
- package/dist/hooks/themes/types.d.ts +20 -0
- package/dist/hooks/themes/useGlobalTheme.d.ts +6 -0
- package/dist/hooks/themes/useTheme.d.ts +8 -0
- package/dist/hooks/themes/useThemeColors.d.ts +8 -0
- package/dist/hooks/themes/useThemeFont.d.ts +8 -0
- package/dist/hooks/themes/useThemePrimitives.d.ts +8 -0
- package/dist/hooks/themes/utils.d.ts +61 -0
- package/dist/hooks/useContentType.d.ts +11 -0
- package/dist/hooks/useDataFilters.d.ts +35 -0
- package/dist/hooks/useGriddoImage.d.ts +49 -0
- package/dist/hooks/useI18n.d.ts +38 -0
- package/dist/hooks/useImage.d.ts +44 -0
- package/dist/hooks/useLink.d.ts +8 -0
- package/dist/hooks/useList.d.ts +36 -0
- package/dist/hooks/useNavigation.d.ts +5 -0
- package/dist/hooks/usePage.d.ts +11 -0
- package/dist/hooks/useReferenceFieldData.d.ts +11 -0
- package/dist/hooks/useSite.d.ts +12 -0
- package/dist/hooks/useSitemap.d.ts +7 -0
- package/dist/index.d.ts +24 -6
- package/dist/index.js +1 -1
- package/dist/types/constants/locales.d.ts +2 -0
- package/dist/types/constants/timezone.d.ts +2 -0
- package/dist/types/constants/utilities.d.ts +1 -0
- package/dist/types/core.d.ts +263 -0
- package/dist/types/fields.d.ts +191 -0
- package/dist/types/global.d.ts +33 -0
- package/dist/{src/types → types}/schema-functions/fields/base.d.ts +33 -43
- package/dist/{src/types/schema-functions/fields/page-data-fields.d.ts → types/schema-functions/fields/page-content-type-fields.d.ts} +4 -4
- package/dist/{src/types → types}/schema-functions/fields/props.d.ts +11 -26
- package/dist/{src/types/schema-functions/fields/pure-data-fields.d.ts → types/schema-functions/fields/simple-content-type-fields.d.ts} +4 -4
- package/dist/{src/types → types}/schema-functions/fields/ui-fields.d.ts +6 -6
- package/dist/types/schema-functions/schemas/Categories.d.ts +10 -0
- package/dist/types/schema-functions/schemas/ContentType.d.ts +4 -0
- package/dist/types/schema-functions/schemas/DamDefaults.d.ts +13 -0
- package/dist/{src/types/schema-functions/schemas/DataPackSchema.d.ts → types/schema-functions/schemas/DataPack.d.ts} +3 -4
- package/dist/types/schema-functions/schemas/DataPackCategory.d.ts +4 -0
- package/dist/{src/types/schema-functions/schemas/HeaderFooterSchema.d.ts → types/schema-functions/schemas/HeaderFooter.d.ts} +15 -16
- package/dist/types/schema-functions/schemas/Languages.d.ts +9 -0
- package/dist/{src/types/schema-functions/schemas/MenuSchema.d.ts → types/schema-functions/schemas/Menu.d.ts} +2 -2
- package/dist/types/schema-functions/schemas/ModuleCategories.d.ts +9 -0
- package/dist/types/schema-functions/schemas/PageContentType.d.ts +19 -0
- package/dist/types/schema-functions/schemas/SimpleContentType.d.ts +15 -0
- package/dist/types/schema-functions/schemas/Themes.d.ts +9 -0
- package/dist/types/schema-functions/schemas/Translations.d.ts +2 -0
- package/dist/types/schema-functions/schemas/UI.d.ts +49 -0
- package/dist/{src/types → types}/schema-functions/schemas/base.d.ts +15 -27
- package/dist/types/schema-functions/schemas/index.d.ts +12 -0
- package/dist/{src/types → types}/schema-functions/schemas/props.d.ts +6 -7
- package/dist/{src/types → types}/schema.d.ts +0 -0
- package/dist/types/theme.d.ts +51 -0
- package/package.json +74 -75
- package/dist/src/functions/create-schemas/index.d.ts +0 -69
- package/dist/src/functions/create-schemas/utils.d.ts +0 -33
- package/dist/src/types/core.d.ts +0 -419
- package/dist/src/types/fields.d.ts +0 -7
- package/dist/src/types/schema-functions/schemas/CategoriesSchema.d.ts +0 -13
- package/dist/src/types/schema-functions/schemas/DamDefaultsSchema.d.ts +0 -11
- package/dist/src/types/schema-functions/schemas/DataPackCategoriesSchema.d.ts +0 -4
- package/dist/src/types/schema-functions/schemas/LanguagesSchema.d.ts +0 -8
- package/dist/src/types/schema-functions/schemas/ModuleCategoriesSchema.d.ts +0 -6
- package/dist/src/types/schema-functions/schemas/PageDataSchema.d.ts +0 -20
- package/dist/src/types/schema-functions/schemas/PureDataSchema.d.ts +0 -14
- package/dist/src/types/schema-functions/schemas/ThemesSchema.d.ts +0 -11
- package/dist/src/types/schema-functions/schemas/TranslationsSchema.d.ts +0 -3
- package/dist/src/types/schema-functions/schemas/UISchema.d.ts +0 -47
- package/dist/src/types/schema-functions/schemas/index.d.ts +0 -14
- package/dist/src/types/theme.d.ts +0 -57
package/README.md
CHANGED
|
@@ -1,81 +1,75 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./src/assets/griddo-core-logo.png" alt="Griddo starter logo" width="280" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<blockquote>
|
|
6
|
+
<p>The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together.</p>
|
|
7
|
+
<footer>— <a href="https://en.wikipedia.org/wiki/Carl_Sagan">Carl Sagan</a></footer>
|
|
8
|
+
</blockquote>
|
|
9
|
+
|
|
10
|
+
<br/>
|
|
11
|
+
|
|
1
12
|
# Griddo Core
|
|
2
13
|
|
|
3
|
-
|
|
14
|
+
Components, hooks and common utilities for the instances and the Griddo product itself written in Typescript.
|
|
4
15
|
|
|
5
|
-
##
|
|
16
|
+
## Types
|
|
6
17
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- `<GriddoImage />`
|
|
12
|
-
- `<GriddoLink />`
|
|
13
|
-
- `<LdJson />`
|
|
14
|
-
- `<ModulePreview />`
|
|
15
|
-
- `<Page />`
|
|
16
|
-
- `<Preview />`
|
|
18
|
+
- `Schema` Griddo schema types
|
|
19
|
+
- `Fields` Griddo fields (API return for schema fields) types
|
|
20
|
+
- `Core` Griddo common types
|
|
21
|
+
- `Theme` Griddo theme creation types
|
|
17
22
|
|
|
18
|
-
##
|
|
23
|
+
## Components
|
|
19
24
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
25
|
+
- `<CloudinaryBackgroundImage>`
|
|
26
|
+
- `<CloudinaryImage>`
|
|
27
|
+
- `<Component>`
|
|
28
|
+
- `<GriddoBackgroundImage>`
|
|
29
|
+
- `<GriddoImage>`
|
|
30
|
+
- `<GriddoLink>`
|
|
31
|
+
- `<LdJson>`
|
|
32
|
+
- `<ModulePreview>`
|
|
33
|
+
- `<Page>`
|
|
34
|
+
- `<Preview>`
|
|
23
35
|
|
|
24
36
|
## Hooks
|
|
25
37
|
|
|
26
|
-
- `useAvif()`
|
|
27
38
|
- `useDataFilters()`
|
|
28
|
-
- `useDistributorData()`
|
|
29
|
-
- `useReferenceFieldData()` como alias for `useDistributorData()`
|
|
39
|
+
- `useDistributorData()` alias for `useReferenceFieldData()`
|
|
30
40
|
- `useGriddoImage()`
|
|
31
41
|
- `useI18n()`
|
|
32
42
|
- `useImage()`
|
|
33
|
-
- `
|
|
34
|
-
- `usePage()`
|
|
43
|
+
- `useList()`
|
|
35
44
|
- `usePage()`
|
|
45
|
+
- `useReferenceFieldData()`
|
|
36
46
|
- `useSite()`
|
|
37
|
-
- `
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<br/>
|
|
67
|
-
|
|
68
|
-
### Funciones
|
|
69
|
-
|
|
70
|
-
- `createCategoriesSchema`: Crea un schema para un dato de tipo categoría (taxonomy).
|
|
71
|
-
- `createDamDefaultsSchema`: Crea un schema para las opciones por defecto del DAM.
|
|
72
|
-
- `createDataPackCategoriesSchema`: Crea un schema para una categoría de DataPack.
|
|
73
|
-
- `createDataPackSchema`: Crea un schema para un DataPack.
|
|
74
|
-
- `createLanguagesSchema`: Crea un schema para los idiomas de la instancia.
|
|
75
|
-
- `createMenuSchema`: Crea un schema para un menú.
|
|
76
|
-
- `createModuleCategoriesSchema`: Crea un schema de categorías de módulos.
|
|
77
|
-
- `createPageDataSchema`: Crea un schema de UI para un dato estructurado de página.
|
|
78
|
-
- `createPureDataSchema`: Crea un schema de UI para un dato estructurado puro.
|
|
79
|
-
- `createThemesSchema`: Crea un schema para los temas.
|
|
80
|
-
- `createTranslationsSchema`: Crea un schema de traducciones estáticas (i18n)
|
|
81
|
-
- `createUISchema`: Crea un schema de UI para un componente, módulo o template.
|
|
47
|
+
- `useuNavigation()`
|
|
48
|
+
|
|
49
|
+
## Contexts and Providers
|
|
50
|
+
|
|
51
|
+
- `<I18n>`
|
|
52
|
+
- `<Page>`
|
|
53
|
+
- `<Site>`
|
|
54
|
+
- `<NavigationProvider>`
|
|
55
|
+
|
|
56
|
+
## Functions
|
|
57
|
+
|
|
58
|
+
**Schemas**
|
|
59
|
+
|
|
60
|
+
- `createCategoryContentTypeSchema`
|
|
61
|
+
- `createComponentSchema`
|
|
62
|
+
- `createDamDefaultsSchema`
|
|
63
|
+
- `createDataPackCategorySchema`
|
|
64
|
+
- `createDataPackSchema`
|
|
65
|
+
- `createFooterSchema`
|
|
66
|
+
- `createHeaderSchema`
|
|
67
|
+
- `createLanguagesSchema`
|
|
68
|
+
- `createMenuSchema`
|
|
69
|
+
- `createModuleCategoriesSchema`
|
|
70
|
+
- `createModuleSchema`
|
|
71
|
+
- `createPageContentTypeSchema`
|
|
72
|
+
- `createSimpleContentTypeSchema`
|
|
73
|
+
- `createTemplateSchema`
|
|
74
|
+
- `createThemesSchema`
|
|
75
|
+
- `createTranslationsSchema`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
/**
|
|
4
|
+
* `<CloudinaryBackgroundImage>`
|
|
5
|
+
*
|
|
6
|
+
* @deprecated This component will be removed from Griddo in the future.
|
|
7
|
+
*/
|
|
8
|
+
declare function CloudinaryBackgroundImage({ backgroundRepeat, backgroundSize, backgroundPosition, children, overlayColor, overlayOpacity, overlayTransition, ratio, publicId, src, customLazyClassName, lazy, ...props }: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
backgroundRepeat?: string | undefined;
|
|
11
|
+
backgroundSize?: string | undefined;
|
|
12
|
+
backgroundPosition?: string | undefined;
|
|
13
|
+
children: any;
|
|
14
|
+
overlayColor?: null | undefined;
|
|
15
|
+
overlayOpacity?: number | undefined;
|
|
16
|
+
overlayTransition?: string | undefined;
|
|
17
|
+
ratio: any;
|
|
18
|
+
publicId: any;
|
|
19
|
+
src: any;
|
|
20
|
+
customLazyClassName?: string | undefined;
|
|
21
|
+
lazy: any;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
export { CloudinaryBackgroundImage };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import "react-aspect-ratio/aspect-ratio.css";
|
|
3
|
+
import { CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps } from "../../hooks/useImage";
|
|
4
|
+
import { ImageDecoding, ImageLoading } from "../../types/core";
|
|
5
|
+
/**
|
|
6
|
+
* `<CloudinaryImage>`
|
|
7
|
+
*
|
|
8
|
+
* @deprecated This component will be removed from Griddo in the future.
|
|
9
|
+
*/
|
|
10
|
+
declare function CloudinaryImage(props: CloudinaryImageProps): JSX.Element;
|
|
11
|
+
export interface CloudinaryImageProps {
|
|
12
|
+
alt?: string;
|
|
13
|
+
width?: string;
|
|
14
|
+
height?: string;
|
|
15
|
+
ratio?: number | string;
|
|
16
|
+
fixed?: boolean;
|
|
17
|
+
publicId?: string;
|
|
18
|
+
src?: string;
|
|
19
|
+
objectFit?: React.CSSProperties["objectFit"];
|
|
20
|
+
quality?: number;
|
|
21
|
+
crop?: CloudinaryImageCrop;
|
|
22
|
+
gravity?: string;
|
|
23
|
+
format?: CloudinaryImageFormat;
|
|
24
|
+
loading?: ImageLoading;
|
|
25
|
+
backgroundLazy?: boolean;
|
|
26
|
+
decoding?: ImageDecoding;
|
|
27
|
+
sizes?: string;
|
|
28
|
+
responsive?: Array<CloudinaryResponsiveImageProps>;
|
|
29
|
+
}
|
|
30
|
+
export { CloudinaryImage };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./style.css";
|
|
3
|
+
/**
|
|
4
|
+
* `<Wrapper>`
|
|
5
|
+
*/
|
|
6
|
+
declare const Wrapper: (props: WrapperProps) => JSX.Element;
|
|
7
|
+
interface WrapperProps {
|
|
8
|
+
selectedEditorID: number | null;
|
|
9
|
+
editorID?: number;
|
|
10
|
+
component: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
parentEditorID?: number;
|
|
13
|
+
isSelectionAllowed: boolean;
|
|
14
|
+
children: JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
export { Wrapper as ComponentWrapper };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* `<Component>`
|
|
4
|
+
*
|
|
5
|
+
* Griddo core component to render dynamically a component/module (using the `component` prop) from the `libComponents` (a list of React components) with the props we provide to it
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import Hero from './Hero'
|
|
9
|
+
* import CardCollection from './CardCollection'
|
|
10
|
+
* const moduleList = { Hero, CardCollection }
|
|
11
|
+
*
|
|
12
|
+
* // Render the Hero component from `moduleList` with `props`
|
|
13
|
+
* <Component
|
|
14
|
+
* libComponents={moduleList}
|
|
15
|
+
* {{ component: 'Hero', ...props }}
|
|
16
|
+
* />
|
|
17
|
+
*/
|
|
18
|
+
declare function Component({ libComponents, ...props }: ComponentProps): JSX.Element | null;
|
|
19
|
+
export interface ComponentProps {
|
|
20
|
+
libComponents: Record<string, React.FC<Omit<ComponentProps, "libComponents">>>;
|
|
21
|
+
editorID?: number;
|
|
22
|
+
component: string;
|
|
23
|
+
type?: string;
|
|
24
|
+
parentEditorID?: number;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
export { Component };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import "react-aspect-ratio/aspect-ratio.css";
|
|
3
|
+
import { FetchPriority, ImageCropType, ImageDecoding, ImageLoading, ImagePosition, ImageTransform, ResponsiveImageProps } from "../../types/core";
|
|
4
|
+
import "./styles.css";
|
|
5
|
+
/**
|
|
6
|
+
* `<GriddoImage>`
|
|
7
|
+
*
|
|
8
|
+
* Renders an image from the **Griddo** cdn.
|
|
9
|
+
* Also return a ref with the `<picture>` tag.
|
|
10
|
+
* [Documentation](https://www.notion.so/griddoio/GriddoImage-a3973298b4e7447884f29185dae2d07e)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <GriddoImage
|
|
14
|
+
* url="https://images.griddo.io/butterfly"
|
|
15
|
+
* width="640px"
|
|
16
|
+
* height="480px"
|
|
17
|
+
* quality={75}
|
|
18
|
+
* />
|
|
19
|
+
*/
|
|
20
|
+
declare const GriddoImage: React.ForwardRefExoticComponent<(Pick<GriddoImageJpgWebpAvif, "fixed" | "slot" | "style" | "title" | "children" | "color" | "lang" | "id" | "is" | "url" | "key" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "crop" | "responsive" | "decoding" | "format" | "height" | "loading" | "quality" | "width" | "alt" | "ratio" | "formats" | "position" | "transforms" | "crossOrigin" | "useMap" | "fetchpriority"> | Pick<GriddoImageGif, "fixed" | "slot" | "style" | "title" | "children" | "color" | "lang" | "id" | "is" | "url" | "key" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "crop" | "responsive" | "decoding" | "format" | "height" | "loading" | "quality" | "width" | "alt" | "ratio" | "formats" | "position" | "transforms" | "crossOrigin" | "useMap" | "fetchpriority"> | Pick<GriddoImageSvg, "fixed" | "slot" | "style" | "title" | "children" | "color" | "lang" | "id" | "is" | "url" | "key" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "crop" | "responsive" | "decoding" | "format" | "height" | "loading" | "quality" | "width" | "alt" | "ratio" | "formats" | "position" | "transforms" | "crossOrigin" | "useMap" | "fetchpriority">) & React.RefAttributes<HTMLPictureElement>>;
|
|
21
|
+
interface GriddoImageCommonProps extends Omit<React.ComponentPropsWithRef<"img">, "src" | "srcSet" | "sizes" | "width" | "height"> {
|
|
22
|
+
crop?: ImageCropType;
|
|
23
|
+
fetchpriority?: FetchPriority;
|
|
24
|
+
height?: string;
|
|
25
|
+
position?: ImagePosition;
|
|
26
|
+
url?: string;
|
|
27
|
+
width?: string;
|
|
28
|
+
ratio?: number;
|
|
29
|
+
fixed?: boolean;
|
|
30
|
+
loading?: ImageLoading;
|
|
31
|
+
decoding?: ImageDecoding;
|
|
32
|
+
responsive?: Array<ResponsiveImageProps>;
|
|
33
|
+
quality?: number;
|
|
34
|
+
formats?: Array<"webp" | "avif">;
|
|
35
|
+
transforms?: ImageTransform;
|
|
36
|
+
}
|
|
37
|
+
interface GriddoImageSvg extends GriddoImageCommonProps {
|
|
38
|
+
format?: "svg";
|
|
39
|
+
responsive?: never;
|
|
40
|
+
quality?: never;
|
|
41
|
+
formats?: never;
|
|
42
|
+
transforms?: never;
|
|
43
|
+
ratio?: never;
|
|
44
|
+
}
|
|
45
|
+
interface GriddoImageGif extends GriddoImageCommonProps {
|
|
46
|
+
format?: "gif";
|
|
47
|
+
responsive?: never;
|
|
48
|
+
quality?: never;
|
|
49
|
+
formats?: never;
|
|
50
|
+
transforms?: never;
|
|
51
|
+
}
|
|
52
|
+
interface GriddoImageJpgWebpAvif extends GriddoImageCommonProps {
|
|
53
|
+
/** Format is set automatically based on formats prop */
|
|
54
|
+
format?: never;
|
|
55
|
+
}
|
|
56
|
+
export declare type GriddoImageProps = GriddoImageJpgWebpAvif | GriddoImageGif | GriddoImageSvg;
|
|
57
|
+
export { GriddoImage };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { UrlField } from "../../types/fields";
|
|
3
|
+
/**
|
|
4
|
+
* <`GriddoLink>`
|
|
5
|
+
*
|
|
6
|
+
* Renders a router component from internal/external Griddo link.
|
|
7
|
+
* You may want to use `<GriddoLink>` instead of an `<a>` tag for internal Griddo pages.
|
|
8
|
+
* [Documentation](https://www.notion.so/griddoio/GriddoLink-bc4f7cddd1484648b024d4bebe4b74c3)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <GriddoLink
|
|
12
|
+
* activeClass="activeLink"
|
|
13
|
+
* url={ linkToURL: 'https://...' }
|
|
14
|
+
* />
|
|
15
|
+
*/
|
|
16
|
+
declare function GriddoLink({ activeClassName, activeStyle, style, children, getProps, partiallyActive, state, url, title, className, ...props }: GriddoLinkProps): JSX.Element;
|
|
17
|
+
export interface HLocation<S = unknown> {
|
|
18
|
+
pathname: string;
|
|
19
|
+
search: string;
|
|
20
|
+
state: S;
|
|
21
|
+
hash: string;
|
|
22
|
+
key?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare type WindowLocation<S = unknown> = Window["location"] & HLocation<S>;
|
|
25
|
+
export interface LinkGetProps {
|
|
26
|
+
/** `true` if the location.pathname is exactly the same as the anchor’s href. */
|
|
27
|
+
isCurrent: boolean;
|
|
28
|
+
/** `true` if the location.pathname is exactly the same as the anchor’s href. */
|
|
29
|
+
isPartiallyCurrent: boolean;
|
|
30
|
+
/** The fully resolved href of the link. */
|
|
31
|
+
href: string;
|
|
32
|
+
/** The app’s location. */
|
|
33
|
+
location: WindowLocation;
|
|
34
|
+
}
|
|
35
|
+
export interface GriddoLinkProps extends Omit<React.ComponentPropsWithoutRef<"a">, "href"> {
|
|
36
|
+
/** Griddo UrlField with the link data */
|
|
37
|
+
url?: UrlField;
|
|
38
|
+
/** Calls up to you to get props for the underlying anchor element. Useful for styling the anchor as active. */
|
|
39
|
+
getProps?: ((props: LinkGetProps) => Record<string, never>) | undefined;
|
|
40
|
+
/** A class name that will be applied the current item is active. */
|
|
41
|
+
activeClassName?: string;
|
|
42
|
+
/** A style object that will be applied when the current item is active. */
|
|
43
|
+
activeStyle?: React.CSSProperties;
|
|
44
|
+
/** Whether partial URLs are considered active (e.g. /blog#hello-world matches <Link to="/blog"> if partiallyActive is true). */
|
|
45
|
+
partiallyActive?: boolean;
|
|
46
|
+
/** 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. */
|
|
47
|
+
replace?: boolean;
|
|
48
|
+
/** Used to pass state data to the linked page.
|
|
49
|
+
* The linked page will have a `location` prop containing a nested `state` object structure containing the passed data. */
|
|
50
|
+
state?: Record<string, unknown>;
|
|
51
|
+
/** @deprecated If using React >= 16.4, use ref instead. */
|
|
52
|
+
innerRef?: React.Ref<HTMLAnchorElement> | undefined;
|
|
53
|
+
/** If using React >=16.4, Link will forward its ref to you. */
|
|
54
|
+
ref?: (node: HTMLAnchorElement | null) => React.ReactNode;
|
|
55
|
+
/** onCLick event */
|
|
56
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
export { GriddoLink };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FullPath } from "../../types/core";
|
|
2
|
+
export declare function getEnvironment(fullPath?: FullPath): "pre" | "pro";
|
|
3
|
+
export declare function getRel(newTab: boolean, noFollow: boolean): string;
|
|
4
|
+
export declare function getTarget(newTab: boolean): "_blank" | "_self";
|
|
5
|
+
export declare function getRelativeToRootPath({ env, fullPath, to, }: {
|
|
6
|
+
env: string;
|
|
7
|
+
fullPath: FullPath;
|
|
8
|
+
to?: string;
|
|
9
|
+
}): string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* `<LdJson>`
|
|
4
|
+
*
|
|
5
|
+
* Inject a google structured data into the `<header>`
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <LdJson data={schemaData} />
|
|
9
|
+
*/
|
|
10
|
+
declare function LdJson(props: LdJsonProps): JSX.Element;
|
|
11
|
+
interface LdJsonProps {
|
|
12
|
+
data: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export { LdJson };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UrlField } from "../../types/fields";
|
|
3
|
+
/**
|
|
4
|
+
* `<Link>`
|
|
5
|
+
*
|
|
6
|
+
* @deprecated This component will be removed from Griddo in the future.
|
|
7
|
+
*/
|
|
8
|
+
declare function Link(props: LinkProps): JSX.Element;
|
|
9
|
+
interface LinkProps {
|
|
10
|
+
url: UrlField;
|
|
11
|
+
linkProp?: string;
|
|
12
|
+
children: JSX.Element;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export { Link };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Page } from "../../types/core";
|
|
3
|
+
import { ComponentProps } from "../Component";
|
|
4
|
+
/**
|
|
5
|
+
* `<ModulePreview>`
|
|
6
|
+
*/
|
|
7
|
+
declare function ModulePreview(props: ModulePreviewProps): JSX.Element | null;
|
|
8
|
+
export interface ModulePreviewProps {
|
|
9
|
+
component: string;
|
|
10
|
+
content: Pick<Page, "title" | "breadcrumb" | "fullPath" | "fullUrl" | "siteSlug" | "template" | "origin" | "site" | "modified" | "published" | "structuredDataContent" | "dimensions" | "isHome">;
|
|
11
|
+
library: {
|
|
12
|
+
components: Record<string, React.FC<Omit<ComponentProps, "libComponents">>>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export { ModulePreview };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Page } from "../../types/core";
|
|
3
|
+
import { ComponentProps } from "../Component";
|
|
4
|
+
/**
|
|
5
|
+
* `<PageComponent>`
|
|
6
|
+
*/
|
|
7
|
+
declare function PageComponent(props: PageProps): JSX.Element;
|
|
8
|
+
export interface PageProps extends Pick<Page, "apiUrl" | "footer" | "header" | "languageId" | "pageLanguages" | "siteMetadata"> {
|
|
9
|
+
content: Pick<Page, "breadcrumb" | "dimensions" | "fullPath" | "fullUrl" | "isHome" | "modified" | "origin" | "published" | "site" | "siteSlug" | "structuredDataContent" | "template" | "title">;
|
|
10
|
+
library: {
|
|
11
|
+
components: Record<string, React.FC<Omit<ComponentProps, "libComponents">>>;
|
|
12
|
+
templates: Record<string, React.FC<Omit<ComponentProps, "libComponents">>>;
|
|
13
|
+
};
|
|
14
|
+
children: JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
export { PageComponent as Page };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ModulePreviewProps } from "../ModulePreview";
|
|
3
|
+
import { PageProps } from "../Page";
|
|
4
|
+
/**
|
|
5
|
+
* `<Preview>`
|
|
6
|
+
*/
|
|
7
|
+
declare function Preview(props: PreviewProps): JSX.Element;
|
|
8
|
+
export declare type PreviewProps = {
|
|
9
|
+
isPage?: boolean;
|
|
10
|
+
} & (ModulePreviewProps | PageProps);
|
|
11
|
+
export { Preview };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CloudinaryBackgroundImage } from "./CloudinaryBackgroundImage";
|
|
2
|
+
import { CloudinaryImage } from "./CloudinaryImage";
|
|
3
|
+
import { Component } from "./Component";
|
|
4
|
+
import { GriddoBackgroundImage } from "./GriddoBackgroundImage";
|
|
5
|
+
import { GriddoImage } from "./GriddoImage";
|
|
6
|
+
import { GriddoLink } from "./GriddoLink";
|
|
7
|
+
import { LdJson } from "./LdJson";
|
|
8
|
+
import { Link } from "./Link";
|
|
9
|
+
import { ModulePreview } from "./ModulePreview";
|
|
10
|
+
import { Page } from "./Page";
|
|
11
|
+
import { Preview } from "./Preview";
|
|
12
|
+
export { CloudinaryBackgroundImage, CloudinaryImage, Component, GriddoBackgroundImage, GriddoImage, GriddoLink, LdJson, Link, ModulePreview, Page, Preview, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
domain: string;
|
|
3
|
+
uploadFolder: string;
|
|
4
|
+
fallback404ImageId: string;
|
|
5
|
+
quality: number;
|
|
6
|
+
crop: string;
|
|
7
|
+
gravity: string;
|
|
8
|
+
format: string;
|
|
9
|
+
loading: string;
|
|
10
|
+
backgroundLazy: boolean;
|
|
11
|
+
decoding: string;
|
|
12
|
+
responsive: {
|
|
13
|
+
breakpoint: null;
|
|
14
|
+
width: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { LocaleTranslations } from "../../types/core";
|
|
3
|
+
declare const I18nContext: React.Context<I18nContextProps>;
|
|
4
|
+
/**
|
|
5
|
+
* `<I18nProvider>`
|
|
6
|
+
*
|
|
7
|
+
* 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
|
+
*/
|
|
9
|
+
declare function I18nProvider(props: I18nProviderProps): JSX.Element;
|
|
10
|
+
interface I18nContextProps {
|
|
11
|
+
translations?: LocaleTranslations;
|
|
12
|
+
}
|
|
13
|
+
interface I18nProviderProps {
|
|
14
|
+
children: JSX.Element;
|
|
15
|
+
/** Object with static translations using local i18n locale codes.
|
|
16
|
+
* @example
|
|
17
|
+
* {
|
|
18
|
+
* es_ES: { hi: "Hola", ... }
|
|
19
|
+
* en_US: { hi: "Hello", ... }
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
translations?: LocaleTranslations;
|
|
23
|
+
}
|
|
24
|
+
export { I18nContext, I18nProvider };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const NavigationContext: React.Context<NavigationContextProps | null>;
|
|
3
|
+
/**
|
|
4
|
+
* `<NavigationProvider>`
|
|
5
|
+
*/
|
|
6
|
+
declare function NavigationProvider(props: NavigationProviderProps): JSX.Element;
|
|
7
|
+
export interface NavigationContextProps {
|
|
8
|
+
isNavigation: true;
|
|
9
|
+
}
|
|
10
|
+
interface NavigationProviderProps {
|
|
11
|
+
children: JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export { NavigationContext, NavigationProvider };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Page } from "../../types/core";
|
|
3
|
+
declare const PageContext: React.Context<Partial<PageProps>>;
|
|
4
|
+
/**
|
|
5
|
+
* `<PageProvider>`
|
|
6
|
+
*
|
|
7
|
+
* This provider component inject some props in the context of the page. Then you can retrieve the context values using the `usePage()` hook.
|
|
8
|
+
*/
|
|
9
|
+
declare function PageProvider(props: PageProviderProps): JSX.Element;
|
|
10
|
+
declare type PageProps = Pick<Page, "activeSectionBase" | "activeSectionSlug" | "apiUrl" | "breadcrumb" | "componentList" | "dimensions" | "firstModule" | "footer" | "fullPath" | "fullUrl" | "header" | "isHome" | "isIndexed" | "languageId" | "metaDescription" | "metasAdvanced" | "metaTitle" | "modified" | "origin" | "pageLanguages" | "published" | "sectionModules" | "site" | "siteMetadata" | "siteSlug" | "socialDescription" | "socialImage" | "socialTitle" | "structuredDataContent" | "title">;
|
|
11
|
+
export declare type PageContextProps = Partial<PageProps>;
|
|
12
|
+
export interface PageProviderProps extends PageProps {
|
|
13
|
+
children: JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export { PageContext, PageProvider };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { GriddoLinkProps } from "../../components/GriddoLink";
|
|
3
|
+
import { Site } from "../../types/core";
|
|
4
|
+
declare const SiteContext: React.Context<SiteContextProps>;
|
|
5
|
+
/**
|
|
6
|
+
* `<SiteProvider>`
|
|
7
|
+
*/
|
|
8
|
+
declare function SiteProvider(props: SiteProviderProps): JSX.Element;
|
|
9
|
+
export interface SiteContextProps extends Site {
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
linkComponent: (props: GriddoLinkProps) => JSX.Element;
|
|
12
|
+
navigate: () => null;
|
|
13
|
+
selectEditorID?(selectedComponent: {
|
|
14
|
+
editorID?: number;
|
|
15
|
+
component: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
parentEditorID?: number;
|
|
18
|
+
}, parentComponent: string | undefined | null, e: React.SyntheticEvent): void;
|
|
19
|
+
moduleActions?: {
|
|
20
|
+
deleteModuleAction: (editorID: number) => void;
|
|
21
|
+
duplicateModuleAction: (editorID: number) => void;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface SiteProviderProps extends Site {
|
|
25
|
+
children: JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
export { SiteContext, SiteProvider };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NavigationContext, NavigationProvider } from "./Navigation";
|
|
2
|
+
import { PageContext, PageProvider } from "./Page";
|
|
3
|
+
import { SiteContext, SiteProvider } from "./Site";
|
|
4
|
+
export { PageContext, PageProvider, SiteContext, SiteProvider, NavigationContext, NavigationProvider, };
|