Compare commits

..

12 Commits

Author SHA1 Message Date
37b7dca212 1.0.29 2020-06-26 01:39:10 +00:00
7d9dc1ad65 fix(core): update 2020-06-26 01:39:10 +00:00
20f06e5935 1.0.28 2020-06-03 10:34:10 +00:00
d3fa33f0cc fix(core): update 2020-06-03 10:34:09 +00:00
aa91dad272 1.0.27 2020-06-03 09:07:32 +00:00
05a22599b8 fix(core): update 2020-06-03 09:07:31 +00:00
bd0b279fc2 1.0.26 2020-06-01 12:30:22 +00:00
8276a5b09b fix(core): update 2020-06-01 12:30:21 +00:00
a9200859ec 1.0.25 2020-05-27 23:53:32 +00:00
210a0ad8a1 fix(core): update 2020-05-27 23:53:32 +00:00
2756a3cb68 1.0.24 2020-05-27 22:41:09 +00:00
acf0ea3874 fix(core): update 2020-05-27 22:41:08 +00:00
9 changed files with 141 additions and 41 deletions

119
package-lock.json generated
View File

@ -1,14 +1,34 @@
{
"name": "@designestate/dees-domtools",
"version": "1.0.23",
"version": "1.0.29",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@apiglobal/typedrequest": {
"version": "1.0.38",
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest/-/typedrequest-1.0.38.tgz",
"integrity": "sha512-A0kFQJEadwOc9Zlnc4QvVoqL0e5zaEGye+dUDlfq3p9jvis6KbDSamG+xcGXw1HTz7BxFp66Ix73qwHUzWkHeg==",
"requires": {
"@apiglobal/typedrequest-interfaces": "^1.0.13",
"@pushrocks/lik": "^4.0.13",
"@pushrocks/smartdelay": "^2.0.9",
"@pushrocks/webrequest": "^2.0.9"
},
"dependencies": {
"@pushrocks/smartdelay": {
"version": "2.0.9",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.9.tgz",
"integrity": "sha512-aVZJit1wq4fBG6ft2LJSPEnNbLSbRUuwNYggSeDqLtY7mXvAQmu4SIsXx18gfOtf69CoZR36RY3ff/IJv62C7w==",
"requires": {
"@pushrocks/smartpromise": "^3.0.6"
}
}
}
},
"@apiglobal/typedrequest-interfaces": {
"version": "1.0.13",
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest-interfaces/-/typedrequest-interfaces-1.0.13.tgz",
"integrity": "sha512-3mk0mMC7unqh+Bb0mPEMwEfJcLAGl5ZjA1If/OGyk56KQOBqA2mLATS40HREeGoAEcUOHU2VCwPuU/tpSVMY/w==",
"dev": true
"integrity": "sha512-3mk0mMC7unqh+Bb0mPEMwEfJcLAGl5ZjA1If/OGyk56KQOBqA2mLATS40HREeGoAEcUOHU2VCwPuU/tpSVMY/w=="
},
"@babel/code-frame": {
"version": "7.8.3",
@ -1072,16 +1092,15 @@
}
},
"@pushrocks/lik": {
"version": "4.0.12",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.12.tgz",
"integrity": "sha512-ffd3bJL+kMuhXDulO5VC5OqgfhZR3I4HoVN7IBLlN1z6Dco6j4NFrp+/GKDoPssFPNQY4okv+N4Hm2T/7t+4CQ==",
"version": "4.0.13",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.13.tgz",
"integrity": "sha512-Nde8rq1DjaDCREKlGGY/zS8g+eFu4zSU2jrbO4DdtYD+9oiauBMz2jzao3fr8401XpNW1Ex8T8FPdjUW8lUMow==",
"requires": {
"@pushrocks/smartdelay": "^2.0.9",
"@pushrocks/smartmatch": "^1.0.7",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrx": "^2.0.15",
"@pushrocks/smarttime": "^3.0.18",
"@pushrocks/smartunique": "^3.0.3",
"@types/minimatch": "^3.0.3",
"symbol-tree": "^3.2.4"
},
@ -1160,6 +1179,23 @@
"@pushrocks/smartpromise": "^3.0.6"
}
},
"@pushrocks/smartenv": {
"version": "4.0.10",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartenv/-/smartenv-4.0.10.tgz",
"integrity": "sha512-b9jJbBSaOl0nlujyEu/0q5lkOFSMmfcOwPGb3pYrF1B37O15qmVpuqYwA5T8BXj8A6y+oA2bwrrtDzQ7hYp1zg==",
"requires": {
"@pushrocks/smartparam": "^1.1.6",
"@pushrocks/smartpromise": "^3.0.6",
"@types/node": "^14.0.14"
},
"dependencies": {
"@types/node": {
"version": "14.0.14",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.0.14.tgz",
"integrity": "sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ=="
}
}
},
"@pushrocks/smartevent": {
"version": "2.0.5",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartevent/-/smartevent-2.0.5.tgz",
@ -1308,7 +1344,6 @@
"version": "1.1.6",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartparam/-/smartparam-1.1.6.tgz",
"integrity": "sha512-1El/F2QTWYDGy4Nh6vz9Ry1JVg1FEeyexB7Uvi4zHElpXYVxwso6xImRTLj+SW50JAg7nwEZ+ljkzTG9XvnwWA==",
"dev": true,
"requires": {
"@pushrocks/smartpromise": "^3.0.6",
"is-promise": "^2.1.0",
@ -1338,6 +1373,14 @@
"form-data": "^2.5.1"
}
},
"@pushrocks/smartrouter": {
"version": "1.0.2",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrouter/-/smartrouter-1.0.2.tgz",
"integrity": "sha512-G7/Mb03TLOyarpDngfTOeWZqQv3GxMoG2JtoPH4mQ0y7SosQdaminnx++oopmP/CTzyj5mtAPCnWv/qcDBkv7Q==",
"requires": {
"path-to-regexp": "^6.1.0"
}
},
"@pushrocks/smartrx": {
"version": "2.0.5",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrx/-/smartrx-2.0.5.tgz",
@ -1423,6 +1466,7 @@
"version": "3.0.3",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartunique/-/smartunique-3.0.3.tgz",
"integrity": "sha512-f+c3s2WzzjASoRHyYTLU0kHDVWREg4sZVdi5L42bTA3CTUWNrcGUC62h4wP4U4BiPl3bopTr3LPhClZHJ738oA==",
"dev": true,
"requires": {
"@types/shortid": "0.0.29",
"@types/uuid": "^7.0.0",
@ -1443,6 +1487,26 @@
"smartchai": "^2.0.1"
}
},
"@pushrocks/webrequest": {
"version": "2.0.9",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fwebrequest/-/webrequest-2.0.9.tgz",
"integrity": "sha512-cHKbVlS6j26SRzFMjvV+4hwwimXJ9NX/NnUmLmPSTZguzz6dEp1dYd+aNzGaGC8Da4ewvH7klhx7a5LI3Gv5tw==",
"requires": {
"@pushrocks/smartdelay": "^2.0.9",
"@pushrocks/smartenv": "^4.0.10",
"node-fetch": "^2.6.0"
},
"dependencies": {
"@pushrocks/smartdelay": {
"version": "2.0.9",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.9.tgz",
"integrity": "sha512-aVZJit1wq4fBG6ft2LJSPEnNbLSbRUuwNYggSeDqLtY7mXvAQmu4SIsXx18gfOtf69CoZR36RY3ff/IJv62C7w==",
"requires": {
"@pushrocks/smartpromise": "^3.0.6"
}
}
}
},
"@rollup/plugin-commonjs": {
"version": "12.0.0",
"resolved": "https://verdaccio.lossless.one/@rollup%2fplugin-commonjs/-/plugin-commonjs-12.0.0.tgz",
@ -1643,7 +1707,8 @@
"@types/shortid": {
"version": "0.0.29",
"resolved": "https://verdaccio.lossless.one/@types%2fshortid/-/shortid-0.0.29.tgz",
"integrity": "sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps="
"integrity": "sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps=",
"dev": true
},
"@types/through2": {
"version": "2.0.36",
@ -1674,7 +1739,8 @@
"@types/uuid": {
"version": "7.0.4",
"resolved": "https://verdaccio.lossless.one/@types%2fuuid/-/uuid-7.0.4.tgz",
"integrity": "sha512-WGZCqBZZ0mXN2RxvLHL6/7RCu+OWs28jgQMP04LWfpyJlQUMTR6YU9CNJAKDgbw+EV/u687INXuLUc7FuML/4g=="
"integrity": "sha512-WGZCqBZZ0mXN2RxvLHL6/7RCu+OWs28jgQMP04LWfpyJlQUMTR6YU9CNJAKDgbw+EV/u687INXuLUc7FuML/4g==",
"dev": true
},
"@types/which": {
"version": "1.3.2",
@ -1775,14 +1841,12 @@
"balanced-match": {
"version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -2000,8 +2064,7 @@
"concat-map": {
"version": "0.0.1",
"resolved": "https://verdaccio.lossless.one/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"convert-source-map": {
"version": "1.7.0",
@ -2378,8 +2441,7 @@
"is-promise": {
"version": "2.2.2",
"resolved": "https://verdaccio.lossless.one/is-promise/-/is-promise-2.2.2.tgz",
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==",
"dev": true
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
},
"is-reference": {
"version": "1.1.4",
@ -2590,7 +2652,6 @@
"version": "3.0.4",
"resolved": "https://verdaccio.lossless.one/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -2634,7 +2695,8 @@
"nanoid": {
"version": "2.1.11",
"resolved": "https://verdaccio.lossless.one/nanoid/-/nanoid-2.1.11.tgz",
"integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA=="
"integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==",
"dev": true
},
"no-case": {
"version": "2.3.2",
@ -2645,6 +2707,11 @@
"lower-case": "^1.1.1"
}
},
"node-fetch": {
"version": "2.6.0",
"resolved": "https://verdaccio.lossless.one/node-fetch/-/node-fetch-2.6.0.tgz",
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
},
"node-releases": {
"version": "1.1.56",
"resolved": "https://verdaccio.lossless.one/node-releases/-/node-releases-1.1.56.tgz",
@ -2768,6 +2835,11 @@
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"dev": true
},
"path-to-regexp": {
"version": "6.1.0",
"resolved": "https://verdaccio.lossless.one/path-to-regexp/-/path-to-regexp-6.1.0.tgz",
"integrity": "sha512-h9DqehX3zZZDCEm+xbfU0ZmwCGFCAAraPJWMXJ4+v32NjZJilVg3k1TcKsRgIb8IQ/izZSaydDc1OhJCZvs2Dw=="
},
"pathval": {
"version": "1.1.0",
"resolved": "https://verdaccio.lossless.one/pathval/-/pathval-1.1.0.tgz",
@ -3057,6 +3129,7 @@
"version": "2.2.15",
"resolved": "https://verdaccio.lossless.one/shortid/-/shortid-2.2.15.tgz",
"integrity": "sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==",
"dev": true,
"requires": {
"nanoid": "^2.1.0"
}
@ -3165,6 +3238,11 @@
"has-flag": "^3.0.0"
}
},
"sweet-scroll": {
"version": "4.0.0",
"resolved": "https://verdaccio.lossless.one/sweet-scroll/-/sweet-scroll-4.0.0.tgz",
"integrity": "sha512-mR6fRsAQANtm3zpzhUE73KAOt2aT4ZsWzNSggiEsSqdO6Zh4gM7ioJG81EngrZEl0XAc3ZvzEfhxggOoEBc8jA=="
},
"symbol-tree": {
"version": "3.2.4",
"resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.4.tgz",
@ -3342,7 +3420,8 @@
"uuid": {
"version": "7.0.3",
"resolved": "https://verdaccio.lossless.one/uuid/-/uuid-7.0.3.tgz",
"integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg=="
"integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==",
"dev": true
},
"wcwidth": {
"version": "1.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@designestate/dees-domtools",
"version": "1.0.23",
"version": "1.0.29",
"private": false,
"description": "tools to simplify complex css structures",
"main": "dist_ts/index.js",
@ -22,10 +22,13 @@
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@pushrocks/lik": "^4.0.12",
"@apiglobal/typedrequest": "^1.0.38",
"@pushrocks/lik": "^4.0.13",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrouter": "^1.0.2",
"@pushrocks/smartstate": "^1.0.16",
"lit-element": "^2.3.1"
"lit-element": "^2.3.1",
"sweet-scroll": "^4.0.0"
},
"files": [
"ts/**/*",

View File

@ -15,6 +15,8 @@ tools to simplify complex css structures
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
[![JavaScript Style Guide](https://badgen.net/bundlephobia/minzip/@material-ui/core)](https://prettier.io/)
## Usage

View File

@ -1,9 +1,9 @@
import { DomTools } from './domtools.classes.domtools';
export const desktop = 1240;
export const tablet = 700;
export const phablet = 500;
export const phone = 340;
export const tablet = 1024;
export const phablet = 600;
export const phone = 400;
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
@ -15,7 +15,7 @@ export const getEnvironment = (): TViewport => {
}
};
export const cssForTablet = async (contentArg) => {
export const cssForTablet = (contentArg) => {
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
return `
@media (max-width: ${tablet}px) {
@ -35,7 +35,7 @@ export const cssForTablet = async (contentArg) => {
}
};
export const cssForPhablet = async (contentArg) => {
export const cssForPhablet = (contentArg) => {
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
return `
@media (max-width: ${phablet}px) {
@ -51,7 +51,7 @@ export const cssForPhablet = async (contentArg) => {
}
};
export const cssForPhone = async (contentArg) => {
export const cssForPhone = (contentArg) => {
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
return `
@media (max-width: ${phone}px) {

View File

@ -8,6 +8,12 @@ export interface IDomToolsState {
}
export class DomTools {
// ======
// STATIC
// ======
/**
* setups domtools
*/
public static async setupDomTools() {
let domToolsInstance: DomTools;
if (!globalThis.deesDomTools) {
@ -30,17 +36,26 @@ export class DomTools {
return domToolsInstance;
}
// ========
// INSTANCE
// ========
public smartstate = new plugins.smartstate.Smartstate();
public domToolsStatePart = this.smartstate.getStatePart<IDomToolsState>('domtools', {
virtualViewport: 'native'
virtualViewport: 'native',
});
public actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(async (statePart, payload) => {
const currentState = statePart.getState();
currentState.virtualViewport = payload;
return currentState;
public router = new plugins.smartrouter.SmartRouter({
debug: false
});
private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
async (statePart, payload) => {
const currentState = statePart.getState();
currentState.virtualViewport = payload;
return currentState;
}
);
public domToolsReady = plugins.smartpromise.defer();
public domReady = plugins.smartpromise.defer();
public globalStylesReady = plugins.smartpromise.defer();
@ -51,12 +66,10 @@ export class DomTools {
bodyElement: HTMLElement;
} = {
headElement: null,
bodyElement: null
bodyElement: null,
};
constructor() {
}
constructor() {}
public async setGlobalStyles(stylesText: string) {
await this.domReady.promise;
@ -83,7 +96,7 @@ export class DomTools {
this.runOnceTrackerStringMap.removeString(runningId);
}
return await this.runOnceTrackerStringMap.registerUntilTrue(
stringMap => {
(stringMap) => {
return !stringMap.includes(runningId);
},
() => {

View File

@ -1 +0,0 @@
import * as plugins from './domtools.plugins';

1
ts/domtools.move.ts Normal file
View File

@ -0,0 +1 @@
import * as plugins from './domtools.plugins';

View File

@ -1,5 +1,6 @@
// pushrocks scope
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrouter from '@pushrocks/smartrouter';
import * as smartstate from '@pushrocks/smartstate';
export { smartpromise, smartstate };
export { smartpromise, smartrouter, smartstate };

View File

@ -6,3 +6,5 @@ import * as css from './domtools.css';
export { css, breakpoints, elementBasic };
export { DomTools } from './domtools.classes.domtools';
export { TypedRequest } from '@apiglobal/typedrequest';