@rxdrag/website-lib-core 0.0.81 → 0.0.83

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-core",
3
- "version": "0.0.81",
3
+ "version": "0.0.83",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts"
@@ -24,9 +24,9 @@
24
24
  "@types/react-dom": "^19.1.0",
25
25
  "eslint": "^7.32.0",
26
26
  "typescript": "^5",
27
- "@rxdrag/tsconfig": "0.2.0",
28
27
  "@rxdrag/slate-preview": "1.2.61",
29
- "@rxdrag/eslint-config-custom": "0.2.12"
28
+ "@rxdrag/eslint-config-custom": "0.2.12",
29
+ "@rxdrag/tsconfig": "0.2.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "@iconify/utils": "^3.0.2",
@@ -3,6 +3,7 @@ import {
3
3
  MediaOnProductFields,
4
4
  MediaQueryOptions,
5
5
  ImageSize,
6
+ MediaFields,
6
7
  } from "@rxdrag/rxcms-models";
7
8
 
8
9
  export function newQueryProductsMediaOptions(imageSize?: ImageSize | undefined) {
@@ -16,7 +17,7 @@ export function newQueryProductsMediaOptions(imageSize?: ImageSize | undefined)
16
17
  ],
17
18
  }
18
19
  ).media(
19
- new MediaQueryOptions().file([
20
+ new MediaQueryOptions([MediaFields.id, MediaFields.mediaType, MediaFields.mediaRef]).file([
20
21
  "thumbnail(width:400, height:320)",
21
22
  "url",
22
23
  imageSize
@@ -13,6 +13,7 @@ import {
13
13
  ProductOrderBy,
14
14
  ImageSize,
15
15
  PostCategoryFields,
16
+ MediaFields,
16
17
  } from "@rxdrag/rxcms-models";
17
18
  import { queryEntityList } from "./queryEntityList";
18
19
  import { ListResult } from "@rxdrag/entify-lib";
@@ -103,7 +104,8 @@ export async function queryPosts(
103
104
  if (!selectFields || selectFields.includes("author" as keyof Post)) {
104
105
  queryOptions.author(
105
106
  new UserQueryOptions([UserFields.id, UserFields.name]).avatar(
106
- new MediaQueryOptions().file(["thumbnail"])
107
+ new MediaQueryOptions([MediaFields.id, MediaFields.mediaType, MediaFields.mediaRef])
108
+ .file(["thumbnail", "original"])
107
109
  )
108
110
  );
109
111
  }
@@ -96,7 +96,7 @@ export function productToViewModel(product?: Product): TProduct | undefined {
96
96
  meta: product?.meta,
97
97
  category:
98
98
  product?.category && productCategoryToViewModel(product?.category),
99
- cover: medias?.[0],
99
+ cover: medias?.filter?.(media => media.mediaType === "image")?.[0],
100
100
  medias: medias,
101
101
  attachments:
102
102
  product?.attachmentPivots &&