@telia-ace/widget-conversation 1.0.41 → 1.1.1-rc.0

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.
Files changed (58) hide show
  1. package/{dist/components → components}/conversation/ui/styles.d.ts +3 -3
  2. package/conversation-78019545.mjs +1388 -0
  3. package/conversation-905bdeb3.js +569 -0
  4. package/{dist/conversation-controller.d.ts → conversation-controller.d.ts} +2 -2
  5. package/index-1180f4a4.js +1212 -0
  6. package/index-bfc77c45.mjs +11311 -0
  7. package/index.js +1 -0
  8. package/index.mjs +15 -0
  9. package/package.json +19 -41
  10. package/return-button-7560bd06.js +93 -0
  11. package/{dist/return-button-17ecf4af.js → return-button-f3f52295.mjs} +39 -49
  12. package/use-dispatch-7cf7db21.js +1 -0
  13. package/use-dispatch-86019505.mjs +24 -0
  14. package/LICENSE.txt +0 -6
  15. package/README.md +0 -485
  16. package/dist/conversation-5f8374bf.js +0 -1376
  17. package/dist/conversation-5f8374bf.js.map +0 -1
  18. package/dist/conversation-form-adapter.d.ts +0 -7
  19. package/dist/index.js +0 -960
  20. package/dist/index.js.map +0 -1
  21. package/dist/resolve-entity-value.d.ts +0 -10
  22. package/dist/return-button-17ecf4af.js.map +0 -1
  23. /package/{dist/agent.d.ts → agent.d.ts} +0 -0
  24. /package/{dist/components → components}/conversation/conversation.d.ts +0 -0
  25. /package/{dist/components → components}/conversation/plugin.d.ts +0 -0
  26. /package/{dist/components → components}/conversation/ui/content.d.ts +0 -0
  27. /package/{dist/components → components}/conversation/ui/input.d.ts +0 -0
  28. /package/{dist/components → components}/conversation/ui/loader.d.ts +0 -0
  29. /package/{dist/components → components}/conversation/ui/message-list-items/button-list.d.ts +0 -0
  30. /package/{dist/components → components}/conversation/ui/message-list-items/custom.d.ts +0 -0
  31. /package/{dist/components → components}/conversation/ui/message-list-items/html.d.ts +0 -0
  32. /package/{dist/components → components}/conversation/ui/message-list-items/item-list.d.ts +0 -0
  33. /package/{dist/components → components}/conversation/ui/message-list-items/link-list.d.ts +0 -0
  34. /package/{dist/components → components}/conversation/ui/message-list-items/separator.d.ts +0 -0
  35. /package/{dist/components → components}/conversation/ui/message-list-items/text.d.ts +0 -0
  36. /package/{dist/components → components}/conversation/ui/message-list-items/video-request.d.ts +0 -0
  37. /package/{dist/components → components}/conversation/ui/message-types/agent.d.ts +0 -0
  38. /package/{dist/components → components}/conversation/ui/message-types/index.d.ts +0 -0
  39. /package/{dist/components → components}/conversation/ui/message-types/message-list.d.ts +0 -0
  40. /package/{dist/components → components}/conversation/ui/message-types/system.d.ts +0 -0
  41. /package/{dist/components → components}/conversation/ui/message-types/timestamp.d.ts +0 -0
  42. /package/{dist/components → components}/conversation/ui/message-types/user.d.ts +0 -0
  43. /package/{dist/components → components}/conversation/ui/message.d.ts +0 -0
  44. /package/{dist/components → components}/conversation/ui/overlay-outlets.d.ts +0 -0
  45. /package/{dist/components → components}/return-button/plugin.d.ts +0 -0
  46. /package/{dist/components → components}/return-button/return-button.d.ts +0 -0
  47. /package/{dist/conversation-history.d.ts → conversation-history.d.ts} +0 -0
  48. /package/{dist/conversation-platform.d.ts → conversation-platform.d.ts} +0 -0
  49. /package/{dist/conversation-provider.d.ts → conversation-provider.d.ts} +0 -0
  50. /package/{dist/index.d.ts → index.d.ts} +0 -0
  51. /package/{dist/store.d.ts → store.d.ts} +0 -0
  52. /package/{dist/types.d.ts → types.d.ts} +0 -0
  53. /package/{dist/user.d.ts → user.d.ts} +0 -0
  54. /package/{dist/utils → utils}/custom-message.d.ts +0 -0
  55. /package/{dist/utils → utils}/index.d.ts +0 -0
  56. /package/{dist/utils → utils}/map-actions.d.ts +0 -0
  57. /package/{dist/utils → utils}/open-chat-widget.d.ts +0 -0
  58. /package/{dist/utils → utils}/swap-provider.d.ts +0 -0
