@memori.ai/memori-react 8.15.0 → 8.16.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.
Files changed (166) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/components/Chat/Chat.css +2 -1
  3. package/dist/components/Chat/Chat.js +17 -17
  4. package/dist/components/Chat/Chat.js.map +1 -1
  5. package/dist/components/ChatBubble/ChatBubble.css +1 -1
  6. package/dist/components/ContentPreviewModal/ContentPreviewModal.css +114 -0
  7. package/dist/components/ContentPreviewModal/ContentPreviewModal.d.ts +14 -0
  8. package/dist/components/ContentPreviewModal/ContentPreviewModal.js +18 -0
  9. package/dist/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -0
  10. package/dist/components/ContentPreviewModal/index.d.ts +2 -0
  11. package/dist/components/ContentPreviewModal/index.js +9 -0
  12. package/dist/components/ContentPreviewModal/index.js.map +1 -0
  13. package/dist/components/FilePreview/FilePreview.css +1 -1
  14. package/dist/components/FilePreview/FilePreview.js +43 -13
  15. package/dist/components/FilePreview/FilePreview.js.map +1 -1
  16. package/dist/components/MediaWidget/DocumentCard.d.ts +3 -0
  17. package/dist/components/MediaWidget/DocumentCard.js +9 -0
  18. package/dist/components/MediaWidget/DocumentCard.js.map +1 -0
  19. package/dist/components/MediaWidget/MediaItemWidget.css +946 -19
  20. package/dist/components/MediaWidget/MediaItemWidget.d.ts +5 -36
  21. package/dist/components/MediaWidget/MediaItemWidget.js +295 -198
  22. package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -1
  23. package/dist/components/MediaWidget/MediaItemWidget.types.d.ts +62 -0
  24. package/dist/components/MediaWidget/MediaItemWidget.types.js +3 -0
  25. package/dist/components/MediaWidget/MediaItemWidget.types.js.map +1 -0
  26. package/dist/components/MediaWidget/MediaItemWidget.utils.d.ts +23 -0
  27. package/dist/components/MediaWidget/MediaItemWidget.utils.js +162 -0
  28. package/dist/components/MediaWidget/MediaItemWidget.utils.js.map +1 -0
  29. package/dist/components/MediaWidget/MediaPreviewModal.d.ts +15 -0
  30. package/dist/components/MediaWidget/MediaPreviewModal.js +162 -0
  31. package/dist/components/MediaWidget/MediaPreviewModal.js.map +1 -0
  32. package/dist/components/MediaWidget/MediaWidget.js +1 -2
  33. package/dist/components/MediaWidget/MediaWidget.js.map +1 -1
  34. package/dist/components/Snippet/Snippet.css +64 -33
  35. package/dist/components/Snippet/Snippet.js +17 -4
  36. package/dist/components/Snippet/Snippet.js.map +1 -1
  37. package/dist/components/StartPanel/StartPanel.js +1 -2
  38. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  39. package/dist/components/UploadButton/UploadButton.css +0 -5
  40. package/dist/components/layouts/WebsiteAssistant.js +8 -8
  41. package/dist/components/layouts/WebsiteAssistant.js.map +1 -1
  42. package/dist/components/layouts/chat.css +1 -1
  43. package/dist/components/layouts/website-assistant.css +405 -197
  44. package/dist/helpers/constants.js +0 -7
  45. package/dist/helpers/constants.js.map +1 -1
  46. package/dist/helpers/utils.d.ts +1 -0
  47. package/dist/helpers/utils.js +3 -1
  48. package/dist/helpers/utils.js.map +1 -1
  49. package/dist/index.js +50 -6
  50. package/dist/index.js.map +1 -1
  51. package/dist/styles.css +0 -2
  52. package/dist/version.d.ts +1 -0
  53. package/dist/version.js +5 -0
  54. package/dist/version.js.map +1 -0
  55. package/esm/components/Chat/Chat.css +2 -1
  56. package/esm/components/Chat/Chat.js +17 -17
  57. package/esm/components/Chat/Chat.js.map +1 -1
  58. package/esm/components/ChatBubble/ChatBubble.css +1 -1
  59. package/esm/components/ContentPreviewModal/ContentPreviewModal.css +114 -0
  60. package/esm/components/ContentPreviewModal/ContentPreviewModal.d.ts +14 -0
  61. package/esm/components/ContentPreviewModal/ContentPreviewModal.js +15 -0
  62. package/esm/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -0
  63. package/esm/components/ContentPreviewModal/index.d.ts +2 -0
  64. package/esm/components/ContentPreviewModal/index.js +2 -0
  65. package/esm/components/ContentPreviewModal/index.js.map +1 -0
  66. package/esm/components/FilePreview/FilePreview.css +1 -1
  67. package/esm/components/FilePreview/FilePreview.js +44 -14
  68. package/esm/components/FilePreview/FilePreview.js.map +1 -1
  69. package/esm/components/MediaWidget/DocumentCard.d.ts +3 -0
  70. package/esm/components/MediaWidget/DocumentCard.js +5 -0
  71. package/esm/components/MediaWidget/DocumentCard.js.map +1 -0
  72. package/esm/components/MediaWidget/MediaItemWidget.css +946 -19
  73. package/esm/components/MediaWidget/MediaItemWidget.d.ts +5 -36
  74. package/esm/components/MediaWidget/MediaItemWidget.js +296 -197
  75. package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -1
  76. package/esm/components/MediaWidget/MediaItemWidget.types.d.ts +62 -0
  77. package/esm/components/MediaWidget/MediaItemWidget.types.js +2 -0
  78. package/esm/components/MediaWidget/MediaItemWidget.types.js.map +1 -0
  79. package/esm/components/MediaWidget/MediaItemWidget.utils.d.ts +23 -0
  80. package/esm/components/MediaWidget/MediaItemWidget.utils.js +149 -0
  81. package/esm/components/MediaWidget/MediaItemWidget.utils.js.map +1 -0
  82. package/esm/components/MediaWidget/MediaPreviewModal.d.ts +15 -0
  83. package/esm/components/MediaWidget/MediaPreviewModal.js +157 -0
  84. package/esm/components/MediaWidget/MediaPreviewModal.js.map +1 -0
  85. package/esm/components/MediaWidget/MediaWidget.js +1 -2
  86. package/esm/components/MediaWidget/MediaWidget.js.map +1 -1
  87. package/esm/components/Snippet/Snippet.css +64 -33
  88. package/esm/components/Snippet/Snippet.js +18 -5
  89. package/esm/components/Snippet/Snippet.js.map +1 -1
  90. package/esm/components/StartPanel/StartPanel.js +1 -2
  91. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  92. package/esm/components/UploadButton/UploadButton.css +0 -5
  93. package/esm/components/layouts/WebsiteAssistant.js +8 -8
  94. package/esm/components/layouts/WebsiteAssistant.js.map +1 -1
  95. package/esm/components/layouts/chat.css +1 -1
  96. package/esm/components/layouts/website-assistant.css +405 -197
  97. package/esm/helpers/constants.js +0 -7
  98. package/esm/helpers/constants.js.map +1 -1
  99. package/esm/helpers/utils.d.ts +1 -0
  100. package/esm/helpers/utils.js +1 -0
  101. package/esm/helpers/utils.js.map +1 -1
  102. package/esm/index.js +50 -6
  103. package/esm/index.js.map +1 -1
  104. package/esm/styles.css +0 -2
  105. package/esm/version.d.ts +1 -0
  106. package/esm/version.js +2 -0
  107. package/esm/version.js.map +1 -0
  108. package/package.json +5 -3
  109. package/src/components/Chat/Chat.css +2 -1
  110. package/src/components/Chat/Chat.stories.tsx +124 -0
  111. package/src/components/Chat/Chat.tsx +72 -71
  112. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +567 -1034
  113. package/src/components/ChatBubble/ChatBubble.css +1 -1
  114. package/src/components/ContentPreviewModal/ContentPreviewModal.css +114 -0
  115. package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +69 -0
  116. package/src/components/ContentPreviewModal/index.ts +2 -0
  117. package/src/components/FilePreview/FilePreview.css +1 -1
  118. package/src/components/FilePreview/FilePreview.tsx +60 -37
  119. package/src/components/FilePreview/__snapshots__/FilePreview.test.tsx.snap +15 -105
  120. package/src/components/MediaWidget/DocumentCard.test.tsx +45 -0
  121. package/src/components/MediaWidget/DocumentCard.tsx +19 -0
  122. package/src/components/MediaWidget/MediaItemWidget.css +946 -19
  123. package/src/components/MediaWidget/MediaItemWidget.test.tsx +89 -1
  124. package/src/components/MediaWidget/MediaItemWidget.tsx +734 -461
  125. package/src/components/MediaWidget/MediaItemWidget.types.ts +65 -0
  126. package/src/components/MediaWidget/MediaItemWidget.utils.test.ts +324 -0
  127. package/src/components/MediaWidget/MediaItemWidget.utils.ts +194 -0
  128. package/src/components/MediaWidget/MediaPreviewModal.test.tsx +271 -0
  129. package/src/components/MediaWidget/MediaPreviewModal.tsx +423 -0
  130. package/src/components/MediaWidget/MediaWidget.stories.tsx +193 -0
  131. package/src/components/MediaWidget/MediaWidget.tsx +2 -4
  132. package/src/components/MediaWidget/__snapshots__/DocumentCard.test.tsx.snap +24 -0
  133. package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +162 -170
  134. package/src/components/MediaWidget/__snapshots__/MediaWidget.test.tsx.snap +21 -63
  135. package/src/components/Snippet/Snippet.css +64 -33
  136. package/src/components/Snippet/Snippet.tsx +30 -21
  137. package/src/components/Snippet/__snapshots__/Snippet.test.tsx.snap +314 -297
  138. package/src/components/StartPanel/StartPanel.tsx +0 -9
  139. package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +12 -636
  140. package/src/components/UploadButton/UploadButton.css +0 -5
  141. package/src/components/layouts/WebsiteAssistant.tsx +66 -62
  142. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +1 -53
  143. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +2 -106
  144. package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +1 -53
  145. package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +1 -53
  146. package/src/components/layouts/__snapshots__/WebsiteAssistant.test.tsx.snap +32 -33
  147. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +1 -53
  148. package/src/components/layouts/chat.css +1 -1
  149. package/src/components/layouts/layouts.stories.tsx +68 -0
  150. package/src/components/layouts/website-assistant.css +405 -197
  151. package/src/helpers/constants.ts +0 -7
  152. package/src/helpers/utils.ts +4 -0
  153. package/src/index.test.tsx +8 -0
  154. package/src/index.tsx +55 -5
  155. package/src/styles.css +0 -2
  156. package/src/version.ts +2 -0
  157. package/src/components/AttachmentLinkModal/AttachmentLinkModal.css +0 -68
  158. package/src/components/AttachmentLinkModal/AttachmentLinkModal.stories.tsx +0 -32
  159. package/src/components/AttachmentLinkModal/AttachmentLinkModal.test.tsx +0 -10
  160. package/src/components/AttachmentLinkModal/AttachmentLinkModal.tsx +0 -131
  161. package/src/components/AttachmentLinkModal/__snapshots__/AttachmentLinkModal.test.tsx.snap +0 -9
  162. package/src/components/MediaWidget/LinkItemWidget.css +0 -46
  163. package/src/components/MediaWidget/LinkItemWidget.stories.tsx +0 -61
  164. package/src/components/MediaWidget/LinkItemWidget.test.tsx +0 -33
  165. package/src/components/MediaWidget/LinkItemWidget.tsx +0 -204
  166. package/src/components/MediaWidget/__snapshots__/LinkItemWidget.test.tsx.snap +0 -253
