Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
23666
package-lock.json
generated
23666
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.83",
|
"version": "1.0.97",
|
||||||
"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",
|
||||||
@ -13,27 +13,27 @@
|
|||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.28",
|
||||||
"@gitzone/tsbundle": "^1.0.78",
|
"@gitzone/tsbundle": "^1.0.88",
|
||||||
"@gitzone/tstest": "^1.0.52",
|
"@gitzone/tstest": "^1.0.60",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.14",
|
||||||
"@types/node": "^14.14.10",
|
"@types/node": "^16.11.9",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apiglobal/typedrequest": "^1.0.54",
|
"@apiglobal/typedrequest": "^1.0.65",
|
||||||
"@designestate/dees-comms": "^1.0.7",
|
"@designestate/dees-comms": "^1.0.11",
|
||||||
"@pushrocks/lik": "^4.0.20",
|
"@pushrocks/lik": "^5.0.0",
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartpromise": "^3.1.3",
|
"@pushrocks/smartpromise": "^3.1.6",
|
||||||
"@pushrocks/smartrouter": "^1.0.7",
|
"@pushrocks/smartrouter": "^1.0.11",
|
||||||
"@pushrocks/smartrx": "^2.0.19",
|
"@pushrocks/smartrx": "^2.0.19",
|
||||||
"@pushrocks/smartstate": "^1.0.21",
|
"@pushrocks/smartstate": "^1.0.21",
|
||||||
"@pushrocks/webrequest": "^2.0.13",
|
"@pushrocks/webrequest": "^2.0.13",
|
||||||
"@pushrocks/websetup": "^3.0.12",
|
"@pushrocks/websetup": "^3.0.15",
|
||||||
"@pushrocks/webstore": "^1.0.16",
|
"@pushrocks/webstore": "^1.0.16",
|
||||||
"lit-element": "^2.4.0",
|
"lit-element": "^3.0.2",
|
||||||
"sweet-scroll": "^4.0.0"
|
"sweet-scroll": "^4.0.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { DomTools } from './domtools.classes.domtools';
|
import { DomTools } from './domtools.classes.domtools';
|
||||||
|
|
||||||
|
import { CSSResult } from 'lit-element';
|
||||||
|
|
||||||
export const desktop = 1240;
|
export const desktop = 1240;
|
||||||
export const tablet = 1024;
|
export const tablet = 1024;
|
||||||
export const phablet = 600;
|
export const phablet = 600;
|
||||||
@ -7,65 +9,35 @@ export const phone = 400;
|
|||||||
|
|
||||||
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
||||||
|
|
||||||
export const getEnvironment = (): TViewport => {
|
export const cssForTablet = (cssArg: CSSResult) => {
|
||||||
if (
|
return `
|
||||||
globalThis.deesDomTools &&
|
@container wccToolsViewport (min-width: ${tablet}px) {
|
||||||
globalThis.deesDomTools.domToolsStatePart.getState().virtualViewport
|
${cssArg.cssText}
|
||||||
) {
|
}
|
||||||
return globalThis.deesDomTools.domToolsStatePart.getState().virtualViewport;
|
@media (min-width: ${tablet}px) {
|
||||||
} else {
|
${cssArg.cssText}
|
||||||
return 'native';
|
}
|
||||||
}
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cssForTablet = (contentArg) => {
|
export const cssForPhablet = (cssArg: CSSResult) => {
|
||||||
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
return `
|
||||||
return `
|
@container wccToolsViewport (min-width: ${phablet}px) {
|
||||||
@media (max-width: ${tablet}px) {
|
${cssArg.cssText}
|
||||||
${contentArg}
|
}
|
||||||
}
|
@media (min-width: ${phablet}px) {
|
||||||
`;
|
${cssArg.cssText}
|
||||||
} else if (
|
}
|
||||||
getEnvironment() === 'tablet' ||
|
`;
|
||||||
getEnvironment() === 'phablet' ||
|
|
||||||
getEnvironment() === 'phone'
|
|
||||||
) {
|
|
||||||
return `
|
|
||||||
@media (min-width: 0px) {
|
|
||||||
${contentArg}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cssForPhablet = (contentArg) => {
|
export const cssForPhone = (cssArg: CSSResult) => {
|
||||||
if (getEnvironment() === 'native' || getEnvironment() === 'desktop') {
|
return `
|
||||||
return `
|
@container wccToolsViewport (min-width: ${phone}px) {
|
||||||
@media (max-width: ${phablet}px) {
|
${cssArg.cssText}
|
||||||
${contentArg}
|
}
|
||||||
}
|
@media (min-width: ${phone}px) {
|
||||||
`;
|
${cssArg.cssText}
|
||||||
} 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}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,6 @@ import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap';
|
|||||||
import { TViewport } from './domtools.breakpoints';
|
import { TViewport } from './domtools.breakpoints';
|
||||||
|
|
||||||
import { Scroller } from './domtools.classes.scroller';
|
import { Scroller } from './domtools.classes.scroller';
|
||||||
import { delayForRandom } from '@pushrocks/smartdelay';
|
|
||||||
import { WebSetup } from '@pushrocks/websetup';
|
import { WebSetup } from '@pushrocks/websetup';
|
||||||
import { ThemeManager } from './domtools.classes.thememanager';
|
import { ThemeManager } from './domtools.classes.thememanager';
|
||||||
|
|
||||||
@ -81,6 +80,7 @@ export class DomTools {
|
|||||||
});
|
});
|
||||||
|
|
||||||
public convenience = {
|
public convenience = {
|
||||||
|
typedrequest: plugins.typedrequest,
|
||||||
smartdelay: plugins.smartdelay,
|
smartdelay: plugins.smartdelay,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,9 @@ import { DomTools } from './domtools.classes.domtools';
|
|||||||
* changes scrollbar styles to be consistent across OS borders
|
* changes scrollbar styles to be consistent across OS borders
|
||||||
*/
|
*/
|
||||||
export const scrollBarStyles = (() => {
|
export const scrollBarStyles = (() => {
|
||||||
const returnStyles = navigator.userAgent.indexOf("Windows") !== -1 ? `
|
const returnStyles =
|
||||||
|
navigator.userAgent.indexOf('Windows') !== -1
|
||||||
|
? `
|
||||||
/* width */
|
/* width */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 8px;
|
width: 8px;
|
||||||
@ -24,5 +26,6 @@ export const scrollBarStyles = (() => {
|
|||||||
::-webkit-scrollbar-thumb:hover {
|
::-webkit-scrollbar-thumb:hover {
|
||||||
background: #777;
|
background: #777;
|
||||||
}
|
}
|
||||||
` : ``;
|
`
|
||||||
|
: ``;
|
||||||
})();
|
})();
|
||||||
|
@ -2,7 +2,20 @@ import * as plugins from './domtools.plugins';
|
|||||||
import { DomTools } from './domtools.classes.domtools';
|
import { DomTools } from './domtools.classes.domtools';
|
||||||
import { scrollBarStyles } from './domtools.css.theme';
|
import { scrollBarStyles } from './domtools.css.theme';
|
||||||
|
|
||||||
import { html, LitElement } from 'lit-element';
|
import { html, LitElement, css, unsafeCSS } from 'lit-element';
|
||||||
|
|
||||||
|
export const staticStyles = css`
|
||||||
|
* {
|
||||||
|
transition: background 0.1s, color 0.1s;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host {
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
${unsafeCSS(scrollBarStyles)}
|
||||||
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* styles to be included in every webcomponent
|
* styles to be included in every webcomponent
|
||||||
@ -11,10 +24,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>
|
||||||
`;
|
`;
|
||||||
|
@ -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';
|
||||||
@ -21,12 +19,22 @@ 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';
|
||||||
const lik = {
|
const lik = {
|
||||||
ObjectMap
|
ObjectMap,
|
||||||
};
|
};
|
||||||
|
|
||||||
export { lik, smartdelay, smartpromise, smartrouter, smartrx, smartstate, webrequest, websetup, webstore };
|
export {
|
||||||
|
lik,
|
||||||
|
smartdelay,
|
||||||
|
smartpromise,
|
||||||
|
smartrouter,
|
||||||
|
smartrx,
|
||||||
|
smartstate,
|
||||||
|
webrequest,
|
||||||
|
websetup,
|
||||||
|
webstore,
|
||||||
|
};
|
||||||
|
|
||||||
// third party scope
|
// third party scope
|
||||||
import SweetScroll from 'sweet-scroll';
|
import SweetScroll from 'sweet-scroll';
|
||||||
|
@ -8,9 +8,13 @@ export { css, breakpoints, elementBasic };
|
|||||||
export { DomTools } from './domtools.classes.domtools';
|
export { DomTools } from './domtools.classes.domtools';
|
||||||
export { TypedRequest } from '@apiglobal/typedrequest';
|
export { TypedRequest } from '@apiglobal/typedrequest';
|
||||||
export { IWebSetupConstructorOptions } from '@pushrocks/websetup';
|
export { IWebSetupConstructorOptions } from '@pushrocks/websetup';
|
||||||
|
export { rxjs } from '@pushrocks/smartrx';
|
||||||
|
|
||||||
import * as allPlugins from './domtools.plugins';
|
import * as allPlugins from './domtools.plugins';
|
||||||
|
|
||||||
export const plugins = {
|
export const plugins = {
|
||||||
|
smartdelay: allPlugins.smartdelay,
|
||||||
smartpromise: allPlugins.smartpromise,
|
smartpromise: allPlugins.smartpromise,
|
||||||
|
SweetScroll: allPlugins.SweetScroll,
|
||||||
|
smartstate: allPlugins.smartstate
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user