@mpxjs/webpack-plugin 2.10.24 → 2.11.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.
- package/lib/index.js +4 -1
- package/lib/platform/style/wx/index.js +417 -120
- package/lib/platform/template/wx/component-config/picker.js +0 -6
- package/lib/react/style-helper.js +6 -6
- package/lib/resolver/AddEnvPlugin.js +1 -1
- package/lib/resolver/AddModePlugin.js +1 -1
- package/lib/resolver/ExtendComponentsPlugin.js +68 -0
- package/lib/runtime/components/extends/section-list.mpx +14 -0
- package/lib/runtime/components/react/animationHooks/index.ts +7 -3
- package/lib/runtime/components/react/dist/animationHooks/index.d.ts +0 -2
- package/lib/runtime/components/react/dist/animationHooks/index.js +6 -1
- package/lib/runtime/components/react/dist/event.config.d.ts +2 -6
- package/lib/runtime/components/react/dist/event.config.js +28 -24
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts +1 -1
- package/lib/runtime/components/react/dist/getInnerListeners.js +74 -56
- package/lib/runtime/components/react/dist/mpx-button.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-button.jsx +16 -9
- package/lib/runtime/components/react/dist/mpx-camera.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-camera.jsx +36 -5
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +1 -3
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +1 -1
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +3 -4
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-checkbox.jsx +8 -9
- package/lib/runtime/components/react/dist/mpx-form.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-form.jsx +5 -5
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-icon/index.jsx +2 -2
- package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-image.jsx +59 -43
- package/lib/runtime/components/react/dist/mpx-inline-text.jsx +13 -4
- package/lib/runtime/components/react/dist/mpx-input.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-input.jsx +16 -8
- package/lib/runtime/components/react/dist/mpx-label.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-label.jsx +5 -6
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-movable-area.jsx +3 -3
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-movable-view.jsx +6 -6
- package/lib/runtime/components/react/dist/mpx-nav.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-picker/index.jsx +72 -23
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +2 -2
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +4 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +1 -1
- package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +10 -14
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.js +0 -5
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +1 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +34 -14
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.jsx +4 -5
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.jsx +3 -5
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +5 -4
- package/lib/runtime/components/react/dist/mpx-popup/index.jsx +2 -2
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.jsx +3 -2
- package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-progress.jsx +1 -3
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-radio-group.jsx +3 -4
- package/lib/runtime/components/react/dist/mpx-radio.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-radio.jsx +8 -9
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +1 -3
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +6 -6
- package/lib/runtime/components/react/dist/mpx-section-list.d.ts +51 -0
- package/lib/runtime/components/react/dist/mpx-section-list.jsx +376 -0
- package/lib/runtime/components/react/dist/mpx-simple-text.jsx +37 -19
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +4 -1
- package/lib/runtime/components/react/dist/mpx-simple-view.jsx +11 -4
- package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-slider.jsx +6 -7
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-sticky-header.jsx +5 -5
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-sticky-section.jsx +6 -6
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +5 -5
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts +1 -2
- package/lib/runtime/components/react/dist/mpx-swiper.jsx +4 -8
- package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-switch.jsx +1 -3
- package/lib/runtime/components/react/dist/mpx-text.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-text.jsx +43 -25
- package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -2
- package/lib/runtime/components/react/dist/mpx-video.jsx +4 -5
- package/lib/runtime/components/react/dist/mpx-view.d.ts +2 -2
- package/lib/runtime/components/react/dist/mpx-view.jsx +214 -114
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts +2 -1
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +5 -1
- package/lib/runtime/components/react/dist/namedColorSet.d.ts +2 -0
- package/lib/runtime/components/react/dist/namedColorSet.js +149 -0
- package/lib/runtime/components/react/dist/utils.d.ts +71 -70
- package/lib/runtime/components/react/dist/utils.jsx +1295 -456
- package/lib/runtime/components/react/event.config.ts +32 -25
- package/lib/runtime/components/react/getInnerListeners.ts +84 -60
- package/lib/runtime/components/react/mpx-button.tsx +18 -18
- package/lib/runtime/components/react/mpx-camera.tsx +40 -8
- package/lib/runtime/components/react/mpx-canvas/index.tsx +5 -7
- package/lib/runtime/components/react/mpx-canvas/utils.tsx +3 -1
- package/lib/runtime/components/react/mpx-checkbox-group.tsx +2 -8
- package/lib/runtime/components/react/mpx-checkbox.tsx +9 -13
- package/lib/runtime/components/react/mpx-form.tsx +6 -8
- package/lib/runtime/components/react/mpx-icon/index.tsx +1 -5
- package/lib/runtime/components/react/mpx-image.tsx +66 -58
- package/lib/runtime/components/react/mpx-inline-text.tsx +13 -4
- package/lib/runtime/components/react/mpx-input.tsx +19 -12
- package/lib/runtime/components/react/mpx-label.tsx +6 -10
- package/lib/runtime/components/react/mpx-movable-area.tsx +3 -5
- package/lib/runtime/components/react/mpx-movable-view.tsx +7 -9
- package/lib/runtime/components/react/mpx-nav.tsx +1 -1
- package/lib/runtime/components/react/mpx-picker/index.tsx +100 -29
- package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +3 -3
- package/lib/runtime/components/react/mpx-picker/selector.tsx +1 -1
- package/lib/runtime/components/react/mpx-picker/type.ts +4 -0
- package/lib/runtime/components/react/mpx-picker-view/index.tsx +17 -24
- package/lib/runtime/components/react/mpx-picker-view/pickerVIewContext.ts +0 -9
- package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +44 -23
- package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItem.tsx +1 -9
- package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItemLite.tsx +0 -9
- package/lib/runtime/components/react/mpx-popup/index.tsx +7 -3
- package/lib/runtime/components/react/mpx-popup/popupBase.tsx +3 -2
- package/lib/runtime/components/react/mpx-progress.tsx +0 -6
- package/lib/runtime/components/react/mpx-radio-group.tsx +2 -8
- package/lib/runtime/components/react/mpx-radio.tsx +9 -13
- package/lib/runtime/components/react/mpx-rich-text/index.tsx +0 -6
- package/lib/runtime/components/react/mpx-scroll-view.tsx +7 -9
- package/lib/runtime/components/react/mpx-section-list.tsx +557 -0
- package/lib/runtime/components/react/mpx-simple-text.tsx +36 -25
- package/lib/runtime/components/react/mpx-simple-view.tsx +17 -5
- package/lib/runtime/components/react/mpx-slider.tsx +15 -13
- package/lib/runtime/components/react/mpx-sticky-header.tsx +6 -8
- package/lib/runtime/components/react/mpx-sticky-section.tsx +7 -9
- package/lib/runtime/components/react/mpx-swiper-item.tsx +6 -7
- package/lib/runtime/components/react/mpx-swiper.tsx +5 -11
- package/lib/runtime/components/react/mpx-switch.tsx +0 -6
- package/lib/runtime/components/react/mpx-text.tsx +45 -36
- package/lib/runtime/components/react/mpx-video.tsx +3 -8
- package/lib/runtime/components/react/mpx-view.tsx +235 -129
- package/lib/runtime/components/react/mpx-web-view.tsx +12 -6
- package/lib/runtime/components/react/namedColorSet.ts +150 -0
- package/lib/runtime/components/react/types/getInnerListeners.d.ts +21 -1
- package/lib/runtime/components/react/types/global.d.ts +1 -0
- package/lib/runtime/components/react/utils.tsx +1352 -550
- package/lib/runtime/i18n.wxs +15 -9
- package/lib/style-compiler/strip-conditional.js +19 -4
- package/lib/template-compiler/compiler.js +6 -0
- package/package.json +6 -6
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
const namedColorSet = {
|
|
2
|
+
transparent: true,
|
|
3
|
+
aliceblue: true,
|
|
4
|
+
antiquewhite: true,
|
|
5
|
+
aqua: true,
|
|
6
|
+
aquamarine: true,
|
|
7
|
+
azure: true,
|
|
8
|
+
beige: true,
|
|
9
|
+
bisque: true,
|
|
10
|
+
black: true,
|
|
11
|
+
blanchedalmond: true,
|
|
12
|
+
blue: true,
|
|
13
|
+
blueviolet: true,
|
|
14
|
+
brown: true,
|
|
15
|
+
burlywood: true,
|
|
16
|
+
cadetblue: true,
|
|
17
|
+
chartreuse: true,
|
|
18
|
+
chocolate: true,
|
|
19
|
+
coral: true,
|
|
20
|
+
cornflowerblue: true,
|
|
21
|
+
cornsilk: true,
|
|
22
|
+
crimson: true,
|
|
23
|
+
cyan: true,
|
|
24
|
+
darkblue: true,
|
|
25
|
+
darkcyan: true,
|
|
26
|
+
darkgoldenrod: true,
|
|
27
|
+
darkgray: true,
|
|
28
|
+
darkgreen: true,
|
|
29
|
+
darkgrey: true,
|
|
30
|
+
darkkhaki: true,
|
|
31
|
+
darkmagenta: true,
|
|
32
|
+
darkolivegreen: true,
|
|
33
|
+
darkorange: true,
|
|
34
|
+
darkorchid: true,
|
|
35
|
+
darkred: true,
|
|
36
|
+
darksalmon: true,
|
|
37
|
+
darkseagreen: true,
|
|
38
|
+
darkslateblue: true,
|
|
39
|
+
darkslategrey: true,
|
|
40
|
+
darkturquoise: true,
|
|
41
|
+
darkviolet: true,
|
|
42
|
+
deeppink: true,
|
|
43
|
+
deepskyblue: true,
|
|
44
|
+
dimgray: true,
|
|
45
|
+
dimgrey: true,
|
|
46
|
+
dodgerblue: true,
|
|
47
|
+
firebrick: true,
|
|
48
|
+
floralwhite: true,
|
|
49
|
+
forestgreen: true,
|
|
50
|
+
fuchsia: true,
|
|
51
|
+
gainsboro: true,
|
|
52
|
+
ghostwhite: true,
|
|
53
|
+
gold: true,
|
|
54
|
+
goldenrod: true,
|
|
55
|
+
gray: true,
|
|
56
|
+
green: true,
|
|
57
|
+
greenyellow: true,
|
|
58
|
+
grey: true,
|
|
59
|
+
honeydew: true,
|
|
60
|
+
hotpink: true,
|
|
61
|
+
indianred: true,
|
|
62
|
+
indigo: true,
|
|
63
|
+
ivory: true,
|
|
64
|
+
khaki: true,
|
|
65
|
+
lavender: true,
|
|
66
|
+
lavenderblush: true,
|
|
67
|
+
lawngreen: true,
|
|
68
|
+
lemonchiffon: true,
|
|
69
|
+
lightblue: true,
|
|
70
|
+
lightcoral: true,
|
|
71
|
+
lightcyan: true,
|
|
72
|
+
lightgoldenrodyellow: true,
|
|
73
|
+
lightgray: true,
|
|
74
|
+
lightgreen: true,
|
|
75
|
+
lightgrey: true,
|
|
76
|
+
lightpink: true,
|
|
77
|
+
lightsalmon: true,
|
|
78
|
+
lightseagreen: true,
|
|
79
|
+
lightskyblue: true,
|
|
80
|
+
lightslategrey: true,
|
|
81
|
+
lightsteelblue: true,
|
|
82
|
+
lightyellow: true,
|
|
83
|
+
lime: true,
|
|
84
|
+
limegreen: true,
|
|
85
|
+
linen: true,
|
|
86
|
+
magenta: true,
|
|
87
|
+
maroon: true,
|
|
88
|
+
mediumaquamarine: true,
|
|
89
|
+
mediumblue: true,
|
|
90
|
+
mediumorchid: true,
|
|
91
|
+
mediumpurple: true,
|
|
92
|
+
mediumseagreen: true,
|
|
93
|
+
mediumslateblue: true,
|
|
94
|
+
mediumspringgreen: true,
|
|
95
|
+
mediumturquoise: true,
|
|
96
|
+
mediumvioletred: true,
|
|
97
|
+
midnightblue: true,
|
|
98
|
+
mintcream: true,
|
|
99
|
+
mistyrose: true,
|
|
100
|
+
moccasin: true,
|
|
101
|
+
navajowhite: true,
|
|
102
|
+
navy: true,
|
|
103
|
+
oldlace: true,
|
|
104
|
+
olive: true,
|
|
105
|
+
olivedrab: true,
|
|
106
|
+
orange: true,
|
|
107
|
+
orangered: true,
|
|
108
|
+
orchid: true,
|
|
109
|
+
palegoldenrod: true,
|
|
110
|
+
palegreen: true,
|
|
111
|
+
paleturquoise: true,
|
|
112
|
+
palevioletred: true,
|
|
113
|
+
papayawhip: true,
|
|
114
|
+
peachpuff: true,
|
|
115
|
+
peru: true,
|
|
116
|
+
pink: true,
|
|
117
|
+
plum: true,
|
|
118
|
+
powderblue: true,
|
|
119
|
+
purple: true,
|
|
120
|
+
rebeccapurple: true,
|
|
121
|
+
red: true,
|
|
122
|
+
rosybrown: true,
|
|
123
|
+
royalblue: true,
|
|
124
|
+
saddlebrown: true,
|
|
125
|
+
salmon: true,
|
|
126
|
+
sandybrown: true,
|
|
127
|
+
seagreen: true,
|
|
128
|
+
seashell: true,
|
|
129
|
+
sienna: true,
|
|
130
|
+
silver: true,
|
|
131
|
+
skyblue: true,
|
|
132
|
+
slateblue: true,
|
|
133
|
+
slategray: true,
|
|
134
|
+
snow: true,
|
|
135
|
+
springgreen: true,
|
|
136
|
+
steelblue: true,
|
|
137
|
+
tan: true,
|
|
138
|
+
teal: true,
|
|
139
|
+
thistle: true,
|
|
140
|
+
tomato: true,
|
|
141
|
+
turquoise: true,
|
|
142
|
+
violet: true,
|
|
143
|
+
wheat: true,
|
|
144
|
+
white: true,
|
|
145
|
+
whitesmoke: true,
|
|
146
|
+
yellow: true,
|
|
147
|
+
yellowgreen: true
|
|
148
|
+
};
|
|
149
|
+
export default namedColorSet;
|
|
@@ -2,19 +2,11 @@ import { ReactNode, ReactElement, Dispatch, SetStateAction, MutableRefObject } f
|
|
|
2
2
|
import { LayoutChangeEvent, TextStyle, ImageProps, Image } from 'react-native';
|
|
3
3
|
import { TextPassThroughContextValue } from './context';
|
|
4
4
|
import type { AnyFunc } from './types/common';
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const SVG_REGEXP: RegExp;
|
|
9
|
-
export declare const BACKGROUND_STYLE_MAP: Record<string, boolean>;
|
|
10
|
-
export declare const TEXT_PROPS_MAP: Record<string, boolean>;
|
|
11
|
-
export declare const DEFAULT_FONT_SIZE = 16;
|
|
12
|
-
export declare const HIDDEN_STYLE: {
|
|
5
|
+
export declare const percentRegExp: RegExp;
|
|
6
|
+
export declare const svgRegExp: RegExp;
|
|
7
|
+
export declare const hiddenStyle: {
|
|
13
8
|
opacity: number;
|
|
14
9
|
};
|
|
15
|
-
export declare const DEFAULT_BOX_SIZING_STYLE: {
|
|
16
|
-
boxSizing: string;
|
|
17
|
-
};
|
|
18
10
|
export declare const isIOS: boolean;
|
|
19
11
|
export declare const isAndroid: boolean;
|
|
20
12
|
export declare const isHarmony: boolean;
|
|
@@ -24,88 +16,42 @@ export declare const extendObject: {
|
|
|
24
16
|
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
25
17
|
(target: object, ...sources: any[]): any;
|
|
26
18
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
export declare const useUpdateEffect: (effect: any, deps: any) => void;
|
|
36
|
-
export declare const parseUrl: (cssUrl?: string) => string | undefined;
|
|
37
|
-
export declare const getRestProps: (transferProps?: any, originProps?: any, deletePropsKey?: any) => any;
|
|
38
|
-
export declare function isText(ele: ReactNode): ele is ReactElement;
|
|
39
|
-
export declare function isStringChildren(children: ReactNode): boolean;
|
|
40
|
-
type GroupData<T> = Record<string, Partial<T>>;
|
|
41
|
-
export declare function groupBy<T extends Record<string, any>>(obj: T, callback: (key: string, val: T[keyof T]) => string, group?: GroupData<T>): GroupData<T>;
|
|
42
|
-
export declare function splitStyle<T extends Record<string, any>>(styleObj: T, sideEffect?: (key: string, val: T[keyof T]) => void): {
|
|
43
|
-
textStyle?: Partial<T>;
|
|
44
|
-
backgroundStyle?: Partial<T>;
|
|
45
|
-
innerStyle?: Partial<T>;
|
|
46
|
-
};
|
|
47
|
-
export declare function parseValues(str: string, char?: string): string[];
|
|
19
|
+
interface PercentConfig {
|
|
20
|
+
fontSize?: number | string;
|
|
21
|
+
width?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
parentWidth?: number;
|
|
24
|
+
parentHeight?: number;
|
|
25
|
+
}
|
|
48
26
|
interface TransformStyleConfig {
|
|
49
27
|
enableVar?: boolean;
|
|
50
|
-
externalVarContext?: Record<string, any>;
|
|
51
|
-
parentFontSize?: number;
|
|
52
28
|
parentWidth?: number;
|
|
53
29
|
parentHeight?: number;
|
|
54
30
|
transformRadiusPercent?: boolean;
|
|
31
|
+
defaultStyle?: Record<string, any>;
|
|
55
32
|
}
|
|
56
|
-
export declare function useTransformStyle(styleObj: Record<string, any> | undefined, { enableVar, transformRadiusPercent, externalVarContext, parentFontSize, parentWidth, parentHeight }: TransformStyleConfig): {
|
|
57
|
-
hasVarDec: boolean;
|
|
58
|
-
varContextRef: MutableRefObject<{}>;
|
|
59
|
-
setWidth: Dispatch<SetStateAction<number>>;
|
|
60
|
-
setHeight: Dispatch<SetStateAction<number>>;
|
|
61
|
-
normalStyle: Record<string, any>;
|
|
62
|
-
hasSelfPercent: boolean;
|
|
63
|
-
hasPositionFixed: boolean;
|
|
64
|
-
};
|
|
65
33
|
export interface VisitorArg {
|
|
66
34
|
target: Record<string, any>;
|
|
67
35
|
key: string;
|
|
68
36
|
value: any;
|
|
69
37
|
keyPath: Array<string>;
|
|
70
38
|
}
|
|
71
|
-
export declare function traverseStyle(styleObj: Record<string, any>, visitors: Array<(arg: VisitorArg) => void>): void;
|
|
72
|
-
export declare function setStyle(styleObj: Record<string, any>, keyPath: Array<string>, setter: (arg: VisitorArg) => void): void;
|
|
73
|
-
export declare function splitProps<T extends Record<string, any>>(props: T): {
|
|
74
|
-
textProps?: Partial<T>;
|
|
75
|
-
innerProps?: Partial<T>;
|
|
76
|
-
};
|
|
77
39
|
interface LayoutConfig {
|
|
78
40
|
props: Record<string, any>;
|
|
79
41
|
hasSelfPercent: boolean;
|
|
80
42
|
setWidth?: Dispatch<SetStateAction<number>>;
|
|
81
43
|
setHeight?: Dispatch<SetStateAction<number>>;
|
|
82
|
-
onLayout?: (event
|
|
44
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
83
45
|
nodeRef: React.RefObject<any>;
|
|
84
46
|
}
|
|
85
|
-
export declare const useLayout: ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => {
|
|
86
|
-
layoutRef: MutableRefObject<{}>;
|
|
87
|
-
layoutStyle: {};
|
|
88
|
-
layoutProps: Record<string, any>;
|
|
89
|
-
};
|
|
90
47
|
export interface WrapChildrenConfig {
|
|
91
48
|
hasVarDec: boolean;
|
|
92
49
|
varContext?: Record<string, any>;
|
|
93
50
|
textPassThrough?: TextPassThroughContextValue | null;
|
|
94
51
|
}
|
|
95
52
|
export interface TextPassThroughValueOptions {
|
|
96
|
-
|
|
97
|
-
disabled?: boolean;
|
|
53
|
+
enableTextPassThrough?: boolean;
|
|
98
54
|
}
|
|
99
|
-
export declare function useTextPassThroughValue(textStyle?: TextStyle, textProps?: Record<string, any>, { inheritTextProps, disabled }?: TextPassThroughValueOptions): TextPassThroughContextValue | null;
|
|
100
|
-
export declare function wrapChildren(props: Record<string, any> | undefined, { hasVarDec, varContext, textPassThrough }: WrapChildrenConfig): any;
|
|
101
|
-
export declare const debounce: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
|
|
102
|
-
clear: () => void;
|
|
103
|
-
};
|
|
104
|
-
export declare const useDebounceCallback: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
|
|
105
|
-
clear: () => void;
|
|
106
|
-
};
|
|
107
|
-
export declare const useStableCallback: <T extends AnyFunc | null | undefined>(callback: T) => T extends AnyFunc ? T : () => void;
|
|
108
|
-
export declare function usePrevious<T>(value: T): T | undefined;
|
|
109
55
|
export interface GestureHandler {
|
|
110
56
|
nodeRefs?: Array<{
|
|
111
57
|
getNodeInstance: () => {
|
|
@@ -113,11 +59,57 @@ export interface GestureHandler {
|
|
|
113
59
|
};
|
|
114
60
|
}>;
|
|
115
61
|
current?: unknown;
|
|
62
|
+
handlerTag?: number;
|
|
116
63
|
}
|
|
117
|
-
export declare function
|
|
118
|
-
export declare
|
|
119
|
-
export declare
|
|
64
|
+
export declare function omit<T, K extends string>(obj: T, fields: K[]): Omit<T, K>;
|
|
65
|
+
export declare const parseUrl: (cssUrl?: string) => string | undefined;
|
|
66
|
+
export declare const getRestProps: (transferProps?: any, originProps?: any, deletePropsKey?: any) => any;
|
|
67
|
+
export declare function getDefaultAllowFontScaling(): boolean;
|
|
68
|
+
export declare function isText(ele: ReactNode): ele is ReactElement;
|
|
69
|
+
export declare function isStringChildren(children: ReactNode): boolean;
|
|
70
|
+
export declare function parseValues(str: string, char?: string): string[];
|
|
71
|
+
export declare const debounce: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
|
|
72
|
+
clear: () => void;
|
|
73
|
+
};
|
|
74
|
+
export declare function isBoxSizingAffectingStyle(key: string): boolean;
|
|
75
|
+
export declare function transformBoxSizing(style?: Record<string, any>): void;
|
|
76
|
+
export declare function splitStyle<T extends Record<string, any>>(styleObj?: T, sideEffect?: (key: string, val: T[keyof T]) => void): {
|
|
77
|
+
textStyle?: Partial<T>;
|
|
78
|
+
backgroundStyle?: Partial<T>;
|
|
79
|
+
innerStyle?: Partial<T>;
|
|
80
|
+
};
|
|
81
|
+
export declare function splitProps<T extends Record<string, any>>(props?: T): {
|
|
82
|
+
textProps?: Partial<T>;
|
|
83
|
+
innerProps?: Partial<T>;
|
|
84
|
+
};
|
|
120
85
|
export declare function pickStyle(styleObj: Record<string, any> | undefined, pickedKeys: Array<string>, callback?: (key: string, val: number | string) => number | string): Record<string, any>;
|
|
86
|
+
export declare function transformShorthand(styleObj: Record<string, any>, shorthandKeys: string[], percentConfig: PercentConfig): void;
|
|
87
|
+
export declare function traverseStyle(styleObj: Record<string, any>, visitor: (arg: VisitorArg) => void): void;
|
|
88
|
+
export declare function setStyle(styleObj: Record<string, any>, keyPath: Array<string>, setter: (arg: VisitorArg) => void): void;
|
|
89
|
+
export declare function useTransformStyle(styleObj: Record<string, any> | undefined, { enableVar, transformRadiusPercent, parentWidth, parentHeight, defaultStyle }: TransformStyleConfig): {
|
|
90
|
+
hasVarDec: boolean;
|
|
91
|
+
varContextRef: MutableRefObject<Record<string, any>>;
|
|
92
|
+
setWidth: Dispatch<SetStateAction<number>>;
|
|
93
|
+
setHeight: Dispatch<SetStateAction<number>>;
|
|
94
|
+
normalStyle: Record<string, any>;
|
|
95
|
+
hasSelfPercent: boolean;
|
|
96
|
+
hasPositionFixed: boolean;
|
|
97
|
+
};
|
|
98
|
+
export declare function useNavigation(): Record<string, any> | undefined;
|
|
99
|
+
export declare function resolveTextFontSizePercentStyle<T extends TextStyle | undefined>(textStyle: T, parentTextStyle?: TextStyle): T;
|
|
100
|
+
export declare function resolveTextLineHeightPercentStyle<T extends TextStyle | undefined>(textStyle: T, parentTextStyle?: TextStyle): T;
|
|
101
|
+
/**
|
|
102
|
+
* 用法等同于 useEffect,但是会忽略首次执行,只在依赖更新时执行
|
|
103
|
+
*/
|
|
104
|
+
export declare const useUpdateEffect: (effect: any, deps: any) => void;
|
|
105
|
+
export declare const useLayout: ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => {
|
|
106
|
+
layoutRef: MutableRefObject<{}>;
|
|
107
|
+
layoutStyle: {
|
|
108
|
+
opacity: number;
|
|
109
|
+
} | undefined;
|
|
110
|
+
layoutProps: Record<string, any>;
|
|
111
|
+
};
|
|
112
|
+
export declare function useTextPassThrough(textStyle?: TextStyle, textProps?: Record<string, any>, { enableTextPassThrough }?: TextPassThroughValueOptions): TextPassThroughContextValue | null;
|
|
121
113
|
export declare function useHover({ enableHover, hoverStartTime, hoverStayTime, disabled }: {
|
|
122
114
|
enableHover: boolean;
|
|
123
115
|
hoverStartTime: number;
|
|
@@ -131,4 +123,13 @@ export declare function useHover({ enableHover, hoverStartTime, hoverStayTime, d
|
|
|
131
123
|
gesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
|
|
132
124
|
};
|
|
133
125
|
export declare function useRunOnJSCallback(callbackMapRef: MutableRefObject<Record<string, AnyFunc>>): (key: string, ...args: any) => any;
|
|
126
|
+
export declare const useDebounceCallback: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
|
|
127
|
+
clear: () => void;
|
|
128
|
+
};
|
|
129
|
+
export declare const useStableCallback: <T extends AnyFunc | null | undefined>(callback: T) => T extends AnyFunc ? T : () => void;
|
|
130
|
+
export declare function usePrevious<T>(value: T): T | undefined;
|
|
131
|
+
export declare function wrapChildren(children: ReactNode, { hasVarDec, varContext, textPassThrough }: WrapChildrenConfig): ReactNode;
|
|
132
|
+
export declare function renderImage(imageProps: ImageProps, enableFastImage?: boolean): import("react").CElement<ImageProps, Image>;
|
|
133
|
+
export declare function flatGesture(gestures?: Array<GestureHandler>): any[];
|
|
134
|
+
export declare function getCurrentPage(pageId: number | null | undefined): any;
|
|
134
135
|
export {};
|