uilib-native 4.2.0 → 4.4.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/components/DynamicFonts/FontDownloader.d.ts +41 -0
- package/components/DynamicFonts/{FontDownloader.ts → FontDownloader.js} +33 -67
- package/components/DynamicFonts/FontLoader.d.ts +35 -0
- package/components/DynamicFonts/{FontLoader.ts → FontLoader.js} +20 -54
- package/components/DynamicFonts/NoPermissionsAcquirer.d.ts +3 -0
- package/components/DynamicFonts/{NoPermissionsAcquirer.ts → NoPermissionsAcquirer.js} +2 -2
- package/components/DynamicFonts/PermissionsAcquirer.android.d.ts +13 -0
- package/components/DynamicFonts/{PermissionsAcquirer.android.ts → PermissionsAcquirer.android.js} +8 -24
- package/components/DynamicFonts/PermissionsAcquirer.ios.js +2 -0
- package/components/DynamicFonts/{PermissionsAcquirer.ios.ts → PermissionsAcquirer.web.d.ts} +0 -1
- package/components/DynamicFonts/PermissionsAcquirer.web.js +2 -0
- package/components/DynamicFonts/RNFSPackage.d.ts +2 -0
- package/components/DynamicFonts/RNFSPackage.js +5 -0
- package/components/DynamicFonts/index.d.ts +61 -0
- package/components/DynamicFonts/index.js +154 -0
- package/components/HighlighterOverlayView.js +40 -0
- package/components/HighlighterOverlayView.web.js +15 -0
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.d.ts +7 -0
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.js +28 -0
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.ios.d.ts +19 -0
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/{CustomKeyboardView.ios.tsx → CustomKeyboardView.ios.js} +25 -33
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/index.d.ts +4 -0
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/index.js +10 -0
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/{index.web.tsx → index.web.js} +2 -7
- package/components/Keyboard/KeyboardInput/CustomKeyboardViewBase.d.ts +24 -0
- package/components/Keyboard/KeyboardInput/CustomKeyboardViewBase.js +67 -0
- package/components/Keyboard/KeyboardInput/KeyboardAccessoryView.d.ts +74 -0
- package/components/Keyboard/KeyboardInput/{KeyboardAccessoryView.tsx → KeyboardAccessoryView.js} +24 -104
- package/components/Keyboard/KeyboardInput/KeyboardRegistry.d.ts +71 -0
- package/components/Keyboard/KeyboardInput/{KeyboardRegistry.ts → KeyboardRegistry.js} +28 -19
- package/components/Keyboard/KeyboardInput/TextInputKeyboardManager/TextInputKeyboardManager.android.d.ts +4 -0
- package/components/Keyboard/KeyboardInput/TextInputKeyboardManager/{TextInputKeyboardManager.android.ts → TextInputKeyboardManager.android.js} +2 -5
- package/components/Keyboard/KeyboardInput/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.ts +10 -0
- package/components/Keyboard/KeyboardInput/TextInputKeyboardManager/{TextInputKeyboardManager.ios.ts → TextInputKeyboardManager.ios.js} +15 -15
- package/components/Keyboard/KeyboardInput/TextInputKeyboardManager/index.d.ts +4 -0
- package/components/Keyboard/KeyboardInput/TextInputKeyboardManager/index.js +6 -0
- package/components/Keyboard/KeyboardInput/utils/EventEmitterManager.d.ts +10 -0
- package/components/Keyboard/KeyboardInput/utils/{EventEmitterManager.ts → EventEmitterManager.js} +8 -14
- package/components/Keyboard/KeyboardInput/utils/KeyboardUtils.d.ts +11 -0
- package/components/Keyboard/KeyboardInput/utils/{KeyboardUtils.ts → KeyboardUtils.js} +3 -3
- package/components/Keyboard/KeyboardTracking/KeyboardAwareInsetsView.d.ts +16 -0
- package/components/Keyboard/KeyboardTracking/{KeyboardAwareInsetsView.tsx → KeyboardAwareInsetsView.js} +11 -13
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/KeyboardTrackingView.android.d.ts +12 -0
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/KeyboardTrackingView.android.js +17 -0
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/KeyboardTrackingView.ios.d.ts +24 -0
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/{KeyboardTrackingView.ios.tsx → KeyboardTrackingView.ios.js} +5 -14
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/index.d.ts +81 -0
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/index.js +22 -0
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/{index.web.tsx → index.web.js} +2 -6
- package/components/Keyboard/index.d.ts +40 -0
- package/components/Keyboard/index.js +13 -0
- package/components/SafeArea/SafeAreaInsetsManager.d.ts +20 -0
- package/components/SafeArea/{SafeAreaInsetsManager.ts → SafeAreaInsetsManager.js} +23 -26
- package/components/SafeArea/SafeAreaSpacerView.d.ts +10 -0
- package/components/SafeArea/SafeAreaSpacerView.js +14 -0
- package/components/SafeArea/SafeAreaSpacerView.web.d.ts +10 -0
- package/components/SafeArea/SafeAreaSpacerView.web.js +9 -0
- package/components/index.js +6 -0
- package/package.json +8 -3
- package/react-native.config.js +22 -0
- package/scripts/releaseNative.js +56 -0
- package/android/build/.transforms/693a7b223f458db1594dd91fc3a98873/results.bin +0 -1
- package/android/build/.transforms/693a7b223f458db1594dd91fc3a98873/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/919c4721f192d8eb61942547d8ca6581/results.bin +0 -1
- package/android/build/.transforms/919c4721f192d8eb61942547d8ca6581/transformed/classes/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/wix/reactnativeuilib/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -9
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -1962
- package/android/build/intermediates/compiled_local_resources/debug/out/layout_wheel_picker.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -2
- package/android/build/intermediates/incremental/debug/packageDebugResources/merged.dir/values/values.xml +0 -15
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -7
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/UiLibPackageList.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/dynamicfont/DynamicFontModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/dynamicfont/DynamicFontPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/HighlightFrame.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/HighlightViewTagParams.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/HighlighterView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/HighlighterViewPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/ReactHacks.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/ReflectionUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/highlighterview/UiUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/AppContextHolder$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/AppContextHolder.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout$5.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewShadow.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/KeyboardInputModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/KeyboardInputPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/ReactContextHolder.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor$Listener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor$Listener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/utils/PredicateFunc.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/utils/ViewUtils$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/utils/ViewUtils$VisibleViewClassMatchPredicate.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/keyboardinput/utils/ViewUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/textinput/DefaultKeyListener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/textinput/KeyListenerProxy.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/textinput/ViewUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/utils/LogForwarder$LogType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/wix/reactnativeuilib/utils/LogForwarder.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -11
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -11
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -9
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
- package/android/build/intermediates/packaged_res/debug/layout/wheel_picker.xml +0 -9
- package/android/build/intermediates/packaged_res/debug/values/values.xml +0 -15
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1455
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -25
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/components/DynamicFonts/RNFSPackage.ts +0 -6
- package/components/DynamicFonts/index.ts +0 -194
- package/components/HighlighterOverlayView.tsx +0 -90
- package/components/HighlighterOverlayView.web.tsx +0 -58
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.tsx +0 -31
- package/components/Keyboard/KeyboardInput/CustomKeyboardView/index.tsx +0 -16
- package/components/Keyboard/KeyboardInput/CustomKeyboardViewBase.tsx +0 -83
- package/components/Keyboard/KeyboardInput/TextInputKeyboardManager/index.ts +0 -9
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/KeyboardTrackingView.android.tsx +0 -15
- package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/index.tsx +0 -96
- package/components/Keyboard/index.ts +0 -15
- package/components/SafeArea/SafeAreaSpacerView.tsx +0 -19
- package/components/SafeArea/SafeAreaSpacerView.web.tsx +0 -14
- package/components/index.ts +0 -16
- /package/components/DynamicFonts/{PermissionsAcquirer.web.ts → PermissionsAcquirer.ios.d.ts} +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {StyleSheet, Dimensions} from 'react-native';
|
|
3
|
-
import KeyboardTrackingView
|
|
4
|
-
|
|
5
|
-
type Props = KeyboardTrackingViewProps & {
|
|
6
|
-
offset?: number;
|
|
7
|
-
}
|
|
2
|
+
import { StyleSheet, Dimensions } from 'react-native';
|
|
3
|
+
import KeyboardTrackingView from "./KeyboardTrackingView";
|
|
8
4
|
/**
|
|
9
5
|
* @description: Used to add an inset when a keyboard is used and might hide part of the screen.
|
|
10
6
|
*
|
|
11
7
|
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TextFieldScreen/InputsScreen.js
|
|
12
8
|
* @notes: This view is useful only for iOS.
|
|
13
9
|
*/
|
|
14
|
-
const KeyboardAwareInsetsView =
|
|
15
|
-
const {
|
|
16
|
-
|
|
10
|
+
const KeyboardAwareInsetsView = props => {
|
|
11
|
+
const {
|
|
12
|
+
offset = 0.5,
|
|
13
|
+
...others
|
|
14
|
+
} = props;
|
|
15
|
+
return <KeyboardTrackingView {...others} pointerEvents={'none'} style={[styles.insetsView, {
|
|
16
|
+
height: offset
|
|
17
|
+
}]} scrollToFocusedInput />;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
19
|
const ScreenSize = Dimensions.get('window');
|
|
20
20
|
const styles = StyleSheet.create({
|
|
21
21
|
insetsView: {
|
|
@@ -27,7 +27,5 @@ const styles = StyleSheet.create({
|
|
|
27
27
|
backgroundColor: 'transparent'
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
|
|
31
30
|
KeyboardAwareInsetsView.displayName = 'KeyboardAwareInsetsView';
|
|
32
|
-
|
|
33
|
-
export default KeyboardAwareInsetsView;
|
|
31
|
+
export default KeyboardAwareInsetsView;
|
package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/KeyboardTrackingView.android.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
declare class KeyboardTrackingView extends PureComponent {
|
|
3
|
+
static displayName: string;
|
|
4
|
+
render(): React.JSX.Element;
|
|
5
|
+
getNativeProps(): Promise<{
|
|
6
|
+
trackingViewHeight: number;
|
|
7
|
+
keyboardHeight: number;
|
|
8
|
+
contentTopInset: number;
|
|
9
|
+
}>;
|
|
10
|
+
scrollToStart(): void;
|
|
11
|
+
}
|
|
12
|
+
export default KeyboardTrackingView;
|
package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/KeyboardTrackingView.android.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
class KeyboardTrackingView extends PureComponent {
|
|
4
|
+
static displayName = 'IGNORE';
|
|
5
|
+
render() {
|
|
6
|
+
return <View {...this.props} />;
|
|
7
|
+
}
|
|
8
|
+
async getNativeProps() {
|
|
9
|
+
return {
|
|
10
|
+
trackingViewHeight: 0,
|
|
11
|
+
keyboardHeight: 0,
|
|
12
|
+
contentTopInset: 0
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
scrollToStart() {}
|
|
16
|
+
}
|
|
17
|
+
export default KeyboardTrackingView;
|
package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/KeyboardTrackingView.ios.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by artald on 15/05/2016.
|
|
3
|
+
*/
|
|
4
|
+
import React, { PureComponent } from 'react';
|
|
5
|
+
import { KeyboardTrackingViewProps } from './index';
|
|
6
|
+
/**
|
|
7
|
+
* @description: A UI component that enables “keyboard tracking" for this view and it's sub-views.
|
|
8
|
+
* Would typically be used when you have a TextField or TextInput inside this view.
|
|
9
|
+
*
|
|
10
|
+
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/KeyboardTrackingViewScreen.js
|
|
11
|
+
* @notes: This view is useful only for iOS.
|
|
12
|
+
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/KeyboardTrackingView/KeyboardTrackingView.gif?raw=true
|
|
13
|
+
*/
|
|
14
|
+
declare class KeyboardTrackingView extends PureComponent<KeyboardTrackingViewProps> {
|
|
15
|
+
static displayName: string;
|
|
16
|
+
static defaultProps: {
|
|
17
|
+
useSafeArea: boolean;
|
|
18
|
+
};
|
|
19
|
+
ref?: any;
|
|
20
|
+
render(): React.JSX.Element;
|
|
21
|
+
getNativeProps(): Promise<any>;
|
|
22
|
+
scrollToStart(): void;
|
|
23
|
+
}
|
|
24
|
+
export default KeyboardTrackingView;
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
* Created by artald on 15/05/2016.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import React, {PureComponent} from 'react';
|
|
6
|
-
import ReactNative, {requireNativeComponent, NativeModules} from 'react-native';
|
|
7
|
-
import {KeyboardTrackingViewProps} from './index';
|
|
8
|
-
|
|
5
|
+
import React, { PureComponent } from 'react';
|
|
6
|
+
import ReactNative, { requireNativeComponent, NativeModules } from 'react-native';
|
|
9
7
|
const NativeKeyboardTrackingView = requireNativeComponent('KeyboardTrackingViewTemp');
|
|
10
8
|
const KeyboardTrackingViewTempManager = NativeModules.KeyboardTrackingViewTempManager;
|
|
11
9
|
|
|
@@ -17,31 +15,24 @@ const KeyboardTrackingViewTempManager = NativeModules.KeyboardTrackingViewTempMa
|
|
|
17
15
|
* @notes: This view is useful only for iOS.
|
|
18
16
|
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/KeyboardTrackingView/KeyboardTrackingView.gif?raw=true
|
|
19
17
|
*/
|
|
20
|
-
class KeyboardTrackingView extends PureComponent
|
|
18
|
+
class KeyboardTrackingView extends PureComponent {
|
|
21
19
|
static displayName = 'KeyboardTrackingView';
|
|
22
|
-
|
|
23
20
|
static defaultProps = {
|
|
24
21
|
useSafeArea: false
|
|
25
22
|
};
|
|
26
|
-
|
|
27
|
-
ref?: any;
|
|
28
|
-
|
|
29
23
|
render() {
|
|
30
|
-
return <NativeKeyboardTrackingView {...this.props} ref={r =>
|
|
24
|
+
return <NativeKeyboardTrackingView {...this.props} ref={r => this.ref = r} />;
|
|
31
25
|
}
|
|
32
|
-
|
|
33
26
|
async getNativeProps() {
|
|
34
27
|
if (this.ref && KeyboardTrackingViewTempManager && KeyboardTrackingViewTempManager.getNativeProps) {
|
|
35
28
|
return await KeyboardTrackingViewTempManager.getNativeProps(ReactNative.findNodeHandle(this.ref));
|
|
36
29
|
}
|
|
37
30
|
return {};
|
|
38
31
|
}
|
|
39
|
-
|
|
40
32
|
scrollToStart() {
|
|
41
33
|
if (this.ref && KeyboardTrackingViewTempManager && KeyboardTrackingViewTempManager.scrollToStart) {
|
|
42
34
|
KeyboardTrackingViewTempManager.scrollToStart(ReactNative.findNodeHandle(this.ref));
|
|
43
35
|
}
|
|
44
36
|
}
|
|
45
37
|
}
|
|
46
|
-
|
|
47
|
-
export default KeyboardTrackingView;
|
|
38
|
+
export default KeyboardTrackingView;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle, ViewProps } from 'react-native';
|
|
3
|
+
declare const SCROLL_BEHAVIORS: {
|
|
4
|
+
NONE: any;
|
|
5
|
+
SCROLL_TO_BOTTOM_INVERTED_ONLY: any;
|
|
6
|
+
FIXED_OFFSET: any;
|
|
7
|
+
};
|
|
8
|
+
export type KeyboardTrackingViewProps = ViewProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Enables tracking of the keyboard when it's dismissed interactively (false by default).
|
|
11
|
+
* Why? When using an external keyboard (BT),
|
|
12
|
+
* you still get the keyboard events and the view just hovers when you focus the input.
|
|
13
|
+
* Also, if you're not using interactive style of dismissing the keyboard
|
|
14
|
+
* (or if you don't have an input inside this view) it doesn't make sense to track it anyway.
|
|
15
|
+
* (This is caused because of the usage of inputAccessory to be able to track the
|
|
16
|
+
* keyboard interactive change and it introduces this bug)
|
|
17
|
+
*/
|
|
18
|
+
trackInteractive?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* iOS only.
|
|
21
|
+
* Show the keyboard on a negative scroll
|
|
22
|
+
* default: false
|
|
23
|
+
*/
|
|
24
|
+
revealKeyboardInteractive?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* iOS only.
|
|
27
|
+
* Set to false to turn off inset management and manage it yourself
|
|
28
|
+
* default: true
|
|
29
|
+
*/
|
|
30
|
+
manageScrollView?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* iOS only.
|
|
33
|
+
* Set to true manageScrollView is set to true and still does not work,
|
|
34
|
+
* it means that the ScrollView found is the wrong one and you'll have
|
|
35
|
+
* to have the KeyboardAccessoryView and the ScrollView as siblings
|
|
36
|
+
* and set this to true
|
|
37
|
+
*
|
|
38
|
+
* default: false
|
|
39
|
+
*/
|
|
40
|
+
requiresSameParentToManageScrollView?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* iOS only.
|
|
43
|
+
* Allow hitting sub-views that are placed beyond the view bounds
|
|
44
|
+
*
|
|
45
|
+
* default: false
|
|
46
|
+
*/
|
|
47
|
+
allowHitsOutsideBounds?: boolean;
|
|
48
|
+
scrollToFocusedInput?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* iOS only.
|
|
51
|
+
* The scrolling behavior (NONE | SCROLL_TO_BOTTOM_INVERTED_ONLY | FIXED_OFFSET)
|
|
52
|
+
*/
|
|
53
|
+
scrollBehavior?: number;
|
|
54
|
+
/**
|
|
55
|
+
* iOS only.
|
|
56
|
+
* Add a SafeArea view beneath the KeyboardAccessoryView
|
|
57
|
+
* default: false
|
|
58
|
+
*/
|
|
59
|
+
addBottomView?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* iOS only.
|
|
62
|
+
* The bottom view's color
|
|
63
|
+
* default: 'white'
|
|
64
|
+
*/
|
|
65
|
+
bottomViewColor?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Allow control safe area
|
|
68
|
+
*/
|
|
69
|
+
useSafeArea?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether or not to include bottom tab bar inset
|
|
72
|
+
*/
|
|
73
|
+
usesBottomTabs?: boolean;
|
|
74
|
+
ref?: any;
|
|
75
|
+
style?: ViewStyle;
|
|
76
|
+
children?: React.ReactChild | React.ReactChild[];
|
|
77
|
+
};
|
|
78
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<KeyboardTrackingViewProps, "ref"> & React.RefAttributes<unknown>> & {
|
|
79
|
+
scrollBehaviors: typeof SCROLL_BEHAVIORS;
|
|
80
|
+
};
|
|
81
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Platform, NativeModules } from 'react-native';
|
|
3
|
+
import { default as KeyboardTrackingViewIOS } from "./KeyboardTrackingView.ios";
|
|
4
|
+
import { default as KeyboardTrackingViewAndroid } from "./KeyboardTrackingView.android";
|
|
5
|
+
const isAndroid = Platform.OS === 'android';
|
|
6
|
+
const SCROLL_BEHAVIORS = {
|
|
7
|
+
NONE: NativeModules.KeyboardTrackingViewTempManager?.KeyboardTrackingScrollBehaviorNone,
|
|
8
|
+
SCROLL_TO_BOTTOM_INVERTED_ONLY: NativeModules.KeyboardTrackingViewTempManager?.KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly,
|
|
9
|
+
FIXED_OFFSET: NativeModules.KeyboardTrackingViewTempManager?.KeyboardTrackingScrollBehaviorFixedOffset
|
|
10
|
+
};
|
|
11
|
+
const KeyboardTrackingView = forwardRef(({
|
|
12
|
+
children,
|
|
13
|
+
...others
|
|
14
|
+
}, ref) => {
|
|
15
|
+
const KeyboardTrackingViewContainer = isAndroid ? KeyboardTrackingViewAndroid : KeyboardTrackingViewIOS;
|
|
16
|
+
return <KeyboardTrackingViewContainer {...others} ref={ref}>
|
|
17
|
+
{children}
|
|
18
|
+
</KeyboardTrackingViewContainer>;
|
|
19
|
+
});
|
|
20
|
+
export default KeyboardTrackingView;
|
|
21
|
+
// @ts-expect-error
|
|
22
|
+
KeyboardTrackingView.scrollBehaviors = SCROLL_BEHAVIORS;
|
package/components/Keyboard/KeyboardTracking/KeyboardTrackingView/{index.web.tsx → index.web.js}
RENAMED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
|
|
3
2
|
console.log('KeyboardTrackingView not supported on web');
|
|
4
3
|
const KeyboardTrackingView = () => {
|
|
5
|
-
return
|
|
6
|
-
);
|
|
4
|
+
return null;
|
|
7
5
|
};
|
|
8
|
-
|
|
9
6
|
export default KeyboardTrackingView;
|
|
10
|
-
|
|
11
|
-
KeyboardTrackingView.scrollBehaviors = {};
|
|
7
|
+
KeyboardTrackingView.scrollBehaviors = {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { KeyboardTrackingViewProps } from './KeyboardTracking/KeyboardTrackingView';
|
|
3
|
+
import KeyboardRegistry from './KeyboardInput/KeyboardRegistry';
|
|
4
|
+
import KeyboardAccessoryView, { KeyboardAccessoryViewProps } from './KeyboardInput/KeyboardAccessoryView';
|
|
5
|
+
import KeyboardUtils from './KeyboardInput/utils/KeyboardUtils';
|
|
6
|
+
export { KeyboardTrackingViewProps, KeyboardAccessoryViewProps };
|
|
7
|
+
declare const _default: {
|
|
8
|
+
KeyboardTrackingView: import("react").ForwardRefExoticComponent<Omit<KeyboardTrackingViewProps, "ref"> & import("react").RefAttributes<unknown>> & {
|
|
9
|
+
scrollBehaviors: {
|
|
10
|
+
NONE: any;
|
|
11
|
+
SCROLL_TO_BOTTOM_INVERTED_ONLY: any;
|
|
12
|
+
FIXED_OFFSET: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
KeyboardAwareInsetsView: {
|
|
16
|
+
(props: import("react-native/types").ViewProps & {
|
|
17
|
+
trackInteractive?: boolean | undefined;
|
|
18
|
+
revealKeyboardInteractive?: boolean | undefined;
|
|
19
|
+
manageScrollView?: boolean | undefined;
|
|
20
|
+
requiresSameParentToManageScrollView?: boolean | undefined;
|
|
21
|
+
allowHitsOutsideBounds?: boolean | undefined;
|
|
22
|
+
scrollToFocusedInput?: boolean | undefined;
|
|
23
|
+
scrollBehavior?: number | undefined;
|
|
24
|
+
addBottomView?: boolean | undefined;
|
|
25
|
+
bottomViewColor?: string | undefined;
|
|
26
|
+
useSafeArea?: boolean | undefined;
|
|
27
|
+
usesBottomTabs?: boolean | undefined;
|
|
28
|
+
ref?: any;
|
|
29
|
+
style?: import("react-native/types").ViewStyle | undefined;
|
|
30
|
+
children?: import("react").ReactChild | import("react").ReactChild[] | undefined;
|
|
31
|
+
} & {
|
|
32
|
+
offset?: number | undefined;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
KeyboardRegistry: typeof KeyboardRegistry;
|
|
37
|
+
KeyboardAccessoryView: typeof KeyboardAccessoryView;
|
|
38
|
+
KeyboardUtils: typeof KeyboardUtils;
|
|
39
|
+
};
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import KeyboardTrackingView, { KeyboardTrackingViewProps } from "./KeyboardTracking/KeyboardTrackingView";
|
|
2
|
+
import KeyboardAwareInsetsView from "./KeyboardTracking/KeyboardAwareInsetsView";
|
|
3
|
+
import KeyboardRegistry from "./KeyboardInput/KeyboardRegistry";
|
|
4
|
+
import KeyboardAccessoryView, { KeyboardAccessoryViewProps } from "./KeyboardInput/KeyboardAccessoryView";
|
|
5
|
+
import KeyboardUtils from "./KeyboardInput/utils/KeyboardUtils";
|
|
6
|
+
export { KeyboardTrackingViewProps, KeyboardAccessoryViewProps };
|
|
7
|
+
export default {
|
|
8
|
+
KeyboardTrackingView,
|
|
9
|
+
KeyboardAwareInsetsView,
|
|
10
|
+
KeyboardRegistry,
|
|
11
|
+
KeyboardAccessoryView,
|
|
12
|
+
KeyboardUtils
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type SafeAreaInsetsType = {
|
|
2
|
+
top: number;
|
|
3
|
+
left: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
right: number;
|
|
6
|
+
} | null;
|
|
7
|
+
declare class SafeAreaInsetsManager {
|
|
8
|
+
_defaultInsets: SafeAreaInsetsType;
|
|
9
|
+
_safeAreaInsets: SafeAreaInsetsType;
|
|
10
|
+
_safeAreaChangedDelegates: Array<any>;
|
|
11
|
+
constructor();
|
|
12
|
+
addSafeAreaChangedListener(): void;
|
|
13
|
+
_updateInsets(): Promise<void>;
|
|
14
|
+
getSafeAreaInsets(): Promise<SafeAreaInsetsType>;
|
|
15
|
+
addSafeAreaChangedDelegate(delegate: any): void;
|
|
16
|
+
removeSafeAreaChangedDelegate(delegateToRemove: any): void;
|
|
17
|
+
get defaultInsets(): SafeAreaInsetsType;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: SafeAreaInsetsManager;
|
|
20
|
+
export default _default;
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
+
import _remove from "lodash/remove";
|
|
2
|
+
import _forEach from "lodash/forEach";
|
|
1
3
|
/* eslint no-underscore-dangle: 0 */
|
|
2
4
|
|
|
3
|
-
import {NativeModules, NativeEventEmitter} from 'react-native';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type SafeAreaInsetsType = { top: number; left: number; bottom: number; right: number; } | null
|
|
7
|
-
|
|
8
|
-
let SafeAreaInsetsCache: SafeAreaInsetsType = null;
|
|
9
|
-
|
|
5
|
+
import { NativeModules, NativeEventEmitter } from 'react-native';
|
|
6
|
+
let SafeAreaInsetsCache = null;
|
|
10
7
|
const NativeSafeAreaManager = NativeModules.SafeAreaManager;
|
|
11
|
-
|
|
12
8
|
class SafeAreaInsetsManager {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
_defaultInsets = {
|
|
10
|
+
top: 0,
|
|
11
|
+
left: 0,
|
|
12
|
+
bottom: 0,
|
|
13
|
+
right: 0
|
|
14
|
+
};
|
|
15
|
+
_safeAreaInsets = {
|
|
16
|
+
top: 0,
|
|
17
|
+
left: 0,
|
|
18
|
+
bottom: 0,
|
|
19
|
+
right: 0
|
|
20
|
+
};
|
|
21
|
+
_safeAreaChangedDelegates = [];
|
|
18
22
|
constructor() {
|
|
19
23
|
this.addSafeAreaChangedListener();
|
|
20
24
|
}
|
|
21
|
-
|
|
22
25
|
addSafeAreaChangedListener() {
|
|
23
26
|
if (!NativeSafeAreaManager) {
|
|
24
27
|
return;
|
|
25
28
|
}
|
|
26
29
|
const NativeSafeAreaEvents = new NativeEventEmitter(NativeSafeAreaManager);
|
|
27
|
-
NativeSafeAreaEvents.addListener('SafeAreaInsetsDidChangeEvent',
|
|
30
|
+
NativeSafeAreaEvents.addListener('SafeAreaInsetsDidChangeEvent', safeAreaInsets => {
|
|
28
31
|
SafeAreaInsetsCache = safeAreaInsets;
|
|
29
32
|
this._safeAreaInsets = SafeAreaInsetsCache;
|
|
30
|
-
|
|
33
|
+
_forEach(this._safeAreaChangedDelegates, delegate => {
|
|
31
34
|
if (delegate.onSafeAreaInsetsDidChangeEvent) {
|
|
32
35
|
delegate.onSafeAreaInsetsDidChangeEvent(this._safeAreaInsets);
|
|
33
36
|
} else {
|
|
@@ -36,32 +39,26 @@ class SafeAreaInsetsManager {
|
|
|
36
39
|
});
|
|
37
40
|
});
|
|
38
41
|
}
|
|
39
|
-
|
|
40
42
|
async _updateInsets() {
|
|
41
43
|
if (NativeSafeAreaManager && SafeAreaInsetsCache === null) {
|
|
42
44
|
SafeAreaInsetsCache = await NativeSafeAreaManager.getSafeAreaInsets();
|
|
43
45
|
this._safeAreaInsets = SafeAreaInsetsCache;
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
|
-
|
|
47
48
|
async getSafeAreaInsets() {
|
|
48
49
|
await this._updateInsets();
|
|
49
50
|
return this._safeAreaInsets;
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
addSafeAreaChangedDelegate(delegate: any) {
|
|
52
|
+
addSafeAreaChangedDelegate(delegate) {
|
|
53
53
|
this._safeAreaChangedDelegates.push(delegate);
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
_.remove(this._safeAreaChangedDelegates, (currentDelegate) => {
|
|
55
|
+
removeSafeAreaChangedDelegate(delegateToRemove) {
|
|
56
|
+
_remove(this._safeAreaChangedDelegates, currentDelegate => {
|
|
58
57
|
return currentDelegate === delegateToRemove;
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
|
-
|
|
62
60
|
get defaultInsets() {
|
|
63
61
|
return this._defaultInsets;
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
|
-
|
|
67
|
-
export default new SafeAreaInsetsManager();
|
|
64
|
+
export default new SafeAreaInsetsManager();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
export type SafeAreaSpacerViewProps = {
|
|
4
|
+
style?: ViewStyle;
|
|
5
|
+
};
|
|
6
|
+
declare const SafeAreaSpacerView: {
|
|
7
|
+
({ style }: SafeAreaSpacerViewProps): React.JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export default SafeAreaSpacerView;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, requireNativeComponent, Platform } from 'react-native';
|
|
3
|
+
const NativeSafeAreaSpacerView = requireNativeComponent('SafeAreaSpacerView');
|
|
4
|
+
const isIOS = Platform.OS === 'ios';
|
|
5
|
+
const SafeAreaSpacerView = ({
|
|
6
|
+
style
|
|
7
|
+
}) => {
|
|
8
|
+
return (
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
isIOS ? <NativeSafeAreaSpacerView style={style} /> : <View style={style} />
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
SafeAreaSpacerView.displayName = 'IGNORE';
|
|
14
|
+
export default SafeAreaSpacerView;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
export type SafeAreaSpacerViewProps = {
|
|
4
|
+
style?: ViewStyle;
|
|
5
|
+
};
|
|
6
|
+
declare const SafeAreaSpacerView: {
|
|
7
|
+
({ style }: SafeAreaSpacerViewProps): React.JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export default SafeAreaSpacerView;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import DynamicFonts, { FontExtension } from "./DynamicFonts";
|
|
2
|
+
import HighlighterOverlayView from "./HighlighterOverlayView";
|
|
3
|
+
import SafeAreaSpacerView from "./SafeArea/SafeAreaSpacerView";
|
|
4
|
+
import SafeAreaInsetsManager from "./SafeArea/SafeAreaInsetsManager";
|
|
5
|
+
import Keyboard, { KeyboardTrackingViewProps, KeyboardAccessoryViewProps } from "./Keyboard";
|
|
6
|
+
export { DynamicFonts, FontExtension, HighlighterOverlayView, SafeAreaSpacerView, SafeAreaInsetsManager, Keyboard, KeyboardTrackingViewProps, KeyboardAccessoryViewProps };
|
package/package.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uilib-native",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"homepage": "https://github.com/wix/react-native-ui-lib",
|
|
5
5
|
"description": "uilib native components (separated from js components)",
|
|
6
|
-
"main": "components/index
|
|
7
|
-
"scripts": {
|
|
6
|
+
"main": "components/index",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"releaseNative": "node ./scripts/releaseNative.js"
|
|
9
|
+
},
|
|
8
10
|
"author": "Ethan Sharabi <ethan.shar@gmail.com>",
|
|
9
11
|
"license": "MIT",
|
|
10
12
|
"dependencies": {
|
|
11
13
|
"lodash": "^4.0.0",
|
|
12
14
|
"prop-types": "^15.5.10"
|
|
13
15
|
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"shell-utils": "^1.0.10"
|
|
18
|
+
},
|
|
14
19
|
"peerDependencies": {
|
|
15
20
|
"react": "^16.0.0",
|
|
16
21
|
"react-native": "^0.51.0"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
dependency: {
|
|
3
|
+
platforms: {
|
|
4
|
+
/* TODO: Once we upgrade to RN69 we should try using podspecPath again, for now I copied ReactNativeUiLib.podspec file to the root - it seems to work
|
|
5
|
+
I copied it, because we need it for both the main uilib and the uilib-native package */
|
|
6
|
+
// ios: {
|
|
7
|
+
// podspecPath: './lib/ReactNativeUiLib.podspec'
|
|
8
|
+
// },
|
|
9
|
+
android: {
|
|
10
|
+
sourceDir: './android/',
|
|
11
|
+
packageImportPath: `import com.wix.reactnativeuilib.dynamicfont.DynamicFontPackage;
|
|
12
|
+
import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
|
|
13
|
+
import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
|
|
14
|
+
import com.wix.reactnativeuilib.textinput.TextInputDelKeyHandlerPackage;`,
|
|
15
|
+
packageInstance: `new DynamicFontPackage(),
|
|
16
|
+
new HighlighterViewPackage(),
|
|
17
|
+
new TextInputDelKeyHandlerPackage(),
|
|
18
|
+
new KeyboardInputPackage(getApplication())`
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const exec = require('shell-utils').exec;
|
|
2
|
+
const p = require('path');
|
|
3
|
+
|
|
4
|
+
function run() {
|
|
5
|
+
if (!validateEnv()) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const currentPublished = findCurrentPublishedVersion();
|
|
10
|
+
const packageJson = require('../package.json');
|
|
11
|
+
const newVersion = packageJson.version;
|
|
12
|
+
|
|
13
|
+
if (currentPublished !== newVersion) {
|
|
14
|
+
createNpmRc();
|
|
15
|
+
versionTagAndPublish(currentPublished, newVersion);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function validateEnv() {
|
|
20
|
+
if (!process.env.CI) {
|
|
21
|
+
throw new Error('releasing is only available from CI');
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function createNpmRc() {
|
|
27
|
+
exec.execSync('rm -f package-lock.json');
|
|
28
|
+
const npmrcPath = p.resolve(`${__dirname}/.npmrc`);
|
|
29
|
+
exec.execSync(`cp -rf ${npmrcPath} .`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function versionTagAndPublish(currentPublished, newVersion) {
|
|
33
|
+
console.log(`current published version: ${currentPublished}`);
|
|
34
|
+
console.log(`Publishing version: ${newVersion}`);
|
|
35
|
+
tryPublishAndTag(newVersion);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function findCurrentPublishedVersion() {
|
|
39
|
+
return exec.execSyncRead(`npm view ${process.env.npm_package_name} dist-tags.latest`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function tryPublishAndTag(version) {
|
|
43
|
+
try {
|
|
44
|
+
tagAndPublish(version);
|
|
45
|
+
console.log(`Released ${version}`);
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.log(`Failed to release ${version}`, err);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function tagAndPublish(newVersion) {
|
|
52
|
+
console.log(`Trying to publish ${newVersion}...`);
|
|
53
|
+
exec.execSync(`npm publish`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
run();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
o/classes
|
package/android/build/.transforms/693a7b223f458db1594dd91fc3a98873/transformed/classes/classes.dex
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
o/classes
|
package/android/build/.transforms/919c4721f192d8eb61942547d8ca6581/transformed/classes/classes.dex
DELETED
|
Binary file
|
package/android/build/generated/source/buildConfig/debug/com/wix/reactnativeuilib/BuildConfig.java
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Automatically generated file. DO NOT MODIFY
|
|
3
|
-
*/
|
|
4
|
-
package com.wix.reactnativeuilib;
|
|
5
|
-
|
|
6
|
-
public final class BuildConfig {
|
|
7
|
-
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
|
8
|
-
public static final String LIBRARY_PACKAGE_NAME = "com.wix.reactnativeuilib";
|
|
9
|
-
public static final String BUILD_TYPE = "debug";
|
|
10
|
-
}
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"artifactType": {
|
|
4
|
-
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
|
|
5
|
-
"kind": "Directory"
|
|
6
|
-
},
|
|
7
|
-
"applicationId": "com.wix.reactnativeuilib",
|
|
8
|
-
"variantName": "debug",
|
|
9
|
-
"elements": [
|
|
10
|
-
{
|
|
11
|
-
"type": "SINGLE",
|
|
12
|
-
"filters": [],
|
|
13
|
-
"attributes": [],
|
|
14
|
-
"outputFile": "AndroidManifest.xml"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"elementType": "File"
|
|
18
|
-
}
|
package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|