jamdesk 1.1.170 → 1.1.171
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamdesk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.171",
|
|
4
4
|
"description": "CLI for Jamdesk — build, preview, and deploy documentation sites from MDX. Dev server with hot reload, 50+ components, OpenAPI support, AI search, and Mintlify migration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jamdesk",
|
|
@@ -433,13 +433,28 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
|
|
|
433
433
|
// Prevent body scroll when sidebar is open on mobile
|
|
434
434
|
useBodyScrollLock(isOpen);
|
|
435
435
|
|
|
436
|
-
//
|
|
437
|
-
//
|
|
438
|
-
// prefetch (see renderGroupContents)
|
|
436
|
+
// Top-level section titles never collapse; clicking one navigates to the
|
|
437
|
+
// section's first page. The key is still marked expanded so the section's
|
|
438
|
+
// Links upgrade to prefetch (see renderGroupContents).
|
|
439
439
|
// The router.push must run AFTER the setState commits — calling it inside the
|
|
440
440
|
// updater triggers "Cannot update a component (Router) while rendering Sidebar".
|
|
441
|
-
const
|
|
442
|
-
|
|
441
|
+
const handleTopLevelGroupClick = useCallback((group: ResolvedGroup, key: string) => {
|
|
442
|
+
setExpandedGroups(prev => {
|
|
443
|
+
if (prev.has(key)) return prev;
|
|
444
|
+
const newSet = new Set(prev);
|
|
445
|
+
newSet.add(key);
|
|
446
|
+
return newSet;
|
|
447
|
+
});
|
|
448
|
+
const firstPagePath = findFirstPageInGroups([group]);
|
|
449
|
+
if (firstPagePath) {
|
|
450
|
+
handleButtonNav(`${linkPrefix}/${firstPagePath}`);
|
|
451
|
+
}
|
|
452
|
+
}, [linkPrefix, handleButtonNav]);
|
|
453
|
+
|
|
454
|
+
// Toggle a nested group's accordion. Expanding only reveals the pages —
|
|
455
|
+
// navigation happens when the visitor clicks a page link, never on the
|
|
456
|
+
// caret itself.
|
|
457
|
+
const handleGroupClick = useCallback((key: string) => {
|
|
443
458
|
setExpandedGroups(prev => {
|
|
444
459
|
const newSet = new Set(prev);
|
|
445
460
|
if (prev.has(key)) {
|
|
@@ -449,13 +464,7 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
|
|
|
449
464
|
}
|
|
450
465
|
return newSet;
|
|
451
466
|
});
|
|
452
|
-
|
|
453
|
-
const firstPagePath = findFirstPageInGroups([group]);
|
|
454
|
-
if (firstPagePath) {
|
|
455
|
-
handleButtonNav(`${linkPrefix}/${firstPagePath}`);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}, [linkPrefix, expandedGroups, handleButtonNav]);
|
|
467
|
+
}, []);
|
|
459
468
|
|
|
460
469
|
// Render the pages and nested groups inside a group. Split out from
|
|
461
470
|
// renderGroup so a named group can gate its contents behind an expanded panel
|
|
@@ -574,7 +583,7 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
|
|
|
574
583
|
{group.name && (
|
|
575
584
|
<button
|
|
576
585
|
type="button"
|
|
577
|
-
onClick={() =>
|
|
586
|
+
onClick={() => handleTopLevelGroupClick(group, key)}
|
|
578
587
|
className="flex items-center justify-between w-full text-left mb-2 cursor-pointer"
|
|
579
588
|
>
|
|
580
589
|
<span className="text-sm font-semibold text-[var(--color-text-tertiary)] flex items-center gap-2">
|
|
@@ -606,7 +615,7 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
|
|
|
606
615
|
type="button"
|
|
607
616
|
aria-expanded={isExpanded}
|
|
608
617
|
aria-controls={panelId}
|
|
609
|
-
onClick={() => handleGroupClick(
|
|
618
|
+
onClick={() => handleGroupClick(key)}
|
|
610
619
|
className={buttonClassName}
|
|
611
620
|
>
|
|
612
621
|
{group.icon && (
|