claude-code-cost 0.6.3 → 0.7.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/package.json +1 -1
- package/public/app.js +20 -0
package/package.json
CHANGED
package/public/app.js
CHANGED
|
@@ -1303,6 +1303,26 @@ window.hubNavigate = function hubNavigate(app, url) {
|
|
|
1303
1303
|
window.parent?.postMessage({ type: 'hub:navigate', app, url }, '*');
|
|
1304
1304
|
};
|
|
1305
1305
|
|
|
1306
|
+
(function initHubTheme() {
|
|
1307
|
+
const getTheme = () => (document.body.classList.contains('light') ? 'light' : 'dark');
|
|
1308
|
+
const hubOrigin = () => (window.__HUB__?.url ? new URL(window.__HUB__.url).origin : null);
|
|
1309
|
+
let lastTheme = getTheme();
|
|
1310
|
+
window.addEventListener('message', (e) => {
|
|
1311
|
+
if (e.source !== window.parent || e.origin !== hubOrigin()) return;
|
|
1312
|
+
if (e.data?.type !== 'hub:theme') return;
|
|
1313
|
+
if (getTheme() === e.data.theme) return;
|
|
1314
|
+
window.toggleTheme();
|
|
1315
|
+
lastTheme = getTheme();
|
|
1316
|
+
});
|
|
1317
|
+
new MutationObserver(() => {
|
|
1318
|
+
const t = getTheme();
|
|
1319
|
+
if (t === lastTheme) return;
|
|
1320
|
+
lastTheme = t;
|
|
1321
|
+
const origin = hubOrigin();
|
|
1322
|
+
if (origin) window.parent.postMessage({ type: 'hub:theme', theme: t }, origin);
|
|
1323
|
+
}).observe(document.body, { attributes: true, attributeFilter: ['class'] });
|
|
1324
|
+
})();
|
|
1325
|
+
|
|
1306
1326
|
// #endregion
|
|
1307
1327
|
|
|
1308
1328
|
// #region INIT
|