react-native-external-keyboard 0.9.1 → 1.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.
- package/README.md +95 -600
- package/android/build.gradle +0 -18
- package/android/src/main/java/com/externalkeyboard/ExternalKeyboardViewPackage.java +24 -22
- package/android/src/main/java/com/externalkeyboard/events/EventHelper.java +10 -13
- package/android/src/main/java/com/externalkeyboard/helper/FocusHelper.java +1 -2
- package/android/src/main/java/com/externalkeyboard/services/FocusMemoryService.java +64 -0
- package/android/src/main/java/com/externalkeyboard/services/KeyboardFocusService.java +41 -0
- package/android/src/main/java/com/externalkeyboard/services/KeyboardService.java +4 -13
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardView.java +2 -8
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardViewManager.java +20 -13
- package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapper.java +99 -21
- package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapperManager.java +11 -0
- package/android/src/main/java/com/externalkeyboard/views/base/FocusHighlightBase.java +11 -5
- package/android/src/main/java/com/externalkeyboard/views/base/FocusableBase.java +36 -0
- package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusChangeBase.java +2 -3
- package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusRequestBase.java +10 -61
- package/android/src/newarch/ExternalKeyboardLockViewManagerInterface.java +11 -0
- package/android/src/newarch/ExternalKeyboardLockViewManagerSpec.java +0 -1
- package/android/src/newarch/ExternalKeyboardViewManagerInterface.java +42 -0
- package/android/src/newarch/ExternalKeyboardViewManagerSpec.java +0 -1
- package/android/src/newarch/KeyboardFocusGroupManagerInterface.java +12 -0
- package/android/src/newarch/KeyboardFocusGroupManagerSpec.java +0 -1
- package/android/src/newarch/TextInputFocusWrapperManagerInterface.java +34 -0
- package/android/src/newarch/TextInputFocusWrapperManagerSpec.java +0 -10
- package/android/src/newarch/helper/ReactNativeEventDispatcher.java +28 -0
- package/android/src/oldarch/ExternalKeyboardViewManagerSpec.java +6 -4
- package/android/src/oldarch/TextInputFocusWrapperManagerSpec.java +4 -0
- package/android/src/oldarch/helper/ReactNativeEventDispatcher.java +15 -0
- package/ios/Delegates/RNCEKVFocusDelegate/RNCEKVFocusDelegate.mm +1 -1
- package/ios/Delegates/RNCEKVFocusDelegate/RNCEKVFocusProtocol.h +1 -1
- package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.h +2 -1
- package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.mm +41 -5
- package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloProtocol.h +1 -0
- package/ios/Extensions/RCTCustomScrollView+RNCEKVExternalKeyboard.mm +5 -6
- package/ios/Extensions/RCTEnhancedScrollView+RNCEKVExternalKeyboard.mm +8 -9
- package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.mm +1 -1
- package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.h +0 -1
- package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.mm +16 -4
- package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.mm +7 -10
- package/ios/Helpers/RNCEKVNativeProps/RNCEKVNativeProps.h +4 -4
- package/ios/Helpers/RNCEKVSwizzleInstanceMethod/RNCEKVSwizzleInstanceMethod.h +19 -0
- package/ios/Protocols/RNCEKVCustomFocusEffectProtocol.h +1 -1
- package/ios/Services/RNCEKVFocusMemoryService.h +39 -0
- package/ios/Services/RNCEKVFocusMemoryService.mm +42 -0
- package/ios/Services/RNCEKVKeyboardFocusService.h +28 -0
- package/ios/Services/RNCEKVKeyboardFocusService.mm +54 -0
- package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.h +2 -0
- package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.mm +12 -10
- package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.h +1 -1
- package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.mm +6 -17
- package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.h +1 -0
- package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.mm +146 -6
- package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.h +2 -0
- package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.mm +4 -0
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h +1 -1
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +8 -4
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardViewManager.mm +22 -11
- package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.mm +17 -0
- package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapperManager.mm +12 -0
- package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js +67 -65
- package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
- package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js +49 -97
- package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.js.map +1 -1
- package/lib/commonjs/components/{KeyboardExtendedInput/KeyboardExtendedInput.types.js → KeyboardFocusGroup/KeyboardFocusGroup.types.js} +1 -1
- package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +2 -1
- package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +2 -1
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +2 -1
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js +14 -51
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
- package/lib/commonjs/components/index.js +47 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/index.js +37 -19
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -3
- package/lib/commonjs/nativeSpec/ExternalKeyboardViewNativeComponent.ts +12 -9
- package/lib/commonjs/nativeSpec/KeyboardFocusGroupNativeComponent.ts +5 -3
- package/lib/commonjs/nativeSpec/TextInputFocusWrapperNativeComponent.ts +7 -3
- package/lib/commonjs/types/KeyboardFocusLock.types.js +13 -0
- package/lib/commonjs/types/KeyboardFocusLock.types.js.map +1 -1
- package/lib/commonjs/types/baseKeyboardView.types.js +6 -0
- package/lib/commonjs/types/baseKeyboardView.types.js.map +1 -0
- package/lib/commonjs/types/{FocusStyle.js → focus.types.js} +1 -1
- package/lib/commonjs/types/{FocusStyle.js.map → focus.types.js.map} +1 -1
- package/lib/commonjs/types/focusOrder.types.js +33 -0
- package/lib/commonjs/types/focusOrder.types.js.map +1 -0
- package/lib/commonjs/types/{WithKeyboardFocus.js → focusStyle.types.js} +1 -1
- package/lib/commonjs/types/{WithKeyboardFocus.js.map → focusStyle.types.js.map} +1 -1
- package/lib/commonjs/types/index.js +18 -0
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/keyPress.types.js +6 -0
- package/lib/{module/types/WithKeyboardFocus.js.map → commonjs/types/keyPress.types.js.map} +1 -1
- package/lib/commonjs/types/keyboardInput.types.js +6 -0
- package/lib/commonjs/types/keyboardInput.types.js.map +1 -0
- package/lib/commonjs/types/withKeyboardFocus.types.js +6 -0
- package/lib/commonjs/types/withKeyboardFocus.types.js.map +1 -0
- package/lib/commonjs/utils/mapLockFocus.js +37 -0
- package/lib/commonjs/utils/mapLockFocus.js.map +1 -0
- package/lib/commonjs/utils/useFocusStyle.js +4 -21
- package/lib/commonjs/utils/useFocusStyle.js.map +1 -1
- package/lib/commonjs/utils/useKeyboardFocusContainer.js +79 -0
- package/lib/commonjs/utils/useKeyboardFocusContainer.js.map +1 -0
- package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.android.js +4 -7
- package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.android.js.map +1 -1
- package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.ios.js +3 -6
- package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.ios.js.map +1 -1
- package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.js +9 -7
- package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.js.map +1 -1
- package/lib/commonjs/utils/useKeyboardPressState.js +65 -0
- package/lib/commonjs/utils/useKeyboardPressState.js.map +1 -0
- package/lib/commonjs/utils/useOnFocusChange.js +1 -1
- package/lib/commonjs/utils/useOnFocusChange.js.map +1 -1
- package/lib/commonjs/utils/useOrderValidation.js +35 -0
- package/lib/commonjs/utils/useOrderValidation.js.map +1 -0
- package/lib/commonjs/utils/useRenderedChildren.js +34 -0
- package/lib/commonjs/utils/useRenderedChildren.js.map +1 -0
- package/lib/commonjs/utils/useWrappedOrderProps.js +35 -0
- package/lib/commonjs/utils/useWrappedOrderProps.js.map +1 -0
- package/lib/commonjs/utils/withKeyboardFocus.js +81 -96
- package/lib/commonjs/utils/withKeyboardFocus.js.map +1 -1
- package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js +57 -55
- package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
- package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js +51 -99
- package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js.map +1 -1
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.js.map +1 -1
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.js.map +1 -1
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js +4 -0
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js.map +1 -0
- package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +2 -1
- package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -1
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +2 -1
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -1
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +2 -1
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js +16 -53
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
- package/lib/module/components/index.js +5 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/index.js +20 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -3
- package/lib/module/nativeSpec/ExternalKeyboardViewNativeComponent.ts +12 -9
- package/lib/module/nativeSpec/KeyboardFocusGroupNativeComponent.ts +5 -3
- package/lib/module/nativeSpec/TextInputFocusWrapperNativeComponent.ts +7 -3
- package/lib/module/types/KeyboardFocusLock.types.js +12 -1
- package/lib/module/types/KeyboardFocusLock.types.js.map +1 -1
- package/lib/module/types/baseKeyboardView.types.js +4 -0
- package/lib/module/types/baseKeyboardView.types.js.map +1 -0
- package/lib/module/types/focus.types.js +4 -0
- package/lib/module/types/{FocusStyle.js.map → focus.types.js.map} +1 -1
- package/lib/module/types/focusOrder.types.js +31 -0
- package/lib/module/types/focusOrder.types.js.map +1 -0
- package/lib/module/types/focusStyle.types.js +4 -0
- package/lib/module/types/focusStyle.types.js.map +1 -0
- package/lib/module/types/index.js +3 -0
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/keyPress.types.js +4 -0
- package/lib/module/types/keyPress.types.js.map +1 -0
- package/lib/module/types/keyboardInput.types.js +4 -0
- package/lib/module/types/keyboardInput.types.js.map +1 -0
- package/lib/module/types/withKeyboardFocus.types.js +4 -0
- package/lib/module/types/withKeyboardFocus.types.js.map +1 -0
- package/lib/module/utils/mapLockFocus.js +32 -0
- package/lib/module/utils/mapLockFocus.js.map +1 -0
- package/lib/module/utils/useFocusStyle.js +4 -21
- package/lib/module/utils/useFocusStyle.js.map +1 -1
- package/lib/module/utils/useKeyboardFocusContainer.js +74 -0
- package/lib/module/utils/useKeyboardFocusContainer.js.map +1 -0
- package/lib/module/utils/useKeyboardPress/useKeyboardPress.android.js +4 -7
- package/lib/module/utils/useKeyboardPress/useKeyboardPress.android.js.map +1 -1
- package/lib/module/utils/useKeyboardPress/useKeyboardPress.ios.js +3 -6
- package/lib/module/utils/useKeyboardPress/useKeyboardPress.ios.js.map +1 -1
- package/lib/module/utils/useKeyboardPress/useKeyboardPress.js +9 -7
- package/lib/module/utils/useKeyboardPress/useKeyboardPress.js.map +1 -1
- package/lib/module/utils/useKeyboardPressState.js +60 -0
- package/lib/module/utils/useKeyboardPressState.js.map +1 -0
- package/lib/module/utils/useOnFocusChange.js +1 -1
- package/lib/module/utils/useOnFocusChange.js.map +1 -1
- package/lib/module/utils/useOrderValidation.js +30 -0
- package/lib/module/utils/useOrderValidation.js.map +1 -0
- package/lib/module/utils/useRenderedChildren.js +29 -0
- package/lib/module/utils/useRenderedChildren.js.map +1 -0
- package/lib/module/utils/useWrappedOrderProps.js +30 -0
- package/lib/module/utils/useWrappedOrderProps.js.map +1 -0
- package/lib/module/utils/withKeyboardFocus.js +84 -99
- package/lib/module/utils/withKeyboardFocus.js.map +1 -1
- package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts +30 -10
- package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts +187 -12
- package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.d.ts +4 -146
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.d.ts +2 -12
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.d.ts +4 -146
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.d.ts +13 -0
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts +28 -18
- package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable/Pressable.d.ts +14 -14
- package/lib/typescript/src/components/Touchable/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +5 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +694 -9
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts +2 -4
- package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts +6 -7
- package/lib/typescript/src/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpec/KeyboardFocusGroupNativeComponent.d.ts +2 -4
- package/lib/typescript/src/nativeSpec/KeyboardFocusGroupNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts +4 -4
- package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts +15 -1
- package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts.map +1 -1
- package/lib/typescript/src/types/KeyboardFocusView.types.d.ts +16 -14
- package/lib/typescript/src/types/KeyboardFocusView.types.d.ts.map +1 -1
- package/lib/typescript/src/types/baseKeyboardView.types.d.ts +119 -0
- package/lib/typescript/src/types/baseKeyboardView.types.d.ts.map +1 -0
- package/lib/typescript/src/types/focus.types.d.ts +35 -0
- package/lib/typescript/src/types/focus.types.d.ts.map +1 -0
- package/lib/typescript/src/types/focusOrder.types.d.ts +57 -0
- package/lib/typescript/src/types/focusOrder.types.d.ts.map +1 -0
- package/lib/typescript/src/types/focusStyle.types.d.ts +11 -0
- package/lib/typescript/src/types/focusStyle.types.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +11 -2
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/keyPress.types.d.ts +7 -0
- package/lib/typescript/src/types/keyPress.types.d.ts.map +1 -0
- package/lib/typescript/src/types/keyboardInput.types.d.ts +53 -0
- package/lib/typescript/src/types/keyboardInput.types.d.ts.map +1 -0
- package/lib/typescript/src/types/withKeyboardFocus.types.d.ts +109 -0
- package/lib/typescript/src/types/withKeyboardFocus.types.d.ts.map +1 -0
- package/lib/typescript/src/utils/mapLockFocus.d.ts +3 -0
- package/lib/typescript/src/utils/mapLockFocus.d.ts.map +1 -0
- package/lib/typescript/src/utils/useFocusStyle.d.ts +26 -34
- package/lib/typescript/src/utils/useFocusStyle.d.ts.map +1 -1
- package/lib/typescript/src/utils/useKeyboardFocusContainer.d.ts +898 -0
- package/lib/typescript/src/utils/useKeyboardFocusContainer.d.ts.map +1 -0
- package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.android.d.ts +2 -2
- package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.android.d.ts.map +1 -1
- package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.d.ts +4 -3
- package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.d.ts.map +1 -1
- package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.ios.d.ts +3 -3
- package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.ios.d.ts.map +1 -1
- package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.types.d.ts +1 -2
- package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.types.d.ts.map +1 -1
- package/lib/typescript/src/utils/useKeyboardPressState.d.ts +29 -0
- package/lib/typescript/src/utils/useKeyboardPressState.d.ts.map +1 -0
- package/lib/typescript/src/utils/useOnFocusChange.d.ts +3 -3
- package/lib/typescript/src/utils/useOnFocusChange.d.ts.map +1 -1
- package/lib/typescript/src/utils/useOrderValidation.d.ts +8 -0
- package/lib/typescript/src/utils/useOrderValidation.d.ts.map +1 -0
- package/lib/typescript/src/utils/useRenderedChildren.d.ts +18 -0
- package/lib/typescript/src/utils/useRenderedChildren.d.ts.map +1 -0
- package/lib/typescript/src/utils/useWrappedOrderProps.d.ts +13 -0
- package/lib/typescript/src/utils/useWrappedOrderProps.d.ts.map +1 -0
- package/lib/typescript/src/utils/withKeyboardFocus.d.ts +3 -4
- package/lib/typescript/src/utils/withKeyboardFocus.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/components/BaseKeyboardView/BaseKeyboardView.tsx +74 -94
- package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.tsx +49 -149
- package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.tsx +23 -32
- package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.tsx +32 -41
- package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.tsx +3 -14
- package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.ts +15 -0
- package/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.tsx +2 -2
- package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.tsx +2 -2
- package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.tsx +1 -1
- package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.tsx +2 -2
- package/src/components/KeyboardFocusView/KeyboardFocusView.tsx +29 -68
- package/src/components/Touchable/Pressable.tsx +2 -2
- package/src/components/index.ts +12 -0
- package/src/index.tsx +44 -32
- package/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -3
- package/src/nativeSpec/ExternalKeyboardViewNativeComponent.ts +12 -9
- package/src/nativeSpec/KeyboardFocusGroupNativeComponent.ts +5 -3
- package/src/nativeSpec/TextInputFocusWrapperNativeComponent.ts +7 -3
- package/src/types/KeyboardFocusLock.types.ts +16 -1
- package/src/types/KeyboardFocusView.types.ts +17 -18
- package/src/types/baseKeyboardView.types.ts +122 -0
- package/src/types/focus.types.ts +40 -0
- package/src/types/focusOrder.types.ts +59 -0
- package/src/types/{FocusStyle.ts → focusStyle.types.ts} +5 -0
- package/src/types/index.ts +32 -2
- package/src/types/keyPress.types.ts +8 -0
- package/src/types/keyboardInput.types.ts +81 -0
- package/src/types/withKeyboardFocus.types.ts +178 -0
- package/src/utils/mapLockFocus.ts +31 -0
- package/src/utils/useFocusStyle.tsx +13 -41
- package/src/utils/useKeyboardFocusContainer.ts +102 -0
- package/src/utils/useKeyboardPress/useKeyboardPress.android.ts +4 -7
- package/src/utils/useKeyboardPress/useKeyboardPress.ios.ts +3 -6
- package/src/utils/useKeyboardPress/useKeyboardPress.ts +9 -7
- package/src/utils/useKeyboardPress/useKeyboardPress.types.ts +1 -2
- package/src/utils/useKeyboardPressState.ts +81 -0
- package/src/utils/useOnFocusChange.ts +4 -7
- package/src/utils/useOrderValidation.ts +74 -0
- package/src/utils/useRenderedChildren.ts +42 -0
- package/src/utils/useWrappedOrderProps.ts +48 -0
- package/src/utils/withKeyboardFocus.tsx +105 -125
- package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js.map +0 -1
- package/lib/commonjs/components/KeyboardFocusView/hooks/index.js +0 -13
- package/lib/commonjs/components/KeyboardFocusView/hooks/index.js.map +0 -1
- package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/index.js +0 -13
- package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/index.js.map +0 -1
- package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js +0 -33
- package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js.map +0 -1
- package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js +0 -39
- package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js.map +0 -1
- package/lib/commonjs/components/RenderPropComponent/RenderPropComponent.js +0 -23
- package/lib/commonjs/components/RenderPropComponent/RenderPropComponent.js.map +0 -1
- package/lib/commonjs/types/BaseKeyboardView.js +0 -18
- package/lib/commonjs/types/BaseKeyboardView.js.map +0 -1
- package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js +0 -4
- package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js.map +0 -1
- package/lib/module/components/KeyboardFocusView/hooks/index.js +0 -4
- package/lib/module/components/KeyboardFocusView/hooks/index.js.map +0 -1
- package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/index.js +0 -4
- package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/index.js.map +0 -1
- package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js +0 -28
- package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js.map +0 -1
- package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js +0 -34
- package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js.map +0 -1
- package/lib/module/components/RenderPropComponent/RenderPropComponent.js +0 -17
- package/lib/module/components/RenderPropComponent/RenderPropComponent.js.map +0 -1
- package/lib/module/types/BaseKeyboardView.js +0 -14
- package/lib/module/types/BaseKeyboardView.js.map +0 -1
- package/lib/module/types/FocusStyle.js +0 -4
- package/lib/module/types/WithKeyboardFocus.js +0 -4
- package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts +0 -45
- package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts.map +0 -1
- package/lib/typescript/src/components/KeyboardFocusView/hooks/index.d.ts +0 -2
- package/lib/typescript/src/components/KeyboardFocusView/hooks/index.d.ts.map +0 -1
- package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/index.d.ts +0 -2
- package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/index.d.ts.map +0 -1
- package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.d.ts +0 -175
- package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.d.ts.map +0 -1
- package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.d.ts +0 -181
- package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.d.ts.map +0 -1
- package/lib/typescript/src/components/RenderPropComponent/RenderPropComponent.d.ts +0 -6
- package/lib/typescript/src/components/RenderPropComponent/RenderPropComponent.d.ts.map +0 -1
- package/lib/typescript/src/types/BaseKeyboardView.d.ts +0 -70
- package/lib/typescript/src/types/BaseKeyboardView.d.ts.map +0 -1
- package/lib/typescript/src/types/FocusStyle.d.ts +0 -6
- package/lib/typescript/src/types/FocusStyle.d.ts.map +0 -1
- package/lib/typescript/src/types/WithKeyboardFocus.d.ts +0 -47
- package/lib/typescript/src/types/WithKeyboardFocus.d.ts.map +0 -1
- package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.ts +0 -73
- package/src/components/KeyboardFocusView/hooks/index.ts +0 -1
- package/src/components/KeyboardFocusView/hooks/useFocusStyle/index.ts +0 -1
- package/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.ts +0 -34
- package/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.ts +0 -41
- package/src/components/RenderPropComponent/RenderPropComponent.tsx +0 -18
- package/src/types/BaseKeyboardView.ts +0 -74
- package/src/types/WithKeyboardFocus.ts +0 -115
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package com.externalkeyboard.views.base;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.view.View;
|
|
5
|
+
|
|
6
|
+
public class FocusableBase extends FocusHighlightBase {
|
|
7
|
+
protected boolean canBeFocused = true;
|
|
8
|
+
|
|
9
|
+
public FocusableBase(Context context) {
|
|
10
|
+
super(context);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public void setCanBeFocused (boolean isCanBeFocused) {
|
|
14
|
+
canBeFocused = isCanBeFocused;
|
|
15
|
+
syncFocusable();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@Override
|
|
19
|
+
public void setFocusableWrapper (boolean isFocusableWrapper) {
|
|
20
|
+
super.setFocusableWrapper(isFocusableWrapper);
|
|
21
|
+
syncFocusable();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public void linkAddView(View child) {
|
|
26
|
+
super.linkAddView(child);
|
|
27
|
+
syncFocusable();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
protected void syncFocusable () {
|
|
31
|
+
View view = getFocusTargetView();
|
|
32
|
+
if (view != null) {
|
|
33
|
+
view.setFocusable(canBeFocused);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusChangeBase.java
CHANGED
|
@@ -4,10 +4,10 @@ import android.content.Context;
|
|
|
4
4
|
import android.view.View;
|
|
5
5
|
|
|
6
6
|
import com.externalkeyboard.events.EventHelper;
|
|
7
|
-
import com.externalkeyboard.views.base.
|
|
7
|
+
import com.externalkeyboard.views.base.FocusableBase;
|
|
8
8
|
import com.facebook.react.bridge.ReactContext;
|
|
9
9
|
|
|
10
|
-
public class ViewFocusChangeBase extends
|
|
10
|
+
public class ViewFocusChangeBase extends FocusableBase {
|
|
11
11
|
private View listeningView;
|
|
12
12
|
private final Context context;
|
|
13
13
|
|
|
@@ -22,7 +22,6 @@ public class ViewFocusChangeBase extends FocusHighlightBase {
|
|
|
22
22
|
super.onAttachedToWindow();
|
|
23
23
|
|
|
24
24
|
this.listeningView = getFocusingView();
|
|
25
|
-
setFocusable(this.listeningView == this);
|
|
26
25
|
|
|
27
26
|
this.listeningView.setOnFocusChangeListener((focusedView, hasFocus) -> {
|
|
28
27
|
EventHelper.focusChanged((ReactContext) context, this.getId(), hasFocus);
|
package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusRequestBase.java
CHANGED
|
@@ -5,17 +5,9 @@ import android.view.View;
|
|
|
5
5
|
import android.view.ViewTreeObserver;
|
|
6
6
|
import android.view.accessibility.AccessibilityEvent;
|
|
7
7
|
|
|
8
|
-
import com.facebook.react.bridge.ReactContext;
|
|
9
|
-
import com.facebook.react.uimanager.UIManagerHelper;
|
|
10
|
-
import com.facebook.react.uimanager.common.ViewUtil;
|
|
11
|
-
import com.facebook.react.uimanager.events.Event;
|
|
12
|
-
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
13
|
-
import com.facebook.react.uimanager.events.EventDispatcherListener;
|
|
14
|
-
|
|
15
8
|
|
|
16
9
|
public class ViewFocusRequestBase extends ViewFocusChangeBase {
|
|
17
10
|
public boolean autoFocus = false;
|
|
18
|
-
public boolean enableA11yFocus = false;
|
|
19
11
|
public boolean hasBeenFocused = false;
|
|
20
12
|
public boolean hasBeenA11yFocused = false;
|
|
21
13
|
|
|
@@ -23,50 +15,17 @@ public class ViewFocusRequestBase extends ViewFocusChangeBase {
|
|
|
23
15
|
|
|
24
16
|
public int screenAutoA11yFocusDelay = 500;
|
|
25
17
|
|
|
26
|
-
private EventDispatcher a11yViewAppearDispatcher = null;
|
|
27
|
-
private EventDispatcherListener eventA11yViewAppearListener = null;
|
|
28
|
-
private final Context context;
|
|
29
|
-
|
|
30
18
|
public ViewFocusRequestBase(Context context) {
|
|
31
19
|
super(context);
|
|
32
|
-
this.context = context;
|
|
33
20
|
}
|
|
34
21
|
|
|
35
22
|
private void onRnScreenViewAppear() {
|
|
36
|
-
boolean a11yAutoFocus = autoFocus &&
|
|
23
|
+
boolean a11yAutoFocus = autoFocus && !hasBeenA11yFocused && screenAutoA11yFocus;
|
|
37
24
|
if (!a11yAutoFocus) return;
|
|
38
25
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
a11yViewAppearDispatcher = UIManagerHelper.getEventDispatcher((ReactContext) context, uiManagerType);
|
|
43
|
-
if (a11yViewAppearDispatcher == null) return;
|
|
44
|
-
View focusingView = this.getFocusingView();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
eventA11yViewAppearListener = new EventDispatcherListener() {
|
|
48
|
-
@Override
|
|
49
|
-
public void onEventDispatch(Event event) {
|
|
50
|
-
if ("topClick".equals(event.getEventName())) {
|
|
51
|
-
a11yViewAppearDispatcher.removeListener(this);
|
|
52
|
-
eventA11yViewAppearListener = null;
|
|
53
|
-
hasBeenA11yFocused = true;
|
|
54
|
-
}
|
|
55
|
-
if ("topFinishTransitioning".equals(event.getEventName()) || "topShow".equals(event.getEventName())) {
|
|
56
|
-
if (hasBeenA11yFocused) return;
|
|
57
|
-
hasBeenA11yFocused = true;
|
|
58
|
-
|
|
59
|
-
focusingView.postDelayed(() -> {
|
|
60
|
-
focus(false, true);
|
|
61
|
-
a11yViewAppearDispatcher.removeListener(this);
|
|
62
|
-
eventA11yViewAppearListener = null;
|
|
63
|
-
}, screenAutoA11yFocusDelay);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
a11yViewAppearDispatcher.addListener(eventA11yViewAppearListener);
|
|
68
|
-
} catch (Exception ignored) {
|
|
69
|
-
}
|
|
26
|
+
hasBeenA11yFocused = true;
|
|
27
|
+
View focusingView = this.getFocusingView();
|
|
28
|
+
focusingView.postDelayed(() -> focus(false, true), screenAutoA11yFocusDelay);
|
|
70
29
|
}
|
|
71
30
|
|
|
72
31
|
@Override
|
|
@@ -79,16 +38,6 @@ public class ViewFocusRequestBase extends ViewFocusChangeBase {
|
|
|
79
38
|
}
|
|
80
39
|
}
|
|
81
40
|
|
|
82
|
-
@Override
|
|
83
|
-
protected void onDetachedFromWindow() {
|
|
84
|
-
super.onDetachedFromWindow();
|
|
85
|
-
if (this.a11yViewAppearDispatcher != null && this.eventA11yViewAppearListener != null) {
|
|
86
|
-
this.a11yViewAppearDispatcher.removeListener(this.eventA11yViewAppearListener);
|
|
87
|
-
a11yViewAppearDispatcher = null;
|
|
88
|
-
eventA11yViewAppearListener = null;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
41
|
private void autoFocusOnDraw() {
|
|
93
42
|
getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
|
|
94
43
|
@Override
|
|
@@ -102,9 +51,9 @@ public class ViewFocusRequestBase extends ViewFocusChangeBase {
|
|
|
102
51
|
});
|
|
103
52
|
}
|
|
104
53
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
54
|
+
public void a11yFocus() {
|
|
55
|
+
View focusingView = this.getFocusingView();
|
|
56
|
+
focusingView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
|
|
108
57
|
}
|
|
109
58
|
|
|
110
59
|
public void focus(boolean keyboard, boolean a11y) {
|
|
@@ -112,9 +61,9 @@ public class ViewFocusRequestBase extends ViewFocusChangeBase {
|
|
|
112
61
|
if (keyboard) {
|
|
113
62
|
focusingView.requestFocus();
|
|
114
63
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
64
|
+
if (a11y) {
|
|
65
|
+
a11yFocus();
|
|
66
|
+
}
|
|
118
67
|
}
|
|
119
68
|
|
|
120
69
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package com.externalkeyboard;
|
|
2
|
+
|
|
3
|
+
import android.view.View;
|
|
4
|
+
|
|
5
|
+
// Marker-free copy of the codegen com.facebook.react.viewmanagers interface.
|
|
6
|
+
// See ExternalKeyboardViewManagerInterface for rationale.
|
|
7
|
+
public interface ExternalKeyboardLockViewManagerInterface<T extends View> {
|
|
8
|
+
void setComponentType(T view, int value);
|
|
9
|
+
void setLockDisabled(T view, boolean value);
|
|
10
|
+
void setForceLock(T view, boolean value);
|
|
11
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
package com.externalkeyboard;
|
|
2
|
+
|
|
3
|
+
import android.view.View;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
// Marker-free copy of the codegen com.facebook.react.viewmanagers interface.
|
|
7
|
+
// Intentionally does NOT extend ViewManagerWithGeneratedInterface so that
|
|
8
|
+
// ViewManager#getDelegate() takes its default (reflection-based) path instead of
|
|
9
|
+
// logging a ReactNoCrashSoftException, while still covering the full @ReactProp
|
|
10
|
+
// hierarchy (BaseViewManager + ReactViewManager extras + our props).
|
|
11
|
+
public interface ExternalKeyboardViewManagerInterface<T extends View> {
|
|
12
|
+
void setCanBeFocused(T view, boolean value);
|
|
13
|
+
void setHasKeyDownPress(T view, boolean value);
|
|
14
|
+
void setHasKeyUpPress(T view, boolean value);
|
|
15
|
+
void setHasOnFocusChanged(T view, boolean value);
|
|
16
|
+
void setAutoFocus(T view, boolean value);
|
|
17
|
+
void setHaloEffect(T view, boolean value);
|
|
18
|
+
void setHaloCornerRadius(T view, float value);
|
|
19
|
+
void setHaloExpendX(T view, float value);
|
|
20
|
+
void setHaloExpendY(T view, float value);
|
|
21
|
+
void setRoundedHaloFix(T view, boolean value);
|
|
22
|
+
void setTintColor(T view, @Nullable Integer value);
|
|
23
|
+
void setFocusableWrapper(T view, boolean value);
|
|
24
|
+
void setGroupIdentifier(T view, @Nullable String value);
|
|
25
|
+
void setScreenAutoA11yFocus(T view, boolean value);
|
|
26
|
+
void setScreenAutoA11yFocusDelay(T view, int value);
|
|
27
|
+
void setOrderGroup(T view, @Nullable String value);
|
|
28
|
+
void setOrderIndex(T view, int value);
|
|
29
|
+
void setLockFocus(T view, int value);
|
|
30
|
+
void setOrderId(T view, @Nullable String value);
|
|
31
|
+
void setOrderLeft(T view, @Nullable String value);
|
|
32
|
+
void setOrderRight(T view, @Nullable String value);
|
|
33
|
+
void setOrderUp(T view, @Nullable String value);
|
|
34
|
+
void setOrderDown(T view, @Nullable String value);
|
|
35
|
+
void setOrderForward(T view, @Nullable String value);
|
|
36
|
+
void setOrderBackward(T view, @Nullable String value);
|
|
37
|
+
void setOrderFirst(T view, @Nullable String value);
|
|
38
|
+
void setOrderLast(T view, @Nullable String value);
|
|
39
|
+
void setEnableContextMenu(T view, boolean value);
|
|
40
|
+
void rnekKeyboardFocus(T view);
|
|
41
|
+
void rnekScreenReaderFocus(T view);
|
|
42
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
package com.externalkeyboard;
|
|
2
|
+
|
|
3
|
+
import android.view.View;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
// Marker-free copy of the codegen com.facebook.react.viewmanagers interface.
|
|
7
|
+
// See ExternalKeyboardViewManagerInterface for rationale.
|
|
8
|
+
public interface KeyboardFocusGroupManagerInterface<T extends View> {
|
|
9
|
+
void setTintColor(T view, @Nullable Integer value);
|
|
10
|
+
void setGroupIdentifier(T view, @Nullable String value);
|
|
11
|
+
void setOrderGroup(T view, @Nullable String value);
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
package com.externalkeyboard;
|
|
2
|
+
|
|
3
|
+
import android.view.View;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
// Marker-free copy of the codegen com.facebook.react.viewmanagers interface.
|
|
7
|
+
// See ExternalKeyboardViewManagerInterface for rationale.
|
|
8
|
+
public interface TextInputFocusWrapperManagerInterface<T extends View> {
|
|
9
|
+
void setFocusType(T view, int value);
|
|
10
|
+
void setBlurType(T view, int value);
|
|
11
|
+
void setCanBeFocused(T view, boolean value);
|
|
12
|
+
void setHasOnFocusChanged(T view, boolean value);
|
|
13
|
+
void setHaloEffect(T view, boolean value);
|
|
14
|
+
void setHaloCornerRadius(T view, float value);
|
|
15
|
+
void setHaloExpendX(T view, float value);
|
|
16
|
+
void setHaloExpendY(T view, float value);
|
|
17
|
+
void setRoundedHaloFix(T view, boolean value);
|
|
18
|
+
void setTintColor(T view, @Nullable Integer value);
|
|
19
|
+
void setBlurOnSubmit(T view, boolean value);
|
|
20
|
+
void setMultiline(T view, boolean value);
|
|
21
|
+
void setGroupIdentifier(T view, @Nullable String value);
|
|
22
|
+
void setLockFocus(T view, int value);
|
|
23
|
+
void setOrderGroup(T view, @Nullable String value);
|
|
24
|
+
void setOrderIndex(T view, int value);
|
|
25
|
+
void setOrderId(T view, @Nullable String value);
|
|
26
|
+
void setOrderLeft(T view, @Nullable String value);
|
|
27
|
+
void setOrderRight(T view, @Nullable String value);
|
|
28
|
+
void setOrderUp(T view, @Nullable String value);
|
|
29
|
+
void setOrderDown(T view, @Nullable String value);
|
|
30
|
+
void setOrderForward(T view, @Nullable String value);
|
|
31
|
+
void setOrderBackward(T view, @Nullable String value);
|
|
32
|
+
void setOrderFirst(T view, @Nullable String value);
|
|
33
|
+
void setOrderLast(T view, @Nullable String value);
|
|
34
|
+
}
|
|
@@ -2,17 +2,7 @@ package com.externalkeyboard;
|
|
|
2
2
|
|
|
3
3
|
import android.view.ViewGroup;
|
|
4
4
|
|
|
5
|
-
import androidx.annotation.Nullable;
|
|
6
|
-
|
|
7
5
|
import com.facebook.react.views.view.ReactViewManager;
|
|
8
|
-
import com.facebook.react.uimanager.ViewManagerDelegate;
|
|
9
|
-
import com.facebook.react.viewmanagers.TextInputFocusWrapperManagerDelegate;
|
|
10
|
-
import com.facebook.react.viewmanagers.TextInputFocusWrapperManagerInterface;
|
|
11
6
|
|
|
12
7
|
public abstract class TextInputFocusWrapperManagerSpec<T extends ViewGroup> extends ReactViewManager implements TextInputFocusWrapperManagerInterface<T> {
|
|
13
|
-
private final ViewManagerDelegate<T> mDelegate;
|
|
14
|
-
|
|
15
|
-
public TextInputFocusWrapperManagerSpec() {
|
|
16
|
-
mDelegate = new TextInputFocusWrapperManagerDelegate(this);
|
|
17
|
-
}
|
|
18
8
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.externalkeyboard.helper;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactContext;
|
|
4
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
5
|
+
import com.facebook.react.uimanager.UIManagerHelper;
|
|
6
|
+
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
7
|
+
import com.facebook.react.uimanager.events.EventDispatcherProvider;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* New Architecture implementation. Prefers the bridgeless {@link EventDispatcherProvider}
|
|
11
|
+
* path — the way RN 0.85+'s {@code UIManagerHelper.getEventDispatcher(context)} works,
|
|
12
|
+
* without the deprecated reactTag. Fabric can still run on the legacy Bridge (e.g. on
|
|
13
|
+
* rn < 0.79, or whenever bridgeless is disabled), where the context is not an
|
|
14
|
+
* {@link EventDispatcherProvider}; that case falls back to the reactTag lookup.
|
|
15
|
+
*/
|
|
16
|
+
public class ReactNativeEventDispatcher {
|
|
17
|
+
@SuppressWarnings("deprecation")
|
|
18
|
+
public static EventDispatcher getEventDispatcher(ReactContext context, int id) {
|
|
19
|
+
ReactContext reactContext = context;
|
|
20
|
+
if (reactContext instanceof ThemedReactContext) {
|
|
21
|
+
reactContext = ((ThemedReactContext) reactContext).getReactApplicationContext();
|
|
22
|
+
}
|
|
23
|
+
if (reactContext instanceof EventDispatcherProvider) {
|
|
24
|
+
return ((EventDispatcherProvider) reactContext).getEventDispatcher();
|
|
25
|
+
}
|
|
26
|
+
return UIManagerHelper.getEventDispatcherForReactTag(context, id);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -15,7 +15,9 @@ public abstract class ExternalKeyboardViewManagerSpec<T extends ViewGroup> exten
|
|
|
15
15
|
|
|
16
16
|
public abstract void setHasKeyUpPress(T view, boolean value);
|
|
17
17
|
|
|
18
|
-
public abstract void
|
|
18
|
+
public abstract void rnekKeyboardFocus(ExternalKeyboardView view);
|
|
19
|
+
|
|
20
|
+
public abstract void rnekScreenReaderFocus(ExternalKeyboardView view);
|
|
19
21
|
|
|
20
22
|
public abstract void setAutoFocus(ExternalKeyboardView view, @Nullable boolean value);
|
|
21
23
|
|
|
@@ -25,7 +27,7 @@ public abstract class ExternalKeyboardViewManagerSpec<T extends ViewGroup> exten
|
|
|
25
27
|
|
|
26
28
|
public abstract void setHaloEffect(ExternalKeyboardView view, boolean value);
|
|
27
29
|
|
|
28
|
-
public abstract void
|
|
30
|
+
public abstract void setFocusableWrapper(ExternalKeyboardView view, boolean value);
|
|
29
31
|
|
|
30
32
|
public abstract void setHaloCornerRadius(ExternalKeyboardView view, float value);
|
|
31
33
|
|
|
@@ -33,9 +35,9 @@ public abstract class ExternalKeyboardViewManagerSpec<T extends ViewGroup> exten
|
|
|
33
35
|
|
|
34
36
|
public abstract void setHaloExpendY(ExternalKeyboardView view, float value);
|
|
35
37
|
|
|
36
|
-
public abstract void
|
|
38
|
+
public abstract void setRoundedHaloFix(ExternalKeyboardView view, boolean value);
|
|
37
39
|
|
|
38
|
-
public abstract void
|
|
40
|
+
public abstract void setGroupIdentifier(ExternalKeyboardView view, @Nullable String value);
|
|
39
41
|
|
|
40
42
|
public abstract void setScreenAutoA11yFocus(ExternalKeyboardView wrapper, boolean enableA11yFocus);
|
|
41
43
|
|
|
@@ -10,6 +10,8 @@ import com.facebook.react.views.view.ReactViewManager;
|
|
|
10
10
|
public abstract class TextInputFocusWrapperManagerSpec<T extends ViewGroup> extends ReactViewManager {
|
|
11
11
|
public abstract void setCanBeFocused(T wrapper, boolean canBeFocused);
|
|
12
12
|
|
|
13
|
+
public abstract void setHasOnFocusChanged(T wrapper, boolean value);
|
|
14
|
+
|
|
13
15
|
public abstract void setFocusType(T wrapper, int focusType);
|
|
14
16
|
|
|
15
17
|
public abstract void setBlurType(T wrapper, int blurType);
|
|
@@ -53,4 +55,6 @@ public abstract class TextInputFocusWrapperManagerSpec<T extends ViewGroup> exte
|
|
|
53
55
|
public abstract void setHaloExpendX(TextInputFocusWrapper view, float value);
|
|
54
56
|
|
|
55
57
|
public abstract void setHaloCornerRadius(TextInputFocusWrapper view, float value);
|
|
58
|
+
|
|
59
|
+
public abstract void setRoundedHaloFix(TextInputFocusWrapper view, boolean value);
|
|
56
60
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package com.externalkeyboard.helper;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactContext;
|
|
4
|
+
import com.facebook.react.uimanager.UIManagerHelper;
|
|
5
|
+
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Legacy (Bridge / old architecture) implementation. The non-bridgeless context is not
|
|
9
|
+
* an {@code EventDispatcherProvider}, so the dispatcher is resolved by reactTag.
|
|
10
|
+
*/
|
|
11
|
+
public class ReactNativeEventDispatcher {
|
|
12
|
+
public static EventDispatcher getEventDispatcher(ReactContext context, int id) {
|
|
13
|
+
return UIManagerHelper.getEventDispatcherForReactTag(context, id);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
// ToDo RNCEKV-2, Double check condition, count more then 1 means that a view can be a ViewGroup, bun when we use hover component it can be considered as ViewGroup instead of touchable component, it can be improved by flag, or by removing hover component from js implementation
|
|
59
59
|
- (UIView *)getFocusingView {
|
|
60
|
-
if (_delegate.
|
|
60
|
+
if (!_delegate.focusableWrapper) {
|
|
61
61
|
return _delegate;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
- (instancetype _Nonnull)initWithView:(UIView<RNCEKVHaloProtocol> *_Nonnull)view;
|
|
17
17
|
|
|
18
|
-
@property (nonatomic, readonly, nullable) UIFocusEffect *focusEffect;
|
|
18
|
+
@property (nonatomic, readonly, nullable) UIFocusEffect *focusEffect API_AVAILABLE(ios(15.0));
|
|
19
|
+
- (void)observeCornerRadius:(CGFloat)radius;
|
|
19
20
|
- (void)invalidate;
|
|
20
21
|
- (void)clear;
|
|
21
22
|
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
UIFocusEffect *_currentEffect;
|
|
20
20
|
BOOL _isDirty;
|
|
21
21
|
CGRect _prevBounds;
|
|
22
|
+
CGFloat _prevRadius;
|
|
23
|
+
// Last non-zero layer.cornerRadius we observed. RN's invalidateLayer toggles
|
|
24
|
+
// the live cornerRadius between the styled value and 0 (its two border-render
|
|
25
|
+
// paths); we pin the halo to this stable value so it stops following the 0.
|
|
26
|
+
CGFloat _stableRadius;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
- (instancetype _Nonnull)initWithView:(UIView<RNCEKVHaloProtocol> *_Nonnull)delegate {
|
|
@@ -28,36 +33,65 @@
|
|
|
28
33
|
_currentEffect = nil;
|
|
29
34
|
_isDirty = YES;
|
|
30
35
|
_prevBounds = CGRectZero;
|
|
36
|
+
_prevRadius = -1;
|
|
37
|
+
_stableRadius = 0;
|
|
31
38
|
}
|
|
32
39
|
return self;
|
|
33
40
|
}
|
|
34
41
|
|
|
35
|
-
- (UIFocusEffect *)focusEffect {
|
|
42
|
+
- (UIFocusEffect *)focusEffect API_AVAILABLE(ios(15.0)) {
|
|
36
43
|
if (_delegate.isHaloHidden) {
|
|
37
44
|
return [RNCEKVFocusEffectUtility emptyFocusEffect];
|
|
38
45
|
}
|
|
39
46
|
|
|
47
|
+
UIView *focusingView = [_delegate getFocusTargetView];
|
|
48
|
+
|
|
49
|
+
// Track the view's intended corner radius, ignoring the transient 0 RN sets
|
|
50
|
+
// while it draws the image-based border. The view also feeds us this value
|
|
51
|
+
// from its layout passes (see -observeCornerRadius:), so by the time UIKit
|
|
52
|
+
// queries the effect _stableRadius is already correct even if RN happens to
|
|
53
|
+
// have the live radius at 0 right now.
|
|
54
|
+
[self observeCornerRadius:focusingView.layer.cornerRadius];
|
|
55
|
+
|
|
56
|
+
// Explicit haloCornerRadius wins; otherwise pin to the view's stable radius.
|
|
57
|
+
CGFloat cornerRadius = _delegate.haloCornerRadius > 0 ? _delegate.haloCornerRadius
|
|
58
|
+
: _stableRadius;
|
|
59
|
+
|
|
60
|
+
// With roundedHaloFix on we always supply our own halo (a fixed rounded rect)
|
|
61
|
+
// rather than returning nil and falling back to the system halo — that system
|
|
62
|
+
// halo follows the squared layer, which is what caused the blink and the
|
|
63
|
+
// square/"default" halo.
|
|
40
64
|
BOOL hasCustomSettings = _delegate.haloExpendX || _delegate.haloExpendY || _delegate.haloCornerRadius;
|
|
41
|
-
if (!hasCustomSettings) {
|
|
65
|
+
if (!hasCustomSettings && !_delegate.roundedHaloFix) {
|
|
42
66
|
return nil;
|
|
43
67
|
}
|
|
44
68
|
|
|
45
|
-
UIView *focusingView = [_delegate getFocusTargetView];
|
|
46
69
|
BOOL boundsChanged = !CGRectEqualToRect(_prevBounds, focusingView.bounds);
|
|
70
|
+
BOOL radiusChanged = _prevRadius != cornerRadius;
|
|
47
71
|
|
|
48
|
-
if (_isDirty || boundsChanged) {
|
|
72
|
+
if (_isDirty || boundsChanged || radiusChanged) {
|
|
49
73
|
_isDirty = NO;
|
|
50
74
|
_prevBounds = focusingView.bounds;
|
|
75
|
+
_prevRadius = cornerRadius;
|
|
51
76
|
|
|
52
77
|
_currentEffect = [RNCEKVFocusEffectUtility getFocusEffect:focusingView
|
|
53
78
|
withExpandedX:_delegate.haloExpendX
|
|
54
79
|
withExpandedY:_delegate.haloExpendY
|
|
55
|
-
withCornerRadius:
|
|
80
|
+
withCornerRadius:cornerRadius];
|
|
56
81
|
}
|
|
57
82
|
|
|
58
83
|
return _currentEffect;
|
|
59
84
|
}
|
|
60
85
|
|
|
86
|
+
- (void)observeCornerRadius:(CGFloat)radius {
|
|
87
|
+
// Remember the last non-zero radius so the transient 0 from RN's image-border
|
|
88
|
+
// path never reaches the halo.
|
|
89
|
+
if (radius > 0 && radius != _stableRadius) {
|
|
90
|
+
_stableRadius = radius;
|
|
91
|
+
_isDirty = YES; // force the effect to be rebuilt at the new radius
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
61
95
|
- (void)invalidate {
|
|
62
96
|
_isDirty = YES;
|
|
63
97
|
}
|
|
@@ -66,6 +100,8 @@
|
|
|
66
100
|
_currentEffect = nil;
|
|
67
101
|
_isDirty = YES;
|
|
68
102
|
_prevBounds = CGRectZero;
|
|
103
|
+
_prevRadius = -1;
|
|
104
|
+
_stableRadius = 0;
|
|
69
105
|
}
|
|
70
106
|
|
|
71
107
|
@end
|
|
@@ -9,14 +9,13 @@
|
|
|
9
9
|
#import "RCTScrollView.h"
|
|
10
10
|
#import "RNCEKVSwizzleInstanceMethod.h"
|
|
11
11
|
|
|
12
|
+
static void RNCEKVRCTScrollViewSwizzle(void) {
|
|
13
|
+
RNCEKVSwizzleInstanceMethod([RCTScrollView class], @selector(initWithEventDispatcher:), @selector(rncekvInitWithEventDispatcher:));
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
@implementation RCTScrollView (RNCEKVExternalKeyboard)
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
static dispatch_once_t onceToken;
|
|
16
|
-
dispatch_once(&onceToken, ^{
|
|
17
|
-
RNCEKVSwizzleInstanceMethod([self class], @selector(initWithEventDispatcher:), @selector(rncekvInitWithEventDispatcher:));
|
|
18
|
-
});
|
|
19
|
-
}
|
|
18
|
+
RNCEKV_INSTALL_SWIZZLES(RNCEKVRCTScrollViewSwizzle)
|
|
20
19
|
|
|
21
20
|
- (instancetype)rncekvInitWithEventDispatcher:(CGRect)frame {
|
|
22
21
|
RCTScrollView *rctView = [self rncekvInitWithEventDispatcher:frame];
|
|
@@ -12,13 +12,19 @@
|
|
|
12
12
|
#import "RNCEKVSwizzleInstanceMethod.h"
|
|
13
13
|
#import "RCTScrollViewComponentView.h"
|
|
14
14
|
|
|
15
|
+
static void RNCEKVEnhancedScrollViewSwizzle(void) {
|
|
16
|
+
RNCEKVSwizzleInstanceMethod([RCTEnhancedScrollView class], @selector(initWithFrame:), @selector(rncekvInitWithFrame:));
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
@implementation RCTEnhancedScrollView (RNCEKVExternalKeyboard)
|
|
16
20
|
|
|
21
|
+
RNCEKV_INSTALL_SWIZZLES(RNCEKVEnhancedScrollViewSwizzle)
|
|
22
|
+
|
|
17
23
|
- (NSArray<id<UIFocusEnvironment>> *)preferredFocusEnvironments {
|
|
18
24
|
@try {
|
|
19
25
|
BOOL isScrollViewComponent = self.superview &&
|
|
20
26
|
[self.superview isKindOfClass:[RCTScrollViewComponentView class]];
|
|
21
|
-
|
|
27
|
+
|
|
22
28
|
if (isScrollViewComponent) {
|
|
23
29
|
RCTScrollViewComponentView *scrollViewComponent = (RCTScrollViewComponentView *)self.superview;
|
|
24
30
|
return @[scrollViewComponent.containerView];
|
|
@@ -26,15 +32,8 @@
|
|
|
26
32
|
}
|
|
27
33
|
@catch (NSException *exception) {
|
|
28
34
|
}
|
|
29
|
-
|
|
30
|
-
return [super preferredFocusEnvironments];
|
|
31
|
-
}
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
static dispatch_once_t onceToken;
|
|
35
|
-
dispatch_once(&onceToken, ^{
|
|
36
|
-
RNCEKVSwizzleInstanceMethod([self class], @selector(initWithFrame:), @selector(rncekvInitWithFrame:));
|
|
37
|
-
});
|
|
36
|
+
return [super preferredFocusEnvironments];
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
- (instancetype)rncekvInitWithFrame:(CGRect)frame {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
@end
|
|
31
31
|
|
|
32
32
|
@implementation RCTUITextField (RNCEKVExternalKeyboard)
|
|
33
|
-
- (UIFocusEffect*)focusEffect {
|
|
33
|
+
- (UIFocusEffect*)focusEffect API_AVAILABLE(ios(15.0)) {
|
|
34
34
|
id superParent = self.superview.superview;
|
|
35
35
|
if (superParent != nil && [superParent conformsToProtocol:@protocol(RNCEKVCustomFocusEffectProtocol)]) {
|
|
36
36
|
id<RNCEKVCustomFocusEffectProtocol> parent = (id<RNCEKVCustomFocusEffectProtocol>)superParent;
|