@whereby.com/browser-sdk 3.37.0 → 3.39.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.
@@ -27,13 +27,17 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
27
27
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(PopoverPrimitive);
28
28
 
29
29
  const WherebyContext = React__namespace.createContext(null);
30
- function Provider({ children }) {
31
- const client = React__namespace.useMemo(() => new core.WherebyClient(), []);
30
+ function Provider({ children, client: externalClient }) {
31
+ const client = React__namespace.useMemo(() => externalClient !== null && externalClient !== void 0 ? externalClient : new core.WherebyClient(), [externalClient]);
32
+ const ownsClient = !externalClient;
32
33
  React__namespace.useEffect(() => {
34
+ if (!ownsClient) {
35
+ return;
36
+ }
33
37
  return () => {
34
38
  client.destroy();
35
39
  };
36
- }, [client]);
40
+ }, [client, ownsClient]);
37
41
  return React__namespace.createElement(WherebyContext.Provider, { value: client }, children);
38
42
  }
39
43
 
@@ -202,7 +206,7 @@ const VideoView = React__namespace.forwardRef((_a, ref) => {
202
206
  });
203
207
  VideoView.displayName = "VideoView";
204
208
 
205
- const browserSdkVersion = "3.37.0";
209
+ const browserSdkVersion = "3.39.0";
206
210
 
