react-peer-chat 0.6.1 → 0.6.3

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Sahil Aggawal, <aggarwalsahil2004@gmail.com>
3
+ Copyright (c) 2024 Sahil Aggawal, <aggarwalsahil2004@gmail.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/dist/icons.js CHANGED
@@ -1,28 +1,28 @@
1
1
  import React from "react";
2
2
  export function BiSolidMessageDetail(props) {
3
- return React.createElement("span", Object.assign({ className: 'rpc-icon-container' }, props),
4
- React.createElement("svg", { fill: "currentColor", width: '1.5rem', height: '1.5rem', className: 'rpc-scale-down' },
3
+ return React.createElement("span", Object.assign({ className: "rpc-icon-container" }, props),
4
+ React.createElement("svg", { viewBox: "0 0 24 24", width: "1.25rem", height: "1.25rem" },
5
5
  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" })));
6
6
  }
7
7
  export function BiSolidMessageX(props) {
8
- return React.createElement("span", Object.assign({ className: 'rpc-icon-container' }, props),
9
- React.createElement("svg", { fill: "currentColor", width: '1.5rem', height: '1.5rem', className: 'rpc-scale-down' },
8
+ return React.createElement("span", Object.assign({ className: "rpc-icon-container" }, props),
9
+ React.createElement("svg", { viewBox: "0 0 24 24", width: "1.25rem", height: "1.25rem" },
10
10
  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" })));
11
11
  }
12
12
  export function GrSend(props) {
13
- return React.createElement("span", Object.assign({ className: 'rpc-icon-container' }, props),
14
- React.createElement("svg", { fill: "currentColor", width: '1.5rem', height: '1.5rem', className: 'rpc-scale-down rpc-invert' },
13
+ return React.createElement("span", Object.assign({ className: "rpc-icon-container" }, props),
14
+ React.createElement("svg", { viewBox: "0 0 24 24", width: "1.25rem", height: "1.25rem", className: "rpc-invert" },
15
15
  React.createElement("path", { fill: "none", stroke: "#000", strokeWidth: 2, 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" })));
16
16
  }
17
17
  export function BsFillMicFill(props) {
18
- return React.createElement("span", Object.assign({ className: 'rpc-icon-container' }, props),
19
- React.createElement("svg", { fill: "currentColor", width: '1rem', height: '1rem' },
18
+ return React.createElement("span", Object.assign({ className: "rpc-icon-container" }, props),
19
+ React.createElement("svg", { viewBox: "0 0 16 16", fill: "currentColor", width: "1.25rem", height: "1.25rem" },
20
20
  React.createElement("path", { d: "M5 3a3 3 0 0 1 6 0v5a3 3 0 0 1-6 0V3z" }),
21
21
  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" })));
22
22
  }
23
23
  export function BsFillMicMuteFill(props) {
24
- return React.createElement("span", Object.assign({ className: 'rpc-icon-container' }, props),
25
- React.createElement("svg", { fill: "currentColor", width: '1rem', height: '1rem' },
24
+ return React.createElement("span", Object.assign({ className: "rpc-icon-container" }, props),
25
+ React.createElement("svg", { viewBox: "0 0 16 16", fill: "currentColor", width: "1.25rem", height: "1.25rem" },
26
26
  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" }),
27
27
  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" })));
28
28
  }
package/dist/index.js CHANGED
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import React, { useEffect, useRef, useState } from 'react';
2
11
  import useStorage, { removeStorage } from './storage.js';
3
12
  import { BiSolidMessageDetail, BiSolidMessageX, BsFillMicFill, BsFillMicMuteFill, GrSend } from './icons.js';
@@ -80,12 +89,14 @@ export default function Chat({ name, peerId, remotePeerId = [], peerOptions, tex
80
89
  setPeer(undefined);
81
90
  return;
82
91
  }
83
- (async function () {
84
- const { Peer, util: { supports: { audioVideo, data } } } = await import('peerjs');
85
- if (!data || !audioVideo)
86
- return onError();
87
- const peer = new Peer(peerId, Object.assign({ config: defaultConfig }, peerOptions));
88
- setPeer(peer);
92
+ (function () {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ const { Peer, util: { supports: { audioVideo, data } } } = yield import('peerjs');
95
+ if (!data || !audioVideo)
96
+ return onError();
97
+ const peer = new Peer(peerId, Object.assign({ config: defaultConfig }, peerOptions));
98
+ setPeer(peer);
99
+ });
89
100
  })();
90
101
  }, [audio]);
91
102
  useEffect(() => {
package/dist/styles.css CHANGED
@@ -116,10 +116,6 @@
116
116
  align-items: center;
117
117
  }
118
118
 
119
- .rpc-scale-down {
120
- scale: calc(2/3);
121
- }
122
-
123
119
  .rpc-invert {
124
120
  filter: invert(100%);
125
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-peer-chat",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "An easy to use react component for impleting peer-to-peer chatting.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",