@mpxjs/webpack-plugin 2.10.4 → 2.10.5

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.
Files changed (70) hide show
  1. package/lib/platform/style/wx/index.js +22 -21
  2. package/lib/react/processScript.js +9 -1
  3. package/lib/react/script-helper.js +5 -1
  4. package/lib/runtime/components/react/dist/event.config.js +0 -2
  5. package/lib/runtime/components/react/dist/getInnerListeners.js +127 -153
  6. package/lib/runtime/components/react/dist/mpx-button.jsx +2 -3
  7. package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +3 -4
  8. package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +2 -2
  9. package/lib/runtime/components/react/dist/mpx-checkbox.jsx +2 -3
  10. package/lib/runtime/components/react/dist/mpx-form.jsx +2 -2
  11. package/lib/runtime/components/react/dist/mpx-icon/index.jsx +2 -2
  12. package/lib/runtime/components/react/dist/mpx-image.jsx +2 -2
  13. package/lib/runtime/components/react/dist/mpx-input.jsx +17 -11
  14. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +22 -29
  15. package/lib/runtime/components/react/dist/mpx-label.jsx +2 -3
  16. package/lib/runtime/components/react/dist/mpx-movable-area.jsx +2 -2
  17. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +1 -1
  18. package/lib/runtime/components/react/dist/mpx-navigator.jsx +11 -3
  19. package/lib/runtime/components/react/dist/mpx-picker/index.jsx +2 -2
  20. package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +2 -3
  21. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +4 -4
  22. package/lib/runtime/components/react/dist/mpx-radio-group.jsx +2 -2
  23. package/lib/runtime/components/react/dist/mpx-radio.jsx +2 -3
  24. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +2 -2
  25. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +1 -1
  26. package/lib/runtime/components/react/dist/mpx-simple-text.jsx +3 -2
  27. package/lib/runtime/components/react/dist/mpx-simple-view.jsx +3 -3
  28. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +4 -5
  29. package/lib/runtime/components/react/dist/mpx-swiper.jsx +9 -9
  30. package/lib/runtime/components/react/dist/mpx-switch.jsx +3 -5
  31. package/lib/runtime/components/react/dist/mpx-text.jsx +4 -7
  32. package/lib/runtime/components/react/dist/mpx-video.jsx +2 -2
  33. package/lib/runtime/components/react/dist/mpx-view.jsx +13 -6
  34. package/lib/runtime/components/react/dist/useAnimationHooks.js +27 -4
  35. package/lib/runtime/components/react/dist/utils.jsx +85 -95
  36. package/lib/runtime/components/react/event.config.ts +1 -8
  37. package/lib/runtime/components/react/getInnerListeners.ts +146 -192
  38. package/lib/runtime/components/react/mpx-button.tsx +4 -5
  39. package/lib/runtime/components/react/mpx-canvas/index.tsx +23 -15
  40. package/lib/runtime/components/react/mpx-checkbox-group.tsx +4 -3
  41. package/lib/runtime/components/react/mpx-checkbox.tsx +8 -9
  42. package/lib/runtime/components/react/mpx-form.tsx +25 -19
  43. package/lib/runtime/components/react/mpx-icon/index.tsx +4 -3
  44. package/lib/runtime/components/react/mpx-image.tsx +4 -3
  45. package/lib/runtime/components/react/mpx-input.tsx +22 -15
  46. package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +30 -41
  47. package/lib/runtime/components/react/mpx-label.tsx +4 -5
  48. package/lib/runtime/components/react/mpx-movable-area.tsx +22 -13
  49. package/lib/runtime/components/react/mpx-movable-view.tsx +47 -40
  50. package/lib/runtime/components/react/mpx-navigator.tsx +4 -6
  51. package/lib/runtime/components/react/mpx-picker/index.tsx +7 -4
  52. package/lib/runtime/components/react/mpx-picker-view/index.tsx +17 -14
  53. package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +4 -4
  54. package/lib/runtime/components/react/mpx-radio-group.tsx +4 -3
  55. package/lib/runtime/components/react/mpx-radio.tsx +8 -9
  56. package/lib/runtime/components/react/mpx-rich-text/index.tsx +15 -6
  57. package/lib/runtime/components/react/mpx-scroll-view.tsx +96 -90
  58. package/lib/runtime/components/react/mpx-simple-text.tsx +10 -3
  59. package/lib/runtime/components/react/mpx-simple-view.tsx +10 -4
  60. package/lib/runtime/components/react/mpx-swiper-item.tsx +31 -24
  61. package/lib/runtime/components/react/mpx-swiper.tsx +67 -61
  62. package/lib/runtime/components/react/mpx-switch.tsx +19 -14
  63. package/lib/runtime/components/react/mpx-text.tsx +16 -13
  64. package/lib/runtime/components/react/mpx-video.tsx +34 -33
  65. package/lib/runtime/components/react/mpx-view.tsx +30 -14
  66. package/lib/runtime/components/react/types/getInnerListeners.d.ts +65 -35
  67. package/lib/runtime/components/react/useAnimationHooks.ts +30 -9
  68. package/lib/runtime/components/react/utils.tsx +91 -98
  69. package/lib/template-compiler/compiler.js +1 -1
  70. package/package.json +3 -3
