@telia-ace/knowledge-widget-adapters 1.0.44-experimental.8 → 1.0.44
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/email/email-form-component.d.ts +1 -1
- package/dist/contact-methods/email/email-plugin.d.ts +1 -2
- package/dist/contact-methods/free-text/free-text-component.d.ts +1 -1
- package/dist/contact-methods/index.d.ts +2 -1
- package/dist/contact-methods/link/link-component.d.ts +1 -1
- package/dist/contact-methods/phone/phone-component.d.ts +1 -1
- package/dist/contact-methods/platform.d.ts +1 -1
- package/dist/contact-methods/ui/contact-list.d.ts +18 -2
- package/dist/contact-methods/ui/contact-method.d.ts +41 -1
- package/dist/contact-methods/ui/description.d.ts +3 -4
- package/dist/contact-methods/ui/form.d.ts +2 -1
- package/dist/contact-methods/ui/index.d.ts +3 -0
- package/dist/email-form-component.c12f6804.js +65 -0
- package/dist/email-form-component.c12f6804.js.map +1 -0
- package/dist/free-text-component.c06abc12.js +20 -0
- package/dist/free-text-component.c06abc12.js.map +1 -0
- package/dist/index.c1d1bd5b.js +581 -0
- package/dist/index.c1d1bd5b.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +27 -350
- package/dist/index.js.map +1 -1
- package/dist/link-component.484bbcf2.js.map +1 -1
- package/dist/phone-component.0c878514.js.map +1 -1
- package/package.json +7 -7
- package/dist/email-form-component.26ca3985.js +0 -6
- package/dist/email-form-component.26ca3985.js.map +0 -1
- package/dist/free-text-component.037b4db9.js +0 -11
- package/dist/free-text-component.037b4db9.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SubmissionApiResult } from '@telia-ace/knowledge-serviceclient';
|
|
2
2
|
import { Container } from '@webprovisions/platform';
|
|
3
|
-
|
|
3
|
+
import { ContactMethodType } from '../ui';
|
|
4
4
|
export declare const submit: (container: Container, contactMethod: ContactMethodType, transform?: ((response: any) => SubmissionApiResult) | undefined) => Promise<string>;
|
|
5
5
|
export declare const validate: (container: Container, contactMethod: ContactMethodType) => Promise<{
|
|
6
6
|
valid: boolean;
|
|
@@ -14,4 +14,3 @@ export declare const validate: (container: Container, contactMethod: ContactMeth
|
|
|
14
14
|
export declare const evaluate: (container: Container, contactMethod: ContactMethodType) => Promise<import("@telia-ace/widget-forms").Form>;
|
|
15
15
|
export declare const complete: (container: Container, contactMethod: ContactMethodType) => Promise<void>;
|
|
16
16
|
export default function emailPlugin(container: Container): void;
|
|
17
|
-
export {};
|
|
@@ -5,5 +5,6 @@ export { LinkPlugin } from './link';
|
|
|
5
5
|
export { PhonePlugin } from './phone';
|
|
6
6
|
export { default as ContactMethodPlatform } from './platform';
|
|
7
7
|
export type { Click as ContactMethodClick, ReactComponentImport } from './platform';
|
|
8
|
-
export { Form as DefaultForm, useContactMethod, } from './ui';
|
|
8
|
+
export { contactItemList, contactLink, ContactList, ContactMethod, Form as DefaultForm, useContactMethod, } from './ui';
|
|
9
|
+
export type { ContactMethodType } from './ui';
|
|
9
10
|
export { WebServicePlugin } from './web-service';
|
|
@@ -2,7 +2,7 @@ import { ComponentPlatform } from '@telia-ace/knowledge-widget-core';
|
|
|
2
2
|
import { Form } from '@telia-ace/widget-forms';
|
|
3
3
|
import { Container } from '@webprovisions/platform';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
|
|
5
|
+
import { ContactMethodProps } from './ui';
|
|
6
6
|
export type ReactComponentImport = Promise<{
|
|
7
7
|
default: React.FunctionComponent<any>;
|
|
8
8
|
}>;
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
import { DispatchAction } from '@telia-ace/knowledge-widget-ui';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
import { ContactMethodType } from './contact-method';
|
|
5
|
+
export declare const contactItemList: (p: {
|
|
6
|
+
theme: Theme;
|
|
7
|
+
}) => import("@emotion/react").SerializedStyles;
|
|
8
|
+
type Props = {
|
|
9
|
+
contactMethods: ContactMethodType[];
|
|
10
|
+
header?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
action?: (action: string, value?: any) => void;
|
|
13
|
+
dispatch?: DispatchAction;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
itemRenderer?: (cm: any, props: any) => JSX.Element;
|
|
16
|
+
guideId?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const ContactList: React.FC<Props>;
|
|
3
19
|
export default ContactList;
|
|
@@ -1 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
import { Symbol } from '@telia-ace/knowledge-widget-core';
|
|
3
|
+
import { DispatchAction, HtmlParseInstruction } from '@telia-ace/knowledge-widget-ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export type ContactMethodType = {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
symbol?: Symbol;
|
|
9
|
+
clientName: string;
|
|
10
|
+
expanded: boolean;
|
|
11
|
+
inline: boolean;
|
|
12
|
+
body: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
description?: string;
|
|
16
|
+
confirmation?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
guideId?: string;
|
|
19
|
+
};
|
|
20
|
+
export type Props = Merge<ContactMethodType, {
|
|
21
|
+
className?: string;
|
|
22
|
+
onClick?: (event: React.MouseEvent, properties: Props) => void;
|
|
23
|
+
renderDefault?: (extraProps?: Partial<Props>) => any;
|
|
24
|
+
htmlParseInstruction?: HtmlParseInstruction;
|
|
25
|
+
href?: string;
|
|
26
|
+
target?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
action?: (action: string, value: any) => void;
|
|
29
|
+
dispatch?: DispatchAction;
|
|
30
|
+
symbol?: Symbol;
|
|
31
|
+
description?: string;
|
|
32
|
+
confirmation?: string;
|
|
33
|
+
guideId?: string;
|
|
34
|
+
autoFocus?: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
declare const ContactMethod: React.FC<Props>;
|
|
37
|
+
export default ContactMethod;
|
|
38
|
+
export declare const contactLink: (p: {
|
|
39
|
+
theme: Theme;
|
|
40
|
+
description?: string;
|
|
41
|
+
}) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const _default: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
2
|
+
declare const _default: import("@emotion/styled").StyledComponent<any, {}, {
|
|
3
|
+
ref?: import("react").Ref<any> | undefined;
|
|
4
|
+
}>;
|
|
6
5
|
export default _default;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { default as Confirmation } from './confirmation';
|
|
2
|
+
export { contactItemList, default as ContactList } from './contact-list';
|
|
3
|
+
export { contactLink, default as ContactMethod } from './contact-method';
|
|
4
|
+
export type { ContactMethodType, Props as ContactMethodProps } from './contact-method';
|
|
2
5
|
export { default as Description } from './description';
|
|
3
6
|
export { default as Form } from './form';
|
|
4
7
|
export { default as useContactMethod } from './use-contact-method';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var h = Object.defineProperty, u = Object.defineProperties;
|
|
2
|
+
var p = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var r = Object.getOwnPropertySymbols;
|
|
4
|
+
var y = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var a = (m, t, e) => t in m ? h(m, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[t] = e, n = (m, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
y.call(t, e) && a(m, e, t[e]);
|
|
8
|
+
if (r)
|
|
9
|
+
for (var e of r(t))
|
|
10
|
+
E.call(t, e) && a(m, e, t[e]);
|
|
11
|
+
return m;
|
|
12
|
+
}, i = (m, t) => u(m, p(t));
|
|
13
|
+
import { css as N } from "@emotion/react";
|
|
14
|
+
import g from "@emotion/styled";
|
|
15
|
+
import { Html as F, genericHtml as H, headingElement as $ } from "@telia-ace/knowledge-widget-ui";
|
|
16
|
+
import { appendClassNames as l } from "@telia-ace/widget-utilities";
|
|
17
|
+
import s from "react";
|
|
18
|
+
import { F as b } from "./index.c1d1bd5b.js";
|
|
19
|
+
import "@telia-ace/widget-forms";
|
|
20
|
+
import "@telia-ace/knowledge-widget-core";
|
|
21
|
+
const C = g(F)`
|
|
22
|
+
${H}
|
|
23
|
+
|
|
24
|
+
${(m) => {
|
|
25
|
+
var t;
|
|
26
|
+
return $(m)(
|
|
27
|
+
"h1",
|
|
28
|
+
N`
|
|
29
|
+
font-weight: normal;
|
|
30
|
+
font-size: ${(t = m.theme.fonts) == null ? void 0 : t.medium};
|
|
31
|
+
`
|
|
32
|
+
);
|
|
33
|
+
}}
|
|
34
|
+
`, k = (m) => {
|
|
35
|
+
const {
|
|
36
|
+
className: t,
|
|
37
|
+
renderDefault: e = () => {
|
|
38
|
+
},
|
|
39
|
+
body: { form: c },
|
|
40
|
+
confirmation: o,
|
|
41
|
+
htmlParseInstruction: f,
|
|
42
|
+
disabled: d
|
|
43
|
+
} = m;
|
|
44
|
+
return o ? /* @__PURE__ */ s.createElement(
|
|
45
|
+
C,
|
|
46
|
+
{
|
|
47
|
+
className: l(
|
|
48
|
+
t,
|
|
49
|
+
"humany-contact-method-confirmation",
|
|
50
|
+
"humany-contact-method-email"
|
|
51
|
+
),
|
|
52
|
+
html: o,
|
|
53
|
+
htmlParseInstruction: f
|
|
54
|
+
}
|
|
55
|
+
) : c && !d ? /* @__PURE__ */ s.createElement(
|
|
56
|
+
b,
|
|
57
|
+
i(n({}, m), {
|
|
58
|
+
className: l(t, "humany-contact-method-email")
|
|
59
|
+
})
|
|
60
|
+
) : e();
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
k as default
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=email-form-component.c12f6804.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-form-component.c12f6804.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;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import l from "@emotion/styled";
|
|
2
|
+
import { Html as a, genericHtml as n } from "@telia-ace/knowledge-widget-ui";
|
|
3
|
+
import { appendClassNames as p } from "@telia-ace/widget-utilities";
|
|
4
|
+
import t from "react";
|
|
5
|
+
import { D as i } from "./index.c1d1bd5b.js";
|
|
6
|
+
import "@telia-ace/widget-forms";
|
|
7
|
+
import "@telia-ace/knowledge-widget-core";
|
|
8
|
+
import "@emotion/react";
|
|
9
|
+
const x = ({
|
|
10
|
+
className: o,
|
|
11
|
+
description: e,
|
|
12
|
+
body: { freetext: m },
|
|
13
|
+
htmlParseInstruction: r
|
|
14
|
+
}) => m ? /* @__PURE__ */ t.createElement("div", { className: p(o, "humany-contact-method-free-text") }, /* @__PURE__ */ t.createElement(c, { html: m, htmlParseInstruction: r }), e && /* @__PURE__ */ t.createElement(i, { html: e, htmlParseInstruction: r })) : null, c = l(a)`
|
|
15
|
+
${n};
|
|
16
|
+
`;
|
|
17
|
+
export {
|
|
18
|
+
x as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=free-text-component.c06abc12.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free-text-component.c06abc12.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;"}
|