@mpxjs/webpack-plugin 2.9.70 → 2.9.71

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 (60) hide show
  1. package/lib/platform/template/wx/component-config/movable-view.js +8 -1
  2. package/lib/platform/template/wx/component-config/picker-view.js +1 -5
  3. package/lib/platform/template/wx/component-config/scroll-view.js +1 -1
  4. package/lib/platform/template/wx/index.js +0 -4
  5. package/lib/runtime/components/react/context.ts +8 -0
  6. package/lib/runtime/components/react/dist/context.js +2 -0
  7. package/lib/runtime/components/react/dist/getInnerListeners.js +34 -31
  8. package/lib/runtime/components/react/dist/mpx-button.jsx +16 -44
  9. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +93 -58
  10. package/lib/runtime/components/react/dist/mpx-navigator.jsx +1 -1
  11. package/lib/runtime/components/react/dist/mpx-picker-view-column-item.jsx +35 -0
  12. package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +151 -127
  13. package/lib/runtime/components/react/dist/mpx-picker-view.jsx +38 -34
  14. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +10 -11
  15. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +11 -4
  16. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +31 -8
  17. package/lib/runtime/components/react/dist/mpx-swiper.jsx +670 -0
  18. package/lib/runtime/components/react/dist/mpx-view.jsx +15 -53
  19. package/lib/runtime/components/react/dist/pickerFaces.js +7 -6
  20. package/lib/runtime/components/react/dist/pickerVIewContext.js +14 -0
  21. package/lib/runtime/components/react/dist/pickerViewIndicator.jsx +23 -0
  22. package/lib/runtime/components/react/dist/pickerViewMask.jsx +18 -0
  23. package/lib/runtime/components/react/dist/useAnimationHooks.js +20 -2
  24. package/lib/runtime/components/react/dist/utils.jsx +74 -11
  25. package/lib/runtime/components/react/getInnerListeners.ts +43 -32
  26. package/lib/runtime/components/react/mpx-button.tsx +20 -57
  27. package/lib/runtime/components/react/mpx-movable-view.tsx +119 -74
  28. package/lib/runtime/components/react/mpx-navigator.tsx +1 -1
  29. package/lib/runtime/components/react/mpx-picker-view-column-item.tsx +76 -0
  30. package/lib/runtime/components/react/mpx-picker-view-column.tsx +206 -183
  31. package/lib/runtime/components/react/mpx-picker-view.tsx +49 -48
  32. package/lib/runtime/components/react/mpx-rich-text/index.tsx +12 -18
  33. package/lib/runtime/components/react/mpx-scroll-view.tsx +21 -10
  34. package/lib/runtime/components/react/mpx-swiper-item.tsx +45 -11
  35. package/lib/runtime/components/react/mpx-swiper.tsx +742 -0
  36. package/lib/runtime/components/react/mpx-view.tsx +18 -65
  37. package/lib/runtime/components/react/pickerFaces.ts +10 -7
  38. package/lib/runtime/components/react/pickerVIewContext.ts +27 -0
  39. package/lib/runtime/components/react/pickerViewIndicator.tsx +34 -0
  40. package/lib/runtime/components/react/pickerViewMask.tsx +30 -0
  41. package/lib/runtime/components/react/types/{getInnerListeners.ts → getInnerListeners.d.ts} +4 -5
  42. package/lib/runtime/components/react/types/global.d.ts +10 -0
  43. package/lib/runtime/components/react/useAnimationHooks.ts +24 -3
  44. package/lib/runtime/components/react/utils.tsx +85 -12
  45. package/lib/runtime/components/web/mpx-checkbox.vue +1 -1
  46. package/lib/runtime/components/web/mpx-picker-view-column.vue +9 -4
  47. package/lib/template-compiler/compiler.js +61 -13
  48. package/lib/wxss/loader.js +15 -2
  49. package/package.json +3 -3
  50. package/lib/runtime/components/react/dist/mpx-swiper/carouse.jsx +0 -480
  51. package/lib/runtime/components/react/dist/mpx-swiper/index.jsx +0 -68
  52. package/lib/runtime/components/react/dist/mpx-swiper/type.js +0 -1
  53. package/lib/runtime/components/react/dist/pickerOverlay.jsx +0 -21
  54. package/lib/runtime/components/react/dist/types/common.js +0 -1
  55. package/lib/runtime/components/react/dist/types/getInnerListeners.js +0 -1
  56. package/lib/runtime/components/react/mpx-swiper/carouse.tsx +0 -527
  57. package/lib/runtime/components/react/mpx-swiper/index.tsx +0 -80
  58. package/lib/runtime/components/react/mpx-swiper/type.ts +0 -87
  59. package/lib/runtime/components/react/pickerOverlay.tsx +0 -32
  60. /package/lib/runtime/components/react/types/{common.ts → common.d.ts} +0 -0
