zkit-ui 2.0.18 → 2.0.19
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.
|
@@ -95,7 +95,7 @@ const TITLE_MAX_WIDTH = (0, zkit_tools_1.wp)(214);
|
|
|
95
95
|
const IOS_SHADOW_OFFSET_Y = (0, zkit_tools_1.wp)(9);
|
|
96
96
|
const IOS_SHADOW_RADIUS = (0, zkit_tools_1.wp)(22);
|
|
97
97
|
const CONTENT_ENTER_OFFSET = (0, zkit_tools_1.wp)(3);
|
|
98
|
-
const HOST_BACKDROP = '
|
|
98
|
+
const HOST_BACKDROP = 'rgba(17, 24, 39, 0.48)';
|
|
99
99
|
const IS_IOS = react_native_1.Platform.OS === 'ios';
|
|
100
100
|
const IS_ANDROID = react_native_1.Platform.OS === 'android';
|
|
101
101
|
const IS_WEB = react_native_1.Platform.OS === 'web';
|
|
@@ -625,7 +625,7 @@ function LoadingHost({ item, onExited }) {
|
|
|
625
625
|
if (!item)
|
|
626
626
|
return null;
|
|
627
627
|
const pointerEvents = item.open ? (item.blocking ? 'auto' : 'none') : 'none';
|
|
628
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: pointerEvents, style: styles.host, accessibilityElementsHidden: !item.open, importantForAccessibility: item.open ? 'yes' : 'no-hide-descendants', collapsable: false, children: (0, jsx_runtime_1.jsx)(LoadingCard, { item: item, onExited: onExited }) }));
|
|
628
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: pointerEvents, style: [react_native_1.StyleSheet.absoluteFill, styles.host], accessibilityElementsHidden: !item.open, importantForAccessibility: item.open ? 'yes' : 'no-hide-descendants', collapsable: false, children: (0, jsx_runtime_1.jsx)(LoadingCard, { item: item, onExited: onExited }) }));
|
|
629
629
|
}
|
|
630
630
|
function resolveColors(item, themeColors) {
|
|
631
631
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -724,7 +724,7 @@ function LoadingCard({ item, onExited }) {
|
|
|
724
724
|
opacity: (0, react_native_reanimated_1.interpolate)(contentProgress.value, [0, 1], [0.72, 1]),
|
|
725
725
|
transform: [{ translateY: (0, react_native_reanimated_1.interpolate)(contentProgress.value, [0, 1], [CONTENT_ENTER_OFFSET, 0]) }],
|
|
726
726
|
}));
|
|
727
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: "none", style: [styles.backdrop, { backgroundColor: colors.backdrop }, backdropStyle] }), (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: item.open && item.blocking ? 'auto' : 'none', renderToHardwareTextureAndroid: IS_ANDROID && item.open, style: [
|
|
727
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: "none", style: [react_native_1.StyleSheet.absoluteFill, styles.backdrop, { backgroundColor: colors.backdrop }, backdropStyle] }), (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: item.open && item.blocking ? 'auto' : 'none', renderToHardwareTextureAndroid: IS_ANDROID && item.open, style: [
|
|
728
728
|
styles.frame,
|
|
729
729
|
webShadowStyle,
|
|
730
730
|
IS_IOS ? { shadowColor: colors.shadow } : undefined,
|
|
@@ -779,14 +779,11 @@ function renderDefaultIcon(item, colors) {
|
|
|
779
779
|
// ============================================================================
|
|
780
780
|
const styles = react_native_1.StyleSheet.create({
|
|
781
781
|
host: {
|
|
782
|
-
...react_native_1.StyleSheet.absoluteFillObject,
|
|
783
782
|
alignItems: 'center',
|
|
784
783
|
justifyContent: 'center',
|
|
785
784
|
zIndex: HOST_Z_INDEX,
|
|
786
785
|
},
|
|
787
|
-
backdrop: {
|
|
788
|
-
...react_native_1.StyleSheet.absoluteFillObject,
|
|
789
|
-
},
|
|
786
|
+
backdrop: {},
|
|
790
787
|
frame: {
|
|
791
788
|
alignSelf: 'center',
|
|
792
789
|
borderRadius: HUD_RADIUS,
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
- 全局只展示一个 HUD;新请求默认替换旧请求,并向旧请求派发 `replace`
|
|
9
9
|
- `loading.promise()` 绑定异步任务,成功/失败结果只会更新当前仍活跃的 handle
|
|
10
10
|
- `loading` 默认 15s 超时自动关闭,`success/error` 默认短暂停留后关闭
|
|
11
|
+
- blocking loading 默认使用全屏蒙层并将 HUD 居中显示;可通过 `colors.backdrop` 自定义蒙层颜色
|
|
11
12
|
- Android 不使用 `elevation` 或额外阴影层;iOS/Web 阴影跟随同一动画层,退出完成后卸载,避免残影
|
|
12
13
|
- 默认文案来自 i18n,可通过 `ZKitProvider loading` 或 `LoadingProvider defaults` 覆盖
|
|
13
14
|
|
|
@@ -240,7 +240,7 @@ const TITLE_MAX_WIDTH = wp(214);
|
|
|
240
240
|
const IOS_SHADOW_OFFSET_Y = wp(9);
|
|
241
241
|
const IOS_SHADOW_RADIUS = wp(22);
|
|
242
242
|
const CONTENT_ENTER_OFFSET = wp(3);
|
|
243
|
-
const HOST_BACKDROP = '
|
|
243
|
+
const HOST_BACKDROP = 'rgba(17, 24, 39, 0.48)';
|
|
244
244
|
|
|
245
245
|
const IS_IOS = Platform.OS === 'ios';
|
|
246
246
|
const IS_ANDROID = Platform.OS === 'android';
|
|
@@ -829,7 +829,7 @@ function LoadingHost({ item, onExited }: LoadingHostProps) {
|
|
|
829
829
|
return (
|
|
830
830
|
<View
|
|
831
831
|
pointerEvents={pointerEvents}
|
|
832
|
-
style={styles.host}
|
|
832
|
+
style={[StyleSheet.absoluteFill, styles.host]}
|
|
833
833
|
accessibilityElementsHidden={!item.open}
|
|
834
834
|
importantForAccessibility={item.open ? 'yes' : 'no-hide-descendants'}
|
|
835
835
|
collapsable={false}
|
|
@@ -953,7 +953,7 @@ function LoadingCard({ item, onExited }: LoadingCardProps) {
|
|
|
953
953
|
<>
|
|
954
954
|
<Animated.View
|
|
955
955
|
pointerEvents="none"
|
|
956
|
-
style={[styles.backdrop, { backgroundColor: colors.backdrop }, backdropStyle]}
|
|
956
|
+
style={[StyleSheet.absoluteFill, styles.backdrop, { backgroundColor: colors.backdrop }, backdropStyle]}
|
|
957
957
|
/>
|
|
958
958
|
<Animated.View
|
|
959
959
|
pointerEvents={item.open && item.blocking ? 'auto' : 'none'}
|
|
@@ -1066,14 +1066,11 @@ function renderDefaultIcon(item: LoadingItem, colors: ResolvedColors) {
|
|
|
1066
1066
|
|
|
1067
1067
|
const styles = StyleSheet.create({
|
|
1068
1068
|
host: {
|
|
1069
|
-
...StyleSheet.absoluteFillObject,
|
|
1070
1069
|
alignItems: 'center',
|
|
1071
1070
|
justifyContent: 'center',
|
|
1072
1071
|
zIndex: HOST_Z_INDEX,
|
|
1073
1072
|
},
|
|
1074
|
-
backdrop: {
|
|
1075
|
-
...StyleSheet.absoluteFillObject,
|
|
1076
|
-
},
|
|
1073
|
+
backdrop: {},
|
|
1077
1074
|
frame: {
|
|
1078
1075
|
alignSelf: 'center',
|
|
1079
1076
|
borderRadius: HUD_RADIUS,
|