Skip to content

Commit 880a28b

Browse files
committed
Merge branch 'feat/state-mgmt-migration-1' of github.com:sendbird/sendbird-uikit-react into feat/state-mgmt-migration-1
2 parents 7b13339 + f18d998 commit 880a28b

File tree

103 files changed

+4437
-2279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4437
-2279
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ yarn-error.log*
4040

4141
# docs
4242
/docs
43+
44+
# Snapshot test data
45+
/playwright-report/
46+
/playwright/.cache/
47+
/test-results/
48+
/blob-report/

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
# Changelog - v3
22

3+
## [v3.15.7] (Oct 24th, 2024)
4+
5+
### Features:
6+
- **Added support for new file types and extensions.**
7+
- **Added mime types:** `'application/zip', 'application/x-rar-compressed', 'application/x-7z-compressed', 'application/x-tar', 'application/gzip', 'application/x-bzip', 'application/x-bzip2', 'application/x-xz', 'application/x-iso9660-image'`
8+
- **Added extensions:**
9+
- **Image:** `'.apng', '.avif', '.gif', '.jpg', '.jpeg', '.jfif', '.pjpeg', '.pjp', '.png', '.svg', '.webp', '.bmp', '.ico', '.cur', '.tif', '.tiff'`
10+
- **Video:** `'.mp4', '.webm', '.ogv', '.3gp', '.3g2', '.avi', '.mov', '.wmv', '.mpg', '.mpeg', '.m4v', '.mkv'`
11+
- **Audio:** `'.aac', '.midi', '.mp3', '.oga', '.opus', '.wav', '.weba', '.3gp', '.3g2'`
12+
- **Document:** `'.txt', '.log', '.csv', '.rtf', '.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'`
13+
- **Archive:** `'.zip', '.rar', '.7z', '.tar', '.gz', '.bz2', '.xz', '.iso'`
14+
- **Enhanced MessageBody rendering support:**
15+
- Added support for `.bmp` files as `ThumbnailMessage`
16+
- Added support for `.heic` files as `FileMessage` for cross-browser consistency
17+
18+
### Fixes:
19+
- Fixed an issue where the `OpenChannel` message list scroll would not move upon initialization **on mobile browsers**.
20+
- Fixed an issue where the `MessageInput` failed to auto-scroll when pasting text.
21+
- Fixed an issue where ASCII characters appeared in the `MessageInput` when pasting non-English text.
22+
23+
## [v3.15.6] (Oct 11th, 2024)
24+
25+
### Features:
26+
- Exported `useLocalization` Hook:
27+
- Provided access to stringSet and dateLocale.
28+
- Note: Required SendbirdProvider to wrap your component for proper usage.
29+
- Import Path: `"@sendbird/uikit-react/hooks/useLocalization"`
30+
- Exported `ThreadReplySelectType`:
31+
- Import Paths:
32+
- `"@sendbird/uikit-react/Channel/context"`
33+
- `"@sendbird/uikit-react/GroupChannel/context"`
34+
35+
### Fixes
36+
- Modified the `MessageInput` to scroll to the caret position when pasting text.
37+
- The maximum height of the `MessageInput` has been extended to `'92px'`
38+
- Fixed an `error message` on `MenuItemAction` when the children prop is `undefined`
39+
40+
## [v3.15.5] (Oct 4th, 2024)
41+
42+
### Updates
43+
- Usage of template message feature:
44+
1. Template data in message
45+
- removed: A message with valid `extendedMessagePayload.template` value will be displayed with `TemplateMessageItemBody`.
46+
- added: A message with valid `extendedMessagePayload.message_template` value will be displayed with `TemplateMessageItemBody`.
47+
2. Container type data in message
48+
- removed: Added 'wide' width support for `MessageContent` when value exists in `message.extendedMessagePayload['ui']['container_type']`
49+
- added: Added support for template message rendering options (boolean type): `profile`, `time`, and `nickname` in `extendedMessagePayload['message_template']['container_options']`
50+
351
## [v3.15.4] (Sep 26th, 2024)
452

