fix(CssManager): Make CssManager a singleton and export the shared instance via getSingleton; update tests and dependencies

This commit is contained in:
2025-11-16 14:53:02 +00:00
parent 217ea3e9d4
commit 8d60911b34
8 changed files with 2734 additions and 1167 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-element',
version: '2.1.2',
version: '2.1.3',
description: 'A library for creating custom elements extending the lit element class with additional functionalities.'
}

View File

@@ -9,6 +9,21 @@ export interface IBdVarTriplet {
}
export class CssManager {
// STATIC
private static instance: CssManager | null = null;
/**
* Returns the singleton instance of CssManager
*/
public static getSingleton(): CssManager {
if (!CssManager.instance) {
CssManager.instance = new CssManager();
}
return CssManager.instance;
}
// INSTANCE
public domtoolsPromise = domtools.DomTools.setupDomTools();
public goBright: boolean = false;
public bdVarTripletStore: IBdVarTriplet[] = [];

View File

@@ -26,7 +26,7 @@ export { directives };
/**
* a singleton instance of CssManager
*/
export const cssManager = new CssManager();
export const cssManager = CssManager.getSingleton();