@griddo/core 1.67.10 → 1.68.0

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 CHANGED
@@ -1 +1,81 @@
1
1
  # Griddo Core
2
+
3
+ Componentes, hooks, utilidades e implementaciones comunes para todo Griddo y las instancias.
4
+
5
+ ## Componentes
6
+
7
+ - `<CloudinaryBackgroundImage />`
8
+ - `<CloudinaryImage />`
9
+ - `<Component />`
10
+ - `<GriddoBackgroundImage />`
11
+ - `<GriddoImage />`
12
+ - `<GriddoLink />`
13
+ - `<LdJson />`
14
+ - `<ModulePreview />`
15
+ - `<Page />`
16
+ - `<Preview />`
17
+ - `<RichText />`
18
+
19
+ ## Contextos
20
+
21
+ - I18n
22
+ - Page
23
+ - Site
24
+
25
+ ## Hooks
26
+
27
+ - `useAvif()`
28
+ - `useDataFilters()`
29
+ - `useDistributorData()`
30
+ - `useGriddoImage()`
31
+ - `useI18n()`
32
+ - `useImage()`
33
+ - `useLink()`
34
+ - `usePage()`
35
+ - `usePage()`
36
+ - `useSite()`
37
+ - `useSitemap()`
38
+ - `useWebp()`
39
+
40
+ ## Funciones para schemas
41
+
42
+ Pretenden facilitar la creación de schemas, utilizando funciones y tipado en TypeScript. Activando sugerencias, autocompletado y checking en el editor. (Probado en VSCode)
43
+
44
+ Las instancias que no usen TypeScript deben añadir la "directiva" `// @ts-check` para que el intellisense funcione como si se estuviera en un entorno TypeScript.
45
+
46
+ ```javascript
47
+ // @ts-check
48
+ import { createUISchema } from "@griddo/core";
49
+
50
+ export default createUISChema({
51
+ component: "BascicContent",
52
+ ...
53
+ });
54
+ ```
55
+
56
+ <br/>
57
+ <br/>
58
+
59
+ <p align='center'><strong>Autocompletado FTW!</strong></p>
60
+
61
+ <p align="center">
62
+ <img src="./src/assets/autocomplete.png" width='600'/>
63
+ </p>
64
+
65
+ <br/>
66
+ <br/>
67
+
68
+ ### Funciones
69
+
70
+ - `createCategoriesSchema`: Crea un schema para un dato de tipo categoría (taxonomy).
71
+ - `createDamDefaultsSchema`: Crea un schema para las opciones por defecto del DAM.
72
+ - `createDataPackCategoriesSchema`: Crea un schema para una categoría de DataPack.
73
+ - `createDataPackSchema`: Crea un schema para un DataPack.
74
+ - `createLanguagesSchema`: Crea un schema para los idiomas de la instancia.
75
+ - `createMenuSchema`: Crea un schema para un menú.
76
+ - `createModuleCategoriesSchema`: Crea un schema de categorías de módulos.
77
+ - `createPageDataSchema`: Crea un schema de UI para un dato estructurado de página.
78
+ - `createPureDataSchema`: Crea un schema de UI para un dato estructurado puro.
79
+ - `createThemesSchema`: Crea un schema para los temas.
80
+ - `createTranslationsSchema`: Crea un schema de traducciones estáticas (i18n)
81
+ - `createUISchema`: Crea un schema de UI para un componente, módulo o template.
@@ -0,0 +1,62 @@
1
+ import { CategoriesSchema, DamDefaultsSchema, DataPackCategoriesSchema, DataPackSchema, LanguagesSchema, MenuSchema, ModuleCategoriesSchema, PageDataSchema, PureDataSchema, ThemesSchema, TranslationsSchema, UISchema } from "./types/schemas";
2
+ /**
3
+ * Crea un schema para una categoría
4
+ * @param {object} schema - Un schema con el formato Schema categories
5
+ */
6
+ declare function createCategoriesSchema(schema: CategoriesSchema): CategoriesSchema;
7
+ /**
8
+ * Crea un schema para los valores por defecto del DAM
9
+ * @param {object} schema - Un schema con el formato Schema DAM
10
+ */
11
+ declare function createDamDefaultsSchema(schema: DamDefaultsSchema): DamDefaultsSchema;
12
+ /**
13
+ * Crea un schema para una categoría de data pack
14
+ * @param {object} schema - Un schema con el formato Schema data pack categories
15
+ */
16
+ declare function createDataPackCategoriesSchema(schema: DataPackCategoriesSchema): DataPackCategoriesSchema;
17
+ /**
18
+ * Crea un schema para un data pack
19
+ * @param {object} schema - Un schema con el formato Schema data pack
20
+ */
21
+ declare function createDataPackSchema(schema: DataPackSchema): DataPackSchema;
22
+ /**
23
+ * Crea un schema para una categoría
24
+ * @param {object} schema - Un schema con el formato Schema categories
25
+ */
26
+ export default function createLanguagesSchema(schema: LanguagesSchema): LanguagesSchema;
27
+ /**
28
+ * Crea un schema para un menú
29
+ * @param {object} schema - Un schema con el formato Schema menú
30
+ */
31
+ declare function createMenuSchema(schema: MenuSchema): MenuSchema;
32
+ /**
33
+ * Crea un schema para las categorías de módulos
34
+ * @param {object} schema - Un schema con el formato Schema categoría de módulo
35
+ */
36
+ declare function createModuleCategoriesSchema(schema: ModuleCategoriesSchema): ModuleCategoriesSchema;
37
+ /**
38
+ * Crea un schema para un dato structurado de página
39
+ * @param {object} schema - Un schema con el formato Schema Page Data
40
+ */
41
+ declare function createPageDataSchema(schema: PageDataSchema): PageDataSchema;
42
+ /**
43
+ * Crea un schema para un dato structurado puro
44
+ * @param {object} schema - Un schema con el formato Schema Data
45
+ */
46
+ declare function createPureDataSchema(schema: PureDataSchema): PureDataSchema;
47
+ /**
48
+ * Crea un schema para un theme
49
+ * @param {object} schema - Un schema con el formato Schema theme
50
+ */
51
+ declare function createThemesSchema(schema: ThemesSchema): ThemesSchema;
52
+ /**
53
+ * Crea un schema para las traducciones estáticas
54
+ * @param {object} schema - Un schema con el formato Schema de traducciones
55
+ */
56
+ declare function createTranslationsSchema(schema: TranslationsSchema): TranslationsSchema;
57
+ /**
58
+ * Crea un schema para un componente, módulo o template
59
+ * @param {object} schema - Un schema con el formato Schema UI
60
+ */
61
+ declare function createUISchema(schema: UISchema): UISchema;
62
+ export { createCategoriesSchema, createDamDefaultsSchema, createDataPackCategoriesSchema, createDataPackSchema, createLanguagesSchema, createMenuSchema, createModuleCategoriesSchema, createPageDataSchema, createPureDataSchema, createThemesSchema, createTranslationsSchema, createUISchema, };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import*as t from"react";import e,{createContext as n,useContext as r,useRef as o,useState as a,useEffect as i}from"react";import c from"react-markdown";function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function d(t,e,n,r,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void n(t)}c.done?e(l):Promise.resolve(l).then(r,o)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){d(a,r,o,i,c,"next",t)}function c(t){d(a,r,o,i,c,"throw",t)}i(void 0)}))}}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A(){return A=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},A.apply(this,arguments)}function g(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||h(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var b=n(null),S=function(t){var n=t.children,r=t.translations;return e.createElement(b.Provider,{value:{translations:r}},n)};b.Consumer;var w=["activeStyle","activeClassName","getProps","partiallyActive","children","to"],x=["children"];function E(e){e.activeStyle,e.activeClassName,e.getProps,e.partiallyActive;var n=e.children;e.to;var r=g(e,w);return t.createElement("a",A({"data-griddo":"link"},r),n)}function I(t){}var k=t.createContext(null),j=function(e){var n=e.children,r=g(e,x);return t.createElement(k.Provider,{value:u({linkComponent:E,navigate:I},r)},n)},O=k.Consumer,C=n(null),B=function(t){var n=r(k),o=null==n?void 0:n.translations;return e.createElement(C.Provider,{value:u({},t)},e.createElement(S,{translations:o},t.children))},P=C.Consumer;function U(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"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=t:o.appendChild(document.createTextNode(t))}}U('.--selected {\n display: block;\n position: relative;\n}\n\n.--selected::before {\n position: absolute;\n height: calc(100% - 8px);\n width: calc(100% - 8px);\n padding-bottom: 4px;\n content: "";\n border: 4px solid rgb(80, 87, 255);\n pointer-events: none;\n z-index: 99;\n}\n\n.--selected::after {\n position: absolute;\n padding: 8px 16px;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n top: -34px;\n left: 50%;\n transform: translate(-50%, 0px);\n content: attr(data-text);\n z-index: 9;\n background: rgb(80, 87, 255);\n color: rgb(255, 255, 255);\n font-family: "Source Sans Pro", sans-serif;\n font-weight: 600;\n font-size: 14px;\n line-height: 18px;\n}\n');var z=function(t){var n=o(),c=m(a(),2),l=c[0],u=c[1],s=r(k).selectEditorID,d=t.selectedEditorID,f=t.editorID,p=t.component,A=t.children;i((function(){u(!!n&&n.current.scrollHeight)}),[A]),i((function(){v&&g()}),[n]);var g=function(){if(n.current){var t=n.current.style.position,e=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=e,n.current.style.position=t}},v=!!d&&d===f;return v&&g(),e.createElement(e.Fragment,null,"Header"===p&&e.createElement("style",{dangerouslySetInnerHTML:{__html:'\n [data-text="Header"].--selected::before {\n height: '.concat(l-8,"px;\n }")}}),e.createElement("span",{className:"".concat(v?"--selected":""),"data-text":p,ref:n,onClick:function(e){!f&&"0"!==f||"undefined"==typeof window||s&&s(t,void 0,e)}},A))},L=function(t,e){var n=e.component||e.id;return void 0!==t[n]?t[n]:(console.warn("The component <".concat(n,"> doesn't exist inside ").concat(JSON.stringify(Object.keys(t)))),null)},R=function(){return r(k)},_={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"faces:center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]},D=["damId","imageConfig"];var N=function(t){var e=t.filter((function(t){return null===t.breakpoint})),n=t.filter((function(t){return null!==t.breakpoint}));return[].concat(v(n),v(e))},G=function(t){return t?t.toString().split(/cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%/)[0]:""},q=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return t[1]})))},T=function(t,e){return u(u({},q(t)),q(e))};function Q(t){var e,n,r,o,a,i,c,l=t.damId,u=t.imageConfig,s=g(t,D),d=T(u,s),f=d.crop?"c/".concat(d.crop):"",p=d.quality?"q/".concat(d.quality):"",A=d.format?"f/".concat(d.format):"",v=d.width?"w/".concat(G(d.width)):"",h=d.height?"h/".concat(G(d.height)):"",y=d.position?"p/".concat(d.position):"",b=null!==(e=d.transforms)&&void 0!==e&&e.length?"t/".concat(d.transforms):"",S="".concat(f,"/").concat(p,"/").concat(v,"/").concat(h,"/").concat(y,"/").concat(b,"/").concat(A);return n="".concat(u.domain,"/").concat(S,"/").concat(l),o=m(null==n?void 0:n.split(/(^https?:\/\/|^\/\/)/).filter(Boolean),2),a=o[0],i=o[1],c=null==i||null===(r=i.replace(/\/\/+/g,"/"))||void 0===r?void 0:r.replace(/\/$/,""),"".concat(a).concat(c)}function F(t){return t&&"string"==typeof t?t.split(/(^[http:|https:|\/\/]*[\S][^\/]*)/)[1]:t}function M(t){return t&&"string"==typeof t?t.split("/").filter(Boolean).slice(-1)[0]:t}var W=["root","imageConfig"],J=["publicId"],Y=function(t){var e=t.root,n=t.imageConfig,r=g(t,W),o=T(n,r),a=o.crop?"c_".concat(o.crop):"",i=o.quality?"q_".concat(o.quality):"",c=o.gravity?"g_".concat(o.gravity):"",l=o.format?"f_".concat(o.format):"",u=o.width?"w_".concat(G(o.width)):"",s=o.height?"h_".concat(G(o.height)):"",d=o.ar?"ar_".concat(o.ar):"",f="".concat(a,",").concat(c,",").concat(l,",").concat(i,",").concat(u,",").concat(s,",").concat(d).split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",");return"".concat(e,"/").concat(f)},H=function(t){var e=t.publicId,n=g(t,J),r=R(),o=r.cloudinaryCloudName,a=r.cloudinaryDefaults,i=u(u(u({},_),a),n),c="".concat(i.domain,"/").concat(o,"/").concat(i.uploadFolder),l="".concat(Y({root:c,imageConfig:i,quality:20,width:"512"}),"/").concat(i.fallback404ImageId),s=i.responsive.map((function(t){var n=t.width,r=t.height,o=t.quality,a=t.crop,l=Y({root:c,imageConfig:i,quality:o,crop:a,width:n,height:r});return"".concat(l,"/").concat(e," ").concat(G(n),"w")})),d=N(i.responsive.reverse()).map((function(t,e){return e<i.responsive.length-1?"(min-width: ".concat(t.breakpoint,") ").concat(t.width):"".concat(t.width)})).join(", "),f=s.map((function(t){return t.split(" ")[0]})),p=i.responsive[0];return{src:"".concat(Y(u({root:c,imageConfig:i},p)),"/").concat(e),srcSet:s,sizes:d,fallbackSrcImage:l,srcSetURL:f}};function X(){return r(k).linkComponent}var Z={firstModule:"",siteSlug:"/",title:"Default page provider title",breadcrumb:[],fullPath:"/",apiUrl:"/",fullUrl:"/",languageId:null,pageLanguages:[]};function V(){var t,e=r(C),n=null==e||null===(t=e.pageLanguages)||void 0===t?void 0:t.filter((function(t){return t.isLive}));return e?u(u({},e),{},{pageLanguages:n}):(console.warn("Griddo: You forgot to put <PageProvider>."),u(u({},Z),{},{pageLanguages:n}))}var K=function(t,e){return!!t.find((function(t){return t.id===e}))},$=function(t,e){var n;return(null===(n=t.find((function(t){return t.id===e})))||void 0===n?void 0:n.locale)||"xx_XX"},tt=function(t,e){return!!t.find((function(t){return(null==t?void 0:t.locale)===e}))},et={languageId:"internalLangId",siteLangs:[{id:"internalLangId",locale:"xx_XX"}],translations:{xx_XX:{griddo:"griddo"}}},nt=function(t,e){return null==t?void 0:t.split(".").reduce((function(t,e){return t[e]?t[e]:""}),e)},rt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.locale,n=R(),o=(null==n?void 0:n.siteLangs)||et.siteLangs,a=V(),i=(null==a?void 0:a.languageId)||et.languageId,c=r(b),l=(null==c?void 0:c.translations)||et.translations;l||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"),K(o,i)||console.warn("Griddo: languageId ".concat(i," doesn't exist in this site")),void 0===e||tt(o,e)||console.warn("Griddo: locale ".concat(e," doesn't exist in this site"));var u=e||$(o,i),s=l?l[u]:void 0,d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return s&&s[t]||e},f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return s&&nt(t,s)||e};return u&&i?{getTranslation:d,getNestedTranslation:f}:(console.warn("Griddo: You forgot to put <I18nProvider> or exists an error in language id."),{})},ot=function(t){return function(t,e){var n=parseFloat(t.match(/\d*\.?\d*/)[0]),r=t.split(n.toString())[1],o=e(n);return"".concat(o).concat(r)}(t,(function(t){return t/2}))},at=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n="#"===t[0]?t.substring(1,7):t,r=parseInt(n.substring(0,2),16),o=parseInt(n.substring(2,4),16),a=parseInt(n.substring(4,6),16);return"rgba(".concat(r,", ").concat(o,", ").concat(a,", ").concat(e,")")},it=function(t,e,n){return n?e===n?"":"".concat(t,": ").concat(n,";"):""},ct=function(t,e,n){return e?"".concat(t,": ").concat(e,";"):n?"".concat(t,": ").concat(n,";"):""},lt=function(t){try{var e=t.mediaquery.mediaqueries,n={};return e.forEach((function(t){if("default"!==t.label){var e=t.minWidth?"and (min-width: ".concat(t.minWidth,")"):"",r=t.maxWidth?"and (max-width: ".concat(t.maxWidth,")"):"";n[t.label]="@media only screen ".concat(e," ").concat(r)}})),n}catch(t){return null}},ut=function(t){try{return t.fontFamily.fontFamilies}catch(t){return null}},st=function(t){return"string"==typeof t?t.match(/\d*\.?\d+?/)[0]:"number"==typeof t?t:void 0},dt=function(t,e){return'\n &::before, &::after {\n content: "";\n display: block;\n }\n &::before {\n margin-bottom: '.concat(e,"em;\n }\n &::after {\n margin-top: ").concat(t,"em;\n }\n ")},ft=function(t){try{return v(new Set(t.textStyle.textStyles.map((function(t){return t.fontSize})).filter(Boolean).reverse().map((function(t){return Number(t.split("px")[0])})).sort((function(t,e){return t-e}))))}catch(t){return null}},pt=function(t){if(t.spacing&&Object.keys(t.spacing).length)return Object.entries(t.spacing).reduce((function(t,e){var n=m(e,2),r=n[0],o=n[1];return u(u({},t),{},p({},r,"string"==typeof o?"-".concat(o):void 0))}),{})},At=function(t){if(t.spacing&&Object.keys(t.spacing).length)return Object.entries(t.spacing).reduce((function(t,e){var n=m(e,2),r=n[0],o=n[1];return u(u({},t),{},p({},r,"string"==typeof o?ot(o):void 0))}),{})},gt=function(t){if(t.spacing&&Object.keys(t.spacing).length)return Object.entries(t.spacing).reduce((function(t,e){var n,r=m(e,2),o=r[0],a=r[1];return u(u({},t),{},p({},o,"string"==typeof a?(n=ot(a),"-".concat(n)):void 0))}),{})},mt=function(t){var e=function(t){try{var e=t.color.colors;return Object.keys(e).reduce((function(t,n){var r,o=function(t){return 1===t.opacity||void 0===t.opacity||null===t.opacity},a=function(t){try{return"#"===t.value[0]}catch(t){return!1}},i=function(t){try{return"hsl"===t.type.toLowerCase()}catch(t){return!1}},c=function(t){try{return"rgb"===t.type.toLowerCase()}catch(t){return!1}};return r=e[n],i(r)&&!o(r)&&(t[n]="hsla(".concat(e[n].value.map((function(t,e){return"".concat(0===e?t:"string"==typeof t?-1===t.indexOf("%")?t+"%":t:t+"%")})).join(", "),", ").concat(e[n].opacity,")")),function(t){return i(t)&&o(t)}(e[n])&&(t[n]="hsl(".concat(e[n].value.map((function(t,e){return"".concat(0===e?t:"string"==typeof t?-1===t.indexOf("%")?t+"%":t:t+"%")})).join(", "),")")),function(t){return a(t)&&o(t)}(e[n])&&(t[n]="".concat(e[n].value)),function(t){return a(t)&&!o(t)}(e[n])&&(t[n]="".concat(at(e[n].value,e[n].opacity))),function(t){return c(t)&&o(t)}(e[n])&&(t[n]="rgb(".concat(e[n].value.join(", "),")")),function(t){return c(t)&&!o(t)}(e[n])&&(t[n]="rgba(".concat(e[n].value.join(", "),", ").concat(e[n].opacity,")")),t}),{})}catch(t){return null}}(t),n=function(t){try{var e=t.gradient.gradients;return Object.keys(e).reduce((function(t,n){return t[n]="linear-gradient(".concat(e[n].direction,", ").concat(e[n].stops.map((function(t){return"".concat(at(t.color,t.opacity)," ").concat(t.position)})).join(","),")"),t}),{})}catch(t){return null}}(t),r=function(t){try{var e=t.shadow.shadows;return Object.keys(e).reduce((function(t,n){return t[n]="".concat(e[n].x,"px ").concat(e[n].y,"px ").concat(e[n].blur,"px ").concat(at(e[n].color,e[n].opacity)),t}),{})}catch(t){return null}}(t),o=lt(t),a=function(t){try{var e=lt(t),n=ut(t),r=t.textStyle.defaultStyles,o=t.textStyle.textStyles,a={};return o.forEach((function(t){var o=st(t.fontSize),i=void 0!==t.croptop?t.croptop:0,c=void 0!==t.cropbottom?t.cropbottom:0,l=Math.max(i+o/2*0,0)/o*-1,u=Math.max(c+o/2*0,0)/o*-1;a[t.name]="\n\n ".concat(ct("font-family",n[t.fontFamily],n[r.fontFamily]),"\n ").concat(ct("font-size",t.fontSize,r.fontSize),"\n ").concat(ct("font-weight",t.fontWeight,r.fontWeight),"\n ").concat(ct("letter-spacing",t.letterSpacing,r.letterSpacing),"\n ").concat(ct("line-height",t.lineHeight,r.lineHeight),"\n ").concat(ct("font-style",t.fontStyle,r.fontStyle),"\n ").concat(ct("text-transform",t.textTransform,r.textTransform),"\n ").concat(i&&c?dt(l,u):"","\n \n ").concat(t.responsive?t.responsive.map((function(r,a){return o=st(r.fontSize),i=void 0!==r.croptop?r.croptop:0,c=void 0!==r.cropbottom?r.cropbottom:0,l=Math.max(i+o/2*0,0)/o*-1,u=Math.max(c+o/2*0,0)/o*-1,a<1?"\n ".concat(e[r.breakpoint]," {\n ").concat(it("font-family",n[t.fontFamily],n[r.fontFamily]),"\n ").concat(it("font-size",t.fontSize,r.fontSize),"\n ").concat(it("font-weight",t.fontWeight,r.fontWeight),"\n ").concat(it("line-height",t.lineHeight,r.lineHeight),"\n ").concat(it("letter-spacing",t.letterSpacing,r.letterSpacing),"\n ").concat(it("font-style",t.fontStyle,r.fontStyle),"\n ").concat(it("text-transform",t.textTransform,r.textTransform),"\n ").concat(i&&c?dt(l,u):"","\n }\n "):(o=st(r.fontSize),i=void 0!==r.croptop?r.croptop:0,c=void 0!==r.cropbottom?r.cropbottom:0,l=Math.max(i+o/2*0,0)/o*-1,u=Math.max(c+o/2*0,0)/o*-1,"\n ".concat(e[r.breakpoint]," {\n ").concat(it("font-family",n[t.responsive[a-1].fontFamily],n[r.fontFamily]),"\n ").concat(it("font-size",t.responsive[a-1].fontSize,r.fontSize),"\n ").concat(it("font-weight",t.responsive[a-1].fontWeight,r.fontWeight),"\n ").concat(it("line-height",t.responsive[a-1].lineHeight,r.lineHeight),"\n ").concat(it("letter-spacing",t.responsive[a-1].letterSpacing,r.letterSpacing),"\n ").concat(it("font-style",t.responsive[a-1].fontStyle,r.fontStyle),"\n ").concat(it("text-transform",t.responsive[a-1].textTransform,r.textTransform),"\n ").concat(i&&c?dt(l,u):"","\n }\n "))})).join(""):"","\n ")})),a}catch(t){return null}}(t),i=function(t){try{return t.mediaquery.mediaqueries.map((function(t){return t.minWidth})).filter(Boolean)}catch(t){return null}}(t),c=ut(t);try{t.mediaquery.mediaqueries.forEach((function(t){i[t.label]=t.minWidth}))}catch(t){}return u(u({},t),{},{fontFamily:c,color:e,colors:e,gradient:n,shadow:r,mq:o,textStyle:a,breakpoints:i,fontSizes:ft(t),negateSpacing:pt(t),halfSpacing:At(t),negateHalfSpacing:gt(t)})},vt=function(t,e){return(null==e?void 0:e.startsWith("".concat(t,"#")))?"#".concat(e.split("#")[1]):e},ht="undefined"!=typeof window,yt=function(){var t=ht&&JSON.parse(localStorage.getItem("persist:app"));if(!t)return null;var e=t.token;return e=JSON.parse(e),{Authorization:"bearer ".concat(e)}},bt=function(){var t,e=s(ht)&&JSON.parse(localStorage.getItem("persist:root"));if(!e)return 1;var n=e.sites;return null===(t=(n=JSON.parse(n)).currentSiteInfo)||void 0===t?void 0:t.id},St=function(){return ht&&parseInt(localStorage.getItem("langID"))};function wt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.obj,n=t.searchKey,r=t.results,o=void 0===r?[]:r,a=t.unique,i=void 0===a||a,c=o;return Object.keys(e).forEach((function(t){var r=e[t];t===n&&"object"!==s(r)?c.push(r):"object"===s(r)&&r&&wt({obj:r,searchKey:n,results:c})})),i?v(new Set(c)):c}function xt(t){var e=t.baseUrl,n=t.params,r=Object.keys(n).map((function(t){return function(t){return Array.isArray(t)&&t.length>0||"number"==typeof t||"string"==typeof t}(n[t])?"".concat(t,"/").concat(n[t]):""})).join("/");return"".concat(e).concat(r.split("/").filter(Boolean).join("/"))}var Et=function(t){var e=m(a(null),2),n=e[0],r=e[1],o=t||{},c=o.order,l=o.quantity,s=o.source,d=o.mode,p=o.fixed,A=o.filter,g=o.fullRelations,v=void 0!==g&&g,h=V().apiUrl;return i((function(){var t=!!St(),e=bt()||"global",n="".concat(h,"/site/").concat(e,"/distributor"),o=function(t){return{method:"POST",mode:"cors",cache:"no-cache",headers:u({"Content-Type":"application/json",lang:St()},yt()),redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(t)}}("auto"===d?{mode:d,order:c,quantity:l,source:s,filter:A,fullRelations:v}:{mode:d,fixed:p,fullRelations:v}),a=function(){var t=f(regeneratorRuntime.mark((function t(){var e,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(n,o);case 2:return e=t.sent,t.next=5,e.json();case 5:a=t.sent,r(a);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t&&a()}),[d,c,l,p,A,s,v]),n},It=function(){var t=m(a(),2),e=t[0],n=t[1],r=m(a(!0),2),o=r[0],c=r[1],l=V(),s=l.apiUrl,d=l.header,p=l.footer,A=l.fullPath,g=R().siteMetadata;i((function(){v()}),[]);var v=function(){var t=f(regeneratorRuntime.mark((function t(){var e,r,o,a,i,l,f,m,v,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((a={}).topMenu=[{label:null==g?void 0:g.title,children:null===(e=d.topMenu)||void 0===e?void 0:e.elements,url:{linkToURL:!!A&&"".concat(A.domainUrl).concat(A.site)}}],g){t.next=13;break}return i=bt(),l="".concat(s,"/site/").concat(i),t.next=7,fetch(l,{method:"GET",mode:"cors",cache:"no-cache",headers:u({"Content-Type":"application/json",lang:St()},yt())});case 7:return f=t.sent,t.next=10,f.json();case 10:m=t.sent,v=m.name,a.topMenu[0].label=v;case 13:a.mainMenu=null===(r=d.mainMenu)||void 0===r?void 0:r.elements,h=null===(o=p.legalMenu)||void 0===o?void 0:o.elements,a.footerMenu=[{label:null,children:h}],n(a),c(!1);case 18:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return[e,o]},kt=function(t){var e,n=t.emptyText,r=t.listElements,o=t.defaultOption,i=m(a(!1),2),c=i[0],l=i[1],u={label:n,value:null},s=[u].concat(v((e=null==r?void 0:r.reduce((function(t,e){if(!Array.isArray(e))return t;var n=null==e?void 0:e.map((function(t){return t.label}));return[].concat(v(t),v(n))}),[]),v(new Set(e)).map((function(t){return{label:t,value:t}}))))),d=s.find((function(t){return t.value===o})),f=m(a(d||u),2),p=f[0],A=f[1];return[s,p,function(t){return function(){A(s.find((function(e){return e.label===t}))),l(!1)}},c,l]},jt={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]},Ot=["url"];function Ct(t){var e=t.srcSet,n=t.srcSetURL,r=t.format;return{type:"image/".concat(r),srcSet:e.map((function(t){return null==t?void 0:t.replace(/f\/\w+/,"f/".concat(r))})),srcSetURL:n.map((function(t){return null==t?void 0:t.replace(/f\/\w+/,"f/".concat(r))}))}}function Bt(t){var e=t.url,n=g(t,Ot),r=(R()||{}).griddoDamDefaults,o=F(e),a=M(e),i=u(u(u(u({},jt),r),n),{},{format:"jpeg",domain:o});void 0===i.responsive&&(i.responsive=[{width:i.width,height:i.height,quality:i.quality,crop:i.crop,position:i.position,transforms:i.transforms}]);var c=i.responsive.map((function(t){var e=t.width,n=t.height,r=t.quality,o=t.crop,c=t.position,l=t.transforms,u=Q({damId:a,imageConfig:i,quality:r,crop:o,width:e,height:n,position:c,transforms:l});return"".concat(u," ").concat(G(e),"w")})),l=N(i.responsive.reverse()).map((function(t,e){return e<i.responsive.length-1?"(min-width: ".concat(t.breakpoint,") ").concat(t.width):"".concat(t.width)})).join(", "),s=c.map((function(t){return null==t?void 0:t.split(" ")[0]})),d=i.responsive[0],f="".concat(Q(u({damId:a,imageConfig:i},d))),p="".concat(Q({damId:a,imageConfig:i,quality:33,width:10,height:10/(G(i.width)/G(i.height))}));return{type:"image/".concat(i.format),srcSet:c,srcSetURL:s,src:f,sizes:l,blurred:p,webpFallback:Ct({srcSet:c,srcSetURL:s,format:"jpeg"}),jpeg:Ct({srcSet:c,srcSetURL:s,format:"jpeg"}),webp:Ct({srcSet:c,srcSetURL:s,format:"webp"}),avif:Ct({srcSet:c,srcSetURL:s,format:"avif"}),png:Ct({srcSet:c,srcSetURL:s,format:"png"}),gif:Ct({srcSet:c,srcSetURL:s,format:"gif"})}}var Pt=["or","and"];function Ut(t){return!!t&&Pt.includes(t.toLowerCase())}function zt(){var e=R(),n=e.publicApiUrl,r=e.siteId,o=e.renderer,a=V().languageId,i=m(t.useState(),2),c=i[0],l=i[1],s=m(t.useState(),2),d=s[0],f=s[1],p=m(t.useState(!0),2),A=p[0],g=p[1],h=m(t.useState(!1),2),y=h[0],b=h[1],S=m(t.useState({}),2),w=S[0],x=S[1],E="editor"===o;return t.useEffect((function(){if(d){d&&function(){g(!0);var t=d.queryUrl,e=d.extra;fetch(t).then((function(t){return t.json()})).then((function(t){g(!1),b(!1),200!==(null==t?void 0:t.code)&&void 0!==(null==t?void 0:t.code)?(b(!0),x(t)):(b(!1),l(u(u({},t),{},{totalItems:e.totalItems?e.totalItems:t.totalItems})))})).catch((function(t){g(!1),b(!0),console.log(t)}))}()}}),[d]),[{query:c,isLoading:A,isError:y,msg:w},function(t){var e,o=t.data,i=t.apiUrl,c=void 0===i?"".concat(n):i,l=t.items,u=void 0===l?10:l,s=t.lang,d=void 0===s?a:s,p=t.page,A=void 0===p?1:p,g=t.site,m=void 0===g?r:g,h=t.fields,y=t.filterIds,b=t.cached,S=t.search,w=t.operator,x=t.exclude,I=t.relations,k=E?(new Date).valueOf():b,j=null==S?void 0:S.replace(/\s/g,"+"),O="auto"===o.mode,C=o.source||o.fixed,B=function(t){var e=t.array,n=t.page,r=t.itemsPerPage;return Array.isArray(e)?v(e).splice((n-1)*r,r):[]}({array:C,page:A,itemsPerPage:u}),P=O?"/list/":"/list/fixed/",U="".concat(O?C:B,"/"),z=xt({baseUrl:"".concat(c).concat(P).concat(U),params:{site:m,lang:d,get:h,page:O?A:null,items:O?u:null,order:O?o.order:null,filter:y,maxItems:o.quantity,search:j,operator:Ut(w)?w:null,exclude:(e=x,Array.isArray(e)?x:null),relations:I?"on":null,cached:k}});return f({queryUrl:z,extra:{totalItems:"manual"===o.mode&&o.fixed.length}})}]}function Lt(){var e=R(),n=e.publicApiUrl,r=e.siteId,o=e.renderer,a=V().languageId,i=m(t.useState(),2),c=i[0],l=i[1],s=m(t.useState(),2),d=s[0],f=s[1],p=m(t.useState(!0),2),A=p[0],g=p[1],v=m(t.useState(!1),2),h=v[0],y=v[1],b=m(t.useState({}),2),S=b[0],w=b[1],x="editor"===o;return t.useEffect((function(){if(d){d&&function(){g(!0);var t=d.queryUrl;fetch(t).then((function(t){return t.json()})).then((function(t){g(!1),y(!1),200!==(null==t?void 0:t.code)&&void 0!==(null==t?void 0:t.code)?(y(!0),w(t)):(y(!1),l(u({},t)))})).catch((function(t){g(!1),y(!0),console.log(t)}))}()}}),[d]),[{query:c,isLoading:A,isError:h,msg:S},function(t){var e=t.data,o=t.apiUrl,i=void 0===o?"".concat(n):o,c=t.lang,l=void 0===c?a:c,u=t.site,s=void 0===u?r:u,d=t.cached,p=x?(new Date).valueOf():d,A=e.source||e.fixed,g="".concat(A,"/"),m=xt({baseUrl:"".concat(i).concat("/filters/").concat(g),params:{site:s,lang:l,cached:p}});return f({queryUrl:m})}]}var Rt=["data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==","data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA","data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="],_t=new Promise((function(t){var e=new Image;e.onerror=function(){return t(!1)},e.onload=function(){return t(1===e.width)},Rt.forEach((function(t){e.src=t}))})).catch((function(){return!1}));function Dt(){var e=m(t.useState(null),2),n=e[0],r=e[1];return t.useEffect((function(){_t.then((function(t){r(!!t)}))}),[]),n}var Nt=["data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAEcbWV0YQAAAAAAAABIaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGNhdmlmIC0gaHR0cHM6Ly9naXRodWIuY29tL2xpbmstdS9jYXZpZgAAAAAeaWxvYwAAAAAEQAABAAEAAAAAAUQAAQAAABcAAAAqaWluZgEAAAAAAAABAAAAGmluZmUCAAAAAAEAAGF2MDFJbWFnZQAAAAAOcGl0bQAAAAAAAQAAAHJpcHJwAAAAUmlwY28AAAAQcGFzcAAAAAEAAAABAAAAFGlzcGUAAAAAAAAAAQAAAAEAAAAQcGl4aQAAAAADCAgIAAAAFmF2MUOBAAwACggYAAYICGgIIAAAABhpcG1hAAAAAAAAAAEAAQUBAoMDhAAAAB9tZGF0CggYAAYICGgIIBoFHiAAAEQiBACwDoA=","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABoAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACJtZGF0EgAKCBgADsgQEAwgMgwf8AAAWAAAAACvJ+o="],Gt=new Promise((function(t){var e=new Image;e.onerror=function(){return t(!1)},e.onload=function(){return t(1===e.width)},Nt.forEach((function(t){e.src=t}))})).catch((function(){return!1}));function qt(){var e=m(t.useState(null),2),n=e[0],r=e[1];return t.useEffect((function(){Gt.then((function(t){r(!!t)}))}),[]),n}var Tt=["libComponents"],Qt=function(t){var n=t.libComponents,r=g(t,Tt),o=R().renderer,a="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||0):null,i=L(n,u({},r));return"editor"===o?e.createElement(z,A({selectedEditorID:a},r),e.createElement(i,r)):e.createElement(i,r)},Ft=function(t){var n,r=t.header,o=t.footer,a=t.content,i=t.apiUrl,c=t.languageId,l=t.pageLanguages,u=t.library,s=u.templates,d=u.components,f=t.siteMetadata,p=s[a.template.templateType],g=a.template.heroSection?a.template.heroSection.modules[0]:void 0,m=g?g.component:void 0,v=wt({obj:a.template,searchKey:"component"});return e.createElement(B,{title:a.title,breadcrumb:a.breadcrumb,fullPath:a.fullPath,fullUrl:a.fullUrl,siteSlug:a.siteSlug,firstModule:m,apiUrl:i,languageId:c,pageLanguages:l,header:r,footer:o,siteMetadata:f,origin:a.origin,site:a.site,componentList:v,activeSectionSlug:a.template.activeSectionSlug||"/",activeSectionBase:a.template.activeSectionBase,modified:a.modified,published:a.published,structuredDataContent:a.structuredDataContent||null,dimensions:(null===(n=a.dimensions)||void 0===n?void 0:n.values)||null,isHome:a.isHome},!!r&&e.createElement(Qt,A({},r,{libComponents:d})),e.createElement(p,a.template),!!o&&e.createElement(Qt,A({},o,{libComponents:d})))},Mt=function(t){var n=t.content,r=t.library.components;return!!n&&e.createElement(Qt,A({libComponents:r},n))},Wt=function(t){var n=t.isPage;return void 0!==n&&n?e.createElement(Ft,t):e.createElement(Mt,t)},Jt=["url","linkProp","children"],Yt=function(t){var n=t.url,r=t.linkProp,o=void 0===r?"to":r,a=t.children,i=g(t,Jt),c=V().fullUrl,l=X()||"a",s=function(t){var e=null==t?void 0:t.href,n=null==t?void 0:t.linkToURL,r=null==n?void 0:n.match(/^\/{2}|^https?:/g),o=null==n?void 0:n.match(/^\/\w/g);return{href:e||(r?n:null),to:o?n:null}}(n),d=s.href,f=s.to,A=null==n?void 0:n.newTab,m=null==n?void 0:n.noFollow,v=u(u({},i),{},p({target:A&&"_blank",rel:"".concat(m?"nofollow":""," ").concat(A?"noreferrer":"").trim(),href:vt(c,d)},o,vt(c,f)));return f?e.createElement(e.Fragment,null,e.createElement("p",null,"Router"),e.createElement(l,v,a)):e.createElement("a",v,a)};function Ht(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Xt(t,e){return t(e={exports:{}},e.exports),e.exports}var Zt=Symbol.for("react.element"),Vt=Symbol.for("react.fragment"),Kt=Object.prototype.hasOwnProperty,$t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,te={key:!0,ref:!0,__self:!0,__source:!0};function ee(t,e,n){var r,o={},a=null,i=null;for(r in void 0!==n&&(a=""+n),void 0!==e.key&&(a=""+e.key),void 0!==e.ref&&(i=e.ref),e)Kt.call(e,r)&&!te.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===o[r]&&(o[r]=e[r]);return{$$typeof:Zt,type:t,key:a,ref:i,props:o,_owner:$t.current}}var ne={Fragment:Vt,jsx:ee,jsxs:ee},re=Xt((function(t){t.exports=ne})),oe=Xt((function(t,n){n.__esModule=!0,n.default=void 0;var r=["className","children","ratio","style"];function o(){return o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o.apply(this,arguments)}var a="--aspect-ratio";class i extends e.Component{constructor(){super(...arguments),this.node=null,this.setNode=t=>{this.node=t}}componentDidUpdate(){if(this.node){var{node:t}=this;t.style.getPropertyValue(a)||t.style.setProperty(a,"("+this.props.ratio+")")}}render(){var t=this.props,{className:e,children:n,ratio:i,style:c}=t,l=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,r),u=o({},c,{[a]:"("+i+")"});return(0,re.jsx)("div",o({className:e,ref:this.setNode,style:u},l,{children:n}))}}i.defaultProps={className:"react-aspect-ratio-placeholder",ratio:1};var c=i;n.default=c}));Ht(oe);var ae=Xt((function(t,e){e.__esModule=!0,e.default=void 0;var n=["className","children","ratio","style"];function r(){return r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},r.apply(this,arguments)}var o="react-aspect-ratio-placeholder";var a=function(t){var{className:e=o,children:a,ratio:i=1,style:c}=t,l=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,n),u=r({},c,{"--aspect-ratio":"("+i+")"});return(0,re.jsx)("div",r({className:e,style:u},l,{children:a}))};e.default=a}));Ht(ae);var ie=oe,ce=ae,le=Xt((function(t,e){e.__esModule=!0,e.default=e.AspectRatio=void 0;var n=o(ie),r=o(ce);function o(t){return t&&t.__esModule?t:{default:t}}var a=n.default;e.default=a;var i=r.default;e.AspectRatio=i}));Ht(le);var ue=le.AspectRatio;U('[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');var se=["alt","width","height","ratio","fixed","publicId","src","objectFit"],de=function(t){var n=t.alt,r=t.width,o=t.height,a=t.ratio,i=t.fixed,c=t.publicId,l=t.src,s=t.objectFit,d=void 0===s?"cover":s,f=g(t,se),p=R().cloudinaryDefaults,m=u(u(u({},_),p),f),v=H({crop:m.crop,format:m.format,gravity:m.gravity,quality:m.quality,sizes:m.sizes,responsive:m.responsive,width:r,height:o,ar:a,publicId:c}),h=v.srcSet,y=v.sizes,b=v.fallbackSrcImage,S=v.src,w={alt:n,width:r,height:o,loading:m.loading,style:{objectFit:d},decoding:m.decoding},x=u(u({},w),{},{src:l}),E=u(u({},w),{},{srcSet:h,sizes:y,src:S}),I=function(){return e.createElement("img",A({},l?x:E,{onError:function(t){t.target.src!==b&&(t.target.onerror=null,t.target.srcset="",t.target.sizes="",t.target.style="",t.target.src=b)}}))};return i?e.createElement(I,null):e.createElement(ue,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(I,null))};U('.Griddo-BgImage {\n display: flex;\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.Griddo-BgImage::before {\n z-index: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n content: "";\n display: block;\n}\n\n.Griddo-BgImage.lazy {\n background-image: none;\n}\n');var fe=["backgroundRepeat","backgroundSize","backgroundPosition","children","overlayColor","overlayOpacity","overlayTransition","ratio","publicId","src","customLazyClassName","lazy"],pe=function(t){var n=t.backgroundRepeat,r=void 0===n?"no-repeat":n,o=t.backgroundSize,a=void 0===o?"cover":o,i=t.backgroundPosition,c=void 0===i?"50% 50%":i,l=t.children,s=t.overlayColor,d=void 0===s?null:s,f=t.overlayOpacity,p=void 0===f?0:f,A=t.overlayTransition,m=void 0===A?"2s":A,h=t.ratio,y=t.publicId,b=t.src,S=t.customLazyClassName,w=void 0===S?"lazy":S,x=t.lazy,E=g(t,fe),I=R().cloudinaryDefaults,k=u(u(u(u({},I),_),E),{},{backgroundLazy:I.backgroundLazy||_.backgroundLazy||x}),j=H({responsive:v(k.responsive),quality:k.quality,crop:k.crop,gravity:k.gravity,format:k.format,publicId:y,ar:h}).srcSetURL,O=b?[b]:j,C=b?[]:k.responsive.map((function(t){return t.breakpoint})),B="Griddo-BgImage--".concat(Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,8)),P=k.backgroundLazy?w:"",U=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Array(t).fill(0).map((function(t,n){return n+e}))}(O.length-1,1).map((function(t){return"@media (min-width: ".concat(C[t],") {\n .").concat(B," {\n background-image: url(").concat(O[t],");\n }\n }\n ")})).join("");return e.createElement(e.Fragment,null,e.createElement("style",{dangerouslySetInnerHTML:{__html:"\n\n .".concat(B," {\n background-repeat: ").concat(r,";\n background-position: ").concat(c,";\n background-size: ").concat(a,";\n background-image: url(").concat(O[0],");\n }\n\n ").concat(U,"\n\n .").concat(B,"::before {\n transition: all ").concat(m," ease;\n background-color: rgba(0, 0, 0, ").concat(p,");\n ").concat(d?"\n background-color: ".concat(d,";\n opacity: ").concat(p,";\n "):"","\n }")}}),e.createElement("div",{className:"Griddo-BgImage ".concat(B," ").concat(P)},l))};U('.griddo-background-image {\n display: flex;\n width: 100%;\n height: 100%;\n\n position: relative;\n\n background-repeat: no-repeat;\n background-size: cover;\n background-position: 50% 50%;\n}\n\n.griddo-background-image--lazy {\n background: none !important;\n}\n\n.griddo-background-image::before {\n z-index: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n content: "";\n display: block;\n transition: all var(--veil-transition-time) var(--veil-transition-easing);\n background-color: var(--veil-opacity);\n}\n');function Ae(e){var n=e.children,r=e.format,o=e.backgroundSize,a=e.veilOpacity,i=void 0===a?.5:a,c=e.veilColor,l=void 0===c?"#000033":c,s=e.veilTransitionTime,d=void 0===s?"2s":s,f=e.veilTransitionEasing,p=void 0===f?"easing":f,A=e.url,g=e.src,m=e.responsive,v=e.className,h=e.style,y=e.quality,b=e.lazyOffset,S=void 0===b?"200px":b,w=t.useRef(null);t.useEffect((function(){if(IntersectionObserver){if(w.current){var t=new IntersectionObserver((function(e){return e.forEach((function(e){e.isIntersecting&&(w.current.classList.remove("griddo-background-image--lazy"),t=t.disconnect())}))}),{rootMargin:"0px 0px ".concat(S," 0px")});return t.observe(w.current),function(){return t=t&&t.disconnect()}}}else w.current.classList.remove("griddo-background-image--lazy")}),[]);var x=R().griddoDamDefaults,E=F(A),I=m&&Object.fromEntries(Object.keys(m).map((function(t){var e=Q({damId:M(A),imageConfig:u(u(u({},jt),x),{},{quality:y,format:r,domain:E},m[t])});return[t,{url:'url("'.concat(e,'")'),customProperty:m[t].customProperty}]}))),k=m&&Object.fromEntries(Object.keys(m).map((function(t,e){return[I[t].customProperty?"".concat(I[t].customProperty):"--image-".concat(e),I[t].url]}))),j=g?{"--image-default":"url(".concat(g,")")}:k;return t.createElement("div",{ref:w,className:"".concat(v," griddo-background-image ").concat("griddo-background-image--lazy"),style:u(u({},h),{},{"--veil-opacity":"".concat(l).concat(Math.round(255/(1/i)).toString(16)),"--veil-transition-time":d,"--veil-transition-easing":p,"--background-size":o},j)},n)}function ge(e){var n=e.data;return t.createElement("script",{dangerouslySetInnerHTML:{__html:"(function(){\n const ldJsonScript = document.createElement('script');\n ldJsonScript.setAttribute('type', 'application/ld+json');\n ldJsonScript.textContent = `".concat(JSON.stringify(n),"`;\n document.head.appendChild(ldJsonScript);\n})();")}})}var me=["alt","width","height","ratio","fixed","url","objectFit","style","responsive","blur","className"];function ve(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){e()},r.srcset=t}))}var he=function(e){var n=e.alt,r=e.width,o=e.height,a=e.ratio,i=e.fixed,c=e.url;e.objectFit;var l=e.style,s=e.responsive,d=e.blur,f=e.className,p=g(e,me),A=(R()||{}).griddoDamDefaults,v=u(u(u({},jt),A),p),h=Bt({url:c,crop:v.crop,format:v.format,quality:v.quality,sizes:v.sizes||"",responsive:s,position:v.position,transforms:v.transforms,width:r,height:o}),y=h.src,b=h.sizes,S=h.blurred,w=h.avif,x=h.jpeg,E=h.gif,I=h.webp,k=function(){return t.createElement("img",{loading:v.loading,decoding:v.decoding,alt:n,srcSet:E.srcSet,sizes:b,type:"image/gif",style:l,src:y,width:r,height:o,className:f})},j=function(){var e,a=m(t.useState(!1),2),i=a[0],c=a[1],s=Dt(),p=qt(),A=m(t.useState({avif:null,webp:null}),2),g=A[0],h=A[1],E=null===(e=v.formats)||void 0===e?void 0:e.map((function(t){return t.toLowerCase()}));return t.useEffect((function(){h({avif:p,webp:s})}),[p,s]),t.useEffect((function(){if(d&&null!==g.avif&&null!==g.webp){var t=g.avif&&(null==E?void 0:E.includes("avif")),e=g.webp&&(null==E?void 0:E.includes("webp"));t?w.srcSet&&ve(w.srcSet).then((function(){c(!0)})):e?I.srcSet&&ve(I.srcSet).then((function(){c(!0)})):x.srcSet&&ve(x.srcSet).then((function(){c(!0)}))}}),[g]),t.createElement("picture",null,v.formats.includes("avif")&&t.createElement("source",{srcSet:d?i?w.srcSet:S:w.srcSet,type:w.type,sizes:b}),v.formats.includes("webp")&&t.createElement("source",{srcSet:d?i?I.srcSet:S:I.srcSet,type:I.type,sizes:b}),t.createElement("img",{loading:v.loading,decoding:v.decoding,alt:n,sizes:b,srcSet:d?i?x.srcSet:S:x.srcSet,type:x.type,style:u(u({},l),{},{transition:d?v.blurCSSTransition:"unset",filter:d?i?"blur(0)":"blur(".concat(v.blurSize,")"):"unset"}),src:y,width:r,height:o,className:f}))};return c?"gif"===p.format?t.createElement(k,null):i||!s?t.createElement(j,null):t.createElement(ue,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},t.createElement(j,null)):null},ye="pre",be="pro";var Se=["activeClassName","activeStyle","style","children","getProps","partiallyActive","state","url","title","className"];function we(e){var n=e.activeClassName,r=void 0===n?"":n,o=e.activeStyle,a=void 0===o?{}:o,i=e.style,c=void 0===i?{}:i,l=e.children,u=e.getProps,s=e.partiallyActive,d=e.state,f=e.url,p=e.title,m=e.className,v=void 0===m?"":m,h=g(e,Se),y=R(),b=y.renderer,S=y.linkComponent,w=V().fullPath,x="editor"===b,E=null==f?void 0:f.href,I=null==f?void 0:f.linkToURL,k=null==f?void 0:f.newTab,j=null==f?void 0:f.noFollow,O=!(null!=f&&f.linkToURL||null!=f&&f.href),C=I==="".concat(null==w?void 0:w.domainUrl).concat(null==w?void 0:w.compose),B=function(t){var e;return null!=t&&null!==(e=t.domainUrl)&&void 0!==e&&e.endsWith("/".concat(t.domain))?be:ye}(w),P=function(t,e){return"".concat(e?"nofollow":""," ").concat(t?"noreferrer":"").trim()}(j,k),U=function(t){return t?"_blank":"_self"}(k),z=function(t){var e,n=t.env,r=t.fullPath,o=t.to;if(n===ye){var a,i=null==r||null===(a=r.domainUrl)||void 0===a?void 0:a.split(r.domain).join("");return null==o?void 0:o.split(i)[1]}return n===be?null==o||null===(e=o.split(null==r?void 0:r.domainUrl))||void 0===e?void 0:e.join(""):o}({env:B,fullPath:w,to:I}),L=k?I:!x&&!O&&z;return E?t.createElement("a",A({target:U,rel:P,href:E,className:v,title:p},h),l):t.createElement(S,A({},h,{rel:P,target:U,to:L,getProps:u,partiallyActive:s,state:d,activeStyle:a,activeClassName:r,title:x?z:p,style:C?a:c,className:C?"".concat(v," ").concat(r||"").trim():v}),l)}function xe(e){var n=e.children,r=e.source;return t.createElement(c,A({children:n||r},e))}export{pe as CloudinaryBackgroundImage,de as CloudinaryImage,Qt as Component,Ae as GriddoBackgroundImage,he as GriddoImage,we as GriddoLink,ge as LdJson,Yt as Link,Ft as Page,P as PageConsumer,C as PageContext,B as PageProvider,Wt as Preview,xe as RichText,O as SiteConsumer,k as SiteContext,j as SiteProvider,L as getComponent,St as getLang,bt as getSiteID,yt as getToken,mt as parseTheme,qt as useAvif,Lt as useDataFilters,Et as useDistributorData,kt as useFilter,Bt as useGriddoImage,rt as useI18n,H as useImage,X as useLink,zt as useList,V as usePage,R as useSite,It as useSitemap,Dt as useWebp};
1
+ import*as t from"react";import e,{createContext as n,useContext as r,useRef as o,useState as a,useEffect as i}from"react";import c from"react-markdown";function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function d(t,e,n,r,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void n(t)}c.done?e(l):Promise.resolve(l).then(r,o)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){d(a,r,o,i,c,"next",t)}function c(t){d(a,r,o,i,c,"throw",t)}i(void 0)}))}}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A(){return A=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},A.apply(this,arguments)}function g(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||h(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var b=n(null),S=function(t){var n=t.children,r=t.translations;return e.createElement(b.Provider,{value:{translations:r}},n)};b.Consumer;var w=["activeStyle","activeClassName","getProps","partiallyActive","children","to"],x=["children"];function k(e){e.activeStyle,e.activeClassName,e.getProps,e.partiallyActive;var n=e.children;e.to;var r=g(e,w);return t.createElement("a",A({"data-griddo":"link"},r),n)}function j(t){}var O=t.createContext(null),E=function(e){var n=e.children,r=g(e,x);return t.createElement(O.Provider,{value:u({linkComponent:k,navigate:j},r)},n)},I=O.Consumer,C=n(null),P=function(t){var n=r(O),o=null==n?void 0:n.translations;return e.createElement(C.Provider,{value:u({},t)},e.createElement(S,{translations:o},t.children))},B=C.Consumer;function U(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"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=t:o.appendChild(document.createTextNode(t))}}U('.--selected {\n display: block;\n position: relative;\n}\n\n.--selected::before {\n position: absolute;\n height: calc(100% - 8px);\n width: calc(100% - 8px);\n padding-bottom: 4px;\n content: "";\n border: 4px solid rgb(80, 87, 255);\n pointer-events: none;\n z-index: 99;\n}\n\n.--selected::after {\n position: absolute;\n padding: 8px 16px;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n top: -34px;\n left: 50%;\n transform: translate(-50%, 0px);\n content: attr(data-text);\n z-index: 9;\n background: rgb(80, 87, 255);\n color: rgb(255, 255, 255);\n font-family: "Source Sans Pro", sans-serif;\n font-weight: 600;\n font-size: 14px;\n line-height: 18px;\n}\n');var z=function(t){var n=o(),c=m(a(),2),l=c[0],u=c[1],s=r(O).selectEditorID,d=t.selectedEditorID,f=t.editorID,p=t.component,A=t.children;i((function(){u(!!n&&n.current.scrollHeight)}),[A]),i((function(){v&&g()}),[n]);var g=function(){if(n.current){var t=n.current.style.position,e=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=e,n.current.style.position=t}},v=!!d&&d===f;return v&&g(),e.createElement(e.Fragment,null,"Header"===p&&e.createElement("style",{dangerouslySetInnerHTML:{__html:'\n [data-text="Header"].--selected::before {\n height: '.concat(l-8,"px;\n }")}}),e.createElement("span",{className:"".concat(v?"--selected":""),"data-text":p,ref:n,onClick:function(e){!f&&"0"!==f||"undefined"==typeof window||s&&s(t,void 0,e)}},A))},L=function(t,e){var n=e.component||e.id;return void 0!==t[n]?t[n]:(console.warn("The component <".concat(n,"> doesn't exist inside ").concat(JSON.stringify(Object.keys(t)))),null)},N=function(){return r(O)},R={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"faces:center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]},_=["damId","imageConfig"];var D=function(t){var e=t.filter((function(t){return null===t.breakpoint})),n=t.filter((function(t){return null!==t.breakpoint}));return[].concat(v(n),v(e))},G=function(t){return t?t.toString().split(/cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%/)[0]:""},q=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return t[1]})))},T=function(t,e){return u(u({},q(t)),q(e))};function Q(t){var e,n,r,o,a,i,c,l=t.damId,u=t.imageConfig,s=g(t,_),d=T(u,s),f=d.crop?"c/".concat(d.crop):"",p=d.quality?"q/".concat(d.quality):"",A=d.format?"f/".concat(d.format):"",v=d.width?"w/".concat(G(d.width)):"",h=d.height?"h/".concat(G(d.height)):"",y=d.position?"p/".concat(d.position):"",b=null!==(e=d.transforms)&&void 0!==e&&e.length?"t/".concat(d.transforms):"",S="".concat(f,"/").concat(p,"/").concat(v,"/").concat(h,"/").concat(y,"/").concat(b,"/").concat(A);return n="".concat(u.domain,"/").concat(S,"/").concat(l),o=m(null==n?void 0:n.split(/(^https?:\/\/|^\/\/)/).filter(Boolean),2),a=o[0],i=o[1],c=null==i||null===(r=i.replace(/\/\/+/g,"/"))||void 0===r?void 0:r.replace(/\/$/,""),"".concat(a).concat(c)}function F(t){return t&&"string"==typeof t?t.split(/(^[http:|https:|\/\/]*[\S][^\/]*)/)[1]:t}function M(t){return t&&"string"==typeof t?t.split("/").filter(Boolean).slice(-1)[0]:t}var W=["root","imageConfig"],J=["publicId"],Y=function(t){var e=t.root,n=t.imageConfig,r=g(t,W),o=T(n,r),a=o.crop?"c_".concat(o.crop):"",i=o.quality?"q_".concat(o.quality):"",c=o.gravity?"g_".concat(o.gravity):"",l=o.format?"f_".concat(o.format):"",u=o.width?"w_".concat(G(o.width)):"",s=o.height?"h_".concat(G(o.height)):"",d=o.ar?"ar_".concat(o.ar):"",f="".concat(a,",").concat(c,",").concat(l,",").concat(i,",").concat(u,",").concat(s,",").concat(d).split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",");return"".concat(e,"/").concat(f)},H=function(t){var e=t.publicId,n=g(t,J),r=N(),o=r.cloudinaryCloudName,a=r.cloudinaryDefaults,i=u(u(u({},R),a),n),c="".concat(i.domain,"/").concat(o,"/").concat(i.uploadFolder),l="".concat(Y({root:c,imageConfig:i,quality:20,width:"512"}),"/").concat(i.fallback404ImageId),s=i.responsive.map((function(t){var n=t.width,r=t.height,o=t.quality,a=t.crop,l=Y({root:c,imageConfig:i,quality:o,crop:a,width:n,height:r});return"".concat(l,"/").concat(e," ").concat(G(n),"w")})),d=D(i.responsive.reverse()).map((function(t,e){return e<i.responsive.length-1?"(min-width: ".concat(t.breakpoint,") ").concat(t.width):"".concat(t.width)})).join(", "),f=s.map((function(t){return t.split(" ")[0]})),p=i.responsive[0];return{src:"".concat(Y(u({root:c,imageConfig:i},p)),"/").concat(e),srcSet:s,sizes:d,fallbackSrcImage:l,srcSetURL:f}};function X(){return r(O).linkComponent}var Z={firstModule:"",siteSlug:"/",title:"Default page provider title",breadcrumb:[],fullPath:"/",apiUrl:"/",fullUrl:"/",languageId:null,pageLanguages:[]};function V(){var t,e=r(C),n=null==e||null===(t=e.pageLanguages)||void 0===t?void 0:t.filter((function(t){return t.isLive}));return e?u(u({},e),{},{pageLanguages:n}):(console.warn("Griddo: You forgot to put <PageProvider>."),u(u({},Z),{},{pageLanguages:n}))}var $=function(t,e){return!!t.find((function(t){return t.id===e}))},K=function(t,e){var n;return(null===(n=t.find((function(t){return t.id===e})))||void 0===n?void 0:n.locale)||"xx_XX"},tt=function(t,e){return!!t.find((function(t){return(null==t?void 0:t.locale)===e}))},et={languageId:"internalLangId",siteLangs:[{id:"internalLangId",locale:"xx_XX"}],translations:{xx_XX:{griddo:"griddo"}}},nt=function(t,e){return null==t?void 0:t.split(".").reduce((function(t,e){return t[e]?t[e]:""}),e)},rt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.locale,n=N(),o=(null==n?void 0:n.siteLangs)||et.siteLangs,a=V(),i=(null==a?void 0:a.languageId)||et.languageId,c=r(b),l=(null==c?void 0:c.translations)||et.translations;l||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"),$(o,i)||console.warn("Griddo: languageId ".concat(i," doesn't exist in this site")),void 0===e||tt(o,e)||console.warn("Griddo: locale ".concat(e," doesn't exist in this site"));var u=e||K(o,i),s=l?l[u]:void 0,d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return s&&s[t]||e},f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return s&&nt(t,s)||e};return u&&i?{getTranslation:d,getNestedTranslation:f}:(console.warn("Griddo: You forgot to put <I18nProvider> or exists an error in language id."),{})},ot=function(t){return function(t,e){var n=parseFloat(t.match(/\d*\.?\d*/)[0]),r=t.split(n.toString())[1],o=e(n);return"".concat(o).concat(r)}(t,(function(t){return t/2}))},at=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n="#"===t[0]?t.substring(1,7):t,r=parseInt(n.substring(0,2),16),o=parseInt(n.substring(2,4),16),a=parseInt(n.substring(4,6),16);return"rgba(".concat(r,", ").concat(o,", ").concat(a,", ").concat(e,")")},it=function(t,e,n){return n?e===n?"":"".concat(t,": ").concat(n,";"):""},ct=function(t,e,n){return e?"".concat(t,": ").concat(e,";"):n?"".concat(t,": ").concat(n,";"):""},lt=function(t){try{var e=t.mediaquery.mediaqueries,n={};return e.forEach((function(t){if("default"!==t.label){var e=t.minWidth?"and (min-width: ".concat(t.minWidth,")"):"",r=t.maxWidth?"and (max-width: ".concat(t.maxWidth,")"):"";n[t.label]="@media only screen ".concat(e," ").concat(r)}})),n}catch(t){return null}},ut=function(t){try{return t.fontFamily.fontFamilies}catch(t){return null}},st=function(t){return"string"==typeof t?t.match(/\d*\.?\d+?/)[0]:"number"==typeof t?t:void 0},dt=function(t,e){return'\n &::before, &::after {\n content: "";\n display: block;\n }\n &::before {\n margin-bottom: '.concat(e,"em;\n }\n &::after {\n margin-top: ").concat(t,"em;\n }\n ")},ft=function(t){try{return v(new Set(t.textStyle.textStyles.map((function(t){return t.fontSize})).filter(Boolean).reverse().map((function(t){return Number(t.split("px")[0])})).sort((function(t,e){return t-e}))))}catch(t){return null}},pt=function(t){if(t.spacing&&Object.keys(t.spacing).length)return Object.entries(t.spacing).reduce((function(t,e){var n=m(e,2),r=n[0],o=n[1];return u(u({},t),{},p({},r,"string"==typeof o?"-".concat(o):void 0))}),{})},At=function(t){if(t.spacing&&Object.keys(t.spacing).length)return Object.entries(t.spacing).reduce((function(t,e){var n=m(e,2),r=n[0],o=n[1];return u(u({},t),{},p({},r,"string"==typeof o?ot(o):void 0))}),{})},gt=function(t){if(t.spacing&&Object.keys(t.spacing).length)return Object.entries(t.spacing).reduce((function(t,e){var n,r=m(e,2),o=r[0],a=r[1];return u(u({},t),{},p({},o,"string"==typeof a?(n=ot(a),"-".concat(n)):void 0))}),{})},mt=function(t){var e=function(t){try{var e=t.color.colors;return Object.keys(e).reduce((function(t,n){var r,o=function(t){return 1===t.opacity||void 0===t.opacity||null===t.opacity},a=function(t){try{return"#"===t.value[0]}catch(t){return!1}},i=function(t){try{return"hsl"===t.type.toLowerCase()}catch(t){return!1}},c=function(t){try{return"rgb"===t.type.toLowerCase()}catch(t){return!1}};return r=e[n],i(r)&&!o(r)&&(t[n]="hsla(".concat(e[n].value.map((function(t,e){return"".concat(0===e?t:"string"==typeof t?-1===t.indexOf("%")?t+"%":t:t+"%")})).join(", "),", ").concat(e[n].opacity,")")),function(t){return i(t)&&o(t)}(e[n])&&(t[n]="hsl(".concat(e[n].value.map((function(t,e){return"".concat(0===e?t:"string"==typeof t?-1===t.indexOf("%")?t+"%":t:t+"%")})).join(", "),")")),function(t){return a(t)&&o(t)}(e[n])&&(t[n]="".concat(e[n].value)),function(t){return a(t)&&!o(t)}(e[n])&&(t[n]="".concat(at(e[n].value,e[n].opacity))),function(t){return c(t)&&o(t)}(e[n])&&(t[n]="rgb(".concat(e[n].value.join(", "),")")),function(t){return c(t)&&!o(t)}(e[n])&&(t[n]="rgba(".concat(e[n].value.join(", "),", ").concat(e[n].opacity,")")),t}),{})}catch(t){return null}}(t),n=function(t){try{var e=t.gradient.gradients;return Object.keys(e).reduce((function(t,n){return t[n]="linear-gradient(".concat(e[n].direction,", ").concat(e[n].stops.map((function(t){return"".concat(at(t.color,t.opacity)," ").concat(t.position)})).join(","),")"),t}),{})}catch(t){return null}}(t),r=function(t){try{var e=t.shadow.shadows;return Object.keys(e).reduce((function(t,n){return t[n]="".concat(e[n].x,"px ").concat(e[n].y,"px ").concat(e[n].blur,"px ").concat(at(e[n].color,e[n].opacity)),t}),{})}catch(t){return null}}(t),o=lt(t),a=function(t){try{var e=lt(t),n=ut(t),r=t.textStyle.defaultStyles,o=t.textStyle.textStyles,a={};return o.forEach((function(t){var o=st(t.fontSize),i=void 0!==t.croptop?t.croptop:0,c=void 0!==t.cropbottom?t.cropbottom:0,l=Math.max(i+o/2*0,0)/o*-1,u=Math.max(c+o/2*0,0)/o*-1;a[t.name]="\n\n ".concat(ct("font-family",n[t.fontFamily],n[r.fontFamily]),"\n ").concat(ct("font-size",t.fontSize,r.fontSize),"\n ").concat(ct("font-weight",t.fontWeight,r.fontWeight),"\n ").concat(ct("letter-spacing",t.letterSpacing,r.letterSpacing),"\n ").concat(ct("line-height",t.lineHeight,r.lineHeight),"\n ").concat(ct("font-style",t.fontStyle,r.fontStyle),"\n ").concat(ct("text-transform",t.textTransform,r.textTransform),"\n ").concat(i&&c?dt(l,u):"","\n \n ").concat(t.responsive?t.responsive.map((function(r,a){return o=st(r.fontSize),i=void 0!==r.croptop?r.croptop:0,c=void 0!==r.cropbottom?r.cropbottom:0,l=Math.max(i+o/2*0,0)/o*-1,u=Math.max(c+o/2*0,0)/o*-1,a<1?"\n ".concat(e[r.breakpoint]," {\n ").concat(it("font-family",n[t.fontFamily],n[r.fontFamily]),"\n ").concat(it("font-size",t.fontSize,r.fontSize),"\n ").concat(it("font-weight",t.fontWeight,r.fontWeight),"\n ").concat(it("line-height",t.lineHeight,r.lineHeight),"\n ").concat(it("letter-spacing",t.letterSpacing,r.letterSpacing),"\n ").concat(it("font-style",t.fontStyle,r.fontStyle),"\n ").concat(it("text-transform",t.textTransform,r.textTransform),"\n ").concat(i&&c?dt(l,u):"","\n }\n "):(o=st(r.fontSize),i=void 0!==r.croptop?r.croptop:0,c=void 0!==r.cropbottom?r.cropbottom:0,l=Math.max(i+o/2*0,0)/o*-1,u=Math.max(c+o/2*0,0)/o*-1,"\n ".concat(e[r.breakpoint]," {\n ").concat(it("font-family",n[t.responsive[a-1].fontFamily],n[r.fontFamily]),"\n ").concat(it("font-size",t.responsive[a-1].fontSize,r.fontSize),"\n ").concat(it("font-weight",t.responsive[a-1].fontWeight,r.fontWeight),"\n ").concat(it("line-height",t.responsive[a-1].lineHeight,r.lineHeight),"\n ").concat(it("letter-spacing",t.responsive[a-1].letterSpacing,r.letterSpacing),"\n ").concat(it("font-style",t.responsive[a-1].fontStyle,r.fontStyle),"\n ").concat(it("text-transform",t.responsive[a-1].textTransform,r.textTransform),"\n ").concat(i&&c?dt(l,u):"","\n }\n "))})).join(""):"","\n ")})),a}catch(t){return null}}(t),i=function(t){try{return t.mediaquery.mediaqueries.map((function(t){return t.minWidth})).filter(Boolean)}catch(t){return null}}(t),c=ut(t);try{t.mediaquery.mediaqueries.forEach((function(t){i[t.label]=t.minWidth}))}catch(t){}return u(u({},t),{},{fontFamily:c,color:e,colors:e,gradient:n,shadow:r,mq:o,textStyle:a,breakpoints:i,fontSizes:ft(t),negateSpacing:pt(t),halfSpacing:At(t),negateHalfSpacing:gt(t)})},vt=function(t,e){return(null==e?void 0:e.startsWith("".concat(t,"#")))?"#".concat(e.split("#")[1]):e},ht="undefined"!=typeof window,yt=function(){var t=ht&&JSON.parse(localStorage.getItem("persist:app"));if(!t)return null;var e=t.token;return e=JSON.parse(e),{Authorization:"bearer ".concat(e)}},bt=function(){var t,e=s(ht)&&JSON.parse(localStorage.getItem("persist:root"));if(!e)return 1;var n=e.sites;return null===(t=(n=JSON.parse(n)).currentSiteInfo)||void 0===t?void 0:t.id},St=function(){return ht&&parseInt(localStorage.getItem("langID"))};function wt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.obj,n=t.searchKey,r=t.results,o=void 0===r?[]:r,a=t.unique,i=void 0===a||a,c=o;return Object.keys(e).forEach((function(t){var r=e[t];t===n&&"object"!==s(r)?c.push(r):"object"===s(r)&&r&&wt({obj:r,searchKey:n,results:c})})),i?v(new Set(c)):c}function xt(t){var e=t.baseUrl,n=t.params,r=Object.keys(n).map((function(t){return function(t){return Array.isArray(t)&&t.length>0||"number"==typeof t||"string"==typeof t}(n[t])?"".concat(t,"/").concat(n[t]):""})).join("/");return"".concat(e).concat(r.split("/").filter(Boolean).join("/"))}var kt=function(t){var e=m(a(null),2),n=e[0],r=e[1],o=t||{},c=o.order,l=o.quantity,s=o.source,d=o.mode,p=o.fixed,A=o.filter,g=o.fullRelations,v=void 0!==g&&g,h=V().apiUrl;return i((function(){var t=!!St(),e=bt()||"global",n="".concat(h,"/site/").concat(e,"/distributor"),o=function(t){return{method:"POST",mode:"cors",cache:"no-cache",headers:u({"Content-Type":"application/json",lang:St()},yt()),redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(t)}}("auto"===d?{mode:d,order:c,quantity:l,source:s,filter:A,fullRelations:v}:{mode:d,fixed:p,fullRelations:v}),a=function(){var t=f(regeneratorRuntime.mark((function t(){var e,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(n,o);case 2:return e=t.sent,t.next=5,e.json();case 5:a=t.sent,r(a);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t&&a()}),[d,c,l,p,A,s,v]),n},jt=function(){var t=m(a(),2),e=t[0],n=t[1],r=m(a(!0),2),o=r[0],c=r[1],l=V(),s=l.apiUrl,d=l.header,p=l.footer,A=l.fullPath,g=N().siteMetadata;i((function(){v()}),[]);var v=function(){var t=f(regeneratorRuntime.mark((function t(){var e,r,o,a,i,l,f,m,v,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((a={}).topMenu=[{label:null==g?void 0:g.title,children:null===(e=d.topMenu)||void 0===e?void 0:e.elements,url:{linkToURL:!!A&&"".concat(A.domainUrl).concat(A.site)}}],g){t.next=14;break}return i=bt(),l="".concat(s,"/site/").concat(i),t.next=7,fetch(l,{method:"GET",mode:"cors",cache:"no-cache",headers:u({"Content-Type":"application/json",lang:St()},yt())});case 7:return f=t.sent,t.next=10,f.json();case 10:m=t.sent,v=m.name,a.topMenu[0].label=v,a.siteName=v;case 14:a.mainMenu=null==d||null===(r=d.mainMenu)||void 0===r?void 0:r.elements,h=null==p||null===(o=p.legalMenu)||void 0===o?void 0:o.elements,a.footerMenu=[{label:null,children:h}],a.header=d,a.footer=p,n(a),c(!1);case 21:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return[e,o]},Ot=function(t){var e,n=t.emptyText,r=t.listElements,o=t.defaultOption,i=m(a(!1),2),c=i[0],l=i[1],u={label:n,value:null},s=[u].concat(v((e=null==r?void 0:r.reduce((function(t,e){if(!Array.isArray(e))return t;var n=null==e?void 0:e.map((function(t){return t.label}));return[].concat(v(t),v(n))}),[]),v(new Set(e)).map((function(t){return{label:t,value:t}}))))),d=s.find((function(t){return t.value===o})),f=m(a(d||u),2),p=f[0],A=f[1];return[s,p,function(t){return function(){A(s.find((function(e){return e.label===t}))),l(!1)}},c,l]},Et={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]},It=["url"];function Ct(t){var e=t.srcSet,n=t.srcSetURL,r=t.format;return{type:"image/".concat(r),srcSet:e.map((function(t){return null==t?void 0:t.replace(/f\/\w+/,"f/".concat(r))})),srcSetURL:n.map((function(t){return null==t?void 0:t.replace(/f\/\w+/,"f/".concat(r))}))}}function Pt(t){var e=t.url,n=g(t,It),r=(N()||{}).griddoDamDefaults,o=F(e),a=M(e),i=u(u(u(u({},Et),r),n),{},{format:"jpeg",domain:o});void 0===i.responsive&&(i.responsive=[{width:i.width,height:i.height,quality:i.quality,crop:i.crop,position:i.position,transforms:i.transforms}]);var c=i.responsive.map((function(t){var e=t.width,n=t.height,r=t.quality,o=t.crop,c=t.position,l=t.transforms,u=Q({damId:a,imageConfig:i,quality:r,crop:o,width:e,height:n,position:c,transforms:l});return"".concat(u," ").concat(G(e),"w")})),l=D(i.responsive.reverse()).map((function(t,e){return e<i.responsive.length-1?"(min-width: ".concat(t.breakpoint,") ").concat(t.width):"".concat(t.width)})).join(", "),s=c.map((function(t){return null==t?void 0:t.split(" ")[0]})),d=i.responsive[0],f="".concat(Q(u({damId:a,imageConfig:i},d))),p="".concat(Q({damId:a,imageConfig:i,quality:33,width:10,height:10/(G(i.width)/G(i.height))}));return{type:"image/".concat(i.format),srcSet:c,srcSetURL:s,src:f,sizes:l,blurred:p,webpFallback:Ct({srcSet:c,srcSetURL:s,format:"jpeg"}),jpeg:Ct({srcSet:c,srcSetURL:s,format:"jpeg"}),webp:Ct({srcSet:c,srcSetURL:s,format:"webp"}),avif:Ct({srcSet:c,srcSetURL:s,format:"avif"}),png:Ct({srcSet:c,srcSetURL:s,format:"png"}),gif:Ct({srcSet:c,srcSetURL:s,format:"gif"})}}var Bt=["or","and"];function Ut(t){return!!t&&Bt.includes(t.toLowerCase())}function zt(){var e=N(),n=e.publicApiUrl,r=e.siteId,o=e.renderer,a=V().languageId,i=m(t.useState(),2),c=i[0],l=i[1],s=m(t.useState(),2),d=s[0],f=s[1],p=m(t.useState(!0),2),A=p[0],g=p[1],h=m(t.useState(!1),2),y=h[0],b=h[1],S=m(t.useState({}),2),w=S[0],x=S[1],k="editor"===o;return t.useEffect((function(){if(d){d&&function(){g(!0);var t=d.queryUrl,e=d.extra;fetch(t).then((function(t){return t.json()})).then((function(t){g(!1),b(!1),200!==(null==t?void 0:t.code)&&void 0!==(null==t?void 0:t.code)?(b(!0),x(t)):(b(!1),l(u(u({},t),{},{totalItems:e.totalItems?e.totalItems:t.totalItems})))})).catch((function(t){g(!1),b(!0),console.log(t)}))}()}}),[d]),[{query:c,isLoading:A,isError:y,msg:w},function(t){var e,o=t.data,i=t.apiUrl,c=void 0===i?"".concat(n):i,l=t.items,u=void 0===l?10:l,s=t.lang,d=void 0===s?a:s,p=t.page,A=void 0===p?1:p,g=t.site,m=void 0===g?r:g,h=t.fields,y=t.filterIds,b=t.cached,S=t.search,w=t.operator,x=t.exclude,j=t.relations,O=k?(new Date).valueOf():b,E=null==S?void 0:S.replace(/\s/g,"+"),I="auto"===o.mode,C=o.source||o.fixed,P=function(t){var e=t.array,n=t.page,r=t.itemsPerPage;return Array.isArray(e)?v(e).splice((n-1)*r,r):[]}({array:C,page:A,itemsPerPage:u}),B=I?"/list/":"/list/fixed/",U="".concat(I?C:P,"/"),z=xt({baseUrl:"".concat(c).concat(B).concat(U),params:{site:m,lang:d,get:h,page:I?A:null,items:I?u:null,order:I?o.order:null,filter:y,maxItems:o.quantity,search:E,operator:Ut(w)?w:null,exclude:(e=x,Array.isArray(e)?x:null),relations:j?"on":null,cached:O}});return f({queryUrl:z,extra:{totalItems:"manual"===o.mode&&o.fixed.length}})}]}function Lt(){var e=N(),n=e.publicApiUrl,r=e.siteId,o=e.renderer,a=V().languageId,i=m(t.useState(),2),c=i[0],l=i[1],s=m(t.useState(),2),d=s[0],f=s[1],p=m(t.useState(!0),2),A=p[0],g=p[1],v=m(t.useState(!1),2),h=v[0],y=v[1],b=m(t.useState({}),2),S=b[0],w=b[1],x="editor"===o;return t.useEffect((function(){if(d){d&&function(){g(!0);var t=d.queryUrl;fetch(t).then((function(t){return t.json()})).then((function(t){g(!1),y(!1),200!==(null==t?void 0:t.code)&&void 0!==(null==t?void 0:t.code)?(y(!0),w(t)):(y(!1),l(u({},t)))})).catch((function(t){g(!1),y(!0),console.log(t)}))}()}}),[d]),[{query:c,isLoading:A,isError:h,msg:S},function(t){var e=t.data,o=t.apiUrl,i=void 0===o?"".concat(n):o,c=t.lang,l=void 0===c?a:c,u=t.site,s=void 0===u?r:u,d=t.cached,p=x?(new Date).valueOf():d,A=e.source||e.fixed,g="".concat(A,"/"),m=xt({baseUrl:"".concat(i).concat("/filters/").concat(g),params:{site:s,lang:l,cached:p}});return f({queryUrl:m})}]}var Nt=["data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==","data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA","data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="],Rt=new Promise((function(t){var e=new Image;e.onerror=function(){return t(!1)},e.onload=function(){return t(1===e.width)},Nt.forEach((function(t){e.src=t}))})).catch((function(){return!1}));function _t(){var e=m(t.useState(null),2),n=e[0],r=e[1];return t.useEffect((function(){Rt.then((function(t){r(!!t)}))}),[]),n}var Dt=["data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAEcbWV0YQAAAAAAAABIaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGNhdmlmIC0gaHR0cHM6Ly9naXRodWIuY29tL2xpbmstdS9jYXZpZgAAAAAeaWxvYwAAAAAEQAABAAEAAAAAAUQAAQAAABcAAAAqaWluZgEAAAAAAAABAAAAGmluZmUCAAAAAAEAAGF2MDFJbWFnZQAAAAAOcGl0bQAAAAAAAQAAAHJpcHJwAAAAUmlwY28AAAAQcGFzcAAAAAEAAAABAAAAFGlzcGUAAAAAAAAAAQAAAAEAAAAQcGl4aQAAAAADCAgIAAAAFmF2MUOBAAwACggYAAYICGgIIAAAABhpcG1hAAAAAAAAAAEAAQUBAoMDhAAAAB9tZGF0CggYAAYICGgIIBoFHiAAAEQiBACwDoA=","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABoAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACJtZGF0EgAKCBgADsgQEAwgMgwf8AAAWAAAAACvJ+o="],Gt=new Promise((function(t){var e=new Image;e.onerror=function(){return t(!1)},e.onload=function(){return t(1===e.width)},Dt.forEach((function(t){e.src=t}))})).catch((function(){return!1}));function qt(){var e=m(t.useState(null),2),n=e[0],r=e[1];return t.useEffect((function(){Gt.then((function(t){r(!!t)}))}),[]),n}var Tt=["libComponents"],Qt=function(t){var n=t.libComponents,r=g(t,Tt),o=N().renderer,a="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||0):null,i=L(n,u({},r));return"editor"===o?e.createElement(z,A({selectedEditorID:a},r),e.createElement(i,r)):e.createElement(i,r)},Ft=function(t){var n,r=t.header,o=t.footer,a=t.content,i=t.apiUrl,c=t.languageId,l=t.pageLanguages,u=t.library,s=u.templates,d=u.components,f=t.siteMetadata,p=s[a.template.templateType],g=a.template.heroSection?a.template.heroSection.modules[0]:void 0,m=g?g.component:void 0,v=wt({obj:a.template,searchKey:"component"});return e.createElement(P,{title:a.title,breadcrumb:a.breadcrumb,fullPath:a.fullPath,fullUrl:a.fullUrl,siteSlug:a.siteSlug,firstModule:m,apiUrl:i,languageId:c,pageLanguages:l,header:r,footer:o,siteMetadata:f,origin:a.origin,site:a.site,componentList:v,activeSectionSlug:a.template.activeSectionSlug||"/",activeSectionBase:a.template.activeSectionBase,modified:a.modified,published:a.published,structuredDataContent:a.structuredDataContent||null,dimensions:(null===(n=a.dimensions)||void 0===n?void 0:n.values)||null,isHome:a.isHome},!!r&&e.createElement(Qt,A({},r,{libComponents:d})),e.createElement(p,a.template),!!o&&e.createElement(Qt,A({},o,{libComponents:d})))},Mt=function(t){var n=t.content,r=t.library.components;return!!n&&e.createElement(Qt,A({libComponents:r},n))},Wt=function(t){var n=t.isPage;return void 0!==n&&n?e.createElement(Ft,t):e.createElement(Mt,t)},Jt=["url","linkProp","children"],Yt=function(t){var n=t.url,r=t.linkProp,o=void 0===r?"to":r,a=t.children,i=g(t,Jt),c=V().fullUrl,l=X()||"a",s=function(t){var e=null==t?void 0:t.href,n=null==t?void 0:t.linkToURL,r=null==n?void 0:n.match(/^\/{2}|^https?:/g),o=null==n?void 0:n.match(/^\/\w/g);return{href:e||(r?n:null),to:o?n:null}}(n),d=s.href,f=s.to,A=null==n?void 0:n.newTab,m=null==n?void 0:n.noFollow,v=u(u({},i),{},p({target:A&&"_blank",rel:"".concat(m?"nofollow":""," ").concat(A?"noreferrer":"").trim(),href:vt(c,d)},o,vt(c,f)));return f?e.createElement(e.Fragment,null,e.createElement("p",null,"Router"),e.createElement(l,v,a)):e.createElement("a",v,a)};function Ht(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Xt(t,e){return t(e={exports:{}},e.exports),e.exports}var Zt=Symbol.for("react.element"),Vt=Symbol.for("react.fragment"),$t=Object.prototype.hasOwnProperty,Kt=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,te={key:!0,ref:!0,__self:!0,__source:!0};function ee(t,e,n){var r,o={},a=null,i=null;for(r in void 0!==n&&(a=""+n),void 0!==e.key&&(a=""+e.key),void 0!==e.ref&&(i=e.ref),e)$t.call(e,r)&&!te.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===o[r]&&(o[r]=e[r]);return{$$typeof:Zt,type:t,key:a,ref:i,props:o,_owner:Kt.current}}var ne={Fragment:Vt,jsx:ee,jsxs:ee},re=Xt((function(t){t.exports=ne})),oe=Xt((function(t,n){n.__esModule=!0,n.default=void 0;var r=["className","children","ratio","style"];function o(){return o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o.apply(this,arguments)}var a="--aspect-ratio";class i extends e.Component{constructor(){super(...arguments),this.node=null,this.setNode=t=>{this.node=t}}componentDidUpdate(){if(this.node){var{node:t}=this;t.style.getPropertyValue(a)||t.style.setProperty(a,"("+this.props.ratio+")")}}render(){var t=this.props,{className:e,children:n,ratio:i,style:c}=t,l=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,r),u=o({},c,{[a]:"("+i+")"});return(0,re.jsx)("div",o({className:e,ref:this.setNode,style:u},l,{children:n}))}}i.defaultProps={className:"react-aspect-ratio-placeholder",ratio:1};var c=i;n.default=c}));Ht(oe);var ae=Xt((function(t,e){e.__esModule=!0,e.default=void 0;var n=["className","children","ratio","style"];function r(){return r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},r.apply(this,arguments)}var o="react-aspect-ratio-placeholder";var a=function(t){var{className:e=o,children:a,ratio:i=1,style:c}=t,l=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,n),u=r({},c,{"--aspect-ratio":"("+i+")"});return(0,re.jsx)("div",r({className:e,style:u},l,{children:a}))};e.default=a}));Ht(ae);var ie=Xt((function(t,e){e.__esModule=!0,e.default=e.AspectRatio=void 0;var n=o(oe),r=o(ae);function o(t){return t&&t.__esModule?t:{default:t}}var a=n.default;e.default=a;var i=r.default;e.AspectRatio=i}));Ht(ie);var ce=ie.AspectRatio;U('[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');var le=["alt","width","height","ratio","fixed","publicId","src","objectFit"],ue=function(t){var n=t.alt,r=t.width,o=t.height,a=t.ratio,i=t.fixed,c=t.publicId,l=t.src,s=t.objectFit,d=void 0===s?"cover":s,f=g(t,le),p=N().cloudinaryDefaults,m=u(u(u({},R),p),f),v=H({crop:m.crop,format:m.format,gravity:m.gravity,quality:m.quality,sizes:m.sizes,responsive:m.responsive,width:r,height:o,ar:a,publicId:c}),h=v.srcSet,y=v.sizes,b=v.fallbackSrcImage,S=v.src,w={alt:n,width:r,height:o,loading:m.loading,style:{objectFit:d},decoding:m.decoding},x=u(u({},w),{},{src:l}),k=u(u({},w),{},{srcSet:h,sizes:y,src:S}),j=function(){return e.createElement("img",A({},l?x:k,{onError:function(t){t.target.src!==b&&(t.target.onerror=null,t.target.srcset="",t.target.sizes="",t.target.style="",t.target.src=b)}}))};return i?e.createElement(j,null):e.createElement(ce,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(j,null))};U('.Griddo-BgImage {\n display: flex;\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.Griddo-BgImage::before {\n z-index: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n content: "";\n display: block;\n}\n\n.Griddo-BgImage.lazy {\n background-image: none;\n}\n');var se=["backgroundRepeat","backgroundSize","backgroundPosition","children","overlayColor","overlayOpacity","overlayTransition","ratio","publicId","src","customLazyClassName","lazy"],de=function(t){var n=t.backgroundRepeat,r=void 0===n?"no-repeat":n,o=t.backgroundSize,a=void 0===o?"cover":o,i=t.backgroundPosition,c=void 0===i?"50% 50%":i,l=t.children,s=t.overlayColor,d=void 0===s?null:s,f=t.overlayOpacity,p=void 0===f?0:f,A=t.overlayTransition,m=void 0===A?"2s":A,h=t.ratio,y=t.publicId,b=t.src,S=t.customLazyClassName,w=void 0===S?"lazy":S,x=t.lazy,k=g(t,se),j=N().cloudinaryDefaults,O=u(u(u(u({},j),R),k),{},{backgroundLazy:j.backgroundLazy||R.backgroundLazy||x}),E=H({responsive:v(O.responsive),quality:O.quality,crop:O.crop,gravity:O.gravity,format:O.format,publicId:y,ar:h}).srcSetURL,I=b?[b]:E,C=b?[]:O.responsive.map((function(t){return t.breakpoint})),P="Griddo-BgImage--".concat(Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,8)),B=O.backgroundLazy?w:"",U=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Array(t).fill(0).map((function(t,n){return n+e}))}(I.length-1,1).map((function(t){return"@media (min-width: ".concat(C[t],") {\n .").concat(P," {\n background-image: url(").concat(I[t],");\n }\n }\n ")})).join("");return e.createElement(e.Fragment,null,e.createElement("style",{dangerouslySetInnerHTML:{__html:"\n\n .".concat(P," {\n background-repeat: ").concat(r,";\n background-position: ").concat(c,";\n background-size: ").concat(a,";\n background-image: url(").concat(I[0],");\n }\n\n ").concat(U,"\n\n .").concat(P,"::before {\n transition: all ").concat(m," ease;\n background-color: rgba(0, 0, 0, ").concat(p,");\n ").concat(d?"\n background-color: ".concat(d,";\n opacity: ").concat(p,";\n "):"","\n }")}}),e.createElement("div",{className:"Griddo-BgImage ".concat(P," ").concat(B)},l))};U('.griddo-background-image {\n display: flex;\n width: 100%;\n height: 100%;\n\n position: relative;\n\n background-repeat: no-repeat;\n background-size: cover;\n background-position: 50% 50%;\n}\n\n.griddo-background-image--lazy {\n background: none !important;\n}\n\n.griddo-background-image::before {\n z-index: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n content: "";\n display: block;\n transition: all var(--veil-transition-time) var(--veil-transition-easing);\n background-color: var(--veil-opacity);\n}\n');function fe(e){var n=e.children,r=e.format,o=e.backgroundSize,a=e.veilOpacity,i=void 0===a?.5:a,c=e.veilColor,l=void 0===c?"#000033":c,s=e.veilTransitionTime,d=void 0===s?"2s":s,f=e.veilTransitionEasing,p=void 0===f?"easing":f,A=e.url,g=e.src,m=e.responsive,v=e.className,h=e.style,y=e.quality,b=e.lazyOffset,S=void 0===b?"200px":b,w=e.loading,x=t.useRef(null);t.useEffect((function(){var t;if(IntersectionObserver){if(x.current){var e=new IntersectionObserver((function(t){return t.forEach((function(t){var n;t.isIntersecting&&(null===(n=x.current)||void 0===n||n.classList.remove("griddo-background-image--lazy"),e=e.disconnect())}))}),{rootMargin:"0px 0px ".concat(S," 0px")});return e.observe(x.current),function(){return e=e&&e.disconnect()}}}else null===(t=x.current)||void 0===t||t.classList.remove("griddo-background-image--lazy")}),[]);var k=N().griddoDamDefaults,j=F(A),O=m&&Object.fromEntries(Object.keys(m).map((function(t){var e=Q({damId:M(A),imageConfig:u(u(u({},Et),k),{},{quality:y,format:r,domain:j},m[t])});return[t,{url:'url("'.concat(e,'")'),customProperty:m[t].customProperty}]}))),E=m&&Object.fromEntries(Object.keys(m).map((function(t,e){return[O[t].customProperty?"".concat(O[t].customProperty):"--image-".concat(e),O[t].url]}))),I=g?{"--image-default":"url(".concat(g,")")}:E;return t.createElement("div",{ref:x,className:"".concat(v," griddo-background-image ").concat("lazy"===w?"griddo-background-image--lazy":""),style:u(u({},h),{},{"--veil-opacity":"".concat(l).concat(Math.round(255/(1/i)).toString(16)),"--veil-transition-time":d,"--veil-transition-easing":p,"--background-size":o},I)},n)}function pe(e){var n=e.data;return t.createElement("script",{dangerouslySetInnerHTML:{__html:"(function(){\n const ldJsonScript = document.createElement('script');\n ldJsonScript.setAttribute('type', 'application/ld+json');\n ldJsonScript.textContent = `".concat(JSON.stringify(n),"`;\n document.head.appendChild(ldJsonScript);\n})();")}})}var Ae=["alt","width","height","ratio","fixed","url","style","responsive","className"],ge=function(e){var n=e.alt,r=e.width,o=e.height,a=e.ratio,i=e.fixed,c=e.url,l=e.style,s=e.responsive,d=e.className,f=g(e,Ae),p=(N()||{}).griddoDamDefaults,A=u(u(u({},Et),p),f),m=Pt({url:c,crop:A.crop,format:A.format,quality:A.quality,sizes:A.sizes||"",responsive:s,position:A.position,transforms:A.transforms,width:r,height:o}),v=m.src,h=m.sizes,y=m.avif,b=m.jpeg,S=m.gif,w=m.webp,x=function(){return t.createElement("img",{loading:A.loading,decoding:A.decoding,alt:n,srcSet:S.srcSet,sizes:h,type:"image/gif",style:l,src:v,width:r,height:o,className:d})},k=function(){return t.createElement("picture",null,A.formats.includes("avif")&&t.createElement("source",{srcSet:y.srcSet,type:y.type,sizes:h}),A.formats.includes("webp")&&t.createElement("source",{srcSet:w.srcSet,type:w.type,sizes:h}),t.createElement("img",{loading:A.loading,decoding:A.decoding,alt:n,sizes:h,srcSet:b.srcSet,type:b.type,style:l,src:v,width:r,height:o,className:d}))};return c?"gif"===f.format?t.createElement(x,null):i||!s?t.createElement(k,null):t.createElement(ce,{ratio:a,style:{maxWidth:"100%",alignSelf:"normal"}},t.createElement(k,null)):null},me="pre",ve="pro";var he=["activeClassName","activeStyle","style","children","getProps","partiallyActive","state","url","title","className"];function ye(e){var n=e.activeClassName,r=void 0===n?"":n,o=e.activeStyle,a=void 0===o?{}:o,i=e.style,c=void 0===i?{}:i,l=e.children,u=e.getProps,s=e.partiallyActive,d=e.state,f=e.url,p=e.title,m=e.className,v=void 0===m?"":m,h=g(e,he),y=N(),b=y.renderer,S=y.linkComponent,w=V().fullPath,x="editor"===b,k=null==f?void 0:f.href,j=null==f?void 0:f.linkToURL,O=null==f?void 0:f.newTab,E=null==f?void 0:f.noFollow,I=!(null!=f&&f.linkToURL||null!=f&&f.href),C=j==="".concat(null==w?void 0:w.domainUrl).concat(null==w?void 0:w.compose),P=function(t){var e;return null!=t&&null!==(e=t.domainUrl)&&void 0!==e&&e.endsWith("/".concat(t.domain))?ve:me}(w),B=function(t,e){return"".concat(e?"nofollow":""," ").concat(t?"noreferrer":"").trim()}(E,O),U=function(t){return t?"_blank":"_self"}(O),z=function(t){var e,n=t.env,r=t.fullPath,o=t.to;if(n===me){var a,i=null==r||null===(a=r.domainUrl)||void 0===a?void 0:a.split(r.domain).join("");return null==o?void 0:o.split(i)[1]}return n===ve?null==o||null===(e=o.split(null==r?void 0:r.domainUrl))||void 0===e?void 0:e.join(""):o}({env:P,fullPath:w,to:j}),L=O?j:!x&&!I&&z;return k?t.createElement("a",A({target:U,rel:B,href:k,className:v,title:p},h),l):t.createElement(S,A({},h,{rel:B,target:U,to:L,getProps:u,partiallyActive:s,state:d,activeStyle:a,activeClassName:r,title:x?z:p,style:C?a:c,className:C?"".concat(v," ").concat(r||"").trim():v}),l)}function be(e){var n=e.children,r=e.source;return t.createElement(c,A({children:n||r},e))}const Se=t=>"object"==typeof t&&null!==t;function we(t){const[e,...n]=t.trim().split(/(?=[A-Z])/).join(" ");return`${e.toUpperCase()}${n.join("")}`}function xe(t,e,n,r=(t=>t)){Object.keys(t).forEach((o=>{const a=t[o],i=o===e&&"string"==typeof a,c=!t[n],l=i&&c,u=Se(a);l&&(t[n]=r(a)),u&&xe(a,e,n,r)}))}function ke(t,e={}){return Object.keys(t).map((n=>{"value"===n&&t.key?e[t.key]=t[n]:Se(t[n])&&ke(t[n],e)})),e}function je(t,e){for(var n in t)if(t.hasOwnProperty(n))switch(typeof t[n]){case"string":e.indexOf(n)>-1&&t.type&&t.key&&"NoteField"!==t.type&&delete t[n];break;case"object":e.indexOf(n)>-1&&t.type&&t.key&&"NoteField"!==t.type?delete t[n]:je(t[n],e)}}function Oe(t){const e=ke(t);return Object.assign(Object.assign({},t),{default:Object.assign(Object.assign({component:t.component},t.default),e)})}function Ee(t){return Object.assign(Object.assign({},t),{taxonomy:!0,fromPage:!1})}function Ie(t){return t}function Ce(t){return t}function Pe(t){return t}function Be(t){return t}function Ue(t){return t}function ze(t){return t}function Le(t){return Object.assign(Object.assign({},t),{fromPage:!0})}function Ne(t){return xe(t,"key","title",we),Object.assign(Object.assign({},t),{fromPage:!1})}function Re(t){return t}function _e(t){return t}function De(t){t.displayName=t.displayName||we(t.component),xe(t,"key","title",we);const e=Oe(t);return je(e,["value"]),e}export{de as CloudinaryBackgroundImage,ue as CloudinaryImage,Qt as Component,fe as GriddoBackgroundImage,ge as GriddoImage,ye as GriddoLink,pe as LdJson,Yt as Link,Ft as Page,B as PageConsumer,C as PageContext,P as PageProvider,Wt as Preview,be as RichText,I as SiteConsumer,O as SiteContext,E as SiteProvider,Ee as createCategoriesSchema,Ie as createDamDefaultsSchema,Ce as createDataPackCategoriesSchema,Pe as createDataPackSchema,Be as createLanguagesSchema,Ue as createMenuSchema,ze as createModuleCategoriesSchema,Le as createPageDataSchema,Ne as createPureDataSchema,Re as createThemesSchema,_e as createTranslationsSchema,De as createUISchema,L as getComponent,St as getLang,bt as getSiteID,yt as getToken,mt as parseTheme,qt as useAvif,Lt as useDataFilters,kt as useDistributorData,Ot as useFilter,Pt as useGriddoImage,rt as useI18n,H as useImage,X as useLink,zt as useList,V as usePage,N as useSite,jt as useSitemap,_t as useWebp};
@@ -0,0 +1,248 @@
1
+ import { Disabled, Entity, Group, HTMLTag, Option, Source, ThemeColors, ThemeVisualUniqueSelection, ThumbnailOption } from "./props";
2
+ export declare type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
3
+ interface GenericField {
4
+ /** Establece el tipo de field */
5
+ type: string;
6
+ /** Valor con el que se indentificará el field en la API. Usar camelCase. */
7
+ key: string;
8
+ /** Label del campo que aparecerá en el formulario. */
9
+ title?: string;
10
+ /** Si el campo es obligatorio. */
11
+ mandatory?: boolean;
12
+ }
13
+ interface GenericComponentField extends GenericField {
14
+ /** Obliga a que todos los elementos del Array sean del mismo tipo. Si se habilita esta opción el schema debería incluir un `VisualUniqueSelection` para elegir el tipo. */
15
+ elementUniqueSelection?: boolean;
16
+ /** Número máximo de componentes que se pueden añadir. */
17
+ maxItems?: number | null;
18
+ }
19
+ interface GenericArrayFieldGroup extends GenericField {
20
+ /** Nombre del item que se va a repetir. */
21
+ name: string;
22
+ /** Añade un campo FieldsDivider a modo de cabecera. */
23
+ divider?: FieldsDividerData;
24
+ /** Las dos formas de visualizar el array de items, con los campos plegados (dropdown) o visibles (inline). */
25
+ arrayType: string;
26
+ /** Plantilla de fields que se va a repetir en cada item. */
27
+ fields: unknown[];
28
+ }
29
+ interface ArrayFieldGroup<FieldsType> extends GenericArrayFieldGroup {
30
+ type: "ArrayFieldGroup";
31
+ arrayType: "inline" | "dropDown";
32
+ fields: (FieldsType & {
33
+ isTitle?: boolean;
34
+ })[];
35
+ }
36
+ interface AsyncCheckGroup extends GenericField, Disabled, Source {
37
+ /** Listado de checkboxes que carga las opciones de una entidad de la base de datos. */
38
+ type: "AsyncCheckGroup";
39
+ }
40
+ interface ExclusiveSource extends Partial<Source> {
41
+ entity?: never;
42
+ }
43
+ interface ExclusiveEntity extends Partial<Entity> {
44
+ source?: never;
45
+ }
46
+ declare type SourceOrEntity = ExclusiveSource | ExclusiveEntity;
47
+ declare type AsyncSelect = (GenericField | Disabled) & SourceOrEntity & {
48
+ type: "AsyncSelect";
49
+ };
50
+ interface CheckGroup extends GenericField, Group {
51
+ /** Agrupación de Check Fields. */
52
+ type: "CheckGroup";
53
+ }
54
+ interface ColorPicker extends GenericField {
55
+ /** Texfield que permite desplegar un modal para elegir un color. */
56
+ type: "ColorPicker";
57
+ /** Array de códigos hexadecimales de los colores que aparecerán elegibles por defecto. También es posible indicar un theme para personalizar los colores. */
58
+ colors: string[] | ThemeColors[];
59
+ }
60
+ interface ComponentArray extends GenericComponentField {
61
+ /** Campo para añadir múltiples componentes a un módulo. */
62
+ type: "ComponentArray";
63
+ }
64
+ interface ComponentContainer extends GenericComponentField {
65
+ /** Campo para añadir un único componente a un módulo. */
66
+ type: "ComponentContainer";
67
+ }
68
+ interface ConditionalField<FieldsType> extends GenericField {
69
+ /** Conjunto de radio buttons para mostrar u ocultar diferenes campos según el valor elegido. Los campos dentro de fields tienen que llevar la key condition con uno de los valores de options para mostrar el campo cuando el valor del radio button coincida con la condición. */
70
+ type: "ConditionalField";
71
+ /** Array de opciones (radio buttons). */
72
+ options: Option[];
73
+ /** Array de fields para el conditional. */
74
+ fields: (FieldsType & {
75
+ condition: unknown;
76
+ })[];
77
+ }
78
+ interface DateField extends GenericField {
79
+ /** Campo para fechas. La fecha se puede escribir o elegir en un calendario. */
80
+ type: "DateField";
81
+ /** Habilita la selección de un rango de fechas. Por defecto: false. */
82
+ selectsRange?: boolean;
83
+ }
84
+ interface FieldGroup<FieldsType> extends GenericField {
85
+ type: "FieldGroup";
86
+ /** Array de fields que pertenecen al grupo. */
87
+ fields: FieldsType[];
88
+ }
89
+ interface FieldsDividerData {
90
+ title: string;
91
+ text: string;
92
+ }
93
+ interface FieldsDivider extends GenericField {
94
+ /** Campo para añadir un componete "divider" entre campos. */
95
+ type: "FieldsDivider";
96
+ /** Objeto con los campos title y text (strings). */
97
+ data: FieldsDividerData;
98
+ }
99
+ interface FileField extends GenericField {
100
+ /** Campo que permite subir ficheros. */
101
+ type: "FileField";
102
+ }
103
+ interface HeadingField extends GenericField {
104
+ /** Campo con TextField + Select. El Select aparece oculto por defecto. */
105
+ type: "HeadingField";
106
+ /** Propiedad obligatoria para que aparezca la opción de desplegar el campo. */
107
+ advanced?: boolean;
108
+ /** Valores por defecto del campo. */
109
+ default: {
110
+ tag: HTMLTag;
111
+ content: string;
112
+ };
113
+ /** Array de opciones que aparecerán en el Select. */
114
+ options: {
115
+ value: HTMLTag;
116
+ label: string;
117
+ }[];
118
+ }
119
+ interface ImageField extends GenericField {
120
+ /** Permite al usuario subir una imagen */
121
+ type: "ImageField";
122
+ /** Si true le hace crop al preview, si es `false` escala el preview. Por defecto: `false` */
123
+ cropPreview?: boolean;
124
+ }
125
+ interface LinkField extends GenericField {
126
+ /** Field que combina `TextField` + `ConditionalField` (`UrlField` o `ComponentContainer`) */
127
+ type: "LinkField";
128
+ }
129
+ interface MultiCheckSelect extends GenericField, Source {
130
+ /** Campo que permite renderizar un AsyncCheckGroup dentro de una lista desplegable. */
131
+ type: "MultiCheckSelect";
132
+ }
133
+ interface MultiCheckSelectGroup extends GenericField {
134
+ /** Campo para renderizar múltiples MultiCheckSelect. */
135
+ type: "MultiCheckSelectGroup";
136
+ /** `NoteField` con texto de ayuda que aparece debajo de la label */
137
+ note?: string;
138
+ /** Array con los datos de los diferentes `MultiCheckSelect` */
139
+ elements: DistributiveOmit<MultiCheckSelect, "type">[];
140
+ /** Si filled es `true` el campo tendrá un fondo blanco. Por defecto: false */
141
+ filled?: boolean;
142
+ }
143
+ interface NoteField extends GenericField {
144
+ /** Campo para añadir un texto destacado. */
145
+ type: "NoteField";
146
+ /** Valor por defecto para NoteField */
147
+ value?: {
148
+ title: string;
149
+ text: string;
150
+ };
151
+ }
152
+ interface NumberField extends Omit<SliderField, "type" | "step"> {
153
+ /** Campo para números. Incluye botones para incrementar o decrementar el valor del campo. */
154
+ type: "NumberField";
155
+ /** Valor mínimo */
156
+ minValue?: number;
157
+ /** Valor máximo */
158
+ maxValue?: number;
159
+ /** Valor por defecto */
160
+ default?: number;
161
+ }
162
+ interface RadioGroup extends GenericField, Group {
163
+ /** Agrupación de Radio Fields. */
164
+ type: "RadioGroup";
165
+ }
166
+ interface ReferenceField extends GenericField {
167
+ /** Campo que carga Datos Estructurados (normalmente puros) de la base de datos. Se suele utilizar en módulos distribuidores. */
168
+ type: "ReferenceField";
169
+ /** Tipos de selección: manual, automática o ambas. Por defecto: ["auto","manual"]. */
170
+ selectionType?: ("auto" | "manual")[];
171
+ /** Solo modo manual. */
172
+ maxItems?: number | null;
173
+ /** Array con los tipos de datos estructurados que tiene que cargar el campo. */
174
+ source: string[];
175
+ }
176
+ interface RichText extends GenericField {
177
+ /** TextArea con editor simple que exporta a markdown o html. Utiliza las librerías de draft.js y react-draft-wysiwyg.js */
178
+ type: "RichText";
179
+ /** Si es true exporta a `html` en vez de a `markdown`. Por defecto: `false`. */
180
+ html?: boolean;
181
+ }
182
+ interface Select extends GenericField, Disabled {
183
+ /** Lista desplegable. */
184
+ type: "Select";
185
+ /** Array de opciones del select. */
186
+ options: {
187
+ value: string;
188
+ label: string;
189
+ }[];
190
+ }
191
+ interface SliderField extends GenericField {
192
+ /** Campo para renderizar un slider. Devuelve un número. */
193
+ type: "SliderField";
194
+ /** Incremento con cada paso del slider. Por defecto: `1` */
195
+ step?: 0.1 | 1 | 2 | 5 | 10 | (number & {});
196
+ /** Valor mínimo del slider. Por defecto: `1` */
197
+ minvalue?: number;
198
+ /** Valor máximo del slider. Por defecto: `100` */
199
+ maxvalue?: number;
200
+ /** String a mostrar por delante del valor en el tooltip del slider. */
201
+ prefix?: string;
202
+ /** String a mostrar por detrás del valor en el tooltip del slider. */
203
+ suffix?: string;
204
+ /** Valor por defecto del slider. Por defecto es el valor mínimo. */
205
+ defaultValue?: number;
206
+ }
207
+ interface TextArea extends GenericField {
208
+ /** Text area. */
209
+ type: "TextArea";
210
+ }
211
+ interface TextField extends GenericField {
212
+ /** Campo de texto. */
213
+ type: "TextField";
214
+ }
215
+ interface ToggleField extends GenericField {
216
+ /** Un botón toggle. */
217
+ type: "ToggleField";
218
+ }
219
+ interface UniqueCheck extends GenericField {
220
+ /** Un único check field. */
221
+ type: "UniqueCheck";
222
+ /** Array con un único objeto con el texto (label) del check. */
223
+ options: {
224
+ title: string;
225
+ }[];
226
+ }
227
+ interface UrlField extends GenericField {
228
+ /** `TextField` para enlazar páginas o urls externas. Despliega dos checkboxes para `nofollow` y abrir en una nueva pestaña: `newTab` */
229
+ type: "UrlField";
230
+ /** Habilita poder mostrar los checks. Por defecto: `false`. */
231
+ advanced?: boolean;
232
+ }
233
+ interface VisualUniqueSelection extends GenericField {
234
+ /** Funciona como un `RadioGroup` pero las opciones son imágenes. */
235
+ type: "VisualUniqueSelection";
236
+ /** Ancho para distribuir las opciones. */
237
+ columns?: number;
238
+ /** Array de radios que se quieren mostrar. */
239
+ options: (ThumbnailOption | ThemeVisualUniqueSelection)[];
240
+ }
241
+ interface Wysiwyg extends GenericField {
242
+ /** `TextArea` con el editor Froala. */
243
+ type: "Wysiwyg";
244
+ /** Opción para mostrar la versión completa del toolbar con todos los botones. Por defecto: `true`. */
245
+ full?: boolean;
246
+ }
247
+ declare type BaseFields<T> = ArrayFieldGroup<T> | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ComponentArray | ComponentContainer | ConditionalField<T> | DateField | FieldGroup<T> | FieldsDivider | FileField | HeadingField | ImageField | LinkField | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TextArea | TextField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
248
+ export { BaseFields, ArrayFieldGroup, AsyncCheckGroup, AsyncSelect, CheckGroup, ColorPicker, ComponentArray, ComponentContainer, ConditionalField, DateField, FieldGroup, FieldsDivider, FileField, HeadingField, ImageField, LinkField, MultiCheckSelect, MultiCheckSelectGroup, NoteField, NumberField, RadioGroup, ReferenceField, RichText, Select, SliderField, TextArea, TextField, ToggleField, UniqueCheck, UrlField, VisualUniqueSelection, Wysiwyg, };
@@ -0,0 +1,6 @@
1
+ import { ArrayFieldGroup, AsyncCheckGroup, AsyncSelect, CheckGroup, ColorPicker, ComponentArray, ComponentContainer, ConditionalField, DateField, FieldGroup, FieldsDivider, FileField, HeadingField, ImageField, LinkField, MultiCheckSelect, MultiCheckSelectGroup, NoteField, NumberField, RadioGroup, ReferenceField, RichText, Select, SliderField, TextArea, TextField, ToggleField, UniqueCheck, UrlField, VisualUniqueSelection, Wysiwyg } from "./base";
2
+ import { Indexable, Searchable, ShowList, From } from "./props";
3
+ declare type PageDataFieldsCommonProps = From & Indexable & Searchable & ShowList;
4
+ declare type BasePageDataFields = (ArrayFieldGroup<BasePageDataFields> & PageDataFieldsCommonProps) | (ConditionalField<BasePageDataFields> & PageDataFieldsCommonProps) | (FieldGroup<BasePageDataFields> & PageDataFieldsCommonProps) | (AsyncCheckGroup & PageDataFieldsCommonProps) | (AsyncSelect & PageDataFieldsCommonProps) | (CheckGroup & PageDataFieldsCommonProps) | (ColorPicker & PageDataFieldsCommonProps) | (ComponentArray & PageDataFieldsCommonProps) | (ComponentContainer & PageDataFieldsCommonProps) | (DateField & PageDataFieldsCommonProps) | (FieldsDivider & PageDataFieldsCommonProps) | (FileField & PageDataFieldsCommonProps) | (HeadingField & PageDataFieldsCommonProps) | (ImageField & PageDataFieldsCommonProps) | (LinkField & PageDataFieldsCommonProps) | (MultiCheckSelect & PageDataFieldsCommonProps) | (MultiCheckSelectGroup & PageDataFieldsCommonProps) | (NoteField & PageDataFieldsCommonProps) | (NumberField & PageDataFieldsCommonProps) | (RadioGroup & PageDataFieldsCommonProps) | (ReferenceField & PageDataFieldsCommonProps) | (RichText & PageDataFieldsCommonProps) | (Select & PageDataFieldsCommonProps) | (SliderField & PageDataFieldsCommonProps) | (TextArea & PageDataFieldsCommonProps) | (TextField & PageDataFieldsCommonProps) | (ToggleField & PageDataFieldsCommonProps) | (UniqueCheck & PageDataFieldsCommonProps) | (UrlField & PageDataFieldsCommonProps) | (VisualUniqueSelection & PageDataFieldsCommonProps) | (Wysiwyg & PageDataFieldsCommonProps);
5
+ export declare type PageDataFields = BasePageDataFields;
6
+ export {};
@@ -0,0 +1,113 @@
1
+ declare type Disabled = {
2
+ /** Si el select está deshabilitado. Por defecto: `false`. */
3
+ disabled?: boolean;
4
+ };
5
+ declare type Entity = {
6
+ /** Tipo de dato estructurado de donde tiene que cargar las opciones. */
7
+ entity: string;
8
+ };
9
+ declare type From = {
10
+ /** La propiedad de la template de página de la que debe extraer el valor de ese campo. */
11
+ from: string;
12
+ };
13
+ declare type Group = {
14
+ /** Array de elementos que se quieren mostrar */
15
+ options: Option[];
16
+ };
17
+ declare type HelpText = {
18
+ /** Texto de ayuda que aparece debajo del campo. */
19
+ helptext?: string;
20
+ };
21
+ declare type Hideable = {
22
+ /** Si es `true` el campo se podrá ocultar en el editor. */
23
+ hideable?: boolean;
24
+ };
25
+ declare type HTMLTag = "h1" | "h2" | "h3" | "h4" | "span" | (string & {});
26
+ declare type Indexable = {
27
+ /** Por defecto es false. Si ese campo se va a utilizar como índice (para poder ordenar por ese campo, etc.) */
28
+ indexable?: boolean;
29
+ };
30
+ declare type IsMockup = {
31
+ /** Marca el contenido del campo por defecto como contenido falso o dummy lo que obliga al usuario editor a cambiarlo. De otra forma al intentar publicar el editor de Griddo nos avisará para cambiarlo. */
32
+ isMockup?: boolean;
33
+ };
34
+ declare type Option = {
35
+ /** Label que aparecerá en el formulario. */
36
+ title: string;
37
+ /** Nombre del field. */
38
+ name: string;
39
+ /** Valor que se enviará a la API. */
40
+ value: unknown;
41
+ /** Si la opción está deshabilitada. */
42
+ disabled?: boolean;
43
+ };
44
+ declare type PlaceHolder = {
45
+ /** Texto de ejemplo de contenido. */
46
+ placeholder?: string;
47
+ };
48
+ declare type Prefix = {
49
+ /** String fijo que aparecerá y se incluirá en el valor del field. */
50
+ prefix?: "#" | (string & {});
51
+ };
52
+ declare type Readonly = {
53
+ /** Si el campo es de solo lectura. */
54
+ readonly?: boolean;
55
+ };
56
+ declare type Searchable = {
57
+ /** Solo para el campo con key “title”. Si está a false, ese título no será utilizado en búsquedas. */
58
+ searchable?: boolean;
59
+ };
60
+ declare type SearchFrom = {
61
+ /** Un array de `keys` representando los campos por los que se pueden realizar una búsqueda. */
62
+ searchFrom?: string[];
63
+ };
64
+ declare type ShowList = {
65
+ /** Por defecto es false. Si en los listados ese campo debe incluirse como un dato más. OJO: lo normal es que si es showList también debe ser indexable. */
66
+ showList?: boolean;
67
+ };
68
+ declare type SlugTo = {
69
+ /** Si se indica una key, el value de este field aparecerá en el campo de texto que tenga esa key en formato de slug. */
70
+ slugTo?: string;
71
+ };
72
+ declare type Source = {
73
+ /** Tipo de dato estructurado de donde tiene que cargar las opciones. */
74
+ source: string;
75
+ };
76
+ declare type ThemeColors = {
77
+ theme: string;
78
+ options: string[];
79
+ };
80
+ declare type ThemeVisualUniqueSelection = {
81
+ theme: string;
82
+ options: ThumbnailOption[];
83
+ };
84
+ declare type ThumbnailOption = {
85
+ value: unknown;
86
+ img: string;
87
+ };
88
+ declare type Validators = {
89
+ /** Validación de campos de tipo `string`, `number` y `date`. */
90
+ validators?: {
91
+ /** Valida la longitud mínima de un string. */
92
+ minChar?: number;
93
+ /** Valida la longitud máxima de un string. */
94
+ maxChar?: number;
95
+ /** Valida el valor mínimo de un número. */
96
+ minValue?: number;
97
+ /** Valida el valor máximo de un número. */
98
+ maxValue?: number;
99
+ /** Valida que el contenido del field cumpla un formato específico. */
100
+ format?: "email" | "URL" | "phone";
101
+ /** Valida que la fecha sea futura o pasada según el día actual. */
102
+ dateFormat?: "futureDate" | "pastDate";
103
+ };
104
+ };
105
+ declare type Value = {
106
+ /** Valor por defecto del field. */
107
+ value?: unknown;
108
+ };
109
+ declare type WhiteList = {
110
+ /** Array de strings con los nombres de los módulos o componentes que se pueden añadir. */
111
+ whiteList: string[];
112
+ };
113
+ export { Disabled, Entity, From, Group, HelpText, Hideable, HTMLTag, Indexable, IsMockup, Option, PlaceHolder, Prefix, Readonly, Searchable, SearchFrom, ShowList, SlugTo, Source, ThemeColors, ThemeVisualUniqueSelection, ThumbnailOption, Validators, Value, WhiteList, };
@@ -0,0 +1,6 @@
1
+ import { ArrayFieldGroup, AsyncCheckGroup, AsyncSelect, CheckGroup, ColorPicker, ConditionalField, DateField, FieldGroup, FieldsDivider, FileField, HeadingField, ImageField, LinkField, MultiCheckSelect, MultiCheckSelectGroup, NoteField, NumberField, RadioGroup, ReferenceField, RichText, Select, SliderField, TextArea, TextField, ToggleField, UniqueCheck, UrlField, VisualUniqueSelection, Wysiwyg } from "./base";
2
+ import { HelpText, Hideable, Indexable, IsMockup, PlaceHolder, Prefix, Readonly, Searchable, ShowList, SlugTo, Validators } from "./props";
3
+ declare type PureDataCommonProps = Hideable & Indexable & PlaceHolder & Searchable & ShowList & HelpText;
4
+ declare type BasePureDataFields = (ArrayFieldGroup<BasePureDataFields> & PureDataCommonProps) | (AsyncCheckGroup & PureDataCommonProps) | (AsyncSelect & PureDataCommonProps) | (CheckGroup & PureDataCommonProps) | (ColorPicker & PureDataCommonProps) | (ConditionalField<BasePureDataFields> & PureDataCommonProps) | (DateField & Validators & PureDataCommonProps) | (FieldGroup<BasePureDataFields> & PureDataCommonProps) | (FieldsDivider & PureDataCommonProps) | (FileField & PureDataCommonProps) | (HeadingField & IsMockup & Validators & PureDataCommonProps) | (ImageField & IsMockup & PureDataCommonProps) | (LinkField & PureDataCommonProps) | (MultiCheckSelect & PureDataCommonProps) | (MultiCheckSelectGroup & PureDataCommonProps) | (NoteField & PureDataCommonProps) | (NumberField & Validators & PureDataCommonProps) | (RadioGroup & PureDataCommonProps) | (ReferenceField & PureDataCommonProps) | (RichText & IsMockup & Validators & PureDataCommonProps) | (Select & Validators & PureDataCommonProps) | (SliderField & Validators & PureDataCommonProps) | (TextArea & IsMockup & Validators & PureDataCommonProps) | (TextField & IsMockup & Validators & Readonly & SlugTo & Prefix & PureDataCommonProps) | (ToggleField & PureDataCommonProps) | (UniqueCheck & PureDataCommonProps) | (UrlField & Validators & PureDataCommonProps) | (VisualUniqueSelection & PureDataCommonProps) | (Wysiwyg & IsMockup & Validators & PureDataCommonProps);
5
+ export declare type PureDataFields = BasePureDataFields;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ArrayFieldGroup, AsyncCheckGroup, AsyncSelect, CheckGroup, ColorPicker, ComponentArray, ComponentContainer, ConditionalField, DateField, FieldGroup, FieldsDivider, FileField, HeadingField, ImageField, LinkField, MultiCheckSelect, MultiCheckSelectGroup, NoteField, NumberField, RadioGroup, ReferenceField, RichText, Select, SliderField, TextArea, TextField, ToggleField, UniqueCheck, UrlField, VisualUniqueSelection, Wysiwyg } from "./base";
2
+ import { HelpText, Hideable, IsMockup, PlaceHolder, Prefix, Readonly, SlugTo, Validators, Value, WhiteList } from "./props";
3
+ declare type UIFieldsCommonProps = PlaceHolder & HelpText & Hideable & Value;
4
+ declare type BaseUIFields = (ArrayFieldGroup<BaseUIFields> & UIFieldsCommonProps) | (AsyncCheckGroup & UIFieldsCommonProps) | (AsyncSelect & UIFieldsCommonProps) | (CheckGroup & UIFieldsCommonProps) | (ColorPicker & UIFieldsCommonProps) | (ComponentArray & WhiteList & UIFieldsCommonProps) | (ComponentContainer & WhiteList & UIFieldsCommonProps) | (ConditionalField<BaseUIFields> & UIFieldsCommonProps) | (DateField & Validators & UIFieldsCommonProps) | (FieldGroup<BaseUIFields> & UIFieldsCommonProps) | (FieldsDivider & UIFieldsCommonProps) | (FileField & UIFieldsCommonProps) | (HeadingField & IsMockup & Validators & UIFieldsCommonProps) | (ImageField & IsMockup & UIFieldsCommonProps) | (LinkField & WhiteList & UIFieldsCommonProps) | (MultiCheckSelect & UIFieldsCommonProps) | (MultiCheckSelectGroup & UIFieldsCommonProps) | (NoteField & UIFieldsCommonProps) | (NumberField & Validators & UIFieldsCommonProps) | (RadioGroup & UIFieldsCommonProps) | (ReferenceField & UIFieldsCommonProps) | (RichText & IsMockup & Validators & UIFieldsCommonProps) | (Select & Validators & UIFieldsCommonProps) | (SliderField & Validators & UIFieldsCommonProps) | (TextArea & IsMockup & Validators & UIFieldsCommonProps) | (TextField & IsMockup & Validators & Readonly & SlugTo & Prefix & UIFieldsCommonProps) | (ToggleField & UIFieldsCommonProps) | (UniqueCheck & UIFieldsCommonProps) | (UrlField & Validators & UIFieldsCommonProps) | (VisualUniqueSelection & UIFieldsCommonProps) | (Wysiwyg & IsMockup & Validators & UIFieldsCommonProps);
5
+ export declare type UIFields = BaseUIFields;
6
+ export {};
@@ -0,0 +1,11 @@
1
+ import { DataPacks } from "./props";
2
+ import { BaseDataSchema } from "./base";
3
+ export interface CategoriesSchema extends BaseDataSchema, Required<DataPacks> {
4
+ /** No hace falta indicar `taxonomy` en las categorías, por defecto son siempre `true` */
5
+ taxonomy?: true;
6
+ /** No hace falta indicar `fromPage` en las categorías. */
7
+ fromPage?: false;
8
+ /** No hace falta indicar `schema` en las categorías.
9
+ * @deprecated */
10
+ schema?: null;
11
+ }
@@ -0,0 +1,9 @@
1
+ export interface DamDefaultsSchema {
2
+ quality: number;
3
+ crop: "cover" | "contain" | "fill";
4
+ loading: "lazy" | "eager" | "auto";
5
+ decoding: "auto" | "async";
6
+ formats: ("webp" | "avif")[];
7
+ blurSize?: string;
8
+ blurCSSTransition?: string;
9
+ }
@@ -0,0 +1,4 @@
1
+ export interface DataPackCategoriesSchema {
2
+ /** Título de la categoria de Data Packs */
3
+ title: string;
4
+ }
@@ -0,0 +1,12 @@
1
+ export interface DataPackSchema {
2
+ /** Título del Data Pack que aparecerá en el editor de Griddo. */
3
+ title: string;
4
+ /** Categoría del Data Pack */
5
+ category: string;
6
+ /** Descripción del Data Pack que aparecerá en el editor de Griddo. */
7
+ description: string;
8
+ /** Thumbnail del Data Pack que aparecerá en el editor de Griddo. Puede ser una imagen o un objeto que represente una imagen por cada teheme. */
9
+ image?: {
10
+ [key: string]: unknown;
11
+ } | string;
12
+ }
@@ -0,0 +1,8 @@
1
+ export interface LanguagesSchema {
2
+ [key: string]: {
3
+ /** Nombre interno para API */
4
+ name: string;
5
+ /** Nombre que aparece en el editor de Griddo. */
6
+ label: string;
7
+ };
8
+ }
@@ -0,0 +1,8 @@
1
+ interface MenuEntry {
2
+ /** Propiedad para API. */
3
+ key: string;
4
+ /** Nombre que se muestra en el editor de Griddo. */
5
+ display: string;
6
+ }
7
+ export declare type MenuSchema = MenuEntry[];
8
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface ModuleCategoryEntry {
2
+ featured?: boolean;
3
+ label: string;
4
+ value: string;
5
+ }
6
+ export declare type ModuleCategoriesSchema = ModuleCategoryEntry[];
@@ -0,0 +1,19 @@
1
+ import { SearchFrom } from "../fields/props";
2
+ import { PageDataFields } from "../fields/page-data-fields";
3
+ import { DataPacks } from "./props";
4
+ import { BaseDataSchema } from "./base";
5
+ declare type PageDataSchemaProp = SearchFrom & {
6
+ /** El nombre de lostemplates React para utilizar con el Schema de tipo página. */
7
+ templates: string[];
8
+ /** Un array de campos de Griddo. */
9
+ fields: PageDataFields[];
10
+ };
11
+ export interface PageDataSchema extends BaseDataSchema, DataPacks {
12
+ taxonomy?: false;
13
+ /** No es necesario indicar la prop `fromPage` en un schema: **Dato estructurado de página**. Siempre va a ser `true`.
14
+ * @deprecated */
15
+ fromPage?: true;
16
+ /** Schema para los datos. */
17
+ schema: PageDataSchemaProp | null;
18
+ }
19
+ export {};
@@ -0,0 +1,15 @@
1
+ import { SearchFrom } from "../fields/props";
2
+ import { PureDataFields } from "../fields/pure-data-fields";
3
+ import { DataPacks } from "./props";
4
+ import { BaseDataSchema } from "./base";
5
+ declare type PureDataSchemaProp = SearchFrom & {
6
+ /** Un array de campos de Griddo. */
7
+ fields: PureDataFields[];
8
+ };
9
+ export interface PureDataSchema extends BaseDataSchema, DataPacks {
10
+ /** No es necesario indicar la prop `fromPage` en un schema: **Dato estructurado puro**. Siempre va a ser `false`.
11
+ * @deprecated */
12
+ fromPage?: false;
13
+ schema: PureDataSchemaProp;
14
+ }
15
+ export {};
@@ -0,0 +1,9 @@
1
+ export interface ThemeEntry {
2
+ /** Texto con el que se mostrará el theme en el selector */
3
+ label: string;
4
+ /** Valor equivalente al id del theme dentro de la instancia. */
5
+ value: string;
6
+ /** Indica si es el theme por defecto que se utilizará por ejemplo en las páginas de datos globales (ya que estas no tienen un site asignado por defecto y por lo tanto no tienen theme) */
7
+ default?: boolean;
8
+ }
9
+ export declare type ThemesSchema = ThemeEntry[];
@@ -0,0 +1,3 @@
1
+ export interface TranslationsSchema {
2
+ [key: string]: unknown;
3
+ }
@@ -0,0 +1,36 @@
1
+ import { UIFields } from "../fields/ui-fields";
2
+ import { BaseUISchema } from "./base";
3
+ import { Dimension } from "./props";
4
+ interface ComponentAndModuleSchema extends BaseUISchema {
5
+ schemaType: "component" | "module";
6
+ /** Indica si un módulo es tratado como footer o header. Si se indica, será obligatorio especificar si es el módulo por defecto con la prop `defaultNavigation`.
7
+ * [Schemas para headers y footers](https://www.notion.so/thesaurus/Headers-y-Footers-82765ffc59fe434a8fb01fa7587614c8) */
8
+ type?: "footer" | "header";
9
+ defaultNavigation?: boolean;
10
+ /** Array de objetos que representan cada una de las pestañas del componente, módulo o template en el editor de Griddo donde se visualizarán los campos de formulario para la introducción de datos. */
11
+ configTabs: {
12
+ /** Título que aparecerá en la pestaña en el editor de Griddo. */
13
+ title: "content" | "config" | (string & {});
14
+ /** Array de campos de Griddo. */
15
+ fields: UIFields[];
16
+ }[];
17
+ }
18
+ interface TemplateSchema extends BaseUISchema {
19
+ /** Schema para tempaltes */
20
+ schemaType: "template";
21
+ /** Indica el tipo de Schema para el template: Listado, Detalle, 404, etc.. */
22
+ type: {
23
+ label: string;
24
+ value: string;
25
+ mode?: "list" | "detail";
26
+ special?: "404" | "sitemap";
27
+ };
28
+ /** Array de clave-valor que van vinculados a una página y se utilizan para ser enviadas al dataLayer (Analytics) cuando se carga la página. */
29
+ dimensions?: Dimension[];
30
+ /** Array de fields para la pestaña content */
31
+ content?: UIFields[];
32
+ /** Array de fields para la pestaña config */
33
+ config?: UIFields[];
34
+ }
35
+ export declare type UISchema = ComponentAndModuleSchema | TemplateSchema;
36
+ export {};
@@ -0,0 +1,66 @@
1
+ import { DataPacks } from "./props";
2
+ declare type Thumbnails = {
3
+ /** Thumbnail para pantallas densidad 1x. */
4
+ "1x"?: unknown;
5
+ /** Thumbnail para pantallas densidad 2x. */
6
+ "2x"?: unknown;
7
+ };
8
+ interface BaseDataSchema {
9
+ /** Títilo que aparecerá en el editor de Griddo. Si es `searchable = false`, no se utilizará para búsquedas (por defecto se entiende que es `true`). Es lo que se usa por ejemplo para los listados de datos estructurados. */
10
+ title: string;
11
+ /** Es recomendado, ya que se utiliza para listados y búsquedas. */
12
+ abstract?: string;
13
+ /** Es el que se usará como imagen en dichos listados y búsquedas, si aplica. */
14
+ image?: string;
15
+ /** Si es `true` el dato será de tipo Site, si es `false`, será de tipo global. */
16
+ local?: boolean;
17
+ /** si es una taxonomía o un dato complejo. La diferencia es que una taxonomía no tiene que definir fields ni esquema, porque solo tiene título y slug. */
18
+ taxonomy?: boolean;
19
+ /** Si es `true` el dato será de tipo página, si es`false`, será de tipo puro. */
20
+ fromPage?: boolean;
21
+ /** Si es `true` el contenido es editable una vez creado. */
22
+ editable?: boolean;
23
+ /** Si es `true` el dato es traducible, si no es el mismo contenido para todas las páginas. */
24
+ translate?: boolean;
25
+ /** ???????????????????????? */
26
+ clone?: {
27
+ cloneAll: boolean;
28
+ sourceSites: number[];
29
+ targetSites: {
30
+ site: number;
31
+ path: string;
32
+ mandatory: boolean;
33
+ }[];
34
+ sections: {
35
+ section: string;
36
+ sync: string;
37
+ }[];
38
+ } | null;
39
+ /** Valores por defecto de los fields */
40
+ defaultValues?: unknown;
41
+ }
42
+ interface BaseUISchema extends DataPacks {
43
+ /** Establece el tipo de schema. De uso interno. */
44
+ schemaType: string;
45
+ /** Si es `true` solo será posible crear una página de este tipo de template. */
46
+ singleInstance?: boolean;
47
+ /** Nombre del componente React para el schema */
48
+ component: string;
49
+ /** Nombre de la categoría previamente exportada como `moduleCategories` para Griddo. Las categorías se utilizan para distribuir y ordenar los módulos en la interface del editor de Griddo. */
50
+ category?: string;
51
+ /** Nombre con el que representar el componente, módulo o template en la interfaz del editor de Griddo. */
52
+ displayName?: string;
53
+ /** ????? */
54
+ sectionList?: {
55
+ [key: string]: string[];
56
+ };
57
+ /** Objeto para establecer valores por defecto de las keys del schema. */
58
+ default?: {
59
+ [key: string]: unknown;
60
+ };
61
+ /** Imágenes que representan el componente, módulo o template en el editor de Griddo. */
62
+ thumbnails?: Thumbnails | {
63
+ [key: string]: Thumbnails;
64
+ };
65
+ }
66
+ export { BaseDataSchema, BaseUISchema };
@@ -0,0 +1,13 @@
1
+ import { CategoriesSchema } from "./CategoriesSchema";
2
+ import { DamDefaultsSchema } from "./DamDefaultsSchema";
3
+ import { DataPackCategoriesSchema } from "./DataPackCategoriesSchema";
4
+ import { DataPackSchema } from "./DataPackSchema";
5
+ import { LanguagesSchema } from "./LanguagesSchema";
6
+ import { MenuSchema } from "./MenuSchema";
7
+ import { ModuleCategoriesSchema } from "./ModuleCategoriesSchema";
8
+ import { PageDataSchema } from "./PageDataSchema";
9
+ import { PureDataSchema } from "./PureDataSchema";
10
+ import { ThemesSchema } from "./ThemesSchema";
11
+ import { TranslationsSchema } from "./TranslationsSchema";
12
+ import { UISchema } from "./UISchema";
13
+ export { CategoriesSchema, DamDefaultsSchema, DataPackCategoriesSchema, DataPackSchema, LanguagesSchema, MenuSchema, ModuleCategoriesSchema, PageDataSchema, PureDataSchema, ThemesSchema, TranslationsSchema, UISchema, };
@@ -0,0 +1,13 @@
1
+ declare type DataPacks = {
2
+ /** Establece los Data Packs a los que pertenece este schema. */
3
+ dataPacks?: string[] | null;
4
+ };
5
+ interface Dimension {
6
+ /** Clave con la que hay que enviar el valor al dataLayer */
7
+ key: string;
8
+ /** Texto para la interface de Griddo (no editable) */
9
+ title: string;
10
+ /** Clave del template de la que sacamos el valor para enviar al dataLayer, que lo coge de template y si no del root. */
11
+ from: string;
12
+ }
13
+ export { DataPacks, Dimension };
@@ -0,0 +1,41 @@
1
+ import { UISchema } from "./types/schemas/UISchema";
2
+ /**
3
+ * Convierte la primera letra de una palabra en minúsculas
4
+ * ```
5
+ * deCamelized('MainLayout') // -> mainLayout
6
+ * ```
7
+ */
8
+ declare function deCapitalized(name: string): string;
9
+ /**
10
+ * Convierte una palabra camelCase en palabras separadas según las mayúsculas
11
+ * ```
12
+ * deCamelized('fooBar') // -> Foo Bar
13
+ * ```
14
+ */
15
+ declare function deCamelized(name: string): string;
16
+ /**
17
+ * Añade una nueva prop `newKey` en el mismo nivel que se encuentre `searchKey`
18
+ * siempre que `newKey` no exista previamente.
19
+ * Se puede pasar una función "transformadora" que recibe el valor de la key
20
+ * encontrada y el resultado será el valor de `newKey`.
21
+ */
22
+ declare function addSibilingKeyBy(
23
+ /** El objeto sobre el que se actua */
24
+ object: any,
25
+ /** La key que se va a buscar */
26
+ searchKey: string,
27
+ /** La nueva key que se va a crear */
28
+ newKey: string,
29
+ /** Simple string transform function */
30
+ fn?: (x: string) => string): void;
31
+ /**
32
+ * Elimina las keys value que ha podido añadir el desarrollador al schema para
33
+ * que la salida del schema siga siendo igual que antes de la implementación de
34
+ * los schemas en TypeScript.
35
+ * En el caso del field `NoteField` no se eliminará `value` porque es una prop
36
+ * que ya existía previamente con un uso similar al actual: establecer un valor
37
+ * para el campo
38
+ */
39
+ declare function removeKeys(obj: any, keys: string[]): void;
40
+ declare function processFieldsDefaults(schema: UISchema): UISchema;
41
+ export { deCapitalized, deCamelized, addSibilingKeyBy, processFieldsDefaults, removeKeys, };
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.67.10",
5
+ "version": "1.68.0",
6
6
  "authors": [
7
7
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
8
8
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -17,7 +17,8 @@
17
17
  "type": "git",
18
18
  "url": "https://github.com/griddo/griddo"
19
19
  },
20
- "main": "dist/index.js",
20
+ "main": "./dist/index.js",
21
+ "types": "dist/functions/create-schemas/index.d.ts",
21
22
  "scripts": {
22
23
  "build": "npx rollup -c",
23
24
  "build-storybook": "build-storybook",
@@ -42,12 +43,12 @@
42
43
  "@babel/preset-env": "^7.12.17",
43
44
  "@babel/preset-react": "^7.12.13",
44
45
  "@rollup/plugin-node-resolve": "^11.2.1",
46
+ "@rollup/plugin-typescript": "^8.3.2",
45
47
  "@storybook/addon-actions": "6.2.9",
46
48
  "@storybook/addon-essentials": "6.2.9",
47
49
  "@storybook/addon-links": "6.2.9",
48
50
  "@storybook/addon-postcss": "^2.0.0",
49
51
  "@storybook/react": "6.2.9",
50
- "ajv": "^8.8.2",
51
52
  "babel-core": "^6.21.0",
52
53
  "babel-loader": "^7.1.4",
53
54
  "babel-preset-env": "^1.6.1",
@@ -78,5 +79,5 @@
78
79
  "resolutions": {
79
80
  "colors": "1.4.0"
80
81
  },
81
- "gitHead": "0036f6f3f22eb0d092654fe726253ef7323de09a"
82
+ "gitHead": "67446292a36acae620ba0097671ec43fd026343f"
82
83
  }