@autobe/ui 0.19.1
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/LICENSE +661 -0
- package/lib/AutoBeAssistantMessageMovie.d.ts +7 -0
- package/lib/AutoBeAssistantMessageMovie.js +13 -0
- package/lib/AutoBeAssistantMessageMovie.js.map +1 -0
- package/lib/AutoBeUserMessageMovie.d.ts +6 -0
- package/lib/AutoBeUserMessageMovie.js +17 -0
- package/lib/AutoBeUserMessageMovie.js.map +1 -0
- package/lib/common/ChatBubble.d.ts +19 -0
- package/lib/common/ChatBubble.js +56 -0
- package/lib/common/ChatBubble.js.map +1 -0
- package/lib/common/openai/OpenAIContent.d.ts +6 -0
- package/lib/common/openai/OpenAIContent.js +37 -0
- package/lib/common/openai/OpenAIContent.js.map +1 -0
- package/lib/common/openai/OpenAIUserAudioContent.d.ts +6 -0
- package/lib/common/openai/OpenAIUserAudioContent.js +39 -0
- package/lib/common/openai/OpenAIUserAudioContent.js.map +1 -0
- package/lib/common/openai/OpenAIUserFileContent.d.ts +6 -0
- package/lib/common/openai/OpenAIUserFileContent.js +45 -0
- package/lib/common/openai/OpenAIUserFileContent.js.map +1 -0
- package/lib/common/openai/OpenAIUserImageContent.d.ts +6 -0
- package/lib/common/openai/OpenAIUserImageContent.js +21 -0
- package/lib/common/openai/OpenAIUserImageContent.js.map +1 -0
- package/lib/common/openai/OpenAIUserTextContent.d.ts +5 -0
- package/lib/common/openai/OpenAIUserTextContent.js +15 -0
- package/lib/common/openai/OpenAIUserTextContent.js.map +1 -0
- package/lib/common/openai/index.d.ts +5 -0
- package/lib/common/openai/index.js +14 -0
- package/lib/common/openai/index.js.map +1 -0
- package/lib/events/AutoBeProgressEventMovie.d.ts +9 -0
- package/lib/events/AutoBeProgressEventMovie.js +163 -0
- package/lib/events/AutoBeProgressEventMovie.js.map +1 -0
- package/lib/events/AutoBeScenarioEventMovie.d.ts +6 -0
- package/lib/events/AutoBeScenarioEventMovie.js +84 -0
- package/lib/events/AutoBeScenarioEventMovie.js.map +1 -0
- package/lib/events/AutoBeStartEventMovie.d.ts +8 -0
- package/lib/events/AutoBeStartEventMovie.js +39 -0
- package/lib/events/AutoBeStartEventMovie.js.map +1 -0
- package/lib/events/index.d.ts +3 -0
- package/lib/events/index.js +13 -0
- package/lib/events/index.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +28 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/time.d.ts +7 -0
- package/lib/utils/time.js +19 -0
- package/lib/utils/time.js.map +1 -0
- package/package.json +28 -0
- package/src/AutoBeAssistantMessageMovie.tsx +22 -0
- package/src/AutoBeUserMessageMovie.tsx +25 -0
- package/src/common/ChatBubble.tsx +119 -0
- package/src/common/openai/OpenAIContent.tsx +53 -0
- package/src/common/openai/OpenAIUserAudioContent.tsx +70 -0
- package/src/common/openai/OpenAIUserFileContent.tsx +76 -0
- package/src/common/openai/OpenAIUserImageContent.tsx +34 -0
- package/src/common/openai/OpenAIUserTextContent.tsx +16 -0
- package/src/common/openai/index.ts +5 -0
- package/src/events/AutoBeProgressEventMovie.tsx +250 -0
- package/src/events/AutoBeScenarioEventMovie.tsx +183 -0
- package/src/events/AutoBeStartEventMovie.tsx +82 -0
- package/src/events/index.ts +3 -0
- package/src/index.ts +8 -0
- package/src/utils/time.ts +14 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AutoBeUserMessageImageContent } from "@autobe/interface";
|
|
2
|
+
|
|
3
|
+
/** Image content renderer component for OpenAI messages */
|
|
4
|
+
export const OpenAIUserImageContent = ({
|
|
5
|
+
content,
|
|
6
|
+
}: {
|
|
7
|
+
content: AutoBeUserMessageImageContent;
|
|
8
|
+
}) => {
|
|
9
|
+
const imgSrc =
|
|
10
|
+
content.image.type === "url" ? content.image.url : content.image.data;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div
|
|
14
|
+
style={{
|
|
15
|
+
position: "relative",
|
|
16
|
+
maxWidth: "16rem",
|
|
17
|
+
borderRadius: "0.5rem",
|
|
18
|
+
overflow: "hidden",
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
<img
|
|
22
|
+
src={imgSrc}
|
|
23
|
+
alt="User uploaded image"
|
|
24
|
+
style={{
|
|
25
|
+
width: "100%",
|
|
26
|
+
height: "auto",
|
|
27
|
+
display: "block",
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default OpenAIUserImageContent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Text content renderer component for OpenAI messages */
|
|
2
|
+
export const OpenAIUserTextContent = ({ text }: { text: string }) => (
|
|
3
|
+
<div
|
|
4
|
+
style={{
|
|
5
|
+
position: "relative",
|
|
6
|
+
zIndex: 10,
|
|
7
|
+
fontSize: "0.875rem",
|
|
8
|
+
lineHeight: "1.625",
|
|
9
|
+
whiteSpace: "pre-wrap",
|
|
10
|
+
}}
|
|
11
|
+
>
|
|
12
|
+
{text}
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default OpenAIUserTextContent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { OpenAIUserTextContent } from "./OpenAIUserTextContent";
|
|
2
|
+
export { OpenAIUserAudioContent } from "./OpenAIUserAudioContent";
|
|
3
|
+
export { OpenAIUserFileContent } from "./OpenAIUserFileContent";
|
|
4
|
+
export { OpenAIUserImageContent } from "./OpenAIUserImageContent";
|
|
5
|
+
export { OpenAIContent } from "./OpenAIContent";
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { AutoBeEvent, AutoBeProgressEventBase } from "@autobe/interface";
|
|
2
|
+
|
|
3
|
+
import { formatTime } from "../utils/time";
|
|
4
|
+
|
|
5
|
+
export function AutoBeProgressEventMovie(
|
|
6
|
+
props: AutoBeProgressEventMovie.IProps,
|
|
7
|
+
) {
|
|
8
|
+
const state: IState = getState(props.event);
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
style={{
|
|
13
|
+
backgroundColor: "#f8fafc",
|
|
14
|
+
border: "1px solid #e2e8f0",
|
|
15
|
+
borderRadius: "0.75rem",
|
|
16
|
+
padding: "1.5rem",
|
|
17
|
+
marginBottom: "1rem",
|
|
18
|
+
boxShadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
{/* Header */}
|
|
22
|
+
<div
|
|
23
|
+
style={{
|
|
24
|
+
display: "flex",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
justifyContent: "space-between",
|
|
27
|
+
marginBottom: "1rem",
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
style={{
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
gap: "0.75rem",
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
{/* Status Icon */}
|
|
38
|
+
<div
|
|
39
|
+
style={{
|
|
40
|
+
width: "2rem",
|
|
41
|
+
height: "2rem",
|
|
42
|
+
backgroundColor: "#4caf50",
|
|
43
|
+
borderRadius: "50%",
|
|
44
|
+
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<svg
|
|
50
|
+
width="16"
|
|
51
|
+
height="16"
|
|
52
|
+
viewBox="0 0 24 24"
|
|
53
|
+
fill="currentColor"
|
|
54
|
+
style={{ color: "#ffffff" }}
|
|
55
|
+
>
|
|
56
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
|
|
57
|
+
</svg>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
{/* Title */}
|
|
61
|
+
<div>
|
|
62
|
+
<h3
|
|
63
|
+
style={{
|
|
64
|
+
fontSize: "1.125rem",
|
|
65
|
+
fontWeight: "600",
|
|
66
|
+
color: "#1e293b",
|
|
67
|
+
margin: 0,
|
|
68
|
+
marginBottom: "0.25rem",
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
{state.title}
|
|
72
|
+
</h3>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
{/* Timestamp */}
|
|
77
|
+
<div
|
|
78
|
+
style={{
|
|
79
|
+
fontSize: "0.75rem",
|
|
80
|
+
color: "#64748b",
|
|
81
|
+
textAlign: "right",
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
{formatTime(props.event.created_at)}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
{/* Content */}
|
|
89
|
+
<div
|
|
90
|
+
style={{
|
|
91
|
+
fontSize: "0.875rem",
|
|
92
|
+
lineHeight: "1.5",
|
|
93
|
+
color: "#475569",
|
|
94
|
+
backgroundColor: "#ffffff",
|
|
95
|
+
padding: "1rem",
|
|
96
|
+
borderRadius: "0.5rem",
|
|
97
|
+
border: "1px solid #e2e8f0",
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<div style={{ marginBottom: "1rem" }}>{state.description}</div>
|
|
101
|
+
|
|
102
|
+
{/* Progress Bar */}
|
|
103
|
+
<div
|
|
104
|
+
style={{
|
|
105
|
+
width: "100%",
|
|
106
|
+
height: "10px",
|
|
107
|
+
backgroundColor: "#e2e8f0",
|
|
108
|
+
borderRadius: "10px",
|
|
109
|
+
overflow: "hidden",
|
|
110
|
+
marginBottom: "0.5rem",
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<div
|
|
114
|
+
style={{
|
|
115
|
+
width: `${Math.round((state.completed / state.total) * 100)}%`,
|
|
116
|
+
height: "100%",
|
|
117
|
+
backgroundColor: "#4caf50",
|
|
118
|
+
borderRadius: "10px",
|
|
119
|
+
transition: "width 0.3s ease",
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div
|
|
125
|
+
style={{
|
|
126
|
+
fontSize: "0.75rem",
|
|
127
|
+
color: "#64748b",
|
|
128
|
+
textAlign: "center",
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
{state.completed} / {state.total} completed
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
type ExtractType<T, U> = T extends U ? T : never;
|
|
138
|
+
|
|
139
|
+
export namespace AutoBeProgressEventMovie {
|
|
140
|
+
export interface IProps {
|
|
141
|
+
event: ExtractType<AutoBeEvent, AutoBeProgressEventBase>;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface IState {
|
|
146
|
+
title: string;
|
|
147
|
+
description: string;
|
|
148
|
+
completed: number;
|
|
149
|
+
total: number;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function getState(event: AutoBeProgressEventMovie.IProps["event"]): IState {
|
|
153
|
+
const content: Pick<IState, "title" | "description"> = (() => {
|
|
154
|
+
switch (event.type) {
|
|
155
|
+
case "analyzeWrite":
|
|
156
|
+
return {
|
|
157
|
+
title: "Analyze Write",
|
|
158
|
+
description: "Analyzing requirements, and writing a report paper",
|
|
159
|
+
};
|
|
160
|
+
case "analyzeReview":
|
|
161
|
+
return {
|
|
162
|
+
title: "Analyze Review",
|
|
163
|
+
description: "Reviewing the analysis results",
|
|
164
|
+
};
|
|
165
|
+
case "prismaSchemas":
|
|
166
|
+
return {
|
|
167
|
+
title: "Prisma Schemas",
|
|
168
|
+
description: "Designing Database schemas",
|
|
169
|
+
};
|
|
170
|
+
case "prismaReview":
|
|
171
|
+
return {
|
|
172
|
+
title: "Prisma Review",
|
|
173
|
+
description: "Reviewing the Prisma schemas",
|
|
174
|
+
};
|
|
175
|
+
case "interfaceEndpoints":
|
|
176
|
+
return {
|
|
177
|
+
title: "Interface Endpoints",
|
|
178
|
+
description: "Collecting API endpoints",
|
|
179
|
+
};
|
|
180
|
+
case "interfaceOperations":
|
|
181
|
+
return {
|
|
182
|
+
title: "Interface Operations",
|
|
183
|
+
description: "Designing API operations",
|
|
184
|
+
};
|
|
185
|
+
case "interfaceOperationsReview":
|
|
186
|
+
return {
|
|
187
|
+
title: "Interface Operations Review",
|
|
188
|
+
description: "Reviewing API operations",
|
|
189
|
+
};
|
|
190
|
+
case "interfaceAuthorization":
|
|
191
|
+
return {
|
|
192
|
+
title: "Interface Authorization",
|
|
193
|
+
description: "Designing API authorization operations",
|
|
194
|
+
};
|
|
195
|
+
case "interfaceSchemas":
|
|
196
|
+
return {
|
|
197
|
+
title: "Interface Schemas",
|
|
198
|
+
description: "Designing API type schemas",
|
|
199
|
+
};
|
|
200
|
+
case "interfaceSchemasReview":
|
|
201
|
+
return {
|
|
202
|
+
title: "Interface Schemas Review",
|
|
203
|
+
description: "Reviewing API type schemas",
|
|
204
|
+
};
|
|
205
|
+
case "testScenarios":
|
|
206
|
+
return {
|
|
207
|
+
title: "Test Scenarios",
|
|
208
|
+
description: "Planning E2E test scenarios",
|
|
209
|
+
};
|
|
210
|
+
case "testWrite":
|
|
211
|
+
return {
|
|
212
|
+
title: "Test Write",
|
|
213
|
+
description: "Writing E2E test functions",
|
|
214
|
+
};
|
|
215
|
+
case "realizeWrite":
|
|
216
|
+
return {
|
|
217
|
+
title: "Realize Write",
|
|
218
|
+
description: "Realizing the API functions",
|
|
219
|
+
};
|
|
220
|
+
case "realizeAuthorizationWrite":
|
|
221
|
+
return {
|
|
222
|
+
title: "Authorization Write",
|
|
223
|
+
description: "Writing authorization decorators and functions",
|
|
224
|
+
};
|
|
225
|
+
case "realizeTestOperation":
|
|
226
|
+
return {
|
|
227
|
+
title: "Realize Test Operation",
|
|
228
|
+
description:
|
|
229
|
+
"Running the E2E test operations to validate the API functions",
|
|
230
|
+
};
|
|
231
|
+
case "realizeCorrect":
|
|
232
|
+
return {
|
|
233
|
+
title: "Realize Correct",
|
|
234
|
+
description: "Correcting the API functions",
|
|
235
|
+
};
|
|
236
|
+
default:
|
|
237
|
+
event satisfies never;
|
|
238
|
+
return {
|
|
239
|
+
title: "Unknown Event",
|
|
240
|
+
description: "This event type is not recognized.",
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
})();
|
|
244
|
+
return {
|
|
245
|
+
...content,
|
|
246
|
+
completed: event.completed,
|
|
247
|
+
total: event.total,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
export default AutoBeProgressEventMovie;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutoBeAnalyzeScenarioEvent,
|
|
3
|
+
AutoBeInterfaceGroupsEvent,
|
|
4
|
+
AutoBePrismaComponentsEvent,
|
|
5
|
+
AutoBeRealizeTestResetEvent,
|
|
6
|
+
} from "@autobe/interface";
|
|
7
|
+
import { JSX } from "react";
|
|
8
|
+
|
|
9
|
+
import { formatTime } from "../utils/time";
|
|
10
|
+
|
|
11
|
+
export interface IAutoBeScenarioEventMovieProps {
|
|
12
|
+
event:
|
|
13
|
+
| AutoBeAnalyzeScenarioEvent
|
|
14
|
+
| AutoBePrismaComponentsEvent
|
|
15
|
+
| AutoBeInterfaceGroupsEvent
|
|
16
|
+
| AutoBeRealizeTestResetEvent;
|
|
17
|
+
}
|
|
18
|
+
export const AutoBeScenarioEventMovie = (
|
|
19
|
+
props: IAutoBeScenarioEventMovieProps,
|
|
20
|
+
) => {
|
|
21
|
+
const { event } = props;
|
|
22
|
+
const { title, description } = getState(event);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
style={{
|
|
27
|
+
backgroundColor: "#f8fafc",
|
|
28
|
+
border: "1px solid #e2e8f0",
|
|
29
|
+
borderRadius: "0.75rem",
|
|
30
|
+
padding: "1.5rem",
|
|
31
|
+
marginBottom: "1rem",
|
|
32
|
+
boxShadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
{/* Header */}
|
|
36
|
+
<div
|
|
37
|
+
style={{
|
|
38
|
+
display: "flex",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
justifyContent: "space-between",
|
|
41
|
+
marginBottom: "1rem",
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<div
|
|
45
|
+
style={{
|
|
46
|
+
display: "flex",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
gap: "0.75rem",
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{/* Status Icon */}
|
|
52
|
+
<div
|
|
53
|
+
style={{
|
|
54
|
+
width: "2rem",
|
|
55
|
+
height: "2rem",
|
|
56
|
+
backgroundColor: "#3b82f6",
|
|
57
|
+
borderRadius: "50%",
|
|
58
|
+
display: "flex",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center",
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
<svg
|
|
64
|
+
width="16"
|
|
65
|
+
height="16"
|
|
66
|
+
viewBox="0 0 24 24"
|
|
67
|
+
fill="currentColor"
|
|
68
|
+
style={{ color: "#ffffff" }}
|
|
69
|
+
>
|
|
70
|
+
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" />
|
|
71
|
+
</svg>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
{/* Title and Step */}
|
|
75
|
+
<div>
|
|
76
|
+
<h3
|
|
77
|
+
style={{
|
|
78
|
+
fontSize: "1.125rem",
|
|
79
|
+
fontWeight: "600",
|
|
80
|
+
color: "#1e293b",
|
|
81
|
+
margin: 0,
|
|
82
|
+
marginBottom: "0.25rem",
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
{title}
|
|
86
|
+
</h3>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
{/* Timestamp */}
|
|
91
|
+
<div
|
|
92
|
+
style={{
|
|
93
|
+
fontSize: "0.75rem",
|
|
94
|
+
color: "#64748b",
|
|
95
|
+
textAlign: "right",
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
{formatTime(event.created_at)}
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{/* Description */}
|
|
103
|
+
<div
|
|
104
|
+
style={{
|
|
105
|
+
fontSize: "0.875rem",
|
|
106
|
+
lineHeight: "1.5",
|
|
107
|
+
color: "#475569",
|
|
108
|
+
backgroundColor: "#ffffff",
|
|
109
|
+
padding: "1rem",
|
|
110
|
+
borderRadius: "0.5rem",
|
|
111
|
+
border: "1px solid #e2e8f0",
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
{description}
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
export default AutoBeScenarioEventMovie;
|
|
120
|
+
|
|
121
|
+
interface IState {
|
|
122
|
+
title: string;
|
|
123
|
+
description: string | JSX.Element;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function getState(event: IAutoBeScenarioEventMovieProps["event"]): IState {
|
|
127
|
+
switch (event.type) {
|
|
128
|
+
case "analyzeScenario":
|
|
129
|
+
return {
|
|
130
|
+
title: "Analyze Scenario",
|
|
131
|
+
description: (
|
|
132
|
+
<>
|
|
133
|
+
Generating analysis report.
|
|
134
|
+
<br />
|
|
135
|
+
<br />
|
|
136
|
+
Number of documents to write: #{event.files.length}
|
|
137
|
+
</>
|
|
138
|
+
),
|
|
139
|
+
};
|
|
140
|
+
case "prismaComponents":
|
|
141
|
+
return {
|
|
142
|
+
title: "Prisma Components",
|
|
143
|
+
description: (
|
|
144
|
+
<>
|
|
145
|
+
Generating Prisma components.
|
|
146
|
+
<br />
|
|
147
|
+
<br />
|
|
148
|
+
Number of Prisma schemas would be:
|
|
149
|
+
<br />
|
|
150
|
+
<ul>
|
|
151
|
+
<li>namespaces: #{event.components.length}</li>
|
|
152
|
+
<li>
|
|
153
|
+
tables: #
|
|
154
|
+
{event.components
|
|
155
|
+
.map((c) => c.tables.length)
|
|
156
|
+
.reduce((a, b) => a + b, 0)}
|
|
157
|
+
</li>
|
|
158
|
+
</ul>
|
|
159
|
+
</>
|
|
160
|
+
),
|
|
161
|
+
};
|
|
162
|
+
case "interfaceGroups":
|
|
163
|
+
return {
|
|
164
|
+
title: "Interface Endpoint Groups",
|
|
165
|
+
description: (
|
|
166
|
+
<>
|
|
167
|
+
Generating interface endpoint groups.
|
|
168
|
+
<br />
|
|
169
|
+
<br />
|
|
170
|
+
Number of API operation groups would be #{event.groups.length}
|
|
171
|
+
</>
|
|
172
|
+
),
|
|
173
|
+
};
|
|
174
|
+
case "realizeTestReset":
|
|
175
|
+
return {
|
|
176
|
+
title: "Realize Test Reset",
|
|
177
|
+
description: "Resetting test environment.",
|
|
178
|
+
};
|
|
179
|
+
default:
|
|
180
|
+
event satisfies never;
|
|
181
|
+
throw new Error("Unknown event type");
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutoBeAnalyzeStartEvent,
|
|
3
|
+
AutoBeInterfaceStartEvent,
|
|
4
|
+
AutoBePrismaStartEvent,
|
|
5
|
+
AutoBeRealizeAuthorizationStartEvent,
|
|
6
|
+
AutoBeRealizeStartEvent,
|
|
7
|
+
AutoBeRealizeTestStartEvent,
|
|
8
|
+
AutoBeTestStartEvent,
|
|
9
|
+
} from "@autobe/interface";
|
|
10
|
+
|
|
11
|
+
interface IAutoBeStartEventProps {
|
|
12
|
+
event:
|
|
13
|
+
| AutoBeAnalyzeStartEvent
|
|
14
|
+
| AutoBePrismaStartEvent
|
|
15
|
+
| AutoBeInterfaceStartEvent
|
|
16
|
+
| AutoBeTestStartEvent
|
|
17
|
+
| AutoBeRealizeStartEvent
|
|
18
|
+
| AutoBeRealizeAuthorizationStartEvent
|
|
19
|
+
| AutoBeRealizeTestStartEvent;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const AutoBeStartEventMovie = (props: IAutoBeStartEventProps) => {
|
|
25
|
+
const { event } = props;
|
|
26
|
+
const title = getTitle(event);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
style={{
|
|
31
|
+
display: "flex",
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
marginBottom: "1rem",
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
className={props.className}
|
|
38
|
+
style={{
|
|
39
|
+
backgroundColor: "#f0f0f0",
|
|
40
|
+
border: "1px solid #e0e0e0",
|
|
41
|
+
borderRadius: "0.5rem",
|
|
42
|
+
padding: "0.5rem 1rem",
|
|
43
|
+
...props.style,
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
style={{
|
|
48
|
+
fontSize: "0.875rem",
|
|
49
|
+
color: "#666",
|
|
50
|
+
fontWeight: "medium",
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
🚀 {title} has started.
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
function getTitle(event: IAutoBeStartEventProps["event"]): string {
|
|
61
|
+
switch (event.type) {
|
|
62
|
+
case "analyzeStart":
|
|
63
|
+
return "Analyze";
|
|
64
|
+
case "prismaStart":
|
|
65
|
+
return "Prisma";
|
|
66
|
+
case "interfaceStart":
|
|
67
|
+
return "Interface";
|
|
68
|
+
case "testStart":
|
|
69
|
+
return "Test";
|
|
70
|
+
case "realizeStart":
|
|
71
|
+
return "Realize";
|
|
72
|
+
case "realizeAuthorizationStart":
|
|
73
|
+
return "Realize Authorization";
|
|
74
|
+
case "realizeTestStart":
|
|
75
|
+
return "Final E2E Test";
|
|
76
|
+
default:
|
|
77
|
+
event satisfies never;
|
|
78
|
+
throw new Error("Unknown event type"); // unreachable
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default AutoBeStartEventMovie;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./events";
|
|
2
|
+
export { default as AutoBeAssistantMessageMovie } from "./AutoBeAssistantMessageMovie";
|
|
3
|
+
export { default as AutoBeUserMessageMovie } from "./AutoBeUserMessageMovie";
|
|
4
|
+
export { default as ChatBubble } from "./common/ChatBubble";
|
|
5
|
+
export type {
|
|
6
|
+
IChatBubbleProps,
|
|
7
|
+
IContentRendererProps,
|
|
8
|
+
} from "./common/ChatBubble";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats an ISO timestamp string to display time in Korean locale
|
|
3
|
+
*
|
|
4
|
+
* @param isoString - ISO format timestamp string
|
|
5
|
+
* @returns Formatted time string (HH:mm)
|
|
6
|
+
*/
|
|
7
|
+
export const formatTime = (isoString: string): string => {
|
|
8
|
+
const date = new Date(isoString);
|
|
9
|
+
return date.toLocaleTimeString("ko-KR", {
|
|
10
|
+
hour: "2-digit",
|
|
11
|
+
minute: "2-digit",
|
|
12
|
+
hour12: false,
|
|
13
|
+
});
|
|
14
|
+
};
|