mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 00:41:09 +02:00
fix(matrix-web): inline navigation stores to avoid shared-stores dependency
Remove external dependency on @manacore/shared-stores and create local implementation using Svelte 5 runes for better build compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
95cd14202d
commit
5663c3d3ce
3 changed files with 38 additions and 4 deletions
|
|
@ -26,7 +26,6 @@ COPY packages/shared-icons ./packages/shared-icons
|
|||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,39 @@
|
|||
import { createSimpleNavigationStores } from '@manacore/shared-stores';
|
||||
// Local implementation of navigation stores
|
||||
// Previously imported from @manacore/shared-stores, now inlined to avoid dependency issues
|
||||
|
||||
export const { isSidebarMode, isNavCollapsed } = createSimpleNavigationStores();
|
||||
import { browser } from '$app/environment';
|
||||
|
||||
// Check if on mobile/tablet width
|
||||
function checkSidebarMode(): boolean {
|
||||
if (!browser) return false;
|
||||
return window.innerWidth < 1024;
|
||||
}
|
||||
|
||||
// Create reactive stores using Svelte 5 runes
|
||||
let _isSidebarMode = $state(checkSidebarMode());
|
||||
let _isNavCollapsed = $state(false);
|
||||
|
||||
// Listen for resize events
|
||||
if (browser) {
|
||||
window.addEventListener('resize', () => {
|
||||
_isSidebarMode = checkSidebarMode();
|
||||
});
|
||||
}
|
||||
|
||||
export const isSidebarMode = {
|
||||
get value() {
|
||||
return _isSidebarMode;
|
||||
},
|
||||
};
|
||||
|
||||
export const isNavCollapsed = {
|
||||
get value() {
|
||||
return _isNavCollapsed;
|
||||
},
|
||||
toggle() {
|
||||
_isNavCollapsed = !_isNavCollapsed;
|
||||
},
|
||||
set(value: boolean) {
|
||||
_isNavCollapsed = value;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ const MANACORE_SHARED_PACKAGES = [
|
|||
'@manacore/shared-splitscreen',
|
||||
'@manacore/shared-utils',
|
||||
'@manacore/shared-tags',
|
||||
'@manacore/shared-stores',
|
||||
'@manacore/shared-help-types',
|
||||
'@manacore/shared-help-content',
|
||||
'@manacore/shared-help-ui',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue