@mpxjs/webpack-plugin 2.9.66 → 2.9.69-beta.0

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 (158) hide show
  1. package/lib/dependencies/RecordGlobalComponentsDependency.js +11 -12
  2. package/lib/dependencies/RecordRuntimeInfoDependency.js +1 -1
  3. package/lib/index.js +29 -8
  4. package/lib/json-compiler/index.js +2 -11
  5. package/lib/loader.js +24 -45
  6. package/lib/native-loader.js +49 -64
  7. package/lib/platform/json/wx/index.js +24 -18
  8. package/lib/platform/style/wx/index.js +49 -47
  9. package/lib/platform/template/wx/component-config/canvas.js +8 -0
  10. package/lib/platform/template/wx/component-config/fix-component-name.js +15 -12
  11. package/lib/platform/template/wx/component-config/index.js +1 -1
  12. package/lib/platform/template/wx/component-config/input.js +1 -1
  13. package/lib/platform/template/wx/component-config/rich-text.js +8 -0
  14. package/lib/platform/template/wx/component-config/swiper.js +1 -1
  15. package/lib/platform/template/wx/component-config/textarea.js +1 -1
  16. package/lib/platform/template/wx/component-config/unsupported.js +1 -1
  17. package/lib/react/index.js +4 -3
  18. package/lib/react/processJSON.js +5 -13
  19. package/lib/react/processMainScript.js +7 -3
  20. package/lib/react/processScript.js +3 -4
  21. package/lib/react/processStyles.js +14 -4
  22. package/lib/react/processTemplate.js +5 -2
  23. package/lib/resolver/AddModePlugin.js +20 -7
  24. package/lib/runtime/components/react/context.ts +6 -0
  25. package/lib/runtime/components/react/dist/context.js +2 -0
  26. package/lib/runtime/components/react/dist/event.config.js +24 -24
  27. package/lib/runtime/components/react/dist/getInnerListeners.js +183 -174
  28. package/lib/runtime/components/react/dist/mpx-button.jsx +78 -50
  29. package/lib/runtime/components/react/dist/mpx-canvas/Bus.js +60 -0
  30. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.js +15 -0
  31. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.js +84 -0
  32. package/lib/runtime/components/react/dist/mpx-canvas/Image.js +87 -0
  33. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.js +15 -0
  34. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.js +28 -0
  35. package/lib/runtime/components/react/dist/mpx-canvas/html.js +343 -0
  36. package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +232 -0
  37. package/lib/runtime/components/react/dist/mpx-canvas/utils.jsx +89 -0
  38. package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +41 -34
  39. package/lib/runtime/components/react/dist/mpx-checkbox.jsx +30 -39
  40. package/lib/runtime/components/react/dist/mpx-form.jsx +47 -41
  41. package/lib/runtime/components/react/dist/mpx-icon.jsx +9 -17
  42. package/lib/runtime/components/react/dist/mpx-image.jsx +291 -0
  43. package/lib/runtime/components/react/dist/mpx-input.jsx +95 -62
  44. package/lib/runtime/components/react/dist/mpx-label.jsx +24 -28
  45. package/lib/runtime/components/react/dist/mpx-movable-area.jsx +20 -30
  46. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +377 -293
  47. package/lib/runtime/components/react/dist/mpx-navigator.jsx +3 -5
  48. package/lib/runtime/components/react/dist/mpx-picker/date.jsx +6 -2
  49. package/lib/runtime/components/react/dist/mpx-picker/index.jsx +5 -3
  50. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +6 -2
  51. package/lib/runtime/components/react/dist/mpx-picker/region.jsx +6 -2
  52. package/lib/runtime/components/react/dist/mpx-picker/selector.jsx +6 -2
  53. package/lib/runtime/components/react/dist/mpx-picker/time.jsx +10 -15
  54. package/lib/runtime/components/react/dist/mpx-picker-view-column-item.jsx +39 -0
  55. package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +160 -88
  56. package/lib/runtime/components/react/dist/mpx-picker-view.jsx +80 -121
  57. package/lib/runtime/components/react/dist/mpx-radio-group.jsx +39 -34
  58. package/lib/runtime/components/react/dist/mpx-radio.jsx +28 -43
  59. package/lib/runtime/components/react/dist/mpx-rich-text/html.js +39 -0
  60. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +63 -0
  61. package/lib/runtime/components/react/dist/mpx-root-portal.jsx +7 -5
  62. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +77 -51
  63. package/lib/runtime/components/react/dist/mpx-simple-text.jsx +11 -0
  64. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +5 -3
  65. package/lib/runtime/components/react/dist/mpx-swiper.jsx +606 -0
  66. package/lib/runtime/components/react/dist/mpx-switch.jsx +28 -11
  67. package/lib/runtime/components/react/dist/mpx-text.jsx +12 -11
  68. package/lib/runtime/components/react/dist/mpx-textarea.jsx +9 -4
  69. package/lib/runtime/components/react/dist/mpx-view.jsx +66 -62
  70. package/lib/runtime/components/react/dist/mpx-web-view.jsx +113 -36
  71. package/lib/runtime/components/react/dist/pickerFaces.js +81 -0
  72. package/lib/runtime/components/react/dist/pickerVIewContext.js +9 -0
  73. package/lib/runtime/components/react/dist/pickerViewMask.jsx +18 -0
  74. package/lib/runtime/components/react/dist/pickerViewOverlay.jsx +23 -0
  75. package/lib/runtime/components/react/dist/useAnimationHooks.js +126 -12
  76. package/lib/runtime/components/react/dist/utils.jsx +80 -24
  77. package/lib/runtime/components/react/event.config.ts +25 -26
  78. package/lib/runtime/components/react/getInnerListeners.ts +237 -198
  79. package/lib/runtime/components/react/mpx-button.tsx +105 -58
  80. package/lib/runtime/components/react/mpx-canvas/Bus.ts +70 -0
  81. package/lib/runtime/components/react/mpx-canvas/CanvasGradient.ts +18 -0
  82. package/lib/runtime/components/react/mpx-canvas/CanvasRenderingContext2D.ts +87 -0
  83. package/lib/runtime/components/react/mpx-canvas/Image.ts +102 -0
  84. package/lib/runtime/components/react/mpx-canvas/ImageData.ts +23 -0
  85. package/lib/runtime/components/react/mpx-canvas/constructorsRegistry.ts +38 -0
  86. package/lib/runtime/components/react/mpx-canvas/html.ts +343 -0
  87. package/lib/runtime/components/react/mpx-canvas/index.tsx +296 -0
  88. package/lib/runtime/components/react/mpx-canvas/utils.tsx +150 -0
  89. package/lib/runtime/components/react/mpx-checkbox-group.tsx +77 -51
  90. package/lib/runtime/components/react/mpx-checkbox.tsx +49 -50
  91. package/lib/runtime/components/react/mpx-form.tsx +62 -57
  92. package/lib/runtime/components/react/mpx-icon.tsx +13 -18
  93. package/lib/runtime/components/react/mpx-image.tsx +436 -0
  94. package/lib/runtime/components/react/mpx-input.tsx +139 -117
  95. package/lib/runtime/components/react/mpx-label.tsx +36 -34
  96. package/lib/runtime/components/react/mpx-movable-area.tsx +26 -39
  97. package/lib/runtime/components/react/mpx-movable-view.tsx +455 -337
  98. package/lib/runtime/components/react/mpx-navigator.tsx +3 -9
  99. package/lib/runtime/components/react/mpx-picker/date.tsx +5 -2
  100. package/lib/runtime/components/react/mpx-picker/index.tsx +3 -2
  101. package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +5 -2
  102. package/lib/runtime/components/react/mpx-picker/region.tsx +5 -2
  103. package/lib/runtime/components/react/mpx-picker/selector.tsx +5 -2
  104. package/lib/runtime/components/react/mpx-picker/time.tsx +10 -15
  105. package/lib/runtime/components/react/mpx-picker/type.ts +48 -43
  106. package/lib/runtime/components/react/mpx-picker-view-column.tsx +236 -104
  107. package/lib/runtime/components/react/mpx-picker-view.tsx +132 -122
  108. package/lib/runtime/components/react/mpx-radio-group.tsx +77 -54
  109. package/lib/runtime/components/react/mpx-radio.tsx +46 -55
  110. package/lib/runtime/components/react/mpx-rich-text/html.ts +40 -0
  111. package/lib/runtime/components/react/mpx-rich-text/index.tsx +121 -0
  112. package/lib/runtime/components/react/mpx-root-portal.tsx +4 -6
  113. package/lib/runtime/components/react/mpx-scroll-view.tsx +122 -76
  114. package/lib/runtime/components/react/mpx-simple-text.tsx +18 -0
  115. package/lib/runtime/components/react/mpx-swiper/carouse.tsx +6 -4
  116. package/lib/runtime/components/react/mpx-swiper/index.tsx +2 -1
  117. package/lib/runtime/components/react/mpx-swiper-item.tsx +4 -3
  118. package/lib/runtime/components/react/mpx-switch.tsx +39 -25
  119. package/lib/runtime/components/react/mpx-text.tsx +15 -19
  120. package/lib/runtime/components/react/mpx-textarea.tsx +12 -11
  121. package/lib/runtime/components/react/mpx-view.tsx +93 -77
  122. package/lib/runtime/components/react/mpx-web-view.tsx +117 -55
  123. package/lib/runtime/components/react/pickerFaces.ts +104 -0
  124. package/lib/runtime/components/react/pickerOverlay.tsx +32 -0
  125. package/lib/runtime/components/react/types/common.ts +2 -0
  126. package/lib/runtime/components/react/types/global.d.ts +5 -17
  127. package/lib/runtime/components/react/useAnimationHooks.ts +127 -18
  128. package/lib/runtime/components/react/useNodesRef.ts +1 -0
  129. package/lib/runtime/components/react/utils.tsx +113 -27
  130. package/lib/runtime/components/web/getInnerListeners.js +6 -6
  131. package/lib/runtime/components/web/mpx-movable-view.vue +334 -344
  132. package/lib/runtime/components/web/mpx-picker-view-column.vue +75 -75
  133. package/lib/runtime/components/web/mpx-picker.vue +382 -385
  134. package/lib/runtime/components/web/mpx-web-view.vue +175 -161
  135. package/lib/runtime/optionProcessor.js +7 -38
  136. package/lib/runtime/optionProcessorReact.js +0 -15
  137. package/lib/runtime/swanHelper.wxs +1 -1
  138. package/lib/runtime/utils.js +2 -0
  139. package/lib/style-compiler/index.js +1 -1
  140. package/lib/style-compiler/plugins/scope-id.js +31 -2
  141. package/lib/template-compiler/bind-this.js +7 -2
  142. package/lib/template-compiler/compiler.js +118 -56
  143. package/lib/template-compiler/gen-node-react.js +3 -3
  144. package/lib/template-compiler/index.js +4 -4
  145. package/lib/utils/pre-process-json.js +117 -0
  146. package/lib/web/index.js +5 -4
  147. package/lib/web/processJSON.js +5 -13
  148. package/lib/web/processTemplate.js +2 -2
  149. package/package.json +6 -4
  150. package/LICENSE +0 -433
  151. package/lib/runtime/components/react/dist/mpx-image/index.jsx +0 -226
  152. package/lib/runtime/components/react/dist/mpx-image/svg.jsx +0 -7
  153. package/lib/runtime/components/react/dist/mpx-swiper/carouse.jsx +0 -478
  154. package/lib/runtime/components/react/dist/mpx-swiper/index.jsx +0 -68
  155. package/lib/runtime/components/react/dist/mpx-swiper/type.js +0 -1
  156. package/lib/runtime/components/react/mpx-image/index.tsx +0 -346
  157. package/lib/runtime/components/react/mpx-image/svg.tsx +0 -22
  158. package/lib/runtime/components/web/event.js +0 -105
