Skip to content

Commit

Permalink
chore(deps): bump @stream-io/stream-chat-css to v4-rc (#2153)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnautov-anton committed Nov 2, 2023
1 parent 30d91c9 commit 030688f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 12 deletions.
8 changes: 6 additions & 2 deletions docusaurus/docs/React/components/core-components/chat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ const i18nInstance = new Streami18n({
});

<Chat client={client} i18nInstance={i18nInstance}>
{// children of Chat component}
</Chat>
{/* children of Chat component */}
</Chat>;
```

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

:::caution
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.
:::

| Type | Default |
| ------- | ------- |
| boolean | false |
15 changes: 12 additions & 3 deletions docusaurus/docs/React/release-guides/emoji-picker-v11.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const WrappedChannel = ({ children }) => {
};
```

### Build your custom `EmojiPicker` (example)
### Build your custom `EmojiPicker` (with example)

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:

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

return (
<>
<button onClick={() => setOpen((cv) => !cv)}>Open EmojiPicker</button>
<button onClick={() => setOpen((isOpen) => !isOpen)}>Open EmojiPicker</button>

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

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.

## Old `emoji-mart` (v3.0.1)

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:

```tsx
import 'stream-chat-react/css/v2/index.css';
import 'stream-chat-react/css/v2/emoji-mart.css';
```

{/_ TODO: mention EmojiContext removal _/}
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@
"require": "./dist/components/Emojis/index.cjs.js",
"import": "./dist/components/Emojis/index.js",
"default": "./dist/components/Emojis/index.js"
},
"./dist/css/*": {
"default": "./dist/css/*"
},
"./dist/scss/*": {
"default": "./dist/scss/*"
},
"./css/*": {
"default": "./dist/css/*"
},
"./scss/*": {
"default": "./dist/scss/*"
}
},
"style": "dist/css/v2/index.css",
"sideEffects": [
"*.css"
],
Expand All @@ -42,7 +53,7 @@
"dependencies": {
"@braintree/sanitize-url": "^6.0.4",
"@popperjs/core": "^2.11.5",
"@stream-io/stream-chat-css": "^3.13.0",
"@stream-io/stream-chat-css": "^4.0.0-rc.4",
"clsx": "^2.0.0",
"dayjs": "^1.10.4",
"emoji-regex": "^9.2.0",
Expand Down
5 changes: 4 additions & 1 deletion src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ export type ChatProps<
initialNavOpen?: boolean;
/** Used for injecting className/s to the Channel and ChannelList components */
theme?: string;
/** Windows 10 does not support country flag emojis out of the box. It chooses to render these emojis as characters instead. Stream
/**
* Windows 10 does not support country flag emojis out of the box. It chooses to render these emojis as characters instead. Stream
* Chat can override this behavior by loading a custom web font that will render images instead (PNGs or SVGs depending on the platform).
* Set this prop to true if you want to use these custom emojis for Windows users.
*
* Note: requires importing `stream-chat-react/css/v2/emoji-replacement.css` style sheet
*/
useImageFlagEmojisOnWindows?: boolean;
};
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2266,10 +2266,10 @@
crypto-browserify "^3.11.0"
process-es6 "^0.11.2"

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

"@stream-io/transliterate@^1.5.5":
version "1.5.5"
Expand Down

0 comments on commit 030688f

Please sign in to comment.