@everymatrix/general-news-notification 1.58.0 → 1.59.1

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.
Files changed (24) hide show
  1. package/dist/cjs/{general-news-notification-5c259234.js → general-news-notification-4a15ce82.js} +1 -1
  2. package/dist/cjs/general-news-notification.cjs.entry.js +1 -1
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/collection/components/general-news-notification/general-news-notification.css +0 -2
  5. package/dist/esm/{general-news-notification-5b4fba57.js → general-news-notification-ed25ca2d.js} +1 -1
  6. package/dist/esm/general-news-notification.entry.js +1 -1
  7. package/dist/esm/index.js +1 -1
  8. package/dist/general-news-notification/general-news-notification.esm.js +1 -1
  9. package/dist/general-news-notification/index.esm.js +1 -1
  10. package/dist/general-news-notification/{p-2fc8870b.js → p-1d13531c.js} +1 -1
  11. package/dist/general-news-notification/p-7204f890.entry.js +1 -0
  12. 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
  13. 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
  14. package/package.json +1 -1
  15. package/dist/general-news-notification/p-b7662132.entry.js +0 -1
  16. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/general-news-notification/.stencil/packages/stencil/general-news-notification/stencil.config.d.ts +0 -2
  17. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/general-news-notification/.stencil/packages/stencil/general-news-notification/stencil.config.dev.d.ts +0 -2
  18. /package/dist/types/{builds/emfe-widgets → Users/adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-news-notification/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
  19. /package/dist/types/{builds/emfe-widgets → Users/adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-news-notification/.stencil/packages/stencil/general-news-notification/storybook/main.d.ts +0 -0
  20. /package/dist/types/{builds/emfe-widgets → Users/adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-news-notification/.stencil/packages/stencil/general-news-notification/storybook/preview.d.ts +0 -0
  21. /package/dist/types/{builds/emfe-widgets → Users/adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-news-notification/.stencil/tools/plugins/index.d.ts +0 -0
  22. /package/dist/types/{builds/emfe-widgets → Users/adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-news-notification/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  23. /package/dist/types/{builds/emfe-widgets → Users/adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-news-notification/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  24. /package/dist/types/{builds/emfe-widgets → Users/adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-news-notification/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -122,7 +122,7 @@ function setStreamStyling(stylingContainer, domain, subscription) {
122
122
  }
123
123
  }
124
124
 
125
- const generalNewsNotificationCss = ":host{display:block}.NotificationWrapper{background:var(--emw--header-color-background, var(--emw--color-background, #000000));color:var(--emw--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(--emw--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(--emw--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}";
125
+ const generalNewsNotificationCss = ":host{display:block}.NotificationWrapper{background:var(--emw--header-color-background, var(--emw--color-background, #000000));color:var(--emw--color-white, #FFFFFF);position:sticky;width:100%;text-align:center;overflow:hidden;display:flex;justify-content:flex-end;align-items:center;border-bottom:6px solid var(--emw--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;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(--emw--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}";
126
126
  const GeneralNewsNotificationStyle0 = generalNewsNotificationCss;
127
127
 
128
128
  const GeneralNewsNotification = class {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const generalNewsNotification = require('./general-news-notification-5c259234.js');
5
+ const generalNewsNotification = require('./general-news-notification-4a15ce82.js');
6
6
  require('./index-a2d41176.js');
7
7
 
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const generalNewsNotification = require('./general-news-notification-5c259234.js');
5
+ const generalNewsNotification = require('./general-news-notification-4a15ce82.js');
6
6
  require('./index-a2d41176.js');
7
7
 
8
8
 
@@ -9,7 +9,6 @@
9
9
  width: 100%;
10
10
  text-align: center;
11
11
  overflow: hidden;
12
- z-index: 298;
13
12
  display: flex;
14
13
  justify-content: flex-end;
15
14
  align-items: center;
@@ -69,7 +68,6 @@
69
68
  padding-left: 10px;
70
69
  background-color: var(--emw--header-color-background, var(--emw--color-background, #000000));
71
70
  display: flex;
72
- z-index: 299;
73
71
  gap: 10px;
74
72
  }
75
73
 
@@ -120,7 +120,7 @@ function setStreamStyling(stylingContainer, domain, subscription) {
120
120
  }
121
121
  }
122
122
 
123
- const generalNewsNotificationCss = ":host{display:block}.NotificationWrapper{background:var(--emw--header-color-background, var(--emw--color-background, #000000));color:var(--emw--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(--emw--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(--emw--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}";
123
+ const generalNewsNotificationCss = ":host{display:block}.NotificationWrapper{background:var(--emw--header-color-background, var(--emw--color-background, #000000));color:var(--emw--color-white, #FFFFFF);position:sticky;width:100%;text-align:center;overflow:hidden;display:flex;justify-content:flex-end;align-items:center;border-bottom:6px solid var(--emw--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;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(--emw--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}";
124
124
  const GeneralNewsNotificationStyle0 = generalNewsNotificationCss;
125
125
 
126
126
  const GeneralNewsNotification = class {
@@ -1,2 +1,2 @@
1
- export { G as general_news_notification } from './general-news-notification-5b4fba57.js';
1
+ export { G as general_news_notification } from './general-news-notification-ed25ca2d.js';
2
2
  import './index-4f53ce97.js';
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { G as GeneralNewsNotification } from './general-news-notification-5b4fba57.js';
1
+ export { G as GeneralNewsNotification } from './general-news-notification-ed25ca2d.js';
2
2
  import './index-4f53ce97.js';
@@ -1 +1 @@
1
- import{p as n,b as i}from"./p-b1020fc5.js";export{s as setNonce}from"./p-b1020fc5.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-b7662132",[[1,"general-news-notification",{cmsEndpoint:[1,"cms-endpoint"],language:[1],animationType:[1,"animation-type"],speed:[2],canMinimize:[4,"can-minimize"],canClose:[4,"can-close"],mbSource:[1,"mb-source"],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:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["handleNewTranslations"]}]]]],n))));
1
+ import{p as n,b as i}from"./p-b1020fc5.js";export{s as setNonce}from"./p-b1020fc5.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-7204f890",[[1,"general-news-notification",{cmsEndpoint:[1,"cms-endpoint"],language:[1],animationType:[1,"animation-type"],speed:[2],canMinimize:[4,"can-minimize"],canClose:[4,"can-close"],mbSource:[1,"mb-source"],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:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["handleNewTranslations"]}]]]],n))));
@@ -1 +1 @@
1
- export{G as GeneralNewsNotification}from"./p-2fc8870b.js";import"./p-b1020fc5.js";
1
+ export{G as GeneralNewsNotification}from"./p-1d13531c.js";import"./p-b1020fc5.js";
@@ -1 +1 @@
1
- import{r as t,h as i}from"./p-b1020fc5.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)}))}));function n(t,i){if(t){const e=document.createElement("style");e.innerHTML=i,t.appendChild(e)}}function a(t,i){const e=new URL(i);fetch(e.href).then((t=>t.text())).then((i=>{const e=document.createElement("style");e.innerHTML=i,t&&t.appendChild(e)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}const r=class{constructor(i){t(this,i),this.connectedCallback=()=>{this.cmsEndpoint&&this.language&&this.getNotificationMessage()},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,window.postMessage({type:"NewsWidgetResize",status:"minimized"},window.location.href)},this.closeNotification=()=>{this.isClosed=!0,window.postMessage({type:"NewsWidgetResize",status:"closed"},window.location.href)},this.cmsEndpoint=void 0,this.language=void 0,this.animationType="static",this.speed=30,this.canMinimize=!1,this.canClose=!1,this.mbSource=void 0,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()}handleClientStylingChange(t,i){t!=i&&n(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,i){t!=i&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}async componentWillLoad(){this.translationUrl.length>2&&await o(this.translationUrl)}componentDidLoad(){window.postMessage({type:"NewsWidgetResize",status:"loaded"},window.location.href),this.stylingContainer&&(null!=window.emMessageBus?function(t,i){if(window.emMessageBus){const e=document.createElement("style");window.emMessageBus.subscribe(i,(i=>{e.innerHTML=i,t&&t.appendChild(e)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}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:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["handleNewTranslations"]}}};r.style=":host{display:block}.NotificationWrapper{background:var(--emw--header-color-background, var(--emw--color-background, #000000));color:var(--emw--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(--emw--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(--emw--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}
1
+ import{r as t,h as i}from"./p-b1020fc5.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)}))}));function n(t,i){if(t){const e=document.createElement("style");e.innerHTML=i,t.appendChild(e)}}function a(t,i){const e=new URL(i);fetch(e.href).then((t=>t.text())).then((i=>{const e=document.createElement("style");e.innerHTML=i,t&&t.appendChild(e)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}const r=class{constructor(i){t(this,i),this.connectedCallback=()=>{this.cmsEndpoint&&this.language&&this.getNotificationMessage()},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,window.postMessage({type:"NewsWidgetResize",status:"minimized"},window.location.href)},this.closeNotification=()=>{this.isClosed=!0,window.postMessage({type:"NewsWidgetResize",status:"closed"},window.location.href)},this.cmsEndpoint=void 0,this.language=void 0,this.animationType="static",this.speed=30,this.canMinimize=!1,this.canClose=!1,this.mbSource=void 0,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()}handleClientStylingChange(t,i){t!=i&&n(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,i){t!=i&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}async componentWillLoad(){this.translationUrl.length>2&&await o(this.translationUrl)}componentDidLoad(){window.postMessage({type:"NewsWidgetResize",status:"loaded"},window.location.href),this.stylingContainer&&(null!=window.emMessageBus?function(t,i){if(window.emMessageBus){const e=document.createElement("style");window.emMessageBus.subscribe(i,(i=>{e.innerHTML=i,t&&t.appendChild(e)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}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:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["handleNewTranslations"]}}};r.style=":host{display:block}.NotificationWrapper{background:var(--emw--header-color-background, var(--emw--color-background, #000000));color:var(--emw--color-white, #FFFFFF);position:sticky;width:100%;text-align:center;overflow:hidden;display:flex;justify-content:flex-end;align-items:center;border-bottom:6px solid var(--emw--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;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(--emw--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-1d13531c.js";import"./p-b1020fc5.js";
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/general-news-notification",
3
- "version": "1.58.0",
3
+ "version": "1.59.1",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- export{G as general_news_notification}from"./p-2fc8870b.js";import"./p-b1020fc5.js";
@@ -1,2 +0,0 @@
1
- import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
- export declare const config: Config;
@@ -1,2 +0,0 @@
1
- import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
- export declare const config: Config;