@100mslive/roomkit-react 0.1.19-alpha.0 → 0.1.19-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-GG4WVUQY.js → HLSView-UBVLOPNY.js} +2 -2
- package/dist/Prebuilt/components/VirtualBackground/VBPicker.d.ts +4 -2
- package/dist/{chunk-GXJIUWTP.js → chunk-VU2CQFCB.js} +12 -11
- package/dist/{chunk-GXJIUWTP.js.map → chunk-VU2CQFCB.js.map} +2 -2
- package/dist/index.cjs.js +10 -9
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +8 -8
- package/dist/meta.esbuild.json +15 -15
- package/package.json +6 -6
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +5 -3
- package/src/Prebuilt/layouts/SidePane.tsx +6 -2
- package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +5 -3
- /package/dist/{HLSView-GG4WVUQY.js.map → HLSView-UBVLOPNY.js.map} +0 -0
package/dist/index.js
CHANGED
package/dist/meta.cjs.json
CHANGED
@@ -3101,7 +3101,7 @@
|
|
3101
3101
|
"format": "esm"
|
3102
3102
|
},
|
3103
3103
|
"src/Prebuilt/provider/roomLayoutProvider/index.tsx": {
|
3104
|
-
"bytes":
|
3104
|
+
"bytes": 1857,
|
3105
3105
|
"imports": [
|
3106
3106
|
{
|
3107
3107
|
"path": "react",
|
@@ -8577,7 +8577,7 @@
|
|
8577
8577
|
"format": "esm"
|
8578
8578
|
},
|
8579
8579
|
"src/Prebuilt/components/VirtualBackground/VBPicker.tsx": {
|
8580
|
-
"bytes":
|
8580
|
+
"bytes": 6579,
|
8581
8581
|
"imports": [
|
8582
8582
|
{
|
8583
8583
|
"path": "react",
|
@@ -8653,7 +8653,7 @@
|
|
8653
8653
|
"format": "esm"
|
8654
8654
|
},
|
8655
8655
|
"src/Prebuilt/layouts/SidePane.tsx": {
|
8656
|
-
"bytes":
|
8656
|
+
"bytes": 4487,
|
8657
8657
|
"imports": [
|
8658
8658
|
{
|
8659
8659
|
"path": "react",
|
@@ -12350,7 +12350,7 @@
|
|
12350
12350
|
"imports": [],
|
12351
12351
|
"exports": [],
|
12352
12352
|
"inputs": {},
|
12353
|
-
"bytes":
|
12353
|
+
"bytes": 3083722
|
12354
12354
|
},
|
12355
12355
|
"dist/index.cjs.js": {
|
12356
12356
|
"imports": [
|
@@ -14984,7 +14984,7 @@
|
|
14984
14984
|
"entryPoint": "src/index.ts",
|
14985
14985
|
"inputs": {
|
14986
14986
|
"<define:process.env>": {
|
14987
|
-
"bytesInOutput":
|
14987
|
+
"bytesInOutput": 18674
|
14988
14988
|
},
|
14989
14989
|
"src/Theme/base.config.ts": {
|
14990
14990
|
"bytesInOutput": 6104
|
@@ -15713,10 +15713,10 @@
|
|
15713
15713
|
"bytesInOutput": 1222
|
15714
15714
|
},
|
15715
15715
|
"src/Prebuilt/components/VirtualBackground/VBPicker.tsx": {
|
15716
|
-
"bytesInOutput":
|
15716
|
+
"bytesInOutput": 8620
|
15717
15717
|
},
|
15718
15718
|
"src/Prebuilt/layouts/SidePane.tsx": {
|
15719
|
-
"bytesInOutput":
|
15719
|
+
"bytesInOutput": 5095
|
15720
15720
|
},
|
15721
15721
|
"src/Prebuilt/components/Chip.tsx": {
|
15722
15722
|
"bytesInOutput": 1118
|
@@ -15959,7 +15959,7 @@
|
|
15959
15959
|
"bytesInOutput": 2930
|
15960
15960
|
}
|
15961
15961
|
},
|
15962
|
-
"bytes":
|
15962
|
+
"bytes": 1434712
|
15963
15963
|
}
|
15964
15964
|
}
|
15965
15965
|
}
|
package/dist/meta.esbuild.json
CHANGED
@@ -3101,7 +3101,7 @@
|
|
3101
3101
|
"format": "esm"
|
3102
3102
|
},
|
3103
3103
|
"src/Prebuilt/provider/roomLayoutProvider/index.tsx": {
|
3104
|
-
"bytes":
|
3104
|
+
"bytes": 1857,
|
3105
3105
|
"imports": [
|
3106
3106
|
{
|
3107
3107
|
"path": "react",
|
@@ -8577,7 +8577,7 @@
|
|
8577
8577
|
"format": "esm"
|
8578
8578
|
},
|
8579
8579
|
"src/Prebuilt/components/VirtualBackground/VBPicker.tsx": {
|
8580
|
-
"bytes":
|
8580
|
+
"bytes": 6579,
|
8581
8581
|
"imports": [
|
8582
8582
|
{
|
8583
8583
|
"path": "react",
|
@@ -8653,7 +8653,7 @@
|
|
8653
8653
|
"format": "esm"
|
8654
8654
|
},
|
8655
8655
|
"src/Prebuilt/layouts/SidePane.tsx": {
|
8656
|
-
"bytes":
|
8656
|
+
"bytes": 4487,
|
8657
8657
|
"imports": [
|
8658
8658
|
{
|
8659
8659
|
"path": "react",
|
@@ -12355,7 +12355,7 @@
|
|
12355
12355
|
"dist/index.js": {
|
12356
12356
|
"imports": [
|
12357
12357
|
{
|
12358
|
-
"path": "dist/chunk-
|
12358
|
+
"path": "dist/chunk-VU2CQFCB.js",
|
12359
12359
|
"kind": "import-statement"
|
12360
12360
|
}
|
12361
12361
|
],
|
@@ -12427,16 +12427,16 @@
|
|
12427
12427
|
"inputs": {},
|
12428
12428
|
"bytes": 1798
|
12429
12429
|
},
|
12430
|
-
"dist/HLSView-
|
12430
|
+
"dist/HLSView-UBVLOPNY.js.map": {
|
12431
12431
|
"imports": [],
|
12432
12432
|
"exports": [],
|
12433
12433
|
"inputs": {},
|
12434
12434
|
"bytes": 58021
|
12435
12435
|
},
|
12436
|
-
"dist/HLSView-
|
12436
|
+
"dist/HLSView-UBVLOPNY.js": {
|
12437
12437
|
"imports": [
|
12438
12438
|
{
|
12439
|
-
"path": "dist/chunk-
|
12439
|
+
"path": "dist/chunk-VU2CQFCB.js",
|
12440
12440
|
"kind": "import-statement"
|
12441
12441
|
},
|
12442
12442
|
{
|
@@ -12600,13 +12600,13 @@
|
|
12600
12600
|
},
|
12601
12601
|
"bytes": 36449
|
12602
12602
|
},
|
12603
|
-
"dist/chunk-
|
12603
|
+
"dist/chunk-VU2CQFCB.js.map": {
|
12604
12604
|
"imports": [],
|
12605
12605
|
"exports": [],
|
12606
12606
|
"inputs": {},
|
12607
|
-
"bytes":
|
12607
|
+
"bytes": 3021393
|
12608
12608
|
},
|
12609
|
-
"dist/chunk-
|
12609
|
+
"dist/chunk-VU2CQFCB.js": {
|
12610
12610
|
"imports": [
|
12611
12611
|
{
|
12612
12612
|
"path": "react",
|
@@ -14794,7 +14794,7 @@
|
|
14794
14794
|
"external": true
|
14795
14795
|
},
|
14796
14796
|
{
|
14797
|
-
"path": "dist/HLSView-
|
14797
|
+
"path": "dist/HLSView-UBVLOPNY.js",
|
14798
14798
|
"kind": "dynamic-import"
|
14799
14799
|
},
|
14800
14800
|
{
|
@@ -15205,7 +15205,7 @@
|
|
15205
15205
|
],
|
15206
15206
|
"inputs": {
|
15207
15207
|
"<define:process.env>": {
|
15208
|
-
"bytesInOutput":
|
15208
|
+
"bytesInOutput": 18674
|
15209
15209
|
},
|
15210
15210
|
"../../node_modules/lodash/lodash.js": {
|
15211
15211
|
"bytesInOutput": 224380
|
@@ -15772,7 +15772,7 @@
|
|
15772
15772
|
"bytesInOutput": 9825
|
15773
15773
|
},
|
15774
15774
|
"src/Prebuilt/layouts/SidePane.tsx": {
|
15775
|
-
"bytesInOutput":
|
15775
|
+
"bytesInOutput": 4143
|
15776
15776
|
},
|
15777
15777
|
"src/Prebuilt/components/Polls/Polls.tsx": {
|
15778
15778
|
"bytesInOutput": 723
|
@@ -15907,7 +15907,7 @@
|
|
15907
15907
|
"bytesInOutput": 1050
|
15908
15908
|
},
|
15909
15909
|
"src/Prebuilt/components/VirtualBackground/VBPicker.tsx": {
|
15910
|
-
"bytesInOutput":
|
15910
|
+
"bytesInOutput": 6935
|
15911
15911
|
},
|
15912
15912
|
"src/Prebuilt/components/VirtualBackground/VBCollection.tsx": {
|
15913
15913
|
"bytesInOutput": 1457
|
@@ -16099,7 +16099,7 @@
|
|
16099
16099
|
"bytesInOutput": 418
|
16100
16100
|
}
|
16101
16101
|
},
|
16102
|
-
"bytes":
|
16102
|
+
"bytes": 1218074
|
16103
16103
|
}
|
16104
16104
|
}
|
16105
16105
|
}
|
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"prebuilt",
|
11
11
|
"roomkit"
|
12
12
|
],
|
13
|
-
"version": "0.1.19-alpha.
|
13
|
+
"version": "0.1.19-alpha.1",
|
14
14
|
"author": "100ms",
|
15
15
|
"license": "MIT",
|
16
16
|
"files": [
|
@@ -76,10 +76,10 @@
|
|
76
76
|
"react": ">=17.0.2 <19.0.0"
|
77
77
|
},
|
78
78
|
"dependencies": {
|
79
|
-
"@100mslive/hls-player": "0.1.28-alpha.
|
80
|
-
"@100mslive/hms-virtual-background": "1.11.28-alpha.
|
81
|
-
"@100mslive/react-icons": "0.8.28-alpha.
|
82
|
-
"@100mslive/react-sdk": "0.8.28-alpha.
|
79
|
+
"@100mslive/hls-player": "0.1.28-alpha.1",
|
80
|
+
"@100mslive/hms-virtual-background": "1.11.28-alpha.1",
|
81
|
+
"@100mslive/react-icons": "0.8.28-alpha.1",
|
82
|
+
"@100mslive/react-sdk": "0.8.28-alpha.1",
|
83
83
|
"@100mslive/types-prebuilt": "0.12.5",
|
84
84
|
"@emoji-mart/data": "^1.0.6",
|
85
85
|
"@emoji-mart/react": "^1.0.1",
|
@@ -115,5 +115,5 @@
|
|
115
115
|
"uuid": "^8.3.2",
|
116
116
|
"worker-timers": "^7.0.40"
|
117
117
|
},
|
118
|
-
"gitHead": "
|
118
|
+
"gitHead": "5f85c1840b3852eee50dbd94689eac2aa7a1f327"
|
119
119
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
2
2
|
import { HMSVirtualBackgroundTypes } from '@100mslive/hms-virtual-background';
|
3
|
-
import {
|
3
|
+
import { VirtualBackgroundMedia } from '@100mslive/types-prebuilt/elements/virtual_background';
|
4
4
|
import {
|
5
5
|
HMSRoomState,
|
6
6
|
selectIsLargeRoom,
|
@@ -28,7 +28,7 @@ import { defaultMedia, vbPlugin } from './constants';
|
|
28
28
|
const iconDims = { height: '40px', width: '40px' };
|
29
29
|
const MAX_RETRIES = 2;
|
30
30
|
|
31
|
-
export const VBPicker = ({
|
31
|
+
export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBackgroundMedia[] }) => {
|
32
32
|
const toggleVB = useSidepaneToggle(SIDE_PANE_OPTIONS.VB);
|
33
33
|
const hmsActions = useHMSActions();
|
34
34
|
const role = useHMSStore(selectLocalPeerRole);
|
@@ -46,7 +46,9 @@ export const VBPicker = ({ background_media = [] }: VirtualBackground = {}) => {
|
|
46
46
|
const roomState = useHMSStore(selectRoomState);
|
47
47
|
const isLargeRoom = useHMSStore(selectIsLargeRoom);
|
48
48
|
const addedPluginToVideoTrack = useRef(false);
|
49
|
-
const mediaList =
|
49
|
+
const mediaList = backgroundMedia.length
|
50
|
+
? backgroundMedia.map((media: VirtualBackgroundMedia) => media?.url)
|
51
|
+
: defaultMedia;
|
50
52
|
|
51
53
|
const inPreview = roomState === HMSRoomState.Preview;
|
52
54
|
// Hidden in preview as the effect will be visible in the preview tile. Needed inside the room because the peer might not be on-screen
|
@@ -12,7 +12,10 @@ import { Box, Flex } from '../../Layout';
|
|
12
12
|
import { config as cssConfig } from '../../Theme';
|
13
13
|
// @ts-ignore: No implicit Any
|
14
14
|
import { useSidepaneReset } from '../components/AppData/useSidepane';
|
15
|
-
import {
|
15
|
+
import {
|
16
|
+
useRoomLayoutConferencingScreen,
|
17
|
+
useRoomLayoutPreviewScreen,
|
18
|
+
} from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
16
19
|
import { translateAcross } from '../../utils';
|
17
20
|
import { APP_DATA, SIDE_PANE_OPTIONS } from '../common/constants';
|
18
21
|
|
@@ -28,6 +31,7 @@ const SidePane = ({
|
|
28
31
|
const activeScreensharePeerId = useHMSStore(selectAppData(APP_DATA.activeScreensharePeerId));
|
29
32
|
const trackId = useHMSStore(selectVideoTrackByPeerID(activeScreensharePeerId))?.id;
|
30
33
|
const { elements } = useRoomLayoutConferencingScreen();
|
34
|
+
const { elements: preview_elements } = useRoomLayoutPreviewScreen();
|
31
35
|
const resetSidePane = useSidepaneReset();
|
32
36
|
let ViewComponent;
|
33
37
|
if (sidepane === SIDE_PANE_OPTIONS.POLLS) {
|
@@ -37,7 +41,7 @@ const SidePane = ({
|
|
37
41
|
ViewComponent = <SidePaneTabs hideControls={hideControls} active={sidepane} />;
|
38
42
|
}
|
39
43
|
if (sidepane === SIDE_PANE_OPTIONS.VB) {
|
40
|
-
ViewComponent = <VBPicker {
|
44
|
+
ViewComponent = <VBPicker backgroundMedia={preview_elements?.virtual_background?.background_media || []} />;
|
41
45
|
}
|
42
46
|
|
43
47
|
useEffect(() => {
|
@@ -18,11 +18,14 @@ export const RoomLayoutContext = React.createContext<
|
|
18
18
|
| undefined
|
19
19
|
>(undefined);
|
20
20
|
|
21
|
+
// The default merge in lodash merges the values of current layout and the changes.
|
22
|
+
// This behaviour makes changes in array based values inconsistent since a union happens.
|
23
|
+
// The customizer uses the new value provided if one of the values is an array
|
21
24
|
function customizer(objValue: any, srcValue: any) {
|
22
|
-
if (isArray(objValue)
|
25
|
+
if (isArray(objValue) || isArray(srcValue)) {
|
23
26
|
return srcValue;
|
24
27
|
}
|
25
|
-
// default
|
28
|
+
// default merge behaviour is followed
|
26
29
|
return undefined;
|
27
30
|
}
|
28
31
|
|
@@ -34,7 +37,6 @@ export const RoomLayoutProvider: React.FC<React.PropsWithChildren<RoomLayoutProv
|
|
34
37
|
const authToken: string = useAuthToken();
|
35
38
|
const { layout, updateRoomLayoutForRole } = useFetchRoomLayout({ authToken, endpoint: roomLayoutEndpoint });
|
36
39
|
const mergedLayout = authToken && layout ? mergeWith(layout, overrideLayout, customizer) : layout;
|
37
|
-
|
38
40
|
return (
|
39
41
|
<RoomLayoutContext.Provider value={{ layout: mergedLayout, updateRoomLayoutForRole }}>
|
40
42
|
{children}
|
File without changes
|