package/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-1180f4a4.js");require("react/jsx-runtime");require("react");require("react-dom");exports.ConversationComponent=e.ConversationComponent;exports.ConversationController=e.ConversationController;exports.ConversationEndedBehavior=e.ConversationEndedBehavior;exports.ConversationEntry=e.ConversationEntry;exports.ConversationMessageListItemType=e.ConversationMessageListItemType;exports.ConversationMessageType=e.ConversationMessageType;exports.ConversationPlatform=e.ConversationPlatform;exports.ConversationReturnButtonComponent=e.ConversationReturnButtonComponent;exports.registerCustomMessageComponent=e.registerCustomMessageComponent;
package/index.mjs ADDED
@@ -0,0 +1,15 @@
1
+ import { y as a, A as r, x as i, D as C, C as m, p, w as v, z as g, E as y } from "./index-bfc77c45.mjs";
2
+ import "react/jsx-runtime";
3
+ import "react";
4
+ import "react-dom";
5
+ export {
6
+ a as ConversationComponent,
7
+ r as ConversationController,
8
+ i as ConversationEndedBehavior,
9
+ C as ConversationEntry,
10
+ m as ConversationMessageListItemType,
11
+ p as ConversationMessageType,
12
+ v as ConversationPlatform,
13
+ g as ConversationReturnButtonComponent,
14
+ y as registerCustomMessageComponent
15
+ };
package/package.json CHANGED
@@ -1,49 +1,27 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-conversation",
3
- "version": "1.0.41",
4
- "description": "ACE Widget Conversation Platform",
5
- "license": "SEE LICENSE IN LICENSE.txt",
6
- "author": "Telia Company AB",
7
- "keywords": [
8
- "telia"
9
- ],
10
- "main": "dist/index.js",
11
- "sourceMain": "src/index.ts",
12
- "type": "module",
13
- "types": "dist/index.d.ts",
14
- "files": [
15
- "LICENSE.txt",
16
- "README.md",
17
- "dist/"
18
- ],
19
- "publishConfig": {
20
- "access": "public"
3
+ "version": "1.1.1-rc.0",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./index.mjs",
9
+ "require": "./index.js"
10
+ }
21
11
  },
22
- "sideEffects": false,
23
12
  "dependencies": {
24
- "@telia-ace/widget-core": "1.0.28",
25
- "@telia-ace/widget-forms": "1.0.35",
26
- "@telia-ace/widget-plugins": "1.0.29",
27
- "@telia-ace/widget-routing": "1.0.29",
28
- "@telia-ace/widget-services": "1.0.28",
29
- "@telia-ace/widget-ui": "1.0.35",
30
- "@telia-ace/widget-utilities": "1.0.17",
31
- "@webprovisions/platform": "^1.1.3"
32
- },
33
- "devDependencies": {
34
- "@emotion/react": "^11.10.5",
35
- "@emotion/styled": "^11.10.5",
36
- "@telia-ace/widget-developer-tools": "1.0.23",
37
- "@types/react": "^18.0.27",
38
- "react": "^18.2.0"
13
+ "@telia-ace/widget-core": "^1.1.1-rc.0",
14
+ "@telia-ace/widget-forms": "^1.1.1-rc.0",
15
+ "@telia-ace/widget-plugins": "^1.1.1-rc.0",
16
+ "@telia-ace/widget-routing": "^1.1.1-rc.0",
17
+ "@telia-ace/widget-services": "^1.1.1-rc.0",
18
+ "@telia-ace/widget-ui": "^1.1.1-rc.0",
19
+ "@telia-ace/widget-utilities": "^1.1.1-rc.0",
20
+ "@webprovisions/platform": "^1.1.4"
39
21
  },
40
22
  "peerDependencies": {
41
- "@emotion/react": "^11.10.5",
42
- "@emotion/styled": "^11.10.5",
43
- "react": "^18.2.0"
44
- },
45
- "scripts": {
46
- "clean": "rimraf ./dist",
47
- "build": "rimraf ./dist && tsc -emitDeclarationOnly && vite build"
23
+ "@emotion/styled": "11.11.0",
24
+ "react": "18.2.0",
25
+ "@emotion/react": "11.11.1"
48
26
  }
