fix(core): update
This commit is contained in:
parent
c467a92e7c
commit
d5732822e4
18
package-lock.json
generated
18
package-lock.json
generated
@ -1381,15 +1381,15 @@
|
|||||||
"integrity": "sha512-P1xLsuA1+8LQpoWCo2nP2vIQXKGUl5wDWU6CD7xTDZc3uw0He5V/qCPHM5zpIZsS7IuZOxDDpWb7aFveB11tXw=="
|
"integrity": "sha512-P1xLsuA1+8LQpoWCo2nP2vIQXKGUl5wDWU6CD7xTDZc3uw0He5V/qCPHM5zpIZsS7IuZOxDDpWb7aFveB11tXw=="
|
||||||
},
|
},
|
||||||
"@pushrocks/lik": {
|
"@pushrocks/lik": {
|
||||||
"version": "4.0.17",
|
"version": "4.0.20",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.17.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.20.tgz",
|
||||||
"integrity": "sha512-K5dX3k3i7iVxFMJ+IYwJRljewukJCc2zgj6+88R18/8SajVAq7ITOl3/FTbmEPFCJv5rl/LQ9FtcMynWlwSlzQ==",
|
"integrity": "sha512-DJbxSZFwDuHe4W7dU5anyO72gy4woZpkxSpySphdHbSYZf50VJ1sMOKIccSpgRIczeB0BTR5i0c+cKnNFrg2jw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartmatch": "^1.0.7",
|
"@pushrocks/smartmatch": "^1.0.7",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.1.3",
|
||||||
"@pushrocks/smartrx": "^2.0.17",
|
"@pushrocks/smartrx": "^2.0.19",
|
||||||
"@pushrocks/smarttime": "^3.0.24",
|
"@pushrocks/smarttime": "^3.0.37",
|
||||||
"@types/minimatch": "^3.0.3",
|
"@types/minimatch": "^3.0.3",
|
||||||
"symbol-tree": "^3.2.4"
|
"symbol-tree": "^3.2.4"
|
||||||
}
|
}
|
||||||
@ -2458,9 +2458,9 @@
|
|||||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "14.14.6",
|
"version": "14.14.9",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.14.6.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.14.9.tgz",
|
||||||
"integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw=="
|
"integrity": "sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw=="
|
||||||
},
|
},
|
||||||
"@types/parcel-bundler": {
|
"@types/parcel-bundler": {
|
||||||
"version": "1.12.1",
|
"version": "1.12.1",
|
||||||
|
@ -17,14 +17,14 @@
|
|||||||
"@gitzone/tsbundle": "^1.0.78",
|
"@gitzone/tsbundle": "^1.0.78",
|
||||||
"@gitzone/tstest": "^1.0.52",
|
"@gitzone/tstest": "^1.0.52",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
"@types/node": "^14.14.6",
|
"@types/node": "^14.14.9",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apiglobal/typedrequest": "^1.0.54",
|
"@apiglobal/typedrequest": "^1.0.54",
|
||||||
"@designestate/dees-comms": "^1.0.7",
|
"@designestate/dees-comms": "^1.0.7",
|
||||||
"@pushrocks/lik": "^4.0.17",
|
"@pushrocks/lik": "^4.0.20",
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartpromise": "^3.1.3",
|
"@pushrocks/smartpromise": "^3.1.3",
|
||||||
"@pushrocks/smartrouter": "^1.0.4",
|
"@pushrocks/smartrouter": "^1.0.4",
|
||||||
|
@ -8,15 +8,19 @@ export class ElementInstrumenter {
|
|||||||
const originalConnectedCallback = elementArg.connectedCallback;
|
const originalConnectedCallback = elementArg.connectedCallback;
|
||||||
const originalDisconnectedCallback = elementArg.disconnectedCallback;
|
const originalDisconnectedCallback = elementArg.disconnectedCallback;
|
||||||
|
|
||||||
elementArg.connectedCallback = () => {
|
if (!elementArg.parentElement) {
|
||||||
|
elementArg.connectedCallback = () => {
|
||||||
|
this.connectedElements.add(elementArg);
|
||||||
|
originalConnectedCallback.apply(elementArg);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
this.connectedElements.add(elementArg);
|
this.connectedElements.add(elementArg);
|
||||||
originalConnectedCallback.apply(elementArg);
|
}
|
||||||
};
|
|
||||||
elementArg.disconnectedCallback = () => {
|
elementArg.disconnectedCallback = () => {
|
||||||
this.connectedElements.remove(elementArg);
|
this.connectedElements.remove(elementArg);
|
||||||
originalDisconnectedCallback.apply(elementArg);
|
originalDisconnectedCallback.apply(elementArg);
|
||||||
};
|
};
|
||||||
this.connectedElements.add(elementArg);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,28 +1,35 @@
|
|||||||
|
import { LitElement } from 'lit-element';
|
||||||
import { DomTools } from './domtools.classes.domtools';
|
import { DomTools } from './domtools.classes.domtools';
|
||||||
import * as plugins from './domtools.plugins';
|
import * as plugins from './domtools.plugins';
|
||||||
|
|
||||||
export class ThemeManager {
|
export class ThemeManager {
|
||||||
public domtoolsRef: DomTools;
|
public domtoolsRef: DomTools;
|
||||||
|
|
||||||
|
goBrightBoolean = false;
|
||||||
|
|
||||||
constructor(domtoolsRefArg: DomTools) {
|
constructor(domtoolsRefArg: DomTools) {
|
||||||
this.domtoolsRef = domtoolsRefArg;
|
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() {
|
public goBright() {
|
||||||
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
||||||
const goBright = (elementArg as any).goBright;
|
await this.setThemeStatusForElement(elementArg, true);
|
||||||
if (typeof goBright === 'boolean') {
|
|
||||||
(elementArg as any).goBright = true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public goDark() {
|
public goDark() {
|
||||||
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
||||||
const goBright = (elementArg as any).goBright;
|
await this.setThemeStatusForElement(elementArg, false);
|
||||||
if (typeof goBright === 'boolean') {
|
|
||||||
(elementArg as any).goBright = false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user