Compare commits

...

4 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
4 changed files with 16 additions and 14 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.97", "version": "1.0.99",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.97", "version": "1.0.99",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@apiglobal/typedrequest": "^1.0.65", "@apiglobal/typedrequest": "^1.0.65",

View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.97", "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",

View File

@ -1,6 +1,6 @@
import { DomTools } from './domtools.classes.domtools'; import { DomTools } from './domtools.classes.domtools';
import { CSSResult } from 'lit-element'; import { CSSResult, unsafeCSS } from 'lit-element';
export const desktop = 1240; export const desktop = 1240;
export const tablet = 1024; export const tablet = 1024;
@ -10,34 +10,34 @@ export const phone = 400;
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone'; export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
export const cssForTablet = (cssArg: CSSResult) => { export const cssForTablet = (cssArg: CSSResult) => {
return ` return unsafeCSS(`
@container wccToolsViewport (min-width: ${tablet}px) { @container wccToolsViewport (min-width: ${tablet}px) {
${cssArg.cssText} ${cssArg.cssText}
} }
@media (min-width: ${tablet}px) { @media (min-width: ${tablet}px) {
${cssArg.cssText} ${cssArg.cssText}
} }
`; `);
}; };
export const cssForPhablet = (cssArg: CSSResult) => { export const cssForPhablet = (cssArg: CSSResult) => {
return ` return unsafeCSS(`
@container wccToolsViewport (min-width: ${phablet}px) { @container wccToolsViewport (min-width: ${phablet}px) {
${cssArg.cssText} ${cssArg.cssText}
} }
@media (min-width: ${phablet}px) { @media (min-width: ${phablet}px) {
${cssArg.cssText} ${cssArg.cssText}
} }
`; `);
}; };
export const cssForPhone = (cssArg: CSSResult) => { export const cssForPhone = (cssArg: CSSResult) => {
return ` return unsafeCSS(`
@container wccToolsViewport (min-width: ${phone}px) { @container wccToolsViewport (min-width: ${phone}px) {
${cssArg.cssText} ${cssArg.cssText}
} }
@media (min-width: ${phone}px) { @media (min-width: ${phone}px) {
${cssArg.cssText} ${cssArg.cssText}
} }
`; `);
}; };

View File

@ -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);