@@ -5,7 +5,7 @@
5
5
  * ✔ lower-threshold
6
6
  * ✔ scroll-top
7
7
  * ✔ scroll-left
8
- * scroll-into-view
8
+ * scroll-into-view
9
9
  * ✔ scroll-with-animation
10
10
  * ✔ enable-back-to-top
11
11
  * ✘ enable-passive
@@ -33,16 +33,18 @@
33
33
  */
34
34
  import { ScrollView } from 'react-native-gesture-handler';
35
35
  import { RefreshControl } from 'react-native';
36
- import { useRef, useState, useEffect, forwardRef, useContext } from 'react';
36
+ import { useRef, useState, useEffect, forwardRef, useContext, createElement } from 'react';
37
37
  import { useAnimatedRef } from 'react-native-reanimated';
38
38
  import { warn } from '@mpxjs/utils';
39
39
  import useInnerProps, { getCustomEvent } from './getInnerListeners';
40
40
  import useNodesRef from './useNodesRef';
41
- import { splitProps, splitStyle, useTransformStyle, useLayout, wrapChildren } from './utils';
41
+ import { splitProps, splitStyle, useTransformStyle, useLayout, wrapChildren, extendObject, flatGesture } from './utils';
42
42
  import { IntersectionObserverContext } from './context';
43
43
  const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
44
44
  const { textProps, innerProps: props = {} } = splitProps(scrollViewProps);
45
- const { enhanced = false, bounces = true, style = {}, '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, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
45
+ 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;
46
+ const simultaneousHandlers = flatGesture(originSimultaneousHandlers);
47
+ const waitForHandlers = flatGesture(waitFor);
46
48
  const [refreshing, setRefreshing] = useState(true);
47
49
  const snapScrollTop = useRef(0);
48
50
  const snapScrollLeft = useRef(0);
@@ -58,10 +60,12 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
58
60
  const hasCallScrollToLower = useRef(false);
59
61
  const initialTimeout = useRef(null);
60
62
  const intersectionObservers = useContext(IntersectionObserverContext);
63
+ const firstScrollIntoViewChange = useRef(false);
61
64
  const { normalStyle, hasVarDec, varContextRef, hasSelfPercent, setWidth, setHeight } = useTransformStyle(style, { enableVar, externalVarContext, parentFontSize, parentWidth, parentHeight });
62
- const { textStyle, innerStyle } = splitStyle(normalStyle);
65
+ const { textStyle, innerStyle = {} } = splitStyle(normalStyle);
63
66
  const scrollViewRef = useAnimatedRef();
64
67
  useNodesRef(props, ref, scrollViewRef, {
68
+ style: normalStyle,
65
69
  scrollOffset: scrollOptions,
66
70
  node: {
67
71
  scrollEnabled: scrollX || scrollY,
@@ -71,30 +75,48 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
71
75
  fastDeceleration: false,
72
76
  decelerationDisabled: false,
73
77
  scrollTo: scrollToOffset
74
- }
78
+ },
79
+ gestureRef: scrollViewRef
75
80
  });
76
81
  const { layoutRef, layoutStyle, layoutProps } = useLayout({ props, hasSelfPercent, setWidth, setHeight, nodeRef: scrollViewRef, onLayout });
77
82
  if (scrollX && scrollY) {
78
83
  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');
79
84
  }
80
85
  useEffect(() => {
81
- if (snapScrollTop.current !== props['scroll-top'] ||
82
- snapScrollLeft.current !== props['scroll-left']) {
83
- snapScrollTop.current = props['scroll-top'] || 0;
84
- snapScrollLeft.current = props['scroll-left'] || 0;
86
+ if (snapScrollTop.current !== scrollTop || snapScrollLeft.current !== scrollLeft) {
85
87
  initialTimeout.current = setTimeout(() => {
86
- scrollToOffset(snapScrollLeft.current, snapScrollTop.current);
88
+ scrollToOffset(scrollLeft, scrollTop);
87
89
  }, 0);
88
90
  return () => {
89
91
  initialTimeout.current && clearTimeout(initialTimeout.current);
90
92
  };
91
93
  }
92
- }, [props['scroll-top'], props['scroll-left']]);
94
+ }, [scrollTop, scrollLeft]);
95
+ useEffect(() => {
96
+ if (refreshing !== refresherTriggered) {
97
+ setRefreshing(!!refresherTriggered);
98
+ }
99
+ }, [refresherTriggered]);
93
100
  useEffect(() => {
94
- if (refreshing !== props['refresher-triggered']) {
95
- setRefreshing(!!props['refresher-triggered']);
101
+ if (scrollIntoView && __selectRef) {
102
+ if (!firstScrollIntoViewChange.current) {
103
+ setTimeout(handleScrollIntoView);
104
+ }
105
+ else {
106
+ handleScrollIntoView();
107
+ }
96
108
  }
97
- }, [props['refresher-triggered']]);
109
+ firstScrollIntoViewChange.current = true;
110
+ }, [scrollIntoView]);
111
+ function handleScrollIntoView() {
112
+ const refs = __selectRef(`#${scrollIntoView}`, 'node');
113
+ if (!refs)
114
+ return;
115
+ const { nodeRef } = refs.getNodeInstance();
116
+ nodeRef.current?.measureLayout(scrollViewRef.current, (left, top) => {
117
+ scrollToOffset(left, top);
118
+ });
119
+ }
98
120
  function selectLength(size) {
99
121
  return !scrollX ? size.height : size.width;
100
122
  }
@@ -149,14 +171,13 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
149
171
  const visibleLength = selectLength(e.nativeEvent.layoutMeasurement);
