@memori.ai/memori-react 4.1.0 → 4.2.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 +28 -0
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js +5 -1
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/dist/components/Header/Header.css +1 -1
- package/dist/components/Header/Header.d.ts +3 -0
- package/dist/components/Header/Header.js +3 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/KnownFacts/KnownFacts.css +19 -0
- package/dist/components/KnownFacts/KnownFacts.d.ts +11 -0
- package/dist/components/KnownFacts/KnownFacts.js +157 -0
- package/dist/components/KnownFacts/KnownFacts.js.map +1 -0
- package/dist/components/MemoriWidget/MemoriWidget.js +8 -3
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/SettingsDrawer/SettingsDrawer.js +1 -1
- package/dist/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.css +2 -2
- package/dist/components/icons/ChevronLeft.d.ts +5 -0
- package/dist/components/icons/ChevronLeft.js +6 -0
- package/dist/components/icons/ChevronLeft.js.map +1 -0
- package/dist/components/icons/ChevronRight.d.ts +5 -0
- package/dist/components/icons/ChevronRight.js +6 -0
- package/dist/components/icons/ChevronRight.js.map +1 -0
- package/dist/components/ui/Button.css +29 -1
- package/dist/components/ui/Checkbox.css +17 -4
- package/dist/components/ui/Checkbox.d.ts +2 -1
- package/dist/components/ui/Checkbox.js +13 -3
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Drawer.css +22 -4
- package/dist/components/ui/Modal.d.ts +1 -1
- package/dist/components/ui/Select.js +1 -1
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/Table.css +113 -0
- package/dist/locales/en.json +20 -0
- package/dist/locales/it.json +20 -0
- package/dist/styles.css +8 -0
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js +5 -1
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/esm/components/Header/Header.css +1 -1
- package/esm/components/Header/Header.d.ts +3 -0
- package/esm/components/Header/Header.js +3 -2
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/KnownFacts/KnownFacts.css +19 -0
- package/esm/components/KnownFacts/KnownFacts.d.ts +11 -0
- package/esm/components/KnownFacts/KnownFacts.js +154 -0
- package/esm/components/KnownFacts/KnownFacts.js.map +1 -0
- package/esm/components/MemoriWidget/MemoriWidget.js +8 -3
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/SettingsDrawer/SettingsDrawer.js +1 -1
- package/esm/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.css +2 -2
- package/esm/components/icons/ChevronLeft.d.ts +5 -0
- package/esm/components/icons/ChevronLeft.js +4 -0
- package/esm/components/icons/ChevronLeft.js.map +1 -0
- package/esm/components/icons/ChevronRight.d.ts +5 -0
- package/esm/components/icons/ChevronRight.js +4 -0
- package/esm/components/icons/ChevronRight.js.map +1 -0
- package/esm/components/ui/Button.css +29 -1
- package/esm/components/ui/Checkbox.css +17 -4
- package/esm/components/ui/Checkbox.d.ts +2 -1
- package/esm/components/ui/Checkbox.js +13 -3
- package/esm/components/ui/Checkbox.js.map +1 -1
- package/esm/components/ui/Drawer.css +22 -4
- package/esm/components/ui/Modal.d.ts +1 -1
- package/esm/components/ui/Select.js +1 -1
- package/esm/components/ui/Select.js.map +1 -1
- package/esm/components/ui/Table.css +113 -0
- package/esm/locales/en.json +20 -0
- package/esm/locales/it.json +20 -0
- package/esm/styles.css +8 -0
- package/package.json +2 -2
- package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +6 -0
- package/src/components/Header/Header.css +1 -1
- package/src/components/Header/Header.stories.tsx +37 -0
- package/src/components/Header/Header.test.tsx +54 -0
- package/src/components/Header/Header.tsx +18 -0
- package/src/components/Header/__snapshots__/Header.test.tsx.snap +203 -0
- package/src/components/KnownFacts/KnownFacts.css +19 -0
- package/src/components/KnownFacts/KnownFacts.stories.tsx +79 -0
- package/src/components/KnownFacts/KnownFacts.test.tsx +54 -0
- package/src/components/KnownFacts/KnownFacts.tsx +449 -0
- package/src/components/KnownFacts/__snapshots__/KnownFacts.test.tsx.snap +19 -0
- package/src/components/MemoriWidget/MemoriWidget.tsx +17 -2
- package/src/components/SettingsDrawer/SettingsDrawer.tsx +3 -1
- package/src/components/StartPanel/StartPanel.css +2 -2
- package/src/components/icons/ChevronLeft.tsx +28 -0
- package/src/components/icons/ChevronRight.tsx +28 -0
- package/src/components/ui/Button.css +29 -1
- package/src/components/ui/Checkbox.css +17 -4
- package/src/components/ui/Checkbox.stories.tsx +15 -0
- package/src/components/ui/Checkbox.test.tsx +5 -0
- package/src/components/ui/Checkbox.tsx +38 -23
- package/src/components/ui/Drawer.css +22 -4
- package/src/components/ui/Modal.tsx +1 -1
- package/src/components/ui/Select.tsx +5 -1
- package/src/components/ui/Table.css +113 -0
- package/src/components/ui/__snapshots__/Checkbox.test.tsx.snap +26 -0
- package/src/locales/en.json +20 -0
- package/src/locales/it.json +20 -0
- package/src/mocks/data.ts +11 -0
- package/src/styles.css +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/ui/Select.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAa7C,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,KAAK,EACL,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,WAAW,GACL,EAAE,EAAE;IACV,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,YAC5C,MAAC,OAAO,IACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,KAAK,CAAC,EAAE;gBAChB,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/ui/Select.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAa7C,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,KAAK,EACL,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,WAAW,GACL,EAAE,EAAE;IACV,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,YAC5C,MAAC,OAAO,IACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,KAAK,CAAC,EAAE;gBAChB,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,KAAK,aAET,KAAK,IAAI,CACR,MAAC,OAAO,CAAC,KAAK,IAAC,SAAS,EAAC,sBAAsB,aAC5C,KAAK,SACQ,CACjB,EACD,MAAC,OAAO,CAAC,MAAM,kBAAa,KAAK,EAAE,SAAS,EAAC,uBAAuB,aAClE,eACE,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE;gCACpC,kCAAkC,EAAE,CAAC,KAAK;6BAC3C,CAAC,YAED,KAAK,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,WAAW,GACvC,EACP,eAAM,SAAS,EAAC,qBAAqB,YACnC,KAAC,UAAU,KAAG,GACT,IACQ,EACjB,KAAC,UAAU,IACT,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAC,iCAAiC,EACvC,SAAS,EAAC,aAAa,EACvB,OAAO,EAAC,WAAW,YAEnB,KAAC,OAAO,CAAC,OAAO,IAAC,SAAS,EAAC,wBAAwB,YAChD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAClB,KAAC,OAAO,CAAC,MAAM,IAEb,KAAK,EAAE,GAAG,CAAC,KAAK,EAChB,SAAS,EAAC,uBAAuB,YAEhC,GAAG,CAAC,KAAK,IAJL,GAAG,CAAC,KAAK,CAKC,CAClB,CAAC,GACc,GACP,IACL,GACN,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
table.memori--table {
|
|
2
|
+
--memori-table-spacing: 1rem;
|
|
3
|
+
--memori-table-border-color: hsl(205, 20%, 94%);
|
|
4
|
+
--memori-table-bg-color: rgb(246, 248, 249);
|
|
5
|
+
|
|
6
|
+
margin: 1rem 0;
|
|
7
|
+
font-size: 1rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media (max-width: 767px) {
|
|
11
|
+
table.memori--table {
|
|
12
|
+
--memori-table-spacing: 0.5rem;
|
|
13
|
+
|
|
14
|
+
font-size: 0.875rem;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:where(table) {
|
|
19
|
+
width: 100%;
|
|
20
|
+
border-collapse: collapse;
|
|
21
|
+
border-spacing: 0;
|
|
22
|
+
text-indent: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
table.memori--table th,
|
|
26
|
+
table.memori--table td {
|
|
27
|
+
padding: calc(var(--memori-table-spacing) / 2) var(--memori-table-spacing);
|
|
28
|
+
border-bottom: 1px solid var(--memori-table-border-color);
|
|
29
|
+
text-align: left;
|
|
30
|
+
text-align: start;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
table.memori--table thead th {
|
|
34
|
+
padding: var(--memori-table-spacing) var(--memori-table-spacing);
|
|
35
|
+
background-color: var(--memori-table-bg-color);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
table.memori--table tfoot th,
|
|
39
|
+
table.memori--table tfoot td {
|
|
40
|
+
border-top: 1px solid var(--memori-table-border-color);
|
|
41
|
+
border-bottom: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
table.memori--table[role="grid"] tbody tr:nth-child(odd) {
|
|
45
|
+
background-color: var(--memori-table-bg-color);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.memori--table--pagination {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: flex-end;
|
|
52
|
+
margin-bottom: 1rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.memori--table--pagination--pages {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
margin-right: 1rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.memori--table--pagination--pages--current {
|
|
62
|
+
padding: 0 0.5rem;
|
|
63
|
+
font-variant-numeric: tabular-nums;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.memori--table--pagination--pages button.memori-button.memori-button--circle {
|
|
67
|
+
padding: 0.25rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.memori--table--pagination--pages button.memori-button[disabled] {
|
|
71
|
+
opacity: 0.3;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.memori--table--pagination ul.memori-select--options {
|
|
75
|
+
right: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media (max-width: 600px) {
|
|
79
|
+
.memori--table--pagination--pages {
|
|
80
|
+
margin-right: auto;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.memori--table--pagination--pages--current {
|
|
84
|
+
padding: 0 0.25rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.memori--table--pagination .memori-select button.memori-select--button {
|
|
88
|
+
padding-top: 0.25rem;
|
|
89
|
+
padding-right: 2rem;
|
|
90
|
+
padding-bottom: 0.25rem;
|
|
91
|
+
padding-left: 0.5rem;
|
|
92
|
+
font-size: 0.875rem;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.memori--table--pagination .memori-select ul.memori-select--options {
|
|
96
|
+
min-width: fit-content;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
table.memori--table th.memori--table--column-centered,
|
|
101
|
+
table.memori--table td.memori--table--column-centered {
|
|
102
|
+
text-align: center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
table.memori--table th.memori--table--column-right,
|
|
106
|
+
table.memori--table td.memori--table--column-right {
|
|
107
|
+
text-align: right;
|
|
108
|
+
text-align: end;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.memori--table--date {
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
}
|
package/esm/locales/en.json
CHANGED
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"day": "Day",
|
|
22
22
|
"month": "Month",
|
|
23
23
|
"year": "Year",
|
|
24
|
+
"createdAt": "Creation date",
|
|
25
|
+
"selected": "Selected",
|
|
26
|
+
"page": "page",
|
|
27
|
+
"actions": "Actions",
|
|
28
|
+
"next": "Next",
|
|
29
|
+
"previous": "Previous",
|
|
24
30
|
"copy": "Copy",
|
|
25
31
|
"copyToClipboard": "Copy to clipboard",
|
|
26
32
|
"showOriginalText": "Show original",
|
|
@@ -47,6 +53,20 @@
|
|
|
47
53
|
"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
54
|
"deepThoughtDisclaimerTitle": "Deep Thought enabled",
|
|
49
55
|
"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.",
|
|
56
|
+
"knownFacts": {
|
|
57
|
+
"title": "Known facts",
|
|
58
|
+
"description": "Details of the information shared between you and {{memoriName}}",
|
|
59
|
+
"type": "Type",
|
|
60
|
+
"typeShortTerm": "Short term",
|
|
61
|
+
"typeLongTerm": "Long term",
|
|
62
|
+
"typeHelper": "Types:\n- Short Term: this Known Fact is always used during conversations\n- Long Term: this Known Fact is used during conversations only if relevant to the current question",
|
|
63
|
+
"text": "Text",
|
|
64
|
+
"deleteSuccess": "Known fact deleted",
|
|
65
|
+
"deleteConfirmTitle": "Delete known fact",
|
|
66
|
+
"deleteConfirmMessage": "Are you sure you want to delete this known fact?",
|
|
67
|
+
"deleteSelectedConfirmTitle": "Delete selected known facts",
|
|
68
|
+
"deleteSelectedConfirmMessage": "Are you sure you want to delete the selected known facts?"
|
|
69
|
+
},
|
|
50
70
|
"auth": {
|
|
51
71
|
"title": "Authentication",
|
|
52
72
|
"useRecoveryTokens": "Use recovery tokens",
|
package/esm/locales/it.json
CHANGED
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"day": "Giorno",
|
|
22
22
|
"month": "Mese",
|
|
23
23
|
"year": "Anno",
|
|
24
|
+
"createdAt": "Data creazione",
|
|
25
|
+
"selected": "Selezionati",
|
|
26
|
+
"page": "pagina",
|
|
27
|
+
"actions": "Azioni",
|
|
28
|
+
"next": "Successivo",
|
|
29
|
+
"previous": "Precedente",
|
|
24
30
|
"copy": "Copia",
|
|
25
31
|
"copyToClipboard": "Copia negli appunti",
|
|
26
32
|
"showOriginalText": "Mostra originale",
|
|
@@ -47,6 +53,20 @@
|
|
|
47
53
|
"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
54
|
"deepThoughtDisclaimerTitle": "Pensiero profondo abilitato",
|
|
49
55
|
"deepThoughtDisclaimer": "Proseguendo nella conversazione autorizzo il trattamento dei miei dati personali così come specificato nell'informativa di cui dichiaro di aver preso visione.",
|
|
56
|
+
"knownFacts": {
|
|
57
|
+
"title": "Fatti noti",
|
|
58
|
+
"description": "Dettagli delle informazioni condivise tra te e {{memoriName}}",
|
|
59
|
+
"type": "Tipo",
|
|
60
|
+
"typeShortTerm": "Breve termine",
|
|
61
|
+
"typeLongTerm": "Lungo termine",
|
|
62
|
+
"typeHelper": "Tipi:\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente",
|
|
63
|
+
"text": "Testo",
|
|
64
|
+
"deleteSuccess": "Fatto noto eliminato",
|
|
65
|
+
"deleteConfirmTitle": "Elimina il fatto noto",
|
|
66
|
+
"deleteConfirmMessage": "Confermi di voler eliminare questo fatto noto?",
|
|
67
|
+
"deleteSelectedConfirmTitle": "Elimina i fatti noti selezionati",
|
|
68
|
+
"deleteSelectedConfirmMessage": "Confermi di voler eliminare i fatti noti selezionati?"
|
|
69
|
+
},
|
|
50
70
|
"auth": {
|
|
51
71
|
"title": "Autenticazione",
|
|
52
72
|
"useRecoveryTokens": "Utilizza i token di recupero",
|
package/esm/styles.css
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@import url('./components/ui/Spin.css');
|
|
7
7
|
@import url('./components/ui/Tooltip.css');
|
|
8
8
|
@import url('./components/ui/Select.css');
|
|
9
|
+
@import url('./components/ui/Table.css');
|
|
9
10
|
|
|
10
11
|
@import url('./components/CompletionProviderStatus/CompletionProviderStatus.css');
|
|
11
12
|
@import url('./components/PoweredBy/PoweredBy.css');
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
@import url('./components/UploadMenu/UploadMenu.css');
|
|
37
38
|
@import url('./components/DateSelector/DateSelector.css');
|
|
38
39
|
@import url('./components/AgeVerificationModal/AgeVerificationModal.css');
|
|
40
|
+
@import url('./components/KnownFacts/KnownFacts.css');
|
|
39
41
|
@import url('./components/MemoriWidget/MemoriWidget.css');
|
|
40
42
|
|
|
41
43
|
@import url('https://fonts.bunny.net/css?family=exo-2:200,400,700');
|
|
@@ -87,4 +89,10 @@ body.sb-show-main #root,
|
|
|
87
89
|
--memori-modal--width--md: 80%;
|
|
88
90
|
--memori-error-color: #ff4d4f;
|
|
89
91
|
--memori-warning-color: #faad14;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media (max-width: 768px) {
|
|
95
|
+
.mobile-hidden {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
90
98
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.2.0",
|
|
3
3
|
"name": "@memori.ai/memori-react",
|
|
4
4
|
"author": "Memori Srl",
|
|
5
5
|
"main": "dist/index.js",
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
"dependencies": {
|
|
292
292
|
"@fontsource/exo-2": "^4.5.10",
|
|
293
293
|
"@headlessui/react": "1.7.4",
|
|
294
|
-
"@memori.ai/memori-api-client": "^2.
|
|
294
|
+
"@memori.ai/memori-api-client": "^2.7.0",
|
|
295
295
|
"@react-three/drei": "8.20.2",
|
|
296
296
|
"@react-three/fiber": "7.0.25",
|
|
297
297
|
"classnames": "2.3.2",
|
|
@@ -17,11 +17,15 @@ const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
|
|
|
17
17
|
|
|
18
18
|
const [birthDate, setBirthDate] = useState<DateTime>();
|
|
19
19
|
const [error, setError] = useState<string>();
|
|
20
|
+
const [submitting, setSubmitting] = useState<boolean>(false);
|
|
20
21
|
|
|
21
22
|
const onSubmit = useCallback(() => {
|
|
23
|
+
setSubmitting(true);
|
|
24
|
+
|
|
22
25
|
if (!birthDate) {
|
|
23
26
|
toast.error(t('requiredField'));
|
|
24
27
|
setError(t('requiredField') || 'Required field');
|
|
28
|
+
setSubmitting(false);
|
|
25
29
|
return;
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -32,6 +36,7 @@ const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
|
|
|
32
36
|
t('underageTwinSession', { age: minAge }) ||
|
|
33
37
|
`You must be at least ${minAge} years old to interact with this Twin`
|
|
34
38
|
);
|
|
39
|
+
setSubmitting(false);
|
|
35
40
|
return;
|
|
36
41
|
}
|
|
37
42
|
|
|
@@ -76,6 +81,7 @@ const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
|
|
|
76
81
|
primary
|
|
77
82
|
htmlType="submit"
|
|
78
83
|
className="age-verification-submit"
|
|
84
|
+
loading={submitting}
|
|
79
85
|
disabled={!birthDate}
|
|
80
86
|
>
|
|
81
87
|
{t('confirm')}
|
|
@@ -27,6 +27,7 @@ export default meta;
|
|
|
27
27
|
const Template: Story<Props> = args => {
|
|
28
28
|
const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);
|
|
29
29
|
const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);
|
|
30
|
+
const [showKnownFactsDrawer, setShowKnownFactsDrawer] = React.useState(false);
|
|
30
31
|
const [continuousSpeech, setContinuousSpeech] = React.useState(true);
|
|
31
32
|
const [continuousSpeechTimeout, setContinuousSpeechTimeout] =
|
|
32
33
|
React.useState(2);
|
|
@@ -39,6 +40,7 @@ const Template: Story<Props> = args => {
|
|
|
39
40
|
setSpeakerMuted={setSpeakerMuted}
|
|
40
41
|
showSettings
|
|
41
42
|
setShowSettingsDrawer={() => setShowSettingsDrawer(true)}
|
|
43
|
+
setShowKnownFactsDrawer={() => setShowKnownFactsDrawer(true)}
|
|
42
44
|
/>
|
|
43
45
|
<SettingsDrawer
|
|
44
46
|
open={!!showSettingsDrawer}
|
|
@@ -157,3 +159,38 @@ WithOngoingChat.args = {
|
|
|
157
159
|
showShare: false,
|
|
158
160
|
showSettings: false,
|
|
159
161
|
};
|
|
162
|
+
|
|
163
|
+
export const WithDeepThoughtEnabled = Template.bind({});
|
|
164
|
+
WithDeepThoughtEnabled.args = {
|
|
165
|
+
memori: {
|
|
166
|
+
...memori,
|
|
167
|
+
enableDeepThought: true,
|
|
168
|
+
},
|
|
169
|
+
history,
|
|
170
|
+
setShowPositionDrawer: () => {},
|
|
171
|
+
setShowSettingsDrawer: () => {},
|
|
172
|
+
clearHistory: () => {},
|
|
173
|
+
speakerMuted: false,
|
|
174
|
+
hasUserActivatedSpeak: false,
|
|
175
|
+
showShare: false,
|
|
176
|
+
showSettings: false,
|
|
177
|
+
loginToken: 'abcd',
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export const WithDeepThoughtEnabledAndOngoingChat = Template.bind({});
|
|
181
|
+
WithDeepThoughtEnabledAndOngoingChat.args = {
|
|
182
|
+
memori: {
|
|
183
|
+
...memori,
|
|
184
|
+
enableDeepThought: true,
|
|
185
|
+
},
|
|
186
|
+
history,
|
|
187
|
+
setShowPositionDrawer: () => {},
|
|
188
|
+
setShowSettingsDrawer: () => {},
|
|
189
|
+
clearHistory: () => {},
|
|
190
|
+
speakerMuted: false,
|
|
191
|
+
hasUserActivatedSpeak: true,
|
|
192
|
+
showShare: false,
|
|
193
|
+
showSettings: false,
|
|
194
|
+
sessionID: '1234',
|
|
195
|
+
loginToken: 'abcd',
|
|
196
|
+
};
|
|
@@ -10,6 +10,7 @@ it('renders Header unchanged', () => {
|
|
|
10
10
|
history={history}
|
|
11
11
|
setShowPositionDrawer={jest.fn()}
|
|
12
12
|
setShowSettingsDrawer={jest.fn()}
|
|
13
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
13
14
|
speakerMuted={false}
|
|
14
15
|
setSpeakerMuted={jest.fn()}
|
|
15
16
|
hasUserActivatedSpeak={false}
|
|
@@ -36,6 +37,7 @@ it('renders Header with position unchanged', () => {
|
|
|
36
37
|
history={history}
|
|
37
38
|
setShowPositionDrawer={jest.fn()}
|
|
38
39
|
setShowSettingsDrawer={jest.fn()}
|
|
40
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
39
41
|
speakerMuted={false}
|
|
40
42
|
setSpeakerMuted={jest.fn()}
|
|
41
43
|
hasUserActivatedSpeak={false}
|
|
@@ -54,6 +56,7 @@ it('renders Header with speaker muted unchanged', () => {
|
|
|
54
56
|
history={history}
|
|
55
57
|
setShowPositionDrawer={jest.fn()}
|
|
56
58
|
setShowSettingsDrawer={jest.fn()}
|
|
59
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
57
60
|
speakerMuted={true}
|
|
58
61
|
setSpeakerMuted={jest.fn()}
|
|
59
62
|
hasUserActivatedSpeak={false}
|
|
@@ -72,6 +75,7 @@ it('renders Header with share button unchanged', () => {
|
|
|
72
75
|
history={history}
|
|
73
76
|
setShowPositionDrawer={jest.fn()}
|
|
74
77
|
setShowSettingsDrawer={jest.fn()}
|
|
78
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
75
79
|
speakerMuted={false}
|
|
76
80
|
setSpeakerMuted={jest.fn()}
|
|
77
81
|
hasUserActivatedSpeak={false}
|
|
@@ -90,6 +94,7 @@ it('renders Header with settings button unchanged', () => {
|
|
|
90
94
|
history={history}
|
|
91
95
|
setShowPositionDrawer={jest.fn()}
|
|
92
96
|
setShowSettingsDrawer={jest.fn()}
|
|
97
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
93
98
|
speakerMuted={false}
|
|
94
99
|
setSpeakerMuted={jest.fn()}
|
|
95
100
|
hasUserActivatedSpeak={false}
|
|
@@ -108,6 +113,7 @@ it('renders Header with clear button unchanged', () => {
|
|
|
108
113
|
history={history}
|
|
109
114
|
setShowPositionDrawer={jest.fn()}
|
|
110
115
|
setShowSettingsDrawer={jest.fn()}
|
|
116
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
111
117
|
speakerMuted={false}
|
|
112
118
|
setSpeakerMuted={jest.fn()}
|
|
113
119
|
hasUserActivatedSpeak={false}
|
|
@@ -127,6 +133,7 @@ it('renders Header with user activated speak unchanged', () => {
|
|
|
127
133
|
history={history}
|
|
128
134
|
setShowPositionDrawer={jest.fn()}
|
|
129
135
|
setShowSettingsDrawer={jest.fn()}
|
|
136
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
130
137
|
speakerMuted={false}
|
|
131
138
|
setSpeakerMuted={jest.fn()}
|
|
132
139
|
hasUserActivatedSpeak={true}
|
|
@@ -137,3 +144,50 @@ it('renders Header with user activated speak unchanged', () => {
|
|
|
137
144
|
);
|
|
138
145
|
expect(container).toMatchSnapshot();
|
|
139
146
|
});
|
|
147
|
+
|
|
148
|
+
it('renders Header with deep thought unchanged', () => {
|
|
149
|
+
const { container } = render(
|
|
150
|
+
<Header
|
|
151
|
+
memori={{
|
|
152
|
+
...memori,
|
|
153
|
+
enableDeepThought: true,
|
|
154
|
+
}}
|
|
155
|
+
history={history}
|
|
156
|
+
setShowPositionDrawer={jest.fn()}
|
|
157
|
+
setShowSettingsDrawer={jest.fn()}
|
|
158
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
159
|
+
speakerMuted={false}
|
|
160
|
+
setSpeakerMuted={jest.fn()}
|
|
161
|
+
hasUserActivatedSpeak={false}
|
|
162
|
+
showShare={false}
|
|
163
|
+
showSettings={false}
|
|
164
|
+
clearHistory={jest.fn()}
|
|
165
|
+
loginToken="abcd"
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
expect(container).toMatchSnapshot();
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('renders Header with deep thought and session open unchanged', () => {
|
|
172
|
+
const { container } = render(
|
|
173
|
+
<Header
|
|
174
|
+
memori={{
|
|
175
|
+
...memori,
|
|
176
|
+
enableDeepThought: true,
|
|
177
|
+
}}
|
|
178
|
+
history={history}
|
|
179
|
+
setShowPositionDrawer={jest.fn()}
|
|
180
|
+
setShowSettingsDrawer={jest.fn()}
|
|
181
|
+
setShowKnownFactsDrawer={jest.fn()}
|
|
182
|
+
speakerMuted={false}
|
|
183
|
+
setSpeakerMuted={jest.fn()}
|
|
184
|
+
hasUserActivatedSpeak={true}
|
|
185
|
+
showShare={false}
|
|
186
|
+
showSettings={false}
|
|
187
|
+
clearHistory={jest.fn()}
|
|
188
|
+
sessionID="1234"
|
|
189
|
+
loginToken="abcd"
|
|
190
|
+
/>
|
|
191
|
+
);
|
|
192
|
+
expect(container).toMatchSnapshot();
|
|
193
|
+
});
|
|
@@ -18,6 +18,7 @@ import FullscreenExit from '../icons/FullscreenExit';
|
|
|
18
18
|
import Fullscreen from '../icons/Fullscreen';
|
|
19
19
|
import Refresh from '../icons/Refresh';
|
|
20
20
|
import Clear from '../icons/Clear';
|
|
21
|
+
import DeepThought from '../icons/DeepThought';
|
|
21
22
|
|
|
22
23
|
export interface Props {
|
|
23
24
|
className?: string;
|
|
@@ -27,6 +28,7 @@ export interface Props {
|
|
|
27
28
|
position?: Venue;
|
|
28
29
|
setShowPositionDrawer: (show: boolean) => void;
|
|
29
30
|
setShowSettingsDrawer: (show: boolean) => void;
|
|
31
|
+
setShowKnownFactsDrawer: (show: boolean) => void;
|
|
30
32
|
speakerMuted: boolean;
|
|
31
33
|
setSpeakerMuted: (mute: boolean) => void;
|
|
32
34
|
hasUserActivatedSpeak?: boolean;
|
|
@@ -36,6 +38,8 @@ export interface Props {
|
|
|
36
38
|
showReload?: boolean;
|
|
37
39
|
showClear?: boolean;
|
|
38
40
|
clearHistory: () => void;
|
|
41
|
+
loginToken?: string;
|
|
42
|
+
sessionID?: string;
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
const Header: React.FC<Props> = ({
|
|
@@ -46,6 +50,7 @@ const Header: React.FC<Props> = ({
|
|
|
46
50
|
position,
|
|
47
51
|
setShowPositionDrawer,
|
|
48
52
|
setShowSettingsDrawer,
|
|
53
|
+
setShowKnownFactsDrawer,
|
|
49
54
|
speakerMuted,
|
|
50
55
|
setSpeakerMuted,
|
|
51
56
|
hasUserActivatedSpeak = false,
|
|
@@ -55,6 +60,8 @@ const Header: React.FC<Props> = ({
|
|
|
55
60
|
showReload = false,
|
|
56
61
|
showClear = false,
|
|
57
62
|
clearHistory,
|
|
63
|
+
loginToken,
|
|
64
|
+
sessionID,
|
|
58
65
|
}) => {
|
|
59
66
|
const { t } = useTranslation();
|
|
60
67
|
const [fullScreenAvailable, setFullScreenAvailable] = useState(false);
|
|
@@ -124,6 +131,17 @@ const Header: React.FC<Props> = ({
|
|
|
124
131
|
}}
|
|
125
132
|
/>
|
|
126
133
|
)}
|
|
134
|
+
{memori.enableDeepThought && !!loginToken && (
|
|
135
|
+
<Button
|
|
136
|
+
primary={!!sessionID && !!hasUserActivatedSpeak}
|
|
137
|
+
shape="circle"
|
|
138
|
+
icon={<DeepThought />}
|
|
139
|
+
className="memori-header--button memori-header--button--knownfacts"
|
|
140
|
+
disabled={!hasUserActivatedSpeak || !sessionID}
|
|
141
|
+
onClick={() => setShowKnownFactsDrawer(true)}
|
|
142
|
+
title={t('knownFacts.title') || 'Known facts'}
|
|
143
|
+
/>
|
|
144
|
+
)}
|
|
127
145
|
{showSpeaker && (
|
|
128
146
|
<Button
|
|
129
147
|
primary
|