@memori.ai/memori-react 8.12.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 +24 -0
- package/dist/components/Chat/Chat.css +37 -3
- package/dist/components/Chat/Chat.js +60 -22
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.css +9 -5
- package/dist/components/ChatBubble/ChatBubble.js +54 -11
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.css +293 -17
- package/dist/components/ChatInputs/ChatInputs.js +41 -25
- 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/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/MediaWidget/MediaItemWidget.js +2 -1
- package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/dist/components/MediaWidget/MediaWidget.css +0 -4
- package/dist/components/MemoriWidget/MemoriWidget.css +11 -2
- package/dist/components/MemoriWidget/MemoriWidget.js +41 -5
- 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 -89
- 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/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 +7 -4
- package/dist/locales/en.json +8 -5
- package/dist/locales/es.json +7 -4
- package/dist/locales/fr.json +7 -4
- package/dist/locales/it.json +8 -5
- package/dist/styles.css +1 -2
- package/esm/components/Chat/Chat.css +37 -3
- package/esm/components/Chat/Chat.js +60 -22
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.css +9 -5
- package/esm/components/ChatBubble/ChatBubble.js +54 -11
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.css +293 -17
- package/esm/components/ChatInputs/ChatInputs.js +42 -26
- 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/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/MediaWidget/MediaItemWidget.js +2 -1
- package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -1
- package/esm/components/MediaWidget/MediaWidget.css +0 -4
- package/esm/components/MemoriWidget/MemoriWidget.css +11 -2
- package/esm/components/MemoriWidget/MemoriWidget.js +41 -5
- 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 -90
- 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/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 +7 -4
- package/esm/locales/en.json +8 -5
- package/esm/locales/es.json +7 -4
- package/esm/locales/fr.json +7 -4
- package/esm/locales/it.json +8 -5
- package/esm/styles.css +1 -2
- package/package.json +1 -1
- package/src/components/Chat/Chat.css +37 -3
- package/src/components/Chat/Chat.tsx +89 -21
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +672 -732
- package/src/components/ChatBubble/ChatBubble.css +9 -5
- package/src/components/ChatBubble/ChatBubble.tsx +111 -20
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +4 -4
- package/src/components/ChatInputs/ChatInputs.css +293 -17
- package/src/components/ChatInputs/ChatInputs.tsx +144 -87
- 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/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/MediaWidget/MediaItemWidget.tsx +2 -1
- package/src/components/MediaWidget/MediaWidget.css +0 -4
- package/src/components/MemoriWidget/MemoriWidget.css +11 -2
- package/src/components/MemoriWidget/MemoriWidget.tsx +61 -12
- 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 -175
- package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +19 -4
- package/src/components/UploadButton/UploadImages/UploadImages.tsx +195 -35
- package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +10 -1
- package/src/components/layouts/chat.css +1 -1
- package/src/helpers/constants.ts +1 -1
- package/src/helpers/imageCompression.ts +230 -0
- package/src/locales/de.json +7 -4
- package/src/locales/en.json +8 -5
- package/src/locales/es.json +7 -4
- package/src/locales/fr.json +7 -4
- package/src/locales/it.json +8 -5
- package/src/styles.css +1 -2
- 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
|
@@ -4,30 +4,59 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
-
const Button_1 = tslib_1.__importDefault(require("../ui/Button"));
|
|
8
|
-
const Expand_1 = tslib_1.__importDefault(require("../icons/Expand"));
|
|
9
|
-
const FullscreenExit_1 = tslib_1.__importDefault(require("../icons/FullscreenExit"));
|
|
10
7
|
const react_i18next_1 = require("react-i18next");
|
|
11
8
|
const ChatTextArea = ({ disabled = false, value, onChange, onPressEnter, onFocus, onBlur, onExpandedChange, }) => {
|
|
12
9
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const textareaRef = (0, react_1.useRef)(null);
|
|
11
|
+
const innerRef = (0, react_1.useRef)(null);
|
|
12
|
+
const MIN_HEIGHT = 36;
|
|
13
|
+
const MAX_HEIGHT = 208;
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
const textarea = textareaRef.current;
|
|
16
|
+
const inner = innerRef.current;
|
|
17
|
+
if (textarea && inner) {
|
|
18
|
+
if (value.length === 0) {
|
|
19
|
+
textarea.style.height = `${MIN_HEIGHT}px`;
|
|
20
|
+
inner.style.height = `${MIN_HEIGHT}px`;
|
|
21
|
+
if (onExpandedChange) {
|
|
22
|
+
onExpandedChange(false);
|
|
23
|
+
}
|
|
24
|
+
const chat = document.getElementsByClassName('memori-chat--content');
|
|
25
|
+
if (chat) {
|
|
26
|
+
const lastChild = chat[chat.length - 1];
|
|
27
|
+
if (lastChild) {
|
|
28
|
+
lastChild.style.paddingBottom = '0px';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
textarea.style.height = 'auto';
|
|
34
|
+
const scrollHeight = textarea.scrollHeight;
|
|
35
|
+
const newHeight = Math.min(Math.max(scrollHeight, MIN_HEIGHT), MAX_HEIGHT);
|
|
36
|
+
textarea.style.height = `${newHeight}px`;
|
|
37
|
+
inner.style.height = `${newHeight}px`;
|
|
38
|
+
const chat = document.getElementsByClassName('memori-chat--content');
|
|
39
|
+
if (chat) {
|
|
40
|
+
const lastChild = chat[chat.length - 1];
|
|
41
|
+
if (lastChild) {
|
|
42
|
+
chat[0].scrollTo({
|
|
43
|
+
top: chat[0].scrollHeight,
|
|
44
|
+
behavior: 'smooth'
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
19
49
|
}
|
|
20
|
-
};
|
|
50
|
+
}, [value]);
|
|
21
51
|
return ((0, jsx_runtime_1.jsx)("div", { "data-testid": "chat-textarea", className: (0, classnames_1.default)('memori-chat-textarea', {
|
|
22
|
-
'memori-chat-textarea--expanded': expanded,
|
|
23
52
|
'memori-chat-textarea--disabled': disabled,
|
|
24
|
-
}), children: (0, jsx_runtime_1.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
53
|
+
}), children: (0, jsx_runtime_1.jsx)("div", { ref: innerRef, className: "memori-chat-textarea--inner", children: (0, jsx_runtime_1.jsx)("textarea", { ref: textareaRef, className: "memori-chat-textarea--input", disabled: disabled, value: value, placeholder: t('placeholder', 'Ask a question') || 'Ask a question', onChange: e => {
|
|
54
|
+
onChange(e.target.value);
|
|
55
|
+
}, onKeyDownCapture: e => {
|
|
56
|
+
if (e.key === 'Enter' && !e.shiftKey && onPressEnter) {
|
|
57
|
+
onPressEnter(e);
|
|
58
|
+
}
|
|
59
|
+
}, onFocus: onFocus, onBlur: onBlur, maxLength: 100000 }) }) }));
|
|
31
60
|
};
|
|
32
61
|
exports.default = ChatTextArea;
|
|
33
62
|
//# sourceMappingURL=ChatTextArea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatTextArea.js","sourceRoot":"","sources":["../../../src/components/ChatTextArea/ChatTextArea.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"ChatTextArea.js","sourceRoot":"","sources":["../../../src/components/ChatTextArea/ChatTextArea.tsx"],"names":[],"mappings":";;;;AAAA,iCAA2D;AAC3D,oEAA4B;AAI5B,iDAA+C;AAY/C,MAAM,YAAY,GAAoB,CAAC,EACrC,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,O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ACjB;gBACH,CAAC,EACD,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GACjB,GACE,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
|
|
@@ -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
|
+
}
|
|
@@ -3,7 +3,6 @@ type FilePreviewProps = {
|
|
|
3
3
|
previewFiles: any;
|
|
4
4
|
removeFile: (id: string, mediumID: string | undefined) => void;
|
|
5
5
|
allowRemove?: boolean;
|
|
6
|
-
isMessagePreview?: boolean;
|
|
7
6
|
};
|
|
8
|
-
declare const FilePreview: ({ previewFiles, removeFile, allowRemove,
|
|
7
|
+
declare const FilePreview: ({ previewFiles, removeFile, allowRemove, }: FilePreviewProps) => JSX.Element;
|
|
9
8
|
export default FilePreview;
|
|
@@ -8,7 +8,7 @@ const Close_1 = tslib_1.__importDefault(require("../icons/Close"));
|
|
|
8
8
|
const Button_1 = tslib_1.__importDefault(require("../ui/Button"));
|
|
9
9
|
const Modal_1 = tslib_1.__importDefault(require("../ui/Modal"));
|
|
10
10
|
const utils_1 = require("../../helpers/utils");
|
|
11
|
-
const FilePreview = ({ previewFiles, removeFile, allowRemove = true,
|
|
11
|
+
const FilePreview = ({ previewFiles, removeFile, allowRemove = true, }) => {
|
|
12
12
|
const [selectedFile, setSelectedFile] = (0, react_1.useState)(null);
|
|
13
13
|
const [hoveredId, setHoveredId] = (0, react_1.useState)(null);
|
|
14
14
|
const getFileType = (filename, type) => {
|
|
@@ -46,6 +46,18 @@ const FilePreview = ({ previewFiles, removeFile, allowRemove = true, isMessagePr
|
|
|
46
46
|
return 'Document';
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
(0, react_1.useEffect)(() => {
|
|
50
|
+
const chat = document.getElementsByClassName('memori-chat--content');
|
|
51
|
+
if (chat) {
|
|
52
|
+
const lastChild = chat[chat.length - 1];
|
|
53
|
+
if (lastChild) {
|
|
54
|
+
chat[0].scrollTo({
|
|
55
|
+
top: chat[0].scrollHeight,
|
|
56
|
+
behavior: 'smooth',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}, [previewFiles]);
|
|
49
61
|
const isImageContent = (content, type) => {
|
|
50
62
|
if (type === 'image')
|
|
51
63
|
return true;
|
|
@@ -56,9 +68,7 @@ const FilePreview = ({ previewFiles, removeFile, allowRemove = true, isMessagePr
|
|
|
56
68
|
hasImageExtension);
|
|
57
69
|
return isImageUrl || hasImageExtension;
|
|
58
70
|
};
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [previewFiles.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: `memori--preview-
|
|
60
|
-
? 'memori--message-preview'
|
|
61
|
-
: 'memori--absolute-preview'}`, children: (0, jsx_runtime_1.jsx)("div", { className: "memori--preview-list", children: previewFiles.map((file) => ((0, jsx_runtime_1.jsxs)("div", { className: `memori--preview-item ${isImageContent(file.content, file.type)
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [previewFiles.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "memori--preview-container", children: (0, jsx_runtime_1.jsx)("div", { className: "memori--preview-list", children: previewFiles.map((file) => ((0, jsx_runtime_1.jsxs)("div", { className: `memori--preview-item ${isImageContent(file.content, file.type)
|
|
62
72
|
? 'memori--preview-item--image'
|
|
63
73
|
: 'memori--preview-item--document'}`, onMouseEnter: () => setHoveredId(file.id), onMouseLeave: () => setHoveredId(null), onClick: () => setSelectedFile(file), children: [isImageContent(file.content, file.type) ? ((0, jsx_runtime_1.jsx)("div", { className: "memori--preview-thumbnail", children: (0, jsx_runtime_1.jsx)("img", { src: file.content, alt: file.name }) })) : ((0, jsx_runtime_1.jsx)(Document_1.DocumentIcon, { className: "memori--preview-icon" })), (0, jsx_runtime_1.jsxs)("div", { className: "memori--preview-file-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori--preview-filename", children: file.name }), (0, jsx_runtime_1.jsx)("span", { className: "memori--preview-filetype", children: getFileType(file.name, file.type) })] }), allowRemove && ((0, jsx_runtime_1.jsx)(Button_1.default, { shape: "rounded", icon: (0, jsx_runtime_1.jsx)(Close_1.default, {}), danger: true, className: `memori--remove-button ${hoveredId === file.id ? 'visible' : ''}`, onClick: e => {
|
|
64
74
|
e.stopPropagation();
|
|
@@ -67,8 +77,12 @@ const FilePreview = ({ previewFiles, removeFile, allowRemove = true, isMessagePr
|
|
|
67
77
|
maxHeight: '70vh',
|
|
68
78
|
overflowY: 'auto',
|
|
69
79
|
textAlign: 'center',
|
|
70
|
-
whiteSpace: selectedFile &&
|
|
71
|
-
|
|
80
|
+
whiteSpace: selectedFile &&
|
|
81
|
+
!isImageContent(selectedFile.content, selectedFile.type)
|
|
82
|
+
? 'pre-wrap'
|
|
83
|
+
: 'normal',
|
|
84
|
+
}, children: selectedFile &&
|
|
85
|
+
isImageContent(selectedFile.content, selectedFile.type) ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("img", { src: selectedFile.content, alt: selectedFile.name, style: { maxWidth: '100%', maxHeight: '60vh' } }) })) : ((0, utils_1.stripHTML)((selectedFile === null || selectedFile === void 0 ? void 0 : selectedFile.content) || '')) }) })] }));
|
|
72
86
|
};
|
|
73
87
|
exports.default = FilePreview;
|
|
74
88
|
//# sourceMappingURL=FilePreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePreview.js","sourceRoot":"","sources":["../../../src/components/FilePreview/FilePreview.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"FilePreview.js","sourceRoot":"","sources":["../../../src/components/FilePreview/FilePreview.tsx"],"names":[],"mappings":";;;;AAAA,iCAAmD;AAEnD,gDAAiD;AAEjD,mEAAuC;AACvC,kEAAkC;AAClC,gEAAgC;AAChC,+CAAgD;AAShD,MAAM,WAAW,GAAG,CAAC,EACnB,YAAY,EACZ,UAAU,EACV,WAAW,GAAG,IAAI,GAEJ,EAAE,EAAE;IAClB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAKtC,IAAI,CAAC,CAAC;IAEhB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAC;IAEhE,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,IAAa,EAAE,EAAE;;QAEtD,IAAI,IAAI,KAAK,OAAO,EAAE;YACpB,MAAM,SAAS,GAAG,MAAA,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,0CAAE,WAAW,EAAE,CAAC;YAC3D,QAAQ,SAAS,EAAE;gBACjB,KAAK,KAAK,CAAC;gBACX,KAAK,MAAM;oBACT,OAAO,MAAM,CAAC;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ACtB,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAC9C,GACD,CACJ,CAAC,CAAC,CAAC,CACF,IAAA,iBAAS,EAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,KAAI,EAAE,CAAC,CACvC,GACG,GACA,IACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
|
@@ -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
|
+
}
|
|
@@ -39,6 +39,7 @@ const RenderMediaItem = ({ isChild = false, item, sessionID, tenantID, preview =
|
|
|
39
39
|
const isCodeSnippet = constants_1.prismSyntaxLangs
|
|
40
40
|
.map(l => l.mimeType)
|
|
41
41
|
.includes(item.mimeType);
|
|
42
|
+
const isHTML = item.mimeType === 'text/html';
|
|
42
43
|
const isImageRGB = ((_a = item.url) === null || _a === void 0 ? void 0 : _a.startsWith('rgb(')) || ((_b = item.url) === null || _b === void 0 ? void 0 : _b.startsWith('rgba('));
|
|
43
44
|
const isValidUrl = (urlString) => {
|
|
44
45
|
if (!urlString)
|
|
@@ -98,7 +99,7 @@ const RenderMediaItem = ({ isChild = false, item, sessionID, tenantID, preview =
|
|
|
98
99
|
return (0, jsx_runtime_1.jsx)(File_1.default, { className: "memori-media-item--icon" });
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
|
-
if (isCodeSnippet && item.content) {
|
|
102
|
+
if ((isCodeSnippet && item.content) || isHTML) {
|
|
102
103
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("a", { className: "memori-media-item--link", href: "#", onClick: e => {
|
|
103
104
|
e.preventDefault();
|
|
104
105
|
setModalOpen(true);
|