@skooldev/skool-stream-layout 1.0.0 → 1.0.2
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.cjs.js +92 -2
- package/dist/index.d.ts +0 -1
- package/package.json +3 -6
- package/dist/index.cjs.js.LICENSE.txt +0 -9
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ // The require scope
|
|
4
|
+
/******/ var __webpack_require__ = {};
|
|
5
|
+
/******/
|
|
6
|
+
/************************************************************************/
|
|
7
|
+
/******/ /* webpack/runtime/define property getters */
|
|
8
|
+
/******/ (() => {
|
|
9
|
+
/******/ // define getter functions for harmony exports
|
|
10
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
11
|
+
/******/ for(var key in definition) {
|
|
12
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
13
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
14
|
+
/******/ }
|
|
15
|
+
/******/ }
|
|
16
|
+
/******/ };
|
|
17
|
+
/******/ })();
|
|
18
|
+
/******/
|
|
19
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
20
|
+
/******/ (() => {
|
|
21
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
22
|
+
/******/ })();
|
|
23
|
+
/******/
|
|
24
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
25
|
+
/******/ (() => {
|
|
26
|
+
/******/ // define __esModule on exports
|
|
27
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
28
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
29
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
30
|
+
/******/ }
|
|
31
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
32
|
+
/******/ };
|
|
33
|
+
/******/ })();
|
|
34
|
+
/******/
|
|
35
|
+
/************************************************************************/
|
|
36
|
+
var __webpack_exports__ = {};
|
|
37
|
+
// ESM COMPAT FLAG
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
|
|
40
|
+
// EXPORTS
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
SkoolStreamLayout: () => (/* binding */ SkoolStreamLayout)
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
;// external "react/jsx-runtime"
|
|
46
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
47
|
+
;// external "react"
|
|
48
|
+
const external_react_namespaceObject = require("react");
|
|
49
|
+
;// external "@stream-io/video-react-sdk"
|
|
50
|
+
const video_react_sdk_namespaceObject = require("@stream-io/video-react-sdk");
|
|
51
|
+
;// ./src/index.tsx
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
let numParticipantsInView = 0;
|
|
56
|
+
const CustomParticipantViewUI = () => {
|
|
57
|
+
const context = (0,video_react_sdk_namespaceObject.useParticipantViewContext)();
|
|
58
|
+
const { participant } = context;
|
|
59
|
+
(0,external_react_namespaceObject.useLayoutEffect)(() => {
|
|
60
|
+
numParticipantsInView++;
|
|
61
|
+
return () => {
|
|
62
|
+
numParticipantsInView--;
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
65
|
+
const hasPausedVideo = (0,external_react_namespaceObject.useMemo)(() => { var _a; return !!((_a = participant.pausedTracks) === null || _a === void 0 ? void 0 : _a.includes(video_react_sdk_namespaceObject.SfuModels.TrackType.VIDEO)); }, [participant]);
|
|
66
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)("div", { className: "participant-label", children: [(0,jsx_runtime_namespaceObject.jsx)("span", { children: participant.name }), !(0,video_react_sdk_namespaceObject.hasAudio)(participant) && (0,jsx_runtime_namespaceObject.jsx)("span", { className: "mute-icon" }), (0,video_react_sdk_namespaceObject.isPinned)(participant) && (0,jsx_runtime_namespaceObject.jsx)("span", { className: "pin-icon" }), hasPausedVideo && (0,jsx_runtime_namespaceObject.jsx)(video_react_sdk_namespaceObject.Icon, { icon: "low-bandwidth" })] }));
|
|
67
|
+
};
|
|
68
|
+
const SkoolStreamLayoutComponent = () => {
|
|
69
|
+
const call = (0,video_react_sdk_namespaceObject.useCall)();
|
|
70
|
+
const { useParticipants, useHasOngoingScreenShare } = (0,video_react_sdk_namespaceObject.useCallStateHooks)();
|
|
71
|
+
const participants = useParticipants();
|
|
72
|
+
const hasOngoingScreenshare = useHasOngoingScreenShare();
|
|
73
|
+
const isWebinar = (call === null || call === void 0 ? void 0 : call.type) === "livestream";
|
|
74
|
+
const hasPinnedParticipant = (0,external_react_namespaceObject.useMemo)(() => !!participants.find((participant) => (0,video_react_sdk_namespaceObject.isPinned)(participant)), [participants]);
|
|
75
|
+
const mainLayout = (0,external_react_namespaceObject.useMemo)(() => {
|
|
76
|
+
const participantsFilter = isWebinar
|
|
77
|
+
? {
|
|
78
|
+
$or: [{ hasVideo: true }, { hasScreenShare: true }],
|
|
79
|
+
}
|
|
80
|
+
: undefined;
|
|
81
|
+
if (hasOngoingScreenshare || (participants.length > 2 && hasPinnedParticipant)) {
|
|
82
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(video_react_sdk_namespaceObject.SpeakerLayout, { ParticipantViewUIBar: CustomParticipantViewUI, ParticipantViewUISpotlight: CustomParticipantViewUI, filterParticipants: participantsFilter }));
|
|
83
|
+
}
|
|
84
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(video_react_sdk_namespaceObject.PaginatedGridLayout, { groupSize: 12, ParticipantViewUI: CustomParticipantViewUI, filterParticipants: participantsFilter }));
|
|
85
|
+
}, [hasOngoingScreenshare, participants, hasPinnedParticipant, isWebinar]);
|
|
86
|
+
return ((0,jsx_runtime_namespaceObject.jsx)("div", { "data-participants": numParticipantsInView, className: "skool-stream-layout", children: mainLayout }));
|
|
87
|
+
};
|
|
88
|
+
const SkoolStreamLayout = (0,external_react_namespaceObject.memo)(SkoolStreamLayoutComponent);
|
|
89
|
+
|
|
90
|
+
module.exports = __webpack_exports__;
|
|
91
|
+
/******/ })()
|
|
92
|
+
;
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skooldev/skool-stream-layout",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Skool Stream Layout",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
|
-
"module": "dist/index.esm.js",
|
|
7
6
|
"types": "dist/index.d.ts",
|
|
8
7
|
"files": [
|
|
9
8
|
"dist"
|
|
10
9
|
],
|
|
11
10
|
"scripts": {
|
|
12
11
|
"build": "webpack --mode production",
|
|
12
|
+
"prepack": "webpack --mode production",
|
|
13
13
|
"prepublishOnly": "npm run build"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
+
"@stream-io/video-react-sdk": "^1.25.0",
|
|
16
17
|
"react": "^17 || ^18 || ^19",
|
|
17
18
|
"react-dom": "^17 || ^18 || ^19"
|
|
18
19
|
},
|
|
@@ -33,7 +34,6 @@
|
|
|
33
34
|
"react-dom": "19.1.0",
|
|
34
35
|
"sass": "^1.80.0",
|
|
35
36
|
"sass-loader": "^13.3.2",
|
|
36
|
-
"style-loader": "^3.3.4",
|
|
37
37
|
"ts-loader": "^9.5.1",
|
|
38
38
|
"typescript": "^5.6.3",
|
|
39
39
|
"webpack": "^5.95.0",
|
|
@@ -43,8 +43,5 @@
|
|
|
43
43
|
"type": "git",
|
|
44
44
|
"url": "https://github.com/skooldev/skool-stream-layout"
|
|
45
45
|
},
|
|
46
|
-
"publishConfig": {
|
|
47
|
-
"access": "restricted"
|
|
48
|
-
},
|
|
49
46
|
"author": "Skool Dev Team"
|
|
50
47
|
}
|