Compare commits

...

20 Commits

Author SHA1 Message Date
afaa88047c 1.0.43 2020-09-12 13:14:17 +00:00
8aabe2820e fix(core): update 2020-09-12 13:14:17 +00:00
570d370c97 1.0.42 2020-09-12 13:11:11 +00:00
73552ad80f fix(core): update 2020-09-12 13:11:10 +00:00
537902aa53 1.0.41 2020-07-29 17:32:28 +00:00
e033bfa5b3 fix(core): update 2020-07-29 17:32:28 +00:00
4983e1ed90 1.0.40 2020-07-27 18:23:48 +00:00
899775b050 fix(core): update 2020-07-27 18:23:47 +00:00
7655fc0348 1.0.39 2020-07-27 17:11:01 +00:00
8aa5576318 fix(core): update 2020-07-27 17:11:00 +00:00
1ff54b0fcd 1.0.38 2020-07-15 18:58:40 +00:00
3901258272 fix(core): update 2020-07-15 18:58:40 +00:00
27380d1483 1.0.37 2020-07-15 18:12:27 +00:00
e2f9991f96 fix(core): update 2020-07-15 18:12:27 +00:00
133ce80b0a 1.0.36 2020-06-30 14:08:35 +00:00
cf12f45c9b fix(core): update 2020-06-30 14:08:35 +00:00
6cc5ec315e 1.0.35 2020-06-28 21:26:57 +00:00
88810bae2c fix(core): update 2020-06-28 21:26:57 +00:00
21369d8da5 1.0.34 2020-06-28 18:03:23 +00:00
a5973944ee fix(core): update 2020-06-28 18:03:22 +00:00
11 changed files with 8971 additions and 1023 deletions

View File

@ -19,23 +19,35 @@ mirror:
stage: security stage: security
script: script:
- npmci git mirror - npmci git mirror
only:
- tags
tags: tags:
- lossless - lossless
- docker - docker
- notpriv - notpriv
audit: auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high - npmci command npm audit --audit-level=high --only=dev
tags: tags:
- lossless
- docker - docker
- notpriv allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -50,9 +62,7 @@ testStable:
- npmci npm test - npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- priv
testBuild: testBuild:
stage: test stage: test
@ -63,9 +73,7 @@ testBuild:
- npmci command npm run build - npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- notpriv
release: release:
stage: release stage: release
@ -85,6 +93,8 @@ release:
codequality: codequality:
stage: metadata stage: metadata
allow_failure: true allow_failure: true
only:
- tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g tslint typescript
- npmci npm prepare - npmci npm prepare

View File

@ -15,7 +15,7 @@
"properties": { "properties": {
"projectType": { "projectType": {
"type": "string", "type": "string",
"enum": ["website", "element", "service", "npm"] "enum": ["website", "element", "service", "npm", "wcc"]
} }
} }
} }

9853
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.33", "version": "1.0.43",
"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",
@ -13,23 +13,24 @@
"format": "(gitzone format)" "format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.0.22", "@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsbundle": "^1.0.69", "@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.15", "@gitzone/tstest": "^1.0.44",
"@pushrocks/tapbundle": "^3.0.7", "@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.0.5", "@types/node": "^14.10.1",
"tslint": "^6.1.2", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
}, },
"dependencies": { "dependencies": {
"@apiglobal/typedrequest": "^1.0.38", "@apiglobal/typedrequest": "^1.0.43",
"@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.4.0",
"sweet-scroll": "^4.0.0" "sweet-scroll": "^4.0.0"
}, },
"files": [ "files": [
@ -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
View 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();

View File

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

View File

@ -4,6 +4,8 @@ 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';
import { setupGlobalTheme } from './domtools.css.theme';
export interface IDomToolsState { export interface IDomToolsState {
virtualViewport: TViewport; virtualViewport: TViewport;
@ -21,6 +23,10 @@ export class DomTools {
if (!globalThis.deesDomTools) { if (!globalThis.deesDomTools) {
globalThis.deesDomTools = new DomTools(); globalThis.deesDomTools = new DomTools();
domToolsInstance = globalThis.deesDomTools; domToolsInstance = globalThis.deesDomTools;
// lets setup theming
setupGlobalTheme(domToolsInstance);
// lets make sure the dom is ready // lets make sure the dom is ready
const readyStateChangedFunc = () => { const readyStateChangedFunc = () => {
if (document.readyState === 'interactive' || document.readyState === 'complete') { if (document.readyState === 'interactive' || document.readyState === 'complete') {
@ -38,6 +44,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 +76,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>(

View File

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

27
ts/domtools.css.theme.ts Normal file
View File

@ -0,0 +1,27 @@
import { DomTools } from './domtools.classes.domtools';
export const setupGlobalTheme = (domToolsInstance: DomTools) => {
const styles = `
/* width */
::-webkit-scrollbar {
width: 8px;
}
/* Track */
::-webkit-scrollbar-track {
background: #111;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #666;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #777;
}
`;
domToolsInstance.setGlobalStyles(styles);
};

View File

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

View File

@ -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,
};