@harnessio/ui3-ai-chat 0.2.0 → 0.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-chat-welcome.d.ts","sourceRoot":"","sources":["../src/default-chat-welcome.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-chat-welcome.d.ts","sourceRoot":"","sources":["../src/default-chat-welcome.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AASjD,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,OAAiB,EAAE,EAAE,uBAAuB,2CA+DhF"}
|
|
@@ -2,10 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCurrentThread, useQuickActions } from '@harnessio/ai-chat-core';
|
|
3
3
|
import { Button, IconV2, Layout, Text } from '@harnessio/ui/components';
|
|
4
4
|
import { cn } from '@harnessio/ui/utils';
|
|
5
|
-
import { useStrings } from '@harnessio/ui3-i18n';
|
|
6
5
|
import { TruncatedChipLabel } from './truncated-chip-label';
|
|
7
6
|
export function DefaultChatWelcome({ variant = 'panel' }) {
|
|
8
|
-
const { getString } = useStrings();
|
|
9
7
|
const thread = useCurrentThread();
|
|
10
8
|
const registeredActions = useQuickActions();
|
|
11
9
|
const isHomepage = variant === 'homepage';
|
|
@@ -13,25 +11,25 @@ export function DefaultChatWelcome({ variant = 'panel' }) {
|
|
|
13
11
|
{
|
|
14
12
|
id: 'list-pipelines',
|
|
15
13
|
icon: 'pipeline',
|
|
16
|
-
label:
|
|
14
|
+
label: 'List pipelines',
|
|
17
15
|
prompt: 'List pipelines'
|
|
18
16
|
},
|
|
19
17
|
{
|
|
20
18
|
id: 'support-question',
|
|
21
19
|
icon: 'help-circle',
|
|
22
|
-
label:
|
|
20
|
+
label: 'Ask a support question',
|
|
23
21
|
prompt: 'Ask a support question'
|
|
24
22
|
},
|
|
25
23
|
{
|
|
26
24
|
id: 'analyze-errors',
|
|
27
25
|
icon: 'pipeline',
|
|
28
|
-
label:
|
|
29
|
-
prompt:
|
|
26
|
+
label: 'Analyze pipeline errors',
|
|
27
|
+
prompt: 'Analyze pipeline errors'
|
|
30
28
|
}
|
|
31
29
|
];
|
|
32
30
|
const actions = registeredActions.length > 0 ? registeredActions : defaultQuickActions;
|
|
33
31
|
const handleQuickAction = (prompt) => {
|
|
34
32
|
thread.send(prompt);
|
|
35
33
|
};
|
|
36
|
-
return (_jsxs(Layout.Vertical, { align: "center", justify: isHomepage ? undefined : 'end', gap: "xl", className: isHomepage ? 'w-full' : 'h-full', children: [_jsxs(Layout.Horizontal, { align: "center", gap: "xs", className: isHomepage ? undefined : 'h-full', children: [_jsx(IconV2, { size: "lg", name: "harness-plugins", className: "text-cn-logo-icon" }), _jsx(Text, { variant: "heading-subsection", color: "foreground-2", children:
|
|
34
|
+
return (_jsxs(Layout.Vertical, { align: "center", justify: isHomepage ? undefined : 'end', gap: "xl", className: isHomepage ? 'w-full' : 'h-full', children: [_jsxs(Layout.Horizontal, { align: "center", gap: "xs", className: isHomepage ? undefined : 'h-full', children: [_jsx(IconV2, { size: "lg", name: "harness-plugins", className: "text-cn-logo-icon" }), _jsx(Text, { variant: "heading-subsection", color: "foreground-2", children: "How can I help you today?" })] }), _jsx(Layout.Vertical, { className: "w-full", children: _jsx("div", { className: cn('mb-cn-sm flex w-full gap-cn-sm', isHomepage ? 'flex-row justify-center' : 'flex-col'), children: actions.map(action => (_jsx(Button, { variant: "outline", className: "w-fit min-w-0 max-w-full justify-start overflow-hidden rounded-cn-4", onClick: () => handleQuickAction(action.prompt), children: _jsxs(Layout.Horizontal, { align: "center", gap: "2xs", className: "w-full min-w-0", children: [_jsx(IconV2, { name: action.icon, className: "shrink-0" }), _jsx(TruncatedChipLabel, { children: action.label })] }) }, action.id))) }) })] }));
|
|
37
35
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harnessio/ui3-ai-chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -22,24 +22,22 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@harnessio/ai-chat-core": "0.0.27",
|
|
25
|
-
"@harnessio/ui": "1.6.
|
|
25
|
+
"@harnessio/ui": "1.6.13",
|
|
26
26
|
"@tanstack/react-table": "8.21.3",
|
|
27
27
|
"@testing-library/jest-dom": "6.6.3",
|
|
28
28
|
"@testing-library/react": "12.1.5",
|
|
29
29
|
"@testing-library/react-hooks": "^8.0.1",
|
|
30
30
|
"@testing-library/user-event": "^14.6.1",
|
|
31
31
|
"@types/react": "^17.0.3",
|
|
32
|
+
"@vitest/coverage-v8": "3.2.7",
|
|
32
33
|
"jsdom": "26.1.0",
|
|
33
34
|
"typescript": "npm:@typescript/typescript6@^6.0.0",
|
|
34
35
|
"typescript-7": "npm:typescript@^7.0.0",
|
|
35
|
-
"vitest": "^3.2.4"
|
|
36
|
-
"@vitest/coverage-v8": "3.2.7",
|
|
37
|
-
"@harnessio/ui3-i18n": "0.0.0"
|
|
36
|
+
"vitest": "^3.2.4"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|
|
40
39
|
"@harnessio/ai-chat-core": ">=0.0.27",
|
|
41
40
|
"@harnessio/ui": "^1.1.2",
|
|
42
|
-
"@harnessio/ui3-i18n": "*",
|
|
43
41
|
"@tanstack/react-table": "^8.21.3"
|
|
44
42
|
},
|
|
45
43
|
"scripts": {
|