@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.
Files changed (140) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +74 -26
  3. package/dist/components/Chat/Chat.d.ts +1 -0
  4. package/dist/components/Chat/Chat.js +2 -2
  5. package/dist/components/Chat/Chat.js.map +1 -1
  6. package/dist/components/ChatBubble/ChatBubble.js +1 -1
  7. package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
  8. package/dist/components/ChatInputs/ChatInputs.css +1 -41
  9. package/dist/components/ChatInputs/ChatInputs.d.ts +1 -0
  10. package/dist/components/ChatInputs/ChatInputs.js +9 -3
  11. package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
  12. package/dist/components/FeedbackButtons/FeedbackButtons.js +1 -1
  13. package/dist/components/FeedbackButtons/FeedbackButtons.js.map +1 -1
  14. package/dist/components/MediaWidget/MediaItemWidget.js +1 -12
  15. package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -1
  16. package/dist/components/MemoriWidget/MemoriWidget.d.ts +17 -1
  17. package/dist/components/MemoriWidget/MemoriWidget.js +31 -19
  18. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  19. package/dist/components/MicrophoneButton/MicrophoneButton.css +101 -0
  20. package/dist/components/MicrophoneButton/MicrophoneButton.d.ts +9 -0
  21. package/dist/components/MicrophoneButton/MicrophoneButton.js +46 -0
  22. package/dist/components/MicrophoneButton/MicrophoneButton.js.map +1 -0
  23. package/dist/components/SettingsDrawer/SettingsDrawer.d.ts +3 -3
  24. package/dist/components/SettingsDrawer/SettingsDrawer.js +8 -6
  25. package/dist/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
  26. package/dist/components/SettingsDrawer/SettingsDrawer.test.js +7 -7
  27. package/dist/components/SettingsDrawer/SettingsDrawer.test.js.map +1 -1
  28. package/dist/components/StartPanel/StartPanel.js +1 -1
  29. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  30. package/dist/components/layouts/FullPage.d.ts +2 -15
  31. package/dist/components/layouts/FullPage.js.map +1 -1
  32. package/dist/components/layouts/Totem.d.ts +2 -15
  33. package/dist/components/layouts/Totem.js.map +1 -1
  34. package/dist/components/ui/Button.d.ts +5 -1
  35. package/dist/components/ui/Button.js +1 -1
  36. package/dist/components/ui/Button.js.map +1 -1
  37. package/dist/components/ui/Tooltip.css +33 -2
  38. package/dist/components/ui/Tooltip.d.ts +2 -1
  39. package/dist/components/ui/Tooltip.js +1 -2
  40. package/dist/components/ui/Tooltip.js.map +1 -1
  41. package/dist/components/ui/Tooltip.test.js +16 -0
  42. package/dist/components/ui/Tooltip.test.js.map +1 -1
  43. package/dist/helpers/configuration.js +1 -1
  44. package/dist/helpers/configuration.js.map +1 -1
  45. package/dist/helpers/media.js +25 -19
  46. package/dist/helpers/media.js.map +1 -1
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.js +2 -2
  49. package/dist/index.js.map +1 -1
  50. package/dist/locales/en.json +4 -0
  51. package/dist/locales/it.json +4 -0
  52. package/dist/styles.css +3 -2
  53. package/esm/components/Chat/Chat.d.ts +1 -0
  54. package/esm/components/Chat/Chat.js +2 -2
  55. package/esm/components/Chat/Chat.js.map +1 -1
  56. package/esm/components/ChatBubble/ChatBubble.js +1 -1
  57. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  58. package/esm/components/ChatInputs/ChatInputs.css +1 -41
  59. package/esm/components/ChatInputs/ChatInputs.d.ts +1 -0
  60. package/esm/components/ChatInputs/ChatInputs.js +9 -3
  61. package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
  62. package/esm/components/FeedbackButtons/FeedbackButtons.js +1 -1
  63. package/esm/components/FeedbackButtons/FeedbackButtons.js.map +1 -1
  64. package/esm/components/MediaWidget/MediaItemWidget.js +1 -12
  65. package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -1
  66. package/esm/components/MemoriWidget/MemoriWidget.d.ts +17 -1
  67. package/esm/components/MemoriWidget/MemoriWidget.js +31 -19
  68. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  69. package/esm/components/MicrophoneButton/MicrophoneButton.css +101 -0
  70. package/esm/components/MicrophoneButton/MicrophoneButton.d.ts +9 -0
  71. package/esm/components/MicrophoneButton/MicrophoneButton.js +43 -0
  72. package/esm/components/MicrophoneButton/MicrophoneButton.js.map +1 -0
  73. package/esm/components/SettingsDrawer/SettingsDrawer.d.ts +3 -3
  74. package/esm/components/SettingsDrawer/SettingsDrawer.js +9 -7
  75. package/esm/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
  76. package/esm/components/SettingsDrawer/SettingsDrawer.test.js +7 -7
  77. package/esm/components/SettingsDrawer/SettingsDrawer.test.js.map +1 -1
  78. package/esm/components/StartPanel/StartPanel.js +1 -1
  79. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  80. package/esm/components/layouts/FullPage.d.ts +2 -15
  81. package/esm/components/layouts/FullPage.js.map +1 -1
  82. package/esm/components/layouts/Totem.d.ts +2 -15
  83. package/esm/components/layouts/Totem.js.map +1 -1
  84. package/esm/components/ui/Button.d.ts +5 -1
  85. package/esm/components/ui/Button.js +1 -1
  86. package/esm/components/ui/Button.js.map +1 -1
  87. package/esm/components/ui/Tooltip.css +33 -2
  88. package/esm/components/ui/Tooltip.d.ts +2 -1
  89. package/esm/components/ui/Tooltip.js +1 -2
  90. package/esm/components/ui/Tooltip.js.map +1 -1
  91. package/esm/components/ui/Tooltip.test.js +16 -0
  92. package/esm/components/ui/Tooltip.test.js.map +1 -1
  93. package/esm/helpers/configuration.js +1 -1
  94. package/esm/helpers/configuration.js.map +1 -1
  95. package/esm/helpers/media.js +25 -19
  96. package/esm/helpers/media.js.map +1 -1
  97. package/esm/index.d.ts +1 -0
  98. package/esm/index.js +2 -2
  99. package/esm/index.js.map +1 -1
  100. package/esm/locales/en.json +4 -0
  101. package/esm/locales/it.json +4 -0
  102. package/esm/styles.css +3 -2
  103. package/package.json +1 -1
  104. package/src/components/BlockedMemoriBadge/__snapshots__/BlockedMemoriBadge.test.tsx.snap +4 -4
  105. package/src/components/Chat/Chat.tsx +3 -0
  106. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +6 -6
  107. package/src/components/ChatBubble/ChatBubble.tsx +1 -1
  108. package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +1 -1
  109. package/src/components/ChatInputs/ChatInputs.css +1 -41
  110. package/src/components/ChatInputs/ChatInputs.stories.tsx +50 -3
  111. package/src/components/ChatInputs/ChatInputs.tsx +20 -3
  112. package/src/components/ChatInputs/__snapshots__/ChatInputs.test.tsx.snap +160 -85
  113. package/src/components/FeedbackButtons/FeedbackButtons.tsx +1 -1
  114. package/src/components/Header/Header.stories.tsx +3 -0
  115. package/src/components/MediaWidget/MediaItemWidget.tsx +1 -12
  116. package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +6 -6
  117. package/src/components/MediaWidget/__snapshots__/MediaWidget.test.tsx.snap +1 -1
  118. package/src/components/MemoriWidget/MemoriWidget.tsx +53 -18
  119. package/src/components/MicrophoneButton/MicrophoneButton.css +101 -0
  120. package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +49 -0
  121. package/src/components/MicrophoneButton/MicrophoneButton.tsx +95 -0
  122. package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +6 -4
  123. package/src/components/SettingsDrawer/SettingsDrawer.test.tsx +14 -14
  124. package/src/components/SettingsDrawer/SettingsDrawer.tsx +57 -25
  125. package/src/components/StartPanel/StartPanel.tsx +3 -3
  126. package/src/components/layouts/FullPage.tsx +2 -16
  127. package/src/components/layouts/Totem.tsx +2 -16
  128. package/src/components/layouts/layouts.stories.tsx +41 -1
  129. package/src/components/ui/Button.tsx +21 -1
  130. package/src/components/ui/Tooltip.css +33 -2
  131. package/src/components/ui/Tooltip.stories.tsx +40 -3
  132. package/src/components/ui/Tooltip.test.tsx +52 -0
  133. package/src/components/ui/Tooltip.tsx +12 -7
  134. package/src/components/ui/__snapshots__/Tooltip.test.tsx.snap +80 -4
  135. package/src/helpers/configuration.ts +1 -1
  136. package/src/helpers/media.ts +29 -23
  137. package/src/index.tsx +3 -0
  138. package/src/locales/en.json +4 -0
  139. package/src/locales/it.json +4 -0
  140. 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 Listening = Template.bind({});
