@memori.ai/memori-react 7.4.5 → 7.5.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 (174) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +1 -1
  3. package/dist/I18nWrapper.js +6 -5
  4. package/dist/I18nWrapper.js.map +1 -1
  5. package/dist/components/Avatar/Avatar.d.ts +1 -0
  6. package/dist/components/Avatar/Avatar.js +64 -60
  7. package/dist/components/Avatar/Avatar.js.map +1 -1
  8. package/dist/components/Avatar/AvatarView/components/controls.d.ts +23 -0
  9. package/dist/components/Avatar/AvatarView/components/controls.js +55 -0
  10. package/dist/components/Avatar/AvatarView/components/controls.js.map +1 -0
  11. package/dist/components/Avatar/AvatarView/components/fullbodyAvatar.d.ts +18 -0
  12. package/dist/components/Avatar/AvatarView/components/fullbodyAvatar.js +60 -0
  13. package/dist/components/Avatar/AvatarView/components/fullbodyAvatar.js.map +1 -0
  14. package/dist/components/Avatar/AvatarView/components/halfbodyAvatar.d.ts +9 -0
  15. package/dist/components/Avatar/AvatarView/components/halfbodyAvatar.js +39 -0
  16. package/dist/components/Avatar/AvatarView/components/halfbodyAvatar.js.map +1 -0
  17. package/dist/components/Avatar/AvatarView/components/loader.d.ts +5 -0
  18. package/dist/components/Avatar/AvatarView/components/loader.js +12 -0
  19. package/dist/components/Avatar/AvatarView/components/loader.js.map +1 -0
  20. package/dist/components/Avatar/AvatarView/index.d.ts +18 -0
  21. package/dist/components/Avatar/AvatarView/index.js +109 -0
  22. package/dist/components/Avatar/AvatarView/index.js.map +1 -0
  23. package/dist/components/Avatar/AvatarView/utils/useEyeBlink.d.ts +2 -0
  24. package/dist/components/Avatar/AvatarView/utils/useEyeBlink.js +47 -0
  25. package/dist/components/Avatar/AvatarView/utils/useEyeBlink.js.map +1 -0
  26. package/dist/components/Avatar/AvatarView/utils/useHeadMovement.d.ts +2 -0
  27. package/dist/components/Avatar/AvatarView/utils/useHeadMovement.js +53 -0
  28. package/dist/components/Avatar/AvatarView/utils/useHeadMovement.js.map +1 -0
  29. package/dist/components/Avatar/AvatarView/utils/useLoadingMorphAnim.d.ts +2 -0
  30. package/dist/components/Avatar/AvatarView/utils/useLoadingMorphAnim.js +34 -0
  31. package/dist/components/Avatar/AvatarView/utils/useLoadingMorphAnim.js.map +1 -0
  32. package/dist/components/Avatar/AvatarView/utils/useMouthSpeaking.d.ts +2 -0
  33. package/dist/components/Avatar/AvatarView/utils/useMouthSpeaking.js +68 -0
  34. package/dist/components/Avatar/AvatarView/utils/useMouthSpeaking.js.map +1 -0
  35. package/dist/components/Avatar/AvatarView/utils/useSmile.d.ts +2 -0
  36. package/dist/components/Avatar/AvatarView/utils/useSmile.js +28 -0
  37. package/dist/components/Avatar/AvatarView/utils/useSmile.js.map +1 -0
  38. package/dist/components/Avatar/AvatarView/utils/utils.d.ts +13 -0
  39. package/dist/components/Avatar/AvatarView/utils/utils.js +42 -0
  40. package/dist/components/Avatar/AvatarView/utils/utils.js.map +1 -0
  41. package/dist/components/ChatBubble/ChatBubble.js +28 -18
  42. package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
  43. package/dist/components/MemoriWidget/MemoriWidget.js +5 -0
  44. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  45. package/dist/components/StartPanel/StartPanel.js +3 -2
  46. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  47. package/dist/components/icons/Code.js +1 -1
  48. package/dist/components/icons/Code.js.map +1 -1
  49. package/dist/components/icons/Copy.js +1 -1
  50. package/dist/components/icons/Copy.js.map +1 -1
  51. package/dist/helpers/constants.d.ts +1 -0
  52. package/dist/helpers/constants.js +2 -1
  53. package/dist/helpers/constants.js.map +1 -1
  54. package/dist/helpers/error.js +5 -0
  55. package/dist/helpers/error.js.map +1 -1
  56. package/dist/i18n.js +13 -1
  57. package/dist/i18n.js.map +1 -1
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +14 -2
  60. package/dist/index.js.map +1 -1
  61. package/dist/locales/de.json +426 -0
  62. package/dist/locales/en.json +5 -0
  63. package/dist/locales/es.json +426 -0
  64. package/dist/locales/fr.json +426 -0
  65. package/dist/locales/it.json +5 -0
  66. package/esm/I18nWrapper.js +6 -5
  67. package/esm/I18nWrapper.js.map +1 -1
  68. package/esm/components/Avatar/Avatar.d.ts +1 -0
  69. package/esm/components/Avatar/Avatar.js +66 -62
  70. package/esm/components/Avatar/Avatar.js.map +1 -1
  71. package/esm/components/Avatar/AvatarView/components/controls.d.ts +23 -0
  72. package/esm/components/Avatar/AvatarView/components/controls.js +52 -0
  73. package/esm/components/Avatar/AvatarView/components/controls.js.map +1 -0
  74. package/esm/components/Avatar/AvatarView/components/fullbodyAvatar.d.ts +18 -0
  75. package/esm/components/Avatar/AvatarView/components/fullbodyAvatar.js +56 -0
  76. package/esm/components/Avatar/AvatarView/components/fullbodyAvatar.js.map +1 -0
  77. package/esm/components/Avatar/AvatarView/components/halfbodyAvatar.d.ts +9 -0
  78. package/esm/components/Avatar/AvatarView/components/halfbodyAvatar.js +35 -0
  79. package/esm/components/Avatar/AvatarView/components/halfbodyAvatar.js.map +1 -0
  80. package/esm/components/Avatar/AvatarView/components/loader.d.ts +5 -0
  81. package/esm/components/Avatar/AvatarView/components/loader.js +9 -0
  82. package/esm/components/Avatar/AvatarView/components/loader.js.map +1 -0
  83. package/esm/components/Avatar/AvatarView/index.d.ts +18 -0
  84. package/esm/components/Avatar/AvatarView/index.js +105 -0
  85. package/esm/components/Avatar/AvatarView/index.js.map +1 -0
  86. package/esm/components/Avatar/AvatarView/utils/useEyeBlink.d.ts +2 -0
  87. package/esm/components/Avatar/AvatarView/utils/useEyeBlink.js +44 -0
  88. package/esm/components/Avatar/AvatarView/utils/useEyeBlink.js.map +1 -0
  89. package/esm/components/Avatar/AvatarView/utils/useHeadMovement.d.ts +2 -0
  90. package/esm/components/Avatar/AvatarView/utils/useHeadMovement.js +50 -0
  91. package/esm/components/Avatar/AvatarView/utils/useHeadMovement.js.map +1 -0
  92. package/esm/components/Avatar/AvatarView/utils/useLoadingMorphAnim.d.ts +2 -0
  93. package/esm/components/Avatar/AvatarView/utils/useLoadingMorphAnim.js +31 -0
  94. package/esm/components/Avatar/AvatarView/utils/useLoadingMorphAnim.js.map +1 -0
  95. package/esm/components/Avatar/AvatarView/utils/useMouthSpeaking.d.ts +2 -0
  96. package/esm/components/Avatar/AvatarView/utils/useMouthSpeaking.js +65 -0
  97. package/esm/components/Avatar/AvatarView/utils/useMouthSpeaking.js.map +1 -0
  98. package/esm/components/Avatar/AvatarView/utils/useSmile.d.ts +2 -0
  99. package/esm/components/Avatar/AvatarView/utils/useSmile.js +25 -0
  100. package/esm/components/Avatar/AvatarView/utils/useSmile.js.map +1 -0
  101. package/esm/components/Avatar/AvatarView/utils/utils.d.ts +13 -0
  102. package/esm/components/Avatar/AvatarView/utils/utils.js +33 -0
  103. package/esm/components/Avatar/AvatarView/utils/utils.js.map +1 -0
  104. package/esm/components/ChatBubble/ChatBubble.js +28 -18
  105. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  106. package/esm/components/MemoriWidget/MemoriWidget.js +6 -1
  107. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  108. package/esm/components/StartPanel/StartPanel.js +3 -2
  109. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  110. package/esm/components/icons/Code.js +1 -1
  111. package/esm/components/icons/Code.js.map +1 -1
  112. package/esm/components/icons/Copy.js +1 -1
  113. package/esm/components/icons/Copy.js.map +1 -1
  114. package/esm/helpers/constants.d.ts +1 -0
  115. package/esm/helpers/constants.js +1 -0
  116. package/esm/helpers/constants.js.map +1 -1
  117. package/esm/helpers/error.js +5 -0
  118. package/esm/helpers/error.js.map +1 -1
  119. package/esm/i18n.js +13 -1
  120. package/esm/i18n.js.map +1 -1
  121. package/esm/index.d.ts +1 -1
  122. package/esm/index.js +15 -3
  123. package/esm/index.js.map +1 -1
  124. package/esm/locales/de.json +426 -0
  125. package/esm/locales/en.json +5 -0
  126. package/esm/locales/es.json +426 -0
  127. package/esm/locales/fr.json +426 -0
  128. package/esm/locales/it.json +5 -0
  129. package/package.json +2 -1
  130. package/src/I18nWrapper.tsx +6 -8
  131. package/src/components/Avatar/Avatar.tsx +149 -144
  132. package/src/components/{AvatarView → Avatar/AvatarView}/AvatarView.stories.tsx +9 -2
  133. package/src/components/Avatar/AvatarView/components/controls.tsx +94 -0
  134. package/src/components/Avatar/AvatarView/components/fullbodyAvatar.tsx +120 -0
  135. package/src/components/Avatar/AvatarView/components/halfbodyAvatar.tsx +69 -0
  136. package/src/components/{AvatarView → Avatar/AvatarView}/components/loader.tsx +1 -1
  137. package/src/components/Avatar/AvatarView/index.tsx +251 -0
  138. package/src/components/Avatar/AvatarView/utils/useEyeBlink.ts +59 -0
  139. package/src/components/Avatar/AvatarView/utils/useMouthSpeaking.ts +87 -0
  140. package/src/components/Avatar/AvatarView/utils/useSmile.ts +39 -0
  141. package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +1 -1
  142. package/src/components/ChatBubble/ChatBubble.stories.tsx +85 -3
  143. package/src/components/ChatBubble/ChatBubble.tsx +44 -34
  144. package/src/components/MemoriWidget/MemoriWidget.tsx +11 -1
  145. package/src/components/StartPanel/StartPanel.tsx +3 -2
  146. package/src/components/icons/Code.tsx +3 -3
  147. package/src/components/icons/Copy.tsx +3 -3
  148. package/src/components/layouts/Chat.test.tsx +12 -9
  149. package/src/components/layouts/FullPage.test.tsx +12 -9
  150. package/src/components/layouts/Totem.test.tsx +12 -9
  151. package/src/components/layouts/WebsiteAssistant.test.tsx +12 -9
  152. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +13 -8
  153. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +14 -9
  154. package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +14 -9
  155. package/src/components/layouts/__snapshots__/WebsiteAssistant.test.tsx.snap +6 -1
  156. package/src/helpers/constants.ts +2 -0
  157. package/src/helpers/error.ts +5 -0
  158. package/src/i18n.ts +13 -1
  159. package/src/index.stories.tsx +29 -0
  160. package/src/index.tsx +17 -5
  161. package/src/locales/de.json +454 -0
  162. package/src/locales/en.json +5 -0
  163. package/src/locales/es.json +426 -0
  164. package/src/locales/fr.json +426 -0
  165. package/src/locales/it.json +5 -0
  166. package/src/components/AvatarView/components/avatar.tsx +0 -57
  167. package/src/components/AvatarView/components/fullbodyAvatar.tsx +0 -99
  168. package/src/components/AvatarView/index.tsx +0 -101
  169. package/src/components/AvatarView/utils/useEyeBlink.ts +0 -48
  170. package/src/components/AvatarView/utils/useMouthSpeaking.ts +0 -70
  171. package/src/components/AvatarView/utils/useSmile.ts +0 -31
  172. /package/src/components/{AvatarView → Avatar/AvatarView}/utils/useHeadMovement.ts +0 -0
  173. /package/src/components/{AvatarView → Avatar/AvatarView}/utils/useLoadingMorphAnim.ts +0 -0
  174. /package/src/components/{AvatarView → Avatar/AvatarView}/utils/utils.ts +0 -0
