@memori.ai/memori-react 9.0.0-alpha.7 → 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 +37 -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 +18 -15
- 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 +10 -236
- 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 -33
- package/dist/components/layouts/zoomed-full-body.css +33 -32
- package/dist/helpers/positionPopover.d.ts +1 -0
- package/dist/helpers/positionPopover.js +7 -0
- package/dist/helpers/positionPopover.js.map +1 -0
- 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 +18 -15
- 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 +12 -238
- 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 -33
- package/esm/components/layouts/zoomed-full-body.css +33 -32
- package/esm/helpers/positionPopover.d.ts +1 -0
- package/esm/helpers/positionPopover.js +4 -0
- package/esm/helpers/positionPopover.js.map +1 -0
- 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 +397 -384
- 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 +16 -413
- 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 -66
- 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 -33
- package/src/components/layouts/layouts.stories.tsx +1 -0
- package/src/components/layouts/zoomed-full-body.css +33 -32
- package/src/helpers/positionPopover.test.ts +33 -0
- package/src/helpers/positionPopover.ts +13 -0
- package/src/styles.css +34 -13
- package/src/version.ts +1 -1
package/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "9.0.0-alpha.
|
|
1
|
+
export declare const version = "9.0.0-alpha.9";
|
package/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '9.0.0-alpha.
|
|
1
|
+
export const version = '9.0.0-alpha.9';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -18,32 +18,45 @@
|
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: calc(100% - 50px);
|
|
20
20
|
flex: 1;
|
|
21
|
-
border-radius: var(--memori-radius-box);
|
|
21
|
+
border-radius: var(--memori-radius-box) var(--memori-radius-box) 0 0;
|
|
22
22
|
margin-bottom: 1rem;
|
|
23
23
|
background-color: var(--memori-secondary-background);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
.memori-chat--history:has(.memori-chat--content--has-global-background) {
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
/* Adjust chat history when textarea is expanded */
|
|
27
31
|
.memori-chat-wrapper--expanded .memori-chat--history {
|
|
28
32
|
margin-bottom: var(--memori-spacing-sm);
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
/* Solo widget layout CHAT: area messaggi a card
|
|
35
|
+
/* Solo widget layout CHAT: area messaggi a card — top radius only;
|
|
36
|
+
bottom radius lives on the input bar so the panel reads as one unit */
|
|
32
37
|
.memori-widget.memori-layout-chat .memori-chat-layout--controls .memori-chat--history {
|
|
38
|
+
height: 100%;
|
|
33
39
|
min-height: 0;
|
|
34
40
|
padding: 0;
|
|
35
|
-
border-radius:
|
|
36
|
-
margin: 0
|
|
37
|
-
background-color:
|
|
41
|
+
border-radius: 0;
|
|
42
|
+
margin: 0;
|
|
43
|
+
background-color: var(--memori-secondary-background);
|
|
38
44
|
box-shadow: none;
|
|
39
45
|
}
|
|
40
46
|
|
|
47
|
+
.memori-widget.memori-layout-chat
|
|
48
|
+
.memori-chat-layout--controls
|
|
49
|
+
.memori-chat--history:has(.memori-chat--content--has-global-background) {
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
}
|
|
52
|
+
|
|
41
53
|
.memori-widget.memori-layout-chat .memori-widget {
|
|
42
54
|
padding: 0;
|
|
43
55
|
}
|
|
44
56
|
|
|
45
|
-
.memori-widget.memori-layout-chat .memori-chat--bubble {
|
|
46
|
-
|
|
57
|
+
.memori-widget.memori-layout-chat .memori-chat--bubble:not(.memori-chat--user-bubble) {
|
|
58
|
+
border: none;
|
|
59
|
+
/* background-color: var(--memori-secondary-background); */
|
|
47
60
|
}
|
|
48
61
|
|
|
49
62
|
.memori-widget.memori-layout-chat .memori-media-item--document {
|
|
@@ -68,6 +81,34 @@
|
|
|
68
81
|
scroll-behavior: smooth;
|
|
69
82
|
}
|
|
70
83
|
|
|
84
|
+
/* Global background image lives on the chat content area (not the whole layout).
|
|
85
|
+
Pseudo-element keeps blur from affecting messages. */
|
|
86
|
+
.memori-chat--content--has-global-background {
|
|
87
|
+
background-color: transparent;
|
|
88
|
+
isolation: isolate;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.memori-chat--content--has-global-background::before {
|
|
92
|
+
position: absolute;
|
|
93
|
+
z-index: 0;
|
|
94
|
+
top: 0;
|
|
95
|
+
right: 0;
|
|
96
|
+
bottom: 0;
|
|
97
|
+
left: 0;
|
|
98
|
+
background-color: #eee;
|
|
99
|
+
background-image: var(--memori-chat-global-background);
|
|
100
|
+
background-position: center center;
|
|
101
|
+
background-repeat: no-repeat;
|
|
102
|
+
background-size: cover;
|
|
103
|
+
content: '';
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.memori-chat--content--has-global-background > * {
|
|
108
|
+
position: relative;
|
|
109
|
+
z-index: 1;
|
|
110
|
+
}
|
|
111
|
+
|
|
71
112
|
.memori-chat--content.memori-chat--content-touch {
|
|
72
113
|
padding: 0;
|
|
73
114
|
}
|
|
@@ -120,6 +120,8 @@ export interface Props {
|
|
|
120
120
|
/** Max characters in chat textarea; shows counter and enforces paste + existing text does not exceed this limit. */
|
|
121
121
|
maxTextareaCharacters?: number;
|
|
122
122
|
/** Max attachments (docs + images) per message. */
|
|
123
|
+
/** Integration global background image URL applied to `.memori-chat--content`. */
|
|
124
|
+
globalBackground?: string;
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
type MessageWithLlmUsage = Message & { llmUsage?: LlmUsageOnLine };
|
|
@@ -180,6 +182,7 @@ const Chat: React.FC<Props> = ({
|
|
|
180
182
|
showFunctionCache = false,
|
|
181
183
|
maxTotalMessagePayload,
|
|
182
184
|
maxTextareaCharacters,
|
|
185
|
+
globalBackground,
|
|
183
186
|
}) => {
|
|
184
187
|
const [isTextareaExpanded, setIsTextareaExpanded] = useState(false);
|
|
185
188
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -421,7 +424,15 @@ const Chat: React.FC<Props> = ({
|
|
|
421
424
|
<div
|
|
422
425
|
className={cx('memori-chat--content', {
|
|
423
426
|
'memori-chat--content-touch': hasTouchscreen(),
|
|
427
|
+
'memori-chat--content--has-global-background': !!globalBackground,
|
|
424
428
|
})}
|
|
429
|
+
style={
|
|
430
|
+
globalBackground
|
|
431
|
+
? ({
|
|
432
|
+
['--memori-chat-global-background' as string]: `url(${globalBackground})`,
|
|
433
|
+
} as React.CSSProperties)
|
|
434
|
+
: undefined
|
|
435
|
+
}
|
|
425
436
|
>
|
|
426
437
|
<div
|
|
427
438
|
className={cx('memori-chat--cover')}
|
|
@@ -73,20 +73,18 @@
|
|
|
73
73
|
flex-direction: column;
|
|
74
74
|
align-items: flex-start;
|
|
75
75
|
padding: 12px 14px;
|
|
76
|
-
|
|
77
|
-
border-radius:
|
|
76
|
+
border: none;
|
|
77
|
+
border-radius: 13px;
|
|
78
78
|
/* margin-top: 1.5rem; */
|
|
79
79
|
background: var(--memori-main-background);
|
|
80
|
-
|
|
80
|
+
border-top-left-radius: 4px;
|
|
81
|
+
box-shadow: none;
|
|
82
|
+
color: var(--memori-text-color);
|
|
81
83
|
font-size: 14px;
|
|
82
84
|
line-height: 1.4;
|
|
83
85
|
white-space: pre-wrap;
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
[data-theme='dark'] .memori-chat--bubble:not(.memori-chat--user-bubble) {
|
|
87
|
-
border-color: #fff;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
88
|
.memori-chat--bubble-timestamp-container {
|
|
91
89
|
display: flex;
|
|
92
90
|
align-items: center;
|
|
@@ -230,17 +228,21 @@
|
|
|
230
228
|
|
|
231
229
|
.memori-chat--bubble.memori-chat--user-bubble {
|
|
232
230
|
max-width: 100%;
|
|
233
|
-
border
|
|
234
|
-
|
|
235
|
-
color:
|
|
231
|
+
border: none;
|
|
232
|
+
border-radius: var(--memori-radius-box);
|
|
233
|
+
/* Prefer --memori-primary-color: dark theme remaps --memori-primary to
|
|
234
|
+
--memori-primary-hover, which circularly resolves and drops the fill. */
|
|
235
|
+
background: var(--memori-primary-color, var(--memori-primary)) !important;
|
|
236
|
+
border-top-right-radius: 4px;
|
|
237
|
+
box-shadow: none;
|
|
238
|
+
color: var(--memori-primary-content);
|
|
236
239
|
font-size: 14px;
|
|
237
240
|
font-weight: 400;
|
|
238
241
|
}
|
|
239
242
|
|
|
240
|
-
[data-theme='dark']
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
243
|
+
[data-theme='dark'] .memori-chat--bubble.memori-chat--user-bubble,
|
|
244
|
+
.memori-widget[data-theme='dark'] .memori-chat--bubble.memori-chat--user-bubble {
|
|
245
|
+
background: var(--memori-primary-color, var(--memori-primary)) !important;
|
|
244
246
|
}
|
|
245
247
|
|
|
246
248
|
.memori-chat--bubble-avatar {
|