@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.
Files changed (168) hide show
  1. package/index.ts +1 -0
  2. package/package.json +12 -13
  3. package/src/entify/Entify.ts +365 -0
  4. package/{dist/entify/index.d.ts → src/entify/index.ts} +4 -4
  5. package/src/entify/lib/createEntifyClient.ts +23 -0
  6. package/{dist/entify/lib/index.d.ts → src/entify/lib/index.ts} +29 -29
  7. package/src/entify/lib/langFields.ts +12 -0
  8. package/src/entify/lib/newAvatarQueryOptions.ts +5 -0
  9. package/src/entify/lib/newOgImageQueryOptions.ts +6 -0
  10. package/src/entify/lib/newPageMetaOptions.ts +20 -0
  11. package/src/entify/lib/newQueryPostOptions.ts +41 -0
  12. package/src/entify/lib/newQueryProductOptions.ts +90 -0
  13. package/src/entify/lib/newQueryProductsMediaOptions.ts +26 -0
  14. package/src/entify/lib/queryAllProducts.ts +27 -0
  15. package/src/entify/lib/queryEntityList.ts +44 -0
  16. package/src/entify/lib/queryFeaturedProducts.ts +47 -0
  17. package/src/entify/lib/queryLangs.ts +47 -0
  18. package/src/entify/lib/queryLatestPosts.ts +65 -0
  19. package/src/entify/lib/queryOneEntity.ts +67 -0
  20. package/src/entify/lib/queryOnePostById.ts +21 -0
  21. package/src/entify/lib/queryOnePostBySlug.ts +21 -0
  22. package/src/entify/lib/queryOnePostCategoryBySlug.ts +30 -0
  23. package/src/entify/lib/queryOneProductById.ts +20 -0
  24. package/src/entify/lib/queryOneProductBySlug.ts +21 -0
  25. package/src/entify/lib/queryOneProductCategoryBySlug.ts +30 -0
  26. package/src/entify/lib/queryOneTheme.ts +76 -0
  27. package/src/entify/lib/queryOneUser.ts +38 -0
  28. package/src/entify/lib/queryPostCategories.ts +48 -0
  29. package/src/entify/lib/queryPostSlugs.ts +32 -0
  30. package/src/entify/lib/queryPosts.ts +92 -0
  31. package/src/entify/lib/queryProductCategories.ts +44 -0
  32. package/src/entify/lib/queryProducts.ts +69 -0
  33. package/src/entify/lib/queryProductsInMenu.ts +31 -0
  34. package/src/entify/lib/queryUserIds.ts +24 -0
  35. package/src/entify/lib/queryUserPosts.ts +74 -0
  36. package/src/entify/lib/queryWebSiteSettings.ts +29 -0
  37. package/src/entify/lib/searchProducts.ts +70 -0
  38. package/src/entify/lib/sendEmail.ts +8 -0
  39. package/src/entify/lib/toQueryOptions.ts +20 -0
  40. package/src/entify/lib/upsertEntity.ts +9 -0
  41. package/src/entify/types/index.ts +2 -0
  42. package/src/entify/types/utils.ts +4 -0
  43. package/src/entify/types/variables.ts +7 -0
  44. package/src/entify/view-model/funcs.ts +271 -0
  45. package/src/entify/view-model/index.ts +2 -0
  46. package/src/entify/view-model/models.ts +143 -0
  47. package/{dist/index.d.ts → src/index.ts} +5 -5
  48. package/src/motion/consts.ts +598 -0
  49. package/{dist/motion/index.d.ts → src/motion/index.ts} +2 -2
  50. package/src/motion/types.ts +46 -0
  51. package/src/react/components/EnquiryForm/Input.tsx +52 -0
  52. package/src/react/components/EnquiryForm/Submit.tsx +30 -0
  53. package/src/react/components/EnquiryForm/Textarea.tsx +51 -0
  54. package/src/react/components/EnquiryForm/index.tsx +334 -0
  55. package/src/react/components/GoogleConsent/CookieItemPanel.tsx +81 -0
  56. package/src/react/components/GoogleConsent/CumtomizedModal.tsx +149 -0
  57. package/src/react/components/GoogleConsent/GoogleConsent.tsx +101 -0
  58. package/src/react/components/GoogleConsent/README.md +1 -0
  59. package/src/react/components/GoogleConsent/gtags.ts +68 -0
  60. package/src/react/components/GoogleConsent/index.ts +3 -0
  61. package/src/react/components/GoogleConsent/types.ts +18 -0
  62. package/src/react/components/GoogleConsent//345/217/202/350/200/203.md +4 -0
  63. package/src/react/components/Medias/index.tsx +347 -0
  64. package/src/react/components/ProductCard/ProductCard.tsx +23 -0
  65. package/src/react/components/ProductCard/ProductCardPreview.tsx +12 -0
  66. package/src/react/components/ProductCard/ProductCta/index.tsx +41 -0
  67. package/src/react/components/ProductCard/ProductCta/style.css +4 -0
  68. package/src/react/components/ProductCard/ProductDescription/index.tsx +13 -0
  69. package/src/react/components/ProductCard/ProductDescription/style.css +6 -0
  70. package/src/react/components/ProductCard/ProductMedia/index.tsx +34 -0
  71. package/src/react/components/ProductCard/ProductMedia/style.css +6 -0
  72. package/src/react/components/ProductCard/ProductTitle/index.tsx +7 -0
  73. package/src/react/components/ProductCard/ProductTitle/style.css +4 -0
  74. package/src/react/components/ProductCard/ProductView.tsx +35 -0
  75. package/{dist/react/components/ProductCard/index.d.ts → src/react/components/ProductCard/index.ts} +6 -6
  76. package/src/react/components/ProductCard/useQueryProduct.ts +32 -0
  77. package/src/react/components/RichTextOutline/index.tsx +76 -0
  78. package/src/react/components/RichTextOutline/useAcitviedHeading.ts +54 -0
  79. package/src/react/components/RichTextOutline/useAnchorScroll.ts +24 -0
  80. package/src/react/components/Scroller.tsx +7 -0
  81. package/src/react/components/SearchInput.tsx +34 -0
  82. package/src/react/components/Share/index.tsx +69 -0
  83. package/src/react/components/Share/socials.tsx +79 -0
  84. package/src/react/components/Share//350/265/204/346/226/231.md +7 -0
  85. package/src/react/components/ToTop/index.tsx +33 -0
  86. package/src/react/components/ToTop.tsx +33 -0
  87. package/{dist/react/components/index.d.ts → src/react/components/index.ts} +8 -8
  88. package/src/react/hooks/index.ts +1 -0
  89. package/src/react/hooks/useScroll.ts +23 -0
  90. package/{dist/react/index.d.ts → src/react/index.ts} +2 -2
  91. package/src/robots.ts +4 -0
  92. package/src/scripts/actions.ts +304 -0
  93. package/src/scripts/consts.ts +32 -0
  94. package/src/scripts/events.ts +33 -0
  95. package/{dist/scripts/index.d.ts → src/scripts/index.ts} +3 -3
  96. package/dist/entify/Entify.d.ts +0 -138
  97. package/dist/entify/lib/createEntifyClient.d.ts +0 -3
  98. package/dist/entify/lib/langFields.d.ts +0 -2
  99. package/dist/entify/lib/newAvatarQueryOptions.d.ts +0 -2
  100. package/dist/entify/lib/newOgImageQueryOptions.d.ts +0 -2
  101. package/dist/entify/lib/newPageMetaOptions.d.ts +0 -2
  102. package/dist/entify/lib/newQueryPostOptions.d.ts +0 -3
  103. package/dist/entify/lib/newQueryProductOptions.d.ts +0 -3
  104. package/dist/entify/lib/newQueryProductsMediaOptions.d.ts +0 -3
  105. package/dist/entify/lib/queryAllProducts.d.ts +0 -4
  106. package/dist/entify/lib/queryEntityList.d.ts +0 -3
  107. package/dist/entify/lib/queryFeaturedProducts.d.ts +0 -4
  108. package/dist/entify/lib/queryLangs.d.ts +0 -4
  109. package/dist/entify/lib/queryLatestPosts.d.ts +0 -4
  110. package/dist/entify/lib/queryOneEntity.d.ts +0 -5
  111. package/dist/entify/lib/queryOnePostById.d.ts +0 -3
  112. package/dist/entify/lib/queryOnePostBySlug.d.ts +0 -3
  113. package/dist/entify/lib/queryOnePostCategoryBySlug.d.ts +0 -3
  114. package/dist/entify/lib/queryOneProductById.d.ts +0 -3
  115. package/dist/entify/lib/queryOneProductBySlug.d.ts +0 -3
  116. package/dist/entify/lib/queryOneProductCategoryBySlug.d.ts +0 -3
  117. package/dist/entify/lib/queryOneTheme.d.ts +0 -3
  118. package/dist/entify/lib/queryOneUser.d.ts +0 -3
  119. package/dist/entify/lib/queryPostCategories.d.ts +0 -4
  120. package/dist/entify/lib/queryPostSlugs.d.ts +0 -4
  121. package/dist/entify/lib/queryPosts.d.ts +0 -10
  122. package/dist/entify/lib/queryProductCategories.d.ts +0 -4
  123. package/dist/entify/lib/queryProducts.d.ts +0 -6
  124. package/dist/entify/lib/queryProductsInMenu.d.ts +0 -2
  125. package/dist/entify/lib/queryUserIds.d.ts +0 -4
  126. package/dist/entify/lib/queryUserPosts.d.ts +0 -9
  127. package/dist/entify/lib/queryWebSiteSettings.d.ts +0 -3
  128. package/dist/entify/lib/searchProducts.d.ts +0 -4
  129. package/dist/entify/lib/sendEmail.d.ts +0 -3
  130. package/dist/entify/lib/toQueryOptions.d.ts +0 -3
  131. package/dist/entify/lib/upsertEntity.d.ts +0 -2
  132. package/dist/entify/types/index.d.ts +0 -2
  133. package/dist/entify/types/utils.d.ts +0 -4
  134. package/dist/entify/types/variables.d.ts +0 -7
  135. package/dist/entify/view-model/funcs.d.ts +0 -20
  136. package/dist/entify/view-model/index.d.ts +0 -2
  137. package/dist/entify/view-model/models.d.ts +0 -119
  138. package/dist/index.mjs +0 -40514
  139. package/dist/index.mjs.map +0 -1
  140. package/dist/motion/consts.d.ts +0 -77
  141. package/dist/motion/types.d.ts +0 -26
  142. package/dist/react/components/EnquiryForm/Input.d.ts +0 -15
  143. package/dist/react/components/EnquiryForm/Submit.d.ts +0 -8
  144. package/dist/react/components/EnquiryForm/Textarea.d.ts +0 -13
  145. package/dist/react/components/EnquiryForm/index.d.ts +0 -22
  146. package/dist/react/components/Medias/index.d.ts +0 -8
  147. package/dist/react/components/ProductCard/ProductCard.d.ts +0 -15
  148. package/dist/react/components/ProductCard/ProductCardPreview.d.ts +0 -2
  149. package/dist/react/components/ProductCard/ProductCta/index.d.ts +0 -5
  150. package/dist/react/components/ProductCard/ProductDescription/index.d.ts +0 -2
  151. package/dist/react/components/ProductCard/ProductMedia/index.d.ts +0 -7
  152. package/dist/react/components/ProductCard/ProductTitle/index.d.ts +0 -2
  153. package/dist/react/components/ProductCard/ProductView.d.ts +0 -5
  154. package/dist/react/components/ProductCard/useQueryProduct.d.ts +0 -2
  155. package/dist/react/components/RichTextOutline/index.d.ts +0 -8
  156. package/dist/react/components/RichTextOutline/useAcitviedHeading.d.ts +0 -1
  157. package/dist/react/components/Scroller.d.ts +0 -3
  158. package/dist/react/components/SearchInput.d.ts +0 -2
  159. package/dist/react/components/Share/index.d.ts +0 -6
  160. package/dist/react/components/Share/socials.d.ts +0 -10
  161. package/dist/react/components/ToTop.d.ts +0 -5
  162. package/dist/react/hooks/index.d.ts +0 -1
  163. package/dist/react/hooks/useScroll.d.ts +0 -2
  164. package/dist/robots.d.ts +0 -2
  165. package/dist/scripts/actions.d.ts +0 -85
  166. package/dist/scripts/consts.d.ts +0 -21
  167. package/dist/scripts/events.d.ts +0 -11
  168. 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,4 +0,0 @@