@@ -1,31 +1,103 @@
1
+ .memori-media-items {
2
+ margin-top: 1.5rem;
3
+ }
4
+
1
5
  .memori-media-items--grid {
2
- display: grid;
3
- padding: 1rem;
4
- grid-auto-flow: dense;
5
- grid-gap: 1rem;
6
- grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ justify-content: flex-start;
9
+ padding: 0.5rem;
10
+ gap: 8px;
11
+ }
12
+
13
+ /* Single image: Single column, centered, full width */
14
+ .memori-media-items--grid.memori-media-items--single {
15
+ grid-template-rows: 1fr;
16
+ justify-items: center;
17
+ }
18
+
19
+ .memori-media-items--grid.memori-media-items--single .memori-media-item,
20
+ .memori-media-item--link .memori-media-item--image {
21
+ width: 100%;
22
+ width: 120px;
23
+ max-width: 100%;
24
+ height: 120px;
25
+ }
26
+
27
+ .memori-media-item--link .memori-media-item--image > div {
28
+ height: 100%;
29
+ }
30
+
31
+ /* 2-4 images: Maximum 2 columns, responsive */
32
+ .memori-media-items--grid.memori-media-items--few {
33
+ max-width: 100%;
34
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
35
+ }
36
+
37
+ /* Limit to 2 columns for 2-4 images on tablet and desktop */
38
+ @media (min-width: 641px) {
39
+ .memori-media-items--grid.memori-media-items--few {
40
+ grid-template-columns: repeat(2, minmax(200px, 1fr));
41
+ }
42
+ }
43
+
44
+ /* 5+ images: Maximum 3 columns on desktop */
45
+ .memori-media-items--grid.memori-media-items--many {
46
+ max-width: 100%;
47
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
48
+ }
49
+
50
+ /* Limit to 3 columns for 5+ images on desktop */
51
+ @media (min-width: 1025px) {
52
+ .memori-media-items--grid.memori-media-items--many {
53
+ grid-template-columns: repeat(3, minmax(200px, 1fr));
54
+ }
7
55
  }
