@memori.ai/memori-react 4.0.1 → 4.1.1

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 (40) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/AgeVerificationModal/AgeVerificationModal.js +5 -1
  3. package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  4. package/dist/components/MemoriWidget/MemoriWidget.js +1 -0
  5. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  6. package/dist/components/StartPanel/StartPanel.css +41 -0
  7. package/dist/components/StartPanel/StartPanel.d.ts +1 -0
  8. package/dist/components/StartPanel/StartPanel.js +3 -2
  9. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  10. package/dist/helpers/tenant.js +1 -1
  11. package/dist/helpers/tenant.js.map +1 -1
  12. package/dist/locales/en.json +4 -0
  13. package/dist/locales/it.json +4 -0
  14. package/dist/styles.css +1 -0
  15. package/esm/components/AgeVerificationModal/AgeVerificationModal.js +5 -1
  16. package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  17. package/esm/components/MemoriWidget/MemoriWidget.js +1 -0
  18. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  19. package/esm/components/StartPanel/StartPanel.css +41 -0
  20. package/esm/components/StartPanel/StartPanel.d.ts +1 -0
  21. package/esm/components/StartPanel/StartPanel.js +3 -2
  22. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  23. package/esm/helpers/tenant.js +1 -1
  24. package/esm/helpers/tenant.js.map +1 -1
  25. package/esm/locales/en.json +4 -0
  26. package/esm/locales/it.json +4 -0
  27. package/esm/styles.css +1 -0
  28. package/package.json +2 -2
  29. package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +6 -0
  30. package/src/components/MemoriWidget/MemoriWidget.tsx +1 -0
  31. package/src/components/StartPanel/StartPanel.css +41 -0
  32. package/src/components/StartPanel/StartPanel.stories.tsx +18 -0
  33. package/src/components/StartPanel/StartPanel.test.tsx +22 -0
  34. package/src/components/StartPanel/StartPanel.tsx +22 -0
  35. package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +167 -0
  36. package/src/helpers/tenant.ts +1 -1
  37. package/src/locales/en.json +4 -0
  38. package/src/locales/it.json +4 -0
  39. package/src/styles.css +1 -0
  40. package/src/components/ui/Message.tsx +0 -12
@@ -190,6 +190,24 @@ WithAllTheBadges.args = {
190
190
  onClickStart: () => {},
191
191
  };
192
192
 
193
+ export const WithDeepThoughtEnabled = Template.bind({});
194
+ WithDeepThoughtEnabled.args = {
195
+ memori: {
196
+ ...memori,
197
+ enableDeepThought: true,
198
+ },
199
+ tenant,
200
+ language: 'it',
201
+ userLang: 'en',
202
+ setUserLang: () => {},
203
+ openPositionDrawer: () => {},
204
+ instruct: false,
205
+ sessionId: sessionID,
206
+ clickedStart: false,
207
+ onClickStart: () => {},
208
+ isUserLoggedIn: true,
209
+ };
210
+
193
211
  export const BoardOfExpert = Template.bind({});
