Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
7655fc0348 | |||
8aa5576318 | |||
1ff54b0fcd | |||
3901258272 | |||
27380d1483 | |||
e2f9991f96 | |||
133ce80b0a | |||
cf12f45c9b | |||
6cc5ec315e | |||
88810bae2c | |||
21369d8da5 | |||
a5973944ee | |||
ad3f4b31fa | |||
91b50ecde5 | |||
45fecfbde8 | |||
e3e6d06969 |
9156
package-lock.json
generated
9156
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",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.31",
|
"version": "1.0.39",
|
||||||
"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,21 @@
|
|||||||
},
|
},
|
||||||
"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.23",
|
||||||
"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.40",
|
||||||
"@pushrocks/lik": "^4.0.13",
|
"@pushrocks/lik": "^4.0.17",
|
||||||
"@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.16",
|
||||||
"@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 +43,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();
|
|
@ -3,6 +3,8 @@ import { Stringmap } from '@pushrocks/lik/dist_ts/lik.stringmap';
|
|||||||
import { FastMap } from '@pushrocks/lik/dist_ts/lik.fastmap';
|
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';
|
||||||
|
|
||||||
export interface IDomToolsState {
|
export interface IDomToolsState {
|
||||||
virtualViewport: TViewport;
|
virtualViewport: TViewport;
|
||||||
}
|
}
|
||||||
@ -36,6 +38,14 @@ export class DomTools {
|
|||||||
return domToolsInstance;
|
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
|
// INSTANCE
|
||||||
// ========
|
// ========
|
||||||
@ -57,6 +67,8 @@ export class DomTools {
|
|||||||
debug: false,
|
debug: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
public scroller: plugins.SweetScroll;
|
||||||
|
|
||||||
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();
|
||||||
@ -71,15 +83,11 @@ export class DomTools {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
// lets care about third party stuff
|
// lets care about third party stuff
|
||||||
document.addEventListener(
|
this.domToolsReady.promise.then(() => {
|
||||||
'DOMContentLoaded',
|
this.scroller = new plugins.SweetScroll({
|
||||||
() => {
|
|
||||||
const scroller = new plugins.sweetscroll({
|
|
||||||
/* some options */
|
/* some options */
|
||||||
});
|
});
|
||||||
},
|
});
|
||||||
false,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private runOnceTrackerStringMap = new Stringmap();
|
private runOnceTrackerStringMap = new Stringmap();
|
||||||
|
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
|
// pushrocks scope
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
import * as smartrouter from '@pushrocks/smartrouter';
|
import * as smartrouter from '@pushrocks/smartrouter';
|
||||||
@ -8,6 +13,6 @@ import * as websetup from '@pushrocks/websetup';
|
|||||||
export { smartpromise, smartrouter, smartstate, webrequest, websetup };
|
export { smartpromise, smartrouter, smartstate, webrequest, websetup };
|
||||||
|
|
||||||
// third party scope
|
// 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 { 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