@telia-ace/knowledge-widget-adapters 1.0.44 → 1.0.45-next.1
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/contact-methods/platform.d.ts +1 -0
- package/dist/{email-form-component.c12f6804.js → email-form-component.fa2f8d54.js} +2 -2
- package/dist/{email-form-component.c12f6804.js.map → email-form-component.fa2f8d54.js.map} +1 -1
- package/dist/{free-text-component.c06abc12.js → free-text-component.692c762b.js} +2 -2
- package/dist/{free-text-component.c06abc12.js.map → free-text-component.692c762b.js.map} +1 -1
- package/dist/{index.c1d1bd5b.js → index.5fee08c6.js} +121 -124
- package/dist/index.5fee08c6.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +8 -8
- package/dist/index.c1d1bd5b.js.map +0 -1
|
@@ -37,6 +37,7 @@ declare class ContactMethodPlatform {
|
|
|
37
37
|
private adapters;
|
|
38
38
|
private subs;
|
|
39
39
|
static create(container: Container): Promise<ContactMethodPlatform>;
|
|
40
|
+
handleAdapters(cm: ContactMethodProps): Promise<ContactMethodProps>;
|
|
40
41
|
constructor(container: Container, componentPlatform: ComponentPlatform);
|
|
41
42
|
static getInstance(container: Container, key?: string): Promise<ContactMethodPlatform>;
|
|
42
43
|
private track;
|
|
@@ -15,7 +15,7 @@ import g from "@emotion/styled";
|
|
|
15
15
|
import { Html as F, genericHtml as H, headingElement as $ } from "@telia-ace/knowledge-widget-ui";
|
|
16
16
|
import { appendClassNames as l } from "@telia-ace/widget-utilities";
|
|
17
17
|
import s from "react";
|
|
18
|
-
import { F as b } from "./index.
|
|
18
|
+
import { F as b } from "./index.5fee08c6.js";
|
|
19
19
|
import "@telia-ace/widget-forms";
|
|
20
20
|
import "@telia-ace/knowledge-widget-core";
|
|
21
21
|
const C = g(F)`
|
|
@@ -62,4 +62,4 @@ const C = g(F)`
|
|
|
62
62
|
export {
|
|
63
63
|
k as default
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=email-form-component.
|
|
65
|
+
//# sourceMappingURL=email-form-component.fa2f8d54.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-form-component.
|
|
1
|
+
{"version":3,"file":"email-form-component.fa2f8d54.js","sources":["../src/contact-methods/email/email-form-component.tsx"],"sourcesContent":["import { css } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { genericHtml, headingElement, Html } from '@telia-ace/knowledge-widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React from 'react';\nimport { ContactMethodProps, Form } from '../ui';\n\nconst StyledHtml = styled(Html)`\n ${genericHtml}\n\n ${(p) =>\n headingElement(p)(\n 'h1',\n css`\n font-weight: normal;\n font-size: ${p.theme.fonts?.medium};\n `\n )}\n`;\n\nconst EmailFormComponent: React.FC<ContactMethodProps> = (props) => {\n const {\n className,\n renderDefault = () => {},\n body: { form },\n confirmation,\n htmlParseInstruction,\n disabled,\n } = props;\n\n if (confirmation) {\n return (\n <StyledHtml\n className={appendClassNames(\n className,\n 'humany-contact-method-confirmation',\n 'humany-contact-method-email'\n )}\n html={confirmation}\n htmlParseInstruction={htmlParseInstruction}\n />\n );\n }\n\n if (form && !disabled) {\n return (\n <Form\n {...props}\n className={appendClassNames(className, 'humany-contact-method-email')}\n />\n );\n }\n\n return renderDefault();\n};\n\nexport default EmailFormComponent;\n"],"names":["StyledHtml","styled","Html","genericHtml","p","headingElement","css","_a","EmailFormComponent","props","className","renderDefault","form","confirmation","htmlParseInstruction","disabled","React","appendClassNames","Form","__spreadProps","__spreadValues"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,MAAMA,IAAaC,EAAOC,CAAI;AAAA,MACxBC;AAAA;AAAA,MAEA,CAACC;;AACC,SAAAC,EAAeD,CAAC;AAAA,IACZ;AAAA,IACAE;AAAA;AAAA,8BAEiBC,IAAAH,EAAE,MAAM,UAAR,gBAAAG,EAAe;AAAA;AAAA,EAEpC;AAAA;AAAA,GAGFC,IAAmD,CAACC,MAAU;AAC1D,QAAA;AAAA,IACF,WAAAC;AAAA,IACA,eAAAC,IAAgB,MAAM;AAAA,IAAC;AAAA,IACvB,MAAM,EAAE,MAAAC,EAAK;AAAA,IACb,cAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,UAAAC;AAAA,EACA,IAAAN;AAEJ,SAAII,IAEI,gBAAAG,EAAA;AAAA,IAAChB;AAAA,IAAA;AAAA,MACG,WAAWiB;AAAA,QACPP;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,MACA,MAAMG;AAAA,MACN,sBAAAC;AAAA,IAAA;AAAA,EAAA,IAKRF,KAAQ,CAACG,IAEL,gBAAAC,EAAA;AAAA,IAACE;AAAA,IAAAC,EAAAC,EAAA,IACOX,IADP;AAAA,MAEG,WAAWQ,EAAiBP,GAAW,6BAA6B;AAAA,IAAA;AAAA,EAAA,IAKzEC,EAAc;AACzB;"}
|
|
@@ -2,7 +2,7 @@ import l from "@emotion/styled";
|
|
|
2
2
|
import { Html as a, genericHtml as n } from "@telia-ace/knowledge-widget-ui";
|
|
3
3
|
import { appendClassNames as p } from "@telia-ace/widget-utilities";
|
|
4
4
|
import t from "react";
|
|
5
|
-
import { D as i } from "./index.
|
|
5
|
+
import { D as i } from "./index.5fee08c6.js";
|
|
6
6
|
import "@telia-ace/widget-forms";
|
|
7
7
|
import "@telia-ace/knowledge-widget-core";
|
|
8
8
|
import "@emotion/react";
|
|
@@ -17,4 +17,4 @@ const x = ({
|
|
|
17
17
|
export {
|
|
18
18
|
x as default
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=free-text-component.
|
|
20
|
+
//# sourceMappingURL=free-text-component.692c762b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"free-text-component.
|
|
1
|
+
{"version":3,"file":"free-text-component.692c762b.js","sources":["../src/contact-methods/free-text/free-text-component.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { genericHtml, Html } from '@telia-ace/knowledge-widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React from 'react';\nimport { ContactMethodProps, Description } from '../ui';\n\nconst FreeTextComponent: React.FC<ContactMethodProps> = ({\n className,\n description,\n body: { freetext },\n htmlParseInstruction,\n}) => {\n if (!freetext) {\n return null;\n }\n return (\n <div className={appendClassNames(className, 'humany-contact-method-free-text')}>\n <StyledHtml html={freetext} htmlParseInstruction={htmlParseInstruction} />\n {description && (\n <Description html={description} htmlParseInstruction={htmlParseInstruction} />\n )}\n </div>\n );\n};\n\nexport default FreeTextComponent;\n\nconst StyledHtml = styled(Html)`\n ${genericHtml};\n`;\n"],"names":["FreeTextComponent","className","description","freetext","htmlParseInstruction","appendClassNames","React","StyledHtml","Description","styled","Html","genericHtml"],"mappings":";;;;;;;;AAMA,MAAMA,IAAkD,CAAC;AAAA,EACrD,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAM,EAAE,UAAAC,EAAS;AAAA,EACjB,sBAAAC;AACJ,MACSD,oCAIA,OAAI,EAAA,WAAWE,EAAiBJ,GAAW,iCAAiC,KACxE,gBAAAK,EAAA,cAAAC,GAAA,EAAW,MAAMJ,GAAU,sBAAAC,EAAA,CAA4C,GACvEF,KACG,gBAAAI,EAAA,cAACE,KAAY,MAAMN,GAAa,sBAAAE,GAA4C,CAEpF,IARO,MAcTG,IAAaE,EAAOC,CAAI;AAAA,MACxBC;AAAA;"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var W = Object.defineProperty, J = Object.defineProperties;
|
|
2
|
+
var Q = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var P = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var D = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var N = (n, e, t) => e in n ? W(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, u = (n, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
D.call(e, t) && N(n, t, e[t]);
|
|
8
8
|
if (P)
|
|
9
9
|
for (var t of P(e))
|
|
10
|
-
|
|
10
|
+
L.call(e, t) && N(n, t, e[t]);
|
|
11
11
|
return n;
|
|
12
|
-
}, y = (n, e) =>
|
|
12
|
+
}, y = (n, e) => J(n, Q(e));
|
|
13
13
|
var C = (n, e) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var o in n)
|
|
16
|
-
|
|
16
|
+
D.call(n, o) && e.indexOf(o) < 0 && (t[o] = n[o]);
|
|
17
17
|
if (n != null && P)
|
|
18
18
|
for (var o of P(n))
|
|
19
|
-
e.indexOf(o) < 0 &&
|
|
19
|
+
e.indexOf(o) < 0 && L.call(n, o) && (t[o] = n[o]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var A = (n, e, t) => (N(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
23
23
|
var b = (n, e, t) => new Promise((o, a) => {
|
|
24
24
|
var c = (r) => {
|
|
25
25
|
try {
|
|
@@ -36,15 +36,15 @@ var b = (n, e, t) => new Promise((o, a) => {
|
|
|
36
36
|
}, i = (r) => r.done ? o(r.value) : Promise.resolve(r.value).then(c, s);
|
|
37
37
|
i((t = t.apply(n, e)).next());
|
|
38
38
|
});
|
|
39
|
-
import { FormBuilder as
|
|
40
|
-
import { ComponentPlatform as
|
|
41
|
-
import { css as
|
|
39
|
+
import { FormBuilder as X, FormReader as S, FormComponent as Y } from "@telia-ace/widget-forms";
|
|
40
|
+
import { ComponentPlatform as T, Plugin as Z } from "@telia-ace/knowledge-widget-core";
|
|
41
|
+
import { css as M } from "@emotion/react";
|
|
42
42
|
import $ from "@emotion/styled";
|
|
43
|
-
import { Html as
|
|
44
|
-
import { lock as he, createParams as
|
|
45
|
-
import m, { lazy as
|
|
46
|
-
const
|
|
47
|
-
const { formData: a } = new
|
|
43
|
+
import { Html as _, genericHtml as ee, borderTabStyle as j, linkTabStyle as te, useComponent as ne, useRouteData as oe, Typography as ae, StyledText as re, Link as se, SymbolBadge as ie, itemList as ce, headingElement as le, ItemList as de, useContainer as me } from "@telia-ace/knowledge-widget-ui";
|
|
44
|
+
import { lock as he, createParams as ue, formatUrl as pe, appendClassNames as fe } from "@telia-ace/widget-utilities";
|
|
45
|
+
import m, { lazy as ge, Suspense as ye, useState as be, useEffect as ve } from "react";
|
|
46
|
+
const x = (n, e, t = !1) => n.getManyAsync("matchingClient", "router").then((o) => {
|
|
47
|
+
const { formData: a } = new S(e.body.form).export(t), { router: c, matchingClient: s } = o, { params: i } = c.getRouteData();
|
|
48
48
|
return s.customRequest(
|
|
49
49
|
`contactmethods/${e.id}${t ? "/validatedwithpayload" : ""}`,
|
|
50
50
|
"POST",
|
|
@@ -55,35 +55,35 @@ const A = (n, e, t = !1) => n.getManyAsync("matchingClient", "router").then((o)
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
|
-
}),
|
|
58
|
+
}), O = (n, e, t) => x(n, e).then((o) => t ? t(o) : o).then(({ ConfirmationText: o }) => o), k = (n, e) => x(n, e, !0).then((t) => ({
|
|
59
59
|
valid: t.Validation.IsValid,
|
|
60
60
|
errors: t.Validation.Errors,
|
|
61
61
|
errorTypes: t.Validation.ErrorTypes
|
|
62
|
-
})),
|
|
63
|
-
(t) =>
|
|
62
|
+
})), H = (n, e) => x(n, e, !0).then(
|
|
63
|
+
(t) => X.fromLegacyForm(e.id, t.ContactMethod.Form).get()
|
|
64
64
|
), w = (n, e) => n.getAsync("matchingClient").then((t) => {
|
|
65
65
|
t.completeContactMethod(e.id);
|
|
66
66
|
});
|
|
67
|
-
function
|
|
67
|
+
function Ce(n) {
|
|
68
68
|
n.getAsync("contactMethods").then((e) => {
|
|
69
69
|
e.create({
|
|
70
70
|
clientName: "email.form",
|
|
71
|
-
render: import("./email-form-component.
|
|
72
|
-
onEvaluate: (t) =>
|
|
71
|
+
render: import("./email-form-component.fa2f8d54.js"),
|
|
72
|
+
onEvaluate: (t) => H(n, t),
|
|
73
73
|
onValidate: (t) => k(n, t),
|
|
74
|
-
onSubmit: (t) =>
|
|
74
|
+
onSubmit: (t) => O(n, t),
|
|
75
75
|
onComplete: (t) => w(n, t)
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
const
|
|
79
|
+
const F = (n, e, t) => {
|
|
80
80
|
const { url: o, width: a, height: c } = e, s = t || {}, i = document.createElement("a");
|
|
81
81
|
return i.href = o, i.search.replace("?", "").split("&").forEach((r) => {
|
|
82
82
|
const [l, d] = r.split("=");
|
|
83
83
|
typeof d != "undefined" && (s[l] = d);
|
|
84
84
|
}), i.search = Object.keys(s).map((r) => `${r}=${s[r]}`).join("&"), window.open(i.href, n, `width=${a},height=${c}`), "";
|
|
85
85
|
};
|
|
86
|
-
function
|
|
86
|
+
function $e(n) {
|
|
87
87
|
n.getAsync("contactMethods").then((e) => {
|
|
88
88
|
e.create({
|
|
89
89
|
clientName: "chat.popup",
|
|
@@ -92,27 +92,27 @@ function ke(n) {
|
|
|
92
92
|
const { title: o, body: a } = t, l = a, { form: c, guideId: s, confirmationFallback: i } = l, r = C(l, ["form", "guideId", "confirmationFallback"]);
|
|
93
93
|
return c ? () => {
|
|
94
94
|
} : (d) => {
|
|
95
|
-
d.preventDefault(),
|
|
95
|
+
d.preventDefault(), F(o, r);
|
|
96
96
|
};
|
|
97
97
|
},
|
|
98
98
|
onValidate: (t) => k(n, t),
|
|
99
99
|
onComplete: (t) => w(n, t),
|
|
100
100
|
onSubmit: (t) => {
|
|
101
|
-
const { title: o, body: a } = t, d = a, { form: c, guideId: s, confirmationFallback: i } = d, r = C(d, ["form", "guideId", "confirmationFallback"]), l = new
|
|
102
|
-
return
|
|
101
|
+
const { title: o, body: a } = t, d = a, { form: c, guideId: s, confirmationFallback: i } = d, r = C(d, ["form", "guideId", "confirmationFallback"]), l = new S(c).export().values;
|
|
102
|
+
return F(o, r, l), i;
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function ke(n) {
|
|
108
108
|
n.getAsync("contactMethods").then((e) => {
|
|
109
109
|
e.create({
|
|
110
110
|
clientName: "custom.freetext",
|
|
111
|
-
render: import("./free-text-component.
|
|
111
|
+
render: import("./free-text-component.692c762b.js")
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function we(n) {
|
|
116
116
|
n.getAsync("contactMethods").then((e) => {
|
|
117
117
|
e.create({
|
|
118
118
|
clientName: "custom.link",
|
|
@@ -120,7 +120,7 @@ function Pe(n) {
|
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Pe(n) {
|
|
124
124
|
n.getAsync("contactMethods").then((e) => {
|
|
125
125
|
e.create({
|
|
126
126
|
clientName: "phone.text",
|
|
@@ -128,31 +128,29 @@ function Ee(n) {
|
|
|
128
128
|
});
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const Ee = (n, e) => b(void 0, null, function* () {
|
|
132
132
|
const t = n.get(e.clientName);
|
|
133
133
|
let { description: o, disabled: a, onClick: c } = e;
|
|
134
134
|
if (t) {
|
|
135
135
|
const { handleClick: s, handleDescription: i, handleDisabled: r } = t;
|
|
136
136
|
typeof s == "function" && (c = yield Promise.resolve(s(e))), typeof i == "function" && (o = yield Promise.resolve(i(e))), typeof r == "function" && (a = yield Promise.resolve(r(e)));
|
|
137
137
|
}
|
|
138
|
-
return Promise.resolve(y(
|
|
138
|
+
return Promise.resolve(y(u({}, e), {
|
|
139
139
|
description: o,
|
|
140
140
|
disabled: a,
|
|
141
141
|
onClick: c
|
|
142
142
|
}));
|
|
143
143
|
});
|
|
144
|
-
class
|
|
144
|
+
class E {
|
|
145
145
|
constructor(e, t) {
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
A(this, "adapters", /* @__PURE__ */ new Map());
|
|
147
|
+
A(this, "subs", []);
|
|
148
148
|
if (this.container = e, this.componentPlatform = t, t) {
|
|
149
149
|
t.components().ofType("contact-list").select().actions.watch("contact-list.fetched", (s, i) => b(this, null, function* () {
|
|
150
150
|
const { contactMethods: r } = s;
|
|
151
151
|
if (r) {
|
|
152
152
|
const l = Promise.all(
|
|
153
|
-
r.map(
|
|
154
|
-
(d) => E(this.adapters, d)
|
|
155
|
-
)
|
|
153
|
+
r.map((d) => this.handleAdapters(d))
|
|
156
154
|
);
|
|
157
155
|
yield Promise.resolve(l).then((d) => {
|
|
158
156
|
s.contactMethods = d;
|
|
@@ -165,9 +163,7 @@ class N {
|
|
|
165
163
|
const { contactMethods: r } = s;
|
|
166
164
|
if (r) {
|
|
167
165
|
const l = Promise.all(
|
|
168
|
-
r.map(
|
|
169
|
-
(d) => E(this.adapters, d)
|
|
170
|
-
)
|
|
166
|
+
r.map((d) => this.handleAdapters(d))
|
|
171
167
|
);
|
|
172
168
|
yield Promise.resolve(l).then((d) => {
|
|
173
169
|
s.contactMethods = d;
|
|
@@ -179,7 +175,7 @@ class N {
|
|
|
179
175
|
if (r) {
|
|
180
176
|
const l = Promise.all(
|
|
181
177
|
r.map(
|
|
182
|
-
(d) =>
|
|
178
|
+
(d) => this.handleAdapters(d)
|
|
183
179
|
)
|
|
184
180
|
);
|
|
185
181
|
yield Promise.resolve(l).then((d) => {
|
|
@@ -189,19 +185,20 @@ class N {
|
|
|
189
185
|
return i(s);
|
|
190
186
|
})), t.components().ofType("contact-method").select().actions.watch("contact-method.fetched", (s, i) => b(this, null, function* () {
|
|
191
187
|
const { contactMethod: r } = s;
|
|
192
|
-
return r ?
|
|
193
|
-
(l) => i(y(h({}, s), { contactMethod: l }))
|
|
194
|
-
) : i(s);
|
|
188
|
+
return r ? this.handleAdapters(r).then((l) => i(y(u({}, s), { contactMethod: l }))) : i(s);
|
|
195
189
|
}));
|
|
196
190
|
}
|
|
197
191
|
}
|
|
198
192
|
static create(e) {
|
|
199
|
-
return
|
|
193
|
+
return T.getInstance(e).then((t) => new E(e, t));
|
|
194
|
+
}
|
|
195
|
+
handleAdapters(e) {
|
|
196
|
+
return Ee(this.adapters, e);
|
|
200
197
|
}
|
|
201
198
|
static getInstance(e, t = "contactMethods") {
|
|
202
199
|
return he(e)(() => e.getAsync(t).then((o) => {
|
|
203
200
|
let a = o;
|
|
204
|
-
return a ||
|
|
201
|
+
return a || T.getInstance(e).then((c) => (a = new E(e, c), e.registerAsync(t, () => a), a));
|
|
205
202
|
}));
|
|
206
203
|
}
|
|
207
204
|
track(e = {}, t) {
|
|
@@ -242,15 +239,15 @@ class N {
|
|
|
242
239
|
}
|
|
243
240
|
create(e) {
|
|
244
241
|
const { clientName: t, render: o } = e;
|
|
245
|
-
return this.adapters.set(t,
|
|
242
|
+
return this.adapters.set(t, u({
|
|
246
243
|
onValidate: (a) => k(this.container, a),
|
|
247
|
-
onEvaluate: (a) =>
|
|
244
|
+
onEvaluate: (a) => H(this.container, a),
|
|
248
245
|
onComplete: (a) => w(this.container, a)
|
|
249
246
|
}, e)), this.container.getAsync("componentResolver").then((a) => {
|
|
250
247
|
typeof o == "string" ? this.subs.push(a.registerAlias(t, o)) : this.subs.push(
|
|
251
248
|
a.registerComponent(
|
|
252
249
|
t,
|
|
253
|
-
|
|
250
|
+
ge(() => o)
|
|
254
251
|
)
|
|
255
252
|
);
|
|
256
253
|
});
|
|
@@ -259,92 +256,92 @@ class N {
|
|
|
259
256
|
this.subs.forEach((e) => e());
|
|
260
257
|
}
|
|
261
258
|
}
|
|
262
|
-
const Ue =
|
|
263
|
-
${
|
|
259
|
+
const Ue = E, Ne = $(_)`
|
|
260
|
+
${ee}
|
|
264
261
|
font-weight: 300;
|
|
265
262
|
line-height: 1.5em;
|
|
266
263
|
button:focus-visible {
|
|
267
|
-
${
|
|
264
|
+
${j};
|
|
268
265
|
}
|
|
269
266
|
|
|
270
267
|
a:focus-visible {
|
|
271
|
-
${
|
|
268
|
+
${te};
|
|
272
269
|
}
|
|
273
|
-
`,
|
|
274
|
-
const e =
|
|
270
|
+
`, Ae = (n) => {
|
|
271
|
+
const e = ne(n.clientName), {
|
|
275
272
|
params: { contactCategory: t, guideCategory: o, phrase: a }
|
|
276
|
-
} =
|
|
273
|
+
} = oe();
|
|
277
274
|
if (typeof e == "undefined")
|
|
278
275
|
return null;
|
|
279
276
|
if (e === null)
|
|
280
277
|
return process.env.NODE_ENV !== "production" ? /* @__PURE__ */ m.createElement(
|
|
281
|
-
|
|
278
|
+
Ie,
|
|
282
279
|
{
|
|
283
280
|
title: `client-name: ${n.clientName}, id: ${n.id}`,
|
|
284
281
|
className: "humany-non-resolved-contact-method"
|
|
285
282
|
},
|
|
286
|
-
/* @__PURE__ */ m.createElement(
|
|
283
|
+
/* @__PURE__ */ m.createElement(ae, { variant: "h5" }, "Non resolved Contact Method type")
|
|
287
284
|
) : null;
|
|
288
285
|
const c = (s = {}) => {
|
|
289
|
-
const i =
|
|
286
|
+
const i = u(u({}, n), s), {
|
|
290
287
|
id: r,
|
|
291
288
|
title: l,
|
|
292
289
|
clientName: d,
|
|
293
|
-
symbol:
|
|
290
|
+
symbol: h,
|
|
294
291
|
inline: g,
|
|
295
292
|
onClick: v = () => {
|
|
296
293
|
},
|
|
297
294
|
description: f,
|
|
298
|
-
htmlParseInstruction:
|
|
299
|
-
className:
|
|
300
|
-
disabled:
|
|
301
|
-
guideId:
|
|
302
|
-
dispatch:
|
|
295
|
+
htmlParseInstruction: I,
|
|
296
|
+
className: B,
|
|
297
|
+
disabled: K,
|
|
298
|
+
guideId: G,
|
|
299
|
+
dispatch: R = () => {
|
|
303
300
|
},
|
|
304
|
-
expanded:
|
|
305
|
-
} = i,
|
|
301
|
+
expanded: V
|
|
302
|
+
} = i, U = g ? {
|
|
306
303
|
onKeyDown: (p) => {
|
|
307
|
-
p.key && p.key === "Enter" && (v(p, i), p.defaultPrevented || !
|
|
304
|
+
p.key && p.key === "Enter" && (v(p, i), p.defaultPrevented || !V && R("expand", r));
|
|
308
305
|
},
|
|
309
306
|
onClick: (p) => {
|
|
310
|
-
v(p, i), p.defaultPrevented || !
|
|
307
|
+
v(p, i), p.defaultPrevented || !V && R("expand", r);
|
|
311
308
|
}
|
|
312
309
|
} : {
|
|
313
310
|
onClick: (p) => v(p, i),
|
|
314
311
|
routeName: "contact-method",
|
|
315
|
-
params:
|
|
312
|
+
params: ue({
|
|
316
313
|
contactCategory: t,
|
|
317
|
-
guideId:
|
|
314
|
+
guideId: G,
|
|
318
315
|
guideCategory: o,
|
|
319
316
|
phrase: a,
|
|
320
317
|
contactMethod: r,
|
|
321
|
-
uriName:
|
|
318
|
+
uriName: pe(l)
|
|
322
319
|
})
|
|
323
320
|
};
|
|
324
321
|
return /* @__PURE__ */ m.createElement(
|
|
325
|
-
|
|
326
|
-
|
|
322
|
+
xe,
|
|
323
|
+
u(u({
|
|
327
324
|
title: l,
|
|
328
325
|
"aria-label": l,
|
|
329
|
-
className:
|
|
330
|
-
disabled:
|
|
326
|
+
className: B,
|
|
327
|
+
disabled: K,
|
|
331
328
|
description: f,
|
|
332
329
|
"data-client-name": d
|
|
333
|
-
}, s),
|
|
334
|
-
|
|
335
|
-
f ? /* @__PURE__ */ m.createElement("div", { className: "humany-contact-link-rich-content" }, /* @__PURE__ */ m.createElement(
|
|
330
|
+
}, s), U),
|
|
331
|
+
h && /* @__PURE__ */ m.createElement(ie, { symbol: h }),
|
|
332
|
+
f ? /* @__PURE__ */ m.createElement("div", { className: "humany-contact-link-rich-content" }, /* @__PURE__ */ m.createElement(z, null, l), /* @__PURE__ */ m.createElement(
|
|
336
333
|
Ne,
|
|
337
334
|
{
|
|
338
335
|
html: f,
|
|
339
|
-
htmlParseInstruction:
|
|
336
|
+
htmlParseInstruction: I
|
|
340
337
|
}
|
|
341
|
-
)) : /* @__PURE__ */ m.createElement(
|
|
338
|
+
)) : /* @__PURE__ */ m.createElement(z, null, l)
|
|
342
339
|
);
|
|
343
340
|
};
|
|
344
|
-
return n.expanded ? /* @__PURE__ */ m.createElement(
|
|
345
|
-
},
|
|
341
|
+
return n.expanded ? /* @__PURE__ */ m.createElement(ye, { fallback: null }, /* @__PURE__ */ m.createElement(e, y(u({}, n), { renderDefault: c }))) : c();
|
|
342
|
+
}, Me = Ae, Se = (n) => {
|
|
346
343
|
var e, t, o, a, c, s, i, r;
|
|
347
|
-
return
|
|
344
|
+
return M`
|
|
348
345
|
display: flex;
|
|
349
346
|
padding: ${(e = n.theme.sizes) == null ? void 0 : e.large};
|
|
350
347
|
${n.description ? "" : "align-items: center;"}
|
|
@@ -364,18 +361,18 @@ const Ue = N, Ne = $(ee)`
|
|
|
364
361
|
color: ${(r = n.theme.colors) == null ? void 0 : r.text};
|
|
365
362
|
}
|
|
366
363
|
`;
|
|
367
|
-
},
|
|
364
|
+
}, z = $(re)`
|
|
368
365
|
line-height: ${(n) => {
|
|
369
366
|
var e;
|
|
370
367
|
return (e = n.theme.fonts) == null ? void 0 : e.large;
|
|
371
368
|
}};
|
|
372
|
-
`,
|
|
373
|
-
${(n) =>
|
|
369
|
+
`, xe = $(se)`
|
|
370
|
+
${(n) => Se(n)}
|
|
374
371
|
|
|
375
372
|
&:focus-visible {
|
|
376
|
-
${
|
|
373
|
+
${j};
|
|
377
374
|
}
|
|
378
|
-
`,
|
|
375
|
+
`, Ie = $.div`
|
|
379
376
|
text-align: center;
|
|
380
377
|
display: block;
|
|
381
378
|
${(n) => {
|
|
@@ -384,15 +381,15 @@ const Ue = N, Ne = $(ee)`
|
|
|
384
381
|
}}
|
|
385
382
|
`, Re = (n) => {
|
|
386
383
|
var e, t, o;
|
|
387
|
-
return
|
|
388
|
-
${
|
|
384
|
+
return M`
|
|
385
|
+
${ce(n)}
|
|
389
386
|
|
|
390
387
|
> div {
|
|
391
388
|
padding: ${(e = n.theme.sizes) == null ? void 0 : e.large};
|
|
392
389
|
|
|
393
|
-
${
|
|
390
|
+
${le(n)(
|
|
394
391
|
"h1",
|
|
395
|
-
|
|
392
|
+
M`
|
|
396
393
|
margin: 0;
|
|
397
394
|
`
|
|
398
395
|
)}
|
|
@@ -435,7 +432,7 @@ const Ue = N, Ne = $(ee)`
|
|
|
435
432
|
}
|
|
436
433
|
}
|
|
437
434
|
`;
|
|
438
|
-
}, Ve = $(
|
|
435
|
+
}, Ve = $(de)`
|
|
439
436
|
${(n) => Re(n)}
|
|
440
437
|
`, De = ({
|
|
441
438
|
contactMethods: n,
|
|
@@ -451,11 +448,11 @@ const Ue = N, Ne = $(ee)`
|
|
|
451
448
|
Ve,
|
|
452
449
|
{
|
|
453
450
|
header: i,
|
|
454
|
-
className:
|
|
451
|
+
className: fe(a, "humany-contact-list"),
|
|
455
452
|
items: n,
|
|
456
453
|
renderItem: c ? (r) => /* @__PURE__ */ m.createElement("li", { key: r.id, "data-contact-method": r.id }, c(r, { action: s, dispatch: o, guideId: t })) : (r) => /* @__PURE__ */ m.createElement("li", { key: r.id, "data-contact-method": r.id }, /* @__PURE__ */ m.createElement(
|
|
457
|
-
|
|
458
|
-
y(
|
|
454
|
+
Me,
|
|
455
|
+
y(u({}, r), {
|
|
459
456
|
action: s,
|
|
460
457
|
dispatch: o,
|
|
461
458
|
guideId: t
|
|
@@ -463,7 +460,7 @@ const Ue = N, Ne = $(ee)`
|
|
|
463
460
|
))
|
|
464
461
|
},
|
|
465
462
|
e
|
|
466
|
-
) : null, We = De,
|
|
463
|
+
) : null, We = De, q = (n, e) => {
|
|
467
464
|
if (n.actionKey === e)
|
|
468
465
|
return n;
|
|
469
466
|
if (!n.properties)
|
|
@@ -471,7 +468,7 @@ const Ue = N, Ne = $(ee)`
|
|
|
471
468
|
const t = Object.keys(n.properties);
|
|
472
469
|
let o;
|
|
473
470
|
for (let a = 0; a < t.length; a++)
|
|
474
|
-
if (o =
|
|
471
|
+
if (o = q(n.properties[t[a]], e), o)
|
|
475
472
|
return o;
|
|
476
473
|
return !1;
|
|
477
474
|
}, Le = ({
|
|
@@ -484,10 +481,10 @@ const Ue = N, Ne = $(ee)`
|
|
|
484
481
|
autoFocus: s
|
|
485
482
|
}) => {
|
|
486
483
|
if (e && !c) {
|
|
487
|
-
const { schema: i, layout: r, data: l, meta: d } = e,
|
|
484
|
+
const { schema: i, layout: r, data: l, meta: d } = e, h = a || o || (() => {
|
|
488
485
|
});
|
|
489
486
|
return /* @__PURE__ */ m.createElement(
|
|
490
|
-
|
|
487
|
+
Y,
|
|
491
488
|
{
|
|
492
489
|
className: n,
|
|
493
490
|
schema: i,
|
|
@@ -496,15 +493,15 @@ const Ue = N, Ne = $(ee)`
|
|
|
496
493
|
autoFocus: s,
|
|
497
494
|
onChange: (g, v) => {
|
|
498
495
|
const f = { schema: i, layout: r, data: v, meta: d };
|
|
499
|
-
g.toString() === "submit" ?
|
|
496
|
+
g.toString() === "submit" ? h("submit", { id: t, form: f }) : q(i, g).evaluate ? h("evaluate", { id: t, form: f }) : h("validate", { id: t, form: f });
|
|
500
497
|
}
|
|
501
498
|
}
|
|
502
499
|
);
|
|
503
500
|
}
|
|
504
501
|
return null;
|
|
505
502
|
}, Je = Le, Te = (n) => {
|
|
506
|
-
const [e, t] =
|
|
507
|
-
return
|
|
503
|
+
const [e, t] = be(null), o = me();
|
|
504
|
+
return ve(() => {
|
|
508
505
|
let a;
|
|
509
506
|
return o.getAsync("componentResolver").then((c) => {
|
|
510
507
|
a = c.registerResolver(
|
|
@@ -523,7 +520,7 @@ function Fe(n) {
|
|
|
523
520
|
render: "email.form",
|
|
524
521
|
onValidate: (t) => k(n, t),
|
|
525
522
|
onComplete: (t) => w(n, t),
|
|
526
|
-
onSubmit: (t) =>
|
|
523
|
+
onSubmit: (t) => O(n, t, (o) => y(u({}, o), {
|
|
527
524
|
ConfirmationText: o.ResponseHtml
|
|
528
525
|
}))
|
|
529
526
|
});
|
|
@@ -536,7 +533,7 @@ const Xe = (n, e, t) => n.getAsync("contactMethods").then((o) => {
|
|
|
536
533
|
handleClick: () => (a, c) => {
|
|
537
534
|
const {
|
|
538
535
|
body: d
|
|
539
|
-
} = c,
|
|
536
|
+
} = c, h = d, { form: s, guideId: i, confirmationFallback: r } = h, l = C(h, ["form", "guideId", "confirmationFallback"]);
|
|
540
537
|
s || (a.preventDefault(), t(l));
|
|
541
538
|
},
|
|
542
539
|
onValidate: (a) => k(n, a),
|
|
@@ -544,15 +541,15 @@ const Xe = (n, e, t) => n.getAsync("contactMethods").then((o) => {
|
|
|
544
541
|
onSubmit: (a) => {
|
|
545
542
|
const {
|
|
546
543
|
body: d
|
|
547
|
-
} = a,
|
|
544
|
+
} = a, h = d, { form: c, guideId: s, confirmationFallback: i } = h, r = C(h, ["form", "guideId", "confirmationFallback"]), { values: l } = new S(c).export();
|
|
548
545
|
return Promise.resolve(t(r, l)).then((g) => g || i);
|
|
549
546
|
}
|
|
550
547
|
});
|
|
551
548
|
});
|
|
552
|
-
class Ye extends
|
|
549
|
+
class Ye extends Z {
|
|
553
550
|
constructor(e, t) {
|
|
554
551
|
super(e, t), this.widget.implementation.configure((a) => {
|
|
555
|
-
a.plugin(
|
|
552
|
+
a.plugin(Ce).plugin($e).plugin(ke).plugin(Pe).plugin(Fe).plugin(we);
|
|
556
553
|
});
|
|
557
554
|
}
|
|
558
555
|
}
|
|
@@ -561,21 +558,21 @@ export {
|
|
|
561
558
|
Ne as D,
|
|
562
559
|
Je as F,
|
|
563
560
|
Re as a,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
561
|
+
Se as b,
|
|
562
|
+
$e as c,
|
|
563
|
+
Me as d,
|
|
567
564
|
Ue as e,
|
|
568
565
|
w as f,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
566
|
+
H as g,
|
|
567
|
+
Ce as h,
|
|
568
|
+
ke as i,
|
|
572
569
|
Xe as j,
|
|
573
570
|
Ye as k,
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
571
|
+
we as l,
|
|
572
|
+
Pe as p,
|
|
573
|
+
O as s,
|
|
577
574
|
Qe as u,
|
|
578
575
|
k as v,
|
|
579
576
|
Fe as w
|
|
580
577
|
};
|
|
581
|
-
//# sourceMappingURL=index.
|
|
578
|
+
//# sourceMappingURL=index.5fee08c6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.5fee08c6.js","sources":["../src/contact-methods/email/email-plugin.ts","../src/contact-methods/chat-popup/chat-popup-plugin.ts","../src/contact-methods/free-text/free-text-plugin.ts","../src/contact-methods/link/link-plugin.tsx","../src/contact-methods/phone/phone-plugin.ts","../src/contact-methods/platform.ts","../src/contact-methods/ui/description.tsx","../src/contact-methods/ui/contact-method.tsx","../src/contact-methods/ui/contact-list.tsx","../src/contact-methods/ui/form.tsx","../src/contact-methods/ui/use-contact-method.ts","../src/contact-methods/web-service/web-service-plugin.ts","../src/create-adapter.ts","../src/default-contact-methods-plugin.ts"],"sourcesContent":["import {\n ContactMethodApiResponse,\n ServiceClient,\n SubmissionApiResult,\n} from '@telia-ace/knowledge-serviceclient';\nimport { FormBuilder, FormReader } from '@telia-ace/widget-forms';\nimport { RoutingService } from '@telia-ace/widget-routing';\nimport { Container } from '@webprovisions/platform';\nimport ContactMethodPlatform from '../platform';\nimport { ContactMethodType } from '../ui';\n\ntype Services = {\n matchingClient: ServiceClient;\n router: RoutingService;\n};\n\nconst post = (container: Container, contactMethod: ContactMethodType, validate = false) =>\n container.getManyAsync('matchingClient', 'router').then((services) => {\n const { formData } = new FormReader(contactMethod.body.form).export(validate);\n const { router, matchingClient } = services as Services;\n const { params } = router.getRouteData();\n\n return matchingClient.customRequest(\n `contactmethods/${contactMethod.id}${validate ? '/validatedwithpayload' : ''}`,\n 'POST',\n {\n body: formData,\n configuration: {\n guideId: contactMethod.body.guideId || params.guideId,\n },\n }\n );\n });\n\nexport const submit = (\n container: Container,\n contactMethod: ContactMethodType,\n transform?: (response: any) => SubmissionApiResult\n) =>\n post(container, contactMethod)\n .then((response) => (transform ? transform(response) : response))\n .then(({ ConfirmationText }: SubmissionApiResult) => ConfirmationText);\n\nexport const validate = (container: Container, contactMethod: ContactMethodType) =>\n post(container, contactMethod, true).then((result: ContactMethodApiResponse) => ({\n valid: result.Validation.IsValid,\n errors: result.Validation.Errors,\n errorTypes: result.Validation.ErrorTypes,\n }));\n\nexport const evaluate = (container: Container, contactMethod: ContactMethodType) =>\n post(container, contactMethod, true).then((result: ContactMethodApiResponse) =>\n FormBuilder.fromLegacyForm(contactMethod.id, result.ContactMethod.Form).get()\n );\n\nexport const complete = (container: Container, contactMethod: ContactMethodType) =>\n container.getAsync('matchingClient').then((matchingClient) => {\n matchingClient.completeContactMethod(contactMethod.id);\n });\n\nexport default function emailPlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'email.form',\n render: import('./email-form-component'),\n onEvaluate: (contactMethod) => evaluate(container, contactMethod),\n onValidate: (contactMethod) => validate(container, contactMethod),\n onSubmit: (contactMethod) => submit(container, contactMethod),\n onComplete: (contactMethod) => complete(container, contactMethod),\n });\n });\n}\n","import { FormReader } from '@telia-ace/widget-forms';\nimport { Container } from '@webprovisions/platform';\nimport { ContactMethodPlatform, defaultValidate } from '..';\nimport { defaultComplete } from '../email';\n\nconst popup = (\n title: string,\n settings: { [key: string]: any },\n formValues?: { [key: string]: any }\n) => {\n const { url, width, height } = settings;\n\n const queries: { [key: string]: any } = formValues ? formValues : {};\n\n const link = document.createElement('a');\n link.href = url;\n\n link.search\n .replace('?', '')\n .split('&')\n .forEach((part) => {\n const [key, value] = part.split('=');\n typeof value !== 'undefined' && (queries[key] = value);\n });\n\n link.search = Object.keys(queries)\n .map((key) => `${key}=${queries[key]}`)\n .join('&');\n\n window.open(link.href, title, `width=${width},height=${height}`);\n return '';\n};\n\nexport default function chatPopupPlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'chat.popup',\n render: 'email.form',\n handleClick: (contactMethod) => {\n const { title, body } = contactMethod;\n const { form, guideId, confirmationFallback, ...rest } = body;\n\n if (!form) {\n return (e) => {\n e.preventDefault();\n popup(title, rest);\n };\n }\n\n return () => {};\n },\n onValidate: (contactMethod) => defaultValidate(container, contactMethod),\n onComplete: (contactMethod) => defaultComplete(container, contactMethod),\n onSubmit: (contactMethod) => {\n const { title, body } = contactMethod;\n const { form, guideId, confirmationFallback, ...rest } = body;\n\n const formValues = new FormReader(form).export().values;\n\n popup(title, rest, formValues);\n\n return confirmationFallback;\n },\n });\n });\n}\n","import { Container } from '@webprovisions/platform';\nimport ContactMethodPlatform from '../platform';\n\nexport default function freeTextPlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'custom.freetext',\n render: import('./free-text-component'),\n });\n });\n}\n","import { Container } from '@webprovisions/platform';\nimport ContactMethodPlatform from '../platform';\n\nexport default function linkPlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'custom.link',\n render: import('./link-component'),\n });\n });\n}\n","import { Container } from '@webprovisions/platform';\nimport ContactMethodPlatform from '../platform';\n\nexport default function phonePlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'phone.text',\n render: import('./phone-component'),\n });\n });\n}\n","import { ComponentPlatform, ComponentResolver } from '@telia-ace/knowledge-widget-core';\nimport { Form } from '@telia-ace/widget-forms';\nimport { lock } from '@telia-ace/widget-utilities';\nimport { Container, EventSubscriptionCancellation, Widget } from '@webprovisions/platform';\nimport React, { lazy } from 'react';\nimport { defaultComplete, defaultEvaluate, defaultValidate } from './email';\nimport { ContactMethodProps } from './ui';\n\nexport type ReactComponentImport = Promise<{ default: React.FunctionComponent<any> }>;\n\nexport type Click = (e: React.MouseEvent, cm: ContactMethodProps) => void;\n\nexport type AdapterSettings = {\n clientName: string;\n render: string | ReactComponentImport;\n handleDescription?: (cm: ContactMethodProps) => Promise<string> | string;\n handleDisabled?: (cm: ContactMethodProps) => Promise<boolean> | boolean;\n handleClick?: (cm: ContactMethodProps) => Promise<Click> | Click;\n onEvaluate?: (cm: ContactMethodProps) => Promise<Form> | Form;\n onValidate?: (cm: ContactMethodProps) => Promise<ValidationResult> | ValidationResult;\n onSubmit?: (cm: ContactMethodProps) => Promise<string> | string;\n onComplete?: (cm: ContactMethodProps) => Promise<void> | void;\n};\n\nexport type ValidationResult = {\n errors?: { [key: string]: string };\n errorTypes?: { [key: string]: string };\n valid: boolean;\n};\n\nexport enum ContactMethodTrackTypes {\n ContactMethodValidate = 'contact-method-validate',\n ContactMethodComplete = 'contact-method-complete',\n}\n\nconst handleContactMethod = async (\n adapters: Map<string, AdapterSettings>,\n contactMethod: ContactMethodProps\n): Promise<ContactMethodProps> => {\n const adapter = adapters.get(contactMethod.clientName);\n let { description, disabled, onClick } = contactMethod;\n\n if (adapter) {\n const { handleClick, handleDescription, handleDisabled } = adapter;\n if (typeof handleClick === 'function') {\n onClick = await Promise.resolve(handleClick(contactMethod));\n }\n\n if (typeof handleDescription === 'function') {\n description = await Promise.resolve(handleDescription(contactMethod));\n }\n\n if (typeof handleDisabled === 'function') {\n disabled = await Promise.resolve(handleDisabled(contactMethod));\n }\n }\n\n return Promise.resolve({\n ...contactMethod,\n description,\n disabled,\n onClick,\n });\n};\n\nclass ContactMethodPlatform {\n private adapters: Map<string, AdapterSettings> = new Map();\n private subs: EventSubscriptionCancellation[] = [];\n\n static create(container: Container): Promise<ContactMethodPlatform> {\n return ComponentPlatform.getInstance(container).then((platform) => {\n return new ContactMethodPlatform(container, platform);\n });\n }\n\n handleAdapters(cm: ContactMethodProps) {\n return handleContactMethod(this.adapters, cm);\n }\n\n constructor(private container: Container, private componentPlatform: ComponentPlatform) {\n if (componentPlatform) {\n const contactListComponent = componentPlatform\n .components()\n .ofType('contact-list')\n .select();\n contactListComponent.actions.watch('contact-list.fetched', async (input, next) => {\n const { contactMethods } = input;\n\n if (contactMethods) {\n const promises = Promise.all(\n contactMethods.map((cm: ContactMethodProps) => this.handleAdapters(cm))\n );\n\n await Promise.resolve(promises).then((contactMethods) => {\n input.contactMethods = contactMethods;\n });\n }\n\n return next(input);\n });\n\n const guideComponent = componentPlatform.components().ofType('guide').select();\n guideComponent.actions.watch('guide.fetched', async (input, next) => {\n const { contactMethods } = input;\n\n if (contactMethods) {\n const promises = Promise.all(\n contactMethods.map((cm: ContactMethodProps) => this.handleAdapters(cm))\n );\n\n await Promise.resolve(promises).then((contactMethods) => {\n input.contactMethods = contactMethods;\n });\n }\n\n return next(input);\n });\n guideComponent.actions.watch('guide.handover', async (input, next) => {\n const { handoverContactMethods } = input;\n\n if (handoverContactMethods) {\n const promises = Promise.all(\n handoverContactMethods.map((cm: ContactMethodProps) =>\n this.handleAdapters(cm)\n )\n );\n\n await Promise.resolve(promises).then((handoverContactMethods) => {\n input.handoverContactMethods = handoverContactMethods;\n });\n }\n\n return next(input);\n });\n\n const contactMethodComponent = componentPlatform\n .components()\n .ofType('contact-method')\n .select();\n contactMethodComponent.actions.watch('contact-method.fetched', async (input, next) => {\n const { contactMethod } = input;\n\n if (contactMethod) {\n return this.handleAdapters(contactMethod).then((contactMethod) => {\n return next({ ...input, contactMethod });\n });\n }\n\n return next(input);\n });\n }\n }\n\n static getInstance(\n container: Container,\n key: string = 'contactMethods'\n ): Promise<ContactMethodPlatform> {\n return lock(container)(() => {\n return container.getAsync(key).then((value: ContactMethodPlatform) => {\n let contactMethodPlatform = value;\n if (!contactMethodPlatform) {\n return ComponentPlatform.getInstance(container).then((components) => {\n contactMethodPlatform = new ContactMethodPlatform(container, components);\n container.registerAsync(key, () => contactMethodPlatform);\n return contactMethodPlatform;\n });\n }\n return contactMethodPlatform;\n });\n });\n }\n\n private track(data: any = {}, type: ContactMethodTrackTypes) {\n const { events } = this.container.get('$widget');\n events.dispatch('tracking:service-client-response', {\n type,\n data,\n });\n }\n\n complete(contactMethod: ContactMethodProps) {\n const { id, title, clientName, expanded, body } = contactMethod;\n this.track(\n { contactMethod: { id, title, expanded, type: clientName }, hasGuide: !!body.guideId },\n ContactMethodTrackTypes.ContactMethodComplete\n );\n\n const adapter = this.adapters.get(clientName);\n if (adapter && adapter.onComplete) {\n return adapter.onComplete(contactMethod);\n }\n }\n\n evaluate(contactMethod: ContactMethodProps): Promise<Form> {\n const { clientName } = contactMethod;\n const adapter = this.adapters.get(clientName);\n\n if (adapter && adapter.onEvaluate) {\n return Promise.resolve(adapter.onEvaluate(contactMethod));\n }\n\n return Promise.resolve(contactMethod.body.form);\n }\n\n validate(contactMethod: ContactMethodProps): Promise<ValidationResult> {\n const { id, title, clientName } = contactMethod;\n const adapter = this.adapters.get(clientName);\n\n if (adapter && adapter.onValidate) {\n return Promise.resolve(adapter.onValidate(contactMethod)).then((result) => {\n this.track(\n { contactMethod: { id, title, type: clientName }, isValid: result.valid },\n ContactMethodTrackTypes.ContactMethodValidate\n );\n const { events } = this.container.get('$widget') as Widget;\n events.dispatch('form:validated', { isValid: result.valid });\n return result;\n });\n }\n\n return Promise.resolve({ valid: true });\n }\n\n submit(contactMethod: ContactMethodProps): Promise<string> {\n const { clientName } = contactMethod;\n const adapter = this.adapters.get(clientName);\n\n if (adapter && adapter.onSubmit) {\n return Promise.resolve(adapter.onSubmit(contactMethod)).then((result) => {\n this.complete(contactMethod);\n return result;\n });\n }\n\n return Promise.resolve('');\n }\n\n create(settings: AdapterSettings) {\n const { clientName, render } = settings;\n this.adapters.set(clientName, {\n onValidate: (cm) => defaultValidate(this.container, cm),\n onEvaluate: (cm) => defaultEvaluate(this.container, cm),\n onComplete: (cm) => defaultComplete(this.container, cm),\n ...settings,\n });\n return this.container.getAsync('componentResolver').then((resolver: ComponentResolver) => {\n if (typeof render === 'string') {\n this.subs.push(resolver.registerAlias(clientName, render));\n } else {\n this.subs.push(\n resolver.registerComponent(\n clientName,\n lazy(() => render)\n )\n );\n }\n });\n }\n\n dispose() {\n this.subs.forEach((s) => s());\n }\n}\n\nexport default ContactMethodPlatform;\n","import styled from '@emotion/styled';\nimport { borderTabStyle, genericHtml, Html, linkTabStyle } from '@telia-ace/knowledge-widget-ui';\n\nexport default styled(Html as any)`\n ${genericHtml}\n font-weight: 300;\n line-height: 1.5em;\n button:focus-visible {\n ${borderTabStyle};\n }\n\n a:focus-visible {\n ${linkTabStyle};\n }\n`;\n","import { css, Theme } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { Symbol } from '@telia-ace/knowledge-widget-core';\nimport {\n borderTabStyle,\n DispatchAction,\n HtmlParseInstruction,\n Link,\n StyledText,\n SymbolBadge,\n Typography,\n useComponent,\n useRouteData,\n} from '@telia-ace/knowledge-widget-ui';\nimport { createParams, formatUrl } from '@telia-ace/widget-utilities';\nimport React, { Suspense } from 'react';\nimport Description from './description';\n\nexport type ContactMethodType = {\n id: string;\n title: string;\n symbol?: Symbol;\n clientName: string;\n expanded: boolean;\n inline: boolean;\n body: { [key: string]: any };\n description?: string;\n confirmation?: string;\n disabled?: boolean;\n guideId?: string;\n};\n\nexport type Props = Merge<\n ContactMethodType,\n {\n className?: string;\n onClick?: (event: React.MouseEvent, properties: Props) => void;\n renderDefault?: (extraProps?: Partial<Props>) => any;\n htmlParseInstruction?: HtmlParseInstruction;\n href?: string;\n target?: string;\n disabled?: boolean;\n action?: (action: string, value: any) => void;\n dispatch?: DispatchAction;\n symbol?: Symbol;\n description?: string;\n confirmation?: string;\n guideId?: string;\n autoFocus?: boolean;\n }\n>;\n\nconst ContactMethod: React.FC<Props> = (props) => {\n const ResolvedComponent = useComponent(props.clientName);\n const {\n params: { contactCategory, guideCategory, phrase },\n } = useRouteData();\n\n if (typeof ResolvedComponent === 'undefined') {\n return null;\n }\n\n if (ResolvedComponent === null) {\n if (process.env.NODE_ENV !== 'production') {\n return (\n <NonResolvedContactMethodWrapper\n title={`client-name: ${props.clientName}, id: ${props.id}`}\n className=\"humany-non-resolved-contact-method\"\n >\n <Typography variant=\"h5\">Non resolved Contact Method type</Typography>\n </NonResolvedContactMethodWrapper>\n );\n }\n return null;\n }\n\n const renderLink = (extraProps: Partial<Props> = {}) => {\n const enhancedProps = { ...props, ...extraProps };\n const {\n id,\n title,\n clientName,\n symbol,\n inline,\n onClick = () => {},\n description,\n htmlParseInstruction,\n className,\n disabled,\n guideId,\n dispatch = () => {},\n expanded,\n } = enhancedProps;\n\n const linkProps = inline\n ? {\n onKeyDown: (event: React.KeyboardEvent) => {\n if (event.key && event.key === 'Enter') {\n onClick(event as any, enhancedProps);\n if (!event.defaultPrevented) {\n !expanded && dispatch('expand', id);\n }\n }\n },\n onClick: (event: React.MouseEvent) => {\n onClick(event, enhancedProps);\n if (!event.defaultPrevented) {\n !expanded && dispatch('expand', id);\n }\n },\n }\n : {\n onClick: (event: React.MouseEvent) => onClick(event, enhancedProps),\n routeName: 'contact-method',\n params: createParams({\n contactCategory,\n guideId,\n guideCategory,\n phrase,\n contactMethod: id,\n uriName: formatUrl(title),\n }),\n };\n\n return (\n <StyledLink\n title={title}\n aria-label={title}\n className={className}\n disabled={disabled}\n description={description}\n data-client-name={clientName}\n {...extraProps}\n {...linkProps}\n >\n {symbol && <SymbolBadge symbol={symbol} />}\n {description ? (\n <div className=\"humany-contact-link-rich-content\">\n {<StyledTitle>{title}</StyledTitle>}\n {\n <Description\n html={description}\n htmlParseInstruction={htmlParseInstruction}\n />\n }\n </div>\n ) : (\n <StyledTitle>{title}</StyledTitle>\n )}\n </StyledLink>\n );\n };\n\n return props.expanded ? (\n <Suspense fallback={null}>\n <ResolvedComponent {...props} renderDefault={renderLink} />\n </Suspense>\n ) : (\n renderLink()\n );\n};\n\nexport default ContactMethod;\n\nexport const contactLink = (p: { theme: Theme; description?: string }) => css`\n display: flex;\n padding: ${p.theme.sizes?.large};\n ${!!p.description ? '' : 'align-items: center;'}\n text-decoration: none;\n span {\n display: inline-block;\n color: ${p.theme.colors?.text};\n }\n i {\n font-size: ${p.theme.fonts?.large};\n margin: 0 ${p.theme.sizes?.large} 0 0;\n min-height: ${p.theme.fonts?.large};\n min-width: ${p.theme.fonts?.large};\n line-height: ${p.theme.fonts?.large};\n display: inline-block;\n vertical-align: bottom;\n color: ${p.theme.colors?.text};\n }\n`;\n\nconst StyledTitle = styled(StyledText)`\n line-height: ${(p) => p.theme.fonts?.large};\n`;\n\nconst StyledLink = styled(Link)`\n ${(p) => contactLink(p)}\n\n &:focus-visible {\n ${borderTabStyle};\n }\n`;\n\nconst NonResolvedContactMethodWrapper = styled.div`\n text-align: center;\n display: block;\n ${(p) => typeof p.theme.colors?.warning !== 'undefined' && `color: ${p.theme.colors?.warning};`}\n`;\n","import { css, Theme } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { DispatchAction, headingElement, ItemList, itemList } from '@telia-ace/knowledge-widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React, { ReactNode } from 'react';\nimport ContactMethod, { ContactMethodType } from './contact-method';\n\nexport const contactItemList = (p: { theme: Theme }) => css`\n ${itemList(p)}\n\n > div {\n padding: ${p.theme.sizes?.large};\n\n ${headingElement(p)(\n 'h1',\n css`\n margin: 0;\n `\n )}\n }\n\n > ul {\n &:not(:first-child) {\n border-top: ${p.theme.border};\n }\n\n > li {\n margin: 0;\n white-space: normal;\n\n > a {\n overflow: hidden;\n }\n\n &:first-child > a {\n border-radius: ${`${p.theme.borderRadius} ${p.theme.borderRadius} 0 0`};\n }\n\n &:last-child:not(:first-child) > a {\n border-radius: ${`0 0 ${p.theme.borderRadius} ${p.theme.borderRadius}`};\n }\n\n &:not(:last-child) {\n border-bottom: ${p.theme.border};\n }\n\n > div {\n padding: ${p.theme.sizes?.large};\n }\n }\n }\n\n @media (hover: hover) {\n a:hover {\n background-color: ${p.theme.colors?.accent};\n }\n }\n`;\n\nconst StyledItemList = styled(ItemList)`\n ${(p) => contactItemList(p)}\n`;\n\ntype Props = {\n contactMethods: ContactMethodType[];\n header?: string;\n className?: string;\n action?: (action: string, value?: any) => void;\n dispatch?: DispatchAction;\n children?: ReactNode;\n itemRenderer?: (cm: any, props: any) => JSX.Element;\n guideId?: string;\n};\n\nconst ContactList: React.FC<Props> = ({\n contactMethods,\n children,\n guideId,\n dispatch,\n className = '',\n itemRenderer,\n action = () => {},\n header = '',\n}) => {\n if (!contactMethods.length) {\n return null;\n }\n\n return (\n <StyledItemList\n header={header}\n className={appendClassNames(className, 'humany-contact-list')}\n items={contactMethods}\n renderItem={\n itemRenderer\n ? (cm: any) => (\n <li key={cm.id} data-contact-method={cm.id}>\n {itemRenderer(cm, { action, dispatch, guideId })}\n </li>\n )\n : (cm: any) => (\n <li key={cm.id} data-contact-method={cm.id}>\n <ContactMethod\n {...cm}\n action={action}\n dispatch={dispatch}\n guideId={guideId}\n />\n </li>\n )\n }\n >\n {children}\n </StyledItemList>\n );\n};\n\nexport default ContactList;\n","import { FormComponent } from '@telia-ace/widget-forms';\nimport React from 'react';\nimport { ContactMethodProps } from '.';\n\n/**\n * Recursively find form component in schema\n * @param node Form schema\n * @param id actionKey of component to find\n */\nconst lookupComponent = (node: any, id: string): any => {\n if (node.actionKey === id) {\n return node;\n }\n\n if (!node.properties) {\n return null;\n }\n\n const keys = Object.keys(node.properties);\n\n let result;\n // tslint:disable-next-line:no-increment-decrement\n for (let i = 0; i < keys.length; i++) {\n result = lookupComponent(node.properties[keys[i]], id);\n\n if (result) {\n return result;\n }\n }\n\n return false;\n};\n\nconst Form: React.FC<ContactMethodProps> = ({\n className,\n body: { form },\n id,\n action,\n dispatch,\n disabled,\n autoFocus,\n}) => {\n if (form && !disabled) {\n const { schema, layout, data, meta } = form;\n const trigger = dispatch || action || (() => {});\n return (\n <FormComponent\n className={className}\n schema={schema}\n layout={layout}\n data={data}\n autoFocus={autoFocus}\n onChange={(event: any, data: any) => {\n const form = { schema, layout, data, meta };\n if (event.toString() === 'submit') {\n trigger('submit', { id, form });\n } else {\n const formComponent = lookupComponent(schema, event);\n if (formComponent.evaluate) {\n trigger('evaluate', { id, form });\n } else {\n trigger('validate', { id, form });\n }\n }\n }}\n />\n );\n }\n\n return null;\n};\n\nexport default Form;\n","import { ComponentResolver } from '@telia-ace/knowledge-widget-core';\nimport { useContainer } from '@telia-ace/knowledge-widget-ui';\nimport { EventSubscriptionCancellation } from '@webprovisions/platform';\nimport { useEffect, useState } from 'react';\n\nconst useContactMethod = (clientName: string): any | null => {\n const [component, setComponent] = useState<any | null>(null);\n const container = useContainer();\n\n useEffect(() => {\n let unsubscribe: EventSubscriptionCancellation;\n container.getAsync('componentResolver').then((resolver: ComponentResolver) => {\n unsubscribe = resolver.registerResolver(clientName, (component) =>\n setComponent(component)\n );\n });\n\n return () => {\n if (unsubscribe) {\n unsubscribe();\n }\n };\n }, [clientName]);\n\n return component;\n};\n\nexport default useContactMethod;\n","import { Container } from '@webprovisions/platform';\nimport { ContactMethodPlatform, defaultComplete, defaultSubmit, defaultValidate } from '..';\n\nexport default function webServicePlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'custom.webservice',\n render: 'email.form',\n onValidate: (contactMethod) => defaultValidate(container, contactMethod),\n onComplete: (contactMethod) => defaultComplete(container, contactMethod),\n onSubmit: (contactMethod) =>\n defaultSubmit(container, contactMethod, (response) => {\n return {\n ...response,\n ConfirmationText: response.ResponseHtml,\n };\n }),\n });\n });\n}\n","import { FormReader } from '@telia-ace/widget-forms';\nimport { Container } from '@webprovisions/platform';\nimport { ContactMethodPlatform, defaultComplete, defaultValidate } from './contact-methods';\n\nexport type Callback = (\n settings: {\n [key: string]: any;\n },\n data?: {\n [key: string]: any;\n }\n) => Promise<string | void> | (string | void);\n\nexport const createSubmitAdapter = (\n container: Container,\n clientName: string,\n fn: Callback\n): Promise<void> => {\n return container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName,\n render: 'email.form',\n handleClick: () => {\n return (e, cm) => {\n const {\n body: { form, guideId, confirmationFallback, ...rest },\n } = cm;\n if (!form) {\n e.preventDefault();\n fn(rest);\n }\n };\n },\n onValidate: (cm) => defaultValidate(container, cm),\n onComplete: (cm) => defaultComplete(container, cm),\n onSubmit: (cm) => {\n const {\n body: { form, guideId, confirmationFallback, ...rest },\n } = cm;\n const { values } = new FormReader(form).export();\n\n return Promise.resolve(fn(rest, values)).then((confirmation) => {\n return confirmation || confirmationFallback;\n });\n },\n });\n });\n};\n","import { Plugin } from '@telia-ace/knowledge-widget-core';\nimport { Container } from '@webprovisions/platform';\nimport {\n ChatPopupPlugin,\n EmailFormPlugin,\n FreeTextPlugin,\n LinkPlugin,\n PhonePlugin,\n WebServicePlugin,\n} from '.';\n\n/**\n * Registers default Humany contact methods.\n */\nexport class DefaultContactMethodsPlugin extends Plugin {\n constructor(container: Container, settings: any) {\n super(container, settings);\n const implementation = this.widget.implementation;\n implementation.configure((config) => {\n config\n .plugin(EmailFormPlugin)\n .plugin(ChatPopupPlugin)\n .plugin(FreeTextPlugin)\n .plugin(PhonePlugin)\n .plugin(WebServicePlugin)\n .plugin(LinkPlugin);\n });\n }\n}\n"],"names":["post","container","contactMethod","validate","services","formData","FormReader","router","matchingClient","params","submit","transform","response","ConfirmationText","result","evaluate","FormBuilder","complete","emailPlugin","platform","popup","title","settings","formValues","url","width","height","queries","link","part","key","value","chatPopupPlugin","body","_a","form","guideId","confirmationFallback","rest","__objRest","e","defaultValidate","defaultComplete","freeTextPlugin","linkPlugin","phonePlugin","handleContactMethod","adapters","__async","adapter","description","disabled","onClick","handleClick","handleDescription","handleDisabled","__spreadProps","__spreadValues","ContactMethodPlatform","componentPlatform","__publicField","input","next","contactMethods","promises","cm","guideComponent","handoverContactMethods","ComponentPlatform","lock","contactMethodPlatform","components","data","type","events","id","clientName","expanded","render","defaultEvaluate","resolver","lazy","s","ContactMethodPlatform$1","Description","styled","Html","genericHtml","borderTabStyle","linkTabStyle","ContactMethod","props","ResolvedComponent","useComponent","contactCategory","guideCategory","phrase","useRouteData","React","NonResolvedContactMethodWrapper","Typography","renderLink","extraProps","enhancedProps","symbol","inline","htmlParseInstruction","className","dispatch","linkProps","event","createParams","formatUrl","StyledLink","SymbolBadge","StyledTitle","Suspense","ContactMethod$1","contactLink","p","css","_b","_c","_d","_e","_f","_g","_h","StyledText","Link","contactItemList","itemList","headingElement","StyledItemList","ItemList","ContactList","children","itemRenderer","action","header","appendClassNames","ContactList$1","lookupComponent","node","keys","i","Form","autoFocus","schema","layout","meta","trigger","FormComponent","Form$1","useContactMethod","component","setComponent","useState","useContainer","useEffect","unsubscribe","useContactMethod$1","webServicePlugin","defaultSubmit","createSubmitAdapter","fn","values","confirmation","DefaultContactMethodsPlugin","Plugin","config","EmailFormPlugin","ChatPopupPlugin","FreeTextPlugin","PhonePlugin","WebServicePlugin","LinkPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,IAAO,CAACC,GAAsBC,GAAkCC,IAAW,OAC7EF,EAAU,aAAa,kBAAkB,QAAQ,EAAE,KAAK,CAACG,MAAa;AAC5D,QAAA,EAAE,UAAAC,MAAa,IAAIC,EAAWJ,EAAc,KAAK,IAAI,EAAE,OAAOC,CAAQ,GACtE,EAAE,QAAAI,GAAQ,gBAAAC,EAAmB,IAAAJ,GAC7B,EAAE,QAAAK,EAAA,IAAWF,EAAO,aAAa;AAEvC,SAAOC,EAAe;AAAA,IAClB,kBAAkBN,EAAc,KAAKC,IAAW,0BAA0B;AAAA,IAC1E;AAAA,IACA;AAAA,MACI,MAAME;AAAA,MACN,eAAe;AAAA,QACX,SAASH,EAAc,KAAK,WAAWO,EAAO;AAAA,MAClD;AAAA,IACJ;AAAA,EAAA;AAER,CAAC,GAEQC,IAAS,CAClBT,GACAC,GACAS,MAEAX,EAAKC,GAAWC,CAAa,EACxB,KAAK,CAACU,MAAcD,IAAYA,EAAUC,CAAQ,IAAIA,CAAS,EAC/D,KAAK,CAAC,EAAE,kBAAAC,EAAiB,MAA2BA,CAAgB,GAEhEV,IAAW,CAACF,GAAsBC,MAC3CF,EAAKC,GAAWC,GAAe,EAAI,EAAE,KAAK,CAACY,OAAsC;A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AAAA,IAGR,YAAY,CAAC2B,MAAOxB,EAAgBxC,GAAWgE,CAAE;AAAA,IACjD,YAAY,CAACA,MAAOvB,EAAgBzC,GAAWgE,CAAE;AAAA,IACjD,UAAU,CAACA,MAAO;AACR,YACI;AAAA,QAAN,MAAM/B;AAAA,UACN+B,GADMwD,IAAAvF,GAAE,QAAAC,GAAM,SAAAC,GAAS,sBAAAC,MAAjBoF,GAA0CnF,IAAAC,EAA1CkF,GAA0C,CAAxC,QAAM,WAAS,0BAErB,EAAE,QAAA6C,EAAO,IAAI,IAAIhK,EAAW6B,CAAI,EAAE;AAEjC,aAAA,QAAQ,QAAQkI,EAAG/H,GAAMgI,CAAM,CAAC,EAAE,KAAK,CAACC,MACpCA,KAAgBlI,CAC1B;AAAA,IACL;AAAA,EAAA,CACH;AAAA,CACJ;AChCE,MAAMmI,WAAoCC,EAAO;AAAA,EACpD,YAAYxK,GAAsBqB,GAAe;AAC7C,UAAMrB,GAAWqB,CAAQ,GACF,KAAK,OAAO,eACpB,UAAU,CAACoJ,MAAW;AACjC,MAAAA,EACK,OAAOC,EAAe,EACtB,OAAOC,EAAe,EACtB,OAAOC,EAAc,EACrB,OAAOC,EAAW,EAClB,OAAOC,EAAgB,EACvB,OAAOC,EAAU;AAAA,IAAA,CACzB;AAAA,EACL;AACJ;"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as m, C as r, d as p, e as c, k as d, F as P, h as f, i as g, l as C, p as h, w as b, a as F, b as L, j as M, f as k, g as v, s as S, v as x, u as D } from "./index.
|
|
1
|
+
import { c as m, C as r, d as p, e as c, k as d, F as P, h as f, i as g, l as C, p as h, w as b, a as F, b as L, j as M, f as k, g as v, s as S, v as x, u as D } from "./index.5fee08c6.js";
|
|
2
2
|
import "@telia-ace/widget-forms";
|
|
3
3
|
import "@telia-ace/knowledge-widget-core";
|
|
4
4
|
import "@emotion/react";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-adapters",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45-next.1",
|
|
4
4
|
"description": "ACE knowledge adapters for ACE widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-serviceclient": "
|
|
25
|
-
"@telia-ace/knowledge-widget-core": "
|
|
26
|
-
"@telia-ace/knowledge-widget-ui": "
|
|
27
|
-
"@telia-ace/widget-forms": "^1.0.27",
|
|
28
|
-
"@telia-ace/widget-routing": "^1.0.21",
|
|
29
|
-
"@telia-ace/widget-utilities": "^1.0.9",
|
|
24
|
+
"@telia-ace/knowledge-serviceclient": "1.0.24-next.1",
|
|
25
|
+
"@telia-ace/knowledge-widget-core": "1.0.35-next.1",
|
|
26
|
+
"@telia-ace/knowledge-widget-ui": "1.0.41-next.1",
|
|
27
|
+
"@telia-ace/widget-forms": "^1.0.27-next.3",
|
|
28
|
+
"@telia-ace/widget-routing": "^1.0.21-next.3",
|
|
29
|
+
"@telia-ace/widget-utilities": "^1.0.9-next.3",
|
|
30
30
|
"@webprovisions/platform": "^1.1.2"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@emotion/react": "^11.10.5",
|
|
39
39
|
"@emotion/styled": "^11.10.5",
|
|
40
|
-
"@types/react": "^18.0.
|
|
40
|
+
"@types/react": "^18.0.27",
|
|
41
41
|
"react": "^18.2.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.c1d1bd5b.js","sources":["../src/contact-methods/email/email-plugin.ts","../src/contact-methods/chat-popup/chat-popup-plugin.ts","../src/contact-methods/free-text/free-text-plugin.ts","../src/contact-methods/link/link-plugin.tsx","../src/contact-methods/phone/phone-plugin.ts","../src/contact-methods/platform.ts","../src/contact-methods/ui/description.tsx","../src/contact-methods/ui/contact-method.tsx","../src/contact-methods/ui/contact-list.tsx","../src/contact-methods/ui/form.tsx","../src/contact-methods/ui/use-contact-method.ts","../src/contact-methods/web-service/web-service-plugin.ts","../src/create-adapter.ts","../src/default-contact-methods-plugin.ts"],"sourcesContent":["import {\n ContactMethodApiResponse,\n ServiceClient,\n SubmissionApiResult,\n} from '@telia-ace/knowledge-serviceclient';\nimport { FormBuilder, FormReader } from '@telia-ace/widget-forms';\nimport { RoutingService } from '@telia-ace/widget-routing';\nimport { Container } from '@webprovisions/platform';\nimport ContactMethodPlatform from '../platform';\nimport { ContactMethodType } from '../ui';\n\ntype Services = {\n matchingClient: ServiceClient;\n router: RoutingService;\n};\n\nconst post = (container: Container, contactMethod: ContactMethodType, validate = false) =>\n container.getManyAsync('matchingClient', 'router').then((services) => {\n const { formData } = new FormReader(contactMethod.body.form).export(validate);\n const { router, matchingClient } = services as Services;\n const { params } = router.getRouteData();\n\n return matchingClient.customRequest(\n `contactmethods/${contactMethod.id}${validate ? '/validatedwithpayload' : ''}`,\n 'POST',\n {\n body: formData,\n configuration: {\n guideId: contactMethod.body.guideId || params.guideId,\n },\n }\n );\n });\n\nexport const submit = (\n container: Container,\n contactMethod: ContactMethodType,\n transform?: (response: any) => SubmissionApiResult\n) =>\n post(container, contactMethod)\n .then((response) => (transform ? transform(response) : response))\n .then(({ ConfirmationText }: SubmissionApiResult) => ConfirmationText);\n\nexport const validate = (container: Container, contactMethod: ContactMethodType) =>\n post(container, contactMethod, true).then((result: ContactMethodApiResponse) => ({\n valid: result.Validation.IsValid,\n errors: result.Validation.Errors,\n errorTypes: result.Validation.ErrorTypes,\n }));\n\nexport const evaluate = (container: Container, contactMethod: ContactMethodType) =>\n post(container, contactMethod, true).then((result: ContactMethodApiResponse) =>\n FormBuilder.fromLegacyForm(contactMethod.id, result.ContactMethod.Form).get()\n );\n\nexport const complete = (container: Container, contactMethod: ContactMethodType) =>\n container.getAsync('matchingClient').then((matchingClient) => {\n matchingClient.completeContactMethod(contactMethod.id);\n });\n\nexport default function emailPlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'email.form',\n render: import('./email-form-component'),\n onEvaluate: (contactMethod) => evaluate(container, contactMethod),\n onValidate: (contactMethod) => validate(container, contactMethod),\n onSubmit: (contactMethod) => submit(container, contactMethod),\n onComplete: (contactMethod) => complete(container, contactMethod),\n });\n });\n}\n","import { FormReader } from '@telia-ace/widget-forms';\nimport { Container } from '@webprovisions/platform';\nimport { ContactMethodPlatform, defaultValidate } from '..';\nimport { defaultComplete } from '../email';\n\nconst popup = (\n title: string,\n settings: { [key: string]: any },\n formValues?: { [key: string]: any }\n) => {\n const { url, width, height } = settings;\n\n const queries: { [key: string]: any } = formValues ? formValues : {};\n\n const link = document.createElement('a');\n link.href = url;\n\n link.search\n .replace('?', '')\n .split('&')\n .forEach((part) => {\n const [key, value] = part.split('=');\n typeof value !== 'undefined' && (queries[key] = value);\n });\n\n link.search = Object.keys(queries)\n .map((key) => `${key}=${queries[key]}`)\n .join('&');\n\n window.open(link.href, title, `width=${width},height=${height}`);\n return '';\n};\n\nexport default function chatPopupPlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'chat.popup',\n render: 'email.form',\n handleClick: (contactMethod) => {\n const { title, body } = contactMethod;\n const { form, guideId, confirmationFallback, ...rest } = body;\n\n if (!form) {\n return (e) => {\n e.preventDefault();\n popup(title, rest);\n };\n }\n\n return () => {};\n },\n onValidate: (contactMethod) => defaultValidate(container, contactMethod),\n onComplete: (contactMethod) => defaultComplete(container, contactMethod),\n onSubmit: (contactMethod) => {\n const { title, body } = contactMethod;\n const { form, guideId, confirmationFallback, ...rest } = body;\n\n const formValues = new FormReader(form).export().values;\n\n popup(title, rest, formValues);\n\n return confirmationFallback;\n },\n });\n });\n}\n","import { Container } from '@webprovisions/platform';\nimport ContactMethodPlatform from '../platform';\n\nexport default function freeTextPlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'custom.freetext',\n render: import('./free-text-component'),\n });\n });\n}\n","import { Container } from '@webprovisions/platform';\nimport ContactMethodPlatform from '../platform';\n\nexport default function linkPlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'custom.link',\n render: import('./link-component'),\n });\n });\n}\n","import { Container } from '@webprovisions/platform';\nimport ContactMethodPlatform from '../platform';\n\nexport default function phonePlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'phone.text',\n render: import('./phone-component'),\n });\n });\n}\n","import { ComponentPlatform, ComponentResolver } from '@telia-ace/knowledge-widget-core';\nimport { Form } from '@telia-ace/widget-forms';\nimport { lock } from '@telia-ace/widget-utilities';\nimport { Container, EventSubscriptionCancellation, Widget } from '@webprovisions/platform';\nimport React, { lazy } from 'react';\nimport { defaultComplete, defaultEvaluate, defaultValidate } from './email';\nimport { ContactMethodProps } from './ui';\n\nexport type ReactComponentImport = Promise<{ default: React.FunctionComponent<any> }>;\n\nexport type Click = (e: React.MouseEvent, cm: ContactMethodProps) => void;\n\nexport type AdapterSettings = {\n clientName: string;\n render: string | ReactComponentImport;\n handleDescription?: (cm: ContactMethodProps) => Promise<string> | string;\n handleDisabled?: (cm: ContactMethodProps) => Promise<boolean> | boolean;\n handleClick?: (cm: ContactMethodProps) => Promise<Click> | Click;\n onEvaluate?: (cm: ContactMethodProps) => Promise<Form> | Form;\n onValidate?: (cm: ContactMethodProps) => Promise<ValidationResult> | ValidationResult;\n onSubmit?: (cm: ContactMethodProps) => Promise<string> | string;\n onComplete?: (cm: ContactMethodProps) => Promise<void> | void;\n};\n\nexport type ValidationResult = {\n errors?: { [key: string]: string };\n errorTypes?: { [key: string]: string };\n valid: boolean;\n};\n\nexport enum ContactMethodTrackTypes {\n ContactMethodValidate = 'contact-method-validate',\n ContactMethodComplete = 'contact-method-complete',\n}\n\nconst handleContactMethod = async (\n adapters: Map<string, AdapterSettings>,\n contactMethod: ContactMethodProps\n): Promise<ContactMethodProps> => {\n const adapter = adapters.get(contactMethod.clientName);\n let { description, disabled, onClick } = contactMethod;\n\n if (adapter) {\n const { handleClick, handleDescription, handleDisabled } = adapter;\n if (typeof handleClick === 'function') {\n onClick = await Promise.resolve(handleClick(contactMethod));\n }\n\n if (typeof handleDescription === 'function') {\n description = await Promise.resolve(handleDescription(contactMethod));\n }\n\n if (typeof handleDisabled === 'function') {\n disabled = await Promise.resolve(handleDisabled(contactMethod));\n }\n }\n\n return Promise.resolve({\n ...contactMethod,\n description,\n disabled,\n onClick,\n });\n};\n\nclass ContactMethodPlatform {\n private adapters: Map<string, AdapterSettings> = new Map();\n private subs: EventSubscriptionCancellation[] = [];\n\n static create(container: Container): Promise<ContactMethodPlatform> {\n return ComponentPlatform.getInstance(container).then((platform) => {\n return new ContactMethodPlatform(container, platform);\n });\n }\n\n constructor(private container: Container, private componentPlatform: ComponentPlatform) {\n if (componentPlatform) {\n const contactListComponent = componentPlatform\n .components()\n .ofType('contact-list')\n .select();\n contactListComponent.actions.watch('contact-list.fetched', async (input, next) => {\n const { contactMethods } = input;\n\n if (contactMethods) {\n const promises = Promise.all(\n contactMethods.map((cm: ContactMethodProps) =>\n handleContactMethod(this.adapters, cm)\n )\n );\n\n await Promise.resolve(promises).then((contactMethods) => {\n input.contactMethods = contactMethods;\n });\n }\n\n return next(input);\n });\n\n const guideComponent = componentPlatform.components().ofType('guide').select();\n guideComponent.actions.watch('guide.fetched', async (input, next) => {\n const { contactMethods } = input;\n\n if (contactMethods) {\n const promises = Promise.all(\n contactMethods.map((cm: ContactMethodProps) =>\n handleContactMethod(this.adapters, cm)\n )\n );\n\n await Promise.resolve(promises).then((contactMethods) => {\n input.contactMethods = contactMethods;\n });\n }\n\n return next(input);\n });\n guideComponent.actions.watch('guide.handover', async (input, next) => {\n const { handoverContactMethods } = input;\n\n if (handoverContactMethods) {\n const promises = Promise.all(\n handoverContactMethods.map((cm: ContactMethodProps) =>\n handleContactMethod(this.adapters, cm)\n )\n );\n\n await Promise.resolve(promises).then((handoverContactMethods) => {\n input.handoverContactMethods = handoverContactMethods;\n });\n }\n\n return next(input);\n });\n\n const contactMethodComponent = componentPlatform\n .components()\n .ofType('contact-method')\n .select();\n contactMethodComponent.actions.watch('contact-method.fetched', async (input, next) => {\n const { contactMethod } = input;\n\n if (contactMethod) {\n return handleContactMethod(this.adapters, contactMethod).then(\n (contactMethod) => {\n return next({ ...input, contactMethod });\n }\n );\n }\n\n return next(input);\n });\n }\n }\n\n static getInstance(\n container: Container,\n key: string = 'contactMethods'\n ): Promise<ContactMethodPlatform> {\n return lock(container)(() => {\n return container.getAsync(key).then((value: ContactMethodPlatform) => {\n let contactMethodPlatform = value;\n if (!contactMethodPlatform) {\n return ComponentPlatform.getInstance(container).then((components) => {\n contactMethodPlatform = new ContactMethodPlatform(container, components);\n container.registerAsync(key, () => contactMethodPlatform);\n return contactMethodPlatform;\n });\n }\n return contactMethodPlatform;\n });\n });\n }\n\n private track(data: any = {}, type: ContactMethodTrackTypes) {\n const { events } = this.container.get('$widget');\n events.dispatch('tracking:service-client-response', {\n type,\n data,\n });\n }\n\n complete(contactMethod: ContactMethodProps) {\n const { id, title, clientName, expanded, body } = contactMethod;\n this.track(\n { contactMethod: { id, title, expanded, type: clientName }, hasGuide: !!body.guideId },\n ContactMethodTrackTypes.ContactMethodComplete\n );\n\n const adapter = this.adapters.get(clientName);\n if (adapter && adapter.onComplete) {\n return adapter.onComplete(contactMethod);\n }\n }\n\n evaluate(contactMethod: ContactMethodProps): Promise<Form> {\n const { clientName } = contactMethod;\n const adapter = this.adapters.get(clientName);\n\n if (adapter && adapter.onEvaluate) {\n return Promise.resolve(adapter.onEvaluate(contactMethod));\n }\n\n return Promise.resolve(contactMethod.body.form);\n }\n\n validate(contactMethod: ContactMethodProps): Promise<ValidationResult> {\n const { id, title, clientName } = contactMethod;\n const adapter = this.adapters.get(clientName);\n\n if (adapter && adapter.onValidate) {\n return Promise.resolve(adapter.onValidate(contactMethod)).then((result) => {\n this.track(\n { contactMethod: { id, title, type: clientName }, isValid: result.valid },\n ContactMethodTrackTypes.ContactMethodValidate\n );\n const { events } = this.container.get('$widget') as Widget;\n events.dispatch('form:validated', { isValid: result.valid });\n return result;\n });\n }\n\n return Promise.resolve({ valid: true });\n }\n\n submit(contactMethod: ContactMethodProps): Promise<string> {\n const { clientName } = contactMethod;\n const adapter = this.adapters.get(clientName);\n\n if (adapter && adapter.onSubmit) {\n return Promise.resolve(adapter.onSubmit(contactMethod)).then((result) => {\n this.complete(contactMethod);\n return result;\n });\n }\n\n return Promise.resolve('');\n }\n\n create(settings: AdapterSettings) {\n const { clientName, render } = settings;\n this.adapters.set(clientName, {\n onValidate: (cm) => defaultValidate(this.container, cm),\n onEvaluate: (cm) => defaultEvaluate(this.container, cm),\n onComplete: (cm) => defaultComplete(this.container, cm),\n ...settings,\n });\n return this.container.getAsync('componentResolver').then((resolver: ComponentResolver) => {\n if (typeof render === 'string') {\n this.subs.push(resolver.registerAlias(clientName, render));\n } else {\n this.subs.push(\n resolver.registerComponent(\n clientName,\n lazy(() => render)\n )\n );\n }\n });\n }\n\n dispose() {\n this.subs.forEach((s) => s());\n }\n}\n\nexport default ContactMethodPlatform;\n","import styled from '@emotion/styled';\nimport { borderTabStyle, genericHtml, Html, linkTabStyle } from '@telia-ace/knowledge-widget-ui';\n\nexport default styled(Html as any)`\n ${genericHtml}\n font-weight: 300;\n line-height: 1.5em;\n button:focus-visible {\n ${borderTabStyle};\n }\n\n a:focus-visible {\n ${linkTabStyle};\n }\n`;\n","import { css, Theme } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { Symbol } from '@telia-ace/knowledge-widget-core';\nimport {\n borderTabStyle,\n DispatchAction,\n HtmlParseInstruction,\n Link,\n StyledText,\n SymbolBadge,\n Typography,\n useComponent,\n useRouteData,\n} from '@telia-ace/knowledge-widget-ui';\nimport { createParams, formatUrl } from '@telia-ace/widget-utilities';\nimport React, { Suspense } from 'react';\nimport Description from './description';\n\nexport type ContactMethodType = {\n id: string;\n title: string;\n symbol?: Symbol;\n clientName: string;\n expanded: boolean;\n inline: boolean;\n body: { [key: string]: any };\n description?: string;\n confirmation?: string;\n disabled?: boolean;\n guideId?: string;\n};\n\nexport type Props = Merge<\n ContactMethodType,\n {\n className?: string;\n onClick?: (event: React.MouseEvent, properties: Props) => void;\n renderDefault?: (extraProps?: Partial<Props>) => any;\n htmlParseInstruction?: HtmlParseInstruction;\n href?: string;\n target?: string;\n disabled?: boolean;\n action?: (action: string, value: any) => void;\n dispatch?: DispatchAction;\n symbol?: Symbol;\n description?: string;\n confirmation?: string;\n guideId?: string;\n autoFocus?: boolean;\n }\n>;\n\nconst ContactMethod: React.FC<Props> = (props) => {\n const ResolvedComponent = useComponent(props.clientName);\n const {\n params: { contactCategory, guideCategory, phrase },\n } = useRouteData();\n\n if (typeof ResolvedComponent === 'undefined') {\n return null;\n }\n\n if (ResolvedComponent === null) {\n if (process.env.NODE_ENV !== 'production') {\n return (\n <NonResolvedContactMethodWrapper\n title={`client-name: ${props.clientName}, id: ${props.id}`}\n className=\"humany-non-resolved-contact-method\"\n >\n <Typography variant=\"h5\">Non resolved Contact Method type</Typography>\n </NonResolvedContactMethodWrapper>\n );\n }\n return null;\n }\n\n const renderLink = (extraProps: Partial<Props> = {}) => {\n const enhancedProps = { ...props, ...extraProps };\n const {\n id,\n title,\n clientName,\n symbol,\n inline,\n onClick = () => {},\n description,\n htmlParseInstruction,\n className,\n disabled,\n guideId,\n dispatch = () => {},\n expanded,\n } = enhancedProps;\n\n const linkProps = inline\n ? {\n onKeyDown: (event: React.KeyboardEvent) => {\n if (event.key && event.key === 'Enter') {\n onClick(event as any, enhancedProps);\n if (!event.defaultPrevented) {\n !expanded && dispatch('expand', id);\n }\n }\n },\n onClick: (event: React.MouseEvent) => {\n onClick(event, enhancedProps);\n if (!event.defaultPrevented) {\n !expanded && dispatch('expand', id);\n }\n },\n }\n : {\n onClick: (event: React.MouseEvent) => onClick(event, enhancedProps),\n routeName: 'contact-method',\n params: createParams({\n contactCategory,\n guideId,\n guideCategory,\n phrase,\n contactMethod: id,\n uriName: formatUrl(title),\n }),\n };\n\n return (\n <StyledLink\n title={title}\n aria-label={title}\n className={className}\n disabled={disabled}\n description={description}\n data-client-name={clientName}\n {...extraProps}\n {...linkProps}\n >\n {symbol && <SymbolBadge symbol={symbol} />}\n {description ? (\n <div className=\"humany-contact-link-rich-content\">\n {<StyledTitle>{title}</StyledTitle>}\n {\n <Description\n html={description}\n htmlParseInstruction={htmlParseInstruction}\n />\n }\n </div>\n ) : (\n <StyledTitle>{title}</StyledTitle>\n )}\n </StyledLink>\n );\n };\n\n return props.expanded ? (\n <Suspense fallback={null}>\n <ResolvedComponent {...props} renderDefault={renderLink} />\n </Suspense>\n ) : (\n renderLink()\n );\n};\n\nexport default ContactMethod;\n\nexport const contactLink = (p: { theme: Theme; description?: string }) => css`\n display: flex;\n padding: ${p.theme.sizes?.large};\n ${!!p.description ? '' : 'align-items: center;'}\n text-decoration: none;\n span {\n display: inline-block;\n color: ${p.theme.colors?.text};\n }\n i {\n font-size: ${p.theme.fonts?.large};\n margin: 0 ${p.theme.sizes?.large} 0 0;\n min-height: ${p.theme.fonts?.large};\n min-width: ${p.theme.fonts?.large};\n line-height: ${p.theme.fonts?.large};\n display: inline-block;\n vertical-align: bottom;\n color: ${p.theme.colors?.text};\n }\n`;\n\nconst StyledTitle = styled(StyledText)`\n line-height: ${(p) => p.theme.fonts?.large};\n`;\n\nconst StyledLink = styled(Link)`\n ${(p) => contactLink(p)}\n\n &:focus-visible {\n ${borderTabStyle};\n }\n`;\n\nconst NonResolvedContactMethodWrapper = styled.div`\n text-align: center;\n display: block;\n ${(p) => typeof p.theme.colors?.warning !== 'undefined' && `color: ${p.theme.colors?.warning};`}\n`;\n","import { css, Theme } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { DispatchAction, headingElement, ItemList, itemList } from '@telia-ace/knowledge-widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React, { ReactNode } from 'react';\nimport ContactMethod, { ContactMethodType } from './contact-method';\n\nexport const contactItemList = (p: { theme: Theme }) => css`\n ${itemList(p)}\n\n > div {\n padding: ${p.theme.sizes?.large};\n\n ${headingElement(p)(\n 'h1',\n css`\n margin: 0;\n `\n )}\n }\n\n > ul {\n &:not(:first-child) {\n border-top: ${p.theme.border};\n }\n\n > li {\n margin: 0;\n white-space: normal;\n\n > a {\n overflow: hidden;\n }\n\n &:first-child > a {\n border-radius: ${`${p.theme.borderRadius} ${p.theme.borderRadius} 0 0`};\n }\n\n &:last-child:not(:first-child) > a {\n border-radius: ${`0 0 ${p.theme.borderRadius} ${p.theme.borderRadius}`};\n }\n\n &:not(:last-child) {\n border-bottom: ${p.theme.border};\n }\n\n > div {\n padding: ${p.theme.sizes?.large};\n }\n }\n }\n\n @media (hover: hover) {\n a:hover {\n background-color: ${p.theme.colors?.accent};\n }\n }\n`;\n\nconst StyledItemList = styled(ItemList)`\n ${(p) => contactItemList(p)}\n`;\n\ntype Props = {\n contactMethods: ContactMethodType[];\n header?: string;\n className?: string;\n action?: (action: string, value?: any) => void;\n dispatch?: DispatchAction;\n children?: ReactNode;\n itemRenderer?: (cm: any, props: any) => JSX.Element;\n guideId?: string;\n};\n\nconst ContactList: React.FC<Props> = ({\n contactMethods,\n children,\n guideId,\n dispatch,\n className = '',\n itemRenderer,\n action = () => {},\n header = '',\n}) => {\n if (!contactMethods.length) {\n return null;\n }\n\n return (\n <StyledItemList\n header={header}\n className={appendClassNames(className, 'humany-contact-list')}\n items={contactMethods}\n renderItem={\n itemRenderer\n ? (cm: any) => (\n <li key={cm.id} data-contact-method={cm.id}>\n {itemRenderer(cm, { action, dispatch, guideId })}\n </li>\n )\n : (cm: any) => (\n <li key={cm.id} data-contact-method={cm.id}>\n <ContactMethod\n {...cm}\n action={action}\n dispatch={dispatch}\n guideId={guideId}\n />\n </li>\n )\n }\n >\n {children}\n </StyledItemList>\n );\n};\n\nexport default ContactList;\n","import { FormComponent } from '@telia-ace/widget-forms';\nimport React from 'react';\nimport { ContactMethodProps } from '.';\n\n/**\n * Recursively find form component in schema\n * @param node Form schema\n * @param id actionKey of component to find\n */\nconst lookupComponent = (node: any, id: string): any => {\n if (node.actionKey === id) {\n return node;\n }\n\n if (!node.properties) {\n return null;\n }\n\n const keys = Object.keys(node.properties);\n\n let result;\n // tslint:disable-next-line:no-increment-decrement\n for (let i = 0; i < keys.length; i++) {\n result = lookupComponent(node.properties[keys[i]], id);\n\n if (result) {\n return result;\n }\n }\n\n return false;\n};\n\nconst Form: React.FC<ContactMethodProps> = ({\n className,\n body: { form },\n id,\n action,\n dispatch,\n disabled,\n autoFocus,\n}) => {\n if (form && !disabled) {\n const { schema, layout, data, meta } = form;\n const trigger = dispatch || action || (() => {});\n return (\n <FormComponent\n className={className}\n schema={schema}\n layout={layout}\n data={data}\n autoFocus={autoFocus}\n onChange={(event: any, data: any) => {\n const form = { schema, layout, data, meta };\n if (event.toString() === 'submit') {\n trigger('submit', { id, form });\n } else {\n const formComponent = lookupComponent(schema, event);\n if (formComponent.evaluate) {\n trigger('evaluate', { id, form });\n } else {\n trigger('validate', { id, form });\n }\n }\n }}\n />\n );\n }\n\n return null;\n};\n\nexport default Form;\n","import { ComponentResolver } from '@telia-ace/knowledge-widget-core';\nimport { useContainer } from '@telia-ace/knowledge-widget-ui';\nimport { EventSubscriptionCancellation } from '@webprovisions/platform';\nimport { useEffect, useState } from 'react';\n\nconst useContactMethod = (clientName: string): any | null => {\n const [component, setComponent] = useState<any | null>(null);\n const container = useContainer();\n\n useEffect(() => {\n let unsubscribe: EventSubscriptionCancellation;\n container.getAsync('componentResolver').then((resolver: ComponentResolver) => {\n unsubscribe = resolver.registerResolver(clientName, (component) =>\n setComponent(component)\n );\n });\n\n return () => {\n if (unsubscribe) {\n unsubscribe();\n }\n };\n }, [clientName]);\n\n return component;\n};\n\nexport default useContactMethod;\n","import { Container } from '@webprovisions/platform';\nimport { ContactMethodPlatform, defaultComplete, defaultSubmit, defaultValidate } from '..';\n\nexport default function webServicePlugin(container: Container) {\n container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName: 'custom.webservice',\n render: 'email.form',\n onValidate: (contactMethod) => defaultValidate(container, contactMethod),\n onComplete: (contactMethod) => defaultComplete(container, contactMethod),\n onSubmit: (contactMethod) =>\n defaultSubmit(container, contactMethod, (response) => {\n return {\n ...response,\n ConfirmationText: response.ResponseHtml,\n };\n }),\n });\n });\n}\n","import { FormReader } from '@telia-ace/widget-forms';\nimport { Container } from '@webprovisions/platform';\nimport { ContactMethodPlatform, defaultComplete, defaultValidate } from './contact-methods';\n\nexport type Callback = (\n settings: {\n [key: string]: any;\n },\n data?: {\n [key: string]: any;\n }\n) => Promise<string | void> | (string | void);\n\nexport const createSubmitAdapter = (\n container: Container,\n clientName: string,\n fn: Callback\n): Promise<void> => {\n return container.getAsync('contactMethods').then((platform: ContactMethodPlatform) => {\n platform.create({\n clientName,\n render: 'email.form',\n handleClick: () => {\n return (e, cm) => {\n const {\n body: { form, guideId, confirmationFallback, ...rest },\n } = cm;\n if (!form) {\n e.preventDefault();\n fn(rest);\n }\n };\n },\n onValidate: (cm) => defaultValidate(container, cm),\n onComplete: (cm) => defaultComplete(container, cm),\n onSubmit: (cm) => {\n const {\n body: { form, guideId, confirmationFallback, ...rest },\n } = cm;\n const { values } = new FormReader(form).export();\n\n return Promise.resolve(fn(rest, values)).then((confirmation) => {\n return confirmation || confirmationFallback;\n });\n },\n });\n });\n};\n","import { Plugin } from '@telia-ace/knowledge-widget-core';\nimport { Container } from '@webprovisions/platform';\nimport {\n ChatPopupPlugin,\n EmailFormPlugin,\n FreeTextPlugin,\n LinkPlugin,\n PhonePlugin,\n WebServicePlugin,\n} from '.';\n\n/**\n * Registers default Humany contact methods.\n */\nexport class DefaultContactMethodsPlugin extends Plugin {\n constructor(container: Container, settings: any) {\n super(container, settings);\n const implementation = this.widget.implementation;\n implementation.configure((config) => {\n config\n .plugin(EmailFormPlugin)\n .plugin(ChatPopupPlugin)\n .plugin(FreeTextPlugin)\n .plugin(PhonePlugin)\n .plugin(WebServicePlugin)\n .plugin(LinkPlugin);\n });\n }\n}\n"],"names":["post","container","contactMethod","validate","services","formData","FormReader","router","matchingClient","params","submit","transform","response","ConfirmationText","result","evaluate","FormBuilder","complete","emailPlugin","platform","popup","title","settings","formValues","url","width","height","queries","link","part","key","value","chatPopupPlugin","body","_a","form","guideId","confirmationFallback","rest","__objRest","e","defaultValidate","defaultComplete","freeTextPlugin","linkPlugin","phonePlugin","handleContactMethod","adapters","__async","adapter","description","disabled","onClick","handleClick","handleDescription","handleDisabled","__spreadProps","__spreadValues","ContactMethodPlatform","componentPlatform","__publicField","input","next","contactMethods","promises","cm","guideComponent","handoverContactMethods","ComponentPlatform","lock","contactMethodPlatform","components","data","type","events","id","clientName","expanded","render","defaultEvaluate","resolver","lazy","s","ContactMethodPlatform$1","Description","styled","Html","genericHtml","borderTabStyle","linkTabStyle","ContactMethod","props","ResolvedComponent","useComponent","contactCategory","guideCategory","phrase","useRouteData","React","NonResolvedContactMethodWrapper","Typography","renderLink","extraProps","enhancedProps","symbol","inline","htmlParseInstruction","className","dispatch","linkProps","event","createParams","formatUrl","StyledLink","SymbolBadge","StyledTitle","Suspense","ContactMethod$1","contactLink","p","css","_b","_c","_d","_e","_f","_g","_h","StyledText","Link","contactItemList","itemList","headingElement","StyledItemList","ItemList","ContactList","children","itemRenderer","action","header","appendClassNames","ContactList$1","lookupComponent","node","keys","i","Form","autoFocus","schema","layout","meta","trigger","FormComponent","Form$1","useContactMethod","component","setComponent","useState","useContainer","useEffect","unsubscribe","useContactMethod$1","webServicePlugin","defaultSubmit","createSubmitAdapter","fn","values","confirmation","DefaultContactMethodsPlugin","Plugin","config","EmailFormPlugin","ChatPopupPlugin","FreeTextPlugin","PhonePlugin","WebServicePlugin","LinkPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,IAAO,CAACC,GAAsBC,GAAkCC,IAAW,OAC7EF,EAAU,aAAa,kBAAkB,QAAQ,EAAE,KAAK,CAACG,MAAa;AAC5D,QAAA,EAAE,UAAAC,MAAa,IAAIC,EAAWJ,EAAc,KAAK,IAAI,EAAE,OAAOC,CAAQ,GACtE,EAAE,QAAAI,GAAQ,gBAAAC,EAAmB,IAAAJ,GAC7B,EAAE,QAAAK,EAAA,IAAWF,EAAO,aAAa;AAEvC,SAAOC,EAAe;AAAA,IAClB,kBAAkBN,EAAc,KAAKC,IAAW,0BAA0B;AAAA,IAC1E;AAAA,IACA;AAAA,MACI,MAAME;AAAA,MACN,eAAe;AAAA,QACX,SAASH,EAAc,KAAK,WAAWO,EAAO;AAAA,MAClD;AAAA,IACJ;AAAA,EAAA;AAER,CAAC,GAEQC,IAAS,CAClBT,GACAC,GACAS,MAEAX,EAAKC,GAAWC,CAAa,EACxB,KAAK,CAACU,MAAcD,IAAYA,EAAUC,CAAQ,IAAIA,CAAS,EAC/D,KAAK,CAAC,EAAE,kBAAAC,EAAiB,MAA2BA,CAAgB,GAEhEV,IAAW,CAACF,GAAsBC,MAC3CF,EAAKC,GAAWC,GAAe,EAAI,EAAE,KAAK,CAACY,OAAsC;AAAA,EAC7E,OAAOA,EAAO,WAAW;AAAA,EACzB,QAAQA,EAAO,WAAW;AAAA,EAC1B,YAAYA,EAAO,WAAW;AAClC,EAAE,GAEOC,IAAW,CAACd,GAAsBC,MAC3CF,EAAKC,GAAWC,GAAe,EAAI,EAAE;AAAA,EAAK,CAACY,MACvCE,EAAY,eAAed,EAAc,IAAIY,EAAO,cAA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