@memori.ai/memori-react 8.32.0 → 8.34.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 +20 -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 +9 -0
- package/dist/components/Header/ChatConsumptionDropdown.js +104 -0
- package/dist/components/Header/ChatConsumptionDropdown.js.map +1 -0
- package/dist/components/Header/Header.css +122 -19
- 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/ui/Tooltip.js +6 -3
- package/dist/components/ui/Tooltip.js.map +1 -1
- package/dist/locales/de.json +2 -0
- package/dist/locales/en.json +2 -0
- package/dist/locales/es.json +2 -0
- package/dist/locales/fr.json +2 -0
- package/dist/locales/it.json +2 -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 +9 -0
- package/esm/components/Header/ChatConsumptionDropdown.js +101 -0
- package/esm/components/Header/ChatConsumptionDropdown.js.map +1 -0
- package/esm/components/Header/Header.css +122 -19
- 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/ui/Tooltip.js +6 -3
- package/esm/components/ui/Tooltip.js.map +1 -1
- package/esm/locales/de.json +2 -0
- package/esm/locales/en.json +2 -0
- package/esm/locales/es.json +2 -0
- package/esm/locales/fr.json +2 -0
- package/esm/locales/it.json +2 -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 +117 -0
- package/src/components/Header/ChatConsumptionDropdown.tsx +275 -0
- package/src/components/Header/Header.css +122 -19
- 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/ui/Tooltip.tsx +12 -3
- package/src/locales/de.json +2 -0
- package/src/locales/en.json +2 -0
- package/src/locales/es.json +2 -0
- package/src/locales/fr.json +2 -0
- package/src/locales/it.json +2 -0
- package/src/version.ts +1 -1
|
@@ -4,7 +4,7 @@ import { memori, tenant, history } from '../../mocks/data';
|
|
|
4
4
|
import I18nWrapper from '../../I18nWrapper';
|
|
5
5
|
import Header, { Props } from './Header';
|
|
6
6
|
import SettingsDrawer from '../SettingsDrawer/SettingsDrawer';
|
|
7
|
-
import LoginDrawer from '../LoginDrawer/LoginDrawer';
|
|
7
|
+
import LoginDrawer from '../LoginDrawer/LoginDrawer';
|
|
8
8
|
import { ArtifactProvider } from '../MemoriArtifactSystem/context/ArtifactContext';
|
|
9
9
|
|
|
10
10
|
import './Header.css';
|
|
@@ -42,6 +42,13 @@ const historyWithConsumption = [
|
|
|
42
42
|
...history[history.length - 1],
|
|
43
43
|
text: 'Second sustainability sample',
|
|
44
44
|
llmUsage: {
|
|
45
|
+
provider: 'OpenAI',
|
|
46
|
+
model: 'gpt-5',
|
|
47
|
+
totalInputTokens: 19168,
|
|
48
|
+
inputCacheReadTokens: 0,
|
|
49
|
+
inputCacheWriteTokens: 0,
|
|
50
|
+
outputTokens: 588,
|
|
51
|
+
durationMs: 13697,
|
|
45
52
|
energyImpact: {
|
|
46
53
|
energy: 0.0008,
|
|
47
54
|
gwp: { source: '0.00035' },
|
|
@@ -64,46 +71,46 @@ const Template: Story<Props> = args => {
|
|
|
64
71
|
return (
|
|
65
72
|
<I18nWrapper>
|
|
66
73
|
<ArtifactProvider>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
74
|
+
<Header
|
|
75
|
+
{...args}
|
|
76
|
+
speakerMuted={speakerMuted}
|
|
77
|
+
setSpeakerMuted={setSpeakerMuted}
|
|
78
|
+
showSettings
|
|
79
|
+
setShowSettingsDrawer={() => setShowSettingsDrawer(true)}
|
|
80
|
+
setShowKnownFactsDrawer={() => setShowKnownFactsDrawer(true)}
|
|
81
|
+
setShowExpertsDrawer={() => setShowExpertsDrawer(true)}
|
|
82
|
+
setShowLoginDrawer={() => setShowLoginDrawer(true)}
|
|
83
|
+
/>
|
|
84
|
+
<SettingsDrawer
|
|
85
|
+
open={!!showSettingsDrawer}
|
|
86
|
+
onClose={() => setShowSettingsDrawer(false)}
|
|
87
|
+
microphoneMode="HOLD_TO_TALK"
|
|
88
|
+
setMicrophoneMode={() => {}}
|
|
89
|
+
continuousSpeechTimeout={2}
|
|
90
|
+
setContinuousSpeechTimeout={() => {}}
|
|
91
|
+
controlsPosition="bottom"
|
|
92
|
+
setControlsPosition={() => {}}
|
|
93
|
+
hideEmissions={false}
|
|
94
|
+
setHideEmissions={() => {}}
|
|
95
|
+
setAvatarType={() => {}}
|
|
96
|
+
setEnablePositionControls={() => {}}
|
|
97
|
+
/>
|
|
98
|
+
<LoginDrawer
|
|
99
|
+
setUser={() => {}}
|
|
100
|
+
tenant={tenant}
|
|
101
|
+
open={!!showLoginDrawer}
|
|
102
|
+
onClose={() => setShowLoginDrawer(false)}
|
|
103
|
+
onLogin={(user, token) => {
|
|
104
|
+
console.log(user, token);
|
|
105
|
+
setShowLoginDrawer(false);
|
|
106
|
+
}}
|
|
107
|
+
onLogout={() => setShowLoginDrawer(false)}
|
|
108
|
+
apiClient={
|
|
109
|
+
{
|
|
110
|
+
backend: {},
|
|
111
|
+
} as any
|
|
112
|
+
}
|
|
113
|
+
/>
|
|
107
114
|
</ArtifactProvider>
|
|
108
115
|
</I18nWrapper>
|
|
109
116
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect,
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import {
|
|
4
4
|
Memori,
|
|
@@ -23,13 +23,12 @@ import DeepThought from '../icons/DeepThought';
|
|
|
23
23
|
import Group from '../icons/Group';
|
|
24
24
|
import UserIcon from '../icons/User';
|
|
25
25
|
import MessageIcon from '../icons/Message';
|
|
26
|
-
import GasStation from '../icons/GasStation';
|
|
27
26
|
import Logout from '../icons/Logout';
|
|
28
27
|
import { getErrori18nKey } from '../../helpers/error';
|
|
29
28
|
import toast from 'react-hot-toast';
|
|
30
29
|
import memoriApiClient from '@memori.ai/memori-api-client';
|
|
31
30
|
import { Props as WidgetProps } from '../MemoriWidget/MemoriWidget';
|
|
32
|
-
import
|
|
31
|
+
import ChatConsumptionDropdown from './ChatConsumptionDropdown';
|
|
33
32
|
|
|
34
33
|
const imgMimeTypes = ['image/jpeg', 'image/png', 'image/jpg', 'image/gif'];
|
|
35
34
|
|
|
@@ -106,90 +105,6 @@ const Header: React.FC<Props> = ({
|
|
|
106
105
|
const { uploadAsset, pwlUpdateUser } = apiClient.backend;
|
|
107
106
|
const [fullScreenAvailable, setFullScreenAvailable] = useState(false);
|
|
108
107
|
const [fullScreen, setFullScreen] = useState(false);
|
|
109
|
-
|
|
110
|
-
type ImpactMetricType = 'energy' | 'co2' | 'water';
|
|
111
|
-
|
|
112
|
-
type LlmUsageEnergyImpact = {
|
|
113
|
-
energy?: number | { source?: string; parsedValue?: number };
|
|
114
|
-
gwp?: number | { source?: string; parsedValue?: number };
|
|
115
|
-
wcf?: number | { source?: string; parsedValue?: number };
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const getMetricValue = (
|
|
119
|
-
metric?: number | { source?: string; parsedValue?: number },
|
|
120
|
-
): number | undefined => {
|
|
121
|
-
if (typeof metric === 'number' && Number.isFinite(metric)) return metric;
|
|
122
|
-
if (!metric || typeof metric !== 'object') return undefined;
|
|
123
|
-
if (
|
|
124
|
-
typeof metric.parsedValue === 'number' &&
|
|
125
|
-
Number.isFinite(metric.parsedValue)
|
|
126
|
-
) {
|
|
127
|
-
return metric.parsedValue;
|
|
128
|
-
}
|
|
129
|
-
if (typeof metric.source === 'string') {
|
|
130
|
-
const parsed = Number(metric.source);
|
|
131
|
-
if (Number.isFinite(parsed)) return parsed;
|
|
132
|
-
}
|
|
133
|
-
return undefined;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const formatMetricValue = (value: number, locale: string): string =>
|
|
137
|
-
new Intl.NumberFormat(locale, {
|
|
138
|
-
minimumFractionDigits: 0,
|
|
139
|
-
maximumFractionDigits: Math.abs(value) >= 1 ? 3 : 4,
|
|
140
|
-
}).format(value);
|
|
141
|
-
|
|
142
|
-
const formatImpactInReadableUnit = (
|
|
143
|
-
value: number,
|
|
144
|
-
metricType: ImpactMetricType,
|
|
145
|
-
locale: string,
|
|
146
|
-
): string => {
|
|
147
|
-
const absValue = Math.abs(value);
|
|
148
|
-
|
|
149
|
-
if (metricType === 'energy') {
|
|
150
|
-
if (absValue >= 1) return `${formatMetricValue(value, locale)} kWh`;
|
|
151
|
-
const wh = value * 1000;
|
|
152
|
-
if (Math.abs(wh) >= 1) return `${formatMetricValue(wh, locale)} Wh`;
|
|
153
|
-
return `${formatMetricValue(wh * 1000, locale)} mWh`;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (metricType === 'co2') {
|
|
157
|
-
if (absValue >= 1) return `${formatMetricValue(value, locale)} kg`;
|
|
158
|
-
const g = value * 1000;
|
|
159
|
-
if (Math.abs(g) >= 1) return `${formatMetricValue(g, locale)} g`;
|
|
160
|
-
return `${formatMetricValue(g * 1000, locale)} mg`;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (absValue >= 1) return `${formatMetricValue(value, locale)} L`;
|
|
164
|
-
const ml = value * 1000;
|
|
165
|
-
if (Math.abs(ml) >= 1) return `${formatMetricValue(ml, locale)} mL`;
|
|
166
|
-
return `${formatMetricValue(ml * 1000, locale)} μL`;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
const currentLocale = i18n.language || navigator.language || 'en';
|
|
170
|
-
const chatLog = useMemo(() => ({ lines: history }), [history]);
|
|
171
|
-
const sustainabilityTotals = useMemo(() => {
|
|
172
|
-
const totals = { energy: 0, gwp: 0, wcf: 0 };
|
|
173
|
-
(chatLog?.lines ?? []).forEach(line => {
|
|
174
|
-
const energyImpact = (line as Message & {
|
|
175
|
-
llmUsage?: { energyImpact?: LlmUsageEnergyImpact };
|
|
176
|
-
}).llmUsage?.energyImpact;
|
|
177
|
-
if (!energyImpact) return;
|
|
178
|
-
totals.energy += getMetricValue(energyImpact.energy) ?? 0;
|
|
179
|
-
totals.gwp += getMetricValue(energyImpact.gwp) ?? 0;
|
|
180
|
-
totals.wcf += getMetricValue(energyImpact.wcf) ?? 0;
|
|
181
|
-
});
|
|
182
|
-
return totals;
|
|
183
|
-
}, [chatLog]);
|
|
184
|
-
const hasSustainabilityData = useMemo(
|
|
185
|
-
() =>
|
|
186
|
-
(chatLog?.lines ?? []).some(
|
|
187
|
-
line =>
|
|
188
|
-
!!(line as Message & { llmUsage?: { energyImpact?: LlmUsageEnergyImpact } })
|
|
189
|
-
.llmUsage?.energyImpact
|
|
190
|
-
),
|
|
191
|
-
[chatLog]
|
|
192
|
-
);
|
|
193
108
|
useEffect(() => {
|
|
194
109
|
if (document.fullscreenEnabled) {
|
|
195
110
|
setFullScreenAvailable(true);
|
|
@@ -307,66 +222,11 @@ const Header: React.FC<Props> = ({
|
|
|
307
222
|
onClick={() => setShowChatHistoryDrawer(true)}
|
|
308
223
|
/>
|
|
309
224
|
)}
|
|
310
|
-
{showMessageConsumption &&
|
|
311
|
-
<
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
primary
|
|
316
|
-
shape="circle"
|
|
317
|
-
className={cx('memori-header--button', 'memori-header--button--sustainability', hasSpacedButtons && 'memori-header--button-spaced')}
|
|
318
|
-
title={t('write_and_speak.showMessageConsumptionLabel') || 'LLM consumption'}
|
|
319
|
-
icon={<GasStation className="memori-header--button--sustainability-icon" />}
|
|
320
|
-
/>
|
|
321
|
-
}
|
|
322
|
-
>
|
|
323
|
-
<div className="memori-dropdown--sustainability">
|
|
324
|
-
<h4 className="memori-dropdown--sustainability-title">
|
|
325
|
-
{t('chatLogs.totalChatConsumptionTitle') || 'Consumo Totale Chat'}
|
|
326
|
-
</h4>
|
|
327
|
-
<div className="memori-dropdown--sustainability-metrics">
|
|
328
|
-
<div className="memori-dropdown--sustainability-row">
|
|
329
|
-
<span className="memori-dropdown--sustainability-label">
|
|
330
|
-
<span aria-hidden="true">{BADGE_EMOJI.energy}</span>{' '}
|
|
331
|
-
{t('chatLogs.energy') || 'Energy'}
|
|
332
|
-
</span>
|
|
333
|
-
<strong className="memori-dropdown--sustainability-value">
|
|
334
|
-
{formatImpactInReadableUnit(
|
|
335
|
-
sustainabilityTotals.energy,
|
|
336
|
-
'energy',
|
|
337
|
-
currentLocale
|
|
338
|
-
)}
|
|
339
|
-
</strong>
|
|
340
|
-
</div>
|
|
341
|
-
<div className="memori-dropdown--sustainability-row">
|
|
342
|
-
<span className="memori-dropdown--sustainability-label">
|
|
343
|
-
<span aria-hidden="true">{BADGE_EMOJI.co2}</span>{' '}
|
|
344
|
-
{t('chatLogs.co2') || 'CO2'}
|
|
345
|
-
</span>
|
|
346
|
-
<strong className="memori-dropdown--sustainability-value">
|
|
347
|
-
{formatImpactInReadableUnit(
|
|
348
|
-
sustainabilityTotals.gwp,
|
|
349
|
-
'co2',
|
|
350
|
-
currentLocale
|
|
351
|
-
)}
|
|
352
|
-
</strong>
|
|
353
|
-
</div>
|
|
354
|
-
<div className="memori-dropdown--sustainability-row">
|
|
355
|
-
<span className="memori-dropdown--sustainability-label">
|
|
356
|
-
<span aria-hidden="true">{BADGE_EMOJI.water}</span>{' '}
|
|
357
|
-
{t('chatLogs.water') || 'Water'}
|
|
358
|
-
</span>
|
|
359
|
-
<strong className="memori-dropdown--sustainability-value">
|
|
360
|
-
{formatImpactInReadableUnit(
|
|
361
|
-
sustainabilityTotals.wcf,
|
|
362
|
-
'water',
|
|
363
|
-
currentLocale
|
|
364
|
-
)}
|
|
365
|
-
</strong>
|
|
366
|
-
</div>
|
|
367
|
-
</div>
|
|
368
|
-
</div>
|
|
369
|
-
</Dropdown>
|
|
225
|
+
{showMessageConsumption && (
|
|
226
|
+
<ChatConsumptionDropdown
|
|
227
|
+
history={history}
|
|
228
|
+
hasSpacedButtons={hasSpacedButtons}
|
|
229
|
+
/>
|
|
370
230
|
)}
|
|
371
231
|
{fullScreenAvailable && (
|
|
372
232
|
<Button
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
.memori-chat-inputs--mic {
|
|
5
2
|
z-index: 1;
|
|
6
3
|
margin-left: 0.33rem;
|
|
@@ -117,6 +114,20 @@
|
|
|
117
114
|
color: red !important;
|
|
118
115
|
}
|
|
119
116
|
|
|
117
|
+
.memori-chat-inputs--mic-tooltip.memori-tooltip--align-topLeft .memori-tooltip--content {
|
|
118
|
+
top: -50%;
|
|
119
|
+
right: 115%;
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: 100%;
|
|
122
|
+
background: rgba(0, 0, 0, 0.8);
|
|
123
|
+
color: #fff;
|
|
124
|
+
font-size: 0.85em;
|
|
125
|
+
opacity: 0;
|
|
126
|
+
text-align: center;
|
|
127
|
+
/* left: 0; */
|
|
128
|
+
transform: translateY(-100%);
|
|
129
|
+
}
|
|
130
|
+
|
|
120
131
|
/* Mobile-specific improvements for listening state */
|
|
121
132
|
@media (hover: none) and (pointer: coarse) {
|
|
122
133
|
.memori-chat-inputs--mic.memori-chat-inputs--mic--listening {
|
|
@@ -49,7 +49,7 @@ const MicrophoneButton = ({
|
|
|
49
49
|
e.preventDefault();
|
|
50
50
|
e.stopPropagation();
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
if (intervalRef.current) {
|
|
54
54
|
clearTimeout(intervalRef.current);
|
|
55
55
|
intervalRef.current = null;
|
|
@@ -64,13 +64,21 @@ const MicrophoneButton = ({
|
|
|
64
64
|
e.stopPropagation();
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
const handleTouchStart = (
|
|
67
|
+
const handleTouchStart = (
|
|
68
|
+
e:
|
|
69
|
+
| React.TouchEvent<HTMLButtonElement>
|
|
70
|
+
| React.MouseEvent<Element, MouseEvent>
|
|
71
|
+
) => {
|
|
68
72
|
e.preventDefault();
|
|
69
73
|
e.stopPropagation();
|
|
70
74
|
startHold(e);
|
|
71
75
|
};
|
|
72
76
|
|
|
73
|
-
const handleTouchEnd = (
|
|
77
|
+
const handleTouchEnd = (
|
|
78
|
+
e:
|
|
79
|
+
| React.TouchEvent<HTMLButtonElement>
|
|
80
|
+
| React.MouseEvent<Element, MouseEvent>
|
|
81
|
+
) => {
|
|
74
82
|
e.preventDefault();
|
|
75
83
|
e.stopPropagation();
|
|
76
84
|
stopHold(e);
|
|
@@ -83,6 +91,7 @@ const MicrophoneButton = ({
|
|
|
83
91
|
return (
|
|
84
92
|
<Tooltip
|
|
85
93
|
visible={!!micBtnTooltip}
|
|
94
|
+
className="memori-chat-inputs--mic-tooltip"
|
|
86
95
|
content={
|
|
87
96
|
<span>
|
|
88
97
|
{micBtnTooltip ||
|
|
@@ -5,7 +5,13 @@ import cx from 'classnames';
|
|
|
5
5
|
export interface Props {
|
|
6
6
|
content: string | JSX.Element | React.ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
-
align?:
|
|
8
|
+
align?:
|
|
9
|
+
| 'left'
|
|
10
|
+
| 'right'
|
|
11
|
+
| 'topLeft'
|
|
12
|
+
| 'topRight'
|
|
13
|
+
| 'bottomLeft'
|
|
14
|
+
| 'bottomRight';
|
|
9
15
|
disabled?: boolean;
|
|
10
16
|
children: React.ReactNode;
|
|
11
17
|
visible?: boolean;
|
|
@@ -73,7 +79,10 @@ const Tooltip: FC<Props> = ({
|
|
|
73
79
|
if (!isOpen) return;
|
|
74
80
|
updatePosition();
|
|
75
81
|
const onScrollOrResize = () => updatePosition();
|
|
76
|
-
window.addEventListener('scroll', onScrollOrResize, {
|
|
82
|
+
window.addEventListener('scroll', onScrollOrResize, {
|
|
83
|
+
passive: true,
|
|
84
|
+
capture: true,
|
|
85
|
+
});
|
|
77
86
|
window.addEventListener('resize', onScrollOrResize);
|
|
78
87
|
return () => {
|
|
79
88
|
window.removeEventListener('scroll', onScrollOrResize, true);
|
|
@@ -100,6 +109,7 @@ const Tooltip: FC<Props> = ({
|
|
|
100
109
|
'memori-tooltip',
|
|
101
110
|
'memori-tooltip--portal',
|
|
102
111
|
`memori-tooltip--align-${align}`,
|
|
112
|
+
className,
|
|
103
113
|
{ 'memori-tooltip--visible': true }
|
|
104
114
|
)}
|
|
105
115
|
style={{
|
|
@@ -114,7 +124,6 @@ const Tooltip: FC<Props> = ({
|
|
|
114
124
|
>
|
|
115
125
|
<div
|
|
116
126
|
className="memori-tooltip--content memori-tooltip--content-portal"
|
|
117
|
-
style={{ pointerEvents: 'auto' }}
|
|
118
127
|
onMouseEnter={handleContentEnter}
|
|
119
128
|
onMouseLeave={handleContentLeave}
|
|
120
129
|
>
|
package/src/locales/de.json
CHANGED
|
@@ -384,6 +384,8 @@
|
|
|
384
384
|
"water": "Wasser",
|
|
385
385
|
"usageBadgesHint": "Klicke auf einen dieser Buttons, um mehr Informationen zu sehen",
|
|
386
386
|
"totalChatConsumptionTitle": "Gesamter Chat-Verbrauch",
|
|
387
|
+
"modelUsage": "Modellnutzung",
|
|
388
|
+
"environmentalImpact": "Umweltbelastung",
|
|
387
389
|
"impactComparisonUnavailable": "Indikativer Vergleich nicht verfuegbar.",
|
|
388
390
|
"impactComparisonEnergy": "Indikativer Vergleich: in etwa wie eine 10-W-LED-Lampe fuer {{duration}} eingeschaltet lassen.",
|
|
389
391
|
"impactComparisonCo2": "Indikativer Vergleich: etwa {{distance}} mit einem durchschnittlichen Benzinauto gefahren.",
|
package/src/locales/en.json
CHANGED
|
@@ -455,6 +455,8 @@
|
|
|
455
455
|
"water": "Water",
|
|
456
456
|
"usageBadgesHint": "Click one of these buttons to show more information",
|
|
457
457
|
"totalChatConsumptionTitle": "Total Chat Consumption",
|
|
458
|
+
"modelUsage": "Model usage",
|
|
459
|
+
"environmentalImpact": "Environmental impact",
|
|
458
460
|
"impactComparisonUnavailable": "Indicative comparison unavailable.",
|
|
459
461
|
"impactComparisonEnergy": "Indicative comparison: roughly like keeping a 10 W LED bulb on for {{duration}}.",
|
|
460
462
|
"impactComparisonCo2": "Indicative comparison: about {{distance}} traveled by an average gasoline car.",
|
package/src/locales/es.json
CHANGED
|
@@ -411,6 +411,8 @@
|
|
|
411
411
|
"water": "Agua",
|
|
412
412
|
"usageBadgesHint": "Haz clic en uno de estos botones para ver más información",
|
|
413
413
|
"totalChatConsumptionTitle": "Consumo Total del Chat",
|
|
414
|
+
"modelUsage": "Uso del modelo",
|
|
415
|
+
"environmentalImpact": "Impacto ambiental",
|
|
414
416
|
"impactComparisonUnavailable": "Comparacion indicativa no disponible.",
|
|
415
417
|
"impactComparisonEnergy": "Comparacion indicativa: aproximadamente como mantener encendida una bombilla LED de 10 W durante {{duration}}.",
|
|
416
418
|
"impactComparisonCo2": "Comparacion indicativa: aproximadamente {{distance}} recorridos en un coche de gasolina promedio.",
|
package/src/locales/fr.json
CHANGED
|
@@ -419,6 +419,8 @@
|
|
|
419
419
|
"water": "Eau",
|
|
420
420
|
"usageBadgesHint": "Cliquez sur un de ces boutons pour afficher plus d'informations",
|
|
421
421
|
"totalChatConsumptionTitle": "Consommation Totale du Chat",
|
|
422
|
+
"modelUsage": "Utilisation du modèle",
|
|
423
|
+
"environmentalImpact": "Impact environnemental",
|
|
422
424
|
"impactComparisonUnavailable": "Comparaison indicative non disponible.",
|
|
423
425
|
"impactComparisonEnergy": "Comparaison indicative : environ comme laisser allumee une ampoule LED de 10 W pendant {{duration}}.",
|
|
424
426
|
"impactComparisonCo2": "Comparaison indicative : environ {{distance}} parcourus en voiture essence moyenne.",
|
package/src/locales/it.json
CHANGED
|
@@ -452,6 +452,8 @@
|
|
|
452
452
|
"water": "Acqua",
|
|
453
453
|
"usageBadgesHint": "Clicca uno di questi pulsanti per mostrare maggiori informazioni",
|
|
454
454
|
"totalChatConsumptionTitle": "Consumo Totale Chat",
|
|
455
|
+
"modelUsage": "Utilizzo del modello",
|
|
456
|
+
"environmentalImpact": "Impatto ambientale",
|
|
455
457
|
"impactComparisonUnavailable": "Confronto indicativo non disponibile.",
|
|
456
458
|
"impactComparisonEnergy": "Confronto indicativo: circa quanto tenere accesa una lampadina LED da 10 W per {{duration}}.",
|
|
457
459
|
"impactComparisonCo2": "Confronto indicativo: circa {{distance}} percorsi in auto a benzina media.",
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not edit manually.
|
|
2
|
-
export const version = '8.
|
|
2
|
+
export const version = '8.34.0';
|