1
- import { ListResult } from "@rxdrag/entify-hooks";
2
- import { EnvVariables } from "../types";
3
- import { TUser } from "../view-model";
4
- export declare function queryUserIds(envVariables: EnvVariables): Promise<ListResult<TUser> | 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,3 +0,0 @@
1
- import { WebsiteSettings } from "@rxdrag/rxcms-models";
2
- import { EnvVariables } from "../types";
3
- export declare function queryWebSiteSettings(envVariables: EnvVariables): Promise<WebsiteSettings | undefined>;
@@ -1,4 +0,0 @@
1
- import { ListResult } from "@rxdrag/entify-hooks";
2
- import { EnvVariables } from "../types";
3
- import { TProduct } from "../view-model";
4
- export declare function searchProducts(keyword: string, envVariables: EnvVariables): Promise<ListResult<TProduct> | undefined>;
@@ -1,3 +0,0 @@
1
- import { IEmail } from "@rxdrag/entify-hooks";
2
- import { EnvVariables } from "../types";
3
- export declare function sendEmail(email: IEmail, envVariables: EnvVariables): Promise<unknown>;
@@ -1,3 +0,0 @@
1
- import { IEntity, IQueryOptions } from "@rxdrag/entify-hooks";
2
- import { ICustomizedDataSource } from "../types";
3
- export declare function toQueryOptions(dataSource: ICustomizedDataSource): IQueryOptions<IEntity>;
@@ -1,2 +0,0 @@
1
- import { EnvVariables } from "../types";
2
- export declare function upsertEntity<Input = object>(entityName: string, object: Input, envVariables: EnvVariables): Promise<unknown>;
@@ -1,2 +0,0 @@
1
- export * from "./utils";
2
- export * from "./variables";
@@ -1,4 +0,0 @@
1
- export type TSize = {
2
- width: number;
3
- height: number;
4
- };
@@ -1,7 +0,0 @@
1
- export type EnvVariables = {
2
- websiteId?: string;
3
- entifyServerUrl?: string;
4
- entifyGuestToken?: string;
5
- language?: string;
6
- formSalt: string;
7
- };
@@ -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,2 +0,0 @@
1
- export * from "./funcs";
2
- export * from "./models";
@@ -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>;