@everymatrix/general-footer-template 1.85.17 → 1.85.19
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.
|
@@ -26,6 +26,8 @@ function setClientStyling(stylingContainer, clientStyling) {
|
|
|
26
26
|
* @param {string} clientStylingUrl The URL of the style content
|
|
27
27
|
*/
|
|
28
28
|
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
29
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
30
|
+
|
|
29
31
|
const url = new URL(clientStylingUrl);
|
|
30
32
|
|
|
31
33
|
fetch(url.href)
|
|
@@ -22,6 +22,8 @@ function setClientStyling(stylingContainer, clientStyling) {
|
|
|
22
22
|
* @param {string} clientStylingUrl The URL of the style content
|
|
23
23
|
*/
|
|
24
24
|
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
25
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
26
|
+
|
|
25
27
|
const url = new URL(clientStylingUrl);
|
|
26
28
|
|
|
27
29
|
fetch(url.href)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,h as e,g as t}from"./index-2051e205.js";import{g as o,n as i,c as r}from"./utils-c4781120.js";function a(n,e){if(n){const t=document.createElement("style");t.innerHTML=e,n.appendChild(t)}}const s=class{constructor(e){n(this,e),this.platform=o(),this.MANDATORY_FIELDS=["endpoint","language","sections"],this.language=void 0,this.sections=void 0,this.endpoint=void 0,this.env="stage",this.userRoles="everyone",this.userid=void 0,this.session=void 0,this.baseUrl=void 0,this.navigateViaEvent="false",this.postMessageEvent="NavigateTo",this.clientStyling="",this.clientStylingUrl="",this.customCss=void 0,this.translationUrl="",this.clockFormat="HH:MM:ss",this.timeZone="",this.mbSource=void 0,this.accordionLinks=!1,this.hasErrors=!1,this.footerContent=void 0}validateMandatoryFields(){this.MANDATORY_FIELDS.forEach((n=>{this[n]||(console.error(`Mandatory parameter ${n} not received`),this.hasErrors=!0)}))}watchLanguage(n,e){n&&e&&n!=e&&this.setFooterData()}setFooterData(){this.sectionsList=this.sections.split(",").map((n=>n.trim()));const n=new URL(`${this.endpoint}/${this.language}/footer-raw-data`);return n.searchParams.append("env",this.env),n.searchParams.append("device",this.platform),n.searchParams.append("userRoles",this.userRoles),this.validateMandatoryFields(),fetch(n.href).then((n=>n.json())).then((n=>{0===Object.keys(n).length?this.hasErrors=!0:this.footerContent=i(n)}))}async componentWillLoad(){await this.setFooterData()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){null!=window.emMessageBus?function(n,e){if(window.emMessageBus){const t=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{t.innerHTML=e,n&&n.appendChild(t)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&function(n,e){const t=new URL(e);fetch(t.href).then((n=>n.text())).then((e=>{const t=document.createElement("style");t.innerHTML=e,n&&n.appendChild(t)})).catch((n=>{console.error("There was an error while trying to load client styling from URL",n)}))}(this.stylingContainer,this.clientStylingUrl),this.customCss=this.footerContent.wysiwyg.customCSS.content,this.customCss&&a(this.hostEl.shadowRoot,this.customCss))}render(){if(this.hasErrors)return e("div",null,"There was an error while bootstraping the widget");{const n=this.sectionsList.map(((n,t)=>{var o,i,a;const s=(null===(o=this.footerContent.repeaters)||void 0===o?void 0:o[n])||(null===(i=this.footerContent.wysiwyg)||void 0===i?void 0:i[n]),d=null==s?void 0:s.content;if("object"==typeof d&&0===(null===(a=Object.keys(d))||void 0===a?void 0:a.length)||"string"==typeof d&&""===d.trim())return null;const c=r[n].component,h=this.footerContent.repeaters.hasOwnProperty(n),l=this.footerContent.wysiwyg.hasOwnProperty(n);return e(c,{class:`${n} FooterSectionContainer FooterSectionContainer${t+1}`,userid:this.userid,session:this.session,"base-url":this.baseUrl,endpoint:this.endpoint,language:this.language,"navigate-via-event":this.navigateViaEvent,"post-message-event":this.postMessageEvent,ruleset:r[n],repeaterContent:h?this.footerContent.repeaters[n]:null,customContent:l?this.footerContent.wysiwyg[n].content:null,"translation-url":this.translationUrl,"clock-format":this.clockFormat,"time-zone":this.timeZone,"accordion-links":this.accordionLinks})}));return e("footer",{class:"FooterContainer",ref:n=>this.stylingContainer=n},e("div",{class:"FooterGrid customStyle"},n))}}get hostEl(){return t(this)}static get watchers(){return{language:["watchLanguage"]}}};s.style=':host {\n display: block;\n}\n\n/* $-background-primary: #14202d; */\n* {\n font-family: sans-serif;\n}\n\nhtml,\nbody {\n margin: 0;\n padding: 0;\n font-family: inherit;\n}\n\n.FooterSectionContainer {\n color: var(--emw--footer-typography, var(--emw--color-thpography, #fff));\n padding: 15px 20px 0;\n}\n\n/* // FOOTER CONTAINER - only serves to be read as a container */\n.FooterContainer {\n container-type: inline-size;\n container-name: footerContainer;\n}\n\n.FooterGrid {\n background-color: var(--emw--footer-color-bg, var(--emw--color-background, #0E1511));\n display: grid;\n grid-template-rows: repeat(9, auto);\n grid-template-areas: "one" "two" "three" "four" "five" "six" "seven";\n}\n\n.FooterSectionContainer1 {\n position: relative;\n grid-area: one;\n}\n\n.FooterSectionContainer2 {\n position: relative;\n grid-area: two;\n}\n\n.FooterSectionContainer3 {\n position: relative;\n grid-area: three;\n}\n\n.FooterSectionContainer4 {\n position: relative;\n grid-area: four;\n}\n\n.FooterSectionContainer5 {\n grid-area: five;\n}\n\n.FooterSectionContainer6 {\n padding-top: 22px;\n grid-area: six;\n}\n\n.FooterSectionContainer7 {\n grid-area: seven;\n}\n\n/* // remove paddings */\n.FooterSectionContainer7 div {\n padding: 0;\n}\n\n@container (max-width: 750px) {\n .FooterSectionContainer3:after,\n .FooterSectionContainer2:after {\n position: absolute;\n content: "";\n height: 1px;\n width: 90%;\n background-color: var(--emw--color-gray-100, #444);\n }\n .FooterSectionContainer5 {\n grid-area: five;\n background-color: var(--emw--color-background-secondary, #060706);\n padding: 30px 0;\n font-size: var(--emw--font-size-medium, 16px);\n min-height: var(--emw--size-medium-plus, 100px);\n justify-self: center;\n }\n}\n/* // STYLES FOR TABLET / DESKTOP */\n@container (min-width: 750px) {\n .FooterGrid {\n background: var(--emw--footer-color-bg, var(--emw--color-background, #0E1511));\n display: grid;\n border-top: 5px solid var(--emw--footer-color-primary, var(--emw--color-primary, #22B04E));\n grid-template-rows: repeat(5, auto);\n grid-template-columns: 1fr 1fr 1fr 1fr;\n grid-template-areas: "one two two two" "one three three three" "one four four four" "one five five five" "one six six six" "seven seven seven seven" "eight eight eight eight" "nine nine nine nine";\n }\n .FooterSectionContainer1 {\n padding: 30px 40px;\n grid-area: one;\n background: var(--emw--color-background, #000000);\n }\n .FooterSectionContainer2 {\n grid-area: two;\n min-height: var(--emw--size-4x-medium, 500px);\n }\n .FooterSectionContainer3 {\n grid-area: three;\n }\n .FooterSectionContainer4 {\n grid-area: four;\n }\n .FooterSectionContainer5 {\n grid-area: five;\n background-color: var(--emw--color-background-secondary, #091217);\n padding: var(--emw--spacing-x-large, 30px) 0;\n font-size: var(--emw--font-size-medium, 16px);\n min-height: var(--emw--size-medium-plus, 100px);\n }\n .FooterSectionContainer6 {\n grid-area: six;\n padding: 0;\n }\n .FooterSectionContainer7 {\n grid-area: seven;\n padding: 0;\n }\n /* // remove paddings */\n .FooterSectionContainer5 .CustomContentSectionWrapper {\n padding: 0;\n }\n .FooterSectionContainer5 .CustomContentSectionWrapper div {\n display: flex;\n flex-direction: left;\n align-items: center;\n padding-left: var(--emw--spacing-large, 20px);\n }\n .FooterSectionContainer5 .CustomContentSectionWrapper div p {\n margin: var(--emw--spacing-2x-small, 5px);\n text-align: center;\n }\n .FooterSectionContainer6 .CustomContentSectionWrapper div p {\n text-align: center;\n }\n .FooterSectionContainer6 .ImageListWrapper {\n padding: 0;\n }\n .FooterSectionContainer6 .ImageListWrapper {\n padding: 0;\n }\n .FooterSectionContainer7 .CustomContentSectionWrapper {\n padding: 0;\n padding-bottom: var(--emw--spacing-large, 22px);\n font-size: var(--emw--font-size-small, 14px);\n }\n}';export{s as general_footer_template}
|
|
1
|
+
import{r as n,h as e,g as t}from"./index-2051e205.js";import{g as o,n as i,c as r}from"./utils-c4781120.js";function a(n,e){if(n){const t=document.createElement("style");t.innerHTML=e,n.appendChild(t)}}const s=class{constructor(e){n(this,e),this.platform=o(),this.MANDATORY_FIELDS=["endpoint","language","sections"],this.language=void 0,this.sections=void 0,this.endpoint=void 0,this.env="stage",this.userRoles="everyone",this.userid=void 0,this.session=void 0,this.baseUrl=void 0,this.navigateViaEvent="false",this.postMessageEvent="NavigateTo",this.clientStyling="",this.clientStylingUrl="",this.customCss=void 0,this.translationUrl="",this.clockFormat="HH:MM:ss",this.timeZone="",this.mbSource=void 0,this.accordionLinks=!1,this.hasErrors=!1,this.footerContent=void 0}validateMandatoryFields(){this.MANDATORY_FIELDS.forEach((n=>{this[n]||(console.error(`Mandatory parameter ${n} not received`),this.hasErrors=!0)}))}watchLanguage(n,e){n&&e&&n!=e&&this.setFooterData()}setFooterData(){this.sectionsList=this.sections.split(",").map((n=>n.trim()));const n=new URL(`${this.endpoint}/${this.language}/footer-raw-data`);return n.searchParams.append("env",this.env),n.searchParams.append("device",this.platform),n.searchParams.append("userRoles",this.userRoles),this.validateMandatoryFields(),fetch(n.href).then((n=>n.json())).then((n=>{0===Object.keys(n).length?this.hasErrors=!0:this.footerContent=i(n)}))}async componentWillLoad(){await this.setFooterData()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){null!=window.emMessageBus?function(n,e){if(window.emMessageBus){const t=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{t.innerHTML=e,n&&n.appendChild(t)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&function(n,e){if(!n||!e)return;const t=new URL(e);fetch(t.href).then((n=>n.text())).then((e=>{const t=document.createElement("style");t.innerHTML=e,n&&n.appendChild(t)})).catch((n=>{console.error("There was an error while trying to load client styling from URL",n)}))}(this.stylingContainer,this.clientStylingUrl),this.customCss=this.footerContent.wysiwyg.customCSS.content,this.customCss&&a(this.hostEl.shadowRoot,this.customCss))}render(){if(this.hasErrors)return e("div",null,"There was an error while bootstraping the widget");{const n=this.sectionsList.map(((n,t)=>{var o,i,a;const s=(null===(o=this.footerContent.repeaters)||void 0===o?void 0:o[n])||(null===(i=this.footerContent.wysiwyg)||void 0===i?void 0:i[n]),d=null==s?void 0:s.content;if("object"==typeof d&&0===(null===(a=Object.keys(d))||void 0===a?void 0:a.length)||"string"==typeof d&&""===d.trim())return null;const c=r[n].component,h=this.footerContent.repeaters.hasOwnProperty(n),l=this.footerContent.wysiwyg.hasOwnProperty(n);return e(c,{class:`${n} FooterSectionContainer FooterSectionContainer${t+1}`,userid:this.userid,session:this.session,"base-url":this.baseUrl,endpoint:this.endpoint,language:this.language,"navigate-via-event":this.navigateViaEvent,"post-message-event":this.postMessageEvent,ruleset:r[n],repeaterContent:h?this.footerContent.repeaters[n]:null,customContent:l?this.footerContent.wysiwyg[n].content:null,"translation-url":this.translationUrl,"clock-format":this.clockFormat,"time-zone":this.timeZone,"accordion-links":this.accordionLinks})}));return e("footer",{class:"FooterContainer",ref:n=>this.stylingContainer=n},e("div",{class:"FooterGrid customStyle"},n))}}get hostEl(){return t(this)}static get watchers(){return{language:["watchLanguage"]}}};s.style=':host {\n display: block;\n}\n\n/* $-background-primary: #14202d; */\n* {\n font-family: sans-serif;\n}\n\nhtml,\nbody {\n margin: 0;\n padding: 0;\n font-family: inherit;\n}\n\n.FooterSectionContainer {\n color: var(--emw--footer-typography, var(--emw--color-thpography, #fff));\n padding: 15px 20px 0;\n}\n\n/* // FOOTER CONTAINER - only serves to be read as a container */\n.FooterContainer {\n container-type: inline-size;\n container-name: footerContainer;\n}\n\n.FooterGrid {\n background-color: var(--emw--footer-color-bg, var(--emw--color-background, #0E1511));\n display: grid;\n grid-template-rows: repeat(9, auto);\n grid-template-areas: "one" "two" "three" "four" "five" "six" "seven";\n}\n\n.FooterSectionContainer1 {\n position: relative;\n grid-area: one;\n}\n\n.FooterSectionContainer2 {\n position: relative;\n grid-area: two;\n}\n\n.FooterSectionContainer3 {\n position: relative;\n grid-area: three;\n}\n\n.FooterSectionContainer4 {\n position: relative;\n grid-area: four;\n}\n\n.FooterSectionContainer5 {\n grid-area: five;\n}\n\n.FooterSectionContainer6 {\n padding-top: 22px;\n grid-area: six;\n}\n\n.FooterSectionContainer7 {\n grid-area: seven;\n}\n\n/* // remove paddings */\n.FooterSectionContainer7 div {\n padding: 0;\n}\n\n@container (max-width: 750px) {\n .FooterSectionContainer3:after,\n .FooterSectionContainer2:after {\n position: absolute;\n content: "";\n height: 1px;\n width: 90%;\n background-color: var(--emw--color-gray-100, #444);\n }\n .FooterSectionContainer5 {\n grid-area: five;\n background-color: var(--emw--color-background-secondary, #060706);\n padding: 30px 0;\n font-size: var(--emw--font-size-medium, 16px);\n min-height: var(--emw--size-medium-plus, 100px);\n justify-self: center;\n }\n}\n/* // STYLES FOR TABLET / DESKTOP */\n@container (min-width: 750px) {\n .FooterGrid {\n background: var(--emw--footer-color-bg, var(--emw--color-background, #0E1511));\n display: grid;\n border-top: 5px solid var(--emw--footer-color-primary, var(--emw--color-primary, #22B04E));\n grid-template-rows: repeat(5, auto);\n grid-template-columns: 1fr 1fr 1fr 1fr;\n grid-template-areas: "one two two two" "one three three three" "one four four four" "one five five five" "one six six six" "seven seven seven seven" "eight eight eight eight" "nine nine nine nine";\n }\n .FooterSectionContainer1 {\n padding: 30px 40px;\n grid-area: one;\n background: var(--emw--color-background, #000000);\n }\n .FooterSectionContainer2 {\n grid-area: two;\n min-height: var(--emw--size-4x-medium, 500px);\n }\n .FooterSectionContainer3 {\n grid-area: three;\n }\n .FooterSectionContainer4 {\n grid-area: four;\n }\n .FooterSectionContainer5 {\n grid-area: five;\n background-color: var(--emw--color-background-secondary, #091217);\n padding: var(--emw--spacing-x-large, 30px) 0;\n font-size: var(--emw--font-size-medium, 16px);\n min-height: var(--emw--size-medium-plus, 100px);\n }\n .FooterSectionContainer6 {\n grid-area: six;\n padding: 0;\n }\n .FooterSectionContainer7 {\n grid-area: seven;\n padding: 0;\n }\n /* // remove paddings */\n .FooterSectionContainer5 .CustomContentSectionWrapper {\n padding: 0;\n }\n .FooterSectionContainer5 .CustomContentSectionWrapper div {\n display: flex;\n flex-direction: left;\n align-items: center;\n padding-left: var(--emw--spacing-large, 20px);\n }\n .FooterSectionContainer5 .CustomContentSectionWrapper div p {\n margin: var(--emw--spacing-2x-small, 5px);\n text-align: center;\n }\n .FooterSectionContainer6 .CustomContentSectionWrapper div p {\n text-align: center;\n }\n .FooterSectionContainer6 .ImageListWrapper {\n padding: 0;\n }\n .FooterSectionContainer6 .ImageListWrapper {\n padding: 0;\n }\n .FooterSectionContainer7 .CustomContentSectionWrapper {\n padding: 0;\n padding-bottom: var(--emw--spacing-large, 22px);\n font-size: var(--emw--font-size-small, 14px);\n }\n}';export{s as general_footer_template}
|