@wlloyalty/wll-react-sdk 1.2.1 → 1.3.1
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 +1 -0
- package/dist/native.js +83 -21
- package/dist/native.js.map +1 -1
- package/dist/types/components/organisms/ContentTile/ContentTile.stories.d.ts +27 -0
- package/dist/types/components/organisms/Group/Group.stories.d.ts +1 -0
- package/dist/types/constants/responsive.d.ts +2 -2
- package/dist/types/context/WllSdkContext.d.ts +1 -0
- package/dist/web.js +84 -23
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,9 @@ export default _default;
|
|
|
5
5
|
export declare const FullSizeWelcomeTier: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
6
6
|
tile: import("../../../types/tile").Tile;
|
|
7
7
|
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
8
|
+
export declare const ImageWithLongTitleAndBody: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
9
|
+
tile: import("../../../types/tile").Tile;
|
|
10
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
8
11
|
export declare const FullSizeRewardHighlight: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
9
12
|
tile: import("../../../types/tile").Tile;
|
|
10
13
|
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
@@ -26,3 +29,27 @@ export declare const HalfSizeReferralBonus: import("@storybook/csf").AnnotatedSt
|
|
|
26
29
|
export declare const FullSizePartnerRewards: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
27
30
|
tile: import("../../../types/tile").Tile;
|
|
28
31
|
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
32
|
+
export declare const TitleOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
33
|
+
tile: import("../../../types/tile").Tile;
|
|
34
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
35
|
+
export declare const BodyOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
36
|
+
tile: import("../../../types/tile").Tile;
|
|
37
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
38
|
+
export declare const TitleAndBody: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
39
|
+
tile: import("../../../types/tile").Tile;
|
|
40
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
41
|
+
export declare const HalfSizeTitleOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
42
|
+
tile: import("../../../types/tile").Tile;
|
|
43
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
44
|
+
export declare const HalfSizeBodyOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
45
|
+
tile: import("../../../types/tile").Tile;
|
|
46
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
47
|
+
export declare const HalfSizeTitleAndBody: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
48
|
+
tile: import("../../../types/tile").Tile;
|
|
49
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
50
|
+
export declare const ResponsiveTest: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
51
|
+
tile: import("../../../types/tile").Tile;
|
|
52
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
53
|
+
export declare const HalfSizeArtworkOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
54
|
+
tile: import("../../../types/tile").Tile;
|
|
55
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
@@ -3,5 +3,5 @@ export declare const DIMENSION_MODES: {
|
|
|
3
3
|
TABLET: "tablet";
|
|
4
4
|
MOBILE: "mobile";
|
|
5
5
|
};
|
|
6
|
-
export declare const TABLET_SCREEN_WIDTH =
|
|
7
|
-
export declare const SMALL_SCREEN_WIDTH =
|
|
6
|
+
export declare const TABLET_SCREEN_WIDTH = 768;
|
|
7
|
+
export declare const SMALL_SCREEN_WIDTH = 480;
|
package/dist/web.js
CHANGED
|
@@ -7843,7 +7843,20 @@ var useNavigation = function (config) {
|
|
|
7843
7843
|
return handleNavigation;
|
|
7844
7844
|
};
|
|
7845
7845
|
|
|
7846
|
-
var
|
|
7846
|
+
var getBaseUrl = function (environment) {
|
|
7847
|
+
if (environment === void 0) {
|
|
7848
|
+
environment = 'STAGING';
|
|
7849
|
+
}
|
|
7850
|
+
switch (environment) {
|
|
7851
|
+
case 'PRODUCTION':
|
|
7852
|
+
return 'https://api.core.wlloyalty.net/v1';
|
|
7853
|
+
case 'DEVELOPMENT':
|
|
7854
|
+
return 'https://localhost:8080/v1';
|
|
7855
|
+
case 'STAGING':
|
|
7856
|
+
default:
|
|
7857
|
+
return 'https://api.staging.core.wlloyalty.net/v1';
|
|
7858
|
+
}
|
|
7859
|
+
};
|
|
7847
7860
|
var useCreateRequestOptions = function (config) {
|
|
7848
7861
|
return React.useCallback(function (options) {
|
|
7849
7862
|
if (options === void 0) {
|
|
@@ -7915,9 +7928,11 @@ var createResourceGetter = function (resource, includeHydrate) {
|
|
|
7915
7928
|
}
|
|
7916
7929
|
// Always append locale=en
|
|
7917
7930
|
params.append('locale', config.locale || 'en');
|
|
7931
|
+
var env = config.environment || 'STAGING';
|
|
7932
|
+
var baseUrl = getBaseUrl(env);
|
|
7918
7933
|
var queryString = params.toString();
|
|
7919
7934
|
return makeRequest("".concat(baseUrl, "/tiles-management/").concat(resource, "/").concat(id).concat(queryString ? "?".concat(queryString) : ''));
|
|
7920
|
-
}, [makeRequest]);
|
|
7935
|
+
}, [makeRequest, config.environment]);
|
|
7921
7936
|
};
|
|
7922
7937
|
};
|
|
7923
7938
|
var useGetGroupByID = createResourceGetter('groups', true);
|
|
@@ -8459,8 +8474,8 @@ var DIMENSION_MODES = {
|
|
|
8459
8474
|
TABLET: 'tablet',
|
|
8460
8475
|
MOBILE: 'mobile'
|
|
8461
8476
|
};
|
|
8462
|
-
var TABLET_SCREEN_WIDTH =
|
|
8463
|
-
var SMALL_SCREEN_WIDTH =
|
|
8477
|
+
var TABLET_SCREEN_WIDTH = 768;
|
|
8478
|
+
var SMALL_SCREEN_WIDTH = 480;
|
|
8464
8479
|
|
|
8465
8480
|
var isWeb = Platform$1.OS === 'web';
|
|
8466
8481
|
function getDimensionMode(window) {
|
|
@@ -8655,6 +8670,9 @@ var validateConfig = function (config) {
|
|
|
8655
8670
|
if (config.locale && !/^[a-z]{2}$/.test(config.locale)) {
|
|
8656
8671
|
throw new Error('Invalid locale format. Expected ISO 639-1 language code (e.g. "en")');
|
|
8657
8672
|
}
|
|
8673
|
+
if (!config.environment) {
|
|
8674
|
+
config.environment = 'STAGING';
|
|
8675
|
+
}
|
|
8658
8676
|
};
|
|
8659
8677
|
|
|
8660
8678
|
function createVariantSystem(baseStyle, variantStyles) {
|
|
@@ -18992,7 +19010,7 @@ var Text = function (_a) {
|
|
|
18992
19010
|
});
|
|
18993
19011
|
case 'title':
|
|
18994
19012
|
return __assign(__assign({}, baseStyle), {
|
|
18995
|
-
fontSize: useResponsiveValue(theme.sizes.
|
|
19013
|
+
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
18996
19014
|
fontWeight: 'bold'
|
|
18997
19015
|
});
|
|
18998
19016
|
case 'body':
|
|
@@ -19010,7 +19028,7 @@ var Text = function (_a) {
|
|
|
19010
19028
|
case 'label':
|
|
19011
19029
|
default:
|
|
19012
19030
|
return __assign(__assign({}, baseStyle), {
|
|
19013
|
-
fontSize: useResponsiveValue(theme.sizes.sm, theme.sizes.
|
|
19031
|
+
fontSize: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet)
|
|
19014
19032
|
});
|
|
19015
19033
|
}
|
|
19016
19034
|
};
|
|
@@ -20083,6 +20101,7 @@ var BadgeTileDateEarned = function () {
|
|
|
20083
20101
|
*/
|
|
20084
20102
|
var BadgeTileDescription = function () {
|
|
20085
20103
|
var tileContext = useTileContext();
|
|
20104
|
+
var width = useWindowDimensions().width;
|
|
20086
20105
|
if (!isContextValid(tileContext)) return null;
|
|
20087
20106
|
var _a = tileContext.configuration,
|
|
20088
20107
|
count = _a.count,
|
|
@@ -20092,13 +20111,23 @@ var BadgeTileDescription = function () {
|
|
|
20092
20111
|
// For Latest type, hide description when count = 0
|
|
20093
20112
|
// For Specific type, always show description
|
|
20094
20113
|
if (count === 0 && type === exports.BadgeTileType.Latest) return null;
|
|
20114
|
+
var numberOfLines = React.useMemo(function () {
|
|
20115
|
+
if (width <= 480) return 2;
|
|
20116
|
+
if (width <= 768) return 3;
|
|
20117
|
+
if (width <= 1024) return 1;
|
|
20118
|
+
return 2;
|
|
20119
|
+
}, [width]);
|
|
20095
20120
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
20096
20121
|
accessible: true,
|
|
20097
20122
|
accessibilityLabel: "Badge description: ".concat(description),
|
|
20098
|
-
testID: "badge-tile-description"
|
|
20123
|
+
testID: "badge-tile-description",
|
|
20124
|
+
style: {
|
|
20125
|
+
width: '100%',
|
|
20126
|
+
overflow: 'hidden'
|
|
20127
|
+
}
|
|
20099
20128
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
20100
20129
|
variant: "body",
|
|
20101
|
-
numberOfLines:
|
|
20130
|
+
numberOfLines: numberOfLines,
|
|
20102
20131
|
ellipsizeMode: "tail",
|
|
20103
20132
|
accessibilityElementsHidden: true,
|
|
20104
20133
|
importantForAccessibility: "no-hide-descendants"
|
|
@@ -20197,7 +20226,7 @@ var BadgeTileTitle = function () {
|
|
|
20197
20226
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
20198
20227
|
variant: "title",
|
|
20199
20228
|
style: styles.titleText,
|
|
20200
|
-
numberOfLines:
|
|
20229
|
+
numberOfLines: 1,
|
|
20201
20230
|
ellipsizeMode: "tail",
|
|
20202
20231
|
accessibilityElementsHidden: true,
|
|
20203
20232
|
importantForAccessibility: "no-hide-descendants"
|
|
@@ -20503,21 +20532,30 @@ var ContentTileMedia = function (_a) {
|
|
|
20503
20532
|
|
|
20504
20533
|
var ContentTileSummary = function () {
|
|
20505
20534
|
var tileContext = useTileContext();
|
|
20535
|
+
var sizeInfo = useTileSize(tileContext);
|
|
20506
20536
|
if (!isContextValid(tileContext)) return null;
|
|
20507
|
-
var
|
|
20537
|
+
var _a = tileContext.configuration,
|
|
20538
|
+
body = _a.body,
|
|
20539
|
+
title = _a.title,
|
|
20540
|
+
artworkUrl = _a.artworkUrl;
|
|
20508
20541
|
if (!body) return null;
|
|
20509
|
-
var sizeInfo = useTileSize(tileContext);
|
|
20510
20542
|
if (!sizeInfo) return null;
|
|
20511
|
-
var
|
|
20512
|
-
|
|
20513
|
-
|
|
20514
|
-
|
|
20515
|
-
|
|
20543
|
+
var isHalfSize = sizeInfo.isHalfSize;
|
|
20544
|
+
var numberOfLines = React.useMemo(function () {
|
|
20545
|
+
if (!body) return undefined;
|
|
20546
|
+
if (isHalfSize) {
|
|
20547
|
+
if (!title && body) return 4;
|
|
20548
|
+
if (title && body) return 2;
|
|
20549
|
+
}
|
|
20550
|
+
if (artworkUrl) return 3;
|
|
20551
|
+
if (!title) return 8;
|
|
20552
|
+
return 6;
|
|
20553
|
+
}, [title, body, artworkUrl, isHalfSize]);
|
|
20516
20554
|
return /*#__PURE__*/React.createElement(Text, {
|
|
20517
20555
|
variant: "body",
|
|
20518
20556
|
role: "article",
|
|
20519
20557
|
accessibilityLabel: body,
|
|
20520
|
-
numberOfLines:
|
|
20558
|
+
numberOfLines: numberOfLines,
|
|
20521
20559
|
testID: "content-tile-summary"
|
|
20522
20560
|
}, body);
|
|
20523
20561
|
};
|
|
@@ -20525,10 +20563,25 @@ var ContentTileSummary = function () {
|
|
|
20525
20563
|
var ContentTileTitle = function () {
|
|
20526
20564
|
var tileContext = useTileContext();
|
|
20527
20565
|
var styles = useContentTileStyles();
|
|
20566
|
+
var sizeInfo = useTileSize(tileContext);
|
|
20528
20567
|
if (!isContextValid(tileContext)) return null;
|
|
20529
20568
|
var _a = tileContext.configuration,
|
|
20530
20569
|
title = _a.title,
|
|
20531
|
-
ctaLink = _a.ctaLink
|
|
20570
|
+
ctaLink = _a.ctaLink,
|
|
20571
|
+
body = _a.body,
|
|
20572
|
+
artworkUrl = _a.artworkUrl;
|
|
20573
|
+
if (!sizeInfo) return null;
|
|
20574
|
+
var isHalfSize = sizeInfo.isHalfSize;
|
|
20575
|
+
var numberOfLines = React.useMemo(function () {
|
|
20576
|
+
if (!title) return undefined;
|
|
20577
|
+
if (isHalfSize) {
|
|
20578
|
+
if (title && !body) return 3;
|
|
20579
|
+
if (title && body) return 1;
|
|
20580
|
+
}
|
|
20581
|
+
if (artworkUrl) return 1;
|
|
20582
|
+
if (!body) return 7;
|
|
20583
|
+
return 2;
|
|
20584
|
+
}, [title, body, artworkUrl, isHalfSize]);
|
|
20532
20585
|
if (!title) return null;
|
|
20533
20586
|
var handleTitleWidth = function () {
|
|
20534
20587
|
if (IS_MOBILE && ctaLink) {
|
|
@@ -20539,7 +20592,7 @@ var ContentTileTitle = function () {
|
|
|
20539
20592
|
variant: "title",
|
|
20540
20593
|
role: "heading",
|
|
20541
20594
|
accessibilityLabel: title,
|
|
20542
|
-
numberOfLines:
|
|
20595
|
+
numberOfLines: numberOfLines,
|
|
20543
20596
|
style: handleTitleWidth(),
|
|
20544
20597
|
testID: "content-tile-title"
|
|
20545
20598
|
}, title);
|
|
@@ -20731,14 +20784,14 @@ var useSectionHeaderStyles = function () {
|
|
|
20731
20784
|
marginBottom: useResponsiveValue(theme.sizes.lg, theme.sizes.xxs, isDesktop, isTablet)
|
|
20732
20785
|
},
|
|
20733
20786
|
sectionTitle: {
|
|
20734
|
-
fontSize: useResponsiveValue(theme.sizes.
|
|
20787
|
+
fontSize: useResponsiveValue(theme.sizes.xxl, theme.sizes.xl, isDesktop, isTablet),
|
|
20735
20788
|
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
|
|
20736
20789
|
fontWeight: '700',
|
|
20737
20790
|
color: theme.text,
|
|
20738
20791
|
fontFamily: theme.fontFamily
|
|
20739
20792
|
},
|
|
20740
20793
|
sectionDescription: {
|
|
20741
|
-
fontSize: useResponsiveValue(theme.sizes.
|
|
20794
|
+
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
20742
20795
|
color: theme.alphaDerivedText[80],
|
|
20743
20796
|
fontFamily: theme.fontFamily
|
|
20744
20797
|
}
|
|
@@ -22245,13 +22298,21 @@ var RewardTilePoints = function () {
|
|
|
22245
22298
|
var RewardTileSummary = function () {
|
|
22246
22299
|
var tileContext = useTileContext();
|
|
22247
22300
|
if (!isContextValid(tileContext)) return null;
|
|
22248
|
-
var
|
|
22301
|
+
var _a = tileContext.configuration,
|
|
22302
|
+
summary = _a.summary,
|
|
22303
|
+
_b = _a.showPrice,
|
|
22304
|
+
showPrice = _b === void 0 ? true : _b,
|
|
22305
|
+
price = _a.price;
|
|
22306
|
+
var shouldShowPrice = showPrice && price !== undefined && price !== null && price !== 0;
|
|
22307
|
+
var numberOfLines = shouldShowPrice ? 1 : 3;
|
|
22249
22308
|
if (!summary) return null;
|
|
22250
22309
|
return /*#__PURE__*/React.createElement(Text, {
|
|
22251
22310
|
variant: "body",
|
|
22252
22311
|
role: "article",
|
|
22253
22312
|
accessibilityLabel: summary,
|
|
22254
|
-
testID: "reward-tile-summary"
|
|
22313
|
+
testID: "reward-tile-summary",
|
|
22314
|
+
numberOfLines: numberOfLines,
|
|
22315
|
+
ellipsizeMode: "tail"
|
|
22255
22316
|
}, summary);
|
|
22256
22317
|
};
|
|
22257
22318
|
|