@telia-ace/widget-conversation 1.0.12 → 1.0.15

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 (136) hide show
  1. package/LICENSE.txt +5 -5
  2. package/README.md +256 -256
  3. package/{lib-esm → dist}/agent.d.ts +17 -17
  4. package/{lib-esm → dist}/conversation-controller.d.ts +88 -88
  5. package/{lib-esm → dist}/conversation-form-adapter.d.ts +7 -7
  6. package/{lib-esm → dist}/conversation-platform.d.ts +50 -49
  7. package/{lib-esm → dist}/conversation-provider.d.ts +22 -22
  8. package/dist/conversation.js +558 -0
  9. package/dist/conversation.js.map +1 -0
  10. package/{lib → dist}/index.d.ts +9 -9
  11. package/dist/index.js +10 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/index2.js +1678 -0
  14. package/dist/index2.js.map +1 -0
  15. package/{lib-esm → dist}/resolve-entity-value.d.ts +10 -10
  16. package/dist/return-button.js +174 -0
  17. package/dist/return-button.js.map +1 -0
  18. package/{lib → dist}/types.d.ts +110 -110
  19. package/{lib-esm → dist}/ui/conversation/conversation-component.d.ts +37 -37
  20. package/{lib → dist}/ui/conversation/conversation-content.d.ts +12 -11
  21. package/{lib-esm → dist}/ui/conversation/conversation-input.d.ts +6 -6
  22. package/{lib → dist}/ui/conversation/conversation-loader.d.ts +8 -8
  23. package/{lib → dist}/ui/conversation/conversation-message.d.ts +7 -7
  24. package/{lib-esm → dist}/ui/conversation/conversation-styles.d.ts +11 -11
  25. package/{lib → dist}/ui/conversation/conversation.d.ts +6 -6
  26. package/{lib → dist}/ui/conversation/index.d.ts +3 -2
  27. package/{lib-esm → dist}/ui/conversation/message-types/agent.d.ts +11 -11
  28. package/{lib → dist}/ui/conversation/message-types/custom-message-list-item.d.ts +9 -9
  29. package/{lib → dist}/ui/conversation/message-types/custom.d.ts +9 -9
  30. package/{lib → dist}/ui/conversation/message-types/index.d.ts +5 -5
  31. package/{lib-esm → dist}/ui/conversation/message-types/system.d.ts +12 -12
  32. package/{lib → dist}/ui/conversation/message-types/timestamp.d.ts +8 -8
  33. package/{lib-esm → dist}/ui/conversation/message-types/user.d.ts +8 -8
  34. package/dist/ui/index.d.ts +2 -0
  35. package/{lib-esm → dist}/ui/return-button/index.d.ts +2 -2
  36. package/{lib → dist}/ui/return-button/return-button-component.d.ts +19 -19
  37. package/{lib → dist}/ui/return-button/return-button.d.ts +6 -6
  38. package/{lib → dist}/user.d.ts +7 -7
  39. package/{lib-esm → dist}/utils/custom-message.d.ts +3 -3
  40. package/{lib-esm → dist}/utils/index.d.ts +1 -1
  41. package/{lib-esm → dist}/utils/open-chat-widget.d.ts +4 -4
  42. package/package.json +15 -16
  43. package/lib/agent.d.ts +0 -17
  44. package/lib/agent.js +0 -37
  45. package/lib/conversation-controller.d.ts +0 -88
  46. package/lib/conversation-controller.js +0 -318
  47. package/lib/conversation-form-adapter.d.ts +0 -7
  48. package/lib/conversation-form-adapter.js +0 -88
  49. package/lib/conversation-platform.d.ts +0 -49
  50. package/lib/conversation-platform.js +0 -295
  51. package/lib/conversation-provider.d.ts +0 -22
  52. package/lib/conversation-provider.js +0 -73
  53. package/lib/index.js +0 -17
  54. package/lib/resolve-entity-value.d.ts +0 -10
  55. package/lib/resolve-entity-value.js +0 -22
  56. package/lib/types.js +0 -19
  57. package/lib/ui/conversation/conversation-component.d.ts +0 -37
  58. package/lib/ui/conversation/conversation-component.js +0 -152
  59. package/lib/ui/conversation/conversation-content.js +0 -240
  60. package/lib/ui/conversation/conversation-input.d.ts +0 -6
  61. package/lib/ui/conversation/conversation-input.js +0 -163
  62. package/lib/ui/conversation/conversation-loader.js +0 -18
  63. package/lib/ui/conversation/conversation-message.js +0 -141
  64. package/lib/ui/conversation/conversation-styles.d.ts +0 -11
  65. package/lib/ui/conversation/conversation-styles.js +0 -65
  66. package/lib/ui/conversation/conversation.js +0 -139
  67. package/lib/ui/conversation/index.js +0 -7
  68. package/lib/ui/conversation/message-types/agent.d.ts +0 -11
  69. package/lib/ui/conversation/message-types/agent.js +0 -54
  70. package/lib/ui/conversation/message-types/custom-message-list-item.js +0 -27
  71. package/lib/ui/conversation/message-types/custom.js +0 -50
  72. package/lib/ui/conversation/message-types/index.js +0 -16
  73. package/lib/ui/conversation/message-types/system.d.ts +0 -12
  74. package/lib/ui/conversation/message-types/system.js +0 -26
  75. package/lib/ui/conversation/message-types/timestamp.js +0 -36
  76. package/lib/ui/conversation/message-types/user.d.ts +0 -8
  77. package/lib/ui/conversation/message-types/user.js +0 -24
  78. package/lib/ui/index.d.ts +0 -2
  79. package/lib/ui/index.js +0 -10
  80. package/lib/ui/return-button/index.d.ts +0 -2
  81. package/lib/ui/return-button/index.js +0 -7
  82. package/lib/ui/return-button/return-button-component.js +0 -70
  83. package/lib/ui/return-button/return-button.js +0 -82
  84. package/lib/user.js +0 -16
  85. package/lib/utils/custom-message.d.ts +0 -3
  86. package/lib/utils/custom-message.js +0 -56
  87. package/lib/utils/index.d.ts +0 -1
  88. package/lib/utils/index.js +0 -7
  89. package/lib/utils/open-chat-widget.d.ts +0 -4
  90. package/lib/utils/open-chat-widget.js +0 -148
  91. package/lib-esm/agent.js +0 -34
  92. package/lib-esm/conversation-controller.js +0 -314
  93. package/lib-esm/conversation-form-adapter.js +0 -85
  94. package/lib-esm/conversation-platform.js +0 -292
  95. package/lib-esm/conversation-provider.js +0 -70
  96. package/lib-esm/index.d.ts +0 -9
  97. package/lib-esm/index.js +0 -6
  98. package/lib-esm/resolve-entity-value.js +0 -18
  99. package/lib-esm/types.d.ts +0 -110
  100. package/lib-esm/types.js +0 -16
  101. package/lib-esm/ui/conversation/conversation-component.js +0 -127
  102. package/lib-esm/ui/conversation/conversation-content.d.ts +0 -11
  103. package/lib-esm/ui/conversation/conversation-content.js +0 -212
  104. package/lib-esm/ui/conversation/conversation-input.js +0 -138
  105. package/lib-esm/ui/conversation/conversation-loader.d.ts +0 -8
  106. package/lib-esm/ui/conversation/conversation-loader.js +0 -13
  107. package/lib-esm/ui/conversation/conversation-message.d.ts +0 -7
  108. package/lib-esm/ui/conversation/conversation-message.js +0 -113
  109. package/lib-esm/ui/conversation/conversation-styles.js +0 -39
  110. package/lib-esm/ui/conversation/conversation.d.ts +0 -6
  111. package/lib-esm/ui/conversation/conversation.js +0 -111
  112. package/lib-esm/ui/conversation/index.d.ts +0 -2
  113. package/lib-esm/ui/conversation/index.js +0 -2
  114. package/lib-esm/ui/conversation/message-types/agent.js +0 -25
  115. package/lib-esm/ui/conversation/message-types/custom-message-list-item.d.ts +0 -9
  116. package/lib-esm/ui/conversation/message-types/custom-message-list-item.js +0 -22
  117. package/lib-esm/ui/conversation/message-types/custom.d.ts +0 -9
  118. package/lib-esm/ui/conversation/message-types/custom.js +0 -25
  119. package/lib-esm/ui/conversation/message-types/index.d.ts +0 -5
  120. package/lib-esm/ui/conversation/message-types/index.js +0 -5
  121. package/lib-esm/ui/conversation/message-types/system.js +0 -20
  122. package/lib-esm/ui/conversation/message-types/timestamp.d.ts +0 -8
  123. package/lib-esm/ui/conversation/message-types/timestamp.js +0 -31
  124. package/lib-esm/ui/conversation/message-types/user.js +0 -19
  125. package/lib-esm/ui/index.d.ts +0 -2
  126. package/lib-esm/ui/index.js +0 -2
  127. package/lib-esm/ui/return-button/index.js +0 -2
  128. package/lib-esm/ui/return-button/return-button-component.d.ts +0 -19
  129. package/lib-esm/ui/return-button/return-button-component.js +0 -44
  130. package/lib-esm/ui/return-button/return-button.d.ts +0 -6
  131. package/lib-esm/ui/return-button/return-button.js +0 -54
  132. package/lib-esm/user.d.ts +0 -7
  133. package/lib-esm/user.js +0 -13
  134. package/lib-esm/utils/custom-message.js +0 -52
  135. package/lib-esm/utils/index.js +0 -1
  136. package/lib-esm/utils/open-chat-widget.js +0 -142
