@wlloyalty/wll-react-sdk 1.0.94 → 1.0.96
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/native.js +15 -0
- package/dist/native.js.map +1 -1
- package/dist/web.js +15 -0
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/native.js
CHANGED
|
@@ -1682,6 +1682,7 @@ var validateTheme = function (theme) {
|
|
|
1682
1682
|
'negative',
|
|
1683
1683
|
'text',
|
|
1684
1684
|
];
|
|
1685
|
+
// fontFamily is optional - it has a default value in defaultTheme
|
|
1685
1686
|
return requiredColors.every(function (color) { return theme[color] && isValidColor(theme[color]); });
|
|
1686
1687
|
};
|
|
1687
1688
|
/**
|
|
@@ -1918,6 +1919,12 @@ function useResponsive() {
|
|
|
1918
1919
|
var createTheme = function (baseTheme) {
|
|
1919
1920
|
if (baseTheme === void 0) { baseTheme = {}; }
|
|
1920
1921
|
var mergedTheme = __assign(__assign({}, defaultTheme), baseTheme);
|
|
1922
|
+
// Always log theme information to help with debugging
|
|
1923
|
+
console.debug('[WLL SDK] Theme created:', {
|
|
1924
|
+
fontFamily: mergedTheme.fontFamily,
|
|
1925
|
+
baseTheme: baseTheme === null || baseTheme === void 0 ? void 0 : baseTheme.fontFamily,
|
|
1926
|
+
defaultTheme: defaultTheme.fontFamily,
|
|
1927
|
+
});
|
|
1921
1928
|
return __assign(__assign({}, mergedTheme), { sizes: sizes, derivedBackground: getDerivedColor(mergedTheme.background), primaryText: getReadableTextColor(mergedTheme.primary), accentText: getReadableTextColor(mergedTheme.accent), positiveText: getReadableTextColor(mergedTheme.positive), negativeText: getReadableTextColor(mergedTheme.negative), derivedSurface: getDerivedColorPercentages(mergedTheme.surface), derivedSurfaceText: getDerivedColorPercentages(mergedTheme.surfaceText), alphaDerivedPrimary: getAlphaDerivedColors(mergedTheme.primary), alphaDerivedText: getAlphaDerivedColors(mergedTheme.text) });
|
|
1922
1929
|
};
|
|
1923
1930
|
var WllSdkContext = React.createContext(undefined);
|
|
@@ -1936,6 +1943,14 @@ var WllSdkProvider = function (_a) {
|
|
|
1936
1943
|
if (!validateTheme(themeToUse)) {
|
|
1937
1944
|
console.warn('Invalid theme provided. Some required colors are missing or invalid.');
|
|
1938
1945
|
}
|
|
1946
|
+
// Always log theme updates to help with debugging
|
|
1947
|
+
console.debug('[WLL SDK] Theme update details:', {
|
|
1948
|
+
'providedTheme (full)': providedTheme,
|
|
1949
|
+
'themeToUse.fontFamily': themeToUse.fontFamily,
|
|
1950
|
+
'providedTheme.fontFamily': providedTheme === null || providedTheme === void 0 ? void 0 : providedTheme.fontFamily,
|
|
1951
|
+
'defaultTheme.fontFamily': defaultTheme.fontFamily,
|
|
1952
|
+
'providedTheme keys': providedTheme ? Object.keys(providedTheme) : 'none',
|
|
1953
|
+
});
|
|
1939
1954
|
setThemeState(createTheme(themeToUse));
|
|
1940
1955
|
}, [providedTheme]);
|
|
1941
1956
|
var setTheme = React.useCallback(function (newTheme) {
|