@mpxjs/webpack-plugin 2.10.17-beta.3 → 2.10.17-beta.6

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 (228) hide show
  1. package/lib/config.js +60 -0
  2. package/lib/file-loader.js +4 -1
  3. package/lib/global.d.ts +245 -0
  4. package/lib/index.js +29 -2
  5. package/lib/json-compiler/index.js +13 -4
  6. package/lib/loader.js +4 -0
  7. package/lib/platform/json/wx/index.js +6 -0
  8. package/lib/platform/style/wx/index.js +57 -33
  9. package/lib/platform/template/wx/component-config/ad.js +5 -0
  10. package/lib/platform/template/wx/component-config/button.js +10 -3
  11. package/lib/platform/template/wx/component-config/camera.js +25 -3
  12. package/lib/platform/template/wx/component-config/canvas.js +8 -1
  13. package/lib/platform/template/wx/component-config/cover-image.js +7 -2
  14. package/lib/platform/template/wx/component-config/cover-view.js +3 -1
  15. package/lib/platform/template/wx/component-config/form.js +27 -2
  16. package/lib/platform/template/wx/component-config/image.js +5 -0
  17. package/lib/platform/template/wx/component-config/input.js +11 -1
  18. package/lib/platform/template/wx/component-config/label.js +10 -2
  19. package/lib/platform/template/wx/component-config/map.js +11 -0
  20. package/lib/platform/template/wx/component-config/movable-area.js +4 -1
  21. package/lib/platform/template/wx/component-config/movable-view.js +17 -2
  22. package/lib/platform/template/wx/component-config/navigator.js +26 -0
  23. package/lib/platform/template/wx/component-config/picker-view.js +12 -0
  24. package/lib/platform/template/wx/component-config/picker.js +3 -1
  25. package/lib/platform/template/wx/component-config/progress.js +11 -1
  26. package/lib/platform/template/wx/component-config/rich-text.js +5 -0
  27. package/lib/platform/template/wx/component-config/scroll-view.js +12 -1
  28. package/lib/platform/template/wx/component-config/slider.js +8 -0
  29. package/lib/platform/template/wx/component-config/swiper-item.js +5 -2
  30. package/lib/platform/template/wx/component-config/swiper.js +10 -0
  31. package/lib/platform/template/wx/component-config/text.js +5 -0
  32. package/lib/platform/template/wx/component-config/textarea.js +20 -3
  33. package/lib/platform/template/wx/component-config/unsupported.js +10 -1
  34. package/lib/platform/template/wx/component-config/video.js +10 -0
  35. package/lib/platform/template/wx/index.js +21 -1
  36. package/lib/react/LoadAsyncChunkModule.js +1 -1
  37. package/lib/react/processStyles.js +21 -9
  38. package/lib/react/style-helper.js +76 -13
  39. package/lib/resolver/AddModePlugin.js +23 -8
  40. package/lib/runtime/components/react/animationHooks/index.ts +75 -0
  41. package/lib/runtime/components/react/animationHooks/useAnimationAPIHooks.ts +198 -0
  42. package/lib/runtime/components/react/animationHooks/useTransitionHooks.ts +297 -0
  43. package/lib/runtime/components/react/animationHooks/utils.ts +196 -0
  44. package/lib/runtime/components/react/context.ts +7 -1
  45. package/lib/runtime/components/react/dist/animationHooks/index.d.ts +15 -0
  46. package/lib/runtime/components/react/dist/animationHooks/index.js +67 -0
  47. package/lib/runtime/components/react/dist/animationHooks/useAnimationAPIHooks.d.ts +3 -0
  48. package/lib/runtime/components/react/dist/animationHooks/useAnimationAPIHooks.js +182 -0
  49. package/lib/runtime/components/react/dist/animationHooks/useTransitionHooks.d.ts +3 -0
  50. package/lib/runtime/components/react/dist/animationHooks/useTransitionHooks.js +274 -0
  51. package/lib/runtime/components/react/dist/animationHooks/utils.d.ts +109 -0
  52. package/lib/runtime/components/react/dist/animationHooks/utils.js +150 -0
  53. package/lib/runtime/components/react/dist/context.d.ts +6 -2
  54. package/lib/runtime/components/react/dist/event.config.d.ts +0 -1
  55. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +0 -1
  56. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +0 -1
  57. package/lib/runtime/components/react/dist/mpx-button.d.ts +0 -1
  58. package/lib/runtime/components/react/dist/mpx-camera.d.ts +31 -0
  59. package/lib/runtime/components/react/dist/mpx-camera.jsx +236 -0
  60. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +0 -1
  61. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +0 -1
  62. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +0 -1
  63. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +0 -1
  64. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +0 -1
  65. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +0 -1
  66. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +0 -1
  67. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -1
  68. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +0 -1
  69. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -1
  70. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +0 -1
  71. package/lib/runtime/components/react/dist/mpx-form.d.ts +0 -1
  72. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -1
  73. package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -1
  74. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +0 -1
  75. package/lib/runtime/components/react/dist/mpx-input.d.ts +2 -1
  76. package/lib/runtime/components/react/dist/mpx-input.jsx +10 -9
  77. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +0 -1
  78. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +7 -2
  79. package/lib/runtime/components/react/dist/mpx-label.d.ts +0 -1
  80. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -1
  81. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +0 -1
  82. package/lib/runtime/components/react/dist/mpx-nav.d.ts +0 -1
  83. package/lib/runtime/components/react/dist/mpx-navigator.d.ts +0 -1
  84. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +0 -1
  85. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +0 -1
  86. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +0 -1
  87. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +0 -1
  88. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +0 -1
  89. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +0 -1
  90. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +0 -1
  91. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +0 -1
  92. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +0 -1
  93. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +0 -1
  94. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +0 -1
  95. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +0 -1
  96. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +0 -1
  97. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +0 -1
  98. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +0 -1
  99. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +0 -1
  100. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +0 -1
  101. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +0 -1
  102. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +0 -1
  103. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +0 -1
  104. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +0 -1
  105. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +0 -1
  106. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.jsx +2 -2
  107. package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -1
  108. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -1
  109. package/lib/runtime/components/react/dist/mpx-radio.d.ts +0 -1
  110. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +0 -1
  111. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -1
  112. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +0 -1
  113. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +0 -1
  114. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +0 -1
  115. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +0 -1
  116. package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -1
  117. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +0 -1
  118. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +0 -1
  119. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +0 -1
  120. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +11 -1
  121. package/lib/runtime/components/react/dist/mpx-swiper.jsx +71 -39
  122. package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -1
  123. package/lib/runtime/components/react/dist/mpx-text.d.ts +0 -1
  124. package/lib/runtime/components/react/dist/mpx-textarea.d.ts +0 -1
  125. package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -1
  126. package/lib/runtime/components/react/dist/mpx-view.d.ts +3 -3
  127. package/lib/runtime/components/react/dist/mpx-view.jsx +22 -8
  128. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +0 -1
  129. package/lib/runtime/components/react/dist/mpx-web-view.jsx +1 -1
  130. package/lib/runtime/components/react/dist/parser.d.ts +0 -1
  131. package/lib/runtime/components/react/dist/useNodesRef.d.ts +0 -1
  132. package/lib/runtime/components/react/dist/utils.d.ts +1 -1
  133. package/lib/runtime/components/react/dist/utils.jsx +34 -13
  134. package/lib/runtime/components/react/mpx-camera.tsx +327 -0
  135. package/lib/runtime/components/react/mpx-input.tsx +15 -9
  136. package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +7 -2
  137. package/lib/runtime/components/react/mpx-portal/portal-manager.tsx +2 -2
  138. package/lib/runtime/components/react/mpx-swiper.tsx +86 -37
  139. package/lib/runtime/components/react/mpx-view.tsx +27 -12
  140. package/lib/runtime/components/react/mpx-web-view.tsx +1 -1
  141. package/lib/runtime/components/react/tsconfig.json +26 -0
  142. package/lib/runtime/components/react/types/global.d.ts +1 -0
  143. package/lib/runtime/components/react/utils.tsx +34 -16
  144. package/lib/runtime/optionProcessor.js +5 -0
  145. package/lib/runtime/optionProcessorReact.js +7 -0
  146. package/lib/runtime/stringify.wxs +2 -2
  147. package/lib/style-compiler/strip-conditional-loader/rebaseUrl.js +225 -0
  148. package/lib/style-compiler/strip-conditional-loader.js +76 -185
  149. package/lib/template-compiler/compiler.js +1 -3
  150. package/lib/utils/dom-tag-config.js +1 -1
  151. package/lib/utils/string.js +25 -1
  152. package/package.json +6 -4
  153. package/lib/runtime/components/react/dist/context.d.ts.map +0 -1
  154. package/lib/runtime/components/react/dist/event.config.d.ts.map +0 -1
  155. package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +0 -1
  156. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +0 -1
  157. package/lib/runtime/components/react/dist/mpx-button.d.ts.map +0 -1
  158. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +0 -1
  159. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +0 -1
  160. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +0 -1
  161. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +0 -1
  162. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +0 -1
  163. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +0 -1
  164. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +0 -1
  165. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +0 -1
  166. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +0 -1
  167. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +0 -1
  168. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +0 -1
  169. package/lib/runtime/components/react/dist/mpx-form.d.ts.map +0 -1
  170. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +0 -1
  171. package/lib/runtime/components/react/dist/mpx-image.d.ts.map +0 -1
  172. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +0 -1
  173. package/lib/runtime/components/react/dist/mpx-input.d.ts.map +0 -1
  174. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +0 -1
  175. package/lib/runtime/components/react/dist/mpx-label.d.ts.map +0 -1
  176. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +0 -1
  177. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +0 -1
  178. package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +0 -1
  179. package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +0 -1
  180. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +0 -1
  181. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +0 -1
  182. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +0 -1
  183. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +0 -1
  184. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +0 -1
  185. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +0 -1
  186. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +0 -1
  187. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +0 -1
  188. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +0 -1
  189. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +0 -1
  190. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +0 -1
  191. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +0 -1
  192. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +0 -1
  193. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +0 -1
  194. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +0 -1
  195. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +0 -1
  196. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +0 -1
  197. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +0 -1
  198. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +0 -1
  199. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +0 -1
  200. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +0 -1
  201. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +0 -1
  202. package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +0 -1
  203. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +0 -1
  204. package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +0 -1
  205. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +0 -1
  206. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +0 -1
  207. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +0 -1
  208. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +0 -1
  209. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +0 -1
  210. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +0 -1
  211. package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +0 -1
  212. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +0 -1
  213. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +0 -1
  214. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +0 -1
  215. package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +0 -1
  216. package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +0 -1
  217. package/lib/runtime/components/react/dist/mpx-text.d.ts.map +0 -1
  218. package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +0 -1
  219. package/lib/runtime/components/react/dist/mpx-video.d.ts.map +0 -1
  220. package/lib/runtime/components/react/dist/mpx-view.d.ts.map +0 -1
  221. package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +0 -1
  222. package/lib/runtime/components/react/dist/parser.d.ts.map +0 -1
  223. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +0 -33
  224. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +0 -1
  225. package/lib/runtime/components/react/dist/useAnimationHooks.js +0 -289
  226. package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +0 -1
  227. package/lib/runtime/components/react/dist/utils.d.ts.map +0 -1
  228. package/lib/runtime/components/react/useAnimationHooks.ts +0 -320
