Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
20f06e5935 | |||
d3fa33f0cc | |||
aa91dad272 | |||
05a22599b8 |
20
package-lock.json
generated
20
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.26",
|
||||
"version": "1.0.28",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -1337,6 +1337,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",
|
||||
@ -2771,6 +2779,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",
|
||||
@ -3169,6 +3182,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",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.26",
|
||||
"version": "1.0.28",
|
||||
"private": false,
|
||||
"description": "tools to simplify complex css structures",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -24,8 +24,10 @@
|
||||
"dependencies": {
|
||||
"@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/**/*",
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { DomTools } from './domtools.classes.domtools';
|
||||
|
||||
export const desktop = 1240;
|
||||
export const tablet = 700;
|
||||
export const phablet = 500;
|
||||
export const tablet = 1024;
|
||||
export const phablet = 600;
|
||||
export const phone = 400;
|
||||
|
||||
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
||||
|
@ -8,6 +8,12 @@ export interface IDomToolsState {
|
||||
}
|
||||
|
||||
export class DomTools {
|
||||
// ======
|
||||
// STATIC
|
||||
// ======
|
||||
/**
|
||||
* setups domtools
|
||||
*/
|
||||
public static async setupDomTools() {
|
||||
let domToolsInstance: DomTools;
|
||||
if (!globalThis.deesDomTools) {
|
||||
@ -30,16 +36,25 @@ 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) => {
|
||||
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();
|
||||
@ -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);
|
||||
},
|
||||
() => {
|
||||
|
@ -1 +0,0 @@
|
||||
import * as plugins from './domtools.plugins';
|
1
ts/domtools.move.ts
Normal file
1
ts/domtools.move.ts
Normal file
@ -0,0 +1 @@
|
||||
import * as plugins from './domtools.plugins';
|
@ -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 };
|
||||
|
Reference in New Issue
Block a user