8
56
 
9
57
  /* Allineamento media per messaggi dell'utente */
10
58
  .memori-media-items--grid.memori-media-items--user {
59
+ margin-right: 3rem;
11
60
  direction: rtl;
12
61
  }
13
62
 
14
63
  /* Allineamento media per messaggi dell'agente */
15
64
  .memori-media-items--grid.memori-media-items--agent {
65
+ margin-left: 3rem;
16
66
  direction: ltr;
17
67
  }
18
68
 
19
69
  .memori-media-item--card {
20
- margin-bottom: 1rem;
70
+ border: 1px solid #e5e7eb;
71
+ border-radius: 8px;
72
+ margin-bottom: 0;
73
+ background: #f9fafb;
74
+ box-shadow: none;
75
+ transition: box-shadow 0.2s ease;
76
+ }
77
+
78
+ .memori-media-item--card:hover {
79
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
80
+ cursor: pointer;
21
81
  }
22
82
 
23
83
  .memori-media-item--image .memori-card--content {
84
+ display: none;
24
85
  padding: 0;
25
86
  }
26
87
 
88
+ .memori-media-item--image .memori-card {
89
+ overflow: hidden;
90
+ border: 1px solid #e5e7eb;
91
+ border-radius: 8px;
92
+ margin: 0;
93
+ background: #f9fafb;
94
+ box-shadow: none;
95
+ }
96
+
27
97
  .memori-media-item .memori-card--cover {
28
98
  height: auto;
99
+ border-radius: 0;
100
+ background: transparent;
29
101
  }
30
102
 
31
103
  .memori-media-item .memori-card--cover audio,
@@ -34,18 +106,30 @@
34
106
  }
35
107
 
36
108
  .memori-media-item--image .memori-card--cover {
37
- height: auto;
109
+ overflow: hidden;
110
+ height: 100%;
111
+ padding: 0;
112
+ border: none;
113
+ border-radius: 0;
114
+ margin: 0;
38
115
  background: transparent;
39
116
  }
40
117
 
41
118
  .memori-media-item--figure {
42
119
  display: flex;
120
+ overflow: hidden;
43
121
  width: 100%;
44
122
  height: 100%;
45
- max-height: 150px;
46
123
  flex-direction: column;
47
124
  align-items: center;
48
125
  justify-content: center;
126
+ border-radius: 8px;
127
+ }
128
+
129
+ /* Single image: max-height 400px */
130
+ .memori-media-items--single .memori-media-item--figure {
131
+ min-height: 120px;
132
+ max-height: 120px;
49
133
  }
50
134
 
51
135
  .memori-media-item--rgb-item {
@@ -55,8 +139,10 @@
55
139
  }
56
140
 
57
141
  .memori-media-item--figure img {
58
- min-width: 100%;
59
- min-height: 100%;
142
+ display: block;
143
+ width: 100%;
144
+ height: auto;
145
+ max-height: inherit;
60
146
  object-fit: cover;
61
147
  object-position: center;
62
148
  }
@@ -78,8 +164,15 @@
78
164
  word-break: break-word;
79
165
  }
80
166
 
