@mpxjs/webpack-plugin 2.10.14-beta.7 → 2.10.14-beta.9

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 (179) hide show
  1. package/lib/platform/style/wx/index.js +7 -1
  2. package/lib/platform/template/wx/component-config/button.js +1 -1
  3. package/lib/runtime/components/react/dist/context.d.ts +5 -3
  4. package/lib/runtime/components/react/dist/context.js +1 -1
  5. package/lib/runtime/components/react/dist/event.config.d.ts +0 -1
  6. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +0 -1
  7. package/lib/runtime/components/react/dist/getInnerListeners.js +21 -35
  8. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +0 -1
  9. package/lib/runtime/components/react/dist/mpx-async-suspense.jsx +2 -2
  10. package/lib/runtime/components/react/dist/mpx-button.d.ts +0 -1
  11. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +0 -1
  12. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +0 -1
  13. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +0 -1
  14. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +0 -1
  15. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +0 -1
  16. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +0 -1
  17. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +0 -1
  18. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -1
  19. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +0 -1
  20. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -1
  21. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +0 -1
  22. package/lib/runtime/components/react/dist/mpx-form.d.ts +0 -1
  23. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -1
  24. package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -1
  25. package/lib/runtime/components/react/dist/mpx-image.jsx +37 -81
  26. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +0 -1
  27. package/lib/runtime/components/react/dist/mpx-input.d.ts +0 -2
  28. package/lib/runtime/components/react/dist/mpx-input.jsx +12 -19
  29. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +0 -1
  30. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +17 -9
  31. package/lib/runtime/components/react/dist/mpx-label.d.ts +0 -1
  32. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -1
  33. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +2 -5
  34. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +34 -102
  35. package/lib/runtime/components/react/dist/mpx-nav-container.d.ts +9 -0
  36. package/lib/runtime/components/react/dist/mpx-nav-container.jsx +23 -0
  37. package/lib/runtime/components/react/dist/mpx-navigator.d.ts +0 -1
  38. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +0 -1
  39. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +0 -1
  40. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +0 -1
  41. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +0 -1
  42. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +0 -1
  43. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +0 -1
  44. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +0 -1
  45. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +0 -1
  46. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +0 -1
  47. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +0 -2
  48. package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +3 -4
  49. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +0 -1
  50. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +0 -2
  51. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +21 -15
  52. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +0 -1
  53. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.jsx +11 -8
  54. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +0 -1
  55. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +0 -1
  56. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +0 -1
  57. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +0 -1
  58. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +0 -1
  59. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +0 -1
  60. package/lib/runtime/components/react/dist/mpx-portal/index.jsx +1 -5
  61. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +0 -1
  62. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +0 -1
  63. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.jsx +5 -3
  64. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -1
  65. package/lib/runtime/components/react/dist/mpx-radio.d.ts +0 -1
  66. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +0 -1
  67. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -1
  68. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +0 -1
  69. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +0 -1
  70. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +51 -69
  71. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +0 -1
  72. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +0 -1
  73. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +0 -1
  74. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +0 -1
  75. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +0 -1
  76. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +0 -1
  77. package/lib/runtime/components/react/dist/mpx-swiper.jsx +16 -9
  78. package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -1
  79. package/lib/runtime/components/react/dist/mpx-text.d.ts +1 -3
  80. package/lib/runtime/components/react/dist/mpx-text.jsx +5 -33
  81. package/lib/runtime/components/react/dist/mpx-textarea.d.ts +0 -1
  82. package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -1
  83. package/lib/runtime/components/react/dist/mpx-view.d.ts +0 -1
  84. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +0 -1
  85. package/lib/runtime/components/react/dist/mpx-web-view.jsx +2 -21
  86. package/lib/runtime/components/react/dist/{mpx-nav.d.ts → nav.d.ts} +0 -1
  87. package/lib/runtime/components/react/dist/{mpx-nav.jsx → nav.jsx} +6 -1
  88. package/lib/runtime/components/react/dist/parser.d.ts +0 -1
  89. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +0 -1
  90. package/lib/runtime/components/react/dist/useNavShared.d.ts +2 -0
  91. package/lib/runtime/components/react/dist/useNavShared.js +6 -0
  92. package/lib/runtime/components/react/dist/useNodesRef.d.ts +0 -1
  93. package/lib/runtime/components/react/dist/utils.d.ts +0 -1
  94. package/lib/runtime/components/react/dist/utils.jsx +6 -16
  95. package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +15 -16
  96. package/lib/runtime/components/react/mpx-view.tsx +1 -1
  97. package/package.json +1 -1
  98. package/lib/runtime/components/react/dist/context.d.ts.map +0 -1
  99. package/lib/runtime/components/react/dist/event.config.d.ts.map +0 -1
  100. package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +0 -1
  101. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +0 -1
  102. package/lib/runtime/components/react/dist/mpx-button.d.ts.map +0 -1
  103. package/lib/runtime/components/react/dist/mpx-camera.d.ts +0 -27
  104. package/lib/runtime/components/react/dist/mpx-camera.d.ts.map +0 -1
  105. package/lib/runtime/components/react/dist/mpx-camera.jsx +0 -197
  106. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +0 -1
  107. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +0 -1
  108. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +0 -1
  109. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +0 -1
  110. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +0 -1
  111. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +0 -1
  112. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +0 -1
  113. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +0 -1
  114. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +0 -1
  115. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +0 -1
  116. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +0 -1
  117. package/lib/runtime/components/react/dist/mpx-form.d.ts.map +0 -1
  118. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +0 -1
  119. package/lib/runtime/components/react/dist/mpx-image.d.ts.map +0 -1
  120. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +0 -1
  121. package/lib/runtime/components/react/dist/mpx-input.d.ts.map +0 -1
  122. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +0 -1
  123. package/lib/runtime/components/react/dist/mpx-label.d.ts.map +0 -1
  124. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +0 -1
  125. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +0 -1
  126. package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +0 -1
  127. package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +0 -1
  128. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +0 -1
  129. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +0 -1
  130. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +0 -1
  131. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +0 -1
  132. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +0 -1
  133. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +0 -1
  134. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +0 -1
  135. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +0 -1
  136. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +0 -1
  137. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +0 -1
  138. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +0 -1
  139. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +0 -1
  140. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +0 -1
  141. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +0 -14
  142. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +0 -1
  143. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.jsx +0 -20
  144. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +0 -1
  145. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +0 -1
  146. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +0 -1
  147. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +0 -1
  148. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +0 -1
  149. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +0 -1
  150. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +0 -1
  151. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +0 -1
  152. package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -24
  153. package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +0 -1
  154. package/lib/runtime/components/react/dist/mpx-progress.jsx +0 -163
  155. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +0 -1
  156. package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +0 -1
  157. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +0 -1
  158. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +0 -1
  159. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +0 -1
  160. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +0 -1
  161. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +0 -1
  162. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +0 -1
  163. package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -31
  164. package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +0 -1
  165. package/lib/runtime/components/react/dist/mpx-slider.jsx +0 -321
  166. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +0 -1
  167. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +0 -1
  168. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +0 -1
  169. package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +0 -1
  170. package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +0 -1
  171. package/lib/runtime/components/react/dist/mpx-text.d.ts.map +0 -1
  172. package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +0 -1
  173. package/lib/runtime/components/react/dist/mpx-video.d.ts.map +0 -1
  174. package/lib/runtime/components/react/dist/mpx-view.d.ts.map +0 -1
  175. package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +0 -1
  176. package/lib/runtime/components/react/dist/parser.d.ts.map +0 -1
  177. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +0 -1
  178. package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +0 -1
  179. package/lib/runtime/components/react/dist/utils.d.ts.map +0 -1