49
27
  }
@@ -0,0 +1,93 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index-1180f4a4.js");require("react");require("react-dom");const g=require("./use-dispatch-7cf7db21.js"),u=({className:e,...t})=>{const{label:r,active:a,mode:i="flat",alert:l={}}=o.useProperties(),{symbol:n,label:c,show:d}=l,m=g.useDispatch();return a?s.jsxs(x,{className:e,mode:i,"aria-label":r,onClick:()=>{m("toggle")},children:[s.jsx(p,{children:r}),n&&s.jsx(y,{showAlert:d,children:s.jsx(o.SymbolBadge,{symbol:n,title:c,size:20})})]}):null},f=e=>{var t,r,a;return o.keyframes`
2
+ 0% {
3
+ background-color: ${(t=e.theme.colors)==null?void 0:t.primary};
4
+ }
5
+ 50% {
6
+ background-color: ${(r=e.theme.colors)==null?void 0:r.accent};
7
+ }
8
+ 100 {
9
+ background-color: ${(a=e.theme.colors)==null?void 0:a.primary};
10
+ }
11
+ `},h=o.keyframes`
12
+ 0% {
13
+ background-position:0% 51%
14
+ }
15
+ 50% {
16
+ background-position:100% 0%
17
+ }
18
+ 100% {
19
+ background-position:0% 51%
20
+ }
21
+ `,b=o.keyframes`
22
+ 0% {
23
+ transform: rotate(0deg) scale(1.00);
24
+ }
25
+ 50% {
26
+ transform: rotate(0deg) scale(1.00);
27
+ }
28
+ 55% {
29
+ transform: rotate(-3deg) scale(0.80);
30
+ }
31
+ 60% {
32
+ transform: rotate(-3deg) scale(0.80);
33
+ }
34
+ 65% {
35
+ transform: rotate(3deg) scale(1.20);
36
+ }
37
+ 70% {
38
+ transform: rotate(-3deg) scale(1.20);
39
+ }
40
+ 75% {
41
+ transform: rotate(3deg) scale(1.20);
42
+ }
43
+ 80% {
44
+ transform: rotate(-3deg) scale(1.20);
45
+ }
46
+ 85% {
47
+ transform: rotate(3deg) scale(1.20);
48
+ }
49
+ 90% {
50
+ transform: rotate(-3deg) scale(1.20);
51
+ }
52
+ 95% {
53
+ transform: rotate(3deg) scale(1.20);
54
+ }
55
+ 100% {
56
+ transform: rotate(0deg) scale(1);
57
+ }
58
+ `,y=o.newStyled.span`
59
+ flex-grow: 0;
60
+ transform: translateX(${e=>e.showAlert?"0px":"50px"});
61
+ opacity: ${e=>e.showAlert?1:0};
62
+ transition: transform 0.5s ease, opacity 0.3s ease;
63
+ `,p=o.newStyled.span`
64
+ flex: 1;
65
+ font-weight: 300;
66
+ `,$=e=>o.css`
67
+ animation: ${f(e)} 1s ease infinite;
68
+ `,k=e=>{var t,r;return o.css`
69
+ background: linear-gradient(155deg, ${(t=e.theme.colors)==null?void 0:t.primary}, ${(r=e.theme.colors)==null?void 0:r.accent});
70
+ background-position: 0px 0px;
71
+ background-size: 200% 200%;
72
+ animation: ${h} 1.5s ease infinite;
73
+ `},x=o.newStyled(o.Button)`
74
+ overflow: hidden;
75
+ padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
76
+ border-radius: ${e=>e.theme.borderRadius};
77
+ color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
78
+ ${e=>e.mode==="flashing"?$:e.mode==="flashingGradient"?k:""}
79
+ background-color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ i,
84
+ svg {
85
+ animation: ${b} 3s ease infinite;
86
+ }
87
+
88
+ &:focus-visible {
89
+ ${e=>o.borderTabStyle(e)}
90
+ background: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
91
+ color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
92
+ }
93
+ `;exports.default=u;
@@ -1,48 +1,39 @@
1
- var c = Object.getOwnPropertySymbols;
2
- var y = Object.prototype.hasOwnProperty, $ = Object.prototype.propertyIsEnumerable;
3
- var m = (e, t) => {
4
- var r = {};
5
- for (var o in e)
6
- y.call(e, o) && t.indexOf(o) < 0 && (r[o] = e[o]);
7
- if (e != null && c)
8
- for (var o of c(e))
9
- t.indexOf(o) < 0 && $.call(e, o) && (r[o] = e[o]);
10
- return r;
11
- };
12
- import { keyframes as n, css as d } from "@emotion/react";
13
- import s from "@emotion/styled";
14
- import { useProperties as k, useDispatch as x, SymbolBadge as S, Button as w, borderTabStyle as A } from "@telia-ace/widget-ui";
15
- import a from "react";
16
- const F = (r) => {
17
- var o = r, { className: e } = o, t = m(o, ["className"]);
18
- const { label: l, active: g, mode: f = "flat", alert: h = {} } = k(), { symbol: i, label: u, show: b } = h, p = x();
19
- return g ? /* @__PURE__ */ a.createElement(
20
- H,
1
+ import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
+ import { d as u, S as b, k as s, n, B as p, b as y, c as l } from "./index-bfc77c45.mjs";
3
+ import "react";
4
+ import "react-dom";
5
+ import { a as $ } from "./use-dispatch-86019505.mjs";
6
+ const L = ({ className: e, ...t }) => {
7
+ const { label: o, active: r, mode: c = "flat", alert: d = {} } = u(), { symbol: i, label: m, show: g } = d, f = $();
8
+ return r ? /* @__PURE__ */ h(
9
+ j,
21
10
  {
22
11
  className: e,
23
- mode: f,
24
- "aria-label": l,
12
+ mode: c,
13
+ "aria-label": o,
25
14
  onClick: () => {
26
- p("toggle");
27
- }
28
- },
29
- /* @__PURE__ */ a.createElement(G, null, l),
30
- i && /* @__PURE__ */ a.createElement(z, { showAlert: b }, /* @__PURE__ */ a.createElement(S, { symbol: i, title: u, size: 20 }))
15
+ f("toggle");
16
+ },
17
+ children: [
18
+ /* @__PURE__ */ a(A, { children: o }),
19
+ i && /* @__PURE__ */ a(w, { showAlert: g, children: /* @__PURE__ */ a(b, { symbol: i, title: m, size: 20 }) })
20
+ ]
21
+ }
31
22
  ) : null;
32
- }, v = (e) => {
33
- var t, r, o;
34
- return n`
23
+ }, k = (e) => {
24
+ var t, o, r;
25
+ return s`
35
26
  0% {
36
27
  background-color: ${(t = e.theme.colors) == null ? void 0 : t.primary};
37
28
  }
38
29
  50% {
39
- background-color: ${(r = e.theme.colors) == null ? void 0 : r.accent};
30
+ background-color: ${(o = e.theme.colors) == null ? void 0 : o.accent};
40
31
  }
41
32
  100 {
42
- background-color: ${(o = e.theme.colors) == null ? void 0 : o.primary};
33
+ background-color: ${(r = e.theme.colors) == null ? void 0 : r.primary};
43
34
  }
44
35
  `;
45
- }, B = n`
36
+ }, x = s`
46
37
  0% {
47
38
  background-position:0% 51%
48
39
  }
