@memori.ai/memori-react 2.22.0 → 3.0.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 +18 -0
- package/dist/I18nWrapper.d.ts +6 -0
- package/dist/I18nWrapper.js +9 -0
- package/dist/I18nWrapper.js.map +1 -0
- package/dist/components/Chat/Chat.d.ts +2 -1
- package/dist/components/Chat/Chat.js +2 -2
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.d.ts +2 -1
- package/dist/components/ChatBubble/ChatBubble.js +30 -18
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.test.js +22 -0
- package/dist/components/ChatBubble/ChatBubble.test.js.map +1 -1
- package/dist/components/ChatTextArea/ChatTextArea.js +3 -1
- package/dist/components/ChatTextArea/ChatTextArea.js.map +1 -1
- package/dist/components/ImageUpload/ImageUpload.js +3 -1
- package/dist/components/ImageUpload/ImageUpload.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +34 -1
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.css +12 -0
- package/dist/components/StartPanel/StartPanel.js +2 -1
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.test.js +7 -0
- package/dist/components/StartPanel/StartPanel.test.js.map +1 -1
- package/dist/components/icons/Group.d.ts +5 -0
- package/dist/components/icons/Group.js +6 -0
- package/dist/components/icons/Group.js.map +1 -0
- package/dist/helpers/media.js +1 -1
- package/dist/helpers/media.js.map +1 -1
- package/dist/helpers/media.test.js +1 -1
- package/dist/helpers/media.test.js.map +1 -1
- package/dist/i18n.d.ts +1 -1
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +2 -0
- package/dist/locales/it.json +2 -0
- package/esm/I18nWrapper.d.ts +6 -0
- package/esm/I18nWrapper.js +6 -0
- package/esm/I18nWrapper.js.map +1 -0
- package/esm/components/Chat/Chat.d.ts +2 -1
- package/esm/components/Chat/Chat.js +2 -2
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.d.ts +2 -1
- package/esm/components/ChatBubble/ChatBubble.js +30 -18
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.test.js +22 -0
- package/esm/components/ChatBubble/ChatBubble.test.js.map +1 -1
- package/esm/components/ChatTextArea/ChatTextArea.js +3 -1
- package/esm/components/ChatTextArea/ChatTextArea.js.map +1 -1
- package/esm/components/ImageUpload/ImageUpload.js +3 -1
- package/esm/components/ImageUpload/ImageUpload.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +34 -1
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.css +12 -0
- package/esm/components/StartPanel/StartPanel.js +2 -1
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.test.js +7 -0
- package/esm/components/StartPanel/StartPanel.test.js.map +1 -1
- package/esm/components/icons/Group.d.ts +5 -0
- package/esm/components/icons/Group.js +4 -0
- package/esm/components/icons/Group.js.map +1 -0
- package/esm/helpers/media.js +1 -1
- package/esm/helpers/media.js.map +1 -1
- package/esm/helpers/media.test.js +1 -1
- package/esm/helpers/media.test.js.map +1 -1
- package/esm/i18n.d.ts +1 -1
- package/esm/i18n.js +3 -3
- package/esm/i18n.js.map +1 -1
- package/esm/index.js +8 -3
- package/esm/index.js.map +1 -1
- package/esm/locales/en.json +2 -0
- package/esm/locales/it.json +2 -0
- package/package.json +2 -2
- package/src/I18nWrapper.tsx +13 -0
- package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +6 -1
- package/src/components/AttachmentLinkModal/AttachmentLinkModal.stories.tsx +6 -1
- package/src/components/AttachmentMediaModal/AttachmentMediaModal.stories.tsx +6 -1
- package/src/components/Auth/Auth.stories.tsx +16 -11
- package/src/components/Avatar/Avatar.stories.tsx +28 -25
- package/src/components/AvatarView/AvatarView.stories.tsx +8 -5
- package/src/components/Blob/Blob.stories.tsx +6 -3
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +6 -1
- package/src/components/ChangeMode/ChangeMode.stories.tsx +9 -6
- package/src/components/Chat/Chat.stories.tsx +8 -5
- package/src/components/Chat/Chat.tsx +4 -0
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +55 -0
- package/src/components/ChatBubble/ChatBubble.stories.tsx +34 -2
- package/src/components/ChatBubble/ChatBubble.test.tsx +32 -0
- package/src/components/ChatBubble/ChatBubble.tsx +37 -9
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +82 -0
- package/src/components/ChatInputs/ChatInputs.stories.tsx +13 -10
- package/src/components/ChatInputs/__snapshots__/ChatInputs.test.tsx.snap +6 -0
- package/src/components/ChatTextArea/ChatTextArea.stories.tsx +6 -3
- package/src/components/ChatTextArea/ChatTextArea.tsx +5 -0
- package/src/components/ChatTextArea/__snapshots__/ChatTextArea.test.tsx.snap +3 -0
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +6 -1
- package/src/components/DateSelector/DateSelector.stories.tsx +6 -2
- package/src/components/ExportHistoryButton/ExportHistoryButton.stories.tsx +11 -6
- package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +6 -2
- package/src/components/Header/Header.stories.tsx +4 -3
- package/src/components/ImageUpload/ImageUpload.stories.tsx +6 -2
- package/src/components/ImageUpload/ImageUpload.tsx +5 -2
- package/src/components/MediaWidget/LinkItemWidget.stories.tsx +6 -1
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +6 -1
- package/src/components/MediaWidget/MediaWidget.stories.tsx +6 -1
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +6 -2
- package/src/components/MemoriWidget/MemoriWidget.tsx +38 -0
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +11 -8
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +17 -13
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +11 -7
- package/src/components/ShareButton/ShareButton.stories.tsx +11 -4
- package/src/components/Snippet/Snippet.stories.tsx +12 -9
- package/src/components/StartPanel/StartPanel.css +12 -0
- package/src/components/StartPanel/StartPanel.stories.tsx +32 -6
- package/src/components/StartPanel/StartPanel.test.tsx +21 -0
- package/src/components/StartPanel/StartPanel.tsx +12 -2
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +89 -0
- package/src/components/Typing/Typing.stories.tsx +6 -2
- package/src/components/UploadMenu/UploadMenu.stories.tsx +16 -13
- package/src/components/icons/Group.tsx +30 -0
- package/src/helpers/media.test.ts +1 -1
- package/src/helpers/media.ts +1 -1
- package/src/i18n.ts +4 -3
- package/src/index.tsx +12 -4
- package/src/locales/en.json +2 -0
- package/src/locales/it.json +2 -0
|
@@ -24,6 +24,7 @@ exports[`renders Chat on X2a state unchanged 1`] = `
|
|
|
24
24
|
>
|
|
25
25
|
<picture
|
|
26
26
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
27
|
+
title="Memori"
|
|
27
28
|
>
|
|
28
29
|
<source
|
|
29
30
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -79,6 +80,7 @@ exports[`renders Chat on X2a state unchanged 1`] = `
|
|
|
79
80
|
>
|
|
80
81
|
<picture
|
|
81
82
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
83
|
+
title="Memori"
|
|
82
84
|
>
|
|
83
85
|
<source
|
|
84
86
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -134,6 +136,7 @@ exports[`renders Chat on X2a state unchanged 1`] = `
|
|
|
134
136
|
>
|
|
135
137
|
<picture
|
|
136
138
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
139
|
+
title="Memori"
|
|
137
140
|
>
|
|
138
141
|
<source
|
|
139
142
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -280,6 +283,7 @@ exports[`renders Chat on X2a state unchanged 1`] = `
|
|
|
280
283
|
>
|
|
281
284
|
<picture
|
|
282
285
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
286
|
+
title="Memori"
|
|
283
287
|
>
|
|
284
288
|
<source
|
|
285
289
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -364,6 +368,7 @@ exports[`renders Chat on X2a state unchanged 1`] = `
|
|
|
364
368
|
>
|
|
365
369
|
<button
|
|
366
370
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
371
|
+
title="expand"
|
|
367
372
|
>
|
|
368
373
|
<span
|
|
369
374
|
class="memori-button--icon"
|
|
@@ -434,6 +439,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
|
|
|
434
439
|
>
|
|
435
440
|
<picture
|
|
436
441
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
442
|
+
title="Memori"
|
|
437
443
|
>
|
|
438
444
|
<source
|
|
439
445
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -489,6 +495,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
|
|
|
489
495
|
>
|
|
490
496
|
<picture
|
|
491
497
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
498
|
+
title="Memori"
|
|
492
499
|
>
|
|
493
500
|
<source
|
|
494
501
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -544,6 +551,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
|
|
|
544
551
|
>
|
|
545
552
|
<picture
|
|
546
553
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
554
|
+
title="Memori"
|
|
547
555
|
>
|
|
548
556
|
<source
|
|
549
557
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -690,6 +698,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
|
|
|
690
698
|
>
|
|
691
699
|
<picture
|
|
692
700
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
701
|
+
title="Memori"
|
|
693
702
|
>
|
|
694
703
|
<source
|
|
695
704
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -807,6 +816,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
|
|
|
807
816
|
>
|
|
808
817
|
<button
|
|
809
818
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
819
|
+
title="expand"
|
|
810
820
|
>
|
|
811
821
|
<span
|
|
812
822
|
class="memori-button--icon"
|
|
@@ -877,6 +887,7 @@ exports[`renders Chat unchanged 1`] = `
|
|
|
877
887
|
>
|
|
878
888
|
<picture
|
|
879
889
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
890
|
+
title="Memori"
|
|
880
891
|
>
|
|
881
892
|
<source
|
|
882
893
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -932,6 +943,7 @@ exports[`renders Chat unchanged 1`] = `
|
|
|
932
943
|
>
|
|
933
944
|
<picture
|
|
934
945
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
946
|
+
title="Memori"
|
|
935
947
|
>
|
|
936
948
|
<source
|
|
937
949
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -987,6 +999,7 @@ exports[`renders Chat unchanged 1`] = `
|
|
|
987
999
|
>
|
|
988
1000
|
<picture
|
|
989
1001
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1002
|
+
title="Memori"
|
|
990
1003
|
>
|
|
991
1004
|
<source
|
|
992
1005
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1118,6 +1131,7 @@ exports[`renders Chat unchanged 1`] = `
|
|
|
1118
1131
|
>
|
|
1119
1132
|
<picture
|
|
1120
1133
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1134
|
+
title="Memori"
|
|
1121
1135
|
>
|
|
1122
1136
|
<source
|
|
1123
1137
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1186,6 +1200,7 @@ exports[`renders Chat unchanged 1`] = `
|
|
|
1186
1200
|
>
|
|
1187
1201
|
<button
|
|
1188
1202
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
1203
|
+
title="expand"
|
|
1189
1204
|
>
|
|
1190
1205
|
<span
|
|
1191
1206
|
class="memori-button--icon"
|
|
@@ -1256,6 +1271,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
|
|
|
1256
1271
|
>
|
|
1257
1272
|
<picture
|
|
1258
1273
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1274
|
+
title="Memori"
|
|
1259
1275
|
>
|
|
1260
1276
|
<source
|
|
1261
1277
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1311,6 +1327,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
|
|
|
1311
1327
|
>
|
|
1312
1328
|
<picture
|
|
1313
1329
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1330
|
+
title="Memori"
|
|
1314
1331
|
>
|
|
1315
1332
|
<source
|
|
1316
1333
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1366,6 +1383,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
|
|
|
1366
1383
|
>
|
|
1367
1384
|
<picture
|
|
1368
1385
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1386
|
+
title="Memori"
|
|
1369
1387
|
>
|
|
1370
1388
|
<source
|
|
1371
1389
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1512,6 +1530,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
|
|
|
1512
1530
|
>
|
|
1513
1531
|
<picture
|
|
1514
1532
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1533
|
+
title="Memori"
|
|
1515
1534
|
>
|
|
1516
1535
|
<source
|
|
1517
1536
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1595,6 +1614,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
|
|
|
1595
1614
|
>
|
|
1596
1615
|
<button
|
|
1597
1616
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
1617
|
+
title="expand"
|
|
1598
1618
|
>
|
|
1599
1619
|
<span
|
|
1600
1620
|
class="memori-button--icon"
|
|
@@ -1665,6 +1685,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
|
|
|
1665
1685
|
>
|
|
1666
1686
|
<picture
|
|
1667
1687
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1688
|
+
title="Memori"
|
|
1668
1689
|
>
|
|
1669
1690
|
<source
|
|
1670
1691
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1712,6 +1733,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
|
|
|
1712
1733
|
>
|
|
1713
1734
|
<picture
|
|
1714
1735
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1736
|
+
title="Memori"
|
|
1715
1737
|
>
|
|
1716
1738
|
<source
|
|
1717
1739
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1759,6 +1781,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
|
|
|
1759
1781
|
>
|
|
1760
1782
|
<picture
|
|
1761
1783
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1784
|
+
title="Memori"
|
|
1762
1785
|
>
|
|
1763
1786
|
<source
|
|
1764
1787
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1882,6 +1905,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
|
|
|
1882
1905
|
>
|
|
1883
1906
|
<picture
|
|
1884
1907
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
1908
|
+
title="Memori"
|
|
1885
1909
|
>
|
|
1886
1910
|
<source
|
|
1887
1911
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -1950,6 +1974,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
|
|
|
1950
1974
|
>
|
|
1951
1975
|
<button
|
|
1952
1976
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
1977
|
+
title="expand"
|
|
1953
1978
|
>
|
|
1954
1979
|
<span
|
|
1955
1980
|
class="memori-button--icon"
|
|
@@ -2020,6 +2045,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
|
|
|
2020
2045
|
>
|
|
2021
2046
|
<picture
|
|
2022
2047
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2048
|
+
title="Memori"
|
|
2023
2049
|
>
|
|
2024
2050
|
<source
|
|
2025
2051
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2069,6 +2095,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
|
|
|
2069
2095
|
>
|
|
2070
2096
|
<picture
|
|
2071
2097
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2098
|
+
title="Memori"
|
|
2072
2099
|
>
|
|
2073
2100
|
<source
|
|
2074
2101
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2118,6 +2145,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
|
|
|
2118
2145
|
>
|
|
2119
2146
|
<picture
|
|
2120
2147
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2148
|
+
title="Memori"
|
|
2121
2149
|
>
|
|
2122
2150
|
<source
|
|
2123
2151
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2243,6 +2271,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
|
|
|
2243
2271
|
>
|
|
2244
2272
|
<picture
|
|
2245
2273
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2274
|
+
title="Memori"
|
|
2246
2275
|
>
|
|
2247
2276
|
<source
|
|
2248
2277
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2311,6 +2340,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
|
|
|
2311
2340
|
>
|
|
2312
2341
|
<button
|
|
2313
2342
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
2343
|
+
title="expand"
|
|
2314
2344
|
>
|
|
2315
2345
|
<span
|
|
2316
2346
|
class="memori-button--icon"
|
|
@@ -2381,6 +2411,7 @@ exports[`renders Chat with dates unchanged 1`] = `
|
|
|
2381
2411
|
>
|
|
2382
2412
|
<picture
|
|
2383
2413
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2414
|
+
title="Memori"
|
|
2384
2415
|
>
|
|
2385
2416
|
<source
|
|
2386
2417
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2446,6 +2477,7 @@ exports[`renders Chat with dates unchanged 1`] = `
|
|
|
2446
2477
|
>
|
|
2447
2478
|
<picture
|
|
2448
2479
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2480
|
+
title="Memori"
|
|
2449
2481
|
>
|
|
2450
2482
|
<source
|
|
2451
2483
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2511,6 +2543,7 @@ exports[`renders Chat with dates unchanged 1`] = `
|
|
|
2511
2543
|
>
|
|
2512
2544
|
<picture
|
|
2513
2545
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2546
|
+
title="Memori"
|
|
2514
2547
|
>
|
|
2515
2548
|
<source
|
|
2516
2549
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2652,6 +2685,7 @@ exports[`renders Chat with dates unchanged 1`] = `
|
|
|
2652
2685
|
>
|
|
2653
2686
|
<picture
|
|
2654
2687
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2688
|
+
title="Memori"
|
|
2655
2689
|
>
|
|
2656
2690
|
<source
|
|
2657
2691
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2725,6 +2759,7 @@ exports[`renders Chat with dates unchanged 1`] = `
|
|
|
2725
2759
|
>
|
|
2726
2760
|
<button
|
|
2727
2761
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
2762
|
+
title="expand"
|
|
2728
2763
|
>
|
|
2729
2764
|
<span
|
|
2730
2765
|
class="memori-button--icon"
|
|
@@ -2795,6 +2830,7 @@ exports[`renders Chat with hints unchanged 1`] = `
|
|
|
2795
2830
|
>
|
|
2796
2831
|
<picture
|
|
2797
2832
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2833
|
+
title="Memori"
|
|
2798
2834
|
>
|
|
2799
2835
|
<source
|
|
2800
2836
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2850,6 +2886,7 @@ exports[`renders Chat with hints unchanged 1`] = `
|
|
|
2850
2886
|
>
|
|
2851
2887
|
<picture
|
|
2852
2888
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2889
|
+
title="Memori"
|
|
2853
2890
|
>
|
|
2854
2891
|
<source
|
|
2855
2892
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -2905,6 +2942,7 @@ exports[`renders Chat with hints unchanged 1`] = `
|
|
|
2905
2942
|
>
|
|
2906
2943
|
<picture
|
|
2907
2944
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
2945
|
+
title="Memori"
|
|
2908
2946
|
>
|
|
2909
2947
|
<source
|
|
2910
2948
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -3036,6 +3074,7 @@ exports[`renders Chat with hints unchanged 1`] = `
|
|
|
3036
3074
|
>
|
|
3037
3075
|
<picture
|
|
3038
3076
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
3077
|
+
title="Memori"
|
|
3039
3078
|
>
|
|
3040
3079
|
<source
|
|
3041
3080
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -3130,6 +3169,7 @@ exports[`renders Chat with hints unchanged 1`] = `
|
|
|
3130
3169
|
>
|
|
3131
3170
|
<button
|
|
3132
3171
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
3172
|
+
title="expand"
|
|
3133
3173
|
>
|
|
3134
3174
|
<span
|
|
3135
3175
|
class="memori-button--icon"
|
|
@@ -3200,6 +3240,7 @@ exports[`renders Chat with media unchanged 1`] = `
|
|
|
3200
3240
|
>
|
|
3201
3241
|
<picture
|
|
3202
3242
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
3243
|
+
title="Memori"
|
|
3203
3244
|
>
|
|
3204
3245
|
<source
|
|
3205
3246
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -3255,6 +3296,7 @@ exports[`renders Chat with media unchanged 1`] = `
|
|
|
3255
3296
|
>
|
|
3256
3297
|
<picture
|
|
3257
3298
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
3299
|
+
title="Memori"
|
|
3258
3300
|
>
|
|
3259
3301
|
<source
|
|
3260
3302
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -3310,6 +3352,7 @@ exports[`renders Chat with media unchanged 1`] = `
|
|
|
3310
3352
|
>
|
|
3311
3353
|
<picture
|
|
3312
3354
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
3355
|
+
title="Memori"
|
|
3313
3356
|
>
|
|
3314
3357
|
<source
|
|
3315
3358
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -3842,6 +3885,7 @@ exports[`renders Chat with media unchanged 1`] = `
|
|
|
3842
3885
|
>
|
|
3843
3886
|
<picture
|
|
3844
3887
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
3888
|
+
title="Memori"
|
|
3845
3889
|
>
|
|
3846
3890
|
<source
|
|
3847
3891
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -3910,6 +3954,7 @@ exports[`renders Chat with media unchanged 1`] = `
|
|
|
3910
3954
|
>
|
|
3911
3955
|
<button
|
|
3912
3956
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
3957
|
+
title="expand"
|
|
3913
3958
|
>
|
|
3914
3959
|
<span
|
|
3915
3960
|
class="memori-button--icon"
|
|
@@ -3980,6 +4025,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
|
|
|
3980
4025
|
>
|
|
3981
4026
|
<picture
|
|
3982
4027
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
4028
|
+
title="Memori"
|
|
3983
4029
|
>
|
|
3984
4030
|
<source
|
|
3985
4031
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -4035,6 +4081,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
|
|
|
4035
4081
|
>
|
|
4036
4082
|
<picture
|
|
4037
4083
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
4084
|
+
title="Memori"
|
|
4038
4085
|
>
|
|
4039
4086
|
<source
|
|
4040
4087
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -4090,6 +4137,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
|
|
|
4090
4137
|
>
|
|
4091
4138
|
<picture
|
|
4092
4139
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
4140
|
+
title="Memori"
|
|
4093
4141
|
>
|
|
4094
4142
|
<source
|
|
4095
4143
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -4221,6 +4269,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
|
|
|
4221
4269
|
>
|
|
4222
4270
|
<picture
|
|
4223
4271
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
4272
|
+
title="Memori"
|
|
4224
4273
|
>
|
|
4225
4274
|
<source
|
|
4226
4275
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -4310,6 +4359,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
|
|
|
4310
4359
|
>
|
|
4311
4360
|
<button
|
|
4312
4361
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
4362
|
+
title="expand"
|
|
4313
4363
|
>
|
|
4314
4364
|
<span
|
|
4315
4365
|
class="memori-button--icon"
|
|
@@ -4380,6 +4430,7 @@ exports[`renders Chat with user unchanged 1`] = `
|
|
|
4380
4430
|
>
|
|
4381
4431
|
<picture
|
|
4382
4432
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
4433
|
+
title="Memori"
|
|
4383
4434
|
>
|
|
4384
4435
|
<source
|
|
4385
4436
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -4429,6 +4480,7 @@ exports[`renders Chat with user unchanged 1`] = `
|
|
|
4429
4480
|
>
|
|
4430
4481
|
<picture
|
|
4431
4482
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
4483
|
+
title="Memori"
|
|
4432
4484
|
>
|
|
4433
4485
|
<source
|
|
4434
4486
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -4478,6 +4530,7 @@ exports[`renders Chat with user unchanged 1`] = `
|
|
|
4478
4530
|
>
|
|
4479
4531
|
<picture
|
|
4480
4532
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
4533
|
+
title="Memori"
|
|
4481
4534
|
>
|
|
4482
4535
|
<source
|
|
4483
4536
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -4603,6 +4656,7 @@ exports[`renders Chat with user unchanged 1`] = `
|
|
|
4603
4656
|
>
|
|
4604
4657
|
<picture
|
|
4605
4658
|
class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
|
|
4659
|
+
title="Memori"
|
|
4606
4660
|
>
|
|
4607
4661
|
<source
|
|
4608
4662
|
src="https://app.twincreator.com/images/twincreator/square_logo.png"
|
|
@@ -4671,6 +4725,7 @@ exports[`renders Chat with user unchanged 1`] = `
|
|
|
4671
4725
|
>
|
|
4672
4726
|
<button
|
|
4673
4727
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
4728
|
+
title="expand"
|
|
4674
4729
|
>
|
|
4675
4730
|
<span
|
|
4676
4731
|
class="memori-button--icon"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
3
|
import { memori, tenant } from '../../mocks/data';
|
|
4
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
4
5
|
import ChatBubble, { Props } from './ChatBubble';
|
|
5
6
|
|
|
6
7
|
import './ChatBubble.css';
|
|
@@ -32,8 +33,11 @@ const meta: Meta = {
|
|
|
32
33
|
|
|
33
34
|
export default meta;
|
|
34
35
|
|
|
35
|
-
const Template: Story<Props> = args =>
|
|
36
|
-
|
|
36
|
+
const Template: Story<Props> = args => (
|
|
37
|
+
<I18nWrapper>
|
|
38
|
+
<ChatBubble {...args} />
|
|
39
|
+
</I18nWrapper>
|
|
40
|
+
);
|
|
37
41
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
38
42
|
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
39
43
|
export const Default = Template.bind({});
|
|
@@ -177,3 +181,31 @@ FromUserWithAvatarAndCustomAvatar.args = {
|
|
|
177
181
|
'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.',
|
|
178
182
|
},
|
|
179
183
|
};
|
|
184
|
+
|
|
185
|
+
export const FromExpertOfABoard = Template.bind({});
|
|
186
|
+
FromExpertOfABoard.args = {
|
|
187
|
+
memori: {
|
|
188
|
+
...memori,
|
|
189
|
+
enableBoardOfExperts: true,
|
|
190
|
+
},
|
|
191
|
+
apiUrl: 'https://backend.memori.ai',
|
|
192
|
+
tenant,
|
|
193
|
+
experts: [
|
|
194
|
+
{
|
|
195
|
+
expertID: '9b0a2913-d3d8-4e98-a49d-6e1c99479e1b',
|
|
196
|
+
name: 'Expert name',
|
|
197
|
+
description: 'Expert description',
|
|
198
|
+
expertMemoriID: '9b0a2913-d3d8-4e98-a49d-6e1c99479e1b',
|
|
199
|
+
expertBaseURL: 'https://engine.memori.ai',
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
message: {
|
|
203
|
+
fromUser: false,
|
|
204
|
+
text: 'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.',
|
|
205
|
+
initial: false,
|
|
206
|
+
generatedByAI: true,
|
|
207
|
+
emitter: 'Expert name',
|
|
208
|
+
translatedText:
|
|
209
|
+
'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.',
|
|
210
|
+
},
|
|
211
|
+
};
|
|
@@ -72,6 +72,38 @@ it('renders ChatBubble with msg generated by AI unchanged', () => {
|
|
|
72
72
|
expect(container).toMatchSnapshot();
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
it('renders ChatBubble with msg from BoE expert unchanged', () => {
|
|
76
|
+
const { container } = render(
|
|
77
|
+
<ChatBubble
|
|
78
|
+
memori={{
|
|
79
|
+
...memori,
|
|
80
|
+
enableBoardOfExperts: true,
|
|
81
|
+
}}
|
|
82
|
+
tenant={tenant}
|
|
83
|
+
apiUrl="https://backend.memori.ai"
|
|
84
|
+
experts={[
|
|
85
|
+
{
|
|
86
|
+
expertID: '9b0a2913-d3d8-4e98-a49d-6e1c99479e1b',
|
|
87
|
+
name: 'Expert name',
|
|
88
|
+
description: 'Expert description',
|
|
89
|
+
expertMemoriID: '9b0a2913-d3d8-4e98-a49d-6e1c99479e1b',
|
|
90
|
+
expertBaseURL: 'https://engine.memori.ai',
|
|
91
|
+
},
|
|
92
|
+
]}
|
|
93
|
+
message={{
|
|
94
|
+
fromUser: true,
|
|
95
|
+
text: 'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.',
|
|
96
|
+
initial: false,
|
|
97
|
+
generatedByAI: true,
|
|
98
|
+
emitter: 'Expert name',
|
|
99
|
+
translatedText:
|
|
100
|
+
'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.',
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
expect(container).toMatchSnapshot();
|
|
105
|
+
});
|
|
106
|
+
|
|
75
107
|
it('renders ChatBubble from user with avatar unchanged', () => {
|
|
76
108
|
const { container } = render(
|
|
77
109
|
<ChatBubble
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import {
|
|
4
|
+
ExpertReference,
|
|
4
5
|
Memori,
|
|
5
6
|
Message,
|
|
6
7
|
Tenant,
|
|
@@ -27,6 +28,7 @@ export interface Props {
|
|
|
27
28
|
isFirst?: boolean;
|
|
28
29
|
userAvatar?: MemoriProps['userAvatar'];
|
|
29
30
|
user?: User;
|
|
31
|
+
experts?: ExpertReference[];
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
const ChatBubble: React.FC<Props> = ({
|
|
@@ -41,6 +43,7 @@ const ChatBubble: React.FC<Props> = ({
|
|
|
41
43
|
isFirst = false,
|
|
42
44
|
user,
|
|
43
45
|
userAvatar,
|
|
46
|
+
experts,
|
|
44
47
|
}) => {
|
|
45
48
|
const { t } = useTranslation();
|
|
46
49
|
|
|
@@ -74,21 +77,46 @@ const ChatBubble: React.FC<Props> = ({
|
|
|
74
77
|
leaveTo={`opacity-0 scale-075 ${
|
|
75
78
|
message.fromUser ? 'translate-x-15' : 'translate-x--15'
|
|
76
79
|
}`}
|
|
80
|
+
title={
|
|
81
|
+
!!message.emitter?.length && !!memori.enableBoardOfExperts
|
|
82
|
+
? message.emitter
|
|
83
|
+
: memori.name
|
|
84
|
+
}
|
|
77
85
|
>
|
|
78
86
|
<source
|
|
79
|
-
src={
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
src={
|
|
88
|
+
!!message.emitter?.length &&
|
|
89
|
+
!!memori.enableBoardOfExperts &&
|
|
90
|
+
experts?.find(e => e.name === message.emitter)
|
|
91
|
+
? `${apiUrl}/api/v1/memoriai/memori/avatar/${
|
|
92
|
+
experts.find(e => e.name === message.emitter)
|
|
93
|
+
?.expertMemoriID
|
|
94
|
+
}`
|
|
95
|
+
: getResourceUrl({
|
|
96
|
+
type: 'avatar',
|
|
97
|
+
tenantID: tenant?.id,
|
|
98
|
+
resourceURI: memori.avatarURL,
|
|
99
|
+
baseURL: baseUrl,
|
|
100
|
+
apiURL: apiUrl,
|
|
101
|
+
})
|
|
102
|
+
}
|
|
86
103
|
/>
|
|
87
104
|
<img
|
|
88
105
|
className="memori-chat--bubble-avatar-img"
|
|
89
|
-
alt={
|
|
106
|
+
alt={
|
|
107
|
+
!!message.emitter?.length && !!memori.enableBoardOfExperts
|
|
108
|
+
? message.emitter
|
|
109
|
+
: memori.name
|
|
110
|
+
}
|
|
90
111
|
src={
|
|
91
|
-
|
|
112
|
+
!!message.emitter?.length &&
|
|
113
|
+
!!memori.enableBoardOfExperts &&
|
|
114
|
+
experts?.find(e => e.name === message.emitter)
|
|
115
|
+
? `${apiUrl}/api/v1/memoriai/memori/avatar/${
|
|
116
|
+
experts.find(e => e.name === message.emitter)
|
|
117
|
+
?.expertMemoriID
|
|
118
|
+
}`
|
|
119
|
+
: memori.avatarURL && memori.avatarURL.length > 0
|
|
92
120
|
? getResourceUrl({
|
|
93
121
|
type: 'avatar',
|
|
94
122
|
tenantID: tenant?.id,
|