@servicetitan/titan-chatbot-ui-anvil2 3.1.3 → 3.1.4
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,EAAyB,MAAM,OAAO,CAAC;AAGlD,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,CAyD3C,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Details, Link, Text } from '@servicetitan/anvil2';
|
|
3
|
+
import classNames from 'classnames';
|
|
3
4
|
import { 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(Details, { className: Styles.details, children: [_jsx(Details.Summary, { children: _jsx(Link, { appearance: "secondary", className: "m-inline-start-2", onClick: handleToggleCollapsible, "data-cy": "titan-chatbot-links-more", "data-pendo": "titan-chatbot-links-more", children: linksCollapsed ? seeMoreLabel : seeLessLabel }) }), _jsx(Details.Content, { "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(Text, { children: _jsx(Link, { href: u.url, target: "_blank", className: Styles.messageLink, primary:
|
|
21
|
+
return (_jsx("li", { children: _jsx(Text, { children: _jsx(Link, { href: u.url, target: "_blank", className: classNames(Styles.messageLink, className), title: (_a = u.title) !== null && _a !== void 0 ? _a : u.url, appearance: primary ? 'primary' : undefined, "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,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAM,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,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,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAM,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC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AAC,CAAC,GAAG,EACX,MAAM,EAAC,QAAQ,EACf,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,EACpD,KAAK,EAAE,MAAA,CAAC,CAAC,KAAK,mCAAI,CAAC,CAAC,GAAG,EACvB,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,aACnC,0BAA0B,gBACvB,oCAAoC,YAE9C,MAAA,CAAC,CAAC,KAAK,mCAAI,CAAC,CAAC,GAAG,GACd,GACJ,IAbF,CAAC,CAAC,GAAG,CAcT,CACR,CAAA;qBAAA,CAAC,GACD,GACS,IACZ,CACb,CAAC;AACN,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/titan-chatbot-ui-anvil2",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
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": "^3.1.
|
|
21
|
-
"@servicetitan/titan-chat-ui-common": "^3.1.
|
|
22
|
-
"@servicetitan/titan-chatbot-api": "^3.1.
|
|
20
|
+
"@servicetitan/titan-chat-ui-anvil2": "^3.1.4",
|
|
21
|
+
"@servicetitan/titan-chat-ui-common": "^3.1.4",
|
|
22
|
+
"@servicetitan/titan-chatbot-api": "^3.1.4",
|
|
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": "^3.1.
|
|
39
|
+
"@servicetitan/cypress-shared": "^3.1.4",
|
|
40
40
|
"cypress": "^14.3.2"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"cli": {
|
|
50
50
|
"webpack": false
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "35fca60717ca9d384fe20fd319471a9d728db23d"
|
|
53
53
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Details, Link, Text } from '@servicetitan/anvil2';
|
|
2
2
|
import { Models } from '@servicetitan/titan-chatbot-api';
|
|
3
|
+
import classNames from 'classnames';
|
|
3
4
|
import { FC, 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);
|
|
@@ -54,12 +57,11 @@ export const ChatbotLinks: FC<ChatLinksProps> = ({
|
|
|
54
57
|
<Link
|
|
55
58
|
href={u.url}
|
|
56
59
|
target="_blank"
|
|
57
|
-
className={Styles.messageLink}
|
|
58
|
-
|
|
60
|
+
className={classNames(Styles.messageLink, className)}
|
|
61
|
+
title={u.title ?? u.url}
|
|
62
|
+
appearance={primary ? 'primary' : undefined}
|
|
59
63
|
data-cy="titan-chatbot-links-link"
|
|
60
64
|
data-pendo="titan-chatbot-links-link-secondary"
|
|
61
|
-
title={u.title ?? u.url}
|
|
62
|
-
{...linkProps}
|
|
63
65
|
>
|
|
64
66
|
{u.title ?? u.url}
|
|
65
67
|
</Link>
|