@chatbi-v/cli 1.0.7 → 1.0.8
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/default/apps/main/src/App.tsx.hbs +46 -30
- package/dist/default/package.json.hbs +1 -0
- package/dist/default/plugins/demo-plugin/package.json.hbs +2 -1
- package/dist/default/plugins/demo-plugin/src/index.tsx.hbs +13 -13
- package/dist/index.js +926 -471
- package/package.json +11 -4
- package/templates/default/.gitignore.hbs +0 -3
- package/templates/default/README.md.hbs +0 -30
- package/templates/default/apps/main/index.html.hbs +0 -13
- package/templates/default/apps/main/package.json.hbs +0 -20
- package/templates/default/apps/main/postcss.config.cjs.hbs +0 -6
- package/templates/default/apps/main/src/App.tsx.hbs +0 -162
- package/templates/default/apps/main/src/components/NavIcon.tsx.hbs +0 -41
- package/templates/default/apps/main/src/hooks/usePluginLoader.ts.hbs +0 -25
- package/templates/default/apps/main/src/index.css.hbs +0 -8
- package/templates/default/apps/main/src/main.tsx.hbs +0 -13
- package/templates/default/apps/main/src/pages/Guide.tsx.hbs +0 -133
- package/templates/default/apps/main/tailwind.config.cjs.hbs +0 -17
- package/templates/default/apps/main/tsconfig.json.hbs +0 -10
- package/templates/default/apps/main/vite.config.ts.hbs +0 -16
- package/templates/default/package.json.hbs +0 -33
- package/templates/default/plugins/demo-plugin/package.json.hbs +0 -17
- package/templates/default/plugins/demo-plugin/src/index.tsx.hbs +0 -44
- package/templates/default/plugins/demo-plugin/tsconfig.json.hbs +0 -10
- package/templates/default/pnpm-workspace.yaml.hbs +0 -3
- package/templates/default/tsconfig.json.hbs +0 -24
|
@@ -42,15 +42,23 @@ const App: React.FC = () => {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
<div className=
|
|
45
|
+
<div className={`flex h-screen flex-col overflow-hidden font-sans ${
|
|
46
|
+
{{#if isNebula}}'bg-purple-50'{{else if isGlass}}'bg-slate-100'{{else}}'bg-gray-50'{{/if}}
|
|
47
|
+
}`}>
|
|
46
48
|
{/* Header */}
|
|
47
|
-
<header className=
|
|
49
|
+
<header className={`flex h-16 items-center justify-between px-6 text-white shadow-md z-10 ${
|
|
50
|
+
{{#if isNebula}}'bg-gradient-to-r from-indigo-900 to-purple-900'{{else if isGlass}}'bg-white/70 backdrop-blur-md text-slate-900 border-b border-white/20'{{else}}'bg-slate-900'{{/if}}
|
|
51
|
+
}`}>
|
|
48
52
|
<div className="flex items-center gap-4">
|
|
49
53
|
<div className="flex items-center gap-2 group cursor-pointer" onClick={() => navigate('/')}>
|
|
50
|
-
<div className=
|
|
54
|
+
<div className={`w-8 h-8 rounded-lg flex items-center justify-center shadow-lg transition-transform group-hover:scale-105 ${
|
|
55
|
+
{{#if isNebula}}'bg-purple-500 shadow-purple-500/20'{{else if isGlass}}'bg-blue-500 shadow-blue-500/20'{{else}}'bg-indigo-500 shadow-indigo-500/20'{{/if}}
|
|
56
|
+
}`}>
|
|
51
57
|
<ThunderboltOutlined className="text-lg text-white" />
|
|
52
58
|
</div>
|
|
53
|
-
<h2 className=
|
|
59
|
+
<h2 className={`m-0 text-lg font-bold tracking-tight uppercase ${
|
|
60
|
+
{{#if isGlass}}'text-slate-800'{{else}}'text-white'{{/if}}
|
|
61
|
+
}`}>
|
|
54
62
|
{{name}}
|
|
55
63
|
</h2>
|
|
56
64
|
</div>
|
|
@@ -58,7 +66,9 @@ const App: React.FC = () => {
|
|
|
58
66
|
<Link
|
|
59
67
|
to="/guide"
|
|
60
68
|
className={`flex items-center gap-1.5 px-3 py-1 rounded transition-colors ${
|
|
61
|
-
location.pathname === '/guide'
|
|
69
|
+
location.pathname === '/guide'
|
|
70
|
+
? ({{#if isGlass}}'bg-blue-500/10 text-blue-600'{{else}}'bg-indigo-500/20 text-indigo-300'{{/if}})
|
|
71
|
+
: ({{#if isGlass}}'text-slate-500 hover:text-slate-800'{{else}}'text-gray-400 hover:text-white'{{/if}})
|
|
62
72
|
}`}
|
|
63
73
|
>
|
|
64
74
|
<QuestionCircleOutlined />
|
|
@@ -74,11 +84,15 @@ const App: React.FC = () => {
|
|
|
74
84
|
<div className="flex flex-1 overflow-hidden">
|
|
75
85
|
{/* Sidebar */}
|
|
76
86
|
<aside
|
|
77
|
-
className={`flex flex-col border-r
|
|
87
|
+
className={`flex flex-col border-r transition-all duration-300 ease-in-out ${
|
|
78
88
|
collapsed ? 'w-16' : 'w-64'
|
|
89
|
+
} ${
|
|
90
|
+
{{#if isGlass}}'bg-white/40 backdrop-blur-lg border-white/20 shadow-xl shadow-slate-200/50'{{else if isNebula}}'bg-white border-purple-100 shadow-sm'{{else}}'bg-white border-gray-200 shadow-sm'{{/if}}
|
|
79
91
|
}`}
|
|
80
92
|
>
|
|
81
|
-
<div className={`p-4 border-b
|
|
93
|
+
<div className={`p-4 border-b text-xs font-semibold uppercase tracking-wider overflow-hidden whitespace-nowrap ${collapsed ? 'text-center px-0' : ''} ${
|
|
94
|
+
{{#if isNebula}}'bg-purple-50/50 text-purple-400 border-purple-50'{{else if isGlass}}'bg-blue-50/30 text-blue-500 border-white/20'{{else}}'bg-gray-50/50 text-gray-400 border-gray-50'{{/if}}
|
|
95
|
+
}`}>
|
|
82
96
|
{collapsed ? '···' : '插件菜单'}
|
|
83
97
|
</div>
|
|
84
98
|
<div className="flex-1 overflow-y-auto no-scrollbar py-4 px-2">
|
|
@@ -119,29 +133,31 @@ const App: React.FC = () => {
|
|
|
119
133
|
</aside>
|
|
120
134
|
|
|
121
135
|
{/* Main Content */}
|
|
122
|
-
<main className="
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
<main className="flex-1 relative overflow-hidden flex flex-col">
|
|
137
|
+
<div className={`absolute top-0 left-0 right-0 h-1 z-20 ${
|
|
138
|
+
{{#if isNebula}}'bg-purple-500/20'{{else if isGlass}}'bg-blue-500/20'{{else}}'bg-indigo-500/10'{{/if}}
|
|
139
|
+
}`} />
|
|
140
|
+
|
|
141
|
+
<div className="flex-1 overflow-y-auto p-6 scroll-smooth bg-transparent">
|
|
142
|
+
<div className={`mx-auto max-w-7xl h-full ${
|
|
143
|
+
{{#if isGlass}}'bg-white/60 backdrop-blur-md rounded-2xl border border-white/40 shadow-xl p-8'{{else}}''{{/if}}
|
|
144
|
+
}`}>
|
|
145
|
+
<Routes>
|
|
146
|
+
<Route path="/guide" element={<GuidePage />} />
|
|
147
|
+
{routes.map(route => (
|
|
148
|
+
<Route key={route.path} path={route.path} element={<route.component />} />
|
|
149
|
+
))}
|
|
150
|
+
<Route path="/" element={<Navigate to={defaultRoute} replace />} />
|
|
151
|
+
</Routes>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
{/* Footer Slot */}
|
|
156
|
+
<div className={`mt-auto px-6 py-3 border-t text-xs text-gray-400 flex justify-between items-center ${
|
|
157
|
+
{{#if isGlass}}'bg-white/30 border-white/20'{{else if isNebula}}'bg-purple-50/30 border-purple-50'{{else}}'bg-white border-gray-100'{{/if}}
|
|
158
|
+
}`}>
|
|
159
|
+
<div>ChatBI-V Plugin Container v1.0.0</div>
|
|
160
|
+
<PluginSlot slot={Slot.Footer} />
|
|
145
161
|
</div>
|
|
146
162
|
</main>
|
|
147
163
|
</div>
|
|
@@ -2,22 +2,22 @@ import React from 'react'
|
|
|
2
2
|
import { Plugin, PluginContext, Slot } from '@chatbi-v/core'
|
|
3
3
|
import { MessageOutlined } from '@ant-design/icons'
|
|
4
4
|
|
|
5
|
-
export class
|
|
6
|
-
id = '
|
|
5
|
+
export class {{className}} implements Plugin {
|
|
6
|
+
id = '{{pluginId}}'
|
|
7
7
|
metadata = {
|
|
8
|
-
id: '
|
|
9
|
-
name: '
|
|
8
|
+
id: '{{pluginId}}',
|
|
9
|
+
name: '{{pluginId}} Plugin',
|
|
10
10
|
version: '1.0.0',
|
|
11
|
-
type: '
|
|
11
|
+
type: '{{pluginType}}' as const,
|
|
12
12
|
routes: [
|
|
13
13
|
{
|
|
14
|
-
path: '/
|
|
14
|
+
path: '/{{pluginId}}',
|
|
15
15
|
component: () => <div style=\{{ padding: '20px', background: '#f5f5f5', borderRadius: '8px' }}>
|
|
16
|
-
<h3>Hello from
|
|
17
|
-
<p>This is a
|
|
16
|
+
<h3>Hello from {{pluginId}} Plugin!</h3>
|
|
17
|
+
<p>This is a {{pluginType}} plugin generated by ChatBI CLI.</p>
|
|
18
18
|
</div>,
|
|
19
19
|
meta: {
|
|
20
|
-
title: '
|
|
20
|
+
title: '{{pluginId}}',
|
|
21
21
|
icon: 'MessageOutlined'
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -28,17 +28,17 @@ export class DemoPlugin implements Plugin {
|
|
|
28
28
|
component: () => null,
|
|
29
29
|
order: 10,
|
|
30
30
|
meta: {
|
|
31
|
-
title: '
|
|
31
|
+
title: '{{pluginId}}',
|
|
32
32
|
icon: <MessageOutlined />,
|
|
33
|
-
path: '/
|
|
33
|
+
path: '/{{pluginId}}'
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
]
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
onLoad(context: PluginContext) {
|
|
40
|
-
context.logger.info('
|
|
40
|
+
context.logger.info('{{className}} Loaded!')
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export default
|
|
44
|
+
export default {{className}}
|