@propknot/shared-ui 1.0.19 → 1.0.21
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/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1529,7 +1529,10 @@ var CustomThemeProvider = ({ children }) => {
|
|
|
1529
1529
|
if (!event.origin.startsWith("http://localhost:")) return;
|
|
1530
1530
|
const { type, theme } = event.data;
|
|
1531
1531
|
if (type === "THEME_CHANGE" && theme && ["light", "dark"].includes(theme)) {
|
|
1532
|
+
console.log("[ThemeContext] Setting theme to:", theme);
|
|
1532
1533
|
setCurrentTheme(theme);
|
|
1534
|
+
} else if (type === "THEME_CHANGE") {
|
|
1535
|
+
console.log("[ThemeContext] Rejected theme change:", theme, "Valid:", ["light", "dark"].includes(theme));
|
|
1533
1536
|
}
|
|
1534
1537
|
};
|
|
1535
1538
|
window.addEventListener("message", handleMessage);
|
|
@@ -1584,7 +1587,7 @@ var CustomThemeProvider = ({ children }) => {
|
|
|
1584
1587
|
}
|
|
1585
1588
|
return (user == null ? void 0 : user.preferredBrandingColor) || 0;
|
|
1586
1589
|
};
|
|
1587
|
-
const effectiveTheme = user ? currentTheme : "light";
|
|
1590
|
+
const effectiveTheme = user || isEmbedded ? currentTheme : "light";
|
|
1588
1591
|
const themeObject = effectiveTheme === "dark" ? darkTheme : lightTheme;
|
|
1589
1592
|
const isDarkMode = effectiveTheme === "dark";
|
|
1590
1593
|
const effectiveBrandingColor = getEffectiveBrandingColor();
|