@memori.ai/memori-react 7.19.2 → 7.21.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.
- package/CHANGELOG.md +52 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.d.ts +3 -2
- package/dist/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.js +13 -6
- package/dist/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/avatarComponent.d.ts +14 -18
- package/dist/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js +19 -77
- package/dist/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.d.ts +17 -2
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js +95 -70
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.d.ts +65 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.js +747 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.js.map +1 -0
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.d.ts +9 -2
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js +60 -2
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.d.ts +3 -4
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.js +5 -11
- package/dist/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.js.map +1 -1
- package/dist/components/Avatar/AvatarView/AvatarComponent/constants.d.ts +13 -52
- package/dist/components/Avatar/AvatarView/AvatarComponent/constants.js +68 -70
- package/dist/components/Avatar/AvatarView/AvatarComponent/constants.js.map +1 -1
- package/dist/components/Avatar/AvatarView/index.d.ts +1 -1
- package/dist/components/Avatar/AvatarView/index.js +2 -2
- package/dist/components/Avatar/AvatarView/index.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.css +9 -0
- package/dist/components/ChatBubble/ChatBubble.js +7 -1
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +130 -62
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/UploadButton/UploadButton.js +2 -2
- package/dist/components/UploadButton/UploadButton.js.map +1 -1
- package/dist/components/WhyThisAnswer/WhyThisAnswer.css +43 -0
- package/dist/components/WhyThisAnswer/WhyThisAnswer.js +2 -1
- package/dist/components/WhyThisAnswer/WhyThisAnswer.js.map +1 -1
- package/dist/context/visemeContext.js +0 -39
- package/dist/context/visemeContext.js.map +1 -1
- package/dist/locales/de.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +1 -0
- package/dist/locales/it.json +1 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.d.ts +3 -2
- package/esm/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.js +13 -6
- package/esm/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/avatarComponent.d.ts +14 -18
- package/esm/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js +20 -78
- package/esm/components/Avatar/AvatarView/AvatarComponent/avatarComponent.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.d.ts +17 -2
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js +99 -74
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.d.ts +65 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.js +743 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.js.map +1 -0
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.d.ts +9 -2
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js +61 -3
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.d.ts +3 -4
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.js +5 -11
- package/esm/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.js.map +1 -1
- package/esm/components/Avatar/AvatarView/AvatarComponent/constants.d.ts +13 -52
- package/esm/components/Avatar/AvatarView/AvatarComponent/constants.js +67 -69
- package/esm/components/Avatar/AvatarView/AvatarComponent/constants.js.map +1 -1
- package/esm/components/Avatar/AvatarView/index.d.ts +1 -1
- package/esm/components/Avatar/AvatarView/index.js +2 -2
- package/esm/components/Avatar/AvatarView/index.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.css +9 -0
- package/esm/components/ChatBubble/ChatBubble.js +7 -1
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +130 -62
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/UploadButton/UploadButton.js +2 -2
- package/esm/components/UploadButton/UploadButton.js.map +1 -1
- package/esm/components/WhyThisAnswer/WhyThisAnswer.css +43 -0
- package/esm/components/WhyThisAnswer/WhyThisAnswer.js +2 -1
- package/esm/components/WhyThisAnswer/WhyThisAnswer.js.map +1 -1
- package/esm/context/visemeContext.js +0 -39
- package/esm/context/visemeContext.js.map +1 -1
- package/esm/locales/de.json +1 -0
- package/esm/locales/en.json +1 -0
- package/esm/locales/es.json +1 -0
- package/esm/locales/fr.json +1 -0
- package/esm/locales/it.json +1 -0
- package/package.json +2 -2
- package/src/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.tsx +15 -8
- package/src/components/Avatar/AvatarView/AvatarComponent/avatarComponent.tsx +64 -219
- package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.tsx +221 -124
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.ts +1250 -0
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.ts +164 -8
- package/src/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.tsx +19 -17
- package/src/components/Avatar/AvatarView/AvatarComponent/constants.ts +80 -79
- package/src/components/Avatar/AvatarView/index.tsx +1 -7
- package/src/components/ChatBubble/ChatBubble.css +9 -0
- package/src/components/ChatBubble/ChatBubble.tsx +14 -2
- package/src/components/MemoriWidget/MemoriWidget.tsx +168 -76
- package/src/components/UploadButton/UploadButton.tsx +4 -4
- package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +1 -1
- package/src/components/WhyThisAnswer/WhyThisAnswer.css +43 -0
- package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +44 -3
- package/src/components/WhyThisAnswer/WhyThisAnswer.test.tsx +128 -8
- package/src/components/WhyThisAnswer/WhyThisAnswer.tsx +28 -3
- package/src/components/WhyThisAnswer/__snapshots__/WhyThisAnswer.test.tsx.snap +15 -1
- package/src/components/layouts/layouts.stories.tsx +0 -8
- package/src/context/visemeContext.tsx +40 -41
- package/src/index.stories.tsx +63 -65
- package/src/locales/de.json +1 -0
- package/src/locales/en.json +1 -0
- package/src/locales/es.json +1 -0
- package/src/locales/fr.json +1 -0
- package/src/locales/it.json +1 -0
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AnimationController.ts +0 -308
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import WhyThisAnswer from './WhyThisAnswer';
|
|
4
|
-
import { sessionID
|
|
4
|
+
import { sessionID } from '../../mocks/data';
|
|
5
5
|
|
|
6
6
|
beforeEach(() => {
|
|
7
7
|
// @ts-ignore
|
|
@@ -61,12 +61,37 @@ it('renders WhyThisAnswer visible unchanged', () => {
|
|
|
61
61
|
expect(container).toMatchSnapshot();
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
+
it('renders WhyThisAnswer loading unchanged', () => {
|
|
65
|
+
const { container } = render(
|
|
66
|
+
<WhyThisAnswer
|
|
67
|
+
apiURL="https://backend.memori.ai"
|
|
68
|
+
sessionID={sessionID}
|
|
69
|
+
visible={true}
|
|
70
|
+
message={{
|
|
71
|
+
questionAnswered: 'Test message',
|
|
72
|
+
text: 'This is a test content',
|
|
73
|
+
date: '2021-01-01',
|
|
74
|
+
placeName: 'Test Place',
|
|
75
|
+
placeLatitude: 0,
|
|
76
|
+
placeLongitude: 0,
|
|
77
|
+
placeUncertaintyKm: 0,
|
|
78
|
+
contextVars: {
|
|
79
|
+
KEY: 'value',
|
|
80
|
+
},
|
|
81
|
+
}}
|
|
82
|
+
closeDrawer={jest.fn()}
|
|
83
|
+
_TEST_loading={true}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
expect(container).toMatchSnapshot();
|
|
87
|
+
});
|
|
88
|
+
|
|
64
89
|
it('renders WhyThisAnswer with data unchanged', () => {
|
|
65
90
|
const { container } = render(
|
|
66
91
|
<WhyThisAnswer
|
|
67
92
|
apiURL="https://backend.memori.ai"
|
|
68
93
|
sessionID={sessionID}
|
|
69
|
-
visible={
|
|
94
|
+
visible={true}
|
|
70
95
|
message={{
|
|
71
96
|
questionAnswered: 'Test message',
|
|
72
97
|
text: 'This is a test content',
|
|
@@ -84,7 +109,8 @@ it('renders WhyThisAnswer with data unchanged', () => {
|
|
|
84
109
|
confidence: 0.8,
|
|
85
110
|
confidenceLevel: 'HIGH',
|
|
86
111
|
memory: {
|
|
87
|
-
|
|
112
|
+
memoryID: '1',
|
|
113
|
+
memoryType: 'Question',
|
|
88
114
|
title: 'This is the title of the content',
|
|
89
115
|
titleVariants: [
|
|
90
116
|
"This is a variant of the content's title",
|
|
@@ -94,26 +120,120 @@ it('renders WhyThisAnswer with data unchanged', () => {
|
|
|
94
120
|
{
|
|
95
121
|
text: 'This is a test answer',
|
|
96
122
|
},
|
|
123
|
+
{
|
|
124
|
+
text: 'This is another answer',
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
confidence: 0.5,
|
|
131
|
+
confidenceLevel: 'LOW',
|
|
132
|
+
memory: {
|
|
133
|
+
memoryID: '2',
|
|
134
|
+
memoryType: 'Question',
|
|
135
|
+
title: 'Content with a long answer',
|
|
136
|
+
titleVariants: undefined,
|
|
137
|
+
answers: [
|
|
138
|
+
{
|
|
139
|
+
text: 'Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.',
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
confidence: 0.5,
|
|
146
|
+
confidenceLevel: 'LOW',
|
|
147
|
+
memory: {
|
|
148
|
+
memoryID: '3',
|
|
149
|
+
title: 'Content with sources',
|
|
150
|
+
titleVariants: undefined,
|
|
151
|
+
memoryType: 'Question',
|
|
152
|
+
answers: [
|
|
153
|
+
{
|
|
154
|
+
text: 'This is a test answer',
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
media: [
|
|
158
|
+
{
|
|
159
|
+
mediumID: '1',
|
|
160
|
+
mimeType: 'text/plain',
|
|
161
|
+
content:
|
|
162
|
+
'This is a source. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
mediumID: '2',
|
|
166
|
+
mimeType: 'text/plain',
|
|
167
|
+
content:
|
|
168
|
+
'This is a source.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\nCras lobortis volutpat nunc.\nProin tincidunt enim in felis aliquet, a ultricies purus bibendum.\n\nQuisque in ultrices lectus.\nNulla at urna diam.\n\nProin sodales lobortis libero eu facilisis.',
|
|
169
|
+
},
|
|
97
170
|
],
|
|
98
|
-
memoryID: '1',
|
|
99
171
|
},
|
|
100
172
|
},
|
|
101
173
|
{
|
|
102
174
|
confidence: 0.7,
|
|
103
175
|
confidenceLevel: 'MEDIUM',
|
|
104
176
|
memory: {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
177
|
+
memoryID: '4',
|
|
178
|
+
title: 'Content with links',
|
|
179
|
+
memoryType: 'Question',
|
|
108
180
|
titleVariants: undefined,
|
|
109
181
|
answers: [
|
|
110
182
|
{
|
|
111
183
|
text: 'This is a an answer',
|
|
112
184
|
},
|
|
185
|
+
],
|
|
186
|
+
media: [
|
|
113
187
|
{
|
|
114
|
-
|
|
188
|
+
mediumID: '1',
|
|
189
|
+
mimeType: 'text/html',
|
|
190
|
+
url: 'https://memori.ai',
|
|
191
|
+
title: 'Memori.AI',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
mediumID: '2',
|
|
195
|
+
mimeType: 'text/html',
|
|
196
|
+
url: 'https://nzambello.dev',
|
|
197
|
+
title: 'Nicola Zambello',
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
confidence: 0.7,
|
|
204
|
+
confidenceLevel: 'MEDIUM',
|
|
205
|
+
memory: {
|
|
206
|
+
memoryID: '5',
|
|
207
|
+
memoryType: 'Question',
|
|
208
|
+
title: 'Content with receiver',
|
|
209
|
+
titleVariants: undefined,
|
|
210
|
+
receiverName: 'receiver',
|
|
211
|
+
receiverTag: '🧑💻',
|
|
212
|
+
answers: [
|
|
213
|
+
{
|
|
214
|
+
text: 'This is a an answer',
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
media: [],
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
confidence: 0.5,
|
|
222
|
+
confidenceLevel: 'MEDIUM',
|
|
223
|
+
memory: {
|
|
224
|
+
memoryID: '5',
|
|
225
|
+
memoryType: 'Question',
|
|
226
|
+
title: 'Content with context',
|
|
227
|
+
titleVariants: undefined,
|
|
228
|
+
contextVars: {
|
|
229
|
+
KEY: 'VALUE',
|
|
230
|
+
},
|
|
231
|
+
answers: [
|
|
232
|
+
{
|
|
233
|
+
text: 'This is a an answer',
|
|
115
234
|
},
|
|
116
235
|
],
|
|
236
|
+
media: [],
|
|
117
237
|
},
|
|
118
238
|
},
|
|
119
239
|
]}
|
|
@@ -12,6 +12,7 @@ import { getErrori18nKey } from '../../helpers/error';
|
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
13
13
|
import Snippet from '../Snippet/Snippet';
|
|
14
14
|
import MediaWidget from '../MediaWidget/MediaWidget';
|
|
15
|
+
import Card from '../ui/Card';
|
|
15
16
|
|
|
16
17
|
export interface Props {
|
|
17
18
|
apiURL: string;
|
|
@@ -152,16 +153,40 @@ const WhyThisAnswer = ({
|
|
|
152
153
|
{m.confidenceLevel}
|
|
153
154
|
</span>
|
|
154
155
|
<div className="memori--whythisanswer-title-text">
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
|
|
156
|
+
<div className="memori--whythisanswer-title-text-top-container">
|
|
157
|
+
<p>
|
|
158
|
+
<strong>{addQuestionMark(m.memory.title ?? '')}</strong>
|
|
159
|
+
</p>
|
|
160
|
+
</div>
|
|
158
161
|
<p>
|
|
159
162
|
{m.memory.titleVariants
|
|
160
163
|
?.map(t => addQuestionMark(t))
|
|
161
164
|
?.join(' | ')}
|
|
162
165
|
</p>
|
|
166
|
+
{(m.memory.receiverName || m.memory.receiverTag) && (
|
|
167
|
+
<p className="memori--whythisanswer-title-text-top">
|
|
168
|
+
{t('receiverLabel')}: {m.memory.receiverTag}{' '}
|
|
169
|
+
{m.memory.receiverName}
|
|
170
|
+
</p>
|
|
171
|
+
)}
|
|
163
172
|
</div>
|
|
164
173
|
</div>
|
|
174
|
+
{m.memory.contextVars && (
|
|
175
|
+
<div className="memori--whythisanswer-contextvars">
|
|
176
|
+
{Object.entries(m.memory.contextVars || {}).map(
|
|
177
|
+
([key, value]) => (
|
|
178
|
+
<Card
|
|
179
|
+
key={key}
|
|
180
|
+
className="memori--whythisanswer-contextvars-card"
|
|
181
|
+
>
|
|
182
|
+
<span>
|
|
183
|
+
{key}: {value?.toString() || '✔️'}
|
|
184
|
+
</span>
|
|
185
|
+
</Card>
|
|
186
|
+
)
|
|
187
|
+
)}
|
|
188
|
+
</div>
|
|
189
|
+
)}
|
|
165
190
|
{m.memory.answers?.map((a, i) => (
|
|
166
191
|
<p key={i} className="memori--whythisanswer-answer">
|
|
167
192
|
<Expandable rows={3}>{a.text}</Expandable>
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders WhyThisAnswer hidden unchanged 1`] = `<div />`;
|
|
4
4
|
|
|
5
|
+
exports[`renders WhyThisAnswer loading unchanged 1`] = `
|
|
6
|
+
<div>
|
|
7
|
+
<div
|
|
8
|
+
style="position: fixed; top: 1px; left: 1px; width: 1px; height: 0px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border-width: 0px; display: none;"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
`;
|
|
12
|
+
|
|
5
13
|
exports[`renders WhyThisAnswer visible unchanged 1`] = `
|
|
6
14
|
<div>
|
|
7
15
|
<div
|
|
@@ -10,4 +18,10 @@ exports[`renders WhyThisAnswer visible unchanged 1`] = `
|
|
|
10
18
|
</div>
|
|
11
19
|
`;
|
|
12
20
|
|
|
13
|
-
exports[`renders WhyThisAnswer with data unchanged 1`] =
|
|
21
|
+
exports[`renders WhyThisAnswer with data unchanged 1`] = `
|
|
22
|
+
<div>
|
|
23
|
+
<div
|
|
24
|
+
style="position: fixed; top: 1px; left: 1px; width: 1px; height: 0px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border-width: 0px; display: none;"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
`;
|
|
@@ -572,14 +572,6 @@ ZoomedFullBody.args = {
|
|
|
572
572
|
lastChangeTimestamp: '2022-06-13T14:44:52.833573Z',
|
|
573
573
|
},
|
|
574
574
|
],
|
|
575
|
-
avatarURL:
|
|
576
|
-
'https://assets.memori.ai/api/v2/asset/3049582f-db5f-452c-913d-e4340d4afd0a.png',
|
|
577
|
-
coverURL:
|
|
578
|
-
'https://assets.memori.ai/api/v2/asset/e9bb9f6d-8f34-45ab-af9e-6d630d9a51a8.png',
|
|
579
|
-
avatar3DURL:
|
|
580
|
-
'https://assets.memori.ai/api/v2/asset/3932bf70-e953-4e8a-b63a-f316544c283e.glb',
|
|
581
|
-
avatarOriginal3DURL:
|
|
582
|
-
'https://assets.memori.ai/api/v2/asset/3932bf70-e953-4e8a-b63a-f316544c283e.glb',
|
|
583
575
|
needsPosition: false,
|
|
584
576
|
voiceType: 'FEMALE',
|
|
585
577
|
culture: 'it-IT',
|
|
@@ -115,19 +115,18 @@ const timing = {
|
|
|
115
115
|
currentWeight + (targetWeight - currentWeight) * SMOOTHING_FACTOR,
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
const createLogger =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
const logVisemeDebug = createLogger('debug');
|
|
118
|
+
// const createLogger =
|
|
119
|
+
// (type: 'event' | 'error' | 'debug') => (event: string, data: any) => {
|
|
120
|
+
// const styles = {
|
|
121
|
+
// event: 'color: #4CAF50; font-weight: bold;',
|
|
122
|
+
// error: 'color: #f44336; font-weight: bold;',
|
|
123
|
+
// debug: 'color: #2196F3; font-weight: bold;',
|
|
124
|
+
// };
|
|
125
|
+
// };
|
|
126
|
+
|
|
127
|
+
// const logVisemeEvent = createLogger('event');
|
|
128
|
+
// const logVisemeError = createLogger('error');
|
|
129
|
+
// const logVisemeDebug = createLogger('debug');
|
|
131
130
|
|
|
132
131
|
type VisemeState = 'idle' | 'preparing' | 'active' | 'paused' | 'finished';
|
|
133
132
|
|
|
@@ -148,10 +147,10 @@ export const VisemeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
148
147
|
|
|
149
148
|
// Listen to audio context state changes
|
|
150
149
|
ctx.onstatechange = () => {
|
|
151
|
-
logVisemeEvent('Audio Context State Change', {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
});
|
|
150
|
+
// logVisemeEvent('Audio Context State Change', {
|
|
151
|
+
// state: ctx.state,
|
|
152
|
+
// currentTime: ctx.currentTime,
|
|
153
|
+
// });
|
|
155
154
|
|
|
156
155
|
switch (ctx.state) {
|
|
157
156
|
case 'running':
|
|
@@ -212,7 +211,7 @@ export const VisemeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
212
211
|
|
|
213
212
|
const startProcessing = useCallback((audioCtx: IAudioContext) => {
|
|
214
213
|
if (!audioCtx) {
|
|
215
|
-
logVisemeError('No audio context provided', { state: visemeState });
|
|
214
|
+
// logVisemeError('No audio context provided', { state: visemeState });
|
|
216
215
|
return;
|
|
217
216
|
}
|
|
218
217
|
|
|
@@ -222,11 +221,11 @@ export const VisemeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
222
221
|
setIsProcessing(true);
|
|
223
222
|
setVisemeState('active');
|
|
224
223
|
|
|
225
|
-
logVisemeEvent('Started Processing', {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
});
|
|
224
|
+
// logVisemeEvent('Started Processing', {
|
|
225
|
+
// audioTime: audioCtx.currentTime,
|
|
226
|
+
// queueLength: visemeQueueRef.current.length,
|
|
227
|
+
// state: visemeState,
|
|
228
|
+
// });
|
|
230
229
|
}, []);
|
|
231
230
|
|
|
232
231
|
const stopProcessing = useCallback(() => {
|
|
@@ -237,10 +236,10 @@ export const VisemeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
237
236
|
frameCountRef.current = 0;
|
|
238
237
|
audioContextRef.current = null;
|
|
239
238
|
|
|
240
|
-
logVisemeEvent('Stopped Processing', {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
});
|
|
239
|
+
// logVisemeEvent('Stopped Processing', {
|
|
240
|
+
// queueLength: visemeQueueRef.current.length,
|
|
241
|
+
// state: visemeState,
|
|
242
|
+
// });
|
|
244
243
|
}, []);
|
|
245
244
|
|
|
246
245
|
const updateCurrentViseme = useCallback(
|
|
@@ -263,13 +262,13 @@ export const VisemeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
263
262
|
);
|
|
264
263
|
|
|
265
264
|
//log it every LOG_INTERVAL frames
|
|
266
|
-
if (frameCountRef.current % LOG_INTERVAL === 60) {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
265
|
+
// if (frameCountRef.current % LOG_INTERVAL === 60) {
|
|
266
|
+
// logVisemeDebug('Current Viseme', {
|
|
267
|
+
// currentViseme,
|
|
268
|
+
// audioTime,
|
|
269
|
+
// visemeQueue: visemeQueueRef.current,
|
|
270
|
+
// });
|
|
271
|
+
// }
|
|
273
272
|
|
|
274
273
|
if (currentViseme) {
|
|
275
274
|
const progress =
|
|
@@ -312,17 +311,17 @@ export const VisemeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
312
311
|
frameCountRef.current = 0;
|
|
313
312
|
setVisemeState('idle');
|
|
314
313
|
|
|
315
|
-
logVisemeEvent('Reset Viseme Queue', {
|
|
316
|
-
|
|
317
|
-
});
|
|
314
|
+
// logVisemeEvent('Reset Viseme Queue', {
|
|
315
|
+
// previousState: visemeState,
|
|
316
|
+
// });
|
|
318
317
|
}, [visemeState]);
|
|
319
318
|
|
|
320
319
|
const resetAndStartProcessing = useCallback(
|
|
321
320
|
(audioCtx: IAudioContext) => {
|
|
322
|
-
logVisemeEvent('Reset And Start Processing', {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
});
|
|
321
|
+
// logVisemeEvent('Reset And Start Processing', {
|
|
322
|
+
// previousState: visemeState,
|
|
323
|
+
// queueLength: visemeQueueRef.current.length,
|
|
324
|
+
// });
|
|
326
325
|
|
|
327
326
|
stopProcessing();
|
|
328
327
|
resetVisemeQueue();
|
package/src/index.stories.tsx
CHANGED
|
@@ -179,64 +179,6 @@ Giovanna.args = {
|
|
|
179
179
|
layout: 'ZOOMED_FULL_BODY',
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
export const GiovannaRPMProva = Template.bind({});
|
|
183
|
-
GiovannaRPMProva.args = {
|
|
184
|
-
memoriName: 'Giovanna Test',
|
|
185
|
-
ownerUserName: 'andrea.patini3',
|
|
186
|
-
memoriID: '431d9819-c958-442c-a799-f90617371c0c',
|
|
187
|
-
ownerUserID: '58770358-a5db-4b49-b3a4-734fc468e745',
|
|
188
|
-
tenantID: 'aisuru-staging.aclambda.online',
|
|
189
|
-
engineURL: 'https://engine-staging.memori.ai',
|
|
190
|
-
apiURL: 'https://backend-staging.memori.ai',
|
|
191
|
-
baseURL: 'https://aisuru-staging.aclambda.online',
|
|
192
|
-
uiLang: 'EN',
|
|
193
|
-
spokenLang: 'IT',
|
|
194
|
-
layout: 'ZOOMED_FULL_BODY',
|
|
195
|
-
integrationID: '061898c0-2138-49da-a6b3-5d86267aad05',
|
|
196
|
-
initialQuestion: 'inizio simulazione',
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export const GiovannaGLBProva = Template.bind({});
|
|
200
|
-
GiovannaGLBProva.args = {
|
|
201
|
-
...GiovannaRPMProva.args,
|
|
202
|
-
integrationID: 'd2099459-0f10-40cd-85e1-06e77a678723',
|
|
203
|
-
layout: 'ZOOMED_FULL_BODY',
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
export const MoodChefAssistant = Template.bind({});
|
|
207
|
-
MoodChefAssistant.args = {
|
|
208
|
-
memoriName: 'Mood Chef Assistant',
|
|
209
|
-
ownerUserName: 'andrea.patini3',
|
|
210
|
-
memoriID: 'fb4f9251-e7ec-4002-b0e5-ffa6e75b2fd8',
|
|
211
|
-
ownerUserID: '58770358-a5db-4b49-b3a4-734fc468e745',
|
|
212
|
-
tenantID: 'aisuru-staging.aclambda.online',
|
|
213
|
-
engineURL: 'https://engine-staging-tmp.memori.ai',
|
|
214
|
-
apiURL: 'https://backend-staging.memori.ai',
|
|
215
|
-
baseURL: 'https://aisuru-staging.aclambda.online',
|
|
216
|
-
uiLang: 'EN',
|
|
217
|
-
spokenLang: 'IT',
|
|
218
|
-
layout: 'ZOOMED_FULL_BODY',
|
|
219
|
-
integrationID: '6e289cc1-df99-4879-8a3a-fe10baea7eac',
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
export const GiovannaProvaWithPreviousSession = Template.bind({});
|
|
223
|
-
GiovannaProvaWithPreviousSession.args = {
|
|
224
|
-
memoriName: 'Giovanna Test',
|
|
225
|
-
ownerUserName: 'andrea.patini3',
|
|
226
|
-
memoriID: '431d9819-c958-442c-a799-f90617371c0c',
|
|
227
|
-
ownerUserID: '58770358-a5db-4b49-b3a4-734fc468e745',
|
|
228
|
-
tenantID: 'aisuru-staging.aclambda.online',
|
|
229
|
-
engineURL: 'https://engine-staging.memori.ai',
|
|
230
|
-
apiURL: 'https://backend-staging.memori.ai',
|
|
231
|
-
baseURL: 'https://aisuru-staging.aclambda.online',
|
|
232
|
-
uiLang: 'EN',
|
|
233
|
-
spokenLang: 'IT',
|
|
234
|
-
layout: 'ZOOMED_FULL_BODY',
|
|
235
|
-
integrationID: 'e92ac275-39b5-474d-8f9e-826cc5284f1e',
|
|
236
|
-
initialQuestion: 'inizio simulazione',
|
|
237
|
-
sessionID: 'c1d13cec-1571-41a0-90bc-15bd2d62e263',
|
|
238
|
-
};
|
|
239
|
-
|
|
240
182
|
export const CreaRiassunti = Template.bind({});
|
|
241
183
|
CreaRiassunti.args = {
|
|
242
184
|
memoriName: 'Crea Riassunti',
|
|
@@ -287,22 +229,78 @@ NunzioFiore.args = {
|
|
|
287
229
|
enableAudio: 'true',
|
|
288
230
|
};
|
|
289
231
|
|
|
290
|
-
export const
|
|
291
|
-
|
|
292
|
-
memoriName: '
|
|
232
|
+
export const TestCustomAnimationsWithRPMSequence = Template.bind({});
|
|
233
|
+
TestCustomAnimationsWithRPMSequence.args = {
|
|
234
|
+
memoriName: 'Test Custom Animations with RPM sequence',
|
|
293
235
|
ownerUserName: 'andrea.patini3',
|
|
294
|
-
memoriID: '
|
|
236
|
+
memoriID: '45420d30-a103-455c-bab1-b708a0566a02',
|
|
295
237
|
ownerUserID: '58770358-a5db-4b49-b3a4-734fc468e745',
|
|
296
238
|
tenantID: 'aisuru-staging.aclambda.online',
|
|
239
|
+
engineURL: 'https://engine-staging-tmp.memori.ai',
|
|
297
240
|
apiURL: 'https://backend-staging.memori.ai',
|
|
241
|
+
baseURL: 'https://aisuru-staging.aclambda.online',
|
|
242
|
+
uiLang: 'IT',
|
|
243
|
+
spokenLang: 'IT',
|
|
244
|
+
layout: 'ZOOMED_FULL_BODY',
|
|
245
|
+
showInstruct: 'false',
|
|
246
|
+
showSettings: 'true',
|
|
247
|
+
showClear: 'false',
|
|
248
|
+
showTypingText: 'false',
|
|
249
|
+
showOnlyLastMessages: 'false',
|
|
250
|
+
showTranslationOriginal: 'false',
|
|
251
|
+
showCopyButton: 'false',
|
|
252
|
+
showShare: 'true',
|
|
253
|
+
showLogin: 'false',
|
|
254
|
+
useMathFormatting: 'false',
|
|
255
|
+
showUpload: 'false',
|
|
256
|
+
autoStart: 'false',
|
|
257
|
+
enableAudio: 'true',
|
|
258
|
+
integrationID: 'a2b9bddc-bb8c-4b0e-b80f-b50ec90e9c99',
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export const TestCustomGLBSingleAnimation = Template.bind({});
|
|
262
|
+
TestCustomGLBSingleAnimation.args = {
|
|
263
|
+
memoriName: "Dragon's Journey",
|
|
264
|
+
ownerUserName: 'andrea.patini3',
|
|
265
|
+
memoriID: 'fa0568c0-aac2-494b-bde7-6a8ec7725a2d',
|
|
266
|
+
ownerUserID: '58770358-a5db-4b49-b3a4-734fc468e745',
|
|
267
|
+
tenantID: 'aisuru-staging.aclambda.online',
|
|
298
268
|
engineURL: 'https://engine-staging-tmp.memori.ai',
|
|
269
|
+
apiURL: 'https://backend-staging.memori.ai',
|
|
299
270
|
baseURL: 'https://aisuru-staging.aclambda.online',
|
|
300
271
|
uiLang: 'IT',
|
|
301
272
|
spokenLang: 'IT',
|
|
302
|
-
layout: '
|
|
303
|
-
|
|
273
|
+
layout: 'TOTEM',
|
|
274
|
+
showInstruct: 'false',
|
|
275
|
+
showSettings: 'true',
|
|
276
|
+
showClear: 'false',
|
|
277
|
+
showTypingText: 'false',
|
|
278
|
+
showOnlyLastMessages: 'false',
|
|
279
|
+
showTranslationOriginal: 'false',
|
|
280
|
+
showCopyButton: 'false',
|
|
304
281
|
showShare: 'true',
|
|
305
|
-
|
|
282
|
+
showLogin: 'false',
|
|
283
|
+
useMathFormatting: 'false',
|
|
284
|
+
showUpload: 'false',
|
|
285
|
+
autoStart: 'false',
|
|
286
|
+
enableAudio: 'true',
|
|
287
|
+
integrationID: 'eea150e2-3ab3-47ae-a9ad-d3ea1704f623',
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export const TestRPMEmotionFunction = Template.bind({});
|
|
291
|
+
TestRPMEmotionFunction.args = {
|
|
292
|
+
memoriName: 'Test RPM',
|
|
293
|
+
ownerUserName: 'andrea.patini3',
|
|
294
|
+
memoriID: '35b7059f-08f4-45ab-98d8-899957666b77',
|
|
295
|
+
ownerUserID: '58770358-a5db-4b49-b3a4-734fc468e745',
|
|
296
|
+
tenantID: 'aisuru-staging.aclambda.online',
|
|
297
|
+
engineURL: 'https://engine-staging-tmp.memori.ai',
|
|
298
|
+
apiURL: 'https://backend-staging.memori.ai',
|
|
299
|
+
baseURL: 'https://aisuru-staging.aclambda.online',
|
|
300
|
+
uiLang: 'IT',
|
|
301
|
+
spokenLang: 'IT',
|
|
302
|
+
layout: 'ZOOMED_FULL_BODY',
|
|
303
|
+
integrationID: '60a37903-44a2-48c2-82e3-c7b8b620cb64',
|
|
306
304
|
};
|
|
307
305
|
|
|
308
306
|
const TemplateWithBatchButton: Story<Props> = args => (
|
package/src/locales/de.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"generatedByAI": "Von KI generierte Antworten können gelegentlich falsche Informationen generieren",
|
|
47
47
|
"whyThisAnswer": "Warum diese Antwort?",
|
|
48
48
|
"whyThisAnswerHelper": "Diese Antwort wurde automatisch von einer künstlichen Intelligenz auf Basis dieser verifizierten Inhalte generiert.",
|
|
49
|
+
"receiverLabel": "Zugewiesen an",
|
|
49
50
|
"completionsEnabled": "Fortschrittliche KI kann mit automatisch generierten Antworten reagieren, die manchmal falsche Informationen enthalten können",
|
|
50
51
|
"completionProviderDown": "Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. ",
|
|
51
52
|
"completionProviderFallbackName": "ein externer Anbieter",
|
package/src/locales/en.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"generatedByAI": "Answer generated by AI, may occasionally generate incorrect informations",
|
|
47
47
|
"whyThisAnswer": "Why this answer?",
|
|
48
48
|
"whyThisAnswerHelper": "This answer was generated automatically by an artificial intelligence based on these verified contents.",
|
|
49
|
+
"receiverLabel": "Assigned to",
|
|
49
50
|
"completionsEnabled": "Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information",
|
|
50
51
|
"completionProviderDown": "This agent is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.",
|
|
51
52
|
"completionProviderFallbackName": "an external provider",
|
package/src/locales/es.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"generatedByAI": "La respuesta generada por IA, ocasionalmente puede generar información incorrecta",
|
|
47
47
|
"whyThisAnswer": "¿Por qué esta respuesta?",
|
|
48
48
|
"whyThisAnswerHelper": "Esta respuesta fue generada automáticamente por una inteligencia artificial basada en estos contenidos verificados.",
|
|
49
|
+
"receiverLabel": "Asignado a",
|
|
49
50
|
"completionsEnabled": "La IA avanzada puede responder con respuestas generadas automáticamente que a veces pueden contener información incorrecta.",
|
|
50
51
|
"completionProviderDown": "Este Agent está integrado con una IA generativa de {{provider}}, pero actualmente no está disponible. ",
|
|
51
52
|
"completionProviderFallbackName": "un proveedor externo",
|
package/src/locales/fr.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"generatedByAI": "Réponse générée par l'IA, peut occasionnellement générer des informations incorrectes",
|
|
47
47
|
"whyThisAnswer": "Pourquoi cette réponse ?",
|
|
48
48
|
"whyThisAnswerHelper": "Cette réponse a été générée automatiquement par une intelligence artificielle basée sur ces contenus vérifiés.",
|
|
49
|
+
"receiverLabel": "Assigné à",
|
|
49
50
|
"completionsEnabled": "L'IA avancée peut répondre avec des réponses générées automatiquement qui peuvent parfois contenir des informations incorrectes",
|
|
50
51
|
"completionProviderDown": "Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. ",
|
|
51
52
|
"completionProviderFallbackName": "un prestataire externe",
|
package/src/locales/it.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"generatedByAI": "Risposta generata da IA, può talvolta generare informazioni non corrette",
|
|
47
47
|
"whyThisAnswer": "Perché questa risposta?",
|
|
48
48
|
"whyThisAnswerHelper": "Questa risposta è stata generata automaticamente da un'intelligenza artificiale sulla base di questi contenuti verificati.",
|
|
49
|
+
"receiverLabel": "Assegnato a",
|
|
49
50
|
"completionsEnabled": "IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette",
|
|
50
51
|
"completionProviderDown": "Questo agente è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.",
|
|
51
52
|
"completionProviderFallbackName": "un provider esterno",
|