@umami/shiso 1.0.0 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/shiso",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Open-source documentation framework for Markdown and MDX sites.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -94,6 +94,7 @@ export function Docs({ page, doc, site }: DocsProps) {
94
94
  tabs={tabs}
95
95
  navigation={navigation}
96
96
  anchors={scopeDocs.anchors}
97
+ activeTabId={page.tabId}
97
98
  drilldown={site.drilldown}
98
99
  navigationLabel={site.labels.documentationNavigation}
99
100
  expandLabel={site.labels.expand}
@@ -108,6 +109,7 @@ export function Docs({ page, doc, site }: DocsProps) {
108
109
  tabs={tabs}
109
110
  navigation={navigation}
110
111
  anchors={scopeDocs.anchors}
112
+ activeTabId={page.tabId}
111
113
  isSticky
112
114
  drilldown={site.drilldown}
113
115
  navigationLabel={site.labels.documentationNavigation}
@@ -21,6 +21,7 @@ export interface SideNavProps {
21
21
  tabs: DocsTab[];
22
22
  navigation: Record<string, NavNode[]>;
23
23
  anchors: NavNode[];
24
+ activeTabId: string;
24
25
  isSticky?: boolean;
25
26
  drilldown?: boolean;
26
27
  navigationLabel: string;
@@ -307,6 +308,7 @@ export function SideNav({
307
308
  tabs,
308
309
  navigation,
309
310
  anchors,
311
+ activeTabId,
310
312
  isSticky,
311
313
  drilldown,
312
314
  navigationLabel,
@@ -314,11 +316,7 @@ export function SideNav({
314
316
  collapseLabel,
315
317
  }: SideNavProps) {
316
318
  const { pathname } = useLocation();
317
-
318
- const tab = [...tabs]
319
- .sort((a, b) => b.url.length - a.url.length)
320
- .find(item => pathname === item.url || pathname.startsWith(`${item.url}/`));
321
- const nodes = navigation[tab?.id || tabs?.[0]?.id] || [];
319
+ const nodes = navigation[activeTabId] || navigation[tabs[0]?.id] || [];
322
320
 
323
321
  return (
324
322
  <ScrollArea className={classNames('w-full max-w-full', { 'h-full': isSticky })}>