@100mslive/roomkit-react 0.3.15-alpha.3 → 0.3.15-alpha.5

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.
@@ -2137,7 +2137,7 @@
2137
2137
  "format": "esm"
2138
2138
  },
2139
2139
  "src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts": {
2140
- "bytes": 2489,
2140
+ "bytes": 2758,
2141
2141
  "imports": [
2142
2142
  {
2143
2143
  "path": "react",
@@ -2163,7 +2163,7 @@
2163
2163
  "format": "esm"
2164
2164
  },
2165
2165
  "src/Prebuilt/provider/roomLayoutProvider/index.tsx": {
2166
- "bytes": 1865,
2166
+ "bytes": 2098,
2167
2167
  "imports": [
2168
2168
  {
2169
2169
  "path": "react",
@@ -10943,7 +10943,7 @@
10943
10943
  ],
10944
10944
  "format": "esm"
10945
10945
  },
10946
- "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686d5b2/tldraw.css": {
10946
+ "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2bafa2/tldraw.css": {
10947
10947
  "bytes": 80111,
10948
10948
  "imports": [
10949
10949
  {
@@ -10993,7 +10993,7 @@
10993
10993
  }
10994
10994
  ]
10995
10995
  },
10996
- "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css": {
10996
+ "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2baed1/index.css": {
10997
10997
  "bytes": 597,
10998
10998
  "imports": [
10999
10999
  {
@@ -11002,7 +11002,7 @@
11002
11002
  "external": true
11003
11003
  },
11004
11004
  {
11005
- "path": "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686d5b2/tldraw.css",
11005
+ "path": "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2bafa2/tldraw.css",
11006
11006
  "kind": "import-rule",
11007
11007
  "original": "@tldraw/tldraw/tldraw.css"
11008
11008
  }
@@ -11077,7 +11077,7 @@
11077
11077
  "original": "../../common/constants"
11078
11078
  },
11079
11079
  {
11080
- "path": "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css",
11080
+ "path": "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2baed1/index.css",
11081
11081
  "kind": "import-statement",
11082
11082
  "original": "@100mslive/hms-whiteboard/index.css"
11083
11083
  },
@@ -12716,7 +12716,7 @@
12716
12716
  "format": "esm"
12717
12717
  },
12718
12718
  "src/Prebuilt/AppStateContext.tsx": {
12719
- "bytes": 3129,
12719
+ "bytes": 3230,
12720
12720
  "imports": [
12721
12721
  {
12722
12722
  "path": "react",
@@ -14950,7 +14950,7 @@
14950
14950
  "dist/index.js": {
14951
14951
  "imports": [
14952
14952
  {
14953
- "path": "dist/chunk-BVSFQTDX.js",
14953
+ "path": "dist/chunk-WN7XPMBC.js",
14954
14954
  "kind": "import-statement"
14955
14955
  }
14956
14956
  ],
@@ -15026,16 +15026,16 @@
15026
15026
  "inputs": {},
15027
15027
  "bytes": 1882
15028
15028
  },
15029
- "dist/HLSView-B4LXRW3N.js.map": {
15029
+ "dist/HLSView-OMPUMOW4.js.map": {
15030
15030
  "imports": [],
15031
15031
  "exports": [],
15032
15032
  "inputs": {},
15033
15033
  "bytes": 100275
15034
15034
  },
15035
- "dist/HLSView-B4LXRW3N.js": {
15035
+ "dist/HLSView-OMPUMOW4.js": {
15036
15036
  "imports": [
15037
15037
  {
15038
- "path": "dist/chunk-BVSFQTDX.js",
15038
+ "path": "dist/chunk-WN7XPMBC.js",
15039
15039
  "kind": "import-statement"
15040
15040
  },
15041
15041
  {
@@ -15213,7 +15213,7 @@
15213
15213
  "default"
15214
15214
  ],
15215
15215
  "entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
15216
- "cssBundle": "dist/HLSView-7HFHBF6S.css",
15216
+ "cssBundle": "dist/HLSView-3KKVE5SS.css",
15217
15217
  "inputs": {
15218
15218
  "src/Prebuilt/layouts/HLSView.jsx": {
15219
15219
  "bytesInOutput": 27671
@@ -15272,13 +15272,13 @@
15272
15272
  },
15273
15273
  "bytes": 61702
15274
15274
  },
15275
- "dist/chunk-BVSFQTDX.js.map": {
15275
+ "dist/chunk-WN7XPMBC.js.map": {
15276
15276
  "imports": [],
15277
15277
  "exports": [],
15278
15278
  "inputs": {},
15279
- "bytes": 3442830
15279
+ "bytes": 3443734
15280
15280
  },
15281
- "dist/chunk-BVSFQTDX.js": {
15281
+ "dist/chunk-WN7XPMBC.js": {
15282
15282
  "imports": [
15283
15283
  {
15284
15284
  "path": "react",
@@ -17751,7 +17751,7 @@
17751
17751
  "external": true
17752
17752
  },
17753
17753
  {
17754
- "path": "dist/HLSView-B4LXRW3N.js",
17754
+ "path": "dist/HLSView-OMPUMOW4.js",
17755
17755
  "kind": "dynamic-import"
17756
17756
  },
17757
17757
  {
@@ -18340,7 +18340,7 @@
18340
18340
  ],
18341
18341
  "inputs": {
18342
18342
  "<define:process.env>": {
18343
- "bytesInOutput": 17931
18343
+ "bytesInOutput": 17905
18344
18344
  },
18345
18345
  "../../node_modules/lodash/lodash.js": {
18346
18346
  "bytesInOutput": 224289
@@ -18649,10 +18649,10 @@
18649
18649
  "bytesInOutput": 2709
18650
18650
  },
18651
18651
  "src/Prebuilt/provider/roomLayoutProvider/index.tsx": {
18652
- "bytesInOutput": 1118
18652
+ "bytesInOutput": 1312
18653
18653
  },
18654
18654
  "src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts": {
18655
- "bytesInOutput": 2254
18655
+ "bytesInOutput": 2483
18656
18656
  },
18657
18657
  "src/Prebuilt/provider/roomLayoutProvider/constants/index.ts": {
18658
18658
  "bytesInOutput": 1486
@@ -19209,7 +19209,7 @@
19209
19209
  "src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
19210
19210
  "bytesInOutput": 2830
19211
19211
  },
19212
- "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css": {
19212
+ "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2baed1/index.css": {
19213
19213
  "bytesInOutput": 0
19214
19214
  },
19215
19215
  "src/Prebuilt/common/PeersSorter.ts": {
@@ -19258,7 +19258,7 @@
19258
19258
  "bytesInOutput": 2185
19259
19259
  },
19260
19260
  "src/Prebuilt/AppStateContext.tsx": {
19261
- "bytesInOutput": 2554
19261
+ "bytesInOutput": 2668
19262
19262
  },
19263
19263
  "src/Prebuilt/components/hooks/useRedirectToLeave.tsx": {
19264
19264
  "bytesInOutput": 491
@@ -19378,7 +19378,7 @@
19378
19378
  "bytesInOutput": 2628
19379
19379
  }
19380
19380
  },
19381
- "bytes": 1425763
19381
+ "bytes": 1426274
19382
19382
  },
19383
19383
  "dist/index.css.map": {
19384
19384
  "imports": [],
@@ -19440,22 +19440,22 @@
19440
19440
  }
19441
19441
  ],
19442
19442
  "inputs": {
19443
- "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686d5b2/tldraw.css": {
19443
+ "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2bafa2/tldraw.css": {
19444
19444
  "bytesInOutput": 75223
19445
19445
  },
19446
- "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css": {
19446
+ "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2baed1/index.css": {
19447
19447
  "bytesInOutput": 401
19448
19448
  }
19449
19449
  },
19450
19450
  "bytes": 75901
19451
19451
  },
19452
- "dist/HLSView-7HFHBF6S.css.map": {
19452
+ "dist/HLSView-3KKVE5SS.css.map": {
19453
19453
  "imports": [],
19454
19454
  "exports": [],
19455
19455
  "inputs": {},
19456
19456
  "bytes": 122402
19457
19457
  },
19458
- "dist/HLSView-7HFHBF6S.css": {
19458
+ "dist/HLSView-3KKVE5SS.css": {
19459
19459
  "imports": [
19460
19460
  {
19461
19461
  "path": "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap",
@@ -19509,10 +19509,10 @@
19509
19509
  }
19510
19510
  ],
19511
19511
  "inputs": {
19512
- "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686d5b2/tldraw.css": {
19512
+ "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2bafa2/tldraw.css": {
19513
19513
  "bytesInOutput": 75223
19514
19514
  },
19515
- "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css": {
19515
+ "../../../../../../../tmp/tmp-2788-b93yXUx6U5UN/19090f2baed1/index.css": {
19516
19516
  "bytesInOutput": 401
19517
19517
  }
19518
19518
  },
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.15-alpha.3",
13
+ "version": "0.3.15-alpha.5",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -75,12 +75,12 @@
75
75
  "react": ">=17.0.2 <19.0.0"
76
76
  },
77
77
  "dependencies": {
78
- "@100mslive/hls-player": "0.3.15-alpha.3",
78
+ "@100mslive/hls-player": "0.3.15-alpha.5",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.15-alpha.3",
81
- "@100mslive/hms-whiteboard": "0.0.5-alpha.3",
82
- "@100mslive/react-icons": "0.10.15-alpha.3",
83
- "@100mslive/react-sdk": "0.10.15-alpha.3",
80
+ "@100mslive/hms-virtual-background": "1.13.15-alpha.5",
81
+ "@100mslive/hms-whiteboard": "0.0.5-alpha.5",
82
+ "@100mslive/react-icons": "0.10.15-alpha.5",
83
+ "@100mslive/react-sdk": "0.10.15-alpha.5",
84
84
  "@100mslive/types-prebuilt": "0.12.9",
85
85
  "@emoji-mart/data": "^1.0.6",
86
86
  "@emoji-mart/react": "^1.0.1",
@@ -116,5 +116,5 @@
116
116
  "uuid": "^8.3.2",
117
117
  "worker-timers": "^7.0.40"
118
118
  },
119
- "gitHead": "810df7bc6d978b45e2c3052343692e982bad600a"
119
+ "gitHead": "3e504fe9d0637a79ce342d651b599498cb0b1f16"
120
120
  }
@@ -3,7 +3,7 @@ import { usePreviousDistinct } from 'react-use';
3
3
  import { match, P } from 'ts-pattern';
4
4
  import { HMSRoomState, selectRoomState, useHMSStore } from '@100mslive/react-sdk';
5
5
  import { VBHandler } from './components/VirtualBackground/VBHandler';
6
- import { useRoomLayout } from './provider/roomLayoutProvider';
6
+ import { useRoomLayout, useSetOriginalLayout } from './provider/roomLayoutProvider';
7
7
  import { useRedirectToLeave } from './components/hooks/useRedirectToLeave';
8
8
  import {
9
9
  useRoomLayoutLeaveScreen,
@@ -38,6 +38,7 @@ export const useHMSAppStateContext = () => {
38
38
 
39
39
  export const useAppStateManager = () => {
40
40
  const roomLayout = useRoomLayout();
41
+ const setOriginalLayout = useSetOriginalLayout();
41
42
  const [activeState, setActiveState] = React.useState<PrebuiltStates | undefined>();
42
43
  const roomState = useHMSStore(selectRoomState);
43
44
  const prevRoomState = usePreviousDistinct(roomState);
@@ -46,6 +47,7 @@ export const useAppStateManager = () => {
46
47
  const { redirectToLeave } = useRedirectToLeave();
47
48
 
48
49
  const rejoin = () => {
50
+ setOriginalLayout?.();
49
51
  setActiveState(isPreviewScreenEnabled ? PrebuiltStates.PREVIEW : PrebuiltStates.MEETING);
50
52
  };
51
53
 
@@ -26,6 +26,7 @@ export type useFetchRoomLayoutProps = {
26
26
  export type useFetchRoomLayoutResponse = {
27
27
  layout: Layout | undefined;
28
28
  updateRoomLayoutForRole: (role: string) => void;
29
+ setOriginalLayout: () => void;
29
30
  };
30
31
 
31
32
  export const useFetchRoomLayout = ({
@@ -34,7 +35,11 @@ export const useFetchRoomLayout = ({
34
35
  }: useFetchRoomLayoutProps): useFetchRoomLayoutResponse => {
35
36
  const [layout, setLayout] = useState<Layout | undefined>(undefined);
36
37
  const layoutResp = useRef<GetResponse>();
38
+ const originalLayout = useRef<Layout>();
37
39
  const isFetchInProgress = useRef(false);
40
+
41
+ const setOriginalLayout = useCallback(() => setLayout(originalLayout.current), []);
42
+
38
43
  const updateRoomLayoutForRole = useCallback((role: string) => {
39
44
  if (!layoutResp.current) {
40
45
  return;
@@ -71,10 +76,13 @@ export const useFetchRoomLayout = ({
71
76
  layoutForRole = defaultLayout;
72
77
  }
73
78
  const layout = layoutForRole;
79
+ if (!originalLayout.current) {
80
+ originalLayout.current = layout;
81
+ }
74
82
  setLayout(layout);
75
83
  isFetchInProgress.current = false;
76
84
  })();
77
85
  }, [authToken, endpoint]);
78
86
 
79
- return { layout, updateRoomLayoutForRole };
87
+ return { layout, updateRoomLayoutForRole, setOriginalLayout };
80
88
  };
@@ -14,6 +14,7 @@ export const RoomLayoutContext = React.createContext<
14
14
  | {
15
15
  layout: Layout | undefined;
16
16
  updateRoomLayoutForRole: useFetchRoomLayoutResponse['updateRoomLayoutForRole'] | undefined;
17
+ setOriginalLayout: useFetchRoomLayoutResponse['setOriginalLayout'] | undefined;
17
18
  }
18
19
  | undefined
19
20
  >(undefined);
@@ -35,10 +36,13 @@ export const RoomLayoutProvider: React.FC<React.PropsWithChildren<RoomLayoutProv
35
36
  overrideLayout,
36
37
  }) => {
37
38
  const authToken: string = useAuthToken();
38
- const { layout, updateRoomLayoutForRole } = useFetchRoomLayout({ authToken, endpoint: roomLayoutEndpoint });
39
+ const { layout, updateRoomLayoutForRole, setOriginalLayout } = useFetchRoomLayout({
40
+ authToken,
41
+ endpoint: roomLayoutEndpoint,
42
+ });
39
43
  const mergedLayout = authToken && layout ? mergeWith(layout, overrideLayout, customizer) : layout;
40
44
  return (
41
- <RoomLayoutContext.Provider value={{ layout: mergedLayout, updateRoomLayoutForRole }}>
45
+ <RoomLayoutContext.Provider value={{ layout: mergedLayout, updateRoomLayoutForRole, setOriginalLayout }}>
42
46
  {children}
43
47
  </RoomLayoutContext.Provider>
44
48
  );
@@ -46,3 +50,4 @@ export const RoomLayoutProvider: React.FC<React.PropsWithChildren<RoomLayoutProv
46
50
 
47
51
  export const useRoomLayout = () => React.useContext(RoomLayoutContext)?.layout;
48
52
  export const useUpdateRoomLayout = () => React.useContext(RoomLayoutContext)?.updateRoomLayoutForRole;
53
+ export const useSetOriginalLayout = () => React.useContext(RoomLayoutContext)?.setOriginalLayout;