@@ -379,8 +379,10 @@ const Image = forwardRef<HandlerRef<RNImage, ImageProps>, ImageProps>((props, re
379
379
  }, [src, isSvg, isLayoutMode])
380
380
 
381
381
  const innerProps = useInnerProps(
382
- props,
383
382
  extendObject(
383
+ {},
384
+ props,
385
+ layoutProps,
384
386
  {
385
387
  ref: nodeRef,
386
388
  style: extendObject(
@@ -390,8 +392,7 @@ const Image = forwardRef<HandlerRef<RNImage, ImageProps>, ImageProps>((props, re
390
392
  isHeightFixMode ? { width: fixedWidth } : {},
391
393
  isWidthFixMode ? { height: fixedHeight } : {}
392
394
  )
393
- },
394
- layoutProps
395
+ }
395
396
  ),
396
397
  [
397
398
  'src',
@@ -39,7 +39,6 @@
39
39
  */
40
40
  import { JSX, forwardRef, useRef, useState, useContext, useEffect, createElement } from 'react'
41
41
  import {
42
- Platform,
43
42
  TextInput,
44
43
  TextStyle,
45
44
  ViewStyle,
@@ -51,7 +50,8 @@ import {
51
50
  TextInputSelectionChangeEventData,
52
51
  TextInputFocusEventData,
53
52
  TextInputChangeEventData,
54
- TextInputSubmitEditingEventData
53
+ TextInputSubmitEditingEventData,
54
+ NativeTouchEvent
55
55
  } from 'react-native'
56
56
  import { warn } from '@mpxjs/utils'
57
57
  import { useUpdateEffect, useTransformStyle, useLayout, extendObject, isIOS } from './utils'
@@ -191,7 +191,7 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
191
191
 
192
192
  const [inputValue, setInputValue] = useState(defaultValue)
193
193
  const [contentHeight, setContentHeight] = useState(0)
194
- const [selection, setSelection] = useState({ start: -1, end: -1 })
194
+ const [selection, setSelection] = useState({ start: -1, end: tmpValue.current.length })
195
195
 
196
196
  const styleObj = extendObject(
197
197
  { padding: 0, backgroundColor: '#fff' },
@@ -217,15 +217,17 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
217
217
 
218
218
  useEffect(() => {
219
219
  if (inputValue !== value) {
220
- setInputValue(parseValue(value))
220
+ const parsed = parseValue(value)
221
+ tmpValue.current = parsed
222
+ setInputValue(parsed)
221
223
  }
222
224
  }, [value])
223
225
 
224
226
  useEffect(() => {
225
- if (typeof cursor === 'number') {
227
+ if (selectionStart > -1) {
228
+ setSelection({ start: selectionStart, end: selectionEnd === -1 ? tmpValue.current.length : selectionEnd })
229
+ } else if (typeof cursor === 'number') {
226
230
  setSelection({ start: cursor, end: cursor })
227
- } else if (selectionStart >= 0 && selectionEnd >= 0 && selectionStart !== selectionEnd) {
228
- setSelection({ start: selectionStart, end: selectionEnd })
229
231
  }
230
232
  }, [cursor, selectionStart, selectionEnd])
231
233
 
@@ -286,6 +288,10 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
286
288
  setKeyboardAvoidContext()
287
289
  }
288
290
 
291
+ const onTouchEnd = (evt: NativeSyntheticEvent<NativeTouchEvent & { origin?: string }>) => {
292
+ evt.nativeEvent.origin = 'input'
293
+ }
294
+
289
295
  const onFocus = (evt: NativeSyntheticEvent<TextInputFocusEventData>) => {
290
296
  setKeyboardAvoidContext()
291
297
  bindfocus && bindfocus(
@@ -384,6 +390,7 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
384
390
  }
385
391
 
386
392
  const resetValue = () => {
393
+ tmpValue.current = ''
387
394
  setInputValue('')
388
395
  }
389
396
 
@@ -423,8 +430,10 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
423
430
  }, [focus])
424
431
 
425
432
  const innerProps = useInnerProps(
426
- props,
427
433
  extendObject(
434
+ {},
435
+ props,
436
+ layoutProps,
428
437
  {
429
438
  ref: nodeRef,
430
439
  style: extendObject({}, normalStyle, layoutStyle),
@@ -436,25 +445,23 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
436
445
  maxLength: maxlength === -1 ? undefined : maxlength,
437
446
  editable: !disabled,
438
447
  autoFocus: !!autoFocus || !!focus,
439
- selection: selection,
448
+ selection: selectionStart > -1 || typeof cursor === 'number' ? selection : undefined,
440
449
  selectionColor: cursorColor,
441
450
  blurOnSubmit: !multiline && !confirmHold,
442
451
  underlineColorAndroid: 'rgba(0,0,0,0)',
443
452
  textAlignVertical: textAlignVertical,
444
453
  placeholderTextColor: placeholderStyle?.color,
445
- multiline: !!multiline
446
- },
447
- !!multiline && confirmType === 'return' ? {} : { enterKeyHint: confirmType },
448
- layoutProps,
449
- {
454
+ multiline: !!multiline,
450
455
  onTouchStart,
456
+ onTouchEnd,
451
457
  onFocus,
452
458
  onBlur,
453
459
  onChange,
454
460
  onSelectionChange,
455
461
  onContentSizeChange,
456
462
  onSubmitEditing: bindconfirm && !multiline && onSubmitEditing
457
- }
463
+ },
464
+ !!multiline && confirmType === 'return' ? {} : { enterKeyHint: confirmType }
458
465
  ),
459
466
  [
460
467
  'type',
@@ -1,7 +1,6 @@
1
- import React, { ReactNode, useContext, useEffect, useMemo } from 'react'
2
- import { DimensionValue, EmitterSubscription, Keyboard, Platform, View, ViewStyle } from 'react-native'
3
- import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing, runOnJS } from 'react-native-reanimated'
4
- import { GestureDetector, Gesture } from 'react-native-gesture-handler'
1
+ import React, { ReactNode, useContext, useEffect } from 'react'
2
+ import { DimensionValue, EmitterSubscription, Keyboard, View, ViewStyle, NativeSyntheticEvent, NativeTouchEvent } from 'react-native'
3
+ import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing } from 'react-native-reanimated'
5
4
  import { KeyboardAvoidContext } from './context'
6
5
  import { isIOS } from './utils'
7
6
 
@@ -19,25 +18,10 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
19
18
  const basic = useSharedValue('auto')
20
19
  const keyboardAvoid = useContext(KeyboardAvoidContext)
21
20
 
22
- const dismiss = () => {
23
- Keyboard.isVisible() && Keyboard.dismiss()
24
- }
25
-
26
- const gesture = useMemo(() => {
27
- return Gesture.Tap()
28
- .onEnd(() => {
29
- dismiss()
30
- }).runOnJS(true)
31
- }, [])
32
-
33
- const animatedStyle = useAnimatedStyle(() => {
34
- return Object.assign(
35
- {
36
- transform: [{ translateY: -offset.value }]
37
- },
38
- isIOS ? {} : { flexBasis: basic.value as DimensionValue }
39
- )
40
- })
21
+ const animatedStyle = useAnimatedStyle(() => ({
22
+ transform: [{ translateY: -offset.value }],
23
+ flexBasis: basic.value as DimensionValue
24
+ }))
41
25
 
42
26
  const resetKeyboard = () => {
43
27
  if (keyboardAvoid?.current) {
@@ -47,6 +31,12 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
47
31
  basic.value = 'auto'
48
32
  }
49
33
 
34
+ const onTouchEnd = ({ nativeEvent }: NativeSyntheticEvent<NativeTouchEvent & { origin?: string }>) => {
35
+ if (nativeEvent.origin !== 'input') {
36
+ Keyboard.isVisible() && Keyboard.dismiss()
37
+ }
38
+ }
39
+
50
40
  useEffect(() => {
51
41
  let subscriptions: EmitterSubscription[] = []
52
42
 
@@ -62,7 +52,12 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
62
52
  const aboveValue = -aboveOffset >= cursorSpacing ? 0 : aboveOffset + cursorSpacing
63
53
  const belowValue = Math.min(endCoordinates.height, aboveOffset + cursorSpacing)
64
54
  const value = aboveOffset > 0 ? belowValue : aboveValue
65
- offset.value = withTiming(value, { duration, easing })
55
+ offset.value = withTiming(value, { duration, easing }, (finished) => {
56
+ if (finished) {
57
+ // Set flexBasic after animation to trigger re-layout and reset layout information
58
+ basic.value = '99.99%'
59
+ }
60
+ })
66
61
  })
67
62
  })
68
63
  }),
