@servicetitan/titan-chatbot-ui-anvil2 4.1.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/components/chatbot/feedback/chatbot-message-feedback-popover.d.ts.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-popover.js +2 -3
- package/dist/components/chatbot/feedback/chatbot-message-feedback-popover.js.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-popover.module.less +4 -0
- package/package.json +6 -6
- package/src/components/chatbot/feedback/chatbot-message-feedback-popover.module.less +4 -0
- package/src/components/chatbot/feedback/chatbot-message-feedback-popover.module.less.d.ts +1 -0
- package/src/components/chatbot/feedback/chatbot-message-feedback-popover.tsx +4 -4
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v4.2.0 (Tue Oct 07 2025)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- SPA-7396: Updated titan chatbot API contract. Changed Anvil2 feedback buttons. [#62](https://github.com/servicetitan/titan-chatbot-client/pull/62) ([@AlexYarmolchuk](https://github.com/AlexYarmolchuk))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Alexandr Yarmolchuk ([@AlexYarmolchuk](https://github.com/AlexYarmolchuk))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v4.0.1 (Fri Sep 19 2025)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-message-feedback-popover.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/feedback/chatbot-message-feedback-popover.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chatbot-message-feedback-popover.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/feedback/chatbot-message-feedback-popover.tsx"],"names":[],"mappings":"AAKA,OAAO,EAKH,MAAM,EAET,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,EAAE,EAAmD,MAAM,OAAO,CAAC;AAK5E,UAAU,4BAA4B;IAClC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,6BAA6B,EAAE,EAAE,CAAC,4BAA4B,CAuL1E,CAAC"}
|
|
@@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button, Flex, Icon, Link, Popover, Spinner, Text } from '@servicetitan/anvil2';
|
|
3
3
|
import IconCheck from '@servicetitan/anvil2/assets/icons/material/round/check.svg';
|
|
4
4
|
import IconError from '@servicetitan/anvil2/assets/icons/material/round/error.svg';
|
|
5
|
-
import
|
|
6
|
-
import IconThumbUp from '@servicetitan/anvil2/assets/icons/material/round/thumb_up.svg';
|
|
5
|
+
import IconThumbDownAlt from '@servicetitan/anvil2/assets/icons/material/round/thumb_down_off_alt.svg';
|
|
7
6
|
import { provide, useDependencies } from '@servicetitan/react-ioc';
|
|
8
7
|
import { CHATBOT_UI_STORE_TOKEN, MessageFeedbackGuardrailStore, MessageFeedbackStore, Models, useCustomizationChatbot, } from '@servicetitan/titan-chatbot-api';
|
|
9
8
|
import classNames from 'classnames';
|
|
@@ -57,6 +56,6 @@ export const ChatbotMessageFeedbackPopover = provide({
|
|
|
57
56
|
return (_jsxs(Flex, { direction: "row", gap: "2", alignItems: "center", className: classNames(className, Styles.feedback), "data-cy": "titan-chatbot-message-feedback-failed", children: [_jsx(Icon, { svg: IconError, className: "c-status-danger" }), _jsx(Text, { className: classNames('c-status-danger', Styles.feedbackResultText), children: "Failed to send feedback." })] }));
|
|
58
57
|
}
|
|
59
58
|
const SubmitButton = (_jsx(Button, { appearance: "primary", disabled: !feedbackStore.isValid, onClick: handleFeedbackSubmit, "data-cy": "titan-chatbot-message-feedback-submit", children: "Submit" }));
|
|
60
|
-
return (_jsxs(Flex, { direction: "row", gap: "2", alignItems: "center", className: className, children: [!isGuardrail && title && _jsx(Text, { variant: "eyebrow", children: title }), !isGuardrail && (_jsx(Button, { icon:
|
|
59
|
+
return (_jsxs(Flex, { direction: "row", gap: "2", alignItems: "center", className: className, children: [!isGuardrail && title && _jsx(Text, { variant: "eyebrow", children: title }), !isGuardrail && (_jsx(Button, { icon: IconThumbDownAlt, className: Styles.feedbackThumbUp, size: "small", appearance: "ghost", "aria-label": "thumb up", onClick: handleFeedbackThumbsUp, "data-cy": "titan-chatbot-message-feedback-thumbs-up" })), _jsx(Popover, { placement: "top-start", onOutsidePress: () => setIsPopoverOpen(false), open: isPopoverOpen, children: isGuardrail ? (_jsxs(Fragment, { children: [_jsx(Popover.Trigger, { children: props => (_jsx(Link, { ...props, onClick: () => setIsPopoverOpen(true), className: classNames('fs-paragraph-small', Styles.provideAnswer), color: "blue", "data-cy": "titan-chatbot-message-feedback-provide-answer", children: "Provide correct answer" })) }), _jsx(Popover.Content, { children: _jsxs(Flex, { direction: "column", children: [_jsx(Flex, { justifyContent: "space-between", alignItems: "center", children: _jsx(Text, { el: "h3", variant: "headline", size: "small", children: "Provide correct answer" }) }), _jsx(ChatbotMessageFeedbackFormGuardrail, {}), SubmitButton] }) })] })) : (_jsxs(Fragment, { children: [_jsx(Popover.Button, { icon: IconThumbDownAlt, size: "small", appearance: "ghost", onClick: () => setIsPopoverOpen(true), "aria-label": "thumb down", "data-cy": "titan-chatbot-message-feedback-thumbs-down" }), _jsx(Popover.Content, { children: _jsxs(Flex, { direction: "column", children: [_jsx(Flex, { justifyContent: "space-between", alignItems: "center", children: _jsx(Text, { el: "h3", variant: "headline", size: "small", children: "Why didn't this answer solve your problem?" }) }), _jsx(ChatbotMessageFeedbackForm, {}), SubmitButton] }) })] })) })] }));
|
|
61
60
|
}));
|
|
62
61
|
//# sourceMappingURL=chatbot-message-feedback-popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-message-feedback-popover.js","sourceRoot":"","sources":["../../../../src/components/chatbot/feedback/chatbot-message-feedback-popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,SAAS,MAAM,4DAA4D,CAAC;AACnF,OAAO,SAAS,MAAM,4DAA4D,CAAC;AACnF,OAAO,
|
|
1
|
+
{"version":3,"file":"chatbot-message-feedback-popover.js","sourceRoot":"","sources":["../../../../src/components/chatbot/feedback/chatbot-message-feedback-popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,SAAS,MAAM,4DAA4D,CAAC;AACnF,OAAO,SAAS,MAAM,4DAA4D,CAAC;AACnF,OAAO,gBAAgB,MAAM,yEAAyE,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EACH,sBAAsB,EAEtB,6BAA6B,EAC7B,oBAAoB,EACpB,MAAM,EACN,uBAAuB,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAM,QAAQ,EAAkB,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,mCAAmC,EAAE,MAAM,2CAA2C,CAAC;AAChG,OAAO,KAAK,MAAM,MAAM,gDAAgD,CAAC;AAOz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,CAAC,CACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/titan-chatbot-ui-anvil2",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Chatbot experience UI package (Anvil2 version)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"push:local": "yalc push"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@servicetitan/titan-chat-ui-anvil2": "^4.
|
|
21
|
-
"@servicetitan/titan-chat-ui-common": "^4.
|
|
22
|
-
"@servicetitan/titan-chatbot-api": "^4.
|
|
20
|
+
"@servicetitan/titan-chat-ui-anvil2": "^4.2.0",
|
|
21
|
+
"@servicetitan/titan-chat-ui-common": "^4.2.0",
|
|
22
|
+
"@servicetitan/titan-chatbot-api": "^4.2.0",
|
|
23
23
|
"nanoid": "^5.1.5"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-dom": ">=18"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@servicetitan/cypress-shared": "^4.
|
|
39
|
+
"@servicetitan/cypress-shared": "^4.2.0",
|
|
40
40
|
"cypress": "^15.2.0"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"cli": {
|
|
50
50
|
"webpack": false
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "165f0a686b7a040223f6a0928b10d1d8cf6033e6"
|
|
53
53
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Button, Flex, Icon, Link, Popover, Spinner, Text } from '@servicetitan/anvil2';
|
|
2
2
|
import IconCheck from '@servicetitan/anvil2/assets/icons/material/round/check.svg';
|
|
3
3
|
import IconError from '@servicetitan/anvil2/assets/icons/material/round/error.svg';
|
|
4
|
-
import
|
|
5
|
-
import IconThumbUp from '@servicetitan/anvil2/assets/icons/material/round/thumb_up.svg';
|
|
4
|
+
import IconThumbDownAlt from '@servicetitan/anvil2/assets/icons/material/round/thumb_down_off_alt.svg';
|
|
6
5
|
import { provide, useDependencies } from '@servicetitan/react-ioc';
|
|
7
6
|
import {
|
|
8
7
|
CHATBOT_UI_STORE_TOKEN,
|
|
@@ -136,7 +135,8 @@ export const ChatbotMessageFeedbackPopover: FC<IChatbotMessageFeedbackProps> = p
|
|
|
136
135
|
{!isGuardrail && title && <Text variant="eyebrow">{title}</Text>}
|
|
137
136
|
{!isGuardrail && (
|
|
138
137
|
<Button
|
|
139
|
-
icon={
|
|
138
|
+
icon={IconThumbDownAlt}
|
|
139
|
+
className={Styles.feedbackThumbUp}
|
|
140
140
|
size="small"
|
|
141
141
|
appearance="ghost"
|
|
142
142
|
aria-label="thumb up"
|
|
@@ -182,7 +182,7 @@ export const ChatbotMessageFeedbackPopover: FC<IChatbotMessageFeedbackProps> = p
|
|
|
182
182
|
) : (
|
|
183
183
|
<Fragment>
|
|
184
184
|
<Popover.Button
|
|
185
|
-
icon={
|
|
185
|
+
icon={IconThumbDownAlt}
|
|
186
186
|
size="small"
|
|
187
187
|
appearance="ghost"
|
|
188
188
|
onClick={() => setIsPopoverOpen(true)}
|