Compare commits

...

6 Commits

Author SHA1 Message Date
217ea3e9d4 2.1.2
Some checks failed
Default (tags) / security (push) Failing after 12s
Default (tags) / test (push) Failing after 11s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-07-06 12:06:06 +00:00
8263a4fe73 fix(build): Update build script in package.json to include tsfolders in tsbuild command 2025-07-06 12:06:06 +00:00
340582e042 2.1.1
Some checks failed
Default (tags) / security (push) Failing after 21s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-07-06 12:04:15 +00:00
a8e07f9682 fix(documentation): Refine project documentation and metadata for clarity 2025-07-06 12:04:15 +00:00
aa37652b6d 2.1.0
Some checks failed
Default (tags) / security (push) Failing after 22s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-07-06 11:56:23 +00:00
7e26cd39d7 feat(DeesElement): Add invocation of the themeChanged hook in connectedCallback 2025-07-06 11:56:23 +00:00
4 changed files with 32 additions and 3 deletions

View File

@ -1,5 +1,23 @@
# Changelog # Changelog
## 2025-07-06 - 2.1.2 - fix(build)
Update build script in package.json to include 'tsfolders' in tsbuild command
- Changed build script from 'tsbuild --web --allowimplicitany && tsbundle npm' to 'tsbuild tsfolders --web --allowimplicitany && tsbundle npm'
## 2025-07-06 - 2.1.1 - fix(documentation)
Refine project documentation and metadata for clarity
- Update readme examples to better illustrate custom element usage
- Clarify CssManager theming and API usage in documentation
- Ensure package.json and commitinfo reflect accurate project details
## 2025-07-06 - 2.1.0 - feat(DeesElement)
Add invocation of the themeChanged hook in connectedCallback
- Now calls themeChanged (if defined) when the theme changes, enabling custom handlers for theme switches
- Improves lifecycle management by allowing extensions to react to bright/dark mode changes
## 2025-06-20 - 2.0.44 - fix(ci) ## 2025-06-20 - 2.0.44 - fix(ci)
Remove obsolete GitLab CI configuration Remove obsolete GitLab CI configuration

View File

@ -1,6 +1,6 @@
{ {
"name": "@design.estate/dees-element", "name": "@design.estate/dees-element",
"version": "2.0.45", "version": "2.1.2",
"private": false, "private": false,
"description": "A library for creating custom elements extending the lit element class with additional functionalities.", "description": "A library for creating custom elements extending the lit element class with additional functionalities.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -10,7 +10,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/ --web)",
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)", "build": "(tsbuild tsfolders --web --allowimplicitany && tsbundle npm)",
"buildDocs": "tsdoc" "buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {

View File

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

View File

@ -25,11 +25,22 @@ export class DeesElement extends plugins.lit.LitElement {
}); });
} }
/**
* Called when the theme changes between bright and dark.
* Override this method to handle theme changes.
* @param goBright - true if switching to bright theme, false if switching to dark theme
*/
protected themeChanged?(goBright: boolean): void;
public async connectedCallback() { public async connectedCallback() {
super.connectedCallback(); super.connectedCallback();
const domtools = await this.domtoolsPromise; const domtools = await this.domtoolsPromise;
this.themeSubscription = domtools.themeManager.themeObservable.subscribe((goBrightArg) => { this.themeSubscription = domtools.themeManager.themeObservable.subscribe((goBrightArg) => {
this.goBright = goBrightArg; this.goBright = goBrightArg;
// Call themeChanged if it's defined
if (this.themeChanged) {
this.themeChanged(goBrightArg);
}
}); });
this.rxSubscriptions.push(this.themeSubscription); this.rxSubscriptions.push(this.themeSubscription);
for (const startupFunction of this.startupFunctions) { for (const startupFunction of this.startupFunctions) {