81
- a.memori-media-item--link {
167
+ a.memori-media-item--link,
168
+ div.memori-media-item--link.memori-media-item--image-link {
169
+ display: block;
170
+ overflow: hidden;
171
+ width: 100%;
172
+ height: 100%;
173
+ border-radius: 8px;
82
174
  text-decoration: none;
175
+ transition: box-shadow 0.2s ease;
83
176
  }
84
177
 
85
178
  .memori-media-item--icon {
@@ -164,6 +257,124 @@ a.memori-media-item--link {
164
257
  z-index: 1000;
165
258
  }
166
259
 
260
+ .memori-media-item--modal-iframe-wrap {
261
+ display: flex;
262
+ width: 100%;
263
+ min-height: 60vh;
264
+ flex: 1;
265
+ }
266
+
267
+ .memori-media-item--modal-iframe {
268
+ width: 100%;
269
+ min-height: 60vh;
270
+ flex: 1;
271
+ border: none;
272
+ border-radius: 8px;
273
+ }
274
+
275
+ /* Video in modal */
276
+ .memori-media-item--modal-video-wrap {
277
+ display: flex;
278
+ width: 100%;
279
+ min-height: 40vh;
280
+ max-height: 70vh;
281
+ }
282
+
283
+ .memori-media-item--modal-video {
284
+ width: 100%;
285
+ max-height: 70vh;
286
+ border-radius: 8px;
287
+ object-fit: contain;
288
+ }
289
+
290
+ /* Audio in modal */
291
+ .memori-media-item--modal-audio-wrap {
292
+ display: flex;
293
+ width: 100%;
294
+ flex-direction: column;
295
+ padding: 1rem 0;
296
+ gap: 1rem;
297
+ }
298
+
299
+ .memori-media-item--modal-audio-title {
300
+ margin: 0;
301
+ color: var(--memori-color-text, #1f2937);
302
+ font-size: 1rem;
303
+ font-weight: 600;
304
+ }
305
+
306
+ .memori-media-item--modal-audio {
307
+ width: 100%;
308
+ max-width: 400px;
309
+ }
310
+
311
+ /* 3D model in modal */
312
+ .memori-media-item--modal-3d-wrap {
313
+ display: flex;
314
+ width: 100%;
315
+ min-height: 60vh;
316
+ }
317
+
318
+ .memori-media-item--modal-3d-wrap .model-viewer {
319
+ width: 100%;
320
+ min-height: 60vh;
321
+ }
322
+
323
+ /* Fallback when preview not available (Word, unknown types) */
324
+ .memori-media-item--modal-fallback {
325
+ display: flex;
326
+ min-height: 200px;
327
+ flex-direction: column;
328
+ align-items: center;
329
+ justify-content: center;
330
+ padding: 2rem;
331
+ gap: 1rem;
332
+ text-align: center;
333
+ }
334
+
335
+ .memori-media-item--modal-fallback-message {
336
+ margin: 0;
337
+ color: var(--memori-color-text, #374151);
338
+ font-size: 1rem;
339
+ font-weight: 500;
340
+ }
341
+
342
+ .memori-media-item--modal-fallback-hint {
343
+ margin: 0;
344
+ color: var(--memori-color-text-secondary, #6b7280);
345
+ font-size: 0.875rem;
346
+ }
347
+
348
+ .memori-media-item--modal-fallback-actions {
349
+ display: flex;
350
+ flex-wrap: wrap;
351
+ justify-content: center;
352
+ gap: 1rem;
353
+ }
354
+
355
+ .memori-media-item--modal-fallback-link {
356
+ padding: 0.5rem 1rem;
357
+ border: 1px solid var(--memori-border-color, #e5e7eb);
358
+ border-radius: 8px;
359
+ background: var(--memori-background-color, #fff);
360
+ color: var(--memori-color-primary, #2563eb);
361
+ font-size: 0.875rem;
362
+ font-weight: 500;
363
+ text-decoration: none;
364
+ transition: background 0.2s, border-color 0.2s;
365
+ }
366
+
367
+ .memori-media-item--modal-fallback-link:hover {
368
+ border-color: var(--memori-color-primary, #2563eb);
369
+ background: var(--memori-background-hover, #f9fafb);
370
+ }
371
+
372
+ .memori-media-item--snippet-body {
373
+ display: flex;
374
+ width: 100%;
375
+ flex-direction: column;
376
+ }
377
+
167
378
  .memori-media-item-preview--content {
168
379
  display: flex;
169
380
  overflow: hidden;
@@ -264,25 +475,55 @@ a.memori-media-item--link {
264
475
  text-decoration: none;
265
476
  }
266
477
 
478
+ .memori-media-item--snippet-title {
479
+ flex: 1;
480
+ margin: 0;
481
+ margin-bottom: 0.5rem;
482
+ -webkit-box-orient: vertical;
483
+ color: #111827;
484
+ direction: ltr;
485
+ font-size: 14px;
486
+ font-weight: 500;
487
+ }
488
+
489
+ .memori-media-item--snippet-header {
490
+ display: flex;
491
+ align-items: center;
492
+ justify-content: flex-end;
493
+ padding: 0.5rem 0.75rem;
494
+ }
495
+
496
+ .memori-media-item--snippet-meta {
497
+ color: #9ca3af;
498
+ font-size: 12px;
499
+ }
500
+
267
501
  .memori-media-item--snippet {
268
- min-width: 450px;
502
+ width: 100%;
503
+ min-width: 0;
269
504
  max-width: 100%;
270
505
  }
271
506
 
272
507
  .memori-media-item--snippet-direct {
273
508
  display: flex;
274
509
  width: 100%;
510
+ min-width: 0;
275
511
  margin-bottom: 1rem;
276
512
  }
277
513
 
278
- /* Enhanced snippet grid layout */
514
+ /* Snippet card: full width of parent so it resizes with container */
515
+ .memori-media-items--grid .memori-media-item:has(.memori-media-item--snippet) {
516
+ width: 100%;
517
+ min-width: 0;
518
+ }
519
+
279
520
  .memori-media-items--grid .memori-media-item--snippet-direct {
280
521
  max-width: none;
281
- grid-column: 1 / -1;
282
522
  }
283
523
 
284
524
  .memori-media-items--grid .memori-media-item--snippet {
285
- min-width: 100%;
525
+ width: 100%;
526
+ min-width: 0;
286
527
  max-width: 100%;
287
528
  }
288
529
 
@@ -306,6 +547,36 @@ a.memori-media-item--link {
306
547
  background: #f8fafc;
307
548
  }
308
549
 
550
+ /* Lower specificity selectors must come before higher specificity ones */
551
+ .memori-media-item--audio-icon svg {
552
+ width: 20px;
553
+ height: 20px;
554
+ color: white;
555
+ }
556
+
557
+ .memori-media-item--generic-file-icon svg {
558
+ width: 24px;
559
+ height: 24px;
560
+ color: white;
561
+ }
562
+
563
+ .memori-media-item--code-body pre {
564
+ padding: 0;
565
+ border: none;
566
+ margin: 0;
567
+ background: transparent;
568
+ color: #d4d4d4;
569
+ font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
570
+ font-size: 13px;
571
+ line-height: 1.6;
572
+ }
573
+
574
+ .memori-media-item--code-body code {
575
+ padding: 0;
576
+ border-radius: 0;
577
+ background: transparent;
578
+ }
579
+
309
580
  .memori-media-item--snippet-direct .memori-snippet pre {
310
581
  padding: 1rem;
311
582
  border: none;
@@ -330,7 +601,6 @@ a.memori-media-item--link {
330
601
  transition: all 0.2s ease;
331
602
  }
332
603
 
333
-
334
604
  .memori-media-item--snippet-direct .memori-snippet--copy-button svg {
335
605
  width: 14px;
336
606
  height: 14px;
@@ -373,6 +643,9 @@ a.memori-media-item--link {
373
643
  background: #1e1e1e;
374
644
  font-size: 0.875rem;
375
645
  line-height: 1.6;
646
+ white-space: pre-wrap;
647
+ word-break: break-word;
648
+ word-wrap: break-word;
376
649
  }
377
650
 
378
651
  .memori-media-item-preview--content .memori-snippet code {
@@ -393,7 +666,6 @@ a.memori-media-item--link {
393
666
  transition: all 0.2s ease;
394
667
  }
395
668
 
396
-
397
669
  .memori-media-item-preview--content .memori-snippet--copy-button:hover {
398
670
  border-color: rgba(255, 255, 255, 0.3);
399
671
  background: rgba(255, 255, 255, 0.2);
@@ -416,11 +688,47 @@ a.memori-media-item--link {
416
688
  }
417
689
 
418
690
  /* Responsive design */
691
+ /* Mobile (≤640px): Force single column layout */
692
+ @media (max-width: 640px) {
693
+ .memori-media-items--grid {
694
+ padding: 0.75rem;
695
+ gap: 8px;
696
+ grid-template-columns: 1fr !important;
697
+ }
698
+
699
+ .memori-media-items--grid.memori-media-items--single,
700
+ .memori-media-items--grid.memori-media-items--few,
701
+ .memori-media-items--grid.memori-media-items--many {
702
+ grid-template-columns: 1fr !important;
703
+ }
704
+ }
705
+
706
+ /* Tablet (641px-1024px): 2 columns max, min 250px per column */
707
+ @media (min-width: 641px) and (max-width: 1024px) {
708
+ .memori-media-items--grid.memori-media-items--few {
709
+ max-width: 100%;
710
+ grid-template-columns: repeat(2, minmax(250px, 1fr));
711
+ }
712
+
713
+ .memori-media-items--grid.memori-media-items--many {
714
+ max-width: 100%;
715
+ grid-template-columns: repeat(2, minmax(250px, 1fr));
716
+ }
717
+ }
718
+
719
+ /* Desktop (>1024px): 3 columns max for 5+ images */
720
+ @media (min-width: 1025px) {
721
+ .memori-media-items--grid.memori-media-items--many {
722
+ max-width: 100%;
723
+ grid-template-columns: repeat(3, minmax(200px, 1fr));
724
+ }
725
+ }
726
+
727
+ /* Legacy mobile styles for backward compatibility */
419
728
  @media (max-width: 768px) {
420
729
  .memori-media-items--grid {
421
730
  padding: 0.75rem;
422
- grid-gap: 0.75rem;
423
- grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
731
+ gap: 8px;
424
732
  }
425
733
 
426
734
  .memori-media-item--figure-caption {
@@ -469,3 +777,622 @@ a.memori-media-item--link {
469
777
  font-size: 0.8rem;
470
778
  }
471
779
  }
780
+
781
+ /* ============================================
782
+ DOCUMENTS (Claude-style: filename, icon, meta)
783
+ ============================================ */
784
+ a.memori-media-item--document-link {
785
+ display: block;
786
+ width: 100%;
787
+ color: inherit;
788
+ text-decoration: none;
789
+ }
790
+
791
+ .memori-media-item--document {
792
+ position: relative;
793
+ display: flex;
794
+ width: 100%;
795
+ min-height: 100px;
796
+ flex-direction: column;
797
+ padding: 12px;
798
+ border: 1px solid #e5e7eb;
799
+ border-radius: 8px;
800
+ background: #fff;
801
+ cursor: pointer;
802
+ transition: box-shadow 0.2s ease;
803
+ }
804
+
805
+ .memori-media-item--document:hover {
806
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
807
+ }
808
+
809
+ .memori-media-item--document:active {
810
+ transform: scale(0.99);
811
+ }
812
+
813
+ .memori-media-item--document-header {
814
+ display: flex;
815
+ align-items: flex-start;
816
+ gap: 12px;
817
+ }
818
+
819
+ .memori-media-item--document-icon {
820
+ display: flex;
821
+ width: 40px;
822
+ height: 40px;
823
+ flex-shrink: 0;
824
+ align-items: center;
825
+ justify-content: center;
826
+ border-radius: 8px;
827
+ background: #f3f4f6;
828
+ color: #374151;
829
+ }
830
+
831
+ .memori-media-item--document-icon-svg {
832
+ width: 20px;
833
+ height: 20px;
834
+ color: #374151;
835
+ }
836
+
837
+ .memori-media-item--document-title {
838
+ display: -webkit-box;
839
+ overflow: hidden;
840
+ flex: 1;
841
+ margin: 0;
842
+ -webkit-box-orient: vertical;
843
+ color: #111827;
844
+ direction: ltr;
845
+ font-size: 14px;
846
+ font-weight: 500;
847
+ -webkit-line-clamp: 3;
848
+ overflow-wrap: break-word;
849
+ }
850
+
851
+ .memori-media-item--document-badge {
852
+ position: absolute;
853
+ right: 12px;
854
+ bottom: 12px;
855
+ padding: 4px 8px;
856
+ border-radius: 6px;
857
+ background: #f3f4f6;
858
+ color: #374151;
859
+ font-size: 11px;
860
+ font-weight: 600;
861
+ letter-spacing: 0.02em;
862
+ text-transform: uppercase;
863
+ }
864
+
865
+ /* Document items in grid: compact, full width */
866
+ .memori-media-items--grid .memori-media-item--document-link {
867
+ width: 100%;
868
+ }
869
+
870
+ .memori-media-items--grid .memori-media-item--document {
871
+ min-width: 120px;
872
+ max-width: 120px;
873
+ min-height: 120px;
874
+ box-sizing: border-box;
875
+ }
876
+
877
+ /* ============================================
878
+ VIDEOS (MP4, QuickTime, AVI, MPEG)
879
+ ============================================ */
880
+ .memori-media-item--video-container {
881
+ position: relative;
882
+ overflow: hidden;
883
+ width: 100%;
884
+ border: 1px solid #e5e7eb;
885
+ border-radius: 8px;
886
+ background: #000;
887
+ cursor: pointer;
888
+ transition: box-shadow 0.2s ease;
889
+ }
890
+
891
+ .memori-media-item--video-container:hover {
892
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
893
+ }
894
+
895
+ .memori-media-item--video-player {
896
+ display: block;
897
+ width: 100%;
898
+ height: auto;
899
+ min-height: 120px;
900
+ max-height: 400px;
901
+ border-radius: 8px;
902
+ }
903
+
904
+ .memori-media-item--video-overlay {
905
+ position: absolute;
906
+ z-index: 1;
907
+ top: 50%;
908
+ left: 50%;
909
+ display: flex;
910
+ width: 64px;
911
+ height: 64px;
912
+ align-items: center;
913
+ justify-content: center;
914
+ border-radius: 50%;
915
+ background: rgba(0, 0, 0, 0.6);
916
+ pointer-events: none;
917
+ transform: translate(-50%, -50%);
918
+ transition: opacity 0.2s ease;
919
+ }
920
+
921
+ .memori-media-item--video-container:hover .memori-media-item--video-overlay {
922
+ opacity: 0.8;
923
+ }
924
+
925
+ .memori-media-item--video-overlay.hidden {
926
+ display: none;
927
+ }
928
+
929
+ .memori-media-item--play-icon {
930
+ width: 32px;
931
+ height: 32px;
932
+ color: white;
933
+ }
934
+
935
+ /* ============================================
936
+ AUDIO (MP3, WAV, MPEG)
937
+ ============================================ */
938
+ .memori-media-item--audio-container {
939
+ display: flex;
940
+ width: 100%;
941
+ min-height: 120px;
942
+ box-sizing: border-box;
943
+ align-items: center;
944
+ padding: 16px;
945
+ border: 1px solid #e5e7eb;
946
+ border-radius: 8px;
947
+ background: #f9fafb;
948
+ gap: 12px;
949
+ transition: box-shadow 0.2s ease;
950
+ }
951
+
952
+ .memori-media-item--audio-container:hover {
953
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
954
+ }
955
+
956
+ .memori-media-item--audio-icon {
957
+ display: flex;
958
+ width: 40px;
959
+ height: 40px;
960
+ flex-shrink: 0;
961
+ align-items: center;
962
+ justify-content: center;
963
+ border-radius: 50%;
964
+ background: #3b82f6;
965
+ }
966
+
967
+ .memori-media-item--audio-player {
968
+ min-width: 0;
969
+ height: 32px;
970
+ flex: 1;
971
+ }
972
+
973
+ .memori-media-item--audio-player::-webkit-media-controls-panel {
974
+ background: transparent;
975
+ }
976
+
977
+ /* ============================================
978
+ 3D MODELS (GLTF)
979
+ ============================================ */
980
+ .memori-media-item--model-container {
981
+ position: relative;
982
+ overflow: hidden;
983
+ width: 100%;
984
+ height: 400px;
985
+ border: 1px solid #e5e7eb;
986
+ border-radius: 8px;
987
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
988
+ cursor: grab;
989
+ transition: box-shadow 0.2s ease;
990
+ }
991
+
992
+ .memori-media-item--model-container:hover {
993
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
994
+ }
995
+
996
+ .memori-media-item--model-container:active {
997
+ cursor: grabbing;
998
+ }
999
+
1000
+ .memori-media-item--model-viewer {
1001
+ width: 100%;
1002
+ height: 100%;
1003
+ }
1004
+
1005
+ .memori-media-item--model-controls {
1006
+ position: absolute;
1007
+ z-index: 10;
1008
+ right: 12px;
1009
+ bottom: 12px;
1010
+ display: flex;
1011
+ gap: 8px;
1012
+ }
1013
+
1014
+ .memori-media-item--model-control-btn {
1015
+ display: flex;
1016
+ width: 32px;
1017
+ height: 32px;
1018
+ align-items: center;
1019
+ justify-content: center;
1020
+ border: none;
1021
+ border-radius: 6px;
1022
+ background: rgba(0, 0, 0, 0.6);
1023
+ color: white;
1024
+ cursor: pointer;
1025
+ transition: background 0.2s ease;
1026
+ }
1027
+
1028
+ .memori-media-item--model-control-btn:hover {
1029
+ background: rgba(0, 0, 0, 0.8);
1030
+ }
1031
+
1032
+ /* ============================================
1033
+ CODE SNIPPETS (Inline and Block)
1034
+ ============================================ */
1035
+ .memori-media-item--code-snippet-inline {
1036
+ display: flex;
1037
+ width: 100%;
1038
+ align-items: flex-start;
1039
+ padding: 12px 16px;
1040
+ border: 1px solid #e5e7eb;
1041
+ border-radius: 8px;
1042
+ background: #f9fafb;
1043
+ font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
1044
+ font-size: 13px;
1045
+ gap: 12px;
1046
+ transition: box-shadow 0.2s ease;
1047
+ }
1048
+
1049
+ .memori-media-item--code-snippet-inline:hover {
1050
+ box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
1051
+ }
1052
+
1053
+ .memori-media-item--code-language-badge {
1054
+ flex-shrink: 0;
1055
+ padding: 2px 8px;
1056
+ border-radius: 4px;
1057
+ background: #3b82f6;
1058
+ color: white;
1059
+ font-size: 11px;
1060
+ font-weight: 500;
1061
+ line-height: 1.5;
1062
+ text-transform: uppercase;
1063
+ }
1064
+
1065
+ .memori-media-item--code-content {
1066
+ flex: 1;
1067
+ margin: 0;
1068
+ color: #374151;
1069
+ line-height: 1.5;
1070
+ overflow-x: auto;
1071
+ }
1072
+
1073
+ .memori-media-item--code-snippet-block {
1074
+ position: relative;
1075
+ overflow: hidden;
1076
+ width: 100%;
1077
+ border: 1px solid #e5e7eb;
1078
+ border-radius: 8px;
1079
+ background: #1e1e1e;
1080
+ transition: box-shadow 0.2s ease;
1081
+ }
1082
+
1083
+ .memori-media-item--code-snippet-block:hover {
1084
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
1085
+ }
1086
+
1087
+ .memori-media-item--code-header {
1088
+ display: flex;
1089
+ align-items: center;
1090
+ justify-content: space-between;
1091
+ padding: 8px 12px;
1092
+ border-bottom: 1px solid #3e3e3e;
1093
+ background: #2d2d2d;
1094
+ }
1095
+
1096
+ .memori-media-item--code-language {
1097
+ margin: 0;
1098
+ color: #9ca3af;
1099
+ font-size: 12px;
1100
+ font-weight: 500;
1101
+ text-transform: uppercase;
1102
+ }
1103
+
1104
+ .memori-media-item--code-actions {
1105
+ display: flex;
1106
+ gap: 8px;
1107
+ }
1108
+
1109
+ .memori-media-item--code-action-btn {
1110
+ padding: 4px 8px;
1111
+ border: 1px solid #4b5563;
1112
+ border-radius: 4px;
1113
+ background: transparent;
1114
+ color: #9ca3af;
1115
+ cursor: pointer;
1116
+ font-size: 11px;
1117
+ transition: all 0.2s ease;
1118
+ }
1119
+
1120
+ .memori-media-item--code-action-btn:hover {
1121
+ border-color: #6b7280;
1122
+ background: #374151;
1123
+ color: white;
1124
+ }
1125
+
1126
+ .memori-media-item--code-body {
1127
+ max-height: 400px;
1128
+ padding: 16px;
1129
+ overflow-x: auto;
1130
+ overflow-y: auto;
1131
+ }
1132
+
1133
+ /* Syntax highlighting colors (Prism-like) */
1134
+ .memori-media-item--code-body .token.comment {
1135
+ color: #6a9955;
1136
+ }
1137
+
1138
+ .memori-media-item--code-body .token.string {
1139
+ color: #ce9178;
1140
+ }
1141
+
1142
+ .memori-media-item--code-body .token.keyword {
1143
+ color: #569cd6;
1144
+ }
1145
+
1146
+ .memori-media-item--code-body .token.function {
1147
+ color: #dcdcaa;
1148
+ }
1149
+
1150
+ .memori-media-item--code-body .token.number {
1151
+ color: #b5cea8;
1152
+ }
1153
+
1154
+ .memori-media-item--code-body .token.operator {
1155
+ color: #d4d4d4;
1156
+ }
1157
+
1158
+ /* ============================================
1159
+ HTML PREVIEW
1160
+ ============================================ */
1161
+ .memori-media-item--html-preview {
1162
+ overflow: auto;
1163
+ width: 100%;
1164
+ min-height: 200px;
1165
+ max-height: 600px;
1166
+ padding: 16px;
1167
+ border: 1px solid #e5e7eb;
1168
+ border-radius: 8px;
1169
+ background: white;
1170
+ cursor: pointer;
1171
+ transition: box-shadow 0.2s ease;
1172
+ }
1173
+
1174
+ .memori-media-item--html-preview:hover {
1175
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
1176
+ }
1177
+
1178
+ .memori-media-item--html-preview-header {
1179
+ display: flex;
1180
+ align-items: center;
1181
+ justify-content: space-between;
1182
+ padding-bottom: 8px;
1183
+ border-bottom: 1px solid #e5e7eb;
1184
+ margin-bottom: 12px;
1185
+ }
1186
+
1187
+ .memori-media-item--html-preview-title {
1188
+ margin: 0;
1189
+ color: #6b7280;
1190
+ font-size: 12px;
1191
+ font-weight: 500;
1192
+ text-transform: uppercase;
1193
+ }
1194
+
1195
+ .memori-media-item--html-preview-content {
1196
+ color: #111827;
1197
+ font-size: 14px;
1198
+ line-height: 1.6;
1199
+ }
1200
+
1201
+ /* ============================================
1202
+ GENERIC FILES (Fallback)
1203
+ ============================================ */
1204
+ .memori-media-item--generic-file {
1205
+ display: flex;
1206
+ width: 100%;
1207
+ align-items: center;
1208
+ padding: 16px;
1209
+ border: 1px solid #e5e7eb;
1210
+ border-radius: 8px;
1211
+ background: #f9fafb;
1212
+ cursor: pointer;
1213
+ gap: 12px;
1214
+ transition: box-shadow 0.2s ease, transform 0.2s ease;
1215
+ }
1216
+
1217
+ .memori-media-item--generic-file:hover {
1218
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
1219
+ }
1220
+
1221
+ .memori-media-item--generic-file:active {
1222
+ transform: scale(0.98);
1223
+ }
1224
+
1225
+ .memori-media-item--generic-file-icon {
1226
+ display: flex;
1227
+ width: 48px;
1228
+ height: 48px;
1229
+ flex-shrink: 0;
1230
+ align-items: center;
1231
+ justify-content: center;
1232
+ border-radius: 8px;
1233
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
1234
+ }
1235
+
1236
+ .memori-media-item--generic-file-info {
1237
+ min-width: 0;
1238
+ flex: 1;
1239
+ }
1240
+
1241
+ .memori-media-item--generic-file-name {
1242
+ overflow: hidden;
1243
+ margin: 0;
1244
+ color: #111827;
1245
+ font-size: 14px;
1246
+ font-weight: 500;
1247
+ text-overflow: ellipsis;
1248
+ white-space: nowrap;
1249
+ }
1250
+
1251
+ .memori-media-item--generic-file-meta {
1252
+ margin: 0;
1253
+ margin-top: 4px;
1254
+ color: #6b7280;
1255
+ font-size: 12px;
1256
+ }
1257
+
1258
+ .memori-media-item--generic-file-action {
1259
+ flex-shrink: 0;
1260
+ padding: 6px 12px;
1261
+ border: 1px solid #e5e7eb;
1262
+ border-radius: 6px;
1263
+ background: white;
1264
+ color: #374151;
1265
+ cursor: pointer;
1266
+ font-size: 12px;
1267
+ transition: background 0.2s ease;
1268
+ }
1269
+
1270
+ .memori-media-item--generic-file-action:hover {
1271
+ background: #f9fafb;
1272
+ }
1273
+
1274
+ /* ============================================
1275
+ GRID LAYOUTS FOR MIXED MEDIA
1276
+ ============================================ */
1277
+ /* Documents, audio, and generic files stack vertically */
1278
+ .memori-media-items--grid.list-items {
1279
+ max-width: 600px;
1280
+ grid-template-columns: 1fr;
1281
+ }
1282
+
1283
+ /* Videos and 3D models can use 1-2 column layout */
1284
+ .memori-media-items--grid.large-media {
1285
+ grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
1286
+ }
1287
+
1288
+ /* Code snippets can be mixed width */
1289
+ .memori-media-items--grid.code-snippets {
1290
+ max-width: 800px;
1291
+ grid-template-columns: 1fr;
1292
+ }
1293
+
1294
+ /* Responsive adjustments for mixed media */
1295
+ @media (max-width: 640px) {
1296
+ .memori-media-items--grid.large-media {
1297
+ grid-template-columns: 1fr !important;
1298
+ }
1299
+
1300
+ .memori-media-item--model-container {
1301
+ height: 300px;
1302
+ }
1303
+
1304
+ .memori-media-item--video-player {
1305
+ max-height: 300px;
1306
+ }
1307
+ }
1308
+
1309
+ /* ============================================
1310
+ DARK FILE CARDS (Files: TXT, HTML, PDF, DOC, etc.)
1311
+ ============================================ */
1312
+ .memori-media-item--card-file {
1313
+ position: relative;
1314
+ display: flex;
1315
+ min-height: 120px;
1316
+ flex-direction: column;
1317
+ padding: 16px;
1318
+ border: 1px solid rgba(255, 255, 255, 0.1);
1319
+ border-radius: 8px;
1320
+ background: #363636;
1321
+ transition: box-shadow 0.2s ease, transform 0.2s ease;
1322
+ }
1323
+
1324
+ .memori-media-item--card-file:hover {
1325
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
1326
+ cursor: pointer;
1327
+ }
1328
+
1329
+ .memori-media-item--card-file:active {
1330
+ transform: scale(0.98);
1331
+ }
1332
+
1333
+ .memori-media-item--file-content {
1334
+ position: relative;
1335
+ display: flex;
1336
+ height: 100%;
1337
+ flex-direction: column;
1338
+ }
1339
+
1340
+ .memori-media-item--file-title {
1341
+ overflow: hidden;
1342
+ flex: 1;
1343
+ margin-bottom: 8px;
1344
+ color: #ffffff;
1345
+ font-size: 14px;
1346
+ font-weight: 500;
1347
+ line-height: 1.4;
1348
+ text-overflow: ellipsis;
1349
+ white-space: nowrap;
1350
+ }
1351
+
1352
+ .memori-media-item--file-meta {
1353
+ margin-bottom: auto;
1354
+ color: #9ca3af;
1355
+ font-size: 12px;
1356
+ line-height: 1.5;
1357
+ }
1358
+
1359
+ .memori-media-item--file-badge {
1360
+ position: absolute;
1361
+ bottom: 12px;
1362
+ left: 12px;
1363
+ padding: 4px 8px;
1364
+ border-radius: 4px;
1365
+ background: rgba(255, 255, 255, 0.2);
1366
+ color: #ffffff;
1367
+ font-size: 11px;
1368
+ font-weight: 500;
1369
+ letter-spacing: 0.5px;
1370
+ text-transform: uppercase;
1371
+ }
1372
+
1373
+ /* Link preview card styles */
1374
+ .memori-media-item--card-cover-icon {
1375
+ display: flex;
1376
+ min-height: 120px;
1377
+ align-items: center;
1378
+ justify-content: center;
1379
+ padding: 2rem;
1380
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
1381
+ }
1382
+
1383
+ .memori-media-item--card-cover-img {
1384
+ display: block;
1385
+ width: 100%;
1386
+ height: auto;
1387
+ max-height: 300px;
1388
+ object-fit: cover;
1389
+ object-position: center;
1390
+ }
1391
+
1392
+ /* Responsive for file cards */
1393
+ @media (max-width: 640px) {
1394
+ .memori-media-item--card-file {
1395
+ min-height: 100px;
1396
+ padding: 12px;
1397
+ }
1398
+ }