207
211
  const initialState$1 = {
208
212
  chatMessages: [],
@@ -2867,6 +2871,10 @@ Object.defineProperty(exports, "ROOM_INTEGRATION_PICKER_MESSAGES", {
2867
2871
  enumerable: true,
2868
2872
  get: function () { return core.ROOM_INTEGRATION_PICKER_MESSAGES; }
2869
2873
  });
2874
+ Object.defineProperty(exports, "WherebyClient", {
2875
+ enumerable: true,
2876
+ get: function () { return core.WherebyClient; }
2877
+ });
2870
2878
  Object.defineProperty(exports, "getUsableCameraEffectPresets", {
2871
2879
  enumerable: true,
2872
2880
  get: function () { return core.getUsableCameraEffectPresets; }
@@ -1,14 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import * as _whereby_com_core from '@whereby.com/core';
3
- import { LocalMediaState, LocalMediaOptions, InitialMuteStates, RoomJoinedSuccess, SendFilesOptions, ChatFileShare, ToggleAudioOnlyModeOptions, RoomIntegrationProps, StartBreakoutSessionOptions, UpdateBreakoutSessionOptions, RoomConnectionState, NotificationsEventEmitter, ClientView, RoomIntegrationSessionView, RoomIntegration, RoomIntegrationPickerResult } from '@whereby.com/core';
4
- export { ACCEPTED_FILE_TYPES, BreakoutState as Breakout, CPUQualityLevel, CallQualityLevel, ChatFileShare, ChatMessageState as ChatMessage, CloudRecordingState as CloudRecording, FileShareError, FileUpload, KnockResponse, LiveStreamState as LiveStreaming, LocalParticipantState as LocalParticipant, LocalParticipantQualityReport, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, ROOM_INTEGRATION_PICKER_MESSAGES, RemoteParticipantState as RemoteParticipant, RemoteParticipantQualityReport, RoomConnectionState as RoomConnection, RoomIntegration, RoomIntegrationContent, RoomIntegrationError, RoomIntegrationErrorDetail, RoomIntegrationPickerResult, RoomIntegrationProps, RoomIntegrationSession, RoomIntegrationSessionView, RoomIntegrationsState as RoomIntegrations, ScreenshareState as Screenshare, SendFilesOptions, ToggleAudioOnlyModeOptions, WaitingParticipantState as WaitingParticipant, YouTubeContentMetadata, getUsableCameraEffectPresets, isAudioDenoiserSupported, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl } from '@whereby.com/core';
3
+ import { WherebyClient, LocalMediaState, LocalMediaOptions, InitialMuteStates, RoomJoinedSuccess, SendFilesOptions, ChatFileShare, ToggleAudioOnlyModeOptions, RoomIntegrationProps, StartBreakoutSessionOptions, UpdateBreakoutSessionOptions, RoomConnectionState, NotificationsEventEmitter, ClientView, RoomIntegrationSessionView, RoomIntegration, RoomIntegrationPickerResult } from '@whereby.com/core';
4
+ export { ACCEPTED_FILE_TYPES, BreakoutState as Breakout, CPUQualityLevel, CallQualityLevel, ChatFileShare, ChatMessageState as ChatMessage, CloudRecordingState as CloudRecording, DeviceCredentials, FileShareError, FileUpload, KnockResponse, LiveStreamState as LiveStreaming, LocalParticipantState as LocalParticipant, LocalParticipantQualityReport, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, ROOM_INTEGRATION_PICKER_MESSAGES, RemoteParticipantState as RemoteParticipant, RemoteParticipantQualityReport, RoomConnectionState as RoomConnection, RoomIntegration, RoomIntegrationContent, RoomIntegrationError, RoomIntegrationErrorDetail, RoomIntegrationPickerResult, RoomIntegrationProps, RoomIntegrationSession, RoomIntegrationSessionView, RoomIntegrationsState as RoomIntegrations, ScreenshareState as Screenshare, SendFilesOptions, ToggleAudioOnlyModeOptions, WaitingParticipantState as WaitingParticipant, WherebyClient, YouTubeContentMetadata, getUsableCameraEffectPresets, isAudioDenoiserSupported, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl } from '@whereby.com/core';
5
5
  import * as _radix_ui_react_popover from '@radix-ui/react-popover';
6
6
  import { PopoverProps } from '@radix-ui/react-popover';
7
7
 
8
8
  interface ProviderProps {
9
9
  children: React.ReactNode;
10
+ client?: WherebyClient;
10
11
  }
11
- declare function Provider({ children }: ProviderProps): React.JSX.Element;
12
+ declare function Provider({ children, client: externalClient }: ProviderProps): React.JSX.Element;
12
13
 
13
14
  interface VideoViewSelfProps {
14
15
  stream: MediaStream;
@@ -1,18 +1,22 @@
1
1
  import * as React from 'react';
2
2
  import { WherebyClient, CURRENT_SPEAKER_CHANGED, debounce, ROOM_INTEGRATION_PICKER_MESSAGES, roomIntegrationPickerUrl } from '@whereby.com/core';
3
- export { ACCEPTED_FILE_TYPES, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, ROOM_INTEGRATION_PICKER_MESSAGES, getUsableCameraEffectPresets, isAudioDenoiserSupported, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl } from '@whereby.com/core';
3
+ export { ACCEPTED_FILE_TYPES, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, ROOM_INTEGRATION_PICKER_MESSAGES, WherebyClient, getUsableCameraEffectPresets, isAudioDenoiserSupported, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl } from '@whereby.com/core';
4
4
  import adapterRaw from 'webrtc-adapter';
5
5
  import runes from 'runes';
6
6
  import * as PopoverPrimitive from '@radix-ui/react-popover';
7
7
 
8
8
  const WherebyContext = React.createContext(null);
9
- function Provider({ children }) {
10
- const client = React.useMemo(() => new WherebyClient(), []);
9
+ function Provider({ children, client: externalClient }) {
10
+ const client = React.useMemo(() => externalClient !== null && externalClient !== void 0 ? externalClient : new WherebyClient(), [externalClient]);
11
+ const ownsClient = !externalClient;
11
12
  React.useEffect(() => {
13
+ if (!ownsClient) {
14
+ return;
15
+ }
12
16
  return () => {
13
17
  client.destroy();
14
18
  };
15
- }, [client]);
19
+ }, [client, ownsClient]);
16
20
  return React.createElement(WherebyContext.Provider, { value: client }, children);
17
21
  }
18
22
 
@@ -181,7 +185,7 @@ const VideoView = React.forwardRef((_a, ref) => {
181
185
  });
182
186
  VideoView.displayName = "VideoView";
183
187
 
184
- const browserSdkVersion = "3.37.0";
188
+ const browserSdkVersion = "3.39.0";
185
189
 
186
190
  const initialState$1 = {
187
191
  chatMessages: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whereby.com/browser-sdk",
3
- "version": "3.37.0",
3
+ "version": "3.39.0",
4
4
  "description": "Modules for integration Whereby video in web apps",
5
5
  "author": "Whereby AS",
6
6
  "license": "MIT",
@@ -66,15 +66,15 @@
66
66
  "eslint-plugin-storybook": "9.0.16",
67
67
  "@storybook/addon-docs": "^9.0.16",
68
68
  "@whereby.com/eslint-config": "0.1.0",
69
- "@whereby.com/jest-config": "0.1.0",
70
69
  "@whereby.com/prettier-config": "0.1.0",
71
70
  "@whereby.com/rollup-config": "0.1.1",
71
+ "@whereby.com/jest-config": "0.1.0",
72
72
  "@whereby.com/tsconfig": "0.1.0"
73
73
  },
74
74
  "dependencies": {
75
75
  "@radix-ui/react-popover": "^1.0.7",
76
- "@whereby.com/media": "11.3.2",
77
- "@whereby.com/core": "1.27.0",
76
+ "@whereby.com/media": "11.3.3",
77
+ "@whereby.com/core": "1.28.0",
78
78
  "clsx": "^2.1.1",
79
79
  "heresy": "^1.0.4",
80
80
  "runes": "^0.4.3",