@rxdrag/website-lib 0.0.66 → 0.0.67
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.67",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.ts"
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"eslint": "^7.32.0",
|
|
25
25
|
"gsap": "^3.12.7",
|
|
26
26
|
"typescript": "^5",
|
|
27
|
+
"@rxdrag/entify-hooks": "0.2.70",
|
|
27
28
|
"@rxdrag/rxcms-models": "0.3.89",
|
|
28
|
-
"@rxdrag/slate-preview": "1.2.58",
|
|
29
29
|
"@rxdrag/eslint-config-custom": "0.2.12",
|
|
30
|
-
"@rxdrag/
|
|
31
|
-
"@rxdrag/
|
|
30
|
+
"@rxdrag/slate-preview": "1.2.58",
|
|
31
|
+
"@rxdrag/tsconfig": "0.2.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"clsx": "^2.1.0",
|
|
35
35
|
"react": "^19.1.0",
|
|
36
36
|
"react-dom": "^19.1.0",
|
|
37
|
-
"@rxdrag/
|
|
38
|
-
"@rxdrag/
|
|
37
|
+
"@rxdrag/rxcms-models": "0.3.89",
|
|
38
|
+
"@rxdrag/website-lib-core": "0.0.66"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"astro": "^4.0.0 || ^5.0.0"
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
BackgroundConfig,
|
|
4
|
+
VideoBackgroundConfig,
|
|
5
|
+
} from "@rxdrag/website-lib-core";
|
|
3
6
|
import {
|
|
4
7
|
BackgroundVideoPlayer,
|
|
5
8
|
BackgroundHlsVideoPlayer,
|
|
@@ -9,14 +12,10 @@ export interface Props {
|
|
|
9
12
|
background: BackgroundConfig;
|
|
10
13
|
index?: number;
|
|
11
14
|
defaultClass?: string;
|
|
12
|
-
rx: IEntify;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
defaultClass = "absolute w-full h-full object-cover",
|
|
18
|
-
rx,
|
|
19
|
-
} = Astro.props;
|
|
17
|
+
const { background, defaultClass = "absolute w-full h-full object-cover" } =
|
|
18
|
+
Astro.props;
|
|
20
19
|
|
|
21
20
|
// 安全地提取 mediaRef 和 posterRef(只有部分背景类型有这些属性)
|
|
22
21
|
const mediaRef =
|
|
@@ -29,6 +28,8 @@ const mediaRef =
|
|
|
29
28
|
const posterRef =
|
|
30
29
|
background.type === "video" ? background.posterRef : undefined;
|
|
31
30
|
|
|
31
|
+
const rx = (background as VideoBackgroundConfig | undefined)?.rx;
|
|
32
|
+
|
|
32
33
|
// 获取媒体数据
|
|
33
34
|
const media = rx ? await rx.getMedia(mediaRef) : undefined;
|
|
34
35
|
const poster = rx ? await rx.getMedia(posterRef) : undefined;
|
|
@@ -40,13 +41,9 @@ const className = [defaultClass, background.className]
|
|
|
40
41
|
|
|
41
42
|
// 预计算视频相关数据
|
|
42
43
|
const videoUrl =
|
|
43
|
-
background.type === "video"
|
|
44
|
-
? media?.file?.original || background.url
|
|
45
|
-
: undefined;
|
|
44
|
+
background.type === "video" ? media?.file?.original : undefined;
|
|
46
45
|
const posterUrl =
|
|
47
|
-
background.type === "video"
|
|
48
|
-
? poster?.file?.original || background.poster
|
|
49
|
-
: undefined;
|
|
46
|
+
background.type === "video" ? poster?.file?.original : undefined;
|
|
50
47
|
const isHls =
|
|
51
48
|
background.type === "video" &&
|
|
52
49
|
(media?.storageType === "cloudflare_stream" ||
|
|
@@ -55,9 +52,7 @@ const isHls =
|
|
|
55
52
|
|
|
56
53
|
// 预计算图片 URL
|
|
57
54
|
const imageUrl =
|
|
58
|
-
background.type === "image"
|
|
59
|
-
? media?.file?.original || background.url
|
|
60
|
-
: undefined;
|
|
55
|
+
background.type === "image" ? media?.file?.original : undefined;
|
|
61
56
|
|
|
62
57
|
// 预计算 Spline URL
|
|
63
58
|
const splineUrl =
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type { BackgroundConfig
|
|
2
|
+
import type { BackgroundConfig } from "@rxdrag/website-lib-core";
|
|
3
3
|
import Background from "./Background.astro";
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
|
-
rx: IEntify;
|
|
7
6
|
backgrounds?: BackgroundConfig[];
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
const { backgrounds
|
|
9
|
+
const { backgrounds } = Astro.props;
|
|
11
10
|
|
|
12
|
-
const defaultClass =
|
|
11
|
+
const defaultClass =
|
|
12
|
+
"absolute w-full h-full inset-0 object-cover object-center";
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
<Fragment>
|
|
16
16
|
{
|
|
17
17
|
backgrounds?.map((background) => (
|
|
18
|
-
<Background background={background}
|
|
18
|
+
<Background background={background} defaultClass={defaultClass} />
|
|
19
19
|
))
|
|
20
20
|
}
|
|
21
21
|
</Fragment>
|
package/src/components/Box.astro
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
AnimationConfig,
|
|
4
4
|
BackgroundConfig,
|
|
5
|
-
IEntify,
|
|
6
5
|
} from "@rxdrag/website-lib-core";
|
|
7
6
|
import BackgroundGroup from "./BackgroundGroup.astro";
|
|
8
7
|
|
|
@@ -12,13 +11,12 @@ interface Props {
|
|
|
12
11
|
backgrounds?: BackgroundConfig[];
|
|
13
12
|
//动效
|
|
14
13
|
animation?: AnimationConfig;
|
|
15
|
-
rx: IEntify;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
const { className, class: originalClass, backgrounds
|
|
16
|
+
const { className, class: originalClass, backgrounds } = Astro.props;
|
|
19
17
|
---
|
|
20
18
|
|
|
21
19
|
<div class:list={["w-full, h-full flex flex-col", className, originalClass]}>
|
|
22
|
-
<BackgroundGroup backgrounds={backgrounds}
|
|
20
|
+
<BackgroundGroup backgrounds={backgrounds} />
|
|
23
21
|
<slot />
|
|
24
22
|
</div>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
AnimationConfig,
|
|
4
4
|
BackgroundConfig,
|
|
5
|
-
IEntify,
|
|
6
5
|
} from "@rxdrag/website-lib-core";
|
|
7
6
|
import BackgroundGroup from "./BackgroundGroup.astro";
|
|
8
7
|
|
|
@@ -14,15 +13,14 @@ interface Props {
|
|
|
14
13
|
backgrounds?: BackgroundConfig[];
|
|
15
14
|
//动效
|
|
16
15
|
animation?: AnimationConfig;
|
|
17
|
-
rx: IEntify;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
const { className, class: originalClass, backgrounds
|
|
18
|
+
const { className, class: originalClass, backgrounds } = Astro.props;
|
|
21
19
|
|
|
22
20
|
//布局容器
|
|
23
21
|
---
|
|
24
22
|
|
|
25
23
|
<div class:list={["relative grid gap-12", className, originalClass]}>
|
|
26
|
-
<BackgroundGroup backgrounds={backgrounds}
|
|
24
|
+
<BackgroundGroup backgrounds={backgrounds} />
|
|
27
25
|
<slot />
|
|
28
26
|
</div>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
AnimationConfig,
|
|
4
4
|
BackgroundConfig,
|
|
5
|
-
IEntify,
|
|
6
5
|
} from "@rxdrag/website-lib-core";
|
|
7
6
|
import BackgroundGroup from "./BackgroundGroup.astro";
|
|
8
7
|
|
|
@@ -12,13 +11,12 @@ interface Props {
|
|
|
12
11
|
backgrounds?: BackgroundConfig[];
|
|
13
12
|
//动效
|
|
14
13
|
animation?: AnimationConfig;
|
|
15
|
-
rx: IEntify;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
const { className, class: originalClass, backgrounds
|
|
16
|
+
const { className, class: originalClass, backgrounds } = Astro.props;
|
|
19
17
|
---
|
|
20
18
|
|
|
21
19
|
<div class:list={["w-full, h-full flex flex-col", className, originalClass]}>
|
|
22
|
-
<BackgroundGroup backgrounds={backgrounds}
|
|
20
|
+
<BackgroundGroup backgrounds={backgrounds} />
|
|
23
21
|
<slot />
|
|
24
22
|
</div>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
AnimationConfig,
|
|
4
4
|
BackgroundConfig,
|
|
5
|
-
IEntify,
|
|
6
5
|
} from "@rxdrag/website-lib-core";
|
|
7
6
|
import BackgroundGroup from "./BackgroundGroup.astro";
|
|
8
7
|
import Container from "./Container.astro";
|
|
@@ -19,7 +18,6 @@ interface Props {
|
|
|
19
18
|
//动效
|
|
20
19
|
animation?: AnimationConfig;
|
|
21
20
|
disableContainer?: boolean;
|
|
22
|
-
rx: IEntify;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
const {
|
|
@@ -28,12 +26,11 @@ const {
|
|
|
28
26
|
backgrounds,
|
|
29
27
|
disableContainer,
|
|
30
28
|
class: originalClass,
|
|
31
|
-
rx,
|
|
32
29
|
} = Astro.props;
|
|
33
30
|
---
|
|
34
31
|
|
|
35
32
|
<section class:list={["section-block", className, originalClass]}>
|
|
36
|
-
<BackgroundGroup
|
|
33
|
+
<BackgroundGroup backgrounds={backgrounds} />
|
|
37
34
|
{
|
|
38
35
|
disableContainer ? (
|
|
39
36
|
<slot />
|