@everymatrix/blog-articles-grid 1.10.10 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blog-articles-grid/blog-articles-grid.esm.js +1 -1
- package/dist/blog-articles-grid/p-72a6c169.entry.js +1 -0
- package/dist/blog-articles-grid/p-f20eb014.js +1 -0
- package/dist/cjs/blog-articles-grid.cjs.entry.js +9 -18
- package/dist/cjs/blog-articles-grid.cjs.js +2 -2
- package/dist/cjs/{index-3643d359.js → index-354d58ac.js} +3 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/blog-articles-grid/blog-articles-grid.css +8 -0
- package/dist/collection/components/blog-articles-grid/blog-articles-grid.js +10 -55
- package/dist/components/blog-articles-grid.js +9 -20
- package/dist/esm/blog-articles-grid.entry.js +9 -18
- package/dist/esm/blog-articles-grid.js +2 -2
- package/dist/esm/{index-f169c118.js → index-d61cebcb.js} +3 -0
- package/dist/esm/loader.js +2 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/blog-articles-grid/.stencil/packages/blog-articles-grid/stencil.config.d.ts +2 -0
- package/dist/types/components/blog-articles-grid/blog-articles-grid.d.ts +2 -10
- package/dist/types/components.d.ts +2 -18
- package/package.json +5 -1
- package/dist/blog-articles-grid/p-4b02b5f1.entry.js +0 -1
- package/dist/blog-articles-grid/p-c88aa418.js +0 -1
- package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/blog-articles-grid/.stencil/packages/blog-articles-grid/stencil.config.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as s,b as t}from"./p-f20eb014.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),s(e)})().then((s=>t([["p-72a6c169",[[1,"blog-articles-grid",{cmsEndpoint:[1,"cms-endpoint"],language:[1],handleClick:[1,"handle-click"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],showPublishingDate:[4,"show-publishing-date"],showImage:[4,"show-image"],showTitle:[4,"show-title"],showContent:[4,"show-content"],showButton:[4,"show-button"],usePostmessage:[4,"use-postmessage"],postMessageEvent:[1,"post-message-event"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32]}]]]],s)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,c as r,h as i}from"./p-f20eb014.js";const t=["ro","en","fr","ar"],o={en:{error:"Error",readmore:"Read more"},ro:{error:"Eroare",readmore:"Read more"},fr:{error:"Error",readmore:"Read more"},ar:{error:"خطأ",readmore:"Read more"}},e=(n,r)=>{const i=r;return o[void 0!==i&&t.includes(i)?i:"en"][n]},d=class{constructor(i){n(this,i),this.articleActionButton=r(this,"articleActionButton",7),this.language="en",this.clientStyling="",this.clientStylingUrl="",this.showPublishingDate=!0,this.showImage=!0,this.showTitle=!0,this.showContent=!0,this.showButton=!0,this.postMessageEvent="articleActionButton",this.hasErrors=!1,this.limitStylingAppends=!1,this.isLoading=!0,this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.stylingContainer.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingUrl),r=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{r.innerHTML=n,setTimeout((()=>{this.stylingContainer.prepend(r)}),1)})).catch((n=>{console.log("error ",n)}))}}getArticleId(n){this.articleActionButton.emit({postId:n}),this.usePostmessage&&window.postMessage({type:this.postMessageEvent,postId:n})}watchEndpoint(n,r){n&&n!=r&&this.cmsEndpoint&&this.getBlogArticleGrid()}handleAction(n){this.getArticleId(n)}connectedCallback(){this.cmsEndpoint&&this.language&&this.getBlogArticleGrid()}componentDidLoad(){window.postMessage({type:"BlogArticlesGridLoaded"},window.location.href)}getBlogArticleGrid(){this.isLoading=!0;let n=new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);fetch(n.href).then((n=>{if(n.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return n.json()})).then((n=>{this.blogData=n.map((n=>Object.assign(Object.assign({},n),{publishingDate:new Date(n.publishingDate).toLocaleDateString()}))),this.isLoading=!1})).catch((n=>{this.hasErrors=!0,console.log("Error",n)})).finally((()=>this.isLoading=!1))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return this.hasErrors?i("div",{class:"BlogArticleDetails"},i("div",{class:"Title"},e("error",this.language))):this.isLoading?void 0:i("div",{ref:n=>this.stylingContainer=n},i("div",{class:"GridContainerWrapper"},this.blogData.map((n=>i("div",{class:"GridContainer"},this.showPublishingDate&&i("div",{class:"BlogDate"},n.publishingDate),this.showImage&&i("div",{class:"BlogBanner"},i("img",{src:n.image.src,alt:n.title})),this.showTitle&&i("div",{class:"BlogTitle"},n.title),this.showContent&&i("div",{class:"BlogContent",innerHTML:n.content}),this.showButton&&i("div",{class:"BlogLink"},i("button",{onClick:()=>this.handleAction(n.postID)},e("readmore",this.language))))))))}static get watchers(){return{cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"]}}};d.style=":host {\n display: block;\n}\n\n.GridContainerWrapper {\n display: grid;\n}\n\n.GridContainer {\n margin: auto;\n width: 100%;\n height: 280px;\n border-radius: 15px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n gap: 30px;\n grid-template-rows: 1fr 4fr 1fr 1fr;\n grid-template-columns: 30px 1fr 1fr 30px;\n}\n.GridContainer .BlogBanner {\n grid-column: 1/3;\n grid-row: 1/5;\n}\n.GridContainer .BlogBanner img {\n border-radius: 5px 0 0 5px;\n width: 100%;\n height: 280px;\n}\n.GridContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n grid-column: 2/2;\n grid-row: 4/4;\n z-index: 1;\n}\n.GridContainer .BlogTitle {\n font-size: 24px;\n color: #FFF;\n margin-top: 20px;\n grid-column: 3/5;\n}\n.GridContainer .BlogContent {\n font-size: 14px;\n color: #FFF;\n width: 90%;\n max-height: 80px;\n overflow: hidden;\n text-overflow: ellipsis;\n grid-column: 3/5;\n}\n.GridContainer .BlogLink {\n grid-column: 3/5;\n color: #FFF;\n}\n.GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n padding: 0;\n background: none;\n color: #D0046C;\n cursor: pointer;\n}\n\n@container (max-width: 475px) {\n .GridContainerWrapper {\n display: grid;\n }\n\n .GridContainer {\n margin: auto;\n width: 100%;\n min-height: 400px;\n gap: 10%;\n padding-bottom: 30px;\n border-radius: 5px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n grid-template-rows: repeat(auto-fit, minmax(50px, 1fr));\n grid-template-rows: auto auto auto 50px;\n grid-template-columns: 15px auto auto 15px;\n gap: 10px;\n }\n .GridContainer .BlogBanner {\n grid-column: 1/5;\n grid-row: 1/3;\n margin: 0;\n }\n .GridContainer .BlogBanner img {\n width: 100%;\n height: 232px;\n border-radius: 5px 5px 0 0;\n }\n .GridContainer .BlogDate {\n grid-column: 2/3;\n grid-row: 2/3;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n z-index: 1;\n }\n .GridContainer .BlogTitle {\n grid-column: 2/4;\n font-size: 24px;\n color: #FFF;\n }\n .GridContainer .BlogContent {\n grid-column: 2/4;\n font-size: 14px;\n color: #FFF;\n }\n .GridContainer .BlogLink {\n grid-column: 2/4;\n color: #FFF;\n cursor: pointer;\n }\n .GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n background: none;\n color: #D0046C;\n cursor: pointer;\n }\n}";export{d as blog_articles_grid}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),r=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,d=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?c[c.length-1].i+=l:c.push(s?$(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=$(e,null);return i.u=t,c.length>0&&(i.$=c),i},$=(e,t)=>({t:0,h:e,i:t,m:null,$:null,u:null}),h={},m=(e,t,n,s,c,r)=>{if(n!==s){let i=z(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=p(n),o=p(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("ref"===t)s&&s(e);else if(i||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((i||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):z(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},y=/\s/,p=e=>e?e.split(y):[],b=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||a,c=t.u||a;for(l in o)l in c||m(s,l,o[l],void 0,n,t.t);for(l in c)m(s,l,o[l],c[l],n,t.t)},w=(t,n,l)=>{let o,c,r=n.$[l],i=0;if(null!==r.i)o=r.m=s.createTextNode(r.i);else if(o=r.m=s.createElement(r.h),b(null,r,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),r.$)for(i=0;i<r.$.length;++i)c=w(t,r,i),c&&o.appendChild(c);return o},S=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=w(null,l,o),r&&(s[o].m=r,i.insertBefore(r,n)))},g=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,M(l),s.remove())},j=(e,t)=>e.h===t.h,v=(e,t)=>{const n=t.m=e.m,l=e.$,s=t.$,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],d=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==d?d=l[--a]:j(i,f)?(v(i,f),i=t[++o],f=l[++c]):j(u,d)?(v(u,d),u=t[--r],d=l[--a]):j(i,d)?(v(i,d),e.insertBefore(i.m,u.m.nextSibling),i=t[++o],d=l[--a]):j(u,f)?(v(u,f),e.insertBefore(u.m,i.m),u=t[--r],f=l[++c]):(s=w(t&&t[c],n,c),f=l[++c],s&&i.m.parentNode.insertBefore(s,i.m));o>r?S(e,null==l[a+1]?null:l[a+1].m,n,l,c,a):c>a&&g(t,o,r)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},M=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(M)},k=(e,t,n)=>{const l=(e=>H(e).p)(e);return{emit:e=>C(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},C=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},O=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},P=(e,t)=>{if(e.t|=16,!(4&e.t))return O(e,e.g),te((()=>x(e,t)));e.t|=512},x=(e,t)=>{const n=e.j;return A(void 0,(()=>E(e,n,t)))},E=async(e,t,n)=>{const l=e.p,o=l["s-rc"];n&&(e=>{const t=e.v,n=e.p,l=t.t,o=((e,t)=>{let n=u(t),l=J.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=i.get(e=e.head||e);o||i.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);L(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>N(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},L=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.p,o=n.M||$(null,null),c=(e=>e&&e.h===h)(l)?l:d(null,null,l);t=s.tagName,c.h=null,c.t|=4,n.M=c,c.m=o.m=s.shadowRoot||s,e=s["s-sc"],v(o,c)})(n,l)}catch(e){B(e,n.p)}return null},N=e=>{const t=e.p,n=e.j,l=e.g;T(n,"componentDidRender"),64&e.t||(e.t|=64,D(t),T(n,"componentDidLoad"),e.k(t),l||R()),e.S&&(e.S(),e.S=void 0),512&e.t&&ee((()=>P(e,!1))),e.t&=-517},R=()=>{D(s.documentElement),ee((()=>C(l,"appload",{detail:{namespace:"blog-articles-grid"}})))},T=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){B(e)}},A=(e,t)=>e&&e.then?e.then(t):t(),D=e=>e.classList.add("hydrated"),U=(e,t,n)=>{if(t.C){e.watchers&&(t.O=e.watchers);const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>H(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=H(e),o=s.p,c=s.P.get(t),r=s.t,i=s.j;if(n=((e,t)=>null==e||f(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.C[t][0]),(!(8&r)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.P.set(t,n),i)){if(l.O&&128&r){const e=l.O[t];e&&e.map((e=>{try{i[e](n,c,t)}catch(e){B(e,o)}}))}2==(18&r)&&P(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},W=e=>{T(e,"connectedCallback")},q=(e,t={})=>{const n=[],c=t.exclude||[],i=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let h,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],C:t[2],L:t[3]};l.C=t[2],l.O={};const s=l.o,a=class extends HTMLElement{constructor(e){super(e),_(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=H(e),n=t.v,l=()=>{};if(1&t.t)W(t.j);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){O(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=I(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.O=s.watchers,U(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){B(e)}t.t&=-9,t.t|=128,e(),W(t.j)}if(s.style){let e=s.style;const t=u(n);if(!J.has(t)){const l=()=>{};((e,t,n)=>{let l=J.get(e);r&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,J.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,c=()=>P(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return H(this).N}};l.R=e[0],c.includes(s)||i.get(s)||(n.push(s),i.define(s,U(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>h=setTimeout(R,30)))},F=new WeakMap,H=e=>F.get(e),V=(e,t)=>F.set(t.j=e,t),_=(e,t)=>{const n={t:0,p:e,v:t,P:new Map};return n.N=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],F.set(e,n)},z=(e,t)=>t in e,B=(e,t)=>(0,console.error)(e,t),G=new Map,I=e=>{const t=e.o.replace(/-/g,"_"),n=e.R,l=G.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(G.set(n,e),e[t])),B)},J=new Map,K=[],Q=[],X=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?ee(Z):o.raf(Z))},Y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){B(e)}e.length=0},Z=()=>{Y(K),Y(Q),(n=K.length>0)&&o.raf(Z)},ee=e=>c().then(e),te=X(Q,!0);export{q as b,k as c,d as h,c as p,V as r}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-354d58ac.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
|
|
@@ -29,7 +29,7 @@ const translate = (key, customLang) => {
|
|
|
29
29
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.GridContainer {\n margin: auto;\n width: 100%;\n height: 280px;\n border-radius: 15px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n gap: 30px;\n grid-template-rows: 1fr 4fr 1fr 1fr;\n grid-template-columns: 30px 1fr 1fr 30px;\n}\n.GridContainer .BlogBanner {\n grid-column: 1/3;\n grid-row: 1/5;\n}\n.GridContainer .BlogBanner img {\n border-radius: 5px 0 0 5px;\n width: 100%;\n height: 280px;\n}\n.GridContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n grid-column: 2/2;\n grid-row: 4/4;\n z-index: 1;\n}\n.GridContainer .BlogTitle {\n font-size: 24px;\n color: #FFF;\n margin-top: 20px;\n grid-column: 3/5;\n}\n.GridContainer .BlogContent {\n font-size: 14px;\n color: #FFF;\n width: 90%;\n max-height: 80px;\n overflow: hidden;\n text-overflow: ellipsis;\n grid-column: 3/5;\n}\n.GridContainer .BlogLink {\n grid-column: 3/5;\n color: #FFF;\n}\n.GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n padding: 0;\n background: none;\n color: #D0046C;\n cursor: pointer;\n}\n\n@container (max-width: 475px) {\n .GridContainer {\n margin: auto;\n width: 100%;\n min-height: 400px;\n gap: 10%;\n padding-bottom: 30px;\n border-radius: 5px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n grid-template-rows: repeat(auto-fit, minmax(50px, 1fr));\n grid-template-rows: auto auto auto 50px;\n grid-template-columns: 15px auto auto 15px;\n gap: 10px;\n }\n .GridContainer .BlogBanner {\n grid-column: 1/5;\n grid-row: 1/3;\n margin: 0;\n }\n .GridContainer .BlogBanner img {\n width: 100%;\n height: 232px;\n border-radius: 5px 5px 0 0;\n }\n .GridContainer .BlogDate {\n grid-column: 2/3;\n grid-row: 2/3;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n z-index: 1;\n }\n .GridContainer .BlogTitle {\n grid-column: 2/4;\n font-size: 24px;\n color: #FFF;\n }\n .GridContainer .BlogContent {\n grid-column: 2/4;\n font-size: 14px;\n color: #FFF;\n }\n .GridContainer .BlogLink {\n grid-column: 2/4;\n color: #FFF;\n cursor: pointer;\n }\n .GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n background: none;\n color: #D0046C;\n cursor: pointer;\n }\n}";
|
|
32
|
+
const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.GridContainerWrapper {\n display: grid;\n}\n\n.GridContainer {\n margin: auto;\n width: 100%;\n height: 280px;\n border-radius: 15px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n gap: 30px;\n grid-template-rows: 1fr 4fr 1fr 1fr;\n grid-template-columns: 30px 1fr 1fr 30px;\n}\n.GridContainer .BlogBanner {\n grid-column: 1/3;\n grid-row: 1/5;\n}\n.GridContainer .BlogBanner img {\n border-radius: 5px 0 0 5px;\n width: 100%;\n height: 280px;\n}\n.GridContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n grid-column: 2/2;\n grid-row: 4/4;\n z-index: 1;\n}\n.GridContainer .BlogTitle {\n font-size: 24px;\n color: #FFF;\n margin-top: 20px;\n grid-column: 3/5;\n}\n.GridContainer .BlogContent {\n font-size: 14px;\n color: #FFF;\n width: 90%;\n max-height: 80px;\n overflow: hidden;\n text-overflow: ellipsis;\n grid-column: 3/5;\n}\n.GridContainer .BlogLink {\n grid-column: 3/5;\n color: #FFF;\n}\n.GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n padding: 0;\n background: none;\n color: #D0046C;\n cursor: pointer;\n}\n\n@container (max-width: 475px) {\n .GridContainerWrapper {\n display: grid;\n }\n\n .GridContainer {\n margin: auto;\n width: 100%;\n min-height: 400px;\n gap: 10%;\n padding-bottom: 30px;\n border-radius: 5px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n grid-template-rows: repeat(auto-fit, minmax(50px, 1fr));\n grid-template-rows: auto auto auto 50px;\n grid-template-columns: 15px auto auto 15px;\n gap: 10px;\n }\n .GridContainer .BlogBanner {\n grid-column: 1/5;\n grid-row: 1/3;\n margin: 0;\n }\n .GridContainer .BlogBanner img {\n width: 100%;\n height: 232px;\n border-radius: 5px 5px 0 0;\n }\n .GridContainer .BlogDate {\n grid-column: 2/3;\n grid-row: 2/3;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n z-index: 1;\n }\n .GridContainer .BlogTitle {\n grid-column: 2/4;\n font-size: 24px;\n color: #FFF;\n }\n .GridContainer .BlogContent {\n grid-column: 2/4;\n font-size: 14px;\n color: #FFF;\n }\n .GridContainer .BlogLink {\n grid-column: 2/4;\n color: #FFF;\n cursor: pointer;\n }\n .GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n background: none;\n color: #D0046C;\n cursor: pointer;\n }\n}";
|
|
33
33
|
|
|
34
34
|
const BlogArticlesGrid = class {
|
|
35
35
|
constructor(hostRef) {
|
|
@@ -46,11 +46,7 @@ const BlogArticlesGrid = class {
|
|
|
46
46
|
/**
|
|
47
47
|
* Client custom styling via url
|
|
48
48
|
*/
|
|
49
|
-
this.
|
|
50
|
-
/**
|
|
51
|
-
* Client custom styling via url content
|
|
52
|
-
*/
|
|
53
|
-
this.clientStylingUrlContent = '';
|
|
49
|
+
this.clientStylingUrl = '';
|
|
54
50
|
/**
|
|
55
51
|
* Property used to display the publishing date
|
|
56
52
|
*/
|
|
@@ -71,10 +67,6 @@ const BlogArticlesGrid = class {
|
|
|
71
67
|
* Property used to display the button
|
|
72
68
|
*/
|
|
73
69
|
this.showButton = true;
|
|
74
|
-
/**
|
|
75
|
-
* Property used to display the button
|
|
76
|
-
*/
|
|
77
|
-
this.showVerticalGrid = false;
|
|
78
70
|
/**
|
|
79
71
|
* Event name to be sent when the button is clicked
|
|
80
72
|
*/
|
|
@@ -88,12 +80,11 @@ const BlogArticlesGrid = class {
|
|
|
88
80
|
this.stylingContainer.prepend(sheet);
|
|
89
81
|
};
|
|
90
82
|
this.setClientStylingURL = () => {
|
|
91
|
-
let url = new URL(this.
|
|
83
|
+
let url = new URL(this.clientStylingUrl);
|
|
92
84
|
let cssFile = document.createElement('style');
|
|
93
85
|
fetch(url.href)
|
|
94
86
|
.then((res) => res.text())
|
|
95
87
|
.then((data) => {
|
|
96
|
-
this.clientStylingUrlContent = data;
|
|
97
88
|
cssFile.innerHTML = data;
|
|
98
89
|
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
99
90
|
})
|
|
@@ -113,9 +104,6 @@ const BlogArticlesGrid = class {
|
|
|
113
104
|
this.getBlogArticleGrid();
|
|
114
105
|
}
|
|
115
106
|
}
|
|
116
|
-
toggleClass() {
|
|
117
|
-
this.showVerticalGrid = !this.showVerticalGrid;
|
|
118
|
-
}
|
|
119
107
|
handleAction(postId) {
|
|
120
108
|
this.getArticleId(postId);
|
|
121
109
|
}
|
|
@@ -124,6 +112,9 @@ const BlogArticlesGrid = class {
|
|
|
124
112
|
this.getBlogArticleGrid();
|
|
125
113
|
}
|
|
126
114
|
}
|
|
115
|
+
componentDidLoad() {
|
|
116
|
+
window.postMessage({ type: 'BlogArticlesGridLoaded' }, window.location.href);
|
|
117
|
+
}
|
|
127
118
|
getBlogArticleGrid() {
|
|
128
119
|
this.isLoading = true;
|
|
129
120
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);
|
|
@@ -152,7 +143,7 @@ const BlogArticlesGrid = class {
|
|
|
152
143
|
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
153
144
|
if (this.clientStyling)
|
|
154
145
|
this.setClientStyling();
|
|
155
|
-
if (this.
|
|
146
|
+
if (this.clientStylingUrl)
|
|
156
147
|
this.setClientStylingURL();
|
|
157
148
|
this.limitStylingAppends = true;
|
|
158
149
|
}
|
|
@@ -163,7 +154,7 @@ const BlogArticlesGrid = class {
|
|
|
163
154
|
return (index.h("div", { class: "BlogArticleDetails" }, index.h("div", { class: "Title" }, translate('error', this.language))));
|
|
164
155
|
}
|
|
165
156
|
if (!this.isLoading) {
|
|
166
|
-
return (index.h("div",
|
|
157
|
+
return (index.h("div", { ref: el => this.stylingContainer = el }, index.h("div", { class: "GridContainerWrapper" }, this.blogData.map((data) => index.h("div", { class: "GridContainer" }, this.showPublishingDate &&
|
|
167
158
|
index.h("div", { class: "BlogDate" }, data.publishingDate), this.showImage &&
|
|
168
159
|
index.h("div", { class: "BlogBanner" }, index.h("img", { src: data.image.src, alt: data.title })), this.showTitle &&
|
|
169
160
|
index.h("div", { class: "BlogTitle" }, data.title), this.showContent &&
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-354d58ac.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["blog-articles-grid.cjs",[[1,"blog-articles-grid",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"handleClick":[1,"handle-click"],"clientStyling":[1,"client-styling"],"
|
|
18
|
+
return index.bootstrapLazy([["blog-articles-grid.cjs",[[1,"blog-articles-grid",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"handleClick":[1,"handle-click"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showPublishingDate":[4,"show-publishing-date"],"showImage":[4,"show-image"],"showTitle":[4,"show-title"],"showContent":[4,"show-content"],"showButton":[4,"show-button"],"usePostmessage":[4,"use-postmessage"],"postMessageEvent":[1,"post-message-event"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32]}]]]], options);
|
|
19
19
|
});
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-354d58ac.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["blog-articles-grid.cjs",[[1,"blog-articles-grid",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"handleClick":[1,"handle-click"],"clientStyling":[1,"client-styling"],"
|
|
17
|
+
return index.bootstrapLazy([["blog-articles-grid.cjs",[[1,"blog-articles-grid",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"handleClick":[1,"handle-click"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showPublishingDate":[4,"show-publishing-date"],"showImage":[4,"show-image"],"showTitle":[4,"show-title"],"showContent":[4,"show-content"],"showButton":[4,"show-button"],"usePostmessage":[4,"use-postmessage"],"postMessageEvent":[1,"post-message-event"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
.GridContainerWrapper {
|
|
6
|
+
display: grid;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
.GridContainer {
|
|
6
10
|
margin: auto;
|
|
7
11
|
width: 100%;
|
|
@@ -64,6 +68,10 @@
|
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
@container (max-width: 475px) {
|
|
71
|
+
.GridContainerWrapper {
|
|
72
|
+
display: grid;
|
|
73
|
+
}
|
|
74
|
+
|
|
67
75
|
.GridContainer {
|
|
68
76
|
margin: auto;
|
|
69
77
|
width: 100%;
|
|
@@ -13,11 +13,7 @@ export class BlogArticlesGrid {
|
|
|
13
13
|
/**
|
|
14
14
|
* Client custom styling via url
|
|
15
15
|
*/
|
|
16
|
-
this.
|
|
17
|
-
/**
|
|
18
|
-
* Client custom styling via url content
|
|
19
|
-
*/
|
|
20
|
-
this.clientStylingUrlContent = '';
|
|
16
|
+
this.clientStylingUrl = '';
|
|
21
17
|
/**
|
|
22
18
|
* Property used to display the publishing date
|
|
23
19
|
*/
|
|
@@ -38,10 +34,6 @@ export class BlogArticlesGrid {
|
|
|
38
34
|
* Property used to display the button
|
|
39
35
|
*/
|
|
40
36
|
this.showButton = true;
|
|
41
|
-
/**
|
|
42
|
-
* Property used to display the button
|
|
43
|
-
*/
|
|
44
|
-
this.showVerticalGrid = false;
|
|
45
37
|
/**
|
|
46
38
|
* Event name to be sent when the button is clicked
|
|
47
39
|
*/
|
|
@@ -55,12 +47,11 @@ export class BlogArticlesGrid {
|
|
|
55
47
|
this.stylingContainer.prepend(sheet);
|
|
56
48
|
};
|
|
57
49
|
this.setClientStylingURL = () => {
|
|
58
|
-
let url = new URL(this.
|
|
50
|
+
let url = new URL(this.clientStylingUrl);
|
|
59
51
|
let cssFile = document.createElement('style');
|
|
60
52
|
fetch(url.href)
|
|
61
53
|
.then((res) => res.text())
|
|
62
54
|
.then((data) => {
|
|
63
|
-
this.clientStylingUrlContent = data;
|
|
64
55
|
cssFile.innerHTML = data;
|
|
65
56
|
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
66
57
|
})
|
|
@@ -80,9 +71,6 @@ export class BlogArticlesGrid {
|
|
|
80
71
|
this.getBlogArticleGrid();
|
|
81
72
|
}
|
|
82
73
|
}
|
|
83
|
-
toggleClass() {
|
|
84
|
-
this.showVerticalGrid = !this.showVerticalGrid;
|
|
85
|
-
}
|
|
86
74
|
handleAction(postId) {
|
|
87
75
|
this.getArticleId(postId);
|
|
88
76
|
}
|
|
@@ -91,6 +79,9 @@ export class BlogArticlesGrid {
|
|
|
91
79
|
this.getBlogArticleGrid();
|
|
92
80
|
}
|
|
93
81
|
}
|
|
82
|
+
componentDidLoad() {
|
|
83
|
+
window.postMessage({ type: 'BlogArticlesGridLoaded' }, window.location.href);
|
|
84
|
+
}
|
|
94
85
|
getBlogArticleGrid() {
|
|
95
86
|
this.isLoading = true;
|
|
96
87
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);
|
|
@@ -119,7 +110,7 @@ export class BlogArticlesGrid {
|
|
|
119
110
|
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
120
111
|
if (this.clientStyling)
|
|
121
112
|
this.setClientStyling();
|
|
122
|
-
if (this.
|
|
113
|
+
if (this.clientStylingUrl)
|
|
123
114
|
this.setClientStylingURL();
|
|
124
115
|
this.limitStylingAppends = true;
|
|
125
116
|
}
|
|
@@ -131,8 +122,8 @@ export class BlogArticlesGrid {
|
|
|
131
122
|
h("div", { class: "Title" }, translate('error', this.language))));
|
|
132
123
|
}
|
|
133
124
|
if (!this.isLoading) {
|
|
134
|
-
return (h("div",
|
|
135
|
-
h("div", {
|
|
125
|
+
return (h("div", { ref: el => this.stylingContainer = el },
|
|
126
|
+
h("div", { class: "GridContainerWrapper" }, this.blogData.map((data) => h("div", { class: "GridContainer" },
|
|
136
127
|
this.showPublishingDate &&
|
|
137
128
|
h("div", { class: "BlogDate" }, data.publishingDate),
|
|
138
129
|
this.showImage &&
|
|
@@ -226,7 +217,7 @@ export class BlogArticlesGrid {
|
|
|
226
217
|
"reflect": false,
|
|
227
218
|
"defaultValue": "''"
|
|
228
219
|
},
|
|
229
|
-
"
|
|
220
|
+
"clientStylingUrl": {
|
|
230
221
|
"type": "string",
|
|
231
222
|
"mutable": false,
|
|
232
223
|
"complexType": {
|
|
@@ -240,25 +231,7 @@ export class BlogArticlesGrid {
|
|
|
240
231
|
"tags": [],
|
|
241
232
|
"text": "Client custom styling via url"
|
|
242
233
|
},
|
|
243
|
-
"attribute": "client-
|
|
244
|
-
"reflect": false,
|
|
245
|
-
"defaultValue": "''"
|
|
246
|
-
},
|
|
247
|
-
"clientStylingUrlContent": {
|
|
248
|
-
"type": "string",
|
|
249
|
-
"mutable": false,
|
|
250
|
-
"complexType": {
|
|
251
|
-
"original": "string",
|
|
252
|
-
"resolved": "string",
|
|
253
|
-
"references": {}
|
|
254
|
-
},
|
|
255
|
-
"required": false,
|
|
256
|
-
"optional": false,
|
|
257
|
-
"docs": {
|
|
258
|
-
"tags": [],
|
|
259
|
-
"text": "Client custom styling via url content"
|
|
260
|
-
},
|
|
261
|
-
"attribute": "client-styling-url-content",
|
|
234
|
+
"attribute": "client-styling-url",
|
|
262
235
|
"reflect": false,
|
|
263
236
|
"defaultValue": "''"
|
|
264
237
|
},
|
|
@@ -352,24 +325,6 @@ export class BlogArticlesGrid {
|
|
|
352
325
|
"reflect": false,
|
|
353
326
|
"defaultValue": "true"
|
|
354
327
|
},
|
|
355
|
-
"showVerticalGrid": {
|
|
356
|
-
"type": "boolean",
|
|
357
|
-
"mutable": false,
|
|
358
|
-
"complexType": {
|
|
359
|
-
"original": "boolean",
|
|
360
|
-
"resolved": "boolean",
|
|
361
|
-
"references": {}
|
|
362
|
-
},
|
|
363
|
-
"required": false,
|
|
364
|
-
"optional": false,
|
|
365
|
-
"docs": {
|
|
366
|
-
"tags": [],
|
|
367
|
-
"text": "Property used to display the button"
|
|
368
|
-
},
|
|
369
|
-
"attribute": "show-vertical-grid",
|
|
370
|
-
"reflect": false,
|
|
371
|
-
"defaultValue": "false"
|
|
372
|
-
},
|
|
373
328
|
"usePostmessage": {
|
|
374
329
|
"type": "boolean",
|
|
375
330
|
"mutable": false,
|
|
@@ -25,7 +25,7 @@ const translate = (key, customLang) => {
|
|
|
25
25
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.GridContainer {\n margin: auto;\n width: 100%;\n height: 280px;\n border-radius: 15px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n gap: 30px;\n grid-template-rows: 1fr 4fr 1fr 1fr;\n grid-template-columns: 30px 1fr 1fr 30px;\n}\n.GridContainer .BlogBanner {\n grid-column: 1/3;\n grid-row: 1/5;\n}\n.GridContainer .BlogBanner img {\n border-radius: 5px 0 0 5px;\n width: 100%;\n height: 280px;\n}\n.GridContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n grid-column: 2/2;\n grid-row: 4/4;\n z-index: 1;\n}\n.GridContainer .BlogTitle {\n font-size: 24px;\n color: #FFF;\n margin-top: 20px;\n grid-column: 3/5;\n}\n.GridContainer .BlogContent {\n font-size: 14px;\n color: #FFF;\n width: 90%;\n max-height: 80px;\n overflow: hidden;\n text-overflow: ellipsis;\n grid-column: 3/5;\n}\n.GridContainer .BlogLink {\n grid-column: 3/5;\n color: #FFF;\n}\n.GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n padding: 0;\n background: none;\n color: #D0046C;\n cursor: pointer;\n}\n\n@container (max-width: 475px) {\n .GridContainer {\n margin: auto;\n width: 100%;\n min-height: 400px;\n gap: 10%;\n padding-bottom: 30px;\n border-radius: 5px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n grid-template-rows: repeat(auto-fit, minmax(50px, 1fr));\n grid-template-rows: auto auto auto 50px;\n grid-template-columns: 15px auto auto 15px;\n gap: 10px;\n }\n .GridContainer .BlogBanner {\n grid-column: 1/5;\n grid-row: 1/3;\n margin: 0;\n }\n .GridContainer .BlogBanner img {\n width: 100%;\n height: 232px;\n border-radius: 5px 5px 0 0;\n }\n .GridContainer .BlogDate {\n grid-column: 2/3;\n grid-row: 2/3;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n z-index: 1;\n }\n .GridContainer .BlogTitle {\n grid-column: 2/4;\n font-size: 24px;\n color: #FFF;\n }\n .GridContainer .BlogContent {\n grid-column: 2/4;\n font-size: 14px;\n color: #FFF;\n }\n .GridContainer .BlogLink {\n grid-column: 2/4;\n color: #FFF;\n cursor: pointer;\n }\n .GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n background: none;\n color: #D0046C;\n cursor: pointer;\n }\n}";
|
|
28
|
+
const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.GridContainerWrapper {\n display: grid;\n}\n\n.GridContainer {\n margin: auto;\n width: 100%;\n height: 280px;\n border-radius: 15px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n gap: 30px;\n grid-template-rows: 1fr 4fr 1fr 1fr;\n grid-template-columns: 30px 1fr 1fr 30px;\n}\n.GridContainer .BlogBanner {\n grid-column: 1/3;\n grid-row: 1/5;\n}\n.GridContainer .BlogBanner img {\n border-radius: 5px 0 0 5px;\n width: 100%;\n height: 280px;\n}\n.GridContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n grid-column: 2/2;\n grid-row: 4/4;\n z-index: 1;\n}\n.GridContainer .BlogTitle {\n font-size: 24px;\n color: #FFF;\n margin-top: 20px;\n grid-column: 3/5;\n}\n.GridContainer .BlogContent {\n font-size: 14px;\n color: #FFF;\n width: 90%;\n max-height: 80px;\n overflow: hidden;\n text-overflow: ellipsis;\n grid-column: 3/5;\n}\n.GridContainer .BlogLink {\n grid-column: 3/5;\n color: #FFF;\n}\n.GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n padding: 0;\n background: none;\n color: #D0046C;\n cursor: pointer;\n}\n\n@container (max-width: 475px) {\n .GridContainerWrapper {\n display: grid;\n }\n\n .GridContainer {\n margin: auto;\n width: 100%;\n min-height: 400px;\n gap: 10%;\n padding-bottom: 30px;\n border-radius: 5px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n grid-template-rows: repeat(auto-fit, minmax(50px, 1fr));\n grid-template-rows: auto auto auto 50px;\n grid-template-columns: 15px auto auto 15px;\n gap: 10px;\n }\n .GridContainer .BlogBanner {\n grid-column: 1/5;\n grid-row: 1/3;\n margin: 0;\n }\n .GridContainer .BlogBanner img {\n width: 100%;\n height: 232px;\n border-radius: 5px 5px 0 0;\n }\n .GridContainer .BlogDate {\n grid-column: 2/3;\n grid-row: 2/3;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n z-index: 1;\n }\n .GridContainer .BlogTitle {\n grid-column: 2/4;\n font-size: 24px;\n color: #FFF;\n }\n .GridContainer .BlogContent {\n grid-column: 2/4;\n font-size: 14px;\n color: #FFF;\n }\n .GridContainer .BlogLink {\n grid-column: 2/4;\n color: #FFF;\n cursor: pointer;\n }\n .GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n background: none;\n color: #D0046C;\n cursor: pointer;\n }\n}";
|
|
29
29
|
|
|
30
30
|
const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
31
31
|
constructor() {
|
|
@@ -44,11 +44,7 @@ const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
44
44
|
/**
|
|
45
45
|
* Client custom styling via url
|
|
46
46
|
*/
|
|
47
|
-
this.
|
|
48
|
-
/**
|
|
49
|
-
* Client custom styling via url content
|
|
50
|
-
*/
|
|
51
|
-
this.clientStylingUrlContent = '';
|
|
47
|
+
this.clientStylingUrl = '';
|
|
52
48
|
/**
|
|
53
49
|
* Property used to display the publishing date
|
|
54
50
|
*/
|
|
@@ -69,10 +65,6 @@ const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
69
65
|
* Property used to display the button
|
|
70
66
|
*/
|
|
71
67
|
this.showButton = true;
|
|
72
|
-
/**
|
|
73
|
-
* Property used to display the button
|
|
74
|
-
*/
|
|
75
|
-
this.showVerticalGrid = false;
|
|
76
68
|
/**
|
|
77
69
|
* Event name to be sent when the button is clicked
|
|
78
70
|
*/
|
|
@@ -86,12 +78,11 @@ const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
86
78
|
this.stylingContainer.prepend(sheet);
|
|
87
79
|
};
|
|
88
80
|
this.setClientStylingURL = () => {
|
|
89
|
-
let url = new URL(this.
|
|
81
|
+
let url = new URL(this.clientStylingUrl);
|
|
90
82
|
let cssFile = document.createElement('style');
|
|
91
83
|
fetch(url.href)
|
|
92
84
|
.then((res) => res.text())
|
|
93
85
|
.then((data) => {
|
|
94
|
-
this.clientStylingUrlContent = data;
|
|
95
86
|
cssFile.innerHTML = data;
|
|
96
87
|
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
97
88
|
})
|
|
@@ -111,9 +102,6 @@ const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
111
102
|
this.getBlogArticleGrid();
|
|
112
103
|
}
|
|
113
104
|
}
|
|
114
|
-
toggleClass() {
|
|
115
|
-
this.showVerticalGrid = !this.showVerticalGrid;
|
|
116
|
-
}
|
|
117
105
|
handleAction(postId) {
|
|
118
106
|
this.getArticleId(postId);
|
|
119
107
|
}
|
|
@@ -122,6 +110,9 @@ const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
122
110
|
this.getBlogArticleGrid();
|
|
123
111
|
}
|
|
124
112
|
}
|
|
113
|
+
componentDidLoad() {
|
|
114
|
+
window.postMessage({ type: 'BlogArticlesGridLoaded' }, window.location.href);
|
|
115
|
+
}
|
|
125
116
|
getBlogArticleGrid() {
|
|
126
117
|
this.isLoading = true;
|
|
127
118
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);
|
|
@@ -150,7 +141,7 @@ const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
150
141
|
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
151
142
|
if (this.clientStyling)
|
|
152
143
|
this.setClientStyling();
|
|
153
|
-
if (this.
|
|
144
|
+
if (this.clientStylingUrl)
|
|
154
145
|
this.setClientStylingURL();
|
|
155
146
|
this.limitStylingAppends = true;
|
|
156
147
|
}
|
|
@@ -161,7 +152,7 @@ const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
161
152
|
return (h("div", { class: "BlogArticleDetails" }, h("div", { class: "Title" }, translate('error', this.language))));
|
|
162
153
|
}
|
|
163
154
|
if (!this.isLoading) {
|
|
164
|
-
return (h("div",
|
|
155
|
+
return (h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "GridContainerWrapper" }, this.blogData.map((data) => h("div", { class: "GridContainer" }, this.showPublishingDate &&
|
|
165
156
|
h("div", { class: "BlogDate" }, data.publishingDate), this.showImage &&
|
|
166
157
|
h("div", { class: "BlogBanner" }, h("img", { src: data.image.src, alt: data.title })), this.showTitle &&
|
|
167
158
|
h("div", { class: "BlogTitle" }, data.title), this.showContent &&
|
|
@@ -179,14 +170,12 @@ const BlogArticlesGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
179
170
|
"language": [1],
|
|
180
171
|
"handleClick": [1, "handle-click"],
|
|
181
172
|
"clientStyling": [1, "client-styling"],
|
|
182
|
-
"
|
|
183
|
-
"clientStylingUrlContent": [1, "client-styling-url-content"],
|
|
173
|
+
"clientStylingUrl": [1, "client-styling-url"],
|
|
184
174
|
"showPublishingDate": [4, "show-publishing-date"],
|
|
185
175
|
"showImage": [4, "show-image"],
|
|
186
176
|
"showTitle": [4, "show-title"],
|
|
187
177
|
"showContent": [4, "show-content"],
|
|
188
178
|
"showButton": [4, "show-button"],
|
|
189
|
-
"showVerticalGrid": [4, "show-vertical-grid"],
|
|
190
179
|
"usePostmessage": [4, "use-postmessage"],
|
|
191
180
|
"postMessageEvent": [1, "post-message-event"],
|
|
192
181
|
"hasErrors": [32],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-d61cebcb.js';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
4
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
|
|
@@ -25,7 +25,7 @@ const translate = (key, customLang) => {
|
|
|
25
25
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.GridContainer {\n margin: auto;\n width: 100%;\n height: 280px;\n border-radius: 15px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n gap: 30px;\n grid-template-rows: 1fr 4fr 1fr 1fr;\n grid-template-columns: 30px 1fr 1fr 30px;\n}\n.GridContainer .BlogBanner {\n grid-column: 1/3;\n grid-row: 1/5;\n}\n.GridContainer .BlogBanner img {\n border-radius: 5px 0 0 5px;\n width: 100%;\n height: 280px;\n}\n.GridContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n grid-column: 2/2;\n grid-row: 4/4;\n z-index: 1;\n}\n.GridContainer .BlogTitle {\n font-size: 24px;\n color: #FFF;\n margin-top: 20px;\n grid-column: 3/5;\n}\n.GridContainer .BlogContent {\n font-size: 14px;\n color: #FFF;\n width: 90%;\n max-height: 80px;\n overflow: hidden;\n text-overflow: ellipsis;\n grid-column: 3/5;\n}\n.GridContainer .BlogLink {\n grid-column: 3/5;\n color: #FFF;\n}\n.GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n padding: 0;\n background: none;\n color: #D0046C;\n cursor: pointer;\n}\n\n@container (max-width: 475px) {\n .GridContainer {\n margin: auto;\n width: 100%;\n min-height: 400px;\n gap: 10%;\n padding-bottom: 30px;\n border-radius: 5px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n grid-template-rows: repeat(auto-fit, minmax(50px, 1fr));\n grid-template-rows: auto auto auto 50px;\n grid-template-columns: 15px auto auto 15px;\n gap: 10px;\n }\n .GridContainer .BlogBanner {\n grid-column: 1/5;\n grid-row: 1/3;\n margin: 0;\n }\n .GridContainer .BlogBanner img {\n width: 100%;\n height: 232px;\n border-radius: 5px 5px 0 0;\n }\n .GridContainer .BlogDate {\n grid-column: 2/3;\n grid-row: 2/3;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n z-index: 1;\n }\n .GridContainer .BlogTitle {\n grid-column: 2/4;\n font-size: 24px;\n color: #FFF;\n }\n .GridContainer .BlogContent {\n grid-column: 2/4;\n font-size: 14px;\n color: #FFF;\n }\n .GridContainer .BlogLink {\n grid-column: 2/4;\n color: #FFF;\n cursor: pointer;\n }\n .GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n background: none;\n color: #D0046C;\n cursor: pointer;\n }\n}";
|
|
28
|
+
const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.GridContainerWrapper {\n display: grid;\n}\n\n.GridContainer {\n margin: auto;\n width: 100%;\n height: 280px;\n border-radius: 15px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n gap: 30px;\n grid-template-rows: 1fr 4fr 1fr 1fr;\n grid-template-columns: 30px 1fr 1fr 30px;\n}\n.GridContainer .BlogBanner {\n grid-column: 1/3;\n grid-row: 1/5;\n}\n.GridContainer .BlogBanner img {\n border-radius: 5px 0 0 5px;\n width: 100%;\n height: 280px;\n}\n.GridContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n grid-column: 2/2;\n grid-row: 4/4;\n z-index: 1;\n}\n.GridContainer .BlogTitle {\n font-size: 24px;\n color: #FFF;\n margin-top: 20px;\n grid-column: 3/5;\n}\n.GridContainer .BlogContent {\n font-size: 14px;\n color: #FFF;\n width: 90%;\n max-height: 80px;\n overflow: hidden;\n text-overflow: ellipsis;\n grid-column: 3/5;\n}\n.GridContainer .BlogLink {\n grid-column: 3/5;\n color: #FFF;\n}\n.GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n padding: 0;\n background: none;\n color: #D0046C;\n cursor: pointer;\n}\n\n@container (max-width: 475px) {\n .GridContainerWrapper {\n display: grid;\n }\n\n .GridContainer {\n margin: auto;\n width: 100%;\n min-height: 400px;\n gap: 10%;\n padding-bottom: 30px;\n border-radius: 5px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n grid-template-rows: repeat(auto-fit, minmax(50px, 1fr));\n grid-template-rows: auto auto auto 50px;\n grid-template-columns: 15px auto auto 15px;\n gap: 10px;\n }\n .GridContainer .BlogBanner {\n grid-column: 1/5;\n grid-row: 1/3;\n margin: 0;\n }\n .GridContainer .BlogBanner img {\n width: 100%;\n height: 232px;\n border-radius: 5px 5px 0 0;\n }\n .GridContainer .BlogDate {\n grid-column: 2/3;\n grid-row: 2/3;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n z-index: 1;\n }\n .GridContainer .BlogTitle {\n grid-column: 2/4;\n font-size: 24px;\n color: #FFF;\n }\n .GridContainer .BlogContent {\n grid-column: 2/4;\n font-size: 14px;\n color: #FFF;\n }\n .GridContainer .BlogLink {\n grid-column: 2/4;\n color: #FFF;\n cursor: pointer;\n }\n .GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n background: none;\n color: #D0046C;\n cursor: pointer;\n }\n}";
|
|
29
29
|
|
|
30
30
|
const BlogArticlesGrid = class {
|
|
31
31
|
constructor(hostRef) {
|
|
@@ -42,11 +42,7 @@ const BlogArticlesGrid = class {
|
|
|
42
42
|
/**
|
|
43
43
|
* Client custom styling via url
|
|
44
44
|
*/
|
|
45
|
-
this.
|
|
46
|
-
/**
|
|
47
|
-
* Client custom styling via url content
|
|
48
|
-
*/
|
|
49
|
-
this.clientStylingUrlContent = '';
|
|
45
|
+
this.clientStylingUrl = '';
|
|
50
46
|
/**
|
|
51
47
|
* Property used to display the publishing date
|
|
52
48
|
*/
|
|
@@ -67,10 +63,6 @@ const BlogArticlesGrid = class {
|
|
|
67
63
|
* Property used to display the button
|
|
68
64
|
*/
|
|
69
65
|
this.showButton = true;
|
|
70
|
-
/**
|
|
71
|
-
* Property used to display the button
|
|
72
|
-
*/
|
|
73
|
-
this.showVerticalGrid = false;
|
|
74
66
|
/**
|
|
75
67
|
* Event name to be sent when the button is clicked
|
|
76
68
|
*/
|
|
@@ -84,12 +76,11 @@ const BlogArticlesGrid = class {
|
|
|
84
76
|
this.stylingContainer.prepend(sheet);
|
|
85
77
|
};
|
|
86
78
|
this.setClientStylingURL = () => {
|
|
87
|
-
let url = new URL(this.
|
|
79
|
+
let url = new URL(this.clientStylingUrl);
|
|
88
80
|
let cssFile = document.createElement('style');
|
|
89
81
|
fetch(url.href)
|
|
90
82
|
.then((res) => res.text())
|
|
91
83
|
.then((data) => {
|
|
92
|
-
this.clientStylingUrlContent = data;
|
|
93
84
|
cssFile.innerHTML = data;
|
|
94
85
|
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
95
86
|
})
|
|
@@ -109,9 +100,6 @@ const BlogArticlesGrid = class {
|
|
|
109
100
|
this.getBlogArticleGrid();
|
|
110
101
|
}
|
|
111
102
|
}
|
|
112
|
-
toggleClass() {
|
|
113
|
-
this.showVerticalGrid = !this.showVerticalGrid;
|
|
114
|
-
}
|
|
115
103
|
handleAction(postId) {
|
|
116
104
|
this.getArticleId(postId);
|
|
117
105
|
}
|
|
@@ -120,6 +108,9 @@ const BlogArticlesGrid = class {
|
|
|
120
108
|
this.getBlogArticleGrid();
|
|
121
109
|
}
|
|
122
110
|
}
|
|
111
|
+
componentDidLoad() {
|
|
112
|
+
window.postMessage({ type: 'BlogArticlesGridLoaded' }, window.location.href);
|
|
113
|
+
}
|
|
123
114
|
getBlogArticleGrid() {
|
|
124
115
|
this.isLoading = true;
|
|
125
116
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);
|
|
@@ -148,7 +139,7 @@ const BlogArticlesGrid = class {
|
|
|
148
139
|
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
149
140
|
if (this.clientStyling)
|
|
150
141
|
this.setClientStyling();
|
|
151
|
-
if (this.
|
|
142
|
+
if (this.clientStylingUrl)
|
|
152
143
|
this.setClientStylingURL();
|
|
153
144
|
this.limitStylingAppends = true;
|
|
154
145
|
}
|
|
@@ -159,7 +150,7 @@ const BlogArticlesGrid = class {
|
|
|
159
150
|
return (h("div", { class: "BlogArticleDetails" }, h("div", { class: "Title" }, translate('error', this.language))));
|
|
160
151
|
}
|
|
161
152
|
if (!this.isLoading) {
|
|
162
|
-
return (h("div",
|
|
153
|
+
return (h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "GridContainerWrapper" }, this.blogData.map((data) => h("div", { class: "GridContainer" }, this.showPublishingDate &&
|
|
163
154
|
h("div", { class: "BlogDate" }, data.publishingDate), this.showImage &&
|
|
164
155
|
h("div", { class: "BlogBanner" }, h("img", { src: data.image.src, alt: data.title })), this.showTitle &&
|
|
165
156
|
h("div", { class: "BlogTitle" }, data.title), this.showContent &&
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-d61cebcb.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["blog-articles-grid",[[1,"blog-articles-grid",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"handleClick":[1,"handle-click"],"clientStyling":[1,"client-styling"],"
|
|
16
|
+
return bootstrapLazy([["blog-articles-grid",[[1,"blog-articles-grid",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"handleClick":[1,"handle-click"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showPublishingDate":[4,"show-publishing-date"],"showImage":[4,"show-image"],"showTitle":[4,"show-title"],"showContent":[4,"show-content"],"showButton":[4,"show-button"],"usePostmessage":[4,"use-postmessage"],"postMessageEvent":[1,"post-message-event"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32]}]]]], options);
|
|
17
17
|
});
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-d61cebcb.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["blog-articles-grid",[[1,"blog-articles-grid",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"handleClick":[1,"handle-click"],"clientStyling":[1,"client-styling"],"
|
|
13
|
+
return bootstrapLazy([["blog-articles-grid",[[1,"blog-articles-grid",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"handleClick":[1,"handle-click"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showPublishingDate":[4,"show-publishing-date"],"showImage":[4,"show-image"],"showTitle":[4,"show-title"],"showContent":[4,"show-content"],"showButton":[4,"show-button"],"usePostmessage":[4,"use-postmessage"],"postMessageEvent":[1,"post-message-event"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -19,11 +19,7 @@ export declare class BlogArticlesGrid {
|
|
|
19
19
|
/**
|
|
20
20
|
* Client custom styling via url
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Client custom styling via url content
|
|
25
|
-
*/
|
|
26
|
-
clientStylingUrlContent: string;
|
|
22
|
+
clientStylingUrl: string;
|
|
27
23
|
/**
|
|
28
24
|
* Property used to display the publishing date
|
|
29
25
|
*/
|
|
@@ -44,10 +40,6 @@ export declare class BlogArticlesGrid {
|
|
|
44
40
|
* Property used to display the button
|
|
45
41
|
*/
|
|
46
42
|
showButton: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Property used to display the button
|
|
49
|
-
*/
|
|
50
|
-
showVerticalGrid: boolean;
|
|
51
43
|
/**
|
|
52
44
|
* Use postMessage event to communicate
|
|
53
45
|
*/
|
|
@@ -64,9 +56,9 @@ export declare class BlogArticlesGrid {
|
|
|
64
56
|
watchEndpoint(newValue: string, oldValue: string): void;
|
|
65
57
|
private stylingContainer;
|
|
66
58
|
private blogData;
|
|
67
|
-
toggleClass(): void;
|
|
68
59
|
handleAction(postId: any): void;
|
|
69
60
|
connectedCallback(): void;
|
|
61
|
+
componentDidLoad(): void;
|
|
70
62
|
getBlogArticleGrid(): void;
|
|
71
63
|
componentDidRender(): void;
|
|
72
64
|
setClientStyling: () => void;
|
|
@@ -11,14 +11,10 @@ export namespace Components {
|
|
|
11
11
|
* Client custom styling via string
|
|
12
12
|
*/
|
|
13
13
|
"clientStyling": string;
|
|
14
|
-
/**
|
|
15
|
-
* Client custom styling via url content
|
|
16
|
-
*/
|
|
17
|
-
"clientStylingUrlContent": string;
|
|
18
14
|
/**
|
|
19
15
|
* Client custom styling via url
|
|
20
16
|
*/
|
|
21
|
-
"
|
|
17
|
+
"clientStylingUrl": string;
|
|
22
18
|
/**
|
|
23
19
|
* Endpoint URL for the source of data
|
|
24
20
|
*/
|
|
@@ -55,10 +51,6 @@ export namespace Components {
|
|
|
55
51
|
* Property used to display the image
|
|
56
52
|
*/
|
|
57
53
|
"showTitle": boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Property used to display the button
|
|
60
|
-
*/
|
|
61
|
-
"showVerticalGrid": boolean;
|
|
62
54
|
/**
|
|
63
55
|
* Use postMessage event to communicate
|
|
64
56
|
*/
|
|
@@ -82,14 +74,10 @@ declare namespace LocalJSX {
|
|
|
82
74
|
* Client custom styling via string
|
|
83
75
|
*/
|
|
84
76
|
"clientStyling"?: string;
|
|
85
|
-
/**
|
|
86
|
-
* Client custom styling via url content
|
|
87
|
-
*/
|
|
88
|
-
"clientStylingUrlContent"?: string;
|
|
89
77
|
/**
|
|
90
78
|
* Client custom styling via url
|
|
91
79
|
*/
|
|
92
|
-
"
|
|
80
|
+
"clientStylingUrl"?: string;
|
|
93
81
|
/**
|
|
94
82
|
* Endpoint URL for the source of data
|
|
95
83
|
*/
|
|
@@ -127,10 +115,6 @@ declare namespace LocalJSX {
|
|
|
127
115
|
* Property used to display the image
|
|
128
116
|
*/
|
|
129
117
|
"showTitle"?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Property used to display the button
|
|
132
|
-
*/
|
|
133
|
-
"showVerticalGrid"?: boolean;
|
|
134
118
|
/**
|
|
135
119
|
* Use postMessage event to communicate
|
|
136
120
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/blog-articles-grid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.4",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"es2015": "./dist/esm/index.mjs",
|
|
@@ -15,5 +15,9 @@
|
|
|
15
15
|
],
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@everymatrix/helper-modal": "*",
|
|
21
|
+
"@stencil/core": "2.17.4"
|
|
18
22
|
}
|
|
19
23
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,c as t,h as i}from"./p-c88aa418.js";const r=["ro","en","fr","ar"],o={en:{error:"Error",readmore:"Read more"},ro:{error:"Eroare",readmore:"Read more"},fr:{error:"Error",readmore:"Read more"},ar:{error:"خطأ",readmore:"Read more"}},e=(n,t)=>{const i=t;return o[void 0!==i&&r.includes(i)?i:"en"][n]},s=class{constructor(i){n(this,i),this.articleActionButton=t(this,"articleActionButton",7),this.language="en",this.clientStyling="",this.clientStylingurl="",this.clientStylingUrlContent="",this.showPublishingDate=!0,this.showImage=!0,this.showTitle=!0,this.showContent=!0,this.showButton=!0,this.showVerticalGrid=!1,this.postMessageEvent="articleActionButton",this.hasErrors=!1,this.limitStylingAppends=!1,this.isLoading=!0,this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.stylingContainer.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingurl),t=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{this.clientStylingUrlContent=n,t.innerHTML=n,setTimeout((()=>{this.stylingContainer.prepend(t)}),1)})).catch((n=>{console.log("error ",n)}))}}getArticleId(n){this.articleActionButton.emit({postId:n}),this.usePostmessage&&window.postMessage({type:this.postMessageEvent,postId:n})}watchEndpoint(n,t){n&&n!=t&&this.cmsEndpoint&&this.getBlogArticleGrid()}toggleClass(){this.showVerticalGrid=!this.showVerticalGrid}handleAction(n){this.getArticleId(n)}connectedCallback(){this.cmsEndpoint&&this.language&&this.getBlogArticleGrid()}getBlogArticleGrid(){this.isLoading=!0;let n=new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);fetch(n.href).then((n=>{if(n.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return n.json()})).then((n=>{this.blogData=n.map((n=>Object.assign(Object.assign({},n),{publishingDate:new Date(n.publishingDate).toLocaleDateString()}))),this.isLoading=!1})).catch((n=>{this.hasErrors=!0,console.log("Error",n)})).finally((()=>this.isLoading=!1))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return this.hasErrors?i("div",{class:"BlogArticleDetails"},i("div",{class:"Title"},e("error",this.language))):this.isLoading?void 0:i("div",null,i("div",{ref:n=>this.stylingContainer=n},this.blogData.map((n=>i("div",{class:"GridContainer"},this.showPublishingDate&&i("div",{class:"BlogDate"},n.publishingDate),this.showImage&&i("div",{class:"BlogBanner"},i("img",{src:n.image.src,alt:n.title})),this.showTitle&&i("div",{class:"BlogTitle"},n.title),this.showContent&&i("div",{class:"BlogContent",innerHTML:n.content}),this.showButton&&i("div",{class:"BlogLink"},i("button",{onClick:()=>this.handleAction(n.postID)},e("readmore",this.language))))))))}static get watchers(){return{cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"]}}};s.style=":host {\n display: block;\n}\n\n.GridContainer {\n margin: auto;\n width: 100%;\n height: 280px;\n border-radius: 15px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n gap: 30px;\n grid-template-rows: 1fr 4fr 1fr 1fr;\n grid-template-columns: 30px 1fr 1fr 30px;\n}\n.GridContainer .BlogBanner {\n grid-column: 1/3;\n grid-row: 1/5;\n}\n.GridContainer .BlogBanner img {\n border-radius: 5px 0 0 5px;\n width: 100%;\n height: 280px;\n}\n.GridContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n grid-column: 2/2;\n grid-row: 4/4;\n z-index: 1;\n}\n.GridContainer .BlogTitle {\n font-size: 24px;\n color: #FFF;\n margin-top: 20px;\n grid-column: 3/5;\n}\n.GridContainer .BlogContent {\n font-size: 14px;\n color: #FFF;\n width: 90%;\n max-height: 80px;\n overflow: hidden;\n text-overflow: ellipsis;\n grid-column: 3/5;\n}\n.GridContainer .BlogLink {\n grid-column: 3/5;\n color: #FFF;\n}\n.GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n padding: 0;\n background: none;\n color: #D0046C;\n cursor: pointer;\n}\n\n@container (max-width: 475px) {\n .GridContainer {\n margin: auto;\n width: 100%;\n min-height: 400px;\n gap: 10%;\n padding-bottom: 30px;\n border-radius: 5px;\n background-color: #07072A;\n margin-bottom: 20px;\n display: grid;\n grid-template-rows: repeat(auto-fit, minmax(50px, 1fr));\n grid-template-rows: auto auto auto 50px;\n grid-template-columns: 15px auto auto 15px;\n gap: 10px;\n }\n .GridContainer .BlogBanner {\n grid-column: 1/5;\n grid-row: 1/3;\n margin: 0;\n }\n .GridContainer .BlogBanner img {\n width: 100%;\n height: 232px;\n border-radius: 5px 5px 0 0;\n }\n .GridContainer .BlogDate {\n grid-column: 2/3;\n grid-row: 2/3;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: #FFFFFF;\n background-color: #0D0D4D;\n z-index: 1;\n }\n .GridContainer .BlogTitle {\n grid-column: 2/4;\n font-size: 24px;\n color: #FFF;\n }\n .GridContainer .BlogContent {\n grid-column: 2/4;\n font-size: 14px;\n color: #FFF;\n }\n .GridContainer .BlogLink {\n grid-column: 2/4;\n color: #FFF;\n cursor: pointer;\n }\n .GridContainer .BlogLink button {\n font-size: 14px;\n border: none;\n background: none;\n color: #D0046C;\n cursor: pointer;\n }\n}";export{s as blog_articles_grid}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,d=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?$(null,l):l),o=s)};if(c(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=$(e,null);return i.u=t,r.length>0&&(i.$=r),i},$=(e,t)=>({t:0,h:e,i:t,m:null,$:null,u:null}),h={},y=(e,t,n,s,r,c)=>{if(n!==s){let i=z(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=p(n),o=p(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("ref"===t)s&&s(e);else if(i||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((i||l&&null!==s)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&c||r)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):z(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},m=/\s/,p=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||a,r=t.u||a;for(l in o)l in r||y(s,l,o[l],void 0,n,t.t);for(l in r)y(s,l,o[l],r[l],n,t.t)},w=(t,n,l)=>{let o,r,c=n.$[l],i=0;if(null!==c.i)o=c.m=s.createTextNode(c.i);else if(o=c.m=s.createElement(c.h),b(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.$)for(i=0;i<c.$.length;++i)r=w(t,c,i),r&&o.appendChild(r);return o},S=(e,n,l,s,o,r)=>{let c,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=w(null,l,o),c&&(s[o].m=c,i.insertBefore(c,n)))},g=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,M(l),s.remove())},j=(e,t)=>e.h===t.h,v=(e,t)=>{const n=t.m=e.m,l=e.$,s=t.$,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,c=t.length-1,i=t[0],u=t[c],a=l.length-1,f=l[0],d=l[a];for(;o<=c&&r<=a;)null==i?i=t[++o]:null==u?u=t[--c]:null==f?f=l[++r]:null==d?d=l[--a]:j(i,f)?(v(i,f),i=t[++o],f=l[++r]):j(u,d)?(v(u,d),u=t[--c],d=l[--a]):j(i,d)?(v(i,d),e.insertBefore(i.m,u.m.nextSibling),i=t[++o],d=l[--a]):j(u,f)?(v(u,f),e.insertBefore(u.m,i.m),u=t[--c],f=l[++r]):(s=w(t&&t[r],n,r),f=l[++r],s&&i.m.parentNode.insertBefore(s,i.m));o>c?S(e,null==l[a+1]?null:l[a+1].m,n,l,r,a):r>a&&g(t,o,c)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},M=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(M)},k=(e,t,n)=>{const l=(e=>H(e).p)(e);return{emit:e=>C(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},C=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},O=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},P=(e,t)=>{if(e.t|=16,!(4&e.t))return O(e,e.g),te((()=>x(e,t)));e.t|=512},x=(e,t)=>{const n=e.j;return L(void 0,(()=>E(e,n,t)))},E=async(e,t,n)=>{const l=e.p,o=l["s-rc"];n&&(e=>{const t=e.v,n=e.p,l=t.t,o=((e,t)=>{let n=u(t),l=J.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=i.get(e=e.head||e);o||i.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);N(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>R(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},N=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.p,o=n.M||$(null,null),r=(e=>e&&e.h===h)(l)?l:d(null,null,l);t=s.tagName,r.h=null,r.t|=4,n.M=r,r.m=o.m=s.shadowRoot||s,e=s["s-sc"],v(o,r)})(n,l)}catch(e){B(e,n.p)}return null},R=e=>{const t=e.p,n=e.g;A(e.j,"componentDidRender"),64&e.t||(e.t|=64,U(t),e.k(t),n||T()),e.S&&(e.S(),e.S=void 0),512&e.t&&ee((()=>P(e,!1))),e.t&=-517},T=()=>{U(s.documentElement),ee((()=>C(l,"appload",{detail:{namespace:"blog-articles-grid"}})))},A=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){B(e)}},L=(e,t)=>e&&e.then?e.then(t):t(),U=e=>e.classList.add("hydrated"),W=(e,t,n)=>{if(t.C){e.watchers&&(t.O=e.watchers);const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>H(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=H(e),o=s.p,r=s.P.get(t),c=s.t,i=s.j;if(n=((e,t)=>null==e||f(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.C[t][0]),(!(8&c)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(s.P.set(t,n),i)){if(l.O&&128&c){const e=l.O[t];e&&e.map((e=>{try{i[e](n,r,t)}catch(e){B(e,o)}}))}2==(18&c)&&P(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},q=e=>{A(e,"connectedCallback")},D=(e,t={})=>{const n=[],r=t.exclude||[],i=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let h,y=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],C:t[2],N:t[3]};l.C=t[2],l.O={};const s=l.o,a=class extends HTMLElement{constructor(e){super(e),_(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),y?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=H(e),n=t.v,l=()=>{};if(1&t.t)q(t.j);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){O(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=I(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.O=s.watchers,W(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){B(e)}t.t&=-9,t.t|=128,e(),q(t.j)}if(s.style){let e=s.style;const t=u(n);if(!J.has(t)){const l=()=>{};((e,t,n)=>{let l=J.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,J.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,r=()=>P(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return H(this).R}};l.T=e[0],r.includes(s)||i.get(s)||(n.push(s),i.define(s,W(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),y=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>h=setTimeout(T,30)))},F=new WeakMap,H=e=>F.get(e),V=(e,t)=>F.set(t.j=e,t),_=(e,t)=>{const n={t:0,p:e,v:t,P:new Map};return n.R=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],F.set(e,n)},z=(e,t)=>t in e,B=(e,t)=>(0,console.error)(e,t),G=new Map,I=e=>{const t=e.o.replace(/-/g,"_"),n=e.T,l=G.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(G.set(n,e),e[t])),B)},J=new Map,K=[],Q=[],X=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?ee(Z):o.raf(Z))},Y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){B(e)}e.length=0},Z=()=>{Y(K),Y(Q),(n=K.length>0)&&o.raf(Z)},ee=e=>r().then(e),te=X(Q,!0);export{D as b,k as c,d as h,r as p,V as r}
|