impact-ui 5.0.4-alpha.3 → 5.0.4-chatbot.2

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 (182) hide show
  1. package/dist/_virtual/ArrowBack.js +4 -0
  2. package/dist/_virtual/AttachFileOutlined.js +4 -0
  3. package/dist/_virtual/ContentCopyOutlined.js +4 -0
  4. package/dist/_virtual/Menu.js +4 -0
  5. package/dist/_virtual/NorthRounded.js +4 -0
  6. package/dist/_virtual/RefreshOutlined.js +4 -0
  7. package/dist/_virtual/StopRounded.js +4 -0
  8. package/dist/_virtual/VolumeUpOutlined.js +4 -0
  9. package/dist/_virtual/index2.js +2 -2
  10. package/dist/_virtual/index3.js +2 -2
  11. package/dist/components/AccordionModern/index.js +1 -1
  12. package/dist/components/Badge/index.js +1 -1
  13. package/dist/components/Breadcrumbs/index.js +1 -1
  14. package/dist/components/Button/index.js +1 -1
  15. package/dist/components/ButtonGroup/index.js +1 -1
  16. package/dist/components/Chatbot/Chatbot.types.d.ts +253 -186
  17. package/dist/components/Chatbot/Chatbot.types.d.ts.map +1 -1
  18. package/dist/components/Chatbot/chatBotFooter.d.ts +1 -1
  19. package/dist/components/Chatbot/chatBotFooter.d.ts.map +1 -1
  20. package/dist/components/Chatbot/chatBotFooter.js +21 -4
  21. package/dist/components/Chatbot/chatbotComposer.d.ts +4 -0
  22. package/dist/components/Chatbot/chatbotComposer.d.ts.map +1 -0
  23. package/dist/components/Chatbot/chatbotComposer.js +328 -0
  24. package/dist/components/Chatbot/chatbotGreetingHeader.d.ts +4 -0
  25. package/dist/components/Chatbot/chatbotGreetingHeader.d.ts.map +1 -0
  26. package/dist/components/Chatbot/chatbotGreetingHeader.js +226 -0
  27. package/dist/components/Chatbot/greetingWeather.d.ts +23 -0
  28. package/dist/components/Chatbot/greetingWeather.d.ts.map +1 -0
  29. package/dist/components/Chatbot/greetingWeather.js +81 -0
  30. package/dist/components/Chatbot/greetingWeather.test.d.ts +2 -0
  31. package/dist/components/Chatbot/greetingWeather.test.d.ts.map +1 -0
  32. package/dist/components/Chatbot/index.d.ts +5 -2
  33. package/dist/components/Chatbot/index.d.ts.map +1 -1
  34. package/dist/components/Chatbot/index.js +390 -421
  35. package/dist/components/Chatbot/irisConversationThread.d.ts +24 -0
  36. package/dist/components/Chatbot/irisConversationThread.d.ts.map +1 -0
  37. package/dist/components/Chatbot/irisConversationThread.js +511 -0
  38. package/dist/components/Chatbot/irisGreetingBackdrop.d.ts +5 -0
  39. package/dist/components/Chatbot/irisGreetingBackdrop.d.ts.map +1 -0
  40. package/dist/components/Chatbot/irisGreetingBackdrop.js +62 -0
  41. package/dist/components/Chatbot/irisMenuListItem.d.ts +11 -0
  42. package/dist/components/Chatbot/irisMenuListItem.d.ts.map +1 -0
  43. package/dist/components/Chatbot/irisMenuListItem.js +126 -0
  44. package/dist/components/Chatbot/irisMenuScreen.d.ts +4 -0
  45. package/dist/components/Chatbot/irisMenuScreen.d.ts.map +1 -0
  46. package/dist/components/Chatbot/irisMenuScreen.js +357 -0
  47. package/dist/components/Chatbot/irisThinking.d.ts +7 -0
  48. package/dist/components/Chatbot/irisThinking.d.ts.map +1 -0
  49. package/dist/components/Chatbot/irisThinking.js +219 -0
  50. package/dist/components/Chatbot/newChatComponent.d.ts +1 -1
  51. package/dist/components/Chatbot/newChatComponent.d.ts.map +1 -1
  52. package/dist/components/Chatbot/newChatComponent.js +497 -72
  53. package/dist/components/Chips/index.js +1 -1
  54. package/dist/components/CommentsPanel/CommentsPanel.impl.js +1 -1
  55. package/dist/components/DatePicker/DatePicker.types.d.ts +0 -4
  56. package/dist/components/DatePicker/DatePicker.types.d.ts.map +1 -1
  57. package/dist/components/DatePicker/datePickerInput.d.ts +0 -2
  58. package/dist/components/DatePicker/datePickerInput.d.ts.map +1 -1
  59. package/dist/components/DatePicker/datePickerInput.js +2 -32
  60. package/dist/components/DatePicker/index.d.ts.map +1 -1
  61. package/dist/components/DatePicker/index.js +1 -5
  62. package/dist/components/DatePicker/showMonthYearSelect.d.ts.map +1 -1
  63. package/dist/components/DatePicker/showMonthYearSelect.js +0 -2
  64. package/dist/components/DateRangePicker/index.js +1 -1
  65. package/dist/components/DateRangePicker/showMonthYearSelect.d.ts.map +1 -1
  66. package/dist/components/DateRangePicker/showMonthYearSelect.js +0 -2
  67. package/dist/components/FileUpload/index.js +1 -1
  68. package/dist/components/FilterPanel/index.js +1 -1
  69. package/dist/components/FiltersStrip/FilterSlider.js +1 -1
  70. package/dist/components/FiltersStrip/index.js +1 -1
  71. package/dist/components/Input/index.js +1 -1
  72. package/dist/components/KeyboardShortCuts/ShortcutLandingPage.js +1 -1
  73. package/dist/components/KeyboardShortCuts/ShortcutModal.js +1 -1
  74. package/dist/components/KeyboardShortCuts/allSetBox.js +1 -1
  75. package/dist/components/KeyboardShortCuts/index.js +1 -1
  76. package/dist/components/KeyboardShortCuts/tutorial.js +1 -1
  77. package/dist/components/Menu/IconMenuItem.js +1 -1
  78. package/dist/components/Menu/NestedMenuItem.js +1 -1
  79. package/dist/components/Menu/index.js +1 -1
  80. package/dist/components/Menu/nestedMenuItemsFromObject.js +1 -1
  81. package/dist/components/Modal/index.js +1 -1
  82. package/dist/components/MonthPicker/index.js +1 -1
  83. package/dist/components/MonthRangePicker/index.js +1 -1
  84. package/dist/components/NewCreateItemFlow/index.js +1 -1
  85. package/dist/components/NewDynamicLayout/index.js +1 -1
  86. package/dist/components/OnboardingTour/index.js +1 -1
  87. package/dist/components/OnboardingTour/productTourList.js +1 -1
  88. package/dist/components/OnboardingTour/tooltipCard.js +1 -1
  89. package/dist/components/Panel/index.js +1 -1
  90. package/dist/components/Popover/index.js +1 -1
  91. package/dist/components/Prompt/index.js +1 -1
  92. package/dist/components/Select/Select.types.d.ts +0 -7
  93. package/dist/components/Select/Select.types.d.ts.map +1 -1
  94. package/dist/components/Select/index.d.ts.map +1 -1
  95. package/dist/components/Select/index.js +26 -44
  96. package/dist/components/Stepper/index.js +1 -1
  97. package/dist/components/TableChat/EmptyContainer.js +1 -1
  98. package/dist/components/TableChat/TableChatSidePanel.js +1 -1
  99. package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +1 -1
  100. package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.js +1 -1
  101. package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +1 -1
  102. package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +1 -1
  103. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +1 -1
  104. package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +1 -1
  105. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +1 -1
  106. package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.js +1 -1
  107. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +1 -1
  108. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +1 -1
  109. package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +1 -1
  110. package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +1 -1
  111. package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +1 -1
  112. package/dist/components/TableChat/components/TextEditor/Mention.js +1 -1
  113. package/dist/components/TableChat/components/TextEditor/MentionList.js +1 -1
  114. package/dist/components/TableV36/AgGridHeader.d.ts.map +1 -1
  115. package/dist/components/TableV36/AgGridHeader.js +115 -107
  116. package/dist/components/TableV36/index.js +1 -1
  117. package/dist/components/Tag/index.js +1 -1
  118. package/dist/components/TextArea/index.js +1 -1
  119. package/dist/components/common/MentionEditor/MentionList/index.js +1 -1
  120. package/dist/components/common/MentionEditor/index.js +1 -1
  121. package/dist/components/index.d.ts +3 -2
  122. package/dist/components/index.d.ts.map +1 -1
  123. package/dist/components/index.js +3 -0
  124. package/dist/hooks/useDraggableResizable.d.ts +11 -1
  125. package/dist/hooks/useDraggableResizable.d.ts.map +1 -1
  126. package/dist/hooks/useDraggableResizable.js +73 -59
  127. package/dist/locales/de-DE.json.d.ts +50 -30
  128. package/dist/locales/de-DE.json.js +50 -30
  129. package/dist/locales/en-US.json.d.ts +50 -30
  130. package/dist/locales/en-US.json.js +50 -30
  131. package/dist/locales/es-ES.json.d.ts +50 -30
  132. package/dist/locales/es-ES.json.js +50 -30
  133. package/dist/mcp-component-registry.json +65 -263
  134. package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +43 -15
  135. package/dist/node_modules/@mui/icons-material/ArrowBack.js +17 -0
  136. package/dist/node_modules/@mui/icons-material/AttachFileOutlined.js +17 -0
  137. package/dist/node_modules/@mui/icons-material/ContentCopyOutlined.js +17 -0
  138. package/dist/node_modules/@mui/icons-material/Menu.js +17 -0
  139. package/dist/node_modules/@mui/icons-material/NorthRounded.js +17 -0
  140. package/dist/node_modules/@mui/icons-material/RefreshOutlined.js +17 -0
  141. package/dist/node_modules/@mui/icons-material/StopRounded.js +17 -0
  142. package/dist/node_modules/@mui/icons-material/VolumeUpOutlined.js +17 -0
  143. package/dist/node_modules/prop-types/index.js +1 -1
  144. package/dist/node_modules/react-is/index.js +1 -1
  145. package/dist/stories/chatBotApiMock.d.ts +91 -0
  146. package/dist/stories/chatBotApiMock.d.ts.map +1 -0
  147. package/dist/styles/style.css +1 -1
  148. package/package.json +2 -2
  149. package/dist/_virtual/MoreVert.js +0 -4
  150. package/dist/_virtual/RemoveRounded.js +0 -4
  151. package/dist/_virtual/SaveOutlined.js +0 -4
  152. package/dist/components/Chatbot/bookMarkPanel.d.ts +0 -4
  153. package/dist/components/Chatbot/bookMarkPanel.d.ts.map +0 -1
  154. package/dist/components/Chatbot/bookMarkPanel.js +0 -64
  155. package/dist/components/Chatbot/chatBotLandingScreen.d.ts +0 -4
  156. package/dist/components/Chatbot/chatBotLandingScreen.d.ts.map +0 -1
  157. package/dist/components/Chatbot/chatBotLandingScreen.js +0 -24
  158. package/dist/components/Chatbot/chatInput.d.ts +0 -4
  159. package/dist/components/Chatbot/chatInput.d.ts.map +0 -1
  160. package/dist/components/Chatbot/chatInput.js +0 -198
  161. package/dist/components/Chatbot/chatbotModuleMenu.d.ts +0 -4
  162. package/dist/components/Chatbot/chatbotModuleMenu.d.ts.map +0 -1
  163. package/dist/components/Chatbot/chatbotModuleMenu.js +0 -248
  164. package/dist/components/Chatbot/constant.d.ts +0 -6
  165. package/dist/components/Chatbot/constant.d.ts.map +0 -1
  166. package/dist/components/Chatbot/constant.js +0 -27
  167. package/dist/components/Chatbot/conversationScreen.d.ts +0 -4
  168. package/dist/components/Chatbot/conversationScreen.d.ts.map +0 -1
  169. package/dist/components/Chatbot/conversationScreen.js +0 -207
  170. package/dist/components/Chatbot/customScreen.d.ts +0 -4
  171. package/dist/components/Chatbot/customScreen.d.ts.map +0 -1
  172. package/dist/components/Chatbot/customScreen.js +0 -66
  173. package/dist/components/Chatbot/historyPanel.d.ts +0 -4
  174. package/dist/components/Chatbot/historyPanel.d.ts.map +0 -1
  175. package/dist/components/Chatbot/historyPanel.js +0 -374
  176. package/dist/components/Chatbot/utils.d.ts +0 -5
  177. package/dist/components/Chatbot/utils.d.ts.map +0 -1
  178. package/dist/components/Chatbot/utils.js +0 -29
  179. package/dist/node_modules/@mui/icons-material/MoreVert.js +0 -17
  180. package/dist/node_modules/@mui/icons-material/RemoveRounded.js +0 -17
  181. package/dist/node_modules/@mui/icons-material/SaveOutlined.js +0 -17
  182. package/dist/utils/onResize.js +0 -28