@@ -7,9 +7,9 @@ const Code = ({ className, title }: { className?: string; title?: string }) => (
7
7
  viewBox="0 0 24 24"
8
8
  fill="none"
9
9
  stroke="currentColor"
10
- stroke-width="1.5"
11
- stroke-linecap="round"
12
- stroke-linejoin="round"
10
+ strokeWidth="1.5"
11
+ strokeLinecap="round"
12
+ strokeLinejoin="round"
13
13
  focusable="false"
14
14
  role="img"
15
15
  className={className}
@@ -7,9 +7,9 @@ const Copy = ({ className, title }: { className?: string; title?: string }) => (
7
7
  viewBox="0 0 24 24"
8
8
  fill="none"
9
9
  stroke="currentColor"
10
- stroke-width="1.5"
11
- stroke-linecap="round"
12
- stroke-linejoin="round"
10
+ strokeWidth="1.5"
11
+ strokeLinecap="round"
12
+ strokeLinejoin="round"
13
13
  focusable="false"
14
14
  role="img"
15
15
  className={className}
@@ -1,6 +1,7 @@
1
1
  import { render } from '@testing-library/react';
2
2
  import Memori from '../MemoriWidget/MemoriWidget';
3
3
  import { integration, memori, tenant } from '../../mocks/data';
4
+ import I18nWrapper from '../../I18nWrapper';
4
5
 
5
6
  Object.defineProperty(window, 'matchMedia', {
6
7
  writable: true,
@@ -18,15 +19,17 @@ Object.defineProperty(window, 'matchMedia', {
18
19
 
19
20
  it('renders Chat layout unchanged', () => {
20
21
  const { container } = render(
21
- <Memori
22
- showShare={true}
23
- showSettings={true}
24
- memori={memori}
25
- tenant={tenant}
26
- tenantID="aisuru.com"
27
- integration={integration}
28
- layout="CHAT"
29
- />
22
+ <I18nWrapper>
23
+ <Memori
24
+ showShare={true}
25
+ showSettings={true}
26
+ memori={memori}
27
+ tenant={tenant}
28
+ tenantID="aisuru.com"
29
+ integration={integration}
30
+ layout="CHAT"
31
+ />
32
+ </I18nWrapper>
30
33
  );
31
34
  expect(container).toMatchSnapshot();
32
35
  });
@@ -1,6 +1,7 @@
1
1
  import { render } from '@testing-library/react';
2
2
  import Memori from '../MemoriWidget/MemoriWidget';
3
3
  import { integration, memori, tenant } from '../../mocks/data';
4
+ import I18nWrapper from '../../I18nWrapper';
4
5
 
5
6
  Object.defineProperty(window, 'matchMedia', {
6
7
  writable: true,
@@ -18,15 +19,17 @@ Object.defineProperty(window, 'matchMedia', {
18
19
 
19
20
  it('renders FullPage layout unchanged', () => {
20
21
  const { container } = render(
21
- <Memori
22
- showShare={true}
23
- showSettings={true}
24
- memori={memori}
25
- tenant={tenant}
26
- tenantID="aisuru.com"
27
- integration={integration}
28
- layout="FULLPAGE"
29
- />
22
+ <I18nWrapper>
23
+ <Memori
24
+ showShare={true}
25
+ showSettings={true}
26
+ memori={memori}
27
+ tenant={tenant}
28
+ tenantID="aisuru.com"
29
+ integration={integration}
30
+ layout="FULLPAGE"
31
+ />
32
+ </I18nWrapper>
30
33
  );
31
34
  expect(container).toMatchSnapshot();
32
35
  });
@@ -1,6 +1,7 @@
1
1
  import { render } from '@testing-library/react';
2
2
  import Memori from '../MemoriWidget/MemoriWidget';
3
3
  import { integration, memori, tenant } from '../../mocks/data';
4
+ import I18nWrapper from '../../I18nWrapper';
4
5
 
5
6
  Object.defineProperty(window, 'matchMedia', {
6
7
  writable: true,
@@ -18,15 +19,17 @@ Object.defineProperty(window, 'matchMedia', {
18
19
 
19
20
  it('renders Totem layout unchanged', () => {
20
21
  const { container } = render(
21
- <Memori
22
- showShare={true}
23
- showSettings={true}
24
- memori={memori}
25
- tenant={tenant}
26
- tenantID="aisuru.com"
27
- integration={integration}
28
- layout="TOTEM"
29
- />
22
+ <I18nWrapper>
23
+ <Memori
24
+ showShare={true}
25
+ showSettings={true}
26
+ memori={memori}
27
+ tenant={tenant}
28
+ tenantID="aisuru.com"
29
+ integration={integration}
30
+ layout="TOTEM"
31
+ />
32
+ </I18nWrapper>
30
33
  );
31
34
  expect(container).toMatchSnapshot();
32
35
  });
@@ -1,6 +1,7 @@
1
1
  import { render } from '@testing-library/react';
2
2
  import Memori from '../MemoriWidget/MemoriWidget';
3
3
  import { integration, memori, tenant } from '../../mocks/data';
4
+ import I18nWrapper from '../../I18nWrapper';
4
5
 
5
6
  Object.defineProperty(window, 'matchMedia', {
6
7
  writable: true,
@@ -18,15 +19,17 @@ Object.defineProperty(window, 'matchMedia', {
18
19
 
19
20
  it('renders WEBSITE_ASSISTANT layout unchanged', () => {
20
21
  const { container } = render(
21
- <Memori
22
- showShare={true}
23
- showSettings={true}
24
- memori={memori}
25
- tenant={tenant}
26
- tenantID="aisuru.com"
27
- integration={integration}
28
- layout="WEBSITE_ASSISTANT"
29
- />
22
+ <I18nWrapper>
23
+ <Memori
24
+ showShare={true}
25
+ showSettings={true}
26
+ memori={memori}
27
+ tenant={tenant}
28
+ tenantID="aisuru.com"
29
+ integration={integration}
30
+ layout="WEBSITE_ASSISTANT"
31
+ />
32
+ </I18nWrapper>
30
33
  );
31
34
  expect(container).toMatchSnapshot();
32
35
  });
@@ -69,7 +69,7 @@ exports[`renders Chat layout unchanged 1`] = `
69
69
  <div
70
70
  class="memori-export-history-button memori-header--button memori-header--button--export"
71
71
  data-headlessui-state=""
72
- title="write_and_speak.exportChatHistoryMessage"
72
+ title="Vuoi esportare la cronologia chat?"
73
73
  >
74
74
  <button
75
75
  class="memori-button memori-button--circle memori-button--icon-only memori-button--disabled"
@@ -97,7 +97,7 @@ exports[`renders Chat layout unchanged 1`] = `
97
97
  </div>
98
98
  <button
99
99
  class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button-settings"
100
- title="widget.settings"
100
+ title="Impostazioni"
101
101
  >
102
102
  <span
103
103
  class="memori-button--icon"
@@ -125,7 +125,7 @@ exports[`renders Chat layout unchanged 1`] = `
125
125
  class="memori-button memori-button--circle memori-button--icon-only memori-share-button--button memori-header--button memori-header--button-share memori-button--primary"
126
126
  data-headlessui-state=""
127
127
  id="headlessui-menu-button-:r5:"
128
- title="widget.share"
128
+ title="Condividi"
129
129
  type="button"
130
130
  >
131
131
  <div
@@ -168,13 +168,13 @@ exports[`renders Chat layout unchanged 1`] = `
168
168
  <div
169
169
  class="memori-tooltip--content"
170
170
  >
171
- completionsEnabled
171
+ IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette
172
172
  </div>
173
173
  <div
174
174
  class="memori-tooltip--trigger"
175
175
  >
176
176
  <span
177
- aria-label="completionsEnabled"
177
+ aria-label="IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette"
178
178
  >
179
179
  <svg
180
180
  aria-hidden="true"
@@ -244,7 +244,7 @@ exports[`renders Chat layout unchanged 1`] = `
244
244
  for="user-lang-pref"
245
245
  id="user-lang-pref-label"
246
246
  >
247
- write_and_speak.iWantToTalkToIn
247
+ Voglio parlare con Memori in
248
248
  </label>
249
249
  <select
250
250
  aria-labelledby="user-lang-pref-label"
@@ -340,12 +340,12 @@ exports[`renders Chat layout unchanged 1`] = `
340
340
  <button
341
341
  class="memori-button memori-button--primary memori-button--rounded memori-button--padded memori--start-button"
342
342
  >
343
- write_and_speak.tryMeButton
343
+ INIZIAMO
344
344
  </button>
345
345
  <p
346
346
  class="memori--start-description"
347
347
  >
348
- write_and_speak.pageTryMeExplanation
348
+ Per parlare con me clicca sul pulsante INIZIAMO per cominciare
349
349
  </p>
350
350
  </div>
351
351
  </div>
@@ -373,5 +373,10 @@ exports[`renders Chat layout unchanged 1`] = `
373
373
  style="display: none;"
374
374
  />
375
375
  </div>
376
+ <script
377
+ async=""
378
+ id="MathJax-script"
379
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
380
+ />
376
381
  </div>
377
382
  `;
@@ -44,7 +44,7 @@ exports[`renders FullPage layout unchanged 1`] = `
44
44
  <div
45
45
  class="memori-export-history-button memori-header--button memori-header--button--export"
46
46
  data-headlessui-state=""
47
- title="write_and_speak.exportChatHistoryMessage"
47
+ title="Vuoi esportare la cronologia chat?"
48
48
  >
49
49
  <button
50
50
  class="memori-button memori-button--circle memori-button--icon-only memori-button--disabled"
@@ -72,7 +72,7 @@ exports[`renders FullPage layout unchanged 1`] = `
72
72
  </div>
73
73
  <button
74
74
  class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button-settings"
75
- title="widget.settings"
75
+ title="Impostazioni"
76
76
  >
77
77
  <span
78
78
  class="memori-button--icon"
@@ -100,7 +100,7 @@ exports[`renders FullPage layout unchanged 1`] = `
100
100
  class="memori-button memori-button--circle memori-button--icon-only memori-share-button--button memori-header--button memori-header--button-share memori-button--primary"
101
101
  data-headlessui-state=""
102
102
  id="headlessui-menu-button-:r5:"
103
- title="widget.share"
103
+ title="Condividi"
104
104
  type="button"
105
105
  >
106
106
  <div
@@ -181,7 +181,7 @@ exports[`renders FullPage layout unchanged 1`] = `
181
181
  <span
182
182
  class="memori--avatar-toggle-text"
183
183
  >
184
- hide
184
+ Nascondi
185
185
  </span>
186
186
  </button>
187
187
  </div>
@@ -207,13 +207,13 @@ exports[`renders FullPage layout unchanged 1`] = `
207
207
  <div
208
208
  class="memori-tooltip--content"
209
209
  >
210
- completionsEnabled
210
+ IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette
211
211
  </div>
212
212
  <div
213
213
  class="memori-tooltip--trigger"
214
214
  >
215
215
  <span
216
- aria-label="completionsEnabled"
216
+ aria-label="IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette"
217
217
  >
218
218
  <svg
219
219
  aria-hidden="true"
@@ -283,7 +283,7 @@ exports[`renders FullPage layout unchanged 1`] = `
283
283
  for="user-lang-pref"
284
284
  id="user-lang-pref-label"
285
285
  >
286
- write_and_speak.iWantToTalkToIn
286
+ Voglio parlare con Memori in
287
287
  </label>
288
288
  <select
289
289
  aria-labelledby="user-lang-pref-label"
@@ -379,12 +379,12 @@ exports[`renders FullPage layout unchanged 1`] = `
379
379
  <button
380
380
  class="memori-button memori-button--primary memori-button--rounded memori-button--padded memori--start-button"
381
381
  >
382
- write_and_speak.tryMeButton
382
+ INIZIAMO
383
383
  </button>
384
384
  <p
385
385
  class="memori--start-description"
386
386
  >
387
- write_and_speak.pageTryMeExplanation
387
+ Per parlare con me clicca sul pulsante INIZIAMO per cominciare
388
388
  </p>
389
389
  </div>
390
390
  </div>
@@ -435,5 +435,10 @@ exports[`renders FullPage layout unchanged 1`] = `
435
435
  style="display: none;"
436
436
  />
437
437
  </div>
438
+ <script
439
+ async=""
440
+ id="MathJax-script"
441
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
442
+ />
438
443
  </div>
439
444
  `;
@@ -100,7 +100,7 @@ exports[`renders Totem layout unchanged 1`] = `
100
100
  <div
101
101
  class="memori-export-history-button memori-header--button memori-header--button--export"
102
102
  data-headlessui-state=""
103
- title="write_and_speak.exportChatHistoryMessage"
103
+ title="Vuoi esportare la cronologia chat?"
104
104
  >
105
105
  <button
106
106
  class="memori-button memori-button--circle memori-button--icon-only memori-button--disabled"
@@ -128,7 +128,7 @@ exports[`renders Totem layout unchanged 1`] = `
128
128
  </div>
129
129
  <button
130
130
  class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button-settings"
131
- title="widget.settings"
131
+ title="Impostazioni"
132
132
  >
133
133
  <span
134
134
  class="memori-button--icon"
@@ -156,7 +156,7 @@ exports[`renders Totem layout unchanged 1`] = `
156
156
  class="memori-button memori-button--circle memori-button--icon-only memori-share-button--button memori-header--button memori-header--button-share memori-button--primary"
157
157
  data-headlessui-state=""
158
158
  id="headlessui-menu-button-:r5:"
159
- title="widget.share"
159
+ title="Condividi"
160
160
  type="button"
161
161
  >
162
162
  <div
@@ -235,7 +235,7 @@ exports[`renders Totem layout unchanged 1`] = `
235
235
  <span
236
236
  class="memori--avatar-toggle-text"
237
237
  >
238
- hide
238
+ Nascondi
239
239
  </span>
240
240
  </button>
241
241
  </div>
@@ -261,13 +261,13 @@ exports[`renders Totem layout unchanged 1`] = `
261
261
  <div
262
262
  class="memori-tooltip--content"
263
263
  >
264
- completionsEnabled
264
+ IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette
265
265
  </div>
266
266
  <div
267
267
  class="memori-tooltip--trigger"
268
268
  >
269
269
  <span
270
- aria-label="completionsEnabled"
270
+ aria-label="IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette"
271
271
  >
272
272
  <svg
273
273
  aria-hidden="true"
@@ -337,7 +337,7 @@ exports[`renders Totem layout unchanged 1`] = `
337
337
  for="user-lang-pref"
338
338
  id="user-lang-pref-label"
339
339
  >
340
- write_and_speak.iWantToTalkToIn
340
+ Voglio parlare con Memori in
341
341
  </label>
342
342
  <select
343
343
  aria-labelledby="user-lang-pref-label"
@@ -433,12 +433,12 @@ exports[`renders Totem layout unchanged 1`] = `
433
433
  <button
434
434
  class="memori-button memori-button--primary memori-button--rounded memori-button--padded memori--start-button"
435
435
  >
436
- write_and_speak.tryMeButton
436
+ INIZIAMO
437
437
  </button>
438
438
  <p
439
439
  class="memori--start-description"
440
440
  >
441
- write_and_speak.pageTryMeExplanation
441
+ Per parlare con me clicca sul pulsante INIZIAMO per cominciare
442
442
  </p>
443
443
  </div>
444
444
  </div>
@@ -466,5 +466,10 @@ exports[`renders Totem layout unchanged 1`] = `
466
466
  style="display: none;"
467
467
  />
468
468
  </div>
469
+ <script
470
+ async=""
471
+ id="MathJax-script"
472
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
473
+ />
469
474
  </div>
470
475
  `;
@@ -19,7 +19,7 @@ exports[`renders WEBSITE_ASSISTANT layout unchanged 1`] = `
19
19
  >
20
20
  <button
21
21
  class="memori-button memori-button--ghost memori-button--circle memori-button--padded memori-website_assistant--trigger-button"
22
- title="expand"
22
+ title="Espandi"
23
23
  >
24
24
  <div
25
25
  class="memori-blob"
@@ -56,5 +56,10 @@ exports[`renders WEBSITE_ASSISTANT layout unchanged 1`] = `
56
56
  style="display: none;"
57
57
  />
58
58
  </div>
59
+ <script
60
+ async=""
61
+ id="MathJax-script"
62
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
63
+ />
59
64
  </div>
60
65
  `;
@@ -15,6 +15,8 @@ export const chatLanguages = [
15
15
  { value: 'JA', label: '日本語' },
16
16
  ];
17
17
 
18
+ export const uiLanguages = ['en', 'it', 'fr', 'es', 'de'];
19
+
18
20
  export const allowedMediaTypes = [
19
21
  'image/jpeg',
20
22
  'image/png',
@@ -38,6 +38,8 @@ const errors = {
38
38
  USER_CANT_ENABLE_DCM_INTEGRATION: -43,
39
39
  USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS: -44,
40
40
  USER_CREATION_BILLING_DENIED_PERMISSION: -46,
41
+ USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS: -47,
42
+ USER_CANT_BE_DELETED: -48,
41
43
 
42
44
  MEMORI_NOT_FOUND: -51,
43
45
  MEMORI_NOT_ACCESSIBLE: -52,
@@ -145,6 +147,7 @@ const errors = {
145
147
  IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR: -1506,
146
148
  IMPORTCSV_INVALID_RECEIVER_ID: -1507,
147
149
  IMPORTCSV_INVALID_MEDIA_LINK: -1508,
150
+ IMPORTCSV_INVALID_LINK_TITLE_HANDLING: -1509,
148
151
  IMPORTCSV_UNDETECTABLE_CHAR_ENCODING: -1521,
149
152
  IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI: -1531,
150
153
 
@@ -152,6 +155,7 @@ const errors = {
152
155
  IMPORTTXT_INVALID_GRANULARITY: -1602,
153
156
  IMPORTTXT_INVALID_RECEIVER_ID: -1603,
154
157
  IMPORTTXT_INVALID_MEDIA_LINK: -1604,
158
+ IMPORTTXT_INVALID_LINK_TITLE_HANDLING: -1605,
155
159
  IMPORTTXT_UNDETECTABLE_CHAR_ENCODING: -1621,
156
160
  IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI: -1631,
157
161
  IMPORTTXT_IMPORT_LIMIT_EXCEEDED: -1632,
@@ -203,6 +207,7 @@ const errors = {
203
207
  COMPLETION_CONFIG_MISSING_API_KEY: -2404,
204
208
  COMPLETION_CONFIG_MISSING_MODEL: -2405,
205
209
  COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED: -2406,
210
+ COMPLETION_CONFIG_INVALID_NAME: -2407,
206
211
  COMPLETION_CONFIG_INVALID_PURPOSE: -2411,
207
212
  COMPLETION_CONFIG_INVALID_ENDPOINT: -2412,
208
213
  COMPLETION_CONFIG_INCONSISTENT_ENDPOINT: -2413,
package/src/i18n.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { createInstance } from 'i18next';
2
2
  import it from './locales/it.json';
3
3
  import en from './locales/en.json';
4
+ import fr from './locales/fr.json';
5
+ import de from './locales/de.json';
6
+ import es from './locales/es.json';
4
7
 
5
8
  const resources = {
6
9
  en: {
@@ -9,13 +12,22 @@ const resources = {
9
12
  it: {
10
13
  translation: it,
11
14
  },
15
+ es: {
16
+ translation: es,
17
+ },
18
+ fr: {
19
+ translation: fr,
20
+ },
21
+ de: {
22
+ translation: de,
23
+ },
12
24
  };
13
25
 
14
26
  const i18n = createInstance({
15
27
  resources,
16
28
  lng: 'en',
17
29
  fallbackLng: 'it',
18
- supportedLngs: ['en', 'it'],
30
+ supportedLngs: ['en', 'it', 'fr', 'es', 'de'],
19
31
  nonExplicitSupportedLngs: true,
20
32
  interpolation: {
21
33
  escapeValue: false,
@@ -82,6 +82,35 @@ Staging.args = {
82
82
  layout: 'FULLPAGE',
83
83
  };
84
84
 
85
+ export const ProductionTotem = Template.bind({});
86
+ ProductionTotem.args = {
87
+ memoriName: 'Prova12345',
88
+ ownerUserName: 'patini929',
89
+ memoriID: '514dd043-ec26-4c57-a014-a512c9014822',
90
+ ownerUserID: '1941d326-6986-4fa1-872b-458d09fb654c',
91
+ tenantID: 'www.aisuru.com',
92
+ engineURL: 'https://engine.memori.ai',
93
+ apiURL: 'https://backend.memori.ai',
94
+ baseURL: 'https://www.aisuru.com',
95
+ uiLang: 'IT',
96
+ spokenLang: 'FR',
97
+ layout: 'FULLPAGE',
98
+
99
+ showInstruct: false,
100
+ showSettings: true,
101
+ showClear: false,
102
+ showAIicon: 'true',
103
+ showWhyThisAnswer: true,
104
+ showTypingText: false,
105
+ showOnlyLastMessages: false,
106
+ showTranslationOriginal: false,
107
+ showCopyButton: false,
108
+ showShare: true,
109
+ showLogin: false,
110
+ enableAudio: true,
111
+ integrationID: '37d368cf-6241-4cc8-a1f3-742786f22431',
112
+ };
113
+
85
114
  const TemplateWithBatchButton: Story<Props> = args => (
86
115
  <div>
87
116
  <button
package/src/index.tsx CHANGED
@@ -14,7 +14,8 @@ import { getTenant } from './helpers/tenant';
14
14
  import { installMathJax } from './helpers/utils';
15
15
 
16
16
  import i18n from './i18n';
17
- import { I18nextProvider, useTranslation } from 'react-i18next';
17
+ import { useTranslation } from 'react-i18next';
18
+ import I18nWrapper from './I18nWrapper';
18
19
 
19
20
  export interface Props {
20
21
  memoriName?: string | null;
@@ -47,7 +48,7 @@ export interface Props {
47
48
  pin?: string;
48
49
  context?: { [key: string]: string };
49
50
  initialQuestion?: string;
50
- uiLang?: 'en' | 'it' | 'IT' | 'EN';
51
+ uiLang?: 'en' | 'it' | 'fr' | 'es' | 'de' | 'IT' | 'EN' | 'FR' | 'ES' | 'DE';
51
52
  spokenLang?: string;
52
53
  multilingual?: boolean;
53
54
  authToken?: string;
@@ -298,10 +299,10 @@ const Memori: React.FC<Props> = ({
298
299
  );
299
300
 
300
301
  return (
301
- <I18nextProvider i18n={i18n}>
302
+ <I18nWrapper>
302
303
  <Toaster position="top-center" reverseOrder={true} />
303
304
  {renderer}
304
- </I18nextProvider>
305
+ </I18nWrapper>
305
306
  );
306
307
  };
307
308
 
@@ -342,7 +343,18 @@ Memori.propTypes = {
342
343
  pin: PropTypes.string,
343
344
  context: PropTypes.objectOf(PropTypes.any),
344
345
  initialQuestion: PropTypes.string,
345
- uiLang: PropTypes.oneOf(['en', 'it', 'EN', 'IT']),
346
+ uiLang: PropTypes.oneOf([
347
+ 'en',
348
+ 'it',
349
+ 'fr',
350
+ 'es',
351
+ 'de',
352
+ 'EN',
353
+ 'IT',
354
+ 'FR',
355
+ 'ES',
356
+ 'DE',
357
+ ]),
346
358
  spokenLang: PropTypes.string,
347
359
  multilingual: PropTypes.bool,
348
360
  authToken: PropTypes.string,