@mpxjs/webpack-plugin 2.10.1-beta.10-3 → 2.10.1-beta.10-4
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.
|
@@ -41,7 +41,7 @@ import { splitProps, splitStyle, useTransformStyle, useLayout, wrapChildren, ext
|
|
|
41
41
|
import { IntersectionObserverContext, ScrollViewContext } from './context';
|
|
42
42
|
const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
|
|
43
43
|
const { textProps, innerProps: props = {} } = splitProps(scrollViewProps);
|
|
44
|
-
const { enhanced = false, bounces = true, style = {}, binddragstart, binddragging, binddragend, bindtouchstart, bindtouchmove, bindtouchend, 'scroll-x': scrollX = false, 'scroll-y': scrollY = false, 'enable-back-to-top': enableBackToTop = false, 'enable-trigger-intersection-observer': enableTriggerIntersectionObserver = false, 'paging-enabled': pagingEnabled = false, 'upper-threshold': upperThreshold = 50, 'lower-threshold': lowerThreshold = 50, 'scroll-with-animation': scrollWithAnimation, 'refresher-enabled': refresherEnabled, 'refresher-default-style': refresherDefaultStyle, 'refresher-background': refresherBackground, 'show-scrollbar': showScrollbar = true, 'scroll-into-view': scrollIntoView = '', 'scroll-top': scrollTop = 0, 'scroll-left': scrollLeft = 0, 'refresher-triggered': refresherTriggered, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'simultaneous-handlers': originSimultaneousHandlers, 'wait-for': waitFor, __selectRef } = props;
|
|
44
|
+
const { enhanced = false, bounces = true, style = {}, binddragstart, binddragging, binddragend, bindtouchstart, bindtouchmove, bindtouchend, 'scroll-x': scrollX = false, 'scroll-y': scrollY = false, 'enable-back-to-top': enableBackToTop = false, 'enable-trigger-intersection-observer': enableTriggerIntersectionObserver = false, 'paging-enabled': pagingEnabled = false, 'upper-threshold': upperThreshold = 50, 'lower-threshold': lowerThreshold = 50, 'scroll-with-animation': scrollWithAnimation, 'refresher-enabled': refresherEnabled, 'refresher-default-style': refresherDefaultStyle, 'refresher-background': refresherBackground, 'show-scrollbar': showScrollbar = true, 'scroll-into-view': scrollIntoView = '', 'scroll-top': scrollTop = 0, 'scroll-left': scrollLeft = 0, 'refresher-triggered': refresherTriggered, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'simultaneous-handlers': originSimultaneousHandlers, 'wait-for': waitFor, 'scroll-event-throttle': scrollEventThrottle = 0, __selectRef } = props;
|
|
45
45
|
const simultaneousHandlers = flatGesture(originSimultaneousHandlers);
|
|
46
46
|
const waitForHandlers = flatGesture(waitFor);
|
|
47
47
|
const [refreshing, setRefreshing] = useState(true);
|
|
@@ -54,7 +54,6 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
|
|
|
54
54
|
scrollTop: 0,
|
|
55
55
|
visibleLength: 0
|
|
56
56
|
});
|
|
57
|
-
const scrollEventThrottle = 50;
|
|
58
57
|
const hasCallScrollToUpper = useRef(true);
|
|
59
58
|
const hasCallScrollToLower = useRef(false);
|
|
60
59
|
const initialTimeout = useRef(null);
|
|
@@ -75,10 +75,7 @@ const _WebView = forwardRef((props, ref) => {
|
|
|
75
75
|
};
|
|
76
76
|
const navigation = useNavigation();
|
|
77
77
|
useEffect(() => {
|
|
78
|
-
|
|
79
|
-
if (__mpx_mode__ !== 'ios') {
|
|
80
|
-
beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle);
|
|
81
|
-
}
|
|
78
|
+
const beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle);
|
|
82
79
|
return () => {
|
|
83
80
|
if (isFunction(beforeRemoveSubscription)) {
|
|
84
81
|
beforeRemoveSubscription();
|
|
@@ -70,6 +70,7 @@ interface ScrollViewProps {
|
|
|
70
70
|
'parent-height'?: number;
|
|
71
71
|
'wait-for'?: Array<GestureHandler>;
|
|
72
72
|
'simultaneous-handlers'?: Array<GestureHandler>;
|
|
73
|
+
'scroll-event-throttle'?:number;
|
|
73
74
|
bindscrolltoupper?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
74
75
|
bindscrolltolower?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
75
76
|
bindscroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
@@ -140,6 +141,7 @@ const _ScrollView = forwardRef<HandlerRef<ScrollView & View, ScrollViewProps>, S
|
|
|
140
141
|
'parent-height': parentHeight,
|
|
141
142
|
'simultaneous-handlers': originSimultaneousHandlers,
|
|
142
143
|
'wait-for': waitFor,
|
|
144
|
+
'scroll-event-throttle': scrollEventThrottle = 0,
|
|
143
145
|
__selectRef
|
|
144
146
|
} = props
|
|
145
147
|
|
|
@@ -159,7 +161,6 @@ const _ScrollView = forwardRef<HandlerRef<ScrollView & View, ScrollViewProps>, S
|
|
|
159
161
|
visibleLength: 0
|
|
160
162
|
})
|
|
161
163
|
|
|
162
|
-
const scrollEventThrottle = 50
|
|
163
164
|
const hasCallScrollToUpper = useRef(true)
|
|
164
165
|
const hasCallScrollToLower = useRef(false)
|
|
165
166
|
const initialTimeout = useRef<ReturnType<typeof setTimeout> | null>(null)
|
|
@@ -123,10 +123,7 @@ const _WebView = forwardRef<HandlerRef<WebView, WebViewProps>, WebViewProps>((pr
|
|
|
123
123
|
const navigation = useNavigation()
|
|
124
124
|
|
|
125
125
|
useEffect(() => {
|
|
126
|
-
|
|
127
|
-
if (__mpx_mode__ !== 'ios') {
|
|
128
|
-
beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle)
|
|
129
|
-
}
|
|
126
|
+
const beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle)
|
|
130
127
|
return () => {
|
|
131
128
|
if (isFunction(beforeRemoveSubscription)) {
|
|
132
129
|
beforeRemoveSubscription()
|