@memori.ai/memori-react 8.31.0 → 8.33.0

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 (71) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.css +351 -0
  3. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +34 -0
  4. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +105 -0
  5. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -0
  6. package/dist/components/Header/ChatConsumptionDropdown.d.ts +8 -0
  7. package/dist/components/Header/ChatConsumptionDropdown.js +103 -0
  8. package/dist/components/Header/ChatConsumptionDropdown.js.map +1 -0
  9. package/dist/components/Header/Header.css +128 -17
  10. package/dist/components/Header/Header.js +2 -72
  11. package/dist/components/Header/Header.js.map +1 -1
  12. package/dist/components/MicrophoneButton/MicrophoneButton.css +14 -3
  13. package/dist/components/MicrophoneButton/MicrophoneButton.js +1 -1
  14. package/dist/components/MicrophoneButton/MicrophoneButton.js.map +1 -1
  15. package/dist/components/PositionPopover/PositionPopover.js +8 -2
  16. package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
  17. package/dist/components/icons/GasStation.d.ts +6 -0
  18. package/dist/components/icons/GasStation.js +6 -0
  19. package/dist/components/icons/GasStation.js.map +1 -0
  20. package/dist/components/ui/Tooltip.js +6 -3
  21. package/dist/components/ui/Tooltip.js.map +1 -1
  22. package/dist/locales/de.json +3 -0
  23. package/dist/locales/en.json +3 -0
  24. package/dist/locales/es.json +3 -0
  25. package/dist/locales/fr.json +3 -0
  26. package/dist/locales/it.json +3 -0
  27. package/dist/version.d.ts +1 -1
  28. package/dist/version.js +1 -1
  29. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.css +351 -0
  30. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +34 -0
  31. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js +102 -0
  32. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -0
  33. package/esm/components/Header/ChatConsumptionDropdown.d.ts +8 -0
  34. package/esm/components/Header/ChatConsumptionDropdown.js +100 -0
  35. package/esm/components/Header/ChatConsumptionDropdown.js.map +1 -0
  36. package/esm/components/Header/Header.css +128 -17
  37. package/esm/components/Header/Header.js +3 -73
  38. package/esm/components/Header/Header.js.map +1 -1
  39. package/esm/components/MicrophoneButton/MicrophoneButton.css +14 -3
  40. package/esm/components/MicrophoneButton/MicrophoneButton.js +1 -1
  41. package/esm/components/MicrophoneButton/MicrophoneButton.js.map +1 -1
  42. package/esm/components/PositionPopover/PositionPopover.js +9 -3
  43. package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
  44. package/esm/components/icons/GasStation.d.ts +6 -0
  45. package/esm/components/icons/GasStation.js +4 -0
  46. package/esm/components/icons/GasStation.js.map +1 -0
  47. package/esm/components/ui/Tooltip.js +6 -3
  48. package/esm/components/ui/Tooltip.js.map +1 -1
  49. package/esm/locales/de.json +3 -0
  50. package/esm/locales/en.json +3 -0
  51. package/esm/locales/es.json +3 -0
  52. package/esm/locales/fr.json +3 -0
  53. package/esm/locales/it.json +3 -0
  54. package/esm/version.d.ts +1 -1
  55. package/esm/version.js +1 -1
  56. package/package.json +2 -2
  57. package/src/components/Header/ChatConsumptionDropdown.test.tsx +86 -0
  58. package/src/components/Header/ChatConsumptionDropdown.tsx +266 -0
  59. package/src/components/Header/Header.css +128 -17
  60. package/src/components/Header/Header.stories.tsx +48 -41
  61. package/src/components/Header/Header.tsx +7 -147
  62. package/src/components/MicrophoneButton/MicrophoneButton.css +14 -3
  63. package/src/components/MicrophoneButton/MicrophoneButton.tsx +12 -3
  64. package/src/components/icons/GasStation.tsx +36 -0
  65. package/src/components/ui/Tooltip.tsx +12 -3
  66. package/src/locales/de.json +3 -0
  67. package/src/locales/en.json +3 -0
  68. package/src/locales/es.json +3 -0
  69. package/src/locales/fr.json +3 -0
  70. package/src/locales/it.json +3 -0
  71. package/src/version.ts +1 -1
@@ -450,6 +450,9 @@
450
450
  "co2": "CO2",
451
451
  "water": "Acqua",
452
452
  "usageBadgesHint": "Clicca uno di questi pulsanti per mostrare maggiori informazioni",
