@memori.ai/memori-react 6.4.4 → 6.4.6
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 +24 -0
- package/dist/components/Chat/Chat.d.ts +1 -0
- package/dist/components/Chat/Chat.js +2 -2
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +20 -0
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/WhyThisAnswer/WhyThisAnswer.js +1 -0
- package/dist/components/WhyThisAnswer/WhyThisAnswer.js.map +1 -1
- package/dist/helpers/constants.js +1 -0
- package/dist/helpers/constants.js.map +1 -1
- package/esm/components/Chat/Chat.d.ts +1 -0
- package/esm/components/Chat/Chat.js +2 -2
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +20 -0
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/WhyThisAnswer/WhyThisAnswer.js +1 -0
- package/esm/components/WhyThisAnswer/WhyThisAnswer.js.map +1 -1
- package/esm/helpers/constants.js +1 -0
- package/esm/helpers/constants.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Chat/Chat.tsx +3 -0
- package/src/components/MemoriWidget/MemoriWidget.tsx +25 -10
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +6 -0
- package/src/components/WhyThisAnswer/WhyThisAnswer.tsx +1 -1
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +6 -0
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +6 -0
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +6 -0
- package/src/helpers/constants.ts +1 -0
package/esm/helpers/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3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AE,CAAC;SACd;QACD;YACE,IAAI,EAAE,2BAA2B;YACjC,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,2CAA2C;YACjD,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,mCAAmC;YACzC,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,mCAAmC;YACzC,UAAU,EAAE,CAAC;SACd;KACF;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "6.4.
|
|
2
|
+
"version": "6.4.6",
|
|
3
3
|
"name": "@memori.ai/memori-react",
|
|
4
4
|
"author": "Memori Srl",
|
|
5
5
|
"main": "dist/index.js",
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
},
|
|
292
292
|
"dependencies": {
|
|
293
293
|
"@headlessui/react": "1.7.4",
|
|
294
|
-
"@memori.ai/memori-api-client": "^4.1
|
|
294
|
+
"@memori.ai/memori-api-client": "^4.2.1",
|
|
295
295
|
"@react-three/drei": "8.20.2",
|
|
296
296
|
"@react-three/fiber": "7.0.25",
|
|
297
297
|
"classnames": "2.3.2",
|
|
@@ -40,6 +40,7 @@ export interface Props {
|
|
|
40
40
|
showDates?: boolean;
|
|
41
41
|
showContextPerLine?: boolean;
|
|
42
42
|
showAIicon?: boolean;
|
|
43
|
+
showWhyThisAnswer?: boolean;
|
|
43
44
|
client: ReturnType<typeof memoriApiClient>;
|
|
44
45
|
selectReceiverTag: (tag: string) => Promise<void>;
|
|
45
46
|
preview?: boolean;
|
|
@@ -84,6 +85,7 @@ const Chat: React.FC<Props> = ({
|
|
|
84
85
|
showDates = false,
|
|
85
86
|
showContextPerLine = false,
|
|
86
87
|
showAIicon = true,
|
|
88
|
+
showWhyThisAnswer = true,
|
|
87
89
|
selectReceiverTag,
|
|
88
90
|
preview = false,
|
|
89
91
|
instruct = false,
|
|
@@ -205,6 +207,7 @@ const Chat: React.FC<Props> = ({
|
|
|
205
207
|
sessionID={sessionID}
|
|
206
208
|
simulateUserPrompt={simulateUserPrompt}
|
|
207
209
|
showAIicon={showAIicon}
|
|
210
|
+
showWhyThisAnswer={showWhyThisAnswer}
|
|
208
211
|
showFeedback={
|
|
209
212
|
index === history.length - 1 &&
|
|
210
213
|
!message.fromUser &&
|
|
@@ -697,7 +697,7 @@ const MemoriWidget = ({
|
|
|
697
697
|
placeLongitude: currentState.currentLongitude,
|
|
698
698
|
placeUncertaintyKm: currentState.currentUncertaintyKm,
|
|
699
699
|
tag: currentState.currentTag,
|
|
700
|
-
|
|
700
|
+
memoryTags: currentState.memoryTags,
|
|
701
701
|
});
|
|
702
702
|
speak(emission);
|
|
703
703
|
}
|
|
@@ -735,7 +735,7 @@ const MemoriWidget = ({
|
|
|
735
735
|
placeLongitude: currentState.currentLongitude,
|
|
736
736
|
placeUncertaintyKm: currentState.currentUncertaintyKm,
|
|
737
737
|
tag: currentState.currentTag,
|
|
738
|
-
|
|
738
|
+
memoryTags: currentState.memoryTags,
|
|
739
739
|
});
|
|
740
740
|
speak(emission);
|
|
741
741
|
}
|
|
@@ -781,7 +781,7 @@ const MemoriWidget = ({
|
|
|
781
781
|
placeLongitude: currentState.currentLongitude,
|
|
782
782
|
placeUncertaintyKm: currentState.currentUncertaintyKm,
|
|
783
783
|
tag: currentState.currentTag,
|
|
784
|
-
|
|
784
|
+
memoryTags: currentState.memoryTags,
|
|
785
785
|
});
|
|
786
786
|
speak(emission);
|
|
787
787
|
}
|
|
@@ -853,7 +853,7 @@ const MemoriWidget = ({
|
|
|
853
853
|
placeLongitude: state.currentLongitude,
|
|
854
854
|
placeUncertaintyKm: state.currentUncertaintyKm,
|
|
855
855
|
tag: state.currentTag,
|
|
856
|
-
|
|
856
|
+
memoryTags: state.memoryTags,
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
} else {
|
|
@@ -903,7 +903,7 @@ const MemoriWidget = ({
|
|
|
903
903
|
placeLongitude: state.currentLongitude,
|
|
904
904
|
placeUncertaintyKm: state.currentUncertaintyKm,
|
|
905
905
|
tag: state.currentTag,
|
|
906
|
-
|
|
906
|
+
memoryTags: state.memoryTags,
|
|
907
907
|
};
|
|
908
908
|
}
|
|
909
909
|
|
|
@@ -1143,7 +1143,7 @@ const MemoriWidget = ({
|
|
|
1143
1143
|
placeLongitude: currentState.currentLongitude,
|
|
1144
1144
|
placeUncertaintyKm: currentState.currentUncertaintyKm,
|
|
1145
1145
|
tag: currentState.currentTag,
|
|
1146
|
-
|
|
1146
|
+
memoryTags: currentState.memoryTags,
|
|
1147
1147
|
},
|
|
1148
1148
|
])
|
|
1149
1149
|
: pushMessage({
|
|
@@ -1159,7 +1159,7 @@ const MemoriWidget = ({
|
|
|
1159
1159
|
placeLongitude: currentState.currentLongitude,
|
|
1160
1160
|
placeUncertaintyKm: currentState.currentUncertaintyKm,
|
|
1161
1161
|
tag: currentState.currentTag,
|
|
1162
|
-
|
|
1162
|
+
memoryTags: currentState.memoryTags,
|
|
1163
1163
|
});
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
@@ -1439,7 +1439,7 @@ const MemoriWidget = ({
|
|
|
1439
1439
|
placeLongitude: currentState.currentLongitude,
|
|
1440
1440
|
placeUncertaintyKm: currentState.currentUncertaintyKm,
|
|
1441
1441
|
tag: currentState.currentTag,
|
|
1442
|
-
|
|
1442
|
+
memoryTags: currentState.memoryTags,
|
|
1443
1443
|
});
|
|
1444
1444
|
speak(emission);
|
|
1445
1445
|
setCurrentDialogState({
|
|
@@ -1558,6 +1558,7 @@ const MemoriWidget = ({
|
|
|
1558
1558
|
// }
|
|
1559
1559
|
}
|
|
1560
1560
|
|
|
1561
|
+
// https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts
|
|
1561
1562
|
switch (voiceLang) {
|
|
1562
1563
|
case 'IT':
|
|
1563
1564
|
voice = `${
|
|
@@ -1609,6 +1610,11 @@ const MemoriWidget = ({
|
|
|
1609
1610
|
voiceType === 'MALE' ? 'fi-FI-HarriNeural' : 'fi-FI-SelmaNeural'
|
|
1610
1611
|
}`;
|
|
1611
1612
|
break;
|
|
1613
|
+
case 'EL':
|
|
1614
|
+
voice = `${
|
|
1615
|
+
voiceType === 'MALE' ? 'el-GR-NestorasNeural' : 'el-GR-AthinaNeural'
|
|
1616
|
+
}`;
|
|
1617
|
+
break;
|
|
1612
1618
|
default:
|
|
1613
1619
|
voice = `${
|
|
1614
1620
|
voiceType === 'MALE' ? 'it-IT-DiegoNeural' : 'it-IT-IsabellaNeural'
|
|
@@ -1665,6 +1671,9 @@ const MemoriWidget = ({
|
|
|
1665
1671
|
case 'FI':
|
|
1666
1672
|
voice = 'fi-FI';
|
|
1667
1673
|
break;
|
|
1674
|
+
case 'EL':
|
|
1675
|
+
voice = 'el-GR';
|
|
1676
|
+
break;
|
|
1668
1677
|
default:
|
|
1669
1678
|
voice = 'it-IT';
|
|
1670
1679
|
break;
|
|
@@ -2229,6 +2238,11 @@ const MemoriWidget = ({
|
|
|
2229
2238
|
? true
|
|
2230
2239
|
: integrationConfig?.showAIicon;
|
|
2231
2240
|
|
|
2241
|
+
const showWhyThisAnswer =
|
|
2242
|
+
integrationConfig?.showWhyThisAnswer === undefined
|
|
2243
|
+
? true
|
|
2244
|
+
: integrationConfig?.showWhyThisAnswer;
|
|
2245
|
+
|
|
2232
2246
|
// eslint-disable-next-line
|
|
2233
2247
|
const [avatar3dVisible, setAvatar3dVisible] = useState(false);
|
|
2234
2248
|
useEffect(() => {
|
|
@@ -2349,7 +2363,7 @@ const MemoriWidget = ({
|
|
|
2349
2363
|
placeLongitude: currentState.currentLongitude,
|
|
2350
2364
|
placeUncertaintyKm: currentState.currentUncertaintyKm,
|
|
2351
2365
|
tag: currentState.currentTag,
|
|
2352
|
-
|
|
2366
|
+
memoryTags: currentState.memoryTags,
|
|
2353
2367
|
});
|
|
2354
2368
|
}
|
|
2355
2369
|
} else {
|
|
@@ -2371,7 +2385,7 @@ const MemoriWidget = ({
|
|
|
2371
2385
|
placeLongitude: currentState.currentLongitude,
|
|
2372
2386
|
placeUncertaintyKm: currentState.currentUncertaintyKm,
|
|
2373
2387
|
tag: currentState.currentTag,
|
|
2374
|
-
|
|
2388
|
+
memoryTags: currentState.memoryTags,
|
|
2375
2389
|
});
|
|
2376
2390
|
}
|
|
2377
2391
|
}
|
|
@@ -2924,6 +2938,7 @@ const MemoriWidget = ({
|
|
|
2924
2938
|
showDates,
|
|
2925
2939
|
showContextPerLine,
|
|
2926
2940
|
showAIicon,
|
|
2941
|
+
showWhyThisAnswer,
|
|
2927
2942
|
client,
|
|
2928
2943
|
selectReceiverTag,
|
|
2929
2944
|
preview,
|
package/src/helpers/constants.ts
CHANGED