@@ -1,80 +0,0 @@
1
- import { ScrollView } from 'react-native'
2
- import { JSX, MutableRefObject, forwardRef, useRef } from 'react'
3
- import Carouse from './carouse'
4
- import { SwiperProps } from './type'
5
- import useInnerProps from '../getInnerListeners'
6
- import useNodesRef, { HandlerRef } from '../useNodesRef' // 引入辅助函数
7
- /**
8
- * ✔ indicator-dots
9
- * ✔ indicator-color
10
- * ✔ indicator-active-color
11
- * ✔ autoplay
12
- * ✔ current
13
- * ✔ interval
14
- * ✔ duration
15
- * ✔ circular
16
- * ✔ vertical
17
- * ✘ display-multiple-items
18
- * ✘ previous-margin
19
- * ✘ next-margin
20
- * ✔ easing-function ="easeOutCubic"
21
- * ✘ snap-to-edge
22
- */
23
- const _SwiperWrapper = forwardRef<HandlerRef<ScrollView, SwiperProps>, SwiperProps>((props: SwiperProps, ref): JSX.Element => {
24
- const { children } = props
25
- const innerLayout = useRef({})
26
- const swiperProp = {
27
- circular: props.circular || false,
28
- current: props.current || 0,
29
- autoplay: props.autoplay || false,
30
- duration: props.duration || 500,
31
- interval: props.interval || 5000,
32
- showsPagination: props['indicator-dots'],
33
- dotColor: props['indicator-color'] || 'rgba(0, 0, 0, .3)',
34
- activeDotColor: props['indicator-active-color'] || '#000000',
35
- horizontal: props.vertical !== undefined ? !props.vertical : true,
36
- previousMargin: props['previous-margin'] ? parseInt(props['previous-margin']) : 0,
37
- nextMargin: props['next-margin'] ? parseInt(props['next-margin']) : 0,
38
- enableOffset: props['enable-offset'] || true,
39
- enableVar: props['enable-var'] || false,
40
- parentFontSize: props['parent-font-size'],
41
- parentWidth: props['parent-width'],
42
- parentHeight: props['parent-height'],
43
- style: props.style || {},
44
- externalVarContext: props['external-var-context'],
45
- bindchange: props.bindchange,
46
- easingFunction: props['easing-function'] || 'default'
47
- }
48
-
49
- const nodeRef = useRef(null)
50
- useNodesRef<ScrollView, SwiperProps>(props, ref, nodeRef, {})
51
-
52
- const innerProps = useInnerProps(props, {
53
- ref: nodeRef
54
- }, [
55
- 'indicator-dots',
56
- 'indicator-color',
57
- 'indicator-active-color',
58
- 'previous-margin',
59
- 'vertical',
60
- 'previous-margin',
61
- 'next-margin',
62
- 'easing-function'
63
- ], { layoutRef: innerLayout })
64
-
65
- const getInnerLayout = (layout: MutableRefObject<{}>) => {
66
- innerLayout.current = layout.current
67
- }
68
-
69
- return <Carouse
70
- getInnerLayout={getInnerLayout}
71
- innerProps={innerProps}
72
- {...innerProps}
73
- {...swiperProp}>
74
- {children}
75
- </Carouse>
76
- })
77
-
78
- _SwiperWrapper.displayName = 'MpxSwiper'
79
-
80
- export default _SwiperWrapper
@@ -1,87 +0,0 @@
1
- import { ReactNode } from 'react'
2
- import { NativeSyntheticEvent } from 'react-native'
3
-
4
- export type EaseType = 'default' | 'linear' | 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic'
5
-
6
- export interface SwiperProps {
7
- children?: ReactNode;
8
- circular?: boolean;
9
- current?: number;
10
- interval?: number;
11
- autoplay?: boolean;
12
- duration?: number;
13
- 'indicator-dots'?: boolean;
14
- 'indicator-color'?: string;
15
- 'indicator-active-color'?: string;
16
- vertical?: boolean;
17
- style: {
18
- [key: string]: any
19
- };
20
- 'easing-function'?: EaseType;
21
- 'previous-margin'?: string;
22
- 'next-margin'?: string;
23
- 'enable-offset'?: boolean;
24
- 'enable-var': boolean;
25
- 'parent-font-size'?: number;
26
- 'parent-width'?: number;
27
- 'parent-height'?: number;
28
- 'external-var-context'?: Record<string, any>;
29
- bindchange?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
30
- }
31
-
32
- export interface CarouseProps {
33
- children?: ReactNode;
34
- circular?: boolean;
35
- current: number;
36
- autoplay?: boolean;
37
- duration?: number;
38
- interval?: number;
39
- showsPagination?: boolean;
40
- dotColor?: string;
41
- activeDotColor?: string;
42
- horizontal?: boolean;
43
- easingFunction?: EaseType;
44
- previousMargin?: number;
45
- nextMargin?: number;
46
- enableOffset?: boolean;
47
- parentFontSize?: number;
48
- parentWidth?: number;
49
- parentHeight?: number;
50
- bindchange?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
51
- getInnerLayout: Function;
52
- innerProps: Object;
53
- style: {
54
- [key: string]: any
55
- };
56
- enableVar: boolean;
57
- externalVarContext?: Record<string, any>;
58
- }
59
-
60
- export interface CarouseState {
61
- children: Array<ReactNode> | ReactNode,
62
- width: number;
63
- height: number;
64
- index: number;
65
- total: number;
66
- // 设置scrollView初始的滚动坐标,contentOffset
67
- offset: {
68
- x: number,
69
- y: number
70
- };
71
- // 是否结束自动轮播,手动设置滚动到具体位置时结束
72
- autoplayEnd: boolean;
73
- loopJump: boolean;
74
- dir: 'x' | 'y';
75
- isScrollEnd: boolean
76
- }
77
-
78
- export interface ScrollElementProps {
79
- pagingEnabled: boolean,
80
- showsHorizontalScrollIndicator: boolean,
81
- showsVerticalScrollIndicator: boolean,
82
- bounces: boolean,
83
- scrollsToTop: boolean,
84
- removeClippedSubviews: boolean,
85
- automaticallyAdjustContentInsets: boolean,
86
- horizontal: boolean
87
- }
@@ -1,32 +0,0 @@
1
- import React from 'react'
2
- import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
3
-
4
- type OverlayProps = {
5
- itemHeight: number
6
- overlayItemStyle?: StyleProp<ViewStyle>
7
- overlayContainerStyle?: StyleProp<ViewStyle>
8
- }
9
-
10
- const Overlay = ({ itemHeight, overlayItemStyle, overlayContainerStyle }: OverlayProps) => {
11
- return (
12
- <View style={[styles.overlayContainer, overlayContainerStyle]} pointerEvents={'none'}>
13
- <View style={[styles.selection, { height: itemHeight }, overlayItemStyle]} />
14
- </View>
15
- )
16
- }
17
-
18
- const styles = StyleSheet.create({
19
- overlayContainer: {
20
- ...StyleSheet.absoluteFillObject,
21
- justifyContent: 'center',
22
- alignItems: 'center'
23
- },
24
- selection: {
25
- borderTopWidth: 1,
26
- borderBottomWidth: 1,
27
- borderColor: 'rgba(0, 0, 0, 0.05)',
28
- alignSelf: 'stretch'
29
- }
30
- })
31
-
32
- export default React.memo(Overlay)