@@ -13,23 +13,23 @@ import Portal from './mpx-portal';
13
13
  const styles = {
14
14
  pagination_x: {
15
15
  position: 'absolute',
16
- bottom: 25,
16
+ bottom: 0,
17
17
  left: 0,
18
18
  right: 0,
19
19
  flexDirection: 'row',
20
20
  flex: 1,
21
21
  justifyContent: 'center',
22
- alignItems: 'center'
22
+ alignItems: 'flex-end'
23
23
  },
24
24
  pagination_y: {
25
25
  position: 'absolute',
26
- right: 15,
26
+ right: 0,
27
27
  top: 0,
28
28
  bottom: 0,
29
29
  flexDirection: 'column',
30
30
  flex: 1,
31
31
  justifyContent: 'center',
32
- alignItems: 'center'
32
+ alignItems: 'flex-end'
33
33
  },
34
34
  pagerWrapperx: {
35
35
  position: 'absolute',
@@ -49,16 +49,6 @@ const styles = {
49
49
  justifyContent: 'flex-start'
50
50
  }
51
51
  };
52
- const dotCommonStyle = {
53
- width: 8,
54
- height: 8,
55
- borderRadius: 4,
56
- marginLeft: 3,
57
- marginRight: 3,
58
- marginTop: 3,
59
- marginBottom: 3,
60
- zIndex: 98
61
- };
62
52
  const activeDotStyle = {
63
53
  zIndex: 99
64
54
  };
@@ -71,7 +61,18 @@ const easeMap = {
71
61
  easeInOutCubic: Easing.inOut(Easing.cubic)
72
62
  };
73
63
  const SwiperWrapper = forwardRef((props, ref) => {
74
- const { 'indicator-dots': showPagination, 'indicator-color': dotColor = 'rgba(0, 0, 0, .3)', 'indicator-active-color': activeDotColor = '#000000', 'enable-var': enableVar = false, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'external-var-context': externalVarContext, 'simultaneous-handlers': originSimultaneousHandlers = [], 'wait-for': waitFor = [], style = {}, autoplay = false, circular = false, disableGesture = false, current: propCurrent = 0, bindchange } = props;
64
+ const { 'indicator-dots': showPagination, 'indicator-color': dotColor = 'rgba(0, 0, 0, .3)', 'indicator-width': dotWidth = 8, 'indicator-height': dotHeight = 8, 'indicator-radius': dotRadius = 4, 'indicator-spacing': dotSpacing = 4, 'indicator-margin': paginationMargin = 10, 'indicator-active-color': activeDotColor = '#000000', 'enable-var': enableVar = false, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'external-var-context': externalVarContext, 'simultaneous-handlers': originSimultaneousHandlers = [], 'wait-for': waitFor = [], style = {}, autoplay = false, circular = false, disableGesture = false, current: propCurrent = 0, bindchange } = props;
65
+ const dotCommonStyle = {
66
+ width: dotWidth,
67
+ height: dotHeight,
68
+ borderRadius: dotRadius,
69
+ marginLeft: dotSpacing,
70
+ marginRight: dotSpacing,
71
+ marginTop: dotSpacing,
72
+ marginBottom: dotSpacing,
73
+ zIndex: 98
74
+ };
75
+ const displayMultipleItems = props['display-multiple-items'] || 1;
75
76
  const easeingFunc = props['easing-function'] || 'default';
76
77
  const easeDuration = props.duration || 500;
77
78
  const horizontal = props.vertical !== undefined ? !props.vertical : true;
@@ -97,18 +98,19 @@ const SwiperWrapper = forwardRef((props, ref) => {
97
98
  const preMarginShared = useSharedValue(preMargin);
98
99
  const nextMarginShared = useSharedValue(nextMargin);
99
100
  const autoplayShared = useSharedValue(autoplay);
101
+ const children = Array.isArray(props.children) ? props.children.filter(child => child) : (props.children ? [props.children] : []);
100
102
  // 默认前后补位的元素个数
101
- const patchElmNum = circular ? (preMargin ? 2 : 1) : 0;
103
+ const patchElmNum = (circular && children.length > 1) ? displayMultipleItems + 1 : 0;
102
104
  const patchElmNumShared = useSharedValue(patchElmNum);
105
+ const displayMultipleItemsShared = useSharedValue(displayMultipleItems);
103
106
  const circularShared = useSharedValue(circular);
104
- const children = Array.isArray(props.children) ? props.children.filter(child => child) : (props.children ? [props.children] : []);
105
107
  // 对有变化的变量,在worklet中只能使用sharedValue变量,useRef不能更新
106
108
  const childrenLength = useSharedValue(children.length);
107
109
  const initWidth = typeof normalStyle?.width === 'number' ? normalStyle.width - preMargin - nextMargin : normalStyle.width;
108
110
  const initHeight = typeof normalStyle?.height === 'number' ? normalStyle.height - preMargin - nextMargin : normalStyle.height;
109
111
  const dir = horizontal === false ? 'y' : 'x';
110
112
  const pstep = dir === 'x' ? initWidth : initHeight;
111
- const initStep = isNaN(pstep) ? 0 : pstep;
113
+ const initStep = isNaN(pstep) ? 0 : pstep / displayMultipleItems;
112
114
  // 每个元素的宽度 or 高度,有固定值直接初始化无则0
113
115
  const step = useSharedValue(initStep);
114
116
  // 记录选中元素的索引值
@@ -152,6 +154,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
152
154
  'style',
153
155
  'indicator-dots',
154
156
  'indicator-color',
157
+ 'indicator-width',
155
158
  'indicator-active-color',
156
159
  'previous-margin',
157
160
  'vertical',
@@ -167,7 +170,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
167
170
  const { width, height } = e.nativeEvent.layout;
168
171
  const realWidth = dir === 'x' ? width - preMargin - nextMargin : width;
169
172
  const realHeight = dir === 'y' ? height - preMargin - nextMargin : height;
170
- const iStep = dir === 'x' ? realWidth : realHeight;
173
+ const iStep = (dir === 'x' ? realWidth : realHeight) / displayMultipleItems;
171
174
  if (iStep !== step.value) {
172
175
  step.value = iStep;
173
176
  updateCurrent(propCurrent, iStep);
@@ -193,7 +196,17 @@ const SwiperWrapper = forwardRef((props, ref) => {
193
196
  for (let i = 0; i < children.length; i++) {
194
197
  dots.push(<View style={[dotCommonStyle, { backgroundColor: unActionColor }]} key={i}></View>);
195
198
  }
196
- return (<View pointerEvents="none" style={styles['pagination_' + dir]}>
199
+ let paginationStyle = styles['pagination_' + dir];
200
+ if (paginationMargin) {
201
+ paginationStyle = {
202
+ ...paginationStyle,
203
+ marginBottom: paginationMargin,
204
+ marginLeft: paginationMargin,
205
+ marginRight: paginationMargin,
206
+ marginTop: paginationMargin
207
+ };
208
+ }
209
+ return (<View pointerEvents="none" style={paginationStyle} key="pagination">
197
210
  <View style={[styles['pagerWrapper' + dir]]}>
198
211
  <Animated.View style={[
199
212
  dotCommonStyle,
@@ -213,19 +226,35 @@ const SwiperWrapper = forwardRef((props, ref) => {
213
226
  function renderItems() {
214
227
  const intLen = children.length;
215
228
  let renderChild = children.slice();
229
+ // if (circular && intLen > 1) {
230
+ // // 最前面加最后一个元素
231
+ // const lastChild = React.cloneElement(children[intLen - 1] as ReactElement, { key: 'clone0' })
232
+ // // 最后面加第一个元素
233
+ // const firstChild = React.cloneElement(children[0] as ReactElement, { key: 'clone1' })
234
+ // if (preMargin) {
235
+ // const lastChild1 = React.cloneElement(children[intLen - 2] as ReactElement, { key: 'clone2' })
236
+ // const firstChild1 = React.cloneElement(children[1] as ReactElement, { key: 'clone3' })
237
+ // renderChild = [lastChild1, lastChild].concat(renderChild).concat([firstChild, firstChild1])
238
+ // } else {
239
+ // renderChild = [lastChild].concat(renderChild).concat([firstChild])
240
+ // }
241
+ // }
216
242
  if (circular && intLen > 1) {
217
- // 最前面加最后一个元素
218
- const lastChild = React.cloneElement(children[intLen - 1], { key: 'clone0' });
219
- // 最后面加第一个元素
220
- const firstChild = React.cloneElement(children[0], { key: 'clone1' });
221
- if (preMargin) {
222
- const lastChild1 = React.cloneElement(children[intLen - 2], { key: 'clone2' });
223
- const firstChild1 = React.cloneElement(children[1], { key: 'clone3' });
224
- renderChild = [lastChild1, lastChild].concat(renderChild).concat([firstChild, firstChild1]);
225
- }
226
- else {
227
- renderChild = [lastChild].concat(renderChild).concat([firstChild]);
228
- }
243
+ // 动态生成前置补位元素
244
+ const frontClones = [];
245
+ // 计算补位序列的起始索引。例如 len=3, patch=2 -> start=1 (即从B开始)
246
+ const startIndex = intLen - (patchElmNum % intLen);
247
+ for (let i = 0; i < patchElmNum; i++) {
248
+ const sourceIndex = (startIndex + i) % intLen;
249
+ frontClones.push(React.cloneElement(children[sourceIndex], { key: `clone_front_${i}` }));
250
+ }
251
+ // 动态生成后置补位元素
252
+ const backClones = [];
253
+ for (let i = 0; i < patchElmNum; i++) {
254
+ const sourceIndex = i % intLen;
255
+ backClones.push(React.cloneElement(children[sourceIndex], { key: `clone_back_${i}` }));
256
+ }
257
+ renderChild = [...frontClones, ...renderChild, ...backClones];
229
258
  }
230
259
  const arrChildren = renderChild.map((child, index) => {
231
260
  const extraStyle = {};
@@ -260,7 +289,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
260
289
  let nextIndex = currentIndex.value;
261
290
  if (!circularShared.value) {
262
291
  // 获取下一个位置的坐标, 循环到最后一个元素,直接停止, 取消定时器
263
- if (currentIndex.value === childrenLength.value - 1) {
292
+ if (currentIndex.value === childrenLength.value - displayMultipleItemsShared.value) {
264
293
  pauseLoop();
265
294
  return;
266
295
  }
@@ -427,12 +456,13 @@ const SwiperWrapper = forwardRef((props, ref) => {
427
456
  };
428
457
  }, [autoplay]);
429
458
  useEffect(() => {
430
- if (circular !== circularShared.value) {
459
+ if (circular !== circularShared.value || patchElmNum !== patchElmNumShared.value || displayMultipleItems !== displayMultipleItemsShared.value) {
431
460
  circularShared.value = circular;
432
- patchElmNumShared.value = circular ? (preMargin ? 2 : 1) : 0;
461
+ patchElmNumShared.value = patchElmNum;
462
+ displayMultipleItemsShared.value = displayMultipleItems;
433
463
  offset.value = getOffset(currentIndex.value, step.value);
434
464
  }
435
- }, [circular, preMargin]);
465
+ }, [circular, patchElmNum, displayMultipleItems]);
436
466
  const { gestureHandler } = useMemo(() => {
437
467
  function getTargetPosition(eventData) {
438
468
  'worklet';
@@ -450,7 +480,8 @@ const SwiperWrapper = forwardRef((props, ref) => {
450
480
  const moveToIndex = transdir < 0 ? Math.ceil(computedIndex) : Math.floor(computedIndex);
451
481
  // 实际应该定位的索引值
452
482
  if (!circularShared.value) {
453
- selectedIndex = moveToIndex;
483
+ const maxIndex = Math.max(0, childrenLength.value - displayMultipleItemsShared.value);
484
+ selectedIndex = Math.min(Math.max(moveToIndex, 0), maxIndex);
454
485
  moveToTargetPos = selectedIndex * step.value;
455
486
  }
456
487
  else {
@@ -486,7 +517,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
486
517
  const gestureMovePos = offset.value + translation;
487
518
  if (!circularShared.value) {
488
519
  // 如果只判断区间,中间非滑动状态(handleResistanceMove)向左滑动,突然改为向右滑动,但是还在非滑动态,本应该可滑动判断为了不可滑动
489
- const posEnd = -step.value * (childrenLength.value - 1);
520
+ const posEnd = -step.value * (childrenLength.value - displayMultipleItemsShared.value);
490
521
  if (transdir < 0) {
491
522
  return gestureMovePos > posEnd;
492
523
  }
@@ -616,7 +647,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
616
647
  const { translation, transdir } = eventData;
617
648
  const moveToOffset = offset.value + translation;
618
649
  const maxOverDrag = Math.floor(step.value / 2);
619
- const maxOffset = translation < 0 ? -(childrenLength.value - 1) * step.value : 0;
650
+ const maxOffset = translation < 0 ? -(childrenLength.value - displayMultipleItemsShared.value) * step.value : 0;
620
651
  let resistance = 0.1;
621
652
  let overDrag = 0;
622
653
  let finalOffset = 0;
@@ -770,6 +801,7 @@ const SwiperWrapper = forwardRef((props, ref) => {
770
801
  style: [normalStyle, layoutStyle, styles.swiper]
771
802
  }, layoutProps, innerProps);
772
803
  const animateComponent = createElement(Animated.View, {
804
+ key: 'swiperContainer',
773
805
  style: [{ flexDirection: dir === 'x' ? 'row' : 'column', width: '100%', height: '100%' }, animatedStyles]
774
806
  }, wrapChildren({
775
807
  children: arrPages
@@ -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
@@ -20,4 +20,3 @@ interface _TextProps extends TextProps {
20
20
  }
21
21
  declare const _Text: import("react").ForwardRefExoticComponent<_TextProps & import("react").RefAttributes<HandlerRef<Text, _TextProps>>>;
22
22
  export default _Text;
23
- //# sourceMappingURL=mpx-text.d.ts.map
@@ -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
@@ -6,7 +6,8 @@
6
6
  */
7
7
  import { View, NativeSyntheticEvent, ViewProps } from 'react-native';
8
8
  import { ReactNode } from 'react';
9
- import type { AnimationProp } from './useAnimationHooks';
9
+ import { AnimationType } from './animationHooks/index';
10
+ import type { AnimationProp } from './animationHooks/utils';
10
11
  import { ExtendedViewStyle } from './types/common';
11
12
  import { HandlerRef } from './useNodesRef';
12
13
  export interface _ViewProps extends ViewProps {
@@ -23,7 +24,7 @@ export interface _ViewProps extends ViewProps {
23
24
  'parent-font-size'?: number;
24
25
  'parent-width'?: number;
25
26
  'parent-height'?: number;
26
- 'enable-animation'?: boolean;
27
+ 'enable-animation'?: boolean | AnimationType;
27
28
  bindtouchstart?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
28
29
  bindtouchmove?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
29
30
  bindtouchend?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
@@ -32,4 +33,3 @@ export interface _ViewProps extends ViewProps {
32
33
  }
33
34
  declare const _View: import("react").ForwardRefExoticComponent<_ViewProps & import("react").RefAttributes<HandlerRef<View, _ViewProps>>>;
34
35
  export default _View;
35
- //# sourceMappingURL=mpx-view.d.ts.map
@@ -8,7 +8,7 @@ import { View, StyleSheet, Image } from 'react-native';
8
8
  import { useRef, useState, useEffect, forwardRef, createElement } from 'react';
9
9
  import useInnerProps from './getInnerListeners';
10
10
  import Animated from 'react-native-reanimated';
11
- import useAnimationHooks from './useAnimationHooks';
11
+ import useAnimationHooks from './animationHooks/index';
12
12
  import useNodesRef from './useNodesRef';
13
13
  import { parseUrl, PERCENT_REGEX, splitStyle, splitProps, useTransformStyle, wrapChildren, useLayout, renderImage, pickStyle, extendObject, useHover } from './utils';
14
14
  import { error, isFunction } from '@mpxjs/utils';
@@ -203,7 +203,7 @@ function backgroundSize(imageProps, preImageInfo, imageSize, layoutInfo) {
203
203
  else { // 数值类型 ImageStyle
204
204
  // 数值类型设置为 stretch
205
205
  imageProps.resizeMode = 'stretch';
206
- if (type === 'linear' && (!layoutWidth || !layoutHeight)) {
206
+ if (type === 'linear' && (!layoutWidth || !layoutHeight) && (isPercent(width) || isPercent(height))) {
207
207
  // ios 上 linear 组件只要重新触发渲染,在渲染过程中外层容器 width 或者 height 被设置为 0,通过设置 % 的方式会渲染不出来,即使后面再更新为正常宽高也渲染不出来
208
208
  // 所以 hack 手动先将 linear 宽高也设置为 0,后面再更新为正确的数值或 %。
209
209
  dimensions = {
@@ -274,6 +274,18 @@ function normalizeBackgroundPosition(parts) {
274
274
  let hOffset = 0;
275
275
  let vStart = 'top';
276
276
  let vOffset = 0;
277
+ if (!Array.isArray(parts)) {
278
+ // 模板 style 属性传入单个数值时不会和 class 一样转成数组,需要手动转换
279
+ parts = [parts];
280
+ }
281
+ // 模板 style 属性传入时, 需要额外转换处理单位 px/rpx/vh 以及 center 转化为 50%
282
+ parts = parts.map((part) => {
283
+ if (typeof part !== 'string')
284
+ return part;
285
+ if (part === 'center')
286
+ return '50%';
287
+ return global.__formatValue(part);
288
+ });
277
289
  if (parts.length === 4)
278
290
  return parts;
279
291
  // 归一化
@@ -415,14 +427,16 @@ function normalizeBackgroundSize(backgroundSize, type) {
415
427
  const sizeList = backgroundSize.slice();
416
428
  if (sizeList.length === 1)
417
429
  sizeList.push('auto');
418
- if (type === 'linear') {
430
+ return sizeList.map((val) => {
431
+ if (typeof val !== 'string')
432
+ return val;
419
433
  // 处理当使用渐变的时候,background-size出现cover, contain, auto,当作100%处理
420
- for (const i in sizeList) {
421
- const val = sizeList[i];
422
- sizeList[i] = /^cover|contain|auto$/.test(val) ? '100%' : val;
434
+ if (type === 'linear' && /^cover|contain|auto$/.test(val)) {
435
+ val = '100%';
423
436
  }
424
- }
425
- return sizeList;
437
+ // 模板 style 属性传入时, 需要额外转换处理单位 px/rpx/vh
438
+ return global.__formatValue(val);
439
+ });
426
440
  }
427
441
  function preParseImage(imageStyle) {
428
442
  const { backgroundImage = '', backgroundSize = ['auto'], backgroundPosition = [0, 0] } = normalizeStyle(imageStyle) || {};
@@ -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
@@ -184,7 +184,7 @@ const _WebView = forwardRef((props, ref) => {
184
184
  }
185
185
  break;
186
186
  case 'postMessage':
187
- bindmessage && bindmessage(getCustomEvent('messsage', {}, {
187
+ bindmessage && bindmessage(getCustomEvent('message', {}, {
188
188
  detail: {
189
189
  data: params[0]?.data
190
190
  }
@@ -37,4 +37,3 @@ export declare class ReplaceSource {
37
37
  source(): string;
38
38
  }
39
39
  export {};
40
- //# sourceMappingURL=parser.d.ts.map
@@ -9,4 +9,3 @@ export type HandlerRef<T, P> = {
9
9
  };
10
10
  export default function useNodesRef<T, P>(props: P, ref: ForwardedRef<HandlerRef<T, P>>, nodeRef: RefObject<T>, instance?: Obj): void;
11
11
  export {};
12
- //# sourceMappingURL=useNodesRef.d.ts.map
@@ -32,6 +32,7 @@ export declare function splitStyle<T extends Record<string, any>>(styleObj: T):
32
32
  backgroundStyle?: Partial<T>;
33
33
  innerStyle?: Partial<T>;
34
34
  };
35
+ export declare function parseValues(str: string, char?: string): string[];
35
36
  interface TransformStyleConfig {
36
37
  enableVar?: boolean;
37
38
  externalVarContext?: Record<string, any>;
@@ -120,4 +121,3 @@ export declare function useHover({ enableHover, hoverStartTime, hoverStayTime, d
120
121
  };
121
122
  export declare function useRunOnJSCallback(callbackMapRef: MutableRefObject<Record<string, AnyFunc>>): (key: string, ...args: any) => any;
122
123
  export {};
123
- //# sourceMappingURL=utils.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useCallback, useMemo, useRef, isValidElement, useContext, useState, Children, cloneElement, createElement } from 'react';
2
2
  import { Image } from 'react-native';
3
- import { isObject, isFunction, isNumber, hasOwn, diffAndCloneA, error, warn } from '@mpxjs/utils';
3
+ import { isObject, isFunction, isNumber, hasOwn, diffAndCloneA, error, warn, isEmptyObject } from '@mpxjs/utils';
4
4
  import { VarContext, ScrollViewContext, RouteContext } from './context';
5
5
  import { ExpressionParser, parseFunc, ReplaceSource } from './parser';
6
6
  import { initialWindowMetrics } from 'react-native-safe-area-context';
@@ -193,7 +193,7 @@ function transformVar(styleObj, varKeyPaths, varContext, visitOther) {
193
193
  const resolved = resolveVar(value, varContext);
194
194
  if (resolved === undefined) {
195
195
  delete target[key];
196
- error(`Can not resolve css var at ${varKeyPath.join('.')}:${value}.`);
196
+ // error(`Can not resolve css var at ${varKeyPath.join('.')}:${value}.`)
197
197
  return;
198
198
  }
199
199
  target[key] = resolved;
@@ -241,6 +241,10 @@ function transformStringify(styleObj) {
241
241
  if (isNumber(styleObj.fontWeight)) {
242
242
  styleObj.fontWeight = '' + styleObj.fontWeight;
243
243
  }
244
+ // transformOrigin 20px 需要转换为 transformOrigin '20'
245
+ if (isNumber(styleObj.transformOrigin)) {
246
+ styleObj.transformOrigin = '' + styleObj.transformOrigin;
247
+ }
244
248
  }
245
249
  function transformPosition(styleObj, meta) {
246
250
  if (styleObj.position === 'fixed') {
@@ -249,7 +253,7 @@ function transformPosition(styleObj, meta) {
249
253
  }
250
254
  }
251
255
  // 多value解析
252
- function parseValues(str, char = ' ') {
256
+ export function parseValues(str, char = ' ') {
253
257
  let stack = 0;
254
258
  let temp = '';
255
259
  const result = [];
@@ -261,11 +265,11 @@ function parseValues(str, char = ' ') {
261
265
  stack--;
262
266
  }
263
267
  // 非括号内 或者 非分隔字符且非空
264
- if (stack !== 0 || (str[i] !== char && str[i] !== ' ')) {
268
+ if (stack !== 0 || str[i] !== char) {
265
269
  temp += str[i];
266
270
  }
267
271
  if ((stack === 0 && str[i] === char) || i === str.length - 1) {
268
- result.push(temp);
272
+ result.push(temp.trim());
269
273
  temp = '';
270
274
  }
271
275
  }
@@ -274,6 +278,8 @@ function parseValues(str, char = ' ') {
274
278
  // parse string transform, eg: transform: 'rotateX(45deg) rotateZ(0.785398rad)'
275
279
  function parseTransform(transformStr) {
276
280
  const values = parseValues(transformStr);
281
+ // Todo transform 排序不一致时,transform动画会闪烁,故这里同样的排序输出 transform
282
+ values.sort();
277
283
  const transform = [];
278
284
  values.forEach(item => {
279
285
  const match = item.match(/([/\w]+)\((.+)\)/);
@@ -337,6 +343,14 @@ function transformBoxShadow(styleObj) {
337
343
  return `${res}${idx === 0 ? '' : ' '}${global.__formatValue(i)}`;
338
344
  }, '');
339
345
  }
346
+ function transformZIndex(styleObj) {
347
+ if (!styleObj.zIndex || typeof styleObj.zIndex === 'number')
348
+ return;
349
+ if (styleObj.zIndex === 'auto') {
350
+ error('Property [z-index] does not supported [auto], please check again!');
351
+ styleObj.zIndex = 0;
352
+ }
353
+ }
340
354
  export function useTransformStyle(styleObj = {}, { enableVar, externalVarContext, parentFontSize, parentWidth, parentHeight }) {
341
355
  const varStyle = {};
342
356
  const unoVarStyle = {};
@@ -386,17 +400,19 @@ export function useTransformStyle(styleObj = {}, { enableVar, externalVarContext
386
400
  envKeyPaths.push(keyPath.slice());
387
401
  }
388
402
  }
389
- function calcVisitor({ value, keyPath }) {
403
+ function calcVisitor({ key, value, keyPath }) {
390
404
  if (calcUseRegExp.test(value)) {
405
+ // calc translate & border-radius 的百分比计算
406
+ if (hasOwn(selfPercentRule, key) && /%/.test(value)) {
407
+ hasSelfPercent = true;
408
+ percentKeyPaths.push(keyPath.slice());
409
+ }
391
410
  calcKeyPaths.push(keyPath.slice());
392
411
  }
393
412
  }
394
413
  function percentVisitor({ key, value, keyPath }) {
395
- if (hasOwn(selfPercentRule, key) && PERCENT_REGEX.test(value)) {
396
- hasSelfPercent = true;
397
- percentKeyPaths.push(keyPath.slice());
398
- }
399
- else if ((key === 'fontSize' || key === 'lineHeight') && PERCENT_REGEX.test(value)) {
414
+ // fixme 去掉 translate & border-radius 的百分比计算
415
+ if ((key === 'fontSize' || key === 'lineHeight') && PERCENT_REGEX.test(value)) {
400
416
  percentKeyPaths.push(keyPath.slice());
401
417
  }
402
418
  }
@@ -405,6 +421,8 @@ export function useTransformStyle(styleObj = {}, { enableVar, externalVarContext
405
421
  [envVisitor, percentVisitor, calcVisitor].forEach(visitor => visitor({ target, key, value, keyPath }));
406
422
  }
407
423
  }
424
+ // transform 字符串格式转化数组格式(先转数组再处理css var)
425
+ transformTransform(styleObj);
408
426
  // traverse var & generate normalStyle
409
427
  traverseStyle(styleObj, [varVisitor]);
410
428
  hasVarDec = hasVarDec || !!externalVarContext;
@@ -467,8 +485,11 @@ export function useTransformStyle(styleObj = {}, { enableVar, externalVarContext
467
485
  transformStringify(normalStyle);
468
486
  // transform rpx to px
469
487
  transformBoxShadow(normalStyle);
470
- // transform 字符串格式转化数组格式
471
- transformTransform(normalStyle);
488
+ // transform z-index auto to 0
489
+ transformZIndex(normalStyle);
490
+ if (Array.isArray(normalStyle.transform)) {
491
+ normalStyle.transform = normalStyle.transform.filter(item => !isEmptyObject(item));
492
+ }
472
493
  return {
473
494
  hasVarDec,
474
495
  varContextRef,