@vc-shell/framework 2.5.0-pr313.14efcac → 2.5.0-pr314.c87af9d

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.
@@ -1,9 +1,22 @@
1
- import { type Ref } from "vue";
1
+ import type { Ref } from "vue";
2
+ /**
3
+ * @deprecated Use `UseSidebarStateReturn` from `useSidebarState`. Will be removed in the
4
+ * next major.
5
+ */
2
6
  export interface UseMenuExpandedReturn {
3
7
  isExpanded: Ref<boolean>;
4
8
  toggleExpanded: () => void;
5
9
  isHoverExpanded: Ref<boolean>;
6
10
  toggleHoverExpanded: (shouldExpand?: boolean) => void;
7
11
  }
12
+ /**
13
+ * Sidebar pinned/hover state with localStorage persistence.
14
+ *
15
+ * @deprecated Use `useSidebarState()`. Will be removed in the next major.
16
+ *
17
+ * Each call builds its own instance, so the returned `isHoverExpanded` is NOT the
18
+ * one the sidebar renders from - only the pinned state is shared, through the
19
+ * localStorage key. `useSidebarState()` returns the single provided instance.
20
+ */
8
21
  export declare const useMenuExpanded: () => UseMenuExpandedReturn;
9
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useMenuExpanded/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,mBAAmB,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACvD;AAgBD,eAAO,MAAM,eAAe,QAAO,qBA8ClC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useMenuExpanded/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG/B;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,mBAAmB,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACvD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,QAAO,qBASlC,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { Ref, ComputedRef } from "vue";
2
+ export interface SidebarState {
3
+ /** Sidebar is pinned open by user (persisted to localStorage) */
4
+ isPinned: Ref<boolean>;
5
+ /** Sidebar is temporarily expanded on mouse hover (desktop only) */
6
+ isHoverExpanded: Ref<boolean>;
7
+ /** Mobile menu overlay is visible */
8
+ isMenuOpen: Ref<boolean>;
9
+ /** Derived: sidebar content should render in expanded mode (pinned OR hovered) */
10
+ isExpanded: ComputedRef<boolean>;
11
+ }
12
+ export interface SidebarActions {
13
+ /** Toggle the pinned state (persists to localStorage) */
14
+ togglePin: () => void;
15
+ /** Set hover expansion state with delay for opening */
16
+ setHoverExpanded: (value: boolean) => void;
17
+ /** Open the mobile menu / widget overlay */
18
+ openMenu: () => void;
19
+ /** Close the mobile menu / widget overlay */
20
+ closeMenu: () => void;
21
+ }
22
+ export type UseSidebarStateReturn = SidebarState & SidebarActions;
23
+ /** @deprecated Use UseSidebarStateReturn instead */
24
+ export type SidebarStateReturn = UseSidebarStateReturn;
25
+ /**
26
+ * Shape of a freshly built instance. Identical to `UseSidebarStateReturn` except that
27
+ * `setHoverExpanded` also accepts `undefined` as a no-op, which the deprecated
28
+ * `useMenuExpanded` adapter forwards. Assignable to `UseSidebarStateReturn`.
29
+ */
30
+ export type SidebarStateInstance = Omit<UseSidebarStateReturn, "setHoverExpanded"> & {
31
+ setHoverExpanded: (value?: boolean) => void;
32
+ };
33
+ /**
34
+ * localStorage key holding the pinned state, scoped per application.
35
+ * The app name defaults to the first segment of `window.location.pathname`
36
+ * ("/vendor-portal/" -> "vendor-portal"), so several vc-shell apps on one
37
+ * domain keep independent sidebar states.
38
+ */
39
+ export declare function sidebarStorageKey(appName?: string): string;
40
+ /**
41
+ * Builds a standalone sidebar state instance. Not provided, not shared:
42
+ * `provideSidebarState()` owns the one instance the component tree sees, and the
43
+ * deprecated `useMenuExpanded()` builds its own because it may be called outside
44
+ * the VcApp tree, where no provider exists.
45
+ */
46
+ export declare function createSidebarStateInstance(): SidebarStateInstance;
47
+ //# sourceMappingURL=_internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_internal.d.ts","sourceRoot":"","sources":["../../../../core/composables/useSidebarState/_internal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAG5C,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,oEAAoE;IACpE,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,qCAAqC;IACrC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,kFAAkF;IAClF,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,uDAAuD;IACvD,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,cAAc,CAAC;AAElE,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,GAAG;IACnF,gBAAgB,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7C,CAAC;AAKF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,oBAAoB,CA0DjE"}
@@ -1,32 +1,9 @@
1
- import type { Ref, ComputedRef } from "vue";
2
- export interface SidebarState {
3
- /** Sidebar is pinned open by user (persisted to localStorage) */
4
- isPinned: Ref<boolean>;
5
- /** Sidebar is temporarily expanded on mouse hover (desktop only) */
6
- isHoverExpanded: Ref<boolean>;
7
- /** Mobile menu overlay is visible */
8
- isMenuOpen: Ref<boolean>;
9
- /** Derived: sidebar content should render in expanded mode (pinned OR hovered) */
10
- isExpanded: ComputedRef<boolean>;
11
- }
12
- export interface SidebarActions {
13
- /** Toggle the pinned state (persists to localStorage) */
14
- togglePin: () => void;
15
- /** Set hover expansion state with delay for opening */
16
- setHoverExpanded: (value: boolean) => void;
17
- /** Open the mobile menu / widget overlay */
18
- openMenu: () => void;
19
- /** Close the mobile menu / widget overlay */
20
- closeMenu: () => void;
21
- }
22
- export type UseSidebarStateReturn = SidebarState & SidebarActions;
23
- /** @deprecated Use UseSidebarStateReturn instead */
24
- export type SidebarStateReturn = UseSidebarStateReturn;
1
+ import type { UseSidebarStateReturn } from "./_internal";
2
+ export type { SidebarState, SidebarActions, UseSidebarStateReturn, SidebarStateReturn } from "./_internal";
3
+ export { sidebarStorageKey } from "./_internal";
25
4
  /**
26
5
  * Provides sidebar state to the component tree. Must be called once in VcApp setup.
27
- * Idempotent: returns existing instance if already provided in the current tree.
28
- * Internally delegates to useMenuExpanded() for shared reactive state,
29
- * ensuring UserDropdownButton (which uses useMenuExpanded directly) stays in sync.
6
+ * Idempotent: returns the existing instance if already provided in the current tree.
30
7
  */
31
8
  export declare function provideSidebarState(): UseSidebarStateReturn;
32
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useSidebarState/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAgB,MAAM,KAAK,CAAC;AAG1D,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,oEAAoE;IACpE,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,qCAAqC;IACrC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,kFAAkF;IAClF,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,uDAAuD;IACvD,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,cAAc,CAAC;AAElE,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAIvD;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,qBAAqB,CAoC3D;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,qBAAqB,CAMvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useSidebarState/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,qBAAqB,CAQ3D;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,qBAAqB,CAMvD"}