150
172
  const contentLength = selectLength(e.nativeEvent.contentSize);
151
173
  const offset = selectOffset(e.nativeEvent.contentOffset);
152
- scrollOptions.current = {
153
- ...scrollOptions.current,
174
+ extendObject(scrollOptions.current, {
154
175
  contentLength,
155
176
  offset,
156
177
  scrollLeft: position.scrollLeft,
157
178
  scrollTop: position.scrollTop,
158
179
  visibleLength
159
- };
180
+ });
160
181
  }
161
182
  function onScroll(e) {
162
183
  const { bindscroll } = props;
@@ -204,6 +225,8 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
204
225
  scrollViewRef.current.scrollTo({ x, y, animated: !!scrollWithAnimation });
205
226
  scrollOptions.current.scrollLeft = x;
206
227
  scrollOptions.current.scrollTop = y;
228
+ snapScrollLeft.current = x;
229
+ snapScrollTop.current = y;
207
230
  }
208
231
  }
209
232
  function onRefresh() {
@@ -212,7 +235,7 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
212
235
  bindrefresherrefresh(getCustomEvent('refresherrefresh', {}, { layoutRef }, props));
213
236
  }
214
237
  function onScrollTouchStart(e) {
215
- const { binddragstart, bindtouchstart, enhanced } = props;
238
+ const { bindtouchstart } = props;
216
239
  bindtouchstart && bindtouchstart(e);
217
240
  if (enhanced) {
218
241
  binddragstart &&
@@ -226,7 +249,6 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
226
249
  }
227
250
  }
228
251
  function onScrollTouchMove(e) {
229
- const { binddragging, bindtouchmove, enhanced } = props;
230
252
  bindtouchmove && bindtouchmove(e);
231
253
  if (enhanced) {
232
254
  binddragging &&
@@ -239,26 +261,25 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
239
261
  }, props));
240
262
  }
241
263
  }
242
- function onScrollEndDrag(e) {
243
- const { binddragend, enhanced } = props;
264
+ function onScrollTouchEnd(e) {
265
+ bindtouchend && bindtouchend(e);
244
266
  if (enhanced) {
245
- const { x: scrollLeft, y: scrollTop } = e.nativeEvent.contentOffset;
246
- const { width: scrollWidth, height: scrollHeight } = e.nativeEvent.contentSize;
247
267
  binddragend &&
248
268
  binddragend(getCustomEvent('dragend', e, {
249
269
  detail: {
250
- scrollLeft: scrollLeft,
251
- scrollTop: scrollTop,
252
- scrollHeight,
253
- scrollWidth
270
+ scrollLeft: scrollOptions.current.scrollLeft || 0,
271
+ scrollTop: scrollOptions.current.scrollTop || 0
254
272
  },
255
273
  layoutRef
256
274
  }, props));
257
- updateScrollOptions(e, { scrollLeft, scrollTop });
258
275
  }
259
276
  }
260
- let scrollAdditionalProps = {
261
- style: { ...innerStyle, ...layoutStyle },
277
+ function onScrollDrag(e) {
278
+ const { x: scrollLeft, y: scrollTop } = e.nativeEvent.contentOffset;
279
+ updateScrollOptions(e, { scrollLeft, scrollTop });
280
+ }
281
+ const scrollAdditionalProps = extendObject({
282
+ style: extendObject({}, innerStyle, layoutStyle),
262
283
  pinchGestureEnabled: false,
263
284
  horizontal: scrollX && !scrollY,
264
285
  scrollEventThrottle: scrollEventThrottle,
@@ -269,20 +290,21 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
269
290
  ref: scrollViewRef,
270
291
  onScroll: onScroll,
271
292
  onContentSizeChange: onContentSizeChange,
272
- bindtouchstart: onScrollTouchStart,
273
- bindtouchmove: onScrollTouchMove,
274
- onScrollEndDrag,
275
- onMomentumScrollEnd: onScrollEnd,
276
- ...layoutProps
277
- };
293
+ bindtouchstart: ((enhanced && binddragstart) || bindtouchstart) && onScrollTouchStart,
294
+ bindtouchmove: ((enhanced && binddragging) || bindtouchend) && onScrollTouchMove,
295
+ bindtouchend: ((enhanced && binddragend) || bindtouchend) && onScrollTouchEnd,
296
+ onScrollBeginDrag: onScrollDrag,
297
+ onScrollEndDrag: onScrollDrag,
298
+ onMomentumScrollEnd: onScrollEnd
299
+ }, (simultaneousHandlers ? { simultaneousHandlers } : {}), (waitForHandlers ? { waitFor: waitForHandlers } : {}), layoutProps);
278
300
  if (enhanced) {
279
- scrollAdditionalProps = {
280
- ...scrollAdditionalProps,
301
+ Object.assign(scrollAdditionalProps, {
281
302
  bounces,
282
303
  pagingEnabled
283
- };
304
+ });
284
305
  }
285
306
  const innerProps = useInnerProps(props, scrollAdditionalProps, [
307
+ 'id',
286
308
  'scroll-x',
287
309
  'scroll-y',
288
310
  'enable-back-to-top',
@@ -312,16 +334,20 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
312
334
  black: ['#000'],
313
335
  white: ['#fff']
314
336
  };
315
- return (<ScrollView {...innerProps} refreshControl={refresherEnabled
316
- ? (<RefreshControl progressBackgroundColor={refresherBackground} refreshing={refreshing} onRefresh={onRefresh} {...(refresherDefaultStyle && refresherDefaultStyle !== 'none' ? { colors: refreshColor[refresherDefaultStyle] } : {})}/>)
317
- : undefined}>
318
- {wrapChildren(props, {
319
- hasVarDec,
320
- varContext: varContextRef.current,
321
- textStyle,
322
- textProps
323
- })}
324
- </ScrollView>);
337
+ return createElement(ScrollView, extendObject({}, innerProps, {
338
+ refreshControl: refresherEnabled
339
+ ? createElement(RefreshControl, extendObject({
340
+ progressBackgroundColor: refresherBackground,
341
+ refreshing: refreshing,
342
+ onRefresh: onRefresh
343
+ }, (refresherDefaultStyle && refresherDefaultStyle !== 'none' ? { colors: refreshColor[refresherDefaultStyle] } : null)))
344
+ : undefined
345
+ }), wrapChildren(props, {
346
+ hasVarDec,
347
+ varContext: varContextRef.current,
348
+ textStyle,
349
+ textProps
350
+ }));
325
351
  });
