react-peer-chat 0.8.2 → 0.8.4
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 +2 -2
- package/dist/index.js +9 -9
- package/package.json +16 -6
- package/.vscode/settings.json +0 -4
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ To install `react-peer-chat`:
|
|
|
33
33
|
|
|
34
34
|
## Usage
|
|
35
35
|
|
|
36
|
-
`react-peer-chat` provides two primary methods to integrate chat functionality into your React apps: through the `<Chat>` component and the `
|
|
36
|
+
`react-peer-chat` provides two primary methods to integrate chat functionality into your React apps: through the `<Chat>` component and the `useChat` hook.
|
|
37
37
|
|
|
38
38
|
It also exports a `clearChat` function that clears the text chat from the browser's session storage when called.
|
|
39
39
|
|
|
@@ -353,4 +353,4 @@ type Children = (childrenOptions: ChildrenOptions) => ReactNode;
|
|
|
353
353
|
|
|
354
354
|
## Author
|
|
355
355
|
|
|
356
|
-
[Sahil Aggarwal](https://
|
|
356
|
+
[Sahil Aggarwal](https://github.com/SahilAggarwal2004)
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { __spreadValues, __async, __objRest, BiSolidMessageX, BiSolidMessageDetail, GrSend, BsFillMicFill, BsFillMicMuteFill } from './chunks/chunk-4CBQRGQ3.js';
|
|
2
2
|
import React, { useRef, useState, useEffect } from 'react';
|
|
3
3
|
|
|
4
|
-
// src/connection.tsx
|
|
5
|
-
function closeConnection(conn) {
|
|
6
|
-
conn.removeAllListeners();
|
|
7
|
-
conn.close();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
4
|
// src/constants.ts
|
|
11
5
|
var turnAccounts = [
|
|
12
6
|
{ username: "70061a377b51f3a3d01c11e3", credential: "lHV4NYJ5Rfl5JNa9" },
|
|
@@ -33,7 +27,13 @@ var defaultConfig = {
|
|
|
33
27
|
)
|
|
34
28
|
};
|
|
35
29
|
|
|
36
|
-
// src/
|
|
30
|
+
// src/lib/connection.ts
|
|
31
|
+
function closeConnection(conn) {
|
|
32
|
+
conn.removeAllListeners();
|
|
33
|
+
conn.close();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/lib/storage.ts
|
|
37
37
|
var removeStorage = (key, local = false) => (local ? localStorage : sessionStorage).removeItem(key);
|
|
38
38
|
var setStorage = (key, value, local = false) => (local ? localStorage : sessionStorage).setItem(key, JSON.stringify(value));
|
|
39
39
|
var getStorage = (key, fallbackValue, local = false) => {
|
|
@@ -57,10 +57,10 @@ var clearChat = () => {
|
|
|
57
57
|
removeStorage("rpc-messages");
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
// src/utils.ts
|
|
60
|
+
// src/lib/utils.ts
|
|
61
61
|
var addPrefix = (str) => `rpc-${str}`;
|
|
62
62
|
|
|
63
|
-
// src/hooks.
|
|
63
|
+
// src/hooks.ts
|
|
64
64
|
function useChat({
|
|
65
65
|
name,
|
|
66
66
|
peerId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-peer-chat",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "An easy to use react component for impleting peer-to-peer chatting.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sahil Aggarwal <aggarwalsahil2004@gmail.com>",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"url": "https://github.com/SahilAggarwal2004/react-peer-chat/issues"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
17
20
|
"exports": {
|
|
18
21
|
".": "./dist/index.js",
|
|
19
22
|
"./icons": "./dist/icons.js",
|
|
@@ -21,13 +24,18 @@
|
|
|
21
24
|
},
|
|
22
25
|
"main": "dist/index.js",
|
|
23
26
|
"types": "dist/index.d.ts",
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"**/*.css"
|
|
29
|
+
],
|
|
24
30
|
"dependencies": {
|
|
25
|
-
"peerjs": "^1.5.
|
|
31
|
+
"peerjs": "^1.5.5"
|
|
26
32
|
},
|
|
27
33
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"
|
|
30
|
-
"
|
|
34
|
+
"@release-it/conventional-changelog": "^10.0.4",
|
|
35
|
+
"@types/react": "^19.2.7",
|
|
36
|
+
"release-it": "^19.2.2",
|
|
37
|
+
"tsup": "^8.5.1",
|
|
38
|
+
"typescript": "^5.9.3"
|
|
31
39
|
},
|
|
32
40
|
"peerDependencies": {
|
|
33
41
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
@@ -52,6 +60,8 @@
|
|
|
52
60
|
"scripts": {
|
|
53
61
|
"build": "pnpm i && pnpm run compile",
|
|
54
62
|
"compile": "tsup",
|
|
55
|
-
"dev": "tsup --watch"
|
|
63
|
+
"dev": "tsup --watch",
|
|
64
|
+
"dry-release": "release-it --ci --dry-run",
|
|
65
|
+
"release": "release-it --ci"
|
|
56
66
|
}
|
|
57
67
|
}
|
package/.vscode/settings.json
DELETED