@griddo/core 1.75.12 → 1.75.14
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/autotype.js +1 -0
- package/dist/components/GriddoLink/index.d.ts +3 -3
- package/dist/components/Link/index.d.ts +2 -2
- package/dist/functions/create-types/index.d.ts +1 -0
- package/dist/functions/create-types/type-transforms.d.ts +6 -0
- package/dist/functions/create-types/types.d.ts +14 -0
- package/dist/functions/create-types/utils.d.ts +165 -0
- package/dist/hooks/useContentType.d.ts +1 -1
- package/dist/hooks/useReferenceFieldData.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/types/autotypes.d.ts +1 -0
- package/dist/types/core.d.ts +2 -2
- package/dist/types/fields.d.ts +40 -41
- package/dist/types/global.d.ts +1 -1
- package/dist/types/schema-functions/fields/base.d.ts +19 -0
- package/dist/types/schema-functions/fields/page-content-type-fields.d.ts +4 -4
- package/dist/types/schema-functions/fields/props.d.ts +6 -1
- package/dist/types/schema-functions/fields/simple-content-type-fields.d.ts +3 -3
- package/dist/types/schema-functions/fields/ui-fields.d.ts +2 -2
- package/dist/types/schema-functions/schemas/PageContentType.d.ts +2 -2
- package/dist/types/schema-functions/schemas/base.d.ts +3 -3
- package/dist/types/schema-functions/schemas/props.d.ts +7 -2
- package/package.json +7 -2
package/dist/autotype.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("fs"),t=require("path"),n=require("prettier");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e),o=r(t),s=r(n),l=e=>new Promise((t=>{i.default.access(e,(e=>{t(!e)}))}));l.sync=e=>{try{return i.default.accessSync(e),!0}catch(e){return!1}};var a=e=>{if(e<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()};return i=>new Promise(((o,s)=>{const l=()=>{var e;n++,(e=i,new Promise((t=>{t(e())}))).then((e=>{o(e),r()}),(e=>{s(e),r()}))};n<e?l():t.push(l)}))};class c extends Error{constructor(e){super(),this.value=e}}var d=(e,t,n)=>{n=Object.assign({concurrency:1/0,preserveOrder:!0},n);const r=a(n.concurrency),i=Array.from(e).map((e=>[e,r((()=>Promise.resolve(e).then(t)))])),o=a(n.preserveOrder?1:1/0);return Promise.all(i.map((e=>o((()=>(e=>Promise.all(e).then((e=>!0===e[1]&&Promise.reject(new c(e[0])))))(e)))))).then((()=>{})).catch((e=>e instanceof c?e.value:Promise.reject(e)))},u=(e,t)=>(t=Object.assign({cwd:process.cwd()},t),d(e,(e=>l(o.default.resolve(t.cwd,e))),t));u.sync=(e,t)=>{t=Object.assign({cwd:process.cwd()},t);for(const n of e)if(l.sync(o.default.resolve(t.cwd,n)))return n};var p=(e,t)=>{t=t||{};const n=o.default.resolve(t.cwd||""),r=o.default.parse(n).root,i=[].concat(e);return new Promise((e=>{!function t(n){u(i,{cwd:n}).then((i=>{i?e(o.default.join(n,i)):n===r?e(null):t(o.default.dirname(n))}))}(n)}))};p.sync=(e,t)=>{t=t||{};let n=o.default.resolve(t.cwd||"");const r=o.default.parse(n).root,i=[].concat(e);for(;;){const e=u.sync(i,{cwd:n});if(e)return o.default.join(n,e);if(n===r)return null;n=o.default.dirname(n)}};var f=e=>p("package.json",{cwd:e}).then((e=>e?o.default.dirname(e):null));f.sync=e=>{const t=p.sync("package.json",{cwd:e});return t?o.default.dirname(t):null};const m=(e,t)=>{if("string"!=typeof e&&!Array.isArray(e))throw new TypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);if(e=Array.isArray(e)?e.map((e=>e.trim())).filter((e=>e.length)).join("-"):e.trim(),0===e.length)return"";if(1===e.length)return t.pascalCase?e.toUpperCase():e.toLowerCase();return e!==e.toLowerCase()&&(e=(e=>{let t=!1,n=!1,r=!1;for(let i=0;i<e.length;i++){const o=e[i];t&&/[a-zA-Z]/.test(o)&&o.toUpperCase()===o?(e=e.slice(0,i)+"-"+e.slice(i),t=!1,r=n,n=!0,i++):n&&r&&/[a-zA-Z]/.test(o)&&o.toLowerCase()===o?(e=e.slice(0,i-1)+"-"+e.slice(i-1),r=n,n=!1,t=!0):(t=o.toLowerCase()===o&&o.toUpperCase()!==o,r=n,n=o.toUpperCase()===o&&o.toLowerCase()!==o)}return e})(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,((e,t)=>t.toUpperCase())).replace(/\d+(\w|$)/g,(e=>e.toUpperCase())),n=e,t.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;var n};var y=m,F=m;function h(e,t){var n,r;const{returnTypeName:i,generic:o}=t||{};return`\n${(null===(n=e._autoType)||void 0===n?void 0:n.doc)?`${null===(r=e._autoType)||void 0===r?void 0:r.doc}`:""}\n${`${e.key}?: ${i||_(e.type)} `}${o?`<${o}>`:""};`}function g(e){return e.length>1?`{\n\t\t\t${e.map((e=>`${y(e)}?: ${e}`)).join(",")}\n\t\t\t}`:e.join("")}function _(e){return{ArrayFieldGroup:"Fields.ArrayFieldGroup",AsyncCheckGroup:"Fields.AsyncCheckGroup",AsyncSelect:"Fields.AsyncSelect",CheckGroup:"Fields.CheckGroup",ColorPicker:"Fields.ColorPicker",ComponentArray:"Fields.ComponentArray",ComponentContainer:"Fields.ComponentContainer",ConditionalField:"Fields.Conditional",DateField:"Fields.Date",FieldGroup:"Fields.FieldGroup",FieldsDivider:"Fields.FieldsDivider",FileField:"Fields.File",HeadingField:"Fields.Heading",ImageField:"Fields.Image",LinkField:"Fields.Link",MultiCheckSelect:"Fields.MultiCheckSelect<Relations>",MultiCheckSelectGroup:"Fields.MultiCheckSelectGroup",NoteField:"Fields.Note",NumberField:"Fields.Number",RadioGroup:"Fields.RadioGroup",ReferenceField:"Fields.Reference",RichText:"Fields.RichText",Select:"Fields.Select",SliderField:"Fields.Slider",TextArea:"Fields.TextArea",TextField:"Fields.Text",ToggleField:"Fields.Toggle",UniqueCheck:"Fields.UniqueCheck",UrlField:"Fields.Url",VisualUniqueSelection:"Fields.VisualUniqueSelection",Wysiwyg:"Fields.Wysiwyg"}[e]}function $(e,t,n){const{type:r,_autoType:i,key:o}=e,{interfaceSuffix:s}=n;if(!(null==i?void 0:i.ignore)){if("AsyncCheckGroup"===r||"DateField"===r||"FileField"===r||"ImageField"===r||"MultiCheckSelect"===r||"NoteField"===r||"NumberField"===r||"RichText"===r||"SliderField"===r||"TextArea"===r||"TextField"===r||"ToggleField"===r||"UniqueCheck"===r||"UrlField"===r||"Wysiwyg"===r)return h(e);if("ColorPicker"===r)return e.onlyFixedColors?h(e,{returnTypeName:"Fields.ColorPickerFixed"}):h(e);if("HeadingField"===r||"RadioGroup"===r||"Select"===r||"CheckGroup"===r){const{options:t}=e,n=function(e){return e.map((({value:e})=>`"${e}"`)).join("|")}(t);return h(e,{generic:n})}if("LinkField"===r){const{whiteList:t}=e;return h(e,{generic:g(t)})}if("AsyncSelect"===r)return"entity"in e&&"menu_containers"===e.entity?`${o}?: Fields.Menu;`:`${o}?: Fields.AsyncSelect;`;if("FieldGroup"===r)return`\n\t\t\t// << ${r}\n\t\t\t${e.fields.map((e=>$(e,t,n))).join("")}\n\t\t\t// end >>\n\t\t`;if("ArrayFieldGroup"===r)return`\n\t\t\t// << ${r}\n\t\t\t${o}?: Fields.ArrayFieldGroup<{${e.fields.map((e=>`${e.key}: ${_(e.type)}`)).join(",")}}>;\n\t\t\t// end >>\n\t\t`;if("ConditionalField"===r){const i=e.fields.map((e=>$(e,t,n)));return`\n\t\t\t// << ${r}\n\t\t\t${o}?: ${_(r)}<${e.options.map((e=>`"${e.value}"`)).join("|")}>;\n\t\t\t${i.join("")}\n\t\t\t// end >>\n\t\t`}if("ComponentArray"===r){const n="template"===t?"TemplateSection":"ComponentArray",r="template"===t?"":"?",i=e,{key:o,_autoType:l,whiteList:a}=i,c=(null==l?void 0:l.suffix)||s;return`${o}${r}: Fields.${n}<${a.map((e=>`${e}${c}`)).join("|")}>;`}if("ComponentContainer"===r&&("object"===t||"component"===t||"module"===t||"template"===t)){const t=e,{whiteList:n}=t;return h(e,{generic:g(n)})}if("ReferenceField"===r){const{source:t}=e,n=t.map((e=>`${e}ContentType${s}`)).join("|");return`\n\t\t\t${h(e,{generic:n})}\n\t\t\t${`queriedData?: Fields.QueriedData<${n}>`};\n\t\t`}if("VisualUniqueSelection"===r){const t=e.options[0],n=e.options[0];let r="";if(t.value){r=e.options.map((e=>`"${e.value}"`)).join("|")}if(n.theme){r=e.options[0].options.map((e=>`"${e.value}"`)).join("|")}return h(e,{generic:r})}throw new Error("Wrong schema!")}}y.default=F;const C=o.default.join(`${f.sync(__dirname)}/`,"../ax/scripts"),w=require(`${C}/__griddo_config_parsed__.js`),v=(T=Object.assign(Object.assign(Object.assign({},w.schemas.all),w.schemas.templates),w.schemas.structuredData),Object.keys(T).map((e=>Object.assign(Object.assign({},T[e]),{component:e}))));var T;const j=(k={interfaceSuffix:"",contentTypeSuffix:"ContentType"},v.map((e=>{var t;let n,r,i="",o="",s="";const{component:l}=e,{interfaceSuffix:a,contentTypeSuffix:c}=k;r=(null===(t=e._autoType)||void 0===t?void 0:t.relations)?"<Relations = unknown>":"","fromPage"in e?(n=e.fromPage?"pageContentType":"simpleContentType",i=c,o=`contentTypeName: "${e.component}";`,r="<Relations = unknown>"):(n=e.schemaType,s=`component?: "${l}";`);const d=function(e){if("fromPage"in e)return e.taxonomy?[]:e.schema.fields;if("template"===e.schemaType)return e.content||[];if("component"===e.schemaType||"module"===e.schemaType)return e.configTabs.map((e=>e.fields)).flat();throw new Error("Wrong schema")}(e).map((e=>$(e,n,k))).filter(Boolean).join("");return`\n\t\t\t\texport interface ${l}${i}${a}${r} {\n\t\t\t\t\t${o}\n\t\t\t\t\t${s}\n\t\t\t\t\t${d}\n\t\t\t\t}`})).join(""));var k;const A=`//\n// Griddo\n// ____ _ _ ___ ____ ___ _ _ ___ ____\n// |__| | | | | | | _/ |__] |___\n// | | |__| | |__| | | | |___\n//\n// These types have been generated from the schemas.\n// Get the benefits of types without typing them!\n// More information about the Griddo AutoType in <...>\n//\n\nimport { Fields } from "@griddo/core"\n\n${s.default.format(j,{parser:"typescript"}).replace(/^\s*\n/gm,"")}`,S=o.default.resolve(f.sync(__dirname)||"","dist/types");e.writeFileSync(`${o.default.join(S,"autotypes.d.ts")}`,A),console.log("🤖 AutoType ✓");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Url } from "../../types/fields";
|
|
3
3
|
/**
|
|
4
4
|
* <`GriddoLink>`
|
|
5
5
|
*
|
|
@@ -33,8 +33,8 @@ export interface LinkGetProps {
|
|
|
33
33
|
location: WindowLocation;
|
|
34
34
|
}
|
|
35
35
|
export interface GriddoLinkProps extends Omit<React.ComponentPropsWithoutRef<"a">, "href"> {
|
|
36
|
-
/** Griddo
|
|
37
|
-
url?:
|
|
36
|
+
/** Griddo Url with the link data */
|
|
37
|
+
url?: Url;
|
|
38
38
|
/** Calls up to you to get props for the underlying anchor element. Useful for styling the anchor as active. */
|
|
39
39
|
getProps?: ((props: LinkGetProps) => Record<string, never>) | undefined;
|
|
40
40
|
/** A class name that will be applied the current item is active. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { Url } from "../../types/fields";
|
|
3
3
|
/**
|
|
4
4
|
* `<Link>`
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ import { UrlField } from "../../types/fields";
|
|
|
7
7
|
*/
|
|
8
8
|
declare function Link(props: LinkProps): JSX.Element;
|
|
9
9
|
interface LinkProps {
|
|
10
|
-
url:
|
|
10
|
+
url: Url;
|
|
11
11
|
linkProp?: string;
|
|
12
12
|
children: JSX.Element;
|
|
13
13
|
[key: string]: unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Schema } from "../..";
|
|
2
|
+
import * as PageContentType_Fields from "../../types/schema-functions/fields/page-content-type-fields";
|
|
3
|
+
import * as SimpleContentType_Fields from "../../types/schema-functions/fields/simple-content-type-fields";
|
|
4
|
+
import * as UI_Fields from "../../types/schema-functions/fields/ui-fields";
|
|
5
|
+
export declare 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" | "TextArea" | "TextField" | "ToggleField" | "UniqueCheck" | "UrlField" | "VisualUniqueSelection" | "Wysiwyg";
|
|
6
|
+
export declare 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<Relations>" | "Fields.MultiCheckSelectGroup" | "Fields.Note" | "Fields.Number" | "Fields.RadioGroup" | "Fields.Reference" | "Fields.RichText" | "Fields.Select" | "Fields.Slider" | "Fields.TextArea" | "Fields.Text" | "Fields.Toggle" | "Fields.UniqueCheck" | "Fields.Url" | "Fields.VisualUniqueSelection" | "Fields.Wysiwyg";
|
|
7
|
+
export declare type SchemaType = Schema.Component | Schema.Module | Schema.Template | Schema.SimpleContentType | Schema.PageContentType;
|
|
8
|
+
export declare type SchemaTypeWithComponentProp = Schema.Component | Schema.Module | Schema.Template | (Schema.SimpleContentType & {
|
|
9
|
+
component: string;
|
|
10
|
+
}) | (Schema.PageContentType & {
|
|
11
|
+
component: string;
|
|
12
|
+
});
|
|
13
|
+
export declare type Fields = UI_Fields.UIFields | SimpleContentType_Fields.SimpleContentTypeFields | PageContentType_Fields.PageContentTypeFields;
|
|
14
|
+
export declare type KindSchema = "object" | "component" | "module" | "template" | "simpleContentType" | "pageContentType";
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Fields, FieldReturnTypes, SchemaType, SchemaFieldTypes } from "./types";
|
|
2
|
+
/** Get all fields from one schema */
|
|
3
|
+
declare function getAllFields(schema: SchemaType): import("../../types/schema-functions/fields/ui-fields").UIFields[] | import("../../types/schema-functions/fields/page-content-type-fields").PageContentTypeFields[];
|
|
4
|
+
/** Build a interface prop based on the field from the schema.
|
|
5
|
+
* Optionally it can receives a custom value for the type and a generic string to use as generic value
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* getInterfacePropType(TextFieldObjectFromSchema)
|
|
9
|
+
* // -> TextFieldObjectFromSchema.key: Fields.TextField
|
|
10
|
+
* getInterfacePropType(TextFieldObjectFromSchema, 'MyCustomValue', 'foo')
|
|
11
|
+
* // -> TextFieldObjectFromSchema.key: MyCustomValue<foo>
|
|
12
|
+
*/
|
|
13
|
+
declare type GetInterfacePropTypeOptions = {
|
|
14
|
+
returnTypeName?: FieldReturnTypes;
|
|
15
|
+
generic?: string;
|
|
16
|
+
};
|
|
17
|
+
declare function getInterfacePropType(field: Fields, options?: GetInterfacePropTypeOptions): string;
|
|
18
|
+
declare function getGenericFromOptions(options: Array<{
|
|
19
|
+
value: unknown;
|
|
20
|
+
}>): string;
|
|
21
|
+
declare function getGenericFromWhitelist(whiteList: Array<string>): string;
|
|
22
|
+
declare function schemasToArray(objectSchemas: Record<string, SchemaType>): ({
|
|
23
|
+
component: string;
|
|
24
|
+
taxonomy: false;
|
|
25
|
+
fromPage: true;
|
|
26
|
+
schema: import("../../types/schema-functions/fields/props").SearchFrom & {
|
|
27
|
+
templates: string[];
|
|
28
|
+
fields: import("../../types/schema-functions/fields/page-content-type-fields").PageContentTypeFields[];
|
|
29
|
+
};
|
|
30
|
+
title: string;
|
|
31
|
+
abstract?: string | undefined;
|
|
32
|
+
image?: string | undefined;
|
|
33
|
+
local?: boolean | undefined;
|
|
34
|
+
editable?: boolean | undefined;
|
|
35
|
+
translate?: boolean | undefined;
|
|
36
|
+
clone?: {
|
|
37
|
+
cloneAll: boolean;
|
|
38
|
+
sourceSites: number[];
|
|
39
|
+
targetSites: {
|
|
40
|
+
site: number;
|
|
41
|
+
path: string;
|
|
42
|
+
mandatory: boolean;
|
|
43
|
+
}[];
|
|
44
|
+
sections: {
|
|
45
|
+
section: string;
|
|
46
|
+
sync: string;
|
|
47
|
+
}[];
|
|
48
|
+
} | null | undefined;
|
|
49
|
+
defaultValues?: unknown;
|
|
50
|
+
_autoType?: {
|
|
51
|
+
relations?: boolean | undefined;
|
|
52
|
+
} | undefined;
|
|
53
|
+
dataPacks?: string[] | null | undefined;
|
|
54
|
+
expirationDateField?: string | undefined;
|
|
55
|
+
expirationDateOffset?: number | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
component: string;
|
|
58
|
+
fromPage: false;
|
|
59
|
+
schema: import("../../types/schema-functions/fields/props").SearchFrom & {
|
|
60
|
+
fields: import("../../types/schema-functions/fields/simple-content-type-fields").SimpleContentTypeFields[];
|
|
61
|
+
};
|
|
62
|
+
title: string;
|
|
63
|
+
abstract?: string | undefined;
|
|
64
|
+
image?: string | undefined;
|
|
65
|
+
local?: boolean | undefined;
|
|
66
|
+
taxonomy?: boolean | undefined;
|
|
67
|
+
editable?: boolean | undefined;
|
|
68
|
+
translate?: boolean | undefined;
|
|
69
|
+
clone?: {
|
|
70
|
+
cloneAll: boolean;
|
|
71
|
+
sourceSites: number[];
|
|
72
|
+
targetSites: {
|
|
73
|
+
site: number;
|
|
74
|
+
path: string;
|
|
75
|
+
mandatory: boolean;
|
|
76
|
+
}[];
|
|
77
|
+
sections: {
|
|
78
|
+
section: string;
|
|
79
|
+
sync: string;
|
|
80
|
+
}[];
|
|
81
|
+
} | null | undefined;
|
|
82
|
+
defaultValues?: unknown;
|
|
83
|
+
_autoType?: {
|
|
84
|
+
relations?: boolean | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
dataPacks?: string[] | null | undefined;
|
|
87
|
+
expirationDateField?: string | undefined;
|
|
88
|
+
expirationDateOffset?: number | undefined;
|
|
89
|
+
} | {
|
|
90
|
+
component: string;
|
|
91
|
+
schemaType: "component";
|
|
92
|
+
configTabs: import("../../types/schema-functions/schemas/props").ConfigTabs[];
|
|
93
|
+
default: {
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
component: string;
|
|
96
|
+
};
|
|
97
|
+
singleInstance?: boolean | undefined;
|
|
98
|
+
category?: string | undefined;
|
|
99
|
+
displayName: string;
|
|
100
|
+
sectionList?: {
|
|
101
|
+
[key: string]: string[];
|
|
102
|
+
} | undefined;
|
|
103
|
+
thumbnails?: import("../../types/schema-functions/schemas/props").Thumbnails | {
|
|
104
|
+
[key: string]: import("../../types/schema-functions/schemas/props").Thumbnails;
|
|
105
|
+
} | undefined;
|
|
106
|
+
hasDistributorData?: boolean | undefined;
|
|
107
|
+
dataPacks?: string[] | null | undefined;
|
|
108
|
+
_autoType?: {
|
|
109
|
+
relations?: boolean | undefined;
|
|
110
|
+
} | undefined;
|
|
111
|
+
} | {
|
|
112
|
+
component: string;
|
|
113
|
+
schemaType: "module";
|
|
114
|
+
configTabs: import("../../types/schema-functions/schemas/props").ConfigTabs[];
|
|
115
|
+
default: {
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
component: string;
|
|
118
|
+
};
|
|
119
|
+
singleInstance?: boolean | undefined;
|
|
120
|
+
category?: string | undefined;
|
|
121
|
+
displayName: string;
|
|
122
|
+
sectionList?: {
|
|
123
|
+
[key: string]: string[];
|
|
124
|
+
} | undefined;
|
|
125
|
+
thumbnails?: import("../../types/schema-functions/schemas/props").Thumbnails | {
|
|
126
|
+
[key: string]: import("../../types/schema-functions/schemas/props").Thumbnails;
|
|
127
|
+
} | undefined;
|
|
128
|
+
hasDistributorData?: boolean | undefined;
|
|
129
|
+
dataPacks?: string[] | null | undefined;
|
|
130
|
+
_autoType?: {
|
|
131
|
+
relations?: boolean | undefined;
|
|
132
|
+
} | undefined;
|
|
133
|
+
} | {
|
|
134
|
+
component: string;
|
|
135
|
+
schemaType: "template";
|
|
136
|
+
type: {
|
|
137
|
+
label: string;
|
|
138
|
+
value: string;
|
|
139
|
+
mode?: "list" | "detail" | undefined;
|
|
140
|
+
special?: "404" | "sitemap" | undefined;
|
|
141
|
+
};
|
|
142
|
+
dimensions?: import("../../types/schema-functions/schemas/props").Dimension[] | undefined;
|
|
143
|
+
content?: import("../../types/schema-functions/fields/ui-fields").UIFields[] | undefined;
|
|
144
|
+
config?: import("../../types/schema-functions/fields/ui-fields").UIFields[] | undefined;
|
|
145
|
+
default: {
|
|
146
|
+
[key: string]: unknown;
|
|
147
|
+
templateType: string;
|
|
148
|
+
};
|
|
149
|
+
singleInstance?: boolean | undefined;
|
|
150
|
+
category?: string | undefined;
|
|
151
|
+
displayName: string;
|
|
152
|
+
sectionList?: {
|
|
153
|
+
[key: string]: string[];
|
|
154
|
+
} | undefined;
|
|
155
|
+
thumbnails?: import("../../types/schema-functions/schemas/props").Thumbnails | {
|
|
156
|
+
[key: string]: import("../../types/schema-functions/schemas/props").Thumbnails;
|
|
157
|
+
} | undefined;
|
|
158
|
+
hasDistributorData?: boolean | undefined;
|
|
159
|
+
dataPacks?: string[] | null | undefined;
|
|
160
|
+
_autoType?: {
|
|
161
|
+
relations?: boolean | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
})[];
|
|
164
|
+
declare function returnType(type: SchemaFieldTypes): FieldReturnTypes;
|
|
165
|
+
export { getAllFields, getGenericFromOptions, getGenericFromWhitelist, getInterfacePropType, returnType, schemasToArray, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fields } from "..";
|
|
2
2
|
interface UseContentTypeProps<ContentType> {
|
|
3
3
|
/** The ReferenceField from the module schema */
|
|
4
|
-
data?: Fields.
|
|
4
|
+
data?: Fields.Reference<ContentType>;
|
|
5
5
|
/** The queriedData prop from the building phase */
|
|
6
6
|
queriedData?: Fields.QueriedData<ContentType>;
|
|
7
7
|
/** --to-be-implemented-- ContentType prop to be processed */
|
|
@@ -7,5 +7,5 @@ import { Fields } from "..";
|
|
|
7
7
|
* @example
|
|
8
8
|
* const dataItems = useReferenceFieldData<NewsContentType>(data)
|
|
9
9
|
*/
|
|
10
|
-
declare function useReferenceFieldData<GriddoContentType = unknown>(data?: Fields.
|
|
10
|
+
declare function useReferenceFieldData<GriddoContentType = unknown>(data?: Fields.Reference<GriddoContentType>): Fields.QueriedData<GriddoContentType> | undefined | null;
|
|
11
11
|
export { useReferenceFieldData };
|
package/dist/index.d.ts
CHANGED
|
@@ -21,4 +21,5 @@ import * as Core from "./types/core";
|
|
|
21
21
|
import * as Fields from "./types/fields";
|
|
22
22
|
import * as Schema from "./types/schema-functions/schemas";
|
|
23
23
|
import * as Theme from "./types/theme";
|
|
24
|
-
|
|
24
|
+
import * as AutoType from "./types/autotypes";
|
|
25
|
+
export { AutoType, PageContext, PageProvider, SiteContext, SiteProvider, SessionContext, SessionProvider, SiteProviderProps, CloudinaryBackgroundImage, CloudinaryImage, Component, GriddoBackgroundImage, GriddoImage, GriddoLink, LdJson, Link, Page, Preview, UseDataFilterSetUrlAction, UseDataFiltersItem, UseDataFiltersReturn, UseDataFiltersSetQueryProps, UseDataFiltersState, CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps, GenerateImageChunkProps, I18nFunctions, ImageChunk, ImageConfig, UseListItem, UseListReturn, UseListSetQueryProps, UseListSetUrlAction, UseListState, UseGriddoImageProps, UseGriddoImageReturn, UseI18nProps, UseImageProps, useContentType, useDataFilters, useGriddoImage, useI18n, useImage, useLink, useList, useNavigation, usePage, useReferenceFieldData as useDistributorData, useReferenceFieldData, useSite, useSitemap, useGlobalTheme, useTheme, useThemeColors, useThemeFont, useThemePrimitives, useSession, getLang, getSiteID, getToken, getComponent, createCategoryContentTypeSchema, createComponentSchema, createDamDefaultsSchema, createDataPackCategorySchema, createDataPackSchema, createFooterSchema, createHeaderSchema, createLanguagesSchema, createMenuSchema, createModuleCategoriesSchema, createModuleSchema, createPageContentTypeSchema, createSimpleContentTypeSchema, createTemplateSchema, createThemesSchema, createTranslationsSchema, Core, Fields, Schema, Theme, CloudinaryImageProps, ComponentProps, GriddoImageProps, GriddoLinkProps, HLocation, LinkGetProps, ModulePreviewProps, PageProps, PreviewProps, WindowLocation, };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import t from"react";function n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function r(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}var o={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"faces:center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function i(e){return null==e?void 0:e.toString().split(/cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%/)[0]}function a(e){return Object.fromEntries(Object.entries(e).filter((e=>e[1])))}function l(e){var t;const{damId:r,imageConfig:o}=e,l=n(e,["damId","imageConfig"]),s=(c=o,u=l,Object.assign(Object.assign({},a(c)),a(u)));var c,u;const d=s.crop?`c/${s.crop}`:"",p=s.quality?`q/${s.quality}`:"",g=s.format?`f/${s.format}`:"",f=`${d}/${p}/${s.width?`w/${i(s.width)}`:""}/${s.height?`h/${i(s.height)}`:""}/${s.position?`p/${s.position}`:""}/${(null===(t=s.transforms)||void 0===t?void 0:t.length)?`t/${s.transforms}`:""}/${g}`;return function(e){const[t,n]=e.split(/(^https?:\/\/|^\/\/)/).filter(Boolean);return`${t}${null==n?void 0:n.replace(/\/\/+/g,"/").replace(/\/$/,"")}`}(`${o.domain}/${f}/${r}`)}function s(e){return e&&"string"==typeof e?e.split(/(^[http:|https:|\/\/]*[\S][^\/]*)/)[1]:e}function c(e){if(e&&"string"==typeof e){return e.split("/").filter(Boolean).slice(-1)[0]}return e}function u(e){return e.global}function d(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return 1===n.length?n[0]:n}const p=e=>{const t={},n=e=>{e.forEach((e=>{e.values.forEach((({cssVar:e,value:n})=>{t[e]=n}))}))};return Array.isArray(e)?n(e):Object.values(e).forEach((e=>{n(e)})),t},g=(e,t)=>e.map((e=>Object.assign(Object.assign({},e),{values:e.values.map((e=>([...e.value.matchAll(/var\((.*?)\)/g)].forEach((n=>{n.length>=2&&(e.value=e.value.replace(n[0],t[n[1]]))})),Object.assign({},e)))).filter((({value:e})=>CSS.supports("color",e)))}))).filter((e=>e.values.length)),f=e=>{const t=(e=>{let t=Object.assign({},p(e.primitives));return"subthemes"in e&&e.subthemes&&e.subthemes.forEach((e=>{t=Object.assign(Object.assign({},t),p(e.primitives))})),t})(e);if(Array.isArray(e.primitives))return g(e.primitives,t);const{common:n,light:r,dark:o}=e.primitives;return{common:n&&g(n,t),light:g(r,t),dark:g(o,t)}},m=(e,t)=>e.filter((e=>Array.isArray(t)?t.includes(e.id):e.id===t)),v=(e,t)=>{if(Array.isArray(e.primitives))return m(e.primitives,t);const{common:n,light:r,dark:o}=e.primitives;return{common:n&&m(n,t),light:m(r,t),dark:m(o,t)}},h=e=>{if(Array.isArray(e.primitives))return e.primitives.length;const{common:t,light:n,dark:r}=e.primitives;return(null==t?void 0:t.length)||n.length||r.length},b=(e,t,n)=>{const r=void 0===n;return e.map((e=>Object.assign(Object.assign({},e),{primitives:r?f(e):v(e,n),subthemes:"subthemes"in e&&e.subthemes&&e.subthemes.map((e=>Object.assign(Object.assign({},e),{primitives:r?f(e):v(e,n)}))).filter((e=>h(e)&&(!t||e.id===t)))||[]}))).filter((e=>h(e)||e.subthemes.length))};function y(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);const r=((e,t)=>b(e,t))(n,null==t?void 0:t.subtheme);return r}function j(e,t){const n=[],{global:r,primitive:o,subtheme:i}=t;if(r&&n.push(e.global),t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return((e,t,n)=>b(e,n,t))(n,o,i)}function O(e,t){return j(e,Object.assign(Object.assign({},t),{primitive:["fontFamily","fontSize"]}))}const $="undefined"!=typeof window;function S(e,t){return(null==t?void 0:t.startsWith(`${e}#`))?`#${t.split("#")[1]}`:t}function x(){const e=localStorage.getItem("persist:app");if(!e||!$)return null;const t=JSON.parse(e);let{token:n}=t;n=JSON.parse(n);return{Authorization:`bearer ${n}`}}function w(){var e;const t=localStorage.getItem("persist:root");if(!$||!t)return 1;const n=JSON.parse(t);let{sites:r}=n;r=JSON.parse(r);return null===(e=r.currentSiteInfo)||void 0===e?void 0:e.id}function E(){const e=localStorage.getItem("langID");return!(!$||!e)&&parseInt(e)}function k({obj:e,searchKey:t,resultsBuffer:n=[],unique:r=!0}={}){if(!e)return[];const o=n;return Object.keys(e).forEach((n=>{const r=e[n];n===t&&"object"!=typeof r?o.push(r):"object"==typeof r&&r&&k({obj:r,searchKey:t,resultsBuffer:o})})),r?[...new Set(o)]:o}function I({baseUrl:e,params:t}){const n=Object.keys(t).map((e=>function(e){return Array.isArray(e)&&e.length>0||"number"==typeof e||"string"==typeof e}(t[e])?`${e}/${t[e]}`:"")).join("/");return`${e}${r=n,r.split("/").filter(Boolean).join("/")}`;var r}const C=e.createContext({translations:{}});function _(t){const{children:n,translations:r}=t;return e.createElement(C.Provider,{value:{translations:r}},n)}const z={linkComponent:function(t){const{children:r}=t,o=n(t,["children"]);return e.createElement("a",Object.assign({"data-griddo":"link"},o),r)},navigate:()=>null},P=e.createContext(z);function L(t){const{children:r}=t,o=n(t,["children"]),i=Object.assign(Object.assign({},z),o);return e.createElement(P.Provider,{value:i},r)}const U=e.createContext({});function N(t){const{children:r}=t,o=n(t,["children"]),i=e.useContext(P),a=null==i?void 0:i.translations;return e.createElement(U.Provider,{value:Object.assign({},o)},e.createElement(_,{translations:a},r))}function q(){var t;const n=e.useContext(U);if(!n)return console.warn("Griddo: You forgot to put <PageProvider>."),{};const r=null===(t=n.pageLanguages)||void 0===t?void 0:t.filter((e=>e.isLive));return Object.assign(Object.assign({},n),{pageLanguages:r})}function R(t){const[n,r]=e.useState(null),{order:o,quantity:i,source:a,mode:l,fixed:s,filter:c,fullRelations:u=!1}=t||{},{apiUrl:d}=q();return e.useEffect((()=>{const e=!!E(),t=w()||"global",n=`${d}/site/${t}/distributor`,p=function(e){const t=E();return{method:"POST",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:null==t?void 0:t.toString()},x()),redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(e)}}("auto"===l?{mode:l,order:o,quantity:i,source:a,filter:c,fullRelations:u}:{mode:l,fixed:s,fullRelations:u});e&&fetch(n,p).then((e=>e.json())).then((e=>r(e))).catch((e=>{console.error("Error:",e)}))}),[l,o,i,s,c,a,u]),n}function A({data:e,queriedData:t}){return e&&R(e)||t}const T=e.createContext(null);function M(t){return e.createElement(T.Provider,{value:{isNavigation:!0}},t.children)}const D=t.createContext([{},()=>null]),H=e=>{const{children:n}=e,r=F();return t.createElement(D.Provider,{value:r},n)},F=()=>{const[e,n]=t.useState({});return[e,e=>n((t=>Object.assign(Object.assign({},t),e)))]};function B(){const t=e.useContext(P),n=null==t?void 0:t.publicApiUrl,r=null==t?void 0:t.siteId,o=null==t?void 0:t.renderer,{languageId:i}=q(),[a,l]=e.useState(),[s,c]=e.useState(),[u,d]=e.useState(!0),[p,g]=e.useState(!1),[f,m]=e.useState({}),v="editor"===o;return e.useEffect((()=>{if(!s)return;s&&(()=>{d(!0);const{queryUrl:e}=s;fetch(e).then((e=>e.json())).then((e=>{d(!1),g(!1),200!==(null==e?void 0:e.code)&&void 0!==(null==e?void 0:e.code)?(g(!0),m(e)):(g(!1),l(Object.assign({},e)))})).catch((e=>{d(!1),g(!0),console.log(e)}))})()}),[s]),[{query:a,isLoading:u,isError:p,msg:f},function({apiUrl:e=`${n}`,cached:t,data:o,lang:a=i,site:l=r}){if(!o)return;const s=v?(new Date).valueOf():t,u=I({baseUrl:`${e}/filters/${`${o.source||o.fixed}/`}`,params:{cached:s,lang:a,site:l}});return c({queryUrl:u})}]}const G={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"},V={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]};function J(t){var{url:r}=t,o=n(t,["url"]);if(!r)return{};const a=e.useContext(P),u=(null==a?void 0:a.griddoDamDefaults)||{},d=s(r),p=c(r),g=Object.assign(Object.assign(Object.assign(Object.assign({},V),u),o),{format:"jpeg",domain:d});void 0===g.responsive&&(g.responsive=[{width:g.width,height:g.height,quality:g.quality,crop:g.crop,position:g.position,transforms:g.transforms}]);const f=g.responsive.map((({width:e,height:t,quality:n,crop:r,position:o,transforms:a})=>`${l({damId:p,imageConfig:g,quality:n,crop:r,width:e,height:t,position:o,transforms:a})} ${i(e)}w`)),m=function(e){const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(g.responsive.reverse()).map(((e,t)=>g.responsive&&t<g.responsive.length-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`)).join(", "),v=f.map((e=>null==e?void 0:e.split(" ")[0])),h=g.responsive[0],b=`${l(Object.assign({damId:p,imageConfig:g},h))}`;return{type:(null==g?void 0:g.format)?G[null==g?void 0:g.format]:G.jpeg,srcSet:f,srcSetURL:v,src:b,sizes:m,webpFallback:W({srcSet:f,srcSetURL:v,format:"jpeg"}),jpeg:W({srcSet:f,srcSetURL:v,format:"jpeg"}),webp:W({srcSet:f,srcSetURL:v,format:"webp"}),avif:W({srcSet:f,srcSetURL:v,format:"avif"}),png:W({srcSet:f,srcSetURL:v,format:"png"}),gif:W({srcSet:f,srcSetURL:v,format:"gif"}),svg:W({srcSet:f,srcSetURL:v,format:"svg"})}}function W({srcSet:e,srcSetURL:t,format:n}){return{type:G[n],srcSet:null==e?void 0:e.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`))),srcSetURL:null==t?void 0:t.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`)))}}const K=()=>e.useContext(P);function Y(t){const n=null==t?void 0:t.locale,r=e.useContext(C),{siteLangs:o}=K(),{languageId:i}=q(),a=null==r?void 0:r.translations;a||console.warn("Griddo: <SiteProvider> needs to have the prop translations"),void 0===o&&console.warn("Griddo: <SiteProvider> needs to have the prop siteLangs set with the site languages"),i||console.warn("Griddo: <PageProvider> needs to have the prop languageId set with the page language id"),function(e,t){return!!(null==e?void 0:e.find((e=>e.id===t)))}(o,i)||console.warn(`Griddo: languageId ${i} doesn't exist in this site`),void 0===n||function(e,t){return!!(null==e?void 0:e.find((e=>(null==e?void 0:e.locale)===t)))}(o,n)||console.warn(`Griddo: locale ${n} doesn't exist in this site`);const l=n||function(e,t){var n;return null===(n=null==e?void 0:e.find((e=>e.id===t)))||void 0===n?void 0:n.locale}(o,i),s=a&&l?a[l]:void 0;return l&&i||console.warn("Griddo: You forgot to put <I18nProvider> or exists an error in language id."),{getTranslation:function(e,t=""){return s&&s[e]?s[e]:t},getNestedTranslation:function(e,t=""){return s&&function(e,t){return null==e?void 0:e.split(".").reduce(((e,t)=>e[t]?e[t]:""),t)}(e,s)||t}}}const Z={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function Q(e){var t,r,{publicId:o}=e,a=n(e,["publicId"]);const{cloudinaryCloudName:l,cloudinaryDefaults:s}=K(),c=Object.assign(Object.assign(Object.assign({},Z),s),a),u=`${c.domain}/${l}/${c.uploadFolder}`,d=`${X({root:u,imageConfig:Object.assign(Object.assign({},c),{quality:20,width:"512"})})}/${c.fallback404ImageId}`,p=null===(t=null==c?void 0:c.responsive)||void 0===t?void 0:t.map((({width:e,height:t,quality:n,crop:r})=>`${X({root:u,imageConfig:Object.assign({quality:n,crop:r,width:e,height:t},c)})}/${o} ${i(e)}w`)),g=function(e){if(!e)return[];const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(null===(r=null==c?void 0:c.responsive)||void 0===r?void 0:r.reverse()).map(((e,t)=>{var n;return c.responsive&&t<(null===(n=null==c?void 0:c.responsive)||void 0===n?void 0:n.length)-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`})).join(", "),f=null==p?void 0:p.map((e=>e.split(" ")[0])),m=(null==c?void 0:c.responsive)&&(null==c?void 0:c.responsive[0])||[];return{src:`${X(Object.assign({root:u,imageConfig:c},m))}/${o}`,srcSet:p,sizes:g,fallbackSrcImage:d,srcSetURL:f}}function X(e){const{root:t,imageConfig:n}=e,r=(null==n?void 0:n.crop)?`c_${n.crop}`:"",o=(null==n?void 0:n.quality)?`q_${n.quality}`:"",a=(null==n?void 0:n.gravity)?`g_${n.gravity}`:"",l=(null==n?void 0:n.format)?`f_${n.format}`:"",s=(null==n?void 0:n.width)?`w_${i(n.width)}`:"",c=(null==n?void 0:n.height)?`h_${i(n.height)}`:"",u=(null==n?void 0:n.ar)?`ar_${n.ar}`:"";const d=`${t}/${`${r},${a},${l},${o},${s},${c},${u}`.split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",")}`;return console.log(d),d}function ee(){const t=e.useContext(P);return null==t?void 0:t.linkComponent}const te=["or","and"];function ne(){const{publicApiUrl:t,siteId:n,renderer:r}=K(),{languageId:o}=q(),[i,a]=e.useState(),[l,s]=e.useState(),[c,u]=e.useState(!0),[d,p]=e.useState(!1),[g,f]=e.useState({}),m="editor"===r;return e.useEffect((()=>{if(!l)return;l&&(e=>{u(!0);const{queryUrl:t,extra:n}=e;t&&n&&fetch(t).then((e=>e.json())).then((e=>{u(!1),p(!1),200!==(null==e?void 0:e.code)&&void 0!==(null==e?void 0:e.code)?(p(!0),f(e)):(p(!1),a(Object.assign(Object.assign({},e),{totalItems:n.totalItems?n.totalItems:e.totalItems})))})).catch((e=>{u(!1),p(!0),console.log(e)}))})(l)}),[l]),[{query:i,isLoading:c,isError:d,msg:g},function({apiUrl:e=`${t}`,cached:r,data:i,exclude:a,fields:l,filterIds:c,filterOperator:u,globalOperator:d,items:p=10,lang:g=o,operator:f,page:v=1,relations:h,search:b,site:y=n}){var j,O;if(!i)return;const $=m?(new Date).valueOf().toString():r,S=null==b?void 0:b.replace(/\s/g,"+"),x="auto"===i.mode,w="manual"===i.mode,E=i.source||i.fixed||[],k=function({array:e,page:t,itemsPerPage:n}){return Array.isArray(e)?[...e].splice((t-1)*n,n):[]}({array:E,page:v,itemsPerPage:p}),C=x?"/list/":"/list/fixed/",_=x?`${E}/`:`${k}/`,z=null===(j=i.filter)||void 0===j?void 0:j.map((e=>"object"==typeof e?e.id:e)),P=k.length<1,L=I({baseUrl:`${e}${C}${_}`,params:{site:y,lang:g,get:l,page:x?v:null,items:x?p:null,order:x?i.order:null,filter:[...z||[],...c||[]],maxItems:i.quantity,search:S,operator:re(f)?f:null,filterOperator:re(u)?u:null,globalOperator:re(d)?d:null,exclude:Array.isArray(a)?a:null,relations:h?"on":null,cached:$}});return s(w&&P?{queryUrl:void 0,extra:void 0}:{queryUrl:L,extra:{totalItems:"manual"===i.mode&&(null===(O=i.fixed)||void 0===O?void 0:O.length)}})}]}function re(e){return!!e&&te.includes(e.toLowerCase())}function oe(){return e.useContext(T)}const ie=()=>t.useContext(D);function ae(){const[t,n]=e.useState(),[o,i]=e.useState(!0),{apiUrl:a,header:l,footer:s,fullPath:c}=q(),{siteMetadata:u}=K();e.useEffect((()=>{d()}),[]);const d=()=>r(this,void 0,void 0,(function*(){var e,t,r;const o={};if(o.topMenu=[{label:null==u?void 0:u.title,children:null===(e=l.topMenu)||void 0===e?void 0:e.elements,url:{linkToURL:!!c&&`${c.domainUrl}${c.site}`}}],!u){const e=w(),t=`${a}/site/${e}`,n=yield fetch(t,function(){const e=E();return{method:"GET",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:e},x())}}()),{name:r}=yield n.json();o.topMenu[0].label=r,o.siteName=r}o.mainMenu=null===(t=null==l?void 0:l.mainMenu)||void 0===t?void 0:t.elements;const d=null===(r=null==s?void 0:s.legalMenu)||void 0===r?void 0:r.elements;o.footerMenu=[{label:null,children:d}],o.header=l,o.footer=s,n(o),i(!1)}));return[t,o]}function le(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function se(t){var{backgroundRepeat:r="no-repeat",backgroundSize:i="cover",backgroundPosition:a="50% 50%",children:l,overlayColor:s=null,overlayOpacity:c=0,overlayTransition:u="2s",ratio:d,publicId:p,src:g,customLazyClassName:f="lazy",lazy:m}=t,v=n(t,["backgroundRepeat","backgroundSize","backgroundPosition","children","overlayColor","overlayOpacity","overlayTransition","ratio","publicId","src","customLazyClassName","lazy"]);const{cloudinaryDefaults:h}=K(),b=Object.assign(Object.assign(Object.assign(Object.assign({},h),o),v),{backgroundLazy:h.backgroundLazy||o.backgroundLazy||m}),{srcSetURL:y}=Q({responsive:[...b.responsive],quality:b.quality,crop:b.crop,gravity:b.gravity,format:b.format,publicId:p,ar:d}),j=g?[g]:y,O=g?[]:b.responsive.map((e=>e.breakpoint)),$=`Griddo-BgImage--${Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,8)}`,S=b.backgroundLazy?f:"",x=function(e,t=0){return Array(e).fill(0).map(((e,n)=>n+t))}(j.length-1,1).map((e=>`@media (min-width: ${O[e]}) {\n .${$} {\n background-image: url(${j[e]});\n }\n }\n `)).join("");return e.createElement(e.Fragment,null,e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n\n .${$} {\n background-repeat: ${r};\n background-position: ${a};\n background-size: ${i};\n background-image: url(${j[0]});\n }\n\n ${x}\n\n .${$}::before {\n transition: all ${u} ease;\n background-color: rgba(0, 0, 0, ${c});\n ${s?`\n background-color: ${s};\n opacity: ${c};\n `:""}\n }`}}),e.createElement("div",{className:`Griddo-BgImage ${$} ${S}`},l))}function ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ue(e,t){return e(t={exports:{}},t.exports),t.exports}le('.Griddo-BgImage {\n\tdisplay: flex;\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.Griddo-BgImage::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n}\n\n.Griddo-BgImage.lazy {\n\tbackground-image: none;\n}\n');var de=Symbol.for("react.element"),pe=Symbol.for("react.fragment"),ge=Object.prototype.hasOwnProperty,fe=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,me={key:!0,ref:!0,__self:!0,__source:!0};function ve(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)ge.call(t,r)&&!me.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:de,type:e,key:i,ref:a,props:o,_owner:fe.current}}var he={Fragment:pe,jsx:ve,jsxs:ve},be=ue((function(e){e.exports=he})),ye=ue((function(e,n){n.__esModule=!0,n.default=void 0;var r=["className","children","ratio","style"];function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i="--aspect-ratio";class a extends t.Component{constructor(){super(...arguments),this.node=null,this.setNode=e=>{this.node=e}}componentDidUpdate(){if(this.node){var{node:e}=this;e.style.getPropertyValue(i)||e.style.setProperty(i,"("+this.props.ratio+")")}}render(){var e=this.props,{className:t,children:n,ratio:a,style:l}=e,s=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,r),c=o({},l,{[i]:"("+a+")"});return(0,be.jsx)("div",o({className:t,ref:this.setNode,style:c},s,{children:n}))}}a.defaultProps={className:"react-aspect-ratio-placeholder",ratio:1};var l=a;n.default=l}));ce(ye);var je=ue((function(e,t){t.__esModule=!0,t.default=void 0;var n=["className","children","ratio","style"];function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}var o="react-aspect-ratio-placeholder";var i=function(e){var{className:t=o,children:i,ratio:a=1,style:l}=e,s=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,n),c=r({},l,{"--aspect-ratio":"("+a+")"});return(0,be.jsx)("div",r({className:t,style:c},s,{children:i}))};t.default=i}));ce(je);var Oe=ue((function(e,t){t.__esModule=!0,t.default=t.AspectRatio=void 0;var n=o(ye),r=o(je);function o(e){return e&&e.__esModule?e:{default:e}}var i=n.default;t.default=i;var a=r.default;t.AspectRatio=a}));ce(Oe);var $e=Oe.AspectRatio;function Se(t){const{alt:n,width:r,height:i,ratio:a,fixed:l,publicId:s,src:c,objectFit:u="cover"}=t,{cloudinaryDefaults:d}=K(),p=Object.assign(Object.assign(Object.assign({},o),d),t),{srcSet:g,sizes:f,src:m}=Q({crop:p.crop,format:p.format,gravity:p.gravity,quality:p.quality,sizes:p.sizes,responsive:p.responsive,ar:a,publicId:s}),v={alt:n,width:r,height:i,loading:p.loading,style:{objectFit:u},decoding:p.decoding},h=Object.assign(Object.assign({},v),{src:c}),b=Object.assign(Object.assign({},v),{srcSet:g,sizes:f,src:m}),y=c?h:b,j=()=>e.createElement("img",Object.assign({},y));return l?e.createElement(j,null):e.createElement($e,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(j,null))}le('[style*="--aspect-ratio"] > img {\n height: auto;\n}\n\n[style*="--aspect-ratio"] {\n position: relative;\n}\n\n[style*="--aspect-ratio"] > :first-child {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n[style*="--aspect-ratio"]::before {\n content: "";\n display: block;\n width: 100%;\n}\n\n@supports not (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n height: 0;\n padding-bottom: calc(100% / (var(--aspect-ratio)));\n }\n}\n\n@supports (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n aspect-ratio: calc(var(--aspect-ratio));\n }\n}\n');const xe=(e,t)=>{const n=t.component;return void 0!==e[n]?e[n]:(console.warn(`The component <${n}> doesn't exist inside ${JSON.stringify(Object.keys(e))}`),null)},we=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{d:"M16 9v10H8V9h8zm-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})),Ee=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5263 2.3158H4.78947C3.80526 2.3158 3 3.12106 3 4.10527V16.6316H4.78947V4.10527H15.5263V2.3158ZM18.2105 5.89475H8.36842C7.38421 5.89475 6.57894 6.70001 6.57894 7.68422V20.2105C6.57894 21.1947 7.38421 22 8.36842 22H18.2105C19.1947 22 20 21.1947 20 20.2105V7.68422C20 6.70001 19.1947 5.89475 18.2105 5.89475ZM8.36843 20.2105H18.2105V7.68422H8.36843V20.2105Z"}));le('.--not-selected-nameplate {\n\tdisplay: none;\n}\n\n.--selected,\n.--selected-header-footer,\n.--selected-nameplate {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.--selected-header-footer::before,\n.--selected::before {\n\tposition: absolute;\n\theight: calc(100% - 8px);\n\twidth: calc(100% - 8px);\n\tpadding-bottom: 4px;\n\tcontent: "";\n\tborder: 4px solid rgb(80, 87, 255);\n\tpointer-events: none;\n\tz-index: 99;\n}\n\n.--selected-header-footer::after {\n\tposition: absolute;\n\tpadding: 8px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tcontent: attr(data-text);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n}\n\n.--selected-nameplate {\n\tdisplay: flex;\n\talign-items: center;\n\tposition: absolute;\n\tpadding: 4px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n\ttext-align: center;\n}\n\n.span-svg-action {\n\tpadding-left: 4px;\n}\n\n.span-svg-action:first-child {\n\tpadding-left: 16px;\n}\n\n.svg-action {\n\tfill: #dadada;\n}\n\n.svg-action:hover {\n\tfill: #fff;\n\tcursor: pointer;\n}\n');const ke=t=>{const n=e.useRef(null),[r,o]=e.useState(0),{selectEditorID:i,moduleActions:a}=e.useContext(P),{selectedEditorID:l,editorID:s,component:c,children:u,isSelectionAllowed:d}=t,p=["Header","Footer"].includes(c);e.useEffect((()=>{n&&n.current&&o(n.current.scrollHeight)}),[u]),e.useEffect((()=>{m&&f()}),[n]);const g=e=>{(s||0===s)&&"undefined"!=typeof window&&d&&i&&i(t,void 0,e)},f=()=>{if(!n.current)return;const e=n.current.style.position,t=n.current.style.top;n.current.style.position="relative",n.current.style.top="-34px",n.current.scrollIntoView({behavior:"smooth",block:"start"}),n.current.style.top=t,n.current.style.position=e;0===n.current.offsetTop&&(n.current.style.marginTop="36px")},m=!!l&&l===s;m&&f();return e.createElement(e.Fragment,null,"Header"===c&&e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n [data-text="Header"].--selected::before {\n height: ${r-8}px;\n }`}}),p&&e.createElement("span",{className:""+(m?"--selected-header-footer":""),"data-text":c,ref:n,onClick:g},u),!p&&e.createElement("span",{className:""+(m?"--selected":""),"data-text":c,ref:n,onClick:g},e.createElement("span",{className:""+(m?"--selected-nameplate":"--not-selected-nameplate")},c,e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.duplicateModuleAction(s)}},e.createElement(Ee,{className:"svg-action"})),e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.deleteModuleAction(s)}},e.createElement(we,{className:"svg-action"}))),u))};function Ie(t){var r,{libComponents:o}=t,i=n(t,["libComponents"]);const{component:a,editorID:l,type:s,parentEditorID:c}=i,{renderer:u}=K(),d=null===(r=oe())||void 0===r?void 0:r.isNavigation,p="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||"0"):null,g=xe(o,Object.assign({},i)),f=d&&!["Header","Footer"].includes(a);return"editor"===u?e.createElement(H,null,e.createElement(ke,{selectedEditorID:p,isSelectionAllowed:!f,editorID:l,component:a,type:s,parentEditorID:c},g?e.createElement(g,Object.assign({},i)):e.createElement(e.Fragment,null))):"preview"===u?e.createElement(H,null,g&&e.createElement(g,Object.assign({},i))):g&&e.createElement(g,Object.assign({},i))}le('.griddo-background-image {\n\tdisplay: flex;\n\twidth: 100%;\n\theight: 100%;\n\n\tposition: relative;\n\n\tbackground-repeat: no-repeat;\n\tbackground-size: cover;\n\tbackground-position: 50% 50%;\n}\n\n.griddo-background-image--lazy .griddo-background-image {\n\tbackground: none !important;\n}\n\n.griddo-background-image::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n\ttransition: all var(--veil-transition-time) var(--veil-transition-easing);\n\tbackground-color: var(--veil-opacity);\n}\n');const Ce=e.forwardRef(((t,n)=>{const{children:r,format:o,backgroundSize:i,veilOpacity:a=.5,veilColor:u="#000033",veilTransitionTime:d="2s",veilTransitionEasing:p="easing",url:g,src:f,responsive:m,className:v,style:h,quality:b,lazyOffset:y="200px",loading:j}=t,{griddoDamDefaults:O}=K(),$=e.useRef(null),S=s(g);e.useEffect((()=>{var e;if(IntersectionObserver){if($.current){let e=new IntersectionObserver((t=>t.forEach((t=>{var n;t.isIntersecting&&(null===(n=$.current)||void 0===n||n.classList.remove("griddo-background-image--lazy"),e=e.disconnect())}))),{rootMargin:`0px 0px ${y} 0px`});return e.observe($.current),()=>e=e&&e.disconnect()}}else null===(e=$.current)||void 0===e||e.classList.remove("griddo-background-image--lazy")}),[]);const x=m&&Object.fromEntries(Object.keys(m).map((e=>[e,{url:`url("${l({damId:c(g),imageConfig:Object.assign(Object.assign(Object.assign({},O),{quality:b,format:o,domain:S}),m[e])})}")`,customProperty:m[e].customProperty}]))),w=m&&Object.fromEntries(Object.keys(m).map(((e,t)=>[x[e].customProperty?`${x[e].customProperty}`:`--image-${t}`,x[e].url]))),E=f?{"--image-default":`url(${f})`}:w;return e.createElement("div",{ref:$,"data-griddo":"loading-ref",className:""+("lazy"===j?"griddo-background-image--lazy":"")},e.createElement("div",{"data-griddo":"image-ref",ref:n,className:`${v} griddo-background-image`,style:Object.assign(Object.assign(Object.assign({},h),{"--veil-opacity":`${u}${Math.round(255/(1/a)).toString(16)}`,"--veil-transition-time":d,"--veil-transition-easing":p,"--background-size":i}),E)},r))}));le('[style*="--aspect-ratio"] [data-image="griddo"] {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 100%;\n\twidth: 100%;\n\tobject-fit: cover;\n}\n');const _e=e.forwardRef(((t,r)=>{var{width:o,height:i,ratio:a,fixed:l,url:s,loading:c,decoding:u,responsive:d,quality:p,crop:g,format:f,formats:m,position:v,transforms:h}=t,b=n(t,["width","height","ratio","fixed","url","loading","decoding","responsive","quality","crop","format","formats","position","transforms"]);if(!s)return null;const{griddoDamDefaults:y}=K()||{},j={loading:c||(null==y?void 0:y.loading),decoding:u||(null==y?void 0:y.decoding),quality:p||(null==y?void 0:y.quality),crop:g||(null==y?void 0:y.crop),format:f,formats:m||(null==y?void 0:y.formats),position:v,transforms:h},{src:O,sizes:$,avif:S,jpeg:x,gif:w,webp:E,svg:k}=J({url:s,crop:j.crop,format:j.format,quality:j.quality,responsive:d,position:j.position,transforms:j.transforms,width:o,height:i}),I=()=>{var t;return e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:u||j.decoding,srcSet:d&&(null===(t=null==w?void 0:w.srcSet)||void 0===t?void 0:t.join(",")),sizes:d&&$,src:(null==w?void 0:w.srcSetURL)&&w.srcSetURL[0],width:o,height:i,fetchpriority:b.fetchpriority},b))},C=()=>e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:u||j.decoding,src:(null==k?void 0:k.srcSetURL)&&k.srcSetURL[0],width:o,height:i,fetchpriority:b.fetchpriority},b)),_=()=>{var t,n,a,l,s;return e.createElement("picture",{ref:r},(null===(t=j.formats)||void 0===t?void 0:t.includes("avif"))&&e.createElement("source",{srcSet:null===(n=null==S?void 0:S.srcSet)||void 0===n?void 0:n.join(","),sizes:$,type:"image/avif"}),(null===(a=j.formats)||void 0===a?void 0:a.includes("webp"))&&e.createElement("source",{srcSet:null===(l=null==E?void 0:E.srcSet)||void 0===l?void 0:l.join(","),sizes:$,type:"image/webp"}),e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:u||j.decoding,sizes:$,srcSet:null===(s=null==x?void 0:x.srcSet)||void 0===s?void 0:s.join(","),src:O,width:o,height:i,fetchpriority:b.fetchpriority},b)))};return s?"svg"===f?e.createElement(C,null):"gif"===f?e.createElement(I,null):l||!d?e.createElement(_,null):e.createElement($e,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(_,null)):null})),ze="pre",Pe="pro";function Le(t){var{activeClassName:r="",activeStyle:o={},style:i={},children:a,getProps:l,partiallyActive:s,state:c,url:u,title:d,className:p=""}=t,g=n(t,["activeClassName","activeStyle","style","children","getProps","partiallyActive","state","url","title","className"]);const{renderer:f,linkComponent:m}=K(),{fullPath:v}=q(),h="editor"===f,b=null==u?void 0:u.href,y=null==u?void 0:u.linkToURL,j=(null==u?void 0:u.newTab)||!1,O=(null==u?void 0:u.noFollow)||!1,$=!(null==u?void 0:u.linkToURL)&&!(null==u?void 0:u.href),S=y===`${null==v?void 0:v.domainUrl}${null==v?void 0:v.compose}`,x=function(e){var t;return(null===(t=null==e?void 0:e.domainUrl)||void 0===t?void 0:t.endsWith(`/${e.domain}`))?Pe:ze}(v),w=function(e,t){return`${t?"nofollow":""} ${e?"noreferrer":""}`.trim()}(j,O),E=function(e){return e?"_blank":"_self"}(j),k=v&&function({env:e,fullPath:t,to:n}){var r,o,i;if("string"!=typeof n)return n;if(e===ze){const e=null===(r=null==t?void 0:t.domainUrl)||void 0===r?void 0:r.split((null==t?void 0:t.domain)||"").join("");return(null===(o=null==n?void 0:n.split(e||""))||void 0===o?void 0:o.join(""))||n}return e===Pe&&(null===(i=null==n?void 0:n.split((null==t?void 0:t.domainUrl)||""))||void 0===i?void 0:i.join(""))||n}({env:x,fullPath:v,to:y}),I=h||$?"":k;return b||j?e.createElement("a",Object.assign({"data-link":"anchor",target:E,rel:w,href:b||y,className:p,title:d},g),a):e.createElement(m,Object.assign({rel:w,target:E,to:I,getProps:l,partiallyActive:s,state:c,activeStyle:o,activeClassName:r,title:h?k:d,style:S?o:i,className:S?`${p} ${r||""}`.trim():p},g),a)}function Ue(t){const{data:n}=t;return e.createElement("script",{dangerouslySetInnerHTML:{__html:`(function(){\n const ldJsonScript = document.createElement('script');\n ldJsonScript.setAttribute('type', 'application/ld+json');\n ldJsonScript.textContent = \`${JSON.stringify(n)}\`;\n document.head.appendChild(ldJsonScript);\n})();`}})}function Ne(t){const{url:r,linkProp:o="to",children:i}=t,a=n(t,["url","linkProp","children"]),{fullUrl:l}=q(),s=ee()||"a",{href:c,to:u}=function(e){const t=null==e?void 0:e.href,n=null==e?void 0:e.linkToURL,r=null==n?void 0:n.match(/^\/{2}|^https?:/g),o=null==n?void 0:n.match(/^\/\w/g);return{href:t||(r?n:null),to:o?n:null}}(r),d=null==r?void 0:r.newTab,p=null==r?void 0:r.noFollow,g=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),d&&{target:"_blank"}),{rel:`${p?"nofollow":""} ${d?"noreferrer":""}`.trim()}),l&&c&&{href:S(l,c)}),l&&u&&{[o]:S(l,u)});return u?e.createElement(e.Fragment,null,e.createElement("p",null,"Router"),e.createElement(s,Object.assign({},g),i)):e.createElement("a",g,i)}function qe(t){const{component:n,content:r,library:{components:o}}=t;return r?e.createElement(Ie,Object.assign({libComponents:o,component:n},r)):null}function Re(t){var n;const{apiUrl:r,content:o,footer:i,header:a,languageId:l,library:{templates:s,components:c},pageLanguages:u,siteMetadata:d}=t,p=s[o.template.templateType],g=o.template.heroSection?o.template.heroSection.modules&&o.template.heroSection.modules[0]:void 0,f=g?g.component:void 0,m=k({obj:o.template,searchKey:"component"}),v=Object.keys(null==o?void 0:o.template).filter((e=>(null==o?void 0:o.template[e])&&o.template[e].component)),h=Object.fromEntries(null==v?void 0:v.map((e=>{var t;return[e,null===(t=null==o?void 0:o.template[e].modules)||void 0===t?void 0:t.map((({component:e})=>e))]})));return e.createElement(N,{activeSectionBase:o.template.activeSectionBase,activeSectionSlug:o.template.activeSectionSlug||"/",apiUrl:r,breadcrumb:o.breadcrumb,componentList:m,dimensions:null===(n=o.dimensions)||void 0===n?void 0:n.values,firstModule:f,footer:i,fullPath:o.fullPath,fullUrl:o.fullUrl,header:a,isHome:o.isHome,languageId:l,modified:o.modified,origin:o.origin,pageLanguages:u,published:o.published,sectionModules:h,site:o.site,siteMetadata:d,siteSlug:o.siteSlug,structuredDataContent:o.structuredDataContent,title:o.title,template:o.template},e.createElement(e.Fragment,null,!!a&&e.createElement(M,null,e.createElement(Ie,Object.assign({libComponents:c},a))),e.createElement(p,Object.assign({},o.template)),!!i&&e.createElement(M,null,e.createElement(Ie,Object.assign({libComponents:c},i)))))}function Ae(t){const{isPage:r=!1}=t,o=n(t,["isPage"]),i=o,a=o;return r?e.createElement(Re,Object.assign({},i)):e.createElement(qe,Object.assign({},a))}const Te=e=>e,Me=e=>e,De=e=>e,He=e=>e,Fe=e=>e,Be=e=>e,Ge=e=>e,Ve=e=>e,Je=e=>e,We=e=>e,Ke=e=>e,Ye=e=>e,Ze=e=>e,Qe=e=>e,Xe=e=>e,et=e=>e;var tt=Object.freeze({__proto__:null}),nt=Object.freeze({__proto__:null}),rt=Object.freeze({__proto__:null}),ot=Object.freeze({__proto__:null});export{se as CloudinaryBackgroundImage,Se as CloudinaryImage,Ie as Component,tt as Core,nt as Fields,Ce as GriddoBackgroundImage,_e as GriddoImage,Le as GriddoLink,Ue as LdJson,Ne as Link,Re as Page,U as PageContext,N as PageProvider,Ae as Preview,rt as Schema,D as SessionContext,H as SessionProvider,P as SiteContext,L as SiteProvider,ot as Theme,He as createCategoryContentTypeSchema,Te as createComponentSchema,Fe as createDamDefaultsSchema,Be as createDataPackCategorySchema,Ge as createDataPackSchema,Ve as createFooterSchema,Je as createHeaderSchema,We as createLanguagesSchema,Ke as createMenuSchema,Ye as createModuleCategoriesSchema,Ze as createModuleSchema,De as createPageContentTypeSchema,Me as createSimpleContentTypeSchema,Qe as createTemplateSchema,Xe as createThemesSchema,et as createTranslationsSchema,xe as getComponent,E as getLang,w as getSiteID,x as getToken,A as useContentType,B as useDataFilters,R as useDistributorData,u as useGlobalTheme,J as useGriddoImage,Y as useI18n,Q as useImage,ee as useLink,ne as useList,oe as useNavigation,q as usePage,R as useReferenceFieldData,ie as useSession,K as useSite,ae as useSitemap,d as useTheme,y as useThemeColors,O as useThemeFont,j as useThemePrimitives};
|
|
1
|
+
import*as e from"react";import t from"react";function n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function r(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}var o={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"faces:center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function i(e){return null==e?void 0:e.toString().split(/cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%/)[0]}function a(e){return Object.fromEntries(Object.entries(e).filter((e=>e[1])))}function l(e){var t;const{damId:r,imageConfig:o}=e,l=n(e,["damId","imageConfig"]),s=(c=o,u=l,Object.assign(Object.assign({},a(c)),a(u)));var c,u;const d=s.crop?`c/${s.crop}`:"",p=s.quality?`q/${s.quality}`:"",g=s.format?`f/${s.format}`:"",f=`${d}/${p}/${s.width?`w/${i(s.width)}`:""}/${s.height?`h/${i(s.height)}`:""}/${s.position?`p/${s.position}`:""}/${(null===(t=s.transforms)||void 0===t?void 0:t.length)?`t/${s.transforms}`:""}/${g}`;return function(e){const[t,n]=e.split(/(^https?:\/\/|^\/\/)/).filter(Boolean);return`${t}${null==n?void 0:n.replace(/\/\/+/g,"/").replace(/\/$/,"")}`}(`${o.domain}/${f}/${r}`)}function s(e){return e&&"string"==typeof e?e.split(/(^[http:|https:|\/\/]*[\S][^\/]*)/)[1]:e}function c(e){if(e&&"string"==typeof e){return e.split("/").filter(Boolean).slice(-1)[0]}return e}function u(e){return e.global}function d(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return 1===n.length?n[0]:n}const p=e=>{const t={},n=e=>{e.forEach((e=>{e.values.forEach((({cssVar:e,value:n})=>{t[e]=n}))}))};return Array.isArray(e)?n(e):Object.values(e).forEach((e=>{n(e)})),t},g=(e,t)=>e.map((e=>Object.assign(Object.assign({},e),{values:e.values.map((e=>([...e.value.matchAll(/var\((.*?)\)/g)].forEach((n=>{n.length>=2&&(e.value=e.value.replace(n[0],t[n[1]]))})),Object.assign({},e)))).filter((({value:e})=>CSS.supports("color",e)))}))).filter((e=>e.values.length)),f=e=>{const t=(e=>{let t=Object.assign({},p(e.primitives));return"subthemes"in e&&e.subthemes&&e.subthemes.forEach((e=>{t=Object.assign(Object.assign({},t),p(e.primitives))})),t})(e);if(Array.isArray(e.primitives))return g(e.primitives,t);const{common:n,light:r,dark:o}=e.primitives;return{common:n&&g(n,t),light:g(r,t),dark:g(o,t)}},m=(e,t)=>e.filter((e=>Array.isArray(t)?t.includes(e.id):e.id===t)),v=(e,t)=>{if(Array.isArray(e.primitives))return m(e.primitives,t);const{common:n,light:r,dark:o}=e.primitives;return{common:n&&m(n,t),light:m(r,t),dark:m(o,t)}},h=e=>{if(Array.isArray(e.primitives))return e.primitives.length;const{common:t,light:n,dark:r}=e.primitives;return(null==t?void 0:t.length)||n.length||r.length},b=(e,t,n)=>{const r=void 0===n;return e.map((e=>Object.assign(Object.assign({},e),{primitives:r?f(e):v(e,n),subthemes:"subthemes"in e&&e.subthemes&&e.subthemes.map((e=>Object.assign(Object.assign({},e),{primitives:r?f(e):v(e,n)}))).filter((e=>h(e)&&(!t||e.id===t)))||[]}))).filter((e=>h(e)||e.subthemes.length))};function y(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);const r=((e,t)=>b(e,t))(n,null==t?void 0:t.subtheme);return r}function j(e,t){const n=[],{global:r,primitive:o,subtheme:i}=t;if(r&&n.push(e.global),t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return((e,t,n)=>b(e,n,t))(n,o,i)}function O(e,t){return j(e,Object.assign(Object.assign({},t),{primitive:["fontFamily","fontSize"]}))}const $="undefined"!=typeof window;function S(e,t){return(null==t?void 0:t.startsWith(`${e}#`))?`#${t.split("#")[1]}`:t}function x(){const e=localStorage.getItem("persist:app");if(!e||!$)return null;const t=JSON.parse(e);let{token:n}=t;n=JSON.parse(n);return{Authorization:`bearer ${n}`}}function w(){var e;const t=localStorage.getItem("persist:root");if(!$||!t)return 1;const n=JSON.parse(t);let{sites:r}=n;r=JSON.parse(r);return null===(e=r.currentSiteInfo)||void 0===e?void 0:e.id}function E(){const e=localStorage.getItem("langID");return!(!$||!e)&&parseInt(e)}function k({obj:e,searchKey:t,resultsBuffer:n=[],unique:r=!0}={}){if(!e)return[];const o=n;return Object.keys(e).forEach((n=>{const r=e[n];n===t&&"object"!=typeof r?o.push(r):"object"==typeof r&&r&&k({obj:r,searchKey:t,resultsBuffer:o})})),r?[...new Set(o)]:o}function I({baseUrl:e,params:t}){const n=Object.keys(t).map((e=>function(e){return Array.isArray(e)&&e.length>0||"number"==typeof e||"string"==typeof e}(t[e])?`${e}/${t[e]}`:"")).join("/");return`${e}${r=n,r.split("/").filter(Boolean).join("/")}`;var r}const C=e.createContext({translations:{}});function _(t){const{children:n,translations:r}=t;return e.createElement(C.Provider,{value:{translations:r}},n)}const z={linkComponent:function(t){const{children:r}=t,o=n(t,["children"]);return e.createElement("a",Object.assign({"data-griddo":"link"},o),r)},navigate:()=>null},P=e.createContext(z);function L(t){const{children:r}=t,o=n(t,["children"]),i=Object.assign(Object.assign({},z),o);return e.createElement(P.Provider,{value:i},r)}const U=e.createContext({});function N(t){const{children:r}=t,o=n(t,["children"]),i=e.useContext(P),a=null==i?void 0:i.translations;return e.createElement(U.Provider,{value:Object.assign({},o)},e.createElement(_,{translations:a},r))}function q(){var t;const n=e.useContext(U);if(!n)return console.warn("Griddo: You forgot to put <PageProvider>."),{};const r=null===(t=n.pageLanguages)||void 0===t?void 0:t.filter((e=>e.isLive));return Object.assign(Object.assign({},n),{pageLanguages:r})}function R(t){const[n,r]=e.useState(null),{order:o,quantity:i,source:a,mode:l,fixed:s,filter:c,fullRelations:u=!1}=t||{},{apiUrl:d}=q();return e.useEffect((()=>{const e=!!E(),t=w()||"global",n=`${d}/site/${t}/distributor`,p=function(e){const t=E();return{method:"POST",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:null==t?void 0:t.toString()},x()),redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(e)}}("auto"===l?{mode:l,order:o,quantity:i,source:a,filter:c,fullRelations:u}:{mode:l,fixed:s,fullRelations:u});e&&fetch(n,p).then((e=>e.json())).then((e=>r(e))).catch((e=>{console.error("Error:",e)}))}),[l,o,i,s,c,a,u]),n}function A({data:e,queriedData:t}){return e&&R(e)||t}const T=e.createContext(null);function M(t){return e.createElement(T.Provider,{value:{isNavigation:!0}},t.children)}const D=t.createContext([{},()=>null]),H=e=>{const{children:n}=e,r=F();return t.createElement(D.Provider,{value:r},n)},F=()=>{const[e,n]=t.useState({});return[e,e=>n((t=>Object.assign(Object.assign({},t),e)))]};function B(){const t=e.useContext(P),n=null==t?void 0:t.publicApiUrl,r=null==t?void 0:t.siteId,o=null==t?void 0:t.renderer,{languageId:i}=q(),[a,l]=e.useState(),[s,c]=e.useState(),[u,d]=e.useState(!0),[p,g]=e.useState(!1),[f,m]=e.useState({}),v="editor"===o;return e.useEffect((()=>{if(!s)return;s&&(()=>{d(!0);const{queryUrl:e}=s;fetch(e).then((e=>e.json())).then((e=>{d(!1),g(!1),200!==(null==e?void 0:e.code)&&void 0!==(null==e?void 0:e.code)?(g(!0),m(e)):(g(!1),l(Object.assign({},e)))})).catch((e=>{d(!1),g(!0),console.log(e)}))})()}),[s]),[{query:a,isLoading:u,isError:p,msg:f},function({apiUrl:e=`${n}`,cached:t,data:o,lang:a=i,site:l=r}){if(!o)return;const s=v?(new Date).valueOf():t,u=I({baseUrl:`${e}/filters/${`${o.source||o.fixed}/`}`,params:{cached:s,lang:a,site:l}});return c({queryUrl:u})}]}const G={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"},V={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]};function J(t){var{url:r}=t,o=n(t,["url"]);if(!r)return{};const a=e.useContext(P),u=(null==a?void 0:a.griddoDamDefaults)||{},d=s(r),p=c(r),g=Object.assign(Object.assign(Object.assign(Object.assign({},V),u),o),{format:"jpeg",domain:d});void 0===g.responsive&&(g.responsive=[{width:g.width,height:g.height,quality:g.quality,crop:g.crop,position:g.position,transforms:g.transforms}]);const f=g.responsive.map((({width:e,height:t,quality:n,crop:r,position:o,transforms:a})=>`${l({damId:p,imageConfig:g,quality:n,crop:r,width:e,height:t,position:o,transforms:a})} ${i(e)}w`)),m=function(e){const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(g.responsive.reverse()).map(((e,t)=>g.responsive&&t<g.responsive.length-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`)).join(", "),v=f.map((e=>null==e?void 0:e.split(" ")[0])),h=g.responsive[0],b=`${l(Object.assign({damId:p,imageConfig:g},h))}`;return{type:(null==g?void 0:g.format)?G[null==g?void 0:g.format]:G.jpeg,srcSet:f,srcSetURL:v,src:b,sizes:m,webpFallback:W({srcSet:f,srcSetURL:v,format:"jpeg"}),jpeg:W({srcSet:f,srcSetURL:v,format:"jpeg"}),webp:W({srcSet:f,srcSetURL:v,format:"webp"}),avif:W({srcSet:f,srcSetURL:v,format:"avif"}),png:W({srcSet:f,srcSetURL:v,format:"png"}),gif:W({srcSet:f,srcSetURL:v,format:"gif"}),svg:W({srcSet:f,srcSetURL:v,format:"svg"})}}function W({srcSet:e,srcSetURL:t,format:n}){return{type:G[n],srcSet:null==e?void 0:e.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`))),srcSetURL:null==t?void 0:t.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`)))}}const K=()=>e.useContext(P);function Y(t){const n=null==t?void 0:t.locale,r=e.useContext(C),{siteLangs:o}=K(),{languageId:i}=q(),a=null==r?void 0:r.translations;a||console.warn("Griddo: <SiteProvider> needs to have the prop translations"),void 0===o&&console.warn("Griddo: <SiteProvider> needs to have the prop siteLangs set with the site languages"),i||console.warn("Griddo: <PageProvider> needs to have the prop languageId set with the page language id"),function(e,t){return!!(null==e?void 0:e.find((e=>e.id===t)))}(o,i)||console.warn(`Griddo: languageId ${i} doesn't exist in this site`),void 0===n||function(e,t){return!!(null==e?void 0:e.find((e=>(null==e?void 0:e.locale)===t)))}(o,n)||console.warn(`Griddo: locale ${n} doesn't exist in this site`);const l=n||function(e,t){var n;return null===(n=null==e?void 0:e.find((e=>e.id===t)))||void 0===n?void 0:n.locale}(o,i),s=a&&l?a[l]:void 0;return l&&i||console.warn("Griddo: You forgot to put <I18nProvider> or exists an error in language id."),{getTranslation:function(e,t=""){return s&&s[e]?s[e]:t},getNestedTranslation:function(e,t=""){return s&&function(e,t){return null==e?void 0:e.split(".").reduce(((e,t)=>e[t]?e[t]:""),t)}(e,s)||t}}}const Z={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function Q(e){var t,r,{publicId:o}=e,a=n(e,["publicId"]);const{cloudinaryCloudName:l,cloudinaryDefaults:s}=K(),c=Object.assign(Object.assign(Object.assign({},Z),s),a),u=`${c.domain}/${l}/${c.uploadFolder}`,d=`${X({root:u,imageConfig:Object.assign(Object.assign({},c),{quality:20,width:"512"})})}/${c.fallback404ImageId}`,p=null===(t=null==c?void 0:c.responsive)||void 0===t?void 0:t.map((({width:e,height:t,quality:n,crop:r})=>`${X({root:u,imageConfig:Object.assign({quality:n,crop:r,width:e,height:t},c)})}/${o} ${i(e)}w`)),g=function(e){if(!e)return[];const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(null===(r=null==c?void 0:c.responsive)||void 0===r?void 0:r.reverse()).map(((e,t)=>{var n;return c.responsive&&t<(null===(n=null==c?void 0:c.responsive)||void 0===n?void 0:n.length)-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`})).join(", "),f=null==p?void 0:p.map((e=>e.split(" ")[0])),m=(null==c?void 0:c.responsive)&&(null==c?void 0:c.responsive[0])||[];return{src:`${X(Object.assign({root:u,imageConfig:c},m))}/${o}`,srcSet:p,sizes:g,fallbackSrcImage:d,srcSetURL:f}}function X(e){const{root:t,imageConfig:n}=e,r=(null==n?void 0:n.crop)?`c_${n.crop}`:"",o=(null==n?void 0:n.quality)?`q_${n.quality}`:"",a=(null==n?void 0:n.gravity)?`g_${n.gravity}`:"",l=(null==n?void 0:n.format)?`f_${n.format}`:"",s=(null==n?void 0:n.width)?`w_${i(n.width)}`:"",c=(null==n?void 0:n.height)?`h_${i(n.height)}`:"",u=(null==n?void 0:n.ar)?`ar_${n.ar}`:"";const d=`${t}/${`${r},${a},${l},${o},${s},${c},${u}`.split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",")}`;return console.log(d),d}function ee(){const t=e.useContext(P);return null==t?void 0:t.linkComponent}const te=["or","and"];function ne(){const{publicApiUrl:t,siteId:n,renderer:r}=K(),{languageId:o}=q(),[i,a]=e.useState(),[l,s]=e.useState(),[c,u]=e.useState(!0),[d,p]=e.useState(!1),[g,f]=e.useState({}),m="editor"===r;return e.useEffect((()=>{if(!l)return;l&&(e=>{u(!0);const{queryUrl:t,extra:n}=e;t&&n&&fetch(t).then((e=>e.json())).then((e=>{u(!1),p(!1),200!==(null==e?void 0:e.code)&&void 0!==(null==e?void 0:e.code)?(p(!0),f(e)):(p(!1),a(Object.assign(Object.assign({},e),{totalItems:n.totalItems?n.totalItems:e.totalItems})))})).catch((e=>{u(!1),p(!0),console.log(e)}))})(l)}),[l]),[{query:i,isLoading:c,isError:d,msg:g},function({apiUrl:e=`${t}`,cached:r,data:i,exclude:a,fields:l,filterIds:c,filterOperator:u,globalOperator:d,items:p=10,lang:g=o,operator:f,page:v=1,relations:h,search:b,site:y=n}){var j,O;if(!i)return;const $=m?(new Date).valueOf().toString():r,S=null==b?void 0:b.replace(/\s/g,"+"),x="auto"===i.mode,w="manual"===i.mode,E=i.source||i.fixed||[],k=function({array:e,page:t,itemsPerPage:n}){return Array.isArray(e)?[...e].splice((t-1)*n,n):[]}({array:E,page:v,itemsPerPage:p}),C=x?"/list/":"/list/fixed/",_=x?`${E}/`:`${k}/`,z=null===(j=i.filter)||void 0===j?void 0:j.map((e=>"object"==typeof e?e.id:e)),P=k.length<1,L=I({baseUrl:`${e}${C}${_}`,params:{site:y,lang:g,get:l,page:x?v:null,items:x?p:null,order:x?i.order:null,filter:[...z||[],...c||[]],maxItems:i.quantity,search:S,operator:re(f)?f:null,filterOperator:re(u)?u:null,globalOperator:re(d)?d:null,exclude:Array.isArray(a)?a:null,relations:h?"on":null,cached:$}});return s(w&&P?{queryUrl:void 0,extra:void 0}:{queryUrl:L,extra:{totalItems:"manual"===i.mode&&(null===(O=i.fixed)||void 0===O?void 0:O.length)}})}]}function re(e){return!!e&&te.includes(e.toLowerCase())}function oe(){return e.useContext(T)}const ie=()=>t.useContext(D);function ae(){const[t,n]=e.useState(),[o,i]=e.useState(!0),{apiUrl:a,header:l,footer:s,fullPath:c}=q(),{siteMetadata:u}=K();e.useEffect((()=>{d()}),[]);const d=()=>r(this,void 0,void 0,(function*(){var e,t,r;const o={};if(o.topMenu=[{label:null==u?void 0:u.title,children:null===(e=l.topMenu)||void 0===e?void 0:e.elements,url:{linkToURL:!!c&&`${c.domainUrl}${c.site}`}}],!u){const e=w(),t=`${a}/site/${e}`,n=yield fetch(t,function(){const e=E();return{method:"GET",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:e},x())}}()),{name:r}=yield n.json();o.topMenu[0].label=r,o.siteName=r}o.mainMenu=null===(t=null==l?void 0:l.mainMenu)||void 0===t?void 0:t.elements;const d=null===(r=null==s?void 0:s.legalMenu)||void 0===r?void 0:r.elements;o.footerMenu=[{label:null,children:d}],o.header=l,o.footer=s,n(o),i(!1)}));return[t,o]}function le(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function se(t){var{backgroundRepeat:r="no-repeat",backgroundSize:i="cover",backgroundPosition:a="50% 50%",children:l,overlayColor:s=null,overlayOpacity:c=0,overlayTransition:u="2s",ratio:d,publicId:p,src:g,customLazyClassName:f="lazy",lazy:m}=t,v=n(t,["backgroundRepeat","backgroundSize","backgroundPosition","children","overlayColor","overlayOpacity","overlayTransition","ratio","publicId","src","customLazyClassName","lazy"]);const{cloudinaryDefaults:h}=K(),b=Object.assign(Object.assign(Object.assign(Object.assign({},h),o),v),{backgroundLazy:h.backgroundLazy||o.backgroundLazy||m}),{srcSetURL:y}=Q({responsive:[...b.responsive],quality:b.quality,crop:b.crop,gravity:b.gravity,format:b.format,publicId:p,ar:d}),j=g?[g]:y,O=g?[]:b.responsive.map((e=>e.breakpoint)),$=`Griddo-BgImage--${Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,8)}`,S=b.backgroundLazy?f:"",x=function(e,t=0){return Array(e).fill(0).map(((e,n)=>n+t))}(j.length-1,1).map((e=>`@media (min-width: ${O[e]}) {\n .${$} {\n background-image: url(${j[e]});\n }\n }\n `)).join("");return e.createElement(e.Fragment,null,e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n\n .${$} {\n background-repeat: ${r};\n background-position: ${a};\n background-size: ${i};\n background-image: url(${j[0]});\n }\n\n ${x}\n\n .${$}::before {\n transition: all ${u} ease;\n background-color: rgba(0, 0, 0, ${c});\n ${s?`\n background-color: ${s};\n opacity: ${c};\n `:""}\n }`}}),e.createElement("div",{className:`Griddo-BgImage ${$} ${S}`},l))}function ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ue(e,t){return e(t={exports:{}},t.exports),t.exports}le('.Griddo-BgImage {\n\tdisplay: flex;\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.Griddo-BgImage::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n}\n\n.Griddo-BgImage.lazy {\n\tbackground-image: none;\n}\n');var de=Symbol.for("react.element"),pe=Symbol.for("react.fragment"),ge=Object.prototype.hasOwnProperty,fe=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,me={key:!0,ref:!0,__self:!0,__source:!0};function ve(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)ge.call(t,r)&&!me.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:de,type:e,key:i,ref:a,props:o,_owner:fe.current}}var he={Fragment:pe,jsx:ve,jsxs:ve},be=ue((function(e){e.exports=he})),ye=ue((function(e,n){n.__esModule=!0,n.default=void 0;var r=["className","children","ratio","style"];function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i="--aspect-ratio";class a extends t.Component{constructor(){super(...arguments),this.node=null,this.setNode=e=>{this.node=e}}componentDidUpdate(){if(this.node){var{node:e}=this;e.style.getPropertyValue(i)||e.style.setProperty(i,"("+this.props.ratio+")")}}render(){var e=this.props,{className:t,children:n,ratio:a,style:l}=e,s=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,r),c=o({},l,{[i]:"("+a+")"});return(0,be.jsx)("div",o({className:t,ref:this.setNode,style:c},s,{children:n}))}}a.defaultProps={className:"react-aspect-ratio-placeholder",ratio:1};var l=a;n.default=l}));ce(ye);var je=ue((function(e,t){t.__esModule=!0,t.default=void 0;var n=["className","children","ratio","style"];function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}var o="react-aspect-ratio-placeholder";var i=function(e){var{className:t=o,children:i,ratio:a=1,style:l}=e,s=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,n),c=r({},l,{"--aspect-ratio":"("+a+")"});return(0,be.jsx)("div",r({className:t,style:c},s,{children:i}))};t.default=i}));ce(je);var Oe=ue((function(e,t){t.__esModule=!0,t.default=t.AspectRatio=void 0;var n=o(ye),r=o(je);function o(e){return e&&e.__esModule?e:{default:e}}var i=n.default;t.default=i;var a=r.default;t.AspectRatio=a}));ce(Oe);var $e=Oe.AspectRatio;function Se(t){const{alt:n,width:r,height:i,ratio:a,fixed:l,publicId:s,src:c,objectFit:u="cover"}=t,{cloudinaryDefaults:d}=K(),p=Object.assign(Object.assign(Object.assign({},o),d),t),{srcSet:g,sizes:f,src:m}=Q({crop:p.crop,format:p.format,gravity:p.gravity,quality:p.quality,sizes:p.sizes,responsive:p.responsive,ar:a,publicId:s}),v={alt:n,width:r,height:i,loading:p.loading,style:{objectFit:u},decoding:p.decoding},h=Object.assign(Object.assign({},v),{src:c}),b=Object.assign(Object.assign({},v),{srcSet:g,sizes:f,src:m}),y=c?h:b,j=()=>e.createElement("img",Object.assign({},y));return l?e.createElement(j,null):e.createElement($e,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(j,null))}le('[style*="--aspect-ratio"] > img {\n height: auto;\n}\n\n[style*="--aspect-ratio"] {\n position: relative;\n}\n\n[style*="--aspect-ratio"] > :first-child {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n[style*="--aspect-ratio"]::before {\n content: "";\n display: block;\n width: 100%;\n}\n\n@supports not (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n height: 0;\n padding-bottom: calc(100% / (var(--aspect-ratio)));\n }\n}\n\n@supports (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n aspect-ratio: calc(var(--aspect-ratio));\n }\n}\n');const xe=(e,t)=>{const n=t.component;return void 0!==e[n]?e[n]:(console.warn(`The component <${n}> doesn't exist inside ${JSON.stringify(Object.keys(e))}`),null)},we=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{d:"M16 9v10H8V9h8zm-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})),Ee=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5263 2.3158H4.78947C3.80526 2.3158 3 3.12106 3 4.10527V16.6316H4.78947V4.10527H15.5263V2.3158ZM18.2105 5.89475H8.36842C7.38421 5.89475 6.57894 6.70001 6.57894 7.68422V20.2105C6.57894 21.1947 7.38421 22 8.36842 22H18.2105C19.1947 22 20 21.1947 20 20.2105V7.68422C20 6.70001 19.1947 5.89475 18.2105 5.89475ZM8.36843 20.2105H18.2105V7.68422H8.36843V20.2105Z"}));le('.--not-selected-nameplate {\n\tdisplay: none;\n}\n\n.--selected,\n.--selected-header-footer,\n.--selected-nameplate {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.--selected-header-footer::before,\n.--selected::before {\n\tposition: absolute;\n\theight: calc(100% - 8px);\n\twidth: calc(100% - 8px);\n\tpadding-bottom: 4px;\n\tcontent: "";\n\tborder: 4px solid rgb(80, 87, 255);\n\tpointer-events: none;\n\tz-index: 99;\n}\n\n.--selected-header-footer::after {\n\tposition: absolute;\n\tpadding: 8px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tcontent: attr(data-text);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n}\n\n.--selected-nameplate {\n\tdisplay: flex;\n\talign-items: center;\n\tposition: absolute;\n\tpadding: 4px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n\ttext-align: center;\n}\n\n.span-svg-action {\n\tpadding-left: 4px;\n}\n\n.span-svg-action:first-child {\n\tpadding-left: 16px;\n}\n\n.svg-action {\n\tfill: #dadada;\n}\n\n.svg-action:hover {\n\tfill: #fff;\n\tcursor: pointer;\n}\n');const ke=t=>{const n=e.useRef(null),[r,o]=e.useState(0),{selectEditorID:i,moduleActions:a}=e.useContext(P),{selectedEditorID:l,editorID:s,component:c,children:u,isSelectionAllowed:d}=t,p=["Header","Footer"].includes(c);e.useEffect((()=>{n&&n.current&&o(n.current.scrollHeight)}),[u]),e.useEffect((()=>{m&&f()}),[n]);const g=e=>{(s||0===s)&&"undefined"!=typeof window&&d&&i&&i(t,void 0,e)},f=()=>{if(!n.current)return;const e=n.current.style.position,t=n.current.style.top;n.current.style.position="relative",n.current.style.top="-34px",n.current.scrollIntoView({behavior:"smooth",block:"start"}),n.current.style.top=t,n.current.style.position=e;0===n.current.offsetTop&&(n.current.style.marginTop="36px")},m=!!l&&l===s;m&&f();return e.createElement(e.Fragment,null,"Header"===c&&e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n [data-text="Header"].--selected::before {\n height: ${r-8}px;\n }`}}),p&&e.createElement("span",{className:""+(m?"--selected-header-footer":""),"data-text":c,ref:n,onClick:g},u),!p&&e.createElement("span",{className:""+(m?"--selected":""),"data-text":c,ref:n,onClick:g},e.createElement("span",{className:""+(m?"--selected-nameplate":"--not-selected-nameplate")},c,e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.duplicateModuleAction(s)}},e.createElement(Ee,{className:"svg-action"})),e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.deleteModuleAction(s)}},e.createElement(we,{className:"svg-action"}))),u))};function Ie(t){var r,{libComponents:o}=t,i=n(t,["libComponents"]);const{component:a,editorID:l,type:s,parentEditorID:c}=i,{renderer:u}=K(),d=null===(r=oe())||void 0===r?void 0:r.isNavigation,p="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||"0"):null,g=xe(o,Object.assign({},i)),f=d&&!["Header","Footer"].includes(a);return"editor"===u?e.createElement(H,null,e.createElement(ke,{selectedEditorID:p,isSelectionAllowed:!f,editorID:l,component:a,type:s,parentEditorID:c},g?e.createElement(g,Object.assign({},i)):e.createElement(e.Fragment,null))):"preview"===u?e.createElement(H,null,g&&e.createElement(g,Object.assign({},i))):g&&e.createElement(g,Object.assign({},i))}le('.griddo-background-image {\n\tdisplay: flex;\n\twidth: 100%;\n\theight: 100%;\n\n\tposition: relative;\n\n\tbackground-repeat: no-repeat;\n\tbackground-size: cover;\n\tbackground-position: 50% 50%;\n}\n\n.griddo-background-image--lazy .griddo-background-image {\n\tbackground: none !important;\n}\n\n.griddo-background-image::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n\ttransition: all var(--veil-transition-time) var(--veil-transition-easing);\n\tbackground-color: var(--veil-opacity);\n}\n');const Ce=e.forwardRef(((t,n)=>{const{children:r,format:o,backgroundSize:i,veilOpacity:a=.5,veilColor:u="#000033",veilTransitionTime:d="2s",veilTransitionEasing:p="easing",url:g,src:f,responsive:m,className:v,style:h,quality:b,lazyOffset:y="200px",loading:j}=t,{griddoDamDefaults:O}=K(),$=e.useRef(null),S=s(g);e.useEffect((()=>{var e;if(IntersectionObserver){if($.current){let e=new IntersectionObserver((t=>t.forEach((t=>{var n;t.isIntersecting&&(null===(n=$.current)||void 0===n||n.classList.remove("griddo-background-image--lazy"),e=e.disconnect())}))),{rootMargin:`0px 0px ${y} 0px`});return e.observe($.current),()=>e=e&&e.disconnect()}}else null===(e=$.current)||void 0===e||e.classList.remove("griddo-background-image--lazy")}),[]);const x=m&&Object.fromEntries(Object.keys(m).map((e=>[e,{url:`url("${l({damId:c(g),imageConfig:Object.assign(Object.assign(Object.assign({},O),{quality:b,format:o,domain:S}),m[e])})}")`,customProperty:m[e].customProperty}]))),w=m&&Object.fromEntries(Object.keys(m).map(((e,t)=>[x[e].customProperty?`${x[e].customProperty}`:`--image-${t}`,x[e].url]))),E=f?{"--image-default":`url(${f})`}:w;return e.createElement("div",{ref:$,"data-griddo":"loading-ref",className:""+("lazy"===j?"griddo-background-image--lazy":"")},e.createElement("div",{"data-griddo":"image-ref",ref:n,className:`${v} griddo-background-image`,style:Object.assign(Object.assign(Object.assign({},h),{"--veil-opacity":`${u}${Math.round(255/(1/a)).toString(16)}`,"--veil-transition-time":d,"--veil-transition-easing":p,"--background-size":i}),E)},r))}));le('[style*="--aspect-ratio"] [data-image="griddo"] {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 100%;\n\twidth: 100%;\n\tobject-fit: cover;\n}\n');const _e=e.forwardRef(((t,r)=>{var{width:o,height:i,ratio:a,fixed:l,url:s,loading:c,decoding:u,responsive:d,quality:p,crop:g,format:f,formats:m,position:v,transforms:h}=t,b=n(t,["width","height","ratio","fixed","url","loading","decoding","responsive","quality","crop","format","formats","position","transforms"]);if(!s)return null;const{griddoDamDefaults:y}=K()||{},j={loading:c||(null==y?void 0:y.loading),decoding:u||(null==y?void 0:y.decoding),quality:p||(null==y?void 0:y.quality),crop:g||(null==y?void 0:y.crop),format:f,formats:m||(null==y?void 0:y.formats),position:v,transforms:h},{src:O,sizes:$,avif:S,jpeg:x,gif:w,webp:E,svg:k}=J({url:s,crop:j.crop,format:j.format,quality:j.quality,responsive:d,position:j.position,transforms:j.transforms,width:o,height:i}),I=()=>{var t;return e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:u||j.decoding,srcSet:d&&(null===(t=null==w?void 0:w.srcSet)||void 0===t?void 0:t.join(",")),sizes:d&&$,src:(null==w?void 0:w.srcSetURL)&&w.srcSetURL[0],width:o,height:i,fetchpriority:b.fetchpriority},b))},C=()=>e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:u||j.decoding,src:(null==k?void 0:k.srcSetURL)&&k.srcSetURL[0],width:o,height:i,fetchpriority:b.fetchpriority},b)),_=()=>{var t,n,a,l,s;return e.createElement("picture",{ref:r},(null===(t=j.formats)||void 0===t?void 0:t.includes("avif"))&&e.createElement("source",{srcSet:null===(n=null==S?void 0:S.srcSet)||void 0===n?void 0:n.join(","),sizes:$,type:"image/avif"}),(null===(a=j.formats)||void 0===a?void 0:a.includes("webp"))&&e.createElement("source",{srcSet:null===(l=null==E?void 0:E.srcSet)||void 0===l?void 0:l.join(","),sizes:$,type:"image/webp"}),e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:u||j.decoding,sizes:$,srcSet:null===(s=null==x?void 0:x.srcSet)||void 0===s?void 0:s.join(","),src:O,width:o,height:i,fetchpriority:b.fetchpriority},b)))};return s?"svg"===f?e.createElement(C,null):"gif"===f?e.createElement(I,null):l||!d?e.createElement(_,null):e.createElement($e,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(_,null)):null})),ze="pre",Pe="pro";function Le(t){var{activeClassName:r="",activeStyle:o={},style:i={},children:a,getProps:l,partiallyActive:s,state:c,url:u,title:d,className:p=""}=t,g=n(t,["activeClassName","activeStyle","style","children","getProps","partiallyActive","state","url","title","className"]);const{renderer:f,linkComponent:m}=K(),{fullPath:v}=q(),h="editor"===f,b=null==u?void 0:u.href,y=null==u?void 0:u.linkToURL,j=(null==u?void 0:u.newTab)||!1,O=(null==u?void 0:u.noFollow)||!1,$=!(null==u?void 0:u.linkToURL)&&!(null==u?void 0:u.href),S=y===`${null==v?void 0:v.domainUrl}${null==v?void 0:v.compose}`,x=function(e){var t;return(null===(t=null==e?void 0:e.domainUrl)||void 0===t?void 0:t.endsWith(`/${e.domain}`))?Pe:ze}(v),w=function(e,t){return`${t?"nofollow":""} ${e?"noreferrer":""}`.trim()}(j,O),E=function(e){return e?"_blank":"_self"}(j),k=v&&function({env:e,fullPath:t,to:n}){var r,o,i;if("string"!=typeof n)return n;if(e===ze){const e=null===(r=null==t?void 0:t.domainUrl)||void 0===r?void 0:r.split((null==t?void 0:t.domain)||"").join("");return(null===(o=null==n?void 0:n.split(e||""))||void 0===o?void 0:o.join(""))||n}return e===Pe&&(null===(i=null==n?void 0:n.split((null==t?void 0:t.domainUrl)||""))||void 0===i?void 0:i.join(""))||n}({env:x,fullPath:v,to:y}),I=h||$?"":k;return b||j?e.createElement("a",Object.assign({"data-link":"anchor",target:E,rel:w,href:b||y,className:p,title:d},g),a):e.createElement(m,Object.assign({rel:w,target:E,to:I,getProps:l,partiallyActive:s,state:c,activeStyle:o,activeClassName:r,title:h?k:d,style:S?o:i,className:S?`${p} ${r||""}`.trim():p},g),a)}function Ue(t){const{data:n}=t;return e.createElement("script",{dangerouslySetInnerHTML:{__html:`(function(){\n const ldJsonScript = document.createElement('script');\n ldJsonScript.setAttribute('type', 'application/ld+json');\n ldJsonScript.textContent = \`${JSON.stringify(n)}\`;\n document.head.appendChild(ldJsonScript);\n})();`}})}function Ne(t){const{url:r,linkProp:o="to",children:i}=t,a=n(t,["url","linkProp","children"]),{fullUrl:l}=q(),s=ee()||"a",{href:c,to:u}=function(e){const t=null==e?void 0:e.href,n=null==e?void 0:e.linkToURL,r=null==n?void 0:n.match(/^\/{2}|^https?:/g),o=null==n?void 0:n.match(/^\/\w/g);return{href:t||(r?n:null),to:o?n:null}}(r),d=null==r?void 0:r.newTab,p=null==r?void 0:r.noFollow,g=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),d&&{target:"_blank"}),{rel:`${p?"nofollow":""} ${d?"noreferrer":""}`.trim()}),l&&c&&{href:S(l,c)}),l&&u&&{[o]:S(l,u)});return u?e.createElement(e.Fragment,null,e.createElement("p",null,"Router"),e.createElement(s,Object.assign({},g),i)):e.createElement("a",g,i)}function qe(t){const{component:n,content:r,library:{components:o}}=t;return r?e.createElement(Ie,Object.assign({libComponents:o,component:n},r)):null}function Re(t){var n;const{apiUrl:r,content:o,footer:i,header:a,languageId:l,library:{templates:s,components:c},pageLanguages:u,siteMetadata:d}=t,p=s[o.template.templateType],g=o.template.heroSection?o.template.heroSection.modules&&o.template.heroSection.modules[0]:void 0,f=g?g.component:void 0,m=k({obj:o.template,searchKey:"component"}),v=Object.keys(null==o?void 0:o.template).filter((e=>(null==o?void 0:o.template[e])&&o.template[e].component)),h=Object.fromEntries(null==v?void 0:v.map((e=>{var t;return[e,null===(t=null==o?void 0:o.template[e].modules)||void 0===t?void 0:t.map((({component:e})=>e))]})));return e.createElement(N,{activeSectionBase:o.template.activeSectionBase,activeSectionSlug:o.template.activeSectionSlug||"/",apiUrl:r,breadcrumb:o.breadcrumb,componentList:m,dimensions:null===(n=o.dimensions)||void 0===n?void 0:n.values,firstModule:f,footer:i,fullPath:o.fullPath,fullUrl:o.fullUrl,header:a,isHome:o.isHome,languageId:l,modified:o.modified,origin:o.origin,pageLanguages:u,published:o.published,sectionModules:h,site:o.site,siteMetadata:d,siteSlug:o.siteSlug,structuredDataContent:o.structuredDataContent,title:o.title,template:o.template},e.createElement(e.Fragment,null,!!a&&e.createElement(M,null,e.createElement(Ie,Object.assign({libComponents:c},a))),e.createElement(p,Object.assign({},o.template)),!!i&&e.createElement(M,null,e.createElement(Ie,Object.assign({libComponents:c},i)))))}function Ae(t){const{isPage:r=!1}=t,o=n(t,["isPage"]),i=o,a=o;return r?e.createElement(Re,Object.assign({},i)):e.createElement(qe,Object.assign({},a))}const Te=e=>e,Me=e=>e,De=e=>e,He=e=>e,Fe=e=>e,Be=e=>e,Ge=e=>e,Ve=e=>e,Je=e=>e,We=e=>e,Ke=e=>e,Ye=e=>e,Ze=e=>e,Qe=e=>e,Xe=e=>e,et=e=>e;var tt=Object.freeze({__proto__:null}),nt=Object.freeze({__proto__:null}),rt=Object.freeze({__proto__:null}),ot=Object.freeze({__proto__:null}),it=Object.freeze({__proto__:null});export{it as AutoType,se as CloudinaryBackgroundImage,Se as CloudinaryImage,Ie as Component,tt as Core,nt as Fields,Ce as GriddoBackgroundImage,_e as GriddoImage,Le as GriddoLink,Ue as LdJson,Ne as Link,Re as Page,U as PageContext,N as PageProvider,Ae as Preview,rt as Schema,D as SessionContext,H as SessionProvider,P as SiteContext,L as SiteProvider,ot as Theme,He as createCategoryContentTypeSchema,Te as createComponentSchema,Fe as createDamDefaultsSchema,Be as createDataPackCategorySchema,Ge as createDataPackSchema,Ve as createFooterSchema,Je as createHeaderSchema,We as createLanguagesSchema,Ke as createMenuSchema,Ye as createModuleCategoriesSchema,Ze as createModuleSchema,De as createPageContentTypeSchema,Me as createSimpleContentTypeSchema,Qe as createTemplateSchema,Xe as createThemesSchema,et as createTranslationsSchema,xe as getComponent,E as getLang,w as getSiteID,x as getToken,A as useContentType,B as useDataFilters,R as useDistributorData,u as useGlobalTheme,J as useGriddoImage,Y as useI18n,Q as useImage,ee as useLink,ne as useList,oe as useNavigation,q as usePage,R as useReferenceFieldData,ie as useSession,K as useSite,ae as useSitemap,d as useTheme,y as useThemeColors,O as useThemeFont,j as useThemePrimitives};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type Noop = never;
|
package/dist/types/core.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { CloudinaryImageProps } from "../components/CloudinaryImage";
|
|
|
3
3
|
import { GriddoLinkProps } from "../components/GriddoLink";
|
|
4
4
|
import locales from "./constants/locales";
|
|
5
5
|
import timezone from "./constants/timezone";
|
|
6
|
-
import {
|
|
6
|
+
import { Image } from "./fields";
|
|
7
7
|
export declare type Renderers = "gatsby" | "editor" | "preview";
|
|
8
8
|
export declare type Breadcrumb = Array<{
|
|
9
9
|
path?: string;
|
|
@@ -119,7 +119,7 @@ export interface Page {
|
|
|
119
119
|
siteSlug?: string;
|
|
120
120
|
slug: string;
|
|
121
121
|
socialDescription?: string;
|
|
122
|
-
socialImage?:
|
|
122
|
+
socialImage?: Image;
|
|
123
123
|
socialTitle?: string;
|
|
124
124
|
structuredData?: unknown;
|
|
125
125
|
structuredDataContent?: Record<string, unknown>;
|
package/dist/types/fields.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
declare type
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
export declare type ArrayFieldGroup<FieldKeys> = Array<FieldKeys>;
|
|
1
|
+
export declare type FieldsDivider = string;
|
|
2
|
+
export declare type ArrayFieldGroup<Fields> = Array<Fields>;
|
|
5
3
|
export declare type AsyncCheckGroup = Array<string>;
|
|
6
|
-
export declare type
|
|
7
|
-
export declare type
|
|
8
|
-
export declare type
|
|
4
|
+
export declare type AsyncSelect = number;
|
|
5
|
+
export declare type CheckGroup<NameValues> = NameValues;
|
|
6
|
+
export declare type ColorPicker = string;
|
|
7
|
+
export declare type ColorPickerFixed = {
|
|
9
8
|
name: string;
|
|
10
9
|
hex: string;
|
|
11
10
|
};
|
|
12
|
-
export declare type
|
|
13
|
-
export declare type
|
|
14
|
-
export declare type
|
|
15
|
-
export declare type
|
|
16
|
-
export declare type
|
|
11
|
+
export declare type ComponentArray<ComponentProps> = Array<ComponentProps>;
|
|
12
|
+
export declare type ComponentContainer<ComponentProps> = ComponentProps;
|
|
13
|
+
export declare type Conditional<Values> = Values;
|
|
14
|
+
export declare type Date = string;
|
|
15
|
+
export declare type FieldGroup = string;
|
|
16
|
+
export declare type File = {
|
|
17
17
|
/** URL for the document */
|
|
18
18
|
url?: string;
|
|
19
19
|
/** Size for the document file in bytes */
|
|
@@ -21,13 +21,13 @@ export declare type FileField = {
|
|
|
21
21
|
/** Upload date */
|
|
22
22
|
uploadDate?: string;
|
|
23
23
|
};
|
|
24
|
-
export declare type
|
|
24
|
+
export declare type Heading<HeadingTagsType = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"> = {
|
|
25
25
|
/** Text content */
|
|
26
26
|
content?: string;
|
|
27
27
|
/** HTML tag used to render the content */
|
|
28
28
|
tag?: HeadingTagsType | null;
|
|
29
29
|
};
|
|
30
|
-
export declare type
|
|
30
|
+
export declare type Image = {
|
|
31
31
|
/** Image id */
|
|
32
32
|
id?: number;
|
|
33
33
|
/** Original image name */
|
|
@@ -71,34 +71,32 @@ export declare type ImageField = {
|
|
|
71
71
|
/** Site to which image belongs */
|
|
72
72
|
site?: number;
|
|
73
73
|
};
|
|
74
|
-
interface
|
|
74
|
+
interface LinkCommon {
|
|
75
75
|
/** Link text */
|
|
76
76
|
text?: string;
|
|
77
77
|
}
|
|
78
|
-
interface
|
|
78
|
+
interface LinkUrl extends LinkCommon {
|
|
79
79
|
linkType: "url";
|
|
80
|
-
url:
|
|
80
|
+
url: Url;
|
|
81
81
|
}
|
|
82
|
-
interface
|
|
82
|
+
interface LinkModal<ModalComponents> extends LinkCommon {
|
|
83
83
|
linkType: "modal";
|
|
84
|
-
modal?:
|
|
85
|
-
[key: string]: ComponentContainerField<T>;
|
|
86
|
-
};
|
|
84
|
+
modal?: ModalComponents;
|
|
87
85
|
}
|
|
88
86
|
/** Field of type link in which a whitelist of modules can be added, for example to open them in a modal. */
|
|
89
|
-
export declare type
|
|
87
|
+
export declare type Link<ModalComponents> = LinkUrl | LinkModal<ModalComponents>;
|
|
90
88
|
declare type SourceReturn<Relations> = Relations extends true ? {
|
|
91
89
|
id?: number;
|
|
92
90
|
label?: string;
|
|
93
91
|
} : number;
|
|
94
|
-
export declare type
|
|
92
|
+
export declare type MultiCheckSelect<Relations = unknown> = Relations extends false ? Array<SourceReturn<false>> : Array<SourceReturn<true>>;
|
|
95
93
|
export declare type MultiCheckSelectGroup<T extends string, Relations> = {
|
|
96
|
-
[K in T]:
|
|
94
|
+
[K in T]: MultiCheckSelect<Relations>;
|
|
97
95
|
};
|
|
98
|
-
export declare type
|
|
99
|
-
export declare type
|
|
100
|
-
export declare type
|
|
101
|
-
export interface
|
|
96
|
+
export declare type Note = string;
|
|
97
|
+
export declare type Number = number | null | "";
|
|
98
|
+
export declare type RadioGroup<Values> = Values;
|
|
99
|
+
export interface Reference<ContentType> {
|
|
102
100
|
mode: "auto" | "manual";
|
|
103
101
|
order?: string;
|
|
104
102
|
fixed?: Array<number>;
|
|
@@ -114,15 +112,16 @@ export interface ReferenceField<ContentType> {
|
|
|
114
112
|
}>;
|
|
115
113
|
fullRelations?: boolean;
|
|
116
114
|
}
|
|
117
|
-
export declare type
|
|
118
|
-
export declare type
|
|
119
|
-
export declare type
|
|
120
|
-
export declare type
|
|
121
|
-
export declare type
|
|
122
|
-
/** Return type of an
|
|
123
|
-
export declare type
|
|
124
|
-
export declare type
|
|
125
|
-
export declare type
|
|
115
|
+
export declare type RichText = string;
|
|
116
|
+
export declare type ScrollableUniqueSelection = string;
|
|
117
|
+
export declare type Select<Values> = Values;
|
|
118
|
+
export declare type Slider = number;
|
|
119
|
+
export declare type TextArea = string;
|
|
120
|
+
/** Return type of an Text */
|
|
121
|
+
export declare type Text = string;
|
|
122
|
+
export declare type Time = string;
|
|
123
|
+
export declare type UniqueCheck = boolean;
|
|
124
|
+
export declare type Url = {
|
|
126
125
|
href?: string;
|
|
127
126
|
title?: string;
|
|
128
127
|
linkToURL?: string;
|
|
@@ -130,8 +129,8 @@ export declare type UrlField = {
|
|
|
130
129
|
noFollow?: boolean;
|
|
131
130
|
subSlug?: string;
|
|
132
131
|
};
|
|
133
|
-
export declare type
|
|
134
|
-
export declare type
|
|
132
|
+
export declare type VisualUniqueSelection<Values> = Values;
|
|
133
|
+
export declare type Wysiwyg = string;
|
|
135
134
|
declare type ConfigBase = {
|
|
136
135
|
type?: "link" | "group";
|
|
137
136
|
headerStyle?: string;
|
|
@@ -139,9 +138,9 @@ declare type ConfigBase = {
|
|
|
139
138
|
};
|
|
140
139
|
declare type MenuItemBase = {
|
|
141
140
|
label?: string;
|
|
142
|
-
url?:
|
|
141
|
+
url?: Url;
|
|
143
142
|
auxText?: string;
|
|
144
|
-
image?:
|
|
143
|
+
image?: Image;
|
|
145
144
|
};
|
|
146
145
|
interface GroupLinkType extends ConfigBase {
|
|
147
146
|
type?: "group";
|
package/dist/types/global.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fields } from "../index";
|
|
2
2
|
export interface SetQueryProps<ContentType> {
|
|
3
3
|
/** The ReferenceField prop */
|
|
4
|
-
data?: Fields.
|
|
4
|
+
data?: Fields.Reference<ContentType>;
|
|
5
5
|
/** The URL of the public API, if not provided, will be obtained from the context */
|
|
6
6
|
apiUrl?: string;
|
|
7
7
|
/** Number of items that will be fetched */
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { WithDisabled, WithEntity, WithGroup, HTMLHeadingTag, Option, WithSource, ThemeColors, ThemeFixedColors, ThemeVisualUniqueSelection, ThumbnailOption } from "./props";
|
|
2
2
|
export declare type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
3
|
+
/** Type generator options */
|
|
4
|
+
declare type TypeGeneratorBase = {
|
|
5
|
+
/** Comment for the Types generator */
|
|
6
|
+
doc?: string;
|
|
7
|
+
/** Ignore this field for the Types generator */
|
|
8
|
+
ignore?: boolean;
|
|
9
|
+
};
|
|
3
10
|
interface GenericField {
|
|
4
11
|
/** Sets the field type. */
|
|
5
12
|
type: string;
|
|
@@ -9,12 +16,19 @@ interface GenericField {
|
|
|
9
16
|
title: string;
|
|
10
17
|
/** If the field is required. */
|
|
11
18
|
mandatory?: boolean;
|
|
19
|
+
/** Auto type generator */
|
|
20
|
+
_autoType?: TypeGeneratorBase;
|
|
12
21
|
}
|
|
13
22
|
interface GenericComponentField extends GenericField {
|
|
14
23
|
/** Forces all elements of the Array to be of the same type. If this option is enabled the schema should include a `VisualUniqueSelection` to choose the type. */
|
|
15
24
|
elementUniqueSelection?: boolean;
|
|
16
25
|
/** Maximum number of components that can be added. */
|
|
17
26
|
maxItems?: number | null;
|
|
27
|
+
/** Auto type generator */
|
|
28
|
+
_autoType?: TypeGeneratorBase & {
|
|
29
|
+
/** Suffix for the components in the Whiltelist */
|
|
30
|
+
suffix?: string;
|
|
31
|
+
};
|
|
18
32
|
}
|
|
19
33
|
interface GenericArrayFieldGroup extends GenericField {
|
|
20
34
|
/** Name of the item to be repeated. */
|
|
@@ -25,6 +39,11 @@ interface GenericArrayFieldGroup extends GenericField {
|
|
|
25
39
|
arrayType: string;
|
|
26
40
|
/** Fields template to be repeated in each item. */
|
|
27
41
|
fields: Array<unknown>;
|
|
42
|
+
/** Type generator options */
|
|
43
|
+
_autoType?: TypeGeneratorBase & {
|
|
44
|
+
/** Suffix for the components in the Whiltelist */
|
|
45
|
+
suffix?: string;
|
|
46
|
+
};
|
|
28
47
|
}
|
|
29
48
|
export interface BaseArrayFieldGroup<FieldsType> extends GenericArrayFieldGroup {
|
|
30
49
|
type: "ArrayFieldGroup";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseComponentArray, BaseComponentContainer, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTextArea, BaseTextField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
-
import { WithIndexable, WithSearchable, WithShowList, WithFrom } from "./props";
|
|
2
|
+
import { WithIndexable, WithSearchable, WithShowList, WithFrom, WithRelations_AutoType, WithWhiteList } from "./props";
|
|
3
3
|
declare type Common = WithFrom & WithIndexable & WithSearchable & WithShowList;
|
|
4
4
|
export declare type ArrayFieldGroup = BaseArrayFieldGroup<PageContentTypeFields> & Common;
|
|
5
5
|
export declare type ConditionalField = BaseConditionalField<PageContentTypeFields> & Common;
|
|
@@ -8,15 +8,15 @@ export declare type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
|
|
|
8
8
|
export declare type AsyncSelect = BaseAsyncSelect & Common;
|
|
9
9
|
export declare type CheckGroup = BaseCheckGroup & Common;
|
|
10
10
|
export declare type ColorPicker = BaseColorPicker & Common;
|
|
11
|
-
export declare type ComponentArray = BaseComponentArray & Common;
|
|
11
|
+
export declare type ComponentArray = BaseComponentArray & WithWhiteList & Common;
|
|
12
12
|
export declare type ComponentContainer = BaseComponentContainer & Common;
|
|
13
13
|
export declare type DateField = BaseDateField & Common;
|
|
14
14
|
export declare type FieldsDivider = BaseFieldsDivider & Common;
|
|
15
15
|
export declare type FileField = BaseFileField & Common;
|
|
16
16
|
export declare type HeadingField = BaseHeadingField & Common;
|
|
17
17
|
export declare type ImageField = BaseImageField & Common;
|
|
18
|
-
export declare type LinkField = BaseLinkField & Common;
|
|
19
|
-
export declare type MultiCheckSelect = BaseMultiCheckSelect & Common;
|
|
18
|
+
export declare type LinkField = BaseLinkField & WithWhiteList & Common;
|
|
19
|
+
export declare type MultiCheckSelect = BaseMultiCheckSelect & WithRelations_AutoType & Common;
|
|
20
20
|
export declare type MultiCheckSelectGroup = BaseMultiCheckSelectGroup & Common;
|
|
21
21
|
export declare type NoteField = BaseNoteField & Common;
|
|
22
22
|
export declare type NumberField = BaseNumberField & Common;
|
|
@@ -4,7 +4,7 @@ export declare type WithDisabled = {
|
|
|
4
4
|
};
|
|
5
5
|
export declare type WithEntity = {
|
|
6
6
|
/** Type of entity from which you have to load the options. */
|
|
7
|
-
entity: "menu_containers" | "pages" | "categories";
|
|
7
|
+
entity: "menu_containers" | "pages" | "categories" | "sites";
|
|
8
8
|
};
|
|
9
9
|
export declare type WithFrom = {
|
|
10
10
|
/** The property of the page template from which the value of that field should be extracted. */
|
|
@@ -114,3 +114,8 @@ export declare type WithWhiteList = {
|
|
|
114
114
|
/** Array of strings with the names of the modules or components that can be added. */
|
|
115
115
|
whiteList: Array<string>;
|
|
116
116
|
};
|
|
117
|
+
export declare type WithRelations_AutoType = {
|
|
118
|
+
_autoType?: {
|
|
119
|
+
relations?: boolean;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTextArea, BaseTextField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
-
import { WithHelpText, WithHideable, WithIndexable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithSearchable, WithShowList, WithSlugTo, WithValidators } from "./props";
|
|
2
|
+
import { WithHelpText, WithHideable, WithIndexable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoType, WithSearchable, WithShowList, WithSlugTo, WithValidators, WithWhiteList } from "./props";
|
|
3
3
|
declare type Common = WithHideable & WithIndexable & WithSearchable & WithShowList & WithHelpText;
|
|
4
4
|
export declare type ArrayFieldGroup = BaseArrayFieldGroup<SimpleContentTypeFields> & Common;
|
|
5
5
|
export declare type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
|
|
@@ -13,8 +13,8 @@ export declare type FieldsDivider = BaseFieldsDivider & Common;
|
|
|
13
13
|
export declare type FileField = BaseFileField & Common & WithPlaceHolder;
|
|
14
14
|
export declare type HeadingField = BaseHeadingField & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
15
15
|
export declare type ImageField = BaseImageField & WithIsMockup & Common;
|
|
16
|
-
export declare type LinkField = BaseLinkField & Common;
|
|
17
|
-
export declare type MultiCheckSelect = BaseMultiCheckSelect & Common;
|
|
16
|
+
export declare type LinkField = BaseLinkField & WithWhiteList & Common;
|
|
17
|
+
export declare type MultiCheckSelect = BaseMultiCheckSelect & WithRelations_AutoType & Common;
|
|
18
18
|
export declare type MultiCheckSelectGroup = BaseMultiCheckSelectGroup & Common;
|
|
19
19
|
export declare type NoteField = BaseNoteField & Common;
|
|
20
20
|
export declare type NumberField = BaseNumberField & WithValidators & Common & WithPlaceHolder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseComponentArray, BaseComponentContainer, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTextArea, BaseTextField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
-
import { WithHelpText, WithHideable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithSlugTo, WithValidators, WithWhiteList } from "./props";
|
|
2
|
+
import { WithHelpText, WithHideable, WithIsMockup, WithPlaceHolder, WithPrefix, WithReadonly, WithRelations_AutoType, WithSlugTo, WithValidators, WithWhiteList } from "./props";
|
|
3
3
|
export declare type Common = WithHelpText & WithHideable;
|
|
4
4
|
export declare type ArrayFieldGroup = BaseArrayFieldGroup<UIFields> & Common;
|
|
5
5
|
export declare type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
|
|
@@ -16,7 +16,7 @@ export declare type FileField = BaseFileField & Common & WithPlaceHolder;
|
|
|
16
16
|
export declare type HeadingField = BaseHeadingField & WithIsMockup & WithValidators & Common & WithPlaceHolder;
|
|
17
17
|
export declare type ImageField = BaseImageField & WithIsMockup & Common;
|
|
18
18
|
export declare type LinkField = BaseLinkField & WithWhiteList & Common;
|
|
19
|
-
export declare type MultiCheckSelect = BaseMultiCheckSelect & Common;
|
|
19
|
+
export declare type MultiCheckSelect = BaseMultiCheckSelect & WithRelations_AutoType & Common;
|
|
20
20
|
export declare type MultiCheckSelectGroup = BaseMultiCheckSelectGroup & Common;
|
|
21
21
|
export declare type NoteField = BaseNoteField & Common;
|
|
22
22
|
export declare type NumberField = BaseNumberField & WithValidators & Common;
|
|
@@ -11,9 +11,9 @@ declare type PageContentTypeProp = SearchFrom & {
|
|
|
11
11
|
export interface PageContentType extends BaseContentType, DataPacks, ExpirationData {
|
|
12
12
|
/** Indicates that is a taxonomy. In this case must be `false`.*/
|
|
13
13
|
taxonomy: false;
|
|
14
|
-
/**
|
|
14
|
+
/** xIndicates that the data is of type page. Must always be `true`. */
|
|
15
15
|
fromPage: true;
|
|
16
16
|
/** Schema for the page content type. */
|
|
17
|
-
schema: PageContentTypeProp
|
|
17
|
+
schema: PageContentTypeProp;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataPacks, Thumbnails } from "./props";
|
|
2
|
-
interface BaseContentType {
|
|
1
|
+
import { DataPacks, Thumbnails, _AutoType } from "./props";
|
|
2
|
+
interface BaseContentType extends _AutoType {
|
|
3
3
|
/** Title that will appear in the Griddo editor. If it is `searchable = false`, it will not be used for searching (default is `true`). This is what is used for example for structured data listings. */
|
|
4
4
|
title: string;
|
|
5
5
|
/** It is recommended, as it is used for listings and searches. */
|
|
@@ -33,7 +33,7 @@ interface BaseContentType {
|
|
|
33
33
|
/** Field default values. */
|
|
34
34
|
defaultValues?: unknown;
|
|
35
35
|
}
|
|
36
|
-
interface BaseUI extends DataPacks {
|
|
36
|
+
interface BaseUI extends DataPacks, _AutoType {
|
|
37
37
|
/** Sets the schema type. For internal use. */
|
|
38
38
|
schemaType: string;
|
|
39
39
|
/** If `true` it will only be possible to create one page of this type of template. */
|
|
@@ -23,10 +23,15 @@ declare type Thumbnails = {
|
|
|
23
23
|
/** Thumbnail for 2x density screens. */
|
|
24
24
|
"2x"?: unknown;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
interface ConfigTabs {
|
|
27
27
|
/** Title that will appear on the tab in the Griddo editor. */
|
|
28
28
|
title: "content" | "config" | (string & {});
|
|
29
29
|
/** Array of Griddo fields. */
|
|
30
30
|
fields: Array<UIFields>;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
interface _AutoType {
|
|
33
|
+
_autoType?: {
|
|
34
|
+
relations?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export { ConfigTabs, Thumbnails, ExpirationData, Dimension, DataPacks, _AutoType, };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@griddo/core",
|
|
3
3
|
"description": "Reload version of Griddo Core",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.75.
|
|
5
|
+
"version": "1.75.14",
|
|
6
6
|
"authors": [
|
|
7
7
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
8
8
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
22
|
+
"bin": {
|
|
23
|
+
"griddo-autotype": "./dist/autotype"
|
|
24
|
+
},
|
|
22
25
|
"scripts": {
|
|
23
26
|
"build": "npx rollup -c",
|
|
24
27
|
"build-storybook": "build-storybook",
|
|
@@ -28,6 +31,8 @@
|
|
|
28
31
|
"start:storybook": "start-storybook -p 6006"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
34
|
+
"@types/prettier": "^2.7.1",
|
|
35
|
+
"prettier": "^2.7.1",
|
|
31
36
|
"react-aspect-ratio": "^1.0.49"
|
|
32
37
|
},
|
|
33
38
|
"devDependencies": {
|
|
@@ -72,5 +77,5 @@
|
|
|
72
77
|
"resolutions": {
|
|
73
78
|
"colors": "1.4.0"
|
|
74
79
|
},
|
|
75
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "ac6385899d1041672cdc83a9b6b02d84ce75b378"
|
|
76
81
|
}
|