@wlloyalty/wll-react-sdk 1.4.10 → 1.5.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/dist/index.d.ts CHANGED
@@ -183,6 +183,7 @@ declare class ContentTileConfig {
183
183
  artworkUrl?: string | null;
184
184
  ctaLinkTarget?: CTALinkTarget;
185
185
  ctaLink?: string | null;
186
+ isLocked?: boolean;
186
187
  }
187
188
  declare class RewardTileConfig {
188
189
  rewardId: string;
@@ -190,6 +191,7 @@ declare class RewardTileConfig {
190
191
  showPrice: boolean;
191
192
  showArtwork?: boolean;
192
193
  showDetails?: boolean;
194
+ isLocked?: boolean;
193
195
  id: string;
194
196
  createdAt: string;
195
197
  updatedAt: string;
@@ -222,6 +224,7 @@ declare class VenueTileConfig {
222
224
  name: string;
223
225
  artworkUrl: string;
224
226
  description: string;
227
+ isLocked?: boolean;
225
228
  }
226
229
  declare enum BadgeTileType {
227
230
  Specific = "SPECIFIC",
package/dist/native.js CHANGED
@@ -2784,6 +2784,9 @@ var shouldHideContentForHalfTile = function (sizeInfo, artworkUrl) {
2784
2784
  };
2785
2785
 
2786
2786
  var baseStyles = reactNative.StyleSheet.create({
2787
+ imageContainer: {
2788
+ position: 'relative',
2789
+ },
2787
2790
  container: {
2788
2791
  width: '100%',
2789
2792
  height: '100%',
@@ -2820,6 +2823,17 @@ var useBaseTileStyles = function () {
2820
2823
  justifyContent: 'space-between',
2821
2824
  },
2822
2825
  media: baseStyles.media,
2826
+ lockOverlay: {
2827
+ position: 'absolute',
2828
+ top: 0,
2829
+ left: 0,
2830
+ right: 0,
2831
+ bottom: 0,
2832
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
2833
+ justifyContent: 'center',
2834
+ alignItems: 'center',
2835
+ zIndex: 10,
2836
+ },
2823
2837
  });
2824
2838
  }
2825
2839
  var sizeInfo = useTileSize(tileContext);
@@ -2839,6 +2853,17 @@ var useBaseTileStyles = function () {
2839
2853
  textAlign: isHalfSize ? 'center' : undefined,
2840
2854
  },
2841
2855
  media: __assign(__assign({}, baseStyles.media), { flexBasis: !isHalfSize && title && body ? '50%' : '100%', height: isHalfSize ? '100%' : undefined }),
2856
+ lockOverlay: {
2857
+ position: 'absolute',
2858
+ top: 0,
2859
+ left: 0,
2860
+ right: 0,
2861
+ bottom: 0,
2862
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
2863
+ justifyContent: 'center',
2864
+ alignItems: 'center',
2865
+ zIndex: 10,
2866
+ },
2842
2867
  });
2843
2868
  };
2844
2869
 
@@ -2902,11 +2927,11 @@ var BaseTileMedia = function (props) {
2902
2927
  var tileContext = useTileContext();
2903
2928
  if (!isContextValid(tileContext))
2904
2929
  return null;
2905
- var _a = tileContext.configuration, artworkUrl = _a.artworkUrl, _b = _a.title, title = _b === void 0 ? '' : _b;
2930
+ var _a = tileContext.configuration, artworkUrl = _a.artworkUrl, _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.isLocked, isLocked = _c === void 0 ? false : _c;
2906
2931
  var styles = useBaseTileStyles();
2907
2932
  if (!artworkUrl)
2908
2933
  return null;
2909
- return (jsxRuntimeExports.jsx(ProgressiveImage, __assign({}, props, { source: { uri: artworkUrl }, testID: "tile-media", style: [props.style, baseStyles.media, styles.media], alt: "Content image".concat(title ? " for ".concat(title) : ''), role: "img" })));
2934
+ return (jsxRuntimeExports.jsxs(reactNative.View, { style: baseStyles.imageContainer, children: [jsxRuntimeExports.jsx(ProgressiveImage, __assign({}, props, { source: { uri: artworkUrl }, testID: "tile-media", style: [props.style, baseStyles.media, styles.media], alt: "Content image".concat(title ? " for ".concat(title) : ''), role: "img" })), isLocked && (jsxRuntimeExports.jsx(reactNative.View, { style: styles.lockOverlay, testID: "lock-overlay", children: jsxRuntimeExports.jsx(Icon, { name: "LockKeyhole", size: 48, color: "white" }) }))] }));
2910
2935
  };
2911
2936
 
