@rxdrag/website-lib-core 0.0.118 → 0.0.119
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 +7 -8
- package/src/entify/view-model/models.ts +2 -0
- package/src/react/components/ProductCard/ProductCard.tsx +1 -1
- package/src/react/components/ProductCard/ProductMedia/index.tsx +6 -5
- package/src/react/components/ProductCard/ProductView.tsx +3 -3
- package/src/react/components/ProductCard/index.ts +0 -1
- package/src/react/components/RichTextOutline/index.tsx +3 -3
- package/src/react/components/ProductCard/ProductCardPreview.tsx +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdrag/website-lib-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.119",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.ts"
|
|
@@ -18,15 +18,14 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@babel/types": "^7.26.9",
|
|
20
20
|
"@iconify/react": "^5.0.2",
|
|
21
|
-
"@types/gsap": "^3.0.0",
|
|
22
21
|
"@types/lodash-es": "^4.14.191",
|
|
23
22
|
"@types/react": "^19.1.0",
|
|
24
23
|
"@types/react-dom": "^19.1.0",
|
|
25
|
-
"eslint": "^
|
|
24
|
+
"eslint": "^9.39.2",
|
|
26
25
|
"typescript": "^5",
|
|
27
|
-
"@rxdrag/eslint-config-custom": "0.2.
|
|
28
|
-
"@rxdrag/
|
|
29
|
-
"@rxdrag/tsconfig": "0.2.
|
|
26
|
+
"@rxdrag/eslint-config-custom": "0.2.13",
|
|
27
|
+
"@rxdrag/tiptap-preview": "0.0.2",
|
|
28
|
+
"@rxdrag/tsconfig": "0.2.1"
|
|
30
29
|
},
|
|
31
30
|
"dependencies": {
|
|
32
31
|
"@iconify/utils": "^3.0.2",
|
|
@@ -34,8 +33,8 @@
|
|
|
34
33
|
"gsap": "^3.12.7",
|
|
35
34
|
"hls.js": "^1.6.13",
|
|
36
35
|
"lodash-es": "^4.17.21",
|
|
37
|
-
"@rxdrag/entify-lib": "0.0.
|
|
38
|
-
"@rxdrag/rxcms-models": "0.3.
|
|
36
|
+
"@rxdrag/entify-lib": "0.0.24",
|
|
37
|
+
"@rxdrag/rxcms-models": "0.3.97"
|
|
39
38
|
},
|
|
40
39
|
"peerDependencies": {
|
|
41
40
|
"astro": "^4.0.0 || ^5.0.0",
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { Product } from "@rxdrag/rxcms-models";
|
|
2
1
|
import { HtmlHTMLAttributes } from "react";
|
|
3
2
|
import "./style.css";
|
|
3
|
+
import { TProduct } from "../../../../entify";
|
|
4
4
|
|
|
5
5
|
export function ProductMedia(
|
|
6
6
|
props: {
|
|
7
|
-
product?:
|
|
7
|
+
product?: TProduct;
|
|
8
8
|
width?: number;
|
|
9
9
|
aspect?: string;
|
|
10
10
|
} & HtmlHTMLAttributes<HTMLImageElement>
|
|
11
11
|
) {
|
|
12
12
|
const { product, style, width, className, aspect, ...rest } = props;
|
|
13
|
-
const media = product?.mediaPivots?.[0]?.media;
|
|
14
13
|
|
|
15
14
|
return (
|
|
16
15
|
<div
|
|
17
16
|
className={"product-media " + className}
|
|
18
17
|
style={{
|
|
19
18
|
aspectRatio: aspect || "4 / 3",
|
|
19
|
+
borderRadius: "1rem",
|
|
20
|
+
overflow: "hidden",
|
|
20
21
|
...style,
|
|
21
22
|
width,
|
|
22
23
|
}}
|
|
@@ -26,8 +27,8 @@ export function ProductMedia(
|
|
|
26
27
|
style={{
|
|
27
28
|
width: "100%",
|
|
28
29
|
}}
|
|
29
|
-
src={
|
|
30
|
-
alt={product?.
|
|
30
|
+
src={product?.coverUrl}
|
|
31
|
+
alt={product?.title}
|
|
31
32
|
/>
|
|
32
33
|
</div>
|
|
33
34
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Product } from "@rxdrag/rxcms-models";
|
|
2
1
|
import { ProductCardProps } from "./ProductCard";
|
|
3
|
-
import { Figcaption, Figure, FigureContent } from "@rxdrag/
|
|
2
|
+
import { Figcaption, Figure, FigureContent } from "@rxdrag/tiptap-preview";
|
|
4
3
|
import { ProductMedia } from "./ProductMedia";
|
|
5
4
|
import { ProductTitle } from "./ProductTitle";
|
|
6
5
|
import { ProductDescription } from "./ProductDescription";
|
|
7
6
|
import { ProductCta } from "./ProductCta";
|
|
7
|
+
import { TProduct } from "../../../entify";
|
|
8
8
|
|
|
9
9
|
export function ProductView(
|
|
10
10
|
props: {
|
|
11
|
-
product?:
|
|
11
|
+
product?: TProduct;
|
|
12
12
|
ctaTitle?: string;
|
|
13
13
|
} & ProductCardProps
|
|
14
14
|
) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { extractOutlineFromTiptap, mdxToTiptap } from "@rxdrag/tiptap-preview";
|
|
2
2
|
import { forwardRef, useEffect } from "react";
|
|
3
3
|
import { useAcitviedHeading } from "./useAcitviedHeading";
|
|
4
4
|
import clsx from "clsx";
|
|
@@ -18,8 +18,8 @@ export const RichTextOutline = forwardRef<
|
|
|
18
18
|
>((props, ref) => {
|
|
19
19
|
const { className, itemClassName, value, yOffset = 200, ...rest } = props;
|
|
20
20
|
const activiedId = useAcitviedHeading(yOffset);
|
|
21
|
-
const
|
|
22
|
-
const outline =
|
|
21
|
+
const doc = mdxToTiptap(value ?? "");
|
|
22
|
+
const outline = extractOutlineFromTiptap(doc);
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
const handleHashChange = () => {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useQueryProduct } from "./useQueryProduct";
|
|
2
|
-
import { ProductCardProps } from "./ProductCard";
|
|
3
|
-
import { ProductView } from "./ProductView";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const createXProductCardPreview = (websiteId?: string) => {
|
|
7
|
-
return ({ node }: ProductCardProps) => {
|
|
8
|
-
const product = useQueryProduct(node?.productId, websiteId);
|
|
9
|
-
|
|
10
|
-
return <ProductView product={product} node={node} />;
|
|
11
|
-
}
|
|
12
|
-
}
|