@servicetitan/titan-chat-ui-anvil2 3.2.1 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/assets/atlas-avatar.svg +95 -0
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-input.js +4 -2
- package/dist/components/chat/chat-input.js.map +1 -1
- package/dist/components/chat/chat-message-typing.js +3 -3
- package/dist/components/chat/chat-message-typing.js.map +1 -1
- package/dist/components/chat/chat-message.d.ts.map +1 -1
- package/dist/components/chat/chat-message.js +3 -5
- package/dist/components/chat/chat-message.js.map +1 -1
- package/dist/components/chat/chat.js +2 -2
- package/dist/components/chat/chat.js.map +1 -1
- package/dist/components/messages/message-avatar.d.ts.map +1 -1
- package/dist/components/messages/message-avatar.js +2 -0
- package/dist/components/messages/message-avatar.js.map +1 -1
- package/dist/components/messages/message-avatar.module.less +4 -0
- package/package.json +5 -5
- package/src/assets/atlas-avatar.svg +95 -0
- package/src/components/chat/chat-input.tsx +3 -2
- package/src/components/chat/chat-message-typing.tsx +3 -3
- package/src/components/chat/chat-message.tsx +3 -5
- package/src/components/chat/chat.tsx +1 -1
- package/src/components/messages/message-avatar.module.less +4 -0
- package/src/components/messages/message-avatar.module.less.d.ts +1 -0
- package/src/components/messages/message-avatar.tsx +2 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# v4.0.0 (Fri Sep 19 2025)
|
|
2
|
+
|
|
3
|
+
#### 💥 Breaking Change
|
|
4
|
+
|
|
5
|
+
- Bump cypress from 14.3.3 to 15.2.0 [#55](https://github.com/servicetitan/titan-chatbot-client/pull/55) ([@dependabot[bot]](https://github.com/dependabot[bot]))
|
|
6
|
+
|
|
7
|
+
#### 🚀 Enhancement
|
|
8
|
+
|
|
9
|
+
- SPA-7400: Rebrand Support Chatbot to Atlas [#56](https://github.com/servicetitan/titan-chatbot-client/pull/56) ([@AlexYarmolchuk](https://github.com/AlexYarmolchuk))
|
|
10
|
+
|
|
11
|
+
#### Authors: 2
|
|
12
|
+
|
|
13
|
+
- [@dependabot[bot]](https://github.com/dependabot[bot])
|
|
14
|
+
- Alexandr Yarmolchuk ([@AlexYarmolchuk](https://github.com/AlexYarmolchuk))
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
1
18
|
# v3.2.1 (Tue Sep 09 2025)
|
|
2
19
|
|
|
3
20
|
#### 🐛 Bug Fix
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_14694_37355)">
|
|
3
|
+
<path d="M2.76947 11.999V35.9984L23.9992 47.9981L45.2289 35.9984V11.999L23.9992 -0.000732422L2.76947 11.999Z" fill="url(#paint0_linear_14694_37355)"/>
|
|
4
|
+
<g style="mix-blend-mode:overlay">
|
|
5
|
+
<path d="M2.77045 35.999L11.8311 30.8767L2.77045 23.9993V35.999Z" fill="url(#paint1_linear_14694_37355)"/>
|
|
6
|
+
<path d="M45.2304 11.9993L36.1697 17.1215L45.2304 23.999V11.9993Z" fill="url(#paint2_linear_14694_37355)"/>
|
|
7
|
+
<path d="M23.9991 48.0002V37.7571L13.3842 42.001L23.9991 48.0002Z" fill="url(#paint3_linear_14694_37355)"/>
|
|
8
|
+
<path d="M23.9995 -0.000732422V10.2424L34.6144 5.99841L23.9995 -0.000732422Z" fill="url(#paint4_linear_14694_37355)"/>
|
|
9
|
+
<path d="M45.2311 36.0004L36.1705 30.8782L34.6162 42.001L45.2311 36.0004Z" fill="url(#paint5_linear_14694_37355)"/>
|
|
10
|
+
<path d="M2.77045 11.9998L11.8311 17.1221L13.3853 5.99927L2.77045 11.9998Z" fill="url(#paint6_linear_14694_37355)"/>
|
|
11
|
+
</g>
|
|
12
|
+
<g style="mix-blend-mode:overlay">
|
|
13
|
+
<path d="M2.77045 11.9993L11.8311 17.1215L2.77045 23.999V11.9993Z" fill="url(#paint7_linear_14694_37355)"/>
|
|
14
|
+
<path d="M45.2304 35.999L36.1697 30.8767L45.2304 23.9993V35.999Z" fill="url(#paint8_linear_14694_37355)"/>
|
|
15
|
+
<path d="M2.7702 36.0008L11.8308 30.8785L13.3851 42.0013L2.7702 36.0008Z" fill="url(#paint9_linear_14694_37355)"/>
|
|
16
|
+
<path d="M45.2311 11.9998L36.1705 17.1221L34.6162 5.99927L45.2311 11.9998Z" fill="url(#paint10_linear_14694_37355)"/>
|
|
17
|
+
<path d="M23.9995 48.0002V37.7571L34.6144 42.001L23.9995 48.0002Z" fill="url(#paint11_linear_14694_37355)"/>
|
|
18
|
+
<path d="M23.9988 -0.000732422V10.2424L13.384 5.99841L23.9988 -0.000732422Z" fill="url(#paint12_linear_14694_37355)"/>
|
|
19
|
+
</g>
|
|
20
|
+
<path opacity="0.66" d="M32.1114 10.2473H15.8869L7.7746 24.0036L15.8869 37.76H32.1114L40.2236 24.0036L32.1114 10.2473Z" fill="white"/>
|
|
21
|
+
<path d="M11.8309 17.1262V30.8811L24 37.76L36.1691 30.8811V17.1262L24 10.2473L11.8309 17.1262Z" fill="white"/>
|
|
22
|
+
<path d="M24.0009 13.3647L26.8825 21.1806L34.866 24.0004L26.8825 26.8216L24.0009 34.6375L21.1207 26.8216L13.1372 24.0004L21.1207 21.1806L24.0009 13.3647Z" fill="url(#paint13_linear_14694_37355)"/>
|
|
23
|
+
<path d="M13.1378 23.9995H24.0014V34.6352L21.1212 26.8192L13.1378 23.9995Z" fill="url(#paint14_linear_14694_37355)"/>
|
|
24
|
+
<path d="M34.8657 24.0004H24.0021V13.3647L26.8823 21.1807L34.8657 24.0004Z" fill="url(#paint15_linear_14694_37355)"/>
|
|
25
|
+
</g>
|
|
26
|
+
<defs>
|
|
27
|
+
<linearGradient id="paint0_linear_14694_37355" x1="2.76947" y1="23.9987" x2="45.2289" y2="23.9987" gradientUnits="userSpaceOnUse">
|
|
28
|
+
<stop stop-color="#2F6CDB"/>
|
|
29
|
+
<stop offset="1" stop-color="#55AAE7"/>
|
|
30
|
+
</linearGradient>
|
|
31
|
+
<linearGradient id="paint1_linear_14694_37355" x1="28.7112" y1="-6.03654" x2="-21.5772" y2="75.9966" gradientUnits="userSpaceOnUse">
|
|
32
|
+
<stop stop-color="#4357B5"/>
|
|
33
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
34
|
+
</linearGradient>
|
|
35
|
+
<linearGradient id="paint2_linear_14694_37355" x1="49.5433" y1="6.73372" x2="-0.746622" y2="88.7655" gradientUnits="userSpaceOnUse">
|
|
36
|
+
<stop stop-color="#4357B5"/>
|
|
37
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
38
|
+
</linearGradient>
|
|
39
|
+
<linearGradient id="paint3_linear_14694_37355" x1="44.9624" y1="3.92721" x2="-5.32747" y2="85.9604" gradientUnits="userSpaceOnUse">
|
|
40
|
+
<stop stop-color="#4357B5"/>
|
|
41
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
42
|
+
</linearGradient>
|
|
43
|
+
<linearGradient id="paint4_linear_14694_37355" x1="33.2914" y1="-3.23027" x2="-16.9986" y2="78.803" gradientUnits="userSpaceOnUse">
|
|
44
|
+
<stop stop-color="#4357B5"/>
|
|
45
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
46
|
+
</linearGradient>
|
|
47
|
+
<linearGradient id="paint5_linear_14694_37355" x1="55.461" y1="10.3619" x2="5.17111" y2="92.3951" gradientUnits="userSpaceOnUse">
|
|
48
|
+
<stop stop-color="#4357B5"/>
|
|
49
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
50
|
+
</linearGradient>
|
|
51
|
+
<linearGradient id="paint6_linear_14694_37355" x1="22.7942" y1="-9.66412" x2="-27.4942" y2="72.3691" gradientUnits="userSpaceOnUse">
|
|
52
|
+
<stop stop-color="#4357B5"/>
|
|
53
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
54
|
+
</linearGradient>
|
|
55
|
+
<linearGradient id="paint7_linear_14694_37355" x1="9.87142" y1="21.6635" x2="0.296576" y2="16.5084" gradientUnits="userSpaceOnUse">
|
|
56
|
+
<stop stop-color="#2E6BD3"/>
|
|
57
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
58
|
+
</linearGradient>
|
|
59
|
+
<linearGradient id="paint8_linear_14694_37355" x1="39.4934" y1="26.968" x2="47.6416" y2="31.4596" gradientUnits="userSpaceOnUse">
|
|
60
|
+
<stop stop-color="#2E6BD3"/>
|
|
61
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
62
|
+
</linearGradient>
|
|
63
|
+
<linearGradient id="paint9_linear_14694_37355" x1="15.835" y1="34.8603" x2="5.21554" y2="40.2831" gradientUnits="userSpaceOnUse">
|
|
64
|
+
<stop stop-color="#2E6BD3"/>
|
|
65
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
66
|
+
</linearGradient>
|
|
67
|
+
<linearGradient id="paint10_linear_14694_37355" x1="33.8435" y1="12.3838" x2="42.8968" y2="7.36418" gradientUnits="userSpaceOnUse">
|
|
68
|
+
<stop stop-color="#2E6BD3"/>
|
|
69
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
70
|
+
</linearGradient>
|
|
71
|
+
<linearGradient id="paint11_linear_14694_37355" x1="29.3062" y1="36.7828" x2="29.3062" y2="47.8354" gradientUnits="userSpaceOnUse">
|
|
72
|
+
<stop stop-color="#2E6BD3"/>
|
|
73
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
74
|
+
</linearGradient>
|
|
75
|
+
<linearGradient id="paint12_linear_14694_37355" x1="18.6907" y1="11.8027" x2="18.6907" y2="0.631132" gradientUnits="userSpaceOnUse">
|
|
76
|
+
<stop stop-color="#2E6BD3"/>
|
|
77
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
78
|
+
</linearGradient>
|
|
79
|
+
<linearGradient id="paint13_linear_14694_37355" x1="24.0009" y1="13.6083" x2="24.0009" y2="34.2593" gradientUnits="userSpaceOnUse">
|
|
80
|
+
<stop stop-color="#2E6BD3"/>
|
|
81
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
82
|
+
</linearGradient>
|
|
83
|
+
<linearGradient id="paint14_linear_14694_37355" x1="17.7244" y1="30.4929" x2="22.4066" y2="23.6925" gradientUnits="userSpaceOnUse">
|
|
84
|
+
<stop stop-color="#2E6BD3"/>
|
|
85
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
86
|
+
</linearGradient>
|
|
87
|
+
<linearGradient id="paint15_linear_14694_37355" x1="29.4346" y1="23.8385" x2="29.4346" y2="17.9239" gradientUnits="userSpaceOnUse">
|
|
88
|
+
<stop stop-color="#2E6BD3"/>
|
|
89
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
90
|
+
</linearGradient>
|
|
91
|
+
<clipPath id="clip0_14694_37355">
|
|
92
|
+
<rect width="48" height="48" fill="white"/>
|
|
93
|
+
</clipPath>
|
|
94
|
+
</defs>
|
|
95
|
+
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input.d.ts","sourceRoot":"","sources":["../../../src/components/chat/chat-input.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEH,EAAE,EAOL,MAAM,OAAO,CAAC;AAMf,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"chat-input.d.ts","sourceRoot":"","sources":["../../../src/components/chat/chat-input.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEH,EAAE,EAOL,MAAM,OAAO,CAAC;AAMf,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CA6IhD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button, Flex, Textarea } from '@servicetitan/anvil2';
|
|
3
3
|
import IconSend from '@servicetitan/anvil2/assets/icons/material/round/send.svg';
|
|
4
4
|
import { provide, useDependencies } from '@servicetitan/react-ioc';
|
|
5
|
-
import { CHAT_UI_STORE_TOKEN } from '@servicetitan/titan-chat-ui-common';
|
|
5
|
+
import { CHAT_UI_STORE_TOKEN, useCustomizationChat } from '@servicetitan/titan-chat-ui-common';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { observer } from 'mobx-react';
|
|
8
8
|
import { useCallback, useEffect, useRef, useState, } from 'react';
|
|
@@ -12,6 +12,8 @@ const TIMEOUT_COOLDOWN_MS = 3000;
|
|
|
12
12
|
export const ChatInput = provide({
|
|
13
13
|
singletons: [ChatInputStore],
|
|
14
14
|
})(observer(({ className }) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const customization = useCustomizationChat();
|
|
15
17
|
const typingTimeoutRef = useRef(undefined);
|
|
16
18
|
const [isSending, setIsSending] = useState(false);
|
|
17
19
|
const textareaRef = useRef(null);
|
|
@@ -82,7 +84,7 @@ export const ChatInput = provide({
|
|
|
82
84
|
textareaRef.current.focus();
|
|
83
85
|
}
|
|
84
86
|
}, []);
|
|
85
|
-
return (_jsx("form", { className: classNames(className), onSubmit: handleSendMessage, children: _jsxs(Flex, { direction: "row", gap: 4, className: Styles.formContainer, children: [_jsx(Textarea, { ref: textareaRef, name: "question", placeholder:
|
|
87
|
+
return (_jsx("form", { className: classNames(className), onSubmit: handleSendMessage, children: _jsxs(Flex, { direction: "row", gap: 4, className: Styles.formContainer, children: [_jsx(Textarea, { ref: textareaRef, name: "question", placeholder: (_b = (_a = customization.input) === null || _a === void 0 ? void 0 : _a.placeholderText) !== null && _b !== void 0 ? _b : 'Type your message', rows: 1, maxRows: 2, autoHeight: true, flexGrow: 1, onKeyDown: handleTextKeyPress, value: supportChatInputStore.formState.$.message.value, error: supportChatInputStore.formState.$.message.error, onChange: (e) => {
|
|
86
88
|
supportChatInputStore.formState.$.message.onChange(e.currentTarget.value);
|
|
87
89
|
}, onFocus: () => {
|
|
88
90
|
setTimeout(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input.js","sourceRoot":"","sources":["../../../src/components/chat/chat-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-input.js","sourceRoot":"","sources":["../../../src/components/chat/chat-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAKH,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AAEnD,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC,MAAM,CAAC,MAAM,SAAS,GAA+B,OAAO,CAAC;IACzD,UAAU,EAAE,CAAC,cAAc,CAAC;CAC/B,CAAC,CACE,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;;IACvB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CAAC;oBACN,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;wBACV,UAAU,CAAC,GAAG,EAAE;4BACZ,WAAW,CAAC,aAAa,EAAE,CAAC;wBAChC,CAAC,EAAE,CAAC,CAAC,CAAC;oBACV,CAAC,EACD,MAAM,EAAE,GAAG,EAAE;wBACT,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,+BAA+B,EAAE,CAAC;oBAChF,CAAC,EACD,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC,EACzD,QAAQ,EAAE,CAAC,WAAW,CAAC,SAAS,IAAI,SAAS,aACrC,kBAAkB,GAC5B,EACF,KAAC,MAAM,IACH,SAAS,EAAC,UAAU,EACpB,IAAI,EAAE,QAAQ,gBACH,iBAAiB,aACpB,iBAAiB,EACzB,IAAI,EAAC,QAAQ,EACb,UAAU,EAAC,SAAS,gBACT,QAAQ,EACnB,QAAQ,EACJ,CAAC,WAAW,CAAC,SAAS;wBACtB,SAAS;wBACT,qBAAqB,CAAC,SAAS,CAAC,QAAQ;wBACxC,qBAAqB,CAAC,OAAO,GAEnC,IACC,GACJ,CACV,CAAC;AACN,CAAC,CAAC,CACL,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useDependencies } from '@servicetitan/react-ioc';
|
|
3
|
-
import { CHAT_UI_STORE_TOKEN } from '@servicetitan/titan-chat-ui-common';
|
|
3
|
+
import { CHAT_UI_STORE_TOKEN, useCustomizationChat } from '@servicetitan/titan-chat-ui-common';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
5
|
import { MessageTyping } from '../messages/message-typing';
|
|
6
6
|
import { useAvatarProps } from '../messages/use-avatar-props';
|
|
7
7
|
export const ChatMessageTyping = observer(() => {
|
|
8
8
|
var _a, _b;
|
|
9
|
-
const
|
|
9
|
+
const customization = useCustomizationChat();
|
|
10
10
|
const [{ agent: { icon, name }, },] = useDependencies(CHAT_UI_STORE_TOKEN);
|
|
11
11
|
const avatar = useAvatarProps(name, icon);
|
|
12
|
-
const Component = (_b = (_a =
|
|
12
|
+
const Component = (_b = (_a = customization.messageTyping) === null || _a === void 0 ? void 0 : _a.component) !== null && _b !== void 0 ? _b : MessageTyping;
|
|
13
13
|
return _jsx(Component, { avatar: avatar });
|
|
14
14
|
});
|
|
15
15
|
//# sourceMappingURL=chat-message-typing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-typing.js","sourceRoot":"","sources":["../../../src/components/chat/chat-message-typing.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-message-typing.js","sourceRoot":"","sources":["../../../src/components/chat/chat-message-typing.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAO,QAAQ,CAAC,GAAG,EAAE;;IAC/C,MAAM,aAAa,GAAG,oBAAoB,EAAE,CAAC;IAC7C,MAAM,CACF,EACI,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GACxB,EACJ,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,MAAA,MAAA,aAAa,CAAC,aAAa,0CAAE,SAAS,mCAAI,aAAa,CAAC;IAE1E,OAAO,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,GAAI,CAAC;AACzC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message.d.ts","sourceRoot":"","sources":["../../../src/components/chat/chat-message.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-message.d.ts","sourceRoot":"","sources":["../../../src/components/chat/chat-message.tsx"],"names":[],"mappings":"AACA,OAAO,EAIH,iBAAiB,EAEpB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAMzD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,iBAAiB,CA8D7C,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from '@servicetitan/anvil2';
|
|
3
|
-
import {
|
|
4
|
-
import { CHAT_UI_STORE_TOKEN, } from '@servicetitan/titan-chat-ui-common';
|
|
3
|
+
import { useCustomizationChat, } from '@servicetitan/titan-chat-ui-common';
|
|
5
4
|
import { observer } from 'mobx-react';
|
|
6
5
|
import { MessageContentFile } from '../message-content/message-content-file';
|
|
7
6
|
import { MessageContentText } from '../message-content/message-content-text';
|
|
@@ -12,10 +11,9 @@ import { ChatMessageTemplateUser } from './chat-message-template-user';
|
|
|
12
11
|
* components and templates/customizations rendering
|
|
13
12
|
*/
|
|
14
13
|
export const ChatMessage = observer(({ message, omitAvatar, omitTimestamp }) => {
|
|
15
|
-
const
|
|
16
|
-
const isAgent = message.participant.isAgent;
|
|
17
|
-
const { messageTemplates, messages } = chatUiStore.customizations;
|
|
14
|
+
const { messageTemplates, messages } = useCustomizationChat();
|
|
18
15
|
const messageCustomization = messages === null || messages === void 0 ? void 0 : messages.find(c => c.predicate(message));
|
|
16
|
+
const isAgent = message.participant.isAgent;
|
|
19
17
|
const isSystem = Boolean(messageCustomization === null || messageCustomization === void 0 ? void 0 : messageCustomization.isSystem);
|
|
20
18
|
let messageContentNode;
|
|
21
19
|
if (messageCustomization === null || messageCustomization === void 0 ? void 0 : messageCustomization.component) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message.js","sourceRoot":"","sources":["../../../src/components/chat/chat-message.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"chat-message.js","sourceRoot":"","sources":["../../../src/components/chat/chat-message.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAKH,oBAAoB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAA0B,QAAQ,CACtD,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,EAAE;IACvC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAC9D,MAAM,oBAAoB,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACvE,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;IAC5C,MAAM,QAAQ,GAAG,OAAO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nC,CAAC;SAAM,CAAC;QACJ,MAAM,QAAQ,GAAG,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,IAAI,CAAC;QACxC,iBAAiB,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,SAAS,CAAC,OAAO,CAAC;YAC5C,CAAC,CAAC,QAAQ,CAAC,SAAS;YACpB,CAAC,CAAC,uBAAuB,CAAC;IAClC,CAAC;IACD,OAAO,CACH,KAAC,iBAAiB,IACd,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,YAE3B,kBAAkB,GACH,CACvB,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -12,7 +12,7 @@ import { ChatMessages } from './chat-messages';
|
|
|
12
12
|
import { ChatNotifications } from './chat-notifications';
|
|
13
13
|
import * as Styles from './chat.module.less';
|
|
14
14
|
export const Chat = observer(({ className, customizations }) => {
|
|
15
|
-
var _a
|
|
15
|
+
var _a;
|
|
16
16
|
const scrollRef = useRef(null);
|
|
17
17
|
const [chatUiStore] = useDependencies(CHAT_UI_STORE_TOKEN);
|
|
18
18
|
const footerComponent = customizations === null || customizations === void 0 ? void 0 : customizations.footerComponent;
|
|
@@ -30,6 +30,6 @@ export const Chat = observer(({ className, customizations }) => {
|
|
|
30
30
|
if (chatUiStore.isStarting) {
|
|
31
31
|
return (_jsx(Flex, { direction: "column", className: className, "data-cy": "titan-chat", children: loadingComponent !== null && loadingComponent !== void 0 ? loadingComponent : _jsx(ChatConnecting, { className: "p-inline-6 p-block-4" }) }));
|
|
32
32
|
}
|
|
33
|
-
return (_jsxs(Flex, { direction: "column", className: className, "data-cy": "titan-chat", children: [_jsx(Flex, { direction: "column", ref: scrollRef, grow: "1", className: classNames('p-inline-6 p-block-4', Styles.scrollContainer), children: _jsx(ChatMessages, { messages: chatUiStore.messages, showTypingIndicator: chatUiStore.isAgentTyping }) }), _jsx(ChatNotifications, {}), !((
|
|
33
|
+
return (_jsxs(Flex, { direction: "column", className: className, "data-cy": "titan-chat", children: [_jsx(Flex, { direction: "column", ref: scrollRef, grow: "1", className: classNames('p-inline-6 p-block-4', Styles.scrollContainer), children: _jsx(ChatMessages, { messages: chatUiStore.messages, showTypingIndicator: chatUiStore.isAgentTyping }) }), _jsx(ChatNotifications, {}), !((_a = customizations === null || customizations === void 0 ? void 0 : customizations.input) === null || _a === void 0 ? void 0 : _a.isDisabled) && (_jsxs(Flex, { className: "p-inline-6 p-block-4", direction: "column", gap: "4", children: [_jsx(ChatInputFile, { className: classNames('p-4 border-radius-small border-color-subdued', Styles.fileContainer) }), _jsx(ChatInput, {}), Boolean(footerComponent) && footerComponent] }))] }));
|
|
34
34
|
});
|
|
35
35
|
//# sourceMappingURL=chat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../src/components/chat/chat.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAsB,MAAM,oCAAoC,CAAC;AAC7F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAM,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAO7C,MAAM,CAAC,MAAM,IAAI,GAAmB,Q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AAC,SAAS,EAAC,QAAQ,EAAC,GAAG,EAAC,GAAG,aAC7D,KAAC,aAAa,IACV,SAAS,EAAE,UAAU,CACjB,8CAA8C,EAC9C,MAAM,CAAC,aAAa,CACvB,GACH,EACF,KAAC,SAAS,KAAG,EACZ,OAAO,CAAC,eAAe,CAAC,IAAI,eAAe,IACzC,CACV,IACE,CACV,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-avatar.d.ts","sourceRoot":"","sources":["../../../src/components/messages/message-avatar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,oCAAoC,CAAC;AAE1F,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,mBAAmB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"message-avatar.d.ts","sourceRoot":"","sources":["../../../src/components/messages/message-avatar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,oCAAoC,CAAC;AAE1F,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,mBAAmB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,mBAAmB,CA2BjD,CAAC"}
|
|
@@ -8,9 +8,11 @@ export const MessageAvatar = ({ className, icon, name }) => {
|
|
|
8
8
|
const isEmpty = icon === ChatParticipantIcon.Empty;
|
|
9
9
|
const isInitials = icon === ChatParticipantIcon.Initials;
|
|
10
10
|
const isBot = icon === ChatParticipantIcon.Bot;
|
|
11
|
+
const isAtlas = icon === ChatParticipantIcon.Atlas;
|
|
11
12
|
const nameInitials = useMemo(() => getNameInitials(name), [name]);
|
|
12
13
|
return (_jsx("div", { className: classNames('align-self-end', Styles.userIcon, {
|
|
13
14
|
[Styles.bot]: isBot,
|
|
15
|
+
[Styles.atlas]: isAtlas,
|
|
14
16
|
[Styles.system]: isEmpty,
|
|
15
17
|
}, className), "data-cy": "titan-chat-avatar", "data-cy2": `titan-chat-avatar-${icon}`, children: _jsx(Text, { variant: "body", inline: true, children: isInitials ? nameInitials : null }) }));
|
|
16
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-avatar.js","sourceRoot":"","sources":["../../../src/components/messages/message-avatar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AAQvD,MAAM,CAAC,MAAM,aAAa,GAA4B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;IAChF,MAAM,OAAO,GAAG,IAAI,KAAK,mBAAmB,CAAC,KAAK,CAAC;IACnD,MAAM,UAAU,GAAG,IAAI,KAAK,mBAAmB,CAAC,QAAQ,CAAC;IACzD,MAAM,KAAK,GAAG,IAAI,KAAK,mBAAmB,CAAC,GAAG,CAAC;IAC/C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAElE,OAAO,CACH,cACI,SAAS,EAAE,UAAU,CACjB,gBAAgB,EAChB,MAAM,CAAC,QAAQ,EACf;YACI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK;YACnB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO;SAC3B,EACD,SAAS,CACZ,aACO,mBAAmB,cACjB,qBAAqB,IAAI,EAAE,YAErC,KAAC,IAAI,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,kBACtB,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,GAC9B,GACL,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"message-avatar.js","sourceRoot":"","sources":["../../../src/components/messages/message-avatar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AAQvD,MAAM,CAAC,MAAM,aAAa,GAA4B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;IAChF,MAAM,OAAO,GAAG,IAAI,KAAK,mBAAmB,CAAC,KAAK,CAAC;IACnD,MAAM,UAAU,GAAG,IAAI,KAAK,mBAAmB,CAAC,QAAQ,CAAC;IACzD,MAAM,KAAK,GAAG,IAAI,KAAK,mBAAmB,CAAC,GAAG,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,KAAK,mBAAmB,CAAC,KAAK,CAAC;IACnD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAElE,OAAO,CACH,cACI,SAAS,EAAE,UAAU,CACjB,gBAAgB,EAChB,MAAM,CAAC,QAAQ,EACf;YACI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK;YACnB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO;YACvB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO;SAC3B,EACD,SAAS,CACZ,aACO,mBAAmB,cACjB,qBAAqB,IAAI,EAAE,YAErC,KAAC,IAAI,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,kBACtB,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,GAC9B,GACL,CACT,CAAC;AACN,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/titan-chat-ui-anvil2",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Chat experience UI package (Anvil2 version)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"push:local": "yalc push"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@servicetitan/titan-chat-ui-common": "^
|
|
20
|
+
"@servicetitan/titan-chat-ui-common": "^4.0.1",
|
|
21
21
|
"dompurify": "^3.2.6",
|
|
22
22
|
"lodash": "4.17.21",
|
|
23
23
|
"nanoid": "^5.1.5",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"react-dom": ">=18"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@servicetitan/cypress-shared": "^
|
|
42
|
-
"cypress": "^
|
|
41
|
+
"@servicetitan/cypress-shared": "^4.0.1",
|
|
42
|
+
"cypress": "^15.2.0"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"ServiceTitan"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"cli": {
|
|
52
52
|
"webpack": false
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "6c7d023e9833d328cd8537a95fc2740a9f09c046"
|
|
55
55
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_14694_37355)">
|
|
3
|
+
<path d="M2.76947 11.999V35.9984L23.9992 47.9981L45.2289 35.9984V11.999L23.9992 -0.000732422L2.76947 11.999Z" fill="url(#paint0_linear_14694_37355)"/>
|
|
4
|
+
<g style="mix-blend-mode:overlay">
|
|
5
|
+
<path d="M2.77045 35.999L11.8311 30.8767L2.77045 23.9993V35.999Z" fill="url(#paint1_linear_14694_37355)"/>
|
|
6
|
+
<path d="M45.2304 11.9993L36.1697 17.1215L45.2304 23.999V11.9993Z" fill="url(#paint2_linear_14694_37355)"/>
|
|
7
|
+
<path d="M23.9991 48.0002V37.7571L13.3842 42.001L23.9991 48.0002Z" fill="url(#paint3_linear_14694_37355)"/>
|
|
8
|
+
<path d="M23.9995 -0.000732422V10.2424L34.6144 5.99841L23.9995 -0.000732422Z" fill="url(#paint4_linear_14694_37355)"/>
|
|
9
|
+
<path d="M45.2311 36.0004L36.1705 30.8782L34.6162 42.001L45.2311 36.0004Z" fill="url(#paint5_linear_14694_37355)"/>
|
|
10
|
+
<path d="M2.77045 11.9998L11.8311 17.1221L13.3853 5.99927L2.77045 11.9998Z" fill="url(#paint6_linear_14694_37355)"/>
|
|
11
|
+
</g>
|
|
12
|
+
<g style="mix-blend-mode:overlay">
|
|
13
|
+
<path d="M2.77045 11.9993L11.8311 17.1215L2.77045 23.999V11.9993Z" fill="url(#paint7_linear_14694_37355)"/>
|
|
14
|
+
<path d="M45.2304 35.999L36.1697 30.8767L45.2304 23.9993V35.999Z" fill="url(#paint8_linear_14694_37355)"/>
|
|
15
|
+
<path d="M2.7702 36.0008L11.8308 30.8785L13.3851 42.0013L2.7702 36.0008Z" fill="url(#paint9_linear_14694_37355)"/>
|
|
16
|
+
<path d="M45.2311 11.9998L36.1705 17.1221L34.6162 5.99927L45.2311 11.9998Z" fill="url(#paint10_linear_14694_37355)"/>
|
|
17
|
+
<path d="M23.9995 48.0002V37.7571L34.6144 42.001L23.9995 48.0002Z" fill="url(#paint11_linear_14694_37355)"/>
|
|
18
|
+
<path d="M23.9988 -0.000732422V10.2424L13.384 5.99841L23.9988 -0.000732422Z" fill="url(#paint12_linear_14694_37355)"/>
|
|
19
|
+
</g>
|
|
20
|
+
<path opacity="0.66" d="M32.1114 10.2473H15.8869L7.7746 24.0036L15.8869 37.76H32.1114L40.2236 24.0036L32.1114 10.2473Z" fill="white"/>
|
|
21
|
+
<path d="M11.8309 17.1262V30.8811L24 37.76L36.1691 30.8811V17.1262L24 10.2473L11.8309 17.1262Z" fill="white"/>
|
|
22
|
+
<path d="M24.0009 13.3647L26.8825 21.1806L34.866 24.0004L26.8825 26.8216L24.0009 34.6375L21.1207 26.8216L13.1372 24.0004L21.1207 21.1806L24.0009 13.3647Z" fill="url(#paint13_linear_14694_37355)"/>
|
|
23
|
+
<path d="M13.1378 23.9995H24.0014V34.6352L21.1212 26.8192L13.1378 23.9995Z" fill="url(#paint14_linear_14694_37355)"/>
|
|
24
|
+
<path d="M34.8657 24.0004H24.0021V13.3647L26.8823 21.1807L34.8657 24.0004Z" fill="url(#paint15_linear_14694_37355)"/>
|
|
25
|
+
</g>
|
|
26
|
+
<defs>
|
|
27
|
+
<linearGradient id="paint0_linear_14694_37355" x1="2.76947" y1="23.9987" x2="45.2289" y2="23.9987" gradientUnits="userSpaceOnUse">
|
|
28
|
+
<stop stop-color="#2F6CDB"/>
|
|
29
|
+
<stop offset="1" stop-color="#55AAE7"/>
|
|
30
|
+
</linearGradient>
|
|
31
|
+
<linearGradient id="paint1_linear_14694_37355" x1="28.7112" y1="-6.03654" x2="-21.5772" y2="75.9966" gradientUnits="userSpaceOnUse">
|
|
32
|
+
<stop stop-color="#4357B5"/>
|
|
33
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
34
|
+
</linearGradient>
|
|
35
|
+
<linearGradient id="paint2_linear_14694_37355" x1="49.5433" y1="6.73372" x2="-0.746622" y2="88.7655" gradientUnits="userSpaceOnUse">
|
|
36
|
+
<stop stop-color="#4357B5"/>
|
|
37
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
38
|
+
</linearGradient>
|
|
39
|
+
<linearGradient id="paint3_linear_14694_37355" x1="44.9624" y1="3.92721" x2="-5.32747" y2="85.9604" gradientUnits="userSpaceOnUse">
|
|
40
|
+
<stop stop-color="#4357B5"/>
|
|
41
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
42
|
+
</linearGradient>
|
|
43
|
+
<linearGradient id="paint4_linear_14694_37355" x1="33.2914" y1="-3.23027" x2="-16.9986" y2="78.803" gradientUnits="userSpaceOnUse">
|
|
44
|
+
<stop stop-color="#4357B5"/>
|
|
45
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
46
|
+
</linearGradient>
|
|
47
|
+
<linearGradient id="paint5_linear_14694_37355" x1="55.461" y1="10.3619" x2="5.17111" y2="92.3951" gradientUnits="userSpaceOnUse">
|
|
48
|
+
<stop stop-color="#4357B5"/>
|
|
49
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
50
|
+
</linearGradient>
|
|
51
|
+
<linearGradient id="paint6_linear_14694_37355" x1="22.7942" y1="-9.66412" x2="-27.4942" y2="72.3691" gradientUnits="userSpaceOnUse">
|
|
52
|
+
<stop stop-color="#4357B5"/>
|
|
53
|
+
<stop offset="1" stop-color="#2E6BD3"/>
|
|
54
|
+
</linearGradient>
|
|
55
|
+
<linearGradient id="paint7_linear_14694_37355" x1="9.87142" y1="21.6635" x2="0.296576" y2="16.5084" gradientUnits="userSpaceOnUse">
|
|
56
|
+
<stop stop-color="#2E6BD3"/>
|
|
57
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
58
|
+
</linearGradient>
|
|
59
|
+
<linearGradient id="paint8_linear_14694_37355" x1="39.4934" y1="26.968" x2="47.6416" y2="31.4596" gradientUnits="userSpaceOnUse">
|
|
60
|
+
<stop stop-color="#2E6BD3"/>
|
|
61
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
62
|
+
</linearGradient>
|
|
63
|
+
<linearGradient id="paint9_linear_14694_37355" x1="15.835" y1="34.8603" x2="5.21554" y2="40.2831" gradientUnits="userSpaceOnUse">
|
|
64
|
+
<stop stop-color="#2E6BD3"/>
|
|
65
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
66
|
+
</linearGradient>
|
|
67
|
+
<linearGradient id="paint10_linear_14694_37355" x1="33.8435" y1="12.3838" x2="42.8968" y2="7.36418" gradientUnits="userSpaceOnUse">
|
|
68
|
+
<stop stop-color="#2E6BD3"/>
|
|
69
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
70
|
+
</linearGradient>
|
|
71
|
+
<linearGradient id="paint11_linear_14694_37355" x1="29.3062" y1="36.7828" x2="29.3062" y2="47.8354" gradientUnits="userSpaceOnUse">
|
|
72
|
+
<stop stop-color="#2E6BD3"/>
|
|
73
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
74
|
+
</linearGradient>
|
|
75
|
+
<linearGradient id="paint12_linear_14694_37355" x1="18.6907" y1="11.8027" x2="18.6907" y2="0.631132" gradientUnits="userSpaceOnUse">
|
|
76
|
+
<stop stop-color="#2E6BD3"/>
|
|
77
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
78
|
+
</linearGradient>
|
|
79
|
+
<linearGradient id="paint13_linear_14694_37355" x1="24.0009" y1="13.6083" x2="24.0009" y2="34.2593" gradientUnits="userSpaceOnUse">
|
|
80
|
+
<stop stop-color="#2E6BD3"/>
|
|
81
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
82
|
+
</linearGradient>
|
|
83
|
+
<linearGradient id="paint14_linear_14694_37355" x1="17.7244" y1="30.4929" x2="22.4066" y2="23.6925" gradientUnits="userSpaceOnUse">
|
|
84
|
+
<stop stop-color="#2E6BD3"/>
|
|
85
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
86
|
+
</linearGradient>
|
|
87
|
+
<linearGradient id="paint15_linear_14694_37355" x1="29.4346" y1="23.8385" x2="29.4346" y2="17.9239" gradientUnits="userSpaceOnUse">
|
|
88
|
+
<stop stop-color="#2E6BD3"/>
|
|
89
|
+
<stop offset="1" stop-color="#2F044D"/>
|
|
90
|
+
</linearGradient>
|
|
91
|
+
<clipPath id="clip0_14694_37355">
|
|
92
|
+
<rect width="48" height="48" fill="white"/>
|
|
93
|
+
</clipPath>
|
|
94
|
+
</defs>
|
|
95
|
+
</svg>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button, Flex, Textarea } from '@servicetitan/anvil2';
|
|
2
2
|
import IconSend from '@servicetitan/anvil2/assets/icons/material/round/send.svg';
|
|
3
3
|
import { provide, useDependencies } from '@servicetitan/react-ioc';
|
|
4
|
-
import { CHAT_UI_STORE_TOKEN } from '@servicetitan/titan-chat-ui-common';
|
|
4
|
+
import { CHAT_UI_STORE_TOKEN, useCustomizationChat } from '@servicetitan/titan-chat-ui-common';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { observer } from 'mobx-react';
|
|
7
7
|
import {
|
|
@@ -23,6 +23,7 @@ export const ChatInput: FC<{ className?: string }> = provide({
|
|
|
23
23
|
singletons: [ChatInputStore],
|
|
24
24
|
})(
|
|
25
25
|
observer(({ className }) => {
|
|
26
|
+
const customization = useCustomizationChat();
|
|
26
27
|
const typingTimeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
|
|
27
28
|
const [isSending, setIsSending] = useState(false);
|
|
28
29
|
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
|
@@ -115,7 +116,7 @@ export const ChatInput: FC<{ className?: string }> = provide({
|
|
|
115
116
|
<Textarea
|
|
116
117
|
ref={textareaRef}
|
|
117
118
|
name="question"
|
|
118
|
-
placeholder=
|
|
119
|
+
placeholder={customization.input?.placeholderText ?? 'Type your message'}
|
|
119
120
|
rows={1}
|
|
120
121
|
maxRows={2}
|
|
121
122
|
autoHeight
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { useDependencies } from '@servicetitan/react-ioc';
|
|
2
|
-
import { CHAT_UI_STORE_TOKEN } from '@servicetitan/titan-chat-ui-common';
|
|
2
|
+
import { CHAT_UI_STORE_TOKEN, useCustomizationChat } from '@servicetitan/titan-chat-ui-common';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { FC } from 'react';
|
|
5
5
|
import { MessageTyping } from '../messages/message-typing';
|
|
6
6
|
import { useAvatarProps } from '../messages/use-avatar-props';
|
|
7
7
|
|
|
8
8
|
export const ChatMessageTyping: FC = observer(() => {
|
|
9
|
-
const
|
|
9
|
+
const customization = useCustomizationChat();
|
|
10
10
|
const [
|
|
11
11
|
{
|
|
12
12
|
agent: { icon, name },
|
|
13
13
|
},
|
|
14
14
|
] = useDependencies(CHAT_UI_STORE_TOKEN);
|
|
15
15
|
const avatar = useAvatarProps(name, icon);
|
|
16
|
-
const Component =
|
|
16
|
+
const Component = customization.messageTyping?.component ?? MessageTyping;
|
|
17
17
|
|
|
18
18
|
return <Component avatar={avatar} />;
|
|
19
19
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Text } from '@servicetitan/anvil2';
|
|
2
|
-
import { useDependencies } from '@servicetitan/react-ioc';
|
|
3
2
|
import {
|
|
4
|
-
CHAT_UI_STORE_TOKEN,
|
|
5
3
|
ChatMessageModelFile,
|
|
6
4
|
ChatMessageModelText,
|
|
7
5
|
ChatMessageModelWelcome,
|
|
8
6
|
IChatMessageProps,
|
|
7
|
+
useCustomizationChat,
|
|
9
8
|
} from '@servicetitan/titan-chat-ui-common';
|
|
10
9
|
import { observer } from 'mobx-react';
|
|
11
10
|
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
@@ -20,10 +19,9 @@ import { ChatMessageTemplateUser } from './chat-message-template-user';
|
|
|
20
19
|
*/
|
|
21
20
|
export const ChatMessage: FC<IChatMessageProps> = observer(
|
|
22
21
|
({ message, omitAvatar, omitTimestamp }) => {
|
|
23
|
-
const
|
|
24
|
-
const isAgent = message.participant.isAgent;
|
|
25
|
-
const { messageTemplates, messages } = chatUiStore.customizations;
|
|
22
|
+
const { messageTemplates, messages } = useCustomizationChat();
|
|
26
23
|
const messageCustomization = messages?.find(c => c.predicate(message));
|
|
24
|
+
const isAgent = message.participant.isAgent;
|
|
27
25
|
const isSystem = Boolean(messageCustomization?.isSystem);
|
|
28
26
|
|
|
29
27
|
let messageContentNode: ReactNode | undefined;
|
|
@@ -56,7 +56,7 @@ export const Chat: FC<IChatProps> = observer(({ className, customizations }) =>
|
|
|
56
56
|
/>
|
|
57
57
|
</Flex>
|
|
58
58
|
<ChatNotifications />
|
|
59
|
-
{!
|
|
59
|
+
{!customizations?.input?.isDisabled && (
|
|
60
60
|
<Flex className="p-inline-6 p-block-4" direction="column" gap="4">
|
|
61
61
|
<ChatInputFile
|
|
62
62
|
className={classNames(
|
|
@@ -14,6 +14,7 @@ export const MessageAvatar: FC<IMessageAvatarProps> = ({ className, icon, name }
|
|
|
14
14
|
const isEmpty = icon === ChatParticipantIcon.Empty;
|
|
15
15
|
const isInitials = icon === ChatParticipantIcon.Initials;
|
|
16
16
|
const isBot = icon === ChatParticipantIcon.Bot;
|
|
17
|
+
const isAtlas = icon === ChatParticipantIcon.Atlas;
|
|
17
18
|
const nameInitials = useMemo(() => getNameInitials(name), [name]);
|
|
18
19
|
|
|
19
20
|
return (
|
|
@@ -23,6 +24,7 @@ export const MessageAvatar: FC<IMessageAvatarProps> = ({ className, icon, name }
|
|
|
23
24
|
Styles.userIcon,
|
|
24
25
|
{
|
|
25
26
|
[Styles.bot]: isBot,
|
|
27
|
+
[Styles.atlas]: isAtlas,
|
|
26
28
|
[Styles.system]: isEmpty,
|
|
27
29
|
},
|
|
28
30
|
className
|