@memori.ai/memori-react 9.0.0-alpha.4 → 9.0.0-alpha.6

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 (268) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/components/AgeVerificationModal/AgeVerificationModal.js +5 -2
  3. package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  4. package/dist/components/Avatar/Avatar.js +5 -10
  5. package/dist/components/Avatar/Avatar.js.map +1 -1
  6. package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js +8 -1
  7. package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js.map +1 -1
  8. package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js +1 -1
  9. package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js.map +1 -1
  10. package/dist/components/Avatar/AvatarView/AvatarComponent/constants.d.ts +2 -0
  11. package/dist/components/Avatar/AvatarView/AvatarComponent/constants.js +14 -5
  12. package/dist/components/Avatar/AvatarView/AvatarComponent/constants.js.map +1 -1
  13. package/dist/components/ChatBubble/ChatBubble.js +22 -16
  14. package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
  15. package/dist/components/CompletionProviderStatus/CompletionProviderStatus.js +6 -3
  16. package/dist/components/CompletionProviderStatus/CompletionProviderStatus.js.map +1 -1
  17. package/dist/components/DateSelector/DateSelector.d.ts +2 -1
  18. package/dist/components/DateSelector/DateSelector.js +17 -7
  19. package/dist/components/DateSelector/DateSelector.js.map +1 -1
  20. package/dist/components/FilePreview/FilePreview.js +22 -5
  21. package/dist/components/FilePreview/FilePreview.js.map +1 -1
  22. package/dist/components/Header/ChatConsumptionDropdown.js +1 -1
  23. package/dist/components/Header/ChatConsumptionDropdown.js.map +1 -1
  24. package/dist/components/Header/Header.css +2 -1
  25. package/dist/components/Header/Header.js +1 -1
  26. package/dist/components/Header/Header.js.map +1 -1
  27. package/dist/components/MediaWidget/MediaItemWidget.js +14 -12
  28. package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -1
  29. package/dist/components/MediaWidget/MediaItemWidget.utils.d.ts +3 -2
  30. package/dist/components/MediaWidget/MediaItemWidget.utils.js +28 -6
  31. package/dist/components/MediaWidget/MediaItemWidget.utils.js.map +1 -1
  32. package/dist/components/MediaWidget/MediaPreviewModal.js +6 -7
  33. package/dist/components/MediaWidget/MediaPreviewModal.js.map +1 -1
  34. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +5 -4
  35. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +90 -38
  36. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +1 -0
  37. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +14 -9
  38. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  39. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +2 -2
  40. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
  41. package/dist/components/MemoriWidget/MemoriWidget.js +632 -280
  42. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  43. package/dist/components/StartPanel/StartPanel.js +10 -5
  44. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  45. package/dist/components/UploadButton/UploadButton.js +21 -5
  46. package/dist/components/UploadButton/UploadButton.js.map +1 -1
  47. package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js +123 -59
  48. package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
  49. package/dist/components/layouts/Chat.js +25 -30
  50. package/dist/components/layouts/Chat.js.map +1 -1
  51. package/dist/components/layouts/FullPage.js +5 -8
  52. package/dist/components/layouts/FullPage.js.map +1 -1
  53. package/dist/components/layouts/HiddenChat.js +2 -1
  54. package/dist/components/layouts/HiddenChat.js.map +1 -1
  55. package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js +5 -1
  56. package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
  57. package/dist/components/layouts/WebsiteAssistant/website-assistant.css +3 -4
  58. package/dist/components/layouts/ZoomedFullBody.js +4 -7
  59. package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
  60. package/dist/components/layouts/chat.css +19 -31
  61. package/dist/components/layouts/fullpage.css +52 -19
  62. package/dist/components/layouts/zoomed-full-body.css +40 -1
  63. package/dist/helpers/constants.d.ts +3 -0
  64. package/dist/helpers/constants.js +27 -1
  65. package/dist/helpers/constants.js.map +1 -1
  66. package/dist/helpers/credits.d.ts +5 -2
  67. package/dist/helpers/credits.js +5 -1
  68. package/dist/helpers/credits.js.map +1 -1
  69. package/dist/helpers/message.d.ts +1 -1
  70. package/dist/helpers/message.js +4 -4
  71. package/dist/helpers/message.js.map +1 -1
  72. package/dist/helpers/nats/getNatsConfig.d.ts +9 -0
  73. package/dist/helpers/nats/getNatsConfig.js +65 -0
  74. package/dist/helpers/nats/getNatsConfig.js.map +1 -0
  75. package/dist/helpers/nats/isSessionExpiredError.d.ts +3 -0
  76. package/dist/helpers/nats/isSessionExpiredError.js +36 -0
  77. package/dist/helpers/nats/isSessionExpiredError.js.map +1 -0
  78. package/dist/helpers/nats/useNats.d.ts +12 -0
  79. package/dist/helpers/nats/useNats.js +75 -0
  80. package/dist/helpers/nats/useNats.js.map +1 -0
  81. package/dist/helpers/nats/useNatsSession.d.ts +28 -0
  82. package/dist/helpers/nats/useNatsSession.js +212 -0
  83. package/dist/helpers/nats/useNatsSession.js.map +1 -0
  84. package/dist/helpers/usePressTooltip.d.ts +13 -0
  85. package/dist/helpers/usePressTooltip.js +23 -0
  86. package/dist/helpers/usePressTooltip.js.map +1 -0
  87. package/dist/helpers/utils.d.ts +21 -0
  88. package/dist/helpers/utils.js +75 -4
  89. package/dist/helpers/utils.js.map +1 -1
  90. package/dist/locales/de.json +1 -0
  91. package/dist/locales/en.json +1 -0
  92. package/dist/locales/es.json +1 -0
  93. package/dist/locales/fr.json +1 -0
  94. package/dist/locales/it.json +1 -0
  95. package/dist/styles.css +1 -1
  96. package/dist/types/integration.d.ts +3 -0
  97. package/dist/types/integration.js +16 -0
  98. package/dist/types/integration.js.map +1 -0
  99. package/dist/version.d.ts +1 -1
  100. package/dist/version.js +1 -1
  101. package/esm/components/AgeVerificationModal/AgeVerificationModal.js +5 -2
  102. package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  103. package/esm/components/Avatar/Avatar.js +5 -10
  104. package/esm/components/Avatar/Avatar.js.map +1 -1
  105. package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js +9 -2
  106. package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js.map +1 -1
  107. package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js +2 -2
  108. package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js.map +1 -1
  109. package/esm/components/Avatar/AvatarView/AvatarComponent/constants.d.ts +2 -0
  110. package/esm/components/Avatar/AvatarView/AvatarComponent/constants.js +13 -4
  111. package/esm/components/Avatar/AvatarView/AvatarComponent/constants.js.map +1 -1
  112. package/esm/components/ChatBubble/ChatBubble.js +22 -16
  113. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  114. package/esm/components/CompletionProviderStatus/CompletionProviderStatus.js +6 -3
  115. package/esm/components/CompletionProviderStatus/CompletionProviderStatus.js.map +1 -1
  116. package/esm/components/DateSelector/DateSelector.d.ts +2 -1
  117. package/esm/components/DateSelector/DateSelector.js +17 -7
  118. package/esm/components/DateSelector/DateSelector.js.map +1 -1
  119. package/esm/components/FilePreview/FilePreview.js +24 -7
  120. package/esm/components/FilePreview/FilePreview.js.map +1 -1
  121. package/esm/components/Header/ChatConsumptionDropdown.js +1 -1
  122. package/esm/components/Header/ChatConsumptionDropdown.js.map +1 -1
  123. package/esm/components/Header/Header.css +2 -1
  124. package/esm/components/Header/Header.js +1 -1
  125. package/esm/components/Header/Header.js.map +1 -1
  126. package/esm/components/MediaWidget/MediaItemWidget.js +16 -14
  127. package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -1
  128. package/esm/components/MediaWidget/MediaItemWidget.utils.d.ts +3 -2
  129. package/esm/components/MediaWidget/MediaItemWidget.utils.js +27 -6
  130. package/esm/components/MediaWidget/MediaItemWidget.utils.js.map +1 -1
  131. package/esm/components/MediaWidget/MediaPreviewModal.js +6 -7
  132. package/esm/components/MediaWidget/MediaPreviewModal.js.map +1 -1
  133. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +5 -4
  134. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +90 -38
  135. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +1 -0
  136. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +14 -9
  137. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  138. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +2 -2
  139. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
  140. package/esm/components/MemoriWidget/MemoriWidget.js +632 -280
  141. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  142. package/esm/components/StartPanel/StartPanel.js +10 -5
  143. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  144. package/esm/components/UploadButton/UploadButton.js +21 -5
  145. package/esm/components/UploadButton/UploadButton.js.map +1 -1
  146. package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js +123 -59
  147. package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
  148. package/esm/components/layouts/Chat.js +25 -30
  149. package/esm/components/layouts/Chat.js.map +1 -1
  150. package/esm/components/layouts/FullPage.js +5 -8
  151. package/esm/components/layouts/FullPage.js.map +1 -1
  152. package/esm/components/layouts/HiddenChat.js +2 -1
  153. package/esm/components/layouts/HiddenChat.js.map +1 -1
  154. package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js +5 -1
  155. package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
  156. package/esm/components/layouts/WebsiteAssistant/website-assistant.css +3 -4
  157. package/esm/components/layouts/ZoomedFullBody.js +4 -7
  158. package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
  159. package/esm/components/layouts/chat.css +19 -31
  160. package/esm/components/layouts/fullpage.css +52 -19
  161. package/esm/components/layouts/zoomed-full-body.css +40 -1
  162. package/esm/helpers/constants.d.ts +3 -0
  163. package/esm/helpers/constants.js +26 -0
  164. package/esm/helpers/constants.js.map +1 -1
  165. package/esm/helpers/credits.d.ts +5 -2
  166. package/esm/helpers/credits.js +5 -1
  167. package/esm/helpers/credits.js.map +1 -1
  168. package/esm/helpers/message.d.ts +1 -1
  169. package/esm/helpers/message.js +2 -2
  170. package/esm/helpers/message.js.map +1 -1
  171. package/esm/helpers/nats/getNatsConfig.d.ts +9 -0
  172. package/esm/helpers/nats/getNatsConfig.js +61 -0
  173. package/esm/helpers/nats/getNatsConfig.js.map +1 -0
  174. package/esm/helpers/nats/isSessionExpiredError.d.ts +3 -0
  175. package/esm/helpers/nats/isSessionExpiredError.js +32 -0
  176. package/esm/helpers/nats/isSessionExpiredError.js.map +1 -0
  177. package/esm/helpers/nats/useNats.d.ts +12 -0
  178. package/esm/helpers/nats/useNats.js +72 -0
  179. package/esm/helpers/nats/useNats.js.map +1 -0
  180. package/esm/helpers/nats/useNatsSession.d.ts +28 -0
  181. package/esm/helpers/nats/useNatsSession.js +208 -0
  182. package/esm/helpers/nats/useNatsSession.js.map +1 -0
  183. package/esm/helpers/usePressTooltip.d.ts +13 -0
  184. package/esm/helpers/usePressTooltip.js +20 -0
  185. package/esm/helpers/usePressTooltip.js.map +1 -0
  186. package/esm/helpers/utils.d.ts +21 -0
  187. package/esm/helpers/utils.js +68 -3
  188. package/esm/helpers/utils.js.map +1 -1
  189. package/esm/locales/de.json +1 -0
  190. package/esm/locales/en.json +1 -0
  191. package/esm/locales/es.json +1 -0
  192. package/esm/locales/fr.json +1 -0
  193. package/esm/locales/it.json +1 -0
  194. package/esm/styles.css +1 -1
  195. package/esm/types/integration.d.ts +3 -0
  196. package/esm/types/integration.js +11 -0
  197. package/esm/types/integration.js.map +1 -0
  198. package/esm/version.d.ts +1 -1
  199. package/esm/version.js +1 -1
  200. package/package.json +6 -4
  201. package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +6 -1
  202. package/src/components/Avatar/Avatar.stories.tsx +45 -28
  203. package/src/components/Avatar/Avatar.test.tsx +54 -0
  204. package/src/components/Avatar/Avatar.tsx +8 -12
  205. package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.tsx +12 -5
  206. package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.ts +2 -1
  207. package/src/components/Avatar/AvatarView/AvatarComponent/constants.ts +16 -4
  208. package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +164 -0
  209. package/src/components/ChatBubble/ChatBubble.tsx +41 -12
  210. package/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx +8 -4
  211. package/src/components/DateSelector/DateSelector.stories.tsx +11 -2
  212. package/src/components/DateSelector/DateSelector.tsx +28 -9
  213. package/src/components/FilePreview/FilePreview.tsx +28 -7
  214. package/src/components/Header/ChatConsumptionDropdown.tsx +5 -1
  215. package/src/components/Header/Header.css +2 -1
  216. package/src/components/Header/Header.tsx +1 -0
  217. package/src/components/MediaWidget/MediaItemWidget.tsx +26 -13
  218. package/src/components/MediaWidget/MediaItemWidget.utils.test.ts +45 -2
  219. package/src/components/MediaWidget/MediaItemWidget.utils.ts +39 -6
  220. package/src/components/MediaWidget/MediaPreviewModal.tsx +9 -7
  221. package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +218 -2252
  222. package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +5 -4
  223. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +90 -38
  224. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +31 -14
  225. package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +4 -3
  226. package/src/components/MemoriWidget/MemoriWidget.tsx +785 -331
  227. package/src/components/StartPanel/StartPanel.stories.tsx +22 -0
  228. package/src/components/StartPanel/StartPanel.test.tsx +64 -1
  229. package/src/components/StartPanel/StartPanel.tsx +26 -3
  230. package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +261 -0
  231. package/src/components/UploadButton/UploadButton.tsx +30 -11
  232. package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +148 -61
  233. package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +2 -2
  234. package/src/components/layouts/Chat.tsx +16 -19
  235. package/src/components/layouts/FullPage.tsx +32 -25
  236. package/src/components/layouts/HiddenChat.tsx +4 -0
  237. package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.tsx +8 -0
  238. package/src/components/layouts/WebsiteAssistant/website-assistant.css +3 -4
  239. package/src/components/layouts/ZoomedFullBody.tsx +30 -24
  240. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +6 -3
  241. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +824 -810
  242. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +280 -273
  243. package/src/components/layouts/chat.css +19 -31
  244. package/src/components/layouts/fullpage.css +52 -19
  245. package/src/components/layouts/layouts.stories.tsx +131 -12
  246. package/src/components/layouts/zoomed-full-body.css +40 -1
  247. package/src/helpers/constants.ts +32 -1
  248. package/src/helpers/credits.ts +16 -1
  249. package/src/helpers/message.test.ts +28 -1
  250. package/src/helpers/message.ts +4 -4
  251. package/src/helpers/nats/getNatsConfig.ts +145 -0
  252. package/src/helpers/nats/isSessionExpiredError.test.ts +38 -0
  253. package/src/helpers/nats/isSessionExpiredError.ts +51 -0
  254. package/src/helpers/nats/useNats.ts +124 -0
  255. package/src/helpers/nats/useNatsSession.ts +394 -0
  256. package/src/helpers/usePressTooltip.ts +29 -0
  257. package/src/helpers/utils.test.ts +162 -0
  258. package/src/helpers/utils.ts +108 -3
  259. package/src/index.stories.tsx +32 -0
  260. package/src/locales/de.json +1 -0
  261. package/src/locales/en.json +1 -0
  262. package/src/locales/es.json +1 -0
  263. package/src/locales/fr.json +1 -0
  264. package/src/locales/it.json +1 -0
  265. package/src/styles.css +4 -7
  266. package/src/types/integration.test.ts +32 -0
  267. package/src/types/integration.ts +31 -0
  268. package/src/version.ts +1 -1
