@rxdrag/website-lib 0.0.64 → 0.0.66

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.64",
3
+ "version": "0.0.66",
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/eslint-config-custom": "0.2.12",
28
27
  "@rxdrag/rxcms-models": "0.3.89",
29
- "@rxdrag/entify-hooks": "0.2.70",
28
+ "@rxdrag/slate-preview": "1.2.58",
29
+ "@rxdrag/eslint-config-custom": "0.2.12",
30
30
  "@rxdrag/tsconfig": "0.2.0",
31
- "@rxdrag/slate-preview": "1.2.58"
31
+ "@rxdrag/entify-hooks": "0.2.70"
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/rxcms-models": "0.3.89",
38
- "@rxdrag/website-lib-core": "0.0.64"
37
+ "@rxdrag/website-lib-core": "0.0.65",
38
+ "@rxdrag/rxcms-models": "0.3.89"
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]
@@ -0,0 +1,24 @@
1
+ ---
2
+ import type {
3
+ AnimationConfig,
4
+ BackgroundConfig,
5
+ IEntify,
6
+ } from "@rxdrag/website-lib-core";
7
+ import BackgroundGroup from "./BackgroundGroup.astro";
8
+
9
+ interface Props {
10
+ class?: string;
11
+ className?: string;
12
+ backgrounds?: BackgroundConfig[];
13
+ //动效
14
+ animation?: AnimationConfig;
15
+ rx: IEntify;
16
+ }
17
+
18
+ const { className, class: originalClass, backgrounds, rx } = Astro.props;
19
+ ---
20
+
21
+ <div class:list={["w-full, h-full flex flex-col", className, originalClass]}>
22
+ <BackgroundGroup backgrounds={backgrounds} rx={rx} />
23
+ <slot />
24
+ </div>
@@ -1,25 +1,46 @@
1
- ---
2
- import type { Media } from "@rxdrag/rxcms-models";
3
-
4
- interface Props
5
- extends Omit<astroHTML.JSX.VideoHTMLAttributes, "src" | "class"> {
6
- video?: Media;
7
- className?: string;
8
- children?: astroHTML.JSX.Element;
9
- classNames?: {
10
- video?: string;
11
- source?: string;
12
- };
13
- }
14
-
15
- const { video, className, children, classNames, ...props } = Astro.props;
16
- ---
17
-
18
- <video class:list={[classNames?.video, className]} {...props}>
19
- <source
20
- src={video?.file?.url || ""}
21
- type="video/mp4"
22
- class={classNames?.source}
23
- />
24
- {children}
25
- </video>
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
+ }
@@ -1,6 +1,7 @@
1
1
  export { default as AnimationNumber } from "./AnimationNumber.astro";
2
2
  export { default as Background } from "./Background.astro";
3
3
  export { default as BackgroundGroup } from "./BackgroundGroup.astro";
4
+ export { default as Box } from "./Box.astro";
4
5
  export { default as Collapse } from "./Collapse.astro";
5
6
  export { default as CollapseTrigger } from "./CollapseTrigger.astro";
6
7
  export { default as CollapsePanel } from "./CollapsePanel.astro";