@nospt/plugin-dev-ai-hub 0.1.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/.eslintrc.js +1 -0
- package/dev/index.tsx +232 -0
- package/dist/api/DevAiHubClient.esm.js +76 -0
- package/dist/api/DevAiHubClient.esm.js.map +1 -0
- package/dist/components/AssetCard/AssetCard.esm.js +194 -0
- package/dist/components/AssetCard/AssetCard.esm.js.map +1 -0
- package/dist/components/AssetDetailPanel/AssetDetailPanel.esm.js +324 -0
- package/dist/components/AssetDetailPanel/AssetDetailPanel.esm.js.map +1 -0
- package/dist/components/AssetFilters/AssetFilters.esm.js +216 -0
- package/dist/components/AssetFilters/AssetFilters.esm.js.map +1 -0
- package/dist/components/AssetInstallDialog/AssetInstallDialog.esm.js +194 -0
- package/dist/components/AssetInstallDialog/AssetInstallDialog.esm.js.map +1 -0
- package/dist/components/DevAiHubPage/DevAiHubPage.esm.js +320 -0
- package/dist/components/DevAiHubPage/DevAiHubPage.esm.js.map +1 -0
- package/dist/components/DevAiHubPage/index.esm.js +6 -0
- package/dist/components/DevAiHubPage/index.esm.js.map +1 -0
- package/dist/components/McpConfigDialog/McpConfigDialog.esm.js +274 -0
- package/dist/components/McpConfigDialog/McpConfigDialog.esm.js.map +1 -0
- package/dist/components/ToolIcon/ToolIcon.esm.js +41 -0
- package/dist/components/ToolIcon/ToolIcon.esm.js.map +1 -0
- package/dist/hooks/index.esm.js +114 -0
- package/dist/hooks/index.esm.js.map +1 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.esm.js +5 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/plugin.esm.js +40 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/pluginLegacy.esm.js +27 -0
- package/dist/pluginLegacy.esm.js.map +1 -0
- package/dist/routes.esm.js +6 -0
- package/dist/routes.esm.js.map +1 -0
- package/package.json +80 -0
- package/package.json-prepack +75 -0
- package/src/api/DevAiHubClient.ts +110 -0
- package/src/components/AssetCard/AssetCard.test.tsx +182 -0
- package/src/components/AssetCard/AssetCard.tsx +221 -0
- package/src/components/AssetCard/index.ts +1 -0
- package/src/components/AssetDetailPanel/AssetDetailPanel.tsx +377 -0
- package/src/components/AssetDetailPanel/index.ts +1 -0
- package/src/components/AssetFilters/AssetFilters.tsx +261 -0
- package/src/components/AssetFilters/index.ts +2 -0
- package/src/components/AssetInstallDialog/AssetInstallDialog.tsx +216 -0
- package/src/components/AssetInstallDialog/index.ts +1 -0
- package/src/components/DevAiHubPage/DevAiHubPage.tsx +346 -0
- package/src/components/DevAiHubPage/index.ts +1 -0
- package/src/components/McpConfigDialog/McpConfigDialog.tsx +301 -0
- package/src/components/McpConfigDialog/index.ts +1 -0
- package/src/components/ToolIcon/ToolIcon.tsx +49 -0
- package/src/components/ToolIcon/index.ts +1 -0
- package/src/hooks/index.ts +152 -0
- package/src/index.ts +10 -0
- package/src/plugin.tsx +47 -0
- package/src/pluginLegacy.ts +42 -0
- package/src/routes.ts +3 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import ReactMarkdown from 'react-markdown';
|
|
4
|
+
import remarkGfm from 'remark-gfm';
|
|
5
|
+
import Alert from '@mui/material/Alert';
|
|
6
|
+
import Box from '@mui/material/Box';
|
|
7
|
+
import Button from '@mui/material/Button';
|
|
8
|
+
import Chip from '@mui/material/Chip';
|
|
9
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
10
|
+
import Divider from '@mui/material/Divider';
|
|
11
|
+
import Drawer from '@mui/material/Drawer';
|
|
12
|
+
import IconButton from '@mui/material/IconButton';
|
|
13
|
+
import Link from '@mui/material/Link';
|
|
14
|
+
import Snackbar from '@mui/material/Snackbar';
|
|
15
|
+
import Tab from '@mui/material/Tab';
|
|
16
|
+
import Tabs from '@mui/material/Tabs';
|
|
17
|
+
import Typography from '@mui/material/Typography';
|
|
18
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
19
|
+
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
|
20
|
+
import FolderZipIcon from '@mui/icons-material/FolderZip';
|
|
21
|
+
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
|
22
|
+
import { useAssetDetail } from '../../hooks/index.esm.js';
|
|
23
|
+
|
|
24
|
+
const SyntaxHighlighter = require("react-syntax-highlighter/dist/esm/prism").default;
|
|
25
|
+
const { oneLight } = require("react-syntax-highlighter/dist/esm/styles/prism");
|
|
26
|
+
const TYPE_COLORS = {
|
|
27
|
+
instruction: "#1976d2",
|
|
28
|
+
agent: "#7b1fa2",
|
|
29
|
+
skill: "#388e3c",
|
|
30
|
+
workflow: "#f57c00"
|
|
31
|
+
};
|
|
32
|
+
function AssetDetailPanel({ assetId, onClose }) {
|
|
33
|
+
const [tab, setTab] = useState(0);
|
|
34
|
+
const [snackbar, setSnackbar] = useState(null);
|
|
35
|
+
const { asset, loading } = useAssetDetail(assetId);
|
|
36
|
+
const handleCopy = () => {
|
|
37
|
+
if (!asset) return;
|
|
38
|
+
navigator.clipboard.writeText(asset.content).then(
|
|
39
|
+
() => setSnackbar("Markdown copied to clipboard!")
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
Drawer,
|
|
45
|
+
{
|
|
46
|
+
anchor: "right",
|
|
47
|
+
open: !!assetId,
|
|
48
|
+
onClose,
|
|
49
|
+
PaperProps: { sx: { width: { xs: "100vw", md: 640 } } },
|
|
50
|
+
children: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
51
|
+
/* @__PURE__ */ jsxs(
|
|
52
|
+
Box,
|
|
53
|
+
{
|
|
54
|
+
sx: {
|
|
55
|
+
p: 2,
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "flex-start",
|
|
58
|
+
gap: 2,
|
|
59
|
+
borderBottom: 1,
|
|
60
|
+
borderColor: "divider"
|
|
61
|
+
},
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsx(Box, { sx: { flex: 1 }, children: loading || !asset ? /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
64
|
+
/* @__PURE__ */ jsx(CircularProgress, { size: 16 }),
|
|
65
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: "Loading..." })
|
|
66
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1, mb: 0.5 }, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", fontWeight: 700, children: asset.name }),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
Chip,
|
|
71
|
+
{
|
|
72
|
+
label: asset.type,
|
|
73
|
+
size: "small",
|
|
74
|
+
sx: {
|
|
75
|
+
backgroundColor: `${TYPE_COLORS[asset.type]}20`,
|
|
76
|
+
color: TYPE_COLORS[asset.type],
|
|
77
|
+
fontWeight: 600
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: asset.description })
|
|
83
|
+
] }) }),
|
|
84
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: onClose, size: "small", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsxs(
|
|
89
|
+
Tabs,
|
|
90
|
+
{
|
|
91
|
+
value: tab,
|
|
92
|
+
onChange: (_, v) => setTab(v),
|
|
93
|
+
sx: { borderBottom: 1, borderColor: "divider", px: 2 },
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx(Tab, { label: "Preview" }),
|
|
96
|
+
/* @__PURE__ */ jsx(Tab, { label: "Metadata" }),
|
|
97
|
+
/* @__PURE__ */ jsx(Tab, { label: "Raw YAML" })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flex: 1, overflow: "auto", p: 2 }, children: [
|
|
102
|
+
loading && /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center", pt: 4 }, children: /* @__PURE__ */ jsx(CircularProgress, {}) }),
|
|
103
|
+
!loading && asset && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
104
|
+
tab === 0 && /* @__PURE__ */ jsx(
|
|
105
|
+
Box,
|
|
106
|
+
{
|
|
107
|
+
sx: {
|
|
108
|
+
"& h1,h2,h3,h4,h5,h6": { mt: 2, mb: 1, fontWeight: 700 },
|
|
109
|
+
"& p": { mb: 1, lineHeight: 1.7 },
|
|
110
|
+
"& ul, & ol": { pl: 2.5, mb: 1 },
|
|
111
|
+
"& li": { mb: 0.5 },
|
|
112
|
+
"& blockquote": {
|
|
113
|
+
borderLeft: "3px solid",
|
|
114
|
+
borderColor: "primary.main",
|
|
115
|
+
pl: 1.5,
|
|
116
|
+
color: "text.secondary",
|
|
117
|
+
my: 1,
|
|
118
|
+
ml: 0
|
|
119
|
+
},
|
|
120
|
+
"& table": { width: "100%", borderCollapse: "collapse", mb: 1 },
|
|
121
|
+
"& th, & td": {
|
|
122
|
+
border: "1px solid",
|
|
123
|
+
borderColor: "divider",
|
|
124
|
+
px: 1.5,
|
|
125
|
+
py: 0.75,
|
|
126
|
+
fontSize: "0.875rem"
|
|
127
|
+
},
|
|
128
|
+
"& th": { backgroundColor: "action.hover", fontWeight: 700 },
|
|
129
|
+
"& code": {
|
|
130
|
+
bgcolor: "action.hover",
|
|
131
|
+
px: 0.5,
|
|
132
|
+
py: 0.2,
|
|
133
|
+
borderRadius: 0.5,
|
|
134
|
+
fontFamily: "monospace",
|
|
135
|
+
fontSize: "0.875em"
|
|
136
|
+
},
|
|
137
|
+
"& pre code": { bgcolor: "transparent", px: 0, py: 0 }
|
|
138
|
+
},
|
|
139
|
+
children: /* @__PURE__ */ jsx(
|
|
140
|
+
ReactMarkdown,
|
|
141
|
+
{
|
|
142
|
+
remarkPlugins: [remarkGfm],
|
|
143
|
+
components: {
|
|
144
|
+
pre: ({ children }) => /* @__PURE__ */ jsx(Box, { sx: { my: 1 }, children }),
|
|
145
|
+
code({ className, children }) {
|
|
146
|
+
const match = /language-(\w+)/.exec(className || "");
|
|
147
|
+
const code = String(children).replace(/\n$/, "");
|
|
148
|
+
const isBlock = code.includes("\n") || !!match;
|
|
149
|
+
return isBlock ? /* @__PURE__ */ jsx(
|
|
150
|
+
SyntaxHighlighter,
|
|
151
|
+
{
|
|
152
|
+
style: oneLight,
|
|
153
|
+
language: match?.[1] ?? "text",
|
|
154
|
+
PreTag: "div",
|
|
155
|
+
customStyle: {
|
|
156
|
+
borderRadius: 8,
|
|
157
|
+
fontSize: "0.8rem",
|
|
158
|
+
margin: 0,
|
|
159
|
+
border: "1px solid rgba(0,0,0,0.08)"
|
|
160
|
+
},
|
|
161
|
+
children: code
|
|
162
|
+
}
|
|
163
|
+
) : /* @__PURE__ */ jsx("code", { className, children });
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
children: asset.content
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
tab === 1 && /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
172
|
+
/* @__PURE__ */ jsx(MetaRow, { label: "Author", value: asset.author }),
|
|
173
|
+
/* @__PURE__ */ jsx(MetaRow, { label: "Version", value: asset.version }),
|
|
174
|
+
/* @__PURE__ */ jsx(MetaRow, { label: "Provider", value: asset.providerId }),
|
|
175
|
+
asset.commitSha && /* @__PURE__ */ jsx(MetaRow, { label: "Commit", value: asset.commitSha.slice(0, 8) }),
|
|
176
|
+
/* @__PURE__ */ jsx(MetaRow, { label: "Last synced", value: new Date(asset.syncedAt).toLocaleString() }),
|
|
177
|
+
/* @__PURE__ */ jsx(MetaRow, { label: "Branch", value: asset.branch }),
|
|
178
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
179
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
180
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Compatible tools" }),
|
|
181
|
+
/* @__PURE__ */ jsx(Box, { sx: { display: "flex", gap: 1, mt: 0.5 }, children: asset.tools.map((t) => /* @__PURE__ */ jsx(Chip, { label: t, size: "small" }, t)) })
|
|
182
|
+
] }),
|
|
183
|
+
asset.tags.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
|
|
184
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Tags" }),
|
|
185
|
+
/* @__PURE__ */ jsx(Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.5 }, children: asset.tags.map((t) => /* @__PURE__ */ jsx(Chip, { label: t, size: "small", variant: "outlined" }, t)) })
|
|
186
|
+
] }),
|
|
187
|
+
asset.type === "skill" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
188
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
189
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
190
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.75, mb: 0.5 }, children: [
|
|
191
|
+
/* @__PURE__ */ jsx(FolderZipIcon, { sx: { fontSize: "0.85rem", color: "text.secondary" } }),
|
|
192
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Bundled files" })
|
|
193
|
+
] }),
|
|
194
|
+
asset.resourcesContent && Object.keys(asset.resourcesContent).length > 0 ? /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", gap: 0.5, mt: 0.5 }, children: [
|
|
195
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap" }, children: [
|
|
196
|
+
/* @__PURE__ */ jsx(
|
|
197
|
+
Chip,
|
|
198
|
+
{
|
|
199
|
+
label: "SKILL.md",
|
|
200
|
+
size: "small",
|
|
201
|
+
sx: { fontFamily: "monospace", fontSize: "0.7rem", height: 20 }
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
Object.keys(asset.resourcesContent).map((p) => /* @__PURE__ */ jsx(
|
|
205
|
+
Chip,
|
|
206
|
+
{
|
|
207
|
+
label: p,
|
|
208
|
+
size: "small",
|
|
209
|
+
variant: "outlined",
|
|
210
|
+
sx: { fontFamily: "monospace", fontSize: "0.7rem", height: 20 }
|
|
211
|
+
},
|
|
212
|
+
p
|
|
213
|
+
))
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.disabled", children: "Downloads as .zip containing all files above." })
|
|
216
|
+
] }) : /* @__PURE__ */ jsx(Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.5 }, children: /* @__PURE__ */ jsx(
|
|
217
|
+
Chip,
|
|
218
|
+
{
|
|
219
|
+
label: "SKILL.md",
|
|
220
|
+
size: "small",
|
|
221
|
+
sx: { fontFamily: "monospace", fontSize: "0.7rem", height: 20 }
|
|
222
|
+
}
|
|
223
|
+
) })
|
|
224
|
+
] })
|
|
225
|
+
] }),
|
|
226
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
227
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
228
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Repository" }),
|
|
229
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(
|
|
230
|
+
Link,
|
|
231
|
+
{
|
|
232
|
+
href: asset.repoUrl,
|
|
233
|
+
target: "_blank",
|
|
234
|
+
rel: "noopener noreferrer",
|
|
235
|
+
variant: "body2",
|
|
236
|
+
children: [
|
|
237
|
+
asset.repoUrl,
|
|
238
|
+
" ",
|
|
239
|
+
/* @__PURE__ */ jsx(OpenInNewIcon, { sx: { fontSize: 12 } })
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
) })
|
|
243
|
+
] })
|
|
244
|
+
] }),
|
|
245
|
+
tab === 2 && /* @__PURE__ */ jsx(
|
|
246
|
+
Box,
|
|
247
|
+
{
|
|
248
|
+
component: "pre",
|
|
249
|
+
sx: {
|
|
250
|
+
bgcolor: "action.hover",
|
|
251
|
+
p: 2,
|
|
252
|
+
borderRadius: 1,
|
|
253
|
+
overflow: "auto",
|
|
254
|
+
fontSize: "0.8rem",
|
|
255
|
+
fontFamily: "monospace",
|
|
256
|
+
whiteSpace: "pre-wrap",
|
|
257
|
+
wordBreak: "break-word",
|
|
258
|
+
border: "1px solid",
|
|
259
|
+
borderColor: "divider"
|
|
260
|
+
},
|
|
261
|
+
children: asset.yamlRaw
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
] })
|
|
265
|
+
] }),
|
|
266
|
+
/* @__PURE__ */ jsxs(
|
|
267
|
+
Box,
|
|
268
|
+
{
|
|
269
|
+
sx: {
|
|
270
|
+
p: 2,
|
|
271
|
+
borderTop: 1,
|
|
272
|
+
borderColor: "divider",
|
|
273
|
+
display: "flex",
|
|
274
|
+
gap: 1,
|
|
275
|
+
flexWrap: "wrap"
|
|
276
|
+
},
|
|
277
|
+
children: [
|
|
278
|
+
/* @__PURE__ */ jsx(
|
|
279
|
+
Button,
|
|
280
|
+
{
|
|
281
|
+
variant: "contained",
|
|
282
|
+
startIcon: /* @__PURE__ */ jsx(ContentCopyIcon, {}),
|
|
283
|
+
onClick: handleCopy,
|
|
284
|
+
disabled: !asset,
|
|
285
|
+
children: "Copy Markdown"
|
|
286
|
+
}
|
|
287
|
+
),
|
|
288
|
+
/* @__PURE__ */ jsx(
|
|
289
|
+
Button,
|
|
290
|
+
{
|
|
291
|
+
variant: "outlined",
|
|
292
|
+
startIcon: /* @__PURE__ */ jsx(OpenInNewIcon, {}),
|
|
293
|
+
onClick: () => asset && window.open(asset.repoUrl, "_blank"),
|
|
294
|
+
disabled: !asset,
|
|
295
|
+
children: "Open in Repo"
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
] })
|
|
302
|
+
}
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ jsx(
|
|
305
|
+
Snackbar,
|
|
306
|
+
{
|
|
307
|
+
open: !!snackbar,
|
|
308
|
+
autoHideDuration: 2500,
|
|
309
|
+
onClose: () => setSnackbar(null),
|
|
310
|
+
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
311
|
+
children: /* @__PURE__ */ jsx(Alert, { severity: "success", onClose: () => setSnackbar(null), children: snackbar })
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
] });
|
|
315
|
+
}
|
|
316
|
+
function MetaRow({ label, value }) {
|
|
317
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
318
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: label }),
|
|
319
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", children: value })
|
|
320
|
+
] });
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export { AssetDetailPanel };
|
|
324
|
+
//# sourceMappingURL=AssetDetailPanel.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetDetailPanel.esm.js","sources":["../../../src/components/AssetDetailPanel/AssetDetailPanel.tsx"],"sourcesContent":["import { useState } from 'react';\nimport ReactMarkdown from 'react-markdown';\nimport remarkGfm from 'remark-gfm';\nimport Alert from '@mui/material/Alert';\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport Chip from '@mui/material/Chip';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport Divider from '@mui/material/Divider';\nimport Drawer from '@mui/material/Drawer';\nimport IconButton from '@mui/material/IconButton';\nimport Link from '@mui/material/Link';\nimport Snackbar from '@mui/material/Snackbar';\nimport Tab from '@mui/material/Tab';\nimport Tabs from '@mui/material/Tabs';\nimport Typography from '@mui/material/Typography';\nimport CloseIcon from '@mui/icons-material/Close';\nimport ContentCopyIcon from '@mui/icons-material/ContentCopy';\nimport FolderZipIcon from '@mui/icons-material/FolderZip';\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport type { AssetType } from '@nospt/plugin-dev-ai-hub-common';\nimport { useAssetDetail } from '../../hooks';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst SyntaxHighlighter = require('react-syntax-highlighter/dist/esm/prism').default;\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst { oneLight } = require('react-syntax-highlighter/dist/esm/styles/prism');\n\nconst TYPE_COLORS: Record<AssetType, string> = {\n instruction: '#1976d2',\n agent: '#7b1fa2',\n skill: '#388e3c',\n workflow: '#f57c00',\n};\n\ninterface AssetDetailPanelProps {\n assetId: string | null;\n onClose: () => void;\n}\n\nexport function AssetDetailPanel({ assetId, onClose }: AssetDetailPanelProps) {\n const [tab, setTab] = useState(0);\n const [snackbar, setSnackbar] = useState<string | null>(null);\n const { asset, loading } = useAssetDetail(assetId);\n\n const handleCopy = () => {\n if (!asset) return;\n navigator.clipboard.writeText(asset.content).then(() =>\n setSnackbar('Markdown copied to clipboard!'),\n );\n };\n\n return (\n <>\n <Drawer\n anchor=\"right\"\n open={!!assetId}\n onClose={onClose}\n PaperProps={{ sx: { width: { xs: '100vw', md: 640 } } }}\n >\n <Box sx={{ display: 'flex', flexDirection: 'column', height: '100%' }}>\n {/* Header */}\n <Box\n sx={{\n p: 2,\n display: 'flex',\n alignItems: 'flex-start',\n gap: 2,\n borderBottom: 1,\n borderColor: 'divider',\n }}\n >\n <Box sx={{ flex: 1 }}>\n {loading || !asset ? (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>\n <CircularProgress size={16} />\n <Typography variant=\"body2\" color=\"text.secondary\">\n Loading...\n </Typography>\n </Box>\n ) : (\n <>\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>\n <Typography variant=\"h6\" fontWeight={700}>\n {asset.name}\n </Typography>\n <Chip\n label={asset.type}\n size=\"small\"\n sx={{\n backgroundColor: `${TYPE_COLORS[asset.type]}20`,\n color: TYPE_COLORS[asset.type],\n fontWeight: 600,\n }}\n />\n </Box>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {asset.description}\n </Typography>\n </>\n )}\n </Box>\n <IconButton onClick={onClose} size=\"small\">\n <CloseIcon />\n </IconButton>\n </Box>\n\n {/* Tabs */}\n <Tabs\n value={tab}\n onChange={(_, v) => setTab(v)}\n sx={{ borderBottom: 1, borderColor: 'divider', px: 2 }}\n >\n <Tab label=\"Preview\" />\n <Tab label=\"Metadata\" />\n <Tab label=\"Raw YAML\" />\n </Tabs>\n\n {/* Content */}\n <Box sx={{ flex: 1, overflow: 'auto', p: 2 }}>\n {loading && (\n <Box sx={{ display: 'flex', justifyContent: 'center', pt: 4 }}>\n <CircularProgress />\n </Box>\n )}\n\n {!loading && asset && (\n <>\n {tab === 0 && (\n <Box\n sx={{\n '& h1,h2,h3,h4,h5,h6': { mt: 2, mb: 1, fontWeight: 700 },\n '& p': { mb: 1, lineHeight: 1.7 },\n '& ul, & ol': { pl: 2.5, mb: 1 },\n '& li': { mb: 0.5 },\n '& blockquote': {\n borderLeft: '3px solid',\n borderColor: 'primary.main',\n pl: 1.5,\n color: 'text.secondary',\n my: 1,\n ml: 0,\n },\n '& table': { width: '100%', borderCollapse: 'collapse', mb: 1 },\n '& th, & td': {\n border: '1px solid',\n borderColor: 'divider',\n px: 1.5,\n py: 0.75,\n fontSize: '0.875rem',\n },\n '& th': { backgroundColor: 'action.hover', fontWeight: 700 },\n '& code': {\n bgcolor: 'action.hover',\n px: 0.5,\n py: 0.2,\n borderRadius: 0.5,\n fontFamily: 'monospace',\n fontSize: '0.875em',\n },\n '& pre code': { bgcolor: 'transparent', px: 0, py: 0 },\n }}\n >\n <ReactMarkdown\n remarkPlugins={[remarkGfm]}\n components={{\n pre: ({ children }) => <Box sx={{ my: 1 }}>{children}</Box>,\n code({ className, children }) {\n const match = /language-(\\w+)/.exec(className || '');\n const code = String(children).replace(/\\n$/, '');\n const isBlock = code.includes('\\n') || !!match;\n return isBlock ? (\n <SyntaxHighlighter\n style={oneLight}\n language={match?.[1] ?? 'text'}\n PreTag=\"div\"\n customStyle={{\n borderRadius: 8,\n fontSize: '0.8rem',\n margin: 0,\n border: '1px solid rgba(0,0,0,0.08)',\n }}\n >\n {code}\n </SyntaxHighlighter>\n ) : (\n <code className={className}>{children}</code>\n );\n },\n }}\n >\n {asset.content}\n </ReactMarkdown>\n </Box>\n )}\n\n {tab === 1 && (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n <MetaRow label=\"Author\" value={asset.author} />\n <MetaRow label=\"Version\" value={asset.version} />\n <MetaRow label=\"Provider\" value={asset.providerId} />\n {asset.commitSha && (\n <MetaRow label=\"Commit\" value={asset.commitSha.slice(0, 8)} />\n )}\n <MetaRow label=\"Last synced\" value={new Date(asset.syncedAt).toLocaleString()} />\n <MetaRow label=\"Branch\" value={asset.branch} />\n\n <Divider />\n\n <Box>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Compatible tools\n </Typography>\n <Box sx={{ display: 'flex', gap: 1, mt: 0.5 }}>\n {asset.tools.map(t => (\n <Chip key={t} label={t} size=\"small\" />\n ))}\n </Box>\n </Box>\n\n {asset.tags.length > 0 && (\n <Box>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Tags\n </Typography>\n <Box sx={{ display: 'flex', gap: 0.5, flexWrap: 'wrap', mt: 0.5 }}>\n {asset.tags.map(t => (\n <Chip key={t} label={t} size=\"small\" variant=\"outlined\" />\n ))}\n </Box>\n </Box>\n )}\n\n {asset.type === 'skill' && (\n <>\n <Divider />\n <Box>\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75, mb: 0.5 }}>\n <FolderZipIcon sx={{ fontSize: '0.85rem', color: 'text.secondary' }} />\n <Typography variant=\"caption\" color=\"text.secondary\">\n Bundled files\n </Typography>\n </Box>\n {asset.resourcesContent && Object.keys(asset.resourcesContent).length > 0 ? (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5, mt: 0.5 }}>\n <Box sx={{ display: 'flex', gap: 0.5, flexWrap: 'wrap' }}>\n <Chip\n label=\"SKILL.md\"\n size=\"small\"\n sx={{ fontFamily: 'monospace', fontSize: '0.7rem', height: 20 }}\n />\n {Object.keys(asset.resourcesContent).map(p => (\n <Chip\n key={p}\n label={p}\n size=\"small\"\n variant=\"outlined\"\n sx={{ fontFamily: 'monospace', fontSize: '0.7rem', height: 20 }}\n />\n ))}\n </Box>\n <Typography variant=\"caption\" color=\"text.disabled\">\n Downloads as .zip containing all files above.\n </Typography>\n </Box>\n ) : (\n <Box sx={{ display: 'flex', gap: 0.5, flexWrap: 'wrap', mt: 0.5 }}>\n <Chip\n label=\"SKILL.md\"\n size=\"small\"\n sx={{ fontFamily: 'monospace', fontSize: '0.7rem', height: 20 }}\n />\n </Box>\n )}\n </Box>\n </>\n )}\n\n <Divider />\n\n <Box>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Repository\n </Typography>\n <Box>\n <Link\n href={asset.repoUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n variant=\"body2\"\n >\n {asset.repoUrl} <OpenInNewIcon sx={{ fontSize: 12 }} />\n </Link>\n </Box>\n </Box>\n </Box>\n )}\n\n {tab === 2 && (\n <Box\n component=\"pre\"\n sx={{\n bgcolor: 'action.hover',\n p: 2,\n borderRadius: 1,\n overflow: 'auto',\n fontSize: '0.8rem',\n fontFamily: 'monospace',\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-word',\n border: '1px solid',\n borderColor: 'divider',\n }}\n >\n {asset.yamlRaw}\n </Box>\n )}\n </>\n )}\n </Box>\n\n {/* Actions */}\n <Box\n sx={{\n p: 2,\n borderTop: 1,\n borderColor: 'divider',\n display: 'flex',\n gap: 1,\n flexWrap: 'wrap',\n }}\n >\n <Button\n variant=\"contained\"\n startIcon={<ContentCopyIcon />}\n onClick={handleCopy}\n disabled={!asset}\n >\n Copy Markdown\n </Button>\n\n <Button\n variant=\"outlined\"\n startIcon={<OpenInNewIcon />}\n onClick={() => asset && window.open(asset.repoUrl, '_blank')}\n disabled={!asset}\n >\n Open in Repo\n </Button>\n </Box>\n </Box>\n </Drawer>\n\n <Snackbar\n open={!!snackbar}\n autoHideDuration={2500}\n onClose={() => setSnackbar(null)}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}\n >\n <Alert severity=\"success\" onClose={() => setSnackbar(null)}>\n {snackbar}\n </Alert>\n </Snackbar>\n </>\n );\n}\n\nfunction MetaRow({ label, value }: { label: string; value: string }) {\n return (\n <Box>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {label}\n </Typography>\n <Typography variant=\"body2\">{value}</Typography>\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,iBAAA,GAAoB,OAAA,CAAQ,yCAAyC,CAAA,CAAE,OAAA;AAE7E,MAAM,EAAE,QAAA,EAAS,GAAI,OAAA,CAAQ,gDAAgD,CAAA;AAE7E,MAAM,WAAA,GAAyC;AAAA,EAC7C,WAAA,EAAa,SAAA;AAAA,EACb,KAAA,EAAO,SAAA;AAAA,EACP,KAAA,EAAO,SAAA;AAAA,EACP,QAAA,EAAU;AACZ,CAAA;AAOO,SAAS,gBAAA,CAAiB,EAAE,OAAA,EAAS,OAAA,EAAQ,EAA0B;AAC5E,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAI,SAAS,CAAC,CAAA;AAChC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CA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EJ;AAEA,SAAS,OAAA,CAAQ,EAAE,KAAA,EAAO,KAAA,EAAM,EAAqC;AACnE,EAAA,4BACG,GAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,SAAA,EAAU,KAAA,EAAM,kBACjC,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,oBACA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EAAS,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EACrC,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import Chip from '@mui/material/Chip';
|
|
4
|
+
import InputAdornment from '@mui/material/InputAdornment';
|
|
5
|
+
import TextField from '@mui/material/TextField';
|
|
6
|
+
import Typography from '@mui/material/Typography';
|
|
7
|
+
import SearchIcon from '@mui/icons-material/Search';
|
|
8
|
+
import StorageIcon from '@mui/icons-material/Storage';
|
|
9
|
+
import ArticleIcon from '@mui/icons-material/Article';
|
|
10
|
+
import SmartToyIcon from '@mui/icons-material/SmartToy';
|
|
11
|
+
import BuildIcon from '@mui/icons-material/Build';
|
|
12
|
+
import AccountTreeIcon from '@mui/icons-material/AccountTree';
|
|
13
|
+
import AppsIcon from '@mui/icons-material/Apps';
|
|
14
|
+
import { ToolIcon } from '../ToolIcon/ToolIcon.esm.js';
|
|
15
|
+
|
|
16
|
+
const ASSET_TYPES = [
|
|
17
|
+
{ value: "all", label: "All", color: "#64748b", Icon: AppsIcon },
|
|
18
|
+
{ value: "instruction", label: "Instructions", color: "#2563EB", Icon: ArticleIcon },
|
|
19
|
+
{ value: "agent", label: "Agents", color: "#7C3AED", Icon: SmartToyIcon },
|
|
20
|
+
{ value: "skill", label: "Skills", color: "#059669", Icon: BuildIcon },
|
|
21
|
+
{ value: "workflow", label: "Workflows", color: "#D97706", Icon: AccountTreeIcon }
|
|
22
|
+
];
|
|
23
|
+
const AI_TOOLS = [
|
|
24
|
+
{ value: "all", label: "All Tools" },
|
|
25
|
+
{ value: "claude-code", label: "Claude Code" },
|
|
26
|
+
{ value: "github-copilot", label: "GitHub Copilot" },
|
|
27
|
+
{ value: "google-gemini", label: "Google Gemini" },
|
|
28
|
+
{ value: "cursor", label: "Cursor" }
|
|
29
|
+
];
|
|
30
|
+
function AssetFilters({ value, onChange, availableTags = [], providers }) {
|
|
31
|
+
const selectedType = value.types.length === 1 ? value.types[0] : "all";
|
|
32
|
+
const selectedTool = value.tools.length === 1 ? value.tools[0] : "all";
|
|
33
|
+
const showProviderFilter = providers && providers.length > 1;
|
|
34
|
+
const handleTypeClick = (type) => {
|
|
35
|
+
onChange({ ...value, types: type === "all" ? [] : [type] });
|
|
36
|
+
};
|
|
37
|
+
const handleToolClick = (tool) => {
|
|
38
|
+
onChange({ ...value, tools: tool === "all" ? [] : [tool] });
|
|
39
|
+
};
|
|
40
|
+
const handleTagToggle = (tag) => {
|
|
41
|
+
const next = value.tags.includes(tag) ? value.tags.filter((t) => t !== tag) : [...value.tags, tag];
|
|
42
|
+
onChange({ ...value, tags: next });
|
|
43
|
+
};
|
|
44
|
+
const handleProviderClick = (id) => {
|
|
45
|
+
onChange({ ...value, providerId: id });
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", gap: 2, mb: 3 }, children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
TextField,
|
|
50
|
+
{
|
|
51
|
+
fullWidth: true,
|
|
52
|
+
size: "small",
|
|
53
|
+
placeholder: "Search assets by name, description or content\u2026",
|
|
54
|
+
value: value.search,
|
|
55
|
+
onChange: (e) => onChange({ ...value, search: e.target.value }),
|
|
56
|
+
InputProps: {
|
|
57
|
+
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx(SearchIcon, { fontSize: "small" }) })
|
|
58
|
+
},
|
|
59
|
+
sx: {
|
|
60
|
+
"& .MuiOutlinedInput-root": {
|
|
61
|
+
borderRadius: 2
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 3, flexWrap: "wrap", alignItems: "flex-start" }, children: [
|
|
67
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 600, color: "text.secondary", sx: { mb: 1, display: "block", textTransform: "uppercase", letterSpacing: 0.5 }, children: "Type" }),
|
|
69
|
+
/* @__PURE__ */ jsx(Box, { sx: { display: "flex", gap: 0.75, flexWrap: "wrap" }, children: ASSET_TYPES.map((t) => {
|
|
70
|
+
const isSelected = selectedType === t.value;
|
|
71
|
+
const TypeIcon = t.Icon;
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
Chip,
|
|
74
|
+
{
|
|
75
|
+
icon: /* @__PURE__ */ jsx(TypeIcon, { sx: { fontSize: "0.9rem !important", color: isSelected ? "#fff !important" : t.color } }),
|
|
76
|
+
label: t.label,
|
|
77
|
+
size: "small",
|
|
78
|
+
clickable: true,
|
|
79
|
+
onClick: () => handleTypeClick(t.value),
|
|
80
|
+
sx: {
|
|
81
|
+
fontWeight: 600,
|
|
82
|
+
fontSize: "0.75rem",
|
|
83
|
+
borderRadius: 2,
|
|
84
|
+
border: "1.5px solid",
|
|
85
|
+
borderColor: isSelected ? t.color : `${t.color}60`,
|
|
86
|
+
backgroundColor: isSelected ? t.color : "transparent",
|
|
87
|
+
color: isSelected ? "#fff" : t.color,
|
|
88
|
+
transition: "all 0.15s ease",
|
|
89
|
+
"&:hover": {
|
|
90
|
+
backgroundColor: isSelected ? t.color : `${t.color}18`,
|
|
91
|
+
borderColor: t.color
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
t.value
|
|
96
|
+
);
|
|
97
|
+
}) })
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
100
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 600, color: "text.secondary", sx: { mb: 1, display: "block", textTransform: "uppercase", letterSpacing: 0.5 }, children: "AI Tool" }),
|
|
101
|
+
/* @__PURE__ */ jsx(Box, { sx: { display: "flex", gap: 0.75, flexWrap: "wrap" }, children: AI_TOOLS.map((t) => {
|
|
102
|
+
const isSelected = selectedTool === t.value;
|
|
103
|
+
const iconEl = t.value !== "all" ? /* @__PURE__ */ jsx(ToolIcon, { tool: t.value, branded: !isSelected, sx: { fontSize: "0.85rem !important", color: isSelected ? "background.paper" : "inherit" } }) : void 0;
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
Chip,
|
|
106
|
+
{
|
|
107
|
+
icon: iconEl,
|
|
108
|
+
label: t.label,
|
|
109
|
+
size: "small",
|
|
110
|
+
clickable: true,
|
|
111
|
+
onClick: () => handleToolClick(t.value),
|
|
112
|
+
sx: {
|
|
113
|
+
fontWeight: 600,
|
|
114
|
+
fontSize: "0.75rem",
|
|
115
|
+
borderRadius: 2,
|
|
116
|
+
border: "1.5px solid",
|
|
117
|
+
borderColor: isSelected ? "text.primary" : "divider",
|
|
118
|
+
backgroundColor: isSelected ? "text.primary" : "transparent",
|
|
119
|
+
color: isSelected ? "background.paper" : "text.secondary",
|
|
120
|
+
transition: "all 0.15s ease",
|
|
121
|
+
"&:hover": {
|
|
122
|
+
borderColor: "text.primary",
|
|
123
|
+
backgroundColor: isSelected ? "text.primary" : "action.hover"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
t.value
|
|
128
|
+
);
|
|
129
|
+
}) })
|
|
130
|
+
] }),
|
|
131
|
+
showProviderFilter && /* @__PURE__ */ jsxs(Box, { children: [
|
|
132
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 600, color: "text.secondary", sx: { mb: 1, display: "block", textTransform: "uppercase", letterSpacing: 0.5 }, children: "Provider" }),
|
|
133
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 0.75, flexWrap: "wrap" }, children: [
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
Chip,
|
|
136
|
+
{
|
|
137
|
+
icon: /* @__PURE__ */ jsx(AppsIcon, { sx: { fontSize: "0.9rem !important" } }),
|
|
138
|
+
label: "All",
|
|
139
|
+
size: "small",
|
|
140
|
+
clickable: true,
|
|
141
|
+
onClick: () => handleProviderClick(void 0),
|
|
142
|
+
sx: {
|
|
143
|
+
fontWeight: 600,
|
|
144
|
+
fontSize: "0.75rem",
|
|
145
|
+
borderRadius: 2,
|
|
146
|
+
border: "1.5px solid",
|
|
147
|
+
borderColor: !value.providerId ? "text.primary" : "divider",
|
|
148
|
+
backgroundColor: !value.providerId ? "text.primary" : "transparent",
|
|
149
|
+
color: !value.providerId ? "background.paper" : "text.secondary",
|
|
150
|
+
transition: "all 0.15s ease",
|
|
151
|
+
"&:hover": {
|
|
152
|
+
borderColor: "text.primary",
|
|
153
|
+
backgroundColor: !value.providerId ? "text.primary" : "action.hover"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
providers.map((p) => {
|
|
159
|
+
const isSelected = value.providerId === p.id;
|
|
160
|
+
const label = p.target.split("/").slice(-1)[0]?.replace(/\.git$/, "") ?? p.id;
|
|
161
|
+
return /* @__PURE__ */ jsx(
|
|
162
|
+
Chip,
|
|
163
|
+
{
|
|
164
|
+
icon: /* @__PURE__ */ jsx(StorageIcon, { sx: { fontSize: "0.85rem !important", color: isSelected ? "background.paper" : "inherit" } }),
|
|
165
|
+
label,
|
|
166
|
+
size: "small",
|
|
167
|
+
clickable: true,
|
|
168
|
+
onClick: () => handleProviderClick(p.id),
|
|
169
|
+
sx: {
|
|
170
|
+
fontWeight: 600,
|
|
171
|
+
fontSize: "0.75rem",
|
|
172
|
+
borderRadius: 2,
|
|
173
|
+
border: "1.5px solid",
|
|
174
|
+
borderColor: isSelected ? "text.primary" : "divider",
|
|
175
|
+
backgroundColor: isSelected ? "text.primary" : "transparent",
|
|
176
|
+
color: isSelected ? "background.paper" : "text.secondary",
|
|
177
|
+
transition: "all 0.15s ease",
|
|
178
|
+
"&:hover": {
|
|
179
|
+
borderColor: "text.primary",
|
|
180
|
+
backgroundColor: isSelected ? "text.primary" : "action.hover"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
p.id
|
|
185
|
+
);
|
|
186
|
+
})
|
|
187
|
+
] })
|
|
188
|
+
] })
|
|
189
|
+
] }),
|
|
190
|
+
availableTags.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
|
|
191
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 600, color: "text.secondary", sx: { mb: 1, display: "block", textTransform: "uppercase", letterSpacing: 0.5 }, children: "Tags" }),
|
|
192
|
+
/* @__PURE__ */ jsx(Box, { sx: { display: "flex", gap: 0.75, flexWrap: "wrap" }, children: availableTags.map((tag) => /* @__PURE__ */ jsx(
|
|
193
|
+
Chip,
|
|
194
|
+
{
|
|
195
|
+
label: `#${tag}`,
|
|
196
|
+
size: "small",
|
|
197
|
+
clickable: true,
|
|
198
|
+
onClick: () => handleTagToggle(tag),
|
|
199
|
+
sx: {
|
|
200
|
+
fontSize: "0.7rem",
|
|
201
|
+
fontWeight: value.tags.includes(tag) ? 700 : 400,
|
|
202
|
+
borderRadius: 1.5,
|
|
203
|
+
backgroundColor: value.tags.includes(tag) ? "primary.main" : "transparent",
|
|
204
|
+
color: value.tags.includes(tag) ? "#fff" : "text.secondary",
|
|
205
|
+
border: "1px solid",
|
|
206
|
+
borderColor: value.tags.includes(tag) ? "primary.main" : "divider"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
tag
|
|
210
|
+
)) })
|
|
211
|
+
] })
|
|
212
|
+
] });
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export { AssetFilters };
|
|
216
|
+
//# sourceMappingURL=AssetFilters.esm.js.map
|