@rxdrag/website-lib 0.0.130 → 0.0.132

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.
@@ -44,7 +44,11 @@ let posterUrl: string | undefined;
44
44
  if (background.type === "video" && background.poster) {
45
45
  if (typeof background.poster === "string") {
46
46
  posterUrl = background.poster;
47
- } else {
47
+ } else if (
48
+ background.poster &&
49
+ typeof background.poster === "object" &&
50
+ "src" in background.poster
51
+ ) {
48
52
  const posterImage = await getImage({
49
53
  src: background.poster as ImageMetadata,
50
54
  });
@@ -7,6 +7,8 @@ interface Props extends ImageProps {}
7
7
  const {
8
8
  src,
9
9
  alt = "",
10
+ width,
11
+ height,
10
12
  layout,
11
13
  formats,
12
14
  loading,
@@ -42,6 +44,8 @@ if (isStringSrc && (src.startsWith("/src/") || src.startsWith("src/"))) {
42
44
  <img
43
45
  src={src}
44
46
  alt={alt}
47
+ width={width}
48
+ height={height}
45
49
  loading={loading}
46
50
  class={className}
47
51
  {...restProps}
@@ -50,6 +54,8 @@ if (isStringSrc && (src.startsWith("/src/") || src.startsWith("src/"))) {
50
54
  <AstroPicture
51
55
  src={src}
52
56
  alt={alt}
57
+ width={width}
58
+ height={height}
53
59
  formats={formats}
54
60
  quality={quality}
55
61
  loading={priority ? "eager" : loading}
@@ -62,6 +68,8 @@ if (isStringSrc && (src.startsWith("/src/") || src.startsWith("src/"))) {
62
68
  <AstroImage
63
69
  src={src}
64
70
  alt={alt}
71
+ width={width}
72
+ height={height}
65
73
  quality={quality}
66
74
  loading={loading}
67
75
  sizes={actualSizes}
@@ -113,6 +113,22 @@ export interface ImageProps extends Omit<HTMLAttributes<"img">, "src" | "width"
113
113
  */
114
114
  src: string | ImageMetadata;
115
115
 
116
+ /**
117
+ * 图片宽度
118
+ * - 本地图片可自动推断,可不填
119
+ * - 本地图片使用 layout="fixed" 时必须填写
120
+ * - 远程图片不需要填写,用 Tailwind 样式代替
121
+ */
122
+ width?: number;
123
+
124
+ /**
125
+ * 图片高度
126
+ * - 本地图片可自动推断,可不填
127
+ * - 本地图片使用 layout="fixed" 时必须填写
128
+ * - 远程图片不需要填写,用 Tailwind 样式代替
129
+ */
130
+ height?: number;
131
+
116
132
  /**
117
133
  * 图片描述(用于无障碍访问和 SEO)
118
134
  * - 内容图片:填写描述文字
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdrag/website-lib",
3
- "version": "0.0.130",
3
+ "version": "0.0.132",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts",
@@ -26,11 +26,11 @@
26
26
  "eslint": "^9.39.2",
27
27
  "gsap": "^3.12.7",
28
28
  "typescript": "^5",
29
- "@rxdrag/tiptap-preview": "0.0.3",
30
29
  "@rxdrag/eslint-config-custom": "0.2.13",
31
30
  "@rxdrag/rxcms-models": "0.3.98",
32
- "@rxdrag/tsconfig": "0.2.1",
33
- "@rxdrag/entify-hooks": "0.2.79"
31
+ "@rxdrag/entify-hooks": "0.2.79",
32
+ "@rxdrag/tiptap-preview": "0.0.3",
33
+ "@rxdrag/tsconfig": "0.2.1"
34
34
  },
35
35
  "dependencies": {
36
36
  "aos": "3.0.0-beta.6",