@@ -0,0 +1,3 @@
1
+ export type AvatarMode = 'readyplayerme' | 'readyplayerme-full' | 'customglb' | 'customrpm' | 'userAvatar' | 'avatar-configurator';
2
+ export declare const is3dAvatarWithUrl: (avatar: AvatarMode | string | undefined, avatarURL: string | undefined) => boolean;
3
+ export declare const usesRpmAvatarView: (avatar: AvatarMode | string | undefined) => boolean;
@@ -0,0 +1,11 @@
1
+ export const is3dAvatarWithUrl = (avatar, avatarURL) => !!avatarURL &&
2
+ (avatar === 'readyplayerme' ||
3
+ avatar === 'readyplayerme-full' ||
4
+ avatar === 'customglb' ||
5
+ avatar === 'customrpm' ||
6
+ avatar === 'avatar-configurator');
7
+ export const usesRpmAvatarView = (avatar) => avatar === 'readyplayerme' ||
8
+ avatar === 'readyplayerme-full' ||
9
+ avatar === 'customrpm' ||
10
+ avatar === 'avatar-configurator';
11
+ //# sourceMappingURL=integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../src/types/integration.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAuC,EACvC,SAA6B,EACpB,EAAE,CACX,CAAC,CAAC,SAAS;IACX,CAAC,MAAM,KAAK,eAAe;QACzB,MAAM,KAAK,oBAAoB;QAC/B,MAAM,KAAK,WAAW;QACtB,MAAM,KAAK,WAAW;QACtB,MAAM,KAAK,qBAAqB,CAAC,CAAC;AAGtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAuC,EAC9B,EAAE,CACX,MAAM,KAAK,eAAe;IAC1B,MAAM,KAAK,oBAAoB;IAC/B,MAAM,KAAK,WAAW;IACtB,MAAM,KAAK,qBAAqB,CAAC"}
package/esm/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "9.0.0-alpha.4";
1
+ export declare const version = "9.0.0-alpha.6";
package/esm/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '9.0.0-alpha.4';
1
+ export const version = '9.0.0-alpha.6';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "9.0.0-alpha.4",
2
+ "version": "9.0.0-alpha.6",
3
3
  "name": "@memori.ai/memori-react",