194
212
  BoardOfExpert.args = {
195
213
  memori: {
@@ -86,6 +86,28 @@ it('renders StartPanel for board of experts unchanged', () => {
86
86
  expect(container).toMatchSnapshot();
87
87
  });
88
88
 
89
+ it('renders StartPanel with deep thought enabled unchanged', () => {
90
+ const { container } = render(
91
+ <StartPanel
92
+ memori={{
93
+ ...memori,
94
+ enableDeepThought: true,
95
+ }}
96
+ tenant={tenant}
97
+ language="it"
98
+ userLang="en"
99
+ setUserLang={() => {}}
100
+ openPositionDrawer={() => {}}
101
+ instruct={false}
102
+ sessionId={sessionID}
103
+ clickedStart={false}
104
+ onClickStart={() => {}}
105
+ isUserLoggedIn
106
+ />
107
+ );
108
+ expect(container).toMatchSnapshot();
109
+ });
110
+
89
111
  it('renders StartPanel on instruct unchanged', () => {
90
112
  const { container } = render(
91
113
  <StartPanel
@@ -15,6 +15,7 @@ import { chatLanguages } from '../../helpers/constants';
15
15
  import BlockedMemoriBadge from '../BlockedMemoriBadge/BlockedMemoriBadge';
16
16
  import AI from '../icons/AI';
17
17
  import Group from '../icons/Group';
18
+ import DeepThought from '../icons/DeepThought';
18
19
  import CompletionProviderStatus from '../CompletionProviderStatus/CompletionProviderStatus';
19
20
 
20
21
  export interface Props {
@@ -35,6 +36,7 @@ export interface Props {
35
36
  onClickStart?: () => void;
36
37
  initializeTTS?: () => void;
37
38
  _TEST_forceProviderStatus?: string;
39
+ isUserLoggedIn?: boolean;
38
40
  }
39
41
 
40
42
  const StartPanel: React.FC<Props> = ({
@@ -54,6 +56,7 @@ const StartPanel: React.FC<Props> = ({
54
56
  onClickStart,
55
57
  initializeTTS,
56
58
  _TEST_forceProviderStatus,
59
+ isUserLoggedIn = false,
57
60
  }) => {
58
61
  const { t, i18n } = useTranslation();
59
62
  const [translatedDescription, setTranslatedDescription] = useState(
@@ -287,6 +290,25 @@ const StartPanel: React.FC<Props> = ({
287
290
  marginLeft
288
291
  />
289
292
  )}
293
+
294
+ {!!memori.enableDeepThought && !instruct && !!isUserLoggedIn && (
295
+ <div className="memori--deep-thought-disclaimer">
296
+ <Tooltip align="left" content={t('deepThoughtHelper')}>
297
+ <DeepThought />
298
+ </Tooltip>
299
+ <h2>{t('deepThoughtDisclaimerTitle')}</h2>
300
+ <p>{t('deepThoughtDisclaimer')}</p>
301
+ <p>
302
+ <a
303
+ href="https://app.twincreator.com/en/privacy_and_cookie"
304
+ target="_blank"
305
+ rel="noopener noreferrer"
306
+ >
307
+ Privacy policy
308
+ </a>
309
+ </p>
310
+ </div>
311
+ )}
290
312
  </div>
291
313
  )}
292
314
  </div>
@@ -553,6 +553,173 @@ exports[`renders StartPanel with completions enabled unchanged 1`] = `
553
553
  </div>
554
554
  `;
555
555
 
556
+ exports[`renders StartPanel with deep thought enabled unchanged 1`] = `
557
+ <div>
558
+ <div
559
+ class="memori--start-panel"
560
+ >
561
+ <div
562
+ class="memori--cover"
563
+ >
564
+ <div
565
+ class="memori--completions-enabled"
566
+ >
567
+ <div
568
+ class="memori-tooltip memori-tooltip--align-left"
569
+ >
570
+ <div
571
+ class="memori-tooltip--content"
572
+ >
573
+ completionsEnabled
574
+ </div>
575
+ <div
576
+ class="memori-tooltip--trigger"
577
+ >
578
+ <span
579
+ aria-label="completionsEnabled"
580
+ >
581
+ <svg
582
+ aria-hidden="true"
583
+ fill="none"
584
+ focusable="false"
585
+ role="img"
586
+ viewBox="0 0 24 24"
587
+ xmlns="http://www.w3.org/2000/svg"
588
+ >
589
+ <g
590
+ clip-rule="evenodd"
591
+ fill="currentColor"
592
+ fill-rule="evenodd"
593
+ >
594
+ <path
595
+ clip-rule="evenodd"
596
+ 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"
597
+ fill-rule="evenodd"
598
+ />
599
+ <path
600
+ clip-rule="evenodd"
601
+ 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"
602
+ fill-rule="evenodd"
603
+ />
604
+ <path
605
+ clip-rule="evenodd"
606
+ 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"
607
+ fill-rule="evenodd"
608
+ />
609
+ </g>
610
+ </svg>
611
+ </span>
612
+ </div>
613
+ </div>
614
+ </div>
615
+ </div>
616
+ <picture
617
+ class="memori--avatar"
618
+ >
619
+ <source
620
+ src="https://app.twincreator.com/images/twincreator/square_logo.png"
621
+ />
622
+ <img
623
+ alt="Memori"
624
+ src="https://app.twincreator.com/images/twincreator/square_logo.png"
625
+ />
626
+ </picture>
627
+ <h2
628
+ class="memori--title"
629
+ >
630
+ Memori
631
+ </h2>
632
+ <div
633
+ class="memori--description"
634
+ >
635
+ <p>
636
+ <span
637
+ class="memori--description-text"
638
+ >
639
+ Lorem ipsum.
640
+ </span>
641
+ </p>
642
+ <button
643
+ class="memori-button memori-button--primary memori-button--rounded memori-button--padded memori--start-button"
644
+ >
645
+ write_and_speak.tryMeButton
646
+ </button>
647
+ <p
648
+ class="memori--start-description"
649
+ >
650
+ write_and_speak.pageTryMeExplanation
651
+ </p>
652
+ <div
653
+ class="memori--deep-thought-disclaimer"
654
+ >
655
+ <div
656
+ class="memori-tooltip memori-tooltip--align-left"
657
+ >
658
+ <div
659
+ class="memori-tooltip--content"
660
+ >
661
+ deepThoughtHelper
662
+ </div>
663
+ <div
664
+ class="memori-tooltip--trigger"
665
+ >
666
+ <svg
667
+ aria-hidden="true"
668
+ fill="none"
669
+ focusable="false"
670
+ height="20"
671
+ role="img"
672
+ stroke="currentColor"
673
+ stroke-linecap="round"
674
+ stroke-linejoin="round"
675
+ stroke-width="3"
676
+ viewBox="0 0 48 48"
677
+ width="20"
678
+ xmlns="http://www.w3.org/2000/svg"
679
+ >
680
+ <path
681
+ d="M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2"
682
+ stroke-miterlimit="10"
683
+ />
684
+ <path
685
+ d="M27.917 12L31.417 12"
686
+ />
687
+ <path
688
+ d="M27.917 26L31.417 26"
689
+ />
690
+ <path
691
+ d="M29.667 12L29.667 26"
692
+ />
693
+ <path
694
+ d="M23.992 26L19.904 12 19.226 12 15.159 26"
695
+ />
696
+ <path
697
+ d="M16.854 21.133L22.276 21.133"
698
+ />
699
+ </svg>
700
+ </div>
701
+ </div>
702
+ <h2>
703
+ deepThoughtDisclaimerTitle
704
+ </h2>
705
+ <p>
706
+ deepThoughtDisclaimer
707
+ </p>
708
+ <p>
709
+ <a
710
+ href="https://app.twincreator.com/en/privacy_and_cookie"
711
+ rel="noopener noreferrer"
712
+ target="_blank"
713
+ >
714
+ Privacy policy
715
+ </a>
716
+ </p>
717
+ </div>
718
+ </div>
719
+ </div>
720
+ </div>
721
+ `;
722
+
556
723
  exports[`renders StartPanel with gamification level unchanged 1`] = `
557
724
  <div>
558
725
  <div
@@ -23,7 +23,7 @@ export const getTenant = async (
23
23
  ? 'http://'
24
24
  : 'https://'
25
25
  }${baseURL}`
26
- ).host
26
+ ).origin
27
27
  : 'https://app.twincreator.com';
28
28
 
29
29
  try {
@@ -43,6 +43,10 @@
43
43
  "ageVerification": "Age verification",
44
44
  "ageVerificationText": "To interact with this Twin, you must be at least {{minAge}} years old.",
45
45
  "nsfw": "NSFW: This Twin contains adult contents",
46
+ "deepThought": "Deep Thought",
47
+ "deepThoughtHelper": "Allows to establish a unique relationship between the AI and the person who interrogates it, allowing the AI to remember this relationship and therefore supporting people with questions targeted to their experiences. Once people start their relationships, the creator of the AI will see their community grow with Followers and will be able to observe the known facts collected during the conversations.",
48
+ "deepThoughtDisclaimerTitle": "Deep Thought enabled",
49
+ "deepThoughtDisclaimer": "By continuing the conversation I authorize the processing of my personal data as specified in the information notice which I declare to have read.",
46
50
  "auth": {
47
51
  "title": "Authentication",
48
52
  "useRecoveryTokens": "Use recovery tokens",
@@ -43,6 +43,10 @@
43
43
  "ageVerification": "Verifica dell'età",
44
44
  "ageVerificationText": "Per interagire con questo Twin, devi aver almeno {{minAge}} anni.",
45
45
  "nsfw": "NSFW: Questo Twin contiene contenuti per adulti",
46
+ "deepThought": "Pensiero profondo",
47
+ "deepThoughtHelper": "Permette di stabilire una relazione univoca tra l'IA e la persona che la interroga, permettendo all'IA memoria di questa relazione supportando quindi le persone con domande mirate alle loro esperienze. Una volta che le persone avvieranno le loro relazioni, il creatore delle AI vedrà la propria community crescere di Follower e potrà osservare i fatti noti raccolti durante le conversazioni.",
48
+ "deepThoughtDisclaimerTitle": "Pensiero profondo abilitato",
49
+ "deepThoughtDisclaimer": "Proseguendo nella conversazione autorizzo il trattamento dei miei dati personali così come specificato nell'informativa di cui dichiaro di aver preso visione.",
46
50
  "auth": {
47
51
  "title": "Autenticazione",
48
52
  "useRecoveryTokens": "Utilizza i token di recupero",
package/src/styles.css CHANGED
@@ -86,4 +86,5 @@ body.sb-show-main #root,
86
86
  --memori-modal--width: 100%;
87
87
  --memori-modal--width--md: 80%;
88
88
  --memori-error-color: #ff4d4f;
89
+ --memori-warning-color: #faad14;
89
90
  }
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
-
3
- const Message = () => <div>Message</div>;
4
-
5
- const message = {
6
- error: console.error,
7
- info: console.info,
8
- success: console.log,
9
- };
10
-
11
- export { Message };
12
- export default message;