@@ -14,4 +14,3 @@ declare const PopupBase: {
14
14
  displayName: string;
15
15
  };
16
16
  export default PopupBase;
17
- //# sourceMappingURL=popupBase.d.ts.map
@@ -13,4 +13,3 @@ declare const Portal: {
13
13
  update: (key: number, e: ReactNode) => void;
14
14
  };
15
15
  export default Portal;
16
- //# sourceMappingURL=index.d.ts.map
@@ -1,18 +1,14 @@
1
1
  import { useContext, useEffect, useRef } from 'react';
2
- import { PortalContext, ProviderContext, RouteContext, VarContext } from '../context';
2
+ import { PortalContext, RouteContext, VarContext } from '../context';
3
3
  import PortalHost, { portal } from './portal-host';
4
4
  const Portal = ({ children }) => {
5
5
  const manager = useContext(PortalContext);
6
6
  const keyRef = useRef(null);
7
7
  const { pageId } = useContext(RouteContext) || {};
8
8
  const varContext = useContext(VarContext);
9
- const parentProvides = useContext(ProviderContext);
10
9
  if (varContext) {
11
10
  children = (<VarContext.Provider value={varContext} key='varContextWrap'>{children}</VarContext.Provider>);
12
11
  }
13
- if (parentProvides) {
14
- children = (<ProviderContext.Provider value={parentProvides} key='providerContextWrap'>{children}</ProviderContext.Provider>);
15
- }
16
12
  useEffect(() => {
17
13
  manager.update(keyRef.current, children);
18
14
  }, [children]);
@@ -27,4 +27,3 @@ declare class PortalGuard {
27
27
  export declare const portal: PortalGuard;
28
28
  declare const PortalHost: ({ children }: PortalHostProps) => JSX.Element;
29
29
  export default PortalHost;
30
- //# sourceMappingURL=portal-host.d.ts.map
@@ -7,4 +7,3 @@ export type State = {
7
7
  };
8
8
  declare const _PortalManager: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
9
9
  export default _PortalManager;
10
- //# sourceMappingURL=portal-manager.d.ts.map
@@ -1,4 +1,5 @@
1
- import { useState, useCallback, forwardRef, useImperativeHandle, Fragment } from 'react';
1
+ import { useState, useCallback, forwardRef, useImperativeHandle } from 'react';
2
+ import { View, StyleSheet } from 'react-native';
2
3
  const _PortalManager = forwardRef((props, ref) => {
3
4
  const [state, setState] = useState({
4
5
  portals: []
@@ -30,9 +31,10 @@ const _PortalManager = forwardRef((props, ref) => {
30
31
  portals: state.portals
31
32
  }));
32
33
  return (<>
33
- {state.portals.map(({ key, children }) => (<Fragment key={key}>
34
+ {state.portals.map(({ key, children }, i) => (<View key={key} collapsable={false} // Need collapsable=false here to clip the elevations
35
+ style={[StyleSheet.absoluteFill, { zIndex: 1000 + i, pointerEvents: 'box-none' }]}>
34
36
  {children}
35
- </Fragment>))}
37
+ </View>))}
36
38
  </>);
37
39
  });
38
40
  export default _PortalManager;
@@ -18,4 +18,3 @@ export interface RadioGroupProps {
18
18
  }
19
19
  declare const radioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HandlerRef<View, RadioGroupProps>>>;
20
20
  export default radioGroup;
21
- //# sourceMappingURL=mpx-radio-group.d.ts.map
@@ -24,4 +24,3 @@ export interface RadioProps {
24
24
  }
25
25
  declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HandlerRef<View, RadioProps>>>;
26
26
  export default Radio;
27
- //# sourceMappingURL=mpx-radio.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare const generateHTML: (html: string) => string;
2
- //# sourceMappingURL=html.d.ts.map
@@ -22,4 +22,3 @@ interface _RichTextProps extends ViewProps {
22
22
  }
23
23
  declare const _RichText: import("react").ForwardRefExoticComponent<_RichTextProps & import("react").RefAttributes<HandlerRef<View, _RichTextProps>>>;
24
24
  export default _RichText;
25
- //# sourceMappingURL=index.d.ts.map
@@ -12,4 +12,3 @@ declare const _RootPortal: {
12
12
  displayName: string;
13
13
  };
14
14
  export default _RootPortal;
15
- //# sourceMappingURL=mpx-root-portal.d.ts.map
@@ -52,4 +52,3 @@ declare const _ScrollView: import("react").ForwardRefExoticComponent<ScrollViewP
52
52
  children?: ReactNode;
53
53
  } & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react").ComponentType<any>>> & import("react-native").ScrollView & View, ScrollViewProps>>>;
54
54
  export default _ScrollView;
55
- //# sourceMappingURL=mpx-scroll-view.d.ts.map
@@ -48,6 +48,8 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
48
48
  const scrollOffset = useRef(new RNAnimated.Value(0)).current;
49
49
  const simultaneousHandlers = flatGesture(originSimultaneousHandlers);
50
50
  const waitForHandlers = flatGesture(waitFor);
51
+ const snapScrollTop = useRef(0);
52
+ const snapScrollLeft = useRef(0);
51
53
  const [refreshing, setRefreshing] = useState(false);
52
54
  const [enableScroll, setEnableScroll] = useState(true);
53
55
  const enableScrollValue = useSharedValue(true);
@@ -72,7 +74,6 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
72
74
  black: ['#000'],
73
75
  white: ['#fff']
74
76
  };
75
- const isContentSizeChange = useRef(false);
76
77
  const { refresherContent, otherContent } = getRefresherContent(props.children);
77
78
  const hasRefresher = refresherContent && refresherEnabled;
78
79
  const { normalStyle, hasVarDec, varContextRef, hasSelfPercent, hasPositionFixed, setWidth, setHeight } = useTransformStyle(style, { enableVar, externalVarContext, parentFontSize, parentWidth, parentHeight });
@@ -125,12 +126,14 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
125
126
  warn('scroll-x and scroll-y cannot be set to true at the same time, Mpx will use the value of scroll-y as the criterion');
126
127
  }
