Compare commits

..

4 Commits

9 changed files with 3251 additions and 5991 deletions

View File

@@ -1,5 +1,17 @@
# Changelog # Changelog
## 2026-03-27 - 2.5.3 - fix(tsconfig)
add Node.js type definitions to TypeScript compiler options
- Includes the node type library in tsconfig to improve recognition of Node.js globals and APIs during type checking.
## 2026-03-27 - 2.5.2 - fix(build,types)
migrate smart config filename and tighten TypeScript null handling
- rename npmextra.json to .smartconfig.json and update the published files list
- update build and test tool dependencies and enable logfile output for tests
- fix TypeScript compatibility by allowing nullable DOM references, casting keyboard event listeners, and guarding optional scroll durations
## 2026-03-11 - 2.5.1 - fix(breakpoints) ## 2026-03-11 - 2.5.1 - fix(breakpoints)
rename exported functions to reflect constraint-based API: cssForCustom -> cssForConstraint and cssForCustomContainer -> cssForConstraintContainer; update README usage rename exported functions to reflect constraint-based API: cssForCustom -> cssForConstraint and cssForCustomContainer -> cssForConstraintContainer; update README usage

View File

@@ -1,6 +1,6 @@
{ {
"name": "@design.estate/dees-domtools", "name": "@design.estate/dees-domtools",
"version": "2.5.1", "version": "2.5.3",
"private": false, "private": false,
"description": "A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.", "description": "A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@@ -9,34 +9,34 @@
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/ --verbose)", "test": "(tstest test/ --verbose --logfile)",
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)", "build": "(tsbuild --web --allowimplicitany && tsbundle npm)",
"format": "(gitzone format)", "format": "(gitzone format)",
"buildDocs": "tsdoc" "buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^4.1.3", "@git.zone/tsbuild": "^4.4.0",
"@git.zone/tsbundle": "^2.9.0", "@git.zone/tsbundle": "^2.10.0",
"@git.zone/tstest": "^3.2.0", "@git.zone/tstest": "^3.6.1",
"@push.rocks/tapbundle": "^6.0.3", "@push.rocks/tapbundle": "^6.0.3",
"@types/node": "^25.3.3" "@types/node": "^25.5.0"
}, },
"dependencies": { "dependencies": {
"@api.global/typedrequest": "^3.3.0", "@api.global/typedrequest": "^3.3.0",
"@design.estate/dees-comms": "^1.0.30", "@design.estate/dees-comms": "^1.0.30",
"@push.rocks/lik": "^6.3.1", "@push.rocks/lik": "^6.4.0",
"@push.rocks/smartdelay": "^3.0.5", "@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartjson": "^6.0.0", "@push.rocks/smartjson": "^6.0.0",
"@push.rocks/smartmarkdown": "^3.0.3", "@push.rocks/smartmarkdown": "^3.0.3",
"@push.rocks/smartpromise": "^4.2.3", "@push.rocks/smartpromise": "^4.2.3",
"@push.rocks/smartrouter": "^1.3.3", "@push.rocks/smartrouter": "^1.3.3",
"@push.rocks/smartrx": "^3.0.10", "@push.rocks/smartrx": "^3.0.10",
"@push.rocks/smartstate": "^2.2.1", "@push.rocks/smartstate": "^2.3.0",
"@push.rocks/smartstring": "^4.1.0", "@push.rocks/smartstring": "^4.1.0",
"@push.rocks/smarturl": "^3.1.0", "@push.rocks/smarturl": "^3.1.0",
"@push.rocks/webrequest": "^4.0.5", "@push.rocks/webrequest": "^4.0.5",
"@push.rocks/websetup": "^3.0.19", "@push.rocks/websetup": "^3.0.19",
"@push.rocks/webstore": "^2.0.20", "@push.rocks/webstore": "^2.0.21",
"@tempfix/lenis": "^1.3.20", "@tempfix/lenis": "^1.3.20",
"lit": "^3.3.2", "lit": "^3.3.2",
"sweet-scroll": "^4.0.0" "sweet-scroll": "^4.0.0"
@@ -50,7 +50,7 @@
"dist_ts_web/**/*", "dist_ts_web/**/*",
"assets/**/*", "assets/**/*",
"cli.js", "cli.js",
"npmextra.json", ".smartconfig.json",
"readme.md" "readme.md"
], ],
"browserslist": [ "browserslist": [

9179
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-domtools', name: '@design.estate/dees-domtools',
version: '2.5.1', version: '2.5.3',
description: 'A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.' description: 'A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.'
} }