553
### Features
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export interface MockMessageFormItemProps {
2+
name: string;
3+
required?: boolean;
4+
sort_order: number;
5+
placeholder?: string;
6+
style: object;
7+
values?: string[];
8+
validators?: object[];
9+
draft_values?: string[];
10+
}
11+
12+
export interface MockMessageFormProps {
13+
name?: string;
14+
items: MockMessageFormItemProps[];
15+
}
16+
17+
export interface FormFixtureProps {
18+
name: string;
19+
form: MockMessageFormProps;
20+
}
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
import { test } from '@playwright/test';
2+
3+
import { assertScreenshot, fillForm, runBeforeEach, testDraftValues } from '../utils';
4+
import { MockMessageFormProps } from '../__fixtures__/form/interface';
5+
6+
runBeforeEach();
7+
8+
// 201: Form with one text input (no fill), one text area input (no fill), and one chip input (no select)
9+
test('201', async ({ page }) => {
10+
const form: MockMessageFormProps = {
11+
name: 'test form',
12+
items: [
13+
{
14+
name: 'Text form',
15+
required: true,
16+
sort_order: 0,
17+
placeholder: 'Text hint',
18+
style: {
19+
layout: 'text',
20+
},
21+
draft_values: [],
22+
},
23+
{
24+
name: 'Textarea form',
25+
required: true,
26+
sort_order: 0,
27+
placeholder: 'Textarea hint',
28+
style: {
29+
layout: 'textarea',
30+
},
31+
},
32+
{
33+
name: 'Chip form',
34+
required: true,
35+
sort_order: 0,
36+
style: {
37+
layout: 'chip',
38+
options: [
39+
'Chip1',
40+
'Chip2',
41+
'Chip3',
42+
'Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4'
43+
+ 'Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4',
44+
],
45+
},
46+
},
47+
],
48+
};
49+
await fillForm(page, JSON.stringify(form));
50+
await testDraftValues(page, form);
51+
await assertScreenshot(page);
52+
});
53+
54+
// 202: Form with one text input (no fill), one text input (no fill, not required)
55+
test('202', async ({ page }) => {
56+
const form: MockMessageFormProps = {
57+
name: 'test form',
58+
items: [
59+
{
60+
name: 'Text form 1',
61+
required: true,
62+
sort_order: 0,
63+
placeholder: 'Text 1 hint',
64+
style: {
65+
layout: 'text',
66+
},
67+
},
68+
{
69+
name: 'Text form 1',
70+
required: false,
71+
sort_order: 1,
72+
placeholder: 'Text 2 hint',
73+
style: {
74+
layout: 'text',
75+
},
76+
},
77+
],
78+
};
79+
await fillForm(page, JSON.stringify(form));
80+
await testDraftValues(page, form);
81+
await assertScreenshot(page);
82+
});
83+
84+
// 203: Form with one text area input (no fill), one text area input (no fill, not required) and one chip input (no select)
85+
test('203', async ({ page }) => {
86+
const form: MockMessageFormProps = {
87+
name: 'test form',
88+
items: [
89+
{
90+
name: 'Textarea form 1',
91+
required: true,
92+
sort_order: 0,
93+
placeholder: 'Textarea 1 hint',
94+
style: {
95+
layout: 'textarea',
96+
},
97+
},
98+
{
99+
name: 'Textarea form 2',
100+
required: false,
101+
sort_order: 1,
102+
placeholder: 'Textarea 2 hint',
103+
style: {
104+
layout: 'textarea',
105+
},
106+
},
107+
],
108+
};
109+
await fillForm(page, JSON.stringify(form));
110+
await testDraftValues(page, form);
111+
await assertScreenshot(page);
112+
});
113+
114+
// 204: Form with one chip input (no select), and one chip input (select one chip)
115+
test('204', async ({ page }) => {
116+
const form: MockMessageFormProps = {
117+
name: 'test form',
118+
items: [
119+
{
120+
name: 'Chip form 1',
121+
required: true,
122+
sort_order: 0,
123+
style: {
124+
layout: 'chip',
125+
options: [
126+
'Chip1',
127+
'Chip2',
128+
'Chip3',
129+
'Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4Chip4',
130+
],
131+
},
132+
},
133+
{
134+
name: 'Chip form 2',
135+
required: true,
136+
sort_order: 1,
137+
style: {
138+
layout: 'chip',
139+
options: [
140+
'Chip5',
141+
'Chip6',
142+
'Chip7',
143+
'Chip8',
144+
],
145+
default_options: [
146+
'Chip5',
147+
],
148+
},
149+
},
150+
{
151+
name: 'Chip form 3',
152+
required: true,
153+
sort_order: 2,
154+
style: {
155+
layout: 'chip',
156+
options: [
157+
'Chip9',
158+
'Chip10',
159+
'Chip11',
160+
'Chip12',
161+
],
162+
},
163+
},
164+
],
165+
};
166+
await fillForm(page, JSON.stringify(form));
167+
await testDraftValues(page, form);
168+
await assertScreenshot(page);
169+
});
14.3 KB
Loading
17.1 KB
Loading
7.25 KB
Loading
9.16 KB
Loading
9.45 KB
Loading
11.9 KB
Loading

0 commit comments

Comments
 (0)