Compare commits
104 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 | |||
94127227a6 | |||
b5af1b1226 | |||
a6f382dd7f | |||
0de00cb2c1 | |||
570a026cf8 | |||
48b5cc770c | |||
7ae2de5843 | |||
e4d87ae882 | |||
259a669e24 | |||
bf461dd1a0 | |||
63c9ae97d4 | |||
a83239e0d9 | |||
8da64f1b50 | |||
2d4c0e4e49 | |||
1c8f7fa59e | |||
a613c0aca2 | |||
127564cd71 | |||
e077bf5b25 | |||
64a3f57813 | |||
1315e8c3f6 | |||
d059862841 | |||
ad34affb9e | |||
011b3fb76a | |||
47099d02b5 | |||
f4029ed008 | |||
d5732822e4 | |||
c467a92e7c | |||
746c1148e3 | |||
d75e66ba78 | |||
7c805a075e | |||
5e1a44ad88 | |||
093eae2c97 |
@ -36,6 +36,7 @@ auditProductionDependencies:
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
23560
package-lock.json
generated
23560
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
38
package.json
38
package.json
@ -1,38 +1,40 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.63",
|
||||
"version": "2.0.0",
|
||||
"private": false,
|
||||
"description": "tools to simplify complex css structures",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web && tsbundle npm)",
|
||||
"build": "(tsbuild --web --allowimplicitany --skiplibcheck && tsbundle npm)",
|
||||
"format": "(gitzone format)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsbundle": "^1.0.78",
|
||||
"@gitzone/tstest": "^1.0.52",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.14.6",
|
||||
"@gitzone/tsbuild": "^2.1.56",
|
||||
"@gitzone/tsbundle": "^1.0.98",
|
||||
"@gitzone/tstest": "^1.0.68",
|
||||
"@pushrocks/tapbundle": "^5.0.2",
|
||||
"@types/node": "^17.0.21",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^1.0.54",
|
||||
"@designestate/dees-comms": "^1.0.7",
|
||||
"@pushrocks/lik": "^4.0.17",
|
||||
"@pushrocks/smartdelay": "^2.0.10",
|
||||
"@pushrocks/smartpromise": "^3.1.3",
|
||||
"@pushrocks/smartrouter": "^1.0.4",
|
||||
"@pushrocks/smartstate": "^1.0.17",
|
||||
"@pushrocks/webrequest": "^2.0.13",
|
||||
"@pushrocks/websetup": "^3.0.11",
|
||||
"@pushrocks/webstore": "^1.0.16",
|
||||
"lit-element": "^2.4.0",
|
||||
"@apiglobal/typedrequest": "^1.0.65",
|
||||
"@designestate/dees-comms": "^1.0.16",
|
||||
"@pushrocks/lik": "^5.0.4",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
"@pushrocks/smartrouter": "^1.0.12",
|
||||
"@pushrocks/smartrx": "^2.0.25",
|
||||
"@pushrocks/smartstate": "^1.0.23",
|
||||
"@pushrocks/webrequest": "^2.0.15",
|
||||
"@pushrocks/websetup": "^3.0.16",
|
||||
"@pushrocks/webstore": "^1.0.18",
|
||||
"lit": "^2.2.1",
|
||||
"sweet-scroll": "^4.0.0"
|
||||
},
|
||||
"files": [
|
||||
|
@ -3,7 +3,7 @@ import * as domtools from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
||||
expect(domtoolsInstance).to.be.instanceof(domtools.DomTools);
|
||||
expect(domtoolsInstance).toBeInstanceOf(domtools.DomTools);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
@ -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,14 +1,15 @@
|
||||
import * as plugins from './domtools.plugins';
|
||||
import { Stringmap } from '@pushrocks/lik/dist_ts/lik.stringmap';
|
||||
import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap';
|
||||
import { TViewport } from './domtools.breakpoints';
|
||||
import * as plugins from './domtools.plugins.js';
|
||||
import { Stringmap } from '@pushrocks/lik/dist_ts/lik.stringmap.js';
|
||||
import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap.js';
|
||||
import { TViewport } from './domtools.css.breakpoints.js';
|
||||
|
||||
import { Scroller } from './domtools.classes.scroller';
|
||||
import { delayForRandom } from '@pushrocks/smartdelay';
|
||||
import { Scroller } from './domtools.classes.scroller.js';
|
||||
import { WebSetup } from '@pushrocks/websetup';
|
||||
import { ThemeManager } from './domtools.classes.thememanager.js';
|
||||
|
||||
export interface IDomToolsState {
|
||||
virtualViewport: TViewport;
|
||||
jwt: string;
|
||||
}
|
||||
|
||||
export class DomTools {
|
||||
@ -66,13 +67,14 @@ export class DomTools {
|
||||
|
||||
public websetup: WebSetup = new WebSetup({
|
||||
metaObject: {
|
||||
title: 'loading...'
|
||||
}
|
||||
title: 'loading...',
|
||||
},
|
||||
});
|
||||
|
||||
public smartstate = new plugins.smartstate.Smartstate();
|
||||
public domToolsStatePart = this.smartstate.getStatePart<IDomToolsState>('domtools', {
|
||||
virtualViewport: 'native',
|
||||
jwt: null
|
||||
});
|
||||
|
||||
public router = new plugins.smartrouter.SmartRouter({
|
||||
@ -80,14 +82,17 @@ export class DomTools {
|
||||
});
|
||||
|
||||
public convenience = {
|
||||
typedrequest: plugins.typedrequest,
|
||||
smartdelay: plugins.smartdelay,
|
||||
};
|
||||
|
||||
public scroller: plugins.SweetScroll;
|
||||
|
||||
public deesComms = new plugins.deesComms.DeesComms();
|
||||
public scroller = new plugins.SweetScroll({
|
||||
/* some options */
|
||||
}); // TODO: switch to scroller class
|
||||
public themeManager = new ThemeManager(this);
|
||||
|
||||
private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
|
||||
/* private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
|
||||
async (statePart, payload) => {
|
||||
const currentState = statePart.getState();
|
||||
currentState.virtualViewport = payload;
|
||||
@ -95,21 +100,19 @@ export class DomTools {
|
||||
}
|
||||
);
|
||||
|
||||
public setVirtualViewport(environmentArg: TViewport) {
|
||||
this.domToolsStatePart.dispatchAction(this.actionSetVirtualViewport, environmentArg);
|
||||
} */
|
||||
|
||||
public domToolsReady = plugins.smartpromise.defer();
|
||||
public domReady = plugins.smartpromise.defer();
|
||||
public globalStylesReady = plugins.smartpromise.defer();
|
||||
|
||||
constructor() {
|
||||
// lets care about third party stuff
|
||||
this.domToolsReady.promise.then(() => {
|
||||
this.scroller = new plugins.SweetScroll({
|
||||
/* some options */
|
||||
});
|
||||
});
|
||||
}
|
||||
constructor() {}
|
||||
|
||||
private runOnceTrackerStringMap = new Stringmap();
|
||||
private runOnceResultMap = new FastMap();
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -135,7 +138,10 @@ export class DomTools {
|
||||
}
|
||||
|
||||
// setStuff
|
||||
|
||||
/**
|
||||
* allows to set global styles
|
||||
* @param stylesText the css text you want to set
|
||||
*/
|
||||
public async setGlobalStyles(stylesText: string) {
|
||||
await this.domReady.promise;
|
||||
const styleElement = document.createElement('style');
|
||||
@ -144,10 +150,22 @@ export class DomTools {
|
||||
this.elements.headElement.appendChild(styleElement);
|
||||
}
|
||||
|
||||
public setVirtualViewport(environmentArg: TViewport) {
|
||||
this.domToolsStatePart.dispatchAction(this.actionSetVirtualViewport, environmentArg);
|
||||
/**
|
||||
* allows setting external css files
|
||||
* @param cssLinkArg a url to an external stylesheet
|
||||
*/
|
||||
public async setExternalCss(cssLinkArg: string) {
|
||||
const cssTag = document.createElement('link');
|
||||
cssTag.rel = 'stylesheet';
|
||||
cssTag.crossOrigin = 'anonymous';
|
||||
cssTag.href = cssLinkArg;
|
||||
document.head.append(cssTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* allows setting of website infos
|
||||
* @param optionsArg the website info
|
||||
*/
|
||||
public async setWebsiteInfo(optionsArg: plugins.websetup.IWebSetupConstructorOptions) {
|
||||
await this.websetup.setup(optionsArg);
|
||||
await this.websetup.readyPromise;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './domtools.plugins';
|
||||
import * as plugins from './domtools.plugins.js';
|
||||
|
||||
export class Scroller {
|
||||
// TODO: move sweet scroll over to here;
|
||||
|
54
ts/domtools.classes.thememanager.ts
Normal file
54
ts/domtools.classes.thememanager.ts
Normal file
@ -0,0 +1,54 @@
|
||||
import { DomTools } from './domtools.classes.domtools.js';
|
||||
import * as plugins from './domtools.plugins.js';
|
||||
|
||||
export class ThemeManager {
|
||||
public domtoolsRef: DomTools;
|
||||
|
||||
public goBrightBoolean = false;
|
||||
public preferredColorSchemeMediaMatch = window.matchMedia('(prefers-color-scheme: light)');
|
||||
|
||||
public themeObservable = new plugins.smartrx.rxjs.ReplaySubject<boolean>(1);
|
||||
|
||||
constructor(domtoolsRefArg: DomTools) {
|
||||
this.domtoolsRef = domtoolsRefArg;
|
||||
|
||||
// lets care
|
||||
this.goBrightBoolean = this.preferredColorSchemeMediaMatch.matches;
|
||||
this.preferredColorSchemeMediaMatch.addEventListener('change', (eventArg) => {
|
||||
this.goBrightBoolean = eventArg.matches;
|
||||
this.updateAllConnectedElements();
|
||||
});
|
||||
this.updateAllConnectedElements();
|
||||
}
|
||||
|
||||
private async updateAllConnectedElements() {
|
||||
if (document.body && document.body.style) {
|
||||
document.body.style.background = this.goBrightBoolean ? '#fff' : '#000';
|
||||
}
|
||||
this.themeObservable.next(this.goBrightBoolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* set the theme of the website to bright
|
||||
*/
|
||||
public goBright() {
|
||||
this.goBrightBoolean = true;
|
||||
this.updateAllConnectedElements();
|
||||
}
|
||||
|
||||
/**
|
||||
* set the theme of the website to dark
|
||||
*/
|
||||
public goDark() {
|
||||
this.goBrightBoolean = false;
|
||||
this.updateAllConnectedElements();
|
||||
}
|
||||
|
||||
/**
|
||||
* simply toggle between bright and dark
|
||||
*/
|
||||
public toggleDarkBright() {
|
||||
this.goBrightBoolean = !this.goBrightBoolean;
|
||||
this.updateAllConnectedElements();
|
||||
}
|
||||
}
|
59
ts/domtools.css.basestyles.ts
Normal file
59
ts/domtools.css.basestyles.ts
Normal file
@ -0,0 +1,59 @@
|
||||
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 returnStyles =
|
||||
navigator.userAgent.indexOf('Mac OS X') === -1
|
||||
? css`
|
||||
/* width */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
/* Track */
|
||||
::-webkit-scrollbar-track {
|
||||
background: #111;
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #666;
|
||||
}
|
||||
|
||||
/* Handle on hover */
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #777;
|
||||
}
|
||||
`.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');
|
||||
}
|
||||
|
||||
/* Roboto Font */
|
||||
@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');
|
||||
|
||||
/* global body styles */
|
||||
body {
|
||||
margin: 0px;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* scroll bar styles */
|
||||
${unsafeCSS(scrollBarStyles)}
|
||||
`.cssText;
|
43
ts/domtools.css.breakpoints.ts
Normal file
43
ts/domtools.css.breakpoints.ts
Normal file
@ -0,0 +1,43 @@
|
||||
import { DomTools } from './domtools.classes.domtools.js';
|
||||
|
||||
import { CSSResult, unsafeCSS } from 'lit';
|
||||
|
||||
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 cssForTablet = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport size(max-width: ${tablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (max-width: ${tablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
`);
|
||||
};
|
||||
|
||||
export const cssForPhablet = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport size(max-width: ${phablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (max-width: ${phablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
`);
|
||||
};
|
||||
|
||||
export const cssForPhone = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport size(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 { DomTools } from './domtools.classes.domtools';
|
||||
import { scrollBarStyles } from './domtools.css.theme';
|
||||
import * as plugins from './domtools.plugins.js';
|
||||
import { DomTools } from './domtools.classes.domtools.js';
|
||||
import { scrollBarStyles, globalBaseStyles } from './domtools.css.basestyles.js';
|
||||
|
||||
import { html } 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
|
||||
@ -10,10 +24,14 @@ import { html } from 'lit-element';
|
||||
export const styles = html`
|
||||
<style>
|
||||
* {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
transition: background 0.1s, color 0.1s;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
:host {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
${scrollBarStyles}
|
||||
</style>
|
||||
`;
|
||||
@ -22,37 +40,17 @@ export const styles = html`
|
||||
* a basic setup for elements
|
||||
* makes sure everything is in check
|
||||
*/
|
||||
export const setup = async () => {
|
||||
export const setup = async (elementArg?: LitElement): Promise<DomTools> => {
|
||||
const domTools = await DomTools.setupDomTools();
|
||||
|
||||
if (elementArg) {
|
||||
// lets do something with the element
|
||||
// not used right now
|
||||
}
|
||||
|
||||
domTools.runOnce('elementBasicSetup', async () => {
|
||||
// bodyStyles
|
||||
domTools.setGlobalStyles(`
|
||||
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}
|
||||
`);
|
||||
domTools.setGlobalStyles(globalBaseStyles);
|
||||
});
|
||||
return domTools;
|
||||
};
|
||||
|
@ -1,9 +1,7 @@
|
||||
// designestate scope
|
||||
import * as deesComms from '@designestate/dees-comms';
|
||||
|
||||
export {
|
||||
deesComms
|
||||
};
|
||||
export { deesComms };
|
||||
|
||||
// apiglobal scope
|
||||
import * as typedrequest from '@apiglobal/typedrequest';
|
||||
@ -14,12 +12,29 @@ export { typedrequest };
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartrouter from '@pushrocks/smartrouter';
|
||||
import * as smartrx from '@pushrocks/smartrx';
|
||||
import * as smartstate from '@pushrocks/smartstate';
|
||||
import * as webrequest from '@pushrocks/webrequest';
|
||||
import * as websetup from '@pushrocks/websetup';
|
||||
import * as webstore from '@pushrocks/webstore';
|
||||
|
||||
export { smartdelay, smartpromise, smartrouter, smartstate, webrequest, websetup, webstore };
|
||||
// subscope lik
|
||||
import { ObjectMap } from '@pushrocks/lik/dist_ts/lik.objectmap.js';
|
||||
const lik = {
|
||||
ObjectMap,
|
||||
};
|
||||
|
||||
export {
|
||||
lik,
|
||||
smartdelay,
|
||||
smartpromise,
|
||||
smartrouter,
|
||||
smartrx,
|
||||
smartstate,
|
||||
webrequest,
|
||||
websetup,
|
||||
webstore,
|
||||
};
|
||||
|
||||
// third party scope
|
||||
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 breakpoints from './domtools.breakpoints';
|
||||
import * as css from './domtools.css';
|
||||
import * as elementBasic from './domtools.elementbasic.js';
|
||||
import * as breakpoints from './domtools.css.breakpoints.js';
|
||||
import * as css from './domtools.css.js';
|
||||
|
||||
export { css, breakpoints, elementBasic };
|
||||
export { DomTools } from './domtools.classes.domtools';
|
||||
export { DomTools } from './domtools.classes.domtools.js';
|
||||
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 = {
|
||||
smartdelay: allPlugins.smartdelay,
|
||||
smartpromise: allPlugins.smartpromise,
|
||||
SweetScroll: allPlugins.SweetScroll,
|
||||
smartstate: allPlugins.smartstate
|
||||
};
|
||||
|
6
tsconfig.json
Normal file
6
tsconfig.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "Node12"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user