163
- Listening.args = {
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
- <button
92
- class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic"
93
- title="write_and_speak.micButtonPopover"
91
+ <div
92
+ class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
94
93
  >
95
- <span
96
- class="memori-button--icon"
94
+ <div
95
+ class="memori-tooltip--content"
97
96
  >
98
- <svg
99
- aria-hidden="true"
100
- focusable="false"
101
- role="img"
102
- viewBox="0 0 1024 1024"
103
- xmlns="http://www.w3.org/2000/svg"
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
- <path
106
- 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"
107
- />
108
- </svg>
109
- </span>
110
- </button>
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
- <button
202
- 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"
203
- title="write_and_speak.micButtonPopoverListening"
216
+ <div
217
+ class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
204
218
  >
205
- <span
206
- class="memori-button--icon"
219
+ <div
220
+ class="memori-tooltip--content"
207
221
  >
208
- <svg
209
- aria-hidden="true"
210
- focusable="false"
211
- role="img"
212
- viewBox="0 0 1024 1024"
213
- xmlns="http://www.w3.org/2000/svg"
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
- <path
216
- 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"
217
- />
218
- </svg>
219
- </span>
220
- </button>
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
- <button
341
- class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic"
342
- title="write_and_speak.micButtonPopover"
370
+ <div
371
+ class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
343
372
  >
344
- <span
345
- class="memori-button--icon"
373
+ <div
374
+ class="memori-tooltip--content"
346
375
  >
347
- <svg
348
- aria-hidden="true"
349
- focusable="false"
350
- role="img"
351
- viewBox="0 0 1024 1024"
352
- xmlns="http://www.w3.org/2000/svg"
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
- <path
355
- 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"
356
- />
357
- </svg>
358
- </span>
359
- </button>
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
- <button
450
- class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic"
451
- title="write_and_speak.micButtonPopover"
494
+ <div
495
+ class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
452
496
  >
453
- <span
454
- class="memori-button--icon"
497
+ <div
498
+ class="memori-tooltip--content"
455
499
  >
456
- <svg
457
- aria-hidden="true"
458
- focusable="false"
459
- role="img"
460
- viewBox="0 0 1024 1024"
461
- xmlns="http://www.w3.org/2000/svg"
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
- <path
464
- 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"
465
- />
466
- </svg>
467
- </span>
468
- </button>
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
- <button
560
- class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-chat-inputs--mic"
561
- title="write_and_speak.micButtonPopover"
619
+ <div
620
+ class="memori-tooltip memori-tooltip--align-topLeft memori-mic-btn-tooltip"
562
621
  >
563
- <span
564
- class="memori-button--icon"
622
+ <div
623
+ class="memori-tooltip--content"
565
624
  >
566
- <svg
567
- aria-hidden="true"
568
- focusable="false"
569
- role="img"
570
- viewBox="0 0 1024 1024"
571
- xmlns="http://www.w3.org/2000/svg"
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
- <path
574
- 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"
575
- />
576
- </svg>
577
- </span>
578
- </button>
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
  `;
@@ -122,7 +122,7 @@ const FeedbackButtons = ({
122
122
  </Transition>
123
123
  </Menu>
124
124
  ) : (
125
- <Tooltip alignLeft content="Feedback">
125
+ <Tooltip align="left" content="Feedback">
126
126
  <Button
127
127
  title="Feedback"
128
128
  onClick={() => {
@@ -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, /images/memoriAvatar.png, 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/131165be-9d1a-42fb-a3ce-e8f86d40c88f"
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/131165be-9d1a-42fb-a3ce-e8f86d40c88f, /images/memoriAvatar.png, 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, /images/memoriAvatar.png, 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, /images/memoriAvatar.png, 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, /images/memoriAvatar.png, 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, /images/memoriAvatar.png, 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