@zhin.js/console 1.0.21 → 1.0.22
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/CHANGELOG.md +11 -0
- package/README.md +4 -4
- package/client/components.json +17 -0
- package/client/index.html +1 -1
- package/client/src/components/PluginConfigForm/BasicFieldRenderers.tsx +89 -180
- package/client/src/components/PluginConfigForm/CollectionFieldRenderers.tsx +97 -200
- package/client/src/components/PluginConfigForm/CompositeFieldRenderers.tsx +31 -70
- package/client/src/components/PluginConfigForm/FieldRenderer.tsx +27 -77
- package/client/src/components/PluginConfigForm/NestedFieldRenderer.tsx +33 -53
- package/client/src/components/PluginConfigForm/index.tsx +71 -173
- package/client/src/components/ui/accordion.tsx +54 -0
- package/client/src/components/ui/alert.tsx +62 -0
- package/client/src/components/ui/avatar.tsx +41 -0
- package/client/src/components/ui/badge.tsx +32 -0
- package/client/src/components/ui/button.tsx +50 -0
- package/client/src/components/ui/card.tsx +50 -0
- package/client/src/components/ui/checkbox.tsx +25 -0
- package/client/src/components/ui/dialog.tsx +87 -0
- package/client/src/components/ui/dropdown-menu.tsx +97 -0
- package/client/src/components/ui/input.tsx +21 -0
- package/client/src/components/ui/scroll-area.tsx +43 -0
- package/client/src/components/ui/select.tsx +127 -0
- package/client/src/components/ui/separator.tsx +23 -0
- package/client/src/components/ui/skeleton.tsx +12 -0
- package/client/src/components/ui/switch.tsx +26 -0
- package/client/src/components/ui/tabs.tsx +52 -0
- package/client/src/components/ui/textarea.tsx +20 -0
- package/client/src/components/ui/tooltip.tsx +27 -0
- package/client/src/layouts/dashboard.tsx +91 -221
- package/client/src/main.tsx +38 -42
- package/client/src/pages/dashboard-bots.tsx +91 -137
- package/client/src/pages/dashboard-home.tsx +133 -204
- package/client/src/pages/dashboard-logs.tsx +125 -196
- package/client/src/pages/dashboard-plugin-detail.tsx +261 -329
- package/client/src/pages/dashboard-plugins.tsx +108 -105
- package/client/src/style.css +156 -865
- package/client/src/theme/index.ts +60 -35
- package/client/tailwind.config.js +78 -69
- package/dist/client.js +1 -1
- package/dist/cva.js +47 -0
- package/dist/index.html +1 -1
- package/dist/index.js +6 -6
- package/dist/react-router.js +7121 -5585
- package/dist/react.js +192 -149
- package/dist/style.css +2 -2
- package/lib/bin.js +2 -2
- package/lib/build.js +2 -2
- package/lib/index.d.ts +0 -3
- package/lib/index.js +160 -205
- package/lib/transform.d.ts +26 -0
- package/lib/transform.js +78 -0
- package/lib/websocket.d.ts +0 -1
- package/package.json +8 -7
- package/dist/radix-ui-themes.js +0 -9305
- package/lib/dev.d.ts +0 -18
- package/lib/dev.js +0 -87
package/lib/dev.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
|
|
3
|
-
interface DevServerOptions {
|
|
4
|
-
/** 客户端代码根目录 */
|
|
5
|
-
root: string;
|
|
6
|
-
/** 基础路径,默认 /vite/ */
|
|
7
|
-
base?: string;
|
|
8
|
-
/** 是否启用 tailwindcss,默认 true */
|
|
9
|
-
enableTailwind?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* 创建 Vite 开发服务器
|
|
13
|
-
* @param options 开发服务器选项
|
|
14
|
-
* @returns Vite 开发服务器实例
|
|
15
|
-
*/
|
|
16
|
-
declare function createViteDevServer(options: DevServerOptions): Promise<ViteDevServer>;
|
|
17
|
-
|
|
18
|
-
export { type DevServerOptions, createViteDevServer };
|
package/lib/dev.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
|
|
4
|
-
// src/dev.ts
|
|
5
|
-
async function createViteDevServer(options) {
|
|
6
|
-
const { root, base = "/vite/", enableTailwind = true } = options;
|
|
7
|
-
try {
|
|
8
|
-
const [
|
|
9
|
-
{ createServer, searchForWorkspaceRoot },
|
|
10
|
-
{ default: react },
|
|
11
|
-
{ default: tailwindcss }
|
|
12
|
-
] = await Promise.all([
|
|
13
|
-
import('vite'),
|
|
14
|
-
import('@vitejs/plugin-react'),
|
|
15
|
-
import('@tailwindcss/vite')
|
|
16
|
-
]);
|
|
17
|
-
const plugins = [react()];
|
|
18
|
-
if (enableTailwind) {
|
|
19
|
-
plugins.push(tailwindcss());
|
|
20
|
-
}
|
|
21
|
-
const clientPath = path.resolve(process.cwd(), "node_modules/@zhin.js/client/client");
|
|
22
|
-
if (!fs.existsSync(clientPath)) {
|
|
23
|
-
throw new Error("@zhin.js/client not found");
|
|
24
|
-
}
|
|
25
|
-
return await createServer({
|
|
26
|
-
root,
|
|
27
|
-
base,
|
|
28
|
-
plugins: [react(), tailwindcss()],
|
|
29
|
-
server: {
|
|
30
|
-
middlewareMode: true,
|
|
31
|
-
allowedHosts: true,
|
|
32
|
-
fs: {
|
|
33
|
-
strict: false,
|
|
34
|
-
// 添加文件访问过滤,避免访问特殊文件
|
|
35
|
-
allow: [
|
|
36
|
-
// 允许访问的目录
|
|
37
|
-
root,
|
|
38
|
-
searchForWorkspaceRoot(root),
|
|
39
|
-
path.resolve(process.cwd(), "node_modules"),
|
|
40
|
-
path.resolve(process.cwd(), "client"),
|
|
41
|
-
path.resolve(process.cwd(), "src")
|
|
42
|
-
],
|
|
43
|
-
// 拒绝访问某些文件模式
|
|
44
|
-
deny: [
|
|
45
|
-
"**/.git/**",
|
|
46
|
-
"**/node_modules/.cache/**",
|
|
47
|
-
"**/*.socket",
|
|
48
|
-
"**/*.pipe",
|
|
49
|
-
"**/Dockerfile*",
|
|
50
|
-
"**/.env*"
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
resolve: {
|
|
55
|
-
dedupe: [
|
|
56
|
-
"react",
|
|
57
|
-
"react-dom",
|
|
58
|
-
"clsx",
|
|
59
|
-
"tailwind-merge",
|
|
60
|
-
"@reduxjs/toolkit",
|
|
61
|
-
"react-router",
|
|
62
|
-
"react-redux",
|
|
63
|
-
"redux-persist"
|
|
64
|
-
],
|
|
65
|
-
alias: {
|
|
66
|
-
"@zhin.js/client": path.resolve(process.cwd(), "node_modules/@zhin.js/client/client"),
|
|
67
|
-
"@": path.resolve(root, "../client/src")
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
optimizeDeps: {
|
|
71
|
-
include: ["react", "react-dom"]
|
|
72
|
-
},
|
|
73
|
-
build: {
|
|
74
|
-
rollupOptions: {
|
|
75
|
-
input: root + "/index.html"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
} catch (error) {
|
|
80
|
-
throw new Error(
|
|
81
|
-
`Failed to create Vite dev server. Make sure all development dependencies are installed: vite, @vitejs/plugin-react, @tailwindcss/vite. Run: pnpm install --include=optional
|
|
82
|
-
Original error: ${error.message}`
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export { createViteDevServer };
|