claude-code-marketplace 0.5.13 → 0.6.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
|
@@ -1466,4 +1466,24 @@ function hubNavigate(app, url) {
|
|
|
1466
1466
|
if (!window.__HUB__?.enabled) return;
|
|
1467
1467
|
window.parent?.postMessage({ type: 'hub:navigate', app, url }, '*');
|
|
1468
1468
|
}
|
|
1469
|
+
|
|
1470
|
+
(function initHubTheme() {
|
|
1471
|
+
const getTheme = () => (document.body.classList.contains('light') ? 'light' : 'dark');
|
|
1472
|
+
const hubOrigin = () => (window.__HUB__?.url ? new URL(window.__HUB__.url).origin : null);
|
|
1473
|
+
let lastTheme = getTheme();
|
|
1474
|
+
window.addEventListener('message', (e) => {
|
|
1475
|
+
if (e.source !== window.parent || e.origin !== hubOrigin()) return;
|
|
1476
|
+
if (e.data?.type !== 'hub:theme') return;
|
|
1477
|
+
if (getTheme() === e.data.theme) return;
|
|
1478
|
+
window.toggleTheme();
|
|
1479
|
+
lastTheme = getTheme();
|
|
1480
|
+
});
|
|
1481
|
+
new MutationObserver(() => {
|
|
1482
|
+
const t = getTheme();
|
|
1483
|
+
if (t === lastTheme) return;
|
|
1484
|
+
lastTheme = t;
|
|
1485
|
+
const origin = hubOrigin();
|
|
1486
|
+
if (origin) window.parent.postMessage({ type: 'hub:theme', theme: t }, origin);
|
|
1487
|
+
}).observe(document.body, { attributes: true, attributeFilter: ['class'] });
|
|
1488
|
+
})();
|
|
1469
1489
|
// #endregion HUB_INTEGRATION
|