@industry-theme/agent-panels 0.2.19 → 0.2.21
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 +3 -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/skills/hooks/useSkillsData.d.ts.map +1 -1
- package/dist/panels.bundle.js +579 -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
|
*
|
|
@@ -2564,6 +2624,8 @@ const determineSkillSource = (path2) => {
|
|
|
2564
2624
|
return { source: "project-universal", priority: 1 };
|
|
2565
2625
|
} else if (path2.includes(".claude/skills/")) {
|
|
2566
2626
|
return { source: "project-claude", priority: 3 };
|
|
2627
|
+
} else if (path2.includes("skills/")) {
|
|
2628
|
+
return { source: "project-other", priority: 1 };
|
|
2567
2629
|
} else {
|
|
2568
2630
|
return { source: "project-other", priority: 5 };
|
|
2569
2631
|
}
|
|
@@ -48048,6 +48110,7 @@ const SkillSidebar = ({
|
|
|
48048
48110
|
skill
|
|
48049
48111
|
}) => {
|
|
48050
48112
|
const [activeTab, setActiveTab] = React2__default.useState("toc");
|
|
48113
|
+
const [isCollapsed, setIsCollapsed] = React2__default.useState(false);
|
|
48051
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;
|
|
48052
48115
|
React2__default.useEffect(() => {
|
|
48053
48116
|
if (headers.length === 0 && hasMetadata) {
|
|
@@ -48062,14 +48125,53 @@ const SkillSidebar = ({
|
|
|
48062
48125
|
{
|
|
48063
48126
|
className,
|
|
48064
48127
|
style: {
|
|
48065
|
-
width: "250px",
|
|
48128
|
+
width: isCollapsed ? "0px" : "250px",
|
|
48066
48129
|
flexShrink: 0,
|
|
48067
48130
|
display: "flex",
|
|
48068
48131
|
flexDirection: "column",
|
|
48069
|
-
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"
|
|
48070
48136
|
},
|
|
48071
48137
|
children: [
|
|
48072
|
-
/* @__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(
|
|
48073
48175
|
"div",
|
|
48074
48176
|
{
|
|
48075
48177
|
style: {
|
|
@@ -48141,7 +48243,7 @@ const SkillSidebar = ({
|
|
|
48141
48243
|
]
|
|
48142
48244
|
}
|
|
48143
48245
|
),
|
|
48144
|
-
/* @__PURE__ */ jsxs("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
|
|
48246
|
+
!isCollapsed && /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
|
|
48145
48247
|
activeTab === "toc" && headers.length > 0 && /* @__PURE__ */ jsx(
|
|
48146
48248
|
TableOfContents,
|
|
48147
48249
|
{
|
|
@@ -48386,11 +48488,117 @@ const formatRelativeTime = (dateString) => {
|
|
|
48386
48488
|
return dateString;
|
|
48387
48489
|
}
|
|
48388
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
|
+
};
|
|
48389
48596
|
const SkillMetadataSection = ({
|
|
48390
48597
|
metadata,
|
|
48391
48598
|
theme: theme2,
|
|
48392
48599
|
structure,
|
|
48393
|
-
skill
|
|
48600
|
+
skill,
|
|
48601
|
+
actions
|
|
48394
48602
|
}) => {
|
|
48395
48603
|
var _a, _b, _c, _d, _e2;
|
|
48396
48604
|
const [expandedSections, setExpandedSections] = React2__default.useState({
|
|
@@ -48478,112 +48686,202 @@ const SkillMetadataSection = ({
|
|
|
48478
48686
|
children: "(No description provided)"
|
|
48479
48687
|
}
|
|
48480
48688
|
),
|
|
48481
|
-
structure && (structure.hasScripts || structure.hasReferences || structure.hasAssets) && /* @__PURE__ */ jsxs("div", { style: {
|
|
48689
|
+
structure && (structure.hasScripts || structure.hasReferences || structure.hasAssets) || actions && (skill == null ? void 0 : skill.path) ? /* @__PURE__ */ jsxs("div", { style: {
|
|
48482
48690
|
marginTop: theme2.space[3]
|
|
48483
48691
|
}, children: [
|
|
48484
48692
|
/* @__PURE__ */ jsxs("div", { style: {
|
|
48485
48693
|
display: "flex",
|
|
48486
48694
|
gap: theme2.space[2],
|
|
48487
|
-
flexWrap: "wrap"
|
|
48695
|
+
flexWrap: "wrap",
|
|
48696
|
+
justifyContent: "space-between",
|
|
48697
|
+
alignItems: "center"
|
|
48488
48698
|
}, children: [
|
|
48489
|
-
|
|
48490
|
-
"
|
|
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
|
-
|
|
48699
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
48700
|
+
display: "flex",
|
|
48701
|
+
gap: theme2.space[2],
|
|
48702
|
+
flexWrap: "wrap"
|
|
48703
|
+
}, children: [
|
|
48704
|
+
(structure == null ? void 0 : structure.hasScripts) && /* @__PURE__ */ jsxs(
|
|
48705
|
+
"button",
|
|
48706
|
+
{
|
|
48707
|
+
onClick: () => toggleSection("scripts"),
|
|
48708
|
+
style: {
|
|
48709
|
+
padding: "0.25rem 0.75rem",
|
|
48710
|
+
borderRadius: "12px",
|
|
48711
|
+
backgroundColor: theme2.colors.primary,
|
|
48712
|
+
color: theme2.colors.background,
|
|
48713
|
+
fontSize: theme2.fontSizes[0],
|
|
48714
|
+
fontFamily: theme2.fonts.body,
|
|
48715
|
+
fontWeight: 500,
|
|
48716
|
+
display: "flex",
|
|
48717
|
+
alignItems: "center",
|
|
48718
|
+
gap: "0.5rem",
|
|
48719
|
+
border: "none",
|
|
48720
|
+
cursor: "pointer",
|
|
48721
|
+
transition: "opacity 0.2s"
|
|
48722
|
+
},
|
|
48723
|
+
onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
|
|
48724
|
+
onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
|
|
48725
|
+
children: [
|
|
48726
|
+
/* @__PURE__ */ jsx(Code, { size: 14 }),
|
|
48727
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
48728
|
+
"Scripts (",
|
|
48729
|
+
((_c = structure.scriptFiles) == null ? void 0 : _c.length) || 0,
|
|
48730
|
+
")"
|
|
48731
|
+
] }),
|
|
48732
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.scripts ? "▼" : "▶" })
|
|
48733
|
+
]
|
|
48734
|
+
}
|
|
48735
|
+
),
|
|
48736
|
+
(structure == null ? void 0 : structure.hasReferences) && /* @__PURE__ */ jsxs(
|
|
48737
|
+
"button",
|
|
48738
|
+
{
|
|
48739
|
+
onClick: () => toggleSection("references"),
|
|
48740
|
+
style: {
|
|
48741
|
+
padding: "0.25rem 0.75rem",
|
|
48742
|
+
borderRadius: "12px",
|
|
48743
|
+
backgroundColor: theme2.colors.secondary,
|
|
48744
|
+
color: theme2.colors.background,
|
|
48745
|
+
fontSize: theme2.fontSizes[0],
|
|
48746
|
+
fontFamily: theme2.fonts.body,
|
|
48747
|
+
fontWeight: 500,
|
|
48748
|
+
display: "flex",
|
|
48749
|
+
alignItems: "center",
|
|
48750
|
+
gap: "0.5rem",
|
|
48751
|
+
border: "none",
|
|
48752
|
+
cursor: "pointer",
|
|
48753
|
+
transition: "opacity 0.2s"
|
|
48754
|
+
},
|
|
48755
|
+
onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
|
|
48756
|
+
onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
|
|
48757
|
+
children: [
|
|
48758
|
+
/* @__PURE__ */ jsx(BookOpen, { size: 14 }),
|
|
48759
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
48760
|
+
"References (",
|
|
48761
|
+
((_d = structure.referenceFiles) == null ? void 0 : _d.length) || 0,
|
|
48762
|
+
")"
|
|
48763
|
+
] }),
|
|
48764
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.references ? "▼" : "▶" })
|
|
48765
|
+
]
|
|
48766
|
+
}
|
|
48767
|
+
),
|
|
48768
|
+
(structure == null ? void 0 : structure.hasAssets) && /* @__PURE__ */ jsxs(
|
|
48769
|
+
"button",
|
|
48770
|
+
{
|
|
48771
|
+
onClick: () => toggleSection("assets"),
|
|
48772
|
+
style: {
|
|
48773
|
+
padding: "0.25rem 0.75rem",
|
|
48774
|
+
borderRadius: "12px",
|
|
48775
|
+
backgroundColor: theme2.colors.accent,
|
|
48776
|
+
color: theme2.colors.background,
|
|
48777
|
+
fontSize: theme2.fontSizes[0],
|
|
48778
|
+
fontFamily: theme2.fonts.body,
|
|
48779
|
+
fontWeight: 500,
|
|
48780
|
+
display: "flex",
|
|
48781
|
+
alignItems: "center",
|
|
48782
|
+
gap: "0.5rem",
|
|
48783
|
+
border: "none",
|
|
48784
|
+
cursor: "pointer",
|
|
48785
|
+
transition: "opacity 0.2s"
|
|
48786
|
+
},
|
|
48787
|
+
onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
|
|
48788
|
+
onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
|
|
48789
|
+
children: [
|
|
48790
|
+
/* @__PURE__ */ jsx(Package, { size: 14 }),
|
|
48791
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
48792
|
+
"Assets (",
|
|
48793
|
+
((_e2 = structure.assetFiles) == null ? void 0 : _e2.length) || 0,
|
|
48794
|
+
")"
|
|
48795
|
+
] }),
|
|
48796
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.assets ? "▼" : "▶" })
|
|
48797
|
+
]
|
|
48798
|
+
}
|
|
48799
|
+
)
|
|
48800
|
+
] }),
|
|
48801
|
+
actions && (skill == null ? void 0 : skill.path) && /* @__PURE__ */ jsxs("div", { style: {
|
|
48802
|
+
display: "flex",
|
|
48803
|
+
gap: theme2.space[2]
|
|
48804
|
+
}, children: [
|
|
48805
|
+
/* @__PURE__ */ jsxs(
|
|
48806
|
+
"button",
|
|
48807
|
+
{
|
|
48808
|
+
onClick: () => {
|
|
48809
|
+
var _a2;
|
|
48810
|
+
if (skill == null ? void 0 : skill.path) {
|
|
48811
|
+
(_a2 = actions == null ? void 0 : actions.openFile) == null ? void 0 : _a2.call(actions, skill.path);
|
|
48812
|
+
}
|
|
48813
|
+
},
|
|
48814
|
+
style: {
|
|
48815
|
+
display: "flex",
|
|
48816
|
+
alignItems: "center",
|
|
48817
|
+
gap: theme2.space[1],
|
|
48818
|
+
padding: `${theme2.space[1]} ${theme2.space[2]}`,
|
|
48819
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
48820
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48821
|
+
borderRadius: "6px",
|
|
48822
|
+
color: theme2.colors.text,
|
|
48823
|
+
fontSize: theme2.fontSizes[1],
|
|
48824
|
+
fontFamily: theme2.fonts.body,
|
|
48825
|
+
cursor: "pointer",
|
|
48826
|
+
transition: "all 0.2s"
|
|
48827
|
+
},
|
|
48828
|
+
onMouseEnter: (e) => {
|
|
48829
|
+
e.currentTarget.style.backgroundColor = theme2.colors.primary;
|
|
48830
|
+
e.currentTarget.style.color = theme2.colors.background;
|
|
48831
|
+
e.currentTarget.style.borderColor = theme2.colors.primary;
|
|
48832
|
+
},
|
|
48833
|
+
onMouseLeave: (e) => {
|
|
48834
|
+
e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
|
|
48835
|
+
e.currentTarget.style.color = theme2.colors.text;
|
|
48836
|
+
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
48837
|
+
},
|
|
48838
|
+
title: "Open in file editor",
|
|
48839
|
+
children: [
|
|
48840
|
+
/* @__PURE__ */ jsx(FilePen, { size: 14 }),
|
|
48841
|
+
/* @__PURE__ */ jsx("span", { children: "Edit" })
|
|
48842
|
+
]
|
|
48843
|
+
}
|
|
48844
|
+
),
|
|
48845
|
+
/* @__PURE__ */ jsxs(
|
|
48846
|
+
"button",
|
|
48847
|
+
{
|
|
48848
|
+
onClick: () => {
|
|
48849
|
+
console.log("Open in MDX editor:", skill.path);
|
|
48850
|
+
},
|
|
48851
|
+
style: {
|
|
48852
|
+
display: "flex",
|
|
48853
|
+
alignItems: "center",
|
|
48854
|
+
gap: theme2.space[1],
|
|
48855
|
+
padding: `${theme2.space[1]} ${theme2.space[2]}`,
|
|
48856
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
48857
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
48858
|
+
borderRadius: "6px",
|
|
48859
|
+
color: theme2.colors.text,
|
|
48860
|
+
fontSize: theme2.fontSizes[1],
|
|
48861
|
+
fontFamily: theme2.fonts.body,
|
|
48862
|
+
cursor: "pointer",
|
|
48863
|
+
transition: "all 0.2s"
|
|
48864
|
+
},
|
|
48865
|
+
onMouseEnter: (e) => {
|
|
48866
|
+
e.currentTarget.style.backgroundColor = theme2.colors.secondary;
|
|
48867
|
+
e.currentTarget.style.color = theme2.colors.background;
|
|
48868
|
+
e.currentTarget.style.borderColor = theme2.colors.secondary;
|
|
48869
|
+
},
|
|
48870
|
+
onMouseLeave: (e) => {
|
|
48871
|
+
e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
|
|
48872
|
+
e.currentTarget.style.color = theme2.colors.text;
|
|
48873
|
+
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
48874
|
+
},
|
|
48875
|
+
title: "Open in MDX editor",
|
|
48876
|
+
children: [
|
|
48877
|
+
/* @__PURE__ */ jsx(ExternalLink, { size: 14 }),
|
|
48878
|
+
/* @__PURE__ */ jsx("span", { children: "MDX Editor" })
|
|
48879
|
+
]
|
|
48880
|
+
}
|
|
48881
|
+
)
|
|
48882
|
+
] })
|
|
48585
48883
|
] }),
|
|
48586
|
-
expandedSections.scripts && structure.scriptFiles && structure.scriptFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48884
|
+
expandedSections.scripts && (structure == null ? void 0 : structure.scriptFiles) && structure.scriptFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48587
48885
|
marginTop: theme2.space[2],
|
|
48588
48886
|
padding: theme2.space[2],
|
|
48589
48887
|
backgroundColor: `${theme2.colors.primary}15`,
|
|
@@ -48601,7 +48899,7 @@ const SkillMetadataSection = ({
|
|
|
48601
48899
|
margin: 0,
|
|
48602
48900
|
paddingLeft: theme2.space[3],
|
|
48603
48901
|
listStyle: "none"
|
|
48604
|
-
}, children: structure.scriptFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48902
|
+
}, children: structure == null ? void 0 : structure.scriptFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48605
48903
|
fontSize: theme2.fontSizes[1],
|
|
48606
48904
|
color: theme2.colors.text,
|
|
48607
48905
|
fontFamily: theme2.fonts.monospace,
|
|
@@ -48611,7 +48909,7 @@ const SkillMetadataSection = ({
|
|
|
48611
48909
|
file
|
|
48612
48910
|
] }, idx)) })
|
|
48613
48911
|
] }),
|
|
48614
|
-
expandedSections.references && structure.referenceFiles && structure.referenceFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48912
|
+
expandedSections.references && (structure == null ? void 0 : structure.referenceFiles) && structure.referenceFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48615
48913
|
marginTop: theme2.space[2],
|
|
48616
48914
|
padding: theme2.space[2],
|
|
48617
48915
|
backgroundColor: `${theme2.colors.secondary}15`,
|
|
@@ -48629,7 +48927,7 @@ const SkillMetadataSection = ({
|
|
|
48629
48927
|
margin: 0,
|
|
48630
48928
|
paddingLeft: theme2.space[3],
|
|
48631
48929
|
listStyle: "none"
|
|
48632
|
-
}, children: structure.referenceFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48930
|
+
}, children: structure == null ? void 0 : structure.referenceFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48633
48931
|
fontSize: theme2.fontSizes[1],
|
|
48634
48932
|
color: theme2.colors.text,
|
|
48635
48933
|
fontFamily: theme2.fonts.monospace,
|
|
@@ -48639,7 +48937,7 @@ const SkillMetadataSection = ({
|
|
|
48639
48937
|
file
|
|
48640
48938
|
] }, idx)) })
|
|
48641
48939
|
] }),
|
|
48642
|
-
expandedSections.assets && structure.assetFiles && structure.assetFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48940
|
+
expandedSections.assets && (structure == null ? void 0 : structure.assetFiles) && structure.assetFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
|
|
48643
48941
|
marginTop: theme2.space[2],
|
|
48644
48942
|
padding: theme2.space[2],
|
|
48645
48943
|
backgroundColor: `${theme2.colors.accent}15`,
|
|
@@ -48657,7 +48955,7 @@ const SkillMetadataSection = ({
|
|
|
48657
48955
|
margin: 0,
|
|
48658
48956
|
paddingLeft: theme2.space[3],
|
|
48659
48957
|
listStyle: "none"
|
|
48660
|
-
}, children: structure.assetFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48958
|
+
}, children: structure == null ? void 0 : structure.assetFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
|
|
48661
48959
|
fontSize: theme2.fontSizes[1],
|
|
48662
48960
|
color: theme2.colors.text,
|
|
48663
48961
|
fontFamily: theme2.fonts.monospace,
|
|
@@ -48667,7 +48965,7 @@ const SkillMetadataSection = ({
|
|
|
48667
48965
|
file
|
|
48668
48966
|
] }, idx)) })
|
|
48669
48967
|
] })
|
|
48670
|
-
] })
|
|
48968
|
+
] }) : null
|
|
48671
48969
|
] });
|
|
48672
48970
|
};
|
|
48673
48971
|
const SkillMarkdown = ({
|
|
@@ -48679,10 +48977,16 @@ const SkillMarkdown = ({
|
|
|
48679
48977
|
showRawOnError = false,
|
|
48680
48978
|
containerWidth,
|
|
48681
48979
|
structure,
|
|
48682
|
-
skill
|
|
48980
|
+
skill,
|
|
48981
|
+
actions
|
|
48683
48982
|
}) => {
|
|
48684
48983
|
const [parsed, setParsed] = React2__default.useState(null);
|
|
48685
48984
|
const [headers, setHeaders] = React2__default.useState([]);
|
|
48985
|
+
const [showSearch, setShowSearch] = React2__default.useState(false);
|
|
48986
|
+
const [searchQuery, setSearchQuery] = React2__default.useState("");
|
|
48987
|
+
const [currentMatch, setCurrentMatch] = React2__default.useState(0);
|
|
48988
|
+
const [totalMatches, setTotalMatches] = React2__default.useState(0);
|
|
48989
|
+
const contentRef = React2__default.useRef(null);
|
|
48686
48990
|
React2__default.useEffect(() => {
|
|
48687
48991
|
const skill2 = parseSkillMarkdownGraceful(content2);
|
|
48688
48992
|
setParsed(skill2);
|
|
@@ -48693,6 +48997,133 @@ const SkillMarkdown = ({
|
|
|
48693
48997
|
const extractedHeaders = extractHeaders(skill2.body);
|
|
48694
48998
|
setHeaders(extractedHeaders);
|
|
48695
48999
|
}, [content2, onParsed, onWarnings]);
|
|
49000
|
+
const scrollToMatch = React2__default.useCallback((matches, index2, theme22) => {
|
|
49001
|
+
matches.forEach((m) => {
|
|
49002
|
+
m.style.backgroundColor = "#ffeb3b";
|
|
49003
|
+
m.style.outline = "none";
|
|
49004
|
+
m.style.boxShadow = "none";
|
|
49005
|
+
});
|
|
49006
|
+
if (matches[index2]) {
|
|
49007
|
+
matches[index2].style.backgroundColor = "#ff9800";
|
|
49008
|
+
matches[index2].style.outline = `2px solid ${theme22.colors.primary}`;
|
|
49009
|
+
matches[index2].style.boxShadow = "0 0 8px rgba(255, 152, 0, 0.6)";
|
|
49010
|
+
matches[index2].scrollIntoView({ behavior: "smooth", block: "center" });
|
|
49011
|
+
}
|
|
49012
|
+
}, []);
|
|
49013
|
+
const handleNext = React2__default.useCallback(() => {
|
|
49014
|
+
var _a;
|
|
49015
|
+
if (totalMatches === 0) return;
|
|
49016
|
+
const newIndex = (currentMatch + 1) % totalMatches;
|
|
49017
|
+
setCurrentMatch(newIndex);
|
|
49018
|
+
const matches = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
|
|
49019
|
+
if (matches) {
|
|
49020
|
+
scrollToMatch(Array.from(matches), newIndex, theme2);
|
|
49021
|
+
}
|
|
49022
|
+
}, [totalMatches, currentMatch, theme2, scrollToMatch]);
|
|
49023
|
+
const handlePrevious = React2__default.useCallback(() => {
|
|
49024
|
+
var _a;
|
|
49025
|
+
if (totalMatches === 0) return;
|
|
49026
|
+
const newIndex = currentMatch === 0 ? totalMatches - 1 : currentMatch - 1;
|
|
49027
|
+
setCurrentMatch(newIndex);
|
|
49028
|
+
const matches = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
|
|
49029
|
+
if (matches) {
|
|
49030
|
+
scrollToMatch(Array.from(matches), newIndex, theme2);
|
|
49031
|
+
}
|
|
49032
|
+
}, [totalMatches, currentMatch, theme2, scrollToMatch]);
|
|
49033
|
+
React2__default.useEffect(() => {
|
|
49034
|
+
const handleKeyDown = (e) => {
|
|
49035
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "f") {
|
|
49036
|
+
e.preventDefault();
|
|
49037
|
+
setShowSearch(true);
|
|
49038
|
+
}
|
|
49039
|
+
if (e.key === "Escape" && showSearch) {
|
|
49040
|
+
setShowSearch(false);
|
|
49041
|
+
setSearchQuery("");
|
|
49042
|
+
}
|
|
49043
|
+
if (e.key === "Enter" && showSearch && totalMatches > 0) {
|
|
49044
|
+
e.preventDefault();
|
|
49045
|
+
handleNext();
|
|
49046
|
+
}
|
|
49047
|
+
};
|
|
49048
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
49049
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
49050
|
+
}, [showSearch, totalMatches, handleNext]);
|
|
49051
|
+
React2__default.useEffect(() => {
|
|
49052
|
+
var _a;
|
|
49053
|
+
if (!searchQuery || !contentRef.current) {
|
|
49054
|
+
const highlights = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
|
|
49055
|
+
highlights == null ? void 0 : highlights.forEach((el) => {
|
|
49056
|
+
const parent = el.parentNode;
|
|
49057
|
+
if (parent) {
|
|
49058
|
+
parent.replaceChild(document.createTextNode(el.textContent || ""), el);
|
|
49059
|
+
parent.normalize();
|
|
49060
|
+
}
|
|
49061
|
+
});
|
|
49062
|
+
setTotalMatches(0);
|
|
49063
|
+
setCurrentMatch(0);
|
|
49064
|
+
return;
|
|
49065
|
+
}
|
|
49066
|
+
const container = contentRef.current;
|
|
49067
|
+
const walker = document.createTreeWalker(
|
|
49068
|
+
container,
|
|
49069
|
+
NodeFilter.SHOW_TEXT,
|
|
49070
|
+
null
|
|
49071
|
+
);
|
|
49072
|
+
const textNodes = [];
|
|
49073
|
+
let node2;
|
|
49074
|
+
while (node2 = walker.nextNode()) {
|
|
49075
|
+
textNodes.push(node2);
|
|
49076
|
+
}
|
|
49077
|
+
const oldHighlights = container.querySelectorAll(".search-highlight");
|
|
49078
|
+
oldHighlights.forEach((el) => {
|
|
49079
|
+
const parent = el.parentNode;
|
|
49080
|
+
if (parent) {
|
|
49081
|
+
parent.replaceChild(document.createTextNode(el.textContent || ""), el);
|
|
49082
|
+
parent.normalize();
|
|
49083
|
+
}
|
|
49084
|
+
});
|
|
49085
|
+
const matches = [];
|
|
49086
|
+
const regex2 = new RegExp(searchQuery.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi");
|
|
49087
|
+
textNodes.forEach((textNode) => {
|
|
49088
|
+
var _a2;
|
|
49089
|
+
const text2 = textNode.textContent || "";
|
|
49090
|
+
const matches_in_text = [...text2.matchAll(regex2)];
|
|
49091
|
+
if (matches_in_text.length > 0) {
|
|
49092
|
+
const fragment2 = document.createDocumentFragment();
|
|
49093
|
+
let lastIndex = 0;
|
|
49094
|
+
matches_in_text.forEach((match) => {
|
|
49095
|
+
const matchIndex = match.index;
|
|
49096
|
+
if (matchIndex > lastIndex) {
|
|
49097
|
+
fragment2.appendChild(document.createTextNode(text2.slice(lastIndex, matchIndex)));
|
|
49098
|
+
}
|
|
49099
|
+
const mark2 = document.createElement("mark");
|
|
49100
|
+
mark2.className = "search-highlight";
|
|
49101
|
+
mark2.style.backgroundColor = "#ffeb3b";
|
|
49102
|
+
mark2.style.color = "#000000";
|
|
49103
|
+
mark2.style.fontWeight = "500";
|
|
49104
|
+
mark2.textContent = match[0];
|
|
49105
|
+
fragment2.appendChild(mark2);
|
|
49106
|
+
matches.push(mark2);
|
|
49107
|
+
lastIndex = matchIndex + match[0].length;
|
|
49108
|
+
});
|
|
49109
|
+
if (lastIndex < text2.length) {
|
|
49110
|
+
fragment2.appendChild(document.createTextNode(text2.slice(lastIndex)));
|
|
49111
|
+
}
|
|
49112
|
+
(_a2 = textNode.parentNode) == null ? void 0 : _a2.replaceChild(fragment2, textNode);
|
|
49113
|
+
}
|
|
49114
|
+
});
|
|
49115
|
+
setTotalMatches(matches.length);
|
|
49116
|
+
if (matches.length > 0) {
|
|
49117
|
+
setCurrentMatch(0);
|
|
49118
|
+
scrollToMatch(matches, 0, theme2);
|
|
49119
|
+
}
|
|
49120
|
+
}, [searchQuery, parsed, theme2, scrollToMatch]);
|
|
49121
|
+
const handleCloseSearch = () => {
|
|
49122
|
+
setShowSearch(false);
|
|
49123
|
+
setSearchQuery("");
|
|
49124
|
+
setCurrentMatch(0);
|
|
49125
|
+
setTotalMatches(0);
|
|
49126
|
+
};
|
|
48696
49127
|
if (!theme2 || !theme2.space) {
|
|
48697
49128
|
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." }) });
|
|
48698
49129
|
}
|
|
@@ -48728,7 +49159,20 @@ const SkillMarkdown = ({
|
|
|
48728
49159
|
background: theme2.colors.background
|
|
48729
49160
|
},
|
|
48730
49161
|
children: [
|
|
48731
|
-
|
|
49162
|
+
showSearch && /* @__PURE__ */ jsx(
|
|
49163
|
+
SearchBar,
|
|
49164
|
+
{
|
|
49165
|
+
theme: theme2,
|
|
49166
|
+
searchQuery,
|
|
49167
|
+
onSearchChange: setSearchQuery,
|
|
49168
|
+
currentMatch,
|
|
49169
|
+
totalMatches,
|
|
49170
|
+
onPrevious: handlePrevious,
|
|
49171
|
+
onNext: handleNext,
|
|
49172
|
+
onClose: handleCloseSearch
|
|
49173
|
+
}
|
|
49174
|
+
),
|
|
49175
|
+
/* @__PURE__ */ jsx("div", { style: { padding: theme2.space[3], paddingBottom: 0 }, children: /* @__PURE__ */ jsx(SkillMetadataSection, { metadata: parsed.metadata, theme: theme2, structure, skill, actions }) }),
|
|
48732
49176
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
|
|
48733
49177
|
/* @__PURE__ */ jsx(
|
|
48734
49178
|
SkillSidebar,
|
|
@@ -48739,7 +49183,7 @@ const SkillMarkdown = ({
|
|
|
48739
49183
|
skill
|
|
48740
49184
|
}
|
|
48741
49185
|
),
|
|
48742
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }, children: /* @__PURE__ */ jsx(
|
|
49186
|
+
/* @__PURE__ */ jsx("div", { ref: contentRef, style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }, children: /* @__PURE__ */ jsx(
|
|
48743
49187
|
IndustryMarkdownSlide,
|
|
48744
49188
|
{
|
|
48745
49189
|
content: parsed.body,
|
|
@@ -48911,7 +49355,8 @@ const SkillDetailPanel = ({
|
|
|
48911
49355
|
referenceFiles: skill.referenceFiles,
|
|
48912
49356
|
assetFiles: skill.assetFiles
|
|
48913
49357
|
},
|
|
48914
|
-
skill
|
|
49358
|
+
skill,
|
|
49359
|
+
actions
|
|
48915
49360
|
}
|
|
48916
49361
|
) }) }) : /* @__PURE__ */ jsx(
|
|
48917
49362
|
"div",
|