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

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 (283) hide show
  1. package/CHANGELOG.md +453 -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 +14 -11
  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/FeedbackButtons/FeedbackButtons.js +2 -2
  31. package/dist/components/FeedbackButtons/FeedbackButtons.js.map +1 -1
  32. package/dist/components/Header/Header.css +8 -3
  33. package/dist/components/Header/Header.js +15 -18
  34. package/dist/components/Header/Header.js.map +1 -1
  35. package/dist/components/IconButton/IconButton.d.ts +1 -1
  36. package/dist/components/KnownFacts/KnownFacts.css +1 -1
  37. package/dist/components/KnownFacts/KnownFacts.js +2 -5
  38. package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
  39. package/dist/components/LoginDrawer/LoginDrawer.css +16 -14
  40. package/dist/components/LoginDrawer/LoginDrawer.js +19 -11
  41. package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
  42. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  43. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  44. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
  45. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  46. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
  47. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
  48. package/dist/components/MemoriWidget/MemoriWidget.d.ts +1 -0
  49. package/dist/components/MemoriWidget/MemoriWidget.js +93 -32
  50. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  51. package/dist/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  52. package/dist/components/PositionPopover/PositionPopover.css +3 -3
  53. package/dist/components/PositionPopover/PositionPopover.js +38 -25
  54. package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
  55. package/dist/components/Snippet/Snippet.css +1 -1
  56. package/dist/components/StartPanel/StartPanel.css +19 -3
  57. package/dist/components/StartPanel/StartPanel.js +12 -18
  58. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  59. package/dist/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  60. package/dist/components/layouts/chat.css +5 -2
  61. package/dist/components/layouts/totem.css +43 -9
  62. package/dist/helpers/nats/getNatsConfig.js.map +1 -1
  63. package/dist/helpers/nats/useNats.d.ts +2 -1
  64. package/dist/helpers/nats/useNats.js +87 -20
  65. package/dist/helpers/nats/useNats.js.map +1 -1
  66. package/dist/helpers/nats/useNatsSession.d.ts +6 -1
  67. package/dist/helpers/nats/useNatsSession.js +48 -7
  68. package/dist/helpers/nats/useNatsSession.js.map +1 -1
  69. package/dist/helpers/positionPopover.d.ts +2 -1
  70. package/dist/helpers/positionPopover.js +10 -2
  71. package/dist/helpers/positionPopover.js.map +1 -1
  72. package/dist/icons/MemoriIcon.js +1 -1
  73. package/dist/icons/MemoriIcon.js.map +1 -1
  74. package/dist/locales/de.json +4 -1
  75. package/dist/locales/en.json +3 -1
  76. package/dist/locales/es.json +3 -1
  77. package/dist/locales/fr.json +3 -1
  78. package/dist/locales/it.json +3 -1
  79. package/dist/styles.css +1 -1
  80. package/dist/version.d.ts +1 -1
  81. package/dist/version.js +1 -1
  82. package/esm/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
  83. package/esm/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
  84. package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  85. package/esm/components/Auth/Auth.css +12 -5
  86. package/esm/components/Auth/Auth.d.ts +1 -1
  87. package/esm/components/Auth/Auth.js +47 -33
  88. package/esm/components/Auth/Auth.js.map +1 -1
  89. package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
  90. package/esm/components/Chat/Chat.css +1 -0
  91. package/esm/components/Chat/Chat.js +1 -1
  92. package/esm/components/Chat/Chat.js.map +1 -1
  93. package/esm/components/ChatBubble/ChatBubble.css +32 -5
  94. package/esm/components/ChatBubble/ChatBubble.js +14 -11
  95. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  96. package/esm/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
  97. package/esm/components/ChatHistoryDrawer/ChatHistory.js +2 -2
  98. package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
  99. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
  100. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
  101. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js +9 -59
  102. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
  103. package/esm/components/ChatInputs/ChatInputs.js +11 -2
  104. package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
  105. package/esm/components/ChatTextArea/ChatTextArea.css +1 -1
  106. package/esm/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
  107. package/esm/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
  108. package/esm/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
  109. package/esm/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
  110. package/esm/components/FeedbackButtons/FeedbackButtons.js +2 -2
  111. package/esm/components/FeedbackButtons/FeedbackButtons.js.map +1 -1
  112. package/esm/components/Header/Header.css +8 -3
  113. package/esm/components/Header/Header.js +15 -18
  114. package/esm/components/Header/Header.js.map +1 -1
  115. package/esm/components/IconButton/IconButton.d.ts +1 -1
  116. package/esm/components/KnownFacts/KnownFacts.css +1 -1
  117. package/esm/components/KnownFacts/KnownFacts.js +2 -5
  118. package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
  119. package/esm/components/LoginDrawer/LoginDrawer.css +16 -14
  120. package/esm/components/LoginDrawer/LoginDrawer.js +20 -12
  121. package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
  122. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  123. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  124. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
  125. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  126. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
  127. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
  128. package/esm/components/MemoriWidget/MemoriWidget.d.ts +1 -0
  129. package/esm/components/MemoriWidget/MemoriWidget.js +93 -33
  130. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  131. package/esm/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  132. package/esm/components/PositionPopover/PositionPopover.css +3 -3
  133. package/esm/components/PositionPopover/PositionPopover.js +39 -26
  134. package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
  135. package/esm/components/Snippet/Snippet.css +1 -1
  136. package/esm/components/StartPanel/StartPanel.css +19 -3
  137. package/esm/components/StartPanel/StartPanel.js +12 -18
  138. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  139. package/esm/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  140. package/esm/components/layouts/chat.css +5 -2
  141. package/esm/components/layouts/totem.css +43 -9
  142. package/esm/helpers/nats/getNatsConfig.js.map +1 -1
  143. package/esm/helpers/nats/useNats.d.ts +2 -1
  144. package/esm/helpers/nats/useNats.js +87 -20
  145. package/esm/helpers/nats/useNats.js.map +1 -1
  146. package/esm/helpers/nats/useNatsSession.d.ts +6 -1
  147. package/esm/helpers/nats/useNatsSession.js +48 -8
  148. package/esm/helpers/nats/useNatsSession.js.map +1 -1
  149. package/esm/helpers/positionPopover.d.ts +2 -1
  150. package/esm/helpers/positionPopover.js +9 -2
  151. package/esm/helpers/positionPopover.js.map +1 -1
  152. package/esm/icons/MemoriIcon.js +1 -1
  153. package/esm/icons/MemoriIcon.js.map +1 -1
  154. package/esm/locales/de.json +4 -1
  155. package/esm/locales/en.json +3 -1
  156. package/esm/locales/es.json +3 -1
  157. package/esm/locales/fr.json +3 -1
  158. package/esm/locales/it.json +3 -1
  159. package/esm/styles.css +1 -1
  160. package/esm/version.d.ts +1 -1
  161. package/esm/version.js +1 -1
  162. package/package.json +8 -5
  163. package/src/Live/Agents.stories.tsx +49 -0
  164. package/src/Live/KnownFacts.stories.tsx +50 -0
  165. package/src/Showcase.stories.tsx +3 -14
  166. package/src/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
  167. package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +1 -1
  168. package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +1 -0
  169. package/src/components/Auth/Auth.css +12 -5
  170. package/src/components/Auth/Auth.stories.tsx +1 -1
  171. package/src/components/Auth/Auth.test.tsx +68 -1
  172. package/src/components/Auth/Auth.tsx +69 -54
  173. package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +5 -6
  174. package/src/components/Avatar/Avatar.stories.tsx +1 -18
  175. package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +1 -103
  176. package/src/components/Blob/Blob.stories.tsx +1 -1
  177. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
  178. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +1 -1
  179. package/src/components/ChangeMode/ChangeMode.stories.tsx +1 -1
  180. package/src/components/Chat/Chat.css +1 -0
  181. package/src/components/Chat/Chat.stories.tsx +61 -7
  182. package/src/components/Chat/Chat.tsx +1 -0
  183. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +151 -151
  184. package/src/components/ChatBubble/ChatBubble.css +32 -5
  185. package/src/components/ChatBubble/ChatBubble.stories.tsx +24 -2
  186. package/src/components/ChatBubble/ChatBubble.test.tsx +37 -1
  187. package/src/components/ChatBubble/ChatBubble.tsx +308 -299
  188. package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +384 -264
  189. package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +1 -1
  190. package/src/components/ChatHistoryDrawer/ChatHistory.tsx +6 -0
  191. package/src/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
  192. package/src/components/ChatHistoryDrawer/ChatResumeDrawer.tsx +24 -81
  193. package/src/components/ChatInputs/ChatInputs.stories.tsx +1 -39
  194. package/src/components/ChatInputs/ChatInputs.test.tsx +47 -0
  195. package/src/components/ChatInputs/ChatInputs.tsx +12 -2
  196. package/src/components/ChatTextArea/ChatTextArea.css +1 -1
  197. package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +1 -1
  198. package/src/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
  199. package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +1 -1
  200. package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
  201. package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +1 -1
  202. package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +29 -10
  203. package/src/components/FeedbackButtons/FeedbackButtons.tsx +2 -0
  204. package/src/components/FeedbackButtons/__snapshots__/FeedbackButtons.test.tsx.snap +1 -1
  205. package/src/components/Header/Header.css +8 -3
  206. package/src/components/Header/Header.stories.tsx +1 -1
  207. package/src/components/Header/Header.tsx +146 -117
  208. package/src/components/KnownFacts/KnownFacts.css +1 -1
  209. package/src/components/KnownFacts/KnownFacts.stories.tsx +1 -23
  210. package/src/components/KnownFacts/KnownFacts.tsx +4 -9
  211. package/src/components/KnownFacts/__snapshots__/KnownFacts.test.tsx.snap +6 -2
  212. package/src/components/LoginDrawer/LoginDrawer.css +16 -14
  213. package/src/components/LoginDrawer/LoginDrawer.stories.tsx +2 -52
  214. package/src/components/LoginDrawer/LoginDrawer.tsx +51 -39
  215. package/src/components/LoginDrawer/__snapshots__/LoginDrawer.test.tsx.snap +33 -11
  216. package/src/components/MediaWidget/MediaItemWidget.stories.tsx +1 -15
  217. package/src/components/MediaWidget/MediaWidget.stories.tsx +1 -45
  218. package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +1 -1
  219. package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  220. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  221. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +4 -6
  222. package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +1 -1
  223. package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +32 -28
  224. package/src/components/MemoriWidget/MemoriUIProvider.contract.test.tsx +55 -0
  225. package/src/components/MemoriWidget/MemoriWidget.stories.tsx +55 -77
  226. package/src/components/MemoriWidget/MemoriWidget.tsx +114 -45
  227. package/src/components/MemoriWidget/getChatStyles.test.ts +24 -0
  228. package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +1 -1
  229. package/src/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  230. package/src/components/PositionPopover/PositionPopover.css +3 -3
  231. package/src/components/PositionPopover/PositionPopover.stories.tsx +1 -1
  232. package/src/components/PositionPopover/PositionPopover.tsx +50 -28
  233. package/src/components/PoweredBy/PoweredBy.stories.tsx +1 -54
  234. package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +2 -2
  235. package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +1 -1
  236. package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +1 -1
  237. package/src/components/ShareButton/ShareButton.stories.tsx +1 -1
  238. package/src/components/Snippet/Snippet.css +1 -1
  239. package/src/components/Snippet/Snippet.stories.tsx +1 -1
  240. package/src/components/StartPanel/StartPanel.css +19 -3
  241. package/src/components/StartPanel/StartPanel.stories.tsx +2 -2
  242. package/src/components/StartPanel/StartPanel.tsx +22 -35
  243. package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +177 -121
  244. package/src/components/Typing/Typing.stories.tsx +1 -1
  245. package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +22 -44
  246. package/src/components/WhyThisAnswer/__snapshots__/WhyThisAnswer.test.tsx.snap +9 -3
  247. package/src/components/layouts/FullBody/FullBody.stories.tsx +55 -68
  248. package/src/components/layouts/Totem/Totem.stories.tsx +69 -87
  249. package/src/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  250. package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +69 -87
  251. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +19 -41
  252. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +39 -83
  253. package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +15 -11
  254. package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +116 -42
  255. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +18 -40
  256. package/src/components/layouts/chat.css +5 -2
  257. package/src/components/layouts/layouts.stories.tsx +96 -179
  258. package/src/components/layouts/totem.css +43 -9
  259. package/src/helpers/nats/getNatsConfig.ts +4 -1
  260. package/src/helpers/nats/useNats.test.tsx +81 -0
  261. package/src/helpers/nats/useNats.ts +109 -29
  262. package/src/helpers/nats/useNatsSession.test.ts +16 -0
  263. package/src/helpers/nats/useNatsSession.ts +79 -13
  264. package/src/helpers/positionPopover.test.ts +36 -1
  265. package/src/helpers/positionPopover.ts +21 -4
  266. package/src/i18n.knownFacts.test.ts +40 -0
  267. package/src/icons/MemoriIcon.tsx +1 -1
  268. package/src/index.stories.tsx +1 -47
  269. package/src/locales/de.json +4 -1
  270. package/src/locales/en.json +3 -1
  271. package/src/locales/es.json +3 -1
  272. package/src/locales/fr.json +3 -1
  273. package/src/locales/it.json +3 -1
  274. package/src/styles.css +13 -27
  275. package/src/version.ts +1 -1
  276. package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
  277. package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
  278. package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
  279. package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
  280. package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -265
  281. package/src/components/UploadButton/UploadButton.stories.tsx +0 -510
  282. package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -69
  283. package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.stories.tsx +0 -115
