@memori.ai/memori-react 7.28.1 → 7.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/dist/components/AccountForm/AccountForm.d.ts +1 -0
- package/dist/components/AgeVerificationModal/AgeVerificationModal.d.ts +1 -0
- package/dist/components/AttachmentLinkModal/AttachmentLinkModal.d.ts +1 -0
- package/dist/components/Auth/Auth.d.ts +1 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.d.ts +1 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.d.ts +1 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/AnimationController.d.ts +38 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/AnimationController.js +181 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/AnimationController.js.map +1 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.d.ts +1 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/loader.d.ts +1 -0
- package/dist/components/Blob/Blob.d.ts +1 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.d.ts +1 -0
- package/dist/components/Chat/Chat.d.ts +1 -0
- package/dist/components/Chat/Chat.js +5 -3
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/VirtualizedContent/VirtualizedContent.d.ts +7 -0
- package/dist/components/ChatBubble/VirtualizedContent/VirtualizedContent.js +69 -0
- package/dist/components/ChatBubble/VirtualizedContent/VirtualizedContent.js.map +1 -0
- package/dist/components/ChatHistoryDrawer/ChatHistory.css +321 -0
- package/dist/components/ChatHistoryDrawer/ChatHistory.d.ts +15 -0
- package/dist/components/ChatHistoryDrawer/ChatHistory.js +109 -0
- package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -0
- package/dist/components/CompletionProviderStatus/CompletionProviderStatus.d.ts +1 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.d.ts +1 -0
- package/dist/components/ExpertsDrawer/ExpertsDrawer.d.ts +1 -0
- package/dist/components/FeedbackButtons/FeedbackButtons.d.ts +1 -0
- package/dist/components/FilePreview/FilePreview.d.ts +1 -0
- package/dist/components/Header/Header.d.ts +2 -0
- package/dist/components/Header/Header.js +3 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/KnownFacts/KnownFacts.d.ts +1 -0
- package/dist/components/LoginDrawer/LoginDrawer.d.ts +1 -0
- package/dist/components/MemoriWidget/MemoriWidget.d.ts +2 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +173 -21
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MicrophoneButton/MicrophoneButton.d.ts +1 -0
- package/dist/components/PositionDrawer/PositionDrawer.d.ts +1 -0
- package/dist/components/PoweredBy/PoweredBy.d.ts +1 -0
- package/dist/components/SettingsDrawer/SettingsDrawer.d.ts +1 -0
- package/dist/components/SignupForm/SignupForm.d.ts +1 -0
- package/dist/components/Snippet/Snippet.d.ts +1 -0
- package/dist/components/StartPanel/StartPanel.css +20 -21
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/Typing/Typing.d.ts +1 -0
- package/dist/components/VenueWidget/VenueWidget.css +7 -0
- package/dist/components/VenueWidget/VenueWidget.d.ts +1 -0
- package/dist/components/VenueWidget/VenueWidget.js +1 -1
- package/dist/components/VenueWidget/VenueWidget.js.map +1 -1
- package/dist/components/WhyThisAnswer/WhyThisAnswer.d.ts +1 -0
- package/dist/components/icons/AI.d.ts +1 -0
- package/dist/components/icons/Alert.d.ts +1 -0
- package/dist/components/icons/Bug.d.ts +1 -0
- package/dist/components/icons/Chat.d.ts +6 -0
- package/dist/components/icons/Chat.js +6 -0
- package/dist/components/icons/Chat.js.map +1 -0
- package/dist/components/icons/ChevronLeft.d.ts +1 -0
- package/dist/components/icons/ChevronRight.d.ts +1 -0
- package/dist/components/icons/Clear.d.ts +1 -0
- package/dist/components/icons/Close.d.ts +1 -0
- package/dist/components/icons/Code.d.ts +1 -0
- package/dist/components/icons/Copy.d.ts +1 -0
- package/dist/components/icons/DeepThought.d.ts +1 -0
- package/dist/components/icons/Delete.d.ts +1 -0
- package/dist/components/icons/Download.d.ts +1 -0
- package/dist/components/icons/Edit.d.ts +1 -0
- package/dist/components/icons/Expand.d.ts +1 -0
- package/dist/components/icons/Eye.d.ts +1 -0
- package/dist/components/icons/EyeInvisible.d.ts +1 -0
- package/dist/components/icons/Facebook.d.ts +1 -0
- package/dist/components/icons/Feedback.d.ts +1 -0
- package/dist/components/icons/File.d.ts +1 -0
- package/dist/components/icons/FileExcel.d.ts +1 -0
- package/dist/components/icons/FilePdf.d.ts +1 -0
- package/dist/components/icons/FileWord.d.ts +1 -0
- package/dist/components/icons/Fullscreen.d.ts +1 -0
- package/dist/components/icons/FullscreenExit.d.ts +1 -0
- package/dist/components/icons/Group.d.ts +1 -0
- package/dist/components/icons/History.d.ts +7 -0
- package/dist/components/icons/History.js +6 -0
- package/dist/components/icons/History.js.map +1 -0
- package/dist/components/icons/Info.d.ts +1 -0
- package/dist/components/icons/Link.d.ts +1 -0
- package/dist/components/icons/Linkedin.d.ts +1 -0
- package/dist/components/icons/Loading.d.ts +1 -0
- package/dist/components/icons/Mail.d.ts +1 -0
- package/dist/components/icons/MapMarker.d.ts +1 -0
- package/dist/components/icons/Message.d.ts +1 -0
- package/dist/components/icons/Microphone.d.ts +1 -0
- package/dist/components/icons/Minus.d.ts +1 -0
- package/dist/components/icons/MinusCircle.d.ts +1 -0
- package/dist/components/icons/PaperClip.d.ts +1 -0
- package/dist/components/icons/Picture.d.ts +1 -0
- package/dist/components/icons/Plus.d.ts +1 -0
- package/dist/components/icons/QuestionHelp.d.ts +1 -0
- package/dist/components/icons/Refresh.d.ts +1 -0
- package/dist/components/icons/SelectIcon.d.ts +1 -0
- package/dist/components/icons/Send.d.ts +1 -0
- package/dist/components/icons/Setting.d.ts +1 -0
- package/dist/components/icons/Share.d.ts +1 -0
- package/dist/components/icons/Sound.d.ts +1 -0
- package/dist/components/icons/SoundDeactivated.d.ts +1 -0
- package/dist/components/icons/Telegram.d.ts +1 -0
- package/dist/components/icons/ThumbDown.d.ts +1 -0
- package/dist/components/icons/ThumbUp.d.ts +1 -0
- package/dist/components/icons/Translation.d.ts +1 -0
- package/dist/components/icons/Twitter.d.ts +1 -0
- package/dist/components/icons/User.d.ts +1 -0
- package/dist/components/icons/Warning.d.ts +1 -0
- package/dist/components/icons/WhatsApp.d.ts +1 -0
- package/dist/components/ui/Card.css +4 -0
- package/dist/components/ui/Card.js +3 -2
- package/dist/components/ui/Card.js.map +1 -1
- package/dist/components/ui/Select.d.ts +1 -0
- package/dist/helpers/message.js +1 -4
- package/dist/helpers/message.js.map +1 -1
- package/dist/helpers/utils.d.ts +1 -0
- package/dist/helpers/utils.js +18 -1
- package/dist/helpers/utils.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/locales/de.json +11 -1
- package/dist/locales/en.json +11 -1
- package/dist/locales/es.json +11 -1
- package/dist/locales/fr.json +14 -2
- package/dist/locales/it.json +11 -1
- package/dist/styles.css +1 -0
- package/esm/components/AccountForm/AccountForm.d.ts +1 -0
- package/esm/components/AgeVerificationModal/AgeVerificationModal.d.ts +1 -0
- package/esm/components/AttachmentLinkModal/AttachmentLinkModal.d.ts +1 -0
- package/esm/components/Auth/Auth.d.ts +1 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.d.ts +1 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.d.ts +1 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/AnimationController.d.ts +38 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/AnimationController.js +177 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/AnimationController.js.map +1 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.d.ts +1 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/loader.d.ts +1 -0
- package/esm/components/Blob/Blob.d.ts +1 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.d.ts +1 -0
- package/esm/components/Chat/Chat.d.ts +1 -0
- package/esm/components/Chat/Chat.js +5 -3
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/VirtualizedContent/VirtualizedContent.d.ts +7 -0
- package/esm/components/ChatBubble/VirtualizedContent/VirtualizedContent.js +67 -0
- package/esm/components/ChatBubble/VirtualizedContent/VirtualizedContent.js.map +1 -0
- package/esm/components/ChatHistoryDrawer/ChatHistory.css +321 -0
- package/esm/components/ChatHistoryDrawer/ChatHistory.d.ts +15 -0
- package/esm/components/ChatHistoryDrawer/ChatHistory.js +106 -0
- package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -0
- package/esm/components/CompletionProviderStatus/CompletionProviderStatus.d.ts +1 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.d.ts +1 -0
- package/esm/components/ExpertsDrawer/ExpertsDrawer.d.ts +1 -0
- package/esm/components/FeedbackButtons/FeedbackButtons.d.ts +1 -0
- package/esm/components/FilePreview/FilePreview.d.ts +1 -0
- package/esm/components/Header/Header.d.ts +2 -0
- package/esm/components/Header/Header.js +3 -2
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/KnownFacts/KnownFacts.d.ts +1 -0
- package/esm/components/LoginDrawer/LoginDrawer.d.ts +1 -0
- package/esm/components/MemoriWidget/MemoriWidget.d.ts +2 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +173 -21
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MicrophoneButton/MicrophoneButton.d.ts +1 -0
- package/esm/components/PositionDrawer/PositionDrawer.d.ts +1 -0
- package/esm/components/PoweredBy/PoweredBy.d.ts +1 -0
- package/esm/components/SettingsDrawer/SettingsDrawer.d.ts +1 -0
- package/esm/components/SignupForm/SignupForm.d.ts +1 -0
- package/esm/components/Snippet/Snippet.d.ts +1 -0
- package/esm/components/StartPanel/StartPanel.css +20 -21
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/Typing/Typing.d.ts +1 -0
- package/esm/components/VenueWidget/VenueWidget.css +7 -0
- package/esm/components/VenueWidget/VenueWidget.d.ts +1 -0
- package/esm/components/VenueWidget/VenueWidget.js +1 -1
- package/esm/components/VenueWidget/VenueWidget.js.map +1 -1
- package/esm/components/WhyThisAnswer/WhyThisAnswer.d.ts +1 -0
- package/esm/components/icons/AI.d.ts +1 -0
- package/esm/components/icons/Alert.d.ts +1 -0
- package/esm/components/icons/Bug.d.ts +1 -0
- package/esm/components/icons/Chat.d.ts +6 -0
- package/esm/components/icons/Chat.js +4 -0
- package/esm/components/icons/Chat.js.map +1 -0
- package/esm/components/icons/ChevronLeft.d.ts +1 -0
- package/esm/components/icons/ChevronRight.d.ts +1 -0
- package/esm/components/icons/Clear.d.ts +1 -0
- package/esm/components/icons/Close.d.ts +1 -0
- package/esm/components/icons/Code.d.ts +1 -0
- package/esm/components/icons/Copy.d.ts +1 -0
- package/esm/components/icons/DeepThought.d.ts +1 -0
- package/esm/components/icons/Delete.d.ts +1 -0
- package/esm/components/icons/Download.d.ts +1 -0
- package/esm/components/icons/Edit.d.ts +1 -0
- package/esm/components/icons/Expand.d.ts +1 -0
- package/esm/components/icons/Eye.d.ts +1 -0
- package/esm/components/icons/EyeInvisible.d.ts +1 -0
- package/esm/components/icons/Facebook.d.ts +1 -0
- package/esm/components/icons/Feedback.d.ts +1 -0
- package/esm/components/icons/File.d.ts +1 -0
- package/esm/components/icons/FileExcel.d.ts +1 -0
- package/esm/components/icons/FilePdf.d.ts +1 -0
- package/esm/components/icons/FileWord.d.ts +1 -0
- package/esm/components/icons/Fullscreen.d.ts +1 -0
- package/esm/components/icons/FullscreenExit.d.ts +1 -0
- package/esm/components/icons/Group.d.ts +1 -0
- package/esm/components/icons/History.d.ts +7 -0
- package/esm/components/icons/History.js +4 -0
- package/esm/components/icons/History.js.map +1 -0
- package/esm/components/icons/Info.d.ts +1 -0
- package/esm/components/icons/Link.d.ts +1 -0
- package/esm/components/icons/Linkedin.d.ts +1 -0
- package/esm/components/icons/Loading.d.ts +1 -0
- package/esm/components/icons/Mail.d.ts +1 -0
- package/esm/components/icons/MapMarker.d.ts +1 -0
- package/esm/components/icons/Message.d.ts +1 -0
- package/esm/components/icons/Microphone.d.ts +1 -0
- package/esm/components/icons/Minus.d.ts +1 -0
- package/esm/components/icons/MinusCircle.d.ts +1 -0
- package/esm/components/icons/PaperClip.d.ts +1 -0
- package/esm/components/icons/Picture.d.ts +1 -0
- package/esm/components/icons/Plus.d.ts +1 -0
- package/esm/components/icons/QuestionHelp.d.ts +1 -0
- package/esm/components/icons/Refresh.d.ts +1 -0
- package/esm/components/icons/SelectIcon.d.ts +1 -0
- package/esm/components/icons/Send.d.ts +1 -0
- package/esm/components/icons/Setting.d.ts +1 -0
- package/esm/components/icons/Share.d.ts +1 -0
- package/esm/components/icons/Sound.d.ts +1 -0
- package/esm/components/icons/SoundDeactivated.d.ts +1 -0
- package/esm/components/icons/Telegram.d.ts +1 -0
- package/esm/components/icons/ThumbDown.d.ts +1 -0
- package/esm/components/icons/ThumbUp.d.ts +1 -0
- package/esm/components/icons/Translation.d.ts +1 -0
- package/esm/components/icons/Twitter.d.ts +1 -0
- package/esm/components/icons/User.d.ts +1 -0
- package/esm/components/icons/Warning.d.ts +1 -0
- package/esm/components/icons/WhatsApp.d.ts +1 -0
- package/esm/components/ui/Card.css +4 -0
- package/esm/components/ui/Card.js +3 -2
- package/esm/components/ui/Card.js.map +1 -1
- package/esm/components/ui/Select.d.ts +1 -0
- package/esm/helpers/message.js +1 -4
- package/esm/helpers/message.js.map +1 -1
- package/esm/helpers/utils.d.ts +1 -0
- package/esm/helpers/utils.js +16 -0
- package/esm/helpers/utils.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/locales/de.json +11 -1
- package/esm/locales/en.json +11 -1
- package/esm/locales/es.json +11 -1
- package/esm/locales/fr.json +14 -2
- package/esm/locales/it.json +11 -1
- package/esm/styles.css +1 -0
- package/package.json +1 -1
- package/src/components/Chat/Chat.tsx +5 -2
- package/src/components/ChatHistoryDrawer/ChatHistory.css +321 -0
- package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +290 -0
- package/src/components/ChatHistoryDrawer/ChatHistory.test.tsx +91 -0
- package/src/components/ChatHistoryDrawer/ChatHistory.tsx +369 -0
- package/src/components/ChatHistoryDrawer/__snapshots__/ChatHistory.test.tsx.snap +27 -0
- package/src/components/Header/Header.test.tsx +16 -1
- package/src/components/Header/Header.tsx +18 -0
- package/src/components/Header/__snapshots__/Header.test.tsx.snap +140 -0
- package/src/components/MemoriWidget/MemoriWidget.tsx +249 -16
- package/src/components/StartPanel/StartPanel.css +20 -21
- package/src/components/StartPanel/StartPanel.tsx +1 -0
- package/src/components/VenueWidget/VenueWidget.css +7 -0
- package/src/components/VenueWidget/VenueWidget.tsx +4 -4
- package/src/components/icons/Chat.tsx +30 -0
- package/src/components/icons/History.tsx +33 -0
- package/src/components/ui/Card.css +4 -0
- package/src/components/ui/Card.tsx +2 -1
- package/src/helpers/message.ts +0 -2
- package/src/helpers/utils.ts +23 -0
- package/src/index.stories.tsx +36 -9
- package/src/index.tsx +3 -0
- package/src/locales/de.json +11 -1
- package/src/locales/en.json +11 -1
- package/src/locales/es.json +11 -1
- package/src/locales/fr.json +14 -2
- package/src/locales/it.json +11 -1
- package/src/styles.css +1 -0
|
@@ -5,6 +5,34 @@ exports[`renders Header for board of experts unchanged 1`] = `
|
|
|
5
5
|
<div
|
|
6
6
|
class="memori-header"
|
|
7
7
|
>
|
|
8
|
+
<button
|
|
9
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--chat-history"
|
|
10
|
+
title="chatHistory"
|
|
11
|
+
>
|
|
12
|
+
<span
|
|
13
|
+
class="memori-button--icon"
|
|
14
|
+
>
|
|
15
|
+
<svg
|
|
16
|
+
fill="none"
|
|
17
|
+
height="800"
|
|
18
|
+
viewBox="0 0 24 24"
|
|
19
|
+
width="800"
|
|
20
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
21
|
+
>
|
|
22
|
+
<path
|
|
23
|
+
d="M12 8v4l2.5 2.5"
|
|
24
|
+
stroke="#ffff"
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round"
|
|
27
|
+
stroke-width="2"
|
|
28
|
+
/>
|
|
29
|
+
<path
|
|
30
|
+
d="m5.604 5.604-.53-.53.53.53ZM4.338 6.871l-.75.003a.75.75 0 0 0 .746.747l.004-.75Zm2.542.762a.75.75 0 1 0 .007-1.5l-.007 1.5ZM5.075 4.321a.75.75 0 0 0-1.5.008l1.5-.008ZM3.75 12a.75.75 0 0 0-1.5 0h1.5Zm13.125 8.445a.75.75 0 1 0-.75-1.298l.75 1.298Zm2.272-4.32a.75.75 0 1 0 1.298.75l-1.298-.75ZM5.14 5.07a.75.75 0 1 0 1.056 1.066L5.14 5.071Zm13.722.067c-3.82-3.82-9.993-3.859-13.788-.064l1.06 1.06c3.2-3.199 8.423-3.18 11.668.065l1.06-1.061ZM5.074 5.074 3.808 6.34l1.06 1.06 1.267-1.265-1.061-1.061Zm-.74 2.547 2.546.012.007-1.5-2.545-.012-.008 1.5Zm.754-.754L5.075 4.32l-1.5.008.013 2.545 1.5-.007ZM12 3.75A8.25 8.25 0 0 1 20.25 12h1.5c0-5.385-4.365-9.75-9.75-9.75v1.5Zm0 16.5A8.25 8.25 0 0 1 3.75 12h-1.5c0 5.385 4.365 9.75 9.75 9.75v-1.5Zm4.125-1.103A8.209 8.209 0 0 1 12 20.25v1.5c1.775 0 3.44-.475 4.875-1.305l-.75-1.298ZM20.25 12a8.209 8.209 0 0 1-1.103 4.125l1.298.75A9.708 9.708 0 0 0 21.75 12h-1.5ZM6.196 6.137A8.221 8.221 0 0 1 12 3.75v-1.5a9.721 9.721 0 0 0-6.86 2.821l1.056 1.066Z"
|
|
31
|
+
fill="#ffff"
|
|
32
|
+
/>
|
|
33
|
+
</svg>
|
|
34
|
+
</span>
|
|
35
|
+
</button>
|
|
8
36
|
<button
|
|
9
37
|
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--experts"
|
|
10
38
|
disabled=""
|
|
@@ -111,6 +139,34 @@ exports[`renders Header for board of experts with session open unchanged 1`] = `
|
|
|
111
139
|
<div
|
|
112
140
|
class="memori-header"
|
|
113
141
|
>
|
|
142
|
+
<button
|
|
143
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--chat-history"
|
|
144
|
+
title="chatHistory"
|
|
145
|
+
>
|
|
146
|
+
<span
|
|
147
|
+
class="memori-button--icon"
|
|
148
|
+
>
|
|
149
|
+
<svg
|
|
150
|
+
fill="none"
|
|
151
|
+
height="800"
|
|
152
|
+
viewBox="0 0 24 24"
|
|
153
|
+
width="800"
|
|
154
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
155
|
+
>
|
|
156
|
+
<path
|
|
157
|
+
d="M12 8v4l2.5 2.5"
|
|
158
|
+
stroke="#ffff"
|
|
159
|
+
stroke-linecap="round"
|
|
160
|
+
stroke-linejoin="round"
|
|
161
|
+
stroke-width="2"
|
|
162
|
+
/>
|
|
163
|
+
<path
|
|
164
|
+
d="m5.604 5.604-.53-.53.53.53ZM4.338 6.871l-.75.003a.75.75 0 0 0 .746.747l.004-.75Zm2.542.762a.75.75 0 1 0 .007-1.5l-.007 1.5ZM5.075 4.321a.75.75 0 0 0-1.5.008l1.5-.008ZM3.75 12a.75.75 0 0 0-1.5 0h1.5Zm13.125 8.445a.75.75 0 1 0-.75-1.298l.75 1.298Zm2.272-4.32a.75.75 0 1 0 1.298.75l-1.298-.75ZM5.14 5.07a.75.75 0 1 0 1.056 1.066L5.14 5.071Zm13.722.067c-3.82-3.82-9.993-3.859-13.788-.064l1.06 1.06c3.2-3.199 8.423-3.18 11.668.065l1.06-1.061ZM5.074 5.074 3.808 6.34l1.06 1.06 1.267-1.265-1.061-1.061Zm-.74 2.547 2.546.012.007-1.5-2.545-.012-.008 1.5Zm.754-.754L5.075 4.32l-1.5.008.013 2.545 1.5-.007ZM12 3.75A8.25 8.25 0 0 1 20.25 12h1.5c0-5.385-4.365-9.75-9.75-9.75v1.5Zm0 16.5A8.25 8.25 0 0 1 3.75 12h-1.5c0 5.385 4.365 9.75 9.75 9.75v-1.5Zm4.125-1.103A8.209 8.209 0 0 1 12 20.25v1.5c1.775 0 3.44-.475 4.875-1.305l-.75-1.298ZM20.25 12a8.209 8.209 0 0 1-1.103 4.125l1.298.75A9.708 9.708 0 0 0 21.75 12h-1.5ZM6.196 6.137A8.221 8.221 0 0 1 12 3.75v-1.5a9.721 9.721 0 0 0-6.86 2.821l1.056 1.066Z"
|
|
165
|
+
fill="#ffff"
|
|
166
|
+
/>
|
|
167
|
+
</svg>
|
|
168
|
+
</span>
|
|
169
|
+
</button>
|
|
114
170
|
<button
|
|
115
171
|
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--experts"
|
|
116
172
|
title="widget.showExpertsInTheBoard"
|
|
@@ -450,6 +506,34 @@ exports[`renders Header with deep thought and session open unchanged 1`] = `
|
|
|
450
506
|
<div
|
|
451
507
|
class="memori-header"
|
|
452
508
|
>
|
|
509
|
+
<button
|
|
510
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--chat-history"
|
|
511
|
+
title="chatHistory"
|
|
512
|
+
>
|
|
513
|
+
<span
|
|
514
|
+
class="memori-button--icon"
|
|
515
|
+
>
|
|
516
|
+
<svg
|
|
517
|
+
fill="none"
|
|
518
|
+
height="800"
|
|
519
|
+
viewBox="0 0 24 24"
|
|
520
|
+
width="800"
|
|
521
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
522
|
+
>
|
|
523
|
+
<path
|
|
524
|
+
d="M12 8v4l2.5 2.5"
|
|
525
|
+
stroke="#ffff"
|
|
526
|
+
stroke-linecap="round"
|
|
527
|
+
stroke-linejoin="round"
|
|
528
|
+
stroke-width="2"
|
|
529
|
+
/>
|
|
530
|
+
<path
|
|
531
|
+
d="m5.604 5.604-.53-.53.53.53ZM4.338 6.871l-.75.003a.75.75 0 0 0 .746.747l.004-.75Zm2.542.762a.75.75 0 1 0 .007-1.5l-.007 1.5ZM5.075 4.321a.75.75 0 0 0-1.5.008l1.5-.008ZM3.75 12a.75.75 0 0 0-1.5 0h1.5Zm13.125 8.445a.75.75 0 1 0-.75-1.298l.75 1.298Zm2.272-4.32a.75.75 0 1 0 1.298.75l-1.298-.75ZM5.14 5.07a.75.75 0 1 0 1.056 1.066L5.14 5.071Zm13.722.067c-3.82-3.82-9.993-3.859-13.788-.064l1.06 1.06c3.2-3.199 8.423-3.18 11.668.065l1.06-1.061ZM5.074 5.074 3.808 6.34l1.06 1.06 1.267-1.265-1.061-1.061Zm-.74 2.547 2.546.012.007-1.5-2.545-.012-.008 1.5Zm.754-.754L5.075 4.32l-1.5.008.013 2.545 1.5-.007ZM12 3.75A8.25 8.25 0 0 1 20.25 12h1.5c0-5.385-4.365-9.75-9.75-9.75v1.5Zm0 16.5A8.25 8.25 0 0 1 3.75 12h-1.5c0 5.385 4.365 9.75 9.75 9.75v-1.5Zm4.125-1.103A8.209 8.209 0 0 1 12 20.25v1.5c1.775 0 3.44-.475 4.875-1.305l-.75-1.298ZM20.25 12a8.209 8.209 0 0 1-1.103 4.125l1.298.75A9.708 9.708 0 0 0 21.75 12h-1.5ZM6.196 6.137A8.221 8.221 0 0 1 12 3.75v-1.5a9.721 9.721 0 0 0-6.86 2.821l1.056 1.066Z"
|
|
532
|
+
fill="#ffff"
|
|
533
|
+
/>
|
|
534
|
+
</svg>
|
|
535
|
+
</span>
|
|
536
|
+
</button>
|
|
453
537
|
<button
|
|
454
538
|
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--speaker"
|
|
455
539
|
title="widget.sound"
|
|
@@ -528,6 +612,34 @@ exports[`renders Header with deep thought logged but without permission flag unc
|
|
|
528
612
|
<div
|
|
529
613
|
class="memori-header"
|
|
530
614
|
>
|
|
615
|
+
<button
|
|
616
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--chat-history"
|
|
617
|
+
title="chatHistory"
|
|
618
|
+
>
|
|
619
|
+
<span
|
|
620
|
+
class="memori-button--icon"
|
|
621
|
+
>
|
|
622
|
+
<svg
|
|
623
|
+
fill="none"
|
|
624
|
+
height="800"
|
|
625
|
+
viewBox="0 0 24 24"
|
|
626
|
+
width="800"
|
|
627
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
628
|
+
>
|
|
629
|
+
<path
|
|
630
|
+
d="M12 8v4l2.5 2.5"
|
|
631
|
+
stroke="#ffff"
|
|
632
|
+
stroke-linecap="round"
|
|
633
|
+
stroke-linejoin="round"
|
|
634
|
+
stroke-width="2"
|
|
635
|
+
/>
|
|
636
|
+
<path
|
|
637
|
+
d="m5.604 5.604-.53-.53.53.53ZM4.338 6.871l-.75.003a.75.75 0 0 0 .746.747l.004-.75Zm2.542.762a.75.75 0 1 0 .007-1.5l-.007 1.5ZM5.075 4.321a.75.75 0 0 0-1.5.008l1.5-.008ZM3.75 12a.75.75 0 0 0-1.5 0h1.5Zm13.125 8.445a.75.75 0 1 0-.75-1.298l.75 1.298Zm2.272-4.32a.75.75 0 1 0 1.298.75l-1.298-.75ZM5.14 5.07a.75.75 0 1 0 1.056 1.066L5.14 5.071Zm13.722.067c-3.82-3.82-9.993-3.859-13.788-.064l1.06 1.06c3.2-3.199 8.423-3.18 11.668.065l1.06-1.061ZM5.074 5.074 3.808 6.34l1.06 1.06 1.267-1.265-1.061-1.061Zm-.74 2.547 2.546.012.007-1.5-2.545-.012-.008 1.5Zm.754-.754L5.075 4.32l-1.5.008.013 2.545 1.5-.007ZM12 3.75A8.25 8.25 0 0 1 20.25 12h1.5c0-5.385-4.365-9.75-9.75-9.75v1.5Zm0 16.5A8.25 8.25 0 0 1 3.75 12h-1.5c0 5.385 4.365 9.75 9.75 9.75v-1.5Zm4.125-1.103A8.209 8.209 0 0 1 12 20.25v1.5c1.775 0 3.44-.475 4.875-1.305l-.75-1.298ZM20.25 12a8.209 8.209 0 0 1-1.103 4.125l1.298.75A9.708 9.708 0 0 0 21.75 12h-1.5ZM6.196 6.137A8.221 8.221 0 0 1 12 3.75v-1.5a9.721 9.721 0 0 0-6.86 2.821l1.056 1.066Z"
|
|
638
|
+
fill="#ffff"
|
|
639
|
+
/>
|
|
640
|
+
</svg>
|
|
641
|
+
</span>
|
|
642
|
+
</button>
|
|
531
643
|
<button
|
|
532
644
|
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--speaker"
|
|
533
645
|
title="widget.sound"
|
|
@@ -606,6 +718,34 @@ exports[`renders Header with deep thought logged with permission flag unchanged
|
|
|
606
718
|
<div
|
|
607
719
|
class="memori-header"
|
|
608
720
|
>
|
|
721
|
+
<button
|
|
722
|
+
class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--chat-history"
|
|
723
|
+
title="chatHistory"
|
|
724
|
+
>
|
|
725
|
+
<span
|
|
726
|
+
class="memori-button--icon"
|
|
727
|
+
>
|
|
728
|
+
<svg
|
|
729
|
+
fill="none"
|
|
730
|
+
height="800"
|
|
731
|
+
viewBox="0 0 24 24"
|
|
732
|
+
width="800"
|
|
733
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
734
|
+
>
|
|
735
|
+
<path
|
|
736
|
+
d="M12 8v4l2.5 2.5"
|
|
737
|
+
stroke="#ffff"
|
|
738
|
+
stroke-linecap="round"
|
|
739
|
+
stroke-linejoin="round"
|
|
740
|
+
stroke-width="2"
|
|
741
|
+
/>
|
|
742
|
+
<path
|
|
743
|
+
d="m5.604 5.604-.53-.53.53.53ZM4.338 6.871l-.75.003a.75.75 0 0 0 .746.747l.004-.75Zm2.542.762a.75.75 0 1 0 .007-1.5l-.007 1.5ZM5.075 4.321a.75.75 0 0 0-1.5.008l1.5-.008ZM3.75 12a.75.75 0 0 0-1.5 0h1.5Zm13.125 8.445a.75.75 0 1 0-.75-1.298l.75 1.298Zm2.272-4.32a.75.75 0 1 0 1.298.75l-1.298-.75ZM5.14 5.07a.75.75 0 1 0 1.056 1.066L5.14 5.071Zm13.722.067c-3.82-3.82-9.993-3.859-13.788-.064l1.06 1.06c3.2-3.199 8.423-3.18 11.668.065l1.06-1.061ZM5.074 5.074 3.808 6.34l1.06 1.06 1.267-1.265-1.061-1.061Zm-.74 2.547 2.546.012.007-1.5-2.545-.012-.008 1.5Zm.754-.754L5.075 4.32l-1.5.008.013 2.545 1.5-.007ZM12 3.75A8.25 8.25 0 0 1 20.25 12h1.5c0-5.385-4.365-9.75-9.75-9.75v1.5Zm0 16.5A8.25 8.25 0 0 1 3.75 12h-1.5c0 5.385 4.365 9.75 9.75 9.75v-1.5Zm4.125-1.103A8.209 8.209 0 0 1 12 20.25v1.5c1.775 0 3.44-.475 4.875-1.305l-.75-1.298ZM20.25 12a8.209 8.209 0 0 1-1.103 4.125l1.298.75A9.708 9.708 0 0 0 21.75 12h-1.5ZM6.196 6.137A8.221 8.221 0 0 1 12 3.75v-1.5a9.721 9.721 0 0 0-6.86 2.821l1.056 1.066Z"
|
|
744
|
+
fill="#ffff"
|
|
745
|
+
/>
|
|
746
|
+
</svg>
|
|
747
|
+
</span>
|
|
748
|
+
</button>
|
|
609
749
|
<button
|
|
610
750
|
class="memori-button memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button--knownfacts"
|
|
611
751
|
disabled=""
|
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
User,
|
|
15
15
|
ExpertReference,
|
|
16
16
|
ResponseSpec,
|
|
17
|
+
ChatLog,
|
|
18
|
+
ChatLogLine,
|
|
17
19
|
} from '@memori.ai/memori-api-client/src/types';
|
|
18
20
|
import {
|
|
19
21
|
SpeakerAudioDestination,
|
|
@@ -87,6 +89,7 @@ import {
|
|
|
87
89
|
import { getErrori18nKey } from '../../helpers/error';
|
|
88
90
|
import { getCredits } from '../../helpers/credits';
|
|
89
91
|
import { useViseme } from '../../context/visemeContext';
|
|
92
|
+
import ChatHistoryDrawer from '../ChatHistoryDrawer/ChatHistory';
|
|
90
93
|
|
|
91
94
|
// Widget utilities and helpers
|
|
92
95
|
const getMemoriState = (integrationId?: string): object | null => {
|
|
@@ -384,6 +387,7 @@ export interface Props {
|
|
|
384
387
|
showTypingText?: boolean;
|
|
385
388
|
showLogin?: boolean;
|
|
386
389
|
showUpload?: boolean;
|
|
390
|
+
showChatHistory?: boolean;
|
|
387
391
|
preview?: boolean;
|
|
388
392
|
embed?: boolean;
|
|
389
393
|
height?: number | string;
|
|
@@ -442,11 +446,12 @@ const MemoriWidget = ({
|
|
|
442
446
|
showLogin = false,
|
|
443
447
|
showUpload,
|
|
444
448
|
showOnlyLastMessages,
|
|
449
|
+
showChatHistory,
|
|
445
450
|
height = '100vh',
|
|
446
451
|
secret,
|
|
447
452
|
baseUrl = 'https://aisuru.com',
|
|
448
|
-
apiURL = 'https://backend.memori.ai',
|
|
449
|
-
engineURL = 'https://engine.memori.ai',
|
|
453
|
+
apiURL = 'https://backend-staging.memori.ai',
|
|
454
|
+
engineURL = 'https://engine-staging.memori.ai',
|
|
450
455
|
initialContextVars,
|
|
451
456
|
initialQuestion,
|
|
452
457
|
ogImage,
|
|
@@ -584,6 +589,7 @@ const MemoriWidget = ({
|
|
|
584
589
|
useState(false);
|
|
585
590
|
const [showPositionDrawer, setShowPositionDrawer] = useState(false);
|
|
586
591
|
const [showSettingsDrawer, setShowSettingsDrawer] = useState(false);
|
|
592
|
+
const [showChatHistoryDrawer, setShowChatHistoryDrawer] = useState(false);
|
|
587
593
|
const [showKnownFactsDrawer, setShowKnownFactsDrawer] = useState(false);
|
|
588
594
|
const [showExpertsDrawer, setShowExpertsDrawer] = useState(false);
|
|
589
595
|
const [muteSpeaker, setMuteSpeaker] = useState(
|
|
@@ -744,6 +750,9 @@ const MemoriWidget = ({
|
|
|
744
750
|
},
|
|
745
751
|
]);
|
|
746
752
|
};
|
|
753
|
+
|
|
754
|
+
// When a user resumes a chat, we need to set the chat reference link of the previous chat
|
|
755
|
+
const [chatLogID, setChatLogID] = useState<string | undefined>(undefined);
|
|
747
756
|
/**
|
|
748
757
|
* Sends a message to the Memori and handles the response
|
|
749
758
|
* @param text The text message to send
|
|
@@ -810,16 +819,31 @@ const MemoriWidget = ({
|
|
|
810
819
|
msg = translation.text;
|
|
811
820
|
}
|
|
812
821
|
|
|
813
|
-
const findMediaDocument = media?.find(
|
|
822
|
+
const findMediaDocument = media?.find(
|
|
823
|
+
m => !m.mediumID && m.properties?.isAttachedFile
|
|
824
|
+
);
|
|
814
825
|
if (findMediaDocument) {
|
|
815
826
|
msg = msg + ' ' + findMediaDocument.content;
|
|
816
827
|
}
|
|
817
828
|
|
|
829
|
+
// Add chat reference link to the message if it exists
|
|
830
|
+
if (chatLogID) {
|
|
831
|
+
msg =
|
|
832
|
+
msg +
|
|
833
|
+
' \n\n' +
|
|
834
|
+
'<chat-reference session-id="' +
|
|
835
|
+
sessionID +
|
|
836
|
+
'" event-log-id="' +
|
|
837
|
+
chatLogID +
|
|
838
|
+
'"></chat-reference>';
|
|
839
|
+
}
|
|
840
|
+
|
|
818
841
|
const { currentState, ...response } = await postTextEnteredEvent({
|
|
819
842
|
sessionId: sessionID,
|
|
820
843
|
text: msg,
|
|
821
844
|
});
|
|
822
845
|
if (response.resultCode === 0 && currentState) {
|
|
846
|
+
setChatLogID(undefined);
|
|
823
847
|
const emission =
|
|
824
848
|
useLoaderTextAsMsg && typingText
|
|
825
849
|
? typingText
|
|
@@ -1447,6 +1471,136 @@ const MemoriWidget = ({
|
|
|
1447
1471
|
return null;
|
|
1448
1472
|
};
|
|
1449
1473
|
|
|
1474
|
+
const [chatLogs, setChatLogs] = useState<any[]>([]);
|
|
1475
|
+
const resumeSession = async (
|
|
1476
|
+
chatLog: ChatLog,
|
|
1477
|
+
questionsAndAnswers: { question: string; answer: string }[],
|
|
1478
|
+
initialContextVars?: { [key: string]: string },
|
|
1479
|
+
initialQuestion?: string,
|
|
1480
|
+
birthDate?: string
|
|
1481
|
+
) => {
|
|
1482
|
+
// Set loading state while reopening session
|
|
1483
|
+
setLoading(true);
|
|
1484
|
+
|
|
1485
|
+
// Get birth date from local storage if not provided
|
|
1486
|
+
let storageBirthDate = getLocalConfig<string | undefined>(
|
|
1487
|
+
'birthDate',
|
|
1488
|
+
undefined
|
|
1489
|
+
);
|
|
1490
|
+
let userBirthDate = birthDate ?? storageBirthDate;
|
|
1491
|
+
// console.log('[REOPEN_SESSION] Using birth date:', userBirthDate);
|
|
1492
|
+
|
|
1493
|
+
try {
|
|
1494
|
+
// Show age verification if required and birth date not provided
|
|
1495
|
+
if (!userBirthDate && !!minAge) {
|
|
1496
|
+
// console.log('[REOPEN_SESSION] Age verification required, showing modal');
|
|
1497
|
+
setShowAgeVerification(true);
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
// Check if authentication is needed based on privacy type and credentials
|
|
1502
|
+
if (
|
|
1503
|
+
memori.privacyType !== 'PUBLIC' &&
|
|
1504
|
+
!memoriPassword &&
|
|
1505
|
+
!memori.secretToken &&
|
|
1506
|
+
!memoriPwd &&
|
|
1507
|
+
!memoriTokens
|
|
1508
|
+
) {
|
|
1509
|
+
// console.log('[REOPEN_SESSION] Authentication required, showing modal');
|
|
1510
|
+
setAuthModalState('password');
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
// Get current URL as referral
|
|
1515
|
+
let referral;
|
|
1516
|
+
try {
|
|
1517
|
+
referral = (() => {
|
|
1518
|
+
return window.location.href;
|
|
1519
|
+
})();
|
|
1520
|
+
console.log('[REOPEN_SESSION] Got referral:', referral);
|
|
1521
|
+
} catch (err) {
|
|
1522
|
+
console.debug('[REOPEN_SESSION] Error getting referral:', err);
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
// Initialize session with provided parameters
|
|
1526
|
+
// console.log('[REOPEN_SESSION] Initializing session...');
|
|
1527
|
+
const { sessionID, currentState, ...response } = await initSession({
|
|
1528
|
+
memoriID: memori.engineMemoriID ?? '',
|
|
1529
|
+
password: memoriPassword || memoriPwd || memori.secretToken,
|
|
1530
|
+
recoveryTokens: memoriTokens,
|
|
1531
|
+
tag: personification?.tag,
|
|
1532
|
+
pin: personification?.pin,
|
|
1533
|
+
continueFromChatLogID: chatLog.chatLogID,
|
|
1534
|
+
initialContextVars: {
|
|
1535
|
+
PATHNAME: window.location.pathname,
|
|
1536
|
+
ROUTE: window.location.pathname?.split('/')?.pop() || '',
|
|
1537
|
+
...(initialContextVars || {}),
|
|
1538
|
+
},
|
|
1539
|
+
initialQuestion,
|
|
1540
|
+
birthDate: userBirthDate,
|
|
1541
|
+
additionalInfo: {
|
|
1542
|
+
...(additionalInfo || {}),
|
|
1543
|
+
loginToken:
|
|
1544
|
+
userToken ?? loginToken ?? additionalInfo?.loginToken ?? authToken,
|
|
1545
|
+
language: getCultureCodeByLanguage(userLang),
|
|
1546
|
+
referral: referral,
|
|
1547
|
+
timeZoneOffset: new Date().getTimezoneOffset().toString(),
|
|
1548
|
+
},
|
|
1549
|
+
});
|
|
1550
|
+
|
|
1551
|
+
// Handle successful session initialization
|
|
1552
|
+
if (sessionID) {
|
|
1553
|
+
// console.log('[REOPEN_SESSION] Session initialized successfully:', sessionID);
|
|
1554
|
+
setSessionId(sessionID);
|
|
1555
|
+
|
|
1556
|
+
// console.log('[REOPEN_SESSION] Processing emission:', currentState.emission);
|
|
1557
|
+
// Set initial message or append to existing history
|
|
1558
|
+
setHistory(
|
|
1559
|
+
chatLog.lines.map(log => ({
|
|
1560
|
+
text: log.text,
|
|
1561
|
+
emitter: log.emitter,
|
|
1562
|
+
media: log.media?.map(m => ({
|
|
1563
|
+
...m,
|
|
1564
|
+
mediumID:
|
|
1565
|
+
'mediumID' in m ? String(m.mediumID) : crypto.randomUUID(),
|
|
1566
|
+
})),
|
|
1567
|
+
fromUser: log.inbound,
|
|
1568
|
+
initial: false,
|
|
1569
|
+
contextVars: log.contextVars,
|
|
1570
|
+
date: log.timestamp,
|
|
1571
|
+
}))
|
|
1572
|
+
);
|
|
1573
|
+
|
|
1574
|
+
setChatLogs(questionsAndAnswers);
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
// Handle age restriction error
|
|
1578
|
+
else if (
|
|
1579
|
+
response?.resultMessage.startsWith('This Memori is aged restricted')
|
|
1580
|
+
) {
|
|
1581
|
+
console.error('[REOPEN_SESSION] Age restriction error:', response);
|
|
1582
|
+
toast.error(t('underageTwinSession', { age: minAge }));
|
|
1583
|
+
setGotErrorInOpening(true);
|
|
1584
|
+
}
|
|
1585
|
+
// Handle authentication error
|
|
1586
|
+
else if (response?.resultCode === 403) {
|
|
1587
|
+
console.error('[REOPEN_SESSION] Authentication error');
|
|
1588
|
+
setMemoriPwd(undefined);
|
|
1589
|
+
setAuthModalState('password');
|
|
1590
|
+
}
|
|
1591
|
+
// Handle other errors
|
|
1592
|
+
else {
|
|
1593
|
+
console.error('[REOPEN_SESSION] Other error:', response);
|
|
1594
|
+
toast.error(t(getErrori18nKey(response.resultCode)));
|
|
1595
|
+
setGotErrorInOpening(true);
|
|
1596
|
+
}
|
|
1597
|
+
} catch (err) {
|
|
1598
|
+
console.error('[RESUME_SESSION] Caught error:', err);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
setLoading(false);
|
|
1602
|
+
};
|
|
1603
|
+
|
|
1450
1604
|
const changeTag = async (
|
|
1451
1605
|
memoriId: string,
|
|
1452
1606
|
sessionId: string,
|
|
@@ -2878,10 +3032,13 @@ const MemoriWidget = ({
|
|
|
2878
3032
|
const onClickStart = useCallback(
|
|
2879
3033
|
async (
|
|
2880
3034
|
session?: { dialogState: DialogState; sessionID: string },
|
|
2881
|
-
initialSessionExpired = false
|
|
3035
|
+
initialSessionExpired = false,
|
|
3036
|
+
chatLog?: ChatLog
|
|
2882
3037
|
) => {
|
|
2883
|
-
const sessionID = session?.sessionID || sessionId;
|
|
2884
|
-
const dialogState =
|
|
3038
|
+
const sessionID = chatLog ? undefined : session?.sessionID || sessionId;
|
|
3039
|
+
const dialogState = chatLog
|
|
3040
|
+
? undefined
|
|
3041
|
+
: session?.dialogState || currentDialogState;
|
|
2885
3042
|
setClickedStart(true);
|
|
2886
3043
|
|
|
2887
3044
|
let translatedMessages: Message[] = [];
|
|
@@ -2951,13 +3108,16 @@ const MemoriWidget = ({
|
|
|
2951
3108
|
password: secret || memoriPwd || memori.secretToken,
|
|
2952
3109
|
tag: personification?.tag,
|
|
2953
3110
|
pin: personification?.pin,
|
|
3111
|
+
continueFromChatLogID: chatLog?.chatLogID,
|
|
2954
3112
|
initialContextVars: {
|
|
2955
3113
|
PATHNAME: window.location.pathname?.toUpperCase(),
|
|
2956
3114
|
ROUTE:
|
|
2957
3115
|
window.location.pathname?.split('/')?.pop()?.toUpperCase() || '',
|
|
2958
|
-
...(
|
|
3116
|
+
...((!chatLog
|
|
3117
|
+
? initialContextVars
|
|
3118
|
+
: chatLog.lines[chatLog.lines.length - 1].contextVars) || {}),
|
|
2959
3119
|
},
|
|
2960
|
-
initialQuestion,
|
|
3120
|
+
initialQuestion: chatLog ? undefined : initialQuestion,
|
|
2961
3121
|
birthDate: birth,
|
|
2962
3122
|
additionalInfo: {
|
|
2963
3123
|
...(additionalInfo || {}),
|
|
@@ -2974,18 +3134,71 @@ const MemoriWidget = ({
|
|
|
2974
3134
|
if (session?.dialogState) {
|
|
2975
3135
|
// console.log('[CLICK_START] Got new session with dialog state');
|
|
2976
3136
|
// reset history
|
|
2977
|
-
|
|
3137
|
+
if (!chatLog) {
|
|
3138
|
+
setHistory([]);
|
|
2978
3139
|
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
3140
|
+
translateDialogState(session.dialogState, userLang)
|
|
3141
|
+
.then(ts => {
|
|
3142
|
+
let text = ts.translatedEmission || ts.emission;
|
|
3143
|
+
if (text) {
|
|
3144
|
+
speak(text);
|
|
3145
|
+
}
|
|
3146
|
+
})
|
|
3147
|
+
.finally(() => {
|
|
3148
|
+
setHasUserActivatedSpeak(true);
|
|
3149
|
+
});
|
|
3150
|
+
} else {
|
|
3151
|
+
const messages = chatLog.lines.map(
|
|
3152
|
+
(l, i) =>
|
|
3153
|
+
({
|
|
3154
|
+
text: l.text,
|
|
3155
|
+
media: l.media
|
|
3156
|
+
?.filter(m => allowedMediaTypes.includes(m.mimeType))
|
|
3157
|
+
?.map(m => ({
|
|
3158
|
+
mediumID: `${i}-${m.mimeType}`,
|
|
3159
|
+
...m,
|
|
3160
|
+
})),
|
|
3161
|
+
fromUser: l.inbound,
|
|
3162
|
+
timestamp: l.timestamp,
|
|
3163
|
+
emitter: l.emitter,
|
|
3164
|
+
initial: i === 0,
|
|
3165
|
+
} as Message)
|
|
3166
|
+
);
|
|
3167
|
+
|
|
3168
|
+
// we dont remove the last one as it is the current state
|
|
3169
|
+
translatedMessages = messages ?? [];
|
|
3170
|
+
if (
|
|
3171
|
+
language.toUpperCase() !== userLang.toUpperCase() &&
|
|
3172
|
+
isMultilanguageEnabled
|
|
3173
|
+
) {
|
|
3174
|
+
try {
|
|
3175
|
+
console.debug('[CLICK_START] Translating messages');
|
|
3176
|
+
translatedMessages = await Promise.all(
|
|
3177
|
+
messages.map(async m => ({
|
|
3178
|
+
...m,
|
|
3179
|
+
originalText: m.text,
|
|
3180
|
+
text: (
|
|
3181
|
+
await getTranslation(m.text, userLang, language, baseUrl)
|
|
3182
|
+
).text,
|
|
3183
|
+
}))
|
|
3184
|
+
);
|
|
3185
|
+
// console.log('[CLICK_START] Translated messages:', translatedMessages);
|
|
3186
|
+
} catch (e) {
|
|
3187
|
+
// console.log('[CLICK_START] Error translating messages:', e);
|
|
2984
3188
|
}
|
|
2985
|
-
}
|
|
2986
|
-
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
setHistory(translatedMessages);
|
|
3192
|
+
|
|
3193
|
+
translateDialogState(
|
|
3194
|
+
session.dialogState,
|
|
3195
|
+
userLang,
|
|
3196
|
+
undefined,
|
|
3197
|
+
true
|
|
3198
|
+
).finally(() => {
|
|
2987
3199
|
setHasUserActivatedSpeak(true);
|
|
2988
3200
|
});
|
|
3201
|
+
}
|
|
2989
3202
|
} else if (session?.resultCode === 0) {
|
|
2990
3203
|
// console.log('[CLICK_START] Retrying with session:', session);
|
|
2991
3204
|
await onClickStart((session as any) || undefined);
|
|
@@ -3439,7 +3652,10 @@ const MemoriWidget = ({
|
|
|
3439
3652
|
source.connect(audioContext.destination);
|
|
3440
3653
|
}
|
|
3441
3654
|
},
|
|
3655
|
+
setShowChatHistoryDrawer,
|
|
3442
3656
|
showSettings: showSettings ?? integrationConfig?.showSettings ?? true,
|
|
3657
|
+
showChatHistory:
|
|
3658
|
+
showChatHistory ?? integrationConfig?.showChatHistory ?? true,
|
|
3443
3659
|
hasUserActivatedSpeak,
|
|
3444
3660
|
showReload: selectedLayout === 'TOTEM',
|
|
3445
3661
|
showClear,
|
|
@@ -3773,6 +3989,23 @@ const MemoriWidget = ({
|
|
|
3773
3989
|
/>
|
|
3774
3990
|
)}
|
|
3775
3991
|
|
|
3992
|
+
{showChatHistoryDrawer && (
|
|
3993
|
+
<ChatHistoryDrawer
|
|
3994
|
+
open={!!showChatHistoryDrawer}
|
|
3995
|
+
onClose={() => setShowChatHistoryDrawer(false)}
|
|
3996
|
+
resumeSession={chatLog => {
|
|
3997
|
+
setChatLogID(chatLog.chatLogID);
|
|
3998
|
+
onClickStart(undefined, false, chatLog);
|
|
3999
|
+
setShowChatHistoryDrawer(false);
|
|
4000
|
+
}}
|
|
4001
|
+
apiClient={client}
|
|
4002
|
+
sessionId={sessionId || ''}
|
|
4003
|
+
memori={memori}
|
|
4004
|
+
baseUrl={baseUrl}
|
|
4005
|
+
apiUrl={client.constants.BACKEND_URL}
|
|
4006
|
+
/>
|
|
4007
|
+
)}
|
|
4008
|
+
|
|
3776
4009
|
{showPositionDrawer && (
|
|
3777
4010
|
<PositionDrawer
|
|
3778
4011
|
memori={memori}
|
|
@@ -96,6 +96,26 @@
|
|
|
96
96
|
display: block;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
.memori--start-privacy-explanation {
|
|
100
|
+
color: var(--memori-text-color, rgba(0, 0, 0, 0.85));
|
|
101
|
+
font-size: 0.85em;
|
|
102
|
+
font-style: italic;
|
|
103
|
+
opacity: 0.85;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.memori--start-privacy-explanation-container {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: flex-start;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.memori--start-privacy-explanation-icon {
|
|
113
|
+
width: 1.2rem;
|
|
114
|
+
height: 1.2rem;
|
|
115
|
+
align-self: center;
|
|
116
|
+
margin-left: 0.5rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
99
119
|
.memori--translation-toggle {
|
|
100
120
|
height: auto;
|
|
101
121
|
padding-right: 0;
|
|
@@ -220,27 +240,6 @@
|
|
|
220
240
|
text-decoration: underline;
|
|
221
241
|
}
|
|
222
242
|
|
|
223
|
-
.memori--start-privacy-explanation-container {
|
|
224
|
-
display: flex;
|
|
225
|
-
align-items: center;
|
|
226
|
-
justify-content: flex-start;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.memori--start-privacy-explanation {
|
|
230
|
-
color: var(--memori-text-color, rgba(0, 0, 0, 0.85));
|
|
231
|
-
font-size: 0.85em;
|
|
232
|
-
font-style: italic;
|
|
233
|
-
opacity: 0.85;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.memori--start-privacy-explanation-icon {
|
|
237
|
-
display: flex;
|
|
238
|
-
width: 1.2rem;
|
|
239
|
-
height: 1.2rem;
|
|
240
|
-
align-self: center;
|
|
241
|
-
margin-left: 0.5rem;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
243
|
.memori--privacy-tooltip-content {
|
|
245
244
|
text-align: left;
|
|
246
245
|
}
|
|
@@ -80,6 +80,7 @@ const StartPanel: React.FC<Props> = ({
|
|
|
80
80
|
const [translatedDescription, setTranslatedDescription] = useState(
|
|
81
81
|
memori.description
|
|
82
82
|
);
|
|
83
|
+
|
|
83
84
|
const [showTranslation, setShowTranslation] = useState(true);
|
|
84
85
|
const toggleTranslations = () => {
|
|
85
86
|
setShowTranslation(show => !show);
|
|
@@ -139,6 +139,13 @@ li.memori--venue-widget-search--option--active {
|
|
|
139
139
|
background-color: #f7fafc;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
.memori--venue-widget-search--option-centered {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
text-align: center;
|
|
147
|
+
}
|
|
148
|
+
|
|
142
149
|
.memori--venue--widget__place-name {
|
|
143
150
|
margin: 0 0 1rem;
|
|
144
151
|
}
|
|
@@ -292,14 +292,14 @@ const VenueWidget = ({
|
|
|
292
292
|
<Combobox.Options className="memori--venue-widget-search--options">
|
|
293
293
|
{fetching ? (
|
|
294
294
|
<Spin spinning>
|
|
295
|
-
<
|
|
295
|
+
<div className="memori--venue-widget-search--option memori--venue-widget-search--option-centered">
|
|
296
296
|
{t('loading')}...
|
|
297
|
-
</
|
|
297
|
+
</div>
|
|
298
298
|
</Spin>
|
|
299
299
|
) : suggestions.length === 0 && query !== '' ? (
|
|
300
|
-
<
|
|
300
|
+
<div className="memori--venue-widget-search--option memori--venue-widget-search--option-centered">
|
|
301
301
|
{t('nothingFound')}
|
|
302
|
-
</
|
|
302
|
+
</div>
|
|
303
303
|
) : (
|
|
304
304
|
suggestions?.map(s => (
|
|
305
305
|
<Combobox.Option
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const ChatRound = ({
|
|
4
|
+
className,
|
|
5
|
+
title,
|
|
6
|
+
}: {
|
|
7
|
+
className?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
}) => (
|
|
10
|
+
<svg
|
|
11
|
+
{...(!title ? { 'aria-hidden': 'true' } : {})}
|
|
12
|
+
focusable="false"
|
|
13
|
+
width="24"
|
|
14
|
+
height="24"
|
|
15
|
+
role="img"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
className={className}
|
|
20
|
+
aria-label={title}
|
|
21
|
+
>
|
|
22
|
+
<path
|
|
23
|
+
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 13.5997 2.37562 15.1116 3.04346 16.4525C3.22094 16.8088 3.28001 17.2161 3.17712 17.6006L2.58151 19.8267C2.32295 20.793 3.20701 21.677 4.17335 21.4185L6.39939 20.8229C6.78393 20.72 7.19121 20.7791 7.54753 20.9565C8.88837 21.6244 10.4003 22 12 22Z"
|
|
24
|
+
stroke="currentColor"
|
|
25
|
+
stroke-width="1.5"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export default ChatRound;
|