@rxdrag/website-studio 0.0.15 → 0.0.17
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/dist/assets/{tailwind.worker-c33e84b9.js → tailwind.worker-97c39410.js} +2 -2
- package/dist/assets/tailwind.worker-97c39410.js.map +1 -0
- package/dist/astro-component/designer/index.d.ts +6 -4
- package/dist/astro-component/hooks/useExecuteClientScript.d.ts +3 -0
- package/dist/astro-component/preview/AstroComponentPreview.d.ts +3 -1
- package/dist/astro-component/preview/PreviewComponentView.d.ts +11 -0
- package/dist/astro-component/preview/useCalcVariables.d.ts +2 -0
- package/dist/components/CanvasPanel/ResizableWrapper.d.ts +1 -1
- package/dist/components/DocCanvas/ComponentTreeWidget/ComDesignerView.d.ts +5 -0
- package/dist/components/DocCanvas/ComponentTreeWidget/ComponentTreeWidget.d.ts +6 -0
- package/dist/components/DocCanvas/ComponentTreeWidget/classListToClassName.d.ts +6 -0
- package/dist/components/DocCanvas/ComponentTreeWidget/index.d.ts +3 -0
- package/dist/components/DocPreview/DocumentPreview.d.ts +4 -0
- package/dist/components/DocPreview/mock/MockEntify.d.ts +35 -0
- package/dist/components/DocPreview/mock/MockRxPage.d.ts +41 -0
- package/dist/components/DocPreview/mock/categories.d.ts +5 -0
- package/dist/components/DocPreview/mock/index.d.ts +1 -0
- package/dist/components/DocPreview/mock/langs.d.ts +2 -0
- package/dist/components/DocPreview/mock/posts.d.ts +2 -0
- package/dist/components/DocPreview/mock/products.d.ts +2 -0
- package/dist/components/DocPreview/mock/theme.d.ts +3 -0
- package/dist/components/DocPreview/mock/user.d.ts +2 -0
- package/dist/components/StatusBar/index.d.ts +4 -1
- package/dist/components/views/CodeViewport.d.ts +1 -1
- package/dist/components/views/PreviewViewport.d.ts +1 -1
- package/dist/generator/hooks/baseFiles.d.ts +109 -0
- package/dist/generator/hooks/bases/astro.config.mjs.d.ts +1 -0
- package/dist/generator/hooks/bases/createEnv.d.ts +2 -0
- package/dist/generator/hooks/bases/favicon.svg.d.ts +1 -0
- package/dist/generator/hooks/bases/package.json.d.ts +1 -0
- package/dist/generator/hooks/bases/src/base.css.d.ts +2 -0
- package/dist/generator/hooks/bases/src/layouts/Layout.astro.d.ts +1 -0
- package/dist/generator/hooks/bases/src/lib/lib.index.d.ts +1 -0
- package/dist/generator/hooks/bases/src/pages/api/ask-for-quote.ts.d.ts +1 -0
- package/dist/generator/hooks/bases/tailwind.config.mjs.d.ts +1 -0
- package/dist/generator/hooks/bases/tsconfig.json.d.ts +1 -0
- package/dist/generator/hooks/index.d.ts +3 -0
- package/dist/generator/hooks/useGetComponentFiles.d.ts +5 -0
- package/dist/generator/hooks/useGetFiles.d.ts +109 -0
- package/dist/generator/hooks/useGetFrontComponents.d.ts +2 -0
- package/dist/generator/hooks/useGetPageFiles.d.ts +13 -0
- package/dist/generator/hooks/useGetPages.d.ts +2 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useImportVariables.d.ts +28 -0
- package/dist/hooks/usePreviews.d.ts +5 -0
- package/dist/hooks/useVfs.d.ts +2 -0
- package/dist/index-e69a2bfd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +13553 -14020
- package/dist/index.mjs.map +1 -1
- package/dist/recoil/atoms.d.ts +2 -2
- package/dist/recoil/selectors.d.ts +1 -1
- package/dist/style.css +6 -1
- package/package.json +22 -21
- package/dist/assets/tailwind.worker-c33e84b9.js.map +0 -1
- package/dist/components/views/OutputPanel.d.ts +0 -1
- package/dist/consts.d.ts +0 -11
- package/dist/generator/classes/ComponentCoder.d.ts +0 -12
- package/dist/generator/classes/ComponentsStore.d.ts +0 -11
- package/dist/generator/classes/Page404Coder.d.ts +0 -10
- package/dist/generator/classes/PageErrorCoder.d.ts +0 -10
- package/dist/generator/classes/WebsiteGenerator.d.ts +0 -16
- package/dist/generator/classes/consts.d.ts +0 -1
- package/dist/generator/templates/IFileTemplate.d.ts +0 -4
- package/dist/generator/templates/app/api.product.$id.d.ts +0 -2
- package/dist/generator/templates/app/ask-for-quote.d.ts +0 -2
- package/dist/generator/templates/app/deploy/env.d.ts +0 -2
- package/dist/generator/templates/app/deploy/get-env.d.ts +0 -2
- package/dist/generator/templates/app/deploy/remix-run-node.d.ts +0 -2
- package/dist/generator/templates/app/page404.d.ts +0 -2
- package/dist/generator/templates/app/pageError.d.ts +0 -2
- package/dist/generator/templates/app/slug.d.ts +0 -2
- package/dist/generator/templates/app/tailwind.d.ts +0 -2
- package/dist/generator/templates/app/types.d.ts +0 -2
- package/dist/generator/templates/env.d.ts +0 -2
- package/dist/generator/templates/eslintrc.d.ts +0 -2
- package/dist/generator/templates/gitignore.d.ts +0 -2
- package/dist/generator/templates/package.d.ts +0 -2
- package/dist/generator/templates/postcss.d.ts +0 -2
- package/dist/generator/templates/readme.d.ts +0 -2
- package/dist/generator/templates/remix.config.d.ts +0 -2
- package/dist/generator/templates/remix.env.d.ts +0 -2
- package/dist/generator/templates/tailwind.config.d.ts +0 -2
- package/dist/generator/templates/tsconfig.d.ts +0 -2
- package/dist/generator/templates/vars.d.ts +0 -17
- package/dist/generator/templates/vite.config.d.ts +0 -2
- package/dist/runtime/index.d.ts +0 -2
- package/dist/runtime/recoil.d.ts +0 -9
- package/dist/runtime/webcontainer/WebcontainerProvider.d.ts +0 -11
- package/dist/runtime/webcontainer/baseFiles.d.ts +0 -50
- package/dist/runtime/webcontainer/contexts.d.ts +0 -4
- package/dist/runtime/webcontainer/hooks/index.d.ts +0 -1
- package/dist/runtime/webcontainer/hooks/useWriteFile.d.ts +0 -3
- package/dist/runtime/webcontainer/index.d.ts +0 -2
- package/dist/runtime/webcontainer/useComponentFiles.d.ts +0 -5
- package/dist/runtime/webcontainer/useFiles.d.ts +0 -50
- package/dist/runtime/webcontainer/usePageFiles.d.ts +0 -5
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { RXID_ATTR_NAME } from "@rxdrag/core-pro";
|
|
2
3
|
export declare const AstroComponentDesigner: (props: {
|
|
3
|
-
[
|
|
4
|
-
className?: string;
|
|
5
|
-
style?:
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
className?: string | undefined;
|
|
6
|
+
style?: import("react").CSSProperties | undefined;
|
|
6
7
|
children?: React.ReactNode;
|
|
7
|
-
|
|
8
|
+
"rx-id"?: string | undefined;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { RXID_ATTR_NAME } from "@rxdrag/core-pro";
|
|
2
3
|
export type AstroComponentPreviewProps = {
|
|
3
4
|
name: string;
|
|
4
5
|
className?: string;
|
|
5
6
|
style?: React.CSSProperties;
|
|
6
7
|
children?: React.ReactNode;
|
|
8
|
+
[RXID_ATTR_NAME]?: string;
|
|
7
9
|
};
|
|
8
10
|
export declare const AstroComponentPreview: (props: AstroComponentPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare const createComponentPreview: (name: string) => (props: Omit<AstroComponentPreviewProps, "
|
|
11
|
+
export declare const createComponentPreview: (name: string) => (props: Omit<AstroComponentPreviewProps, "name">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { INodeSchema } from "@rxdrag/schema-pro";
|
|
2
3
|
import { RXID_ATTR_NAME } from "@rxdrag/core-pro";
|
|
4
|
+
/**
|
|
5
|
+
* 将HTML格式的属性名转换为JSX格式的属性名
|
|
6
|
+
* 例如: stroke-width -> strokeWidth
|
|
7
|
+
* 但保留特殊属性如 aria-label, data-* 等
|
|
8
|
+
*/
|
|
9
|
+
export declare function convertHtmlAttrToJsxAttr(props: Record<string, unknown>): Record<string, unknown>;
|
|
3
10
|
export type ComponentPreviewProps = {
|
|
4
11
|
node: INodeSchema;
|
|
5
12
|
[RXID_ATTR_NAME]?: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
slotContents?: Record<string, React.ReactNode>;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
6
17
|
};
|
|
7
18
|
export declare function PreviewComponentView(props: ComponentPreviewProps): any;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function executeClassList(expr?: string | null, variables?: Record<string, unknown>): any;
|
|
3
|
+
export declare const ComDesignerView: React.MemoExoticComponent<(props: {
|
|
4
|
+
nodeId: string;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IDocument } from "@rxdrag/core-pro";
|
|
3
|
+
export type ComponentTreeWidgetProps = {
|
|
4
|
+
doc: IDocument;
|
|
5
|
+
};
|
|
6
|
+
export declare const ComponentTreeWidget: import("react").MemoExoticComponent<(props: ComponentTreeWidgetProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IEntify, ListConditions, PostPatinateOptions, PostsOptions, TPost, TPostCategory, TProduct, TProductCategory, TSize, TUser } from "@rxdrag/website-lib-core";
|
|
2
|
+
import { IQueryOptions, ListResult } from "@rxdrag/entify-hooks";
|
|
3
|
+
import { Lang, Theme } from "@rxdrag/rxcms-models";
|
|
4
|
+
export declare class MockEntify implements IEntify {
|
|
5
|
+
queryEntityList<T, WhereExp = unknown, OrderBy = unknown, DistinctExp = unknown>(options: IQueryOptions<T, WhereExp, OrderBy, DistinctExp>, staticKey?: string): Promise<ListResult<unknown> | undefined>;
|
|
6
|
+
getTheme(): Promise<Theme | undefined>;
|
|
7
|
+
getLangs(): Promise<Lang[] | undefined>;
|
|
8
|
+
getFeaturedProducts(count?: number): Promise<TProduct[] | undefined>;
|
|
9
|
+
getLatestPosts(count?: number): Promise<TPost[] | undefined>;
|
|
10
|
+
getPosts(options: PostsOptions): Promise<TPost[] | undefined>;
|
|
11
|
+
getPostListPaths(options: PostPatinateOptions): Promise<unknown>;
|
|
12
|
+
getPostPaths(): Promise<unknown>;
|
|
13
|
+
getPostBySlug(slug: string, coverSize: TSize | undefined): Promise<unknown>;
|
|
14
|
+
getPostSlugs(): Promise<Array<string | undefined>>;
|
|
15
|
+
getPostCategories(): Promise<TPostCategory[] | undefined>;
|
|
16
|
+
getPostCategoryBySlug(slug: string): Promise<TPostCategory | undefined>;
|
|
17
|
+
getProducts(conditions: ListConditions, imageSize: TSize | undefined): Promise<TProduct[] | undefined>;
|
|
18
|
+
getProductListPaths(options: {
|
|
19
|
+
category?: string;
|
|
20
|
+
pageSize: number;
|
|
21
|
+
}): Promise<unknown>;
|
|
22
|
+
getCategoredProductListPaths(): Promise<unknown>;
|
|
23
|
+
getCategoredPostListPaths(): Promise<unknown>;
|
|
24
|
+
getProductBySlug(slug: string, imageSize: TSize | undefined): Promise<TProduct | undefined>;
|
|
25
|
+
getProductPaths(): Promise<unknown>;
|
|
26
|
+
getProductSlugs(): Promise<Array<string | undefined>>;
|
|
27
|
+
getProductIds(): Promise<Array<string | null | undefined>>;
|
|
28
|
+
getProductCategories(): Promise<TProductCategory[] | undefined>;
|
|
29
|
+
getProductCategoryBySlug(slug: string): Promise<TProductCategory | undefined>;
|
|
30
|
+
getOneUser(id: string): Promise<TUser | undefined>;
|
|
31
|
+
getUserPosts(userId: string): Promise<TPost[] | undefined>;
|
|
32
|
+
searchProducts(keyword: string): Promise<ListResult<TProduct> | undefined>;
|
|
33
|
+
getUserPaths(): Promise<unknown>;
|
|
34
|
+
createPagination(totalItems: number, pageSize: number): unknown;
|
|
35
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TBreadcrumbItem, TPost, TPostCategory, TProduct, TProductCategory } from "@rxdrag/website-lib-core";
|
|
2
|
+
export declare function postsPagination(options: {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
}): {
|
|
7
|
+
pages: (number | "...")[];
|
|
8
|
+
hasPreviousPage: boolean;
|
|
9
|
+
hasNextPage: boolean;
|
|
10
|
+
previousPageUrl: string;
|
|
11
|
+
nextPageUrl: string;
|
|
12
|
+
pageUrls: Record<number, string>;
|
|
13
|
+
currentPage: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function productsPagination(options: {
|
|
16
|
+
currentPage: number;
|
|
17
|
+
totalPages: number;
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
}): {
|
|
20
|
+
pages: (number | "...")[];
|
|
21
|
+
hasPreviousPage: boolean;
|
|
22
|
+
hasNextPage: boolean;
|
|
23
|
+
previousPageUrl: string;
|
|
24
|
+
nextPageUrl: string;
|
|
25
|
+
pageUrls: Record<number, string>;
|
|
26
|
+
currentPage: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function productBreadcrumbs(product?: TProduct): TBreadcrumbItem[];
|
|
29
|
+
export declare function productListBreadcrumbs(category?: TProductCategory | null): TBreadcrumbItem[];
|
|
30
|
+
export declare function postBreadcrumbs(post?: TPost): TBreadcrumbItem[];
|
|
31
|
+
export declare function postListBreadcrumbs(category?: TPostCategory): TBreadcrumbItem[];
|
|
32
|
+
export declare function pageBreadcrumbs(title: string): TBreadcrumbItem[];
|
|
33
|
+
export declare const mockRxPage: {
|
|
34
|
+
postsPagination: typeof postsPagination;
|
|
35
|
+
productsPagination: typeof productsPagination;
|
|
36
|
+
postBreadcrumbs: typeof postBreadcrumbs;
|
|
37
|
+
postListBreadcrumbs: typeof postListBreadcrumbs;
|
|
38
|
+
breadcrumbs: typeof pageBreadcrumbs;
|
|
39
|
+
productBreadcrumbs: typeof productBreadcrumbs;
|
|
40
|
+
productListBreadcrumbs: typeof productListBreadcrumbs;
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./MockEntify";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function PreviewViewport():
|
|
1
|
+
export declare function PreviewViewport(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Theme } from "@rxdrag/rxcms-models";
|
|
2
|
+
export declare const createBaseFiles: (theme: Theme) => {
|
|
3
|
+
"package.json": {
|
|
4
|
+
file: {
|
|
5
|
+
contents: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
".gitignore": {
|
|
9
|
+
file: {
|
|
10
|
+
contents: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
"astro.config.mjs": {
|
|
14
|
+
file: {
|
|
15
|
+
contents: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
"tsconfig.json": {
|
|
19
|
+
file: {
|
|
20
|
+
contents: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
".env": {
|
|
24
|
+
file: {
|
|
25
|
+
contents: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
"tailwind.config.mjs": {
|
|
29
|
+
file: {
|
|
30
|
+
contents: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
".vscode": {
|
|
34
|
+
directory: {
|
|
35
|
+
"settings.json": {
|
|
36
|
+
file: {
|
|
37
|
+
contents: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
"extensions.json": {
|
|
41
|
+
file: {
|
|
42
|
+
contents: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
"launch.json": {
|
|
46
|
+
file: {
|
|
47
|
+
contents: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
src: {
|
|
53
|
+
directory: {
|
|
54
|
+
layouts: {
|
|
55
|
+
directory: {
|
|
56
|
+
"Layout.astro": {
|
|
57
|
+
file: {
|
|
58
|
+
contents: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
pages: {
|
|
64
|
+
directory: {
|
|
65
|
+
api: {
|
|
66
|
+
directory: {
|
|
67
|
+
"ask-for-quote.ts": {
|
|
68
|
+
file: {
|
|
69
|
+
contents: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
components: {
|
|
77
|
+
directory: {};
|
|
78
|
+
};
|
|
79
|
+
lib: {
|
|
80
|
+
directory: {
|
|
81
|
+
"index.ts": {
|
|
82
|
+
file: {
|
|
83
|
+
contents: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
"base.css": {
|
|
89
|
+
file: {
|
|
90
|
+
contents: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
"env.d.ts": {
|
|
94
|
+
file: {
|
|
95
|
+
contents: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
public: {
|
|
101
|
+
directory: {
|
|
102
|
+
"favicon.svg": {
|
|
103
|
+
file: {
|
|
104
|
+
contents: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const astroConfig = "import { defineConfig } from \"astro/config\";\nimport tailwind from \"@astrojs/tailwind\";\nimport react from \"@astrojs/react\";\nimport node from \"@astrojs/node\";\n\nexport default defineConfig({\n integrations: [tailwind(), react()],\n output: \"server\", // \u4F7F\u7528\u670D\u52A1\u7AEF\u6E32\u67D3\u6A21\u5F0F\n adapter: node({\n mode: \"standalone\", // \u4F7F\u7528\u72EC\u7ACB\u6A21\u5F0F\n }), // \u4F7F\u7528 Node.js \u9002\u914D\u5668\n});\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const faviconCode = "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 36 36\">\n<path fill=\"#000\" d=\"M22.25 4h-8.5a1 1 0 0 0-.96.73l-5.54 19.4a.5.5 0 0 0 .62.62l5.05-1.44a2 2 0 0 0 1.38-1.4l3.22-11.66a.5.5 0 0 1 .96 0l3.22 11.67a2 2 0 0 0 1.38 1.39l5.05 1.44a.5.5 0 0 0 .62-.62l-5.54-19.4a1 1 0 0 0-.96-.73Z\"/>\n<path fill=\"url(#gradient)\" d=\"M18 28a7.63 7.63 0 0 1-3-.61v.61a3 3 0 0 0 6 0v-.61c-.94.4-1.95.61-3 .61Z\"/>\n<defs>\n <linearGradient id=\"gradient\" x1=\"18\" x2=\"18\" y1=\"28\" y2=\"31\" gradientUnits=\"userSpaceOnUse\">\n <stop stop-color=\"#FF1639\"/>\n <stop offset=\"1\" stop-color=\"#FF1639\" stop-opacity=\"0\"/>\n </linearGradient>\n</defs>\n</svg>";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const packageCode = "{\n \"name\": \"astro-project\",\n \"type\": \"module\",\n \"version\": \"0.0.1\",\n \"scripts\": {\n \"dev\": \"astro dev\",\n \"start\": \"astro dev\",\n \"build\": \"astro build\",\n \"preview\": \"astro preview\",\n \"astro\": \"astro\"\n },\n \"dependencies\": {\n \"@astrojs/react\": \"^4.2.0\",\n \"@iconify/react\": \"^5.0.2\",\n \"@rxdrag/website-lib\": \"^0.0.10\",\n \"@rxdrag/website-lib-core\": \"^0.0.8\",\n \"@rxdrag/slate-preview\": \"^1.2.55\",\n \"@rxdrag/rxcms-models\": \"^0.3.46\",\n \"astro\": \"^5.3.0\",\n \"dayjs\": \"^1.11.7\",\n \"gsap\": \"^3.12.7\",\n \"react\": \"^18.2.0\",\n \"react-dom\": \"^18.2.0\"\n },\n \"devDependencies\": {\n \"@astrojs/node\": \"^9.1.3\",\n \"@astrojs/tailwind\": \"^6.0.0\",\n \"@astrojs/vercel\": \"^8.1.2\",\n \"@tailwindcss/forms\": \"^0.5.7\",\n \"@tailwindcss/typography\": \"^0.5.13\",\n \"@types/react\": \"^18.2.20\",\n \"@types/react-dom\": \"^18.2.7\",\n \"tailwindcss\": \"^3.4.1\"\n }\n }";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const layoutCode = "---\nimport \"../base.css\";\nimport { ClientRouter } from \"astro:transitions\";\n---\n\n<!doctype html>\n<html lang=\"zh-CN\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n <meta name=\"generator\" content={Astro.generator} />\n <ClientRouter />\n <slot name=\"meta\" />\n </head>\n <body>\n <slot />\n </body>\n</html>\n\n<style>\n html,\n body {\n margin: 0;\n width: 100%;\n height: 100%;\n }\n</style>\n ";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const libCode = "import {\n Entify,\n type EnvVariables,\n type IEntify,\n } from \"@rxdrag/website-lib-core\";\n \n export function getEnvVariables(): EnvVariables {\n return {\n websiteId: import.meta.env.PUBLIC_WEBSITE_ID,\n entifyServerUrl: import.meta.env.PUBLIC_ENTIFY_SERVER_URL,\n entifyGuestToken: import.meta.env.PUBLIC_ENTIFY_GUEST_TOKEN,\n language: import.meta.env.PUBLIC_LANGUAGE,\n formSalt: import.meta.env.PUBLIC_FORM_SALT || \"yizhanfei\",\n };\n }\n \n export const rx = Entify.getInstance(getEnvVariables()) as IEntify;\n ";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const askForQuoteCode = "import type { APIRoute } from \"astro\";\n import type {\n SpamFilterRule,\n SpamFilterRuleBoolExp,\n SpamFilterRuleDistinctExp,\n SpamFilterRuleOrderBy,\n } from \"@rxdrag/rxcms-models\";\n import {\n EnquiryAssciations,\n EnquiryEntityName,\n EnquiryFields,\n SpamFilterRuleFields,\n SpamFilterRuleQueryOptions,\n } from \"@rxdrag/rxcms-models\";\n import { getEnvVariables, rx } from \"../../lib\";\n import {\n queryWebSiteSettings,\n sendEmail,\n upsertEntity,\n verifyEncryption,\n type QuoteRequest,\n } from \"@rxdrag/website-lib-core\";\n \n // \u6807\u8BB0\u6B64\u9875\u9762\u4E3A\u670D\u52A1\u5668\u6E32\u67D3\uFF0C\u800C\u4E0D\u662F\u9759\u6001\u751F\u6210\n export const prerender = false;\n \n export const POST: APIRoute = async ({ request }) => {\n try {\n const envVariables = getEnvVariables();\n \n // \u4ECE\u8BF7\u6C42\u4E2D\u83B7\u53D6JSON\u6570\u636E\n let requestData: QuoteRequest;\n try {\n requestData = await request.json();\n } catch (error) {\n console.error(\"JSON parsing error:\", error);\n return new Response(\n JSON.stringify({\n success: false,\n message: \"Invalid request format\",\n }),\n {\n status: 400,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }\n );\n }\n \n // \u9A8C\u8BC1\u871C\u7F50\u5B57\u6BB5\n if (requestData.phone) {\n console.log(\"Honeypot triggered - spam submission detected\");\n // \u6084\u6084\u5931\u8D25\uFF0C\u8FD4\u56DE\u6210\u529F\u4F46\u4E0D\u5904\u7406\n return new Response(\n JSON.stringify({\n success: true,\n message:\n \"Your enquiry has been submitted successfully, we will contact you soon\",\n }),\n {\n status: 200,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }\n );\n }\n \n // \u521B\u5EFA\u5B9E\u4F53\u5BF9\u8C61 - \u79FB\u9664\u4E0D\u5728\u6570\u636E\u5E93\u6A21\u578B\u4E2D\u7684\u5B57\u6BB5\n const { phone, encryptedField, ...entityData } = requestData;\n const entity: Record<string, unknown> = { ...entityData };\n \n // \u68C0\u67E5\u871C\u7F50\u5B57\u6BB5\n if (phone) {\n // \u871C\u7F50\u88AB\u89E6\u53D1\uFF0C\u62D2\u7EDD\u8BF7\u6C42\n return new Response(\n JSON.stringify({\n success: false,\n message: \"Form submission rejected\",\n }),\n {\n status: 400,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }\n );\n }\n \n // \u9A8C\u8BC1\u52A0\u5BC6\u5B57\u6BB5\n const isValid = verifyEncryption(\n //\u52A0\u5BC6\u76D0\n envVariables.formSalt,\n encryptedField,\n phone || \"\",\n 30 // 30\u5206\u949F\u6709\u6548\u671F\n );\n \n if (!isValid) {\n // \u52A0\u5BC6\u9A8C\u8BC1\u5931\u8D25\uFF0C\u62D2\u7EDD\u8BF7\u6C42\n return new Response(\n JSON.stringify({\n success: false,\n message: \"Invalid form submission\",\n }),\n {\n status: 400,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }\n );\n }\n \n // \u83B7\u53D6\u8BF7\u6C42\u5934\u4FE1\u606F\n const url =\n request.headers.get(\"X-Request-URL\") || request.headers.get(\"referer\");\n const ip =\n request.headers.get(\"X-Forwarded-For\") ||\n request.headers.get(\"X-Real-IP\");\n const userAgent = request.headers.get(\"user-agent\");\n \n // \u8BBE\u7F6E\u989D\u5916\u5B57\u6BB5\n entity[EnquiryFields.formIp] = ip;\n entity[EnquiryFields.fromUrl] = url;\n entity[EnquiryFields.userAgent] = userAgent;\n entity[EnquiryFields.read] = false;\n entity[EnquiryFields.spam] = false;\n entity[EnquiryAssciations.website] = {\n sync: { id: envVariables.websiteId },\n };\n \n // \u9A8C\u8BC1\u5FC5\u586B\u5B57\u6BB5\n if (\n !entity[EnquiryFields.name] ||\n !entity[EnquiryFields.email] ||\n !entity[EnquiryFields.message]\n ) {\n return new Response(\n JSON.stringify({\n success: false,\n message: \"Please fill in all required fields\",\n }),\n {\n status: 400,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }\n );\n }\n \n // \u5783\u573E\u4FE1\u606F\u8FC7\u6EE4\n const spamRules = (\n await rx.queryEntityList<\n SpamFilterRule,\n SpamFilterRuleBoolExp,\n SpamFilterRuleOrderBy,\n SpamFilterRuleDistinctExp\n >(\n new SpamFilterRuleQueryOptions([\n SpamFilterRuleFields.emails,\n SpamFilterRuleFields.ips,\n SpamFilterRuleFields.keywords,\n ])\n )\n )?.items as SpamFilterRule[] | undefined;\n \n for (const rule of spamRules || []) {\n const email = (entity[EnquiryFields.email] as string)?.trim();\n if (\n !email ||\n rule.emails\n ?.replace(\"\uFF0C\", \",\")\n .split(\",\")\n .map((em) => em.trim())\n .includes(email) ||\n (ip &&\n rule.ips\n ?.replace(\"\uFF0C\", \",\")\n .split(\",\")\n .map((ipAddr) => ipAddr.trim())\n .includes(ip)) ||\n rule.keywords\n ?.split(\",\")\n .some(\n (keyword: string) =>\n keyword &&\n (entity[EnquiryFields.message] as string).includes(keyword)\n )\n ) {\n // \u6807\u8BB0\u4E3A\u5783\u573E\u4FE1\u606F\u5E76\u4FDD\u5B58\n await upsertEntity(\n EnquiryEntityName,\n { ...entity, spam: true, read: false },\n envVariables\n );\n \n // \u8FD4\u56DE404\u54CD\u5E94\uFF0C\u6A21\u62DF\u539F\u59CB\u884C\u4E3A\n return new Response(null, { status: 404 });\n }\n }\n \n // \u4FDD\u5B58\u8BE2\u4EF7\u4FE1\u606F\n await upsertEntity(EnquiryEntityName, entity, envVariables);\n \n // \u83B7\u53D6\u7F51\u7AD9\u8BBE\u7F6E\u5E76\u53D1\u9001\u90AE\u4EF6\u901A\u77E5\n const websettins = await queryWebSiteSettings(envVariables);\n const name = entity?.[EnquiryFields.name] as string;\n \n if (websettins?.noticeEmail) {\n const content = `\n Company: ${entity[EnquiryFields.company]}\n Name: ${name}\n Email: ${entity[EnquiryFields.email]}\n Message: ${entity[EnquiryFields.message]}\n IP: ${ip}\n URL: ${url}\n CTA: ${entity[EnquiryFields.fromCta]}\n userAgent: ${userAgent}\n `;\n \n const employeeEmail = {\n to: websettins?.noticeEmail,\n subject: \"New Enquiry Received\",\n message: content,\n };\n \n await sendEmail(employeeEmail, envVariables);\n }\n \n // \u8FD4\u56DEJSON\u54CD\u5E94\n return new Response(\n JSON.stringify({\n success: true,\n message:\n \"Your enquiry has been submitted successfully, we will contact you soon\",\n }),\n {\n status: 200,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }\n );\n } catch (error) {\n console.error(\"Error processing enquiry request:\", error);\n \n // \u8FD4\u56DE\u9519\u8BEF\u54CD\u5E94\n return new Response(\n JSON.stringify({\n success: false,\n message: \"Submission failed, please try again later\",\n }),\n {\n status: 500,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }\n );\n }\n };\n ";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tailwindConfigCode = "import plugin from \"tailwindcss/plugin\";\n\nexport default {\n darkMode: \"class\", // \u4F7F\u7528class\u7B56\u7565\u6765\u63A7\u5236\u6697\u8272\u6A21\u5F0F\n content: [\n \"./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}\",\n \"node_modules/@rxdrag/website-lib/src/**/*.{js,ts,jsx,tsx}\",\n \"node_modules/@rxdrag/website-lib-core/src/**/*.{js,ts,jsx,tsx}\",\n ],\n theme: {\n extend: {},\n },\n plugins: [\n require(\"@tailwindcss/forms\"),\n require(\"@tailwindcss/typography\"),\n plugin(function ({ addVariant }) {\n addVariant(\"scrolling\", \".scrolling &\");\n addVariant(\"open\", [\".open&\", \".open &\"]);\n addVariant(\"actived\", [\".actived&\", \".actived &\"]);\n addVariant(\"disabled\", [\".disabled&\", \".disabled &\"]);\n addVariant(\"selected\", [\".selected&\", \".selected &\"]);\n }),\n ],\n};\n\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tsconfigCode = "{\n \"extends\": \"astro/tsconfigs/strict\",\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"jsxImportSource\": \"react\"\n },\n \"include\": [\".astro/types.d.ts\", \"**/*\"],\n \"exclude\": [\"dist\"]\n }\n ";
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Theme } from "@rxdrag/rxcms-models";
|
|
2
|
+
export declare function useGetFiles(): (theme?: Theme) => Promise<{
|
|
3
|
+
src: {
|
|
4
|
+
directory: {
|
|
5
|
+
components: {
|
|
6
|
+
directory: {};
|
|
7
|
+
};
|
|
8
|
+
pages: {
|
|
9
|
+
directory: {
|
|
10
|
+
api: {
|
|
11
|
+
directory: {
|
|
12
|
+
"ask-for-quote.ts": {
|
|
13
|
+
file: {
|
|
14
|
+
contents: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
layouts: {
|
|
22
|
+
directory: {
|
|
23
|
+
"Layout.astro": {
|
|
24
|
+
file: {
|
|
25
|
+
contents: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
lib: {
|
|
31
|
+
directory: {
|
|
32
|
+
"index.ts": {
|
|
33
|
+
file: {
|
|
34
|
+
contents: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
"base.css": {
|
|
40
|
+
file: {
|
|
41
|
+
contents: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
"env.d.ts": {
|
|
45
|
+
file: {
|
|
46
|
+
contents: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
"package.json": {
|
|
52
|
+
file: {
|
|
53
|
+
contents: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
".gitignore": {
|
|
57
|
+
file: {
|
|
58
|
+
contents: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
"astro.config.mjs": {
|
|
62
|
+
file: {
|
|
63
|
+
contents: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
"tsconfig.json": {
|
|
67
|
+
file: {
|
|
68
|
+
contents: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
".env": {
|
|
72
|
+
file: {
|
|
73
|
+
contents: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
"tailwind.config.mjs": {
|
|
77
|
+
file: {
|
|
78
|
+
contents: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
".vscode": {
|
|
82
|
+
directory: {
|
|
83
|
+
"settings.json": {
|
|
84
|
+
file: {
|
|
85
|
+
contents: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
"extensions.json": {
|
|
89
|
+
file: {
|
|
90
|
+
contents: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
"launch.json": {
|
|
94
|
+
file: {
|
|
95
|
+
contents: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
public: {
|
|
101
|
+
directory: {
|
|
102
|
+
"favicon.svg": {
|
|
103
|
+
file: {
|
|
104
|
+
contents: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
} | undefined>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type FileContent = {
|
|
2
|
+
contents: string;
|
|
3
|
+
};
|
|
4
|
+
type FileEntry = {
|
|
5
|
+
file: FileContent;
|
|
6
|
+
};
|
|
7
|
+
type DirectoryEntry = {
|
|
8
|
+
directory: DirectoryContent;
|
|
9
|
+
};
|
|
10
|
+
type DirectoryContent = Record<string, FileEntry | DirectoryEntry>;
|
|
11
|
+
type FileStructure = Record<string, FileEntry | DirectoryEntry>;
|
|
12
|
+
export declare function useGetPageFiles(): (themeId?: string) => Promise<FileStructure>;
|
|
13
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ProductCategoryFields, ProductCategoryQueryOptions, ProductFields, ProductQueryOptions, PublishableStatus } from "@rxdrag/rxcms-models";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import { MockEntify } from "../components/DocPreview/mock";
|
|
4
|
+
export declare function useImportVariables(): {
|
|
5
|
+
rx: MockEntify;
|
|
6
|
+
ProductCategoryQueryOptions: typeof ProductCategoryQueryOptions;
|
|
7
|
+
ProductCategoryFields: typeof ProductCategoryFields;
|
|
8
|
+
ProductQueryOptions: typeof ProductQueryOptions;
|
|
9
|
+
ProductFields: typeof ProductFields;
|
|
10
|
+
PublishableStatus: typeof PublishableStatus;
|
|
11
|
+
getEnvVariables: () => {
|
|
12
|
+
websiteId: string;
|
|
13
|
+
entifyServerUrl: string;
|
|
14
|
+
entifyGuestToken: string;
|
|
15
|
+
language: string;
|
|
16
|
+
formSalt: string;
|
|
17
|
+
};
|
|
18
|
+
dayjs: typeof dayjs;
|
|
19
|
+
rxPage: {
|
|
20
|
+
postsPagination: typeof import("../components/DocPreview/mock/MockRxPage").postsPagination;
|
|
21
|
+
productsPagination: typeof import("../components/DocPreview/mock/MockRxPage").productsPagination;
|
|
22
|
+
postBreadcrumbs: typeof import("../components/DocPreview/mock/MockRxPage").postBreadcrumbs;
|
|
23
|
+
postListBreadcrumbs: typeof import("../components/DocPreview/mock/MockRxPage").postListBreadcrumbs;
|
|
24
|
+
breadcrumbs: typeof import("../components/DocPreview/mock/MockRxPage").pageBreadcrumbs;
|
|
25
|
+
productBreadcrumbs: typeof import("../components/DocPreview/mock/MockRxPage").productBreadcrumbs;
|
|
26
|
+
productListBreadcrumbs: typeof import("../components/DocPreview/mock/MockRxPage").productListBreadcrumbs;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-e69a2bfd.js","sources":["../../../node_modules/.pnpm/@heroui+dom-animation@2.1.5_framer-motion@11.
|
|
1
|
+
{"version":3,"file":"index-e69a2bfd.js","sources":["../../../node_modules/.pnpm/@heroui+dom-animation@2.1.5_framer-motion@11.18.2_@emotion+is-prop-valid@1.3.1_react-dom@18.3_3dhswdhjtz6s5ttwxy6m3woumy/node_modules/@heroui/dom-animation/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/index.ts\nimport { domAnimation } from \"framer-motion\";\nvar index_default = domAnimation;\nexport {\n index_default as default\n};\n"],"names":[],"mappings":";AAIG,IAAC,gBAAgB;","x_google_ignoreList":[0]}
|
package/dist/index.d.ts
CHANGED