@memori.ai/memori-react 9.0.0-alpha.5 → 9.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js +8 -3
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/dist/components/Auth/Auth.js +3 -1
- package/dist/components/Auth/Auth.js.map +1 -1
- package/dist/components/Avatar/Avatar.js +5 -10
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js +8 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/constants.d.ts +2 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/constants.js +14 -5
- package/dist/components/Avatar/AvatarView/AvatarComponent/constants.js.map +1 -1
- package/dist/components/Chat/Chat.js +3 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.js +21 -15
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.js +3 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/dist/components/CompletionProviderStatus/CompletionProviderStatus.js +6 -3
- package/dist/components/CompletionProviderStatus/CompletionProviderStatus.js.map +1 -1
- package/dist/components/ContentPreviewModal/ContentPreviewModal.js +3 -1
- package/dist/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
- package/dist/components/DateSelector/DateSelector.d.ts +2 -1
- package/dist/components/DateSelector/DateSelector.js +17 -7
- package/dist/components/DateSelector/DateSelector.js.map +1 -1
- package/dist/components/ExpertsDrawer/ExpertsDrawer.js +3 -1
- package/dist/components/ExpertsDrawer/ExpertsDrawer.js.map +1 -1
- package/dist/components/FilePreview/FilePreview.js +22 -5
- package/dist/components/FilePreview/FilePreview.js.map +1 -1
- package/dist/components/KnownFacts/KnownFacts.js +5 -3
- package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
- package/dist/components/LoginDrawer/LoginDrawer.js +3 -1
- package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/dist/components/MediaWidget/MediaItemWidget.js +14 -12
- package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/dist/components/MediaWidget/MediaItemWidget.utils.d.ts +3 -2
- package/dist/components/MediaWidget/MediaItemWidget.utils.js +28 -6
- package/dist/components/MediaWidget/MediaItemWidget.utils.js.map +1 -1
- package/dist/components/MediaWidget/MediaPreviewModal.js +6 -7
- package/dist/components/MediaWidget/MediaPreviewModal.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +19 -5
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +4 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.css +4 -2
- package/dist/components/MemoriWidget/MemoriWidget.js +760 -404
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/SettingsDrawer/SettingsDrawer.js +3 -1
- package/dist/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.js +3 -1
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/UploadButton/UploadButton.js +21 -5
- package/dist/components/UploadButton/UploadButton.js.map +1 -1
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js +126 -60
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/dist/components/UploadButton/UploadImages/UploadImages.js +3 -1
- package/dist/components/UploadButton/UploadImages/UploadImages.js.map +1 -1
- package/dist/components/WhyThisAnswer/WhyThisAnswer.js +3 -1
- package/dist/components/WhyThisAnswer/WhyThisAnswer.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js +3 -1
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/website-assistant.css +21 -1
- package/dist/components/layouts/chat.css +2 -1
- package/dist/components/layouts/fullpage.css +31 -8
- package/dist/components/layouts/hidden-chat.css +1 -0
- package/dist/components/layouts/totem.css +2 -1
- package/dist/components/layouts/zoomed-full-body.css +32 -7
- package/dist/context/widgetSurfaceContext.d.ts +3 -0
- package/dist/context/widgetSurfaceContext.js +11 -0
- package/dist/context/widgetSurfaceContext.js.map +1 -0
- package/dist/helpers/constants.d.ts +3 -0
- package/dist/helpers/constants.js +27 -1
- package/dist/helpers/constants.js.map +1 -1
- package/dist/helpers/credits.d.ts +5 -2
- package/dist/helpers/credits.js +5 -1
- package/dist/helpers/credits.js.map +1 -1
- package/dist/helpers/message.d.ts +1 -1
- package/dist/helpers/message.js +4 -4
- package/dist/helpers/message.js.map +1 -1
- package/dist/helpers/nats/getNatsConfig.d.ts +9 -0
- package/dist/helpers/nats/getNatsConfig.js +65 -0
- package/dist/helpers/nats/getNatsConfig.js.map +1 -0
- package/dist/helpers/nats/isSessionExpiredError.d.ts +3 -0
- package/dist/helpers/nats/isSessionExpiredError.js +36 -0
- package/dist/helpers/nats/isSessionExpiredError.js.map +1 -0
- package/dist/helpers/nats/useNats.d.ts +12 -0
- package/dist/helpers/nats/useNats.js +75 -0
- package/dist/helpers/nats/useNats.js.map +1 -0
- package/dist/helpers/nats/useNatsSession.d.ts +28 -0
- package/dist/helpers/nats/useNatsSession.js +212 -0
- package/dist/helpers/nats/useNatsSession.js.map +1 -0
- package/dist/helpers/utils.d.ts +21 -0
- package/dist/helpers/utils.js +75 -4
- package/dist/helpers/utils.js.map +1 -1
- package/dist/locales/de.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +1 -0
- package/dist/locales/it.json +1 -0
- package/dist/styles.css +1 -1
- package/dist/types/integration.d.ts +3 -0
- package/dist/types/integration.js +16 -0
- package/dist/types/integration.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js +8 -3
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/esm/components/Auth/Auth.js +3 -1
- package/esm/components/Auth/Auth.js.map +1 -1
- package/esm/components/Avatar/Avatar.js +5 -10
- package/esm/components/Avatar/Avatar.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js +9 -2
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js +2 -2
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/constants.d.ts +2 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/constants.js +13 -4
- package/esm/components/Avatar/AvatarView/AvatarComponent/constants.js.map +1 -1
- package/esm/components/Chat/Chat.js +3 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.js +21 -15
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.js +3 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/esm/components/CompletionProviderStatus/CompletionProviderStatus.js +6 -3
- package/esm/components/CompletionProviderStatus/CompletionProviderStatus.js.map +1 -1
- package/esm/components/ContentPreviewModal/ContentPreviewModal.js +3 -1
- package/esm/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
- package/esm/components/DateSelector/DateSelector.d.ts +2 -1
- package/esm/components/DateSelector/DateSelector.js +17 -7
- package/esm/components/DateSelector/DateSelector.js.map +1 -1
- package/esm/components/ExpertsDrawer/ExpertsDrawer.js +3 -1
- package/esm/components/ExpertsDrawer/ExpertsDrawer.js.map +1 -1
- package/esm/components/FilePreview/FilePreview.js +24 -7
- package/esm/components/FilePreview/FilePreview.js.map +1 -1
- package/esm/components/KnownFacts/KnownFacts.js +5 -3
- package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
- package/esm/components/LoginDrawer/LoginDrawer.js +3 -1
- package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/esm/components/MediaWidget/MediaItemWidget.js +16 -14
- package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/esm/components/MediaWidget/MediaItemWidget.utils.d.ts +3 -2
- package/esm/components/MediaWidget/MediaItemWidget.utils.js +27 -6
- package/esm/components/MediaWidget/MediaItemWidget.utils.js.map +1 -1
- package/esm/components/MediaWidget/MediaPreviewModal.js +6 -7
- package/esm/components/MediaWidget/MediaPreviewModal.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +19 -5
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +4 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.css +4 -2
- package/esm/components/MemoriWidget/MemoriWidget.js +760 -404
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/SettingsDrawer/SettingsDrawer.js +3 -1
- package/esm/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.js +3 -1
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/UploadButton/UploadButton.js +21 -5
- package/esm/components/UploadButton/UploadButton.js.map +1 -1
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js +126 -60
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/esm/components/UploadButton/UploadImages/UploadImages.js +3 -1
- package/esm/components/UploadButton/UploadImages/UploadImages.js.map +1 -1
- package/esm/components/WhyThisAnswer/WhyThisAnswer.js +3 -1
- package/esm/components/WhyThisAnswer/WhyThisAnswer.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js +3 -1
- package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/website-assistant.css +21 -1
- package/esm/components/layouts/chat.css +2 -1
- package/esm/components/layouts/fullpage.css +31 -8
- package/esm/components/layouts/hidden-chat.css +1 -0
- package/esm/components/layouts/totem.css +2 -1
- package/esm/components/layouts/zoomed-full-body.css +32 -7
- package/esm/context/widgetSurfaceContext.d.ts +3 -0
- package/esm/context/widgetSurfaceContext.js +7 -0
- package/esm/context/widgetSurfaceContext.js.map +1 -0
- package/esm/helpers/constants.d.ts +3 -0
- package/esm/helpers/constants.js +26 -0
- package/esm/helpers/constants.js.map +1 -1
- package/esm/helpers/credits.d.ts +5 -2
- package/esm/helpers/credits.js +5 -1
- package/esm/helpers/credits.js.map +1 -1
- package/esm/helpers/message.d.ts +1 -1
- package/esm/helpers/message.js +2 -2
- package/esm/helpers/message.js.map +1 -1
- package/esm/helpers/nats/getNatsConfig.d.ts +9 -0
- package/esm/helpers/nats/getNatsConfig.js +61 -0
- package/esm/helpers/nats/getNatsConfig.js.map +1 -0
- package/esm/helpers/nats/isSessionExpiredError.d.ts +3 -0
- package/esm/helpers/nats/isSessionExpiredError.js +32 -0
- package/esm/helpers/nats/isSessionExpiredError.js.map +1 -0
- package/esm/helpers/nats/useNats.d.ts +12 -0
- package/esm/helpers/nats/useNats.js +72 -0
- package/esm/helpers/nats/useNats.js.map +1 -0
- package/esm/helpers/nats/useNatsSession.d.ts +28 -0
- package/esm/helpers/nats/useNatsSession.js +208 -0
- package/esm/helpers/nats/useNatsSession.js.map +1 -0
- package/esm/helpers/utils.d.ts +21 -0
- package/esm/helpers/utils.js +68 -3
- package/esm/helpers/utils.js.map +1 -1
- package/esm/locales/de.json +1 -0
- package/esm/locales/en.json +1 -0
- package/esm/locales/es.json +1 -0
- package/esm/locales/fr.json +1 -0
- package/esm/locales/it.json +1 -0
- package/esm/styles.css +1 -1
- package/esm/types/integration.d.ts +3 -0
- package/esm/types/integration.js +11 -0
- package/esm/types/integration.js.map +1 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +5 -3
- package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +9 -1
- package/src/components/Auth/Auth.tsx +3 -0
- package/src/components/Avatar/Avatar.stories.tsx +45 -28
- package/src/components/Avatar/Avatar.test.tsx +54 -0
- package/src/components/Avatar/Avatar.tsx +8 -12
- package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.tsx +12 -5
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.ts +2 -1
- package/src/components/Avatar/AvatarView/AvatarComponent/constants.ts +16 -4
- package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +164 -0
- package/src/components/Chat/Chat.tsx +3 -0
- package/src/components/ChatBubble/ChatBubble.tsx +40 -12
- package/src/components/ChatHistoryDrawer/ChatHistory.tsx +3 -0
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx +8 -4
- package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +3 -0
- package/src/components/DateSelector/DateSelector.stories.tsx +11 -2
- package/src/components/DateSelector/DateSelector.tsx +28 -9
- package/src/components/ExpertsDrawer/ExpertsDrawer.tsx +3 -0
- package/src/components/FilePreview/FilePreview.tsx +28 -7
- package/src/components/KnownFacts/KnownFacts.tsx +5 -0
- package/src/components/LoginDrawer/LoginDrawer.tsx +3 -0
- package/src/components/MediaWidget/MediaItemWidget.tsx +26 -13
- package/src/components/MediaWidget/MediaItemWidget.utils.test.ts +45 -2
- package/src/components/MediaWidget/MediaItemWidget.utils.ts +39 -6
- package/src/components/MediaWidget/MediaPreviewModal.tsx +9 -7
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +19 -5
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +4 -0
- package/src/components/MemoriWidget/MemoriWidget.css +4 -2
- package/src/components/MemoriWidget/MemoriWidget.tsx +818 -349
- package/src/components/SettingsDrawer/SettingsDrawer.tsx +3 -0
- package/src/components/StartPanel/StartPanel.stories.tsx +22 -0
- package/src/components/StartPanel/StartPanel.test.tsx +64 -1
- package/src/components/StartPanel/StartPanel.tsx +3 -0
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +261 -0
- package/src/components/UploadButton/UploadButton.tsx +30 -11
- package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +151 -61
- package/src/components/UploadButton/UploadImages/UploadImages.tsx +3 -0
- package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +2 -2
- package/src/components/WhyThisAnswer/WhyThisAnswer.tsx +3 -0
- package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.tsx +4 -0
- package/src/components/layouts/WebsiteAssistant/__snapshots__/WebsiteAssistant.test.tsx.snap +48 -44
- package/src/components/layouts/WebsiteAssistant/website-assistant.css +21 -1
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +533 -529
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +1058 -1050
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +443 -439
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +584 -580
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +528 -524
- package/src/components/layouts/chat.css +2 -1
- package/src/components/layouts/fullpage.css +31 -8
- package/src/components/layouts/hidden-chat.css +1 -0
- package/src/components/layouts/layouts.stories.tsx +131 -12
- package/src/components/layouts/totem.css +2 -1
- package/src/components/layouts/zoomed-full-body.css +32 -7
- package/src/context/widgetSurfaceContext.tsx +14 -0
- package/src/helpers/constants.ts +32 -1
- package/src/helpers/credits.ts +16 -1
- package/src/helpers/message.test.ts +28 -1
- package/src/helpers/message.ts +4 -4
- package/src/helpers/nats/getNatsConfig.ts +145 -0
- package/src/helpers/nats/isSessionExpiredError.test.ts +38 -0
- package/src/helpers/nats/isSessionExpiredError.ts +51 -0
- package/src/helpers/nats/useNats.ts +124 -0
- package/src/helpers/nats/useNatsSession.ts +394 -0
- package/src/helpers/utils.test.ts +162 -0
- package/src/helpers/utils.ts +108 -3
- package/src/index.stories.tsx +32 -0
- package/src/locales/de.json +1 -0
- package/src/locales/en.json +1 -0
- package/src/locales/es.json +1 -0
- package/src/locales/fr.json +1 -0
- package/src/locales/it.json +1 -0
- package/src/styles.css +61 -1
- package/src/types/integration.test.ts +32 -0
- package/src/types/integration.ts +31 -0
- 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.
|
|
1
|
+
export declare const version = "9.0.0-alpha.7";
|
package/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '9.0.0-alpha.
|
|
1
|
+
export const version = '9.0.0-alpha.7';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "9.0.0-alpha.
|
|
2
|
+
"version": "9.0.0-alpha.7",
|
|
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.
|
|
304
|
+
"@memori.ai/memori-api-client": "6.24.1",
|
|
305
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.
|
|
311
|
+
"dompurify": "^3.4.12",
|
|
310
312
|
"ellipsed": "1.6.0",
|
|
311
313
|
"i18next": "22.0.6",
|
|
312
314
|
"katex": "^0.16.11",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useTranslation } from 'react-i18next';
|
|
2
|
+
import { useWidgetSurfaceEl } from '../../context/widgetSurfaceContext';
|
|
2
3
|
import {
|
|
3
4
|
Button,
|
|
4
5
|
FieldGroup,
|
|
@@ -18,6 +19,7 @@ export interface Props {
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
|
|
22
|
+
const surfaceEl = useWidgetSurfaceEl();
|
|
21
23
|
const { t } = useTranslation();
|
|
22
24
|
const { add } = useAlertManager();
|
|
23
25
|
const [birthDate, setBirthDate] = useState<DateTime>();
|
|
@@ -66,8 +68,13 @@ const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
|
|
|
66
68
|
setSubmitting(false);
|
|
67
69
|
}, [add, birthDate, minAge, onClose, t]);
|
|
68
70
|
|
|
71
|
+
const handleDateChange = useCallback((date: DateTime | undefined) => {
|
|
72
|
+
setBirthDate(date);
|
|
73
|
+
}, []);
|
|
74
|
+
|
|
69
75
|
return (
|
|
70
76
|
<Modal
|
|
77
|
+
container={surfaceEl ?? undefined}
|
|
71
78
|
open={visible}
|
|
72
79
|
width="600px"
|
|
73
80
|
widthMd="600px"
|
|
@@ -93,8 +100,9 @@ const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
|
|
|
93
100
|
required
|
|
94
101
|
>
|
|
95
102
|
<DateSelector
|
|
103
|
+
minAge={minAge}
|
|
96
104
|
onChange={date => {
|
|
97
|
-
|
|
105
|
+
handleDateChange(date);
|
|
98
106
|
setError(undefined);
|
|
99
107
|
}}
|
|
100
108
|
/>
|
|
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
3
3
|
import { Button, Input, Modal, Form } from '@memori.ai/ui';
|
|
4
4
|
import { useForm, SubmitHandler } from 'react-hook-form';
|
|
5
5
|
import { Plus } from 'lucide-react';
|
|
6
|
+
import { useWidgetSurfaceEl } from '../../context/widgetSurfaceContext';
|
|
6
7
|
|
|
7
8
|
export interface Props {
|
|
8
9
|
pwdOrTokens: null | 'password' | 'tokens';
|
|
@@ -32,6 +33,7 @@ export const AuthWidget = ({
|
|
|
32
33
|
openModal = false,
|
|
33
34
|
withModal = false,
|
|
34
35
|
}: Props) => {
|
|
36
|
+
const surfaceEl = useWidgetSurfaceEl();
|
|
35
37
|
const { t } = useTranslation();
|
|
36
38
|
const {
|
|
37
39
|
register,
|
|
@@ -198,6 +200,7 @@ export const AuthWidget = ({
|
|
|
198
200
|
|
|
199
201
|
return withModal ? (
|
|
200
202
|
<Modal
|
|
203
|
+
container={surfaceEl ?? undefined}
|
|
201
204
|
open={openModal || showModal}
|
|
202
205
|
title={t('auth.title') || 'Authentication'}
|
|
203
206
|
closable={true}
|
|
@@ -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
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
(
|
|
92
|
-
integrationConfig?.avatar
|
|
93
|
-
integrationConfig?.
|
|
94
|
-
|
|
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
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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 *
|
|
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
|
-
'
|
|
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
|
-
'
|
|
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
|
-
'
|
|
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
|
-
'
|
|
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
|
|
@@ -30,6 +30,7 @@ import { boardOfExpertsLoadingSentences } from '../../helpers/constants';
|
|
|
30
30
|
import { FileText as DocumentIcon } from 'lucide-react';
|
|
31
31
|
import { useTranslation } from 'react-i18next';
|
|
32
32
|
import { Tooltip, Modal } from '@memori.ai/ui';
|
|
33
|
+
import { useWidgetSurfaceEl } from '../../context/widgetSurfaceContext';
|
|
33
34
|
import {
|
|
34
35
|
maxDocumentsPerMessage,
|
|
35
36
|
maxDocumentContentLength,
|
|
@@ -186,6 +187,7 @@ const Chat: React.FC<Props> = ({
|
|
|
186
187
|
useState<UsageBadgeModalState | null>(null);
|
|
187
188
|
const chatWrapperRef = useRef<HTMLDivElement>(null);
|
|
188
189
|
const { t } = useTranslation();
|
|
190
|
+
const surfaceEl = useWidgetSurfaceEl();
|
|
189
191
|
const locale = (translateTo || memori.culture || 'it-IT').replace('_', '-');
|
|
190
192
|
|
|
191
193
|
const llmUsageLabels = useMemo<LlmUsageLabels>(
|
|
@@ -625,6 +627,7 @@ const Chat: React.FC<Props> = ({
|
|
|
625
627
|
)}
|
|
626
628
|
|
|
627
629
|
<Modal
|
|
630
|
+
container={surfaceEl ?? undefined}
|
|
628
631
|
open={!!activeUsageBadge}
|
|
629
632
|
onClose={() => setActiveUsageBadge(null)}
|
|
630
633
|
title={
|