Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
537902aa53 | |||
e033bfa5b3 | |||
4983e1ed90 | |||
899775b050 | |||
7655fc0348 | |||
8aa5576318 | |||
1ff54b0fcd | |||
3901258272 | |||
27380d1483 | |||
e2f9991f96 | |||
133ce80b0a | |||
cf12f45c9b | |||
6cc5ec315e | |||
88810bae2c | |||
21369d8da5 | |||
a5973944ee |
9227
package-lock.json
generated
9227
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.33",
|
"version": "1.0.41",
|
||||||
"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",
|
||||||
@ -14,21 +14,22 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.0.22",
|
||||||
"@gitzone/tsbundle": "^1.0.69",
|
"@gitzone/tsbundle": "^1.0.72",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.43",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
"@types/node": "^14.0.5",
|
"@types/node": "^14.0.26",
|
||||||
"tslint": "^6.1.2",
|
"tslint": "^6.1.2",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apiglobal/typedrequest": "^1.0.38",
|
"@apiglobal/typedrequest": "^1.0.41",
|
||||||
"@pushrocks/lik": "^4.0.13",
|
"@pushrocks/lik": "^4.0.17",
|
||||||
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartrouter": "^1.0.2",
|
"@pushrocks/smartrouter": "^1.0.4",
|
||||||
"@pushrocks/smartstate": "^1.0.16",
|
"@pushrocks/smartstate": "^1.0.17",
|
||||||
"@pushrocks/webrequest": "^2.0.9",
|
"@pushrocks/webrequest": "^2.0.10",
|
||||||
"@pushrocks/websetup": "^2.0.16",
|
"@pushrocks/websetup": "^2.0.18",
|
||||||
"lit-element": "^2.3.1",
|
"lit-element": "^2.3.1",
|
||||||
"sweet-scroll": "^4.0.0"
|
"sweet-scroll": "^4.0.0"
|
||||||
},
|
},
|
||||||
@ -43,5 +44,8 @@
|
|||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
9
test/test.browser.ts
Normal file
9
test/test.browser.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
|
import * as domtools from '../ts/index';
|
||||||
|
|
||||||
|
tap.test('first test', async () => {
|
||||||
|
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
||||||
|
expect(domtoolsInstance).to.be.instanceof(domtools.DomTools);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.start();
|
@ -1,8 +0,0 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
|
||||||
import * as deesCsstools from '../ts/index';
|
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
|
||||||
console.log('hi');
|
|
||||||
});
|
|
||||||
|
|
||||||
tap.start();
|
|
@ -4,6 +4,7 @@ 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';
|
||||||
|
|
||||||
export interface IDomToolsState {
|
export interface IDomToolsState {
|
||||||
virtualViewport: TViewport;
|
virtualViewport: TViewport;
|
||||||
@ -38,6 +39,17 @@ export class DomTools {
|
|||||||
return domToolsInstance;
|
return domToolsInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if you can, use the static asysnc .setupDomTools() function instead since it is safer to use.
|
||||||
|
*/
|
||||||
|
public static getGlobalDomToolsSync() {
|
||||||
|
const globalDomTools: DomTools = globalThis.deesDomTools;
|
||||||
|
if (!globalDomTools) {
|
||||||
|
throw new Error('You tried to access domtools synchronously too early');
|
||||||
|
}
|
||||||
|
return globalThis.deesDomTools;
|
||||||
|
}
|
||||||
|
|
||||||
// ========
|
// ========
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
// ========
|
// ========
|
||||||
@ -59,6 +71,10 @@ export class DomTools {
|
|||||||
debug: false,
|
debug: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
public convenience = {
|
||||||
|
smartdelay: plugins.smartdelay
|
||||||
|
};
|
||||||
|
|
||||||
public scroller: plugins.SweetScroll;
|
public scroller: plugins.SweetScroll;
|
||||||
|
|
||||||
private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
|
private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
|
||||||
|
@ -2,4 +2,4 @@ import * as plugins from './domtools.plugins';
|
|||||||
|
|
||||||
export class Scroller {
|
export class Scroller {
|
||||||
// TODO: move sweet scroll over to here;
|
// TODO: move sweet scroll over to here;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
|
// api glbal scope
|
||||||
|
import * as typedrequest from '@apiglobal/typedrequest';
|
||||||
|
|
||||||
|
export { typedrequest };
|
||||||
|
|
||||||
// pushrocks scope
|
// pushrocks scope
|
||||||
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
import * as smartrouter from '@pushrocks/smartrouter';
|
import * as smartrouter from '@pushrocks/smartrouter';
|
||||||
import * as smartstate from '@pushrocks/smartstate';
|
import * as smartstate from '@pushrocks/smartstate';
|
||||||
import * as webrequest from '@pushrocks/webrequest';
|
import * as webrequest from '@pushrocks/webrequest';
|
||||||
import * as websetup from '@pushrocks/websetup';
|
import * as websetup from '@pushrocks/websetup';
|
||||||
|
|
||||||
export { smartpromise, smartrouter, smartstate, webrequest, websetup };
|
export { smartdelay, smartpromise, smartrouter, smartstate, webrequest, websetup };
|
||||||
|
|
||||||
// third party scope
|
// third party scope
|
||||||
import SweetScroll from 'sweet-scroll';
|
import SweetScroll from 'sweet-scroll';
|
||||||
|
@ -7,3 +7,9 @@ import * as css from './domtools.css';
|
|||||||
export { css, breakpoints, elementBasic };
|
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';
|
||||||
|
|
||||||
|
import * as allPlugins from './domtools.plugins';
|
||||||
|
|
||||||
|
export const plugins = {
|
||||||
|
smartpromise: allPlugins.smartpromise,
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user