@memori.ai/memori-react 2.22.0 → 2.23.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 (67) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/Chat/Chat.d.ts +2 -1
  3. package/dist/components/Chat/Chat.js +2 -2
  4. package/dist/components/Chat/Chat.js.map +1 -1
  5. package/dist/components/ChatBubble/ChatBubble.d.ts +2 -1
  6. package/dist/components/ChatBubble/ChatBubble.js +30 -18
  7. package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
  8. package/dist/components/ChatBubble/ChatBubble.test.js +22 -0
  9. package/dist/components/ChatBubble/ChatBubble.test.js.map +1 -1
  10. package/dist/components/MemoriWidget/MemoriWidget.js +34 -1
  11. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  12. package/dist/components/StartPanel/StartPanel.css +12 -0
  13. package/dist/components/StartPanel/StartPanel.js +2 -1
  14. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  15. package/dist/components/StartPanel/StartPanel.test.js +7 -0
  16. package/dist/components/StartPanel/StartPanel.test.js.map +1 -1
  17. package/dist/components/icons/Group.d.ts +5 -0
  18. package/dist/components/icons/Group.js +6 -0
  19. package/dist/components/icons/Group.js.map +1 -0
  20. package/dist/helpers/media.js +1 -1
  21. package/dist/helpers/media.js.map +1 -1
  22. package/dist/helpers/media.test.js +1 -1
  23. package/dist/helpers/media.test.js.map +1 -1
  24. package/dist/locales/en.json +1 -0
  25. package/dist/locales/it.json +1 -0
  26. package/esm/components/Chat/Chat.d.ts +2 -1
  27. package/esm/components/Chat/Chat.js +2 -2
  28. package/esm/components/Chat/Chat.js.map +1 -1
  29. package/esm/components/ChatBubble/ChatBubble.d.ts +2 -1
  30. package/esm/components/ChatBubble/ChatBubble.js +30 -18
  31. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  32. package/esm/components/ChatBubble/ChatBubble.test.js +22 -0
  33. package/esm/components/ChatBubble/ChatBubble.test.js.map +1 -1
  34. package/esm/components/MemoriWidget/MemoriWidget.js +34 -1
  35. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  36. package/esm/components/StartPanel/StartPanel.css +12 -0
  37. package/esm/components/StartPanel/StartPanel.js +2 -1
  38. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  39. package/esm/components/StartPanel/StartPanel.test.js +7 -0
  40. package/esm/components/StartPanel/StartPanel.test.js.map +1 -1
  41. package/esm/components/icons/Group.d.ts +5 -0
  42. package/esm/components/icons/Group.js +4 -0
  43. package/esm/components/icons/Group.js.map +1 -0
  44. package/esm/helpers/media.js +1 -1
  45. package/esm/helpers/media.js.map +1 -1
  46. package/esm/helpers/media.test.js +1 -1
  47. package/esm/helpers/media.test.js.map +1 -1
  48. package/esm/locales/en.json +1 -0
  49. package/esm/locales/it.json +1 -0
  50. package/package.json +2 -2
  51. package/src/components/Chat/Chat.tsx +4 -0
  52. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +44 -0
  53. package/src/components/ChatBubble/ChatBubble.stories.tsx +28 -0
  54. package/src/components/ChatBubble/ChatBubble.test.tsx +32 -0
  55. package/src/components/ChatBubble/ChatBubble.tsx +37 -9
  56. package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +82 -0
  57. package/src/components/MemoriWidget/MemoriWidget.tsx +38 -0
  58. package/src/components/StartPanel/StartPanel.css +12 -0
  59. package/src/components/StartPanel/StartPanel.stories.tsx +23 -0
  60. package/src/components/StartPanel/StartPanel.test.tsx +21 -0
  61. package/src/components/StartPanel/StartPanel.tsx +12 -2
  62. package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +89 -0
  63. package/src/components/icons/Group.tsx +30 -0
  64. package/src/helpers/media.test.ts +1 -1
  65. package/src/helpers/media.ts +1 -1
  66. package/src/locales/en.json +1 -0
  67. package/src/locales/it.json +1 -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"
@@ -434,6 +438,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
434
438
  >
435
439
  <picture
436
440
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
441
+ title="Memori"
437
442
  >
438
443
  <source
439
444
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -489,6 +494,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
489
494
  >
490
495
  <picture
491
496
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
497
+ title="Memori"
492
498
  >
493
499
  <source
494
500
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -544,6 +550,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
544
550
  >
