@avora-labs/meta-forge 1.7.0 → 1.7.1

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.
@@ -2299,6 +2299,7 @@ class MetaRouterService {
2299
2299
  { path: '**', redirectTo: defaultPath }
2300
2300
  ];
2301
2301
  this.router.resetConfig(finalConfig);
2302
+ this.router.initialNavigation();
2302
2303
  console.log('[AvoraMetaForge] Router configured with', finalConfig.length, 'routes');
2303
2304
  }
2304
2305
  /**
@@ -5370,12 +5371,6 @@ class AppConfigService {
5370
5371
  const compact = this.stateService.get('settings.compactSidebar');
5371
5372
  if (compact !== undefined && compact !== null)
5372
5373
  this.sidebarCollapsed.set(Boolean(compact));
5373
- // Restore dark/light mode preference (default is dark)
5374
- const darkMode = this.stateService.get('settings.darkMode');
5375
- // If no preference is stored yet, default to dark (no attribute = dark variables from :root)
5376
- if (darkMode !== undefined && darkMode !== null) {
5377
- this.applyColorScheme(Boolean(darkMode));
5378
- }
5379
5374
  }
5380
5375
  /**
5381
5376
  * Called whenever a settings.* state key changes (e.g. after the Settings
@@ -5392,8 +5387,8 @@ class AppConfigService {
5392
5387
  case 'settings.compactSidebar':
5393
5388
  this.sidebarCollapsed.set(Boolean(value));
5394
5389
  break;
5390
+ // Dark mode is handled exclusively by ThemeService now
5395
5391
  case 'settings.darkMode':
5396
- this.applyColorScheme(Boolean(value));
5397
5392
  break;
5398
5393
  case 'settings.language':
5399
5394
  // Language preference is stored; full i18n runtime switching requires
@@ -5404,20 +5399,6 @@ class AppConfigService {
5404
5399
  break;
5405
5400
  }
5406
5401
  }
5407
- /**
5408
- * Toggles dark / light mode by setting data-color-scheme on <html>.
5409
- * Dark mode = no attribute (uses :root CSS vars from _variables.scss).
5410
- * Light mode = data-color-scheme="light" (overrides via _themes.scss).
5411
- */
5412
- applyColorScheme(isDark) {
5413
- const html = document.documentElement;
5414
- if (isDark) {
5415
- html.removeAttribute('data-color-scheme');
5416
- }
5417
- else {
5418
- html.setAttribute('data-color-scheme', 'light');
5419
- }
5420
- }
5421
5402
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AppConfigService, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
5422
5403
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AppConfigService, providedIn: 'root' });
5423
5404
  }
@@ -5613,6 +5594,7 @@ class ThemeService {
5613
5594
  config = signal(DEFAULT_THEME_CONFIG, ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
5614
5595
  // Customizer UI State
5615
5596
  customizerOpen = signal(false, ...(ngDevMode ? [{ debugName: "customizerOpen" }] : /* istanbul ignore next */ []));
5597
+ stateService = inject(MetaStateService);
5616
5598
  constructor(platformId) {
5617
5599
  this.platformId = platformId;
5618
5600
  if (isPlatformBrowser(this.platformId)) {
@@ -5623,6 +5605,11 @@ class ThemeService {
5623
5605
  this.saveConfig(currentConfig);
5624
5606
  this.applyTheme(currentConfig);
5625
5607
  });
5608
+ // Sync from MetaStateService (e.g. from Settings page)
5609
+ this.stateService.changes$.pipe(filter(change => change.key === 'settings.darkMode')).subscribe(change => {
5610
+ const isDark = Boolean(change.newValue);
5611
+ this.updateConfig({ colorScheme: isDark ? 'dark' : 'light' });
5612
+ });
5626
5613
  }
5627
5614
  }
5628
5615
  updateConfig(partial) {