@everymatrix/blog-article-details 1.52.6 → 1.53.10
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-article-details/blog-article-details.esm.js +1 -1
- package/dist/blog-article-details/p-0d6bb34f.entry.js +1 -0
- package/dist/blog-article-details/p-2b35fdbf.js +2 -0
- package/dist/cjs/blog-article-details.cjs.entry.js +46 -20
- package/dist/cjs/blog-article-details.cjs.js +2 -2
- package/dist/cjs/{index-fb71f202.js → index-a091cae7.js} +167 -72
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/blog-article-details/blog-article-details.js +73 -19
- package/dist/esm/blog-article-details.entry.js +46 -20
- package/dist/esm/blog-article-details.js +3 -3
- package/dist/esm/{index-7ef6b24c.js → index-da72f48b.js} +167 -72
- package/dist/esm/loader.js +2 -2
- package/package.json +1 -1
- package/dist/blog-article-details/p-7184e790.entry.js +0 -1
- package/dist/blog-article-details/p-aaa8e218.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,b as n}from"./p-
|
|
1
|
+
import{p as t,b as n}from"./p-2b35fdbf.js";export{s as setNonce}from"./p-2b35fdbf.js";import{g as e}from"./p-e1255160.js";(()=>{const n=import.meta.url,s={};return""!==n&&(s.resourcesUrl=new URL(".",n).href),t(s)})().then((async t=>(await e(),n([["p-0d6bb34f",[[1,"blog-article-details",{cmsEndpoint:[513,"cms-endpoint"],language:[513],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showContent:[516,"show-content"],postId:[514,"post-id"],postSlug:[513,"post-slug"],postCustomPath:[513,"post-custom-path"],intlDateTimeFormat:[1,"intl-date-time-format"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32],bannerMatrixReady:[32],device:[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{postId:["watchEndpoint"],postSlug:["watchEndpoint"],postCustomPath:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"]}]]]],t))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i}from"./p-2b35fdbf.js";const n={en:{error:"Error"},ro:{error:"Eroare"},fr:{error:"Error"},ar:{error:"خطأ"},hr:{error:"Greška"},"pt-br":{error:"Erro"},"es-mx":{error:"Error"}};const e=class{constructor(n){t(this,n),this.language="en",this.userRoles="everyone",this.cmsEnv="stage",this.clientStyling="",this.clientStylingUrl="",this.showPublishingDate=!0,this.showImage=!0,this.showTitle=!0,this.showContent=!0,this.intlDateTimeFormat="",this.hasErrors=!1,this.limitStylingAppends=!1,this.isLoading=!0,this.bannerMatrixReady=!1,this.device="",this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},this.renderContentConditionally=t=>-1!==(null==t?void 0:t.indexOf("<bannermatrix-banner"))?this.bannerMatrixReady?i("div",{class:"BlogContent",innerHTML:t}):null:i("div",{class:"BlogContent",innerHTML:t}),this.setImage=t=>{let i="";switch(this.device){case"mobile":i=t.sources[0].pictureSource;break;case"tablet":i=t.sources[1].pictureSource;break;case"desktop":i=t.sources[2].pictureSource}return i}}handleBannerReady(){this.bannerMatrixReady=!0}watchEndpoint(t,i){t&&t!=i&&this.cmsEndpoint&&this.language&&(this.postCustomPath||this.postSlug||this.postId)&&this.getBlogArticleDetails()}handleStylingChange(t,i){t!==i&&this.setClientStyling()}handleStylingUrlChange(t,i){t!==i&&this.setClientStylingURL()}connectedCallback(){this.cmsEndpoint&&this.language&&(this.postCustomPath||this.postSlug||this.postId)&&this.getBlogArticleDetails()}getBlogArticleDetails(){if(!this.postId&&!this.postSlug&&!this.postCustomPath)throw this.hasErrors=!0,new Error("postId, postSlug or postCustomPath parameter has to be provided!");this.isLoading=!0;let t=new URL(`${this.cmsEndpoint}/${this.language}/blog-posts${this.postCustomPath?"":"/"+this.postSlug||"/"+this.postId}`);t.searchParams.append("env",this.cmsEnv),t.searchParams.append("userRoles",this.userRoles),t.searchParams.append("device",(()=>{const t=(()=>{let t=window.navigator.userAgent;return t.toLowerCase().match(/android/i)?"Android":t.toLowerCase().match(/iphone/i)?"iPhone":t.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(t)return"PC"===t?"dk":"mtWeb"})()),this.postCustomPath&&t.searchParams.append("customURL",this.postCustomPath),fetch(t.href).then((t=>{if(t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{if(t.count>=1&&this.postCustomPath){let i=new Date(t.items[0].publishingDate),n=0;for(let e=1;e<t.items.length;e++){const s=new Date(t.items[e].publishingDate);i.getTime()<s.getTime()&&(i=s,n=e)}this.blogData=t.items[n]}else this.blogData=t;this.isLoading=!1})).catch((t=>{this.hasErrors=!0,console.log("Error",t)})).finally((()=>this.isLoading=!1))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}componentDidLoad(){this.detectAndAlertDeviceType()}detectAndAlertDeviceType(){this.device=function(){const t=navigator.userAgent.toLowerCase();let i="";return i=t.includes("android")||t.includes("iphone")||t.includes("ipad")?function(){const t=screen.availWidth;return t<600?"mobile":t>=600&&t<1100?"tablet":void 0}():"desktop",i}()}formatDate(t){return new Intl.DateTimeFormat(this.intlDateTimeFormat||"en-GB").format(new Date(t))}render(){var t,e,s,o,r,h;return this.hasErrors?i("div",{class:"BlogArticleDetails"},i("div",{class:"Title"},n[void 0!==(h=this.language)&&h in n?h:"en"].error)):this.isLoading?void 0:i("div",{ref:t=>this.stylingContainer=t},i("div",{class:"DetailsContainer"},i("div",{class:"DetailsHeadWrapper"},this.showPublishingDate&&this.blogData.publishingDate&&i("div",{class:"BlogDate"},this.formatDate(null===(t=this.blogData)||void 0===t?void 0:t.publishingDate)),this.showImage&&i("div",{class:"BlogBanner"},(null===(e=this.blogData.image)||void 0===e?void 0:e.src)?i("div",{style:{background:`url(${this.setImage(this.blogData.image)}) no-repeat center center / cover`}}):(null===(s=this.blogData.video)||void 0===s?void 0:s.sources[this.device])?i("video",{src:this.blogData.video.sources[this.device],controls:!0}):i("h1",{style:{color:"white"}},"No Image"))),i("div",{class:"DetailsBodyWrapper"},this.showTitle&&i("div",{class:"BlogTitle"},null===(o=this.blogData)||void 0===o?void 0:o.title),this.showContent&&this.renderContentConditionally(null===(r=this.blogData)||void 0===r?void 0:r.content))))}static get watchers(){return{postId:["watchEndpoint"],postSlug:["watchEndpoint"],postCustomPath:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"]}}};e.style=":host {\n display: block;\n}\n\n.DetailsContainer {\n background-color: #07072A;\n color: #fff;\n display: flex;\n flex-direction: column;\n}\n.DetailsContainer .BlogBanner div {\n height: 400px;\n}\n.DetailsContainer .DetailsHeadWrapper {\n position: relative;\n}\n.DetailsContainer .DetailsBodyWrapper {\n padding: 30px;\n}\n.DetailsContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n background-color: #0D0D4D;\n z-index: 1;\n text-wrap: nowrap;\n position: absolute;\n bottom: 0;\n left: 30px;\n}\n.DetailsContainer .BlogTitle {\n font-size: 24px;\n}\n.DetailsContainer .BlogContent {\n font-size: 14px;\n}\n.DetailsContainer .BlogContent p:last-child {\n margin-bottom: 0;\n}\n\n@container (max-width: 475px) {\n .DetailsContainer {\n font-size: 12px;\n }\n}";export{e as blog_article_details}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),o=(t,n)=>{e.set(n.t=t,n)},l=(t,e)=>(0,console.error)(t,e),s=new Map,i=new Map,r="slot-fb{display:contents}slot-fb[hidden]{display:none}",c="undefined"!=typeof window?window:{},u=c.document||{head:{}},a={o:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},f=t=>Promise.resolve(t),h=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),d=!1,p=[],m=[],y=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&a.o?$(b):a.raf(b))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},b=()=>{v(p),v(m),(d=p.length>0)&&a.raf(b)},$=t=>f().then(t),w=y(m,!0),S=t=>"object"==(t=typeof t)||"function"===t;function g(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>O,map:()=>k,ok:()=>j,unwrap:()=>C,unwrapErr:()=>M});var j=t=>({isOk:!0,isErr:!1,value:t}),O=t=>({isOk:!1,isErr:!0,value:t});function k(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>j(t))):j(n)}if(t.isErr)return O(t.value);throw"should never get here"}var E,C=t=>{if(t.isOk)return t.value;throw t.value},M=t=>{if(t.isErr)return t.value;throw t.value},P=(t,e,...n)=>{let o=null,l=!1,s=!1;const i=[],r=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?r(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!S(o))&&(o+=""),l&&s?i[i.length-1].i+=o:i.push(l?x(null,o):o),s=l)};if(r(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}const c=x(t,null);return c.u=e,i.length>0&&(c.h=i),c},x=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),A={},D=(t,e)=>null==t||S(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t,H=new WeakMap,N=t=>"sc-"+t.v,R=(t,e,n,o,l,s)=>{if(n!==o){let i=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,l=F(n);let s=F(o);e.remove(...l.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)o&&null!=o[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in o)n&&o[e]===n[e]||(e.includes("-")?t.style.setProperty(e,o[e]):t.style[e]=o[e])}else if("ref"===e)o&&o(t);else{const r=S(o);if((i||r&&null!==o)&&!l)try{if(t.tagName.includes("-"))t[e]!==o&&(t[e]=o);else{const l=null==o?"":o;"list"===e?i=!1:null!=n&&t[e]==l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&s||l)&&!r&&t.setAttribute(e,o=!0===o?"":o)}}},T=/\s/,F=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(T):[]),L=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||{},s=e.u||{};for(const t of U(Object.keys(l)))t in s||R(o,t,l[t],void 0,n,e.o);for(const t of U(Object.keys(s)))R(o,t,l[t],s[t],n,e.o)};function U(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,W=(t,e,n)=>{const o=e.h[n];let l,s,i=0;if(null!==o.i)l=o.m=u.createTextNode(o.i);else if(l=o.m=u.createElement(o.p),L(null,o,V),o.h)for(i=0;i<o.h.length;++i)s=W(t,o,i),s&&l.appendChild(s);return l["s-hn"]=E,l},q=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===E&&(r=r.shadowRoot);l<=s;++l)o[l]&&(i=W(null,n,l),i&&(o[l].m=i,I(r,i,e)))},G=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.m;B(e),t&&t.remove()}}},_=(t,e,n=!1)=>t.p===e.p&&(n&&!t.$&&e.$&&(t.$=e.$),!0),z=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,s=e.h,i=e.i;null===i?(L(t,e,V),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i=0,r=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],d=o[f];for(;i<=c&&r<=f;)null==u?u=e[++i]:null==a?a=e[--c]:null==h?h=o[++r]:null==d?d=o[--f]:_(u,h,l)?(z(u,h,l),u=e[++i],h=o[++r]):_(a,d,l)?(z(a,d,l),a=e[--c],d=o[--f]):_(u,d,l)?(z(u,d,l),I(t,u.m,a.m.nextSibling),u=e[++i],d=o[--f]):_(a,h,l)?(z(a,h,l),I(t,a.m,u.m),a=e[--c],h=o[++r]):(s=W(e&&e[r],n,r),h=o[++r],s&&I(u.m.parentNode,s,u.m));i>c?q(t,null==o[f+1]?null:o[f+1].m,n,o,r,f):r>f&&G(e,i,c)})(o,l,e,s,n):null!==s?(null!==t.i&&(o.textContent=""),q(o,null,e,s,0,s.length-1)):!n&&null!==l&&G(l,0,l.length-1)):t.i!==i&&(o.data=i)},B=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(B)},I=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),J=(t,e)=>{if(e&&!t.S&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.S=()=>{e["s-p"].splice(n-1,1),o()})))}},K=(t,e)=>{if(t.o|=16,!(4&t.o))return J(t,t.j),w((()=>Q(t,e)));t.o|=512},Q=(t,e)=>{const n=t.$hostElement$,o=t.t;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return e&&(t.o|=256,t.O&&(t.O.map((([t,e])=>ot(o,t,e,n))),t.O=void 0)),X(void 0,(()=>Z(t,o,e)))},X=(t,e)=>Y(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Y=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Z=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.k,n=t.$hostElement$,o=e.o,l=((t,e)=>{var n;const o=N(e),l=i.get(o);if(t=11===t.nodeType?t:u,l)if("string"==typeof l){let s,i=H.get(t=t.head||t);if(i||H.set(t,i=new Set),!i.has(o)){{s=document.querySelector(`[sty-id="${o}"]`)||u.createElement("style"),s.innerHTML=l;const i=null!=(n=a.C)?n:g(u);if(null!=i&&s.setAttribute("nonce",i),!(1&e.o))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(h){const e=new CSSStyleSheet;e.replaceSync(l),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=l+e.innerHTML:t.prepend(s)}else t.append(s);1&e.o&&"HEAD"!==t.nodeName&&t.insertBefore(s,null)}4&e.o&&(s.innerHTML+=r),i&&i.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&2&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);tt(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>et(t);0===e.length?n():(Promise.all(e).then(n),t.o|=4,e.length=0)}},tt=(t,e,n,o)=>{try{e=e.render(),t.o&=-17,t.o|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.k,s=t.M||x(null,null),i=(t=>t&&t.p===A)(e)?e:P(null,null,e);if(E=o.tagName,l.P&&(i.u=i.u||{},l.P.map((([t,e])=>i.u[e]=o[t]))),n&&i.u)for(const t of Object.keys(i.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.u[t]=o[t]);i.p=null,i.o|=4,t.M=i,i.m=s.m=o.shadowRoot||o,z(s,i,n)})(t,e,o)}catch(e){l(e,t.$hostElement$)}return null},et=t=>{const e=t.$hostElement$,n=t.t,o=t.j;ot(n,"componentDidRender",void 0,e),64&t.o||(t.o|=64,lt(e),ot(n,"componentDidLoad",void 0,e),t.A(e),o||nt()),t.S&&(t.S(),t.S=void 0),512&t.o&&$((()=>K(t,!1))),t.o&=-517},nt=()=>{lt(u.documentElement),$((()=>(t=>{const e=a.ce("appload",{detail:{namespace:"blog-article-details"}});return t.dispatchEvent(e),e})(c)))},ot=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){l(t,o)}},lt=t=>t.classList.add("hydrated"),st=(t,e,o,s)=>{const i=n(t);if(!i)throw Error(`Couldn't find host element for "${s.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const r=i.$hostElement$,c=i.D.get(e),u=i.o,a=i.t;if(o=D(o,s.H[e][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(i.D.set(e,o),a)){if(s.N&&128&u){const t=s.N[e];t&&t.map((t=>{try{a[t](o,c,e)}catch(t){l(t,r)}}))}2==(18&u)&&K(i,!1)}},it=(t,e,o)=>{var l,s;const i=t.prototype;if(e.H||e.N||t.watchers){t.watchers&&!e.N&&(e.N=t.watchers);const r=Object.entries(null!=(l=e.H)?l:{});if(r.map((([t,[l]])=>{if(31&l||2&o&&32&l){const{get:s,set:r}=Object.getOwnPropertyDescriptor(i,t)||{};s&&(e.H[t][0]|=2048),r&&(e.H[t][0]|=4096),(1&o||!s)&&Object.defineProperty(i,t,{get(){{if(!(2048&e.H[t][0]))return((t,e)=>n(this).D.get(e))(0,t);const o=n(this),l=o?o.t:i;if(!l)return;return l[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(i,t,{set(s){const i=n(this);if(r){const n=32&l?this[t]:i.$hostElement$[t];return void 0===n&&i.D.get(t)?s=i.D.get(t):!i.D.get(t)&&n&&i.D.set(t,n),r.call(this,D(s,l)),void st(this,t,s=32&l?this[t]:i.$hostElement$[t],e)}{if(!(1&o&&4096&e.H[t][0]))return st(this,t,s,e),void(1&o&&!i.t&&i.R.then((()=>{4096&e.H[t][0]&&i.t[t]!==i.D.get(t)&&(i.t[t]=s)})));const n=()=>{const n=i.t[t];!i.D.get(t)&&n&&i.D.set(t,n),i.t[t]=D(s,l),st(this,t,i.t[t],e)};i.t?n():i.R.then((()=>n()))}}})}})),1&o){const o=new Map;i.attributeChangedCallback=function(t,l,s){a.jmp((()=>{var r;const c=o.get(t);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const o=n(this),i=null==o?void 0:o.o;if(i&&!(8&i)&&128&i&&s!==l){const n=o.t,i=null==(r=e.N)?void 0:r[t];null==i||i.forEach((e=>{null!=n[e]&&n[e].call(n,s,l,t)}))}return}}const u=Object.getOwnPropertyDescriptor(i,c);(s=(null!==s||"boolean"!=typeof this[c])&&s)===this[c]||u.get&&!u.set||(this[c]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.N)?s:{}),...r.filter((([t,e])=>15&e[0])).map((([t,n])=>{var l;const s=n[1]||t;return o.set(s,t),512&n[0]&&(null==(l=e.P)||l.push([t,s])),s}))]))}}return t},rt=(t,e)=>{ot(t,"connectedCallback",void 0,e)},ct=(t,o={})=>{var f;const d=[],p=o.exclude||[],m=c.customElements,y=u.head,v=y.querySelector("meta[charset]"),b=u.createElement("style"),$=[];let w,S=!0;Object.assign(a,o),a.l=new URL(o.resourcesUrl||"./",u.baseURI).href;let j=!1;if(t.map((t=>{t[1].map((o=>{var r;const c={o:o[0],v:o[1],H:o[2],T:o[3]};4&c.o&&(j=!0),c.H=o[2],c.T=o[3],c.P=[],c.N=null!=(r=o[4])?r:{};const u=c.v,f=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const o={o:0,$hostElement$:t,k:n,D:new Map};o.R=new Promise((t=>o.A=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,o)})(t=this,c),1&c.o)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){const t=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,ut(this,t,c.T)),w&&(clearTimeout(w),w=null),S?$.push(this):a.jmp((()=>(t=>{if(!(1&a.o)){const e=n(t),o=e.k,r=()=>{};if(1&e.o)ut(t,e,o.T),(null==e?void 0:e.t)?rt(e.t,t):(null==e?void 0:e.R)&&e.R.then((()=>rt(e.t,t)));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){J(e,e.j=n);break}}o.H&&Object.entries(o.H).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.o)){e.o|=32;{const i=((t,e)=>{const n=t.v.replace(/-/g,"_"),o=t.F;if(!o)return;const i=s.get(o);return i?i[n]:import(`./${o}.entry.js`).then((t=>(s.set(o,t),t[n])),(t=>{l(t,e.$hostElement$)}))
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(i&&"then"in i){const t=()=>{};o=await i,t()}else o=i;if(!o)throw Error(`Constructor for "${n.v}#${e.L}" was not found`);o.isProxied||(n.N=o.watchers,it(o,n,2),o.isProxied=!0);const r=()=>{};e.o|=8;try{new o(e)}catch(e){l(e,t)}e.o&=-9,e.o|=128,r(),rt(e.t,t)}if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=N(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);h&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.o)),o()}}}const r=e.j,c=()=>K(e,!0);r&&r["s-rc"]?r["s-rc"].push(c):c()})(t,e,o)}r()}})(this)))}disconnectedCallback(){a.jmp((()=>(async t=>{if(!(1&a.o)){const e=n(t);e.U&&(e.U.map((t=>t())),e.U=void 0),(null==e?void 0:e.t)||(null==e?void 0:e.R)&&e.R.then((()=>{}))}H.has(t)&&H.delete(t),t.shadowRoot&&H.has(t.shadowRoot)&&H.delete(t.shadowRoot)})(this))),a.raf((()=>{var t;const e=n(this);(null==(t=null==e?void 0:e.M)?void 0:t.m)instanceof Node&&!e.M.m.isConnected&&delete e.M.m}))}componentOnReady(){return n(this).R}};c.F=t[0],p.includes(u)||m.get(u)||(d.push(u),m.define(u,it(f,c,1)))}))})),d.length>0&&(j&&(b.textContent+=r),b.textContent+=d.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const t=null!=(f=a.C)?f:g(u);null!=t&&b.setAttribute("nonce",t),y.insertBefore(b,v?v.nextSibling:y.firstChild)}S=!1,$.length?$.map((t=>t.connectedCallback())):a.jmp((()=>w=setTimeout(nt,30)))},ut=(t,e,n)=>{n&&n.map((([n,o,l])=>{const s=ft(t,n),i=at(e,l),r=ht(n);a.ael(s,o,i,r),(e.U=e.U||[]).push((()=>a.rel(s,o,i,r)))}))},at=(t,e)=>n=>{var o;try{256&t.o?null==(o=t.t)||o[e](n):(t.O=t.O||[]).push([e,n])}catch(e){l(e,t.$hostElement$)}},ft=(t,e)=>8&e?c:t,ht=t=>({passive:!!(1&t),capture:!!(2&t)}),dt=t=>a.C=t;export{ct as b,P as h,f as p,o as r,dt as s}
|
|
@@ -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-a091cae7.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
const TRANSLATIONS = {
|
|
@@ -82,6 +82,51 @@ const BlogArticleDetailsStyle0 = blogArticleDetailsCss;
|
|
|
82
82
|
const BlogArticleDetails = class {
|
|
83
83
|
constructor(hostRef) {
|
|
84
84
|
index.registerInstance(this, hostRef);
|
|
85
|
+
/**
|
|
86
|
+
* Language of the widget
|
|
87
|
+
*/
|
|
88
|
+
this.language = 'en';
|
|
89
|
+
/**
|
|
90
|
+
* User roles
|
|
91
|
+
*/
|
|
92
|
+
this.userRoles = 'everyone';
|
|
93
|
+
/**
|
|
94
|
+
* CMS Endpoint stage
|
|
95
|
+
*/
|
|
96
|
+
this.cmsEnv = 'stage';
|
|
97
|
+
/**
|
|
98
|
+
* Client custom styling via string
|
|
99
|
+
*/
|
|
100
|
+
this.clientStyling = '';
|
|
101
|
+
/**
|
|
102
|
+
* Client custom styling via url
|
|
103
|
+
*/
|
|
104
|
+
this.clientStylingUrl = '';
|
|
105
|
+
/**
|
|
106
|
+
* Property used to display the publishing date
|
|
107
|
+
*/
|
|
108
|
+
this.showPublishingDate = true;
|
|
109
|
+
/**
|
|
110
|
+
* Property used to display the image
|
|
111
|
+
*/
|
|
112
|
+
this.showImage = true;
|
|
113
|
+
/**
|
|
114
|
+
* Property used to display the image
|
|
115
|
+
*/
|
|
116
|
+
this.showTitle = true;
|
|
117
|
+
/**
|
|
118
|
+
* Property used to display the description
|
|
119
|
+
*/
|
|
120
|
+
this.showContent = true;
|
|
121
|
+
/**
|
|
122
|
+
* Intl date format
|
|
123
|
+
*/
|
|
124
|
+
this.intlDateTimeFormat = '';
|
|
125
|
+
this.hasErrors = false;
|
|
126
|
+
this.limitStylingAppends = false;
|
|
127
|
+
this.isLoading = true;
|
|
128
|
+
this.bannerMatrixReady = false;
|
|
129
|
+
this.device = '';
|
|
85
130
|
this.setClientStyling = () => {
|
|
86
131
|
let sheet = document.createElement('style');
|
|
87
132
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -125,25 +170,6 @@ const BlogArticleDetails = class {
|
|
|
125
170
|
}
|
|
126
171
|
return source;
|
|
127
172
|
};
|
|
128
|
-
this.cmsEndpoint = undefined;
|
|
129
|
-
this.language = 'en';
|
|
130
|
-
this.userRoles = 'everyone';
|
|
131
|
-
this.cmsEnv = 'stage';
|
|
132
|
-
this.clientStyling = '';
|
|
133
|
-
this.clientStylingUrl = '';
|
|
134
|
-
this.showPublishingDate = true;
|
|
135
|
-
this.showImage = true;
|
|
136
|
-
this.showTitle = true;
|
|
137
|
-
this.showContent = true;
|
|
138
|
-
this.postId = undefined;
|
|
139
|
-
this.postSlug = undefined;
|
|
140
|
-
this.postCustomPath = undefined;
|
|
141
|
-
this.intlDateTimeFormat = '';
|
|
142
|
-
this.hasErrors = false;
|
|
143
|
-
this.limitStylingAppends = false;
|
|
144
|
-
this.isLoading = true;
|
|
145
|
-
this.bannerMatrixReady = false;
|
|
146
|
-
this.device = '';
|
|
147
173
|
}
|
|
148
174
|
// Rerender when bannermatrix has finished loaded. Issue when bannermatrix passed as content from CMS.
|
|
149
175
|
handleBannerReady() {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-a091cae7.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
Stencil Client Patch Browser v4.
|
|
9
|
+
Stencil Client Patch Browser v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
10
10
|
*/
|
|
11
11
|
var patchBrowser = () => {
|
|
12
12
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('blog-article-details.cjs.js', document.baseURI).href));
|
|
@@ -21,19 +21,23 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'blog-article-details';
|
|
24
|
-
const BUILD = /* blog-article-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: false, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
24
|
+
const BUILD = /* blog-article-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: false, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
27
|
+
Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
28
28
|
*/
|
|
29
29
|
var __defProp = Object.defineProperty;
|
|
30
30
|
var __export = (target, all) => {
|
|
31
31
|
for (var name in all)
|
|
32
32
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
// src/client/client-host-ref.ts
|
|
34
36
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
35
37
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
36
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
38
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
39
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
40
|
+
};
|
|
37
41
|
var registerHost = (hostElement, cmpMeta) => {
|
|
38
42
|
const hostRef = {
|
|
39
43
|
$flags$: 0,
|
|
@@ -46,7 +50,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
46
50
|
hostElement["s-p"] = [];
|
|
47
51
|
hostElement["s-rc"] = [];
|
|
48
52
|
}
|
|
49
|
-
|
|
53
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
54
|
+
return ref;
|
|
50
55
|
};
|
|
51
56
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
52
57
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -83,16 +88,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
83
88
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
84
89
|
/* webpackMode: "lazy" */
|
|
85
90
|
`./${bundleId}.entry.js${""}`
|
|
86
|
-
)); }).then(
|
|
87
|
-
{
|
|
88
|
-
|
|
91
|
+
)); }).then(
|
|
92
|
+
(importedModule) => {
|
|
93
|
+
{
|
|
94
|
+
cmpModules.set(bundleId, importedModule);
|
|
95
|
+
}
|
|
96
|
+
return importedModule[exportName];
|
|
97
|
+
},
|
|
98
|
+
(e) => {
|
|
99
|
+
consoleError(e, hostRef.$hostElement$);
|
|
89
100
|
}
|
|
90
|
-
|
|
91
|
-
}, consoleError);
|
|
101
|
+
);
|
|
92
102
|
};
|
|
93
103
|
|
|
94
104
|
// src/client/client-style.ts
|
|
95
105
|
var styles = /* @__PURE__ */ new Map();
|
|
106
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
96
107
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
97
108
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
98
109
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -166,12 +177,6 @@ var flush = () => {
|
|
|
166
177
|
};
|
|
167
178
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
168
179
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
169
|
-
|
|
170
|
-
// src/utils/constants.ts
|
|
171
|
-
var EMPTY_OBJ = {};
|
|
172
|
-
|
|
173
|
-
// src/utils/helpers.ts
|
|
174
|
-
var isDef = (v) => v != null;
|
|
175
180
|
var isComplexType = (o) => {
|
|
176
181
|
o = typeof o;
|
|
177
182
|
return o === "object" || o === "function";
|
|
@@ -349,7 +354,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
349
354
|
}
|
|
350
355
|
if (!appliedStyles.has(scopeId2)) {
|
|
351
356
|
{
|
|
352
|
-
styleElm = doc.createElement("style");
|
|
357
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
353
358
|
styleElm.innerHTML = style;
|
|
354
359
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
355
360
|
if (nonce != null) {
|
|
@@ -359,7 +364,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
359
364
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
360
365
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
361
366
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
362
|
-
styleContainerNode.insertBefore(
|
|
367
|
+
styleContainerNode.insertBefore(
|
|
368
|
+
styleElm,
|
|
369
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
370
|
+
);
|
|
363
371
|
} else if ("host" in styleContainerNode) {
|
|
364
372
|
if (supportsConstructableStylesheets) {
|
|
365
373
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -409,16 +417,18 @@ var attachStyles = (hostRef) => {
|
|
|
409
417
|
endAttachStyles();
|
|
410
418
|
};
|
|
411
419
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
412
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
420
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
413
421
|
if (oldValue !== newValue) {
|
|
414
422
|
let isProp = isMemberInElement(elm, memberName);
|
|
415
423
|
memberName.toLowerCase();
|
|
416
424
|
if (memberName === "class") {
|
|
417
425
|
const classList = elm.classList;
|
|
418
426
|
const oldClasses = parseClassList(oldValue);
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
427
|
+
let newClasses = parseClassList(newValue);
|
|
428
|
+
{
|
|
429
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
430
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
431
|
+
}
|
|
422
432
|
} else if (memberName === "style") {
|
|
423
433
|
{
|
|
424
434
|
for (const prop in oldValue) {
|
|
@@ -459,7 +469,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
459
469
|
elm.setAttribute(memberName, n);
|
|
460
470
|
}
|
|
461
471
|
}
|
|
462
|
-
} else {
|
|
472
|
+
} else if (elm[memberName] !== newValue) {
|
|
463
473
|
elm[memberName] = newValue;
|
|
464
474
|
}
|
|
465
475
|
} catch (e) {
|
|
@@ -481,22 +491,42 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
481
491
|
}
|
|
482
492
|
};
|
|
483
493
|
var parseClassListRegex = /\s/;
|
|
484
|
-
var parseClassList = (value) =>
|
|
494
|
+
var parseClassList = (value) => {
|
|
495
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
496
|
+
value = value.baseVal;
|
|
497
|
+
}
|
|
498
|
+
if (!value || typeof value !== "string") {
|
|
499
|
+
return [];
|
|
500
|
+
}
|
|
501
|
+
return value.split(parseClassListRegex);
|
|
502
|
+
};
|
|
485
503
|
|
|
486
504
|
// src/runtime/vdom/update-element.ts
|
|
487
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
505
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
488
506
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
489
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
490
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
507
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
508
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
491
509
|
{
|
|
492
510
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
493
511
|
if (!(memberName in newVnodeAttrs)) {
|
|
494
|
-
setAccessor(
|
|
512
|
+
setAccessor(
|
|
513
|
+
elm,
|
|
514
|
+
memberName,
|
|
515
|
+
oldVnodeAttrs[memberName],
|
|
516
|
+
void 0,
|
|
517
|
+
isSvgMode2,
|
|
518
|
+
newVnode.$flags$);
|
|
495
519
|
}
|
|
496
520
|
}
|
|
497
521
|
}
|
|
498
522
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
499
|
-
setAccessor(
|
|
523
|
+
setAccessor(
|
|
524
|
+
elm,
|
|
525
|
+
memberName,
|
|
526
|
+
oldVnodeAttrs[memberName],
|
|
527
|
+
newVnodeAttrs[memberName],
|
|
528
|
+
isSvgMode2,
|
|
529
|
+
newVnode.$flags$);
|
|
500
530
|
}
|
|
501
531
|
};
|
|
502
532
|
function sortedAttrNames(attrNames) {
|
|
@@ -508,13 +538,10 @@ function sortedAttrNames(attrNames) {
|
|
|
508
538
|
attrNames
|
|
509
539
|
);
|
|
510
540
|
}
|
|
511
|
-
|
|
512
|
-
// src/runtime/vdom/vdom-render.ts
|
|
513
|
-
var scopeId;
|
|
514
541
|
var hostTagName;
|
|
515
542
|
var useNativeShadowDom = false;
|
|
516
543
|
var isSvgMode = false;
|
|
517
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
544
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
518
545
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
519
546
|
let i2 = 0;
|
|
520
547
|
let elm;
|
|
@@ -528,11 +555,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
528
555
|
{
|
|
529
556
|
updateElement(null, newVNode2, isSvgMode);
|
|
530
557
|
}
|
|
531
|
-
const rootNode = elm.getRootNode();
|
|
532
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
533
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
534
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
535
|
-
}
|
|
536
558
|
if (newVNode2.$children$) {
|
|
537
559
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
538
560
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -637,6 +659,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
637
659
|
};
|
|
638
660
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
639
661
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
662
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
663
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
664
|
+
}
|
|
640
665
|
return true;
|
|
641
666
|
}
|
|
642
667
|
return false;
|
|
@@ -676,8 +701,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
676
701
|
}
|
|
677
702
|
};
|
|
678
703
|
var insertBefore = (parent, newNode, reference) => {
|
|
679
|
-
|
|
680
|
-
|
|
704
|
+
{
|
|
705
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
706
|
+
}
|
|
681
707
|
};
|
|
682
708
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
683
709
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -702,9 +728,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
702
728
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
703
729
|
hostRef.$vnode$ = rootVnode;
|
|
704
730
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
705
|
-
{
|
|
706
|
-
scopeId = hostElm["s-sc"];
|
|
707
|
-
}
|
|
708
731
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
709
732
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
710
733
|
};
|
|
@@ -712,7 +735,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
712
735
|
// src/runtime/update-component.ts
|
|
713
736
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
714
737
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
715
|
-
ancestorComponent["s-p"].push(
|
|
738
|
+
const index = ancestorComponent["s-p"].push(
|
|
739
|
+
new Promise(
|
|
740
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
741
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
742
|
+
r();
|
|
743
|
+
}
|
|
744
|
+
)
|
|
745
|
+
);
|
|
716
746
|
}
|
|
717
747
|
};
|
|
718
748
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -741,7 +771,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
741
771
|
{
|
|
742
772
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
743
773
|
if (hostRef.$queuedListeners$) {
|
|
744
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
774
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
745
775
|
hostRef.$queuedListeners$ = void 0;
|
|
746
776
|
}
|
|
747
777
|
}
|
|
@@ -812,7 +842,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
812
842
|
const instance = hostRef.$lazyInstance$ ;
|
|
813
843
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
814
844
|
{
|
|
815
|
-
safeCall(instance, "componentDidRender");
|
|
845
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
816
846
|
}
|
|
817
847
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
818
848
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
@@ -820,7 +850,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
820
850
|
addHydratedFlag(elm);
|
|
821
851
|
}
|
|
822
852
|
{
|
|
823
|
-
safeCall(instance, "componentDidLoad");
|
|
853
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
824
854
|
}
|
|
825
855
|
endPostUpdate();
|
|
826
856
|
{
|
|
@@ -849,12 +879,12 @@ var appDidLoad = (who) => {
|
|
|
849
879
|
}
|
|
850
880
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
851
881
|
};
|
|
852
|
-
var safeCall = (instance, method, arg) => {
|
|
882
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
853
883
|
if (instance && instance[method]) {
|
|
854
884
|
try {
|
|
855
885
|
return instance[method](arg);
|
|
856
886
|
} catch (e) {
|
|
857
|
-
consoleError(e);
|
|
887
|
+
consoleError(e, elm);
|
|
858
888
|
}
|
|
859
889
|
}
|
|
860
890
|
return void 0;
|
|
@@ -913,15 +943,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
913
943
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
914
944
|
members.map(([memberName, [memberFlags]]) => {
|
|
915
945
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
946
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
947
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
948
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
949
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
950
|
+
Object.defineProperty(prototype, memberName, {
|
|
951
|
+
get() {
|
|
952
|
+
{
|
|
953
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
954
|
+
return getValue(this, memberName);
|
|
955
|
+
}
|
|
956
|
+
const ref = getHostRef(this);
|
|
957
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
958
|
+
if (!instance) return;
|
|
959
|
+
return instance[memberName];
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
configurable: true,
|
|
963
|
+
enumerable: true
|
|
964
|
+
});
|
|
965
|
+
}
|
|
916
966
|
Object.defineProperty(prototype, memberName, {
|
|
917
|
-
get() {
|
|
918
|
-
return getValue(this, memberName);
|
|
919
|
-
},
|
|
920
967
|
set(newValue) {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
968
|
+
const ref = getHostRef(this);
|
|
969
|
+
if (origSetter) {
|
|
970
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
971
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
972
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
973
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
974
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
975
|
+
}
|
|
976
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
977
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
978
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
{
|
|
982
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
983
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
984
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
985
|
+
ref.$onReadyPromise$.then(() => {
|
|
986
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
987
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
return;
|
|
992
|
+
}
|
|
993
|
+
const setterSetVal = () => {
|
|
994
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
995
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
996
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
997
|
+
}
|
|
998
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
999
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1000
|
+
};
|
|
1001
|
+
if (ref.$lazyInstance$) {
|
|
1002
|
+
setterSetVal();
|
|
1003
|
+
} else {
|
|
1004
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
925
1008
|
});
|
|
926
1009
|
}
|
|
927
1010
|
});
|
|
@@ -931,7 +1014,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
931
1014
|
plt.jmp(() => {
|
|
932
1015
|
var _a2;
|
|
933
1016
|
const propName = attrNameToPropName.get(attrName);
|
|
934
|
-
if (this.hasOwnProperty(propName)) {
|
|
1017
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
935
1018
|
newValue = this[propName];
|
|
936
1019
|
delete this[propName];
|
|
937
1020
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -951,7 +1034,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
951
1034
|
}
|
|
952
1035
|
return;
|
|
953
1036
|
}
|
|
954
|
-
|
|
1037
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1038
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1039
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1040
|
+
this[propName] = newValue;
|
|
1041
|
+
}
|
|
955
1042
|
});
|
|
956
1043
|
};
|
|
957
1044
|
Cstr.observedAttributes = Array.from(
|
|
@@ -978,9 +1065,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
978
1065
|
let Cstr;
|
|
979
1066
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
980
1067
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1068
|
+
{
|
|
1069
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
984
1070
|
if (CstrImport && "then" in CstrImport) {
|
|
985
1071
|
const endLoad = uniqueTime();
|
|
986
1072
|
Cstr = await CstrImport;
|
|
@@ -1005,7 +1091,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1005
1091
|
try {
|
|
1006
1092
|
new Cstr(hostRef);
|
|
1007
1093
|
} catch (e) {
|
|
1008
|
-
consoleError(e);
|
|
1094
|
+
consoleError(e, elm);
|
|
1009
1095
|
}
|
|
1010
1096
|
{
|
|
1011
1097
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1014,11 +1100,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1014
1100
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1015
1101
|
}
|
|
1016
1102
|
endNewInstance();
|
|
1017
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
1018
|
-
} else {
|
|
1019
|
-
Cstr = elm.constructor;
|
|
1020
|
-
const cmpTag = elm.localName;
|
|
1021
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1103
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1022
1104
|
}
|
|
1023
1105
|
if (Cstr && Cstr.style) {
|
|
1024
1106
|
let style;
|
|
@@ -1041,9 +1123,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1041
1123
|
schedule();
|
|
1042
1124
|
}
|
|
1043
1125
|
};
|
|
1044
|
-
var fireConnectedCallback = (instance) => {
|
|
1126
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1045
1127
|
{
|
|
1046
|
-
safeCall(instance, "connectedCallback");
|
|
1128
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1047
1129
|
}
|
|
1048
1130
|
};
|
|
1049
1131
|
|
|
@@ -1079,15 +1161,15 @@ var connectedCallback = (elm) => {
|
|
|
1079
1161
|
} else {
|
|
1080
1162
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1081
1163
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1082
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
1164
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1083
1165
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1084
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
1166
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1085
1167
|
}
|
|
1086
1168
|
}
|
|
1087
1169
|
endConnected();
|
|
1088
1170
|
}
|
|
1089
1171
|
};
|
|
1090
|
-
var disconnectInstance = (instance) => {
|
|
1172
|
+
var disconnectInstance = (instance, elm) => {
|
|
1091
1173
|
};
|
|
1092
1174
|
var disconnectedCallback = async (elm) => {
|
|
1093
1175
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1102,6 +1184,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1102
1184
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1103
1185
|
}
|
|
1104
1186
|
}
|
|
1187
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1188
|
+
rootAppliedStyles.delete(elm);
|
|
1189
|
+
}
|
|
1190
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1191
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1192
|
+
}
|
|
1105
1193
|
};
|
|
1106
1194
|
|
|
1107
1195
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1186,6 +1274,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1186
1274
|
}
|
|
1187
1275
|
disconnectedCallback() {
|
|
1188
1276
|
plt.jmp(() => disconnectedCallback(this));
|
|
1277
|
+
plt.raf(() => {
|
|
1278
|
+
var _a3;
|
|
1279
|
+
const hostRef = getHostRef(this);
|
|
1280
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1281
|
+
delete hostRef.$vnode$.$elm$;
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1189
1284
|
}
|
|
1190
1285
|
componentOnReady() {
|
|
1191
1286
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1249,7 +1344,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1249
1344
|
}
|
|
1250
1345
|
}
|
|
1251
1346
|
} catch (e) {
|
|
1252
|
-
consoleError(e);
|
|
1347
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1253
1348
|
}
|
|
1254
1349
|
};
|
|
1255
1350
|
var getHostListenerTarget = (elm, flags) => {
|
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-a091cae7.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|