react-peer-chat 0.12.0 → 0.13.0
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 +1 -1
- package/dist/icons-CSyvsX4e.mjs +83 -0
- package/dist/icons.d.mts +1 -1
- package/dist/icons.mjs +1 -61
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +26 -26
- package/dist/style.css +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +5 -4
- /package/dist/{types-CwAnkJpd.d.mts → types-B5bswkwd.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -218,7 +218,7 @@ function Chat({ text = true, audio = true, onMessageReceived, dialogOptions, pro
|
|
|
218
218
|
}, [dialog, remotePeers, messages]);
|
|
219
219
|
|
|
220
220
|
return (
|
|
221
|
-
<div className="rpc-main rpc-font" {...props}>
|
|
221
|
+
<div className="rpc-main-container rpc-font" {...props}>
|
|
222
222
|
{typeof children === "function" ? (
|
|
223
223
|
children({ remotePeers, messages, sendMessage, audio: audioEnabled, setAudio })
|
|
224
224
|
) : (
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
//#region src/style.module.css
|
|
3
|
+
var style_module_default = {
|
|
4
|
+
"badge": "rpc-badge",
|
|
5
|
+
"button": "rpc-button",
|
|
6
|
+
"dialog": "rpc-dialog",
|
|
7
|
+
"dialog-container": "rpc-dialog-container",
|
|
8
|
+
"font": "rpc-font",
|
|
9
|
+
"heading": "rpc-heading",
|
|
10
|
+
"hr": "rpc-hr",
|
|
11
|
+
"icon-container": "rpc-icon-container",
|
|
12
|
+
"input": "rpc-input",
|
|
13
|
+
"input-container": "rpc-input-container",
|
|
14
|
+
"invert": "rpc-invert",
|
|
15
|
+
"main-container": "rpc-main-container",
|
|
16
|
+
"message-container": "rpc-message-container",
|
|
17
|
+
"notification": "rpc-notification",
|
|
18
|
+
"position-center": "rpc-position-center",
|
|
19
|
+
"position-left": "rpc-position-left",
|
|
20
|
+
"position-right": "rpc-position-right"
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/icons.tsx
|
|
24
|
+
function BiSolidMessageDetail(props) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
26
|
+
className: style_module_default["icon-container"],
|
|
27
|
+
...props
|
|
28
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
29
|
+
viewBox: "0 0 24 24",
|
|
30
|
+
width: "1.25rem",
|
|
31
|
+
height: "1.25rem"
|
|
32
|
+
}, /* @__PURE__ */ React.createElement("path", { d: "M20 2H4c-1.103 0-2 .894-2 1.992v12.016C2 17.106 2.897 18 4 18h3v4l6.351-4H20c1.103 0 2-.894 2-1.992V3.992A1.998 1.998 0 0 0 20 2zm-6 11H7v-2h7v2zm3-4H7V7h10v2z" })));
|
|
33
|
+
}
|
|
34
|
+
function BiSolidMessageX(props) {
|
|
35
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
36
|
+
className: style_module_default["icon-container"],
|
|
37
|
+
...props
|
|
38
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
39
|
+
viewBox: "0 0 24 24",
|
|
40
|
+
width: "1.25rem",
|
|
41
|
+
height: "1.25rem"
|
|
42
|
+
}, /* @__PURE__ */ React.createElement("path", { d: "M20 2H4c-1.103 0-2 .894-2 1.992v12.016C2 17.106 2.897 18 4 18h3v4l6.351-4H20c1.103 0 2-.894 2-1.992V3.992A1.998 1.998 0 0 0 20 2zm-3.293 11.293-1.414 1.414L12 11.414l-3.293 3.293-1.414-1.414L10.586 10 7.293 6.707l1.414-1.414L12 8.586l3.293-3.293 1.414 1.414L13.414 10l3.293 3.293z" })));
|
|
43
|
+
}
|
|
44
|
+
function GrSend(props) {
|
|
45
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
46
|
+
className: style_module_default["icon-container"],
|
|
47
|
+
...props
|
|
48
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
width: "1.25rem",
|
|
51
|
+
height: "1.25rem",
|
|
52
|
+
className: style_module_default["invert"]
|
|
53
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
54
|
+
fill: "none",
|
|
55
|
+
stroke: "#000",
|
|
56
|
+
strokeWidth: 2,
|
|
57
|
+
d: "M22,3 L2,11 L20.5,19 L22,3 Z M10,20.5 L13,16 M15.5,9.5 L9,14 L9.85884537,20.0119176 C9.93680292,20.5576204 10.0751625,20.5490248 10.1651297,20.009222 L11,15 L15.5,9.5 Z"
|
|
58
|
+
})));
|
|
59
|
+
}
|
|
60
|
+
function BsFillMicFill(props) {
|
|
61
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
62
|
+
className: style_module_default["icon-container"],
|
|
63
|
+
...props
|
|
64
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
65
|
+
viewBox: "0 0 16 16",
|
|
66
|
+
fill: "currentColor",
|
|
67
|
+
width: "1.25rem",
|
|
68
|
+
height: "1.25rem"
|
|
69
|
+
}, /* @__PURE__ */ React.createElement("path", { d: "M5 3a3 3 0 0 1 6 0v5a3 3 0 0 1-6 0V3z" }), /* @__PURE__ */ React.createElement("path", { d: "M3.5 6.5A.5.5 0 0 1 4 7v1a4 4 0 0 0 8 0V7a.5.5 0 0 1 1 0v1a5 5 0 0 1-4.5 4.975V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 .5-.5z" })));
|
|
70
|
+
}
|
|
71
|
+
function BsFillMicMuteFill(props) {
|
|
72
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
73
|
+
className: style_module_default["icon-container"],
|
|
74
|
+
...props
|
|
75
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
76
|
+
viewBox: "0 0 16 16",
|
|
77
|
+
fill: "currentColor",
|
|
78
|
+
width: "1.25rem",
|
|
79
|
+
height: "1.25rem"
|
|
80
|
+
}, /* @__PURE__ */ React.createElement("path", { d: "M13 8c0 .564-.094 1.107-.266 1.613l-.814-.814A4.02 4.02 0 0 0 12 8V7a.5.5 0 0 1 1 0v1zm-5 4c.818 0 1.578-.245 2.212-.667l.718.719a4.973 4.973 0 0 1-2.43.923V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 1 0v1a4 4 0 0 0 4 4zm3-9v4.879L5.158 2.037A3.001 3.001 0 0 1 11 3z" }), /* @__PURE__ */ React.createElement("path", { d: "M9.486 10.607 5 6.12V8a3 3 0 0 0 4.486 2.607zm-7.84-9.253 12 12 .708-.708-12-12-.708.708z" })));
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { GrSend as a, BsFillMicMuteFill as i, BiSolidMessageX as n, style_module_default as o, BsFillMicFill as r, BiSolidMessageDetail as t };
|
package/dist/icons.d.mts
CHANGED
package/dist/icons.mjs
CHANGED
|
@@ -1,62 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/icons.tsx
|
|
3
|
-
function BiSolidMessageDetail(props) {
|
|
4
|
-
return /* @__PURE__ */ React.createElement("span", {
|
|
5
|
-
className: "rpc-icon-container",
|
|
6
|
-
...props
|
|
7
|
-
}, /* @__PURE__ */ React.createElement("svg", {
|
|
8
|
-
viewBox: "0 0 24 24",
|
|
9
|
-
width: "1.25rem",
|
|
10
|
-
height: "1.25rem"
|
|
11
|
-
}, /* @__PURE__ */ React.createElement("path", { d: "M20 2H4c-1.103 0-2 .894-2 1.992v12.016C2 17.106 2.897 18 4 18h3v4l6.351-4H20c1.103 0 2-.894 2-1.992V3.992A1.998 1.998 0 0 0 20 2zm-6 11H7v-2h7v2zm3-4H7V7h10v2z" })));
|
|
12
|
-
}
|
|
13
|
-
function BiSolidMessageX(props) {
|
|
14
|
-
return /* @__PURE__ */ React.createElement("span", {
|
|
15
|
-
className: "rpc-icon-container",
|
|
16
|
-
...props
|
|
17
|
-
}, /* @__PURE__ */ React.createElement("svg", {
|
|
18
|
-
viewBox: "0 0 24 24",
|
|
19
|
-
width: "1.25rem",
|
|
20
|
-
height: "1.25rem"
|
|
21
|
-
}, /* @__PURE__ */ React.createElement("path", { d: "M20 2H4c-1.103 0-2 .894-2 1.992v12.016C2 17.106 2.897 18 4 18h3v4l6.351-4H20c1.103 0 2-.894 2-1.992V3.992A1.998 1.998 0 0 0 20 2zm-3.293 11.293-1.414 1.414L12 11.414l-3.293 3.293-1.414-1.414L10.586 10 7.293 6.707l1.414-1.414L12 8.586l3.293-3.293 1.414 1.414L13.414 10l3.293 3.293z" })));
|
|
22
|
-
}
|
|
23
|
-
function GrSend(props) {
|
|
24
|
-
return /* @__PURE__ */ React.createElement("span", {
|
|
25
|
-
className: "rpc-icon-container",
|
|
26
|
-
...props
|
|
27
|
-
}, /* @__PURE__ */ React.createElement("svg", {
|
|
28
|
-
viewBox: "0 0 24 24",
|
|
29
|
-
width: "1.25rem",
|
|
30
|
-
height: "1.25rem",
|
|
31
|
-
className: "rpc-invert"
|
|
32
|
-
}, /* @__PURE__ */ React.createElement("path", {
|
|
33
|
-
fill: "none",
|
|
34
|
-
stroke: "#000",
|
|
35
|
-
strokeWidth: 2,
|
|
36
|
-
d: "M22,3 L2,11 L20.5,19 L22,3 Z M10,20.5 L13,16 M15.5,9.5 L9,14 L9.85884537,20.0119176 C9.93680292,20.5576204 10.0751625,20.5490248 10.1651297,20.009222 L11,15 L15.5,9.5 Z"
|
|
37
|
-
})));
|
|
38
|
-
}
|
|
39
|
-
function BsFillMicFill(props) {
|
|
40
|
-
return /* @__PURE__ */ React.createElement("span", {
|
|
41
|
-
className: "rpc-icon-container",
|
|
42
|
-
...props
|
|
43
|
-
}, /* @__PURE__ */ React.createElement("svg", {
|
|
44
|
-
viewBox: "0 0 16 16",
|
|
45
|
-
fill: "currentColor",
|
|
46
|
-
width: "1.25rem",
|
|
47
|
-
height: "1.25rem"
|
|
48
|
-
}, /* @__PURE__ */ React.createElement("path", { d: "M5 3a3 3 0 0 1 6 0v5a3 3 0 0 1-6 0V3z" }), /* @__PURE__ */ React.createElement("path", { d: "M3.5 6.5A.5.5 0 0 1 4 7v1a4 4 0 0 0 8 0V7a.5.5 0 0 1 1 0v1a5 5 0 0 1-4.5 4.975V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 .5-.5z" })));
|
|
49
|
-
}
|
|
50
|
-
function BsFillMicMuteFill(props) {
|
|
51
|
-
return /* @__PURE__ */ React.createElement("span", {
|
|
52
|
-
className: "rpc-icon-container",
|
|
53
|
-
...props
|
|
54
|
-
}, /* @__PURE__ */ React.createElement("svg", {
|
|
55
|
-
viewBox: "0 0 16 16",
|
|
56
|
-
fill: "currentColor",
|
|
57
|
-
width: "1.25rem",
|
|
58
|
-
height: "1.25rem"
|
|
59
|
-
}, /* @__PURE__ */ React.createElement("path", { d: "M13 8c0 .564-.094 1.107-.266 1.613l-.814-.814A4.02 4.02 0 0 0 12 8V7a.5.5 0 0 1 1 0v1zm-5 4c.818 0 1.578-.245 2.212-.667l.718.719a4.973 4.973 0 0 1-2.43.923V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 1 0v1a4 4 0 0 0 4 4zm3-9v4.879L5.158 2.037A3.001 3.001 0 0 1 11 3z" }), /* @__PURE__ */ React.createElement("path", { d: "M9.486 10.607 5 6.12V8a3 3 0 0 0 4.486 2.607zm-7.84-9.253 12 12 .708-.708-12-12-.708.708z" })));
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
1
|
+
import { a as GrSend, i as BsFillMicMuteFill, n as BiSolidMessageX, r as BsFillMicFill, t as BiSolidMessageDetail } from "./icons-CSyvsX4e.mjs";
|
|
62
2
|
export { BiSolidMessageDetail, BiSolidMessageX, BsFillMicFill, BsFillMicMuteFill, GrSend };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as UseChatReturn, t as ChatProps, y as UseChatProps } from "./types-
|
|
1
|
+
import { b as UseChatReturn, t as ChatProps, y as UseChatProps } from "./types-B5bswkwd.mjs";
|
|
2
2
|
import React, { SetStateAction } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as GrSend, i as BsFillMicMuteFill, n as BiSolidMessageX, o as style_module_default, r as BsFillMicFill, t as BiSolidMessageDetail } from "./icons-CSyvsX4e.mjs";
|
|
2
2
|
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
const defaults = {
|
|
4
4
|
config: { iceServers: [{ urls: ["stun:stun.l.google.com:19302", "stun:stun.relay.metered.ca:80"] }].concat([
|
|
@@ -52,11 +52,19 @@ function isSetStateFunction(v) {
|
|
|
52
52
|
return typeof v === "function";
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
|
+
//#region src/lib/utils.ts
|
|
56
|
+
const addPrefix = (str) => `rpc-${str}`;
|
|
57
|
+
function isMobile(iOS = true) {
|
|
58
|
+
let result = navigator.userAgentData?.mobile;
|
|
59
|
+
result ??= mobileRegex.test(navigator.userAgent) || iOS && iosRegex.test(navigator.userAgent);
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
55
63
|
//#region src/lib/storage.ts
|
|
56
64
|
const listeners = /* @__PURE__ */ new Map();
|
|
57
65
|
function clearChat() {
|
|
58
|
-
removeStorage("
|
|
59
|
-
removeStorage("
|
|
66
|
+
removeStorage(addPrefix("remote-peer"), false);
|
|
67
|
+
removeStorage(addPrefix("messages"), false);
|
|
60
68
|
}
|
|
61
69
|
const getStorageInstance = (local) => local ? localStorage : sessionStorage;
|
|
62
70
|
const getNamespacedKey = (key, local) => `${local ? "local" : "session"}:${key}`;
|
|
@@ -95,14 +103,6 @@ function subscribeToStorage(key, local, callback) {
|
|
|
95
103
|
};
|
|
96
104
|
}
|
|
97
105
|
//#endregion
|
|
98
|
-
//#region src/lib/utils.ts
|
|
99
|
-
const addPrefix = (str) => `rpc-${str}`;
|
|
100
|
-
function isMobile(iOS = true) {
|
|
101
|
-
let result = navigator.userAgentData?.mobile;
|
|
102
|
-
result ??= mobileRegex.test(navigator.userAgent) || iOS && iosRegex.test(navigator.userAgent);
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
//#endregion
|
|
106
106
|
//#region src/hooks.ts
|
|
107
107
|
const { config: defaultConfig, peerOptions: defaultPeerOptions, remotePeerId: defaultRemotePeerId } = defaults;
|
|
108
108
|
function useChat({ peerId, name = "Anonymous User", remotePeerId = defaultRemotePeerId, peerOptions = defaultPeerOptions, text = true, recoverChat = false, audio: allowed = true, onError = console.error, onPeerError = console.error, onNetworkError, onMessageSent, onMessageReceived }) {
|
|
@@ -118,7 +118,7 @@ function useChat({ peerId, name = "Anonymous User", remotePeerId = defaultRemote
|
|
|
118
118
|
const mixerRef = useRef(null);
|
|
119
119
|
const sourceNodesRef = useRef({});
|
|
120
120
|
const [messages, setMessages, addMessage] = useMessages();
|
|
121
|
-
const [remotePeers, setRemotePeers] = useStorage("
|
|
121
|
+
const [remotePeers, setRemotePeers] = useStorage(addPrefix("remote-peer"), {});
|
|
122
122
|
const { completePeerId, completeRemotePeerIds } = useMemo(() => {
|
|
123
123
|
const remotePeerIds = Array.isArray(remotePeerId) ? remotePeerId : [remotePeerId];
|
|
124
124
|
return {
|
|
@@ -335,7 +335,7 @@ function useChat({ peerId, name = "Anonymous User", remotePeerId = defaultRemote
|
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
337
|
function useMessages() {
|
|
338
|
-
const [messages, setMessages] = useStorage("
|
|
338
|
+
const [messages, setMessages] = useStorage(addPrefix("messages"), []);
|
|
339
339
|
const addMessage = (message) => setMessages((prev) => prev.concat(message));
|
|
340
340
|
return [
|
|
341
341
|
messages,
|
|
@@ -358,7 +358,7 @@ function useStorage(key, initialValue, local = false) {
|
|
|
358
358
|
return [storedValue, setValue];
|
|
359
359
|
}
|
|
360
360
|
function useAudio(allowed) {
|
|
361
|
-
const [audio, setAudio] = useStorage("
|
|
361
|
+
const [audio, setAudio] = useStorage(addPrefix("audio"), false, true);
|
|
362
362
|
return [audio && allowed, setAudio];
|
|
363
363
|
}
|
|
364
364
|
//#endregion
|
|
@@ -393,26 +393,26 @@ function Chat({ text = true, audio = true, onMessageReceived, dialogOptions, pro
|
|
|
393
393
|
messages
|
|
394
394
|
]);
|
|
395
395
|
return /* @__PURE__ */ React.createElement("div", {
|
|
396
|
-
className: "
|
|
396
|
+
className: `${style_module_default["main-container"]} ${style_module_default["font"]}`,
|
|
397
397
|
...props
|
|
398
|
-
}, typeof children === "function" ? children(childrenOptions) : /* @__PURE__ */ React.createElement(React.Fragment, null, text && /* @__PURE__ */ React.createElement("div", { className: "
|
|
398
|
+
}, typeof children === "function" ? children(childrenOptions) : /* @__PURE__ */ React.createElement(React.Fragment, null, text && /* @__PURE__ */ React.createElement("div", { className: style_module_default["dialog-container"] }, dialog ? /* @__PURE__ */ React.createElement(BiSolidMessageX, {
|
|
399
399
|
title: "Close chat",
|
|
400
400
|
onClick: () => setDialog(false)
|
|
401
|
-
}) : /* @__PURE__ */ React.createElement("div", { className: "
|
|
401
|
+
}) : /* @__PURE__ */ React.createElement("div", { className: style_module_default["notification"] }, /* @__PURE__ */ React.createElement(BiSolidMessageDetail, {
|
|
402
402
|
title: "Open chat",
|
|
403
403
|
onClick: () => {
|
|
404
404
|
setNotification(false);
|
|
405
405
|
setDialog(true);
|
|
406
406
|
}
|
|
407
|
-
}), notification && /* @__PURE__ */ React.createElement("span", { className: "
|
|
407
|
+
}), notification && /* @__PURE__ */ React.createElement("span", { className: style_module_default["badge"] })), /* @__PURE__ */ React.createElement("dialog", {
|
|
408
408
|
ref: dialogRef,
|
|
409
|
-
className: `${dialog ? "
|
|
409
|
+
className: `${dialog ? style_module_default["dialog"] : ""} ${style_module_default[`position-${dialogOptions?.position || "center"}`]}`,
|
|
410
410
|
style: dialogOptions?.style
|
|
411
|
-
}, /* @__PURE__ */ React.createElement("div", { className: "
|
|
411
|
+
}, /* @__PURE__ */ React.createElement("div", { className: style_module_default["heading"] }, "Chat"), /* @__PURE__ */ React.createElement("hr", { className: style_module_default["hr"] }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", {
|
|
412
412
|
ref: containerRef,
|
|
413
|
-
className: "
|
|
414
|
-
}, messages.map(({ id, name, text }, i) => /* @__PURE__ */ React.createElement("div", { key: i }, /* @__PURE__ */ React.createElement("strong", null, id === peerId ? "You" : name, ": "), /* @__PURE__ */ React.createElement("span", null, text)))), /* @__PURE__ */ React.createElement("hr", { className: "
|
|
415
|
-
className: "
|
|
413
|
+
className: style_module_default["message-container"]
|
|
414
|
+
}, messages.map(({ id, name, text }, i) => /* @__PURE__ */ React.createElement("div", { key: i }, /* @__PURE__ */ React.createElement("strong", null, id === peerId ? "You" : name, ": "), /* @__PURE__ */ React.createElement("span", null, text)))), /* @__PURE__ */ React.createElement("hr", { className: style_module_default["hr"] }), /* @__PURE__ */ React.createElement("form", {
|
|
415
|
+
className: style_module_default["input-container"],
|
|
416
416
|
onSubmit: (e) => {
|
|
417
417
|
e.preventDefault();
|
|
418
418
|
const text = inputRef.current?.value;
|
|
@@ -426,13 +426,13 @@ function Chat({ text = true, audio = true, onMessageReceived, dialogOptions, pro
|
|
|
426
426
|
}
|
|
427
427
|
}, /* @__PURE__ */ React.createElement("input", {
|
|
428
428
|
ref: inputRef,
|
|
429
|
-
className: "
|
|
429
|
+
className: `${style_module_default["input"]} ${style_module_default["font"]}`,
|
|
430
430
|
placeholder: "Enter a message"
|
|
431
431
|
}), /* @__PURE__ */ React.createElement("button", {
|
|
432
432
|
type: "submit",
|
|
433
|
-
className: "
|
|
433
|
+
className: style_module_default["button"]
|
|
434
434
|
}, /* @__PURE__ */ React.createElement(GrSend, { title: "Send message" })))))), audio && /* @__PURE__ */ React.createElement("button", {
|
|
435
|
-
className: "
|
|
435
|
+
className: style_module_default["button"],
|
|
436
436
|
onClick: () => setAudio(!audioEnabled)
|
|
437
437
|
}, audioEnabled ? /* @__PURE__ */ React.createElement(BsFillMicFill, { title: "Turn mic off" }) : /* @__PURE__ */ React.createElement(BsFillMicMuteFill, { title: "Turn mic on" }))));
|
|
438
438
|
}
|
package/dist/style.css
CHANGED
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as RemotePeers, a as DialogOptions, b as UseChatReturn, c as ErrorHandler, d as Listener, f as Message, g as RemotePeerId, h as PeerOptions, i as Connection, l as IconProps, m as PeerErrorHandler, n as Children, o as DialogPosition, p as MessageEventHandler, r as ChildrenOptions, s as DivProps, t as ChatProps, u as InputMessage, v as ResetConnectionType, x as VoidFunction, y as UseChatProps } from "./types-
|
|
1
|
+
import { _ as RemotePeers, a as DialogOptions, b as UseChatReturn, c as ErrorHandler, d as Listener, f as Message, g as RemotePeerId, h as PeerOptions, i as Connection, l as IconProps, m as PeerErrorHandler, n as Children, o as DialogPosition, p as MessageEventHandler, r as ChildrenOptions, s as DivProps, t as ChatProps, u as InputMessage, v as ResetConnectionType, x as VoidFunction, y as UseChatProps } from "./types-B5bswkwd.mjs";
|
|
2
2
|
export { ChatProps, Children, ChildrenOptions, Connection, DialogOptions, DialogPosition, DivProps, ErrorHandler, IconProps, InputMessage, Listener, Message, MessageEventHandler, PeerErrorHandler, PeerOptions, RemotePeerId, RemotePeers, ResetConnectionType, UseChatProps, UseChatReturn, VoidFunction };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-peer-chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
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>",
|
|
@@ -35,13 +35,14 @@
|
|
|
35
35
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
38
39
|
"@release-it/conventional-changelog": "^10.0.6",
|
|
39
|
-
"@tsdown/css": "^0.21.
|
|
40
|
+
"@tsdown/css": "^0.21.7",
|
|
40
41
|
"@types/react": "^19.2.14",
|
|
41
42
|
"prettier-package-json": "^2.8.0",
|
|
42
43
|
"release-it": "^19.2.4",
|
|
43
|
-
"tsdown": "^0.21.
|
|
44
|
-
"typescript": "^
|
|
44
|
+
"tsdown": "^0.21.7",
|
|
45
|
+
"typescript": "^6.0.2"
|
|
45
46
|
},
|
|
46
47
|
"keywords": [
|
|
47
48
|
"audio-chat",
|
|
File without changes
|