react-peer-chat 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -8
- package/{build → dist}/index.d.ts +1 -1
- package/package.json +42 -41
- /package/{build → dist}/icons.d.ts +0 -0
- /package/{build → dist}/icons.js +0 -0
- /package/{build → dist}/index.js +0 -0
- /package/{build → dist}/storage.d.ts +0 -0
- /package/{build → dist}/storage.js +0 -0
- /package/{build → dist}/styles.css +0 -0
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ It also exports a `clearChat` function that clears the text chat whenever invoke
|
|
|
33
33
|
```jsx
|
|
34
34
|
import React from 'react';
|
|
35
35
|
import Chat, { clearChat } from 'react-peer-chat';
|
|
36
|
-
import 'react-peer-chat/
|
|
36
|
+
import 'react-peer-chat/dist/styles.css';
|
|
37
37
|
|
|
38
38
|
export default function App() {
|
|
39
39
|
return <div>
|
|
@@ -51,7 +51,7 @@ export default function App() {
|
|
|
51
51
|
```jsx
|
|
52
52
|
import React from 'react';
|
|
53
53
|
import Chat, { clearChat } from 'react-peer-chat';
|
|
54
|
-
import 'react-peer-chat/
|
|
54
|
+
import 'react-peer-chat/dist/styles.css';
|
|
55
55
|
|
|
56
56
|
export default function App() {
|
|
57
57
|
return <div>
|
|
@@ -70,7 +70,7 @@ Use props provided by `<Chat>` component to customize it.
|
|
|
70
70
|
```jsx
|
|
71
71
|
import React from 'react';
|
|
72
72
|
import Chat from 'react-peer-chat';
|
|
73
|
-
import 'react-peer-chat/
|
|
73
|
+
import 'react-peer-chat/dist/styles.css';
|
|
74
74
|
|
|
75
75
|
export default function App() {
|
|
76
76
|
return <Chat
|
|
@@ -92,7 +92,7 @@ Use Function as Children(FoC) to fully customize the `<Chat>` component.
|
|
|
92
92
|
```jsx
|
|
93
93
|
import React from 'react'
|
|
94
94
|
import Chat from 'react-peer-chat'
|
|
95
|
-
// import 'react-peer-chat/
|
|
95
|
+
// import 'react-peer-chat/dist/styles.css' (No need to import CSS when using custom component)
|
|
96
96
|
|
|
97
97
|
export default function App() {
|
|
98
98
|
return <Chat
|
|
@@ -122,10 +122,10 @@ Here is the full API for the `<Chat>` component, these properties can be set on
|
|
|
122
122
|
| `voice` | `boolean` | No | `true` | Voice chat will be enabled if this property is set to true. |
|
|
123
123
|
| `peerOptions` | [`PeerOptions`](#PeerOptions) | No | - | Options to customize peerjs Peer instance. |
|
|
124
124
|
| `dialogOptions` | [`DialogOptions`](#DialogOptions) | No | { position: 'center' } | Options to customize text dialog box styling. |
|
|
125
|
-
| `onError` | `Function` | No | `() => alert('Browser not supported! Try some other browser.')` | Function to be executed if browser doesn't support
|
|
125
|
+
| `onError` | `Function` | No | `() => alert('Browser not supported! Try some other browser.')` | Function to be executed if browser doesn't support `WebRTC` |
|
|
126
126
|
| `onMicError` | `Function` | No | `() => alert('Microphone not accessible!')` | Function to be executed when microphone is not accessible. |
|
|
127
127
|
| `props` | `React.DetailedHTMLProps` | No | - | Props to customize the `<Chat>` component. |
|
|
128
|
-
| `children` | [`Children`](#Children) | No | - |
|
|
128
|
+
| `children` | [`Children`](#Children) | No | - | See [usage with FoC](#Full-Customization) |
|
|
129
129
|
### Types
|
|
130
130
|
#### PeerOptions
|
|
131
131
|
```typescript
|
|
@@ -157,7 +157,5 @@ type ChildrenOptions = {
|
|
|
157
157
|
};
|
|
158
158
|
type Children = (childrenOptions: ChildrenOptions) => ReactNode;
|
|
159
159
|
```
|
|
160
|
-
## Used By
|
|
161
|
-
- [StarWars](https://starwarsgame.vercel.app/)
|
|
162
160
|
## Author
|
|
163
161
|
[Sahil Aggarwal](https://www.github.com/SahilAggarwal2004)
|
package/package.json
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-peer-chat",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "An easy to use react component for impleting peer-to-peer chatting.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"peer",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"react
|
|
35
|
-
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
},
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "react-peer-chat",
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "An easy to use react component for impleting peer-to-peer chatting.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/SahilAggarwal2004/react-peer-chat.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"react",
|
|
14
|
+
"chat",
|
|
15
|
+
"component",
|
|
16
|
+
"peer",
|
|
17
|
+
"peerjs",
|
|
18
|
+
"p2p",
|
|
19
|
+
"peer-to-peer",
|
|
20
|
+
"webrtc",
|
|
21
|
+
"react-peer-chat"
|
|
22
|
+
],
|
|
23
|
+
"author": "Sahil Aggarwal",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/SahilAggarwal2004/react-peer-chat/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/SahilAggarwal2004/react-peer-chat#readme",
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": ">=16.0.0",
|
|
31
|
+
"react-dom": ">=16.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/react": "^18.2.28"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"peerjs": "^1.5.1"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"copy": "copy .\\src\\*.css dist",
|
|
41
|
+
"build": "npm i && tsc && npm run copy"
|
|
42
|
+
}
|
|
42
43
|
}
|
|
File without changes
|
/package/{build → dist}/icons.js
RENAMED
|
File without changes
|
/package/{build → dist}/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|