326
- _ScrollView.displayName = 'mpx-scroll-view';
352
+ _ScrollView.displayName = 'MpxScrollView';
327
353
  export default _ScrollView;
@@ -0,0 +1,11 @@
1
+ import { Text } from 'react-native';
2
+ import { createElement } from 'react';
3
+ import { extendObject } from './utils';
4
+ const _Text2 = (props) => {
5
+ const { allowFontScaling = false } = props;
6
+ return createElement(Text, extendObject({}, props, {
7
+ allowFontScaling
8
+ }));
9
+ };
10
+ _Text2.displayName = 'MpxSimpleText';
11
+ export default _Text2;
@@ -4,12 +4,14 @@ import useInnerProps from './getInnerListeners';
4
4
  import useNodesRef from './useNodesRef'; // 引入辅助函数
5
5
  import { useTransformStyle, splitStyle, splitProps, wrapChildren, useLayout } from './utils';
6
6
  const _SwiperItem = forwardRef((props, ref) => {
7
- const { 'enable-offset': enableOffset, 'enable-var': enableVar, 'external-var-context': externalVarContext, style } = props;
7
+ const { 'enable-var': enableVar, 'external-var-context': externalVarContext, style } = props;
8
8
  const { textProps } = splitProps(props);
9
9
  const nodeRef = useRef(null);
10
- useNodesRef(props, ref, nodeRef, {});
11
10
  const { normalStyle, hasVarDec, varContextRef, hasSelfPercent, setWidth, setHeight } = useTransformStyle(style, { enableVar, externalVarContext });
12
11
  const { textStyle, innerStyle } = splitStyle(normalStyle);
12
+ useNodesRef(props, ref, nodeRef, {
13
+ style: normalStyle
14
+ });
13
15
  const {
14
16
  // 存储layout布局信息
15
17
  layoutRef, layoutProps, layoutStyle } = useLayout({ props, hasSelfPercent, setWidth, setHeight, nodeRef: nodeRef });
@@ -30,5 +32,5 @@ const _SwiperItem = forwardRef((props, ref) => {
30
32
  })}
31
33
  </View>);
32
34
  });
33
- _SwiperItem.displayName = 'mpx-swiper-item';
35
+ _SwiperItem.displayName = 'MpxSwiperItem';
34
36
  export default _SwiperItem;