127
128
  useEffect(() => {
128
- initialTimeout.current = setTimeout(() => {
129
- scrollToOffset(scrollLeft, scrollTop);
130
- }, 0);
131
- return () => {
132
- initialTimeout.current && clearTimeout(initialTimeout.current);
133
- };
129
+ if (snapScrollTop.current !== scrollTop || snapScrollLeft.current !== scrollLeft) {
130
+ initialTimeout.current = setTimeout(() => {
131
+ scrollToOffset(scrollLeft, scrollTop);
132
+ }, 0);
133
+ return () => {
134
+ initialTimeout.current && clearTimeout(initialTimeout.current);
135
+ };
136
+ }
134
137
  }, [scrollTop, scrollLeft]);
135
138
  useEffect(() => {
136
139
  if (scrollIntoView && __selectRef) {
@@ -220,22 +223,7 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
220
223
  }
221
224
  }
222
225
  function onContentSizeChange(width, height) {
223
- isContentSizeChange.current = true;
224
- const newContentLength = selectLength({ height, width });
225
- const oldContentLength = scrollOptions.current.contentLength;
226
- scrollOptions.current.contentLength = newContentLength;
227
- // 内容高度变化时,Animated.event 的映射可能会有不生效的场景,所以需要手动设置一下 scrollOffset 的值
228
- if (enableSticky && (__mpx_mode__ === 'android' || __mpx_mode__ === 'ios')) {
229
- // 当内容变少时,检查当前滚动位置是否超出新的内容范围
230
- if (newContentLength < oldContentLength) {
231
- const { visibleLength, offset } = scrollOptions.current;
232
- const maxOffset = Math.max(0, newContentLength - visibleLength);
233
- // 如果当前滚动位置超出了新的内容范围,调整滚动offset
234
- if (offset > maxOffset && scrollY) {
235
- scrollOffset.setValue(maxOffset);
236
- }
237
- }
238
- }
226
+ scrollOptions.current.contentLength = selectLength({ height, width });
239
227
  }
240
228
  function onLayout(e) {
241
229
  const layout = e.nativeEvent.layout || {};
@@ -255,9 +243,8 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
255
243
  }
256
244
  function onScroll(e) {
257
245
  const { bindscroll } = props;
258
- const { contentOffset, layoutMeasurement, contentSize } = e.nativeEvent;
259
- const { x: scrollLeft, y: scrollTop } = contentOffset;
260
- const { width: scrollWidth, height: scrollHeight } = contentSize;
246
+ const { x: scrollLeft, y: scrollTop } = e.nativeEvent.contentOffset;
247
+ const { width: scrollWidth, height: scrollHeight } = e.nativeEvent.contentSize;
261
248
  isAtTop.value = scrollTop <= 0;
262
249
  bindscroll &&
263
250
  bindscroll(getCustomEvent('scroll', e, {
@@ -267,8 +254,7 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
267
254
  scrollHeight,
268
255
  scrollWidth,
269
256
  deltaX: scrollLeft - scrollOptions.current.scrollLeft,
270
- deltaY: scrollTop - scrollOptions.current.scrollTop,
271
- layoutMeasurement
257
+ deltaY: scrollTop - scrollOptions.current.scrollTop
272
258
  },
273
259
  layoutRef
274
260
  }, props));
@@ -281,9 +267,8 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
281
267
  }
