@industry-theme/agent-panels 0.2.20 → 0.2.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/dist/panels/SkillDetailPanel.d.ts.map +1 -1
- package/dist/panels/skills/components/SkillMarkdown.d.ts +5 -0
- package/dist/panels/skills/components/SkillMarkdown.d.ts.map +1 -1
- package/dist/panels/skills/components/SkillSidebar.d.ts.map +1 -1
- package/dist/panels.bundle.js +596 -134
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +1 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -2201,7 +2201,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
2201
2201
|
* This source code is licensed under the ISC license.
|
|
2202
2202
|
* See the LICENSE file in the root directory of this source tree.
|
|
2203
2203
|
*/
|
|
2204
|
-
const __iconNode$
|
|
2204
|
+
const __iconNode$t = [
|
|
2205
2205
|
["path", { d: "M12 7v14", key: "1akyts" }],
|
|
2206
2206
|
[
|
|
2207
2207
|
"path",
|
|
@@ -2211,14 +2211,14 @@ const __iconNode$o = [
|
|
|
2211
2211
|
}
|
|
2212
2212
|
]
|
|
2213
2213
|
];
|
|
2214
|
-
const BookOpen = createLucideIcon("book-open", __iconNode$
|
|
2214
|
+
const BookOpen = createLucideIcon("book-open", __iconNode$t);
|
|
2215
2215
|
/**
|
|
2216
2216
|
* @license lucide-react v0.552.0 - ISC
|
|
2217
2217
|
*
|
|
2218
2218
|
* This source code is licensed under the ISC license.
|
|
2219
2219
|
* See the LICENSE file in the root directory of this source tree.
|
|
2220
2220
|
*/
|
|
2221
|
-
const __iconNode$
|
|
2221
|
+
const __iconNode$s = [
|
|
2222
2222
|
["path", { d: "M12 8V4H8", key: "hb8ula" }],
|
|
2223
2223
|
["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
|
|
2224
2224
|
["path", { d: "M2 14h2", key: "vft8re" }],
|
|
@@ -2226,76 +2226,100 @@ const __iconNode$n = [
|
|
|
2226
2226
|
["path", { d: "M15 13v2", key: "1xurst" }],
|
|
2227
2227
|
["path", { d: "M9 13v2", key: "rq6x2g" }]
|
|
2228
2228
|
];
|
|
2229
|
-
const Bot = createLucideIcon("bot", __iconNode$
|
|
2229
|
+
const Bot = createLucideIcon("bot", __iconNode$s);
|
|
2230
2230
|
/**
|
|
2231
2231
|
* @license lucide-react v0.552.0 - ISC
|
|
2232
2232
|
*
|
|
2233
2233
|
* This source code is licensed under the ISC license.
|
|
2234
2234
|
* See the LICENSE file in the root directory of this source tree.
|
|
2235
2235
|
*/
|
|
2236
|
-
const __iconNode$
|
|
2237
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
2236
|
+
const __iconNode$r = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
2237
|
+
const Check = createLucideIcon("check", __iconNode$r);
|
|
2238
2238
|
/**
|
|
2239
2239
|
* @license lucide-react v0.552.0 - ISC
|
|
2240
2240
|
*
|
|
2241
2241
|
* This source code is licensed under the ISC license.
|
|
2242
2242
|
* See the LICENSE file in the root directory of this source tree.
|
|
2243
2243
|
*/
|
|
2244
|
-
const __iconNode$
|
|
2245
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
2244
|
+
const __iconNode$q = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
2245
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$q);
|
|
2246
2246
|
/**
|
|
2247
2247
|
* @license lucide-react v0.552.0 - ISC
|
|
2248
2248
|
*
|
|
2249
2249
|
* This source code is licensed under the ISC license.
|
|
2250
2250
|
* See the LICENSE file in the root directory of this source tree.
|
|
2251
2251
|
*/
|
|
2252
|
-
const __iconNode$
|
|
2252
|
+
const __iconNode$p = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
2253
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$p);
|
|
2254
|
+
/**
|
|
2255
|
+
* @license lucide-react v0.552.0 - ISC
|
|
2256
|
+
*
|
|
2257
|
+
* This source code is licensed under the ISC license.
|
|
2258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2259
|
+
*/
|
|
2260
|
+
const __iconNode$o = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
2261
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$o);
|
|
2262
|
+
/**
|
|
2263
|
+
* @license lucide-react v0.552.0 - ISC
|
|
2264
|
+
*
|
|
2265
|
+
* This source code is licensed under the ISC license.
|
|
2266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2267
|
+
*/
|
|
2268
|
+
const __iconNode$n = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
2269
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$n);
|
|
2270
|
+
/**
|
|
2271
|
+
* @license lucide-react v0.552.0 - ISC
|
|
2272
|
+
*
|
|
2273
|
+
* This source code is licensed under the ISC license.
|
|
2274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2275
|
+
*/
|
|
2276
|
+
const __iconNode$m = [
|
|
2253
2277
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
2254
2278
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
2255
2279
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
2256
2280
|
];
|
|
2257
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
2281
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$m);
|
|
2258
2282
|
/**
|
|
2259
2283
|
* @license lucide-react v0.552.0 - ISC
|
|
2260
2284
|
*
|
|
2261
2285
|
* This source code is licensed under the ISC license.
|
|
2262
2286
|
* See the LICENSE file in the root directory of this source tree.
|
|
2263
2287
|
*/
|
|
2264
|
-
const __iconNode$
|
|
2288
|
+
const __iconNode$l = [
|
|
2265
2289
|
["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
|
|
2266
2290
|
["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
|
|
2267
2291
|
["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
|
|
2268
2292
|
];
|
|
2269
|
-
const CodeXml = createLucideIcon("code-xml", __iconNode$
|
|
2293
|
+
const CodeXml = createLucideIcon("code-xml", __iconNode$l);
|
|
2270
2294
|
/**
|
|
2271
2295
|
* @license lucide-react v0.552.0 - ISC
|
|
2272
2296
|
*
|
|
2273
2297
|
* This source code is licensed under the ISC license.
|
|
2274
2298
|
* See the LICENSE file in the root directory of this source tree.
|
|
2275
2299
|
*/
|
|
2276
|
-
const __iconNode$
|
|
2300
|
+
const __iconNode$k = [
|
|
2277
2301
|
["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
|
|
2278
2302
|
["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
|
|
2279
2303
|
];
|
|
2280
|
-
const Code = createLucideIcon("code", __iconNode$
|
|
2304
|
+
const Code = createLucideIcon("code", __iconNode$k);
|
|
2281
2305
|
/**
|
|
2282
2306
|
* @license lucide-react v0.552.0 - ISC
|
|
2283
2307
|
*
|
|
2284
2308
|
* This source code is licensed under the ISC license.
|
|
2285
2309
|
* See the LICENSE file in the root directory of this source tree.
|
|
2286
2310
|
*/
|
|
2287
|
-
const __iconNode$
|
|
2311
|
+
const __iconNode$j = [
|
|
2288
2312
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
2289
2313
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
2290
2314
|
];
|
|
2291
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
2315
|
+
const Copy = createLucideIcon("copy", __iconNode$j);
|
|
2292
2316
|
/**
|
|
2293
2317
|
* @license lucide-react v0.552.0 - ISC
|
|
2294
2318
|
*
|
|
2295
2319
|
* This source code is licensed under the ISC license.
|
|
2296
2320
|
* See the LICENSE file in the root directory of this source tree.
|
|
2297
2321
|
*/
|
|
2298
|
-
const __iconNode$
|
|
2322
|
+
const __iconNode$i = [
|
|
2299
2323
|
["path", { d: "m15 15 6 6", key: "1s409w" }],
|
|
2300
2324
|
["path", { d: "m15 9 6-6", key: "ko1vev" }],
|
|
2301
2325
|
["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
|
|
@@ -2305,14 +2329,26 @@ const __iconNode$g = [
|
|
|
2305
2329
|
["path", { d: "M3 8V3h5", key: "1ln10m" }],
|
|
2306
2330
|
["path", { d: "M9 9 3 3", key: "v551iv" }]
|
|
2307
2331
|
];
|
|
2308
|
-
const Expand = createLucideIcon("expand", __iconNode$
|
|
2332
|
+
const Expand = createLucideIcon("expand", __iconNode$i);
|
|
2309
2333
|
/**
|
|
2310
2334
|
* @license lucide-react v0.552.0 - ISC
|
|
2311
2335
|
*
|
|
2312
2336
|
* This source code is licensed under the ISC license.
|
|
2313
2337
|
* See the LICENSE file in the root directory of this source tree.
|
|
2314
2338
|
*/
|
|
2315
|
-
const __iconNode$
|
|
2339
|
+
const __iconNode$h = [
|
|
2340
|
+
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
2341
|
+
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
2342
|
+
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
2343
|
+
];
|
|
2344
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$h);
|
|
2345
|
+
/**
|
|
2346
|
+
* @license lucide-react v0.552.0 - ISC
|
|
2347
|
+
*
|
|
2348
|
+
* This source code is licensed under the ISC license.
|
|
2349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2350
|
+
*/
|
|
2351
|
+
const __iconNode$g = [
|
|
2316
2352
|
[
|
|
2317
2353
|
"path",
|
|
2318
2354
|
{
|
|
@@ -2324,7 +2360,31 @@ const __iconNode$f = [
|
|
|
2324
2360
|
["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
|
|
2325
2361
|
["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }]
|
|
2326
2362
|
];
|
|
2327
|
-
const FileCode = createLucideIcon("file-code", __iconNode$
|
|
2363
|
+
const FileCode = createLucideIcon("file-code", __iconNode$g);
|
|
2364
|
+
/**
|
|
2365
|
+
* @license lucide-react v0.552.0 - ISC
|
|
2366
|
+
*
|
|
2367
|
+
* This source code is licensed under the ISC license.
|
|
2368
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2369
|
+
*/
|
|
2370
|
+
const __iconNode$f = [
|
|
2371
|
+
[
|
|
2372
|
+
"path",
|
|
2373
|
+
{
|
|
2374
|
+
d: "M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",
|
|
2375
|
+
key: "o6klzx"
|
|
2376
|
+
}
|
|
2377
|
+
],
|
|
2378
|
+
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
|
|
2379
|
+
[
|
|
2380
|
+
"path",
|
|
2381
|
+
{
|
|
2382
|
+
d: "M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",
|
|
2383
|
+
key: "zhnas1"
|
|
2384
|
+
}
|
|
2385
|
+
]
|
|
2386
|
+
];
|
|
2387
|
+
const FilePen = createLucideIcon("file-pen", __iconNode$f);
|
|
2328
2388
|
/**
|
|
2329
2389
|
* @license lucide-react v0.552.0 - ISC
|
|
2330
2390
|
*
|
|
@@ -48050,6 +48110,7 @@ const SkillSidebar = ({
|
|
|
48050
48110
|
skill
|
|
48051
48111
|
}) => {
|
|
48052
48112
|
const [activeTab, setActiveTab] = React2__default.useState("toc");
|
|
48113
|
+
const [isCollapsed, setIsCollapsed] = React2__default.useState(false);
|
|
48053
48114
|
const hasMetadata = metadata.compatibility || metadata["allowed-tools"] && metadata["allowed-tools"].length > 0 || metadata.metadata && Object.keys(metadata.metadata).length > 0 || (skill == null ? void 0 : skill.installedLocations) && skill.installedLocations.length > 1;
|
|
48054
48115
|
React2__default.useEffect(() => {
|
|
48055
48116
|
if (headers.length === 0 && hasMetadata) {
|
|
@@ -48064,14 +48125,53 @@ const SkillSidebar = ({
|
|
|
48064
48125
|
{
|
|
48065
48126
|
className,
|
|
48066
48127
|
style: {
|
|
48067
|
-
width: "250px",
|
|
48128
|
+
width: isCollapsed ? "0px" : "250px",
|
|
48068
48129
|
flexShrink: 0,
|
|
48069
48130
|
display: "flex",
|
|
48070
48131
|
flexDirection: "column",
|
|
48071
|
-
borderRight: `1px solid ${theme2.colors.border}
|
|
48132
|
+
borderRight: isCollapsed ? "none" : `1px solid ${theme2.colors.border}`,
|
|
48133
|
+
position: "relative",
|
|
48134
|
+
transition: "width 0.3s ease",
|
|
48135
|
+
overflow: "visible"
|
|
48072
48136
|
},
|
|
48073
48137
|
children: [
|
|
48074
|
-
/* @__PURE__ */
|
|
48138
|
+
/* @__PURE__ */ jsx(
|
|
48139
|
+
"button",
|
|
48140
|
+
{
|
|
48141
|
+
onClick: () => setIsCollapsed(!isCollapsed),
|
|
48142
|
+
style: {
|
|
48143
|
+
position: "absolute",
|
|
48144
|
+
right: "-20px",
|
|
48145
|
+
top: "16px",
|
|
48146
|
+
width: "20px",
|
|
48147
|
+
height: "60px",
|
|
48148
|
+
padding: 0,
|
|
48149
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
48150
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48151
|
+
borderLeft: "none",
|
|
48152
|
+
borderTopRightRadius: "8px",
|
|
48153
|
+
borderBottomRightRadius: "8px",
|
|
48154
|
+
cursor: "pointer",
|
|
48155
|
+
display: "flex",
|
|
48156
|
+
alignItems: "center",
|
|
48157
|
+
justifyContent: "center",
|
|
48158
|
+
color: theme2.colors.textSecondary,
|
|
48159
|
+
transition: "all 0.2s",
|
|
48160
|
+
zIndex: 10
|
|
48161
|
+
},
|
|
48162
|
+
onMouseEnter: (e) => {
|
|
48163
|
+
e.currentTarget.style.backgroundColor = theme2.colors.primary;
|
|
48164
|
+
e.currentTarget.style.color = theme2.colors.background;
|
|
48165
|
+
},
|
|
48166
|
+
onMouseLeave: (e) => {
|
|
48167
|
+
e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
|
|
48168
|
+
e.currentTarget.style.color = theme2.colors.textSecondary;
|
|
48169
|
+
},
|
|
48170
|
+
title: isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
48171
|
+
children: isCollapsed ? /* @__PURE__ */ jsx(ChevronRight, { size: 14 }) : /* @__PURE__ */ jsx(ChevronLeft, { size: 14 })
|
|
48172
|
+
}
|
|
48173
|
+
),
|
|
48174
|
+
!isCollapsed && /* @__PURE__ */ jsxs(
|
|
48075
48175
|
"div",
|
|
48076
48176
|
{
|
|
48077
48177
|
style: {
|
|
@@ -48143,7 +48243,7 @@ const SkillSidebar = ({
|
|
|
48143
48243
|
]
|
|
48144
48244
|
}
|
|
48145
48245
|
),
|
|
48146
|
-
/* @__PURE__ */ jsxs("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
|
|
48246
|
+
!isCollapsed && /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
|
|
48147
48247
|
activeTab === "toc" && headers.length > 0 && /* @__PURE__ */ jsx(
|
|
48148
48248
|
TableOfContents,
|
|
48149
48249
|
{
|
|
@@ -48388,11 +48488,118 @@ const formatRelativeTime = (dateString) => {
|
|
|
48388
48488
|
return dateString;
|
|
48389
48489
|
}
|
|
48390
48490
|
};
|
|
48491
|
+
const SearchBar = ({ theme: theme2, searchQuery, onSearchChange, currentMatch, totalMatches, onPrevious, onNext, onClose }) => {
|
|
48492
|
+
const inputRef = React2__default.useRef(null);
|
|
48493
|
+
React2__default.useEffect(() => {
|
|
48494
|
+
var _a;
|
|
48495
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
48496
|
+
}, []);
|
|
48497
|
+
return /* @__PURE__ */ jsxs("div", { style: {
|
|
48498
|
+
display: "flex",
|
|
48499
|
+
alignItems: "center",
|
|
48500
|
+
gap: theme2.space[2],
|
|
48501
|
+
padding: theme2.space[2],
|
|
48502
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
48503
|
+
borderBottom: `1px solid ${theme2.colors.border}`
|
|
48504
|
+
}, children: [
|
|
48505
|
+
/* @__PURE__ */ jsx(Search, { size: 16, color: theme2.colors.textSecondary }),
|
|
48506
|
+
/* @__PURE__ */ jsx(
|
|
48507
|
+
"input",
|
|
48508
|
+
{
|
|
48509
|
+
ref: inputRef,
|
|
48510
|
+
type: "text",
|
|
48511
|
+
placeholder: "Find in skill...",
|
|
48512
|
+
value: searchQuery,
|
|
48513
|
+
onChange: (e) => onSearchChange(e.target.value),
|
|
48514
|
+
style: {
|
|
48515
|
+
flex: 1,
|
|
48516
|
+
padding: "0.375rem 0.75rem",
|
|
48517
|
+
fontSize: theme2.fontSizes[2],
|
|
48518
|
+
fontFamily: theme2.fonts.body,
|
|
48519
|
+
color: theme2.colors.text,
|
|
48520
|
+
backgroundColor: theme2.colors.background,
|
|
48521
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48522
|
+
borderRadius: "6px",
|
|
48523
|
+
outline: "none"
|
|
48524
|
+
},
|
|
48525
|
+
onFocus: (e) => e.currentTarget.style.borderColor = theme2.colors.primary,
|
|
48526
|
+
onBlur: (e) => e.currentTarget.style.borderColor = theme2.colors.border
|
|
48527
|
+
}
|
|
48528
|
+
),
|
|
48529
|
+
totalMatches > 0 && /* @__PURE__ */ jsxs("span", { style: {
|
|
48530
|
+
fontSize: theme2.fontSizes[1],
|
|
48531
|
+
color: theme2.colors.textSecondary,
|
|
48532
|
+
fontFamily: theme2.fonts.monospace,
|
|
48533
|
+
whiteSpace: "nowrap"
|
|
48534
|
+
}, children: [
|
|
48535
|
+
currentMatch + 1,
|
|
48536
|
+
" / ",
|
|
48537
|
+
totalMatches
|
|
48538
|
+
] }),
|
|
48539
|
+
/* @__PURE__ */ jsx(
|
|
48540
|
+
"button",
|
|
48541
|
+
{
|
|
48542
|
+
onClick: onPrevious,
|
|
48543
|
+
disabled: totalMatches === 0,
|
|
48544
|
+
style: {
|
|
48545
|
+
padding: "0.375rem",
|
|
48546
|
+
backgroundColor: "transparent",
|
|
48547
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48548
|
+
borderRadius: "4px",
|
|
48549
|
+
cursor: totalMatches === 0 ? "not-allowed" : "pointer",
|
|
48550
|
+
display: "flex",
|
|
48551
|
+
alignItems: "center",
|
|
48552
|
+
opacity: totalMatches === 0 ? 0.5 : 1
|
|
48553
|
+
},
|
|
48554
|
+
title: "Previous match",
|
|
48555
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { size: 16, color: theme2.colors.text })
|
|
48556
|
+
}
|
|
48557
|
+
),
|
|
48558
|
+
/* @__PURE__ */ jsx(
|
|
48559
|
+
"button",
|
|
48560
|
+
{
|
|
48561
|
+
onClick: onNext,
|
|
48562
|
+
disabled: totalMatches === 0,
|
|
48563
|
+
style: {
|
|
48564
|
+
padding: "0.375rem",
|
|
48565
|
+
backgroundColor: "transparent",
|
|
48566
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48567
|
+
borderRadius: "4px",
|
|
48568
|
+
cursor: totalMatches === 0 ? "not-allowed" : "pointer",
|
|
48569
|
+
display: "flex",
|
|
48570
|
+
alignItems: "center",
|
|
48571
|
+
opacity: totalMatches === 0 ? 0.5 : 1
|
|
48572
|
+
},
|
|
48573
|
+
title: "Next match",
|
|
48574
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { size: 16, color: theme2.colors.text })
|
|
48575
|
+
}
|
|
48576
|
+
),
|
|
48577
|
+
/* @__PURE__ */ jsx(
|
|
48578
|
+
"button",
|
|
48579
|
+
{
|
|
48580
|
+
onClick: onClose,
|
|
48581
|
+
style: {
|
|
48582
|
+
padding: "0.375rem",
|
|
48583
|
+
backgroundColor: "transparent",
|
|
48584
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48585
|
+
borderRadius: "4px",
|
|
48586
|
+
cursor: "pointer",
|
|
48587
|
+
display: "flex",
|
|
48588
|
+
alignItems: "center"
|
|
48589
|
+
},
|
|
48590
|
+
title: "Close search",
|
|
48591
|
+
children: /* @__PURE__ */ jsx(X, { size: 16, color: theme2.colors.text })
|
|
48592
|
+
}
|
|
48593
|
+
)
|
|
48594
|
+
] });
|
|
48595
|
+
};
|
|
48391
48596
|
const SkillMetadataSection = ({
|
|
48392
48597
|
metadata,
|
|
48393
48598
|
theme: theme2,
|
|
48394
48599
|
structure,
|
|
48395
|
-
skill
|
|
48600
|
+
skill,
|
|
48601
|
+
actions,
|
|
48602
|
+
events
|
|
48396
48603
|
}) => {
|
|
48397
48604
|
var _a, _b, _c, _d, _e2;
|
|
48398
48605
|
const [expandedSections, setExpandedSections] = React2__default.useState({
|
|
@@ -48480,112 +48687,218 @@ const SkillMetadataSection = ({
|
|
|
48480
48687
|
children: "(No description provided)"
|
|
48481
48688
|
}
|
|
48482
48689
|
),
|
|
48483
|
-
structure && (structure.hasScripts || structure.hasReferences || structure.hasAssets) && /* @__PURE__ */ jsxs("div", { style: {
|
|
48690
|
+
structure && (structure.hasScripts || structure.hasReferences || structure.hasAssets) || actions && (skill == null ? void 0 : skill.path) ? /* @__PURE__ */ jsxs("div", { style: {
|
|
48484
48691
|
marginTop: theme2.space[3]
|
|
48485
48692
|
}, children: [
|
|
48486
48693
|
/* @__PURE__ */ jsxs("div", { style: {
|
|
48487
48694
|
display: "flex",
|
|
48488
48695
|
gap: theme2.space[2],
|
|
48489
|
-
flexWrap: "wrap"
|
|
48696
|
+
flexWrap: "wrap",
|
|
48697
|
+
justifyContent: "space-between",
|
|
48698
|
+
alignItems: "center"
|
|
48490
48699
|
}, children: [
|
|
48491
|
-
|
|
48492
|
-
"
|
|
48493
|
-
|
|
48494
|
-
|
|
48495
|
-
|
|
48496
|
-
|
|
48497
|
-
|
|
48498
|
-
|
|
48499
|
-
|
|
48500
|
-
|
|
48501
|
-
|
|
48502
|
-
|
|
48503
|
-
|
|
48504
|
-
|
|
48505
|
-
|
|
48506
|
-
|
|
48507
|
-
|
|
48508
|
-
|
|
48509
|
-
|
|
48510
|
-
|
|
48511
|
-
|
|
48512
|
-
|
|
48513
|
-
|
|
48514
|
-
|
|
48515
|
-
|
|
48516
|
-
|
|
48517
|
-
|
|
48518
|
-
|
|
48519
|
-
|
|
48520
|
-
|
|
48521
|
-
|
|
48522
|
-
|
|
48523
|
-
|
|
48524
|
-
|
|
48525
|
-
|
|
48526
|
-
|
|
48527
|
-
|
|
48528
|
-
|
|
48529
|
-
|
|
48530
|
-
|
|
48531
|
-
|
|
48532
|
-
|
|
48533
|
-
|
|
48534
|
-
|
|
48535
|
-
|
|
48536
|
-
|
|
48537
|
-
|
|
48538
|
-
|
|
48539
|
-
|
|
48540
|
-
|
|
48541
|
-
|
|
48542
|
-
|
|
48543
|
-
|
|
48544
|
-
|
|
48545
|
-
|
|
48546
|
-
|
|
48547
|
-
|
|
48548
|
-
|
|
48549
|
-
|
|
48550
|
-
|
|
48551
|
-
|
|
48552
|
-
|
|
48553
|
-
|
|
48554
|
-
|
|
48555
|
-
|
|
48556
|
-
|
|
48557
|
-
|
|
48558
|
-
|
|
48559
|
-
|
|
48560
|
-
|
|
48561
|
-
|
|
48562
|
-
|
|
48563
|
-
|
|
48564
|
-
|
|
48565
|
-
|
|
48566
|
-
|
|
48567
|
-
|
|
48568
|
-
|
|
48569
|
-
|
|
48570
|
-
|
|
48571
|
-
|
|
48572
|
-
|
|
48573
|
-
|
|
48574
|
-
|
|
48575
|
-
|
|
48576
|
-
|
|
48577
|
-
|
|
48578
|
-
|
|
48579
|
-
|
|
48580
|
-
|
|
48581
|
-
|
|
48582
|
-
|
|
48583
|
-
|
|
48584
|
-
|
|
48585
|
-
|
|
48586
|
-
|
|
48700
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
48701
|
+
display: "flex",
|
|
48702
|
+
gap: theme2.space[2],
|
|
48703
|
+
flexWrap: "wrap"
|
|
48704
|
+
}, children: [
|
|
48705
|
+
(structure == null ? void 0 : structure.hasScripts) && /* @__PURE__ */ jsxs(
|
|
48706
|
+
"button",
|
|
48707
|
+
{
|
|
48708
|
+
onClick: () => toggleSection("scripts"),
|
|
48709
|
+
style: {
|
|
48710
|
+
padding: "0.25rem 0.75rem",
|
|
48711
|
+
borderRadius: "12px",
|
|
48712
|
+
backgroundColor: theme2.colors.primary,
|
|
48713
|
+
color: theme2.colors.background,
|
|
48714
|
+
fontSize: theme2.fontSizes[0],
|
|
48715
|
+
fontFamily: theme2.fonts.body,
|
|
48716
|
+
fontWeight: 500,
|
|
48717
|
+
display: "flex",
|
|
48718
|
+
alignItems: "center",
|
|
48719
|
+
gap: "0.5rem",
|
|
48720
|
+
border: "none",
|
|
48721
|
+
cursor: "pointer",
|
|
48722
|
+
transition: "opacity 0.2s"
|
|
48723
|
+
},
|
|
48724
|
+
onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
|
|
48725
|
+
onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
|
|
48726
|
+
children: [
|
|
48727
|
+
/* @__PURE__ */ jsx(Code, { size: 14 }),
|
|
48728
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
48729
|
+
"Scripts (",
|
|
48730
|
+
((_c = structure.scriptFiles) == null ? void 0 : _c.length) || 0,
|
|
48731
|
+
")"
|
|
48732
|
+
] }),
|
|
48733
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.scripts ? "▼" : "▶" })
|
|
48734
|
+
]
|
|
48735
|
+
}
|
|
48736
|
+
),
|
|
48737
|
+
(structure == null ? void 0 : structure.hasReferences) && /* @__PURE__ */ jsxs(
|
|
48738
|
+
"button",
|
|
48739
|
+
{
|
|
48740
|
+
onClick: () => toggleSection("references"),
|
|
48741
|
+
style: {
|
|
48742
|
+
padding: "0.25rem 0.75rem",
|
|
48743
|
+
borderRadius: "12px",
|
|
48744
|
+
backgroundColor: theme2.colors.secondary,
|
|
48745
|
+
color: theme2.colors.background,
|
|
48746
|
+
fontSize: theme2.fontSizes[0],
|
|
48747
|
+
fontFamily: theme2.fonts.body,
|
|
48748
|
+
fontWeight: 500,
|
|
48749
|
+
display: "flex",
|
|
48750
|
+
alignItems: "center",
|
|
48751
|
+
gap: "0.5rem",
|
|
48752
|
+
border: "none",
|
|
48753
|
+
cursor: "pointer",
|
|
48754
|
+
transition: "opacity 0.2s"
|
|
48755
|
+
},
|
|
48756
|
+
onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
|
|
48757
|
+
onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
|
|
48758
|
+
children: [
|
|
48759
|
+
/* @__PURE__ */ jsx(BookOpen, { size: 14 }),
|
|
48760
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
48761
|
+
"References (",
|
|
48762
|
+
((_d = structure.referenceFiles) == null ? void 0 : _d.length) || 0,
|
|
48763
|
+
")"
|
|
48764
|
+
] }),
|
|
48765
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.references ? "▼" : "▶" })
|
|
48766
|
+
]
|
|
48767
|
+
}
|
|
48768
|
+
),
|
|
48769
|
+
(structure == null ? void 0 : structure.hasAssets) && /* @__PURE__ */ jsxs(
|
|
48770
|
+
"button",
|
|
48771
|
+
{
|
|
48772
|
+
onClick: () => toggleSection("assets"),
|
|
48773
|
+
style: {
|
|
48774
|
+
padding: "0.25rem 0.75rem",
|
|
48775
|
+
borderRadius: "12px",
|
|
48776
|
+
backgroundColor: theme2.colors.accent,
|
|
48777
|
+
color: theme2.colors.background,
|
|
48778
|
+
fontSize: theme2.fontSizes[0],
|
|
48779
|
+
fontFamily: theme2.fonts.body,
|
|
48780
|
+
fontWeight: 500,
|
|
48781
|
+
display: "flex",
|
|
48782
|
+
alignItems: "center",
|
|
48783
|
+
gap: "0.5rem",
|
|
48784
|
+
border: "none",
|
|
48785
|
+
cursor: "pointer",
|
|
48786
|
+
transition: "opacity 0.2s"
|
|
48787
|
+
},
|
|
48788
|
+
onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
|
|
48789
|
+
onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
|
|
48790
|
+
children: [
|
|
48791
|
+
/* @__PURE__ */ jsx(Package, { size: 14 }),
|
|
48792
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
48793
|
+
"Assets (",
|
|
48794
|
+
((_e2 = structure.assetFiles) == null ? void 0 : _e2.length) || 0,
|
|
48795
|
+
")"
|
|
48796
|
+
] }),
|
|
48797
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.assets ? "▼" : "▶" })
|
|
48798
|
+
]
|
|
48799
|
+
}
|
|
48800
|
+
)
|
|
48801
|
+
] }),
|
|
48802
|
+
events && (skill == null ? void 0 : skill.path) && /* @__PURE__ */ jsxs("div", { style: {
|
|
48803
|
+
display: "flex",
|
|
48804
|
+
gap: theme2.space[2]
|
|
48805
|
+
}, children: [
|
|
48806
|
+
/* @__PURE__ */ jsxs(
|
|
48807
|
+
"button",
|
|
48808
|
+
{
|
|
48809
|
+
onClick: () => {
|
|
48810
|
+
if (skill == null ? void 0 : skill.path) {
|
|
48811
|
+
events.emit({
|
|
48812
|
+
type: "file:open",
|
|
48813
|
+
source: "skill-detail",
|
|
48814
|
+
timestamp: Date.now(),
|
|
48815
|
+
payload: {
|
|
48816
|
+
filePath: skill.path,
|
|
48817
|
+
gitStatus: "untracked"
|
|
48818
|
+
}
|
|
48819
|
+
});
|
|
48820
|
+
}
|
|
48821
|
+
},
|
|
48822
|
+
style: {
|
|
48823
|
+
display: "flex",
|
|
48824
|
+
alignItems: "center",
|
|
48825
|
+
gap: theme2.space[1],
|
|
48826
|
+
padding: `${theme2.space[1]} ${theme2.space[2]}`,
|
|
48827
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
48828
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48829
|
+
borderRadius: "6px",
|
|
48830
|
+
color: theme2.colors.text,
|
|
48831
|
+
fontSize: theme2.fontSizes[1],
|
|
48832
|
+
fontFamily: theme2.fonts.body,
|
|
48833
|
+
cursor: "pointer",
|
|
48834
|
+
transition: "all 0.2s"
|
|
48835
|
+
},
|
|
48836
|
+
onMouseEnter: (e) => {
|
|
48837
|
+
e.currentTarget.style.backgroundColor = theme2.colors.primary;
|
|
48838
|
+
e.currentTarget.style.color = theme2.colors.background;
|
|
48839
|
+
e.currentTarget.style.borderColor = theme2.colors.primary;
|
|
48840
|
+
},
|
|
48841
|
+
onMouseLeave: (e) => {
|
|
48842
|
+
e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
|
|
48843
|
+
e.currentTarget.style.color = theme2.colors.text;
|
|
48844
|
+
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
48845
|
+
},
|
|
48846
|
+
title: "Open in file editor",
|
|
48847
|
+
children: [
|
|
48848
|
+
/* @__PURE__ */ jsx(FilePen, { size: 14 }),
|
|
48849
|
+
/* @__PURE__ */ jsx("span", { children: "Edit" })
|
|
48850
|
+
]
|
|
48851
|
+
}
|
|
48852
|
+
),
|
|
48853
|
+
/* @__PURE__ */ jsxs(
|
|
48854
|
+
"button",
|
|
48855
|
+
{
|
|
48856
|
+
onClick: () => {
|
|
48857
|
+
if (skill == null ? void 0 : skill.path) {
|
|
48858
|
+
events.emit({
|
|
48859
|
+
type: "file:openInMdxEditor",
|
|
48860
|
+
source: "skill-detail",
|
|
48861
|
+
timestamp: Date.now(),
|
|
48862
|
+
payload: {
|
|
48863
|
+
filePath: skill.path
|
|
48864
|
+
}
|
|
48865
|
+
});
|
|
48866
|
+
}
|
|
48867
|
+
},
|
|
48868
|
+
style: {
|
|
48869
|
+
display: "flex",
|
|
48870
|
+
alignItems: "center",
|
|
48871
|
+
gap: theme2.space[1],
|
|
48872
|
+
padding: `${theme2.space[1]} ${theme2.space[2]}`,
|
|
48873
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
48874
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48875
|
+
borderRadius: "6px",
|
|
48876
|
+
color: theme2.colors.text,
|
|
48877
|
+
fontSize: theme2.fontSizes[1],
|
|
48878
|
+
fontFamily: theme2.fonts.body,
|
|
48879
|
+
cursor: "pointer",
|
|
48880
|
+
transition: "all 0.2s"
|
|
48881
|
+
},
|
|
48882
|
+
onMouseEnter: (e) => {
|
|
48883
|
+
e.currentTarget.style.backgroundColor = theme2.colors.secondary;
|
|
48884
|
+
e.currentTarget.style.color = theme2.colors.background;
|
|
48885
|
+
e.currentTarget.style.borderColor = theme2.colors.secondary;
|
|
48886
|
+
},
|
|
48887
|
+
onMouseLeave: (e) => {
|
|
48888
|
+
e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
|
|
48889
|
+
e.currentTarget.style.color = theme2.colors.text;
|
|
48890
|
+
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
48891
|
+
},
|
|
48892
|
+
title: "Open in MDX editor",
|
|
48893
|
+
children: [
|
|
48894
|
+
/* @__PURE__ */ jsx(ExternalLink, { size: 14 }),
|
|
48895
|
+
/* @__PURE__ */ jsx("span", { children: "MDX Editor" })
|
|
48896
|
+
]
|
|
48897
|
+
}
|
|
48898
|
+
)
|
|
48899
|
+
] })
|
|
48587
48900
|
] }),
|
|
48588
|
-
expandedSections.scripts && structure.scriptFiles && structure.scriptFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48901
|
+
expandedSections.scripts && (structure == null ? void 0 : structure.scriptFiles) && structure.scriptFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48589
48902
|
marginTop: theme2.space[2],
|
|
48590
48903
|
padding: theme2.space[2],
|
|
48591
48904
|
backgroundColor: `${theme2.colors.primary}15`,
|
|
@@ -48603,7 +48916,7 @@ const SkillMetadataSection = ({
|
|
|
48603
48916
|
margin: 0,
|
|
48604
48917
|
paddingLeft: theme2.space[3],
|
|
48605
48918
|
listStyle: "none"
|
|
48606
|
-
}, children: structure.scriptFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48919
|
+
}, children: structure == null ? void 0 : structure.scriptFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48607
48920
|
fontSize: theme2.fontSizes[1],
|
|
48608
48921
|
color: theme2.colors.text,
|
|
48609
48922
|
fontFamily: theme2.fonts.monospace,
|
|
@@ -48613,7 +48926,7 @@ const SkillMetadataSection = ({
|
|
|
48613
48926
|
file
|
|
48614
48927
|
] }, idx)) })
|
|
48615
48928
|
] }),
|
|
48616
|
-
expandedSections.references && structure.referenceFiles && structure.referenceFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48929
|
+
expandedSections.references && (structure == null ? void 0 : structure.referenceFiles) && structure.referenceFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48617
48930
|
marginTop: theme2.space[2],
|
|
48618
48931
|
padding: theme2.space[2],
|
|
48619
48932
|
backgroundColor: `${theme2.colors.secondary}15`,
|
|
@@ -48631,7 +48944,7 @@ const SkillMetadataSection = ({
|
|
|
48631
48944
|
margin: 0,
|
|
48632
48945
|
paddingLeft: theme2.space[3],
|
|
48633
48946
|
listStyle: "none"
|
|
48634
|
-
}, children: structure.referenceFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48947
|
+
}, children: structure == null ? void 0 : structure.referenceFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48635
48948
|
fontSize: theme2.fontSizes[1],
|
|
48636
48949
|
color: theme2.colors.text,
|
|
48637
48950
|
fontFamily: theme2.fonts.monospace,
|
|
@@ -48641,7 +48954,7 @@ const SkillMetadataSection = ({
|
|
|
48641
48954
|
file
|
|
48642
48955
|
] }, idx)) })
|
|
48643
48956
|
] }),
|
|
48644
|
-
expandedSections.assets && structure.assetFiles && structure.assetFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48957
|
+
expandedSections.assets && (structure == null ? void 0 : structure.assetFiles) && structure.assetFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48645
48958
|
marginTop: theme2.space[2],
|
|
48646
48959
|
padding: theme2.space[2],
|
|
48647
48960
|
backgroundColor: `${theme2.colors.accent}15`,
|
|
@@ -48659,7 +48972,7 @@ const SkillMetadataSection = ({
|
|
|
48659
48972
|
margin: 0,
|
|
48660
48973
|
paddingLeft: theme2.space[3],
|
|
48661
48974
|
listStyle: "none"
|
|
48662
|
-
}, children: structure.assetFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48975
|
+
}, children: structure == null ? void 0 : structure.assetFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48663
48976
|
fontSize: theme2.fontSizes[1],
|
|
48664
48977
|
color: theme2.colors.text,
|
|
48665
48978
|
fontFamily: theme2.fonts.monospace,
|
|
@@ -48669,7 +48982,7 @@ const SkillMetadataSection = ({
|
|
|
48669
48982
|
file
|
|
48670
48983
|
] }, idx)) })
|
|
48671
48984
|
] })
|
|
48672
|
-
] })
|
|
48985
|
+
] }) : null
|
|
48673
48986
|
] });
|
|
48674
48987
|
};
|
|
48675
48988
|
const SkillMarkdown = ({
|
|
@@ -48681,10 +48994,17 @@ const SkillMarkdown = ({
|
|
|
48681
48994
|
showRawOnError = false,
|
|
48682
48995
|
containerWidth,
|
|
48683
48996
|
structure,
|
|
48684
|
-
skill
|
|
48997
|
+
skill,
|
|
48998
|
+
actions,
|
|
48999
|
+
events
|
|
48685
49000
|
}) => {
|
|
48686
49001
|
const [parsed, setParsed] = React2__default.useState(null);
|
|
48687
49002
|
const [headers, setHeaders] = React2__default.useState([]);
|
|
49003
|
+
const [showSearch, setShowSearch] = React2__default.useState(false);
|
|
49004
|
+
const [searchQuery, setSearchQuery] = React2__default.useState("");
|
|
49005
|
+
const [currentMatch, setCurrentMatch] = React2__default.useState(0);
|
|
49006
|
+
const [totalMatches, setTotalMatches] = React2__default.useState(0);
|
|
49007
|
+
const contentRef = React2__default.useRef(null);
|
|
48688
49008
|
React2__default.useEffect(() => {
|
|
48689
49009
|
const skill2 = parseSkillMarkdownGraceful(content2);
|
|
48690
49010
|
setParsed(skill2);
|
|
@@ -48695,6 +49015,133 @@ const SkillMarkdown = ({
|
|
|
48695
49015
|
const extractedHeaders = extractHeaders(skill2.body);
|
|
48696
49016
|
setHeaders(extractedHeaders);
|
|
48697
49017
|
}, [content2, onParsed, onWarnings]);
|
|
49018
|
+
const scrollToMatch = React2__default.useCallback((matches, index2, theme22) => {
|
|
49019
|
+
matches.forEach((m) => {
|
|
49020
|
+
m.style.backgroundColor = "#ffeb3b";
|
|
49021
|
+
m.style.outline = "none";
|
|
49022
|
+
m.style.boxShadow = "none";
|
|
49023
|
+
});
|
|
49024
|
+
if (matches[index2]) {
|
|
49025
|
+
matches[index2].style.backgroundColor = "#ff9800";
|
|
49026
|
+
matches[index2].style.outline = `2px solid ${theme22.colors.primary}`;
|
|
49027
|
+
matches[index2].style.boxShadow = "0 0 8px rgba(255, 152, 0, 0.6)";
|
|
49028
|
+
matches[index2].scrollIntoView({ behavior: "smooth", block: "center" });
|
|
49029
|
+
}
|
|
49030
|
+
}, []);
|
|
49031
|
+
const handleNext = React2__default.useCallback(() => {
|
|
49032
|
+
var _a;
|
|
49033
|
+
if (totalMatches === 0) return;
|
|
49034
|
+
const newIndex = (currentMatch + 1) % totalMatches;
|
|
49035
|
+
setCurrentMatch(newIndex);
|
|
49036
|
+
const matches = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
|
|
49037
|
+
if (matches) {
|
|
49038
|
+
scrollToMatch(Array.from(matches), newIndex, theme2);
|
|
49039
|
+
}
|
|
49040
|
+
}, [totalMatches, currentMatch, theme2, scrollToMatch]);
|
|
49041
|
+
const handlePrevious = React2__default.useCallback(() => {
|
|
49042
|
+
var _a;
|
|
49043
|
+
if (totalMatches === 0) return;
|
|
49044
|
+
const newIndex = currentMatch === 0 ? totalMatches - 1 : currentMatch - 1;
|
|
49045
|
+
setCurrentMatch(newIndex);
|
|
49046
|
+
const matches = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
|
|
49047
|
+
if (matches) {
|
|
49048
|
+
scrollToMatch(Array.from(matches), newIndex, theme2);
|
|
49049
|
+
}
|
|
49050
|
+
}, [totalMatches, currentMatch, theme2, scrollToMatch]);
|
|
49051
|
+
React2__default.useEffect(() => {
|
|
49052
|
+
const handleKeyDown = (e) => {
|
|
49053
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "f") {
|
|
49054
|
+
e.preventDefault();
|
|
49055
|
+
setShowSearch(true);
|
|
49056
|
+
}
|
|
49057
|
+
if (e.key === "Escape" && showSearch) {
|
|
49058
|
+
setShowSearch(false);
|
|
49059
|
+
setSearchQuery("");
|
|
49060
|
+
}
|
|
49061
|
+
if (e.key === "Enter" && showSearch && totalMatches > 0) {
|
|
49062
|
+
e.preventDefault();
|
|
49063
|
+
handleNext();
|
|
49064
|
+
}
|
|
49065
|
+
};
|
|
49066
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
49067
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
49068
|
+
}, [showSearch, totalMatches, handleNext]);
|
|
49069
|
+
React2__default.useEffect(() => {
|
|
49070
|
+
var _a;
|
|
49071
|
+
if (!searchQuery || !contentRef.current) {
|
|
49072
|
+
const highlights = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
|
|
49073
|
+
highlights == null ? void 0 : highlights.forEach((el) => {
|
|
49074
|
+
const parent = el.parentNode;
|
|
49075
|
+
if (parent) {
|
|
49076
|
+
parent.replaceChild(document.createTextNode(el.textContent || ""), el);
|
|
49077
|
+
parent.normalize();
|
|
49078
|
+
}
|
|
49079
|
+
});
|
|
49080
|
+
setTotalMatches(0);
|
|
49081
|
+
setCurrentMatch(0);
|
|
49082
|
+
return;
|
|
49083
|
+
}
|
|
49084
|
+
const container = contentRef.current;
|
|
49085
|
+
const walker = document.createTreeWalker(
|
|
49086
|
+
container,
|
|
49087
|
+
NodeFilter.SHOW_TEXT,
|
|
49088
|
+
null
|
|
49089
|
+
);
|
|
49090
|
+
const textNodes = [];
|
|
49091
|
+
let node2;
|
|
49092
|
+
while (node2 = walker.nextNode()) {
|
|
49093
|
+
textNodes.push(node2);
|
|
49094
|
+
}
|
|
49095
|
+
const oldHighlights = container.querySelectorAll(".search-highlight");
|
|
49096
|
+
oldHighlights.forEach((el) => {
|
|
49097
|
+
const parent = el.parentNode;
|
|
49098
|
+
if (parent) {
|
|
49099
|
+
parent.replaceChild(document.createTextNode(el.textContent || ""), el);
|
|
49100
|
+
parent.normalize();
|
|
49101
|
+
}
|
|
49102
|
+
});
|
|
49103
|
+
const matches = [];
|
|
49104
|
+
const regex2 = new RegExp(searchQuery.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi");
|
|
49105
|
+
textNodes.forEach((textNode) => {
|
|
49106
|
+
var _a2;
|
|
49107
|
+
const text2 = textNode.textContent || "";
|
|
49108
|
+
const matches_in_text = [...text2.matchAll(regex2)];
|
|
49109
|
+
if (matches_in_text.length > 0) {
|
|
49110
|
+
const fragment2 = document.createDocumentFragment();
|
|
49111
|
+
let lastIndex = 0;
|
|
49112
|
+
matches_in_text.forEach((match) => {
|
|
49113
|
+
const matchIndex = match.index;
|
|
49114
|
+
if (matchIndex > lastIndex) {
|
|
49115
|
+
fragment2.appendChild(document.createTextNode(text2.slice(lastIndex, matchIndex)));
|
|
49116
|
+
}
|
|
49117
|
+
const mark2 = document.createElement("mark");
|
|
49118
|
+
mark2.className = "search-highlight";
|
|
49119
|
+
mark2.style.backgroundColor = "#ffeb3b";
|
|
49120
|
+
mark2.style.color = "#000000";
|
|
49121
|
+
mark2.style.fontWeight = "500";
|
|
49122
|
+
mark2.textContent = match[0];
|
|
49123
|
+
fragment2.appendChild(mark2);
|
|
49124
|
+
matches.push(mark2);
|
|
49125
|
+
lastIndex = matchIndex + match[0].length;
|
|
49126
|
+
});
|
|
49127
|
+
if (lastIndex < text2.length) {
|
|
49128
|
+
fragment2.appendChild(document.createTextNode(text2.slice(lastIndex)));
|
|
49129
|
+
}
|
|
49130
|
+
(_a2 = textNode.parentNode) == null ? void 0 : _a2.replaceChild(fragment2, textNode);
|
|
49131
|
+
}
|
|
49132
|
+
});
|
|
49133
|
+
setTotalMatches(matches.length);
|
|
49134
|
+
if (matches.length > 0) {
|
|
49135
|
+
setCurrentMatch(0);
|
|
49136
|
+
scrollToMatch(matches, 0, theme2);
|
|
49137
|
+
}
|
|
49138
|
+
}, [searchQuery, parsed, theme2, scrollToMatch]);
|
|
49139
|
+
const handleCloseSearch = () => {
|
|
49140
|
+
setShowSearch(false);
|
|
49141
|
+
setSearchQuery("");
|
|
49142
|
+
setCurrentMatch(0);
|
|
49143
|
+
setTotalMatches(0);
|
|
49144
|
+
};
|
|
48698
49145
|
if (!theme2 || !theme2.space) {
|
|
48699
49146
|
return /* @__PURE__ */ jsx("div", { className, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx("div", { style: { padding: "2rem", textAlign: "center", color: "#856404" }, children: "Error: Theme not available. Wrap component in ThemeProvider." }) });
|
|
48700
49147
|
}
|
|
@@ -48730,7 +49177,20 @@ const SkillMarkdown = ({
|
|
|
48730
49177
|
background: theme2.colors.background
|
|
48731
49178
|
},
|
|
48732
49179
|
children: [
|
|
48733
|
-
|
|
49180
|
+
showSearch && /* @__PURE__ */ jsx(
|
|
49181
|
+
SearchBar,
|
|
49182
|
+
{
|
|
49183
|
+
theme: theme2,
|
|
49184
|
+
searchQuery,
|
|
49185
|
+
onSearchChange: setSearchQuery,
|
|
49186
|
+
currentMatch,
|
|
49187
|
+
totalMatches,
|
|
49188
|
+
onPrevious: handlePrevious,
|
|
49189
|
+
onNext: handleNext,
|
|
49190
|
+
onClose: handleCloseSearch
|
|
49191
|
+
}
|
|
49192
|
+
),
|
|
49193
|
+
/* @__PURE__ */ jsx("div", { style: { padding: theme2.space[3], paddingBottom: 0 }, children: /* @__PURE__ */ jsx(SkillMetadataSection, { metadata: parsed.metadata, theme: theme2, structure, skill, actions, events }) }),
|
|
48734
49194
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
|
|
48735
49195
|
/* @__PURE__ */ jsx(
|
|
48736
49196
|
SkillSidebar,
|
|
@@ -48741,7 +49201,7 @@ const SkillMarkdown = ({
|
|
|
48741
49201
|
skill
|
|
48742
49202
|
}
|
|
48743
49203
|
),
|
|
48744
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }, children: /* @__PURE__ */ jsx(
|
|
49204
|
+
/* @__PURE__ */ jsx("div", { ref: contentRef, style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }, children: /* @__PURE__ */ jsx(
|
|
48745
49205
|
IndustryMarkdownSlide,
|
|
48746
49206
|
{
|
|
48747
49207
|
content: parsed.body,
|
|
@@ -48913,7 +49373,9 @@ const SkillDetailPanel = ({
|
|
|
48913
49373
|
referenceFiles: skill.referenceFiles,
|
|
48914
49374
|
assetFiles: skill.assetFiles
|
|
48915
49375
|
},
|
|
48916
|
-
skill
|
|
49376
|
+
skill,
|
|
49377
|
+
actions,
|
|
49378
|
+
events
|
|
48917
49379
|
}
|
|
48918
49380
|
) }) }) : /* @__PURE__ */ jsx(
|
|
48919
49381
|
"div",
|