4
4
  "author": "Memori Srl",
5
5
  "main": "dist/index.js",
@@ -301,12 +301,14 @@
301
301
  "typescript": ">=4.8"
302
302
  },
303
303
  "dependencies": {
304
- "@memori.ai/memori-api-client": "6.22.0",
305
- "@memori.ai/ui": "^1.15.0",
304
+ "@memori.ai/memori-api-client": "6.24.1",
305
+ "@memori.ai/ui": "^1.16.1",
306
+ "@nats-io/jetstream": "^3.4.0",
307
+ "@nats-io/nats-core": "^3.4.0",
306
308
  "@react-three/drei": "8.20.2",
307
309
  "@react-three/fiber": "7.0.25",
308
310
  "classnames": "2.5.1",
309
- "dompurify": "^3.4.0",
311
+ "dompurify": "^3.4.12",
310
312
  "ellipsed": "1.6.0",
311
313
  "i18next": "22.0.6",
312
314
  "katex": "^0.16.11",
@@ -66,6 +66,10 @@ const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
66
66
  setSubmitting(false);
67
67
  }, [add, birthDate, minAge, onClose, t]);
68
68
 
69
+ const handleDateChange = useCallback((date: DateTime | undefined) => {
70
+ setBirthDate(date);
71
+ }, []);
72
+
69
73
  return (
70
74
  <Modal
71
75
  open={visible}
@@ -93,8 +97,9 @@ const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
93
97
  required
94
98
  >
95
99
  <DateSelector
100
+ minAge={minAge}
96
101
  onChange={date => {
97
- setBirthDate(date);
102
+ handleDateChange(date);
98
103
  setError(undefined);
99
104
  }}
100
105
  />
@@ -6,6 +6,7 @@ import Avatar, { Props } from './Avatar';
6
6
 
7
7
  import './Avatar.css';
8
8
  import { ArtifactProvider } from '../MemoriArtifactSystem/context/ArtifactContext';
9
+ import { VisemeProvider } from '../../context/visemeContext';
9
10
 
10
11
  const meta: Meta = {
11
12
  title: 'Widget/Avatar',
@@ -33,34 +34,38 @@ const Template: Story<Props> = args => {
33
34
 
34
35
  return (
35
36
  <I18nWrapper>
36
- <ArtifactProvider>
37
- <div
38
- style={
39
- args.integrationConfig?.avatar === 'customglb' ||
40
- args.integrationConfig?.avatar === 'readyplayerme' ||
41
- args.integrationConfig?.avatar === 'readyplayerme-full'
42
- ? {}
43
- : { marginTop: '20vw' }
44
- }
45
- >
46
- <Avatar
47
- {...args}
48
- integrationConfig={
49
- args.integrationConfig
50
- ? {
51
- ...args.integrationConfig,
52
- avatarURL:
53
- args.integrationConfig.avatarURL?.split('#')?.[0] +
54
- `#${new Date(Date.now()).toISOString()}`,
55
- }
56
- : undefined
57
- }
58
- avatar3dVisible={avatar3dVisible}
59
- setAvatar3dVisible={setAvatar3dVisible}
60
- key={Date.now()}
61
- />
62
- </div>
63
- </ArtifactProvider>
37
+ <VisemeProvider>
38
+ {' '}
39
+ <ArtifactProvider>
40
+ <div
41
+ style={
42
+ args.integrationConfig?.avatar === 'customglb' ||
43
+ args.integrationConfig?.avatar === 'readyplayerme' ||
44
+ args.integrationConfig?.avatar === 'readyplayerme-full' ||
45
+ args.integrationConfig?.avatar === 'avatar-configurator'
46
+ ? {}
47
+ : { marginTop: '20vw' }
48
+ }
49
+ >
50
+ <Avatar
51
+ {...args}
52
+ integrationConfig={
53
+ args.integrationConfig
54
+ ? {
55
+ ...args.integrationConfig,
56
+ avatarURL:
57
+ args.integrationConfig.avatarURL?.split('#')?.[0] +
58
+ `#${new Date(Date.now()).toISOString()}`,
59
+ }
60
+ : undefined
61
+ }
62
+ avatar3dVisible={avatar3dVisible}
63
+ setAvatar3dVisible={setAvatar3dVisible}
64
+ key={Date.now()}
65
+ />
66
+ </div>
67
+ </ArtifactProvider>
68
+ </VisemeProvider>
64
69
  </I18nWrapper>
65
70
  );
66
71
  };
@@ -141,3 +146,15 @@ FullbodyReadyPlayerMeAvatar.args = {
141
146
  'https://models.readyplayer.me/63b55751f17e295642bf07a2.glb#1669136149862',
142
147
  },
143
148
  };
149
+
150
+ export const AvatarConfigurator = Template.bind({});
151
+ AvatarConfigurator.args = {
152
+ ...FullbodyReadyPlayerMeAvatar.args,
153
+ integrationConfig: {
154
+ ...integrationConfig,
155
+ avatar: 'avatar-configurator',
156
+ avatarURL:
157
+ 'https://models.readyplayer.me/63b55751f17e295642bf07a2.glb#1669136149862',
158
+ },
159
+ avatarType: 'avatar3d',
160
+ };
@@ -102,3 +102,57 @@ it('renders Avatar with rpm 3d avatar unchanged', () => {
102
102
  );
103
103
  expect(container).toMatchSnapshot();
104
104
  });