545
551
  <picture
546
552
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
553
+ title="Memori"
547
554
  >
548
555
  <source
549
556
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -690,6 +697,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
690
697
  >
691
698
  <picture
692
699
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
700
+ title="Memori"
693
701
  >
694
702
  <source
695
703
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -877,6 +885,7 @@ exports[`renders Chat unchanged 1`] = `
877
885
  >
878
886
  <picture
879
887
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
888
+ title="Memori"
880
889
  >
881
890
  <source
882
891
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -932,6 +941,7 @@ exports[`renders Chat unchanged 1`] = `
932
941
  >
933
942
  <picture
934
943
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
944
+ title="Memori"
935
945
  >
936
946
  <source
937
947
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -987,6 +997,7 @@ exports[`renders Chat unchanged 1`] = `
987
997
  >
988
998
  <picture
989
999
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1000
+ title="Memori"
990
1001
  >
991
1002
  <source
992
1003
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1118,6 +1129,7 @@ exports[`renders Chat unchanged 1`] = `
1118
1129
  >
1119
1130
  <picture
1120
1131
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1132
+ title="Memori"
1121
1133
  >
1122
1134
  <source
1123
1135
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1256,6 +1268,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
1256
1268
  >
1257
1269
  <picture
1258
1270
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1271
+ title="Memori"
1259
1272
  >
1260
1273
  <source
1261
1274
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1311,6 +1324,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
1311
1324
  >
1312
1325
  <picture
1313
1326
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1327
+ title="Memori"
1314
1328
  >
1315
1329
  <source
1316
1330
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1366,6 +1380,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
1366
1380
  >
1367
1381
  <picture
1368
1382
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1383
+ title="Memori"
1369
1384
  >
1370
1385
  <source
1371
1386
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1512,6 +1527,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
1512
1527
  >
1513
1528
  <picture
1514
1529
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1530
+ title="Memori"
1515
1531
  >
1516
1532
  <source
1517
1533
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1665,6 +1681,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
1665
1681
  >
1666
1682
  <picture
1667
1683
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1684
+ title="Memori"
1668
1685
  >
1669
1686
  <source
1670
1687
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1712,6 +1729,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
1712
1729
  >
1713
1730
  <picture
1714
1731
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1732
+ title="Memori"
1715
1733
  >
1716
1734
  <source
1717
1735
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1759,6 +1777,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
1759
1777
  >
1760
1778
  <picture
1761
1779
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1780
+ title="Memori"
1762
1781
  >
1763
1782
  <source
1764
1783
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -1882,6 +1901,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
1882
1901
  >
1883
1902
  <picture
1884
1903
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
1904
+ title="Memori"
1885
1905
  >
1886
1906
  <source
1887
1907
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2020,6 +2040,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
2020
2040
  >
2021
2041
  <picture
2022
2042
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2043
+ title="Memori"
2023
2044
  >
2024
2045
  <source
2025
2046
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2069,6 +2090,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
2069
2090
  >
2070
2091
  <picture
2071
2092
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2093
+ title="Memori"
2072
2094
  >
2073
2095
  <source
2074
2096
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2118,6 +2140,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
2118
2140
  >
2119
2141
  <picture
2120
2142
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2143
+ title="Memori"
2121
2144
  >
2122
2145
  <source
2123
2146
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2243,6 +2266,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
2243
2266
  >
2244
2267
  <picture
2245
2268
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2269
+ title="Memori"
2246
2270
  >
2247
2271
  <source
2248
2272
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2381,6 +2405,7 @@ exports[`renders Chat with dates unchanged 1`] = `
2381
2405
  >
2382
2406
  <picture
2383
2407
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2408
+ title="Memori"
2384
2409
  >
2385
2410
  <source
2386
2411
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2446,6 +2471,7 @@ exports[`renders Chat with dates unchanged 1`] = `
2446
2471
  >
2447
2472
  <picture
2448
2473
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2474
+ title="Memori"
2449
2475
  >
2450
2476
  <source
2451
2477
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2511,6 +2537,7 @@ exports[`renders Chat with dates unchanged 1`] = `
2511
2537
  >
2512
2538
  <picture
2513
2539
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2540
+ title="Memori"
2514
2541
  >
2515
2542
  <source
2516
2543
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2652,6 +2679,7 @@ exports[`renders Chat with dates unchanged 1`] = `
2652
2679
  >
2653
2680
  <picture
2654
2681
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2682
+ title="Memori"
2655
2683
  >
