@rxdrag/website-lib-core 0.0.126 → 0.0.128
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/README.md +1 -1
- package/index.ts +1 -1
- package/package.json +2 -2
- package/src/astro/animation.ts +146 -146
- package/src/astro/background.ts +82 -53
- package/src/astro/base.ts +7 -0
- package/src/astro/business.ts +13 -0
- package/src/astro/grid/consts.ts +80 -80
- package/src/astro/grid/index.ts +2 -2
- package/src/astro/grid/types.ts +35 -35
- package/src/astro/image.ts +239 -239
- package/src/astro/index.ts +12 -9
- package/src/astro/link.ts +20 -0
- package/src/astro/media.ts +123 -123
- package/src/astro/nav.ts +13 -13
- package/src/astro/section/index.ts +7 -12
- package/src/component-logic/index.ts +1 -1
- package/src/component-logic/link-client.ts +32 -32
- package/src/component-logic/link.ts +61 -61
- package/src/design-tokens.ts +160 -160
- package/src/entify/Entify.ts +533 -530
- package/src/entify/IEntify.ts +151 -177
- package/src/entify/index.ts +4 -4
- package/src/entify/lib/collectCategoryIds.ts +20 -20
- package/src/entify/lib/fulltextSearch.ts +63 -62
- package/src/entify/lib/langFields.ts +14 -14
- package/src/entify/lib/listToTree.ts +23 -23
- package/src/entify/lib/newAvatarQueryOptions.ts +4 -4
- package/src/entify/lib/newOgImageQueryOptions.ts +5 -5
- package/src/entify/lib/newQueryPostOptions.ts +42 -45
- package/src/entify/lib/newQueryProductOptions.ts +96 -98
- package/src/entify/lib/newQueryProductsMediaOptions.ts +28 -28
- package/src/entify/lib/queryAllProducts.ts +40 -40
- package/src/entify/lib/queryBulletin.ts +28 -16
- package/src/entify/lib/queryEntityList.ts +41 -41
- package/src/entify/lib/queryFeaturedProducts.ts +69 -68
- package/src/entify/lib/queryLangs.ts +36 -60
- package/src/entify/lib/queryLatestPosts.ts +92 -91
- package/src/entify/lib/queryOneEntity.ts +63 -63
- package/src/entify/lib/queryOneMedia.ts +27 -27
- package/src/entify/lib/queryOnePostById.ts +21 -21
- package/src/entify/lib/queryOnePostBySlug.ts +40 -39
- package/src/entify/lib/queryOnePostCategoryBySlug.ts +35 -35
- package/src/entify/lib/queryOneProductById.ts +20 -20
- package/src/entify/lib/queryOneProductBySlug.ts +53 -52
- package/src/entify/lib/queryOneProductCategoryBySlug.ts +50 -49
- package/src/entify/lib/queryOneTheme.ts +54 -72
- package/src/entify/lib/queryOneUser.ts +38 -38
- package/src/entify/lib/queryPostCategories.ts +67 -67
- package/src/entify/lib/queryPostSlugs.ts +37 -37
- package/src/entify/lib/queryPosts.ts +175 -174
- package/src/entify/lib/queryProductCategories.ts +59 -59
- package/src/entify/lib/queryProducts.ts +145 -144
- package/src/entify/lib/queryProductsInMenu.ts +45 -45
- package/src/entify/lib/queryTagCategories.ts +58 -58
- package/src/entify/lib/queryTags.ts +57 -57
- package/src/entify/lib/queryUserIds.ts +24 -24
- package/src/entify/lib/queryUserPosts.ts +80 -79
- package/src/entify/lib/queryWebSiteSettings.ts +28 -28
- package/src/entify/lib/queryWebsite.ts +43 -43
- package/src/entify/lib/sendEmail.ts +7 -7
- package/src/entify/lib/toQueryOptions.ts +19 -19
- package/src/entify/lib/upsertEntity.ts +8 -8
- package/src/entify/types/index.ts +1 -1
- package/src/entify/types/utils.ts +11 -6
- package/src/entify/types/variables.ts +5 -6
- package/src/entify/view-model/funcs.ts +230 -230
- package/src/entify/view-model/index.ts +1 -1
- package/src/entify/view-model/models.ts +135 -135
- package/src/global.d.ts +7 -7
- package/src/index.ts +8 -8
- package/src/lib/formatDate.ts +15 -15
- package/src/lib/index.ts +3 -3
- package/src/lib/pagination.ts +114 -114
- package/src/lib/utils.ts +135 -135
- package/src/react/components/Analytics/eventHandlers.ts +173 -173
- package/src/react/components/Analytics/index.tsx +21 -21
- package/src/react/components/Analytics/singleton.ts +214 -214
- package/src/react/components/Analytics/tracking.ts +221 -221
- package/src/react/components/Analytics/types.ts +60 -60
- package/src/react/components/Analytics/utils.ts +95 -95
- package/src/react/components/AttachmentIcon/index.tsx +53 -53
- package/src/react/components/BackgroundHlsVideoPlayer.tsx +97 -97
- package/src/react/components/BackgroundVideoPlayer.tsx +32 -32
- package/src/react/components/Bulletin.tsx +30 -30
- package/src/react/components/ContactForm/ContactForm.tsx +289 -289
- package/src/react/components/ContactForm/Input.tsx +48 -48
- package/src/react/components/ContactForm/Input2.tsx +59 -59
- package/src/react/components/ContactForm/Submit.tsx +48 -48
- package/src/react/components/ContactForm/TelInput.tsx +215 -215
- package/src/react/components/ContactForm/Textarea.tsx +48 -48
- package/src/react/components/ContactForm/Textarea2.tsx +89 -89
- package/src/react/components/ContactForm/funcs.ts +64 -64
- package/src/react/components/ContactForm/index.ts +7 -7
- package/src/react/components/ContactForm/types.ts +68 -68
- package/src/react/components/GoogleConsent/CookieItemPanel.tsx +80 -80
- package/src/react/components/GoogleConsent/CumtomizedModal.tsx +148 -148
- package/src/react/components/GoogleConsent/GoogleConsent.tsx +100 -100
- package/src/react/components/GoogleConsent/gtags.ts +67 -67
- package/src/react/components/GoogleConsent/index.ts +2 -2
- package/src/react/components/GoogleConsent/types.ts +18 -18
- package/src/react/components/GoogleConsent//345/217/202/350/200/203.md +4 -4
- package/src/react/components/Icon/index.tsx +19 -19
- package/src/react/components/Medias/MainMedia.tsx +257 -257
- package/src/react/components/Medias/Thumbnail.tsx +62 -62
- package/src/react/components/Medias/VideoPlayer.tsx +114 -114
- package/src/react/components/Medias/index.tsx +271 -271
- package/src/react/components/ProductCard/ProductCard.tsx +24 -24
- package/src/react/components/ProductCard/ProductCta/index.tsx +28 -28
- package/src/react/components/ProductCard/ProductCta/style.css +3 -3
- package/src/react/components/ProductCard/ProductDescription/index.tsx +12 -12
- package/src/react/components/ProductCard/ProductDescription/style.css +5 -5
- package/src/react/components/ProductCard/ProductMedia/index.tsx +35 -35
- package/src/react/components/ProductCard/ProductMedia/style.css +5 -5
- package/src/react/components/ProductCard/ProductTitle/index.tsx +7 -7
- package/src/react/components/ProductCard/ProductTitle/style.css +3 -3
- package/src/react/components/ProductCard/ProductView.tsx +36 -36
- package/src/react/components/ProductCard/index.ts +4 -4
- package/src/react/components/ProductCard/useQueryProduct.ts +32 -32
- package/src/react/components/ReactModalTrigger.tsx +28 -28
- package/src/react/components/ReactVideoPlayer.tsx +29 -52
- package/src/react/components/RichTextOutline/index.tsx +75 -75
- package/src/react/components/RichTextOutline/useAnchorScroll.ts +23 -23
- package/src/react/components/Scroller.tsx +39 -39
- package/src/react/components/SearchInput.tsx +21 -21
- package/src/react/components/Share/index.tsx +86 -86
- package/src/react/components/Share/socials.tsx +79 -77
- package/src/react/components/Share//350/265/204/346/226/231.md +7 -7
- package/src/react/components/ToTop.tsx +72 -72
- package/src/react/components/VideoPlayIcon.tsx +43 -0
- package/src/react/components/all.ts +38 -38
- package/src/react/components/index.ts +16 -16
- package/src/robots.ts +4 -4
- package/src/entify/lib/newPageMetaOptions.ts +0 -18
- package/src/entify/lib/newQueryPageOptions.ts +0 -14
- package/src/entify/lib/queryOneIcon.ts +0 -27
- package/src/entify/lib/queryPageBySlug.ts +0 -43
- package/src/entify/lib/queryPageByType.ts +0 -44
|
@@ -1,78 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export interface IconListType {
|
|
4
|
+
[key: string]: {
|
|
5
|
+
title: string;
|
|
6
|
+
path: React.ReactElement;
|
|
7
|
+
url: (l: string, t?: string, ti?: string) => string;
|
|
8
|
+
color: string;
|
|
9
|
+
viewBox?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const iconList: IconListType = {
|
|
14
|
+
linkedin: {
|
|
15
|
+
title: "LinkedIn",
|
|
16
|
+
path: (
|
|
17
|
+
<path d="M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z" />
|
|
18
|
+
),
|
|
19
|
+
color: "#0073b1",
|
|
20
|
+
url: (l, t, ti) =>
|
|
21
|
+
`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(l)}&title=${encodeURIComponent(ti || "")}&summary=${encodeURIComponent(t || "")}`,
|
|
22
|
+
},
|
|
23
|
+
facebook: {
|
|
24
|
+
title: "Facebook",
|
|
25
|
+
path: (
|
|
26
|
+
<path d="M24 12a12 12 0 10-13.9 11.9v-8.4h-3V12h3V9.4c0-3 1.8-4.7 4.6-4.7l2.6.2v3h-1.5c-1.5 0-2 .9-2 1.8V12h3.4l-.5 3.5h-2.8v8.4A12 12 0 0024 12z" />
|
|
27
|
+
),
|
|
28
|
+
color: "#0076FB",
|
|
29
|
+
url: (l) => `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(l)}`,
|
|
30
|
+
},
|
|
31
|
+
twitter: {
|
|
32
|
+
title: "X",
|
|
33
|
+
path: (
|
|
34
|
+
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path>
|
|
35
|
+
),
|
|
36
|
+
color: "#0F1419",
|
|
37
|
+
url: (l, t) => `https://twitter.com/intent/tweet?text=${t}&url=${encodeURIComponent(l)}`,
|
|
38
|
+
},
|
|
39
|
+
whatsapp: {
|
|
40
|
+
title: "WhatsApp",
|
|
41
|
+
path: (
|
|
42
|
+
<path d="M17.5 14.4l-2-1c-.3 0-.5-.1-.7.2l-1 1.1c-.1.2-.3.3-.6.1s-1.3-.5-2.4-1.5a9 9 0 01-1.7-2c-.1-.3 0-.5.2-.6l.4-.6c.2-.1.2-.3.3-.5v-.5L9 7c-.2-.6-.4-.5-.6-.5h-.6c-.2 0-.5 0-.8.4-.2.3-1 1-1 2.5s1 2.8 1.2 3c.2.2 2.1 3.2 5.1 4.5l1.7.6a4 4 0 001.9.2c.5-.1 1.7-.8 2-1.5.2-.6.2-1.2.1-1.4l-.5-.3M12 21.8a9.9 9.9 0 01-5-1.4l-.4-.2-3.7 1 1-3.7-.2-.3a9.9 9.9 0 01-1.5-5.3 9.9 9.9 0 0116.8-7 9.8 9.8 0 013 7 9.9 9.9 0 01-10 9.9m8.4-18.3A11.8 11.8 0 0012.1 0 12 12 0 001.8 17.8L0 24l6.4-1.6a11.9 11.9 0 005.6 1.4 12 12 0 0012-11.9 11.8 11.8 0 00-3.5-8.4z" />
|
|
43
|
+
),
|
|
44
|
+
color: "#25D366",
|
|
45
|
+
url: (l, t) => `https://api.whatsapp.com/send?text=${encodeURIComponent(t || "")} ${encodeURIComponent(l)}`,
|
|
46
|
+
},
|
|
47
|
+
reddit: {
|
|
48
|
+
title: "Reddit",
|
|
49
|
+
path: (
|
|
50
|
+
<path d="M12 0A12 12 0 000 12a12 12 0 0012 12 12 12 0 0012-12A12 12 0 0012 0zm5.01 4.74c.69 0 1.25.56 1.25 1.25a1.25 1.25 0 01-2.5.06l-2.6-.55-.8 3.75c1.83.07 3.48.63 4.68 1.49.3-.31.73-.5 1.2-.5.97 0 1.76.8 1.76 1.76 0 .72-.43 1.33-1.01 1.61a3.11 3.11 0 01.04.52c0 2.7-3.13 4.87-7 4.87-3.88 0-7-2.17-7-4.87 0-.18 0-.36.04-.53A1.75 1.75 0 014.03 12a1.75 1.75 0 012.96-1.26 8.52 8.52 0 014.74-1.5l.89-4.17a.34.34 0 01.14-.2.35.35 0 01.24-.04l2.9.62a1.21 1.21 0 011.11-.7zM9.25 12a1.25 1.25 0 101.25 1.25c0-.69-.56-1.25-1.25-1.25zm5.5 0a1.25 1.25 0 000 2.5 1.25 1.25 0 000-2.5zm-5.47 3.99a.33.33 0 00-.23.1.33.33 0 000 .46c.84.84 2.49.91 2.96.91.48 0 2.1-.06 2.96-.91a.36.36 0 00.03-.47.33.33 0 00-.46 0c-.55.54-1.68.73-2.51.73-.83 0-1.98-.2-2.51-.73a.33.33 0 00-.24-.1z" />
|
|
51
|
+
),
|
|
52
|
+
color: "#FF4500",
|
|
53
|
+
url: (l, t) => `https://www.reddit.com/submit?url=${encodeURIComponent(l)}&title=${encodeURIComponent(t || "")}`,
|
|
54
|
+
},
|
|
55
|
+
// telegram: {
|
|
56
|
+
// title: "Telegram",
|
|
57
|
+
// path: (
|
|
58
|
+
// <path d="M23.91 3.79L20.3 20.84c-.25 1.21-.98 1.5-2 .94l-5.5-4.07-2.66 2.57c-.3.3-.55.56-1.1.56-.72 0-.6-.27-.84-.95L6.3 13.7.85 12c-1.18-.35-1.19-1.16.26-1.75l21.26-8.2c.97-.43 1.9.24 1.53 1.73z" />
|
|
59
|
+
// ),
|
|
60
|
+
// color: "#0088CC",
|
|
61
|
+
// url: (l, t) => `https://telegram.me/share/msg?url=${encodeURIComponent(l)}&text=${encodeURIComponent(t || "")}`,
|
|
62
|
+
// },
|
|
63
|
+
|
|
64
|
+
// pinterest: {
|
|
65
|
+
// title: "Pinterest",
|
|
66
|
+
// path: (
|
|
67
|
+
// <path d="M0 12C0 17.123 3.211 21.497 7.73 23.218C7.62 22.281 7.503 20.736 7.755 19.652C7.972 18.72 9.156 13.714 9.156 13.714C9.156 13.714 8.799 12.999 8.799 11.94C8.799 10.28 9.761 9.04 10.96 9.04C11.98 9.04 12.472 9.805 12.472 10.722C12.472 11.747 11.819 13.279 11.482 14.7C11.201 15.889 12.079 16.859 13.251 16.859C15.374 16.859 17.007 14.62 17.007 11.388C17.007 8.527 14.951 6.528 12.016 6.528C8.618 6.528 6.623 9.077 6.623 11.712C6.623 12.739 7.018 13.839 7.512 14.438C7.55412 14.4832 7.58387 14.5386 7.59841 14.5986C7.61295 14.6587 7.61177 14.7215 7.595 14.781C7.504 15.159 7.302 15.97 7.263 16.136C7.21 16.354 7.09 16.401 6.863 16.295C5.371 15.601 4.439 13.42 4.439 11.668C4.439 7.899 7.176 4.439 12.331 4.439C16.475 4.439 19.696 7.392 19.696 11.338C19.696 15.455 17.101 18.769 13.497 18.769C12.286 18.769 11.149 18.139 10.759 17.396C10.759 17.396 10.16 19.678 10.015 20.236C9.733 21.32 8.951 22.692 8.466 23.471C9.584 23.815 10.77 24 12 24C18.627 24 24 18.627 24 12C24 5.373 18.627 0 12 0C5.373 0 0 5.373 0 12Z" />
|
|
68
|
+
// ),
|
|
69
|
+
// color: "#c8232c",
|
|
70
|
+
// url: (l) => `http://pinterest.com/pin/create/link/?url=${encodeURIComponent(l)}`,
|
|
71
|
+
// },
|
|
72
|
+
// email: {
|
|
73
|
+
// title: "Email",
|
|
74
|
+
// path: (
|
|
75
|
+
// <path d="M20 4H4a2 2 0 00-2 2v12c0 1.1.9 2 2 2h16a2 2 0 002-2V6a2 2 0 00-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" />
|
|
76
|
+
// ),
|
|
77
|
+
// color: "#E53E3E",
|
|
78
|
+
// url: (l, t) => `mailto:?body=${encodeURIComponent(l)}&subject=${encodeURIComponent(t || "")}`,
|
|
79
|
+
// },
|
|
78
80
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Facebook调试:https://developers.facebook.com/tools/debug/
|
|
3
|
-
|
|
4
|
-
https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started
|
|
5
|
-
https://developers.facebook.com/docs/sharing/webmasters/
|
|
6
|
-
https://developers.pinterest.com/docs/rich-pins/rich-pins/
|
|
7
|
-
https://www.linkedin.com/help/linkedin/answer/a521928/making-your-website-shareable-on-linkedin?lang=en
|
|
1
|
+
|
|
2
|
+
Facebook调试:https://developers.facebook.com/tools/debug/
|
|
3
|
+
|
|
4
|
+
https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started
|
|
5
|
+
https://developers.facebook.com/docs/sharing/webmasters/
|
|
6
|
+
https://developers.pinterest.com/docs/rich-pins/rich-pins/
|
|
7
|
+
https://www.linkedin.com/help/linkedin/answer/a521928/making-your-website-shareable-on-linkedin?lang=en
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import { forwardRef, useRef, useEffect, useState } from "react";
|
|
3
|
-
|
|
4
|
-
export type ToTopProps = {
|
|
5
|
-
className?: string;
|
|
6
|
-
svg?: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const topIcon = () => (
|
|
10
|
-
<svg
|
|
11
|
-
className="h-6 w-6"
|
|
12
|
-
width="1.5rem"
|
|
13
|
-
height="1.5rem"
|
|
14
|
-
fill="none"
|
|
15
|
-
viewBox="0 0 24 24"
|
|
16
|
-
stroke="currentColor"
|
|
17
|
-
>
|
|
18
|
-
<path
|
|
19
|
-
strokeLinecap="round"
|
|
20
|
-
strokeLinejoin="round"
|
|
21
|
-
strokeWidth={2}
|
|
22
|
-
d="M5 15l7-7 7 7"
|
|
23
|
-
/>
|
|
24
|
-
</svg>
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
export const ToTop = forwardRef<HTMLDivElement, ToTopProps>((props, ref) => {
|
|
28
|
-
const { className, svg, ...rest } = props;
|
|
29
|
-
const [win, setWin] = useState<Window | null>(null);
|
|
30
|
-
const innerRef = useRef<HTMLDivElement>(null);
|
|
31
|
-
|
|
32
|
-
// 合并外部传入的ref和内部ref
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (!innerRef.current) return;
|
|
35
|
-
|
|
36
|
-
// 获取当前元素所在的window
|
|
37
|
-
const currentWin = innerRef.current.ownerDocument.defaultView;
|
|
38
|
-
setWin(currentWin);
|
|
39
|
-
|
|
40
|
-
// 如果外部传入的是ref对象,则设置其current属性
|
|
41
|
-
if (ref && typeof ref === "object") {
|
|
42
|
-
ref.current = innerRef.current;
|
|
43
|
-
}
|
|
44
|
-
}, [ref]);
|
|
45
|
-
|
|
46
|
-
const handleClick = () => {
|
|
47
|
-
if (win) {
|
|
48
|
-
win.scrollTo({ top: 0, behavior: "smooth" });
|
|
49
|
-
} else if (typeof window !== "undefined") {
|
|
50
|
-
// 降级处理:如果没有获取到特定window,使用全局window
|
|
51
|
-
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div
|
|
57
|
-
ref={innerRef}
|
|
58
|
-
className={clsx(
|
|
59
|
-
"fixed bottom-4 right-4 hidden user-select-none shadow-lg scrolled:flex cursor-pointer transition duration-300 ease-in-out z-50",
|
|
60
|
-
className
|
|
61
|
-
)}
|
|
62
|
-
{...rest}
|
|
63
|
-
onClick={handleClick}
|
|
64
|
-
>
|
|
65
|
-
{svg ? (
|
|
66
|
-
<div className="contents" dangerouslySetInnerHTML={{ __html: svg }} />
|
|
67
|
-
) : (
|
|
68
|
-
topIcon()
|
|
69
|
-
)}
|
|
70
|
-
</div>
|
|
71
|
-
);
|
|
72
|
-
});
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { forwardRef, useRef, useEffect, useState } from "react";
|
|
3
|
+
|
|
4
|
+
export type ToTopProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
svg?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const topIcon = () => (
|
|
10
|
+
<svg
|
|
11
|
+
className="h-6 w-6"
|
|
12
|
+
width="1.5rem"
|
|
13
|
+
height="1.5rem"
|
|
14
|
+
fill="none"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
>
|
|
18
|
+
<path
|
|
19
|
+
strokeLinecap="round"
|
|
20
|
+
strokeLinejoin="round"
|
|
21
|
+
strokeWidth={2}
|
|
22
|
+
d="M5 15l7-7 7 7"
|
|
23
|
+
/>
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const ToTop = forwardRef<HTMLDivElement, ToTopProps>((props, ref) => {
|
|
28
|
+
const { className, svg, ...rest } = props;
|
|
29
|
+
const [win, setWin] = useState<Window | null>(null);
|
|
30
|
+
const innerRef = useRef<HTMLDivElement>(null);
|
|
31
|
+
|
|
32
|
+
// 合并外部传入的ref和内部ref
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!innerRef.current) return;
|
|
35
|
+
|
|
36
|
+
// 获取当前元素所在的window
|
|
37
|
+
const currentWin = innerRef.current.ownerDocument.defaultView;
|
|
38
|
+
setWin(currentWin);
|
|
39
|
+
|
|
40
|
+
// 如果外部传入的是ref对象,则设置其current属性
|
|
41
|
+
if (ref && typeof ref === "object") {
|
|
42
|
+
ref.current = innerRef.current;
|
|
43
|
+
}
|
|
44
|
+
}, [ref]);
|
|
45
|
+
|
|
46
|
+
const handleClick = () => {
|
|
47
|
+
if (win) {
|
|
48
|
+
win.scrollTo({ top: 0, behavior: "smooth" });
|
|
49
|
+
} else if (typeof window !== "undefined") {
|
|
50
|
+
// 降级处理:如果没有获取到特定window,使用全局window
|
|
51
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div
|
|
57
|
+
ref={innerRef}
|
|
58
|
+
className={clsx(
|
|
59
|
+
"fixed bottom-4 right-4 hidden user-select-none shadow-lg scrolled:flex cursor-pointer transition duration-300 ease-in-out z-50",
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
{...rest}
|
|
63
|
+
onClick={handleClick}
|
|
64
|
+
>
|
|
65
|
+
{svg ? (
|
|
66
|
+
<div className="contents" dangerouslySetInnerHTML={{ __html: svg }} />
|
|
67
|
+
) : (
|
|
68
|
+
topIcon()
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
|
|
3
|
+
export function VideoPlayIcon(props: {
|
|
4
|
+
classNames?: {
|
|
5
|
+
playButton?: string;
|
|
6
|
+
playButtonOuter?: string;
|
|
7
|
+
playButtonInner?: string;
|
|
8
|
+
playIcon?: string;
|
|
9
|
+
};
|
|
10
|
+
}) {
|
|
11
|
+
const { classNames } = props;
|
|
12
|
+
return (
|
|
13
|
+
<div
|
|
14
|
+
className={clsx(
|
|
15
|
+
"flex items-center justify-center w-14 h-14 lg:w-[130px] lg:h-[130px] bg-white/15 rounded-full backdrop-blur-sm hover:shadow-md transition-all duration-300 hover:scale-110 group",
|
|
16
|
+
classNames?.playButtonOuter,
|
|
17
|
+
)}
|
|
18
|
+
>
|
|
19
|
+
<div
|
|
20
|
+
className={clsx(
|
|
21
|
+
"w-10 h-10 lg:w-[90px] lg:h-[90px] bg-white relative overflow-hidden rounded-full",
|
|
22
|
+
classNames?.playButtonInner,
|
|
23
|
+
)}
|
|
24
|
+
>
|
|
25
|
+
<div className="absolute inset-0 cross-gradient box-shadow-1">
|
|
26
|
+
<div className="w-full h-full flex items-center justify-center">
|
|
27
|
+
<svg
|
|
28
|
+
className={clsx(
|
|
29
|
+
"size-4 lg:size-8 text-gray-700",
|
|
30
|
+
classNames?.playIcon,
|
|
31
|
+
)}
|
|
32
|
+
viewBox="0 0 30 32"
|
|
33
|
+
fill="currentColor"
|
|
34
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
35
|
+
>
|
|
36
|
+
<path d="M27.2003 19.4972C29.945 17.9735 29.945 14.0264 27.2003 12.5027L6.44148 0.978573C3.77538 -0.501503 0.5 1.42643 0.5 4.47581V27.5241C0.5 30.5735 3.77537 32.5014 6.44147 31.0214L27.2003 19.4972Z" />
|
|
37
|
+
</svg>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Analytics } from "./Analytics";
|
|
2
|
-
import { AttachmentIcon } from "./AttachmentIcon";
|
|
3
|
-
import { BackgroundHlsVideoPlayer } from "./BackgroundHlsVideoPlayer";
|
|
4
|
-
import { BackgroundVideoPlayer } from "./BackgroundVideoPlayer";
|
|
5
|
-
import { Bulletin } from "./Bulletin";
|
|
6
|
-
import { ContactForm } from "./ContactForm";
|
|
7
|
-
import { Icon } from "./Icon";
|
|
8
|
-
import { Medias } from "./Medias";
|
|
9
|
-
import { ProductCard, ProductCta, ProductDescription, ProductMedia, ProductTitle } from "./ProductCard";
|
|
10
|
-
import { ReactModalTrigger } from "./ReactModalTrigger";
|
|
11
|
-
import { ReactVideoPlayer } from "./ReactVideoPlayer";
|
|
12
|
-
import { RichTextOutline } from "./RichTextOutline";
|
|
13
|
-
import { Scroller } from "./Scroller";
|
|
14
|
-
import { SearchInput } from "./SearchInput";
|
|
15
|
-
import { Share } from "./Share";
|
|
16
|
-
import { ToTop } from "./ToTop";
|
|
17
|
-
|
|
18
|
-
export const allCoreComponents = {
|
|
19
|
-
Analytics,
|
|
20
|
-
AttachmentIcon,
|
|
21
|
-
BackgroundHlsVideoPlayer,
|
|
22
|
-
BackgroundVideoPlayer,
|
|
23
|
-
Bulletin,
|
|
24
|
-
ContactForm,
|
|
25
|
-
Icon,
|
|
26
|
-
Medias,
|
|
27
|
-
ProductCard,
|
|
28
|
-
ProductCta,
|
|
29
|
-
ProductDescription,
|
|
30
|
-
ProductMedia,
|
|
31
|
-
ProductTitle,
|
|
32
|
-
ReactModalTrigger,
|
|
33
|
-
ReactVideoPlayer,
|
|
34
|
-
RichTextOutline,
|
|
35
|
-
Scroller,
|
|
36
|
-
SearchInput,
|
|
37
|
-
Share,
|
|
38
|
-
ToTop,
|
|
1
|
+
import { Analytics } from "./Analytics";
|
|
2
|
+
import { AttachmentIcon } from "./AttachmentIcon";
|
|
3
|
+
import { BackgroundHlsVideoPlayer } from "./BackgroundHlsVideoPlayer";
|
|
4
|
+
import { BackgroundVideoPlayer } from "./BackgroundVideoPlayer";
|
|
5
|
+
import { Bulletin } from "./Bulletin";
|
|
6
|
+
import { ContactForm } from "./ContactForm";
|
|
7
|
+
import { Icon } from "./Icon";
|
|
8
|
+
import { Medias } from "./Medias";
|
|
9
|
+
import { ProductCard, ProductCta, ProductDescription, ProductMedia, ProductTitle } from "./ProductCard";
|
|
10
|
+
import { ReactModalTrigger } from "./ReactModalTrigger";
|
|
11
|
+
import { ReactVideoPlayer } from "./ReactVideoPlayer";
|
|
12
|
+
import { RichTextOutline } from "./RichTextOutline";
|
|
13
|
+
import { Scroller } from "./Scroller";
|
|
14
|
+
import { SearchInput } from "./SearchInput";
|
|
15
|
+
import { Share } from "./Share";
|
|
16
|
+
import { ToTop } from "./ToTop";
|
|
17
|
+
|
|
18
|
+
export const allCoreComponents = {
|
|
19
|
+
Analytics,
|
|
20
|
+
AttachmentIcon,
|
|
21
|
+
BackgroundHlsVideoPlayer,
|
|
22
|
+
BackgroundVideoPlayer,
|
|
23
|
+
Bulletin,
|
|
24
|
+
ContactForm,
|
|
25
|
+
Icon,
|
|
26
|
+
Medias,
|
|
27
|
+
ProductCard,
|
|
28
|
+
ProductCta,
|
|
29
|
+
ProductDescription,
|
|
30
|
+
ProductMedia,
|
|
31
|
+
ProductTitle,
|
|
32
|
+
ReactModalTrigger,
|
|
33
|
+
ReactVideoPlayer,
|
|
34
|
+
RichTextOutline,
|
|
35
|
+
Scroller,
|
|
36
|
+
SearchInput,
|
|
37
|
+
Share,
|
|
38
|
+
ToTop,
|
|
39
39
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export * from "./Analytics";
|
|
2
|
-
export * from "./AttachmentIcon";
|
|
3
|
-
export * from "./ContactForm";
|
|
4
|
-
export * from "./Icon";
|
|
5
|
-
export * from "./Medias";
|
|
6
|
-
export * from "./ProductCard";
|
|
7
|
-
export * from "./RichTextOutline";
|
|
8
|
-
export * from "./Share";
|
|
9
|
-
export * from "./Scroller";
|
|
10
|
-
export * from "./SearchInput";
|
|
11
|
-
export * from "./ToTop";
|
|
12
|
-
export * from "./BackgroundVideoPlayer";
|
|
13
|
-
export * from "./BackgroundHlsVideoPlayer";
|
|
14
|
-
export * from "./Bulletin";
|
|
15
|
-
export * from "./ReactModalTrigger";
|
|
16
|
-
export * from "./ReactVideoPlayer";
|
|
1
|
+
export * from "./Analytics";
|
|
2
|
+
export * from "./AttachmentIcon";
|
|
3
|
+
export * from "./ContactForm";
|
|
4
|
+
export * from "./Icon";
|
|
5
|
+
export * from "./Medias";
|
|
6
|
+
export * from "./ProductCard";
|
|
7
|
+
export * from "./RichTextOutline";
|
|
8
|
+
export * from "./Share";
|
|
9
|
+
export * from "./Scroller";
|
|
10
|
+
export * from "./SearchInput";
|
|
11
|
+
export * from "./ToTop";
|
|
12
|
+
export * from "./BackgroundVideoPlayer";
|
|
13
|
+
export * from "./BackgroundHlsVideoPlayer";
|
|
14
|
+
export * from "./Bulletin";
|
|
15
|
+
export * from "./ReactModalTrigger";
|
|
16
|
+
export * from "./ReactVideoPlayer";
|
|
17
17
|
export * from "./all"
|
package/src/robots.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const disallowAllRobots = `User-agent: *
|
|
2
|
-
Disallow: /`;
|
|
3
|
-
export const allowAllRobots = `User-agent: *
|
|
4
|
-
Disallow:`;
|
|
1
|
+
export const disallowAllRobots = `User-agent: *
|
|
2
|
+
Disallow: /`;
|
|
3
|
+
export const allowAllRobots = `User-agent: *
|
|
4
|
+
Disallow:`;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { PageMetaQueryOptions, PageMetaFields } from "@rxdrag/rxcms-models";
|
|
2
|
-
import { newOgImageQueryOptions } from "./newOgImageQueryOptions";
|
|
3
|
-
|
|
4
|
-
export function newPageMetaOptions() {
|
|
5
|
-
return new PageMetaQueryOptions([
|
|
6
|
-
PageMetaFields.id,
|
|
7
|
-
PageMetaFields.seoTitle,
|
|
8
|
-
PageMetaFields.seoKeywords,
|
|
9
|
-
PageMetaFields.seoDescription,
|
|
10
|
-
PageMetaFields.ogTitle,
|
|
11
|
-
PageMetaFields.ogDescription,
|
|
12
|
-
PageMetaFields.ogUrl,
|
|
13
|
-
PageMetaFields.ogType,
|
|
14
|
-
PageMetaFields.ogSiteName,
|
|
15
|
-
PageMetaFields.xCard,
|
|
16
|
-
PageMetaFields.xSite,
|
|
17
|
-
]).ogImage(newOgImageQueryOptions());
|
|
18
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PageQueryOptions,
|
|
3
|
-
PageFields,
|
|
4
|
-
} from "@rxdrag/rxcms-models";
|
|
5
|
-
import { newPageMetaOptions } from "./newPageMetaOptions";
|
|
6
|
-
|
|
7
|
-
//查询一个产品的参数,不带条件
|
|
8
|
-
export function newQueryPageOptions() {
|
|
9
|
-
return new PageQueryOptions([
|
|
10
|
-
PageFields.id,
|
|
11
|
-
PageFields.slug,
|
|
12
|
-
PageFields.title,
|
|
13
|
-
]).meta(newPageMetaOptions());
|
|
14
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { SvgIcon, SvgIconBoolExp, SvgIconDistinctExp, SvgIconOrderBy, SvgIconQueryOptions, SvgIconFields } from "@rxdrag/rxcms-models";
|
|
2
|
-
import { EnvVariables } from "../types";
|
|
3
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
4
|
-
|
|
5
|
-
export const queryOneIcon = async (
|
|
6
|
-
name: string | undefined | null,
|
|
7
|
-
envVariables: EnvVariables) => {
|
|
8
|
-
|
|
9
|
-
const icon = await queryOneEntity<SvgIcon, SvgIconBoolExp, SvgIconOrderBy, SvgIconDistinctExp>(
|
|
10
|
-
new SvgIconQueryOptions([
|
|
11
|
-
SvgIconFields.id,
|
|
12
|
-
SvgIconFields.name,
|
|
13
|
-
SvgIconFields.title,
|
|
14
|
-
SvgIconFields.code,
|
|
15
|
-
], {
|
|
16
|
-
where: {
|
|
17
|
-
name: {
|
|
18
|
-
"_eq": name || ""
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
.setNoQuery(!name)
|
|
23
|
-
,
|
|
24
|
-
envVariables
|
|
25
|
-
);
|
|
26
|
-
return icon;
|
|
27
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Page,
|
|
3
|
-
PageBoolExp,
|
|
4
|
-
PageOrderBy,
|
|
5
|
-
PageDistinctExp,
|
|
6
|
-
} from "@rxdrag/rxcms-models";
|
|
7
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
8
|
-
import { EnvVariables } from "../types";
|
|
9
|
-
import { newQueryPageOptions } from "./newQueryPageOptions";
|
|
10
|
-
|
|
11
|
-
export async function queryPageBySlug(
|
|
12
|
-
slug: string,
|
|
13
|
-
envVariables: EnvVariables
|
|
14
|
-
) {
|
|
15
|
-
const post = await queryOneEntity<
|
|
16
|
-
Page,
|
|
17
|
-
PageBoolExp,
|
|
18
|
-
PageOrderBy,
|
|
19
|
-
PageDistinctExp
|
|
20
|
-
>(
|
|
21
|
-
newQueryPageOptions().setQueryArgs({
|
|
22
|
-
where: {
|
|
23
|
-
slug: {
|
|
24
|
-
_eq: slug,
|
|
25
|
-
},
|
|
26
|
-
theme: {
|
|
27
|
-
lang: {
|
|
28
|
-
abbr: {
|
|
29
|
-
_eq: envVariables.language,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
website: {
|
|
33
|
-
id: {
|
|
34
|
-
_eq: envVariables.websiteId,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
{ ...envVariables, websiteId: undefined }
|
|
41
|
-
);
|
|
42
|
-
return post as Page | undefined;
|
|
43
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Page,
|
|
3
|
-
PageBoolExp,
|
|
4
|
-
PageOrderBy,
|
|
5
|
-
PageDistinctExp,
|
|
6
|
-
PageType,
|
|
7
|
-
} from "@rxdrag/rxcms-models";
|
|
8
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
9
|
-
import { EnvVariables } from "../types";
|
|
10
|
-
import { newQueryPageOptions } from "./newQueryPageOptions";
|
|
11
|
-
|
|
12
|
-
export async function queryPageByType(
|
|
13
|
-
pageType: PageType,
|
|
14
|
-
envVariables: EnvVariables
|
|
15
|
-
) {
|
|
16
|
-
const post = await queryOneEntity<
|
|
17
|
-
Page,
|
|
18
|
-
PageBoolExp,
|
|
19
|
-
PageOrderBy,
|
|
20
|
-
PageDistinctExp
|
|
21
|
-
>(
|
|
22
|
-
newQueryPageOptions().setQueryArgs({
|
|
23
|
-
where: {
|
|
24
|
-
pageType: {
|
|
25
|
-
_eq: pageType,
|
|
26
|
-
},
|
|
27
|
-
theme: {
|
|
28
|
-
lang: {
|
|
29
|
-
abbr: {
|
|
30
|
-
_eq: envVariables.language,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
website: {
|
|
34
|
-
id: {
|
|
35
|
-
_eq: envVariables.websiteId,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
{ ...envVariables, websiteId: undefined }
|
|
42
|
-
);
|
|
43
|
-
return post as Page | undefined;
|
|
44
|
-
}
|