@@ -0,0 +1,558 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
29
+ import { Input, Button, borderTabStyle, SymbolBadge, useDispatch, useProperties, useScroll, invertedHoverButton, Html, List, buttonCss, Lightbox, useTransitionEnd, headingElement } from "@telia-ace/widget-ui";
30
+ import { appendClassNames } from "@telia-ace/widget-utilities";
31
+ import React, { useState, useEffect, useRef, useCallback } from "react";
32
+ import styled, { css } from "styled-components";
33
+ import { C as ContentBundle, M as MessageContainer, a as MessageContent, L as Loader, b as ConversationMessageType, S as SystemMessage, c as ConversationContent, A as AgentMessage, U as UserMessage } from "./index2.js";
34
+ import { FormComponent } from "@telia-ace/widget-forms";
35
+ import "@telia-ace/widget-core";
36
+ import "@telia-ace/widget-services";
37
+ import "@telia-ace/widget-plugins";
38
+ const ConversationInput = ({ className }) => {
39
+ const [inputText, setInputText] = useState("");
40
+ const [inputFocus, setInputFocus] = useState(false);
41
+ const [calculatedLineHeight, setCalculatedLineHeight] = useState(0);
42
+ const [textareaMaxHeight, setTextareaMaxHeight] = useState(0);
43
+ const dispatch = useDispatch();
44
+ const {
45
+ inputPlaceholder = "Type your message",
46
+ inputHidden = false,
47
+ inputDisabled = false,
48
+ sendButtonLabel = "Send message",
49
+ inputMultiline: multiline = true,
50
+ secondaryAction
51
+ } = useProperties();
52
+ const [scrollableCss, inputRef] = useScroll(true);
53
+ useEffect(() => {
54
+ if (inputRef.current) {
55
+ const { lineHeight, maxHeight } = getComputedStyle(inputRef.current);
56
+ if (lineHeight && lineHeight.indexOf("px") > -1) {
57
+ const lineHeightNumber = lineHeight.split("px");
58
+ const calcLH = parseInt(lineHeightNumber[0], 10);
59
+ setCalculatedLineHeight(calcLH);
60
+ const maxHeightNumber = maxHeight.split("px");
61
+ setTextareaMaxHeight(parseInt(maxHeightNumber[0], 10));
62
+ }
63
+ }
64
+ }, [inputRef.current]);
65
+ const submit = (e) => {
66
+ if (!e.shiftKey || !multiline) {
67
+ e.preventDefault();
68
+ if (inputText && inputText.length > 0) {
69
+ dispatch("user-submit", { text: inputText });
70
+ setInputText("");
71
+ onChange("");
72
+ }
73
+ } else if (inputText.length < 1) {
74
+ e.preventDefault();
75
+ }
76
+ };
77
+ const onSecondaryActionButtonClick = (e) => {
78
+ if (!secondaryAction) {
79
+ return;
80
+ }
81
+ e.preventDefault();
82
+ dispatch("action", secondaryAction.action);
83
+ };
84
+ const calculateHeight = (value) => {
85
+ if (multiline && inputRef.current) {
86
+ const scrollHeight = inputRef.current.scrollHeight;
87
+ if (scrollHeight > calculatedLineHeight) {
88
+ inputRef.current.style.height = "auto";
89
+ let areaHeight = scrollHeight;
90
+ if (value.length < 1) {
91
+ areaHeight = calculatedLineHeight;
92
+ }
93
+ inputRef.current.style.height = `${areaHeight}px`;
94
+ if (areaHeight >= textareaMaxHeight) {
95
+ inputRef.current.style.overflowY = "scroll";
96
+ } else {
97
+ inputRef.current.style.overflowY = "hidden";
98
+ }
99
+ }
100
+ }
101
+ };
102
+ const onChange = (value) => {
103
+ calculateHeight(value);
104
+ setInputText(value);
105
+ if (value && value.length > 0) {
106
+ dispatch("user-typing", { textLength: value.length });
107
+ }
108
+ };
109
+ if (inputHidden) {
110
+ return null;
111
+ }
112
+ return /* @__PURE__ */ React.createElement(Wrapper$1, {
113
+ grow: multiline,
114
+ className: appendClassNames("humany-conversation-input", className),
115
+ "data-has-focus": inputFocus,
116
+ scrollableCss
117
+ }, secondaryAction && /* @__PURE__ */ React.createElement(StyledButton, {
118
+ disabled: inputDisabled,
119
+ onClick: onSecondaryActionButtonClick,
120
+ title: secondaryAction.label,
121
+ "aria-label": secondaryAction.label
122
+ }, /* @__PURE__ */ React.createElement(SymbolBadge, {
123
+ size: 24,
124
+ symbol: { type: "Svg", content: secondaryAction.icon || "browse" }
125
+ })), multiline ? /* @__PURE__ */ React.createElement(StyledTextArea, {
126
+ value: inputText,
127
+ onChange,
128
+ onEnter: submit,
129
+ disabled: inputDisabled,
130
+ "aria-label": inputPlaceholder,
131
+ placeholder: inputPlaceholder,
132
+ onFocusChange: setInputFocus,
133
+ type: "textarea",
134
+ rows: 1,
135
+ ref: inputRef
136
+ }) : /* @__PURE__ */ React.createElement(StyledInput, {
137
+ value: inputText,
138
+ onChange,
139
+ onEnter: submit,
140
+ disabled: inputDisabled,
141
+ "aria-label": inputPlaceholder,
142
+ placeholder: inputPlaceholder,
143
+ onFocusChange: setInputFocus
144
+ }), /* @__PURE__ */ React.createElement(StyledButton, {
145
+ disabled: inputDisabled,
146
+ onClick: submit,
147
+ title: sendButtonLabel,
148
+ "aria-label": sendButtonLabel
149
+ }, /* @__PURE__ */ React.createElement(SendSymbol, {
150
+ size: 22,
151
+ symbol: { type: "Svg", content: "send" },
152
+ hasContent: inputText && inputText.length
153
+ })));
154
+ };
155
+ const StyledTextArea = styled(Input)`
156
+ resize: none;
157
+ flex: 1;
158
+ flex-shrink: 1;
159
+ min-height: 1.2em;
160
+ max-height: 148px;
161
+ line-height: 1.2em;
162
+ height: 1.2em;
163
+ padding: 0;
164
+ margin: ${(p) => {
165
+ var _a;
166
+ return (_a = p.theme.sizes) == null ? void 0 : _a.small;
167
+ }} ${(p) => {
168
+ var _a;
169
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
170
+ }};
171
+ font-size: ${(p) => {
172
+ var _a;
173
+ return (_a = p.theme.fonts) == null ? void 0 : _a.normal;
174
+ }};
175
+ border: none;
176
+ transition: height 200ms linear;
177
+ outline: none;
178
+ `;
179
+ const StyledInput = styled(Input)`
180
+ flex: 1;
181
+ border: none;
182
+ background-color: transparent;
183
+ font-weight: 300;
184
+ font-size: ${(p) => {
185
+ var _a;
186
+ return (_a = p.theme.fonts) == null ? void 0 : _a.normal;
187
+ }};
188
+ line-height: 1.2em;
189
+ outline: none;
190
+ padding-left: ${(p) => {
191
+ var _a;
192
+ return (_a = p.theme.sizes) == null ? void 0 : _a.large;
193
+ }};
194
+ color: ${(p) => {
195
+ var _a;
196
+ return (_a = p.theme.colors) == null ? void 0 : _a.text;
197
+ }};
198
+ &::placeholder {
199
+ color: ${(p) => {
200
+ var _a;
201
+ return (_a = p.theme.colors) == null ? void 0 : _a.textLight;
202
+ }};
203
+ font-style: italic;
204
+ }
205
+ `;
206
+ const StyledButton = styled(Button)`
207
+ flex: 0 0 50px;
208
+ align-self: stretch;
209
+ background-color: transparent;
210
+ display: flex;
211
+ align-items: center;
212
+ justify-content: center;
213
+ border: none;
214
+ color: #a6a6a6;
215
+ &:focus {
216
+ ${(p) => {
217
+ var _a;
218
+ return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && borderTabStyle;
219
+ }};
220
+ }
221
+ `;
222
+ const Wrapper$1 = styled.div`
223
+ ${(p) => p.grow ? css`
224
+ min-height: 50px;
225
+ max-height: 150px;
226
+ ` : css`
227
+ height: 50px;
228
+ `}
229
+ flex: 0 0 auto;
230
+ display: flex;
231
+ align-items: center;
232
+ background-color: ${(p) => {
233
+ var _a;
234
+ return (_a = p.theme.colors) == null ? void 0 : _a.accent;
235
+ }};
236
+ border-top: ${(p) => p.theme.inputBorder};
237
+ ${(p) => p["data-has-focus"] && css`
238
+ ${(p2) => {
239
+ var _a;
240
+ return ((_a = p2.theme.accessibility) == null ? void 0 : _a.isTabbing) && borderTabStyle;
241
+ }};
242
+ `}
243
+ ${StyledTextArea} {
244
+ ${(p) => !!p.scrollableCss && p.scrollableCss}
245
+ }
246
+ `;
247
+ const SendSymbol = styled((_a) => {
248
+ var _b = _a, { hasContent } = _b, other = __objRest(_b, ["hasContent"]);
249
+ return /* @__PURE__ */ React.createElement(SymbolBadge, __spreadValues({}, other));
250
+ })`
251
+ line,
252
+ path {
253
+ stroke: ${(p) => {
254
+ var _a;
255
+ return p.hasContent ? (_a = p.theme.colors) == null ? void 0 : _a.primary : "#a6a6a6";
256
+ }};
257
+ fill: ${(p) => {
258
+ var _a;
259
+ return p.hasContent ? (_a = p.theme.colors) == null ? void 0 : _a.primary : "#a6a6a6";
260
+ }};
261
+ }
262
+ `;
263
+ const ConversationLoader = ({ className, agentData }) => {
264
+ return /* @__PURE__ */ React.createElement(ContentBundle, null, /* @__PURE__ */ React.createElement(MessageContainer, null, /* @__PURE__ */ React.createElement(MessageContent, null, /* @__PURE__ */ React.createElement(Loader, null, /* @__PURE__ */ React.createElement("div", null), /* @__PURE__ */ React.createElement("div", null), /* @__PURE__ */ React.createElement("div", null)))));
265
+ };
266
+ const imageLightboxRenderer = (attrs) => /* @__PURE__ */ React.createElement(Lightbox, {
267
+ attrs
268
+ });
269
+ const htmlParseInstructions = {
270
+ transform: {
271
+ img: imageLightboxRenderer
272
+ }
273
+ };
274
+ const ConversationMessageComponent = ({
275
+ className,
276
+ timestamp,
277
+ sender,
278
+ type,
279
+ content
280
+ }) => {
281
+ useDispatch();
282
+ const getMessageStackPosition = (index) => {
283
+ let messageOrder = void 0;
284
+ if (content.length > 1) {
285
+ messageOrder = index === 0 ? "first" : index + 1 === content.length ? "last" : "middle";
286
+ }
287
+ return messageOrder;
288
+ };
289
+ const createSystemMessage = () => {
290
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, content.map((item) => {
291
+ const { key, body, title, form, actions } = item;
292
+ const discrete = !!body && !title && !form && !actions;
293
+ return /* @__PURE__ */ React.createElement(SystemMessage, {
294
+ className,
295
+ key,
296
+ discrete,
297
+ timestamp,
298
+ fullWidth: !!form || !!actions
299
+ }, discrete && body ? /* @__PURE__ */ React.createElement(Html, {
300
+ html: body,
301
+ htmlParseInstruction: htmlParseInstructions
302
+ }) : /* @__PURE__ */ React.createElement(ConversationContent, {
303
+ content: item,
304
+ isUser: false
305
+ }));
306
+ }));
307
+ };
308
+ const createAgentMessage = () => {
309
+ return /* @__PURE__ */ React.createElement(AgentMessage, {
310
+ sender,
311
+ timestamp,
312
+ className
313
+ }, /* @__PURE__ */ React.createElement(ContentBundle, null, content.map((item, index) => {
314
+ return /* @__PURE__ */ React.createElement(MessageContainer, {
315
+ key: item.key
316
+ }, /* @__PURE__ */ React.createElement(ConversationContent, {
317
+ content: item,
318
+ isUser: false,
319
+ stacked: getMessageStackPosition(index)
320
+ }));
321
+ })));
322
+ };
323
+ const createUserMessage = () => {
324
+ return /* @__PURE__ */ React.createElement(UserMessage, {
325
+ timestamp,
326
+ className
327
+ }, /* @__PURE__ */ React.createElement(ContentBundle, null, content.map((item, index) => {
328
+ return /* @__PURE__ */ React.createElement(MessageContainer, {
329
+ key: item.key
330
+ }, /* @__PURE__ */ React.createElement(ConversationContent, {
331
+ content: item,
332
+ isUser: true,
333
+ stacked: getMessageStackPosition(index)
334
+ }));
335
+ })));
336
+ };
337
+ switch (type) {
338
+ case ConversationMessageType.System:
339
+ return createSystemMessage();
340
+ case ConversationMessageType.Agent:
341
+ return createAgentMessage();
342
+ case ConversationMessageType.User:
343
+ return createUserMessage();
344
+ default:
345
+ return null;
346
+ }
347
+ };
348
+ styled(FormComponent)`
349
+ & button.humany-form-component-button {
350
+ ${(p) => {
351
+ var _a, _b;
352
+ return invertedHoverButton({
353
+ active: false,
354
+ primaryColor: (_a = p.theme.colors) == null ? void 0 : _a.primary,
355
+ secondaryColor: (_b = p.theme.colors) == null ? void 0 : _b.accent
356
+ });
357
+ }};
358
+ display: block;
359
+ width: 100%;
360
+ margin-bottom: ${(p) => {
361
+ var _a;
362
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
363
+ }};
364
+ }
365
+
366
+ & button.humany-form-component-submit {
367
+ width: 100%;
368
+ margin: 0;
369
+ :not(:last-child) {
370
+ margin-bottom: ${(p) => {
371
+ var _a;
372
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
373
+ }};
374
+ }
375
+ }
376
+ `;
377
+ styled(Html)`
378
+ white-space: pre-wrap;
379
+
380
+ a {
381
+ color: ${(p) => p.theme.colors.link};
382
+ &:focus {
383
+ ${(p) => {
384
+ var _a;
385
+ return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && borderTabStyle;
386
+ }};
387
+ }
388
+ }
389
+ `;
390
+ styled(List)`
391
+ padding: 0;
392
+ list-style: none;
393
+ margin: 0 -${(p) => {
394
+ var _a;
395
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
396
+ }};
397
+ > li {
398
+ margin: ${(p) => {
399
+ var _a;
400
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
401
+ }};
402
+ }
403
+ `;
404
+ styled.button`
405
+ ${buttonCss};
406
+ display: block;
407
+ background-color: ${(p) => {
408
+ var _a;
409
+ return (_a = p.theme.colors) == null ? void 0 : _a.primary;
410
+ }};
411
+ width: 100%;
412
+ color: #fff;
413
+ &:focus {
414
+ ${(p) => {
415
+ var _a;
416
+ return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && css`
417
+ ${borderTabStyle}
418
+ background-color: transparent;
419
+ `;
420
+ }}
421
+ }
422
+ `;
423
+ const Conversation = ({ className }) => {
424
+ const lastEntry = useRef(document.createElement("div"));
425
+ const [scrollableCss, viewElem] = useScroll(true);
426
+ const { messages, loading, typingActors } = useProperties();
427
+ const [canSmooth, setCanSmooth] = useState(false);
428
+ const scrollView = useCallback((lastEntry2, smooth = true) => {
429
+ if (lastEntry2 !== null && lastEntry2.current !== null) {
430
+ if (messages && messages.length === 1) {
431
+ lastEntry2.current.focus();
432
+ }
433
+ if (lastEntry2.current.id.indexOf("typing_") !== -1 && viewElem.current.scrollTopMax - viewElem.current.scrollTop > lastEntry2.current.clientHeight + 100) {
434
+ return;
435
+ }
436
+ setTimeout(() => {
437
+ if (lastEntry2.current) {
438
+ lastEntry2.current.scrollIntoView({
439
+ block: "end",
440
+ behavior: smooth ? "smooth" : "auto"
441
+ });
442
+ }
443
+ }, 0);
444
+ }
445
+ }, [lastEntry]);
446
+ useEffect(() => {
447
+ if (canSmooth) {
448
+ scrollView(lastEntry);
449
+ }
450
+ }, [messages, typingActors]);
451
+ useTransitionEnd(() => {
452
+ setCanSmooth(true);
453
+ scrollView(lastEntry, false);
454
+ });
455
+ const renderTypingActors = () => {
456
+ if (typingActors && typingActors.length) {
457
+ return typingActors.map((actor, index) => {
458
+ return /* @__PURE__ */ React.createElement(MessageEntry, {
459
+ id: `typing_${actor.name}`,
460
+ ref: typingActors.length ? lastEntry : null,
461
+ key: `typing_${actor.name}`
462
+ }, /* @__PURE__ */ React.createElement(AgentMessage, {
463
+ timestamp: Date.now(),
464
+ sender: actor
465
+ }, /* @__PURE__ */ React.createElement(ConversationLoader, null)));
466
+ });
467
+ }
468
+ return null;
469
+ };
470
+ return /* @__PURE__ */ React.createElement(Wrapper, {
471
+ className: appendClassNames(className, "humany-conversation-component")
472
+ }, /* @__PURE__ */ React.createElement(Scrollable, {
473
+ tabIndex: 0,
474
+ scrollableCss,
475
+ ref: viewElem
476
+ }, messages && messages.length ? messages.map((message, index) => {
477
+ const { type, timestamp, sender, content } = message;
478
+ return /* @__PURE__ */ React.createElement(MessageEntry, {
479
+ className: "humany-conversation-entry",
480
+ tabIndex: -1,
481
+ key: `${type}_${sender == null ? void 0 : sender.name}_${timestamp}_${content[0].key}`,
482
+ ref: index + 1 < messages.length ? null : typingActors.length ? null : lastEntry
483
+ }, /* @__PURE__ */ React.createElement(ConversationMessageComponent, __spreadValues({}, message)));
484
+ }) : null, renderTypingActors(), loading && /* @__PURE__ */ React.createElement(MessageEntry, null, /* @__PURE__ */ React.createElement(ConversationLoader, null))), /* @__PURE__ */ React.createElement(ConversationInput, null));
485
+ };
486
+ const Wrapper = styled.div`
487
+ position: absolute;
488
+ right: 0;
489
+ left: 0;
490
+ bottom: 0;
491
+ top: 0;
492
+ overflow: hidden;
493
+ display: flex;
494
+ flex-direction: column;
495
+ `;
496
+ const Scrollable = styled.div`
497
+ display: flex;
498
+ flex-direction: column;
499
+ align-items: stretch;
500
+ flex: 0 1 100%;
501
+ padding: 0 ${(p) => {
502
+ var _a;
503
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
504
+ }};
505
+ ${(p) => !!p.scrollableCss && p.scrollableCss};
506
+ &:focus {
507
+ ${(p) => {
508
+ var _a;
509
+ return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && borderTabStyle;
510
+ }};
511
+ }
512
+ `;
513
+ const MessageEntry = styled.div`
514
+ margin: 0;
515
+ margin-bottom: ${(p) => {
516
+ var _a;
517
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
518
+ }};
519
+
520
+ &:first-of-type {
521
+ margin-top: ${(p) => {
522
+ var _a;
523
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
524
+ }};
525
+ }
526
+
527
+ &:last-of-type {
528
+ padding-bottom: ${(p) => {
529
+ var _a;
530
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
531
+ }};
532
+ }
533
+
534
+ * {
535
+ font-size: ${(p) => {
536
+ var _a;
537
+ return (_a = p.theme.fonts) == null ? void 0 : _a.normal;
538
+ }};
539
+ }
540
+
541
+ & span,
542
+ p,
543
+ a,
544
+ div {
545
+ font-weight: 300;
546
+ }
547
+
548
+ & b,
549
+ h1 {
550
+ font-weight: normal;
551
+ }
552
+
553
+ ${headingElement("h1", css`
554
+ font-weight: normal;
555
+ `)}
556
+ `;
557
+ export { Conversation as default };
558
+ //# sourceMappingURL=conversation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.js","sources":["../src/ui/conversation/conversation-input.tsx","../src/ui/conversation/conversation-loader.tsx","../src/ui/conversation/conversation-message.tsx","../src/ui/conversation/conversation.tsx"],"sourcesContent":["import {\n borderTabStyle,\n Button,\n Input,\n SymbolBadge,\n useDispatch,\n useProperties,\n useScroll,\n} from '@telia-ace/widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React, { useEffect, useState } from 'react';\nimport styled, { css } from 'styled-components';\nimport { ConversationComponentProperties } from './conversation-component';\n\ntype Props = {\n className?: string;\n};\n\nconst ConversationInput: React.FC<Props> = ({ className }) => {\n const [inputText, setInputText] = useState('');\n const [inputFocus, setInputFocus] = useState(false);\n const [calculatedLineHeight, setCalculatedLineHeight] = useState(0);\n const [textareaMaxHeight, setTextareaMaxHeight] = useState(0);\n const dispatch = useDispatch();\n const {\n inputPlaceholder = 'Type your message',\n inputHidden = false,\n inputDisabled = false,\n sendButtonLabel = 'Send message',\n inputMultiline: multiline = true,\n secondaryAction,\n } = useProperties<ConversationComponentProperties>();\n const [scrollableCss, inputRef] = useScroll(true);\n\n useEffect(() => {\n if (inputRef.current) {\n const { lineHeight, maxHeight } = getComputedStyle(inputRef.current);\n if (lineHeight && lineHeight.indexOf('px') > -1) {\n const lineHeightNumber = lineHeight.split('px');\n const calcLH = parseInt(lineHeightNumber[0], 10);\n setCalculatedLineHeight(calcLH);\n const maxHeightNumber = maxHeight.split('px');\n setTextareaMaxHeight(parseInt(maxHeightNumber[0], 10));\n }\n }\n }, [inputRef.current]);\n\n const submit = (e: any) => {\n if (!e.shiftKey || !multiline) {\n e.preventDefault();\n if (inputText && inputText.length > 0) {\n dispatch('user-submit', { text: inputText });\n setInputText('');\n onChange('');\n }\n } else if (inputText.length < 1) {\n e.preventDefault();\n }\n };\n\n const onSecondaryActionButtonClick = (e: any) => {\n if (!secondaryAction) {\n return;\n }\n e.preventDefault();\n dispatch('action', secondaryAction.action);\n };\n\n const calculateHeight = (value: string) => {\n if (multiline && inputRef.current) {\n const scrollHeight = inputRef.current.scrollHeight;\n if (scrollHeight > calculatedLineHeight) {\n inputRef.current.style.height = 'auto';\n let areaHeight = scrollHeight;\n if (value.length < 1) {\n areaHeight = calculatedLineHeight;\n }\n inputRef.current.style.height = `${areaHeight}px`;\n\n if (areaHeight >= textareaMaxHeight) {\n inputRef.current.style.overflowY = 'scroll';\n } else {\n inputRef.current.style.overflowY = 'hidden';\n }\n }\n }\n };\n\n const onChange = (value: string) => {\n calculateHeight(value);\n setInputText(value);\n if (value && value.length > 0) {\n dispatch('user-typing', { textLength: value.length });\n }\n };\n\n if (inputHidden) {\n return null;\n }\n\n return (\n <Wrapper\n grow={multiline}\n className={appendClassNames('humany-conversation-input', className)}\n data-has-focus={inputFocus}\n scrollableCss={scrollableCss}\n >\n {secondaryAction && (\n <StyledButton\n disabled={inputDisabled}\n onClick={onSecondaryActionButtonClick}\n title={secondaryAction.label}\n aria-label={secondaryAction.label}\n >\n <SymbolBadge\n size={24}\n symbol={{ type: 'Svg', content: secondaryAction.icon || 'browse' }}\n />\n </StyledButton>\n )}\n {multiline ? (\n <StyledTextArea\n value={inputText}\n onChange={onChange}\n onEnter={submit}\n disabled={inputDisabled}\n aria-label={inputPlaceholder}\n placeholder={inputPlaceholder}\n onFocusChange={setInputFocus}\n type={'textarea'}\n rows={1}\n ref={inputRef}\n />\n ) : (\n <StyledInput\n value={inputText}\n onChange={onChange}\n onEnter={submit}\n disabled={inputDisabled}\n aria-label={inputPlaceholder}\n placeholder={inputPlaceholder}\n onFocusChange={setInputFocus}\n />\n )}\n <StyledButton\n disabled={inputDisabled}\n onClick={submit}\n title={sendButtonLabel}\n aria-label={sendButtonLabel}\n >\n <SendSymbol\n size={22}\n symbol={{ type: 'Svg', content: 'send' }}\n hasContent={inputText && inputText.length}\n />\n </StyledButton>\n </Wrapper>\n );\n};\n\nconst StyledTextArea = styled(Input)<any>`\n resize: none;\n flex: 1;\n flex-shrink: 1;\n min-height: 1.2em;\n max-height: 148px;\n line-height: 1.2em;\n height: 1.2em;\n padding: 0;\n margin: ${(p) => p.theme.sizes?.small} ${(p) => p.theme.sizes?.medium};\n font-size: ${(p) => p.theme.fonts?.normal};\n border: none;\n transition: height 200ms linear;\n outline: none;\n`;\n\nconst StyledInput = styled(Input)<any>`\n flex: 1;\n border: none;\n background-color: transparent;\n font-weight: 300;\n font-size: ${(p) => p.theme.fonts?.normal};\n line-height: 1.2em;\n outline: none;\n padding-left: ${(p) => p.theme.sizes?.large};\n color: ${(p) => p.theme.colors?.text};\n &::placeholder {\n color: ${(p) => p.theme.colors?.textLight};\n font-style: italic;\n }\n`;\n\nconst StyledButton = styled(Button)<any>`\n flex: 0 0 50px;\n align-self: stretch;\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n color: #a6a6a6;\n &:focus {\n ${(p) => p.theme.accessibility?.isTabbing && borderTabStyle};\n }\n`;\n\nconst Wrapper = styled.div<{ 'data-has-focus': boolean } & any>`\n ${(p) =>\n p.grow\n ? css`\n min-height: 50px;\n max-height: 150px;\n `\n : css`\n height: 50px;\n `}\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n background-color: ${(p) => p.theme.colors?.accent};\n border-top: ${(p) => p.theme.inputBorder};\n ${(p) =>\n p['data-has-focus'] &&\n css`\n ${(p) => p.theme.accessibility?.isTabbing && borderTabStyle};\n `}\n ${StyledTextArea} {\n ${(p) => !!p.scrollableCss && p.scrollableCss}\n }\n`;\n\nconst SendSymbol = styled(({ hasContent, ...other }) => <SymbolBadge {...other} />)`\n line,\n path {\n stroke: ${(p) => (p.hasContent ? p.theme.colors?.primary : '#a6a6a6')};\n fill: ${(p) => (p.hasContent ? p.theme.colors?.primary : '#a6a6a6')};\n }\n`;\n\nexport default ConversationInput;\n","import React from 'react';\nimport { ConversationMessageSender } from '../../types';\nimport { ContentBundle, Loader, MessageContainer, MessageContent } from './conversation-styles';\n\ntype Props = {\n className?: string;\n agentData?: ConversationMessageSender;\n};\n\nconst ConversationLoader: React.FC<Props> = ({ className, agentData }) => {\n return (\n <ContentBundle>\n <MessageContainer>\n <MessageContent>\n <Loader>\n <div />\n <div />\n <div />\n </Loader>\n </MessageContent>\n </MessageContainer>\n </ContentBundle>\n );\n};\n\nexport default ConversationLoader;\n","import { FormComponent } from '@telia-ace/widget-forms';\nimport {\n borderTabStyle,\n buttonCss,\n Html,\n invertedHoverButton,\n Lightbox,\n List,\n useDispatch,\n} from '@telia-ace/widget-ui';\nimport React from 'react';\nimport styled, { css } from 'styled-components';\nimport { ConversationMessageType } from '../../conversation-controller';\nimport { ConversationMessageContent } from '../../types';\nimport { BundledConversationMessage } from './conversation-component';\nimport ConversationContent from './conversation-content';\nimport {\n ContentBundle,\n MessageContainer,\n MessageContent,\n MessageContentPart as Part,\n MessageTitle,\n} from './conversation-styles';\nimport { AgentMessage, SystemMessage, UserMessage } from './message-types';\n\nconst imageLightboxRenderer = (\n attrs: React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLImageElement>, HTMLImageElement>\n) => <Lightbox attrs={attrs} />;\n\nconst htmlParseInstructions = {\n transform: {\n img: imageLightboxRenderer,\n },\n};\n\ntype Props = {\n className?: string;\n} & BundledConversationMessage;\n\nconst ConversationMessageComponent: React.FC<Props> = ({\n className,\n timestamp,\n sender,\n type,\n content,\n}) => {\n const dispatch = useDispatch();\n\n const getMessageStackPosition = (index: number) => {\n let messageOrder = undefined;\n if (content.length > 1) {\n messageOrder = index === 0 ? 'first' : index + 1 === content.length ? 'last' : 'middle';\n }\n return messageOrder;\n };\n\n const renderContent = (content: ConversationMessageContent, isUser = false, stacked?: any) => {\n const { title, body, actions, form } = content;\n return (\n <MessageContent\n user={isUser}\n stacked={!!stacked && stacked}\n fullWidth={!!form || !!actions}\n >\n {title && (\n <Part>\n <MessageTitle variant=\"h2\">{title}</MessageTitle>\n </Part>\n )}\n {body && (\n <Part>\n <StyledHtml html={body} htmlParseInstruction={htmlParseInstructions} />\n </Part>\n )}\n {form && (\n <Part>\n <StyledForm\n {...form}\n onChange={(key: string, data: any) => {\n dispatch('form', {\n data,\n formKey: form.schema.id,\n actionKey: key,\n });\n }}\n />\n </Part>\n )}\n {actions && (\n <Part>\n <StyledActionList\n items={Object.keys(actions).map((i: any) => {\n return { label: actions[i], actionKey: i };\n })}\n renderItem={(item: any) => {\n return (\n <li key={item.actionKey}>\n <StyledActionButton\n onClick={() => {\n dispatch('action', item.actionKey);\n }}\n >\n {item.label}\n </StyledActionButton>\n </li>\n );\n }}\n />\n </Part>\n )}\n </MessageContent>\n );\n };\n\n const createSystemMessage = () => {\n return (\n <>\n {content.map((item) => {\n const { key, body, title, form, actions } = item;\n const discrete = !!body && !title && !form && !actions;\n return (\n <SystemMessage\n className={className}\n key={key}\n discrete={discrete}\n timestamp={timestamp}\n fullWidth={!!form || !!actions}\n >\n {discrete && body ? (\n <Html html={body} htmlParseInstruction={htmlParseInstructions} />\n ) : (\n <ConversationContent content={item} isUser={false} />\n )}\n </SystemMessage>\n );\n })}\n </>\n );\n };\n\n const createAgentMessage = () => {\n return (\n <AgentMessage sender={sender} timestamp={timestamp} className={className}>\n <ContentBundle>\n {content.map((item, index) => {\n return (\n <MessageContainer key={item.key}>\n <ConversationContent\n content={item}\n isUser={false}\n stacked={getMessageStackPosition(index)}\n />\n </MessageContainer>\n );\n })}\n </ContentBundle>\n </AgentMessage>\n );\n };\n\n const createUserMessage = () => {\n return (\n <UserMessage timestamp={timestamp} className={className}>\n <ContentBundle>\n {content.map((item, index) => {\n return (\n <MessageContainer key={item.key}>\n <ConversationContent\n content={item}\n isUser={true}\n stacked={getMessageStackPosition(index)}\n />\n </MessageContainer>\n );\n })}\n </ContentBundle>\n </UserMessage>\n );\n };\n\n switch (type) {\n case ConversationMessageType.System:\n return createSystemMessage();\n case ConversationMessageType.Agent:\n return createAgentMessage();\n case ConversationMessageType.User:\n return createUserMessage();\n default:\n return null;\n }\n};\n\nconst StyledForm = styled(FormComponent)`\n & button.humany-form-component-button {\n ${(p) =>\n invertedHoverButton({\n active: false,\n primaryColor: p.theme.colors?.primary,\n secondaryColor: p.theme.colors?.accent,\n })};\n display: block;\n width: 100%;\n margin-bottom: ${(p) => p.theme.sizes?.normal};\n }\n\n & button.humany-form-component-submit {\n width: 100%;\n margin: 0;\n :not(:last-child) {\n margin-bottom: ${(p) => p.theme.sizes?.normal};\n }\n }\n`;\n\nconst StyledHtml = styled(Html)<any>`\n white-space: pre-wrap;\n\n a {\n color: ${(p) => p.theme.colors.link};\n &:focus {\n ${(p) => p.theme.accessibility?.isTabbing && borderTabStyle};\n }\n }\n`;\n\nconst StyledActionList = styled(List)`\n padding: 0;\n list-style: none;\n margin: 0 -${(p) => p.theme.sizes?.normal};\n > li {\n margin: ${(p) => p.theme.sizes?.normal};\n }\n`;\n\nconst StyledActionButton = styled.button`\n ${buttonCss};\n display: block;\n background-color: ${(p) => p.theme.colors?.primary};\n width: 100%;\n color: #fff;\n &:focus {\n ${(p) =>\n p.theme.accessibility?.isTabbing &&\n css`\n ${borderTabStyle}\n background-color: transparent;\n `}\n }\n`;\n\nexport default ConversationMessageComponent;\n","import {\n borderTabStyle,\n headingElement,\n useProperties,\n useScroll,\n useTransitionEnd,\n} from '@telia-ace/widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\nimport { ConversationMessageSender } from '../../types';\nimport {\n BundledConversationMessage,\n ConversationComponentProperties,\n} from './conversation-component';\nimport ConversationInput from './conversation-input';\nimport ConversationLoader from './conversation-loader';\nimport ConversationMessageComponent from './conversation-message';\nimport { AgentMessage } from './message-types';\n\ntype Props = {\n className: string;\n};\n\nconst Conversation: React.FC<Props> = ({ className }) => {\n const lastEntry = useRef(document.createElement('div'));\n const [scrollableCss, viewElem] = useScroll(true);\n const { messages, loading, typingActors } = useProperties<ConversationComponentProperties>();\n const [canSmooth, setCanSmooth] = useState(false);\n const scrollView = useCallback(\n (lastEntry: any, smooth = true) => {\n if (lastEntry !== null && lastEntry.current !== null) {\n if (messages && messages.length === 1) {\n lastEntry.current.focus();\n }\n /**\n * Don't scroll on typing state if the user has scrolled up a bit.\n */\n if (\n lastEntry.current.id.indexOf('typing_') !== -1 &&\n viewElem.current.scrollTopMax - viewElem.current.scrollTop >\n lastEntry.current.clientHeight + 100\n ) {\n return;\n }\n setTimeout(() => {\n if (lastEntry.current) {\n lastEntry.current.scrollIntoView({\n block: 'end',\n behavior: smooth ? 'smooth' : 'auto',\n });\n }\n }, 0);\n }\n },\n [lastEntry]\n );\n\n useEffect(() => {\n if (canSmooth) {\n scrollView(lastEntry);\n }\n }, [messages, typingActors]);\n\n useTransitionEnd(() => {\n setCanSmooth(true);\n scrollView(lastEntry, false);\n });\n\n const renderTypingActors = () => {\n if (typingActors && typingActors.length) {\n return typingActors.map((actor: ConversationMessageSender, index) => {\n return (\n <MessageEntry\n id={`typing_${actor.name}`}\n ref={typingActors.length ? lastEntry : null}\n key={`typing_${actor.name}`}\n >\n <AgentMessage timestamp={Date.now()} sender={actor}>\n <ConversationLoader></ConversationLoader>\n </AgentMessage>\n </MessageEntry>\n );\n });\n }\n return null;\n };\n\n return (\n <Wrapper className={appendClassNames(className, 'humany-conversation-component')}>\n <Scrollable tabIndex={0} scrollableCss={scrollableCss} ref={viewElem}>\n {messages && messages.length\n ? messages.map((message: BundledConversationMessage, index: any) => {\n const { type, timestamp, sender, content } = message;\n return (\n <MessageEntry\n className={'humany-conversation-entry'}\n tabIndex={-1}\n key={`${type}_${sender?.name}_${timestamp}_${content[0].key}`}\n ref={\n index + 1 < messages.length\n ? null\n : typingActors.length\n ? null\n : lastEntry\n }\n >\n <ConversationMessageComponent {...message} />\n </MessageEntry>\n );\n })\n : null}\n {renderTypingActors()}\n {loading && (\n <MessageEntry>\n <ConversationLoader />\n </MessageEntry>\n )}\n </Scrollable>\n <ConversationInput />\n </Wrapper>\n );\n};\n\nconst Wrapper = styled.div`\n position: absolute;\n right: 0;\n left: 0;\n bottom: 0;\n top: 0;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n`;\n\nconst Scrollable = styled.div<{ scrolling: boolean } & any>`\n display: flex;\n flex-direction: column;\n align-items: stretch;\n flex: 0 1 100%;\n padding: 0 ${(p) => p.theme.sizes?.normal};\n ${(p) => !!p.scrollableCss && p.scrollableCss};\n &:focus {\n ${(p) => p.theme.accessibility?.isTabbing && borderTabStyle};\n }\n`;\n\nconst MessageEntry = styled.div`\n margin: 0;\n margin-bottom: ${(p) => p.theme.sizes?.medium};\n\n &:first-of-type {\n margin-top: ${(p) => p.theme.sizes?.medium};\n }\n\n &:last-of-type {\n padding-bottom: ${(p) => p.theme.sizes?.medium};\n }\n\n * {\n font-size: ${(p) => p.theme.fonts?.normal};\n }\n\n & span,\n p,\n a,\n div {\n font-weight: 300;\n }\n\n & b,\n h1 {\n font-weight: normal;\n }\n\n ${headingElement(\n 'h1',\n css`\n font-weight: normal;\n `\n )}\n`;\n\nexport default Conversation;\n"],"names":["Wrapper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,oBAAqC,CAAC,EAAE,gBAAgB;AAC1D,QAAM,CAAC,WAAW,gBAAgB,SAAS,EAAE;AAC7C,QAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;AAClD,QAAM,CAAC,sBAAsB,2BAA2B,SAAS,CAAC;AAClE,QAAM,CAAC,mBAAmB,wBAAwB,SAAS,CAAC;AAC5D,QAAM,WAAW;AACX,QAAA;AAAA,IACF,mBAAmB;AAAA,IACnB,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,IAClB,gBAAgB,YAAY;AAAA,IAC5B;AAAA,MACA,cAA+C;AACnD,QAAM,CAAC,eAAe,YAAY,UAAU,IAAI;AAEhD,YAAU,MAAM;AACZ,QAAI,SAAS,SAAS;AAClB,YAAM,EAAE,YAAY,c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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAerC,eACE,MACA;AAAA;AAAA,SAGJ;AAAA;;"}
@@ -1,9 +1,9 @@
1
- import { ConversationEndedBehavior, ConversationPlatform, UnregisterControllerDelegate } from './conversation-platform';
2
- export { ConversationController, ConversationEntry, ConversationMessageType, } from './conversation-controller';
3
- export type { ConversationMessage } from './conversation-controller';
4
- export { ConversationMessageListItemType } from './types';
5
- export type { ConversationMessageContent, ConversationMessageSender, ConverstationMessageItem, } from './types';
6
- export { ConversationComponent, ConversationReturnButtonComponent } from './ui';
7
- export { registerCustomMessageComponent } from './utils/custom-message';
8
- export { ConversationPlatform, ConversationEndedBehavior };
9
- export type { UnregisterControllerDelegate };
1
+ import { ConversationEndedBehavior, ConversationPlatform, UnregisterControllerDelegate } from './conversation-platform';
2
+ export { ConversationController, ConversationEntry, ConversationMessageType, } from './conversation-controller';
3
+ export type { ConversationMessage } from './conversation-controller';
4
+ export { ConversationMessageListItemType } from './types';
5
+ export type { ConversationMessageContent, ConversationMessageSender, ConverstationMessageItem, } from './types';
6
+ export { ConversationComponent, ConversationReturnButtonComponent, StyledButtonList } from './ui';
7
+ export { registerCustomMessageComponent } from './utils/custom-message';
8
+ export { ConversationPlatform, ConversationEndedBehavior };
9
+ export type { UnregisterControllerDelegate };
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export { i as ConversationComponent, f as ConversationController, e as ConversationEndedBehavior, g as ConversationEntry, h as ConversationMessageListItemType, b as ConversationMessageType, d as ConversationPlatform, j as ConversationReturnButtonComponent, k as StyledButtonList, r as registerCustomMessageComponent } from "./index2.js";
2
+ import "@telia-ace/widget-core";
3
+ import "@telia-ace/widget-services";
4
+ import "@telia-ace/widget-utilities";
5
+ import "@telia-ace/widget-forms";
6
+ import "@telia-ace/widget-plugins";
7
+ import "@telia-ace/widget-ui";
8
+ import "react";
9
+ import "styled-components";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}