2656
2684
  <source
2657
2685
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2795,6 +2823,7 @@ exports[`renders Chat with hints unchanged 1`] = `
2795
2823
  >
2796
2824
  <picture
2797
2825
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2826
+ title="Memori"
2798
2827
  >
2799
2828
  <source
2800
2829
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2850,6 +2879,7 @@ exports[`renders Chat with hints unchanged 1`] = `
2850
2879
  >
2851
2880
  <picture
2852
2881
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2882
+ title="Memori"
2853
2883
  >
2854
2884
  <source
2855
2885
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -2905,6 +2935,7 @@ exports[`renders Chat with hints unchanged 1`] = `
2905
2935
  >
2906
2936
  <picture
2907
2937
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
2938
+ title="Memori"
2908
2939
  >
2909
2940
  <source
2910
2941
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -3036,6 +3067,7 @@ exports[`renders Chat with hints unchanged 1`] = `
3036
3067
  >
3037
3068
  <picture
3038
3069
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
3070
+ title="Memori"
3039
3071
  >
3040
3072
  <source
3041
3073
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -3200,6 +3232,7 @@ exports[`renders Chat with media unchanged 1`] = `
3200
3232
  >
3201
3233
  <picture
3202
3234
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
3235
+ title="Memori"
3203
3236
  >
3204
3237
  <source
3205
3238
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -3255,6 +3288,7 @@ exports[`renders Chat with media unchanged 1`] = `
3255
3288
  >
3256
3289
  <picture
3257
3290
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
3291
+ title="Memori"
3258
3292
  >
3259
3293
  <source
3260
3294
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -3310,6 +3344,7 @@ exports[`renders Chat with media unchanged 1`] = `
3310
3344
  >
3311
3345
  <picture
3312
3346
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
3347
+ title="Memori"
3313
3348
  >
3314
3349
  <source
3315
3350
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -3842,6 +3877,7 @@ exports[`renders Chat with media unchanged 1`] = `
3842
3877
  >
3843
3878
  <picture
3844
3879
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
3880
+ title="Memori"
3845
3881
  >
3846
3882
  <source
3847
3883
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -3980,6 +4016,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
3980
4016
  >
3981
4017
  <picture
3982
4018
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
4019
+ title="Memori"
3983
4020
  >
3984
4021
  <source
3985
4022
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -4035,6 +4072,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
4035
4072
  >
4036
4073
  <picture
4037
4074
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
4075
+ title="Memori"
4038
4076
  >
4039
4077
  <source
4040
4078
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -4090,6 +4128,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
4090
4128
  >
4091
4129
  <picture
4092
4130
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
4131
+ title="Memori"
4093
4132
  >
4094
4133
  <source
4095
4134
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -4221,6 +4260,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
4221
4260
  >
4222
4261
  <picture
4223
4262
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
4263
+ title="Memori"
4224
4264
  >
4225
4265
  <source
4226
4266
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -4380,6 +4420,7 @@ exports[`renders Chat with user unchanged 1`] = `
4380
4420
  >
4381
4421
  <picture
4382
4422
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
4423
+ title="Memori"
4383
4424
  >
4384
4425
  <source
4385
4426
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -4429,6 +4470,7 @@ exports[`renders Chat with user unchanged 1`] = `
4429
4470
  >
4430
4471
  <picture
4431
4472
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
4473
+ title="Memori"
4432
4474
  >
4433
4475
  <source
4434
4476
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -4478,6 +4520,7 @@ exports[`renders Chat with user unchanged 1`] = `
4478
4520
  >
4479
4521
  <picture
4480
4522
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
4523
+ title="Memori"
4481
4524
  >
4482
4525
  <source
4483
4526
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -4603,6 +4646,7 @@ exports[`renders Chat with user unchanged 1`] = `
4603
4646
  >
4604
4647
  <picture
4605
4648
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
4649
+ title="Memori"
4606
4650
  >
4607
4651
  <source
4608
4652
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -177,3 +177,31 @@ FromUserWithAvatarAndCustomAvatar.args = {
177
177
  'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.',
178
178
  },
179
179
  };
