@mpxjs/webpack-plugin 2.10.4-beta.10 → 2.10.4-beta.12

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.
@@ -36,7 +36,7 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }) => {
36
36
  const { ref, cursorSpacing = 0 } = keyboardAvoid.current;
37
37
  setTimeout(() => {
38
38
  ref?.current?.measure((x, y, width, height, pageX, pageY) => {
39
- const aboveOffset = pageY + height - endCoordinates.screenY;
39
+ const aboveOffset = offset.value + pageY + height - endCoordinates.screenY;
40
40
  const aboveValue = -aboveOffset >= cursorSpacing ? 0 : aboveOffset + cursorSpacing;
41
41
  const belowValue = Math.min(endCoordinates.height, aboveOffset + cursorSpacing);
42
42
  const value = aboveOffset > 0 ? belowValue : aboveValue;
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef, useRef, useState, useMemo, useEffect, useCallback } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
  import Reanimated, { useAnimatedRef, useScrollViewOffset } from 'react-native-reanimated';
4
- import { useTransformStyle, splitStyle, splitProps, useLayout, usePrevious, isAndroid, isIOS } from '../utils';
4
+ import { useTransformStyle, splitStyle, splitProps, useLayout, usePrevious, isAndroid, isIOS, isHarmony } from '../utils';
5
5
  import useNodesRef from '../useNodesRef';
6
6
  import PickerIndicator from './pickerViewIndicator';
7
7
  import PickerMask from './pickerViewMask';
@@ -143,9 +143,9 @@ const _PickerViewColumn = forwardRef((props, ref) => {
143
143
  }, [itemRawH]);
144
144
  const onScrollEndDrag = useCallback((e) => {
145
145
  dragging.current = false;
146
- if (isIOS) {
146
+ if (!isAndroid) {
147
147
  const { y } = e.nativeEvent.contentOffset;
148
- if (y % itemRawH === 0) {
148
+ if (y % itemRawH === 0 || (isHarmony && y > snapToOffsets[maxIndex])) {
149
149
  onMomentumScrollEnd({ nativeEvent: { contentOffset: { y } } });
150
150
  }
151
151
  else if (y > 0 && y < snapToOffsets[maxIndex]) {
@@ -48,7 +48,7 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
48
48
  const { ref, cursorSpacing = 0 } = keyboardAvoid.current
49
49
  setTimeout(() => {
50
50
  ref?.current?.measure((x: number, y: number, width: number, height: number, pageX: number, pageY: number) => {
51
- const aboveOffset = pageY + height - endCoordinates.screenY
51
+ const aboveOffset = offset.value + pageY + height - endCoordinates.screenY
52
52
  const aboveValue = -aboveOffset >= cursorSpacing ? 0 : aboveOffset + cursorSpacing
53
53
  const belowValue = Math.min(endCoordinates.height, aboveOffset + cursorSpacing)
54
54
  const value = aboveOffset > 0 ? belowValue : aboveValue
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef, useRef, useState, useMemo, useEffect, useCallback } from 'react'
2
2
  import { GestureResponderEvent, LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent, ScrollView, StyleSheet, View } from 'react-native'
3
3
  import Reanimated, { AnimatedRef, useAnimatedRef, useScrollViewOffset } from 'react-native-reanimated'
4
- import { useTransformStyle, splitStyle, splitProps, useLayout, usePrevious, isAndroid, isIOS } from '../utils'
4
+ import { useTransformStyle, splitStyle, splitProps, useLayout, usePrevious, isAndroid, isIOS, isHarmony } from '../utils'
5
5
  import useNodesRef, { HandlerRef } from '../useNodesRef'
6
6
  import PickerIndicator from './pickerViewIndicator'
7
7
  import PickerMask from './pickerViewMask'
@@ -209,9 +209,9 @@ const _PickerViewColumn = forwardRef<HandlerRef<ScrollView & View, ColumnProps>,
209
209
 
210
210
  const onScrollEndDrag = useCallback((e: NativeSyntheticEvent<NativeScrollEvent>) => {
211
211
  dragging.current = false
212
- if (isIOS) {
212
+ if (!isAndroid) {
213
213
  const { y } = e.nativeEvent.contentOffset
214
- if (y % itemRawH === 0) {
214
+ if (y % itemRawH === 0 || (isHarmony && y > snapToOffsets[maxIndex])) {
215
215
  onMomentumScrollEnd({ nativeEvent: { contentOffset: { y } } })
216
216
  } else if (y > 0 && y < snapToOffsets[maxIndex]) {
217
217
  timerResetPosition.current = setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.4-beta.10",
3
+ "version": "2.10.4-beta.12",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"