@@ -82,11 +77,7 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
82
77
  const value = aboveOffset > 0 ? belowValue : aboveValue
83
78
  offset.value = withTiming(value, { duration, easing }, (finished) => {
84
79
  if (finished) {
85
- /**
86
- * In the Android environment, the layout information is not synchronized after the animation,
87
- * which results in the inability to correctly trigger element events.
88
- * Here, we utilize flexBasic to proactively trigger a re-layout
89
- */
80
+ // Set flexBasic after animation to trigger re-layout and reset layout information
90
81
  basic.value = '99.99%'
91
82
  }
92
83
  })
@@ -102,18 +93,16 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
102
93
  }, [keyboardAvoid])
103
94
 
104
95
  return (
105
- <GestureDetector gesture={gesture}>
106
- <View style={style}>
107
- <Animated.View
108
- style={[
109
- contentContainerStyle,
110
- animatedStyle
111
- ]}
112
- >
113
- {children}
114
- </Animated.View>
115
- </View>
116
- </GestureDetector>
96
+ <View style={style} onTouchEnd={onTouchEnd}>
97
+ <Animated.View
98
+ style={[
99
+ contentContainerStyle,
100
+ animatedStyle
101
+ ]}
102
+ >
103
+ {children}
104
+ </Animated.View>
105
+ </View>
117
106
  )
