@memori.ai/memori-react 2.23.0 → 3.0.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 +13 -0
- package/dist/I18nWrapper.d.ts +6 -0
- package/dist/I18nWrapper.js +9 -0
- package/dist/I18nWrapper.js.map +1 -0
- package/dist/components/ChatTextArea/ChatTextArea.js +3 -1
- package/dist/components/ChatTextArea/ChatTextArea.js.map +1 -1
- package/dist/components/ImageUpload/ImageUpload.js +3 -1
- package/dist/components/ImageUpload/ImageUpload.js.map +1 -1
- package/dist/i18n.d.ts +1 -1
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +1 -0
- package/dist/locales/it.json +1 -0
- package/esm/I18nWrapper.d.ts +6 -0
- package/esm/I18nWrapper.js +6 -0
- package/esm/I18nWrapper.js.map +1 -0
- package/esm/components/ChatTextArea/ChatTextArea.js +3 -1
- package/esm/components/ChatTextArea/ChatTextArea.js.map +1 -1
- package/esm/components/ImageUpload/ImageUpload.js +3 -1
- package/esm/components/ImageUpload/ImageUpload.js.map +1 -1
- package/esm/i18n.d.ts +1 -1
- package/esm/i18n.js +3 -3
- package/esm/i18n.js.map +1 -1
- package/esm/index.js +8 -3
- package/esm/index.js.map +1 -1
- package/esm/locales/en.json +1 -0
- package/esm/locales/it.json +1 -0
- package/package.json +1 -1
- package/src/I18nWrapper.tsx +13 -0
- package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +6 -1
- package/src/components/AttachmentLinkModal/AttachmentLinkModal.stories.tsx +6 -1
- package/src/components/AttachmentMediaModal/AttachmentMediaModal.stories.tsx +6 -1
- package/src/components/Auth/Auth.stories.tsx +16 -11
- package/src/components/Avatar/Avatar.stories.tsx +28 -25
- package/src/components/AvatarView/AvatarView.stories.tsx +8 -5
- package/src/components/Blob/Blob.stories.tsx +6 -3
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +6 -1
- package/src/components/ChangeMode/ChangeMode.stories.tsx +9 -6
- package/src/components/Chat/Chat.stories.tsx +8 -5
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +11 -0
- package/src/components/ChatBubble/ChatBubble.stories.tsx +6 -2
- package/src/components/ChatInputs/ChatInputs.stories.tsx +13 -10
- package/src/components/ChatInputs/__snapshots__/ChatInputs.test.tsx.snap +6 -0
- package/src/components/ChatTextArea/ChatTextArea.stories.tsx +6 -3
- package/src/components/ChatTextArea/ChatTextArea.tsx +5 -0
- package/src/components/ChatTextArea/__snapshots__/ChatTextArea.test.tsx.snap +3 -0
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +6 -1
- package/src/components/DateSelector/DateSelector.stories.tsx +6 -2
- package/src/components/ExportHistoryButton/ExportHistoryButton.stories.tsx +11 -6
- package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +6 -2
- package/src/components/Header/Header.stories.tsx +4 -3
- package/src/components/ImageUpload/ImageUpload.stories.tsx +6 -2
- package/src/components/ImageUpload/ImageUpload.tsx +5 -2
- package/src/components/MediaWidget/LinkItemWidget.stories.tsx +6 -1
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +6 -1
- package/src/components/MediaWidget/MediaWidget.stories.tsx +6 -1
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +6 -2
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +11 -8
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +17 -13
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +11 -7
- package/src/components/ShareButton/ShareButton.stories.tsx +11 -4
- package/src/components/Snippet/Snippet.stories.tsx +12 -9
- package/src/components/StartPanel/StartPanel.stories.tsx +9 -6
- package/src/components/Typing/Typing.stories.tsx +6 -2
- package/src/components/UploadMenu/UploadMenu.stories.tsx +16 -13
- package/src/i18n.ts +4 -3
- package/src/index.tsx +12 -4
- package/src/locales/en.json +1 -0
- package/src/locales/it.json +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
3
|
import { memori, tenant, integration } from '../../mocks/data';
|
|
4
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
4
5
|
import Avatar, { Props } from './Avatar';
|
|
5
6
|
|
|
6
7
|
import './Avatar.css';
|
|
@@ -30,32 +31,34 @@ const Template: Story<Props> = args => {
|
|
|
30
31
|
);
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
>
|
|
42
|
-
<Avatar
|
|
43
|
-
{...args}
|
|
44
|
-
integrationConfig={
|
|
45
|
-
args.integrationConfig
|
|
46
|
-
? {
|
|
47
|
-
...args.integrationConfig,
|
|
48
|
-
avatarURL:
|
|
49
|
-
args.integrationConfig.avatarURL?.split('#')?.[0] +
|
|
50
|
-
`#${new Date(Date.now()).toISOString()}`,
|
|
51
|
-
}
|
|
52
|
-
: undefined
|
|
34
|
+
<I18nWrapper>
|
|
35
|
+
<div
|
|
36
|
+
style={
|
|
37
|
+
args.integrationConfig?.avatar === 'customglb' ||
|
|
38
|
+
args.integrationConfig?.avatar === 'readyplayerme' ||
|
|
39
|
+
args.integrationConfig?.avatar === 'readyplayerme-full'
|
|
40
|
+
? {}
|
|
41
|
+
: { marginTop: '20vw' }
|
|
53
42
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
>
|
|
44
|
+
<Avatar
|
|
45
|
+
{...args}
|
|
46
|
+
integrationConfig={
|
|
47
|
+
args.integrationConfig
|
|
48
|
+
? {
|
|
49
|
+
...args.integrationConfig,
|
|
50
|
+
avatarURL:
|
|
51
|
+
args.integrationConfig.avatarURL?.split('#')?.[0] +
|
|
52
|
+
`#${new Date(Date.now()).toISOString()}`,
|
|
53
|
+
}
|
|
54
|
+
: undefined
|
|
55
|
+
}
|
|
56
|
+
avatar3dVisible={avatar3dVisible}
|
|
57
|
+
setAvatar3dVisible={setAvatar3dVisible}
|
|
58
|
+
key={Date.now()}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
</I18nWrapper>
|
|
59
62
|
);
|
|
60
63
|
};
|
|
61
64
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import AvatarView, { Props } from './index';
|
|
4
5
|
|
|
5
6
|
const meta: Meta = {
|
|
@@ -67,11 +68,13 @@ const Template: Story<Props> = args => {
|
|
|
67
68
|
}, []);
|
|
68
69
|
|
|
69
70
|
return hydrated ? (
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
<I18nWrapper>
|
|
72
|
+
<AvatarView
|
|
73
|
+
{...args}
|
|
74
|
+
url={args.url + `#${new Date(Date.now()).toISOString()}`}
|
|
75
|
+
key={Date.now()}
|
|
76
|
+
/>
|
|
77
|
+
</I18nWrapper>
|
|
75
78
|
) : (
|
|
76
79
|
<></>
|
|
77
80
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import Blob, { Props } from './Blob';
|
|
4
5
|
import './Blob.css';
|
|
5
6
|
|
|
@@ -26,9 +27,11 @@ const meta: Meta = {
|
|
|
26
27
|
export default meta;
|
|
27
28
|
|
|
28
29
|
const Template: Story<Props> = args => (
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
30
|
+
<I18nWrapper>
|
|
31
|
+
<div style={{ marginTop: '20vw' }}>
|
|
32
|
+
<Blob {...args} />
|
|
33
|
+
</div>
|
|
34
|
+
</I18nWrapper>
|
|
32
35
|
);
|
|
33
36
|
|
|
34
37
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import BlockedMemoriBadge, { Props } from './BlockedMemoriBadge';
|
|
4
5
|
|
|
5
6
|
import './BlockedMemoriBadge.css';
|
|
@@ -15,7 +16,11 @@ const meta: Meta = {
|
|
|
15
16
|
|
|
16
17
|
export default meta;
|
|
17
18
|
|
|
18
|
-
const Template: Story<Props> = args =>
|
|
19
|
+
const Template: Story<Props> = args => (
|
|
20
|
+
<I18nWrapper>
|
|
21
|
+
<BlockedMemoriBadge {...args} />
|
|
22
|
+
</I18nWrapper>
|
|
23
|
+
);
|
|
19
24
|
|
|
20
25
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
21
26
|
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import ChangeMode, { Props } from './ChangeMode';
|
|
4
5
|
|
|
5
6
|
import './ChangeMode.css';
|
|
@@ -25,12 +26,14 @@ const Template: Story<Props> = args => {
|
|
|
25
26
|
const [instruct, setInstruct] = React.useState(args.instruct);
|
|
26
27
|
|
|
27
28
|
return (
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
<I18nWrapper>
|
|
30
|
+
<ChangeMode
|
|
31
|
+
{...args}
|
|
32
|
+
canInstruct
|
|
33
|
+
instruct={instruct}
|
|
34
|
+
onChangeMode={mode => setInstruct(mode === 'instruct')}
|
|
35
|
+
/>
|
|
36
|
+
</I18nWrapper>
|
|
34
37
|
);
|
|
35
38
|
};
|
|
36
39
|
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
sessionID,
|
|
10
10
|
dialogState as dialogStateWithHints,
|
|
11
11
|
} from '../../mocks/data';
|
|
12
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
12
13
|
import Chat, { Props } from './Chat';
|
|
13
14
|
|
|
14
15
|
import './Chat.css';
|
|
@@ -33,11 +34,13 @@ const Template: Story<Props> = args => {
|
|
|
33
34
|
const [userMessage, setUserMessage] = useState(args.userMessage);
|
|
34
35
|
|
|
35
36
|
return (
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
<I18nWrapper>
|
|
38
|
+
<Chat
|
|
39
|
+
{...args}
|
|
40
|
+
userMessage={userMessage}
|
|
41
|
+
onChangeUserMessage={setUserMessage}
|
|
42
|
+
/>
|
|
43
|
+
</I18nWrapper>
|
|
41
44
|
);
|
|
42
45
|
};
|
|
43
46
|
|
|
@@ -368,6 +368,7 @@ exports[`renders Chat on X2a state unchanged 1`] = `
|
|
|
368
368
|
>
|
|
369
369
|
<button
|
|
370
370
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
371
|
+
title="expand"
|
|
371
372
|
>
|
|
372
373
|
<span
|
|
373
374
|
class="memori-button--icon"
|
|
@@ -815,6 +816,7 @@ exports[`renders Chat on X3 state unchanged 1`] = `
|
|
|
815
816
|
>
|
|
816
817
|
<button
|
|
817
818
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
819
|
+
title="expand"
|
|
818
820
|
>
|
|
819
821
|
<span
|
|
820
822
|
class="memori-button--icon"
|
|
@@ -1198,6 +1200,7 @@ exports[`renders Chat unchanged 1`] = `
|
|
|
1198
1200
|
>
|
|
1199
1201
|
<button
|
|
1200
1202
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
1203
|
+
title="expand"
|
|
1201
1204
|
>
|
|
1202
1205
|
<span
|
|
1203
1206
|
class="memori-button--icon"
|
|
@@ -1611,6 +1614,7 @@ exports[`renders Chat with context vars unchanged 1`] = `
|
|
|
1611
1614
|
>
|
|
1612
1615
|
<button
|
|
1613
1616
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
1617
|
+
title="expand"
|
|
1614
1618
|
>
|
|
1615
1619
|
<span
|
|
1616
1620
|
class="memori-button--icon"
|
|
@@ -1970,6 +1974,7 @@ exports[`renders Chat with custom user avatar as react element unchanged 1`] = `
|
|
|
1970
1974
|
>
|
|
1971
1975
|
<button
|
|
1972
1976
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
1977
|
+
title="expand"
|
|
1973
1978
|
>
|
|
1974
1979
|
<span
|
|
1975
1980
|
class="memori-button--icon"
|
|
@@ -2335,6 +2340,7 @@ exports[`renders Chat with custom user avatar unchanged 1`] = `
|
|
|
2335
2340
|
>
|
|
2336
2341
|
<button
|
|
2337
2342
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
2343
|
+
title="expand"
|
|
2338
2344
|
>
|
|
2339
2345
|
<span
|
|
2340
2346
|
class="memori-button--icon"
|
|
@@ -2753,6 +2759,7 @@ exports[`renders Chat with dates unchanged 1`] = `
|
|
|
2753
2759
|
>
|
|
2754
2760
|
<button
|
|
2755
2761
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
2762
|
+
title="expand"
|
|
2756
2763
|
>
|
|
2757
2764
|
<span
|
|
2758
2765
|
class="memori-button--icon"
|
|
@@ -3162,6 +3169,7 @@ exports[`renders Chat with hints unchanged 1`] = `
|
|
|
3162
3169
|
>
|
|
3163
3170
|
<button
|
|
3164
3171
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
3172
|
+
title="expand"
|
|
3165
3173
|
>
|
|
3166
3174
|
<span
|
|
3167
3175
|
class="memori-button--icon"
|
|
@@ -3946,6 +3954,7 @@ exports[`renders Chat with media unchanged 1`] = `
|
|
|
3946
3954
|
>
|
|
3947
3955
|
<button
|
|
3948
3956
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
3957
|
+
title="expand"
|
|
3949
3958
|
>
|
|
3950
3959
|
<span
|
|
3951
3960
|
class="memori-button--icon"
|
|
@@ -4350,6 +4359,7 @@ exports[`renders Chat with memori typing unchanged 1`] = `
|
|
|
4350
4359
|
>
|
|
4351
4360
|
<button
|
|
4352
4361
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
4362
|
+
title="expand"
|
|
4353
4363
|
>
|
|
4354
4364
|
<span
|
|
4355
4365
|
class="memori-button--icon"
|
|
@@ -4715,6 +4725,7 @@ exports[`renders Chat with user unchanged 1`] = `
|
|
|
4715
4725
|
>
|
|
4716
4726
|
<button
|
|
4717
4727
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
4728
|
+
title="expand"
|
|
4718
4729
|
>
|
|
4719
4730
|
<span
|
|
4720
4731
|
class="memori-button--icon"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
3
|
import { memori, tenant } from '../../mocks/data';
|
|
4
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
4
5
|
import ChatBubble, { Props } from './ChatBubble';
|
|
5
6
|
|
|
6
7
|
import './ChatBubble.css';
|
|
@@ -32,8 +33,11 @@ const meta: Meta = {
|
|
|
32
33
|
|
|
33
34
|
export default meta;
|
|
34
35
|
|
|
35
|
-
const Template: Story<Props> = args =>
|
|
36
|
-
|
|
36
|
+
const Template: Story<Props> = args => (
|
|
37
|
+
<I18nWrapper>
|
|
38
|
+
<ChatBubble {...args} />
|
|
39
|
+
</I18nWrapper>
|
|
40
|
+
);
|
|
37
41
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
38
42
|
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
39
43
|
export const Default = Template.bind({});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
3
|
import ChatInputs, { Props } from './ChatInputs';
|
|
4
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
4
5
|
import { dialogState } from '../../mocks/data';
|
|
5
6
|
|
|
6
7
|
import './ChatInputs.css';
|
|
@@ -50,16 +51,18 @@ const Template: Story<Props> = args => {
|
|
|
50
51
|
}, [listening]);
|
|
51
52
|
|
|
52
53
|
return (
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
<I18nWrapper>
|
|
55
|
+
<div style={{ paddingTop: '10rem' }}>
|
|
56
|
+
<ChatInputs
|
|
57
|
+
{...args}
|
|
58
|
+
listening={listening}
|
|
59
|
+
startListening={startListening}
|
|
60
|
+
stopListening={stopListening}
|
|
61
|
+
userMessage={userMessage}
|
|
62
|
+
onChangeUserMessage={setUserMessage}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</I18nWrapper>
|
|
63
66
|
);
|
|
64
67
|
};
|
|
65
68
|
|
|
@@ -48,6 +48,7 @@ exports[`renders ChatInputs disabled unchanged 1`] = `
|
|
|
48
48
|
>
|
|
49
49
|
<button
|
|
50
50
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
51
|
+
title="expand"
|
|
51
52
|
>
|
|
52
53
|
<span
|
|
53
54
|
class="memori-button--icon"
|
|
@@ -173,6 +174,7 @@ exports[`renders ChatInputs listening unchanged 1`] = `
|
|
|
173
174
|
>
|
|
174
175
|
<button
|
|
175
176
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
177
|
+
title="expand"
|
|
176
178
|
>
|
|
177
179
|
<span
|
|
178
180
|
class="memori-button--icon"
|
|
@@ -327,6 +329,7 @@ exports[`renders ChatInputs on instruct unchanged 1`] = `
|
|
|
327
329
|
>
|
|
328
330
|
<button
|
|
329
331
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
332
|
+
title="expand"
|
|
330
333
|
>
|
|
331
334
|
<span
|
|
332
335
|
class="memori-button--icon"
|
|
@@ -450,6 +453,7 @@ exports[`renders ChatInputs unchanged 1`] = `
|
|
|
450
453
|
>
|
|
451
454
|
<button
|
|
452
455
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
456
|
+
title="expand"
|
|
453
457
|
>
|
|
454
458
|
<span
|
|
455
459
|
class="memori-button--icon"
|
|
@@ -576,6 +580,7 @@ exports[`renders ChatInputs with user message unchanged 1`] = `
|
|
|
576
580
|
>
|
|
577
581
|
<button
|
|
578
582
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
583
|
+
title="expand"
|
|
579
584
|
>
|
|
580
585
|
<span
|
|
581
586
|
class="memori-button--icon"
|
|
@@ -701,6 +706,7 @@ exports[`renders ChatInputs without microphone button unchanged 1`] = `
|
|
|
701
706
|
>
|
|
702
707
|
<button
|
|
703
708
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
709
|
+
title="expand"
|
|
704
710
|
>
|
|
705
711
|
<span
|
|
706
712
|
class="memori-button--icon"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
3
|
import ChatTextArea, { Props } from './ChatTextArea';
|
|
4
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
4
5
|
import './ChatTextArea.css';
|
|
5
6
|
|
|
6
7
|
const meta: Meta = {
|
|
@@ -24,9 +25,11 @@ const Template: Story<Props> = args => {
|
|
|
24
25
|
const [userMessage, setUserMessage] = React.useState(args.value);
|
|
25
26
|
|
|
26
27
|
return (
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
28
|
+
<I18nWrapper>
|
|
29
|
+
<div style={{ paddingTop: '10rem' }}>
|
|
30
|
+
<ChatTextArea {...args} value={userMessage} onChange={setUserMessage} />
|
|
31
|
+
</div>
|
|
32
|
+
</I18nWrapper>
|
|
30
33
|
);
|
|
31
34
|
};
|
|
32
35
|
|
|
@@ -3,6 +3,7 @@ import cx from 'classnames';
|
|
|
3
3
|
import Button from '../ui/Button';
|
|
4
4
|
import Expand from '../icons/Expand';
|
|
5
5
|
import FullscreenExit from '../icons/FullscreenExit';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
6
7
|
|
|
7
8
|
export interface Props {
|
|
8
9
|
disabled?: boolean;
|
|
@@ -21,6 +22,7 @@ const ChatTextArea: React.FC<Props> = ({
|
|
|
21
22
|
onFocus,
|
|
22
23
|
onBlur,
|
|
23
24
|
}) => {
|
|
25
|
+
const { t } = useTranslation();
|
|
24
26
|
const [expanded, setExpanded] = useState(false);
|
|
25
27
|
|
|
26
28
|
return (
|
|
@@ -53,6 +55,9 @@ const ChatTextArea: React.FC<Props> = ({
|
|
|
53
55
|
onClick={() => setExpanded(!expanded)}
|
|
54
56
|
padded={false}
|
|
55
57
|
ghost
|
|
58
|
+
title={
|
|
59
|
+
expanded ? t('collapse') || 'Collapse' : t('expand') || 'Expand'
|
|
60
|
+
}
|
|
56
61
|
icon={expanded ? <FullscreenExit /> : <Expand />}
|
|
57
62
|
/>
|
|
58
63
|
</div>
|
|
@@ -17,6 +17,7 @@ exports[`renders ChatTextArea unchanged 1`] = `
|
|
|
17
17
|
>
|
|
18
18
|
<button
|
|
19
19
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
20
|
+
title="expand"
|
|
20
21
|
>
|
|
21
22
|
<span
|
|
22
23
|
class="memori-button--icon"
|
|
@@ -59,6 +60,7 @@ exports[`renders ChatTextArea with long text unchanged 1`] = `
|
|
|
59
60
|
>
|
|
60
61
|
<button
|
|
61
62
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
63
|
+
title="expand"
|
|
62
64
|
>
|
|
63
65
|
<span
|
|
64
66
|
class="memori-button--icon"
|
|
@@ -101,6 +103,7 @@ exports[`renders ChatTextArea with value unchanged 1`] = `
|
|
|
101
103
|
>
|
|
102
104
|
<button
|
|
103
105
|
class="memori-button memori-button--ghost memori-button--rounded memori-button--icon-only memori-chat-textarea--expand-button"
|
|
106
|
+
title="expand"
|
|
104
107
|
>
|
|
105
108
|
<span
|
|
106
109
|
class="memori-button--icon"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import CompletionProviderStatus, { Props } from './CompletionProviderStatus';
|
|
4
5
|
|
|
5
6
|
import './CompletionProviderStatus.css';
|
|
@@ -16,7 +17,11 @@ const meta: Meta = {
|
|
|
16
17
|
|
|
17
18
|
export default meta;
|
|
18
19
|
|
|
19
|
-
const Template: Story<Props> = args =>
|
|
20
|
+
const Template: Story<Props> = args => (
|
|
21
|
+
<I18nWrapper>
|
|
22
|
+
<CompletionProviderStatus {...args} />
|
|
23
|
+
</I18nWrapper>
|
|
24
|
+
);
|
|
20
25
|
|
|
21
26
|
export const Default = Template.bind({});
|
|
22
27
|
Default.args = {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import DateSelector, { Props } from './DateSelector';
|
|
4
5
|
|
|
5
6
|
import './DateSelector.css';
|
|
@@ -15,8 +16,11 @@ const meta: Meta = {
|
|
|
15
16
|
|
|
16
17
|
export default meta;
|
|
17
18
|
|
|
18
|
-
const Template: Story<Props> = args =>
|
|
19
|
-
|
|
19
|
+
const Template: Story<Props> = args => (
|
|
20
|
+
<I18nWrapper>
|
|
21
|
+
<DateSelector {...args} />
|
|
22
|
+
</I18nWrapper>
|
|
23
|
+
);
|
|
20
24
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
21
25
|
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
22
26
|
export const Default = Template.bind({});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
3
|
import ExportHistoryButton, { Props } from './ExportHistoryButton';
|
|
4
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
4
5
|
import { memori, history } from '../../mocks/data';
|
|
5
6
|
import Download from '../icons/Download';
|
|
6
7
|
|
|
@@ -27,15 +28,19 @@ const meta: Meta = {
|
|
|
27
28
|
export default meta;
|
|
28
29
|
|
|
29
30
|
const Template: Story<Props> = args => (
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
31
|
+
<I18nWrapper>
|
|
32
|
+
<div style={{ textAlign: 'right' }}>
|
|
33
|
+
<ExportHistoryButton {...args} />
|
|
34
|
+
</div>
|
|
35
|
+
</I18nWrapper>
|
|
33
36
|
);
|
|
34
37
|
|
|
35
38
|
const TemplateRight: Story<Props> = args => (
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
+
<I18nWrapper>
|
|
40
|
+
<div style={{ textAlign: 'left' }}>
|
|
41
|
+
<ExportHistoryButton {...args} />
|
|
42
|
+
</div>
|
|
43
|
+
</I18nWrapper>
|
|
39
44
|
);
|
|
40
45
|
|
|
41
46
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import FeedbackButtons, { Props } from './FeedbackButtons';
|
|
4
5
|
import { memori } from '../../mocks/data';
|
|
5
6
|
|
|
@@ -23,8 +24,11 @@ const meta: Meta = {
|
|
|
23
24
|
|
|
24
25
|
export default meta;
|
|
25
26
|
|
|
26
|
-
const Template: Story<Props> = args =>
|
|
27
|
-
|
|
27
|
+
const Template: Story<Props> = args => (
|
|
28
|
+
<I18nWrapper>
|
|
29
|
+
<FeedbackButtons {...args} />
|
|
30
|
+
</I18nWrapper>
|
|
31
|
+
);
|
|
28
32
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
29
33
|
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
30
34
|
export const Default = Template.bind({});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
3
|
import { memori, history } from '../../mocks/data';
|
|
4
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
4
5
|
import Header, { Props } from './Header';
|
|
6
|
+
import SettingsDrawer from '../SettingsDrawer/SettingsDrawer';
|
|
5
7
|
|
|
6
8
|
import './Header.css';
|
|
7
|
-
import SettingsDrawer from '../SettingsDrawer/SettingsDrawer';
|
|
8
9
|
|
|
9
10
|
const meta: Meta = {
|
|
10
11
|
title: 'Widget/Header',
|
|
@@ -31,7 +32,7 @@ const Template: Story<Props> = args => {
|
|
|
31
32
|
React.useState(2);
|
|
32
33
|
|
|
33
34
|
return (
|
|
34
|
-
|
|
35
|
+
<I18nWrapper>
|
|
35
36
|
<Header
|
|
36
37
|
{...args}
|
|
37
38
|
speakerMuted={speakerMuted}
|
|
@@ -51,7 +52,7 @@ const Template: Story<Props> = args => {
|
|
|
51
52
|
hideEmissions={false}
|
|
52
53
|
setHideEmissions={() => {}}
|
|
53
54
|
/>
|
|
54
|
-
|
|
55
|
+
</I18nWrapper>
|
|
55
56
|
);
|
|
56
57
|
};
|
|
57
58
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import ImageUpload, { Props } from './ImageUpload';
|
|
4
5
|
import memoriAPIClient from '@memori.ai/memori-api-client';
|
|
5
6
|
|
|
@@ -18,8 +19,11 @@ const meta: Meta = {
|
|
|
18
19
|
|
|
19
20
|
export default meta;
|
|
20
21
|
|
|
21
|
-
const Template: Story<Props> = args =>
|
|
22
|
-
|
|
22
|
+
const Template: Story<Props> = args => (
|
|
23
|
+
<I18nWrapper>
|
|
24
|
+
<ImageUpload {...args} />
|
|
25
|
+
</I18nWrapper>
|
|
26
|
+
);
|
|
23
27
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
24
28
|
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
25
29
|
export const Default = Template.bind({});
|
|
@@ -371,8 +371,11 @@ const ImageUpload: React.FC<Props> = ({
|
|
|
371
371
|
{t(
|
|
372
372
|
allowedMimeTypes
|
|
373
373
|
? 'media.uploadHelper'
|
|
374
|
-
: 'media.uploadHelperImages'
|
|
375
|
-
|
|
374
|
+
: 'media.uploadHelperImages',
|
|
375
|
+
{
|
|
376
|
+
size: maxFileSizeInMB ?? 2,
|
|
377
|
+
}
|
|
378
|
+
)}
|
|
376
379
|
</p>
|
|
377
380
|
{imageProportionsHelper && useImageCrop && (
|
|
378
381
|
<p>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import LinkItemWidget, { Props } from './LinkItemWidget';
|
|
4
5
|
|
|
5
6
|
import './LinkItemWidget.css';
|
|
@@ -15,7 +16,11 @@ const meta: Meta = {
|
|
|
15
16
|
|
|
16
17
|
export default meta;
|
|
17
18
|
|
|
18
|
-
const Template: Story<Props> = args =>
|
|
19
|
+
const Template: Story<Props> = args => (
|
|
20
|
+
<I18nWrapper>
|
|
21
|
+
<LinkItemWidget {...args} />
|
|
22
|
+
</I18nWrapper>
|
|
23
|
+
);
|
|
19
24
|
|
|
20
25
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
21
26
|
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
3
4
|
import MediaItemWidget, { Props } from './MediaItemWidget';
|
|
4
5
|
|
|
5
6
|
import './MediaItemWidget.css';
|
|
@@ -22,7 +23,11 @@ const meta: Meta = {
|
|
|
22
23
|
|
|
23
24
|
export default meta;
|
|
24
25
|
|
|
25
|
-
const Template: Story<Props> = args =>
|
|
26
|
+
const Template: Story<Props> = args => (
|
|
27
|
+
<I18nWrapper>
|
|
28
|
+
<MediaItemWidget {...args} />
|
|
29
|
+
</I18nWrapper>
|
|
30
|
+
);
|
|
26
31
|
|
|
27
32
|
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
28
33
|
// https://storybook.js.org/docs/react/workflows/unit-testing
|