@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,40 +1,320 @@
|
|
|
1
|
+
.memori-chat-inputs-wrapper {
|
|
2
|
+
position: sticky;
|
|
3
|
+
z-index: 10;
|
|
4
|
+
bottom: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: 0;
|
|
7
|
+
padding-bottom: 1.5rem;
|
|
8
|
+
margin: 0;
|
|
9
|
+
/* background: linear-gradient(to top, rgba(255, 255, 255, 0.8) 0%, transparent 100%); */
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
.memori-chat-inputs {
|
|
2
13
|
position: relative;
|
|
3
14
|
display: flex;
|
|
4
15
|
width: 100%;
|
|
16
|
+
min-width: 97%;
|
|
17
|
+
max-width: 97%;
|
|
5
18
|
box-sizing: border-box;
|
|
19
|
+
flex-flow: column;
|
|
6
20
|
flex-shrink: 0;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
21
|
padding: 0;
|
|
22
|
+
padding: 8px 12px !important;
|
|
10
23
|
border: none;
|
|
24
|
+
border-radius: 12px;
|
|
11
25
|
margin: 0;
|
|
12
|
-
|
|
26
|
+
margin: auto;
|
|
27
|
+
background: white;
|
|
28
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.memori-chat-inputs:disabled {
|
|
32
|
+
opacity: 0.5;
|
|
33
|
+
pointer-events: none;
|
|
13
34
|
}
|
|
14
35
|
|
|
15
|
-
.memori-chat-inputs--
|
|
16
|
-
|
|
17
|
-
|
|
36
|
+
.memori-chat-inputs--container {
|
|
37
|
+
position: relative;
|
|
38
|
+
display: grid;
|
|
39
|
+
width: 100%;
|
|
40
|
+
/* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
|
|
41
|
+
min-height: 56px;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
align-items: center;
|
|
44
|
+
padding: 0 1rem;
|
|
45
|
+
padding: 12px;
|
|
46
|
+
border-radius: var(--memori-border-radius);
|
|
47
|
+
/* max-width: 48rem; */
|
|
48
|
+
margin: 0 auto;
|
|
49
|
+
background: #fff;
|
|
50
|
+
gap: 0;
|
|
51
|
+
grid-template-areas: 'leading primary trailing';
|
|
52
|
+
grid-template-columns: auto 1fr auto;
|
|
18
53
|
}
|
|
19
54
|
|
|
20
55
|
/* Responsive adjustments */
|
|
21
56
|
@media (max-width: 768px) {
|
|
22
|
-
.memori-chat-inputs {
|
|
57
|
+
.memori-chat-inputs--container {
|
|
58
|
+
padding: 0 0.5rem;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (max-width: 480px) {
|
|
63
|
+
.memori-chat-inputs--container {
|
|
23
64
|
padding: 0 0.25rem;
|
|
24
65
|
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.memori-chat-inputs--leading {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
padding-right: 6px;
|
|
72
|
+
grid-area: leading;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.memori-chat-inputs--primary {
|
|
76
|
+
display: flex;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
min-height: 36px;
|
|
79
|
+
align-items: center;
|
|
80
|
+
grid-area: primary;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.memori-chat-inputs--trailing {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
padding-left: 8px;
|
|
87
|
+
grid-area: trailing;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.memori-chat-inputs--trailing-inner {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: 12px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Plus button styling */
|
|
97
|
+
.memori-chat-inputs--upload-wrapper {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.memori-chat-inputs--upload-wrapper .memori--unified-upload-wrapper {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.memori-chat-inputs--upload-wrapper .memori-button {
|
|
108
|
+
display: flex;
|
|
109
|
+
width: 20px;
|
|
110
|
+
min-width: 20px;
|
|
111
|
+
height: 20px;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
padding: 0;
|
|
115
|
+
border: none !important;
|
|
116
|
+
background: transparent !important;
|
|
117
|
+
box-shadow: none !important;
|
|
118
|
+
color: #000 !important;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
transition: opacity 0.2s ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.memori-chat-inputs--upload-wrapper .memori-button:hover {
|
|
124
|
+
background: transparent !important;
|
|
125
|
+
opacity: 0.7;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.memori-chat-inputs--upload-wrapper .memori-button:disabled {
|
|
129
|
+
cursor: not-allowed;
|
|
130
|
+
opacity: 0.3;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Icon class styling */
|
|
134
|
+
.memori-chat-inputs--container .icon {
|
|
135
|
+
width: 20px;
|
|
136
|
+
height: 20px;
|
|
137
|
+
flex-shrink: 0;
|
|
138
|
+
fill: currentColor;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Microphone button styling */
|
|
142
|
+
.memori-chat-inputs--mic-btn {
|
|
143
|
+
display: flex;
|
|
144
|
+
width: 20px;
|
|
145
|
+
min-width: 20px;
|
|
146
|
+
height: 20px;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
padding: 0;
|
|
150
|
+
border: none;
|
|
151
|
+
background: transparent;
|
|
152
|
+
color: #000;
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
transition: opacity 0.2s ease;
|
|
155
|
+
}
|
|
25
156
|
|
|
26
|
-
|
|
27
|
-
|
|
157
|
+
.memori-chat-inputs--mic-btn:hover {
|
|
158
|
+
opacity: 0.7;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.memori-chat-inputs--mic-btn:disabled {
|
|
162
|
+
cursor: not-allowed;
|
|
163
|
+
opacity: 0.3;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.memori-chat-inputs--mic-btn svg,
|
|
167
|
+
.memori-chat-inputs--mic-btn .icon {
|
|
168
|
+
width: 20px;
|
|
169
|
+
height: 20px;
|
|
170
|
+
fill: #000;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Ensure icons are black on white background */
|
|
174
|
+
.memori-chat-inputs--leading .icon {
|
|
175
|
+
fill: #000;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.memori-chat-inputs--send-btn svg {
|
|
179
|
+
width: 20px;
|
|
180
|
+
height: 20px;
|
|
181
|
+
fill: #fff;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.memori-chat-inputs--send-btn .icon {
|
|
185
|
+
width: 20px;
|
|
186
|
+
height: 20px;
|
|
187
|
+
fill: #fff;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.memori-chat-inputs--upload-wrapper .memori-button svg,
|
|
191
|
+
.memori-chat-inputs--upload-wrapper .memori-button .icon {
|
|
192
|
+
width: 20px;
|
|
193
|
+
height: 20px;
|
|
194
|
+
/* fill: #000; */
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.memori-chat-inputs--trailing .memori-chat-inputs--mic-btn .icon {
|
|
198
|
+
fill: #000;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.memori-chat-inputs--mic-btn--listening {
|
|
202
|
+
color: #10a37f;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.memori-chat-inputs--mic {
|
|
206
|
+
font-size: 125%;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* Style MicrophoneButton component when used in trailing area */
|
|
210
|
+
.memori-chat-inputs--trailing .memori-chat-inputs--mic {
|
|
211
|
+
width: 20px;
|
|
212
|
+
min-width: 20px;
|
|
213
|
+
height: 20px;
|
|
214
|
+
padding: 0;
|
|
215
|
+
border: none;
|
|
216
|
+
background: transparent;
|
|
217
|
+
color: #000;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.memori-chat-inputs--trailing .memori-chat-inputs--mic .memori-button {
|
|
221
|
+
width: 20px;
|
|
222
|
+
min-width: 20px;
|
|
223
|
+
height: 20px;
|
|
224
|
+
padding: 0;
|
|
225
|
+
border: none;
|
|
226
|
+
background: transparent;
|
|
227
|
+
color: #000;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Send button styling - ChatGPT style */
|
|
231
|
+
.memori-chat-inputs--send-btn {
|
|
232
|
+
display: flex;
|
|
233
|
+
width: 32px;
|
|
234
|
+
min-width: 32px;
|
|
235
|
+
height: 32px;
|
|
236
|
+
flex-shrink: 0;
|
|
237
|
+
align-items: center;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
padding: 0;
|
|
240
|
+
padding: 1.2rem !important;
|
|
241
|
+
border: none;
|
|
242
|
+
border-radius: var(--memori-border-radius);
|
|
243
|
+
background: #000;
|
|
244
|
+
background: var(--memori-chat-user-bubble-bg);
|
|
245
|
+
color: #fff;
|
|
246
|
+
cursor: pointer;
|
|
247
|
+
transition: all 0.2s ease;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.memori-chat-inputs--send-btn:disabled {
|
|
251
|
+
/* background: #f4f4f4; */
|
|
252
|
+
color: #f4f4f4;
|
|
253
|
+
cursor: not-allowed;
|
|
254
|
+
opacity: 0.3;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.memori-chat-inputs--send-btn:hover:not(:disabled) {
|
|
258
|
+
opacity: 0.7;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.memori-chat-inputs--trailing .memori-chat-inputs--mic svg {
|
|
262
|
+
width: 20px;
|
|
263
|
+
height: 20px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.memori-chat-inputs--send-btn--active {
|
|
267
|
+
/* background: #000; */
|
|
268
|
+
color: #fff;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.memori-chat-inputs--send-btn--loading {
|
|
272
|
+
width: 16px;
|
|
273
|
+
height: 16px;
|
|
274
|
+
border: 2px solid currentColor;
|
|
275
|
+
border-radius: var(--memori-border-radius);
|
|
276
|
+
border-top-color: transparent;
|
|
277
|
+
animation: spin 0.8s linear infinite;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@keyframes spin {
|
|
281
|
+
to {
|
|
282
|
+
transform: rotate(360deg);
|
|
28
283
|
}
|
|
29
284
|
}
|
|
30
285
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
286
|
+
/* Disclaimer styling */
|
|
287
|
+
.memori-chat-inputs--disclaimer {
|
|
288
|
+
display: flex;
|
|
289
|
+
min-height: 32px;
|
|
290
|
+
align-items: center;
|
|
291
|
+
justify-content: center;
|
|
292
|
+
padding: 8px 60px;
|
|
293
|
+
margin-top: -4px;
|
|
294
|
+
color: rgba(0, 0, 0, 0.6);
|
|
295
|
+
font-size: 12px;
|
|
296
|
+
line-height: 1.5;
|
|
297
|
+
text-align: center;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.memori-chat-inputs--disclaimer a {
|
|
301
|
+
color: rgba(0, 0, 0, 0.8);
|
|
302
|
+
cursor: pointer;
|
|
303
|
+
text-decoration: underline;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.memori-chat-inputs--disclaimer a:hover {
|
|
307
|
+
opacity: 0.8;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
@media (max-width: 768px) {
|
|
311
|
+
.memori-chat-inputs--disclaimer {
|
|
312
|
+
padding: 8px 16px;
|
|
34
313
|
}
|
|
35
314
|
}
|
|
36
315
|
|
|
37
|
-
|
|
316
|
+
/* Legacy support for old button classes */
|
|
317
|
+
.memori-chat-inputs .memori-upload-menu + .memori-send-on-enter-menu {
|
|
38
318
|
margin-left: 0.33rem;
|
|
39
319
|
}
|
|
40
320
|
|
|
@@ -42,7 +322,3 @@
|
|
|
42
322
|
background: #fff;
|
|
43
323
|
color: #000;
|
|
44
324
|
}
|
|
45
|
-
|
|
46
|
-
.memori-chat-inputs--mic {
|
|
47
|
-
font-size: 125%;
|
|
48
|
-
}
|
|
@@ -10,6 +10,7 @@ import Microphone from '../icons/Microphone';
|
|
|
10
10
|
import UploadButton from '../UploadButton/UploadButton';
|
|
11
11
|
import FilePreview from '../FilePreview/FilePreview';
|
|
12
12
|
import memoriApiClient from '@memori.ai/memori-api-client';
|
|
13
|
+
import Plus from '../icons/Plus';
|
|
13
14
|
export interface Props {
|
|
14
15
|
dialogState?: DialogState;
|
|
15
16
|
instruct?: boolean;
|
|
@@ -31,6 +32,7 @@ export interface Props {
|
|
|
31
32
|
microphoneMode?: 'CONTINUOUS' | 'HOLD_TO_TALK';
|
|
32
33
|
authToken?: string;
|
|
33
34
|
showUpload?: boolean;
|
|
35
|
+
isTyping?: boolean;
|
|
34
36
|
sessionID?: string;
|
|
35
37
|
memoriID?: string;
|
|
36
38
|
client?: ReturnType<typeof memoriApiClient>;
|
|
@@ -52,6 +54,7 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
52
54
|
startListening,
|
|
53
55
|
stopListening,
|
|
54
56
|
showUpload = false,
|
|
57
|
+
isTyping = false,
|
|
55
58
|
sessionID,
|
|
56
59
|
authToken,
|
|
57
60
|
memoriID,
|
|
@@ -95,8 +98,14 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
95
98
|
url?: string;
|
|
96
99
|
}[]
|
|
97
100
|
) => {
|
|
101
|
+
if (isTyping) return;
|
|
102
|
+
|
|
98
103
|
const mediaWithIds = files.map((file, index) => {
|
|
99
|
-
const generatedMediumID =
|
|
104
|
+
const generatedMediumID =
|
|
105
|
+
file.mediumID ||
|
|
106
|
+
`file_${Date.now()}_${index}_${Math.random()
|
|
107
|
+
.toString(36)
|
|
108
|
+
.substr(2, 9)}`;
|
|
100
109
|
return {
|
|
101
110
|
mediumID: generatedMediumID,
|
|
102
111
|
mimeType: file.mimeType,
|
|
@@ -107,7 +116,7 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
107
116
|
url: file.url,
|
|
108
117
|
};
|
|
109
118
|
});
|
|
110
|
-
|
|
119
|
+
|
|
111
120
|
sendMessage(userMessage, mediaWithIds);
|
|
112
121
|
|
|
113
122
|
// Reset states after sending
|
|
@@ -119,11 +128,23 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
119
128
|
/**
|
|
120
129
|
* Handles enter key press in textarea
|
|
121
130
|
*/
|
|
122
|
-
const onTextareaPressEnter = (
|
|
131
|
+
const onTextareaPressEnter = (
|
|
132
|
+
e: React.KeyboardEvent<HTMLTextAreaElement>
|
|
133
|
+
) => {
|
|
134
|
+
// Prevent default newline on Enter to keep behavior consistent
|
|
135
|
+
e.preventDefault();
|
|
136
|
+
|
|
137
|
+
// While the agent is typing, ignore Enter (no send, no newline)
|
|
138
|
+
if (isTyping) return;
|
|
139
|
+
|
|
123
140
|
if (sendOnEnter === 'keypress' && userMessage?.length > 0) {
|
|
124
141
|
stopListening();
|
|
125
142
|
const mediaWithIds = documentPreviewFiles.map((file, index) => {
|
|
126
|
-
const generatedMediumID =
|
|
143
|
+
const generatedMediumID =
|
|
144
|
+
file.mediumID ||
|
|
145
|
+
`file_${Date.now()}_${index}_${Math.random()
|
|
146
|
+
.toString(36)
|
|
147
|
+
.substr(2, 9)}`;
|
|
127
148
|
return {
|
|
128
149
|
mediumID: generatedMediumID,
|
|
129
150
|
mimeType: file.mimeType,
|
|
@@ -134,7 +155,7 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
134
155
|
url: file.url,
|
|
135
156
|
};
|
|
136
157
|
});
|
|
137
|
-
|
|
158
|
+
|
|
138
159
|
sendMessage(userMessage, mediaWithIds);
|
|
139
160
|
|
|
140
161
|
setDocumentPreviewFiles([]);
|
|
@@ -175,93 +196,142 @@ const ChatInputs: React.FC<Props> = ({
|
|
|
175
196
|
}
|
|
176
197
|
};
|
|
177
198
|
|
|
199
|
+
const isDisabled =
|
|
200
|
+
dialogState?.state === 'X2a' || dialogState?.state === 'X3';
|
|
201
|
+
const textareaDisabled = ['R2', 'R3', 'R4', 'R5', 'G3', 'X3'].includes(
|
|
202
|
+
dialogState?.state || ''
|
|
203
|
+
);
|
|
204
|
+
|
|
178
205
|
return (
|
|
179
|
-
<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
'memori-chat-inputs
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
onPressEnter={onTextareaPressEnter}
|
|
190
|
-
onFocus={onTextareaFocus}
|
|
191
|
-
onBlur={onTextareaBlur}
|
|
192
|
-
onExpandedChange={handleTextareaExpanded}
|
|
193
|
-
disabled={['R2', 'R3', 'R4', 'R5', 'G3', 'X3'].includes(
|
|
194
|
-
dialogState?.state || ''
|
|
195
|
-
)}
|
|
196
|
-
/>
|
|
197
|
-
{/* Preview for document files */}
|
|
198
|
-
{showUpload && (
|
|
199
|
-
<>
|
|
206
|
+
<div className="memori-chat-inputs-wrapper">
|
|
207
|
+
<fieldset
|
|
208
|
+
id="chat-fieldset"
|
|
209
|
+
className={cx('memori-chat-inputs', {
|
|
210
|
+
'memori-chat-inputs--expanded': isExpanded,
|
|
211
|
+
})}
|
|
212
|
+
disabled={isDisabled}
|
|
213
|
+
>
|
|
214
|
+
{/* Preview for document files */}
|
|
215
|
+
{showUpload && (
|
|
200
216
|
<FilePreview
|
|
201
217
|
previewFiles={documentPreviewFiles}
|
|
202
218
|
removeFile={removeFile}
|
|
203
219
|
/>
|
|
220
|
+
)}
|
|
221
|
+
<div className="memori-chat-inputs--container">
|
|
222
|
+
{/* Leading area - Plus button */}
|
|
223
|
+
<div className="memori-chat-inputs--leading">
|
|
224
|
+
{showUpload && (
|
|
225
|
+
<div className="memori-chat-inputs--upload-wrapper">
|
|
226
|
+
<UploadButton
|
|
227
|
+
authToken={authToken}
|
|
228
|
+
client={client}
|
|
229
|
+
sessionID={sessionID}
|
|
230
|
+
isMediaAccepted={dialogState?.acceptsMedia || false}
|
|
231
|
+
setDocumentPreviewFiles={setDocumentPreviewFiles}
|
|
232
|
+
documentPreviewFiles={documentPreviewFiles}
|
|
233
|
+
memoriID={memoriID}
|
|
234
|
+
/>
|
|
235
|
+
</div>
|
|
236
|
+
)}
|
|
237
|
+
</div>
|
|
204
238
|
|
|
205
|
-
{/*
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
239
|
+
{/* Primary area - Textarea */}
|
|
240
|
+
<div className="memori-chat-inputs--primary">
|
|
241
|
+
<ChatTextArea
|
|
242
|
+
value={userMessage}
|
|
243
|
+
onChange={onChangeUserMessage}
|
|
244
|
+
onPressEnter={onTextareaPressEnter}
|
|
245
|
+
onFocus={onTextareaFocus}
|
|
246
|
+
onBlur={onTextareaBlur}
|
|
247
|
+
onExpandedChange={handleTextareaExpanded}
|
|
248
|
+
disabled={textareaDisabled}
|
|
249
|
+
/>
|
|
250
|
+
</div>
|
|
251
|
+
|
|
252
|
+
{/* Trailing area - Microphone and Send button */}
|
|
253
|
+
<div className="memori-chat-inputs--trailing">
|
|
254
|
+
<div className="memori-chat-inputs--trailing-inner">
|
|
255
|
+
{showMicrophone && microphoneMode === 'CONTINUOUS' && (
|
|
256
|
+
<button
|
|
257
|
+
type="button"
|
|
258
|
+
className={cx('memori-chat-inputs--mic-btn', {
|
|
259
|
+
'memori-chat-inputs--mic-btn--listening': listening,
|
|
260
|
+
})}
|
|
261
|
+
title={
|
|
262
|
+
listening
|
|
263
|
+
? t('write_and_speak.micButtonPopoverListening') ||
|
|
264
|
+
'Listening'
|
|
265
|
+
: t('write_and_speak.micButtonPopover') ||
|
|
266
|
+
'Start listening'
|
|
267
|
+
}
|
|
268
|
+
onClick={() => {
|
|
269
|
+
if (listening) {
|
|
270
|
+
stopListening();
|
|
271
|
+
} else {
|
|
272
|
+
stopAudio();
|
|
273
|
+
startListening();
|
|
274
|
+
}
|
|
275
|
+
}}
|
|
276
|
+
disabled={isDisabled}
|
|
277
|
+
aria-label={
|
|
278
|
+
listening
|
|
279
|
+
? t('write_and_speak.micButtonPopoverListening') ||
|
|
280
|
+
'Listening'
|
|
281
|
+
: t('write_and_speak.micButtonPopover') ||
|
|
282
|
+
'Start listening'
|
|
283
|
+
}
|
|
284
|
+
>
|
|
285
|
+
<Microphone className="icon" />
|
|
286
|
+
</button>
|
|
287
|
+
)}
|
|
288
|
+
{showMicrophone && microphoneMode === 'HOLD_TO_TALK' && (
|
|
289
|
+
<MicrophoneButton
|
|
290
|
+
listening={listening}
|
|
291
|
+
startListening={startListening}
|
|
292
|
+
stopListening={() => {
|
|
293
|
+
stopListening();
|
|
294
|
+
if (listening && !!userMessage?.length) {
|
|
295
|
+
sendMessage(userMessage);
|
|
296
|
+
}
|
|
297
|
+
}}
|
|
298
|
+
stopAudio={stopAudio}
|
|
299
|
+
/>
|
|
300
|
+
)}
|
|
301
|
+
<button
|
|
302
|
+
type="button"
|
|
303
|
+
className={cx('memori-chat-inputs--send-btn', {
|
|
304
|
+
'memori-chat-inputs--send-btn--active': !!userMessage?.length,
|
|
305
|
+
'memori-chat-inputs--send-btn--disabled':
|
|
306
|
+
!userMessage || userMessage.length === 0,
|
|
307
|
+
})}
|
|
308
|
+
onClick={() => {
|
|
309
|
+
onSendMessage(documentPreviewFiles);
|
|
310
|
+
}}
|
|
311
|
+
disabled={!userMessage || userMessage.length === 0 || isTyping}
|
|
312
|
+
title={t('send') || 'Send'}
|
|
313
|
+
aria-label={t('send') || 'Send'}
|
|
314
|
+
>
|
|
315
|
+
{isTyping ? (
|
|
316
|
+
<div className="memori-chat-inputs--send-btn--loading" />
|
|
317
|
+
) : (
|
|
318
|
+
<Send className="icon" />
|
|
319
|
+
)}
|
|
320
|
+
</button>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
</fieldset>
|
|
325
|
+
{/* Disclaimer */}
|
|
326
|
+
{/* <div className="memori-chat-inputs--disclaimer">
|
|
327
|
+
<div>
|
|
328
|
+
{t(
|
|
329
|
+
'chat.disclaimer',
|
|
330
|
+
'AIsuru può commettere errori. Assicurati di verificare le informazioni importanti.'
|
|
331
|
+
)}
|
|
332
|
+
</div>
|
|
333
|
+
</div> */}
|
|
334
|
+
</div>
|
|
265
335
|
);
|
|
266
336
|
};
|
|
267
337
|
|