Skip to content

Commit 030688f

Browse files
chore(deps): bump @stream-io/stream-chat-css to v4-rc (#2153)
1 parent 30d91c9 commit 030688f

File tree

5 files changed

+39
-12
lines changed

5 files changed

+39
-12
lines changed

docusaurus/docs/React/components/core-components/chat.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ const i18nInstance = new Streami18n({
9393
});
9494

9595
<Chat client={client} i18nInstance={i18nInstance}>
96-
{// children of Chat component}
97-
</Chat>
96+
{/* children of Chat component */}
97+
</Chat>;
9898
```
9999

100100
| Type |
@@ -123,6 +123,10 @@ Windows 10 does not support country flag emojis out of the box. It chooses to re
123123
Stream Chat can override this behavior by loading a custom web font that will render images instead (PNGs or SVGs depending
124124
on the platform). Set this prop to true if you want to use these custom emojis for Windows users.
125125

126+
:::caution
127+
If you're moving from older versions to `11.0.0` then make sure to import related stylesheet from `stream-chat-react/css/v2/emoji-replacement.css` as it has been removed from our main stylesheet to reduce final bundle size for integrators who do not wish to use this feature.
128+
:::
129+
126130
| Type | Default |
127131
| ------- | ------- |
128132
| boolean | false |

docusaurus/docs/React/release-guides/emoji-picker-v11.mdx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const WrappedChannel = ({ children }) => {
4242
};
4343
```
4444

45-
### Build your custom `EmojiPicker` (example)
45+
### Build your custom `EmojiPicker` (with example)
4646

4747
If `emoji-mart` is too heavy for your use-case and you'd like to build your own you can certainly do so, here's a simple `EmojiPicker` built using `emoji-picker-react` package:
4848

@@ -57,12 +57,12 @@ export const CustomEmojiPicker = () => {
5757

5858
return (
5959
<>
60-
<button onClick={() => setOpen((cv) => !cv)}>Open EmojiPicker</button>
60+
<button onClick={() => setOpen((isOpen) => !isOpen)}>Open EmojiPicker</button>
6161

6262
{open && (
6363
<EmojiPicker
6464
onEmojiClick={(emoji, event) => {
65-
insertText(e.native);
65+
insertText(emoji.native);
6666
textareaRef.current?.focus(); // returns focus back to the message input element
6767
}}
6868
/>
@@ -76,4 +76,13 @@ export const CustomEmojiPicker = () => {
7676

7777
You can make the component slightly better using [`FloatingUI`](https://floating-ui.com/) by wrapping the actual picker element to make it float perfectly positioned above the button. See the [source of the component (`EmojiPicker`)]() which comes with the SDK for inspiration.
7878

79+
## Old `emoji-mart` (v3.0.1)
80+
81+
Even though it's not explicitly provided by our SDK anymore, it's still possible for our integrators to use older version of the `emoji-mart` - specifically version `3.0.1` on top of which our old components were built. We don't recommend using old version of the `emoji-mart` but if you really need to, follow the [`3.0.1` documentation](https://github.com/missive/emoji-mart/tree/v3.0.1#picker) in combination with the previous guide to build your own `EmojiPicker` component with the old `emoji-mart` API. Beware though, if you wish to use slightly modified `emoji-mart` CSS previously supplied by our SDK by default in the main `index.css` file, you'll now have to explicitly import it:
82+
83+
```tsx
84+
import 'stream-chat-react/css/v2/index.css';
85+
import 'stream-chat-react/css/v2/emoji-mart.css';
86+
```
87+
7988
{/_ TODO: mention EmojiContext removal _/}

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,20 @@
2424
"require": "./dist/components/Emojis/index.cjs.js",
2525
"import": "./dist/components/Emojis/index.js",
2626
"default": "./dist/components/Emojis/index.js"
27+
},
28+
"./dist/css/*": {
29+
"default": "./dist/css/*"
30+
},
31+
"./dist/scss/*": {
32+
"default": "./dist/scss/*"
33+
},
34+
"./css/*": {
35+
"default": "./dist/css/*"
36+
},
37+
"./scss/*": {
38+
"default": "./dist/scss/*"
2739
}
2840
},
29-
"style": "dist/css/v2/index.css",
3041
"sideEffects": [
3142
"*.css"
3243
],
@@ -42,7 +53,7 @@
4253
"dependencies": {
4354
"@braintree/sanitize-url": "^6.0.4",
4455
"@popperjs/core": "^2.11.5",
45-
"@stream-io/stream-chat-css": "^3.13.0",
56+
"@stream-io/stream-chat-css": "^4.0.0-rc.4",
4657
"clsx": "^2.0.0",
4758
"dayjs": "^1.10.4",
4859
"emoji-regex": "^9.2.0",

src/components/Chat/Chat.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ export type ChatProps<
5353
initialNavOpen?: boolean;
5454
/** Used for injecting className/s to the Channel and ChannelList components */
5555
theme?: string;
56-
/** Windows 10 does not support country flag emojis out of the box. It chooses to render these emojis as characters instead. Stream
56+
/**
57+
* Windows 10 does not support country flag emojis out of the box. It chooses to render these emojis as characters instead. Stream
5758
* Chat can override this behavior by loading a custom web font that will render images instead (PNGs or SVGs depending on the platform).
5859
* Set this prop to true if you want to use these custom emojis for Windows users.
60+
*
61+
* Note: requires importing `stream-chat-react/css/v2/emoji-replacement.css` style sheet
5962
*/
6063
useImageFlagEmojisOnWindows?: boolean;
6164
};

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,10 +2266,10 @@
22662266
crypto-browserify "^3.11.0"
22672267
process-es6 "^0.11.2"
22682268

2269-
"@stream-io/stream-chat-css@^3.13.0":
2270-
version "3.13.0"
2271-
resolved "https://registry.yarnpkg.com/@stream-io/stream-chat-css/-/stream-chat-css-3.13.0.tgz#3c49d17baeddf9d48b4fea377387eca23663b5fe"
2272-
integrity sha512-dF0VauSvAVeq+71z9zIru2Jpaj9D3yMK5S2+o1RGApYvGXkl07nS3vcPXv9btZ6c1RFskoVnzG/2xb42P0nleA==
2269+
"@stream-io/stream-chat-css@^4.0.0-rc.4":
2270+
version "4.0.0-rc.4"
2271+
resolved "https://registry.yarnpkg.com/@stream-io/stream-chat-css/-/stream-chat-css-4.0.0-rc.4.tgz#672f7af5930dd622feb102b03130f3486342339b"
2272+
integrity sha512-pw2A1R8oUml3X3cznsVWNU7CrUbTlf9R6KZCB4XwCjpigi5u0jXK3Y0fqrXnCK0FwXVCmM5oj+y7w01wmZ8NZQ==
22732273

22742274
"@stream-io/transliterate@^1.5.5":
22752275
version "1.5.5"

0 commit comments

Comments
 (0)