282
268
  function onScrollEnd(e) {
283
269
  const { bindscrollend } = props;
284
- const { contentOffset, layoutMeasurement, contentSize } = e.nativeEvent;
285
- const { x: scrollLeft, y: scrollTop } = contentOffset;
286
- const { width: scrollWidth, height: scrollHeight } = contentSize;
270
+ const { x: scrollLeft, y: scrollTop } = e.nativeEvent.contentOffset;
271
+ const { width: scrollWidth, height: scrollHeight } = e.nativeEvent.contentSize;
287
272
  isAtTop.value = scrollTop <= 0;
288
273
  bindscrollend &&
289
274
  bindscrollend(getCustomEvent('scrollend', e, {
@@ -291,8 +276,7 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
291
276
  scrollLeft,
292
277
  scrollTop,
293
278
  scrollHeight,
294
- scrollWidth,
295
- layoutMeasurement
279
+ scrollWidth
296
280
  },
297
281
  layoutRef
298
282
  }, props));
@@ -312,6 +296,24 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
312
296
  function scrollToOffset(x = 0, y = 0, animated = scrollWithAnimation) {
313
297
  if (scrollViewRef.current) {
314
298
  scrollViewRef.current.scrollTo({ x, y, animated });
299
+ scrollOptions.current.scrollLeft = x;
300
+ scrollOptions.current.scrollTop = y;
301
+ snapScrollLeft.current = x;
302
+ snapScrollTop.current = y;
303
+ }
304
+ }
305
+ function onScrollTouchStart(e) {
306
+ const { bindtouchstart } = props;
307
+ bindtouchstart && bindtouchstart(e);
308
+ if (enhanced) {
309
+ binddragstart &&
310
+ binddragstart(getCustomEvent('dragstart', e, {
311
+ detail: {
312
+ scrollLeft: scrollOptions.current.scrollLeft,
313
+ scrollTop: scrollOptions.current.scrollTop
314
+ },
315
+ layoutRef
316
+ }, props));
315
317
  }
316
318
  }
317
319
  function onScrollTouchMove(e) {
@@ -327,6 +329,19 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
327
329
  }, props));
328
330
  }
329
331
  }
