@memori.ai/memori-react 8.8.5 → 8.9.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 +38 -0
- package/README.md +28 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js +0 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js +0 -10
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.js +0 -9
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.js.map +1 -1
- package/dist/components/Chat/Chat.css +31 -0
- package/dist/components/Chat/Chat.js +18 -4
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.js +1 -2
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.css +23 -0
- package/dist/components/ChatInputs/ChatInputs.d.ts +1 -0
- package/dist/components/ChatInputs/ChatInputs.js +37 -21
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
- package/dist/components/ChatTextArea/ChatTextArea.css +31 -0
- package/dist/components/ChatTextArea/ChatTextArea.d.ts +1 -0
- package/dist/components/ChatTextArea/ChatTextArea.js +9 -2
- package/dist/components/ChatTextArea/ChatTextArea.js.map +1 -1
- package/dist/components/FilePreview/FilePreview.css +39 -0
- package/dist/components/Header/Header.js +3 -16
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/MediaWidget/LinkItemWidget.js +1 -1
- package/dist/components/MediaWidget/LinkItemWidget.js.map +1 -1
- package/dist/components/MediaWidget/MediaItemWidget.js +5 -9
- package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +65 -51
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/utils/ArtifactAPI.d.ts +5 -0
- package/dist/components/MemoriArtifactSystem/utils/ArtifactAPI.js +287 -0
- package/dist/components/MemoriArtifactSystem/utils/ArtifactAPI.js.map +1 -0
- package/dist/components/MemoriWidget/MemoriWidget.d.ts +12 -0
- package/dist/components/MemoriWidget/MemoriWidget.js +12 -3
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/Snippet/Snippet.js +4 -3
- package/dist/components/Snippet/Snippet.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.css +14 -0
- package/dist/components/StartPanel/StartPanel.js +2 -2
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js +0 -21
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/dist/components/VenueWidget/VenueWidget.js +0 -1
- package/dist/components/VenueWidget/VenueWidget.js.map +1 -1
- package/dist/components/layouts/HiddenChat.js +0 -15
- package/dist/components/layouts/HiddenChat.js.map +1 -1
- package/dist/components/layouts/chat.css +2 -2
- package/dist/context/visemeContext.js +0 -6
- package/dist/context/visemeContext.js.map +1 -1
- package/dist/helpers/constants.d.ts +11 -0
- package/dist/helpers/constants.js +24 -2
- package/dist/helpers/constants.js.map +1 -1
- package/dist/helpers/tts/useTTS.js +0 -3
- package/dist/helpers/tts/useTTS.js.map +1 -1
- package/dist/helpers/utils.d.ts +1 -0
- package/dist/helpers/utils.js +6 -1
- package/dist/helpers/utils.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/locales/de.json +2 -0
- package/dist/locales/en.json +2 -0
- package/dist/locales/es.json +2 -0
- package/dist/locales/fr.json +2 -0
- package/dist/locales/it.json +2 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js +0 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js +0 -10
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.js +0 -9
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.js.map +1 -1
- package/esm/components/Chat/Chat.css +31 -0
- package/esm/components/Chat/Chat.js +19 -5
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.js +1 -2
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.css +23 -0
- package/esm/components/ChatInputs/ChatInputs.d.ts +1 -0
- package/esm/components/ChatInputs/ChatInputs.js +37 -21
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
- package/esm/components/ChatTextArea/ChatTextArea.css +31 -0
- package/esm/components/ChatTextArea/ChatTextArea.d.ts +1 -0
- package/esm/components/ChatTextArea/ChatTextArea.js +9 -2
- package/esm/components/ChatTextArea/ChatTextArea.js.map +1 -1
- package/esm/components/FilePreview/FilePreview.css +39 -0
- package/esm/components/Header/Header.js +3 -16
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/MediaWidget/LinkItemWidget.js +1 -1
- package/esm/components/MediaWidget/LinkItemWidget.js.map +1 -1
- package/esm/components/MediaWidget/MediaItemWidget.js +5 -9
- package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +65 -51
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/utils/ArtifactAPI.d.ts +5 -0
- package/esm/components/MemoriArtifactSystem/utils/ArtifactAPI.js +282 -0
- package/esm/components/MemoriArtifactSystem/utils/ArtifactAPI.js.map +1 -0
- package/esm/components/MemoriWidget/MemoriWidget.d.ts +12 -0
- package/esm/components/MemoriWidget/MemoriWidget.js +12 -3
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/Snippet/Snippet.js +4 -3
- package/esm/components/Snippet/Snippet.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.css +14 -0
- package/esm/components/StartPanel/StartPanel.js +3 -3
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js +0 -21
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/esm/components/VenueWidget/VenueWidget.js +0 -1
- package/esm/components/VenueWidget/VenueWidget.js.map +1 -1
- package/esm/components/layouts/HiddenChat.js +0 -15
- package/esm/components/layouts/HiddenChat.js.map +1 -1
- package/esm/components/layouts/chat.css +2 -2
- package/esm/context/visemeContext.js +0 -6
- package/esm/context/visemeContext.js.map +1 -1
- package/esm/helpers/constants.d.ts +11 -0
- package/esm/helpers/constants.js +22 -1
- package/esm/helpers/constants.js.map +1 -1
- package/esm/helpers/tts/useTTS.js +0 -3
- package/esm/helpers/tts/useTTS.js.map +1 -1
- package/esm/helpers/utils.d.ts +1 -0
- package/esm/helpers/utils.js +4 -0
- package/esm/helpers/utils.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/locales/de.json +2 -0
- package/esm/locales/en.json +2 -0
- package/esm/locales/es.json +2 -0
- package/esm/locales/fr.json +2 -0
- package/esm/locales/it.json +2 -0
- package/package.json +1 -1
- package/src/components/Avatar/AvatarView/AvatarComponent/avatarComponent.tsx +0 -1
- package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.tsx +0 -17
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.ts +0 -20
- package/src/components/Chat/Chat.css +31 -0
- package/src/components/Chat/Chat.stories.tsx +503 -9
- package/src/components/Chat/Chat.tsx +23 -3
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +73 -73
- package/src/components/ChatBubble/ChatBubble.tsx +1 -2
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +25 -25
- package/src/components/ChatInputs/ChatInputs.css +23 -0
- package/src/components/ChatInputs/ChatInputs.tsx +36 -14
- package/src/components/ChatTextArea/ChatTextArea.css +31 -0
- package/src/components/ChatTextArea/ChatTextArea.tsx +11 -1
- package/src/components/FilePreview/FilePreview.css +39 -0
- package/src/components/Header/Header.tsx +0 -13
- package/src/components/MediaWidget/LinkItemWidget.tsx +1 -1
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +33 -0
- package/src/components/MediaWidget/MediaItemWidget.tsx +7 -10
- package/src/components/MediaWidget/__snapshots__/LinkItemWidget.test.tsx.snap +4 -4
- package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +6 -6
- package/src/components/MediaWidget/__snapshots__/MediaWidget.test.tsx.snap +2 -2
- package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +766 -2
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +103 -89
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +307 -0
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.tsx +373 -0
- package/src/components/MemoriWidget/MemoriWidget.tsx +26 -4
- package/src/components/Snippet/Snippet.tsx +3 -2
- package/src/components/StartPanel/StartPanel.css +14 -0
- package/src/components/StartPanel/StartPanel.tsx +23 -10
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +206 -84
- package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +0 -23
- package/src/components/VenueWidget/VenueWidget.tsx +0 -1
- package/src/components/layouts/HiddenChat.tsx +0 -16
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +204 -82
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +408 -164
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +204 -82
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +204 -82
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +204 -82
- package/src/components/layouts/chat.css +2 -2
- package/src/context/visemeContext.tsx +0 -7
- package/src/helpers/constants.ts +28 -3
- package/src/helpers/tts/useTTS.ts +0 -2
- package/src/helpers/utils.ts +5 -0
- package/src/index.tsx +0 -1
- package/src/locales/de.json +2 -0
- package/src/locales/en.json +2 -0
- package/src/locales/es.json +2 -0
- package/src/locales/fr.json +2 -0
- package/src/locales/it.json +2 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`renders ChatBubble from user with avatar as react element unchanged 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
|
-
class="memori-chat--bubble-container memori-chat--bubble-from-user"
|
|
6
|
+
class="memori-chat--bubble-container memori-chat-scroll-item memori-chat--bubble-from-user"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
class="memori-chat--bubble memori-chat--user-bubble transition ease-in-out duration-300 opacity-0 scale-09 translate-x-30"
|
|
@@ -40,7 +40,7 @@ exports[`renders ChatBubble from user with avatar as react element unchanged 1`]
|
|
|
40
40
|
exports[`renders ChatBubble from user with avatar unchanged 1`] = `
|
|
41
41
|
<div>
|
|
42
42
|
<div
|
|
43
|
-
class="memori-chat--bubble-container memori-chat--bubble-from-user"
|
|
43
|
+
class="memori-chat--bubble-container memori-chat-scroll-item memori-chat--bubble-from-user"
|
|
44
44
|
>
|
|
45
45
|
<div
|
|
46
46
|
class="memori-chat--bubble memori-chat--user-bubble transition ease-in-out duration-300 opacity-0 scale-09 translate-x-30"
|
|
@@ -79,7 +79,7 @@ exports[`renders ChatBubble from user with avatar unchanged 1`] = `
|
|
|
79
79
|
exports[`renders ChatBubble from user with custom avatar unchanged 1`] = `
|
|
80
80
|
<div>
|
|
81
81
|
<div
|
|
82
|
-
class="memori-chat--bubble-container memori-chat--bubble-from-user"
|
|
82
|
+
class="memori-chat--bubble-container memori-chat-scroll-item memori-chat--bubble-from-user"
|
|
83
83
|
>
|
|
84
84
|
<div
|
|
85
85
|
class="memori-chat--bubble memori-chat--user-bubble transition ease-in-out duration-300 opacity-0 scale-09 translate-x-30"
|
|
@@ -118,7 +118,7 @@ exports[`renders ChatBubble from user with custom avatar unchanged 1`] = `
|
|
|
118
118
|
exports[`renders ChatBubble unchanged 1`] = `
|
|
119
119
|
<div>
|
|
120
120
|
<div
|
|
121
|
-
class="memori-chat--bubble-container"
|
|
121
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
122
122
|
>
|
|
123
123
|
<picture
|
|
124
124
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -186,7 +186,7 @@ exports[`renders ChatBubble unchanged 1`] = `
|
|
|
186
186
|
exports[`renders ChatBubble with complex markdown and math 1 unchanged 1`] = `
|
|
187
187
|
<div>
|
|
188
188
|
<div
|
|
189
|
-
class="memori-chat--bubble-container"
|
|
189
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
190
190
|
>
|
|
191
191
|
<picture
|
|
192
192
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -2773,7 +2773,7 @@ M834 80h400000v40h-400000z"
|
|
|
2773
2773
|
exports[`renders ChatBubble with complex markdown and math 2 unchanged 1`] = `
|
|
2774
2774
|
<div>
|
|
2775
2775
|
<div
|
|
2776
|
-
class="memori-chat--bubble-container"
|
|
2776
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
2777
2777
|
>
|
|
2778
2778
|
<picture
|
|
2779
2779
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -4024,7 +4024,7 @@ Gli esiti delle prove devono essere attentamente analizzati per confermare le ca
|
|
|
4024
4024
|
exports[`renders ChatBubble with complex markdown and math 3 unchanged 1`] = `
|
|
4025
4025
|
<div>
|
|
4026
4026
|
<div
|
|
4027
|
-
class="memori-chat--bubble-container"
|
|
4027
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
4028
4028
|
>
|
|
4029
4029
|
<picture
|
|
4030
4030
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -5009,7 +5009,7 @@ exports[`renders ChatBubble with complex markdown and math 3 unchanged 1`] = `
|
|
|
5009
5009
|
exports[`renders ChatBubble with complex markdown and math 4 unchanged 1`] = `
|
|
5010
5010
|
<div>
|
|
5011
5011
|
<div
|
|
5012
|
-
class="memori-chat--bubble-container"
|
|
5012
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
5013
5013
|
>
|
|
5014
5014
|
<picture
|
|
5015
5015
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -5533,7 +5533,7 @@ exports[`renders ChatBubble with complex markdown and math 4 unchanged 1`] = `
|
|
|
5533
5533
|
exports[`renders ChatBubble with complex markdown and math 5 unchanged 1`] = `
|
|
5534
5534
|
<div>
|
|
5535
5535
|
<div
|
|
5536
|
-
class="memori-chat--bubble-container"
|
|
5536
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
5537
5537
|
>
|
|
5538
5538
|
<picture
|
|
5539
5539
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -6319,7 +6319,7 @@ exports[`renders ChatBubble with complex markdown and math 5 unchanged 1`] = `
|
|
|
6319
6319
|
exports[`renders ChatBubble with complex markdown and math but disabled unchanged 1`] = `
|
|
6320
6320
|
<div>
|
|
6321
6321
|
<div
|
|
6322
|
-
class="memori-chat--bubble-container"
|
|
6322
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
6323
6323
|
>
|
|
6324
6324
|
<picture
|
|
6325
6325
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -6583,7 +6583,7 @@ Prendi la radice quadrata della somma per trovare l'ipotenusa: $ c = \\sqrt{a^2
|
|
|
6583
6583
|
exports[`renders ChatBubble with copy disabled unchanged 1`] = `
|
|
6584
6584
|
<div>
|
|
6585
6585
|
<div
|
|
6586
|
-
class="memori-chat--bubble-container"
|
|
6586
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
6587
6587
|
>
|
|
6588
6588
|
<picture
|
|
6589
6589
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -6614,7 +6614,7 @@ exports[`renders ChatBubble with copy disabled unchanged 1`] = `
|
|
|
6614
6614
|
exports[`renders ChatBubble with debug button unchanged 1`] = `
|
|
6615
6615
|
<div>
|
|
6616
6616
|
<div
|
|
6617
|
-
class="memori-chat--bubble-container memori-chat--with-addon"
|
|
6617
|
+
class="memori-chat--bubble-container memori-chat-scroll-item memori-chat--with-addon"
|
|
6618
6618
|
>
|
|
6619
6619
|
<picture
|
|
6620
6620
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -6812,7 +6812,7 @@ exports[`renders ChatBubble with initial msg unchanged 1`] = `
|
|
|
6812
6812
|
class="memori-chat--bubble-initial"
|
|
6813
6813
|
/>
|
|
6814
6814
|
<div
|
|
6815
|
-
class="memori-chat--bubble-container"
|
|
6815
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
6816
6816
|
>
|
|
6817
6817
|
<picture
|
|
6818
6818
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -6880,7 +6880,7 @@ exports[`renders ChatBubble with initial msg unchanged 1`] = `
|
|
|
6880
6880
|
exports[`renders ChatBubble with markdown and breakline unchanged 1`] = `
|
|
6881
6881
|
<div>
|
|
6882
6882
|
<div
|
|
6883
|
-
class="memori-chat--bubble-container"
|
|
6883
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
6884
6884
|
>
|
|
6885
6885
|
<picture
|
|
6886
6886
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -7019,7 +7019,7 @@ exports[`renders ChatBubble with markdown and breakline unchanged 1`] = `
|
|
|
7019
7019
|
exports[`renders ChatBubble with markdown code unchanged 1`] = `
|
|
7020
7020
|
<div>
|
|
7021
7021
|
<div
|
|
7022
|
-
class="memori-chat--bubble-container"
|
|
7022
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
7023
7023
|
>
|
|
7024
7024
|
<picture
|
|
7025
7025
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -7132,7 +7132,7 @@ exports[`renders ChatBubble with markdown code unchanged 1`] = `
|
|
|
7132
7132
|
exports[`renders ChatBubble with markdown table unchanged 1`] = `
|
|
7133
7133
|
<div>
|
|
7134
7134
|
<div
|
|
7135
|
-
class="memori-chat--bubble-container"
|
|
7135
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
7136
7136
|
>
|
|
7137
7137
|
<picture
|
|
7138
7138
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -7303,7 +7303,7 @@ exports[`renders ChatBubble with markdown table unchanged 1`] = `
|
|
|
7303
7303
|
exports[`renders ChatBubble with markdown unchanged 1`] = `
|
|
7304
7304
|
<div>
|
|
7305
7305
|
<div
|
|
7306
|
-
class="memori-chat--bubble-container"
|
|
7306
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
7307
7307
|
>
|
|
7308
7308
|
<picture
|
|
7309
7309
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -7637,7 +7637,7 @@ exports[`renders ChatBubble with markdown unchanged 1`] = `
|
|
|
7637
7637
|
exports[`renders ChatBubble with msg from BoE expert unchanged 1`] = `
|
|
7638
7638
|
<div>
|
|
7639
7639
|
<div
|
|
7640
|
-
class="memori-chat--bubble-container memori-chat--bubble-from-user memori-chat--with-addon"
|
|
7640
|
+
class="memori-chat--bubble-container memori-chat-scroll-item memori-chat--bubble-from-user memori-chat--with-addon"
|
|
7641
7641
|
>
|
|
7642
7642
|
<div
|
|
7643
7643
|
class="memori-chat--bubble memori-chat--user-bubble memori-chat--with-addon memori-chat--ai-generated transition ease-in-out duration-300 opacity-0 scale-09 translate-x-30"
|
|
@@ -7731,7 +7731,7 @@ exports[`renders ChatBubble with msg from BoE expert unchanged 1`] = `
|
|
|
7731
7731
|
exports[`renders ChatBubble with msg generated by AI unchanged 1`] = `
|
|
7732
7732
|
<div>
|
|
7733
7733
|
<div
|
|
7734
|
-
class="memori-chat--bubble-container memori-chat--bubble-from-user memori-chat--with-addon"
|
|
7734
|
+
class="memori-chat--bubble-container memori-chat-scroll-item memori-chat--bubble-from-user memori-chat--with-addon"
|
|
7735
7735
|
>
|
|
7736
7736
|
<div
|
|
7737
7737
|
class="memori-chat--bubble memori-chat--user-bubble memori-chat--with-addon memori-chat--ai-generated transition ease-in-out duration-300 opacity-0 scale-09 translate-x-30"
|
|
@@ -7825,7 +7825,7 @@ exports[`renders ChatBubble with msg generated by AI unchanged 1`] = `
|
|
|
7825
7825
|
exports[`renders ChatBubble with output code unchanged 1`] = `
|
|
7826
7826
|
<div>
|
|
7827
7827
|
<div
|
|
7828
|
-
class="memori-chat--bubble-container"
|
|
7828
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
7829
7829
|
>
|
|
7830
7830
|
<picture
|
|
7831
7831
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -7945,7 +7945,7 @@ exports[`renders ChatBubble with output code unchanged 1`] = `
|
|
|
7945
7945
|
exports[`renders ChatBubble with reasoning and output and markdown unchanged 1`] = `
|
|
7946
7946
|
<div>
|
|
7947
7947
|
<div
|
|
7948
|
-
class="memori-chat--bubble-container"
|
|
7948
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
7949
7949
|
>
|
|
7950
7950
|
<picture
|
|
7951
7951
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -8084,7 +8084,7 @@ end
|
|
|
8084
8084
|
exports[`renders ChatBubble with reasoning shown unchanged 1`] = `
|
|
8085
8085
|
<div>
|
|
8086
8086
|
<div
|
|
8087
|
-
class="memori-chat--bubble-container"
|
|
8087
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
8088
8088
|
>
|
|
8089
8089
|
<picture
|
|
8090
8090
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -8194,7 +8194,7 @@ Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
|
|
|
8194
8194
|
exports[`renders ChatBubble with reasoning unchanged 1`] = `
|
|
8195
8195
|
<div>
|
|
8196
8196
|
<div
|
|
8197
|
-
class="memori-chat--bubble-container"
|
|
8197
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
8198
8198
|
>
|
|
8199
8199
|
<picture
|
|
8200
8200
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -8297,7 +8297,7 @@ exports[`renders ChatBubble with reasoning unchanged 1`] = `
|
|
|
8297
8297
|
exports[`renders ChatBubble with translation and original unchanged 1`] = `
|
|
8298
8298
|
<div>
|
|
8299
8299
|
<div
|
|
8300
|
-
class="memori-chat--bubble-container"
|
|
8300
|
+
class="memori-chat--bubble-container memori-chat-scroll-item"
|
|
8301
8301
|
>
|
|
8302
8302
|
<picture
|
|
8303
8303
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
@@ -8429,7 +8429,7 @@ exports[`renders ChatBubble with translation and original unchanged 1`] = `
|
|
|
8429
8429
|
exports[`renders ChatBubble with user msg unchanged 1`] = `
|
|
8430
8430
|
<div>
|
|
8431
8431
|
<div
|
|
8432
|
-
class="memori-chat--bubble-container memori-chat--bubble-from-user"
|
|
8432
|
+
class="memori-chat--bubble-container memori-chat-scroll-item memori-chat--bubble-from-user"
|
|
8433
8433
|
>
|
|
8434
8434
|
<div
|
|
8435
8435
|
class="memori-chat--bubble memori-chat--user-bubble transition ease-in-out duration-300 opacity-0 scale-09 translate-x-30"
|
|
@@ -9,6 +9,29 @@
|
|
|
9
9
|
padding: 0;
|
|
10
10
|
border: none;
|
|
11
11
|
margin: 0;
|
|
12
|
+
transition: all 0.2s ease-in-out;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.memori-chat-inputs--expanded {
|
|
16
|
+
/* Additional padding when expanded to prevent overlap with file preview */
|
|
17
|
+
padding-top: 0.5rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Responsive adjustments */
|
|
21
|
+
@media (max-width: 768px) {
|
|
22
|
+
.memori-chat-inputs {
|
|
23
|
+
padding: 0 0.25rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.memori-chat-inputs--expanded {
|
|
27
|
+
padding-top: 0.25rem;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media (max-width: 480px) {
|
|
32
|
+
.memori-chat-inputs {
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
}
|
|
12
35
|
}
|
|
13
36
|
|
|
14
37
|
.memori-chat-inputs .memori-upload-menu+.memori-send-on-enter-menu {
|
|
@@ -34,6 +34,7 @@ export interface Props {
|
|
|
34
34
|
sessionID?: string;
|
|
35
35
|
memoriID?: string;
|
|
36
36
|
client?: ReturnType<typeof memoriApiClient>;
|
|
37
|
+
onTextareaExpanded?: (expanded: boolean) => void;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
const ChatInputs: React.FC<Props> = ({
|
|
@@ -55,9 +56,13 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
55
56
|
authToken,
|
|
56
57
|
memoriID,
|
|
57
58
|
client,
|
|
59
|
+
onTextareaExpanded,
|
|
58
60
|
}) => {
|
|
59
61
|
const { t } = useTranslation();
|
|
60
62
|
|
|
63
|
+
// State for textarea expansion
|
|
64
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
65
|
+
|
|
61
66
|
// State for document preview files
|
|
62
67
|
const [documentPreviewFiles, setDocumentPreviewFiles] = useState<
|
|
63
68
|
{
|
|
@@ -90,18 +95,21 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
90
95
|
url?: string;
|
|
91
96
|
}[]
|
|
92
97
|
) => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
|
|
99
|
+
const mediaWithIds = files.map((file, index) => {
|
|
100
|
+
const generatedMediumID = file.mediumID || `file_${Date.now()}_${index}_${Math.random().toString(36).substr(2, 9)}`;
|
|
101
|
+
return {
|
|
102
|
+
mediumID: generatedMediumID,
|
|
97
103
|
mimeType: file.mimeType,
|
|
98
104
|
content: file.content,
|
|
99
105
|
title: file.name,
|
|
100
106
|
properties: { isAttachedFile: true },
|
|
101
107
|
type: file.type,
|
|
102
108
|
url: file.url,
|
|
103
|
-
}
|
|
104
|
-
);
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
sendMessage(userMessage, mediaWithIds);
|
|
105
113
|
|
|
106
114
|
// Reset states after sending
|
|
107
115
|
setDocumentPreviewFiles([]);
|
|
@@ -115,18 +123,20 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
115
123
|
const onTextareaPressEnter = () => {
|
|
116
124
|
if (sendOnEnter === 'keypress' && userMessage?.length > 0) {
|
|
117
125
|
stopListening();
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
mediumID:
|
|
126
|
+
const mediaWithIds = documentPreviewFiles.map((file, index) => {
|
|
127
|
+
const generatedMediumID = file.mediumID || `file_${Date.now()}_${index}_${Math.random().toString(36).substr(2, 9)}`;
|
|
128
|
+
return {
|
|
129
|
+
mediumID: generatedMediumID,
|
|
122
130
|
mimeType: file.mimeType,
|
|
123
131
|
content: file.content,
|
|
124
132
|
title: file.name,
|
|
125
133
|
properties: { isAttachedFile: true },
|
|
126
134
|
type: file.type,
|
|
127
135
|
url: file.url,
|
|
128
|
-
}
|
|
129
|
-
);
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
sendMessage(userMessage, mediaWithIds);
|
|
130
140
|
|
|
131
141
|
setDocumentPreviewFiles([]);
|
|
132
142
|
onChangeUserMessage('');
|
|
@@ -137,7 +147,6 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
137
147
|
* Removes a file from the preview list
|
|
138
148
|
*/
|
|
139
149
|
const removeFile = async (fileId: string, mediumID: string | undefined) => {
|
|
140
|
-
console.log('removeFile', fileId);
|
|
141
150
|
// Call the MediumDeselected event if dialog API is available
|
|
142
151
|
if (dialog.postMediumDeselectedEvent && sessionID && mediumID) {
|
|
143
152
|
await dialog.postMediumDeselectedEvent(sessionID, mediumID);
|
|
@@ -157,10 +166,22 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
157
166
|
);
|
|
158
167
|
};
|
|
159
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Handles textarea expansion change
|
|
171
|
+
*/
|
|
172
|
+
const handleTextareaExpanded = (expanded: boolean) => {
|
|
173
|
+
setIsExpanded(expanded);
|
|
174
|
+
if (onTextareaExpanded) {
|
|
175
|
+
onTextareaExpanded(expanded);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
160
179
|
return (
|
|
161
180
|
<fieldset
|
|
162
181
|
id="chat-fieldset"
|
|
163
|
-
className=
|
|
182
|
+
className={cx('memori-chat-inputs', {
|
|
183
|
+
'memori-chat-inputs--expanded': isExpanded,
|
|
184
|
+
})}
|
|
164
185
|
disabled={dialogState?.state === 'X2a' || dialogState?.state === 'X3'}
|
|
165
186
|
>
|
|
166
187
|
<ChatTextArea
|
|
@@ -169,6 +190,7 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
169
190
|
onPressEnter={onTextareaPressEnter}
|
|
170
191
|
onFocus={onTextareaFocus}
|
|
171
192
|
onBlur={onTextareaBlur}
|
|
193
|
+
onExpandedChange={handleTextareaExpanded}
|
|
172
194
|
disabled={['R2', 'R3', 'R4', 'R5', 'G3', 'X3'].includes(
|
|
173
195
|
dialogState?.state || ''
|
|
174
196
|
)}
|
|
@@ -4,9 +4,27 @@
|
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
flex: 1 0 auto;
|
|
6
6
|
margin-right: 0.5rem;
|
|
7
|
+
transition: height 0.2s ease-in-out;
|
|
7
8
|
/* margin-left: 0.5rem; */
|
|
8
9
|
}
|
|
9
10
|
|
|
11
|
+
.memori-chat-textarea--expanded {
|
|
12
|
+
height: 300px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Responsive adjustments for small screens */
|
|
16
|
+
@media (max-width: 768px) {
|
|
17
|
+
.memori-chat-textarea--expanded {
|
|
18
|
+
height: 200px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (max-width: 480px) {
|
|
23
|
+
.memori-chat-textarea--expanded {
|
|
24
|
+
height: 150px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
10
28
|
.memori-chat-textarea--inner {
|
|
11
29
|
position: absolute;
|
|
12
30
|
right: 0;
|
|
@@ -27,6 +45,19 @@
|
|
|
27
45
|
max-height: 300px;
|
|
28
46
|
}
|
|
29
47
|
|
|
48
|
+
/* Responsive adjustments for textarea inner */
|
|
49
|
+
@media (max-width: 768px) {
|
|
50
|
+
.memori-chat-textarea--expanded .memori-chat-textarea--inner {
|
|
51
|
+
max-height: 200px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (max-width: 480px) {
|
|
56
|
+
.memori-chat-textarea--expanded .memori-chat-textarea--inner {
|
|
57
|
+
max-height: 150px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
30
61
|
.memori-chat-textarea--disabled .memori-chat-textarea--inner {
|
|
31
62
|
background: #e3e3e3;
|
|
32
63
|
opacity: 0.8;
|
|
@@ -12,6 +12,7 @@ export interface Props {
|
|
|
12
12
|
onPressEnter?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
13
13
|
onFocus?: (e: React.FocusEvent) => void;
|
|
14
14
|
onBlur?: (e: React.FocusEvent) => void;
|
|
15
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const ChatTextArea: React.FC<Props> = ({
|
|
@@ -21,10 +22,19 @@ const ChatTextArea: React.FC<Props> = ({
|
|
|
21
22
|
onPressEnter,
|
|
22
23
|
onFocus,
|
|
23
24
|
onBlur,
|
|
25
|
+
onExpandedChange,
|
|
24
26
|
}) => {
|
|
25
27
|
const { t } = useTranslation();
|
|
26
28
|
const [expanded, setExpanded] = useState(false);
|
|
27
29
|
|
|
30
|
+
const handleExpandToggle = () => {
|
|
31
|
+
const newExpanded = !expanded;
|
|
32
|
+
setExpanded(newExpanded);
|
|
33
|
+
if (onExpandedChange) {
|
|
34
|
+
onExpandedChange(newExpanded);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
28
38
|
return (
|
|
29
39
|
<div
|
|
30
40
|
data-testid="chat-textarea"
|
|
@@ -53,7 +63,7 @@ const ChatTextArea: React.FC<Props> = ({
|
|
|
53
63
|
<div className="memori-chat-textarea--expand">
|
|
54
64
|
<Button
|
|
55
65
|
className={cx('memori-chat-textarea--expand-button')}
|
|
56
|
-
onClick={
|
|
66
|
+
onClick={handleExpandToggle}
|
|
57
67
|
padded={false}
|
|
58
68
|
ghost
|
|
59
69
|
title={
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Updated FilePreview Styles */
|
|
2
2
|
|
|
3
3
|
.memori--preview-container {
|
|
4
|
+
z-index: 10;
|
|
4
5
|
min-width: 100%;
|
|
5
6
|
padding: 12px;
|
|
6
7
|
border-radius: 8px;
|
|
@@ -17,7 +18,45 @@
|
|
|
17
18
|
|
|
18
19
|
.memori--absolute-preview {
|
|
19
20
|
position: absolute;
|
|
21
|
+
z-index: 10;
|
|
22
|
+
right: 0;
|
|
20
23
|
bottom: 100%;
|
|
24
|
+
left: 0;
|
|
25
|
+
max-height: 200px;
|
|
26
|
+
overflow-y: auto;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Responsive adjustments for file preview */
|
|
30
|
+
@media (max-width: 768px) {
|
|
31
|
+
.memori--absolute-preview {
|
|
32
|
+
max-height: 150px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.memori--preview-container {
|
|
36
|
+
padding: 8px;
|
|
37
|
+
margin-bottom: 8px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.memori--preview-filename {
|
|
41
|
+
max-width: 150px;
|
|
42
|
+
font-size: 12px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (max-width: 480px) {
|
|
47
|
+
.memori--absolute-preview {
|
|
48
|
+
max-height: 120px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.memori--preview-container {
|
|
52
|
+
padding: 6px;
|
|
53
|
+
margin-bottom: 6px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.memori--preview-filename {
|
|
57
|
+
max-width: 100px;
|
|
58
|
+
font-size: 11px;
|
|
59
|
+
}
|
|
21
60
|
}
|
|
22
61
|
|
|
23
62
|
.memori--message-preview {
|
|
@@ -113,8 +113,6 @@ const Header: React.FC<Props> = ({
|
|
|
113
113
|
layout?: WidgetProps['layout'],
|
|
114
114
|
additionalSettings?: WidgetProps['additionalSettings']
|
|
115
115
|
): boolean => {
|
|
116
|
-
console.log('[hasSettingsContent] Layout:', layout);
|
|
117
|
-
console.log('[hasSettingsContent] Additional settings:', additionalSettings);
|
|
118
116
|
return (
|
|
119
117
|
layout === 'TOTEM' ||
|
|
120
118
|
(additionalSettings && Object.keys(additionalSettings).length > 0) || false
|
|
@@ -122,27 +120,20 @@ const Header: React.FC<Props> = ({
|
|
|
122
120
|
}, [layout, additionalSettings]);
|
|
123
121
|
|
|
124
122
|
const updateAvatar = async (avatar: Blob) => {
|
|
125
|
-
console.log('[updateAvatar] Starting avatar update', { avatar });
|
|
126
123
|
if (avatar && loginToken) {
|
|
127
124
|
const reader = new FileReader();
|
|
128
125
|
reader.onload = async e => {
|
|
129
|
-
console.log('[updateAvatar] FileReader loaded', {
|
|
130
|
-
result: e.target?.result,
|
|
131
|
-
});
|
|
132
126
|
try {
|
|
133
|
-
console.log('[updateAvatar] Uploading asset...');
|
|
134
127
|
const { asset: avatarAsset, ...resp } = await uploadAsset(
|
|
135
128
|
avatar.name ?? 'avatar',
|
|
136
129
|
e.target?.result as string,
|
|
137
130
|
loginToken ?? ''
|
|
138
131
|
);
|
|
139
|
-
console.log('[updateAvatar] Upload response:', { avatarAsset, resp });
|
|
140
132
|
|
|
141
133
|
if (resp.resultCode !== 0) {
|
|
142
134
|
console.error('[updateAvatar] Upload failed:', resp);
|
|
143
135
|
toast.error(t(getErrori18nKey(resp.resultCode)));
|
|
144
136
|
} else if (avatarAsset) {
|
|
145
|
-
console.log('[updateAvatar] Upload successful, updating user...');
|
|
146
137
|
let newUser: Partial<User> = {
|
|
147
138
|
userID: user?.userID,
|
|
148
139
|
avatarURL: avatarAsset.assetURL,
|
|
@@ -153,10 +144,6 @@ const Header: React.FC<Props> = ({
|
|
|
153
144
|
user?.userID ?? '',
|
|
154
145
|
newUser
|
|
155
146
|
);
|
|
156
|
-
console.log('[updateAvatar] User update complete', {
|
|
157
|
-
patchedUser,
|
|
158
|
-
resp,
|
|
159
|
-
});
|
|
160
147
|
}
|
|
161
148
|
} catch (e) {
|
|
162
149
|
let err = e as Error;
|
|
@@ -172,7 +172,7 @@ const LinkItemWidget: React.FC<Props> = ({
|
|
|
172
172
|
}: Props) => {
|
|
173
173
|
return (
|
|
174
174
|
<Transition appear show as="div" className="memori-link-items">
|
|
175
|
-
<div className={cx('memori-link-items--grid', {
|
|
175
|
+
<div className={cx('memori-link-items--grid memori-chat-scroll-item', {
|
|
176
176
|
'memori-link-items--user': fromUser,
|
|
177
177
|
'memori-link-items--agent': !fromUser,
|
|
178
178
|
})}>
|
|
@@ -216,6 +216,39 @@ MixedSnippets.args = {
|
|
|
216
216
|
title: 'Quick Function',
|
|
217
217
|
content: 'const add = (a, b) => a + b;',
|
|
218
218
|
},
|
|
219
|
+
{
|
|
220
|
+
mediumID: 'long-2',
|
|
221
|
+
mimeType: 'text/javascript',
|
|
222
|
+
title: 'Long JSON',
|
|
223
|
+
content: `{
|
|
224
|
+
"id": 1,
|
|
225
|
+
"title": "Ciao",
|
|
226
|
+
"description": "I'm a test!",
|
|
227
|
+
"refs": [
|
|
228
|
+
{
|
|
229
|
+
"id": 1,
|
|
230
|
+
"tag": "TEST"
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
`,
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
mediumID: 'long-3',
|
|
238
|
+
mimeType: 'text/plain',
|
|
239
|
+
title: 'Long Text',
|
|
240
|
+
content: `{
|
|
241
|
+
"id": 1,
|
|
242
|
+
"title": "Ciao",
|
|
243
|
+
"description": "I'm a test!",
|
|
244
|
+
"refs": [
|
|
245
|
+
{
|
|
246
|
+
"id": 1,
|
|
247
|
+
"tag": "TEST"
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
}`,
|
|
251
|
+
},
|
|
219
252
|
{
|
|
220
253
|
mediumID: 'long-1',
|
|
221
254
|
mimeType: 'text/javascript',
|
|
@@ -413,9 +413,7 @@ export const RenderSnippetItem = ({
|
|
|
413
413
|
onClick={e => {
|
|
414
414
|
e.preventDefault();
|
|
415
415
|
if (onClick) {
|
|
416
|
-
console.log('Snippet item.mediumID:', item.mediumID);
|
|
417
416
|
onClick(item.mediumID);
|
|
418
|
-
console.log('clicked snippet');
|
|
419
417
|
}
|
|
420
418
|
}}
|
|
421
419
|
className="memori-media-item--link"
|
|
@@ -448,6 +446,11 @@ const MediaItemWidget: React.FC<Props> = ({
|
|
|
448
446
|
const [media, setMedia] = useState(items);
|
|
449
447
|
const [openModalMedium, setOpenModalMedium] = useState<Medium>();
|
|
450
448
|
|
|
449
|
+
// Sync items prop with media state
|
|
450
|
+
useEffect(() => {
|
|
451
|
+
setMedia(items);
|
|
452
|
+
}, [items]);
|
|
453
|
+
|
|
451
454
|
const translateMediaCaptions = useCallback(async () => {
|
|
452
455
|
if (!translateTo) return;
|
|
453
456
|
|
|
@@ -498,15 +501,11 @@ const MediaItemWidget: React.FC<Props> = ({
|
|
|
498
501
|
m => m.mimeType === 'text/css' && !!m.properties?.executable
|
|
499
502
|
);
|
|
500
503
|
|
|
501
|
-
console.log('openModalMedium', openModalMedium);
|
|
502
|
-
console.log('codeSnippets', codeSnippets);
|
|
503
|
-
console.log('nonCodeDisplayMedia', nonCodeDisplayMedia);
|
|
504
|
-
|
|
505
504
|
return (
|
|
506
505
|
<Transition appear show as="div" className="memori-media-items">
|
|
507
506
|
{!!nonCodeDisplayMedia.length && (
|
|
508
507
|
<div
|
|
509
|
-
className={cx('memori-media-items--grid', {
|
|
508
|
+
className={cx('memori-media-items--grid memori-chat-scroll-item', {
|
|
510
509
|
'memori-media-items--user': fromUser,
|
|
511
510
|
'memori-media-items--agent': !fromUser,
|
|
512
511
|
})}
|
|
@@ -547,7 +546,7 @@ const MediaItemWidget: React.FC<Props> = ({
|
|
|
547
546
|
)}
|
|
548
547
|
{!!codeSnippets.length && (
|
|
549
548
|
<div
|
|
550
|
-
className={cx('memori-media-items--grid', {
|
|
549
|
+
className={cx('memori-media-items--grid memori-chat-scroll-item', {
|
|
551
550
|
'memori-media-items--user': fromUser,
|
|
552
551
|
'memori-media-items--agent': !fromUser,
|
|
553
552
|
})}
|
|
@@ -570,9 +569,7 @@ const MediaItemWidget: React.FC<Props> = ({
|
|
|
570
569
|
baseURL={baseURL}
|
|
571
570
|
apiURL={apiURL}
|
|
572
571
|
onClick={mediumID => {
|
|
573
|
-
console.log('Snippet clicked, mediumID:', mediumID);
|
|
574
572
|
const foundMedium = codeSnippets.find(m => m.mediumID === mediumID);
|
|
575
|
-
console.log('Found medium:', foundMedium);
|
|
576
573
|
setOpenModalMedium(foundMedium);
|
|
577
574
|
}}
|
|
578
575
|
item={{
|