react-native-ui-lib 7.44.0-snapshot.7202 → 7.44.0-snapshot.7204

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 (102) hide show
  1. package/babel.config.js +12 -0
  2. package/index.js +1 -0
  3. package/lib/android/build.gradle +5 -5
  4. package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +0 -2
  5. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +31 -23
  6. package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +1 -1
  7. package/lib/components/HighlighterOverlayView/HighlighterViewNativeComponent.d.ts +61 -0
  8. package/lib/components/HighlighterOverlayView/HighlighterViewNativeComponent.js +2 -0
  9. package/lib/components/{HighlighterOverlayView.web.d.ts → HighlighterOverlayView/index.d.ts} +1 -1
  10. package/lib/components/HighlighterOverlayView/index.js +49 -0
  11. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.android.d.ts +5 -2
  12. package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.js +51 -0
  13. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.d.ts +1 -1
  14. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.js +3 -3
  15. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.d.ts +3 -0
  16. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.js +1 -1
  17. package/lib/components/Keyboard/{KeyboardInput/utils → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager}/__tests__/EventEmitterManager.spec.js +1 -1
  18. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/__tests__/KeyboardRegistry.spec.js +1 -1
  19. package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.d.ts → KeyboardAccessoryView/KeyboardRegistry/index.d.ts} +1 -1
  20. package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.js → KeyboardAccessoryView/KeyboardRegistry/index.js} +1 -1
  21. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/keyboardRegistry.api.json +9 -9
  22. package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.ts +26 -0
  23. package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.js +91 -0
  24. package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.d.ts → KeyboardAccessoryView/index.d.ts} +11 -1
  25. package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.js → KeyboardAccessoryView/index.js} +31 -5
  26. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/keyboardAccessoryView.api.json +5 -5
  27. package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.d.ts → KeyboardAwareInsetsView/index.d.ts} +1 -1
  28. package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.js → KeyboardAwareInsetsView/index.js} +1 -1
  29. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.d.ts +1 -4
  30. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.js +5 -8
  31. package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingViewNativeComponent.d.ts +58 -0
  32. package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingViewNativeComponent.js +2 -0
  33. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.d.ts +2 -2
  34. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/keyboardTrackingView.api.json +11 -20
  35. package/lib/components/Keyboard/index.d.ts +6 -6
  36. package/lib/components/Keyboard/index.js +6 -6
  37. package/lib/components/SafeArea/SafeAreaInsetsManager.d.ts +8 -3
  38. package/lib/components/SafeArea/SafeAreaInsetsManager.js +89 -23
  39. package/lib/components/SafeArea/SafeAreaSpacerView.js +60 -9
  40. package/lib/package.json +1 -1
  41. package/lib/react-native.config.js +1 -3
  42. package/metro.config.js +2 -2
  43. package/package.json +23 -23
  44. package/react-native.config.js +1 -3
  45. package/src/commons/Constants.js +7 -2
  46. package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +5 -1
  47. package/src/components/badge/index.d.ts +107 -47
  48. package/src/components/button/button.api.json +1 -1
  49. package/src/components/button/index.d.ts +53 -23
  50. package/src/components/button/types.d.ts +0 -1
  51. package/src/components/checkbox/index.d.ts +1 -0
  52. package/src/components/checkbox/index.js +4 -2
  53. package/src/components/drawer/Swipeable.js +1 -2
  54. package/src/components/drawer/index.js +31 -25
  55. package/src/components/fadedScrollView/index.js +7 -2
  56. package/src/components/pageControl/index.js +1 -6
  57. package/src/components/picker/helpers/useFieldType.d.ts +53 -23
  58. package/src/components/radioButton/index.js +8 -6
  59. package/src/components/slider/GradientSlider.d.ts +1 -1
  60. package/src/components/sortableGridList/SortableItem.js +13 -4
  61. package/src/components/sortableList/SortableListItem.js +13 -4
  62. package/src/components/stackAggregator/index.js +16 -11
  63. package/src/components/textField/Input.js +0 -1
  64. package/src/components/textField/presets/outline.d.ts +106 -46
  65. package/src/components/textField/presets/underline.d.ts +106 -46
  66. package/src/components/textField/usePreset.d.ts +72 -44
  67. package/src/incubator/dialog/useDialogContent.d.ts +1 -1
  68. package/src/style/colors.d.ts +5 -3
  69. package/src/style/designTokens.js +4 -7
  70. package/src/utils/styleUtils.d.ts +0 -1
  71. package/src/utils/styleUtils.js +0 -3
  72. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReactHacks.java +0 -30
  73. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReflectionUtils.java +0 -34
  74. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/DefaultKeyListener.java +0 -33
  75. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/KeyListenerProxy.java +0 -53
  76. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule.java +0 -54
  77. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerPackage.java +0 -28
  78. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/ViewUtils.java +0 -36
  79. package/lib/components/HighlighterOverlayView.js +0 -40
  80. package/lib/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.js +0 -28
  81. package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.d.ts +0 -11
  82. package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.js +0 -17
  83. /package/lib/components/{HighlighterOverlayView.d.ts → HighlighterOverlayView/index.web.d.ts} +0 -0
  84. /package/lib/components/{HighlighterOverlayView.web.js → HighlighterOverlayView/index.web.js} +0 -0
  85. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.d.ts +0 -0
  86. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.js +0 -0
  87. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.d.ts +0 -0
  88. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.js +0 -0
  89. /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.d.ts → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.ts} +0 -0
  90. /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.js → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.js} +0 -0
  91. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.d.ts +0 -0
  92. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.js +0 -0
  93. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.ts +0 -0
  94. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.js +0 -0
  95. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.d.ts +0 -0
  96. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.js +0 -0
  97. /package/lib/components/Keyboard/{KeyboardTracking → KeyboardAwareInsetsView}/keyboardAwareInsetsView.api.json +0 -0
  98. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.d.ts +0 -0
  99. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.js +0 -0
  100. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.js +0 -0
  101. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.d.ts +0 -0
  102. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.js +0 -0
