You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
Copy file name to clipboardExpand all lines: docusaurus/docs/React/components/contexts/chat-context.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ Deprecated and to be removed in a future major release. Use the `customStyles` p
109
109
110
110
### themeVersion
111
111
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).
Copy file name to clipboardExpand all lines: docusaurus/docs/React/components/contexts/component-context.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,7 +295,7 @@ Custom UI component to display the header of a `Thread`.
295
295
296
296
### ThreadInput
297
297
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.
Copy file name to clipboardExpand all lines: docusaurus/docs/React/components/core-components/channel.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -546,7 +546,7 @@ Custom UI component to display the header of a `Thread`.
546
546
547
547
### ThreadInput
548
548
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.
Copy file name to clipboardExpand all lines: docusaurus/docs/React/components/core-components/thread.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,7 @@ If true, displays the thread at 100% width of its parent container, useful for m
180
180
181
181
### Input
182
182
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.
Copy file name to clipboardExpand all lines: docusaurus/docs/React/components/message-components/attachment.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ The following section details how the width and height of images and videos uplo
111
111
112
112
#### Maximum size
113
113
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).
115
115
116
116
If you set an invalid value to the variable, you'll see a warning on the browser's console:
117
117
@@ -125,7 +125,7 @@ For example if an image has `max-width` and `max-height` set to `300px` and the
125
125
126
126
#### Aspect ratio
127
127
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).
129
129
130
130
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:
Copy file name to clipboardExpand all lines: docusaurus/docs/React/components/utility-components/channel-search.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ The `ChannelSearch` component renders 2 components:
49
49
1. the search input
50
50
2. the search results list
51
51
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.
53
53
54
54
### Search input vs.SearchResults state
55
55
@@ -158,7 +158,7 @@ The `ChannelSearch` offers possibility to keep the search results open meanwhile
158
158
159
159
### AppMenu
160
160
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).
Copy file name to clipboardExpand all lines: docusaurus/docs/React/guides/theming/css-and-theming.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ import Theming2 from '../../assets/Theming2.png';
10
10
importTheming3from'../../assets/Theming3.png';
11
11
12
12
:::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).
14
14
:::
15
15
16
16
While the components in the React Chat library come with basic styling, the look and feel can easily be adjusted to fit
Copy file name to clipboardExpand all lines: docusaurus/docs/React/guides/theming/translations.mdx
+118-9Lines changed: 118 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,8 @@ The `setLanguage` method on the class instance of `Streami18n` is asynchronous,
149
149
awaited before the language translations can be updated.
150
150
:::
151
151
152
+
We can initialize the instance dynamically:
153
+
152
154
```tsx
153
155
importzhTranslationfrom'path/to/zh.json';
154
156
@@ -177,6 +179,111 @@ const App = () => {
177
179
};
178
180
```
179
181
182
+
Or we can have a pre-configured `Streami18n` instance:
183
+
184
+
```tsx
185
+
importzhTranslationfrom'path/to/zh.json';
186
+
187
+
const i18nInstance =newStreami18n({
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
+
constApp= () => {
201
+
return (
202
+
<Chatclient={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
+
consti18n=newStreami18n({
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
+
consti18n=newStreami18n();
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
+
importMomentfrommoment
263
+
264
+
consti18n=newStreami18n({
265
+
language: 'nl',
266
+
DateTimeParser: Moment
267
+
})
268
+
```
269
+
270
+
3. Provide your own Dayjs object
271
+
272
+
```js
273
+
importDayjsfrom'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
+
consti18n=newStreami18n({
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
+
180
287
### Translating Messages
181
288
182
289
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)
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.
22
22
23
23
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).
0 commit comments