Compare commits

...

20 Commits

Author SHA1 Message Date
05cc971c0b 2.0.45
Some checks failed
Default (tags) / security (push) Failing after 24s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-06-24 07:16:09 +00:00
8d39592d23 fix(exports): Export static parts 2025-06-24 07:15:49 +00:00
0d6f9b7f19 2.0.44
Some checks failed
Default (tags) / security (push) Failing after 12s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-06-20 00:08:14 +00:00
8fc1a4ae5d fix(ci): Remove obsolete GitLab CI configuration 2025-06-20 00:08:14 +00:00
82d672abc2 2.0.43
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-06-20 00:06:31 +00:00
387b415de9 fix(dependencies): Bump build and runtime dependencies to newer versions for improved tooling and compatibility. 2025-06-20 00:06:31 +00:00
74229cb226 2.0.42 2025-04-18 19:22:57 +00:00
2e64489e9b fix(directives): Add explicit type annotations to subscribeWithTemplate directive export 2025-04-18 19:22:57 +00:00
af2b4048d0 2.0.41 2025-04-18 17:04:34 +00:00
a4992c26be fix(directives): Refactor export statements in directives index for consistency 2025-04-18 17:04:34 +00:00
02f32f5e4f 2.0.40 2025-04-18 17:00:04 +00:00
a9d5fce1b2 fix(dees-element): Refactor project structure and update dependency versions. Internal modules (e.g. dees-element classes and directives) have been reorganized and deprecated paths removed, and package.json now includes an updated packageManager field. 2025-04-18 17:00:04 +00:00
1dd6756213 2.0.39 2024-10-04 15:29:23 +02:00
07dcfb41be fix(core): Update dependency version for @design.estate/dees-domtools 2024-10-04 15:29:22 +02:00
fb2dc2e315 2.0.38 2024-10-02 17:50:38 +02:00
3d67a757ca fix(dependencies): Bump to 2.0.60 2024-10-02 17:50:37 +02:00
1b2206a8f9 2.0.37 2024-10-02 15:47:14 +02:00
5631c9cbb0 fix(dependencies): Update dependencies to latest versions. 2024-10-02 15:47:14 +02:00
e50bc60bfb 2.0.36 2024-07-01 14:26:00 +02:00
ffd95a2e2f fix(core): Ensure documentation completeness and code quality improvements 2024-07-01 14:25:59 +02:00
13 changed files with 5280 additions and 2472 deletions

View File

@ -1,128 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --prod
tags:
- lossless
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --dev
tags:
- lossless
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci npm build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install stable
- npmci npm install
- npmci command npm run buildDocs
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -1,5 +1,67 @@
# Changelog # Changelog
## 2025-06-20 - 2.0.44 - fix(ci)
Remove obsolete GitLab CI configuration
- Deleted the .gitlab-ci.yml file to remove outdated CI configuration from the repository.
## 2025-06-20 - 2.0.43 - fix(dependencies)
Bump build and runtime dependencies to newer versions for improved tooling and compatibility.
- Bumped @git.zone/tsbuild from ^2.3.2 to ^2.6.4
- Bumped @git.zone/tsbundle from ^2.2.5 to ^2.4.0
- Bumped @git.zone/tstest from ^1.0.96 to ^2.3.1
- Bumped @push.rocks/tapbundle from ^5.6.3 to ^6.0.3
- Bumped @design.estate/dees-domtools from ^2.3.2 to ^2.3.3
- Bumped @push.rocks/smartrx from ^3.0.7 to ^3.0.10
## 2025-04-18 - 2.0.42 - fix(directives)
Add explicit type annotations to subscribeWithTemplate directive export
- Imported DirectiveResult type for better typing
- Defined SubscribeWithTemplateFn signature to ensure proper type inference
- Used type assertion with 'as SubscribeWithTemplateFn' to improve type safety
## 2025-04-18 - 2.0.41 - fix(directives)
Refactor export statements in directives index for consistency
- Changed individual export of 'resolve' and 'subscribe' to wildcard exports in ts/directives/index.ts
- Simplified module export structure without altering functionality
## 2025-04-18 - 2.0.40 - fix(dees-element)
Refactor project structure and update dependency versions. Internal modules (e.g. dees-element classes and directives) have been reorganized and deprecated paths removed, and package.json now includes an updated packageManager field.
- Updated versions for @git.zone/tsbuild, tsbundle, tstest, tapbundle, and lit.
- Changed dependency @design.estate/dees-domtools from ^2.0.61 to ^2.3.2.
- Reorganized internal file structure: moved code from dees-element.classes.* to classes.* and re-exported via index.
- Added packageManager field in package.json for pnpm configuration.
## 2024-10-04 - 2.0.39 - fix(core)
Update dependency version for @design.estate/dees-domtools
- Bumped @design.estate/dees-domtools dependency to version ^2.0.61 to include latest patches and improvements.
## 2024-10-02 - 2.0.38 - fix(dependencies)
Bump `@design.estate/dees-domtools` to 2.0.60
- Updated @design.estate/dees-domtools from 2.0.59 to 2.0.60
## 2024-10-02 - 2.0.37 - fix(dependencies)
Update dependencies to latest versions.
- Updated @git.zone/tsbuild from ^2.1.82 to ^2.1.84
- Updated @types/node from ^20.14.9 to ^22.7.4
- Updated @push.rocks/tapbundle from ^5.0.23 to ^5.3.0
- Updated @design.estate/dees-domtools from ^2.0.57 to ^2.0.59
- Updated lit from ^3.1.4 to ^3.2.0
## 2024-07-01 - 2.0.36 - fix(core)
Ensure documentation completeness and code quality improvements
- Improved the README.md file to provide more detailed usage instructions and examples.
- Refactored code for better readability and performance.
- Updated npmextra.json to ensure accurate project metadata and configurations.
## 2024-07-01 - 2.0.35 - fix(dependencies) ## 2024-07-01 - 2.0.35 - fix(dependencies)
Update dependency versions and development dependencies Update dependency versions and development dependencies

