@wlloyalty/wll-react-sdk 1.0.43 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +126 -90
- package/dist/index.js +830 -710
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var React
|
|
3
|
+
var React = require('react');
|
|
4
4
|
var Color = require('color');
|
|
5
5
|
var LucideIcons = require('lucide-react');
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ function _interopNamespaceDefault(e) {
|
|
|
21
21
|
return Object.freeze(n);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React
|
|
24
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
25
|
var LucideIcons__namespace = /*#__PURE__*/_interopNamespaceDefault(LucideIcons);
|
|
26
26
|
|
|
27
27
|
function _typeof$1(o) {
|
|
@@ -91,6 +91,125 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
91
91
|
return t;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Copyright (c) Nicolas Gallagher.
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the MIT license found in the
|
|
98
|
+
* LICENSE file in the root directory of this source tree.
|
|
99
|
+
*
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
var isDisabled = props => props.disabled || Array.isArray(props.accessibilityStates) && props.accessibilityStates.indexOf('disabled') > -1;
|
|
104
|
+
var isDisabled$1 = isDisabled;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Copyright (c) Nicolas Gallagher.
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the MIT license found in the
|
|
110
|
+
* LICENSE file in the root directory of this source tree.
|
|
111
|
+
*
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
var accessibilityRoleToWebRole = {
|
|
116
|
+
adjustable: 'slider',
|
|
117
|
+
button: 'button',
|
|
118
|
+
header: 'heading',
|
|
119
|
+
image: 'img',
|
|
120
|
+
imagebutton: null,
|
|
121
|
+
keyboardkey: null,
|
|
122
|
+
label: null,
|
|
123
|
+
link: 'link',
|
|
124
|
+
none: 'presentation',
|
|
125
|
+
search: 'search',
|
|
126
|
+
summary: 'region',
|
|
127
|
+
text: null
|
|
128
|
+
};
|
|
129
|
+
var propsToAriaRole = _ref => {
|
|
130
|
+
var accessibilityRole = _ref.accessibilityRole,
|
|
131
|
+
role = _ref.role;
|
|
132
|
+
var _role = role || accessibilityRole;
|
|
133
|
+
if (_role) {
|
|
134
|
+
var inferredRole = accessibilityRoleToWebRole[_role];
|
|
135
|
+
if (inferredRole !== null) {
|
|
136
|
+
// ignore roles that don't map to web
|
|
137
|
+
return inferredRole || _role;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var propsToAriaRole$1 = propsToAriaRole;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Copyright (c) Nicolas Gallagher.
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the MIT license found in the
|
|
147
|
+
* LICENSE file in the root directory of this source tree.
|
|
148
|
+
*
|
|
149
|
+
*
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
var roleComponents = {
|
|
153
|
+
article: 'article',
|
|
154
|
+
banner: 'header',
|
|
155
|
+
blockquote: 'blockquote',
|
|
156
|
+
button: 'button',
|
|
157
|
+
code: 'code',
|
|
158
|
+
complementary: 'aside',
|
|
159
|
+
contentinfo: 'footer',
|
|
160
|
+
deletion: 'del',
|
|
161
|
+
emphasis: 'em',
|
|
162
|
+
figure: 'figure',
|
|
163
|
+
insertion: 'ins',
|
|
164
|
+
form: 'form',
|
|
165
|
+
list: 'ul',
|
|
166
|
+
listitem: 'li',
|
|
167
|
+
main: 'main',
|
|
168
|
+
navigation: 'nav',
|
|
169
|
+
paragraph: 'p',
|
|
170
|
+
region: 'section',
|
|
171
|
+
strong: 'strong'
|
|
172
|
+
};
|
|
173
|
+
var emptyObject$9 = {};
|
|
174
|
+
var propsToAccessibilityComponent = function propsToAccessibilityComponent(props) {
|
|
175
|
+
if (props === void 0) {
|
|
176
|
+
props = emptyObject$9;
|
|
177
|
+
}
|
|
178
|
+
var roleProp = props.role || props.accessibilityRole;
|
|
179
|
+
// special-case for "label" role which doesn't map to an ARIA role
|
|
180
|
+
if (roleProp === 'label') {
|
|
181
|
+
return 'label';
|
|
182
|
+
}
|
|
183
|
+
var role = propsToAriaRole$1(props);
|
|
184
|
+
if (role) {
|
|
185
|
+
if (role === 'heading') {
|
|
186
|
+
var level = props.accessibilityLevel || props['aria-level'];
|
|
187
|
+
if (level != null) {
|
|
188
|
+
return "h" + level;
|
|
189
|
+
}
|
|
190
|
+
return 'h1';
|
|
191
|
+
}
|
|
192
|
+
return roleComponents[role];
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
var propsToAccessibilityComponent$1 = propsToAccessibilityComponent;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Copyright (c) Nicolas Gallagher.
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the MIT license found in the
|
|
201
|
+
* LICENSE file in the root directory of this source tree.
|
|
202
|
+
*
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
var AccessibilityUtil = {
|
|
207
|
+
isDisabled: isDisabled$1,
|
|
208
|
+
propsToAccessibilityComponent: propsToAccessibilityComponent$1,
|
|
209
|
+
propsToAriaRole: propsToAriaRole$1
|
|
210
|
+
};
|
|
211
|
+
var AccessibilityUtil$1 = AccessibilityUtil;
|
|
212
|
+
|
|
94
213
|
/**
|
|
95
214
|
* Copyright (c) Nicolas Gallagher.
|
|
96
215
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -785,7 +904,7 @@ var canUseDOM$1 = canUseDOM;
|
|
|
785
904
|
* longfrom equivalents.
|
|
786
905
|
*/
|
|
787
906
|
|
|
788
|
-
var emptyObject$
|
|
907
|
+
var emptyObject$8 = {};
|
|
789
908
|
var supportsCSS3TextDecoration = !canUseDOM$1 || window.CSS != null && window.CSS.supports != null && (window.CSS.supports('text-decoration-line', 'none') || window.CSS.supports('-webkit-text-decoration-line', 'none'));
|
|
790
909
|
var MONOSPACE_FONT_STACK = 'monospace,monospace';
|
|
791
910
|
var SYSTEM_FONT_STACK = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
|
|
@@ -844,7 +963,7 @@ var STYLE_SHORT_FORM_EXPANSIONS = {
|
|
|
844
963
|
|
|
845
964
|
var createReactDOMStyle = (style, isInline) => {
|
|
846
965
|
if (!style) {
|
|
847
|
-
return emptyObject$
|
|
966
|
+
return emptyObject$8;
|
|
848
967
|
}
|
|
849
968
|
var resolvedStyle = {};
|
|
850
969
|
var _loop = function _loop() {
|
|
@@ -1786,7 +1905,7 @@ var prefixStyles = prefixAll;
|
|
|
1786
1905
|
|
|
1787
1906
|
var _excluded$f = ["animationKeyframes"];
|
|
1788
1907
|
var cache$3 = new Map();
|
|
1789
|
-
var emptyObject$
|
|
1908
|
+
var emptyObject$7 = {};
|
|
1790
1909
|
var classicGroup = 1;
|
|
1791
1910
|
var atomicGroup = 3;
|
|
1792
1911
|
var customGroup = {
|
|
@@ -2010,7 +2129,7 @@ function classic(style, name) {
|
|
|
2010
2129
|
* No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
|
|
2011
2130
|
*/
|
|
2012
2131
|
function inline(originalStyle, isRTL) {
|
|
2013
|
-
var style = originalStyle || emptyObject$
|
|
2132
|
+
var style = originalStyle || emptyObject$7;
|
|
2014
2133
|
var frozenProps = {};
|
|
2015
2134
|
var nextStyle = {};
|
|
2016
2135
|
var _loop = function _loop() {
|
|
@@ -2631,7 +2750,7 @@ function warnOnce(key, message) {
|
|
|
2631
2750
|
*
|
|
2632
2751
|
*/
|
|
2633
2752
|
|
|
2634
|
-
var emptyObject$
|
|
2753
|
+
var emptyObject$6 = {};
|
|
2635
2754
|
|
|
2636
2755
|
/**
|
|
2637
2756
|
* Shadows
|
|
@@ -2726,7 +2845,7 @@ var preprocess = function preprocess(originalStyle, options) {
|
|
|
2726
2845
|
if (options === void 0) {
|
|
2727
2846
|
options = {};
|
|
2728
2847
|
}
|
|
2729
|
-
var style = originalStyle || emptyObject$
|
|
2848
|
+
var style = originalStyle || emptyObject$6;
|
|
2730
2849
|
var nextStyle = {};
|
|
2731
2850
|
|
|
2732
2851
|
// Convert shadow styles
|
|
@@ -3764,125 +3883,6 @@ if (canUseDOM$1 && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
|
|
3764
3883
|
var stylesheet = StyleSheet;
|
|
3765
3884
|
var StyleSheet$1 = stylesheet;
|
|
3766
3885
|
|
|
3767
|
-
/**
|
|
3768
|
-
* Copyright (c) Nicolas Gallagher.
|
|
3769
|
-
*
|
|
3770
|
-
* This source code is licensed under the MIT license found in the
|
|
3771
|
-
* LICENSE file in the root directory of this source tree.
|
|
3772
|
-
*
|
|
3773
|
-
*
|
|
3774
|
-
*/
|
|
3775
|
-
|
|
3776
|
-
var isDisabled = props => props.disabled || Array.isArray(props.accessibilityStates) && props.accessibilityStates.indexOf('disabled') > -1;
|
|
3777
|
-
var isDisabled$1 = isDisabled;
|
|
3778
|
-
|
|
3779
|
-
/**
|
|
3780
|
-
* Copyright (c) Nicolas Gallagher.
|
|
3781
|
-
*
|
|
3782
|
-
* This source code is licensed under the MIT license found in the
|
|
3783
|
-
* LICENSE file in the root directory of this source tree.
|
|
3784
|
-
*
|
|
3785
|
-
*
|
|
3786
|
-
*/
|
|
3787
|
-
|
|
3788
|
-
var accessibilityRoleToWebRole = {
|
|
3789
|
-
adjustable: 'slider',
|
|
3790
|
-
button: 'button',
|
|
3791
|
-
header: 'heading',
|
|
3792
|
-
image: 'img',
|
|
3793
|
-
imagebutton: null,
|
|
3794
|
-
keyboardkey: null,
|
|
3795
|
-
label: null,
|
|
3796
|
-
link: 'link',
|
|
3797
|
-
none: 'presentation',
|
|
3798
|
-
search: 'search',
|
|
3799
|
-
summary: 'region',
|
|
3800
|
-
text: null
|
|
3801
|
-
};
|
|
3802
|
-
var propsToAriaRole = _ref => {
|
|
3803
|
-
var accessibilityRole = _ref.accessibilityRole,
|
|
3804
|
-
role = _ref.role;
|
|
3805
|
-
var _role = role || accessibilityRole;
|
|
3806
|
-
if (_role) {
|
|
3807
|
-
var inferredRole = accessibilityRoleToWebRole[_role];
|
|
3808
|
-
if (inferredRole !== null) {
|
|
3809
|
-
// ignore roles that don't map to web
|
|
3810
|
-
return inferredRole || _role;
|
|
3811
|
-
}
|
|
3812
|
-
}
|
|
3813
|
-
};
|
|
3814
|
-
var propsToAriaRole$1 = propsToAriaRole;
|
|
3815
|
-
|
|
3816
|
-
/**
|
|
3817
|
-
* Copyright (c) Nicolas Gallagher.
|
|
3818
|
-
*
|
|
3819
|
-
* This source code is licensed under the MIT license found in the
|
|
3820
|
-
* LICENSE file in the root directory of this source tree.
|
|
3821
|
-
*
|
|
3822
|
-
*
|
|
3823
|
-
*/
|
|
3824
|
-
|
|
3825
|
-
var roleComponents = {
|
|
3826
|
-
article: 'article',
|
|
3827
|
-
banner: 'header',
|
|
3828
|
-
blockquote: 'blockquote',
|
|
3829
|
-
button: 'button',
|
|
3830
|
-
code: 'code',
|
|
3831
|
-
complementary: 'aside',
|
|
3832
|
-
contentinfo: 'footer',
|
|
3833
|
-
deletion: 'del',
|
|
3834
|
-
emphasis: 'em',
|
|
3835
|
-
figure: 'figure',
|
|
3836
|
-
insertion: 'ins',
|
|
3837
|
-
form: 'form',
|
|
3838
|
-
list: 'ul',
|
|
3839
|
-
listitem: 'li',
|
|
3840
|
-
main: 'main',
|
|
3841
|
-
navigation: 'nav',
|
|
3842
|
-
paragraph: 'p',
|
|
3843
|
-
region: 'section',
|
|
3844
|
-
strong: 'strong'
|
|
3845
|
-
};
|
|
3846
|
-
var emptyObject$6 = {};
|
|
3847
|
-
var propsToAccessibilityComponent = function propsToAccessibilityComponent(props) {
|
|
3848
|
-
if (props === void 0) {
|
|
3849
|
-
props = emptyObject$6;
|
|
3850
|
-
}
|
|
3851
|
-
var roleProp = props.role || props.accessibilityRole;
|
|
3852
|
-
// special-case for "label" role which doesn't map to an ARIA role
|
|
3853
|
-
if (roleProp === 'label') {
|
|
3854
|
-
return 'label';
|
|
3855
|
-
}
|
|
3856
|
-
var role = propsToAriaRole$1(props);
|
|
3857
|
-
if (role) {
|
|
3858
|
-
if (role === 'heading') {
|
|
3859
|
-
var level = props.accessibilityLevel || props['aria-level'];
|
|
3860
|
-
if (level != null) {
|
|
3861
|
-
return "h" + level;
|
|
3862
|
-
}
|
|
3863
|
-
return 'h1';
|
|
3864
|
-
}
|
|
3865
|
-
return roleComponents[role];
|
|
3866
|
-
}
|
|
3867
|
-
};
|
|
3868
|
-
var propsToAccessibilityComponent$1 = propsToAccessibilityComponent;
|
|
3869
|
-
|
|
3870
|
-
/**
|
|
3871
|
-
* Copyright (c) Nicolas Gallagher.
|
|
3872
|
-
*
|
|
3873
|
-
* This source code is licensed under the MIT license found in the
|
|
3874
|
-
* LICENSE file in the root directory of this source tree.
|
|
3875
|
-
*
|
|
3876
|
-
*
|
|
3877
|
-
*/
|
|
3878
|
-
|
|
3879
|
-
var AccessibilityUtil = {
|
|
3880
|
-
isDisabled: isDisabled$1,
|
|
3881
|
-
propsToAccessibilityComponent: propsToAccessibilityComponent$1,
|
|
3882
|
-
propsToAriaRole: propsToAriaRole$1
|
|
3883
|
-
};
|
|
3884
|
-
var AccessibilityUtil$1 = AccessibilityUtil;
|
|
3885
|
-
|
|
3886
3886
|
var _excluded$d = ["aria-activedescendant", "accessibilityActiveDescendant", "aria-atomic", "accessibilityAtomic", "aria-autocomplete", "accessibilityAutoComplete", "aria-busy", "accessibilityBusy", "aria-checked", "accessibilityChecked", "aria-colcount", "accessibilityColumnCount", "aria-colindex", "accessibilityColumnIndex", "aria-colspan", "accessibilityColumnSpan", "aria-controls", "accessibilityControls", "aria-current", "accessibilityCurrent", "aria-describedby", "accessibilityDescribedBy", "aria-details", "accessibilityDetails", "aria-disabled", "accessibilityDisabled", "aria-errormessage", "accessibilityErrorMessage", "aria-expanded", "accessibilityExpanded", "aria-flowto", "accessibilityFlowTo", "aria-haspopup", "accessibilityHasPopup", "aria-hidden", "accessibilityHidden", "aria-invalid", "accessibilityInvalid", "aria-keyshortcuts", "accessibilityKeyShortcuts", "aria-label", "accessibilityLabel", "aria-labelledby", "accessibilityLabelledBy", "aria-level", "accessibilityLevel", "aria-live", "accessibilityLiveRegion", "aria-modal", "accessibilityModal", "aria-multiline", "accessibilityMultiline", "aria-multiselectable", "accessibilityMultiSelectable", "aria-orientation", "accessibilityOrientation", "aria-owns", "accessibilityOwns", "aria-placeholder", "accessibilityPlaceholder", "aria-posinset", "accessibilityPosInSet", "aria-pressed", "accessibilityPressed", "aria-readonly", "accessibilityReadOnly", "aria-required", "accessibilityRequired", "role", "accessibilityRole", "aria-roledescription", "accessibilityRoleDescription", "aria-rowcount", "accessibilityRowCount", "aria-rowindex", "accessibilityRowIndex", "aria-rowspan", "accessibilityRowSpan", "aria-selected", "accessibilitySelected", "aria-setsize", "accessibilitySetSize", "aria-sort", "accessibilitySort", "aria-valuemax", "accessibilityValueMax", "aria-valuemin", "accessibilityValueMin", "aria-valuenow", "accessibilityValueNow", "aria-valuetext", "accessibilityValueText", "dataSet", "focusable", "id", "nativeID", "pointerEvents", "style", "tabIndex", "testID"];
|
|
3887
3887
|
var emptyObject$5 = {};
|
|
3888
3888
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -4527,7 +4527,7 @@ var defaultLocale = {
|
|
|
4527
4527
|
direction: 'ltr',
|
|
4528
4528
|
locale: 'en-US'
|
|
4529
4529
|
};
|
|
4530
|
-
var LocaleContext = /*#__PURE__*/React
|
|
4530
|
+
var LocaleContext = /*#__PURE__*/React.createContext(defaultLocale);
|
|
4531
4531
|
function getLocaleDirection(locale) {
|
|
4532
4532
|
return isLocaleRTL(locale) ? 'rtl' : 'ltr';
|
|
4533
4533
|
}
|
|
@@ -4536,7 +4536,7 @@ function LocaleProvider(props) {
|
|
|
4536
4536
|
locale = props.locale,
|
|
4537
4537
|
children = props.children;
|
|
4538
4538
|
var needsContext = direction || locale;
|
|
4539
|
-
return needsContext ? /*#__PURE__*/React
|
|
4539
|
+
return needsContext ? /*#__PURE__*/React.createElement(LocaleContext.Provider, {
|
|
4540
4540
|
children: children,
|
|
4541
4541
|
value: {
|
|
4542
4542
|
direction: locale ? getLocaleDirection(locale) : direction,
|
|
@@ -4545,7 +4545,7 @@ function LocaleProvider(props) {
|
|
|
4545
4545
|
}) : children;
|
|
4546
4546
|
}
|
|
4547
4547
|
function useLocaleContext() {
|
|
4548
|
-
return React
|
|
4548
|
+
return React.useContext(LocaleContext);
|
|
4549
4549
|
}
|
|
4550
4550
|
|
|
4551
4551
|
/**
|
|
@@ -4565,10 +4565,10 @@ var createElement = (component, props, options) => {
|
|
|
4565
4565
|
}
|
|
4566
4566
|
var Component = accessibilityComponent || component;
|
|
4567
4567
|
var domProps = createDOMProps$1(Component, props, options);
|
|
4568
|
-
var element = /*#__PURE__*/React
|
|
4568
|
+
var element = /*#__PURE__*/React.createElement(Component, domProps);
|
|
4569
4569
|
|
|
4570
4570
|
// Update locale context if element's writing direction prop changes
|
|
4571
|
-
var elementWithLocaleProvider = domProps.dir ? /*#__PURE__*/React
|
|
4571
|
+
var elementWithLocaleProvider = domProps.dir ? /*#__PURE__*/React.createElement(LocaleProvider, {
|
|
4572
4572
|
children: element,
|
|
4573
4573
|
direction: domProps.dir,
|
|
4574
4574
|
locale: domProps.lang
|
|
@@ -4775,7 +4775,7 @@ function pick(obj, list) {
|
|
|
4775
4775
|
*
|
|
4776
4776
|
*/
|
|
4777
4777
|
|
|
4778
|
-
var useLayoutEffectImpl = canUseDOM$1 ? React
|
|
4778
|
+
var useLayoutEffectImpl = canUseDOM$1 ? React.useLayoutEffect : React.useEffect;
|
|
4779
4779
|
var useLayoutEffect = useLayoutEffectImpl;
|
|
4780
4780
|
|
|
4781
4781
|
/**
|
|
@@ -6312,7 +6312,7 @@ function useResponderEvents(hostRef, config) {
|
|
|
6312
6312
|
*
|
|
6313
6313
|
*/
|
|
6314
6314
|
|
|
6315
|
-
var TextAncestorContext = /*#__PURE__*/React
|
|
6315
|
+
var TextAncestorContext = /*#__PURE__*/React.createContext(false);
|
|
6316
6316
|
var TextAncestorContext$1 = TextAncestorContext;
|
|
6317
6317
|
|
|
6318
6318
|
var _excluded$c = ["hrefAttrs", "numberOfLines", "onClick", "onLayout", "onPress", "onMoveShouldSetResponder", "onMoveShouldSetResponderCapture", "onResponderEnd", "onResponderGrant", "onResponderMove", "onResponderReject", "onResponderRelease", "onResponderStart", "onResponderTerminate", "onResponderTerminationRequest", "onScrollShouldSetResponder", "onScrollShouldSetResponderCapture", "onSelectionChangeShouldSetResponder", "onSelectionChangeShouldSetResponderCapture", "onStartShouldSetResponder", "onStartShouldSetResponderCapture", "selectable"];
|
|
@@ -6988,25 +6988,25 @@ function getTouchFromResponderEvent(event) {
|
|
|
6988
6988
|
*/
|
|
6989
6989
|
|
|
6990
6990
|
function usePressEvents(hostRef, config) {
|
|
6991
|
-
var pressResponderRef = React
|
|
6991
|
+
var pressResponderRef = React.useRef(null);
|
|
6992
6992
|
if (pressResponderRef.current == null) {
|
|
6993
6993
|
pressResponderRef.current = new PressResponder(config);
|
|
6994
6994
|
}
|
|
6995
6995
|
var pressResponder = pressResponderRef.current;
|
|
6996
6996
|
|
|
6997
6997
|
// Re-configure to use the current node and configuration.
|
|
6998
|
-
React
|
|
6998
|
+
React.useEffect(() => {
|
|
6999
6999
|
pressResponder.configure(config);
|
|
7000
7000
|
}, [config, pressResponder]);
|
|
7001
7001
|
|
|
7002
7002
|
// Reset the `pressResponder` when cleanup needs to occur. This is
|
|
7003
7003
|
// a separate effect because we do not want to rest the responder when `config` changes.
|
|
7004
|
-
React
|
|
7004
|
+
React.useEffect(() => {
|
|
7005
7005
|
return () => {
|
|
7006
7006
|
pressResponder.reset();
|
|
7007
7007
|
};
|
|
7008
7008
|
}, [pressResponder]);
|
|
7009
|
-
React
|
|
7009
|
+
React.useDebugValue(config);
|
|
7010
7010
|
return pressResponder.getEventHandlers();
|
|
7011
7011
|
}
|
|
7012
7012
|
|
|
@@ -7156,25 +7156,25 @@ function TouchableOpacity(props, forwardedRef) {
|
|
|
7156
7156
|
rejectResponderTermination = props.rejectResponderTermination,
|
|
7157
7157
|
style = props.style,
|
|
7158
7158
|
rest = _objectWithoutPropertiesLoose(props, _excluded$a);
|
|
7159
|
-
var hostRef = React
|
|
7159
|
+
var hostRef = React.useRef(null);
|
|
7160
7160
|
var setRef = useMergeRefs$1(forwardedRef, hostRef);
|
|
7161
|
-
var _useState = React
|
|
7161
|
+
var _useState = React.useState('0s'),
|
|
7162
7162
|
duration = _useState[0],
|
|
7163
7163
|
setDuration = _useState[1];
|
|
7164
|
-
var _useState2 = React
|
|
7164
|
+
var _useState2 = React.useState(null),
|
|
7165
7165
|
opacityOverride = _useState2[0],
|
|
7166
7166
|
setOpacityOverride = _useState2[1];
|
|
7167
|
-
var setOpacityTo = React
|
|
7167
|
+
var setOpacityTo = React.useCallback((value, duration) => {
|
|
7168
7168
|
setOpacityOverride(value);
|
|
7169
7169
|
setDuration(duration ? duration / 1000 + "s" : '0s');
|
|
7170
7170
|
}, [setOpacityOverride, setDuration]);
|
|
7171
|
-
var setOpacityActive = React
|
|
7171
|
+
var setOpacityActive = React.useCallback(duration => {
|
|
7172
7172
|
setOpacityTo(activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.2, duration);
|
|
7173
7173
|
}, [activeOpacity, setOpacityTo]);
|
|
7174
|
-
var setOpacityInactive = React
|
|
7174
|
+
var setOpacityInactive = React.useCallback(duration => {
|
|
7175
7175
|
setOpacityTo(null, duration);
|
|
7176
7176
|
}, [setOpacityTo]);
|
|
7177
|
-
var pressConfig = React
|
|
7177
|
+
var pressConfig = React.useMemo(() => ({
|
|
7178
7178
|
cancelable: !rejectResponderTermination,
|
|
7179
7179
|
disabled,
|
|
7180
7180
|
delayLongPress,
|
|
@@ -7339,7 +7339,7 @@ var parseNavigationLink = function (link) {
|
|
|
7339
7339
|
};
|
|
7340
7340
|
|
|
7341
7341
|
var useNavigation = function (config) {
|
|
7342
|
-
var handleNavigation = React
|
|
7342
|
+
var handleNavigation = React.useCallback(function (link, ctaTarget) {
|
|
7343
7343
|
var _a;
|
|
7344
7344
|
var _b = parseNavigationLink(link),
|
|
7345
7345
|
type = _b.type,
|
|
@@ -7357,7 +7357,7 @@ var useNavigation = function (config) {
|
|
|
7357
7357
|
|
|
7358
7358
|
var baseUrl = 'https://api.staging.core.wlloyalty.net/v1';
|
|
7359
7359
|
var useCreateRequestOptions = function (config) {
|
|
7360
|
-
return React
|
|
7360
|
+
return React.useCallback(function (options) {
|
|
7361
7361
|
if (options === void 0) {
|
|
7362
7362
|
options = {};
|
|
7363
7363
|
}
|
|
@@ -7374,7 +7374,7 @@ var useCreateRequestOptions = function (config) {
|
|
|
7374
7374
|
};
|
|
7375
7375
|
var useMakeRequest = function (config) {
|
|
7376
7376
|
var createRequestOptions = useCreateRequestOptions(config);
|
|
7377
|
-
return React
|
|
7377
|
+
return React.useCallback(function (url) {
|
|
7378
7378
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
7379
7379
|
var response, json, error_1;
|
|
7380
7380
|
return __generator(this, function (_a) {
|
|
@@ -7422,7 +7422,7 @@ var createResourceGetter = function (resource, includeHydrate) {
|
|
|
7422
7422
|
}
|
|
7423
7423
|
return function (config) {
|
|
7424
7424
|
var makeRequest = useMakeRequest(config);
|
|
7425
|
-
return React
|
|
7425
|
+
return React.useCallback(function (id) {
|
|
7426
7426
|
var params = new URLSearchParams();
|
|
7427
7427
|
if (includeHydrate) {
|
|
7428
7428
|
params.append('hydrate', 'true');
|
|
@@ -7781,10 +7781,10 @@ function getDimensionMode(window) {
|
|
|
7781
7781
|
}
|
|
7782
7782
|
function useResponsive$1() {
|
|
7783
7783
|
var deviceWindow = Dimensions.get('window');
|
|
7784
|
-
var _a = React
|
|
7784
|
+
var _a = React.useState(getDimensionMode(deviceWindow)),
|
|
7785
7785
|
dimensionMode = _a[0],
|
|
7786
7786
|
setDimensionMode = _a[1];
|
|
7787
|
-
React
|
|
7787
|
+
React.useEffect(function () {
|
|
7788
7788
|
if (!isWeb) return;
|
|
7789
7789
|
var subscription = Dimensions.addEventListener('change', function (_a) {
|
|
7790
7790
|
var window = _a.window;
|
|
@@ -7807,10 +7807,10 @@ function useResponsive$1() {
|
|
|
7807
7807
|
};
|
|
7808
7808
|
}
|
|
7809
7809
|
|
|
7810
|
-
var ResponsiveContext = /*#__PURE__*/React
|
|
7810
|
+
var ResponsiveContext = /*#__PURE__*/React.createContext(undefined);
|
|
7811
7811
|
function ResponsiveProvider(_a) {
|
|
7812
7812
|
var children = _a.children;
|
|
7813
|
-
var _b = React
|
|
7813
|
+
var _b = React.useState(function () {
|
|
7814
7814
|
var window = Dimensions.get('window');
|
|
7815
7815
|
var dimensionMode = getDimensionMode(window);
|
|
7816
7816
|
return {
|
|
@@ -7822,7 +7822,7 @@ function ResponsiveProvider(_a) {
|
|
|
7822
7822
|
}),
|
|
7823
7823
|
state = _b[0],
|
|
7824
7824
|
setState = _b[1];
|
|
7825
|
-
React
|
|
7825
|
+
React.useEffect(function () {
|
|
7826
7826
|
var subscription = Dimensions.addEventListener('change', function (_a) {
|
|
7827
7827
|
var window = _a.window;
|
|
7828
7828
|
if (window) {
|
|
@@ -7841,12 +7841,12 @@ function ResponsiveProvider(_a) {
|
|
|
7841
7841
|
}
|
|
7842
7842
|
};
|
|
7843
7843
|
}, []);
|
|
7844
|
-
return /*#__PURE__*/React
|
|
7844
|
+
return /*#__PURE__*/React.createElement(ResponsiveContext.Provider, {
|
|
7845
7845
|
value: state
|
|
7846
7846
|
}, children);
|
|
7847
7847
|
}
|
|
7848
7848
|
function useResponsive() {
|
|
7849
|
-
var context = React
|
|
7849
|
+
var context = React.useContext(ResponsiveContext);
|
|
7850
7850
|
if (context === undefined) {
|
|
7851
7851
|
throw new Error('useResponsive must be used within a ResponsiveProvider');
|
|
7852
7852
|
}
|
|
@@ -7879,22 +7879,22 @@ var createTheme = function (baseTheme) {
|
|
|
7879
7879
|
alphaDerivedText: getAlphaDerivedColors(text)
|
|
7880
7880
|
});
|
|
7881
7881
|
};
|
|
7882
|
-
var WllSdkContext = /*#__PURE__*/React
|
|
7882
|
+
var WllSdkContext = /*#__PURE__*/React.createContext(undefined);
|
|
7883
7883
|
var WllSdkProvider = function (_a) {
|
|
7884
7884
|
var children = _a.children,
|
|
7885
7885
|
providedTheme = _a.theme,
|
|
7886
7886
|
config = _a.config,
|
|
7887
7887
|
_b = _a.navigationConfig,
|
|
7888
7888
|
navigationConfig = _b === void 0 ? {} : _b;
|
|
7889
|
-
var _c = React
|
|
7889
|
+
var _c = React.useState(function () {
|
|
7890
7890
|
return createTheme(providedTheme || {});
|
|
7891
7891
|
}),
|
|
7892
7892
|
theme = _c[0],
|
|
7893
7893
|
setThemeState = _c[1];
|
|
7894
|
-
React
|
|
7894
|
+
React.useEffect(function () {
|
|
7895
7895
|
setThemeState(createTheme(providedTheme || {}));
|
|
7896
7896
|
}, [providedTheme]);
|
|
7897
|
-
var setTheme = React
|
|
7897
|
+
var setTheme = React.useCallback(function (newTheme) {
|
|
7898
7898
|
setThemeState(function (prevTheme) {
|
|
7899
7899
|
return createTheme(__assign(__assign({}, prevTheme), newTheme));
|
|
7900
7900
|
});
|
|
@@ -7903,7 +7903,7 @@ var WllSdkProvider = function (_a) {
|
|
|
7903
7903
|
var getSectionByID = useGetSectionByID(config);
|
|
7904
7904
|
var getTileByID = useGetTileByID(config);
|
|
7905
7905
|
var handleNavigation = useNavigation(navigationConfig);
|
|
7906
|
-
var contextValue = React
|
|
7906
|
+
var contextValue = React.useMemo(function () {
|
|
7907
7907
|
return {
|
|
7908
7908
|
theme: theme,
|
|
7909
7909
|
setTheme: setTheme,
|
|
@@ -7913,18 +7913,25 @@ var WllSdkProvider = function (_a) {
|
|
|
7913
7913
|
handleNavigation: handleNavigation
|
|
7914
7914
|
};
|
|
7915
7915
|
}, [theme, setTheme, getGroupByID, getSectionByID, getTileByID, handleNavigation]);
|
|
7916
|
-
return /*#__PURE__*/React
|
|
7916
|
+
return /*#__PURE__*/React.createElement(WllSdkContext.Provider, {
|
|
7917
7917
|
value: contextValue
|
|
7918
|
-
}, /*#__PURE__*/React
|
|
7918
|
+
}, /*#__PURE__*/React.createElement(ResponsiveProvider, null, children));
|
|
7919
7919
|
};
|
|
7920
7920
|
var useWllSdk = function () {
|
|
7921
|
-
var context = React
|
|
7921
|
+
var context = React.useContext(WllSdkContext);
|
|
7922
7922
|
if (context === undefined) {
|
|
7923
7923
|
throw new Error('useWllSdk must be used within a WllSdkProvider');
|
|
7924
7924
|
}
|
|
7925
7925
|
return context;
|
|
7926
7926
|
};
|
|
7927
7927
|
|
|
7928
|
+
function createVariantSystem(baseStyle, variantStyles) {
|
|
7929
|
+
return function (theme, variant) {
|
|
7930
|
+
var styles = variantStyles(theme);
|
|
7931
|
+
return [baseStyle, styles[variant]];
|
|
7932
|
+
};
|
|
7933
|
+
}
|
|
7934
|
+
|
|
7928
7935
|
var clamp$1 = function (value, min, max) {
|
|
7929
7936
|
return Math.min(Math.max(value, min), max);
|
|
7930
7937
|
};
|
|
@@ -7953,12 +7960,12 @@ var getResponsiveValue = function (desktopValue, mobileValue, isDesktop, isTable
|
|
|
7953
7960
|
return mobileValue;
|
|
7954
7961
|
};
|
|
7955
7962
|
var useResponsiveValue = function (desktopValue, mobileValue, isDesktop, isTablet) {
|
|
7956
|
-
var _a = React
|
|
7963
|
+
var _a = React.useState(function () {
|
|
7957
7964
|
return getResponsiveValue(desktopValue, mobileValue);
|
|
7958
7965
|
}),
|
|
7959
7966
|
value = _a[0],
|
|
7960
7967
|
setValue = _a[1];
|
|
7961
|
-
React
|
|
7968
|
+
React.useEffect(function () {
|
|
7962
7969
|
if (Platform$1.OS !== 'web') return;
|
|
7963
7970
|
var handleResize = function () {
|
|
7964
7971
|
setValue(getResponsiveValue(desktopValue, mobileValue));
|
|
@@ -7971,12 +7978,27 @@ var useResponsiveValue = function (desktopValue, mobileValue, isDesktop, isTable
|
|
|
7971
7978
|
return value;
|
|
7972
7979
|
};
|
|
7973
7980
|
|
|
7974
|
-
function
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7981
|
+
var useButtonDynamicStyles = function () {
|
|
7982
|
+
var _a = useResponsive$1(),
|
|
7983
|
+
isDesktop = _a.isDesktop,
|
|
7984
|
+
isTablet = _a.isTablet;
|
|
7985
|
+
var theme = useWllSdk().theme;
|
|
7986
|
+
return StyleSheet$1.create({
|
|
7987
|
+
button: {
|
|
7988
|
+
justifyContent: 'center',
|
|
7989
|
+
alignItems: 'center',
|
|
7990
|
+
paddingHorizontal: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet),
|
|
7991
|
+
paddingVertical: theme.sizes.sm,
|
|
7992
|
+
alignSelf: 'flex-start'
|
|
7993
|
+
},
|
|
7994
|
+
text: {
|
|
7995
|
+
textAlign: 'center',
|
|
7996
|
+
textTransform: 'uppercase',
|
|
7997
|
+
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.sm, isDesktop, isTablet),
|
|
7998
|
+
fontWeight: '700'
|
|
7999
|
+
}
|
|
8000
|
+
});
|
|
8001
|
+
};
|
|
7980
8002
|
|
|
7981
8003
|
var useButtonStyles = createVariantSystem({}, function (theme) {
|
|
7982
8004
|
return {
|
|
@@ -8015,79 +8037,19 @@ var Button = function (_a) {
|
|
|
8015
8037
|
onPress = _a.onPress,
|
|
8016
8038
|
variant = _a.variant;
|
|
8017
8039
|
var theme = useWllSdk().theme;
|
|
8018
|
-
var _b = useResponsive$1(),
|
|
8019
|
-
isDesktop = _b.isDesktop,
|
|
8020
|
-
isTablet = _b.isTablet;
|
|
8021
8040
|
var buttonStyle = useButtonStyles(theme, variant);
|
|
8022
8041
|
var textStyle = useTextStyles(theme, variant);
|
|
8023
|
-
var
|
|
8024
|
-
button: {
|
|
8025
|
-
justifyContent: 'center',
|
|
8026
|
-
alignItems: 'center',
|
|
8027
|
-
paddingHorizontal: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet),
|
|
8028
|
-
paddingVertical: theme.sizes.sm,
|
|
8029
|
-
alignSelf: 'flex-start'
|
|
8030
|
-
},
|
|
8031
|
-
text: {
|
|
8032
|
-
textAlign: 'center',
|
|
8033
|
-
textTransform: 'uppercase',
|
|
8034
|
-
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.sm, isDesktop, isTablet),
|
|
8035
|
-
fontWeight: '700'
|
|
8036
|
-
}
|
|
8037
|
-
});
|
|
8042
|
+
var styles = useButtonDynamicStyles();
|
|
8038
8043
|
return /*#__PURE__*/React__namespace.createElement(TouchableOpacity$1, {
|
|
8039
|
-
style: [
|
|
8044
|
+
style: [styles.button, buttonStyle, {
|
|
8040
8045
|
borderRadius: theme.sizes.borderRadiusButton
|
|
8041
8046
|
}],
|
|
8042
8047
|
onPress: onPress
|
|
8043
8048
|
}, /*#__PURE__*/React__namespace.createElement(Text$3, {
|
|
8044
|
-
style: [
|
|
8049
|
+
style: [styles.text, textStyle]
|
|
8045
8050
|
}, title));
|
|
8046
8051
|
};
|
|
8047
8052
|
|
|
8048
|
-
var justifyMap$1 = {
|
|
8049
|
-
start: 'flex-start',
|
|
8050
|
-
end: 'flex-end',
|
|
8051
|
-
center: 'center',
|
|
8052
|
-
between: 'space-between',
|
|
8053
|
-
around: 'space-around',
|
|
8054
|
-
evenly: 'space-evenly'
|
|
8055
|
-
};
|
|
8056
|
-
var alignMap$1 = {
|
|
8057
|
-
start: 'flex-start',
|
|
8058
|
-
end: 'flex-end',
|
|
8059
|
-
center: 'center',
|
|
8060
|
-
stretch: 'stretch'
|
|
8061
|
-
};
|
|
8062
|
-
var Column$1 = function (_a) {
|
|
8063
|
-
var children = _a.children,
|
|
8064
|
-
_b = _a.justify,
|
|
8065
|
-
justify = _b === void 0 ? 'start' : _b,
|
|
8066
|
-
_c = _a.align,
|
|
8067
|
-
align = _c === void 0 ? 'stretch' : _c,
|
|
8068
|
-
_d = _a.direction,
|
|
8069
|
-
direction = _d === void 0 ? 'column' : _d,
|
|
8070
|
-
_e = _a.style,
|
|
8071
|
-
style = _e === void 0 ? {} : _e;
|
|
8072
|
-
var theme = useWllSdk().theme;
|
|
8073
|
-
var _f = useResponsive$1(),
|
|
8074
|
-
isDesktop = _f.isDesktop,
|
|
8075
|
-
isTablet = _f.isTablet;
|
|
8076
|
-
var dynamicStyles = StyleSheet$1.create({
|
|
8077
|
-
column: {
|
|
8078
|
-
flex: 1,
|
|
8079
|
-
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
8080
|
-
paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
8081
|
-
justifyContent: justifyMap$1[justify],
|
|
8082
|
-
alignItems: alignMap$1[align],
|
|
8083
|
-
flexDirection: direction
|
|
8084
|
-
}
|
|
8085
|
-
});
|
|
8086
|
-
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
8087
|
-
style: [dynamicStyles.column, style]
|
|
8088
|
-
}, children);
|
|
8089
|
-
};
|
|
8090
|
-
|
|
8091
8053
|
var Icon = function (_a) {
|
|
8092
8054
|
var name = _a.name,
|
|
8093
8055
|
_b = _a.color,
|
|
@@ -8331,7 +8293,7 @@ function RefreshControl(props) {
|
|
|
8331
8293
|
props.title;
|
|
8332
8294
|
props.titleColor;
|
|
8333
8295
|
var rest = _objectWithoutPropertiesLoose(props, _excluded$8);
|
|
8334
|
-
return /*#__PURE__*/React
|
|
8296
|
+
return /*#__PURE__*/React.createElement(View$2, rest);
|
|
8335
8297
|
}
|
|
8336
8298
|
|
|
8337
8299
|
/**
|
|
@@ -8634,7 +8596,7 @@ var warning$1 = /*@__PURE__*/getDefaultExportFromCjs(warning_1);
|
|
|
8634
8596
|
var _excluded$6 = ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "forwardedRef", "keyboardDismissMode", "onScroll", "centerContent"];
|
|
8635
8597
|
var emptyObject$1 = {};
|
|
8636
8598
|
var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
|
|
8637
|
-
let ScrollView$1 = class ScrollView extends React
|
|
8599
|
+
let ScrollView$1 = class ScrollView extends React.Component {
|
|
8638
8600
|
constructor() {
|
|
8639
8601
|
super(...arguments);
|
|
8640
8602
|
this._scrollNodeRef = null;
|
|
@@ -9161,17 +9123,17 @@ let ScrollView$1 = class ScrollView extends React$1.Component {
|
|
|
9161
9123
|
};
|
|
9162
9124
|
}
|
|
9163
9125
|
var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);
|
|
9164
|
-
var children = hasStickyHeaderIndices || pagingEnabled ? React
|
|
9126
|
+
var children = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(this.props.children, (child, i) => {
|
|
9165
9127
|
var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
|
|
9166
9128
|
if (child != null && (isSticky || pagingEnabled)) {
|
|
9167
|
-
return /*#__PURE__*/React
|
|
9129
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
9168
9130
|
style: [isSticky && styles$d.stickyHeader, pagingEnabled && styles$d.pagingEnabledChild]
|
|
9169
9131
|
}, child);
|
|
9170
9132
|
} else {
|
|
9171
9133
|
return child;
|
|
9172
9134
|
}
|
|
9173
9135
|
}) : this.props.children;
|
|
9174
|
-
var contentContainer = /*#__PURE__*/React
|
|
9136
|
+
var contentContainer = /*#__PURE__*/React.createElement(View$2, _extends$1({}, contentSizeChangeProps, {
|
|
9175
9137
|
children: children,
|
|
9176
9138
|
collapsable: false,
|
|
9177
9139
|
ref: this._setInnerViewRef,
|
|
@@ -9200,11 +9162,11 @@ let ScrollView$1 = class ScrollView extends React$1.Component {
|
|
|
9200
9162
|
});
|
|
9201
9163
|
var ScrollViewClass = ScrollViewBase$1;
|
|
9202
9164
|
invariant$1(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined');
|
|
9203
|
-
var scrollView = /*#__PURE__*/React
|
|
9165
|
+
var scrollView = /*#__PURE__*/React.createElement(ScrollViewClass, _extends$1({}, props, {
|
|
9204
9166
|
ref: this._setScrollNodeRef
|
|
9205
9167
|
}), contentContainer);
|
|
9206
9168
|
if (refreshControl) {
|
|
9207
|
-
return /*#__PURE__*/React
|
|
9169
|
+
return /*#__PURE__*/React.cloneElement(refreshControl, {
|
|
9208
9170
|
style: props.style
|
|
9209
9171
|
}, scrollView);
|
|
9210
9172
|
}
|
|
@@ -9254,8 +9216,8 @@ var styles$d = StyleSheet$1.create({
|
|
|
9254
9216
|
scrollSnapAlign: 'start'
|
|
9255
9217
|
}
|
|
9256
9218
|
});
|
|
9257
|
-
var ForwardedScrollView = /*#__PURE__*/React
|
|
9258
|
-
return /*#__PURE__*/React
|
|
9219
|
+
var ForwardedScrollView = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
9220
|
+
return /*#__PURE__*/React.createElement(ScrollView$1, _extends$1({}, props, {
|
|
9259
9221
|
forwardedRef: forwardedRef
|
|
9260
9222
|
}));
|
|
9261
9223
|
});
|
|
@@ -10301,7 +10263,7 @@ function VirtualizedListContextProvider(_ref2) {
|
|
|
10301
10263
|
var children = _ref2.children,
|
|
10302
10264
|
value = _ref2.value;
|
|
10303
10265
|
// Avoid setting a newly created context object if the values are identical.
|
|
10304
|
-
var context = React
|
|
10266
|
+
var context = React.useMemo(() => ({
|
|
10305
10267
|
cellKey: null,
|
|
10306
10268
|
getScrollMetrics: value.getScrollMetrics,
|
|
10307
10269
|
horizontal: value.horizontal,
|
|
@@ -10321,8 +10283,8 @@ function VirtualizedListCellContextProvider(_ref3) {
|
|
|
10321
10283
|
var cellKey = _ref3.cellKey,
|
|
10322
10284
|
children = _ref3.children;
|
|
10323
10285
|
// Avoid setting a newly created context object if the values are identical.
|
|
10324
|
-
var currContext = React
|
|
10325
|
-
var context = React
|
|
10286
|
+
var currContext = React.useContext(VirtualizedListContext);
|
|
10287
|
+
var context = React.useMemo(() => currContext == null ? null : _objectSpread2(_objectSpread2({}, currContext), {}, {
|
|
10326
10288
|
cellKey
|
|
10327
10289
|
}), [currContext, cellKey]);
|
|
10328
10290
|
return /*#__PURE__*/React__namespace.createElement(VirtualizedListContext.Provider, {
|
|
@@ -14367,8 +14329,8 @@ var AnimatedProps$1 = AnimatedProps;
|
|
|
14367
14329
|
* WARNING: The `effect` callback should be stable (e.g. using `useCallback`).
|
|
14368
14330
|
*/
|
|
14369
14331
|
function useRefEffect(effect) {
|
|
14370
|
-
var cleanupRef = React
|
|
14371
|
-
return React
|
|
14332
|
+
var cleanupRef = React.useRef(undefined);
|
|
14333
|
+
return React.useCallback(instance => {
|
|
14372
14334
|
if (cleanupRef.current) {
|
|
14373
14335
|
cleanupRef.current();
|
|
14374
14336
|
cleanupRef.current = undefined;
|
|
@@ -14390,15 +14352,15 @@ function useRefEffect(effect) {
|
|
|
14390
14352
|
*/
|
|
14391
14353
|
|
|
14392
14354
|
function useAnimatedProps(props) {
|
|
14393
|
-
var _useReducer = React
|
|
14355
|
+
var _useReducer = React.useReducer(count => count + 1, 0),
|
|
14394
14356
|
scheduleUpdate = _useReducer[1];
|
|
14395
|
-
var onUpdateRef = React
|
|
14357
|
+
var onUpdateRef = React.useRef(null);
|
|
14396
14358
|
|
|
14397
14359
|
// TODO: Only invalidate `node` if animated props or `style` change. In the
|
|
14398
14360
|
// previous implementation, we permitted `style` to override props with the
|
|
14399
14361
|
// same name property name as styles, so we can probably continue doing that.
|
|
14400
14362
|
// The ordering of other props *should* not matter.
|
|
14401
|
-
var node = React
|
|
14363
|
+
var node = React.useMemo(() => new AnimatedProps$1(props, () => onUpdateRef.current == null ? void 0 : onUpdateRef.current()), [props]);
|
|
14402
14364
|
useAnimatedPropsLifecycle(node);
|
|
14403
14365
|
|
|
14404
14366
|
// TODO: This "effect" does three things:
|
|
@@ -14414,7 +14376,7 @@ function useAnimatedProps(props) {
|
|
|
14414
14376
|
//
|
|
14415
14377
|
// But there is no way to transparently compose three separate callback refs,
|
|
14416
14378
|
// so we just combine them all into one for now.
|
|
14417
|
-
var refEffect = React
|
|
14379
|
+
var refEffect = React.useCallback(instance => {
|
|
14418
14380
|
// NOTE: This may be called more often than necessary (e.g. when `props`
|
|
14419
14381
|
// changes), but `setNativeView` already optimizes for that.
|
|
14420
14382
|
node.setNativeView(instance);
|
|
@@ -14464,9 +14426,9 @@ function reduceAnimatedProps(node) {
|
|
|
14464
14426
|
* unless we are unmounting.
|
|
14465
14427
|
*/
|
|
14466
14428
|
function useAnimatedPropsLifecycle(node) {
|
|
14467
|
-
var prevNodeRef = React
|
|
14468
|
-
var isUnmountingRef = React
|
|
14469
|
-
React
|
|
14429
|
+
var prevNodeRef = React.useRef(null);
|
|
14430
|
+
var isUnmountingRef = React.useRef(false);
|
|
14431
|
+
React.useEffect(() => {
|
|
14470
14432
|
// It is ok for multiple components to call `flushQueue` because it noops
|
|
14471
14433
|
// if the queue is empty. When multiple animated components are mounted at
|
|
14472
14434
|
// the same time. Only first component flushes the queue and the others will noop.
|
|
@@ -14526,7 +14488,7 @@ function useMergeRefs() {
|
|
|
14526
14488
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14527
14489
|
refs[_key] = arguments[_key];
|
|
14528
14490
|
}
|
|
14529
|
-
return React
|
|
14491
|
+
return React.useCallback(current => {
|
|
14530
14492
|
for (var _i = 0, _refs = refs; _i < _refs.length; _i++) {
|
|
14531
14493
|
var ref = _refs[_i];
|
|
14532
14494
|
if (ref != null) {
|
|
@@ -18164,30 +18126,21 @@ function _extends() {
|
|
|
18164
18126
|
}, _extends.apply(null, arguments);
|
|
18165
18127
|
}
|
|
18166
18128
|
|
|
18167
|
-
var
|
|
18168
|
-
|
|
18169
|
-
|
|
18170
|
-
|
|
18171
|
-
|
|
18172
|
-
|
|
18173
|
-
|
|
18174
|
-
|
|
18175
|
-
container: {
|
|
18176
|
-
position: 'relative',
|
|
18177
|
-
alignItems: 'center',
|
|
18178
|
-
justifyContent: 'center',
|
|
18179
|
-
backgroundColor: 'red',
|
|
18180
|
-
width: '100%',
|
|
18181
|
-
height: '100%'
|
|
18182
|
-
}
|
|
18183
|
-
});
|
|
18129
|
+
var IS_WEB = Platform$1.OS === "web";
|
|
18130
|
+
Platform$1.OS === "ios";
|
|
18131
|
+
Platform$1.OS === "android";
|
|
18132
|
+
var _a$1 = Dimensions.get("window"),
|
|
18133
|
+
width = _a$1.width;
|
|
18134
|
+
_a$1.height;
|
|
18135
|
+
var SCREEN_WIDTH = width;
|
|
18136
|
+
|
|
18184
18137
|
var ProgressiveImage = function (_a) {
|
|
18185
18138
|
var source = _a.source,
|
|
18186
18139
|
style = _a.style,
|
|
18187
18140
|
_b = _a.isDesaturated,
|
|
18188
18141
|
isDesaturated = _b === void 0 ? false : _b,
|
|
18189
18142
|
props = __rest(_a, ["source", "style", "isDesaturated"]);
|
|
18190
|
-
var imageAnimated = React
|
|
18143
|
+
var imageAnimated = React.useRef(new Animated$1.Value(0)).current;
|
|
18191
18144
|
var theme = useWllSdk().theme;
|
|
18192
18145
|
var onImageLoad = function () {
|
|
18193
18146
|
requestAnimationFrame(function () {
|
|
@@ -18201,11 +18154,17 @@ var ProgressiveImage = function (_a) {
|
|
|
18201
18154
|
var baseColor = theme.alphaDerivedPrimary[20];
|
|
18202
18155
|
var desaturatedColor = desaturateColor(baseColor);
|
|
18203
18156
|
var backgroundColor = isDesaturated ? desaturatedColor : baseColor;
|
|
18204
|
-
|
|
18157
|
+
// Platform-specific logic for desaturation
|
|
18158
|
+
var desaturationStyle = IS_WEB ? {
|
|
18159
|
+
filter: isDesaturated ? 'grayscale(100%)' : undefined
|
|
18160
|
+
} : {
|
|
18161
|
+
tintColor: isDesaturated ? desaturatedColor : undefined
|
|
18162
|
+
};
|
|
18163
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
18205
18164
|
style: [styles$8.container, style, {
|
|
18206
18165
|
backgroundColor: backgroundColor
|
|
18207
18166
|
}]
|
|
18208
|
-
}, /*#__PURE__*/React
|
|
18167
|
+
}, /*#__PURE__*/React.createElement(Animated$1.View, {
|
|
18209
18168
|
style: [styles$8.imageOverlay, {
|
|
18210
18169
|
backgroundColor: backgroundColor,
|
|
18211
18170
|
opacity: imageAnimated.interpolate({
|
|
@@ -18213,37 +18172,31 @@ var ProgressiveImage = function (_a) {
|
|
|
18213
18172
|
outputRange: [1, 0]
|
|
18214
18173
|
})
|
|
18215
18174
|
}]
|
|
18216
|
-
}), /*#__PURE__*/React
|
|
18175
|
+
}), /*#__PURE__*/React.createElement(Animated$1.Image, _extends({}, props, {
|
|
18217
18176
|
source: source,
|
|
18218
18177
|
style: [styles$8.imageOverlay, __assign({
|
|
18219
18178
|
opacity: imageAnimated
|
|
18220
|
-
},
|
|
18221
|
-
filter: "saturate(".concat(0 * 100, "%)")
|
|
18222
|
-
})],
|
|
18179
|
+
}, desaturationStyle)],
|
|
18223
18180
|
onLoad: onImageLoad
|
|
18224
18181
|
})));
|
|
18225
18182
|
};
|
|
18226
|
-
|
|
18227
|
-
|
|
18228
|
-
|
|
18229
|
-
|
|
18230
|
-
|
|
18231
|
-
|
|
18232
|
-
|
|
18233
|
-
|
|
18234
|
-
|
|
18235
|
-
|
|
18236
|
-
|
|
18237
|
-
|
|
18238
|
-
|
|
18239
|
-
|
|
18240
|
-
|
|
18241
|
-
|
|
18242
|
-
|
|
18243
|
-
return /*#__PURE__*/React__namespace.createElement(View$2, _extends({
|
|
18244
|
-
style: [dynamicStyles.header, style]
|
|
18245
|
-
}, props), children);
|
|
18246
|
-
};
|
|
18183
|
+
var styles$8 = StyleSheet$1.create({
|
|
18184
|
+
imageOverlay: {
|
|
18185
|
+
position: 'absolute',
|
|
18186
|
+
left: 0,
|
|
18187
|
+
right: 0,
|
|
18188
|
+
bottom: 0,
|
|
18189
|
+
top: 0
|
|
18190
|
+
},
|
|
18191
|
+
container: {
|
|
18192
|
+
position: 'relative',
|
|
18193
|
+
alignItems: 'center',
|
|
18194
|
+
justifyContent: 'center',
|
|
18195
|
+
backgroundColor: 'red',
|
|
18196
|
+
width: '100%',
|
|
18197
|
+
height: '100%'
|
|
18198
|
+
}
|
|
18199
|
+
});
|
|
18247
18200
|
|
|
18248
18201
|
var Text = function (_a) {
|
|
18249
18202
|
var _b = _a.variant,
|
|
@@ -18780,9 +18733,9 @@ function Pressable(props, forwardedRef) {
|
|
|
18780
18733
|
var _useForceableState3 = useForceableState(testOnly_pressed === true),
|
|
18781
18734
|
pressed = _useForceableState3[0],
|
|
18782
18735
|
setPressed = _useForceableState3[1];
|
|
18783
|
-
var hostRef = React
|
|
18736
|
+
var hostRef = React.useRef(null);
|
|
18784
18737
|
var setRef = useMergeRefs$1(forwardedRef, hostRef);
|
|
18785
|
-
var pressConfig = React
|
|
18738
|
+
var pressConfig = React.useMemo(() => ({
|
|
18786
18739
|
delayLongPress,
|
|
18787
18740
|
delayPressStart: delayPressIn,
|
|
18788
18741
|
delayPressEnd: delayPressOut,
|
|
@@ -18859,7 +18812,7 @@ function Pressable(props, forwardedRef) {
|
|
|
18859
18812
|
}), typeof children === 'function' ? children(interactionState) : children);
|
|
18860
18813
|
}
|
|
18861
18814
|
function useForceableState(forced) {
|
|
18862
|
-
var _useState = React
|
|
18815
|
+
var _useState = React.useState(false),
|
|
18863
18816
|
bool = _useState[0],
|
|
18864
18817
|
setBool = _useState[1];
|
|
18865
18818
|
return [bool || forced, setBool];
|
|
@@ -18873,7 +18826,7 @@ var styles$7 = StyleSheet$1.create({
|
|
|
18873
18826
|
pointerEvents: 'box-none'
|
|
18874
18827
|
}
|
|
18875
18828
|
});
|
|
18876
|
-
var MemoedPressable = /*#__PURE__*/React
|
|
18829
|
+
var MemoedPressable = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Pressable));
|
|
18877
18830
|
MemoedPressable.displayName = 'Pressable';
|
|
18878
18831
|
var Pressable$1 = MemoedPressable;
|
|
18879
18832
|
|
|
@@ -19015,7 +18968,7 @@ var TierTileConfig = /** @class */function () {
|
|
|
19015
18968
|
|
|
19016
18969
|
var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
|
|
19017
18970
|
var handleNavigation = useWllSdk().handleNavigation;
|
|
19018
|
-
return React
|
|
18971
|
+
return React.useCallback(function () {
|
|
19019
18972
|
if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.Reward) {
|
|
19020
18973
|
var config = tile.configuration;
|
|
19021
18974
|
if (config === null || config === void 0 ? void 0 : config.rewardId) {
|
|
@@ -19037,9 +18990,9 @@ var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
|
|
|
19037
18990
|
}, [tile, ctaLink, ctaLinkTarget, handleNavigation]);
|
|
19038
18991
|
};
|
|
19039
18992
|
|
|
19040
|
-
var BannerContext = /*#__PURE__*/
|
|
18993
|
+
var BannerContext = /*#__PURE__*/React.createContext(null);
|
|
19041
18994
|
var useBannerContext = function () {
|
|
19042
|
-
var context =
|
|
18995
|
+
var context = React.useContext(BannerContext);
|
|
19043
18996
|
if (!context) {
|
|
19044
18997
|
throw new Error('Tile components must be used within a BaseTile');
|
|
19045
18998
|
}
|
|
@@ -19054,9 +19007,9 @@ var BaseBanner = function (_a) {
|
|
|
19054
19007
|
ctaLinkTarget = _b.ctaLinkTarget,
|
|
19055
19008
|
title = _b.title;
|
|
19056
19009
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19057
|
-
return /*#__PURE__*/
|
|
19010
|
+
return /*#__PURE__*/React.createElement(BannerContext.Provider, {
|
|
19058
19011
|
value: tile
|
|
19059
|
-
}, /*#__PURE__*/
|
|
19012
|
+
}, /*#__PURE__*/React.createElement(Pressable$1, {
|
|
19060
19013
|
style: function (_a) {
|
|
19061
19014
|
var pressed = _a.pressed;
|
|
19062
19015
|
return [styles$6.container, {
|
|
@@ -19084,7 +19037,7 @@ var styles$6 = StyleSheet$1.create({
|
|
|
19084
19037
|
});
|
|
19085
19038
|
|
|
19086
19039
|
var useTileSize = function (tile) {
|
|
19087
|
-
return React
|
|
19040
|
+
return React.useMemo(function () {
|
|
19088
19041
|
return {
|
|
19089
19042
|
isFullSize: tile.tileHeight === exports.TileHeight.Full,
|
|
19090
19043
|
isHalfSize: tile.tileHeight === exports.TileHeight.Half
|
|
@@ -19102,11 +19055,16 @@ var BaseTileBody = function (props) {
|
|
|
19102
19055
|
artworkUrl = _b.artworkUrl;
|
|
19103
19056
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
19104
19057
|
if (isHalfSize && artworkUrl || !body) return null;
|
|
19105
|
-
|
|
19058
|
+
// Helper function to determine the number of lines
|
|
19059
|
+
var getNumberOfLines = function () {
|
|
19060
|
+
if (!isHalfSize && !artworkUrl) return undefined;
|
|
19061
|
+
return isDesktop ? 3 : isTablet ? 4 : 3;
|
|
19062
|
+
};
|
|
19063
|
+
return /*#__PURE__*/React.createElement(Text, _extends({
|
|
19106
19064
|
variant: "body"
|
|
19107
19065
|
}, props, {
|
|
19108
19066
|
accessibilityLabel: body,
|
|
19109
|
-
numberOfLines:
|
|
19067
|
+
numberOfLines: getNumberOfLines()
|
|
19110
19068
|
}), body);
|
|
19111
19069
|
};
|
|
19112
19070
|
|
|
@@ -19171,7 +19129,7 @@ var BaseTileContent = function (_a) {
|
|
|
19171
19129
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
19172
19130
|
// For half tiles with an image, don't show other content
|
|
19173
19131
|
if (isHalfSize && artworkUrl) return null;
|
|
19174
|
-
return /*#__PURE__*/React
|
|
19132
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19175
19133
|
style: [baseStyles.content, {
|
|
19176
19134
|
justifyContent: 'center',
|
|
19177
19135
|
height: !artworkUrl ? '100%' : undefined
|
|
@@ -19187,7 +19145,7 @@ var BaseTileHeader = function (_a) {
|
|
|
19187
19145
|
// For half tiles with an image, don't show header
|
|
19188
19146
|
if (isHalfSize && artworkUrl) return null;
|
|
19189
19147
|
var dynamicStyles = useBaseTileStyles();
|
|
19190
|
-
return /*#__PURE__*/React
|
|
19148
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19191
19149
|
style: [dynamicStyles.header, {
|
|
19192
19150
|
marginTop: isHalfSize ? 0 : dynamicStyles.header.marginTop,
|
|
19193
19151
|
// @ts-ignore
|
|
@@ -19207,7 +19165,7 @@ var BaseTileMedia = function (props) {
|
|
|
19207
19165
|
useTileSize(tile).isHalfSize;
|
|
19208
19166
|
var styles = useBaseTileStyles();
|
|
19209
19167
|
if (!artworkUrl) return null;
|
|
19210
|
-
return /*#__PURE__*/React
|
|
19168
|
+
return /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
|
|
19211
19169
|
source: {
|
|
19212
19170
|
uri: artworkUrl
|
|
19213
19171
|
},
|
|
@@ -19225,31 +19183,33 @@ var BaseTileTitle = function () {
|
|
|
19225
19183
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
19226
19184
|
// Don't show title for half tiles with image
|
|
19227
19185
|
if (isHalfSize && artworkUrl || !title) return null;
|
|
19228
|
-
return /*#__PURE__*/React
|
|
19186
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
19229
19187
|
variant: "title",
|
|
19230
19188
|
accessibilityLabel: title,
|
|
19231
19189
|
numberOfLines: 1
|
|
19232
|
-
}, title), ctaLink && /*#__PURE__*/React
|
|
19190
|
+
}, title), ctaLink && /*#__PURE__*/React.createElement(Icon, {
|
|
19233
19191
|
name: "ChevronRight",
|
|
19234
19192
|
color: theme.derivedSurfaceText[20]
|
|
19235
19193
|
}));
|
|
19236
19194
|
};
|
|
19237
19195
|
|
|
19238
|
-
|
|
19196
|
+
/**
|
|
19197
|
+
* Context to provide the current tile to child components.
|
|
19198
|
+
*/
|
|
19199
|
+
var TileContext = /*#__PURE__*/React.createContext(null);
|
|
19200
|
+
/**
|
|
19201
|
+
* Custom hook to access the TileContext.
|
|
19202
|
+
*/
|
|
19239
19203
|
var useTileContext = function () {
|
|
19240
|
-
var context = React
|
|
19204
|
+
var context = React.useContext(TileContext);
|
|
19241
19205
|
if (!context) {
|
|
19242
19206
|
throw new Error('Tile components must be used within a BaseTile');
|
|
19243
19207
|
}
|
|
19244
19208
|
return context;
|
|
19245
19209
|
};
|
|
19246
|
-
|
|
19247
|
-
|
|
19248
|
-
|
|
19249
|
-
return /*#__PURE__*/React$1.createElement(TileContext.Provider, {
|
|
19250
|
-
value: tile
|
|
19251
|
-
}, /*#__PURE__*/React$1.createElement(BaseTile.Root, null, children));
|
|
19252
|
-
};
|
|
19210
|
+
/**
|
|
19211
|
+
* BaseTileRoot component to handle layout and pressable behavior.
|
|
19212
|
+
*/
|
|
19253
19213
|
var BaseTileRoot = function (_a) {
|
|
19254
19214
|
var children = _a.children,
|
|
19255
19215
|
style = _a.style;
|
|
@@ -19261,13 +19221,14 @@ var BaseTileRoot = function (_a) {
|
|
|
19261
19221
|
ctaLinkTarget = _b.ctaLinkTarget,
|
|
19262
19222
|
title = _b.title;
|
|
19263
19223
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19224
|
+
// Dynamic layout and styles
|
|
19264
19225
|
var layout = {
|
|
19265
19226
|
flexDirection: 'column',
|
|
19266
19227
|
justifyContent: isHalfSize ? 'center' : 'flex-start',
|
|
19267
19228
|
alignItems: 'stretch'
|
|
19268
19229
|
};
|
|
19269
19230
|
var dynamicStyles = useBaseTileStyles();
|
|
19270
|
-
return /*#__PURE__*/React
|
|
19231
|
+
return /*#__PURE__*/React.createElement(Pressable$1, {
|
|
19271
19232
|
style: function (_a) {
|
|
19272
19233
|
var pressed = _a.pressed;
|
|
19273
19234
|
return [baseStyles.container, dynamicStyles.container, {
|
|
@@ -19282,13 +19243,27 @@ var BaseTileRoot = function (_a) {
|
|
|
19282
19243
|
accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : '')
|
|
19283
19244
|
}, children);
|
|
19284
19245
|
};
|
|
19285
|
-
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19246
|
+
/**
|
|
19247
|
+
* BaseTileInner component to provide context and render children.
|
|
19248
|
+
*/
|
|
19249
|
+
var BaseTileInner = function (_a) {
|
|
19250
|
+
var tile = _a.tile,
|
|
19251
|
+
children = _a.children;
|
|
19252
|
+
return /*#__PURE__*/React.createElement(TileContext.Provider, {
|
|
19253
|
+
value: tile
|
|
19254
|
+
}, /*#__PURE__*/React.createElement(BaseTile.Root, null, children));
|
|
19255
|
+
};
|
|
19256
|
+
/**
|
|
19257
|
+
* BaseTile component with subcomponents attached.
|
|
19258
|
+
*/
|
|
19259
|
+
var BaseTile = Object.assign(BaseTileInner, {
|
|
19260
|
+
Root: BaseTileRoot,
|
|
19261
|
+
Media: BaseTileMedia,
|
|
19262
|
+
Content: BaseTileContent,
|
|
19263
|
+
Header: BaseTileHeader,
|
|
19264
|
+
Title: BaseTileTitle,
|
|
19265
|
+
Body: BaseTileBody
|
|
19266
|
+
});
|
|
19292
19267
|
|
|
19293
19268
|
var Indicator = function () {
|
|
19294
19269
|
var _a = useResponsive$1(),
|
|
@@ -19299,9 +19274,9 @@ var Indicator = function () {
|
|
|
19299
19274
|
if (isTablet) return 'Tablet Layout';
|
|
19300
19275
|
return 'Mobile Layout';
|
|
19301
19276
|
};
|
|
19302
|
-
return /*#__PURE__*/React
|
|
19277
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19303
19278
|
style: styles$5.indicator
|
|
19304
|
-
}, /*#__PURE__*/React
|
|
19279
|
+
}, /*#__PURE__*/React.createElement(Text$3, {
|
|
19305
19280
|
style: styles$5.indicatorText
|
|
19306
19281
|
}, getCurrentLayout()));
|
|
19307
19282
|
};
|
|
@@ -19449,16 +19424,16 @@ function withTileFetching(WrappedComponent) {
|
|
|
19449
19424
|
var tile = props.tile,
|
|
19450
19425
|
tileId = props.tileId;
|
|
19451
19426
|
var getTileByID = useWllSdk().getTileByID;
|
|
19452
|
-
var _a = React
|
|
19427
|
+
var _a = React.useState(tile || null),
|
|
19453
19428
|
tileData = _a[0],
|
|
19454
19429
|
setTileData = _a[1];
|
|
19455
|
-
var _b = React
|
|
19430
|
+
var _b = React.useState(false),
|
|
19456
19431
|
isLoading = _b[0],
|
|
19457
19432
|
setIsLoading = _b[1];
|
|
19458
|
-
var _c = React
|
|
19433
|
+
var _c = React.useState(null),
|
|
19459
19434
|
error = _c[0],
|
|
19460
19435
|
setError = _c[1];
|
|
19461
|
-
React
|
|
19436
|
+
React.useEffect(function () {
|
|
19462
19437
|
if (tile) {
|
|
19463
19438
|
setTileData(tile);
|
|
19464
19439
|
} else if (tileId) {
|
|
@@ -19498,18 +19473,18 @@ function withTileFetching(WrappedComponent) {
|
|
|
19498
19473
|
}
|
|
19499
19474
|
}, [tile, tileId, getTileByID]);
|
|
19500
19475
|
if (isLoading) {
|
|
19501
|
-
return /*#__PURE__*/React
|
|
19476
|
+
return /*#__PURE__*/React.createElement(SkeletonTile, {
|
|
19502
19477
|
style: {
|
|
19503
19478
|
width: '100%'
|
|
19504
19479
|
}
|
|
19505
19480
|
});
|
|
19506
19481
|
}
|
|
19507
19482
|
if (error || !tileData) {
|
|
19508
|
-
return /*#__PURE__*/React
|
|
19483
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19509
19484
|
style: commonStyles.emptyContainer
|
|
19510
|
-
}, /*#__PURE__*/React
|
|
19485
|
+
}, /*#__PURE__*/React.createElement(Text$3, null, "No tile data available"));
|
|
19511
19486
|
}
|
|
19512
|
-
return /*#__PURE__*/React
|
|
19487
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
|
|
19513
19488
|
tile: tileData
|
|
19514
19489
|
}));
|
|
19515
19490
|
};
|
|
@@ -19577,21 +19552,28 @@ var BadgeTileDateEarned = function () {
|
|
|
19577
19552
|
var containerStyle = [styles.dateEarnedContainer, {
|
|
19578
19553
|
backgroundColor: backgroundColor
|
|
19579
19554
|
}];
|
|
19555
|
+
var textColor = getReadableTextColor(backgroundColor);
|
|
19580
19556
|
if (type === exports.BadgeTileType.Latest && count === 0) {
|
|
19581
19557
|
return null;
|
|
19582
19558
|
}
|
|
19583
19559
|
if (count === 0) {
|
|
19584
|
-
return /*#__PURE__*/React
|
|
19560
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19585
19561
|
style: containerStyle
|
|
19586
|
-
}, /*#__PURE__*/React
|
|
19587
|
-
variant: "label"
|
|
19562
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19563
|
+
variant: "label",
|
|
19564
|
+
style: {
|
|
19565
|
+
color: textColor
|
|
19566
|
+
}
|
|
19588
19567
|
}, badgeNotEarnedMessage));
|
|
19589
19568
|
}
|
|
19590
19569
|
var formattedDate = new Date(createdAt).toLocaleDateString();
|
|
19591
|
-
return /*#__PURE__*/React
|
|
19570
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19592
19571
|
style: containerStyle
|
|
19593
|
-
}, /*#__PURE__*/React
|
|
19594
|
-
variant: "label"
|
|
19572
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19573
|
+
variant: "label",
|
|
19574
|
+
style: {
|
|
19575
|
+
color: textColor
|
|
19576
|
+
}
|
|
19595
19577
|
}, "".concat(awardedDatePrefix, " ").concat(formattedDate)));
|
|
19596
19578
|
};
|
|
19597
19579
|
|
|
@@ -19601,7 +19583,7 @@ var BadgeTileDescription = function () {
|
|
|
19601
19583
|
var count = configuration.count,
|
|
19602
19584
|
description = configuration.description;
|
|
19603
19585
|
if (count === 0 || !description) return null;
|
|
19604
|
-
return /*#__PURE__*/React
|
|
19586
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
19605
19587
|
variant: "body",
|
|
19606
19588
|
numberOfLines: 2,
|
|
19607
19589
|
ellipsizeMode: "tail"
|
|
@@ -19620,9 +19602,9 @@ var BadgeTileMedia = function (_a) {
|
|
|
19620
19602
|
emptyBadgeArtworkUrl = configuration.emptyBadgeArtworkUrl;
|
|
19621
19603
|
var displayUrl = count === 0 ? emptyBadgeArtworkUrl : artworkUrl;
|
|
19622
19604
|
if (!displayUrl) return null;
|
|
19623
|
-
return /*#__PURE__*/React
|
|
19605
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19624
19606
|
style: styles.header
|
|
19625
|
-
}, /*#__PURE__*/React
|
|
19607
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
|
|
19626
19608
|
source: {
|
|
19627
19609
|
uri: displayUrl
|
|
19628
19610
|
},
|
|
@@ -19641,12 +19623,12 @@ var BadgeTileStatus = function () {
|
|
|
19641
19623
|
if (type !== exports.BadgeTileType.Specific || count === 1) {
|
|
19642
19624
|
return null;
|
|
19643
19625
|
}
|
|
19644
|
-
return /*#__PURE__*/React
|
|
19626
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19645
19627
|
style: styles.indicatorContainer
|
|
19646
|
-
}, count === 0 ? /*#__PURE__*/React
|
|
19628
|
+
}, count === 0 ? /*#__PURE__*/React.createElement(LucideIcons.LockKeyholeIcon, {
|
|
19647
19629
|
color: "#FFF",
|
|
19648
19630
|
size: 20
|
|
19649
|
-
}) : /*#__PURE__*/React
|
|
19631
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
19650
19632
|
style: styles.countText
|
|
19651
19633
|
}, count, "x"));
|
|
19652
19634
|
};
|
|
@@ -19660,7 +19642,7 @@ var BadgeTileTitle = function () {
|
|
|
19660
19642
|
emptyBadgeMessage = configuration.emptyBadgeMessage;
|
|
19661
19643
|
var displayText = count === 0 ? emptyBadgeMessage : name;
|
|
19662
19644
|
if (!displayText) return null;
|
|
19663
|
-
return /*#__PURE__*/React
|
|
19645
|
+
return /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(Text, {
|
|
19664
19646
|
variant: "title",
|
|
19665
19647
|
style: styles.titleText,
|
|
19666
19648
|
numberOfLines: count === 0 ? 2 : 1,
|
|
@@ -19668,22 +19650,31 @@ var BadgeTileTitle = function () {
|
|
|
19668
19650
|
}, displayText));
|
|
19669
19651
|
};
|
|
19670
19652
|
|
|
19671
|
-
|
|
19653
|
+
/**
|
|
19654
|
+
* The main BadgeTile component.
|
|
19655
|
+
*
|
|
19656
|
+
* This component renders a badge tile with optional media, status, title, description, and date earned.
|
|
19657
|
+
*/
|
|
19658
|
+
var BadgeTileRoot = function (_a) {
|
|
19672
19659
|
var tile = _a.tile;
|
|
19673
19660
|
if (!tile) return null;
|
|
19674
|
-
return /*#__PURE__*/React
|
|
19661
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
19675
19662
|
tile: tile
|
|
19676
|
-
}, /*#__PURE__*/React
|
|
19663
|
+
}, /*#__PURE__*/React.createElement(BadgeTile.Media, null, /*#__PURE__*/React.createElement(BadgeTile.Status, null)), /*#__PURE__*/React.createElement(Layout, {
|
|
19677
19664
|
justify: "between",
|
|
19678
19665
|
align: "start"
|
|
19679
|
-
}, /*#__PURE__*/React
|
|
19666
|
+
}, /*#__PURE__*/React.createElement(BadgeTile.Title, null), /*#__PURE__*/React.createElement(BadgeTile.Description, null), /*#__PURE__*/React.createElement(Spacer, null), /*#__PURE__*/React.createElement(BadgeTile.DateEarned, null)));
|
|
19680
19667
|
};
|
|
19681
|
-
|
|
19682
|
-
BadgeTile
|
|
19683
|
-
|
|
19684
|
-
BadgeTile
|
|
19685
|
-
|
|
19686
|
-
|
|
19668
|
+
/**
|
|
19669
|
+
* The BadgeTile component with subcomponents attached.
|
|
19670
|
+
*/
|
|
19671
|
+
var BadgeTile = Object.assign(BadgeTileRoot, {
|
|
19672
|
+
Media: BadgeTileMedia,
|
|
19673
|
+
Title: BadgeTileTitle,
|
|
19674
|
+
Description: BadgeTileDescription,
|
|
19675
|
+
DateEarned: BadgeTileDateEarned,
|
|
19676
|
+
Status: BadgeTileStatus
|
|
19677
|
+
});
|
|
19687
19678
|
var BadgeTile$1 = withTileFetching(BadgeTile);
|
|
19688
19679
|
|
|
19689
19680
|
var BannerTileCTA = function () {
|
|
@@ -19694,7 +19685,7 @@ var BannerTileCTA = function () {
|
|
|
19694
19685
|
ctaLinkTarget = _a.ctaLinkTarget;
|
|
19695
19686
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19696
19687
|
if (!ctaText) return null;
|
|
19697
|
-
return /*#__PURE__*/React
|
|
19688
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
19698
19689
|
title: ctaText,
|
|
19699
19690
|
variant: "accent",
|
|
19700
19691
|
onPress: handlePress
|
|
@@ -19743,7 +19734,7 @@ var BannerTileDescription = function () {
|
|
|
19743
19734
|
var description = configuration.description;
|
|
19744
19735
|
var theme = useWllSdk().theme;
|
|
19745
19736
|
if (!description) return null;
|
|
19746
|
-
return /*#__PURE__*/React
|
|
19737
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
19747
19738
|
style: [styles.description, {
|
|
19748
19739
|
color: theme.derivedSurfaceText[20]
|
|
19749
19740
|
}]
|
|
@@ -19762,9 +19753,9 @@ var BannerTileMedia = function (_a) {
|
|
|
19762
19753
|
return (
|
|
19763
19754
|
/*#__PURE__*/
|
|
19764
19755
|
// @ts-ignore: We are using percentage values for width, which is valid in React Native but TypeScript expects a number.
|
|
19765
|
-
React
|
|
19756
|
+
React.createElement(View$2, {
|
|
19766
19757
|
style: [styles.mediaContainer, containerStyle]
|
|
19767
|
-
}, /*#__PURE__*/React
|
|
19758
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
19768
19759
|
source: {
|
|
19769
19760
|
uri: artworkUrl
|
|
19770
19761
|
},
|
|
@@ -19778,33 +19769,50 @@ var BannerTileTitle = function () {
|
|
|
19778
19769
|
var configuration = useBannerContext().configuration;
|
|
19779
19770
|
var title = configuration.title;
|
|
19780
19771
|
if (!title) return null;
|
|
19781
|
-
return /*#__PURE__*/React
|
|
19772
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
19782
19773
|
variant: "title",
|
|
19783
19774
|
style: styles.title
|
|
19784
19775
|
}, title);
|
|
19785
19776
|
};
|
|
19786
19777
|
|
|
19787
|
-
|
|
19778
|
+
/**
|
|
19779
|
+
* Helper function to determine if the tile is artwork-only.
|
|
19780
|
+
*
|
|
19781
|
+
* @param configuration - The configuration object of the tile.
|
|
19782
|
+
* @returns `true` if the tile has no title, description, or CTA text.
|
|
19783
|
+
*/
|
|
19784
|
+
var isArtworkOnly$1 = function (configuration) {
|
|
19785
|
+
return !configuration.title && !configuration.description && !configuration.ctaText;
|
|
19786
|
+
};
|
|
19787
|
+
/**
|
|
19788
|
+
* The main BannerTile component.
|
|
19789
|
+
*
|
|
19790
|
+
* This component renders a banner tile with optional media, title, description, and CTA.
|
|
19791
|
+
*/
|
|
19792
|
+
var BannerTileRoot = function (_a) {
|
|
19788
19793
|
var tile = _a.tile;
|
|
19789
|
-
|
|
19794
|
+
if (!tile) return null;
|
|
19795
|
+
useBannerTileStyles();
|
|
19790
19796
|
var configuration = tile.configuration;
|
|
19791
|
-
|
|
19792
|
-
return /*#__PURE__*/React__namespace.createElement(BaseBanner, {
|
|
19797
|
+
return /*#__PURE__*/React.createElement(BaseBanner, {
|
|
19793
19798
|
tile: tile
|
|
19794
|
-
}, /*#__PURE__*/
|
|
19795
|
-
isArtworkOnly: isArtworkOnly
|
|
19796
|
-
}), /*#__PURE__*/
|
|
19797
|
-
style: styles.slideContent
|
|
19798
|
-
}, /*#__PURE__*/React__namespace.createElement(BannerTile.Title, null), /*#__PURE__*/React__namespace.createElement(BannerTile.Description, null), /*#__PURE__*/React__namespace.createElement(BannerTile.CTA, null)));
|
|
19799
|
+
}, /*#__PURE__*/React.createElement(BannerTile.Media, {
|
|
19800
|
+
isArtworkOnly: isArtworkOnly$1(configuration)
|
|
19801
|
+
}), /*#__PURE__*/React.createElement(FlexBox, null, /*#__PURE__*/React.createElement(BannerTile.Title, null), /*#__PURE__*/React.createElement(BannerTile.Description, null), /*#__PURE__*/React.createElement(BannerTile.CTA, null)));
|
|
19799
19802
|
};
|
|
19800
|
-
|
|
19801
|
-
BannerTile
|
|
19802
|
-
|
|
19803
|
-
BannerTile
|
|
19803
|
+
/**
|
|
19804
|
+
* The BannerTile component with subcomponents attached.
|
|
19805
|
+
*/
|
|
19806
|
+
var BannerTile = Object.assign(BannerTileRoot, {
|
|
19807
|
+
Media: BannerTileMedia,
|
|
19808
|
+
Title: BannerTileTitle,
|
|
19809
|
+
Description: BannerTileDescription,
|
|
19810
|
+
CTA: BannerTileCTA
|
|
19811
|
+
});
|
|
19804
19812
|
var BannerTile$1 = withTileFetching(BannerTile);
|
|
19805
19813
|
|
|
19806
19814
|
var ContentTileBody = function () {
|
|
19807
|
-
return /*#__PURE__*/React
|
|
19815
|
+
return /*#__PURE__*/React.createElement(BaseTile.Body, null);
|
|
19808
19816
|
};
|
|
19809
19817
|
|
|
19810
19818
|
var useContentTileStyles = function () {
|
|
@@ -19827,7 +19835,7 @@ var useContentTileStyles = function () {
|
|
|
19827
19835
|
var ContentTileContent = function (_a) {
|
|
19828
19836
|
var children = _a.children;
|
|
19829
19837
|
var styles = useContentTileStyles();
|
|
19830
|
-
return /*#__PURE__*/React
|
|
19838
|
+
return /*#__PURE__*/React.createElement(BaseTile.Content, null, /*#__PURE__*/React.createElement(View$2, {
|
|
19831
19839
|
style: styles.content
|
|
19832
19840
|
}, children));
|
|
19833
19841
|
};
|
|
@@ -19836,33 +19844,43 @@ var ContentTileHeader = function () {
|
|
|
19836
19844
|
var tile = useTileContext();
|
|
19837
19845
|
var title = tile.configuration.title;
|
|
19838
19846
|
if (!title) return null;
|
|
19839
|
-
return /*#__PURE__*/React
|
|
19847
|
+
return /*#__PURE__*/React.createElement(BaseTile.Header, null, /*#__PURE__*/React.createElement(BaseTile.Title, null));
|
|
19840
19848
|
};
|
|
19841
19849
|
|
|
19842
19850
|
var ContentTileMedia = function () {
|
|
19843
19851
|
var styles = useContentTileStyles();
|
|
19844
|
-
return /*#__PURE__*/React
|
|
19852
|
+
return /*#__PURE__*/React.createElement(BaseTile.Media, {
|
|
19845
19853
|
style: styles.media
|
|
19846
19854
|
});
|
|
19847
19855
|
};
|
|
19848
19856
|
|
|
19849
19857
|
var ContentTileRoot = function (_a) {
|
|
19850
19858
|
var children = _a.children;
|
|
19851
|
-
return /*#__PURE__*/React
|
|
19859
|
+
return /*#__PURE__*/React.createElement(BaseTile.Root, null, children);
|
|
19852
19860
|
};
|
|
19853
19861
|
|
|
19862
|
+
/**
|
|
19863
|
+
* The ContentTile component renders a tile with a root, media, content, header, and body.
|
|
19864
|
+
*
|
|
19865
|
+
* @param tile - The tile data to render.
|
|
19866
|
+
*/
|
|
19854
19867
|
var ContentTileMain = function (_a) {
|
|
19855
19868
|
var tile = _a.tile;
|
|
19856
|
-
|
|
19869
|
+
if (!tile) return null;
|
|
19870
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
19857
19871
|
tile: tile
|
|
19858
|
-
}, /*#__PURE__*/React
|
|
19872
|
+
}, /*#__PURE__*/React.createElement(ContentTile.Root, 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))));
|
|
19859
19873
|
};
|
|
19860
|
-
|
|
19861
|
-
ContentTile
|
|
19862
|
-
|
|
19863
|
-
ContentTile
|
|
19864
|
-
|
|
19865
|
-
|
|
19874
|
+
/**
|
|
19875
|
+
* The ContentTile component with subcomponents attached.
|
|
19876
|
+
*/
|
|
19877
|
+
var ContentTile = Object.assign(ContentTileMain, {
|
|
19878
|
+
Root: ContentTileRoot,
|
|
19879
|
+
Media: ContentTileMedia,
|
|
19880
|
+
Content: ContentTileContent,
|
|
19881
|
+
Header: ContentTileHeader,
|
|
19882
|
+
Body: ContentTileBody
|
|
19883
|
+
});
|
|
19866
19884
|
var ContentTile$1 = withTileFetching(ContentTile);
|
|
19867
19885
|
|
|
19868
19886
|
/**
|
|
@@ -19898,10 +19916,10 @@ exports.SectionType = void 0;
|
|
|
19898
19916
|
*/
|
|
19899
19917
|
|
|
19900
19918
|
function useWindowDimensions() {
|
|
19901
|
-
var _useState = React
|
|
19919
|
+
var _useState = React.useState(() => Dimensions.get('window')),
|
|
19902
19920
|
dims = _useState[0],
|
|
19903
19921
|
setDims = _useState[1];
|
|
19904
|
-
React
|
|
19922
|
+
React.useEffect(() => {
|
|
19905
19923
|
function handleChange(_ref) {
|
|
19906
19924
|
var window = _ref.window;
|
|
19907
19925
|
if (window != null) {
|
|
@@ -19950,14 +19968,14 @@ var SectionHeader = function (_a) {
|
|
|
19950
19968
|
if (!title) {
|
|
19951
19969
|
return null;
|
|
19952
19970
|
}
|
|
19953
|
-
return /*#__PURE__*/React
|
|
19971
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19954
19972
|
style: styles.sectionHeader
|
|
19955
|
-
}, title && /*#__PURE__*/React
|
|
19973
|
+
}, title && /*#__PURE__*/React.createElement(Text, {
|
|
19956
19974
|
style: [styles.sectionTitle, {
|
|
19957
19975
|
fontWeight: '700',
|
|
19958
19976
|
color: theme.text
|
|
19959
19977
|
}]
|
|
19960
|
-
}, title), description && /*#__PURE__*/React
|
|
19978
|
+
}, title), description && /*#__PURE__*/React.createElement(Text, {
|
|
19961
19979
|
style: [styles.sectionDescription, {
|
|
19962
19980
|
color: theme.alphaDerivedText[80]
|
|
19963
19981
|
}]
|
|
@@ -20043,52 +20061,85 @@ var useCarouselStyles = function (buttonSize) {
|
|
|
20043
20061
|
});
|
|
20044
20062
|
};
|
|
20045
20063
|
|
|
20064
|
+
var initialState = {
|
|
20065
|
+
currentIndex: 0,
|
|
20066
|
+
containerWidth: 0
|
|
20067
|
+
};
|
|
20068
|
+
var carouselReducer = function (state, action) {
|
|
20069
|
+
switch (action.type) {
|
|
20070
|
+
case 'SET_CONTAINER_WIDTH':
|
|
20071
|
+
return __assign(__assign({}, state), {
|
|
20072
|
+
containerWidth: action.payload
|
|
20073
|
+
});
|
|
20074
|
+
case 'SET_CURRENT_INDEX':
|
|
20075
|
+
return __assign(__assign({}, state), {
|
|
20076
|
+
currentIndex: action.payload
|
|
20077
|
+
});
|
|
20078
|
+
case 'PREV_SLIDE':
|
|
20079
|
+
return __assign(__assign({}, state), {
|
|
20080
|
+
currentIndex: Math.max(0, state.currentIndex - 1)
|
|
20081
|
+
});
|
|
20082
|
+
case 'NEXT_SLIDE':
|
|
20083
|
+
return __assign(__assign({}, state), {
|
|
20084
|
+
currentIndex: Math.min(action.maxIndex, state.currentIndex + 1)
|
|
20085
|
+
});
|
|
20086
|
+
default:
|
|
20087
|
+
return state;
|
|
20088
|
+
}
|
|
20089
|
+
};
|
|
20046
20090
|
var Carousel = function (_a) {
|
|
20047
20091
|
var section = _a.section;
|
|
20048
|
-
var
|
|
20049
|
-
var containerRef = React
|
|
20050
|
-
var _b = React$1.useState(windowWidth),
|
|
20051
|
-
containerWidth = _b[0],
|
|
20052
|
-
setContainerWidth = _b[1];
|
|
20092
|
+
var WINDOW_WIDTH = useWindowDimensions().width;
|
|
20093
|
+
var containerRef = React.useRef(null);
|
|
20053
20094
|
var styles = useCarouselStyles(BUTTON_SIZE);
|
|
20054
|
-
var animatedIndex = React
|
|
20095
|
+
var animatedIndex = React.useRef(new Animated$1.Value(0)).current;
|
|
20055
20096
|
var theme = useWllSdk().theme;
|
|
20056
|
-
var
|
|
20057
|
-
isDesktop =
|
|
20058
|
-
isTablet =
|
|
20059
|
-
var scrollViewRef = React
|
|
20060
|
-
var
|
|
20061
|
-
|
|
20062
|
-
|
|
20097
|
+
var _b = useResponsive(),
|
|
20098
|
+
isDesktop = _b.isDesktop,
|
|
20099
|
+
isTablet = _b.isTablet;
|
|
20100
|
+
var scrollViewRef = React.useRef(null);
|
|
20101
|
+
var _c = React.useReducer(carouselReducer, __assign(__assign({}, initialState), {
|
|
20102
|
+
containerWidth: WINDOW_WIDTH
|
|
20103
|
+
})),
|
|
20104
|
+
state = _c[0],
|
|
20105
|
+
dispatch = _c[1];
|
|
20106
|
+
var currentIndex = state.currentIndex,
|
|
20107
|
+
containerWidth = state.containerWidth;
|
|
20063
20108
|
var bannerTiles = section.tiles.filter(function (tile) {
|
|
20064
20109
|
return tile.type === exports.TileType.Banner;
|
|
20065
20110
|
});
|
|
20066
20111
|
var sortedTiles = sortByPriority(bannerTiles);
|
|
20067
|
-
var handleScroll = React
|
|
20112
|
+
var handleScroll = React.useCallback(function (event) {
|
|
20068
20113
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
20069
20114
|
var newIndex = contentOffsetX / containerWidth;
|
|
20070
20115
|
animatedIndex.setValue(newIndex);
|
|
20071
20116
|
}, [containerWidth, animatedIndex]);
|
|
20072
|
-
var handleScrollEnd = React
|
|
20117
|
+
var handleScrollEnd = React.useCallback(function (event) {
|
|
20073
20118
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
20074
20119
|
var newIndex = Math.round(contentOffsetX / containerWidth);
|
|
20075
|
-
|
|
20120
|
+
dispatch({
|
|
20121
|
+
type: 'SET_CURRENT_INDEX',
|
|
20122
|
+
payload: newIndex
|
|
20123
|
+
});
|
|
20076
20124
|
}, [containerWidth]);
|
|
20077
20125
|
var handlePrev = function () {
|
|
20078
20126
|
var _a;
|
|
20079
|
-
|
|
20080
|
-
|
|
20127
|
+
dispatch({
|
|
20128
|
+
type: 'PREV_SLIDE'
|
|
20129
|
+
});
|
|
20081
20130
|
(_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
20082
|
-
x:
|
|
20131
|
+
x: (currentIndex - 1) * containerWidth,
|
|
20083
20132
|
animated: true
|
|
20084
20133
|
});
|
|
20085
20134
|
};
|
|
20086
20135
|
var handleNext = function () {
|
|
20087
20136
|
var _a;
|
|
20088
|
-
|
|
20089
|
-
|
|
20137
|
+
dispatch({
|
|
20138
|
+
type: 'NEXT_SLIDE',
|
|
20139
|
+
maxIndex: sortedTiles.length - 1
|
|
20140
|
+
});
|
|
20090
20141
|
(_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
20091
|
-
x:
|
|
20142
|
+
x: (currentIndex + 1) * containerWidth,
|
|
20092
20143
|
animated: true
|
|
20093
20144
|
});
|
|
20094
20145
|
};
|
|
@@ -20102,28 +20153,31 @@ var Carousel = function (_a) {
|
|
|
20102
20153
|
marginTop: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet)
|
|
20103
20154
|
}
|
|
20104
20155
|
});
|
|
20105
|
-
return /*#__PURE__*/React
|
|
20156
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionHeader, {
|
|
20106
20157
|
title: section.title,
|
|
20107
20158
|
description: section.description
|
|
20108
|
-
}), /*#__PURE__*/React
|
|
20159
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20109
20160
|
ref: containerRef,
|
|
20110
20161
|
style: styles.container,
|
|
20111
20162
|
onLayout: function (event) {
|
|
20112
20163
|
var width = event.nativeEvent.layout.width;
|
|
20113
|
-
|
|
20164
|
+
dispatch({
|
|
20165
|
+
type: 'SET_CONTAINER_WIDTH',
|
|
20166
|
+
payload: width
|
|
20167
|
+
});
|
|
20114
20168
|
}
|
|
20115
|
-
}, /*#__PURE__*/React
|
|
20169
|
+
}, /*#__PURE__*/React.createElement(View$2, {
|
|
20116
20170
|
style: styles.carouselContainer
|
|
20117
|
-
}, showPrevButton && /*#__PURE__*/React
|
|
20171
|
+
}, showPrevButton && /*#__PURE__*/React.createElement(TouchableOpacity$1, {
|
|
20118
20172
|
style: [styles.navButton, styles.navButtonLeft, {
|
|
20119
20173
|
backgroundColor: theme.background
|
|
20120
20174
|
}],
|
|
20121
20175
|
onPress: handlePrev
|
|
20122
|
-
}, /*#__PURE__*/React
|
|
20176
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20123
20177
|
name: "ArrowLeft",
|
|
20124
20178
|
size: 20,
|
|
20125
20179
|
color: theme.primary
|
|
20126
|
-
})), /*#__PURE__*/React
|
|
20180
|
+
})), /*#__PURE__*/React.createElement(ScrollView$2, {
|
|
20127
20181
|
ref: scrollViewRef,
|
|
20128
20182
|
horizontal: true,
|
|
20129
20183
|
pagingEnabled: true,
|
|
@@ -20139,24 +20193,24 @@ var Carousel = function (_a) {
|
|
|
20139
20193
|
snapToInterval: containerWidth,
|
|
20140
20194
|
snapToAlignment: "start"
|
|
20141
20195
|
}, sortedTiles.map(function (tile, index) {
|
|
20142
|
-
return /*#__PURE__*/React
|
|
20196
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20143
20197
|
key: index,
|
|
20144
20198
|
style: [styles.slideContainer, {
|
|
20145
20199
|
width: containerWidth
|
|
20146
20200
|
}]
|
|
20147
|
-
}, /*#__PURE__*/React
|
|
20201
|
+
}, /*#__PURE__*/React.createElement(BannerTile$1, {
|
|
20148
20202
|
tile: tile
|
|
20149
20203
|
}));
|
|
20150
|
-
})), showNextButton && /*#__PURE__*/React
|
|
20204
|
+
})), showNextButton && /*#__PURE__*/React.createElement(TouchableOpacity$1, {
|
|
20151
20205
|
style: [styles.navButton, styles.navButtonRight, {
|
|
20152
20206
|
backgroundColor: theme.surface
|
|
20153
20207
|
}],
|
|
20154
20208
|
onPress: handleNext
|
|
20155
|
-
}, /*#__PURE__*/React
|
|
20209
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20156
20210
|
name: "ArrowRight",
|
|
20157
20211
|
size: 20,
|
|
20158
20212
|
color: theme.primary
|
|
20159
|
-
}))), displayControls && /*#__PURE__*/React
|
|
20213
|
+
}))), displayControls && /*#__PURE__*/React.createElement(View$2, {
|
|
20160
20214
|
style: dynamicStyles.indicators
|
|
20161
20215
|
}, sortedTiles.map(function (_, index) {
|
|
20162
20216
|
var width = animatedIndex.interpolate({
|
|
@@ -20164,7 +20218,7 @@ var Carousel = function (_a) {
|
|
|
20164
20218
|
outputRange: [8, 30, 8],
|
|
20165
20219
|
extrapolate: 'clamp'
|
|
20166
20220
|
});
|
|
20167
|
-
return /*#__PURE__*/React
|
|
20221
|
+
return /*#__PURE__*/React.createElement(Animated$1.View, {
|
|
20168
20222
|
key: index,
|
|
20169
20223
|
style: [styles.indicator, {
|
|
20170
20224
|
backgroundColor: theme.derivedBackground,
|
|
@@ -20180,43 +20234,30 @@ var Grid = function (_a) {
|
|
|
20180
20234
|
var section = _a.section;
|
|
20181
20235
|
var isDesktop = useResponsive().isDesktop;
|
|
20182
20236
|
var columnsPerRow = isDesktop ? 4 : 2;
|
|
20183
|
-
var
|
|
20184
|
-
|
|
20185
|
-
var currentTiles = [];
|
|
20186
|
-
var gridTiles = section.tiles.filter(function (tile) {
|
|
20237
|
+
var gridTiles = React.useMemo(function () {
|
|
20238
|
+
return sortByPriority(section.tiles.filter(function (tile) {
|
|
20187
20239
|
return tile.type !== exports.TileType.Banner;
|
|
20188
|
-
})
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
return section.tiles.indexOf(a) - section.tiles.indexOf(b);
|
|
20193
|
-
});
|
|
20194
|
-
var allHalfTiles = gridTiles.every(function (tile) {
|
|
20195
|
-
return tile.tileHeight === exports.TileHeight.Half;
|
|
20196
|
-
});
|
|
20197
|
-
var getTileWidth = function (columns) {
|
|
20240
|
+
}));
|
|
20241
|
+
}, [section.tiles]);
|
|
20242
|
+
var getTileWidth = React.useCallback(function (columns) {
|
|
20243
|
+
if (IS_WEB) {
|
|
20198
20244
|
return {
|
|
20199
20245
|
width: "calc(".concat(100 / columns, "% - ").concat((columns - 1) * GRID_GAP / columns, "px)"),
|
|
20200
20246
|
marginBottom: GRID_GAP,
|
|
20201
20247
|
height: 'auto'
|
|
20202
20248
|
};
|
|
20203
|
-
}
|
|
20204
|
-
|
|
20205
|
-
|
|
20206
|
-
|
|
20207
|
-
|
|
20208
|
-
|
|
20209
|
-
|
|
20210
|
-
// @ts-ignore
|
|
20211
|
-
getTileWidth(columnsPerRow), !isLastInRow && {
|
|
20212
|
-
marginRight: GRID_GAP
|
|
20213
|
-
}]
|
|
20214
|
-
}, /*#__PURE__*/React__namespace.createElement(TileContainer, {
|
|
20215
|
-
tiles: [tile]
|
|
20216
|
-
})));
|
|
20217
|
-
});
|
|
20218
|
-
return tileContainers;
|
|
20249
|
+
} else {
|
|
20250
|
+
var tileWidth = (SCREEN_WIDTH - (columns - 1) * GRID_GAP) / columns;
|
|
20251
|
+
return {
|
|
20252
|
+
width: tileWidth,
|
|
20253
|
+
marginBottom: GRID_GAP,
|
|
20254
|
+
height: 'auto'
|
|
20255
|
+
};
|
|
20219
20256
|
}
|
|
20257
|
+
}, []);
|
|
20258
|
+
var renderTileContainers = React.useCallback(function () {
|
|
20259
|
+
var tileContainers = [];
|
|
20260
|
+
var currentTiles = [];
|
|
20220
20261
|
var sortedTiles = sortByPriority(gridTiles);
|
|
20221
20262
|
sortedTiles.forEach(function (tile, index) {
|
|
20222
20263
|
currentTiles.push(tile);
|
|
@@ -20236,27 +20277,27 @@ var Grid = function (_a) {
|
|
|
20236
20277
|
};
|
|
20237
20278
|
if (shouldStartNewContainer(currentTiles, tile, nextTile)) {
|
|
20238
20279
|
var isLastInRow = (tileContainers.length + 1) % columnsPerRow === 0;
|
|
20239
|
-
tileContainers.push( /*#__PURE__*/
|
|
20280
|
+
tileContainers.push( /*#__PURE__*/React.createElement(View$2, {
|
|
20240
20281
|
key: "container-".concat(index),
|
|
20241
20282
|
style: [
|
|
20242
|
-
// @ts-ignore
|
|
20283
|
+
// @ts-ignore Web uses CSS calc strings for responsive layouts, while ViewStyle expects numbers
|
|
20243
20284
|
getTileWidth(columnsPerRow), !isLastInRow && {
|
|
20244
20285
|
marginRight: GRID_GAP
|
|
20245
20286
|
}]
|
|
20246
|
-
}, /*#__PURE__*/
|
|
20287
|
+
}, /*#__PURE__*/React.createElement(TileContainer, {
|
|
20247
20288
|
tiles: currentTiles
|
|
20248
20289
|
})));
|
|
20249
20290
|
currentTiles = [];
|
|
20250
20291
|
}
|
|
20251
20292
|
});
|
|
20252
20293
|
return tileContainers;
|
|
20253
|
-
};
|
|
20254
|
-
return /*#__PURE__*/
|
|
20294
|
+
}, [gridTiles, columnsPerRow, getTileWidth]);
|
|
20295
|
+
return /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(SectionHeader, {
|
|
20255
20296
|
title: section.title,
|
|
20256
20297
|
description: section.description
|
|
20257
|
-
}), /*#__PURE__*/
|
|
20298
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20258
20299
|
style: styles$2.grid
|
|
20259
|
-
},
|
|
20300
|
+
}, renderTileContainers()));
|
|
20260
20301
|
};
|
|
20261
20302
|
var styles$2 = StyleSheet$1.create({
|
|
20262
20303
|
grid: {
|
|
@@ -20340,22 +20381,25 @@ var useSectionStyles = function () {
|
|
|
20340
20381
|
});
|
|
20341
20382
|
};
|
|
20342
20383
|
|
|
20343
|
-
|
|
20344
|
-
|
|
20345
|
-
|
|
20346
|
-
|
|
20347
|
-
|
|
20384
|
+
/**
|
|
20385
|
+
* SectionContext provides the current section data to child components.
|
|
20386
|
+
*/
|
|
20387
|
+
var SectionContext = /*#__PURE__*/React.createContext(undefined);
|
|
20388
|
+
/**
|
|
20389
|
+
* Custom hook to fetch section data.
|
|
20390
|
+
*/
|
|
20391
|
+
var useSectionData = function (section, sectionId) {
|
|
20348
20392
|
var getSectionByID = useWllSdk().getSectionByID;
|
|
20349
|
-
var
|
|
20350
|
-
sectionData =
|
|
20351
|
-
setSectionData =
|
|
20352
|
-
var
|
|
20353
|
-
isLoading =
|
|
20354
|
-
setIsLoading =
|
|
20355
|
-
var
|
|
20356
|
-
error =
|
|
20357
|
-
setError =
|
|
20358
|
-
React
|
|
20393
|
+
var _a = React.useState(section || null),
|
|
20394
|
+
sectionData = _a[0],
|
|
20395
|
+
setSectionData = _a[1];
|
|
20396
|
+
var _b = React.useState(false),
|
|
20397
|
+
isLoading = _b[0],
|
|
20398
|
+
setIsLoading = _b[1];
|
|
20399
|
+
var _c = React.useState(null),
|
|
20400
|
+
error = _c[0],
|
|
20401
|
+
setError = _c[1];
|
|
20402
|
+
React.useEffect(function () {
|
|
20359
20403
|
if (section) {
|
|
20360
20404
|
setSectionData(section);
|
|
20361
20405
|
} else if (sectionId) {
|
|
@@ -20375,12 +20419,12 @@ var Section = function (_a) {
|
|
|
20375
20419
|
if (response.status === 'success' && response.data) {
|
|
20376
20420
|
setSectionData(response.data);
|
|
20377
20421
|
} else {
|
|
20378
|
-
setError(response.error || 'Failed to fetch section');
|
|
20422
|
+
setError(response.error || 'Failed to fetch section data.');
|
|
20379
20423
|
}
|
|
20380
20424
|
return [3 /*break*/, 5];
|
|
20381
20425
|
case 3:
|
|
20382
20426
|
err_1 = _a.sent();
|
|
20383
|
-
setError(err_1 instanceof Error ? err_1.message : 'Failed to fetch section');
|
|
20427
|
+
setError(err_1 instanceof Error ? err_1.message : 'Failed to fetch section data.');
|
|
20384
20428
|
return [3 /*break*/, 5];
|
|
20385
20429
|
case 4:
|
|
20386
20430
|
setIsLoading(false);
|
|
@@ -20394,95 +20438,151 @@ var Section = function (_a) {
|
|
|
20394
20438
|
fetchSection();
|
|
20395
20439
|
}
|
|
20396
20440
|
}, [section, sectionId, getSectionByID]);
|
|
20441
|
+
return {
|
|
20442
|
+
sectionData: sectionData,
|
|
20443
|
+
isLoading: isLoading,
|
|
20444
|
+
error: error
|
|
20445
|
+
};
|
|
20446
|
+
};
|
|
20447
|
+
/**
|
|
20448
|
+
* Component to display an empty state with a message.
|
|
20449
|
+
*/
|
|
20450
|
+
var EmptyState = function (_a) {
|
|
20451
|
+
var message = _a.message;
|
|
20452
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20453
|
+
style: commonStyles.emptyContainer
|
|
20454
|
+
}, /*#__PURE__*/React.createElement(Text$3, null, message));
|
|
20455
|
+
};
|
|
20456
|
+
/**
|
|
20457
|
+
* The Section component renders a section based on its type (e.g., Banner, Grid).
|
|
20458
|
+
*/
|
|
20459
|
+
var Section = function (_a) {
|
|
20460
|
+
var section = _a.section,
|
|
20461
|
+
sectionId = _a.sectionId;
|
|
20462
|
+
var styles = useSectionStyles();
|
|
20463
|
+
var _b = useSectionData(section, sectionId),
|
|
20464
|
+
sectionData = _b.sectionData,
|
|
20465
|
+
isLoading = _b.isLoading,
|
|
20466
|
+
error = _b.error;
|
|
20467
|
+
if (!section && !sectionId) {
|
|
20468
|
+
console.warn('Section component requires either section or sectionId prop.');
|
|
20469
|
+
return null;
|
|
20470
|
+
}
|
|
20397
20471
|
var renderSectionContent = function () {
|
|
20398
20472
|
if (isLoading) {
|
|
20399
|
-
return /*#__PURE__*/React
|
|
20473
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20400
20474
|
style: commonStyles.emptyContainer
|
|
20401
|
-
}, /*#__PURE__*/React
|
|
20475
|
+
}, /*#__PURE__*/React.createElement(Skeleton, null));
|
|
20402
20476
|
}
|
|
20403
20477
|
if (error || !sectionData) {
|
|
20404
|
-
return /*#__PURE__*/React
|
|
20405
|
-
|
|
20406
|
-
}
|
|
20478
|
+
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
20479
|
+
message: error || 'No section data available.'
|
|
20480
|
+
});
|
|
20407
20481
|
}
|
|
20408
20482
|
switch (sectionData.type) {
|
|
20409
20483
|
case exports.SectionType.Banner:
|
|
20410
|
-
return /*#__PURE__*/React
|
|
20484
|
+
return /*#__PURE__*/React.createElement(Carousel, {
|
|
20411
20485
|
section: sectionData
|
|
20412
20486
|
});
|
|
20413
20487
|
case exports.SectionType.Grid:
|
|
20414
|
-
return /*#__PURE__*/React
|
|
20488
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
20415
20489
|
section: sectionData
|
|
20416
20490
|
});
|
|
20417
20491
|
default:
|
|
20418
20492
|
console.warn("Unknown section type: ".concat(sectionData.type));
|
|
20419
|
-
return
|
|
20493
|
+
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
20494
|
+
message: "Unknown section type."
|
|
20495
|
+
});
|
|
20420
20496
|
}
|
|
20421
20497
|
};
|
|
20422
|
-
|
|
20423
|
-
console.warn('Section component requires either section or sectionId prop');
|
|
20424
|
-
return null;
|
|
20425
|
-
}
|
|
20426
|
-
return sectionData ? /*#__PURE__*/React$1.createElement(SectionContext.Provider, {
|
|
20498
|
+
return sectionData ? /*#__PURE__*/React.createElement(SectionContext.Provider, {
|
|
20427
20499
|
value: {
|
|
20428
20500
|
sectionData: sectionData
|
|
20429
20501
|
}
|
|
20430
|
-
}, /*#__PURE__*/React
|
|
20502
|
+
}, /*#__PURE__*/React.createElement(View$2, {
|
|
20431
20503
|
style: styles.section
|
|
20432
20504
|
}, renderSectionContent())) : null;
|
|
20433
20505
|
};
|
|
20434
20506
|
|
|
20507
|
+
/**
|
|
20508
|
+
* A page-level component that represents a Group view in the application.
|
|
20509
|
+
*
|
|
20510
|
+
* This component serves as a container page that manages the fetching and display
|
|
20511
|
+
* of a group's data and its associated sections. It handles various states including
|
|
20512
|
+
* loading, errors, and empty states, providing a complete page experience for
|
|
20513
|
+
* viewing group content.
|
|
20514
|
+
*
|
|
20515
|
+
* @param id - The unique identifier of the group to fetch and display.
|
|
20516
|
+
*/
|
|
20435
20517
|
var Group = function (_a) {
|
|
20436
20518
|
var id = _a.id;
|
|
20519
|
+
if (!id) return null;
|
|
20437
20520
|
var getGroupByID = useWllSdk().getGroupByID;
|
|
20438
|
-
var _b = React
|
|
20521
|
+
var _b = React.useState(null),
|
|
20439
20522
|
groupData = _b[0],
|
|
20440
20523
|
setGroupData = _b[1];
|
|
20441
|
-
var _c = React
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
React
|
|
20445
|
-
|
|
20446
|
-
|
|
20447
|
-
|
|
20448
|
-
|
|
20449
|
-
|
|
20450
|
-
|
|
20451
|
-
|
|
20452
|
-
|
|
20453
|
-
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
20457
|
-
|
|
20458
|
-
|
|
20459
|
-
|
|
20524
|
+
var _c = React.useState(null),
|
|
20525
|
+
error = _c[0],
|
|
20526
|
+
setError = _c[1];
|
|
20527
|
+
var fetchGroup = React.useCallback(function () {
|
|
20528
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
20529
|
+
var response;
|
|
20530
|
+
return __generator(this, function (_a) {
|
|
20531
|
+
switch (_a.label) {
|
|
20532
|
+
case 0:
|
|
20533
|
+
_a.trys.push([0, 2,, 3]);
|
|
20534
|
+
setError(null);
|
|
20535
|
+
return [4 /*yield*/, getGroupByID(id)];
|
|
20536
|
+
case 1:
|
|
20537
|
+
response = _a.sent();
|
|
20538
|
+
setGroupData(response.data);
|
|
20539
|
+
return [3 /*break*/, 3];
|
|
20540
|
+
case 2:
|
|
20541
|
+
_a.sent();
|
|
20542
|
+
setError('Failed to fetch group data. Please try again later.');
|
|
20543
|
+
return [3 /*break*/, 3];
|
|
20544
|
+
case 3:
|
|
20545
|
+
return [2 /*return*/];
|
|
20546
|
+
}
|
|
20460
20547
|
});
|
|
20461
|
-
};
|
|
20462
|
-
fetchGroup();
|
|
20548
|
+
});
|
|
20463
20549
|
}, [id, getGroupByID]);
|
|
20464
|
-
|
|
20465
|
-
|
|
20550
|
+
React.useEffect(function () {
|
|
20551
|
+
fetchGroup();
|
|
20552
|
+
}, [fetchGroup]);
|
|
20553
|
+
// Handle loading state
|
|
20554
|
+
if (!groupData && !error) {
|
|
20555
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20556
|
+
style: commonStyles.emptyContainer
|
|
20557
|
+
}, /*#__PURE__*/React.createElement(Skeleton, null));
|
|
20558
|
+
}
|
|
20559
|
+
// Handle error state
|
|
20560
|
+
if (error) {
|
|
20561
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20466
20562
|
style: commonStyles.emptyContainer
|
|
20467
|
-
}, /*#__PURE__*/React
|
|
20563
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20564
|
+
variant: "body"
|
|
20565
|
+
}, error));
|
|
20468
20566
|
}
|
|
20567
|
+
// Handle empty group data
|
|
20469
20568
|
if (!groupData) {
|
|
20470
|
-
return /*#__PURE__*/React
|
|
20569
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20471
20570
|
style: commonStyles.emptyContainer
|
|
20472
|
-
}, /*#__PURE__*/React
|
|
20571
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20473
20572
|
variant: "body"
|
|
20474
20573
|
}, "No group data available"));
|
|
20475
20574
|
}
|
|
20575
|
+
// Handle empty sections
|
|
20476
20576
|
if (!groupData.sections || groupData.sections.length === 0) {
|
|
20477
|
-
return /*#__PURE__*/React
|
|
20577
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20478
20578
|
style: commonStyles.emptyContainer
|
|
20479
|
-
}, /*#__PURE__*/React
|
|
20579
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20480
20580
|
variant: "body"
|
|
20481
20581
|
}, "No sections available"));
|
|
20482
20582
|
}
|
|
20483
20583
|
var sortedSections = sortByPriority(groupData.sections);
|
|
20484
|
-
return /*#__PURE__*/React
|
|
20485
|
-
return /*#__PURE__*/React
|
|
20584
|
+
return /*#__PURE__*/React.createElement(View$2, null, sortedSections.map(function (section) {
|
|
20585
|
+
return /*#__PURE__*/React.createElement(Section, {
|
|
20486
20586
|
key: section.id,
|
|
20487
20587
|
section: section
|
|
20488
20588
|
});
|
|
@@ -20503,7 +20603,6 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
20503
20603
|
justifyContent: 'space-between'
|
|
20504
20604
|
},
|
|
20505
20605
|
contentContainer: {
|
|
20506
|
-
flexDirection: 'column',
|
|
20507
20606
|
width: isFullSize ? '100%' : 'auto'
|
|
20508
20607
|
},
|
|
20509
20608
|
suffix: {
|
|
@@ -20537,17 +20636,22 @@ var PointsTileFormattedPoints = function () {
|
|
|
20537
20636
|
var styles = usePointsTileStyles();
|
|
20538
20637
|
var configuration = useTileContext().configuration;
|
|
20539
20638
|
var _a = configuration,
|
|
20540
|
-
|
|
20541
|
-
|
|
20542
|
-
|
|
20639
|
+
_b = _a.multiplier,
|
|
20640
|
+
multiplier = _b === void 0 ? 1 : _b,
|
|
20641
|
+
_c = _a.pointsPrefix,
|
|
20642
|
+
pointsPrefix = _c === void 0 ? '' : _c,
|
|
20643
|
+
_d = _a.pointsSuffix,
|
|
20644
|
+
pointsSuffix = _d === void 0 ? 'pts' : _d,
|
|
20543
20645
|
points = _a.points;
|
|
20544
|
-
|
|
20545
|
-
|
|
20546
|
-
return /*#__PURE__*/
|
|
20646
|
+
if (points === undefined) return null;
|
|
20647
|
+
var calculatedPoints = points * multiplier;
|
|
20648
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20547
20649
|
variant: "caption"
|
|
20548
|
-
}, pointsPrefix
|
|
20650
|
+
}, pointsPrefix, /*#__PURE__*/React.createElement(Layout, {
|
|
20651
|
+
direction: "row"
|
|
20652
|
+
}, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
|
|
20549
20653
|
style: styles.suffix
|
|
20550
|
-
}, pointsSuffix
|
|
20654
|
+
}, pointsSuffix)));
|
|
20551
20655
|
};
|
|
20552
20656
|
|
|
20553
20657
|
var PointsTileMedia = function (_a) {
|
|
@@ -20556,9 +20660,9 @@ var PointsTileMedia = function (_a) {
|
|
|
20556
20660
|
var artworkUrl = configuration.artworkUrl;
|
|
20557
20661
|
var styles = usePointsTileStyles(isFullSize);
|
|
20558
20662
|
if (!artworkUrl) return null;
|
|
20559
|
-
return /*#__PURE__*/React
|
|
20663
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20560
20664
|
style: styles.imageContainer
|
|
20561
|
-
}, /*#__PURE__*/React
|
|
20665
|
+
}, /*#__PURE__*/React.createElement(Image$2, {
|
|
20562
20666
|
source: {
|
|
20563
20667
|
uri: artworkUrl
|
|
20564
20668
|
},
|
|
@@ -20570,30 +20674,41 @@ var PointsTileMedia = function (_a) {
|
|
|
20570
20674
|
var PointsTileTitle = function () {
|
|
20571
20675
|
var configuration = useTileContext().configuration;
|
|
20572
20676
|
var title = configuration.title;
|
|
20573
|
-
return /*#__PURE__*/React
|
|
20677
|
+
return title ? /*#__PURE__*/React.createElement(Text, {
|
|
20574
20678
|
variant: "eyebrow"
|
|
20575
|
-
}, title);
|
|
20679
|
+
}, title) : null;
|
|
20576
20680
|
};
|
|
20577
20681
|
|
|
20578
|
-
|
|
20682
|
+
/**
|
|
20683
|
+
* The PointsTile component renders a tile with media, title, and formatted points.
|
|
20684
|
+
*
|
|
20685
|
+
* @param tile - The tile data to render.
|
|
20686
|
+
*/
|
|
20687
|
+
var PointsTileRoot = function (_a) {
|
|
20579
20688
|
var tile = _a.tile;
|
|
20689
|
+
if (!tile) return null;
|
|
20580
20690
|
var isFullSize = useTileSize(tile).isFullSize;
|
|
20581
20691
|
var styles = usePointsTileStyles(isFullSize);
|
|
20582
|
-
return /*#__PURE__*/React
|
|
20692
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
20583
20693
|
tile: tile
|
|
20584
|
-
}, isFullSize && /*#__PURE__*/React
|
|
20585
|
-
isFullSize:
|
|
20586
|
-
}), /*#__PURE__*/React
|
|
20694
|
+
}, isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
20695
|
+
isFullSize: true
|
|
20696
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20587
20697
|
style: styles.container
|
|
20588
|
-
}, !isFullSize && /*#__PURE__*/React
|
|
20589
|
-
isFullSize:
|
|
20590
|
-
}), /*#__PURE__*/React
|
|
20698
|
+
}, !isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
20699
|
+
isFullSize: false
|
|
20700
|
+
}), /*#__PURE__*/React.createElement(Layout, {
|
|
20591
20701
|
style: styles.contentContainer
|
|
20592
|
-
}, /*#__PURE__*/React
|
|
20702
|
+
}, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null))));
|
|
20593
20703
|
};
|
|
20594
|
-
|
|
20595
|
-
PointsTile
|
|
20596
|
-
|
|
20704
|
+
/**
|
|
20705
|
+
* The PointsTile component with subcomponents attached.
|
|
20706
|
+
*/
|
|
20707
|
+
var PointsTile = Object.assign(PointsTileRoot, {
|
|
20708
|
+
Title: PointsTileTitle,
|
|
20709
|
+
Points: PointsTileFormattedPoints,
|
|
20710
|
+
Media: PointsTileMedia
|
|
20711
|
+
});
|
|
20597
20712
|
var PointsTile$1 = withTileFetching(PointsTile);
|
|
20598
20713
|
|
|
20599
20714
|
var useRewardCategoryTileStyles = function () {
|
|
@@ -20635,11 +20750,11 @@ var RewardCategoryHeader = function () {
|
|
|
20635
20750
|
showName = _a.showName,
|
|
20636
20751
|
name = _a.name;
|
|
20637
20752
|
if (!showName || !name) return null;
|
|
20638
|
-
return /*#__PURE__*/React
|
|
20753
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20639
20754
|
style: [styles.header, {
|
|
20640
20755
|
backgroundColor: theme.primary
|
|
20641
20756
|
}]
|
|
20642
|
-
}, /*#__PURE__*/React
|
|
20757
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20643
20758
|
style: [styles.headerText, {
|
|
20644
20759
|
color: theme.primaryText
|
|
20645
20760
|
}],
|
|
@@ -20653,7 +20768,7 @@ var RewardCategoryMedia = function () {
|
|
|
20653
20768
|
var configuration = useTileContext().configuration;
|
|
20654
20769
|
var artworkUrl = configuration.artworkUrl;
|
|
20655
20770
|
if (!artworkUrl) return null;
|
|
20656
|
-
return /*#__PURE__*/React
|
|
20771
|
+
return /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
20657
20772
|
source: {
|
|
20658
20773
|
uri: artworkUrl
|
|
20659
20774
|
},
|
|
@@ -20661,20 +20776,30 @@ var RewardCategoryMedia = function () {
|
|
|
20661
20776
|
});
|
|
20662
20777
|
};
|
|
20663
20778
|
|
|
20664
|
-
|
|
20779
|
+
/**
|
|
20780
|
+
* The RewardCategoryTile component renders a tile with a header and media.
|
|
20781
|
+
*
|
|
20782
|
+
* @param tile - The tile data to render.
|
|
20783
|
+
*/
|
|
20784
|
+
var RewardCategoryTileRoot = function (_a) {
|
|
20665
20785
|
var tile = _a.tile;
|
|
20666
20786
|
if (!tile) return null;
|
|
20667
|
-
return /*#__PURE__*/
|
|
20787
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
20668
20788
|
tile: tile
|
|
20669
|
-
}, /*#__PURE__*/
|
|
20789
|
+
}, /*#__PURE__*/React.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React.createElement(RewardCategoryTile.Media, null));
|
|
20670
20790
|
};
|
|
20671
|
-
|
|
20672
|
-
RewardCategoryTile
|
|
20791
|
+
/**
|
|
20792
|
+
* The RewardCategoryTile component with subcomponents attached.
|
|
20793
|
+
*/
|
|
20794
|
+
var RewardCategoryTile = Object.assign(RewardCategoryTileRoot, {
|
|
20795
|
+
Header: RewardCategoryHeader,
|
|
20796
|
+
Media: RewardCategoryMedia
|
|
20797
|
+
});
|
|
20673
20798
|
var RewardCategoryTile$1 = withTileFetching(RewardCategoryTile);
|
|
20674
20799
|
|
|
20675
20800
|
var RewardTileChevron = function () {
|
|
20676
20801
|
var theme = useWllSdk().theme;
|
|
20677
|
-
return /*#__PURE__*/React
|
|
20802
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
20678
20803
|
name: "ChevronRight",
|
|
20679
20804
|
color: theme.derivedSurfaceText[20]
|
|
20680
20805
|
});
|
|
@@ -20715,6 +20840,9 @@ var useRewardTileStyles = function () {
|
|
|
20715
20840
|
suffix: {
|
|
20716
20841
|
color: theme.primary,
|
|
20717
20842
|
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet)
|
|
20843
|
+
},
|
|
20844
|
+
header: {
|
|
20845
|
+
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
|
|
20718
20846
|
}
|
|
20719
20847
|
});
|
|
20720
20848
|
};
|
|
@@ -20734,9 +20862,9 @@ var RewardTileMedia = function (_a) {
|
|
|
20734
20862
|
return (
|
|
20735
20863
|
/*#__PURE__*/
|
|
20736
20864
|
// @ts-ignore: We are using percentage values for flexBasis, which is valid in React Native but TypeScript expects a number.
|
|
20737
|
-
React
|
|
20865
|
+
React.createElement(View$2, {
|
|
20738
20866
|
style: [styles.imageContainer, containerStyle]
|
|
20739
|
-
}, /*#__PURE__*/React
|
|
20867
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
20740
20868
|
source: {
|
|
20741
20869
|
uri: artworkUrl
|
|
20742
20870
|
},
|
|
@@ -20751,17 +20879,22 @@ var RewardTilePoints = function () {
|
|
|
20751
20879
|
var _a = configuration,
|
|
20752
20880
|
showPrice = _a.showPrice,
|
|
20753
20881
|
price = _a.price,
|
|
20754
|
-
|
|
20755
|
-
|
|
20756
|
-
|
|
20757
|
-
|
|
20758
|
-
|
|
20759
|
-
|
|
20882
|
+
_b = _a.pointsMultiplier,
|
|
20883
|
+
pointsMultiplier = _b === void 0 ? 1 : _b,
|
|
20884
|
+
_c = _a.pointsPrefix,
|
|
20885
|
+
pointsPrefix = _c === void 0 ? '' : _c,
|
|
20886
|
+
_d = _a.pointsSuffix,
|
|
20887
|
+
pointsSuffix = _d === void 0 ? 'pts' : _d;
|
|
20888
|
+
// Exit early if price is not shown or undefined
|
|
20889
|
+
if (!showPrice || price === undefined) return null;
|
|
20890
|
+
// Calculate points
|
|
20891
|
+
var calculatedPoints = price * Number(pointsMultiplier);
|
|
20892
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20760
20893
|
variant: "caption",
|
|
20761
20894
|
style: styles.footer
|
|
20762
|
-
}, pointsPrefix, /*#__PURE__*/React
|
|
20895
|
+
}, pointsPrefix, /*#__PURE__*/React.createElement(View$2, {
|
|
20763
20896
|
style: styles.pointsContainer
|
|
20764
|
-
}, calculatedPoints, /*#__PURE__*/React
|
|
20897
|
+
}, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
|
|
20765
20898
|
style: styles.suffix
|
|
20766
20899
|
}, pointsSuffix)));
|
|
20767
20900
|
};
|
|
@@ -20770,7 +20903,7 @@ var RewardTileSummary = function () {
|
|
|
20770
20903
|
var configuration = useTileContext().configuration;
|
|
20771
20904
|
var summary = configuration.summary;
|
|
20772
20905
|
if (!summary) return null;
|
|
20773
|
-
return /*#__PURE__*/React
|
|
20906
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20774
20907
|
variant: "body"
|
|
20775
20908
|
}, summary);
|
|
20776
20909
|
};
|
|
@@ -20779,31 +20912,53 @@ var RewardTileTitle = function () {
|
|
|
20779
20912
|
var configuration = useTileContext().configuration;
|
|
20780
20913
|
var name = configuration.name;
|
|
20781
20914
|
if (!name) return null;
|
|
20782
|
-
return /*#__PURE__*/React
|
|
20915
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20783
20916
|
variant: "title",
|
|
20784
20917
|
ellipsizeMode: "tail",
|
|
20785
20918
|
numberOfLines: 1
|
|
20786
20919
|
}, name);
|
|
20787
20920
|
};
|
|
20788
20921
|
|
|
20789
|
-
|
|
20922
|
+
/**
|
|
20923
|
+
* Helper function to determine if the tile should display artwork only.
|
|
20924
|
+
*
|
|
20925
|
+
* @param configuration - The configuration object of the tile.
|
|
20926
|
+
* @returns `true` if the tile should display artwork only.
|
|
20927
|
+
*/
|
|
20928
|
+
var isArtworkOnly = function (configuration) {
|
|
20929
|
+
return !configuration.showDetails;
|
|
20930
|
+
};
|
|
20931
|
+
/**
|
|
20932
|
+
* The RewardTile component renders a tile with media, title, summary, points, and a chevron.
|
|
20933
|
+
*
|
|
20934
|
+
* @param tile - The tile data to render.
|
|
20935
|
+
*/
|
|
20936
|
+
var RewardTileRoot = function (_a) {
|
|
20790
20937
|
var tile = _a.tile;
|
|
20938
|
+
var styles = useRewardTileStyles();
|
|
20939
|
+
if (!tile) return null;
|
|
20791
20940
|
var configuration = tile.configuration;
|
|
20792
|
-
|
|
20793
|
-
return /*#__PURE__*/React$1.createElement(BaseTile, {
|
|
20941
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
20794
20942
|
tile: tile
|
|
20795
|
-
}, /*#__PURE__*/React
|
|
20796
|
-
isArtworkOnly:
|
|
20797
|
-
}), /*#__PURE__*/React
|
|
20943
|
+
}, /*#__PURE__*/React.createElement(RewardTile.Media, {
|
|
20944
|
+
isArtworkOnly: isArtworkOnly(configuration)
|
|
20945
|
+
}), /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Layout, {
|
|
20946
|
+
direction: "row",
|
|
20798
20947
|
justify: "between",
|
|
20799
|
-
align: "center"
|
|
20800
|
-
|
|
20948
|
+
align: "center",
|
|
20949
|
+
style: styles.header
|
|
20950
|
+
}, /*#__PURE__*/React.createElement(RewardTile.Title, null), /*#__PURE__*/React.createElement(RewardTile.Chevron, null)), /*#__PURE__*/React.createElement(RewardTile.Summary, null), /*#__PURE__*/React.createElement(RewardTile.Points, null)));
|
|
20801
20951
|
};
|
|
20802
|
-
|
|
20803
|
-
RewardTile
|
|
20804
|
-
|
|
20805
|
-
RewardTile
|
|
20806
|
-
|
|
20952
|
+
/**
|
|
20953
|
+
* The RewardTile component with subcomponents attached.
|
|
20954
|
+
*/
|
|
20955
|
+
var RewardTile = Object.assign(RewardTileRoot, {
|
|
20956
|
+
Media: RewardTileMedia,
|
|
20957
|
+
Title: RewardTileTitle,
|
|
20958
|
+
Summary: RewardTileSummary,
|
|
20959
|
+
Points: RewardTilePoints,
|
|
20960
|
+
Chevron: RewardTileChevron
|
|
20961
|
+
});
|
|
20807
20962
|
var RewardTile$1 = withTileFetching(RewardTile);
|
|
20808
20963
|
|
|
20809
20964
|
var useTierTileStyles = function () {
|
|
@@ -20886,10 +21041,9 @@ var TierTileFull = function (_a) {
|
|
|
20886
21041
|
},
|
|
20887
21042
|
style: styles.image,
|
|
20888
21043
|
resizeMode: "center"
|
|
20889
|
-
})), /*#__PURE__*/React__namespace.createElement(
|
|
21044
|
+
})), /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
20890
21045
|
align: "stretch",
|
|
20891
|
-
justify: artworkUrl ? 'start' : 'center'
|
|
20892
|
-
direction: "column"
|
|
21046
|
+
justify: artworkUrl ? 'start' : 'center'
|
|
20893
21047
|
}, /*#__PURE__*/React__namespace.createElement(View$2, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20894
21048
|
variant: "eyebrow",
|
|
20895
21049
|
style: styles.title
|
|
@@ -20912,7 +21066,7 @@ var TierTileHalf = function (_a) {
|
|
|
20912
21066
|
name = _c.name;
|
|
20913
21067
|
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
20914
21068
|
tile: tile
|
|
20915
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
21069
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
20916
21070
|
align: "center",
|
|
20917
21071
|
justify: "between",
|
|
20918
21072
|
direction: "row",
|
|
@@ -20953,23 +21107,19 @@ var TierTileEmpty = function (_a) {
|
|
|
20953
21107
|
if (isHalfSize) {
|
|
20954
21108
|
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
20955
21109
|
tile: tile
|
|
20956
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
21110
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
20957
21111
|
align: "center",
|
|
20958
21112
|
justify: "between",
|
|
20959
21113
|
direction: "row",
|
|
20960
21114
|
style: {
|
|
20961
21115
|
paddingTop: 16
|
|
20962
21116
|
}
|
|
20963
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
20964
|
-
style: {
|
|
20965
|
-
flex: 1
|
|
20966
|
-
}
|
|
20967
|
-
}, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21117
|
+
}, /*#__PURE__*/React__namespace.createElement(FlexBox, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20968
21118
|
variant: "title",
|
|
20969
21119
|
style: styles.title
|
|
20970
21120
|
}, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20971
21121
|
variant: "body"
|
|
20972
|
-
}, emptyDescription)), emptyArtworkUrl && /*#__PURE__*/React__namespace.createElement(
|
|
21122
|
+
}, emptyDescription)), emptyArtworkUrl && /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
20973
21123
|
style: styles.smallImageContainer
|
|
20974
21124
|
}, /*#__PURE__*/React__namespace.createElement(Image$2, {
|
|
20975
21125
|
source: {
|
|
@@ -20989,11 +21139,10 @@ var TierTileEmpty = function (_a) {
|
|
|
20989
21139
|
},
|
|
20990
21140
|
style: styles.image,
|
|
20991
21141
|
resizeMode: "center"
|
|
20992
|
-
})), /*#__PURE__*/React__namespace.createElement(
|
|
21142
|
+
})), /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
20993
21143
|
align: "stretch",
|
|
20994
|
-
justify: "center"
|
|
20995
|
-
|
|
20996
|
-
}, /*#__PURE__*/React__namespace.createElement(Column, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21144
|
+
justify: "center"
|
|
21145
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20997
21146
|
variant: "title",
|
|
20998
21147
|
style: styles.title
|
|
20999
21148
|
}, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
@@ -21005,46 +21154,26 @@ TierTile.Full = TierTileFull;
|
|
|
21005
21154
|
TierTile.Half = TierTileHalf;
|
|
21006
21155
|
TierTile.Empty = TierTileEmpty;
|
|
21007
21156
|
|
|
21157
|
+
var _a;
|
|
21158
|
+
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);
|
|
21159
|
+
/**
|
|
21160
|
+
* TileContainer component to render a list of tiles with proper layout and spacing.
|
|
21161
|
+
*/
|
|
21008
21162
|
var TileContainer = function (_a) {
|
|
21009
21163
|
var tiles = _a.tiles;
|
|
21010
|
-
|
|
21011
|
-
switch (tile.type) {
|
|
21012
|
-
case exports.TileType.Content:
|
|
21013
|
-
return /*#__PURE__*/React__namespace.createElement(ContentTile$1, {
|
|
21014
|
-
tile: tile
|
|
21015
|
-
});
|
|
21016
|
-
case exports.TileType.Badge:
|
|
21017
|
-
return /*#__PURE__*/React__namespace.createElement(BadgeTile$1, {
|
|
21018
|
-
tile: tile
|
|
21019
|
-
});
|
|
21020
|
-
case exports.TileType.Tier:
|
|
21021
|
-
return /*#__PURE__*/React__namespace.createElement(TierTile, {
|
|
21022
|
-
tile: tile
|
|
21023
|
-
});
|
|
21024
|
-
case exports.TileType.Points:
|
|
21025
|
-
return /*#__PURE__*/React__namespace.createElement(PointsTile$1, {
|
|
21026
|
-
tile: tile
|
|
21027
|
-
});
|
|
21028
|
-
case exports.TileType.Reward:
|
|
21029
|
-
return /*#__PURE__*/React__namespace.createElement(RewardTile$1, {
|
|
21030
|
-
tile: tile
|
|
21031
|
-
});
|
|
21032
|
-
case exports.TileType.RewardCategory:
|
|
21033
|
-
return /*#__PURE__*/React__namespace.createElement(RewardCategoryTile$1, {
|
|
21034
|
-
tile: tile
|
|
21035
|
-
});
|
|
21036
|
-
}
|
|
21037
|
-
};
|
|
21038
|
-
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21164
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21039
21165
|
style: styles.container
|
|
21040
21166
|
}, tiles.map(function (tile, index) {
|
|
21041
|
-
var
|
|
21042
|
-
|
|
21167
|
+
var TileComponent = TILE_COMPONENTS[tile.type];
|
|
21168
|
+
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
21169
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21043
21170
|
key: tile.id,
|
|
21044
|
-
style: [styles.tileContainer,
|
|
21171
|
+
style: [styles.tileContainer, isHalfSize && styles.halfTileContainer, index > 0 && {
|
|
21045
21172
|
marginTop: GRID_GAP
|
|
21046
21173
|
}]
|
|
21047
|
-
},
|
|
21174
|
+
}, TileComponent ? /*#__PURE__*/React.createElement(TileComponent, {
|
|
21175
|
+
tile: tile
|
|
21176
|
+
}) : null);
|
|
21048
21177
|
}));
|
|
21049
21178
|
};
|
|
21050
21179
|
var styles = StyleSheet$1.create({
|
|
@@ -21063,70 +21192,18 @@ var styles = StyleSheet$1.create({
|
|
|
21063
21192
|
}
|
|
21064
21193
|
});
|
|
21065
21194
|
|
|
21066
|
-
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21071
|
-
|
|
21072
|
-
style = _a.style;
|
|
21073
|
-
var _d = useResponsive$1(),
|
|
21074
|
-
isDesktop = _d.isDesktop,
|
|
21075
|
-
isTablet = _d.isTablet;
|
|
21076
|
-
var theme = useWllSdk().theme;
|
|
21077
|
-
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
21078
|
-
style: [{
|
|
21079
|
-
flex: 1,
|
|
21080
|
-
flexDirection: 'column',
|
|
21081
|
-
justifyContent: justifyMap[justify],
|
|
21082
|
-
alignItems: alignMap[align],
|
|
21083
|
-
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
21084
|
-
paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet)
|
|
21085
|
-
}, style]
|
|
21086
|
-
}, children);
|
|
21087
|
-
};
|
|
21088
|
-
|
|
21089
|
-
var Row = function (_a) {
|
|
21090
|
-
var children = _a.children,
|
|
21091
|
-
_b = _a.justify,
|
|
21092
|
-
justify = _b === void 0 ? 'start' : _b,
|
|
21093
|
-
_c = _a.align,
|
|
21094
|
-
align = _c === void 0 ? 'center' : _c,
|
|
21095
|
-
_d = _a.direction,
|
|
21096
|
-
direction = _d === void 0 ? 'row' : _d,
|
|
21097
|
-
style = _a.style;
|
|
21098
|
-
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
21099
|
-
style: [{
|
|
21100
|
-
flexDirection: direction,
|
|
21101
|
-
justifyContent: justifyMap[justify],
|
|
21102
|
-
alignItems: alignMap[align]
|
|
21103
|
-
}, style]
|
|
21104
|
-
}, children);
|
|
21105
|
-
};
|
|
21106
|
-
|
|
21195
|
+
/**
|
|
21196
|
+
* A FlexBox component that provides a flexible container with `flex: 1`.
|
|
21197
|
+
*
|
|
21198
|
+
* This component is commonly used to create a full-flex container that expands
|
|
21199
|
+
* to fill available space in a layout.
|
|
21200
|
+
*/
|
|
21107
21201
|
var FlexBox = function (_a) {
|
|
21108
|
-
var children = _a.children;
|
|
21109
|
-
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
21110
|
-
style: {
|
|
21111
|
-
flex: 1
|
|
21112
|
-
}
|
|
21113
|
-
}, children);
|
|
21114
|
-
};
|
|
21115
|
-
|
|
21116
|
-
var Stack = function (_a) {
|
|
21117
21202
|
var children = _a.children,
|
|
21118
|
-
_b = _a.justify,
|
|
21119
|
-
justify = _b === void 0 ? 'start' : _b,
|
|
21120
|
-
_c = _a.align,
|
|
21121
|
-
align = _c === void 0 ? 'stretch' : _c,
|
|
21122
|
-
_d = _a.direction,
|
|
21123
|
-
direction = _d === void 0 ? 'column' : _d,
|
|
21124
21203
|
style = _a.style;
|
|
21125
21204
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
21126
21205
|
style: [{
|
|
21127
|
-
|
|
21128
|
-
justifyContent: justifyMap[justify],
|
|
21129
|
-
alignItems: alignMap[align]
|
|
21206
|
+
flex: 1
|
|
21130
21207
|
}, style]
|
|
21131
21208
|
}, children);
|
|
21132
21209
|
};
|
|
@@ -21147,6 +21224,50 @@ var alignMap = {
|
|
|
21147
21224
|
baseline: 'baseline'
|
|
21148
21225
|
};
|
|
21149
21226
|
|
|
21227
|
+
var Layout = function (_a) {
|
|
21228
|
+
var children = _a.children,
|
|
21229
|
+
_b = _a.justify,
|
|
21230
|
+
justify = _b === void 0 ? 'start' : _b,
|
|
21231
|
+
_c = _a.align,
|
|
21232
|
+
align = _c === void 0 ? 'stretch' : _c,
|
|
21233
|
+
_d = _a.direction,
|
|
21234
|
+
direction = _d === void 0 ? 'column' : _d,
|
|
21235
|
+
_e = _a.style,
|
|
21236
|
+
style = _e === void 0 ? {} : _e;
|
|
21237
|
+
var theme = useWllSdk().theme;
|
|
21238
|
+
var _f = useResponsive$1(),
|
|
21239
|
+
isDesktop = _f.isDesktop,
|
|
21240
|
+
isTablet = _f.isTablet;
|
|
21241
|
+
var dynamicStyles = StyleSheet$1.create({
|
|
21242
|
+
column: {
|
|
21243
|
+
flex: 1,
|
|
21244
|
+
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
21245
|
+
paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
21246
|
+
justifyContent: justifyMap[justify],
|
|
21247
|
+
alignItems: alignMap[align],
|
|
21248
|
+
flexDirection: direction
|
|
21249
|
+
}
|
|
21250
|
+
});
|
|
21251
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21252
|
+
style: [dynamicStyles.column, style]
|
|
21253
|
+
}, children);
|
|
21254
|
+
};
|
|
21255
|
+
|
|
21256
|
+
/**
|
|
21257
|
+
* A simple Spacer component that creates flexible space in layouts.
|
|
21258
|
+
*
|
|
21259
|
+
* The Spacer is commonly used in flexbox layouts to create adjustable empty space
|
|
21260
|
+
* between child elements, avoiding the need for explicit margins or padding.
|
|
21261
|
+
*/
|
|
21262
|
+
var Spacer = function (_a) {
|
|
21263
|
+
var style = _a.style;
|
|
21264
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21265
|
+
style: [{
|
|
21266
|
+
flex: 1
|
|
21267
|
+
}, style]
|
|
21268
|
+
});
|
|
21269
|
+
};
|
|
21270
|
+
|
|
21150
21271
|
var Reward = /** @class */function () {
|
|
21151
21272
|
function Reward() {}
|
|
21152
21273
|
return Reward;
|
|
@@ -21160,8 +21281,6 @@ exports.BaseBanner = BaseBanner;
|
|
|
21160
21281
|
exports.BaseTile = BaseTile;
|
|
21161
21282
|
exports.Button = Button;
|
|
21162
21283
|
exports.Carousel = Carousel;
|
|
21163
|
-
exports.Column = Column;
|
|
21164
|
-
exports.Content = Column$1;
|
|
21165
21284
|
exports.ContentTile = ContentTile$1;
|
|
21166
21285
|
exports.ContentTileConfig = ContentTileConfig;
|
|
21167
21286
|
exports.FlexBox = FlexBox;
|
|
@@ -21169,6 +21288,7 @@ exports.Grid = Grid;
|
|
|
21169
21288
|
exports.Group = Group;
|
|
21170
21289
|
exports.Icon = Icon;
|
|
21171
21290
|
exports.Indicator = Indicator;
|
|
21291
|
+
exports.Layout = Layout;
|
|
21172
21292
|
exports.LoadingIndicator = LoadingIndicator;
|
|
21173
21293
|
exports.PointsTile = PointsTile$1;
|
|
21174
21294
|
exports.PointsTileConfig = PointsTileConfig;
|
|
@@ -21180,16 +21300,16 @@ exports.RewardCategoryTile = RewardCategoryTile$1;
|
|
|
21180
21300
|
exports.RewardCategoryTileConfig = RewardCategoryTileConfig;
|
|
21181
21301
|
exports.RewardTile = RewardTile$1;
|
|
21182
21302
|
exports.RewardTileConfig = RewardTileConfig;
|
|
21183
|
-
exports.Row = Row;
|
|
21184
|
-
exports.RowHeader = RowHeader;
|
|
21185
21303
|
exports.Section = Section;
|
|
21186
21304
|
exports.SectionHeader = SectionHeader;
|
|
21187
21305
|
exports.Skeleton = Skeleton;
|
|
21188
|
-
exports.
|
|
21306
|
+
exports.Spacer = Spacer;
|
|
21189
21307
|
exports.Text = Text;
|
|
21190
21308
|
exports.TierTileConfig = TierTileConfig;
|
|
21191
21309
|
exports.TierTileUpdated = TierTile;
|
|
21192
21310
|
exports.TileContainer = TileContainer;
|
|
21193
21311
|
exports.WllSdkProvider = WllSdkProvider;
|
|
21312
|
+
exports.alignMap = alignMap;
|
|
21313
|
+
exports.justifyMap = justifyMap;
|
|
21194
21314
|
exports.useWllSdk = useWllSdk;
|
|
21195
21315
|
//# sourceMappingURL=index.js.map
|