@wlloyalty/wll-react-sdk 1.0.43 → 1.0.44
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 +165 -92
- package/dist/index.js +933 -696
- 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,16 +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
|
};
|
|
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
|
+
});
|
|
18226
18200
|
|
|
18227
18201
|
var RowHeader = function (_a) {
|
|
18228
18202
|
var children = _a.children,
|
|
@@ -18780,9 +18754,9 @@ function Pressable(props, forwardedRef) {
|
|
|
18780
18754
|
var _useForceableState3 = useForceableState(testOnly_pressed === true),
|
|
18781
18755
|
pressed = _useForceableState3[0],
|
|
18782
18756
|
setPressed = _useForceableState3[1];
|
|
18783
|
-
var hostRef = React
|
|
18757
|
+
var hostRef = React.useRef(null);
|
|
18784
18758
|
var setRef = useMergeRefs$1(forwardedRef, hostRef);
|
|
18785
|
-
var pressConfig = React
|
|
18759
|
+
var pressConfig = React.useMemo(() => ({
|
|
18786
18760
|
delayLongPress,
|
|
18787
18761
|
delayPressStart: delayPressIn,
|
|
18788
18762
|
delayPressEnd: delayPressOut,
|
|
@@ -18859,7 +18833,7 @@ function Pressable(props, forwardedRef) {
|
|
|
18859
18833
|
}), typeof children === 'function' ? children(interactionState) : children);
|
|
18860
18834
|
}
|
|
18861
18835
|
function useForceableState(forced) {
|
|
18862
|
-
var _useState = React
|
|
18836
|
+
var _useState = React.useState(false),
|
|
18863
18837
|
bool = _useState[0],
|
|
18864
18838
|
setBool = _useState[1];
|
|
18865
18839
|
return [bool || forced, setBool];
|
|
@@ -18873,7 +18847,7 @@ var styles$7 = StyleSheet$1.create({
|
|
|
18873
18847
|
pointerEvents: 'box-none'
|
|
18874
18848
|
}
|
|
18875
18849
|
});
|
|
18876
|
-
var MemoedPressable = /*#__PURE__*/React
|
|
18850
|
+
var MemoedPressable = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Pressable));
|
|
18877
18851
|
MemoedPressable.displayName = 'Pressable';
|
|
18878
18852
|
var Pressable$1 = MemoedPressable;
|
|
18879
18853
|
|
|
@@ -19015,7 +18989,7 @@ var TierTileConfig = /** @class */function () {
|
|
|
19015
18989
|
|
|
19016
18990
|
var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
|
|
19017
18991
|
var handleNavigation = useWllSdk().handleNavigation;
|
|
19018
|
-
return React
|
|
18992
|
+
return React.useCallback(function () {
|
|
19019
18993
|
if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.Reward) {
|
|
19020
18994
|
var config = tile.configuration;
|
|
19021
18995
|
if (config === null || config === void 0 ? void 0 : config.rewardId) {
|
|
@@ -19037,9 +19011,9 @@ var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
|
|
|
19037
19011
|
}, [tile, ctaLink, ctaLinkTarget, handleNavigation]);
|
|
19038
19012
|
};
|
|
19039
19013
|
|
|
19040
|
-
var BannerContext = /*#__PURE__*/
|
|
19014
|
+
var BannerContext = /*#__PURE__*/React.createContext(null);
|
|
19041
19015
|
var useBannerContext = function () {
|
|
19042
|
-
var context =
|
|
19016
|
+
var context = React.useContext(BannerContext);
|
|
19043
19017
|
if (!context) {
|
|
19044
19018
|
throw new Error('Tile components must be used within a BaseTile');
|
|
19045
19019
|
}
|
|
@@ -19054,9 +19028,9 @@ var BaseBanner = function (_a) {
|
|
|
19054
19028
|
ctaLinkTarget = _b.ctaLinkTarget,
|
|
19055
19029
|
title = _b.title;
|
|
19056
19030
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19057
|
-
return /*#__PURE__*/
|
|
19031
|
+
return /*#__PURE__*/React.createElement(BannerContext.Provider, {
|
|
19058
19032
|
value: tile
|
|
19059
|
-
}, /*#__PURE__*/
|
|
19033
|
+
}, /*#__PURE__*/React.createElement(Pressable$1, {
|
|
19060
19034
|
style: function (_a) {
|
|
19061
19035
|
var pressed = _a.pressed;
|
|
19062
19036
|
return [styles$6.container, {
|
|
@@ -19084,7 +19058,7 @@ var styles$6 = StyleSheet$1.create({
|
|
|
19084
19058
|
});
|
|
19085
19059
|
|
|
19086
19060
|
var useTileSize = function (tile) {
|
|
19087
|
-
return React
|
|
19061
|
+
return React.useMemo(function () {
|
|
19088
19062
|
return {
|
|
19089
19063
|
isFullSize: tile.tileHeight === exports.TileHeight.Full,
|
|
19090
19064
|
isHalfSize: tile.tileHeight === exports.TileHeight.Half
|
|
@@ -19102,11 +19076,16 @@ var BaseTileBody = function (props) {
|
|
|
19102
19076
|
artworkUrl = _b.artworkUrl;
|
|
19103
19077
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
19104
19078
|
if (isHalfSize && artworkUrl || !body) return null;
|
|
19105
|
-
|
|
19079
|
+
// Helper function to determine the number of lines
|
|
19080
|
+
var getNumberOfLines = function () {
|
|
19081
|
+
if (!isHalfSize && !artworkUrl) return undefined;
|
|
19082
|
+
return isDesktop ? 3 : isTablet ? 4 : 3;
|
|
19083
|
+
};
|
|
19084
|
+
return /*#__PURE__*/React.createElement(Text, _extends({
|
|
19106
19085
|
variant: "body"
|
|
19107
19086
|
}, props, {
|
|
19108
19087
|
accessibilityLabel: body,
|
|
19109
|
-
numberOfLines:
|
|
19088
|
+
numberOfLines: getNumberOfLines()
|
|
19110
19089
|
}), body);
|
|
19111
19090
|
};
|
|
19112
19091
|
|
|
@@ -19171,7 +19150,7 @@ var BaseTileContent = function (_a) {
|
|
|
19171
19150
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
19172
19151
|
// For half tiles with an image, don't show other content
|
|
19173
19152
|
if (isHalfSize && artworkUrl) return null;
|
|
19174
|
-
return /*#__PURE__*/React
|
|
19153
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19175
19154
|
style: [baseStyles.content, {
|
|
19176
19155
|
justifyContent: 'center',
|
|
19177
19156
|
height: !artworkUrl ? '100%' : undefined
|
|
@@ -19187,7 +19166,7 @@ var BaseTileHeader = function (_a) {
|
|
|
19187
19166
|
// For half tiles with an image, don't show header
|
|
19188
19167
|
if (isHalfSize && artworkUrl) return null;
|
|
19189
19168
|
var dynamicStyles = useBaseTileStyles();
|
|
19190
|
-
return /*#__PURE__*/React
|
|
19169
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19191
19170
|
style: [dynamicStyles.header, {
|
|
19192
19171
|
marginTop: isHalfSize ? 0 : dynamicStyles.header.marginTop,
|
|
19193
19172
|
// @ts-ignore
|
|
@@ -19207,7 +19186,7 @@ var BaseTileMedia = function (props) {
|
|
|
19207
19186
|
useTileSize(tile).isHalfSize;
|
|
19208
19187
|
var styles = useBaseTileStyles();
|
|
19209
19188
|
if (!artworkUrl) return null;
|
|
19210
|
-
return /*#__PURE__*/React
|
|
19189
|
+
return /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
|
|
19211
19190
|
source: {
|
|
19212
19191
|
uri: artworkUrl
|
|
19213
19192
|
},
|
|
@@ -19225,31 +19204,33 @@ var BaseTileTitle = function () {
|
|
|
19225
19204
|
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
19226
19205
|
// Don't show title for half tiles with image
|
|
19227
19206
|
if (isHalfSize && artworkUrl || !title) return null;
|
|
19228
|
-
return /*#__PURE__*/React
|
|
19207
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
19229
19208
|
variant: "title",
|
|
19230
19209
|
accessibilityLabel: title,
|
|
19231
19210
|
numberOfLines: 1
|
|
19232
|
-
}, title), ctaLink && /*#__PURE__*/React
|
|
19211
|
+
}, title), ctaLink && /*#__PURE__*/React.createElement(Icon, {
|
|
19233
19212
|
name: "ChevronRight",
|
|
19234
19213
|
color: theme.derivedSurfaceText[20]
|
|
19235
19214
|
}));
|
|
19236
19215
|
};
|
|
19237
19216
|
|
|
19238
|
-
|
|
19217
|
+
/**
|
|
19218
|
+
* Context to provide the current tile to child components.
|
|
19219
|
+
*/
|
|
19220
|
+
var TileContext = /*#__PURE__*/React.createContext(null);
|
|
19221
|
+
/**
|
|
19222
|
+
* Custom hook to access the TileContext.
|
|
19223
|
+
*/
|
|
19239
19224
|
var useTileContext = function () {
|
|
19240
|
-
var context = React
|
|
19225
|
+
var context = React.useContext(TileContext);
|
|
19241
19226
|
if (!context) {
|
|
19242
19227
|
throw new Error('Tile components must be used within a BaseTile');
|
|
19243
19228
|
}
|
|
19244
19229
|
return context;
|
|
19245
19230
|
};
|
|
19246
|
-
|
|
19247
|
-
|
|
19248
|
-
|
|
19249
|
-
return /*#__PURE__*/React$1.createElement(TileContext.Provider, {
|
|
19250
|
-
value: tile
|
|
19251
|
-
}, /*#__PURE__*/React$1.createElement(BaseTile.Root, null, children));
|
|
19252
|
-
};
|
|
19231
|
+
/**
|
|
19232
|
+
* BaseTileRoot component to handle layout and pressable behavior.
|
|
19233
|
+
*/
|
|
19253
19234
|
var BaseTileRoot = function (_a) {
|
|
19254
19235
|
var children = _a.children,
|
|
19255
19236
|
style = _a.style;
|
|
@@ -19261,13 +19242,14 @@ var BaseTileRoot = function (_a) {
|
|
|
19261
19242
|
ctaLinkTarget = _b.ctaLinkTarget,
|
|
19262
19243
|
title = _b.title;
|
|
19263
19244
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19245
|
+
// Dynamic layout and styles
|
|
19264
19246
|
var layout = {
|
|
19265
19247
|
flexDirection: 'column',
|
|
19266
19248
|
justifyContent: isHalfSize ? 'center' : 'flex-start',
|
|
19267
19249
|
alignItems: 'stretch'
|
|
19268
19250
|
};
|
|
19269
19251
|
var dynamicStyles = useBaseTileStyles();
|
|
19270
|
-
return /*#__PURE__*/React
|
|
19252
|
+
return /*#__PURE__*/React.createElement(Pressable$1, {
|
|
19271
19253
|
style: function (_a) {
|
|
19272
19254
|
var pressed = _a.pressed;
|
|
19273
19255
|
return [baseStyles.container, dynamicStyles.container, {
|
|
@@ -19282,13 +19264,27 @@ var BaseTileRoot = function (_a) {
|
|
|
19282
19264
|
accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : '')
|
|
19283
19265
|
}, children);
|
|
19284
19266
|
};
|
|
19285
|
-
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19267
|
+
/**
|
|
19268
|
+
* BaseTileInner component to provide context and render children.
|
|
19269
|
+
*/
|
|
19270
|
+
var BaseTileInner = function (_a) {
|
|
19271
|
+
var tile = _a.tile,
|
|
19272
|
+
children = _a.children;
|
|
19273
|
+
return /*#__PURE__*/React.createElement(TileContext.Provider, {
|
|
19274
|
+
value: tile
|
|
19275
|
+
}, /*#__PURE__*/React.createElement(BaseTile.Root, null, children));
|
|
19276
|
+
};
|
|
19277
|
+
/**
|
|
19278
|
+
* BaseTile component with subcomponents attached.
|
|
19279
|
+
*/
|
|
19280
|
+
var BaseTile = Object.assign(BaseTileInner, {
|
|
19281
|
+
Root: BaseTileRoot,
|
|
19282
|
+
Media: BaseTileMedia,
|
|
19283
|
+
Content: BaseTileContent,
|
|
19284
|
+
Header: BaseTileHeader,
|
|
19285
|
+
Title: BaseTileTitle,
|
|
19286
|
+
Body: BaseTileBody
|
|
19287
|
+
});
|
|
19292
19288
|
|
|
19293
19289
|
var Indicator = function () {
|
|
19294
19290
|
var _a = useResponsive$1(),
|
|
@@ -19299,9 +19295,9 @@ var Indicator = function () {
|
|
|
19299
19295
|
if (isTablet) return 'Tablet Layout';
|
|
19300
19296
|
return 'Mobile Layout';
|
|
19301
19297
|
};
|
|
19302
|
-
return /*#__PURE__*/React
|
|
19298
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19303
19299
|
style: styles$5.indicator
|
|
19304
|
-
}, /*#__PURE__*/React
|
|
19300
|
+
}, /*#__PURE__*/React.createElement(Text$3, {
|
|
19305
19301
|
style: styles$5.indicatorText
|
|
19306
19302
|
}, getCurrentLayout()));
|
|
19307
19303
|
};
|
|
@@ -19449,16 +19445,16 @@ function withTileFetching(WrappedComponent) {
|
|
|
19449
19445
|
var tile = props.tile,
|
|
19450
19446
|
tileId = props.tileId;
|
|
19451
19447
|
var getTileByID = useWllSdk().getTileByID;
|
|
19452
|
-
var _a = React
|
|
19448
|
+
var _a = React.useState(tile || null),
|
|
19453
19449
|
tileData = _a[0],
|
|
19454
19450
|
setTileData = _a[1];
|
|
19455
|
-
var _b = React
|
|
19451
|
+
var _b = React.useState(false),
|
|
19456
19452
|
isLoading = _b[0],
|
|
19457
19453
|
setIsLoading = _b[1];
|
|
19458
|
-
var _c = React
|
|
19454
|
+
var _c = React.useState(null),
|
|
19459
19455
|
error = _c[0],
|
|
19460
19456
|
setError = _c[1];
|
|
19461
|
-
React
|
|
19457
|
+
React.useEffect(function () {
|
|
19462
19458
|
if (tile) {
|
|
19463
19459
|
setTileData(tile);
|
|
19464
19460
|
} else if (tileId) {
|
|
@@ -19498,18 +19494,18 @@ function withTileFetching(WrappedComponent) {
|
|
|
19498
19494
|
}
|
|
19499
19495
|
}, [tile, tileId, getTileByID]);
|
|
19500
19496
|
if (isLoading) {
|
|
19501
|
-
return /*#__PURE__*/React
|
|
19497
|
+
return /*#__PURE__*/React.createElement(SkeletonTile, {
|
|
19502
19498
|
style: {
|
|
19503
19499
|
width: '100%'
|
|
19504
19500
|
}
|
|
19505
19501
|
});
|
|
19506
19502
|
}
|
|
19507
19503
|
if (error || !tileData) {
|
|
19508
|
-
return /*#__PURE__*/React
|
|
19504
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19509
19505
|
style: commonStyles.emptyContainer
|
|
19510
|
-
}, /*#__PURE__*/React
|
|
19506
|
+
}, /*#__PURE__*/React.createElement(Text$3, null, "No tile data available"));
|
|
19511
19507
|
}
|
|
19512
|
-
return /*#__PURE__*/React
|
|
19508
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
|
|
19513
19509
|
tile: tileData
|
|
19514
19510
|
}));
|
|
19515
19511
|
};
|
|
@@ -19577,21 +19573,28 @@ var BadgeTileDateEarned = function () {
|
|
|
19577
19573
|
var containerStyle = [styles.dateEarnedContainer, {
|
|
19578
19574
|
backgroundColor: backgroundColor
|
|
19579
19575
|
}];
|
|
19576
|
+
var textColor = getReadableTextColor(backgroundColor);
|
|
19580
19577
|
if (type === exports.BadgeTileType.Latest && count === 0) {
|
|
19581
19578
|
return null;
|
|
19582
19579
|
}
|
|
19583
19580
|
if (count === 0) {
|
|
19584
|
-
return /*#__PURE__*/React
|
|
19581
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19585
19582
|
style: containerStyle
|
|
19586
|
-
}, /*#__PURE__*/React
|
|
19587
|
-
variant: "label"
|
|
19583
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19584
|
+
variant: "label",
|
|
19585
|
+
style: {
|
|
19586
|
+
color: textColor
|
|
19587
|
+
}
|
|
19588
19588
|
}, badgeNotEarnedMessage));
|
|
19589
19589
|
}
|
|
19590
19590
|
var formattedDate = new Date(createdAt).toLocaleDateString();
|
|
19591
|
-
return /*#__PURE__*/React
|
|
19591
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19592
19592
|
style: containerStyle
|
|
19593
|
-
}, /*#__PURE__*/React
|
|
19594
|
-
variant: "label"
|
|
19593
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19594
|
+
variant: "label",
|
|
19595
|
+
style: {
|
|
19596
|
+
color: textColor
|
|
19597
|
+
}
|
|
19595
19598
|
}, "".concat(awardedDatePrefix, " ").concat(formattedDate)));
|
|
19596
19599
|
};
|
|
19597
19600
|
|
|
@@ -19601,7 +19604,7 @@ var BadgeTileDescription = function () {
|
|
|
19601
19604
|
var count = configuration.count,
|
|
19602
19605
|
description = configuration.description;
|
|
19603
19606
|
if (count === 0 || !description) return null;
|
|
19604
|
-
return /*#__PURE__*/React
|
|
19607
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
19605
19608
|
variant: "body",
|
|
19606
19609
|
numberOfLines: 2,
|
|
19607
19610
|
ellipsizeMode: "tail"
|
|
@@ -19620,9 +19623,9 @@ var BadgeTileMedia = function (_a) {
|
|
|
19620
19623
|
emptyBadgeArtworkUrl = configuration.emptyBadgeArtworkUrl;
|
|
19621
19624
|
var displayUrl = count === 0 ? emptyBadgeArtworkUrl : artworkUrl;
|
|
19622
19625
|
if (!displayUrl) return null;
|
|
19623
|
-
return /*#__PURE__*/React
|
|
19626
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19624
19627
|
style: styles.header
|
|
19625
|
-
}, /*#__PURE__*/React
|
|
19628
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
|
|
19626
19629
|
source: {
|
|
19627
19630
|
uri: displayUrl
|
|
19628
19631
|
},
|
|
@@ -19641,12 +19644,12 @@ var BadgeTileStatus = function () {
|
|
|
19641
19644
|
if (type !== exports.BadgeTileType.Specific || count === 1) {
|
|
19642
19645
|
return null;
|
|
19643
19646
|
}
|
|
19644
|
-
return /*#__PURE__*/React
|
|
19647
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19645
19648
|
style: styles.indicatorContainer
|
|
19646
|
-
}, count === 0 ? /*#__PURE__*/React
|
|
19649
|
+
}, count === 0 ? /*#__PURE__*/React.createElement(LucideIcons.LockKeyholeIcon, {
|
|
19647
19650
|
color: "#FFF",
|
|
19648
19651
|
size: 20
|
|
19649
|
-
}) : /*#__PURE__*/React
|
|
19652
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
19650
19653
|
style: styles.countText
|
|
19651
19654
|
}, count, "x"));
|
|
19652
19655
|
};
|
|
@@ -19660,7 +19663,7 @@ var BadgeTileTitle = function () {
|
|
|
19660
19663
|
emptyBadgeMessage = configuration.emptyBadgeMessage;
|
|
19661
19664
|
var displayText = count === 0 ? emptyBadgeMessage : name;
|
|
19662
19665
|
if (!displayText) return null;
|
|
19663
|
-
return /*#__PURE__*/React
|
|
19666
|
+
return /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(Text, {
|
|
19664
19667
|
variant: "title",
|
|
19665
19668
|
style: styles.titleText,
|
|
19666
19669
|
numberOfLines: count === 0 ? 2 : 1,
|
|
@@ -19668,22 +19671,31 @@ var BadgeTileTitle = function () {
|
|
|
19668
19671
|
}, displayText));
|
|
19669
19672
|
};
|
|
19670
19673
|
|
|
19671
|
-
|
|
19674
|
+
/**
|
|
19675
|
+
* The main BadgeTile component.
|
|
19676
|
+
*
|
|
19677
|
+
* This component renders a badge tile with optional media, status, title, description, and date earned.
|
|
19678
|
+
*/
|
|
19679
|
+
var BadgeTileRoot = function (_a) {
|
|
19672
19680
|
var tile = _a.tile;
|
|
19673
19681
|
if (!tile) return null;
|
|
19674
|
-
return /*#__PURE__*/React
|
|
19682
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
19675
19683
|
tile: tile
|
|
19676
|
-
}, /*#__PURE__*/React
|
|
19684
|
+
}, /*#__PURE__*/React.createElement(BadgeTile.Media, null, /*#__PURE__*/React.createElement(BadgeTile.Status, null)), /*#__PURE__*/React.createElement(Column, {
|
|
19677
19685
|
justify: "between",
|
|
19678
19686
|
align: "start"
|
|
19679
|
-
}, /*#__PURE__*/React
|
|
19687
|
+
}, /*#__PURE__*/React.createElement(BadgeTile.Title, null), /*#__PURE__*/React.createElement(BadgeTile.Description, null), /*#__PURE__*/React.createElement(Spacer, null), /*#__PURE__*/React.createElement(BadgeTile.DateEarned, null)));
|
|
19680
19688
|
};
|
|
19681
|
-
|
|
19682
|
-
BadgeTile
|
|
19683
|
-
|
|
19684
|
-
BadgeTile
|
|
19685
|
-
|
|
19686
|
-
|
|
19689
|
+
/**
|
|
19690
|
+
* The BadgeTile component with subcomponents attached.
|
|
19691
|
+
*/
|
|
19692
|
+
var BadgeTile = Object.assign(BadgeTileRoot, {
|
|
19693
|
+
Media: BadgeTileMedia,
|
|
19694
|
+
Title: BadgeTileTitle,
|
|
19695
|
+
Description: BadgeTileDescription,
|
|
19696
|
+
DateEarned: BadgeTileDateEarned,
|
|
19697
|
+
Status: BadgeTileStatus
|
|
19698
|
+
});
|
|
19687
19699
|
var BadgeTile$1 = withTileFetching(BadgeTile);
|
|
19688
19700
|
|
|
19689
19701
|
var BannerTileCTA = function () {
|
|
@@ -19694,7 +19706,7 @@ var BannerTileCTA = function () {
|
|
|
19694
19706
|
ctaLinkTarget = _a.ctaLinkTarget;
|
|
19695
19707
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19696
19708
|
if (!ctaText) return null;
|
|
19697
|
-
return /*#__PURE__*/React
|
|
19709
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
19698
19710
|
title: ctaText,
|
|
19699
19711
|
variant: "accent",
|
|
19700
19712
|
onPress: handlePress
|
|
@@ -19743,7 +19755,7 @@ var BannerTileDescription = function () {
|
|
|
19743
19755
|
var description = configuration.description;
|
|
19744
19756
|
var theme = useWllSdk().theme;
|
|
19745
19757
|
if (!description) return null;
|
|
19746
|
-
return /*#__PURE__*/React
|
|
19758
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
19747
19759
|
style: [styles.description, {
|
|
19748
19760
|
color: theme.derivedSurfaceText[20]
|
|
19749
19761
|
}]
|
|
@@ -19762,9 +19774,9 @@ var BannerTileMedia = function (_a) {
|
|
|
19762
19774
|
return (
|
|
19763
19775
|
/*#__PURE__*/
|
|
19764
19776
|
// @ts-ignore: We are using percentage values for width, which is valid in React Native but TypeScript expects a number.
|
|
19765
|
-
React
|
|
19777
|
+
React.createElement(View$2, {
|
|
19766
19778
|
style: [styles.mediaContainer, containerStyle]
|
|
19767
|
-
}, /*#__PURE__*/React
|
|
19779
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
19768
19780
|
source: {
|
|
19769
19781
|
uri: artworkUrl
|
|
19770
19782
|
},
|
|
@@ -19778,33 +19790,52 @@ var BannerTileTitle = function () {
|
|
|
19778
19790
|
var configuration = useBannerContext().configuration;
|
|
19779
19791
|
var title = configuration.title;
|
|
19780
19792
|
if (!title) return null;
|
|
19781
|
-
return /*#__PURE__*/React
|
|
19793
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
19782
19794
|
variant: "title",
|
|
19783
19795
|
style: styles.title
|
|
19784
19796
|
}, title);
|
|
19785
19797
|
};
|
|
19786
19798
|
|
|
19787
|
-
|
|
19799
|
+
/**
|
|
19800
|
+
* Helper function to determine if the tile is artwork-only.
|
|
19801
|
+
*
|
|
19802
|
+
* @param configuration - The configuration object of the tile.
|
|
19803
|
+
* @returns `true` if the tile has no title, description, or CTA text.
|
|
19804
|
+
*/
|
|
19805
|
+
var isArtworkOnly$1 = function (configuration) {
|
|
19806
|
+
return !configuration.title && !configuration.description && !configuration.ctaText;
|
|
19807
|
+
};
|
|
19808
|
+
/**
|
|
19809
|
+
* The main BannerTile component.
|
|
19810
|
+
*
|
|
19811
|
+
* This component renders a banner tile with optional media, title, description, and CTA.
|
|
19812
|
+
*/
|
|
19813
|
+
var BannerTileRoot = function (_a) {
|
|
19788
19814
|
var tile = _a.tile;
|
|
19815
|
+
if (!tile) return null;
|
|
19789
19816
|
var styles = useBannerTileStyles();
|
|
19790
19817
|
var configuration = tile.configuration;
|
|
19791
|
-
|
|
19792
|
-
return /*#__PURE__*/React__namespace.createElement(BaseBanner, {
|
|
19818
|
+
return /*#__PURE__*/React.createElement(BaseBanner, {
|
|
19793
19819
|
tile: tile
|
|
19794
|
-
}, /*#__PURE__*/
|
|
19795
|
-
isArtworkOnly: isArtworkOnly
|
|
19796
|
-
}), /*#__PURE__*/
|
|
19820
|
+
}, /*#__PURE__*/React.createElement(BannerTile.Media, {
|
|
19821
|
+
isArtworkOnly: isArtworkOnly$1(configuration)
|
|
19822
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
19797
19823
|
style: styles.slideContent
|
|
19798
|
-
}, /*#__PURE__*/
|
|
19824
|
+
}, /*#__PURE__*/React.createElement(BannerTile.Title, null), /*#__PURE__*/React.createElement(BannerTile.Description, null), /*#__PURE__*/React.createElement(BannerTile.CTA, null)));
|
|
19799
19825
|
};
|
|
19800
|
-
|
|
19801
|
-
BannerTile
|
|
19802
|
-
|
|
19803
|
-
BannerTile
|
|
19826
|
+
/**
|
|
19827
|
+
* The BannerTile component with subcomponents attached.
|
|
19828
|
+
*/
|
|
19829
|
+
var BannerTile = Object.assign(BannerTileRoot, {
|
|
19830
|
+
Media: BannerTileMedia,
|
|
19831
|
+
Title: BannerTileTitle,
|
|
19832
|
+
Description: BannerTileDescription,
|
|
19833
|
+
CTA: BannerTileCTA
|
|
19834
|
+
});
|
|
19804
19835
|
var BannerTile$1 = withTileFetching(BannerTile);
|
|
19805
19836
|
|
|
19806
19837
|
var ContentTileBody = function () {
|
|
19807
|
-
return /*#__PURE__*/React
|
|
19838
|
+
return /*#__PURE__*/React.createElement(BaseTile.Body, null);
|
|
19808
19839
|
};
|
|
19809
19840
|
|
|
19810
19841
|
var useContentTileStyles = function () {
|
|
@@ -19827,7 +19858,7 @@ var useContentTileStyles = function () {
|
|
|
19827
19858
|
var ContentTileContent = function (_a) {
|
|
19828
19859
|
var children = _a.children;
|
|
19829
19860
|
var styles = useContentTileStyles();
|
|
19830
|
-
return /*#__PURE__*/React
|
|
19861
|
+
return /*#__PURE__*/React.createElement(BaseTile.Content, null, /*#__PURE__*/React.createElement(View$2, {
|
|
19831
19862
|
style: styles.content
|
|
19832
19863
|
}, children));
|
|
19833
19864
|
};
|
|
@@ -19836,33 +19867,43 @@ var ContentTileHeader = function () {
|
|
|
19836
19867
|
var tile = useTileContext();
|
|
19837
19868
|
var title = tile.configuration.title;
|
|
19838
19869
|
if (!title) return null;
|
|
19839
|
-
return /*#__PURE__*/React
|
|
19870
|
+
return /*#__PURE__*/React.createElement(BaseTile.Header, null, /*#__PURE__*/React.createElement(BaseTile.Title, null));
|
|
19840
19871
|
};
|
|
19841
19872
|
|
|
19842
19873
|
var ContentTileMedia = function () {
|
|
19843
19874
|
var styles = useContentTileStyles();
|
|
19844
|
-
return /*#__PURE__*/React
|
|
19875
|
+
return /*#__PURE__*/React.createElement(BaseTile.Media, {
|
|
19845
19876
|
style: styles.media
|
|
19846
19877
|
});
|
|
19847
19878
|
};
|
|
19848
19879
|
|
|
19849
19880
|
var ContentTileRoot = function (_a) {
|
|
19850
19881
|
var children = _a.children;
|
|
19851
|
-
return /*#__PURE__*/React
|
|
19882
|
+
return /*#__PURE__*/React.createElement(BaseTile.Root, null, children);
|
|
19852
19883
|
};
|
|
19853
19884
|
|
|
19885
|
+
/**
|
|
19886
|
+
* The ContentTile component renders a tile with a root, media, content, header, and body.
|
|
19887
|
+
*
|
|
19888
|
+
* @param tile - The tile data to render.
|
|
19889
|
+
*/
|
|
19854
19890
|
var ContentTileMain = function (_a) {
|
|
19855
19891
|
var tile = _a.tile;
|
|
19856
|
-
|
|
19892
|
+
if (!tile) return null;
|
|
19893
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
19857
19894
|
tile: tile
|
|
19858
|
-
}, /*#__PURE__*/React
|
|
19895
|
+
}, /*#__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
19896
|
};
|
|
19860
|
-
|
|
19861
|
-
ContentTile
|
|
19862
|
-
|
|
19863
|
-
ContentTile
|
|
19864
|
-
|
|
19865
|
-
|
|
19897
|
+
/**
|
|
19898
|
+
* The ContentTile component with subcomponents attached.
|
|
19899
|
+
*/
|
|
19900
|
+
var ContentTile = Object.assign(ContentTileMain, {
|
|
19901
|
+
Root: ContentTileRoot,
|
|
19902
|
+
Media: ContentTileMedia,
|
|
19903
|
+
Content: ContentTileContent,
|
|
19904
|
+
Header: ContentTileHeader,
|
|
19905
|
+
Body: ContentTileBody
|
|
19906
|
+
});
|
|
19866
19907
|
var ContentTile$1 = withTileFetching(ContentTile);
|
|
19867
19908
|
|
|
19868
19909
|
/**
|
|
@@ -19898,10 +19939,10 @@ exports.SectionType = void 0;
|
|
|
19898
19939
|
*/
|
|
19899
19940
|
|
|
19900
19941
|
function useWindowDimensions() {
|
|
19901
|
-
var _useState = React
|
|
19942
|
+
var _useState = React.useState(() => Dimensions.get('window')),
|
|
19902
19943
|
dims = _useState[0],
|
|
19903
19944
|
setDims = _useState[1];
|
|
19904
|
-
React
|
|
19945
|
+
React.useEffect(() => {
|
|
19905
19946
|
function handleChange(_ref) {
|
|
19906
19947
|
var window = _ref.window;
|
|
19907
19948
|
if (window != null) {
|
|
@@ -19950,14 +19991,14 @@ var SectionHeader = function (_a) {
|
|
|
19950
19991
|
if (!title) {
|
|
19951
19992
|
return null;
|
|
19952
19993
|
}
|
|
19953
|
-
return /*#__PURE__*/React
|
|
19994
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19954
19995
|
style: styles.sectionHeader
|
|
19955
|
-
}, title && /*#__PURE__*/React
|
|
19996
|
+
}, title && /*#__PURE__*/React.createElement(Text, {
|
|
19956
19997
|
style: [styles.sectionTitle, {
|
|
19957
19998
|
fontWeight: '700',
|
|
19958
19999
|
color: theme.text
|
|
19959
20000
|
}]
|
|
19960
|
-
}, title), description && /*#__PURE__*/React
|
|
20001
|
+
}, title), description && /*#__PURE__*/React.createElement(Text, {
|
|
19961
20002
|
style: [styles.sectionDescription, {
|
|
19962
20003
|
color: theme.alphaDerivedText[80]
|
|
19963
20004
|
}]
|
|
@@ -20043,52 +20084,85 @@ var useCarouselStyles = function (buttonSize) {
|
|
|
20043
20084
|
});
|
|
20044
20085
|
};
|
|
20045
20086
|
|
|
20087
|
+
var initialState = {
|
|
20088
|
+
currentIndex: 0,
|
|
20089
|
+
containerWidth: 0
|
|
20090
|
+
};
|
|
20091
|
+
var carouselReducer = function (state, action) {
|
|
20092
|
+
switch (action.type) {
|
|
20093
|
+
case 'SET_CONTAINER_WIDTH':
|
|
20094
|
+
return __assign(__assign({}, state), {
|
|
20095
|
+
containerWidth: action.payload
|
|
20096
|
+
});
|
|
20097
|
+
case 'SET_CURRENT_INDEX':
|
|
20098
|
+
return __assign(__assign({}, state), {
|
|
20099
|
+
currentIndex: action.payload
|
|
20100
|
+
});
|
|
20101
|
+
case 'PREV_SLIDE':
|
|
20102
|
+
return __assign(__assign({}, state), {
|
|
20103
|
+
currentIndex: Math.max(0, state.currentIndex - 1)
|
|
20104
|
+
});
|
|
20105
|
+
case 'NEXT_SLIDE':
|
|
20106
|
+
return __assign(__assign({}, state), {
|
|
20107
|
+
currentIndex: Math.min(action.maxIndex, state.currentIndex + 1)
|
|
20108
|
+
});
|
|
20109
|
+
default:
|
|
20110
|
+
return state;
|
|
20111
|
+
}
|
|
20112
|
+
};
|
|
20046
20113
|
var Carousel = function (_a) {
|
|
20047
20114
|
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];
|
|
20115
|
+
var WINDOW_WIDTH = useWindowDimensions().width;
|
|
20116
|
+
var containerRef = React.useRef(null);
|
|
20053
20117
|
var styles = useCarouselStyles(BUTTON_SIZE);
|
|
20054
|
-
var animatedIndex = React
|
|
20118
|
+
var animatedIndex = React.useRef(new Animated$1.Value(0)).current;
|
|
20055
20119
|
var theme = useWllSdk().theme;
|
|
20056
|
-
var
|
|
20057
|
-
isDesktop =
|
|
20058
|
-
isTablet =
|
|
20059
|
-
var scrollViewRef = React
|
|
20060
|
-
var
|
|
20061
|
-
|
|
20062
|
-
|
|
20120
|
+
var _b = useResponsive(),
|
|
20121
|
+
isDesktop = _b.isDesktop,
|
|
20122
|
+
isTablet = _b.isTablet;
|
|
20123
|
+
var scrollViewRef = React.useRef(null);
|
|
20124
|
+
var _c = React.useReducer(carouselReducer, __assign(__assign({}, initialState), {
|
|
20125
|
+
containerWidth: WINDOW_WIDTH
|
|
20126
|
+
})),
|
|
20127
|
+
state = _c[0],
|
|
20128
|
+
dispatch = _c[1];
|
|
20129
|
+
var currentIndex = state.currentIndex,
|
|
20130
|
+
containerWidth = state.containerWidth;
|
|
20063
20131
|
var bannerTiles = section.tiles.filter(function (tile) {
|
|
20064
20132
|
return tile.type === exports.TileType.Banner;
|
|
20065
20133
|
});
|
|
20066
20134
|
var sortedTiles = sortByPriority(bannerTiles);
|
|
20067
|
-
var handleScroll = React
|
|
20135
|
+
var handleScroll = React.useCallback(function (event) {
|
|
20068
20136
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
20069
20137
|
var newIndex = contentOffsetX / containerWidth;
|
|
20070
20138
|
animatedIndex.setValue(newIndex);
|
|
20071
20139
|
}, [containerWidth, animatedIndex]);
|
|
20072
|
-
var handleScrollEnd = React
|
|
20140
|
+
var handleScrollEnd = React.useCallback(function (event) {
|
|
20073
20141
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
20074
20142
|
var newIndex = Math.round(contentOffsetX / containerWidth);
|
|
20075
|
-
|
|
20143
|
+
dispatch({
|
|
20144
|
+
type: 'SET_CURRENT_INDEX',
|
|
20145
|
+
payload: newIndex
|
|
20146
|
+
});
|
|
20076
20147
|
}, [containerWidth]);
|
|
20077
20148
|
var handlePrev = function () {
|
|
20078
20149
|
var _a;
|
|
20079
|
-
|
|
20080
|
-
|
|
20150
|
+
dispatch({
|
|
20151
|
+
type: 'PREV_SLIDE'
|
|
20152
|
+
});
|
|
20081
20153
|
(_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
20082
|
-
x:
|
|
20154
|
+
x: (currentIndex - 1) * containerWidth,
|
|
20083
20155
|
animated: true
|
|
20084
20156
|
});
|
|
20085
20157
|
};
|
|
20086
20158
|
var handleNext = function () {
|
|
20087
20159
|
var _a;
|
|
20088
|
-
|
|
20089
|
-
|
|
20160
|
+
dispatch({
|
|
20161
|
+
type: 'NEXT_SLIDE',
|
|
20162
|
+
maxIndex: sortedTiles.length - 1
|
|
20163
|
+
});
|
|
20090
20164
|
(_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
20091
|
-
x:
|
|
20165
|
+
x: (currentIndex + 1) * containerWidth,
|
|
20092
20166
|
animated: true
|
|
20093
20167
|
});
|
|
20094
20168
|
};
|
|
@@ -20102,28 +20176,31 @@ var Carousel = function (_a) {
|
|
|
20102
20176
|
marginTop: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet)
|
|
20103
20177
|
}
|
|
20104
20178
|
});
|
|
20105
|
-
return /*#__PURE__*/React
|
|
20179
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionHeader, {
|
|
20106
20180
|
title: section.title,
|
|
20107
20181
|
description: section.description
|
|
20108
|
-
}), /*#__PURE__*/React
|
|
20182
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20109
20183
|
ref: containerRef,
|
|
20110
20184
|
style: styles.container,
|
|
20111
20185
|
onLayout: function (event) {
|
|
20112
20186
|
var width = event.nativeEvent.layout.width;
|
|
20113
|
-
|
|
20187
|
+
dispatch({
|
|
20188
|
+
type: 'SET_CONTAINER_WIDTH',
|
|
20189
|
+
payload: width
|
|
20190
|
+
});
|
|
20114
20191
|
}
|
|
20115
|
-
}, /*#__PURE__*/React
|
|
20192
|
+
}, /*#__PURE__*/React.createElement(View$2, {
|
|
20116
20193
|
style: styles.carouselContainer
|
|
20117
|
-
}, showPrevButton && /*#__PURE__*/React
|
|
20194
|
+
}, showPrevButton && /*#__PURE__*/React.createElement(TouchableOpacity$1, {
|
|
20118
20195
|
style: [styles.navButton, styles.navButtonLeft, {
|
|
20119
20196
|
backgroundColor: theme.background
|
|
20120
20197
|
}],
|
|
20121
20198
|
onPress: handlePrev
|
|
20122
|
-
}, /*#__PURE__*/React
|
|
20199
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20123
20200
|
name: "ArrowLeft",
|
|
20124
20201
|
size: 20,
|
|
20125
20202
|
color: theme.primary
|
|
20126
|
-
})), /*#__PURE__*/React
|
|
20203
|
+
})), /*#__PURE__*/React.createElement(ScrollView$2, {
|
|
20127
20204
|
ref: scrollViewRef,
|
|
20128
20205
|
horizontal: true,
|
|
20129
20206
|
pagingEnabled: true,
|
|
@@ -20139,24 +20216,24 @@ var Carousel = function (_a) {
|
|
|
20139
20216
|
snapToInterval: containerWidth,
|
|
20140
20217
|
snapToAlignment: "start"
|
|
20141
20218
|
}, sortedTiles.map(function (tile, index) {
|
|
20142
|
-
return /*#__PURE__*/React
|
|
20219
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20143
20220
|
key: index,
|
|
20144
20221
|
style: [styles.slideContainer, {
|
|
20145
20222
|
width: containerWidth
|
|
20146
20223
|
}]
|
|
20147
|
-
}, /*#__PURE__*/React
|
|
20224
|
+
}, /*#__PURE__*/React.createElement(BannerTile$1, {
|
|
20148
20225
|
tile: tile
|
|
20149
20226
|
}));
|
|
20150
|
-
})), showNextButton && /*#__PURE__*/React
|
|
20227
|
+
})), showNextButton && /*#__PURE__*/React.createElement(TouchableOpacity$1, {
|
|
20151
20228
|
style: [styles.navButton, styles.navButtonRight, {
|
|
20152
20229
|
backgroundColor: theme.surface
|
|
20153
20230
|
}],
|
|
20154
20231
|
onPress: handleNext
|
|
20155
|
-
}, /*#__PURE__*/React
|
|
20232
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20156
20233
|
name: "ArrowRight",
|
|
20157
20234
|
size: 20,
|
|
20158
20235
|
color: theme.primary
|
|
20159
|
-
}))), displayControls && /*#__PURE__*/React
|
|
20236
|
+
}))), displayControls && /*#__PURE__*/React.createElement(View$2, {
|
|
20160
20237
|
style: dynamicStyles.indicators
|
|
20161
20238
|
}, sortedTiles.map(function (_, index) {
|
|
20162
20239
|
var width = animatedIndex.interpolate({
|
|
@@ -20164,7 +20241,7 @@ var Carousel = function (_a) {
|
|
|
20164
20241
|
outputRange: [8, 30, 8],
|
|
20165
20242
|
extrapolate: 'clamp'
|
|
20166
20243
|
});
|
|
20167
|
-
return /*#__PURE__*/React
|
|
20244
|
+
return /*#__PURE__*/React.createElement(Animated$1.View, {
|
|
20168
20245
|
key: index,
|
|
20169
20246
|
style: [styles.indicator, {
|
|
20170
20247
|
backgroundColor: theme.derivedBackground,
|
|
@@ -20180,43 +20257,30 @@ var Grid = function (_a) {
|
|
|
20180
20257
|
var section = _a.section;
|
|
20181
20258
|
var isDesktop = useResponsive().isDesktop;
|
|
20182
20259
|
var columnsPerRow = isDesktop ? 4 : 2;
|
|
20183
|
-
var
|
|
20184
|
-
|
|
20185
|
-
var currentTiles = [];
|
|
20186
|
-
var gridTiles = section.tiles.filter(function (tile) {
|
|
20260
|
+
var gridTiles = React.useMemo(function () {
|
|
20261
|
+
return sortByPriority(section.tiles.filter(function (tile) {
|
|
20187
20262
|
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) {
|
|
20263
|
+
}));
|
|
20264
|
+
}, [section.tiles]);
|
|
20265
|
+
var getTileWidth = React.useCallback(function (columns) {
|
|
20266
|
+
if (IS_WEB) {
|
|
20198
20267
|
return {
|
|
20199
20268
|
width: "calc(".concat(100 / columns, "% - ").concat((columns - 1) * GRID_GAP / columns, "px)"),
|
|
20200
20269
|
marginBottom: GRID_GAP,
|
|
20201
20270
|
height: 'auto'
|
|
20202
20271
|
};
|
|
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;
|
|
20272
|
+
} else {
|
|
20273
|
+
var tileWidth = (SCREEN_WIDTH - (columns - 1) * GRID_GAP) / columns;
|
|
20274
|
+
return {
|
|
20275
|
+
width: tileWidth,
|
|
20276
|
+
marginBottom: GRID_GAP,
|
|
20277
|
+
height: 'auto'
|
|
20278
|
+
};
|
|
20219
20279
|
}
|
|
20280
|
+
}, []);
|
|
20281
|
+
var renderTileContainers = React.useCallback(function () {
|
|
20282
|
+
var tileContainers = [];
|
|
20283
|
+
var currentTiles = [];
|
|
20220
20284
|
var sortedTiles = sortByPriority(gridTiles);
|
|
20221
20285
|
sortedTiles.forEach(function (tile, index) {
|
|
20222
20286
|
currentTiles.push(tile);
|
|
@@ -20236,27 +20300,27 @@ var Grid = function (_a) {
|
|
|
20236
20300
|
};
|
|
20237
20301
|
if (shouldStartNewContainer(currentTiles, tile, nextTile)) {
|
|
20238
20302
|
var isLastInRow = (tileContainers.length + 1) % columnsPerRow === 0;
|
|
20239
|
-
tileContainers.push( /*#__PURE__*/
|
|
20303
|
+
tileContainers.push( /*#__PURE__*/React.createElement(View$2, {
|
|
20240
20304
|
key: "container-".concat(index),
|
|
20241
20305
|
style: [
|
|
20242
|
-
// @ts-ignore
|
|
20306
|
+
// @ts-ignore Web uses CSS calc strings for responsive layouts, while ViewStyle expects numbers
|
|
20243
20307
|
getTileWidth(columnsPerRow), !isLastInRow && {
|
|
20244
20308
|
marginRight: GRID_GAP
|
|
20245
20309
|
}]
|
|
20246
|
-
}, /*#__PURE__*/
|
|
20310
|
+
}, /*#__PURE__*/React.createElement(TileContainer, {
|
|
20247
20311
|
tiles: currentTiles
|
|
20248
20312
|
})));
|
|
20249
20313
|
currentTiles = [];
|
|
20250
20314
|
}
|
|
20251
20315
|
});
|
|
20252
20316
|
return tileContainers;
|
|
20253
|
-
};
|
|
20254
|
-
return /*#__PURE__*/
|
|
20317
|
+
}, [gridTiles, columnsPerRow, getTileWidth]);
|
|
20318
|
+
return /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(SectionHeader, {
|
|
20255
20319
|
title: section.title,
|
|
20256
20320
|
description: section.description
|
|
20257
|
-
}), /*#__PURE__*/
|
|
20321
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20258
20322
|
style: styles$2.grid
|
|
20259
|
-
},
|
|
20323
|
+
}, renderTileContainers()));
|
|
20260
20324
|
};
|
|
20261
20325
|
var styles$2 = StyleSheet$1.create({
|
|
20262
20326
|
grid: {
|
|
@@ -20340,22 +20404,25 @@ var useSectionStyles = function () {
|
|
|
20340
20404
|
});
|
|
20341
20405
|
};
|
|
20342
20406
|
|
|
20343
|
-
|
|
20344
|
-
|
|
20345
|
-
|
|
20346
|
-
|
|
20347
|
-
|
|
20407
|
+
/**
|
|
20408
|
+
* SectionContext provides the current section data to child components.
|
|
20409
|
+
*/
|
|
20410
|
+
var SectionContext = /*#__PURE__*/React.createContext(undefined);
|
|
20411
|
+
/**
|
|
20412
|
+
* Custom hook to fetch section data.
|
|
20413
|
+
*/
|
|
20414
|
+
var useSectionData = function (section, sectionId) {
|
|
20348
20415
|
var getSectionByID = useWllSdk().getSectionByID;
|
|
20349
|
-
var
|
|
20350
|
-
sectionData =
|
|
20351
|
-
setSectionData =
|
|
20352
|
-
var
|
|
20353
|
-
isLoading =
|
|
20354
|
-
setIsLoading =
|
|
20355
|
-
var
|
|
20356
|
-
error =
|
|
20357
|
-
setError =
|
|
20358
|
-
React
|
|
20416
|
+
var _a = React.useState(section || null),
|
|
20417
|
+
sectionData = _a[0],
|
|
20418
|
+
setSectionData = _a[1];
|
|
20419
|
+
var _b = React.useState(false),
|
|
20420
|
+
isLoading = _b[0],
|
|
20421
|
+
setIsLoading = _b[1];
|
|
20422
|
+
var _c = React.useState(null),
|
|
20423
|
+
error = _c[0],
|
|
20424
|
+
setError = _c[1];
|
|
20425
|
+
React.useEffect(function () {
|
|
20359
20426
|
if (section) {
|
|
20360
20427
|
setSectionData(section);
|
|
20361
20428
|
} else if (sectionId) {
|
|
@@ -20375,12 +20442,12 @@ var Section = function (_a) {
|
|
|
20375
20442
|
if (response.status === 'success' && response.data) {
|
|
20376
20443
|
setSectionData(response.data);
|
|
20377
20444
|
} else {
|
|
20378
|
-
setError(response.error || 'Failed to fetch section');
|
|
20445
|
+
setError(response.error || 'Failed to fetch section data.');
|
|
20379
20446
|
}
|
|
20380
20447
|
return [3 /*break*/, 5];
|
|
20381
20448
|
case 3:
|
|
20382
20449
|
err_1 = _a.sent();
|
|
20383
|
-
setError(err_1 instanceof Error ? err_1.message : 'Failed to fetch section');
|
|
20450
|
+
setError(err_1 instanceof Error ? err_1.message : 'Failed to fetch section data.');
|
|
20384
20451
|
return [3 /*break*/, 5];
|
|
20385
20452
|
case 4:
|
|
20386
20453
|
setIsLoading(false);
|
|
@@ -20394,95 +20461,151 @@ var Section = function (_a) {
|
|
|
20394
20461
|
fetchSection();
|
|
20395
20462
|
}
|
|
20396
20463
|
}, [section, sectionId, getSectionByID]);
|
|
20464
|
+
return {
|
|
20465
|
+
sectionData: sectionData,
|
|
20466
|
+
isLoading: isLoading,
|
|
20467
|
+
error: error
|
|
20468
|
+
};
|
|
20469
|
+
};
|
|
20470
|
+
/**
|
|
20471
|
+
* Component to display an empty state with a message.
|
|
20472
|
+
*/
|
|
20473
|
+
var EmptyState = function (_a) {
|
|
20474
|
+
var message = _a.message;
|
|
20475
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20476
|
+
style: commonStyles.emptyContainer
|
|
20477
|
+
}, /*#__PURE__*/React.createElement(Text$3, null, message));
|
|
20478
|
+
};
|
|
20479
|
+
/**
|
|
20480
|
+
* The Section component renders a section based on its type (e.g., Banner, Grid).
|
|
20481
|
+
*/
|
|
20482
|
+
var Section = function (_a) {
|
|
20483
|
+
var section = _a.section,
|
|
20484
|
+
sectionId = _a.sectionId;
|
|
20485
|
+
var styles = useSectionStyles();
|
|
20486
|
+
var _b = useSectionData(section, sectionId),
|
|
20487
|
+
sectionData = _b.sectionData,
|
|
20488
|
+
isLoading = _b.isLoading,
|
|
20489
|
+
error = _b.error;
|
|
20490
|
+
if (!section && !sectionId) {
|
|
20491
|
+
console.warn('Section component requires either section or sectionId prop.');
|
|
20492
|
+
return null;
|
|
20493
|
+
}
|
|
20397
20494
|
var renderSectionContent = function () {
|
|
20398
20495
|
if (isLoading) {
|
|
20399
|
-
return /*#__PURE__*/React
|
|
20496
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20400
20497
|
style: commonStyles.emptyContainer
|
|
20401
|
-
}, /*#__PURE__*/React
|
|
20498
|
+
}, /*#__PURE__*/React.createElement(Skeleton, null));
|
|
20402
20499
|
}
|
|
20403
20500
|
if (error || !sectionData) {
|
|
20404
|
-
return /*#__PURE__*/React
|
|
20405
|
-
|
|
20406
|
-
}
|
|
20501
|
+
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
20502
|
+
message: error || 'No section data available.'
|
|
20503
|
+
});
|
|
20407
20504
|
}
|
|
20408
20505
|
switch (sectionData.type) {
|
|
20409
20506
|
case exports.SectionType.Banner:
|
|
20410
|
-
return /*#__PURE__*/React
|
|
20507
|
+
return /*#__PURE__*/React.createElement(Carousel, {
|
|
20411
20508
|
section: sectionData
|
|
20412
20509
|
});
|
|
20413
20510
|
case exports.SectionType.Grid:
|
|
20414
|
-
return /*#__PURE__*/React
|
|
20511
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
20415
20512
|
section: sectionData
|
|
20416
20513
|
});
|
|
20417
20514
|
default:
|
|
20418
20515
|
console.warn("Unknown section type: ".concat(sectionData.type));
|
|
20419
|
-
return
|
|
20516
|
+
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
20517
|
+
message: "Unknown section type."
|
|
20518
|
+
});
|
|
20420
20519
|
}
|
|
20421
20520
|
};
|
|
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, {
|
|
20521
|
+
return sectionData ? /*#__PURE__*/React.createElement(SectionContext.Provider, {
|
|
20427
20522
|
value: {
|
|
20428
20523
|
sectionData: sectionData
|
|
20429
20524
|
}
|
|
20430
|
-
}, /*#__PURE__*/React
|
|
20525
|
+
}, /*#__PURE__*/React.createElement(View$2, {
|
|
20431
20526
|
style: styles.section
|
|
20432
20527
|
}, renderSectionContent())) : null;
|
|
20433
20528
|
};
|
|
20434
20529
|
|
|
20530
|
+
/**
|
|
20531
|
+
* A page-level component that represents a Group view in the application.
|
|
20532
|
+
*
|
|
20533
|
+
* This component serves as a container page that manages the fetching and display
|
|
20534
|
+
* of a group's data and its associated sections. It handles various states including
|
|
20535
|
+
* loading, errors, and empty states, providing a complete page experience for
|
|
20536
|
+
* viewing group content.
|
|
20537
|
+
*
|
|
20538
|
+
* @param id - The unique identifier of the group to fetch and display.
|
|
20539
|
+
*/
|
|
20435
20540
|
var Group = function (_a) {
|
|
20436
20541
|
var id = _a.id;
|
|
20542
|
+
if (!id) return null;
|
|
20437
20543
|
var getGroupByID = useWllSdk().getGroupByID;
|
|
20438
|
-
var _b = React
|
|
20544
|
+
var _b = React.useState(null),
|
|
20439
20545
|
groupData = _b[0],
|
|
20440
20546
|
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
|
-
|
|
20547
|
+
var _c = React.useState(null),
|
|
20548
|
+
error = _c[0],
|
|
20549
|
+
setError = _c[1];
|
|
20550
|
+
var fetchGroup = React.useCallback(function () {
|
|
20551
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
20552
|
+
var response;
|
|
20553
|
+
return __generator(this, function (_a) {
|
|
20554
|
+
switch (_a.label) {
|
|
20555
|
+
case 0:
|
|
20556
|
+
_a.trys.push([0, 2,, 3]);
|
|
20557
|
+
setError(null);
|
|
20558
|
+
return [4 /*yield*/, getGroupByID(id)];
|
|
20559
|
+
case 1:
|
|
20560
|
+
response = _a.sent();
|
|
20561
|
+
setGroupData(response.data);
|
|
20562
|
+
return [3 /*break*/, 3];
|
|
20563
|
+
case 2:
|
|
20564
|
+
_a.sent();
|
|
20565
|
+
setError('Failed to fetch group data. Please try again later.');
|
|
20566
|
+
return [3 /*break*/, 3];
|
|
20567
|
+
case 3:
|
|
20568
|
+
return [2 /*return*/];
|
|
20569
|
+
}
|
|
20460
20570
|
});
|
|
20461
|
-
};
|
|
20462
|
-
fetchGroup();
|
|
20571
|
+
});
|
|
20463
20572
|
}, [id, getGroupByID]);
|
|
20464
|
-
|
|
20465
|
-
|
|
20573
|
+
React.useEffect(function () {
|
|
20574
|
+
fetchGroup();
|
|
20575
|
+
}, [fetchGroup]);
|
|
20576
|
+
// Handle loading state
|
|
20577
|
+
if (!groupData && !error) {
|
|
20578
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20466
20579
|
style: commonStyles.emptyContainer
|
|
20467
|
-
}, /*#__PURE__*/React
|
|
20580
|
+
}, /*#__PURE__*/React.createElement(Skeleton, null));
|
|
20468
20581
|
}
|
|
20582
|
+
// Handle error state
|
|
20583
|
+
if (error) {
|
|
20584
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20585
|
+
style: commonStyles.emptyContainer
|
|
20586
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20587
|
+
variant: "body"
|
|
20588
|
+
}, error));
|
|
20589
|
+
}
|
|
20590
|
+
// Handle empty group data
|
|
20469
20591
|
if (!groupData) {
|
|
20470
|
-
return /*#__PURE__*/React
|
|
20592
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20471
20593
|
style: commonStyles.emptyContainer
|
|
20472
|
-
}, /*#__PURE__*/React
|
|
20594
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20473
20595
|
variant: "body"
|
|
20474
20596
|
}, "No group data available"));
|
|
20475
20597
|
}
|
|
20598
|
+
// Handle empty sections
|
|
20476
20599
|
if (!groupData.sections || groupData.sections.length === 0) {
|
|
20477
|
-
return /*#__PURE__*/React
|
|
20600
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20478
20601
|
style: commonStyles.emptyContainer
|
|
20479
|
-
}, /*#__PURE__*/React
|
|
20602
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20480
20603
|
variant: "body"
|
|
20481
20604
|
}, "No sections available"));
|
|
20482
20605
|
}
|
|
20483
20606
|
var sortedSections = sortByPriority(groupData.sections);
|
|
20484
|
-
return /*#__PURE__*/React
|
|
20485
|
-
return /*#__PURE__*/React
|
|
20607
|
+
return /*#__PURE__*/React.createElement(View$2, null, sortedSections.map(function (section) {
|
|
20608
|
+
return /*#__PURE__*/React.createElement(Section, {
|
|
20486
20609
|
key: section.id,
|
|
20487
20610
|
section: section
|
|
20488
20611
|
});
|
|
@@ -20537,17 +20660,20 @@ var PointsTileFormattedPoints = function () {
|
|
|
20537
20660
|
var styles = usePointsTileStyles();
|
|
20538
20661
|
var configuration = useTileContext().configuration;
|
|
20539
20662
|
var _a = configuration,
|
|
20540
|
-
|
|
20541
|
-
|
|
20542
|
-
|
|
20663
|
+
_b = _a.multiplier,
|
|
20664
|
+
multiplier = _b === void 0 ? 1 : _b,
|
|
20665
|
+
_c = _a.pointsPrefix,
|
|
20666
|
+
pointsPrefix = _c === void 0 ? '' : _c,
|
|
20667
|
+
_d = _a.pointsSuffix,
|
|
20668
|
+
pointsSuffix = _d === void 0 ? 'pts' : _d,
|
|
20543
20669
|
points = _a.points;
|
|
20544
|
-
|
|
20545
|
-
|
|
20546
|
-
return /*#__PURE__*/
|
|
20670
|
+
if (points === undefined) return null;
|
|
20671
|
+
var calculatedPoints = points * multiplier;
|
|
20672
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20547
20673
|
variant: "caption"
|
|
20548
|
-
}, pointsPrefix
|
|
20674
|
+
}, pointsPrefix, /*#__PURE__*/React.createElement(Row, null, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
|
|
20549
20675
|
style: styles.suffix
|
|
20550
|
-
}, pointsSuffix
|
|
20676
|
+
}, pointsSuffix)));
|
|
20551
20677
|
};
|
|
20552
20678
|
|
|
20553
20679
|
var PointsTileMedia = function (_a) {
|
|
@@ -20556,9 +20682,9 @@ var PointsTileMedia = function (_a) {
|
|
|
20556
20682
|
var artworkUrl = configuration.artworkUrl;
|
|
20557
20683
|
var styles = usePointsTileStyles(isFullSize);
|
|
20558
20684
|
if (!artworkUrl) return null;
|
|
20559
|
-
return /*#__PURE__*/React
|
|
20685
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20560
20686
|
style: styles.imageContainer
|
|
20561
|
-
}, /*#__PURE__*/React
|
|
20687
|
+
}, /*#__PURE__*/React.createElement(Image$2, {
|
|
20562
20688
|
source: {
|
|
20563
20689
|
uri: artworkUrl
|
|
20564
20690
|
},
|
|
@@ -20570,30 +20696,41 @@ var PointsTileMedia = function (_a) {
|
|
|
20570
20696
|
var PointsTileTitle = function () {
|
|
20571
20697
|
var configuration = useTileContext().configuration;
|
|
20572
20698
|
var title = configuration.title;
|
|
20573
|
-
return /*#__PURE__*/React
|
|
20699
|
+
return title ? /*#__PURE__*/React.createElement(Text, {
|
|
20574
20700
|
variant: "eyebrow"
|
|
20575
|
-
}, title);
|
|
20701
|
+
}, title) : null;
|
|
20576
20702
|
};
|
|
20577
20703
|
|
|
20578
|
-
|
|
20704
|
+
/**
|
|
20705
|
+
* The PointsTile component renders a tile with media, title, and formatted points.
|
|
20706
|
+
*
|
|
20707
|
+
* @param tile - The tile data to render.
|
|
20708
|
+
*/
|
|
20709
|
+
var PointsTileRoot = function (_a) {
|
|
20579
20710
|
var tile = _a.tile;
|
|
20711
|
+
if (!tile) return null;
|
|
20580
20712
|
var isFullSize = useTileSize(tile).isFullSize;
|
|
20581
20713
|
var styles = usePointsTileStyles(isFullSize);
|
|
20582
|
-
return /*#__PURE__*/React
|
|
20714
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
20583
20715
|
tile: tile
|
|
20584
|
-
}, isFullSize && /*#__PURE__*/React
|
|
20585
|
-
isFullSize:
|
|
20586
|
-
}), /*#__PURE__*/React
|
|
20716
|
+
}, isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
20717
|
+
isFullSize: true
|
|
20718
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20587
20719
|
style: styles.container
|
|
20588
|
-
}, !isFullSize && /*#__PURE__*/React
|
|
20589
|
-
isFullSize:
|
|
20590
|
-
}), /*#__PURE__*/React
|
|
20720
|
+
}, !isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
20721
|
+
isFullSize: false
|
|
20722
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
20591
20723
|
style: styles.contentContainer
|
|
20592
|
-
}, /*#__PURE__*/React
|
|
20724
|
+
}, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null))));
|
|
20593
20725
|
};
|
|
20594
|
-
|
|
20595
|
-
PointsTile
|
|
20596
|
-
|
|
20726
|
+
/**
|
|
20727
|
+
* The PointsTile component with subcomponents attached.
|
|
20728
|
+
*/
|
|
20729
|
+
var PointsTile = Object.assign(PointsTileRoot, {
|
|
20730
|
+
Title: PointsTileTitle,
|
|
20731
|
+
Points: PointsTileFormattedPoints,
|
|
20732
|
+
Media: PointsTileMedia
|
|
20733
|
+
});
|
|
20597
20734
|
var PointsTile$1 = withTileFetching(PointsTile);
|
|
20598
20735
|
|
|
20599
20736
|
var useRewardCategoryTileStyles = function () {
|
|
@@ -20635,11 +20772,11 @@ var RewardCategoryHeader = function () {
|
|
|
20635
20772
|
showName = _a.showName,
|
|
20636
20773
|
name = _a.name;
|
|
20637
20774
|
if (!showName || !name) return null;
|
|
20638
|
-
return /*#__PURE__*/React
|
|
20775
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20639
20776
|
style: [styles.header, {
|
|
20640
20777
|
backgroundColor: theme.primary
|
|
20641
20778
|
}]
|
|
20642
|
-
}, /*#__PURE__*/React
|
|
20779
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20643
20780
|
style: [styles.headerText, {
|
|
20644
20781
|
color: theme.primaryText
|
|
20645
20782
|
}],
|
|
@@ -20653,7 +20790,7 @@ var RewardCategoryMedia = function () {
|
|
|
20653
20790
|
var configuration = useTileContext().configuration;
|
|
20654
20791
|
var artworkUrl = configuration.artworkUrl;
|
|
20655
20792
|
if (!artworkUrl) return null;
|
|
20656
|
-
return /*#__PURE__*/React
|
|
20793
|
+
return /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
20657
20794
|
source: {
|
|
20658
20795
|
uri: artworkUrl
|
|
20659
20796
|
},
|
|
@@ -20661,20 +20798,30 @@ var RewardCategoryMedia = function () {
|
|
|
20661
20798
|
});
|
|
20662
20799
|
};
|
|
20663
20800
|
|
|
20664
|
-
|
|
20801
|
+
/**
|
|
20802
|
+
* The RewardCategoryTile component renders a tile with a header and media.
|
|
20803
|
+
*
|
|
20804
|
+
* @param tile - The tile data to render.
|
|
20805
|
+
*/
|
|
20806
|
+
var RewardCategoryTileRoot = function (_a) {
|
|
20665
20807
|
var tile = _a.tile;
|
|
20666
20808
|
if (!tile) return null;
|
|
20667
|
-
return /*#__PURE__*/
|
|
20809
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
20668
20810
|
tile: tile
|
|
20669
|
-
}, /*#__PURE__*/
|
|
20811
|
+
}, /*#__PURE__*/React.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React.createElement(RewardCategoryTile.Media, null));
|
|
20670
20812
|
};
|
|
20671
|
-
|
|
20672
|
-
RewardCategoryTile
|
|
20813
|
+
/**
|
|
20814
|
+
* The RewardCategoryTile component with subcomponents attached.
|
|
20815
|
+
*/
|
|
20816
|
+
var RewardCategoryTile = Object.assign(RewardCategoryTileRoot, {
|
|
20817
|
+
Header: RewardCategoryHeader,
|
|
20818
|
+
Media: RewardCategoryMedia
|
|
20819
|
+
});
|
|
20673
20820
|
var RewardCategoryTile$1 = withTileFetching(RewardCategoryTile);
|
|
20674
20821
|
|
|
20675
20822
|
var RewardTileChevron = function () {
|
|
20676
20823
|
var theme = useWllSdk().theme;
|
|
20677
|
-
return /*#__PURE__*/React
|
|
20824
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
20678
20825
|
name: "ChevronRight",
|
|
20679
20826
|
color: theme.derivedSurfaceText[20]
|
|
20680
20827
|
});
|
|
@@ -20715,6 +20862,9 @@ var useRewardTileStyles = function () {
|
|
|
20715
20862
|
suffix: {
|
|
20716
20863
|
color: theme.primary,
|
|
20717
20864
|
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet)
|
|
20865
|
+
},
|
|
20866
|
+
header: {
|
|
20867
|
+
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
|
|
20718
20868
|
}
|
|
20719
20869
|
});
|
|
20720
20870
|
};
|
|
@@ -20734,9 +20884,9 @@ var RewardTileMedia = function (_a) {
|
|
|
20734
20884
|
return (
|
|
20735
20885
|
/*#__PURE__*/
|
|
20736
20886
|
// @ts-ignore: We are using percentage values for flexBasis, which is valid in React Native but TypeScript expects a number.
|
|
20737
|
-
React
|
|
20887
|
+
React.createElement(View$2, {
|
|
20738
20888
|
style: [styles.imageContainer, containerStyle]
|
|
20739
|
-
}, /*#__PURE__*/React
|
|
20889
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
20740
20890
|
source: {
|
|
20741
20891
|
uri: artworkUrl
|
|
20742
20892
|
},
|
|
@@ -20751,17 +20901,22 @@ var RewardTilePoints = function () {
|
|
|
20751
20901
|
var _a = configuration,
|
|
20752
20902
|
showPrice = _a.showPrice,
|
|
20753
20903
|
price = _a.price,
|
|
20754
|
-
|
|
20755
|
-
|
|
20756
|
-
|
|
20757
|
-
|
|
20758
|
-
|
|
20759
|
-
|
|
20904
|
+
_b = _a.pointsMultiplier,
|
|
20905
|
+
pointsMultiplier = _b === void 0 ? 1 : _b,
|
|
20906
|
+
_c = _a.pointsPrefix,
|
|
20907
|
+
pointsPrefix = _c === void 0 ? '' : _c,
|
|
20908
|
+
_d = _a.pointsSuffix,
|
|
20909
|
+
pointsSuffix = _d === void 0 ? 'pts' : _d;
|
|
20910
|
+
// Exit early if price is not shown or undefined
|
|
20911
|
+
if (!showPrice || price === undefined) return null;
|
|
20912
|
+
// Calculate points
|
|
20913
|
+
var calculatedPoints = price * Number(pointsMultiplier);
|
|
20914
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20760
20915
|
variant: "caption",
|
|
20761
20916
|
style: styles.footer
|
|
20762
|
-
}, pointsPrefix, /*#__PURE__*/React
|
|
20917
|
+
}, pointsPrefix, /*#__PURE__*/React.createElement(View$2, {
|
|
20763
20918
|
style: styles.pointsContainer
|
|
20764
|
-
}, calculatedPoints, /*#__PURE__*/React
|
|
20919
|
+
}, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
|
|
20765
20920
|
style: styles.suffix
|
|
20766
20921
|
}, pointsSuffix)));
|
|
20767
20922
|
};
|
|
@@ -20770,7 +20925,7 @@ var RewardTileSummary = function () {
|
|
|
20770
20925
|
var configuration = useTileContext().configuration;
|
|
20771
20926
|
var summary = configuration.summary;
|
|
20772
20927
|
if (!summary) return null;
|
|
20773
|
-
return /*#__PURE__*/React
|
|
20928
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20774
20929
|
variant: "body"
|
|
20775
20930
|
}, summary);
|
|
20776
20931
|
};
|
|
@@ -20779,33 +20934,217 @@ var RewardTileTitle = function () {
|
|
|
20779
20934
|
var configuration = useTileContext().configuration;
|
|
20780
20935
|
var name = configuration.name;
|
|
20781
20936
|
if (!name) return null;
|
|
20782
|
-
return /*#__PURE__*/React
|
|
20937
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
20783
20938
|
variant: "title",
|
|
20784
20939
|
ellipsizeMode: "tail",
|
|
20785
20940
|
numberOfLines: 1
|
|
20786
20941
|
}, name);
|
|
20787
20942
|
};
|
|
20788
20943
|
|
|
20789
|
-
|
|
20944
|
+
/**
|
|
20945
|
+
* Helper function to determine if the tile should display artwork only.
|
|
20946
|
+
*
|
|
20947
|
+
* @param configuration - The configuration object of the tile.
|
|
20948
|
+
* @returns `true` if the tile should display artwork only.
|
|
20949
|
+
*/
|
|
20950
|
+
var isArtworkOnly = function (configuration) {
|
|
20951
|
+
return !configuration.showDetails;
|
|
20952
|
+
};
|
|
20953
|
+
/**
|
|
20954
|
+
* The RewardTile component renders a tile with media, title, summary, points, and a chevron.
|
|
20955
|
+
*
|
|
20956
|
+
* @param tile - The tile data to render.
|
|
20957
|
+
*/
|
|
20958
|
+
var RewardTileRoot = function (_a) {
|
|
20790
20959
|
var tile = _a.tile;
|
|
20960
|
+
var styles = useRewardTileStyles();
|
|
20961
|
+
if (!tile) return null;
|
|
20791
20962
|
var configuration = tile.configuration;
|
|
20792
|
-
|
|
20793
|
-
return /*#__PURE__*/React$1.createElement(BaseTile, {
|
|
20963
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
20794
20964
|
tile: tile
|
|
20795
|
-
}, /*#__PURE__*/React
|
|
20796
|
-
isArtworkOnly:
|
|
20797
|
-
}), /*#__PURE__*/React
|
|
20965
|
+
}, /*#__PURE__*/React.createElement(RewardTile.Media, {
|
|
20966
|
+
isArtworkOnly: isArtworkOnly(configuration)
|
|
20967
|
+
}), /*#__PURE__*/React.createElement(Column, null, /*#__PURE__*/React.createElement(Row, {
|
|
20798
20968
|
justify: "between",
|
|
20799
|
-
align: "center"
|
|
20800
|
-
|
|
20969
|
+
align: "center",
|
|
20970
|
+
style: styles.header
|
|
20971
|
+
}, /*#__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
20972
|
};
|
|
20802
|
-
|
|
20803
|
-
RewardTile
|
|
20804
|
-
|
|
20805
|
-
RewardTile
|
|
20806
|
-
|
|
20973
|
+
/**
|
|
20974
|
+
* The RewardTile component with subcomponents attached.
|
|
20975
|
+
*/
|
|
20976
|
+
var RewardTile = Object.assign(RewardTileRoot, {
|
|
20977
|
+
Media: RewardTileMedia,
|
|
20978
|
+
Title: RewardTileTitle,
|
|
20979
|
+
Summary: RewardTileSummary,
|
|
20980
|
+
Points: RewardTilePoints,
|
|
20981
|
+
Chevron: RewardTileChevron
|
|
20982
|
+
});
|
|
20807
20983
|
var RewardTile$1 = withTileFetching(RewardTile);
|
|
20808
20984
|
|
|
20985
|
+
var justifyMap = {
|
|
20986
|
+
start: 'flex-start',
|
|
20987
|
+
end: 'flex-end',
|
|
20988
|
+
center: 'center',
|
|
20989
|
+
between: 'space-between',
|
|
20990
|
+
around: 'space-around',
|
|
20991
|
+
evenly: 'space-evenly'
|
|
20992
|
+
};
|
|
20993
|
+
var alignMap = {
|
|
20994
|
+
start: 'flex-start',
|
|
20995
|
+
end: 'flex-end',
|
|
20996
|
+
center: 'center',
|
|
20997
|
+
stretch: 'stretch',
|
|
20998
|
+
baseline: 'baseline'
|
|
20999
|
+
};
|
|
21000
|
+
|
|
21001
|
+
/**
|
|
21002
|
+
* A Column layout component that arranges its children in a vertical stack.
|
|
21003
|
+
*
|
|
21004
|
+
* @param children - The child components to render inside the column.
|
|
21005
|
+
* @param justify - Defines how children are aligned along the main axis.
|
|
21006
|
+
* @param align - Defines how children are aligned along the cross axis.
|
|
21007
|
+
* @param style - Additional styles to apply to the container.
|
|
21008
|
+
*/
|
|
21009
|
+
var Column = /*#__PURE__*/React.memo(function (_a) {
|
|
21010
|
+
var _b, _c;
|
|
21011
|
+
var children = _a.children,
|
|
21012
|
+
_d = _a.justify,
|
|
21013
|
+
justify = _d === void 0 ? 'start' : _d,
|
|
21014
|
+
_e = _a.align,
|
|
21015
|
+
align = _e === void 0 ? 'stretch' : _e,
|
|
21016
|
+
style = _a.style;
|
|
21017
|
+
var _f = useResponsive$1(),
|
|
21018
|
+
isDesktop = _f.isDesktop,
|
|
21019
|
+
isTablet = _f.isTablet;
|
|
21020
|
+
var theme = useWllSdk().theme;
|
|
21021
|
+
var spacing = useResponsiveValue((_b = theme === null || theme === void 0 ? void 0 : theme.sizes) === null || _b === void 0 ? void 0 : _b.sm, (_c = theme === null || theme === void 0 ? void 0 : theme.sizes) === null || _c === void 0 ? void 0 : _c.xxxs, isDesktop, isTablet);
|
|
21022
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21023
|
+
style: [{
|
|
21024
|
+
flex: 1,
|
|
21025
|
+
flexDirection: 'column',
|
|
21026
|
+
justifyContent: justifyMap[justify],
|
|
21027
|
+
alignItems: alignMap[align],
|
|
21028
|
+
paddingHorizontal: spacing,
|
|
21029
|
+
paddingBottom: spacing
|
|
21030
|
+
}, style]
|
|
21031
|
+
}, children);
|
|
21032
|
+
});
|
|
21033
|
+
|
|
21034
|
+
/**
|
|
21035
|
+
* A FlexBox component that provides a flexible container with `flex: 1`.
|
|
21036
|
+
*
|
|
21037
|
+
* This component is commonly used to create a full-flex container that expands
|
|
21038
|
+
* to fill available space in a layout.
|
|
21039
|
+
*/
|
|
21040
|
+
var FlexBox = function (_a) {
|
|
21041
|
+
var children = _a.children,
|
|
21042
|
+
style = _a.style;
|
|
21043
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21044
|
+
style: [{
|
|
21045
|
+
flex: 1
|
|
21046
|
+
}, style]
|
|
21047
|
+
}, children);
|
|
21048
|
+
};
|
|
21049
|
+
|
|
21050
|
+
var Layout = function (_a) {
|
|
21051
|
+
var children = _a.children,
|
|
21052
|
+
_b = _a.justify,
|
|
21053
|
+
justify = _b === void 0 ? 'start' : _b,
|
|
21054
|
+
_c = _a.align,
|
|
21055
|
+
align = _c === void 0 ? 'stretch' : _c,
|
|
21056
|
+
_d = _a.direction,
|
|
21057
|
+
direction = _d === void 0 ? 'column' : _d,
|
|
21058
|
+
_e = _a.style,
|
|
21059
|
+
style = _e === void 0 ? {} : _e;
|
|
21060
|
+
var theme = useWllSdk().theme;
|
|
21061
|
+
var _f = useResponsive$1(),
|
|
21062
|
+
isDesktop = _f.isDesktop,
|
|
21063
|
+
isTablet = _f.isTablet;
|
|
21064
|
+
var dynamicStyles = StyleSheet$1.create({
|
|
21065
|
+
column: {
|
|
21066
|
+
flex: 1,
|
|
21067
|
+
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
21068
|
+
paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
21069
|
+
justifyContent: justifyMap[justify],
|
|
21070
|
+
alignItems: alignMap[align],
|
|
21071
|
+
flexDirection: direction
|
|
21072
|
+
}
|
|
21073
|
+
});
|
|
21074
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21075
|
+
style: [dynamicStyles.column, style]
|
|
21076
|
+
}, children);
|
|
21077
|
+
};
|
|
21078
|
+
|
|
21079
|
+
/**
|
|
21080
|
+
* A Row layout component that arranges its children in a horizontal stack.
|
|
21081
|
+
*
|
|
21082
|
+
* @param children - The child components to render inside the row.
|
|
21083
|
+
* @param justify - Defines how children are aligned along the main axis (horizontal).
|
|
21084
|
+
* @param align - Defines how children are aligned along the cross axis (vertical).
|
|
21085
|
+
* @param direction - The flex direction for the row (default is 'row').
|
|
21086
|
+
* @param style - Additional styles to apply to the container.
|
|
21087
|
+
*/
|
|
21088
|
+
var Row = function (_a) {
|
|
21089
|
+
var children = _a.children,
|
|
21090
|
+
_b = _a.justify,
|
|
21091
|
+
justify = _b === void 0 ? 'start' : _b,
|
|
21092
|
+
_c = _a.align,
|
|
21093
|
+
align = _c === void 0 ? 'center' : _c,
|
|
21094
|
+
_d = _a.direction,
|
|
21095
|
+
direction = _d === void 0 ? 'row' : _d,
|
|
21096
|
+
style = _a.style;
|
|
21097
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21098
|
+
style: [{
|
|
21099
|
+
flexDirection: direction,
|
|
21100
|
+
justifyContent: justifyMap[justify],
|
|
21101
|
+
alignItems: alignMap[align]
|
|
21102
|
+
}, style]
|
|
21103
|
+
}, children);
|
|
21104
|
+
};
|
|
21105
|
+
|
|
21106
|
+
/**
|
|
21107
|
+
* A simple Spacer component that creates flexible space in layouts.
|
|
21108
|
+
*
|
|
21109
|
+
* The Spacer is commonly used in flexbox layouts to create adjustable empty space
|
|
21110
|
+
* between child elements, avoiding the need for explicit margins or padding.
|
|
21111
|
+
*/
|
|
21112
|
+
var Spacer = function (_a) {
|
|
21113
|
+
var style = _a.style;
|
|
21114
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21115
|
+
style: [{
|
|
21116
|
+
flex: 1
|
|
21117
|
+
}, style]
|
|
21118
|
+
});
|
|
21119
|
+
};
|
|
21120
|
+
|
|
21121
|
+
/**
|
|
21122
|
+
* A Stack layout component that arranges its children in a flexible stack.
|
|
21123
|
+
*
|
|
21124
|
+
* @param children - The child components to render inside the stack.
|
|
21125
|
+
* @param justify - Defines how children are aligned along the main axis.
|
|
21126
|
+
* @param align - Defines how children are aligned along the cross axis.
|
|
21127
|
+
* @param direction - The flex direction for the stack (default is 'column').
|
|
21128
|
+
* @param style - Additional styles to apply to the container.
|
|
21129
|
+
*/
|
|
21130
|
+
var Stack = function (_a) {
|
|
21131
|
+
var children = _a.children,
|
|
21132
|
+
_b = _a.justify,
|
|
21133
|
+
justify = _b === void 0 ? 'start' : _b,
|
|
21134
|
+
_c = _a.align,
|
|
21135
|
+
align = _c === void 0 ? 'stretch' : _c,
|
|
21136
|
+
_d = _a.direction,
|
|
21137
|
+
direction = _d === void 0 ? 'column' : _d,
|
|
21138
|
+
style = _a.style;
|
|
21139
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21140
|
+
style: [{
|
|
21141
|
+
flexDirection: direction,
|
|
21142
|
+
justifyContent: justifyMap[justify],
|
|
21143
|
+
alignItems: alignMap[align]
|
|
21144
|
+
}, style]
|
|
21145
|
+
}, children);
|
|
21146
|
+
};
|
|
21147
|
+
|
|
20809
21148
|
var useTierTileStyles = function () {
|
|
20810
21149
|
var _a = useResponsive$1(),
|
|
20811
21150
|
isDesktop = _a.isDesktop,
|
|
@@ -20886,7 +21225,7 @@ var TierTileFull = function (_a) {
|
|
|
20886
21225
|
},
|
|
20887
21226
|
style: styles.image,
|
|
20888
21227
|
resizeMode: "center"
|
|
20889
|
-
})), /*#__PURE__*/React__namespace.createElement(
|
|
21228
|
+
})), /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
20890
21229
|
align: "stretch",
|
|
20891
21230
|
justify: artworkUrl ? 'start' : 'center',
|
|
20892
21231
|
direction: "column"
|
|
@@ -20912,7 +21251,7 @@ var TierTileHalf = function (_a) {
|
|
|
20912
21251
|
name = _c.name;
|
|
20913
21252
|
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
20914
21253
|
tile: tile
|
|
20915
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
21254
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
20916
21255
|
align: "center",
|
|
20917
21256
|
justify: "between",
|
|
20918
21257
|
direction: "row",
|
|
@@ -20953,7 +21292,7 @@ var TierTileEmpty = function (_a) {
|
|
|
20953
21292
|
if (isHalfSize) {
|
|
20954
21293
|
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
20955
21294
|
tile: tile
|
|
20956
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
21295
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
20957
21296
|
align: "center",
|
|
20958
21297
|
justify: "between",
|
|
20959
21298
|
direction: "row",
|
|
@@ -20989,7 +21328,7 @@ var TierTileEmpty = function (_a) {
|
|
|
20989
21328
|
},
|
|
20990
21329
|
style: styles.image,
|
|
20991
21330
|
resizeMode: "center"
|
|
20992
|
-
})), /*#__PURE__*/React__namespace.createElement(
|
|
21331
|
+
})), /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
20993
21332
|
align: "stretch",
|
|
20994
21333
|
justify: "center",
|
|
20995
21334
|
direction: "column"
|
|
@@ -21005,46 +21344,26 @@ TierTile.Full = TierTileFull;
|
|
|
21005
21344
|
TierTile.Half = TierTileHalf;
|
|
21006
21345
|
TierTile.Empty = TierTileEmpty;
|
|
21007
21346
|
|
|
21347
|
+
var _a;
|
|
21348
|
+
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);
|
|
21349
|
+
/**
|
|
21350
|
+
* TileContainer component to render a list of tiles with proper layout and spacing.
|
|
21351
|
+
*/
|
|
21008
21352
|
var TileContainer = function (_a) {
|
|
21009
21353
|
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, {
|
|
21354
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21039
21355
|
style: styles.container
|
|
21040
21356
|
}, tiles.map(function (tile, index) {
|
|
21041
|
-
var
|
|
21042
|
-
|
|
21357
|
+
var TileComponent = TILE_COMPONENTS[tile.type];
|
|
21358
|
+
var isHalfSize = useTileSize(tile).isHalfSize;
|
|
21359
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21043
21360
|
key: tile.id,
|
|
21044
|
-
style: [styles.tileContainer,
|
|
21361
|
+
style: [styles.tileContainer, isHalfSize && styles.halfTileContainer, index > 0 && {
|
|
21045
21362
|
marginTop: GRID_GAP
|
|
21046
21363
|
}]
|
|
21047
|
-
},
|
|
21364
|
+
}, TileComponent ? /*#__PURE__*/React.createElement(TileComponent, {
|
|
21365
|
+
tile: tile
|
|
21366
|
+
}) : null);
|
|
21048
21367
|
}));
|
|
21049
21368
|
};
|
|
21050
21369
|
var styles = StyleSheet$1.create({
|
|
@@ -21063,90 +21382,6 @@ var styles = StyleSheet$1.create({
|
|
|
21063
21382
|
}
|
|
21064
21383
|
});
|
|
21065
21384
|
|
|
21066
|
-
var Column = function (_a) {
|
|
21067
|
-
var children = _a.children,
|
|
21068
|
-
_b = _a.justify,
|
|
21069
|
-
justify = _b === void 0 ? 'start' : _b,
|
|
21070
|
-
_c = _a.align,
|
|
21071
|
-
align = _c === void 0 ? 'stretch' : _c,
|
|
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
|
-
|
|
21107
|
-
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
|
-
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
|
-
style = _a.style;
|
|
21125
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
21126
|
-
style: [{
|
|
21127
|
-
flexDirection: direction,
|
|
21128
|
-
justifyContent: justifyMap[justify],
|
|
21129
|
-
alignItems: alignMap[align]
|
|
21130
|
-
}, style]
|
|
21131
|
-
}, children);
|
|
21132
|
-
};
|
|
21133
|
-
|
|
21134
|
-
var justifyMap = {
|
|
21135
|
-
start: 'flex-start',
|
|
21136
|
-
end: 'flex-end',
|
|
21137
|
-
center: 'center',
|
|
21138
|
-
between: 'space-between',
|
|
21139
|
-
around: 'space-around',
|
|
21140
|
-
evenly: 'space-evenly'
|
|
21141
|
-
};
|
|
21142
|
-
var alignMap = {
|
|
21143
|
-
start: 'flex-start',
|
|
21144
|
-
end: 'flex-end',
|
|
21145
|
-
center: 'center',
|
|
21146
|
-
stretch: 'stretch',
|
|
21147
|
-
baseline: 'baseline'
|
|
21148
|
-
};
|
|
21149
|
-
|
|
21150
21385
|
var Reward = /** @class */function () {
|
|
21151
21386
|
function Reward() {}
|
|
21152
21387
|
return Reward;
|
|
@@ -21161,7 +21396,6 @@ exports.BaseTile = BaseTile;
|
|
|
21161
21396
|
exports.Button = Button;
|
|
21162
21397
|
exports.Carousel = Carousel;
|
|
21163
21398
|
exports.Column = Column;
|
|
21164
|
-
exports.Content = Column$1;
|
|
21165
21399
|
exports.ContentTile = ContentTile$1;
|
|
21166
21400
|
exports.ContentTileConfig = ContentTileConfig;
|
|
21167
21401
|
exports.FlexBox = FlexBox;
|
|
@@ -21185,11 +21419,14 @@ exports.RowHeader = RowHeader;
|
|
|
21185
21419
|
exports.Section = Section;
|
|
21186
21420
|
exports.SectionHeader = SectionHeader;
|
|
21187
21421
|
exports.Skeleton = Skeleton;
|
|
21422
|
+
exports.Spacer = Spacer;
|
|
21188
21423
|
exports.Stack = Stack;
|
|
21189
21424
|
exports.Text = Text;
|
|
21190
21425
|
exports.TierTileConfig = TierTileConfig;
|
|
21191
21426
|
exports.TierTileUpdated = TierTile;
|
|
21192
21427
|
exports.TileContainer = TileContainer;
|
|
21193
21428
|
exports.WllSdkProvider = WllSdkProvider;
|
|
21429
|
+
exports.alignMap = alignMap;
|
|
21430
|
+
exports.justifyMap = justifyMap;
|
|
21194
21431
|
exports.useWllSdk = useWllSdk;
|
|
21195
21432
|
//# sourceMappingURL=index.js.map
|