@telia-ace/widget-core-flamingo 1.1.76-rc.15 → 1.1.76-rc.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/index.js +9 -1
  2. package/index.mjs +24 -16
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -284,7 +284,7 @@
284
284
  * @license
285
285
  * Copyright 2017 Google LLC
286
286
  * SPDX-License-Identifier: BSD-3-Clause
287
- */function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Gt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Gt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=me()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&ge(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,r;const t=this.application.settings.components.conversation;return((r=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:r.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===$.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),R`<div class="widget-container" ${ve(this.wrapperRef)}>
287
+ */function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Gt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Gt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=me()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&ge(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,r;const t=this.application.settings.components.conversation;return((r=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:r.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===$.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),window.self!==window.top?(console.log("This page is embedded in an iframe."),this.renderRoot.host.classList.add("embedded")):console.log("This page is not embedded in an iframe."),R`<div class="widget-container" ${ve(this.wrapperRef)}>
288
288
  ${xi(this.nodes,n=>n)}
289
289
  </div>`}}nt.styles=N`
290
290
  :host {
@@ -331,6 +331,14 @@
331
331
  position: fixed;
332
332
  }
333
333
 
334
+ :host(.embedded) {
335
+ padding: 40px !important;
336
+ }
337
+
338
+ :host(.embedded) .widget-container {
339
+ border-radius: var(--border-radius) !important;
340
+ }
341
+
334
342
  @media screen and (max-width: 800px) {
335
343
  :host(.floating) {
336
344
  inset: 0;
package/index.mjs CHANGED
@@ -587,7 +587,7 @@ const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), N = (s,
587
587
  * Copyright 2017 Google LLC
588
588
  * SPDX-License-Identifier: BSD-3-Clause
589
589
  */
590
- const { is: Ne, defineProperty: Ue, getOwnPropertyDescriptor: Me, getOwnPropertyNames: je, getOwnPropertySymbols: He, getPrototypeOf: Le } = Object, C = globalThis, Mt = C.trustedTypes, De = Mt ? Mt.emptyScript : "", ct = C.reactiveElementPolyfillSupport, j = (s, t) => s, X = { toAttribute(s, t) {
590
+ const { is: Ne, defineProperty: Ue, getOwnPropertyDescriptor: Me, getOwnPropertyNames: je, getOwnPropertySymbols: Le, getPrototypeOf: He } = Object, C = globalThis, Mt = C.trustedTypes, De = Mt ? Mt.emptyScript : "", ct = C.reactiveElementPolyfillSupport, j = (s, t) => s, X = { toAttribute(s, t) {
591
591
  switch (t) {
592
592
  case Boolean:
593
593
  s = s ? De : null;
@@ -649,14 +649,14 @@ let I = class extends HTMLElement {
649
649
  static _$Ei() {
650
650
  if (this.hasOwnProperty(j("elementProperties")))
651
651
  return;
652
- const t = Le(this);
652
+ const t = He(this);
653
653
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
654
654
  }
655
655
  static finalize() {
656
656
  if (this.hasOwnProperty(j("finalized")))
657
657
  return;
658
658
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
659
- const e = this.properties, i = [...je(e), ...He(e)];
659
+ const e = this.properties, i = [...je(e), ...Le(e)];
660
660
  for (const r of i)
661
661
  this.createProperty(r, e[r]);
662
662
  }
@@ -834,13 +834,13 @@ I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[j("elementProper
834
834
  * Copyright 2017 Google LLC
835
835
  * SPDX-License-Identifier: BSD-3-Clause
836
836
  */
837
- const H = globalThis, Q = H.trustedTypes, Ht = Q ? Q.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ae = "$lit$", x = `lit$${(Math.random() + "").slice(9)}$`, ce = "?" + x, Be = `<${ce}>`, O = document, D = () => O.createComment(""), B = (s) => s === null || typeof s != "object" && typeof s != "function", he = Array.isArray, ze = (s) => he(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", ht = `[
838
- \f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Lt = /-->/g, Dt = />/g, S = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
837
+ const L = globalThis, Q = L.trustedTypes, Lt = Q ? Q.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ae = "$lit$", x = `lit$${(Math.random() + "").slice(9)}$`, ce = "?" + x, Be = `<${ce}>`, O = document, D = () => O.createComment(""), B = (s) => s === null || typeof s != "object" && typeof s != "function", he = Array.isArray, ze = (s) => he(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", ht = `[
838
+ \f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ht = /-->/g, Dt = />/g, S = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
839
839
  \f\r"'\`<>=]|("|')|))|$)`, "g"), Bt = /'/g, zt = /"/g, le = /^(?:script|style|textarea|title)$/i, We = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), R = We(1), T = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Wt = /* @__PURE__ */ new WeakMap(), P = O.createTreeWalker(O, 129);
840
840
  function de(s, t) {
841
841
  if (!Array.isArray(s) || !s.hasOwnProperty("raw"))
842
842
  throw Error("invalid template strings array");
843
- return Ht !== void 0 ? Ht.createHTML(t) : t;
843
+ return Lt !== void 0 ? Lt.createHTML(t) : t;
844
844
  }
845
845
  const Fe = (s, t) => {
846
846
  const e = s.length - 1, i = [];
@@ -849,7 +849,7 @@ const Fe = (s, t) => {
849
849
  const c = s[a];
850
850
  let h, l, d = -1, p = 0;
851
851
  for (; p < c.length && (o.lastIndex = p, l = o.exec(c), l !== null); )
852
- p = o.lastIndex, o === M ? l[1] === "!--" ? o = Lt : l[1] !== void 0 ? o = Dt : l[2] !== void 0 ? (le.test(l[2]) && (r = RegExp("</" + l[2], "g")), o = S) : l[3] !== void 0 && (o = S) : o === S ? l[0] === ">" ? (o = r ?? M, d = -1) : l[1] === void 0 ? d = -2 : (d = o.lastIndex - l[2].length, h = l[1], o = l[3] === void 0 ? S : l[3] === '"' ? zt : Bt) : o === zt || o === Bt ? o = S : o === Lt || o === Dt ? o = M : (o = S, r = void 0);
852
+ p = o.lastIndex, o === M ? l[1] === "!--" ? o = Ht : l[1] !== void 0 ? o = Dt : l[2] !== void 0 ? (le.test(l[2]) && (r = RegExp("</" + l[2], "g")), o = S) : l[3] !== void 0 && (o = S) : o === S ? l[0] === ">" ? (o = r ?? M, d = -1) : l[1] === void 0 ? d = -2 : (d = o.lastIndex - l[2].length, h = l[1], o = l[3] === void 0 ? S : l[3] === '"' ? zt : Bt) : o === zt || o === Bt ? o = S : o === Ht || o === Dt ? o = M : (o = S, r = void 0);
853
853
  const f = o === S && s[a + 1].startsWith("/>") ? " " : "";
854
854
  n += o === M ? c + Be : d >= 0 ? (i.push(h), c.slice(0, d) + ae + c.slice(d) + x + f) : c + x + (d === -2 ? a : f);
855
855
  }
@@ -1070,8 +1070,8 @@ class Ze {
1070
1070
  k(this, t);
1071
1071
  }
1072
1072
  }
1073
- const lt = H.litHtmlPolyfillSupport;
1074
- lt == null || lt(z, F), (H.litHtmlVersions ?? (H.litHtmlVersions = [])).push("3.1.2");
1073
+ const lt = L.litHtmlPolyfillSupport;
1074
+ lt == null || lt(z, F), (L.litHtmlVersions ?? (L.litHtmlVersions = [])).push("3.1.2");
1075
1075
  const Je = (s, t, e) => {
1076
1076
  const i = (e == null ? void 0 : e.renderBefore) ?? t;
1077
1077
  let r = i._$litPart$;
@@ -1228,13 +1228,13 @@ const ii = (s) => s.strings === void 0;
1228
1228
  * Copyright 2017 Google LLC
1229
1229
  * SPDX-License-Identifier: BSD-3-Clause
1230
1230
  */
1231
- const L = (s, t) => {
1231
+ const H = (s, t) => {
1232
1232
  var i;
1233
1233
  const e = s._$AN;
1234
1234
  if (e === void 0)
1235
1235
  return !1;
1236
1236
  for (const r of e)
1237
- (i = r._$AO) == null || i.call(r, t, !1), L(r, t);
1237
+ (i = r._$AO) == null || i.call(r, t, !1), H(r, t);
1238
1238
  return !0;
1239
1239
  }, tt = (s) => {
1240
1240
  let t, e;
@@ -1262,11 +1262,11 @@ function ri(s, t = !1, e = 0) {
1262
1262
  if (t)
1263
1263
  if (Array.isArray(i))
1264
1264
  for (let n = e; n < i.length; n++)
1265
- L(i[n], !1), tt(i[n]);
1265
+ H(i[n], !1), tt(i[n]);
1266
1266
  else
1267
- i != null && (L(i, !1), tt(i));
1267
+ i != null && (H(i, !1), tt(i));
1268
1268
  else
1269
- L(this, s);
1269
+ H(this, s);
1270
1270
  }
1271
1271
  const ni = (s) => {
1272
1272
  s.type == xt.CHILD && (s._$AP ?? (s._$AP = ri), s._$AQ ?? (s._$AQ = si));
@@ -1280,7 +1280,7 @@ class fe extends pe {
1280
1280
  }
1281
1281
  _$AO(t, e = !0) {
1282
1282
  var i, r;
1283
- t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), e && (L(this, t), tt(this));
1283
+ t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), e && (H(this, t), tt(this));
1284
1284
  }
1285
1285
  setValue(t) {
1286
1286
  if (ii(this._$Ct))
@@ -2130,7 +2130,7 @@ class nt extends _ {
2130
2130
  render() {
2131
2131
  var i, r;
2132
2132
  const t = this.application.settings.components.conversation;
2133
- return ((r = (i = t == null ? void 0 : t.properties) == null ? void 0 : i.chat) == null ? void 0 : r.isThirdPartyWidget) ? this.renderRoot.host.classList.add("third-party") : this.application.renderStrategy === w.Trigger && (this.renderRoot.host.classList.add("floating"), this.application.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.application.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right")), R`<div class="widget-container" ${ve(this.wrapperRef)}>
2133
+ return ((r = (i = t == null ? void 0 : t.properties) == null ? void 0 : i.chat) == null ? void 0 : r.isThirdPartyWidget) ? this.renderRoot.host.classList.add("third-party") : this.application.renderStrategy === w.Trigger && (this.renderRoot.host.classList.add("floating"), this.application.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.application.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right")), window.self !== window.top ? (console.log("This page is embedded in an iframe."), this.renderRoot.host.classList.add("embedded")) : console.log("This page is not embedded in an iframe."), R`<div class="widget-container" ${ve(this.wrapperRef)}>
2134
2134
  ${bi(this.nodes, (n) => n)}
2135
2135
  </div>`;
2136
2136
  }
@@ -2180,6 +2180,14 @@ nt.styles = N`
2180
2180
  position: fixed;
2181
2181
  }
2182
2182
 
2183
+ :host(.embedded) {
2184
+ padding: 40px !important;
2185
+ }
2186
+
2187
+ :host(.embedded) .widget-container {
2188
+ border-radius: var(--border-radius) !important;
2189
+ }
2190
+
2183
2191
  @media screen and (max-width: 800px) {
2184
2192
  :host(.floating) {
2185
2193
  inset: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-core-flamingo",
3
- "version": "1.1.76-rc.15",
3
+ "version": "1.1.76-rc.17",
4
4
  "dependencies": {
5
5
  "lit": "^3.0.2",
6
6
  "@teliads/icons": "^8.4.0",