@@ -1,88 +1,115 @@
1
1
  import React from 'react';
2
- import { Meta, Story } from '@storybook/react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
3
  import { Spin } from '@memori.ai/ui';
4
4
  import { memori, tenant, integration } from '../../mocks/data';
5
5
  import Memori, { Props } from '../../index';
6
6
  import { LayoutProps } from '../MemoriWidget/MemoriWidget';
7
- import I18nWrapper from '../../I18nWrapper';
8
- import { VisemeProvider } from '../../context/visemeContext';
9
- import { ArtifactProvider } from '../MemoriArtifactSystem/context/ArtifactContext';
10
-
11
- const meta: Meta = {
12
- title: 'General/Layouts',
13
- component: (args: Props) => <Memori {...args} />,
14
- argTypes: {},
7
+ import { withWidgetProviders } from '../../../.storybook/decorators';
8
+
9
+ /**
10
+ * Canonical layout matrix — one story per LayoutName (plus Custom + HiddenChat note).
11
+ * Live staging/localhost agents live under `Live/` (see Live/Agents.stories.tsx).
12
+ */
13
+ const meta = {
14
+ title: 'Layouts',
15
+ component: Memori,
16
+ decorators: [withWidgetProviders],
15
17
  parameters: {
16
18
  controls: { expanded: true },
17
19
  layout: 'fullscreen',
18
20
  },
19
- };
21
+ } satisfies Meta<typeof Memori>;
20
22
 
