@memori.ai/memori-react 9.0.0-alpha.21 → 9.0.0-alpha.22

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 (250) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
  3. package/dist/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
  4. package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  5. package/dist/components/Auth/Auth.css +12 -5
  6. package/dist/components/Auth/Auth.d.ts +1 -1
  7. package/dist/components/Auth/Auth.js +46 -32
  8. package/dist/components/Auth/Auth.js.map +1 -1
  9. package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
  10. package/dist/components/Chat/Chat.css +1 -0
  11. package/dist/components/Chat/Chat.js +1 -1
  12. package/dist/components/Chat/Chat.js.map +1 -1
  13. package/dist/components/ChatBubble/ChatBubble.css +32 -5
  14. package/dist/components/ChatBubble/ChatBubble.js +2 -4
  15. package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
  16. package/dist/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
  17. package/dist/components/ChatHistoryDrawer/ChatHistory.js +2 -2
  18. package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
  19. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
  20. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
  21. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +7 -57
  22. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
  23. package/dist/components/ChatInputs/ChatInputs.js +10 -1
  24. package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
  25. package/dist/components/ChatTextArea/ChatTextArea.css +1 -1
  26. package/dist/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
  27. package/dist/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
  28. package/dist/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
  29. package/dist/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
  30. package/dist/components/Header/Header.css +8 -3
  31. package/dist/components/Header/Header.js +15 -18
  32. package/dist/components/Header/Header.js.map +1 -1
  33. package/dist/components/IconButton/IconButton.d.ts +1 -1
  34. package/dist/components/KnownFacts/KnownFacts.css +1 -1
  35. package/dist/components/KnownFacts/KnownFacts.js +2 -5
  36. package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
  37. package/dist/components/LoginDrawer/LoginDrawer.css +16 -14
  38. package/dist/components/LoginDrawer/LoginDrawer.js +19 -11
  39. package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
  40. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  41. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  42. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
  43. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  44. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
  45. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
  46. package/dist/components/MemoriWidget/MemoriWidget.js +35 -31
  47. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  48. package/dist/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  49. package/dist/components/PositionPopover/PositionPopover.css +3 -3
  50. package/dist/components/PositionPopover/PositionPopover.js +38 -25
  51. package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
  52. package/dist/components/Snippet/Snippet.css +1 -1
  53. package/dist/components/StartPanel/StartPanel.css +19 -3
  54. package/dist/components/StartPanel/StartPanel.js +12 -18
  55. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  56. package/dist/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  57. package/dist/components/layouts/totem.css +43 -9
  58. package/dist/helpers/positionPopover.d.ts +2 -1
  59. package/dist/helpers/positionPopover.js +10 -2
  60. package/dist/helpers/positionPopover.js.map +1 -1
  61. package/dist/icons/MemoriIcon.js +1 -1
  62. package/dist/icons/MemoriIcon.js.map +1 -1
  63. package/dist/locales/de.json +4 -1
  64. package/dist/locales/en.json +3 -1
  65. package/dist/locales/es.json +3 -1
  66. package/dist/locales/fr.json +3 -1
  67. package/dist/locales/it.json +3 -1
  68. package/dist/styles.css +1 -1
  69. package/dist/version.d.ts +1 -1
  70. package/dist/version.js +1 -1
  71. package/esm/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
  72. package/esm/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
  73. package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  74. package/esm/components/Auth/Auth.css +12 -5
  75. package/esm/components/Auth/Auth.d.ts +1 -1
  76. package/esm/components/Auth/Auth.js +47 -33
  77. package/esm/components/Auth/Auth.js.map +1 -1
  78. package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
  79. package/esm/components/Chat/Chat.css +1 -0
  80. package/esm/components/Chat/Chat.js +1 -1
  81. package/esm/components/Chat/Chat.js.map +1 -1
  82. package/esm/components/ChatBubble/ChatBubble.css +32 -5
  83. package/esm/components/ChatBubble/ChatBubble.js +2 -4
  84. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  85. package/esm/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
  86. package/esm/components/ChatHistoryDrawer/ChatHistory.js +2 -2
  87. package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
  88. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
  89. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
  90. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js +9 -59
  91. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
  92. package/esm/components/ChatInputs/ChatInputs.js +11 -2
  93. package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
  94. package/esm/components/ChatTextArea/ChatTextArea.css +1 -1
  95. package/esm/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
  96. package/esm/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
  97. package/esm/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
  98. package/esm/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
  99. package/esm/components/Header/Header.css +8 -3
  100. package/esm/components/Header/Header.js +15 -18
  101. package/esm/components/Header/Header.js.map +1 -1
  102. package/esm/components/IconButton/IconButton.d.ts +1 -1
  103. package/esm/components/KnownFacts/KnownFacts.css +1 -1
  104. package/esm/components/KnownFacts/KnownFacts.js +2 -5
  105. package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
  106. package/esm/components/LoginDrawer/LoginDrawer.css +16 -14
  107. package/esm/components/LoginDrawer/LoginDrawer.js +20 -12
  108. package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
  109. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  110. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  111. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
  112. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  113. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
  114. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
  115. package/esm/components/MemoriWidget/MemoriWidget.js +36 -32
  116. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  117. package/esm/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  118. package/esm/components/PositionPopover/PositionPopover.css +3 -3
  119. package/esm/components/PositionPopover/PositionPopover.js +39 -26
  120. package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
  121. package/esm/components/Snippet/Snippet.css +1 -1
  122. package/esm/components/StartPanel/StartPanel.css +19 -3
  123. package/esm/components/StartPanel/StartPanel.js +12 -18
  124. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  125. package/esm/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  126. package/esm/components/layouts/totem.css +43 -9
  127. package/esm/helpers/positionPopover.d.ts +2 -1
  128. package/esm/helpers/positionPopover.js +9 -2
  129. package/esm/helpers/positionPopover.js.map +1 -1
  130. package/esm/icons/MemoriIcon.js +1 -1
  131. package/esm/icons/MemoriIcon.js.map +1 -1
  132. package/esm/locales/de.json +4 -1
  133. package/esm/locales/en.json +3 -1
  134. package/esm/locales/es.json +3 -1
  135. package/esm/locales/fr.json +3 -1
  136. package/esm/locales/it.json +3 -1
  137. package/esm/styles.css +1 -1
  138. package/esm/version.d.ts +1 -1
  139. package/esm/version.js +1 -1
  140. package/package.json +5 -3
  141. package/src/Live/Agents.stories.tsx +49 -0
  142. package/src/Live/KnownFacts.stories.tsx +50 -0
  143. package/src/Showcase.stories.tsx +3 -14
  144. package/src/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
  145. package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +1 -1
  146. package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +1 -0
  147. package/src/components/Auth/Auth.css +12 -5
  148. package/src/components/Auth/Auth.stories.tsx +1 -1
  149. package/src/components/Auth/Auth.test.tsx +68 -1
  150. package/src/components/Auth/Auth.tsx +69 -54
  151. package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +5 -6
  152. package/src/components/Avatar/Avatar.stories.tsx +1 -18
  153. package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +1 -103
  154. package/src/components/Blob/Blob.stories.tsx +1 -1
  155. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
  156. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +1 -1
  157. package/src/components/ChangeMode/ChangeMode.stories.tsx +1 -1
  158. package/src/components/Chat/Chat.css +1 -0
  159. package/src/components/Chat/Chat.stories.tsx +61 -7
  160. package/src/components/Chat/Chat.tsx +1 -0
  161. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +80 -80
  162. package/src/components/ChatBubble/ChatBubble.css +32 -5
  163. package/src/components/ChatBubble/ChatBubble.stories.tsx +13 -2
  164. package/src/components/ChatBubble/ChatBubble.test.tsx +21 -1
  165. package/src/components/ChatBubble/ChatBubble.tsx +7 -13
  166. package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +158 -185
  167. package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +1 -1
  168. package/src/components/ChatHistoryDrawer/ChatHistory.tsx +6 -0
  169. package/src/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
  170. package/src/components/ChatHistoryDrawer/ChatResumeDrawer.tsx +24 -81
  171. package/src/components/ChatInputs/ChatInputs.stories.tsx +1 -39
  172. package/src/components/ChatInputs/ChatInputs.test.tsx +47 -0
  173. package/src/components/ChatInputs/ChatInputs.tsx +12 -2
  174. package/src/components/ChatTextArea/ChatTextArea.css +1 -1
  175. package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +1 -1
  176. package/src/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
  177. package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +1 -1
  178. package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
  179. package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +1 -1
  180. package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +29 -10
  181. package/src/components/Header/Header.css +8 -3
  182. package/src/components/Header/Header.stories.tsx +1 -1
  183. package/src/components/Header/Header.tsx +146 -117
  184. package/src/components/KnownFacts/KnownFacts.css +1 -1
  185. package/src/components/KnownFacts/KnownFacts.stories.tsx +1 -23
  186. package/src/components/KnownFacts/KnownFacts.tsx +4 -9
  187. package/src/components/LoginDrawer/LoginDrawer.css +16 -14
  188. package/src/components/LoginDrawer/LoginDrawer.stories.tsx +2 -52
  189. package/src/components/LoginDrawer/LoginDrawer.tsx +51 -39
  190. package/src/components/MediaWidget/MediaItemWidget.stories.tsx +1 -15
  191. package/src/components/MediaWidget/MediaWidget.stories.tsx +1 -45
  192. package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +1 -1
  193. package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  194. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  195. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +4 -6
  196. package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +1 -1
  197. package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +32 -28
  198. package/src/components/MemoriWidget/MemoriUIProvider.contract.test.tsx +55 -0
  199. package/src/components/MemoriWidget/MemoriWidget.stories.tsx +55 -77
  200. package/src/components/MemoriWidget/MemoriWidget.tsx +49 -44
  201. package/src/components/MemoriWidget/getChatStyles.test.ts +24 -0
  202. package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +1 -1
  203. package/src/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  204. package/src/components/PositionPopover/PositionPopover.css +3 -3
  205. package/src/components/PositionPopover/PositionPopover.stories.tsx +1 -1
  206. package/src/components/PositionPopover/PositionPopover.tsx +50 -28
  207. package/src/components/PoweredBy/PoweredBy.stories.tsx +1 -54
  208. package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +2 -2
  209. package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +1 -1
  210. package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +1 -1
  211. package/src/components/ShareButton/ShareButton.stories.tsx +1 -1
  212. package/src/components/Snippet/Snippet.css +1 -1
  213. package/src/components/Snippet/Snippet.stories.tsx +1 -1
  214. package/src/components/StartPanel/StartPanel.css +19 -3
  215. package/src/components/StartPanel/StartPanel.stories.tsx +2 -2
  216. package/src/components/StartPanel/StartPanel.tsx +22 -35
  217. package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +177 -121
  218. package/src/components/Typing/Typing.stories.tsx +1 -1
  219. package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +22 -44
  220. package/src/components/layouts/FullBody/FullBody.stories.tsx +55 -68
  221. package/src/components/layouts/Totem/Totem.stories.tsx +69 -87
  222. package/src/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  223. package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +69 -87
  224. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +19 -41
  225. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +39 -83
  226. package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +15 -11
  227. package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +116 -42
  228. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +18 -40
  229. package/src/components/layouts/layouts.stories.tsx +96 -179
  230. package/src/components/layouts/totem.css +43 -9
  231. package/src/helpers/positionPopover.test.ts +36 -1
  232. package/src/helpers/positionPopover.ts +21 -4
  233. package/src/i18n.knownFacts.test.ts +40 -0
  234. package/src/icons/MemoriIcon.tsx +1 -1
  235. package/src/index.stories.tsx +1 -47
  236. package/src/locales/de.json +4 -1
  237. package/src/locales/en.json +3 -1
  238. package/src/locales/es.json +3 -1
  239. package/src/locales/fr.json +3 -1
  240. package/src/locales/it.json +3 -1
  241. package/src/styles.css +13 -27
  242. package/src/version.ts +1 -1
  243. package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
  244. package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
  245. package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
  246. package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
  247. package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -265
  248. package/src/components/UploadButton/UploadButton.stories.tsx +0 -510
  249. package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -69
  250. package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.stories.tsx +0 -115
