react-native-ui-lib 7.46.3 → 8.0.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.
Files changed (214) hide show
  1. package/babel.config.js +12 -0
  2. package/incubator.d.ts +2 -2
  3. package/incubator.js +0 -2
  4. package/index.js +1 -0
  5. package/lib/android/build.gradle +5 -5
  6. package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +0 -2
  7. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +31 -23
  8. package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +1 -1
  9. package/lib/components/{HighlighterOverlayView.d.ts → HighlighterOverlayView/index.d.ts} +1 -1
  10. package/lib/components/HighlighterOverlayView/index.js +49 -0
  11. package/lib/components/{HighlighterOverlayView.web.d.ts → HighlighterOverlayView/index.web.d.ts} +1 -1
  12. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.android.d.ts +5 -2
  13. package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.js +51 -0
  14. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.d.ts +1 -1
  15. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.js +3 -3
  16. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.d.ts +3 -0
  17. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.js +1 -1
  18. package/lib/components/Keyboard/{KeyboardInput/utils → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager}/__tests__/EventEmitterManager.spec.js +1 -1
  19. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/__tests__/KeyboardRegistry.spec.js +1 -1
  20. package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.d.ts → KeyboardAccessoryView/KeyboardRegistry/index.d.ts} +1 -1
  21. package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.js → KeyboardAccessoryView/KeyboardRegistry/index.js} +1 -1
  22. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/keyboardRegistry.api.json +9 -9
  23. package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.ts +26 -0
  24. package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.js +91 -0
  25. package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.d.ts → KeyboardAccessoryView/index.d.ts} +11 -1
  26. package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.js → KeyboardAccessoryView/index.js} +31 -5
  27. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/keyboardAccessoryView.api.json +5 -5
  28. package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.d.ts → KeyboardAwareInsetsView/index.d.ts} +1 -1
  29. package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.js → KeyboardAwareInsetsView/index.js} +1 -1
  30. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.d.ts +1 -4
  31. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.js +5 -8
  32. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.d.ts +2 -2
  33. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/keyboardTrackingView.api.json +11 -20
  34. package/lib/components/Keyboard/index.d.ts +6 -6
  35. package/lib/components/Keyboard/index.js +6 -6
  36. package/lib/components/SafeArea/SafeAreaInsetsManager.d.ts +21 -7
  37. package/lib/components/SafeArea/SafeAreaInsetsManager.js +95 -31
  38. package/lib/components/SafeArea/SafeAreaSpacerView.d.ts +2 -2
  39. package/lib/components/SafeArea/SafeAreaSpacerView.js +63 -9
  40. package/lib/components/SafeArea/__tests__/SafeAreaInsetsManager.spec.js +274 -0
  41. package/lib/components/SafeArea/index.d.ts +10 -0
  42. package/lib/components/SafeArea/index.js +11 -0
  43. package/lib/components/index.d.ts +1 -1
  44. package/lib/components/index.js +1 -1
  45. package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +56 -8
  46. package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +1 -7
  47. package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +1 -1
  48. package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +134 -44
  49. package/lib/package.json +3 -3
  50. package/lib/react-native.config.js +1 -3
  51. package/metro.config.js +2 -2
  52. package/package.json +33 -32
  53. package/panView.d.ts +2 -0
  54. package/panView.js +1 -0
  55. package/scripts/release/prReleaseNotesCommon.js +15 -4
  56. package/src/commons/Constants.js +2 -5
  57. package/src/commons/modifiers.d.ts +1 -0
  58. package/src/commons/modifiers.js +5 -2
  59. package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +5 -1
  60. package/src/components/actionSheet/index.d.ts +2 -12
  61. package/src/components/actionSheet/index.js +3 -42
  62. package/src/components/animatedImage/index.js +12 -2
  63. package/src/components/badge/index.d.ts +107 -47
  64. package/src/components/button/button.api.json +1 -1
  65. package/src/components/button/index.d.ts +53 -23
  66. package/src/components/button/types.d.ts +0 -1
  67. package/src/components/colorPicker/ColorPickerDialog.d.ts +1 -1
  68. package/src/components/colorPicker/ColorPickerDialog.js +1 -1
  69. package/src/components/dateTimePicker/index.d.ts +186 -5
  70. package/src/components/dateTimePicker/index.js +3 -4
  71. package/src/components/dialog/dialog.api.json +34 -35
  72. package/src/{incubator → components}/dialog/dialogHeader.api.json +2 -2
  73. package/src/components/dialog/index.d.ts +13 -105
  74. package/src/components/dialog/index.js +205 -212
  75. package/src/{incubator → components}/dialog/types.d.ts +7 -19
  76. package/src/{incubator → components}/dialog/types.js +1 -3
  77. package/src/{incubator → components}/dialog/useDialogContent.d.ts +1 -1
  78. package/src/components/drawer/Swipeable.js +1 -2
  79. package/src/components/drawer/index.js +31 -25
  80. package/src/components/fadedScrollView/index.js +7 -2
  81. package/src/components/featureHighlight/index.d.ts +1 -1
  82. package/src/components/hint/index.d.ts +0 -8
  83. package/src/components/hint/index.js +4 -6
  84. package/src/components/image/index.js +4 -0
  85. package/src/components/index.js +0 -19
  86. package/src/components/marquee/types.js +4 -1
  87. package/src/components/modal/index.d.ts +5 -0
  88. package/src/components/modal/index.js +14 -10
  89. package/src/components/modal/modal.api.json +5 -0
  90. package/src/{incubator → components}/panView/index.d.ts +3 -3
  91. package/src/{incubator → components}/panView/index.js +4 -4
  92. package/src/{incubator → components}/panView/usePanGesture.d.ts +1 -1
  93. package/src/components/picker/Picker.driver.new.d.ts +2 -2
  94. package/src/components/picker/Picker.driver.new.js +3 -3
  95. package/src/components/picker/PickerItem.js +6 -20
  96. package/src/components/picker/PickerPresenter.d.ts +0 -1
  97. package/src/components/picker/PickerPresenter.js +1 -23
  98. package/src/components/picker/api/picker.api.json +0 -1
  99. package/src/components/picker/api/pickerItem.api.json +0 -5
  100. package/src/components/picker/helpers/useFieldType.d.ts +53 -23
  101. package/src/components/picker/helpers/usePickerLabel.d.ts +1 -1
  102. package/src/components/picker/helpers/usePickerLabel.js +2 -3
  103. package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +1 -1
  104. package/src/components/picker/helpers/usePickerMigrationWarnings.js +0 -12
  105. package/src/components/picker/helpers/usePickerSearch.d.ts +1 -1
  106. package/src/components/picker/helpers/usePickerSearch.js +4 -8
  107. package/src/components/picker/helpers/usePickerSelection.d.ts +1 -1
  108. package/src/components/picker/helpers/usePickerSelection.js +2 -10
  109. package/src/components/picker/index.js +4 -22
  110. package/src/components/picker/types.d.ts +1 -24
  111. package/src/components/segmentedControl/index.js +3 -3
  112. package/src/components/slider/GradientSlider.d.ts +1 -1
  113. package/src/components/slider/index.js +1 -1
  114. package/src/components/sortableGridList/SortableItem.js +13 -4
  115. package/src/components/sortableList/SortableListItem.js +13 -4
  116. package/src/components/stackAggregator/index.js +16 -11
  117. package/src/components/tabController/TabPage.js +18 -14
  118. package/src/components/text/Text.driver.new.d.ts +2 -2
  119. package/src/components/text/Text.driver.new.js +2 -2
  120. package/src/components/text/index.js +2 -3
  121. package/src/components/textField/Input.js +0 -1
  122. package/src/components/textField/TextField.driver.new.d.ts +2 -2
  123. package/src/components/textField/TextField.driver.new.js +2 -2
  124. package/src/components/textField/presets/outline.d.ts +106 -46
  125. package/src/components/textField/presets/underline.d.ts +106 -46
  126. package/src/components/textField/types.js +1 -0
  127. package/src/components/textField/usePreset.d.ts +72 -44
  128. package/src/components/timeline/types.js +3 -0
  129. package/src/{incubator/hooks/useHiddenLocation.web.d.ts → hooks/useHiddenLocation/index.d.ts} +1 -1
  130. package/src/{incubator/hooks/useHiddenLocation.d.ts → hooks/useHiddenLocation/index.web.d.ts} +1 -1
  131. package/src/incubator/expandableOverlay/ExpandableOverlay.driver.js +1 -1
  132. package/src/incubator/expandableOverlay/index.d.ts +42 -3
  133. package/src/incubator/expandableOverlay/index.js +1 -4
  134. package/src/incubator/index.d.ts +0 -2
  135. package/src/incubator/index.js +0 -2
  136. package/src/incubator/slider/SliderPresenter.js +2 -1
  137. package/src/incubator/toast/index.js +1 -1
  138. package/src/index.d.ts +3 -10
  139. package/src/index.js +42 -162
  140. package/src/testkit/index.d.ts +1 -1
  141. package/src/testkit/index.js +1 -1
  142. package/src/testkit/new/Component.driver.d.ts +4 -1
  143. package/src/testkit/new/Component.driver.js +3 -3
  144. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReactHacks.java +0 -30
  145. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReflectionUtils.java +0 -34
  146. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/DefaultKeyListener.java +0 -33
  147. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/KeyListenerProxy.java +0 -53
  148. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule.java +0 -54
  149. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerPackage.java +0 -28
  150. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/ViewUtils.java +0 -36
  151. package/lib/components/HighlighterOverlayView.js +0 -40
  152. package/lib/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.js +0 -28
  153. package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.d.ts +0 -11
  154. package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.js +0 -17
  155. package/panningViews.d.ts +0 -2
  156. package/panningViews.js +0 -1
  157. package/react-native.config.js +0 -22
  158. package/sharedTransition.d.ts +0 -2
  159. package/sharedTransition.js +0 -1
  160. package/src/components/dialog/DialogDismissibleView.d.ts +0 -34
  161. package/src/components/dialog/DialogDismissibleView.js +0 -184
  162. package/src/components/dialog/OverlayFadingBackground.d.ts +0 -14
  163. package/src/components/dialog/OverlayFadingBackground.js +0 -45
  164. package/src/components/panningViews/asPanViewConsumer.d.ts +0 -3
  165. package/src/components/panningViews/asPanViewConsumer.js +0 -16
  166. package/src/components/panningViews/panDismissibleView.d.ts +0 -51
  167. package/src/components/panningViews/panDismissibleView.js +0 -350
  168. package/src/components/panningViews/panGestureView.d.ts +0 -23
  169. package/src/components/panningViews/panGestureView.js +0 -156
  170. package/src/components/panningViews/panListenerView.d.ts +0 -66
  171. package/src/components/panningViews/panListenerView.js +0 -155
  172. package/src/components/panningViews/panResponderView.d.ts +0 -19
  173. package/src/components/panningViews/panResponderView.js +0 -79
  174. package/src/components/panningViews/panningContext.d.ts +0 -3
  175. package/src/components/panningViews/panningContext.js +0 -4
  176. package/src/components/panningViews/panningProvider.d.ts +0 -73
  177. package/src/components/panningViews/panningProvider.js +0 -101
  178. package/src/components/sharedTransition/ShareTransitionContext.js +0 -3
  179. package/src/components/sharedTransition/SharedArea.js +0 -153
  180. package/src/components/sharedTransition/SourceElement.js +0 -44
  181. package/src/components/sharedTransition/TargetElement.js +0 -38
  182. package/src/components/sharedTransition/index.js +0 -9
  183. package/src/incubator/dialog/dialog.api.json +0 -54
  184. package/src/incubator/dialog/index.d.ts +0 -15
  185. package/src/incubator/dialog/index.js +0 -218
  186. /package/lib/components/{HighlighterOverlayView.web.js → HighlighterOverlayView/index.web.js} +0 -0
  187. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.d.ts +0 -0
  188. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.js +0 -0
  189. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.d.ts +0 -0
  190. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.js +0 -0
  191. /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.d.ts → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.ts} +0 -0
  192. /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.js → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.js} +0 -0
  193. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.d.ts +0 -0
  194. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.js +0 -0
  195. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.ts +0 -0
  196. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.js +0 -0
  197. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.d.ts +0 -0
  198. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.js +0 -0
  199. /package/lib/components/Keyboard/{KeyboardTracking → KeyboardAwareInsetsView}/keyboardAwareInsetsView.api.json +0 -0
  200. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.d.ts +0 -0
  201. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.js +0 -0
  202. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.js +0 -0
  203. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.d.ts +0 -0
  204. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.js +0 -0
  205. /package/src/{incubator → components}/dialog/Dialog.driver.new.d.ts +0 -0
  206. /package/src/{incubator → components}/dialog/Dialog.driver.new.js +0 -0
  207. /package/src/{incubator → components}/dialog/DialogHeader.d.ts +0 -0
  208. /package/src/{incubator → components}/dialog/DialogHeader.js +0 -0
  209. /package/src/{incubator → components}/dialog/useDialogContent.js +0 -0
  210. /package/src/{incubator → components}/panView/panningUtil.d.ts +0 -0
  211. /package/src/{incubator → components}/panView/panningUtil.js +0 -0
  212. /package/src/{incubator → components}/panView/usePanGesture.js +0 -0
  213. /package/src/{incubator/hooks/useHiddenLocation.js → hooks/useHiddenLocation/index.js} +0 -0
  214. /package/src/{incubator/hooks/useHiddenLocation.web.js → hooks/useHiddenLocation/index.web.js} +0 -0
