@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.
- package/CHANGELOG.md +21 -0
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.css +351 -0
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +34 -0
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +105 -0
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -0
- package/dist/components/Header/ChatConsumptionDropdown.d.ts +8 -0
- package/dist/components/Header/ChatConsumptionDropdown.js +103 -0
- package/dist/components/Header/ChatConsumptionDropdown.js.map +1 -0
- package/dist/components/Header/Header.css +128 -17
- package/dist/components/Header/Header.js +2 -72
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/MicrophoneButton/MicrophoneButton.css +14 -3
- package/dist/components/MicrophoneButton/MicrophoneButton.js +1 -1
- package/dist/components/MicrophoneButton/MicrophoneButton.js.map +1 -1
- package/dist/components/PositionPopover/PositionPopover.js +8 -2
- package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
- package/dist/components/icons/GasStation.d.ts +6 -0
- package/dist/components/icons/GasStation.js +6 -0
- package/dist/components/icons/GasStation.js.map +1 -0
- package/dist/components/ui/Tooltip.js +6 -3
- package/dist/components/ui/Tooltip.js.map +1 -1
- package/dist/locales/de.json +3 -0
- package/dist/locales/en.json +3 -0
- package/dist/locales/es.json +3 -0
- package/dist/locales/fr.json +3 -0
- package/dist/locales/it.json +3 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.css +351 -0
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +34 -0
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js +102 -0
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -0
- package/esm/components/Header/ChatConsumptionDropdown.d.ts +8 -0
- package/esm/components/Header/ChatConsumptionDropdown.js +100 -0
- package/esm/components/Header/ChatConsumptionDropdown.js.map +1 -0
- package/esm/components/Header/Header.css +128 -17
- package/esm/components/Header/Header.js +3 -73
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/MicrophoneButton/MicrophoneButton.css +14 -3
- package/esm/components/MicrophoneButton/MicrophoneButton.js +1 -1
- package/esm/components/MicrophoneButton/MicrophoneButton.js.map +1 -1
- package/esm/components/PositionPopover/PositionPopover.js +9 -3
- package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
- package/esm/components/icons/GasStation.d.ts +6 -0
- package/esm/components/icons/GasStation.js +4 -0
- package/esm/components/icons/GasStation.js.map +1 -0
- package/esm/components/ui/Tooltip.js +6 -3
- package/esm/components/ui/Tooltip.js.map +1 -1
- package/esm/locales/de.json +3 -0
- package/esm/locales/en.json +3 -0
- package/esm/locales/es.json +3 -0
- package/esm/locales/fr.json +3 -0
- package/esm/locales/it.json +3 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +2 -2
- package/src/components/Header/ChatConsumptionDropdown.test.tsx +86 -0
- package/src/components/Header/ChatConsumptionDropdown.tsx +266 -0
- package/src/components/Header/Header.css +128 -17
- package/src/components/Header/Header.stories.tsx +48 -41
- package/src/components/Header/Header.tsx +7 -147
- package/src/components/MicrophoneButton/MicrophoneButton.css +14 -3
- package/src/components/MicrophoneButton/MicrophoneButton.tsx +12 -3
- package/src/components/icons/GasStation.tsx +36 -0
- package/src/components/ui/Tooltip.tsx +12 -3
- package/src/locales/de.json +3 -0
- package/src/locales/en.json +3 -0
- package/src/locales/es.json +3 -0
- package/src/locales/fr.json +3 -0
- package/src/locales/it.json +3 -0
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [8.33.0](https://github.com/memori-ai/memori-react/compare/v8.32.0...v8.33.0) (2026-04-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add tooltip styling and improve MicrophoneButton component functionality ([719b2b1](https://github.com/memori-ai/memori-react/commit/719b2b181e61c6eb0cc122222c6d9806995b969f))
|
|
9
|
+
* enhance Header component with detailed chat consumption metrics and improved styling ([75d2809](https://github.com/memori-ai/memori-react/commit/75d2809e996d9c5af1ac147bc8acf01c54b3db8f))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Maintenance
|
|
13
|
+
|
|
14
|
+
* update dompurify to version 3.4.0 ([50f2f48](https://github.com/memori-ai/memori-react/commit/50f2f48f826b5be3f81e34718167ce73b3715b40))
|
|
15
|
+
|
|
16
|
+
## [8.32.0](https://github.com/memori-ai/memori-react/compare/v8.31.0...v8.32.0) (2026-04-07)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* add GasStation icon and update Header component for sustainability button ([434c61a](https://github.com/memori-ai/memori-react/commit/434c61a02eeb493261fe44d343b337a8727b83d1))
|
|
22
|
+
* update Header component to use localized strings for total chat consumption ([6173c7e](https://github.com/memori-ai/memori-react/commit/6173c7e880aeed5947fa74f0abfa0854231f8e99))
|
|
23
|
+
|
|
3
24
|
## [8.31.0](https://github.com/memori-ai/memori-react/compare/v8.30.1...v8.31.0) (2026-04-07)
|
|
4
25
|
|
|
5
26
|
|
|
@@ -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,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const ui_1 = require("@memori.ai/ui");
|
|
7
|
+
const lucide_react_1 = require("lucide-react");
|
|
8
|
+
const utils_1 = require("../../helpers/utils");
|
|
9
|
+
const Chat_1 = tslib_1.__importDefault(require("../Chat/Chat"));
|
|
10
|
+
require("./ChatResumeDrawer.css");
|
|
11
|
+
const ANIMATION_DURATION_MS = 280;
|
|
12
|
+
const EMPTY_MEMORI = {
|
|
13
|
+
memoriID: 'chat-resume-drawer',
|
|
14
|
+
name: 'AI',
|
|
15
|
+
culture: 'it-IT',
|
|
16
|
+
coverURL: '',
|
|
17
|
+
avatarURL: '',
|
|
18
|
+
enableBoardOfExperts: false,
|
|
19
|
+
};
|
|
20
|
+
const NOOP = () => { };
|
|
21
|
+
const stripMarkdownChars = (value) => {
|
|
22
|
+
return value
|
|
23
|
+
.replace(/[#*_`~>\-[\]()]/g, ' ')
|
|
24
|
+
.replace(/\s+/g, ' ')
|
|
25
|
+
.trim();
|
|
26
|
+
};
|
|
27
|
+
const escapeAttachmentAttr = (value) => value.replaceAll('"', '"');
|
|
28
|
+
const ChatResumeDrawer = ({ isOpen, onClose, onBack, embedded = false, session, onResume, isLoading = false, }) => {
|
|
29
|
+
const panelRef = (0, react_1.useRef)(null);
|
|
30
|
+
const backButtonRef = (0, react_1.useRef)(null);
|
|
31
|
+
const [shouldRender, setShouldRender] = (0, react_1.useState)(isOpen);
|
|
32
|
+
const [isVisible, setIsVisible] = (0, react_1.useState)(isOpen);
|
|
33
|
+
(0, react_1.useEffect)(() => {
|
|
34
|
+
if (isOpen) {
|
|
35
|
+
setShouldRender(true);
|
|
36
|
+
requestAnimationFrame(() => setIsVisible(true));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
setIsVisible(false);
|
|
40
|
+
const timeout = window.setTimeout(() => {
|
|
41
|
+
setShouldRender(false);
|
|
42
|
+
}, ANIMATION_DURATION_MS);
|
|
43
|
+
return () => window.clearTimeout(timeout);
|
|
44
|
+
}, [isOpen]);
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
var _a;
|
|
47
|
+
if (!isOpen)
|
|
48
|
+
return;
|
|
49
|
+
(_a = backButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
50
|
+
}, [isOpen]);
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
52
|
+
if (!isOpen)
|
|
53
|
+
return;
|
|
54
|
+
const handleKeyDown = (event) => {
|
|
55
|
+
if (event.key === 'Escape') {
|
|
56
|
+
onClose();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (event.key !== 'Tab' || !panelRef.current)
|
|
60
|
+
return;
|
|
61
|
+
const focusableElements = panelRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
62
|
+
if (!focusableElements.length)
|
|
63
|
+
return;
|
|
64
|
+
const first = focusableElements[0];
|
|
65
|
+
const last = focusableElements[focusableElements.length - 1];
|
|
66
|
+
const active = document.activeElement;
|
|
67
|
+
if (event.shiftKey && active === first) {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
last.focus();
|
|
70
|
+
}
|
|
71
|
+
else if (!event.shiftKey && active === last) {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
first.focus();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
77
|
+
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
78
|
+
}, [isOpen, onClose]);
|
|
79
|
+
const safeTitle = (0, react_1.useMemo)(() => {
|
|
80
|
+
const cleaned = stripMarkdownChars((0, utils_1.stripHTML)(session.title || ''));
|
|
81
|
+
return cleaned || 'Conversazione';
|
|
82
|
+
}, [session.title]);
|
|
83
|
+
const history = (0, react_1.useMemo)(() => session.messages.map(message => {
|
|
84
|
+
const attachmentTag = message.attachment
|
|
85
|
+
? `<document_attachment filename="${escapeAttachmentAttr(message.attachment.name)}" type="${escapeAttachmentAttr(message.attachment.type)}"></document_attachment>`
|
|
86
|
+
: '';
|
|
87
|
+
const interruptedText = message.role === 'assistant' && message.status === 'interrupted'
|
|
88
|
+
? 'Risposta interrotta - sessione in pausa'
|
|
89
|
+
: message.content;
|
|
90
|
+
return {
|
|
91
|
+
fromUser: message.role === 'user',
|
|
92
|
+
text: `${interruptedText}${attachmentTag}`,
|
|
93
|
+
timestamp: message.timestamp,
|
|
94
|
+
};
|
|
95
|
+
}), [session.messages]);
|
|
96
|
+
if (!embedded && !shouldRender)
|
|
97
|
+
return null;
|
|
98
|
+
const content = ((0, jsx_runtime_1.jsxs)("div", { ref: panelRef, className: `memori-chat-resume-drawer--panel ${embedded ? 'memori-chat-resume-drawer--panel-embedded' : ''}`, onClick: event => event.stopPropagation(), children: [(0, jsx_runtime_1.jsxs)("header", { className: "memori-chat-resume-drawer--header", children: [(0, jsx_runtime_1.jsx)(ui_1.Button, { ref: backButtonRef, variant: "ghost", type: "button", className: "memori-chat-resume-drawer--header-icon-button", onClick: onBack || onClose, "aria-label": "Back", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowLeft, { size: 16 }) }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-resume-drawer--header-main", children: [(0, jsx_runtime_1.jsx)("h2", { className: "memori-chat-resume-drawer--title", title: safeTitle, children: safeTitle }), (0, jsx_runtime_1.jsx)("p", { className: "memori-chat-resume-drawer--subtitle", children: session.subtitle })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-resume-drawer--thread", children: [isLoading && ((0, jsx_runtime_1.jsx)("div", { className: "memori-chat-resume-drawer--skeletons", children: [0, 1, 2].map(item => ((0, jsx_runtime_1.jsx)("div", { className: "memori-chat-resume-drawer--skeleton-bubble" }, item))) })), !isLoading && ((0, jsx_runtime_1.jsx)("div", { className: "memori-chat-resume-drawer--embedded-chat", children: (0, jsx_runtime_1.jsx)(Chat_1.default, { 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 }) }))] }), (0, jsx_runtime_1.jsx)("footer", { className: "memori-chat-resume-drawer--actions", children: (0, jsx_runtime_1.jsxs)(ui_1.Button, { className: "memori-chat-resume-drawer--resume-cta", variant: "primary", onClick: () => onResume(), children: ["Riprendi conversazione ", (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowUpRight, { size: 16 })] }) })] }));
|
|
99
|
+
if (embedded) {
|
|
100
|
+
return (0, jsx_runtime_1.jsx)("div", { className: "memori-chat-resume-drawer--embedded-shell", children: content });
|
|
101
|
+
}
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `memori-chat-resume-drawer ${isVisible ? 'memori-chat-resume-drawer--open' : ''}`, role: "dialog", "aria-modal": "true", "aria-label": "Riprendi conversazione", children: [(0, jsx_runtime_1.jsx)(ui_1.Button, { className: "memori-chat-resume-drawer--backdrop", type: "button", "aria-label": "Close resume drawer", onClick: onClose }), content] }));
|
|
103
|
+
};
|
|
104
|
+
exports.default = ChatResumeDrawer;
|
|
105
|
+
//# sourceMappingURL=ChatResumeDrawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatResumeDrawer.js","sourceRoot":"","sources":["../../../src/components/ChatHistoryDrawer/ChatResumeDrawer.tsx"],"names":[],"mappings":";;;;AAAA,iCAAoE;AACpE,sCAAuC;AAEvC,+CAAuD;AACvD,+CAAgD;AAChD,gEAAgC;AAChC,kCAAgC;AAgChC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,oBAAoB;IAC9B,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,EAAE;IACb,oBAAoB,EAAE,KAAK;CAClB,CAAC;AACZ,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEtB,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAU,EAAE;IACnD,OAAO,KAAK;SACT,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC;SAChC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAU,EAAE,CACrD,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAElC,MAAM,gBAAgB,GAAG,CAAC,EACxB,MAAM,EACN,OAAO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F,IACL,CACP,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,gCAAK,SAAS,EAAC,2CAA2C,YAAE,OAAO,GAAO,CAAC;IACpF,CAAC;IAED,OAAO,CACL,iCACE,SAAS,EAAE,6BACT,SAAS,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAClD,EAAE,EACF,IAAI,EAAC,QAAQ,gBACF,MAAM,gBACN,wBAAwB,aAEnC,uBAAC,WAAM,IACL,SAAS,EAAC,qCAAqC,EAC/C,IAAI,EAAC,QAAQ,gBACF,qBAAqB,EAChC,OAAO,EAAE,OAAO,GAChB,EACD,OAAO,IACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,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,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const react_i18next_1 = require("react-i18next");
|
|
8
|
+
const Button_1 = tslib_1.__importDefault(require("../ui/Button"));
|
|
9
|
+
const Dropdown_1 = tslib_1.__importDefault(require("../ui/Dropdown"));
|
|
10
|
+
const GasStation_1 = tslib_1.__importDefault(require("../icons/GasStation"));
|
|
11
|
+
const llmUsage_1 = require("../../helpers/llmUsage");
|
|
12
|
+
const getMetricValue = (metric) => {
|
|
13
|
+
if (typeof metric === 'number' && Number.isFinite(metric))
|
|
14
|
+
return metric;
|
|
15
|
+
if (!metric || typeof metric !== 'object')
|
|
16
|
+
return undefined;
|
|
17
|
+
if (typeof metric.parsedValue === 'number' &&
|
|
18
|
+
Number.isFinite(metric.parsedValue)) {
|
|
19
|
+
return metric.parsedValue;
|
|
20
|
+
}
|
|
21
|
+
if (typeof metric.source === 'string') {
|
|
22
|
+
const parsed = Number(metric.source);
|
|
23
|
+
if (Number.isFinite(parsed))
|
|
24
|
+
return parsed;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
};
|
|
28
|
+
const formatMetricValue = (value, locale) => new Intl.NumberFormat(locale, {
|
|
29
|
+
minimumFractionDigits: 0,
|
|
30
|
+
maximumFractionDigits: Math.abs(value) >= 1 ? 3 : 4,
|
|
31
|
+
}).format(value);
|
|
32
|
+
const formatCountValue = (value, locale) => new Intl.NumberFormat(locale, {
|
|
33
|
+
maximumFractionDigits: 0,
|
|
34
|
+
}).format(value);
|
|
35
|
+
const formatImpactInReadableUnit = (value, metricType, locale) => {
|
|
36
|
+
const absValue = Math.abs(value);
|
|
37
|
+
if (metricType === 'energy') {
|
|
38
|
+
if (absValue >= 1)
|
|
39
|
+
return `${formatMetricValue(value, locale)} kWh`;
|
|
40
|
+
const wh = value * 1000;
|
|
41
|
+
if (Math.abs(wh) >= 1)
|
|
42
|
+
return `${formatMetricValue(wh, locale)} Wh`;
|
|
43
|
+
return `${formatMetricValue(wh * 1000, locale)} mWh`;
|
|
44
|
+
}
|
|
45
|
+
if (metricType === 'co2') {
|
|
46
|
+
if (absValue >= 1)
|
|
47
|
+
return `${formatMetricValue(value, locale)} kg`;
|
|
48
|
+
const g = value * 1000;
|
|
49
|
+
if (Math.abs(g) >= 1)
|
|
50
|
+
return `${formatMetricValue(g, locale)} g`;
|
|
51
|
+
return `${formatMetricValue(g * 1000, locale)} mg`;
|
|
52
|
+
}
|
|
53
|
+
if (absValue >= 1)
|
|
54
|
+
return `${formatMetricValue(value, locale)} L`;
|
|
55
|
+
const ml = value * 1000;
|
|
56
|
+
if (Math.abs(ml) >= 1)
|
|
57
|
+
return `${formatMetricValue(ml, locale)} mL`;
|
|
58
|
+
return `${formatMetricValue(ml * 1000, locale)} μL`;
|
|
59
|
+
};
|
|
60
|
+
const ChatConsumptionDropdown = ({ history, hasSpacedButtons = false, }) => {
|
|
61
|
+
const { t, i18n } = (0, react_i18next_1.useTranslation)();
|
|
62
|
+
const currentLocale = i18n.language || navigator.language || 'en';
|
|
63
|
+
const chatLog = (0, react_1.useMemo)(() => ({ lines: history }), [history]);
|
|
64
|
+
const chatConsumptionTotals = (0, react_1.useMemo)(() => {
|
|
65
|
+
var _a;
|
|
66
|
+
const totals = {
|
|
67
|
+
totalInputTokens: 0,
|
|
68
|
+
totalOutputTokens: 0,
|
|
69
|
+
energy: 0,
|
|
70
|
+
gwp: 0,
|
|
71
|
+
wcf: 0,
|
|
72
|
+
models: new Set(),
|
|
73
|
+
};
|
|
74
|
+
((_a = chatLog === null || chatLog === void 0 ? void 0 : chatLog.lines) !== null && _a !== void 0 ? _a : []).forEach(line => {
|
|
75
|
+
var _a, _b, _c, _d, _e;
|
|
76
|
+
const llmUsage = line.llmUsage;
|
|
77
|
+
if (!llmUsage)
|
|
78
|
+
return;
|
|
79
|
+
totals.totalInputTokens += (_a = llmUsage.totalInputTokens) !== null && _a !== void 0 ? _a : 0;
|
|
80
|
+
totals.totalOutputTokens += (_b = llmUsage.outputTokens) !== null && _b !== void 0 ? _b : 0;
|
|
81
|
+
if (llmUsage.provider || llmUsage.model) {
|
|
82
|
+
totals.models.add([llmUsage.provider, llmUsage.model].filter(Boolean).join(' · '));
|
|
83
|
+
}
|
|
84
|
+
if (!llmUsage.energyImpact)
|
|
85
|
+
return;
|
|
86
|
+
const impact = llmUsage.energyImpact;
|
|
87
|
+
totals.energy += (_c = getMetricValue(impact.energy)) !== null && _c !== void 0 ? _c : 0;
|
|
88
|
+
totals.gwp += (_d = getMetricValue(impact.gwp)) !== null && _d !== void 0 ? _d : 0;
|
|
89
|
+
totals.wcf += (_e = getMetricValue(impact.wcf)) !== null && _e !== void 0 ? _e : 0;
|
|
90
|
+
});
|
|
91
|
+
return totals;
|
|
92
|
+
}, [chatLog]);
|
|
93
|
+
const llmUsageModels = (0, react_1.useMemo)(() => Array.from(chatConsumptionTotals.models), [chatConsumptionTotals.models]);
|
|
94
|
+
const hasConsumptionData = (0, react_1.useMemo)(() => {
|
|
95
|
+
var _a;
|
|
96
|
+
return ((_a = chatLog === null || chatLog === void 0 ? void 0 : chatLog.lines) !== null && _a !== void 0 ? _a : []).some(line => !!line.llmUsage);
|
|
97
|
+
}, [chatLog]);
|
|
98
|
+
if (!hasConsumptionData)
|
|
99
|
+
return null;
|
|
100
|
+
return ((0, jsx_runtime_1.jsx)(Dropdown_1.default, { placement: "bottom-right", trigger: (0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, shape: "circle", className: (0, classnames_1.default)('memori-header--button', 'memori-header--button--sustainability', hasSpacedButtons && 'memori-header--button-spaced'), title: t('write_and_speak.showMessageConsumptionLabel') || 'LLM consumption', icon: (0, jsx_runtime_1.jsx)(GasStation_1.default, { className: "memori-header--button--sustainability-icon" }) }), children: (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability", children: [(0, jsx_runtime_1.jsx)("h4", { className: "memori-dropdown--sustainability-title", children: t('chatLogs.totalChatConsumptionTitle') || 'Consumo Totale Chat' }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-section", children: [(0, jsx_runtime_1.jsx)("h5", { className: "memori-dropdown--sustainability-section-title", children: t('chatLogs.modelUsage') || 'Model usage' }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-summary", children: [(0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-stat", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--sustainability-stat-label", children: t('chatLogs.input') || 'Input' }), (0, jsx_runtime_1.jsx)("strong", { className: "memori-dropdown--sustainability-stat-value", children: formatCountValue(chatConsumptionTotals.totalInputTokens, currentLocale) }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--sustainability-stat-meta", children: t('chatLogs.tokens') || 'Tokens' })] }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-stat", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--sustainability-stat-label", children: t('chatLogs.output') || 'Output' }), (0, jsx_runtime_1.jsx)("strong", { className: "memori-dropdown--sustainability-stat-value", children: formatCountValue(chatConsumptionTotals.totalOutputTokens, currentLocale) }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--sustainability-stat-meta", children: t('chatLogs.tokens') || 'Tokens' })] })] }), llmUsageModels.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-row memori-dropdown--sustainability-row--stacked", children: [(0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--sustainability-label", children: [t('chatLogs.provider') || 'Provider', " /", ' ', t('chatLogs.model') || 'Model'] }), (0, jsx_runtime_1.jsx)("div", { className: "memori-dropdown--sustainability-tags", children: llmUsageModels.map(modelLabel => ((0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--sustainability-tag", children: modelLabel }, modelLabel))) })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-metrics", children: [(0, jsx_runtime_1.jsx)("h5", { className: "memori-dropdown--sustainability-section-title", children: t('chatLogs.environmentalImpact') || 'Environmental impact' }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-row", children: [(0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--sustainability-label", children: [(0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", children: llmUsage_1.BADGE_EMOJI.energy }), ' ', t('chatLogs.energy') || 'Energy'] }), (0, jsx_runtime_1.jsx)("strong", { className: "memori-dropdown--sustainability-value", children: formatImpactInReadableUnit(chatConsumptionTotals.energy, 'energy', currentLocale) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-row", children: [(0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--sustainability-label", children: [(0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", children: llmUsage_1.BADGE_EMOJI.co2 }), ' ', t('chatLogs.co2') || 'CO2'] }), (0, jsx_runtime_1.jsx)("strong", { className: "memori-dropdown--sustainability-value", children: formatImpactInReadableUnit(chatConsumptionTotals.gwp, 'co2', currentLocale) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--sustainability-row", children: [(0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--sustainability-label", children: [(0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", children: llmUsage_1.BADGE_EMOJI.water }), ' ', t('chatLogs.water') || 'Water'] }), (0, jsx_runtime_1.jsx)("strong", { className: "memori-dropdown--sustainability-value", children: formatImpactInReadableUnit(chatConsumptionTotals.wcf, 'water', currentLocale) })] })] })] }) }));
|
|
101
|
+
};
|
|
102
|
+
exports.default = ChatConsumptionDropdown;
|
|
103
|
+
//# sourceMappingURL=ChatConsumptionDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatConsumptionDropdown.js","sourceRoot":"","sources":["../../../src/components/Header/ChatConsumptionDropdown.tsx"],"names":[],"mappings":";;;;AAAA,iCAAuC;AACvC,oEAA4B;AAE5B,iDAA+C;AAC/C,kEAAkC;AAClC,sEAAsC;AACtC,6EAA6C;AAC7C,qDAAqD;AAuBrD,MAAM,cAAc,GAAG,CACrB,MAA2D,EACvC,EAAE;IACtB,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACzE,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS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