@servicetitan/titan-chatbot-ui 3.1.3 → 3.1.5
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/messages/chatbot-links.d.ts.map +1 -1
- package/dist/components/chatbot/messages/chatbot-links.js +4 -1
- package/dist/components/chatbot/messages/chatbot-links.js.map +1 -1
- package/package.json +6 -6
- package/src/components/chatbot/messages/chatbot-links.tsx +6 -4
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v3.1.4 (Fri Aug 22 2025)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- SPA-7126: Small link props improvement [#47](https://github.com/servicetitan/titan-chatbot-client/pull/47) ([@AlexYarmolchuk](https://github.com/AlexYarmolchuk))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Alexandr Yarmolchuk ([@AlexYarmolchuk](https://github.com/AlexYarmolchuk))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v3.1.3 (Fri Aug 22 2025)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-links.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/messages/chatbot-links.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"chatbot-links.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/messages/chatbot-links.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEzD,OAAO,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAG5D,UAAU,cAAc;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACL;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,cAAc,CA4D3C,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { BodyText, Collapsible, Icon, Link, Stack } from '@servicetitan/design-system';
|
|
3
|
+
import classNames from 'classnames';
|
|
3
4
|
import { Fragment, useCallback, useState } from 'react';
|
|
4
5
|
import * as Styles from './chatbot-links.module.less';
|
|
5
6
|
export const ChatbotLinks = ({ linkProps, links, onToggle, seeLessLabel, seeMoreLabel, }) => {
|
|
6
7
|
const [linksCollapsed, setLinksCollapsed] = useState(true);
|
|
8
|
+
const className = linkProps === null || linkProps === void 0 ? void 0 : linkProps.className;
|
|
9
|
+
const primary = Boolean(linkProps === null || linkProps === void 0 ? void 0 : linkProps.primary);
|
|
7
10
|
const handleToggleCollapsible = useCallback(() => {
|
|
8
11
|
setLinksCollapsed(!linksCollapsed);
|
|
9
12
|
setTimeout(() => {
|
|
@@ -15,7 +18,7 @@ export const ChatbotLinks = ({ linkProps, links, onToggle, seeLessLabel, seeMore
|
|
|
15
18
|
}
|
|
16
19
|
return (_jsxs(Fragment, { children: [_jsx(Link, { className: "m-t-2", onClick: handleToggleCollapsible, "data-cy": "titan-chatbot-links-more", "data-pendo": "titan-chatbot-links-more", children: _jsxs(Stack, { direction: "row", alignItems: "center", children: [_jsx(BodyText, { el: "div", children: linksCollapsed ? seeMoreLabel : seeLessLabel }), _jsx(Icon, { className: "m-l-half", name: linksCollapsed ? 'keyboard_arrow_down' : 'keyboard_arrow_up' })] }) }), _jsx(Collapsible, { animate: true, open: !linksCollapsed, "data-cy": "titan-chatbot-links-collapsible", children: _jsx("ul", { className: Styles.messageLinkList, children: links.map(u => {
|
|
17
20
|
var _a, _b;
|
|
18
|
-
return (_jsx("li", { children: _jsx(BodyText, { el: "span", children: _jsx(Link, { href: u.url, target: "_blank", className: Styles.messageLink,
|
|
21
|
+
return (_jsx("li", { children: _jsx(BodyText, { el: "span", children: _jsx(Link, { href: u.url, target: "_blank", className: classNames(Styles.messageLink, className), primary: primary, title: (_a = u.title) !== null && _a !== void 0 ? _a : u.url, "data-cy": "titan-chatbot-links-link", "data-pendo": "titan-chatbot-links-link-secondary", children: (_b = u.title) !== null && _b !== void 0 ? _b : u.url }) }) }, u.url));
|
|
19
22
|
}) }) })] }));
|
|
20
23
|
};
|
|
21
24
|
//# sourceMappingURL=chatbot-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-links.js","sourceRoot":"","sources":["../../../../src/components/chatbot/messages/chatbot-links.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEvF,OAAO,EAAM,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAatD,MAAM,CAAC,MAAM,YAAY,GAAuB,CAAC,EAC7C,SAAS,EACT,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,GACf,EAAE,EAAE;IACD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"chatbot-links.js","sourceRoot":"","sources":["../../../../src/components/chatbot/messages/chatbot-links.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,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,EAC5E,KAAC,IAAI,IACD,SAAS,EAAC,UAAU,EACpB,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,GACpE,IACE,GACL,EACP,KAAC,WAAW,IAAC,OAAO,QAAC,IAAI,EAAE,CAAC,cAAc,aAAU,iCAAiC,YACjF,aAAI,SAAS,EAAE,MAAM,CAAC,eAAe,YAChC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;wBAAC,OAAA,CACZ,uBACI,KAAC,QAAQ,IAAC,EAAE,EAAC,MAAM,YACf,KAAC,IAAI,IACD,IAAI,EAAE,CAAC,CAAC,GAAG,EACX,MAAM,EAAC,QAAQ,EACf,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,EACpD,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAA,CAAC,CAAC,KAAK,mCAAI,CAAC,CAAC,GAAG,aACf,0BAA0B,gBACvB,oCAAoC,YAE9C,MAAA,CAAC,CAAC,KAAK,mCAAI,CAAC,CAAC,GAAG,GACd,GACA,IAbN,CAAC,CAAC,GAAG,CAcT,CACR,CAAA;qBAAA,CAAC,GACD,GACK,IACP,CACd,CAAC;AACN,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/titan-chatbot-ui",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "Chatbot experience UI package",
|
|
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": "^3.1.
|
|
21
|
-
"@servicetitan/titan-chat-ui-common": "^3.1.
|
|
22
|
-
"@servicetitan/titan-chatbot-api": "^3.1.
|
|
20
|
+
"@servicetitan/titan-chat-ui": "^3.1.5",
|
|
21
|
+
"@servicetitan/titan-chat-ui-common": "^3.1.5",
|
|
22
|
+
"@servicetitan/titan-chatbot-api": "^3.1.5",
|
|
23
23
|
"nanoid": "^5.1.5"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react-dom": ">=18"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@servicetitan/cypress-shared": "^3.1.
|
|
43
|
+
"@servicetitan/cypress-shared": "^3.1.5",
|
|
44
44
|
"cypress": "^14.3.2"
|
|
45
45
|
},
|
|
46
46
|
"keywords": [
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"cli": {
|
|
54
54
|
"webpack": false
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "d505add9e192f5d8260f14e15eee7460980e869b"
|
|
57
57
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BodyText, Collapsible, Icon, Link, Stack } from '@servicetitan/design-system';
|
|
2
2
|
import { Models } from '@servicetitan/titan-chatbot-api';
|
|
3
|
+
import classNames from 'classnames';
|
|
3
4
|
import { FC, Fragment, useCallback, useState } from 'react';
|
|
4
5
|
import * as Styles from './chatbot-links.module.less';
|
|
5
6
|
|
|
@@ -22,6 +23,8 @@ export const ChatbotLinks: FC<ChatLinksProps> = ({
|
|
|
22
23
|
seeMoreLabel,
|
|
23
24
|
}) => {
|
|
24
25
|
const [linksCollapsed, setLinksCollapsed] = useState(true);
|
|
26
|
+
const className = linkProps?.className;
|
|
27
|
+
const primary = Boolean(linkProps?.primary);
|
|
25
28
|
|
|
26
29
|
const handleToggleCollapsible = useCallback(() => {
|
|
27
30
|
setLinksCollapsed(!linksCollapsed);
|
|
@@ -57,12 +60,11 @@ export const ChatbotLinks: FC<ChatLinksProps> = ({
|
|
|
57
60
|
<Link
|
|
58
61
|
href={u.url}
|
|
59
62
|
target="_blank"
|
|
60
|
-
className={Styles.messageLink}
|
|
61
|
-
primary
|
|
63
|
+
className={classNames(Styles.messageLink, className)}
|
|
64
|
+
primary={primary}
|
|
65
|
+
title={u.title ?? u.url}
|
|
62
66
|
data-cy="titan-chatbot-links-link"
|
|
63
67
|
data-pendo="titan-chatbot-links-link-secondary"
|
|
64
|
-
title={u.title ?? u.url}
|
|
65
|
-
{...linkProps}
|
|
66
68
|
>
|
|
67
69
|
{u.title ?? u.url}
|
|
68
70
|
</Link>
|