@edifice.io/react 2.3.1-develop-b2school.20250922103154 → 2.3.1-develop.20250917140552
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.
|
@@ -14,7 +14,7 @@ const WidgetAppsFooter = () => {
|
|
|
14
14
|
} = useTranslation();
|
|
15
15
|
return /* @__PURE__ */ jsxs("div", { className: "widget-body d-flex flex-wrap", children: [
|
|
16
16
|
!bookmarkedApps.length && /* @__PURE__ */ jsx("div", { className: "text-dark", children: t("navbar.myapps.more") }),
|
|
17
|
-
bookmarkedApps.slice(0, 6).map((app, index) => /* @__PURE__ */ jsx("a", { href: app.address, className: "bookmarked-app",
|
|
17
|
+
bookmarkedApps.slice(0, 6).map((app, index) => /* @__PURE__ */ jsx("a", { href: app.address, className: "bookmarked-app", children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index))
|
|
18
18
|
] });
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
@@ -47,7 +47,7 @@ const VideoRecorder = /* @__PURE__ */ forwardRef(({
|
|
|
47
47
|
}
|
|
48
48
|
useEffect(() => {
|
|
49
49
|
try {
|
|
50
|
-
videoRef.current && (videoRef.current.src && (window.URL.revokeObjectURL(videoRef.current.src), videoRef.current.src = ""),
|
|
50
|
+
videoRef.current && (videoRef.current.src && (window.URL.revokeObjectURL(videoRef.current.src), videoRef.current.src = ""), stream && (videoRef.current.srcObject = stream, videoRef.current.autoplay = !0, videoRef.current.volume = 1, videoRef.current.muted = !0));
|
|
51
51
|
} catch (err) {
|
|
52
52
|
console.error(err);
|
|
53
53
|
}
|
|
@@ -113,11 +113,11 @@ const VideoRecorder = /* @__PURE__ */ forwardRef(({
|
|
|
113
113
|
onError("Error while uploading video"), setSaving(!1), setSaved(!0);
|
|
114
114
|
}, handleEnded = () => {
|
|
115
115
|
setPlaying(!1), setPlayedTime(0), videoRef.current && (videoRef.current.currentTime = 0);
|
|
116
|
-
}, handleInputDeviceChange = (option) => {
|
|
116
|
+
}, handleInputDeviceChange = useCallback((option) => {
|
|
117
117
|
var _a;
|
|
118
118
|
const selectedDevice = inputDevices.find((inputDevice) => inputDevice.label === option);
|
|
119
119
|
((_a = recorderRef.current) == null ? void 0 : _a.state) === "recording" && (recorderRef.current.requestData(), recorderRef.current.stop()), setPreferedDevice(selectedDevice);
|
|
120
|
-
};
|
|
120
|
+
}, [inputDevices, stream]);
|
|
121
121
|
return useEffect(() => {
|
|
122
122
|
recordedTime >= maxDuration && handleStop();
|
|
123
123
|
}, [recordedTime, handleStop]), /* @__PURE__ */ jsxs("div", { className: "video-recorder d-flex flex-fill flex-column align-items-center pb-8", children: [
|
|
@@ -9,41 +9,41 @@ function useCameras() {
|
|
|
9
9
|
t
|
|
10
10
|
} = useTranslation(), [inputDevices, setInputDevices] = useState([]), [mediaStreamConstraints, setMediaStreamConstraints] = useState({
|
|
11
11
|
audio: !0,
|
|
12
|
-
video:
|
|
12
|
+
video: {
|
|
13
|
+
facingMode: "environment",
|
|
14
|
+
aspectRatio: VIDEO_WIDTH / VIDEO_HEIGHT
|
|
15
|
+
}
|
|
13
16
|
}), [stream, setStream] = useState();
|
|
14
17
|
async function getVideoInputDevices() {
|
|
15
18
|
return (await navigator.mediaDevices.enumerateDevices()).filter((device2) => device2.kind === "videoinput");
|
|
16
19
|
}
|
|
17
|
-
|
|
20
|
+
async function enableStream(mediaStreamConstraints2) {
|
|
18
21
|
try {
|
|
19
|
-
const mediaStream = await navigator.mediaDevices.getUserMedia(
|
|
20
|
-
setStream(mediaStream);
|
|
22
|
+
const mediaStream = await navigator.mediaDevices.getUserMedia(mediaStreamConstraints2);
|
|
23
|
+
setStream((previousStream) => (previousStream == null || previousStream.getTracks().forEach((track) => track.stop()), mediaStream));
|
|
21
24
|
} catch (err) {
|
|
22
25
|
console.error(err);
|
|
23
26
|
}
|
|
24
|
-
}
|
|
25
|
-
|
|
27
|
+
}
|
|
28
|
+
const restartStream = () => {
|
|
29
|
+
enableStream(mediaStreamConstraints);
|
|
26
30
|
}, setPreferedDevice = (device2) => {
|
|
27
|
-
let
|
|
28
|
-
device2 != null && device2.deviceId ? (device2.deviceId === "environment" || device2.deviceId === "user" ?
|
|
31
|
+
let mediaStreamConstraints2 = {};
|
|
32
|
+
device2 != null && device2.deviceId ? ((device2 == null ? void 0 : device2.deviceId) === "environment" || (device2 == null ? void 0 : device2.deviceId) === "user" ? mediaStreamConstraints2 = {
|
|
29
33
|
audio: !0,
|
|
30
34
|
video: {
|
|
31
35
|
aspectRatio: VIDEO_WIDTH / VIDEO_HEIGHT,
|
|
32
36
|
facingMode: device2 == null ? void 0 : device2.deviceId
|
|
33
37
|
}
|
|
34
|
-
} :
|
|
38
|
+
} : mediaStreamConstraints2 = {
|
|
35
39
|
audio: !0,
|
|
36
40
|
video: {
|
|
37
41
|
aspectRatio: VIDEO_WIDTH / VIDEO_HEIGHT,
|
|
38
|
-
deviceId:
|
|
39
|
-
exact: device2.deviceId
|
|
40
|
-
}
|
|
42
|
+
deviceId: device2.deviceId
|
|
41
43
|
}
|
|
42
|
-
}, setMediaStreamConstraints(
|
|
44
|
+
}, setMediaStreamConstraints(mediaStreamConstraints2), restartStream()) : console.error("Selected input device id is null");
|
|
43
45
|
};
|
|
44
46
|
return useEffect(() => {
|
|
45
|
-
restartStream();
|
|
46
|
-
}, [mediaStreamConstraints]), useEffect(() => {
|
|
47
47
|
async function initInputDevices() {
|
|
48
48
|
await enableStream(mediaStreamConstraints);
|
|
49
49
|
const videoDevices = await getVideoInputDevices();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.3.1-develop
|
|
3
|
+
"version": "2.3.1-develop.20250917140552",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -130,9 +130,9 @@
|
|
|
130
130
|
"react-slugify": "^3.0.3",
|
|
131
131
|
"swiper": "^10.1.0",
|
|
132
132
|
"ua-parser-js": "^1.0.36",
|
|
133
|
-
"@edifice.io/bootstrap": "2.3.1-develop
|
|
134
|
-
"@edifice.io/tiptap-extensions": "2.3.1-develop
|
|
135
|
-
"@edifice.io/utilities": "2.3.1-develop
|
|
133
|
+
"@edifice.io/bootstrap": "2.3.1-develop.20250917140552",
|
|
134
|
+
"@edifice.io/tiptap-extensions": "2.3.1-develop.20250917140552",
|
|
135
|
+
"@edifice.io/utilities": "2.3.1-develop.20250917140552"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -163,8 +163,8 @@
|
|
|
163
163
|
"vite": "^5.4.11",
|
|
164
164
|
"vite-plugin-dts": "^4.1.0",
|
|
165
165
|
"vite-tsconfig-paths": "^5.0.1",
|
|
166
|
-
"@edifice.io/client": "2.3.1-develop
|
|
167
|
-
"@edifice.io/config": "2.3.1-develop
|
|
166
|
+
"@edifice.io/client": "2.3.1-develop.20250917140552",
|
|
167
|
+
"@edifice.io/config": "2.3.1-develop.20250917140552"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"@react-spring/web": "^9.7.5",
|