@memori.ai/memori-react 7.1.3 → 7.3.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 (64) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +2 -0
  3. package/dist/components/Chat/Chat.d.ts +2 -0
  4. package/dist/components/Chat/Chat.js +3 -3
  5. package/dist/components/Chat/Chat.js.map +1 -1
  6. package/dist/components/ChatBubble/ChatBubble.css +15 -10
  7. package/dist/components/ChatBubble/ChatBubble.d.ts +2 -0
  8. package/dist/components/ChatBubble/ChatBubble.js +23 -8
  9. package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
  10. package/dist/components/MemoriWidget/MemoriWidget.d.ts +3 -1
  11. package/dist/components/MemoriWidget/MemoriWidget.js +76 -42
  12. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  13. package/dist/components/icons/Code.d.ts +5 -0
  14. package/dist/components/icons/Code.js +6 -0
  15. package/dist/components/icons/Code.js.map +1 -0
  16. package/dist/components/icons/Copy.js +1 -1
  17. package/dist/components/icons/Copy.js.map +1 -1
  18. package/dist/helpers/translations.js +5 -1
  19. package/dist/helpers/translations.js.map +1 -1
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.js +4 -2
  22. package/dist/index.js.map +1 -1
  23. package/dist/locales/en.json +1 -0
  24. package/dist/locales/it.json +1 -0
  25. package/esm/components/Chat/Chat.d.ts +2 -0
  26. package/esm/components/Chat/Chat.js +3 -3
  27. package/esm/components/Chat/Chat.js.map +1 -1
  28. package/esm/components/ChatBubble/ChatBubble.css +15 -10
  29. package/esm/components/ChatBubble/ChatBubble.d.ts +2 -0
  30. package/esm/components/ChatBubble/ChatBubble.js +23 -8
  31. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  32. package/esm/components/MemoriWidget/MemoriWidget.d.ts +3 -1
  33. package/esm/components/MemoriWidget/MemoriWidget.js +76 -42
  34. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  35. package/esm/components/icons/Code.d.ts +5 -0
  36. package/esm/components/icons/Code.js +4 -0
  37. package/esm/components/icons/Code.js.map +1 -0
  38. package/esm/components/icons/Copy.js +2 -2
  39. package/esm/components/icons/Copy.js.map +1 -1
  40. package/esm/helpers/translations.js +5 -1
  41. package/esm/helpers/translations.js.map +1 -1
  42. package/esm/index.d.ts +2 -0
  43. package/esm/index.js +4 -2
  44. package/esm/index.js.map +1 -1
  45. package/esm/locales/en.json +1 -0
  46. package/esm/locales/it.json +1 -0
  47. package/package.json +2 -2
  48. package/src/components/Chat/Chat.tsx +6 -0
  49. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +1672 -44
  50. package/src/components/ChatBubble/ChatBubble.css +15 -10
  51. package/src/components/ChatBubble/ChatBubble.stories.tsx +25 -0
  52. package/src/components/ChatBubble/ChatBubble.test.tsx +35 -0
  53. package/src/components/ChatBubble/ChatBubble.tsx +66 -4
  54. package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +896 -11
  55. package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +30 -4
  56. package/src/components/MemoriWidget/MemoriWidget.tsx +86 -49
  57. package/src/components/Snippet/__snapshots__/Snippet.test.tsx.snap +120 -16
  58. package/src/components/icons/Code.tsx +24 -0
  59. package/src/components/icons/Copy.tsx +8 -2
  60. package/src/helpers/translations.ts +10 -2
  61. package/src/index.stories.tsx +3 -17
  62. package/src/index.tsx +8 -0
  63. package/src/locales/en.json +1 -0
  64. package/src/locales/it.json +1 -0
package/src/index.tsx CHANGED
@@ -28,6 +28,8 @@ export interface Props {
28
28
  layout?: WidgetProps['layout'];
29
29
  customLayout?: WidgetProps['customLayout'];
30
30
  showShare?: boolean;
31
+ showCopyButton?: boolean;
32
+ showTranslationOriginal?: boolean;
31
33
  showInstruct?: boolean;
32
34
  showInputs?: boolean;
33
35
  showDates?: boolean;
@@ -88,6 +90,8 @@ const Memori: React.FC<Props> = ({
88
90
  layout = 'DEFAULT',
89
91
  customLayout,
90
92
  showShare = true,
93
+ showCopyButton = true,
94
+ showTranslationOriginal = false,
91
95
  showSettings = true,
92
96
  showInstruct = false,
93
97
  showTypingText = false,
@@ -239,6 +243,8 @@ const Memori: React.FC<Props> = ({
239
243
  secret={secretToken}
240
244
  sessionID={sessionID}
241
245
  showShare={showShare}
246
+ showCopyButton={showCopyButton}
247
+ showTranslationOriginal={showTranslationOriginal}
242
248
  showSettings={showSettings}
243
249
  showInstruct={showInstruct}
244
250
  showTypingText={showTypingText}
@@ -314,6 +320,8 @@ Memori.propTypes = {
314
320
  ]),
315
321
  customLayout: PropTypes.any,
316
322
  showShare: PropTypes.bool,
323
+ showCopyButton: PropTypes.bool,
324
+ showTranslationOriginal: PropTypes.bool,
317
325
  showInstruct: PropTypes.bool,
318
326
  showInputs: PropTypes.bool,
319
327
  showDates: PropTypes.bool,
@@ -28,6 +28,7 @@
28
28
  "next": "Next",
29
29
  "previous": "Previous",
30
30
  "copy": "Copy",
31
+ "copyRawCode": "Copy raw code",
31
32
  "copyToClipboard": "Copy to clipboard",
32
33
  "showOriginalText": "Show original",
33
34
  "showTranslatedText": "Show translation",
@@ -28,6 +28,7 @@
28
28
  "next": "Successivo",
29
29
  "previous": "Precedente",
30
30
  "copy": "Copia",
31
+ "copyRawCode": "Copia codice sorgente",
31
32
  "copyToClipboard": "Copia negli appunti",
32
33
  "showOriginalText": "Mostra originale",
33
34
  "showTranslatedText": "Mostra traduzione",