Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
7655fc0348 | |||
8aa5576318 | |||
1ff54b0fcd | |||
3901258272 | |||
27380d1483 | |||
e2f9991f96 | |||
133ce80b0a | |||
cf12f45c9b | |||
6cc5ec315e | |||
88810bae2c | |||
21369d8da5 | |||
a5973944ee | |||
ad3f4b31fa | |||
91b50ecde5 | |||
45fecfbde8 | |||
e3e6d06969 | |||
50ace4c236 | |||
90f68965bb |
9196
package-lock.json
generated
9196
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.30",
|
||||
"version": "1.0.39",
|
||||
"private": false,
|
||||
"description": "tools to simplify complex css structures",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -14,21 +14,21 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.0.22",
|
||||
"@gitzone/tsbundle": "^1.0.69",
|
||||
"@gitzone/tstest": "^1.0.15",
|
||||
"@pushrocks/tapbundle": "^3.0.7",
|
||||
"@types/node": "^14.0.5",
|
||||
"@gitzone/tsbundle": "^1.0.72",
|
||||
"@gitzone/tstest": "^1.0.43",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.0.23",
|
||||
"tslint": "^6.1.2",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^1.0.38",
|
||||
"@pushrocks/lik": "^4.0.13",
|
||||
"@apiglobal/typedrequest": "^1.0.40",
|
||||
"@pushrocks/lik": "^4.0.17",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartrouter": "^1.0.2",
|
||||
"@pushrocks/smartrouter": "^1.0.4",
|
||||
"@pushrocks/smartstate": "^1.0.16",
|
||||
"@pushrocks/webrequest": "^2.0.9",
|
||||
"@pushrocks/websetup": "^2.0.16",
|
||||
"@pushrocks/webrequest": "^2.0.10",
|
||||
"@pushrocks/websetup": "^2.0.18",
|
||||
"lit-element": "^2.3.1",
|
||||
"sweet-scroll": "^4.0.0"
|
||||
},
|
||||
@ -43,5 +43,8 @@
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"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();
|
@ -3,6 +3,8 @@ import { Stringmap } from '@pushrocks/lik/dist_ts/lik.stringmap';
|
||||
import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap';
|
||||
import { TViewport } from './domtools.breakpoints';
|
||||
|
||||
import { Scroller } from './domtools.classes.scroller';
|
||||
|
||||
export interface IDomToolsState {
|
||||
virtualViewport: TViewport;
|
||||
}
|
||||
@ -36,6 +38,14 @@ export class DomTools {
|
||||
return domToolsInstance;
|
||||
}
|
||||
|
||||
public static getDomToolsSync() {
|
||||
const globalDomTools: DomTools = globalThis.deesDomTools;
|
||||
if (!globalDomTools) {
|
||||
throw new Error('You tried to access domtools synchronouly too early');
|
||||
}
|
||||
return globalThis.deesDomTools;
|
||||
}
|
||||
|
||||
// ========
|
||||
// INSTANCE
|
||||
// ========
|
||||
@ -57,6 +67,8 @@ export class DomTools {
|
||||
debug: false,
|
||||
});
|
||||
|
||||
public scroller: plugins.SweetScroll;
|
||||
|
||||
private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
|
||||
async (statePart, payload) => {
|
||||
const currentState = statePart.getState();
|
||||
@ -72,7 +84,7 @@ export class DomTools {
|
||||
constructor() {
|
||||
// lets care about third party stuff
|
||||
this.domToolsReady.promise.then(() => {
|
||||
const scroller = new plugins.sweetscroll({
|
||||
this.scroller = new plugins.SweetScroll({
|
||||
/* some options */
|
||||
});
|
||||
});
|
||||
|
5
ts/domtools.classes.scroller.ts
Normal file
5
ts/domtools.classes.scroller.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as plugins from './domtools.plugins';
|
||||
|
||||
export class Scroller {
|
||||
// TODO: move sweet scroll over to here;
|
||||
}
|
@ -1 +0,0 @@
|
||||
import * as plugins from './domtools.plugins';
|
@ -1,3 +1,8 @@
|
||||
// api glbal scope
|
||||
import * as typedrequest from '@apiglobal/typedrequest';
|
||||
|
||||
export { typedrequest };
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartrouter from '@pushrocks/smartrouter';
|
||||
@ -8,6 +13,6 @@ import * as websetup from '@pushrocks/websetup';
|
||||
export { smartpromise, smartrouter, smartstate, webrequest, websetup };
|
||||
|
||||
// third party scope
|
||||
import sweetscroll from 'sweet-scroll';
|
||||
import SweetScroll from 'sweet-scroll';
|
||||
|
||||
export { sweetscroll };
|
||||
export { SweetScroll };
|
||||
|
@ -7,3 +7,9 @@ import * as css from './domtools.css';
|
||||
export { css, breakpoints, elementBasic };
|
||||
export { DomTools } from './domtools.classes.domtools';
|
||||
export { TypedRequest } from '@apiglobal/typedrequest';
|
||||
|
||||
import * as allPlugins from './domtools.plugins';
|
||||
|
||||
export const plugins = {
|
||||
smartpromise: allPlugins.smartpromise,
|
||||
};
|
||||
|
Reference in New Issue
Block a user