jam-core-react
Advanced tools
Comparing version 0.3.10 to 0.3.11
@@ -199,5 +199,5 @@ // ../../jam-core-react/backend-hooks.ts | ||
for (let entry of subscriptions) { | ||
let [key, set3] = entry; | ||
set3.delete(element); | ||
if (set3.size === 0) { | ||
let [key, set2] = entry; | ||
set2.delete(element); | ||
if (set2.size === 0) { | ||
subscriptions.delete(key); | ||
@@ -207,5 +207,2 @@ } | ||
} | ||
function Action(type) { | ||
return { type, toString: () => type }; | ||
} | ||
function useExternalState(state, keyOrSelector) { | ||
@@ -467,18 +464,5 @@ if (current === root) | ||
// ../../jam-core/backend.js | ||
import { on as on5 } from "minimal-state"; | ||
// ../../jam-core-react/backend-hooks.ts | ||
import { apiUrl } from "jam-core"; | ||
// ../../jam-core/config.ts | ||
var defaultConfig = { | ||
urls: { | ||
pantry: `https://beta.jam.systems/_/pantry`, | ||
stun: `stun:stun.beta.jam.systems:3478`, | ||
turn: `turn:turn.beta.jam.systems:3478`, | ||
turnCredentials: { username: "test", credential: "yieChoi0PeoKo8ni" } | ||
}, | ||
development: false, | ||
sfu: false | ||
}; | ||
var staticConfig = window.jamConfig ?? defaultConfig; | ||
// ../../lib/GetRequest.js | ||
@@ -564,64 +548,2 @@ import { update } from "minimal-state"; | ||
// ../../jam-core/room/Speakers.js | ||
import { is as is2 } from "minimal-state"; | ||
// ../../lib/local-storage.js | ||
import { on as on3, pure, set as set2 } from "minimal-state"; | ||
// ../../lib/state-utils.js | ||
import { on as on4 } from "minimal-state"; | ||
// ../../jam-core/state.ts | ||
var defaultState2 = { | ||
myIdentity: null, | ||
myId: null, | ||
roomId: window.existingRoomId ?? null, | ||
inRoom: null, | ||
room: { name: "", description: "", speakers: [], moderators: [] }, | ||
hasRoom: false, | ||
isRoomLoading: false, | ||
iAmSpeaker: false, | ||
iAmModerator: false, | ||
identities: {}, | ||
otherDeviceInRoom: false, | ||
swarm: null, | ||
reactions: {}, | ||
handRaised: false, | ||
soundMuted: true, | ||
micMuted: false, | ||
audioFile: null, | ||
audioFileElement: null, | ||
myAudio: null, | ||
audioPlayError: false, | ||
speaking: new Set(), | ||
isRecording: false, | ||
recordedAudio: null | ||
}; | ||
var actions = { | ||
JOIN: Action("join"), | ||
LEAVE_STAGE: Action("leave-stage"), | ||
RETRY_MIC: Action("retry-mic"), | ||
RETRY_AUDIO: Action("retry-audio"), | ||
REACTION: Action("reaction"), | ||
AUTO_JOIN: Action("auto-join") | ||
}; | ||
// ../../jam-core/room.js | ||
var emptyRoom = { | ||
name: "", | ||
description: "", | ||
...staticConfig.defaultRoom ?? null, | ||
speakers: [], | ||
moderators: [] | ||
}; | ||
// ../../jam-core/backend.js | ||
var API = `${staticConfig.urls.pantry}/api/v1`; | ||
on5(staticConfig, () => { | ||
API = `${staticConfig.urls.pantry}/api/v1`; | ||
}); | ||
function apiUrl() { | ||
return API; | ||
} | ||
// ../../jam-core-react/backend-hooks.ts | ||
@@ -628,0 +550,0 @@ function useApiQuery(path, { dontFetch = false, fetchOnMount = false } = {}) { |
import React from 'react'; | ||
import { createJam, StateType } from 'jam-core'; | ||
import { createJam, StateType } from '../jam-core'; | ||
export { JamProvider, useJamState, useJam }; | ||
@@ -26,8 +26,8 @@ declare const defaultApi: { | ||
setState: { | ||
<L extends "roomId" | "micMuted" | "handRaised" | "myIdentity" | "myId" | "inRoom" | "room" | "hasRoom" | "isRoomLoading" | "iAmSpeaker" | "iAmModerator" | "identities" | "otherDeviceInRoom" | "swarm" | "reactions" | "soundMuted" | "audioFile" | "audioFileElement" | "myAudio" | "audioPlayError" | "speaking" | "isRecording" | "recordedAudio">(key: L, value: { | ||
myIdentity: import("jam-core/dist/jam-core/state").IdentityType | null; | ||
<L extends "identities" | "roomId" | "myIdentity" | "myId" | "swarm" | "micMuted" | "handRaised" | "inRoom" | "room" | "hasRoom" | "isRoomLoading" | "iAmSpeaker" | "iAmModerator" | "otherDeviceInRoom" | "peers" | "peerState" | "myPeerState" | "reactions" | "soundMuted" | "audioFile" | "audioFileElement" | "myAudio" | "audioPlayError" | "speaking" | "isRecording" | "recordedAudio">(key: L, value: { | ||
myIdentity: import("../jam-core/state").IdentityType | null; | ||
myId: string | null; | ||
roomId: string | null; | ||
inRoom: string | null; | ||
room: import("jam-core/dist/jam-core/state").RoomType; | ||
room: import("../jam-core/state").RoomType; | ||
hasRoom: boolean; | ||
@@ -40,2 +40,15 @@ isRoomLoading: boolean; | ||
swarm: null; | ||
peers: string[]; | ||
peerState: Record<string, { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
} | undefined>; | ||
myPeerState: { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
}; | ||
reactions: {}; | ||
@@ -54,7 +67,7 @@ handRaised: boolean; | ||
(state: Partial<{ | ||
myIdentity: import("jam-core/dist/jam-core/state").IdentityType | null; | ||
myIdentity: import("../jam-core/state").IdentityType | null; | ||
myId: string | null; | ||
roomId: string | null; | ||
inRoom: string | null; | ||
room: import("jam-core/dist/jam-core/state").RoomType; | ||
room: import("../jam-core/state").RoomType; | ||
hasRoom: boolean; | ||
@@ -67,2 +80,15 @@ isRoomLoading: boolean; | ||
swarm: null; | ||
peers: string[]; | ||
peerState: Record<string, { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
} | undefined>; | ||
myPeerState: { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
}; | ||
reactions: {}; | ||
@@ -81,5 +107,5 @@ handRaised: boolean; | ||
}; | ||
onState: (key: "roomId" | "micMuted" | "handRaised" | "myIdentity" | "myId" | "inRoom" | "room" | "hasRoom" | "isRoomLoading" | "iAmSpeaker" | "iAmModerator" | "identities" | "otherDeviceInRoom" | "swarm" | "reactions" | "soundMuted" | "audioFile" | "audioFileElement" | "myAudio" | "audioPlayError" | "speaking" | "isRecording" | "recordedAudio" | undefined, listener: (...args: unknown[]) => void) => () => void; | ||
createRoom: (roomId: string, partialRoom?: Partial<import("jam-core/dist/jam-core/state").RoomType> | undefined) => Promise<boolean>; | ||
updateRoom: (roomId: string, room: import("jam-core/dist/jam-core/state").RoomType) => Promise<boolean>; | ||
onState: (key: "identities" | "roomId" | "myIdentity" | "myId" | "swarm" | "micMuted" | "handRaised" | "inRoom" | "room" | "hasRoom" | "isRoomLoading" | "iAmSpeaker" | "iAmModerator" | "otherDeviceInRoom" | "peers" | "peerState" | "myPeerState" | "reactions" | "soundMuted" | "audioFile" | "audioFileElement" | "myAudio" | "audioPlayError" | "speaking" | "isRecording" | "recordedAudio" | undefined, listener: (...args: unknown[]) => void) => () => void; | ||
createRoom: (roomId: string, partialRoom?: Partial<import("../jam-core/state").RoomType> | undefined) => Promise<boolean>; | ||
updateRoom: (roomId: string, room: import("../jam-core/state").RoomType) => Promise<boolean>; | ||
addSpeaker: (roomId: string, peerId: string) => Promise<boolean>; | ||
@@ -91,3 +117,3 @@ addModerator: (roomId: string, peerId: string) => Promise<boolean>; | ||
removeAdmin: (peerId: string) => Promise<boolean>; | ||
updateInfo: (info: import("jam-core/dist/jam-core/state").IdentityInfo) => Promise<boolean>; | ||
updateInfo: (info: import("../jam-core/state").IdentityInfo) => Promise<boolean>; | ||
enterRoom: (roomId: string) => Promise<void>; | ||
@@ -112,7 +138,7 @@ leaveRoom: () => Promise<void>; | ||
declare function useJam(): readonly [{ | ||
myIdentity: import("jam-core/dist/jam-core/state").IdentityType | null; | ||
myIdentity: import("../jam-core/state").IdentityType | null; | ||
myId: string | null; | ||
roomId: string | null; | ||
inRoom: string | null; | ||
room: import("jam-core/dist/jam-core/state").RoomType; | ||
room: import("../jam-core/state").RoomType; | ||
hasRoom: boolean; | ||
@@ -125,2 +151,15 @@ isRoomLoading: boolean; | ||
swarm: null; | ||
peers: string[]; | ||
peerState: Record<string, { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
} | undefined>; | ||
myPeerState: { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
}; | ||
reactions: {}; | ||
@@ -159,8 +198,8 @@ handRaised: boolean; | ||
setState: { | ||
<L extends "roomId" | "micMuted" | "handRaised" | "myIdentity" | "myId" | "inRoom" | "room" | "hasRoom" | "isRoomLoading" | "iAmSpeaker" | "iAmModerator" | "identities" | "otherDeviceInRoom" | "swarm" | "reactions" | "soundMuted" | "audioFile" | "audioFileElement" | "myAudio" | "audioPlayError" | "speaking" | "isRecording" | "recordedAudio">(key: L, value: { | ||
myIdentity: import("jam-core/dist/jam-core/state").IdentityType | null; | ||
<L extends "identities" | "roomId" | "myIdentity" | "myId" | "swarm" | "micMuted" | "handRaised" | "inRoom" | "room" | "hasRoom" | "isRoomLoading" | "iAmSpeaker" | "iAmModerator" | "otherDeviceInRoom" | "peers" | "peerState" | "myPeerState" | "reactions" | "soundMuted" | "audioFile" | "audioFileElement" | "myAudio" | "audioPlayError" | "speaking" | "isRecording" | "recordedAudio">(key: L, value: { | ||
myIdentity: import("../jam-core/state").IdentityType | null; | ||
myId: string | null; | ||
roomId: string | null; | ||
inRoom: string | null; | ||
room: import("jam-core/dist/jam-core/state").RoomType; | ||
room: import("../jam-core/state").RoomType; | ||
hasRoom: boolean; | ||
@@ -173,2 +212,15 @@ isRoomLoading: boolean; | ||
swarm: null; | ||
peers: string[]; | ||
peerState: Record<string, { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
} | undefined>; | ||
myPeerState: { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
}; | ||
reactions: {}; | ||
@@ -187,7 +239,7 @@ handRaised: boolean; | ||
(state: Partial<{ | ||
myIdentity: import("jam-core/dist/jam-core/state").IdentityType | null; | ||
myIdentity: import("../jam-core/state").IdentityType | null; | ||
myId: string | null; | ||
roomId: string | null; | ||
inRoom: string | null; | ||
room: import("jam-core/dist/jam-core/state").RoomType; | ||
room: import("../jam-core/state").RoomType; | ||
hasRoom: boolean; | ||
@@ -200,2 +252,15 @@ isRoomLoading: boolean; | ||
swarm: null; | ||
peers: string[]; | ||
peerState: Record<string, { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
} | undefined>; | ||
myPeerState: { | ||
inRoom: boolean; | ||
micMuted: boolean; | ||
leftStage: boolean; | ||
isRecording: boolean; | ||
}; | ||
reactions: {}; | ||
@@ -214,5 +279,5 @@ handRaised: boolean; | ||
}; | ||
onState: (key: "roomId" | "micMuted" | "handRaised" | "myIdentity" | "myId" | "inRoom" | "room" | "hasRoom" | "isRoomLoading" | "iAmSpeaker" | "iAmModerator" | "identities" | "otherDeviceInRoom" | "swarm" | "reactions" | "soundMuted" | "audioFile" | "audioFileElement" | "myAudio" | "audioPlayError" | "speaking" | "isRecording" | "recordedAudio" | undefined, listener: (...args: unknown[]) => void) => () => void; | ||
createRoom: (roomId: string, partialRoom?: Partial<import("jam-core/dist/jam-core/state").RoomType> | undefined) => Promise<boolean>; | ||
updateRoom: (roomId: string, room: import("jam-core/dist/jam-core/state").RoomType) => Promise<boolean>; | ||
onState: (key: "identities" | "roomId" | "myIdentity" | "myId" | "swarm" | "micMuted" | "handRaised" | "inRoom" | "room" | "hasRoom" | "isRoomLoading" | "iAmSpeaker" | "iAmModerator" | "otherDeviceInRoom" | "peers" | "peerState" | "myPeerState" | "reactions" | "soundMuted" | "audioFile" | "audioFileElement" | "myAudio" | "audioPlayError" | "speaking" | "isRecording" | "recordedAudio" | undefined, listener: (...args: unknown[]) => void) => () => void; | ||
createRoom: (roomId: string, partialRoom?: Partial<import("../jam-core/state").RoomType> | undefined) => Promise<boolean>; | ||
updateRoom: (roomId: string, room: import("../jam-core/state").RoomType) => Promise<boolean>; | ||
addSpeaker: (roomId: string, peerId: string) => Promise<boolean>; | ||
@@ -224,3 +289,3 @@ addModerator: (roomId: string, peerId: string) => Promise<boolean>; | ||
removeAdmin: (peerId: string) => Promise<boolean>; | ||
updateInfo: (info: import("jam-core/dist/jam-core/state").IdentityInfo) => Promise<boolean>; | ||
updateInfo: (info: import("../jam-core/state").IdentityInfo) => Promise<boolean>; | ||
enterRoom: (roomId: string) => Promise<void>; | ||
@@ -227,0 +292,0 @@ leaveRoom: () => Promise<void>; |
{ | ||
"name": "jam-core-react", | ||
"description": "React hooks for creating custom audio spaces like Clubhouse / Twitter Spaces, made with WebRTC", | ||
"version": "0.3.10", | ||
"version": "0.3.11", | ||
"main": "dist/index.js", | ||
"license": "AGPL-3.0", | ||
"type": "module", | ||
"exports": { | ||
"import": "./dist/index.js" | ||
}, | ||
"proxy": "../../jam-core-react.ts", | ||
"scripts": { | ||
"build": "tsc --emitDeclarationOnly && mv dist/jam-core-react.d.ts dist/index.d.ts && esbuild --bundle ../../jam-core-react.ts --outfile=./dist/index.js --format=esm --target=es2020 --external:compact-base64 --external:minimal-state --external:simple-signed-records-engine --external:use-minimal-state --external:jam-core --external:react", | ||
"build": "tsc --emitDeclarationOnly && mv dist/jam-core-react.d.ts dist/index.d.ts && node ../buildProxyPackage.mjs", | ||
"bundle": "esbuild --bundle ../../jam-core-react.ts --minify --outfile=./dist/bundle.js --format=esm --target=es6", | ||
@@ -18,3 +23,3 @@ "size": "cat dist/bundle.js | gzip | wc -c", | ||
"compact-base64": "^2.1.2", | ||
"jam-core": "0.3.10", | ||
"jam-core": "0.3.11", | ||
"minimal-state": "^5.6.0", | ||
@@ -21,0 +26,0 @@ "simple-signed-records-engine": "0.1.2", |
Sorry, the diff of this file is too big to display
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
433863
11
2641
4
Yes
+ Addedjam-core@0.3.11(transitive)
- Removedjam-core@0.3.10(transitive)
Updatedjam-core@0.3.11