Compare commits

...

20 Commits

Author SHA1 Message Date
1aabacdf87 1.0.99 2021-11-21 16:14:28 +01:00
1747afe04a fix(core): update 2021-11-21 16:14:27 +01:00
a1bd7f74a7 1.0.98 2021-11-21 16:08:28 +01:00
6ff89390b7 fix(core): update 2021-11-21 16:08:27 +01:00
2ad8d0a9fd 1.0.97 2021-11-21 15:52:49 +01:00
ae01670361 fix(core): update 2021-11-21 15:52:49 +01:00
5657b0be1d 1.0.96 2021-09-27 12:35:39 +02:00
781ae3c3b1 fix(core): update 2021-09-27 12:35:39 +02:00
da79e623cc 1.0.95 2021-09-16 16:49:24 +02:00
3ca6b5e34e fix(core): update 2021-09-16 16:49:24 +02:00
98f0bc013d 1.0.94 2021-09-13 20:35:34 +02:00
d32a544de2 fix(core): update 2021-09-13 20:35:33 +02:00
070221d6c9 1.0.93 2021-09-08 23:10:04 +02:00
19714854ba fix(core): update 2021-09-08 23:10:04 +02:00
50ebea1b5f 1.0.92 2021-09-08 22:42:33 +02:00
df0527f3c1 fix(core): update 2021-09-08 22:42:32 +02:00
b620b7393e 1.0.91 2021-09-01 21:05:55 +02:00
ab5b9511fd fix(core): update 2021-09-01 21:05:54 +02:00
da86e64056 1.0.90 2021-09-01 00:37:05 +02:00
effc331a67 fix(core): update 2021-09-01 00:37:05 +02:00
5 changed files with 7849 additions and 8275 deletions

16000
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.89", "version": "1.0.99",
"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.80", "@gitzone/tsbundle": "^1.0.88",
"@gitzone/tstest": "^1.0.52", "@gitzone/tstest": "^1.0.60",
"@pushrocks/tapbundle": "^3.2.14", "@pushrocks/tapbundle": "^3.2.14",
"@types/node": "^14.14.33", "@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.56", "@apiglobal/typedrequest": "^1.0.65",
"@designestate/dees-comms": "^1.0.9", "@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.15", "@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": [

View File

@ -1,5 +1,7 @@
import { DomTools } from './domtools.classes.domtools'; import { DomTools } from './domtools.classes.domtools';
import { CSSResult, unsafeCSS } 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 unsafeCSS(`
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 unsafeCSS(`
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 unsafeCSS(`
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}
}
`;
}
}; };

View File

@ -80,7 +80,7 @@ export class DomTools {
}); });
public convenience = { public convenience = {
typedrequest: plugins.typedrequest,
smartdelay: plugins.smartdelay, smartdelay: plugins.smartdelay,
}; };
@ -90,7 +90,7 @@ export class DomTools {
}); // TODO: switch to scroller class }); // TODO: switch to scroller class
public themeManager = new ThemeManager(this); public themeManager = new ThemeManager(this);
private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>( /* private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
async (statePart, payload) => { async (statePart, payload) => {
const currentState = statePart.getState(); const currentState = statePart.getState();
currentState.virtualViewport = payload; currentState.virtualViewport = payload;
@ -98,6 +98,10 @@ export class DomTools {
} }
); );
public setVirtualViewport(environmentArg: TViewport) {
this.domToolsStatePart.dispatchAction(this.actionSetVirtualViewport, environmentArg);
} */
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();
@ -148,9 +152,7 @@ export class DomTools {
document.head.append(cssTag); document.head.append(cssTag);
} }
public setVirtualViewport(environmentArg: TViewport) {
this.domToolsStatePart.dispatchAction(this.actionSetVirtualViewport, environmentArg);
}
public async setWebsiteInfo(optionsArg: plugins.websetup.IWebSetupConstructorOptions) { public async setWebsiteInfo(optionsArg: plugins.websetup.IWebSetupConstructorOptions) {
await this.websetup.setup(optionsArg); await this.websetup.setup(optionsArg);

View File

@ -15,4 +15,6 @@ import * as allPlugins from './domtools.plugins';
export const plugins = { export const plugins = {
smartdelay: allPlugins.smartdelay, smartdelay: allPlugins.smartdelay,
smartpromise: allPlugins.smartpromise, smartpromise: allPlugins.smartpromise,
SweetScroll: allPlugins.SweetScroll,
smartstate: allPlugins.smartstate
}; };