@memori.ai/memori-react 9.0.0-alpha.8 → 9.0.0-alpha.9
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 +48 -7
- package/dist/components/Chat/Chat.d.ts +1 -0
- package/dist/components/Chat/Chat.js +7 -2
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.css +16 -14
- package/dist/components/ChatInputs/ChatInputs.css +233 -100
- package/dist/components/ChatTextArea/ChatTextArea.css +28 -6
- package/dist/components/KnownFacts/KnownFacts.js +2 -2
- package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.css +1 -3
- package/dist/components/MemoriWidget/MemoriWidget.js +9 -11
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MicrophoneButton/MicrophoneButton.css +50 -18
- package/dist/components/PoweredBy/PoweredBy.css +10 -2
- package/dist/components/UploadButton/UploadImages/UploadImages.js +1 -1
- package/dist/components/UploadButton/UploadImages/UploadImages.js.map +1 -1
- package/dist/components/layouts/Chat.js +5 -5
- package/dist/components/layouts/Chat.js.map +1 -1
- package/dist/components/layouts/HiddenChat.js +9 -16
- package/dist/components/layouts/HiddenChat.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js +23 -2
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/website-assistant.css +138 -55
- package/dist/components/layouts/ZoomedFullBody.js +2 -2
- package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
- package/dist/components/layouts/chat.css +42 -29
- package/dist/components/layouts/fullpage.css +29 -22
- package/dist/components/layouts/hidden-chat.css +147 -27
- package/dist/components/layouts/zoomed-full-body.css +33 -32
- package/dist/styles.css +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/Chat/Chat.css +48 -7
- package/esm/components/Chat/Chat.d.ts +1 -0
- package/esm/components/Chat/Chat.js +7 -2
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.css +16 -14
- package/esm/components/ChatInputs/ChatInputs.css +233 -100
- package/esm/components/ChatTextArea/ChatTextArea.css +28 -6
- package/esm/components/KnownFacts/KnownFacts.js +2 -2
- package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.css +1 -3
- package/esm/components/MemoriWidget/MemoriWidget.js +9 -11
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MicrophoneButton/MicrophoneButton.css +50 -18
- package/esm/components/PoweredBy/PoweredBy.css +10 -2
- package/esm/components/UploadButton/UploadImages/UploadImages.js +1 -1
- package/esm/components/UploadButton/UploadImages/UploadImages.js.map +1 -1
- package/esm/components/layouts/Chat.js +5 -5
- package/esm/components/layouts/Chat.js.map +1 -1
- package/esm/components/layouts/HiddenChat.js +9 -16
- package/esm/components/layouts/HiddenChat.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js +23 -2
- package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/website-assistant.css +138 -55
- package/esm/components/layouts/ZoomedFullBody.js +2 -2
- package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
- package/esm/components/layouts/chat.css +42 -29
- package/esm/components/layouts/fullpage.css +29 -22
- package/esm/components/layouts/hidden-chat.css +147 -27
- package/esm/components/layouts/zoomed-full-body.css +33 -32
- package/esm/styles.css +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +1 -1
- package/src/components/Chat/Chat.css +48 -7
- package/src/components/Chat/Chat.tsx +11 -0
- package/src/components/ChatBubble/ChatBubble.css +16 -14
- package/src/components/ChatInputs/ChatInputs.css +233 -100
- package/src/components/ChatTextArea/ChatTextArea.css +28 -6
- package/src/components/KnownFacts/KnownFacts.tsx +2 -0
- package/src/components/MemoriWidget/MemoriWidget.css +1 -3
- package/src/components/MemoriWidget/MemoriWidget.tsx +385 -380
- package/src/components/MicrophoneButton/MicrophoneButton.css +50 -18
- package/src/components/PoweredBy/PoweredBy.css +10 -2
- package/src/components/UploadButton/UploadImages/UploadImages.tsx +1 -1
- package/src/components/layouts/Chat.tsx +42 -44
- package/src/components/layouts/HiddenChat.tsx +13 -24
- package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.tsx +59 -15
- package/src/components/layouts/WebsiteAssistant/website-assistant.css +138 -55
- package/src/components/layouts/ZoomedFullBody.tsx +3 -1
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +227 -236
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +30 -40
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +165 -27
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +15 -20
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +153 -158
- package/src/components/layouts/chat.css +42 -29
- package/src/components/layouts/fullpage.css +29 -22
- package/src/components/layouts/hidden-chat.css +147 -27
- package/src/components/layouts/layouts.stories.tsx +1 -0
- package/src/components/layouts/zoomed-full-body.css +33 -32
- package/src/styles.css +34 -13
- package/src/version.ts +1 -1
|
@@ -11,16 +11,22 @@
|
|
|
11
11
|
|
|
12
12
|
.memori-chat-inputs--mic {
|
|
13
13
|
z-index: 1;
|
|
14
|
-
width:
|
|
15
|
-
min-width:
|
|
16
|
-
height:
|
|
14
|
+
width: 34px;
|
|
15
|
+
min-width: 34px;
|
|
16
|
+
height: 34px;
|
|
17
17
|
box-sizing: border-box;
|
|
18
|
+
flex-shrink: 0;
|
|
18
19
|
padding: 0;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
border: none;
|
|
21
|
+
border-radius: 10px;
|
|
22
|
+
margin-left: 0;
|
|
23
|
+
background: transparent;
|
|
24
|
+
color: #888;
|
|
25
|
+
cursor: pointer;
|
|
21
26
|
-webkit-tap-highlight-color: transparent;
|
|
22
27
|
touch-action: manipulation;
|
|
23
28
|
-webkit-touch-callout: none;
|
|
29
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
24
30
|
-webkit-user-drag: none;
|
|
25
31
|
-khtml-user-drag: none;
|
|
26
32
|
-moz-user-drag: none;
|
|
@@ -30,21 +36,45 @@
|
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
.memori-chat-inputs--mic svg {
|
|
33
|
-
width:
|
|
34
|
-
height:
|
|
35
|
-
color:
|
|
39
|
+
width: 18px;
|
|
40
|
+
height: 18px;
|
|
41
|
+
color: inherit;
|
|
36
42
|
font-size: 1em;
|
|
37
43
|
-webkit-user-select: none;
|
|
38
44
|
user-select: none;
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
.memori-chat-inputs--mic:hover {
|
|
42
|
-
background-color:
|
|
48
|
+
background-color: #f2eef5 !important;
|
|
49
|
+
color: #555 !important;
|
|
43
50
|
}
|
|
44
51
|
|
|
45
52
|
.memori-chat-inputs--mic:active,
|
|
46
53
|
.memori-chat-inputs--mic:focus {
|
|
47
|
-
box-shadow:
|
|
54
|
+
box-shadow: none !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.memori-chat-inputs--mic:not(.memori-chat-inputs--mic--listening):active,
|
|
58
|
+
.memori-chat-inputs--mic:not(.memori-chat-inputs--mic--listening):focus {
|
|
59
|
+
color: #555 !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Layout-scoped mic colors (FULL_PAGE / HIDDEN_CHAT / WEBSITE_ASSISTANT) */
|
|
63
|
+
.memori-widget.memori-layout-fullpage .memori-chat-inputs--mic,
|
|
64
|
+
.memori-widget.memori-layout-hidden_chat .memori-chat-inputs--mic,
|
|
65
|
+
.memori-widget.memori-layout-website_assistant .memori-chat-inputs--mic {
|
|
66
|
+
color: #9c98a4;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.memori-widget.memori-layout-fullpage .memori-chat-inputs--mic:hover {
|
|
70
|
+
background-color: #332f3a !important;
|
|
71
|
+
color: #d8d6de !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.memori-widget.memori-layout-hidden_chat .memori-chat-inputs--mic:hover,
|
|
75
|
+
.memori-widget.memori-layout-website_assistant .memori-chat-inputs--mic:hover {
|
|
76
|
+
background-color: transparent !important;
|
|
77
|
+
color: #d8d6de !important;
|
|
48
78
|
}
|
|
49
79
|
|
|
50
80
|
/* Enhanced touch feedback for mobile */
|
|
@@ -55,17 +85,10 @@
|
|
|
55
85
|
}
|
|
56
86
|
|
|
57
87
|
.memori-chat-inputs--mic:not(.memori-chat-inputs--mic--listening):active {
|
|
58
|
-
background-color:
|
|
88
|
+
background-color: #f2eef5;
|
|
59
89
|
}
|
|
60
90
|
}
|
|
61
91
|
|
|
62
|
-
/* Prevent double-tap zoom on mobile - already defined above */
|
|
63
|
-
|
|
64
|
-
.memori-chat-inputs--mic:not(.memori-chat-inputs--mic--listening):active,
|
|
65
|
-
.memori-chat-inputs--mic:not(.memori-chat-inputs--mic--listening):focus {
|
|
66
|
-
color: var(--memori-primary) !important;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
92
|
@keyframes micBtnActivePulse {
|
|
70
93
|
0% {
|
|
71
94
|
transform: scale(1.25);
|
|
@@ -160,3 +183,12 @@
|
|
|
160
183
|
[data-theme='dark'] .memori-chat-inputs--mic .lucide-mic {
|
|
161
184
|
color: #fff;
|
|
162
185
|
}
|
|
186
|
+
|
|
187
|
+
.memori-widget.memori-layout-fullpage[data-theme='dark'] .memori-chat-inputs--mic .lucide-mic,
|
|
188
|
+
[data-theme='dark'] .memori-widget.memori-layout-fullpage .memori-chat-inputs--mic .lucide-mic,
|
|
189
|
+
.memori-widget.memori-layout-hidden_chat[data-theme='dark'] .memori-chat-inputs--mic .lucide-mic,
|
|
190
|
+
[data-theme='dark'] .memori-widget.memori-layout-hidden_chat .memori-chat-inputs--mic .lucide-mic,
|
|
191
|
+
.memori-widget.memori-layout-website_assistant[data-theme='dark'] .memori-chat-inputs--mic .lucide-mic,
|
|
192
|
+
[data-theme='dark'] .memori-widget.memori-layout-website_assistant .memori-chat-inputs--mic .lucide-mic {
|
|
193
|
+
color: inherit;
|
|
194
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
/* border: 1px solid var(--memori-border-color); */
|
|
11
11
|
border-radius: 9999px;
|
|
12
12
|
/* background-color: var(--memori-secondary-background); */
|
|
13
|
-
color: var(--memori-text-color);
|
|
13
|
+
color: color-mix(in srgb, var(--memori-text-color) 45%, transparent);
|
|
14
14
|
font-size: 0.75rem;
|
|
15
15
|
font-weight: 500;
|
|
16
16
|
gap: 0.5rem;
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
width: 1.25rem;
|
|
23
23
|
height: 1.25rem;
|
|
24
24
|
flex-shrink: 0;
|
|
25
|
+
opacity: 0.55;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
.memori--powered-by-label {
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
.memori--powered-by-label a {
|
|
34
|
-
color:
|
|
35
|
+
color: inherit;
|
|
35
36
|
text-decoration: underline;
|
|
36
37
|
text-underline-offset: 2px;
|
|
37
38
|
}
|
|
@@ -46,4 +47,11 @@
|
|
|
46
47
|
.memori-widget .memori--powered-by {
|
|
47
48
|
display: none !important;
|
|
48
49
|
}
|
|
50
|
+
|
|
51
|
+
/* Keep the footer strip visible under the input on compact chat layouts */
|
|
52
|
+
.memori-widget.memori-layout-chat .memori--powered-by,
|
|
53
|
+
.memori-widget.memori-layout-website_assistant .memori--powered-by,
|
|
54
|
+
.memori-widget.memori-layout-hidden_chat .memori--powered-by {
|
|
55
|
+
display: flex !important;
|
|
56
|
+
}
|
|
49
57
|
}
|
|
@@ -499,7 +499,7 @@ const UploadImages: React.FC<UploadImagesProps> = ({
|
|
|
499
499
|
borderTop: '1px solid rgba(255, 255, 255, 0.2)',
|
|
500
500
|
}}
|
|
501
501
|
>
|
|
502
|
-
<Button onClick={handleCancelUpload} variant="outline">
|
|
502
|
+
<Button onClick={handleCancelUpload} variant="outline" danger>
|
|
503
503
|
{t('cancel') ?? 'Cancel'}
|
|
504
504
|
</Button>
|
|
505
505
|
<Button
|
|
@@ -226,8 +226,6 @@ const ChatLayout: React.FC<LayoutProps> = ({
|
|
|
226
226
|
{integrationBackground}
|
|
227
227
|
|
|
228
228
|
<Spin spinning={loading} className="memori-chat-layout">
|
|
229
|
-
{poweredBy}
|
|
230
|
-
|
|
231
229
|
<div id="extension" />
|
|
232
230
|
|
|
233
231
|
<div className="memori-chat-layout--main">
|
|
@@ -356,7 +354,7 @@ const ChatLayout: React.FC<LayoutProps> = ({
|
|
|
356
354
|
/>
|
|
357
355
|
)}
|
|
358
356
|
{sessionId && hasUserActivatedSpeak && Chat && chatProps ? (
|
|
359
|
-
<Chat {...chatProps} />
|
|
357
|
+
<Chat {...chatProps} showInputs={false} />
|
|
360
358
|
) : startPanelProps ? (
|
|
361
359
|
<div
|
|
362
360
|
className="memori-chat-layout--start-shell"
|
|
@@ -365,50 +363,50 @@ const ChatLayout: React.FC<LayoutProps> = ({
|
|
|
365
363
|
<div className="memori-chat-layout--start-panel-wrap">
|
|
366
364
|
<StartPanel {...startPanelProps} />
|
|
367
365
|
</div>
|
|
368
|
-
{Chat && chatProps && chatProps.showInputs !== false && (
|
|
369
|
-
<div className="memori-chat-layout--prechat-inputs">
|
|
370
|
-
<ChatInputs
|
|
371
|
-
userMessage={chatProps.userMessage}
|
|
372
|
-
onChangeUserMessage={chatProps.onChangeUserMessage}
|
|
373
|
-
dialogState={chatProps.dialogState}
|
|
374
|
-
instruct={chatProps.instruct}
|
|
375
|
-
authToken={chatProps.authToken}
|
|
376
|
-
sendMessage={chatProps.sendMessage}
|
|
377
|
-
isTyping={chatProps.memoriTyping}
|
|
378
|
-
microphoneMode={chatProps.microphoneMode}
|
|
379
|
-
sendOnEnter={chatProps.sendOnEnter}
|
|
380
|
-
setSendOnEnter={chatProps.setSendOnEnter}
|
|
381
|
-
client={chatProps.client}
|
|
382
|
-
sessionID={chatProps.sessionID}
|
|
383
|
-
showUpload={chatProps.showUpload}
|
|
384
|
-
attachmentsMenuOpen={chatProps.attachmentsMenuOpen}
|
|
385
|
-
setAttachmentsMenuOpen={
|
|
386
|
-
chatProps.setAttachmentsMenuOpen
|
|
387
|
-
}
|
|
388
|
-
onTextareaFocus={() => {
|
|
389
|
-
chatProps.stopListening?.();
|
|
390
|
-
}}
|
|
391
|
-
onTextareaBlur={() => {}}
|
|
392
|
-
onTextareaExpanded={() => {}}
|
|
393
|
-
startListening={chatProps.startListening}
|
|
394
|
-
stopListening={chatProps.stopListening}
|
|
395
|
-
stopAudio={chatProps.stopAudio}
|
|
396
|
-
listening={chatProps.listening}
|
|
397
|
-
isPlayingAudio={chatProps.isPlayingAudio}
|
|
398
|
-
showMicrophone={chatProps.showMicrophone}
|
|
399
|
-
memoriID={chatProps.memori?.memoriID}
|
|
400
|
-
maxTextareaCharacters={chatProps.maxTextareaCharacters}
|
|
401
|
-
maxDocumentsPerMessage={maxDocumentsPerMessage}
|
|
402
|
-
maxDocumentContentLength={maxDocumentContentLength}
|
|
403
|
-
pasteAsCardLineThreshold={pasteAsCardLineThreshold}
|
|
404
|
-
pasteAsCardCharThreshold={pasteAsCardCharThreshold}
|
|
405
|
-
showAiGeneratedNote={false}
|
|
406
|
-
/>
|
|
407
|
-
</div>
|
|
408
|
-
)}
|
|
409
366
|
</div>
|
|
410
367
|
) : null}
|
|
411
368
|
</div>
|
|
369
|
+
|
|
370
|
+
{/* Input bar sits outside body so it spans full width below the scroll area */}
|
|
371
|
+
{Chat && chatProps && chatProps.showInputs !== false && (
|
|
372
|
+
<ChatInputs
|
|
373
|
+
userMessage={chatProps.userMessage}
|
|
374
|
+
onChangeUserMessage={chatProps.onChangeUserMessage}
|
|
375
|
+
dialogState={chatProps.dialogState}
|
|
376
|
+
instruct={chatProps.instruct}
|
|
377
|
+
authToken={chatProps.authToken}
|
|
378
|
+
sendMessage={chatProps.sendMessage}
|
|
379
|
+
isTyping={chatProps.memoriTyping}
|
|
380
|
+
microphoneMode={chatProps.microphoneMode}
|
|
381
|
+
sendOnEnter={chatProps.sendOnEnter}
|
|
382
|
+
setSendOnEnter={chatProps.setSendOnEnter}
|
|
383
|
+
client={chatProps.client}
|
|
384
|
+
sessionID={chatProps.sessionID}
|
|
385
|
+
showUpload={chatProps.showUpload}
|
|
386
|
+
attachmentsMenuOpen={chatProps.attachmentsMenuOpen}
|
|
387
|
+
setAttachmentsMenuOpen={chatProps.setAttachmentsMenuOpen}
|
|
388
|
+
onTextareaFocus={() => {
|
|
389
|
+
chatProps.stopListening?.();
|
|
390
|
+
}}
|
|
391
|
+
onTextareaBlur={() => {}}
|
|
392
|
+
onTextareaExpanded={() => {}}
|
|
393
|
+
startListening={chatProps.startListening}
|
|
394
|
+
stopListening={chatProps.stopListening}
|
|
395
|
+
stopAudio={chatProps.stopAudio}
|
|
396
|
+
listening={chatProps.listening}
|
|
397
|
+
isPlayingAudio={chatProps.isPlayingAudio}
|
|
398
|
+
showMicrophone={chatProps.showMicrophone}
|
|
399
|
+
memoriID={chatProps.memori?.memoriID}
|
|
400
|
+
maxTextareaCharacters={chatProps.maxTextareaCharacters}
|
|
401
|
+
maxTotalMessagePayload={chatProps.maxTotalMessagePayload}
|
|
402
|
+
maxDocumentsPerMessage={maxDocumentsPerMessage}
|
|
403
|
+
maxDocumentContentLength={maxDocumentContentLength}
|
|
404
|
+
pasteAsCardLineThreshold={pasteAsCardLineThreshold}
|
|
405
|
+
pasteAsCardCharThreshold={pasteAsCardCharThreshold}
|
|
406
|
+
showAiGeneratedNote={isSessionStarted}
|
|
407
|
+
/>
|
|
408
|
+
)}
|
|
409
|
+
{poweredBy}
|
|
412
410
|
</div>
|
|
413
411
|
|
|
414
412
|
{/* Artifact column — width 0→480px with CSS transition */}
|
|
@@ -27,6 +27,7 @@ const HiddenChatLayout: React.FC<LayoutProps> = ({
|
|
|
27
27
|
autoStart,
|
|
28
28
|
StartPanel,
|
|
29
29
|
onSidebarToggle,
|
|
30
|
+
poweredBy,
|
|
30
31
|
}) => {
|
|
31
32
|
const { t } = useTranslation();
|
|
32
33
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -168,11 +169,6 @@ const HiddenChatLayout: React.FC<LayoutProps> = ({
|
|
|
168
169
|
const restoreFromFullscreen = () => {
|
|
169
170
|
const sidebarElement = document.querySelector('.memori-sidebar');
|
|
170
171
|
if (sidebarElement) {
|
|
171
|
-
//restore closing button
|
|
172
|
-
const closeButton = document.querySelector('.memori-close-label');
|
|
173
|
-
if (closeButton) {
|
|
174
|
-
(closeButton as HTMLElement).style.display = 'flex';
|
|
175
|
-
}
|
|
176
172
|
// Restore original styles
|
|
177
173
|
const sidebar = sidebarElement as HTMLElement;
|
|
178
174
|
sidebar.style.right = originalSidebarStyles.current.right;
|
|
@@ -193,12 +189,6 @@ const HiddenChatLayout: React.FC<LayoutProps> = ({
|
|
|
193
189
|
if (sidebarElement) {
|
|
194
190
|
const sidebar = sidebarElement as HTMLElement;
|
|
195
191
|
|
|
196
|
-
//hide closing button
|
|
197
|
-
const closeButton = document.querySelector('.memori-close-label');
|
|
198
|
-
if (closeButton) {
|
|
199
|
-
(closeButton as HTMLElement).style.display = 'none';
|
|
200
|
-
}
|
|
201
|
-
|
|
202
192
|
// Store original styles before modifying
|
|
203
193
|
originalSidebarStyles.current = {
|
|
204
194
|
right: sidebar.style.right,
|
|
@@ -206,10 +196,11 @@ const HiddenChatLayout: React.FC<LayoutProps> = ({
|
|
|
206
196
|
backgroundColor: sidebar.style.backgroundColor,
|
|
207
197
|
};
|
|
208
198
|
|
|
209
|
-
// Set styles for fullscreen
|
|
199
|
+
// Set styles for fullscreen — keep --memori-secondary-background via CSS, clear inline white
|
|
210
200
|
sidebar.style.right = '0';
|
|
211
201
|
sidebar.style.width = '100%';
|
|
212
|
-
sidebar.style.backgroundColor = '
|
|
202
|
+
sidebar.style.backgroundColor = '';
|
|
203
|
+
sidebar.classList.add('memori-sidebar-fullscreen');
|
|
213
204
|
|
|
214
205
|
// Request fullscreen
|
|
215
206
|
sidebar.requestFullscreen().catch(err => {
|
|
@@ -255,17 +246,6 @@ const HiddenChatLayout: React.FC<LayoutProps> = ({
|
|
|
255
246
|
fullScreen ? 'memori-sidebar-fullscreen' : ''
|
|
256
247
|
}`}
|
|
257
248
|
>
|
|
258
|
-
<label
|
|
259
|
-
htmlFor="memori-sidebar-toggle"
|
|
260
|
-
className="memori-sidebar-toggle-label memori-close-label"
|
|
261
|
-
>
|
|
262
|
-
<span>
|
|
263
|
-
<X
|
|
264
|
-
className="memori-icon-close"
|
|
265
|
-
aria-label={t('collapse') ?? undefined}
|
|
266
|
-
/>
|
|
267
|
-
</span>
|
|
268
|
-
</label>
|
|
269
249
|
<div className="memori-hidden-chat-layout--controls memori-chat-layout--controls">
|
|
270
250
|
<div className="memori-chat-layout--header">
|
|
271
251
|
{Header && headerProps && (
|
|
@@ -303,6 +283,14 @@ const HiddenChatLayout: React.FC<LayoutProps> = ({
|
|
|
303
283
|
fullScreenHandler={handleFullscreenToggle}
|
|
304
284
|
/>
|
|
305
285
|
)}
|
|
286
|
+
<label
|
|
287
|
+
htmlFor="memori-sidebar-toggle"
|
|
288
|
+
className="memori-sidebar-toggle-label memori-close-label memori-hidden-chat-layout--header-close"
|
|
289
|
+
aria-label={t('collapse') || 'Close'}
|
|
290
|
+
title={t('collapse') || 'Close'}
|
|
291
|
+
>
|
|
292
|
+
<X className="memori-icon-close" aria-hidden />
|
|
293
|
+
</label>
|
|
306
294
|
</div>
|
|
307
295
|
</div>
|
|
308
296
|
)}
|
|
@@ -364,6 +352,7 @@ const HiddenChatLayout: React.FC<LayoutProps> = ({
|
|
|
364
352
|
)}
|
|
365
353
|
<div id="extension" />
|
|
366
354
|
</div>
|
|
355
|
+
{poweredBy}
|
|
367
356
|
</div>
|
|
368
357
|
</aside>
|
|
369
358
|
</div>
|
|
@@ -6,6 +6,7 @@ import { X } from 'lucide-react';
|
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { useArtifact } from '../../MemoriArtifactSystem/context/ArtifactContext';
|
|
8
8
|
import ArtifactDrawer from '../../MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer';
|
|
9
|
+
import { getResourceUrl } from '../../../helpers/media';
|
|
9
10
|
|
|
10
11
|
const WebsiteAssistantLayout: React.FC<LayoutProps> = ({
|
|
11
12
|
Header,
|
|
@@ -32,6 +33,28 @@ const WebsiteAssistantLayout: React.FC<LayoutProps> = ({
|
|
|
32
33
|
|
|
33
34
|
const stopAudio = useMemo(() => chatProps?.stopAudio, [chatProps?.stopAudio]);
|
|
34
35
|
|
|
36
|
+
const memori = headerProps?.memori;
|
|
37
|
+
const tenant = headerProps?.tenant;
|
|
38
|
+
const baseUrl = headerProps?.baseUrl;
|
|
39
|
+
const isSessionStarted = Boolean(sessionId && hasUserActivatedSpeak);
|
|
40
|
+
|
|
41
|
+
const brandAvatarSrc = memori
|
|
42
|
+
? memori.avatarURL && memori.avatarURL.length > 0
|
|
43
|
+
? getResourceUrl({
|
|
44
|
+
type: 'avatar',
|
|
45
|
+
tenantID: tenant?.name,
|
|
46
|
+
resourceURI: memori.avatarURL,
|
|
47
|
+
baseURL: baseUrl,
|
|
48
|
+
apiURL: '',
|
|
49
|
+
})
|
|
50
|
+
: getResourceUrl({
|
|
51
|
+
type: 'avatar',
|
|
52
|
+
tenantID: tenant?.name,
|
|
53
|
+
baseURL: baseUrl,
|
|
54
|
+
apiURL: '',
|
|
55
|
+
})
|
|
56
|
+
: undefined;
|
|
57
|
+
|
|
35
58
|
const setCollapsed = (collapsed: boolean) => {
|
|
36
59
|
_setCollapsed(collapsed);
|
|
37
60
|
setExpandedKey(collapsed ? undefined : new Date().toISOString());
|
|
@@ -76,25 +99,45 @@ const WebsiteAssistantLayout: React.FC<LayoutProps> = ({
|
|
|
76
99
|
spinning={loading}
|
|
77
100
|
className="memori-website_assistant-layout"
|
|
78
101
|
>
|
|
79
|
-
{poweredBy}
|
|
80
102
|
<div className="memori-website_assistant-layout--header-row">
|
|
81
|
-
{
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
103
|
+
{memori && brandAvatarSrc && (
|
|
104
|
+
<div className="memori-chat-layout--brand">
|
|
105
|
+
<img
|
|
106
|
+
className="memori-chat-layout--brand-avatar"
|
|
107
|
+
src={brandAvatarSrc}
|
|
108
|
+
alt=""
|
|
109
|
+
role="presentation"
|
|
110
|
+
/>
|
|
111
|
+
<div className="memori-chat-layout--brand-text">
|
|
112
|
+
{isSessionStarted && (
|
|
113
|
+
<span
|
|
114
|
+
className="memori-chat-layout--brand-name"
|
|
115
|
+
title={memori.name}
|
|
116
|
+
>
|
|
117
|
+
{memori.name}
|
|
118
|
+
</span>
|
|
119
|
+
)}
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
88
122
|
)}
|
|
89
|
-
<div className="memori-website_assistant--
|
|
90
|
-
|
|
123
|
+
<div className="memori-website_assistant-layout--header-actions">
|
|
124
|
+
{Header && headerProps && (
|
|
125
|
+
<Header
|
|
126
|
+
buttonVariant="outline"
|
|
127
|
+
{...headerProps}
|
|
128
|
+
showSettings={false}
|
|
129
|
+
showReload={false}
|
|
130
|
+
/>
|
|
131
|
+
)}
|
|
132
|
+
<button
|
|
133
|
+
type="button"
|
|
91
134
|
className="memori-website_assistant--close-button"
|
|
92
|
-
variant="ghost"
|
|
93
135
|
onClick={() => setCollapsed(true)}
|
|
94
|
-
aria-label={t('
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
136
|
+
aria-label={t('collapse') || 'Close'}
|
|
137
|
+
title={t('collapse') || 'Close'}
|
|
138
|
+
>
|
|
139
|
+
<X className="memori-icon-close" aria-hidden />
|
|
140
|
+
</button>
|
|
98
141
|
</div>
|
|
99
142
|
</div>
|
|
100
143
|
|
|
@@ -136,6 +179,7 @@ const WebsiteAssistantLayout: React.FC<LayoutProps> = ({
|
|
|
136
179
|
/>
|
|
137
180
|
) : null}
|
|
138
181
|
</div>
|
|
182
|
+
{poweredBy}
|
|
139
183
|
</Spin>
|
|
140
184
|
</>
|
|
141
185
|
)}
|