specra 0.2.55 → 0.2.57
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.
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{title}
|
|
28
28
|
</h3>
|
|
29
29
|
{#if description}
|
|
30
|
-
<p class="text-sm text-muted-foreground
|
|
30
|
+
<p class="text-sm text-muted-foreground no-underline">{description}</p>
|
|
31
31
|
{/if}
|
|
32
32
|
{#if children}
|
|
33
33
|
<div class="mt-2 text-sm text-muted-foreground no-underline">
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
{#if href}
|
|
51
51
|
<a
|
|
52
52
|
{href}
|
|
53
|
-
class="card-link group block p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all"
|
|
53
|
+
class="card-link group block h-full p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all"
|
|
54
54
|
target={external ? '_blank' : undefined}
|
|
55
55
|
rel={external ? 'noopener noreferrer' : undefined}
|
|
56
56
|
>
|
|
57
57
|
{@render cardContent(true)}
|
|
58
58
|
</a>
|
|
59
59
|
{:else}
|
|
60
|
-
<div class="p-4 rounded-xl border border-border bg-muted/30 no-underline">
|
|
60
|
+
<div class="h-full p-4 rounded-xl border border-border bg-muted/30 no-underline">
|
|
61
61
|
{@render cardContent(false)}
|
|
62
62
|
</div>
|
|
63
63
|
{/if}
|
|
@@ -88,16 +88,30 @@
|
|
|
88
88
|
);
|
|
89
89
|
|
|
90
90
|
let filteredDocs = $derived.by(() => {
|
|
91
|
-
if (hasTabGroups
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
91
|
+
if (!hasTabGroups) return docs;
|
|
92
|
+
|
|
93
|
+
// Fall back to the first tab group when activeTabGroup isn't set —
|
|
94
|
+
// that happens whenever the current doc has no `tab_group` in its
|
|
95
|
+
// frontmatter and no `_category_.json` ancestor with a tab_group.
|
|
96
|
+
// Without this fallback the sidebar bypasses tab filtering entirely
|
|
97
|
+
// and renders every doc, while the tab bar still visually highlights
|
|
98
|
+
// the first tab (TabGroups.svelte applies the same fallback on its
|
|
99
|
+
// own `activeTab`). The end result looked like "every tab contains
|
|
100
|
+
// every doc" — but the real cause was that the sidebar's filter just
|
|
101
|
+
// wasn't running.
|
|
102
|
+
const effectiveTabGroup =
|
|
103
|
+
activeTabGroup || config.navigation?.tabGroups?.[0]?.id;
|
|
104
|
+
if (!effectiveTabGroup) return docs;
|
|
105
|
+
|
|
106
|
+
const firstTabId = config.navigation?.tabGroups?.[0]?.id;
|
|
107
|
+
return docs.filter((doc) => {
|
|
108
|
+
const docTabGroup = doc.meta?.tab_group || doc.categoryTabGroup;
|
|
109
|
+
if (!docTabGroup) {
|
|
110
|
+
// Unlabeled docs land in the first tab group (Getting Started).
|
|
111
|
+
return effectiveTabGroup === firstTabId;
|
|
112
|
+
}
|
|
113
|
+
return docTabGroup === effectiveTabGroup;
|
|
114
|
+
});
|
|
101
115
|
});
|
|
102
116
|
|
|
103
117
|
// Build hierarchical tree structure
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specra",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.57",
|
|
4
4
|
"description": "A modern documentation library for SvelteKit with built-in versioning, API reference generation, full-text search, and MDX support",
|
|
5
5
|
"svelte": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|