react-peer-chat 0.8.3 → 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/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/storage.ts
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.tsx
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",
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,6 +24,9 @@
21
24
  },
22
25
  "main": "dist/index.js",
23
26
  "types": "dist/index.d.ts",
27
+ "sideEffects": [
28
+ "**/*.css"
29
+ ],
24
30
  "dependencies": {
25
31
  "peerjs": "^1.5.5"
26
32
  },
package/.env DELETED
@@ -1 +0,0 @@
1
- GITHUB_TOKEN=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
package/.release-it.js DELETED
@@ -1,86 +0,0 @@
1
- const COMMIT_HASH_LENGTH = 7;
2
-
3
- const typeMap = {
4
- feat: "Features",
5
- fix: "Bug Fixes",
6
- chore: "Chores",
7
- perf: "Performance Improvements",
8
- revert: "Reverts",
9
- docs: "Documentation",
10
- style: "Styles",
11
- refactor: "Code Refactoring",
12
- test: "Tests",
13
- build: "Build System",
14
- ci: "Continuous Integration",
15
- };
16
-
17
- module.exports = {
18
- git: {
19
- commit: true,
20
- tag: true,
21
- push: true,
22
- commitMessage: "release: ${version}",
23
- tagName: "v${version}",
24
- },
25
- github: {
26
- release: true,
27
- },
28
- hooks: {
29
- "after:bump": "pnpm run compile",
30
- },
31
- npm: {
32
- publish: false,
33
- },
34
- plugins: {
35
- "@release-it/conventional-changelog": {
36
- preset: "conventionalcommits",
37
- infile: "CHANGELOG.md",
38
- writerOpts: {
39
- transform: (commit, context) => {
40
- const notes = commit.notes.map((note) => ({ ...note, title: "BREAKING CHANGES" }));
41
- const type = typeMap[commit.type] || "Other";
42
- const scope = commit.scope === "*" ? "" : commit.scope;
43
- const shortHash = typeof commit.hash === "string" ? commit.hash.substring(0, COMMIT_HASH_LENGTH) : commit.shortHash;
44
- const issues = [];
45
-
46
- let message = commit.subject || "";
47
- if (message) {
48
- if (!/[.!?]$/.test(message)) message += ".";
49
- message += " ";
50
- }
51
- if (commit.body) message += commit.body.trim();
52
-
53
- let url = context.repository ? `${context.host}/${context.owner}/${context.repository}` : context.repoUrl;
54
- if (url) {
55
- url = `${url}/issues/`;
56
- // Issue URLs
57
- message = message.replace(/#([0-9]+)/g, (_, issue) => {
58
- issues.push(issue);
59
- return `[#${issue}](${url}${issue})`;
60
- });
61
- }
62
-
63
- if (context.host) {
64
- // User URLs
65
- message = message.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
66
- if (username.includes("/")) return `@${username}`;
67
- return `[@${username}](${context.host}/${username})`;
68
- });
69
- }
70
-
71
- // remove references that already appear in the subject/body
72
- const references = commit.references.filter((reference) => !issues.includes(reference.issue));
73
-
74
- return {
75
- notes,
76
- type,
77
- scope,
78
- shortHash,
79
- subject: message,
80
- references,
81
- };
82
- },
83
- },
84
- },
85
- },
86
- };
@@ -1,4 +0,0 @@
1
- {
2
- "editor.tabSize": 2,
3
- "editor.defaultFormatter": "esbenp.prettier-vscode"
4
- }
@@ -1,2 +0,0 @@
1
- onlyBuiltDependencies:
2
- - esbuild