@griddo/core 1.75.0 → 1.75.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/components/GriddoLink/index.d.ts +2 -1
- package/dist/contexts/Page/index.d.ts +1 -4
- package/dist/functions/create-schemas/index.d.ts +5 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/types/constants/utilities.d.ts +1 -0
- package/dist/types/core.d.ts +73 -72
- package/dist/types/fields.d.ts +1 -1
- package/dist/types/schema-functions/fields/base.d.ts +3 -3
- package/dist/types/schema-functions/fields/props.d.ts +1 -1
- package/dist/types/schema-functions/schemas/ContentType.d.ts +1 -1
- package/dist/types/schema-functions/schemas/index.d.ts +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -57,8 +57,8 @@ Components, hooks and common utilities for the instances and the Griddo product
|
|
|
57
57
|
|
|
58
58
|
**Schemas**
|
|
59
59
|
|
|
60
|
+
- `createCategoryContentTypeSchema`
|
|
60
61
|
- `createComponentSchema`
|
|
61
|
-
- `createContentTypeSchema`
|
|
62
62
|
- `createDamDefaultsSchema`
|
|
63
63
|
- `createDataPackCategorySchema`
|
|
64
64
|
- `createDataPackSchema`
|
|
@@ -68,6 +68,8 @@ Components, hooks and common utilities for the instances and the Griddo product
|
|
|
68
68
|
- `createMenuSchema`
|
|
69
69
|
- `createModuleCategoriesSchema`
|
|
70
70
|
- `createModuleSchema`
|
|
71
|
+
- `createPageContentTypeSchema`
|
|
72
|
+
- `createSimpleContentTypeSchema`
|
|
71
73
|
- `createTemplateSchema`
|
|
72
74
|
- `createThemesSchema`
|
|
73
75
|
- `createTranslationsSchema`
|
|
@@ -52,7 +52,8 @@ export interface GriddoLinkProps extends Omit<React.ComponentPropsWithoutRef<"a"
|
|
|
52
52
|
innerRef?: React.Ref<HTMLAnchorElement> | undefined;
|
|
53
53
|
/** If using React >=16.4, Link will forward its ref to you. */
|
|
54
54
|
ref?: (node: HTMLAnchorElement | null) => React.ReactNode;
|
|
55
|
+
/** onCLick event */
|
|
55
56
|
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
56
|
-
children
|
|
57
|
+
children?: React.ReactNode;
|
|
57
58
|
}
|
|
58
59
|
export { GriddoLink };
|
|
@@ -7,12 +7,9 @@ declare const PageContext: React.Context<Partial<PageProps>>;
|
|
|
7
7
|
* This provider component inject some props in the context of the page. Then you can retrieve the context values using the `usePage()` hook.
|
|
8
8
|
*/
|
|
9
9
|
declare function PageProvider(props: PageProviderProps): JSX.Element;
|
|
10
|
-
declare type PageProps = Pick<Page, "activeSectionBase" | "activeSectionSlug" | "apiUrl" | "breadcrumb" | "componentList" | "dimensions" | "firstModule" | "footer" | "fullPath" | "fullUrl" | "header" | "isHome" | "isIndexed" | "languageId" | "metaDescription" | "metasAdvanced" | "metaTitle" | "modified" | "origin" | "pageLanguages" | "published" | "site" | "siteMetadata" | "siteSlug" | "socialDescription" | "socialImage" | "socialTitle" | "structuredDataContent" | "title">;
|
|
10
|
+
declare type PageProps = Pick<Page, "activeSectionBase" | "activeSectionSlug" | "apiUrl" | "breadcrumb" | "componentList" | "dimensions" | "firstModule" | "footer" | "fullPath" | "fullUrl" | "header" | "isHome" | "isIndexed" | "languageId" | "metaDescription" | "metasAdvanced" | "metaTitle" | "modified" | "origin" | "pageLanguages" | "published" | "sectionModules" | "site" | "siteMetadata" | "siteSlug" | "socialDescription" | "socialImage" | "socialTitle" | "structuredDataContent" | "title">;
|
|
11
11
|
export declare type PageContextProps = Partial<PageProps>;
|
|
12
12
|
export interface PageProviderProps extends PageProps {
|
|
13
13
|
children: JSX.Element;
|
|
14
|
-
sectionModules?: {
|
|
15
|
-
[key: string]: Array<string>;
|
|
16
|
-
};
|
|
17
14
|
}
|
|
18
15
|
export { PageContext, PageProvider };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CategoryContentType, Component, DamDefaults, DataPack, DataPackCategory, Footer, Header, Languages, Menu, Module, ModuleCategories, PageContentType, SimpleContentType, Template, Themes, Translations } from "../../types/schema-functions/schemas";
|
|
2
2
|
declare const createComponentSchema: (schema: Component) => Component;
|
|
3
|
-
declare const
|
|
3
|
+
declare const createSimpleContentTypeSchema: (schema: SimpleContentType) => SimpleContentType;
|
|
4
|
+
declare const createPageContentTypeSchema: (schema: PageContentType) => PageContentType;
|
|
5
|
+
declare const createCategoryContentTypeSchema: (schema: CategoryContentType) => CategoryContentType;
|
|
4
6
|
declare const createDamDefaultsSchema: (schema: DamDefaults) => DamDefaults;
|
|
5
7
|
declare const createDataPackCategorySchema: (schema: DataPackCategory) => DataPackCategory;
|
|
6
8
|
declare const createDataPackSchema: (schema: DataPack) => DataPack;
|
|
@@ -13,4 +15,4 @@ declare const createModuleSchema: (schema: Module) => Module;
|
|
|
13
15
|
declare const createTemplateSchema: (schema: Template) => Template;
|
|
14
16
|
declare const createThemesSchema: (schema: Themes) => Themes;
|
|
15
17
|
declare const createTranslationsSchema: (schema: Translations) => Partial<Record<"br" | "hr" | "li" | "th" | "tr" | "or" | "Cy_az_AZ" | "Cy_sr_SP" | "Cy_uz_UZ" | "Lt_az_AZ" | "Lt_sr_SP" | "Lt_uz_UZ" | "aa" | "ab" | "ae" | "af" | "af_ZA" | "ak" | "am" | "an" | "ar" | "ar_AE" | "ar_BH" | "ar_DZ" | "ar_EG" | "ar_IQ" | "ar_JO" | "ar_KW" | "ar_LB" | "ar_LY" | "ar_MA" | "ar_OM" | "ar_QA" | "ar_SA" | "ar_SY" | "ar_TN" | "ar_YE" | "as" | "av" | "ay" | "az" | "ba" | "be" | "be_BY" | "bg" | "bg_BG" | "bh" | "bi" | "bm" | "bn" | "bo" | "bs" | "ca" | "ca_ES" | "ce" | "ch" | "co" | "cr" | "cs" | "cs_CZ" | "cu" | "cv" | "cy" | "da" | "da_DK" | "de" | "de_AT" | "de_CH" | "de_DE" | "de_LI" | "de_LU" | "div_MV" | "dv" | "dz" | "ee" | "el" | "el_GR" | "en" | "en_AU" | "en_BZ" | "en_CA" | "en_CB" | "en_GB" | "en_IE" | "en_JM" | "en_NZ" | "en_PH" | "en_TT" | "en_US" | "en_ZA" | "en_ZW" | "eo" | "es" | "es_AR" | "es_BO" | "es_CL" | "es_CO" | "es_CR" | "es_DO" | "es_EC" | "es_ES" | "es_GT" | "es_HN" | "es_MX" | "es_NI" | "es_PA" | "es_PE" | "es_PR" | "es_PY" | "es_SV" | "es_UY" | "es_VE" | "et" | "et_EE" | "eu" | "eu_ES" | "fa" | "fa_IR" | "ff" | "fi" | "fi_FI" | "fj" | "fo" | "fo_FO" | "fr" | "fr_BE" | "fr_CA" | "fr_CH" | "fr_FR" | "fr_LU" | "fr_MC" | "fy" | "ga" | "gd" | "gl" | "gl_ES" | "gn" | "gu" | "gu_IN" | "gv" | "ha" | "he" | "he_IL" | "hi" | "hi_IN" | "ho" | "hr_HR" | "ht" | "hu" | "hu_HU" | "hy" | "hy_AM" | "hz" | "ia" | "id" | "id_ID" | "ie" | "ig" | "ii" | "ik" | "io" | "is" | "is_IS" | "it" | "it_CH" | "it_IT" | "iu" | "ja" | "ja_JP" | "jv" | "ka" | "ka_GE" | "kg" | "ki" | "kj" | "kk" | "kk_KZ" | "kl" | "km" | "kn" | "kn_IN" | "ko" | "ko_KR" | "kr" | "ks" | "ku" | "kv" | "kw" | "ky" | "ky_KZ" | "la" | "lb" | "lg" | "ln" | "lo" | "lt" | "lt_LT" | "lu" | "lv" | "lv_LV" | "mg" | "mh" | "mi" | "mk" | "mk_MK" | "ml" | "mn" | "mn_MN" | "mr" | "mr_IN" | "ms" | "ms_BN" | "ms_MY" | "mt" | "my" | "na" | "nb" | "nb_NO" | "nd" | "ne" | "ng" | "nl" | "nl_BE" | "nl_NL" | "nn" | "nn_NO" | "no" | "nr" | "nv" | "ny" | "oc" | "oj" | "om" | "os" | "pa" | "pa_IN" | "pi" | "pl" | "pl_PL" | "ps" | "pt" | "pt_BR" | "pt_PT" | "qu" | "rm" | "rn" | "ro" | "ro_RO" | "ru" | "ru_RU" | "rw" | "sa" | "sa_IN" | "sc" | "sd" | "se" | "sg" | "si" | "sk" | "sk_SK" | "sl" | "sl_SI" | "sm" | "sn" | "so" | "sq" | "sq_AL" | "sr" | "ss" | "st" | "su" | "sv" | "sv_FI" | "sv_SE" | "sw" | "sw_KE" | "ta" | "ta_IN" | "te" | "te_IN" | "tg" | "th_TH" | "ti" | "tk" | "tl" | "tn" | "to" | "tr_TR" | "ts" | "tt" | "tt_RU" | "tw" | "ty" | "ug" | "uk" | "uk_UA" | "ur" | "ur_PK" | "uz" | "ve" | "vi" | "vi_VN" | "vo" | "wa" | "wo" | "xh" | "yi" | "yo" | "za" | "zh" | "zh_CHS" | "zh_CHT" | "zh_CN" | "zh_HK" | "zh_MO" | "zh_SG" | "zh_TW" | "zu", Record<string, unknown>>>;
|
|
16
|
-
export {
|
|
18
|
+
export { createCategoryContentTypeSchema, createComponentSchema, createDamDefaultsSchema, createDataPackCategorySchema, createDataPackSchema, createFooterSchema, createHeaderSchema, createLanguagesSchema, createMenuSchema, createModuleCategoriesSchema, createModuleSchema, createPageContentTypeSchema, createSimpleContentTypeSchema, createTemplateSchema, createThemesSchema, createTranslationsSchema, };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CloudinaryBackgroundImage, CloudinaryImage, Component, GriddoBackground
|
|
|
2
2
|
import { PageContext, PageProvider, SiteContext, SiteProvider } from "./contexts";
|
|
3
3
|
import { SiteProviderProps } from "./contexts/Site";
|
|
4
4
|
import { getComponent } from "./functions";
|
|
5
|
-
import { createComponentSchema,
|
|
5
|
+
import { createComponentSchema, createSimpleContentTypeSchema, createPageContentTypeSchema, createCategoryContentTypeSchema, createDamDefaultsSchema, createDataPackCategorySchema, createDataPackSchema, createFooterSchema, createHeaderSchema, createLanguagesSchema, createMenuSchema, createModuleCategoriesSchema, createModuleSchema, createTemplateSchema, createThemesSchema, createTranslationsSchema } from "./functions/create-schemas";
|
|
6
6
|
import { getLang, getSiteID, getToken } from "./functions/utils";
|
|
7
7
|
import { useContentType, useDataFilters, useGlobalTheme, useGriddoImage, useI18n, useImage, useLink, useList, useNavigation, usePage, useReferenceFieldData, useSite, useSitemap, useTheme, useThemeColors, useThemeFont, useThemePrimitives } from "./hooks";
|
|
8
8
|
import { CloudinaryImageProps } from "./components/CloudinaryImage";
|
|
@@ -21,4 +21,4 @@ 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
|
-
export { PageContext, PageProvider, SiteContext, SiteProvider, 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, getLang, getSiteID, getToken, getComponent,
|
|
24
|
+
export { PageContext, PageProvider, SiteContext, SiteProvider, 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, 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:"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 R(){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 q(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}=R();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&&q(e)||t}const T=e.createContext(null);function M(t){return e.createElement(T.Provider,{value:{isNavigation:!0}},t.children)}function D(){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}=R(),[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 H={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]};function F(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({},H),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];return{srcSet:f,srcSetURL:v,src:`${l(Object.assign({damId:p,imageConfig:g},h))}`,sizes:m,webpFallback:B({srcSet:f,srcSetURL:v,format:"jpeg"}),jpeg:B({srcSet:f,srcSetURL:v,format:"jpeg"}),webp:B({srcSet:f,srcSetURL:v,format:"webp"}),avif:B({srcSet:f,srcSetURL:v,format:"avif"}),png:B({srcSet:f,srcSetURL:v,format:"png"}),gif:B({srcSet:f,srcSetURL:v,format:"gif"}),svg:B({srcSet:f,srcSetURL:v,format:"svg"})}}function B({srcSet:e,srcSetURL:t,format:n}){return{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 G=()=>e.useContext(P);function V(t){const n=null==t?void 0:t.locale,r=e.useContext(C),{siteLangs:o}=G(),{languageId:i}=R(),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 J={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 W(e){var t,r,{publicId:o}=e,a=n(e,["publicId"]);const{cloudinaryCloudName:l,cloudinaryDefaults:s}=G(),c=Object.assign(Object.assign(Object.assign({},J),s),a),u=`${c.domain}/${l}/${c.uploadFolder}`,d=`${K({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})=>`${K({root:u,imageConfig:Object.assign(Object.assign({},c),{quality:n,crop:r,width:e,height:t})})}/${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:`${K(Object.assign({root:u,imageConfig:c},m))}/${o}`,srcSet:p,sizes:g,fallbackSrcImage:d,srcSetURL:f}}function K(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}`:"";return`${t}/${`${r},${a},${l},${o},${s},${c},${u}`.split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",")}`}function Y(){const t=e.useContext(P);return null==t?void 0:t.linkComponent}const Z=["or","and"];function Q(){const{publicApiUrl:t,siteId:n,renderer:r}=G(),{languageId:o}=R(),[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:X(f)?f:null,filterOperator:X(u)?u:null,globalOperator:X(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 X(e){return!!e&&Z.includes(e.toLowerCase())}function ee(){return e.useContext(T)}function te(){const[t,n]=e.useState(),[o,i]=e.useState(!0),{apiUrl:a,header:l,footer:s,fullPath:c}=R(),{siteMetadata:u}=G();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 ne(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 re(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}=G(),b=Object.assign(Object.assign(Object.assign(Object.assign({},h),o),v),{backgroundLazy:h.backgroundLazy||o.backgroundLazy||m}),{srcSetURL:y}=W({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 oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ie(e,t){return e(t={exports:{}},t.exports),t.exports}ne('.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 ae=Symbol.for("react.element"),le=Symbol.for("react.fragment"),se=Object.prototype.hasOwnProperty,ce=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ue={key:!0,ref:!0,__self:!0,__source:!0};function de(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)se.call(t,r)&&!ue.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:ae,type:e,key:i,ref:a,props:o,_owner:ce.current}}var pe={Fragment:le,jsx:de,jsxs:de},ge=ie((function(e){e.exports=pe})),fe=ie((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,ge.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}));oe(fe);var me=ie((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,ge.jsx)("div",r({className:t,style:c},s,{children:i}))};t.default=i}));oe(me);var ve=ie((function(e,t){t.__esModule=!0,t.default=t.AspectRatio=void 0;var n=o(fe),r=o(me);function o(e){return e&&e.__esModule?e:{default:e}}var i=n.default;t.default=i;var a=r.default;t.AspectRatio=a}));oe(ve);var he=ve.AspectRatio;function be(t){const{alt:n,width:r,height:i,ratio:a,fixed:l,publicId:s,src:c,objectFit:u="cover"}=t,{cloudinaryDefaults:d}=G(),p=Object.assign(Object.assign(Object.assign({},o),d),t),{srcSet:g,sizes:f,src:m}=W({crop:p.crop,format:p.format,gravity:p.gravity,quality:p.quality,sizes:p.sizes,responsive:p.responsive,width:r,height:i,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(he,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(j,null))}ne('[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 ye=(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)},je=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"})),Oe=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"}));ne('.--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 $e=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(Oe,{className:"svg-action"})),e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.deleteModuleAction(s)}},e.createElement(je,{className:"svg-action"}))),u))};function Se(t){var r,{libComponents:o}=t,i=n(t,["libComponents"]);const{component:a,editorID:l,type:s,parentEditorID:c}=i,{renderer:u}=G(),d=null===(r=ee())||void 0===r?void 0:r.isNavigation,p="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||"0"):null,g=ye(o,Object.assign({},i)),f=d&&!["Header","Footer"].includes(a);return"editor"===u?e.createElement($e,{selectedEditorID:p,isSelectionAllowed:!f,editorID:l,component:a,type:s,parentEditorID:c},g?e.createElement(g,Object.assign({},i)):e.createElement(e.Fragment,null)):g&&e.createElement(g,Object.assign({},i))}ne('.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 xe=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}=G(),$=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))}));ne('[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 we=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}=G()||{},j=Object.assign(Object.assign({},y),{quality:p,crop:g,format:f,formats:m,position:v,transforms:h}),{src:O,sizes:$,avif:S,jpeg:x,gif:w,webp:E,svg:k}=F({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;return e.createElement("picture",{ref:r},j.formats.includes("avif")&&e.createElement("source",{srcSet:null===(t=null==S?void 0:S.srcSet)||void 0===t?void 0:t.join(","),sizes:$}),j.formats.includes("webp")&&e.createElement("source",{srcSet:null===(n=null==E?void 0:E.srcSet)||void 0===n?void 0:n.join(","),sizes:$}),e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:u||j.decoding,sizes:$,srcSet:null===(a=null==x?void 0:x.srcSet)||void 0===a?void 0:a.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(he,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(_,null)):null})),Ee="pre",ke="pro";function Ie(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}=G(),{fullPath:v}=R(),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}`))?ke:Ee}(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===Ee){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===ke&&(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=j?y:!h&&!$&&k||"";return b?e.createElement("a",Object.assign({target:E,rel:w,href:b,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 Ce(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 _e(t){const{url:r,linkProp:o="to",children:i}=t,a=n(t,["url","linkProp","children"]),{fullUrl:l}=R(),s=Y()||"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 ze(t){const{component:n,content:r,library:{components:o}}=t;return r?e.createElement(Se,Object.assign({libComponents:o,component:n},r)):null}function Pe(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},e.createElement(e.Fragment,null,!!a&&e.createElement(M,null,e.createElement(Se,Object.assign({libComponents:c},a))),e.createElement(p,Object.assign({},o.template)),!!i&&e.createElement(M,null,e.createElement(Se,Object.assign({libComponents:c},i)))))}function Le(t){const{isPage:r=!1}=t,o=n(t,["isPage"]),i=o,a=o;return r?e.createElement(Pe,Object.assign({},i)):e.createElement(ze,Object.assign({},a))}const Ue=e=>e,Ne=e=>e,Re=e=>e,qe=e=>e,Ae=e=>e,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;var We=Object.freeze({__proto__:null}),Ke=Object.freeze({__proto__:null}),Ye=Object.freeze({__proto__:null}),Ze=Object.freeze({__proto__:null});export{re as CloudinaryBackgroundImage,be as CloudinaryImage,Se as Component,We as Core,Ke as Fields,xe as GriddoBackgroundImage,we as GriddoImage,Ie as GriddoLink,Ce as LdJson,_e as Link,Pe as Page,U as PageContext,N as PageProvider,Le as Preview,Ye as Schema,P as SiteContext,L as SiteProvider,Ze as Theme,Ue as createComponentSchema,Ne as createContentTypeSchema,Re as createDamDefaultsSchema,qe as createDataPackCategorySchema,Ae as createDataPackSchema,Te as createFooterSchema,Me as createHeaderSchema,De as createLanguagesSchema,He as createMenuSchema,Fe as createModuleCategoriesSchema,Be as createModuleSchema,Ge as createTemplateSchema,Ve as createThemesSchema,Je as createTranslationsSchema,ye as getComponent,E as getLang,w as getSiteID,x as getToken,A as useContentType,D as useDataFilters,q as useDistributorData,u as useGlobalTheme,F as useGriddoImage,V as useI18n,W as useImage,Y as useLink,Q as useList,ee as useNavigation,R as usePage,q as useReferenceFieldData,G as useSite,te 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:"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 R(){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 q(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}=R();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&&q(e)||t}const T=e.createContext(null);function M(t){return e.createElement(T.Provider,{value:{isNavigation:!0}},t.children)}function D(){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}=R(),[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 H={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]};function F(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({},H),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];return{srcSet:f,srcSetURL:v,src:`${l(Object.assign({damId:p,imageConfig:g},h))}`,sizes:m,webpFallback:B({srcSet:f,srcSetURL:v,format:"jpeg"}),jpeg:B({srcSet:f,srcSetURL:v,format:"jpeg"}),webp:B({srcSet:f,srcSetURL:v,format:"webp"}),avif:B({srcSet:f,srcSetURL:v,format:"avif"}),png:B({srcSet:f,srcSetURL:v,format:"png"}),gif:B({srcSet:f,srcSetURL:v,format:"gif"}),svg:B({srcSet:f,srcSetURL:v,format:"svg"})}}function B({srcSet:e,srcSetURL:t,format:n}){return{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 G=()=>e.useContext(P);function V(t){const n=null==t?void 0:t.locale,r=e.useContext(C),{siteLangs:o}=G(),{languageId:i}=R(),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 J={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 W(e){var t,r,{publicId:o}=e,a=n(e,["publicId"]);const{cloudinaryCloudName:l,cloudinaryDefaults:s}=G(),c=Object.assign(Object.assign(Object.assign({},J),s),a),u=`${c.domain}/${l}/${c.uploadFolder}`,d=`${K({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})=>`${K({root:u,imageConfig:Object.assign(Object.assign({},c),{quality:n,crop:r,width:e,height:t})})}/${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:`${K(Object.assign({root:u,imageConfig:c},m))}/${o}`,srcSet:p,sizes:g,fallbackSrcImage:d,srcSetURL:f}}function K(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}`:"";return`${t}/${`${r},${a},${l},${o},${s},${c},${u}`.split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",")}`}function Y(){const t=e.useContext(P);return null==t?void 0:t.linkComponent}const Z=["or","and"];function Q(){const{publicApiUrl:t,siteId:n,renderer:r}=G(),{languageId:o}=R(),[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:X(f)?f:null,filterOperator:X(u)?u:null,globalOperator:X(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 X(e){return!!e&&Z.includes(e.toLowerCase())}function ee(){return e.useContext(T)}function te(){const[t,n]=e.useState(),[o,i]=e.useState(!0),{apiUrl:a,header:l,footer:s,fullPath:c}=R(),{siteMetadata:u}=G();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 ne(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 re(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}=G(),b=Object.assign(Object.assign(Object.assign(Object.assign({},h),o),v),{backgroundLazy:h.backgroundLazy||o.backgroundLazy||m}),{srcSetURL:y}=W({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 oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ie(e,t){return e(t={exports:{}},t.exports),t.exports}ne('.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 ae=Symbol.for("react.element"),le=Symbol.for("react.fragment"),se=Object.prototype.hasOwnProperty,ce=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ue={key:!0,ref:!0,__self:!0,__source:!0};function de(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)se.call(t,r)&&!ue.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:ae,type:e,key:i,ref:a,props:o,_owner:ce.current}}var pe={Fragment:le,jsx:de,jsxs:de},ge=ie((function(e){e.exports=pe})),fe=ie((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,ge.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}));oe(fe);var me=ie((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,ge.jsx)("div",r({className:t,style:c},s,{children:i}))};t.default=i}));oe(me);var ve=ie((function(e,t){t.__esModule=!0,t.default=t.AspectRatio=void 0;var n=o(fe),r=o(me);function o(e){return e&&e.__esModule?e:{default:e}}var i=n.default;t.default=i;var a=r.default;t.AspectRatio=a}));oe(ve);var he=ve.AspectRatio;function be(t){const{alt:n,width:r,height:i,ratio:a,fixed:l,publicId:s,src:c,objectFit:u="cover"}=t,{cloudinaryDefaults:d}=G(),p=Object.assign(Object.assign(Object.assign({},o),d),t),{srcSet:g,sizes:f,src:m}=W({crop:p.crop,format:p.format,gravity:p.gravity,quality:p.quality,sizes:p.sizes,responsive:p.responsive,width:r,height:i,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(he,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(j,null))}ne('[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 ye=(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)},je=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"})),Oe=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"}));ne('.--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 $e=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(Oe,{className:"svg-action"})),e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.deleteModuleAction(s)}},e.createElement(je,{className:"svg-action"}))),u))};function Se(t){var r,{libComponents:o}=t,i=n(t,["libComponents"]);const{component:a,editorID:l,type:s,parentEditorID:c}=i,{renderer:u}=G(),d=null===(r=ee())||void 0===r?void 0:r.isNavigation,p="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||"0"):null,g=ye(o,Object.assign({},i)),f=d&&!["Header","Footer"].includes(a);return"editor"===u?e.createElement($e,{selectedEditorID:p,isSelectionAllowed:!f,editorID:l,component:a,type:s,parentEditorID:c},g?e.createElement(g,Object.assign({},i)):e.createElement(e.Fragment,null)):g&&e.createElement(g,Object.assign({},i))}ne('.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 xe=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}=G(),$=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))}));ne('[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 we=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}=G()||{},j=Object.assign(Object.assign({},y),{quality:p,crop:g,format:f,formats:m,position:v,transforms:h}),{src:O,sizes:$,avif:S,jpeg:x,gif:w,webp:E,svg:k}=F({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;return e.createElement("picture",{ref:r},j.formats.includes("avif")&&e.createElement("source",{srcSet:null===(t=null==S?void 0:S.srcSet)||void 0===t?void 0:t.join(","),sizes:$}),j.formats.includes("webp")&&e.createElement("source",{srcSet:null===(n=null==E?void 0:E.srcSet)||void 0===n?void 0:n.join(","),sizes:$}),e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:u||j.decoding,sizes:$,srcSet:null===(a=null==x?void 0:x.srcSet)||void 0===a?void 0:a.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(he,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(_,null)):null})),Ee="pre",ke="pro";function Ie(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}=G(),{fullPath:v}=R(),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}`))?ke:Ee}(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===Ee){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===ke&&(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=j?y:!h&&!$&&k||"";return b?e.createElement("a",Object.assign({target:E,rel:w,href:b,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 Ce(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 _e(t){const{url:r,linkProp:o="to",children:i}=t,a=n(t,["url","linkProp","children"]),{fullUrl:l}=R(),s=Y()||"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 ze(t){const{component:n,content:r,library:{components:o}}=t;return r?e.createElement(Se,Object.assign({libComponents:o,component:n},r)):null}function Pe(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},e.createElement(e.Fragment,null,!!a&&e.createElement(M,null,e.createElement(Se,Object.assign({libComponents:c},a))),e.createElement(p,Object.assign({},o.template)),!!i&&e.createElement(M,null,e.createElement(Se,Object.assign({libComponents:c},i)))))}function Le(t){const{isPage:r=!1}=t,o=n(t,["isPage"]),i=o,a=o;return r?e.createElement(Pe,Object.assign({},i)):e.createElement(ze,Object.assign({},a))}const Ue=e=>e,Ne=e=>e,Re=e=>e,qe=e=>e,Ae=e=>e,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;var Ye=Object.freeze({__proto__:null}),Ze=Object.freeze({__proto__:null}),Qe=Object.freeze({__proto__:null}),Xe=Object.freeze({__proto__:null});export{re as CloudinaryBackgroundImage,be as CloudinaryImage,Se as Component,Ye as Core,Ze as Fields,xe as GriddoBackgroundImage,we as GriddoImage,Ie as GriddoLink,Ce as LdJson,_e as Link,Pe as Page,U as PageContext,N as PageProvider,Le as Preview,Qe as Schema,P as SiteContext,L as SiteProvider,Xe as Theme,qe as createCategoryContentTypeSchema,Ue as createComponentSchema,Ae as createDamDefaultsSchema,Te as createDataPackCategorySchema,Me as createDataPackSchema,De as createFooterSchema,He as createHeaderSchema,Fe as createLanguagesSchema,Be as createMenuSchema,Ge as createModuleCategoriesSchema,Ve as createModuleSchema,Re as createPageContentTypeSchema,Ne as createSimpleContentTypeSchema,Je as createTemplateSchema,We as createThemesSchema,Ke as createTranslationsSchema,ye as getComponent,E as getLang,w as getSiteID,x as getToken,A as useContentType,D as useDataFilters,q as useDistributorData,u as useGlobalTheme,F as useGriddoImage,V as useI18n,W as useImage,Y as useLink,Q as useList,ee as useNavigation,R as usePage,q as useReferenceFieldData,G as useSite,te as useSitemap,d as useTheme,y as useThemeColors,O as useThemeFont,j as useThemePrimitives};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type NonEmptyArray<T> = [T, ...T[]];
|
package/dist/types/core.d.ts
CHANGED
|
@@ -22,64 +22,70 @@ export interface SiteLanguage {
|
|
|
22
22
|
isDefault: boolean;
|
|
23
23
|
}
|
|
24
24
|
export interface Page {
|
|
25
|
-
/** Page slug */
|
|
26
|
-
siteSlug?: string;
|
|
27
|
-
/** First module of the page if appeared in a section called `HeroSection`
|
|
28
|
-
* @deprecated To deprecated due to coupling with the section name */
|
|
29
|
-
firstModule?: string;
|
|
30
25
|
/** Private API url */
|
|
31
26
|
apiUrl?: string;
|
|
32
|
-
/** Id of the page language */
|
|
33
|
-
languageId?: number;
|
|
34
|
-
siteMetadata?: {
|
|
35
|
-
siteUrl: string;
|
|
36
|
-
title: string;
|
|
37
|
-
favicon: string;
|
|
38
|
-
};
|
|
39
|
-
componentList?: Array<string>;
|
|
40
|
-
structuredDataContent?: Record<string, unknown>;
|
|
41
|
-
language?: PageLanguage;
|
|
42
|
-
activeSectionSlug?: string;
|
|
43
27
|
activeSectionBase?: string;
|
|
44
|
-
|
|
45
|
-
setAsHome?: boolean;
|
|
46
|
-
entity?: string;
|
|
47
|
-
site: number;
|
|
48
|
-
title: string;
|
|
49
|
-
slug: string;
|
|
28
|
+
activeSectionSlug?: string;
|
|
50
29
|
author?: number;
|
|
51
|
-
|
|
30
|
+
availableSites?: Array<{
|
|
31
|
+
id: number;
|
|
32
|
+
name: string;
|
|
33
|
+
}>;
|
|
34
|
+
breadcrumb?: Breadcrumb;
|
|
35
|
+
canBeUnpublished?: boolean;
|
|
52
36
|
canonicalURL?: string;
|
|
53
|
-
|
|
54
|
-
|
|
37
|
+
component?: "Page";
|
|
38
|
+
componentList?: Array<string>;
|
|
55
39
|
deleted?: boolean;
|
|
40
|
+
dimensions?: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
draftFromPage?: unknown;
|
|
44
|
+
editable?: boolean;
|
|
45
|
+
editing?: {
|
|
46
|
+
id: number;
|
|
47
|
+
name: string;
|
|
48
|
+
username: string;
|
|
49
|
+
email: string;
|
|
50
|
+
};
|
|
51
|
+
entity?: string;
|
|
52
|
+
/** First module of the page if appeared in a section called `HeroSection`
|
|
53
|
+
* @deprecated To deprecated due to coupling with the section name */
|
|
54
|
+
firstModule?: string;
|
|
56
55
|
follow?: boolean;
|
|
57
|
-
header: LibraryComponentProps;
|
|
58
56
|
footer: LibraryComponentProps;
|
|
57
|
+
fullPath?: {
|
|
58
|
+
site: string;
|
|
59
|
+
domain: string;
|
|
60
|
+
domainUrl: string;
|
|
61
|
+
language: string;
|
|
62
|
+
page: string;
|
|
63
|
+
compose: string;
|
|
64
|
+
};
|
|
65
|
+
fullUrl?: string;
|
|
66
|
+
hash?: string;
|
|
67
|
+
haveDraftPage?: unknown;
|
|
68
|
+
header: LibraryComponentProps;
|
|
69
|
+
id?: number;
|
|
70
|
+
isHome?: boolean;
|
|
59
71
|
isIndexed?: boolean;
|
|
72
|
+
language?: PageLanguage;
|
|
73
|
+
/** Id of the page language */
|
|
74
|
+
languageId?: number;
|
|
75
|
+
liveChanged?: boolean;
|
|
60
76
|
liveStatus?: {
|
|
61
77
|
id: 1 | 2 | 3 | 4 | 5 | 6;
|
|
62
78
|
title: string;
|
|
63
79
|
status: "offline" | "upload-pending" | "active" | "offline-pending" | "modified" | "scheduled";
|
|
64
80
|
};
|
|
65
81
|
locale?: unknown;
|
|
82
|
+
manuallyImported?: boolean;
|
|
66
83
|
metaDescription?: string;
|
|
67
|
-
metaTitle?: string;
|
|
68
84
|
metasAdvanced?: string;
|
|
69
|
-
|
|
70
|
-
socialDescription?: string;
|
|
71
|
-
socialImage?: ImageField;
|
|
72
|
-
template: {
|
|
73
|
-
type: string;
|
|
74
|
-
templateType: string;
|
|
75
|
-
activeSectionSlug: string;
|
|
76
|
-
activeSectionBase: string;
|
|
77
|
-
[key: string]: any;
|
|
78
|
-
};
|
|
79
|
-
url?: string;
|
|
80
|
-
workflowStatus?: unknown;
|
|
85
|
+
metaTitle?: string;
|
|
81
86
|
modified?: string;
|
|
82
|
-
|
|
87
|
+
noTranslate?: boolean;
|
|
88
|
+
origin?: string;
|
|
83
89
|
pageLanguages?: Array<{
|
|
84
90
|
siteId: number;
|
|
85
91
|
languageId: number;
|
|
@@ -98,42 +104,37 @@ export interface Page {
|
|
|
98
104
|
compose: string;
|
|
99
105
|
};
|
|
100
106
|
}>;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
canBeUnpublished?: boolean;
|
|
112
|
-
editing?: {
|
|
113
|
-
id: number;
|
|
114
|
-
name: string;
|
|
115
|
-
username: string;
|
|
116
|
-
email: string;
|
|
107
|
+
parent?: unknown;
|
|
108
|
+
path?: string;
|
|
109
|
+
published?: string;
|
|
110
|
+
sectionModules?: Record<string, Array<string>>;
|
|
111
|
+
setAsHome?: boolean;
|
|
112
|
+
site: number;
|
|
113
|
+
siteMetadata?: {
|
|
114
|
+
siteUrl: string;
|
|
115
|
+
title: string;
|
|
116
|
+
favicon: string;
|
|
117
117
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
/** Page slug */
|
|
119
|
+
siteSlug?: string;
|
|
120
|
+
slug: string;
|
|
121
|
+
socialDescription?: string;
|
|
122
|
+
socialImage?: ImageField;
|
|
123
|
+
socialTitle?: string;
|
|
124
|
+
structuredData?: unknown;
|
|
125
|
+
structuredDataContent?: Record<string, unknown>;
|
|
126
|
+
template: {
|
|
127
|
+
type: string;
|
|
128
|
+
templateType: string;
|
|
129
|
+
activeSectionSlug: string;
|
|
130
|
+
activeSectionBase: string;
|
|
123
131
|
[key: string]: any;
|
|
124
132
|
};
|
|
125
|
-
readonly breadcrumb?: Breadcrumb;
|
|
126
|
-
readonly path?: string;
|
|
127
|
-
readonly fullPath?: {
|
|
128
|
-
site: string;
|
|
129
|
-
domain: string;
|
|
130
|
-
domainUrl: string;
|
|
131
|
-
language: string;
|
|
132
|
-
page: string;
|
|
133
|
-
compose: string;
|
|
134
|
-
};
|
|
135
|
-
readonly fullUrl?: string;
|
|
136
133
|
templateConfig?: unknown;
|
|
134
|
+
templateId?: string;
|
|
135
|
+
title: string;
|
|
136
|
+
url?: string;
|
|
137
|
+
workflowStatus?: unknown;
|
|
137
138
|
}
|
|
138
139
|
export interface CloudinaryDefaults extends Partial<Pick<CloudinaryImageProps, "quality" | "crop" | "gravity" | "format" | "loading" | "decoding" | "sizes" | "responsive">> {
|
|
139
140
|
domain?: string;
|
package/dist/types/fields.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare type FileField = {
|
|
|
21
21
|
/** Upload date */
|
|
22
22
|
uploadDate?: string;
|
|
23
23
|
};
|
|
24
|
-
export declare type HeadingField<HeadingTagsType = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
|
|
24
|
+
export declare type HeadingField<HeadingTagsType = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"> = {
|
|
25
25
|
/** Text content */
|
|
26
26
|
content?: string;
|
|
27
27
|
/** HTML tag used to render the content */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithDisabled, WithEntity, WithGroup,
|
|
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
3
|
interface GenericField {
|
|
4
4
|
/** Sets the field type. */
|
|
@@ -118,12 +118,12 @@ export interface BaseHeadingField extends GenericField {
|
|
|
118
118
|
advanced?: boolean;
|
|
119
119
|
/** Field defaults. */
|
|
120
120
|
default: {
|
|
121
|
-
tag:
|
|
121
|
+
tag: HTMLHeadingTag;
|
|
122
122
|
content: string;
|
|
123
123
|
};
|
|
124
124
|
/** Array of options that will appear in the Select. */
|
|
125
125
|
options: Array<{
|
|
126
|
-
value:
|
|
126
|
+
value: HTMLHeadingTag;
|
|
127
127
|
label: string;
|
|
128
128
|
}>;
|
|
129
129
|
}
|
|
@@ -22,7 +22,7 @@ export declare type WithHideable = {
|
|
|
22
22
|
/** If `true` the field can be hidden in the editor. */
|
|
23
23
|
hideable?: boolean;
|
|
24
24
|
};
|
|
25
|
-
export declare type
|
|
25
|
+
export declare type HTMLHeadingTag = "h1" | "h2" | "h3" | "h4";
|
|
26
26
|
export declare type WithIndexable = {
|
|
27
27
|
/** Default is false. If that field is to be used as an index (to be able to sort by that field, etc.) */
|
|
28
28
|
indexable?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Categories } from "./Categories";
|
|
2
2
|
import { PageContentType } from "./PageContentType";
|
|
3
3
|
import { SimpleContentType } from "./SimpleContentType";
|
|
4
|
-
export
|
|
4
|
+
export { PageContentType, SimpleContentType, Categories as CategoryContentType, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageContentType, CategoryContentType, SimpleContentType } from "./ContentType";
|
|
2
2
|
import { DamDefaults } from "./DamDefaults";
|
|
3
3
|
import { DataPack } from "./DataPack";
|
|
4
4
|
import { DataPackCategory } from "./DataPackCategory";
|
|
@@ -9,4 +9,4 @@ import { ModuleCategories } from "./ModuleCategories";
|
|
|
9
9
|
import { Themes } from "./Themes";
|
|
10
10
|
import { Translations } from "./Translations";
|
|
11
11
|
import { Component, Module, Template } from "./UI";
|
|
12
|
-
export {
|
|
12
|
+
export { CategoryContentType, Component, DamDefaults, DataPack, DataPackCategory, Footer, Header, Languages, Menu, Module, ModuleCategories, PageContentType, SimpleContentType, Template, Themes, Translations, };
|
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.2",
|
|
6
6
|
"authors": [
|
|
7
7
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
8
8
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"resolutions": {
|
|
73
73
|
"colors": "1.4.0"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "f2d7e58bd884b6fb5472d1127975fd806f936e17"
|
|
76
76
|
}
|