@everymatrix/general-news-notification 1.45.7
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/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/general-news-notification-57b70677.js +206 -0
- package/dist/cjs/general-news-notification.cjs.entry.js +10 -0
- package/dist/cjs/general-news-notification.cjs.js +25 -0
- package/dist/cjs/index-95e31eec.js +1207 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/general-news-notification/general-news-notification.css +110 -0
- package/dist/collection/components/general-news-notification/general-news-notification.js +330 -0
- package/dist/collection/components/general-news-notification/index.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +34 -0
- package/dist/collection/utils/utils.js +30 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/general-news-notification-c65ccc64.js +204 -0
- package/dist/esm/general-news-notification.entry.js +2 -0
- package/dist/esm/general-news-notification.js +20 -0
- package/dist/esm/index-cffad24d.js +1181 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/general-news-notification/general-news-notification.esm.js +1 -0
- package/dist/general-news-notification/index.esm.js +1 -0
- package/dist/general-news-notification/p-8b27880f.js +2 -0
- package/dist/general-news-notification/p-cfdc487f.js +1 -0
- package/dist/general-news-notification/p-e06cf24f.entry.js +1 -0
- package/dist/general-news-notification/p-e1255160.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +14 -0
- package/dist/stencil.config.js +17 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-news-notification/.stencil/packages/stencil/general-news-notification/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-news-notification/.stencil/packages/stencil/general-news-notification/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/general-news-notification/general-news-notification.d.ts +56 -0
- package/dist/types/components/general-news-notification/index.d.ts +1 -0
- package/dist/types/components.d.ts +109 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +3 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { b as bootstrapLazy } from './index-cffad24d.js';
|
|
2
|
+
export { s as setNonce } from './index-cffad24d.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await globalScripts();
|
|
8
|
+
return bootstrapLazy([["general-news-notification",[[1,"general-news-notification",{"cmsEndpoint":[1,"cms-endpoint"],"language":[1],"animationType":[1,"animation-type"],"speed":[2],"canMinimize":[4,"can-minimize"],"canClose":[4,"can-close"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"message":[32],"isMinimized":[32],"isClosed":[32],"isLoading":[32]},null,{"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { defineCustomElements };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as n,b as i}from"./p-8b27880f.js";export{s as setNonce}from"./p-8b27880f.js";import{g as t}from"./p-e1255160.js";(()=>{const i=import.meta.url,t={};return""!==i&&(t.resourcesUrl=new URL(".",i).href),n(t)})().then((async n=>(await t(),i([["p-e06cf24f",[[1,"general-news-notification",{cmsEndpoint:[1,"cms-endpoint"],language:[1],animationType:[1,"animation-type"],speed:[2],canMinimize:[4,"can-minimize"],canClose:[4,"can-close"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],translationUrl:[1,"translation-url"],message:[32],isMinimized:[32],isClosed:[32],isLoading:[32]},null,{cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"],translationUrl:["handleNewTranslations"]}]]]],n))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{G as GeneralNewsNotification}from"./p-cfdc487f.js";import"./p-8b27880f.js";
|
|
@@ -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)=>e in t,s=(t,e)=>(0,console.error)(t,e),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={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)},h=t=>Promise.resolve(t),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),m=!1,d=[],w=[],y=(t,e)=>n=>{t.push(n),m||(m=!0,e&&4&f.o?b(v):f.raf(v))},$=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},v=()=>{$(d),$(w),(m=d.length>0)&&f.raf(v)},b=t=>h().then(t),g=y(w,!0),S={},j=t=>"object"==(t=typeof t)||"function"===t;function O(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:()=>k,map:()=>C,ok:()=>E,unwrap:()=>x,unwrapErr:()=>P});var E=t=>({isOk:!0,isErr:!1,value:t}),k=t=>({isOk:!1,isErr:!0,value:t});function C(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>E(t))):E(n)}if(t.isErr)return k(t.value);throw"should never get here"}var M,x=t=>{if(t.isOk)return t.value;throw t.value},P=t=>{if(t.isErr)return t.value;throw t.value},A=(t,e,...n)=>{let o=null,l=!1,s=!1;const r=[],i=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?i(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!j(o))&&(o+=""),l&&s?r[r.length-1].i+=o:r.push(l?R(null,o):o),s=l)};if(i(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=R(t,null);return c.u=e,r.length>0&&(c.h=r),c},R=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),T={},F=new WeakMap,H=t=>"sc-"+t.$,L=(t,e,n,o,s,r)=>{if(n!==o){let i=l(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,l=U(n),s=U(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 if(i||"o"!==e[0]||"n"!==e[1]){const l=j(o);if((i||l&&null!==o)&&!s)try{if(t.tagName.includes("-"))t[e]=o;else{const l=null==o?"":o;"list"===e?i=!1:null!=n&&t[e]==l||(t[e]=l)}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&r||s)&&!l&&t.setAttribute(e,o=!0===o?"":o)}else if(e="-"===e[2]?e.slice(3):l(u,c)?c.slice(2):c[2]+e.slice(3),n||o){const l=e.endsWith(W);e=e.replace(D,""),n&&f.rel(t,e,n,l),o&&f.ael(t,e,o,l)}}},N=/\s/,U=t=>t?t.split(N):[],W="Capture",D=RegExp(W+"$"),q=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||S,s=e.u||S;for(const t of G(Object.keys(l)))t in s||L(o,t,l[t],void 0,n,e.o);for(const t of G(Object.keys(s)))L(o,t,l[t],s[t],n,e.o)};function G(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,_=(t,e,n)=>{const o=e.h[n];let l,s,r=0;if(null!==o.i)l=o.m=a.createTextNode(o.i);else{if(V||(V="svg"===o.p),l=o.m=a.createElementNS(V?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.p),V&&"foreignObject"===o.p&&(V=!1),q(null,o,V),l.getRootNode().querySelector("body"),o.h)for(r=0;r<o.h.length;++r)s=_(t,o,r),s&&l.appendChild(s);"svg"===o.p?V=!1:"foreignObject"===l.tagName&&(V=!0)}return l["s-hn"]=M,l},z=(t,e,n,o,l,s)=>{let r,i=t;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);l<=s;++l)o[l]&&(r=_(null,n,l),r&&(o[l].m=r,Q(i,r,e)))},B=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.m;K(e),t&&t.remove()}}},I=(t,e)=>t.p===e.p,J=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,s=e.h,r=e.p,i=e.i;null===i?(q(t,e,V="svg"===r||"foreignObject"!==r&&V),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,r=0,i=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],p=o[f];for(;r<=c&&i<=f;)null==u?u=e[++r]:null==a?a=e[--c]:null==h?h=o[++i]:null==p?p=o[--f]:I(u,h)?(J(u,h,l),u=e[++r],h=o[++i]):I(a,p)?(J(a,p,l),a=e[--c],p=o[--f]):I(u,p)?(J(u,p,l),Q(t,u.m,a.m.nextSibling),u=e[++r],p=o[--f]):I(a,h)?(J(a,h,l),Q(t,a.m,u.m),a=e[--c],h=o[++i]):(s=_(e&&e[i],n,i),h=o[++i],s&&Q(u.m.parentNode,s,u.m));r>c?z(t,null==o[f+1]?null:o[f+1].m,n,o,i,f):i>f&&B(e,r,c)})(o,l,e,s,n):null!==s?(null!==t.i&&(o.textContent=""),z(o,null,e,s,0,s.length-1)):!n&&null!==l&&B(l,0,l.length-1),V&&"svg"===r&&(V=!1)):t.i!==i&&(o.data=i)},K=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(K)},Q=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),X=(t,e)=>{e&&!t.v&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.v=e)))},Y=(t,e)=>{if(t.o|=16,!(4&t.o))return X(t,t.S),g((()=>Z(t,e)));t.o|=512},Z=(t,e)=>{const n=t.t;if(!n)throw Error(`Can't render component <${t.$hostElement$.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`);let o;return e&&(o=rt(n,"componentWillLoad")),tt(o,(()=>nt(t,n,e)))},tt=(t,e)=>et(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),et=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,nt=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.j,n=t.$hostElement$,o=e.o,l=((t,e)=>{var n;const o=H(e),l=i.get(o);if(t=11===t.nodeType?t:a,l)if("string"==typeof l){let s,r=F.get(t=t.head||t);if(r||F.set(t,r=new Set),!r.has(o)){{s=a.createElement("style"),s.innerHTML=l;const o=null!=(n=f.O)?n:O(a);null!=o&&s.setAttribute("nonce",o),(!(1&e.o)||1&e.o&&"HEAD"!==t.nodeName)&&t.insertBefore(s,t.querySelector("link"))}4&e.o&&(s.innerHTML+=c),r&&r.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);ot(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>lt(t);0===e.length?n():(Promise.all(e).then(n),t.o|=4,e.length=0)}},ot=(t,e,n,o)=>{try{e=e.render(),t.o&=-17,t.o|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.j,s=t.k||R(null,null),r=(t=>t&&t.p===T)(e)?e:A(null,null,e);if(M=o.tagName,n&&r.u)for(const t of Object.keys(r.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.u[t]=o[t]);r.p=null,r.o|=4,t.k=r,r.m=s.m=o.shadowRoot||o,J(s,r,n)})(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},lt=t=>{const e=t.$hostElement$,n=t.S;64&t.o||(t.o|=64,it(e),t.C(e),n||st()),t.v&&(t.v(),t.v=void 0),512&t.o&&b((()=>Y(t,!1))),t.o&=-517},st=()=>{it(a.documentElement),b((()=>(t=>{const e=f.ce("appload",{detail:{namespace:"general-news-notification"}});return t.dispatchEvent(e),e})(u)))},rt=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t)}},it=t=>t.classList.add("hydrated"),ct=(t,e,o)=>{var l,r;const i=t.prototype;if(e.M||e.P||t.watchers){t.watchers&&!e.P&&(e.P=t.watchers);const c=Object.entries(null!=(l=e.M)?l:{});if(c.map((([t,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(i,t,{get(){return((t,e)=>n(this).A.get(e))(0,t)},set(o){((t,e,o,l)=>{const r=n(t);if(!r)throw Error(`Couldn't find host element for "${l.$}" 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 i=r.$hostElement$,c=r.A.get(e),u=r.o,a=r.t;if(o=((t,e)=>null==t||j(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t)(o,l.M[e][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(r.A.set(e,o),a)){if(l.P&&128&u){const t=l.P[e];t&&t.map((t=>{try{a[t](o,c,e)}catch(t){s(t,i)}}))}2==(18&u)&&Y(r,!1)}})(this,t,o,e)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;i.attributeChangedCallback=function(t,l,s){f.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.P)?void 0:r[t];null==i||i.forEach((e=>{null!=n[e]&&n[e].call(n,s,l,t)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=e.P)?r:{}),...c.filter((([t,e])=>15&e[0])).map((([t,e])=>{const n=e[1]||t;return o.set(n,t),n}))]))}}return t},ut=(t,o={})=>{var l;const h=[],m=o.exclude||[],d=u.customElements,w=a.head,y=w.querySelector("meta[charset]"),$=a.createElement("style"),v=[];let b,g=!0;Object.assign(f,o),f.l=new URL(o.resourcesUrl||"./",a.baseURI).href;let S=!1;if(t.map((t=>{t[1].map((o=>{var l;const c={o:o[0],$:o[1],M:o[2],R:o[3]};4&c.o&&(S=!0),c.M=o[2],c.P=null!=(l=o[4])?l:{};const u=c.$,a=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const o={o:0,$hostElement$:t,j:n,A:new Map};o.T=new Promise((t=>o.C=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.$}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),g?v.push(this):f.jmp((()=>(t=>{if(!(1&f.o)){const e=n(t),o=e.j,l=()=>{};if(1&e.o)(null==e?void 0:e.t)||(null==e?void 0:e.T)&&e.T.then((()=>{}));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){X(e,e.S=n);break}}o.M&&Object.entries(o.M).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)){if(e.o|=32,n.F){const t=(t=>{const e=t.$.replace(/-/g,"_"),n=t.F;if(!n)return;const o=r.get(n);return o?o[e]:import(`./${n}.entry.js`).then((t=>(r.set(n,t),t[e])),s)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};o=await t,e()}else o=t;if(!o)throw Error(`Constructor for "${n.$}#${e.H}" was not found`);o.isProxied||(n.P=o.watchers,ct(o,n,2),o.isProxied=!0);const l=()=>{};e.o|=8;try{new o(e)}catch(t){s(t)}e.o&=-9,e.o|=128,l()}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.o|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=H(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);p&&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 l=e.S,c=()=>Y(e,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(t,e,o)}l()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.o)){const t=n(this);(null==t?void 0:t.t)||(null==t?void 0:t.T)&&t.T.then((()=>{}))}})()))}componentOnReady(){return n(this).T}};c.F=t[0],m.includes(u)||d.get(u)||(h.push(u),d.define(u,ct(a,c,1)))}))})),h.length>0&&(S&&($.textContent+=c),$.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",$.innerHTML.length)){$.setAttribute("data-styles","");const t=null!=(l=f.O)?l:O(a);null!=t&&$.setAttribute("nonce",t),w.insertBefore($,y?y.nextSibling:w.firstChild)}g=!1,v.length?v.map((t=>t.connectedCallback())):f.jmp((()=>b=setTimeout(st,30)))},at=t=>f.O=t;export{ut as b,A as h,h as p,o as r,at as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i}from"./p-8b27880f.js";const e=()=>{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":"iPad"===t||"iPhone"===t?"ios":"mtWeb"},s={en:{loading:"Is Loading ..."}},o=t=>new Promise((i=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((i=>{s[i]||(s[i]={});for(let e in t[i])s[i][e]=t[i][e]})),i(!0)}))})),r=class{constructor(i){t(this,i),this.componentDidLoad=()=>{this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL())},this.connectedCallback=()=>{this.cmsEndpoint&&this.language&&this.getNotificationMessage()},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.getNotificationMessage=()=>{this.isLoading=!0;try{let t=new URL(`${this.cmsEndpoint}/${this.language}/header-notification`);t.searchParams.append("device",e()),t.searchParams.append("platform",e()),fetch(t.href).then((t=>{if(200===t.status)return t.json();throw new Error("HTTP status "+t.status)})).then((t=>{this.message=t.message})).catch((t=>{console.error(t)})).finally((()=>this.isLoading=!1))}catch(t){console.error("Error fetching message:",t)}},this.toggleMinimize=()=>{this.isMinimized=!this.isMinimized},this.closeNotification=()=>{this.isClosed=!0},this.cmsEndpoint=void 0,this.language=void 0,this.animationType="static",this.speed=30,this.canMinimize=!1,this.canClose=!1,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.message=void 0,this.isMinimized=!1,this.isClosed=!1,this.isLoading=!0}watchEndpoint(t,i){t&&t!=i&&this.cmsEndpoint&&this.language&&this.getNotificationMessage()}handleStylingChange(t,i){t!==i&&this.setClientStyling()}handleStylingUrlChange(t,i){t!==i&&this.setClientStylingURL()}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}async componentWillLoad(){this.translationUrl.length>2&&await o(this.translationUrl)}render(){if(this.isClosed)return null;const t=`${this.speed}s`;return i("div",{ref:t=>this.stylingContainer=t},this.canMinimize&&i("button",{class:"ToggleButton",onClick:this.toggleMinimize},i("span",{class:this.isMinimized?"TriangleActive":"TriangleInactive"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"6.835",viewBox:"0 0 14 6.835"},i("path",{id:"arrow",d:"M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z",transform:"translate(-274.511 -441.088)"})))),i("div",{class:{NotificationWrapper:!0,Minimized:this.isMinimized}},i("div",{class:{SlidingBar:!0,Minimized:this.isMinimized,ScrollLeft:"scroll-left"===this.animationType,ScrollRight:"scroll-right"===this.animationType,VisibleButtons:this.canMinimize||!0===this.canClose}},i("div",{class:"Message",style:{animationDuration:t}},this.isLoading?((t,i)=>{let e=s[void 0!==i&&i in s?i:"en"].loading;return e})(0,this.language):this.message)),this.canClose&&i("div",{class:"CloseButton"},i("button",{onClick:this.closeNotification},"X"))))}static get watchers(){return{cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"],translationUrl:["handleNewTranslations"]}}};r.style=":host{display:block}.NotificationWrapper{background:var(--emw-header-color-background, var(--emw-color-background, #000000));color:var(--emfe-w-color-white, #FFFFFF);position:sticky;width:100%;text-align:center;overflow:hidden;z-index:298;display:flex;justify-content:flex-end;align-items:center;border-bottom:6px solid var(--emfe-w-color-primary, #22B04E);max-height:40px}.SlidingBar{transition:all 0.3s ease-in-out;width:100%}.Message{will-change:transform;margin:0 auto;padding:10px;width:90%}.ScrollLeft .Message{white-space:nowrap;animation:scroll-left 10s linear infinite;width:100%}.ScrollRight .Message{white-space:nowrap;animation:scroll-right 10s linear infinite;width:100%}.VisibleButtons .Message{display:flex}@keyframes scroll-left{from{transform:translateX(100%)}to{transform:translateX(-100%)}}@keyframes scroll-right{from{transform:translateX(-100%)}to{transform:translateX(100%)}}.SlidingBar:hover .Message{animation-play-state:paused}.CloseButton{padding-left:10px;background-color:var(--emw-header-color-background, var(--emw-color-background, #000000));display:flex;z-index:299;gap:10px}.ToggleButton{position:absolute;left:0}.ToggleButton .TriangleActive,.ToggleButton .TriangleInactive{display:block;transition:all 0.2s}.ToggleButton .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px);fill:var(--emw--color-primary, #52d004);margin-top:8px}.ToggleButton svg{fill:var(--emw-header-color-background, var(--emw-color-background, #000000));width:16px;transform:rotate(180deg)}.CloseButton{right:10px}button{background-color:var(--emfe-w-color-primary, #22B04E);color:var(--emw-header-color-background, var(--emw-color-background, #000000));border:none;width:40px;height:40px;cursor:pointer}.NotificationWrapper.Minimized{visibility:hidden}";export{r as G}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{G as general_news_notification}from"./p-cfdc487f.js";import"./p-8b27880f.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './esm/index.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'general-news-notification',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'dist',
|
|
14
|
+
esmLoaderPath: '../loader'
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare class GeneralNewsNotification {
|
|
2
|
+
/**
|
|
3
|
+
* The CMS endpoint
|
|
4
|
+
*/
|
|
5
|
+
cmsEndpoint: string;
|
|
6
|
+
/**
|
|
7
|
+
* The language
|
|
8
|
+
*/
|
|
9
|
+
language: string;
|
|
10
|
+
/**
|
|
11
|
+
* Animation types
|
|
12
|
+
*/
|
|
13
|
+
animationType: 'static' | 'scroll-left' | 'scroll-right';
|
|
14
|
+
/**
|
|
15
|
+
* Default speed of the scroll animation in seconds
|
|
16
|
+
*/
|
|
17
|
+
speed: number;
|
|
18
|
+
/**
|
|
19
|
+
* Option to minimize
|
|
20
|
+
*/
|
|
21
|
+
canMinimize: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Option to close the notification
|
|
24
|
+
*/
|
|
25
|
+
canClose: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Client custom styling via string
|
|
28
|
+
*/
|
|
29
|
+
clientStyling: string;
|
|
30
|
+
/**
|
|
31
|
+
* Client custom styling via url content
|
|
32
|
+
*/
|
|
33
|
+
clientStylingUrl: string;
|
|
34
|
+
/**
|
|
35
|
+
* The translationurl
|
|
36
|
+
*/
|
|
37
|
+
translationUrl: string;
|
|
38
|
+
message: string;
|
|
39
|
+
isMinimized: boolean;
|
|
40
|
+
isClosed: boolean;
|
|
41
|
+
private isLoading;
|
|
42
|
+
private stylingContainer;
|
|
43
|
+
watchEndpoint(newValue: string, oldValue: string): void;
|
|
44
|
+
handleStylingChange(newValue: string, oldValue: string): void;
|
|
45
|
+
handleStylingUrlChange(newValue: string, oldValue: string): void;
|
|
46
|
+
handleNewTranslations(): void;
|
|
47
|
+
componentWillLoad(): Promise<void>;
|
|
48
|
+
componentDidLoad: () => void;
|
|
49
|
+
connectedCallback: () => void;
|
|
50
|
+
setClientStyling: () => void;
|
|
51
|
+
setClientStylingURL: () => void;
|
|
52
|
+
getNotificationMessage: () => void;
|
|
53
|
+
toggleMinimize: () => void;
|
|
54
|
+
closeNotification: () => void;
|
|
55
|
+
render(): any;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GeneralNewsNotification } from './general-news-notification';
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/**
|
|
4
|
+
* This is an autogenerated file created by the Stencil compiler.
|
|
5
|
+
* It contains typing information for all components that exist in this project.
|
|
6
|
+
*/
|
|
7
|
+
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
export namespace Components {
|
|
9
|
+
interface GeneralNewsNotification {
|
|
10
|
+
/**
|
|
11
|
+
* Animation types
|
|
12
|
+
*/
|
|
13
|
+
"animationType": 'static' | 'scroll-left' | 'scroll-right';
|
|
14
|
+
/**
|
|
15
|
+
* Option to close the notification
|
|
16
|
+
*/
|
|
17
|
+
"canClose": boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Option to minimize
|
|
20
|
+
*/
|
|
21
|
+
"canMinimize": boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Client custom styling via string
|
|
24
|
+
*/
|
|
25
|
+
"clientStyling": string;
|
|
26
|
+
/**
|
|
27
|
+
* Client custom styling via url content
|
|
28
|
+
*/
|
|
29
|
+
"clientStylingUrl": string;
|
|
30
|
+
/**
|
|
31
|
+
* The CMS endpoint
|
|
32
|
+
*/
|
|
33
|
+
"cmsEndpoint": string;
|
|
34
|
+
/**
|
|
35
|
+
* The language
|
|
36
|
+
*/
|
|
37
|
+
"language": string;
|
|
38
|
+
/**
|
|
39
|
+
* Default speed of the scroll animation in seconds
|
|
40
|
+
*/
|
|
41
|
+
"speed": number;
|
|
42
|
+
/**
|
|
43
|
+
* The translationurl
|
|
44
|
+
*/
|
|
45
|
+
"translationUrl": string;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
declare global {
|
|
49
|
+
interface HTMLGeneralNewsNotificationElement extends Components.GeneralNewsNotification, HTMLStencilElement {
|
|
50
|
+
}
|
|
51
|
+
var HTMLGeneralNewsNotificationElement: {
|
|
52
|
+
prototype: HTMLGeneralNewsNotificationElement;
|
|
53
|
+
new (): HTMLGeneralNewsNotificationElement;
|
|
54
|
+
};
|
|
55
|
+
interface HTMLElementTagNameMap {
|
|
56
|
+
"general-news-notification": HTMLGeneralNewsNotificationElement;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
declare namespace LocalJSX {
|
|
60
|
+
interface GeneralNewsNotification {
|
|
61
|
+
/**
|
|
62
|
+
* Animation types
|
|
63
|
+
*/
|
|
64
|
+
"animationType"?: 'static' | 'scroll-left' | 'scroll-right';
|
|
65
|
+
/**
|
|
66
|
+
* Option to close the notification
|
|
67
|
+
*/
|
|
68
|
+
"canClose"?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Option to minimize
|
|
71
|
+
*/
|
|
72
|
+
"canMinimize"?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Client custom styling via string
|
|
75
|
+
*/
|
|
76
|
+
"clientStyling"?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Client custom styling via url content
|
|
79
|
+
*/
|
|
80
|
+
"clientStylingUrl"?: string;
|
|
81
|
+
/**
|
|
82
|
+
* The CMS endpoint
|
|
83
|
+
*/
|
|
84
|
+
"cmsEndpoint"?: string;
|
|
85
|
+
/**
|
|
86
|
+
* The language
|
|
87
|
+
*/
|
|
88
|
+
"language"?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Default speed of the scroll animation in seconds
|
|
91
|
+
*/
|
|
92
|
+
"speed"?: number;
|
|
93
|
+
/**
|
|
94
|
+
* The translationurl
|
|
95
|
+
*/
|
|
96
|
+
"translationUrl"?: string;
|
|
97
|
+
}
|
|
98
|
+
interface IntrinsicElements {
|
|
99
|
+
"general-news-notification": GeneralNewsNotification;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export { LocalJSX as JSX };
|
|
103
|
+
declare module "@stencil/core" {
|
|
104
|
+
export namespace JSX {
|
|
105
|
+
interface IntrinsicElements {
|
|
106
|
+
"general-news-notification": LocalJSX.GeneralNewsNotification & JSXBase.HTMLAttributes<HTMLGeneralNewsNotificationElement>;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/general-news-notification';
|