@@ -52,7 +43,7 @@ const F = (r) => {
52
43
  100% {
53
44
  background-position:0% 51%
54
45
  }
55
- `, E = n`
46
+ `, S = s`
56
47
  0% {
57
48
  transform: rotate(0deg) scale(1.00);
58
49
  }
@@ -89,25 +80,25 @@ const F = (r) => {
89
80
  100% {
90
81
  transform: rotate(0deg) scale(1);
91
82
  }
92
- `, z = s.span`
83
+ `, w = n.span`
93
84
  flex-grow: 0;
94
85
  transform: translateX(${(e) => e.showAlert ? "0px" : "50px"});
95
86
  opacity: ${(e) => e.showAlert ? 1 : 0};
96
87
  transition: transform 0.5s ease, opacity 0.3s ease;
97
- `, G = s.span`
88
+ `, A = n.span`
98
89
  flex: 1;
99
90
  font-weight: 300;
100
- `, R = (e) => d`
101
- animation: ${v(e)} 1s ease infinite;
102
- `, C = (e) => {
103
- var t, r;
104
- return d`
105
- background: linear-gradient(155deg, ${(t = e.theme.colors) == null ? void 0 : t.primary}, ${(r = e.theme.colors) == null ? void 0 : r.accent});
91
+ `, B = (e) => l`
92
+ animation: ${k(e)} 1s ease infinite;
93
+ `, v = (e) => {
94
+ var t, o;
95
+ return l`
96
+ background: linear-gradient(155deg, ${(t = e.theme.colors) == null ? void 0 : t.primary}, ${(o = e.theme.colors) == null ? void 0 : o.accent});
106
97
  background-position: 0px 0px;
107
98
  background-size: 200% 200%;
108
- animation: ${B} 1.5s ease infinite;
99
+ animation: ${x} 1.5s ease infinite;
109
100
  `;
110
- }, H = s(w)`
101
+ }, j = n(p)`
111
102
  overflow: hidden;
112
103
  padding: ${(e) => {
113
104
  var t;
@@ -118,7 +109,7 @@ const F = (r) => {
118
109
  var t;
119
110
  return (t = e.theme.colors) == null ? void 0 : t.text;
120
111
  }};
121
- ${(e) => e.mode === "flashing" ? R : e.mode === "flashingGradient" ? C : ""}
112
+ ${(e) => e.mode === "flashing" ? B : e.mode === "flashingGradient" ? v : ""}
122
113
  background-color: ${(e) => {
123
114
  var t;
124
115
  return (t = e.theme.colors) == null ? void 0 : t.primary;
@@ -128,11 +119,11 @@ const F = (r) => {
128
119
  justify-content: center;
129
120
  i,
130
121
  svg {
131
- animation: ${E} 3s ease infinite;
122
+ animation: ${S} 3s ease infinite;
132
123
  }
133
124
 
134
125
  &:focus-visible {
135
- ${(e) => A(e)}
126
+ ${(e) => y(e)}
136
127
  background: ${(e) => {
137
128
  var t;
138
129
  return (t = e.theme.colors) == null ? void 0 : t.text;
@@ -144,6 +135,5 @@ const F = (r) => {
144
135
  }
145
136
  `;
146
137
  export {
147
- F as default
138
+ L as default
148
139
  };
149
- //# sourceMappingURL=return-button-17ecf4af.js.map
@@ -0,0 +1 @@
1
+ "use strict";const r=require("./index-1180f4a4.js"),i=require("react"),p=()=>i.useContext(r.ComponentNodeContext),l=()=>{const o=r.useComponentPlatform(),s=p(),[c,a]=i.useState([]),[d,h]=i.useState();return i.useEffect(()=>{if(o&&s){const u=new r.ComponentQuery(o).withId(s.id),t=o.actions(u,s.type||r.uuid());h(t),c!==null&&(c.forEach(e=>{t.dispatch(e.key,e.data).then(n=>e.resolve(n)).catch(n=>e.reject(n))}),a(null))}},[o,s.id]),(u,t)=>c!==null?new Promise((e,n)=>{c.push({key:u,data:t,resolve:e,reject:n})}):d.dispatch(u,t)};exports.useComponentDescriptor=p;exports.useDispatch=l;
@@ -0,0 +1,24 @@
1
+ import { r as f, s as m, t as d, v as h } from "./index-bfc77c45.mjs";
2
+ import { useContext as l, useState as u, useEffect as C } from "react";
3
+ const w = () => l(f), y = () => {
4
+ const s = m(), n = w(), [c, a] = u([]), [i, p] = u();
5
+ return C(() => {
6
+ if (s && n) {
7
+ const r = new d(s).withId(n.id), o = s.actions(r, n.type || h());
8
+ p(o), c !== null && (c.forEach((t) => {
9
+ o.dispatch(t.key, t.data).then((e) => t.resolve(e)).catch((e) => t.reject(e));
10
+ }), a(null));
11
+ }
12
+ }, [s, n.id]), (r, o) => c !== null ? new Promise((t, e) => {
13
+ c.push({
14
+ key: r,
15
+ data: o,
16
+ resolve: t,
17
+ reject: e
18
+ });
19
+ }) : i.dispatch(r, o);
20
+ };
21
+ export {
22
+ y as a,
23
+ w as u
24
+ };
package/LICENSE.txt DELETED
@@ -1,6 +0,0 @@
1
- Copyright © 2021, Telia Company AB. All rights reserved.
2
-
3
- THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
4
- THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
5
- AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
6
- http://www.humany.com/legal