@shwfed/nuxt 0.1.63 → 0.1.65
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/module.d.mts +57 -20
- package/dist/module.json +1 -1
- package/dist/module.mjs +10 -1
- package/dist/runtime/components/app.d.vue.ts +3 -78
- package/dist/runtime/components/app.vue +411 -558
- package/dist/runtime/components/app.vue.d.ts +3 -78
- package/dist/runtime/components/ui/sidebar/SidebarGroup.vue +1 -1
- package/dist/runtime/components/ui/sidebar/SidebarGroupLabel.vue +1 -1
- package/dist/runtime/components/ui/sidebar/SidebarMenu.vue +1 -1
- package/dist/runtime/composables/useFavorite.d.ts +23 -0
- package/dist/runtime/composables/useFavorite.js +68 -0
- package/dist/runtime/composables/useNavigationTabs.d.ts +7 -0
- package/dist/runtime/composables/useNavigationTabs.js +65 -0
- package/dist/runtime/plugins/api/index.js +15 -23
- package/dist/runtime/plugins/cel/env.js +62 -3
- package/dist/runtime/utils/command-palette.d.ts +71 -0
- package/dist/runtime/utils/command-palette.js +72 -0
- package/dist/runtime/utils/command.d.ts +15 -0
- package/dist/runtime/utils/command.js +28 -0
- package/dist/runtime/utils/route.d.ts +2 -0
- package/dist/runtime/utils/route.js +14 -0
- package/dist/runtime/utils/sidebar-fallback.d.ts +16 -0
- package/dist/runtime/utils/sidebar-fallback.js +32 -0
- package/package.json +1 -2
- package/dist/runtime/server/tsconfig.json +0 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { normalizeRoutePath } from "./route.js";
|
|
2
|
+
function isRouteItem(item) {
|
|
3
|
+
return "route" in item;
|
|
4
|
+
}
|
|
5
|
+
export function getDefaultNavigationRoute(items) {
|
|
6
|
+
for (const item of items) {
|
|
7
|
+
if (isRouteItem(item))
|
|
8
|
+
return normalizeRoutePath(item.route);
|
|
9
|
+
const firstChildRoute = item.children[0]?.route;
|
|
10
|
+
if (firstChildRoute)
|
|
11
|
+
return normalizeRoutePath(firstChildRoute);
|
|
12
|
+
}
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
export function hasRootNavigation(items) {
|
|
16
|
+
return items.some((item) => {
|
|
17
|
+
if (isRouteItem(item))
|
|
18
|
+
return normalizeRoutePath(item.route) === "/";
|
|
19
|
+
return item.children.some((child) => normalizeRoutePath(child.route) === "/");
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function applyRootNavigationFallback(options) {
|
|
23
|
+
if (normalizeRoutePath(options.path) !== "/")
|
|
24
|
+
return;
|
|
25
|
+
if (hasRootNavigation(options.items))
|
|
26
|
+
return;
|
|
27
|
+
const fallbackRoute = getDefaultNavigationRoute(options.items);
|
|
28
|
+
if (!fallbackRoute || fallbackRoute === "/")
|
|
29
|
+
return;
|
|
30
|
+
options.tabs.delete("/");
|
|
31
|
+
options.activateTab(fallbackRoute);
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shwfed/nuxt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.65",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"effect": "^3.19.15",
|
|
55
55
|
"markdown-it": "^14.1.0",
|
|
56
56
|
"mutative": "^1.3.0",
|
|
57
|
-
"nzh": "^1.0.14",
|
|
58
57
|
"reka-ui": "^2.7.0",
|
|
59
58
|
"tailwind-merge": "^3.4.0",
|
|
60
59
|
"vue": "^3.5.27",
|