21
23
  export default meta;
24
+ type Story = StoryObj<typeof meta>;
22
25
 
23
- const Template: Story<Props> = args => (
24
- <I18nWrapper>
25
- <ArtifactProvider>
26
- <VisemeProvider>
27
- <Memori {...args} />
28
- </VisemeProvider>
29
- </ArtifactProvider>
30
- </I18nWrapper>
31
- );
32
-
33
- const DefaultLayout = Template.bind({});
34
- DefaultLayout.args = {
35
- memoriName: 'Layout Storybook',
36
- ownerUserName: 'Andrea-Patini',
37
- memoriID: 'ae20fc5a-cc15-4db9-b7dd-2cd4a621b85e',
38
- ownerUserID: '91dbc9ba-b684-4fbe-9828-b5980af6cda9',
39
- tenantID: 'aisuru-staging.aclambda.online',
40
- engineURL: 'https://engine-staging.memori.ai/memori/v2',
41
- apiURL: 'https://backend-staging.memori.ai/api/v2',
42
- // baseURL: 'http://localhost:3000',
43
- layout: 'ZOOMED_FULL_BODY',
26
+ /** Fixture-first base deterministic sidebar entry for each layout. */
27
+ const fixtureBase: Partial<Props> = {
28
+ memori,
29
+ tenant,
30
+ memoriName: memori.name,
31
+ memoriID: memori.memoriID,
32
+ ownerUserName: 'memoridev',
33
+ tenantID: 'www.aisuru.com',
34
+ engineURL: 'https://engine.memori.ai',
35
+ apiURL: 'https://backend.memori.ai',
36
+ baseURL: 'https://www.aisuru.com',
44
37
  uiLang: 'IT',
45
38
  spokenLang: 'IT',
46
- integrationID: '32922e14-24d6-4f5f-a06b-d963da14a658',
47
39
  showSettings: true,
40
+ showShare: true,
48
41
  };
49
42
 
50
- export const Default = Template.bind({});
51
- Default.args = {
52
- ...DefaultLayout.args,
43
+ /** Default layout = FULLPAGE (not Zoomed). */
44
+ export const FullPage: Story = {
45
+ args: {
46
+ ...fixtureBase,
47
+ layout: 'FULLPAGE',
48
+ },
53
49
  };
54
50
 
55
- export const Totem = Template.bind({});
56
- Totem.args = {
57
- ...DefaultLayout.args,
58
- uiLang: 'it',
59
- showShare: true,
60
- showSettings: true,
61
- // memori: memori,
62
- integration: {
63
- ...integration,
51
+ export const Chat: Story = {
52
+ args: {
53
+ ...fixtureBase,
54
+ layout: 'CHAT',
55
+ showUpload: true,
64
56
  },
65
- tenant,
66
- layout: 'TOTEM',
67
57
  };
68
58
 
69
- export const ChatOnly = Template.bind({});
70
- ChatOnly.args = {
71
- ...DefaultLayout.args,
72
- uiLang: 'it',
73
- showShare: true,
74
- showSettings: true,
75
- showUpload: true,
76
- memori: memori,
77
- tenant,
78
- layout: 'CHAT',
59
+ export const Totem: Story = {
60
+ args: {
61
+ ...fixtureBase,
62
+ layout: 'TOTEM',
63
+ integration: { ...integration },
64
+ },
65
+ };
66
+
67
+ export const ZoomedFullBody: Story = {
68
+ args: {
69
+ ...fixtureBase,
70
+ layout: 'ZOOMED_FULL_BODY',
71
+ },
72
+ };
73
+
74
+ export const WebsiteAssistant: Story = {
75
+ args: {
76
+ ...fixtureBase,
77
+ layout: 'WEBSITE_ASSISTANT',
78
+ multilingual: true,
79
+ integration: {
80
+ ...integration,
81
+ customData: JSON.stringify({
82
+ textColor: '#2a2a2a',
83
+ buttonBgColor: '#653165',
84
+ buttonTextColor: '#ffffff',
85
+ blurBackground: true,
86
+ innerBgColor: 'light',
87
+ innerBgAlpha: 0.8,
88
+ multilanguage: true,
89
+ avatar: 'readyplayerme',
90
+ avatarURL:
91
+ 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
92
+ }),
93
+ },
94
+ },
95
+ };
96
+
97
+ export const WebsiteAssistantWithout3DAvatar: Story = {
98
+ args: {
99
+ ...WebsiteAssistant.args,
100
+ avatar3dHidden: true,
101
+ },
102
+ };
103
+
104
+ /** Collapsed / FAB entry point for HIDDEN_CHAT. */
105
+ export const HiddenChat: Story = {
106
+ args: {
107
+ ...fixtureBase,
108
+ layout: 'HIDDEN_CHAT',
109
+ },
79
110
  };
80
111
 
81
112
  const CustomLayout: React.FC<LayoutProps> = ({
82
- Header,
83
- headerProps,
84
- Avatar,
85
- avatarProps,
86
113
  Chat,
87
114
  chatProps,
88
115
  StartPanel,
@@ -97,10 +124,11 @@ const CustomLayout: React.FC<LayoutProps> = ({
97
124
  <>
98
125
  {integrationStyle}
99
126
  {integrationBackground}
100
-
101
- <Spin spinning={loading} className="memori-mycustom-layout">
127
+ <Spin
128
+ spinning={loading}
129
+ className="memori-mycustom-layout"
130
+ >
102
131
  {poweredBy}
103
-
104
132
  <div className="memori-mycustom-layout--controls">
105
133
  {sessionId && hasUserActivatedSpeak && Chat && chatProps ? (
106
134
  <Chat {...chatProps} />
@@ -112,121 +140,10 @@ const CustomLayout: React.FC<LayoutProps> = ({
112
140
  </>
113
141
  );
114
142
 
115
- export const Custom = Template.bind({});
116
- Custom.args = {
117
- ...DefaultLayout.args,
118
- uiLang: 'it',
119
- showShare: true,
120
- showSettings: true,
121
- memori: memori,
122
- tenant,
123
- layout: 'FULLPAGE',
124
- customLayout: CustomLayout,
125
- };
126
-
127
- export const WebsiteAssistant2 = Template.bind({});
128
- WebsiteAssistant2.args = {
129
- memoriName: 'Marconi Express',
130
- ownerUserName: 'exmita',
131
- memoriID: '1755979f-28f1-45d1-8f41-bb34e1f7756b',
132
- ownerUserID: '3194fcd3-040b-4d5e-a925-691911fb1177',
133
- tenantID: 'exmachina.aclambda.online',
134
- engineURL: 'https://engine.memori.ai',
135
- apiURL: 'https://backend.memori.ai',
136
- baseURL: 'https://exmachina.aclambda.online',
137
- uiLang: 'IT',
138
- avatar3dHidden: true,
139
- spokenLang: 'IT',
140
- layout: 'WEBSITE_ASSISTANT',
141
- };
142
-
143
- export const WebsiteAssistant3 = Template.bind({});
144
- WebsiteAssistant3.args = {
145
- memoriName: 'Layout Storybook',
146
- ownerUserName: 'Andrea-Patini',
147
- memoriID: 'ae20fc5a-cc15-4db9-b7dd-2cd4a621b85e',
148
- ownerUserID: '91dbc9ba-b684-4fbe-9828-b5980af6cda9',
149
- tenantID: 'aisuru-staging.aclambda.online',
150
- engineURL: 'https://engine-staging.memori.ai/memori/v2',
151
- apiURL: 'https://backend-staging.memori.ai/api/v2',
152
- baseURL: 'http://localhost:3000',
153
- layout: 'WEBSITE_ASSISTANT',
154
- avatar3dHidden: true,
155
- uiLang: 'IT',
156
- spokenLang: 'IT',
157
- showOnlyLastMessages: true,
158
- integrationID: '716f4728-919c-4015-aae1-88998a081c6f',
159
- };
160
-
161
- export const WebsiteAssistant = Template.bind({});
162
- WebsiteAssistant.args = {
163
- uiLang: 'EN',
164
- showShare: false,
165
- showSettings: true,
166
- memori: memori,
167
- tenant,
168
- layout: 'WEBSITE_ASSISTANT',
169
- memoriName: 'Memori',
170
- memoriID: '25ced51c-3520-41af-8bbe-222d861b8e32',
171
- ownerUserName: 'memoridev',
172
- tenantID: 'www.aisuru.com',
173
- apiURL: 'https://backend.memori.ai',
174
- baseURL: 'https://www.aisuru.com',
175
- spokenLang: 'EN',
176
- context: {
177
- SOURCE: 'WEBSITE',
178
- PATH: '/en/',
179
- },
180
- multilingual: true,
181
- integrationID: 'cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1',
182
- integration: {
183
- ...integration,
184
- customData: JSON.stringify({
185
- textColor: '#2a2a2a',
186
- buttonBgColor: '#653165',
187
- buttonTextColor: '#ffffff',
188
- blurBackground: true,
189
- innerBgColor: 'light',
190
- innerBgAlpha: 0.8,
191
- multilanguage: true,
192
- avatar: 'readyplayerme',
193
- avatarURL:
194
- 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
195
- }),
143
+ export const Custom: Story = {
144
+ args: {
145
+ ...fixtureBase,
146
+ layout: 'FULLPAGE',
147
+ customLayout: CustomLayout,
196
148
  },
197
149
  };
198
-
199
- export const WebsiteAssistantWithout3DAvatar = Template.bind({});
200
- WebsiteAssistantWithout3DAvatar.args = {
201
- ...WebsiteAssistant.args,
202
- avatar3dHidden: true,
203
- };
204
-
205
- export const HiddenChat = Template.bind({});
206
- HiddenChat.args = {
207
- ...DefaultLayout.args,
208
- uiLang: 'it',
209
- showShare: true,
210
- showSettings: true,
211
- memori: memori,
212
- tenant,
213
- layout: 'HIDDEN_CHAT',
214
- };
215
-
216
- export const ZoomedFullBody = Template.bind({});
217
- ZoomedFullBody.args = {
218
- ...DefaultLayout.args,
219
- memoriName: 'Layout Storybook',
220
- ownerUserName: 'Andrea-Patini',
221
- memoriID: 'ae20fc5a-cc15-4db9-b7dd-2cd4a621b85e',
222
- ownerUserID: '91dbc9ba-b684-4fbe-9828-b5980af6cda9',
223
- tenantID: 'aisuru-staging.aclambda.online',
224
- engineURL: 'https://engine-staging.memori.ai/memori/v2',
225
- apiURL: 'https://backend-staging.memori.ai/api/v2',
226
- // baseURL: 'http://localhost:3000',
227
- layout: 'ZOOMED_FULL_BODY',
228
- uiLang: 'IT',
229
- spokenLang: 'IT',
230
- integrationID: '32922e14-24d6-4f5f-a06b-d963da14a658',
231
- showSettings: true,
232
- };
@@ -180,6 +180,11 @@
180
180
  internal scroll instead of pushing the scene up. */
181
181
  .memori-totem-layout--controls {
182
182
  z-index: 100;
183
+ display: flex;
184
+ width: 100%;
185
+ min-height: 0;
186
+ max-height: 48vh;
187
+ flex-direction: column;
183
188
  flex-shrink: 0;
184
189
  }
185
190
 
@@ -187,6 +192,8 @@
187
192
  SECTION 2–3 — Single unified panel + shared alignment axis
188
193
  One container (surface + 1px border + 12px radius). Inner sections have
189
194
  NO border/shadow/width of their own, only 1px dividers between them.
195
+ A definite height (not just max-height) is required so nested overflow-y
196
+ auto actually scrolls instead of clipping.
190
197
  ========================================================================== */
191
198
  .memori-totem-layout--controls .memori-chat--wrapper,
192
199
  .memori-totem-layout--controls .memori--start-panel {
@@ -194,8 +201,11 @@
194
201
  overflow: hidden;
195
202
  width: 100%;
196
203
  max-width: var(--memori-totem-max-width, 600px);
204
+ height: 48vh;
205
+ min-height: 0;
197
206
  max-height: 48vh;
198
207
  box-sizing: border-box;
208
+ flex: 1 1 auto;
199
209
  flex-direction: column;
200
210
  padding: 0;
201
211
  border: 1px solid var(--memori-border-color);
@@ -206,34 +216,53 @@
206
216
 
207
217
  /* Nested conversation column must not add its own axis/padding/surface. */
208
218
  .memori-totem-layout--controls .memori-conversation-column {
219
+ display: flex;
220
+ overflow: hidden;
209
221
  width: 100%;
210
222
  max-width: none;
211
223
  height: auto;
212
224
  min-height: 0;
225
+ flex: 1 1 0%;
226
+ flex-direction: column;
213
227
  padding: 0;
214
228
  margin: 0;
215
229
  }
216
230
 
217
- /* Messages section: height follows content (no empty band), scrolls when capped. */
218
- .memori-totem-layout--controls .memori-chat--history {
219
- height: auto;
231
+ /* Messages section: remaining panel height; children must not size to content. */
232
+ .memori-totem-layout--controls .memori-chat--history,
233
+ .memori-totem-layout--controls .memori-chat--history.memori-chat--history-touch {
234
+ display: flex;
235
+ overflow: hidden;
236
+ height: auto !important;
220
237
  min-height: 0;
221
- flex: 1 1 auto;
238
+ flex: 1 1 0%;
239
+ flex-direction: column;
222
240
  border: none;
223
241
  border-radius: 0;
224
242
  margin: 0;
225
243
  background: transparent;
226
244
  }
227
245
 
228
- .memori-totem-layout--controls .memori-chat--content {
229
- height: auto;
246
+ .memori-totem-layout--controls .memori-chat--content,
247
+ .memori-totem-layout--controls .memori-chat--content.memori-chat--content-touch {
248
+ height: 0;
249
+ min-height: 0;
230
250
  max-height: none;
251
+ flex: 1 1 auto;
231
252
  padding: var(--memori-spacing-md);
232
253
  background: transparent;
254
+ overflow-x: hidden;
255
+ overflow-y: auto;
256
+ overscroll-behavior: contain;
257
+ }
258
+
259
+ .memori-totem-layout--controls .memori-chat--content > * {
260
+ flex-shrink: 0;
233
261
  }
234
262
 
235
263
  /* Input section: 1px divider above, no own surface. */
236
264
  .memori-totem-layout--controls .memori-chat-inputs-wrapper {
265
+ flex-shrink: 0;
237
266
  padding: var(--memori-spacing-md);
238
267
  border-top: 1px solid var(--memori-border-color);
239
268
  background: transparent;
@@ -244,10 +273,15 @@
244
273
  border-radius: 8px;
245
274
  }
246
275
 
276
+ .memori-totem-layout--controls .memori-chat--bubble,
277
+ .memori-totem-layout--controls .memori-chat--bubble.memori-chat--user-bubble {
278
+ font-size: 1.125rem;
279
+ }
280
+
247
281
  /* Start-panel body scrolls internally instead of stretching the panel. */
248
282
  .memori-totem-layout--controls .memori--start-panel__body {
249
283
  min-height: 0;
250
- flex: 1 1 auto;
284
+ flex: 1 1 0%;
251
285
  overflow-y: auto;
252
286
  }
253
287
 
@@ -259,11 +293,11 @@
259
293
  }
260
294
 
261
295
  @media (max-width: 480px) {
262
- .memori-totem-layou .memori-send-on-enter-menu {
296
+ .memori-totem-layout .memori-send-on-enter-menu {
263
297
  display: none;
264
298
  }
265
299
 
266
- .memori-totem-layou .memori-header--button-settings {
300
+ .memori-totem-layout .memori-header--button-settings {
267
301
  display: none;
268
302
  }
269
303
  }
@@ -7,7 +7,10 @@
7
7
  export interface NatsConfig {
8
8
  /** WebSocket URL of the NATS server (e.g. wss://nats.hz.slnode.net:8080). */
9
9
  url: string;
10
- /** Bearer token used to authenticate the WebSocket connection. */
10
+ /**
11
+ * Per-session NATS user JWT. Presented with `jwtAuthenticator` (bearer:
12
+ * no nkey seed on the client).
13
+ */
11
14
  token: string;
12
15
  /**
13
16
  * JetStream stream that stores session events. When set, the client consumes
@@ -0,0 +1,81 @@
1
+ import { act, renderHook, waitFor } from '@testing-library/react';
2
+ import { getNatsConfig } from './getNatsConfig';
3
+ import { useNats } from './useNats';
4
+ import { NatsSessionLifecycle, useNatsSession } from './useNatsSession';
5
+
6
+ jest.mock('./getNatsConfig', () => ({
7
+ getNatsConfig: jest.fn(),
8
+ }));
9
+
10
+ jest.mock('./useNatsSession', () => ({
11
+ useNatsSession: jest.fn(),
12
+ }));
13
+
14
+ const mockGetNatsConfig = getNatsConfig as jest.MockedFunction<
15
+ typeof getNatsConfig
16
+ >;
17
+ const mockUseNatsSession = useNatsSession as jest.MockedFunction<
18
+ typeof useNatsSession
19
+ >;
20
+
21
+ function latestLifecycle(): NatsSessionLifecycle {
22
+ return mockUseNatsSession.mock.calls.at(-1)?.[3] ?? {};
23
+ }
24
+
25
+ describe('useNats credential lifecycle', () => {
26
+ beforeEach(() => {
27
+ jest.clearAllMocks();
28
+ mockGetNatsConfig.mockResolvedValue({
29
+ url: 'wss://nats.example.test',
30
+ token: 'fresh-jwt',
31
+ });
32
+ Object.defineProperty(document, 'visibilityState', {
33
+ configurable: true,
34
+ value: 'visible',
35
+ });
36
+ });
37
+
38
+ it('refreshes the JWT on resume and catches up after reconnecting', async () => {
39
+ const onCatchUp = jest.fn();
40
+ renderHook(() =>
41
+ useNats({
42
+ baseUrl: 'https://dashboard.example.test',
43
+ sessionId: 'session-a',
44
+ onCatchUp,
45
+ })
46
+ );
47
+
48
+ await waitFor(() => expect(mockGetNatsConfig).toHaveBeenCalledTimes(1));
49
+
50
+ act(() => {
51
+ (document.dispatchEvent as (event: Event) => boolean)(
52
+ new Event('visibilitychange')
53
+ );
54
+ });
55
+ await waitFor(() => expect(mockGetNatsConfig).toHaveBeenCalledTimes(2));
56
+
57
+ act(() => latestLifecycle().onConnected?.());
58
+ expect(onCatchUp).toHaveBeenCalledTimes(1);
59
+ });
60
+
61
+ it('refreshes the JWT after an authorization error', async () => {
62
+ const onCatchUp = jest.fn();
63
+ renderHook(() =>
64
+ useNats({
65
+ baseUrl: 'https://dashboard.example.test',
66
+ sessionId: 'session-a',
67
+ onCatchUp,
68
+ })
69
+ );
70
+
71
+ await waitFor(() => expect(mockGetNatsConfig).toHaveBeenCalledTimes(1));
72
+
73
+ act(() => {
74
+ latestLifecycle().onAuthError?.(new Error('Authorization Violation'));
75
+ });
76
+ await waitFor(() => expect(mockGetNatsConfig).toHaveBeenCalledTimes(2));
77
+
78
+ act(() => latestLifecycle().onConnected?.());
79
+ expect(onCatchUp).toHaveBeenCalledTimes(1);
80
+ });
81
+ });