@memori.ai/memori-react 8.11.0 → 8.13.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 +74 -0
- package/dist/components/AgeVerificationModal/AgeVerificationModal.css +41 -14
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js +2 -2
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/dist/components/Auth/Auth.js +36 -8
- package/dist/components/Auth/Auth.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.css +2 -2
- package/dist/components/Chat/Chat.css +37 -3
- package/dist/components/Chat/Chat.js +61 -23
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.css +87 -15
- package/dist/components/ChatBubble/ChatBubble.js +129 -19
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.css +5 -1
- package/dist/components/ChatInputs/ChatInputs.css +293 -17
- package/dist/components/ChatInputs/ChatInputs.d.ts +1 -0
- package/dist/components/ChatInputs/ChatInputs.js +48 -27
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
- package/dist/components/ChatTextArea/ChatTextArea.css +75 -31
- package/dist/components/ChatTextArea/ChatTextArea.js +47 -18
- package/dist/components/ChatTextArea/ChatTextArea.js.map +1 -1
- package/dist/components/DateSelector/DateSelector.css +125 -104
- package/dist/components/DateSelector/DateSelector.d.ts +1 -1
- package/dist/components/DateSelector/DateSelector.js +110 -52
- package/dist/components/DateSelector/DateSelector.js.map +1 -1
- package/dist/components/FilePreview/FilePreview.css +225 -146
- package/dist/components/FilePreview/FilePreview.d.ts +1 -2
- package/dist/components/FilePreview/FilePreview.js +20 -6
- package/dist/components/FilePreview/FilePreview.js.map +1 -1
- package/dist/components/Header/Header.css +2 -2
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/LoginDrawer/LoginDrawer.css +37 -5
- package/dist/components/LoginDrawer/LoginDrawer.d.ts +1 -2
- package/dist/components/LoginDrawer/LoginDrawer.js +2 -9
- package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/dist/components/MediaWidget/MediaItemWidget.js +2 -1
- package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.js +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.js +3 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +16 -7
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +6 -4
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.css +11 -2
- package/dist/components/MemoriWidget/MemoriWidget.js +105 -25
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MicrophoneButton/MicrophoneButton.css +2 -2
- package/dist/components/StartPanel/StartPanel.css +8 -0
- package/dist/components/UploadButton/UploadButton.css +20 -17
- package/dist/components/UploadButton/UploadButton.js +218 -87
- package/dist/components/UploadButton/UploadButton.js.map +1 -1
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js +14 -4
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/dist/components/UploadButton/UploadImages/UploadImages.js +143 -16
- package/dist/components/UploadButton/UploadImages/UploadImages.js.map +1 -1
- package/dist/components/layouts/chat.css +1 -1
- package/dist/components/ui/Drawer.css +8 -0
- package/dist/components/ui/Drawer.d.ts +2 -0
- package/dist/components/ui/Drawer.js +2 -2
- package/dist/components/ui/Drawer.js.map +1 -1
- package/dist/components/ui/Tooltip.css +49 -1
- package/dist/components/ui/Tooltip.d.ts +1 -1
- package/dist/helpers/constants.d.ts +1 -0
- package/dist/helpers/constants.js +2 -1
- package/dist/helpers/constants.js.map +1 -1
- package/dist/helpers/imageCompression.d.ts +7 -0
- package/dist/helpers/imageCompression.js +123 -0
- package/dist/helpers/imageCompression.js.map +1 -0
- package/dist/locales/de.json +13 -5
- package/dist/locales/en.json +17 -6
- package/dist/locales/es.json +13 -5
- package/dist/locales/fr.json +12 -5
- package/dist/locales/it.json +16 -6
- package/dist/styles.css +4 -4
- package/esm/components/AgeVerificationModal/AgeVerificationModal.css +41 -14
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js +2 -2
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/esm/components/Auth/Auth.js +36 -8
- package/esm/components/Auth/Auth.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.css +2 -2
- package/esm/components/Chat/Chat.css +37 -3
- package/esm/components/Chat/Chat.js +61 -23
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.css +87 -15
- package/esm/components/ChatBubble/ChatBubble.js +130 -20
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.css +5 -1
- package/esm/components/ChatInputs/ChatInputs.css +293 -17
- package/esm/components/ChatInputs/ChatInputs.d.ts +1 -0
- package/esm/components/ChatInputs/ChatInputs.js +49 -28
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
- package/esm/components/ChatTextArea/ChatTextArea.css +75 -31
- package/esm/components/ChatTextArea/ChatTextArea.js +49 -20
- package/esm/components/ChatTextArea/ChatTextArea.js.map +1 -1
- package/esm/components/DateSelector/DateSelector.css +125 -104
- package/esm/components/DateSelector/DateSelector.d.ts +1 -1
- package/esm/components/DateSelector/DateSelector.js +111 -52
- package/esm/components/DateSelector/DateSelector.js.map +1 -1
- package/esm/components/FilePreview/FilePreview.css +225 -146
- package/esm/components/FilePreview/FilePreview.d.ts +1 -2
- package/esm/components/FilePreview/FilePreview.js +21 -7
- package/esm/components/FilePreview/FilePreview.js.map +1 -1
- package/esm/components/Header/Header.css +2 -2
- package/esm/components/Header/Header.js +1 -1
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/LoginDrawer/LoginDrawer.css +37 -5
- package/esm/components/LoginDrawer/LoginDrawer.d.ts +1 -2
- package/esm/components/LoginDrawer/LoginDrawer.js +2 -9
- package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/esm/components/MediaWidget/MediaItemWidget.js +2 -1
- package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.js +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.js +3 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +16 -7
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +6 -4
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.css +11 -2
- package/esm/components/MemoriWidget/MemoriWidget.js +105 -25
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MicrophoneButton/MicrophoneButton.css +2 -2
- package/esm/components/StartPanel/StartPanel.css +8 -0
- package/esm/components/UploadButton/UploadButton.css +20 -17
- package/esm/components/UploadButton/UploadButton.js +219 -88
- package/esm/components/UploadButton/UploadButton.js.map +1 -1
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js +14 -4
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/esm/components/UploadButton/UploadImages/UploadImages.js +143 -16
- package/esm/components/UploadButton/UploadImages/UploadImages.js.map +1 -1
- package/esm/components/layouts/chat.css +1 -1
- package/esm/components/ui/Drawer.css +8 -0
- package/esm/components/ui/Drawer.d.ts +2 -0
- package/esm/components/ui/Drawer.js +2 -2
- package/esm/components/ui/Drawer.js.map +1 -1
- package/esm/components/ui/Tooltip.css +49 -1
- package/esm/components/ui/Tooltip.d.ts +1 -1
- package/esm/helpers/constants.d.ts +1 -0
- package/esm/helpers/constants.js +1 -0
- package/esm/helpers/constants.js.map +1 -1
- package/esm/helpers/imageCompression.d.ts +7 -0
- package/esm/helpers/imageCompression.js +119 -0
- package/esm/helpers/imageCompression.js.map +1 -0
- package/esm/locales/de.json +13 -5
- package/esm/locales/en.json +17 -6
- package/esm/locales/es.json +13 -5
- package/esm/locales/fr.json +12 -5
- package/esm/locales/it.json +16 -6
- package/esm/styles.css +4 -4
- package/package.json +2 -2
- package/src/components/AgeVerificationModal/AgeVerificationModal.css +41 -14
- package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +3 -1
- package/src/components/Auth/Auth.tsx +55 -11
- package/src/components/Avatar/Avatar.stories.tsx +3 -0
- package/src/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.css +2 -2
- package/src/components/Chat/Chat.css +37 -3
- package/src/components/Chat/Chat.stories.tsx +16 -2
- package/src/components/Chat/Chat.tsx +90 -21
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +1752 -812
- package/src/components/ChatBubble/ChatBubble.css +87 -15
- package/src/components/ChatBubble/ChatBubble.stories.tsx +16 -2
- package/src/components/ChatBubble/ChatBubble.test.tsx +17 -0
- package/src/components/ChatBubble/ChatBubble.tsx +237 -33
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +304 -8
- package/src/components/ChatHistoryDrawer/ChatHistory.css +5 -1
- package/src/components/ChatInputs/ChatInputs.css +293 -17
- package/src/components/ChatInputs/ChatInputs.tsx +156 -86
- package/src/components/ChatInputs/__snapshots__/ChatInputs.test.tsx.snap +430 -424
- package/src/components/ChatTextArea/ChatTextArea.css +75 -31
- package/src/components/ChatTextArea/ChatTextArea.test.tsx +1 -16
- package/src/components/ChatTextArea/ChatTextArea.tsx +51 -22
- package/src/components/ChatTextArea/__snapshots__/ChatTextArea.test.tsx.snap +9 -72
- package/src/components/DateSelector/DateSelector.css +125 -104
- package/src/components/DateSelector/DateSelector.stories.tsx +1 -1
- package/src/components/DateSelector/DateSelector.test.tsx +137 -23
- package/src/components/DateSelector/DateSelector.tsx +203 -177
- package/src/components/FilePreview/FilePreview.css +225 -146
- package/src/components/FilePreview/FilePreview.tsx +49 -36
- package/src/components/FilePreview/__snapshots__/FilePreview.test.tsx.snap +2 -2
- package/src/components/Header/Header.css +2 -2
- package/src/components/Header/Header.stories.tsx +5 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/__snapshots__/Header.test.tsx.snap +1 -1
- package/src/components/LoginDrawer/LoginDrawer.css +37 -5
- package/src/components/LoginDrawer/LoginDrawer.stories.tsx +0 -1
- package/src/components/LoginDrawer/LoginDrawer.test.tsx +0 -1
- package/src/components/LoginDrawer/LoginDrawer.tsx +0 -19
- package/src/components/MediaWidget/MediaItemWidget.tsx +2 -1
- package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +996 -204
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +2 -2
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.tsx +1 -1
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.tsx +3 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +56 -54
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +16 -7
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +12 -3
- package/src/components/MemoriWidget/MemoriWidget.css +11 -2
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +6 -3
- package/src/components/MemoriWidget/MemoriWidget.tsx +173 -49
- package/src/components/MicrophoneButton/MicrophoneButton.css +2 -2
- package/src/components/StartPanel/StartPanel.css +8 -0
- package/src/components/UploadButton/UploadButton.css +20 -17
- package/src/components/UploadButton/UploadButton.stories.tsx +247 -35
- package/src/components/UploadButton/UploadButton.tsx +280 -173
- package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +19 -4
- package/src/components/UploadButton/UploadImages/UploadImages.tsx +196 -35
- package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +10 -1
- package/src/components/layouts/FullBody/FullBody.stories.tsx +9 -10
- package/src/components/layouts/Totem/Totem.stories.tsx +8 -9
- package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +8 -9
- package/src/components/layouts/chat.css +1 -1
- package/src/components/layouts/layouts.stories.tsx +10 -9
- package/src/components/ui/Drawer.css +8 -0
- package/src/components/ui/Drawer.tsx +16 -12
- package/src/components/ui/Tooltip.css +49 -1
- package/src/components/ui/Tooltip.tsx +1 -1
- package/src/helpers/constants.ts +1 -1
- package/src/helpers/imageCompression.ts +230 -0
- package/src/index.stories.tsx +18 -0
- package/src/locales/de.json +13 -5
- package/src/locales/en.json +17 -6
- package/src/locales/es.json +13 -5
- package/src/locales/fr.json +12 -5
- package/src/locales/it.json +16 -6
- package/src/mocks/data.ts +4 -2
- package/src/styles.css +4 -4
- package/src/components/SignupForm/SignupForm.test.tsx +0 -40
- package/src/components/SignupForm/SignupForm.tsx +0 -457
- package/src/components/SignupForm/__snapshots__/SignupForm.test.tsx.snap +0 -247
- package/src/components/UploadMenu/UploadMenu.css +0 -47
- package/src/components/UploadMenu/UploadMenu.stories.tsx +0 -66
- package/src/components/UploadMenu/UploadMenu.test.tsx +0 -34
- package/src/components/UploadMenu/UploadMenu.tsx +0 -68
- package/src/components/UploadMenu/__snapshots__/UploadMenu.test.tsx.snap +0 -137
|
@@ -1,223 +1,302 @@
|
|
|
1
1
|
/* Updated FilePreview Styles */
|
|
2
2
|
|
|
3
3
|
.memori--preview-container {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
z-index: 10;
|
|
5
|
+
min-width: 100%;
|
|
6
|
+
/* padding: 12px; */
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
/* margin-bottom: 12px; */
|
|
9
|
+
animation: slide-in 0.3s ease;
|
|
10
|
+
background: white;
|
|
11
|
+
/* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
|
|
12
|
+
transition: all 0.3s ease;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.memori--preview-container.slide-down {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.memori--absolute-preview {
|
|
20
|
-
position: absolute;
|
|
21
|
-
z-index: 10;
|
|
22
|
-
right: 0;
|
|
23
|
-
bottom: 100%;
|
|
24
|
-
left: 0;
|
|
25
|
-
max-height: 200px;
|
|
26
|
-
overflow-y: auto;
|
|
16
|
+
animation: slide-down 0.3s ease;
|
|
27
17
|
}
|
|
28
18
|
|
|
29
19
|
/* Responsive adjustments for file preview */
|
|
30
20
|
@media (max-width: 768px) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
.memori--absolute-preview {
|
|
22
|
+
max-height: 150px;
|
|
23
|
+
}
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
.memori--preview-container {
|
|
26
|
+
padding: 8px;
|
|
27
|
+
margin-bottom: 8px;
|
|
28
|
+
}
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
.memori--preview-filename {
|
|
31
|
+
max-width: 150px;
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Make remove button always visible on mobile */
|
|
36
|
+
.memori--remove-button {
|
|
37
|
+
opacity: 1 !important;
|
|
38
|
+
transform: scale(1) !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Increase card size for easier interaction */
|
|
42
|
+
.memori--preview-item {
|
|
43
|
+
min-width: 140px;
|
|
44
|
+
min-height: 60px;
|
|
45
|
+
padding: 12px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.memori--preview-icon {
|
|
49
|
+
width: 24px;
|
|
50
|
+
height: 24px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.memori--preview-thumbnail {
|
|
54
|
+
min-width: 50px;
|
|
55
|
+
min-height: 50px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.memori--preview-thumbnail img {
|
|
59
|
+
width: 50px;
|
|
60
|
+
height: 50px;
|
|
61
|
+
object-fit: cover;
|
|
62
|
+
}
|
|
44
63
|
}
|
|
45
64
|
|
|
46
65
|
@media (max-width: 480px) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
.memori--absolute-preview {
|
|
67
|
+
max-height: 120px;
|
|
68
|
+
}
|
|
50
69
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
.memori--preview-container {
|
|
71
|
+
padding: 6px;
|
|
72
|
+
margin-bottom: 6px;
|
|
73
|
+
}
|
|
55
74
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
.memori--preview-filename {
|
|
76
|
+
max-width: 100px;
|
|
77
|
+
font-size: 11px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Make remove button always visible on mobile */
|
|
81
|
+
.memori--remove-button {
|
|
82
|
+
opacity: 1 !important;
|
|
83
|
+
transform: scale(1) !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Increase card size for easier interaction on small screens */
|
|
87
|
+
.memori--preview-item {
|
|
88
|
+
min-width: 160px;
|
|
89
|
+
min-height: 70px;
|
|
90
|
+
padding: 14px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.memori--preview-icon {
|
|
94
|
+
width: 28px;
|
|
95
|
+
height: 28px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.memori--preview-thumbnail {
|
|
99
|
+
min-width: 60px;
|
|
100
|
+
min-height: 60px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.memori--preview-thumbnail img {
|
|
104
|
+
width: 60px;
|
|
105
|
+
height: 60px;
|
|
106
|
+
object-fit: cover;
|
|
107
|
+
}
|
|
60
108
|
}
|
|
61
109
|
|
|
62
110
|
.memori--message-preview {
|
|
63
|
-
|
|
64
|
-
|
|
111
|
+
max-width: 100%;
|
|
112
|
+
margin: 12px 0;
|
|
65
113
|
}
|
|
66
114
|
|
|
67
115
|
.memori--preview-list {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: row;
|
|
118
|
+
padding: 0.875rem;
|
|
119
|
+
padding-bottom: 0.625rem;
|
|
120
|
+
gap: 8px;
|
|
121
|
+
overflow-x: auto;
|
|
122
|
+
scrollbar-color: hsla(var(--border-300) / 35%) transparent;
|
|
123
|
+
scrollbar-width: thin;
|
|
72
124
|
}
|
|
73
125
|
|
|
74
126
|
.memori--preview-item {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
127
|
+
position: relative;
|
|
128
|
+
display: flex;
|
|
129
|
+
max-width: fit-content;
|
|
130
|
+
align-items: center;
|
|
131
|
+
padding: 8px;
|
|
132
|
+
border-radius: 8px;
|
|
133
|
+
animation: slide-in 0.3s ease;
|
|
134
|
+
background-color: #f8f9fa;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
gap: 8px;
|
|
137
|
+
transition: all 0.2s ease;
|
|
86
138
|
}
|
|
87
139
|
|
|
88
140
|
.memori--preview-item:hover {
|
|
89
|
-
|
|
90
|
-
|
|
141
|
+
background-color: #f1f3f5;
|
|
142
|
+
transform: translateX(4px);
|
|
91
143
|
}
|
|
92
144
|
|
|
93
145
|
.memori--preview-icon {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
146
|
+
width: 20px;
|
|
147
|
+
height: 20px;
|
|
148
|
+
flex-shrink: 0;
|
|
149
|
+
color: #fff;
|
|
150
|
+
fill: var(--memori-primary);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.memori--preview-thumbnail {
|
|
154
|
+
display: flex;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
flex-shrink: 0;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
border-radius: 4px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.memori--preview-thumbnail img {
|
|
163
|
+
width: 40px;
|
|
164
|
+
height: 40px;
|
|
165
|
+
border-radius: 4px;
|
|
166
|
+
object-fit: cover;
|
|
99
167
|
}
|
|
100
168
|
|
|
101
169
|
.memori--preview-file-info {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
170
|
+
display: flex;
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.memori-modal--title {
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
max-width: 100%;
|
|
178
|
+
text-overflow: ellipsis;
|
|
179
|
+
white-space: nowrap;
|
|
105
180
|
}
|
|
106
181
|
|
|
107
182
|
.memori--preview-filename {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
183
|
+
overflow: hidden;
|
|
184
|
+
max-width: 100px;
|
|
185
|
+
color: #495057;
|
|
186
|
+
font-size: 14px;
|
|
187
|
+
font-weight: 500;
|
|
188
|
+
text-overflow: ellipsis;
|
|
189
|
+
white-space: nowrap;
|
|
115
190
|
}
|
|
116
191
|
|
|
117
192
|
.memori--preview-filetype {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
193
|
+
margin-top: 2px;
|
|
194
|
+
color: #868e96;
|
|
195
|
+
font-size: 12px;
|
|
121
196
|
}
|
|
122
197
|
|
|
123
198
|
.memori--modal-title-preview {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
199
|
+
margin-top: 12px;
|
|
200
|
+
margin-bottom: 12px;
|
|
201
|
+
font-size: 20px;
|
|
202
|
+
font-weight: 600;
|
|
128
203
|
}
|
|
129
204
|
|
|
130
205
|
.memori--remove-button {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
206
|
+
position: absolute;
|
|
207
|
+
top: -4px;
|
|
208
|
+
right: -4px;
|
|
209
|
+
padding: 4px;
|
|
210
|
+
border: none;
|
|
211
|
+
border-radius: 50%;
|
|
212
|
+
background-color: #e03131;
|
|
213
|
+
color: white;
|
|
214
|
+
cursor: pointer;
|
|
215
|
+
opacity: 0;
|
|
216
|
+
transform: scale(0.75);
|
|
217
|
+
transition: all 0.2s ease;
|
|
143
218
|
}
|
|
144
219
|
|
|
145
220
|
.memori--remove-button.visible {
|
|
146
|
-
|
|
147
|
-
|
|
221
|
+
opacity: 1;
|
|
222
|
+
transform: scale(1);
|
|
148
223
|
}
|
|
149
224
|
|
|
150
225
|
.memori--remove-button:hover {
|
|
151
|
-
|
|
152
|
-
|
|
226
|
+
background-color: #c92a2a;
|
|
227
|
+
transform: scale(1.1);
|
|
153
228
|
}
|
|
154
229
|
|
|
155
230
|
.memori--remove-icon {
|
|
156
|
-
|
|
157
|
-
|
|
231
|
+
width: 12px;
|
|
232
|
+
height: 12px;
|
|
158
233
|
}
|
|
159
234
|
|
|
160
235
|
.memori--modal-preview-file {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
236
|
+
width: 100%;
|
|
237
|
+
max-width: 800px;
|
|
238
|
+
height: 100%;
|
|
239
|
+
padding: 12px;
|
|
165
240
|
}
|
|
166
241
|
|
|
167
242
|
.memori--preview-content {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
243
|
+
padding: 16px;
|
|
244
|
+
border-radius: 8px;
|
|
245
|
+
/* background-color: #f8f9fa; */
|
|
246
|
+
font-family: monospace;
|
|
247
|
+
font-size: 14px;
|
|
248
|
+
line-height: 1.5;
|
|
174
249
|
}
|
|
175
250
|
|
|
176
251
|
@keyframes fadeIn {
|
|
177
|
-
|
|
178
|
-
|
|
252
|
+
from {
|
|
253
|
+
opacity: 0;
|
|
254
|
+
}
|
|
255
|
+
to {
|
|
256
|
+
opacity: 1;
|
|
257
|
+
}
|
|
179
258
|
}
|
|
180
259
|
|
|
181
260
|
@keyframes scaleIn {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
261
|
+
from {
|
|
262
|
+
opacity: 0;
|
|
263
|
+
transform: scale(0.95);
|
|
264
|
+
}
|
|
265
|
+
to {
|
|
266
|
+
opacity: 1;
|
|
267
|
+
transform: scale(1);
|
|
268
|
+
}
|
|
190
269
|
}
|
|
191
270
|
|
|
192
271
|
@keyframes slide-up {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
272
|
+
from {
|
|
273
|
+
opacity: 0;
|
|
274
|
+
transform: translateY(10px);
|
|
275
|
+
}
|
|
276
|
+
to {
|
|
277
|
+
opacity: 1;
|
|
278
|
+
transform: translateY(0);
|
|
279
|
+
}
|
|
201
280
|
}
|
|
202
281
|
|
|
203
282
|
@keyframes slide-in {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
283
|
+
from {
|
|
284
|
+
opacity: 0;
|
|
285
|
+
transform: translateY(-10px);
|
|
286
|
+
}
|
|
287
|
+
to {
|
|
288
|
+
opacity: 1;
|
|
289
|
+
transform: translateY(0);
|
|
290
|
+
}
|
|
212
291
|
}
|
|
213
292
|
|
|
214
293
|
@keyframes slide-down {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
294
|
+
from {
|
|
295
|
+
opacity: 1;
|
|
296
|
+
transform: translateY(0);
|
|
297
|
+
}
|
|
298
|
+
to {
|
|
299
|
+
opacity: 0;
|
|
300
|
+
transform: translateY(10px);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { PreviewIcon } from '../icons/Preview';
|
|
3
3
|
import { DocumentIcon } from '../icons/Document';
|
|
4
4
|
import { ImageIcon } from '../icons/Image';
|
|
@@ -11,22 +11,22 @@ type FilePreviewProps = {
|
|
|
11
11
|
previewFiles: any;
|
|
12
12
|
removeFile: (id: string, mediumID: string | undefined) => void;
|
|
13
13
|
allowRemove?: boolean;
|
|
14
|
-
isMessagePreview?: boolean;
|
|
14
|
+
// isMessagePreview?: boolean;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const FilePreview = ({
|
|
18
18
|
previewFiles,
|
|
19
19
|
removeFile,
|
|
20
20
|
allowRemove = true,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
}: // isMessagePreview = false,
|
|
22
|
+
FilePreviewProps) => {
|
|
23
23
|
const [selectedFile, setSelectedFile] = useState<{
|
|
24
24
|
name: string;
|
|
25
25
|
id: string;
|
|
26
26
|
content: string;
|
|
27
27
|
type?: string;
|
|
28
28
|
} | null>(null);
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
const [hoveredId, setHoveredId] = useState<string | null>(null);
|
|
31
31
|
|
|
32
32
|
const getFileType = (filename: string, type?: string) => {
|
|
@@ -43,7 +43,7 @@ const FilePreview = ({
|
|
|
43
43
|
return 'Image';
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
// Otherwise use extension
|
|
48
48
|
const extension = filename.split('.').pop()?.toLowerCase();
|
|
49
49
|
switch (extension) {
|
|
@@ -67,37 +67,45 @@ const FilePreview = ({
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
const chat = document.getElementsByClassName('memori-chat--content');
|
|
72
|
+
if (chat) {
|
|
73
|
+
const lastChild = chat[chat.length - 1];
|
|
74
|
+
if (lastChild) {
|
|
75
|
+
//then scroll to the bottom of the chat
|
|
76
|
+
(chat[0] as HTMLElement).scrollTo({
|
|
77
|
+
top: (chat[0] as HTMLElement).scrollHeight,
|
|
78
|
+
behavior: 'smooth',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}, [previewFiles]);
|
|
70
83
|
// Detect if the content is an image URL
|
|
71
84
|
const isImageContent = (content: string, type?: string): boolean => {
|
|
72
85
|
if (type === 'image') return true;
|
|
73
|
-
|
|
86
|
+
|
|
74
87
|
// Check if the content has image file extension or is an image URL
|
|
75
88
|
const hasImageExtension = /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(content);
|
|
76
|
-
const isImageUrl =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
const isImageUrl =
|
|
90
|
+
content.startsWith('http') &&
|
|
91
|
+
(content.includes('/image/') ||
|
|
92
|
+
content.includes('/img/') ||
|
|
93
|
+
hasImageExtension);
|
|
94
|
+
|
|
81
95
|
return isImageUrl || hasImageExtension;
|
|
82
96
|
};
|
|
83
97
|
|
|
84
98
|
return (
|
|
85
99
|
<>
|
|
86
100
|
{previewFiles.length > 0 && (
|
|
87
|
-
<div
|
|
88
|
-
className={`memori--preview-container ${
|
|
89
|
-
isMessagePreview
|
|
90
|
-
? 'memori--message-preview'
|
|
91
|
-
: 'memori--absolute-preview'
|
|
92
|
-
}`}
|
|
93
|
-
>
|
|
101
|
+
<div className="memori--preview-container">
|
|
94
102
|
<div className="memori--preview-list">
|
|
95
103
|
{previewFiles.map((file: any) => (
|
|
96
104
|
<div
|
|
97
105
|
key={file.id}
|
|
98
106
|
className={`memori--preview-item ${
|
|
99
|
-
isImageContent(file.content, file.type)
|
|
100
|
-
? 'memori--preview-item--image'
|
|
107
|
+
isImageContent(file.content, file.type)
|
|
108
|
+
? 'memori--preview-item--image'
|
|
101
109
|
: 'memori--preview-item--document'
|
|
102
110
|
}`}
|
|
103
111
|
onMouseEnter={() => setHoveredId(file.id)}
|
|
@@ -111,14 +119,14 @@ const FilePreview = ({
|
|
|
111
119
|
) : (
|
|
112
120
|
<DocumentIcon className="memori--preview-icon" />
|
|
113
121
|
)}
|
|
114
|
-
|
|
122
|
+
|
|
115
123
|
<div className="memori--preview-file-info">
|
|
116
124
|
<span className="memori--preview-filename">{file.name}</span>
|
|
117
125
|
<span className="memori--preview-filetype">
|
|
118
126
|
{getFileType(file.name, file.type)}
|
|
119
127
|
</span>
|
|
120
128
|
</div>
|
|
121
|
-
|
|
129
|
+
|
|
122
130
|
{allowRemove && (
|
|
123
131
|
<Button
|
|
124
132
|
shape="rounded"
|
|
@@ -138,7 +146,7 @@ const FilePreview = ({
|
|
|
138
146
|
</div>
|
|
139
147
|
</div>
|
|
140
148
|
)}
|
|
141
|
-
|
|
149
|
+
|
|
142
150
|
<Modal
|
|
143
151
|
width="80%"
|
|
144
152
|
widthMd="80%"
|
|
@@ -148,22 +156,27 @@ const FilePreview = ({
|
|
|
148
156
|
closable
|
|
149
157
|
title={selectedFile?.name}
|
|
150
158
|
>
|
|
151
|
-
<div
|
|
152
|
-
className="memori--preview-content"
|
|
153
|
-
style={{
|
|
154
|
-
maxHeight: '70vh',
|
|
159
|
+
<div
|
|
160
|
+
className="memori--preview-content"
|
|
161
|
+
style={{
|
|
162
|
+
maxHeight: '70vh',
|
|
155
163
|
overflowY: 'auto',
|
|
156
164
|
textAlign: 'center',
|
|
157
|
-
whiteSpace:
|
|
165
|
+
whiteSpace:
|
|
166
|
+
selectedFile &&
|
|
167
|
+
!isImageContent(selectedFile.content, selectedFile.type)
|
|
168
|
+
? 'pre-wrap'
|
|
169
|
+
: 'normal',
|
|
158
170
|
}}
|
|
159
171
|
>
|
|
160
|
-
{selectedFile &&
|
|
172
|
+
{selectedFile &&
|
|
173
|
+
isImageContent(selectedFile.content, selectedFile.type) ? (
|
|
161
174
|
<>
|
|
162
|
-
<img
|
|
163
|
-
src={selectedFile.content}
|
|
164
|
-
alt={selectedFile.name}
|
|
165
|
-
style={{ maxWidth: '100%', maxHeight: '60vh' }}
|
|
166
|
-
|
|
175
|
+
<img
|
|
176
|
+
src={selectedFile.content}
|
|
177
|
+
alt={selectedFile.name}
|
|
178
|
+
style={{ maxWidth: '100%', maxHeight: '60vh' }}
|
|
179
|
+
/>
|
|
167
180
|
</>
|
|
168
181
|
) : (
|
|
169
182
|
stripHTML(selectedFile?.content || '')
|
|
@@ -174,4 +187,4 @@ const FilePreview = ({
|
|
|
174
187
|
);
|
|
175
188
|
};
|
|
176
189
|
|
|
177
|
-
export default FilePreview;
|
|
190
|
+
export default FilePreview;
|
|
@@ -5,7 +5,7 @@ exports[`renders FilePreview unchanged 1`] = `<div />`;
|
|
|
5
5
|
exports[`renders FilePreview with one file 1`] = `
|
|
6
6
|
<div>
|
|
7
7
|
<div
|
|
8
|
-
class="memori--preview-container
|
|
8
|
+
class="memori--preview-container"
|
|
9
9
|
>
|
|
10
10
|
<div
|
|
11
11
|
class="memori--preview-list"
|
|
@@ -100,7 +100,7 @@ exports[`renders FilePreview with one file 1`] = `
|
|
|
100
100
|
exports[`renders FilePreview with two files 1`] = `
|
|
101
101
|
<div>
|
|
102
102
|
<div
|
|
103
|
-
class="memori--preview-container
|
|
103
|
+
class="memori--preview-container"
|
|
104
104
|
>
|
|
105
105
|
<div
|
|
106
106
|
class="memori--preview-list"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.memori-header {
|
|
2
2
|
position: relative;
|
|
3
|
-
z-index:
|
|
3
|
+
z-index: 1000;
|
|
4
4
|
width: calc(50% - 1rem);
|
|
5
5
|
height: 50px;
|
|
6
6
|
padding: calc(var(--memori-inner-content-pad) / 4) calc(var(--memori-inner-content-pad) / 2);
|
|
@@ -106,4 +106,4 @@
|
|
|
106
106
|
|
|
107
107
|
.memori-dropdown--avatar-initial:hover + .memori-dropdown--avatar-input,.memori-dropdown--avatar:hover + .memori-dropdown--avatar-input{
|
|
108
108
|
display: block;
|
|
109
|
-
}
|
|
109
|
+
}
|
|
@@ -4,7 +4,8 @@ import { memori, tenant, history } from '../../mocks/data';
|
|
|
4
4
|
import I18nWrapper from '../../I18nWrapper';
|
|
5
5
|
import Header, { Props } from './Header';
|
|
6
6
|
import SettingsDrawer from '../SettingsDrawer/SettingsDrawer';
|
|
7
|
-
import LoginDrawer from '../LoginDrawer/LoginDrawer';
|
|
7
|
+
import LoginDrawer from '../LoginDrawer/LoginDrawer';
|
|
8
|
+
import { ArtifactProvider } from '../MemoriArtifactSystem/context/ArtifactContext';
|
|
8
9
|
|
|
9
10
|
import './Header.css';
|
|
10
11
|
|
|
@@ -37,6 +38,7 @@ const Template: Story<Props> = args => {
|
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
40
|
<I18nWrapper>
|
|
41
|
+
<ArtifactProvider>
|
|
40
42
|
<Header
|
|
41
43
|
{...args}
|
|
42
44
|
speakerMuted={speakerMuted}
|
|
@@ -62,6 +64,7 @@ const Template: Story<Props> = args => {
|
|
|
62
64
|
setEnablePositionControls={() => {}}
|
|
63
65
|
/>
|
|
64
66
|
<LoginDrawer
|
|
67
|
+
setUser={() => {}}
|
|
65
68
|
tenant={tenant}
|
|
66
69
|
open={!!showLoginDrawer}
|
|
67
70
|
onClose={() => setShowLoginDrawer(false)}
|
|
@@ -76,6 +79,7 @@ const Template: Story<Props> = args => {
|
|
|
76
79
|
} as any
|
|
77
80
|
}
|
|
78
81
|
/>
|
|
82
|
+
</ArtifactProvider>
|
|
79
83
|
</I18nWrapper>
|
|
80
84
|
);
|
|
81
85
|
};
|
|
@@ -290,7 +290,7 @@ const Header: React.FC<Props> = ({
|
|
|
290
290
|
<Button
|
|
291
291
|
primary
|
|
292
292
|
shape="circle"
|
|
293
|
-
className=
|
|
293
|
+
className={cx('memori-header--button memori-header--button--speaker', { 'memori-header--button--speaker-muted': speakerMuted })}
|
|
294
294
|
icon={speakerMuted ? <SoundDeactivated /> : <Sound />}
|
|
295
295
|
onClick={() => setSpeakerMuted(!speakerMuted)}
|
|
296
296
|
title={t('widget.sound') || 'Sound'}
|