@canmingir/link 1.2.55 → 1.2.57

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 (220) hide show
  1. package/.eslintignore +0 -1
  2. package/.github/workflows/publish.yml +6 -1
  3. package/LICENSE +201 -0
  4. package/bun.lock +20 -30
  5. package/package.json +4 -1
  6. package/src/assets/illustrations/avatar-shape.jsx +10 -8
  7. package/src/assets/illustrations/background-shape.jsx +0 -2
  8. package/src/assets/illustrations/booking-illustration.jsx +8 -6
  9. package/src/assets/illustrations/check-in-illustration.jsx +8 -6
  10. package/src/assets/illustrations/check-out-illustration.jsx +8 -6
  11. package/src/assets/illustrations/coming-soon-illustration.jsx +8 -6
  12. package/src/assets/illustrations/forbidden-illustration.jsx +8 -6
  13. package/src/assets/illustrations/maintenance-illustration.jsx +8 -6
  14. package/src/assets/illustrations/motivation-illustration.jsx +8 -6
  15. package/src/assets/illustrations/order-complete-illustration.jsx +8 -6
  16. package/src/assets/illustrations/page-not-found-illustration.jsx +8 -6
  17. package/src/assets/illustrations/seo-illustration.jsx +8 -6
  18. package/src/assets/illustrations/sever-error-illustration.jsx +8 -6
  19. package/src/assets/illustrations/upgrade-storage-illustration.jsx +8 -6
  20. package/src/assets/illustrations/upload-illustration.jsx +8 -6
  21. package/src/components/Iconify/Iconify.jsx +0 -1
  22. package/src/components/chart/chart.js +0 -2
  23. package/src/components/chart/index.js +0 -2
  24. package/src/components/chart/use-chart.js +0 -2
  25. package/src/components/custom-popover/styles.js +0 -2
  26. package/src/components/custom-popover/use-popover.js +0 -2
  27. package/src/components/custom-popover/utils.js +0 -2
  28. package/src/components/file-thumbnail/utils.js +0 -12
  29. package/src/components/image/utils.js +0 -2
  30. package/src/components/label/styles.js +0 -2
  31. package/src/components/logo/logo.jsx +1 -1
  32. package/src/components/scrollbar/styles.js +0 -2
  33. package/src/components/settings/context/settings-context.js +0 -2
  34. package/src/hooks/use-boolean.js +0 -2
  35. package/src/hooks/use-event-listener.js +0 -2
  36. package/src/hooks/use-local-storage.js +0 -4
  37. package/src/hooks/use-off-set-top.js +0 -2
  38. package/src/hooks/use-responsive.js +0 -4
  39. package/src/hooks/use-scroll-to-top.js +0 -2
  40. package/src/layouts/CompactLayout/CompactLayout.jsx +0 -2
  41. package/src/layouts/DashboardLayout/DashboardLayout.jsx +0 -2
  42. package/src/layouts/DashboardLayout/main.jsx +0 -2
  43. package/src/layouts/DashboardLayout/nav-horizontal.jsx +0 -2
  44. package/src/layouts/DashboardLayout/nav-vertical.jsx +6 -5
  45. package/src/layouts/FullScreenLayout/FullScreenLayout.jsx +3 -4
  46. package/src/layouts/FullScreenLayout/nav-horizontal.jsx +0 -2
  47. package/src/layouts/FullScreenLayout/nav-vertical.jsx +4 -5
  48. package/src/layouts/MainLayout/header.jsx +1 -3
  49. package/src/layouts/MainLayout/nav/desktop/index.jsx +0 -2
  50. package/src/layouts/MainLayout/nav/desktop/nav-item.jsx +0 -6
  51. package/src/layouts/MainLayout/nav/desktop/nav-list.jsx +16 -16
  52. package/src/layouts/MainLayout/nav/mobile/index.jsx +1 -3
  53. package/src/layouts/MainLayout/nav/mobile/nav-item.jsx +0 -4
  54. package/src/layouts/MainLayout/nav/mobile/nav-list.jsx +0 -2
  55. package/src/layouts/TwoSideLayout/TwoSideLayout.jsx +0 -1
  56. package/src/layouts/auth/classic.jsx +3 -4
  57. package/src/layouts/auth/modern-compact.jsx +0 -2
  58. package/src/layouts/auth/modern.jsx +0 -2
  59. package/src/layouts/common/ProjectBar/utils.js +0 -10
  60. package/src/layouts/common/account-popover.jsx +0 -2
  61. package/src/layouts/common/header-shadow.jsx +0 -2
  62. package/src/layouts/common/header-sim.jsx +7 -4
  63. package/src/layouts/common/header-simple.jsx +14 -8
  64. package/src/layouts/common/nav-toggle-button.jsx +1 -3
  65. package/src/layouts/common/notifications-popover/index.jsx +9 -10
  66. package/src/layouts/common/notifications-popover/notification-item.jsx +20 -17
  67. package/src/layouts/common/settings-button.jsx +0 -2
  68. package/src/layouts/config-layout.js +0 -2
  69. package/src/lib/ChatMessage/AIMessage.tsx +163 -0
  70. package/src/lib/ChatMessage/ErrorMessage.tsx +63 -0
  71. package/src/lib/ChatMessage/HumanMessage.tsx +142 -0
  72. package/src/lib/ChatMessage/LoadingMessage.tsx +27 -0
  73. package/src/lib/ChatMessage/MessageList.tsx +81 -0
  74. package/src/lib/ChatMessage/ToolMessage.tsx +346 -0
  75. package/src/lib/ChatMessage/index.js +6 -0
  76. package/src/lib/Image/utils.js +0 -2
  77. package/src/lib/PresetSelector/PresetSelector.tsx +112 -0
  78. package/src/lib/PresetSelector/index.js +1 -0
  79. package/src/lib/Scrollbar/styles.js +0 -2
  80. package/src/lib/SidebarChat/ChatDrawer.tsx +407 -0
  81. package/src/lib/SidebarChat/SessionPopover.tsx +221 -0
  82. package/src/lib/SidebarChat/SidebarChat.tsx +222 -0
  83. package/src/lib/SidebarChat/SidebarSessionList.tsx +304 -0
  84. package/src/lib/SidebarChat/assets.d.ts +4 -0
  85. package/src/lib/SidebarChat/cleanIconName.ts +4 -0
  86. package/src/lib/SidebarChat/index.js +1 -0
  87. package/src/lib/SidebarChat/messageSFX.mp3 +0 -0
  88. package/src/lib/SidebarChat/types.ts +14 -0
  89. package/src/lib/index.js +11 -0
  90. package/src/pages/404.jsx +0 -2
  91. package/src/routes/components/router-link.jsx +0 -2
  92. package/src/routes/hooks/use-active-link.js +0 -2
  93. package/src/routes/hooks/use-pathname.js +0 -2
  94. package/src/routes/hooks/use-router.js +0 -2
  95. package/src/theme/css.js +0 -12
  96. package/src/theme/custom-shadows.js +0 -2
  97. package/src/theme/options/contrast.js +0 -2
  98. package/src/theme/options/presets.js +0 -4
  99. package/src/theme/options/right-to-left.jsx +0 -2
  100. package/src/theme/overrides/components/accordion.js +0 -2
  101. package/src/theme/overrides/components/alert.js +0 -4
  102. package/src/theme/overrides/components/appbar.js +0 -2
  103. package/src/theme/overrides/components/autocomplete.js +0 -2
  104. package/src/theme/overrides/components/avatar.js +0 -4
  105. package/src/theme/overrides/components/backdrop.js +0 -2
  106. package/src/theme/overrides/components/badge.js +0 -2
  107. package/src/theme/overrides/components/breadcrumbs.js +0 -2
  108. package/src/theme/overrides/components/button-group.js +0 -4
  109. package/src/theme/overrides/components/button.js +0 -4
  110. package/src/theme/overrides/components/card.js +0 -2
  111. package/src/theme/overrides/components/checkbox.js +0 -2
  112. package/src/theme/overrides/components/chip.js +0 -4
  113. package/src/theme/overrides/components/css-baseline.js +0 -2
  114. package/src/theme/overrides/components/data-grid.js +0 -2
  115. package/src/theme/overrides/components/date-picker.jsx +0 -2
  116. package/src/theme/overrides/components/dialog.js +0 -2
  117. package/src/theme/overrides/components/drawer.js +0 -2
  118. package/src/theme/overrides/components/fab.js +0 -4
  119. package/src/theme/overrides/components/form.js +0 -2
  120. package/src/theme/overrides/components/list.js +0 -2
  121. package/src/theme/overrides/components/loading-button.js +0 -2
  122. package/src/theme/overrides/components/menu.js +0 -2
  123. package/src/theme/overrides/components/pagination.js +0 -4
  124. package/src/theme/overrides/components/paper.js +0 -2
  125. package/src/theme/overrides/components/popover.js +0 -2
  126. package/src/theme/overrides/components/progress.js +0 -4
  127. package/src/theme/overrides/components/radio.js +0 -2
  128. package/src/theme/overrides/components/rating.js +0 -2
  129. package/src/theme/overrides/components/select.js +0 -2
  130. package/src/theme/overrides/components/skeleton.js +0 -2
  131. package/src/theme/overrides/components/slider.js +0 -2
  132. package/src/theme/overrides/components/stepper.js +0 -2
  133. package/src/theme/overrides/components/svg-icon.js +0 -2
  134. package/src/theme/overrides/components/switch.js +0 -2
  135. package/src/theme/overrides/components/table.js +0 -2
  136. package/src/theme/overrides/components/tabs.js +0 -2
  137. package/src/theme/overrides/components/textfield.js +0 -2
  138. package/src/theme/overrides/components/timeline.js +0 -2
  139. package/src/theme/overrides/components/toggle-button.js +0 -4
  140. package/src/theme/overrides/components/tooltip.js +0 -2
  141. package/src/theme/overrides/components/tree-view.js +0 -2
  142. package/src/theme/overrides/components/typography.js +0 -2
  143. package/src/theme/overrides/default-props.jsx +4 -7
  144. package/src/theme/palette.js +0 -4
  145. package/src/theme/shadows.js +0 -2
  146. package/src/theme/typography.js +0 -4
  147. package/src/utils/flatten-array.js +0 -2
  148. package/src/utils/format-number.js +0 -2
  149. package/src/utils/format-time.js +0 -2
  150. package/src/utils/storage-available.js +0 -2
  151. package/src/widgets/Login/Login.jsx +0 -2
  152. package/src/widgets/error/not-found-view.jsx +0 -2
  153. package/vite/vite.js +8 -1
  154. package/project/.eslintrc.cjs +0 -22
  155. package/project/config.js +0 -18
  156. package/project/config.menu.js +0 -39
  157. package/project/config.template.js +0 -31
  158. package/project/cypress/e2e/layouts.cy.js +0 -170
  159. package/project/cypress/e2e/login.cy.js +0 -35
  160. package/project/cypress/e2e/selectbar.cy.js +0 -80
  161. package/project/cypress/fixtures/CONFIG/MENU_CONFIG.js +0 -39
  162. package/project/cypress/fixtures/EMPEROR/EMPERORS_GET.json +0 -51
  163. package/project/cypress/fixtures/EMPEROR/EMPERORS_POST.json +0 -9
  164. package/project/cypress/fixtures/OAUTH/GITHUB/user.json +0 -46
  165. package/project/cypress/fixtures/example.json +0 -5
  166. package/project/cypress/support/commands.js +0 -104
  167. package/project/cypress/support/e2e.js +0 -1
  168. package/project/cypress.config.js +0 -10
  169. package/project/index.html +0 -12
  170. package/project/media/ProjectIcons/3d.png +0 -0
  171. package/project/media/ProjectIcons/box.png +0 -0
  172. package/project/media/ProjectIcons/cafe.png +0 -0
  173. package/project/media/ProjectIcons/cargo.png +0 -0
  174. package/project/media/ProjectIcons/cloud.png +0 -0
  175. package/project/media/ProjectIcons/code.png +0 -0
  176. package/project/media/ProjectIcons/company.png +0 -0
  177. package/project/media/ProjectIcons/conversation.png +0 -0
  178. package/project/media/ProjectIcons/distributed.png +0 -0
  179. package/project/media/ProjectIcons/fingerprint.png +0 -0
  180. package/project/media/ProjectIcons/forest.png +0 -0
  181. package/project/media/ProjectIcons/headphones.png +0 -0
  182. package/project/media/ProjectIcons/office.png +0 -0
  183. package/project/media/ProjectIcons/path.png +0 -0
  184. package/project/media/ProjectIcons/printer.png +0 -0
  185. package/project/media/ProjectIcons/project.png +0 -0
  186. package/project/media/ProjectIcons/resume.png +0 -0
  187. package/project/media/ProjectIcons/rocket.png +0 -0
  188. package/project/media/ProjectIcons/rtruck.png +0 -0
  189. package/project/media/ProjectIcons/sign.png +0 -0
  190. package/project/media/ProjectIcons/site.png +0 -0
  191. package/project/media/ProjectIcons/truck.png +0 -0
  192. package/project/media/logo.png +0 -0
  193. package/project/package-lock.json +0 -22434
  194. package/project/package.json +0 -42
  195. package/project/public/assets/background/overlay_2.jpg +0 -0
  196. package/project/public/assets/illustrations/illustration_dashboard.png +0 -0
  197. package/project/public/media/largeLogo.png +0 -0
  198. package/project/public/media/logo.png +0 -0
  199. package/project/public/vite.svg +0 -1
  200. package/project/routes.jsx +0 -47
  201. package/project/server/mock.json +0 -110
  202. package/project/server/oauthMock.js +0 -27
  203. package/project/server/package-lock.json +0 -1505
  204. package/project/server/package.json +0 -20
  205. package/project/server/server.js +0 -127
  206. package/project/src/Container.jsx +0 -7
  207. package/project/src/components/ActionButton.jsx +0 -18
  208. package/project/src/hooks/useEmperor.jsx +0 -21
  209. package/project/src/http/index.js +0 -39
  210. package/project/src/main.jsx +0 -10
  211. package/project/src/pages/Battles.jsx +0 -16
  212. package/project/src/pages/Emperor.jsx +0 -50
  213. package/project/src/pages/index.jsx +0 -33
  214. package/project/src/theme.js +0 -151
  215. package/project/src/widgets/ActionButton.jsx +0 -68
  216. package/project/src/widgets/AddNewEmperor.jsx +0 -120
  217. package/project/src/widgets/ProjectContainer.jsx +0 -27
  218. package/project/vite.config.js +0 -6
  219. package/project/vite.config.js.timestamp-1709564450418-45fdd27900806.mjs +0 -341
  220. package/src/layouts/MainLayout/footer.jsx +0 -153
