@rxdrag/website-lib 0.0.71 → 0.0.72

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.71",
3
+ "version": "0.0.72",
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.72",
28
- "@rxdrag/tsconfig": "0.2.0",
27
+ "@rxdrag/entify-hooks": "0.2.73",
29
28
  "@rxdrag/eslint-config-custom": "0.2.12",
30
- "@rxdrag/rxcms-models": "0.3.91",
31
- "@rxdrag/slate-preview": "1.2.58"
29
+ "@rxdrag/slate-preview": "1.2.58",
30
+ "@rxdrag/rxcms-models": "0.3.92",
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/rxcms-models": "0.3.91",
38
- "@rxdrag/website-lib-core": "0.0.69"
37
+ "@rxdrag/website-lib-core": "0.0.70",
38
+ "@rxdrag/rxcms-models": "0.3.92"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "astro": "^4.0.0 || ^5.0.0"
@@ -1,13 +1,18 @@
1
1
  ---
2
- import type { FileRef, Media } from "@rxdrag/rxcms-models";
2
+ import { Entify, type ImageProps, type Locals } from "@rxdrag/website-lib-core";
3
+ const { env, imageSizes } = Astro.locals as Locals;
3
4
 
4
- interface Props extends Omit<astroHTML.JSX.ImgHTMLAttributes, "src" | "class"> {
5
- showField?: keyof FileRef;
6
- image?: Media;
7
- className?: string;
8
- }
5
+ interface Props extends ImageProps {}
9
6
 
10
- const { showField = "url", image, className, ...props } = Astro.props;
7
+ const { mediaRef, fileField, resize, className, ...props } = Astro.props;
8
+
9
+ const rx = Entify.getInstance(env, imageSizes);
10
+
11
+ const media = rx ? await rx.getMedia(mediaRef, fileField, resize) : undefined;
11
12
  ---
12
13
 
13
- <img src={image?.file?.[showField] || ""} class={className} {...props} />
14
+ <img
15
+ src={fileField ? media?.file?.[fileField] : media?.file?.original || ""}
16
+ class={className}
17
+ {...props}
18
+ />