332
+ function onScrollTouchEnd(e) {
333
+ bindtouchend && bindtouchend(e);
334
+ if (enhanced) {
335
+ binddragend &&
336
+ binddragend(getCustomEvent('dragend', e, {
337
+ detail: {
338
+ scrollLeft: scrollOptions.current.scrollLeft || 0,
339
+ scrollTop: scrollOptions.current.scrollTop || 0
340
+ },
341
+ layoutRef
342
+ }, props));
343
+ }
344
+ }
330
345
  function onScrollDrag(e) {
331
346
  const { x: scrollLeft, y: scrollTop } = e.nativeEvent.contentOffset;
332
347
  updateScrollOptions(e, { scrollLeft, scrollTop });
@@ -335,16 +350,6 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
335
350
  const scrollHandler = RNAnimated.event([{ nativeEvent: { contentOffset: { y: scrollOffset } } }], {
336
351
  useNativeDriver: true,
337
352
  listener: (event) => {
338
- const y = event.nativeEvent.contentOffset.y || 0;
339
- // 内容高度变化时,鸿蒙中 listener 回调通过scrollOffset.__getValue获取值一直等于event.nativeEvent.contentOffset.y,值是正确的,但是无法触发 sticky 动画执行,所以需要手动再 set 一次
340
- if (__mpx_mode__ === 'harmony') {
341
- if (isContentSizeChange.current) {
342
- scrollOffset.setValue(y);
343
- setTimeout(() => {
344
- isContentSizeChange.current = false;
345
- }, 100);
346
- }
347
- }
348
353
  onScroll(event);
349
354
  }
350
355
  });
@@ -352,30 +357,6 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
352
357
  hasCallScrollToLower.current = false;
353
358
  hasCallScrollToUpper.current = false;
354
359
  onScrollDrag(e);
355
- if (enhanced) {
356
- binddragstart &&
357
- binddragstart(getCustomEvent('dragstart', e, {
358
- detail: {
359
- scrollLeft: scrollOptions.current.scrollLeft,
360
- scrollTop: scrollOptions.current.scrollTop
361
- },
362
- layoutRef
363
- }, props));
364
- }
365
- }
366
- function onScrollDragEnd(e) {
367
- onScrollDrag(e);
368
- if (enhanced) {
369
- // 安卓上如果触发了默认的下拉刷新,binddragend可能不触发,只会触发 binddragstart
370
- binddragend &&
371
- binddragend(getCustomEvent('dragend', e, {
372
- detail: {
373
- scrollLeft: scrollOptions.current.scrollLeft || 0,
374
- scrollTop: scrollOptions.current.scrollTop || 0
375
- },
376
- layoutRef
377
- }, props));
378
- }
379
360
  }
380
361
  // 处理刷新
381
362
  function onRefresh() {
@@ -532,13 +513,14 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
532
513
  showsVerticalScrollIndicator: scrollY && showScrollbar,
533
514
  scrollEnabled: !enableScroll ? false : !!(scrollX || scrollY),
534
515
  bounces: false,
535
- overScrollMode: 'never',
536
516
  ref: scrollViewRef,
537
517
  onScroll: enableSticky ? scrollHandler : onScroll,
538
518
  onContentSizeChange: onContentSizeChange,
519
+ bindtouchstart: ((enhanced && binddragstart) || bindtouchstart) && onScrollTouchStart,
539
520
  bindtouchmove: ((enhanced && binddragging) || bindtouchmove) && onScrollTouchMove,
521
+ bindtouchend: ((enhanced && binddragend) || bindtouchend) && onScrollTouchEnd,
540
522
  onScrollBeginDrag: onScrollDragStart,
541
- onScrollEndDrag: onScrollDragEnd,
523
+ onScrollEndDrag: onScrollDrag,
542
524
  onMomentumScrollEnd: onScrollEnd
543
525
  }, (simultaneousHandlers ? { simultaneousHandlers } : {}), (waitForHandlers ? { waitFor: waitForHandlers } : {}), layoutProps);
