@zpress/core 0.6.0 → 0.6.2
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/index.mjs +23 -5
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -27775,15 +27775,13 @@ function buildNavEntry(entry) {
|
|
|
27775
27775
|
const link = sidebar_resolveLink(entry);
|
|
27776
27776
|
const children = resolveChildren(entry);
|
|
27777
27777
|
return {
|
|
27778
|
-
|
|
27778
|
+
text: entry.title,
|
|
27779
27779
|
link,
|
|
27780
27780
|
...maybeChildren(children)
|
|
27781
27781
|
};
|
|
27782
27782
|
}
|
|
27783
27783
|
function generateNav(config, resolved) {
|
|
27784
|
-
if ('auto' !== config.nav && void 0 !== config.nav) return
|
|
27785
|
-
...config.nav
|
|
27786
|
-
];
|
|
27784
|
+
if ('auto' !== config.nav && void 0 !== config.nav) return config.nav.map(mapNavItem);
|
|
27787
27785
|
const visible = resolved.filter((e)=>!e.hidden);
|
|
27788
27786
|
const nonIsolated = visible.filter((e)=>!e.isolated).slice(0, 3);
|
|
27789
27787
|
const isolated = visible.filter((e)=>e.isolated);
|
|
@@ -27817,7 +27815,7 @@ function sidebar_resolveLink(entry) {
|
|
|
27817
27815
|
}
|
|
27818
27816
|
function resolveChildren(entry) {
|
|
27819
27817
|
if (entry.isolated && entry.items && entry.items.length > 0) return entry.items.filter((child)=>!child.hidden).map((child)=>({
|
|
27820
|
-
|
|
27818
|
+
text: child.title,
|
|
27821
27819
|
link: resolveChildLink(child)
|
|
27822
27820
|
})).filter((child)=>void 0 !== child.link);
|
|
27823
27821
|
}
|
|
@@ -27831,6 +27829,26 @@ function maybeChildren(children) {
|
|
|
27831
27829
|
};
|
|
27832
27830
|
return {};
|
|
27833
27831
|
}
|
|
27832
|
+
function maybeActiveMatch(item) {
|
|
27833
|
+
if (item.activeMatch) return {
|
|
27834
|
+
activeMatch: item.activeMatch
|
|
27835
|
+
};
|
|
27836
|
+
return {};
|
|
27837
|
+
}
|
|
27838
|
+
function maybeItems(item) {
|
|
27839
|
+
if (item.items) return {
|
|
27840
|
+
items: item.items.map(mapNavItem)
|
|
27841
|
+
};
|
|
27842
|
+
return {};
|
|
27843
|
+
}
|
|
27844
|
+
function mapNavItem(item) {
|
|
27845
|
+
return {
|
|
27846
|
+
text: item.title,
|
|
27847
|
+
link: item.link,
|
|
27848
|
+
...maybeActiveMatch(item),
|
|
27849
|
+
...maybeItems(item)
|
|
27850
|
+
};
|
|
27851
|
+
}
|
|
27834
27852
|
async function generateLandingContent(sectionText, description, children, iconColor) {
|
|
27835
27853
|
const visible = children.filter((c)=>!c.hidden && c.link);
|
|
27836
27854
|
const useWorkspace = visible.some((c)=>c.card);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zpress/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Sync engine and asset utilities for zpress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"gray-matter": "^4.0.3",
|
|
38
38
|
"jiti": "^2.6.1",
|
|
39
39
|
"ts-pattern": "^5.9.0",
|
|
40
|
-
"@zpress/config": "0.2.
|
|
41
|
-
"@zpress/theme": "0.
|
|
40
|
+
"@zpress/config": "0.2.2",
|
|
41
|
+
"@zpress/theme": "0.3.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@rslib/core": "^0.20.0",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "rslib build",
|
|
52
52
|
"dev": "rslib build --watch --no-clean",
|
|
53
|
+
"test": "vitest run",
|
|
53
54
|
"typecheck": "tsc --noEmit"
|
|
54
55
|
}
|
|
55
56
|
}
|