@wlloyalty/wll-react-sdk 1.4.3 → 1.4.5
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 +59 -37
- package/dist/native.js +495 -1356
- package/dist/native.js.map +1 -1
- package/dist/types/components/atoms/BaseTile/base-tile-body.d.ts +3 -2
- package/dist/types/components/atoms/BaseTile/base-tile-content.d.ts +3 -2
- package/dist/types/components/atoms/BaseTile/base-tile-header.d.ts +3 -2
- package/dist/types/components/atoms/BaseTile/base-tile-media.d.ts +3 -2
- package/dist/types/components/atoms/BaseTile/base-tile-title.d.ts +3 -2
- package/dist/types/components/atoms/BaseTile/index.d.ts +8 -7
- package/dist/types/components/atoms/Button/index.d.ts +2 -1
- package/dist/types/components/atoms/Icon/index.d.ts +2 -1
- package/dist/types/components/atoms/Indicator/index.d.ts +2 -1
- package/dist/types/components/atoms/LoadingIndicator/index.d.ts +2 -1
- package/dist/types/components/atoms/Primatives/Column.d.ts +1 -1
- package/dist/types/components/atoms/Primatives/FullFlex.d.ts +1 -1
- package/dist/types/components/atoms/Primatives/Layout.d.ts +1 -1
- package/dist/types/components/atoms/Primatives/Row.d.ts +1 -1
- package/dist/types/components/atoms/Primatives/Spacer.d.ts +2 -1
- package/dist/types/components/atoms/ProgressBar/index.d.ts +2 -1
- package/dist/types/components/atoms/ProgressiveImage/index.d.ts +2 -1
- package/dist/types/components/atoms/Skeleton/index.d.ts +2 -1
- package/dist/types/components/atoms/SkeletonTile/index.d.ts +2 -1
- package/dist/types/components/atoms/Text/index.d.ts +4 -3
- package/dist/types/components/atoms/TileContainer/index.d.ts +2 -1
- package/dist/types/components/molecules/Carousel/index.d.ts +2 -1
- package/dist/types/components/molecules/CarouselNavButton/index.d.ts +2 -1
- package/dist/types/components/molecules/ProgressIndicator/index.d.ts +2 -1
- package/dist/types/components/molecules/SectionHeader/index.d.ts +2 -1
- package/dist/types/components/organisms/BadgeTile/badge-tile-date-earned.d.ts +3 -2
- package/dist/types/components/organisms/BadgeTile/badge-tile-description.d.ts +3 -2
- package/dist/types/components/organisms/BadgeTile/badge-tile-media.d.ts +2 -2
- package/dist/types/components/organisms/BadgeTile/badge-tile-status.d.ts +3 -2
- package/dist/types/components/organisms/BadgeTile/badge-tile-title.d.ts +3 -2
- package/dist/types/components/organisms/BadgeTile/index.d.ts +6 -6
- package/dist/types/components/organisms/BannerTile/banner-tile-cta.d.ts +3 -2
- package/dist/types/components/organisms/BannerTile/banner-tile-description.d.ts +3 -2
- package/dist/types/components/organisms/BannerTile/banner-tile-media.d.ts +3 -2
- package/dist/types/components/organisms/BannerTile/banner-tile-title.d.ts +3 -2
- package/dist/types/components/organisms/BannerTile/index.d.ts +5 -5
- package/dist/types/components/organisms/ContentTile/content-tile-chevron.d.ts +2 -1
- package/dist/types/components/organisms/ContentTile/content-tile-media.d.ts +2 -1
- package/dist/types/components/organisms/ContentTile/content-tile-summary.d.ts +2 -1
- package/dist/types/components/organisms/ContentTile/content-tile-title.d.ts +2 -1
- package/dist/types/components/organisms/ContentTile/index.d.ts +5 -5
- package/dist/types/components/organisms/Group/index.d.ts +8 -6
- package/dist/types/components/organisms/PointsTile/index.d.ts +5 -5
- package/dist/types/components/organisms/PointsTile/points-tile-chevron.d.ts +3 -2
- package/dist/types/components/organisms/PointsTile/points-tile-formatted-points.d.ts +3 -2
- package/dist/types/components/organisms/PointsTile/points-tile-media.d.ts +3 -2
- package/dist/types/components/organisms/PointsTile/points-tile-title.d.ts +3 -2
- package/dist/types/components/organisms/RewardCategoryTile/index.d.ts +3 -3
- package/dist/types/components/organisms/RewardCategoryTile/reward-category-header.d.ts +3 -2
- package/dist/types/components/organisms/RewardCategoryTile/reward-category-media.d.ts +3 -2
- package/dist/types/components/organisms/RewardTile/index.d.ts +6 -6
- package/dist/types/components/organisms/RewardTile/reward-tile-chevron.d.ts +3 -2
- package/dist/types/components/organisms/RewardTile/reward-tile-media.d.ts +3 -2
- package/dist/types/components/organisms/RewardTile/reward-tile-points.d.ts +3 -2
- package/dist/types/components/organisms/RewardTile/reward-tile-summary.d.ts +3 -2
- package/dist/types/components/organisms/RewardTile/reward-tile-title.d.ts +3 -2
- package/dist/types/components/organisms/RoundupTile/index.d.ts +5 -5
- package/dist/types/components/organisms/RoundupTile/roundup-tile-chevron.d.ts +3 -2
- package/dist/types/components/organisms/RoundupTile/roundup-tile-formatted-points.d.ts +3 -2
- package/dist/types/components/organisms/RoundupTile/roundup-tile-media.d.ts +3 -2
- package/dist/types/components/organisms/RoundupTile/roundup-tile-title.d.ts +3 -2
- package/dist/types/components/organisms/Section/index.d.ts +2 -2
- package/dist/types/context/WllSdkContext.d.ts +2 -1
- package/dist/types/hooks/useInvalidateData.d.ts +9 -0
- package/dist/types/hooks/usePullToRefresh.d.ts +12 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/utils/storybookHelpers.d.ts +1 -1
- package/dist/web.js +159 -50
- package/dist/web.js.map +1 -1
- package/package.json +12 -11
package/dist/web.js
CHANGED
|
@@ -19317,7 +19317,7 @@ var useTileSize = function (tile) {
|
|
|
19317
19317
|
* Renders the body text of a BaseTile component.
|
|
19318
19318
|
*
|
|
19319
19319
|
* @param {BaseTileBodyProps} props - Component props including text styling options
|
|
19320
|
-
* @returns {
|
|
19320
|
+
* @returns {React.ReactElement|null} The rendered body text or null if conditions for display are not met
|
|
19321
19321
|
*/
|
|
19322
19322
|
var BaseTileBody = function (props) {
|
|
19323
19323
|
var tileContext = useTileContext();
|
|
@@ -19448,7 +19448,7 @@ var useBaseTileStyles = function () {
|
|
|
19448
19448
|
*
|
|
19449
19449
|
* @param {BaseTileContentProps} props - Component props
|
|
19450
19450
|
* @param {ReactNode} props.children - Child elements to render within the content area
|
|
19451
|
-
* @returns {
|
|
19451
|
+
* @returns {React.ReactElement|null} The rendered content or null if conditions for display are not met
|
|
19452
19452
|
*/
|
|
19453
19453
|
var BaseTileContent = function (_a) {
|
|
19454
19454
|
var children = _a.children;
|
|
@@ -19473,7 +19473,7 @@ var BaseTileContent = function (_a) {
|
|
|
19473
19473
|
*
|
|
19474
19474
|
* @param {BaseTileHeaderProps} props - Component props
|
|
19475
19475
|
* @param {ReactNode} props.children - Child elements to render within the header
|
|
19476
|
-
* @returns {
|
|
19476
|
+
* @returns {React.ReactElement|null} The rendered header or null if conditions for display are not met
|
|
19477
19477
|
*/
|
|
19478
19478
|
var BaseTileHeader = function (_a) {
|
|
19479
19479
|
var children = _a.children;
|
|
@@ -19500,7 +19500,7 @@ var BaseTileHeader = function (_a) {
|
|
|
19500
19500
|
* Renders the media (image) for a BaseTile component.
|
|
19501
19501
|
*
|
|
19502
19502
|
* @param {ImagePropsNoSource} props - The image props excluding source
|
|
19503
|
-
* @returns {
|
|
19503
|
+
* @returns {React.ReactElement|null} The rendered image or null if no artwork URL is present
|
|
19504
19504
|
*/
|
|
19505
19505
|
var BaseTileMedia = function (props) {
|
|
19506
19506
|
var tileContext = useTileContext();
|
|
@@ -19525,7 +19525,7 @@ var BaseTileMedia = function (props) {
|
|
|
19525
19525
|
/**
|
|
19526
19526
|
* Renders the title of a BaseTile component.
|
|
19527
19527
|
*
|
|
19528
|
-
* @returns {
|
|
19528
|
+
* @returns {React.ReactElement|null} The rendered title or null if conditions for display are not met
|
|
19529
19529
|
*/
|
|
19530
19530
|
var BaseTileTitle = function () {
|
|
19531
19531
|
var _a, _b;
|
|
@@ -19631,7 +19631,7 @@ var BaseTileContainer = function (_a) {
|
|
|
19631
19631
|
* BaseTileRoot component to provide context and render children.
|
|
19632
19632
|
*
|
|
19633
19633
|
* @param {BaseTileProps} props - Component props
|
|
19634
|
-
* @returns {
|
|
19634
|
+
* @returns {React.ReactElement|null} The rendered BaseTileRoot or null if no tile is provided
|
|
19635
19635
|
*/
|
|
19636
19636
|
var BaseTileRoot = function (_a) {
|
|
19637
19637
|
var tile = _a.tile,
|
|
@@ -20038,7 +20038,7 @@ var useBadgeTileStyles = function () {
|
|
|
20038
20038
|
/**
|
|
20039
20039
|
* Renders the date earned for a Badge Tile.
|
|
20040
20040
|
*
|
|
20041
|
-
* @returns
|
|
20041
|
+
* @returns React.ReactElement or null if badge is not earned or badgeNotEarnedMessage exists
|
|
20042
20042
|
*/
|
|
20043
20043
|
var BadgeTileDateEarned = function () {
|
|
20044
20044
|
var styles = useBadgeTileStyles();
|
|
@@ -20087,7 +20087,7 @@ var BadgeTileDateEarned = function () {
|
|
|
20087
20087
|
/**
|
|
20088
20088
|
* Renders the description for a Badge Tile.
|
|
20089
20089
|
*
|
|
20090
|
-
* @returns
|
|
20090
|
+
* @returns React.ReactElement or null if description is not present
|
|
20091
20091
|
*/
|
|
20092
20092
|
var BadgeTileDescription = function () {
|
|
20093
20093
|
var tileContext = useTileContext();
|
|
@@ -20127,7 +20127,7 @@ var BadgeTileDescription = function () {
|
|
|
20127
20127
|
/**
|
|
20128
20128
|
* Renders the media for a Badge Tile.
|
|
20129
20129
|
*
|
|
20130
|
-
* @returns
|
|
20130
|
+
* @returns React.ReactElement or null if media is not present
|
|
20131
20131
|
*/
|
|
20132
20132
|
var BadgeTileMedia = function (_a) {
|
|
20133
20133
|
var children = _a.children,
|
|
@@ -20161,7 +20161,7 @@ var BadgeTileMedia = function (_a) {
|
|
|
20161
20161
|
/**
|
|
20162
20162
|
* Renders the status for a Badge Tile.
|
|
20163
20163
|
*
|
|
20164
|
-
* @returns
|
|
20164
|
+
* @returns React.ReactElement or null if badge is not earned or badgeNotEarnedMessage exists
|
|
20165
20165
|
*/
|
|
20166
20166
|
var BadgeTileStatus = function () {
|
|
20167
20167
|
var styles = useBadgeTileStyles();
|
|
@@ -20196,7 +20196,7 @@ var BadgeTileStatus = function () {
|
|
|
20196
20196
|
/**
|
|
20197
20197
|
* Renders the title for a Badge Tile.
|
|
20198
20198
|
*
|
|
20199
|
-
* @returns
|
|
20199
|
+
* @returns React.ReactElement or null if name is not present
|
|
20200
20200
|
*/
|
|
20201
20201
|
var BadgeTileTitle = function () {
|
|
20202
20202
|
var styles = useBadgeTileStyles();
|
|
@@ -20225,7 +20225,7 @@ var BadgeTileTitle = function () {
|
|
|
20225
20225
|
|
|
20226
20226
|
/**
|
|
20227
20227
|
* The main BadgeTile component.
|
|
20228
|
-
* @returns
|
|
20228
|
+
* @returns React.ReactElement or null if tile is not active or tileHeight is not full.
|
|
20229
20229
|
* This component renders a badge tile with optional media, status, title, description, and date earned.
|
|
20230
20230
|
*/
|
|
20231
20231
|
var BadgeTileRoot = function (_a) {
|
|
@@ -20253,7 +20253,7 @@ var BadgeTile$1 = withTileFetching(BadgeTile);
|
|
|
20253
20253
|
/**
|
|
20254
20254
|
* Renders the call to action of a Banner Tile.
|
|
20255
20255
|
*
|
|
20256
|
-
* @returns
|
|
20256
|
+
* @returns React.ReactElement or null if no text or required props are present
|
|
20257
20257
|
*/
|
|
20258
20258
|
var BannerTileCTA = function () {
|
|
20259
20259
|
var bannerContext = useBannerContext();
|
|
@@ -20321,7 +20321,7 @@ var useBannerTileStyles = function () {
|
|
|
20321
20321
|
/**
|
|
20322
20322
|
* Renders the description text of a Banner Tile.
|
|
20323
20323
|
*
|
|
20324
|
-
* @returns
|
|
20324
|
+
* @returns React.ReactElement or null if no description is present
|
|
20325
20325
|
*/
|
|
20326
20326
|
var BannerTileDescription = function () {
|
|
20327
20327
|
var styles = useBannerTileStyles();
|
|
@@ -20339,7 +20339,7 @@ var BannerTileDescription = function () {
|
|
|
20339
20339
|
/**
|
|
20340
20340
|
* Renders the media of a Banner Tile.
|
|
20341
20341
|
*
|
|
20342
|
-
* @returns
|
|
20342
|
+
* @returns React.ReactElement or null if no media is present
|
|
20343
20343
|
*/
|
|
20344
20344
|
var BannerTileMedia = function (_a) {
|
|
20345
20345
|
var isArtworkOnly = _a.isArtworkOnly;
|
|
@@ -20370,7 +20370,7 @@ var BannerTileMedia = function (_a) {
|
|
|
20370
20370
|
/**
|
|
20371
20371
|
* Renders the title of a Banner Tile.
|
|
20372
20372
|
*
|
|
20373
|
-
* @returns
|
|
20373
|
+
* @returns React.ReactElement or null if no title is present
|
|
20374
20374
|
*/
|
|
20375
20375
|
var BannerTileTitle = function () {
|
|
20376
20376
|
var styles = useBannerTileStyles();
|
|
@@ -20403,7 +20403,7 @@ var isArtworkOnly$2 = function (configuration) {
|
|
|
20403
20403
|
* This component renders a banner tile with optional media, title, description, and CTA.
|
|
20404
20404
|
*
|
|
20405
20405
|
* @param {BannerTileProps} props - Component props
|
|
20406
|
-
* @returns {
|
|
20406
|
+
* @returns {React.ReactElement | null} Rendered component or null if tile is inactive
|
|
20407
20407
|
*/
|
|
20408
20408
|
var BannerTileRoot = function (_a) {
|
|
20409
20409
|
var tile = _a.tile;
|
|
@@ -20604,7 +20604,7 @@ var isArtworkOnly$1 = function (configuration) {
|
|
|
20604
20604
|
*
|
|
20605
20605
|
* @param {ContentTileProps} props - Component props
|
|
20606
20606
|
* @param {Tile} props.tile - The tile data to render
|
|
20607
|
-
* @returns
|
|
20607
|
+
* @returns React.ReactElement or null if tile is inactive
|
|
20608
20608
|
*/
|
|
20609
20609
|
var ContentTileRoot = function (_a) {
|
|
20610
20610
|
var tile = _a.tile;
|
|
@@ -20758,6 +20758,98 @@ var useInitialGroupFetch = function (_a) {
|
|
|
20758
20758
|
};
|
|
20759
20759
|
};
|
|
20760
20760
|
|
|
20761
|
+
/**
|
|
20762
|
+
* Hook to invalidate SDK data
|
|
20763
|
+
* @returns Methods to trigger SDK data updates
|
|
20764
|
+
*/
|
|
20765
|
+
function useInvalidateData() {
|
|
20766
|
+
var sdk = useWllSdk();
|
|
20767
|
+
return {
|
|
20768
|
+
invalidateGroupData: function () {
|
|
20769
|
+
if (sdk) {
|
|
20770
|
+
sdk.notifyDataChange('GROUP_DATA_CHANGED');
|
|
20771
|
+
}
|
|
20772
|
+
},
|
|
20773
|
+
invalidateSectionData: function (sectionId) {
|
|
20774
|
+
if (sdk) {
|
|
20775
|
+
sdk.notifyDataChange('SECTION_DATA_CHANGED', {
|
|
20776
|
+
sectionId: sectionId
|
|
20777
|
+
});
|
|
20778
|
+
}
|
|
20779
|
+
},
|
|
20780
|
+
invalidateTileData: function (tileId) {
|
|
20781
|
+
if (sdk) {
|
|
20782
|
+
sdk.notifyDataChange('TILE_DATA_CHANGED', {
|
|
20783
|
+
tileId: tileId
|
|
20784
|
+
});
|
|
20785
|
+
}
|
|
20786
|
+
}
|
|
20787
|
+
};
|
|
20788
|
+
}
|
|
20789
|
+
|
|
20790
|
+
function usePullToRefresh(_a) {
|
|
20791
|
+
var _this = this;
|
|
20792
|
+
var _b = _a === void 0 ? {} : _a,
|
|
20793
|
+
onRefresh = _b.onRefresh,
|
|
20794
|
+
externalRefreshing = _b.refreshing;
|
|
20795
|
+
var _c = React.useState(false),
|
|
20796
|
+
internalRefreshing = _c[0],
|
|
20797
|
+
setInternalRefreshing = _c[1];
|
|
20798
|
+
var invalidateGroupData = useInvalidateData().invalidateGroupData;
|
|
20799
|
+
var refreshing = externalRefreshing !== null && externalRefreshing !== void 0 ? externalRefreshing : internalRefreshing;
|
|
20800
|
+
var handleRefresh = React.useCallback(function () {
|
|
20801
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
20802
|
+
var error_1;
|
|
20803
|
+
return __generator(this, function (_a) {
|
|
20804
|
+
switch (_a.label) {
|
|
20805
|
+
case 0:
|
|
20806
|
+
if (refreshing) return [2 /*return*/];
|
|
20807
|
+
setInternalRefreshing(true);
|
|
20808
|
+
_a.label = 1;
|
|
20809
|
+
case 1:
|
|
20810
|
+
_a.trys.push([1, 6, 7, 8]);
|
|
20811
|
+
if (!onRefresh) return [3 /*break*/, 3];
|
|
20812
|
+
return [4 /*yield*/, onRefresh()];
|
|
20813
|
+
case 2:
|
|
20814
|
+
_a.sent();
|
|
20815
|
+
return [3 /*break*/, 5];
|
|
20816
|
+
case 3:
|
|
20817
|
+
// Default behavior: refresh all group data
|
|
20818
|
+
invalidateGroupData();
|
|
20819
|
+
// Add a small delay to show the refresh animation
|
|
20820
|
+
return [4 /*yield*/, new Promise(function (resolve) {
|
|
20821
|
+
return setTimeout(resolve, 1000);
|
|
20822
|
+
})];
|
|
20823
|
+
case 4:
|
|
20824
|
+
// Add a small delay to show the refresh animation
|
|
20825
|
+
_a.sent();
|
|
20826
|
+
_a.label = 5;
|
|
20827
|
+
case 5:
|
|
20828
|
+
return [3 /*break*/, 8];
|
|
20829
|
+
case 6:
|
|
20830
|
+
error_1 = _a.sent();
|
|
20831
|
+
console.error('Pull to refresh failed:', error_1);
|
|
20832
|
+
return [3 /*break*/, 8];
|
|
20833
|
+
case 7:
|
|
20834
|
+
setInternalRefreshing(false);
|
|
20835
|
+
return [7 /*endfinally*/];
|
|
20836
|
+
case 8:
|
|
20837
|
+
return [2 /*return*/];
|
|
20838
|
+
}
|
|
20839
|
+
});
|
|
20840
|
+
});
|
|
20841
|
+
}, [refreshing, onRefresh, invalidateGroupData]);
|
|
20842
|
+
var refreshControl = /*#__PURE__*/React.createElement(RefreshControl, {
|
|
20843
|
+
refreshing: refreshing,
|
|
20844
|
+
onRefresh: handleRefresh
|
|
20845
|
+
});
|
|
20846
|
+
return {
|
|
20847
|
+
refreshControl: refreshControl,
|
|
20848
|
+
refreshing: refreshing,
|
|
20849
|
+
handleRefresh: handleRefresh
|
|
20850
|
+
};
|
|
20851
|
+
}
|
|
20852
|
+
|
|
20761
20853
|
exports.SectionType = void 0;
|
|
20762
20854
|
(function (SectionType) {
|
|
20763
20855
|
SectionType["Grid"] = "GRID";
|
|
@@ -21355,7 +21447,7 @@ var useSectionData = function (section, sectionId) {
|
|
|
21355
21447
|
*
|
|
21356
21448
|
* @param {Object} props - Component props
|
|
21357
21449
|
* @param {string} props.message - Message to display in the empty state
|
|
21358
|
-
* @returns {
|
|
21450
|
+
* @returns {React.ReactElement} The empty state component
|
|
21359
21451
|
*/
|
|
21360
21452
|
var EmptyState = function (_a) {
|
|
21361
21453
|
var message = _a.message;
|
|
@@ -21371,7 +21463,7 @@ var EmptyState = function (_a) {
|
|
|
21371
21463
|
* @param {SectionProps} props - Component props
|
|
21372
21464
|
* @param {TSection} [props.section] - The section data
|
|
21373
21465
|
* @param {string} [props.sectionId] - The ID of the section to fetch
|
|
21374
|
-
* @returns {
|
|
21466
|
+
* @returns {React.ReactElement|null} The rendered section or null if invalid props
|
|
21375
21467
|
*/
|
|
21376
21468
|
var Section = function (_a) {
|
|
21377
21469
|
var section = _a.section,
|
|
@@ -21501,7 +21593,7 @@ var useGroupData = function (id) {
|
|
|
21501
21593
|
*
|
|
21502
21594
|
* @param {GroupEmptyStateProps} props - Component props
|
|
21503
21595
|
* @param {string} props.message - Message to display
|
|
21504
|
-
* @returns {
|
|
21596
|
+
* @returns {React.ReactElement} The empty state component
|
|
21505
21597
|
*/
|
|
21506
21598
|
var GroupEmptyState = function (_a) {
|
|
21507
21599
|
var message = _a.message;
|
|
@@ -21516,7 +21608,7 @@ var GroupEmptyState = function (_a) {
|
|
|
21516
21608
|
/**
|
|
21517
21609
|
* Component to render all sections in a group
|
|
21518
21610
|
*
|
|
21519
|
-
* @returns {
|
|
21611
|
+
* @returns {React.ReactElement} The sections component
|
|
21520
21612
|
*/
|
|
21521
21613
|
var GroupSections = function () {
|
|
21522
21614
|
var groupData = useGroupContext().groupData;
|
|
@@ -21535,7 +21627,8 @@ var GroupSections = function () {
|
|
|
21535
21627
|
});
|
|
21536
21628
|
}
|
|
21537
21629
|
var sortedSections = sortByPriority(activeSections);
|
|
21538
|
-
|
|
21630
|
+
var Container = IS_WEB ? View$2 : ScrollView$2;
|
|
21631
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
21539
21632
|
accessible: true,
|
|
21540
21633
|
accessibilityLabel: "Group: ".concat(groupData.name || 'Unnamed group'),
|
|
21541
21634
|
role: "region"
|
|
@@ -21556,20 +21649,29 @@ var GroupSections = function () {
|
|
|
21556
21649
|
*
|
|
21557
21650
|
* @param {GroupProps} props - Component props
|
|
21558
21651
|
* @param {string} props.id - The unique identifier of the group to fetch and display
|
|
21559
|
-
* @returns {
|
|
21652
|
+
* @returns {React.ReactElement|null} The rendered group or null if invalid ID
|
|
21560
21653
|
*/
|
|
21561
21654
|
var Group = function (_a) {
|
|
21562
|
-
var id = _a.id
|
|
21655
|
+
var id = _a.id,
|
|
21656
|
+
_b = _a.enablePullToRefresh,
|
|
21657
|
+
enablePullToRefresh = _b === void 0 ? true : _b,
|
|
21658
|
+
onRefresh = _a.onRefresh;
|
|
21563
21659
|
if (!id) {
|
|
21564
21660
|
console.warn('Group component requires id prop');
|
|
21565
21661
|
return null;
|
|
21566
21662
|
}
|
|
21567
|
-
var
|
|
21568
|
-
groupData =
|
|
21569
|
-
isLoading =
|
|
21570
|
-
error =
|
|
21663
|
+
var _c = useGroupData(id),
|
|
21664
|
+
groupData = _c.groupData,
|
|
21665
|
+
isLoading = _c.isLoading,
|
|
21666
|
+
error = _c.error;
|
|
21571
21667
|
var theme = useWllSdk().theme;
|
|
21572
|
-
|
|
21668
|
+
var _d = usePullToRefresh({
|
|
21669
|
+
onRefresh: onRefresh,
|
|
21670
|
+
refreshing: isLoading && !groupData
|
|
21671
|
+
}),
|
|
21672
|
+
refreshControl = _d.refreshControl;
|
|
21673
|
+
_d.refreshing;
|
|
21674
|
+
if (isLoading && !groupData) {
|
|
21573
21675
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
21574
21676
|
style: {
|
|
21575
21677
|
flex: 1,
|
|
@@ -21586,13 +21688,18 @@ var Group = function (_a) {
|
|
|
21586
21688
|
message: error || 'No group data available'
|
|
21587
21689
|
});
|
|
21588
21690
|
}
|
|
21691
|
+
var Container = IS_WEB ? View$2 : ScrollView$2;
|
|
21692
|
+
var containerProps = IS_WEB ? {} : {
|
|
21693
|
+
refreshControl: enablePullToRefresh ? refreshControl : undefined,
|
|
21694
|
+
showsVerticalScrollIndicator: true
|
|
21695
|
+
};
|
|
21589
21696
|
return /*#__PURE__*/React.createElement(GroupContext.Provider, {
|
|
21590
21697
|
value: {
|
|
21591
21698
|
groupData: groupData
|
|
21592
21699
|
}
|
|
21593
21700
|
}, /*#__PURE__*/React.createElement(View$2, {
|
|
21594
21701
|
testID: "group-container"
|
|
21595
|
-
}, /*#__PURE__*/React.createElement(GroupSections, null)));
|
|
21702
|
+
}, /*#__PURE__*/React.createElement(Container, __assign({}, containerProps), /*#__PURE__*/React.createElement(GroupSections, null))));
|
|
21596
21703
|
};
|
|
21597
21704
|
|
|
21598
21705
|
/**
|
|
@@ -21863,7 +21970,7 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
21863
21970
|
/**
|
|
21864
21971
|
* Renders formatted points value for a Points Tile.
|
|
21865
21972
|
*
|
|
21866
|
-
* @returns
|
|
21973
|
+
* @returns React.ReactElement or null if points are undefined or zero
|
|
21867
21974
|
*/
|
|
21868
21975
|
var PointsTileFormattedPoints = function () {
|
|
21869
21976
|
var styles = usePointsTileStyles();
|
|
@@ -21904,7 +22011,7 @@ var PointsTileFormattedPoints = function () {
|
|
|
21904
22011
|
/**
|
|
21905
22012
|
* Renders the media of a Points Tile.
|
|
21906
22013
|
*
|
|
21907
|
-
* @returns
|
|
22014
|
+
* @returns React.ReactElement or null if media is not present
|
|
21908
22015
|
*/
|
|
21909
22016
|
var PointsTileMedia = function (_a) {
|
|
21910
22017
|
var isFullSize = _a.isFullSize;
|
|
@@ -21933,7 +22040,7 @@ var PointsTileMedia = function (_a) {
|
|
|
21933
22040
|
/**
|
|
21934
22041
|
* Renders the title of a Points Tile.
|
|
21935
22042
|
*
|
|
21936
|
-
* @returns
|
|
22043
|
+
* @returns React.ReactElement or null if no title is present
|
|
21937
22044
|
*/
|
|
21938
22045
|
var PointsTileTitle = function () {
|
|
21939
22046
|
var tileContext = useTileContext();
|
|
@@ -21951,7 +22058,7 @@ var PointsTileTitle = function () {
|
|
|
21951
22058
|
/**
|
|
21952
22059
|
* Renders a chevron icon for a Roundup Tile.
|
|
21953
22060
|
*
|
|
21954
|
-
* @returns
|
|
22061
|
+
* @returns React.ReactElement
|
|
21955
22062
|
*/
|
|
21956
22063
|
var PointsTileChevron = function () {
|
|
21957
22064
|
var _a, _b;
|
|
@@ -21976,7 +22083,7 @@ var PointsTileChevron = function () {
|
|
|
21976
22083
|
* The PointsTile component renders a tile with media, title, and formatted points.
|
|
21977
22084
|
*
|
|
21978
22085
|
* @param props - Component props
|
|
21979
|
-
* @returns
|
|
22086
|
+
* @returns React.ReactElement or null if tile is inactive or missing required props
|
|
21980
22087
|
*/
|
|
21981
22088
|
var PointsTileRoot = function (_a) {
|
|
21982
22089
|
var tile = _a.tile;
|
|
@@ -22052,7 +22159,7 @@ var useRewardCategoryTileStyles = function () {
|
|
|
22052
22159
|
/**
|
|
22053
22160
|
* Renders the header for a Reward Category Tile.
|
|
22054
22161
|
*
|
|
22055
|
-
* @returns
|
|
22162
|
+
* @returns React.ReactElement or null if showName is false or name is not present
|
|
22056
22163
|
*/
|
|
22057
22164
|
var RewardCategoryHeader = function () {
|
|
22058
22165
|
var styles = useRewardCategoryTileStyles();
|
|
@@ -22084,7 +22191,7 @@ var RewardCategoryHeader = function () {
|
|
|
22084
22191
|
/**
|
|
22085
22192
|
* Renders the background media for a Reward Category Tile.
|
|
22086
22193
|
*
|
|
22087
|
-
* @returns
|
|
22194
|
+
* @returns React.ReactElement or null if no artwork URL is present
|
|
22088
22195
|
*/
|
|
22089
22196
|
var RewardCategoryMedia = function () {
|
|
22090
22197
|
var styles = useRewardCategoryTileStyles();
|
|
@@ -22111,7 +22218,7 @@ var RewardCategoryMedia = function () {
|
|
|
22111
22218
|
*
|
|
22112
22219
|
* @param {RewardCategoryTileProps} props - The component props
|
|
22113
22220
|
* @param {Tile} props.tile - The tile data to render
|
|
22114
|
-
* @returns {
|
|
22221
|
+
* @returns {React.ReactElement|null} Rendered component or null if tile is inactive or missing configuration
|
|
22115
22222
|
*/
|
|
22116
22223
|
var RewardCategoryTileRoot = function (_a) {
|
|
22117
22224
|
var tile = _a.tile;
|
|
@@ -22132,7 +22239,7 @@ var RewardCategoryTile$1 = withTileFetching(RewardCategoryTile);
|
|
|
22132
22239
|
/**
|
|
22133
22240
|
* Renders a chevron icon for a Reward Tile.
|
|
22134
22241
|
*
|
|
22135
|
-
* @returns
|
|
22242
|
+
* @returns React.ReactElement
|
|
22136
22243
|
*/
|
|
22137
22244
|
var RewardTileChevron = function () {
|
|
22138
22245
|
var _a;
|
|
@@ -22204,7 +22311,7 @@ var useRewardTileStyles = function () {
|
|
|
22204
22311
|
*
|
|
22205
22312
|
* @param props {RewardTileMediaProps} - Component props
|
|
22206
22313
|
* @param props.isArtworkOnly {boolean} - Whether the media should be rendered as an artwork only component
|
|
22207
|
-
* @returns
|
|
22314
|
+
* @returns React.ReactElement or null if no artwork URL is present or artwork should not be shown
|
|
22208
22315
|
*/
|
|
22209
22316
|
var RewardTileMedia = function (_a) {
|
|
22210
22317
|
var isArtworkOnly = _a.isArtworkOnly;
|
|
@@ -22238,7 +22345,7 @@ var RewardTileMedia = function (_a) {
|
|
|
22238
22345
|
/**
|
|
22239
22346
|
* Renders the points value of a Reward Tile.
|
|
22240
22347
|
*
|
|
22241
|
-
* @returns
|
|
22348
|
+
* @returns React.ReactElement or null if price should not be shown or is zero/undefined
|
|
22242
22349
|
*/
|
|
22243
22350
|
var RewardTilePoints = function () {
|
|
22244
22351
|
var styles = useRewardTileStyles();
|
|
@@ -22282,7 +22389,7 @@ var RewardTilePoints = function () {
|
|
|
22282
22389
|
/**
|
|
22283
22390
|
* Renders the summary of a Reward Tile.
|
|
22284
22391
|
*
|
|
22285
|
-
* @returns
|
|
22392
|
+
* @returns React.ReactElement or null if no summary is present
|
|
22286
22393
|
*/
|
|
22287
22394
|
var RewardTileSummary = function () {
|
|
22288
22395
|
var tileContext = useTileContext();
|
|
@@ -22308,7 +22415,7 @@ var RewardTileSummary = function () {
|
|
|
22308
22415
|
/**
|
|
22309
22416
|
* Renders the title of a Reward Tile.
|
|
22310
22417
|
*
|
|
22311
|
-
* @returns
|
|
22418
|
+
* @returns React.ReactElement or null if no name is present
|
|
22312
22419
|
*/
|
|
22313
22420
|
var RewardTileTitle = function () {
|
|
22314
22421
|
var tileContext = useTileContext();
|
|
@@ -22347,7 +22454,7 @@ var isArtworkOnly = function (configuration) {
|
|
|
22347
22454
|
*
|
|
22348
22455
|
* @param {RewardTileProps} props - Component props
|
|
22349
22456
|
* @param {Tile} props.tile - The tile data to render
|
|
22350
|
-
* @returns
|
|
22457
|
+
* @returns React.ReactElement or null if tile is inactive or not a full-height tile
|
|
22351
22458
|
*/
|
|
22352
22459
|
var RewardTileRoot = function (_a) {
|
|
22353
22460
|
var tile = _a.tile;
|
|
@@ -22570,7 +22677,7 @@ TierTile.Empty = TierTileEmpty;
|
|
|
22570
22677
|
/**
|
|
22571
22678
|
* Renders formatted points value for a Roundup Tile.
|
|
22572
22679
|
*
|
|
22573
|
-
* @returns
|
|
22680
|
+
* @returns React.ReactElement or null if points are undefined or zero
|
|
22574
22681
|
*/
|
|
22575
22682
|
var RoundupTileFormattedPoints = function () {
|
|
22576
22683
|
var tileContext = useTileContext();
|
|
@@ -22659,7 +22766,7 @@ var useRoundupTileStyles = function (isFullSize) {
|
|
|
22659
22766
|
/**
|
|
22660
22767
|
* Renders the media of a Points Tile.
|
|
22661
22768
|
*
|
|
22662
|
-
* @returns
|
|
22769
|
+
* @returns React.ReactElement or null if media is not present
|
|
22663
22770
|
*/
|
|
22664
22771
|
var RoundupTileMedia = function (_a) {
|
|
22665
22772
|
var isFullSize = _a.isFullSize;
|
|
@@ -22688,7 +22795,7 @@ var RoundupTileMedia = function (_a) {
|
|
|
22688
22795
|
/**
|
|
22689
22796
|
* Renders the title of a Roundup Tile.
|
|
22690
22797
|
*
|
|
22691
|
-
* @returns
|
|
22798
|
+
* @returns React.ReactElement or null if no title is present
|
|
22692
22799
|
*/
|
|
22693
22800
|
var RoundupTileTitle = function () {
|
|
22694
22801
|
var tileContext = useTileContext();
|
|
@@ -22706,7 +22813,7 @@ var RoundupTileTitle = function () {
|
|
|
22706
22813
|
/**
|
|
22707
22814
|
* Renders a chevron icon for a Roundup Tile.
|
|
22708
22815
|
*
|
|
22709
|
-
* @returns
|
|
22816
|
+
* @returns React.ReactElement
|
|
22710
22817
|
*/
|
|
22711
22818
|
var RoundupTileChevron = function () {
|
|
22712
22819
|
var _a, _b;
|
|
@@ -22731,7 +22838,7 @@ var RoundupTileChevron = function () {
|
|
|
22731
22838
|
* The PointsTile component renders a tile with media, title, and formatted points.
|
|
22732
22839
|
*
|
|
22733
22840
|
* @param props - Component props
|
|
22734
|
-
* @returns
|
|
22841
|
+
* @returns React.ReactElement or null if tile is inactive or missing required props
|
|
22735
22842
|
*/
|
|
22736
22843
|
var RoundupTileRoot = function (_a) {
|
|
22737
22844
|
var tile = _a.tile;
|
|
@@ -22859,5 +22966,7 @@ exports.TileContainer = TileContainer;
|
|
|
22859
22966
|
exports.WllSdkProvider = WllSdkProvider;
|
|
22860
22967
|
exports.alignMap = alignMap;
|
|
22861
22968
|
exports.justifyMap = justifyMap;
|
|
22969
|
+
exports.useInvalidateData = useInvalidateData;
|
|
22970
|
+
exports.usePullToRefresh = usePullToRefresh;
|
|
22862
22971
|
exports.useWllSdk = useWllSdk;
|
|
22863
22972
|
//# sourceMappingURL=web.js.map
|