@@ -1,33 +0,0 @@
1
- package com.wix.reactnativeuilib.textinput;
2
-
3
- import android.text.Editable;
4
- import android.text.InputType;
5
- import android.text.method.KeyListener;
6
- import android.view.KeyEvent;
7
- import android.view.View;
8
-
9
- class DefaultKeyListener implements KeyListener {
10
- @Override
11
- public int getInputType() {
12
- return InputType.TYPE_NULL;
13
- }
14
-
15
- @Override
16
- public boolean onKeyDown(View view, Editable text, int keyCode, KeyEvent event) {
17
- return false;
18
- }
19
-
20
- @Override
21
- public boolean onKeyUp(View view, Editable text, int keyCode, KeyEvent event) {
22
- return false;
23
- }
24
-
25
- @Override
26
- public boolean onKeyOther(View view, Editable text, KeyEvent event) {
27
- return false;
28
- }
29
-
30
- @Override
31
- public void clearMetaKeyState(View view, Editable content, int states) {
32
- }
33
- }
@@ -1,53 +0,0 @@
1
- package com.wix.reactnativeuilib.textinput;
2
-
3
- import android.text.Editable;
4
- import android.text.method.KeyListener;
5
- import android.view.KeyEvent;
6
- import android.view.View;
7
-
8
- import com.facebook.react.bridge.Arguments;
9
- import com.facebook.react.bridge.ReactApplicationContext;
10
- import com.facebook.react.modules.core.DeviceEventManagerModule;
11
-
12
- public class KeyListenerProxy implements KeyListener {
13
-
14
- final private ReactApplicationContext mContext;
15
- final private KeyListener mKeyListener;
16
-
17
- KeyListenerProxy(ReactApplicationContext context, KeyListener keyListener) {
18
- mContext = context;
19
- mKeyListener = keyListener == null ? new DefaultKeyListener() : keyListener;
20
- }
21
-
22
- @Override
23
- public int getInputType() {
24
- return mKeyListener.getInputType();
25
- }
26
-
27
- @Override
28
- public boolean onKeyDown(View view, Editable text, int keyCode, KeyEvent event) {
29
- return mKeyListener.onKeyDown(view, text, keyCode, event);
30
- }
31
-
32
- @Override
33
- public boolean onKeyUp(View view, Editable text, int keyCode, KeyEvent event) {
34
- if (keyCode == KeyEvent.KEYCODE_DEL) {
35
- emitBackspacePressEvent();
36
- }
37
- return mKeyListener.onKeyUp(view, text, keyCode, event);
38
- }
39
-
40
- @Override
41
- public boolean onKeyOther(View view, Editable text, KeyEvent event) {
42
- return mKeyListener.onKeyOther(view, text, event);
43
- }
44
-
45
- @Override
46
- public void clearMetaKeyState(View view, Editable content, int states) {
47
- mKeyListener.clearMetaKeyState(view, content, states);
48
- }
49
-
50
- private void emitBackspacePressEvent() {
51
- mContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("onBackspacePress", Arguments.createMap());
52
- }
53
- }
@@ -1,54 +0,0 @@
1
- package com.wix.reactnativeuilib.textinput;
2
-
3
- import android.util.Log;
4
- import android.view.View;
5
-
6
- import com.facebook.react.bridge.ReactApplicationContext;
7
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
8
- import com.facebook.react.bridge.ReactMethod;
9
- import com.facebook.react.uimanager.IllegalViewOperationException;
10
- import com.facebook.react.uimanager.NativeViewHierarchyManager;
11
- import com.facebook.react.uimanager.UIBlock;
12
- import com.facebook.react.uimanager.UIManagerModule;
13
- import com.facebook.react.views.textinput.ReactEditText;
14
-
15
- public class TextInputDelKeyHandlerModule extends ReactContextBaseJavaModule {
16
-
17
- private final static String REACT_CLASS = "TextInputDelKeyHandler";
18
-
19
- TextInputDelKeyHandlerModule(ReactApplicationContext reactContext) {
20
- super(reactContext);
21
- }
22
-
23
- @Override
24
- public String getName() {
25
- return REACT_CLASS;
26
- }
27
-
28
- @ReactMethod
29
- public void register(final Integer textInputTag) {
30
- final ReactApplicationContext reactContext = this.getReactApplicationContext();
31
- final UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);
32
-
33
- uiManager.addUIBlock(new UIBlock() {
34
- public void execute(NativeViewHierarchyManager viewHierarchyManager) {
35
- Log.d("ReactNativeJS","registering tag = " + textInputTag);
36
- final View view;
37
- try {
38
- view = viewHierarchyManager.resolveView(textInputTag);
39
- } catch (IllegalViewOperationException e) {
40
- Log.d("ReactNativeJS","no view for tag = " + textInputTag);
41
- e.printStackTrace();
42
- return;
43
- }
44
- final ReactEditText editText = ViewUtils.getEditTextInView(view);
45
-
46
- if (editText != null) {
47
- Log.d("ReactNativeJS","has editText for tag = " + textInputTag);
48
- final KeyListenerProxy keyListenerProxy = new KeyListenerProxy(reactContext, editText.getKeyListener());
49
- editText.setKeyListener(keyListenerProxy);
50
- }
51
- }
52
- });
53
- }
54
- }
@@ -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
- }