544
526
  if (enhanced) {
@@ -5,4 +5,3 @@ declare const SimpleText: {
5
5
  displayName: string;
6
6
  };
7
7
  export default SimpleText;
8
- //# sourceMappingURL=mpx-simple-text.d.ts.map
@@ -5,4 +5,3 @@ declare const SimpleView: {
5
5
  displayName: string;
6
6
  };
7
7
  export default SimpleView;
8
- //# sourceMappingURL=mpx-simple-view.d.ts.map
@@ -15,4 +15,3 @@ interface StickyHeaderProps {
15
15
  }
16
16
  declare const _StickyHeader: import("react").ForwardRefExoticComponent<StickyHeaderProps & import("react").RefAttributes<HandlerRef<View, StickyHeaderProps>>>;
17
17
  export default _StickyHeader;
18
- //# sourceMappingURL=mpx-sticky-header.d.ts.map
@@ -13,4 +13,3 @@ interface StickySectionProps {
13
13
  }
14
14
  declare const _StickySection: import("react").ForwardRefExoticComponent<StickySectionProps & import("react").RefAttributes<HandlerRef<View, StickySectionProps>>>;
15
15
  export default _StickySection;
16
- //# sourceMappingURL=mpx-sticky-section.d.ts.map
@@ -16,4 +16,3 @@ interface SwiperItemProps {
16
16
  }
17
17
  declare const _SwiperItem: import("react").ForwardRefExoticComponent<SwiperItemProps & import("react").RefAttributes<HandlerRef<View, SwiperItemProps>>>;
18
18
  export default _SwiperItem;
19
- //# sourceMappingURL=mpx-swiper-item.d.ts.map
@@ -50,4 +50,3 @@ interface SwiperProps {
50
50
  }
51
51
  declare const SwiperWrapper: React.ForwardRefExoticComponent<SwiperProps & React.RefAttributes<HandlerRef<View, SwiperProps>>>;
52
52
  export default SwiperWrapper;
53
- //# sourceMappingURL=mpx-swiper.d.ts.map
@@ -120,6 +120,8 @@ const SwiperWrapper = forwardRef((props, ref) => {
120
120
  const strVelocity = 'velocity' + dir.toUpperCase();
121
121
  // 标识手指触摸和抬起, 起点在onBegin
122
122
  const touchfinish = useSharedValue(true);
123
+ // 记录onUpdate时的方向,用于进行onFinalize中的值修正
124
+ const preUpdateTransDir = useSharedValue(0);
123
125
  // 记录上一帧的绝对定位坐标
124
126
  const preAbsolutePos = useSharedValue(0);
125
127
  // 记录从onBegin 到 onTouchesUp 时移动的距离
@@ -325,11 +327,9 @@ const SwiperWrapper = forwardRef((props, ref) => {
325
327
  resumeLoop
326
328
  };
327
329
  }, []);
328
- function handleSwiperChange(current, pCurrent) {
329
- if (pCurrent !== currentIndex.value) {
330
- const eventData = getCustomEvent('change', {}, { detail: { current, source: 'touch' }, layoutRef: layoutRef });
331
- bindchange && bindchange(eventData);
332
- }
330
+ function handleSwiperChange(current) {
331
+ const eventData = getCustomEvent('change', {}, { detail: { current, source: 'touch' }, layoutRef: layoutRef });
332
+ bindchange && bindchange(eventData);
333
333
  }
334
334
  const runOnJSCallbackRef = useRef({
335
335
  loop,
@@ -379,7 +379,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
379
379
  // 1. 用户在当前页切换选中项,动画;用户携带选中index打开到swiper页直接选中不走动画
380
380
  useAnimatedReaction(() => currentIndex.value, (newIndex, preIndex) => {
381
381
  // 这里必须传递函数名, 直接写()=> {}形式会报 访问了未sharedValue信息
382
- if (newIndex !== preIndex && bindchange) {
382
+ if (newIndex !== preIndex && preIndex !== null && preIndex !== undefined && bindchange) {
383
383
  runOnJS(runOnJSCallback)('handleSwiperChange', newIndex, propCurrent);
384
384
  }
385
385
  });
@@ -411,9 +411,9 @@ const SwiperWrapper = forwardRef((props, ref) => {
411
411
  }
412
412
  }, [children.length]);
413
413
  useEffect(() => {
414
- // 1. 如果用户在touch的过程中, 外部更新了current以外部为准(小程序表现)
414
+ // 1. 如果用户在touch的过程中, 外部更新了current以内部为准(小程序表现)
415
415
  // 2. 手指滑动过程中更新索引,外部会把current再传入进来,导致offset直接更新,增加判断不同才更新
416
- if (propCurrent !== currentIndex.value) {
416
+ if (propCurrent !== currentIndex.value && touchfinish.value) {
417
417
  updateCurrent(propCurrent, step.value);
418
418
  }
419
419
  }, [propCurrent]);
@@ -662,6 +662,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
662
662
  translation: moveDistance,
663
663
  transdir: moveDistance
664
664
  };
665
+ preUpdateTransDir.value = moveDistance;
665
666
  // 1. 支持滑动中超出一半更新索引的能力:只更新索引并不会影响onFinalize依据当前offset计算的索引
666
667
  const { half } = computeHalf(eventData);
667
668
  if (childrenLength.value > 1 && half) {
@@ -702,11 +703,17 @@ const SwiperWrapper = forwardRef((props, ref) => {
702
703
  if (touchfinish.value)
703
704
  return;
704
705
  touchfinish.value = true;
706
+ /**
707
+ * 安卓修正
708
+ * 问题:部分安卓机型onFinalize中拿到的absoluteX 有问题
709
+ * 案例:比如手指从右向左滑的时候,onUpdate拿到的是241.64346313476562, 而onFinalize中拿到的是241.81817626953125,理论上onFinalize中应该比onUpdate小才对吧
710
+ * 解决方式:修正
711
+ */
705
712
  // 触发过onUpdate正常情况下e[strAbso] - preAbsolutePos.value=0; 未触发过onUpdate的情况下e[strAbso] - preAbsolutePos.value 不为0
706
713
  const moveDistance = e[strAbso] - preAbsolutePos.value;
707
714
  const eventData = {
708
715
  translation: moveDistance,
709
- transdir: moveDistance !== 0 ? moveDistance : e[strAbso] - moveTranstion.value
716
+ transdir: Math.abs(moveDistance) > 1 ? moveDistance : preUpdateTransDir.value
710
717
  };
711
718
  // 1. 只有一个元素:循环 和 非循环状态,都走回弹效果
712
719
  if (childrenLength.value === 1) {
@@ -24,4 +24,3 @@ interface _SwitchProps extends SwitchProps {
24
24
  }
25
25
  declare const _Switch: import("react").ForwardRefExoticComponent<_SwitchProps & import("react").RefAttributes<HandlerRef<Switch, _SwitchProps>>>;
26
26
  export default _Switch;
27
- //# sourceMappingURL=mpx-switch.d.ts.map
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * ✔ selectable
3
3
  * ✘ space
4
- * decode
4
+ * decode
5
5
  */
6
6
  import { Text, TextStyle, TextProps } from 'react-native';
7
7
  import { ReactNode } from 'react';
@@ -16,8 +16,6 @@ interface _TextProps extends TextProps {
16
16
  'parent-font-size'?: number;
17
17
  'parent-width'?: number;
18
18
  'parent-height'?: number;
19
- decode?: boolean;
20
19
  }
21
20
  declare const _Text: import("react").ForwardRefExoticComponent<_TextProps & import("react").RefAttributes<HandlerRef<Text, _TextProps>>>;
22
21
  export default _Text;
23
- //# sourceMappingURL=mpx-text.d.ts.map
@@ -1,40 +1,16 @@
1
1
  /**
2
2
  * ✔ selectable
3
3
  * ✘ space
4
- * decode
4
+ * decode
5
5
  */
6
6
  import { Text } from 'react-native';
7
- import { useRef, forwardRef, createElement, Children } from 'react';
7
+ import { useRef, forwardRef, createElement } from 'react';
8
8
  import Portal from './mpx-portal';
9
9
  import useInnerProps from './getInnerListeners';
10
10
  import useNodesRef from './useNodesRef'; // 引入辅助函数
11
11
  import { useTransformStyle, wrapChildren, extendObject } from './utils';
12
- const decodeMap = {
13
- '&lt;': '<',
14
- '&gt;': '>',
15
- '&quot;': '"',
16
- '&amp;': '&',
17
- '&#39;': '\'',
18
- '&nbsp;': ' '
19
- };
20
- const encodedRe = /&(?:lt|gt|quot|amp|#39|nbsp);/g;
21
- function decode(value) {
22
- if (value != null) {
23
- return value.replace(encodedRe, function (match) {
24
- return decodeMap[match];
25
- });
26
- }
27
- }
28
- function getDecodedChildren(children) {
29
- return Children.map(children, (child) => {
30
- if (typeof child === 'string') {
31
- return decode(child);
32
- }
33
- return child;
34
- });
35
- }
36
12
  const _Text = forwardRef((props, ref) => {
37
- const { style = {}, allowFontScaling = false, selectable, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'user-select': userSelect, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, decode } = props;
13
+ const { style = {}, allowFontScaling = false, selectable, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'user-select': userSelect, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
38
14
  const { normalStyle, hasVarDec, varContextRef, hasPositionFixed } = useTransformStyle(style, {
39
15
  enableVar,
40
16
  externalVarContext,
@@ -52,13 +28,9 @@ const _Text = forwardRef((props, ref) => {
52
28
  selectable: !!selectable || !!userSelect,
53
29
  allowFontScaling
54
30
  }), [
55
- 'user-select',
56
- 'decode'
31
+ 'user-select'
57
32
  ]);
58
- const children = decode ? getDecodedChildren(props.children) : props.children;
59
- let finalComponent = createElement(Text, innerProps, wrapChildren(extendObject({}, props, {
60
- children
61
- }), {
33
+ let finalComponent = createElement(Text, innerProps, wrapChildren(props, {
62
34
  hasVarDec,
63
35
  varContext: varContextRef.current
64
36
  }));
@@ -5,4 +5,3 @@ import { HandlerRef } from './useNodesRef';
5
5
  export type TextareProps = Omit<InputProps & PrivateInputProps, 'type' | 'password' | 'multiline' | 'confirm-hold'>;
6
6
  declare const Textarea: import("react").ForwardRefExoticComponent<TextareProps & import("react").RefAttributes<HandlerRef<TextInput, TextareProps>>>;
7
7
  export default Textarea;
8
- //# sourceMappingURL=mpx-textarea.d.ts.map
@@ -99,4 +99,3 @@ interface VideoProps {
99
99
  }
100
100
  declare const MpxVideo: import("react").ForwardRefExoticComponent<VideoProps & import("react").RefAttributes<HandlerRef<View, VideoProps>>>;
101
101
  export default MpxVideo;
102
- //# sourceMappingURL=mpx-video.d.ts.map
@@ -32,4 +32,3 @@ export interface _ViewProps extends ViewProps {
32
32
  }
33
33
  declare const _View: import("react").ForwardRefExoticComponent<_ViewProps & import("react").RefAttributes<HandlerRef<View, _ViewProps>>>;
34
34
  export default _View;
35
- //# sourceMappingURL=mpx-view.d.ts.map
@@ -20,4 +20,3 @@ interface WebViewProps {
20
20
  }
21
21
  declare const _WebView: import("react").ForwardRefExoticComponent<Omit<WebViewProps, "ref"> & import("react").RefAttributes<HandlerRef<WebView<{}>, WebViewProps>>>;
22
22
  export default _WebView;
23
- //# sourceMappingURL=mpx-web-view.d.ts.map
@@ -80,25 +80,9 @@ const _WebView = forwardRef((props, ref) => {
80
80
  useNodesRef(props, ref, webViewRef, {
81
81
  style: defaultWebViewStyle
82
82
  });
83
- const hostValidate = (url) => {
84
- const host = url && new URL(url).host;
85
- const hostWhitelists = mpx.config.rnConfig?.webviewConfig?.hostWhitelists || [];
86
- if (hostWhitelists.length) {
87
- return hostWhitelists.some((item) => {
88
- return host.endsWith(item);
89
- });
90
- }
91
- else {
92
- return true;
93
- }
94
- };
95
83
  if (!src) {
96
84
  return null;
97
85
  }
98
- if (!hostValidate(src)) {
99
- console.error('访问页面域名不符合domainWhiteLists白名单配置,请确认是否正确配置该域名白名单');
100
- return null;
101
- }
102
86
  const _reload = function () {
103
87
  if (__mpx_mode__ !== 'ios') {
104
88
  fristLoaded.current = false; // 安卓需要重新设置
@@ -149,9 +133,6 @@ const _WebView = forwardRef((props, ref) => {
149
133
  }
150
134
  };
151
135
  const _message = function (res) {
152
- if (!hostValidate(res.nativeEvent?.url)) {
153
- return;
154
- }
155
136
  let data = {};
156
137
  let asyncCallback;
157
138
  const navObj = promisify({ redirectTo, navigateTo, navigateBack, reLaunch, switchTab });
@@ -176,7 +157,7 @@ const _WebView = forwardRef((props, ref) => {
176
157
  }
177
158
  break;
178
159
  case 'postMessage':
179
- bindmessage && bindmessage(getCustomEvent('message', {}, {
160
+ bindmessage && bindmessage(getCustomEvent('messsage', {}, {
180
161
  detail: {
181
162
  data: params[0]?.data
182
163
  }
@@ -203,7 +184,7 @@ const _WebView = forwardRef((props, ref) => {
203
184
  break;
204
185
  default:
205
186
  if (type) {
206
- const implement = mpx.config.rnConfig.webviewConfig && mpx.config.rnConfig.webviewConfig.apiImplementations && mpx.config.rnConfig.webviewConfig.apiImplementations[type];
187
+ const implement = mpx.config.webviewConfig.apiImplementations && mpx.config.webviewConfig.apiImplementations[type];
207
188
  if (isFunction(implement)) {
208
189
  asyncCallback = Promise.resolve(implement(...params));
209
190
  }
@@ -6,4 +6,3 @@ export interface MpxNavProps {
6
6
  }
7
7
  declare const MpxNav: import("react").MemoExoticComponent<({ pageConfig, navigation }: MpxNavProps) => import("react").JSX.Element>;
8
8
  export default MpxNav;
9
- //# sourceMappingURL=mpx-nav.d.ts.map
@@ -2,6 +2,7 @@
2
2
  import { useState, useMemo, memo } from 'react';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
  import { StatusBar, processColor, TouchableWithoutFeedback, Image, View, StyleSheet, Text } from 'react-native';
5
+ import { useNavShared } from './useNavShared';
5
6
  function convertToHex(color) {
6
7
  try {
7
8
  const intColor = processColor(color);
@@ -80,6 +81,7 @@ const validBarTextStyle = (textStyle) => {
80
81
  const BACK_ICON = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAABICAYAAACqT5alAAAA2UlEQVR4nO3bMQrCUBRE0Yla6AYEN2nnBrTL+izcitW3MRDkEUWSvPzJvfCqgMwhZbAppWhNbbIHzB1g9wATERFRVyvpkj1irlpJ5X326D7WHh1hbdFD2CLpLmmftm7kfsEe09aNHFiBrT+wAlt/YAW2/sAKbP2BFdj6Ayuwy+ufz6XPL893krZ//O6iu2n4LT8kndLWTRTo4EC7BDo40C6BDg60S6CDA+0S6OBAuwQ6uNWiD2nrJmoIfU7cNWkR2hbb1UfbY7uuWhGWiIg+a/iHuHmA3QPs3gu4JW9Gan+OJAAAAABJRU5ErkJggg==';
81
82
  const MpxNav = memo(({ pageConfig, navigation }) => {
82
83
  const [innerPageConfig, setPageConfig] = useState(pageConfig || {});
84
+ const [customNav] = useNavShared();
83
85
  const safeAreaTop = useSafeAreaInsets()?.top || 0;
84
86
  navigation.setPageConfig = (config) => {
85
87
  setPageConfig(Object.assign({}, innerPageConfig, config));
@@ -89,7 +91,10 @@ const MpxNav = memo(({ pageConfig, navigation }) => {
89
91
  // 状态栏的颜色
90
92
  const statusBarElement = (<StatusBar translucent backgroundColor='transparent' barStyle={navigationBarTextStyle === NavColor.White ? 'light-content' : 'dark-content'}></StatusBar>);
91
93
  if (isCustom)
92
- return statusBarElement;
94
+ return (<>
95
+ {statusBarElement}
96
+ {customNav}
97
+ </>);
93
98
  // 假设是栈导航,获取栈的长度
94
99
  const stackLength = navigation.getState()?.routes?.length;
95
100
  const onStackTopBack = mpxGlobal?.__mpx?.config?.rnConfig?.onStackTopBack;
@@ -37,4 +37,3 @@ export declare class ReplaceSource {
37
37
  source(): string;
38
38
  }
39
39
  export {};
40
- //# sourceMappingURL=parser.d.ts.map
@@ -30,4 +30,3 @@ export default function useAnimationHooks<T, P>(props: _ViewProps & {
30
30
  animationStyle: ExtendedViewStyle;
31
31
  };
32
32
  export {};
33
- //# sourceMappingURL=useAnimationHooks.d.ts.map
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function useNavShared(): readonly [import("react").ReactNode, (value: import("react").ReactNode) => void];