ai-design-system 0.1.40 → 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/blocks/WorkflowCanvas/WorkflowCanvas.tsx +3 -3
- package/components/composites/FilePreviewDialog/FilePreviewDialog.tsx +15 -10
- package/components/composites/FileQueue/FileQueue.tsx +5 -1
- package/components/composites/FileQueue/interfaces.ts +2 -0
- package/dist/index.cjs +42 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.js +42 -7
- 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
|
/**
|
|
@@ -97,7 +97,7 @@ function WorkflowCanvasInner({
|
|
|
97
97
|
connectionMode={ConnectionMode.Strict}
|
|
98
98
|
edges={edges}
|
|
99
99
|
edgeTypes={edgeTypes}
|
|
100
|
-
elementsSelectable={
|
|
100
|
+
elementsSelectable={true}
|
|
101
101
|
isValidConnection={isValidConnection}
|
|
102
102
|
nodes={nodes}
|
|
103
103
|
nodeTypes={nodeTypes}
|
|
@@ -106,8 +106,8 @@ function WorkflowCanvasInner({
|
|
|
106
106
|
onConnect={interactive ? onConnect : undefined}
|
|
107
107
|
onConnectEnd={interactive ? onConnectEnd : undefined}
|
|
108
108
|
onConnectStart={interactive ? onConnectStart : undefined}
|
|
109
|
-
onEdgesChange={
|
|
110
|
-
onNodesChange={
|
|
109
|
+
onEdgesChange={onEdgesChange}
|
|
110
|
+
onNodesChange={onNodesChange}
|
|
111
111
|
onPaneClick={onPaneClick}
|
|
112
112
|
onNodeClick={onNodeClick}
|
|
113
113
|
onEdgeClick={onEdgeClick}
|
|
@@ -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
|
))}
|
|
@@ -102,7 +102,11 @@ export const FileQueue = React.memo<FileQueueProps>(
|
|
|
102
102
|
aria-selected={isClickable ? isSelected : undefined}
|
|
103
103
|
>
|
|
104
104
|
<div className="flex items-start gap-2">
|
|
105
|
-
<Icon
|
|
105
|
+
<Icon
|
|
106
|
+
name={file.icon || "file"}
|
|
107
|
+
size="sm"
|
|
108
|
+
className={cn("mt-0.5", file.iconColor)}
|
|
109
|
+
/>
|
|
106
110
|
<QueueItemContent>
|
|
107
111
|
{file.name}
|
|
108
112
|
{file.path && (
|
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 {
|
|
@@ -2984,7 +3010,14 @@ var FileQueue = React3__namespace.memo(
|
|
|
2984
3010
|
onKeyDown: (e) => handleKeyDown(e, file.id),
|
|
2985
3011
|
"aria-selected": isClickable ? isSelected : void 0,
|
|
2986
3012
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
2987
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3013
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3014
|
+
Icon,
|
|
3015
|
+
{
|
|
3016
|
+
name: file.icon || "file",
|
|
3017
|
+
size: "sm",
|
|
3018
|
+
className: cn("mt-0.5", file.iconColor)
|
|
3019
|
+
}
|
|
3020
|
+
),
|
|
2988
3021
|
/* @__PURE__ */ jsxRuntime.jsxs(QueueItemContent, { children: [
|
|
2989
3022
|
file.name,
|
|
2990
3023
|
file.path && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground/70", children: [
|
|
@@ -4576,7 +4609,8 @@ function parseChecklistItems(content) {
|
|
|
4576
4609
|
items.push({
|
|
4577
4610
|
id: `checklist-${index}`,
|
|
4578
4611
|
label: taskMatch[2],
|
|
4579
|
-
checked: taskMatch[1].toLowerCase() === "x"
|
|
4612
|
+
checked: taskMatch[1].toLowerCase() === "x",
|
|
4613
|
+
isTask: true
|
|
4580
4614
|
});
|
|
4581
4615
|
return items;
|
|
4582
4616
|
}
|
|
@@ -4585,7 +4619,8 @@ function parseChecklistItems(content) {
|
|
|
4585
4619
|
items.push({
|
|
4586
4620
|
id: `checklist-${index}`,
|
|
4587
4621
|
label: numberStripped,
|
|
4588
|
-
checked: false
|
|
4622
|
+
checked: false,
|
|
4623
|
+
isTask: false
|
|
4589
4624
|
});
|
|
4590
4625
|
return items;
|
|
4591
4626
|
}, []);
|
|
@@ -4628,7 +4663,7 @@ var FilePreviewDialog = React3__namespace.memo(
|
|
|
4628
4663
|
{
|
|
4629
4664
|
className: "flex items-start gap-3 rounded-md px-1 py-1 text-sm leading-6",
|
|
4630
4665
|
children: [
|
|
4631
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4666
|
+
item.isTask && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4632
4667
|
Checkbox2,
|
|
4633
4668
|
{
|
|
4634
4669
|
checked: (_a = checkedItems[item.id]) != null ? _a : false,
|
|
@@ -9438,7 +9473,7 @@ function WorkflowCanvasInner({
|
|
|
9438
9473
|
connectionMode: react.ConnectionMode.Strict,
|
|
9439
9474
|
edges,
|
|
9440
9475
|
edgeTypes,
|
|
9441
|
-
elementsSelectable:
|
|
9476
|
+
elementsSelectable: true,
|
|
9442
9477
|
isValidConnection,
|
|
9443
9478
|
nodes,
|
|
9444
9479
|
nodeTypes,
|
|
@@ -9447,8 +9482,8 @@ function WorkflowCanvasInner({
|
|
|
9447
9482
|
onConnect: interactive ? onConnect : void 0,
|
|
9448
9483
|
onConnectEnd: interactive ? onConnectEnd : void 0,
|
|
9449
9484
|
onConnectStart: interactive ? onConnectStart : void 0,
|
|
9450
|
-
onEdgesChange
|
|
9451
|
-
onNodesChange
|
|
9485
|
+
onEdgesChange,
|
|
9486
|
+
onNodesChange,
|
|
9452
9487
|
onPaneClick,
|
|
9453
9488
|
onNodeClick,
|
|
9454
9489
|
onEdgeClick,
|