@@ -1,17 +1,15 @@
1
1
  import React from 'react';
2
2
  import { Meta, Story } from '@storybook/react';
3
3
  import { memori, integration, tenant } from '../../mocks/data';
4
- import I18nWrapper from '../../I18nWrapper';
5
- import MemoriWidget, { Props } from './MemoriWidget';
4
+ import Memori, { Props } from '../../index';
5
+ import { withWidgetProviders } from '../../../.storybook/decorators';
6
6
 
7
7
  import './MemoriWidget.css';
8
- import { VisemeProvider } from '../../context/visemeContext';
9
- import { ArtifactProvider } from '../MemoriArtifactSystem/context/ArtifactContext';
10
- import { AlertProvider } from '@memori.ai/ui';
11
8
 
12
9
  const meta: Meta = {
13
- title: 'Widget/Default',
14
- component: MemoriWidget,
10
+ title: 'Compositions/MemoriWidget',
11
+ component: Memori,
12
+ decorators: [withWidgetProviders],
15
13
  argTypes: {
16
14
  AZURE_COGNITIVE_SERVICES_TTS_KEY: {
17
15
  control: {
@@ -37,79 +35,74 @@ const meta: Meta = {
37
35
 
38
36
  export default meta;
39
37
 
40
- const Template: Story<Props> = args => (
41
- <I18nWrapper>
42
- <AlertProvider defaultDuration={5000}>
43
- <ArtifactProvider>
44
- <VisemeProvider>
45
- <MemoriWidget {...args} />
46
- </VisemeProvider>
47
- </ArtifactProvider>
48
- </AlertProvider>
49
- </I18nWrapper>
50
- );
38
+ /** Same live agent as Layouts / Full Page. */
39
+ const fixtureBase: Partial<Props> = {
40
+ memori,
41
+ tenant,
42
+ memoriName: memori.name,
43
+ memoriID: memori.memoriID,
44
+ ownerUserName: 'memoridev',
45
+ tenantID: 'www.aisuru.com',
46
+ engineURL: 'https://engine.memori.ai',
47
+ apiURL: 'https://backend.memori.ai',
48
+ baseURL: 'https://www.aisuru.com',
49
+ uiLang: 'IT',
50
+ spokenLang: 'IT',
51
+ showSettings: true,
52
+ showShare: true,
53
+ };
54
+
55
+ const Template: Story<Props> = args => <Memori {...args} />;
51
56
  // By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
52
57
  // https://storybook.js.org/docs/react/workflows/unit-testing
53
58
  export const Default = Template.bind({});
54
59
  Default.args = {
55
- memori,
56
- tenant,
60
+ ...fixtureBase,
61
+ layout: 'FULLPAGE',
57
62
  };
58
63
 
59
64
  export const WithAutoStart = Template.bind({});
60
65
  WithAutoStart.args = {
61
- memori,
62
- tenant,
66
+ ...fixtureBase,
63
67
  autoStart: true,
64
68
  layout: 'FULLPAGE',
65
69
  };
66
70
 
67
71
  export const WithPosition = Template.bind({});
68
72
  WithPosition.args = {
69
- memori: {
70
- ...memori,
71
- needsPosition: true,
72
- },
73
- tenant,
73
+ ...fixtureBase,
74
+ layout: 'FULLPAGE',
75
+ };
76
+
77
+ export const WithAutoStartAndRequiredPosition = Template.bind({});
78
+ WithAutoStartAndRequiredPosition.args = {
79
+ ...fixtureBase,
80
+ autoStart: true,
74
81
  layout: 'FULLPAGE',
75
82
  };
76
83
 
77
84
  export const WithLoginRequired = Template.bind({});
78
85
  WithLoginRequired.args = {
79
- memori: {
80
- ...memori,
81
- requireLoginToken: true,
82
- },
83
- tenant,
86
+ ...fixtureBase,
84
87
  layout: 'FULLPAGE',
85
88
  };
86
89
 
87
90
  export const WithDates = Template.bind({});
88
91
  WithDates.args = {
89
- memori: {
90
- ...memori,
91
- needsDateTime: true,
92
- },
93
- tenant,
92
+ ...fixtureBase,
94
93
  layout: 'FULLPAGE',
95
94
  };
96
95
 
97
96
  /** To test dateUTC/place in Enter Text: open DevTools → Network, start chat, set position (header position icon) if testing place, then send a message. Inspect the request to your backend/engine for body.dateUTC (ISO) and body.place (placeName, latitude, longitude, uncertaintyKm). */
98
97
  export const WithDateAndPlaceForEnterText = Template.bind({});
99
98
  WithDateAndPlaceForEnterText.args = {
100
- memori: {
101
- ...memori,
102
- needsDateTime: true,
103
- needsPosition: true,
104
- },
105
- tenant,
99
+ ...fixtureBase,
106
100
  layout: 'FULLPAGE',
107
101
  };
108
102
 
109
103
  export const WithPublicPageIntegration = Template.bind({});
110
104
  WithPublicPageIntegration.args = {
111
- memori,
112
- tenant,
105
+ ...fixtureBase,
113
106
  integration: {
114
107
  ...integration,
115
108
  customData: JSON.stringify({
@@ -125,8 +118,7 @@ WithPublicPageIntegration.args = {
125
118
 
126
119
  export const WithPublicPageIntegrationAndFullbodyAvatar = Template.bind({});
127
120
  WithPublicPageIntegrationAndFullbodyAvatar.args = {
128
- memori,
129
- tenant,
121
+ ...fixtureBase,
130
122
  integration: {
131
123
  ...integration,
132
124
  customData: JSON.stringify({
@@ -142,8 +134,7 @@ WithPublicPageIntegrationAndFullbodyAvatar.args = {
142
134
 
143
135
  export const WithPublicPageIntegrationAndNonDefaultLang = Template.bind({});
144
136
  WithPublicPageIntegrationAndNonDefaultLang.args = {
145
- memori,
146
- tenant,
137
+ ...fixtureBase,
147
138
  integration: {
148
139
  ...integration,
149
140
  customData: JSON.stringify({
@@ -156,40 +147,35 @@ WithPublicPageIntegrationAndNonDefaultLang.args = {
156
147
 
157
148
  export const ShowShare = Template.bind({});
158
149
  ShowShare.args = {
159
- memori,
160
- tenant,
150
+ ...fixtureBase,
161
151
  showShare: true,
162
152
  layout: 'FULLPAGE',
163
153
  };
164
154
 
165
155
  export const ShowSettings = Template.bind({});
166
156
  ShowSettings.args = {
167
- memori,
168
- tenant,
157
+ ...fixtureBase,
169
158
  showSettings: true,
170
159
  layout: 'FULLPAGE',
171
160
  };
172
161
 
173
162
  export const ShowClear = Template.bind({});
174
163
  ShowClear.args = {
175
- memori,
176
- tenant,
164
+ ...fixtureBase,
177
165
  showClear: true,
178
166
  layout: 'FULLPAGE',
179
167
  };
180
168
 
181
169
  export const ShowUpload = Template.bind({});
182
170
  ShowUpload.args = {
183
- memori,
184
- tenant,
171
+ ...fixtureBase,
185
172
  showUpload: true,
186
173
  layout: 'FULLPAGE',
187
174
  };
188
175
 
189
176
  export const ShowUploadFromIntegration = Template.bind({});
190
177
  ShowUploadFromIntegration.args = {
191
- memori,
192
- tenant,
178
+ ...fixtureBase,
193
179
  showUpload: false,
194
180
  integration: {
195
181
  ...integration,
@@ -203,8 +189,7 @@ ShowUploadFromIntegration.args = {
203
189
 
204
190
  export const WithoutAudio = Template.bind({});
205
191
  WithoutAudio.args = {
206
- memori,
207
- tenant,
192
+ ...fixtureBase,
208
193
  enableAudio: false,
209
194
  AZURE_COGNITIVE_SERVICES_TTS_KEY: 'provide your key here',
210
195
  layout: 'FULLPAGE',
@@ -212,8 +197,7 @@ WithoutAudio.args = {
212
197
 
213
198
  export const WithoutAudioFromIntegrationConfig = Template.bind({});
214
199
  WithoutAudioFromIntegrationConfig.args = {
215
- memori,
216
- tenant,
200
+ ...fixtureBase,
217
201
  integration: {
218
202
  ...integration,
219
203
  customData: JSON.stringify({
@@ -226,8 +210,7 @@ WithoutAudioFromIntegrationConfig.args = {
226
210
 
227
211
  export const DefautSpeakerDisabled = Template.bind({});
228
212
  DefautSpeakerDisabled.args = {
229
- memori,
230
- tenant,
213
+ ...fixtureBase,
231
214
  defaultSpeakerActive: false,
232
215
  AZURE_COGNITIVE_SERVICES_TTS_KEY: 'provide your key here',
233
216
  layout: 'FULLPAGE',
@@ -235,32 +218,28 @@ DefautSpeakerDisabled.args = {
235
218
 
236
219
  export const ShowOnlyLastMessages = Template.bind({});
237
220
  ShowOnlyLastMessages.args = {
238
- memori,
239
- tenant,
221
+ ...fixtureBase,
240
222
  showOnlyLastMessages: true,
241
223
  layout: 'FULLPAGE',
242
224
  };
243
225
 
244
226
  export const ShowOnlyLastMessagesWithAnotherDefault = Template.bind({});
245
227
  ShowOnlyLastMessagesWithAnotherDefault.args = {
246
- memori,
247
- tenant,
228
+ ...fixtureBase,
248
229
  showOnlyLastMessages: false,
249
230
  layout: 'FULLPAGE',
250
231
  };
251
232
 
252
233
  export const WithAzureSpeechKey = Template.bind({});
253
234
  WithAzureSpeechKey.args = {
254
- memori,
255
- tenant,
235
+ ...fixtureBase,
256
236
  AZURE_COGNITIVE_SERVICES_TTS_KEY: 'provide your key here',
257
237
  layout: 'FULLPAGE',
258
238
  };
259
239
 
260
240
  export const WithCustomMediaRenderer = Template.bind({});
261
241
  WithCustomMediaRenderer.args = {
262
- memori,
263
- tenant,
242
+ ...fixtureBase,
264
243
  customMediaRenderer: (mimeType: string) => (
265
244
  <div
266
245
  style={{
@@ -280,16 +259,15 @@ WithCustomMediaRenderer.args = {
280
259
 
281
260
  export const WithUserAvatar = Template.bind({});
282
261
  WithUserAvatar.args = {
283
- memori,
284
- tenant,
262
+ ...fixtureBase,
285
263
  userAvatar: 'https://picsum.photos/200',
286
264
  layout: 'FULLPAGE',
287
265
  };
288
266
 
289
267
  export const WithUserAvatarAsElement = Template.bind({});
290
268
  WithUserAvatarAsElement.args = {
291
- memori,
292
- tenant,
269
+ ...fixtureBase,
293
270
  userAvatar: <span>USER</span>,
294
271
  layout: 'FULLPAGE',
295
272
  };
273
+
@@ -24,7 +24,10 @@ import type {
24
24
  PiiDetectionConfig,
25
25
  } from '../../types/layout';
26
26
  import { checkPii } from '../../helpers/piiDetection'; // PII check when integrationConfig.layout has piiDetection.enabled
27
- import { shouldRestartSessionOnPositionPopoverClose } from '../../helpers/positionPopover';
27
+ import {
28
+ shouldHoldAutoStartForPosition,
29
+ shouldRestartSessionOnPositionPopoverClose,
30
+ } from '../../helpers/positionPopover';
28
31
 
29
32
  // Libraries
30
33
  import React, {
@@ -511,9 +514,8 @@ type ChatStylesConfig = {
511
514
 
512
515
  /**
513
516
  * Returns CSS custom properties for the chat container when a brand primary is set.
514
- * Maps buttonBgColor --memori-primary-color / --memori-primary and injects derived
515
- * tokens (hover, active, borders, etc.) in the same scope.
516
- * If buttonBgColor is missing, returns {} so global CSS defaults are used.
517
+ * Sets the UI brand hook (`--memori-primary-color`); hover/active/subtle derive from
518
+ * `@memori.ai/ui` theme tokens. Widget-only icon soft fills stay here.
517
519
  */
518
520
  export function getChatStyles(
519
521
  config: ChatStylesConfig | null | undefined
@@ -523,41 +525,14 @@ export function getChatStyles(
523
525
 
524
526
  const primaryContent = config?.buttonTextColor ?? '#ffffff';
525
527
 
526
- // Match @memori.ai/ui token semantics:
527
- // --memori-surface-contrast = ink (#000 light / #fff dark)
528
- // --memori-surface-contrast-inverse = surface (#fff light / #000 dark)
529
528
  return {
530
529
  '--memori-primary-color': primary,
531
- '--memori-primary': primary,
532
530
  '--memori-primary-content': primaryContent,
533
- '--memori-primary-hover':
534
- 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast, black) 15%)',
535
- '--memori-primary-active':
536
- 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast, black) 25%)',
537
- '--memori-primary-disabled':
538
- 'color-mix(in oklch, var(--memori-primary), transparent 60%)',
539
- '--memori-primary-subtle':
540
- 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 60%)',
541
- '--memori-primary-subtle-hover':
542
- 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 50%)',
543
- '--memori-border-primary':
544
- 'color-mix(in oklch, var(--memori-primary), transparent 70%)',
545
- '--memori-border-primary-hover':
546
- 'color-mix(in oklch, var(--memori-primary), transparent 50%)',
547
- '--memori-focus-ring-color':
548
- 'color-mix(in oklch, var(--memori-primary), transparent 80%)',
549
- '--memori-focus-ring': '0 0 0 3px var(--memori-focus-ring-color)',
550
- '--memori-shadow-primary':
551
- '0 8px 16px -4px color-mix(in oklch, var(--memori-primary), transparent 70%)',
552
- '--memori-skeleton-base':
553
- 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 85%)',
554
- '--memori-skeleton-highlight':
555
- 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 75%)',
556
531
  /* Soft fills for secondary IconButton active / recording (never solid CTA) */
557
532
  '--memori-icon-active-bg':
558
533
  'color-mix(in oklch, var(--memori-primary) 12%, transparent)',
559
534
  '--memori-icon-recording-bg':
560
- 'color-mix(in oklch, var(--memori-error, #dc2626) 12%, transparent)',
535
+ 'color-mix(in oklch, var(--memori-error) 12%, transparent)',
561
536
  } as CSSProperties;
562
537
  }
563
538
 
@@ -1536,8 +1511,10 @@ const MemoriWidget = ({
1536
1511
  // Check if authentication is needed for private Memori
1537
1512
  if (
1538
1513
  memori.privacyType !== 'PUBLIC' &&
1514
+ !params.password &&
1539
1515
  !memori.secretToken &&
1540
1516
  !memoriPwd &&
1517
+ !params.recoveryTokens?.length &&
1541
1518
  !memoriTokens
1542
1519
  ) {
1543
1520
  setAuthModalState('password');
@@ -1700,6 +1677,7 @@ const MemoriWidget = ({
1700
1677
  // Show age verification if required and birth date not provided
1701
1678
  if (!userBirthDate && !!minAge) {
1702
1679
  setShowAgeVerification(true);
1680
+ setLoading(false);
1703
1681
  return;
1704
1682
  }
1705
1683
 
@@ -1709,10 +1687,11 @@ const MemoriWidget = ({
1709
1687
  !password &&
1710
1688
  !memori.secretToken &&
1711
1689
  !memoriPwd &&
1712
- !recoveryTokens &&
1690
+ !recoveryTokens?.length &&
1713
1691
  !memoriTokens
1714
1692
  ) {
1715
1693
  setAuthModalState('password');
1694
+ setLoading(false);
1716
1695
  return;
1717
1696
  }
1718
1697
 
@@ -2613,20 +2592,26 @@ const MemoriWidget = ({
2613
2592
  }, []);
2614
2593
 
2615
2594
  useEffect(() => {
2616
- // if memori is speaking, don't start listening
2595
+ // if memori is speaking or generating a reply, don't start listening
2617
2596
  if (
2618
2597
  !isPlayingAudio &&
2598
+ !memoriTyping &&
2619
2599
  continuousSpeech &&
2620
2600
  (hasUserActivatedListening || !requestedListening) &&
2621
2601
  sessionId &&
2622
2602
  !hasUserTypedMessage // Don't start recording if user has typed a message
2623
2603
  ) {
2624
2604
  startRecording();
2625
- } else if (isPlayingAudio && isListening) {
2605
+ } else if ((isPlayingAudio || memoriTyping) && isListening) {
2626
2606
  stopRecording();
2627
2607
  }
2628
2608
  // eslint-disable-next-line react-hooks/exhaustive-deps
2629
- }, [isPlayingAudio, hasUserActivatedListening, hasUserTypedMessage]);
2609
+ }, [
2610
+ isPlayingAudio,
2611
+ hasUserActivatedListening,
2612
+ hasUserTypedMessage,
2613
+ memoriTyping,
2614
+ ]);
2630
2615
 
2631
2616
  useEffect(() => {
2632
2617
  stopRecording();
@@ -2701,7 +2686,7 @@ const MemoriWidget = ({
2701
2686
  }`
2702
2687
  );
2703
2688
  }
2704
- const integrationStylesheet = `@layer integration {
2689
+ const integrationStylesheet = `@layer memori.overrides {
2705
2690
  ${integrationStylesheetParts.join('\n ')}
2706
2691
  }
2707
2692
  `;
@@ -2874,9 +2859,15 @@ const MemoriWidget = ({
2874
2859
  'position',
2875
2860
  undefined
2876
2861
  );
2877
- // Only check for position requirement if memori.needsPosition is true
2878
- if (autoStart && !localPosition && memori.needsPosition) {
2879
- setPositionPopoverOpenState(true);
2862
+ // Wait on the start panel for location share/skip; do not open the header popover.
2863
+ if (
2864
+ autoStart &&
2865
+ shouldHoldAutoStartForPosition(
2866
+ !!memori.needsPosition,
2867
+ Boolean(position || localPosition)
2868
+ )
2869
+ ) {
2870
+ setClickedStart(false);
2880
2871
  return;
2881
2872
  }
2882
2873
 
@@ -3282,13 +3273,17 @@ const MemoriWidget = ({
3282
3273
  const setPositionPopoverOpen = useCallback(
3283
3274
  (open: boolean) => {
3284
3275
  const sessionAlreadyStarted = !!(sessionId && hasUserActivatedSpeak);
3276
+ const hasPosition = Boolean(
3277
+ position || getLocalConfig<Venue | undefined>('position', undefined)
3278
+ );
3285
3279
  setPositionPopoverOpenState(wasOpen => {
3286
3280
  if (
3287
3281
  shouldRestartSessionOnPositionPopoverClose(
3288
3282
  wasOpen,
3289
3283
  open,
3290
3284
  autoStart,
3291
- sessionAlreadyStarted
3285
+ sessionAlreadyStarted,
3286
+ hasPosition
3292
3287
  )
3293
3288
  ) {
3294
3289
  // Defer: React setState updaters must stay pure.
@@ -3304,17 +3299,23 @@ const MemoriWidget = ({
3304
3299
  return open;
3305
3300
  });
3306
3301
  },
3307
- [autoStart, onClickStart, sessionId, hasUserActivatedSpeak]
3302
+ [autoStart, onClickStart, sessionId, hasUserActivatedSpeak, position]
3308
3303
  );
3309
3304
 
3310
3305
  useEffect(() => {
3306
+ const storedPosition = getLocalConfig<Venue | undefined>(
3307
+ 'position',
3308
+ undefined
3309
+ );
3310
+ const hasPosition = Boolean(position || storedPosition);
3311
3311
  if (
3312
3312
  !clickedStart &&
3313
3313
  !sessionStartingRef.current &&
3314
3314
  !sessionId &&
3315
3315
  autoStart &&
3316
3316
  selectedLayout !== 'HIDDEN_CHAT' &&
3317
- (!needsCredits || hasEnoughCredits)
3317
+ (!needsCredits || hasEnoughCredits) &&
3318
+ !shouldHoldAutoStartForPosition(!!memori.needsPosition, hasPosition)
3318
3319
  ) {
3319
3320
  onClickStart();
3320
3321
  }
@@ -3325,6 +3326,8 @@ const MemoriWidget = ({
3325
3326
  sessionId,
3326
3327
  needsCredits,
3327
3328
  hasEnoughCredits,
3329
+ position,
3330
+ memori.needsPosition,
3328
3331
  ]);
3329
3332
 
3330
3333
  useEffect(() => {
@@ -3488,7 +3491,7 @@ const MemoriWidget = ({
3488
3491
 
3489
3492
  const showFullHistory =
3490
3493
  showOnlyLastMessages === undefined
3491
- ? selectedLayout !== 'TOTEM' && selectedLayout !== 'WEBSITE_ASSISTANT'
3494
+ ? selectedLayout !== 'WEBSITE_ASSISTANT'
3492
3495
  : !showOnlyLastMessages;
3493
3496
  const canShowLoginButton =
3494
3497
  !tenant?.ssoLogin &&
@@ -3964,6 +3967,8 @@ const MemoriWidget = ({
3964
3967
  language={language}
3965
3968
  userLang={userLang}
3966
3969
  isMultilanguageEnabled={isMultilanguageEnabled}
3970
+ showFunctionCache={showFunctionCache}
3971
+ showMessageConsumption={enableMessageConsumption}
3967
3972
  />
3968
3973
  )}
3969
3974
 
@@ -0,0 +1,24 @@
1
+ import { getChatStyles } from './MemoriWidget';
2
+
3
+ describe('getChatStyles', () => {
4
+ it('returns empty object when no brand primary is set', () => {
5
+ expect(getChatStyles(undefined)).toEqual({});
6
+ expect(getChatStyles({})).toEqual({});
7
+ });
8
+
9
+ it('sets only the brand hook and widget-domain icon tokens', () => {
10
+ const styles = getChatStyles({
11
+ buttonBgColor: '#8246af',
12
+ buttonTextColor: '#fff',
13
+ });
14
+
15
+ expect(styles).toMatchObject({
16
+ '--memori-primary-color': '#8246af',
17
+ '--memori-primary-content': '#fff',
18
+ });
19
+ expect(styles).not.toHaveProperty('--memori-primary-hover');
20
+ expect(styles).not.toHaveProperty('--memori-primary-active');
21
+ expect(styles).toHaveProperty('--memori-icon-active-bg');
22
+ expect(styles).toHaveProperty('--memori-icon-recording-bg');
23
+ });
24
+ });
@@ -6,7 +6,7 @@ import MicrophoneButton, { Props } from './MicrophoneButton';
6
6
  import './MicrophoneButton.css';
7
7
 
8
8
  const meta: Meta = {
9
- title: 'Widget/Microphone Button',
9
+ title: 'Internals/Microphone Button',
10
10
  component: MicrophoneButton,
11
11
  argTypes: {
12
12
  disabled: {
@@ -1,5 +1,5 @@
1
1
  .memori-mobile-session-panel--overlay {
2
- position: fixed;
2
+ position: absolute;
3
3
  z-index: 2100;
4
4
  top: 0;
5
5
  right: 0;
@@ -343,7 +343,7 @@
343
343
  .memori-dropdown--user-email {
344
344
  overflow: hidden;
345
345
  margin: 0;
346
- color: var(--memori-text-muted, #666);
346
+ color: var(--memori-neutral, #666);
347
347
  font-size: 0.875rem;
348
348
  line-height: 1.35;
349
349
  text-overflow: ellipsis;
@@ -37,7 +37,7 @@
37
37
 
38
38
  .memori-position-popover__switch-icon {
39
39
  flex-shrink: 0;
40
- color: var(--memori-text-color-secondary, rgba(255, 255, 255, 0.75));
40
+ color: var(--memori-neutral, rgba(255, 255, 255, 0.75));
41
41
  }
42
42
 
43
43
  .memori-position-popover__switch-label {
@@ -55,7 +55,7 @@
55
55
  }
56
56
 
57
57
  .memori-position-popover__switch-label-subtitle {
58
- color: var(--memori-text-color-secondary, rgba(255, 255, 255, 0.65));
58
+ color: var(--memori-neutral, rgba(255, 255, 255, 0.65));
59
59
  font-size: 0.75rem;
60
60
  line-height: 1.2;
61
61
  }
@@ -181,7 +181,7 @@
181
181
 
182
182
  .memori-position-popover__error {
183
183
  margin: 0 0 var(--memori-spacing-sm);
184
- color: var(--memori-danger, #c53030);
184
+ color: var(--memori-error, #c53030);
185
185
  font-size: 0.875rem;
186
186
  line-height: var(--memori-text-line-normal);
187
187
  }
@@ -6,7 +6,7 @@ import { memori, venue } from '../../mocks/data';
6
6
  import PositionPopover from './PositionPopover';
7
7
 
8
8
  const meta: Meta = {
9
- title: 'Widget/PositionPopover',
9
+ title: 'Surfaces/PositionPopover',
10
10
  component: PositionPopover,
11
11
  };
12
12