@telia-ace/knowledge-widget-bot-provider 0.0.15-experimental.7 → 0.0.15-experimental.8
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/dist/index.js +74 -62
- package/dist/index.js.map +1 -1
- package/dist/new-feedback-list.4dc450c7.js +61 -0
- package/dist/new-feedback-list.4dc450c7.js.map +1 -0
- package/dist/new-no-good-alternative.63439a76.js +48 -0
- package/dist/new-no-good-alternative.63439a76.js.map +1 -0
- package/dist/new-notification-list.17d34093.js +24 -0
- package/dist/new-notification-list.17d34093.js.map +1 -0
- package/dist/ui/new-feedback-list.d.ts +13 -0
- package/dist/ui/new-no-good-alternative.d.ts +8 -0
- package/dist/ui/new-notification-list.d.ts +6 -0
- package/package.json +14 -10
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var O = (i, t, e) => t in i ? U(i, t, { enumerable: !0, configurable: !0, writab
|
|
|
9
9
|
for (var e of A(t))
|
|
10
10
|
W.call(t, e) && O(i, e, t[e]);
|
|
11
11
|
return i;
|
|
12
|
-
},
|
|
12
|
+
}, P = (i, t) => V(i, j(t));
|
|
13
13
|
var m = (i, t, e) => new Promise((n, s) => {
|
|
14
14
|
var a = (v) => {
|
|
15
15
|
try {
|
|
@@ -26,9 +26,9 @@ var m = (i, t, e) => new Promise((n, s) => {
|
|
|
26
26
|
}, d = (v) => v.done ? n(v.value) : Promise.resolve(v.value).then(a, c);
|
|
27
27
|
d((e = e.apply(i, t)).next());
|
|
28
28
|
});
|
|
29
|
-
import { ConversationMessageListItemType as
|
|
29
|
+
import { ConversationMessageListItemType as S, ConversationPlatform as _, registerCustomMessageComponent as x } from "@telia-ace/widget-conversation";
|
|
30
30
|
import { readStorage as D, createStorageWriter as R, StorageCategory as F } from "@telia-ace/widget-services";
|
|
31
|
-
import { uuid as
|
|
31
|
+
import { uuid as N } from "@telia-ace/widget-utilities";
|
|
32
32
|
import { FormBuilder as $, submitButton as J } from "@telia-ace/widget-forms";
|
|
33
33
|
var f = /* @__PURE__ */ ((i) => (i.ContactMethod = "ace-knowledge-bot-contact-method", i.ContactList = "ace-knowledge-bot-contact-list", i.FeedbackList = "ace-knowledge-bot-feedback-list", i.NotificationList = "ace-knowledge-bot-notification-list", i.NoGoodAlternative = "ace-knowledge-bot-no-good-alternative", i))(f || {});
|
|
34
34
|
const q = (i) => {
|
|
@@ -42,12 +42,12 @@ const q = (i) => {
|
|
|
42
42
|
items: t = [],
|
|
43
43
|
meta: e = {}
|
|
44
44
|
}) => {
|
|
45
|
-
const n =
|
|
45
|
+
const n = N();
|
|
46
46
|
return {
|
|
47
47
|
id: n,
|
|
48
48
|
isUser: i,
|
|
49
49
|
items: t.map((a) => ({
|
|
50
|
-
id: a.id ||
|
|
50
|
+
id: a.id || N(),
|
|
51
51
|
isUser: i,
|
|
52
52
|
groupId: n,
|
|
53
53
|
message: a.message || []
|
|
@@ -65,7 +65,7 @@ const q = (i) => {
|
|
|
65
65
|
form: d,
|
|
66
66
|
description: v
|
|
67
67
|
}, o = {}) => {
|
|
68
|
-
const { adapter: r } = n || { Adapter: {} }, { clientName: l = "", settings: y = {}, customClientName: I = "" } = r, { validation:
|
|
68
|
+
const { adapter: r } = n || { Adapter: {} }, { clientName: l = "", settings: y = {}, customClientName: I = "" } = r, { validation: w } = o, p = {
|
|
69
69
|
id: i.toString(),
|
|
70
70
|
title: t,
|
|
71
71
|
description: v,
|
|
@@ -79,8 +79,8 @@ const q = (i) => {
|
|
|
79
79
|
const { displayTextBeforeClick: h, textBeforeClick: g } = y;
|
|
80
80
|
h === "true" && (p.expanded = !1, p.title = g), l.indexOf("phone.text") > -1 ? p.body.phoneNumber = y.phoneNumber : p.body.freetext = y.freetext;
|
|
81
81
|
}
|
|
82
|
-
return (l.indexOf("chat.popup") > -1 || l.indexOf("link") > -1 || l === "custom.adapter" && s === "custom") && (p.body = y, p.body.confirmationFallback = a), l.indexOf("ace") > -1 && (p.body = y), d && d.hasValueComponents && (
|
|
83
|
-
}, X = (i) => (i == null ? void 0 : i.$type) === "Humany.Matching.Bots.Conversations.GuideListState, Humany.Matching" ?
|
|
82
|
+
return (l.indexOf("chat.popup") > -1 || l.indexOf("link") > -1 || l === "custom.adapter" && s === "custom") && (p.body = y, p.body.confirmationFallback = a), l.indexOf("ace") > -1 && (p.body = y), d && d.hasValueComponents && (w ? p.body.form = $.fromLegacyForm(i.toString(), d, w).get() : p.body.form = $.fromLegacyForm(i.toString(), d).get(), c || (p.expanded = p.inline = !1), p.body = Z(p, { submit: "Submit" })), o.guideId && (p.body.guideId = o.guideId), p;
|
|
83
|
+
}, X = (i) => (i == null ? void 0 : i.$type) === "Humany.Matching.Bots.Conversations.GuideListState, Humany.Matching" ? S.LinkList : (i == null ? void 0 : i.$type) === "Humany.Matching.Bots.Conversations.States.GuideFeedbackState, Humany.Matching" ? f.FeedbackList : (i == null ? void 0 : i.$type) === "Humany.Matching.Bots.Conversations.States.ContactState, Humany.Matching" ? f.ContactList : S.ButtonList, Y = (i, t) => {
|
|
84
84
|
const { knowledgeBotEndpoint: e } = t.properties();
|
|
85
85
|
if (e)
|
|
86
86
|
return `${e}/conversations`;
|
|
@@ -96,7 +96,7 @@ const q = (i) => {
|
|
|
96
96
|
var s;
|
|
97
97
|
if ((s = i == null ? void 0 : i.body) != null && s.form) {
|
|
98
98
|
const { body: a } = i, c = new $(a.form);
|
|
99
|
-
return a.form.layout.submit || c.createComponent(J(t, "submit")), e && c.setValidationErrors(e), n && c.setMeta(n),
|
|
99
|
+
return a.form.layout.submit || c.createComponent(J(t, "submit")), e && c.setValidationErrors(e), n && c.setMeta(n), P(M({}, a), {
|
|
100
100
|
form: c.get()
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -117,41 +117,41 @@ const q = (i) => {
|
|
|
117
117
|
groupId: l
|
|
118
118
|
}) => {
|
|
119
119
|
const I = [];
|
|
120
|
-
return y.actions = r.content.items.map((
|
|
120
|
+
return y.actions = r.content.items.map((w) => {
|
|
121
121
|
var h;
|
|
122
122
|
const p = {
|
|
123
|
-
label:
|
|
124
|
-
actionKey:
|
|
125
|
-
symbol:
|
|
123
|
+
label: w.title,
|
|
124
|
+
actionKey: w.actionKey,
|
|
125
|
+
symbol: w.symbol ? w.symbol : void 0
|
|
126
126
|
};
|
|
127
|
-
if (
|
|
128
|
-
const g = r.actions[
|
|
129
|
-
o === f.ContactList ? (I.push(
|
|
127
|
+
if (w.data) {
|
|
128
|
+
const g = r.actions[w.actionKey];
|
|
129
|
+
o === f.ContactList ? (I.push(w.data.id), p.data = Q(w.data, {
|
|
130
130
|
guideId: (h = g == null ? void 0 : g.guideId) == null ? void 0 : h.toString()
|
|
131
|
-
})) : p.data =
|
|
131
|
+
})) : p.data = w.data;
|
|
132
132
|
}
|
|
133
133
|
return p;
|
|
134
134
|
}), o === f.ContactList && (y.contactMethodIds = I), y;
|
|
135
|
-
}, n = (I,
|
|
136
|
-
const h =
|
|
135
|
+
}, n = (I, w, ...p) => m(void 0, [I, w, ...p], function* (o, r, l = [], y) {
|
|
136
|
+
const h = N();
|
|
137
137
|
switch (o.type) {
|
|
138
138
|
case "List": {
|
|
139
|
-
const { header: g, items: K, html:
|
|
140
|
-
let
|
|
139
|
+
const { header: g, items: K, html: H } = o.content, L = [];
|
|
140
|
+
let C = {
|
|
141
141
|
actions: [],
|
|
142
142
|
entryId: o.id,
|
|
143
143
|
groupId: r.id
|
|
144
144
|
};
|
|
145
|
-
if (g && (
|
|
145
|
+
if (g && (C.header = g), (K == null ? void 0 : K.length) > 0) {
|
|
146
146
|
const u = X(o.localState);
|
|
147
|
-
if (
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
actions:
|
|
151
|
-
items:
|
|
152
|
-
localState:
|
|
153
|
-
},
|
|
154
|
-
|
|
147
|
+
if (C = e(u, o, r.id, C), l.length) {
|
|
148
|
+
const k = l.find((E) => E.tags.includes("paging")), B = l.find((E) => E.tags.includes("fallback"));
|
|
149
|
+
if (k != null && k.content && (r.meta.paging = {
|
|
150
|
+
actions: k.actions,
|
|
151
|
+
items: k.content.items,
|
|
152
|
+
localState: k.localState
|
|
153
|
+
}, k.content.items.forEach((E) => {
|
|
154
|
+
C.actions.push({
|
|
155
155
|
label: E.title,
|
|
156
156
|
actionKey: E.actionKey,
|
|
157
157
|
data: {
|
|
@@ -166,7 +166,7 @@ const q = (i) => {
|
|
|
166
166
|
b({
|
|
167
167
|
messageId: h,
|
|
168
168
|
message: [
|
|
169
|
-
|
|
169
|
+
S.Separator,
|
|
170
170
|
void 0
|
|
171
171
|
],
|
|
172
172
|
group: r
|
|
@@ -186,15 +186,15 @@ const q = (i) => {
|
|
|
186
186
|
L.unshift(
|
|
187
187
|
b({
|
|
188
188
|
messageId: h,
|
|
189
|
-
message: [u,
|
|
189
|
+
message: [u, C],
|
|
190
190
|
group: r
|
|
191
191
|
})
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
|
-
return
|
|
194
|
+
return H && L.unshift(
|
|
195
195
|
b({
|
|
196
196
|
messageId: h,
|
|
197
|
-
message: [
|
|
197
|
+
message: [S.HTML, { body: H }],
|
|
198
198
|
group: r
|
|
199
199
|
})
|
|
200
200
|
), L;
|
|
@@ -205,7 +205,7 @@ const q = (i) => {
|
|
|
205
205
|
b({
|
|
206
206
|
messageId: h,
|
|
207
207
|
message: [
|
|
208
|
-
|
|
208
|
+
S.HTML,
|
|
209
209
|
{ body: o.content.html }
|
|
210
210
|
],
|
|
211
211
|
group: r
|
|
@@ -213,32 +213,32 @@ const q = (i) => {
|
|
|
213
213
|
), l.length) {
|
|
214
214
|
const K = l.find(
|
|
215
215
|
(u) => {
|
|
216
|
-
var
|
|
217
|
-
return u.type === "List" && ((
|
|
216
|
+
var k;
|
|
217
|
+
return u.type === "List" && ((k = u.localState) == null ? void 0 : k.$type) === "Humany.Matching.Bots.Conversations.States.ContactState, Humany.Matching";
|
|
218
218
|
}
|
|
219
|
-
),
|
|
219
|
+
), H = l.find((u) => u.tags.includes("dialog")), L = l.find((u) => u.tags.includes("feedback")), C = l.find(
|
|
220
220
|
(u) => u.tags.includes("contact") && u.type === "Contact"
|
|
221
221
|
);
|
|
222
|
-
if (
|
|
222
|
+
if (C && g.push(
|
|
223
223
|
b({
|
|
224
224
|
messageId: h,
|
|
225
225
|
message: [
|
|
226
226
|
f.ContactMethod,
|
|
227
227
|
{
|
|
228
|
-
contactMethodId:
|
|
228
|
+
contactMethodId: C.content.id,
|
|
229
229
|
groupId: r.id,
|
|
230
|
-
guideId:
|
|
230
|
+
guideId: C.content.guideId
|
|
231
231
|
}
|
|
232
232
|
],
|
|
233
233
|
group: r
|
|
234
234
|
})
|
|
235
|
-
),
|
|
235
|
+
), H && g.push(
|
|
236
236
|
b({
|
|
237
237
|
messageId: h,
|
|
238
238
|
message: [
|
|
239
|
-
|
|
239
|
+
S.ButtonList,
|
|
240
240
|
{
|
|
241
|
-
actions:
|
|
241
|
+
actions: H.content.items.map((u) => ({
|
|
242
242
|
label: u.title,
|
|
243
243
|
actionKey: u.actionKey
|
|
244
244
|
}))
|
|
@@ -255,7 +255,7 @@ const q = (i) => {
|
|
|
255
255
|
g.push(
|
|
256
256
|
b({
|
|
257
257
|
messageId: h,
|
|
258
|
-
message: [
|
|
258
|
+
message: [S.Separator, void 0],
|
|
259
259
|
group: r
|
|
260
260
|
})
|
|
261
261
|
), g.push(
|
|
@@ -271,7 +271,7 @@ const q = (i) => {
|
|
|
271
271
|
messageId: h,
|
|
272
272
|
group: r,
|
|
273
273
|
message: [
|
|
274
|
-
|
|
274
|
+
S.HTML,
|
|
275
275
|
{
|
|
276
276
|
body: L.content.html
|
|
277
277
|
}
|
|
@@ -331,7 +331,7 @@ const q = (i) => {
|
|
|
331
331
|
b({
|
|
332
332
|
messageId: h,
|
|
333
333
|
message: [
|
|
334
|
-
|
|
334
|
+
S.HTML,
|
|
335
335
|
{
|
|
336
336
|
body: K.body
|
|
337
337
|
}
|
|
@@ -346,7 +346,7 @@ const q = (i) => {
|
|
|
346
346
|
b({
|
|
347
347
|
messageId: h,
|
|
348
348
|
message: [
|
|
349
|
-
|
|
349
|
+
S.HTML,
|
|
350
350
|
{
|
|
351
351
|
body: o.content.item.body
|
|
352
352
|
}
|
|
@@ -359,7 +359,7 @@ const q = (i) => {
|
|
|
359
359
|
b({
|
|
360
360
|
messageId: h,
|
|
361
361
|
message: [
|
|
362
|
-
|
|
362
|
+
S.HTML,
|
|
363
363
|
{
|
|
364
364
|
body: o.content.message || "Something went wrong."
|
|
365
365
|
}
|
|
@@ -370,8 +370,8 @@ const q = (i) => {
|
|
|
370
370
|
default:
|
|
371
371
|
return [];
|
|
372
372
|
}
|
|
373
|
-
}), s = (o) => ["CategorizedNoticeList", "NoticeList"].includes(o.type) ? (o.content.items || []).reduce((r, l) => (o.content.isInitialNotices && r.push(
|
|
374
|
-
id:
|
|
373
|
+
}), s = (o) => ["CategorizedNoticeList", "NoticeList"].includes(o.type) ? (o.content.items || []).reduce((r, l) => (o.content.isInitialNotices && r.push(P(M({}, o), {
|
|
374
|
+
id: N(),
|
|
375
375
|
type: l.type || o.type,
|
|
376
376
|
content: {
|
|
377
377
|
$type: o.content.$type,
|
|
@@ -400,7 +400,7 @@ const q = (i) => {
|
|
|
400
400
|
});
|
|
401
401
|
class et {
|
|
402
402
|
constructor(t, e, n, s) {
|
|
403
|
-
this.endpoint = t, this.events = e, this.store = n, this.container = s, this.clientId =
|
|
403
|
+
this.endpoint = t, this.events = e, this.store = n, this.container = s, this.clientId = N(), this.entries = [];
|
|
404
404
|
}
|
|
405
405
|
start(e) {
|
|
406
406
|
return m(this, arguments, function* ({ silent: t }) {
|
|
@@ -453,11 +453,11 @@ class et {
|
|
|
453
453
|
t
|
|
454
454
|
).then((s) => {
|
|
455
455
|
const a = t.items.findIndex((c) => c.message[0] === "link-list");
|
|
456
|
-
return a === -1 || !s ? t :
|
|
456
|
+
return a === -1 || !s ? t : P(M({}, t), {
|
|
457
457
|
meta: M(M({}, t.meta), s[0].meta),
|
|
458
458
|
items: [
|
|
459
459
|
...t.items.slice(0, a),
|
|
460
|
-
|
|
460
|
+
P(M({}, t.items[a]), {
|
|
461
461
|
message: [
|
|
462
462
|
s[0].items[0].message[0],
|
|
463
463
|
M(M({}, t.items[a].message[1]), s[0].items[0].message[1])
|
|
@@ -521,7 +521,7 @@ class et {
|
|
|
521
521
|
return (n.message === "Failed to fetch" || n.message === "NetworkError when attempting to fetch resource.") && (s = "Lost connection... Please try again."), this.handleResponse({
|
|
522
522
|
entries: [
|
|
523
523
|
{
|
|
524
|
-
id:
|
|
524
|
+
id: N(),
|
|
525
525
|
type: "Error",
|
|
526
526
|
timestamp: new Date().toISOString(),
|
|
527
527
|
content: {
|
|
@@ -683,9 +683,9 @@ class ot {
|
|
|
683
683
|
isUser: !0,
|
|
684
684
|
items: [
|
|
685
685
|
{
|
|
686
|
-
id:
|
|
686
|
+
id: N(),
|
|
687
687
|
isUser: !0,
|
|
688
|
-
message: [
|
|
688
|
+
message: [S.HTML, { body: t }]
|
|
689
689
|
}
|
|
690
690
|
]
|
|
691
691
|
});
|
|
@@ -717,23 +717,35 @@ class ot {
|
|
|
717
717
|
}
|
|
718
718
|
const at = ot, rt = (i) => m(void 0, null, function* () {
|
|
719
719
|
const t = yield _.getInstance(i);
|
|
720
|
-
|
|
720
|
+
x(
|
|
721
721
|
i,
|
|
722
722
|
f.ContactList,
|
|
723
723
|
import("./contact-method-list.2b3b6ea5.js")
|
|
724
|
-
),
|
|
724
|
+
), x(
|
|
725
725
|
i,
|
|
726
726
|
f.ContactMethod,
|
|
727
727
|
import("./contact-method.016a8ec5.js")
|
|
728
|
-
),
|
|
728
|
+
), x(
|
|
729
|
+
i,
|
|
730
|
+
"ace-knowledge-bot-new-no-good-alternative",
|
|
731
|
+
import("./new-no-good-alternative.63439a76.js")
|
|
732
|
+
), x(
|
|
733
|
+
i,
|
|
734
|
+
"ace-knowledge-bot-new-feedback-list",
|
|
735
|
+
import("./new-feedback-list.4dc450c7.js")
|
|
736
|
+
), x(
|
|
737
|
+
i,
|
|
738
|
+
"ace-knowledge-bot-new-notification-list",
|
|
739
|
+
import("./new-notification-list.17d34093.js")
|
|
740
|
+
), x(
|
|
729
741
|
i,
|
|
730
742
|
f.NotificationList,
|
|
731
743
|
import("./notification-list.399e34ff.js")
|
|
732
|
-
),
|
|
744
|
+
), x(
|
|
733
745
|
i,
|
|
734
746
|
f.NoGoodAlternative,
|
|
735
747
|
import("./no-good-alternative.4e277f5b.js")
|
|
736
|
-
),
|
|
748
|
+
), x(
|
|
737
749
|
i,
|
|
738
750
|
f.FeedbackList,
|
|
739
751
|
import("./feedback-list.042775aa.js")
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/types.ts","../src/utils.ts","../src/entry-handler.ts","../src/http-client.ts","../src/store.ts","../src/provider.ts","../src/plugin.ts"],"sourcesContent":["import { ConversationMessageListItemType } from '@telia-ace/widget-conversation';\n\nexport enum CustomMessageTypes {\n ContactMethod = 'ace-knowledge-bot-contact-method',\n ContactList = 'ace-knowledge-bot-contact-list',\n FeedbackList = 'ace-knowledge-bot-feedback-list',\n NotificationList = 'ace-knowledge-bot-notification-list',\n NoGoodAlternative = 'ace-knowledge-bot-no-good-alternative',\n}\n\nexport type LooseObject = { [key: string]: any };\n\nexport interface ActionItem {\n label: string;\n actionKey: string;\n data?: any;\n}\n\nexport interface MessageGroup {\n id: string;\n isUser: boolean;\n items: MessageGroupItem[];\n writer?: any;\n meta: { [key: string]: any };\n}\n\nexport interface MessageGroupItem {\n id: string;\n groupId: string;\n isUser: boolean;\n message: [ConversationMessageListItemType | CustomMessageTypes, any];\n}\n\nexport interface ClientEnvelope {\n command?: LooseObject;\n action?: {\n key: string;\n content: any;\n };\n globalState?: LooseObject;\n localState?: LooseObject;\n clientId?: string;\n funnel?: string;\n}\n\nexport interface ServerEnvelope {\n clientId?: string | undefined;\n entries: ServerEntry[];\n globalState?: GlobalState;\n resolveCommand?: string;\n clientEnvelope?: ClientEnvelope;\n}\n\nexport interface GlobalState {\n completedInteractionsCount: number;\n lastQuestion?: string;\n lastBotGuide: number;\n lastGuideTitle?: string;\n site: string;\n invincibleParameters: object;\n}\n\nexport interface ServerEntry {\n id: string;\n type: string;\n content: any;\n actions: { [key: string]: any };\n tags: string[];\n relation?: string;\n timestamp: string;\n localState?: { [key: string]: any };\n}\n\nexport interface ListContent {\n header?: string;\n actions: ActionItem[];\n contactMethodIds?: string[];\n entryId: string;\n groupId: string;\n}\n","// import { ContactMethodType } from '@telia-ace/knowledge-widget-adapters';\n// import { Symbol } from '@telia-ace/knowledge-widget-ui';\nimport { ConversationMessageListItemType } from '@telia-ace/widget-conversation';\nimport { FormBuilder, submitButton } from '@telia-ace/widget-forms';\nimport { uuid } from '@telia-ace/widget-utilities';\nimport { Container } from '@webprovisions/platform';\nimport { CustomMessageTypes, MessageGroup, MessageGroupItem } from './types';\n\ntype ContactMethodType = any;\ntype Symbol = any;\n\nconst convertLegacySymbol = (symbol?: { type: string; content: string }): Symbol | undefined => {\n if (symbol) {\n const { type, content } = symbol;\n if (type && content) {\n return { type, content };\n }\n }\n};\n\nexport const createGroup = ({\n isUser,\n items = [],\n meta = {},\n}: {\n isUser: boolean;\n items?: Partial<MessageGroupItem>[];\n meta?: MessageGroup['meta'];\n}) => {\n const groupId = uuid();\n\n const group = {\n id: groupId,\n isUser,\n items: items.map((i) => {\n return {\n id: i.id || uuid(),\n isUser: isUser,\n groupId: groupId,\n message: i.message || [],\n };\n }),\n meta,\n } as MessageGroup;\n\n return group;\n};\n\nexport const contactMethodFromLegacy = (\n {\n id,\n title,\n defaultIcon,\n exits: [exit],\n exitType,\n confirmationText,\n expandFormAutomatically,\n form,\n description,\n }: any,\n options: {\n validation?: any;\n guideId?: string;\n } = {}\n): any => {\n const { adapter } = exit || { Adapter: {} };\n const { clientName = '', settings: adapterSettings = {}, customClientName = '' } = adapter;\n const { validation } = options;\n\n const settings: any = {\n id: id.toString(),\n title: title,\n description: description,\n symbol: convertLegacySymbol(defaultIcon),\n clientName: clientName === 'custom.adapter' ? customClientName : clientName,\n expanded: true,\n inline: true,\n body: {},\n };\n\n if (clientName.indexOf('phone') > -1 || clientName.indexOf('freetext') > -1) {\n const { displayTextBeforeClick, textBeforeClick } = adapterSettings;\n if (displayTextBeforeClick === 'true') {\n settings.expanded = false;\n settings.title = textBeforeClick;\n }\n\n if (clientName.indexOf('phone.text') > -1) {\n settings.body.phoneNumber = adapterSettings.phoneNumber;\n } else {\n settings.body.freetext = adapterSettings.freetext;\n }\n }\n\n if (\n clientName.indexOf('chat.popup') > -1 ||\n clientName.indexOf('link') > -1 ||\n (clientName === 'custom.adapter' && exitType === 'custom')\n ) {\n settings.body = adapterSettings;\n settings.body.confirmationFallback = confirmationText;\n }\n\n if (clientName.indexOf('ace') > -1) {\n settings.body = adapterSettings;\n }\n\n if (form && form.hasValueComponents) {\n if (validation) {\n settings.body.form = FormBuilder.fromLegacyForm(id.toString(), form, validation).get();\n } else {\n settings.body.form = FormBuilder.fromLegacyForm(id.toString(), form).get();\n }\n if (!expandFormAutomatically) {\n settings.expanded = settings.inline = false;\n }\n\n settings.body = updateForm(settings, { submit: 'Submit' });\n }\n\n if (options.guideId) {\n settings.body.guideId = options.guideId;\n }\n\n return settings;\n};\n\nexport const getListType = (state: any) => {\n if (state?.$type === 'Humany.Matching.Bots.Conversations.GuideListState, Humany.Matching') {\n return ConversationMessageListItemType.LinkList;\n } else if (\n state?.$type ===\n 'Humany.Matching.Bots.Conversations.States.GuideFeedbackState, Humany.Matching'\n ) {\n return CustomMessageTypes.FeedbackList;\n } else if (\n state?.$type === 'Humany.Matching.Bots.Conversations.States.ContactState, Humany.Matching'\n ) {\n return CustomMessageTypes.ContactList;\n } else return ConversationMessageListItemType.ButtonList;\n};\n\nexport const getKnowledgeBotEndpoint = (\n container: Container,\n component: any /*: ComponentNodeController */\n) => {\n const { knowledgeBotEndpoint } = component.properties();\n\n if (knowledgeBotEndpoint) {\n return `${knowledgeBotEndpoint}/conversations`;\n }\n\n const { data } = container.get('$settings');\n\n if (!data || !data.projection) throw new Error('Missing Knowledge Bot endpoint');\n\n return `${data.projection}/conversations`;\n};\n\nexport const updateForm = (\n contactMethod: ContactMethodType,\n {\n submit,\n errors,\n meta,\n }: { submit: string; errors?: { [key: string]: string }; meta?: { [key: string]: string } }\n): any => {\n if (contactMethod?.body?.form) {\n const { body } = contactMethod;\n const builder = new FormBuilder(body.form);\n\n if (!body.form.layout.submit) {\n builder.createComponent(submitButton(submit, 'submit'));\n }\n\n if (errors) {\n builder.setValidationErrors(errors);\n }\n\n if (meta) {\n (builder as any).setMeta(meta);\n }\n\n return {\n ...body,\n form: builder.get(),\n };\n }\n return contactMethod?.body || {};\n};\n","import { ConversationMessageListItemType } from '@telia-ace/widget-conversation';\nimport { uuid } from '@telia-ace/widget-utilities';\nimport {\n ActionItem,\n CustomMessageTypes,\n ListContent,\n MessageGroup,\n MessageGroupItem,\n ServerEntry,\n} from './types';\nimport { contactMethodFromLegacy, createGroup, getListType } from './utils';\n\nconst createGroupItem = ({\n messageId,\n message,\n group,\n}: {\n messageId: string;\n message: MessageGroupItem['message'];\n group: MessageGroup;\n}) => {\n return {\n id: messageId,\n message,\n groupId: group.id,\n isUser: group.isUser,\n };\n};\n\nexport const processEntries = async (entries: ServerEntry[], prevGroup?: MessageGroup) => {\n const createListContent = (\n listType: string,\n entry: ServerEntry,\n groupId: string,\n listContent: ListContent = {\n actions: [],\n entryId: entry.id,\n groupId,\n }\n ) => {\n const contactMethodIds: string[] = [];\n\n listContent.actions = entry.content.items.map((i: any) => {\n const action = {\n label: i.title,\n actionKey: i.actionKey,\n symbol: !!i.symbol ? i.symbol : undefined,\n } as ActionItem;\n\n if (i.data) {\n const entryAction = entry.actions[i.actionKey];\n if (listType === CustomMessageTypes.ContactList) {\n contactMethodIds.push(i.data.id);\n action.data = contactMethodFromLegacy(i.data, {\n guideId: entryAction?.guideId?.toString(),\n });\n } else {\n action.data = i.data;\n }\n }\n return action;\n });\n\n if (listType === CustomMessageTypes.ContactList) {\n listContent.contactMethodIds = contactMethodIds;\n }\n\n return listContent;\n };\n\n const transform = async (\n entry: ServerEntry,\n group: MessageGroup,\n related: ServerEntry[] = [],\n prevGroup?: MessageGroup\n ) => {\n const messageId = uuid();\n\n switch (entry.type) {\n case 'List':\n {\n const { header, items, html } = entry.content;\n\n const result = [];\n\n let listContent = {\n actions: [],\n entryId: entry.id,\n groupId: group.id,\n } as ListContent;\n\n if (header) {\n listContent.header = header;\n }\n\n if (items?.length > 0) {\n const listType = getListType(entry.localState);\n listContent = createListContent(listType, entry, group.id, listContent);\n\n // entry has related entries\n if (!!related.length) {\n const pagingEntry = related.find((e) => e.tags.includes('paging'));\n const fallbackEntry = related.find((e) => e.tags.includes('fallback'));\n\n if (pagingEntry?.content) {\n group.meta.paging = {\n actions: pagingEntry.actions,\n items: pagingEntry.content.items,\n localState: pagingEntry.localState,\n };\n pagingEntry.content.items.forEach((i: any) => {\n listContent.actions.push({\n label: i.title,\n actionKey: i.actionKey,\n data: {\n groupId: !!prevGroup ? prevGroup.id : group.id,\n },\n });\n });\n }\n\n if (fallbackEntry) {\n const fallbackAction = fallbackEntry.content.items.find(\n (i: any) => i.actionKey === 'help'\n );\n if (fallbackAction) {\n result.push(\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.Separator,\n undefined,\n ],\n group,\n })\n );\n result.push(\n createGroupItem({\n messageId,\n message: [\n CustomMessageTypes.NoGoodAlternative,\n { body: fallbackAction.title },\n ],\n group,\n })\n );\n }\n }\n }\n\n result.unshift(\n createGroupItem({\n messageId,\n message: [listType, listContent],\n group,\n })\n );\n }\n\n if (html) {\n result.unshift(\n createGroupItem({\n messageId,\n message: [ConversationMessageListItemType.HTML, { body: html }],\n group,\n })\n );\n }\n\n return result;\n }\n break;\n case 'Text':\n {\n const result = [];\n result.push(\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.HTML,\n { body: entry.content.html },\n ],\n group,\n })\n );\n\n // embedded contact methods\n if (!!related.length) {\n const contactMethodListEntry = related.find(\n (e) =>\n e.type === 'List' &&\n e.localState?.$type ===\n 'Humany.Matching.Bots.Conversations.States.ContactState, Humany.Matching'\n );\n\n const dialogListEntry = related.find((e) => e.tags.includes('dialog'));\n const feedbackEntry = related.find((e) => e.tags.includes('feedback'));\n const contactMethodEntry = related.find(\n (e) => e.tags.includes('contact') && e.type === 'Contact'\n );\n\n if (contactMethodEntry) {\n result.push(\n createGroupItem({\n messageId,\n message: [\n CustomMessageTypes.ContactMethod,\n {\n contactMethodId: contactMethodEntry.content.id,\n groupId: group.id,\n guideId: contactMethodEntry.content.guideId,\n },\n ],\n group,\n })\n );\n }\n\n if (dialogListEntry) {\n result.push(\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.ButtonList,\n {\n actions: dialogListEntry.content.items.map((i: any) => {\n return {\n label: i.title,\n actionKey: i.actionKey,\n };\n }),\n },\n ],\n group,\n })\n );\n }\n\n if (contactMethodListEntry) {\n const listContent = createListContent(\n CustomMessageTypes.ContactList,\n contactMethodListEntry,\n group.id\n );\n\n result.push(\n createGroupItem({\n messageId,\n message: [ConversationMessageListItemType.Separator, undefined],\n group,\n })\n );\n\n result.push(\n createGroupItem({\n messageId,\n message: [CustomMessageTypes.ContactList, listContent],\n group,\n })\n );\n }\n\n if (feedbackEntry) {\n if (feedbackEntry.content.html) {\n result.push(\n createGroupItem({\n messageId,\n group,\n message: [\n ConversationMessageListItemType.HTML,\n {\n body: feedbackEntry.content.html,\n },\n ],\n })\n );\n }\n result.push(\n createGroupItem({\n messageId,\n group,\n message: [\n CustomMessageTypes.FeedbackList,\n {\n actions: feedbackEntry.content.items.map((i: any) => {\n return {\n actionKey: i.actionKey,\n label: i.title,\n };\n }),\n },\n ],\n })\n );\n }\n }\n return result;\n }\n break;\n case 'Contact': {\n return [\n createGroupItem({\n messageId,\n message: [\n CustomMessageTypes.ContactMethod,\n {\n contactMethodId: entry.content.id,\n groupId: group.id,\n guideId: entry.content.guideId,\n },\n ],\n group,\n }),\n ];\n }\n case 'CategorizedNoticeList': {\n const result = [\n createGroupItem({\n messageId,\n message: [\n CustomMessageTypes.NotificationList,\n {\n id: entry.content.item.id.toString(),\n header: entry.content.item.title,\n items: entry.content.item.listNotices,\n symbol: entry.content.item.defaultIcon,\n },\n ],\n group,\n }),\n ];\n\n (entry.content.notices || []).forEach((notice: any) => {\n result.push(\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.HTML,\n {\n body: notice.body,\n },\n ],\n group,\n })\n );\n });\n\n return result;\n }\n case 'footerNotice': {\n return [\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.HTML,\n {\n body: entry.content.item.body,\n },\n ],\n group,\n }),\n ];\n }\n case 'Error': {\n return [\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.HTML,\n {\n body: entry.content.message || 'Something went wrong.',\n },\n ],\n group,\n }),\n ];\n }\n\n default:\n return [];\n }\n };\n\n const splitEntry = (entry: ServerEntry): ServerEntry | ServerEntry[] => {\n if (['CategorizedNoticeList', 'NoticeList'].includes(entry.type)) {\n return (entry.content.items || []).reduce((acc: any, item: any) => {\n if (!entry.content.isInitialNotices) {\n return acc;\n }\n acc.push({\n ...entry,\n id: uuid(),\n type: item.type || entry.type,\n content: {\n $type: entry.content.$type,\n isInitialNotices: entry.content.isInitialNotices,\n notices: item.notices,\n item,\n },\n });\n return acc;\n }, []);\n }\n return entry;\n };\n\n // map of in which order the messages should be displayed\n // lower numbers will be displayed above higher\n const sortMap = new Map<string, number>([\n ['Text', 1],\n ['List', 2],\n ['Contact', 3],\n ['CategorizedNoticeList', 10],\n ]);\n\n const result: MessageGroup[] = [];\n const filteredEntries = entries\n .sort((item, other) => {\n // sort the entries based on it's types sort value\n const defaultSortValue = 20;\n\n var sortValue = sortMap.get(item.type) || defaultSortValue;\n var sortValueOther = sortMap.get(other.type) || defaultSortValue;\n return sortValue - sortValueOther;\n })\n .filter((entry) => !entry.relation) // remove any \"relation entries\"\n .reduce<ServerEntry[]>((acc, entry) => {\n // some entries needs to be splitted into seperate groups\n return acc.concat(splitEntry(entry));\n }, []);\n\n // we dont want to display this type of entry\n // as we dont support it, and it was not supported in v4 either\n const isNonVisibleRelatedEntry = (e: ServerEntry) => {\n return typeof e.actions['selector'] !== 'undefined';\n };\n\n for (const entry of filteredEntries) {\n const relatedEntries = entries.filter(\n (other) => other.relation === entry.id && !isNonVisibleRelatedEntry(other)\n );\n const group = createGroup({ isUser: false });\n\n const items = await transform(entry, group, relatedEntries, prevGroup);\n items.forEach((item) => {\n group.items.push(item);\n });\n\n if (group.items.length) {\n result.push(group);\n }\n }\n return result;\n};\n","import { uuid } from '@telia-ace/widget-utilities';\nimport { Container, EventManager } from '@webprovisions/platform';\nimport { processEntries } from './entry-handler';\nimport Store from './store';\nimport { ClientEnvelope, MessageGroup, ServerEntry, ServerEnvelope } from './types';\n\nclass HttpClient {\n private globalState: any;\n private localState: ServerEntry['localState'];\n private clientId: string;\n private entries: ServerEntry[];\n\n constructor(\n private endpoint: string,\n private events: EventManager,\n private store: Store,\n private container: Container\n ) {\n this.clientId = uuid();\n this.entries = [];\n }\n\n async start({ silent }: { silent: boolean }) {\n const storedGlobalState = await this.store.read('globalState');\n const storedLocalState = await this.store.read('localState');\n const storedEntries = await this.store.read('entries');\n\n // if there is state stored we need to set it\n this.globalState = storedGlobalState || this.globalState;\n this.localState = storedLocalState || this.localState;\n this.entries = storedEntries || this.entries;\n\n // dont create initial envelope if the client should just\n // set local and global state and then start silently\n if (silent) {\n return;\n }\n\n const envelope = this.createInitialEnvelope();\n const initialResponse = await this.postEnvelope(envelope);\n return initialResponse;\n }\n\n async sendMessage(message: string) {\n const envelope = {\n command: { phrase: message },\n globalState: this.globalState,\n clientId: this.clientId,\n };\n\n const result = await this.postEnvelope(envelope);\n return result;\n }\n\n async helpAction() {\n return this.postEnvelope({\n action: {\n key: 'help',\n content: {\n $type: 'Humany.Matching.Bots.Conversations.Actions.Help, Humany.Matching',\n },\n },\n globalState: this.globalState,\n clientId: this.clientId,\n });\n }\n\n async nextAction(group: MessageGroup) {\n const { paging } = group.meta;\n if (!paging.actions?.next) {\n return;\n }\n return this.postEnvelope(\n {\n action: {\n key: 'next',\n content: paging.actions.next,\n },\n localState: paging.localState,\n globalState: this.globalState,\n clientId: this.clientId,\n },\n group\n ).then((response) => {\n const listItemIndex = group.items.findIndex((item) => item.message[0] === 'link-list');\n if (listItemIndex === -1 || !response) {\n return group;\n }\n\n return {\n ...group,\n meta: {\n ...group.meta,\n ...response[0].meta,\n },\n items: [\n ...group.items.slice(0, listItemIndex),\n {\n ...group.items[listItemIndex],\n message: [\n response[0].items[0].message[0],\n {\n ...group.items[listItemIndex].message[1],\n ...response[0].items[0].message[1],\n },\n ],\n },\n ...group.items.slice(listItemIndex + 1),\n ],\n };\n });\n }\n\n async showContactMethodAction(data: {\n contactMethod: any;\n actionKey: string;\n entryId: string;\n }) {\n const entry = this.entries.find((e) => e.id === data.entryId);\n const actionItem = entry?.actions[data.actionKey];\n\n if (!actionItem) {\n return;\n }\n\n return this.postEnvelope({\n action: {\n key: data.actionKey,\n content: actionItem,\n },\n localState: entry.localState,\n globalState: this.globalState,\n clientId: this.clientId,\n });\n }\n\n async defaultAction(action: string) {\n const entry = this.getEntryOfAction(action);\n\n if (!entry) {\n return;\n }\n\n return this.postEnvelope({\n action: {\n key: action,\n content: entry.actions[action],\n },\n localState: entry.localState,\n globalState: this.globalState,\n clientId: this.clientId,\n });\n }\n\n private createInitialEnvelope(): ClientEnvelope {\n return {\n command: { site: this.endpoint },\n clientId: this.clientId,\n globalState: {},\n funnel: this.container.get('$widget').name,\n };\n }\n\n private async postEnvelope(envelope: ClientEnvelope, prevGroup?: MessageGroup) {\n try {\n const response = await fetch(this.endpoint, this.getHttpOptions(envelope));\n\n if (!response.ok) {\n throw response;\n }\n\n const data = await response.json();\n\n return this.handleResponse(data, prevGroup);\n } catch (error: any) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Something went wrong when posting the envelope.');\n }\n let message = 'Something went wrong';\n if (\n error.message === 'Failed to fetch' ||\n error.message === 'NetworkError when attempting to fetch resource.'\n ) {\n message = 'Lost connection... Please try again.';\n }\n return this.handleResponse({\n entries: [\n {\n id: uuid(),\n type: 'Error',\n timestamp: new Date().toISOString(),\n content: {\n message,\n },\n actions: {},\n tags: [],\n },\n ],\n });\n }\n }\n\n private async handleResponse(data: ServerEnvelope, prevGroup?: MessageGroup) {\n this.entries = this.entries.concat(data.entries);\n this.store.write(this.entries, 'entries');\n\n const widgetEntry = data.entries.find((e) => e.type === 'Widget');\n\n if (widgetEntry) {\n this.events.dispatch('provider:widget-entry', widgetEntry.content);\n }\n\n if (data.globalState) {\n this.globalState = data.globalState;\n this.store.write(data.globalState, 'globalState');\n }\n\n this.localState = data.entries.reduce<ServerEntry['localState']>((acc, entry) => {\n if (entry.localState) {\n return entry.localState;\n }\n return acc;\n }, undefined);\n this.store.write(this.localState, 'localState');\n\n const groups = await processEntries(data.entries, prevGroup);\n return groups;\n }\n\n private getHttpOptions(envelope: ClientEnvelope) {\n const fetchOptions = {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n };\n envelope.funnel = this.container.get('$widget').name;\n envelope.localState = envelope.localState || this.localState;\n return Object.assign({}, fetchOptions, {\n body: JSON.stringify(envelope),\n credentials: 'same-origin' as RequestCredentials,\n });\n }\n\n private getEntryOfAction(action: string) {\n return this.entries.find((entry) => !!entry.actions[action]);\n }\n}\n\nexport default HttpClient;\n","import { createStorageWriter, readStorage, StorageCategory } from '@telia-ace/widget-services';\nimport { Container } from '@webprovisions/platform';\nimport { GlobalState, LooseObject, ServerEntry } from './types';\n\ntype MetaData = {\n agent: {\n name: string;\n avatar?: string;\n };\n};\n\ntype StorageTypes = 'localState' | 'globalState' | 'entries' | 'meta';\n\nclass Store {\n private enabled = true; // set whether or not to store data\n private botProviderGlobalStateKey = 'bot-provider-global-state';\n private botProviderLocalStateKey = 'bot-provider-local-state';\n private botProviderEntriesKey = 'bot-provider-entries';\n private botProviderMetaStateKey = 'bot-provider-conversation-meta';\n\n constructor(private container: Container) {}\n\n private getKey(type: StorageTypes) {\n let key;\n switch (type) {\n case 'localState':\n key = this.botProviderLocalStateKey;\n break;\n case 'globalState':\n key = this.botProviderGlobalStateKey;\n break;\n case 'entries':\n key = this.botProviderEntriesKey;\n break;\n case 'meta':\n key = this.botProviderMetaStateKey;\n break;\n\n default:\n break;\n }\n return key;\n }\n\n async read(type: 'localState'): Promise<LooseObject | undefined>;\n async read(type: 'meta'): Promise<MetaData | undefined>;\n async read(type: 'entries'): Promise<ServerEntry[] | undefined>;\n async read(type: 'globalState'): Promise<GlobalState | undefined>;\n async read(type: StorageTypes): Promise<any | undefined> {\n const key = this.getKey(type);\n if (!this.enabled || !key) {\n return;\n }\n\n return readStorage(this.container, key);\n }\n\n async write(data: any, type: StorageTypes) {\n const key = this.getKey(type);\n if (!this.enabled || !key) {\n return;\n }\n\n const write = await createStorageWriter(this.container, key, StorageCategory.Necessary);\n write(data);\n }\n}\n\nexport default Store;\n","import { ComponentNodeController } from '@telia-ace/knowledge-widget-core';\nimport { ConversationMessageListItemType } from '@telia-ace/widget-conversation';\nimport { createStorageWriter, StorageCategory } from '@telia-ace/widget-services';\nimport { uuid } from '@telia-ace/widget-utilities';\nimport { Container, EventManager, Widget } from '@webprovisions/platform';\nimport HttpClient from './http-client';\nimport Store from './store';\nimport { MessageGroup, ServerEntry } from './types';\nimport { createGroup, getKnowledgeBotEndpoint } from './utils';\n\nclass KnowledgeBotProvider {\n private agent: any;\n private user: any;\n private httpClient: HttpClient;\n private events: EventManager;\n private groups: MessageGroup[] = [];\n private store: Store;\n\n constructor(\n private container: Container,\n private conversation: any,\n component: ComponentNodeController\n ) {\n const { events } = this.container.get('$widget') as Widget;\n this.events = events;\n this.store = new Store(container);\n this.agent = conversation.createAgent({\n id: 'knowledge-bot-agent', // we need to specify an ID here to allow rehydration to work\n name: '',\n avatar: undefined,\n });\n this.user = conversation.user;\n const endpoint = getKnowledgeBotEndpoint(container, component);\n this.httpClient = new HttpClient(endpoint, events, this.store, this.container);\n\n this.events.subscribe('provider:widget-entry', (_event, data: ServerEntry['content']) => {\n this.onWidgetEntryReceived(data);\n });\n\n this.events.subscribe(\n 'provider:open-contact-method',\n async (_event, data: { contactMethod: any; entryId: string; actionKey: string }) => {\n const response = await this.httpClient.showContactMethodAction(data);\n\n if (response) {\n if (!!data.contactMethod.title) this.printUserMessage(data.contactMethod.title);\n this.onMessagesReceived(response);\n }\n }\n );\n }\n\n async initialize() {\n const loader = this.conversation.loading();\n\n const storedMeta = await this.store.read('meta');\n if (storedMeta?.agent) {\n this.agent.update({\n name: storedMeta.agent.name,\n avatar: storedMeta.agent.avatar,\n });\n }\n\n const rehydrated = await this.conversation.isRehydrated();\n\n const response = await this.httpClient.start({\n silent: this.conversation.options?.silent || rehydrated,\n });\n if (response) {\n this.onMessagesReceived(response);\n }\n\n loader();\n }\n\n async onMessagesReceived(groups: MessageGroup[]) {\n this.groups = this.groups.concat(groups);\n groups.forEach((group) => {\n const items = group.items.map((item) => item.message);\n if (group.isUser) {\n group.writer = this.user.print(items);\n } else {\n group.writer = this.agent.print(items);\n }\n });\n }\n\n async onInput(action: string | { [key: string]: any; actionKey: string; label?: string }) {\n const actionKey = typeof action === 'string' ? action : action.actionKey;\n\n switch (actionKey) {\n case 'next':\n {\n if (typeof action === 'string') {\n return;\n }\n const group = this.groups.find((other) => other.id === action.data?.groupId);\n\n if (group) {\n const response = await this.httpClient.nextAction(group);\n if (response) {\n const combined = response.items.map((item) => item.message);\n group.meta.paging = response?.meta.paging;\n group.writer.update(combined);\n }\n }\n }\n break;\n case 'help':\n {\n const loader = this.conversation.loading();\n\n const response = await this.httpClient.helpAction();\n loader();\n if (response) {\n this.onMessagesReceived(response);\n }\n }\n break;\n default:\n {\n if (typeof action !== 'string' && action.label) {\n this.printUserMessage(action.label);\n }\n const loader = this.conversation.loading();\n const response = await this.httpClient.defaultAction(actionKey);\n if (response) {\n this.onMessagesReceived(response);\n }\n loader();\n }\n break;\n }\n }\n\n private printUserMessage(message: string) {\n const group = createGroup({\n isUser: true,\n items: [\n {\n id: uuid(),\n isUser: true,\n message: [ConversationMessageListItemType.HTML, { body: message }],\n },\n ],\n });\n this.onMessagesReceived([group]);\n return group;\n }\n\n async onMessageSend(message: string) {\n const loader = this.conversation.loading();\n const response = await this.httpClient.sendMessage(message);\n\n this.printUserMessage(message);\n\n if (response) {\n this.onMessagesReceived(response);\n }\n loader();\n }\n\n private async onWidgetEntryReceived(data: ServerEntry['content']) {\n if (data.agent) {\n const agentSettings = {\n name: data.agent.name,\n avatar: data.agent.avatar,\n };\n this.agent.update(agentSettings);\n const write = await createStorageWriter(\n this.container,\n 'bot-provider-conversation-meta',\n StorageCategory.Necessary\n );\n write({\n agent: agentSettings,\n });\n }\n }\n}\n\nexport default KnowledgeBotProvider;\n","import {\n ConversationPlatform,\n registerCustomMessageComponent,\n} from '@telia-ace/widget-conversation';\nimport { Container, Widget } from '@webprovisions/platform';\nimport KnowledgeBotProvider from './provider';\nimport { CustomMessageTypes } from './types';\n\nconst KnowledgeBotProviderPlugin = async (container: Container) => {\n const platform = await ConversationPlatform.getInstance(container);\n\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.ContactList,\n import('./ui/contact-method-list')\n );\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.ContactMethod,\n import('./ui/contact-method')\n );\n\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.NotificationList,\n import('./ui/notification-list')\n );\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.NoGoodAlternative,\n import('./ui/no-good-alternative')\n );\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.FeedbackList,\n import('./ui/feedback-list')\n );\n\n platform.registerProvider('ace-knowledge-bot', (conversation, component) => {\n const provider = new KnowledgeBotProvider(container, conversation, component);\n provider.initialize();\n\n const subscriptions: any[] = [];\n subscriptions.push(\n component.actions.watch('conversation.user-submit', (input, next) => {\n provider.onMessageSend(input.text);\n })\n );\n\n subscriptions.push(\n component.actions.watch('conversation.action', (input, next) => {\n provider.onInput(input);\n\n return next(input);\n })\n );\n\n subscriptions.push(\n component.actions.create('evaluate', (input) => {\n const { events } = container.get('$widget') as Widget;\n events.dispatch('bot-provider:evaluate', input);\n })\n );\n\n subscriptions.push(\n component.actions.create('submit', (input) => {\n const { events } = container.get('$widget') as Widget;\n events.dispatch('bot-provider:form-submitted', input);\n })\n );\n\n return () => {\n // cleaning up when provider is disposed\n subscriptions.forEach((unsubscribe) => {\n unsubscribe();\n });\n };\n });\n};\n\nexport default KnowledgeBotProviderPlugin;\n"],"names":["CustomMessageTypes","convertLegacySymbol","symbol","type","content","createGroup","isUser","items","meta","groupId","uuid","i","contactMethodFromLegacy","id","title","defaultIcon","exit","exitType","confirmationText","expandFormAutomatically","form","description","options","adapter","clientName","adapterSettings","customClientName","validation","settings","displayTextBeforeClick","textBeforeClick","FormBuilder","updateForm","getListType","state","ConversationMessageListItemType","getKnowledgeBotEndpoint","container","component","knowledgeBotEndpoint","data","contactMethod","submit","errors","_a","body","builder","submitButton","__spreadProps","__spreadValues","createGroupItem","messageId","message","group","processEntries","entries","prevGroup","__async","createListContent","listType","entry","listContent","contactMethodIds","action","entryAction","transform","_0","_1","_2","related","header","html","result","pagingEntry","e","fallbackEntry","fallbackAction","contactMethodListEntry","dialogListEntry","feedbackEntry","contactMethodEntry","notice","splitEntry","acc","item","sortMap","filteredEntries","other","sortValue","sortValueOther","isNonVisibleRelatedEntry","relatedEntries","HttpClient","endpoint","events","store","silent","storedGlobalState","storedLocalState","storedEntries","envelope","paging","response","listItemIndex","actionItem","error","widgetEntry","fetchOptions","HttpClient$1","Store","key","readStorage","createStorageWriter","StorageCategory","Store$1","KnowledgeBotProvider","conversation","_event","loader","storedMeta","rehydrated","groups","actionKey","combined","agentSettings","KnowledgeBotProvider$1","KnowledgeBotProviderPlugin","platform","ConversationPlatform","registerCustomMessageComponent","provider","subscriptions","input","next","unsubscribe","KnowledgeBotProviderPlugin$1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEY,IAAAA,sBAAAA,OACRA,EAAA,gBAAgB,oCAChBA,EAAA,cAAc,kCACdA,EAAA,eAAe,mCACfA,EAAA,mBAAmB,uCACnBA,EAAA,oBAAoB,yCALZA,IAAAA,KAAA,CAAA,CAAA;ACSZ,MAAMC,IAAsB,CAACC,MAAmE;AAC5F,MAAIA,GAAQ;AACF,UAAA,EAAE,MAAAC,GAAM,SAAAC,EAAY,IAAAF;AAC1B,QAAIC,KAAQC;AACD,aAAA,EAAE,MAAAD,GAAM,SAAAC;EAEvB;AACJ,GAEaC,IAAc,CAAC;AAAA,EACxB,QAAAC;AAAA,EACA,OAAAC,IAAQ,CAAC;AAAA,EACT,MAAAC,IAAO,CAAC;AACZ,MAIM;AACF,QAAMC,IAAUC;AAgBT,SAdO;AAAA,IACV,IAAID;AAAA,IACJ,QAAAH;AAAA,IACA,OAAOC,EAAM,IAAI,CAACI,OACP;AAAA,MACH,IAAIA,EAAE,MAAMD,EAAK;AAAA,MACjB,QAAAJ;AAAA,MACA,SAAAG;AAAA,MACA,SAASE,EAAE,WAAW,CAAC;AAAA,IAAA,EAE9B;AAAA,IACD,MAAAH;AAAA,EAAA;AAIR,GAEaI,IAA0B,CACnC;AAAA,EACI,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAO,CAACC,CAAI;AAAA,EACZ,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,aAAAC;AACJ,GACAC,IAGI,CAAA,MACE;AACN,QAAM,EAAE,SAAAC,EAAQ,IAAIP,KAAQ,EAAE,SAAS,CAAG,EAAA,GACpC,EAAE,YAAAQ,IAAa,IAAI,UAAUC,IAAkB,CAAA,GAAI,kBAAAC,IAAmB,GAAO,IAAAH,GAC7E,EAA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AAAyD,EAAA,SAAS,+BAA+BsC,CAAK;AAAA,MAAA,CACvD;AAAA,IAAA,GAGE,MAAM;AAEK,MAAAD,EAAA,QAAQ,CAACG,MAAgB;AACvB,QAAAA;MAAA,CACf;AAAA,IAAA;AAAA,EACL,CACH;AACL,IAEAC,KAAeT;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/types.ts","../src/utils.ts","../src/entry-handler.ts","../src/http-client.ts","../src/store.ts","../src/provider.ts","../src/plugin.ts"],"sourcesContent":["import { ConversationMessageListItemType } from '@telia-ace/widget-conversation';\n\nexport enum CustomMessageTypes {\n ContactMethod = 'ace-knowledge-bot-contact-method',\n ContactList = 'ace-knowledge-bot-contact-list',\n FeedbackList = 'ace-knowledge-bot-feedback-list',\n NotificationList = 'ace-knowledge-bot-notification-list',\n NoGoodAlternative = 'ace-knowledge-bot-no-good-alternative',\n}\n\nexport type LooseObject = { [key: string]: any };\n\nexport interface ActionItem {\n label: string;\n actionKey: string;\n data?: any;\n}\n\nexport interface MessageGroup {\n id: string;\n isUser: boolean;\n items: MessageGroupItem[];\n writer?: any;\n meta: { [key: string]: any };\n}\n\nexport interface MessageGroupItem {\n id: string;\n groupId: string;\n isUser: boolean;\n message: [ConversationMessageListItemType | CustomMessageTypes, any];\n}\n\nexport interface ClientEnvelope {\n command?: LooseObject;\n action?: {\n key: string;\n content: any;\n };\n globalState?: LooseObject;\n localState?: LooseObject;\n clientId?: string;\n funnel?: string;\n}\n\nexport interface ServerEnvelope {\n clientId?: string | undefined;\n entries: ServerEntry[];\n globalState?: GlobalState;\n resolveCommand?: string;\n clientEnvelope?: ClientEnvelope;\n}\n\nexport interface GlobalState {\n completedInteractionsCount: number;\n lastQuestion?: string;\n lastBotGuide: number;\n lastGuideTitle?: string;\n site: string;\n invincibleParameters: object;\n}\n\nexport interface ServerEntry {\n id: string;\n type: string;\n content: any;\n actions: { [key: string]: any };\n tags: string[];\n relation?: string;\n timestamp: string;\n localState?: { [key: string]: any };\n}\n\nexport interface ListContent {\n header?: string;\n actions: ActionItem[];\n contactMethodIds?: string[];\n entryId: string;\n groupId: string;\n}\n","// import { ContactMethodType } from '@telia-ace/knowledge-widget-adapters';\n// import { Symbol } from '@telia-ace/knowledge-widget-ui';\nimport { ConversationMessageListItemType } from '@telia-ace/widget-conversation';\nimport { FormBuilder, submitButton } from '@telia-ace/widget-forms';\nimport { uuid } from '@telia-ace/widget-utilities';\nimport { Container } from '@webprovisions/platform';\nimport { CustomMessageTypes, MessageGroup, MessageGroupItem } from './types';\n\ntype ContactMethodType = any;\ntype Symbol = any;\n\nconst convertLegacySymbol = (symbol?: { type: string; content: string }): Symbol | undefined => {\n if (symbol) {\n const { type, content } = symbol;\n if (type && content) {\n return { type, content };\n }\n }\n};\n\nexport const createGroup = ({\n isUser,\n items = [],\n meta = {},\n}: {\n isUser: boolean;\n items?: Partial<MessageGroupItem>[];\n meta?: MessageGroup['meta'];\n}) => {\n const groupId = uuid();\n\n const group = {\n id: groupId,\n isUser,\n items: items.map((i) => {\n return {\n id: i.id || uuid(),\n isUser: isUser,\n groupId: groupId,\n message: i.message || [],\n };\n }),\n meta,\n } as MessageGroup;\n\n return group;\n};\n\nexport const contactMethodFromLegacy = (\n {\n id,\n title,\n defaultIcon,\n exits: [exit],\n exitType,\n confirmationText,\n expandFormAutomatically,\n form,\n description,\n }: any,\n options: {\n validation?: any;\n guideId?: string;\n } = {}\n): any => {\n const { adapter } = exit || { Adapter: {} };\n const { clientName = '', settings: adapterSettings = {}, customClientName = '' } = adapter;\n const { validation } = options;\n\n const settings: any = {\n id: id.toString(),\n title: title,\n description: description,\n symbol: convertLegacySymbol(defaultIcon),\n clientName: clientName === 'custom.adapter' ? customClientName : clientName,\n expanded: true,\n inline: true,\n body: {},\n };\n\n if (clientName.indexOf('phone') > -1 || clientName.indexOf('freetext') > -1) {\n const { displayTextBeforeClick, textBeforeClick } = adapterSettings;\n if (displayTextBeforeClick === 'true') {\n settings.expanded = false;\n settings.title = textBeforeClick;\n }\n\n if (clientName.indexOf('phone.text') > -1) {\n settings.body.phoneNumber = adapterSettings.phoneNumber;\n } else {\n settings.body.freetext = adapterSettings.freetext;\n }\n }\n\n if (\n clientName.indexOf('chat.popup') > -1 ||\n clientName.indexOf('link') > -1 ||\n (clientName === 'custom.adapter' && exitType === 'custom')\n ) {\n settings.body = adapterSettings;\n settings.body.confirmationFallback = confirmationText;\n }\n\n if (clientName.indexOf('ace') > -1) {\n settings.body = adapterSettings;\n }\n\n if (form && form.hasValueComponents) {\n if (validation) {\n settings.body.form = FormBuilder.fromLegacyForm(id.toString(), form, validation).get();\n } else {\n settings.body.form = FormBuilder.fromLegacyForm(id.toString(), form).get();\n }\n if (!expandFormAutomatically) {\n settings.expanded = settings.inline = false;\n }\n\n settings.body = updateForm(settings, { submit: 'Submit' });\n }\n\n if (options.guideId) {\n settings.body.guideId = options.guideId;\n }\n\n return settings;\n};\n\nexport const getListType = (state: any) => {\n if (state?.$type === 'Humany.Matching.Bots.Conversations.GuideListState, Humany.Matching') {\n return ConversationMessageListItemType.LinkList;\n } else if (\n state?.$type ===\n 'Humany.Matching.Bots.Conversations.States.GuideFeedbackState, Humany.Matching'\n ) {\n return CustomMessageTypes.FeedbackList;\n } else if (\n state?.$type === 'Humany.Matching.Bots.Conversations.States.ContactState, Humany.Matching'\n ) {\n return CustomMessageTypes.ContactList;\n } else return ConversationMessageListItemType.ButtonList;\n};\n\nexport const getKnowledgeBotEndpoint = (\n container: Container,\n component: any /*: ComponentNodeController */\n) => {\n const { knowledgeBotEndpoint } = component.properties();\n\n if (knowledgeBotEndpoint) {\n return `${knowledgeBotEndpoint}/conversations`;\n }\n\n const { data } = container.get('$settings');\n\n if (!data || !data.projection) throw new Error('Missing Knowledge Bot endpoint');\n\n return `${data.projection}/conversations`;\n};\n\nexport const updateForm = (\n contactMethod: ContactMethodType,\n {\n submit,\n errors,\n meta,\n }: { submit: string; errors?: { [key: string]: string }; meta?: { [key: string]: string } }\n): any => {\n if (contactMethod?.body?.form) {\n const { body } = contactMethod;\n const builder = new FormBuilder(body.form);\n\n if (!body.form.layout.submit) {\n builder.createComponent(submitButton(submit, 'submit'));\n }\n\n if (errors) {\n builder.setValidationErrors(errors);\n }\n\n if (meta) {\n (builder as any).setMeta(meta);\n }\n\n return {\n ...body,\n form: builder.get(),\n };\n }\n return contactMethod?.body || {};\n};\n","import { ConversationMessageListItemType } from '@telia-ace/widget-conversation';\nimport { uuid } from '@telia-ace/widget-utilities';\nimport {\n ActionItem,\n CustomMessageTypes,\n ListContent,\n MessageGroup,\n MessageGroupItem,\n ServerEntry,\n} from './types';\nimport { contactMethodFromLegacy, createGroup, getListType } from './utils';\n\nconst createGroupItem = ({\n messageId,\n message,\n group,\n}: {\n messageId: string;\n message: MessageGroupItem['message'];\n group: MessageGroup;\n}) => {\n return {\n id: messageId,\n message,\n groupId: group.id,\n isUser: group.isUser,\n };\n};\n\nexport const processEntries = async (entries: ServerEntry[], prevGroup?: MessageGroup) => {\n const createListContent = (\n listType: string,\n entry: ServerEntry,\n groupId: string,\n listContent: ListContent = {\n actions: [],\n entryId: entry.id,\n groupId,\n }\n ) => {\n const contactMethodIds: string[] = [];\n\n listContent.actions = entry.content.items.map((i: any) => {\n const action = {\n label: i.title,\n actionKey: i.actionKey,\n symbol: !!i.symbol ? i.symbol : undefined,\n } as ActionItem;\n\n if (i.data) {\n const entryAction = entry.actions[i.actionKey];\n if (listType === CustomMessageTypes.ContactList) {\n contactMethodIds.push(i.data.id);\n action.data = contactMethodFromLegacy(i.data, {\n guideId: entryAction?.guideId?.toString(),\n });\n } else {\n action.data = i.data;\n }\n }\n return action;\n });\n\n if (listType === CustomMessageTypes.ContactList) {\n listContent.contactMethodIds = contactMethodIds;\n }\n\n return listContent;\n };\n\n const transform = async (\n entry: ServerEntry,\n group: MessageGroup,\n related: ServerEntry[] = [],\n prevGroup?: MessageGroup\n ) => {\n const messageId = uuid();\n\n switch (entry.type) {\n case 'List':\n {\n const { header, items, html } = entry.content;\n\n const result = [];\n\n let listContent = {\n actions: [],\n entryId: entry.id,\n groupId: group.id,\n } as ListContent;\n\n if (header) {\n listContent.header = header;\n }\n\n if (items?.length > 0) {\n const listType = getListType(entry.localState);\n listContent = createListContent(listType, entry, group.id, listContent);\n\n // entry has related entries\n if (!!related.length) {\n const pagingEntry = related.find((e) => e.tags.includes('paging'));\n const fallbackEntry = related.find((e) => e.tags.includes('fallback'));\n\n if (pagingEntry?.content) {\n group.meta.paging = {\n actions: pagingEntry.actions,\n items: pagingEntry.content.items,\n localState: pagingEntry.localState,\n };\n pagingEntry.content.items.forEach((i: any) => {\n listContent.actions.push({\n label: i.title,\n actionKey: i.actionKey,\n data: {\n groupId: !!prevGroup ? prevGroup.id : group.id,\n },\n });\n });\n }\n\n if (fallbackEntry) {\n const fallbackAction = fallbackEntry.content.items.find(\n (i: any) => i.actionKey === 'help'\n );\n if (fallbackAction) {\n result.push(\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.Separator,\n undefined,\n ],\n group,\n })\n );\n result.push(\n createGroupItem({\n messageId,\n message: [\n CustomMessageTypes.NoGoodAlternative,\n { body: fallbackAction.title },\n ],\n group,\n })\n );\n }\n }\n }\n\n result.unshift(\n createGroupItem({\n messageId,\n message: [listType, listContent],\n group,\n })\n );\n }\n\n if (html) {\n result.unshift(\n createGroupItem({\n messageId,\n message: [ConversationMessageListItemType.HTML, { body: html }],\n group,\n })\n );\n }\n\n return result;\n }\n break;\n case 'Text':\n {\n const result = [];\n result.push(\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.HTML,\n { body: entry.content.html },\n ],\n group,\n })\n );\n\n // embedded contact methods\n if (!!related.length) {\n const contactMethodListEntry = related.find(\n (e) =>\n e.type === 'List' &&\n e.localState?.$type ===\n 'Humany.Matching.Bots.Conversations.States.ContactState, Humany.Matching'\n );\n\n const dialogListEntry = related.find((e) => e.tags.includes('dialog'));\n const feedbackEntry = related.find((e) => e.tags.includes('feedback'));\n const contactMethodEntry = related.find(\n (e) => e.tags.includes('contact') && e.type === 'Contact'\n );\n\n if (contactMethodEntry) {\n result.push(\n createGroupItem({\n messageId,\n message: [\n CustomMessageTypes.ContactMethod,\n {\n contactMethodId: contactMethodEntry.content.id,\n groupId: group.id,\n guideId: contactMethodEntry.content.guideId,\n },\n ],\n group,\n })\n );\n }\n\n if (dialogListEntry) {\n result.push(\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.ButtonList,\n {\n actions: dialogListEntry.content.items.map((i: any) => {\n return {\n label: i.title,\n actionKey: i.actionKey,\n };\n }),\n },\n ],\n group,\n })\n );\n }\n\n if (contactMethodListEntry) {\n const listContent = createListContent(\n CustomMessageTypes.ContactList,\n contactMethodListEntry,\n group.id\n );\n\n result.push(\n createGroupItem({\n messageId,\n message: [ConversationMessageListItemType.Separator, undefined],\n group,\n })\n );\n\n result.push(\n createGroupItem({\n messageId,\n message: [CustomMessageTypes.ContactList, listContent],\n group,\n })\n );\n }\n\n if (feedbackEntry) {\n if (feedbackEntry.content.html) {\n result.push(\n createGroupItem({\n messageId,\n group,\n message: [\n ConversationMessageListItemType.HTML,\n {\n body: feedbackEntry.content.html,\n },\n ],\n })\n );\n }\n result.push(\n createGroupItem({\n messageId,\n group,\n message: [\n CustomMessageTypes.FeedbackList,\n {\n actions: feedbackEntry.content.items.map((i: any) => {\n return {\n actionKey: i.actionKey,\n label: i.title,\n };\n }),\n },\n ],\n })\n );\n }\n }\n return result;\n }\n break;\n case 'Contact': {\n return [\n createGroupItem({\n messageId,\n message: [\n CustomMessageTypes.ContactMethod,\n {\n contactMethodId: entry.content.id,\n groupId: group.id,\n guideId: entry.content.guideId,\n },\n ],\n group,\n }),\n ];\n }\n case 'CategorizedNoticeList': {\n const result = [\n createGroupItem({\n messageId,\n message: [\n CustomMessageTypes.NotificationList,\n {\n id: entry.content.item.id.toString(),\n header: entry.content.item.title,\n items: entry.content.item.listNotices,\n symbol: entry.content.item.defaultIcon,\n },\n ],\n group,\n }),\n ];\n\n (entry.content.notices || []).forEach((notice: any) => {\n result.push(\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.HTML,\n {\n body: notice.body,\n },\n ],\n group,\n })\n );\n });\n\n return result;\n }\n case 'footerNotice': {\n return [\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.HTML,\n {\n body: entry.content.item.body,\n },\n ],\n group,\n }),\n ];\n }\n case 'Error': {\n return [\n createGroupItem({\n messageId,\n message: [\n ConversationMessageListItemType.HTML,\n {\n body: entry.content.message || 'Something went wrong.',\n },\n ],\n group,\n }),\n ];\n }\n\n default:\n return [];\n }\n };\n\n const splitEntry = (entry: ServerEntry): ServerEntry | ServerEntry[] => {\n if (['CategorizedNoticeList', 'NoticeList'].includes(entry.type)) {\n return (entry.content.items || []).reduce((acc: any, item: any) => {\n if (!entry.content.isInitialNotices) {\n return acc;\n }\n acc.push({\n ...entry,\n id: uuid(),\n type: item.type || entry.type,\n content: {\n $type: entry.content.$type,\n isInitialNotices: entry.content.isInitialNotices,\n notices: item.notices,\n item,\n },\n });\n return acc;\n }, []);\n }\n return entry;\n };\n\n // map of in which order the messages should be displayed\n // lower numbers will be displayed above higher\n const sortMap = new Map<string, number>([\n ['Text', 1],\n ['List', 2],\n ['Contact', 3],\n ['CategorizedNoticeList', 10],\n ]);\n\n const result: MessageGroup[] = [];\n const filteredEntries = entries\n .sort((item, other) => {\n // sort the entries based on it's types sort value\n const defaultSortValue = 20;\n\n var sortValue = sortMap.get(item.type) || defaultSortValue;\n var sortValueOther = sortMap.get(other.type) || defaultSortValue;\n return sortValue - sortValueOther;\n })\n .filter((entry) => !entry.relation) // remove any \"relation entries\"\n .reduce<ServerEntry[]>((acc, entry) => {\n // some entries needs to be splitted into seperate groups\n return acc.concat(splitEntry(entry));\n }, []);\n\n // we dont want to display this type of entry\n // as we dont support it, and it was not supported in v4 either\n const isNonVisibleRelatedEntry = (e: ServerEntry) => {\n return typeof e.actions['selector'] !== 'undefined';\n };\n\n for (const entry of filteredEntries) {\n const relatedEntries = entries.filter(\n (other) => other.relation === entry.id && !isNonVisibleRelatedEntry(other)\n );\n const group = createGroup({ isUser: false });\n\n const items = await transform(entry, group, relatedEntries, prevGroup);\n items.forEach((item) => {\n group.items.push(item);\n });\n\n if (group.items.length) {\n result.push(group);\n }\n }\n return result;\n};\n","import { uuid } from '@telia-ace/widget-utilities';\nimport { Container, EventManager } from '@webprovisions/platform';\nimport { processEntries } from './entry-handler';\nimport Store from './store';\nimport { ClientEnvelope, MessageGroup, ServerEntry, ServerEnvelope } from './types';\n\nclass HttpClient {\n private globalState: any;\n private localState: ServerEntry['localState'];\n private clientId: string;\n private entries: ServerEntry[];\n\n constructor(\n private endpoint: string,\n private events: EventManager,\n private store: Store,\n private container: Container\n ) {\n this.clientId = uuid();\n this.entries = [];\n }\n\n async start({ silent }: { silent: boolean }) {\n const storedGlobalState = await this.store.read('globalState');\n const storedLocalState = await this.store.read('localState');\n const storedEntries = await this.store.read('entries');\n\n // if there is state stored we need to set it\n this.globalState = storedGlobalState || this.globalState;\n this.localState = storedLocalState || this.localState;\n this.entries = storedEntries || this.entries;\n\n // dont create initial envelope if the client should just\n // set local and global state and then start silently\n if (silent) {\n return;\n }\n\n const envelope = this.createInitialEnvelope();\n const initialResponse = await this.postEnvelope(envelope);\n return initialResponse;\n }\n\n async sendMessage(message: string) {\n const envelope = {\n command: { phrase: message },\n globalState: this.globalState,\n clientId: this.clientId,\n };\n\n const result = await this.postEnvelope(envelope);\n return result;\n }\n\n async helpAction() {\n return this.postEnvelope({\n action: {\n key: 'help',\n content: {\n $type: 'Humany.Matching.Bots.Conversations.Actions.Help, Humany.Matching',\n },\n },\n globalState: this.globalState,\n clientId: this.clientId,\n });\n }\n\n async nextAction(group: MessageGroup) {\n const { paging } = group.meta;\n if (!paging.actions?.next) {\n return;\n }\n return this.postEnvelope(\n {\n action: {\n key: 'next',\n content: paging.actions.next,\n },\n localState: paging.localState,\n globalState: this.globalState,\n clientId: this.clientId,\n },\n group\n ).then((response) => {\n const listItemIndex = group.items.findIndex((item) => item.message[0] === 'link-list');\n if (listItemIndex === -1 || !response) {\n return group;\n }\n\n return {\n ...group,\n meta: {\n ...group.meta,\n ...response[0].meta,\n },\n items: [\n ...group.items.slice(0, listItemIndex),\n {\n ...group.items[listItemIndex],\n message: [\n response[0].items[0].message[0],\n {\n ...group.items[listItemIndex].message[1],\n ...response[0].items[0].message[1],\n },\n ],\n },\n ...group.items.slice(listItemIndex + 1),\n ],\n };\n });\n }\n\n async showContactMethodAction(data: {\n contactMethod: any;\n actionKey: string;\n entryId: string;\n }) {\n const entry = this.entries.find((e) => e.id === data.entryId);\n const actionItem = entry?.actions[data.actionKey];\n\n if (!actionItem) {\n return;\n }\n\n return this.postEnvelope({\n action: {\n key: data.actionKey,\n content: actionItem,\n },\n localState: entry.localState,\n globalState: this.globalState,\n clientId: this.clientId,\n });\n }\n\n async defaultAction(action: string) {\n const entry = this.getEntryOfAction(action);\n\n if (!entry) {\n return;\n }\n\n return this.postEnvelope({\n action: {\n key: action,\n content: entry.actions[action],\n },\n localState: entry.localState,\n globalState: this.globalState,\n clientId: this.clientId,\n });\n }\n\n private createInitialEnvelope(): ClientEnvelope {\n return {\n command: { site: this.endpoint },\n clientId: this.clientId,\n globalState: {},\n funnel: this.container.get('$widget').name,\n };\n }\n\n private async postEnvelope(envelope: ClientEnvelope, prevGroup?: MessageGroup) {\n try {\n const response = await fetch(this.endpoint, this.getHttpOptions(envelope));\n\n if (!response.ok) {\n throw response;\n }\n\n const data = await response.json();\n\n return this.handleResponse(data, prevGroup);\n } catch (error: any) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Something went wrong when posting the envelope.');\n }\n let message = 'Something went wrong';\n if (\n error.message === 'Failed to fetch' ||\n error.message === 'NetworkError when attempting to fetch resource.'\n ) {\n message = 'Lost connection... Please try again.';\n }\n return this.handleResponse({\n entries: [\n {\n id: uuid(),\n type: 'Error',\n timestamp: new Date().toISOString(),\n content: {\n message,\n },\n actions: {},\n tags: [],\n },\n ],\n });\n }\n }\n\n private async handleResponse(data: ServerEnvelope, prevGroup?: MessageGroup) {\n this.entries = this.entries.concat(data.entries);\n this.store.write(this.entries, 'entries');\n\n const widgetEntry = data.entries.find((e) => e.type === 'Widget');\n\n if (widgetEntry) {\n this.events.dispatch('provider:widget-entry', widgetEntry.content);\n }\n\n if (data.globalState) {\n this.globalState = data.globalState;\n this.store.write(data.globalState, 'globalState');\n }\n\n this.localState = data.entries.reduce<ServerEntry['localState']>((acc, entry) => {\n if (entry.localState) {\n return entry.localState;\n }\n return acc;\n }, undefined);\n this.store.write(this.localState, 'localState');\n\n const groups = await processEntries(data.entries, prevGroup);\n return groups;\n }\n\n private getHttpOptions(envelope: ClientEnvelope) {\n const fetchOptions = {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n };\n envelope.funnel = this.container.get('$widget').name;\n envelope.localState = envelope.localState || this.localState;\n return Object.assign({}, fetchOptions, {\n body: JSON.stringify(envelope),\n credentials: 'same-origin' as RequestCredentials,\n });\n }\n\n private getEntryOfAction(action: string) {\n return this.entries.find((entry) => !!entry.actions[action]);\n }\n}\n\nexport default HttpClient;\n","import { createStorageWriter, readStorage, StorageCategory } from '@telia-ace/widget-services';\nimport { Container } from '@webprovisions/platform';\nimport { GlobalState, LooseObject, ServerEntry } from './types';\n\ntype MetaData = {\n agent: {\n name: string;\n avatar?: string;\n };\n};\n\ntype StorageTypes = 'localState' | 'globalState' | 'entries' | 'meta';\n\nclass Store {\n private enabled = true; // set whether or not to store data\n private botProviderGlobalStateKey = 'bot-provider-global-state';\n private botProviderLocalStateKey = 'bot-provider-local-state';\n private botProviderEntriesKey = 'bot-provider-entries';\n private botProviderMetaStateKey = 'bot-provider-conversation-meta';\n\n constructor(private container: Container) {}\n\n private getKey(type: StorageTypes) {\n let key;\n switch (type) {\n case 'localState':\n key = this.botProviderLocalStateKey;\n break;\n case 'globalState':\n key = this.botProviderGlobalStateKey;\n break;\n case 'entries':\n key = this.botProviderEntriesKey;\n break;\n case 'meta':\n key = this.botProviderMetaStateKey;\n break;\n\n default:\n break;\n }\n return key;\n }\n\n async read(type: 'localState'): Promise<LooseObject | undefined>;\n async read(type: 'meta'): Promise<MetaData | undefined>;\n async read(type: 'entries'): Promise<ServerEntry[] | undefined>;\n async read(type: 'globalState'): Promise<GlobalState | undefined>;\n async read(type: StorageTypes): Promise<any | undefined> {\n const key = this.getKey(type);\n if (!this.enabled || !key) {\n return;\n }\n\n return readStorage(this.container, key);\n }\n\n async write(data: any, type: StorageTypes) {\n const key = this.getKey(type);\n if (!this.enabled || !key) {\n return;\n }\n\n const write = await createStorageWriter(this.container, key, StorageCategory.Necessary);\n write(data);\n }\n}\n\nexport default Store;\n","import { ComponentNodeController } from '@telia-ace/knowledge-widget-core';\nimport { ConversationMessageListItemType } from '@telia-ace/widget-conversation';\nimport { createStorageWriter, StorageCategory } from '@telia-ace/widget-services';\nimport { uuid } from '@telia-ace/widget-utilities';\nimport { Container, EventManager, Widget } from '@webprovisions/platform';\nimport HttpClient from './http-client';\nimport Store from './store';\nimport { MessageGroup, ServerEntry } from './types';\nimport { createGroup, getKnowledgeBotEndpoint } from './utils';\n\nclass KnowledgeBotProvider {\n private agent: any;\n private user: any;\n private httpClient: HttpClient;\n private events: EventManager;\n private groups: MessageGroup[] = [];\n private store: Store;\n\n constructor(\n private container: Container,\n private conversation: any,\n component: ComponentNodeController\n ) {\n const { events } = this.container.get('$widget') as Widget;\n this.events = events;\n this.store = new Store(container);\n this.agent = conversation.createAgent({\n id: 'knowledge-bot-agent', // we need to specify an ID here to allow rehydration to work\n name: '',\n avatar: undefined,\n });\n this.user = conversation.user;\n const endpoint = getKnowledgeBotEndpoint(container, component);\n this.httpClient = new HttpClient(endpoint, events, this.store, this.container);\n\n this.events.subscribe('provider:widget-entry', (_event, data: ServerEntry['content']) => {\n this.onWidgetEntryReceived(data);\n });\n\n this.events.subscribe(\n 'provider:open-contact-method',\n async (_event, data: { contactMethod: any; entryId: string; actionKey: string }) => {\n const response = await this.httpClient.showContactMethodAction(data);\n\n if (response) {\n if (!!data.contactMethod.title) this.printUserMessage(data.contactMethod.title);\n this.onMessagesReceived(response);\n }\n }\n );\n }\n\n async initialize() {\n const loader = this.conversation.loading();\n\n const storedMeta = await this.store.read('meta');\n if (storedMeta?.agent) {\n this.agent.update({\n name: storedMeta.agent.name,\n avatar: storedMeta.agent.avatar,\n });\n }\n\n const rehydrated = await this.conversation.isRehydrated();\n\n const response = await this.httpClient.start({\n silent: this.conversation.options?.silent || rehydrated,\n });\n if (response) {\n this.onMessagesReceived(response);\n }\n\n loader();\n }\n\n async onMessagesReceived(groups: MessageGroup[]) {\n this.groups = this.groups.concat(groups);\n groups.forEach((group) => {\n const items = group.items.map((item) => item.message);\n if (group.isUser) {\n group.writer = this.user.print(items);\n } else {\n group.writer = this.agent.print(items);\n }\n });\n }\n\n async onInput(action: string | { [key: string]: any; actionKey: string; label?: string }) {\n const actionKey = typeof action === 'string' ? action : action.actionKey;\n\n switch (actionKey) {\n case 'next':\n {\n if (typeof action === 'string') {\n return;\n }\n const group = this.groups.find((other) => other.id === action.data?.groupId);\n\n if (group) {\n const response = await this.httpClient.nextAction(group);\n if (response) {\n const combined = response.items.map((item) => item.message);\n group.meta.paging = response?.meta.paging;\n group.writer.update(combined);\n }\n }\n }\n break;\n case 'help':\n {\n const loader = this.conversation.loading();\n\n const response = await this.httpClient.helpAction();\n loader();\n if (response) {\n this.onMessagesReceived(response);\n }\n }\n break;\n default:\n {\n if (typeof action !== 'string' && action.label) {\n this.printUserMessage(action.label);\n }\n const loader = this.conversation.loading();\n const response = await this.httpClient.defaultAction(actionKey);\n if (response) {\n this.onMessagesReceived(response);\n }\n loader();\n }\n break;\n }\n }\n\n private printUserMessage(message: string) {\n const group = createGroup({\n isUser: true,\n items: [\n {\n id: uuid(),\n isUser: true,\n message: [ConversationMessageListItemType.HTML, { body: message }],\n },\n ],\n });\n this.onMessagesReceived([group]);\n return group;\n }\n\n async onMessageSend(message: string) {\n const loader = this.conversation.loading();\n const response = await this.httpClient.sendMessage(message);\n\n this.printUserMessage(message);\n\n if (response) {\n this.onMessagesReceived(response);\n }\n loader();\n }\n\n private async onWidgetEntryReceived(data: ServerEntry['content']) {\n if (data.agent) {\n const agentSettings = {\n name: data.agent.name,\n avatar: data.agent.avatar,\n };\n this.agent.update(agentSettings);\n const write = await createStorageWriter(\n this.container,\n 'bot-provider-conversation-meta',\n StorageCategory.Necessary\n );\n write({\n agent: agentSettings,\n });\n }\n }\n}\n\nexport default KnowledgeBotProvider;\n","import {\n ConversationPlatform,\n registerCustomMessageComponent,\n} from '@telia-ace/widget-conversation';\nimport { Container, Widget } from '@webprovisions/platform';\nimport KnowledgeBotProvider from './provider';\nimport { CustomMessageTypes } from './types';\n\nconst KnowledgeBotProviderPlugin = async (container: Container) => {\n const platform = await ConversationPlatform.getInstance(container);\n\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.ContactList,\n import('./ui/contact-method-list')\n );\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.ContactMethod,\n import('./ui/contact-method')\n );\n registerCustomMessageComponent(\n container,\n 'ace-knowledge-bot-new-no-good-alternative', // TODO: remove new from name..\n import('./ui/new-no-good-alternative')\n );\n registerCustomMessageComponent(\n container,\n 'ace-knowledge-bot-new-feedback-list', // TODO: remove new from name..\n import('./ui/new-feedback-list')\n );\n registerCustomMessageComponent(\n container,\n 'ace-knowledge-bot-new-notification-list', // TODO: remove new from name..\n import('./ui/new-notification-list')\n );\n\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.NotificationList,\n import('./ui/notification-list')\n );\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.NoGoodAlternative,\n import('./ui/no-good-alternative')\n );\n registerCustomMessageComponent(\n container,\n CustomMessageTypes.FeedbackList,\n import('./ui/feedback-list')\n );\n\n platform.registerProvider('ace-knowledge-bot', (conversation, component) => {\n const provider = new KnowledgeBotProvider(container, conversation, component);\n provider.initialize();\n\n const subscriptions: any[] = [];\n subscriptions.push(\n component.actions.watch('conversation.user-submit', (input, next) => {\n provider.onMessageSend(input.text);\n })\n );\n\n subscriptions.push(\n component.actions.watch('conversation.action', (input, next) => {\n provider.onInput(input);\n\n return next(input);\n })\n );\n\n subscriptions.push(\n component.actions.create('evaluate', (input) => {\n const { events } = container.get('$widget') as Widget;\n events.dispatch('bot-provider:evaluate', input);\n })\n );\n\n subscriptions.push(\n component.actions.create('submit', (input) => {\n const { events } = container.get('$widget') as Widget;\n events.dispatch('bot-provider:form-submitted', input);\n })\n );\n\n return () => {\n // cleaning up when provider is disposed\n subscriptions.forEach((unsubscribe) => {\n unsubscribe();\n });\n };\n });\n};\n\nexport default KnowledgeBotProviderPlugin;\n"],"names":["CustomMessageTypes","convertLegacySymbol","symbol","type","content","createGroup","isUser","items","meta","groupId","uuid","i","contactMethodFromLegacy","id","title","defaultIcon","exit","exitType","confirmationText","expandFormAutomatically","form","description","options","adapter","clientName","adapterSettings","customClientName","validation","settings","displayTextBeforeClick","textBeforeClick","FormBuilder","updateForm","getListType","state","ConversationMessageListItemType","getKnowledgeBotEndpoint","container","component","knowledgeBotEndpoint","data","contactMethod","submit","errors","_a","body","builder","submitButton","__spreadProps","__spreadValues","createGroupItem","messageId","message","group","processEntries","entries","prevGroup","__async","createListContent","listType","entry","listContent","contactMethodIds","action","entryAction","transform","_0","_1","_2","related","header","html","result","pagingEntry","e","fallbackEntry","fallbackAction","contactMethodListEntry","dialogListEntry","feedbackEntry","contactMethodEntry","notice","splitEntry","acc","item","sortMap","filteredEntries","other","sortValue","sortValueOther","isNonVisibleRelatedEntry","relatedEntries","HttpClient","endpoint","events","store","silent","storedGlobalState","storedLocalState","storedEntries","envelope","paging","response","listItemIndex","actionItem","error","widgetEntry","fetchOptions","HttpClient$1","Store","key","readStorage","createStorageWriter","StorageCategory","Store$1","KnowledgeBotProvider","conversation","_event","loader","storedMeta","rehydrated","groups","actionKey","combined","agentSettings","KnowledgeBotProvider$1","KnowledgeBotProviderPlugin","platform","ConversationPlatform","registerCustomMessageComponent","provider","subscriptions","input","next","unsubscribe","KnowledgeBotProviderPlugin$1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEY,IAAAA,sBAAAA,OACRA,EAAA,gBAAgB,oCAChBA,EAAA,cAAc,kCACdA,EAAA,eAAe,mCACfA,EAAA,mBAAmB,uCACnBA,EAAA,oBAAoB,yCALZA,IAAAA,KAAA,CAAA,CAAA;ACSZ,MAAMC,IAAsB,CAACC,MAAmE;AAC5F,MAAIA,GAAQ;AACF,UAAA,EAAE,MAAAC,GAAM,SAAAC,EAAY,IAAAF;AAC1B,QAAIC,KAAQC;AACD,aAAA,EAAE,MAAAD,GAAM,SAAAC;EAEvB;AACJ,GAEaC,IAAc,CAAC;AAAA,EACxB,QAAAC;AAAA,EACA,OAAAC,IAAQ,CAAC;AAAA,EACT,MAAAC,IAAO,CAAC;AACZ,MAIM;AACF,QAAMC,IAAUC;AAgBT,SAdO;AAAA,IACV,IAAID;AAAA,IACJ,QAAAH;AAAA,IACA,OAAOC,EAAM,IAAI,CAACI,OACP;AAAA,MACH,IAAIA,EAAE,MAAMD,EAAK;AAAA,MACjB,QAAAJ;AAAA,MACA,SAAAG;AAAA,MACA,SAASE,EAAE,WAAW,CAAC;AAAA,IAAA,EAE9B;AAAA,IACD,MAAAH;AAAA,EAAA;AAIR,GAEaI,IAA0B,CACnC;AAAA,EACI,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAO,CAACC,CAAI;AAAA,EACZ,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,aAAAC;AACJ,GACAC,IAGI,CAAA,MACE;AACN,QAAM,EAAE,SAAAC,EAAQ,IAAIP,KAAQ,EAAE,SAAS,CAAG,EAAA,GACpC,EAAE,YAAAQ,IAAa,IAAI,UAAUC,IAAkB,CAAA,GAAI,kBAAAC,IAAmB,GA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ACnC,QAAAyD,EAAA,SAAS,yBAAyBsC,CAAK;AAAA,MAAA,CACjD;AAAA,IAAA,GAGSD,EAAA;AAAA,MACV7F,EAAU,QAAQ,OAAO,UAAU,CAAC8F,MAAU;AAC1C,cAAM,EAAE,QAAAtC,EAAW,IAAAzD,EAAU,IAAI,SAAS;AACnC,QAAAyD,EAAA,SAAS,+BAA+BsC,CAAK;AAAA,MAAA,CACvD;AAAA,IAAA,GAGE,MAAM;AAEK,MAAAD,EAAA,QAAQ,CAACG,MAAgB;AACvB,QAAAA;MAAA,CACf;AAAA,IAAA;AAAA,EACL,CACH;AACL,IAEAC,KAAeT;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { LitElement as u, html as l, unsafeCSS as b } from "lit";
|
|
2
|
+
import { property as d, customElement as p } from "lit/decorators.js";
|
|
3
|
+
const m = `ul{margin:var(--size-medium) 0;padding:0 var(--size-medium);list-style:none;display:flex;gap:var(--size-normal);flex-direction:column}ul>li{flex:1;margin:0}button{--button-primary: var(--colors-primary);--button-secondary: white;-webkit-appearance:button;text-transform:none;overflow:visible;outline:none;background-color:transparent;font-size:inherit;line-height:normal;margin:0;padding:0;cursor:pointer;text-align:center;border:none;padding:var(--size-normal);border-radius:var(--borderRadius);font-family:inherit;border:1px solid var(--button-primary, var(--colors-primary));background-color:var(--button-secondary, var(--colors-secondary));color:var(--button-primary, var(--colors-primary));transition:background-color .2s ease-out,color .2s ease-out;font-size:var(--fonts-normal);border-color:var(--colors-primary);font-weight:300;display:block;width:100%;display:flex;justify-content:center;align-items:center;gap:5px;padding:var(--size-medium)}button.active{border-color:var(--button-secondary, var(--colors-secondary));background-color:var(--button-primary, var(--colors-primary));color:var(--button-secondary, var(--colors-secondary))}button span,button i,button p,button a{transition:color .2s ease-out;color:inherit;font-size:var(--fonts-normal)}button:not([disabled]):hover{background-color:var(--button-primary, var(--colors-primary));color:var(--button-secondary, var(--colors-secondary))}button:not([disabled]):focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent}
|
|
4
|
+
`;
|
|
5
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, c = (o, r, e, n) => {
|
|
6
|
+
for (var t = n > 1 ? void 0 : n ? y(r, e) : r, i = o.length - 1, s; i >= 0; i--)
|
|
7
|
+
(s = o[i]) && (t = (n ? s(r, e, t) : s(t)) || t);
|
|
8
|
+
return n && t && v(r, e, t), t;
|
|
9
|
+
};
|
|
10
|
+
let a = class extends u {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), this.actions = [];
|
|
13
|
+
}
|
|
14
|
+
onClick(o, r) {
|
|
15
|
+
o.stopPropagation(), o.preventDefault();
|
|
16
|
+
const e = new CustomEvent("action", {
|
|
17
|
+
bubbles: !0,
|
|
18
|
+
cancelable: !0,
|
|
19
|
+
composed: !0,
|
|
20
|
+
detail: {
|
|
21
|
+
actionKey: r
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
this.dispatchEvent(e);
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return l`
|
|
28
|
+
<ul>
|
|
29
|
+
${this.actions.map((o) => l`
|
|
30
|
+
<li>
|
|
31
|
+
<button
|
|
32
|
+
aria-pressed=${!0}
|
|
33
|
+
data-selected=${!0}
|
|
34
|
+
@click=${(r) => this.onClick(r, o.actionKey)}
|
|
35
|
+
>
|
|
36
|
+
<ui-symbol-badge
|
|
37
|
+
.size=${14}
|
|
38
|
+
.symbol=${{
|
|
39
|
+
type: "FontAwesome",
|
|
40
|
+
content: o.actionKey === "yes" ? "smile-o" : "frown-o"
|
|
41
|
+
}}
|
|
42
|
+
></ui-symbol-badge>
|
|
43
|
+
<span>${o.label}</span>
|
|
44
|
+
</button>
|
|
45
|
+
</li>
|
|
46
|
+
`)}
|
|
47
|
+
</ul>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
a.styles = b(m);
|
|
52
|
+
c([
|
|
53
|
+
d({ type: String })
|
|
54
|
+
], a.prototype, "actions", 2);
|
|
55
|
+
a = c([
|
|
56
|
+
p("ace-knowledge-bot-feedback-list")
|
|
57
|
+
], a);
|
|
58
|
+
export {
|
|
59
|
+
a as FeedbackList
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=new-feedback-list.4dc450c7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-feedback-list.4dc450c7.js","sources":["../src/ui/new-feedback-list.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport styles from './feedback-list.scss?inline';\n\ntype FeedbackAction = {\n actionKey: string;\n label: string;\n};\n\n@customElement('ace-knowledge-bot-feedback-list')\nexport class FeedbackList extends LitElement {\n static styles = unsafeCSS(styles);\n\n @property({ type: String })\n declare actions: FeedbackAction[];\n\n constructor() {\n super();\n this.actions = [];\n }\n\n onClick(event: Event, key: string) {\n event.stopPropagation();\n event.preventDefault();\n const ev = new CustomEvent('action', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n actionKey: key,\n },\n });\n this.dispatchEvent(ev);\n }\n\n render() {\n return html`\n <ul>\n ${this.actions.map((item) => {\n return html`\n <li>\n <button\n aria-pressed=${true}\n data-selected=${true}\n @click=${(ev: Event) => this.onClick(ev, item.actionKey)}\n >\n <ui-symbol-badge\n .size=${14}\n .symbol=${{\n type: 'FontAwesome',\n content: item.actionKey === 'yes' ? 'smile-o' : 'frown-o',\n }}\n ></ui-symbol-badge>\n <span>${item.label}</span>\n </button>\n </li>\n `;\n })}\n </ul>\n `;\n }\n}\n"],"names":["FeedbackList","LitElement","event","key","ev","html","item","unsafeCSS","styles","__decorateClass","property","customElement"],"mappings":";;;;;;;;;AAUa,IAAAA,IAAN,cAA2BC,EAAW;AAAA,EAMzC,cAAc;AACJ,aACN,KAAK,UAAU;EACnB;AAAA,EAEA,QAAQC,GAAcC,GAAa;AAC/B,IAAAD,EAAM,gBAAgB,GACtBA,EAAM,eAAe;AACf,UAAAE,IAAK,IAAI,YAAY,UAAU;AAAA,MACjC,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,QAAQ;AAAA,QACJ,WAAWD;AAAA,MACf;AAAA,IAAA,CACH;AACD,SAAK,cAAcC,CAAE;AAAA,EACzB;AAAA,EAEA,SAAS;AACE,WAAAC;AAAA;AAAA,kBAEG,KAAK,QAAQ,IAAI,CAACC,MACTD;AAAA;AAAA;AAAA,+CAGoB;AAAA,gDACC;AAAA,yCACP,CAACD,MAAc,KAAK,QAAQA,GAAIE,EAAK,SAAS;AAAA;AAAA;AAAA,4CAG3C;AAAA,8CACE;AAAA,MACN,MAAM;AAAA,MACN,SAASA,EAAK,cAAc,QAAQ,YAAY;AAAA,IAAA;AAAA;AAAA,wCAGhDA,EAAK;AAAA;AAAA;AAAA,qBAI5B;AAAA;AAAA;AAAA,EAGb;AACJ;AAnDaN,EACF,SAASO,EAAUC,CAAM;AAGxBC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAHjBV,EAID,WAAA,WAAA,CAAA;AAJCA,IAANS,EAAA;AAAA,EADNE,EAAc,iCAAiC;AAAA,GACnCX,CAAA;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LitElement as c, html as p, unsafeCSS as b } from "lit";
|
|
2
|
+
import { property as u, customElement as d } from "lit/decorators.js";
|
|
3
|
+
const m = `.wrapper{display:flex;align-items:center;justify-content:center;margin:var(--size-medium) 0;padding:0 var(--size-medium)}button{padding:0;margin:0;line-height:normal;font-size:inherit;font-family:inherit;cursor:pointer;background-color:transparent;border:none;outline:none;appearance:button;font-weight:300;display:flex;gap:var(--size-small)}button>i,button svg{margin-right:var(--size-small)}button:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent}
|
|
4
|
+
`;
|
|
5
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, l = (o, t, i, r) => {
|
|
6
|
+
for (var e = r > 1 ? void 0 : r ? y(t, i) : t, s = o.length - 1, a; s >= 0; s--)
|
|
7
|
+
(a = o[s]) && (e = (r ? a(t, i, e) : a(e)) || e);
|
|
8
|
+
return r && e && v(t, i, e), e;
|
|
9
|
+
};
|
|
10
|
+
let n = class extends c {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), this.body = "";
|
|
13
|
+
}
|
|
14
|
+
onClick(o) {
|
|
15
|
+
o.stopPropagation(), o.preventDefault();
|
|
16
|
+
const t = new CustomEvent("action", {
|
|
17
|
+
bubbles: !0,
|
|
18
|
+
cancelable: !0,
|
|
19
|
+
composed: !0,
|
|
20
|
+
detail: {
|
|
21
|
+
actionKey: "help"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
this.dispatchEvent(t);
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return p`<div class="wrapper">
|
|
28
|
+
<button @click=${this.onClick} aria-label=${this.body} title=${this.body}>
|
|
29
|
+
<ui-symbol-badge
|
|
30
|
+
.size=${14}
|
|
31
|
+
.symbol=${{ type: "FontAwesome", content: "meh-o" }}
|
|
32
|
+
></ui-symbol-badge>
|
|
33
|
+
<span>${this.body}</span>
|
|
34
|
+
</button>
|
|
35
|
+
</div>`;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
n.styles = b(m);
|
|
39
|
+
l([
|
|
40
|
+
u({ type: String })
|
|
41
|
+
], n.prototype, "body", 2);
|
|
42
|
+
n = l([
|
|
43
|
+
d("ace-knowledge-bot-no-good-alternative")
|
|
44
|
+
], n);
|
|
45
|
+
export {
|
|
46
|
+
n as NoGoodAlternative
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=new-no-good-alternative.63439a76.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-no-good-alternative.63439a76.js","sources":["../src/ui/new-no-good-alternative.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport styles from './no-good-alternative.scss?inline';\n\n@customElement('ace-knowledge-bot-no-good-alternative')\nexport class NoGoodAlternative extends LitElement {\n static styles = unsafeCSS(styles);\n\n @property({ type: String })\n declare body: string;\n\n constructor() {\n super();\n\n this.body = '';\n }\n\n onClick(event: Event) {\n event.stopPropagation();\n event.preventDefault();\n const ev = new CustomEvent('action', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n actionKey: 'help',\n },\n });\n this.dispatchEvent(ev);\n }\n\n render() {\n return html`<div class=\"wrapper\">\n <button @click=${this.onClick} aria-label=${this.body} title=${this.body}>\n <ui-symbol-badge\n .size=${14}\n .symbol=${{ type: 'FontAwesome', content: 'meh-o' }}\n ></ui-symbol-badge>\n <span>${this.body}</span>\n </button>\n </div>`;\n }\n}\n"],"names":["NoGoodAlternative","LitElement","event","ev","html","unsafeCSS","styles","__decorateClass","property","customElement"],"mappings":";;;;;;;;;AAKa,IAAAA,IAAN,cAAgCC,EAAW;AAAA,EAM9C,cAAc;AACJ,aAEN,KAAK,OAAO;AAAA,EAChB;AAAA,EAEA,QAAQC,GAAc;AAClB,IAAAA,EAAM,gBAAgB,GACtBA,EAAM,eAAe;AACf,UAAAC,IAAK,IAAI,YAAY,UAAU;AAAA,MACjC,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,QAAQ;AAAA,QACJ,WAAW;AAAA,MACf;AAAA,IAAA,CACH;AACD,SAAK,cAAcA,CAAE;AAAA,EACzB;AAAA,EAEA,SAAS;AACE,WAAAC;AAAA,6BACc,KAAK,sBAAsB,KAAK,cAAc,KAAK;AAAA;AAAA,4BAEpD;AAAA,8BACE,EAAE,MAAM,eAAe,SAAS,QAAQ;AAAA;AAAA,wBAE9C,KAAK;AAAA;AAAA;AAAA,EAGzB;AACJ;AArCaJ,EACF,SAASK,EAAUC,CAAM;AAGxBC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAHjBR,EAID,WAAA,QAAA,CAAA;AAJCA,IAANO,EAAA;AAAA,EADNE,EAAc,uCAAuC;AAAA,GACzCT,CAAA;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement as f, html as c, unsafeCSS as m } from "lit";
|
|
2
|
+
import { property as a, customElement as v } from "lit/decorators.js";
|
|
3
|
+
const _ = "";
|
|
4
|
+
var u = Object.defineProperty, y = Object.getOwnPropertyDescriptor, l = (p, e, s, r) => {
|
|
5
|
+
for (var t = r > 1 ? void 0 : r ? y(e, s) : e, i = p.length - 1, n; i >= 0; i--)
|
|
6
|
+
(n = p[i]) && (t = (r ? n(e, s, t) : n(t)) || t);
|
|
7
|
+
return r && t && u(e, s, t), t;
|
|
8
|
+
};
|
|
9
|
+
let o = class extends f {
|
|
10
|
+
render() {
|
|
11
|
+
return c`notificationList`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
o.styles = m(_);
|
|
15
|
+
l([
|
|
16
|
+
a({ type: String })
|
|
17
|
+
], o.prototype, "propName", 2);
|
|
18
|
+
o = l([
|
|
19
|
+
v("ace-knowledge-bot-notification-list")
|
|
20
|
+
], o);
|
|
21
|
+
export {
|
|
22
|
+
o as NewNotificationList
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=new-notification-list.17d34093.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-notification-list.17d34093.js","sources":["../src/ui/new-notification-list.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport styles from './notification-list.scss?inline';\n// import {NotificationListUi} from '@telia-ace/knowledge-widget-ui';\n\n@customElement('ace-knowledge-bot-notification-list')\nexport class NewNotificationList extends LitElement {\n static styles = unsafeCSS(styles);\n\n @property({ type: String })\n declare propName: any;\n\n render() {\n return html`notificationList`;\n }\n}\n"],"names":["NewNotificationList","LitElement","html","unsafeCSS","styles","__decorateClass","property","customElement"],"mappings":";;;;;;;;AAMa,IAAAA,IAAN,cAAkCC,EAAW;AAAA,EAMhD,SAAS;AACE,WAAAC;AAAA,EACX;AACJ;AATaF,EACF,SAASG,EAAUC,CAAM;AAGxBC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAHjBN,EAID,WAAA,YAAA,CAAA;AAJCA,IAANK,EAAA;AAAA,EADNE,EAAc,qCAAqC;AAAA,GACvCP,CAAA;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type FeedbackAction = {
|
|
3
|
+
actionKey: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export declare class FeedbackList extends LitElement {
|
|
7
|
+
static styles: import("lit").CSSResult;
|
|
8
|
+
actions: FeedbackAction[];
|
|
9
|
+
constructor();
|
|
10
|
+
onClick(event: Event, key: string): void;
|
|
11
|
+
render(): import("lit").TemplateResult<1>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-bot-provider",
|
|
3
|
-
"version": "0.0.15-experimental.
|
|
3
|
+
"version": "0.0.15-experimental.8",
|
|
4
4
|
"description": "Bot Provider Plugin ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,27 +21,31 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-widget-adapters": "1.0.44-experimental.
|
|
25
|
-
"@telia-ace/knowledge-widget-types-grid": "1.0.45-experimental.
|
|
26
|
-
"@telia-ace/knowledge-widget-ui": "1.0.40-experimental.
|
|
27
|
-
"@telia-ace/widget-conversation": "^1.0.34-experimental.
|
|
28
|
-
"@telia-ace/widget-forms": "^1.0.28-experimental.
|
|
29
|
-
"@telia-ace/widget-services": "^1.0.21-experimental.
|
|
30
|
-
"@telia-ace/widget-
|
|
24
|
+
"@telia-ace/knowledge-widget-adapters": "1.0.44-experimental.8",
|
|
25
|
+
"@telia-ace/knowledge-widget-types-grid": "1.0.45-experimental.8",
|
|
26
|
+
"@telia-ace/knowledge-widget-ui": "1.0.40-experimental.8",
|
|
27
|
+
"@telia-ace/widget-conversation": "^1.0.34-experimental.18",
|
|
28
|
+
"@telia-ace/widget-forms": "^1.0.28-experimental.18",
|
|
29
|
+
"@telia-ace/widget-services": "^1.0.21-experimental.18",
|
|
30
|
+
"@telia-ace/widget-ui": "^1.0.28-experimental.18",
|
|
31
|
+
"@telia-ace/widget-utilities": "^1.0.10-experimental.18",
|
|
31
32
|
"@webprovisions/bootstrapping": "^1.0.12"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"@emotion/react": "^11.10.5",
|
|
35
36
|
"@emotion/styled": "^11.10.5",
|
|
37
|
+
"lit": "^2.6.0",
|
|
36
38
|
"react": "^18.2.0"
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
39
41
|
"@emotion/react": "^11.10.5",
|
|
40
42
|
"@emotion/styled": "^11.10.5",
|
|
41
|
-
"@telia-ace/knowledge-widget-core": "1.0.34-experimental.
|
|
43
|
+
"@telia-ace/knowledge-widget-core": "1.0.34-experimental.8",
|
|
42
44
|
"@types/react": "^18.0.26",
|
|
43
45
|
"@webprovisions/platform": "^1.1.2",
|
|
44
|
-
"
|
|
46
|
+
"lit": "^2.6.1",
|
|
47
|
+
"react": "^18.2.0",
|
|
48
|
+
"sass": "^1.57.1"
|
|
45
49
|
},
|
|
46
50
|
"scripts": {
|
|
47
51
|
"clean": "rimraf ./dist",
|