180
+
181
+ export const FromExpertOfABoard = Template.bind({});
182
+ FromExpertOfABoard.args = {
183
+ memori: {
184
+ ...memori,
185
+ enableBoardOfExperts: true,
186
+ },
187
+ apiUrl: 'https://backend.memori.ai',
188
+ tenant,
189
+ experts: [
190
+ {
191
+ expertID: '9b0a2913-d3d8-4e98-a49d-6e1c99479e1b',
192
+ name: 'Expert name',
193
+ description: 'Expert description',
194
+ expertMemoriID: '9b0a2913-d3d8-4e98-a49d-6e1c99479e1b',
195
+ expertBaseURL: 'https://engine.memori.ai',
196
+ },
197
+ ],
198
+ message: {
199
+ fromUser: false,
200
+ text: 'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.',
201
+ initial: false,
202
+ generatedByAI: true,
203
+ emitter: 'Expert name',
204
+ translatedText:
205
+ 'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.',
206
+ },
207
+ };
@@ -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={getResourceUrl({
80
- type: 'avatar',
81
- tenantID: tenant?.id,
82
- resourceURI: memori.avatarURL,
83
- baseURL: baseUrl,
84
- apiURL: apiUrl,
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={memori.name}
106
+ alt={
107
+ !!message.emitter?.length && !!memori.enableBoardOfExperts
108
+ ? message.emitter
109
+ : memori.name
110
+ }
90
111
  src={
91
- memori.avatarURL && memori.avatarURL.length > 0
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,
@@ -80,6 +80,7 @@ exports[`renders ChatBubble unchanged 1`] = `
80
80
  >
81
81
  <picture
82
82
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
83
+ title="Memori"
83
84
  >
84
85
  <source
85
86
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -111,6 +112,7 @@ exports[`renders ChatBubble with initial msg unchanged 1`] = `
111
112
  >
112
113
  <picture
113
114
  class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x--15"
115
+ title="Memori"
114
116
  >
115
117
  <source
116
118
  src="https://app.twincreator.com/images/twincreator/square_logo.png"
@@ -132,6 +134,86 @@ exports[`renders ChatBubble with initial msg unchanged 1`] = `
132
134
  </div>
133
135
  `;
134
136
 
137
+ exports[`renders ChatBubble with msg from BoE expert unchanged 1`] = `
138
+ <div>
139
+ <div
140
+ class="memori-chat--bubble-container memori-chat--bubble-from-user memori-chat--with-addon"
141
+ >
142
+ <div
143
+ class="memori-chat--bubble memori-chat--user-bubble memori-chat--with-addon memori-chat--ai-generated transition ease-in-out duration-300 opacity-0 scale-09 translate-x-30"
144
+ >
145
+ <p>
146
+ Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
147
+ </p>
148
+ <div
149
+ class="memori-chat--bubble-addon"
150
+ >
151
+ <div
152
+ class="memori-tooltip memori-tooltip--align-left memori-chat--bubble-ai-icon"
153
+ >
154
+ <div
155
+ class="memori-tooltip--content"
156
+ >
157
+ generatedByAI
158
+ </div>
159
+ <div
160
+ class="memori-tooltip--trigger"
161
+ >
162
+ <span>
163
+ <svg
164
+ aria-label="generatedByAI"
165
+ fill="none"
166
+ focusable="false"
167
+ role="img"
168
+ viewBox="0 0 24 24"
169
+ xmlns="http://www.w3.org/2000/svg"
170
+ >
171
+ <g
172
+ clip-rule="evenodd"
173
+ fill="currentColor"
174
+ fill-rule="evenodd"
175
+ >
176
+ <path
177
+ clip-rule="evenodd"
178
+ d="M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z"
179
+ fill-rule="evenodd"
180
+ />
181
+ <path
182
+ clip-rule="evenodd"
183
+ d="M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z"
184
+ fill-rule="evenodd"
185
+ />
186
+ <path
187
+ clip-rule="evenodd"
188
+ d="M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z"
189
+ fill-rule="evenodd"
190
+ />
191
+ </g>
192
+ </svg>
193
+ </span>
194
+ </div>
195
+ </div>
196
+ </div>
197
+ </div>
198
+ <div
199
+ class="memori-chat--bubble-avatar transition ease-in-out duration-300 opacity-0 scale-075 translate-x-15"
200
+ >
201
+ <svg
202
+ aria-hidden="true"
203
+ focusable="false"
204
+ role="img"
205
+ viewBox="0 0 1024 1024"
206
+ xmlns="http://www.w3.org/2000/svg"
207
+ >
208
+ <path
209
+ d="M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"
210
+ />
211
+ </svg>
212
+ </div>
213
+ </div>
214
+ </div>
215
+ `;
216
+
135
217
  exports[`renders ChatBubble with msg generated by AI unchanged 1`] = `
136
218
  <div>
137
219
  <div