@telia-ace/widget-components-area-flamingo 1.1.76-rc.11 → 1.1.76-rc.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,7 +66,7 @@
66
66
  * @license
67
67
  * Copyright 2020 Google LLC
68
68
  * SPDX-License-Identifier: BSD-3-Clause
69
- */const ue=()=>new hi;class hi{}const ht=new WeakMap,de=_t(class extends le{render(s){return u}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),u}rt(s){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=ht.get(t);e===void 0&&(e=new WeakMap,ht.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ht.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var li=Object.defineProperty,pi=Object.getOwnPropertyDescriptor,V=(s,t,e,i)=>{for(var r=i>1?void 0:i?pi(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&li(t,e,r),r};class w extends m{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=ue(),this.widgetActive$=new Ye(!1),this.componentIsDestroyed$=new yt}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.widgetActive$.next(!1),this.showTrigger())}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&pe(this.application.settings.branding,this)}async _renderSymbol(){var a,c,h;const t=(a=this.application)==null?void 0:a.branding(),e=(c=t==null?void 0:t.graphics)==null?void 0:c.trigger;if(e)return C` <img src=${e} class="trigger-icon" alt="" /> `;const i=(h=this.application)==null?void 0:h.triggerIcon;if(!i)return u;const r=async l=>ci,{type:o,content:n}=i;switch(o){case"Telia":{const l=await r();return l?C`<telia-icon
69
+ */const ue=()=>new hi;class hi{}const ht=new WeakMap,de=_t(class extends le{render(s){return u}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),u}rt(s){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=ht.get(t);e===void 0&&(e=new WeakMap,ht.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ht.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var li=Object.defineProperty,pi=Object.getOwnPropertyDescriptor,V=(s,t,e,i)=>{for(var r=i>1?void 0:i?pi(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&li(t,e,r),r};class w extends m{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=ue(),this.widgetActive$=new Ye(!1),this.componentIsDestroyed$=new yt}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.notify("widget-set-active",{widgetId:this.application.id,active:!0}),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.notify("widget-set-active",{widgetId:this.application.id,active:!1}),this.widgetActive$.next(!1),this.showTrigger())}notify(t,e={}){window!=null&&window.parent&&window.parent.postMessage({type:t,data:e})}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&pe(this.application.settings.branding,this)}async _renderSymbol(){var a,c,h;const t=(a=this.application)==null?void 0:a.branding(),e=(c=t==null?void 0:t.graphics)==null?void 0:c.trigger;if(e)return C` <img src=${e} class="trigger-icon" alt="" /> `;const i=(h=this.application)==null?void 0:h.triggerIcon;if(!i)return u;const r=async l=>ci,{type:o,content:n}=i;switch(o){case"Telia":{const l=await r();return l?C`<telia-icon
70
70
  class="trigger-icon"
71
71
  svg=${l.svg}
72
72
  size="lg"
@@ -1616,7 +1616,19 @@ class w extends m {
1616
1616
  );
1617
1617
  return;
1618
1618
  }
1619
- this.active = !this.active, this.active ? (this.application.appendToDOM(), this.widgetActive$.next(!0), this.hideTrigger()) : (this.application.hide(), this.widgetActive$.next(!1), this.showTrigger());
1619
+ this.active = !this.active, this.active ? (this.application.appendToDOM(), this.notify("widget-set-active", {
1620
+ widgetId: this.application.id,
1621
+ active: !0
1622
+ }), this.widgetActive$.next(!0), this.hideTrigger()) : (this.application.hide(), this.notify("widget-set-active", {
1623
+ widgetId: this.application.id,
1624
+ active: !1
1625
+ }), this.widgetActive$.next(!1), this.showTrigger());
1626
+ }
1627
+ notify(t, e = {}) {
1628
+ window != null && window.parent && window.parent.postMessage({
1629
+ type: t,
1630
+ data: e
1631
+ });
1620
1632
  }
1621
1633
  _applyBranding() {
1622
1634
  var t;
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";const r=async e=>{e.registerComponent("area",Promise.resolve().then(()=>require("./area-929c9764.js")))};module.exports=r;
1
+ "use strict";const r=async e=>{e.registerComponent("area",Promise.resolve().then(()=>require("./area-2bf07f24.js")))};module.exports=r;
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const o = async (e) => {
2
- e.registerComponent("area", import("./area-3b36f4f8.mjs"));
2
+ e.registerComponent("area", import("./area-bea9c2e9.mjs"));
3
3
  };
4
4
  export {
5
5
  o as default
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-components-area-flamingo",
3
- "version": "1.1.76-rc.11",
3
+ "version": "1.1.76-rc.13",
4
4
  "dependencies": {
5
- "@telia-ace/widget-core-flamingo": "1.1.76-rc.11",
5
+ "@telia-ace/widget-core-flamingo": "1.1.76-rc.13",
6
6
  "lit": "^3.0.2"
7
7
  },
8
8
  "main": "./index.js",