@wlloyalty/wll-react-sdk 1.0.86 → 1.0.87
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 +134 -87
- package/dist/native.js.map +1 -1
- package/dist/types/components/organisms/ContentTile/content-tile-chevron.d.ts +1 -0
- package/dist/types/components/organisms/ContentTile/content-tile-media.d.ts +5 -1
- package/dist/types/components/organisms/ContentTile/content-tile-summary.d.ts +1 -0
- package/dist/types/components/organisms/ContentTile/content-tile-title.d.ts +1 -0
- package/dist/types/components/organisms/ContentTile/index.d.ts +6 -5
- package/dist/types/components/organisms/ContentTile/styles.d.ts +1 -1
- package/dist/types/constants/theme.d.ts +1 -1
- package/dist/web.js +418 -334
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/components/organisms/ContentTile/content-tile-body.d.ts +0 -1
- package/dist/types/components/organisms/ContentTile/content-tile-container.d.ts +0 -2
- package/dist/types/components/organisms/ContentTile/content-tile-content.d.ts +0 -2
- package/dist/types/components/organisms/ContentTile/content-tile-header.d.ts +0 -1
package/dist/web.js
CHANGED
|
@@ -6599,7 +6599,7 @@ function isPrimaryPointerDown(domEvent) {
|
|
|
6599
6599
|
* when touches end and start again.
|
|
6600
6600
|
*/
|
|
6601
6601
|
|
|
6602
|
-
var __DEV__$
|
|
6602
|
+
var __DEV__$4 = process.env.NODE_ENV !== 'production';
|
|
6603
6603
|
var MAX_TOUCH_BANK = 20;
|
|
6604
6604
|
function timestampForTouch(touch) {
|
|
6605
6605
|
// The legacy internal implementation provides "timeStamp", which has been
|
|
@@ -6642,7 +6642,7 @@ function getTouchIdentifier(_ref) {
|
|
|
6642
6642
|
if (identifier == null) {
|
|
6643
6643
|
console.error('Touch object is missing identifier.');
|
|
6644
6644
|
}
|
|
6645
|
-
if (__DEV__$
|
|
6645
|
+
if (__DEV__$4) {
|
|
6646
6646
|
if (identifier > MAX_TOUCH_BANK) {
|
|
6647
6647
|
console.error('Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK);
|
|
6648
6648
|
}
|
|
@@ -6740,7 +6740,7 @@ class ResponderTouchHistoryStore {
|
|
|
6740
6740
|
break;
|
|
6741
6741
|
}
|
|
6742
6742
|
}
|
|
6743
|
-
if (__DEV__$
|
|
6743
|
+
if (__DEV__$4) {
|
|
6744
6744
|
var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];
|
|
6745
6745
|
if (!(activeRecord != null && activeRecord.touchActive)) {
|
|
6746
6746
|
console.error('Cannot find single active touch.');
|
|
@@ -7964,195 +7964,6 @@ var defaultTheme = {
|
|
|
7964
7964
|
negative: '#ff0000'
|
|
7965
7965
|
};
|
|
7966
7966
|
|
|
7967
|
-
var COLOR_CONSTANTS = {
|
|
7968
|
-
MINIMUM_CONTRAST_RATIO: 2,
|
|
7969
|
-
DEFAULT_LIGHTNESS_ADJUSTMENT: 0.2,
|
|
7970
|
-
DESATURATION_LIGHTEN_AMOUNT: 0.8,
|
|
7971
|
-
DEFAULT_COLOR: '#FFFFFF'
|
|
7972
|
-
};
|
|
7973
|
-
|
|
7974
|
-
// Storybook Themes
|
|
7975
|
-
({
|
|
7976
|
-
modern: __assign(__assign({}, defaultTheme), {
|
|
7977
|
-
primary: '#f72585',
|
|
7978
|
-
accent: '#ffc300',
|
|
7979
|
-
background: '#e5e5e5',
|
|
7980
|
-
surface: '#f4f3ee',
|
|
7981
|
-
surfaceText: '#f72585'
|
|
7982
|
-
}),
|
|
7983
|
-
warm: __assign(__assign({}, defaultTheme), {
|
|
7984
|
-
primary: '#014F5C',
|
|
7985
|
-
accent: '#F38A51',
|
|
7986
|
-
background: '#BE9C80',
|
|
7987
|
-
surface: '#F1CFB3',
|
|
7988
|
-
surfaceText: '#014F5C'
|
|
7989
|
-
}),
|
|
7990
|
-
dark: __assign(__assign({}, defaultTheme), {
|
|
7991
|
-
background: '#1e1e1e',
|
|
7992
|
-
text: '#ffffff',
|
|
7993
|
-
primary: '#ffbe0b',
|
|
7994
|
-
accent: '#d00000',
|
|
7995
|
-
surface: '#2f3037',
|
|
7996
|
-
surfaceText: '#ffffff'
|
|
7997
|
-
}),
|
|
7998
|
-
forest: __assign(__assign({}, defaultTheme), {
|
|
7999
|
-
primary: '#354f52',
|
|
8000
|
-
accent: '#84a98c',
|
|
8001
|
-
background: '#f0f4f0',
|
|
8002
|
-
surface: '#cad2c5',
|
|
8003
|
-
surfaceText: '#2d3436'
|
|
8004
|
-
}),
|
|
8005
|
-
sunset: __assign(__assign({}, defaultTheme), {
|
|
8006
|
-
primary: '#c32f27',
|
|
8007
|
-
accent: '#db7c26',
|
|
8008
|
-
background: '#f9edcc',
|
|
8009
|
-
surface: '#f0dfad',
|
|
8010
|
-
surfaceText: '#2d3436'
|
|
8011
|
-
})
|
|
8012
|
-
});
|
|
8013
|
-
|
|
8014
|
-
var isValidColor = function (color) {
|
|
8015
|
-
try {
|
|
8016
|
-
Color(color);
|
|
8017
|
-
return true;
|
|
8018
|
-
} catch (_a) {
|
|
8019
|
-
return false;
|
|
8020
|
-
}
|
|
8021
|
-
};
|
|
8022
|
-
/**
|
|
8023
|
-
* Validates a theme object to ensure all required colors are present and valid
|
|
8024
|
-
* @param theme - Partial theme object to validate
|
|
8025
|
-
* @returns Boolean indicating if theme is valid
|
|
8026
|
-
*/
|
|
8027
|
-
var validateTheme = function (theme) {
|
|
8028
|
-
var requiredColors = ['accent', 'background', 'primary', 'surface', 'surfaceText', 'positive', 'negative', 'text'];
|
|
8029
|
-
return requiredColors.every(function (color) {
|
|
8030
|
-
return theme[color] && isValidColor(theme[color]);
|
|
8031
|
-
});
|
|
8032
|
-
};
|
|
8033
|
-
/**
|
|
8034
|
-
* Safely creates a Color instance with error handling
|
|
8035
|
-
* @param color - Color string to process
|
|
8036
|
-
* @returns Color instance or null if invalid
|
|
8037
|
-
*/
|
|
8038
|
-
var createSafeColor = function (color) {
|
|
8039
|
-
try {
|
|
8040
|
-
return Color(color);
|
|
8041
|
-
} catch (error) {
|
|
8042
|
-
console.error("Invalid color value: ".concat(color), error);
|
|
8043
|
-
return null;
|
|
8044
|
-
}
|
|
8045
|
-
};
|
|
8046
|
-
/**
|
|
8047
|
-
* Returns a derived color based on the background darkness
|
|
8048
|
-
* @param color - Base color to derive from
|
|
8049
|
-
* @returns Derived color string or default color if invalid
|
|
8050
|
-
*/
|
|
8051
|
-
var getDerivedColor = function (color) {
|
|
8052
|
-
var backgroundColor = createSafeColor(color);
|
|
8053
|
-
if (!backgroundColor) return COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8054
|
-
return backgroundColor.isDark() ? backgroundColor.lighten(COLOR_CONSTANTS.DEFAULT_LIGHTNESS_ADJUSTMENT).string() : backgroundColor.darken(COLOR_CONSTANTS.DEFAULT_LIGHTNESS_ADJUSTMENT).string();
|
|
8055
|
-
};
|
|
8056
|
-
/**
|
|
8057
|
-
* Determines the most readable text color (black or white) for a given background
|
|
8058
|
-
* @param backgroundColor - Background color to check against
|
|
8059
|
-
* @returns Hex color string for text
|
|
8060
|
-
*/
|
|
8061
|
-
var getReadableTextColor = function (backgroundColor) {
|
|
8062
|
-
var bgColor = createSafeColor(backgroundColor);
|
|
8063
|
-
if (!bgColor) return COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8064
|
-
var white = Color('#fff');
|
|
8065
|
-
var black = Color('#000');
|
|
8066
|
-
var contrastWithWhite = bgColor.contrast(white);
|
|
8067
|
-
return contrastWithWhite >= COLOR_CONSTANTS.MINIMUM_CONTRAST_RATIO ? white.hex() : black.hex();
|
|
8068
|
-
};
|
|
8069
|
-
var percentages = [5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95];
|
|
8070
|
-
/**
|
|
8071
|
-
* Generates a set of derived colors based on a base color and derivation function
|
|
8072
|
-
* @param color - Base color to derive from
|
|
8073
|
-
* @param derivationFunction - Function to generate variations
|
|
8074
|
-
* @returns Object containing derived colors at different percentages
|
|
8075
|
-
*/
|
|
8076
|
-
var generateDerivedColors = function (color, derivationFunction) {
|
|
8077
|
-
var baseColor = createSafeColor(color);
|
|
8078
|
-
if (!baseColor) {
|
|
8079
|
-
return percentages.reduce(function (acc, percentage) {
|
|
8080
|
-
acc[percentage] = COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8081
|
-
return acc;
|
|
8082
|
-
}, {});
|
|
8083
|
-
}
|
|
8084
|
-
var result = {};
|
|
8085
|
-
percentages.forEach(function (percentage) {
|
|
8086
|
-
try {
|
|
8087
|
-
var derivedColor = derivationFunction(baseColor, percentage);
|
|
8088
|
-
result[percentage] = derivedColor.toString();
|
|
8089
|
-
} catch (error) {
|
|
8090
|
-
console.error("Error generating derived color for ".concat(percentage, "%"), error);
|
|
8091
|
-
result[percentage] = COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8092
|
-
}
|
|
8093
|
-
});
|
|
8094
|
-
return result;
|
|
8095
|
-
};
|
|
8096
|
-
/**
|
|
8097
|
-
* Generates a set of colors with varying lightness based on the base color
|
|
8098
|
-
* @param color - Base color to derive from
|
|
8099
|
-
* @returns Object containing derived colors at different lightness levels
|
|
8100
|
-
*/
|
|
8101
|
-
var getDerivedColorPercentages = function (color) {
|
|
8102
|
-
var baseColor = createSafeColor(color);
|
|
8103
|
-
if (!baseColor) return generateDerivedColors(COLOR_CONSTANTS.DEFAULT_COLOR, function (color) {
|
|
8104
|
-
return color;
|
|
8105
|
-
});
|
|
8106
|
-
var isDark = baseColor.isDark();
|
|
8107
|
-
return generateDerivedColors(color, function (baseColor, percentage) {
|
|
8108
|
-
return isDark ? baseColor.lightness(percentage) : baseColor.lightness(100 - percentage);
|
|
8109
|
-
});
|
|
8110
|
-
};
|
|
8111
|
-
/**
|
|
8112
|
-
* Generates a set of colors with varying alpha values
|
|
8113
|
-
* @param color - Base color to derive from
|
|
8114
|
-
* @returns Object containing derived colors at different alpha levels
|
|
8115
|
-
*/
|
|
8116
|
-
var getAlphaDerivedColors = function (color) {
|
|
8117
|
-
return generateDerivedColors(color, function (baseColor, percentage) {
|
|
8118
|
-
return baseColor.alpha(percentage / 100);
|
|
8119
|
-
});
|
|
8120
|
-
};
|
|
8121
|
-
/**
|
|
8122
|
-
* Determines if a color should be desaturated based on type and count
|
|
8123
|
-
* @param type - Type of desaturation to apply
|
|
8124
|
-
* @param count - Count value affecting desaturation
|
|
8125
|
-
* @returns Boolean indicating if color should be desaturated
|
|
8126
|
-
*/
|
|
8127
|
-
var shouldDesaturate = function (type, count) {
|
|
8128
|
-
switch (type) {
|
|
8129
|
-
case 'SPECIFIC':
|
|
8130
|
-
return count === 0;
|
|
8131
|
-
default:
|
|
8132
|
-
return false;
|
|
8133
|
-
}
|
|
8134
|
-
};
|
|
8135
|
-
/**
|
|
8136
|
-
* Desaturates a color and lightens it
|
|
8137
|
-
* @param color - Color to desaturate
|
|
8138
|
-
* @returns Desaturated color string or default color if invalid
|
|
8139
|
-
*/
|
|
8140
|
-
var desaturateColor = function (color) {
|
|
8141
|
-
var baseColor = createSafeColor(color);
|
|
8142
|
-
if (!baseColor) return COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8143
|
-
return baseColor.grayscale().lighten(COLOR_CONSTANTS.DESATURATION_LIGHTEN_AMOUNT).toString();
|
|
8144
|
-
};
|
|
8145
|
-
/**
|
|
8146
|
-
* Gets the appropriate state color based on type and count
|
|
8147
|
-
* @param baseColor - Base color to process
|
|
8148
|
-
* @param type - Type of state
|
|
8149
|
-
* @param count - Count affecting the state
|
|
8150
|
-
* @returns Processed color string
|
|
8151
|
-
*/
|
|
8152
|
-
var getStateColor = function (baseColor, type, count) {
|
|
8153
|
-
return shouldDesaturate(type, count) ? desaturateColor(baseColor) : baseColor;
|
|
8154
|
-
};
|
|
8155
|
-
|
|
8156
7967
|
/**
|
|
8157
7968
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
8158
7969
|
*
|
|
@@ -8312,19 +8123,239 @@ class Dimensions {
|
|
|
8312
8123
|
}
|
|
8313
8124
|
};
|
|
8314
8125
|
}
|
|
8315
|
-
static removeEventListener(type, handler) {
|
|
8316
|
-
if (Array.isArray(listeners[type])) {
|
|
8317
|
-
listeners[type] = listeners[type].filter(_handler => _handler !== handler);
|
|
8126
|
+
static removeEventListener(type, handler) {
|
|
8127
|
+
if (Array.isArray(listeners[type])) {
|
|
8128
|
+
listeners[type] = listeners[type].filter(_handler => _handler !== handler);
|
|
8129
|
+
}
|
|
8130
|
+
}
|
|
8131
|
+
}
|
|
8132
|
+
if (canUseDOM$1) {
|
|
8133
|
+
if (window.visualViewport) {
|
|
8134
|
+
window.visualViewport.addEventListener('resize', handleResize, false);
|
|
8135
|
+
} else {
|
|
8136
|
+
window.addEventListener('resize', handleResize, false);
|
|
8137
|
+
}
|
|
8138
|
+
}
|
|
8139
|
+
|
|
8140
|
+
/**
|
|
8141
|
+
* Copyright (c) Nicolas Gallagher.
|
|
8142
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8143
|
+
*
|
|
8144
|
+
* This source code is licensed under the MIT license found in the
|
|
8145
|
+
* LICENSE file in the root directory of this source tree.
|
|
8146
|
+
*
|
|
8147
|
+
*
|
|
8148
|
+
*/
|
|
8149
|
+
|
|
8150
|
+
var Platform = {
|
|
8151
|
+
OS: 'web',
|
|
8152
|
+
select: obj => 'web' in obj ? obj.web : obj.default,
|
|
8153
|
+
get isTesting() {
|
|
8154
|
+
if (process.env.NODE_ENV === 'test') {
|
|
8155
|
+
return true;
|
|
8156
|
+
}
|
|
8157
|
+
return false;
|
|
8158
|
+
}
|
|
8159
|
+
};
|
|
8160
|
+
var Platform$1 = Platform;
|
|
8161
|
+
|
|
8162
|
+
var IS_WEB = Platform$1.OS === "web";
|
|
8163
|
+
var IS_IOS = Platform$1.OS === "ios";
|
|
8164
|
+
var IS_ANDROID = Platform$1.OS === "android";
|
|
8165
|
+
var IS_MOBILE = IS_IOS || IS_ANDROID;
|
|
8166
|
+
var _a$1 = Dimensions.get("window"),
|
|
8167
|
+
width = _a$1.width;
|
|
8168
|
+
_a$1.height;
|
|
8169
|
+
var SCREEN_WIDTH = width;
|
|
8170
|
+
|
|
8171
|
+
var COLOR_CONSTANTS = {
|
|
8172
|
+
MINIMUM_CONTRAST_RATIO: 2,
|
|
8173
|
+
DEFAULT_LIGHTNESS_ADJUSTMENT: 0.2,
|
|
8174
|
+
DESATURATION_LIGHTEN_AMOUNT: IS_WEB ? 0.8 : 0.2,
|
|
8175
|
+
DEFAULT_COLOR: '#FFFFFF'
|
|
8176
|
+
};
|
|
8177
|
+
|
|
8178
|
+
// Storybook Themes
|
|
8179
|
+
({
|
|
8180
|
+
modern: __assign(__assign({}, defaultTheme), {
|
|
8181
|
+
primary: '#f72585',
|
|
8182
|
+
accent: '#ffc300',
|
|
8183
|
+
background: '#e5e5e5',
|
|
8184
|
+
surface: '#f4f3ee',
|
|
8185
|
+
surfaceText: '#f72585'
|
|
8186
|
+
}),
|
|
8187
|
+
warm: __assign(__assign({}, defaultTheme), {
|
|
8188
|
+
primary: '#014F5C',
|
|
8189
|
+
accent: '#F38A51',
|
|
8190
|
+
background: '#BE9C80',
|
|
8191
|
+
surface: '#F1CFB3',
|
|
8192
|
+
surfaceText: '#014F5C'
|
|
8193
|
+
}),
|
|
8194
|
+
dark: __assign(__assign({}, defaultTheme), {
|
|
8195
|
+
background: '#1e1e1e',
|
|
8196
|
+
text: '#ffffff',
|
|
8197
|
+
primary: '#ffbe0b',
|
|
8198
|
+
accent: '#d00000',
|
|
8199
|
+
surface: '#2f3037',
|
|
8200
|
+
surfaceText: '#ffffff'
|
|
8201
|
+
}),
|
|
8202
|
+
forest: __assign(__assign({}, defaultTheme), {
|
|
8203
|
+
primary: '#354f52',
|
|
8204
|
+
accent: '#84a98c',
|
|
8205
|
+
background: '#f0f4f0',
|
|
8206
|
+
surface: '#cad2c5',
|
|
8207
|
+
surfaceText: '#2d3436'
|
|
8208
|
+
}),
|
|
8209
|
+
sunset: __assign(__assign({}, defaultTheme), {
|
|
8210
|
+
primary: '#c32f27',
|
|
8211
|
+
accent: '#db7c26',
|
|
8212
|
+
background: '#f9edcc',
|
|
8213
|
+
surface: '#f0dfad',
|
|
8214
|
+
surfaceText: '#2d3436'
|
|
8215
|
+
})
|
|
8216
|
+
});
|
|
8217
|
+
|
|
8218
|
+
var isValidColor = function (color) {
|
|
8219
|
+
try {
|
|
8220
|
+
Color(color);
|
|
8221
|
+
return true;
|
|
8222
|
+
} catch (_a) {
|
|
8223
|
+
return false;
|
|
8224
|
+
}
|
|
8225
|
+
};
|
|
8226
|
+
/**
|
|
8227
|
+
* Validates a theme object to ensure all required colors are present and valid
|
|
8228
|
+
* @param theme - Partial theme object to validate
|
|
8229
|
+
* @returns Boolean indicating if theme is valid
|
|
8230
|
+
*/
|
|
8231
|
+
var validateTheme = function (theme) {
|
|
8232
|
+
var requiredColors = ['accent', 'background', 'primary', 'surface', 'surfaceText', 'positive', 'negative', 'text'];
|
|
8233
|
+
return requiredColors.every(function (color) {
|
|
8234
|
+
return theme[color] && isValidColor(theme[color]);
|
|
8235
|
+
});
|
|
8236
|
+
};
|
|
8237
|
+
/**
|
|
8238
|
+
* Safely creates a Color instance with error handling
|
|
8239
|
+
* @param color - Color string to process
|
|
8240
|
+
* @returns Color instance or null if invalid
|
|
8241
|
+
*/
|
|
8242
|
+
var createSafeColor = function (color) {
|
|
8243
|
+
try {
|
|
8244
|
+
return Color(color);
|
|
8245
|
+
} catch (error) {
|
|
8246
|
+
console.error("Invalid color value: ".concat(color), error);
|
|
8247
|
+
return null;
|
|
8248
|
+
}
|
|
8249
|
+
};
|
|
8250
|
+
/**
|
|
8251
|
+
* Returns a derived color based on the background darkness
|
|
8252
|
+
* @param color - Base color to derive from
|
|
8253
|
+
* @returns Derived color string or default color if invalid
|
|
8254
|
+
*/
|
|
8255
|
+
var getDerivedColor = function (color) {
|
|
8256
|
+
var backgroundColor = createSafeColor(color);
|
|
8257
|
+
if (!backgroundColor) return COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8258
|
+
return backgroundColor.isDark() ? backgroundColor.lighten(COLOR_CONSTANTS.DEFAULT_LIGHTNESS_ADJUSTMENT).string() : backgroundColor.darken(COLOR_CONSTANTS.DEFAULT_LIGHTNESS_ADJUSTMENT).string();
|
|
8259
|
+
};
|
|
8260
|
+
/**
|
|
8261
|
+
* Determines the most readable text color (black or white) for a given background
|
|
8262
|
+
* @param backgroundColor - Background color to check against
|
|
8263
|
+
* @returns Hex color string for text
|
|
8264
|
+
*/
|
|
8265
|
+
var getReadableTextColor = function (backgroundColor) {
|
|
8266
|
+
var bgColor = createSafeColor(backgroundColor);
|
|
8267
|
+
if (!bgColor) return COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8268
|
+
var white = Color('#fff');
|
|
8269
|
+
var black = Color('#000');
|
|
8270
|
+
var contrastWithWhite = bgColor.contrast(white);
|
|
8271
|
+
return contrastWithWhite >= COLOR_CONSTANTS.MINIMUM_CONTRAST_RATIO ? white.hex() : black.hex();
|
|
8272
|
+
};
|
|
8273
|
+
var percentages = [5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95];
|
|
8274
|
+
/**
|
|
8275
|
+
* Generates a set of derived colors based on a base color and derivation function
|
|
8276
|
+
* @param color - Base color to derive from
|
|
8277
|
+
* @param derivationFunction - Function to generate variations
|
|
8278
|
+
* @returns Object containing derived colors at different percentages
|
|
8279
|
+
*/
|
|
8280
|
+
var generateDerivedColors = function (color, derivationFunction) {
|
|
8281
|
+
var baseColor = createSafeColor(color);
|
|
8282
|
+
if (!baseColor) {
|
|
8283
|
+
return percentages.reduce(function (acc, percentage) {
|
|
8284
|
+
acc[percentage] = COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8285
|
+
return acc;
|
|
8286
|
+
}, {});
|
|
8287
|
+
}
|
|
8288
|
+
var result = {};
|
|
8289
|
+
percentages.forEach(function (percentage) {
|
|
8290
|
+
try {
|
|
8291
|
+
var derivedColor = derivationFunction(baseColor, percentage);
|
|
8292
|
+
result[percentage] = derivedColor.toString();
|
|
8293
|
+
} catch (error) {
|
|
8294
|
+
console.error("Error generating derived color for ".concat(percentage, "%"), error);
|
|
8295
|
+
result[percentage] = COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8318
8296
|
}
|
|
8297
|
+
});
|
|
8298
|
+
return result;
|
|
8299
|
+
};
|
|
8300
|
+
/**
|
|
8301
|
+
* Generates a set of colors with varying lightness based on the base color
|
|
8302
|
+
* @param color - Base color to derive from
|
|
8303
|
+
* @returns Object containing derived colors at different lightness levels
|
|
8304
|
+
*/
|
|
8305
|
+
var getDerivedColorPercentages = function (color) {
|
|
8306
|
+
var baseColor = createSafeColor(color);
|
|
8307
|
+
if (!baseColor) return generateDerivedColors(COLOR_CONSTANTS.DEFAULT_COLOR, function (color) {
|
|
8308
|
+
return color;
|
|
8309
|
+
});
|
|
8310
|
+
var isDark = baseColor.isDark();
|
|
8311
|
+
return generateDerivedColors(color, function (baseColor, percentage) {
|
|
8312
|
+
return isDark ? baseColor.lightness(percentage) : baseColor.lightness(100 - percentage);
|
|
8313
|
+
});
|
|
8314
|
+
};
|
|
8315
|
+
/**
|
|
8316
|
+
* Generates a set of colors with varying alpha values
|
|
8317
|
+
* @param color - Base color to derive from
|
|
8318
|
+
* @returns Object containing derived colors at different alpha levels
|
|
8319
|
+
*/
|
|
8320
|
+
var getAlphaDerivedColors = function (color) {
|
|
8321
|
+
return generateDerivedColors(color, function (baseColor, percentage) {
|
|
8322
|
+
return baseColor.alpha(percentage / 100);
|
|
8323
|
+
});
|
|
8324
|
+
};
|
|
8325
|
+
/**
|
|
8326
|
+
* Determines if a color should be desaturated based on type and count
|
|
8327
|
+
* @param type - Type of desaturation to apply
|
|
8328
|
+
* @param count - Count value affecting desaturation
|
|
8329
|
+
* @returns Boolean indicating if color should be desaturated
|
|
8330
|
+
*/
|
|
8331
|
+
var shouldDesaturate = function (type, count) {
|
|
8332
|
+
switch (type) {
|
|
8333
|
+
case 'SPECIFIC':
|
|
8334
|
+
return count === 0;
|
|
8335
|
+
default:
|
|
8336
|
+
return false;
|
|
8319
8337
|
}
|
|
8320
|
-
}
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8338
|
+
};
|
|
8339
|
+
/**
|
|
8340
|
+
* Desaturates a color and lightens it
|
|
8341
|
+
* @param color - Color to desaturate
|
|
8342
|
+
* @returns Desaturated color string or default color if invalid
|
|
8343
|
+
*/
|
|
8344
|
+
var desaturateColor = function (color) {
|
|
8345
|
+
var baseColor = createSafeColor(color);
|
|
8346
|
+
if (!baseColor) return COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8347
|
+
return baseColor.grayscale().lighten(COLOR_CONSTANTS.DESATURATION_LIGHTEN_AMOUNT).toString();
|
|
8348
|
+
};
|
|
8349
|
+
/**
|
|
8350
|
+
* Gets the appropriate state color based on type and count
|
|
8351
|
+
* @param baseColor - Base color to process
|
|
8352
|
+
* @param type - Type of state
|
|
8353
|
+
* @param count - Count affecting the state
|
|
8354
|
+
* @returns Processed color string
|
|
8355
|
+
*/
|
|
8356
|
+
var getStateColor = function (baseColor, type, count) {
|
|
8357
|
+
return shouldDesaturate(type, count) ? desaturateColor(baseColor) : baseColor;
|
|
8358
|
+
};
|
|
8328
8359
|
|
|
8329
8360
|
var DIMENSION_MODES = {
|
|
8330
8361
|
DESKTOP: 'desktop',
|
|
@@ -8334,28 +8365,6 @@ var DIMENSION_MODES = {
|
|
|
8334
8365
|
var TABLET_SCREEN_WIDTH = 728;
|
|
8335
8366
|
var SMALL_SCREEN_WIDTH = 530;
|
|
8336
8367
|
|
|
8337
|
-
/**
|
|
8338
|
-
* Copyright (c) Nicolas Gallagher.
|
|
8339
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8340
|
-
*
|
|
8341
|
-
* This source code is licensed under the MIT license found in the
|
|
8342
|
-
* LICENSE file in the root directory of this source tree.
|
|
8343
|
-
*
|
|
8344
|
-
*
|
|
8345
|
-
*/
|
|
8346
|
-
|
|
8347
|
-
var Platform = {
|
|
8348
|
-
OS: 'web',
|
|
8349
|
-
select: obj => 'web' in obj ? obj.web : obj.default,
|
|
8350
|
-
get isTesting() {
|
|
8351
|
-
if (process.env.NODE_ENV === 'test') {
|
|
8352
|
-
return true;
|
|
8353
|
-
}
|
|
8354
|
-
return false;
|
|
8355
|
-
}
|
|
8356
|
-
};
|
|
8357
|
-
var Platform$1 = Platform;
|
|
8358
|
-
|
|
8359
8368
|
var isWeb = Platform$1.OS === 'web';
|
|
8360
8369
|
function getDimensionMode(window) {
|
|
8361
8370
|
if (!window || !window.width) {
|
|
@@ -10905,9 +10914,9 @@ function _isEntirelyVisible(top, bottom, viewportHeight) {
|
|
|
10905
10914
|
}
|
|
10906
10915
|
var ViewabilityHelper$1 = ViewabilityHelper;
|
|
10907
10916
|
|
|
10908
|
-
var __DEV__$
|
|
10917
|
+
var __DEV__$3 = process.env.NODE_ENV !== 'production';
|
|
10909
10918
|
var VirtualizedListContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
10910
|
-
if (__DEV__$
|
|
10919
|
+
if (__DEV__$3) {
|
|
10911
10920
|
VirtualizedListContext.displayName = 'VirtualizedListContext';
|
|
10912
10921
|
}
|
|
10913
10922
|
|
|
@@ -11277,7 +11286,7 @@ Object.defineProperty(nullthrows$2.exports, '__esModule', {value: true});
|
|
|
11277
11286
|
var nullthrowsExports = nullthrows$2.exports;
|
|
11278
11287
|
var nullthrows$1 = /*@__PURE__*/getDefaultExportFromCjs(nullthrowsExports);
|
|
11279
11288
|
|
|
11280
|
-
var __DEV__$
|
|
11289
|
+
var __DEV__$2 = process.env.NODE_ENV !== 'production';
|
|
11281
11290
|
var ON_EDGE_REACHED_EPSILON = 0.001;
|
|
11282
11291
|
var _usedIndexForKey = false;
|
|
11283
11292
|
var _keylessItemComponentName = '';
|
|
@@ -11986,7 +11995,7 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
11986
11995
|
console.warn("initialScrollIndex \"" + initialScrollIndex + "\" is not valid (list has " + itemCount + " items)");
|
|
11987
11996
|
this._hasWarned.initialScrollIndex = true;
|
|
11988
11997
|
}
|
|
11989
|
-
if (__DEV__$
|
|
11998
|
+
if (__DEV__$2 && !this._hasWarned.flexWrap) {
|
|
11990
11999
|
// $FlowFixMe[underconstrained-implicit-instantiation]
|
|
11991
12000
|
var flatStyles = StyleSheet$1.flatten(this.props.contentContainerStyle);
|
|
11992
12001
|
if (flatStyles != null && flatStyles.flexWrap === 'wrap') {
|
|
@@ -13938,7 +13947,7 @@ var AnimatedWithChildren$1 = AnimatedWithChildren;
|
|
|
13938
13947
|
* @format
|
|
13939
13948
|
*/
|
|
13940
13949
|
|
|
13941
|
-
var __DEV__$
|
|
13950
|
+
var __DEV__$1 = process.env.NODE_ENV !== 'production';
|
|
13942
13951
|
var linear = t => t;
|
|
13943
13952
|
|
|
13944
13953
|
/**
|
|
@@ -13951,7 +13960,7 @@ function createInterpolation(config) {
|
|
|
13951
13960
|
}
|
|
13952
13961
|
var outputRange = config.outputRange;
|
|
13953
13962
|
var inputRange = config.inputRange;
|
|
13954
|
-
if (__DEV__$
|
|
13963
|
+
if (__DEV__$1) {
|
|
13955
13964
|
checkInfiniteRange('outputRange', outputRange);
|
|
13956
13965
|
checkInfiniteRange('inputRange', inputRange);
|
|
13957
13966
|
checkValidInputRange(inputRange);
|
|
@@ -14166,7 +14175,7 @@ class AnimatedInterpolation extends AnimatedWithChildren$1 {
|
|
|
14166
14175
|
return range.map(NativeAnimatedHelper.transformDataType);
|
|
14167
14176
|
}
|
|
14168
14177
|
__getNativeConfig() {
|
|
14169
|
-
if (__DEV__$
|
|
14178
|
+
if (__DEV__$1) {
|
|
14170
14179
|
NativeAnimatedHelper.validateInterpolation(this._config);
|
|
14171
14180
|
}
|
|
14172
14181
|
return {
|
|
@@ -14455,7 +14464,7 @@ var AnimatedValue$1 = AnimatedValue;
|
|
|
14455
14464
|
* @format
|
|
14456
14465
|
*/
|
|
14457
14466
|
|
|
14458
|
-
var __DEV__
|
|
14467
|
+
var __DEV__ = process.env.NODE_ENV !== 'production';
|
|
14459
14468
|
function attachNativeEvent(viewRef, eventName, argMapping) {
|
|
14460
14469
|
// Find animated values in `argMapping` and create an array representing their
|
|
14461
14470
|
// key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x'].
|
|
@@ -14549,7 +14558,7 @@ class AnimatedEvent {
|
|
|
14549
14558
|
__getHandler() {
|
|
14550
14559
|
var _this = this;
|
|
14551
14560
|
if (this.__isNative) {
|
|
14552
|
-
if (__DEV__
|
|
14561
|
+
if (__DEV__) {
|
|
14553
14562
|
var _validatedMapping = false;
|
|
14554
14563
|
return function () {
|
|
14555
14564
|
for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
|
|
@@ -14570,7 +14579,7 @@ class AnimatedEvent {
|
|
|
14570
14579
|
for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
|
14571
14580
|
args[_key3] = arguments[_key3];
|
|
14572
14581
|
}
|
|
14573
|
-
if (__DEV__
|
|
14582
|
+
if (__DEV__ && !validatedMapping) {
|
|
14574
14583
|
validateMapping(_this._argMapping, args);
|
|
14575
14584
|
validatedMapping = true;
|
|
14576
14585
|
}
|
|
@@ -18772,14 +18781,6 @@ var ProgressBar = function (_a) {
|
|
|
18772
18781
|
}));
|
|
18773
18782
|
};
|
|
18774
18783
|
|
|
18775
|
-
var IS_WEB = Platform$1.OS === "web";
|
|
18776
|
-
Platform$1.OS === "ios";
|
|
18777
|
-
Platform$1.OS === "android";
|
|
18778
|
-
var _a$1 = Dimensions.get("window"),
|
|
18779
|
-
width = _a$1.width;
|
|
18780
|
-
_a$1.height;
|
|
18781
|
-
var SCREEN_WIDTH = width;
|
|
18782
|
-
|
|
18783
18784
|
var ProgressiveImage = function (_a) {
|
|
18784
18785
|
var source = _a.source,
|
|
18785
18786
|
style = _a.style,
|
|
@@ -18801,10 +18802,17 @@ var ProgressiveImage = function (_a) {
|
|
|
18801
18802
|
var baseColor = theme.alphaDerivedPrimary[20];
|
|
18802
18803
|
var desaturatedColor = desaturateColor(baseColor);
|
|
18803
18804
|
var backgroundColor = isDesaturated ? desaturatedColor : baseColor;
|
|
18804
|
-
//
|
|
18805
|
-
var
|
|
18806
|
-
|
|
18807
|
-
|
|
18805
|
+
// Create base animated image
|
|
18806
|
+
var baseImage = /*#__PURE__*/React.createElement(Animated$1.Image, __assign({}, props, {
|
|
18807
|
+
source: source,
|
|
18808
|
+
style: [styles$7.imageOverlay, __assign({
|
|
18809
|
+
opacity: imageAnimated
|
|
18810
|
+
}, IS_WEB && {
|
|
18811
|
+
filter: isDesaturated ? 'grayscale(100%)' : undefined
|
|
18812
|
+
})],
|
|
18813
|
+
onLoad: onImageLoad,
|
|
18814
|
+
accessibilityLabel: alt
|
|
18815
|
+
}));
|
|
18808
18816
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
18809
18817
|
style: [styles$7.container, style, {
|
|
18810
18818
|
backgroundColor: backgroundColor
|
|
@@ -18817,14 +18825,19 @@ var ProgressiveImage = function (_a) {
|
|
|
18817
18825
|
outputRange: [1, 0]
|
|
18818
18826
|
})
|
|
18819
18827
|
}]
|
|
18820
|
-
}),
|
|
18828
|
+
}), IS_WEB ? baseImage : (
|
|
18829
|
+
/*#__PURE__*/
|
|
18830
|
+
// For React Native, use the overlay technique
|
|
18831
|
+
React.createElement(React.Fragment, null, baseImage, isDesaturated && (/*#__PURE__*/React.createElement(Animated$1.Image, __assign({}, props, {
|
|
18821
18832
|
source: source,
|
|
18822
|
-
style: [styles$7.imageOverlay,
|
|
18823
|
-
opacity: imageAnimated
|
|
18824
|
-
|
|
18825
|
-
|
|
18826
|
-
|
|
18827
|
-
|
|
18833
|
+
style: [styles$7.imageOverlay, {
|
|
18834
|
+
opacity: imageAnimated.interpolate({
|
|
18835
|
+
inputRange: [0, 1],
|
|
18836
|
+
outputRange: [0, 0.8]
|
|
18837
|
+
}),
|
|
18838
|
+
tintColor: 'gray'
|
|
18839
|
+
}]
|
|
18840
|
+
}))))));
|
|
18828
18841
|
};
|
|
18829
18842
|
var styles$7 = StyleSheet$1.create({
|
|
18830
18843
|
imageOverlay: {
|
|
@@ -20078,7 +20091,7 @@ var BannerTileTitle = function () {
|
|
|
20078
20091
|
* @param configuration - The configuration object of the tile.
|
|
20079
20092
|
* @returns `true` if the tile has no title, description, or CTA text.
|
|
20080
20093
|
*/
|
|
20081
|
-
var isArtworkOnly$
|
|
20094
|
+
var isArtworkOnly$2 = function (configuration) {
|
|
20082
20095
|
if (!configuration) return true;
|
|
20083
20096
|
return !configuration.title && !configuration.description && !configuration.ctaText;
|
|
20084
20097
|
};
|
|
@@ -20097,7 +20110,7 @@ var BannerTileRoot = function (_a) {
|
|
|
20097
20110
|
return /*#__PURE__*/React.createElement(BaseBanner, {
|
|
20098
20111
|
tile: tile
|
|
20099
20112
|
}, /*#__PURE__*/React.createElement(BannerTile.Media, {
|
|
20100
|
-
isArtworkOnly: isArtworkOnly$
|
|
20113
|
+
isArtworkOnly: isArtworkOnly$2(configuration)
|
|
20101
20114
|
}), /*#__PURE__*/React.createElement(FullFlex, null, /*#__PURE__*/React.createElement(BannerTile.Title, null), /*#__PURE__*/React.createElement(BannerTile.Description, null), /*#__PURE__*/React.createElement(BannerTile.CTA, null)));
|
|
20102
20115
|
};
|
|
20103
20116
|
/**
|
|
@@ -20111,13 +20124,20 @@ var BannerTile = Object.assign(BannerTileRoot, {
|
|
|
20111
20124
|
});
|
|
20112
20125
|
var BannerTile$1 = withTileFetching(BannerTile);
|
|
20113
20126
|
|
|
20114
|
-
var
|
|
20115
|
-
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
var
|
|
20120
|
-
|
|
20127
|
+
var ContentTileChevron = function () {
|
|
20128
|
+
var _a, _b;
|
|
20129
|
+
var tileContext = useTileContext();
|
|
20130
|
+
var sdk = useWllSdk();
|
|
20131
|
+
if (!isContextValid(tileContext)) return null;
|
|
20132
|
+
var ctaLink = tileContext.configuration.ctaLink;
|
|
20133
|
+
if (!ctaLink) return null;
|
|
20134
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
20135
|
+
name: "ChevronRight",
|
|
20136
|
+
size: IS_MOBILE ? 16 : undefined,
|
|
20137
|
+
color: (_b = (_a = sdk.theme) === null || _a === void 0 ? void 0 : _a.derivedSurfaceText) === null || _b === void 0 ? void 0 : _b[20],
|
|
20138
|
+
accessibilityLabel: "View details",
|
|
20139
|
+
testID: "content-tile-chevron"
|
|
20140
|
+
});
|
|
20121
20141
|
};
|
|
20122
20142
|
|
|
20123
20143
|
/**
|
|
@@ -20126,67 +20146,156 @@ var ContentTileContainer = function (_a) {
|
|
|
20126
20146
|
*
|
|
20127
20147
|
* @returns StyleSheet styles for the ContentTile component
|
|
20128
20148
|
*/
|
|
20129
|
-
var useContentTileStyles = function () {
|
|
20130
|
-
|
|
20149
|
+
var useContentTileStyles = function (hasArtwork) {
|
|
20150
|
+
if (hasArtwork === void 0) {
|
|
20151
|
+
hasArtwork = false;
|
|
20152
|
+
}
|
|
20131
20153
|
var _a = useResponsive$1(),
|
|
20132
20154
|
isDesktop = _a.isDesktop,
|
|
20133
20155
|
isTablet = _a.isTablet;
|
|
20156
|
+
var theme = useWllSdk().theme;
|
|
20157
|
+
var getHeaderStyle = function (hasArtwork) {
|
|
20158
|
+
return __assign({
|
|
20159
|
+
width: '100%',
|
|
20160
|
+
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
|
|
20161
|
+
}, hasArtwork && {
|
|
20162
|
+
marginTop: useResponsiveValue(theme.sizes.xs, theme.sizes.xxs, isDesktop, isTablet)
|
|
20163
|
+
});
|
|
20164
|
+
};
|
|
20134
20165
|
return StyleSheet$1.create({
|
|
20166
|
+
imageContainer: {
|
|
20167
|
+
width: '100%',
|
|
20168
|
+
marginBottom: 0
|
|
20169
|
+
},
|
|
20170
|
+
image: {
|
|
20171
|
+
position: 'absolute',
|
|
20172
|
+
top: 0,
|
|
20173
|
+
left: 0,
|
|
20174
|
+
bottom: 0,
|
|
20175
|
+
right: 0,
|
|
20176
|
+
width: '100%',
|
|
20177
|
+
height: '100%',
|
|
20178
|
+
resizeMode: 'cover'
|
|
20179
|
+
},
|
|
20135
20180
|
content: {
|
|
20136
20181
|
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
20137
|
-
flex: 1
|
|
20138
|
-
justifyContent: 'center'
|
|
20182
|
+
flex: 1
|
|
20139
20183
|
},
|
|
20140
|
-
|
|
20141
|
-
width: '100%'
|
|
20142
|
-
}
|
|
20184
|
+
header: getHeaderStyle(hasArtwork)
|
|
20143
20185
|
});
|
|
20144
20186
|
};
|
|
20145
20187
|
|
|
20146
|
-
var
|
|
20147
|
-
var
|
|
20148
|
-
var
|
|
20149
|
-
|
|
20150
|
-
|
|
20151
|
-
|
|
20188
|
+
var ContentTileMedia = function (_a) {
|
|
20189
|
+
var isArtworkOnly = _a.isArtworkOnly;
|
|
20190
|
+
var tileContext = useTileContext();
|
|
20191
|
+
if (!isContextValid(tileContext)) return null;
|
|
20192
|
+
var _b = tileContext.configuration,
|
|
20193
|
+
artworkUrl = _b.artworkUrl,
|
|
20194
|
+
_c = _b.title,
|
|
20195
|
+
title = _c === void 0 ? '' : _c;
|
|
20196
|
+
if (!artworkUrl) return null;
|
|
20197
|
+
var hasArtwork = Boolean(artworkUrl);
|
|
20198
|
+
var styles = useContentTileStyles(hasArtwork);
|
|
20199
|
+
var containerStyle = {
|
|
20200
|
+
flexBasis: isArtworkOnly ? '100%' : '50%'
|
|
20201
|
+
};
|
|
20202
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20203
|
+
style: [styles.imageContainer, containerStyle],
|
|
20204
|
+
testID: "content-tile-media",
|
|
20205
|
+
accessibilityRole: "image",
|
|
20206
|
+
accessibilityLabel: "Image for ".concat(title)
|
|
20207
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
20208
|
+
source: {
|
|
20209
|
+
uri: artworkUrl
|
|
20210
|
+
},
|
|
20211
|
+
style: styles.image,
|
|
20212
|
+
alt: "Image for ".concat(title)
|
|
20213
|
+
}));
|
|
20214
|
+
};
|
|
20215
|
+
|
|
20216
|
+
var ContentTileSummary = function () {
|
|
20217
|
+
var tileContext = useTileContext();
|
|
20218
|
+
if (!isContextValid(tileContext)) return null;
|
|
20219
|
+
var body = tileContext.configuration.body;
|
|
20220
|
+
if (!body) return null;
|
|
20221
|
+
var sizeInfo = useTileSize(tileContext);
|
|
20222
|
+
if (!sizeInfo) return null;
|
|
20223
|
+
var isFullSize = sizeInfo.isFullSize,
|
|
20224
|
+
isHalfSize = sizeInfo.isHalfSize;
|
|
20225
|
+
var getNumberOfLines = function () {
|
|
20226
|
+
return isFullSize ? 3 : isHalfSize ? 4 : 3;
|
|
20227
|
+
};
|
|
20228
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20229
|
+
variant: "body",
|
|
20230
|
+
accessibilityRole: "text",
|
|
20231
|
+
accessibilityLabel: body,
|
|
20232
|
+
numberOfLines: getNumberOfLines(),
|
|
20233
|
+
testID: "content-tile-summary"
|
|
20234
|
+
}, body);
|
|
20152
20235
|
};
|
|
20153
20236
|
|
|
20154
|
-
var
|
|
20237
|
+
var ContentTileTitle = function () {
|
|
20155
20238
|
var tileContext = useTileContext();
|
|
20156
20239
|
if (!isContextValid(tileContext)) return null;
|
|
20157
20240
|
var title = tileContext.configuration.title;
|
|
20158
20241
|
if (!title) return null;
|
|
20159
|
-
return /*#__PURE__*/React.createElement(
|
|
20242
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20243
|
+
variant: "title",
|
|
20244
|
+
accessibilityRole: "header",
|
|
20245
|
+
accessibilityLabel: title,
|
|
20246
|
+
numberOfLines: 1,
|
|
20247
|
+
testID: "content-tile-title"
|
|
20248
|
+
}, title);
|
|
20160
20249
|
};
|
|
20161
20250
|
|
|
20162
|
-
|
|
20163
|
-
|
|
20164
|
-
|
|
20165
|
-
|
|
20166
|
-
|
|
20251
|
+
/**
|
|
20252
|
+
* Helper function to determine if the tile should display artwork only.
|
|
20253
|
+
*
|
|
20254
|
+
* @param configuration - The configuration object of the tile.
|
|
20255
|
+
* @returns `true` if the tile should display artwork only.
|
|
20256
|
+
*/
|
|
20257
|
+
var isArtworkOnly$1 = function (configuration) {
|
|
20258
|
+
if (!configuration) return false;
|
|
20259
|
+
return !configuration.title && !configuration.body;
|
|
20167
20260
|
};
|
|
20168
|
-
|
|
20169
20261
|
/**
|
|
20170
|
-
* The ContentTile component renders a tile with
|
|
20262
|
+
* The ContentTile component renders a tile with media, title, summary, and a chevron.
|
|
20263
|
+
* This follows the same structure as RewardTile for consistent layout.
|
|
20171
20264
|
*
|
|
20172
|
-
* @param
|
|
20265
|
+
* @param {ContentTileProps} props - Component props
|
|
20266
|
+
* @param {Tile} props.tile - The tile data to render
|
|
20267
|
+
* @returns JSX.Element or null if tile is inactive
|
|
20173
20268
|
*/
|
|
20174
20269
|
var ContentTileRoot = function (_a) {
|
|
20175
20270
|
var tile = _a.tile;
|
|
20176
|
-
if (!tile || !tile.active) return null;
|
|
20271
|
+
if (!tile || !tile.active || !tile.configuration) return null;
|
|
20272
|
+
var configuration = tile.configuration;
|
|
20273
|
+
var hasArtwork = Boolean(configuration.artworkUrl);
|
|
20274
|
+
var styles = useContentTileStyles(hasArtwork);
|
|
20177
20275
|
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
20178
20276
|
tile: tile
|
|
20179
|
-
}, /*#__PURE__*/React.createElement(ContentTile.
|
|
20277
|
+
}, /*#__PURE__*/React.createElement(ContentTile.Media, {
|
|
20278
|
+
isArtworkOnly: isArtworkOnly$1(configuration)
|
|
20279
|
+
}), /*#__PURE__*/React.createElement(Layout, {
|
|
20280
|
+
justify: hasArtwork ? 'start' : 'center',
|
|
20281
|
+
style: {
|
|
20282
|
+
paddingBottom: 0,
|
|
20283
|
+
marginBottom: 0
|
|
20284
|
+
}
|
|
20285
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
20286
|
+
justify: "between",
|
|
20287
|
+
align: "center",
|
|
20288
|
+
style: styles.header
|
|
20289
|
+
}, /*#__PURE__*/React.createElement(ContentTile.Title, null), /*#__PURE__*/React.createElement(ContentTile.Chevron, null)), /*#__PURE__*/React.createElement(ContentTile.Summary, null)));
|
|
20180
20290
|
};
|
|
20181
20291
|
/**
|
|
20182
20292
|
* The ContentTile component with subcomponents attached.
|
|
20183
20293
|
*/
|
|
20184
20294
|
var ContentTile = Object.assign(ContentTileRoot, {
|
|
20185
|
-
Container: ContentTileContainer,
|
|
20186
20295
|
Media: ContentTileMedia,
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20296
|
+
Title: ContentTileTitle,
|
|
20297
|
+
Summary: ContentTileSummary,
|
|
20298
|
+
Chevron: ContentTileChevron
|
|
20190
20299
|
});
|
|
20191
20300
|
var ContentTile$1 = withTileFetching(ContentTile);
|
|
20192
20301
|
|
|
@@ -20561,21 +20670,9 @@ var Grid = function (_a) {
|
|
|
20561
20670
|
height: 'auto'
|
|
20562
20671
|
};
|
|
20563
20672
|
} else {
|
|
20564
|
-
// Calculate available width accounting for screen width and section padding
|
|
20565
20673
|
var availableWidth = SCREEN_WIDTH - GRID_GAP * 2;
|
|
20566
20674
|
var gapSpace = (columns - 1) * GRID_GAP;
|
|
20567
20675
|
var tileWidth = Math.floor((availableWidth - gapSpace) / columns);
|
|
20568
|
-
var halfTileHeight = Math.floor(tileWidth / 2);
|
|
20569
|
-
// Detailed logging for debugging
|
|
20570
|
-
console.log('=== GRID DEBUG ===');
|
|
20571
|
-
console.log("SCREEN_WIDTH: ".concat(SCREEN_WIDTH, "px, GRID_GAP: ").concat(GRID_GAP, "px"));
|
|
20572
|
-
console.log("Columns: ".concat(columns, ", Section padding: ").concat(GRID_GAP * 2, "px"));
|
|
20573
|
-
console.log("Available width: ".concat(availableWidth, "px, Gap space: ").concat(gapSpace, "px"));
|
|
20574
|
-
console.log("Calculated tile width: ".concat(tileWidth, "px"));
|
|
20575
|
-
console.log("Half tile height should be: ".concat(halfTileHeight, "px"));
|
|
20576
|
-
console.log("Expected full tile: ".concat(tileWidth, "x").concat(tileWidth, "px"));
|
|
20577
|
-
console.log("Expected half tile: ".concat(tileWidth, "x").concat(halfTileHeight, "px"));
|
|
20578
|
-
console.log('=== END DEBUG ===');
|
|
20579
20676
|
return {
|
|
20580
20677
|
width: tileWidth,
|
|
20581
20678
|
marginBottom: GRID_GAP,
|
|
@@ -21974,32 +22071,21 @@ var TILE_COMPONENTS = (_a = {}, _a[exports.TileType.Content] = ContentTile$1, _a
|
|
|
21974
22071
|
*/
|
|
21975
22072
|
var TileContainer = function (_a) {
|
|
21976
22073
|
var tiles = _a.tiles;
|
|
22074
|
+
var allHalfHeight = tiles.length > 0 && tiles.every(function (tile) {
|
|
22075
|
+
return tile.tileHeight === exports.TileHeight.Half;
|
|
22076
|
+
});
|
|
22077
|
+
var halfHeightGap = allHalfHeight ? GRID_GAP / 2 : GRID_GAP;
|
|
21977
22078
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
21978
|
-
style: styles.container,
|
|
22079
|
+
style: [styles.container, allHalfHeight && styles.aspectContainer],
|
|
21979
22080
|
testID: "tile-container"
|
|
21980
22081
|
}, tiles.map(function (tile, index) {
|
|
21981
22082
|
var TileComponent = TILE_COMPONENTS[tile.type];
|
|
21982
|
-
var
|
|
21983
|
-
// Log tile dimensions for debugging
|
|
21984
|
-
if (!__DEV__) {
|
|
21985
|
-
console.log("Tile ".concat(index, " (").concat(tile.id, "): ").concat(isHalfSize ? 'Half' : 'Full', " size"));
|
|
21986
|
-
}
|
|
22083
|
+
var isHalfHeight = tile.tileHeight === exports.TileHeight.Half;
|
|
21987
22084
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
21988
22085
|
key: tile.id,
|
|
21989
|
-
style: [styles.
|
|
21990
|
-
marginTop: GRID_GAP
|
|
21991
|
-
}]
|
|
21992
|
-
onLayout: function (event) {
|
|
21993
|
-
if (__DEV__) {
|
|
21994
|
-
var _a = event.nativeEvent.layout,
|
|
21995
|
-
width = _a.width,
|
|
21996
|
-
height = _a.height;
|
|
21997
|
-
console.log("=== TILE ".concat(index, " LAYOUT ==="));
|
|
21998
|
-
console.log("Tile ID: ".concat(tile.id, ", Type: ").concat(tile.type));
|
|
21999
|
-
console.log("Is Half Size: ".concat(isHalfSize));
|
|
22000
|
-
console.log("Actual dimensions: ".concat(width.toFixed(2), "x").concat(height.toFixed(2), "px"));
|
|
22001
|
-
}
|
|
22002
|
-
}
|
|
22086
|
+
style: [styles.tileWrapper, isHalfHeight && styles.halfHeightTile, index > 0 && {
|
|
22087
|
+
marginTop: allHalfHeight ? halfHeightGap : GRID_GAP
|
|
22088
|
+
}]
|
|
22003
22089
|
}, TileComponent ? /*#__PURE__*/React.createElement(TileComponent, {
|
|
22004
22090
|
tile: tile
|
|
22005
22091
|
}) : null);
|
|
@@ -22007,20 +22093,18 @@ var TileContainer = function (_a) {
|
|
|
22007
22093
|
};
|
|
22008
22094
|
var styles = StyleSheet$1.create({
|
|
22009
22095
|
container: {
|
|
22010
|
-
flexDirection: 'column',
|
|
22011
22096
|
flex: 1,
|
|
22012
|
-
width: '100%'
|
|
22013
|
-
|
|
22097
|
+
width: '100%'
|
|
22098
|
+
},
|
|
22099
|
+
aspectContainer: {
|
|
22100
|
+
aspectRatio: 1
|
|
22014
22101
|
},
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
flexShrink: 1,
|
|
22018
|
-
flexBasis: '100%',
|
|
22102
|
+
tileWrapper: {
|
|
22103
|
+
flex: 1,
|
|
22019
22104
|
width: '100%'
|
|
22020
22105
|
},
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
backgroundColor: 'red'
|
|
22106
|
+
halfHeightTile: {
|
|
22107
|
+
flex: 0.5
|
|
22024
22108
|
}
|
|
22025
22109
|
});
|
|
22026
22110
|
|