2912
2937
  /**
@@ -5042,6 +5067,15 @@ var useRewardTileStyles = function () {
5042
5067
  height: '100%',
5043
5068
  resizeMode: 'cover',
5044
5069
  },
5070
+ lockIcon: {
5071
+ position: 'absolute',
5072
+ top: 0,
5073
+ left: 0,
5074
+ bottom: 0,
5075
+ right: 0,
5076
+ width: '100%',
5077
+ height: '100%',
5078
+ },
5045
5079
  content: {
5046
5080
  paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
5047
5081
  flex: 1,
@@ -5063,6 +5097,17 @@ var useRewardTileStyles = function () {
5063
5097
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
5064
5098
  },
5065
5099
  tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
5100
+ lockOverlay: {
5101
+ position: 'absolute',
5102
+ top: 0,
5103
+ left: 0,
5104
+ right: 0,
5105
+ bottom: 0,
5106
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
5107
+ justifyContent: 'center',
5108
+ alignItems: 'center',
5109
+ zIndex: 10,
5110
+ },
5066
5111
  });
5067
5112
  };
5068
5113
 
@@ -5079,13 +5124,13 @@ var RewardTileMedia = function (_a) {
5079
5124
  var tileContext = useTileContext();
5080
5125
  if (!isContextValid(tileContext))
5081
5126
  return null;
5082
- var _b = tileContext.configuration, artworkUrl = _b.artworkUrl, _c = _b.showArtwork, showArtwork = _c === void 0 ? true : _c, _d = _b.name, name = _d === void 0 ? 'Reward' : _d;
5127
+ var _b = tileContext.configuration, artworkUrl = _b.artworkUrl, _c = _b.showArtwork, showArtwork = _c === void 0 ? true : _c, _d = _b.name, name = _d === void 0 ? 'Reward' : _d, _e = _b.isLocked, isLocked = _e === void 0 ? false : _e;
5083
5128
  if (!artworkUrl || !showArtwork)
5084
5129
  return null;
5085
5130
  var containerStyle = {
5086
5131
  flexBasis: isArtworkOnly ? '100%' : '50%',
5087
5132
  };
5088
- return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "reward-tile-media", role: "img", accessibilityLabel: "Reward image for ".concat(name), children: jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Reward image for ".concat(name) }) }));
5133
+ return (jsxRuntimeExports.jsxs(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "reward-tile-media", role: "img", accessibilityLabel: "Reward image for ".concat(name), children: [jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Reward image for ".concat(name) }), isLocked && (jsxRuntimeExports.jsx(reactNative.View, { style: styles.lockOverlay, testID: "lock-overlay", children: jsxRuntimeExports.jsx(Icon, { name: "LockKeyhole", size: 48, color: "white" }) }))] }));
5089
5134
  };
5090
5135
 
5091
5136
  /**
@@ -5482,6 +5527,17 @@ var useVenueTileStyles = function () {
5482
5527
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
5483
5528
  },
5484
5529
  tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
5530
+ lockOverlay: {
5531
+ position: 'absolute',
5532
+ top: 0,
5533
+ left: 0,
5534
+ right: 0,
5535
+ bottom: 0,
5536
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
5537
+ justifyContent: 'center',
5538
+ alignItems: 'center',
5539
+ zIndex: 10,
5540
+ },
5485
5541
  });
5486
5542
  };
5487
5543
 
@@ -5493,18 +5549,18 @@ var useVenueTileStyles = function () {
5493
5549
  * @returns React.ReactElement or null if no artwork URL is present or artwork should not be shown
5494
5550
  */
5495
5551
  var VenueTileMedia = function (_a) {
5496
- var isArtworkOnly = _a.isArtworkOnly;
5552
+ var _b = _a.isArtworkOnly, isArtworkOnly = _b === void 0 ? false : _b;
5497
5553
  var styles = useVenueTileStyles();
5498
5554
  var tileContext = useTileContext();
5499
5555
  if (!isContextValid(tileContext))
5500
5556
  return null;
5501
- var _b = tileContext.configuration, artworkUrl = _b.artworkUrl, _c = _b.name, name = _c === void 0 ? 'Venue' : _c;
5557
+ var _c = tileContext.configuration, artworkUrl = _c.artworkUrl, _d = _c.name, name = _d === void 0 ? 'Venue' : _d, _e = _c.isLocked, isLocked = _e === void 0 ? false : _e;
5502
5558
  if (!artworkUrl)
5503
5559
  return null;
5504
5560
  var containerStyle = {
5505
5561
  flexBasis: isArtworkOnly ? '100%' : '50%',
5506
5562
  };
5507
- return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "venue-tile-media", role: "img", accessibilityLabel: "Venue image for ".concat(name), children: jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Venue image for ".concat(name) }) }));
5563
+ return (jsxRuntimeExports.jsxs(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "venue-tile-media", role: "img", accessibilityLabel: "Venue image for ".concat(name), children: [jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Venue image for ".concat(name) }), isLocked && (jsxRuntimeExports.jsx(reactNative.View, { style: styles.lockOverlay, testID: "lock-overlay", children: jsxRuntimeExports.jsx(Icon, { name: "LockKeyhole", size: 48, color: "white" }) }))] }));
5508
5564
  };
5509
5565
 
5510
5566
  /**
@@ -5558,7 +5614,7 @@ var VenueTileRoot = function (_a) {
5558
5614
  !tile.active ||
5559
5615
  !tile.configuration)
5560
5616
  return null;
5561
- return (jsxRuntimeExports.jsxs(BaseTile, { tile: tile, children: [jsxRuntimeExports.jsx(VenueTile.Media, { isArtworkOnly: false }), jsxRuntimeExports.jsxs(Layout, { children: [jsxRuntimeExports.jsxs(Row, { justify: "between", align: "center", style: styles.header, children: [jsxRuntimeExports.jsx(VenueTile.Title, {}), jsxRuntimeExports.jsx(VenueTile.Chevron, {})] }), jsxRuntimeExports.jsx(VenueTile.Description, {})] })] }));
5617
+ return (jsxRuntimeExports.jsxs(BaseTile, { tile: tile, children: [jsxRuntimeExports.jsx(VenueTile.Media, {}), jsxRuntimeExports.jsxs(Layout, { children: [jsxRuntimeExports.jsxs(Row, { justify: "between", align: "center", style: styles.header, children: [jsxRuntimeExports.jsx(VenueTile.Title, {}), jsxRuntimeExports.jsx(VenueTile.Chevron, {})] }), jsxRuntimeExports.jsx(VenueTile.Description, {})] })] }));
5562
5618
  };
5563
5619
  /**
5564
5620
  * The VenueTile component with subcomponents attached.