@webstudio-is/sdk-components-react 0.226.0 → 0.227.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.
- package/lib/video.js +14 -14
- package/package.json +7 -7
package/lib/video.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as y, useId as V, useContext as N, useEffect as x } from "react";
|
|
3
3
|
import { ReactSdkContext as I } from "@webstudio-is/react-sdk/runtime";
|
|
4
4
|
const c = "data-ws-video-id", S = {
|
|
@@ -7,44 +7,44 @@ const c = "data-ws-video-id", S = {
|
|
|
7
7
|
({
|
|
8
8
|
$progress: r,
|
|
9
9
|
$visible: n,
|
|
10
|
-
$timeline:
|
|
10
|
+
$timeline: d,
|
|
11
11
|
$webstudio$canvasOnly$assetId: w,
|
|
12
12
|
children: l,
|
|
13
|
-
src:
|
|
13
|
+
src: o,
|
|
14
14
|
...b
|
|
15
15
|
}, m) => {
|
|
16
|
-
const
|
|
17
|
-
[c]:
|
|
18
|
-
}, { videoLoader: f } = N(I), T =
|
|
16
|
+
const u = V(), A = {
|
|
17
|
+
[c]: u
|
|
18
|
+
}, { videoLoader: f } = N(I), T = o && f ? f({ src: o }) : o;
|
|
19
19
|
return x(() => {
|
|
20
20
|
if (r === void 0 || n === void 0)
|
|
21
21
|
return;
|
|
22
|
-
const e = document.querySelector(`[${c}="${
|
|
22
|
+
const e = document.querySelector(`[${c}="${u}"]`);
|
|
23
23
|
if (e === null || !(e instanceof HTMLVideoElement))
|
|
24
24
|
return;
|
|
25
25
|
if (e.play().catch(() => {
|
|
26
|
-
}), e.pause(),
|
|
26
|
+
}), e.pause(), d)
|
|
27
27
|
return r.subscribe((t) => {
|
|
28
28
|
if (e.readyState < S.HAVE_METADATA || (e.paused || e.pause(), e.seeking))
|
|
29
29
|
return;
|
|
30
30
|
let s = e.duration;
|
|
31
31
|
Number.isNaN(s) || (Number.isFinite(s) || (s = 60), e.currentTime = (t ?? 0) * s);
|
|
32
32
|
});
|
|
33
|
-
let i = !1,
|
|
33
|
+
let i = !1, a = !1;
|
|
34
34
|
const v = n.subscribe((t) => {
|
|
35
|
-
|
|
36
|
-
}),
|
|
35
|
+
a = t, a === !1 && i === !1 && !e.loop && (e.currentTime = 0);
|
|
36
|
+
}), E = r.subscribe((t) => {
|
|
37
37
|
if (i && (t === void 0 || t === 0 || t === 1)) {
|
|
38
|
-
i = !1, e.pause(),
|
|
38
|
+
i = !1, e.pause(), a === !1 && i === !1 && !e.loop && (e.currentTime = 0);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
i || (i = !0, e.ended || e.play().catch(() => {
|
|
42
42
|
}));
|
|
43
43
|
});
|
|
44
44
|
return () => {
|
|
45
|
-
|
|
45
|
+
E(), v();
|
|
46
46
|
};
|
|
47
|
-
}, [r,
|
|
47
|
+
}, [r, d, n, u]), /* @__PURE__ */ p("video", { src: T, ...b, ...A, ref: m, children: l });
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
_.displayName = "Video";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.227.0",
|
|
4
4
|
"description": "Webstudio default library for react",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"colord": "^2.9.3",
|
|
45
45
|
"micromark": "^4.0.2",
|
|
46
46
|
"micromark-extension-gfm-table": "^2.1.1",
|
|
47
|
-
"@webstudio-is/icons": "0.
|
|
48
|
-
"@webstudio-is/sdk": "0.
|
|
49
|
-
"@webstudio-is/
|
|
50
|
-
"@webstudio-is/
|
|
47
|
+
"@webstudio-is/icons": "0.227.0",
|
|
48
|
+
"@webstudio-is/react-sdk": "0.227.0",
|
|
49
|
+
"@webstudio-is/sdk": "0.227.0",
|
|
50
|
+
"@webstudio-is/image": "0.227.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
59
59
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
60
60
|
"vitest": "^3.1.2",
|
|
61
|
-
"@webstudio-is/sdk-cli": "0.94.0",
|
|
62
61
|
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
63
|
-
"@webstudio-is/template": "0.
|
|
62
|
+
"@webstudio-is/template": "0.227.0",
|
|
63
|
+
"@webstudio-is/sdk-cli": "0.94.0",
|
|
64
64
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|