@wlloyalty/wll-react-sdk 1.0.52 → 1.0.54
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.js +492 -431
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var Color = require('color');
|
|
5
|
+
var LucideIcons = require('lucide-react');
|
|
6
|
+
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
|
+
var LucideIcons__namespace = /*#__PURE__*/_interopNamespaceDefault(LucideIcons);
|
|
5
26
|
|
|
6
27
|
function _extends$1() {
|
|
7
28
|
return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -67,7 +88,7 @@ function useMergeRefs$1() {
|
|
|
67
88
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
68
89
|
args[_key] = arguments[_key];
|
|
69
90
|
}
|
|
70
|
-
return
|
|
91
|
+
return React__namespace.useMemo(() => mergeRefs(...args),
|
|
71
92
|
// eslint-disable-next-line
|
|
72
93
|
[...args]);
|
|
73
94
|
}
|
|
@@ -339,7 +360,7 @@ function getModality() {
|
|
|
339
360
|
*
|
|
340
361
|
*/
|
|
341
362
|
|
|
342
|
-
var useLayoutEffectImpl = canUseDOM$1 ? useLayoutEffect
|
|
363
|
+
var useLayoutEffectImpl = canUseDOM$1 ? React.useLayoutEffect : React.useEffect;
|
|
343
364
|
var useLayoutEffect = useLayoutEffectImpl;
|
|
344
365
|
|
|
345
366
|
/**
|
|
@@ -353,7 +374,7 @@ var useLayoutEffect = useLayoutEffectImpl;
|
|
|
353
374
|
|
|
354
375
|
var UNINITIALIZED = typeof Symbol === 'function' && typeof Symbol() === 'symbol' ? Symbol() : Object.freeze({});
|
|
355
376
|
function useStable$1(getInitialValue) {
|
|
356
|
-
var ref =
|
|
377
|
+
var ref = React__namespace.useRef(UNINITIALIZED);
|
|
357
378
|
if (ref.current === UNINITIALIZED) {
|
|
358
379
|
ref.current = getInitialValue();
|
|
359
380
|
}
|
|
@@ -1061,25 +1082,25 @@ function getTouchFromResponderEvent(event) {
|
|
|
1061
1082
|
*/
|
|
1062
1083
|
|
|
1063
1084
|
function usePressEvents(hostRef, config) {
|
|
1064
|
-
var pressResponderRef = useRef(null);
|
|
1085
|
+
var pressResponderRef = React.useRef(null);
|
|
1065
1086
|
if (pressResponderRef.current == null) {
|
|
1066
1087
|
pressResponderRef.current = new PressResponder(config);
|
|
1067
1088
|
}
|
|
1068
1089
|
var pressResponder = pressResponderRef.current;
|
|
1069
1090
|
|
|
1070
1091
|
// Re-configure to use the current node and configuration.
|
|
1071
|
-
useEffect(() => {
|
|
1092
|
+
React.useEffect(() => {
|
|
1072
1093
|
pressResponder.configure(config);
|
|
1073
1094
|
}, [config, pressResponder]);
|
|
1074
1095
|
|
|
1075
1096
|
// Reset the `pressResponder` when cleanup needs to occur. This is
|
|
1076
1097
|
// a separate effect because we do not want to rest the responder when `config` changes.
|
|
1077
|
-
useEffect(() => {
|
|
1098
|
+
React.useEffect(() => {
|
|
1078
1099
|
return () => {
|
|
1079
1100
|
pressResponder.reset();
|
|
1080
1101
|
};
|
|
1081
1102
|
}, [pressResponder]);
|
|
1082
|
-
useDebugValue(config);
|
|
1103
|
+
React.useDebugValue(config);
|
|
1083
1104
|
return pressResponder.getEventHandlers();
|
|
1084
1105
|
}
|
|
1085
1106
|
|
|
@@ -5564,7 +5585,7 @@ var defaultLocale = {
|
|
|
5564
5585
|
direction: 'ltr',
|
|
5565
5586
|
locale: 'en-US'
|
|
5566
5587
|
};
|
|
5567
|
-
var LocaleContext = /*#__PURE__*/createContext(defaultLocale);
|
|
5588
|
+
var LocaleContext = /*#__PURE__*/React.createContext(defaultLocale);
|
|
5568
5589
|
function getLocaleDirection(locale) {
|
|
5569
5590
|
return isLocaleRTL(locale) ? 'rtl' : 'ltr';
|
|
5570
5591
|
}
|
|
@@ -5573,7 +5594,7 @@ function LocaleProvider(props) {
|
|
|
5573
5594
|
locale = props.locale,
|
|
5574
5595
|
children = props.children;
|
|
5575
5596
|
var needsContext = direction || locale;
|
|
5576
|
-
return needsContext ? /*#__PURE__*/
|
|
5597
|
+
return needsContext ? /*#__PURE__*/React.createElement(LocaleContext.Provider, {
|
|
5577
5598
|
children: children,
|
|
5578
5599
|
value: {
|
|
5579
5600
|
direction: locale ? getLocaleDirection(locale) : direction,
|
|
@@ -5582,7 +5603,7 @@ function LocaleProvider(props) {
|
|
|
5582
5603
|
}) : children;
|
|
5583
5604
|
}
|
|
5584
5605
|
function useLocaleContext() {
|
|
5585
|
-
return useContext(LocaleContext);
|
|
5606
|
+
return React.useContext(LocaleContext);
|
|
5586
5607
|
}
|
|
5587
5608
|
|
|
5588
5609
|
/**
|
|
@@ -5602,10 +5623,10 @@ var createElement = (component, props, options) => {
|
|
|
5602
5623
|
}
|
|
5603
5624
|
var Component = accessibilityComponent || component;
|
|
5604
5625
|
var domProps = createDOMProps$1(Component, props, options);
|
|
5605
|
-
var element = /*#__PURE__*/
|
|
5626
|
+
var element = /*#__PURE__*/React.createElement(Component, domProps);
|
|
5606
5627
|
|
|
5607
5628
|
// Update locale context if element's writing direction prop changes
|
|
5608
|
-
var elementWithLocaleProvider = domProps.dir ? /*#__PURE__*/
|
|
5629
|
+
var elementWithLocaleProvider = domProps.dir ? /*#__PURE__*/React.createElement(LocaleProvider, {
|
|
5609
5630
|
children: element,
|
|
5610
5631
|
direction: domProps.dir,
|
|
5611
5632
|
locale: domProps.lang
|
|
@@ -7207,7 +7228,7 @@ function getResponderNode() {
|
|
|
7207
7228
|
var emptyObject$1 = {};
|
|
7208
7229
|
var idCounter = 0;
|
|
7209
7230
|
function useStable(getInitialValue) {
|
|
7210
|
-
var ref =
|
|
7231
|
+
var ref = React__namespace.useRef(null);
|
|
7211
7232
|
if (ref.current == null) {
|
|
7212
7233
|
ref.current = getInitialValue();
|
|
7213
7234
|
}
|
|
@@ -7218,12 +7239,12 @@ function useResponderEvents(hostRef, config) {
|
|
|
7218
7239
|
config = emptyObject$1;
|
|
7219
7240
|
}
|
|
7220
7241
|
var id = useStable(() => idCounter++);
|
|
7221
|
-
var isAttachedRef =
|
|
7242
|
+
var isAttachedRef = React__namespace.useRef(false);
|
|
7222
7243
|
|
|
7223
7244
|
// This is a separate effects so it doesn't run when the config changes.
|
|
7224
7245
|
// On initial mount, attach global listeners if needed.
|
|
7225
7246
|
// On unmount, remove node potentially attached to the Responder System.
|
|
7226
|
-
|
|
7247
|
+
React__namespace.useEffect(() => {
|
|
7227
7248
|
attachListeners();
|
|
7228
7249
|
return () => {
|
|
7229
7250
|
removeNode(id);
|
|
@@ -7231,7 +7252,7 @@ function useResponderEvents(hostRef, config) {
|
|
|
7231
7252
|
}, [id]);
|
|
7232
7253
|
|
|
7233
7254
|
// Register and unregister with the Responder System as necessary
|
|
7234
|
-
|
|
7255
|
+
React__namespace.useEffect(() => {
|
|
7235
7256
|
var _config = config,
|
|
7236
7257
|
onMoveShouldSetResponder = _config.onMoveShouldSetResponder,
|
|
7237
7258
|
onMoveShouldSetResponderCapture = _config.onMoveShouldSetResponderCapture,
|
|
@@ -7251,10 +7272,10 @@ function useResponderEvents(hostRef, config) {
|
|
|
7251
7272
|
isAttachedRef.current = false;
|
|
7252
7273
|
}
|
|
7253
7274
|
}, [config, hostRef, id]);
|
|
7254
|
-
|
|
7275
|
+
React__namespace.useDebugValue({
|
|
7255
7276
|
isResponder: hostRef.current === getResponderNode()
|
|
7256
7277
|
});
|
|
7257
|
-
|
|
7278
|
+
React__namespace.useDebugValue(config);
|
|
7258
7279
|
}
|
|
7259
7280
|
|
|
7260
7281
|
/**
|
|
@@ -7266,7 +7287,7 @@ function useResponderEvents(hostRef, config) {
|
|
|
7266
7287
|
*
|
|
7267
7288
|
*/
|
|
7268
7289
|
|
|
7269
|
-
var TextAncestorContext = /*#__PURE__*/createContext(false);
|
|
7290
|
+
var TextAncestorContext = /*#__PURE__*/React.createContext(false);
|
|
7270
7291
|
var TextAncestorContext$1 = TextAncestorContext;
|
|
7271
7292
|
|
|
7272
7293
|
var _excluded$b = ["hrefAttrs", "onLayout", "onMoveShouldSetResponder", "onMoveShouldSetResponderCapture", "onResponderEnd", "onResponderGrant", "onResponderMove", "onResponderReject", "onResponderRelease", "onResponderStart", "onResponderTerminate", "onResponderTerminationRequest", "onScrollShouldSetResponder", "onScrollShouldSetResponderCapture", "onSelectionChangeShouldSetResponder", "onSelectionChangeShouldSetResponderCapture", "onStartShouldSetResponder", "onStartShouldSetResponderCapture"];
|
|
@@ -7278,7 +7299,7 @@ var forwardPropsList$1 = Object.assign({}, defaultProps, accessibilityProps, cli
|
|
|
7278
7299
|
pointerEvents: true
|
|
7279
7300
|
});
|
|
7280
7301
|
var pickProps$1 = props => pick(props, forwardPropsList$1);
|
|
7281
|
-
var View$1 = /*#__PURE__*/
|
|
7302
|
+
var View$1 = /*#__PURE__*/React__namespace.forwardRef((props, forwardedRef) => {
|
|
7282
7303
|
var hrefAttrs = props.hrefAttrs,
|
|
7283
7304
|
onLayout = props.onLayout,
|
|
7284
7305
|
onMoveShouldSetResponder = props.onMoveShouldSetResponder,
|
|
@@ -7299,14 +7320,14 @@ var View$1 = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
7299
7320
|
onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture,
|
|
7300
7321
|
rest = _objectWithoutPropertiesLoose(props, _excluded$b);
|
|
7301
7322
|
if (process.env.NODE_ENV !== 'production') {
|
|
7302
|
-
|
|
7323
|
+
React__namespace.Children.toArray(props.children).forEach(item => {
|
|
7303
7324
|
if (typeof item === 'string') {
|
|
7304
7325
|
console.error("Unexpected text node: " + item + ". A text node cannot be a child of a <View>.");
|
|
7305
7326
|
}
|
|
7306
7327
|
});
|
|
7307
7328
|
}
|
|
7308
|
-
var hasTextAncestor =
|
|
7309
|
-
var hostRef =
|
|
7329
|
+
var hasTextAncestor = React__namespace.useContext(TextAncestorContext$1);
|
|
7330
|
+
var hostRef = React__namespace.useRef(null);
|
|
7310
7331
|
var _useLocaleContext = useLocaleContext(),
|
|
7311
7332
|
contextDirection = _useLocaleContext.direction;
|
|
7312
7333
|
useElementLayout(hostRef, onLayout);
|
|
@@ -7430,9 +7451,9 @@ function Pressable(props, forwardedRef) {
|
|
|
7430
7451
|
var _useForceableState3 = useForceableState(testOnly_pressed === true),
|
|
7431
7452
|
pressed = _useForceableState3[0],
|
|
7432
7453
|
setPressed = _useForceableState3[1];
|
|
7433
|
-
var hostRef = useRef(null);
|
|
7454
|
+
var hostRef = React.useRef(null);
|
|
7434
7455
|
var setRef = useMergeRefs$1(forwardedRef, hostRef);
|
|
7435
|
-
var pressConfig = useMemo(() => ({
|
|
7456
|
+
var pressConfig = React.useMemo(() => ({
|
|
7436
7457
|
delayLongPress,
|
|
7437
7458
|
delayPressStart: delayPressIn,
|
|
7438
7459
|
delayPressEnd: delayPressOut,
|
|
@@ -7459,7 +7480,7 @@ function Pressable(props, forwardedRef) {
|
|
|
7459
7480
|
focused,
|
|
7460
7481
|
pressed
|
|
7461
7482
|
};
|
|
7462
|
-
var blurHandler =
|
|
7483
|
+
var blurHandler = React__namespace.useCallback(e => {
|
|
7463
7484
|
if (e.nativeEvent.target === hostRef.current) {
|
|
7464
7485
|
setFocused(false);
|
|
7465
7486
|
if (onBlur != null) {
|
|
@@ -7467,7 +7488,7 @@ function Pressable(props, forwardedRef) {
|
|
|
7467
7488
|
}
|
|
7468
7489
|
}
|
|
7469
7490
|
}, [hostRef, setFocused, onBlur]);
|
|
7470
|
-
var focusHandler =
|
|
7491
|
+
var focusHandler = React__namespace.useCallback(e => {
|
|
7471
7492
|
if (e.nativeEvent.target === hostRef.current) {
|
|
7472
7493
|
setFocused(true);
|
|
7473
7494
|
if (onFocus != null) {
|
|
@@ -7475,7 +7496,7 @@ function Pressable(props, forwardedRef) {
|
|
|
7475
7496
|
}
|
|
7476
7497
|
}
|
|
7477
7498
|
}, [hostRef, setFocused, onFocus]);
|
|
7478
|
-
var contextMenuHandler =
|
|
7499
|
+
var contextMenuHandler = React__namespace.useCallback(e => {
|
|
7479
7500
|
if (onContextMenuPress != null) {
|
|
7480
7501
|
onContextMenuPress(e);
|
|
7481
7502
|
}
|
|
@@ -7483,7 +7504,7 @@ function Pressable(props, forwardedRef) {
|
|
|
7483
7504
|
onContextMenu(e);
|
|
7484
7505
|
}
|
|
7485
7506
|
}, [onContextMenu, onContextMenuPress]);
|
|
7486
|
-
var keyDownHandler =
|
|
7507
|
+
var keyDownHandler = React__namespace.useCallback(e => {
|
|
7487
7508
|
if (onKeyDownPress != null) {
|
|
7488
7509
|
onKeyDownPress(e);
|
|
7489
7510
|
}
|
|
@@ -7497,7 +7518,7 @@ function Pressable(props, forwardedRef) {
|
|
|
7497
7518
|
} else {
|
|
7498
7519
|
_tabIndex = disabled ? -1 : 0;
|
|
7499
7520
|
}
|
|
7500
|
-
return /*#__PURE__*/
|
|
7521
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends$1({}, rest, pressEventHandlers, {
|
|
7501
7522
|
"aria-disabled": disabled,
|
|
7502
7523
|
onBlur: blurHandler,
|
|
7503
7524
|
onContextMenu: contextMenuHandler,
|
|
@@ -7509,7 +7530,7 @@ function Pressable(props, forwardedRef) {
|
|
|
7509
7530
|
}), typeof children === 'function' ? children(interactionState) : children);
|
|
7510
7531
|
}
|
|
7511
7532
|
function useForceableState(forced) {
|
|
7512
|
-
var _useState = useState(false),
|
|
7533
|
+
var _useState = React.useState(false),
|
|
7513
7534
|
bool = _useState[0],
|
|
7514
7535
|
setBool = _useState[1];
|
|
7515
7536
|
return [bool || forced, setBool];
|
|
@@ -7523,7 +7544,7 @@ var styles$h = StyleSheet$1.create({
|
|
|
7523
7544
|
pointerEvents: 'box-none'
|
|
7524
7545
|
}
|
|
7525
7546
|
});
|
|
7526
|
-
var MemoedPressable = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(Pressable));
|
|
7547
|
+
var MemoedPressable = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Pressable));
|
|
7527
7548
|
MemoedPressable.displayName = 'Pressable';
|
|
7528
7549
|
var Pressable$1 = MemoedPressable;
|
|
7529
7550
|
|
|
@@ -7534,7 +7555,7 @@ var forwardPropsList = Object.assign({}, defaultProps, accessibilityProps, click
|
|
|
7534
7555
|
pointerEvents: true
|
|
7535
7556
|
});
|
|
7536
7557
|
var pickProps = props => pick(props, forwardPropsList);
|
|
7537
|
-
var Text$2 = /*#__PURE__*/
|
|
7558
|
+
var Text$2 = /*#__PURE__*/React__namespace.forwardRef((props, forwardedRef) => {
|
|
7538
7559
|
var hrefAttrs = props.hrefAttrs,
|
|
7539
7560
|
numberOfLines = props.numberOfLines,
|
|
7540
7561
|
onClick = props.onClick,
|
|
@@ -7561,8 +7582,8 @@ var Text$2 = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
7561
7582
|
if (selectable != null) {
|
|
7562
7583
|
warnOnce('selectable', 'selectable prop is deprecated. Use styles.userSelect.');
|
|
7563
7584
|
}
|
|
7564
|
-
var hasTextAncestor =
|
|
7565
|
-
var hostRef =
|
|
7585
|
+
var hasTextAncestor = React__namespace.useContext(TextAncestorContext$1);
|
|
7586
|
+
var hostRef = React__namespace.useRef(null);
|
|
7566
7587
|
var _useLocaleContext = useLocaleContext(),
|
|
7567
7588
|
contextDirection = _useLocaleContext.direction;
|
|
7568
7589
|
useElementLayout(hostRef, onLayout);
|
|
@@ -7584,7 +7605,7 @@ var Text$2 = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
7584
7605
|
onStartShouldSetResponder,
|
|
7585
7606
|
onStartShouldSetResponderCapture
|
|
7586
7607
|
});
|
|
7587
|
-
var handleClick =
|
|
7608
|
+
var handleClick = React__namespace.useCallback(e => {
|
|
7588
7609
|
if (onClick != null) {
|
|
7589
7610
|
onClick(e);
|
|
7590
7611
|
} else if (onPress != null) {
|
|
@@ -7631,7 +7652,7 @@ var Text$2 = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
7631
7652
|
var element = createElement$1(component, supportedProps, {
|
|
7632
7653
|
writingDirection
|
|
7633
7654
|
});
|
|
7634
|
-
return hasTextAncestor ? element : /*#__PURE__*/
|
|
7655
|
+
return hasTextAncestor ? element : /*#__PURE__*/React__namespace.createElement(TextAncestorContext$1.Provider, {
|
|
7635
7656
|
value: true
|
|
7636
7657
|
}, element);
|
|
7637
7658
|
});
|
|
@@ -7802,7 +7823,7 @@ var parseNavigationLink = function (link) {
|
|
|
7802
7823
|
};
|
|
7803
7824
|
|
|
7804
7825
|
var useNavigation = function (config) {
|
|
7805
|
-
var handleNavigation = useCallback(function (link, ctaTarget) {
|
|
7826
|
+
var handleNavigation = React.useCallback(function (link, ctaTarget) {
|
|
7806
7827
|
var _a;
|
|
7807
7828
|
var _b = parseNavigationLink(link),
|
|
7808
7829
|
type = _b.type,
|
|
@@ -7820,7 +7841,7 @@ var useNavigation = function (config) {
|
|
|
7820
7841
|
|
|
7821
7842
|
var baseUrl = 'https://api.staging.core.wlloyalty.net/v1';
|
|
7822
7843
|
var useCreateRequestOptions = function (config) {
|
|
7823
|
-
return useCallback(function (options) {
|
|
7844
|
+
return React.useCallback(function (options) {
|
|
7824
7845
|
if (options === void 0) {
|
|
7825
7846
|
options = {};
|
|
7826
7847
|
}
|
|
@@ -7837,7 +7858,7 @@ var useCreateRequestOptions = function (config) {
|
|
|
7837
7858
|
};
|
|
7838
7859
|
var useMakeRequest = function (config) {
|
|
7839
7860
|
var createRequestOptions = useCreateRequestOptions(config);
|
|
7840
|
-
return useCallback(function (url) {
|
|
7861
|
+
return React.useCallback(function (url) {
|
|
7841
7862
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
7842
7863
|
var response, json, error_1;
|
|
7843
7864
|
return __generator(this, function (_a) {
|
|
@@ -7885,7 +7906,7 @@ var createResourceGetter = function (resource, includeHydrate) {
|
|
|
7885
7906
|
}
|
|
7886
7907
|
return function (config) {
|
|
7887
7908
|
var makeRequest = useMakeRequest(config);
|
|
7888
|
-
return useCallback(function (id) {
|
|
7909
|
+
return React.useCallback(function (id) {
|
|
7889
7910
|
var params = new URLSearchParams();
|
|
7890
7911
|
if (includeHydrate) {
|
|
7891
7912
|
params.append('hydrate', 'true');
|
|
@@ -8244,10 +8265,10 @@ function getDimensionMode(window) {
|
|
|
8244
8265
|
}
|
|
8245
8266
|
function useResponsive$1() {
|
|
8246
8267
|
var deviceWindow = Dimensions.get('window');
|
|
8247
|
-
var _a = useState(getDimensionMode(deviceWindow)),
|
|
8268
|
+
var _a = React.useState(getDimensionMode(deviceWindow)),
|
|
8248
8269
|
dimensionMode = _a[0],
|
|
8249
8270
|
setDimensionMode = _a[1];
|
|
8250
|
-
useEffect(function () {
|
|
8271
|
+
React.useEffect(function () {
|
|
8251
8272
|
if (!isWeb) return;
|
|
8252
8273
|
var subscription = Dimensions.addEventListener('change', function (_a) {
|
|
8253
8274
|
var window = _a.window;
|
|
@@ -8270,10 +8291,10 @@ function useResponsive$1() {
|
|
|
8270
8291
|
};
|
|
8271
8292
|
}
|
|
8272
8293
|
|
|
8273
|
-
var ResponsiveContext = /*#__PURE__*/createContext(undefined);
|
|
8294
|
+
var ResponsiveContext = /*#__PURE__*/React.createContext(undefined);
|
|
8274
8295
|
function ResponsiveProvider(_a) {
|
|
8275
8296
|
var children = _a.children;
|
|
8276
|
-
var _b =
|
|
8297
|
+
var _b = React.useState(function () {
|
|
8277
8298
|
var window = Dimensions.get('window');
|
|
8278
8299
|
var dimensionMode = getDimensionMode(window);
|
|
8279
8300
|
return {
|
|
@@ -8285,7 +8306,7 @@ function ResponsiveProvider(_a) {
|
|
|
8285
8306
|
}),
|
|
8286
8307
|
state = _b[0],
|
|
8287
8308
|
setState = _b[1];
|
|
8288
|
-
|
|
8309
|
+
React.useEffect(function () {
|
|
8289
8310
|
var subscription = Dimensions.addEventListener('change', function (_a) {
|
|
8290
8311
|
var window = _a.window;
|
|
8291
8312
|
if (window) {
|
|
@@ -8304,12 +8325,12 @@ function ResponsiveProvider(_a) {
|
|
|
8304
8325
|
}
|
|
8305
8326
|
};
|
|
8306
8327
|
}, []);
|
|
8307
|
-
return /*#__PURE__*/
|
|
8328
|
+
return /*#__PURE__*/React.createElement(ResponsiveContext.Provider, {
|
|
8308
8329
|
value: state
|
|
8309
8330
|
}, children);
|
|
8310
8331
|
}
|
|
8311
8332
|
function useResponsive() {
|
|
8312
|
-
var context = useContext(ResponsiveContext);
|
|
8333
|
+
var context = React.useContext(ResponsiveContext);
|
|
8313
8334
|
if (context === undefined) {
|
|
8314
8335
|
throw new Error('useResponsive must be used within a ResponsiveProvider');
|
|
8315
8336
|
}
|
|
@@ -8342,22 +8363,22 @@ var createTheme = function (baseTheme) {
|
|
|
8342
8363
|
alphaDerivedText: getAlphaDerivedColors(text)
|
|
8343
8364
|
});
|
|
8344
8365
|
};
|
|
8345
|
-
var WllSdkContext = /*#__PURE__*/
|
|
8366
|
+
var WllSdkContext = /*#__PURE__*/React.createContext(undefined);
|
|
8346
8367
|
var WllSdkProvider = function (_a) {
|
|
8347
8368
|
var children = _a.children,
|
|
8348
8369
|
providedTheme = _a.theme,
|
|
8349
8370
|
config = _a.config,
|
|
8350
8371
|
_b = _a.navigationConfig,
|
|
8351
8372
|
navigationConfig = _b === void 0 ? {} : _b;
|
|
8352
|
-
var _c =
|
|
8373
|
+
var _c = React.useState(function () {
|
|
8353
8374
|
return createTheme(providedTheme || {});
|
|
8354
8375
|
}),
|
|
8355
8376
|
theme = _c[0],
|
|
8356
8377
|
setThemeState = _c[1];
|
|
8357
|
-
|
|
8378
|
+
React.useEffect(function () {
|
|
8358
8379
|
setThemeState(createTheme(providedTheme || {}));
|
|
8359
8380
|
}, [providedTheme]);
|
|
8360
|
-
var setTheme =
|
|
8381
|
+
var setTheme = React.useCallback(function (newTheme) {
|
|
8361
8382
|
setThemeState(function (prevTheme) {
|
|
8362
8383
|
return createTheme(__assign(__assign({}, prevTheme), newTheme));
|
|
8363
8384
|
});
|
|
@@ -8366,7 +8387,7 @@ var WllSdkProvider = function (_a) {
|
|
|
8366
8387
|
var getSectionByID = useGetSectionByID(config);
|
|
8367
8388
|
var getTileByID = useGetTileByID(config);
|
|
8368
8389
|
var handleNavigation = useNavigation(navigationConfig);
|
|
8369
|
-
var contextValue =
|
|
8390
|
+
var contextValue = React.useMemo(function () {
|
|
8370
8391
|
return {
|
|
8371
8392
|
theme: theme,
|
|
8372
8393
|
setTheme: setTheme,
|
|
@@ -8376,12 +8397,12 @@ var WllSdkProvider = function (_a) {
|
|
|
8376
8397
|
handleNavigation: handleNavigation
|
|
8377
8398
|
};
|
|
8378
8399
|
}, [theme, setTheme, getGroupByID, getSectionByID, getTileByID, handleNavigation]);
|
|
8379
|
-
return /*#__PURE__*/
|
|
8400
|
+
return /*#__PURE__*/React.createElement(WllSdkContext.Provider, {
|
|
8380
8401
|
value: contextValue
|
|
8381
|
-
}, /*#__PURE__*/
|
|
8402
|
+
}, /*#__PURE__*/React.createElement(ResponsiveProvider, null, children));
|
|
8382
8403
|
};
|
|
8383
8404
|
var useWllSdk = function () {
|
|
8384
|
-
var context =
|
|
8405
|
+
var context = React.useContext(WllSdkContext);
|
|
8385
8406
|
if (context === undefined) {
|
|
8386
8407
|
throw new Error('useWllSdk must be used within a WllSdkProvider');
|
|
8387
8408
|
}
|
|
@@ -8423,12 +8444,12 @@ var getResponsiveValue = function (desktopValue, mobileValue, isDesktop, isTable
|
|
|
8423
8444
|
return mobileValue;
|
|
8424
8445
|
};
|
|
8425
8446
|
var useResponsiveValue = function (desktopValue, mobileValue, isDesktop, isTablet) {
|
|
8426
|
-
var _a = useState(function () {
|
|
8447
|
+
var _a = React.useState(function () {
|
|
8427
8448
|
return getResponsiveValue(desktopValue, mobileValue);
|
|
8428
8449
|
}),
|
|
8429
8450
|
value = _a[0],
|
|
8430
8451
|
setValue = _a[1];
|
|
8431
|
-
useEffect(function () {
|
|
8452
|
+
React.useEffect(function () {
|
|
8432
8453
|
if (Platform$1.OS !== 'web') return;
|
|
8433
8454
|
var handleResize = function () {
|
|
8434
8455
|
setValue(getResponsiveValue(desktopValue, mobileValue));
|
|
@@ -8508,7 +8529,7 @@ var Button = function (_a) {
|
|
|
8508
8529
|
var buttonStyle = useButtonStyles(theme, variant);
|
|
8509
8530
|
var textStyle = useTextStyles(theme, variant);
|
|
8510
8531
|
var styles = useButtonDynamicStyles();
|
|
8511
|
-
return /*#__PURE__*/
|
|
8532
|
+
return /*#__PURE__*/React__namespace.createElement(Pressable$1, {
|
|
8512
8533
|
style: function (_a) {
|
|
8513
8534
|
var pressed = _a.pressed;
|
|
8514
8535
|
return [styles.button, buttonStyle, {
|
|
@@ -8529,7 +8550,7 @@ var Button = function (_a) {
|
|
|
8529
8550
|
disabled: disabled
|
|
8530
8551
|
},
|
|
8531
8552
|
testID: testID
|
|
8532
|
-
}, /*#__PURE__*/
|
|
8553
|
+
}, /*#__PURE__*/React__namespace.createElement(Text$3, {
|
|
8533
8554
|
style: [styles.text, textStyle]
|
|
8534
8555
|
}, title));
|
|
8535
8556
|
};
|
|
@@ -8543,12 +8564,12 @@ var Icon = function (_a) {
|
|
|
8543
8564
|
_d = _a.strokeWidth,
|
|
8544
8565
|
strokeWidth = _d === void 0 ? 2 : _d,
|
|
8545
8566
|
props = __rest(_a, ["name", "color", "size", "strokeWidth"]);
|
|
8546
|
-
var LucideIcon =
|
|
8567
|
+
var LucideIcon = LucideIcons__namespace[name];
|
|
8547
8568
|
if (!LucideIcon) {
|
|
8548
8569
|
console.warn("Icon \"".concat(name, "\" not found in Lucide icons"));
|
|
8549
8570
|
return null;
|
|
8550
8571
|
}
|
|
8551
|
-
return /*#__PURE__*/
|
|
8572
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, props, /*#__PURE__*/React__namespace.createElement(LucideIcon, {
|
|
8552
8573
|
color: color,
|
|
8553
8574
|
size: size,
|
|
8554
8575
|
strokeWidth: strokeWidth
|
|
@@ -8556,7 +8577,7 @@ var Icon = function (_a) {
|
|
|
8556
8577
|
};
|
|
8557
8578
|
|
|
8558
8579
|
var _excluded$8 = ["animating", "color", "hidesWhenStopped", "size", "style"];
|
|
8559
|
-
var createSvgCircle = style => /*#__PURE__*/
|
|
8580
|
+
var createSvgCircle = style => /*#__PURE__*/React__namespace.createElement("circle", {
|
|
8560
8581
|
cx: "16",
|
|
8561
8582
|
cy: "16",
|
|
8562
8583
|
fill: "none",
|
|
@@ -8564,7 +8585,7 @@ var createSvgCircle = style => /*#__PURE__*/React.createElement("circle", {
|
|
|
8564
8585
|
strokeWidth: "4",
|
|
8565
8586
|
style: style
|
|
8566
8587
|
});
|
|
8567
|
-
var ActivityIndicator = /*#__PURE__*/
|
|
8588
|
+
var ActivityIndicator = /*#__PURE__*/React__namespace.forwardRef((props, forwardedRef) => {
|
|
8568
8589
|
var _props$animating = props.animating,
|
|
8569
8590
|
animating = _props$animating === void 0 ? true : _props$animating,
|
|
8570
8591
|
_props$color = props.color,
|
|
@@ -8575,7 +8596,7 @@ var ActivityIndicator = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
8575
8596
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
8576
8597
|
style = props.style,
|
|
8577
8598
|
other = _objectWithoutPropertiesLoose(props, _excluded$8);
|
|
8578
|
-
var svg = /*#__PURE__*/
|
|
8599
|
+
var svg = /*#__PURE__*/React__namespace.createElement("svg", {
|
|
8579
8600
|
height: "100%",
|
|
8580
8601
|
viewBox: "0 0 32 32",
|
|
8581
8602
|
width: "100%"
|
|
@@ -8587,13 +8608,13 @@ var ActivityIndicator = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
8587
8608
|
strokeDasharray: 80,
|
|
8588
8609
|
strokeDashoffset: 60
|
|
8589
8610
|
}));
|
|
8590
|
-
return /*#__PURE__*/
|
|
8611
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends$1({}, other, {
|
|
8591
8612
|
"aria-valuemax": 1,
|
|
8592
8613
|
"aria-valuemin": 0,
|
|
8593
8614
|
ref: forwardedRef,
|
|
8594
8615
|
role: "progressbar",
|
|
8595
8616
|
style: [styles$f.container, style]
|
|
8596
|
-
}), /*#__PURE__*/
|
|
8617
|
+
}), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
8597
8618
|
children: svg,
|
|
8598
8619
|
style: [typeof size === 'number' ? {
|
|
8599
8620
|
height: size,
|
|
@@ -8642,12 +8663,12 @@ var ActivityIndicator$1 = ActivityIndicator;
|
|
|
8642
8663
|
/* istanbul ignore file */
|
|
8643
8664
|
var LoadingIndicator = function () {
|
|
8644
8665
|
var theme = useWllSdk().theme;
|
|
8645
|
-
return /*#__PURE__*/
|
|
8666
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
8646
8667
|
style: [styles$e.container, {
|
|
8647
8668
|
borderRadius: theme.sizes.borderRadiusSm,
|
|
8648
8669
|
padding: theme.sizes.md
|
|
8649
8670
|
}]
|
|
8650
|
-
}, /*#__PURE__*/
|
|
8671
|
+
}, /*#__PURE__*/React__namespace.createElement(ActivityIndicator$1, {
|
|
8651
8672
|
size: "small",
|
|
8652
8673
|
color: theme.primary
|
|
8653
8674
|
}));
|
|
@@ -8778,7 +8799,7 @@ function RefreshControl(props) {
|
|
|
8778
8799
|
props.title;
|
|
8779
8800
|
props.titleColor;
|
|
8780
8801
|
var rest = _objectWithoutPropertiesLoose(props, _excluded$7);
|
|
8781
|
-
return /*#__PURE__*/
|
|
8802
|
+
return /*#__PURE__*/React.createElement(View$2, rest);
|
|
8782
8803
|
}
|
|
8783
8804
|
|
|
8784
8805
|
/**
|
|
@@ -8895,7 +8916,7 @@ function shouldEmitScrollEvent(lastTick, eventThrottle) {
|
|
|
8895
8916
|
/**
|
|
8896
8917
|
* Encapsulates the Web-specific scroll throttling and disabling logic
|
|
8897
8918
|
*/
|
|
8898
|
-
var ScrollViewBase = /*#__PURE__*/
|
|
8919
|
+
var ScrollViewBase = /*#__PURE__*/React__namespace.forwardRef((props, forwardedRef) => {
|
|
8899
8920
|
var onScroll = props.onScroll,
|
|
8900
8921
|
onTouchMove = props.onTouchMove,
|
|
8901
8922
|
onWheel = props.onWheel,
|
|
@@ -8907,12 +8928,12 @@ var ScrollViewBase = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
8907
8928
|
showsVerticalScrollIndicator = props.showsVerticalScrollIndicator,
|
|
8908
8929
|
style = props.style,
|
|
8909
8930
|
rest = _objectWithoutPropertiesLoose(props, _excluded$6);
|
|
8910
|
-
var scrollState =
|
|
8931
|
+
var scrollState = React__namespace.useRef({
|
|
8911
8932
|
isScrolling: false,
|
|
8912
8933
|
scrollLastTick: 0
|
|
8913
8934
|
});
|
|
8914
|
-
var scrollTimeout =
|
|
8915
|
-
var scrollRef =
|
|
8935
|
+
var scrollTimeout = React__namespace.useRef(null);
|
|
8936
|
+
var scrollRef = React__namespace.useRef(null);
|
|
8916
8937
|
function createPreventableScrollHandler(handler) {
|
|
8917
8938
|
return e => {
|
|
8918
8939
|
if (scrollEnabled) {
|
|
@@ -8961,7 +8982,7 @@ var ScrollViewBase = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
8961
8982
|
}
|
|
8962
8983
|
}
|
|
8963
8984
|
var hideScrollbar = showsHorizontalScrollIndicator === false || showsVerticalScrollIndicator === false;
|
|
8964
|
-
return /*#__PURE__*/
|
|
8985
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends$1({}, rest, {
|
|
8965
8986
|
onScroll: handleScroll,
|
|
8966
8987
|
onTouchMove: createPreventableScrollHandler(onTouchMove),
|
|
8967
8988
|
onWheel: createPreventableScrollHandler(onWheel),
|
|
@@ -9081,7 +9102,7 @@ var warning$1 = /*@__PURE__*/getDefaultExportFromCjs(warning_1);
|
|
|
9081
9102
|
var _excluded$5 = ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "forwardedRef", "keyboardDismissMode", "onScroll", "centerContent"];
|
|
9082
9103
|
var emptyObject = {};
|
|
9083
9104
|
var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
|
|
9084
|
-
let ScrollView$1 = class ScrollView extends
|
|
9105
|
+
let ScrollView$1 = class ScrollView extends React.Component {
|
|
9085
9106
|
constructor() {
|
|
9086
9107
|
super(...arguments);
|
|
9087
9108
|
this._scrollNodeRef = null;
|
|
@@ -9608,17 +9629,17 @@ let ScrollView$1 = class ScrollView extends React__default.Component {
|
|
|
9608
9629
|
};
|
|
9609
9630
|
}
|
|
9610
9631
|
var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);
|
|
9611
|
-
var children = hasStickyHeaderIndices || pagingEnabled ?
|
|
9632
|
+
var children = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(this.props.children, (child, i) => {
|
|
9612
9633
|
var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
|
|
9613
9634
|
if (child != null && (isSticky || pagingEnabled)) {
|
|
9614
|
-
return /*#__PURE__*/
|
|
9635
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
9615
9636
|
style: [isSticky && styles$c.stickyHeader, pagingEnabled && styles$c.pagingEnabledChild]
|
|
9616
9637
|
}, child);
|
|
9617
9638
|
} else {
|
|
9618
9639
|
return child;
|
|
9619
9640
|
}
|
|
9620
9641
|
}) : this.props.children;
|
|
9621
|
-
var contentContainer = /*#__PURE__*/
|
|
9642
|
+
var contentContainer = /*#__PURE__*/React.createElement(View$2, _extends$1({}, contentSizeChangeProps, {
|
|
9622
9643
|
children: children,
|
|
9623
9644
|
collapsable: false,
|
|
9624
9645
|
ref: this._setInnerViewRef,
|
|
@@ -9647,11 +9668,11 @@ let ScrollView$1 = class ScrollView extends React__default.Component {
|
|
|
9647
9668
|
});
|
|
9648
9669
|
var ScrollViewClass = ScrollViewBase$1;
|
|
9649
9670
|
invariant$1(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined');
|
|
9650
|
-
var scrollView = /*#__PURE__*/
|
|
9671
|
+
var scrollView = /*#__PURE__*/React.createElement(ScrollViewClass, _extends$1({}, props, {
|
|
9651
9672
|
ref: this._setScrollNodeRef
|
|
9652
9673
|
}), contentContainer);
|
|
9653
9674
|
if (refreshControl) {
|
|
9654
|
-
return /*#__PURE__*/
|
|
9675
|
+
return /*#__PURE__*/React.cloneElement(refreshControl, {
|
|
9655
9676
|
style: props.style
|
|
9656
9677
|
}, scrollView);
|
|
9657
9678
|
}
|
|
@@ -9701,8 +9722,8 @@ var styles$c = StyleSheet$1.create({
|
|
|
9701
9722
|
scrollSnapAlign: 'start'
|
|
9702
9723
|
}
|
|
9703
9724
|
});
|
|
9704
|
-
var ForwardedScrollView = /*#__PURE__*/
|
|
9705
|
-
return /*#__PURE__*/
|
|
9725
|
+
var ForwardedScrollView = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
9726
|
+
return /*#__PURE__*/React.createElement(ScrollView$1, _extends$1({}, props, {
|
|
9706
9727
|
forwardedRef: forwardedRef
|
|
9707
9728
|
}));
|
|
9708
9729
|
});
|
|
@@ -10484,7 +10505,7 @@ var FillRateHelper$1 = FillRateHelper;
|
|
|
10484
10505
|
* variables are read in a state updater function, instead of the ones passed
|
|
10485
10506
|
* in.
|
|
10486
10507
|
*/
|
|
10487
|
-
class StateSafePureComponent extends
|
|
10508
|
+
class StateSafePureComponent extends React__namespace.PureComponent {
|
|
10488
10509
|
constructor(props) {
|
|
10489
10510
|
super(props);
|
|
10490
10511
|
this._inAsyncStateUpdate = false;
|
|
@@ -10736,7 +10757,7 @@ function _isEntirelyVisible(top, bottom, viewportHeight) {
|
|
|
10736
10757
|
var ViewabilityHelper$1 = ViewabilityHelper;
|
|
10737
10758
|
|
|
10738
10759
|
var __DEV__$3 = process.env.NODE_ENV !== 'production';
|
|
10739
|
-
var VirtualizedListContext = /*#__PURE__*/
|
|
10760
|
+
var VirtualizedListContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
10740
10761
|
if (__DEV__$3) {
|
|
10741
10762
|
VirtualizedListContext.displayName = 'VirtualizedListContext';
|
|
10742
10763
|
}
|
|
@@ -10748,7 +10769,7 @@ function VirtualizedListContextProvider(_ref2) {
|
|
|
10748
10769
|
var children = _ref2.children,
|
|
10749
10770
|
value = _ref2.value;
|
|
10750
10771
|
// Avoid setting a newly created context object if the values are identical.
|
|
10751
|
-
var context = useMemo(() => ({
|
|
10772
|
+
var context = React.useMemo(() => ({
|
|
10752
10773
|
cellKey: null,
|
|
10753
10774
|
getScrollMetrics: value.getScrollMetrics,
|
|
10754
10775
|
horizontal: value.horizontal,
|
|
@@ -10756,7 +10777,7 @@ function VirtualizedListContextProvider(_ref2) {
|
|
|
10756
10777
|
registerAsNestedChild: value.registerAsNestedChild,
|
|
10757
10778
|
unregisterAsNestedChild: value.unregisterAsNestedChild
|
|
10758
10779
|
}), [value.getScrollMetrics, value.horizontal, value.getOutermostParentListRef, value.registerAsNestedChild, value.unregisterAsNestedChild]);
|
|
10759
|
-
return /*#__PURE__*/
|
|
10780
|
+
return /*#__PURE__*/React__namespace.createElement(VirtualizedListContext.Provider, {
|
|
10760
10781
|
value: context
|
|
10761
10782
|
}, children);
|
|
10762
10783
|
}
|
|
@@ -10768,16 +10789,16 @@ function VirtualizedListCellContextProvider(_ref3) {
|
|
|
10768
10789
|
var cellKey = _ref3.cellKey,
|
|
10769
10790
|
children = _ref3.children;
|
|
10770
10791
|
// Avoid setting a newly created context object if the values are identical.
|
|
10771
|
-
var currContext = useContext(VirtualizedListContext);
|
|
10772
|
-
var context = useMemo(() => currContext == null ? null : _objectSpread2(_objectSpread2({}, currContext), {}, {
|
|
10792
|
+
var currContext = React.useContext(VirtualizedListContext);
|
|
10793
|
+
var context = React.useMemo(() => currContext == null ? null : _objectSpread2(_objectSpread2({}, currContext), {}, {
|
|
10773
10794
|
cellKey
|
|
10774
10795
|
}), [currContext, cellKey]);
|
|
10775
|
-
return /*#__PURE__*/
|
|
10796
|
+
return /*#__PURE__*/React__namespace.createElement(VirtualizedListContext.Provider, {
|
|
10776
10797
|
value: context
|
|
10777
10798
|
}, children);
|
|
10778
10799
|
}
|
|
10779
10800
|
|
|
10780
|
-
class CellRenderer extends
|
|
10801
|
+
class CellRenderer extends React__namespace.Component {
|
|
10781
10802
|
constructor() {
|
|
10782
10803
|
super(...arguments);
|
|
10783
10804
|
this.state = {
|
|
@@ -10844,7 +10865,7 @@ class CellRenderer extends React.Component {
|
|
|
10844
10865
|
/* $FlowFixMe[incompatible-type-arg] (>=0.108.0 site=react_native_fb)
|
|
10845
10866
|
* This comment suppresses an error found when Flow v0.108 was deployed.
|
|
10846
10867
|
* To see the error, delete this comment and run Flow. */
|
|
10847
|
-
return /*#__PURE__*/
|
|
10868
|
+
return /*#__PURE__*/React__namespace.createElement(ListItemComponent, {
|
|
10848
10869
|
item,
|
|
10849
10870
|
index,
|
|
10850
10871
|
separators: this._separators
|
|
@@ -10876,18 +10897,18 @@ class CellRenderer extends React.Component {
|
|
|
10876
10897
|
|
|
10877
10898
|
// NOTE: that when this is a sticky header, `onLayout` will get automatically extracted and
|
|
10878
10899
|
// called explicitly by `ScrollViewStickyHeader`.
|
|
10879
|
-
var itemSeparator = /*#__PURE__*/
|
|
10900
|
+
var itemSeparator = /*#__PURE__*/React__namespace.isValidElement(ItemSeparatorComponent) ?
|
|
10880
10901
|
// $FlowFixMe[incompatible-type]
|
|
10881
10902
|
ItemSeparatorComponent :
|
|
10882
10903
|
// $FlowFixMe[incompatible-type]
|
|
10883
|
-
ItemSeparatorComponent && /*#__PURE__*/
|
|
10904
|
+
ItemSeparatorComponent && /*#__PURE__*/React__namespace.createElement(ItemSeparatorComponent, this.state.separatorProps);
|
|
10884
10905
|
var cellStyle = inversionStyle ? horizontal ? [styles$b.rowReverse, inversionStyle] : [styles$b.columnReverse, inversionStyle] : horizontal ? [styles$b.row, inversionStyle] : inversionStyle;
|
|
10885
|
-
var result = !CellRendererComponent ? /*#__PURE__*/
|
|
10906
|
+
var result = !CellRendererComponent ? /*#__PURE__*/React__namespace.createElement(View$2, _extends$1({
|
|
10886
10907
|
style: cellStyle,
|
|
10887
10908
|
onFocusCapture: onCellFocusCapture
|
|
10888
10909
|
}, onCellLayout && {
|
|
10889
10910
|
onLayout: this._onLayout
|
|
10890
|
-
}), element, itemSeparator) : /*#__PURE__*/
|
|
10911
|
+
}), element, itemSeparator) : /*#__PURE__*/React__namespace.createElement(CellRendererComponent, _extends$1({
|
|
10891
10912
|
cellKey: cellKey,
|
|
10892
10913
|
index: index,
|
|
10893
10914
|
item: item,
|
|
@@ -10896,7 +10917,7 @@ class CellRenderer extends React.Component {
|
|
|
10896
10917
|
}, onCellLayout && {
|
|
10897
10918
|
onLayout: this._onLayout
|
|
10898
10919
|
}), element, itemSeparator);
|
|
10899
|
-
return /*#__PURE__*/
|
|
10920
|
+
return /*#__PURE__*/React__namespace.createElement(VirtualizedListCellContextProvider, {
|
|
10900
10921
|
cellKey: this.props.cellKey
|
|
10901
10922
|
}, result);
|
|
10902
10923
|
}
|
|
@@ -11429,7 +11450,7 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
11429
11450
|
var onRefresh = props.onRefresh;
|
|
11430
11451
|
if (this._isNestedWithSameOrientation()) {
|
|
11431
11452
|
// $FlowFixMe[prop-missing] - Typing ReactNativeComponent revealed errors
|
|
11432
|
-
return /*#__PURE__*/
|
|
11453
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, props);
|
|
11433
11454
|
} else if (onRefresh) {
|
|
11434
11455
|
var _props$refreshing;
|
|
11435
11456
|
invariant$1(typeof props.refreshing === 'boolean', '`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `' + JSON.stringify((_props$refreshing = props.refreshing) !== null && _props$refreshing !== void 0 ? _props$refreshing : 'undefined') + '`');
|
|
@@ -11437,8 +11458,8 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
11437
11458
|
/*#__PURE__*/
|
|
11438
11459
|
// $FlowFixMe[prop-missing] Invalid prop usage
|
|
11439
11460
|
// $FlowFixMe[incompatible-use]
|
|
11440
|
-
|
|
11441
|
-
refreshControl: props.refreshControl == null ? /*#__PURE__*/
|
|
11461
|
+
React__namespace.createElement(ScrollView$2, _extends$1({}, props, {
|
|
11462
|
+
refreshControl: props.refreshControl == null ? /*#__PURE__*/React__namespace.createElement(RefreshControl
|
|
11442
11463
|
// $FlowFixMe[incompatible-type]
|
|
11443
11464
|
, {
|
|
11444
11465
|
refreshing: props.refreshing,
|
|
@@ -11450,7 +11471,7 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
11450
11471
|
} else {
|
|
11451
11472
|
// $FlowFixMe[prop-missing] Invalid prop usage
|
|
11452
11473
|
// $FlowFixMe[incompatible-use]
|
|
11453
|
-
return /*#__PURE__*/
|
|
11474
|
+
return /*#__PURE__*/React__namespace.createElement(ScrollView$2, props);
|
|
11454
11475
|
}
|
|
11455
11476
|
};
|
|
11456
11477
|
this._onCellLayout = (e, cellKey, index) => {
|
|
@@ -12017,7 +12038,7 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12017
12038
|
stickyHeaderIndices.push(cells.length);
|
|
12018
12039
|
}
|
|
12019
12040
|
var shouldListenForLayout = getItemLayout == null || debug || _this._fillRateHelper.enabled();
|
|
12020
|
-
cells.push( /*#__PURE__*/
|
|
12041
|
+
cells.push( /*#__PURE__*/React__namespace.createElement(CellRenderer, _extends$1({
|
|
12021
12042
|
CellRendererComponent: CellRendererComponent,
|
|
12022
12043
|
ItemSeparatorComponent: ii < end ? ItemSeparatorComponent : undefined,
|
|
12023
12044
|
ListItemComponent: ListItemComponent,
|
|
@@ -12091,15 +12112,15 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12091
12112
|
if (stickyIndicesFromProps.has(0)) {
|
|
12092
12113
|
stickyHeaderIndices.push(0);
|
|
12093
12114
|
}
|
|
12094
|
-
var _element = /*#__PURE__*/
|
|
12115
|
+
var _element = /*#__PURE__*/React__namespace.isValidElement(ListHeaderComponent) ? ListHeaderComponent :
|
|
12095
12116
|
/*#__PURE__*/
|
|
12096
12117
|
// $FlowFixMe[not-a-component]
|
|
12097
12118
|
// $FlowFixMe[incompatible-type-arg]
|
|
12098
|
-
|
|
12099
|
-
cells.push( /*#__PURE__*/
|
|
12119
|
+
React__namespace.createElement(ListHeaderComponent, null);
|
|
12120
|
+
cells.push( /*#__PURE__*/React__namespace.createElement(VirtualizedListCellContextProvider, {
|
|
12100
12121
|
cellKey: this._getCellKey() + '-header',
|
|
12101
12122
|
key: "$header"
|
|
12102
|
-
}, /*#__PURE__*/
|
|
12123
|
+
}, /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12103
12124
|
onLayout: this._onLayoutHeader,
|
|
12104
12125
|
style: [inversionStyle, this.props.ListHeaderComponentStyle]
|
|
12105
12126
|
},
|
|
@@ -12110,15 +12131,15 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12110
12131
|
// 2a. Add a cell for ListEmptyComponent if applicable
|
|
12111
12132
|
var itemCount = this.props.getItemCount(data);
|
|
12112
12133
|
if (itemCount === 0 && ListEmptyComponent) {
|
|
12113
|
-
var _element2 = /*#__PURE__*/
|
|
12134
|
+
var _element2 = /*#__PURE__*/React__namespace.isValidElement(ListEmptyComponent) ? ListEmptyComponent :
|
|
12114
12135
|
/*#__PURE__*/
|
|
12115
12136
|
// $FlowFixMe[not-a-component]
|
|
12116
12137
|
// $FlowFixMe[incompatible-type-arg]
|
|
12117
|
-
|
|
12118
|
-
cells.push( /*#__PURE__*/
|
|
12138
|
+
React__namespace.createElement(ListEmptyComponent, null);
|
|
12139
|
+
cells.push( /*#__PURE__*/React__namespace.createElement(VirtualizedListCellContextProvider, {
|
|
12119
12140
|
cellKey: this._getCellKey() + '-empty',
|
|
12120
12141
|
key: "$empty"
|
|
12121
|
-
}, /*#__PURE__*/
|
|
12142
|
+
}, /*#__PURE__*/React__namespace.cloneElement(_element2, {
|
|
12122
12143
|
onLayout: event => {
|
|
12123
12144
|
this._onLayoutEmpty(event);
|
|
12124
12145
|
if (_element2.props.onLayout) {
|
|
@@ -12154,7 +12175,7 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12154
12175
|
var firstMetrics = this.__getFrameMetricsApprox(section.first, this.props);
|
|
12155
12176
|
var lastMetrics = this.__getFrameMetricsApprox(last, this.props);
|
|
12156
12177
|
var spacerSize = lastMetrics.offset + lastMetrics.length - firstMetrics.offset;
|
|
12157
|
-
cells.push( /*#__PURE__*/
|
|
12178
|
+
cells.push( /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12158
12179
|
key: "$spacer-" + section.first,
|
|
12159
12180
|
style: {
|
|
12160
12181
|
[spacerKey]: spacerSize
|
|
@@ -12172,15 +12193,15 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12172
12193
|
|
|
12173
12194
|
// 3. Add cell for ListFooterComponent
|
|
12174
12195
|
if (ListFooterComponent) {
|
|
12175
|
-
var _element3 = /*#__PURE__*/
|
|
12196
|
+
var _element3 = /*#__PURE__*/React__namespace.isValidElement(ListFooterComponent) ? ListFooterComponent :
|
|
12176
12197
|
/*#__PURE__*/
|
|
12177
12198
|
// $FlowFixMe[not-a-component]
|
|
12178
12199
|
// $FlowFixMe[incompatible-type-arg]
|
|
12179
|
-
|
|
12180
|
-
cells.push( /*#__PURE__*/
|
|
12200
|
+
React__namespace.createElement(ListFooterComponent, null);
|
|
12201
|
+
cells.push( /*#__PURE__*/React__namespace.createElement(VirtualizedListCellContextProvider, {
|
|
12181
12202
|
cellKey: this._getFooterCellKey(),
|
|
12182
12203
|
key: "$footer"
|
|
12183
|
-
}, /*#__PURE__*/
|
|
12204
|
+
}, /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12184
12205
|
onLayout: this._onLayoutFooter,
|
|
12185
12206
|
style: [inversionStyle, this.props.ListFooterComponentStyle]
|
|
12186
12207
|
},
|
|
@@ -12204,7 +12225,7 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12204
12225
|
style: inversionStyle ? [inversionStyle, this.props.style] : this.props.style
|
|
12205
12226
|
});
|
|
12206
12227
|
this._hasMore = this.state.cellsAroundViewport.last < itemCount - 1;
|
|
12207
|
-
var innerRet = /*#__PURE__*/
|
|
12228
|
+
var innerRet = /*#__PURE__*/React__namespace.createElement(VirtualizedListContextProvider, {
|
|
12208
12229
|
value: {
|
|
12209
12230
|
cellKey: null,
|
|
12210
12231
|
getScrollMetrics: this._getScrollMetrics,
|
|
@@ -12213,7 +12234,7 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12213
12234
|
registerAsNestedChild: this._registerAsNestedChild,
|
|
12214
12235
|
unregisterAsNestedChild: this._unregisterAsNestedChild
|
|
12215
12236
|
}
|
|
12216
|
-
}, /*#__PURE__*/
|
|
12237
|
+
}, /*#__PURE__*/React__namespace.cloneElement((this.props.renderScrollComponent || this._defaultRenderScrollComponent)(scrollProps), {
|
|
12217
12238
|
ref: this._captureScrollRef
|
|
12218
12239
|
}, cells));
|
|
12219
12240
|
var ret = innerRet;
|
|
@@ -12244,7 +12265,7 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12244
12265
|
);
|
|
12245
12266
|
}*/
|
|
12246
12267
|
if (this.props.debug) {
|
|
12247
|
-
return /*#__PURE__*/
|
|
12268
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12248
12269
|
style: styles$a.debug
|
|
12249
12270
|
}, ret, this._renderDebugOverlay());
|
|
12250
12271
|
} else {
|
|
@@ -12361,20 +12382,20 @@ class VirtualizedList extends StateSafePureComponent {
|
|
|
12361
12382
|
var windowLen = frameLast.offset + frameLast.length - windowTop;
|
|
12362
12383
|
var visTop = this._scrollMetrics.offset;
|
|
12363
12384
|
var visLen = this._scrollMetrics.visibleLength;
|
|
12364
|
-
return /*#__PURE__*/
|
|
12385
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12365
12386
|
style: [styles$a.debugOverlayBase, styles$a.debugOverlay]
|
|
12366
|
-
}, framesInLayout.map((f, ii) => /*#__PURE__*/
|
|
12387
|
+
}, framesInLayout.map((f, ii) => /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12367
12388
|
key: 'f' + ii,
|
|
12368
12389
|
style: [styles$a.debugOverlayBase, styles$a.debugOverlayFrame, {
|
|
12369
12390
|
top: f.offset * normalize,
|
|
12370
12391
|
height: f.length * normalize
|
|
12371
12392
|
}]
|
|
12372
|
-
})), /*#__PURE__*/
|
|
12393
|
+
})), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12373
12394
|
style: [styles$a.debugOverlayBase, styles$a.debugOverlayFrameLast, {
|
|
12374
12395
|
top: windowTop * normalize,
|
|
12375
12396
|
height: windowLen * normalize
|
|
12376
12397
|
}]
|
|
12377
|
-
}), /*#__PURE__*/
|
|
12398
|
+
}), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12378
12399
|
style: [styles$a.debugOverlayBase, styles$a.debugOverlayFrameVis, {
|
|
12379
12400
|
top: visTop * normalize,
|
|
12380
12401
|
height: visLen * normalize
|
|
@@ -12729,7 +12750,7 @@ function isArrayLike(data) {
|
|
|
12729
12750
|
*
|
|
12730
12751
|
* Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation.
|
|
12731
12752
|
*/
|
|
12732
|
-
let FlatList$1 = class FlatList extends
|
|
12753
|
+
let FlatList$1 = class FlatList extends React__namespace.PureComponent {
|
|
12733
12754
|
/**
|
|
12734
12755
|
* Scrolls to the end of the content. May be janky without `getItemLayout` prop.
|
|
12735
12756
|
*/
|
|
@@ -12879,7 +12900,7 @@ let FlatList$1 = class FlatList extends React.PureComponent {
|
|
|
12879
12900
|
// $FlowFixMe[not-a-component] Component isn't valid
|
|
12880
12901
|
// $FlowFixMe[incompatible-type-arg] Component isn't valid
|
|
12881
12902
|
// $FlowFixMe[incompatible-return] Component isn't valid
|
|
12882
|
-
return /*#__PURE__*/
|
|
12903
|
+
return /*#__PURE__*/React__namespace.createElement(ListItemComponent, props);
|
|
12883
12904
|
} else if (renderItem) {
|
|
12884
12905
|
// $FlowFixMe[incompatible-call]
|
|
12885
12906
|
return renderItem(props);
|
|
@@ -12892,7 +12913,7 @@ let FlatList$1 = class FlatList extends React.PureComponent {
|
|
|
12892
12913
|
var _item2 = info.item,
|
|
12893
12914
|
_index = info.index;
|
|
12894
12915
|
invariant$1(Array.isArray(_item2), 'Expected array of items with numColumns > 1');
|
|
12895
|
-
return /*#__PURE__*/
|
|
12916
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
12896
12917
|
style: [styles$9.row, columnWrapperStyle]
|
|
12897
12918
|
}, _item2.map((it, kk) => {
|
|
12898
12919
|
var element = render({
|
|
@@ -12901,7 +12922,7 @@ let FlatList$1 = class FlatList extends React.PureComponent {
|
|
|
12901
12922
|
index: _index * cols + kk,
|
|
12902
12923
|
separators: info.separators
|
|
12903
12924
|
});
|
|
12904
|
-
return element != null ? /*#__PURE__*/
|
|
12925
|
+
return element != null ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, {
|
|
12905
12926
|
key: kk
|
|
12906
12927
|
}, element) : null;
|
|
12907
12928
|
}));
|
|
@@ -13008,7 +13029,7 @@ let FlatList$1 = class FlatList extends React.PureComponent {
|
|
|
13008
13029
|
return (
|
|
13009
13030
|
/*#__PURE__*/
|
|
13010
13031
|
// $FlowFixMe[incompatible-exact] - `restProps` (`Props`) is inexact.
|
|
13011
|
-
|
|
13032
|
+
React__namespace.createElement(VirtualizedList$1, _extends$1({}, restProps, {
|
|
13012
13033
|
getItem: this._getItem,
|
|
13013
13034
|
getItemCount: this._getItemCount,
|
|
13014
13035
|
keyExtractor: this._keyExtractor,
|
|
@@ -14814,8 +14835,8 @@ var AnimatedProps$1 = AnimatedProps;
|
|
|
14814
14835
|
* WARNING: The `effect` callback should be stable (e.g. using `useCallback`).
|
|
14815
14836
|
*/
|
|
14816
14837
|
function useRefEffect(effect) {
|
|
14817
|
-
var cleanupRef = useRef(undefined);
|
|
14818
|
-
return useCallback(instance => {
|
|
14838
|
+
var cleanupRef = React.useRef(undefined);
|
|
14839
|
+
return React.useCallback(instance => {
|
|
14819
14840
|
if (cleanupRef.current) {
|
|
14820
14841
|
cleanupRef.current();
|
|
14821
14842
|
cleanupRef.current = undefined;
|
|
@@ -14837,15 +14858,15 @@ function useRefEffect(effect) {
|
|
|
14837
14858
|
*/
|
|
14838
14859
|
|
|
14839
14860
|
function useAnimatedProps(props) {
|
|
14840
|
-
var _useReducer = useReducer(count => count + 1, 0),
|
|
14861
|
+
var _useReducer = React.useReducer(count => count + 1, 0),
|
|
14841
14862
|
scheduleUpdate = _useReducer[1];
|
|
14842
|
-
var onUpdateRef = useRef(null);
|
|
14863
|
+
var onUpdateRef = React.useRef(null);
|
|
14843
14864
|
|
|
14844
14865
|
// TODO: Only invalidate `node` if animated props or `style` change. In the
|
|
14845
14866
|
// previous implementation, we permitted `style` to override props with the
|
|
14846
14867
|
// same name property name as styles, so we can probably continue doing that.
|
|
14847
14868
|
// The ordering of other props *should* not matter.
|
|
14848
|
-
var node = useMemo(() => new AnimatedProps$1(props, () => onUpdateRef.current == null ? void 0 : onUpdateRef.current()), [props]);
|
|
14869
|
+
var node = React.useMemo(() => new AnimatedProps$1(props, () => onUpdateRef.current == null ? void 0 : onUpdateRef.current()), [props]);
|
|
14849
14870
|
useAnimatedPropsLifecycle(node);
|
|
14850
14871
|
|
|
14851
14872
|
// TODO: This "effect" does three things:
|
|
@@ -14861,7 +14882,7 @@ function useAnimatedProps(props) {
|
|
|
14861
14882
|
//
|
|
14862
14883
|
// But there is no way to transparently compose three separate callback refs,
|
|
14863
14884
|
// so we just combine them all into one for now.
|
|
14864
|
-
var refEffect = useCallback(instance => {
|
|
14885
|
+
var refEffect = React.useCallback(instance => {
|
|
14865
14886
|
// NOTE: This may be called more often than necessary (e.g. when `props`
|
|
14866
14887
|
// changes), but `setNativeView` already optimizes for that.
|
|
14867
14888
|
node.setNativeView(instance);
|
|
@@ -14911,9 +14932,9 @@ function reduceAnimatedProps(node) {
|
|
|
14911
14932
|
* unless we are unmounting.
|
|
14912
14933
|
*/
|
|
14913
14934
|
function useAnimatedPropsLifecycle(node) {
|
|
14914
|
-
var prevNodeRef = useRef(null);
|
|
14915
|
-
var isUnmountingRef = useRef(false);
|
|
14916
|
-
useEffect(() => {
|
|
14935
|
+
var prevNodeRef = React.useRef(null);
|
|
14936
|
+
var isUnmountingRef = React.useRef(false);
|
|
14937
|
+
React.useEffect(() => {
|
|
14917
14938
|
// It is ok for multiple components to call `flushQueue` because it noops
|
|
14918
14939
|
// if the queue is empty. When multiple animated components are mounted at
|
|
14919
14940
|
// the same time. Only first component flushes the queue and the others will noop.
|
|
@@ -14973,7 +14994,7 @@ function useMergeRefs() {
|
|
|
14973
14994
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14974
14995
|
refs[_key] = arguments[_key];
|
|
14975
14996
|
}
|
|
14976
|
-
return useCallback(current => {
|
|
14997
|
+
return React.useCallback(current => {
|
|
14977
14998
|
for (var _i = 0, _refs = refs; _i < _refs.length; _i++) {
|
|
14978
14999
|
var ref = _refs[_i];
|
|
14979
15000
|
if (ref != null) {
|
|
@@ -14994,7 +15015,7 @@ var _excluded$3 = ["style"];
|
|
|
14994
15015
|
* be compatible with concurrent rendering.
|
|
14995
15016
|
*/
|
|
14996
15017
|
function createAnimatedComponent(Component) {
|
|
14997
|
-
return /*#__PURE__*/
|
|
15018
|
+
return /*#__PURE__*/React__namespace.forwardRef((props, forwardedRef) => {
|
|
14998
15019
|
var _useAnimatedProps = useAnimatedProps(props),
|
|
14999
15020
|
reducedProps = _useAnimatedProps[0],
|
|
15000
15021
|
callbackRef = _useAnimatedProps[1];
|
|
@@ -15011,7 +15032,7 @@ function createAnimatedComponent(Component) {
|
|
|
15011
15032
|
passthroughStyle = _ref.style,
|
|
15012
15033
|
passthroughProps = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
15013
15034
|
var mergedStyle = [style, passthroughStyle];
|
|
15014
|
-
return /*#__PURE__*/
|
|
15035
|
+
return /*#__PURE__*/React__namespace.createElement(Component, _extends$1({}, reducedProps, passthroughProps, {
|
|
15015
15036
|
style: mergedStyle,
|
|
15016
15037
|
ref: ref
|
|
15017
15038
|
}));
|
|
@@ -15021,7 +15042,7 @@ function createAnimatedComponent(Component) {
|
|
|
15021
15042
|
/**
|
|
15022
15043
|
* @see https://github.com/facebook/react-native/commit/b8c8562
|
|
15023
15044
|
*/
|
|
15024
|
-
var FlatListWithEventThrottle = /*#__PURE__*/
|
|
15045
|
+
var FlatListWithEventThrottle = /*#__PURE__*/React__namespace.forwardRef((props, ref) => /*#__PURE__*/React__namespace.createElement(FlatList$2, _extends$1({
|
|
15025
15046
|
scrollEventThrottle: 0.0001
|
|
15026
15047
|
}, props, {
|
|
15027
15048
|
ref: ref
|
|
@@ -15244,20 +15265,20 @@ var IDLE = 'IDLE';
|
|
|
15244
15265
|
var _filterId = 0;
|
|
15245
15266
|
var svgDataUriPattern = /^(data:image\/svg\+xml;utf8,)(.*)/;
|
|
15246
15267
|
function createTintColorSVG(tintColor, id) {
|
|
15247
|
-
return tintColor && id != null ? /*#__PURE__*/
|
|
15268
|
+
return tintColor && id != null ? /*#__PURE__*/React__namespace.createElement("svg", {
|
|
15248
15269
|
style: {
|
|
15249
15270
|
position: 'absolute',
|
|
15250
15271
|
height: 0,
|
|
15251
15272
|
visibility: 'hidden',
|
|
15252
15273
|
width: 0
|
|
15253
15274
|
}
|
|
15254
|
-
}, /*#__PURE__*/
|
|
15275
|
+
}, /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("filter", {
|
|
15255
15276
|
id: "tint-" + id,
|
|
15256
15277
|
suppressHydrationWarning: true
|
|
15257
|
-
}, /*#__PURE__*/
|
|
15278
|
+
}, /*#__PURE__*/React__namespace.createElement("feFlood", {
|
|
15258
15279
|
floodColor: "" + tintColor,
|
|
15259
15280
|
key: tintColor
|
|
15260
|
-
}), /*#__PURE__*/
|
|
15281
|
+
}), /*#__PURE__*/React__namespace.createElement("feComposite", {
|
|
15261
15282
|
in2: "SourceAlpha",
|
|
15262
15283
|
operator: "atop"
|
|
15263
15284
|
})))) : null;
|
|
@@ -15350,7 +15371,7 @@ function resolveAssetUri(source) {
|
|
|
15350
15371
|
}
|
|
15351
15372
|
return uri;
|
|
15352
15373
|
}
|
|
15353
|
-
var Image$1 = /*#__PURE__*/
|
|
15374
|
+
var Image$1 = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
|
|
15354
15375
|
var _ariaLabel = props['aria-label'],
|
|
15355
15376
|
accessibilityLabel = props.accessibilityLabel,
|
|
15356
15377
|
blurRadius = props.blurRadius,
|
|
@@ -15371,7 +15392,7 @@ var Image$1 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
15371
15392
|
throw new Error('The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.');
|
|
15372
15393
|
}
|
|
15373
15394
|
}
|
|
15374
|
-
var _React$useState =
|
|
15395
|
+
var _React$useState = React__namespace.useState(() => {
|
|
15375
15396
|
var uri = resolveAssetUri(source);
|
|
15376
15397
|
if (uri != null) {
|
|
15377
15398
|
var isLoaded = ImageLoader$1.has(uri);
|
|
@@ -15383,13 +15404,13 @@ var Image$1 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
15383
15404
|
}),
|
|
15384
15405
|
state = _React$useState[0],
|
|
15385
15406
|
updateState = _React$useState[1];
|
|
15386
|
-
var _React$useState2 =
|
|
15407
|
+
var _React$useState2 = React__namespace.useState({}),
|
|
15387
15408
|
layout = _React$useState2[0],
|
|
15388
15409
|
updateLayout = _React$useState2[1];
|
|
15389
|
-
var hasTextAncestor =
|
|
15390
|
-
var hiddenImageRef =
|
|
15391
|
-
var filterRef =
|
|
15392
|
-
var requestRef =
|
|
15410
|
+
var hasTextAncestor = React__namespace.useContext(TextAncestorContext$1);
|
|
15411
|
+
var hiddenImageRef = React__namespace.useRef(null);
|
|
15412
|
+
var filterRef = React__namespace.useRef(_filterId++);
|
|
15413
|
+
var requestRef = React__namespace.useRef(null);
|
|
15393
15414
|
var shouldDisplaySource = state === LOADED || state === LOADING && defaultSource == null;
|
|
15394
15415
|
var _extractNonStandardSt = extractNonStandardStyleProps(style, blurRadius, filterRef.current, props.tintColor),
|
|
15395
15416
|
_resizeMode = _extractNonStandardSt[0],
|
|
@@ -15436,7 +15457,7 @@ var Image$1 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
15436
15457
|
|
|
15437
15458
|
// Image loading
|
|
15438
15459
|
var uri = resolveAssetUri(source);
|
|
15439
|
-
|
|
15460
|
+
React__namespace.useEffect(() => {
|
|
15440
15461
|
abortPendingRequest();
|
|
15441
15462
|
if (uri != null) {
|
|
15442
15463
|
updateState(LOADING);
|
|
@@ -15473,7 +15494,7 @@ var Image$1 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
15473
15494
|
}
|
|
15474
15495
|
return abortPendingRequest;
|
|
15475
15496
|
}, [uri, requestRef, updateState, onError, onLoad, onLoadEnd, onLoadStart]);
|
|
15476
|
-
return /*#__PURE__*/
|
|
15497
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends$1({}, rest, {
|
|
15477
15498
|
"aria-label": ariaLabel,
|
|
15478
15499
|
onLayout: handleLayout,
|
|
15479
15500
|
pointerEvents: pointerEvents,
|
|
@@ -15484,7 +15505,7 @@ var Image$1 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
15484
15505
|
{
|
|
15485
15506
|
boxShadow: null
|
|
15486
15507
|
}]
|
|
15487
|
-
}), /*#__PURE__*/
|
|
15508
|
+
}), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
15488
15509
|
style: [styles$8.image, resizeModeStyles[resizeMode], {
|
|
15489
15510
|
backgroundImage,
|
|
15490
15511
|
filter
|
|
@@ -15585,7 +15606,7 @@ var Image = createAnimatedComponent(Image$2);
|
|
|
15585
15606
|
/**
|
|
15586
15607
|
* @see https://github.com/facebook/react-native/commit/b8c8562
|
|
15587
15608
|
*/
|
|
15588
|
-
var ScrollViewWithEventThrottle = /*#__PURE__*/
|
|
15609
|
+
var ScrollViewWithEventThrottle = /*#__PURE__*/React__namespace.forwardRef((props, ref) => /*#__PURE__*/React__namespace.createElement(ScrollView$2, _extends$1({
|
|
15589
15610
|
scrollEventThrottle: 0.0001
|
|
15590
15611
|
}, props, {
|
|
15591
15612
|
ref: ref
|
|
@@ -15598,7 +15619,7 @@ var _excluded$1 = ["ItemSeparatorComponent", "SectionSeparatorComponent", "rende
|
|
|
15598
15619
|
* hood. The only operation that might not scale well is concatting the data arrays of all the
|
|
15599
15620
|
* sections when new props are received, which should be plenty fast for up to ~10,000 items.
|
|
15600
15621
|
*/
|
|
15601
|
-
class VirtualizedSectionList extends
|
|
15622
|
+
class VirtualizedSectionList extends React__namespace.PureComponent {
|
|
15602
15623
|
constructor() {
|
|
15603
15624
|
super(...arguments);
|
|
15604
15625
|
this._keyExtractor = (item, index) => {
|
|
@@ -15659,7 +15680,7 @@ class VirtualizedSectionList extends React.PureComponent {
|
|
|
15659
15680
|
var renderItem = info.section.renderItem || this.props.renderItem;
|
|
15660
15681
|
var SeparatorComponent = this._getSeparatorComponent(index, info, listItemCount);
|
|
15661
15682
|
invariant$1(renderItem, 'no renderItem!');
|
|
15662
|
-
return /*#__PURE__*/
|
|
15683
|
+
return /*#__PURE__*/React__namespace.createElement(ItemWithSeparator, {
|
|
15663
15684
|
SeparatorComponent: SeparatorComponent,
|
|
15664
15685
|
LeadingSeparatorComponent: infoIndex === 0 ? this.props.SectionSeparatorComponent : undefined,
|
|
15665
15686
|
cellKey: info.key,
|
|
@@ -15765,7 +15786,7 @@ class VirtualizedSectionList extends React.PureComponent {
|
|
|
15765
15786
|
itemCount += this.props.getItemCount(section.data);
|
|
15766
15787
|
}
|
|
15767
15788
|
var renderItem = this._renderItem(itemCount);
|
|
15768
|
-
return /*#__PURE__*/
|
|
15789
|
+
return /*#__PURE__*/React__namespace.createElement(VirtualizedList$1, _extends$1({}, passThroughProps, {
|
|
15769
15790
|
keyExtractor: this._keyExtractor,
|
|
15770
15791
|
stickyHeaderIndices: stickyHeaderIndices,
|
|
15771
15792
|
renderItem: renderItem,
|
|
@@ -15878,13 +15899,13 @@ function ItemWithSeparator(props) {
|
|
|
15878
15899
|
index = props.index,
|
|
15879
15900
|
section = props.section,
|
|
15880
15901
|
inverted = props.inverted;
|
|
15881
|
-
var _React$useState =
|
|
15902
|
+
var _React$useState = React__namespace.useState(false),
|
|
15882
15903
|
leadingSeparatorHiglighted = _React$useState[0],
|
|
15883
15904
|
setLeadingSeparatorHighlighted = _React$useState[1];
|
|
15884
|
-
var _React$useState2 =
|
|
15905
|
+
var _React$useState2 = React__namespace.useState(false),
|
|
15885
15906
|
separatorHighlighted = _React$useState2[0],
|
|
15886
15907
|
setSeparatorHighlighted = _React$useState2[1];
|
|
15887
|
-
var _React$useState3 =
|
|
15908
|
+
var _React$useState3 = React__namespace.useState({
|
|
15888
15909
|
leadingItem: props.leadingItem,
|
|
15889
15910
|
leadingSection: props.leadingSection,
|
|
15890
15911
|
section: props.section,
|
|
@@ -15893,7 +15914,7 @@ function ItemWithSeparator(props) {
|
|
|
15893
15914
|
}),
|
|
15894
15915
|
leadingSeparatorProps = _React$useState3[0],
|
|
15895
15916
|
setLeadingSeparatorProps = _React$useState3[1];
|
|
15896
|
-
var _React$useState4 =
|
|
15917
|
+
var _React$useState4 = React__namespace.useState({
|
|
15897
15918
|
leadingItem: props.item,
|
|
15898
15919
|
leadingSection: props.leadingSection,
|
|
15899
15920
|
section: props.section,
|
|
@@ -15902,7 +15923,7 @@ function ItemWithSeparator(props) {
|
|
|
15902
15923
|
}),
|
|
15903
15924
|
separatorProps = _React$useState4[0],
|
|
15904
15925
|
setSeparatorProps = _React$useState4[1];
|
|
15905
|
-
|
|
15926
|
+
React__namespace.useEffect(() => {
|
|
15906
15927
|
setSelfHighlightCallback(cellKey, setSeparatorHighlighted);
|
|
15907
15928
|
// $FlowFixMe[incompatible-call]
|
|
15908
15929
|
setSelfUpdatePropsCallback(cellKey, setSeparatorProps);
|
|
@@ -15945,13 +15966,13 @@ function ItemWithSeparator(props) {
|
|
|
15945
15966
|
section,
|
|
15946
15967
|
separators
|
|
15947
15968
|
});
|
|
15948
|
-
var leadingSeparator = LeadingSeparatorComponent != null && /*#__PURE__*/
|
|
15969
|
+
var leadingSeparator = LeadingSeparatorComponent != null && /*#__PURE__*/React__namespace.createElement(LeadingSeparatorComponent, _extends$1({
|
|
15949
15970
|
highlighted: leadingSeparatorHiglighted
|
|
15950
15971
|
}, leadingSeparatorProps));
|
|
15951
|
-
var separator = SeparatorComponent != null && /*#__PURE__*/
|
|
15972
|
+
var separator = SeparatorComponent != null && /*#__PURE__*/React__namespace.createElement(SeparatorComponent, _extends$1({
|
|
15952
15973
|
highlighted: separatorHighlighted
|
|
15953
15974
|
}, separatorProps));
|
|
15954
|
-
return leadingSeparator || separator ? /*#__PURE__*/
|
|
15975
|
+
return leadingSeparator || separator ? /*#__PURE__*/React__namespace.createElement(View$2, null, inverted === false ? leadingSeparator : separator, element, inverted === false ? separator : leadingSeparator) : element;
|
|
15955
15976
|
}
|
|
15956
15977
|
|
|
15957
15978
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
@@ -16025,7 +16046,7 @@ var _excluded = ["stickySectionHeadersEnabled"];
|
|
|
16025
16046
|
* Alternatively, you can provide a custom `keyExtractor` prop.
|
|
16026
16047
|
*
|
|
16027
16048
|
*/
|
|
16028
|
-
let SectionList$1 = class SectionList extends
|
|
16049
|
+
let SectionList$1 = class SectionList extends React__namespace.PureComponent {
|
|
16029
16050
|
constructor() {
|
|
16030
16051
|
super(...arguments);
|
|
16031
16052
|
this._captureRef = ref => {
|
|
@@ -16088,7 +16109,7 @@ let SectionList$1 = class SectionList extends React.PureComponent {
|
|
|
16088
16109
|
_stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled,
|
|
16089
16110
|
restProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
16090
16111
|
var stickySectionHeadersEnabled = _stickySectionHeadersEnabled !== null && _stickySectionHeadersEnabled !== void 0 ? _stickySectionHeadersEnabled : Platform$1.OS === 'ios';
|
|
16091
|
-
return /*#__PURE__*/
|
|
16112
|
+
return /*#__PURE__*/React__namespace.createElement(VirtualizedSectionList$1, _extends$1({}, restProps, {
|
|
16092
16113
|
stickySectionHeadersEnabled: stickySectionHeadersEnabled,
|
|
16093
16114
|
ref: this._captureRef,
|
|
16094
16115
|
getItemCount: items => items.length,
|
|
@@ -16100,7 +16121,7 @@ let SectionList$1 = class SectionList extends React.PureComponent {
|
|
|
16100
16121
|
/**
|
|
16101
16122
|
* @see https://github.com/facebook/react-native/commit/b8c8562
|
|
16102
16123
|
*/
|
|
16103
|
-
var SectionListWithEventThrottle = /*#__PURE__*/
|
|
16124
|
+
var SectionListWithEventThrottle = /*#__PURE__*/React__namespace.forwardRef((props, ref) => /*#__PURE__*/React__namespace.createElement(SectionList$1, _extends$1({
|
|
16104
16125
|
scrollEventThrottle: 0.0001
|
|
16105
16126
|
}, props, {
|
|
16106
16127
|
ref: ref
|
|
@@ -18578,11 +18599,11 @@ var ProgressBar = function (_a) {
|
|
|
18578
18599
|
var styles = useStyles(theme);
|
|
18579
18600
|
var containerStyles = useContainerStyles(theme);
|
|
18580
18601
|
var progressStyles = useProgressStyles(theme, variant);
|
|
18581
|
-
var animatedWidth =
|
|
18602
|
+
var animatedWidth = React__namespace.useRef(new Animated$1.Value(0)).current;
|
|
18582
18603
|
var containerStyle = [styles.container, containerStyles[height], {
|
|
18583
18604
|
backgroundColor: theme.derivedSurface[20]
|
|
18584
18605
|
}];
|
|
18585
|
-
|
|
18606
|
+
React__namespace.useEffect(function () {
|
|
18586
18607
|
Animated$1.timing(animatedWidth, {
|
|
18587
18608
|
toValue: Math.min(Math.max(percentage, 0), 100),
|
|
18588
18609
|
duration: animationDuration,
|
|
@@ -18595,9 +18616,9 @@ var ProgressBar = function (_a) {
|
|
|
18595
18616
|
outputRange: ['0%', '100%']
|
|
18596
18617
|
})
|
|
18597
18618
|
};
|
|
18598
|
-
return /*#__PURE__*/
|
|
18619
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
18599
18620
|
style: containerStyle
|
|
18600
|
-
}, /*#__PURE__*/
|
|
18621
|
+
}, /*#__PURE__*/React__namespace.createElement(Animated$1.View, {
|
|
18601
18622
|
style: [styles.progress, progressStyles, progressWidth]
|
|
18602
18623
|
}));
|
|
18603
18624
|
};
|
|
@@ -18626,7 +18647,7 @@ var ProgressiveImage = function (_a) {
|
|
|
18626
18647
|
_b = _a.isDesaturated,
|
|
18627
18648
|
isDesaturated = _b === void 0 ? false : _b,
|
|
18628
18649
|
props = __rest(_a, ["source", "style", "isDesaturated"]);
|
|
18629
|
-
var imageAnimated = useRef(new Animated$1.Value(0)).current;
|
|
18650
|
+
var imageAnimated = React.useRef(new Animated$1.Value(0)).current;
|
|
18630
18651
|
var theme = useWllSdk().theme;
|
|
18631
18652
|
var onImageLoad = function () {
|
|
18632
18653
|
requestAnimationFrame(function () {
|
|
@@ -18646,11 +18667,11 @@ var ProgressiveImage = function (_a) {
|
|
|
18646
18667
|
} : {
|
|
18647
18668
|
tintColor: isDesaturated ? desaturatedColor : undefined
|
|
18648
18669
|
};
|
|
18649
|
-
return /*#__PURE__*/
|
|
18670
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
18650
18671
|
style: [styles$7.container, style, {
|
|
18651
18672
|
backgroundColor: backgroundColor
|
|
18652
18673
|
}]
|
|
18653
|
-
}, /*#__PURE__*/
|
|
18674
|
+
}, /*#__PURE__*/React.createElement(Animated$1.View, {
|
|
18654
18675
|
style: [styles$7.imageOverlay, {
|
|
18655
18676
|
backgroundColor: backgroundColor,
|
|
18656
18677
|
opacity: imageAnimated.interpolate({
|
|
@@ -18658,7 +18679,7 @@ var ProgressiveImage = function (_a) {
|
|
|
18658
18679
|
outputRange: [1, 0]
|
|
18659
18680
|
})
|
|
18660
18681
|
}]
|
|
18661
|
-
}), /*#__PURE__*/
|
|
18682
|
+
}), /*#__PURE__*/React.createElement(Animated$1.Image, _extends({}, props, {
|
|
18662
18683
|
source: source,
|
|
18663
18684
|
style: [styles$7.imageOverlay, __assign({
|
|
18664
18685
|
opacity: imageAnimated
|
|
@@ -18729,7 +18750,7 @@ var Text = function (_a) {
|
|
|
18729
18750
|
}
|
|
18730
18751
|
};
|
|
18731
18752
|
var variantStyle = getVariantStyle(variant);
|
|
18732
|
-
return /*#__PURE__*/
|
|
18753
|
+
return /*#__PURE__*/React__namespace.createElement(Text$3, _extends({
|
|
18733
18754
|
style: [variantStyle, style]
|
|
18734
18755
|
}, props));
|
|
18735
18756
|
};
|
|
@@ -18737,22 +18758,22 @@ var Text = function (_a) {
|
|
|
18737
18758
|
var MAX_WIDTH = 1080;
|
|
18738
18759
|
var BUTTON_SIZE = 42;
|
|
18739
18760
|
|
|
18740
|
-
|
|
18761
|
+
exports.CTALinkTarget = void 0;
|
|
18741
18762
|
(function (CTALinkTarget) {
|
|
18742
18763
|
CTALinkTarget["sameWindow"] = "SAME_FRAME";
|
|
18743
18764
|
CTALinkTarget["newWindow"] = "NEW_WINDOW";
|
|
18744
|
-
})(CTALinkTarget || (CTALinkTarget = {}));
|
|
18745
|
-
|
|
18765
|
+
})(exports.CTALinkTarget || (exports.CTALinkTarget = {}));
|
|
18766
|
+
exports.TierTileType = void 0;
|
|
18746
18767
|
(function (TierTileType) {
|
|
18747
18768
|
TierTileType["currentTier"] = "CURRENT";
|
|
18748
18769
|
TierTileType["specificTier"] = "SPECIFIC";
|
|
18749
|
-
})(TierTileType || (TierTileType = {}));
|
|
18750
|
-
|
|
18770
|
+
})(exports.TierTileType || (exports.TierTileType = {}));
|
|
18771
|
+
exports.ProgressType = void 0;
|
|
18751
18772
|
(function (ProgressType) {
|
|
18752
18773
|
ProgressType["Name"] = "NAME";
|
|
18753
18774
|
ProgressType["Points"] = "POINTS";
|
|
18754
|
-
})(ProgressType || (ProgressType = {}));
|
|
18755
|
-
|
|
18775
|
+
})(exports.ProgressType || (exports.ProgressType = {}));
|
|
18776
|
+
exports.TileType = void 0;
|
|
18756
18777
|
(function (TileType) {
|
|
18757
18778
|
TileType["Banner"] = "BANNER";
|
|
18758
18779
|
TileType["Points"] = "POINTS";
|
|
@@ -18761,12 +18782,12 @@ var TileType;
|
|
|
18761
18782
|
TileType["Badge"] = "BADGE";
|
|
18762
18783
|
TileType["RewardCategory"] = "REWARD_CATEGORY";
|
|
18763
18784
|
TileType["Tier"] = "TIER";
|
|
18764
|
-
})(TileType || (TileType = {}));
|
|
18765
|
-
|
|
18785
|
+
})(exports.TileType || (exports.TileType = {}));
|
|
18786
|
+
exports.TileHeight = void 0;
|
|
18766
18787
|
(function (TileHeight) {
|
|
18767
18788
|
TileHeight["Half"] = "HALF";
|
|
18768
18789
|
TileHeight["Full"] = "FULL";
|
|
18769
|
-
})(TileHeight || (TileHeight = {}));
|
|
18790
|
+
})(exports.TileHeight || (exports.TileHeight = {}));
|
|
18770
18791
|
var BannerTileConfig = /** @class */function () {
|
|
18771
18792
|
function BannerTileConfig() {}
|
|
18772
18793
|
return BannerTileConfig;
|
|
@@ -18826,14 +18847,14 @@ var RewardTileConfig = /** @class */function () {
|
|
|
18826
18847
|
}
|
|
18827
18848
|
return RewardTileConfig;
|
|
18828
18849
|
}();
|
|
18829
|
-
|
|
18850
|
+
exports.BadgeTileType = void 0;
|
|
18830
18851
|
(function (BadgeTileType) {
|
|
18831
18852
|
BadgeTileType["Specific"] = "SPECIFIC";
|
|
18832
18853
|
BadgeTileType["Latest"] = "LATEST_EARNED";
|
|
18833
|
-
})(BadgeTileType || (BadgeTileType = {}));
|
|
18854
|
+
})(exports.BadgeTileType || (exports.BadgeTileType = {}));
|
|
18834
18855
|
var BadgeTileConfig = /** @class */function () {
|
|
18835
18856
|
function BadgeTileConfig() {
|
|
18836
|
-
this.type = BadgeTileType.Specific;
|
|
18857
|
+
this.type = exports.BadgeTileType.Specific;
|
|
18837
18858
|
this.badgeId = '';
|
|
18838
18859
|
this.defaultLocale = 'en';
|
|
18839
18860
|
this.priority = 0;
|
|
@@ -18860,7 +18881,7 @@ var RewardCategoryTileConfig = /** @class */function () {
|
|
|
18860
18881
|
}();
|
|
18861
18882
|
var TierTileConfig = /** @class */function () {
|
|
18862
18883
|
function TierTileConfig() {
|
|
18863
|
-
this.progressType = ProgressType.Name;
|
|
18884
|
+
this.progressType = exports.ProgressType.Name;
|
|
18864
18885
|
this.title = '';
|
|
18865
18886
|
this.emptyDescription = '';
|
|
18866
18887
|
this.emptyArtworkUrl = '';
|
|
@@ -18873,31 +18894,31 @@ var TierTileConfig = /** @class */function () {
|
|
|
18873
18894
|
|
|
18874
18895
|
var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
|
|
18875
18896
|
var handleNavigation = useWllSdk().handleNavigation;
|
|
18876
|
-
return useCallback(function () {
|
|
18877
|
-
if ((tile === null || tile === void 0 ? void 0 : tile.type) === TileType.Reward) {
|
|
18897
|
+
return React.useCallback(function () {
|
|
18898
|
+
if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.Reward) {
|
|
18878
18899
|
var config = tile.configuration;
|
|
18879
18900
|
if (config === null || config === void 0 ? void 0 : config.rewardId) {
|
|
18880
18901
|
var url = "/reward?id=".concat(config.rewardId);
|
|
18881
|
-
return handleNavigation(url, CTALinkTarget.sameWindow);
|
|
18902
|
+
return handleNavigation(url, exports.CTALinkTarget.sameWindow);
|
|
18882
18903
|
}
|
|
18883
18904
|
}
|
|
18884
|
-
if ((tile === null || tile === void 0 ? void 0 : tile.type) === TileType.RewardCategory) {
|
|
18905
|
+
if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.RewardCategory) {
|
|
18885
18906
|
var config = tile.configuration;
|
|
18886
18907
|
var url = "/category?id=".concat(config.rewardCategoryId);
|
|
18887
18908
|
if (config === null || config === void 0 ? void 0 : config.rewardCategoryId) {
|
|
18888
|
-
return handleNavigation(url, CTALinkTarget.sameWindow);
|
|
18909
|
+
return handleNavigation(url, exports.CTALinkTarget.sameWindow);
|
|
18889
18910
|
}
|
|
18890
18911
|
}
|
|
18891
18912
|
if (ctaLink) {
|
|
18892
|
-
var target = ctaLinkTarget || CTALinkTarget.sameWindow;
|
|
18913
|
+
var target = ctaLinkTarget || exports.CTALinkTarget.sameWindow;
|
|
18893
18914
|
return handleNavigation(ctaLink, target);
|
|
18894
18915
|
}
|
|
18895
18916
|
}, [tile, ctaLink, ctaLinkTarget, handleNavigation]);
|
|
18896
18917
|
};
|
|
18897
18918
|
|
|
18898
|
-
var BannerContext = /*#__PURE__*/createContext(null);
|
|
18919
|
+
var BannerContext = /*#__PURE__*/React.createContext(null);
|
|
18899
18920
|
var useBannerContext = function () {
|
|
18900
|
-
var context = useContext(BannerContext);
|
|
18921
|
+
var context = React.useContext(BannerContext);
|
|
18901
18922
|
if (!context) {
|
|
18902
18923
|
throw new Error('Banner components must be used within a BaseBanner');
|
|
18903
18924
|
}
|
|
@@ -18917,9 +18938,9 @@ var BaseBanner = function (_a) {
|
|
|
18917
18938
|
ctaText = _b.ctaText;
|
|
18918
18939
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
18919
18940
|
var hasCTA = Boolean(ctaText);
|
|
18920
|
-
return /*#__PURE__*/
|
|
18941
|
+
return /*#__PURE__*/React.createElement(BannerContext.Provider, {
|
|
18921
18942
|
value: tile
|
|
18922
|
-
}, /*#__PURE__*/
|
|
18943
|
+
}, /*#__PURE__*/React.createElement(Pressable$1, {
|
|
18923
18944
|
testID: testID || 'banner-tile',
|
|
18924
18945
|
style: function (_a) {
|
|
18925
18946
|
var pressed = _a.pressed;
|
|
@@ -18948,10 +18969,10 @@ var styles$6 = StyleSheet$1.create({
|
|
|
18948
18969
|
});
|
|
18949
18970
|
|
|
18950
18971
|
var useTileSize = function (tile) {
|
|
18951
|
-
return useMemo(function () {
|
|
18972
|
+
return React.useMemo(function () {
|
|
18952
18973
|
return {
|
|
18953
|
-
isFullSize: tile.tileHeight === TileHeight.Full,
|
|
18954
|
-
isHalfSize: tile.tileHeight === TileHeight.Half
|
|
18974
|
+
isFullSize: tile.tileHeight === exports.TileHeight.Full,
|
|
18975
|
+
isHalfSize: tile.tileHeight === exports.TileHeight.Half
|
|
18955
18976
|
};
|
|
18956
18977
|
}, [tile.tileHeight]);
|
|
18957
18978
|
};
|
|
@@ -18971,7 +18992,7 @@ var BaseTileBody = function (props) {
|
|
|
18971
18992
|
if (!isHalfSize && !artworkUrl) return undefined;
|
|
18972
18993
|
return isDesktop ? 3 : isTablet ? 4 : 3;
|
|
18973
18994
|
};
|
|
18974
|
-
return /*#__PURE__*/
|
|
18995
|
+
return /*#__PURE__*/React.createElement(Text, _extends({
|
|
18975
18996
|
variant: "body"
|
|
18976
18997
|
}, props, {
|
|
18977
18998
|
accessibilityLabel: body,
|
|
@@ -19041,7 +19062,7 @@ var BaseTileContent = function (_a) {
|
|
|
19041
19062
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
19042
19063
|
// For half tiles with an image, don't show other content
|
|
19043
19064
|
if (isHalfSize && artworkUrl) return null;
|
|
19044
|
-
return /*#__PURE__*/
|
|
19065
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19045
19066
|
testID: "tile-content",
|
|
19046
19067
|
style: [baseStyles.content, {
|
|
19047
19068
|
justifyContent: 'center',
|
|
@@ -19058,7 +19079,7 @@ var BaseTileHeader = function (_a) {
|
|
|
19058
19079
|
// For half tiles with an image, don't show header
|
|
19059
19080
|
if (isHalfSize && artworkUrl) return null;
|
|
19060
19081
|
var dynamicStyles = useBaseTileStyles();
|
|
19061
|
-
return /*#__PURE__*/
|
|
19082
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19062
19083
|
style: [dynamicStyles.header, {
|
|
19063
19084
|
marginTop: isHalfSize ? 0 : dynamicStyles.header.marginTop,
|
|
19064
19085
|
// @ts-ignore
|
|
@@ -19074,7 +19095,7 @@ var BaseTileMedia = function (props) {
|
|
|
19074
19095
|
var artworkUrl = tile.configuration.artworkUrl;
|
|
19075
19096
|
var styles = useBaseTileStyles();
|
|
19076
19097
|
if (!artworkUrl) return null;
|
|
19077
|
-
return /*#__PURE__*/
|
|
19098
|
+
return /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
|
|
19078
19099
|
testID: "tile-media",
|
|
19079
19100
|
source: {
|
|
19080
19101
|
uri: artworkUrl
|
|
@@ -19093,12 +19114,12 @@ var BaseTileTitle = function () {
|
|
|
19093
19114
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
19094
19115
|
// Don't show title for half tiles with image
|
|
19095
19116
|
if (isHalfSize && artworkUrl || !title) return null;
|
|
19096
|
-
return /*#__PURE__*/
|
|
19117
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
19097
19118
|
variant: "title",
|
|
19098
19119
|
accessibilityLabel: title,
|
|
19099
19120
|
numberOfLines: 1,
|
|
19100
19121
|
testID: "tile-title"
|
|
19101
|
-
}, title), ctaLink && /*#__PURE__*/
|
|
19122
|
+
}, title), ctaLink && /*#__PURE__*/React.createElement(Icon, {
|
|
19102
19123
|
name: "ChevronRight",
|
|
19103
19124
|
color: theme.derivedSurfaceText[20]
|
|
19104
19125
|
}));
|
|
@@ -19107,12 +19128,12 @@ var BaseTileTitle = function () {
|
|
|
19107
19128
|
/**
|
|
19108
19129
|
* Context to provide the current tile to child components.
|
|
19109
19130
|
*/
|
|
19110
|
-
var TileContext = /*#__PURE__*/createContext(null);
|
|
19131
|
+
var TileContext = /*#__PURE__*/React.createContext(null);
|
|
19111
19132
|
/**
|
|
19112
19133
|
* Custom hook to access the TileContext.
|
|
19113
19134
|
*/
|
|
19114
19135
|
var useTileContext = function () {
|
|
19115
|
-
var context = useContext(TileContext);
|
|
19136
|
+
var context = React.useContext(TileContext);
|
|
19116
19137
|
if (!context) {
|
|
19117
19138
|
throw new Error('Tile components must be used within a BaseTile');
|
|
19118
19139
|
}
|
|
@@ -19139,7 +19160,7 @@ var BaseTileContainer = function (_a) {
|
|
|
19139
19160
|
alignItems: 'stretch'
|
|
19140
19161
|
};
|
|
19141
19162
|
var dynamicStyles = useBaseTileStyles();
|
|
19142
|
-
return /*#__PURE__*/
|
|
19163
|
+
return /*#__PURE__*/React.createElement(Pressable$1, {
|
|
19143
19164
|
style: function (_a) {
|
|
19144
19165
|
var pressed = _a.pressed;
|
|
19145
19166
|
return [baseStyles.container, dynamicStyles.container, {
|
|
@@ -19160,9 +19181,9 @@ var BaseTileContainer = function (_a) {
|
|
|
19160
19181
|
var BaseTileRoot = function (_a) {
|
|
19161
19182
|
var tile = _a.tile,
|
|
19162
19183
|
children = _a.children;
|
|
19163
|
-
return /*#__PURE__*/
|
|
19184
|
+
return /*#__PURE__*/React.createElement(TileContext.Provider, {
|
|
19164
19185
|
value: tile
|
|
19165
|
-
}, /*#__PURE__*/
|
|
19186
|
+
}, /*#__PURE__*/React.createElement(BaseTile.Container, null, children));
|
|
19166
19187
|
};
|
|
19167
19188
|
/**
|
|
19168
19189
|
* BaseTile component with subcomponents attached.
|
|
@@ -19186,9 +19207,9 @@ var Indicator = function () {
|
|
|
19186
19207
|
if (isTablet) return 'Tablet Layout';
|
|
19187
19208
|
return 'Mobile Layout';
|
|
19188
19209
|
};
|
|
19189
|
-
return /*#__PURE__*/
|
|
19210
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19190
19211
|
style: styles$5.indicator
|
|
19191
|
-
}, /*#__PURE__*/
|
|
19212
|
+
}, /*#__PURE__*/React.createElement(Text$3, {
|
|
19192
19213
|
style: styles$5.indicatorText
|
|
19193
19214
|
}, getCurrentLayout()));
|
|
19194
19215
|
};
|
|
@@ -19215,8 +19236,8 @@ var GRID_GAP = 16;
|
|
|
19215
19236
|
var SkeletonTile = function (_a) {
|
|
19216
19237
|
var style = _a.style;
|
|
19217
19238
|
var theme = useWllSdk().theme;
|
|
19218
|
-
var animatedValue =
|
|
19219
|
-
|
|
19239
|
+
var animatedValue = React__namespace.useRef(new Animated$1.Value(0)).current;
|
|
19240
|
+
React__namespace.useEffect(function () {
|
|
19220
19241
|
var pulseAnimation = Animated$1.loop(Animated$1.sequence([Animated$1.timing(animatedValue, {
|
|
19221
19242
|
toValue: 1,
|
|
19222
19243
|
duration: 1000,
|
|
@@ -19235,7 +19256,7 @@ var SkeletonTile = function (_a) {
|
|
|
19235
19256
|
inputRange: [0, 1],
|
|
19236
19257
|
outputRange: [0.3, 0.7]
|
|
19237
19258
|
});
|
|
19238
|
-
return /*#__PURE__*/
|
|
19259
|
+
return /*#__PURE__*/React__namespace.createElement(Animated$1.View, {
|
|
19239
19260
|
style: [styles$4.container, {
|
|
19240
19261
|
opacity: opacity,
|
|
19241
19262
|
backgroundColor: theme.alphaDerivedText[20],
|
|
@@ -19257,8 +19278,8 @@ var Skeleton = function (_a) {
|
|
|
19257
19278
|
_b = _a.numberOfSquares,
|
|
19258
19279
|
numberOfSquares = _b === void 0 ? 4 : _b;
|
|
19259
19280
|
var theme = useWllSdk().theme;
|
|
19260
|
-
var animatedValue =
|
|
19261
|
-
|
|
19281
|
+
var animatedValue = React__namespace.useRef(new Animated$1.Value(0)).current;
|
|
19282
|
+
React__namespace.useEffect(function () {
|
|
19262
19283
|
var pulseAnimation = Animated$1.loop(Animated$1.sequence([Animated$1.timing(animatedValue, {
|
|
19263
19284
|
toValue: 1,
|
|
19264
19285
|
duration: 1000,
|
|
@@ -19277,26 +19298,26 @@ var Skeleton = function (_a) {
|
|
|
19277
19298
|
inputRange: [0, 1],
|
|
19278
19299
|
outputRange: [0.3, 0.7]
|
|
19279
19300
|
});
|
|
19280
|
-
return /*#__PURE__*/
|
|
19301
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
19281
19302
|
testID: "loading-skeleton"
|
|
19282
|
-
}, /*#__PURE__*/
|
|
19303
|
+
}, /*#__PURE__*/React__namespace.createElement(Animated$1.View, {
|
|
19283
19304
|
style: [styles$3.skeleton, styles$3.title, {
|
|
19284
19305
|
opacity: opacity,
|
|
19285
19306
|
backgroundColor: theme.alphaDerivedText[20],
|
|
19286
19307
|
borderRadius: 6
|
|
19287
19308
|
}]
|
|
19288
|
-
}), /*#__PURE__*/
|
|
19309
|
+
}), /*#__PURE__*/React__namespace.createElement(Animated$1.View, {
|
|
19289
19310
|
style: [styles$3.skeleton, styles$3.body, {
|
|
19290
19311
|
opacity: opacity,
|
|
19291
19312
|
backgroundColor: theme.alphaDerivedText[20],
|
|
19292
19313
|
borderRadius: 6
|
|
19293
19314
|
}]
|
|
19294
|
-
}), /*#__PURE__*/
|
|
19315
|
+
}), /*#__PURE__*/React__namespace.createElement(Animated$1.View, {
|
|
19295
19316
|
style: [styles$3.container, style]
|
|
19296
19317
|
}, Array.from({
|
|
19297
19318
|
length: numberOfSquares
|
|
19298
19319
|
}).map(function (_, index) {
|
|
19299
|
-
return /*#__PURE__*/
|
|
19320
|
+
return /*#__PURE__*/React__namespace.createElement(SkeletonTile, {
|
|
19300
19321
|
key: index
|
|
19301
19322
|
});
|
|
19302
19323
|
})));
|
|
@@ -19335,16 +19356,16 @@ function withTileFetching(WrappedComponent) {
|
|
|
19335
19356
|
var tile = props.tile,
|
|
19336
19357
|
tileId = props.tileId;
|
|
19337
19358
|
var getTileByID = useWllSdk().getTileByID;
|
|
19338
|
-
var _a = useState(tile || null),
|
|
19359
|
+
var _a = React.useState(tile || null),
|
|
19339
19360
|
tileData = _a[0],
|
|
19340
19361
|
setTileData = _a[1];
|
|
19341
|
-
var _b = useState(false),
|
|
19362
|
+
var _b = React.useState(false),
|
|
19342
19363
|
isLoading = _b[0],
|
|
19343
19364
|
setIsLoading = _b[1];
|
|
19344
|
-
var _c = useState(null),
|
|
19365
|
+
var _c = React.useState(null),
|
|
19345
19366
|
error = _c[0],
|
|
19346
19367
|
setError = _c[1];
|
|
19347
|
-
useEffect(function () {
|
|
19368
|
+
React.useEffect(function () {
|
|
19348
19369
|
if (tile) {
|
|
19349
19370
|
setTileData(tile);
|
|
19350
19371
|
} else if (tileId) {
|
|
@@ -19384,18 +19405,18 @@ function withTileFetching(WrappedComponent) {
|
|
|
19384
19405
|
}
|
|
19385
19406
|
}, [tile, tileId, getTileByID]);
|
|
19386
19407
|
if (isLoading) {
|
|
19387
|
-
return /*#__PURE__*/
|
|
19408
|
+
return /*#__PURE__*/React.createElement(SkeletonTile, {
|
|
19388
19409
|
style: {
|
|
19389
19410
|
width: '100%'
|
|
19390
19411
|
}
|
|
19391
19412
|
});
|
|
19392
19413
|
}
|
|
19393
19414
|
if (error || !tileData) {
|
|
19394
|
-
return /*#__PURE__*/
|
|
19415
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19395
19416
|
style: commonStyles.emptyContainer
|
|
19396
|
-
}, /*#__PURE__*/
|
|
19417
|
+
}, /*#__PURE__*/React.createElement(Text$3, null, "No tile data available"));
|
|
19397
19418
|
}
|
|
19398
|
-
return /*#__PURE__*/
|
|
19419
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
|
|
19399
19420
|
tile: tileData
|
|
19400
19421
|
}));
|
|
19401
19422
|
};
|
|
@@ -19460,11 +19481,11 @@ var BadgeTileDateEarned = function () {
|
|
|
19460
19481
|
type = configuration.type;
|
|
19461
19482
|
var theme = useWllSdk().theme;
|
|
19462
19483
|
// Don't show for Latest type with count=0
|
|
19463
|
-
if (type === BadgeTileType.Latest && count === 0) {
|
|
19484
|
+
if (type === exports.BadgeTileType.Latest && count === 0) {
|
|
19464
19485
|
return null;
|
|
19465
19486
|
}
|
|
19466
19487
|
// For Specific type, only show if count > 0 or badgeNotEarnedMessage exists
|
|
19467
|
-
if (type === BadgeTileType.Specific && count === 0 && !badgeNotEarnedMessage) {
|
|
19488
|
+
if (type === exports.BadgeTileType.Specific && count === 0 && !badgeNotEarnedMessage) {
|
|
19468
19489
|
return null;
|
|
19469
19490
|
}
|
|
19470
19491
|
var backgroundColor = getStateColor(theme.alphaDerivedPrimary[20], type, count);
|
|
@@ -19474,12 +19495,12 @@ var BadgeTileDateEarned = function () {
|
|
|
19474
19495
|
var textColor = getReadableTextColor(backgroundColor);
|
|
19475
19496
|
var displayText = count === 0 ? badgeNotEarnedMessage : "".concat(awardedDatePrefix, " ").concat(new Date(createdAt).toLocaleDateString());
|
|
19476
19497
|
var accessibilityLabel = count === 0 ? 'Badge not yet earned' : "Badge earned on ".concat(new Date(createdAt).toLocaleDateString());
|
|
19477
|
-
return /*#__PURE__*/
|
|
19498
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19478
19499
|
style: containerStyle,
|
|
19479
19500
|
accessible: true,
|
|
19480
19501
|
accessibilityLabel: accessibilityLabel,
|
|
19481
19502
|
testID: "badge-tile-date-earned"
|
|
19482
|
-
}, /*#__PURE__*/
|
|
19503
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19483
19504
|
variant: "label",
|
|
19484
19505
|
style: [styles.dateEarnedText, {
|
|
19485
19506
|
color: textColor
|
|
@@ -19500,12 +19521,12 @@ var BadgeTileDescription = function () {
|
|
|
19500
19521
|
if (!description) return null;
|
|
19501
19522
|
// For Latest type, hide description when count = 0
|
|
19502
19523
|
// For Specific type, always show description
|
|
19503
|
-
if (count === 0 && type === BadgeTileType.Latest) return null;
|
|
19504
|
-
return /*#__PURE__*/
|
|
19524
|
+
if (count === 0 && type === exports.BadgeTileType.Latest) return null;
|
|
19525
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19505
19526
|
accessible: true,
|
|
19506
19527
|
accessibilityLabel: "Badge description: ".concat(description),
|
|
19507
19528
|
testID: "badge-tile-description"
|
|
19508
|
-
}, /*#__PURE__*/
|
|
19529
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19509
19530
|
variant: "body",
|
|
19510
19531
|
numberOfLines: 2,
|
|
19511
19532
|
ellipsizeMode: "tail",
|
|
@@ -19524,12 +19545,12 @@ var BadgeTileMedia = function (_a) {
|
|
|
19524
19545
|
artworkUrl = configuration.artworkUrl,
|
|
19525
19546
|
emptyBadgeArtworkUrl = configuration.emptyBadgeArtworkUrl,
|
|
19526
19547
|
type = configuration.type;
|
|
19527
|
-
var displayUrl = type === BadgeTileType.Specific ? artworkUrl : count === 0 ? emptyBadgeArtworkUrl : artworkUrl;
|
|
19548
|
+
var displayUrl = type === exports.BadgeTileType.Specific ? artworkUrl : count === 0 ? emptyBadgeArtworkUrl : artworkUrl;
|
|
19528
19549
|
if (!displayUrl) return null;
|
|
19529
|
-
return /*#__PURE__*/
|
|
19550
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19530
19551
|
style: styles.header,
|
|
19531
19552
|
testID: "badge-tile-media"
|
|
19532
|
-
}, /*#__PURE__*/
|
|
19553
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
|
|
19533
19554
|
source: {
|
|
19534
19555
|
uri: displayUrl
|
|
19535
19556
|
},
|
|
@@ -19545,23 +19566,23 @@ var BadgeTileStatus = function () {
|
|
|
19545
19566
|
var configuration = tile.configuration;
|
|
19546
19567
|
var count = configuration.count,
|
|
19547
19568
|
type = configuration.type;
|
|
19548
|
-
if (type !== BadgeTileType.Specific || count === 1) {
|
|
19569
|
+
if (type !== exports.BadgeTileType.Specific || count === 1) {
|
|
19549
19570
|
return null;
|
|
19550
19571
|
}
|
|
19551
19572
|
var isLocked = count === 0;
|
|
19552
19573
|
var statusLabel = isLocked ? 'Badge locked' : "Earned ".concat(count, " times");
|
|
19553
|
-
return /*#__PURE__*/
|
|
19574
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19554
19575
|
style: styles.indicatorContainer,
|
|
19555
19576
|
accessible: true,
|
|
19556
19577
|
accessibilityLabel: statusLabel,
|
|
19557
19578
|
testID: "badge-tile-status"
|
|
19558
|
-
}, isLocked ? /*#__PURE__*/
|
|
19579
|
+
}, isLocked ? /*#__PURE__*/React.createElement(Icon, {
|
|
19559
19580
|
name: "LockKeyhole",
|
|
19560
19581
|
testID: "badge-tile-status-locked",
|
|
19561
19582
|
color: "#FFF",
|
|
19562
19583
|
size: 20,
|
|
19563
19584
|
accessibilityElementsHidden: true
|
|
19564
|
-
}) : /*#__PURE__*/
|
|
19585
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
19565
19586
|
style: styles.countText,
|
|
19566
19587
|
accessibilityElementsHidden: true,
|
|
19567
19588
|
importantForAccessibility: "no-hide-descendants"
|
|
@@ -19576,13 +19597,13 @@ var BadgeTileTitle = function () {
|
|
|
19576
19597
|
name = configuration.name,
|
|
19577
19598
|
emptyBadgeMessage = configuration.emptyBadgeMessage,
|
|
19578
19599
|
type = configuration.type;
|
|
19579
|
-
var displayText = type === BadgeTileType.Specific ? name : count === 0 ? emptyBadgeMessage : name;
|
|
19600
|
+
var displayText = type === exports.BadgeTileType.Specific ? name : count === 0 ? emptyBadgeMessage : name;
|
|
19580
19601
|
if (!displayText) return null;
|
|
19581
|
-
return /*#__PURE__*/
|
|
19602
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19582
19603
|
accessible: true,
|
|
19583
19604
|
accessibilityLabel: "Badge title: ".concat(displayText),
|
|
19584
19605
|
testID: "badge-tile-title"
|
|
19585
|
-
}, /*#__PURE__*/
|
|
19606
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19586
19607
|
variant: "title",
|
|
19587
19608
|
style: styles.titleText,
|
|
19588
19609
|
numberOfLines: count === 0 ? 2 : 1,
|
|
@@ -19599,13 +19620,13 @@ var BadgeTileTitle = function () {
|
|
|
19599
19620
|
*/
|
|
19600
19621
|
var BadgeTileRoot = function (_a) {
|
|
19601
19622
|
var tile = _a.tile;
|
|
19602
|
-
if (!tile || tile.tileHeight !== TileHeight.Full || !tile.active) return null;
|
|
19603
|
-
return /*#__PURE__*/
|
|
19623
|
+
if (!tile || tile.tileHeight !== exports.TileHeight.Full || !tile.active) return null;
|
|
19624
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
19604
19625
|
tile: tile
|
|
19605
|
-
}, /*#__PURE__*/
|
|
19626
|
+
}, /*#__PURE__*/React.createElement(BadgeTile.Media, null, /*#__PURE__*/React.createElement(BadgeTile.Status, null)), /*#__PURE__*/React.createElement(Layout, {
|
|
19606
19627
|
justify: "between",
|
|
19607
19628
|
align: "start"
|
|
19608
|
-
}, /*#__PURE__*/
|
|
19629
|
+
}, /*#__PURE__*/React.createElement(BadgeTile.Title, null), /*#__PURE__*/React.createElement(BadgeTile.Description, null), /*#__PURE__*/React.createElement(Spacer, null), /*#__PURE__*/React.createElement(BadgeTile.DateEarned, null)));
|
|
19609
19630
|
};
|
|
19610
19631
|
/**
|
|
19611
19632
|
* The BadgeTile component with subcomponents attached.
|
|
@@ -19628,7 +19649,7 @@ var BannerTileCTA = function () {
|
|
|
19628
19649
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19629
19650
|
if (!ctaText) return null;
|
|
19630
19651
|
var hint = ctaLinkTarget === 'NEW_WINDOW' ? "Opens ".concat(ctaLink, " in a new window") : "Takes you to ".concat(ctaLink);
|
|
19631
|
-
return /*#__PURE__*/
|
|
19652
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
19632
19653
|
testID: "banner-tile-cta",
|
|
19633
19654
|
title: ctaText,
|
|
19634
19655
|
variant: "accent",
|
|
@@ -19679,11 +19700,11 @@ var BannerTileDescription = function () {
|
|
|
19679
19700
|
var description = configuration.description;
|
|
19680
19701
|
var theme = useWllSdk().theme;
|
|
19681
19702
|
if (!description) return null;
|
|
19682
|
-
return /*#__PURE__*/
|
|
19703
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19683
19704
|
accessible: true,
|
|
19684
19705
|
accessibilityLabel: description,
|
|
19685
19706
|
testID: "banner-tile-description"
|
|
19686
|
-
}, /*#__PURE__*/
|
|
19707
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19687
19708
|
style: [styles.description, {
|
|
19688
19709
|
color: theme.derivedSurfaceText[20]
|
|
19689
19710
|
}],
|
|
@@ -19703,7 +19724,7 @@ var BannerTileMedia = function (_a) {
|
|
|
19703
19724
|
var containerStyle = {
|
|
19704
19725
|
width: isArtworkOnly ? '100%' : '30%'
|
|
19705
19726
|
};
|
|
19706
|
-
return /*#__PURE__*/
|
|
19727
|
+
return /*#__PURE__*/React.createElement(View$2
|
|
19707
19728
|
// @ts-ignore: We are using percentage values for width, which is valid in React Native but TypeScript expects a number.
|
|
19708
19729
|
, {
|
|
19709
19730
|
style: [styles.mediaContainer, containerStyle],
|
|
@@ -19711,7 +19732,7 @@ var BannerTileMedia = function (_a) {
|
|
|
19711
19732
|
role: "img",
|
|
19712
19733
|
accessibilityLabel: "Banner image".concat(title ? " for ".concat(title) : ''),
|
|
19713
19734
|
testID: "banner-tile-media"
|
|
19714
|
-
}, /*#__PURE__*/
|
|
19735
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
19715
19736
|
source: {
|
|
19716
19737
|
uri: artworkUrl
|
|
19717
19738
|
},
|
|
@@ -19726,10 +19747,10 @@ var BannerTileTitle = function () {
|
|
|
19726
19747
|
var configuration = useBannerContext().configuration;
|
|
19727
19748
|
var title = configuration.title;
|
|
19728
19749
|
if (!title) return null;
|
|
19729
|
-
return /*#__PURE__*/
|
|
19750
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19730
19751
|
accessible: true,
|
|
19731
19752
|
accessibilityLabel: title
|
|
19732
|
-
}, /*#__PURE__*/
|
|
19753
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19733
19754
|
variant: "title",
|
|
19734
19755
|
testID: "banner-tile-title",
|
|
19735
19756
|
style: styles.title,
|
|
@@ -19756,11 +19777,11 @@ var BannerTileRoot = function (_a) {
|
|
|
19756
19777
|
var tile = _a.tile;
|
|
19757
19778
|
if (!tile || !tile.active) return null;
|
|
19758
19779
|
var configuration = tile.configuration;
|
|
19759
|
-
return /*#__PURE__*/
|
|
19780
|
+
return /*#__PURE__*/React.createElement(BaseBanner, {
|
|
19760
19781
|
tile: tile
|
|
19761
|
-
}, /*#__PURE__*/
|
|
19782
|
+
}, /*#__PURE__*/React.createElement(BannerTile.Media, {
|
|
19762
19783
|
isArtworkOnly: isArtworkOnly$1(configuration)
|
|
19763
|
-
}), /*#__PURE__*/
|
|
19784
|
+
}), /*#__PURE__*/React.createElement(FullFlex, null, /*#__PURE__*/React.createElement(BannerTile.Title, null), /*#__PURE__*/React.createElement(BannerTile.Description, null), /*#__PURE__*/React.createElement(BannerTile.CTA, null)));
|
|
19764
19785
|
};
|
|
19765
19786
|
/**
|
|
19766
19787
|
* The BannerTile component with subcomponents attached.
|
|
@@ -19774,12 +19795,12 @@ var BannerTile = Object.assign(BannerTileRoot, {
|
|
|
19774
19795
|
var BannerTile$1 = withTileFetching(BannerTile);
|
|
19775
19796
|
|
|
19776
19797
|
var ContentTileBody = function () {
|
|
19777
|
-
return /*#__PURE__*/
|
|
19798
|
+
return /*#__PURE__*/React.createElement(BaseTile.Body, null);
|
|
19778
19799
|
};
|
|
19779
19800
|
|
|
19780
19801
|
var ContentTileContainer = function (_a) {
|
|
19781
19802
|
var children = _a.children;
|
|
19782
|
-
return /*#__PURE__*/
|
|
19803
|
+
return /*#__PURE__*/React.createElement(BaseTile.Container, null, children);
|
|
19783
19804
|
};
|
|
19784
19805
|
|
|
19785
19806
|
var useContentTileStyles = function () {
|
|
@@ -19802,7 +19823,7 @@ var useContentTileStyles = function () {
|
|
|
19802
19823
|
var ContentTileContent = function (_a) {
|
|
19803
19824
|
var children = _a.children;
|
|
19804
19825
|
var styles = useContentTileStyles();
|
|
19805
|
-
return /*#__PURE__*/
|
|
19826
|
+
return /*#__PURE__*/React.createElement(BaseTile.Content, null, /*#__PURE__*/React.createElement(View$2, {
|
|
19806
19827
|
style: styles.content
|
|
19807
19828
|
}, children));
|
|
19808
19829
|
};
|
|
@@ -19811,12 +19832,12 @@ var ContentTileHeader = function () {
|
|
|
19811
19832
|
var tile = useTileContext();
|
|
19812
19833
|
var title = tile.configuration.title;
|
|
19813
19834
|
if (!title) return null;
|
|
19814
|
-
return /*#__PURE__*/
|
|
19835
|
+
return /*#__PURE__*/React.createElement(BaseTile.Header, null, /*#__PURE__*/React.createElement(BaseTile.Title, null));
|
|
19815
19836
|
};
|
|
19816
19837
|
|
|
19817
19838
|
var ContentTileMedia = function () {
|
|
19818
19839
|
var styles = useContentTileStyles();
|
|
19819
|
-
return /*#__PURE__*/
|
|
19840
|
+
return /*#__PURE__*/React.createElement(BaseTile.Media, {
|
|
19820
19841
|
style: styles.media
|
|
19821
19842
|
});
|
|
19822
19843
|
};
|
|
@@ -19829,9 +19850,9 @@ var ContentTileMedia = function () {
|
|
|
19829
19850
|
var ContentTileRoot = function (_a) {
|
|
19830
19851
|
var tile = _a.tile;
|
|
19831
19852
|
if (!tile || !tile.active) return null;
|
|
19832
|
-
return /*#__PURE__*/
|
|
19853
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
19833
19854
|
tile: tile
|
|
19834
|
-
}, /*#__PURE__*/
|
|
19855
|
+
}, /*#__PURE__*/React.createElement(ContentTile.Container, null, /*#__PURE__*/React.createElement(ContentTile.Media, null), /*#__PURE__*/React.createElement(ContentTile.Content, null, /*#__PURE__*/React.createElement(ContentTile.Header, null), /*#__PURE__*/React.createElement(ContentTile.Body, null))));
|
|
19835
19856
|
};
|
|
19836
19857
|
/**
|
|
19837
19858
|
* The ContentTile component with subcomponents attached.
|
|
@@ -19861,11 +19882,11 @@ var sortByPriority = function (tiles) {
|
|
|
19861
19882
|
});
|
|
19862
19883
|
};
|
|
19863
19884
|
|
|
19864
|
-
|
|
19885
|
+
exports.SectionType = void 0;
|
|
19865
19886
|
(function (SectionType) {
|
|
19866
19887
|
SectionType["Grid"] = "GRID";
|
|
19867
19888
|
SectionType["Banner"] = "BANNER";
|
|
19868
|
-
})(SectionType || (SectionType = {}));
|
|
19889
|
+
})(exports.SectionType || (exports.SectionType = {}));
|
|
19869
19890
|
|
|
19870
19891
|
/**
|
|
19871
19892
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -19878,10 +19899,10 @@ var SectionType;
|
|
|
19878
19899
|
*/
|
|
19879
19900
|
|
|
19880
19901
|
function useWindowDimensions() {
|
|
19881
|
-
var _useState = useState(() => Dimensions.get('window')),
|
|
19902
|
+
var _useState = React.useState(() => Dimensions.get('window')),
|
|
19882
19903
|
dims = _useState[0],
|
|
19883
19904
|
setDims = _useState[1];
|
|
19884
|
-
useEffect(() => {
|
|
19905
|
+
React.useEffect(() => {
|
|
19885
19906
|
function handleChange(_ref) {
|
|
19886
19907
|
var window = _ref.window;
|
|
19887
19908
|
if (window != null) {
|
|
@@ -19930,14 +19951,14 @@ var SectionHeader = function (_a) {
|
|
|
19930
19951
|
if (!title) {
|
|
19931
19952
|
return null;
|
|
19932
19953
|
}
|
|
19933
|
-
return /*#__PURE__*/
|
|
19954
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19934
19955
|
style: styles.sectionHeader
|
|
19935
|
-
}, title && /*#__PURE__*/
|
|
19956
|
+
}, title && /*#__PURE__*/React.createElement(Text, {
|
|
19936
19957
|
style: [styles.sectionTitle, {
|
|
19937
19958
|
fontWeight: '700',
|
|
19938
19959
|
color: theme.text
|
|
19939
19960
|
}]
|
|
19940
|
-
}, title), description && /*#__PURE__*/
|
|
19961
|
+
}, title), description && /*#__PURE__*/React.createElement(Text, {
|
|
19941
19962
|
style: [styles.sectionDescription, {
|
|
19942
19963
|
color: theme.alphaDerivedText[80]
|
|
19943
19964
|
}]
|
|
@@ -20053,15 +20074,15 @@ var Carousel = function (_a) {
|
|
|
20053
20074
|
var section = _a.section;
|
|
20054
20075
|
if (!section) return null;
|
|
20055
20076
|
var WINDOW_WIDTH = useWindowDimensions().width;
|
|
20056
|
-
var containerRef = useRef(null);
|
|
20077
|
+
var containerRef = React.useRef(null);
|
|
20057
20078
|
var styles = useCarouselStyles(BUTTON_SIZE);
|
|
20058
|
-
var animatedIndex = useRef(new Animated$1.Value(0)).current;
|
|
20079
|
+
var animatedIndex = React.useRef(new Animated$1.Value(0)).current;
|
|
20059
20080
|
var theme = useWllSdk().theme;
|
|
20060
20081
|
var _b = useResponsive(),
|
|
20061
20082
|
isDesktop = _b.isDesktop,
|
|
20062
20083
|
isTablet = _b.isTablet;
|
|
20063
|
-
var scrollViewRef = useRef(null);
|
|
20064
|
-
var _c =
|
|
20084
|
+
var scrollViewRef = React.useRef(null);
|
|
20085
|
+
var _c = React.useReducer(carouselReducer, __assign(__assign({}, initialState), {
|
|
20065
20086
|
containerWidth: WINDOW_WIDTH
|
|
20066
20087
|
})),
|
|
20067
20088
|
state = _c[0],
|
|
@@ -20069,14 +20090,14 @@ var Carousel = function (_a) {
|
|
|
20069
20090
|
var currentIndex = state.currentIndex,
|
|
20070
20091
|
containerWidth = state.containerWidth;
|
|
20071
20092
|
var sortedTiles = sortByPriority(section.tiles.filter(function (tile) {
|
|
20072
|
-
return tile.type === TileType.Banner;
|
|
20093
|
+
return tile.type === exports.TileType.Banner;
|
|
20073
20094
|
}));
|
|
20074
|
-
var handleScroll = useCallback(function (event) {
|
|
20095
|
+
var handleScroll = React.useCallback(function (event) {
|
|
20075
20096
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
20076
20097
|
var newIndex = contentOffsetX / containerWidth;
|
|
20077
20098
|
animatedIndex.setValue(newIndex);
|
|
20078
20099
|
}, [containerWidth, animatedIndex]);
|
|
20079
|
-
var handleScrollEnd = useCallback(function (event) {
|
|
20100
|
+
var handleScrollEnd = React.useCallback(function (event) {
|
|
20080
20101
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
20081
20102
|
var newIndex = Math.round(contentOffsetX / containerWidth);
|
|
20082
20103
|
dispatch({
|
|
@@ -20115,10 +20136,10 @@ var Carousel = function (_a) {
|
|
|
20115
20136
|
marginTop: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet)
|
|
20116
20137
|
}
|
|
20117
20138
|
});
|
|
20118
|
-
return /*#__PURE__*/
|
|
20139
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionHeader, {
|
|
20119
20140
|
title: section.title,
|
|
20120
20141
|
description: section.description
|
|
20121
|
-
}), /*#__PURE__*/
|
|
20142
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20122
20143
|
ref: containerRef,
|
|
20123
20144
|
style: styles.container,
|
|
20124
20145
|
onLayout: function (event) {
|
|
@@ -20128,20 +20149,20 @@ var Carousel = function (_a) {
|
|
|
20128
20149
|
payload: width
|
|
20129
20150
|
});
|
|
20130
20151
|
}
|
|
20131
|
-
}, /*#__PURE__*/
|
|
20152
|
+
}, /*#__PURE__*/React.createElement(View$2, {
|
|
20132
20153
|
style: styles.carouselContainer
|
|
20133
|
-
}, showPrevButton && /*#__PURE__*/
|
|
20154
|
+
}, showPrevButton && /*#__PURE__*/React.createElement(Pressable$1, {
|
|
20134
20155
|
style: [styles.navButton, styles.navButtonLeft, {
|
|
20135
20156
|
backgroundColor: theme.background
|
|
20136
20157
|
}],
|
|
20137
20158
|
onPress: handlePrev,
|
|
20138
20159
|
accessibilityLabel: "Previous slide",
|
|
20139
20160
|
role: "button"
|
|
20140
|
-
}, /*#__PURE__*/
|
|
20161
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20141
20162
|
name: "ArrowLeft",
|
|
20142
20163
|
size: 20,
|
|
20143
20164
|
color: theme.primary
|
|
20144
|
-
})), /*#__PURE__*/
|
|
20165
|
+
})), /*#__PURE__*/React.createElement(ScrollView$2, {
|
|
20145
20166
|
ref: scrollViewRef,
|
|
20146
20167
|
horizontal: true,
|
|
20147
20168
|
pagingEnabled: true,
|
|
@@ -20157,26 +20178,26 @@ var Carousel = function (_a) {
|
|
|
20157
20178
|
snapToInterval: containerWidth,
|
|
20158
20179
|
snapToAlignment: "start"
|
|
20159
20180
|
}, sortedTiles.map(function (tile, index) {
|
|
20160
|
-
return /*#__PURE__*/
|
|
20181
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20161
20182
|
key: index,
|
|
20162
20183
|
style: [styles.slideContainer, {
|
|
20163
20184
|
width: containerWidth
|
|
20164
20185
|
}]
|
|
20165
|
-
}, /*#__PURE__*/
|
|
20186
|
+
}, /*#__PURE__*/React.createElement(BannerTile$1, {
|
|
20166
20187
|
tile: tile
|
|
20167
20188
|
}));
|
|
20168
|
-
})), showNextButton && /*#__PURE__*/
|
|
20189
|
+
})), showNextButton && /*#__PURE__*/React.createElement(Pressable$1, {
|
|
20169
20190
|
style: [styles.navButton, styles.navButtonRight, {
|
|
20170
20191
|
backgroundColor: theme.background
|
|
20171
20192
|
}],
|
|
20172
20193
|
onPress: handleNext,
|
|
20173
20194
|
accessibilityLabel: "Next slide",
|
|
20174
20195
|
role: "button"
|
|
20175
|
-
}, /*#__PURE__*/
|
|
20196
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20176
20197
|
name: "ArrowRight",
|
|
20177
20198
|
size: 20,
|
|
20178
20199
|
color: theme.primary
|
|
20179
|
-
}))), displayControls && /*#__PURE__*/
|
|
20200
|
+
}))), displayControls && /*#__PURE__*/React.createElement(View$2, {
|
|
20180
20201
|
style: dynamicStyles.indicators
|
|
20181
20202
|
}, sortedTiles.map(function (_, index) {
|
|
20182
20203
|
var width = animatedIndex.interpolate({
|
|
@@ -20184,7 +20205,7 @@ var Carousel = function (_a) {
|
|
|
20184
20205
|
outputRange: [8, 30, 8],
|
|
20185
20206
|
extrapolate: 'clamp'
|
|
20186
20207
|
});
|
|
20187
|
-
return /*#__PURE__*/
|
|
20208
|
+
return /*#__PURE__*/React.createElement(Animated$1.View, {
|
|
20188
20209
|
key: index,
|
|
20189
20210
|
style: [styles.indicator, {
|
|
20190
20211
|
backgroundColor: theme.derivedBackground,
|
|
@@ -20198,17 +20219,17 @@ var Carousel = function (_a) {
|
|
|
20198
20219
|
|
|
20199
20220
|
var Grid = function (_a) {
|
|
20200
20221
|
var section = _a.section;
|
|
20201
|
-
if (section.type !== SectionType.Grid) {
|
|
20222
|
+
if (section.type !== exports.SectionType.Grid) {
|
|
20202
20223
|
return null;
|
|
20203
20224
|
}
|
|
20204
20225
|
var isDesktop = useResponsive().isDesktop;
|
|
20205
20226
|
var columnsPerRow = isDesktop ? 4 : 2;
|
|
20206
|
-
var gridTiles = useMemo(function () {
|
|
20227
|
+
var gridTiles = React.useMemo(function () {
|
|
20207
20228
|
return sortByPriority(section.tiles.filter(function (tile) {
|
|
20208
|
-
return tile.type !== TileType.Banner;
|
|
20229
|
+
return tile.type !== exports.TileType.Banner;
|
|
20209
20230
|
}));
|
|
20210
20231
|
}, [section.tiles]);
|
|
20211
|
-
var getTileWidth = useCallback(function (columns) {
|
|
20232
|
+
var getTileWidth = React.useCallback(function (columns) {
|
|
20212
20233
|
if (IS_WEB) {
|
|
20213
20234
|
return {
|
|
20214
20235
|
width: "calc(".concat(100 / columns, "% - ").concat((columns - 1) * GRID_GAP / columns, "px)"),
|
|
@@ -20224,7 +20245,7 @@ var Grid = function (_a) {
|
|
|
20224
20245
|
};
|
|
20225
20246
|
}
|
|
20226
20247
|
}, []);
|
|
20227
|
-
var renderTileContainers = useCallback(function () {
|
|
20248
|
+
var renderTileContainers = React.useCallback(function () {
|
|
20228
20249
|
var tileContainers = [];
|
|
20229
20250
|
var currentTiles = [];
|
|
20230
20251
|
var sortedTiles = sortByPriority(gridTiles);
|
|
@@ -20233,12 +20254,12 @@ var Grid = function (_a) {
|
|
|
20233
20254
|
var nextTile = sortedTiles[index + 1];
|
|
20234
20255
|
var shouldStartNewContainer = function (currentTiles, currentTile, nextTile) {
|
|
20235
20256
|
if (currentTiles.length === 2) return true;
|
|
20236
|
-
if (currentTile.tileHeight === TileHeight.Full) return true;
|
|
20237
|
-
if (currentTile.tileHeight === TileHeight.Half) {
|
|
20257
|
+
if (currentTile.tileHeight === exports.TileHeight.Full) return true;
|
|
20258
|
+
if (currentTile.tileHeight === exports.TileHeight.Half) {
|
|
20238
20259
|
if (!nextTile) return true;
|
|
20239
|
-
if (nextTile.tileHeight === TileHeight.Full) return true;
|
|
20260
|
+
if (nextTile.tileHeight === exports.TileHeight.Full) return true;
|
|
20240
20261
|
if (currentTiles.length === 0) return false;
|
|
20241
|
-
if (currentTiles.length === 1 && currentTiles[0].tileHeight === TileHeight.Half && nextTile.tileHeight === TileHeight.Half) {
|
|
20262
|
+
if (currentTiles.length === 1 && currentTiles[0].tileHeight === exports.TileHeight.Half && nextTile.tileHeight === exports.TileHeight.Half) {
|
|
20242
20263
|
return false;
|
|
20243
20264
|
}
|
|
20244
20265
|
}
|
|
@@ -20246,14 +20267,14 @@ var Grid = function (_a) {
|
|
|
20246
20267
|
};
|
|
20247
20268
|
if (shouldStartNewContainer(currentTiles, tile, nextTile)) {
|
|
20248
20269
|
var isLastInRow = (tileContainers.length + 1) % columnsPerRow === 0;
|
|
20249
|
-
tileContainers.push(/*#__PURE__*/
|
|
20270
|
+
tileContainers.push(/*#__PURE__*/React.createElement(View$2, {
|
|
20250
20271
|
key: "container-".concat(index),
|
|
20251
20272
|
style: [
|
|
20252
20273
|
// @ts-ignore Web uses CSS calc strings for responsive layouts, while ViewStyle expects numbers
|
|
20253
20274
|
getTileWidth(columnsPerRow), !isLastInRow && {
|
|
20254
20275
|
marginRight: GRID_GAP
|
|
20255
20276
|
}]
|
|
20256
|
-
}, /*#__PURE__*/
|
|
20277
|
+
}, /*#__PURE__*/React.createElement(TileContainer, {
|
|
20257
20278
|
tiles: currentTiles
|
|
20258
20279
|
})));
|
|
20259
20280
|
currentTiles = [];
|
|
@@ -20261,10 +20282,10 @@ var Grid = function (_a) {
|
|
|
20261
20282
|
});
|
|
20262
20283
|
return tileContainers;
|
|
20263
20284
|
}, [gridTiles, columnsPerRow, getTileWidth]);
|
|
20264
|
-
return /*#__PURE__*/
|
|
20285
|
+
return /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(SectionHeader, {
|
|
20265
20286
|
title: section.title,
|
|
20266
20287
|
description: section.description
|
|
20267
|
-
}), /*#__PURE__*/
|
|
20288
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20268
20289
|
style: styles$2.grid
|
|
20269
20290
|
}, renderTileContainers()));
|
|
20270
20291
|
};
|
|
@@ -20295,21 +20316,21 @@ var ProgressIndicator = function (_a) {
|
|
|
20295
20316
|
} else if (percentage < 50) {
|
|
20296
20317
|
progressVariant = 'accent';
|
|
20297
20318
|
}
|
|
20298
|
-
return /*#__PURE__*/
|
|
20319
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
20299
20320
|
style: styles$1.container
|
|
20300
|
-
}, /*#__PURE__*/
|
|
20321
|
+
}, /*#__PURE__*/React__namespace.createElement(ProgressBar, {
|
|
20301
20322
|
percentage: percentage,
|
|
20302
20323
|
variant: progressVariant,
|
|
20303
20324
|
height: height
|
|
20304
|
-
}), /*#__PURE__*/
|
|
20325
|
+
}), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
20305
20326
|
style: [styles$1.circleContainer]
|
|
20306
|
-
}, /*#__PURE__*/
|
|
20327
|
+
}, /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
20307
20328
|
style: [styles$1.circle, {
|
|
20308
20329
|
borderColor: theme.derivedSurface[20],
|
|
20309
20330
|
backgroundColor: isComplete ? theme.primary : theme.surface,
|
|
20310
20331
|
borderWidth: isComplete ? 0 : 4
|
|
20311
20332
|
}]
|
|
20312
|
-
}, isComplete && /*#__PURE__*/
|
|
20333
|
+
}, isComplete && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
20313
20334
|
name: "Check",
|
|
20314
20335
|
size: 12,
|
|
20315
20336
|
color: theme.primaryText
|
|
@@ -20354,22 +20375,22 @@ var useSectionStyles = function () {
|
|
|
20354
20375
|
/**
|
|
20355
20376
|
* SectionContext provides the current section data to child components.
|
|
20356
20377
|
*/
|
|
20357
|
-
var SectionContext = /*#__PURE__*/createContext(undefined);
|
|
20378
|
+
var SectionContext = /*#__PURE__*/React.createContext(undefined);
|
|
20358
20379
|
/**
|
|
20359
20380
|
* Custom hook to fetch section data.
|
|
20360
20381
|
*/
|
|
20361
20382
|
var useSectionData = function (section, sectionId) {
|
|
20362
20383
|
var getSectionByID = useWllSdk().getSectionByID;
|
|
20363
|
-
var _a = useState(section || null),
|
|
20384
|
+
var _a = React.useState(section || null),
|
|
20364
20385
|
sectionData = _a[0],
|
|
20365
20386
|
setSectionData = _a[1];
|
|
20366
|
-
var _b = useState(false),
|
|
20387
|
+
var _b = React.useState(false),
|
|
20367
20388
|
isLoading = _b[0],
|
|
20368
20389
|
setIsLoading = _b[1];
|
|
20369
|
-
var _c = useState(null),
|
|
20390
|
+
var _c = React.useState(null),
|
|
20370
20391
|
error = _c[0],
|
|
20371
20392
|
setError = _c[1];
|
|
20372
|
-
useEffect(function () {
|
|
20393
|
+
React.useEffect(function () {
|
|
20373
20394
|
if (section) {
|
|
20374
20395
|
setSectionData(section);
|
|
20375
20396
|
} else if (sectionId) {
|
|
@@ -20419,11 +20440,11 @@ var useSectionData = function (section, sectionId) {
|
|
|
20419
20440
|
*/
|
|
20420
20441
|
var EmptyState = function (_a) {
|
|
20421
20442
|
var message = _a.message;
|
|
20422
|
-
return /*#__PURE__*/
|
|
20443
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20423
20444
|
style: commonStyles.emptyContainer,
|
|
20424
20445
|
accessible: true,
|
|
20425
20446
|
accessibilityLabel: "Empty state: ".concat(message)
|
|
20426
|
-
}, /*#__PURE__*/
|
|
20447
|
+
}, /*#__PURE__*/React.createElement(Text$3, {
|
|
20427
20448
|
accessibilityElementsHidden: true,
|
|
20428
20449
|
importantForAccessibility: "no-hide-descendants"
|
|
20429
20450
|
}, message));
|
|
@@ -20445,13 +20466,13 @@ var Section = function (_a) {
|
|
|
20445
20466
|
}
|
|
20446
20467
|
var renderSectionContent = function () {
|
|
20447
20468
|
if (isLoading) {
|
|
20448
|
-
return /*#__PURE__*/
|
|
20469
|
+
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
20449
20470
|
"aria-label": "Loading section content",
|
|
20450
20471
|
numberOfSquares: 4
|
|
20451
20472
|
});
|
|
20452
20473
|
}
|
|
20453
20474
|
if (error || !sectionData) {
|
|
20454
|
-
return /*#__PURE__*/
|
|
20475
|
+
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
20455
20476
|
message: error || 'No section data available.'
|
|
20456
20477
|
});
|
|
20457
20478
|
}
|
|
@@ -20463,26 +20484,26 @@ var Section = function (_a) {
|
|
|
20463
20484
|
tiles: activeTiles
|
|
20464
20485
|
});
|
|
20465
20486
|
switch (sectionData.type) {
|
|
20466
|
-
case SectionType.Banner:
|
|
20467
|
-
return /*#__PURE__*/
|
|
20487
|
+
case exports.SectionType.Banner:
|
|
20488
|
+
return /*#__PURE__*/React.createElement(Carousel, {
|
|
20468
20489
|
section: sectionWithActiveTiles
|
|
20469
20490
|
});
|
|
20470
|
-
case SectionType.Grid:
|
|
20471
|
-
return /*#__PURE__*/
|
|
20491
|
+
case exports.SectionType.Grid:
|
|
20492
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
20472
20493
|
section: sectionWithActiveTiles
|
|
20473
20494
|
});
|
|
20474
20495
|
default:
|
|
20475
20496
|
console.warn("Unknown section type: ".concat(sectionData.type));
|
|
20476
|
-
return /*#__PURE__*/
|
|
20497
|
+
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
20477
20498
|
message: "Unknown section type."
|
|
20478
20499
|
});
|
|
20479
20500
|
}
|
|
20480
20501
|
};
|
|
20481
|
-
return sectionData ? /*#__PURE__*/
|
|
20502
|
+
return sectionData ? /*#__PURE__*/React.createElement(SectionContext.Provider, {
|
|
20482
20503
|
value: {
|
|
20483
20504
|
sectionData: sectionData
|
|
20484
20505
|
}
|
|
20485
|
-
}, /*#__PURE__*/
|
|
20506
|
+
}, /*#__PURE__*/React.createElement(View$2, {
|
|
20486
20507
|
style: styles.section,
|
|
20487
20508
|
accessible: true,
|
|
20488
20509
|
role: "region",
|
|
@@ -20491,9 +20512,9 @@ var Section = function (_a) {
|
|
|
20491
20512
|
}, renderSectionContent())) : null;
|
|
20492
20513
|
};
|
|
20493
20514
|
|
|
20494
|
-
var GroupContext = /*#__PURE__*/createContext(undefined);
|
|
20515
|
+
var GroupContext = /*#__PURE__*/React.createContext(undefined);
|
|
20495
20516
|
var useGroupContext = function () {
|
|
20496
|
-
var context = useContext(GroupContext);
|
|
20517
|
+
var context = React.useContext(GroupContext);
|
|
20497
20518
|
if (!context) {
|
|
20498
20519
|
throw new Error('useGroupContext must be used within a GroupProvider');
|
|
20499
20520
|
}
|
|
@@ -20502,16 +20523,16 @@ var useGroupContext = function () {
|
|
|
20502
20523
|
// Custom Hook for Group Data
|
|
20503
20524
|
var useGroupData = function (id) {
|
|
20504
20525
|
var getGroupByID = useWllSdk().getGroupByID;
|
|
20505
|
-
var _a = useState(null),
|
|
20526
|
+
var _a = React.useState(null),
|
|
20506
20527
|
groupData = _a[0],
|
|
20507
20528
|
setGroupData = _a[1];
|
|
20508
|
-
var _b = useState(null),
|
|
20529
|
+
var _b = React.useState(null),
|
|
20509
20530
|
error = _b[0],
|
|
20510
20531
|
setError = _b[1];
|
|
20511
|
-
var _c = useState(true),
|
|
20532
|
+
var _c = React.useState(true),
|
|
20512
20533
|
isLoading = _c[0],
|
|
20513
20534
|
setIsLoading = _c[1];
|
|
20514
|
-
var fetchGroup = useCallback(function () {
|
|
20535
|
+
var fetchGroup = React.useCallback(function () {
|
|
20515
20536
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20516
20537
|
var response;
|
|
20517
20538
|
return __generator(this, function (_a) {
|
|
@@ -20544,7 +20565,7 @@ var useGroupData = function (id) {
|
|
|
20544
20565
|
});
|
|
20545
20566
|
});
|
|
20546
20567
|
}, [id, getGroupByID]);
|
|
20547
|
-
useEffect(function () {
|
|
20568
|
+
React.useEffect(function () {
|
|
20548
20569
|
fetchGroup();
|
|
20549
20570
|
}, [fetchGroup]);
|
|
20550
20571
|
return {
|
|
@@ -20571,27 +20592,27 @@ var Group = function (_a) {
|
|
|
20571
20592
|
isLoading = _b.isLoading,
|
|
20572
20593
|
error = _b.error;
|
|
20573
20594
|
if (isLoading) {
|
|
20574
|
-
return /*#__PURE__*/
|
|
20595
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20575
20596
|
style: commonStyles.emptyContainer
|
|
20576
|
-
}, /*#__PURE__*/
|
|
20597
|
+
}, /*#__PURE__*/React.createElement(Skeleton, null));
|
|
20577
20598
|
}
|
|
20578
20599
|
if (error || !groupData) {
|
|
20579
|
-
return /*#__PURE__*/
|
|
20600
|
+
return /*#__PURE__*/React.createElement(GroupEmptyState, {
|
|
20580
20601
|
message: error || 'No group data available'
|
|
20581
20602
|
});
|
|
20582
20603
|
}
|
|
20583
|
-
return /*#__PURE__*/
|
|
20604
|
+
return /*#__PURE__*/React.createElement(GroupContext.Provider, {
|
|
20584
20605
|
value: {
|
|
20585
20606
|
groupData: groupData
|
|
20586
20607
|
}
|
|
20587
|
-
}, /*#__PURE__*/
|
|
20608
|
+
}, /*#__PURE__*/React.createElement(View$2, {
|
|
20588
20609
|
"data-testid": "group-container"
|
|
20589
|
-
}, /*#__PURE__*/
|
|
20610
|
+
}, /*#__PURE__*/React.createElement(GroupSections, null)));
|
|
20590
20611
|
};
|
|
20591
20612
|
var GroupSections = function () {
|
|
20592
20613
|
var groupData = useGroupContext().groupData;
|
|
20593
20614
|
if (!groupData.sections || groupData.sections.length === 0) {
|
|
20594
|
-
return /*#__PURE__*/
|
|
20615
|
+
return /*#__PURE__*/React.createElement(GroupEmptyState, {
|
|
20595
20616
|
message: "This group doesn't have any sections"
|
|
20596
20617
|
});
|
|
20597
20618
|
}
|
|
@@ -20600,8 +20621,8 @@ var GroupSections = function () {
|
|
|
20600
20621
|
return section.active;
|
|
20601
20622
|
});
|
|
20602
20623
|
var sortedSections = sortByPriority(activeSections);
|
|
20603
|
-
return /*#__PURE__*/
|
|
20604
|
-
return /*#__PURE__*/
|
|
20624
|
+
return /*#__PURE__*/React.createElement(View$2, null, sortedSections.map(function (section) {
|
|
20625
|
+
return /*#__PURE__*/React.createElement(Section, {
|
|
20605
20626
|
key: section.id,
|
|
20606
20627
|
section: section
|
|
20607
20628
|
});
|
|
@@ -20609,9 +20630,9 @@ var GroupSections = function () {
|
|
|
20609
20630
|
};
|
|
20610
20631
|
var GroupEmptyState = function (_a) {
|
|
20611
20632
|
var message = _a.message;
|
|
20612
|
-
return /*#__PURE__*/
|
|
20633
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20613
20634
|
style: commonStyles.emptyContainer
|
|
20614
|
-
}, /*#__PURE__*/
|
|
20635
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20615
20636
|
variant: "body"
|
|
20616
20637
|
}, message));
|
|
20617
20638
|
};
|
|
@@ -20711,7 +20732,7 @@ var Column = function (_a) {
|
|
|
20711
20732
|
flex: flex
|
|
20712
20733
|
})
|
|
20713
20734
|
});
|
|
20714
|
-
return /*#__PURE__*/
|
|
20735
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends({
|
|
20715
20736
|
style: [styles.container, style]
|
|
20716
20737
|
}, rest), children);
|
|
20717
20738
|
};
|
|
@@ -20726,7 +20747,7 @@ var FullFlex = function (_a) {
|
|
|
20726
20747
|
var children = _a.children,
|
|
20727
20748
|
style = _a.style,
|
|
20728
20749
|
rest = __rest(_a, ["children", "style"]);
|
|
20729
|
-
return /*#__PURE__*/
|
|
20750
|
+
return /*#__PURE__*/React.createElement(View$2, _extends({
|
|
20730
20751
|
style: [{
|
|
20731
20752
|
flex: 1
|
|
20732
20753
|
}, style]
|
|
@@ -20767,7 +20788,7 @@ var Layout = function (_a) {
|
|
|
20767
20788
|
flexDirection: direction
|
|
20768
20789
|
}
|
|
20769
20790
|
});
|
|
20770
|
-
return /*#__PURE__*/
|
|
20791
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends({
|
|
20771
20792
|
style: [dynamicStyles.container, style]
|
|
20772
20793
|
}, rest), children);
|
|
20773
20794
|
};
|
|
@@ -20801,7 +20822,7 @@ var Row = function (_a) {
|
|
|
20801
20822
|
flex: flex
|
|
20802
20823
|
})
|
|
20803
20824
|
});
|
|
20804
|
-
return /*#__PURE__*/
|
|
20825
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends({
|
|
20805
20826
|
style: [styles.container, style]
|
|
20806
20827
|
}, rest), children);
|
|
20807
20828
|
};
|
|
@@ -20815,7 +20836,7 @@ var Row = function (_a) {
|
|
|
20815
20836
|
var Spacer = function (_a) {
|
|
20816
20837
|
var style = _a.style,
|
|
20817
20838
|
rest = __rest(_a, ["style"]);
|
|
20818
|
-
return /*#__PURE__*/
|
|
20839
|
+
return /*#__PURE__*/React.createElement(View$2, _extends({
|
|
20819
20840
|
style: [{
|
|
20820
20841
|
flex: 1
|
|
20821
20842
|
}, style]
|
|
@@ -20879,20 +20900,20 @@ var PointsTileFormattedPoints = function () {
|
|
|
20879
20900
|
if (points === undefined || points === 0) return null;
|
|
20880
20901
|
var calculatedPoints = applyMultiplier(points, pointsMultiplier);
|
|
20881
20902
|
var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix);
|
|
20882
|
-
return /*#__PURE__*/
|
|
20903
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20883
20904
|
testID: "points-tile-points",
|
|
20884
20905
|
accessible: true,
|
|
20885
20906
|
accessibilityLabel: "Points value: ".concat(fullPointsText)
|
|
20886
|
-
}, /*#__PURE__*/
|
|
20907
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
20887
20908
|
align: "center",
|
|
20888
20909
|
justify: "start"
|
|
20889
|
-
}, pointsPrefix ? /*#__PURE__*/
|
|
20910
|
+
}, pointsPrefix ? /*#__PURE__*/React.createElement(Text, {
|
|
20890
20911
|
variant: "caption",
|
|
20891
20912
|
testID: "points-tile-prefix"
|
|
20892
|
-
}, pointsPrefix) : null, /*#__PURE__*/
|
|
20913
|
+
}, pointsPrefix) : null, /*#__PURE__*/React.createElement(Text, {
|
|
20893
20914
|
variant: "caption",
|
|
20894
20915
|
testID: "points-tile-value"
|
|
20895
|
-
}, calculatedPoints), pointsSuffix ? /*#__PURE__*/
|
|
20916
|
+
}, calculatedPoints), pointsSuffix ? /*#__PURE__*/React.createElement(Text, {
|
|
20896
20917
|
variant: "caption",
|
|
20897
20918
|
style: styles.suffix,
|
|
20898
20919
|
testID: "points-tile-suffix"
|
|
@@ -20907,13 +20928,13 @@ var PointsTileMedia = function (_a) {
|
|
|
20907
20928
|
title = _b.title;
|
|
20908
20929
|
var styles = usePointsTileStyles(isFullSize);
|
|
20909
20930
|
if (!artworkUrl) return null;
|
|
20910
|
-
return /*#__PURE__*/
|
|
20931
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20911
20932
|
testID: "points-tile-media",
|
|
20912
20933
|
accessible: true,
|
|
20913
20934
|
role: "img",
|
|
20914
20935
|
accessibilityLabel: "Points tile image for ".concat(title),
|
|
20915
20936
|
style: styles.imageContainer
|
|
20916
|
-
}, /*#__PURE__*/
|
|
20937
|
+
}, /*#__PURE__*/React.createElement(Image$2, {
|
|
20917
20938
|
source: {
|
|
20918
20939
|
uri: artworkUrl
|
|
20919
20940
|
},
|
|
@@ -20928,12 +20949,12 @@ var PointsTileTitle = function () {
|
|
|
20928
20949
|
var configuration = useTileContext().configuration;
|
|
20929
20950
|
var title = configuration.title;
|
|
20930
20951
|
if (!title) return null;
|
|
20931
|
-
return /*#__PURE__*/
|
|
20952
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20932
20953
|
testID: "points-tile-title",
|
|
20933
20954
|
accessible: true,
|
|
20934
20955
|
accessibilityLabel: title,
|
|
20935
20956
|
role: "banner"
|
|
20936
|
-
}, /*#__PURE__*/
|
|
20957
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20937
20958
|
variant: "eyebrow",
|
|
20938
20959
|
accessibilityElementsHidden: true,
|
|
20939
20960
|
importantForAccessibility: "no-hide-descendants"
|
|
@@ -20950,17 +20971,17 @@ var PointsTileRoot = function (_a) {
|
|
|
20950
20971
|
if (!tile || !tile.active) return null;
|
|
20951
20972
|
var isFullSize = useTileSize(tile).isFullSize;
|
|
20952
20973
|
var styles = usePointsTileStyles(isFullSize);
|
|
20953
|
-
return /*#__PURE__*/
|
|
20974
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
20954
20975
|
tile: tile
|
|
20955
|
-
}, isFullSize && /*#__PURE__*/
|
|
20976
|
+
}, isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
20956
20977
|
isFullSize: true
|
|
20957
|
-
}), /*#__PURE__*/
|
|
20978
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20958
20979
|
style: styles.container
|
|
20959
|
-
}, !isFullSize && /*#__PURE__*/
|
|
20980
|
+
}, !isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
20960
20981
|
isFullSize: false
|
|
20961
|
-
}), /*#__PURE__*/
|
|
20982
|
+
}), /*#__PURE__*/React.createElement(Column, {
|
|
20962
20983
|
style: styles.contentContainer
|
|
20963
|
-
}, /*#__PURE__*/
|
|
20984
|
+
}, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null))));
|
|
20964
20985
|
};
|
|
20965
20986
|
/**
|
|
20966
20987
|
* The PointsTile component with subcomponents attached.
|
|
@@ -21011,14 +21032,14 @@ var RewardCategoryHeader = function () {
|
|
|
21011
21032
|
showName = _a.showName,
|
|
21012
21033
|
name = _a.name;
|
|
21013
21034
|
if (!showName || !name) return null;
|
|
21014
|
-
return /*#__PURE__*/
|
|
21035
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21015
21036
|
style: [styles.header, {
|
|
21016
21037
|
backgroundColor: theme.primary
|
|
21017
21038
|
}],
|
|
21018
21039
|
accessible: true,
|
|
21019
21040
|
accessibilityLabel: "Reward category: ".concat(name),
|
|
21020
21041
|
testID: "reward-category-header"
|
|
21021
|
-
}, /*#__PURE__*/
|
|
21042
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
21022
21043
|
style: [styles.headerText, {
|
|
21023
21044
|
color: theme.primaryText
|
|
21024
21045
|
}],
|
|
@@ -21034,7 +21055,7 @@ var RewardCategoryMedia = function () {
|
|
|
21034
21055
|
artworkUrl = _a.artworkUrl,
|
|
21035
21056
|
name = _a.name;
|
|
21036
21057
|
if (!artworkUrl) return null;
|
|
21037
|
-
return /*#__PURE__*/
|
|
21058
|
+
return /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
21038
21059
|
testID: "reward-category-media",
|
|
21039
21060
|
source: {
|
|
21040
21061
|
uri: artworkUrl
|
|
@@ -21052,9 +21073,9 @@ var RewardCategoryMedia = function () {
|
|
|
21052
21073
|
var RewardCategoryTileRoot = function (_a) {
|
|
21053
21074
|
var tile = _a.tile;
|
|
21054
21075
|
if (!tile || !tile.active) return null;
|
|
21055
|
-
return /*#__PURE__*/
|
|
21076
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
21056
21077
|
tile: tile
|
|
21057
|
-
}, /*#__PURE__*/
|
|
21078
|
+
}, /*#__PURE__*/React.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React.createElement(RewardCategoryTile.Media, null));
|
|
21058
21079
|
};
|
|
21059
21080
|
/**
|
|
21060
21081
|
* The RewardCategoryTile component with subcomponents attached.
|
|
@@ -21067,7 +21088,7 @@ var RewardCategoryTile$1 = withTileFetching(RewardCategoryTile);
|
|
|
21067
21088
|
|
|
21068
21089
|
var RewardTileChevron = function () {
|
|
21069
21090
|
var theme = useWllSdk().theme;
|
|
21070
|
-
return /*#__PURE__*/
|
|
21091
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
21071
21092
|
name: "ChevronRight",
|
|
21072
21093
|
color: theme.derivedSurfaceText[20]
|
|
21073
21094
|
});
|
|
@@ -21128,12 +21149,12 @@ var RewardTileMedia = function (_a) {
|
|
|
21128
21149
|
var containerStyle = {
|
|
21129
21150
|
flexBasis: isArtworkOnly ? '100%' : '50%'
|
|
21130
21151
|
};
|
|
21131
|
-
return /*#__PURE__*/
|
|
21152
|
+
return /*#__PURE__*/React.createElement(View$2
|
|
21132
21153
|
// @ts-ignore: We are using percentage values for flexBasis, which is valid in React Native but TypeScript expects a number.
|
|
21133
21154
|
, {
|
|
21134
21155
|
style: [styles.imageContainer, containerStyle],
|
|
21135
21156
|
testID: "reward-tile-media"
|
|
21136
|
-
}, /*#__PURE__*/
|
|
21157
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
21137
21158
|
source: {
|
|
21138
21159
|
uri: artworkUrl
|
|
21139
21160
|
},
|
|
@@ -21158,22 +21179,22 @@ var RewardTilePoints = function () {
|
|
|
21158
21179
|
// Calculate points
|
|
21159
21180
|
var calculatedPoints = applyMultiplier(price, pointsMultiplier);
|
|
21160
21181
|
var accessibilityLabel = getPointsLabel('Reward points:', calculatedPoints, pointsPrefix, pointsSuffix);
|
|
21161
|
-
return /*#__PURE__*/
|
|
21182
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21162
21183
|
testID: "reward-tile-points",
|
|
21163
21184
|
accessible: true,
|
|
21164
21185
|
accessibilityLabel: accessibilityLabel
|
|
21165
|
-
}, /*#__PURE__*/
|
|
21186
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
21166
21187
|
align: "center",
|
|
21167
21188
|
justify: "start",
|
|
21168
21189
|
style: {
|
|
21169
21190
|
marginTop: 8
|
|
21170
21191
|
}
|
|
21171
|
-
}, pointsPrefix ? /*#__PURE__*/
|
|
21192
|
+
}, pointsPrefix ? /*#__PURE__*/React.createElement(Text, {
|
|
21172
21193
|
variant: "caption"
|
|
21173
|
-
}, pointsPrefix) : null, /*#__PURE__*/
|
|
21194
|
+
}, pointsPrefix) : null, /*#__PURE__*/React.createElement(Text, {
|
|
21174
21195
|
variant: "caption",
|
|
21175
21196
|
testID: "reward-tile-points-value"
|
|
21176
|
-
}, calculatedPoints), pointsSuffix ? /*#__PURE__*/
|
|
21197
|
+
}, calculatedPoints), pointsSuffix ? /*#__PURE__*/React.createElement(Text, {
|
|
21177
21198
|
variant: "caption",
|
|
21178
21199
|
style: styles.suffix
|
|
21179
21200
|
}, pointsSuffix) : null));
|
|
@@ -21183,10 +21204,10 @@ var RewardTileSummary = function () {
|
|
|
21183
21204
|
var configuration = useTileContext().configuration;
|
|
21184
21205
|
var summary = configuration.summary;
|
|
21185
21206
|
if (!summary) return null;
|
|
21186
|
-
return /*#__PURE__*/
|
|
21207
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21187
21208
|
accessible: true,
|
|
21188
21209
|
accessibilityLabel: summary
|
|
21189
|
-
}, /*#__PURE__*/
|
|
21210
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
21190
21211
|
variant: "body",
|
|
21191
21212
|
accessibilityElementsHidden: true,
|
|
21192
21213
|
importantForAccessibility: "no-hide-descendants",
|
|
@@ -21198,7 +21219,7 @@ var RewardTileTitle = function () {
|
|
|
21198
21219
|
var configuration = useTileContext().configuration;
|
|
21199
21220
|
var name = configuration.name;
|
|
21200
21221
|
if (!name) return null;
|
|
21201
|
-
return /*#__PURE__*/
|
|
21222
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
21202
21223
|
variant: "title",
|
|
21203
21224
|
ellipsizeMode: "tail",
|
|
21204
21225
|
numberOfLines: 1,
|
|
@@ -21224,17 +21245,17 @@ var isArtworkOnly = function (configuration) {
|
|
|
21224
21245
|
var RewardTileRoot = function (_a) {
|
|
21225
21246
|
var tile = _a.tile;
|
|
21226
21247
|
var styles = useRewardTileStyles();
|
|
21227
|
-
if (!tile || tile.tileHeight !== TileHeight.Full || !tile.active) return null;
|
|
21248
|
+
if (!tile || tile.tileHeight !== exports.TileHeight.Full || !tile.active) return null;
|
|
21228
21249
|
var configuration = tile.configuration;
|
|
21229
|
-
return /*#__PURE__*/
|
|
21250
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
21230
21251
|
tile: tile
|
|
21231
|
-
}, /*#__PURE__*/
|
|
21252
|
+
}, /*#__PURE__*/React.createElement(RewardTile.Media, {
|
|
21232
21253
|
isArtworkOnly: isArtworkOnly(configuration)
|
|
21233
|
-
}), /*#__PURE__*/
|
|
21254
|
+
}), /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Row, {
|
|
21234
21255
|
justify: "between",
|
|
21235
21256
|
align: "center",
|
|
21236
21257
|
style: styles.header
|
|
21237
|
-
}, /*#__PURE__*/
|
|
21258
|
+
}, /*#__PURE__*/React.createElement(RewardTile.Title, null), /*#__PURE__*/React.createElement(RewardTile.Chevron, null)), /*#__PURE__*/React.createElement(RewardTile.Summary, null), /*#__PURE__*/React.createElement(RewardTile.Points, null)));
|
|
21238
21259
|
};
|
|
21239
21260
|
/**
|
|
21240
21261
|
* The RewardTile component with subcomponents attached.
|
|
@@ -21298,13 +21319,13 @@ var TierTileInner = function (_a) {
|
|
|
21298
21319
|
var tier = configuration.tier;
|
|
21299
21320
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
21300
21321
|
if (!tier || Array.isArray(tier)) {
|
|
21301
|
-
return /*#__PURE__*/
|
|
21322
|
+
return /*#__PURE__*/React__namespace.createElement(TierTile.Empty, {
|
|
21302
21323
|
tile: tile
|
|
21303
21324
|
});
|
|
21304
21325
|
}
|
|
21305
|
-
return isHalfSize ? /*#__PURE__*/
|
|
21326
|
+
return isHalfSize ? /*#__PURE__*/React__namespace.createElement(TierTile.Half, {
|
|
21306
21327
|
tile: tile
|
|
21307
|
-
}) : /*#__PURE__*/
|
|
21328
|
+
}) : /*#__PURE__*/React__namespace.createElement(TierTile.Full, {
|
|
21308
21329
|
tile: tile
|
|
21309
21330
|
});
|
|
21310
21331
|
};
|
|
@@ -21318,26 +21339,26 @@ var TierTileFull = function (_a) {
|
|
|
21318
21339
|
artworkUrl = _b.artworkUrl,
|
|
21319
21340
|
name = _b.name,
|
|
21320
21341
|
description = _b.description;
|
|
21321
|
-
return /*#__PURE__*/
|
|
21342
|
+
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
21322
21343
|
tile: tile
|
|
21323
|
-
}, artworkUrl && /*#__PURE__*/
|
|
21344
|
+
}, artworkUrl && /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21324
21345
|
style: styles.header
|
|
21325
|
-
}, /*#__PURE__*/
|
|
21346
|
+
}, /*#__PURE__*/React__namespace.createElement(ProgressiveImage, {
|
|
21326
21347
|
source: {
|
|
21327
21348
|
uri: artworkUrl
|
|
21328
21349
|
},
|
|
21329
21350
|
style: styles.image,
|
|
21330
21351
|
resizeMode: "center"
|
|
21331
|
-
})), /*#__PURE__*/
|
|
21352
|
+
})), /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
21332
21353
|
align: "stretch",
|
|
21333
21354
|
justify: artworkUrl ? 'start' : 'center'
|
|
21334
|
-
}, /*#__PURE__*/
|
|
21355
|
+
}, /*#__PURE__*/React__namespace.createElement(View$2, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21335
21356
|
variant: "eyebrow",
|
|
21336
21357
|
style: styles.title
|
|
21337
|
-
}, title), name && /*#__PURE__*/
|
|
21358
|
+
}, title), name && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21338
21359
|
variant: "title",
|
|
21339
21360
|
style: styles.title
|
|
21340
|
-
}, name), description && /*#__PURE__*/
|
|
21361
|
+
}, name), description && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21341
21362
|
variant: "body"
|
|
21342
21363
|
}, description))));
|
|
21343
21364
|
};
|
|
@@ -21351,30 +21372,30 @@ var TierTileHalf = function (_a) {
|
|
|
21351
21372
|
var _c = tier || {},
|
|
21352
21373
|
artworkUrl = _c.artworkUrl,
|
|
21353
21374
|
name = _c.name;
|
|
21354
|
-
return /*#__PURE__*/
|
|
21375
|
+
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
21355
21376
|
tile: tile
|
|
21356
|
-
}, /*#__PURE__*/
|
|
21377
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
21357
21378
|
align: "center",
|
|
21358
21379
|
justify: "between",
|
|
21359
21380
|
direction: "row",
|
|
21360
21381
|
style: {
|
|
21361
21382
|
paddingTop: 16
|
|
21362
21383
|
}
|
|
21363
|
-
}, /*#__PURE__*/
|
|
21384
|
+
}, /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21364
21385
|
style: {
|
|
21365
21386
|
flex: 1,
|
|
21366
21387
|
flexShrink: 1
|
|
21367
21388
|
}
|
|
21368
|
-
}, title && /*#__PURE__*/
|
|
21389
|
+
}, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21369
21390
|
variant: "eyebrow",
|
|
21370
21391
|
style: styles.title
|
|
21371
|
-
}, title), name && /*#__PURE__*/
|
|
21392
|
+
}, title), name && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21372
21393
|
variant: "title",
|
|
21373
21394
|
style: styles.name,
|
|
21374
21395
|
numberOfLines: 2
|
|
21375
|
-
}, name)), artworkUrl && /*#__PURE__*/
|
|
21396
|
+
}, name)), artworkUrl && /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21376
21397
|
style: styles.smallImageContainer
|
|
21377
|
-
}, /*#__PURE__*/
|
|
21398
|
+
}, /*#__PURE__*/React__namespace.createElement(Image$2, {
|
|
21378
21399
|
source: {
|
|
21379
21400
|
uri: artworkUrl
|
|
21380
21401
|
},
|
|
@@ -21392,23 +21413,23 @@ var TierTileEmpty = function (_a) {
|
|
|
21392
21413
|
emptyArtworkUrl = configuration.emptyArtworkUrl;
|
|
21393
21414
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
21394
21415
|
if (isHalfSize) {
|
|
21395
|
-
return /*#__PURE__*/
|
|
21416
|
+
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
21396
21417
|
tile: tile
|
|
21397
|
-
}, /*#__PURE__*/
|
|
21418
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
21398
21419
|
align: "center",
|
|
21399
21420
|
justify: "between",
|
|
21400
21421
|
direction: "row",
|
|
21401
21422
|
style: {
|
|
21402
21423
|
paddingTop: 16
|
|
21403
21424
|
}
|
|
21404
|
-
}, /*#__PURE__*/
|
|
21425
|
+
}, /*#__PURE__*/React__namespace.createElement(FullFlex, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21405
21426
|
variant: "title",
|
|
21406
21427
|
style: styles.title
|
|
21407
|
-
}, title), emptyDescription && /*#__PURE__*/
|
|
21428
|
+
}, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21408
21429
|
variant: "body"
|
|
21409
|
-
}, emptyDescription)), emptyArtworkUrl && /*#__PURE__*/
|
|
21430
|
+
}, emptyDescription)), emptyArtworkUrl && /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21410
21431
|
style: styles.smallImageContainer
|
|
21411
|
-
}, /*#__PURE__*/
|
|
21432
|
+
}, /*#__PURE__*/React__namespace.createElement(Image$2, {
|
|
21412
21433
|
source: {
|
|
21413
21434
|
uri: emptyArtworkUrl
|
|
21414
21435
|
},
|
|
@@ -21416,23 +21437,23 @@ var TierTileEmpty = function (_a) {
|
|
|
21416
21437
|
resizeMode: "contain"
|
|
21417
21438
|
}))));
|
|
21418
21439
|
}
|
|
21419
|
-
return /*#__PURE__*/
|
|
21440
|
+
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
21420
21441
|
tile: tile
|
|
21421
|
-
}, emptyArtworkUrl && /*#__PURE__*/
|
|
21442
|
+
}, emptyArtworkUrl && /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21422
21443
|
style: styles.header
|
|
21423
|
-
}, /*#__PURE__*/
|
|
21444
|
+
}, /*#__PURE__*/React__namespace.createElement(ProgressiveImage, {
|
|
21424
21445
|
source: {
|
|
21425
21446
|
uri: emptyArtworkUrl
|
|
21426
21447
|
},
|
|
21427
21448
|
style: styles.image,
|
|
21428
21449
|
resizeMode: "center"
|
|
21429
|
-
})), /*#__PURE__*/
|
|
21450
|
+
})), /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
21430
21451
|
align: "stretch",
|
|
21431
21452
|
justify: "center"
|
|
21432
|
-
}, /*#__PURE__*/
|
|
21453
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21433
21454
|
variant: "title",
|
|
21434
21455
|
style: styles.title
|
|
21435
|
-
}, title), emptyDescription && /*#__PURE__*/
|
|
21456
|
+
}, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21436
21457
|
variant: "body"
|
|
21437
21458
|
}, emptyDescription))));
|
|
21438
21459
|
};
|
|
@@ -21442,24 +21463,24 @@ TierTile.Half = TierTileHalf;
|
|
|
21442
21463
|
TierTile.Empty = TierTileEmpty;
|
|
21443
21464
|
|
|
21444
21465
|
var _a;
|
|
21445
|
-
var TILE_COMPONENTS = (_a = {}, _a[TileType.Content] = ContentTile$1, _a[TileType.Badge] = BadgeTile$1, _a[TileType.Tier] = TierTile, _a[TileType.Points] = PointsTile$1, _a[TileType.Reward] = RewardTile$1, _a[TileType.RewardCategory] = RewardCategoryTile$1, _a[TileType.Banner] = BannerTile$1, _a);
|
|
21466
|
+
var TILE_COMPONENTS = (_a = {}, _a[exports.TileType.Content] = ContentTile$1, _a[exports.TileType.Badge] = BadgeTile$1, _a[exports.TileType.Tier] = TierTile, _a[exports.TileType.Points] = PointsTile$1, _a[exports.TileType.Reward] = RewardTile$1, _a[exports.TileType.RewardCategory] = RewardCategoryTile$1, _a[exports.TileType.Banner] = BannerTile$1, _a);
|
|
21446
21467
|
/**
|
|
21447
21468
|
* TileContainer component to render a list of tiles with proper layout and spacing.
|
|
21448
21469
|
*/
|
|
21449
21470
|
var TileContainer = function (_a) {
|
|
21450
21471
|
var tiles = _a.tiles;
|
|
21451
|
-
return /*#__PURE__*/
|
|
21472
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21452
21473
|
style: styles.container,
|
|
21453
21474
|
testID: "tile-container"
|
|
21454
21475
|
}, tiles.map(function (tile, index) {
|
|
21455
21476
|
var TileComponent = TILE_COMPONENTS[tile.type];
|
|
21456
21477
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
21457
|
-
return /*#__PURE__*/
|
|
21478
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21458
21479
|
key: tile.id,
|
|
21459
21480
|
style: [styles.tileContainer, isHalfSize && styles.halfTileContainer, index > 0 && {
|
|
21460
21481
|
marginTop: GRID_GAP
|
|
21461
21482
|
}]
|
|
21462
|
-
}, TileComponent ? /*#__PURE__*/
|
|
21483
|
+
}, TileComponent ? /*#__PURE__*/React.createElement(TileComponent, {
|
|
21463
21484
|
tile: tile
|
|
21464
21485
|
}) : null);
|
|
21465
21486
|
}));
|
|
@@ -21485,5 +21506,45 @@ var Reward = /** @class */function () {
|
|
|
21485
21506
|
return Reward;
|
|
21486
21507
|
}();
|
|
21487
21508
|
|
|
21488
|
-
|
|
21509
|
+
exports.BadgeTile = BadgeTile$1;
|
|
21510
|
+
exports.BadgeTileConfig = BadgeTileConfig;
|
|
21511
|
+
exports.BannerTile = BannerTile$1;
|
|
21512
|
+
exports.BannerTileConfig = BannerTileConfig;
|
|
21513
|
+
exports.BaseBanner = BaseBanner;
|
|
21514
|
+
exports.BaseTile = BaseTile;
|
|
21515
|
+
exports.Button = Button;
|
|
21516
|
+
exports.Carousel = Carousel;
|
|
21517
|
+
exports.Column = Column;
|
|
21518
|
+
exports.ContentTile = ContentTile$1;
|
|
21519
|
+
exports.ContentTileConfig = ContentTileConfig;
|
|
21520
|
+
exports.FullFlex = FullFlex;
|
|
21521
|
+
exports.Grid = Grid;
|
|
21522
|
+
exports.Group = Group;
|
|
21523
|
+
exports.Icon = Icon;
|
|
21524
|
+
exports.Indicator = Indicator;
|
|
21525
|
+
exports.Layout = Layout;
|
|
21526
|
+
exports.LoadingIndicator = LoadingIndicator;
|
|
21527
|
+
exports.PointsTile = PointsTile$1;
|
|
21528
|
+
exports.PointsTileConfig = PointsTileConfig;
|
|
21529
|
+
exports.ProgressBar = ProgressBar;
|
|
21530
|
+
exports.ProgressIndicator = ProgressIndicator;
|
|
21531
|
+
exports.ProgressiveImage = ProgressiveImage;
|
|
21532
|
+
exports.Reward = Reward;
|
|
21533
|
+
exports.RewardCategoryTile = RewardCategoryTile$1;
|
|
21534
|
+
exports.RewardCategoryTileConfig = RewardCategoryTileConfig;
|
|
21535
|
+
exports.RewardTile = RewardTile$1;
|
|
21536
|
+
exports.RewardTileConfig = RewardTileConfig;
|
|
21537
|
+
exports.Row = Row;
|
|
21538
|
+
exports.Section = Section;
|
|
21539
|
+
exports.SectionHeader = SectionHeader;
|
|
21540
|
+
exports.Skeleton = Skeleton;
|
|
21541
|
+
exports.Spacer = Spacer;
|
|
21542
|
+
exports.Text = Text;
|
|
21543
|
+
exports.TierTileConfig = TierTileConfig;
|
|
21544
|
+
exports.TierTileUpdated = TierTile;
|
|
21545
|
+
exports.TileContainer = TileContainer;
|
|
21546
|
+
exports.WllSdkProvider = WllSdkProvider;
|
|
21547
|
+
exports.alignMap = alignMap;
|
|
21548
|
+
exports.justifyMap = justifyMap;
|
|
21549
|
+
exports.useWllSdk = useWllSdk;
|
|
21489
21550
|
//# sourceMappingURL=index.js.map
|