@@ -1,28 +0,0 @@
1
- package com.wix.reactnativeuilib.textinput;
2
-
3
- import com.facebook.react.ReactPackage;
4
- import com.facebook.react.bridge.JavaScriptModule;
5
- import com.facebook.react.bridge.NativeModule;
6
- import com.facebook.react.bridge.ReactApplicationContext;
7
- import com.facebook.react.uimanager.ViewManager;
8
-
9
- import java.util.Arrays;
10
- import java.util.Collections;
11
- import java.util.List;
12
-
13
- public class TextInputDelKeyHandlerPackage implements ReactPackage {
14
- @Override
15
- public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16
- return Arrays.<NativeModule>asList(new TextInputDelKeyHandlerModule(reactContext));
17
- }
18
-
19
- // @Override
20
- // public List<Class<? extends JavaScriptModule>> createJSModules() {
21
- // return Collections.emptyList();
22
- // }
23
-
24
- @Override
25
- public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
26
- return Collections.emptyList();
27
- }
28
- }
@@ -1,36 +0,0 @@
1
- package com.wix.reactnativeuilib.textinput;
2
-
3
- import android.view.View;
4
- import android.view.ViewGroup;
5
-
6
- import androidx.annotation.Nullable;
7
-
8
- import com.facebook.react.views.textinput.ReactEditText;
9
-
10
- class ViewUtils {
11
-
12
- @Nullable
13
- static ReactEditText getEditTextInView(View view) {
14
- if (view == null) {
15
- return null;
16
- }
17
-
18
- if (view instanceof ReactEditText) {
19
- return (ReactEditText) view;
20
- }
21
-
22
- if (view instanceof ViewGroup) {
23
- final ViewGroup viewGroup = (ViewGroup) view;
24
-
25
- for (int i = 0; i < viewGroup.getChildCount(); i++) {
26
- final View child = viewGroup.getChildAt(i);
27
- final View childView = getEditTextInView(child);
28
-
29
- if (childView != null) {
30
- return (ReactEditText) childView;
31
- }
32
- }
33
- }
34
- return null;
35
- }
36
- }
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import { requireNativeComponent, processColor, Platform, StyleSheet, Modal } from 'react-native';
3
- const NativeHighlighterView = requireNativeComponent('HighlighterView');
4
- const DefaultOverlayColor = 'rgba(0, 0, 0, 0.5)';
5
- const HighlighterOverlayView = props => {
6
- const {
7
- overlayColor,
8
- borderRadius,
9
- strokeColor,
10
- strokeWidth,
11
- visible,
12
- onRequestClose,
13
- highlightFrame,
14
- style,
15
- children,
16
- highlightViewTag,
17
- highlightViewTagParams,
18
- minimumRectSize,
19
- innerPadding
20
- } = props;
21
- let overlayColorToUse = overlayColor || DefaultOverlayColor;
22
- let strokeColorToUse = strokeColor;
23
- if (Platform.OS === 'android') {
24
- // @ts-ignore
25
- overlayColorToUse = processColor(overlayColorToUse);
26
- // @ts-ignore
27
- strokeColorToUse = processColor(strokeColorToUse);
28
- }
29
- return <Modal visible={!!visible} animationType={'fade'} transparent onRequestClose={() => onRequestClose?.()}>
30
- <NativeHighlighterView
31
- // @ts-ignore, this became private, not sure if I should remove it
32
- highlightFrame={highlightFrame} style={[style, {
33
- ...StyleSheet.absoluteFillObject,
34
- backgroundColor: 'transparent'
35
- }]} overlayColor={overlayColorToUse} borderRadius={borderRadius} strokeColor={strokeColorToUse} strokeWidth={strokeWidth} highlightViewTag={highlightViewTag} highlightViewTagParams={highlightViewTagParams} minimumRectSize={minimumRectSize} innerPadding={innerPadding} />
36
- {children}
37
- </Modal>;
38
- };
39
- HighlighterOverlayView.displayName = 'IGNORE';
40
- export default HighlighterOverlayView;
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { requireNativeComponent } from 'react-native';
3
- import TextInputKeyboardManager from "../TextInputKeyboardManager/TextInputKeyboardManager.android";
4
- import KeyboardRegistry from "../KeyboardRegistry";
5
- import CustomKeyboardViewBase from "../CustomKeyboardViewBase";
6
- const CustomKeyboardViewNativeAndroid = requireNativeComponent('CustomKeyboardViewNativeTemp');
7
- export default class CustomKeyboardView extends CustomKeyboardViewBase {
8
- static displayName = 'IGNORE';
9
- async componentDidUpdate(prevProps) {
10
- const {
11
- component
12
- } = this.props;
13
- if (prevProps.component !== component && !component) {
14
- await TextInputKeyboardManager.reset();
15
- }
16
- super.componentDidUpdate(prevProps);
17
- }
18
- render() {
19
- const {
20
- component,
21
- initialProps
22
- } = this.props;
23
- const KeyboardComponent = component && KeyboardRegistry.getKeyboard(component);
24
- return <CustomKeyboardViewNativeAndroid>
25
- {KeyboardComponent && <KeyboardComponent {...initialProps} />}
26
- </CustomKeyboardViewNativeAndroid>;
27
- }
28
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * @description: util for managing the keyboard.
3
- * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/keyboardInput/KeyboardInputViewScreen.js
4
- */
5
- export default class KeyboardUtils {
6
- static displayName: string;
7
- /**
8
- * Used to dismiss (close) the keyboard.
9
- */
10
- static dismiss: () => void;
11
- }
@@ -1,17 +0,0 @@
1
- import { Keyboard } from 'react-native';
2
- import TextInputKeyboardManager from "../TextInputKeyboardManager";
3
-
4
- /**
5
- * @description: util for managing the keyboard.
6
- * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/keyboardInput/KeyboardInputViewScreen.js
7
- */
8
- export default class KeyboardUtils {
9
- static displayName = 'KeyboardUtils';
10
- /**
11
- * Used to dismiss (close) the keyboard.
12
- */
13
- static dismiss = () => {
14
- Keyboard.dismiss();
15
- TextInputKeyboardManager.dismissKeyboard();
16
- };
17
- }
package/panningViews.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import {PanningViews} from './src';
2
- export default PanningViews;
package/panningViews.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./src/components/panningViews').default;
@@ -1,22 +0,0 @@
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: '../uilib-native/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
- };
@@ -1,2 +0,0 @@
1
- import {SharedTransition} from './src';
2
- export default SharedTransition;
@@ -1 +0,0 @@
1
- module.exports = require('./src/components/sharedTransition').default;
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
- import { PanningDirections } from '../panningViews/panningProvider';
4
- interface DialogDismissibleProps {
5
- /**
6
- * Additional styling
7
- */
8
- style?: StyleProp<ViewStyle>;
9
- /**
10
- * The direction of the allowed pan (default is DOWN)
11
- * Types: UP, DOWN, LEFT and RIGHT (using PanningProvider.Directions.###)
12
- */
13
- direction?: PanningDirections;
14
- /**
15
- * onDismiss callback
16
- */
17
- onDismiss?: () => void;
18
- /**
19
- * The dialog`s container style
20
- */
21
- containerStyle?: StyleProp<ViewStyle>;
22
- /**
23
- * Whether to show the dialog or not
24
- */
25
- visible?: boolean;
26
- }
27
- interface Props extends DialogDismissibleProps {
28
- children?: React.ReactNode | React.ReactNode[];
29
- }
30
- declare const DialogDismissibleView: {
31
- (props: Props): React.JSX.Element;
32
- displayName: string;
33
- };
34
- export default DialogDismissibleView;
@@ -1,184 +0,0 @@
1
- import _isUndefined from "lodash/isUndefined";
2
- import React, { useEffect, useRef, useCallback, useContext } from 'react';
3
- import { Animated, Easing, StyleSheet } from 'react-native';
4
- import { Constants } from "../../commons/new";
5
- import View from "../view";
6
- import PanningContext from "../panningViews/panningContext";
7
- import PanningProvider from "../panningViews/panningProvider";
8
- import PanResponderView from "../panningViews/panResponderView";
9
- const MAXIMUM_DRAGS_AFTER_SWIPE = 2;
10
-
11
- // TODO: move this to panningContext
12
-
13
- const DEFAULT_DIRECTION = PanningProvider.Directions.DOWN;
14
- const DialogDismissibleView = props => {
15
- const {
16
- direction = DEFAULT_DIRECTION,
17
- visible: propsVisible,
18
- containerStyle,
19
- style,
20
- children,
21
- onDismiss = () => {}
22
- } = props;
23
- // @ts-expect-error
24
- const {
25
- isPanning,
26
- dragDeltas,
27
- swipeDirections
28
- } = useContext(PanningContext);
29
- const width = useRef(Constants.screenWidth);
30
- const height = useRef(Constants.screenHeight);
31
- const TOP_INSET = useRef(Constants.isIphoneX ? Constants.getSafeAreaInsets().top : Constants.isIOS ? 20 : 0);
32
- const BOTTOM_INSET = useRef(Constants.isIphoneX ? Constants.getSafeAreaInsets().bottom : Constants.isIOS ? 20 : 0);
33
- const thresholdX = useRef(0);
34
- const thresholdY = useRef(0);
35
- const dragsCounter = useRef(0);
36
- const containerRef = useRef();
37
- const animatedValue = useRef(new Animated.Value(0));
38
- const mutableSwipeDirections = useRef({});
39
- const prevDragDeltas = useRef();
40
- const prevSwipeDirections = useRef();
41
- const visible = useRef(Boolean(propsVisible));
42
- const getHiddenLocation = useCallback((left, top) => {
43
- const result = {
44
- left: 0,
45
- top: 0
46
- };
47
- switch (direction) {
48
- case PanningProvider.Directions.LEFT:
49
- result.left = -left - width.current;
50
- break;
51
- case PanningProvider.Directions.RIGHT:
52
- result.left = Constants.screenWidth - left;
53
- break;
54
- case PanningProvider.Directions.UP:
55
- result.top = -top - height.current - TOP_INSET.current;
56
- break;
57
- case PanningProvider.Directions.DOWN:
58
- default:
59
- result.top = Constants.screenHeight - top + BOTTOM_INSET.current;
60
- break;
61
- }
62
- return result;
63
- }, [direction]);
64
- const hiddenLocation = useRef(getHiddenLocation(0, 0));
65
- const animateTo = useCallback((toValue, animationEndCallback) => {
66
- Animated.timing(animatedValue.current, {
67
- toValue,
68
- duration: 300,
69
- easing: Easing.bezier(0.2, 0, 0.35, 1),
70
- useNativeDriver: true
71
- }).start(animationEndCallback);
72
- }, []);
73
- const isSwiping = useCallback(() => {
74
- return !_isUndefined(mutableSwipeDirections.current.x) || !_isUndefined(mutableSwipeDirections.current.y);
75
- }, []);
76
- const resetSwipe = useCallback(() => {
77
- dragsCounter.current = 0;
78
- mutableSwipeDirections.current = {};
79
- }, []);
80
- const onDrag = useCallback(() => {
81
- if (isSwiping()) {
82
- if (dragsCounter.current < MAXIMUM_DRAGS_AFTER_SWIPE) {
83
- dragsCounter.current += 1;
84
- } else {
85
- resetSwipe();
86
- }
87
- }
88
- }, [isSwiping, resetSwipe]);
89
- const hide = useCallback(() => {
90
- // TODO: test we're not animating?
91
- animateTo(0, () => {
92
- visible.current = false;
93
- onDismiss?.();
94
- });
95
- }, [animateTo, onDismiss]);
96
- useEffect(() => {
97
- if (isPanning && (dragDeltas.x || dragDeltas.y) && (dragDeltas.x !== prevDragDeltas.current?.x || dragDeltas.y !== prevDragDeltas.current?.y)) {
98
- onDrag();
99
- prevDragDeltas.current = dragDeltas;
100
- }
101
- }, [isPanning, dragDeltas, onDrag, hide]);
102
- useEffect(() => {
103
- if (isPanning && (swipeDirections.x || swipeDirections.y) && (swipeDirections.x !== prevSwipeDirections.current?.x || swipeDirections.y !== prevSwipeDirections.current?.y)) {
104
- mutableSwipeDirections.current = swipeDirections;
105
- }
106
- }, [isPanning, swipeDirections, hide]);
107
- useEffect(() => {
108
- if (visible.current && !propsVisible) {
109
- hide();
110
- }
111
- }, [propsVisible, hide]);
112
- const onLayout = useCallback(event => {
113
- // DO NOT move the width\height into the measureInWindow - it causes errors with orientation change
114
- const layout = event.nativeEvent.layout;
115
- width.current = layout.width;
116
- height.current = layout.height;
117
- thresholdX.current = width.current / 2;
118
- thresholdY.current = height.current / 2;
119
- if (containerRef.current) {
120
- // @ts-ignore TODO: can we fix this on ViewProps \ View?
121
- containerRef.current.measureInWindow((x, y) => {
122
- hiddenLocation.current = getHiddenLocation(x, y);
123
- animateTo(1);
124
- });
125
- }
126
- }, [getHiddenLocation, animateTo]);
127
- const getAnimationStyle = useCallback(() => {
128
- return {
129
- transform: [{
130
- translateX: animatedValue.current.interpolate({
131
- inputRange: [0, 1],
132
- outputRange: [hiddenLocation.current.left, 0]
133
- })
134
- }, {
135
- translateY: animatedValue.current.interpolate({
136
- inputRange: [0, 1],
137
- outputRange: [hiddenLocation.current.top, 0]
138
- })
139
- }]
140
- };
141
- }, []);
142
- const resetToShown = useCallback((left, top, direction) => {
143
- const toValue =
144
- //@ts-expect-error
145
- [PanningProvider.Directions.LEFT, PanningProvider.Directions.RIGHT].includes(direction) ? 1 + left / hiddenLocation.current.left : 1 + top / hiddenLocation.current.top;
146
- animateTo(toValue);
147
- }, [animateTo]);
148
- const onPanLocationChanged = useCallback(({
149
- left = 0,
150
- top = 0
151
- }) => {
152
- const endValue = {
153
- x: Math.round(left),
154
- y: Math.round(top)
155
- };
156
- if (isSwiping()) {
157
- hide();
158
- } else {
159
- resetSwipe();
160
- if (direction === PanningProvider.Directions.LEFT && endValue.x <= -thresholdX.current || direction === PanningProvider.Directions.RIGHT && endValue.x >= thresholdX.current || direction === PanningProvider.Directions.UP && endValue.y <= -thresholdY.current || direction === PanningProvider.Directions.DOWN && endValue.y >= thresholdY.current) {
161
- hide();
162
- } else {
163
- resetToShown(left, top, direction);
164
- }
165
- }
166
- }, [isSwiping, hide, resetSwipe, direction, resetToShown]);
167
- return (
168
- // @ts-ignore
169
- <View ref={containerRef} style={containerStyle} onLayout={onLayout}>
170
- <PanResponderView
171
- // !visible.current && styles.hidden is done to fix a bug is iOS
172
- style={[style, getAnimationStyle(), !visible.current && styles.hidden]} isAnimated onPanLocationChanged={onPanLocationChanged}>
173
- {children}
174
- </PanResponderView>
175
- </View>
176
- );
177
- };
178
- DialogDismissibleView.displayName = 'IGNORE';
179
- export default DialogDismissibleView;
180
- const styles = StyleSheet.create({
181
- hidden: {
182
- opacity: 0
183
- }
184
- });
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- testID?: string;
4
- dialogVisibility?: boolean;
5
- modalVisibility?: boolean;
6
- overlayBackgroundColor?: string;
7
- onFadeDone?: () => void;
8
- fadeOut?: boolean;
9
- }
10
- declare const OverlayFadingBackground: {
11
- ({ testID, dialogVisibility, modalVisibility, overlayBackgroundColor, onFadeDone: propsOnFadeDone, fadeOut }: Props): React.JSX.Element;
12
- displayName: string;
13
- };
14
- export default OverlayFadingBackground;
@@ -1,45 +0,0 @@
1
- import React, { useRef, useEffect, useCallback, useMemo } from 'react';
2
- import View from "../view";
3
- import { Animated } from 'react-native';
4
- const OverlayFadingBackground = ({
5
- testID,
6
- dialogVisibility,
7
- modalVisibility,
8
- overlayBackgroundColor,
9
- onFadeDone: propsOnFadeDone,
10
- fadeOut
11
- }) => {
12
- const fadeAnimation = useRef(new Animated.Value(0)).current;
13
- const isAnimating = useRef(false);
14
- const onFadeDone = useCallback(() => {
15
- isAnimating.current = false;
16
- propsOnFadeDone?.();
17
- }, [propsOnFadeDone]);
18
- const animateFading = useCallback(toValue => {
19
- isAnimating.current = true;
20
- Animated.timing(fadeAnimation, {
21
- toValue,
22
- duration: 400,
23
- useNativeDriver: true
24
- }).start(onFadeDone);
25
- }, [fadeAnimation, onFadeDone]);
26
- useEffect(() => {
27
- if (!isAnimating.current && (!dialogVisibility || fadeOut)) {
28
- animateFading(0);
29
- }
30
- }, [dialogVisibility, animateFading, fadeOut]);
31
- useEffect(() => {
32
- if (modalVisibility) {
33
- animateFading(1);
34
- }
35
- }, [modalVisibility, animateFading]);
36
- const style = useMemo(() => {
37
- return {
38
- opacity: fadeAnimation,
39
- backgroundColor: overlayBackgroundColor
40
- };
41
- }, [overlayBackgroundColor, fadeAnimation]);
42
- return <View testID={testID} absF animated style={style} pointerEvents="none" />;
43
- };
44
- OverlayFadingBackground.displayName = 'IGNORE';
45
- export default OverlayFadingBackground;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare function asPanViewConsumer<PROPS>(WrappedComponent: React.ComponentType<any>): React.ComponentClass<PROPS>;
3
- export default asPanViewConsumer;
@@ -1,16 +0,0 @@
1
- import React, { Component } from 'react';
2
- import PanningContext from "./panningContext";
3
- function asPanViewConsumer(WrappedComponent) {
4
- class PanViewConsumer extends Component {
5
- saveRef = r => {
6
- this.contentRef = r;
7
- };
8
- render() {
9
- return <PanningContext.Consumer>
10
- {context => <WrappedComponent ref={this.saveRef} context={context} {...this.props} />}
11
- </PanningContext.Consumer>;
12
- }
13
- }
14
- return PanViewConsumer;
15
- }
16
- export default asPanViewConsumer;
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
- import { PanningDirections, PanAmountsProps } from './panningProvider';
4
- export interface DismissibleAnimationProps {
5
- /**
6
- * The return animation speed (default is 20)
7
- */
8
- speed?: number;
9
- /**
10
- * The return animation bounciness (default is 6)
11
- */
12
- bounciness?: number;
13
- /**
14
- * The dismiss animation duration (default is 280)
15
- */
16
- duration?: number;
17
- }
18
- export interface PanDismissibleViewProps {
19
- /**
20
- * Additional styling
21
- */
22
- style?: StyleProp<ViewStyle>;
23
- /**
24
- * The directions of the allowed pan (default allows all directions)
25
- * Types: UP, DOWN, LEFT and RIGHT (using PanningProvider.Directions.###)
26
- */
27
- directions?: PanningDirections[];
28
- /**
29
- * onDismiss callback
30
- */
31
- onDismiss?: () => void;
32
- /**
33
- * Some animation options to choose from, defaults are set for:
34
- * speed - the animation speed (default is 20)
35
- * bounciness - the animation bounciness (default is 6)
36
- * duration - the dismiss animation duration (default is 280)
37
- */
38
- animationOptions?: DismissibleAnimationProps;
39
- /**
40
- * Override the default threshold (height/2 and width/2) with different values.
41
- */
42
- threshold?: PanAmountsProps;
43
- /**
44
- * Allow diagonal dismiss, this is false by default,
45
- * since it looks better and most cases.
46
- */
47
- allowDiagonalDismiss?: boolean;
48
- children?: React.ReactNode;
49
- }
50
- declare const _default: React.ComponentClass<PanDismissibleViewProps, any>;
51
- export default _default;