@memori.ai/memori-react 8.3.0 → 8.4.0-rc.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 +20 -0
- package/dist/components/Chat/Chat.js +8 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +166 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +3 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +115 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +104 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js +50 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +78 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.d.ts +12 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.js +22 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.d.ts +12 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.js +288 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/index.d.ts +9 -0
- package/dist/components/MemoriArtifactSystem/index.js +28 -0
- package/dist/components/MemoriArtifactSystem/index.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.d.ts +108 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.js +31 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.js.map +1 -0
- package/dist/components/icons/Print.d.ts +6 -0
- package/dist/components/icons/Print.js +6 -0
- package/dist/components/icons/Print.js.map +1 -0
- package/dist/components/layouts/Chat.js +29 -1
- package/dist/components/layouts/Chat.js.map +1 -1
- package/dist/components/layouts/FullPage.js +33 -1
- package/dist/components/layouts/FullPage.js.map +1 -1
- package/dist/components/layouts/ZoomedFullBody.js +29 -2
- package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
- package/dist/components/layouts/chat.css +335 -13
- package/dist/components/layouts/zoomed-full-body.css +1 -3
- package/dist/helpers/message.js +1 -0
- package/dist/helpers/message.js.map +1 -1
- package/dist/index.js +58 -15
- package/dist/index.js.map +1 -1
- package/dist/styles.css +5 -0
- package/esm/components/Chat/Chat.js +8 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +163 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +3 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +112 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +101 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js +47 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +75 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.d.ts +12 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.js +17 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.d.ts +12 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.js +281 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/index.d.ts +9 -0
- package/esm/components/MemoriArtifactSystem/index.js +9 -0
- package/esm/components/MemoriArtifactSystem/index.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.d.ts +108 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.js +28 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.js.map +1 -0
- package/esm/components/icons/Print.d.ts +6 -0
- package/esm/components/icons/Print.js +4 -0
- package/esm/components/icons/Print.js.map +1 -0
- package/esm/components/layouts/Chat.js +29 -1
- package/esm/components/layouts/Chat.js.map +1 -1
- package/esm/components/layouts/FullPage.js +33 -1
- package/esm/components/layouts/FullPage.js.map +1 -1
- package/esm/components/layouts/ZoomedFullBody.js +30 -3
- package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
- package/esm/components/layouts/chat.css +335 -13
- package/esm/components/layouts/zoomed-full-body.css +1 -3
- package/esm/helpers/message.js +1 -0
- package/esm/helpers/message.js.map +1 -1
- package/esm/index.js +58 -15
- package/esm/index.js.map +1 -1
- package/esm/styles.css +5 -0
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.test.tsx +13 -0
- package/src/components/Chat/Chat.stories.tsx +33 -2
- package/src/components/Chat/Chat.test.tsx +340 -213
- package/src/components/Chat/Chat.tsx +27 -4
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +278 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +308 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +282 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.tsx +178 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +190 -0
- package/src/components/MemoriArtifactSystem/context/ArtifactSystemContext.tsx +57 -0
- package/src/components/MemoriArtifactSystem/hooks/useArtifactSystem.ts +419 -0
- package/src/components/MemoriArtifactSystem/index.ts +45 -0
- package/src/components/MemoriArtifactSystem/types/artifact.types.ts +180 -0
- package/src/components/icons/Print.tsx +34 -0
- package/src/components/layouts/Chat.test.tsx +13 -0
- package/src/components/layouts/Chat.tsx +80 -25
- package/src/components/layouts/FullPage.test.tsx +40 -11
- package/src/components/layouts/FullPage.tsx +92 -24
- package/src/components/layouts/HiddenChat.test.tsx +13 -0
- package/src/components/layouts/Totem.test.tsx +13 -0
- package/src/components/layouts/WebsiteAssistant.test.tsx +13 -0
- package/src/components/layouts/ZoomedFullBody.test.tsx +13 -0
- package/src/components/layouts/ZoomedFullBody.tsx +78 -14
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +252 -248
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +504 -496
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +252 -248
- package/src/components/layouts/chat.css +335 -13
- package/src/components/layouts/layouts.stories.tsx +13 -2
- package/src/components/layouts/zoomed-full-body.css +1 -3
- package/src/helpers/message.ts +1 -0
- package/src/index.stories.tsx +26 -22
- package/src/index.tsx +46 -0
- package/src/mocks/data.ts +258 -0
- package/src/styles.css +5 -0
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
background: none;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.memori-widget > .memori-spin.memori-chat-layout
|
|
9
|
+
.memori-widget > .memori-spin.memori-chat-layout {
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
.memori-chat-layout--main, .memori-chat-layout--controls{
|
|
16
|
+
min-height: calc(100% - 25px);
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
.memori-chat-layout--header {
|
|
16
20
|
text-align: right;
|
|
17
21
|
}
|
|
@@ -21,6 +25,98 @@
|
|
|
21
25
|
width: auto;
|
|
22
26
|
}
|
|
23
27
|
|
|
28
|
+
.memori-chat-layout-controls-hide{
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.memori-chat-layout-artifact-panel-full-screen{
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
flex:1 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
.memori-chat-layout--main {
|
|
40
|
+
position: relative;
|
|
41
|
+
display: flex;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
flex: 1;
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
/* max-width: 1200px; */
|
|
50
|
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.memori-chat-layout--main-with-artifact {
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
padding: 1rem;
|
|
56
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
57
|
+
backdrop-filter: blur(20px);
|
|
58
|
+
background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
|
|
59
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
|
60
|
+
gap: 1rem;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.memori-chat-layout--controls {
|
|
64
|
+
position: relative;
|
|
65
|
+
z-index: 5;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
flex: 1;
|
|
69
|
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.memori-chat-layout--controls-with-artifact {
|
|
73
|
+
max-height: 100%;
|
|
74
|
+
flex: 0 0 50%;
|
|
75
|
+
margin: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.memori-chat-layout--artifact-panel {
|
|
79
|
+
position: relative;
|
|
80
|
+
display: flex;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
width: 100%;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
height: 100%;
|
|
85
|
+
flex: 0 0 50%;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
88
|
+
border-radius: 12px;
|
|
89
|
+
backdrop-filter: blur(20px);
|
|
90
|
+
background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
|
|
91
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
|
92
|
+
opacity: 0;
|
|
93
|
+
transform: translateX(100%) scale(0.95);
|
|
94
|
+
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.memori-chat-layout--artifact-panel-enter {
|
|
98
|
+
animation: artifact-panel-slide-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
99
|
+
opacity: 1;
|
|
100
|
+
transform: translateX(0) scale(1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@keyframes artifact-panel-slide-in {
|
|
104
|
+
0% {
|
|
105
|
+
opacity: 0;
|
|
106
|
+
transform: translateX(100%) scale(0.95);
|
|
107
|
+
}
|
|
108
|
+
50% {
|
|
109
|
+
opacity: 0.8;
|
|
110
|
+
transform: translateX(50%) scale(0.98);
|
|
111
|
+
}
|
|
112
|
+
100% {
|
|
113
|
+
opacity: 1;
|
|
114
|
+
transform: translateX(0) scale(1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
24
120
|
.memori-chat-layout .memori--avatar {
|
|
25
121
|
top: 0;
|
|
26
122
|
}
|
|
@@ -52,25 +148,17 @@
|
|
|
52
148
|
}
|
|
53
149
|
}
|
|
54
150
|
|
|
55
|
-
.memori-chat-layout--controls {
|
|
56
|
-
position: relative;
|
|
57
|
-
z-index: 5;
|
|
58
|
-
max-height: calc(100% - 50px);
|
|
59
|
-
flex: 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
151
|
.memori-chat-layout--controls .memori--start-panel,
|
|
63
152
|
.memori-chat-layout--controls .memori-chat--wrapper {
|
|
64
153
|
max-width: 1200px;
|
|
154
|
+
height: 100%;
|
|
155
|
+
min-height: calc(87vh - 1rem);
|
|
65
156
|
margin: 0 auto;
|
|
66
157
|
}
|
|
67
158
|
|
|
68
|
-
.memori-chat-layout--controls .memori--start-panel {
|
|
69
|
-
margin-top: 3rem;
|
|
70
|
-
}
|
|
71
159
|
|
|
72
160
|
.memori-chat-layout--controls .memori-chat--wrapper {
|
|
73
|
-
height: calc(
|
|
161
|
+
height: calc(87vh - 1rem);
|
|
74
162
|
}
|
|
75
163
|
|
|
76
164
|
.memori-chat-layout .memori-chat--content {
|
|
@@ -125,5 +213,239 @@
|
|
|
125
213
|
}
|
|
126
214
|
|
|
127
215
|
.memori-chat-layout .memori--global-background-image {
|
|
128
|
-
|
|
216
|
+
position: relative;
|
|
217
|
+
overflow: hidden;
|
|
218
|
+
background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(200, 200, 200, 0.8) 100%);
|
|
219
|
+
transition: all 0.2s ease-in-out;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.memori-chat-layout .memori--global-background-image::before {
|
|
223
|
+
position: absolute;
|
|
224
|
+
top: 0;
|
|
225
|
+
right: 0;
|
|
226
|
+
bottom: 0;
|
|
227
|
+
left: 0;
|
|
228
|
+
animation: background-shimmer 4s ease-in-out infinite;
|
|
229
|
+
background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
|
|
230
|
+
background-size: 200% 200%;
|
|
231
|
+
content: '';
|
|
232
|
+
pointer-events: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@keyframes background-shimmer {
|
|
236
|
+
0%, 100% { background-position: 200% 200%; }
|
|
237
|
+
50% { background-position: -200% -200%; }
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* Enhanced micro-interactions */
|
|
241
|
+
|
|
242
|
+
.memori-chat-layout--main:hover {
|
|
243
|
+
transform: translateY(-2px);
|
|
244
|
+
/* box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15); */
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
.memori-chat-layout--controls:hover {
|
|
249
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
250
|
+
transform: translateY(-1px);
|
|
129
251
|
}
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
.memori-chat-layout--artifact-panel:hover {
|
|
256
|
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
|
257
|
+
transform: translateY(-1px) scale(1.01);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* Loading states */
|
|
261
|
+
.memori-chat-layout--loading {
|
|
262
|
+
position: relative;
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.memori-chat-layout--loading::before {
|
|
267
|
+
position: absolute;
|
|
268
|
+
z-index: 1;
|
|
269
|
+
top: 0;
|
|
270
|
+
left: -100%;
|
|
271
|
+
width: 100%;
|
|
272
|
+
height: 100%;
|
|
273
|
+
animation: loading-shimmer 1.5s infinite;
|
|
274
|
+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
|
275
|
+
content: '';
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@keyframes loading-shimmer {
|
|
279
|
+
0% { left: -100%; }
|
|
280
|
+
100% { left: 100%; }
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Success animations */
|
|
284
|
+
.memori-chat-layout--success {
|
|
285
|
+
animation: success-pulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
@keyframes success-pulse {
|
|
289
|
+
0% { transform: scale(1); }
|
|
290
|
+
50% { transform: scale(1.02); }
|
|
291
|
+
100% { transform: scale(1); }
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/* Error states */
|
|
295
|
+
.memori-chat-layout--error {
|
|
296
|
+
animation: error-shake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@keyframes error-shake {
|
|
300
|
+
0%, 100% { transform: translateX(0); }
|
|
301
|
+
25% { transform: translateX(-4px); }
|
|
302
|
+
75% { transform: translateX(4px); }
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* Focus states for accessibility */
|
|
306
|
+
.memori-chat-layout--controls:focus-within {
|
|
307
|
+
border-radius: 12px;
|
|
308
|
+
box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
|
|
309
|
+
outline: 2px solid #007bff;
|
|
310
|
+
outline-offset: 2px;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* High contrast mode support */
|
|
314
|
+
@media (prefers-contrast: high) {
|
|
315
|
+
.memori-chat-layout--main {
|
|
316
|
+
border: 2px solid #333;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.memori-chat-layout--controls {
|
|
320
|
+
border: 2px solid #333;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.memori-chat-layout--artifact-panel {
|
|
324
|
+
border: 2px solid #333;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* Reduced motion support */
|
|
329
|
+
@media (prefers-reduced-motion: reduce) {
|
|
330
|
+
.memori-chat-layout--main,
|
|
331
|
+
.memori-chat-layout--controls,
|
|
332
|
+
.memori-chat-layout--artifact-panel,
|
|
333
|
+
.memori-chat-layout--header {
|
|
334
|
+
animation: none;
|
|
335
|
+
transition: none;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.memori-chat-layout--main:hover {
|
|
339
|
+
transform: none;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.memori-chat-layout--controls:hover {
|
|
343
|
+
transform: none;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.memori-chat-layout--artifact-panel:hover {
|
|
347
|
+
transform: none;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.memori-chat-layout--artifact-panel-enter {
|
|
351
|
+
animation: none;
|
|
352
|
+
opacity: 1;
|
|
353
|
+
transform: translateX(0) scale(1);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
.memori-chat-layout--artifact-drawer {
|
|
359
|
+
position: fixed;
|
|
360
|
+
z-index: 1000;
|
|
361
|
+
top: 0;
|
|
362
|
+
right: 0;
|
|
363
|
+
bottom: 0;
|
|
364
|
+
left: 0;
|
|
365
|
+
pointer-events: none;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.memori-chat-layout--artifact-drawer .memori-artifact-drawer {
|
|
369
|
+
pointer-events: auto;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/* Mobile drawer animations */
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
.memori-chat-layout--artifact-drawer[data-headlessui-state~="open"] {
|
|
376
|
+
opacity: 1;
|
|
377
|
+
visibility: visible;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.memori-chat-layout--artifact-drawer[data-headlessui-state~="open"] .memori-artifact-drawer {
|
|
381
|
+
animation: mobile-drawer-slide-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
382
|
+
transform: translateX(0);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
@keyframes mobile-drawer-slide-in {
|
|
386
|
+
0% {
|
|
387
|
+
opacity: 0;
|
|
388
|
+
transform: translateX(100%);
|
|
389
|
+
}
|
|
390
|
+
50% {
|
|
391
|
+
opacity: 0.8;
|
|
392
|
+
transform: translateX(50%);
|
|
393
|
+
}
|
|
394
|
+
100% {
|
|
395
|
+
opacity: 1;
|
|
396
|
+
transform: translateX(0);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* Adjust chat layout when drawer is open */
|
|
401
|
+
.memori-chat-layout:has(.memori-chat-layout--artifact-drawer .memori-artifact-drawer[data-headlessui-state~="open"]) .memori-chat-layout--controls {
|
|
402
|
+
margin-right: 50%;
|
|
403
|
+
filter: blur(1px);
|
|
404
|
+
opacity: 0.8;
|
|
405
|
+
transform: scale(0.98);
|
|
406
|
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.memori-chat-layout:has(.memori-chat-layout--artifact-drawer .memori-artifact-drawer[data-headlessui-state~="open"]) .memori-chat-layout--main {
|
|
410
|
+
backdrop-filter: blur(5px);
|
|
411
|
+
background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(248, 250, 252, 0.02) 100%);
|
|
412
|
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* Mobile adjustments */
|
|
416
|
+
@media (max-width: 768px) {
|
|
417
|
+
.memori-chat-layout--main {
|
|
418
|
+
flex-direction: column !important;
|
|
419
|
+
padding: 0.5rem !important;
|
|
420
|
+
backdrop-filter: blur(10px) !important;
|
|
421
|
+
background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(248, 250, 252, 0.02) 100%) !important;
|
|
422
|
+
gap: 0.5rem !important;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.memori-chat-layout--artifact-panel {
|
|
426
|
+
display: none !important;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.memori-chat-layout--controls {
|
|
430
|
+
max-height: calc(100% - 50px) !important;
|
|
431
|
+
flex: 1 !important;
|
|
432
|
+
border: 1px solid rgba(255, 255, 255, 0.3) !important;
|
|
433
|
+
margin: 0 !important;
|
|
434
|
+
/* background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.6) 100%) !important;
|
|
435
|
+
backdrop-filter: blur(20px) !important;
|
|
436
|
+
border-radius: 12px !important; */
|
|
437
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.memori-chat-layout:has(.memori-chat-layout--artifact-drawer .memori-artifact-drawer[data-headlessui-state~="open"]) .memori-chat-layout--controls {
|
|
441
|
+
margin-right: 0;
|
|
442
|
+
filter: blur(2px);
|
|
443
|
+
opacity: 0.7;
|
|
444
|
+
transform: scale(0.95);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.memori-chat-layout--artifact-drawer {
|
|
448
|
+
backdrop-filter: blur(12px) saturate(200%) !important;
|
|
449
|
+
background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%) !important;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
@@ -5,6 +5,7 @@ import Memori, { LayoutProps, Props } from '../MemoriWidget/MemoriWidget';
|
|
|
5
5
|
import I18nWrapper from '../../I18nWrapper';
|
|
6
6
|
import Spin from '../ui/Spin';
|
|
7
7
|
import { VisemeProvider } from '../../context/visemeContext';
|
|
8
|
+
import { ArtifactSystemProvider } from '../MemoriArtifactSystem';
|
|
8
9
|
|
|
9
10
|
const meta: Meta = {
|
|
10
11
|
title: 'General/Layouts',
|
|
@@ -26,9 +27,21 @@ export default meta;
|
|
|
26
27
|
|
|
27
28
|
const Template: Story<Props> = args => (
|
|
28
29
|
<I18nWrapper>
|
|
30
|
+
<ArtifactSystemProvider config={{
|
|
31
|
+
supportedMimeTypes: {
|
|
32
|
+
html: {
|
|
33
|
+
name: 'HTML',
|
|
34
|
+
icon: '🌐',
|
|
35
|
+
hasPreview: true,
|
|
36
|
+
language: 'html',
|
|
37
|
+
mimeType: 'text/html',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}}>
|
|
29
41
|
<VisemeProvider>
|
|
30
42
|
<Memori {...args} />
|
|
31
43
|
</VisemeProvider>
|
|
44
|
+
</ArtifactSystemProvider>
|
|
32
45
|
</I18nWrapper>
|
|
33
46
|
);
|
|
34
47
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
@@ -267,8 +280,6 @@ export const CustomLayout: React.FC<LayoutProps> = ({
|
|
|
267
280
|
startPanelProps,
|
|
268
281
|
integrationStyle,
|
|
269
282
|
integrationBackground,
|
|
270
|
-
ChangeMode,
|
|
271
|
-
changeModeProps,
|
|
272
283
|
sessionId,
|
|
273
284
|
hasUserActivatedSpeak,
|
|
274
285
|
loading = false,
|
package/src/helpers/message.ts
CHANGED
|
@@ -87,6 +87,7 @@ export const renderMsg = (
|
|
|
87
87
|
/<document_attachment filename="([^"]+)" type="([^"]+)">([\s\S]*?)<\/document_attachment>/g,
|
|
88
88
|
''
|
|
89
89
|
)
|
|
90
|
+
.replaceAll(/<output\s+class\s*=\s*["\']memori-artifact["\'][^>]*data-mimetype\s*=\s*["\']([^"']+)["\'][^>]*>([\s\S]*?)(?:<\/output>|$)/gi, '')
|
|
90
91
|
.replaceAll(/```markdown([^```]+)```/g, '$1')
|
|
91
92
|
.replaceAll('($', '( $')
|
|
92
93
|
.replaceAll(':$', ': $')
|
package/src/index.stories.tsx
CHANGED
|
@@ -258,20 +258,20 @@ NunzioFiore.args = {
|
|
|
258
258
|
|
|
259
259
|
export const TestCustomAnimationsWithRPMSequence = Template.bind({});
|
|
260
260
|
TestCustomAnimationsWithRPMSequence.args = {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
261
|
+
memoriName: 'Dancing Avatar',
|
|
262
|
+
ownerUserName: 'andrea.patini3',
|
|
263
|
+
memoriID: '45420d30-a103-455c-bab1-b708a0566a02',
|
|
264
|
+
ownerUserID: '58770358-a5db-4b49-b3a4-734fc468e745',
|
|
265
|
+
tenantID: 'aisuru-staging.aclambda.online',
|
|
266
|
+
engineURL: 'https://engine-staging.memori.ai/memori/v2',
|
|
267
|
+
apiURL: 'https://backend-staging.memori.ai/api/v2',
|
|
268
|
+
baseURL: 'https://aisuru-staging.aclambda.online',
|
|
269
|
+
uiLang: 'IT',
|
|
270
|
+
spokenLang: 'IT',
|
|
271
|
+
layout: 'HIDDEN_CHAT',
|
|
272
|
+
showLogin: true,
|
|
273
|
+
autoStart: true,
|
|
274
|
+
integrationID: '2f6e11a0-d799-4974-aa17-cf111d0af82a',
|
|
275
275
|
};
|
|
276
276
|
|
|
277
277
|
export const TestCustomGLBSingleAnimation = Template.bind({});
|
|
@@ -397,12 +397,16 @@ WithCustomUserAvatar.args = {
|
|
|
397
397
|
|
|
398
398
|
export const Test = Template.bind({});
|
|
399
399
|
Test.args = {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
400
|
+
memoriName: 'Test Artifact',
|
|
401
|
+
ownerUserName: 'Andrea-Patini',
|
|
402
|
+
memoriID: '8cec936c-d440-4781-91df-e4ddf044255e',
|
|
403
|
+
ownerUserID: '91dbc9ba-b684-4fbe-9828-b5980af6cda9',
|
|
404
|
+
tenantID: 'aisuru-staging.aclambda.online',
|
|
405
|
+
engineURL: 'https://engine-staging.memori.ai/memori/v2',
|
|
406
|
+
apiURL: 'https://backend-staging.memori.ai/api/v2',
|
|
407
|
+
baseURL: 'https://aisuru-staging.aclambda.online',
|
|
408
|
+
layout: 'FULLPAGE',
|
|
409
|
+
uiLang: 'EN',
|
|
410
|
+
spokenLang: 'EN',
|
|
411
|
+
integrationID: '2b37c25d-8cf9-456f-b9ee-2c27dc4d54fc',
|
|
408
412
|
};
|
package/src/index.tsx
CHANGED
|
@@ -21,6 +21,7 @@ import { safeParseJSON } from './helpers/utils';
|
|
|
21
21
|
import i18n from './i18n';
|
|
22
22
|
import { useTranslation } from 'react-i18next';
|
|
23
23
|
import I18nWrapper from './I18nWrapper';
|
|
24
|
+
import { ArtifactSystemProvider } from './components/MemoriArtifactSystem';
|
|
24
25
|
|
|
25
26
|
export interface Props {
|
|
26
27
|
memoriName?: string | null;
|
|
@@ -332,6 +333,50 @@ const Memori: React.FC<Props> = ({
|
|
|
332
333
|
return (
|
|
333
334
|
<I18nWrapper>
|
|
334
335
|
<VisemeProvider>
|
|
336
|
+
<ArtifactSystemProvider config={{
|
|
337
|
+
supportedMimeTypes: {
|
|
338
|
+
html: {
|
|
339
|
+
name: 'HTML',
|
|
340
|
+
icon: '🌐',
|
|
341
|
+
hasPreview: true,
|
|
342
|
+
language: 'html',
|
|
343
|
+
mimeType: 'text/html',
|
|
344
|
+
},
|
|
345
|
+
css: {
|
|
346
|
+
name: 'CSS',
|
|
347
|
+
icon: '🎨',
|
|
348
|
+
hasPreview: false,
|
|
349
|
+
language: 'css',
|
|
350
|
+
mimeType: 'text/css',
|
|
351
|
+
},
|
|
352
|
+
javascript: {
|
|
353
|
+
name: 'JavaScript',
|
|
354
|
+
icon: '⚡',
|
|
355
|
+
hasPreview: false,
|
|
356
|
+
language: 'javascript',
|
|
357
|
+
mimeType: 'text/javascript',
|
|
358
|
+
},
|
|
359
|
+
typescript: {
|
|
360
|
+
name: 'TypeScript',
|
|
361
|
+
icon: '🔷',
|
|
362
|
+
hasPreview: false,
|
|
363
|
+
language: 'typescript',
|
|
364
|
+
mimeType: 'text/typescript',
|
|
365
|
+
},
|
|
366
|
+
markdown: {
|
|
367
|
+
name: 'Markdown',
|
|
368
|
+
icon: '📝',
|
|
369
|
+
hasPreview: true,
|
|
370
|
+
language: 'markdown',
|
|
371
|
+
mimeType: 'text/markdown',
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
autoOpenArtifacts: true,
|
|
375
|
+
enableSyntaxHighlighting: true,
|
|
376
|
+
showLineNumbers: true,
|
|
377
|
+
maxHistoryItems: 10,
|
|
378
|
+
}}>
|
|
379
|
+
|
|
335
380
|
<Toaster position="top-center" reverseOrder={true} />
|
|
336
381
|
{memori ? (
|
|
337
382
|
<MemoriWidget
|
|
@@ -393,6 +438,7 @@ const Memori: React.FC<Props> = ({
|
|
|
393
438
|
</p>
|
|
394
439
|
</div>
|
|
395
440
|
)}
|
|
441
|
+
</ArtifactSystemProvider>
|
|
396
442
|
</VisemeProvider>
|
|
397
443
|
</I18nWrapper>
|
|
398
444
|
);
|