@xyz/navigation 1.2.0 → 1.2.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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0 || ^4.0.0"
6
6
  },
7
- "version": "1.2.0",
7
+ "version": "1.2.2",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -1,4 +1,4 @@
1
- import type { NavigationConfig, NavigationResult, UseNavigationOptions } from '../types/index.js';
1
+ import type { NavigationConfig, NavigationResult, UseNavigationOptions, NavigationSection } from '../types/index.js';
2
2
  /**
3
3
  * Main navigation composable
4
4
  * Processes navigation configuration and returns resolved items
@@ -15,5 +15,7 @@ import type { NavigationConfig, NavigationResult, UseNavigationOptions } from '.
15
15
  * const { sections } = useNavigation(config)
16
16
  * // sections.app.value → processed items
17
17
  * ```
18
+ * Main composable for context-aware navigation
19
+ * Auto-uses navigationConfig if no config provided
18
20
  */
19
- export declare function useNavigation<T extends NavigationConfig>(config: T, options?: UseNavigationOptions): NavigationResult<T>;
21
+ export declare function useNavigation<T extends Record<string, NavigationSection>>(config?: NavigationConfig<T>, options?: UseNavigationOptions): NavigationResult<T>;
@@ -1,5 +1,6 @@
1
1
  import { computed, isRef, unref } from "vue";
2
2
  import { useNuxtApp } from "#app";
3
+ import navigationConfig from "#build/navigation-config";
3
4
  import { useNavigationContext } from "./useNavigationContext.js";
4
5
  import { processNavigationItems } from "../utils/processor.js";
5
6
  import { createTemplateRegistry } from "../config/default-templates.js";
@@ -8,7 +9,7 @@ import { computeActiveStates } from "../utils/active-state.js";
8
9
  function isNestedSection(section) {
9
10
  return typeof section === "object" && !Array.isArray(section) && ("items" in section || "children" in section || "footer" in section || "header" in section);
10
11
  }
11
- export function useNavigation(config, options = {}) {
12
+ export function useNavigation(config = navigationConfig, options = {}) {
12
13
  if (import.meta.dev) {
13
14
  validateNavigationConfig(config);
14
15
  }
@@ -78,7 +79,9 @@ export function useNavigation(config, options = {}) {
78
79
  };
79
80
  return {
80
81
  sections,
81
- // Unwrapped: sections.app.items (no .value)
82
+ // Grouped: sections.value.app, sections.value.organization
83
+ ...sectionsRaw,
84
+ // Individual: app.value, organization.value
82
85
  context,
83
86
  refresh
84
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyz/navigation",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Context-aware, type-safe navigation for multi-tenant Nuxt applications",
5
5
  "type": "module",
6
6
  "exports": {
@@ -49,12 +49,12 @@
49
49
  "license": "MIT",
50
50
  "repository": {
51
51
  "type": "git",
52
- "url": "git+https://github.com/xyz/xyz-navigation.git"
52
+ "url": "git+https://github.com/xyzhub/xyz-navigation.git"
53
53
  },
54
54
  "bugs": {
55
- "url": "https://github.com/xyz/xyz-navigation/issues"
55
+ "url": "https://github.com/xyzhub/xyz-navigation/issues"
56
56
  },
57
- "homepage": "https://github.com/xyz/xyz-navigation#readme",
57
+ "homepage": "https://github.com/xyzhub/xyz-navigation#readme",
58
58
  "dependencies": {
59
59
  "defu": "^6.1.4"
60
60
  },