@@ -0,0 +1,304 @@
1
+ import type { StoredSession } from "./types";
2
+ import { alpha } from "@mui/material/styles";
3
+ import { cleanIconName } from "./cleanIconName";
4
+ import { publish } from "@nucleoidai/react-event";
5
+
6
+ import { Badge, Box, Tooltip, Typography } from "@mui/material";
7
+ import { DevTool, Iconify } from "@canmingir/link/platform/components";
8
+ import React, { memo } from "react";
9
+
10
+ interface SidebarSessionListProps {
11
+ sessions: StoredSession[];
12
+ currentSessionId?: string;
13
+ unreadCount: number;
14
+ onToggleChat: () => void;
15
+ onSessionClick: (
16
+ event: React.MouseEvent<HTMLElement>,
17
+ sessionId: string
18
+ ) => void;
19
+ onClearAll: () => void;
20
+ onNewSession?: () => void;
21
+ wrapperRef?: React.Ref<HTMLDivElement>;
22
+ beta?: boolean;
23
+ }
24
+
25
+ const btnBase = {
26
+ width: 32,
27
+ height: 32,
28
+ borderRadius: "10px",
29
+ display: "flex",
30
+ alignItems: "center",
31
+ justifyContent: "center",
32
+ alignSelf: "center",
33
+ flexDirection: "column",
34
+ cursor: "pointer",
35
+ flexShrink: 0,
36
+ transition: "all 0.18s ease",
37
+ border: "1px solid transparent",
38
+ };
39
+
40
+ const SidebarSessionList = ({
41
+ sessions,
42
+ currentSessionId,
43
+ unreadCount,
44
+ onToggleChat,
45
+ onSessionClick,
46
+ onClearAll,
47
+ onNewSession,
48
+ wrapperRef,
49
+ beta,
50
+ }: SidebarSessionListProps) => {
51
+ const sidebarSessions = sessions;
52
+
53
+ const header = (
54
+ <>
55
+ <Tooltip
56
+ title="New Chat"
57
+ placement="left"
58
+ enterDelay={1000}
59
+ enterNextDelay={1000}
60
+ >
61
+ <Box
62
+ onClick={() => {
63
+ onNewSession?.();
64
+ onToggleChat();
65
+ }}
66
+ sx={{
67
+ ...btnBase,
68
+ flexDirection: "column",
69
+ gap: 0.5,
70
+ mb: 0.5,
71
+ color: "text.secondary",
72
+ "&:hover": {
73
+ color: "primary.main",
74
+ bgcolor: (theme) => alpha(theme.palette.primary.main, 0.12),
75
+ borderColor: (theme) => alpha(theme.palette.primary.main, 0.2),
76
+ transform: "scale(1.08)",
77
+ },
78
+ }}
79
+ >
80
+ <Iconify
81
+ icon="solar:add-square-bold-duotone"
82
+ sx={{ width: 20, height: 20 }}
83
+ />
84
+ <Typography
85
+ sx={{
86
+ fontSize: "0.5rem",
87
+ fontWeight: 500,
88
+ letterSpacing: 0.5,
89
+ lineHeight: 1,
90
+ textTransform: "capitalize",
91
+ }}
92
+ >
93
+ New
94
+ </Typography>
95
+ </Box>
96
+ </Tooltip>
97
+
98
+ {!beta && (
99
+ <Tooltip
100
+ title="Open API"
101
+ placement="left"
102
+ enterDelay={1000}
103
+ enterNextDelay={1000}
104
+ >
105
+ <Box
106
+ onClick={() => publish("SWAGGER_DIALOG_OPEN", { open: true })}
107
+ sx={{
108
+ ...btnBase,
109
+ flexDirection: "column",
110
+ gap: 0.5,
111
+ mb: 1,
112
+ color: "text.secondary",
113
+ "&:hover": {
114
+ bgcolor: (theme) =>
115
+ theme.palette.mode === "dark"
116
+ ? "rgba(255,255,255,0.1)"
117
+ : "rgba(0,0,0,0.08)",
118
+ transform: "scale(1.08)",
119
+ },
120
+ }}
121
+ >
122
+ <Iconify
123
+ icon="logos:swagger"
124
+ sx={{ width: 20, height: 20, transition: "all 0.2s ease-in-out" }}
125
+ />
126
+ <Typography
127
+ sx={{
128
+ fontSize: "0.5rem",
129
+ fontWeight: 500,
130
+ letterSpacing: 0.5,
131
+ lineHeight: 1,
132
+ textTransform: "capitalize",
133
+ }}
134
+ >
135
+ API
136
+ </Typography>
137
+ </Box>
138
+ </Tooltip>
139
+ )}
140
+ </>
141
+ );
142
+
143
+ const content = (
144
+ <Box
145
+ ref={wrapperRef}
146
+ sx={{
147
+ display: "flex",
148
+ flexDirection: "column",
149
+ alignItems: "center",
150
+ gap: 1,
151
+ width: "100%",
152
+ py: 1,
153
+ }}
154
+ >
155
+ {sidebarSessions.map((session, idx) => {
156
+ const isCurrent = session.sessionId === currentSessionId;
157
+ const sessionNum = idx + 1;
158
+ const hasUnread = isCurrent && unreadCount > 0;
159
+
160
+ return (
161
+ <Tooltip
162
+ key={session.sessionId}
163
+ title={
164
+ hasUnread
165
+ ? `${unreadCount} new · message${unreadCount !== 1 ? "s" : ""}`
166
+ : `${session.messages.length} message${
167
+ session.messages.length !== 1 ? "s" : ""
168
+ }`
169
+ }
170
+ placement="left"
171
+ enterDelay={1000}
172
+ enterNextDelay={1000}
173
+ >
174
+ <Box
175
+ onClick={(e) => onSessionClick(e, session.sessionId)}
176
+ sx={{
177
+ ...btnBase,
178
+ flexDirection: "column",
179
+ gap: 0.4,
180
+ color: isCurrent ? "primary.main" : "text.secondary",
181
+ borderColor: isCurrent
182
+ ? (theme) => alpha(theme.palette.primary.main, 0.28)
183
+ : "transparent",
184
+ boxShadow: isCurrent
185
+ ? (theme) =>
186
+ `0 0 0 1px ${alpha(theme.palette.primary.main, 0.2)}`
187
+ : "none",
188
+ "&:hover": {
189
+ bgcolor: isCurrent
190
+ ? (theme) => alpha(theme.palette.primary.main, 0.2)
191
+ : (theme) =>
192
+ theme.palette.mode === "dark"
193
+ ? "rgba(255,255,255,0.1)"
194
+ : "rgba(0,0,0,0.08)",
195
+ transform: "scale(1.08)",
196
+ },
197
+ }}
198
+ >
199
+ <Badge
200
+ badgeContent={hasUnread ? unreadCount : 0}
201
+ color="error"
202
+ max={9}
203
+ sx={{
204
+ "& .MuiBadge-badge": {
205
+ fontSize: "0.55rem",
206
+ minWidth: 14,
207
+ height: 14,
208
+ padding: "0 3px",
209
+ transform: "scale(0.85) translate(25%, -25%)",
210
+ transition: "all 0.2s ease",
211
+ },
212
+ }}
213
+ >
214
+ <Box
215
+ sx={{
216
+ width: 20,
217
+ height: 20,
218
+ borderRadius: "7px",
219
+ display: "flex",
220
+ alignItems: "center",
221
+ justifyContent: "center",
222
+ transition: "all 0.2s ease-in-out",
223
+ bgcolor: (theme) =>
224
+ isCurrent
225
+ ? alpha(theme.palette.primary.main, 0.2)
226
+ : alpha(theme.palette.text.secondary, 0.1),
227
+ }}
228
+ >
229
+ {session.agentIcon ? (
230
+ <Iconify
231
+ icon={cleanIconName(session.agentIcon)}
232
+ sx={{ width: 15, height: 15 }}
233
+ />
234
+ ) : (
235
+ <Typography
236
+ sx={{
237
+ fontSize: "0.65rem",
238
+ fontWeight: 800,
239
+ lineHeight: 1,
240
+ }}
241
+ >
242
+ {sessionNum}
243
+ </Typography>
244
+ )}
245
+ </Box>
246
+ </Badge>
247
+
248
+ <Typography
249
+ sx={{
250
+ fontSize: "0.55rem",
251
+ fontWeight: 700,
252
+ lineHeight: 1,
253
+ letterSpacing: 0.3,
254
+ }}
255
+ >
256
+ {`Ses. ${sessionNum}`}
257
+ </Typography>
258
+ </Box>
259
+ </Tooltip>
260
+ );
261
+ })}
262
+ </Box>
263
+ );
264
+
265
+ const footer = (
266
+ <Tooltip
267
+ title={sidebarSessions.length > 0 ? "Clear all sessions" : "No sessions"}
268
+ placement="left"
269
+ >
270
+ <Box
271
+ onClick={sidebarSessions.length > 0 ? onClearAll : undefined}
272
+ sx={{
273
+ ...btnBase,
274
+ color: "text.disabled",
275
+ bgcolor: "transparent",
276
+ opacity: sidebarSessions.length > 0 ? 1 : 0.4,
277
+ cursor: sidebarSessions.length > 0 ? "pointer" : "not-allowed",
278
+ ...(sidebarSessions.length > 0 && {
279
+ "&:hover": {
280
+ bgcolor: (theme) => alpha(theme.palette.error.main, 0.1),
281
+ color: "error.main",
282
+ borderColor: (theme) => alpha(theme.palette.error.main, 0.2),
283
+ transform: "scale(1.08)",
284
+ },
285
+ }),
286
+ }}
287
+ >
288
+ <Iconify icon="solar:trash-bin-2-bold" sx={{ width: 18, height: 18 }} />
289
+ </Box>
290
+ </Tooltip>
291
+ );
292
+
293
+ return (
294
+ <DevTool
295
+ width={45}
296
+ height={310}
297
+ header={header}
298
+ content={content}
299
+ footer={footer}
300
+ />
301
+ );
302
+ };
303
+
304
+ export default memo(SidebarSessionList);
@@ -0,0 +1,4 @@
1
+ declare module "*.mp3" {
2
+ const src: string;
3
+ export default src;
4
+ }
@@ -0,0 +1,4 @@
1
+ export const cleanIconName = (icon?: string) => {
2
+ if (!icon) return "";
3
+ return icon.replace(/^:+|:+$/g, "");
4
+ };
@@ -0,0 +1 @@
1
+ export { default } from "./SidebarChat";
@@ -0,0 +1,14 @@
1
+ export interface Message {
2
+ id?: string;
3
+ content: string;
4
+ role: string;
5
+ }
6
+
7
+ export interface StoredSession {
8
+ sessionId: string;
9
+ agentId?: string;
10
+ messages: Message[];
11
+ lastUpdated: number;
12
+ agentIcon?: string;
13
+ agentName?: string;
14
+ }
package/src/lib/index.js CHANGED
@@ -56,3 +56,14 @@ export {
56
56
  GlassCardActions,
57
57
  } from "./GlassCard/GlassCard";
