@autobe/ui 0.30.4-dev.20260324 → 0.30.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.
Files changed (53) hide show
  1. package/LICENSE +661 -661
  2. package/lib/components/AutoBeChatMain.js +5 -5
  3. package/lib/components/AutoBeConfigModal.js +9 -9
  4. package/package.json +2 -2
  5. package/src/components/AutoBeAssistantMessageMovie.tsx +22 -22
  6. package/src/components/AutoBeChatMain.tsx +394 -394
  7. package/src/components/AutoBeChatSidebar.tsx +414 -414
  8. package/src/components/AutoBeConfigButton.tsx +83 -83
  9. package/src/components/AutoBeConfigModal.tsx +443 -443
  10. package/src/components/AutoBeStatusButton.tsx +75 -75
  11. package/src/components/AutoBeStatusModal.tsx +486 -486
  12. package/src/components/AutoBeUserMessageMovie.tsx +27 -27
  13. package/src/components/common/ActionButton.tsx +205 -205
  14. package/src/components/common/ActionButtonGroup.tsx +80 -80
  15. package/src/components/common/AutoBeConfigInput.tsx +185 -185
  16. package/src/components/common/ChatBubble.tsx +119 -119
  17. package/src/components/common/Collapsible.tsx +95 -95
  18. package/src/components/common/CompactSessionIndicator.tsx +73 -73
  19. package/src/components/common/CompactSessionList.tsx +82 -82
  20. package/src/components/common/openai/OpenAIContent.tsx +53 -53
  21. package/src/components/common/openai/OpenAIUserAudioContent.tsx +70 -70
  22. package/src/components/common/openai/OpenAIUserFileContent.tsx +76 -76
  23. package/src/components/common/openai/OpenAIUserImageContent.tsx +34 -34
  24. package/src/components/common/openai/OpenAIUserTextContent.tsx +15 -15
  25. package/src/components/events/AutoBeCompleteEventMovie.tsx +402 -402
  26. package/src/components/events/AutoBeCorrectEventMovie.tsx +354 -354
  27. package/src/components/events/AutoBeEventGroupMovie.tsx +18 -18
  28. package/src/components/events/AutoBeEventMovie.tsx +154 -154
  29. package/src/components/events/AutoBeProgressEventMovie.tsx +207 -207
  30. package/src/components/events/AutoBeScenarioEventMovie.tsx +135 -135
  31. package/src/components/events/AutoBeStartEventMovie.tsx +82 -82
  32. package/src/components/events/AutoBeValidateEventMovie.tsx +249 -249
  33. package/src/components/events/README.md +300 -300
  34. package/src/components/events/common/CollapsibleEventGroup.tsx +211 -211
  35. package/src/components/events/common/EventCard.tsx +61 -61
  36. package/src/components/events/common/EventContent.tsx +31 -31
  37. package/src/components/events/common/EventHeader.tsx +85 -85
  38. package/src/components/events/common/EventIcon.tsx +82 -82
  39. package/src/components/events/common/ProgressBar.tsx +64 -64
  40. package/src/components/events/groups/CorrectEventGroup.tsx +183 -183
  41. package/src/components/events/groups/ValidateEventGroup.tsx +143 -143
  42. package/src/components/events/utils/eventGrouper.tsx +116 -116
  43. package/src/components/upload/AutoBeChatUploadBox.tsx +433 -433
  44. package/src/components/upload/AutoBeChatUploadSendButton.tsx +66 -66
  45. package/src/components/upload/AutoBeFileUploadBox.tsx +123 -123
  46. package/src/components/upload/AutoBeVoiceRecoderButton.tsx +100 -100
  47. package/src/context/AutoBeAgentContext.tsx +301 -301
  48. package/src/context/AutoBeAgentSessionList.tsx +58 -58
  49. package/src/context/SearchParamsContext.tsx +49 -49
  50. package/src/icons/Receipt.tsx +74 -74
  51. package/src/structure/AutoBeListener.ts +368 -368
  52. package/tsconfig.json +9 -9
  53. package/README.md +0 -261
