Compare commits
124 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 | |||
52fb046fa8 | |||
b83d3e1aed | |||
4ec8707596 | |||
69e1b52e72 | |||
a5ff175913 | |||
f84e7c48ae | |||
185d9ff957 | |||
6145bd66dc | |||
d58272a604 | |||
68ca1e8906 | |||
7023888f38 | |||
1356666700 | |||
b436fe77b0 | |||
3de788bb75 | |||
d50e320f17 | |||
a7532c8816 | |||
2d5944cdd7 | |||
5a8527068a | |||
ffd0bb925a | |||
4a5fb3ef4b | |||
a059c268af | |||
714aa77839 | |||
2527e6e586 | |||
88f7f20b6f | |||
8e23b7ebec | |||
b3d12c39bf | |||
d102d5a7e6 | |||
8be31958b4 | |||
e21f6c3920 | |||
356a756962 | |||
0bb66e8221 | |||
b70077c43f | |||
9c5f024e5f | |||
5eea208924 | |||
f21fdb2eb8 | |||
d6ea74cb71 | |||
10375576a7 | |||
367be854ff | |||
0933c1d83b | |||
af1eb73028 | |||
4bff0091c9 | |||
7bae4585f3 | |||
d9cdff2897 | |||
189060f11d | |||
fc2dfa8018 | |||
be44cb7a78 | |||
de6aba4289 | |||
3babbce2c5 | |||
707956b7ee | |||
c71a6170d5 | |||
3f98f2867c | |||
7c86f5a8f6 | |||
472ec3158e | |||
9a0d09d9de | |||
5975ca7320 | |||
97583c650d | |||
f5fd0662d3 | |||
14c91ed81f | |||
1aabacdf87 | |||
1747afe04a | |||
a1bd7f74a7 | |||
6ff89390b7 | |||
2ad8d0a9fd | |||
ae01670361 | |||
5657b0be1d | |||
781ae3c3b1 | |||
da79e623cc | |||
3ca6b5e34e | |||
98f0bc013d | |||
d32a544de2 | |||
070221d6c9 | |||
19714854ba | |||
50ebea1b5f | |||
df0527f3c1 | |||
b620b7393e | |||
ab5b9511fd | |||
da86e64056 | |||
effc331a67 | |||
fa24708a47 | |||
31126e30eb | |||
ef0a4eae80 | |||
e711302c28 | |||
1cfc07fe8e | |||
7f221c1a8c | |||
09f927c0d4 | |||
1042e79625 | |||
fced2efcbd | |||
83fe1d62e7 | |||
78bce9600c | |||
2860b5b6e0 | |||
b802935d27 | |||
b73a702b74 | |||
b3deb31ab5 | |||
6ea5482e3d | |||
0ead7215ff | |||
286bb0887a | |||
4456f00816 | |||
b60a1bebe0 |
@ -36,6 +36,7 @@ auditProductionDependencies:
|
|||||||
- npmci command npm audit --audit-level=high --only=prod --production
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
auditDevDependencies:
|
auditDevDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
1
license
1
license
@ -1,4 +1,5 @@
|
|||||||
Copyright (c) 2020 Lossless GmbH (hello@lossless.com)
|
Copyright (c) 2020 Lossless GmbH (hello@lossless.com)
|
||||||
|
Copyright (c) 2017 Nathan Friend (ts-keycode-enum)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
11394
package-lock.json
generated
11394
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
42
package.json
42
package.json
@ -1,38 +1,40 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.79",
|
"version": "2.0.26",
|
||||||
"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",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --web)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild --web && tsbundle npm)",
|
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)",
|
||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.63",
|
||||||
"@gitzone/tsbundle": "^1.0.78",
|
"@gitzone/tsbundle": "^2.0.6",
|
||||||
"@gitzone/tstest": "^1.0.52",
|
"@gitzone/tstest": "^1.0.72",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^5.0.4",
|
||||||
"@types/node": "^14.14.10",
|
"@types/node": "^18.6.3"
|
||||||
"tslint": "^6.1.3",
|
|
||||||
"tslint-config-prettier": "^1.15.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apiglobal/typedrequest": "^1.0.54",
|
"@apiglobal/typedrequest": "^2.0.8",
|
||||||
"@designestate/dees-comms": "^1.0.7",
|
"@designestate/dees-comms": "^1.0.22",
|
||||||
"@pushrocks/lik": "^4.0.20",
|
"@pushrocks/lik": "^6.0.0",
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartpromise": "^3.1.3",
|
"@pushrocks/smartjson": "^5.0.5",
|
||||||
"@pushrocks/smartrouter": "^1.0.6",
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"@pushrocks/smartstate": "^1.0.21",
|
"@pushrocks/smartrouter": "^1.0.12",
|
||||||
"@pushrocks/webrequest": "^2.0.13",
|
"@pushrocks/smartrx": "^3.0.0",
|
||||||
"@pushrocks/websetup": "^3.0.11",
|
"@pushrocks/smartstate": "^2.0.0",
|
||||||
"@pushrocks/webstore": "^1.0.16",
|
"@pushrocks/smarturl": "^3.0.5",
|
||||||
"lit-element": "^2.4.0",
|
"@pushrocks/webrequest": "^3.0.9",
|
||||||
|
"@pushrocks/websetup": "^3.0.16",
|
||||||
|
"@pushrocks/webstore": "^2.0.5",
|
||||||
|
"lit": "^2.2.8",
|
||||||
"sweet-scroll": "^4.0.0"
|
"sweet-scroll": "^4.0.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
4393
pnpm-lock.yaml
generated
Normal file
4393
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@ import * as domtools from '../ts/index';
|
|||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
||||||
expect(domtoolsInstance).to.be.instanceof(domtools.DomTools);
|
expect(domtoolsInstance).toBeInstanceOf(domtools.DomTools);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
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: '@designestate/dees-domtools',
|
||||||
|
version: '2.0.26',
|
||||||
|
description: 'tools to simplify complex css structures'
|
||||||
|
}
|
@ -1,71 +0,0 @@
|
|||||||
import { DomTools } from './domtools.classes.domtools';
|
|
||||||
|
|
||||||
export const desktop = 1240;
|
|
||||||
export const tablet = 1024;
|
|
||||||
export const phablet = 600;
|
|
||||||
export const phone = 400;
|
|
||||||
|
|
||||||
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
|
||||||
|
|
||||||
export const getEnvironment = (): TViewport => {
|
|
||||||
if (
|
|
||||||
globalThis.deesDomTools &&
|
|
||||||
globalThis.deesDomTools.domToolsStatePart.getState().virtualViewport
|
|
||||||
) {
|
|
||||||
return globalThis.deesDomTools.domToolsStatePart.getState().virtualViewport;
|
|
||||||
} else {
|
|
||||||
return 'native';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const cssForTablet = (contentArg) => {
|
|
||||||
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
|
||||||
return `
|
|
||||||
@media (max-width: ${tablet}px) {
|
|
||||||
${contentArg}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
} else if (
|
|
||||||
getEnvironment() === 'tablet' ||
|
|
||||||
getEnvironment() === 'phablet' ||
|
|
||||||
getEnvironment() === 'phone'
|
|
||||||
) {
|
|
||||||
return `
|
|
||||||
@media (min-width: 0px) {
|
|
||||||
${contentArg}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const cssForPhablet = (contentArg) => {
|
|
||||||
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
|
||||||
return `
|
|
||||||
@media (max-width: ${phablet}px) {
|
|
||||||
${contentArg}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
} else if (getEnvironment() === 'phablet' || getEnvironment() === 'phone') {
|
|
||||||
return `
|
|
||||||
@media (min-width: 0px) {
|
|
||||||
${contentArg}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const cssForPhone = (contentArg) => {
|
|
||||||
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
|
||||||
return `
|
|
||||||
@media (max-width: ${phone}px) {
|
|
||||||
${contentArg}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
} else if (getEnvironment() === 'phone') {
|
|
||||||
return `
|
|
||||||
@media (min-width: 0px) {
|
|
||||||
${contentArg}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,16 +1,17 @@
|
|||||||
import * as plugins from './domtools.plugins';
|
import * as plugins from './domtools.plugins.js';
|
||||||
import { Stringmap } from '@pushrocks/lik/dist_ts/lik.stringmap';
|
import { TViewport } from './domtools.css.breakpoints.js';
|
||||||
import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap';
|
import { Scroller } from './domtools.classes.scroller.js';
|
||||||
import { TViewport } from './domtools.breakpoints';
|
|
||||||
|
|
||||||
import { Scroller } from './domtools.classes.scroller';
|
|
||||||
import { delayForRandom } from '@pushrocks/smartdelay';
|
|
||||||
import { WebSetup } from '@pushrocks/websetup';
|
import { WebSetup } from '@pushrocks/websetup';
|
||||||
import { ElementInstrumenter } from './domtools.classes.elementinstrumenter';
|
import { ThemeManager } from './domtools.classes.thememanager.js';
|
||||||
import { ThemeManager } from './domtools.classes.thememanager';
|
import { Keyboard } from './domtools.classes.keyboard.js';
|
||||||
|
|
||||||
export interface IDomToolsState {
|
export interface IDomToolsState {
|
||||||
virtualViewport: TViewport;
|
virtualViewport: TViewport;
|
||||||
|
jwt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDomToolsContructorOptions {
|
||||||
|
ignoreGlobal?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DomTools {
|
export class DomTools {
|
||||||
@ -20,10 +21,10 @@ export class DomTools {
|
|||||||
/**
|
/**
|
||||||
* setups domtools
|
* setups domtools
|
||||||
*/
|
*/
|
||||||
public static async setupDomTools() {
|
public static async setupDomTools(optionsArg: IDomToolsContructorOptions = {}) {
|
||||||
let domToolsInstance: DomTools;
|
let domToolsInstance: DomTools;
|
||||||
if (!globalThis.deesDomTools) {
|
if (!globalThis.deesDomTools && !optionsArg.ignoreGlobal) {
|
||||||
globalThis.deesDomTools = new DomTools();
|
globalThis.deesDomTools = new DomTools(optionsArg);
|
||||||
domToolsInstance = globalThis.deesDomTools;
|
domToolsInstance = globalThis.deesDomTools;
|
||||||
|
|
||||||
// lets make sure the dom is ready
|
// lets make sure the dom is ready
|
||||||
@ -36,6 +37,8 @@ export class DomTools {
|
|||||||
};
|
};
|
||||||
document.addEventListener('readystatechange', readyStateChangedFunc);
|
document.addEventListener('readystatechange', readyStateChangedFunc);
|
||||||
domToolsInstance.domToolsReady.resolve();
|
domToolsInstance.domToolsReady.resolve();
|
||||||
|
} else if (optionsArg.ignoreGlobal) {
|
||||||
|
domToolsInstance = new DomTools(optionsArg);
|
||||||
} else {
|
} else {
|
||||||
domToolsInstance = globalThis.deesDomTools;
|
domToolsInstance = globalThis.deesDomTools;
|
||||||
}
|
}
|
||||||
@ -75,6 +78,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,
|
||||||
});
|
});
|
||||||
|
|
||||||
public router = new plugins.smartrouter.SmartRouter({
|
public router = new plugins.smartrouter.SmartRouter({
|
||||||
@ -82,33 +86,28 @@ export class DomTools {
|
|||||||
});
|
});
|
||||||
|
|
||||||
public convenience = {
|
public convenience = {
|
||||||
|
typedrequest: plugins.typedrequest,
|
||||||
smartdelay: plugins.smartdelay,
|
smartdelay: plugins.smartdelay,
|
||||||
|
smartjson: plugins.smartjson,
|
||||||
|
smarturl: plugins.smarturl,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
public elementInstrumenter = new ElementInstrumenter();
|
|
||||||
public deesComms = new plugins.deesComms.DeesComms();
|
public deesComms = new plugins.deesComms.DeesComms();
|
||||||
public scroller = new plugins.SweetScroll({
|
public scroller = new plugins.SweetScroll({
|
||||||
/* some options */
|
/* some options */
|
||||||
}); // TODO: switch to scroller class
|
}); // TODO: switch to scroller class
|
||||||
public themeManager = new ThemeManager(this);
|
public themeManager = new ThemeManager(this);
|
||||||
|
public keyboard = new Keyboard(document.body);
|
||||||
private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
|
|
||||||
async (statePart, payload) => {
|
|
||||||
const currentState = statePart.getState();
|
|
||||||
currentState.virtualViewport = payload;
|
|
||||||
return currentState;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
public domToolsReady = plugins.smartpromise.defer();
|
public domToolsReady = plugins.smartpromise.defer();
|
||||||
public domReady = plugins.smartpromise.defer();
|
public domReady = plugins.smartpromise.defer();
|
||||||
public globalStylesReady = plugins.smartpromise.defer();
|
public globalStylesReady = plugins.smartpromise.defer();
|
||||||
|
|
||||||
constructor() {}
|
constructor(optionsArg: IDomToolsContructorOptions) {}
|
||||||
|
|
||||||
|
private runOnceTrackerStringMap = new plugins.lik.Stringmap();
|
||||||
|
private runOnceResultMap = new plugins.lik.FastMap();
|
||||||
|
|
||||||
private runOnceTrackerStringMap = new Stringmap();
|
|
||||||
private runOnceResultMap = new 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
|
||||||
* @param identifierArg the indentifier arg identifies functions. functions with the same identifier are considered equal
|
* @param identifierArg the indentifier arg identifies functions. functions with the same identifier are considered equal
|
||||||
@ -134,7 +133,10 @@ export class DomTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// setStuff
|
// setStuff
|
||||||
|
/**
|
||||||
|
* allows to set global styles
|
||||||
|
* @param stylesText the css text you want to set
|
||||||
|
*/
|
||||||
public async setGlobalStyles(stylesText: string) {
|
public async setGlobalStyles(stylesText: string) {
|
||||||
await this.domReady.promise;
|
await this.domReady.promise;
|
||||||
const styleElement = document.createElement('style');
|
const styleElement = document.createElement('style');
|
||||||
@ -143,6 +145,27 @@ 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
|
||||||
|
* @param cssLinkArg a url to an external stylesheet
|
||||||
|
*/
|
||||||
public async setExternalCss(cssLinkArg: string) {
|
public async setExternalCss(cssLinkArg: string) {
|
||||||
const cssTag = document.createElement('link');
|
const cssTag = document.createElement('link');
|
||||||
cssTag.rel = 'stylesheet';
|
cssTag.rel = 'stylesheet';
|
||||||
@ -151,10 +174,10 @@ export class DomTools {
|
|||||||
document.head.append(cssTag);
|
document.head.append(cssTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public setVirtualViewport(environmentArg: TViewport) {
|
/**
|
||||||
this.domToolsStatePart.dispatchAction(this.actionSetVirtualViewport, environmentArg);
|
* allows setting of website infos
|
||||||
}
|
* @param optionsArg the website info
|
||||||
|
*/
|
||||||
public async setWebsiteInfo(optionsArg: plugins.websetup.IWebSetupConstructorOptions) {
|
public async setWebsiteInfo(optionsArg: plugins.websetup.IWebSetupConstructorOptions) {
|
||||||
await this.websetup.setup(optionsArg);
|
await this.websetup.setup(optionsArg);
|
||||||
await this.websetup.readyPromise;
|
await this.websetup.readyPromise;
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
import * as plugins from './domtools.plugins';
|
|
||||||
import { LitElement } from 'lit-element';
|
|
||||||
|
|
||||||
export class ElementInstrumenter {
|
|
||||||
connectedElements = new plugins.lik.ObjectMap<LitElement>();
|
|
||||||
|
|
||||||
public instrumentElement(elementArg: LitElement) {
|
|
||||||
const addToConnectedElementsFunc = (eventArg: CustomEvent) => {
|
|
||||||
this.connectedElements.add(elementArg);
|
|
||||||
};
|
|
||||||
const removeFromConnectedElementsFunc = eventArg => {
|
|
||||||
this.connectedElements.remove(elementArg);
|
|
||||||
elementArg.removeEventListener('domtools-connected', addToConnectedElementsFunc);
|
|
||||||
elementArg.removeEventListener('domtools-disconnected', removeFromConnectedElementsFunc);
|
|
||||||
};
|
|
||||||
elementArg.addEventListener('domtools-connected', addToConnectedElementsFunc);
|
|
||||||
elementArg.addEventListener('domtools-disconnected', removeFromConnectedElementsFunc);
|
|
||||||
|
|
||||||
if (elementArg.parentElement) {
|
|
||||||
this.connectedElements.add(elementArg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async forEachelement(eachFuncArg: (elementArg: LitElement) => Promise<void>) {
|
|
||||||
for (const elementArg of this.connectedElements.getArray()) {
|
|
||||||
await eachFuncArg(elementArg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
213
ts/domtools.classes.keyboard.ts
Normal file
213
ts/domtools.classes.keyboard.ts
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
import * as plugins from './domtools.plugins.js';
|
||||||
|
|
||||||
|
export enum Key {
|
||||||
|
Backspace = 8,
|
||||||
|
Tab = 9,
|
||||||
|
Enter = 13,
|
||||||
|
Shift = 16,
|
||||||
|
Ctrl = 17,
|
||||||
|
Alt = 18,
|
||||||
|
PauseBreak = 19,
|
||||||
|
CapsLock = 20,
|
||||||
|
Escape = 27,
|
||||||
|
Space = 32,
|
||||||
|
PageUp = 33,
|
||||||
|
PageDown = 34,
|
||||||
|
End = 35,
|
||||||
|
Home = 36,
|
||||||
|
|
||||||
|
LeftArrow = 37,
|
||||||
|
UpArrow = 38,
|
||||||
|
RightArrow = 39,
|
||||||
|
DownArrow = 40,
|
||||||
|
|
||||||
|
Insert = 45,
|
||||||
|
Delete = 46,
|
||||||
|
|
||||||
|
Zero = 48,
|
||||||
|
ClosedParen = Zero,
|
||||||
|
One = 49,
|
||||||
|
ExclamationMark = One,
|
||||||
|
Two = 50,
|
||||||
|
AtSign = Two,
|
||||||
|
Three = 51,
|
||||||
|
PoundSign = Three,
|
||||||
|
Hash = PoundSign,
|
||||||
|
Four = 52,
|
||||||
|
DollarSign = Four,
|
||||||
|
Five = 53,
|
||||||
|
PercentSign = Five,
|
||||||
|
Six = 54,
|
||||||
|
Caret = Six,
|
||||||
|
Hat = Caret,
|
||||||
|
Seven = 55,
|
||||||
|
Ampersand = Seven,
|
||||||
|
Eight = 56,
|
||||||
|
Star = Eight,
|
||||||
|
Asterik = Star,
|
||||||
|
Nine = 57,
|
||||||
|
OpenParen = Nine,
|
||||||
|
|
||||||
|
A = 65,
|
||||||
|
B = 66,
|
||||||
|
C = 67,
|
||||||
|
D = 68,
|
||||||
|
E = 69,
|
||||||
|
F = 70,
|
||||||
|
G = 71,
|
||||||
|
H = 72,
|
||||||
|
I = 73,
|
||||||
|
J = 74,
|
||||||
|
K = 75,
|
||||||
|
L = 76,
|
||||||
|
M = 77,
|
||||||
|
N = 78,
|
||||||
|
O = 79,
|
||||||
|
P = 80,
|
||||||
|
Q = 81,
|
||||||
|
R = 82,
|
||||||
|
S = 83,
|
||||||
|
T = 84,
|
||||||
|
U = 85,
|
||||||
|
V = 86,
|
||||||
|
W = 87,
|
||||||
|
X = 88,
|
||||||
|
Y = 89,
|
||||||
|
Z = 90,
|
||||||
|
|
||||||
|
LeftWindowKey = 91,
|
||||||
|
RightWindowKey = 92,
|
||||||
|
SelectKey = 93,
|
||||||
|
|
||||||
|
Numpad0 = 96,
|
||||||
|
Numpad1 = 97,
|
||||||
|
Numpad2 = 98,
|
||||||
|
Numpad3 = 99,
|
||||||
|
Numpad4 = 100,
|
||||||
|
Numpad5 = 101,
|
||||||
|
Numpad6 = 102,
|
||||||
|
Numpad7 = 103,
|
||||||
|
Numpad8 = 104,
|
||||||
|
Numpad9 = 105,
|
||||||
|
|
||||||
|
Multiply = 106,
|
||||||
|
Add = 107,
|
||||||
|
Subtract = 109,
|
||||||
|
DecimalPoint = 110,
|
||||||
|
Divide = 111,
|
||||||
|
|
||||||
|
F1 = 112,
|
||||||
|
F2 = 113,
|
||||||
|
F3 = 114,
|
||||||
|
F4 = 115,
|
||||||
|
F5 = 116,
|
||||||
|
F6 = 117,
|
||||||
|
F7 = 118,
|
||||||
|
F8 = 119,
|
||||||
|
F9 = 120,
|
||||||
|
F10 = 121,
|
||||||
|
F11 = 122,
|
||||||
|
F12 = 123,
|
||||||
|
|
||||||
|
NumLock = 144,
|
||||||
|
ScrollLock = 145,
|
||||||
|
|
||||||
|
SemiColon = 186,
|
||||||
|
Equals = 187,
|
||||||
|
Comma = 188,
|
||||||
|
Dash = 189,
|
||||||
|
Period = 190,
|
||||||
|
UnderScore = Dash,
|
||||||
|
PlusSign = Equals,
|
||||||
|
ForwardSlash = 191,
|
||||||
|
Tilde = 192,
|
||||||
|
GraveAccent = Tilde,
|
||||||
|
|
||||||
|
OpenBracket = 219,
|
||||||
|
ClosedBracket = 221,
|
||||||
|
Quote = 222,
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Keyboard {
|
||||||
|
private mapCombosToHandlers = new Map<number[], plugins.smartrx.rxjs.Subject<KeyboardEvent>>();
|
||||||
|
private pressedKeys = new Set<Key>();
|
||||||
|
|
||||||
|
constructor(private domNode: Element | Document) {
|
||||||
|
this.startListening();
|
||||||
|
}
|
||||||
|
|
||||||
|
public keyEnum = Key;
|
||||||
|
|
||||||
|
public on(keys: Key[]) {
|
||||||
|
const subject = new plugins.smartrx.rxjs.Subject<KeyboardEvent>();
|
||||||
|
this.registerKeys(keys, 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() {
|
||||||
|
this.domNode.addEventListener('keydown', this.handleKeyDown);
|
||||||
|
this.domNode.addEventListener('keyup', this.handleKeyUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public stopListening() {
|
||||||
|
this.domNode.removeEventListener('keydown', this.handleKeyDown);
|
||||||
|
this.domNode.removeEventListener('keyup', this.handleKeyUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public clear() {
|
||||||
|
this.stopListening();
|
||||||
|
this.mapCombosToHandlers.clear();
|
||||||
|
this.pressedKeys.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleKeyDown = (event: KeyboardEvent) => {
|
||||||
|
this.pressedKeys.add(event.keyCode);
|
||||||
|
this.checkMatchingKeyboardSubjects(event);
|
||||||
|
};
|
||||||
|
|
||||||
|
private checkMatchingKeyboardSubjects(payloadArg?) {
|
||||||
|
this.mapCombosToHandlers.forEach((subjectArg, keysArg) => {
|
||||||
|
if (this.areAllKeysPressed(keysArg)) {
|
||||||
|
subjectArg.next(payloadArg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleKeyUp = (event: KeyboardEvent) => {
|
||||||
|
this.pressedKeys.delete(event.keyCode);
|
||||||
|
};
|
||||||
|
|
||||||
|
private areAllKeysPressed(keysArg: Key[]) {
|
||||||
|
let result = true;
|
||||||
|
|
||||||
|
keysArg.forEach((key) => {
|
||||||
|
if (!this.pressedKeys.has(key)) {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private registerKeys(
|
||||||
|
keysArg: Array<Key>,
|
||||||
|
subjectArg: plugins.smartrx.rxjs.Subject<KeyboardEvent>
|
||||||
|
) {
|
||||||
|
if (!this.mapCombosToHandlers.has(keysArg)) {
|
||||||
|
this.mapCombosToHandlers.set(keysArg, subjectArg);
|
||||||
|
} else {
|
||||||
|
const subject = this.mapCombosToHandlers.get(keysArg);
|
||||||
|
return subject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
import * as plugins from './domtools.plugins';
|
import * as plugins from './domtools.plugins.js';
|
||||||
|
|
||||||
export class Scroller {
|
export class Scroller {
|
||||||
// TODO: move sweet scroll over to here;
|
// TODO: move sweet scroll over to here;
|
||||||
|
@ -1,55 +1,54 @@
|
|||||||
import { LitElement } from 'lit-element';
|
import { DomTools } from './domtools.classes.domtools.js';
|
||||||
import { DomTools } from './domtools.classes.domtools';
|
import * as plugins from './domtools.plugins.js';
|
||||||
import * as plugins from './domtools.plugins';
|
|
||||||
|
|
||||||
export class ThemeManager {
|
export class ThemeManager {
|
||||||
public domtoolsRef: DomTools;
|
public domtoolsRef: DomTools;
|
||||||
|
|
||||||
public goBrightBoolean = false;
|
public goBrightBoolean = false;
|
||||||
public preferredColorSchemeMediaMatch = window.matchMedia('(prefers-color-scheme: light)');
|
public preferredColorSchemeMediaMatch = window.matchMedia('(prefers-color-scheme: light)');
|
||||||
|
|
||||||
|
public themeObservable = new plugins.smartrx.rxjs.ReplaySubject<boolean>(1);
|
||||||
|
|
||||||
constructor(domtoolsRefArg: DomTools) {
|
constructor(domtoolsRefArg: DomTools) {
|
||||||
this.domtoolsRef = domtoolsRefArg;
|
this.domtoolsRef = domtoolsRefArg;
|
||||||
|
|
||||||
// lets take care of elements being added that need to know of the current theme
|
|
||||||
this.domtoolsRef.elementInstrumenter.connectedElements.eventSubject.subscribe(async eventData => {
|
|
||||||
await this.setThemeStatusForElement(eventData.payload, this.goBrightBoolean);
|
|
||||||
});
|
|
||||||
|
|
||||||
// lets care
|
// lets care
|
||||||
this.goBrightBoolean = this.preferredColorSchemeMediaMatch.matches;
|
this.goBrightBoolean = this.preferredColorSchemeMediaMatch.matches;
|
||||||
this.preferredColorSchemeMediaMatch.addEventListener('change', eventArg => {
|
this.preferredColorSchemeMediaMatch.addEventListener('change', (eventArg) => {
|
||||||
this.goBrightBoolean = eventArg.matches;
|
this.goBrightBoolean = eventArg.matches;
|
||||||
this.updateAllConnectedElements();
|
this.updateAllConnectedElements();
|
||||||
});
|
});
|
||||||
}
|
this.updateAllConnectedElements();
|
||||||
|
|
||||||
private async setThemeStatusForElement (elementArg: LitElement, goBrightBool: boolean) {
|
|
||||||
const goBright = (elementArg as any).goBright;
|
|
||||||
if (typeof goBright === 'boolean') {
|
|
||||||
(elementArg as any).goBright = goBrightBool;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async updateAllConnectedElements() {
|
private async updateAllConnectedElements() {
|
||||||
document.body.style.background = this.goBrightBoolean ? '#fff' : '#000';
|
if (document.body && document.body.style) {
|
||||||
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
document.body.style.background = this.goBrightBoolean ? '#fff' : '#000';
|
||||||
await this.setThemeStatusForElement(elementArg, this.goBrightBoolean);
|
}
|
||||||
});
|
this.themeObservable.next(this.goBrightBoolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set the theme of the website to bright
|
||||||
|
*/
|
||||||
public goBright() {
|
public goBright() {
|
||||||
this.goBrightBoolean = true;
|
this.goBrightBoolean = true;
|
||||||
this.updateAllConnectedElements();
|
this.updateAllConnectedElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set the theme of the website to dark
|
||||||
|
*/
|
||||||
public goDark() {
|
public goDark() {
|
||||||
this.goBrightBoolean = false;
|
this.goBrightBoolean = false;
|
||||||
this.updateAllConnectedElements();
|
this.updateAllConnectedElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* simply toggle between bright and dark
|
||||||
|
*/
|
||||||
public toggleDarkBright() {
|
public toggleDarkBright() {
|
||||||
this.goBrightBoolean = !this.goBrightBoolean;
|
this.goBrightBoolean = !this.goBrightBoolean;
|
||||||
this.updateAllConnectedElements();
|
this.updateAllConnectedElements();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
41
ts/domtools.css.basestyles.ts
Normal file
41
ts/domtools.css.basestyles.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import { DomTools } from './domtools.classes.domtools.js';
|
||||||
|
|
||||||
|
import { css, unsafeCSS } from 'lit';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* changes scrollbar styles to be consistent across OS borders
|
||||||
|
*/
|
||||||
|
export const scrollBarStyles: string = (() => {
|
||||||
|
const returnStylesOld = navigator.userAgent.indexOf('Mac OS X') === -1 ? css``.cssText : ``;
|
||||||
|
const returnStyles = css`
|
||||||
|
/* width */
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 0px;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
scrollbar-width: none;
|
||||||
|
}
|
||||||
|
`.cssText;
|
||||||
|
return returnStyles;
|
||||||
|
})();
|
||||||
|
|
||||||
|
export const globalBaseStyles: string = css`
|
||||||
|
/* global material font */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Material Icons';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2)
|
||||||
|
format('woff2');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* global body styles */
|
||||||
|
body {
|
||||||
|
margin: 0px;
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* scroll bar styles */
|
||||||
|
${unsafeCSS(scrollBarStyles)}
|
||||||
|
`.cssText;
|
66
ts/domtools.css.breakpoints.ts
Normal file
66
ts/domtools.css.breakpoints.ts
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
import { DomTools } from './domtools.classes.domtools.js';
|
||||||
|
|
||||||
|
import { CSSResult, unsafeCSS } from 'lit';
|
||||||
|
|
||||||
|
export const desktop = 1600;
|
||||||
|
export const notebook = 1240;
|
||||||
|
export const tablet = 1024;
|
||||||
|
export const phablet = 600;
|
||||||
|
export const phone = 400;
|
||||||
|
|
||||||
|
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
||||||
|
|
||||||
|
export const cssForDesktop = (cssArg: CSSResult) => {
|
||||||
|
return unsafeCSS(`
|
||||||
|
@container wccToolsViewport (min-width: ${desktop}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
@media (min-width: ${desktop}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const cssForNotebook = (cssArg: CSSResult) => {
|
||||||
|
return unsafeCSS(`
|
||||||
|
@container wccToolsViewport (max-width: ${notebook}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
@media (max-width: ${notebook}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const cssForTablet = (cssArg: CSSResult) => {
|
||||||
|
return unsafeCSS(`
|
||||||
|
@container wccToolsViewport (max-width: ${tablet}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
@media (max-width: ${tablet}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const cssForPhablet = (cssArg: CSSResult) => {
|
||||||
|
return unsafeCSS(`
|
||||||
|
@container wccToolsViewport (max-width: ${phablet}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
@media (max-width: ${phablet}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const cssForPhone = (cssArg: CSSResult) => {
|
||||||
|
return unsafeCSS(`
|
||||||
|
@container wccToolsViewport (max-width: ${phone}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
@media (max-width: ${phone}px) {
|
||||||
|
${cssArg.cssText}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
};
|
@ -1,28 +0,0 @@
|
|||||||
import { DomTools } from './domtools.classes.domtools';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* changes scrollbar styles to be consistent across OS borders
|
|
||||||
*/
|
|
||||||
export const scrollBarStyles = (() => {
|
|
||||||
const returnStyles = navigator.userAgent.indexOf("Windows") !== -1 ? `
|
|
||||||
/* width */
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Track */
|
|
||||||
::-webkit-scrollbar-track {
|
|
||||||
background: #111;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Handle */
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Handle on hover */
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
background: #777;
|
|
||||||
}
|
|
||||||
` : ``;
|
|
||||||
})();
|
|
@ -1,8 +1,22 @@
|
|||||||
import * as plugins from './domtools.plugins';
|
import * as plugins from './domtools.plugins.js';
|
||||||
import { DomTools } from './domtools.classes.domtools';
|
import { DomTools, IDomToolsContructorOptions } from './domtools.classes.domtools.js';
|
||||||
import { scrollBarStyles } from './domtools.css.theme';
|
import { scrollBarStyles, globalBaseStyles } from './domtools.css.basestyles.js';
|
||||||
|
|
||||||
import { html, LitElement } from 'lit-element';
|
import { html, LitElement, css, unsafeCSS } from 'lit';
|
||||||
|
|
||||||
|
export const staticStyles = css`
|
||||||
|
* {
|
||||||
|
transition: background 0.1s, color 0.1s;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host {
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
${unsafeCSS(scrollBarStyles)}
|
||||||
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* styles to be included in every webcomponent
|
* styles to be included in every webcomponent
|
||||||
@ -11,10 +25,13 @@ export const styles = html`
|
|||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
transition: background 0.1s, color 0.1s;
|
transition: background 0.1s, color 0.1s;
|
||||||
font-family: 'Roboto', sans-serif;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host {
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
${scrollBarStyles}
|
${scrollBarStyles}
|
||||||
</style>
|
</style>
|
||||||
`;
|
`;
|
||||||
@ -23,43 +40,17 @@ 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): Promise<DomTools> => {
|
export const setup = async (elementArg?: LitElement, optionsArg: IDomToolsContructorOptions = {}): Promise<DomTools> => {
|
||||||
const domTools = await DomTools.setupDomTools();
|
const domTools = await DomTools.setupDomTools(optionsArg);
|
||||||
|
|
||||||
if (elementArg) {
|
if (elementArg) {
|
||||||
domTools.elementInstrumenter.instrumentElement(elementArg);
|
// lets do something with the element
|
||||||
|
// not used right now
|
||||||
}
|
}
|
||||||
|
|
||||||
domTools.runOnce('elementBasicSetup', async () => {
|
domTools.runOnce('elementBasicSetup', async () => {
|
||||||
// bodyStyles
|
// bodyStyles
|
||||||
domTools.setGlobalStyles(`
|
domTools.setGlobalStyles(globalBaseStyles);
|
||||||
body {
|
|
||||||
margin: 0px;
|
|
||||||
font-family: 'Roboto', sans-serif;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
// material font
|
|
||||||
domTools.setGlobalStyles(`
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Material Icons';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2');
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
// Roboto Font
|
|
||||||
domTools.setGlobalStyles(`
|
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400');
|
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@100;300;400');
|
|
||||||
`);
|
|
||||||
|
|
||||||
// scrollbars
|
|
||||||
domTools.setGlobalStyles(`
|
|
||||||
${scrollBarStyles}
|
|
||||||
`);
|
|
||||||
});
|
});
|
||||||
return domTools;
|
return domTools;
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
// designestate scope
|
// designestate scope
|
||||||
import * as deesComms from '@designestate/dees-comms';
|
import * as deesComms from '@designestate/dees-comms';
|
||||||
|
|
||||||
export {
|
export { deesComms };
|
||||||
deesComms
|
|
||||||
};
|
|
||||||
|
|
||||||
// apiglobal scope
|
// apiglobal scope
|
||||||
import * as typedrequest from '@apiglobal/typedrequest';
|
import * as typedrequest from '@apiglobal/typedrequest';
|
||||||
@ -12,20 +10,39 @@ export { typedrequest };
|
|||||||
|
|
||||||
// pushrocks scope
|
// pushrocks scope
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
|
import * as smartjson from '@pushrocks/smartjson';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
import * as smartrouter from '@pushrocks/smartrouter';
|
import * as smartrouter from '@pushrocks/smartrouter';
|
||||||
|
import * as smartrx from '@pushrocks/smartrx';
|
||||||
import * as smartstate from '@pushrocks/smartstate';
|
import * as smartstate from '@pushrocks/smartstate';
|
||||||
|
import * as smarturl from '@pushrocks/smarturl';
|
||||||
import * as webrequest from '@pushrocks/webrequest';
|
import * as webrequest from '@pushrocks/webrequest';
|
||||||
import * as websetup from '@pushrocks/websetup';
|
import * as websetup from '@pushrocks/websetup';
|
||||||
import * as webstore from '@pushrocks/webstore';
|
import * as webstore from '@pushrocks/webstore';
|
||||||
|
|
||||||
// subscope lik
|
// subscope lik
|
||||||
import { ObjectMap } from '@pushrocks/lik/dist_ts/lik.objectmap';
|
import { ObjectMap } from '@pushrocks/lik/dist_ts/lik.objectmap.js';
|
||||||
|
import { Stringmap } from '@pushrocks/lik/dist_ts/lik.stringmap.js';
|
||||||
|
import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap.js';
|
||||||
const lik = {
|
const lik = {
|
||||||
ObjectMap
|
ObjectMap,
|
||||||
|
Stringmap,
|
||||||
|
FastMap,
|
||||||
};
|
};
|
||||||
|
|
||||||
export { lik, smartdelay, smartpromise, smartrouter, smartstate, webrequest, websetup, webstore };
|
export {
|
||||||
|
lik,
|
||||||
|
smartdelay,
|
||||||
|
smartjson,
|
||||||
|
smartpromise,
|
||||||
|
smartrouter,
|
||||||
|
smartrx,
|
||||||
|
smarturl,
|
||||||
|
smartstate,
|
||||||
|
webrequest,
|
||||||
|
websetup,
|
||||||
|
webstore,
|
||||||
|
};
|
||||||
|
|
||||||
// third party scope
|
// third party scope
|
||||||
import SweetScroll from 'sweet-scroll';
|
import SweetScroll from 'sweet-scroll';
|
||||||
|
17
ts/index.ts
17
ts/index.ts
@ -1,15 +1,20 @@
|
|||||||
export * from './domtools.colors';
|
export * from './domtools.colors.js';
|
||||||
|
|
||||||
import * as elementBasic from './domtools.elementbasic';
|
import * as elementBasic from './domtools.elementbasic.js';
|
||||||
import * as breakpoints from './domtools.breakpoints';
|
import * as breakpoints from './domtools.css.breakpoints.js';
|
||||||
import * as css from './domtools.css';
|
import * as css from './domtools.css.js';
|
||||||
|
|
||||||
export { css, breakpoints, elementBasic };
|
export { css, breakpoints, elementBasic };
|
||||||
export { DomTools } from './domtools.classes.domtools';
|
export { DomTools, IDomToolsContructorOptions } from './domtools.classes.domtools.js';
|
||||||
export { TypedRequest } from '@apiglobal/typedrequest';
|
export { TypedRequest } from '@apiglobal/typedrequest';
|
||||||
|
export { IWebSetupConstructorOptions } from '@pushrocks/websetup';
|
||||||
|
export { rxjs } from '@pushrocks/smartrx';
|
||||||
|
|
||||||
import * as allPlugins from './domtools.plugins';
|
import * as allPlugins from './domtools.plugins.js';
|
||||||
|
|
||||||
export const plugins = {
|
export const plugins = {
|
||||||
|
smartdelay: allPlugins.smartdelay,
|
||||||
smartpromise: allPlugins.smartpromise,
|
smartpromise: allPlugins.smartpromise,
|
||||||
|
SweetScroll: allPlugins.SweetScroll,
|
||||||
|
smartstate: allPlugins.smartstate
|
||||||
};
|
};
|
||||||
|
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"moduleResolution": "nodenext",
|
||||||
|
"esModuleInterop": 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