@telia-ace/widget-conversation-flamingo 1.1.11 → 1.1.12-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/{conversation-b2f9f789.js → conversation-5265abc7.js} +2 -2
- package/{conversation-17a64990.mjs → conversation-8c2255c2.mjs} +80 -80
- package/{index-ecfa0fe7.js → index-5cf6726d.js} +1 -1
- package/{index-ffd77508.mjs → index-836222bd.mjs} +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-5cf6726d.js"),Vt=require("./send-eb8b9428.js");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2017 Google LLC
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -298,7 +298,7 @@
|
|
298
298
|
</div>
|
299
299
|
<form class="conversation-bottom" @submit=${this._onSendMessage}>
|
300
300
|
<input
|
301
|
-
placeholder
|
301
|
+
placeholder=${this.properties.inputPlaceholder||"Type your message here..."}
|
302
302
|
.value=${this.message}
|
303
303
|
@input=${this._inputHandler}
|
304
304
|
/>
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { p as Dt, P as ue, h as
|
1
|
+
import { p as Dt, P as ue, h as pe, i as w, n as x, r as k, E as pt, a as Nt, t as at, e as lt, T as f, s as A, x as p, C as V, b as Ht, w as fe } from "./index-836222bd.mjs";
|
2
2
|
import { s as $e } from "./send-18482cae.mjs";
|
3
3
|
/**
|
4
4
|
* @license
|
5
5
|
* Copyright 2017 Google LLC
|
6
6
|
* SPDX-License-Identifier: BSD-3-Clause
|
7
7
|
*/
|
8
|
-
const
|
8
|
+
const L = (e) => (t, s) => {
|
9
9
|
s !== void 0 ? s.addInitializer(() => {
|
10
10
|
customElements.define(e, t);
|
11
11
|
}) : customElements.define(e, t);
|
@@ -30,7 +30,7 @@ let zt = class extends Event {
|
|
30
30
|
* Copyright 2021 Google LLC
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
32
32
|
*/
|
33
|
-
let
|
33
|
+
let ft = class {
|
34
34
|
constructor(t, s, i, n) {
|
35
35
|
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, r) => {
|
36
36
|
this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, r)), this.unsubscribe = r;
|
@@ -125,11 +125,11 @@ let me = class extends Event {
|
|
125
125
|
function ve({ context: e, subscribe: t }) {
|
126
126
|
return (s, i) => {
|
127
127
|
typeof i == "object" ? i.addInitializer(function() {
|
128
|
-
new
|
128
|
+
new ft(this, { context: e, callback: (n) => {
|
129
129
|
this[i.name] = n;
|
130
130
|
}, subscribe: t });
|
131
131
|
}) : s.constructor.addInitializer((n) => {
|
132
|
-
new
|
132
|
+
new ft(n, { context: e, callback: (o) => {
|
133
133
|
n[i] = o;
|
134
134
|
}, subscribe: t });
|
135
135
|
});
|
@@ -160,7 +160,7 @@ class Ce {
|
|
160
160
|
);
|
161
161
|
await i.actions(
|
162
162
|
n,
|
163
|
-
this._descriptor.type ||
|
163
|
+
this._descriptor.type || pe()
|
164
164
|
).dispatch(t, s);
|
165
165
|
}
|
166
166
|
}
|
@@ -175,12 +175,12 @@ const Se = (e) => {
|
|
175
175
|
e.style.setProperty(i.replace("css-", ""), n);
|
176
176
|
});
|
177
177
|
};
|
178
|
-
var Oe = Object.defineProperty,
|
179
|
-
for (var n = i > 1 ? void 0 : i ?
|
178
|
+
var Oe = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, y = (e, t, s, i) => {
|
179
|
+
for (var n = i > 1 ? void 0 : i ? Pe(t, s) : t, o = e.length - 1, r; o >= 0; o--)
|
180
180
|
(r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
|
181
181
|
return i && n && Oe(t, s, n), n;
|
182
182
|
};
|
183
|
-
const
|
183
|
+
const Ae = (e) => {
|
184
184
|
class t extends e {
|
185
185
|
constructor() {
|
186
186
|
super(...arguments), this.entry = "", this._descriptorProvider = new j(
|
@@ -212,8 +212,8 @@ const Le = (e) => {
|
|
212
212
|
}
|
213
213
|
);
|
214
214
|
const a = "default";
|
215
|
-
this._unmountNode = n.mount(this.container), this._setDescriptor(
|
216
|
-
const l = n.getChildren(a).map((h) =>
|
215
|
+
this._unmountNode = n.mount(this.container), this._setDescriptor(pt(n, a)), this._setProperties(n.attributes.properties), this._setContext(n.attributes.context), this._setLayout(this.layout);
|
216
|
+
const l = n.getChildren(a).map((h) => pt(h));
|
217
217
|
this._childrenProvider.setValue(l);
|
218
218
|
const c = await this.container.getAsync("componentResolver");
|
219
219
|
if (((o = this.descriptor) == null ? void 0 : o.type) === "area")
|
@@ -287,7 +287,7 @@ const Le = (e) => {
|
|
287
287
|
* Copyright 2020 Google LLC
|
288
288
|
* SPDX-License-Identifier: BSD-3-Clause
|
289
289
|
*/
|
290
|
-
const
|
290
|
+
const Le = (e) => e.strings === void 0;
|
291
291
|
/**
|
292
292
|
* @license
|
293
293
|
* Copyright 2017 Google LLC
|
@@ -348,7 +348,7 @@ let Ft = class extends Nt {
|
|
348
348
|
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), s && (I(this, t), M(this));
|
349
349
|
}
|
350
350
|
setValue(t) {
|
351
|
-
if (
|
351
|
+
if (Le(this._$Ct))
|
352
352
|
this._$Ct._$AI(t, this);
|
353
353
|
else {
|
354
354
|
const s = [...this._$Ct._$AH];
|
@@ -370,12 +370,12 @@ let De = class {
|
|
370
370
|
};
|
371
371
|
const tt = /* @__PURE__ */ new WeakMap(), Ne = lt(class extends Ft {
|
372
372
|
render(e) {
|
373
|
-
return
|
373
|
+
return f;
|
374
374
|
}
|
375
375
|
update(e, [t]) {
|
376
376
|
var i;
|
377
377
|
const s = t !== this.G;
|
378
|
-
return s && this.G !== void 0 && this.ot(void 0), (s || this.rt !== this.lt) && (this.G = t, this.ct = (i = e.options) == null ? void 0 : i.host, this.ot(this.lt = e.element)),
|
378
|
+
return s && this.G !== void 0 && this.ot(void 0), (s || this.rt !== this.lt) && (this.G = t, this.ct = (i = e.options) == null ? void 0 : i.host, this.ot(this.lt = e.element)), f;
|
379
379
|
}
|
380
380
|
ot(e) {
|
381
381
|
if (typeof this.G == "function") {
|
@@ -437,7 +437,7 @@ class Fe extends Ft {
|
|
437
437
|
(t = this.h) == null || t.call(this), this.h = void 0;
|
438
438
|
}
|
439
439
|
render(t) {
|
440
|
-
return
|
440
|
+
return f;
|
441
441
|
}
|
442
442
|
getController() {
|
443
443
|
return He.get(this.l);
|
@@ -784,11 +784,11 @@ const J = typeof window < "u" ? window : {}, b = J.document || { head: {} }, Wt
|
|
784
784
|
}
|
785
785
|
const t = U(e.vtag, e.vtext);
|
786
786
|
return t.$attrs$ = e.vattrs, t.$children$ = e.vchildren, t.$key$ = e.vkey, t.$name$ = e.vname, t;
|
787
|
-
},
|
787
|
+
}, Pt = (e, t, s, i, n, o) => {
|
788
788
|
if (s !== i) {
|
789
789
|
let r = jt(e, t), a = t.toLowerCase();
|
790
790
|
if (t === "class") {
|
791
|
-
const l = e.classList, c =
|
791
|
+
const l = e.classList, c = At(s), d = At(i);
|
792
792
|
l.remove(...c.filter((h) => h && !d.includes(h))), l.add(...d.filter((h) => h && !c.includes(h)));
|
793
793
|
} else if (t === "style") {
|
794
794
|
for (const l in s)
|
@@ -816,12 +816,12 @@ const J = typeof window < "u" ? window : {}, b = J.document || { head: {} }, Wt
|
|
816
816
|
a !== (a = a.replace(/^xlink\:?/, "")) && (t = a, c = !0), i == null || i === !1 ? (i !== !1 || e.getAttribute(t) === "") && (c ? e.removeAttributeNS(Ct, t) : e.removeAttribute(t)) : (!r || o & 4 || n) && !l && (i = i === !0 ? "" : i, c ? e.setAttributeNS(Ct, t, i) : e.setAttribute(t, i));
|
817
817
|
}
|
818
818
|
}
|
819
|
-
}, ns = /\s/,
|
819
|
+
}, ns = /\s/, At = (e) => e ? e.split(ns) : [], Kt = (e, t, s, i) => {
|
820
820
|
const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Tt, r = t.$attrs$ || Tt;
|
821
821
|
for (i in o)
|
822
|
-
i in r ||
|
822
|
+
i in r || Pt(n, i, o[i], void 0, s, t.$flags$);
|
823
823
|
for (i in r)
|
824
|
-
|
824
|
+
Pt(n, i, o[i], r[i], s, t.$flags$);
|
825
825
|
}, B = (e, t, s, i) => {
|
826
826
|
let n = t.$children$[s], o = 0, r, a, l;
|
827
827
|
if (Bt || (ct = !0, n.$tag$ === "slot" && (S && i.classList.add(S + "-s"), n.$flags$ |= n.$children$ ? (
|
@@ -911,17 +911,17 @@ const J = typeof window < "u" ? window : {}, b = J.document || { head: {} }, Wt
|
|
911
911
|
for (; a < c; a++) {
|
912
912
|
if (t = l[a], t["s-sr"] && (s = t["s-cr"]) && s.parentNode)
|
913
913
|
for (i = s.parentNode.childNodes, n = t["s-sn"], r = i.length - 1; r >= 0; r--)
|
914
|
-
s = i[r], !s["s-cn"] && !s["s-nr"] && s["s-hn"] !== t["s-hn"] && (
|
914
|
+
s = i[r], !s["s-cn"] && !s["s-nr"] && s["s-hn"] !== t["s-hn"] && (Lt(s, n) ? (o = v.find((d) => d.$nodeToRelocate$ === s), F = !0, s["s-sn"] = s["s-sn"] || n, o ? o.$slotRefNode$ = t : v.push({
|
915
915
|
$slotRefNode$: t,
|
916
916
|
$nodeToRelocate$: s
|
917
917
|
}), s["s-sr"] && v.map((d) => {
|
918
|
-
|
918
|
+
Lt(d.$nodeToRelocate$, s["s-sn"]) && (o = v.find((h) => h.$nodeToRelocate$ === s), o && !d.$slotRefNode$ && (d.$slotRefNode$ = o.$slotRefNode$));
|
919
919
|
})) : v.some((d) => d.$nodeToRelocate$ === s) || v.push({
|
920
920
|
$nodeToRelocate$: s
|
921
921
|
}));
|
922
922
|
t.nodeType === 1 && Zt(t);
|
923
923
|
}
|
924
|
-
},
|
924
|
+
}, Lt = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", Vt = (e) => {
|
925
925
|
e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(Vt);
|
926
926
|
}, rs = (e, t) => {
|
927
927
|
const s = e.$hostElement$, i = e.$cmpMeta$, n = e.$vnode$ || U(null, null), o = es(t) ? t : O(null, null, t);
|
@@ -962,23 +962,23 @@ const J = typeof window < "u" ? window : {}, b = J.document || { head: {} }, Wt
|
|
962
962
|
}, te = (e, t) => (e.$flags$ |= 16, ds(e, e.$ancestorComponent$), Os(() => hs(e, t))), hs = (e, t) => {
|
963
963
|
const s = e.$hostElement$, i = _("scheduleUpdate", e.$cmpMeta$.$tagName$), n = s;
|
964
964
|
let o;
|
965
|
-
return t ? o =
|
965
|
+
return t ? o = P(n, "componentWillLoad") : o = P(n, "componentWillUpdate"), o = Et(o, () => P(n, "componentWillRender")), i(), Et(o, () => us(e, n, t));
|
966
966
|
}, us = async (e, t, s) => {
|
967
967
|
const i = e.$hostElement$, n = _("update", e.$cmpMeta$.$tagName$);
|
968
968
|
i["s-rc"], s && Ye(e);
|
969
969
|
const o = _("render", e.$cmpMeta$.$tagName$);
|
970
|
-
|
971
|
-
},
|
970
|
+
ps(e, t, i), o(), n(), fs(e);
|
971
|
+
}, ps = (e, t, s) => {
|
972
972
|
try {
|
973
973
|
kt = t, t = t.render && t.render(), e.$flags$ &= -17, e.$flags$ |= 2, (C.hasRenderFn || C.reflect) && (C.vdomRender || C.reflect) && (C.hydrateServerSide || rs(e, t));
|
974
974
|
} catch (a) {
|
975
975
|
N(a, e.$hostElement$);
|
976
976
|
}
|
977
977
|
return kt = null, null;
|
978
|
-
},
|
978
|
+
}, fs = (e) => {
|
979
979
|
const t = e.$cmpMeta$.$tagName$, s = e.$hostElement$, i = _("postUpdate", t), n = s;
|
980
|
-
e.$ancestorComponent$,
|
981
|
-
},
|
980
|
+
e.$ancestorComponent$, P(n, "componentDidRender"), e.$flags$ & 64 ? (P(n, "componentDidUpdate"), i()) : (e.$flags$ |= 64, P(n, "componentDidLoad"), i());
|
981
|
+
}, P = (e, t, s) => {
|
982
982
|
if (e && e[t])
|
983
983
|
try {
|
984
984
|
return e[t](s);
|
@@ -1120,7 +1120,7 @@ const J = typeof window < "u" ? window : {}, b = J.document || { head: {} }, Wt
|
|
1120
1120
|
e.length = 0;
|
1121
1121
|
}, nt = () => {
|
1122
1122
|
Rt(It), Rt(ie), (it = It.length > 0) && $.raf(nt);
|
1123
|
-
}, Ts = (e) => Be().then(e), Os = /* @__PURE__ */ Ss(ie, !0),
|
1123
|
+
}, Ts = (e) => Be().then(e), Os = /* @__PURE__ */ Ss(ie, !0), Ps = (e = {}) => {
|
1124
1124
|
const { content: t = "", title: s, attributes: i = [] } = e;
|
1125
1125
|
let n = "", o = [
|
1126
1126
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
@@ -1128,13 +1128,13 @@ const J = typeof window < "u" ? window : {}, b = J.document || { head: {} }, Wt
|
|
1128
1128
|
...i
|
1129
1129
|
];
|
1130
1130
|
return s && (n = `<title>${s}</title>`), `<svg ${o.map((a) => `${a.name}="${a.value}"`).join(" ")}>${n}${t}</svg>`;
|
1131
|
-
},
|
1132
|
-
function
|
1131
|
+
}, As = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim();
|
1132
|
+
function Ls(e) {
|
1133
1133
|
return `${e.getFullYear()}.${e.getMonth() + 1}`;
|
1134
1134
|
}
|
1135
1135
|
class Es {
|
1136
1136
|
constructor(t) {
|
1137
|
-
this.voca_component = t, this.voca_added =
|
1137
|
+
this.voca_component = t, this.voca_added = Ls(/* @__PURE__ */ new Date());
|
1138
1138
|
}
|
1139
1139
|
}
|
1140
1140
|
const js = "telia-vst{display:none}", Is = /* @__PURE__ */ ee(class extends Wt {
|
@@ -1199,8 +1199,8 @@ const Ns = ".telia-icon{display:inline-block}.telia-icon__container{display:bloc
|
|
1199
1199
|
...t,
|
1200
1200
|
{ name: "aria-hidden", value: "true" }
|
1201
1201
|
];
|
1202
|
-
const s =
|
1203
|
-
content:
|
1202
|
+
const s = Ps({
|
1203
|
+
content: As(e),
|
1204
1204
|
attributes: t,
|
1205
1205
|
title: this.allyTitle
|
1206
1206
|
});
|
@@ -1236,16 +1236,16 @@ var Ms = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, oe = (e, t
|
|
1236
1236
|
(r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
|
1237
1237
|
return i && n && Ms(t, s, n), n;
|
1238
1238
|
};
|
1239
|
-
let q = class extends
|
1239
|
+
let q = class extends A {
|
1240
1240
|
_renderTimestamp(e, t) {
|
1241
1241
|
if (!e && !t)
|
1242
|
-
return
|
1242
|
+
return f;
|
1243
1243
|
const s = (n) => new Date(n).toLocaleTimeString([], {
|
1244
1244
|
hour: "2-digit",
|
1245
1245
|
minute: "2-digit"
|
1246
1246
|
});
|
1247
1247
|
let i = "";
|
1248
|
-
return e ? t ? i = `${e}: ${s(t)}` : i = e : t && (i = s(t)),
|
1248
|
+
return e ? t ? i = `${e}: ${s(t)}` : i = e : t && (i = s(t)), p`<p class="conversation-timestamp">${i}</p>`;
|
1249
1249
|
}
|
1250
1250
|
render() {
|
1251
1251
|
var e, t;
|
@@ -1253,19 +1253,19 @@ let q = class extends L {
|
|
1253
1253
|
case V.System:
|
1254
1254
|
return "";
|
1255
1255
|
case V.Agent:
|
1256
|
-
return
|
1256
|
+
return p`<div
|
1257
1257
|
class=${Ht({
|
1258
1258
|
"conversation-agent-message": !0,
|
1259
1259
|
"has-avatar": !!((e = this.message.sender) != null && e.avatar)
|
1260
1260
|
})}
|
1261
1261
|
>
|
1262
|
-
${typeof ((t = this.message.sender) == null ? void 0 : t.avatar) == "string" ?
|
1262
|
+
${typeof ((t = this.message.sender) == null ? void 0 : t.avatar) == "string" ? p`<div class="avatar">
|
1263
1263
|
<img src=${this.message.sender.avatar} />
|
1264
|
-
</div>` :
|
1264
|
+
</div>` : f}
|
1265
1265
|
|
1266
1266
|
<div class="content-bundle">
|
1267
1267
|
${this.message.content.map(
|
1268
|
-
(s) =>
|
1268
|
+
(s) => p`
|
1269
1269
|
<div class="message-container">
|
1270
1270
|
<div class="message-content">
|
1271
1271
|
<conversation-component-message-list
|
@@ -1282,10 +1282,10 @@ let q = class extends L {
|
|
1282
1282
|
)}
|
1283
1283
|
</div>`;
|
1284
1284
|
case V.User:
|
1285
|
-
return
|
1285
|
+
return p`<div class="conversation-user-message">
|
1286
1286
|
<div class="content-bundle">
|
1287
1287
|
${this.message.content.map(
|
1288
|
-
(s) =>
|
1288
|
+
(s) => p`
|
1289
1289
|
<div class="message-container">
|
1290
1290
|
<div class="message-content">
|
1291
1291
|
<conversation-component-message-list
|
@@ -1303,7 +1303,7 @@ let q = class extends L {
|
|
1303
1303
|
)}
|
1304
1304
|
</div>`;
|
1305
1305
|
default:
|
1306
|
-
return
|
1306
|
+
return f;
|
1307
1307
|
}
|
1308
1308
|
}
|
1309
1309
|
};
|
@@ -1394,14 +1394,14 @@ oe([
|
|
1394
1394
|
x()
|
1395
1395
|
], q.prototype, "message", 2);
|
1396
1396
|
q = oe([
|
1397
|
-
|
1397
|
+
L("conversation-component-message")
|
1398
1398
|
], q);
|
1399
1399
|
var Us = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, re = (e, t, s, i) => {
|
1400
1400
|
for (var n = i > 1 ? void 0 : i ? Bs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
|
1401
1401
|
(r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
|
1402
1402
|
return i && n && Us(t, s, n), n;
|
1403
1403
|
};
|
1404
|
-
let G = class extends
|
1404
|
+
let G = class extends A {
|
1405
1405
|
constructor() {
|
1406
1406
|
super(...arguments), this.items = [];
|
1407
1407
|
}
|
@@ -1414,24 +1414,24 @@ let G = class extends L {
|
|
1414
1414
|
const i = new s();
|
1415
1415
|
return i.message = t, i;
|
1416
1416
|
}
|
1417
|
-
return
|
1417
|
+
return f;
|
1418
1418
|
}
|
1419
1419
|
render() {
|
1420
|
-
return
|
1420
|
+
return p` <div class="message-list">
|
1421
1421
|
${this.items.map(
|
1422
|
-
([e, t]) =>
|
1423
|
-
${e === "html" ?
|
1422
|
+
([e, t]) => p`
|
1423
|
+
${e === "html" ? p`
|
1424
1424
|
<message-type-html .message=${t}> </message-type-html>
|
1425
|
-
` :
|
1426
|
-
${e === "link-list" ?
|
1425
|
+
` : f}
|
1426
|
+
${e === "link-list" ? p`
|
1427
1427
|
<message-type-link-list .message=${t}>
|
1428
1428
|
</message-type-link-list>
|
1429
|
-
` :
|
1430
|
-
${e === "separator" ?
|
1429
|
+
` : f}
|
1430
|
+
${e === "separator" ? p`
|
1431
1431
|
<message-type-separator .message=${t}>
|
1432
1432
|
</message-type-separator>
|
1433
|
-
` :
|
1434
|
-
${this._isCustomComponent(e) ? this._createCustomComponent(e, t) :
|
1433
|
+
` : f}
|
1434
|
+
${this._isCustomComponent(e) ? this._createCustomComponent(e, t) : f}
|
1435
1435
|
`
|
1436
1436
|
)}
|
1437
1437
|
</div>`;
|
@@ -1455,7 +1455,7 @@ re([
|
|
1455
1455
|
x()
|
1456
1456
|
], G.prototype, "items", 2);
|
1457
1457
|
G = re([
|
1458
|
-
|
1458
|
+
L("conversation-component-message-list")
|
1459
1459
|
], G);
|
1460
1460
|
/**
|
1461
1461
|
* @license
|
@@ -1464,13 +1464,13 @@ G = re([
|
|
1464
1464
|
*/
|
1465
1465
|
class rt extends Nt {
|
1466
1466
|
constructor(t) {
|
1467
|
-
if (super(t), this.et =
|
1467
|
+
if (super(t), this.et = f, t.type !== at.CHILD)
|
1468
1468
|
throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
1469
1469
|
}
|
1470
1470
|
render(t) {
|
1471
|
-
if (t ===
|
1471
|
+
if (t === f || t == null)
|
1472
1472
|
return this.vt = void 0, this.et = t;
|
1473
|
-
if (t ===
|
1473
|
+
if (t === fe)
|
1474
1474
|
return t;
|
1475
1475
|
if (typeof t != "string")
|
1476
1476
|
throw Error(this.constructor.directiveName + "() called with a non-string value");
|
@@ -1488,9 +1488,9 @@ var qs = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, ae = (e, t
|
|
1488
1488
|
(r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
|
1489
1489
|
return i && n && qs(t, s, n), n;
|
1490
1490
|
};
|
1491
|
-
let K = class extends
|
1491
|
+
let K = class extends A {
|
1492
1492
|
render() {
|
1493
|
-
return
|
1493
|
+
return p`<div class="message-type-html">
|
1494
1494
|
${Ws(this.message.body)}
|
1495
1495
|
</div>`;
|
1496
1496
|
}
|
@@ -1514,14 +1514,14 @@ ae([
|
|
1514
1514
|
x({ attribute: !1 })
|
1515
1515
|
], K.prototype, "message", 2);
|
1516
1516
|
K = ae([
|
1517
|
-
|
1517
|
+
L("message-type-html")
|
1518
1518
|
], K);
|
1519
1519
|
var Ks = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, le = (e, t, s, i) => {
|
1520
1520
|
for (var n = i > 1 ? void 0 : i ? Qs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
|
1521
1521
|
(r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
|
1522
1522
|
return i && n && Ks(t, s, n), n;
|
1523
1523
|
};
|
1524
|
-
let Q = class extends
|
1524
|
+
let Q = class extends A {
|
1525
1525
|
_onItemClick(e) {
|
1526
1526
|
const t = new CustomEvent("action", {
|
1527
1527
|
bubbles: !0,
|
@@ -1534,12 +1534,12 @@ let Q = class extends L {
|
|
1534
1534
|
this.dispatchEvent(t);
|
1535
1535
|
}
|
1536
1536
|
render() {
|
1537
|
-
return
|
1537
|
+
return p`
|
1538
1538
|
<div class="message-type-link-list">
|
1539
|
-
${this.message.header ?
|
1539
|
+
${this.message.header ? p`<h1>${this.message.header}</h1>` : f}
|
1540
1540
|
<ul>
|
1541
1541
|
${this.message.actions.map(
|
1542
|
-
(e) =>
|
1542
|
+
(e) => p`
|
1543
1543
|
<li>
|
1544
1544
|
<button @click=${() => this._onItemClick(e)}>
|
1545
1545
|
${e.label}
|
@@ -1598,16 +1598,16 @@ le([
|
|
1598
1598
|
x({ attribute: !1 })
|
1599
1599
|
], Q.prototype, "message", 2);
|
1600
1600
|
Q = le([
|
1601
|
-
|
1601
|
+
L("message-type-link-list")
|
1602
1602
|
], Q);
|
1603
1603
|
var Xs = Object.defineProperty, Ys = Object.getOwnPropertyDescriptor, ce = (e, t, s, i) => {
|
1604
1604
|
for (var n = i > 1 ? void 0 : i ? Ys(t, s) : t, o = e.length - 1, r; o >= 0; o--)
|
1605
1605
|
(r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
|
1606
1606
|
return i && n && Xs(t, s, n), n;
|
1607
1607
|
};
|
1608
|
-
let X = class extends
|
1608
|
+
let X = class extends A {
|
1609
1609
|
render() {
|
1610
|
-
return
|
1610
|
+
return p`<div class="message-type-separator"></div>`;
|
1611
1611
|
}
|
1612
1612
|
};
|
1613
1613
|
X.styles = [
|
@@ -1628,7 +1628,7 @@ ce([
|
|
1628
1628
|
x({ attribute: !1 })
|
1629
1629
|
], X.prototype, "message", 2);
|
1630
1630
|
X = ce([
|
1631
|
-
|
1631
|
+
L("message-type-separator")
|
1632
1632
|
], X);
|
1633
1633
|
const Js = (e) => {
|
1634
1634
|
e.scrollTo ? e.scrollTo({ top: e.scrollHeight, behavior: "smooth" }) : e.scrollTop = e.scrollHeight;
|
@@ -1638,7 +1638,7 @@ var Zs = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, de = (e, t
|
|
1638
1638
|
(r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
|
1639
1639
|
return i && n && Zs(t, s, n), n;
|
1640
1640
|
};
|
1641
|
-
const he =
|
1641
|
+
const he = Ae(A);
|
1642
1642
|
let D = class extends he {
|
1643
1643
|
constructor() {
|
1644
1644
|
super(...arguments), this.message = "", this.conversationContentRef = Re(), this.chatScrollHeight = 0;
|
@@ -1660,7 +1660,7 @@ let D = class extends he {
|
|
1660
1660
|
}, 1e3);
|
1661
1661
|
}
|
1662
1662
|
render() {
|
1663
|
-
return
|
1663
|
+
return p` <div
|
1664
1664
|
@action=${this._actionHandler}
|
1665
1665
|
class=${Ht({
|
1666
1666
|
conversation: !0,
|
@@ -1670,7 +1670,7 @@ let D = class extends he {
|
|
1670
1670
|
<div class="conversation-content" ${Ne(this.conversationContentRef)}>
|
1671
1671
|
<div class="conversation-content-inner">
|
1672
1672
|
${(this.properties.messages || []).map(
|
1673
|
-
(e) =>
|
1673
|
+
(e) => p`<div class="conversation-entry" tabindex="-1">
|
1674
1674
|
<conversation-component-message
|
1675
1675
|
.message=${e}
|
1676
1676
|
${wt({
|
@@ -1684,7 +1684,7 @@ let D = class extends he {
|
|
1684
1684
|
</conversation-component-message>
|
1685
1685
|
</div>`
|
1686
1686
|
)}
|
1687
|
-
${this.properties.loading ?
|
1687
|
+
${this.properties.loading ? p`<div
|
1688
1688
|
class="loader"
|
1689
1689
|
${wt({
|
1690
1690
|
in: bt,
|
@@ -1695,12 +1695,12 @@ let D = class extends he {
|
|
1695
1695
|
<div></div>
|
1696
1696
|
<div></div>
|
1697
1697
|
<div></div>
|
1698
|
-
</div>` :
|
1698
|
+
</div>` : f}
|
1699
1699
|
</div>
|
1700
1700
|
</div>
|
1701
1701
|
<form class="conversation-bottom" @submit=${this._onSendMessage}>
|
1702
1702
|
<input
|
1703
|
-
placeholder
|
1703
|
+
placeholder=${this.properties.inputPlaceholder || "Type your message here..."}
|
1704
1704
|
.value=${this.message}
|
1705
1705
|
@input=${this._inputHandler}
|
1706
1706
|
/>
|
@@ -1856,7 +1856,7 @@ de([
|
|
1856
1856
|
k()
|
1857
1857
|
], D.prototype, "message", 2);
|
1858
1858
|
D = de([
|
1859
|
-
|
1859
|
+
L("ace-conversation")
|
1860
1860
|
], D);
|
1861
1861
|
const ci = D;
|
1862
1862
|
export {
|
@@ -153,4 +153,4 @@ ${e}`:t.length?`${t} ${e}`:e}dispose(){this.subscriptions.forEach(t=>{t()})}}cla
|
|
153
153
|
align-items: center;
|
154
154
|
fill: var(--trigger-text-color, var(--text-on-primary-background));
|
155
155
|
}
|
156
|
-
`];at([St({attribute:!1})],Q.prototype,"symbol",2);at([St({attribute:!1})],Q.prototype,"container",2);at([Ot()],Q.prototype,"active",2);at([Ot()],Q.prototype,"loaded",2);at([Ot()],Q.prototype,"icon",2);const mi=(n,t,e,s,i)=>n.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),bn(n,t,s||(()=>{}),t,i))),vi=(n,t)=>n.reduce((e,s,i)=>{var o,a;const r={...s,content:[{...s.content,key:s.key}]};if(e.length>0&&s.type!==F.System){const c=e[e.length-1];if((!t&&t!==0||Math.abs(c.timestamp-s.timestamp)<t)&&((o=c.sender)==null?void 0:o.name)===((a=s.sender)==null?void 0:a.name)&&c.type===s.type)return c.timestamp=s.timestamp,c.content.push({...s.content,key:s.key}),e}return e.push(r),e},[]),fi=async n=>mi(n,"conversation",Promise.resolve().then(()=>require("./conversation-
|
156
|
+
`];at([St({attribute:!1})],Q.prototype,"symbol",2);at([St({attribute:!1})],Q.prototype,"container",2);at([Ot()],Q.prototype,"active",2);at([Ot()],Q.prototype,"loaded",2);at([Ot()],Q.prototype,"icon",2);const mi=(n,t,e,s,i)=>n.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),bn(n,t,s||(()=>{}),t,i))),vi=(n,t)=>n.reduce((e,s,i)=>{var o,a;const r={...s,content:[{...s.content,key:s.key}]};if(e.length>0&&s.type!==F.System){const c=e[e.length-1];if((!t&&t!==0||Math.abs(c.timestamp-s.timestamp)<t)&&((o=c.sender)==null?void 0:o.name)===((a=s.sender)==null?void 0:a.name)&&c.type===s.type)return c.timestamp=s.timestamp,c.content.push({...s.content,key:s.key}),e}return e.push(r),e},[]),fi=async n=>mi(n,"conversation",Promise.resolve().then(()=>require("./conversation-5265abc7.js")),async t=>{const e=await Ct.getInstance(n),{rehydrate:s=!1}=t.properties(),i="component",r=await e.createController(i,{rehydrate:s}),o=e.registerController(r,t),a=3*60*1e3,c=l=>{const{providers:p=[]}=l;if(p){const u=Array.isArray(p)?p:[p];return r.setProviders(u),u}};c(t.properties(c)),r.setComponentMountedState(!0);const h=l=>{const{loading:p,typingActors:u,messages:g}=l;t.writeProperties({loading:p,typingActors:u,messages:vi(g,a)})};h(r.getMessageStream()),o&&(t.writeProperties({conversationControllerId:r.id}),t.actions.create("user-submit",(l,p)=>{if(p){const{preventDefault:u,validationPromise:g}=p;if(u){g&&g().then(A=>{A&&r.user.print(A)});return}}r.user.print(l.text)}),t.actions.create("user-typing",(l,p)=>{}),t.actions.create("form",(l,p)=>{}),t.actions.create("action",(l,p)=>{}),t.actions.create("overlay-mounted",(l,p)=>{}),t.actions.create("show-overlay",(l,p)=>{t.writeProperties({overlay:{conversation:!1,secondary:!1}})}),t.actions.create("hide-overlay",(l,p)=>{t.writeProperties({overlay:null})}),t.actions.create("show-overlay-conversation",(l,p)=>{t.writeProperties({overlay:{conversation:!0,secondary:!1}})}),t.actions.create("hide-overlay-conversation",(l,p)=>{t.writeProperties({overlay:{conversation:!1,secondary:!1}})}));const d=r.events.subscribe("conversation:updated",(l,p)=>{h(p)});return()=>{r.setComponentMountedState(!1),d(),r.active||h({messages:[],typingActors:[],loading:!1})}},{reuseController:!0});var As=(n=>(n.LinkList="link-list",n.Separator="separator",n.ButtonList="button-list",n.ItemList="item-list",n.Text="text",n.HTML="html",n.VideoRequest="video-request",n))(As||{});const yi=async(n,t,e)=>{await e};exports.ConversationComponent=fi;exports.ConversationController=ds;exports.ConversationEndedBehavior=xt;exports.ConversationEntry=ls;exports.ConversationMessageListItemType=As;exports.ConversationMessageType=F;exports.ConversationPlatform=Ct;exports.Et=$n;exports.P=wt;exports.T=m;exports.e=bs;exports.e$1=_s;exports.ht=H;exports.i=us;exports.i$1=ws;exports.n=St;exports.pt=ne;exports.r=Ot;exports.registerCustomMessageComponent=yi;exports.s=V;exports.t=$s;exports.w=I;exports.x=G;
|
@@ -3815,7 +3815,7 @@ const ui = (n, t, e, s, i) => n.getAsync("componentResolver").then((r) => (r.reg
|
|
3815
3815
|
}, []), Mi = async (n) => ui(
|
3816
3816
|
n,
|
3817
3817
|
"conversation",
|
3818
|
-
import("./conversation-
|
3818
|
+
import("./conversation-8c2255c2.mjs"),
|
3819
3819
|
async (t) => {
|
3820
3820
|
const e = await re.getInstance(n), { rehydrate: s = !1 } = t.properties(), i = "component", r = await e.createController(i, { rehydrate: s }), o = e.registerController(
|
3821
3821
|
r,
|
package/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-5cf6726d.js");exports.ConversationComponent=e.ConversationComponent;exports.ConversationController=e.ConversationController;exports.ConversationEndedBehavior=e.ConversationEndedBehavior;exports.ConversationEntry=e.ConversationEntry;exports.ConversationMessageListItemType=e.ConversationMessageListItemType;exports.ConversationMessageType=e.ConversationMessageType;exports.ConversationPlatform=e.ConversationPlatform;exports.registerCustomMessageComponent=e.registerCustomMessageComponent;
|
package/index.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@telia-ace/widget-conversation-flamingo",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.12-rc.1",
|
4
4
|
"publishConfig": {
|
5
5
|
"registry": "https://registry.npmjs.org"
|
6
6
|
},
|
@@ -10,7 +10,7 @@
|
|
10
10
|
"@lit-labs/motion": "^1.0.4",
|
11
11
|
"@teliads/icons": "^8.4.0",
|
12
12
|
"@teliads/components": "^22.1.1",
|
13
|
-
"@telia-ace/widget-runtime-flamingo": "1.1.
|
13
|
+
"@telia-ace/widget-runtime-flamingo": "1.1.12-rc.1",
|
14
14
|
"@webprovisions/platform": "^1.1.3",
|
15
15
|
"@telia-ace/widget-core": "^1.0.27",
|
16
16
|
"@telia-ace/widget-services": "^1.0.27"
|