@wlloyalty/wll-react-sdk 1.0.105 → 1.0.107

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
@@ -1655,6 +1655,13 @@ var EventEmitter = /** @class */ (function () {
1655
1655
  */
1656
1656
  var sdkEventEmitter = new EventEmitter();
1657
1657
 
1658
+ var IS_WEB = reactNative.Platform.OS === "web";
1659
+ var IS_IOS = reactNative.Platform.OS === "ios";
1660
+ var IS_ANDROID = reactNative.Platform.OS === "android";
1661
+ var IS_MOBILE = IS_IOS || IS_ANDROID;
1662
+ var _a$1 = reactNative.Dimensions.get("window"), width = _a$1.width; _a$1.height;
1663
+ var SCREEN_WIDTH = width;
1664
+
1658
1665
  var sizes = {
1659
1666
  borderRadiusSm: 15,
1660
1667
  borderRadiusLg: 20,
@@ -1693,13 +1700,24 @@ var defaultTheme = {
1693
1700
  positive: '#008000',
1694
1701
  negative: '#ff0000',
1695
1702
  };
1696
-
1697
- var IS_WEB = reactNative.Platform.OS === "web";
1698
- var IS_IOS = reactNative.Platform.OS === "ios";
1699
- var IS_ANDROID = reactNative.Platform.OS === "android";
1700
- var IS_MOBILE = IS_IOS || IS_ANDROID;
1701
- var _a$1 = reactNative.Dimensions.get("window"), width = _a$1.width; _a$1.height;
1702
- var SCREEN_WIDTH = width;
1703
+ /**
1704
+ * Creates appropriate directional margin styles for both web and native platforms.
1705
+ * Handles RTL layouts correctly across platforms by using the I18nManager.
1706
+ *
1707
+ * @param value - The margin value to apply
1708
+ * @returns An object with the appropriate margin style property
1709
+ */
1710
+ var getDirectionalMargin = function (value) {
1711
+ if (IS_WEB) {
1712
+ // Check document direction for web
1713
+ // We need to use this because React Native Web does not support I18nManager
1714
+ // and marginStart/marginEnd resolves to margin-left/margin-right and not margin-inline-start/end
1715
+ var isRTL = typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
1716
+ return isRTL ? { marginLeft: value } : { marginRight: value };
1717
+ }
1718
+ // For native platforms, use marginEnd which automatically handles RTL
1719
+ return { marginEnd: value };
1720
+ };
1703
1721
 
1704
1722
  var COLOR_CONSTANTS = {
1705
1723
  MINIMUM_CONTRAST_RATIO: 2,
@@ -3422,14 +3440,7 @@ var useBannerTileStyles = function () {
3422
3440
  slideContent: {
3423
3441
  flex: 1,
3424
3442
  },
3425
- mediaContainer: {
3426
- aspectRatio: 1,
3427
- position: 'relative',
3428
- overflow: 'hidden',
3429
- marginRight: useResponsiveValue(theme.sizes.xxl, theme.sizes.xxs, isDesktop, isTablet),
3430
- maxHeight: useResponsiveValue(253, 120, isDesktop, isTablet),
3431
- minHeight: 120,
3432
- },
3443
+ mediaContainer: __assign(__assign({ aspectRatio: 1, position: 'relative', overflow: 'hidden' }, getDirectionalMargin(useResponsiveValue(theme.sizes.xxl, theme.sizes.xxs, isDesktop, isTablet))), { maxHeight: useResponsiveValue(253, 120, isDesktop, isTablet), minHeight: 120 }),
3433
3444
  media: {
3434
3445
  position: 'absolute',
3435
3446
  width: '100%',
@@ -3583,11 +3594,7 @@ var useContentTileStyles = function (hasArtwork) {
3583
3594
  flex: 1,
3584
3595
  },
3585
3596
  header: getHeaderStyle(hasArtwork),
3586
- tileTitle: {
3587
- maxWidth: '90%',
3588
- flex: 1,
3589
- marginRight: 8,
3590
- },
3597
+ tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
3591
3598
  });
3592
3599
  };
3593
3600
 
@@ -4016,7 +4023,7 @@ var Grid = function (_a) {
4016
4023
  tileContainers.push(jsxRuntimeExports.jsx(reactNative.View, { style: [
4017
4024
  // @ts-ignore Web uses CSS calc strings for responsive layouts, while ViewStyle expects numbers
4018
4025
  getTileWidth(columnsPerRow),
4019
- !isLastInRow && { marginRight: GRID_GAP },
4026
+ !isLastInRow && getDirectionalMargin(GRID_GAP),
4020
4027
  ], children: jsxRuntimeExports.jsx(TileContainer, { tiles: currentTiles }) }, "container-".concat(index)));
4021
4028
  currentTiles = [];
4022
4029
  }
@@ -4795,11 +4802,7 @@ var useRewardTileStyles = function () {
4795
4802
  width: '100%',
4796
4803
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
4797
4804
  },
4798
- tileTitle: {
4799
- maxWidth: '90%',
4800
- flex: 1,
4801
- marginRight: 8,
4802
- },
4805
+ tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
4803
4806
  });
4804
4807
  };
4805
4808