@@ -1,374 +0,0 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { useMemo, useState, useRef, useEffect } from "react";
3
- import { getAssetUrl } from "../../utils/assetBase.js";
4
- import { Skeleton } from "../Skeleton/index.js";
5
- import { useTranslation } from "../../i18n/useTranslation.js";
6
- const CloseIcon = getAssetUrl("icons/close.svg");
7
- const ACTION_LABEL_KEYS = {
8
- share: "chatBot.history.share",
9
- rename: "chatBot.history.rename",
10
- pin: "chatBot.history.pin",
11
- unpin: "chatBot.history.unpin",
12
- delete: "chatBot.history.delete"
13
- };
14
- function HistoryPanelSkeletonRow() {
15
- return /* @__PURE__ */ jsx(Skeleton, { className: "history-panel-skeleton-item", height: 42, variant: "rounded", width: "100%" });
16
- }
17
- function HistoryPanelSkeletonGroupLabel() {
18
- return /* @__PURE__ */ jsx(Skeleton, { className: "history-panel-skeleton-label", height: 16, variant: "rounded", width: "35%" });
19
- }
20
- function HistoryPanelSkeleton() {
21
- return /* @__PURE__ */ jsxs(
22
- "div",
23
- {
24
- "aria-busy": "true",
25
- "aria-live": "polite",
26
- className: "history-panel-skeleton",
27
- "data-testid": "history-panel-skeleton",
28
- children: [
29
- /* @__PURE__ */ jsxs("div", { className: "history-panel-skeleton-pinned", children: [
30
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {}),
31
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {})
32
- ] }),
33
- /* @__PURE__ */ jsxs("div", { className: "history-panel-skeleton-group-block", children: [
34
- /* @__PURE__ */ jsx(HistoryPanelSkeletonGroupLabel, {}),
35
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {}),
36
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {}),
37
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {})
38
- ] }),
39
- /* @__PURE__ */ jsxs("div", { className: "history-panel-skeleton-group-block", children: [
40
- /* @__PURE__ */ jsx(HistoryPanelSkeletonGroupLabel, {}),
41
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {}),
42
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {}),
43
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {})
44
- ] }),
45
- /* @__PURE__ */ jsxs("div", { className: "history-panel-skeleton-group-block", children: [
46
- /* @__PURE__ */ jsx(HistoryPanelSkeletonGroupLabel, {}),
47
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {}),
48
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {}),
49
- /* @__PURE__ */ jsx(HistoryPanelSkeletonRow, {})
50
- ] })
51
- ]
52
- }
53
- );
54
- }
55
- function HistoryPanel({
56
- historyPanelData = [],
57
- isConversationLoading = false,
58
- onClose,
59
- onSearchChange,
60
- onSelectConversation,
61
- onToggleGroup,
62
- openGroups,
63
- onMenuAction,
64
- activeConversationId
65
- }) {
66
- const { t } = useTranslation();
67
- const baseGroups = useMemo(() => {
68
- if (Array.isArray(historyPanelData)) return historyPanelData;
69
- return historyPanelData.groups || [];
70
- }, [historyPanelData]);
71
- const pinnedItems = useMemo(() => {
72
- const fromObject = !Array.isArray(historyPanelData) && Array.isArray(historyPanelData.pinned) ? historyPanelData.pinned : [];
73
- const fromGroups = (baseGroups || []).flatMap(
74
- (g) => (g.conversation_list || []).filter((it) => !!it.pinned)
75
- );
76
- return [...fromObject, ...fromGroups];
77
- }, [historyPanelData, baseGroups]);
78
- const groupsData = useMemo(
79
- () => (baseGroups || []).map((g) => ({
80
- ...g,
81
- conversation_list: (g.conversation_list || []).filter((it) => !it.pinned)
82
- })),
83
- [baseGroups]
84
- );
85
- const [query, setQuery] = useState("");
86
- const [internalOpen, setInternalOpen] = useState({});
87
- const [focusedIndex, setFocusedIndex] = useState(-1);
88
- const containerRef = useRef(null);
89
- const [openMenuId, setOpenMenuId] = useState(null);
90
- const isActiveConversation = (conversationId) => {
91
- if (activeConversationId == null || conversationId == null) return false;
92
- return String(activeConversationId) === String(conversationId);
93
- };
94
- useEffect(() => {
95
- const init = {};
96
- (groupsData || []).forEach((g) => {
97
- if (g.group_name) init[g.group_name] = true;
98
- });
99
- setInternalOpen((prev) => ({ ...init, ...prev }));
100
- }, [groupsData]);
101
- const isControlledGroups = openGroups !== void 0 && openGroups !== null && Object.keys(openGroups).length > 0;
102
- const groupsState = useMemo(() => {
103
- if (!isControlledGroups) return internalOpen;
104
- const merged = {};
105
- (groupsData || []).forEach((g) => {
106
- const n = g.group_name;
107
- if (!n) return;
108
- merged[n] = openGroups[n] !== void 0 ? openGroups[n] : true;
109
- });
110
- return merged;
111
- }, [isControlledGroups, openGroups, internalOpen, groupsData]);
112
- const handleSearch = (e) => {
113
- const value = e.target.value ?? "";
114
- setQuery(value);
115
- onSearchChange == null ? void 0 : onSearchChange(value);
116
- };
117
- const handleToggle = (name) => {
118
- const next = !groupsState[name];
119
- if (openGroups == null) setInternalOpen((prev) => ({ ...prev, [name]: next }));
120
- onToggleGroup == null ? void 0 : onToggleGroup(name, next);
121
- };
122
- const filtered = useMemo(() => {
123
- if (!query) return groupsData || [];
124
- const q = query.toLowerCase();
125
- return (groupsData || []).map((g) => {
126
- const list = (g.conversation_list || []).filter((c) => {
127
- var _a, _b;
128
- const byName = (_a = c.name) == null ? void 0 : _a.toLowerCase().includes(q);
129
- const byModule = (_b = c.module_name) == null ? void 0 : _b.toLowerCase().includes(q);
130
- return byName || byModule;
131
- });
132
- return { ...g, conversation_list: list };
133
- }).filter((g) => (g.conversation_list || []).length > 0);
134
- }, [groupsData, query]);
135
- const filteredPinned = useMemo(() => {
136
- if (!pinnedItems || pinnedItems.length === 0) return [];
137
- if (!query) return pinnedItems;
138
- const q = query.toLowerCase();
139
- return pinnedItems.filter((item) => {
140
- var _a, _b;
141
- const byName = (_a = item.name) == null ? void 0 : _a.toLowerCase().includes(q);
142
- const byModule = (_b = item.module_name) == null ? void 0 : _b.toLowerCase().includes(q);
143
- return byName || byModule;
144
- });
145
- }, [pinnedItems, query]);
146
- const flatItems = useMemo(() => {
147
- const out = [];
148
- (filteredPinned || []).forEach((item) => {
149
- out.push({ groupName: "pinned", item });
150
- });
151
- (filtered || []).forEach((g) => {
152
- if (!groupsState[g.group_name]) return;
153
- (g.conversation_list || []).forEach((item) => {
154
- out.push({ groupName: g.group_name, item });
155
- });
156
- });
157
- return out;
158
- }, [filtered, filteredPinned, groupsState]);
159
- const currentFocused = flatItems[focusedIndex];
160
- useEffect(() => {
161
- const onDocClick = (e) => {
162
- const target = e.target;
163
- if (!containerRef.current) return;
164
- const isInsideMenu = target.closest(".history-item-menu");
165
- const isOnTrigger = target.closest(".item-menu-trigger");
166
- if (isInsideMenu || isOnTrigger) return;
167
- if (openMenuId != null) setOpenMenuId(null);
168
- };
169
- document.addEventListener("mousedown", onDocClick);
170
- return () => {
171
- document.removeEventListener("mousedown", onDocClick);
172
- };
173
- }, [openMenuId]);
174
- const focusItemAt = (idx) => {
175
- if (!containerRef.current) return;
176
- const nodes = containerRef.current.querySelectorAll(".history-item");
177
- const clamped = Math.max(0, Math.min(idx, nodes.length - 1));
178
- const el = nodes[clamped];
179
- if (el) {
180
- setFocusedIndex(clamped);
181
- requestAnimationFrame(() => {
182
- el.focus();
183
- });
184
- }
185
- };
186
- const handleContainerKeyDown = (e) => {
187
- if (flatItems.length === 0) return;
188
- switch (e.key) {
189
- case "ArrowDown": {
190
- e.preventDefault();
191
- const next = focusedIndex < 0 ? 0 : Math.min(focusedIndex + 1, flatItems.length - 1);
192
- focusItemAt(next);
193
- break;
194
- }
195
- case "ArrowUp": {
196
- e.preventDefault();
197
- const prev = focusedIndex <= 0 ? 0 : focusedIndex - 1;
198
- focusItemAt(prev);
199
- break;
200
- }
201
- case "Home":
202
- e.preventDefault();
203
- focusItemAt(0);
204
- break;
205
- case "End":
206
- e.preventDefault();
207
- focusItemAt(flatItems.length - 1);
208
- break;
209
- case "Enter":
210
- if (focusedIndex >= 0 && flatItems[focusedIndex]) {
211
- e.preventDefault();
212
- onSelectConversation == null ? void 0 : onSelectConversation(flatItems[focusedIndex].item);
213
- }
214
- break;
215
- }
216
- };
217
- return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "history-panel-container", onKeyDown: handleContainerKeyDown, children: [
218
- /* @__PURE__ */ jsxs("div", { className: "history-panel-header", children: [
219
- /* @__PURE__ */ jsx("span", { children: t("chatBot.history.title") }),
220
- /* @__PURE__ */ jsx("img", { alt: t("chatBot.closeAlt"), src: CloseIcon, onClick: onClose })
221
- ] }),
222
- /* @__PURE__ */ jsx("div", { className: "history-panel-search", children: /* @__PURE__ */ jsx(
223
- "input",
224
- {
225
- "aria-label": t("chatBot.history.searchAriaLabel"),
226
- placeholder: t("chatBot.history.searchPlaceholder"),
227
- type: "text",
228
- value: query,
229
- onChange: handleSearch,
230
- onKeyDown: (e) => {
231
- if (e.key === "ArrowDown") {
232
- e.preventDefault();
233
- focusItemAt(0);
234
- }
235
- }
236
- }
237
- ) }),
238
- /* @__PURE__ */ jsx("div", { className: "history-panel-groups", children: isConversationLoading ? /* @__PURE__ */ jsx(HistoryPanelSkeleton, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
239
- filteredPinned.length > 0 && /* @__PURE__ */ jsx("ul", { className: "history-pinned-list", children: filteredPinned.map((item, idx) => {
240
- const isActive = isActiveConversation(item.conversation_id);
241
- return /* @__PURE__ */ jsxs(
242
- "li",
243
- {
244
- "aria-current": isActive ? "true" : void 0,
245
- className: "history-item history-pinned-item" + (isActive ? " active" : ""),
246
- role: "button",
247
- tabIndex: currentFocused && currentFocused.groupName === "pinned" && currentFocused.item === item ? 0 : -1,
248
- onClick: () => onSelectConversation == null ? void 0 : onSelectConversation(item),
249
- onKeyDown: (e) => {
250
- if (e.key === "Enter" || e.key === " ") onSelectConversation == null ? void 0 : onSelectConversation(item);
251
- },
252
- children: [
253
- /* @__PURE__ */ jsxs("div", { className: "history-item-row", children: [
254
- /* @__PURE__ */ jsxs("div", { className: "history-item-name", children: [
255
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "pin-icon", children: "📌" }),
256
- item.name
257
- ] }),
258
- /* @__PURE__ */ jsx(
259
- "button",
260
- {
261
- "aria-expanded": openMenuId === item.conversation_id,
262
- "aria-haspopup": "menu",
263
- className: "item-menu-trigger" + (openMenuId === item.conversation_id || isActive ? " always-visible" + (openMenuId === item.conversation_id ? " open" : "") : ""),
264
- title: t("chatBot.history.moreActions"),
265
- type: "button",
266
- onClick: (e) => {
267
- e.stopPropagation();
268
- setOpenMenuId(
269
- (prev) => prev === item.conversation_id ? null : item.conversation_id ?? null
270
- );
271
- },
272
- children: "⋯"
273
- }
274
- )
275
- ] }),
276
- openMenuId === item.conversation_id && /* @__PURE__ */ jsx("div", { className: "history-item-menu", role: "menu", children: ["share", "rename", "unpin", "delete"].map((action) => /* @__PURE__ */ jsx(
277
- "button",
278
- {
279
- className: `menu-item ${action === "delete" ? "danger" : ""}`.trim(),
280
- role: "menuitem",
281
- type: "button",
282
- onClick: (e) => {
283
- e.stopPropagation();
284
- onMenuAction == null ? void 0 : onMenuAction(action, item);
285
- setOpenMenuId(null);
286
- },
287
- children: t(ACTION_LABEL_KEYS[action] ?? action)
288
- },
289
- action
290
- )) })
291
- ]
292
- },
293
- `pinned-${item.conversation_id}-${idx}`
294
- );
295
- }) }),
296
- filtered.map((group) => {
297
- const name = group.group_name ?? "";
298
- const isOpen = !!groupsState[name];
299
- return /* @__PURE__ */ jsxs("div", { className: "history-group", children: [
300
- /* @__PURE__ */ jsxs(
301
- "button",
302
- {
303
- "aria-expanded": isOpen,
304
- className: "history-group-header",
305
- type: "button",
306
- onClick: () => {
307
- handleToggle(name);
308
- },
309
- children: [
310
- /* @__PURE__ */ jsx("span", { className: "chevron", children: isOpen ? "▾" : "▸" }),
311
- /* @__PURE__ */ jsx("span", { className: "group-title", children: name })
312
- ]
313
- }
314
- ),
315
- isOpen && /* @__PURE__ */ jsx("ul", { className: "history-group-list", children: (group.conversation_list || []).map((item, idx) => {
316
- const isActive = isActiveConversation(item.conversation_id);
317
- return /* @__PURE__ */ jsxs(
318
- "li",
319
- {
320
- "aria-current": isActive ? "true" : void 0,
321
- className: "history-item" + (isActive ? " active" : ""),
322
- role: "button",
323
- tabIndex: currentFocused && currentFocused.groupName === name && currentFocused.item === item ? 0 : -1,
324
- onClick: () => onSelectConversation == null ? void 0 : onSelectConversation(item),
325
- children: [
326
- /* @__PURE__ */ jsxs("div", { className: "history-item-row", children: [
327
- /* @__PURE__ */ jsx("div", { className: "history-item-name", children: item.name }),
328
- /* @__PURE__ */ jsx(
329
- "button",
330
- {
331
- "aria-expanded": openMenuId === item.conversation_id,
332
- "aria-haspopup": "menu",
333
- className: "item-menu-trigger" + (openMenuId === item.conversation_id || isActive ? " always-visible" + (openMenuId === item.conversation_id ? " open" : "") : ""),
334
- title: t("chatBot.history.moreActions"),
335
- type: "button",
336
- onClick: (e) => {
337
- e.stopPropagation();
338
- setOpenMenuId(
339
- (prev) => prev === item.conversation_id ? null : item.conversation_id ?? null
340
- );
341
- },
342
- children: "⋯"
343
- }
344
- )
345
- ] }),
346
- openMenuId === item.conversation_id && /* @__PURE__ */ jsx("div", { className: "history-item-menu", role: "menu", children: ["share", "rename", "pin", "delete"].map((action) => /* @__PURE__ */ jsx(
347
- "button",
348
- {
349
- className: `menu-item ${action === "delete" ? "danger" : ""}`.trim(),
350
- role: "menuitem",
351
- type: "button",
352
- onClick: (e) => {
353
- e.stopPropagation();
354
- onMenuAction == null ? void 0 : onMenuAction(action, item);
355
- setOpenMenuId(null);
356
- },
357
- children: t(ACTION_LABEL_KEYS[action] ?? action)
358
- },
359
- action
360
- )) })
361
- ]
362
- },
363
- `${name}-${item.conversation_id}-${idx}`
364
- );
365
- }) })
366
- ] }, name);
367
- }),
368
- filtered.length === 0 && filteredPinned.length === 0 && /* @__PURE__ */ jsx("div", { className: "history-empty-state", children: t("chatBot.history.noConversations") })
369
- ] }) })
370
- ] });
371
- }
372
- export {
373
- HistoryPanel
374
- };
@@ -1,5 +0,0 @@
1
- import { TFunction } from '../../i18n';
2
-
3
- export declare const formatAMPM: (date: Date) => string;
4
- export declare const getDateLabel: (dateString?: string, t?: TFunction, locale?: string) => string;
5
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,KAAG,MAQvC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,EAAE,IAAI,SAAS,EAAE,SAAS,MAAM,KAAG,MAiBlF,CAAC"}
@@ -1,29 +0,0 @@
1
- const formatAMPM = (date) => {
2
- let hours = date.getHours();
3
- let minutes = date.getMinutes();
4
- const ampm = hours >= 12 ? "PM" : "AM";
5
- hours = hours % 12;
6
- hours = hours || 12;
7
- minutes = minutes < 10 ? `0${minutes}` : minutes;
8
- return `${hours}:${minutes} ${ampm}`;
9
- };
10
- const getDateLabel = (dateString, t, locale) => {
11
- if (!dateString) return "";
12
- const date = new Date(dateString);
13
- const today = /* @__PURE__ */ new Date();
14
- const yesterday = /* @__PURE__ */ new Date();
15
- yesterday.setDate(today.getDate() - 1);
16
- const isToday = date.toDateString() === today.toDateString();
17
- const isYesterday = date.toDateString() === yesterday.toDateString();
18
- if (isToday) return t ? t("chatBot.dateSeparator.today") : "Today";
19
- if (isYesterday) return t ? t("chatBot.dateSeparator.yesterday") : "Yesterday";
20
- return date.toLocaleDateString(locale, {
21
- month: "short",
22
- day: "numeric",
23
- year: "numeric"
24
- });
25
- };
26
- export {
27
- formatAMPM,
28
- getDateLabel
29
- };
@@ -1,17 +0,0 @@
1
- import { __exports as MoreVert } from "../../../_virtual/MoreVert.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(MoreVert, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = MoreVert.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = MoreVert.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"
14
- }), "MoreVert");
15
- export {
16
- default_1 as default
17
- };
@@ -1,17 +0,0 @@
1
- import { __exports as RemoveRounded } from "../../../_virtual/RemoveRounded.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(RemoveRounded, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = RemoveRounded.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = RemoveRounded.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1"
14
- }), "RemoveRounded");
15
- export {
16
- default_1 as default
17
- };
@@ -1,17 +0,0 @@
1
- import { __exports as SaveOutlined } from "../../../_virtual/SaveOutlined.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(SaveOutlined, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = SaveOutlined.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = SaveOutlined.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm2 16H5V5h11.17L19 7.83zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3M6 6h9v4H6z"
14
- }), "SaveOutlined");
15
- export {
16
- default_1 as default
17
- };
@@ -1,28 +0,0 @@
1
- function getSize(el) {
2
- const { width, height } = el.getBoundingClientRect();
3
- return { width, height };
4
- }
5
- function onResize(el, callback) {
6
- if (typeof ResizeObserver === "undefined") {
7
- callback(getSize(el));
8
- return () => {
9
- };
10
- }
11
- const observer = new ResizeObserver((entries) => {
12
- const entry = entries[0];
13
- if (!entry) return;
14
- const box = entry.borderBoxSize[0];
15
- callback(
16
- box ? { width: box.inlineSize, height: box.blockSize } : { width: entry.contentRect.width, height: entry.contentRect.height }
17
- );
18
- });
19
- observer.observe(el);
20
- callback(getSize(el));
21
- return () => {
22
- observer.disconnect();
23
- };
24
- }
25
- export {
26
- getSize,
27
- onResize
28
- };