@wlloyalty/wll-react-sdk 1.0.97 → 1.0.99

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 CHANGED
@@ -1680,11 +1680,14 @@ var validateTheme = function (theme) {
1680
1680
  'surfaceText',
1681
1681
  'text',
1682
1682
  ];
1683
- // fontFamily is optional - it has a default value in defaultTheme
1684
- // Log missing or invalid colors for debugging
1685
1683
  var missingOrInvalidColors = requiredColors.filter(function (color) { return !theme[color] || !isValidColor(theme[color]); });
1686
1684
  if (missingOrInvalidColors.length > 0) {
1687
- console.warn('[WLL SDK] Missing or invalid required colors:', missingOrInvalidColors);
1685
+ console.warn('Theme validation failed. Missing or invalid colors:', missingOrInvalidColors.map(function (color) { return ({
1686
+ color: color,
1687
+ value: theme[color],
1688
+ exists: !!theme[color],
1689
+ isValid: theme[color] ? isValidColor(theme[color]) : false,
1690
+ }); }));
1688
1691
  }
1689
1692
  return missingOrInvalidColors.length === 0;
1690
1693
  };
@@ -1695,7 +1698,11 @@ var validateTheme = function (theme) {
1695
1698
  */
1696
1699
  var createSafeColor = function (color) {
1697
1700
  try {
1698
- return Color(color);
1701
+ var colorInstance = Color(color);
1702
+ console.log('Original color:', color);
1703
+ console.log('Color instance toString:', colorInstance.toString());
1704
+ console.log('Color instance hex:', colorInstance.hex());
1705
+ return colorInstance;
1699
1706
  }
1700
1707
  catch (error) {
1701
1708
  console.error("Invalid color value: ".concat(color), error);
@@ -1922,12 +1929,6 @@ function useResponsive() {
1922
1929
  var createTheme = function (baseTheme) {
1923
1930
  if (baseTheme === void 0) { baseTheme = {}; }
1924
1931
  var mergedTheme = __assign(__assign({}, defaultTheme), baseTheme);
1925
- // Always log theme information to help with debugging
1926
- console.debug('[WLL SDK] Theme created:', {
1927
- fontFamily: mergedTheme.fontFamily,
1928
- baseTheme: baseTheme === null || baseTheme === void 0 ? void 0 : baseTheme.fontFamily,
1929
- defaultTheme: defaultTheme.fontFamily,
1930
- });
1931
1932
  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) });
1932
1933
  };
1933
1934
  var WllSdkContext = React.createContext(undefined);
@@ -1946,14 +1947,6 @@ var WllSdkProvider = function (_a) {
1946
1947
  if (!validateTheme(themeToUse)) {
1947
1948
  console.warn('Invalid theme provided. Some required colors are missing or invalid.');
1948
1949
  }
1949
- // Always log theme updates to help with debugging
1950
- console.debug('[WLL SDK] Theme update details:', {
1951
- 'providedTheme (full)': providedTheme,
1952
- 'themeToUse.fontFamily': themeToUse.fontFamily,
1953
- 'providedTheme.fontFamily': providedTheme === null || providedTheme === void 0 ? void 0 : providedTheme.fontFamily,
1954
- 'defaultTheme.fontFamily': defaultTheme.fontFamily,
1955
- 'providedTheme keys': providedTheme ? Object.keys(providedTheme) : 'none',
1956
- });
1957
1950
  setThemeState(createTheme(themeToUse));
1958
1951
  }, [providedTheme]);
1959
1952
  var setTheme = React.useCallback(function (newTheme) {
@@ -2321,6 +2314,7 @@ var Text = function (_a) {
2321
2314
  var baseTextStyle = {
2322
2315
  fontFamily: theme.fontFamily,
2323
2316
  };
2317
+ // NOTE: We must apply fontFamily as base style to ensure it's always applied
2324
2318
  return jsxRuntimeExports.jsx(reactNative.Text, __assign({ style: [baseTextStyle, variantStyle, style] }, props));
2325
2319
  };
2326
2320