58
58
  export { default as DevTool } from "./DevTool";
59
+
60
+ export { default as SidebarChat } from "./SidebarChat/SidebarChat";
61
+ export { default as PresetSelector } from "./PresetSelector/PresetSelector";
62
+ export {
63
+ AIMessage,
64
+ ErrorMessage,
65
+ HumanMessage,
66
+ LoadingMessage,
67
+ MessageList,
68
+ ToolMessage,
69
+ } from "./ChatMessage";
package/src/pages/404.jsx CHANGED
@@ -2,8 +2,6 @@ import { Helmet } from "react-helmet-async";
2
2
  import { NotFoundView } from "../widgets/error";
3
3
  import React from "react";
4
4
 
5
- // ----------------------------------------------------------------------
6
-
7
5
  export default function NotFoundPage() {
8
6
  return (
9
7
  <>
@@ -2,8 +2,6 @@ import { Link } from "react-router-dom";
2
2
  import React from "react";
3
3
  import { forwardRef } from "react";
4
4
 
5
- // ----------------------------------------------------------------------
6
-
7
5
  const RouterLink = forwardRef(({ href, ...other }, ref) => (
8
6
  <Link ref={ref} to={href} {...other} />
9
7
  ));
@@ -1,7 +1,5 @@
1
1
  import { matchPath, useLocation } from "react-router-dom";
2
2
 
3
- // ----------------------------------------------------------------------
4
-
5
3
  export function useActiveLink(path, deep = true) {
6
4
  const { pathname } = useLocation();
7
5
 
@@ -1,8 +1,6 @@
1
1
  import { useLocation } from "react-router-dom";
2
2
  import { useMemo } from "react";
3
3
 
4
- // ----------------------------------------------------------------------
5
-
6
4
  export function usePathname() {
7
5
  const { pathname } = useLocation();
8
6
 
@@ -1,8 +1,6 @@
1
1
  import { useMemo } from "react";
2
2
  import { useNavigate } from "react-router-dom";
3
3
 
4
- // ----------------------------------------------------------------------
5
-
6
4
  export function useRouter() {
7
5
  const navigate = useNavigate();
8
6
 
package/src/theme/css.js CHANGED
@@ -4,8 +4,6 @@ import { checkboxClasses } from "@mui/material/Checkbox";
4
4
  import { dividerClasses } from "@mui/material/Divider";
5
5
  import { menuItemClasses } from "@mui/material/MenuItem";
6
6
 
7
- // ----------------------------------------------------------------------
8
-
9
7
  export const paper = ({ theme, bgcolor, dropdown }) => ({
10
8
  ...bgBlur({
11
9
  blur: 20,
@@ -29,8 +27,6 @@ export const paper = ({ theme, bgcolor, dropdown }) => ({
29
27
  }),
30
28
  });
31
29
 
32
- // ----------------------------------------------------------------------
33
-
34
30
  export const menuItem = (theme) => ({
35
31
  ...theme.typography.body2,
36
32
  padding: theme.spacing(0.75, 1),
@@ -61,8 +57,6 @@ export const menuItem = (theme) => ({
61
57
  },
62
58
  });
63
59
 
64
- // ----------------------------------------------------------------------
65
-
66
60
  export function bgBlur(props) {
67
61
  const color = props?.color || "#000000";
68
62
  const blur = props?.blur || 6;
@@ -95,8 +89,6 @@ export function bgBlur(props) {
95
89
  };
96
90
  }
97
91
 
98
- // ----------------------------------------------------------------------
99
-
100
92
  export function bgGradient(props) {
101
93
  const direction = props?.direction || "to bottom";
102
94
  const startColor = props?.startColor;
@@ -120,8 +112,6 @@ export function bgGradient(props) {
120
112
  };
121
113
  }
122
114
 
123
- // ----------------------------------------------------------------------
124
-
125
115
  export function textGradient(value) {
126
116
  return {
127
117
  background: `-webkit-linear-gradient(${value})`,
@@ -130,8 +120,6 @@ export function textGradient(value) {
130
120
  };
131
121
  }
132
122
 
133
- // ----------------------------------------------------------------------
134
-
135
123
  export const hideScroll = {
136
124
  x: {
137
125
  msOverflowStyle: "none",
@@ -11,8 +11,6 @@ import {
11
11
  warning,
12
12
  } from "./palette";
13
13
 
14
- // ----------------------------------------------------------------------
15
-
16
14
  export function customShadows(mode) {
17
15
  const color = mode === "light" ? grey[500] : common.black;
18
16
 
@@ -1,8 +1,6 @@
1
1
  import { customShadows } from "../custom-shadows";
2
2
  import { grey } from "../palette";
3
3
 
4
- // ----------------------------------------------------------------------
5
-
6
4
  export function createContrast(contrast, mode) {
7
5
  const theme = {
8
6
  ...(contrast === "bold" &&
@@ -2,8 +2,6 @@ import { alpha } from "@mui/material/styles";
2
2
 
3
3
  import { grey, primary } from "../palette";
4
4
 
5
- // ----------------------------------------------------------------------
6
-
7
5
  export function createPresets(preset) {
8
6
  const primaryColor = getPrimary(preset);
9
7
 
@@ -21,8 +19,6 @@ export function createPresets(preset) {
21
19
  };
22
20
  }
23
21
 
24
- // ----------------------------------------------------------------------
25
-
26
22
  const cyan = {
27
23
  lighter: "#CCF4FE",
28
24
  light: "#68CDF9",
@@ -4,8 +4,6 @@ import createCache from "@emotion/cache";
4
4
  import rtlPlugin from "stylis-plugin-rtl";
5
5
  import { useEffect } from "react";
6
6
 
7
- // ----------------------------------------------------------------------
8
-
9
7
  export default function RTL({ children, themeDirection }) {
10
8
  useEffect(() => {
11
9
  document.dir = themeDirection;
@@ -2,8 +2,6 @@ import { accordionClasses } from "@mui/material/Accordion";
2
2
  import { accordionSummaryClasses } from "@mui/material/AccordionSummary";
3
3
  import { typographyClasses } from "@mui/material/Typography";
4
4
 
5
- // ----------------------------------------------------------------------
6
-
7
5
  export function accordion(theme) {
8
6
  return {
9
7
  MuiAccordion: {
@@ -1,12 +1,8 @@
1
1
  import { alertClasses } from "@mui/material/Alert";
2
2
  import { alpha } from "@mui/material/styles";
3
3
 
4
- // ----------------------------------------------------------------------
5
-
6
4
  const COLORS = ["info", "success", "warning", "error"];
7
5
 
8
- // ----------------------------------------------------------------------
9
-
10
6
  export function alert(theme) {
11
7
  const lightMode = theme.palette.mode === "light";
12
8
 
@@ -1,5 +1,3 @@
1
- // ----------------------------------------------------------------------
2
-
3
1
  export function appBar(theme) {
4
2
  return {
5
3
  MuiAppBar: {
@@ -4,8 +4,6 @@ import { svgIconClasses } from "@mui/material/SvgIcon";
4
4
 
5
5
  import { menuItem, paper } from "../../css";
6
6
 
7
- // ----------------------------------------------------------------------
8
-
9
7
  export function autocomplete(theme) {
10
8
  return {
11
9
  MuiAutocomplete: {
@@ -1,8 +1,6 @@
1
1
  import { alpha } from "@mui/material/styles";
2
2
  import { avatarGroupClasses } from "@mui/material/AvatarGroup";
3
3
 
4
- // ----------------------------------------------------------------------
5
-
6
4
  const COLORS = [
7
5
  "default",
8
6
  "primary",
@@ -25,8 +23,6 @@ const colorByName = (name) => {
25
23
  return "default";
26
24
  };
27
25
 
28
- // ----------------------------------------------------------------------
29
-
30
26
  export function avatar(theme) {
31
27
  return {
32
28
  MuiAvatar: {
@@ -1,7 +1,5 @@
1
1
  import { alpha } from "@mui/material/styles";
2
2
 
3
- // ----------------------------------------------------------------------
4
-
5
3
  export function backdrop(theme) {
6
4
  return {
7
5
  MuiBackdrop: {
@@ -1,7 +1,5 @@
1
1
  import { badgeClasses } from "@mui/material/Badge";
2
2
 
3
- // ----------------------------------------------------------------------
4
-
5
3
  export function badge(theme) {
6
4
  return {
7
5
  MuiBadge: {
@@ -1,5 +1,3 @@
1
- // ----------------------------------------------------------------------
2
-
3
1
  export function breadcrumbs(theme) {
4
2
  return {
5
3
  MuiBreadcrumbs: {
@@ -1,12 +1,8 @@
1
1
  import { alpha } from "@mui/material/styles";
2
2
  import { buttonGroupClasses } from "@mui/material/ButtonGroup";
3
3
 
4
- // ----------------------------------------------------------------------
5
-
6
4
  const COLORS = ["primary", "secondary", "info", "success", "warning", "error"];
7
5
 
8
- // ----------------------------------------------------------------------
9
-
10
6
  export function buttonGroup(theme) {
11
7
  const rootStyles = (ownerState) => {
12
8
  const inheritColor = ownerState.color === "inherit";
@@ -1,12 +1,8 @@
1
1
  import { alpha } from "@mui/material/styles";
2
2
  import { buttonClasses } from "@mui/material/Button";
3
3
 
4
- // ----------------------------------------------------------------------
5
-
6
4
  const COLORS = ["primary", "secondary", "info", "success", "warning", "error"];
7
5
 
8
- // ----------------------------------------------------------------------
9
-
10
6
  export function button(theme) {
11
7
  const lightMode = theme.palette.mode === "light";
12
8
 
@@ -1,5 +1,3 @@
1
- // ----------------------------------------------------------------------
2
-
3
1
  export function card(theme) {
4
2
  return {
5
3
  MuiCard: {
@@ -1,5 +1,3 @@
1
- // ----------------------------------------------------------------------
2
-
3
1
  export function checkbox(theme) {
4
2
  return {
5
3
  MuiCheckbox: {
@@ -1,12 +1,8 @@
1
1
  import { alpha } from "@mui/material/styles";
2
2
  import { chipClasses } from "@mui/material/Chip";
3
3
 
4
- // ----------------------------------------------------------------------
5
-
6
4
  const COLORS = ["primary", "secondary", "info", "success", "warning", "error"];
7
5
 
8
- // ----------------------------------------------------------------------
9
-
10
6
  export function chip(theme) {
11
7
  const lightMode = theme.palette.mode === "light";
12
8
 
@@ -1,5 +1,3 @@
1
- // ----------------------------------------------------------------------
2
-
3
1
  export function cssBaseline(theme) {
4
2
  return {
5
3
  MuiCssBaseline: {
@@ -6,8 +6,6 @@ import { paper } from "../../css";
6
6
  import { paperClasses } from "@mui/material/Paper";
7
7
  import { tablePaginationClasses } from "@mui/material/TablePagination";
8
8
 
9
- // ----------------------------------------------------------------------
10
-
11
9
  export function dataGrid(theme) {
12
10
  const paperStyles = paper({ theme, dropdown: true });
13
11
 
@@ -2,8 +2,6 @@ import Iconify from "../../../components/Iconify";
2
2
  import React from "react";
3
3
  import { buttonClasses } from "@mui/material/Button";
4
4
 
5
- // ----------------------------------------------------------------------
6
-
7
5
  const dateList = [
8
6
  "DatePicker",
9
7
  "DateTimePicker",
@@ -1,5 +1,3 @@
1
- // ----------------------------------------------------------------------
2
-
3
1
  export function dialog(theme) {
4
2
  return {
5
3
  MuiDialog: {