@mpxjs/webpack-plugin 2.10.3-beta.1 → 2.10.3-beta.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.
@@ -70,7 +70,7 @@ const easeMap = {
70
70
  easeInOutCubic: Easing.inOut(Easing.cubic)
71
71
  };
72
72
  const SwiperWrapper = forwardRef((props, ref) => {
73
- const { 'indicator-dots': showsPagination, 'indicator-color': dotColor = 'rgba(0, 0, 0, .3)', 'indicator-active-color': activeDotColor = '#000000', 'enable-var': enableVar = false, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'external-var-context': externalVarContext, style = {}, autoplay = false, circular = false } = props;
73
+ const { 'indicator-dots': showsPagination, 'indicator-color': dotColor = 'rgba(0, 0, 0, .3)', 'indicator-active-color': activeDotColor = '#000000', 'enable-var': enableVar = false, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'external-var-context': externalVarContext, style = {}, autoplay = false, circular = false, disableGesture = false } = props;
74
74
  const easeingFunc = props['easing-function'] || 'default';
75
75
  const easeDuration = props.duration || 500;
76
76
  const horizontal = props.vertical !== undefined ? !props.vertical : true;
@@ -658,7 +658,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
658
658
  {showsPagination && renderPagination()}
659
659
  </View>);
660
660
  }
661
- if (children.length === 1) {
661
+ if (children.length === 1 || disableGesture) {
662
662
  return renderSwiper();
663
663
  }
664
664
  else {
@@ -75,7 +75,10 @@ const _WebView = forwardRef((props, ref) => {
75
75
  };
76
76
  const navigation = useNavigation();
77
77
  useEffect(() => {
78
- const beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle);
78
+ let beforeRemoveSubscription;
79
+ if (__mpx_mode__ !== 'ios') {
80
+ beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle);
81
+ }
79
82
  return () => {
80
83
  if (isFunction(beforeRemoveSubscription)) {
81
84
  beforeRemoveSubscription();
@@ -55,6 +55,7 @@ interface SwiperProps {
55
55
  'parent-width'?: number;
56
56
  'parent-height'?: number;
57
57
  'external-var-context'?: Record<string, any>;
58
+ disableGesture?: boolean;
58
59
  bindchange?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
59
60
  }
60
61
 
@@ -136,7 +137,8 @@ const SwiperWrapper = forwardRef<HandlerRef<View, SwiperProps>, SwiperProps>((pr
136
137
  'external-var-context': externalVarContext,
137
138
  style = {},
138
139
  autoplay = false,
139
- circular = false
140
+ circular = false,
141
+ disableGesture = false
140
142
  } = props
141
143
  const easeingFunc = props['easing-function'] || 'default'
142
144
  const easeDuration = props.duration || 500
@@ -730,7 +732,7 @@ const SwiperWrapper = forwardRef<HandlerRef<View, SwiperProps>, SwiperProps>((pr
730
732
  </View>)
731
733
  }
732
734
 
733
- if (children.length === 1) {
735
+ if (children.length === 1 || disableGesture) {
734
736
  return renderSwiper()
735
737
  } else {
736
738
  return (<GestureDetector gesture={gestureHandler}>
@@ -123,7 +123,10 @@ const _WebView = forwardRef<HandlerRef<WebView, WebViewProps>, WebViewProps>((pr
123
123
  const navigation = useNavigation()
124
124
 
125
125
  useEffect(() => {
126
- const beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle)
126
+ let beforeRemoveSubscription:any
127
+ if (__mpx_mode__ !== 'ios') {
128
+ beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle)
129
+ }
127
130
  return () => {
128
131
  if (isFunction(beforeRemoveSubscription)) {
129
132
  beforeRemoveSubscription()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.3-beta.1",
3
+ "version": "2.10.3-beta.4",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"