Compare commits
66 Commits
Author | SHA1 | Date | |
---|---|---|---|
6a7da41c98 | |||
b67a602f78 | |||
fa093e6f5b | |||
29f26d2ea7 | |||
77fe34ebac | |||
9ccd2fb2cf | |||
02f67c64df | |||
31dd8aa258 | |||
5f66725c6b | |||
89af82d2c4 | |||
98dab6c683 | |||
805ce5ed88 | |||
6f30b7618d | |||
42fd443ad8 | |||
b2cb49a314 | |||
d580df7e0a | |||
68ea3052fd | |||
252d56a321 | |||
497e6d1c11 | |||
f1949bdc5d | |||
d36d4a921a | |||
e6194045d1 | |||
6147e5f02f | |||
0e64232e26 | |||
fa66a51612 | |||
b26cc004c1 | |||
f923802ba1 | |||
cf589d727f | |||
b6720aef9d | |||
ce945173ec | |||
0c016ea6d9 | |||
467b0d3011 | |||
333e991231 | |||
94c6c5a525 | |||
bb64a8ecac | |||
a4a26e44aa | |||
f350905907 | |||
a90e326f5e | |||
7c9aef342d | |||
99eab4e35f | |||
6d12aed53e | |||
29bcd17350 | |||
f2e858d0b8 | |||
83a78a2c97 | |||
d77c657d6a | |||
f8f2f05396 | |||
7ee0d63a2c | |||
e01f1a6a72 | |||
c7b9374169 | |||
dfe189ff1c | |||
b777508b7a | |||
52664d8ea1 | |||
7bad85a1fa | |||
e5056a7be3 | |||
989d4d35d2 | |||
c5e75419b3 | |||
ca52d06c60 | |||
d33366c487 | |||
3bc5e1d0e2 | |||
96a88112dc | |||
6c0c1e165f | |||
653a4138a9 | |||
d776843494 | |||
79e64c4cc2 | |||
7192d3fbf7 | |||
42bcb8243d |
@ -12,29 +12,25 @@ stages:
|
|||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- pnpm install -g pnpm
|
||||||
|
- pnpm install -g @shipzone/npmci
|
||||||
|
- npmci npm prepare
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# security stage
|
||||||
|
# ====================
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
# ====================
|
# ====================
|
||||||
mirror:
|
|
||||||
stage: security
|
|
||||||
script:
|
|
||||||
- npmci git mirror
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
tags:
|
|
||||||
- lossless
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
auditProductionDependencies:
|
auditProductionDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
|
||||||
- npmci command npm install --production --ignore-scripts
|
|
||||||
- npmci command npm config set registry https://registry.npmjs.org
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command npm audit --audit-level=high --only=prod --production
|
- npmci command pnpm audit --audit-level=high --prod
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
@ -42,11 +38,10 @@ auditDevDependencies:
|
|||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
|
||||||
- npmci command npm install --ignore-scripts
|
|
||||||
- npmci command npm config set registry https://registry.npmjs.org
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command npm audit --audit-level=high --only=dev
|
- npmci command pnpm audit --audit-level=high --dev
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
@ -57,7 +52,6 @@ auditDevDependencies:
|
|||||||
testStable:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
@ -68,10 +62,9 @@ testStable:
|
|||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command npm run build
|
- npmci npm build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
@ -97,10 +90,9 @@ codequality:
|
|||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g tslint typescript
|
- npmci command npm install -g typescript
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
@ -120,11 +112,9 @@ trigger:
|
|||||||
pages:
|
pages:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command tsdoc
|
- npmci command npm run buildDocs
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -2,28 +2,10 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "current file",
|
"command": "npm test",
|
||||||
"type": "node",
|
"name": "Run npm test",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"args": [
|
"type": "node-terminal"
|
||||||
"${relativeFile}"
|
|
||||||
],
|
|
||||||
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
|
||||||
"cwd": "${workspaceRoot}",
|
|
||||||
"protocol": "inspector",
|
|
||||||
"internalConsoleOptions": "openOnSessionStart"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "test.ts",
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"args": [
|
|
||||||
"test/test.ts"
|
|
||||||
],
|
|
||||||
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
|
||||||
"cwd": "${workspaceRoot}",
|
|
||||||
"protocol": "inspector",
|
|
||||||
"internalConsoleOptions": "openOnSessionStart"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
"projectType": "npm",
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "designestate",
|
"gitscope": "design.estate",
|
||||||
"gitrepo": "dees-domtools",
|
"gitrepo": "dees-domtools",
|
||||||
"shortDescription": "tools to simplify complex css structures",
|
"description": "tools to simplify complex css structures",
|
||||||
"npmPackagename": "@designestate/dees-domtools",
|
"npmPackagename": "@design.estate/dees-domtools",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"projectDomain": "design.estate"
|
"projectDomain": "design.estate"
|
||||||
}
|
}
|
||||||
|
19481
package-lock.json
generated
19481
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
47
package.json
47
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@design.estate/dees-domtools",
|
||||||
"version": "2.0.13",
|
"version": "2.0.46",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "tools to simplify complex css structures",
|
"description": "tools to simplify complex css structures",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -10,31 +10,32 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --web)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild --web --allowimplicitany --skiplibcheck && tsbundle npm)",
|
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)",
|
||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)",
|
||||||
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.61",
|
"@git.zone/tsbuild": "^2.1.70",
|
||||||
"@gitzone/tsbundle": "^1.0.102",
|
"@git.zone/tsbundle": "^2.0.8",
|
||||||
"@gitzone/tstest": "^1.0.70",
|
"@git.zone/tstest": "^1.0.81",
|
||||||
"@pushrocks/tapbundle": "^5.0.3",
|
"@push.rocks/tapbundle": "^5.0.15",
|
||||||
"@types/node": "^17.0.23",
|
"@types/node": "^20.8.2"
|
||||||
"tslint": "^6.1.3",
|
|
||||||
"tslint-config-prettier": "^1.15.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apiglobal/typedrequest": "^2.0.3",
|
"@api.global/typedrequest": "^3.0.1",
|
||||||
"@designestate/dees-comms": "^1.0.22",
|
"@design.estate/dees-comms": "^1.0.22",
|
||||||
"@pushrocks/lik": "^5.0.4",
|
"@push.rocks/lik": "^6.0.5",
|
||||||
"@pushrocks/smartdelay": "^2.0.13",
|
"@push.rocks/smartdelay": "^3.0.5",
|
||||||
"@pushrocks/smartpromise": "^3.1.7",
|
"@push.rocks/smartjson": "^5.0.10",
|
||||||
"@pushrocks/smartrouter": "^1.0.12",
|
"@push.rocks/smartpromise": "^4.0.2",
|
||||||
"@pushrocks/smartrx": "^2.0.25",
|
"@push.rocks/smartrouter": "^1.0.16",
|
||||||
"@pushrocks/smartstate": "^2.0.0",
|
"@push.rocks/smartrx": "^3.0.6",
|
||||||
"@pushrocks/webrequest": "^3.0.3",
|
"@push.rocks/smartstate": "^2.0.13",
|
||||||
"@pushrocks/websetup": "^3.0.16",
|
"@push.rocks/smarturl": "^3.0.6",
|
||||||
"@pushrocks/webstore": "^1.0.18",
|
"@push.rocks/webrequest": "^3.0.33",
|
||||||
"lit": "^2.2.2",
|
"@push.rocks/websetup": "^3.0.19",
|
||||||
|
"@push.rocks/webstore": "^2.0.13",
|
||||||
|
"lit": "^2.8.0",
|
||||||
"sweet-scroll": "^4.0.0"
|
"sweet-scroll": "^4.0.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
5692
pnpm-lock.yaml
generated
Normal file
5692
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,6 @@ Code Style | [](htt
|
|||||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -33,7 +32,6 @@ We are always happy for code contributions. If you are not the code contributing
|
|||||||
|
|
||||||
For further information read the linked docs at the top of this readme.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
## Legal
|
||||||
|
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@push.rocks/tapbundle';
|
||||||
import * as domtools from '../ts/index';
|
import * as domtools from '../ts/index.js';
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
||||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* autocreated commitinfo by @pushrocks/commitinfo
|
||||||
|
*/
|
||||||
|
export const commitinfo = {
|
||||||
|
name: '@design.estate/dees-domtools',
|
||||||
|
version: '2.0.46',
|
||||||
|
description: 'tools to simplify complex css structures'
|
||||||
|
}
|
@ -1,10 +1,7 @@
|
|||||||
import * as plugins from './domtools.plugins.js';
|
import * as plugins from './domtools.plugins.js';
|
||||||
import { Stringmap } from '@pushrocks/lik/dist_ts/lik.stringmap.js';
|
import { type TViewport } from './domtools.css.breakpoints.js';
|
||||||
import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap.js';
|
|
||||||
import { TViewport } from './domtools.css.breakpoints.js';
|
|
||||||
|
|
||||||
import { Scroller } from './domtools.classes.scroller.js';
|
import { Scroller } from './domtools.classes.scroller.js';
|
||||||
import { WebSetup } from '@pushrocks/websetup';
|
import { WebSetup } from '@push.rocks/websetup';
|
||||||
import { ThemeManager } from './domtools.classes.thememanager.js';
|
import { ThemeManager } from './domtools.classes.thememanager.js';
|
||||||
import { Keyboard } from './domtools.classes.keyboard.js';
|
import { Keyboard } from './domtools.classes.keyboard.js';
|
||||||
|
|
||||||
@ -91,6 +88,8 @@ export class DomTools {
|
|||||||
public convenience = {
|
public convenience = {
|
||||||
typedrequest: plugins.typedrequest,
|
typedrequest: plugins.typedrequest,
|
||||||
smartdelay: plugins.smartdelay,
|
smartdelay: plugins.smartdelay,
|
||||||
|
smartjson: plugins.smartjson,
|
||||||
|
smarturl: plugins.smarturl,
|
||||||
};
|
};
|
||||||
|
|
||||||
public deesComms = new plugins.deesComms.DeesComms();
|
public deesComms = new plugins.deesComms.DeesComms();
|
||||||
@ -106,8 +105,8 @@ export class DomTools {
|
|||||||
|
|
||||||
constructor(optionsArg: IDomToolsContructorOptions) {}
|
constructor(optionsArg: IDomToolsContructorOptions) {}
|
||||||
|
|
||||||
private runOnceTrackerStringMap = new Stringmap();
|
private runOnceTrackerStringMap = new plugins.lik.Stringmap();
|
||||||
private runOnceResultMap = new FastMap();
|
private runOnceResultMap = new plugins.lik.FastMap();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* run a function once and always get the Promise of the first execution
|
* run a function once and always get the Promise of the first execution
|
||||||
@ -146,6 +145,23 @@ export class DomTools {
|
|||||||
this.elements.headElement.appendChild(styleElement);
|
this.elements.headElement.appendChild(styleElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* allows to set global styles
|
||||||
|
* @param stylesText the css text you want to set
|
||||||
|
*/
|
||||||
|
public async setExternalScript(scriptLinkArg: string) {
|
||||||
|
await this.domReady.promise;
|
||||||
|
const done = plugins.smartpromise.defer();
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.src = scriptLinkArg;
|
||||||
|
script.addEventListener('load', function () {
|
||||||
|
done.resolve();
|
||||||
|
});
|
||||||
|
const parentNode = document.head || document.body;
|
||||||
|
parentNode.append(script);
|
||||||
|
await done.promise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* allows setting external css files
|
* allows setting external css files
|
||||||
* @param cssLinkArg a url to an external stylesheet
|
* @param cssLinkArg a url to an external stylesheet
|
||||||
|
@ -128,8 +128,6 @@ export enum Key {
|
|||||||
Quote = 222,
|
Quote = 222,
|
||||||
}
|
}
|
||||||
|
|
||||||
type KeyCombo = Array<Key>;
|
|
||||||
|
|
||||||
export class Keyboard {
|
export class Keyboard {
|
||||||
private mapCombosToHandlers = new Map<number[], plugins.smartrx.rxjs.Subject<KeyboardEvent>>();
|
private mapCombosToHandlers = new Map<number[], plugins.smartrx.rxjs.Subject<KeyboardEvent>>();
|
||||||
private pressedKeys = new Set<Key>();
|
private pressedKeys = new Set<Key>();
|
||||||
@ -140,15 +138,22 @@ export class Keyboard {
|
|||||||
|
|
||||||
public keyEnum = Key;
|
public keyEnum = Key;
|
||||||
|
|
||||||
public on(keys: Key[] | KeyCombo[]) {
|
public on(keys: Key[]) {
|
||||||
const combos = this.toCombos(keys);
|
|
||||||
const subject = new plugins.smartrx.rxjs.Subject<KeyboardEvent>();
|
const subject = new plugins.smartrx.rxjs.Subject<KeyboardEvent>();
|
||||||
combos.forEach((combo) => {
|
this.registerKeys(keys, subject);
|
||||||
this.registerComboCallback(combo, subject);
|
|
||||||
});
|
|
||||||
return subject;
|
return subject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public triggerKeyPress(keysArg: Key[]) {
|
||||||
|
for (const key of keysArg) {
|
||||||
|
this.pressedKeys.add(key);
|
||||||
|
}
|
||||||
|
this.checkMatchingKeyboardSubjects();
|
||||||
|
for (const key of keysArg) {
|
||||||
|
this.pressedKeys.delete(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public startListening() {
|
public startListening() {
|
||||||
this.domNode.addEventListener('keydown', this.handleKeyDown);
|
this.domNode.addEventListener('keydown', this.handleKeyDown);
|
||||||
this.domNode.addEventListener('keyup', this.handleKeyUp);
|
this.domNode.addEventListener('keyup', this.handleKeyUp);
|
||||||
@ -167,22 +172,25 @@ export class Keyboard {
|
|||||||
|
|
||||||
private handleKeyDown = (event: KeyboardEvent) => {
|
private handleKeyDown = (event: KeyboardEvent) => {
|
||||||
this.pressedKeys.add(event.keyCode);
|
this.pressedKeys.add(event.keyCode);
|
||||||
|
this.checkMatchingKeyboardSubjects(event);
|
||||||
|
};
|
||||||
|
|
||||||
this.mapCombosToHandlers.forEach((subjectArg, comboArg) => {
|
private checkMatchingKeyboardSubjects(payloadArg?) {
|
||||||
if (this.isComboPressed(comboArg)) {
|
this.mapCombosToHandlers.forEach((subjectArg, keysArg) => {
|
||||||
subjectArg.next(event);
|
if (this.areAllKeysPressed(keysArg)) {
|
||||||
|
subjectArg.next(payloadArg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
private handleKeyUp = (event: KeyboardEvent) => {
|
private handleKeyUp = (event: KeyboardEvent) => {
|
||||||
this.pressedKeys.delete(event.keyCode);
|
this.pressedKeys.delete(event.keyCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
private isComboPressed(combo: number[]) {
|
private areAllKeysPressed(keysArg: Key[]) {
|
||||||
let result = true;
|
let result = true;
|
||||||
|
|
||||||
combo.forEach((key) => {
|
keysArg.forEach((key) => {
|
||||||
if (!this.pressedKeys.has(key)) {
|
if (!this.pressedKeys.has(key)) {
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
@ -191,33 +199,15 @@ export class Keyboard {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private registerComboCallback(
|
private registerKeys(
|
||||||
comboArg: Array<Key>,
|
keysArg: Array<Key>,
|
||||||
subjectArg: plugins.smartrx.rxjs.Subject<KeyboardEvent>
|
subjectArg: plugins.smartrx.rxjs.Subject<KeyboardEvent>
|
||||||
) {
|
) {
|
||||||
if (!this.mapCombosToHandlers.has(comboArg)) {
|
if (!this.mapCombosToHandlers.has(keysArg)) {
|
||||||
this.mapCombosToHandlers.set(comboArg, subjectArg);
|
this.mapCombosToHandlers.set(keysArg, subjectArg);
|
||||||
} else {
|
} else {
|
||||||
const subject = this.mapCombosToHandlers.get(comboArg);
|
const subject = this.mapCombosToHandlers.get(keysArg);
|
||||||
return subject;
|
return subject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private toCombos(keys: KeyCombo[] | Key[]) {
|
|
||||||
if (keys.length === 0) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const isKeys = !Array.isArray(keys[0]);
|
|
||||||
let combos: KeyCombo[] = [];
|
|
||||||
|
|
||||||
if (isKeys) {
|
|
||||||
combos = (keys as Key[]).map((key) => [key]);
|
|
||||||
} else {
|
|
||||||
combos = keys as KeyCombo[];
|
|
||||||
combos = combos.filter((combo) => combo.length > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return combos;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,47 +6,33 @@ import { css, unsafeCSS } from 'lit';
|
|||||||
* changes scrollbar styles to be consistent across OS borders
|
* changes scrollbar styles to be consistent across OS borders
|
||||||
*/
|
*/
|
||||||
export const scrollBarStyles: string = (() => {
|
export const scrollBarStyles: string = (() => {
|
||||||
const returnStyles =
|
const returnStylesOld = navigator.userAgent.indexOf('Mac OS X') === -1 ? css``.cssText : ``;
|
||||||
navigator.userAgent.indexOf('Mac OS X') === -1
|
const returnStyles = css`
|
||||||
? css`
|
|
||||||
/* width */
|
/* width */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 6px;
|
width: 0px;
|
||||||
}
|
}
|
||||||
|
body {
|
||||||
/* Track */
|
scrollbar-width: none;
|
||||||
::-webkit-scrollbar-track {
|
|
||||||
background: #111;
|
|
||||||
}
|
}
|
||||||
|
`.cssText;
|
||||||
/* Handle */
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Handle on hover */
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
background: #777;
|
|
||||||
}
|
|
||||||
`.cssText
|
|
||||||
: ``;
|
|
||||||
return returnStyles;
|
return returnStyles;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
export const globalBaseStyles: string = css`
|
export const globalBaseStyles: string = css`
|
||||||
/* global material font */
|
/*
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Material Icons';
|
font-family: 'Material Icons';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2)
|
src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2)
|
||||||
format('woff2');
|
format('woff2');
|
||||||
}
|
} */
|
||||||
|
|
||||||
/* global body styles */
|
/* global body styles */
|
||||||
body {
|
body {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Mona Sans', 'Inter', sans-serif;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from './domtools.plugins.js';
|
import * as plugins from './domtools.plugins.js';
|
||||||
import { DomTools, IDomToolsContructorOptions } from './domtools.classes.domtools.js';
|
import { DomTools, type IDomToolsContructorOptions } from './domtools.classes.domtools.js';
|
||||||
import { scrollBarStyles, globalBaseStyles } from './domtools.css.basestyles.js';
|
import { scrollBarStyles, globalBaseStyles } from './domtools.css.basestyles.js';
|
||||||
|
|
||||||
import { html, LitElement, css, unsafeCSS } from 'lit';
|
import { html, LitElement, css, unsafeCSS } from 'lit';
|
||||||
@ -12,7 +12,7 @@ export const staticStyles = css`
|
|||||||
|
|
||||||
:host {
|
:host {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Mona Sans', 'Inter', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
${unsafeCSS(scrollBarStyles)}
|
${unsafeCSS(scrollBarStyles)}
|
||||||
@ -29,7 +29,7 @@ export const styles = html`
|
|||||||
}
|
}
|
||||||
|
|
||||||
:host {
|
:host {
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Mona Sans', 'Inter', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
${scrollBarStyles}
|
${scrollBarStyles}
|
||||||
@ -40,7 +40,10 @@ export const styles = html`
|
|||||||
* a basic setup for elements
|
* a basic setup for elements
|
||||||
* makes sure everything is in check
|
* makes sure everything is in check
|
||||||
*/
|
*/
|
||||||
export const setup = async (elementArg?: LitElement, optionsArg: IDomToolsContructorOptions = {}): Promise<DomTools> => {
|
export const setup = async (
|
||||||
|
elementArg?: LitElement,
|
||||||
|
optionsArg: IDomToolsContructorOptions = {}
|
||||||
|
): Promise<DomTools> => {
|
||||||
const domTools = await DomTools.setupDomTools(optionsArg);
|
const domTools = await DomTools.setupDomTools(optionsArg);
|
||||||
|
|
||||||
if (elementArg) {
|
if (elementArg) {
|
||||||
|
@ -1,35 +1,43 @@
|
|||||||
// designestate scope
|
// designestate scope
|
||||||
import * as deesComms from '@designestate/dees-comms';
|
import * as deesComms from '@design.estate/dees-comms';
|
||||||
|
|
||||||
export { deesComms };
|
export { deesComms };
|
||||||
|
|
||||||
// apiglobal scope
|
// apiglobal scope
|
||||||
import * as typedrequest from '@apiglobal/typedrequest';
|
import * as typedrequest from '@api.global/typedrequest';
|
||||||
|
|
||||||
export { typedrequest };
|
export { typedrequest };
|
||||||
|
|
||||||
// pushrocks scope
|
// pushrocks scope
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@push.rocks/smartdelay';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartjson from '@push.rocks/smartjson';
|
||||||
import * as smartrouter from '@pushrocks/smartrouter';
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
import * as smartrx from '@pushrocks/smartrx';
|
import * as smartrouter from '@push.rocks/smartrouter';
|
||||||
import * as smartstate from '@pushrocks/smartstate';
|
import * as smartrx from '@push.rocks/smartrx';
|
||||||
import * as webrequest from '@pushrocks/webrequest';
|
import * as smartstate from '@push.rocks/smartstate';
|
||||||
import * as websetup from '@pushrocks/websetup';
|
import * as smarturl from '@push.rocks/smarturl';
|
||||||
import * as webstore from '@pushrocks/webstore';
|
import * as webrequest from '@push.rocks/webrequest';
|
||||||
|
import * as websetup from '@push.rocks/websetup';
|
||||||
|
import * as webstore from '@push.rocks/webstore';
|
||||||
|
|
||||||
// subscope lik
|
// subscope lik
|
||||||
import { ObjectMap } from '@pushrocks/lik/dist_ts/lik.objectmap.js';
|
import { ObjectMap } from '@push.rocks/lik/dist_ts/lik.objectmap.js';
|
||||||
|
import { Stringmap } from '@push.rocks/lik/dist_ts/lik.stringmap.js';
|
||||||
|
import { FastMap } from '@push.rocks/lik/dist_ts/lik.fastmap.js';
|
||||||
const lik = {
|
const lik = {
|
||||||
ObjectMap,
|
ObjectMap,
|
||||||
|
Stringmap,
|
||||||
|
FastMap,
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
lik,
|
lik,
|
||||||
smartdelay,
|
smartdelay,
|
||||||
|
smartjson,
|
||||||
smartpromise,
|
smartpromise,
|
||||||
smartrouter,
|
smartrouter,
|
||||||
smartrx,
|
smartrx,
|
||||||
|
smarturl,
|
||||||
smartstate,
|
smartstate,
|
||||||
webrequest,
|
webrequest,
|
||||||
websetup,
|
websetup,
|
||||||
|
13
ts/index.ts
13
ts/index.ts
@ -5,10 +5,10 @@ import * as breakpoints from './domtools.css.breakpoints.js';
|
|||||||
import * as css from './domtools.css.js';
|
import * as css from './domtools.css.js';
|
||||||
|
|
||||||
export { css, breakpoints, elementBasic };
|
export { css, breakpoints, elementBasic };
|
||||||
export { DomTools } from './domtools.classes.domtools.js';
|
export { DomTools, type IDomToolsContructorOptions } from './domtools.classes.domtools.js';
|
||||||
export { TypedRequest } from '@apiglobal/typedrequest';
|
export { TypedRequest } from '@api.global/typedrequest';
|
||||||
export { IWebSetupConstructorOptions } from '@pushrocks/websetup';
|
export { type IWebSetupConstructorOptions } from '@push.rocks/websetup';
|
||||||
export { rxjs } from '@pushrocks/smartrx';
|
export { rxjs } from '@push.rocks/smartrx';
|
||||||
|
|
||||||
import * as allPlugins from './domtools.plugins.js';
|
import * as allPlugins from './domtools.plugins.js';
|
||||||
|
|
||||||
@ -16,5 +16,8 @@ export const plugins = {
|
|||||||
smartdelay: allPlugins.smartdelay,
|
smartdelay: allPlugins.smartdelay,
|
||||||
smartpromise: allPlugins.smartpromise,
|
smartpromise: allPlugins.smartpromise,
|
||||||
SweetScroll: allPlugins.SweetScroll,
|
SweetScroll: allPlugins.SweetScroll,
|
||||||
smartstate: allPlugins.smartstate
|
smartstate: allPlugins.smartstate,
|
||||||
|
smartrx: allPlugins.smartrx,
|
||||||
|
smarturl: allPlugins.smarturl,
|
||||||
|
typedrequest: allPlugins.typedrequest,
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"experimentalDecorators": true,
|
||||||
"module": "Node12"
|
"useDefineForClassFields": false,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
}
|
}
|
||||||
}
|
}
|
17
tslint.json
17
tslint.json
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
|
||||||
"rules": {
|
|
||||||
"semicolon": [true, "always"],
|
|
||||||
"no-console": false,
|
|
||||||
"ordered-imports": false,
|
|
||||||
"object-literal-sort-keys": false,
|
|
||||||
"member-ordering": {
|
|
||||||
"options":{
|
|
||||||
"order": [
|
|
||||||
"static-method"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultSeverity": "warning"
|
|
||||||
}
|
|
Reference in New Issue
Block a user