View File

@ -1,6 +1,6 @@
{ {
"name": "@design.estate/dees-element", "name": "@design.estate/dees-element",
"version": "2.0.35", "version": "2.0.45",
"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",
@ -14,17 +14,17 @@
"buildDocs": "tsdoc" "buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.1.82", "@git.zone/tsbuild": "^2.6.4",
"@git.zone/tsbundle": "^2.0.15", "@git.zone/tsbundle": "^2.4.0",
"@git.zone/tstest": "^1.0.90", "@git.zone/tstest": "^2.3.1",
"@push.rocks/tapbundle": "^5.0.23", "@push.rocks/tapbundle": "^6.0.3",
"@types/node": "^20.14.9" "@types/node": "^22.14.1"
}, },
"dependencies": { "dependencies": {
"@design.estate/dees-domtools": "^2.0.57", "@design.estate/dees-domtools": "^2.3.3",
"@push.rocks/isounique": "^1.0.5", "@push.rocks/isounique": "^1.0.5",
"@push.rocks/smartrx": "^3.0.7", "@push.rocks/smartrx": "^3.0.10",
"lit": "^3.1.4" "lit": "^3.3.0"
}, },
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
@ -52,5 +52,6 @@
"web components", "web components",
"reactive programming", "reactive programming",
"DOM manipulation" "DOM manipulation"
] ],
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
} }

7435
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

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.35', version: '2.0.44',
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

