@memori.ai/memori-react 2.0.11 → 2.2.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 +29 -0
- package/README.md +74 -26
- package/dist/components/Chat/Chat.d.ts +1 -0
- package/dist/components/Chat/Chat.js +2 -2
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.js +1 -1
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.css +1 -41
- package/dist/components/ChatInputs/ChatInputs.d.ts +1 -0
- package/dist/components/ChatInputs/ChatInputs.js +9 -3
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
- package/dist/components/FeedbackButtons/FeedbackButtons.js +1 -1
- package/dist/components/FeedbackButtons/FeedbackButtons.js.map +1 -1
- package/dist/components/MediaWidget/MediaItemWidget.js +1 -12
- package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.d.ts +17 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +31 -19
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MicrophoneButton/MicrophoneButton.css +101 -0
- package/dist/components/MicrophoneButton/MicrophoneButton.d.ts +9 -0
- package/dist/components/MicrophoneButton/MicrophoneButton.js +46 -0
- package/dist/components/MicrophoneButton/MicrophoneButton.js.map +1 -0
- package/dist/components/SettingsDrawer/SettingsDrawer.d.ts +3 -3
- package/dist/components/SettingsDrawer/SettingsDrawer.js +8 -6
- package/dist/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
- package/dist/components/SettingsDrawer/SettingsDrawer.test.js +7 -7
- package/dist/components/SettingsDrawer/SettingsDrawer.test.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.js +1 -1
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/layouts/FullPage.d.ts +2 -15
- package/dist/components/layouts/FullPage.js.map +1 -1
- package/dist/components/layouts/Totem.d.ts +2 -15
- package/dist/components/layouts/Totem.js.map +1 -1
- package/dist/components/ui/Button.d.ts +5 -1
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Tooltip.css +33 -2
- package/dist/components/ui/Tooltip.d.ts +2 -1
- package/dist/components/ui/Tooltip.js +1 -2
- package/dist/components/ui/Tooltip.js.map +1 -1
- package/dist/components/ui/Tooltip.test.js +16 -0
- package/dist/components/ui/Tooltip.test.js.map +1 -1
- package/dist/helpers/configuration.js +1 -1
- package/dist/helpers/configuration.js.map +1 -1
- package/dist/helpers/media.js +25 -19
- package/dist/helpers/media.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +4 -0
- package/dist/locales/it.json +4 -0
- package/dist/styles.css +3 -2
- package/esm/components/Chat/Chat.d.ts +1 -0
- package/esm/components/Chat/Chat.js +2 -2
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.js +1 -1
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.css +1 -41
- package/esm/components/ChatInputs/ChatInputs.d.ts +1 -0
- package/esm/components/ChatInputs/ChatInputs.js +9 -3
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
- package/esm/components/FeedbackButtons/FeedbackButtons.js +1 -1
- package/esm/components/FeedbackButtons/FeedbackButtons.js.map +1 -1
- package/esm/components/MediaWidget/MediaItemWidget.js +1 -12
- package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.d.ts +17 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +31 -19
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MicrophoneButton/MicrophoneButton.css +101 -0
- package/esm/components/MicrophoneButton/MicrophoneButton.d.ts +9 -0
- package/esm/components/MicrophoneButton/MicrophoneButton.js +43 -0
- package/esm/components/MicrophoneButton/MicrophoneButton.js.map +1 -0
- package/esm/components/SettingsDrawer/SettingsDrawer.d.ts +3 -3
- package/esm/components/SettingsDrawer/SettingsDrawer.js +9 -7
- package/esm/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
- package/esm/components/SettingsDrawer/SettingsDrawer.test.js +7 -7
- package/esm/components/SettingsDrawer/SettingsDrawer.test.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.js +1 -1
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/layouts/FullPage.d.ts +2 -15
- package/esm/components/layouts/FullPage.js.map +1 -1
- package/esm/components/layouts/Totem.d.ts +2 -15
- package/esm/components/layouts/Totem.js.map +1 -1
- package/esm/components/ui/Button.d.ts +5 -1
- package/esm/components/ui/Button.js +1 -1
- package/esm/components/ui/Button.js.map +1 -1
- package/esm/components/ui/Tooltip.css +33 -2
- package/esm/components/ui/Tooltip.d.ts +2 -1
- package/esm/components/ui/Tooltip.js +1 -2
- package/esm/components/ui/Tooltip.js.map +1 -1
- package/esm/components/ui/Tooltip.test.js +16 -0
- package/esm/components/ui/Tooltip.test.js.map +1 -1
- package/esm/helpers/configuration.js +1 -1
- package/esm/helpers/configuration.js.map +1 -1
- package/esm/helpers/media.js +25 -19
- package/esm/helpers/media.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/locales/en.json +4 -0
- package/esm/locales/it.json +4 -0
- package/esm/styles.css +3 -2
- package/package.json +1 -1
- package/src/components/BlockedMemoriBadge/__snapshots__/BlockedMemoriBadge.test.tsx.snap +4 -4
- package/src/components/Chat/Chat.tsx +3 -0
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +6 -6
- package/src/components/ChatBubble/ChatBubble.tsx +1 -1
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +1 -1
- package/src/components/ChatInputs/ChatInputs.css +1 -41
- package/src/components/ChatInputs/ChatInputs.stories.tsx +50 -3
- package/src/components/ChatInputs/ChatInputs.tsx +20 -3
- package/src/components/ChatInputs/__snapshots__/ChatInputs.test.tsx.snap +160 -85
- package/src/components/FeedbackButtons/FeedbackButtons.tsx +1 -1
- package/src/components/Header/Header.stories.tsx +3 -0
- package/src/components/MediaWidget/MediaItemWidget.tsx +1 -12
- package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +6 -6
- package/src/components/MediaWidget/__snapshots__/MediaWidget.test.tsx.snap +1 -1
- package/src/components/MemoriWidget/MemoriWidget.tsx +53 -18
- package/src/components/MicrophoneButton/MicrophoneButton.css +101 -0
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +49 -0
- package/src/components/MicrophoneButton/MicrophoneButton.tsx +95 -0
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +6 -4
- package/src/components/SettingsDrawer/SettingsDrawer.test.tsx +14 -14
- package/src/components/SettingsDrawer/SettingsDrawer.tsx +57 -25
- package/src/components/StartPanel/StartPanel.tsx +3 -3
- package/src/components/layouts/FullPage.tsx +2 -16
- package/src/components/layouts/Totem.tsx +2 -16
- package/src/components/layouts/layouts.stories.tsx +41 -1
- package/src/components/ui/Button.tsx +21 -1
- package/src/components/ui/Tooltip.css +33 -2
- package/src/components/ui/Tooltip.stories.tsx +40 -3
- package/src/components/ui/Tooltip.test.tsx +52 -0
- package/src/components/ui/Tooltip.tsx +12 -7
- package/src/components/ui/__snapshots__/Tooltip.test.tsx.snap +80 -4
- package/src/helpers/configuration.ts +1 -1
- package/src/helpers/media.ts +29 -23
- package/src/index.tsx +3 -0
- package/src/locales/en.json +4 -0
- package/src/locales/it.json +4 -0
- package/src/styles.css +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
3
|
import ChatInputs, { Props } from './ChatInputs';
|
|
4
4
|
import { dialogState } from '../../mocks/data';
|
|
@@ -22,13 +22,40 @@ const meta: Meta = {
|
|
|
22
22
|
|
|
23
23
|
export default meta;
|
|
24
24
|
|
|
25
|
+
const text =
|
|
26
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
|
27
|
+
.split(' ')
|
|
28
|
+
.reverse();
|
|
29
|
+
|
|
25
30
|
const Template: Story<Props> = args => {
|
|
26
31
|
const [userMessage, setUserMessage] = React.useState(args.userMessage);
|
|
32
|
+
const [listening, setListening] = React.useState(args.listening);
|
|
33
|
+
const startListening = () => setListening(true);
|
|
34
|
+
const stopListening = () => setListening(false);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (listening) {
|
|
38
|
+
const interval = setInterval(() => {
|
|
39
|
+
let nextWord = text.pop();
|
|
40
|
+
|
|
41
|
+
if (!nextWord) {
|
|
42
|
+
clearInterval(interval);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);
|
|
47
|
+
}, Math.random() * 500 + 100);
|
|
48
|
+
return () => clearInterval(interval);
|
|
49
|
+
}
|
|
50
|
+
}, [listening]);
|
|
27
51
|
|
|
28
52
|
return (
|
|
29
53
|
<div style={{ paddingTop: '10rem' }}>
|
|
30
54
|
<ChatInputs
|
|
31
55
|
{...args}
|
|
56
|
+
listening={listening}
|
|
57
|
+
startListening={startListening}
|
|
58
|
+
stopListening={stopListening}
|
|
32
59
|
userMessage={userMessage}
|
|
33
60
|
onChangeUserMessage={setUserMessage}
|
|
34
61
|
/>
|
|
@@ -159,8 +186,27 @@ Disabled.args = {
|
|
|
159
186
|
showMicrophone: true,
|
|
160
187
|
};
|
|
161
188
|
|
|
162
|
-
export const
|
|
163
|
-
|
|
189
|
+
export const ContinuousSpeech = Template.bind({});
|
|
190
|
+
ContinuousSpeech.args = {
|
|
191
|
+
dialogState,
|
|
192
|
+
userMessage: 'Suspendisse sit amet volutpat velit.',
|
|
193
|
+
sendMessage: (msg: string) => console.log(msg),
|
|
194
|
+
onTextareaBlur: () => {},
|
|
195
|
+
onTextareaFocus: () => {},
|
|
196
|
+
onTextareaPressEnter: () => {},
|
|
197
|
+
setAttachmentsMenuOpen: () => {},
|
|
198
|
+
setSendOnEnter: () => {},
|
|
199
|
+
listening: false,
|
|
200
|
+
isPlayingAudio: false,
|
|
201
|
+
stopAudio: () => {},
|
|
202
|
+
startListening: () => {},
|
|
203
|
+
stopListening: () => {},
|
|
204
|
+
showMicrophone: true,
|
|
205
|
+
microphoneMode: 'CONTINUOUS',
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export const ContinuousSpeechListening = Template.bind({});
|
|
209
|
+
ContinuousSpeechListening.args = {
|
|
164
210
|
dialogState,
|
|
165
211
|
userMessage: 'Suspendisse sit amet volutpat velit.',
|
|
166
212
|
sendMessage: (msg: string) => console.log(msg),
|
|
@@ -175,6 +221,7 @@ Listening.args = {
|
|
|
175
221
|
startListening: () => {},
|
|
176
222
|
stopListening: () => {},
|
|
177
223
|
showMicrophone: true,
|
|
224
|
+
microphoneMode: 'CONTINUOUS',
|
|
178
225
|
};
|
|
179
226
|
|
|
180
227
|
export const WithoutMicrophone = Template.bind({});
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { DialogState } from '@memori.ai/memori-api-client/dist/types';
|
|
3
3
|
import UploadMenu from '../UploadMenu/UploadMenu';
|
|
4
4
|
import SendOnEnterMenu from '../SendOnEnterMenu/SendOnEnterMenu';
|
|
5
5
|
import ChatTextArea from '../ChatTextArea/ChatTextArea';
|
|
6
6
|
import Button from '../ui/Button';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import cx from 'classnames';
|
|
9
8
|
import Send from '../icons/Send';
|
|
9
|
+
import MicrophoneButton from '../MicrophoneButton/MicrophoneButton';
|
|
10
|
+
import cx from 'classnames';
|
|
10
11
|
import Microphone from '../icons/Microphone';
|
|
11
12
|
|
|
12
13
|
export interface Props {
|
|
@@ -28,6 +29,7 @@ export interface Props {
|
|
|
28
29
|
startListening: () => void;
|
|
29
30
|
stopListening: () => void;
|
|
30
31
|
showMicrophone?: boolean;
|
|
32
|
+
microphoneMode?: 'CONTINUOUS' | 'HOLD_TO_TALK';
|
|
31
33
|
authToken?: string;
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -45,6 +47,7 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
45
47
|
onTextareaBlur,
|
|
46
48
|
onTextareaPressEnter,
|
|
47
49
|
showMicrophone = false,
|
|
50
|
+
microphoneMode = 'HOLD_TO_TALK',
|
|
48
51
|
listening = false,
|
|
49
52
|
stopAudio,
|
|
50
53
|
startListening,
|
|
@@ -94,7 +97,21 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
94
97
|
title={t('send') || 'Send'}
|
|
95
98
|
icon={<Send />}
|
|
96
99
|
/>
|
|
97
|
-
{showMicrophone && (
|
|
100
|
+
{showMicrophone && microphoneMode === 'HOLD_TO_TALK' && (
|
|
101
|
+
<MicrophoneButton
|
|
102
|
+
listening={listening}
|
|
103
|
+
startListening={startListening}
|
|
104
|
+
stopListening={() => {
|
|
105
|
+
stopListening();
|
|
106
|
+
|
|
107
|
+
if (!!userMessage?.length) {
|
|
108
|
+
sendMessage(userMessage);
|
|
109
|
+
}
|
|
110
|
+
}}
|
|
111
|
+
stopAudio={stopAudio}
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
114
|
+
{showMicrophone && microphoneMode === 'CONTINUOUS' && (
|
|
98
115
|
<Button
|
|
99
116
|
primary
|
|
100
117
|
className={cx('memori-chat-inputs--mic', {
|
|
@@ -88,26 +88,41 @@ exports[`renders ChatInputs disabled unchanged 1`] = `
|
|
|
88
88
|
</svg>
|
|
89
89
|
</span>
|
|
90
90
|
</button>
|
|
91
|
-
<
|
|
92
|
-
class="memori-
|
|
93
|
-
title="write_and_speak.micButtonPopover"
|
|
91
|
+
<div
|
|
92
|
+
class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
|
|
94
93
|
>
|
|
95
|
-
<
|
|
96
|
-
class="memori-
|
|
94
|
+
<div
|
|
95
|
+
class="memori-tooltip--content"
|
|
97
96
|
>
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
<span>
|
|
98
|
+
write_and_speak.pressAndHoldToSpeak
|
|
99
|
+
</span>
|
|
100
|
+
</div>
|
|
101
|
+
<div
|
|
102
|
+
class="memori-tooltip--trigger"
|
|
103
|
+
>
|
|
104
|
+
<button
|
|
105
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic"
|
|
106
|
+
title="write_and_speak.micButtonPopover"
|
|
104
107
|
>
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
<span
|
|
109
|
+
class="memori-button--icon"
|
|
110
|
+
>
|
|
111
|
+
<svg
|
|
112
|
+
aria-hidden="true"
|
|
113
|
+
focusable="false"
|
|
114
|
+
role="img"
|
|
115
|
+
viewBox="0 0 1024 1024"
|
|
116
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
117
|
+
>
|
|
118
|
+
<path
|
|
119
|
+
d="M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
|
|
120
|
+
/>
|
|
121
|
+
</svg>
|
|
122
|
+
</span>
|
|
123
|
+
</button>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
111
126
|
</fieldset>
|
|
112
127
|
</div>
|
|
113
128
|
`;
|
|
@@ -198,26 +213,41 @@ exports[`renders ChatInputs listening unchanged 1`] = `
|
|
|
198
213
|
</svg>
|
|
199
214
|
</span>
|
|
200
215
|
</button>
|
|
201
|
-
<
|
|
202
|
-
class="memori-
|
|
203
|
-
title="write_and_speak.micButtonPopoverListening"
|
|
216
|
+
<div
|
|
217
|
+
class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
|
|
204
218
|
>
|
|
205
|
-
<
|
|
206
|
-
class="memori-
|
|
219
|
+
<div
|
|
220
|
+
class="memori-tooltip--content"
|
|
207
221
|
>
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
222
|
+
<span>
|
|
223
|
+
write_and_speak.pressAndHoldToSpeak
|
|
224
|
+
</span>
|
|
225
|
+
</div>
|
|
226
|
+
<div
|
|
227
|
+
class="memori-tooltip--trigger"
|
|
228
|
+
>
|
|
229
|
+
<button
|
|
230
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic memori-chat-inputs--mic--listening"
|
|
231
|
+
title="write_and_speak.micButtonPopoverListening"
|
|
214
232
|
>
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
233
|
+
<span
|
|
234
|
+
class="memori-button--icon"
|
|
235
|
+
>
|
|
236
|
+
<svg
|
|
237
|
+
aria-hidden="true"
|
|
238
|
+
focusable="false"
|
|
239
|
+
role="img"
|
|
240
|
+
viewBox="0 0 1024 1024"
|
|
241
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
242
|
+
>
|
|
243
|
+
<path
|
|
244
|
+
d="M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
|
|
245
|
+
/>
|
|
246
|
+
</svg>
|
|
247
|
+
</span>
|
|
248
|
+
</button>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
221
251
|
</fieldset>
|
|
222
252
|
</div>
|
|
223
253
|
`;
|
|
@@ -337,26 +367,41 @@ exports[`renders ChatInputs on instruct unchanged 1`] = `
|
|
|
337
367
|
</svg>
|
|
338
368
|
</span>
|
|
339
369
|
</button>
|
|
340
|
-
<
|
|
341
|
-
class="memori-
|
|
342
|
-
title="write_and_speak.micButtonPopover"
|
|
370
|
+
<div
|
|
371
|
+
class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
|
|
343
372
|
>
|
|
344
|
-
<
|
|
345
|
-
class="memori-
|
|
373
|
+
<div
|
|
374
|
+
class="memori-tooltip--content"
|
|
346
375
|
>
|
|
347
|
-
<
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
376
|
+
<span>
|
|
377
|
+
write_and_speak.pressAndHoldToSpeak
|
|
378
|
+
</span>
|
|
379
|
+
</div>
|
|
380
|
+
<div
|
|
381
|
+
class="memori-tooltip--trigger"
|
|
382
|
+
>
|
|
383
|
+
<button
|
|
384
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic"
|
|
385
|
+
title="write_and_speak.micButtonPopover"
|
|
353
386
|
>
|
|
354
|
-
<
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
387
|
+
<span
|
|
388
|
+
class="memori-button--icon"
|
|
389
|
+
>
|
|
390
|
+
<svg
|
|
391
|
+
aria-hidden="true"
|
|
392
|
+
focusable="false"
|
|
393
|
+
role="img"
|
|
394
|
+
viewBox="0 0 1024 1024"
|
|
395
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
396
|
+
>
|
|
397
|
+
<path
|
|
398
|
+
d="M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
|
|
399
|
+
/>
|
|
400
|
+
</svg>
|
|
401
|
+
</span>
|
|
402
|
+
</button>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
360
405
|
</fieldset>
|
|
361
406
|
</div>
|
|
362
407
|
`;
|
|
@@ -446,26 +491,41 @@ exports[`renders ChatInputs unchanged 1`] = `
|
|
|
446
491
|
</svg>
|
|
447
492
|
</span>
|
|
448
493
|
</button>
|
|
449
|
-
<
|
|
450
|
-
class="memori-
|
|
451
|
-
title="write_and_speak.micButtonPopover"
|
|
494
|
+
<div
|
|
495
|
+
class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
|
|
452
496
|
>
|
|
453
|
-
<
|
|
454
|
-
class="memori-
|
|
497
|
+
<div
|
|
498
|
+
class="memori-tooltip--content"
|
|
455
499
|
>
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
500
|
+
<span>
|
|
501
|
+
write_and_speak.pressAndHoldToSpeak
|
|
502
|
+
</span>
|
|
503
|
+
</div>
|
|
504
|
+
<div
|
|
505
|
+
class="memori-tooltip--trigger"
|
|
506
|
+
>
|
|
507
|
+
<button
|
|
508
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic"
|
|
509
|
+
title="write_and_speak.micButtonPopover"
|
|
462
510
|
>
|
|
463
|
-
<
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
511
|
+
<span
|
|
512
|
+
class="memori-button--icon"
|
|
513
|
+
>
|
|
514
|
+
<svg
|
|
515
|
+
aria-hidden="true"
|
|
516
|
+
focusable="false"
|
|
517
|
+
role="img"
|
|
518
|
+
viewBox="0 0 1024 1024"
|
|
519
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
520
|
+
>
|
|
521
|
+
<path
|
|
522
|
+
d="M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
|
|
523
|
+
/>
|
|
524
|
+
</svg>
|
|
525
|
+
</span>
|
|
526
|
+
</button>
|
|
527
|
+
</div>
|
|
528
|
+
</div>
|
|
469
529
|
</fieldset>
|
|
470
530
|
</div>
|
|
471
531
|
`;
|
|
@@ -556,26 +616,41 @@ exports[`renders ChatInputs with user message unchanged 1`] = `
|
|
|
556
616
|
</svg>
|
|
557
617
|
</span>
|
|
558
618
|
</button>
|
|
559
|
-
<
|
|
560
|
-
class="memori-
|
|
561
|
-
title="write_and_speak.micButtonPopover"
|
|
619
|
+
<div
|
|
620
|
+
class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
|
|
562
621
|
>
|
|
563
|
-
<
|
|
564
|
-
class="memori-
|
|
622
|
+
<div
|
|
623
|
+
class="memori-tooltip--content"
|
|
565
624
|
>
|
|
566
|
-
<
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
625
|
+
<span>
|
|
626
|
+
write_and_speak.pressAndHoldToSpeak
|
|
627
|
+
</span>
|
|
628
|
+
</div>
|
|
629
|
+
<div
|
|
630
|
+
class="memori-tooltip--trigger"
|
|
631
|
+
>
|
|
632
|
+
<button
|
|
633
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic"
|
|
634
|
+
title="write_and_speak.micButtonPopover"
|
|
572
635
|
>
|
|
573
|
-
<
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
636
|
+
<span
|
|
637
|
+
class="memori-button--icon"
|
|
638
|
+
>
|
|
639
|
+
<svg
|
|
640
|
+
aria-hidden="true"
|
|
641
|
+
focusable="false"
|
|
642
|
+
role="img"
|
|
643
|
+
viewBox="0 0 1024 1024"
|
|
644
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
645
|
+
>
|
|
646
|
+
<path
|
|
647
|
+
d="M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
|
|
648
|
+
/>
|
|
649
|
+
</svg>
|
|
650
|
+
</span>
|
|
651
|
+
</button>
|
|
652
|
+
</div>
|
|
653
|
+
</div>
|
|
579
654
|
</fieldset>
|
|
580
655
|
</div>
|
|
581
656
|
`;
|
|
@@ -46,6 +46,9 @@ const Template: Story<Props> = args => {
|
|
|
46
46
|
continuousSpeechTimeout={continuousSpeechTimeout}
|
|
47
47
|
setContinuousSpeech={setContinuousSpeech}
|
|
48
48
|
setContinuousSpeechTimeout={setContinuousSpeechTimeout}
|
|
49
|
+
setControlsPosition={() => {}}
|
|
50
|
+
controlsPosition="bottom"
|
|
51
|
+
setHideEmissions={() => {}}
|
|
49
52
|
/>
|
|
50
53
|
</>
|
|
51
54
|
);
|
|
@@ -78,18 +78,7 @@ export const RenderMediaItem = ({
|
|
|
78
78
|
<picture className="memori-media-item--figure">
|
|
79
79
|
{!preview && (
|
|
80
80
|
<source
|
|
81
|
-
srcSet={[
|
|
82
|
-
url,
|
|
83
|
-
getResourceUrl({
|
|
84
|
-
resourceURI: item.content,
|
|
85
|
-
sessionID,
|
|
86
|
-
tenantID,
|
|
87
|
-
baseURL,
|
|
88
|
-
apiURL,
|
|
89
|
-
}),
|
|
90
|
-
item.url,
|
|
91
|
-
item.content,
|
|
92
|
-
].join(', ')}
|
|
81
|
+
srcSet={[url, item.url, item.content].join(', ')}
|
|
93
82
|
type={item.mimeType}
|
|
94
83
|
/>
|
|
95
84
|
)}
|
|
@@ -182,7 +182,7 @@ exports[`renders MediaItemWidget unchanged with img 1`] = `
|
|
|
182
182
|
class="memori-media-item--figure"
|
|
183
183
|
>
|
|
184
184
|
<source
|
|
185
|
-
srcset="https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2,
|
|
185
|
+
srcset="https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2, https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2, "
|
|
186
186
|
type="image/jpeg"
|
|
187
187
|
/>
|
|
188
188
|
<img
|
|
@@ -241,7 +241,7 @@ exports[`renders MediaItemWidget unchanged with img and sessionID 1`] = `
|
|
|
241
241
|
>
|
|
242
242
|
<a
|
|
243
243
|
class="memori-media-item--link"
|
|
244
|
-
href="https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2
|
|
244
|
+
href="https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2"
|
|
245
245
|
rel="noopener noreferrer"
|
|
246
246
|
target="_blank"
|
|
247
247
|
title="Game Cover"
|
|
@@ -259,7 +259,7 @@ exports[`renders MediaItemWidget unchanged with img and sessionID 1`] = `
|
|
|
259
259
|
class="memori-media-item--figure"
|
|
260
260
|
>
|
|
261
261
|
<source
|
|
262
|
-
srcset="https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2
|
|
262
|
+
srcset="https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2, https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2, "
|
|
263
263
|
type="image/jpeg"
|
|
264
264
|
/>
|
|
265
265
|
<img
|
|
@@ -431,7 +431,7 @@ exports[`renders MediaItemWidget with imgs in correct order (creation date) 1`]
|
|
|
431
431
|
class="memori-media-item--figure"
|
|
432
432
|
>
|
|
433
433
|
<source
|
|
434
|
-
srcset="https://memori.ai/past,
|
|
434
|
+
srcset="https://memori.ai/past, https://memori.ai/past, "
|
|
435
435
|
type="image/jpeg"
|
|
436
436
|
/>
|
|
437
437
|
<img
|
|
@@ -495,7 +495,7 @@ exports[`renders MediaItemWidget with imgs in correct order (creation date) 1`]
|
|
|
495
495
|
class="memori-media-item--figure"
|
|
496
496
|
>
|
|
497
497
|
<source
|
|
498
|
-
srcset="https://memori.ai/medium,
|
|
498
|
+
srcset="https://memori.ai/medium, https://memori.ai/medium, "
|
|
499
499
|
type="image/jpeg"
|
|
500
500
|
/>
|
|
501
501
|
<img
|
|
@@ -559,7 +559,7 @@ exports[`renders MediaItemWidget with imgs in correct order (creation date) 1`]
|
|
|
559
559
|
class="memori-media-item--figure"
|
|
560
560
|
>
|
|
561
561
|
<source
|
|
562
|
-
srcset="https://memori.ai/now,
|
|
562
|
+
srcset="https://memori.ai/now, https://memori.ai/now, "
|
|
563
563
|
type="image/jpeg"
|
|
564
564
|
/>
|
|
565
565
|
<img
|
|
@@ -148,7 +148,7 @@ exports[`renders MediaWidget with media unchanged 1`] = `
|
|
|
148
148
|
class="memori-media-item--figure"
|
|
149
149
|
>
|
|
150
150
|
<source
|
|
151
|
-
srcset="https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2,
|
|
151
|
+
srcset="https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2, https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2, "
|
|
152
152
|
type="image/jpeg"
|
|
153
153
|
/>
|
|
154
154
|
<img
|