@mpxjs/webpack-plugin 2.10.16-beta.5 → 2.10.16-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.
- package/lib/loader.js +2 -2
- package/lib/runtime/components/react/context.ts +10 -6
- package/lib/runtime/components/react/dist/context.d.ts +75 -0
- package/lib/runtime/components/react/dist/context.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/event.config.d.ts +8 -0
- package/lib/runtime/components/react/dist/event.config.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts +8 -0
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-button.d.ts +69 -0
- package/lib/runtime/components/react/dist/mpx-button.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-camera.d.ts +28 -0
- package/lib/runtime/components/react/dist/mpx-camera.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +11 -0
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +3 -0
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +53 -0
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-form.d.ts +28 -0
- package/lib/runtime/components/react/dist/mpx-form.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +19 -0
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-image.d.ts +22 -0
- package/lib/runtime/components/react/dist/mpx-image.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-input.d.ts +50 -0
- package/lib/runtime/components/react/dist/mpx-input.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-input.jsx +35 -9
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +46 -53
- package/lib/runtime/components/react/dist/mpx-label.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-label.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +66 -0
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-nav.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-nav.jsx +132 -0
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts +10 -0
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +3 -0
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +107 -0
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +15 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +14 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +17 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +12 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +17 -0
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +16 -0
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +30 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +10 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-progress.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-radio.d.ts +27 -0
- package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +2 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +25 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +15 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +55 -0
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-slider.d.ts +31 -0
- package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +18 -0
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +16 -0
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +19 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts +53 -0
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-switch.d.ts +27 -0
- package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-text.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-video.d.ts +102 -0
- package/lib/runtime/components/react/dist/mpx-video.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-view.d.ts +35 -0
- package/lib/runtime/components/react/dist/mpx-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/parser.d.ts +40 -0
- package/lib/runtime/components/react/dist/parser.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +33 -0
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/useNodesRef.d.ts +12 -0
- package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/utils.d.ts +123 -0
- package/lib/runtime/components/react/dist/utils.d.ts.map +1 -0
- package/lib/runtime/components/react/mpx-camera.tsx +1 -1
- package/lib/runtime/components/react/mpx-input.tsx +41 -16
- package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +48 -58
- package/lib/runtime/components/react/mpx-nav.tsx +155 -0
- package/lib/runtime/components/react/types/common.d.ts +19 -0
- package/lib/style-compiler/strip-conditional-loader.js +27 -4
- package/package.json +4 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mpx-video.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AAG,CAAC,KAAK,IAAI,CAAA;IAChD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IAChD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IACrD,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IAC3D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IAClD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IAChD,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IACzD,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IACzD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;CACxD;AAmBD,QAAA,MAAM,QAAQ,qHAuQZ,CAAA;AAEF,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ✔ hover-class
|
|
3
|
+
* ✘ hover-stop-propagation
|
|
4
|
+
* ✔ hover-start-time
|
|
5
|
+
* ✔ hover-stay-time
|
|
6
|
+
*/
|
|
7
|
+
import { View, NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
8
|
+
import { ReactNode } from 'react';
|
|
9
|
+
import type { AnimationProp } from './useAnimationHooks';
|
|
10
|
+
import { ExtendedViewStyle } from './types/common';
|
|
11
|
+
import { HandlerRef } from './useNodesRef';
|
|
12
|
+
export interface _ViewProps extends ViewProps {
|
|
13
|
+
style?: ExtendedViewStyle;
|
|
14
|
+
animation?: AnimationProp;
|
|
15
|
+
children?: ReactNode | ReactNode[];
|
|
16
|
+
'hover-style'?: ExtendedViewStyle;
|
|
17
|
+
'hover-start-time'?: number;
|
|
18
|
+
'hover-stay-time'?: number;
|
|
19
|
+
'enable-background'?: boolean;
|
|
20
|
+
'enable-var'?: boolean;
|
|
21
|
+
'enable-fast-image'?: boolean;
|
|
22
|
+
'external-var-context'?: Record<string, any>;
|
|
23
|
+
'parent-font-size'?: number;
|
|
24
|
+
'parent-width'?: number;
|
|
25
|
+
'parent-height'?: number;
|
|
26
|
+
'enable-animation'?: boolean;
|
|
27
|
+
bindtouchstart?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
|
|
28
|
+
bindtouchmove?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
|
|
29
|
+
bindtouchend?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
|
|
30
|
+
bindtransitionend?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
|
|
31
|
+
catchtransitionend?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
|
|
32
|
+
}
|
|
33
|
+
declare const _View: import("react").ForwardRefExoticComponent<_ViewProps & import("react").RefAttributes<HandlerRef<View, _ViewProps>>>;
|
|
34
|
+
export default _View;
|
|
35
|
+
//# sourceMappingURL=mpx-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mpx-view.d.ts","sourceRoot":"","sources":["../mpx-view.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAa,oBAAoB,EAAE,SAAS,EAAoD,MAAM,cAAc,CAAA;AACjI,OAAO,EAA2C,SAAS,EAAsB,MAAM,OAAO,CAAA;AAI9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,i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AAM,KAAK,qHAiIT,CAAA;AAIF,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebView } from 'react-native-webview';
|
|
3
|
+
import { HandlerRef } from './useNodesRef';
|
|
4
|
+
type OnMessageCallbackEvent = {
|
|
5
|
+
detail: {
|
|
6
|
+
data: any[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
type CommonCallbackEvent = {
|
|
10
|
+
detail: {
|
|
11
|
+
src?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
interface WebViewProps {
|
|
15
|
+
src?: string;
|
|
16
|
+
bindmessage?: (event: OnMessageCallbackEvent) => void;
|
|
17
|
+
bindload?: (event: CommonCallbackEvent) => void;
|
|
18
|
+
binderror?: (event: CommonCallbackEvent) => void;
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}
|
|
21
|
+
declare const _WebView: import("react").ForwardRefExoticComponent<Omit<WebViewProps, "ref"> & import("react").RefAttributes<HandlerRef<WebView<{}>, WebViewProps>>>;
|
|
22
|
+
export default _WebView;
|
|
23
|
+
//# sourceMappingURL=mpx-web-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mpx-web-view.d.ts","sourceRoot":"","sources":["../mpx-web-view.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAMvD,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE;QACN,IAAI,EAAE,GAAG,EAAE,CAAA;KACZ,CAAA;CACF,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;CACF,CAAA;AAED,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAA;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAC/C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAChD,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACjB;AAgDD,QAAA,MAAM,QAAQ,6IA0RZ,CAAA;AAIF,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface Token {
|
|
2
|
+
type: string;
|
|
3
|
+
value: string | number;
|
|
4
|
+
}
|
|
5
|
+
interface ExpressionNode {
|
|
6
|
+
type: 'NUMBER';
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class ExpressionParser {
|
|
10
|
+
private tokens;
|
|
11
|
+
private formatter;
|
|
12
|
+
private functions;
|
|
13
|
+
private current;
|
|
14
|
+
constructor(input: string, formatter?: (val: string) => number, functions?: {
|
|
15
|
+
[key: string]: (...args: number[]) => number;
|
|
16
|
+
});
|
|
17
|
+
tokenize(input: string): Token[];
|
|
18
|
+
parse(): ExpressionNode;
|
|
19
|
+
private expression;
|
|
20
|
+
private term;
|
|
21
|
+
private factor;
|
|
22
|
+
private parseArguments;
|
|
23
|
+
private applyOperator;
|
|
24
|
+
private applyFunction;
|
|
25
|
+
}
|
|
26
|
+
interface FuncInfo {
|
|
27
|
+
start: number;
|
|
28
|
+
end: number;
|
|
29
|
+
args: string[];
|
|
30
|
+
}
|
|
31
|
+
export declare function parseFunc(str: string, funcName: string): FuncInfo[];
|
|
32
|
+
export declare class ReplaceSource {
|
|
33
|
+
private _source;
|
|
34
|
+
private _replacements;
|
|
35
|
+
constructor(source: string);
|
|
36
|
+
replace(start: number, end: number, content: string): void;
|
|
37
|
+
source(): string;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@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EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3D,MAAM,IAAK,MAAM;CA2BlB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
2
|
+
import type { NativeSyntheticEvent } from 'react-native';
|
|
3
|
+
import { ExtendedViewStyle } from './types/common';
|
|
4
|
+
import type { _ViewProps } from './mpx-view';
|
|
5
|
+
type AnimatedOption = {
|
|
6
|
+
duration: number;
|
|
7
|
+
delay: number;
|
|
8
|
+
useNativeDriver: boolean;
|
|
9
|
+
timingFunction: 'linear' | 'ease' | 'ease-in' | 'ease-in-out' | 'ease-out';
|
|
10
|
+
transformOrigin: string;
|
|
11
|
+
};
|
|
12
|
+
export type AnimationStepItem = {
|
|
13
|
+
animatedOption: AnimatedOption;
|
|
14
|
+
rules: Map<string, number | string>;
|
|
15
|
+
transform: Map<string, number>;
|
|
16
|
+
};
|
|
17
|
+
export type AnimationProp = {
|
|
18
|
+
id: number;
|
|
19
|
+
actions: AnimationStepItem[];
|
|
20
|
+
};
|
|
21
|
+
export default function useAnimationHooks<T, P>(props: _ViewProps & {
|
|
22
|
+
enableAnimation?: boolean;
|
|
23
|
+
layoutRef: MutableRefObject<any>;
|
|
24
|
+
transitionend?: (event: NativeSyntheticEvent<TouchEvent> | unknown) => void;
|
|
25
|
+
}): {
|
|
26
|
+
enableStyleAnimation: boolean;
|
|
27
|
+
animationStyle?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
enableStyleAnimation: true;
|
|
30
|
+
animationStyle: ExtendedViewStyle;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=useAnimationHooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimationHooks.d.ts","sourceRoot":"","sources":["../useAnimationHooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,KAAK,EAAE,oBAAoB,EAAmB,MAAM,cAAc,CAAA;AAezE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,EAAE,OAAO,CAAA;IACxB,cAAc,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,GAAE,UAAU,CAAA;IACzE,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAID,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,cAAc,CAAA;IAC9B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;IACnC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B,CAAA;AACD,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,iBAAiB,EAAE,CAAA;CAC7B,CAAA;AA0DD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAG,KAAK,EAAE,UAAU,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;CAAE;;;;;;EA+NhN"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject, ForwardedRef } from 'react';
|
|
2
|
+
type Obj = Record<string, any>;
|
|
3
|
+
export type HandlerRef<T, P> = {
|
|
4
|
+
getNodeInstance(): {
|
|
5
|
+
props: RefObject<P>;
|
|
6
|
+
nodeRef: RefObject<T>;
|
|
7
|
+
instance: Obj;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default function useNodesRef<T, P>(props: P, ref: ForwardedRef<HandlerRef<T, P>>, nodeRef: RefObject<T>, instance?: Obj): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useNodesRef.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNodesRef.d.ts","sourceRoot":"","sources":["../useNodesRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAE5E,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAE9B,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI;IAC7B,eAAe,IAAI;QACjB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,QAAQ,EAAE,GAAG,CAAA;KACd,CAAA;CACF,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAE,CAAC,EAAG,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAC,GAAQ,QAejI"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, Dispatch, SetStateAction, MutableRefObject } from 'react';
|
|
2
|
+
import { LayoutChangeEvent, TextStyle, ImageProps } from 'react-native';
|
|
3
|
+
import { FastImageProps } from '@d11/react-native-fast-image';
|
|
4
|
+
import type { AnyFunc } from './types/common';
|
|
5
|
+
export declare const TEXT_STYLE_REGEX: RegExp;
|
|
6
|
+
export declare const PERCENT_REGEX: RegExp;
|
|
7
|
+
export declare const URL_REGEX: RegExp;
|
|
8
|
+
export declare const SVG_REGEXP: RegExp;
|
|
9
|
+
export declare const BACKGROUND_REGEX: RegExp;
|
|
10
|
+
export declare const TEXT_PROPS_REGEX: RegExp;
|
|
11
|
+
export declare const DEFAULT_FONT_SIZE = 16;
|
|
12
|
+
export declare const HIDDEN_STYLE: {
|
|
13
|
+
opacity: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const isIOS: boolean;
|
|
16
|
+
export declare const isAndroid: boolean;
|
|
17
|
+
export declare const isHarmony: boolean;
|
|
18
|
+
export declare function useNavigation(): Record<string, any> | undefined;
|
|
19
|
+
export declare function omit<T, K extends string>(obj: T, fields: K[]): Omit<T, K>;
|
|
20
|
+
/**
|
|
21
|
+
* 用法等同于 useEffect,但是会忽略首次执行,只在依赖更新时执行
|
|
22
|
+
*/
|
|
23
|
+
export declare const useUpdateEffect: (effect: any, deps: any) => void;
|
|
24
|
+
export declare const parseUrl: (cssUrl?: string) => string | undefined;
|
|
25
|
+
export declare const getRestProps: (transferProps?: any, originProps?: any, deletePropsKey?: any) => any;
|
|
26
|
+
export declare function isText(ele: ReactNode): ele is ReactElement;
|
|
27
|
+
export declare function every(children: ReactNode, callback: (children: ReactNode) => boolean): boolean;
|
|
28
|
+
type GroupData<T> = Record<string, Partial<T>>;
|
|
29
|
+
export declare function groupBy<T extends Record<string, any>>(obj: T, callback: (key: string, val: T[keyof T]) => string, group?: GroupData<T>): GroupData<T>;
|
|
30
|
+
export declare function splitStyle<T extends Record<string, any>>(styleObj: T): {
|
|
31
|
+
textStyle?: Partial<T>;
|
|
32
|
+
backgroundStyle?: Partial<T>;
|
|
33
|
+
innerStyle?: Partial<T>;
|
|
34
|
+
};
|
|
35
|
+
interface TransformStyleConfig {
|
|
36
|
+
enableVar?: boolean;
|
|
37
|
+
externalVarContext?: Record<string, any>;
|
|
38
|
+
parentFontSize?: number;
|
|
39
|
+
parentWidth?: number;
|
|
40
|
+
parentHeight?: number;
|
|
41
|
+
}
|
|
42
|
+
export declare function useTransformStyle(styleObj: Record<string, any> | undefined, { enableVar, externalVarContext, parentFontSize, parentWidth, parentHeight }: TransformStyleConfig): {
|
|
43
|
+
hasVarDec: boolean;
|
|
44
|
+
varContextRef: MutableRefObject<{}>;
|
|
45
|
+
setWidth: Dispatch<SetStateAction<number>>;
|
|
46
|
+
setHeight: Dispatch<SetStateAction<number>>;
|
|
47
|
+
normalStyle: Record<string, any>;
|
|
48
|
+
hasSelfPercent: boolean;
|
|
49
|
+
hasPositionFixed: boolean;
|
|
50
|
+
};
|
|
51
|
+
export interface VisitorArg {
|
|
52
|
+
target: Record<string, any>;
|
|
53
|
+
key: string;
|
|
54
|
+
value: any;
|
|
55
|
+
keyPath: Array<string>;
|
|
56
|
+
}
|
|
57
|
+
export declare function traverseStyle(styleObj: Record<string, any>, visitors: Array<(arg: VisitorArg) => void>): void;
|
|
58
|
+
export declare function setStyle(styleObj: Record<string, any>, keyPath: Array<string>, setter: (arg: VisitorArg) => void): void;
|
|
59
|
+
export declare function splitProps<T extends Record<string, any>>(props: T): {
|
|
60
|
+
textProps?: Partial<T>;
|
|
61
|
+
innerProps?: Partial<T>;
|
|
62
|
+
};
|
|
63
|
+
interface LayoutConfig {
|
|
64
|
+
props: Record<string, any>;
|
|
65
|
+
hasSelfPercent: boolean;
|
|
66
|
+
setWidth?: Dispatch<SetStateAction<number>>;
|
|
67
|
+
setHeight?: Dispatch<SetStateAction<number>>;
|
|
68
|
+
onLayout?: (event?: LayoutChangeEvent) => void;
|
|
69
|
+
nodeRef: React.RefObject<any>;
|
|
70
|
+
}
|
|
71
|
+
export declare const useLayout: ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => {
|
|
72
|
+
layoutRef: MutableRefObject<{}>;
|
|
73
|
+
layoutStyle: {};
|
|
74
|
+
layoutProps: Record<string, any>;
|
|
75
|
+
};
|
|
76
|
+
export interface WrapChildrenConfig {
|
|
77
|
+
hasVarDec: boolean;
|
|
78
|
+
varContext?: Record<string, any>;
|
|
79
|
+
textStyle?: TextStyle;
|
|
80
|
+
textProps?: Record<string, any>;
|
|
81
|
+
}
|
|
82
|
+
export declare function wrapChildren(props: Record<string, any> | undefined, { hasVarDec, varContext, textStyle, textProps }: WrapChildrenConfig): any;
|
|
83
|
+
export declare const debounce: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
|
|
84
|
+
clear: () => void;
|
|
85
|
+
};
|
|
86
|
+
export declare const useDebounceCallback: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
|
|
87
|
+
clear: () => void;
|
|
88
|
+
};
|
|
89
|
+
export declare const useStableCallback: <T extends AnyFunc | null | undefined>(callback: T) => T extends AnyFunc ? T : () => void;
|
|
90
|
+
export declare function usePrevious<T>(value: T): T | undefined;
|
|
91
|
+
export interface GestureHandler {
|
|
92
|
+
nodeRefs?: Array<{
|
|
93
|
+
getNodeInstance: () => {
|
|
94
|
+
nodeRef: unknown;
|
|
95
|
+
};
|
|
96
|
+
}>;
|
|
97
|
+
current?: unknown;
|
|
98
|
+
}
|
|
99
|
+
export declare function flatGesture(gestures?: Array<GestureHandler>): any[];
|
|
100
|
+
export declare const extendObject: {
|
|
101
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
102
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
103
|
+
<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;
|
|
104
|
+
(target: object, ...sources: any[]): any;
|
|
105
|
+
};
|
|
106
|
+
export declare function getCurrentPage(pageId: number | null | undefined): any;
|
|
107
|
+
export declare function renderImage(imageProps: ImageProps | FastImageProps, enableFastImage?: boolean): ReactElement<ImageProps | FastImageProps, string | import("react").JSXElementConstructor<any>>;
|
|
108
|
+
export declare function pickStyle(styleObj: Record<string, any> | undefined, pickedKeys: Array<string>, callback?: (key: string, val: number | string) => number | string): Record<string, any>;
|
|
109
|
+
export declare function useHover({ enableHover, hoverStartTime, hoverStayTime, disabled }: {
|
|
110
|
+
enableHover: boolean;
|
|
111
|
+
hoverStartTime: number;
|
|
112
|
+
hoverStayTime: number;
|
|
113
|
+
disabled?: boolean;
|
|
114
|
+
}): {
|
|
115
|
+
isHover: boolean;
|
|
116
|
+
gesture?: undefined;
|
|
117
|
+
} | {
|
|
118
|
+
isHover: boolean;
|
|
119
|
+
gesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
|
|
120
|
+
};
|
|
121
|
+
export declare function useRunOnJSCallback(callbackMapRef: MutableRefObject<Record<string, AnyFunc>>): (key: string, ...args: any) => any;
|
|
122
|
+
export {};
|
|
123
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2C,SAAS,EAAE,YAAY,EAAwC,QAAQ,EAAE,cAAc,EAAyC,gBAAgB,EAAE,MAAM,OAAO,CAAA;AACjN,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAS,MAAM,cAAc,CAAA;AAK9E,OAAkB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,KAAK,EAAE,OAAO,EAA6B,MAAM,gBAAgB,CAAA;AAIxE,eAAO,MAAM,gBAAgB,QAAqF,CAAA;AAClH,eAAO,MAAM,aAAa,QAA2B,CAAA;AACrD,eAAO,MAAM,SAAS,QAAmC,CAAA;AACzD,eAAO,MAAM,UAAU,QAA4B,CAAA;AACnD,eAAO,MAAM,gBAAgB,QAA6C,CAAA;AAC1E,eAAO,MAAM,gBAAgB,QAAiD,CAAA;AAC9E,eAAO,MAAM,iBAAiB,KAAK,CAAA;AACnC,eAAO,MAAM,YAAY;;CAExB,CAAA;AAID,eAAO,MAAM,KAAK,SAAyB,CAAA;AAC3C,eAAO,MAAM,SAAS,SAA6B,CAAA;AACnD,eAAO,MAAM,SAAS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AO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAE,QAAQ,GAAE,KAAK,CAAC,cAAc,CAAM,SAQhE;AAED,eAAO,MAAM,YAAY;;;;;CAAgB,CAAA;AAEzC,wBAAgB,cAAc,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,OAIhE;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,GAAG,cAAc,EACvC,eAAe,UAAQ,kGAIxB;AAED,wBAAgB,SAAS,CAAE,QAAQ,iCAA0B,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,GAAG,MAAM,uBAO1J;AAED,wBAAgB,QAAQ,CAAE,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE;IAAE,WAAW,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;;EA4D9K;AAED,wBAAgB,kBAAkB,CAAE,cAAc,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,SAClD,MAAM,WAAW,GAAG,SAa9D"}
|
|
@@ -280,8 +280,8 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
const setKeyboardAvoidContext = () => {
|
|
283
|
-
if (
|
|
284
|
-
keyboardAvoid.current = { cursorSpacing, ref: nodeRef }
|
|
283
|
+
if (keyboardAvoid) {
|
|
284
|
+
keyboardAvoid.current = { cursorSpacing, ref: nodeRef, adjustPosition }
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -295,20 +295,45 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
const onFocus = (evt: NativeSyntheticEvent<TextInputFocusEventData>) => {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
298
|
+
if (!keyboardAvoid?.current) {
|
|
299
|
+
setKeyboardAvoidContext()
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (bindfocus) {
|
|
303
|
+
const focusAction = () => {
|
|
304
|
+
bindfocus(
|
|
305
|
+
getCustomEvent(
|
|
306
|
+
'focus',
|
|
307
|
+
evt,
|
|
308
|
+
{
|
|
309
|
+
detail: {
|
|
310
|
+
value: tmpValue.current || '',
|
|
311
|
+
height: keyboardAvoid?.current?.keyboardHeight
|
|
312
|
+
},
|
|
313
|
+
layoutRef
|
|
314
|
+
},
|
|
315
|
+
props
|
|
316
|
+
)
|
|
317
|
+
)
|
|
318
|
+
if (keyboardAvoid?.current?.onKeyboardShow) {
|
|
319
|
+
keyboardAvoid.current.onKeyboardShow = undefined
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (keyboardAvoid?.current) {
|
|
323
|
+
// 有 keyboardAvoiding
|
|
324
|
+
if (keyboardAvoid.current.keyboardHeight) {
|
|
325
|
+
// iOS: keyboard 获取高度时机 keyboardWillShow 在 input focus 之前,可以立即执行
|
|
326
|
+
focusAction()
|
|
327
|
+
} else {
|
|
328
|
+
// Android,Harmony: keyboard 获取高度时机 keyboardDidShow 在 input focus 之后,需要延迟回调
|
|
329
|
+
evt.persist()
|
|
330
|
+
keyboardAvoid.current.onKeyboardShow = focusAction
|
|
331
|
+
}
|
|
332
|
+
} else {
|
|
333
|
+
// 无 keyboardAvoiding,直接执行 focus 回调
|
|
334
|
+
focusAction()
|
|
335
|
+
}
|
|
336
|
+
}
|
|
312
337
|
}
|
|
313
338
|
|
|
314
339
|
const onBlur = (evt: NativeSyntheticEvent<TextInputFocusEventData>) => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/* eslint-disable space-before-function-paren */
|
|
1
2
|
import React, { ReactNode, useContext, useEffect, useRef } from 'react'
|
|
2
3
|
import { DimensionValue, EmitterSubscription, Keyboard, View, ViewStyle, NativeSyntheticEvent, NativeTouchEvent } from 'react-native'
|
|
3
4
|
import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing, cancelAnimation } from 'react-native-reanimated'
|
|
4
5
|
import { KeyboardAvoidContext } from './context'
|
|
5
|
-
import { isIOS } from './utils'
|
|
6
|
+
import { isAndroid, isIOS } from './utils'
|
|
6
7
|
|
|
7
8
|
type KeyboardAvoidViewProps = {
|
|
8
9
|
children?: ReactNode
|
|
@@ -24,7 +25,8 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
|
|
|
24
25
|
const isShow = useRef<boolean>(false)
|
|
25
26
|
|
|
26
27
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
27
|
-
|
|
28
|
+
// translate/position top可能会导致底部渲染区域缺失
|
|
29
|
+
marginTop: -offset.value,
|
|
28
30
|
flexBasis: basic.value as DimensionValue
|
|
29
31
|
}))
|
|
30
32
|
|
|
@@ -36,6 +38,11 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
|
|
|
36
38
|
isShow.current = false
|
|
37
39
|
|
|
38
40
|
if (keyboardAvoid?.current) {
|
|
41
|
+
const inputRef = keyboardAvoid.current.ref?.current
|
|
42
|
+
if (inputRef && inputRef.isFocused()) {
|
|
43
|
+
// 修复 Android 点击键盘收起按钮时当前 input 没触发失焦的问题
|
|
44
|
+
inputRef.blur()
|
|
45
|
+
}
|
|
39
46
|
keyboardAvoid.current = null
|
|
40
47
|
}
|
|
41
48
|
|
|
@@ -53,65 +60,55 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
|
|
|
53
60
|
useEffect(() => {
|
|
54
61
|
let subscriptions: EmitterSubscription[] = []
|
|
55
62
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
function keybaordAvoding(evt: any) {
|
|
64
|
+
if (!keyboardAvoid?.current || isShow.current) {
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
isShow.current = true
|
|
69
|
+
|
|
70
|
+
const { endCoordinates } = evt
|
|
71
|
+
const { ref, cursorSpacing = 0, adjustPosition, onKeyboardShow } = keyboardAvoid.current
|
|
72
|
+
keyboardAvoid.current.keyboardHeight = endCoordinates.height
|
|
73
|
+
onKeyboardShow?.()
|
|
74
|
+
if (adjustPosition) {
|
|
75
|
+
// 默认沿用旧版本逻辑,在 android 原生关闭键盘避让的情况下应该将该配置设置为 false,走 mpx 的键盘避让逻辑,否则bundle内的所有input都会无法避让键盘
|
|
76
|
+
const enableNativeKeyboardAvoiding = mpxGlobal?.__mpx?.config?.rnConfig?.enableNativeKeyboardAvoiding ?? true
|
|
77
|
+
const callback = () => {
|
|
78
|
+
ref?.current?.measure((x: number, y: number, width: number, height: number, pageX: number, pageY: number) => {
|
|
79
|
+
function calculateOffset() {
|
|
80
|
+
// enableNativeKeyboardAvoding 默认开启
|
|
81
|
+
if (enableNativeKeyboardAvoiding && isAndroid) {
|
|
82
|
+
const aboveOffset = pageY + height - endCoordinates.screenY
|
|
83
|
+
const belowOffset = endCoordinates.height - aboveOffset
|
|
84
|
+
const aboveValue = -aboveOffset >= cursorSpacing ? 0 : aboveOffset + cursorSpacing
|
|
85
|
+
const belowValue = Math.min(belowOffset, cursorSpacing)
|
|
86
|
+
return aboveOffset > 0 ? belowValue : aboveValue
|
|
87
|
+
}
|
|
67
88
|
|
|
68
|
-
setTimeout(() => {
|
|
69
|
-
ref?.current?.measure((x: number, y: number, width: number, height: number, pageX: number, pageY: number) => {
|
|
70
89
|
const aboveOffset = offset.value + pageY + height - endCoordinates.screenY
|
|
71
90
|
const aboveValue = -aboveOffset >= cursorSpacing ? 0 : aboveOffset + cursorSpacing
|
|
72
91
|
const belowValue = Math.min(endCoordinates.height, aboveOffset + cursorSpacing)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
offset.value = withTiming(value, { duration, easing }, (finished) => {
|
|
76
|
-
if (finished) {
|
|
77
|
-
// Set flexBasic after animation to trigger re-layout and reset layout information
|
|
78
|
-
basic.value = '99.99%'
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
}),
|
|
84
|
-
Keyboard.addListener('keyboardWillHide', resetKeyboard)
|
|
85
|
-
]
|
|
86
|
-
} else {
|
|
87
|
-
subscriptions = [
|
|
88
|
-
Keyboard.addListener('keyboardDidShow', (evt: any) => {
|
|
89
|
-
if (!keyboardAvoid?.current || isShow.current) {
|
|
90
|
-
return
|
|
91
|
-
}
|
|
92
|
+
return aboveOffset > 0 ? belowValue : aboveValue
|
|
93
|
+
}
|
|
92
94
|
|
|
93
|
-
isShow.current = true
|
|
94
|
-
|
|
95
|
-
const { endCoordinates } = evt
|
|
96
|
-
const { ref, cursorSpacing = 0 } = keyboardAvoid.current
|
|
97
|
-
|
|
98
|
-
ref?.current?.measure((x: number, y: number, width: number, height: number, pageX: number, pageY: number) => {
|
|
99
|
-
const aboveOffset = pageY + height - endCoordinates.screenY
|
|
100
|
-
const belowOffset = endCoordinates.height - aboveOffset
|
|
101
|
-
const aboveValue = -aboveOffset >= cursorSpacing ? 0 : aboveOffset + cursorSpacing
|
|
102
|
-
const belowValue = Math.min(belowOffset, cursorSpacing)
|
|
103
|
-
const value = aboveOffset > 0 ? belowValue : aboveValue
|
|
104
95
|
cancelAnimation(offset)
|
|
105
|
-
offset.value = withTiming(
|
|
96
|
+
offset.value = withTiming(calculateOffset(), { duration, easing }, finished => {
|
|
106
97
|
if (finished) {
|
|
107
98
|
// Set flexBasic after animation to trigger re-layout and reset layout information
|
|
108
99
|
basic.value = '99.99%'
|
|
109
100
|
}
|
|
110
101
|
})
|
|
111
102
|
})
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
}
|
|
104
|
+
;(isIOS ? () => setTimeout(callback) : callback)()
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (isIOS) {
|
|
109
|
+
subscriptions = [Keyboard.addListener('keyboardWillShow', keybaordAvoding), Keyboard.addListener('keyboardWillHide', resetKeyboard)]
|
|
110
|
+
} else {
|
|
111
|
+
subscriptions = [Keyboard.addListener('keyboardDidShow', keybaordAvoding), Keyboard.addListener('keyboardDidHide', resetKeyboard)]
|
|
115
112
|
}
|
|
116
113
|
|
|
117
114
|
return () => {
|
|
@@ -120,15 +117,8 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
|
|
|
120
117
|
}, [keyboardAvoid])
|
|
121
118
|
|
|
122
119
|
return (
|
|
123
|
-
<View style={style} onTouchEnd={onTouchEnd}>
|
|
124
|
-
<Animated.View
|
|
125
|
-
style={[
|
|
126
|
-
contentContainerStyle,
|
|
127
|
-
animatedStyle
|
|
128
|
-
]}
|
|
129
|
-
>
|
|
130
|
-
{children}
|
|
131
|
-
</Animated.View>
|
|
120
|
+
<View style={style} onTouchEnd={onTouchEnd} onTouchMove={onTouchEnd}>
|
|
121
|
+
<Animated.View style={[contentContainerStyle, animatedStyle]}>{children}</Animated.View>
|
|
132
122
|
</View>
|
|
133
123
|
)
|
|
134
124
|
}
|