@rxdrag/website-lib 0.0.63 → 0.0.65
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdrag/website-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.65",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.ts"
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"eslint": "^7.32.0",
|
|
25
25
|
"gsap": "^3.12.7",
|
|
26
26
|
"typescript": "^5",
|
|
27
|
-
"@rxdrag/rxcms-models": "0.3.89",
|
|
28
|
-
"@rxdrag/eslint-config-custom": "0.2.12",
|
|
29
27
|
"@rxdrag/entify-hooks": "0.2.70",
|
|
28
|
+
"@rxdrag/eslint-config-custom": "0.2.12",
|
|
29
|
+
"@rxdrag/rxcms-models": "0.3.89",
|
|
30
30
|
"@rxdrag/slate-preview": "1.2.58",
|
|
31
31
|
"@rxdrag/tsconfig": "0.2.0"
|
|
32
32
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react": "^19.1.0",
|
|
36
36
|
"react-dom": "^19.1.0",
|
|
37
37
|
"@rxdrag/rxcms-models": "0.3.89",
|
|
38
|
-
"@rxdrag/website-lib-core": "0.0.
|
|
38
|
+
"@rxdrag/website-lib-core": "0.0.65"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"astro": "^4.0.0 || ^5.0.0"
|
|
@@ -30,8 +30,8 @@ const posterRef =
|
|
|
30
30
|
background.type === "video" ? background.posterRef : undefined;
|
|
31
31
|
|
|
32
32
|
// 获取媒体数据
|
|
33
|
-
const media = await rx.getMedia(mediaRef);
|
|
34
|
-
const poster = await rx.getMedia(posterRef);
|
|
33
|
+
const media = rx ? await rx.getMedia(mediaRef) : undefined;
|
|
34
|
+
const poster = rx ? await rx.getMedia(posterRef) : undefined;
|
|
35
35
|
|
|
36
36
|
// 构建 className
|
|
37
37
|
const className = [defaultClass, background.className]
|
|
@@ -1,25 +1,46 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
interface Props
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
video?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
---
|
|
2
|
+
import { ReactVideoPlayer, type IEntify } from "@rxdrag/website-lib-core";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
videoRef?: string;
|
|
6
|
+
posterRef?: string;
|
|
7
|
+
endTitle?: string;
|
|
8
|
+
classNames?: {
|
|
9
|
+
container?: string;
|
|
10
|
+
video?: string;
|
|
11
|
+
playButton?: string;
|
|
12
|
+
playButtonOuter?: string;
|
|
13
|
+
playButtonInner?: string;
|
|
14
|
+
playIcon?: string;
|
|
15
|
+
overlay?: string;
|
|
16
|
+
overlayTitle?: string;
|
|
17
|
+
ctaButton?: string;
|
|
18
|
+
overlayReplayButton?: string;
|
|
19
|
+
};
|
|
20
|
+
rx: IEntify;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
rx,
|
|
25
|
+
videoRef,
|
|
26
|
+
posterRef,
|
|
27
|
+
endTitle = "Contact Us Now",
|
|
28
|
+
classNames = {},
|
|
29
|
+
} = Astro.props;
|
|
30
|
+
|
|
31
|
+
// 获取媒体数据(增加 rx 为空时的保护)
|
|
32
|
+
const media = rx ? await rx.getMedia(videoRef) : undefined;
|
|
33
|
+
const poster = rx ? await rx.getMedia(posterRef) : undefined;
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
{
|
|
37
|
+
media && (
|
|
38
|
+
<ReactVideoPlayer
|
|
39
|
+
client:load
|
|
40
|
+
media={media}
|
|
41
|
+
endTitle={endTitle}
|
|
42
|
+
posterUrl={poster?.file?.original}
|
|
43
|
+
classNames={classNames}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|