@telia-ace/widget-conversation 1.1.2-rc.0 → 1.1.2-rc.2
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/{conversation-b5103766.mjs → conversation-2acab7f7.mjs} +394 -344
- package/{conversation-cba1688c.js → conversation-eb4d6944.js} +320 -320
- package/index.js +1 -1
- package/index.mjs +64 -24
- package/package.json +8 -8
- package/{return-button-70a640cb.mjs → return-button-3e542ab7.mjs} +47 -31
- package/{return-button-cdc53d1f.js → return-button-f1f43984.js} +33 -29
- package/types.d.ts +16 -4
- package/utils/index.d.ts +1 -1
|
@@ -64,40 +64,40 @@
|
|
|
64
64
|
fill: ${e=>{var t;return e.hasContent?(t=e.theme.colors)==null?void 0:t.primary:"#a6a6a6"}};
|
|
65
65
|
}
|
|
66
66
|
`,se=a.div`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
width: ${e=>e.avatarSize||"32px"};
|
|
68
|
+
height: ${e=>e.avatarSize||"32px"};
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
background-color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.accent}};
|
|
71
|
+
border: ${e=>e.theme.border};
|
|
72
|
+
grid-area: avatar;
|
|
73
|
+
align-self: flex-end;
|
|
74
|
+
justify-self: center;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
margin-right: 10px;
|
|
77
|
+
display: flex;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
align-items: center;
|
|
80
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
> img {
|
|
83
|
+
height: 100%;
|
|
84
|
+
width: 100%;
|
|
85
|
+
object-fit: cover;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
> svg {
|
|
89
|
+
width: 90%;
|
|
90
|
+
height: 90%;
|
|
91
|
+
padding: 10%;
|
|
92
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
line,
|
|
95
|
-
path,
|
|
96
|
-
circle,
|
|
97
|
-
fill {
|
|
98
|
-
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
99
|
-
}
|
|
94
|
+
line,
|
|
95
|
+
path,
|
|
96
|
+
circle,
|
|
97
|
+
fill {
|
|
98
|
+
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
100
99
|
}
|
|
100
|
+
}
|
|
101
101
|
`,ne=y.keyframes`
|
|
102
102
|
0% {
|
|
103
103
|
opacity: 0;
|
|
@@ -109,140 +109,140 @@
|
|
|
109
109
|
opacity: 0;
|
|
110
110
|
}
|
|
111
111
|
`,re=a.div`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
112
|
+
display: flex;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
> div {
|
|
115
|
+
height: 10px;
|
|
116
|
+
width: 10px;
|
|
117
|
+
border-radius: 50%;
|
|
118
|
+
margin: 5px;
|
|
119
|
+
background-color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
120
|
+
animation: ${ne} 1s infinite;
|
|
121
|
+
}
|
|
122
|
+
> div:nth-of-type(2) {
|
|
123
|
+
animation-delay: 100ms;
|
|
124
|
+
}
|
|
125
|
+
> div:nth-of-type(3) {
|
|
126
|
+
animation-delay: 200ms;
|
|
127
|
+
}
|
|
128
128
|
`,R=a.div`
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
grid-area: content;
|
|
130
|
+
max-width: 100%;
|
|
131
|
+
overflow: hidden;
|
|
132
132
|
`,oe=a(r.Typography)`
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
134
|
+
font-weight: normal;
|
|
135
|
+
margin: 0;
|
|
136
136
|
`,A=a.div`
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
display: flex;
|
|
138
|
+
${e=>e.left&&"justify-content: start;"};
|
|
139
|
+
${e=>e.center&&"justify-content: center;"};
|
|
140
|
+
${e=>e.right&&"justify-content: end;"};
|
|
141
141
|
`,O=a.div`
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
${e=>{var t;return e.padded&&`padding: ${(t=e.theme.sizes)==null?void 0:t.medium};`}}
|
|
143
|
+
${e=>!e.user&&e.stacked&&ae(e.stacked,e.theme)}
|
|
144
144
|
${e=>e.user&&e.stacked&&ie(e.stacked,e.theme)}
|
|
145
145
|
|
|
146
146
|
display: inline-block;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
147
|
+
margin-top: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
148
|
+
&& > * {
|
|
149
|
+
overflow-wrap: break-word;
|
|
150
|
+
word-wrap: break-word;
|
|
151
|
+
word-break: break-all;
|
|
152
|
+
word-break: break-word;
|
|
153
|
+
hyphens: auto;
|
|
154
|
+
}
|
|
155
|
+
max-width: 100%;
|
|
156
|
+
${e=>e.fullWidth&&"width: 100%;"}
|
|
157
157
|
`,ae=(e,t)=>{var n,i;const o=y.css`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
background-color: ${(n=t.colors)==null?void 0:n.accent};
|
|
159
|
+
color: ${(i=t.colors)==null?void 0:i.text};
|
|
160
|
+
${t.border&&`border: ${t.border};`};
|
|
161
|
+
`;return t.borderRadius?y.css`
|
|
162
|
+
${o}
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
border-top-right-radius: ${t.borderRadius};
|
|
165
|
+
border-bottom-right-radius: ${t.borderRadius};
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
${e==="first"&&`
|
|
168
168
|
border-top-left-radius: ${t.borderRadius};
|
|
169
169
|
`}
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
${e==="last"&&`
|
|
172
172
|
border-bottom-left-radius: ${t.borderRadius};
|
|
173
173
|
`}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
`:o},ie=(e,t)=>{var n,i;const o=y.css`
|
|
175
|
+
background-color: ${(n=t.colors)==null?void 0:n.primary};
|
|
176
|
+
color: ${(i=t.colors)==null?void 0:i.accent};
|
|
177
|
+
`;return t.borderRadius?y.css`
|
|
178
|
+
${o}
|
|
179
179
|
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
border-top-left-radius: ${t.borderRadius};
|
|
181
|
+
border-bottom-left-radius: ${t.borderRadius};
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
${e==="first"&&`
|
|
184
184
|
border-top-right-radius: ${t.borderRadius};
|
|
185
185
|
`}
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
${e==="last"&&`
|
|
188
188
|
border-bottom-right-radius: ${t.borderRadius};
|
|
189
189
|
`}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
`:o},T=a.div`
|
|
191
|
+
margin-bottom: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
192
|
+
&:last-child {
|
|
193
|
+
margin-bottom: 0;
|
|
194
|
+
}
|
|
195
195
|
`,S=e=>{var t,o;return y.css`
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
margin: ${(t=e.theme.sizes)==null?void 0:t.medium} 0;
|
|
197
|
+
padding: 0 ${(o=e.theme.sizes)==null?void 0:o.medium};
|
|
198
198
|
`},le=a(G.FormComponent)`
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
199
|
+
& button.humany-form-component-button {
|
|
200
|
+
${e=>{var t,o,n,i;return((t=e.theme.colors)==null?void 0:t.primary)&&((o=e.theme.colors)==null?void 0:o.accent)&&r.invertedHoverButton({active:!1,primaryColor:(n=e.theme.colors)==null?void 0:n.primary,secondaryColor:(i=e.theme.colors)==null?void 0:i.accent,theme:e.theme})}};
|
|
201
|
+
display: block;
|
|
202
|
+
width: 100%;
|
|
203
|
+
margin-bottom: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
204
|
+
}
|
|
205
|
+
& button.humany-form-component-submit {
|
|
206
|
+
width: 100%;
|
|
207
|
+
margin: 0;
|
|
208
|
+
:not(:last-child) {
|
|
209
|
+
margin-bottom: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
211
210
|
}
|
|
211
|
+
}
|
|
212
212
|
`,ce=a(r.Html)`
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
213
|
+
white-space: pre-wrap;
|
|
214
|
+
a {
|
|
215
|
+
color: ${e=>e.theme.colors.link};
|
|
216
|
+
&:focus {
|
|
217
|
+
${e=>{var t;return((t=e.theme.accessibility)==null?void 0:t.isTabbing)&&r.borderTabStyle}};
|
|
219
218
|
}
|
|
219
|
+
}
|
|
220
220
|
`,de=a(r.List)`
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
padding: 0;
|
|
222
|
+
list-style: none;
|
|
223
|
+
margin: 0 -${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
224
|
+
> li {
|
|
225
|
+
margin: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
226
|
+
}
|
|
227
227
|
`,me=a.button`
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
228
|
+
${e=>r.buttonCss(e)};
|
|
229
|
+
display: block;
|
|
230
|
+
background-color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
231
|
+
width: 100%;
|
|
232
|
+
color: #fff;
|
|
233
|
+
&:focus-visible {
|
|
234
|
+
${r.borderTabStyle}
|
|
235
|
+
background-color: transparent;
|
|
236
|
+
}
|
|
237
237
|
`,q=g.forwardRef(({boxed:e,className:t,agentData:o},n)=>s.jsx(R,{ref:n,children:s.jsx(A,{left:e,center:!e,children:s.jsx(O,{padded:!!e,stacked:e?"first":void 0,children:s.jsxs(re,{children:[s.jsx("div",{}),s.jsx("div",{}),s.jsx("div",{})]})})})})),ue=a.p`
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
238
|
+
&& {
|
|
239
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
|
|
240
|
+
font-weight: 300;
|
|
241
|
+
}
|
|
242
|
+
margin: 0;
|
|
243
|
+
line-height: 1.5em;
|
|
244
|
+
grid-area: info;
|
|
245
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
246
246
|
`,D=e=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),I=({className:e,name:t,timestamp:o})=>{if(!t&&!o)return null;let n="";return t?o?n=`${t}: ${D(o)}`:n=t:o&&(n=D(o)),s.jsx(ue,{children:n})},P=({className:e,children:t,sender:o,timestamp:n})=>{const{avatar:i,name:l}=o,{avatarSize:h}=r.useProperties();return s.jsxs(he,{hasAvatar:!!i,className:L.appendClassNames(e,"humany-conversation-agent-message"),children:[i&&s.jsx(se,{avatarSize:h,children:typeof i=="string"?s.jsx("img",{src:i}):s.jsx(r.SymbolBadge,{symbol:i})}),t,s.jsx(I,{name:l,timestamp:n})]})},he=a.div`
|
|
247
247
|
display: grid;
|
|
248
248
|
margin-right: 10%;
|
|
@@ -261,23 +261,23 @@
|
|
|
261
261
|
'info';
|
|
262
262
|
`};
|
|
263
263
|
`,ge=g.forwardRef(({className:e,children:t,timestamp:o,discrete:n,fullWidth:i},l)=>s.jsx(ye,{ref:l,className:L.appendClassNames(e,"humany-conversation-system-message"),fullWidth:i,children:n?s.jsxs(pe,{className:"humany-conversation-discrete-message",children:[t,s.jsx(I,{timestamp:o})]}):s.jsxs(s.Fragment,{children:[t,s.jsx(I,{timestamp:o})]})})),ye=a.div`
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
${e=>e.fullWidth&&"width: 100%"};
|
|
265
|
+
padding: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
|
|
266
|
+
overflow: auto;
|
|
267
267
|
`,pe=a.div`
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
268
|
+
text-align: center;
|
|
269
|
+
word-wrap: break-word;
|
|
270
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
271
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
272
|
+
> p {
|
|
273
|
+
margin: 0;
|
|
274
|
+
}
|
|
275
275
|
`,be=({className:e,children:t,timestamp:o})=>{const{userLabel:n=""}=r.useProperties();return s.jsxs(fe,{className:L.appendClassNames(e,"humany-conversation-user-message"),children:[t,s.jsx(I,{name:n,timestamp:o})]})},fe=a.div`
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
276
|
+
margin-left: 10%;
|
|
277
|
+
width: 90%;
|
|
278
|
+
display: flex;
|
|
279
|
+
flex-direction: column;
|
|
280
|
+
align-items: flex-end;
|
|
281
281
|
`,K=e=>Array.isArray(e)?e:Object.keys(e).map(t=>({label:e[t],actionKey:t})),xe=({header:e,actions:t,dispatch:o})=>s.jsx($e,{className:"humany-conversation-button-list",header:e,items:K(t),renderItem:n=>{var l;const i=!!((l=n==null?void 0:n.data)!=null&&l.href);return s.jsx("li",{children:i?s.jsxs(ve,{onClick:()=>{o("action",n)},href:n.data.href,target:n.data.target,"aria-label":n.label,title:n.label,children:[s.jsx(r.SymbolBadge,{symbol:n.symbol}),n.label]}):s.jsxs(je,{onClick:()=>{o("action",n)},"aria-label":n.label,title:n.label,children:[s.jsx(r.SymbolBadge,{symbol:n.symbol}),n.label]})},n.actionKey)}}),$e=a(r.ItemList)`
|
|
282
282
|
${r.itemList}
|
|
283
283
|
> ul {
|
|
@@ -328,219 +328,219 @@
|
|
|
328
328
|
margin-right: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
|
|
329
329
|
}
|
|
330
330
|
`,Se=({type:e,content:t={}})=>{const o=r.useComponent(e);return!o||!e?null:s.jsx(g.Suspense,{fallback:null,children:s.jsx(o,{...t})})},we=({body:e})=>s.jsx(Ce,{html:e}),Ce=a(r.Html)`
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
331
|
+
${r.genericHtml}
|
|
332
|
+
color: inherit;
|
|
333
|
+
white-space: pre-wrap;
|
|
334
|
+
${S}
|
|
335
|
+
a {
|
|
336
|
+
color: ${e=>e.theme.colors.link};
|
|
337
|
+
&:focus-visible {
|
|
338
|
+
${r.borderTabStyle};
|
|
340
339
|
}
|
|
340
|
+
}
|
|
341
341
|
`,ke=({header:e,actions:t,dispatch:o})=>s.jsx(Le,{className:"humany-conversation-item-list",header:e,items:K(t),renderItem:n=>{var i;return s.jsx("li",{children:s.jsxs(ze,{children:[((i=n.symbol)==null?void 0:i.content)&&s.jsx("div",{className:"item-icon",children:s.jsx(r.SymbolBadge,{size:22,symbol:{type:n.symbol.type,content:n.symbol.content}})}),s.jsxs("div",{className:"item-body",children:[s.jsx(r.Button,{onClick:()=>{o("action",n)},"aria-label":n.label,title:n.label,children:n.label}),n.description&&s.jsx("p",{children:n.description})]})]})},n.actionKey)}}),Le=a(r.ItemList)`
|
|
342
|
-
|
|
342
|
+
${r.itemList}
|
|
343
343
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
344
|
+
> .humany-paragraph {
|
|
345
|
+
${S}
|
|
346
|
+
margin-bottom: 0;
|
|
347
347
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
348
|
+
h1 {
|
|
349
|
+
margin: 0;
|
|
351
350
|
}
|
|
351
|
+
}
|
|
352
352
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
${e=>r.headingElement(e)("h1",y.css`
|
|
354
|
+
white-space: normal;
|
|
355
|
+
`)}
|
|
356
356
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
357
|
+
> ul {
|
|
358
|
+
display: flex;
|
|
359
|
+
flex-direction: column;
|
|
360
|
+
gap: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
361
|
+
> li {
|
|
362
|
+
margin: 0;
|
|
364
363
|
}
|
|
364
|
+
}
|
|
365
365
|
|
|
366
|
-
|
|
367
|
-
|
|
366
|
+
li {
|
|
367
|
+
border-bottom: ${e=>e.theme.border};
|
|
368
368
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
369
|
+
&:last-of-type {
|
|
370
|
+
border-bottom: none;
|
|
372
371
|
}
|
|
372
|
+
}
|
|
373
373
|
`,ze=a.div`
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
374
|
+
display: flex;
|
|
375
|
+
gap: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
|
|
376
|
+
${S}
|
|
377
377
|
|
|
378
|
-
|
|
379
|
-
|
|
378
|
+
.item-icon {
|
|
379
|
+
}
|
|
380
380
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
381
|
+
.item-body {
|
|
382
|
+
display: flex;
|
|
383
|
+
flex-direction: column;
|
|
384
|
+
align-items: flex-start;
|
|
385
|
+
gap: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
386
386
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
387
|
+
p {
|
|
388
|
+
margin: 0;
|
|
389
|
+
white-space: normal;
|
|
391
390
|
}
|
|
391
|
+
}
|
|
392
392
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
393
|
+
button {
|
|
394
|
+
background: transparent;
|
|
395
|
+
border: none;
|
|
396
|
+
font-family: inherit;
|
|
397
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
398
|
+
cursor: pointer;
|
|
399
|
+
padding: 0;
|
|
400
|
+
margin: 0;
|
|
401
|
+
|
|
402
|
+
&:focus-visible {
|
|
403
|
+
${r.borderTabStyle}
|
|
404
|
+
span {
|
|
405
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
406
|
+
text-decoration: underline;
|
|
407
|
+
}
|
|
409
408
|
}
|
|
409
|
+
}
|
|
410
410
|
`,Te=({header:e,actions:t,dispatch:o})=>s.jsx(Ie,{className:"humany-conversation-link-list",header:e,items:K(t),renderItem:n=>s.jsx("li",{children:s.jsxs(Me,{help:n.actionKey==="help",onClick:()=>{o("action",n)},"aria-label":n.label,title:n.label,children:[n.label,n.actionKey==="help"&&s.jsx(r.SymbolBadge,{size:14,symbol:{type:"Svg",content:"caret-down"}})]})},n.actionKey)}),Ie=a(r.ItemList)`
|
|
411
|
-
|
|
412
|
-
|
|
411
|
+
${r.itemList}
|
|
412
|
+
${S}
|
|
413
413
|
|
|
414
414
|
${e=>r.headingElement(e)("h1",y.css`
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
white-space: normal;
|
|
416
|
+
`)}
|
|
417
417
|
|
|
418
418
|
> ul {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
419
|
+
display: flex;
|
|
420
|
+
flex-direction: column;
|
|
421
|
+
gap: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
422
|
+
> li {
|
|
423
|
+
margin: 0;
|
|
425
424
|
}
|
|
425
|
+
}
|
|
426
426
|
`,Me=a(r.Button)`
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
427
|
+
display: block;
|
|
428
|
+
text-align: left;
|
|
429
|
+
font-weight: 300;
|
|
430
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
431
|
+
max-width: 100%;
|
|
432
|
+
text-overflow: ellipsis;
|
|
433
|
+
overflow: hidden;
|
|
434
434
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
435
|
+
${e=>{var t,o;return e.help&&y.css`
|
|
436
|
+
color: ${(t=e.theme.colors)==null?void 0:t.text};
|
|
437
|
+
text-decoration: underline;
|
|
438
438
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
439
|
+
i,
|
|
440
|
+
svg {
|
|
441
|
+
margin-left: ${(o=e.theme.sizes)==null?void 0:o.small};
|
|
442
|
+
}
|
|
443
|
+
`}}
|
|
444
444
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
445
|
+
&:focus-visible {
|
|
446
|
+
${r.borderTabStyle}
|
|
447
|
+
span {
|
|
448
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
449
|
+
text-decoration: underline;
|
|
451
450
|
}
|
|
451
|
+
}
|
|
452
452
|
`,Ne=()=>s.jsx(Be,{className:"humany-conversation-separator"}),Be=a.div`
|
|
453
|
-
|
|
454
|
-
|
|
453
|
+
${e=>e.theme.border&&`border-bottom: ${e.theme.border};`}
|
|
454
|
+
width: 100%;
|
|
455
455
|
`,He=({text:e})=>s.jsx(Re,{className:"humany-conversation-text",variant:"span",children:e}),Re=a(r.Typography)`
|
|
456
|
-
|
|
456
|
+
${S}
|
|
457
457
|
`,Ae=({header:e="Video call",acceptLabel:t="Accept",declineLabel:o="Decline",dispatch:n})=>{const i=g.useMemo(()=>[{label:t,actionKey:"accept-video-call",symbol:{type:"Svg",content:"video"}},{label:o,actionKey:"decline-video-call",symbol:{type:"Svg",content:"close"}}],[t,o]);return s.jsx(Oe,{className:"humany-conversation-video-request",header:e,items:i,renderItem:l=>{const h=l.actionKey==="accept-video-call"?"#70c48e":"#da5c85";return s.jsx("li",{children:s.jsx(Ke,{onClick:()=>{n("action",l)},"aria-label":l.label,title:l.label,bgColor:h,children:s.jsx(r.SymbolBadge,{symbol:l.symbol,size:25})})},l.actionKey)}})},Oe=a(r.ItemList)`
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
458
|
+
${e=>r.itemList(e)}
|
|
459
|
+
> ul {
|
|
460
|
+
display: flex;
|
|
461
|
+
flex-wrap: wrap;
|
|
462
|
+
gap: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
463
|
+
> li {
|
|
464
|
+
margin: 0;
|
|
466
465
|
}
|
|
467
|
-
|
|
466
|
+
}
|
|
467
|
+
${e=>S(e)}
|
|
468
468
|
`,Ke=a(r.Button)`
|
|
469
|
-
|
|
469
|
+
${r.buttonCss};
|
|
470
470
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
471
|
+
background-color: ${e=>e.bgColor};
|
|
472
|
+
display: flex;
|
|
473
|
+
justify-content: center;
|
|
474
|
+
align-items: center;
|
|
475
|
+
color: #ffffff;
|
|
476
|
+
width: 46px;
|
|
477
|
+
height: 46px;
|
|
478
|
+
border-radius: 100%;
|
|
479
479
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
&:focus-visible {
|
|
481
|
+
${r.borderTabStyle}
|
|
482
|
+
background-color: transparent;
|
|
483
483
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
484
|
+
i,
|
|
485
|
+
svg {
|
|
486
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
487
487
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
}
|
|
488
|
+
path {
|
|
489
|
+
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
490
|
+
}
|
|
492
491
|
}
|
|
492
|
+
}
|
|
493
493
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
494
|
+
i,
|
|
495
|
+
svg {
|
|
496
|
+
color: #fff;
|
|
497
497
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
498
|
+
path {
|
|
499
|
+
stroke: #fff;
|
|
501
500
|
}
|
|
501
|
+
}
|
|
502
502
|
`,qe=([e,t])=>({type:e,content:t}),De=({items:e,dispatch:t})=>s.jsx(Fe,{className:"humany-message-list",items:e.map(qe),renderLi:!0,renderItem:o=>{switch(o.type){case x.ConversationMessageListItemType.Text:return s.jsx(He,{text:o.content});case x.ConversationMessageListItemType.HTML:return s.jsx(we,{...o.content});case x.ConversationMessageListItemType.Separator:return s.jsx(Ne,{...o.content});case x.ConversationMessageListItemType.ItemList:return s.jsx(ke,{...o.content,dispatch:t});case x.ConversationMessageListItemType.LinkList:return s.jsx(Te,{...o.content,dispatch:t});case x.ConversationMessageListItemType.ButtonList:return s.jsx(xe,{...o.content,dispatch:t});case x.ConversationMessageListItemType.VideoRequest:return s.jsx(Ae,{...o.content,dispatch:t});default:return s.jsx(Se,{type:o.type,content:o.content})}}}),Fe=a(r.List)`
|
|
503
|
-
|
|
503
|
+
${r.list}
|
|
504
504
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
505
|
+
> li {
|
|
506
|
+
margin: 0;
|
|
507
|
+
}
|
|
508
508
|
`,Pe=g.forwardRef(({className:e,timestamp:t,sender:o,type:n,content:i},l)=>{const h=g.useCallback(m=>{let c="first";return i.length>1&&(c=m===0?"first":m+1===i.length?"last":"middle"),c},[i]),d=()=>s.jsx(s.Fragment,{children:i.map(m=>{const{key:c,body:$,title:w,form:C,actions:j}=m,b=!!$&&!w&&!C&&!j;return s.jsx(ge,{className:e,discrete:b,ref:l,timestamp:t,fullWidth:!!C||!!j,children:b&&$?s.jsx(r.Html,{html:$}):s.jsx(B,{isSystem:!0,content:m})},c)})}),p=()=>s.jsx(P,{sender:o,timestamp:t,className:e,children:s.jsx(R,{className:"humany-message-content-bundle",children:i.map((m,c)=>s.jsx(A,{className:"humany-message-container",left:!0,ref:l,children:s.jsx(B,{content:m,stacked:h(c)})},m.key))})}),v=()=>s.jsx(be,{timestamp:t,className:e,children:s.jsx(R,{className:"humany-message-content-bundle",children:i.map((m,c)=>s.jsx(A,{className:"humany-message-container",right:!0,ref:l,children:s.jsx(B,{isUser:!0,content:m,stacked:h(c)})},m.key))})});switch(n){case x.ConversationMessageType.System:return d();case x.ConversationMessageType.Agent:return p();case x.ConversationMessageType.User:return v();default:return null}}),B=({content:e,isUser:t,isSystem:o,stacked:n})=>{const i=r.useDispatch(),{title:l,body:h,actions:d,form:p,items:v}=e;return v?s.jsx(O,{className:"humany-message-content",user:!!t,stacked:n,children:s.jsx(De,{items:v,dispatch:i})}):s.jsxs(O,{className:"humany-message-content",padded:!o,user:!!t,stacked:n,fullWidth:!!p||!!d,children:[l&&s.jsx(T,{children:s.jsx(oe,{variant:"h2",children:l})}),h&&s.jsx(T,{children:s.jsx(ce,{html:h})}),p&&s.jsx(T,{children:s.jsx(le,{...p,onChange:(c,$)=>{i("form",{data:$,formKey:p.schema.id,actionKey:c})}})}),d&&s.jsx(T,{children:s.jsx(de,{items:Object.keys(d).map(c=>({label:d[c],actionKey:c})),renderItem:c=>s.jsx("li",{children:s.jsx(me,{onClick:()=>{i("action",c.actionKey)},children:c.label})},c.actionKey)})})]})},E=()=>{const e=g.useCallback(d=>{d&&setTimeout(()=>{d.scrollIntoView({block:"start",behavior:"smooth"})},250)},[]),[t,o]=r.useScroll(!0),{messages:n,loading:i,typingActors:l=[]}=r.useProperties(),h=()=>l&&l.length?l.map((d,p)=>s.jsx(H,{id:`typing_${d.name}`,children:s.jsx(P,{timestamp:Date.now(),sender:d,children:s.jsx(q,{boxed:!0,ref:e})})},`typing_${d.name}`)):null;return s.jsxs(s.Fragment,{children:[s.jsxs(Ee,{tabIndex:0,scrollableCss:t,ref:o,children:[n&&n.length?n.map((d,p)=>{const{type:v,timestamp:m,sender:c,content:$}=d;return s.jsx(H,{className:"humany-conversation-entry",tabIndex:-1,children:s.jsx(Pe,{...d,ref:e})},`${v}_${c==null?void 0:c.name}_${m}_${$[0].key}`)}):null,h(),i&&s.jsx(H,{children:s.jsx(q,{ref:e})})]}),s.jsx(J,{})]})},Ee=a.div`
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
509
|
+
display: flex;
|
|
510
|
+
flex-direction: column;
|
|
511
|
+
align-items: stretch;
|
|
512
|
+
flex: 0 1 100%;
|
|
513
|
+
padding: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
|
|
514
|
+
${e=>!!e.scrollableCss&&e.scrollableCss};
|
|
515
|
+
&:focus-visible {
|
|
516
|
+
${e=>r.borderTabStyle(e)};
|
|
517
|
+
}
|
|
518
518
|
`,H=a.div`
|
|
519
|
-
|
|
520
|
-
|
|
519
|
+
margin: 0;
|
|
520
|
+
margin-bottom: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
|
|
521
521
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
522
|
+
&:first-of-type {
|
|
523
|
+
margin-top: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
|
|
524
|
+
}
|
|
525
525
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
526
|
+
&:last-of-type {
|
|
527
|
+
padding-bottom: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
|
|
528
|
+
}
|
|
529
529
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
530
|
+
& span,
|
|
531
|
+
p,
|
|
532
|
+
a,
|
|
533
|
+
div {
|
|
534
|
+
font-weight: 300;
|
|
535
|
+
}
|
|
536
536
|
|
|
537
|
-
|
|
538
|
-
|
|
537
|
+
& b,
|
|
538
|
+
h1 {
|
|
539
|
+
font-weight: normal;
|
|
540
|
+
}
|
|
541
|
+
${e=>r.headingElement(e)("h1",y.css`
|
|
539
542
|
font-weight: normal;
|
|
540
|
-
|
|
541
|
-
${e=>r.headingElement(e)("h1",y.css`
|
|
542
|
-
font-weight: normal;
|
|
543
|
-
`)}
|
|
543
|
+
`)}
|
|
544
544
|
`,We=({dispatch:e})=>{const t=g.useRef(null);return g.useEffect(()=>{t.current&&t.current.parentNode&&e("overlay-mounted",t.current)},[t]),s.jsx(r.WidgetOverlayOutlet,{portalId:"humany-conversation-overlay-portal",className:"humany-conversation-overlay-outlet",ref:t})},Ue=({dispatch:e,header:t,buttonLabel:o})=>s.jsxs(_e,{portalId:"humany-conversation-portal",className:"humany-conversation-outlet",children:[s.jsxs(Ve,{className:"humany-conversation-outlet-head",children:[s.jsx(Ge,{className:"humany-conversation-outlet-head-button","aria-label":o,title:o,onClick:()=>e("hide-overlay-conversation"),children:s.jsx(r.SymbolBadge,{symbol:{type:"Svg",content:"caret-down"},size:20})}),t&&s.jsx(Ye,{className:"humany-conversation-outlet-header",variant:"h1",children:t})]}),s.jsx(E,{})]}),_e=a(r.WidgetOverlayOutlet)`
|
|
545
545
|
z-index: 11;
|
|
546
546
|
top: auto;
|
|
@@ -577,12 +577,12 @@
|
|
|
577
577
|
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
578
578
|
}
|
|
579
579
|
`,Je=({className:e,...t})=>{const{overlay:o,overlayConversationHeader:n,overlayConversationCloseLabel:i,conversationControllerId:l}=r.useProperties(),h=r.useDispatch();return s.jsxs(r.ConversationContext.Provider,{value:l?{id:l}:null,children:[s.jsx(Qe,{...t,className:L.appendClassNames(e,"humany-conversation-component"),children:s.jsx(E,{})}),o&&s.jsxs(s.Fragment,{children:[s.jsx(We,{dispatch:h}),o.conversation&&s.jsx(Ue,{dispatch:h,header:n,buttonLabel:i})]})]})},Qe=a.div`
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
580
|
+
position: absolute;
|
|
581
|
+
right: 0;
|
|
582
|
+
left: 0;
|
|
583
|
+
bottom: 0;
|
|
584
|
+
top: 0;
|
|
585
|
+
overflow: hidden;
|
|
586
|
+
display: flex;
|
|
587
|
+
flex-direction: column;
|
|
588
588
|
`;exports.default=Je;
|