@rxap/ngx-theme 21.0.1-dev.0 → 21.0.1-dev.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.
- package/CHANGELOG.md +18 -0
- package/compodoc/changelog.html +17 -0
- package/compodoc/dependencies.html +4 -4
- package/compodoc/injectables/ThemeModeService.html +94 -83
- package/compodoc/injectables/ThemeService.html +58 -83
- package/compodoc/interfaces/ColorPaletteConfig.html +8 -3
- package/compodoc/interfaces/ColorPaletteConfigWithName.html +8 -3
- package/compodoc/interfaces/ThemeConfig.html +8 -3
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +479 -541
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/ThemeModeService.html +6 -6
- package/docs/html/classes/ThemeService.html +2 -2
- package/docs/html/enums/ColorPaletteAlgorithm.html +2 -2
- package/docs/html/functions/ComputeColorPalette.html +1 -1
- package/docs/html/functions/ObserveCurrentThemeDensity.html +1 -1
- package/docs/html/functions/provideTheme.html +1 -1
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/ColorPalette.html +2 -2
- package/docs/html/interfaces/ColorPaletteConfig.html +2 -2
- package/docs/html/interfaces/ColorPaletteConfigWithName.html +2 -2
- package/docs/html/interfaces/ThemeConfig.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/ActiveTheme.html +1 -1
- package/docs/html/types/ThemeSetting.html +1 -1
- package/docs/html/variables/THEME_SETTING_KEY.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/ThemeModeService.md +23 -33
- package/docs/markdown/classes/ThemeService.md +32 -38
- package/docs/markdown/enumerations/ColorPaletteAlgorithm.md +4 -4
- package/docs/markdown/functions/ComputeColorPalette.md +2 -2
- package/docs/markdown/functions/ObserveCurrentThemeDensity.md +2 -2
- package/docs/markdown/functions/provideTheme.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/ColorPalette.md +16 -16
- package/docs/markdown/interfaces/ColorPaletteConfig.md +5 -5
- package/docs/markdown/interfaces/ColorPaletteConfigWithName.md +6 -6
- package/docs/markdown/interfaces/ThemeConfig.md +7 -7
- package/docs/markdown/type-aliases/ActiveTheme.md +2 -2
- package/docs/markdown/type-aliases/ThemeSetting.md +2 -2
- package/docs/markdown/variables/THEME_SETTING_KEY.md +2 -2
- package/docs/wiki/Class.ThemeModeService.md +22 -32
- package/docs/wiki/Class.ThemeService.md +31 -37
- package/docs/wiki/Enumeration.ColorPaletteAlgorithm.md +3 -3
- package/docs/wiki/Function.ComputeColorPalette.md +1 -1
- package/docs/wiki/Function.ObserveCurrentThemeDensity.md +1 -1
- package/docs/wiki/Function.provideTheme.md +1 -1
- package/docs/wiki/Interface.ColorPalette.md +15 -15
- package/docs/wiki/Interface.ColorPaletteConfig.md +4 -4
- package/docs/wiki/Interface.ColorPaletteConfigWithName.md +5 -5
- package/docs/wiki/Interface.ThemeConfig.md +6 -6
- package/docs/wiki/TypeAlias.ActiveTheme.md +1 -1
- package/docs/wiki/TypeAlias.ThemeSetting.md +1 -1
- package/docs/wiki/Variable.THEME_SETTING_KEY.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-ngx-theme.mjs +18 -16
- package/fesm2022/rxap-ngx-theme.mjs.map +1 -1
- package/package.json +10 -10
- package/types/rxap-ngx-theme.d.ts +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TinyColor } from '@ctrl/tinycolor';
|
|
2
2
|
import { Observable, Subscription, debounceTime, map, tap } from 'rxjs';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, computed, signal, effect,
|
|
5
|
-
import
|
|
4
|
+
import { inject, DOCUMENT, computed, signal, effect, Injectable, isDevMode, provideAppInitializer } from '@angular/core';
|
|
5
|
+
import { MediaMatcher } from '@angular/cdk/layout';
|
|
6
6
|
import { ConfigService } from '@rxap/config';
|
|
7
7
|
import { PubSubService, RXAP_TOPICS } from '@rxap/ngx-pub-sub';
|
|
8
8
|
import { isDefined } from '@rxap/rxjs';
|
|
@@ -116,9 +116,9 @@ const THEME_SETTING_KEY = 'rxap_theme_settings';
|
|
|
116
116
|
* theme changes.
|
|
117
117
|
*/
|
|
118
118
|
class ThemeModeService {
|
|
119
|
-
constructor(
|
|
120
|
-
this.mediaMatcher =
|
|
121
|
-
this.document =
|
|
119
|
+
constructor() {
|
|
120
|
+
this.mediaMatcher = inject(MediaMatcher);
|
|
121
|
+
this.document = inject(DOCUMENT);
|
|
122
122
|
this.config = inject(ConfigService);
|
|
123
123
|
this.pubSub = inject(PubSubService);
|
|
124
124
|
this.darkMode = computed(() => this.activeTheme() === 'dark', ...(ngDevMode ? [{ debugName: "darkMode" }] : /* istanbul ignore next */ []));
|
|
@@ -227,20 +227,17 @@ class ThemeModeService {
|
|
|
227
227
|
this.pubSub.publish(RXAP_TOPICS.theme.darkMode.changed, this.darkMode());
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ThemeModeService, deps: [
|
|
230
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ThemeModeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
231
231
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ThemeModeService, providedIn: 'root' }); }
|
|
232
232
|
}
|
|
233
233
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ThemeModeService, decorators: [{
|
|
234
234
|
type: Injectable,
|
|
235
235
|
args: [{ providedIn: 'root' }]
|
|
236
|
-
}], ctorParameters: () => [
|
|
237
|
-
type: Inject,
|
|
238
|
-
args: [DOCUMENT]
|
|
239
|
-
}] }] });
|
|
236
|
+
}], ctorParameters: () => [] });
|
|
240
237
|
|
|
241
238
|
class ThemeService {
|
|
242
|
-
constructor(
|
|
243
|
-
this.mediaMatcher =
|
|
239
|
+
constructor() {
|
|
240
|
+
this.mediaMatcher = inject(MediaMatcher);
|
|
244
241
|
this.config = inject(ConfigService);
|
|
245
242
|
this.pubSub = inject(PubSubService);
|
|
246
243
|
this.themeModeService = inject(ThemeModeService);
|
|
@@ -292,7 +289,7 @@ class ThemeService {
|
|
|
292
289
|
return typography;
|
|
293
290
|
}
|
|
294
291
|
restoreDensity() {
|
|
295
|
-
const density = localStorage.getItem(
|
|
292
|
+
const density = localStorage.getItem(this.densityLocalStorageKey);
|
|
296
293
|
if (density) {
|
|
297
294
|
const value = Number(density);
|
|
298
295
|
if (value <= 0 && value >= -3) {
|
|
@@ -456,8 +453,13 @@ class ThemeService {
|
|
|
456
453
|
colorPalette =
|
|
457
454
|
ComputeColorPalette(colorPaletteConfig.base, colorPaletteConfig.color, colorPaletteConfig.algorithm);
|
|
458
455
|
}
|
|
456
|
+
else {
|
|
457
|
+
colorPalette = colorPaletteConfig.color;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
colorPalette = colorPaletteConfig.color;
|
|
459
462
|
}
|
|
460
|
-
colorPalette = colorPaletteConfig.color;
|
|
461
463
|
}
|
|
462
464
|
else if (colorPaletteConfig.base) {
|
|
463
465
|
colorPalette = ComputeColorPalette(colorPaletteConfig.base, {}, colorPaletteConfig.algorithm);
|
|
@@ -507,13 +509,13 @@ class ThemeService {
|
|
|
507
509
|
localStorage.removeItem(this.densityLocalStorageKey);
|
|
508
510
|
localStorage.removeItem(this.typographyLocalStorageKey);
|
|
509
511
|
}
|
|
510
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ThemeService, deps: [
|
|
512
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
511
513
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
|
512
514
|
}
|
|
513
515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ThemeService, decorators: [{
|
|
514
516
|
type: Injectable,
|
|
515
517
|
args: [{ providedIn: 'root' }]
|
|
516
|
-
}], ctorParameters: () => [
|
|
518
|
+
}], ctorParameters: () => [] });
|
|
517
519
|
|
|
518
520
|
function provideTheme() {
|
|
519
521
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-ngx-theme.mjs","sources":["../../../../../packages/angular/theme/src/lib/compute-color-palette.ts","../../../../../packages/angular/theme/src/lib/observe-current-theme-density.ts","../../../../../packages/angular/theme/src/lib/theme-mode.service.ts","../../../../../packages/angular/theme/src/lib/theme.service.ts","../../../../../packages/angular/theme/src/lib/provide.ts","../../../../../packages/angular/theme/src/index.ts","../../../../../packages/angular/theme/src/rxap-ngx-theme.ts"],"sourcesContent":["import {\n ColorInput,\n Numberify,\n RGBA,\n TinyColor,\n} from '@ctrl/tinycolor';\n\nexport interface ColorPalette {\n 50: string;\n 100: string;\n 200: string;\n 300: string;\n 400: string;\n 500: string;\n 600: string;\n 700: string;\n 800: string;\n 900: string;\n A100: string;\n A200: string;\n A400: string;\n A700: string;\n}\n\nexport enum ColorPaletteAlgorithm {\n CONSTANTIN = 'constantin',\n BUCKNER = 'buckner',\n}\n\nexport function ComputeColorPalette(\n color: ColorInput,\n colorPalette: Partial<ColorPalette> = {},\n algorithm?: ColorPaletteAlgorithm | string,\n): ColorPalette {\n colorPalette = { ...colorPalette };\n\n const baseLight = new TinyColor('#ffffff');\n const baseDark = multiply(new TinyColor(color).toRgb(), new TinyColor(color).toRgb());\n const baseTriad = new TinyColor(color).tetrad();\n\n switch (algorithm) {\n\n case ColorPaletteAlgorithm.CONSTANTIN:\n colorPalette[50] ??= baseLight.mix(color, 12).toHexString();\n colorPalette[100] ??= baseLight.mix(color, 30).toHexString();\n colorPalette[200] ??= baseLight.mix(color, 50).toHexString();\n colorPalette[300] ??= baseLight.mix(color, 70).toHexString();\n colorPalette[400] ??= baseLight.mix(color, 85).toHexString();\n colorPalette[500] ??= baseLight.mix(color, 100).toHexString();\n colorPalette[600] ??= baseDark.mix(color, 87).toHexString();\n colorPalette[700] ??= baseDark.mix(color, 70).toHexString();\n colorPalette[800] ??= baseDark.mix(color, 54).toHexString();\n colorPalette[900] ??= baseDark.mix(color, 25).toHexString();\n colorPalette.A100 ??= baseDark.mix(baseTriad[4], 15).saturate(80).lighten(65).toHexString();\n colorPalette.A200 ??= baseDark.mix(baseTriad[4], 15).saturate(80).lighten(55).toHexString();\n colorPalette.A400 ??= baseDark.mix(baseTriad[4], 15).saturate(100).lighten(45).toHexString();\n colorPalette.A700 ??= baseDark.mix(baseTriad[4], 15).saturate(100).lighten(40).toHexString();\n break;\n\n case ColorPaletteAlgorithm.BUCKNER:\n colorPalette[50] ??= baseLight.mix(color, 12).toHexString();\n colorPalette[100] ??= baseLight.mix(color, 30).toHexString();\n colorPalette[200] ??= baseLight.mix(color, 50).toHexString();\n colorPalette[300] ??= baseLight.mix(color, 70).toHexString();\n colorPalette[400] ??= baseLight.mix(color, 85).toHexString();\n colorPalette[500] ??= baseLight.mix(color, 100).toHexString();\n colorPalette[600] ??= baseDark.mix(color, 87).toHexString();\n colorPalette[700] ??= baseDark.mix(color, 70).toHexString();\n colorPalette[800] ??= baseDark.mix(color, 54).toHexString();\n colorPalette[900] ??= baseDark.mix(color, 25).toHexString();\n colorPalette.A100 ??= baseDark.mix(baseTriad[3], 15).saturate(80).lighten(48).toHexString();\n colorPalette.A200 ??= baseDark.mix(baseTriad[3], 15).saturate(80).lighten(36).toHexString();\n colorPalette.A400 ??= baseDark.mix(baseTriad[3], 15).saturate(100).lighten(31).toHexString();\n colorPalette.A700 ??= baseDark.mix(baseTriad[3], 15).saturate(100).lighten(28).toHexString();\n break;\n\n default:\n colorPalette[50] ??= new TinyColor(color).lighten(52).toHexString();\n colorPalette[100] ??= new TinyColor(color).lighten(37).toHexString();\n colorPalette[200] ??= new TinyColor(color).lighten(26).toHexString();\n colorPalette[300] ??= new TinyColor(color).lighten(12).toHexString();\n colorPalette[400] ??= new TinyColor(color).lighten(6).toHexString();\n colorPalette[500] ??= new TinyColor(color).toHexString();\n colorPalette[600] ??= new TinyColor(color).darken(6).toHexString();\n colorPalette[700] ??= new TinyColor(color).darken(12).toHexString();\n colorPalette[800] ??= new TinyColor(color).darken(18).toHexString();\n colorPalette[900] ??= new TinyColor(color).darken(24).toHexString();\n colorPalette.A100 ??= new TinyColor(color).lighten(50).saturate(30).toHexString();\n colorPalette.A200 ??= new TinyColor(color).lighten(30).saturate(30).toHexString();\n colorPalette.A400 ??= new TinyColor(color).lighten(10).saturate(15).toHexString();\n colorPalette.A700 ??= new TinyColor(color).lighten(5).saturate(5).toHexString();\n break;\n\n }\n\n return colorPalette as ColorPalette;\n}\n\nfunction multiply(rgb1: Numberify<RGBA>, rgb2: Numberify<RGBA>) {\n rgb1.b = Math.floor(rgb1.b * rgb2.b / 255);\n rgb1.g = Math.floor(rgb1.g * rgb2.g / 255);\n rgb1.r = Math.floor(rgb1.r * rgb2.r / 255);\n return new TinyColor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b);\n}\n","import { ThemeDensity } from '@rxap/utilities';\nimport { Observable } from 'rxjs';\n\nexport function ObserveCurrentThemeDensity(): Observable<ThemeDensity> {\n return new Observable((subscriber) => {\n\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n const classList = (mutation.target as HTMLElement).classList;\n const matchingClasses = Array.from(classList).filter((className) =>\n /density-\\d/.test(className),\n );\n if (matchingClasses.length > 0) {\n const match = matchingClasses[0].match(/density-(\\d)/);\n if (match) {\n subscriber.next(Number(match[1]) * -1 as ThemeDensity);\n }\n } else {\n subscriber.next(0);\n }\n }\n });\n });\n\n subscriber.add(() => observer.disconnect());\n\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: [ 'class' ],\n });\n\n });\n}\n","import { MediaMatcher } from '@angular/cdk/layout';\n\nimport {\n computed,\n effect,\n inject,\n Inject,\n Injectable,\n OnDestroy,\n Renderer2,\n signal,\n WritableSignal,\n DOCUMENT\n} from '@angular/core';\nimport { ConfigService } from '@rxap/config';\nimport {\n PubSubService,\n RXAP_TOPICS,\n} from '@rxap/ngx-pub-sub';\nimport { isDefined } from '@rxap/rxjs';\nimport {\n debounceTime,\n map,\n Subscription,\n tap,\n} from 'rxjs';\n\n// Represents the user's preference setting ('system', 'light', or 'dark')\nexport type ThemeSetting = 'system' | 'light' | 'dark';\n// Represents the currently active theme ('light' or 'dark')\nexport type ActiveTheme = 'light' | 'dark';\n\nexport const THEME_SETTING_KEY = 'rxap_theme_settings';\n\n/**\n * Service to manage theme mode (light/dark/system) for the application.\n * It provides functionality to handle theme preferences, persist them, and synchronize changes.\n *\n * This service integrates with media queries to detect system-level theme changes and allows the user\n * or application logic to toggle or set a specific theme.\n *\n * It utilizes dependency injection to access various required services and the document object.\n * Additionally, it publishes theme-related events for other parts of the application to react to\n * theme changes.\n */\n@Injectable({ providedIn: 'root' })\nexport class ThemeModeService implements OnDestroy {\n\n public readonly config = inject(ConfigService);\n public readonly pubSub = inject(PubSubService);\n\n public readonly activeTheme: WritableSignal<ActiveTheme>;\n public readonly themeSetting: WritableSignal<ThemeSetting>;\n public readonly darkMode = computed(() => this.activeTheme() === 'dark');\n\n protected readonly darkColorSchemaMediaQuery: MediaQueryList;\n\n protected readonly subscriptions: Subscription | null = null;\n protected readonly mediaQueryListener: (this: MediaQueryList, ev: MediaQueryListEventMap['change']) => any;\n\n protected syncSubscription?: Subscription;\n\n constructor(\n protected readonly mediaMatcher: MediaMatcher,\n @Inject(DOCUMENT) protected readonly document: Document,\n ) {\n this.darkColorSchemaMediaQuery = this.mediaMatcher.matchMedia('(prefers-color-scheme: dark)');\n this.themeSetting = signal(this.restoreThemeSetting());\n let activeTheme: ActiveTheme;\n const themeSetting = this.themeSetting();\n switch (themeSetting) {\n case 'system':\n activeTheme = this.darkColorSchemaMediaQuery.matches ? 'dark' : 'light';\n break;\n case 'light':\n activeTheme = 'light';\n break;\n case 'dark':\n activeTheme = 'dark';\n break;\n default:\n activeTheme = this.config.get('theme.active', 'light');\n break;\n }\n this.activeTheme = signal(activeTheme);\n effect(() => {\n const setting = this.themeSetting();\n this.storeThemeSetting(setting);\n });\n effect(() => {\n const active = this.activeTheme();\n this.setThemeClasses(active);\n });\n this.mediaQueryListener = (event: MediaQueryListEventMap['change']) => {\n if (this.themeSetting() === 'system') {\n this.activeTheme.set(event.matches ? 'dark' : 'light');\n }\n };\n this.darkColorSchemaMediaQuery.addEventListener('change', this.mediaQueryListener);\n this.restoreFromPubSub();\n }\n\n private get darkModeLocalStorageKey() {\n return (\n window as any\n )?.['__rxap__']?.['ngx']?.['theme']?.['darkMode']?.['key'] ?? THEME_SETTING_KEY;\n }\n\n protected restoreFromPubSub() {\n if (this.syncSubscription) {\n return;\n }\n this.syncSubscription = new Subscription();\n this.syncSubscription.add(this.pubSub.subscribe<boolean>(RXAP_TOPICS.theme.darkMode.restore).pipe(\n debounceTime(1000),\n map(event => event.data),\n isDefined(),\n tap(data => {\n const active = data ? 'dark' : 'light';\n this.themeSetting.set(active);\n this.activeTheme.set(active);\n })\n ).subscribe());\n }\n\n /**\n * Cleans up subscriptions and event listeners when the service is destroyed.\n */\n ngOnDestroy(): void {\n // Remove the media query listener if it exists.\n this.darkColorSchemaMediaQuery.removeEventListener('change', this.mediaQueryListener);\n // Unsubscribe from all RxJS subscriptions.\n this.subscriptions?.unsubscribe();\n this.syncSubscription?.unsubscribe();\n }\n\n protected restoreThemeSetting() {\n const setting = localStorage.getItem(this.darkModeLocalStorageKey) ?? this.config.get('theme.setting', 'system');\n if (setting && ['system', 'dark', 'light'].includes(setting)) {\n return setting as ThemeSetting;\n }\n return 'system';\n }\n\n protected storeThemeSetting(setting: ThemeSetting) {\n localStorage.setItem(this.darkModeLocalStorageKey, setting);\n }\n\n protected removeThemeClasses() {\n this.document.body.classList.remove('light');\n this.document.body.classList.remove('dark');\n }\n\n protected setThemeClasses(active: ActiveTheme) {\n this.document.body.classList.remove(active === 'light' ? 'dark' : 'light');\n this.document.body.classList.add(active);\n }\n\n /**\n * Toggles the application theme between 'light' and 'dark' modes.\n * It checks the currently active theme and switches to the opposite mode.\n *\n * @return {void} Does not return a value.\n */\n public toggleTheme(): void {\n const currentActive = this.activeTheme();\n // Determine the new setting based on the *currently active* theme.\n const newActive = currentActive === 'light' ? 'dark' : 'light';\n this.themeSetting.set(newActive);\n this.activeTheme.set(newActive);\n }\n\n /**\n * Sets the active theme for the application and optionally publishes the change.\n *\n * @param {ActiveTheme} active - The theme to be set as active.\n * @param {boolean} [publish=true] - Indicates whether to publish the theme change event.\n * @return {void}\n */\n public setTheme(active: ActiveTheme, publish = true) {\n this.themeSetting.set(active);\n this.activeTheme.set(active);\n if (publish) {\n this.pubSub.publish(RXAP_TOPICS.theme.darkMode.changed, this.darkMode());\n }\n }\n\n}\n","import { MediaMatcher } from '@angular/cdk/layout';\nimport {\n inject,\n Injectable,\n isDevMode,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { ConfigService } from '@rxap/config';\nimport {\n PubSubService,\n RXAP_TOPICS,\n} from '@rxap/ngx-pub-sub';\nimport { isDefined } from '@rxap/rxjs';\nimport { ThemeDensity } from '@rxap/utilities';\nimport {\n debounceTime,\n map,\n Subscription,\n tap,\n} from 'rxjs';\nimport {\n ColorPalette,\n ComputeColorPalette,\n} from './compute-color-palette';\nimport { ThemeModeService } from './theme-mode.service';\n\nexport interface ColorPaletteConfigWithName extends ColorPaletteConfig {\n name?: string;\n}\n\nexport interface ThemeConfig {\n primaryColor?: ColorPaletteConfigWithName;\n accentColor?: ColorPaletteConfigWithName;\n warnColor?: ColorPaletteConfigWithName;\n density?: ThemeDensity;\n typography?: string;\n}\n\nexport interface ColorPaletteConfig {\n algorithm?: string;\n base?: string;\n color?: Partial<ColorPalette>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ThemeService {\n\n public readonly config = inject(ConfigService);\n public readonly pubSub = inject(PubSubService);\n\n public readonly themeModeService = inject(ThemeModeService);\n\n public readonly darkMode = this.themeModeService.darkMode;\n public readonly themeName: WritableSignal<string>;\n public readonly density: WritableSignal<ThemeDensity>;\n public readonly typography: WritableSignal<string>;\n\n protected syncSubscription?: Subscription;\n\n constructor(private readonly mediaMatcher: MediaMatcher) {\n this.themeName = signal(this.getTheme());\n this.density = signal(this.getDensity());\n this.typography = signal(this.getTypography());\n }\n\n public restore() {\n if (isDevMode()) {\n console.log('Restore theme settings from local storage');\n }\n\n this.restoreThemeName();\n this.restoreDensity();\n this.restoreTypography();\n\n this.restoreFromPubSub();\n }\n\n protected restoreFromPubSub() {\n if (this.syncSubscription) {\n return;\n }\n this.syncSubscription = new Subscription();\n this.syncSubscription.add(this.pubSub.subscribe<ThemeDensity>(RXAP_TOPICS.theme.density.restore).pipe(\n debounceTime(1000),\n map(event => event.data),\n isDefined(),\n tap(data => this.setDensity(data, false, false))\n ).subscribe());\n this.syncSubscription.add(this.pubSub.subscribe<string>(RXAP_TOPICS.theme.preset.restore).pipe(\n debounceTime(1000),\n map(event => event.data),\n isDefined(),\n tap(data => this.setTheme(data, false, false))\n ).subscribe());\n this.syncSubscription.add(this.pubSub.subscribe<string>(RXAP_TOPICS.theme.typography.restore).pipe(\n debounceTime(1000),\n map(event => event.data),\n isDefined(),\n tap(data => this.setTypography(data, false, false))\n ).subscribe());\n }\n\n private get themeNameLocalStorageKey() {\n return (\n window as any\n )?.['__rxap__']?.['ngx']?.['theme']?.['name']?.['key'] ?? `rxap-theme-name`;\n }\n\n private get densityLocalStorageKey() {\n return (\n window as any\n )?.['__rxap__']?.['ngx']?.['theme']?.['density']?.['key'] ?? `rxap-theme-density`;\n }\n\n private get typographyLocalStorageKey() {\n return (\n window as any\n )?.['__rxap__']?.['ngx']?.['theme']?.['typography']?.['key'] ?? `rxap-theme-typography`;\n }\n\n // region restore\n\n public restoreThemeName() {\n const themeName = localStorage.getItem(this.themeNameLocalStorageKey);\n if (themeName) {\n this.setTheme(themeName, true);\n }\n return themeName;\n }\n\n public restoreTypography() {\n const typography = localStorage.getItem(this.typographyLocalStorageKey);\n if (typography) {\n this.setTypography(typography, true);\n }\n return typography;\n }\n\n public restoreDensity() {\n const density = localStorage.getItem('rxap-theme-density');\n if (density) {\n const value = Number(density) as ThemeDensity;\n if (value <= 0 && value >= -3) {\n this.setDensity(Number(density) as ThemeDensity, true);\n return value;\n }\n }\n return null;\n }\n\n // endregion\n\n public toggleDarkTheme(): void {\n this.themeModeService.toggleTheme();\n }\n\n // region set theme configuration state\n\n public setDarkTheme(darkMode: boolean, silent = false, publish = true): void {\n this.themeModeService.setTheme(darkMode ? 'dark' : 'light', publish);\n }\n\n public setDensity(density: ThemeDensity, silent = false, publish = true): void {\n this.applyDensity(density);\n if (this.density() !== density) {\n this.density.set(density);\n if (!silent) {\n localStorage.setItem(this.densityLocalStorageKey, String(density));\n if (publish) {\n this.pubSub.publish(RXAP_TOPICS.theme.density.changed, density);\n }\n }\n }\n }\n\n public setTypography(typography: string, silent = false, publish = true): void {\n this.applyTypography(typography);\n if (this.typography() !== typography) {\n this.typography.set(typography);\n if (!silent) {\n localStorage.setItem(this.typographyLocalStorageKey, typography);\n if (publish) {\n this.pubSub.publish(RXAP_TOPICS.theme.typography.changed, typography);\n }\n }\n }\n }\n\n public setTheme(themeName: string, silent = false, publish = true) {\n this.applyTheme(themeName);\n this.density.set(this.getDensity());\n this.typography.set(this.getTypography());\n if (this.themeName() !== themeName) {\n this.themeName.set(themeName);\n if (!silent) {\n localStorage.setItem(this.themeNameLocalStorageKey, themeName);\n if (publish) {\n this.pubSub.publish(RXAP_TOPICS.theme.preset.changed, themeName);\n }\n }\n }\n }\n\n // endregion\n\n // region apply theme configuration state\n\n public applyDensity(density: ThemeDensity): void {\n document.body.classList.remove('density-0', 'density-1', 'density-2', 'density-3');\n if (density < 0) {\n document.body.classList.add(`density${ density }`);\n }\n }\n\n public applyTypography(typography: string): void {\n document.body.style.setProperty('--font-family', `var(--font-family-${ typography })`);\n }\n\n public applyTheme(themeName: string): void {\n if (themeName === 'default') {\n this.resetToDefaultTheme();\n return;\n }\n\n const theme = this.getThemeConfig(themeName);\n\n if (theme.primaryColor?.color) {\n this.setCssColorVariables('primary', theme.primaryColor.color);\n }\n\n if (theme.accentColor?.color) {\n this.setCssColorVariables('accent', theme.accentColor.color);\n }\n\n if (theme.warnColor?.color) {\n this.setCssColorVariables('warn', theme.warnColor.color);\n }\n\n if (theme.density !== undefined) {\n this.applyDensity(theme.density);\n }\n\n if (theme.typography) {\n this.applyTypography(theme.typography);\n }\n\n document.body.style.setProperty(`--theme-name`, themeName);\n }\n\n // endregion\n\n // region get theme configuration state\n\n public getDensity(): ThemeDensity {\n let density = 0;\n document.body.classList.forEach((className) => {\n const match = className.match(/density-([123])/);\n if (match) {\n density = Number(match[1]) * -1;\n }\n });\n return density as ThemeDensity;\n }\n\n public getTypography(): string {\n const variable = document.body.style.getPropertyValue('--font-family');\n const match = variable.match(/var\\(--font-family-(.*)\\)/);\n if (match) {\n return match[1];\n }\n return 'default';\n }\n\n public getTheme() {\n return document.body.style.getPropertyValue('--theme-name') || 'default';\n }\n\n // endregion\n\n // region get available\n\n public getAvailableColorPalettes(): string[] | null {\n const colorPalettesConfigs: Record<string, unknown> | boolean = this.config.get('colorPalettes', false);\n if (!colorPalettesConfigs) {\n return null;\n }\n const availableColorPalettes: string[] = Object.keys(colorPalettesConfigs);\n availableColorPalettes.unshift('default');\n return availableColorPalettes;\n }\n\n public getAvailableThemes(): string[] | null {\n const themeConfigs: Record<string, unknown> | boolean = this.config.get('themes', false);\n if (!themeConfigs) {\n return null;\n }\n const availableThemes: string[] = Object.keys(themeConfigs);\n availableThemes.unshift('default');\n return availableThemes;\n }\n\n public getAvailableTypographies(): string[] | null {\n const availableTypographies = this.config.get('typographies', false);\n if (!availableTypographies) {\n return null;\n }\n return Array\n .from(document.styleSheets)\n .filter(sheet => sheet.href === null || sheet.href.startsWith(window.location.origin))\n .flatMap(sheet => Array.from(sheet.cssRules || []))\n .filter((rule: any) => rule.selectorText === ':root')\n .flatMap((rule: any) => Array.from(rule.style))\n .filter((prop: any) => prop.startsWith('--'))\n .filter((prop: any) => prop.startsWith('--font-family-'))\n .map((prop: any) => prop.replace('--font-family-', ''))\n .sort();\n }\n\n // endregion\n\n public getColorPalette(colorPaletteName: string): Partial<ColorPalette> {\n const colorPaletteConfig = this.config.getOrThrow<ColorPaletteConfig>(`colorPalettes.${ colorPaletteName }`);\n return this.coerceColorPalette(colorPaletteConfig);\n }\n\n // region utility\n\n private coerceColorPalette(colorPaletteConfig: ColorPaletteConfig): Partial<ColorPalette> {\n let colorPalette: Partial<ColorPalette> = {};\n\n if (colorPaletteConfig.color) {\n if (Object.keys(colorPaletteConfig.color).length !== 14) {\n // the color palette is not complete\n if (colorPaletteConfig.base) {\n colorPalette =\n ComputeColorPalette(colorPaletteConfig.base, colorPaletteConfig.color, colorPaletteConfig.algorithm);\n }\n }\n colorPalette = colorPaletteConfig.color;\n } else if (colorPaletteConfig.base) {\n colorPalette = ComputeColorPalette(colorPaletteConfig.base, {}, colorPaletteConfig.algorithm);\n }\n\n if (Object.keys(colorPalette).length === 0) {\n throw new Error('FATAL: The color palette has neither a base nor a color property');\n }\n\n return colorPalette;\n }\n\n private getThemeConfig(themeName: string): ThemeConfig {\n const themeConfig = this.config.getOrThrow<ThemeConfig>(`themes.${ themeName }`);\n\n if (themeConfig.accentColor) {\n themeConfig.accentColor.color = this.coerceColorPalette(themeConfig.accentColor);\n }\n\n if (themeConfig.primaryColor) {\n themeConfig.primaryColor.color = this.coerceColorPalette(themeConfig.primaryColor);\n }\n\n if (themeConfig.warnColor) {\n themeConfig.warnColor.color = this.coerceColorPalette(themeConfig.warnColor);\n }\n\n return themeConfig;\n }\n\n private setCssColorVariables(name: string, colorPalette: Partial<ColorPalette>): void {\n this.clearCssColorVariables(name);\n for (const [ index, color ] of Object.entries(colorPalette)) {\n document.body.style.setProperty(`--${ name }-${ index }`, color);\n }\n }\n\n private clearCssColorVariables(name: string): void {\n document.body.style.removeProperty(`--${ name }-50`);\n for (let index = 100; index <= 900; index += 100) {\n document.body.style.removeProperty(`--${ name }-${ index }`);\n }\n document.body.style.removeProperty(`--${ name }-a100`);\n document.body.style.removeProperty(`--${ name }-a200`);\n document.body.style.removeProperty(`--${ name }-a400`);\n document.body.style.removeProperty(`--${ name }-a700`);\n }\n\n private resetToDefaultTheme() {\n this.clearCssColorVariables('primary');\n this.clearCssColorVariables('accent');\n this.clearCssColorVariables('warn');\n this.setDensity(0);\n this.setTypography('default');\n document.body.style.removeProperty(`--theme-name`);\n localStorage.removeItem(this.themeNameLocalStorageKey);\n localStorage.removeItem(this.densityLocalStorageKey);\n localStorage.removeItem(this.typographyLocalStorageKey);\n }\n\n // endregion\n\n}\n","import {\n inject,\n provideAppInitializer,\n} from '@angular/core';\nimport { ThemeService } from './theme.service';\n\nexport function provideTheme() {\n return [\n provideAppInitializer(() => {\n const initializerFn = ((themeService: ThemeService) => () => themeService.restore())(inject(ThemeService));\n return initializerFn();\n })\n ];\n}\n","// region \nexport * from './lib/compute-color-palette';\nexport * from './lib/observe-current-theme-density';\nexport * from './lib/provide';\nexport * from './lib/theme-mode.service';\nexport * from './lib/theme.service';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAwBY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,YAAA,CAAA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,KAAK,MAAM,YAAY,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YAC1G,OAAO,aAAa,EAAE;AACxB,QAAA,CAAC;KACJ;AACH;;ACbA;AAMA;;ACNA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rxap-ngx-theme.mjs","sources":["../../../../../packages/angular/theme/src/lib/compute-color-palette.ts","../../../../../packages/angular/theme/src/lib/observe-current-theme-density.ts","../../../../../packages/angular/theme/src/lib/theme-mode.service.ts","../../../../../packages/angular/theme/src/lib/theme.service.ts","../../../../../packages/angular/theme/src/lib/provide.ts","../../../../../packages/angular/theme/src/index.ts","../../../../../packages/angular/theme/src/rxap-ngx-theme.ts"],"sourcesContent":["import {\n ColorInput,\n Numberify,\n RGBA,\n TinyColor,\n} from '@ctrl/tinycolor';\n\nexport interface ColorPalette {\n 50: string;\n 100: string;\n 200: string;\n 300: string;\n 400: string;\n 500: string;\n 600: string;\n 700: string;\n 800: string;\n 900: string;\n A100: string;\n A200: string;\n A400: string;\n A700: string;\n}\n\nexport enum ColorPaletteAlgorithm {\n CONSTANTIN = 'constantin',\n BUCKNER = 'buckner',\n}\n\nexport function ComputeColorPalette(\n color: ColorInput,\n colorPalette: Partial<ColorPalette> = {},\n algorithm?: ColorPaletteAlgorithm | string,\n): ColorPalette {\n colorPalette = { ...colorPalette };\n\n const baseLight = new TinyColor('#ffffff');\n const baseDark = multiply(new TinyColor(color).toRgb(), new TinyColor(color).toRgb());\n const baseTriad = new TinyColor(color).tetrad();\n\n switch (algorithm) {\n\n case ColorPaletteAlgorithm.CONSTANTIN:\n colorPalette[50] ??= baseLight.mix(color, 12).toHexString();\n colorPalette[100] ??= baseLight.mix(color, 30).toHexString();\n colorPalette[200] ??= baseLight.mix(color, 50).toHexString();\n colorPalette[300] ??= baseLight.mix(color, 70).toHexString();\n colorPalette[400] ??= baseLight.mix(color, 85).toHexString();\n colorPalette[500] ??= baseLight.mix(color, 100).toHexString();\n colorPalette[600] ??= baseDark.mix(color, 87).toHexString();\n colorPalette[700] ??= baseDark.mix(color, 70).toHexString();\n colorPalette[800] ??= baseDark.mix(color, 54).toHexString();\n colorPalette[900] ??= baseDark.mix(color, 25).toHexString();\n colorPalette.A100 ??= baseDark.mix(baseTriad[4], 15).saturate(80).lighten(65).toHexString();\n colorPalette.A200 ??= baseDark.mix(baseTriad[4], 15).saturate(80).lighten(55).toHexString();\n colorPalette.A400 ??= baseDark.mix(baseTriad[4], 15).saturate(100).lighten(45).toHexString();\n colorPalette.A700 ??= baseDark.mix(baseTriad[4], 15).saturate(100).lighten(40).toHexString();\n break;\n\n case ColorPaletteAlgorithm.BUCKNER:\n colorPalette[50] ??= baseLight.mix(color, 12).toHexString();\n colorPalette[100] ??= baseLight.mix(color, 30).toHexString();\n colorPalette[200] ??= baseLight.mix(color, 50).toHexString();\n colorPalette[300] ??= baseLight.mix(color, 70).toHexString();\n colorPalette[400] ??= baseLight.mix(color, 85).toHexString();\n colorPalette[500] ??= baseLight.mix(color, 100).toHexString();\n colorPalette[600] ??= baseDark.mix(color, 87).toHexString();\n colorPalette[700] ??= baseDark.mix(color, 70).toHexString();\n colorPalette[800] ??= baseDark.mix(color, 54).toHexString();\n colorPalette[900] ??= baseDark.mix(color, 25).toHexString();\n colorPalette.A100 ??= baseDark.mix(baseTriad[3], 15).saturate(80).lighten(48).toHexString();\n colorPalette.A200 ??= baseDark.mix(baseTriad[3], 15).saturate(80).lighten(36).toHexString();\n colorPalette.A400 ??= baseDark.mix(baseTriad[3], 15).saturate(100).lighten(31).toHexString();\n colorPalette.A700 ??= baseDark.mix(baseTriad[3], 15).saturate(100).lighten(28).toHexString();\n break;\n\n default:\n colorPalette[50] ??= new TinyColor(color).lighten(52).toHexString();\n colorPalette[100] ??= new TinyColor(color).lighten(37).toHexString();\n colorPalette[200] ??= new TinyColor(color).lighten(26).toHexString();\n colorPalette[300] ??= new TinyColor(color).lighten(12).toHexString();\n colorPalette[400] ??= new TinyColor(color).lighten(6).toHexString();\n colorPalette[500] ??= new TinyColor(color).toHexString();\n colorPalette[600] ??= new TinyColor(color).darken(6).toHexString();\n colorPalette[700] ??= new TinyColor(color).darken(12).toHexString();\n colorPalette[800] ??= new TinyColor(color).darken(18).toHexString();\n colorPalette[900] ??= new TinyColor(color).darken(24).toHexString();\n colorPalette.A100 ??= new TinyColor(color).lighten(50).saturate(30).toHexString();\n colorPalette.A200 ??= new TinyColor(color).lighten(30).saturate(30).toHexString();\n colorPalette.A400 ??= new TinyColor(color).lighten(10).saturate(15).toHexString();\n colorPalette.A700 ??= new TinyColor(color).lighten(5).saturate(5).toHexString();\n break;\n\n }\n\n return colorPalette as ColorPalette;\n}\n\nfunction multiply(rgb1: Numberify<RGBA>, rgb2: Numberify<RGBA>) {\n rgb1.b = Math.floor(rgb1.b * rgb2.b / 255);\n rgb1.g = Math.floor(rgb1.g * rgb2.g / 255);\n rgb1.r = Math.floor(rgb1.r * rgb2.r / 255);\n return new TinyColor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b);\n}\n","import { ThemeDensity } from '@rxap/utilities';\nimport { Observable } from 'rxjs';\n\nexport function ObserveCurrentThemeDensity(): Observable<ThemeDensity> {\n return new Observable((subscriber) => {\n\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n const classList = (mutation.target as HTMLElement).classList;\n const matchingClasses = Array.from(classList).filter((className) =>\n /density-\\d/.test(className),\n );\n if (matchingClasses.length > 0) {\n const match = matchingClasses[0].match(/density-(\\d)/);\n if (match) {\n subscriber.next(Number(match[1]) * -1 as ThemeDensity);\n }\n } else {\n subscriber.next(0);\n }\n }\n });\n });\n\n subscriber.add(() => observer.disconnect());\n\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: [ 'class' ],\n });\n\n });\n}\n","import { MediaMatcher } from '@angular/cdk/layout';\n\nimport { computed, effect, inject, Injectable, OnDestroy, Renderer2, signal, WritableSignal, DOCUMENT } from '@angular/core';\nimport { ConfigService } from '@rxap/config';\nimport {\n PubSubService,\n RXAP_TOPICS,\n} from '@rxap/ngx-pub-sub';\nimport { isDefined } from '@rxap/rxjs';\nimport {\n debounceTime,\n map,\n Subscription,\n tap,\n} from 'rxjs';\n\n// Represents the user's preference setting ('system', 'light', or 'dark')\nexport type ThemeSetting = 'system' | 'light' | 'dark';\n// Represents the currently active theme ('light' or 'dark')\nexport type ActiveTheme = 'light' | 'dark';\n\nexport const THEME_SETTING_KEY = 'rxap_theme_settings';\n\n/**\n * Service to manage theme mode (light/dark/system) for the application.\n * It provides functionality to handle theme preferences, persist them, and synchronize changes.\n *\n * This service integrates with media queries to detect system-level theme changes and allows the user\n * or application logic to toggle or set a specific theme.\n *\n * It utilizes dependency injection to access various required services and the document object.\n * Additionally, it publishes theme-related events for other parts of the application to react to\n * theme changes.\n */\n@Injectable({ providedIn: 'root' })\nexport class ThemeModeService implements OnDestroy {\n protected readonly mediaMatcher = inject(MediaMatcher);\n protected readonly document = inject<Document>(DOCUMENT);\n\n\n public readonly config = inject(ConfigService);\n public readonly pubSub = inject(PubSubService);\n\n public readonly activeTheme: WritableSignal<ActiveTheme>;\n public readonly themeSetting: WritableSignal<ThemeSetting>;\n public readonly darkMode = computed(() => this.activeTheme() === 'dark');\n\n protected readonly darkColorSchemaMediaQuery: MediaQueryList;\n\n protected readonly subscriptions: Subscription | null = null;\n protected readonly mediaQueryListener: (this: MediaQueryList, ev: MediaQueryListEventMap['change']) => any;\n\n protected syncSubscription?: Subscription;\n\n constructor() {\n this.darkColorSchemaMediaQuery = this.mediaMatcher.matchMedia('(prefers-color-scheme: dark)');\n this.themeSetting = signal(this.restoreThemeSetting());\n let activeTheme: ActiveTheme;\n const themeSetting = this.themeSetting();\n switch (themeSetting) {\n case 'system':\n activeTheme = this.darkColorSchemaMediaQuery.matches ? 'dark' : 'light';\n break;\n case 'light':\n activeTheme = 'light';\n break;\n case 'dark':\n activeTheme = 'dark';\n break;\n default:\n activeTheme = this.config.get('theme.active', 'light');\n break;\n }\n this.activeTheme = signal(activeTheme);\n effect(() => {\n const setting = this.themeSetting();\n this.storeThemeSetting(setting);\n });\n effect(() => {\n const active = this.activeTheme();\n this.setThemeClasses(active);\n });\n this.mediaQueryListener = (event: MediaQueryListEventMap['change']) => {\n if (this.themeSetting() === 'system') {\n this.activeTheme.set(event.matches ? 'dark' : 'light');\n }\n };\n this.darkColorSchemaMediaQuery.addEventListener('change', this.mediaQueryListener);\n this.restoreFromPubSub();\n }\n\n private get darkModeLocalStorageKey() {\n return (\n window as any\n )?.['__rxap__']?.['ngx']?.['theme']?.['darkMode']?.['key'] ?? THEME_SETTING_KEY;\n }\n\n protected restoreFromPubSub() {\n if (this.syncSubscription) {\n return;\n }\n this.syncSubscription = new Subscription();\n this.syncSubscription.add(this.pubSub.subscribe<boolean>(RXAP_TOPICS.theme.darkMode.restore).pipe(\n debounceTime(1000),\n map(event => event.data),\n isDefined(),\n tap(data => {\n const active = data ? 'dark' : 'light';\n this.themeSetting.set(active);\n this.activeTheme.set(active);\n })\n ).subscribe());\n }\n\n /**\n * Cleans up subscriptions and event listeners when the service is destroyed.\n */\n ngOnDestroy(): void {\n // Remove the media query listener if it exists.\n this.darkColorSchemaMediaQuery.removeEventListener('change', this.mediaQueryListener);\n // Unsubscribe from all RxJS subscriptions.\n this.subscriptions?.unsubscribe();\n this.syncSubscription?.unsubscribe();\n }\n\n protected restoreThemeSetting() {\n const setting = localStorage.getItem(this.darkModeLocalStorageKey) ?? this.config.get('theme.setting', 'system');\n if (setting && ['system', 'dark', 'light'].includes(setting)) {\n return setting as ThemeSetting;\n }\n return 'system';\n }\n\n protected storeThemeSetting(setting: ThemeSetting) {\n localStorage.setItem(this.darkModeLocalStorageKey, setting);\n }\n\n protected removeThemeClasses() {\n this.document.body.classList.remove('light');\n this.document.body.classList.remove('dark');\n }\n\n protected setThemeClasses(active: ActiveTheme) {\n this.document.body.classList.remove(active === 'light' ? 'dark' : 'light');\n this.document.body.classList.add(active);\n }\n\n /**\n * Toggles the application theme between 'light' and 'dark' modes.\n * It checks the currently active theme and switches to the opposite mode.\n *\n * @return {void} Does not return a value.\n */\n public toggleTheme(): void {\n const currentActive = this.activeTheme();\n // Determine the new setting based on the *currently active* theme.\n const newActive = currentActive === 'light' ? 'dark' : 'light';\n this.themeSetting.set(newActive);\n this.activeTheme.set(newActive);\n }\n\n /**\n * Sets the active theme for the application and optionally publishes the change.\n *\n * @param {ActiveTheme} active - The theme to be set as active.\n * @param {boolean} [publish=true] - Indicates whether to publish the theme change event.\n * @return {void}\n */\n public setTheme(active: ActiveTheme, publish = true) {\n this.themeSetting.set(active);\n this.activeTheme.set(active);\n if (publish) {\n this.pubSub.publish(RXAP_TOPICS.theme.darkMode.changed, this.darkMode());\n }\n }\n\n}\n","import { MediaMatcher } from '@angular/cdk/layout';\nimport {\n inject,\n Injectable,\n isDevMode,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { ConfigService } from '@rxap/config';\nimport {\n PubSubService,\n RXAP_TOPICS,\n} from '@rxap/ngx-pub-sub';\nimport { isDefined } from '@rxap/rxjs';\nimport { ThemeDensity } from '@rxap/utilities';\nimport {\n debounceTime,\n map,\n Subscription,\n tap,\n} from 'rxjs';\nimport {\n ColorPalette,\n ComputeColorPalette,\n} from './compute-color-palette';\nimport { ThemeModeService } from './theme-mode.service';\n\nexport interface ColorPaletteConfigWithName extends ColorPaletteConfig {\n name?: string;\n}\n\nexport interface ThemeConfig {\n primaryColor?: ColorPaletteConfigWithName;\n accentColor?: ColorPaletteConfigWithName;\n warnColor?: ColorPaletteConfigWithName;\n density?: ThemeDensity;\n typography?: string;\n}\n\nexport interface ColorPaletteConfig {\n algorithm?: string;\n base?: string;\n color?: Partial<ColorPalette>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ThemeService {\n private readonly mediaMatcher = inject(MediaMatcher);\n\n\n public readonly config = inject(ConfigService);\n public readonly pubSub = inject(PubSubService);\n\n public readonly themeModeService = inject(ThemeModeService);\n\n public readonly darkMode = this.themeModeService.darkMode;\n public readonly themeName: WritableSignal<string>;\n public readonly density: WritableSignal<ThemeDensity>;\n public readonly typography: WritableSignal<string>;\n\n protected syncSubscription?: Subscription;\n\n constructor() {\n this.themeName = signal(this.getTheme());\n this.density = signal(this.getDensity());\n this.typography = signal(this.getTypography());\n }\n\n public restore() {\n if (isDevMode()) {\n console.log('Restore theme settings from local storage');\n }\n\n this.restoreThemeName();\n this.restoreDensity();\n this.restoreTypography();\n\n this.restoreFromPubSub();\n }\n\n protected restoreFromPubSub() {\n if (this.syncSubscription) {\n return;\n }\n this.syncSubscription = new Subscription();\n this.syncSubscription.add(this.pubSub.subscribe<ThemeDensity>(RXAP_TOPICS.theme.density.restore).pipe(\n debounceTime(1000),\n map(event => event.data),\n isDefined(),\n tap(data => this.setDensity(data, false, false))\n ).subscribe());\n this.syncSubscription.add(this.pubSub.subscribe<string>(RXAP_TOPICS.theme.preset.restore).pipe(\n debounceTime(1000),\n map(event => event.data),\n isDefined(),\n tap(data => this.setTheme(data, false, false))\n ).subscribe());\n this.syncSubscription.add(this.pubSub.subscribe<string>(RXAP_TOPICS.theme.typography.restore).pipe(\n debounceTime(1000),\n map(event => event.data),\n isDefined(),\n tap(data => this.setTypography(data, false, false))\n ).subscribe());\n }\n\n private get themeNameLocalStorageKey() {\n return (\n window as any\n )?.['__rxap__']?.['ngx']?.['theme']?.['name']?.['key'] ?? `rxap-theme-name`;\n }\n\n private get densityLocalStorageKey() {\n return (\n window as any\n )?.['__rxap__']?.['ngx']?.['theme']?.['density']?.['key'] ?? `rxap-theme-density`;\n }\n\n private get typographyLocalStorageKey() {\n return (\n window as any\n )?.['__rxap__']?.['ngx']?.['theme']?.['typography']?.['key'] ?? `rxap-theme-typography`;\n }\n\n // region restore\n\n public restoreThemeName() {\n const themeName = localStorage.getItem(this.themeNameLocalStorageKey);\n if (themeName) {\n this.setTheme(themeName, true);\n }\n return themeName;\n }\n\n public restoreTypography() {\n const typography = localStorage.getItem(this.typographyLocalStorageKey);\n if (typography) {\n this.setTypography(typography, true);\n }\n return typography;\n }\n\n public restoreDensity() {\n const density = localStorage.getItem(this.densityLocalStorageKey);\n if (density) {\n const value = Number(density) as ThemeDensity;\n if (value <= 0 && value >= -3) {\n this.setDensity(Number(density) as ThemeDensity, true);\n return value;\n }\n }\n return null;\n }\n\n // endregion\n\n public toggleDarkTheme(): void {\n this.themeModeService.toggleTheme();\n }\n\n // region set theme configuration state\n\n public setDarkTheme(darkMode: boolean, silent = false, publish = true): void {\n this.themeModeService.setTheme(darkMode ? 'dark' : 'light', publish);\n }\n\n public setDensity(density: ThemeDensity, silent = false, publish = true): void {\n this.applyDensity(density);\n if (this.density() !== density) {\n this.density.set(density);\n if (!silent) {\n localStorage.setItem(this.densityLocalStorageKey, String(density));\n if (publish) {\n this.pubSub.publish(RXAP_TOPICS.theme.density.changed, density);\n }\n }\n }\n }\n\n public setTypography(typography: string, silent = false, publish = true): void {\n this.applyTypography(typography);\n if (this.typography() !== typography) {\n this.typography.set(typography);\n if (!silent) {\n localStorage.setItem(this.typographyLocalStorageKey, typography);\n if (publish) {\n this.pubSub.publish(RXAP_TOPICS.theme.typography.changed, typography);\n }\n }\n }\n }\n\n public setTheme(themeName: string, silent = false, publish = true) {\n this.applyTheme(themeName);\n this.density.set(this.getDensity());\n this.typography.set(this.getTypography());\n if (this.themeName() !== themeName) {\n this.themeName.set(themeName);\n if (!silent) {\n localStorage.setItem(this.themeNameLocalStorageKey, themeName);\n if (publish) {\n this.pubSub.publish(RXAP_TOPICS.theme.preset.changed, themeName);\n }\n }\n }\n }\n\n // endregion\n\n // region apply theme configuration state\n\n public applyDensity(density: ThemeDensity): void {\n document.body.classList.remove('density-0', 'density-1', 'density-2', 'density-3');\n if (density < 0) {\n document.body.classList.add(`density${ density }`);\n }\n }\n\n public applyTypography(typography: string): void {\n document.body.style.setProperty('--font-family', `var(--font-family-${ typography })`);\n }\n\n public applyTheme(themeName: string): void {\n if (themeName === 'default') {\n this.resetToDefaultTheme();\n return;\n }\n\n const theme = this.getThemeConfig(themeName);\n\n if (theme.primaryColor?.color) {\n this.setCssColorVariables('primary', theme.primaryColor.color);\n }\n\n if (theme.accentColor?.color) {\n this.setCssColorVariables('accent', theme.accentColor.color);\n }\n\n if (theme.warnColor?.color) {\n this.setCssColorVariables('warn', theme.warnColor.color);\n }\n\n if (theme.density !== undefined) {\n this.applyDensity(theme.density);\n }\n\n if (theme.typography) {\n this.applyTypography(theme.typography);\n }\n\n document.body.style.setProperty(`--theme-name`, themeName);\n }\n\n // endregion\n\n // region get theme configuration state\n\n public getDensity(): ThemeDensity {\n let density = 0;\n document.body.classList.forEach((className) => {\n const match = className.match(/density-([123])/);\n if (match) {\n density = Number(match[1]) * -1;\n }\n });\n return density as ThemeDensity;\n }\n\n public getTypography(): string {\n const variable = document.body.style.getPropertyValue('--font-family');\n const match = variable.match(/var\\(--font-family-(.*)\\)/);\n if (match) {\n return match[1];\n }\n return 'default';\n }\n\n public getTheme() {\n return document.body.style.getPropertyValue('--theme-name') || 'default';\n }\n\n // endregion\n\n // region get available\n\n public getAvailableColorPalettes(): string[] | null {\n const colorPalettesConfigs: Record<string, unknown> | boolean = this.config.get('colorPalettes', false);\n if (!colorPalettesConfigs) {\n return null;\n }\n const availableColorPalettes: string[] = Object.keys(colorPalettesConfigs);\n availableColorPalettes.unshift('default');\n return availableColorPalettes;\n }\n\n public getAvailableThemes(): string[] | null {\n const themeConfigs: Record<string, unknown> | boolean = this.config.get('themes', false);\n if (!themeConfigs) {\n return null;\n }\n const availableThemes: string[] = Object.keys(themeConfigs);\n availableThemes.unshift('default');\n return availableThemes;\n }\n\n public getAvailableTypographies(): string[] | null {\n const availableTypographies = this.config.get('typographies', false);\n if (!availableTypographies) {\n return null;\n }\n return Array\n .from(document.styleSheets)\n .filter(sheet => sheet.href === null || sheet.href.startsWith(window.location.origin))\n .flatMap(sheet => Array.from(sheet.cssRules || []))\n .filter((rule: any) => rule.selectorText === ':root')\n .flatMap((rule: any) => Array.from(rule.style))\n .filter((prop: any) => prop.startsWith('--'))\n .filter((prop: any) => prop.startsWith('--font-family-'))\n .map((prop: any) => prop.replace('--font-family-', ''))\n .sort();\n }\n\n // endregion\n\n public getColorPalette(colorPaletteName: string): Partial<ColorPalette> {\n const colorPaletteConfig = this.config.getOrThrow<ColorPaletteConfig>(`colorPalettes.${ colorPaletteName }`);\n return this.coerceColorPalette(colorPaletteConfig);\n }\n\n // region utility\n\n private coerceColorPalette(colorPaletteConfig: ColorPaletteConfig): Partial<ColorPalette> {\n let colorPalette: Partial<ColorPalette> = {};\n\n if (colorPaletteConfig.color) {\n if (Object.keys(colorPaletteConfig.color).length !== 14) {\n // the color palette is not complete\n if (colorPaletteConfig.base) {\n colorPalette =\n ComputeColorPalette(colorPaletteConfig.base, colorPaletteConfig.color, colorPaletteConfig.algorithm);\n } else {\n colorPalette = colorPaletteConfig.color;\n }\n } else {\n colorPalette = colorPaletteConfig.color;\n }\n } else if (colorPaletteConfig.base) {\n colorPalette = ComputeColorPalette(colorPaletteConfig.base, {}, colorPaletteConfig.algorithm);\n }\n\n if (Object.keys(colorPalette).length === 0) {\n throw new Error('FATAL: The color palette has neither a base nor a color property');\n }\n\n return colorPalette;\n }\n\n private getThemeConfig(themeName: string): ThemeConfig {\n const themeConfig = this.config.getOrThrow<ThemeConfig>(`themes.${ themeName }`);\n\n if (themeConfig.accentColor) {\n themeConfig.accentColor.color = this.coerceColorPalette(themeConfig.accentColor);\n }\n\n if (themeConfig.primaryColor) {\n themeConfig.primaryColor.color = this.coerceColorPalette(themeConfig.primaryColor);\n }\n\n if (themeConfig.warnColor) {\n themeConfig.warnColor.color = this.coerceColorPalette(themeConfig.warnColor);\n }\n\n return themeConfig;\n }\n\n private setCssColorVariables(name: string, colorPalette: Partial<ColorPalette>): void {\n this.clearCssColorVariables(name);\n for (const [ index, color ] of Object.entries(colorPalette)) {\n document.body.style.setProperty(`--${ name }-${ index }`, color);\n }\n }\n\n private clearCssColorVariables(name: string): void {\n document.body.style.removeProperty(`--${ name }-50`);\n for (let index = 100; index <= 900; index += 100) {\n document.body.style.removeProperty(`--${ name }-${ index }`);\n }\n document.body.style.removeProperty(`--${ name }-a100`);\n document.body.style.removeProperty(`--${ name }-a200`);\n document.body.style.removeProperty(`--${ name }-a400`);\n document.body.style.removeProperty(`--${ name }-a700`);\n }\n\n private resetToDefaultTheme() {\n this.clearCssColorVariables('primary');\n this.clearCssColorVariables('accent');\n this.clearCssColorVariables('warn');\n this.setDensity(0);\n this.setTypography('default');\n document.body.style.removeProperty(`--theme-name`);\n localStorage.removeItem(this.themeNameLocalStorageKey);\n localStorage.removeItem(this.densityLocalStorageKey);\n localStorage.removeItem(this.typographyLocalStorageKey);\n }\n\n // endregion\n\n}\n","import {\n inject,\n provideAppInitializer,\n} from '@angular/core';\nimport { ThemeService } from './theme.service';\n\nexport function provideTheme() {\n return [\n provideAppInitializer(() => {\n const initializerFn = ((themeService: ThemeService) => () => themeService.restore())(inject(ThemeService));\n return initializerFn();\n })\n ];\n}\n","// region \nexport * from './lib/compute-color-palette';\nexport * from './lib/observe-current-theme-density';\nexport * from './lib/provide';\nexport * from './lib/theme-mode.service';\nexport * from './lib/theme.service';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAwBY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,qBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAAA,EAAA,CAAA,CAAA;AAK3B,SAAU,mBAAmB,CACjC,KAAiB,EACjB,YAAA,GAAsC,EAAE,EACxC,SAA0C,EAAA;AAE1C,IAAA,YAAY,GAAG,EAAE,GAAG,YAAY,EAAE;AAElC,IAAA,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC;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A,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;QAC7B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA,YAAA,CAAc,CAAC;AAClD,QAAA,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,wBAAwB,CAAC;AACtD,QAAA,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC;AACpD,QAAA,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,yBAAyB,CAAC;IACzD;8GApWW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAZ,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cADC,MAAM,EAAA,CAAA,CAAA;;2FACnB,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;SCvClB,YAAY,GAAA;IAC1B,OAAO;QACL,qBAAqB,CAAC,MAAK;YACvB,MAAM,aAAa,GAAG,CAAC,CAAC,YAA0B,KAAK,MAAM,YAAY,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YAC1G,OAAO,aAAa,EAAE;AACxB,QAAA,CAAC;KACJ;AACH;;ACbA;AAMA;;ACNA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "21.0.1-dev.
|
|
2
|
+
"version": "21.0.1-dev.1",
|
|
3
3
|
"name": "@rxap/ngx-theme",
|
|
4
4
|
"description": "This package provides an Angular theme service that allows you to manage and customize the look and feel of your application. It includes features such as dark mode support, theme density control, typography settings, and color palette management. The service also provides utilities for computing color palettes and observing theme density changes.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"peerDependencies": {
|
|
12
12
|
"@angular/cdk": "^21.2.9",
|
|
13
13
|
"@angular/core": "^21.2.9",
|
|
14
|
-
"@rxap/config": "^21.0.1-dev.
|
|
15
|
-
"@rxap/ngx-pub-sub": "^21.0.1-dev.
|
|
16
|
-
"@rxap/rxjs": "^1.1.18-dev.
|
|
17
|
-
"@rxap/utilities": "^16.5.2-dev.
|
|
14
|
+
"@rxap/config": "^21.0.1-dev.1",
|
|
15
|
+
"@rxap/ngx-pub-sub": "^21.0.1-dev.1",
|
|
16
|
+
"@rxap/rxjs": "^1.1.18-dev.1",
|
|
17
|
+
"@rxap/utilities": "^16.5.2-dev.1",
|
|
18
18
|
"rxjs": "^7.8.2"
|
|
19
19
|
},
|
|
20
20
|
"author": {
|
|
@@ -55,23 +55,23 @@
|
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"package": "@rxap/config",
|
|
58
|
-
"version": "21.0.1-dev.
|
|
58
|
+
"version": "21.0.1-dev.1"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"package": "@rxap/environment",
|
|
62
|
-
"version": "21.0.1-dev.
|
|
62
|
+
"version": "21.0.1-dev.1"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"package": "@rxap/ngx-pub-sub",
|
|
66
|
-
"version": "21.0.1-dev.
|
|
66
|
+
"version": "21.0.1-dev.1"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"package": "@rxap/rxjs",
|
|
70
|
-
"version": "1.1.18-dev.
|
|
70
|
+
"version": "1.1.18-dev.1"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"package": "@rxap/utilities",
|
|
74
|
-
"version": "16.5.2-dev.
|
|
74
|
+
"version": "16.5.2-dev.1"
|
|
75
75
|
}
|
|
76
76
|
]
|
|
77
77
|
},
|
|
@@ -59,7 +59,7 @@ declare class ThemeModeService implements OnDestroy {
|
|
|
59
59
|
protected readonly subscriptions: Subscription | null;
|
|
60
60
|
protected readonly mediaQueryListener: (this: MediaQueryList, ev: MediaQueryListEventMap['change']) => any;
|
|
61
61
|
protected syncSubscription?: Subscription;
|
|
62
|
-
constructor(
|
|
62
|
+
constructor();
|
|
63
63
|
private get darkModeLocalStorageKey();
|
|
64
64
|
protected restoreFromPubSub(): void;
|
|
65
65
|
/**
|
|
@@ -114,7 +114,7 @@ declare class ThemeService {
|
|
|
114
114
|
readonly density: WritableSignal<ThemeDensity>;
|
|
115
115
|
readonly typography: WritableSignal<string>;
|
|
116
116
|
protected syncSubscription?: Subscription;
|
|
117
|
-
constructor(
|
|
117
|
+
constructor();
|
|
118
118
|
restore(): void;
|
|
119
119
|
protected restoreFromPubSub(): void;
|
|
120
120
|
private get themeNameLocalStorageKey();
|