@@ -1,116 +1,116 @@
1
- import { AutoBeEvent } from "@autobe/interface";
2
- import { ReactNode } from "react";
3
-
4
- import { ValidateEventGroup } from "../groups";
5
- import { ValidateEvent } from "../groups/ValidateEventGroup";
6
-
7
- /** Configuration for event grouping */
8
- export interface IEventGrouperConfig {
9
- /** Minimum number of events to form a group (default: 2) */
10
- minGroupSize?: number;
11
- /** Whether groups should be collapsed by default (default: true) */
12
- defaultCollapsed?: boolean;
13
- /** Whether to group events at all (default: true) */
14
- enableGrouping?: boolean;
15
- }
16
-
17
- /**
18
- * Groups events by type and renders appropriate group components
19
- *
20
- * @param events Array of AutoBe events to group
21
- * @param config Configuration options for grouping
22
- * @returns Array of ReactNode components (grouped or individual)
23
- */
24
- export function groupEvents(
25
- events: AutoBeEvent[],
26
- config: IEventGrouperConfig = {},
27
- ): ReactNode[] {
28
- const {
29
- minGroupSize = 2,
30
- defaultCollapsed = true,
31
- enableGrouping = true,
32
- } = config;
33
-
34
- if (!enableGrouping) {
35
- // Return individual event components without grouping
36
- return events.map((event, index) => (
37
- <div key={`${event.type}-${index}`}>{renderIndividualEvent(event)}</div>
38
- ));
39
- }
40
-
41
- // Group events by category
42
- const groupedEvents = groupEventsByCategory(events);
43
- const components: ReactNode[] = [];
44
-
45
- // Validation Events
46
- if (groupedEvents.validate.length >= minGroupSize) {
47
- components.push(
48
- <ValidateEventGroup
49
- key="validate-group"
50
- events={groupedEvents.validate}
51
- defaultCollapsed={defaultCollapsed}
52
- />,
53
- );
54
- } else {
55
- groupedEvents.validate.forEach((event, index) => {
56
- components.push(
57
- <div key={`validate-${index}`}>{renderIndividualEvent(event)}</div>,
58
- );
59
- });
60
- }
61
-
62
- // All other events (ungrouped)
63
- groupedEvents.other.forEach((event, index) => {
64
- components.push(
65
- <div key={`other-${index}`}>{renderIndividualEvent(event)}</div>,
66
- );
67
- });
68
-
69
- return components;
70
- }
71
-
72
- /** Groups events by their category */
73
- function groupEventsByCategory(events: AutoBeEvent[]) {
74
- const grouped = {
75
- validate: [] as ValidateEvent[],
76
- other: [] as AutoBeEvent[],
77
- };
78
-
79
- events.forEach((event) => {
80
- switch (event.type) {
81
- // Validation events
82
- case "databaseValidate":
83
- case "testValidate":
84
- case "realizeValidate":
85
- case "realizeAuthorizationValidate":
86
- case "interfaceOperationReview":
87
- grouped.validate.push(event);
88
- break;
89
- default:
90
- grouped.other.push(event);
91
- break;
92
- }
93
- });
94
-
95
- return grouped;
96
- }
97
-
98
- /** Renders individual event components based on event type */
99
- function renderIndividualEvent(event: AutoBeEvent): ReactNode {
100
- // This would import and use the actual event components
101
- // For now, returning a placeholder
102
- return (
103
- <div
104
- style={{
105
- padding: "1rem",
106
- border: "1px solid #e2e8f0",
107
- borderRadius: "0.5rem",
108
- marginBottom: "0.5rem",
109
- }}
110
- >
111
- <strong>{event.type}</strong> - {event.created_at}
112
- </div>
113
- );
114
- }
115
-
116
- export default groupEvents;
1
+ import { AutoBeEvent } from "@autobe/interface";
2
+ import { ReactNode } from "react";
3
+
4
+ import { ValidateEventGroup } from "../groups";
5
+ import { ValidateEvent } from "../groups/ValidateEventGroup";
6
+
7
+ /** Configuration for event grouping */
8
+ export interface IEventGrouperConfig {
9
+ /** Minimum number of events to form a group (default: 2) */
10
+ minGroupSize?: number;
11
+ /** Whether groups should be collapsed by default (default: true) */
12
+ defaultCollapsed?: boolean;
13
+ /** Whether to group events at all (default: true) */
14
+ enableGrouping?: boolean;
15
+ }
16
+
17
+ /**
18
+ * Groups events by type and renders appropriate group components
19
+ *
20
+ * @param events Array of AutoBe events to group
21
+ * @param config Configuration options for grouping
22
+ * @returns Array of ReactNode components (grouped or individual)
23
+ */
24
+ export function groupEvents(
25
+ events: AutoBeEvent[],
26
+ config: IEventGrouperConfig = {},
27
+ ): ReactNode[] {
28
+ const {
29
+ minGroupSize = 2,
30
+ defaultCollapsed = true,
31
+ enableGrouping = true,
32
+ } = config;
33
+
34
+ if (!enableGrouping) {
35
+ // Return individual event components without grouping
36
+ return events.map((event, index) => (
37
+ <div key={`${event.type}-${index}`}>{renderIndividualEvent(event)}</div>
38
+ ));
39
+ }
40
+
41
+ // Group events by category
42
+ const groupedEvents = groupEventsByCategory(events);
43
+ const components: ReactNode[] = [];
44
+
45
+ // Validation Events
46
+ if (groupedEvents.validate.length >= minGroupSize) {
47
+ components.push(
48
+ <ValidateEventGroup
49
+ key="validate-group"
50
+ events={groupedEvents.validate}
51
+ defaultCollapsed={defaultCollapsed}
52
+ />,
53
+ );
54
+ } else {
55
+ groupedEvents.validate.forEach((event, index) => {
56
+ components.push(
57
+ <div key={`validate-${index}`}>{renderIndividualEvent(event)}</div>,
58
+ );
59
+ });
60
+ }
61
+
62
+ // All other events (ungrouped)
63
+ groupedEvents.other.forEach((event, index) => {
64
+ components.push(
65
+ <div key={`other-${index}`}>{renderIndividualEvent(event)}</div>,
66
+ );
67
+ });
68
+
69
+ return components;
70
+ }
71
+
72
+ /** Groups events by their category */
73
+ function groupEventsByCategory(events: AutoBeEvent[]) {
74
+ const grouped = {
75
+ validate: [] as ValidateEvent[],
76
+ other: [] as AutoBeEvent[],
77
+ };
78
+
79
+ events.forEach((event) => {
80
+ switch (event.type) {
81
+ // Validation events
82
+ case "databaseValidate":
83
+ case "testValidate":
84
+ case "realizeValidate":
85
+ case "realizeAuthorizationValidate":
86
+ case "interfaceOperationReview":
87
+ grouped.validate.push(event);
88
+ break;
89
+ default:
90
+ grouped.other.push(event);
91
+ break;
92
+ }
93
+ });
94
+
95
+ return grouped;
96
+ }
97
+
98
+ /** Renders individual event components based on event type */
99
+ function renderIndividualEvent(event: AutoBeEvent): ReactNode {
100
+ // This would import and use the actual event components
101
+ // For now, returning a placeholder
102
+ return (
103
+ <div
104
+ style={{
105
+ padding: "1rem",
106
+ border: "1px solid #e2e8f0",
107
+ borderRadius: "0.5rem",
108
+ marginBottom: "0.5rem",
109
+ }}
110
+ >
111
+ <strong>{event.type}</strong> - {event.created_at}
112
+ </div>
113
+ );
114
+ }
115
+
116
+ export default groupEvents;