118
107
  }
119
108
 
@@ -75,14 +75,13 @@ const Label = forwardRef<HandlerRef<View, LabelProps>, LabelProps>(
75
75
  }, [])
76
76
 
77
77
  const innerProps = useInnerProps(
78
- props,
79
78
  extendObject(
80
- {
81
- ref: nodeRef,
82
- style: extendObject({}, innerStyle, layoutStyle)
83
- },
79
+ {},
80
+ props,
84
81
  layoutProps,
85
82
  {
83
+ ref: nodeRef,
84
+ style: extendObject({}, innerStyle, layoutStyle),
86
85
  bindtap: onTap
87
86
  }
88
87
  ),
@@ -10,16 +10,16 @@ import { MovableAreaContext } from './context'
10
10
  import { useTransformStyle, wrapChildren, useLayout, extendObject } from './utils'
11
11
 
12
12
  interface MovableAreaProps {
13
- style?: Record<string, any>;
14
- children: ReactNode;
15
- width?: number;
16
- height?: number;
17
- 'enable-offset'?: boolean;
13
+ style?: Record<string, any>
14
+ children: ReactNode
15
+ width?: number
16
+ height?: number
17
+ 'enable-offset'?: boolean
18
18
  'enable-var'?: boolean
19
- 'external-var-context'?: Record<string, any>;
20
- 'parent-font-size'?: number;
21
- 'parent-width'?: number;
22
- 'parent-height'?: number;
19
+ 'external-var-context'?: Record<string, any>
20
+ 'parent-font-size'?: number
21
+ 'parent-width'?: number
22
+ 'parent-height'?: number
23
23
  }
24
24
 
25
25
  const _MovableArea = forwardRef<HandlerRef<View, MovableAreaProps>, MovableAreaProps>((props: MovableAreaProps, ref): JSX.Element => {
@@ -46,10 +46,19 @@ const _MovableArea = forwardRef<HandlerRef<View, MovableAreaProps>, MovableAreaP
46
46
 
47
47
  const { layoutRef, layoutStyle, layoutProps } = useLayout({ props, hasSelfPercent, setWidth, setHeight, nodeRef: movableViewRef })
48
48
 
49
- const innerProps = useInnerProps(props, extendObject({
50
- style: extendObject({ height: contextValue.height, width: contextValue.width, overflow: 'hidden' }, normalStyle, layoutStyle),
51
- ref: movableViewRef
52
- }, layoutProps), [], { layoutRef })
49
+ const innerProps = useInnerProps(
50
+ extendObject(
51
+ {},
52
+ props,
53
+ layoutProps,
54
+ {
55
+ style: extendObject({ height: contextValue.height, width: contextValue.width, overflow: 'hidden' }, normalStyle, layoutStyle),
56
+ ref: movableViewRef
57
+ }
58
+ ),
59
+ [],
60
+ { layoutRef }
61
+ )
53
62
 
54
63
  return createElement(MovableAreaContext.Provider, { value: contextValue }, createElement(
55
64
  View,
@@ -36,39 +36,39 @@ import Animated, {
36
36
  import { collectDataset, noop } from '@mpxjs/utils'
37
37
 
38
38
  interface MovableViewProps {
39
- children: ReactNode;
40
- style?: Record<string, any>;
41
- direction: 'all' | 'vertical' | 'horizontal' | 'none';
42
- x?: number;
43
- y?: number;
44
- disabled?: boolean;
45
- animation?: boolean;
46
- id?: string;
47
- bindchange?: (event: unknown) => void;
48
- bindtouchstart?: (event: GestureTouchEvent) => void;
49
- catchtouchstart?: (event: GestureTouchEvent) => void;
50
- bindtouchmove?: (event: GestureTouchEvent) => void;
51
- catchtouchmove?: (event: GestureTouchEvent) => void;
52
- catchtouchend?: (event: GestureTouchEvent) => void;
53
- bindtouchend?: (event: GestureTouchEvent) => void;
54
- bindhtouchmove?: (event: GestureTouchEvent) => void;
55
- bindvtouchmove?: (event: GestureTouchEvent) => void;
56
- catchhtouchmove?: (event: GestureTouchEvent) => void;
57
- catchvtouchmove?: (event: GestureTouchEvent) => void;
58
- bindlongpress?: (event: GestureTouchEvent) => void;
59
- catchlongpress?: (event: GestureTouchEvent) => void;
60
- bindtap?: (event: GestureTouchEvent) => void;
61
- catchtap?: (event: GestureTouchEvent) => void;
62
- onLayout?: (event: LayoutChangeEvent) => void;
63
- 'out-of-bounds'?: boolean;
64
- 'wait-for'?: Array<GestureHandler>;
65
- 'simultaneous-handlers'?: Array<GestureHandler>;
66
- inertia?: boolean;
39
+ children: ReactNode
40
+ style?: Record<string, any>
41
+ direction: 'all' | 'vertical' | 'horizontal' | 'none'
42
+ x?: number
43
+ y?: number
44
+ disabled?: boolean
45
+ animation?: boolean
46
+ id?: string
47
+ bindchange?: (event: unknown) => void
48
+ bindtouchstart?: (event: GestureTouchEvent) => void
49
+ catchtouchstart?: (event: GestureTouchEvent) => void
50
+ bindtouchmove?: (event: GestureTouchEvent) => void
51
+ catchtouchmove?: (event: GestureTouchEvent) => void
52
+ catchtouchend?: (event: GestureTouchEvent) => void
53
+ bindtouchend?: (event: GestureTouchEvent) => void
54
+ bindhtouchmove?: (event: GestureTouchEvent) => void
55
+ bindvtouchmove?: (event: GestureTouchEvent) => void
56
+ catchhtouchmove?: (event: GestureTouchEvent) => void
57
+ catchvtouchmove?: (event: GestureTouchEvent) => void
58
+ bindlongpress?: (event: GestureTouchEvent) => void
59
+ catchlongpress?: (event: GestureTouchEvent) => void
60
+ bindtap?: (event: GestureTouchEvent) => void
61
+ catchtap?: (event: GestureTouchEvent) => void
62
+ onLayout?: (event: LayoutChangeEvent) => void
63
+ 'out-of-bounds'?: boolean
64
+ 'wait-for'?: Array<GestureHandler>
65
+ 'simultaneous-handlers'?: Array<GestureHandler>
66
+ inertia?: boolean
67
67
  'enable-var'?: boolean
68
- 'external-var-context'?: Record<string, any>;
69
- 'parent-font-size'?: number;
70
- 'parent-width'?: number;
71
- 'parent-height'?: number;
68
+ 'external-var-context'?: Record<string, any>
69
+ 'parent-font-size'?: number
70
+ 'parent-width'?: number
71
+ 'parent-height'?: number
72
72
  }
73
73
 
74
74
  const styles = StyleSheet.create({
@@ -235,7 +235,7 @@ const _MovableView = forwardRef<HandlerRef<View, MovableViewProps>, MovableViewP
235
235
  offsetX: offsetX.value,
236
236
  offsetY: offsetY.value
237
237
  }),
238
- (currentValue: { offsetX: any; offsetY: any; }) => {
238
+ (currentValue: { offsetX: any; offsetY: any }) => {
239
239
  const { offsetX, offsetY } = currentValue
240
240
  runOnJS(handleTriggerChange)({
241
241
  x: offsetX,
@@ -342,11 +342,11 @@ const _MovableView = forwardRef<HandlerRef<View, MovableViewProps>, MovableViewP
342
342
  props.onLayout && props.onLayout(e)
343
343
  }
344
344
 
345
- const extendEvent = useCallback((e: any, type: 'start'|'move'|'end') => {
345
+ const extendEvent = useCallback((e: any, type: 'start' | 'move' | 'end') => {
346
346
  const { y: navigationY = 0 } = navigation?.layout || {}
347
347
  const touchArr = [e.changedTouches, e.allTouches]
348
348
  touchArr.forEach(touches => {
349
- touches && touches.forEach((item: { absoluteX: number; absoluteY: number; pageX: number; pageY: number ; clientX: number; clientY: number}) => {
349
+ touches && touches.forEach((item: { absoluteX: number; absoluteY: number; pageX: number; pageY: number; clientX: number; clientY: number }) => {
350
350
  item.pageX = item.absoluteX
351
351
  item.pageY = item.absoluteY - navigationY
352
352
  item.clientX = item.absoluteX
@@ -565,11 +565,18 @@ const _MovableView = forwardRef<HandlerRef<View, MovableViewProps>, MovableViewP
565
565
  'catchtouchend'
566
566
  ])
567
567
 
568
- const innerProps = useInnerProps(filterProps, extendObject({
569
- ref: nodeRef,
570
- onLayout: onLayout,
571
- style: [innerStyle, animatedStyles, layoutStyle]
572
- }, rewriteCatchEvent()))
568
+ const innerProps = useInnerProps(
569
+ extendObject(
570
+ {},
571
+ filterProps,
572
+ {
573
+ ref: nodeRef,
574
+ onLayout: onLayout,
575
+ style: [innerStyle, animatedStyles, layoutStyle]
576
+ },
577
+ rewriteCatchEvent()
578
+ )
579
+ )
573
580
 
574
581
  return createElement(GestureDetector, { gesture: gesture }, createElement(
575
582
  Animated.View,
@@ -7,9 +7,7 @@
7
7
  * ✔ url
8
8
  * ✔ delta
9
9
  */
10
- import { View } from 'react-native'
11
- import { useCallback, forwardRef, JSX, createElement } from 'react'
12
- import useInnerProps from './getInnerListeners'
10
+ import { useCallback, forwardRef, JSX, createElement, MutableRefObject } from 'react'
13
11
  import { redirectTo, navigateTo, navigateBack, reLaunch, switchTab } from '@mpxjs/api-proxy'
14
12
 
15
13
  import MpxView, { _ViewProps } from './mpx-view'
@@ -20,7 +18,7 @@ interface _NavigatorProps extends _ViewProps {
20
18
  delta: number
21
19
  }
22
20
 
23
- const _Navigator = forwardRef<View, _NavigatorProps>((props, ref): JSX.Element => {
21
+ const _Navigator = forwardRef<any, _NavigatorProps>((props, ref): JSX.Element => {
24
22
  const {
25
23
  children,
26
24
  'open-type': openType,
@@ -48,10 +46,10 @@ const _Navigator = forwardRef<View, _NavigatorProps>((props, ref): JSX.Element =
48
46
  }
49
47
  }, [openType, url, delta])
50
48
 
51
- const innerProps = useInnerProps(props, {
49
+ const innerProps = {
52
50
  ref,
53
51
  bindtap: handleClick
54
- })
52
+ }
55
53
 
56
54
  return createElement(MpxView, innerProps, children)
57
55
  })
@@ -134,10 +134,13 @@ const Picker = forwardRef<HandlerRef<View, PickerProps>, PickerProps>(
134
134
 
135
135
  useNodesRef<View, PickerProps>(props, ref, nodeRef)
136
136
  const innerProps = useInnerProps(
137
- props,
138
- {
139
- ref: nodeRef
140
- },
137
+ extendObject(
138
+ {},
139
+ props,
140
+ {
141
+ ref: nodeRef
142
+ }
143
+ ),
141
144
  [],
142
145
  { layoutRef: innerLayout }
143
146
  )
@@ -130,20 +130,23 @@ const _PickerView = forwardRef<HandlerRef<View, PickerViewProps>, PickerViewProp
130
130
  }
131
131
 
132
132
  const innerProps = useInnerProps(
133
- props,
134
- extendObject({
135
- ref: nodeRef,
136
- style: extendObject(
137
- {},
138
- normalStyle,
139
- layoutStyle,
140
- {
141
- position: 'relative',
142
- overflow: 'hidden'
143
- }
144
- ),
145
- layoutProps
146
- }),
133
+ extendObject(
134
+ {},
135
+ props,
136
+ layoutProps,
137
+ {
138
+ ref: nodeRef,
139
+ style: extendObject(
140
+ {},
141
+ normalStyle,
142
+ layoutStyle,
143
+ {
144
+ position: 'relative',
145
+ overflow: 'hidden'
146
+ }
147
+ )
148
+ }
149
+ ),
147
150
  [
148
151
  'enable-offset',
149
152
  'indicator-style',
@@ -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(() => {
@@ -314,7 +314,7 @@ const _PickerViewColumn = forwardRef<HandlerRef<ScrollView & View, ColumnProps>,
314
314
  showsHorizontalScrollIndicator={false}
315
315
  scrollEventThrottle={16}
316
316
  {...layoutProps}
317
- onTouchStart={onClickOnceItem}
317
+ onTouchEnd={onClickOnceItem}
318
318
  style={[{ width: '100%' }]}
319
319
  decelerationRate="fast"
320
320
  snapToOffsets={snapToOffsets}
@@ -141,13 +141,14 @@ const radioGroup = forwardRef<
141
141
  }, [])
142
142
 
143
143
  const innerProps = useInnerProps(
144
- props,
145
144
  extendObject(
145
+ {},
146
+ props,
147
+ layoutProps,
146
148
  {
147
149
  ref: nodeRef,
148
150
  style: extendObject({}, normalStyle, layoutStyle)
149
- },
150
- layoutProps
151
+ }
151
152
  ),
152
153
  ['name'],
153
154
  {
@@ -22,9 +22,9 @@ export interface RadioProps {
22
22
  'enable-offset'?: boolean
23
23
  'enable-var'?: boolean
24
24
  'external-var-context'?: Record<string, any>
25
- 'parent-font-size'?: number;
26
- 'parent-width'?: number;
27
- 'parent-height'?: number;
25
+ 'parent-font-size'?: number
26
+ 'parent-width'?: number
27
+ 'parent-height'?: number
28
28
  children: ReactNode
29
29
  bindtap?: (evt: NativeSyntheticEvent<TouchEvent> | unknown) => void
30
30
  }
@@ -84,7 +84,7 @@ const Radio = forwardRef<HandlerRef<View, RadioProps>, RadioProps>(
84
84
  const [isChecked, setIsChecked] = useState<boolean>(!!checked)
85
85
 
86
86
  const groupContext = useContext(RadioGroupContext)
87
- let groupValue: { [key: string]: { checked: boolean; setValue: Dispatch<SetStateAction<boolean>>; } } | undefined
87
+ let groupValue: { [key: string]: { checked: boolean; setValue: Dispatch<SetStateAction<boolean>> } } | undefined
88
88
  let notifyChange: (evt: NativeSyntheticEvent<TouchEvent>) => void | undefined
89
89
 
90
90
  const labelContext = useContext(LabelContext)
@@ -149,14 +149,13 @@ const Radio = forwardRef<HandlerRef<View, RadioProps>, RadioProps>(
149
149
  }
150
150
 
151
151
  const innerProps = useInnerProps(
152
- props,
153
152
  extendObject(
154
- {
155
- ref: nodeRef,
156
- style: extendObject({}, innerStyle, layoutStyle)
157
- },
153
+ {},
154
+ props,
158
155
  layoutProps,
159
156
  {
157
+ ref: nodeRef,
158
+ style: extendObject({}, innerStyle, layoutStyle),
160
159
  bindtap: !disabled && onTap
161
160
  }
162
161
  ),
@@ -91,12 +91,21 @@ const _RichText = forwardRef<HandlerRef<View, _RichTextProps>, _RichTextProps>((
91
91
  layoutRef
92
92
  })
93
93
 
94
- const innerProps = useInnerProps(props, extendObject({
95
- ref: nodeRef,
96
- style: extendObject(normalStyle, layoutStyle)
97
- }, layoutProps), [], {
98
- layoutRef
99
- })
94
+ const innerProps = useInnerProps(
95
+ extendObject(
96
+ {},
97
+ props,
98
+ layoutProps,
99
+ {
100
+ ref: nodeRef,
101
+ style: extendObject(normalStyle, layoutStyle)
102
+ }
103
+ ),
104
+ [],
105
+ {
106
+ layoutRef
107
+ }
108
+ )
100
109
 
101
110
  const html: string = typeof nodes === 'string' ? nodes : jsonToHtmlStr(nodes)
102
111