@memori.ai/memori-react 8.2.0 → 8.4.0-rc.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 +27 -0
- package/dist/components/Chat/Chat.js +8 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +166 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +3 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +115 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +104 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js +50 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +78 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.d.ts +12 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.js +22 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.d.ts +12 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.js +288 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/index.d.ts +9 -0
- package/dist/components/MemoriArtifactSystem/index.js +28 -0
- package/dist/components/MemoriArtifactSystem/index.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.d.ts +108 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.js +31 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.js.map +1 -0
- package/dist/components/icons/Print.d.ts +6 -0
- package/dist/components/icons/Print.js +6 -0
- package/dist/components/icons/Print.js.map +1 -0
- package/dist/components/layouts/Chat.js +29 -1
- package/dist/components/layouts/Chat.js.map +1 -1
- package/dist/components/layouts/FullPage.js +33 -1
- package/dist/components/layouts/FullPage.js.map +1 -1
- package/dist/components/layouts/ZoomedFullBody.js +29 -2
- package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
- package/dist/components/layouts/chat.css +335 -13
- package/dist/components/layouts/zoomed-full-body.css +1 -3
- package/dist/helpers/message.js +1 -0
- package/dist/helpers/message.js.map +1 -1
- package/dist/helpers/stt/useSTT.js +76 -9
- package/dist/helpers/stt/useSTT.js.map +1 -1
- package/dist/index.js +58 -15
- package/dist/index.js.map +1 -1
- package/dist/styles.css +5 -0
- package/esm/components/Chat/Chat.js +8 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +163 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +3 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +112 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +101 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js +47 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +75 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.d.ts +12 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.js +17 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.d.ts +12 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.js +281 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/index.d.ts +9 -0
- package/esm/components/MemoriArtifactSystem/index.js +9 -0
- package/esm/components/MemoriArtifactSystem/index.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.d.ts +108 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.js +28 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.js.map +1 -0
- package/esm/components/icons/Print.d.ts +6 -0
- package/esm/components/icons/Print.js +4 -0
- package/esm/components/icons/Print.js.map +1 -0
- package/esm/components/layouts/Chat.js +29 -1
- package/esm/components/layouts/Chat.js.map +1 -1
- package/esm/components/layouts/FullPage.js +33 -1
- package/esm/components/layouts/FullPage.js.map +1 -1
- package/esm/components/layouts/ZoomedFullBody.js +30 -3
- package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
- package/esm/components/layouts/chat.css +335 -13
- package/esm/components/layouts/zoomed-full-body.css +1 -3
- package/esm/helpers/message.js +1 -0
- package/esm/helpers/message.js.map +1 -1
- package/esm/helpers/stt/useSTT.js +76 -9
- package/esm/helpers/stt/useSTT.js.map +1 -1
- package/esm/index.js +58 -15
- package/esm/index.js.map +1 -1
- package/esm/styles.css +5 -0
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.test.tsx +13 -0
- package/src/components/Chat/Chat.stories.tsx +33 -2
- package/src/components/Chat/Chat.test.tsx +340 -213
- package/src/components/Chat/Chat.tsx +27 -4
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +278 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +308 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +282 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.tsx +178 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +190 -0
- package/src/components/MemoriArtifactSystem/context/ArtifactSystemContext.tsx +57 -0
- package/src/components/MemoriArtifactSystem/hooks/useArtifactSystem.ts +419 -0
- package/src/components/MemoriArtifactSystem/index.ts +45 -0
- package/src/components/MemoriArtifactSystem/types/artifact.types.ts +180 -0
- package/src/components/icons/Print.tsx +34 -0
- package/src/components/layouts/Chat.test.tsx +13 -0
- package/src/components/layouts/Chat.tsx +80 -25
- package/src/components/layouts/FullPage.test.tsx +40 -11
- package/src/components/layouts/FullPage.tsx +92 -24
- package/src/components/layouts/HiddenChat.test.tsx +13 -0
- package/src/components/layouts/Totem.test.tsx +13 -0
- package/src/components/layouts/WebsiteAssistant.test.tsx +13 -0
- package/src/components/layouts/ZoomedFullBody.test.tsx +13 -0
- package/src/components/layouts/ZoomedFullBody.tsx +78 -14
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +252 -248
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +504 -496
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +252 -248
- package/src/components/layouts/chat.css +335 -13
- package/src/components/layouts/layouts.stories.tsx +13 -2
- package/src/components/layouts/zoomed-full-body.css +1 -3
- package/src/helpers/message.ts +1 -0
- package/src/helpers/stt/useSTT.ts +101 -16
- package/src/index.stories.tsx +26 -22
- package/src/index.tsx +46 -0
- package/src/mocks/data.ts +258 -0
- package/src/styles.css +5 -0
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
dialogState as dialogStateWithHints,
|
|
11
11
|
} from '../../mocks/data';
|
|
12
12
|
import memoriApiClient from '@memori.ai/memori-api-client';
|
|
13
|
+
import { ArtifactSystemProvider } from '../MemoriArtifactSystem';
|
|
13
14
|
|
|
14
15
|
const client = memoriApiClient();
|
|
15
16
|
|
|
@@ -31,267 +32,393 @@ beforeEach(() => {
|
|
|
31
32
|
|
|
32
33
|
it('renders Chat unchanged', () => {
|
|
33
34
|
const { container } = render(
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
35
|
+
<ArtifactSystemProvider
|
|
36
|
+
config={{
|
|
37
|
+
supportedMimeTypes: {
|
|
38
|
+
html: {
|
|
39
|
+
name: 'HTML',
|
|
40
|
+
icon: '🌐',
|
|
41
|
+
hasPreview: true,
|
|
42
|
+
language: 'html',
|
|
43
|
+
mimeType: 'text/html',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<Chat
|
|
49
|
+
memori={memori}
|
|
50
|
+
tenant={tenant}
|
|
51
|
+
dialogState={dialogState}
|
|
52
|
+
layout="DEFAULT"
|
|
53
|
+
client={client}
|
|
54
|
+
history={history}
|
|
55
|
+
pushMessage={jest.fn()}
|
|
56
|
+
sessionID={sessionID}
|
|
57
|
+
simulateUserPrompt={jest.fn()}
|
|
58
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
59
|
+
setSendOnEnter={jest.fn()}
|
|
60
|
+
userMessage=""
|
|
61
|
+
onChangeUserMessage={jest.fn()}
|
|
62
|
+
sendMessage={jest.fn()}
|
|
63
|
+
isPlayingAudio={false}
|
|
64
|
+
stopAudio={jest.fn()}
|
|
65
|
+
showMicrophone={false}
|
|
66
|
+
listening={false}
|
|
67
|
+
startListening={jest.fn()}
|
|
68
|
+
stopListening={jest.fn()}
|
|
69
|
+
setEnableFocusChatInput={jest.fn()}
|
|
70
|
+
/>
|
|
71
|
+
</ArtifactSystemProvider>
|
|
57
72
|
);
|
|
58
73
|
expect(container).toMatchSnapshot();
|
|
59
74
|
});
|
|
60
75
|
|
|
61
76
|
it('renders Chat with memori typing unchanged', () => {
|
|
62
77
|
const { container } = render(
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
<ArtifactSystemProvider
|
|
79
|
+
config={{
|
|
80
|
+
supportedMimeTypes: {
|
|
81
|
+
html: {
|
|
82
|
+
name: 'HTML',
|
|
83
|
+
icon: '🌐',
|
|
84
|
+
hasPreview: true,
|
|
85
|
+
language: 'html',
|
|
86
|
+
mimeType: 'text/html',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<Chat
|
|
92
|
+
memori={memori}
|
|
93
|
+
tenant={tenant}
|
|
94
|
+
dialogState={dialogState}
|
|
95
|
+
client={client}
|
|
96
|
+
history={history}
|
|
97
|
+
layout="DEFAULT"
|
|
98
|
+
pushMessage={jest.fn()}
|
|
99
|
+
sessionID={sessionID}
|
|
100
|
+
simulateUserPrompt={jest.fn()}
|
|
101
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
102
|
+
setSendOnEnter={jest.fn()}
|
|
103
|
+
userMessage=""
|
|
104
|
+
onChangeUserMessage={jest.fn()}
|
|
105
|
+
sendMessage={jest.fn()}
|
|
106
|
+
stopListening={jest.fn()}
|
|
107
|
+
isPlayingAudio={false}
|
|
108
|
+
stopAudio={jest.fn()}
|
|
109
|
+
showMicrophone={false}
|
|
110
|
+
listening={false}
|
|
111
|
+
startListening={jest.fn()}
|
|
112
|
+
setEnableFocusChatInput={jest.fn()}
|
|
113
|
+
memoriTyping
|
|
114
|
+
/>
|
|
115
|
+
</ArtifactSystemProvider>
|
|
87
116
|
);
|
|
88
117
|
expect(container).toMatchSnapshot();
|
|
89
118
|
});
|
|
90
119
|
|
|
91
120
|
it('renders Chat with hints unchanged', () => {
|
|
92
121
|
const { container } = render(
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
<ArtifactSystemProvider
|
|
123
|
+
config={{
|
|
124
|
+
supportedMimeTypes: {
|
|
125
|
+
html: {
|
|
126
|
+
name: 'HTML',
|
|
127
|
+
icon: '🌐',
|
|
128
|
+
hasPreview: true,
|
|
129
|
+
language: 'html',
|
|
130
|
+
mimeType: 'text/html',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
<Chat
|
|
136
|
+
memori={memori}
|
|
137
|
+
tenant={tenant}
|
|
138
|
+
dialogState={dialogStateWithHints}
|
|
139
|
+
client={client}
|
|
140
|
+
history={history}
|
|
141
|
+
layout="DEFAULT"
|
|
142
|
+
pushMessage={jest.fn()}
|
|
143
|
+
sessionID={sessionID}
|
|
144
|
+
simulateUserPrompt={jest.fn()}
|
|
145
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
146
|
+
setSendOnEnter={jest.fn()}
|
|
147
|
+
userMessage=""
|
|
148
|
+
onChangeUserMessage={jest.fn()}
|
|
149
|
+
sendMessage={jest.fn()}
|
|
150
|
+
stopListening={jest.fn()}
|
|
151
|
+
isPlayingAudio={false}
|
|
152
|
+
stopAudio={jest.fn()}
|
|
153
|
+
showMicrophone={false}
|
|
154
|
+
listening={false}
|
|
155
|
+
startListening={jest.fn()}
|
|
156
|
+
setEnableFocusChatInput={jest.fn()}
|
|
157
|
+
/>
|
|
158
|
+
</ArtifactSystemProvider>
|
|
116
159
|
);
|
|
117
160
|
expect(container).toMatchSnapshot();
|
|
118
161
|
});
|
|
119
162
|
|
|
120
163
|
it('renders Chat with media unchanged', () => {
|
|
121
164
|
const { container } = render(
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
<ArtifactSystemProvider
|
|
166
|
+
config={{
|
|
167
|
+
supportedMimeTypes: {
|
|
168
|
+
html: {
|
|
169
|
+
name: 'HTML',
|
|
170
|
+
icon: '🌐',
|
|
171
|
+
hasPreview: true,
|
|
172
|
+
language: 'html',
|
|
173
|
+
mimeType: 'text/html',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
<Chat
|
|
179
|
+
memori={memori}
|
|
180
|
+
tenant={tenant}
|
|
181
|
+
dialogState={dialogState}
|
|
182
|
+
client={client}
|
|
183
|
+
history={historyWithMedia}
|
|
184
|
+
layout="DEFAULT"
|
|
185
|
+
pushMessage={jest.fn()}
|
|
186
|
+
sessionID={sessionID}
|
|
187
|
+
simulateUserPrompt={jest.fn()}
|
|
188
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
189
|
+
setSendOnEnter={jest.fn()}
|
|
190
|
+
userMessage=""
|
|
191
|
+
onChangeUserMessage={jest.fn()}
|
|
192
|
+
sendMessage={jest.fn()}
|
|
193
|
+
stopListening={jest.fn()}
|
|
194
|
+
isPlayingAudio={false}
|
|
195
|
+
stopAudio={jest.fn()}
|
|
196
|
+
showMicrophone={false}
|
|
197
|
+
listening={false}
|
|
198
|
+
startListening={jest.fn()}
|
|
199
|
+
setEnableFocusChatInput={jest.fn()}
|
|
200
|
+
/>
|
|
201
|
+
</ArtifactSystemProvider>
|
|
145
202
|
);
|
|
146
203
|
expect(container).toMatchSnapshot();
|
|
147
204
|
});
|
|
148
205
|
|
|
149
206
|
it('renders Chat with dates unchanged', () => {
|
|
150
207
|
const { container } = render(
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
208
|
+
<ArtifactSystemProvider
|
|
209
|
+
config={{
|
|
210
|
+
supportedMimeTypes: {
|
|
211
|
+
html: {
|
|
212
|
+
name: 'HTML',
|
|
213
|
+
icon: '🌐',
|
|
214
|
+
hasPreview: true,
|
|
215
|
+
language: 'html',
|
|
216
|
+
mimeType: 'text/html',
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
}}
|
|
220
|
+
>
|
|
221
|
+
<Chat
|
|
222
|
+
memori={memori}
|
|
223
|
+
tenant={tenant}
|
|
224
|
+
dialogState={dialogState}
|
|
225
|
+
client={client}
|
|
226
|
+
history={history}
|
|
227
|
+
layout="DEFAULT"
|
|
228
|
+
pushMessage={jest.fn()}
|
|
229
|
+
sessionID={sessionID}
|
|
230
|
+
simulateUserPrompt={jest.fn()}
|
|
231
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
232
|
+
setSendOnEnter={jest.fn()}
|
|
233
|
+
userMessage=""
|
|
234
|
+
onChangeUserMessage={jest.fn()}
|
|
235
|
+
sendMessage={jest.fn()}
|
|
236
|
+
stopListening={jest.fn()}
|
|
237
|
+
isPlayingAudio={false}
|
|
238
|
+
stopAudio={jest.fn()}
|
|
239
|
+
showMicrophone={false}
|
|
240
|
+
listening={false}
|
|
241
|
+
startListening={jest.fn()}
|
|
242
|
+
showDates
|
|
243
|
+
setEnableFocusChatInput={jest.fn()}
|
|
244
|
+
/>
|
|
245
|
+
</ArtifactSystemProvider>
|
|
175
246
|
);
|
|
176
247
|
expect(container).toMatchSnapshot();
|
|
177
248
|
});
|
|
178
249
|
|
|
179
250
|
it('renders Chat with context vars unchanged', () => {
|
|
180
251
|
const { container } = render(
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
252
|
+
<ArtifactSystemProvider
|
|
253
|
+
config={{
|
|
254
|
+
supportedMimeTypes: {
|
|
255
|
+
html: {
|
|
256
|
+
name: 'HTML',
|
|
257
|
+
icon: '🌐',
|
|
258
|
+
hasPreview: true,
|
|
259
|
+
language: 'html',
|
|
260
|
+
mimeType: 'text/html',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
}}
|
|
264
|
+
>
|
|
265
|
+
<Chat
|
|
266
|
+
memori={memori}
|
|
267
|
+
tenant={tenant}
|
|
268
|
+
dialogState={dialogState}
|
|
269
|
+
client={client}
|
|
270
|
+
history={history}
|
|
271
|
+
layout="DEFAULT"
|
|
272
|
+
pushMessage={jest.fn()}
|
|
273
|
+
sessionID={sessionID}
|
|
274
|
+
simulateUserPrompt={jest.fn()}
|
|
275
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
276
|
+
setSendOnEnter={jest.fn()}
|
|
277
|
+
userMessage=""
|
|
278
|
+
onChangeUserMessage={jest.fn()}
|
|
279
|
+
sendMessage={jest.fn()}
|
|
280
|
+
stopListening={jest.fn()}
|
|
281
|
+
isPlayingAudio={false}
|
|
282
|
+
stopAudio={jest.fn()}
|
|
283
|
+
showMicrophone={false}
|
|
284
|
+
listening={false}
|
|
285
|
+
startListening={jest.fn()}
|
|
286
|
+
setEnableFocusChatInput={jest.fn()}
|
|
287
|
+
showContextPerLine
|
|
288
|
+
/>
|
|
289
|
+
</ArtifactSystemProvider>
|
|
205
290
|
);
|
|
206
291
|
expect(container).toMatchSnapshot();
|
|
207
292
|
});
|
|
208
293
|
|
|
209
294
|
it('renders Chat with user unchanged', () => {
|
|
210
295
|
const { container } = render(
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
296
|
+
<ArtifactSystemProvider
|
|
297
|
+
config={{
|
|
298
|
+
supportedMimeTypes: {
|
|
299
|
+
html: {
|
|
300
|
+
name: 'HTML',
|
|
301
|
+
icon: '🌐',
|
|
302
|
+
hasPreview: true,
|
|
303
|
+
language: 'html',
|
|
304
|
+
mimeType: 'text/html',
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
}}
|
|
308
|
+
>
|
|
309
|
+
<Chat
|
|
310
|
+
user={{ avatarURL: 'https://picsum.photos/200' }}
|
|
311
|
+
memori={memori}
|
|
312
|
+
tenant={tenant}
|
|
313
|
+
dialogState={dialogState}
|
|
314
|
+
layout="DEFAULT"
|
|
315
|
+
client={client}
|
|
316
|
+
history={history}
|
|
317
|
+
pushMessage={jest.fn()}
|
|
318
|
+
sessionID={sessionID}
|
|
319
|
+
simulateUserPrompt={jest.fn()}
|
|
320
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
321
|
+
setSendOnEnter={jest.fn()}
|
|
322
|
+
userMessage=""
|
|
323
|
+
onChangeUserMessage={jest.fn()}
|
|
324
|
+
sendMessage={jest.fn()}
|
|
325
|
+
isPlayingAudio={false}
|
|
326
|
+
stopAudio={jest.fn()}
|
|
327
|
+
showMicrophone={false}
|
|
328
|
+
listening={false}
|
|
329
|
+
startListening={jest.fn()}
|
|
330
|
+
stopListening={jest.fn()}
|
|
331
|
+
setEnableFocusChatInput={jest.fn()}
|
|
332
|
+
/>
|
|
333
|
+
</ArtifactSystemProvider>
|
|
235
334
|
);
|
|
236
335
|
expect(container).toMatchSnapshot();
|
|
237
336
|
});
|
|
238
337
|
|
|
239
338
|
it('renders Chat with custom user avatar unchanged', () => {
|
|
240
339
|
const { container } = render(
|
|
241
|
-
<
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
340
|
+
<ArtifactSystemProvider
|
|
341
|
+
config={{
|
|
342
|
+
supportedMimeTypes: {
|
|
343
|
+
html: {
|
|
344
|
+
name: 'HTML',
|
|
345
|
+
icon: '🌐',
|
|
346
|
+
hasPreview: true,
|
|
347
|
+
language: 'html',
|
|
348
|
+
mimeType: 'text/html',
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
}}
|
|
352
|
+
>
|
|
353
|
+
<Chat
|
|
354
|
+
userAvatar="https://picsum.photos/200"
|
|
355
|
+
memori={memori}
|
|
356
|
+
tenant={tenant}
|
|
357
|
+
dialogState={dialogState}
|
|
358
|
+
layout="DEFAULT"
|
|
359
|
+
client={client}
|
|
360
|
+
history={history}
|
|
361
|
+
pushMessage={jest.fn()}
|
|
362
|
+
sessionID={sessionID}
|
|
363
|
+
simulateUserPrompt={jest.fn()}
|
|
364
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
365
|
+
setSendOnEnter={jest.fn()}
|
|
366
|
+
userMessage=""
|
|
367
|
+
onChangeUserMessage={jest.fn()}
|
|
368
|
+
sendMessage={jest.fn()}
|
|
369
|
+
isPlayingAudio={false}
|
|
370
|
+
stopAudio={jest.fn()}
|
|
371
|
+
showMicrophone={false}
|
|
372
|
+
listening={false}
|
|
373
|
+
startListening={jest.fn()}
|
|
374
|
+
stopListening={jest.fn()}
|
|
375
|
+
setEnableFocusChatInput={jest.fn()}
|
|
376
|
+
/>
|
|
377
|
+
</ArtifactSystemProvider>
|
|
265
378
|
);
|
|
266
379
|
expect(container).toMatchSnapshot();
|
|
267
380
|
});
|
|
268
381
|
|
|
269
382
|
it('renders Chat with custom user avatar as react element unchanged', () => {
|
|
270
383
|
const { container } = render(
|
|
271
|
-
<
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
384
|
+
<ArtifactSystemProvider
|
|
385
|
+
config={{
|
|
386
|
+
supportedMimeTypes: {
|
|
387
|
+
html: {
|
|
388
|
+
name: 'HTML',
|
|
389
|
+
icon: '🌐',
|
|
390
|
+
hasPreview: true,
|
|
391
|
+
language: 'html',
|
|
392
|
+
mimeType: 'text/html',
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
}}
|
|
396
|
+
>
|
|
397
|
+
<Chat
|
|
398
|
+
userAvatar={<span>USER</span>}
|
|
399
|
+
memori={memori}
|
|
400
|
+
tenant={tenant}
|
|
401
|
+
dialogState={dialogState}
|
|
402
|
+
layout="DEFAULT"
|
|
403
|
+
client={client}
|
|
404
|
+
history={history}
|
|
405
|
+
pushMessage={jest.fn()}
|
|
406
|
+
sessionID={sessionID}
|
|
407
|
+
simulateUserPrompt={jest.fn()}
|
|
408
|
+
setAttachmentsMenuOpen={jest.fn()}
|
|
409
|
+
setSendOnEnter={jest.fn()}
|
|
410
|
+
userMessage=""
|
|
411
|
+
onChangeUserMessage={jest.fn()}
|
|
412
|
+
sendMessage={jest.fn()}
|
|
413
|
+
isPlayingAudio={false}
|
|
414
|
+
stopAudio={jest.fn()}
|
|
415
|
+
showMicrophone={false}
|
|
416
|
+
listening={false}
|
|
417
|
+
startListening={jest.fn()}
|
|
418
|
+
stopListening={jest.fn()}
|
|
419
|
+
setEnableFocusChatInput={jest.fn()}
|
|
420
|
+
/>
|
|
421
|
+
</ArtifactSystemProvider>
|
|
295
422
|
);
|
|
296
423
|
expect(container).toMatchSnapshot();
|
|
297
424
|
});
|