ai-design-system 0.1.41 → 0.1.42
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/components/blocks/AIConversation/AIConversation.tsx +12 -2
- package/components/composites/FilePreviewDialog/FilePreviewDialog.tsx +15 -10
- package/dist/index.cjs +31 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +44 -44
- package/dist/index.js +31 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
|
@@ -6,12 +6,11 @@ import {
|
|
|
6
6
|
ConversationScrollButton,
|
|
7
7
|
type ConversationProps,
|
|
8
8
|
} from "@/components/ai-elements/conversation"
|
|
9
|
-
import {
|
|
9
|
+
import type { ToolCall, SubAgent } from "@/components/composites"
|
|
10
10
|
import { UserMessage } from "@/components/composites/UserMessage"
|
|
11
11
|
import { SpecialistMessage } from "@/components/composites/SpecialistMessage"
|
|
12
12
|
import { OrchestratorMessage } from "@/components/composites/OrchestratorMessage"
|
|
13
13
|
import { ToolCallDisplay } from "@/components/composites/ToolCallDisplay"
|
|
14
|
-
import type { SubAgent } from "@/components/composites/AgentIndicator"
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* AIConversation Section
|
|
@@ -23,6 +22,17 @@ import type { SubAgent } from "@/components/composites/AgentIndicator"
|
|
|
23
22
|
* Based on reference implementation from deep-agents-ui ChatInterface.
|
|
24
23
|
*/
|
|
25
24
|
|
|
25
|
+
interface AIMessage {
|
|
26
|
+
id: string;
|
|
27
|
+
type: 'human' | 'ai';
|
|
28
|
+
role: string;
|
|
29
|
+
content: string;
|
|
30
|
+
avatarSrc?: string;
|
|
31
|
+
avatarName?: string;
|
|
32
|
+
toolCalls?: ToolCall[];
|
|
33
|
+
subAgents?: SubAgent[];
|
|
34
|
+
}
|
|
35
|
+
|
|
26
36
|
export interface AIConversationProps
|
|
27
37
|
extends Omit<ConversationProps, "children"> {
|
|
28
38
|
/**
|
|
@@ -13,6 +13,7 @@ interface ChecklistItem {
|
|
|
13
13
|
id: string;
|
|
14
14
|
label: string;
|
|
15
15
|
checked: boolean;
|
|
16
|
+
isTask: boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
function parseChecklistItems(content?: string) {
|
|
@@ -50,6 +51,7 @@ function parseChecklistItems(content?: string) {
|
|
|
50
51
|
id: `checklist-${index}`,
|
|
51
52
|
label: taskMatch[2],
|
|
52
53
|
checked: taskMatch[1].toLowerCase() === "x",
|
|
54
|
+
isTask: true,
|
|
53
55
|
});
|
|
54
56
|
return items;
|
|
55
57
|
}
|
|
@@ -61,6 +63,7 @@ function parseChecklistItems(content?: string) {
|
|
|
61
63
|
id: `checklist-${index}`,
|
|
62
64
|
label: numberStripped,
|
|
63
65
|
checked: false,
|
|
66
|
+
isTask: false,
|
|
64
67
|
});
|
|
65
68
|
|
|
66
69
|
return items;
|
|
@@ -121,16 +124,18 @@ export const FilePreviewDialog = React.memo<FilePreviewDialogProps>(
|
|
|
121
124
|
key={item.id}
|
|
122
125
|
className="flex items-start gap-3 rounded-md px-1 py-1 text-sm leading-6"
|
|
123
126
|
>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
{item.isTask && (
|
|
128
|
+
<Checkbox
|
|
129
|
+
checked={checkedItems[item.id] ?? false}
|
|
130
|
+
onCheckedChange={(checked) => {
|
|
131
|
+
setCheckedItems((prev) => ({
|
|
132
|
+
...prev,
|
|
133
|
+
[item.id]: checked === true,
|
|
134
|
+
}));
|
|
135
|
+
}}
|
|
136
|
+
className="mt-1"
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
134
139
|
<span>{item.label}</span>
|
|
135
140
|
</label>
|
|
136
141
|
))}
|
package/dist/index.cjs
CHANGED
|
@@ -1010,6 +1010,32 @@ var defaultIcons = {
|
|
|
1010
1010
|
name: "server",
|
|
1011
1011
|
viewBox: "0 0 24 24",
|
|
1012
1012
|
path: "M20 8V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2M4 18v2a2 2 0 002 2h12a2 2 0 002-2v-2M4 12h16M4 12v2a2 2 0 002 2h12a2 2 0 002-2v-2M8 6h.01M16 6h.01M8 18h.01M16 18h.01"
|
|
1013
|
+
},
|
|
1014
|
+
// Plugin specific icons
|
|
1015
|
+
"bot": {
|
|
1016
|
+
name: "bot",
|
|
1017
|
+
viewBox: "0 0 24 24",
|
|
1018
|
+
path: "M12 8V4H8 M2 14h2 M20 14h2 M15 13v2 M9 13v2 M4 8h16v12H4z"
|
|
1019
|
+
},
|
|
1020
|
+
"github": {
|
|
1021
|
+
name: "github",
|
|
1022
|
+
viewBox: "0 0 24 24",
|
|
1023
|
+
path: "M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 00-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0020 4.77 5.07 5.07 0 0019.91 1S18.73.65 16 2.48a13.38 13.38 0 00-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 005 4.77a5.44 5.44 0 00-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 009 18.13V22"
|
|
1024
|
+
},
|
|
1025
|
+
"credit-card": {
|
|
1026
|
+
name: "credit-card",
|
|
1027
|
+
viewBox: "0 0 24 24",
|
|
1028
|
+
path: "M21 4H3a2 2 0 00-2 2v12a2 2 0 002 2h18a2 2 0 002-2V6a2 2 0 00-2-2zM1 10h22"
|
|
1029
|
+
},
|
|
1030
|
+
"video": {
|
|
1031
|
+
name: "video",
|
|
1032
|
+
viewBox: "0 0 24 24",
|
|
1033
|
+
path: "M23 7l-7 5 7 5V7z M1 5h15v14H1z"
|
|
1034
|
+
},
|
|
1035
|
+
"globe": {
|
|
1036
|
+
name: "globe",
|
|
1037
|
+
viewBox: "0 0 24 24",
|
|
1038
|
+
path: "M12 22a10 10 0 100-20 10 10 0 000 20z M2 12h20 M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"
|
|
1013
1039
|
}
|
|
1014
1040
|
};
|
|
1015
1041
|
var IconRegistry = class {
|
|
@@ -4583,7 +4609,8 @@ function parseChecklistItems(content) {
|
|
|
4583
4609
|
items.push({
|
|
4584
4610
|
id: `checklist-${index}`,
|
|
4585
4611
|
label: taskMatch[2],
|
|
4586
|
-
checked: taskMatch[1].toLowerCase() === "x"
|
|
4612
|
+
checked: taskMatch[1].toLowerCase() === "x",
|
|
4613
|
+
isTask: true
|
|
4587
4614
|
});
|
|
4588
4615
|
return items;
|
|
4589
4616
|
}
|
|
@@ -4592,7 +4619,8 @@ function parseChecklistItems(content) {
|
|
|
4592
4619
|
items.push({
|
|
4593
4620
|
id: `checklist-${index}`,
|
|
4594
4621
|
label: numberStripped,
|
|
4595
|
-
checked: false
|
|
4622
|
+
checked: false,
|
|
4623
|
+
isTask: false
|
|
4596
4624
|
});
|
|
4597
4625
|
return items;
|
|
4598
4626
|
}, []);
|
|
@@ -4635,7 +4663,7 @@ var FilePreviewDialog = React3__namespace.memo(
|
|
|
4635
4663
|
{
|
|
4636
4664
|
className: "flex items-start gap-3 rounded-md px-1 py-1 text-sm leading-6",
|
|
4637
4665
|
children: [
|
|
4638
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4666
|
+
item.isTask && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4639
4667
|
Checkbox2,
|
|
4640
4668
|
{
|
|
4641
4669
|
checked: (_a = checkedItems[item.id]) != null ? _a : false,
|