@telia-ace/widget-conversation-flamingo 1.0.37 → 1.0.43
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/agent.d.ts +3 -3
- package/{conversation-069e0c28.mjs → conversation-025ea610.mjs} +2 -2
- package/{conversation-da609cdf.js → conversation-9a2e4011.js} +2 -2
- package/conversation-platform.d.ts +1 -1
- package/{index-8e55fd9b.js → index-2a545cb2.js} +9 -9
- package/{index-5ce43fbe.mjs → index-fb306d2b.mjs} +54 -57
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +6 -3
- package/types.d.ts +2 -2
package/agent.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ConversationEntry } from './conversation-controller';
|
|
2
2
|
import { ConversationProvider } from './conversation-provider';
|
|
3
|
-
import { ConversationMessageSettings, ConverstationMessageItem
|
|
3
|
+
import { ConversationMessageSettings, ConverstationMessageItem } from './types';
|
|
4
4
|
export type AgentSettings = {
|
|
5
5
|
id?: string;
|
|
6
6
|
name?: string;
|
|
7
|
-
avatar?: string |
|
|
7
|
+
avatar?: string | symbol;
|
|
8
8
|
};
|
|
9
9
|
export declare class Agent {
|
|
10
10
|
private provider;
|
|
11
11
|
id: string;
|
|
12
12
|
name?: string;
|
|
13
|
-
avatar?: string |
|
|
13
|
+
avatar?: string | symbol;
|
|
14
14
|
constructor(provider: ConversationProvider, settings: AgentSettings);
|
|
15
15
|
print: (settings: string | ConversationMessageSettings | ConverstationMessageItem<any> | ConverstationMessageItem<any>[], options?: {
|
|
16
16
|
key?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as Dt, P as he, h as ue, i as w, n as x, t as k, E as ft, m as fe, a as It, b as at, e as lt, A as $, s as P, x as f, C as V, o as Nt, T as pe } from "./index-
|
|
1
|
+
import { p as Dt, P as he, h as ue, i as w, n as x, t as k, E as ft, m as fe, a as It, b as at, e as lt, A as $, s as P, x as f, C as V, o as Nt, T as pe } from "./index-fb306d2b.mjs";
|
|
2
2
|
import { g as $e, s as ge } from "./send-1e9780e5.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
@@ -1412,7 +1412,7 @@ q.styles = w`
|
|
|
1412
1412
|
}
|
|
1413
1413
|
`;
|
|
1414
1414
|
ne([
|
|
1415
|
-
x(
|
|
1415
|
+
x()
|
|
1416
1416
|
], q.prototype, "message", 2);
|
|
1417
1417
|
q = ne([
|
|
1418
1418
|
L("conversation-component-message")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-2a545cb2.js"),nt=require("./send-df47dcea.js");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
.content-bundle {
|
|
170
170
|
grid-area: content;
|
|
171
171
|
}
|
|
172
|
-
`;Gt([l.n(
|
|
172
|
+
`;Gt([l.n()],H.prototype,"message",2);H=Gt([S("conversation-component-message")],H);var As=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,Kt=(e,t,s,i)=>{for(var n=i>1?void 0:i?Ts(t,s):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&As(t,s,n),n};let z=class extends l.s{constructor(){super(...arguments),this.items=[]}_isCustomComponent(e){return!["html","link-list"].includes(e)}_createCustomComponent(e,t){const s=customElements.get(e);if(s){const i=new s;return i.message=t,i}return l.A}render(){return l.x` <div class="message-list">
|
|
173
173
|
${this.items.map(([e,t])=>l.x`
|
|
174
174
|
${e==="html"?l.x`
|
|
175
175
|
<message-type-html .message=${t}> </message-type-html>
|
|
@@ -46,6 +46,6 @@ export declare class ConversationPlatform {
|
|
|
46
46
|
private invokeHandler;
|
|
47
47
|
getComponentRoute(): Promise<any>;
|
|
48
48
|
dispose(): void;
|
|
49
|
-
static handleContactMethodClick(event: any, container: Container, contactMethod: any, _callback?:
|
|
49
|
+
static handleContactMethodClick(event: any, container: Container, contactMethod: any, _callback?: () => any): Promise<void>;
|
|
50
50
|
static handleContactMethodSubmit(container: Container, contactMethod: any): Promise<any>;
|
|
51
51
|
}
|
|
@@ -50,14 +50,14 @@ ${e}`:t.length?`${t} ${e}`:e}dispose(){this.subscriptions.forEach(t=>{t()})}}cla
|
|
|
50
50
|
* @license
|
|
51
51
|
* Copyright 2018 Google LLC
|
|
52
52
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
|
-
*/const Ps=Es(class extends Cs{constructor(i){var t;if(super(i),i.type!==As.ATTRIBUTE||i.name!=="class"||((t=i.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var e,s;if(this.it===void 0){this.it=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!(!((e=this.nt)===null||e===void 0)&&e.has(r))&&this.it.add(r);return this.render(t)}const n=i.element.classList;this.it.forEach(r=>{r in t||(n.remove(r),this.it.delete(r))});for(const r in t){const o=!!t[r];o===this.it.has(r)||!((s=this.nt)===null||s===void 0)&&s.has(r)||(o?(n.add(r),this.it.add(r)):(n.remove(r),this.it.delete(r)))}return I}}),y=(i,t,e)=>{i&&e.style.setProperty(t,i)},xs=(i,t)=>{var e,s,n,r,o,a,c,h,l,d,u;y((e=i.colors)==null?void 0:e.primary,"--primary-color",t),y((s=i.colors)==null?void 0:s.secondary,"--secondary-color",t),y((n=i.colors)==null?void 0:n.text,"--text-color",t),y((r=i.colors)==null?void 0:r.link,"--link-color",t),y((o=i.colors)==null?void 0:o.gray,"--gray-color",t),y((a=i.colors)==null?void 0:a.grayDark,"--gray-dark-color",t),y((c=i.spacing)==null?void 0:c.xs,"--spacing-xs",t),y((h=i.spacing)==null?void 0:h.sm,"--spacing-sm",t),y((l=i.spacing)==null?void 0:l.md,"--spacing-md",t),y((d=i.spacing)==null?void 0:d.lg,"--spacing-lg",t),y((u=i.spacing)==null?void 0:u.xl,"--spacing-xl",t),y(i.boxShadow,"--box-shadow",t),y(i.borderRadius,"--border-radius",t),y(i.borderRadiusSm,"--border-radius-sm",t),y(i.fontFamily,"--font-family",t)};var un=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,ot=(i,t,e,s)=>{for(var n=s>1?void 0:s?pn(t,e):t,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=(s?o(t,e,n):o(n))||n);return s&&n&&un(t,e,n),n};class K extends B{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var s;const t=((s=this.container)==null?void 0:s.get("$settings"))??{},e=t==null?void 0:t.components[t==null?void 0:t.entry];e&&xs(e.context,this)}async _renderSymbol(t){const e=async
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
*/const Ps=Es(class extends Cs{constructor(i){var t;if(super(i),i.type!==As.ATTRIBUTE||i.name!=="class"||((t=i.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var e,s;if(this.it===void 0){this.it=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!(!((e=this.nt)===null||e===void 0)&&e.has(r))&&this.it.add(r);return this.render(t)}const n=i.element.classList;this.it.forEach(r=>{r in t||(n.remove(r),this.it.delete(r))});for(const r in t){const o=!!t[r];o===this.it.has(r)||!((s=this.nt)===null||s===void 0)&&s.has(r)||(o?(n.add(r),this.it.add(r)):(n.remove(r),this.it.delete(r)))}return I}}),y=(i,t,e)=>{i&&e.style.setProperty(t,i)},xs=(i,t)=>{var e,s,n,r,o,a,c,h,l,d,u;y((e=i.colors)==null?void 0:e.primary,"--primary-color",t),y((s=i.colors)==null?void 0:s.secondary,"--secondary-color",t),y((n=i.colors)==null?void 0:n.text,"--text-color",t),y((r=i.colors)==null?void 0:r.link,"--link-color",t),y((o=i.colors)==null?void 0:o.gray,"--gray-color",t),y((a=i.colors)==null?void 0:a.grayDark,"--gray-dark-color",t),y((c=i.spacing)==null?void 0:c.xs,"--spacing-xs",t),y((h=i.spacing)==null?void 0:h.sm,"--spacing-sm",t),y((l=i.spacing)==null?void 0:l.md,"--spacing-md",t),y((d=i.spacing)==null?void 0:d.lg,"--spacing-lg",t),y((u=i.spacing)==null?void 0:u.xl,"--spacing-xl",t),y(i.boxShadow,"--box-shadow",t),y(i.borderRadius,"--border-radius",t),y(i.borderRadiusSm,"--border-radius-sm",t),y(i.fontFamily,"--font-family",t)};var un=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,ot=(i,t,e,s)=>{for(var n=s>1?void 0:s?pn(t,e):t,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=(s?o(t,e,n):o(n))||n);return s&&n&&un(t,e,n),n};class K extends B{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var s;const t=((s=this.container)==null?void 0:s.get("$settings"))??{},e=t==null?void 0:t.components[t==null?void 0:t.entry];e&&xs(e.context,this)}async _renderSymbol(t){const e=async s=>await Promise.resolve().then(()=>require("./index-17fa2121.js")).then(r=>r[s]);if(t){const{type:s,content:n}=t;switch(s){case"Telia":{const r=await e(n);return r?X`<telia-icon
|
|
54
|
+
class="trigger-icon"
|
|
55
|
+
svg=${r.svg}
|
|
56
|
+
size="lg"
|
|
57
|
+
></telia-icon>`:g}case"FontAwesome":return X`<i class="trigger-fa-icon fa fa-${n}"></i>`;case"Uri":return X`<i
|
|
58
|
+
class="trigger-custom-icon"
|
|
59
|
+
style="background: url(${n}) no-repeat center center;background-size: contain;"
|
|
60
|
+
></i>`;default:return g}}}render(){return X`<button
|
|
61
61
|
class=${Ps({trigger:!0,active:this.active,rendered:this.loaded})}
|
|
62
62
|
@click=${this._toggleActive}
|
|
63
63
|
>
|
|
@@ -157,4 +157,4 @@ ${e}`:t.length?`${t} ${e}`:e}dispose(){this.subscriptions.forEach(t=>{t()})}}cla
|
|
|
157
157
|
align-items: center;
|
|
158
158
|
fill: var(--trigger-text-color, #fff);
|
|
159
159
|
}
|
|
160
|
-
`];ot([xt({attribute:!1})],K.prototype,"symbol",2);ot([xt({attribute:!1})],K.prototype,"container",2);ot([kt()],K.prototype,"active",2);ot([kt()],K.prototype,"loaded",2);ot([kt()],K.prototype,"icon",2);const gn=(i,t,e,s,n)=>i.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),Ei(i,t,s||(()=>{}),t,n)))
|
|
160
|
+
`];ot([xt({attribute:!1})],K.prototype,"symbol",2);ot([xt({attribute:!1})],K.prototype,"container",2);ot([kt()],K.prototype,"active",2);ot([kt()],K.prototype,"loaded",2);ot([kt()],K.prototype,"icon",2);const gn=(i,t,e,s,n)=>i.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),Ei(i,t,s||(()=>{}),t,n))),mn=(i,t)=>i.reduce((e,s,n)=>{var o,a;const r={...s,content:[{...s.content,key:s.key}]};if(e.length>0&&s.type!==Q.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},[]),vn=async i=>gn(i,"conversation",Promise.resolve().then(()=>require("./conversation-9a2e4011.js")),async t=>{const e=await Ct.getInstance(i),{rehydrate:s=!1}=t.properties(),n="component",r=await e.createController(n,{rehydrate:s}),o=e.registerController(r,t),a=3*60*1e3,c=d=>{const{providers:u=[]}=d;if(u){const p=Array.isArray(u)?u:[u];return r.setProviders(p),p}};c(t.properties(c)),r.setComponentMountedState(!0);const h=d=>{const{loading:u,typingActors:p,messages:v}=d;t.writeProperties({loading:u,typingActors:p,messages:mn(v,a)})};h(r.getMessageStream()),o&&(t.writeProperties({conversationControllerId:r.id}),t.actions.create("user-submit",(d,u)=>{if(u){const{preventDefault:p,validationPromise:v}=u;if(p){v&&v().then(f=>{f&&r.user.print(f)});return}}r.user.print(d.text)}),t.actions.create("user-typing",(d,u)=>{}),t.actions.create("form",(d,u)=>{}),t.actions.create("action",(d,u)=>{}),t.actions.create("overlay-mounted",(d,u)=>{}),t.actions.create("show-overlay",(d,u)=>{t.writeProperties({overlay:{conversation:!1,secondary:!1}})}),t.actions.create("hide-overlay",(d,u)=>{t.writeProperties({overlay:null})}),t.actions.create("show-overlay-conversation",(d,u)=>{t.writeProperties({overlay:{conversation:!0,secondary:!1}})}),t.actions.create("hide-overlay-conversation",(d,u)=>{t.writeProperties({overlay:{conversation:!1,secondary:!1}})}));const l=r.events.subscribe("conversation:updated",(d,u)=>{h(u)});return()=>{r.setComponentMountedState(!1),l(),r.active||h({messages:[],typingActors:[],loading:!1})}},{reuseController:!0});var ks=(i=>(i.LinkList="link-list",i.Separator="separator",i.ButtonList="button-list",i.ItemList="item-list",i.Text="text",i.HTML="html",i.VideoRequest="video-request",i))(ks||{});const fn=async(i,t,e)=>{await e};exports.A=g;exports.ConversationComponent=vn;exports.ConversationController=ms;exports.ConversationEndedBehavior=Et;exports.ConversationEntry=gs;exports.ConversationMessageListItemType=ks;exports.ConversationMessageType=Q;exports.ConversationPlatform=Ct;exports.Et=Ai;exports.P=$t;exports.T=I;exports.e=Es;exports.ht=F;exports.i=fs;exports.i$1=Cs;exports.mapBranding=xs;exports.n=xt;exports.o=Ps;exports.pt=ae;exports.registerCustomMessageComponent=fn;exports.s=B;exports.t=kt;exports.t$1=As;exports.x=X;
|
|
@@ -192,11 +192,11 @@ const kt = (i, t, e, ...s) => {
|
|
|
192
192
|
warn: (e, ...s) => kt(t, "warning", e, ...s),
|
|
193
193
|
error: (e, ...s) => kt(t, "error", e, ...s)
|
|
194
194
|
};
|
|
195
|
-
},
|
|
195
|
+
}, g = J(), Zt = (() => {
|
|
196
196
|
let i = 0;
|
|
197
197
|
return () => ++i;
|
|
198
198
|
})(), Gt = (i, t, e) => {
|
|
199
|
-
const s =
|
|
199
|
+
const s = g(i).touchQueue.get(t);
|
|
200
200
|
s && s.forEach((n) => {
|
|
201
201
|
n(e, i);
|
|
202
202
|
});
|
|
@@ -232,21 +232,21 @@ let Es = class {
|
|
|
232
232
|
* @param parent Parent container this should be a child of.
|
|
233
233
|
*/
|
|
234
234
|
constructor(t, e, s) {
|
|
235
|
-
this.owner = t, this.name = e, this.parent = s,
|
|
235
|
+
this.owner = t, this.name = e, this.parent = s, g(this).resolvers = /* @__PURE__ */ new Map(), g(this).touchQueue = /* @__PURE__ */ new Map(), g(this).children = [];
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
238
238
|
* Deletes an existing resolver by its unique id.
|
|
239
239
|
* @param id Resolver id.
|
|
240
240
|
*/
|
|
241
241
|
delete(t) {
|
|
242
|
-
const e =
|
|
243
|
-
return s ? (
|
|
242
|
+
const e = g(this).resolvers, s = Array.from(e.values()).find((n) => n.id === t);
|
|
243
|
+
return s ? (g(this).touchQueue.delete(s.key), Promise.resolve(e.delete(s.key))) : this.parent ? this.parent.delete(t) : Promise.resolve(!1);
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
246
246
|
* Clears the `Container` and any child containers by deleteing all registered resolvers.
|
|
247
247
|
*/
|
|
248
248
|
clear() {
|
|
249
|
-
const t =
|
|
249
|
+
const t = g(this).resolvers, e = Array.from(t.values());
|
|
250
250
|
return Promise.all(e.map((s) => {
|
|
251
251
|
if (s.constructed)
|
|
252
252
|
return Promise.resolve(s.resolve()).then((n) => {
|
|
@@ -254,7 +254,7 @@ let Es = class {
|
|
|
254
254
|
return n.dispose.call(n, this, s);
|
|
255
255
|
});
|
|
256
256
|
})).then(() => {
|
|
257
|
-
e.forEach((s) => this.delete(s.id)),
|
|
257
|
+
e.forEach((s) => this.delete(s.id)), g(this).children.forEach((s) => s.clear());
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
/**
|
|
@@ -262,7 +262,7 @@ let Es = class {
|
|
|
262
262
|
*/
|
|
263
263
|
detach() {
|
|
264
264
|
if (this.parent) {
|
|
265
|
-
const t =
|
|
265
|
+
const t = g(this.parent).children, e = t.indexOf(this);
|
|
266
266
|
e > -1 && (t.splice(e, 1), delete this.parent);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
@@ -272,13 +272,13 @@ let Es = class {
|
|
|
272
272
|
* @param handler Handler function for touching the resolved value.
|
|
273
273
|
*/
|
|
274
274
|
touch(t, e) {
|
|
275
|
-
const s =
|
|
275
|
+
const s = g(this).resolvers.get(t);
|
|
276
276
|
if (s && s.constructed)
|
|
277
277
|
Promise.resolve(s.resolve()).then((n) => {
|
|
278
278
|
e(n, this);
|
|
279
279
|
});
|
|
280
280
|
else {
|
|
281
|
-
const n =
|
|
281
|
+
const n = g(this).touchQueue;
|
|
282
282
|
let r = n.get(t);
|
|
283
283
|
r || (r = [], n.set(t, r)), r.push(e);
|
|
284
284
|
}
|
|
@@ -290,10 +290,10 @@ let Es = class {
|
|
|
290
290
|
* @param factory Value factory.
|
|
291
291
|
*/
|
|
292
292
|
registerAsync(t, e) {
|
|
293
|
-
const s =
|
|
293
|
+
const s = g(this).resolvers.get(t);
|
|
294
294
|
s && !s.async && process.env.NODE_ENV !== "production" && w(this).warn(`Mismatching resolver type. You are registering an async resolver with a key ('${t}') previously used by a non-async resolver.`);
|
|
295
295
|
const n = new Es(t, e, s, this);
|
|
296
|
-
return
|
|
296
|
+
return g(this).resolvers.set(t, n), n.id;
|
|
297
297
|
}
|
|
298
298
|
/**
|
|
299
299
|
* Registers a factory resolver for constructing the value to be resolved.
|
|
@@ -301,10 +301,10 @@ let Es = class {
|
|
|
301
301
|
* @param factory Value factory.
|
|
302
302
|
*/
|
|
303
303
|
registerFactory(t, e) {
|
|
304
|
-
const s =
|
|
304
|
+
const s = g(this).resolvers.get(t);
|
|
305
305
|
s && s.async && process.env.NODE_ENV !== "production" && w(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);
|
|
306
306
|
const n = new Cs(t, e, s, this);
|
|
307
|
-
return
|
|
307
|
+
return g(this).resolvers.set(t, n), n.id;
|
|
308
308
|
}
|
|
309
309
|
/**
|
|
310
310
|
* Registers an synchronous resolver.
|
|
@@ -312,17 +312,17 @@ let Es = class {
|
|
|
312
312
|
* @param value Value.
|
|
313
313
|
*/
|
|
314
314
|
register(t, e) {
|
|
315
|
-
const s =
|
|
315
|
+
const s = g(this).resolvers.get(t);
|
|
316
316
|
s && s.async && process.env.NODE_ENV !== "production" && w(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);
|
|
317
317
|
const n = new Ps(t, e, s, this);
|
|
318
|
-
return
|
|
318
|
+
return g(this).resolvers.set(t, n), n.id;
|
|
319
319
|
}
|
|
320
320
|
/**
|
|
321
321
|
* Gets the value for a synchronous resolver.
|
|
322
322
|
* @param key Key of resolver to get.
|
|
323
323
|
*/
|
|
324
324
|
get(t) {
|
|
325
|
-
const e =
|
|
325
|
+
const e = g(this).resolvers.get(t);
|
|
326
326
|
if (e)
|
|
327
327
|
return e.async && process.env.NODE_ENV !== "production" && w(this).warn(`You are retrieving an async value (with key '${t}') by the non-async function 'container.get(key)'. This will not be supported in future versions. Use 'container.getAsync(key) instead.'`), e.resolve();
|
|
328
328
|
if (this.parent)
|
|
@@ -333,7 +333,7 @@ let Es = class {
|
|
|
333
333
|
* @param key Key of resolver to get.
|
|
334
334
|
*/
|
|
335
335
|
getAsync(t) {
|
|
336
|
-
const e =
|
|
336
|
+
const e = g(this).resolvers.get(t);
|
|
337
337
|
if (e) {
|
|
338
338
|
if (!e.async)
|
|
339
339
|
throw process.env.NODE_ENV !== "production" && w(this).warn(`You are retrieving a non-async value (with key '${t}') by the async function 'container.getAsync(key)'.Use 'container.get(key) instead.'`), "Mismatching resolver type";
|
|
@@ -351,7 +351,7 @@ let Es = class {
|
|
|
351
351
|
}
|
|
352
352
|
createChild(t, e) {
|
|
353
353
|
const s = new Ye(t, e, this);
|
|
354
|
-
return
|
|
354
|
+
return g(this).children.push(s), s;
|
|
355
355
|
}
|
|
356
356
|
}, ye = class {
|
|
357
357
|
/**
|
|
@@ -3205,7 +3205,7 @@ R[Kt] = !0, R.elementProperties = /* @__PURE__ */ new Map(), R.elementStyles = [
|
|
|
3205
3205
|
var Lt;
|
|
3206
3206
|
const ft = window, B = ft.trustedTypes, ze = B ? B.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, Yt = "$lit$", N = `lit$${(Math.random() + "").slice(9)}$`, vs = "?" + N, Ji = `<${vs}>`, j = document, G = () => j.createComment(""), X = (i) => i === null || typeof i != "object" && typeof i != "function", fs = Array.isArray, Fi = (i) => fs(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", Rt = `[
|
|
3207
3207
|
\f\r]`, Q = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, We = /-->/g, Be = />/g, I = RegExp(`>|${Rt}(?:([^\\s"'>=/]+)(${Rt}*=${Rt}*(?:[^
|
|
3208
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ve = /'/g, Je = /"/g, ys = /^(?:script|style|textarea|title)$/i, qi = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), lt = qi(1), H = Symbol.for("lit-noChange"),
|
|
3208
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ve = /'/g, Je = /"/g, ys = /^(?:script|style|textarea|title)$/i, qi = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), lt = qi(1), H = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Fe = /* @__PURE__ */ new WeakMap(), D = j.createTreeWalker(j, 129, null, !1);
|
|
3209
3209
|
function $s(i, t) {
|
|
3210
3210
|
if (!Array.isArray(i) || !i.hasOwnProperty("raw"))
|
|
3211
3211
|
throw Error("invalid template strings array");
|
|
@@ -3316,7 +3316,7 @@ class Ki {
|
|
|
3316
3316
|
class nt {
|
|
3317
3317
|
constructor(t, e, s, n) {
|
|
3318
3318
|
var r;
|
|
3319
|
-
this.type = 2, this._$AH =
|
|
3319
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = n, this._$Cp = (r = n == null ? void 0 : n.isConnected) === null || r === void 0 || r;
|
|
3320
3320
|
}
|
|
3321
3321
|
get _$AU() {
|
|
3322
3322
|
var t, e;
|
|
@@ -3334,7 +3334,7 @@ class nt {
|
|
|
3334
3334
|
return this._$AB;
|
|
3335
3335
|
}
|
|
3336
3336
|
_$AI(t, e = this) {
|
|
3337
|
-
t = V(this, t, e), X(t) ? t ===
|
|
3337
|
+
t = V(this, t, e), X(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Fi(t) ? this.T(t) : this._(t);
|
|
3338
3338
|
}
|
|
3339
3339
|
k(t) {
|
|
3340
3340
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -3343,7 +3343,7 @@ class nt {
|
|
|
3343
3343
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
|
3344
3344
|
}
|
|
3345
3345
|
_(t) {
|
|
3346
|
-
this._$AH !==
|
|
3346
|
+
this._$AH !== m && X(this._$AH) ? this._$AA.nextSibling.data = t : this.$(j.createTextNode(t)), this._$AH = t;
|
|
3347
3347
|
}
|
|
3348
3348
|
g(t) {
|
|
3349
3349
|
var e;
|
|
@@ -3381,7 +3381,7 @@ class nt {
|
|
|
3381
3381
|
}
|
|
3382
3382
|
class At {
|
|
3383
3383
|
constructor(t, e, s, n, r) {
|
|
3384
|
-
this.type = 1, this._$AH =
|
|
3384
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = n, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = m;
|
|
3385
3385
|
}
|
|
3386
3386
|
get tagName() {
|
|
3387
3387
|
return this.element.tagName;
|
|
@@ -3398,12 +3398,12 @@ class At {
|
|
|
3398
3398
|
const a = t;
|
|
3399
3399
|
let c, h;
|
|
3400
3400
|
for (t = r[0], c = 0; c < r.length - 1; c++)
|
|
3401
|
-
h = V(this, a[s + c], e, c), h === H && (h = this._$AH[c]), o || (o = !X(h) || h !== this._$AH[c]), h ===
|
|
3401
|
+
h = V(this, a[s + c], e, c), h === H && (h = this._$AH[c]), o || (o = !X(h) || h !== this._$AH[c]), h === m ? t = m : t !== m && (t += (h ?? "") + r[c + 1]), this._$AH[c] = h;
|
|
3402
3402
|
}
|
|
3403
3403
|
o && !n && this.j(t);
|
|
3404
3404
|
}
|
|
3405
3405
|
j(t) {
|
|
3406
|
-
t ===
|
|
3406
|
+
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
3407
3407
|
}
|
|
3408
3408
|
}
|
|
3409
3409
|
class Yi extends At {
|
|
@@ -3411,7 +3411,7 @@ class Yi extends At {
|
|
|
3411
3411
|
super(...arguments), this.type = 3;
|
|
3412
3412
|
}
|
|
3413
3413
|
j(t) {
|
|
3414
|
-
this.element[this.name] = t ===
|
|
3414
|
+
this.element[this.name] = t === m ? void 0 : t;
|
|
3415
3415
|
}
|
|
3416
3416
|
}
|
|
3417
3417
|
const Zi = B ? B.emptyScript : "";
|
|
@@ -3420,7 +3420,7 @@ class Gi extends At {
|
|
|
3420
3420
|
super(...arguments), this.type = 4;
|
|
3421
3421
|
}
|
|
3422
3422
|
j(t) {
|
|
3423
|
-
t && t !==
|
|
3423
|
+
t && t !== m ? this.element.setAttribute(this.name, Zi) : this.element.removeAttribute(this.name);
|
|
3424
3424
|
}
|
|
3425
3425
|
}
|
|
3426
3426
|
class Xi extends At {
|
|
@@ -3429,9 +3429,9 @@ class Xi extends At {
|
|
|
3429
3429
|
}
|
|
3430
3430
|
_$AI(t, e = this) {
|
|
3431
3431
|
var s;
|
|
3432
|
-
if ((t = (s = V(this, t, e, 0)) !== null && s !== void 0 ? s :
|
|
3432
|
+
if ((t = (s = V(this, t, e, 0)) !== null && s !== void 0 ? s : m) === H)
|
|
3433
3433
|
return;
|
|
3434
|
-
const n = this._$AH, r = t ===
|
|
3434
|
+
const n = this._$AH, r = t === m && n !== m || t.capture !== n.capture || t.once !== n.once || t.passive !== n.passive, o = t !== m && (n === m || r);
|
|
3435
3435
|
r && this.element.removeEventListener(this.name, this, n), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
3436
3436
|
}
|
|
3437
3437
|
handleEvent(t) {
|
|
@@ -3610,28 +3610,28 @@ class F extends Y {
|
|
|
3610
3610
|
e && hn(e.context, this);
|
|
3611
3611
|
}
|
|
3612
3612
|
async _renderSymbol(t) {
|
|
3613
|
-
const e = async (
|
|
3614
|
-
if (
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3613
|
+
const e = async (s) => await import("./index-17239ac6.mjs").then((r) => r[s]);
|
|
3614
|
+
if (t) {
|
|
3615
|
+
const { type: s, content: n } = t;
|
|
3616
|
+
switch (s) {
|
|
3617
|
+
case "Telia": {
|
|
3618
|
+
const r = await e(n);
|
|
3619
|
+
return r ? lt`<telia-icon
|
|
3620
|
+
class="trigger-icon"
|
|
3621
|
+
svg=${r.svg}
|
|
3622
|
+
size="lg"
|
|
3623
|
+
></telia-icon>` : m;
|
|
3624
|
+
}
|
|
3625
|
+
case "FontAwesome":
|
|
3626
|
+
return lt`<i class="trigger-fa-icon fa fa-${n}"></i>`;
|
|
3627
|
+
case "Uri":
|
|
3628
|
+
return lt`<i
|
|
3629
|
+
class="trigger-custom-icon"
|
|
3630
|
+
style="background: url(${n}) no-repeat center center;background-size: contain;"
|
|
3631
|
+
></i>`;
|
|
3632
|
+
default:
|
|
3633
|
+
return m;
|
|
3625
3634
|
}
|
|
3626
|
-
case "FontAwesome":
|
|
3627
|
-
return lt`<i class="trigger-fa-icon fa fa-${n}"></i>`;
|
|
3628
|
-
case "Uri":
|
|
3629
|
-
return lt`<i
|
|
3630
|
-
class="trigger-custom-icon"
|
|
3631
|
-
style="background: url(${n}) no-repeat center center;background-size: contain;"
|
|
3632
|
-
></i>`;
|
|
3633
|
-
default:
|
|
3634
|
-
return g;
|
|
3635
3635
|
}
|
|
3636
3636
|
}
|
|
3637
3637
|
render() {
|
|
@@ -3761,9 +3761,7 @@ rt([
|
|
|
3761
3761
|
pe()
|
|
3762
3762
|
], F.prototype, "icon", 2);
|
|
3763
3763
|
const un = (i, t, e, s, n) => i.getAsync("componentResolver").then((r) => (r.registerComponent(t, e), gi(i, t, s || (() => {
|
|
3764
|
-
}), t, n)))
|
|
3765
|
-
console.log("test12323425324222");
|
|
3766
|
-
const pn = (i, t) => i.reduce((e, s, n) => {
|
|
3764
|
+
}), t, n))), pn = (i, t) => i.reduce((e, s, n) => {
|
|
3767
3765
|
var o, a;
|
|
3768
3766
|
const r = {
|
|
3769
3767
|
...s,
|
|
@@ -3778,7 +3776,7 @@ const pn = (i, t) => i.reduce((e, s, n) => {
|
|
|
3778
3776
|
}, []), Mn = async (i) => un(
|
|
3779
3777
|
i,
|
|
3780
3778
|
"conversation",
|
|
3781
|
-
import("./conversation-
|
|
3779
|
+
import("./conversation-025ea610.mjs"),
|
|
3782
3780
|
async (t) => {
|
|
3783
3781
|
const e = await he.getInstance(i), { rehydrate: s = !1 } = t.properties(), n = "component", r = await e.createController(n, { rehydrate: s }), o = e.registerController(
|
|
3784
3782
|
r,
|
|
@@ -3859,9 +3857,8 @@ var gn = /* @__PURE__ */ ((i) => (i.LinkList = "link-list", i.Separator = "separ
|
|
|
3859
3857
|
const Dn = async (i, t, e) => {
|
|
3860
3858
|
await e;
|
|
3861
3859
|
};
|
|
3862
|
-
console.log("tes3t123");
|
|
3863
3860
|
export {
|
|
3864
|
-
|
|
3861
|
+
m as A,
|
|
3865
3862
|
it as C,
|
|
3866
3863
|
On as E,
|
|
3867
3864
|
te as P,
|
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-2a545cb2.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,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-conversation-flamingo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"registry": "https://registry.npmjs.org"
|
|
6
|
+
},
|
|
4
7
|
"dependencies": {
|
|
5
8
|
"@telia-ace/widget-utilities": "^1.0.16",
|
|
6
9
|
"lit": "^2.8.0",
|
|
7
10
|
"@lit-labs/motion": "^1.0.4",
|
|
8
11
|
"@teliads/icons": "^8.4.0",
|
|
9
12
|
"@teliads/components": "^22.1.1",
|
|
10
|
-
"@telia-ace/widget-runtime-flamingo": "
|
|
13
|
+
"@telia-ace/widget-runtime-flamingo": "^1.0.43",
|
|
11
14
|
"@webprovisions/platform": "^1.1.3",
|
|
12
15
|
"@telia-ace/widget-core": "^1.0.27",
|
|
13
16
|
"@telia-ace/widget-services": "^1.0.27"
|
|
@@ -15,4 +18,4 @@
|
|
|
15
18
|
"main": "./index.js",
|
|
16
19
|
"module": "./index.mjs",
|
|
17
20
|
"typings": "./index.d.ts"
|
|
18
|
-
}
|
|
21
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export type ConversationMessageUpdateSettings = ConversationMessageContent & {
|
|
|
49
49
|
};
|
|
50
50
|
export type ConversationMessageSender = {
|
|
51
51
|
name?: string;
|
|
52
|
-
avatar?: string |
|
|
52
|
+
avatar?: string | symbol;
|
|
53
53
|
id?: string;
|
|
54
54
|
};
|
|
55
55
|
export declare enum ConversationMessageListType {
|
|
@@ -123,7 +123,7 @@ export type HtmlProperties = {
|
|
|
123
123
|
};
|
|
124
124
|
type HtmlItem = [ConversationMessageListItemType.HTML, HtmlProperties];
|
|
125
125
|
type ItemPayload = LinkListItem | TextItem | SeparatorItem | ButtonListItem | HtmlItem | VideoRequestItem | ItemListItem;
|
|
126
|
-
export type
|
|
126
|
+
export type Symbol = {
|
|
127
127
|
type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;
|
|
128
128
|
content: string;
|
|
129
129
|
};
|