dsh-skin-galactic-opera 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/client.js +46 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.2.0 - 2026-09-04
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Pauses skin animation work while the page is hidden to reduce background CPU/GPU usage.
|
|
10
|
+
- Suspends telemetry scans while the page is hidden, then forces an immediate refresh plus a short follow-up when the page becomes visible again.
|
|
11
|
+
|
|
5
12
|
## 0.1.9 - 2026-09-03
|
|
6
13
|
|
|
7
14
|
### Changed
|
package/lib/client.js
CHANGED
|
@@ -11,6 +11,7 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
const STYLE_ID = "dsh-skin-galactic-opera-style";
|
|
12
12
|
const DECOR_ID = "dsh-skin-galactic-opera-decor";
|
|
13
13
|
const DECOR_HOST_CLASS = "dsh-skin-galactic-opera-decor-host";
|
|
14
|
+
const PAGE_HIDDEN_CLASS = "dsh-skin-galactic-opera-page-hidden";
|
|
14
15
|
const CSS_TAG_ID = `${PLUGIN_ID}/global.css`;
|
|
15
16
|
|
|
16
17
|
const TOKENS = Object.freeze({
|
|
@@ -170,6 +171,16 @@ body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-input-active :is(.dsh-skin-
|
|
|
170
171
|
opacity: 0.16 !important;
|
|
171
172
|
}
|
|
172
173
|
|
|
174
|
+
body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-page-hidden::before,
|
|
175
|
+
body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-page-hidden::after,
|
|
176
|
+
body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-page-hidden #root::before,
|
|
177
|
+
body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-page-hidden .dsh-skin-galactic-opera-decor::before,
|
|
178
|
+
body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-page-hidden .dsh-skin-galactic-opera-decor *,
|
|
179
|
+
body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-page-hidden .dsh-skin-galactic-opera-decor *::before,
|
|
180
|
+
body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-page-hidden .dsh-skin-galactic-opera-decor *::after {
|
|
181
|
+
animation-play-state: paused !important;
|
|
182
|
+
}
|
|
183
|
+
|
|
173
184
|
body.dsh-skin-galactic-opera #root > *,
|
|
174
185
|
body.dsh-skin-galactic-opera main,
|
|
175
186
|
body.dsh-skin-galactic-opera aside,
|
|
@@ -1149,6 +1160,7 @@ body.dsh-skin-galactic-opera .dsh-skin-telemetry-value-full {
|
|
|
1149
1160
|
return `${CSS
|
|
1150
1161
|
.replace(/body\.dsh-skin-galactic-opera\.dsh-skin-galactic-opera-input-active\s+/g, ":host-context(body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-input-active) ")
|
|
1151
1162
|
.replace(/body\.dsh-skin-galactic-opera\.dsh-skin-galactic-opera-hyperspace\s+/g, ":host-context(body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-hyperspace) ")
|
|
1163
|
+
.replace(/body\.dsh-skin-galactic-opera\.dsh-skin-galactic-opera-page-hidden\s+/g, ":host-context(body.dsh-skin-galactic-opera.dsh-skin-galactic-opera-page-hidden) ")
|
|
1152
1164
|
.replace(/body\.dsh-skin-galactic-opera\s+/g, "")}
|
|
1153
1165
|
|
|
1154
1166
|
.dsh-skin-galactic-opera-decor {
|
|
@@ -1249,6 +1261,20 @@ body.dsh-skin-galactic-opera .dsh-skin-telemetry-value-full {
|
|
|
1249
1261
|
}
|
|
1250
1262
|
|
|
1251
1263
|
const EDITABLE_CONTENT_SELECTOR = `[contenteditable]:not([contenteditable="false"])`;
|
|
1264
|
+
|
|
1265
|
+
function installVisibilityState() {
|
|
1266
|
+
if (typeof document === "undefined" || typeof window === "undefined") return () => {};
|
|
1267
|
+
const syncVisibilityClass = () => {
|
|
1268
|
+
document.body.classList.toggle(PAGE_HIDDEN_CLASS, document.hidden);
|
|
1269
|
+
};
|
|
1270
|
+
syncVisibilityClass();
|
|
1271
|
+
document.addEventListener("visibilitychange", syncVisibilityClass);
|
|
1272
|
+
return () => {
|
|
1273
|
+
document.removeEventListener("visibilitychange", syncVisibilityClass);
|
|
1274
|
+
document.body.classList.remove(PAGE_HIDDEN_CLASS);
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1252
1278
|
let reducedMotionQuery;
|
|
1253
1279
|
let reducedMotionMatches = false;
|
|
1254
1280
|
let reducedMotionListener;
|
|
@@ -1676,7 +1702,7 @@ body.dsh-skin-galactic-opera .dsh-skin-telemetry-value-full {
|
|
|
1676
1702
|
const update = ({ ignorePause = false } = {}) => {
|
|
1677
1703
|
frame = 0;
|
|
1678
1704
|
frameIgnoresTelemetryPause = false;
|
|
1679
|
-
if (!ignorePause && isTelemetryPaused()) return;
|
|
1705
|
+
if (document.hidden || (!ignorePause && isTelemetryPaused())) return;
|
|
1680
1706
|
let nextSources = currentSources;
|
|
1681
1707
|
let text = getSourcesText(nextSources);
|
|
1682
1708
|
const needsFullScan = forceTelemetryRescan || telemetryRefreshesSinceFullScan >= TELEMETRY_FULL_RESCAN_UPDATES || !areCachedSourcesUsable();
|
|
@@ -1696,7 +1722,7 @@ body.dsh-skin-galactic-opera .dsh-skin-telemetry-value-full {
|
|
|
1696
1722
|
renderPanel(text);
|
|
1697
1723
|
};
|
|
1698
1724
|
const schedule = ({ delay = TELEMETRY_UPDATE_DELAY, force = false, ignorePause = false } = {}) => {
|
|
1699
|
-
if (!ignorePause && isTelemetryPaused()) return;
|
|
1725
|
+
if (document.hidden || (!ignorePause && isTelemetryPaused())) return;
|
|
1700
1726
|
if (force) forceTelemetryRescan = true;
|
|
1701
1727
|
if (frame !== 0) {
|
|
1702
1728
|
if (!force && delay >= TELEMETRY_UPDATE_DELAY) return;
|
|
@@ -1778,6 +1804,20 @@ body.dsh-skin-galactic-opera .dsh-skin-telemetry-value-full {
|
|
|
1778
1804
|
forceTelemetryRescan = true;
|
|
1779
1805
|
schedule();
|
|
1780
1806
|
};
|
|
1807
|
+
const onTelemetryVisibilityChange = () => {
|
|
1808
|
+
if (document.hidden) {
|
|
1809
|
+
if (frame !== 0) {
|
|
1810
|
+
window.clearTimeout(frame);
|
|
1811
|
+
frame = 0;
|
|
1812
|
+
}
|
|
1813
|
+
frameIgnoresTelemetryPause = false;
|
|
1814
|
+
for (const timer of telemetryNavigationTimers) window.clearTimeout(timer);
|
|
1815
|
+
telemetryNavigationTimers.clear();
|
|
1816
|
+
return;
|
|
1817
|
+
}
|
|
1818
|
+
schedule({ delay: 0, force: true, ignorePause: true });
|
|
1819
|
+
setTelemetryNavigationTimer(() => schedule({ delay: 0, force: true, ignorePause: true }), TELEMETRY_NAV_FOLLOWUP_DELAY);
|
|
1820
|
+
};
|
|
1781
1821
|
const observer = typeof MutationObserver === "undefined" ? undefined : new MutationObserver((mutations) => {
|
|
1782
1822
|
if (mutations.every(isSkinOwnedMutation)) return;
|
|
1783
1823
|
if (isTelemetryPaused() && mutations.some(isPotentialTelemetryNavigationMutation)) {
|
|
@@ -1790,6 +1830,7 @@ body.dsh-skin-galactic-opera .dsh-skin-telemetry-value-full {
|
|
|
1790
1830
|
schedule();
|
|
1791
1831
|
observer?.observe(document.body, { childList: true, subtree: true, characterData: true });
|
|
1792
1832
|
window.addEventListener("resize", onTelemetryResize, { passive: true });
|
|
1833
|
+
document.addEventListener("visibilitychange", onTelemetryVisibilityChange);
|
|
1793
1834
|
window.addEventListener("popstate", checkTelemetryLocation, { passive: true });
|
|
1794
1835
|
window.addEventListener("hashchange", checkTelemetryLocation, { passive: true });
|
|
1795
1836
|
document.addEventListener("click", onTelemetryNavigationClick, true);
|
|
@@ -1800,6 +1841,7 @@ body.dsh-skin-galactic-opera .dsh-skin-telemetry-value-full {
|
|
|
1800
1841
|
if (telemetryPushState !== undefined && window.history.pushState === telemetryPushState) window.history.pushState = originalPushState;
|
|
1801
1842
|
if (telemetryReplaceState !== undefined && window.history.replaceState === telemetryReplaceState) window.history.replaceState = originalReplaceState;
|
|
1802
1843
|
window.removeEventListener("resize", onTelemetryResize);
|
|
1844
|
+
document.removeEventListener("visibilitychange", onTelemetryVisibilityChange);
|
|
1803
1845
|
window.removeEventListener("popstate", checkTelemetryLocation);
|
|
1804
1846
|
window.removeEventListener("hashchange", checkTelemetryLocation);
|
|
1805
1847
|
document.removeEventListener("click", onTelemetryNavigationClick, true);
|
|
@@ -1821,12 +1863,14 @@ body.dsh-skin-galactic-opera .dsh-skin-telemetry-value-full {
|
|
|
1821
1863
|
ctx.effect(() => {
|
|
1822
1864
|
const style = ensureStyle();
|
|
1823
1865
|
if (typeof document !== "undefined") document.body.classList.add("dsh-skin-galactic-opera");
|
|
1866
|
+
const disposeVisibilityState = installVisibilityState();
|
|
1824
1867
|
const decor = ensureDecor();
|
|
1825
1868
|
const disposeInteractions = installInteractions(decor);
|
|
1826
1869
|
const disposeTelemetryPanel = installTelemetryPanel();
|
|
1827
1870
|
return () => {
|
|
1828
1871
|
disposeTelemetryPanel();
|
|
1829
1872
|
disposeInteractions();
|
|
1873
|
+
disposeVisibilityState();
|
|
1830
1874
|
disposeReducedMotionCache();
|
|
1831
1875
|
if (typeof document !== "undefined") document.body.classList.remove("dsh-skin-galactic-opera");
|
|
1832
1876
|
decor?.remove();
|