105
+
106
+ it('renders Avatar with avatar-configurator like readyplayerme-full', () => {
107
+ const { container } = render(
108
+ <VisemeProvider>
109
+ <Avatar
110
+ memori={memori}
111
+ integration={integration}
112
+ isTotem={false}
113
+ setEnablePositionControls={() => {}}
114
+ integrationConfig={{
115
+ ...integrationConfig,
116
+ avatar: 'avatar-configurator',
117
+ avatarURL:
118
+ 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
119
+ }}
120
+ tenant={tenant}
121
+ instruct={false}
122
+ avatar3dVisible={true}
123
+ setAvatar3dVisible={() => {}}
124
+ hasUserActivatedSpeak={false}
125
+ isPlayingAudio={false}
126
+ avatarType="avatar3d"
127
+ />
128
+ </VisemeProvider>
129
+ );
130
+ expect(container).toMatchSnapshot();
131
+ });
132
+
133
+ it('renders Avatar with avatar-configurator on totem layout unchanged', () => {
134
+ const { container } = render(
135
+ <VisemeProvider>
136
+ <Avatar
137
+ memori={memori}
138
+ integration={integration}
139
+ isTotem
140
+ setEnablePositionControls={() => {}}
141
+ integrationConfig={{
142
+ ...integrationConfig,
143
+ avatar: 'avatar-configurator',
144
+ avatarURL:
145
+ 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
146
+ }}
147
+ tenant={tenant}
148
+ instruct={false}
149
+ avatar3dVisible={true}
150
+ setAvatar3dVisible={() => {}}
151
+ hasUserActivatedSpeak={false}
152
+ isPlayingAudio={false}
153
+ avatarType="avatar3d"
154
+ />
155
+ </VisemeProvider>
156
+ );
157
+ expect(container).toMatchSnapshot();
158
+ });
@@ -15,6 +15,7 @@ import { Eye, EyeOff, Pencil } from 'lucide-react';
15
15
  import cx from 'classnames';
