@wlloyalty/wll-react-sdk 1.0.62 → 1.0.63

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
@@ -245,6 +245,10 @@ type Tile = {
245
245
  };
246
246
  declare const getConfigForTileType: (tileType: TileType) => typeof BannerTileConfig | typeof PointsTileConfig | typeof ContentTileConfig | typeof RewardTileConfig | typeof BadgeTileConfig | typeof RewardCategoryTileConfig | typeof TierTileConfig;
247
247
  type TileConfig = InstanceType<ReturnType<typeof getConfigForTileType>>;
248
+ type TileSizeInfo = {
249
+ isFullSize: boolean;
250
+ isHalfSize: boolean;
251
+ };
248
252
 
249
253
  type PercentageKey = 5 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 95;
250
254
  type DerivedColors = {
@@ -375,13 +379,13 @@ declare const BaseTile: (({ tile, children, style, }: BaseTileProps) => JSX.Elem
375
379
 
376
380
  declare const Indicator: () => JSX.Element;
377
381
 
378
- interface SkeletonProps {
382
+ type SkeletonProps = {
379
383
  width?: number | `${number}%`;
380
384
  height?: number | `${number}%`;
381
385
  borderRadius?: number;
382
386
  style?: ViewStyle;
383
387
  numberOfSquares?: number;
384
- }
388
+ };
385
389
  declare const Skeleton: ({ style, numberOfSquares, }: SkeletonProps) => JSX.Element;
386
390
 
387
391
  type TileContainerProps = {
@@ -677,4 +681,4 @@ type WllSdkProviderProps = WithChildren & {
677
681
  declare const WllSdkProvider: ({ children, theme: providedTheme, config, navigationConfig, }: WllSdkProviderProps) => JSX.Element;
678
682
  declare const useWllSdk: () => WllSdkContextType;
679
683
 
680
- export { type APIResponse, type Align, type Availability, type Badge, type BadgeDetail, _default$5 as BadgeTile, BadgeTileConfig, BadgeTileType, _default$4 as BannerTile, BannerTileConfig, BaseBanner, type BaseThemeObject, BaseTile, Button, CTALinkTarget, Carousel, Column, _default$3 as ContentTile, ContentTileConfig, type DerivedColors, type DerivedProperties, type DesaturationType, type FlexDirection, FullFlex, Grid, Group, Icon, type ImagePropsNoSource, Indicator, type Justify, Layout, type LayoutProps$1 as LayoutProps, LoadingIndicator, type NavigationConfig, type NavigationType, type PercentageKey, _default$2 as PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, _default$1 as RewardCategoryTile, RewardCategoryTileConfig, _default as RewardTile, RewardTileConfig, Row, type SDKConfig, Section, SectionHeader, SectionType, type Size, Skeleton, Spacer, type TGroup, type TSection, Text, type ThemeContextType, type ThemeObject, type ThemeProviderProps, TierTileConfig, TierTileType, TierTile as TierTileUpdated, type TierType, type Tile, type TileConfig, TileContainer, TileHeight, TileType, type Variant, WllSdkProvider, alignMap, justifyMap, useWllSdk };
684
+ export { type APIResponse, type Align, type Availability, type Badge, type BadgeDetail, _default$5 as BadgeTile, BadgeTileConfig, BadgeTileType, _default$4 as BannerTile, BannerTileConfig, BaseBanner, type BaseThemeObject, BaseTile, Button, CTALinkTarget, Carousel, Column, _default$3 as ContentTile, ContentTileConfig, type DerivedColors, type DerivedProperties, type DesaturationType, type FlexDirection, FullFlex, Grid, Group, Icon, type ImagePropsNoSource, Indicator, type Justify, Layout, type LayoutProps$1 as LayoutProps, LoadingIndicator, type NavigationConfig, type NavigationType, type PercentageKey, _default$2 as PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, _default$1 as RewardCategoryTile, RewardCategoryTileConfig, _default as RewardTile, RewardTileConfig, Row, type SDKConfig, Section, SectionHeader, SectionType, type Size, Skeleton, Spacer, type TGroup, type TSection, Text, type ThemeContextType, type ThemeObject, type ThemeProviderProps, TierTileConfig, TierTileType, TierTile as TierTileUpdated, type TierType, type Tile, type TileConfig, TileContainer, TileHeight, type TileSizeInfo, TileType, type Variant, WllSdkProvider, alignMap, justifyMap, useWllSdk };
package/dist/native.js CHANGED
@@ -19149,6 +19149,17 @@ var BaseTileBody = function (props) {
19149
19149
  function isContextValid(context) {
19150
19150
  return context !== null && context !== undefined && context.configuration !== null && context.configuration !== undefined;
19151
19151
  }
19152
+ /**
19153
+ * Checks if a tile's content should be hidden based on its size and artwork configuration.
19154
+ *
19155
+ * @param {TileSizeInfo | null} sizeInfo - The size information for the tile
19156
+ * @param {string | null | undefined} artworkUrl - The URL of the tile's artwork
19157
+ * @returns {boolean} True if the content should be hidden, false otherwise
19158
+ */
19159
+ var shouldHideContentForHalfTile = function (sizeInfo, artworkUrl) {
19160
+ if (!sizeInfo) return false;
19161
+ return sizeInfo.isHalfSize && !!artworkUrl;
19162
+ };
19152
19163
 
19153
19164
  var baseStyles = StyleSheet$1.create({
19154
19165
  container: {
@@ -19238,9 +19249,7 @@ var BaseTileContent = function (_a) {
19238
19249
  var artworkUrl = tileContext.configuration.artworkUrl;
19239
19250
  var sizeInfo = useTileSize(tileContext);
19240
19251
  if (!sizeInfo) return null;
19241
- var isHalfSize = sizeInfo.isHalfSize;
19242
- // For half tiles with an image, don't show other content
19243
- if (isHalfSize && artworkUrl) return null;
19252
+ if (shouldHideContentForHalfTile(sizeInfo, artworkUrl)) return null;
19244
19253
  return /*#__PURE__*/React.createElement(View$2, {
19245
19254
  testID: "tile-content",
19246
19255
  style: [baseStyles.content, {
@@ -19265,13 +19274,11 @@ var BaseTileHeader = function (_a) {
19265
19274
  var artworkUrl = tileContext.configuration.artworkUrl;
19266
19275
  var sizeInfo = useTileSize(tileContext);
19267
19276
  if (!sizeInfo) return null;
19268
- var isHalfSize = sizeInfo.isHalfSize;
19269
- // For half tiles with an image, don't show header
19270
- if (isHalfSize && artworkUrl) return null;
19277
+ if (shouldHideContentForHalfTile(sizeInfo, artworkUrl)) return null;
19271
19278
  var dynamicStyles = useBaseTileStyles();
19272
19279
  var combinedStyle = __assign(__assign(__assign({}, dynamicStyles.header), {
19273
- marginTop: isHalfSize ? 0 : dynamicStyles.header.marginTop
19274
- }), isHalfSize ? {
19280
+ marginTop: sizeInfo.isHalfSize ? 0 : dynamicStyles.header.marginTop
19281
+ }), sizeInfo.isHalfSize ? {
19275
19282
  alignItems: 'center'
19276
19283
  } : {});
19277
19284
  return /*#__PURE__*/React.createElement(View$2, {