Skip to content

Commit a0c1c24

Browse files
authored
Merge pull request #2028 from GetStream/develop
v10.8.2
2 parents 04f6caf + 392783f commit a0c1c24

File tree

14 files changed

+382
-218
lines changed

14 files changed

+382
-218
lines changed

SECURITY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Reporting a Vulnerability
2+
At Stream we are committed to the security of our Software. We appreciate your efforts in disclosing vulnerabilities responsibly and we will make every effort to acknowledge your contributions.
3+
4+
Report security vulnerabilities at the following email address:
5+
```
6+
7+
```
8+
Alternatively it is also possible to open a new issue in the affected repository, tagging it with the `security` tag.
9+
10+
A team member will acknowledge the vulnerability and will follow-up with more detailed information. A representative of the security team will be in touch if more information is needed.
11+
12+
# Information to include in a report
13+
While we appreciate any information that you are willing to provide, please make sure to include the following:
14+
* Which repository is affected
15+
* Which branch, if relevant
16+
* Be as descriptive as possible, the team will replicate the vulnerability before working on a fix.

docusaurus/docs/React/components/contexts/chat-context.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Deprecated and to be removed in a future major release. Use the `customStyles` p
109109

110110
### themeVersion
111111

112-
Stream chat theme version 2 has been introduced with the release of stream-chat-react v10.0.0. This flag is used internally by some UI components of the SDK and the integrators shouldn't need to use it. The value is extracted from a CSS variable `--str-chat__theme-version`. You can set it to values `'1'` or `'2'` in your stylesheets and import the corresponding v2 stylesheet from `stream-chat-react/dist`. Find out more about benefits that the theme version 2 brings to the integrators with [the theming guide](../../guides/theming/css-and-theming.mdx).
112+
Stream chat theme version 2 has been introduced with the release of stream-chat-react v10.0.0. This flag is used internally by some UI components of the SDK and the integrators shouldn't need to use it. The value is extracted from a CSS variable `--str-chat__theme-version`. You can set it to values `'1'` or `'2'` in your stylesheets and import the corresponding v2 stylesheet from `stream-chat-react/dist`. Find out more about benefits that the theme version 2 brings to the integrators with [the theming guide](../../theming/introduction.mdx).
113113

114114
| Type | Default |
115115
| -------------- | --------- |

docusaurus/docs/React/components/contexts/component-context.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Custom UI component to display the header of a `Thread`.
295295

296296
### ThreadInput
297297

298-
Custom UI component to replace the `MessageInput` of a `Thread`. For the applications using [theme version](../../guides/theming/css-and-theming.mdx) 1, the default is `MessageInputSmall`. Applications using theme version 2 will use `MessageInputFlat` by default.
298+
Custom UI component to replace the `MessageInput` of a `Thread`. For the applications using [theme version 1](../../guides/theming/css-and-theming.mdx), the default is `MessageInputSmall`. Applications using [theme version 2](../../theming/introduction.mdx) will use `MessageInputFlat` by default.
299299

300300
| Type | Default |
301301
| --------- | ------------------------------------------------------------------------------------------------------------------ |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ Custom UI component to display the header of a `Thread`.
546546

547547
### ThreadInput
548548

549-
Custom UI component to replace the `MessageInput` of a `Thread`. For the applications using [theme version](../../guides/theming/css-and-theming.mdx) 1, the default is `MessageInputSmall`. Applications using theme version 2 will use `MessageInputFlat` by default.
549+
Custom UI component to replace the `MessageInput` of a `Thread`. For the applications using [theme version 1](../../guides/theming/css-and-theming.mdx), the default is `MessageInputSmall`. Applications using [theme version 2](../../theming/introduction.mdx) will use `MessageInputFlat` by default.
550550

551551
| Type | Default |
552552
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ If true, displays the thread at 100% width of its parent container, useful for m
180180

181181
### Input
182182