@ -1,5 +1,5 @@
import { CSSResult, unsafeCSS } from 'lit'; import { CSSResult, unsafeCSS } from 'lit';
import * as plugins from './dees-element.plugins.js'; import * as plugins from './plugins.js';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
export interface IBdVarTriplet { export interface IBdVarTriplet {

View File

@ -1,4 +1,4 @@
import * as plugins from './dees-element.plugins.js'; import * as plugins from './plugins.js';
export class DeesElement extends plugins.lit.LitElement { export class DeesElement extends plugins.lit.LitElement {
// INSTANCE // INSTANCE

View File

@ -1,6 +1,9 @@
import { type TemplateResult, noChange } from 'lit'; import { type TemplateResult, noChange } from 'lit';
import { AsyncDirective, directive } from 'lit/async-directive.js'; import { AsyncDirective, directive } from 'lit/async-directive.js';
/**
* Resolves a promise and sets the value of the directive
*/
class ResolveDirective extends AsyncDirective { class ResolveDirective extends AsyncDirective {
promise: Promise<unknown> | undefined; promise: Promise<unknown> | undefined;
hasPromiseSettled: boolean = false; hasPromiseSettled: boolean = false;

View File

@ -2,6 +2,9 @@ import { noChange } from 'lit';
import { AsyncDirective, directive } from 'lit/async-directive.js'; import { AsyncDirective, directive } from 'lit/async-directive.js';
import { rxjs } from '@push.rocks/smartrx'; import { rxjs } from '@push.rocks/smartrx';
/**
* Subscribes to an observable
*/
class SubscribeDirective extends AsyncDirective { class SubscribeDirective extends AsyncDirective {
observable: rxjs.Observable<unknown> | undefined; observable: rxjs.Observable<unknown> | undefined;
sub: rxjs.Subscription | null = null; sub: rxjs.Subscription | null = null;

View File

@ -0,0 +1,61 @@
import { type TemplateResult, noChange } from 'lit';
import type { DirectiveResult } from 'lit/directive.js';
import { AsyncDirective, directive } from 'lit/async-directive.js';
import { rxjs } from '@push.rocks/smartrx';
/**
* Subscribes to an observable and applies a template function to each emission.
* @param observable - the source Observable
* @param templateFn - function mapping each emitted value to a TemplateResult or other renderable content
*/
class SubscribeWithTemplateDirective extends AsyncDirective {
private observable?: rxjs.Observable<unknown>;
private templateFn?: (value: unknown) => TemplateResult | unknown;
private sub: rxjs.Subscription | null = null;
render(
observable: rxjs.Observable<unknown>,
templateFn: (value: unknown) => TemplateResult | unknown
) {
const changed = this.observable !== observable || this.templateFn !== templateFn;
if (changed) {
this.sub?.unsubscribe();
this.observable = observable;
this.templateFn = templateFn;
if (this.isConnected) {
this.startSubscription();
}
}
return noChange;
}
private startSubscription() {
this.sub = this.observable!.subscribe((v: unknown) => {
const out = this.templateFn!(v);
this.setValue(out);
});
}
disconnected() {
this.sub?.unsubscribe();
}
reconnected() {
this.startSubscription();
}
}
/**
* Directive that renders templates for each emission of an Observable.
* Usage: html`${subscribeWithTemplate(myObservable, v => html`<span>${v}</span>`)}`
*/
/**
* Typed directive function signature: returns a Lit DirectiveResult.
*/
type SubscribeWithTemplateFn = <T>(
observable: rxjs.Observable<T>,
templateFn: (value: T) => TemplateResult | unknown
) => DirectiveResult;
export const subscribeWithTemplate = directive(
SubscribeWithTemplateDirective
) as SubscribeWithTemplateFn;

9
ts/directives/index.ts Normal file
View File

@ -0,0 +1,9 @@
// better scoped exports
export * from './classes.resolvedirective.js';
export * from './classes.subscribedirective.js';
export { subscribeWithTemplate } from './classes.subscribewithtemplate.js';
export { until } from 'lit/directives/until.js';
export { asyncAppend } from 'lit/directives/async-append.js';

View File

@ -1,38 +1,34 @@
import { CssManager } from './dees-element.classes.cssmanager.js'; import { CssManager } from './classes.cssmanager.js';
// lit exports // lit exports
export { html, type TemplateResult, css, unsafeCSS, render, type CSSResult } from 'lit'; export { html, type TemplateResult, css, unsafeCSS, render, type CSSResult } from 'lit';
export { html as static, unsafeStatic } from 'lit/static-html.js';
export { unsafeHTML } from 'lit/directives/unsafe-html.js'; export { unsafeHTML } from 'lit/directives/unsafe-html.js';
export { customElement } from 'lit/decorators/custom-element.js'; export { customElement } from 'lit/decorators/custom-element.js';
export { property, state, query, queryAll, queryAsync } from 'lit/decorators.js'; export { property, state, query, queryAll, queryAsync } from 'lit/decorators.js';
export { until } from 'lit/directives/until.js';
export { asyncAppend } from 'lit/directives/async-append.js';
// domtools exports // domtools exports
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
export { domtools }; export { domtools };
// DeesElements exports // DeesElements exports
export * from './dees-element.classes.dees-element.js'; export * from './classes.dees-element.js';
export * from './dees-element.classes.subscribedirective.js';
export * from './dees-element.classes.resolvedirective.js'; // directives exports
import * as directives from './directives/index.js';
export { directives };
/** /**
* a singleton instance of CssManager * a singleton instance of CssManager
*/ */
export const cssManager = new CssManager(); export const cssManager = new CssManager();
// better scoped exports
import { resolve } from './dees-element.classes.resolvedirective.js';
import { subscribe } from './dees-element.classes.subscribedirective.js';
export const directives = {
resolve,
subscribe,
}
// type exports // type exports
import type { rxjs } from '@push.rocks/smartrx'; import type { rxjs } from '@push.rocks/smartrx';