fix(core): update

This commit is contained in:
Philipp Kunz 2020-11-24 19:18:59 +00:00
parent c467a92e7c
commit d5732822e4
4 changed files with 34 additions and 23 deletions

18
package-lock.json generated
View File

@ -1381,15 +1381,15 @@
"integrity": "sha512-P1xLsuA1+8LQpoWCo2nP2vIQXKGUl5wDWU6CD7xTDZc3uw0He5V/qCPHM5zpIZsS7IuZOxDDpWb7aFveB11tXw=="
},
"@pushrocks/lik": {
"version": "4.0.17",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.17.tgz",
"integrity": "sha512-K5dX3k3i7iVxFMJ+IYwJRljewukJCc2zgj6+88R18/8SajVAq7ITOl3/FTbmEPFCJv5rl/LQ9FtcMynWlwSlzQ==",
"version": "4.0.20",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.20.tgz",
"integrity": "sha512-DJbxSZFwDuHe4W7dU5anyO72gy4woZpkxSpySphdHbSYZf50VJ1sMOKIccSpgRIczeB0BTR5i0c+cKnNFrg2jw==",
"requires": {
"@pushrocks/smartdelay": "^2.0.10",
"@pushrocks/smartmatch": "^1.0.7",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrx": "^2.0.17",
"@pushrocks/smarttime": "^3.0.24",
"@pushrocks/smartpromise": "^3.1.3",
"@pushrocks/smartrx": "^2.0.19",
"@pushrocks/smarttime": "^3.0.37",
"@types/minimatch": "^3.0.3",
"symbol-tree": "^3.2.4"
}
@ -2458,9 +2458,9 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
},
"@types/node": {
"version": "14.14.6",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.14.6.tgz",
"integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw=="
"version": "14.14.9",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.14.9.tgz",
"integrity": "sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw=="
},
"@types/parcel-bundler": {
"version": "1.12.1",

View File

@ -17,14 +17,14 @@
"@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.14.6",
"@types/node": "^14.14.9",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@apiglobal/typedrequest": "^1.0.54",
"@designestate/dees-comms": "^1.0.7",
"@pushrocks/lik": "^4.0.17",
"@pushrocks/lik": "^4.0.20",
"@pushrocks/smartdelay": "^2.0.10",
"@pushrocks/smartpromise": "^3.1.3",
"@pushrocks/smartrouter": "^1.0.4",

View File

@ -8,15 +8,19 @@ export class ElementInstrumenter {
const originalConnectedCallback = elementArg.connectedCallback;
const originalDisconnectedCallback = elementArg.disconnectedCallback;
if (!elementArg.parentElement) {
elementArg.connectedCallback = () => {
this.connectedElements.add(elementArg);
originalConnectedCallback.apply(elementArg);
};
} else {
this.connectedElements.add(elementArg);
}
elementArg.disconnectedCallback = () => {
this.connectedElements.remove(elementArg);
originalDisconnectedCallback.apply(elementArg);
};
this.connectedElements.add(elementArg);
}

View File

@ -1,28 +1,35 @@
import { LitElement } from 'lit-element';
import { DomTools } from './domtools.classes.domtools';
import * as plugins from './domtools.plugins';
export class ThemeManager {
public domtoolsRef: DomTools;
goBrightBoolean = false;
constructor(domtoolsRefArg: DomTools) {
this.domtoolsRef = domtoolsRefArg;
this.domtoolsRef.elementInstrumenter.connectedElements.eventSubject.subscribe(async eventData => {
await this.setThemeStatusForElement(eventData.payload, this.goBrightBoolean);
});
}
private async setThemeStatusForElement (elementArg: LitElement, goBrightBool: boolean) {
const goBright = (elementArg as any).goBright;
if (typeof goBright === 'boolean') {
(elementArg as any).goBright = goBrightBool;
}
}
public goBright() {
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
const goBright = (elementArg as any).goBright;
if (typeof goBright === 'boolean') {
(elementArg as any).goBright = true;
}
await this.setThemeStatusForElement(elementArg, true);
});
}
public goDark() {
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
const goBright = (elementArg as any).goBright;
if (typeof goBright === 'boolean') {
(elementArg as any).goBright = false;
}
await this.setThemeStatusForElement(elementArg, false);
});
}
}