@zhin.js/console 1.0.21 → 1.0.23

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 (56) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +4 -4
  3. package/client/components.json +17 -0
  4. package/client/index.html +1 -1
  5. package/client/src/components/PluginConfigForm/BasicFieldRenderers.tsx +89 -180
  6. package/client/src/components/PluginConfigForm/CollectionFieldRenderers.tsx +97 -200
  7. package/client/src/components/PluginConfigForm/CompositeFieldRenderers.tsx +31 -70
  8. package/client/src/components/PluginConfigForm/FieldRenderer.tsx +27 -77
  9. package/client/src/components/PluginConfigForm/NestedFieldRenderer.tsx +33 -53
  10. package/client/src/components/PluginConfigForm/index.tsx +71 -173
  11. package/client/src/components/ui/accordion.tsx +54 -0
  12. package/client/src/components/ui/alert.tsx +62 -0
  13. package/client/src/components/ui/avatar.tsx +41 -0
  14. package/client/src/components/ui/badge.tsx +32 -0
  15. package/client/src/components/ui/button.tsx +50 -0
  16. package/client/src/components/ui/card.tsx +50 -0
  17. package/client/src/components/ui/checkbox.tsx +25 -0
  18. package/client/src/components/ui/dialog.tsx +87 -0
  19. package/client/src/components/ui/dropdown-menu.tsx +97 -0
  20. package/client/src/components/ui/input.tsx +21 -0
  21. package/client/src/components/ui/scroll-area.tsx +43 -0
  22. package/client/src/components/ui/select.tsx +127 -0
  23. package/client/src/components/ui/separator.tsx +23 -0
  24. package/client/src/components/ui/skeleton.tsx +12 -0
  25. package/client/src/components/ui/switch.tsx +26 -0
  26. package/client/src/components/ui/tabs.tsx +52 -0
  27. package/client/src/components/ui/textarea.tsx +20 -0
  28. package/client/src/components/ui/tooltip.tsx +27 -0
  29. package/client/src/layouts/dashboard.tsx +91 -221
  30. package/client/src/main.tsx +38 -42
  31. package/client/src/pages/dashboard-bots.tsx +91 -137
  32. package/client/src/pages/dashboard-home.tsx +133 -204
  33. package/client/src/pages/dashboard-logs.tsx +125 -196
  34. package/client/src/pages/dashboard-plugin-detail.tsx +261 -329
  35. package/client/src/pages/dashboard-plugins.tsx +108 -105
  36. package/client/src/style.css +156 -865
  37. package/client/src/theme/index.ts +60 -35
  38. package/client/tailwind.config.js +78 -69
  39. package/dist/client.js +1 -1
  40. package/dist/cva.js +47 -0
  41. package/dist/index.html +1 -1
  42. package/dist/index.js +6 -6
  43. package/dist/react-router.js +7121 -5585
  44. package/dist/react.js +192 -149
  45. package/dist/style.css +2 -2
  46. package/lib/bin.js +2 -2
  47. package/lib/build.js +2 -2
  48. package/lib/index.d.ts +0 -3
  49. package/lib/index.js +160 -205
  50. package/lib/transform.d.ts +26 -0
  51. package/lib/transform.js +78 -0
  52. package/lib/websocket.d.ts +0 -1
  53. package/package.json +9 -8
  54. package/dist/radix-ui-themes.js +0 -9305
  55. package/lib/dev.d.ts +0 -18
  56. 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 };