@kb-labs/studio-app 0.6.0
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/.env.example +10 -0
- package/README.md +74 -0
- package/UI-KIT-COMPONENTS.md +783 -0
- package/UI-KIT-PLAN.md +326 -0
- package/eslint-rules/no-direct-antd-import.js +151 -0
- package/eslint.config.ts +27 -0
- package/index.html +17 -0
- package/package.json +72 -0
- package/postcss.config.js +7 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +7 -0
- package/rspack.config.mjs +118 -0
- package/src/App.tsx +46 -0
- package/src/components/devtools/devtools-log-feed.module.css +165 -0
- package/src/components/devtools/devtools-log-feed.tsx +300 -0
- package/src/components/devtools/devtools-panel.module.css +121 -0
- package/src/components/devtools/devtools-panel.tsx +115 -0
- package/src/components/empty-state.tsx +28 -0
- package/src/components/error-boundary.tsx +210 -0
- package/src/components/health-banner.module.css +103 -0
- package/src/components/health-banner.tsx +134 -0
- package/src/components/health-indicator.tsx +12 -0
- package/src/components/page-header.tsx +49 -0
- package/src/components/page-transition.tsx +24 -0
- package/src/components/role-switcher.tsx +148 -0
- package/src/components/run-badge.tsx +13 -0
- package/src/components/ui/icons.tsx +509 -0
- package/src/components/ui/index.ts +25 -0
- package/src/components/ui/kb-config-provider.tsx +130 -0
- package/src/components/ui/kb-header.module.css +51 -0
- package/src/components/ui/kb-header.tsx +112 -0
- package/src/components/ui/kb-notification-bell.module.css +103 -0
- package/src/components/ui/kb-notification-bell.tsx +199 -0
- package/src/components/ui/kb-page-layout.tsx +66 -0
- package/src/components/ui/kb-quick-search.module.css +86 -0
- package/src/components/ui/kb-quick-search.tsx +196 -0
- package/src/components/ui/kb-sidebar.module.css +47 -0
- package/src/components/ui/kb-sidebar.tsx +196 -0
- package/src/components/ui/kb-stat-card.module.css +21 -0
- package/src/components/ui/kb-stat-card.tsx +22 -0
- package/src/components/ui/kb-stat-grid.tsx +22 -0
- package/src/components/ui/kb-status-bar.module.css +49 -0
- package/src/components/ui/kb-status-bar.tsx +145 -0
- package/src/components/ui/kb-system-health-indicator.tsx +229 -0
- package/src/components/ui/kb-theme-toggle.tsx +42 -0
- package/src/components/ui/theme-adapter.ts +812 -0
- package/src/components/ui/theme-transition-overlay.tsx +70 -0
- package/src/components/ui/utils.ts +6 -0
- package/src/components/widget-error-boundary.tsx +172 -0
- package/src/config/env.ts +5 -0
- package/src/config/feature-flags.ts +482 -0
- package/src/config/studio.config.schema.ts +88 -0
- package/src/config/studio.config.ts +84 -0
- package/src/env.d.ts +23 -0
- package/src/hooks/use-command-palette.ts +6 -0
- package/src/hooks/use-devtools-store.ts +25 -0
- package/src/hooks/use-feature-flags.ts +101 -0
- package/src/index.css +10 -0
- package/src/layouts/dashboard-grid.tsx +122 -0
- package/src/layouts/index.ts +12 -0
- package/src/layouts/two-pane.tsx +134 -0
- package/src/main.tsx +15 -0
- package/src/modules/analytics/components/analytics-daily-stats-chart.tsx +257 -0
- package/src/modules/analytics/components/analytics-date-range-picker.tsx +121 -0
- package/src/modules/analytics/pages/analytics-cache-page.tsx +285 -0
- package/src/modules/analytics/pages/analytics-embeddings-page.tsx +274 -0
- package/src/modules/analytics/pages/analytics-events-page.tsx +425 -0
- package/src/modules/analytics/pages/analytics-llm-page.tsx +434 -0
- package/src/modules/analytics/pages/analytics-overview-page.tsx +336 -0
- package/src/modules/analytics/pages/analytics-page.tsx +20 -0
- package/src/modules/analytics/pages/analytics-storage-page.tsx +344 -0
- package/src/modules/analytics/pages/analytics-vectorstore-page.tsx +279 -0
- package/src/modules/analytics/routes/index.tsx +133 -0
- package/src/modules/analytics/utils/formatters.test.ts +148 -0
- package/src/modules/analytics/utils/formatters.ts +100 -0
- package/src/modules/auth/pages/login-page.module.css +113 -0
- package/src/modules/auth/pages/login-page.tsx +80 -0
- package/src/modules/auth/routes/index.tsx +24 -0
- package/src/modules/dashboard/components/ActivityTimelineWidget.tsx +199 -0
- package/src/modules/dashboard/components/AiInsightsWidget.tsx +358 -0
- package/src/modules/dashboard/components/AnimatedMetricCard.css +88 -0
- package/src/modules/dashboard/components/AnimatedMetricCard.tsx +125 -0
- package/src/modules/dashboard/components/HeroMetricCard.css +114 -0
- package/src/modules/dashboard/components/HeroMetricCard.tsx +152 -0
- package/src/modules/dashboard/components/HeroMetricsWidget.tsx +146 -0
- package/src/modules/dashboard/components/SystemResourcesWidget.tsx +197 -0
- package/src/modules/dashboard/components/dashboard-empty.tsx +22 -0
- package/src/modules/dashboard/components/dashboard-kpis-widget.tsx +59 -0
- package/src/modules/dashboard/components/dashboard-kpis.tsx +13 -0
- package/src/modules/dashboard/components/dashboard-latency-percentiles-widget.tsx +85 -0
- package/src/modules/dashboard/components/dashboard-metrics-widget.tsx +78 -0
- package/src/modules/dashboard/components/dashboard-plugins-widget.tsx +67 -0
- package/src/modules/dashboard/components/dashboard-requests-widget.tsx +62 -0
- package/src/modules/dashboard/layouts/dashboard-layout.tsx +16 -0
- package/src/modules/dashboard/pages/ai-insights-page.tsx +563 -0
- package/src/modules/dashboard/pages/dashboard-animations.css +317 -0
- package/src/modules/dashboard/pages/dashboard-page.tsx +13 -0
- package/src/modules/dashboard/routes/index.tsx +70 -0
- package/src/modules/observability/pages/devkit-page.tsx +263 -0
- package/src/modules/observability/pages/incident-detail-page.tsx +571 -0
- package/src/modules/observability/pages/incidents-page.tsx +370 -0
- package/src/modules/observability/pages/log-detail-page.tsx +508 -0
- package/src/modules/observability/pages/logs-page.tsx +1129 -0
- package/src/modules/observability/pages/prometheus-metrics-page.tsx +486 -0
- package/src/modules/observability/pages/state-broker-page.tsx +229 -0
- package/src/modules/observability/pages/system-events-page.tsx +255 -0
- package/src/modules/observability/routes/index.tsx +133 -0
- package/src/modules/plugins/components/marketplace-card.tsx +153 -0
- package/src/modules/plugins/components/plugin-ai-assistant-modal.tsx +374 -0
- package/src/modules/plugins/components/plugin-card.tsx +136 -0
- package/src/modules/plugins/components/plugin-detail/capabilities-summary.tsx +101 -0
- package/src/modules/plugins/components/plugin-detail/cli-commands-table.tsx +101 -0
- package/src/modules/plugins/components/plugin-detail/index.ts +7 -0
- package/src/modules/plugins/components/plugin-detail/jobs-table.tsx +64 -0
- package/src/modules/plugins/components/plugin-detail/permissions/env-permissions.tsx +30 -0
- package/src/modules/plugins/components/plugin-detail/permissions/filesystem-permissions.tsx +68 -0
- package/src/modules/plugins/components/plugin-detail/permissions/index.ts +6 -0
- package/src/modules/plugins/components/plugin-detail/permissions/network-permissions.tsx +43 -0
- package/src/modules/plugins/components/plugin-detail/permissions/platform-services.tsx +242 -0
- package/src/modules/plugins/components/plugin-detail/permissions/resource-quotas.tsx +96 -0
- package/src/modules/plugins/components/plugin-detail/permissions/shell-permissions.tsx +55 -0
- package/src/modules/plugins/components/plugin-detail/permissions-view.tsx +47 -0
- package/src/modules/plugins/components/plugin-detail/plugin-header.tsx +169 -0
- package/src/modules/plugins/components/plugin-detail/rest-routes-table.tsx +159 -0
- package/src/modules/plugins/components/plugin-detail/workflows-table.tsx +40 -0
- package/src/modules/plugins/components/plugin-grid.tsx +20 -0
- package/src/modules/plugins/components/plugin-table.tsx +178 -0
- package/src/modules/plugins/pages/marketplace-page.tsx +200 -0
- package/src/modules/plugins/pages/plugin-detail-page.tsx +1145 -0
- package/src/modules/plugins/routes/index.tsx +48 -0
- package/src/modules/plugins/utils/index.ts +1 -0
- package/src/modules/plugins/utils/schema-helpers.ts +21 -0
- package/src/modules/settings/components/api-routes-viewer.tsx +415 -0
- package/src/modules/settings/components/appearance-settings.tsx +200 -0
- package/src/modules/settings/components/configuration-settings.tsx +321 -0
- package/src/modules/settings/components/data-privacy-settings.tsx +111 -0
- package/src/modules/settings/components/experimental-settings.tsx +243 -0
- package/src/modules/settings/components/navigation-settings.tsx +198 -0
- package/src/modules/settings/components/notifications-settings.tsx +40 -0
- package/src/modules/settings/pages/settings-page.tsx +298 -0
- package/src/modules/settings/routes/index.tsx +47 -0
- package/src/pages/README-assistant.md +91 -0
- package/src/pages/login-page.tsx +177 -0
- package/src/pages/not-found-page.tsx +85 -0
- package/src/providers/auth-provider.tsx +40 -0
- package/src/providers/command-palette-provider.tsx +193 -0
- package/src/providers/data-sources-provider.tsx +27 -0
- package/src/providers/devtools-provider.tsx +72 -0
- package/src/providers/navigation-items-provider.tsx +38 -0
- package/src/providers/registry-v2-provider.tsx +93 -0
- package/src/providers/settings-provider.tsx +158 -0
- package/src/router.tsx +302 -0
- package/src/routes/helpers.tsx +25 -0
- package/src/routes/plugin-page-v2.tsx +52 -0
- package/src/routes/types.ts +18 -0
- package/src/styles/antd-overrides.css +211 -0
- package/src/styles/base.css +190 -0
- package/src/styles/settings.css +75 -0
- package/src/styles/variables.css +94 -0
- package/src/utils/analytics.ts +183 -0
- package/src/utils/apply-navigation-categories.ts +83 -0
- package/src/utils/commands.ts +252 -0
- package/src/utils/export.ts +174 -0
- package/src/utils/format-date.ts +166 -0
- package/src/utils/logger.ts +110 -0
- package/tailwind.config.ts +13 -0
- package/tsconfig.json +13 -0
- package/vitest-setup.ts +1 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UITable,
|
|
3
|
+
UITag,
|
|
4
|
+
UISpace,
|
|
5
|
+
UITypographyText,
|
|
6
|
+
UITooltip,
|
|
7
|
+
UIIcon,
|
|
8
|
+
} from '@kb-labs/studio-ui-kit';
|
|
9
|
+
import type { UITableColumn } from '@kb-labs/studio-ui-kit';
|
|
10
|
+
import type { PluginManifestEntry } from '@kb-labs/studio-data-client';
|
|
11
|
+
|
|
12
|
+
interface PluginTableProps {
|
|
13
|
+
plugins: PluginManifestEntry[];
|
|
14
|
+
onPluginClick: (plugin: PluginManifestEntry) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function PluginTable({ plugins, onPluginClick }: PluginTableProps) {
|
|
18
|
+
const columns: UITableColumn<PluginManifestEntry>[] = [
|
|
19
|
+
{
|
|
20
|
+
title: 'Plugin',
|
|
21
|
+
key: 'id',
|
|
22
|
+
width: 250,
|
|
23
|
+
fixed: 'left',
|
|
24
|
+
render: (_value, record) => {
|
|
25
|
+
const { display } = record.manifest;
|
|
26
|
+
const id = record.manifest.id;
|
|
27
|
+
return (
|
|
28
|
+
<UISpace>
|
|
29
|
+
<span style={{ fontSize: 20 }}>{display?.icon || ''}</span>
|
|
30
|
+
<div>
|
|
31
|
+
<UITypographyText strong>{display?.name || id}</UITypographyText>
|
|
32
|
+
<br />
|
|
33
|
+
<UITypographyText type="secondary" style={{ fontSize: 12 }}>
|
|
34
|
+
{id}
|
|
35
|
+
</UITypographyText>
|
|
36
|
+
</div>
|
|
37
|
+
</UISpace>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: 'Version',
|
|
43
|
+
key: 'version',
|
|
44
|
+
width: 100,
|
|
45
|
+
render: (_value, record) => (
|
|
46
|
+
<UITypographyText code>{record.manifest.version}</UITypographyText>
|
|
47
|
+
),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: 'Description',
|
|
51
|
+
key: 'description',
|
|
52
|
+
ellipsis: true,
|
|
53
|
+
render: (_value, record) => {
|
|
54
|
+
const desc = record.manifest.display?.description;
|
|
55
|
+
return (
|
|
56
|
+
<UITooltip title={desc}>
|
|
57
|
+
<UITypographyText type="secondary">{desc || '--'}</UITypographyText>
|
|
58
|
+
</UITooltip>
|
|
59
|
+
);
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
title: 'CLI',
|
|
64
|
+
key: 'cli',
|
|
65
|
+
width: 80,
|
|
66
|
+
align: 'center',
|
|
67
|
+
render: (_, record) => {
|
|
68
|
+
const count = record.manifest.cli?.commands.length ?? 0;
|
|
69
|
+
return count > 0 ? (
|
|
70
|
+
<UITooltip title={`${count} command${count > 1 ? 's' : ''}`}>
|
|
71
|
+
<UITag icon={<UIIcon name="CodeOutlined" />} color="blue">
|
|
72
|
+
{count}
|
|
73
|
+
</UITag>
|
|
74
|
+
</UITooltip>
|
|
75
|
+
) : (
|
|
76
|
+
<UITypographyText type="secondary">--</UITypographyText>
|
|
77
|
+
);
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: 'REST',
|
|
82
|
+
key: 'rest',
|
|
83
|
+
width: 80,
|
|
84
|
+
align: 'center',
|
|
85
|
+
render: (_, record) => {
|
|
86
|
+
const count = record.manifest.rest?.routes.length ?? 0;
|
|
87
|
+
return count > 0 ? (
|
|
88
|
+
<UITooltip title={`${count} route${count > 1 ? 's' : ''}`}>
|
|
89
|
+
<UITag icon={<UIIcon name="ApiOutlined" />} color="green">
|
|
90
|
+
{count}
|
|
91
|
+
</UITag>
|
|
92
|
+
</UITooltip>
|
|
93
|
+
) : (
|
|
94
|
+
<UITypographyText type="secondary">--</UITypographyText>
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: 'Workflows',
|
|
100
|
+
key: 'workflows',
|
|
101
|
+
width: 100,
|
|
102
|
+
align: 'center',
|
|
103
|
+
render: (_, record) => {
|
|
104
|
+
const count = record.manifest.workflows?.handlers.length ?? 0;
|
|
105
|
+
return count > 0 ? (
|
|
106
|
+
<UITooltip title={`${count} handler${count > 1 ? 's' : ''}`}>
|
|
107
|
+
<UITag icon={<UIIcon name="NodeIndexOutlined" />} color="purple">
|
|
108
|
+
{count}
|
|
109
|
+
</UITag>
|
|
110
|
+
</UITooltip>
|
|
111
|
+
) : (
|
|
112
|
+
<UITypographyText type="secondary">--</UITypographyText>
|
|
113
|
+
);
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
title: 'Jobs',
|
|
118
|
+
key: 'jobs',
|
|
119
|
+
width: 80,
|
|
120
|
+
align: 'center',
|
|
121
|
+
render: (_, record) => {
|
|
122
|
+
const count = record.manifest.jobs?.handlers.length ?? 0;
|
|
123
|
+
return count > 0 ? (
|
|
124
|
+
<UITooltip title={`${count} job${count > 1 ? 's' : ''}`}>
|
|
125
|
+
<UITag icon={<UIIcon name="ClockCircleOutlined" />} color="orange">
|
|
126
|
+
{count}
|
|
127
|
+
</UITag>
|
|
128
|
+
</UITooltip>
|
|
129
|
+
) : (
|
|
130
|
+
<UITypographyText type="secondary">--</UITypographyText>
|
|
131
|
+
);
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
title: 'Flags',
|
|
136
|
+
key: 'flags',
|
|
137
|
+
width: 180,
|
|
138
|
+
render: (_, record) => (
|
|
139
|
+
<UISpace wrap size={4}>
|
|
140
|
+
{record.manifest.permissions && (
|
|
141
|
+
<UITooltip title="Requires permissions">
|
|
142
|
+
<UITag icon={<UIIcon name="WarningOutlined" />} color="gold" style={{ fontSize: 11 }}>
|
|
143
|
+
Perms
|
|
144
|
+
</UITag>
|
|
145
|
+
</UITooltip>
|
|
146
|
+
)}
|
|
147
|
+
{record.manifest.platform?.requires && record.manifest.platform.requires.length > 0 && (
|
|
148
|
+
<UITooltip title={`Requires: ${record.manifest.platform.requires.join(', ')}`}>
|
|
149
|
+
<UITag icon={<UIIcon name="CheckCircleOutlined" />} color="cyan" style={{ fontSize: 11 }}>
|
|
150
|
+
Platform
|
|
151
|
+
</UITag>
|
|
152
|
+
</UITooltip>
|
|
153
|
+
)}
|
|
154
|
+
{record.manifest.display?.tags?.slice(0, 2).map((tag) => (
|
|
155
|
+
<UITag key={tag} style={{ fontSize: 11 }}>
|
|
156
|
+
{tag}
|
|
157
|
+
</UITag>
|
|
158
|
+
))}
|
|
159
|
+
</UISpace>
|
|
160
|
+
),
|
|
161
|
+
},
|
|
162
|
+
];
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<UITable
|
|
166
|
+
columns={columns}
|
|
167
|
+
dataSource={plugins}
|
|
168
|
+
rowKey="pluginId"
|
|
169
|
+
pagination={{
|
|
170
|
+
pageSize: 20,
|
|
171
|
+
}}
|
|
172
|
+
onRow={(record) => ({
|
|
173
|
+
onClick: () => onPluginClick(record),
|
|
174
|
+
style: { cursor: 'pointer' },
|
|
175
|
+
})}
|
|
176
|
+
/>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import {
|
|
4
|
+
UIInputSearch,
|
|
5
|
+
UISpin,
|
|
6
|
+
UIEmptyState,
|
|
7
|
+
UIMessage,
|
|
8
|
+
UIButton,
|
|
9
|
+
UIIcon,
|
|
10
|
+
UIRow,
|
|
11
|
+
UICol,
|
|
12
|
+
UIPage,
|
|
13
|
+
UIPageHeader,
|
|
14
|
+
} from '@kb-labs/studio-ui-kit';
|
|
15
|
+
import { useDataSources } from '@/providers/data-sources-provider';
|
|
16
|
+
import type { PluginManifestEntry } from '@kb-labs/studio-data-client';
|
|
17
|
+
import { MarketplaceCard } from '../components/marketplace-card';
|
|
18
|
+
|
|
19
|
+
type KindFilter = 'all' | 'plugins' | 'adapters';
|
|
20
|
+
type SurfaceFilter = 'all' | 'cli' | 'studio' | 'rest';
|
|
21
|
+
|
|
22
|
+
export function PluginsPage() {
|
|
23
|
+
const navigate = useNavigate();
|
|
24
|
+
const { plugins: pluginsSource } = useDataSources();
|
|
25
|
+
|
|
26
|
+
const [loading, setLoading] = useState(true);
|
|
27
|
+
const [plugins, setPlugins] = useState<PluginManifestEntry[]>([]);
|
|
28
|
+
const [search, setSearch] = useState('');
|
|
29
|
+
const [kindFilter, setKindFilter] = useState<KindFilter>('all');
|
|
30
|
+
const [surfaceFilter, setSurfaceFilter] = useState<SurfaceFilter>('all');
|
|
31
|
+
|
|
32
|
+
const loadPlugins = useCallback(async () => {
|
|
33
|
+
try {
|
|
34
|
+
setLoading(true);
|
|
35
|
+
const result = await pluginsSource.getPlugins();
|
|
36
|
+
setPlugins(result.manifests);
|
|
37
|
+
} catch {
|
|
38
|
+
UIMessage.error('Failed to load marketplace');
|
|
39
|
+
} finally {
|
|
40
|
+
setLoading(false);
|
|
41
|
+
}
|
|
42
|
+
}, [pluginsSource]);
|
|
43
|
+
|
|
44
|
+
useEffect(() => { loadPlugins(); }, [loadPlugins]);
|
|
45
|
+
|
|
46
|
+
const counts = useMemo(() => ({
|
|
47
|
+
all: plugins.length,
|
|
48
|
+
plugins: plugins.length,
|
|
49
|
+
adapters: 0,
|
|
50
|
+
cli: plugins.filter(p => (p.manifest.cli?.commands?.length ?? 0) > 0).length,
|
|
51
|
+
studio: plugins.filter(p => (p.manifest.studio?.pages?.length ?? 0) > 0).length,
|
|
52
|
+
rest: plugins.filter(p => (p.manifest.rest?.routes?.length ?? 0) > 0).length,
|
|
53
|
+
}), [plugins]);
|
|
54
|
+
|
|
55
|
+
const filtered = useMemo(() => {
|
|
56
|
+
return plugins.filter(p => {
|
|
57
|
+
const m = p.manifest;
|
|
58
|
+
if (search) {
|
|
59
|
+
const q = search.toLowerCase();
|
|
60
|
+
const text = [m.id, m.display?.name, m.display?.description, ...(m.display?.tags ?? [])].join(' ').toLowerCase();
|
|
61
|
+
if (!text.includes(q)) {return false;}
|
|
62
|
+
}
|
|
63
|
+
if (surfaceFilter === 'cli' && !((m.cli?.commands?.length ?? 0) > 0)) {return false;}
|
|
64
|
+
if (surfaceFilter === 'studio' && !((m.studio?.pages?.length ?? 0) > 0)) {return false;}
|
|
65
|
+
if (surfaceFilter === 'rest' && !((m.rest?.routes?.length ?? 0) > 0)) {return false;}
|
|
66
|
+
return true;
|
|
67
|
+
});
|
|
68
|
+
}, [plugins, search, surfaceFilter]);
|
|
69
|
+
|
|
70
|
+
const handleClick = (plugin: PluginManifestEntry) => {
|
|
71
|
+
navigate(`/marketplace/${encodeURIComponent(plugin.pluginId)}`);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const kindTabs: { key: KindFilter; label: string; count: number }[] = [
|
|
75
|
+
{ key: 'all', label: 'All', count: counts.all },
|
|
76
|
+
{ key: 'plugins', label: 'Extensions', count: counts.plugins },
|
|
77
|
+
{ key: 'adapters', label: 'Adapters', count: counts.adapters },
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
const surfaceChips: { key: SurfaceFilter; label: string; count: number }[] = [
|
|
81
|
+
{ key: 'cli', label: 'CLI', count: counts.cli },
|
|
82
|
+
{ key: 'studio', label: 'Studio UI', count: counts.studio },
|
|
83
|
+
{ key: 'rest', label: 'REST API', count: counts.rest },
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
if (loading) {
|
|
87
|
+
return (
|
|
88
|
+
<UIPage width="full">
|
|
89
|
+
<div style={{ textAlign: 'center', padding: '80px 0' }}>
|
|
90
|
+
<UISpin size="large" />
|
|
91
|
+
</div>
|
|
92
|
+
</UIPage>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<UIPage width="full">
|
|
98
|
+
<UIPageHeader
|
|
99
|
+
title="Marketplace"
|
|
100
|
+
description={`${counts.all} extension${counts.all !== 1 ? 's' : ''} installed`}
|
|
101
|
+
actions={
|
|
102
|
+
<UIButton variant="primary" icon={<UIIcon name="PlusOutlined" />}>
|
|
103
|
+
Install Extension
|
|
104
|
+
</UIButton>
|
|
105
|
+
}
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
{/* Filters bar */}
|
|
109
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 24, marginBottom: 24, flexWrap: 'wrap' }}>
|
|
110
|
+
|
|
111
|
+
{/* Kind tabs */}
|
|
112
|
+
<div style={{ display: 'flex', gap: 2, background: 'var(--bg-tertiary)', borderRadius: 10, padding: 3 }}>
|
|
113
|
+
{kindTabs.map(tab => (
|
|
114
|
+
<button
|
|
115
|
+
key={tab.key}
|
|
116
|
+
onClick={() => setKindFilter(tab.key)}
|
|
117
|
+
style={{
|
|
118
|
+
display: 'flex', alignItems: 'center', gap: 6,
|
|
119
|
+
padding: '5px 12px', borderRadius: 8, border: 'none', cursor: 'pointer',
|
|
120
|
+
background: kindFilter === tab.key ? 'var(--bg-secondary)' : 'transparent',
|
|
121
|
+
color: kindFilter === tab.key ? 'var(--text-primary)' : 'var(--text-secondary)',
|
|
122
|
+
fontSize: 13, fontWeight: kindFilter === tab.key ? 600 : 400,
|
|
123
|
+
boxShadow: kindFilter === tab.key ? '0 1px 3px rgba(0,0,0,0.08)' : 'none',
|
|
124
|
+
transition: 'all 120ms ease',
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
{tab.label}
|
|
128
|
+
<span style={{
|
|
129
|
+
fontSize: 11, fontWeight: 600,
|
|
130
|
+
color: kindFilter === tab.key ? 'var(--link)' : 'var(--text-tertiary)',
|
|
131
|
+
background: kindFilter === tab.key ? 'rgba(12,102,255,0.10)' : 'transparent',
|
|
132
|
+
borderRadius: 8, padding: '0 5px',
|
|
133
|
+
}}>
|
|
134
|
+
{tab.count}
|
|
135
|
+
</span>
|
|
136
|
+
</button>
|
|
137
|
+
))}
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
{/* Divider */}
|
|
141
|
+
<div style={{ width: 1, height: 20, background: 'var(--border-primary)', flexShrink: 0 }} />
|
|
142
|
+
|
|
143
|
+
{/* Surface chips */}
|
|
144
|
+
<div style={{ display: 'flex', gap: 6 }}>
|
|
145
|
+
{surfaceChips.map(chip => {
|
|
146
|
+
const active = surfaceFilter === chip.key;
|
|
147
|
+
return (
|
|
148
|
+
<button
|
|
149
|
+
key={chip.key}
|
|
150
|
+
onClick={() => setSurfaceFilter(active ? 'all' : chip.key)}
|
|
151
|
+
style={{
|
|
152
|
+
display: 'flex', alignItems: 'center', gap: 5,
|
|
153
|
+
padding: '5px 12px', borderRadius: 20,
|
|
154
|
+
border: `1px solid ${active ? 'var(--link)' : 'var(--border-primary)'}`,
|
|
155
|
+
cursor: 'pointer',
|
|
156
|
+
background: active ? 'rgba(12,102,255,0.08)' : 'transparent',
|
|
157
|
+
color: active ? 'var(--link)' : 'var(--text-secondary)',
|
|
158
|
+
fontSize: 13, fontWeight: active ? 500 : 400,
|
|
159
|
+
transition: 'all 120ms ease',
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
162
|
+
{chip.label}
|
|
163
|
+
<span style={{ fontSize: 11, color: active ? 'var(--link)' : 'var(--text-tertiary)' }}>
|
|
164
|
+
{chip.count}
|
|
165
|
+
</span>
|
|
166
|
+
</button>
|
|
167
|
+
);
|
|
168
|
+
})}
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
{/* Search — pushed to the right */}
|
|
172
|
+
<div style={{ marginLeft: 'auto' }}>
|
|
173
|
+
<UIInputSearch
|
|
174
|
+
placeholder="Search extensions..."
|
|
175
|
+
value={search}
|
|
176
|
+
onChange={e => setSearch(e.target.value)}
|
|
177
|
+
allowClear
|
|
178
|
+
style={{ width: 260 }}
|
|
179
|
+
/>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
{/* Grid */}
|
|
184
|
+
{filtered.length === 0 ? (
|
|
185
|
+
<UIEmptyState
|
|
186
|
+
description={search ? 'No extensions match your search' : 'No extensions found'}
|
|
187
|
+
style={{ marginTop: 48 }}
|
|
188
|
+
/>
|
|
189
|
+
) : (
|
|
190
|
+
<UIRow gutter={[16, 16]}>
|
|
191
|
+
{filtered.map(plugin => (
|
|
192
|
+
<UICol key={plugin.pluginId} xs={24} sm={12} xl={8}>
|
|
193
|
+
<MarketplaceCard plugin={plugin} onClick={() => handleClick(plugin)} />
|
|
194
|
+
</UICol>
|
|
195
|
+
))}
|
|
196
|
+
</UIRow>
|
|
197
|
+
)}
|
|
198
|
+
</UIPage>
|
|
199
|
+
);
|
|
200
|
+
}
|