16
16
  import ContainerAvatarView from './AvatarView';
17
17
  import { useViseme } from '../../context/visemeContext';
18
+ import { is3dAvatarWithUrl, usesRpmAvatarView } from '../../types/integration';
18
19
 
19
20
  export interface Props {
20
21
  memori: Memori;
@@ -88,11 +89,10 @@ const Avatar: React.FC<Props> = ({
88
89
 
89
90
  const renderAvatar = () => {
90
91
  if (
91
- (integrationConfig?.avatar === 'readyplayerme' ||
92
- integrationConfig?.avatar === 'readyplayerme-full' ||
93
- integrationConfig?.avatar === 'customglb' ||
94
- integrationConfig?.avatar === 'customrpm') &&
95
- integrationConfig?.avatarURL &&
92
+ is3dAvatarWithUrl(
93
+ integrationConfig?.avatar,
94
+ integrationConfig?.avatarURL
95
+ ) &&
96
96
  avatarType &&
97
97
  avatarType !== 'blob'
98
98
  ) {
@@ -121,12 +121,8 @@ const Avatar: React.FC<Props> = ({
121
121
  };
122
122
 
123
123
  const renderAvatarContent = () => {
124
- if (!isClient) return null;
125
- if (
126
- integrationConfig?.avatar === 'readyplayerme' ||
127
- integrationConfig?.avatar === 'readyplayerme-full' ||
128
- integrationConfig?.avatar === 'customrpm'
129
- ) {
124
+ if (!isClient || !integrationConfig) return null;
125
+ if (usesRpmAvatarView(integrationConfig.avatar)) {
130
126
  return (
131
127
  <ErrorBoundary
132
128
  fallback={
@@ -161,7 +157,7 @@ const Avatar: React.FC<Props> = ({
161
157
  );
162
158
  }
163
159
 
164
- if (integrationConfig?.avatar === 'customglb') {
160
+ if (integrationConfig.avatar === 'customglb') {
165
161
  return (
166
162
  <ModelViewer
167
163
  poster={getAvatarUrl() || ''}
@@ -9,6 +9,7 @@ import {
9
9
  ANIMATION_URLS,
10
10
  AVATAR_POSITION,
11
11
  AVATAR_ROTATION,
12
+ MALE_EXCLUDED_ANIMATIONS,
12
13
  SCALE_LERP_FACTOR,
13
14
  } from '../../constants';
14
15
  import DynamicShadow from '../../Shadow/DynamicShadow';
@@ -64,11 +65,17 @@ export function FullbodyAvatar({
64
65
  return found;
65
66
  }, [scene]);
66
67
 
67
- // Merge base and additional animations only if needed
68
- const mergedAnimations = useMemo(
69
- () => needsAdditionalAnimations ? [...baseAnimations, ...additionalAnimations] : baseAnimations,
70
- [baseAnimations, additionalAnimations, needsAdditionalAnimations]
71
- );
68
+ // Merge base and additional animations only if needed.
69
+ // For male avatars, exclude problematic idle clips from the full set (base + pack).
70
+ const mergedAnimations = useMemo(() => {
71
+ const clips = needsAdditionalAnimations
72
+ ? [...baseAnimations, ...additionalAnimations]
73
+ : baseAnimations;
74
+
75
+ if (sex !== 'MALE') return clips;
76
+
77
+ return clips.filter(clip => !MALE_EXCLUDED_ANIMATIONS.has(clip.name));
78
+ }, [baseAnimations, additionalAnimations, needsAdditionalAnimations, sex]);
72
79
 
73
80
  // Create animation actions from the merged animations
74
81
  const { actions } = useAnimations(mergedAnimations, scene);
@@ -2,6 +2,7 @@ import { SkinnedMesh } from 'three';
2
2
  import { MathUtils } from 'three';
3
3
  import {
4
4
  EMOTION_SMOOTHING,
5
+ EMOTION_INTENSITY,
5
6
  VISEME_SMOOTHING,
6
7
  BLINK_CONFIG,
7
8
  MAPPING_EMOTIONS_ITALIAN_TO_ENGLISH,
@@ -214,7 +215,7 @@ export class MorphTargetController {
214
215
  const currentEmotionValue = this.currentEmotionValues[key] || 0;
215
216
  const newEmotionValue = MathUtils.lerp(
216
217
  currentEmotionValue,
217
- targetEmotionValue * 1.5, // Apply emotion at 80% intensity for more natural expressions
218
+ targetEmotionValue * EMOTION_INTENSITY,
218
219
  EMOTION_SMOOTHING
219
220
  );
220
221
  this.currentEmotionValues[key] = newEmotionValue;
@@ -58,7 +58,8 @@ export const MAPPING_BLEND_SHAPE_TO_EMOTION_RPM: BlendShapeMap = [
58
58
  'browDownRight': 0.5,
59
59
  'browOuterUpLeft': 0.5,
60
60
  'browOuterUpRight': 0.5,
61
- 'mouthSmile': -0.2,
61
+ 'mouthSmileLeft': -0.2,
62
+ 'mouthSmileRight': -0.2,
62
63
  },
63
64
  },
64
65
  {
@@ -77,7 +78,8 @@ export const MAPPING_BLEND_SHAPE_TO_EMOTION_RPM: BlendShapeMap = [
77
78
  'browDownRight': -0.5,
78
79
  'eyeSquintLeft': 0.5,
79
80
  'eyeSquintRight': 0.5,
80
- 'mouthSmile': -0.6,
81
+ 'mouthSmileLeft': -0.6,
82
+ 'mouthSmileRight': -0.6,
81
83
  },
82
84
  },
83
85
  {
@@ -88,7 +90,8 @@ export const MAPPING_BLEND_SHAPE_TO_EMOTION_RPM: BlendShapeMap = [
88
90
  'browOuterUpRight': 0.5,
89
91
  'eyeWideLeft': 0.5,
90
92
  'eyeWideRight': 0.5,
91
- 'mouthSmile': 0.5,
93
+ 'mouthSmileLeft': 0.5,
94
+ 'mouthSmileRight': 0.5,
92
95
  },
93
96
  },
94
97
  {
@@ -97,7 +100,8 @@ export const MAPPING_BLEND_SHAPE_TO_EMOTION_RPM: BlendShapeMap = [
97
100
  'browDownLeft': 0.5,
98
101
  'browDownRight': 0.5,
99
102
  'browInnerUp': 0.5,
100
- 'mouthSmile': 0.5,
103
+ 'mouthSmileLeft': 0.5,
104
+ 'mouthSmileRight': 0.5,
101
105
  },
102
106
  },
103
107
  ];
@@ -109,6 +113,12 @@ export const ANIMATION_URLS = {
109
113
  'https://assets.memori.ai/api/v2/asset/2adc934b-24b2-45bd-94ad-ffec58d3cb32.glb',
110
114
  };
111
115
 
116
+ /** Idle clips excluded from the male animation pack. */
117
+ export const MALE_EXCLUDED_ANIMATIONS = new Set([
118
+ 'Idle',
119
+ 'Idle2'
120
+ ]);
121
+
112
122
  // Blink configuration
113
123
  export const BLINK_CONFIG = {
114
124
  minInterval: 1000,
@@ -127,3 +137,5 @@ export const DEFAULT_CONFIG: AnimationConfig = {
127
137
  // Smoothing factors for emotion and viseme morphs
128
138
  export const EMOTION_SMOOTHING = 0.3;
129
139
  export const VISEME_SMOOTHING = 0.5;
140
+ /** Multiplier applied to emotion morph target values before clamping (1 = raw mapping). */
141
+ export const EMOTION_INTENSITY = 2.5;
@@ -1,5 +1,169 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders Avatar with avatar-configurator like readyplayerme-full 1`] = `
4
+ <div>
5
+ <div
6
+ class="memori--avatar-wrapper memori--avatar-avatar-configurator"
7
+ >
8
+ <div
9
+ class="memori--blob-container"
10
+ >
11
+ <div
12
+ class="memori-blob"
13
+ >
14
+ <div
15
+ class="mainDiv"
16
+ />
17
+ <div
18
+ class="mainDiv"
19
+ />
20
+ <div
21
+ class="mainDiv"
22
+ />
23
+ <div
24
+ class="mainDiv"
25
+ />
26
+ <div
27
+ class="mainDiv"
28
+ />
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <div
33
+ class="memori--avatar-toggle"
34
+ >
35
+ <button
36
+ aria-label="hide"
37
+ class="memori-button memori-button--ghost memori-button--md"
38
+ tabindex="0"
39
+ type="button"
40
+ >
41
+ <span
42
+ class="memori-button__icon"
43
+ >
44
+ <svg
45
+ aria-hidden="true"
46
+ class="lucide lucide-eye-off"
47
+ fill="none"
48
+ height="24"
49
+ stroke="currentColor"
50
+ stroke-linecap="round"
51
+ stroke-linejoin="round"
52
+ stroke-width="2"
53
+ viewBox="0 0 24 24"
54
+ width="24"
55
+ xmlns="http://www.w3.org/2000/svg"
56
+ >
57
+ <path
58
+ d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"
59
+ />
60
+ <path
61
+ d="M14.084 14.158a3 3 0 0 1-4.242-4.242"
62
+ />
63
+ <path
64
+ d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"
65
+ />
66
+ <path
67
+ d="m2 2 20 20"
68
+ />
69
+ </svg>
70
+ </span>
71
+ <span
72
+ class="memori-button__content"
73
+ >
74
+ <span
75
+ class="memori--avatar-toggle-text"
76
+ >
77
+ hide
78
+ </span>
79
+ </span>
80
+ </button>
81
+ </div>
82
+ </div>
83
+ `;
84
+
85
+ exports[`renders Avatar with avatar-configurator on totem layout unchanged 1`] = `
86
+ <div>
87
+ <div
88
+ class="memori--avatar-wrapper memori--avatar-avatar-configurator"
89
+ >
90
+ <div
91
+ class="memori--blob-container"
92
+ >
93
+ <div
94
+ class="memori-blob"
95
+ >
96
+ <div
97
+ class="mainDiv"
98
+ />
99
+ <div
100
+ class="mainDiv"
101
+ />
102
+ <div
103
+ class="mainDiv"
104
+ />
105
+ <div
106
+ class="mainDiv"
107
+ />
108
+ <div
109
+ class="mainDiv"
110
+ />
111
+ </div>
112
+ </div>
113
+ </div>
114
+ <div
115
+ class="memori--avatar-toggle"
116
+ >
117
+ <button
118
+ aria-label="hide"
119
+ class="memori-button memori-button--ghost memori-button--md"
120
+ tabindex="0"
121
+ type="button"
122
+ >
123
+ <span
124
+ class="memori-button__icon"
125
+ >
126
+ <svg
127
+ aria-hidden="true"
128
+ class="lucide lucide-eye-off"
129
+ fill="none"
130
+ height="24"
131
+ stroke="currentColor"
132
+ stroke-linecap="round"
133
+ stroke-linejoin="round"
134
+ stroke-width="2"
135
+ viewBox="0 0 24 24"
136
+ width="24"
137
+ xmlns="http://www.w3.org/2000/svg"
138
+ >
139
+ <path
140
+ d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"
141
+ />
142
+ <path
143
+ d="M14.084 14.158a3 3 0 0 1-4.242-4.242"
144
+ />
145
+ <path
146
+ d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"
147
+ />
148
+ <path
149
+ d="m2 2 20 20"
150
+ />
151
+ </svg>
152
+ </span>
153
+ <span
154
+ class="memori-button__content"
155
+ >
156
+ <span
157
+ class="memori--avatar-toggle-text"
158
+ >
159
+ hide
160
+ </span>
161
+ </span>
162
+ </button>
163
+ </div>
164
+ </div>
165
+ `;
166
+
3
167
  exports[`renders Avatar with blob and avatar in blob unchanged 1`] = `
4
168
  <div>
5
169
  <div
@@ -35,6 +35,7 @@ import {
35
35
  } from '../../helpers/message';
36
36
  import { Expandable, Modal } from '@memori.ai/ui';
37
37
  import memoriApiClient from '@memori.ai/memori-api-client';
38
+ import { usePressTooltip } from '../../helpers/usePressTooltip';
38
39
  const ASSET_URL_PATTERN = /https?:\/\/\S*\/api\/v\d+\/asset\/\S+/gi;
39
40
 
40
41
  const sanitizeRawCopyText = (text: string) =>
@@ -122,18 +123,22 @@ const ChatBubble: React.FC<Props> = ({
122
123
  }) => {
123
124
  const { t, i18n } = useTranslation();
124
125
  const lang = i18n.language || 'en';
126
+ const generatedByAiTooltip = usePressTooltip();
125
127
  const [showingWhyThisAnswer, setShowingWhyThisAnswer] = useState(false);
126
128
  const [openFunctionCache, setOpenFunctionCache] = useState(false);
127
129
  const [copyStatus, setCopyStatus] = useState<{
128
130
  plain: 'idle' | 'success' | 'error';
129
131
  raw: 'idle' | 'success' | 'error';
130
- }>({ plain: 'idle', raw: 'idle' });
132
+ functionCache: 'idle' | 'success' | 'error';
133
+ }>({ plain: 'idle', raw: 'idle', functionCache: 'idle' });
131
134
  const copyResetTimers = useRef<{
132
135
  plain: ReturnType<typeof setTimeout> | null;
133
136
  raw: ReturnType<typeof setTimeout> | null;
137
+ functionCache: ReturnType<typeof setTimeout> | null;
134
138
  }>({
135
139
  plain: null,
136
140
  raw: null,
141
+ functionCache: null,
137
142
  });
138
143
  // Initialize MathJax on component mount
139
144
  useEffect(() => {
@@ -242,26 +247,33 @@ const ChatBubble: React.FC<Props> = ({
242
247
 
243
248
  useEffect(() => {
244
249
  return () => {
245
- (Object.keys(copyResetTimers.current) as Array<'plain' | 'raw'>).forEach(
246
- key => {
247
- const timer = copyResetTimers.current[key];
248
- if (timer) {
249
- clearTimeout(timer);
250
- copyResetTimers.current[key] = null;
251
- }
250
+ (
251
+ Object.keys(copyResetTimers.current) as Array<
252
+ 'plain' | 'raw' | 'functionCache'
253
+ >
254
+ ).forEach(key => {
255
+ const timer = copyResetTimers.current[key];
256
+ if (timer) {
257
+ clearTimeout(timer);
258
+ copyResetTimers.current[key] = null;
252
259
  }
253
- );
260
+ });
254
261
  };
255
262
  }, []);
256
263
 
257
- const clearCopyReset = (type: 'plain' | 'raw') => {
264
+ const functionCacheCopyText =
265
+ functionCacheData
266
+ ?.map(f => `${f.title}\n\n${f.content}`)
267
+ .join('\n\n---\n\n') ?? '';
268
+
269
+ const clearCopyReset = (type: 'plain' | 'raw' | 'functionCache') => {
258
270
  if (copyResetTimers.current[type]) {
259
271
  clearTimeout(copyResetTimers.current[type]!);
260
272
  copyResetTimers.current[type] = null;
261
273
  }
262
274
  };
263
275
 
264
- const scheduleCopyReset = (type: 'plain' | 'raw') => {
276
+ const scheduleCopyReset = (type: 'plain' | 'raw' | 'functionCache') => {
265
277
  clearCopyReset(type);
266
278
  copyResetTimers.current[type] = setTimeout(() => {
267
279
  setCopyStatus(prev => ({ ...prev, [type]: 'idle' }));
@@ -269,7 +281,10 @@ const ChatBubble: React.FC<Props> = ({
269
281
  }, COPY_FEEDBACK_MS);
270
282
  };
271
283
 
272
- const handleCopyClick = async (type: 'plain' | 'raw', text: string) => {
284
+ const handleCopyClick = async (
285
+ type: 'plain' | 'raw' | 'functionCache',
286
+ text: string
287
+ ) => {
273
288
  if (!text?.length) return;
274
289
  try {
275
290
  if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {
@@ -736,6 +751,7 @@ const ChatBubble: React.FC<Props> = ({
736
751
  placement="bottom"
737
752
  content={t('generatedByAI')}
738
753
  className="memori-chat--bubble-action-icon memori-chat--bubble-action-icon--ai"
754
+ {...generatedByAiTooltip.tooltipProps}
739
755
  >
740
756
  <span className="memori-chat--bubble-addon-tooltip-trigger">
741
757
  <Button
@@ -745,6 +761,7 @@ const ChatBubble: React.FC<Props> = ({
745
761
  className="memori-chat--bubble-action-button"
746
762
  aria-label={String(t('generatedByAI'))}
747
763
  icon={<Bot aria-hidden />}
764
+ {...generatedByAiTooltip.pressTriggerProps}
748
765
  />
749
766
  </span>
750
767
  </Tooltip>
@@ -823,6 +840,18 @@ const ChatBubble: React.FC<Props> = ({
823
840
  closable={true}
824
841
  onOpenChange={setOpenFunctionCache}
825
842
  >
843
+ <div style={{ marginBottom: '1rem' }}>
844
+ <Button
845
+ icon={<Copy aria-hidden />}
846
+ onClick={() =>
847
+ handleCopyClick('functionCache', functionCacheCopyText)
848
+ }
849
+ >
850
+ {copyStatus.functionCache === 'success'
851
+ ? copiedLabel
852
+ : t('copy') || 'Copy'}
853
+ </Button>
854
+ </div>
826
855
  {functionCacheData?.map((f, i) => (
827
856
  <div
828
857
  key={f.mediumID}