183-
Custom thread input UI component used to override the optional `Input` value stored in `ComponentContext` or the default. For the applications using [theme version](../../guides/theming/css-and-theming.mdx) 1, the default is `MessageInputSmall`. Applications using theme version 2 will use `MessageInputFlat` by default.
183+
Custom thread input UI component used to override the optional `Input` value stored in `ComponentContext` or the default. For the applications using [theme version 1](../../guides/theming/css-and-theming.mdx), the default is `MessageInputSmall`. Applications using [theme version 2](../../theming/introduction.mdx) will use `MessageInputFlat` by default.
184184

185185
| Type | Default |
186186
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

docusaurus/docs/React/components/message-components/attachment.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ The following section details how the width and height of images and videos uplo
111111
112112
#### Maximum size
113113
114-
You can control the maximum width and height of images and videos with the [`--str-chat__attachment-max-width`](../../guides/theming/css-and-theming.mdx) CSS variable (available only in [theme-v2](../../guides/theming/css-and-theming.mdx)). The value of this variable must be a value that can be computed to a valid pixel value using the [`getComputedStyle`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle) method (for example: `300px`, `10rem`, `calc(300px - var(--margin))`, but not `100%`). If you provide an invalid value, the image and video sizing can break, which can lead to scrolling issues inside the message list (for example the message list isn't scrolled to the bottom when you open a channel).
114+
You can control the maximum width and height of images and videos with the [`--str-chat__attachment-max-width`](../../theming/component-variables.mdx) CSS variable (available only in [theme-v2](../../theming/introduction.mdx)). The value of this variable must be a value that can be computed to a valid pixel value using the [`getComputedStyle`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle) method (for example: `300px`, `10rem`, `calc(300px - var(--margin))`, but not `100%`). If you provide an invalid value, the image and video sizing can break, which can lead to scrolling issues inside the message list (for example the message list isn't scrolled to the bottom when you open a channel).
115115
116116
If you set an invalid value to the variable, you'll see a warning on the browser's console:
117117
@@ -125,7 +125,7 @@ For example if an image has `max-width` and `max-height` set to `300px` and the
125125
126126
#### Aspect ratio
127127
128-
The following description is applicable for [theme-v2](../../guides/theming/css-and-theming.mdx).
128+
The following description is applicable for [theme-v2](../../theming/introduction.mdx).
129129
130130
The SDK will try to display images and videos with their original aspect ratio, however this isn't always guaranteed (in those cases a cropped image will be displayed). Three notable exceptions are:
131131

docusaurus/docs/React/components/utility-components/channel-search.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The `ChannelSearch` component renders 2 components:
4949
1. the search input
5050
2. the search results list
5151

52-
If opted in the use of [theme version 2](../../guides/theming/css-and-theming.mdx), the `ChannelSearch` will render a more complex search input component called [`SearchBar`](./#searchbar-component). Otherwise, the [`SearchInput`](./#searchinput-component) is rendered.
52+
If opted in the use of [theme version 2](../../theming/introduction.mdx), the `ChannelSearch` will render a more complex search input component called [`SearchBar`](./#searchbar-component). Otherwise, the [`SearchInput`](./#searchinput-component) is rendered.
5353

5454
### Search input vs.SearchResults state
5555

@@ -158,7 +158,7 @@ The `ChannelSearch` offers possibility to keep the search results open meanwhile
158158

159159
### AppMenu
160160

161-
Application menu / drop-down to be displayed when clicked on [`MenuIcon`](./#menuicon). Prop is consumed only by the [`SearchBar` component](./#searchbar). The `SearchBar` component is only available with the use of the [theming v2](../../guides/theming/css-and-theming.mdx). No default component is provided by the SDK. The library does not provide any CSS for `AppMenu`. Consult the customization tutorial on how to [add AppMenu to your application](../../guides/customization/channel-search.mdx/#adding-menu). The component is passed a prop `close`, which is a function that can be called to hide the app menu (e.g. on menu item selection).
161+
Application menu / drop-down to be displayed when clicked on [`MenuIcon`](./#menuicon). Prop is consumed only by the [`SearchBar` component](./#searchbar). The `SearchBar` component is only available with the use of the [theming v2](../../theming/introduction.mdx). No default component is provided by the SDK. The library does not provide any CSS for `AppMenu`. Consult the customization tutorial on how to [add AppMenu to your application](../../guides/customization/channel-search.mdx/#adding-menu). The component is passed a prop `close`, which is a function that can be called to hide the app menu (e.g. on menu item selection).
162162

163163
| Type | Default |
164164
|-----------------------|-------------|

docusaurus/docs/React/guides/theming/css-and-theming.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Theming2 from '../../assets/Theming2.png';
1010
import Theming3 from '../../assets/Theming3.png';
1111

1212
:::caution
13-
This page contains information about the old theming system (v1) of the chat UI, this is now deprecated and will be removed in a future release. Please refer to our [new theming guide](./css-and-theming.mdx).
13+
This page contains information about the old theming system (v1) of the chat UI, this is now deprecated and will be removed in a future release. Please refer to our [new theming guide](../../theming/introduction.mdx).
1414
:::
1515

1616
While the components in the React Chat library come with basic styling, the look and feel can easily be adjusted to fit

docusaurus/docs/React/guides/theming/translations.mdx

Lines changed: 118 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ The `setLanguage` method on the class instance of `Streami18n` is asynchronous,
149149
awaited before the language translations can be updated.
150150
:::
151151

152+
We can initialize the instance dynamically:
153+
152154
```tsx
153155
import zhTranslation from 'path/to/zh.json';
154156

@@ -177,6 +179,111 @@ const App = () => {
177179
};
178180
```
179181

182+
Or we can have a pre-configured `Streami18n` instance:
183+
184+
```tsx
185+
import zhTranslation from 'path/to/zh.json';
186+
187+
const i18nInstance = new Streami18n({
188+
language: 'zh',
189+
translationsForLanguage: zhTranslations,
190+
dayjsLocaleConfigForLanguage: {
191+
// see the next section about Datetime translations
192+
months: [...],
193+
monthsShort: [...],
194+
calendar: {
195+
sameDay: ...'
196+
}
197+
}
198+
});
199+
200+
const App = () => {
201+
return (
202+
<Chat client={client} i18nInstance={i18nInstance}>
203+
...
204+
</Chat>
205+
);
206+
};
207+
```
208+
209+
### Datetime translations
210+
211+
The SDK components use [`Dayjs`](https://day.js.org/en/) internally by default to format dates and times. It has [locale support](https://day.js.org/docs/en/i18n/i18n) being a lightweight alternative to `Momentjs` with the same modern API. `Dayjs` provides [locale config for plenty of languages](https://github.com/iamkun/dayjs/tree/dev/src/locale).
212+
213+
You can either provide the `Dayjs` locale config while registering language with `Streami18n` (either via constructor or `registerTranslation()`) or you can provide your own `Dayjs` or `Momentjs` instance to `Streami18n` constructor, which will be then used internally (using the language locale) in components.
214+
215+
:::note
216+
The `dayjsLocaleConfigForLanguage` object is a union of configuration objects for [`Dayjs` calendar plugin](https://day.js.org/docs/en/plugin/calendar) and `Dayjs` locale configuration(examples are available in [`Dayjs` default locale configurations](https://github.com/iamkun/dayjs/tree/dev/src/locale))
217+
:::
218+
219+
1. Via language registration
220+
221+
```js
222+
const i18n = new Streami18n({
223+
language: 'nl',
224+
dayjsLocaleConfigForLanguage: {
225+
months: [...],
226+
monthsShort: [...],
227+
calendar: {
228+
sameDay: ...'
229+
}
230+
}
231+
});
232+
```
233+
234+
Similarly, you can add locale config for `Momentjs` while registering translation via `registerTranslation` function.
235+
236+
```js
237+
const i18n = new Streami18n();
238+
239+
i18n.registerTranslation(
240+
'mr',
241+
{
242+
'Nothing yet...': 'काहीही नाही ...',
243+
'{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} आणि {{ secondUser }} टीपी करत आहेत ',
244+
},
245+
{
246+
months: [...],
247+
monthsShort: [...],
248+
calendar: {
249+
sameDay: ...'
250+
}
251+
}
252+
);
253+
```
254+
2. Provide your own `Momentjs` object
255+
256+
```js
257+
import 'moment/locale/nl';
258+
import 'moment/locale/it';
259+
// or if you want to include all locales
260+
import 'moment/min/locales';
261+
262+
import Moment from moment
263+
264+
const i18n = new Streami18n({
265+
language: 'nl',
266+
DateTimeParser: Moment
267+
})
268+
```
269+
270+
3. Provide your own Dayjs object
271+
272+
```js
273+
import Dayjs from 'dayjs'
274+
275+
import 'dayjs/locale/nl';
276+
import 'dayjs/locale/it';
277+
// or if you want to include all locales
278+
import 'dayjs/min/locales';
279+
280+
const i18n = new Streami18n({
281+
language: 'nl',
282+
DateTimeParser: Dayjs
283+
})
284+
```
285+
If you would like to stick with english language for dates and times in Stream components, you can set `disableDateTimeTranslations` to true.
286+
180287
### Translating Messages
181288
182289
Stream Chat provide the ability to run users' messages through automatic translation.
@@ -199,15 +306,17 @@ The `Streami18n` class wraps [`i18next`](https://www.npmjs.com/package/i18next)
199306
200307
### Class Constructor Options
201308
202-
| Option | Description | Type | Default |
203-
| ---------------------------- | ------------------------------------------------------------------------------------ | -------- | ---------- |
204-
| language | connected user's language | string | 'en' |
205-
| translationsForLanguage | overrides existing component text | object | {} |
206-
| disableDateTimeTranslations | disables translation of date times | boolean | false |
207-
| debug | enables i18n debug mode | boolean | false |
208-
| logger | logs warnings/errors | function | () => {} |
209-
| dayjsLocaleConfigForLanguage | internal Day.js [config object](https://github.com/iamkun/dayjs/tree/dev/src/locale) | object | 'enConfig' |
210-
| DateTimeParser | custom date time parser | function | Day.js |
309+
| Option | Description | Type | Default |
310+
|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------|
311+
| language | connected user's language | string | 'en' |
312+
| translationsForLanguage | overrides existing component text | object | {} |
313+
| disableDateTimeTranslations | disables translation of date times | boolean | false |
314+
| debug | enables i18n debug mode | boolean | false |
315+
| logger | logs warnings/errors | function | () => {} |
316+
| dayjsLocaleConfigForLanguage | internal Day.js [config object](https://github.com/iamkun/dayjs/tree/dev/src/locale) and [calendar locale config object](https://day.js.org/docs/en/plugin/calendar) | object | 'enConfig' |
317+
| DateTimeParser | custom date time parser | function | Day.js |
318+
319+
####
211320
212321
### Class Instance Methods
213322

docusaurus/docs/React/release-guides/upgrade-to-v10.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import EmptyChannelList from '../assets/theme-v2-empty-channel-list.png';
1818
import EmptyMessageList from '../assets/theme-v2-empty-message-list.png';
1919
import ScrollToBottomButton from '../assets/theme-v2-scroll-to-bottom-button-theme-v1.png';
2020

21-
The release v10 brings some new features as well as some breaking changes to the users. The main focus was to support [the next version of theming V2](../guides/theming/css-and-theming.mdx) brought with `@stream-io/[email protected]`. It lead to addition resp. removal of some HTML elements in few components. This may invalidate some of your CSS selectors. Also, some components marked as deprecated for a longer period of time have been removed.
21+
The release v10 brings some new features as well as some breaking changes to the users. The main focus was to support [the next version of theming V2](../theming/introduction.mdx) brought with `@stream-io/[email protected]`. It lead to addition resp. removal of some HTML elements in few components. This may invalidate some of your CSS selectors. Also, some components marked as deprecated for a longer period of time have been removed.
2222

2323
We have tried to introduce as few breaking changes as possible. We have not removed classes but rather added new ones that are exclusively used with the theming V2 stylesheet. Also, where possible, V1 and V2 components have been introduced for backwards compatibility (the V1 components are used unless opted into theme version 2).
2424

0 commit comments

Comments
 (0)