@rxdrag/website-lib-core 0.0.4 → 0.0.7
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/index.ts +1 -0
- package/package.json +12 -13
- package/src/entify/Entify.ts +365 -0
- package/{dist/entify/index.d.ts → src/entify/index.ts} +4 -4
- package/src/entify/lib/createEntifyClient.ts +23 -0
- package/{dist/entify/lib/index.d.ts → src/entify/lib/index.ts} +29 -29
- package/src/entify/lib/langFields.ts +12 -0
- package/src/entify/lib/newAvatarQueryOptions.ts +5 -0
- package/src/entify/lib/newOgImageQueryOptions.ts +6 -0
- package/src/entify/lib/newPageMetaOptions.ts +20 -0
- package/src/entify/lib/newQueryPostOptions.ts +41 -0
- package/src/entify/lib/newQueryProductOptions.ts +90 -0
- package/src/entify/lib/newQueryProductsMediaOptions.ts +26 -0
- package/src/entify/lib/queryAllProducts.ts +27 -0
- package/src/entify/lib/queryEntityList.ts +44 -0
- package/src/entify/lib/queryFeaturedProducts.ts +47 -0
- package/src/entify/lib/queryLangs.ts +47 -0
- package/src/entify/lib/queryLatestPosts.ts +65 -0
- package/src/entify/lib/queryOneEntity.ts +67 -0
- package/src/entify/lib/queryOnePostById.ts +21 -0
- package/src/entify/lib/queryOnePostBySlug.ts +21 -0
- package/src/entify/lib/queryOnePostCategoryBySlug.ts +30 -0
- package/src/entify/lib/queryOneProductById.ts +20 -0
- package/src/entify/lib/queryOneProductBySlug.ts +21 -0
- package/src/entify/lib/queryOneProductCategoryBySlug.ts +30 -0
- package/src/entify/lib/queryOneTheme.ts +76 -0
- package/src/entify/lib/queryOneUser.ts +38 -0
- package/src/entify/lib/queryPostCategories.ts +48 -0
- package/src/entify/lib/queryPostSlugs.ts +32 -0
- package/src/entify/lib/queryPosts.ts +92 -0
- package/src/entify/lib/queryProductCategories.ts +44 -0
- package/src/entify/lib/queryProducts.ts +69 -0
- package/src/entify/lib/queryProductsInMenu.ts +31 -0
- package/src/entify/lib/queryUserIds.ts +24 -0
- package/src/entify/lib/queryUserPosts.ts +74 -0
- package/src/entify/lib/queryWebSiteSettings.ts +29 -0
- package/src/entify/lib/searchProducts.ts +70 -0
- package/src/entify/lib/sendEmail.ts +8 -0
- package/src/entify/lib/toQueryOptions.ts +20 -0
- package/src/entify/lib/upsertEntity.ts +9 -0
- package/src/entify/types/index.ts +2 -0
- package/src/entify/types/utils.ts +4 -0
- package/src/entify/types/variables.ts +7 -0
- package/src/entify/view-model/funcs.ts +271 -0
- package/src/entify/view-model/index.ts +2 -0
- package/src/entify/view-model/models.ts +143 -0
- package/{dist/index.d.ts → src/index.ts} +5 -5
- package/src/motion/consts.ts +598 -0
- package/{dist/motion/index.d.ts → src/motion/index.ts} +2 -2
- package/src/motion/types.ts +46 -0
- package/src/react/components/EnquiryForm/Input.tsx +52 -0
- package/src/react/components/EnquiryForm/Submit.tsx +30 -0
- package/src/react/components/EnquiryForm/Textarea.tsx +51 -0
- package/src/react/components/EnquiryForm/index.tsx +334 -0
- package/src/react/components/GoogleConsent/CookieItemPanel.tsx +81 -0
- package/src/react/components/GoogleConsent/CumtomizedModal.tsx +149 -0
- package/src/react/components/GoogleConsent/GoogleConsent.tsx +101 -0
- package/src/react/components/GoogleConsent/README.md +1 -0
- package/src/react/components/GoogleConsent/gtags.ts +68 -0
- package/src/react/components/GoogleConsent/index.ts +3 -0
- package/src/react/components/GoogleConsent/types.ts +18 -0
- package/src/react/components/GoogleConsent//345/217/202/350/200/203.md +4 -0
- package/src/react/components/Medias/index.tsx +347 -0
- package/src/react/components/ProductCard/ProductCard.tsx +23 -0
- package/src/react/components/ProductCard/ProductCardPreview.tsx +12 -0
- package/src/react/components/ProductCard/ProductCta/index.tsx +41 -0
- package/src/react/components/ProductCard/ProductCta/style.css +4 -0
- package/src/react/components/ProductCard/ProductDescription/index.tsx +13 -0
- package/src/react/components/ProductCard/ProductDescription/style.css +6 -0
- package/src/react/components/ProductCard/ProductMedia/index.tsx +34 -0
- package/src/react/components/ProductCard/ProductMedia/style.css +6 -0
- package/src/react/components/ProductCard/ProductTitle/index.tsx +7 -0
- package/src/react/components/ProductCard/ProductTitle/style.css +4 -0
- package/src/react/components/ProductCard/ProductView.tsx +35 -0
- package/{dist/react/components/ProductCard/index.d.ts → src/react/components/ProductCard/index.ts} +6 -6
- package/src/react/components/ProductCard/useQueryProduct.ts +32 -0
- package/src/react/components/RichTextOutline/index.tsx +76 -0
- package/src/react/components/RichTextOutline/useAcitviedHeading.ts +54 -0
- package/src/react/components/RichTextOutline/useAnchorScroll.ts +24 -0
- package/src/react/components/Scroller.tsx +7 -0
- package/src/react/components/SearchInput.tsx +34 -0
- package/src/react/components/Share/index.tsx +69 -0
- package/src/react/components/Share/socials.tsx +79 -0
- package/src/react/components/Share//350/265/204/346/226/231.md +7 -0
- package/src/react/components/ToTop/index.tsx +33 -0
- package/src/react/components/ToTop.tsx +33 -0
- package/{dist/react/components/index.d.ts → src/react/components/index.ts} +8 -8
- package/src/react/hooks/index.ts +1 -0
- package/src/react/hooks/useScroll.ts +23 -0
- package/{dist/react/index.d.ts → src/react/index.ts} +2 -2
- package/src/robots.ts +4 -0
- package/src/scripts/actions.ts +304 -0
- package/src/scripts/consts.ts +32 -0
- package/src/scripts/events.ts +33 -0
- package/{dist/scripts/index.d.ts → src/scripts/index.ts} +3 -3
- package/dist/entify/Entify.d.ts +0 -138
- package/dist/entify/lib/createEntifyClient.d.ts +0 -3
- package/dist/entify/lib/langFields.d.ts +0 -2
- package/dist/entify/lib/newAvatarQueryOptions.d.ts +0 -2
- package/dist/entify/lib/newOgImageQueryOptions.d.ts +0 -2
- package/dist/entify/lib/newPageMetaOptions.d.ts +0 -2
- package/dist/entify/lib/newQueryPostOptions.d.ts +0 -3
- package/dist/entify/lib/newQueryProductOptions.d.ts +0 -3
- package/dist/entify/lib/newQueryProductsMediaOptions.d.ts +0 -3
- package/dist/entify/lib/queryAllProducts.d.ts +0 -4
- package/dist/entify/lib/queryEntityList.d.ts +0 -3
- package/dist/entify/lib/queryFeaturedProducts.d.ts +0 -4
- package/dist/entify/lib/queryLangs.d.ts +0 -4
- package/dist/entify/lib/queryLatestPosts.d.ts +0 -4
- package/dist/entify/lib/queryOneEntity.d.ts +0 -5
- package/dist/entify/lib/queryOnePostById.d.ts +0 -3
- package/dist/entify/lib/queryOnePostBySlug.d.ts +0 -3
- package/dist/entify/lib/queryOnePostCategoryBySlug.d.ts +0 -3
- package/dist/entify/lib/queryOneProductById.d.ts +0 -3
- package/dist/entify/lib/queryOneProductBySlug.d.ts +0 -3
- package/dist/entify/lib/queryOneProductCategoryBySlug.d.ts +0 -3
- package/dist/entify/lib/queryOneTheme.d.ts +0 -3
- package/dist/entify/lib/queryOneUser.d.ts +0 -3
- package/dist/entify/lib/queryPostCategories.d.ts +0 -4
- package/dist/entify/lib/queryPostSlugs.d.ts +0 -4
- package/dist/entify/lib/queryPosts.d.ts +0 -10
- package/dist/entify/lib/queryProductCategories.d.ts +0 -4
- package/dist/entify/lib/queryProducts.d.ts +0 -6
- package/dist/entify/lib/queryProductsInMenu.d.ts +0 -2
- package/dist/entify/lib/queryUserIds.d.ts +0 -4
- package/dist/entify/lib/queryUserPosts.d.ts +0 -9
- package/dist/entify/lib/queryWebSiteSettings.d.ts +0 -3
- package/dist/entify/lib/searchProducts.d.ts +0 -4
- package/dist/entify/lib/sendEmail.d.ts +0 -3
- package/dist/entify/lib/toQueryOptions.d.ts +0 -3
- package/dist/entify/lib/upsertEntity.d.ts +0 -2
- package/dist/entify/types/index.d.ts +0 -2
- package/dist/entify/types/utils.d.ts +0 -4
- package/dist/entify/types/variables.d.ts +0 -7
- package/dist/entify/view-model/funcs.d.ts +0 -20
- package/dist/entify/view-model/index.d.ts +0 -2
- package/dist/entify/view-model/models.d.ts +0 -119
- package/dist/index.mjs +0 -40514
- package/dist/index.mjs.map +0 -1
- package/dist/motion/consts.d.ts +0 -77
- package/dist/motion/types.d.ts +0 -26
- package/dist/react/components/EnquiryForm/Input.d.ts +0 -15
- package/dist/react/components/EnquiryForm/Submit.d.ts +0 -8
- package/dist/react/components/EnquiryForm/Textarea.d.ts +0 -13
- package/dist/react/components/EnquiryForm/index.d.ts +0 -22
- package/dist/react/components/Medias/index.d.ts +0 -8
- package/dist/react/components/ProductCard/ProductCard.d.ts +0 -15
- package/dist/react/components/ProductCard/ProductCardPreview.d.ts +0 -2
- package/dist/react/components/ProductCard/ProductCta/index.d.ts +0 -5
- package/dist/react/components/ProductCard/ProductDescription/index.d.ts +0 -2
- package/dist/react/components/ProductCard/ProductMedia/index.d.ts +0 -7
- package/dist/react/components/ProductCard/ProductTitle/index.d.ts +0 -2
- package/dist/react/components/ProductCard/ProductView.d.ts +0 -5
- package/dist/react/components/ProductCard/useQueryProduct.d.ts +0 -2
- package/dist/react/components/RichTextOutline/index.d.ts +0 -8
- package/dist/react/components/RichTextOutline/useAcitviedHeading.d.ts +0 -1
- package/dist/react/components/Scroller.d.ts +0 -3
- package/dist/react/components/SearchInput.d.ts +0 -2
- package/dist/react/components/Share/index.d.ts +0 -6
- package/dist/react/components/Share/socials.d.ts +0 -10
- package/dist/react/components/ToTop.d.ts +0 -5
- package/dist/react/hooks/index.d.ts +0 -1
- package/dist/react/hooks/useScroll.d.ts +0 -2
- package/dist/robots.d.ts +0 -2
- package/dist/scripts/actions.d.ts +0 -85
- package/dist/scripts/consts.d.ts +0 -21
- package/dist/scripts/events.d.ts +0 -11
- package/dist/style.css +0 -98
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Product } from "@rxdrag/rxcms-models";
|
|
2
|
-
import { ListConditions } from "./queryPosts";
|
|
3
|
-
import { ListResult } from "@rxdrag/entify-hooks";
|
|
4
|
-
import { EnvVariables, TSize } from "../types";
|
|
5
|
-
import { TProduct } from "../view-model";
|
|
6
|
-
export declare function queryProducts(conditions: ListConditions, imageSize: TSize | undefined, envVariables: EnvVariables, selectFields?: (keyof Product)[]): Promise<ListResult<TProduct> | undefined>;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { EnvVariables } from "../types";
|
|
2
|
-
export declare function queryProductsInMenu(envVariables: EnvVariables): Promise<import("@rxdrag/entify-hooks").ListResult<import("@rxdrag/rxcms-models").Product> | import("@rxdrag/entify-hooks").ListResult<import("..").TProduct> | import("@rxdrag/entify-hooks").ListResult<import("..").TPost> | import("@rxdrag/entify-hooks").ListResult<import("..").TProductCategory> | import("@rxdrag/entify-hooks").ListResult<import("..").TPostCategory> | import("@rxdrag/entify-hooks").ListResult<import("..").TUser> | import("@rxdrag/entify-hooks").ListResult<import("..").TMedia> | undefined>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ListResult } from "@rxdrag/entify-hooks";
|
|
2
|
-
import { EnvVariables } from "../types";
|
|
3
|
-
import { TPost } from "../view-model";
|
|
4
|
-
export type UserPostsCondition = {
|
|
5
|
-
userId: string;
|
|
6
|
-
page?: number;
|
|
7
|
-
pageSize?: number;
|
|
8
|
-
};
|
|
9
|
-
export declare function queryUserPosts(pagination: UserPostsCondition, envVariables: EnvVariables): Promise<ListResult<TPost> | undefined>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AttachmentOnProduct, Media, Post, PostCategory, Product, ProductCategory, ProductRelatedPivot, User, WebsiteSettings } from "@rxdrag/rxcms-models";
|
|
2
|
-
import { TMedia, TMedias, TPost, TPostCategory, TProduct, TProductCategory, TUser, TWebsiteSettings } from "./models";
|
|
3
|
-
import { ListResult } from "@rxdrag/entify-hooks";
|
|
4
|
-
export declare function mediaToViewModel(media?: Media): TMedia | undefined;
|
|
5
|
-
export declare function mediasToViewModel(product?: Product): TMedias | undefined;
|
|
6
|
-
export declare function attachmentsToViewModel(attachments?: AttachmentOnProduct[]): TMedia[] | undefined;
|
|
7
|
-
export declare function websiteSettingsToViewModel(websiteSettings?: WebsiteSettings): TWebsiteSettings | undefined;
|
|
8
|
-
export declare function productCategoryToViewModel(productCategory?: ProductCategory): TProductCategory | undefined;
|
|
9
|
-
export declare function productToViewModel(product?: Product): TProduct | undefined;
|
|
10
|
-
export declare function relatedPovitToViewModel(related?: ProductRelatedPivot[]): TProduct[] | undefined;
|
|
11
|
-
export declare function productListToViewModel(products?: ListResult<Product>): ListResult<TProduct> | undefined;
|
|
12
|
-
export declare function productCategoriesToViewModel(productCategories?: ListResult<ProductCategory>): ListResult<TProductCategory> | undefined;
|
|
13
|
-
export declare function postCategoryToViewModel(postCategory?: PostCategory): TPostCategory | undefined;
|
|
14
|
-
export declare function postCategoriesToViewModel(postCategories?: ListResult<PostCategory>): ListResult<TPostCategory> | undefined;
|
|
15
|
-
export declare function postToViewModel(post?: Post): TPost | undefined;
|
|
16
|
-
export declare function postListToViewModel(posts?: ListResult<Post>): ListResult<TPost> | undefined;
|
|
17
|
-
export declare function postCategoryListToViewModel(postCategories?: ListResult<PostCategory>): ListResult<TPostCategory> | undefined;
|
|
18
|
-
export declare function userToViewModel(user?: User): TUser | undefined;
|
|
19
|
-
export declare function userListToViewModel(users?: ListResult<User>): ListResult<TUser> | undefined;
|
|
20
|
-
export declare function mediaListToViewModel(medias?: ListResult<Media>): ListResult<TMedia> | undefined;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { MediaType, PageMeta } from "@rxdrag/rxcms-models";
|
|
2
|
-
/**
|
|
3
|
-
* 定义数据绑定用的类型,需要从@rxdrag/rxcms-models的类型进行转换
|
|
4
|
-
*/
|
|
5
|
-
export type TMedia = {
|
|
6
|
-
id?: string | null;
|
|
7
|
-
name?: string;
|
|
8
|
-
mimeType?: string;
|
|
9
|
-
extName?: string;
|
|
10
|
-
thumbnail?: string;
|
|
11
|
-
resize?: string;
|
|
12
|
-
url?: string;
|
|
13
|
-
alt?: string;
|
|
14
|
-
createdAt?: Date;
|
|
15
|
-
updatedAt?: Date;
|
|
16
|
-
mediaType?: MediaType;
|
|
17
|
-
};
|
|
18
|
-
export type TMedias = {
|
|
19
|
-
externalVideoUrl?: string;
|
|
20
|
-
medias?: TMedia[];
|
|
21
|
-
};
|
|
22
|
-
export type TProductCategory = {
|
|
23
|
-
id?: string | null;
|
|
24
|
-
slug?: string;
|
|
25
|
-
name?: string;
|
|
26
|
-
children?: TProductCategory[];
|
|
27
|
-
media?: TMedia;
|
|
28
|
-
parent?: TProductCategory;
|
|
29
|
-
products?: TProduct[];
|
|
30
|
-
};
|
|
31
|
-
export type TProduct = {
|
|
32
|
-
id?: string | null;
|
|
33
|
-
slug?: string;
|
|
34
|
-
title?: string;
|
|
35
|
-
shortTitle?: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
features?: string;
|
|
38
|
-
medias?: TMedias;
|
|
39
|
-
cover?: TMedia;
|
|
40
|
-
content?: string;
|
|
41
|
-
content2?: string;
|
|
42
|
-
content3?: string;
|
|
43
|
-
extends?: object;
|
|
44
|
-
publishedAt?: Date;
|
|
45
|
-
createdAt?: Date;
|
|
46
|
-
updatedAt?: Date;
|
|
47
|
-
category?: TProductCategory;
|
|
48
|
-
related?: TProduct[];
|
|
49
|
-
attachments?: TMedia[];
|
|
50
|
-
meta?: PageMeta;
|
|
51
|
-
};
|
|
52
|
-
export type TPostCategory = {
|
|
53
|
-
id?: string | null;
|
|
54
|
-
slug?: string;
|
|
55
|
-
name?: string;
|
|
56
|
-
children?: TProductCategory[];
|
|
57
|
-
media?: TMedia;
|
|
58
|
-
parent?: TProductCategory;
|
|
59
|
-
posts?: TPost[];
|
|
60
|
-
};
|
|
61
|
-
export type TUser = {
|
|
62
|
-
id?: string | null;
|
|
63
|
-
name?: string;
|
|
64
|
-
avatar?: TMedia;
|
|
65
|
-
position?: string;
|
|
66
|
-
profile?: string;
|
|
67
|
-
email?: string;
|
|
68
|
-
tel?: string;
|
|
69
|
-
mobile?: string;
|
|
70
|
-
linkedin?: string;
|
|
71
|
-
facebook?: string;
|
|
72
|
-
twitter?: string;
|
|
73
|
-
instagram?: string;
|
|
74
|
-
};
|
|
75
|
-
export type TPost = {
|
|
76
|
-
id?: string | null;
|
|
77
|
-
slug?: string;
|
|
78
|
-
title?: string;
|
|
79
|
-
description?: string;
|
|
80
|
-
cover?: TMedia;
|
|
81
|
-
content?: string;
|
|
82
|
-
extends?: object;
|
|
83
|
-
publishedAt?: Date;
|
|
84
|
-
createdAt?: Date;
|
|
85
|
-
updatedAt?: Date;
|
|
86
|
-
category?: TPostCategory;
|
|
87
|
-
author?: TUser;
|
|
88
|
-
meta?: PageMeta;
|
|
89
|
-
};
|
|
90
|
-
export type TWebsiteSettings = {
|
|
91
|
-
id?: string | null;
|
|
92
|
-
contact?: string;
|
|
93
|
-
contactAvatar?: TMedia;
|
|
94
|
-
address?: string;
|
|
95
|
-
email?: string;
|
|
96
|
-
tel?: string;
|
|
97
|
-
mobile?: string;
|
|
98
|
-
linkedin?: string;
|
|
99
|
-
facebook?: string;
|
|
100
|
-
twitter?: string;
|
|
101
|
-
instagram?: string;
|
|
102
|
-
footerCode?: string;
|
|
103
|
-
websiteName?: string;
|
|
104
|
-
map301?: string;
|
|
105
|
-
};
|
|
106
|
-
export type TBreadcrumbItem = {
|
|
107
|
-
title: string;
|
|
108
|
-
href?: string;
|
|
109
|
-
};
|
|
110
|
-
export type TPage = {
|
|
111
|
-
title?: string;
|
|
112
|
-
breadcrumbs?: TBreadcrumbItem[];
|
|
113
|
-
};
|
|
114
|
-
export type TPagination = {
|
|
115
|
-
urlPrefix?: string;
|
|
116
|
-
current?: number;
|
|
117
|
-
total?: number;
|
|
118
|
-
};
|
|
119
|
-
export declare const entityMaps: Record<string, string>;
|