453
+ "totalChatConsumptionTitle": "Consumo Totale Chat",
454
+ "modelUsage": "Utilizzo del modello",
455
+ "environmentalImpact": "Impatto ambientale",
453
456
  "impactComparisonUnavailable": "Confronto indicativo non disponibile.",
454
457
  "impactComparisonEnergy": "Confronto indicativo: circa quanto tenere accesa una lampadina LED da 10 W per {{duration}}.",
455
458
  "impactComparisonCo2": "Confronto indicativo: circa {{distance}} percorsi in auto a benzina media.",
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "8.31.0";
1
+ export declare const version = "8.33.0";
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '8.31.0';
4
+ exports.version = '8.33.0';
5
5
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,351 @@
1
+ .memori-chat-resume-drawer {
2
+ position: fixed;
3
+ z-index: 1200;
4
+ inset: 0;
5
+ pointer-events: none;
6
+ }
7
+
8
+ .memori-chat-resume-drawer--backdrop {
9
+ position: absolute;
10
+ border: 0;
11
+ background: rgba(0, 0, 0, 0);
12
+ cursor: default;
13
+ inset: 0;
14
+ opacity: 0;
15
+ transition: opacity 280ms cubic-bezier(0.32, 0.72, 0, 1);
16
+ }
17
+
18
+ .memori-chat-resume-drawer--panel {
19
+ position: absolute;
20
+ top: 0;
21
+ right: 0;
22
+ display: flex;
23
+ width: min(100%, 430px);
24
+ height: 100%;
25
+ flex-direction: column;
26
+ background: var(--memori-main-background);
27
+ box-shadow: -10px 0 30px rgba(0, 0, 0, 0.16);
28
+ transform: translateX(100%);
29
+ transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
30
+ }
31
+
32
+ .memori-chat-resume-drawer--embedded-shell {
33
+ display: flex;
34
+ height: 100%;
35
+ min-height: 0;
36
+ flex: 1;
37
+ }
38
+
39
+ .memori-chat-resume-drawer--panel-embedded {
40
+ position: relative;
41
+ width: 100%;
42
+ height: 100%;
43
+ box-shadow: none;
44
+ transform: none;
45
+ }
46
+
47
+ .memori-chat-resume-drawer--open {
48
+ pointer-events: auto;
49
+ }
50
+
51
+ .memori-chat-resume-drawer--open .memori-chat-resume-drawer--backdrop {
52
+ opacity: 0.4;
53
+ }
54
+
55
+ .memori-chat-resume-drawer--open .memori-chat-resume-drawer--panel {
56
+ transform: translateX(0);
57
+ }
58
+
59
+ .memori-chat-resume-drawer--header {
60
+ display: flex;
61
+ align-items: center;
62
+ padding: 14px 16px 12px;
63
+ /* border-bottom: 0.5px solid var(--color-border-tertiary, var(--memori-border-color, #e5e7eb)); */
64
+ gap: 8px;
65
+ }
66
+
67
+ .memori-chat-resume-drawer--header-icon-button {
68
+ display: inline-flex;
69
+ width: 28px;
70
+ min-width: 28px;
71
+ height: 28px;
72
+ align-items: center;
73
+ justify-content: center;
74
+ padding: 0;
75
+ border: none;
76
+ border-radius: 999px;
77
+ background: transparent;
78
+ color: var(--color-text-primary, var(--memori-text-color));
79
+ cursor: pointer;
80
+ }
81
+
82
+ .memori-chat-resume-drawer--header-main {
83
+ min-width: 0;
84
+ flex: 1;
85
+ }
86
+
87
+ .memori-chat-resume-drawer--title {
88
+ overflow: hidden;
89
+ margin: 0;
90
+ color: var(--color-text-primary, var(--memori-text-color));
91
+ font-size: 15px;
92
+ font-weight: 500;
93
+ text-overflow: ellipsis;
94
+ white-space: nowrap;
95
+ }
96
+
97
+ .memori-chat-resume-drawer--subtitle {
98
+ overflow: hidden;
99
+ margin: 2px 0 0;
100
+ color: color-mix(in oklch, var(--memori-text-color) 66%, transparent);
101
+ font-size: 12px;
102
+ text-overflow: ellipsis;
103
+ white-space: nowrap;
104
+ }
105
+
106
+ .memori-chat-resume-drawer--summary-banner {
107
+ display: flex;
108
+ align-items: flex-start;
109
+ padding: 10px 12px;
110
+ border: 1px solid var(--color-border-tertiary, var(--memori-border-color, #e5e7eb));
111
+ border-radius: 8px;
112
+ margin: 12px 16px 0;
113
+ background: var(--color-background-secondary, var(--memori-secondary-background));
114
+ gap: 8px;
115
+ }
116
+
117
+ .memori-chat-resume-drawer--summary-icon {
118
+ margin-top: 1px;
119
+ color: color-mix(in oklch, var(--memori-text-color) 68%, transparent);
120
+ }
121
+
122
+ .memori-chat-resume-drawer--summary-title {
123
+ margin: 0 0 2px;
124
+ color: var(--color-text-primary, var(--memori-text-color));
125
+ font-size: 14px;
126
+ font-weight: 600;
127
+ }
128
+
129
+ .memori-chat-resume-drawer--summary-text {
130
+ margin: 0;
131
+ color: color-mix(in oklch, var(--memori-text-color) 72%, transparent);
132
+ font-size: 14px;
133
+ line-height: 1.35;
134
+ }
135
+
136
+ .memori-chat-resume-drawer--thread {
137
+ display: flex;
138
+ overflow: hidden;
139
+ min-height: 0;
140
+ flex: 1;
141
+ flex-direction: column;
142
+ padding: 16px;
143
+ }
144
+
145
+ .memori-chat-resume-drawer--embedded-chat {
146
+ min-height: 0;
147
+ flex: 1;
148
+ }
149
+
150
+ .memori-chat-resume-drawer--embedded-chat .memori-chat--wrapper {
151
+ height: 100%;
152
+ }
153
+
154
+ .memori-chat-resume-drawer--embedded-chat .memori-chat--history {
155
+ height: 100%;
156
+ border-radius: 0;
157
+ margin: 0;
158
+ background: transparent;
159
+ }
160
+
161
+ .memori-chat-resume-drawer--embedded-chat .memori-chat--content {
162
+ padding: 0;
163
+ }
164
+
165
+ .memori-chat-resume-drawer--embedded-chat .memori-chat--cover {
166
+ display: none;
167
+ }
168
+
169
+ .memori-chat-resume-drawer--embedded-chat .memori-chat--bubble-container,
170
+ .memori-chat-resume-drawer--embedded-chat .memori-chat--timestamp,
171
+ .memori-chat-resume-drawer--embedded-chat .memori-media-widget,
172
+ .memori-chat-resume-drawer--embedded-chat .memori-chat--bubble-shell {
173
+ padding-right: 0;
174
+ padding-left: 0;
175
+ }
176
+
177
+ .memori-chat-resume-drawer--message-group {
178
+ display: flex;
179
+ width: 100%;
180
+ gap: 8px;
181
+ }
182
+
183
+ .memori-chat-resume-drawer--message-group-assistant {
184
+ justify-content: flex-start;
185
+ }
186
+
187
+ .memori-chat-resume-drawer--message-group-user {
188
+ justify-content: flex-end;
189
+ }
190
+
191
+ .memori-chat-resume-drawer--avatar {
192
+ display: inline-flex;
193
+ width: 28px;
194
+ min-width: 28px;
195
+ height: 28px;
196
+ align-items: center;
197
+ justify-content: center;
198
+ border-radius: 999px;
199
+ background: linear-gradient(135deg, #b5a2ff 0%, #8b72ff 100%);
200
+ color: #fff;
201
+ font-size: 11px;
202
+ font-weight: 600;
203
+ }
204
+
205
+ .memori-chat-resume-drawer--message-content {
206
+ display: flex;
207
+ max-width: 82%;
208
+ flex-direction: column;
209
+ gap: 6px;
210
+ }
211
+
212
+ .memori-chat-resume-drawer--message-group-user .memori-chat-resume-drawer--message-content {
213
+ align-items: flex-end;
214
+ }
215
+
216
+ .memori-chat-resume-drawer--timestamp {
217
+ color: color-mix(in oklch, var(--memori-text-color) 64%, transparent);
218
+ font-size: 12px;
219
+ line-height: 1;
220
+ }
221
+
222
+ .memori-chat-resume-drawer--attachment-pill {
223
+ display: flex;
224
+ align-items: center;
225
+ padding: 8px 10px;
226
+ border: 1px solid var(--color-border-tertiary, var(--memori-border-color, #e5e7eb));
227
+ border-radius: 8px;
228
+ background: var(--color-background-secondary, var(--memori-secondary-background));
229
+ gap: 8px;
230
+ }
231
+
232
+ .memori-chat-resume-drawer--attachment-ext {
233
+ display: inline-flex;
234
+ min-width: 34px;
235
+ align-items: center;
236
+ justify-content: center;
237
+ padding: 4px 8px;
238
+ border-radius: 6px;
239
+ background: #d9e8ff;
240
+ color: #2f5fa8;
241
+ font-size: 11px;
242
+ font-weight: 600;
243
+ }
244
+
245
+ .memori-chat-resume-drawer--attachment-meta {
246
+ display: flex;
247
+ min-width: 0;
248
+ flex-direction: column;
249
+ }
250
+
251
+ .memori-chat-resume-drawer--attachment-name {
252
+ overflow: hidden;
253
+ color: var(--color-text-primary, var(--memori-text-color));
254
+ font-size: 13px;
255
+ text-overflow: ellipsis;
256
+ white-space: nowrap;
257
+ }
258
+
259
+ .memori-chat-resume-drawer--attachment-info {
260
+ color: color-mix(in oklch, var(--memori-text-color) 70%, transparent);
261
+ font-size: 12px;
262
+ }
263
+
264
+ .memori-chat-resume-drawer--bubble {
265
+ padding: 10px 12px;
266
+ color: var(--color-text-primary, var(--memori-text-color));
267
+ font-size: 14px;
268
+ line-height: 1.4;
269
+ white-space: pre-wrap;
270
+ }
271
+
272
+ .memori-chat-resume-drawer--bubble-assistant {
273
+ border: 0.5px solid var(--color-border-tertiary, var(--memori-border-color, #e5e7eb));
274
+ border-radius: 4px 12px 12px 12px;
275
+ background: var(--color-background-secondary, var(--memori-secondary-background));
276
+ }
277
+
278
+ .memori-chat-resume-drawer--bubble-user {
279
+ border-radius: 12px 4px 12px 12px;
280
+ background: var(--memori-primary);
281
+ color: #fff;
282
+ }
283
+
284
+ .memori-chat-resume-drawer--interrupted {
285
+ display: inline-flex;
286
+ align-items: center;
287
+ color: color-mix(in oklch, var(--memori-text-color) 72%, transparent);
288
+ font-size: 14px;
289
+ gap: 6px;
290
+ }
291
+
292
+ .memori-chat-resume-drawer--actions {
293
+ display: flex;
294
+ flex-direction: column;
295
+ flex-shrink: 0;
296
+ padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
297
+ /* border-top: 0.5px solid var(--color-border-tertiary, var(--memori-border-color, #e5e7eb)); */
298
+ background: var(--memori-main-background);
299
+ gap: 12px;
300
+ }
301
+
302
+ .memori-chat-resume-drawer--chips-row {
303
+ display: flex;
304
+ flex-wrap: wrap;
305
+ gap: 8px;
306
+ }
307
+
308
+ .memori-chat-resume-drawer--chip {
309
+ min-height: 32px;
310
+ padding: 0 14px;
311
+ border: 0.5px solid color-mix(in oklch, var(--memori-text-color) 20%, transparent);
312
+ border-radius: 20px;
313
+ background: transparent;
314
+ color: color-mix(in oklch, var(--memori-text-color) 85%, transparent);
315
+ cursor: pointer;
316
+ font-size: 12px;
317
+ font-weight: 500;
318
+ }
319
+
320
+ .memori-chat-resume-drawer--resume-cta {
321
+ width: 100%;
322
+ min-height: 44px;
323
+ border-radius: 10px;
324
+ font-size: 14px;
325
+ font-weight: 500;
326
+ }
327
+
328
+ .memori-chat-resume-drawer--skeletons {
329
+ display: flex;
330
+ flex-direction: column;
331
+ gap: 12px;
332
+ }
333
+
334
+ .memori-chat-resume-drawer--skeleton-bubble {
335
+ width: 72%;
336
+ height: 54px;
337
+ border-radius: 12px;
338
+ animation: memori-chat-resume-shimmer 1.2s infinite;
339
+ background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 100%);
340
+ background-size: 200% 100%;
341
+ }
342
+
343
+ @keyframes memori-chat-resume-shimmer {
344
+ from {
345
+ background-position: 200% 0;
346
+ }
347
+
348
+ to {
349
+ background-position: -200% 0;
350
+ }
351
+ }
@@ -0,0 +1,34 @@
1
+ import './ChatResumeDrawer.css';
2
+ export interface ResumeDrawerMessage {
3
+ id: string;
4
+ role: 'user' | 'assistant';
5
+ content: string;
6
+ timestamp: string;
7
+ status?: 'completed' | 'interrupted';
8
+ attachment?: {
9
+ name: string;
10
+ type: string;
11
+ size: string;
12
+ ext: string;
13
+ };
14
+ }
15
+ export interface ChatResumeDrawerProps {
16
+ isOpen: boolean;
17
+ onClose: () => void;
18
+ onBack?: () => void;
19
+ embedded?: boolean;
20
+ session: {
21
+ title: string;
22
+ subtitle: string;
23
+ summary: string;
24
+ messages: ResumeDrawerMessage[];
25
+ quickActions: {
26
+ label: string;
27
+ prompt: string;
28
+ }[];
29
+ };
30
+ onResume: (prompt?: string) => void;
31
+ isLoading?: boolean;
32
+ }
33
+ declare const ChatResumeDrawer: ({ isOpen, onClose, onBack, embedded, session, onResume, isLoading, }: ChatResumeDrawerProps) => JSX.Element | null;
34
+ export default ChatResumeDrawer;
@@ -0,0 +1,102 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef, useState } from 'react';
3
+ import { Button } from '@memori.ai/ui';
4
+ import { ArrowLeft, ArrowUpRight } from 'lucide-react';
5
+ import { stripHTML } from '../../helpers/utils';
6
+ import Chat from '../Chat/Chat';
7
+ import './ChatResumeDrawer.css';
8
+ const ANIMATION_DURATION_MS = 280;
9
+ const EMPTY_MEMORI = {
10
+ memoriID: 'chat-resume-drawer',
11
+ name: 'AI',
12
+ culture: 'it-IT',
13
+ coverURL: '',
14
+ avatarURL: '',
15
+ enableBoardOfExperts: false,
16
+ };
17
+ const NOOP = () => { };
18
+ const stripMarkdownChars = (value) => {
19
+ return value
20
+ .replace(/[#*_`~>\-[\]()]/g, ' ')
21
+ .replace(/\s+/g, ' ')
22
+ .trim();
23
+ };
24
+ const escapeAttachmentAttr = (value) => value.replaceAll('"', '"');
25
+ const ChatResumeDrawer = ({ isOpen, onClose, onBack, embedded = false, session, onResume, isLoading = false, }) => {
26
+ const panelRef = useRef(null);
27
+ const backButtonRef = useRef(null);
28
+ const [shouldRender, setShouldRender] = useState(isOpen);
29
+ const [isVisible, setIsVisible] = useState(isOpen);
30
+ useEffect(() => {
31
+ if (isOpen) {
32
+ setShouldRender(true);
33
+ requestAnimationFrame(() => setIsVisible(true));
34
+ return;
35
+ }
36
+ setIsVisible(false);
37
+ const timeout = window.setTimeout(() => {
38
+ setShouldRender(false);
39
+ }, ANIMATION_DURATION_MS);
40
+ return () => window.clearTimeout(timeout);
41
+ }, [isOpen]);
42
+ useEffect(() => {
43
+ var _a;
44
+ if (!isOpen)
45
+ return;
46
+ (_a = backButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
47
+ }, [isOpen]);
48
+ useEffect(() => {
49
+ if (!isOpen)
50
+ return;
51
+ const handleKeyDown = (event) => {
52
+ if (event.key === 'Escape') {
53
+ onClose();
54
+ return;
55
+ }
56
+ if (event.key !== 'Tab' || !panelRef.current)
57
+ return;
58
+ const focusableElements = panelRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
59
+ if (!focusableElements.length)
60
+ return;
61
+ const first = focusableElements[0];
62
+ const last = focusableElements[focusableElements.length - 1];
63
+ const active = document.activeElement;
64
+ if (event.shiftKey && active === first) {
65
+ event.preventDefault();
66
+ last.focus();
67
+ }
68
+ else if (!event.shiftKey && active === last) {
69
+ event.preventDefault();
70
+ first.focus();
71
+ }
72
+ };
73
+ document.addEventListener('keydown', handleKeyDown);
74
+ return () => document.removeEventListener('keydown', handleKeyDown);
75
+ }, [isOpen, onClose]);
76
+ const safeTitle = useMemo(() => {
77
+ const cleaned = stripMarkdownChars(stripHTML(session.title || ''));
78
+ return cleaned || 'Conversazione';
79
+ }, [session.title]);
80
+ const history = useMemo(() => session.messages.map(message => {
81
+ const attachmentTag = message.attachment
82
+ ? `<document_attachment filename="${escapeAttachmentAttr(message.attachment.name)}" type="${escapeAttachmentAttr(message.attachment.type)}"></document_attachment>`
83
+ : '';
84
+ const interruptedText = message.role === 'assistant' && message.status === 'interrupted'
85
+ ? 'Risposta interrotta - sessione in pausa'
86
+ : message.content;
87
+ return {
88
+ fromUser: message.role === 'user',
89
+ text: `${interruptedText}${attachmentTag}`,
90
+ timestamp: message.timestamp,
91
+ };
92
+ }), [session.messages]);
93
+ if (!embedded && !shouldRender)
94
+ return null;
95
+ const content = (_jsxs("div", { ref: panelRef, className: `memori-chat-resume-drawer--panel ${embedded ? 'memori-chat-resume-drawer--panel-embedded' : ''}`, onClick: event => event.stopPropagation(), children: [_jsxs("header", { className: "memori-chat-resume-drawer--header", children: [_jsx(Button, { ref: backButtonRef, variant: "ghost", type: "button", className: "memori-chat-resume-drawer--header-icon-button", onClick: onBack || onClose, "aria-label": "Back", children: _jsx(ArrowLeft, { size: 16 }) }), _jsxs("div", { className: "memori-chat-resume-drawer--header-main", children: [_jsx("h2", { className: "memori-chat-resume-drawer--title", title: safeTitle, children: safeTitle }), _jsx("p", { className: "memori-chat-resume-drawer--subtitle", children: session.subtitle })] })] }), _jsxs("div", { className: "memori-chat-resume-drawer--thread", children: [isLoading && (_jsx("div", { className: "memori-chat-resume-drawer--skeletons", children: [0, 1, 2].map(item => (_jsx("div", { className: "memori-chat-resume-drawer--skeleton-bubble" }, item))) })), !isLoading && (_jsx("div", { className: "memori-chat-resume-drawer--embedded-chat", children: _jsx(Chat, { memori: EMPTY_MEMORI, sessionID: "chat-resume-drawer", history: history, pushMessage: NOOP, simulateUserPrompt: NOOP, setSendOnEnter: NOOP, setAttachmentsMenuOpen: NOOP, onChangeUserMessage: NOOP, sendMessage: NOOP, setEnableFocusChatInput: NOOP, stopAudio: NOOP, startListening: NOOP, stopListening: NOOP, showInputs: false, showAIicon: true, showCopyButton: true, isHistoryView: true }) }))] }), _jsx("footer", { className: "memori-chat-resume-drawer--actions", children: _jsxs(Button, { className: "memori-chat-resume-drawer--resume-cta", variant: "primary", onClick: () => onResume(), children: ["Riprendi conversazione ", _jsx(ArrowUpRight, { size: 16 })] }) })] }));
96
+ if (embedded) {
97
+ return _jsx("div", { className: "memori-chat-resume-drawer--embedded-shell", children: content });
98
+ }
99
+ return (_jsxs("div", { className: `memori-chat-resume-drawer ${isVisible ? 'memori-chat-resume-drawer--open' : ''}`, role: "dialog", "aria-modal": "true", "aria-label": "Riprendi conversazione", children: [_jsx(Button, { className: "memori-chat-resume-drawer--backdrop", type: "button", "aria-label": "Close resume drawer", onClick: onClose }), content] }));
100
+ };
101
+ export default ChatResumeDrawer;
102
+ //# sourceMappingURL=ChatResumeDrawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatResumeDrawer.js","sourceRoot":"","sources":["../../../src/components/ChatHistoryDrawer/ChatResumeDrawer.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAA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CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Message } from '@memori.ai/memori-api-client/dist/types';
3
+ export interface ChatConsumptionDropdownProps {
4
+ history: Message[];
5
+ hasSpacedButtons?: boolean;
6
+ }
7
+ declare const ChatConsumptionDropdown: React.FC<ChatConsumptionDropdownProps>;
8
+ export default ChatConsumptionDropdown;
@@ -0,0 +1,100 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import cx from 'classnames';
4
+ import { useTranslation } from 'react-i18next';
5
+ import Button from '../ui/Button';
6
+ import Dropdown from '../ui/Dropdown';
7
+ import GasStation from '../icons/GasStation';
8
+ import { BADGE_EMOJI } from '../../helpers/llmUsage';
9
+ const getMetricValue = (metric) => {
10
+ if (typeof metric === 'number' && Number.isFinite(metric))
11
+ return metric;
12
+ if (!metric || typeof metric !== 'object')
13
+ return undefined;
14
+ if (typeof metric.parsedValue === 'number' &&
15
+ Number.isFinite(metric.parsedValue)) {
16
+ return metric.parsedValue;
17
+ }
18
+ if (typeof metric.source === 'string') {
19
+ const parsed = Number(metric.source);
20
+ if (Number.isFinite(parsed))
21
+ return parsed;
22
+ }
23
+ return undefined;
24
+ };
25
+ const formatMetricValue = (value, locale) => new Intl.NumberFormat(locale, {
26
+ minimumFractionDigits: 0,
27
+ maximumFractionDigits: Math.abs(value) >= 1 ? 3 : 4,
28
+ }).format(value);
29
+ const formatCountValue = (value, locale) => new Intl.NumberFormat(locale, {
30
+ maximumFractionDigits: 0,
31
+ }).format(value);
32
+ const formatImpactInReadableUnit = (value, metricType, locale) => {
33
+ const absValue = Math.abs(value);
34
+ if (metricType === 'energy') {
35
+ if (absValue >= 1)
36
+ return `${formatMetricValue(value, locale)} kWh`;
37
+ const wh = value * 1000;
38
+ if (Math.abs(wh) >= 1)
39
+ return `${formatMetricValue(wh, locale)} Wh`;
40
+ return `${formatMetricValue(wh * 1000, locale)} mWh`;
41
+ }
42
+ if (metricType === 'co2') {
43
+ if (absValue >= 1)
44
+ return `${formatMetricValue(value, locale)} kg`;
45
+ const g = value * 1000;
46
+ if (Math.abs(g) >= 1)
47
+ return `${formatMetricValue(g, locale)} g`;
48
+ return `${formatMetricValue(g * 1000, locale)} mg`;
49
+ }
50
+ if (absValue >= 1)
51
+ return `${formatMetricValue(value, locale)} L`;
52
+ const ml = value * 1000;
53
+ if (Math.abs(ml) >= 1)
54
+ return `${formatMetricValue(ml, locale)} mL`;
55
+ return `${formatMetricValue(ml * 1000, locale)} μL`;
56
+ };
57
+ const ChatConsumptionDropdown = ({ history, hasSpacedButtons = false, }) => {
58
+ const { t, i18n } = useTranslation();
59
+ const currentLocale = i18n.language || navigator.language || 'en';
60
+ const chatLog = useMemo(() => ({ lines: history }), [history]);
61
+ const chatConsumptionTotals = useMemo(() => {
62
+ var _a;
63
+ const totals = {
64
+ totalInputTokens: 0,
65
+ totalOutputTokens: 0,
66
+ energy: 0,
67
+ gwp: 0,
68
+ wcf: 0,
69
+ models: new Set(),
70
+ };
71
+ ((_a = chatLog === null || chatLog === void 0 ? void 0 : chatLog.lines) !== null && _a !== void 0 ? _a : []).forEach(line => {
72
+ var _a, _b, _c, _d, _e;
73
+ const llmUsage = line.llmUsage;
74
+ if (!llmUsage)
75
+ return;
76
+ totals.totalInputTokens += (_a = llmUsage.totalInputTokens) !== null && _a !== void 0 ? _a : 0;
77
+ totals.totalOutputTokens += (_b = llmUsage.outputTokens) !== null && _b !== void 0 ? _b : 0;
78
+ if (llmUsage.provider || llmUsage.model) {
79
+ totals.models.add([llmUsage.provider, llmUsage.model].filter(Boolean).join(' · '));
80
+ }
81
+ if (!llmUsage.energyImpact)
82
+ return;
83
+ const impact = llmUsage.energyImpact;
84
+ totals.energy += (_c = getMetricValue(impact.energy)) !== null && _c !== void 0 ? _c : 0;
85
+ totals.gwp += (_d = getMetricValue(impact.gwp)) !== null && _d !== void 0 ? _d : 0;
86
+ totals.wcf += (_e = getMetricValue(impact.wcf)) !== null && _e !== void 0 ? _e : 0;
87
+ });
88
+ return totals;
89
+ }, [chatLog]);
90
+ const llmUsageModels = useMemo(() => Array.from(chatConsumptionTotals.models), [chatConsumptionTotals.models]);
91
+ const hasConsumptionData = useMemo(() => {
92
+ var _a;
93
+ return ((_a = chatLog === null || chatLog === void 0 ? void 0 : chatLog.lines) !== null && _a !== void 0 ? _a : []).some(line => !!line.llmUsage);
94
+ }, [chatLog]);
95
+ if (!hasConsumptionData)
96
+ return null;
97
+ return (_jsx(Dropdown, { placement: "bottom-right", trigger: _jsx(Button, { primary: true, shape: "circle", className: cx('memori-header--button', 'memori-header--button--sustainability', hasSpacedButtons && 'memori-header--button-spaced'), title: t('write_and_speak.showMessageConsumptionLabel') || 'LLM consumption', icon: _jsx(GasStation, { className: "memori-header--button--sustainability-icon" }) }), children: _jsxs("div", { className: "memori-dropdown--sustainability", children: [_jsx("h4", { className: "memori-dropdown--sustainability-title", children: t('chatLogs.totalChatConsumptionTitle') || 'Consumo Totale Chat' }), _jsxs("div", { className: "memori-dropdown--sustainability-section", children: [_jsx("h5", { className: "memori-dropdown--sustainability-section-title", children: t('chatLogs.modelUsage') || 'Model usage' }), _jsxs("div", { className: "memori-dropdown--sustainability-summary", children: [_jsxs("div", { className: "memori-dropdown--sustainability-stat", children: [_jsx("span", { className: "memori-dropdown--sustainability-stat-label", children: t('chatLogs.input') || 'Input' }), _jsx("strong", { className: "memori-dropdown--sustainability-stat-value", children: formatCountValue(chatConsumptionTotals.totalInputTokens, currentLocale) }), _jsx("span", { className: "memori-dropdown--sustainability-stat-meta", children: t('chatLogs.tokens') || 'Tokens' })] }), _jsxs("div", { className: "memori-dropdown--sustainability-stat", children: [_jsx("span", { className: "memori-dropdown--sustainability-stat-label", children: t('chatLogs.output') || 'Output' }), _jsx("strong", { className: "memori-dropdown--sustainability-stat-value", children: formatCountValue(chatConsumptionTotals.totalOutputTokens, currentLocale) }), _jsx("span", { className: "memori-dropdown--sustainability-stat-meta", children: t('chatLogs.tokens') || 'Tokens' })] })] }), llmUsageModels.length > 0 && (_jsxs("div", { className: "memori-dropdown--sustainability-row memori-dropdown--sustainability-row--stacked", children: [_jsxs("span", { className: "memori-dropdown--sustainability-label", children: [t('chatLogs.provider') || 'Provider', " /", ' ', t('chatLogs.model') || 'Model'] }), _jsx("div", { className: "memori-dropdown--sustainability-tags", children: llmUsageModels.map(modelLabel => (_jsx("span", { className: "memori-dropdown--sustainability-tag", children: modelLabel }, modelLabel))) })] }))] }), _jsxs("div", { className: "memori-dropdown--sustainability-metrics", children: [_jsx("h5", { className: "memori-dropdown--sustainability-section-title", children: t('chatLogs.environmentalImpact') || 'Environmental impact' }), _jsxs("div", { className: "memori-dropdown--sustainability-row", children: [_jsxs("span", { className: "memori-dropdown--sustainability-label", children: [_jsx("span", { "aria-hidden": "true", children: BADGE_EMOJI.energy }), ' ', t('chatLogs.energy') || 'Energy'] }), _jsx("strong", { className: "memori-dropdown--sustainability-value", children: formatImpactInReadableUnit(chatConsumptionTotals.energy, 'energy', currentLocale) })] }), _jsxs("div", { className: "memori-dropdown--sustainability-row", children: [_jsxs("span", { className: "memori-dropdown--sustainability-label", children: [_jsx("span", { "aria-hidden": "true", children: BADGE_EMOJI.co2 }), ' ', t('chatLogs.co2') || 'CO2'] }), _jsx("strong", { className: "memori-dropdown--sustainability-value", children: formatImpactInReadableUnit(chatConsumptionTotals.gwp, 'co2', currentLocale) })] }), _jsxs("div", { className: "memori-dropdown--sustainability-row", children: [_jsxs("span", { className: "memori-dropdown--sustainability-label", children: [_jsx("span", { "aria-hidden": "true", children: BADGE_EMOJI.water }), ' ', t('chatLogs.water') || 'Water'] }), _jsx("strong", { className: "memori-dropdown--sustainability-value", children: formatImpactInReadableUnit(chatConsumptionTotals.wcf, 'water', currentLocale) })] })] })] }) }));
98
+ };
99
+ export default ChatConsumptionDropdown;
100
+ //# sourceMappingURL=ChatConsumptionDropdown.js.map
@@ -0,0 +1 @@
1
+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