@rb-mwindh/ngx-theme-manager
Version:
Angular component to switch between different theming stylesheets
1 lines • 36.4 kB
Source Map (JSON)
{"version":3,"file":"rb-mwindh-ngx-theme-manager.mjs","sources":["../../../projects/ngx-theme-manager/src/lib/internal/storage.service.ts","../../../projects/ngx-theme-manager/src/lib/internal/theme-registry.service.ts","../../../projects/ngx-theme-manager/src/lib/internal/theme-tracking.service.ts","../../../projects/ngx-theme-manager/src/lib/internal/theme-style-manager.service.ts","../../../projects/ngx-theme-manager/src/lib/theme.service.ts","../../../projects/ngx-theme-manager/src/rb-mwindh-ngx-theme-manager.ts"],"sourcesContent":["import { Inject, Injectable, OnDestroy } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { share, Subject, takeUntil } from 'rxjs';\n\n/**\n * StorageChangeEvent represents the change event of the storage.\n *\n * @interface\n * @group Public API\n */\nexport interface StorageChangeEvent {\n /**\n * The key of the item that was changed.\n */\n key: string;\n\n /**\n * The value of the item before the change.\n */\n oldValue: string | null;\n\n /**\n * The value of the item after the change.\n */\n newValue: string | null;\n}\n\n/**\n * RbStorageService is a service that provides an observable stream of storage change events.\n *\n * @internal\n * @group Services\n */\n@Injectable({ providedIn: 'root' })\nexport class StorageService implements OnDestroy {\n readonly #destroy$ = new Subject<void>();\n\n /**\n * The browser's local storage object.\n *\n * @readonly\n * @private\n */\n readonly #storage: Storage;\n\n /**\n * The browser's window object.\n *\n * @readonly\n * @private\n */\n readonly #window: Window;\n\n /**\n * The Subject receiving the storage change events.\n *\n * @readonly\n * @private\n */\n readonly #changes$ = new Subject<StorageChangeEvent>();\n\n /**\n * The observable stream of storage change events, shared among subscribers.\n *\n * @readonly\n */\n public readonly changes$ = this.#changes$.pipe(\n share(),\n takeUntil(this.#destroy$),\n );\n\n /**\n * Creates an instance of RbStorageService.\n *\n * @param {Document} document - the document object provided by Angular's DI.\n */\n public constructor(@Inject(DOCUMENT) document: Document) {\n this.#window = (document as any).parentWindow || document.defaultView;\n this.#storage = this.#window.localStorage;\n this.#window.addEventListener(\n 'storage',\n this.#storageEventListener.bind(this),\n );\n }\n\n /**\n * An Angular lifecycle hook that removes the storage event listener.\n *\n * @internal\n */\n ngOnDestroy() {\n this.#window.removeEventListener(\n 'storage',\n this.#storageEventListener.bind(this),\n );\n this.#destroy$.next();\n this.#destroy$.complete();\n }\n\n /**\n * Sets a key-value pair in the local storage and emits a change event.\n *\n * @param {string} key - The key to set\n * @param {string} newValue - The value to set\n */\n public setItem(key: string, newValue: string): void {\n const oldValue = this.#storage.getItem(key);\n this.#storage.setItem(key, newValue);\n this.#changes$.next({ key, oldValue, newValue });\n }\n\n /**\n * Gets the value of a key in the local storage.\n *\n * @param {string} key - The key to get the value of\n * @returns {(string | null)} The value of the key or null if it does not exist\n */\n public getItem(key: string): string | null {\n return this.#storage.getItem(key);\n }\n\n /**\n * Removes the value of a key from the local storage and emits a change event.\n *\n * @param {string} key - The key to remove\n */\n public removeItem(key: string): void {\n const oldValue = this.#storage.getItem(key);\n this.#storage.removeItem(key);\n this.#changes$.next({ key, oldValue, newValue: null });\n }\n\n /**\n * Clears all keys from the local storage and emits a change event for each removed key.\n */\n public clear(): void {\n const changes: StorageChangeEvent[] = [];\n for (let i = 0; i < this.#storage.length; i++) {\n const key = this.#storage.key(i)!; // I'm sure it's never null!\n const oldValue = this.#storage.getItem(key);\n changes.push({ key, oldValue, newValue: null });\n }\n this.#storage.clear();\n changes.forEach((change) => this.#changes$.next(change));\n }\n\n /**\n * The storage event handler that takes a native StorageEvent and emits a {@link StorageChangeEvent}.\n *\n * @param {StorageEvent} event - The native event to handle\n * @private\n */\n #storageEventListener(event: StorageEvent): void {\n if (event.storageArea != this.#storage) {\n return;\n }\n\n const key = event.key!;\n const { oldValue, newValue } = event;\n this.#changes$.next({ key, oldValue, newValue });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { share, Subject } from 'rxjs';\nimport { Theme } from '../theme';\n\n/**\n * RbThemeRegistryService is an injectable service that allows for\n * registering and unregistering themes, as well as providing access\n * to the currently registered themes.\n * It also provides an observable of themes that can be used\n * to notify subscribers of changes to the registered themes.\n *\n * @internal\n * @group Services\n */\n@Injectable({ providedIn: 'root' })\nexport class ThemeRegistryService {\n /**\n * The internal dictionary that holds the registered themes.\n *\n * @private\n */\n readonly #dictionary = new Map<string, Theme>();\n\n /**\n * The subject that emits an updated array of registered themes whenever a change occurs.\n *\n * @private\n */\n readonly #themes$ = new Subject<Theme[]>();\n\n /**\n * The observable that emits the collection of registered themes when it changes.\n */\n readonly themes$ = this.#themes$.pipe(share());\n\n /**\n * Registers a new theme and emits the changed collection of themes.\n *\n * If a theme with the same ID is already registered,\n * the registered theme will be merged with the new one.\n *\n * Themes without ID will be ignored.\n *\n * @param {Theme | undefined | null} theme - The new theme to register\n */\n register(theme: Theme | undefined | null): void {\n if (!theme?.id) {\n return;\n }\n const oldValue = this.#dictionary.get(theme.id) || {};\n this.#dictionary.set(theme.id, { ...oldValue, ...theme });\n this.#themes$.next([...this.#dictionary.values()]);\n }\n\n /**\n * Removes the provided theme from the registry and emits the changed collection of themes.\n *\n * @param {Theme} theme - The theme to remove.\n */\n unregister(theme: Theme): void {\n if (this.#dictionary.delete(theme?.id)) {\n this.#themes$.next([...this.#dictionary.values()]);\n }\n }\n\n /**\n * Returns the collection of registered themes.\n *\n * @returns {Theme[]} A new array with all currently registered themes\n * @remarks A new array is created every time this getter is called.\n */\n get themes(): Theme[] {\n return [...this.#dictionary.values()];\n }\n\n /**\n * Returns the theme with the given ID, or null if no such theme is registered.\n *\n * @param {string | null} id - The ID of the theme to retrieve\n */\n get(id: string | null): Theme | null {\n return this.#dictionary.get(id!) || null;\n }\n\n /**\n * Returns whether a theme with the given ID is currently registered.\n *\n * @param {string | null} id - The ID of the theme to check.\n */\n has(id: string | null): boolean {\n return this.#dictionary.has(id!);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { distinctUntilChanged, share, Subject, tap } from 'rxjs';\n\n/**\n * A service to track the currently active theme.\n *\n * @internal\n * @group Services\n */\n@Injectable({ providedIn: 'root' })\nexport class ThemeTrackingService {\n /**\n * The subject that emits the next value set through {@link currentTheme}.\n *\n * @private\n */\n readonly #currentTheme$ = new Subject<string | null>();\n\n /**\n * A private property to hold the current theme value.\n *\n * @private\n */\n #currentTheme: string | null = null;\n\n /**\n * The observable that emits the current theme, shared among subscribers.\n * This observable prevents emitting the same value twice in a row.\n * It also updates the private #currentTheme property.\n */\n readonly currentTheme$ = this.#currentTheme$.pipe(\n distinctUntilChanged(),\n tap((theme) => (this.#currentTheme = theme)),\n share(),\n );\n\n /**\n * Set the current theme.\n *\n * @param {string | null} arg\n */\n set currentTheme(arg: string | null) {\n this.#currentTheme$.next(arg);\n }\n\n /**\n * Get the current theme.\n *\n * @returns {string | null} The current theme\n */\n get currentTheme(): string | null {\n return this.#currentTheme;\n }\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { ContentObserver } from '@angular/cdk/observers';\nimport { filter, map, timer } from 'rxjs';\nimport { Theme } from '../theme';\nimport { ThemeRegistryService } from './theme-registry.service';\n\n/**\n * A service that manages the activation and deactivation of themes.\n *\n * The service uses the `ContentObserver` service to observe changes in the `<head>` element\n * and updates the {@link ThemeRegistryService internal theme registry}\n * when new `<style>` elements are added to the DOM.\n *\n * Themes are identified by the `data-theme` attribute on the `<style>` element.\n *\n * The service provides a method `use` to activate a theme with a given ID\n * and deactivate all other themes.\n *\n * @internal\n * @group Services\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ThemeStyleManagerService {\n /**\n * Creates a new instance.\n *\n * Subscribes to the `ContentObserver` to listen for new `<style>` elements\n * added to the document head. If a new `<style>` element is added, the\n * `#updateRegistry()` method is called.\n *\n * @param {ContentObserver} observer - The Angular ContentObserver service\n * @param {ThemeRegistryService} themeRegistry - A service to register new themes\n * @param {Document} document - A reference to the current document\n */\n constructor(\n private readonly observer: ContentObserver,\n private readonly themeRegistry: ThemeRegistryService,\n @Inject(DOCUMENT) private readonly document: Document,\n ) {\n this.observer\n .observe(document.head)\n .pipe(\n map((mutations) =>\n mutations.some((mutation) =>\n Array.from(mutation.addedNodes).some(\n (node) => node.nodeName === 'STYLE',\n ),\n ),\n ),\n filter((newStyles) => !!newStyles),\n )\n .subscribe(() => this.#updateRegistry());\n }\n\n /**\n * Activates the theme with the given ID and deactivates all other themes.\n *\n * @param {string} theme - The theme to activate\n * @see turnOn\n * @see turnOff\n * @remarks A theme may consist of 1 or more `<style>` elements.\n */\n use(theme: string): void {\n // INFO: [author: NWD8FE, since: 2023/01/26]\n // running asynchronously, to give #updateRegistries\n // the chance to run first.\n timer(0).subscribe(() => {\n const styles = this.#getAllThemeStyles();\n styles.forEach((el) => {\n const id = el.getAttribute('data-theme');\n (theme === id ? turnOn : turnOff)(el);\n });\n });\n }\n\n /**\n * Get all theme `<style>` elements in the document head.\n *\n * @private\n */\n #getAllThemeStyles(): HTMLStyleElement[] {\n return Array.from(\n this.document.head.querySelectorAll('style[data-theme]'),\n );\n }\n\n /**\n * Updates the internal theme registry.\n *\n * Identifies all `<style>` elements without the `data-no-theme` and `data-theme` attributes.\n * Extracts the theme annotations from the elements' text content and applies the\n * `data-theme` or `data-no-theme` attribute depending on the discovered theme id.\n *\n * @private\n * @see extractThemeAnnotations\n * @see applyThemeIdentifier\n */\n #updateRegistry() {\n Array.from(\n this.document.head.querySelectorAll<HTMLStyleElement>(\n 'style:not([data-no-theme]):not([data-theme])',\n ),\n )\n .map((el) => ({ el, meta: extractThemeAnnotations(el.textContent) }))\n .forEach(({ el, meta }) => {\n if (applyThemeIdentifier(el, meta?.id)) {\n turnOff(el);\n this.themeRegistry.register(meta);\n }\n });\n }\n}\n\n/**\n * Applies a theme identifier to a `<style>` element.\n *\n * If the provided `id` is truthy, the element receives the attribute\n * `data-theme` set to the given `id`. Otherwise, the element\n * will get the attribute `data-no-theme` without any value.\n *\n * @param {HTMLStyleElement} el - The `<style>` element to apply the identifier to\n * @param {string | undefined} id - The theme identifier\n * @returns {boolean} true, if the style element belongs to a theme\n * @group Functions\n * @internal\n */\nexport function applyThemeIdentifier(\n el: HTMLStyleElement,\n id?: string,\n): boolean {\n if (!!id) {\n el.setAttribute('data-theme', id);\n return true;\n } else {\n el.toggleAttribute('data-no-theme', true);\n return false;\n }\n}\n\n/**\n * Turn off a style element by setting its `media` attribute to `none`.\n *\n * @param {HTMLStyleElement} el - The style element to turn off.\n * @group Functions\n * @internal\n */\nexport function turnOff(el: HTMLStyleElement): void {\n el.media = 'none';\n}\n\n/**\n * Turn on a style element by removing its `media` attribute.\n *\n * @param {HTMLStyleElement} el - The style element to turn on.\n * @group Functions\n * @internal\n */\nexport function turnOn(el: HTMLStyleElement): void {\n el.removeAttribute('media');\n}\n\n/**\n * Extracts theme annotations from a given string.\n *\n * **Format:** `@@<annotationName> value` (until end of line)\n *\n * Possible annotation names:\n * - `id`: a unique identifier for the theme\n * - `displayName`: a human-readable name for the theme\n * - `description`: a short description of the theme\n * - `defaultTheme`: a boolean flag indicating if this is the default theme\n *\n * @param {string} s The string to extract annotations from.\n * @returns {Theme | null} An object containing the extracted annotations, or null if no annotations were found.\n * @group Functions\n * @internal\n */\nexport function extractThemeAnnotations(\n s: undefined | null | string,\n): Theme | null {\n if (!s) {\n return null;\n }\n const id = unwrap(/@@id\\s+([^\\r\\n]+)$/m.exec(s));\n if (!id) {\n return null;\n }\n const displayName = unwrap(/@@displayName\\s+([^\\r\\n]+)$/m.exec(s)) || id;\n const description = unwrap(/@@description\\s+([^\\r\\n]+)$/m.exec(s));\n const defaultTheme = /@@default/m.test(s);\n return { id, displayName, description, defaultTheme };\n}\n\n/**\n * Unwrap a match from a regular expression, returning the first captured group as a string.\n *\n * @param {RegExpExecArray} match - The match to unwrap.\n * @group Functions\n * @internal\n */\nexport function unwrap(match: RegExpExecArray | null): string | undefined {\n return (match && match[1] && match[1].trim()) || undefined;\n}\n","import {\n Inject,\n Injectable,\n InjectionToken,\n OnDestroy,\n Optional,\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport {\n debounceTime,\n filter,\n map,\n skipWhile,\n Subject,\n take,\n takeUntil,\n takeWhile,\n tap,\n} from 'rxjs';\nimport {\n StorageService,\n ThemeRegistryService,\n ThemeStyleManagerService,\n ThemeTrackingService,\n} from './internal';\n\nconst PREFIX = 'ngx-theme-manager';\n\n/**\n * @group InjectionToken\n */\nexport const STORAGE_KEY = new InjectionToken<string>(\n `${PREFIX}/STORAGE_KEY`,\n {\n factory: () => `${PREFIX}/current-theme`,\n },\n);\n\n/**\n * @group InjectionToken\n */\nexport const QUERY_PARAM = new InjectionToken<string>(\n `${PREFIX}/QUERY_PARAM`,\n {\n factory: () => `theme`,\n },\n);\n\n/**\n * Service for managing and switching between different themes in an application.\n *\n * @group Services\n * @group Public API\n */\n@Injectable({ providedIn: 'root' })\nexport class ThemeService implements OnDestroy {\n /**\n * Subject for triggering cleanup on service destruction.\n *\n * @private\n */\n readonly #destroyed = new Subject<void>();\n\n /**\n * Observable stream that emits the currently active theme.\n */\n public readonly themes$ = this.registry.themes$;\n\n /**\n * Observable stream of all registered themes.\n */\n public readonly currentTheme$ = this.tracker.currentTheme$;\n\n /**\n * Creates a new instance\n *\n * @param {ThemeRegistryService} registry - Service for registering available themes\n * @param {ThemeTrackingService} tracker - Service for tracking the currently selected theme\n * @param {ThemeStyleManagerService} manager - Service for theme discovery, activation and deactivation\n * @param {StorageService} storage - Service for storing the currently selected theme in the browser storage\n * @param {ActivatedRoute} activatedRoute - Angular service for managing the current route\n * @param {Router} router - Angular service for navigating between routes\n * @param {string} storageKey - Key for storing the currently selected theme in browser storage\n * @param {string} queryParam - Query parameter name for specifying the theme in the route\n */\n constructor(\n private readonly registry: ThemeRegistryService,\n private readonly tracker: ThemeTrackingService,\n private readonly manager: ThemeStyleManagerService,\n private readonly storage: StorageService,\n private readonly activatedRoute: ActivatedRoute,\n private readonly router: Router,\n @Optional() @Inject(STORAGE_KEY) private readonly storageKey?: string,\n @Optional() @Inject(QUERY_PARAM) private readonly queryParam?: string,\n ) {\n // update the current route, the browser storage and the style elements' media attribute,\n // when the currently selected theme changes\n this.tracker.currentTheme$\n .pipe(\n filter(isNotNull),\n tap((theme) => this.#updateRouteParam(theme)),\n tap((theme) => this.#updateStoredTheme(theme)),\n tap((theme) => manager.use(theme)),\n takeUntil(this.#destroyed),\n )\n .subscribe();\n\n // calculate the initially selected theme\n this.registry.themes$\n .pipe(\n debounceTime(1),\n takeWhile(() => !this.tracker.currentTheme),\n map(\n (themes) =>\n themes.find((theme) => theme.defaultTheme) || themes[0],\n ),\n map((defaultTheme) => ({\n fromRoute: this.#themeFromRoute,\n fromStorage: this.#themeFromStorage,\n defaultTheme: defaultTheme?.id,\n })),\n map(\n ({ fromRoute, fromStorage, defaultTheme }) =>\n fromRoute || fromStorage || defaultTheme,\n ),\n tap((initialTheme) => {\n if (!this.tracker.currentTheme) {\n this.tracker.currentTheme = initialTheme;\n }\n }),\n take(1),\n )\n .subscribe();\n\n // if we got a storage key, update current theme on storage changes\n if (!!this.storageKey) {\n this.storage.changes$\n .pipe(\n skipWhile(() => !this.tracker.currentTheme),\n filter(({ key }) => key === this.storageKey),\n map(({ newValue }) => newValue),\n tap((theme) => (this.tracker.currentTheme = theme)),\n takeUntil(this.#destroyed),\n )\n .subscribe();\n }\n\n // if we got a query param, update the current theme on route param changes\n if (!!this.queryParam) {\n this.activatedRoute.queryParamMap\n .pipe(\n skipWhile(() => !this.tracker.currentTheme),\n filter((map) => map.has(this.queryParam!)),\n map((map) => map.get(this.queryParam!)),\n tap((theme) => (this.tracker.currentTheme = theme)),\n takeUntil(this.#destroyed),\n )\n .subscribe();\n }\n }\n\n /**\n * Cleanup logic to be executed when the service is destroyed.\n *\n * @internal\n */\n ngOnDestroy() {\n this.#destroyed.next();\n this.#destroyed.complete();\n }\n\n /**\n * Select the theme to be used\n *\n * @param {string} theme\n */\n selectTheme(theme: string) {\n this.tracker.currentTheme = theme;\n }\n\n /**\n * Gets the theme from the browser's storage.\n *\n * @returns {string | null} - The stored theme or null if the storage key is not provided\n * @private\n */\n get #themeFromStorage(): string | null {\n if (!this.storageKey) {\n return null;\n }\n return this.storage.getItem(this.storageKey);\n }\n\n /**\n * Gets the theme from the current route's query.\n *\n * @returns {string | null} - The current theme or null if the query param is not provided\n * @private\n */\n get #themeFromRoute(): string | null {\n if (!this.queryParam) {\n return null;\n }\n return this.activatedRoute.snapshot.queryParamMap.get(this.queryParam);\n }\n\n /**\n * Updates the browser's url query params with the given theme ID.\n *\n * Does nothing if the query param is not provided.\n *\n * @param {string} theme - The theme ID to update in the browser's url query params\n * @private\n */\n #updateRouteParam(theme: string) {\n if (!this.queryParam) {\n return;\n }\n this.router.navigate([], {\n relativeTo: this.activatedRoute,\n queryParams: theme ? { [this.queryParam]: theme } : {},\n queryParamsHandling: 'merge',\n preserveFragment: true,\n });\n }\n\n /**\n * Updates the theme ID in the browser's storage.\n *\n * Does nothing if the storage key is not provided.\n *\n * @param {string} theme - The theme ID to save in the browser's storage\n * @private\n */\n #updateStoredTheme(theme: string) {\n if (!this.storageKey) {\n return;\n }\n this.storage.setItem(this.storageKey, theme);\n }\n}\n\n/**\n * Type guard.\n *\n * @param {T | null]} arg - The argument to guard\n * @internal\n */\nfunction isNotNull<T>(arg: T | null): arg is T {\n return arg !== null;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ThemeRegistryService","i1.ThemeTrackingService","i1.ThemeStyleManagerService","i1.StorageService"],"mappings":";;;;;;;AA2BA;;;;;AAKG;MAEU,cAAc,CAAA;AAChB,IAAA,SAAS,CAAuB;AAEzC;;;;;AAKG;AACM,IAAA,QAAQ,CAAU;AAE3B;;;;;AAKG;AACM,IAAA,OAAO,CAAS;AAEzB;;;;;AAKG;AACM,IAAA,SAAS,CAAqC;AAYvD;;;;AAIG;AACH,IAAA,WAAA,CAAqC,QAAkB,EAAA;AAzC9C,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,OAAO,EAAQ,CAAC;A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