View File

@@ -84,8 +84,8 @@ export class DomTools {
// ======== // ========
// elements // elements
public elements: { public elements: {
headElement: HTMLElement; headElement: HTMLElement | null;
bodyElement: HTMLElement; bodyElement: HTMLElement | null;
} = { } = {
headElement: null, headElement: null,
bodyElement: null, bodyElement: null,
@@ -100,7 +100,7 @@ export class DomTools {
public smartstate = new plugins.smartstate.Smartstate(); public smartstate = new plugins.smartstate.Smartstate();
public domToolsStatePart = this.smartstate.getStatePart<IDomToolsState>('domtools', { public domToolsStatePart = this.smartstate.getStatePart<IDomToolsState>('domtools', {
virtualViewport: 'native', virtualViewport: 'native',
jwt: null, jwt: '' as string,
}); });
public router = new plugins.smartrouter.SmartRouter({ public router = new plugins.smartrouter.SmartRouter({
@@ -117,7 +117,7 @@ export class DomTools {
public deesComms = new plugins.deesComms.DeesComms(); public deesComms = new plugins.deesComms.DeesComms();
public scroller = new Scroller(this); public scroller = new Scroller(this);
public themeManager = new ThemeManager(this); public themeManager = new ThemeManager(this);
public keyboard: Keyboard = null; // Initialized after DOM ready to avoid accessing document.body before it exists public keyboard: Keyboard | null = null; // Initialized after DOM ready to avoid accessing document.body before it exists
public domToolsReady = plugins.smartpromise.defer(); public domToolsReady = plugins.smartpromise.defer();
public domReady = plugins.smartpromise.defer(); public domReady = plugins.smartpromise.defer();
@@ -151,8 +151,8 @@ export class DomTools {
} }
} }
return await this.runOnceTrackerStringMap.registerUntilTrue( return await this.runOnceTrackerStringMap.registerUntilTrue(
(stringMap) => { (stringMap?: string[]) => {
return !stringMap.includes(runningId); return !stringMap?.includes(runningId);
}, },
() => { () => {
// Check if there was an error and re-throw it // Check if there was an error and re-throw it
@@ -175,7 +175,7 @@ export class DomTools {
const styleElement = document.createElement('style'); const styleElement = document.createElement('style');
styleElement.type = 'text/css'; styleElement.type = 'text/css';
styleElement.appendChild(document.createTextNode(stylesText)); styleElement.appendChild(document.createTextNode(stylesText));
this.elements.headElement.appendChild(styleElement); this.elements.headElement!.appendChild(styleElement);
} }
/** /**

View File

@@ -155,13 +155,13 @@ export class Keyboard {
} }
public startListening() { public startListening() {
this.domNode.addEventListener('keydown', this.handleKeyDown); this.domNode.addEventListener('keydown', this.handleKeyDown as EventListener);
this.domNode.addEventListener('keyup', this.handleKeyUp); this.domNode.addEventListener('keyup', this.handleKeyUp as EventListener);
} }
public stopListening() { public stopListening() {
this.domNode.removeEventListener('keydown', this.handleKeyDown); this.domNode.removeEventListener('keydown', this.handleKeyDown as EventListener);
this.domNode.removeEventListener('keyup', this.handleKeyUp); this.domNode.removeEventListener('keyup', this.handleKeyUp as EventListener);
} }
public clear() { public clear() {

View File

@@ -35,8 +35,10 @@ export class Scroller {
optionsArg: Parameters<typeof this.sweetScroller.toElement>[1] optionsArg: Parameters<typeof this.sweetScroller.toElement>[1]
) { ) {
this.sweetScroller.toElement(elementArg, optionsArg); this.sweetScroller.toElement(elementArg, optionsArg);
if (optionsArg?.duration) {
await plugins.smartdelay.delayFor(optionsArg.duration); await plugins.smartdelay.delayFor(optionsArg.duration);
} }
}
/** /**
* Detects whether native smooth scrolling is enabled. * Detects whether native smooth scrolling is enabled.

View File

@@ -4,7 +4,8 @@
"module": "NodeNext", "module": "NodeNext",
"moduleResolution": "NodeNext", "moduleResolution": "NodeNext",
"esModuleInterop": true, "esModuleInterop": true,
"verbatimModuleSyntax": true "verbatimModuleSyntax": true,
"types": ["node"]
}, },
"exclude": [ "exclude": [
"dist_*/**/*.d.ts" "dist_*/**/*.d.ts"