From bbfef6ee8a644ea3709b73c69c13277fef9fd286 Mon Sep 17 00:00:00 2001 From: Douglas Nassif Roma Junior Date: Thu, 2 May 2024 13:42:20 -0300 Subject: [PATCH] Update IQKeyboardManager to 7.0.2 --- .eslintrc.js | 2 +- ReactNativeKeyboardManager.podspec | 2 +- Sample/.buckconfig | 6 - Sample/.eslintrc.js | 14 +- Sample/.gitignore | 33 +- Sample/.watchmanconfig | 2 +- Sample/App.tsx | 99 +- Sample/README.md | 79 + .../__tests__/{App-test.tsx => App.test.tsx} | 3 + Sample/app.json | 2 +- Sample/babel.config.js | 2 +- Sample/install.sh | 2 +- Sample/ios/.xcode.env | 11 + Sample/ios/Podfile | 39 +- Sample/ios/Podfile.lock | 1671 +++- .../project.pbxproj | 64 +- .../AppDelegate.h | 6 +- .../AppDelegate.mm | 97 +- .../Info.plist | 19 +- .../PrivacyInfo.xcprivacy | 38 + Sample/jest.config.js | 3 + Sample/metro.config.js | 20 +- Sample/package.json | 53 +- Sample/tsconfig.json | 104 +- Sample/yarn.lock | 6871 ++++++++--------- babel.config.js | 2 +- dist/.gitkeep | 1 - .../ReactNativeKeyboardManager.m | 66 +- package.json | 24 +- src/index.ts | 11 +- tsconfig.json | 5 +- yarn.lock | 3512 ++++----- 32 files changed, 6548 insertions(+), 6315 deletions(-) delete mode 100644 Sample/.buckconfig create mode 100644 Sample/README.md rename Sample/__tests__/{App-test.tsx => App.test.tsx} (73%) create mode 100644 Sample/ios/.xcode.env create mode 100644 Sample/ios/ReactNativeKeyboardManagerSample/PrivacyInfo.xcprivacy create mode 100644 Sample/jest.config.js delete mode 100644 dist/.gitkeep diff --git a/.eslintrc.js b/.eslintrc.js index 40c6dcd..187894b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,4 @@ module.exports = { root: true, - extends: '@react-native-community', + extends: '@react-native', }; diff --git a/ReactNativeKeyboardManager.podspec b/ReactNativeKeyboardManager.podspec index 4fbdeff..e9251c1 100644 --- a/ReactNativeKeyboardManager.podspec +++ b/ReactNativeKeyboardManager.podspec @@ -14,7 +14,7 @@ Pod::Spec.new do |s| s.license = packageJson["license"] s.authors = packageJson["author"] s.source = { :git => repository, :tag => version } - s.platform = :ios, "9.0" + s.platform = :ios, "13.0" s.preserve_paths = 'README.md', 'package.json', '*.js' s.source_files = 'ios/ReactNativeKeyboardManager/**/*.{h,m}' diff --git a/Sample/.buckconfig b/Sample/.buckconfig deleted file mode 100644 index 934256c..0000000 --- a/Sample/.buckconfig +++ /dev/null @@ -1,6 +0,0 @@ - -[android] - target = Google Inc.:Google APIs:23 - -[maven_repositories] - central = https://repo1.maven.org/maven2 diff --git a/Sample/.eslintrc.js b/Sample/.eslintrc.js index dcf0be0..187894b 100644 --- a/Sample/.eslintrc.js +++ b/Sample/.eslintrc.js @@ -1,16 +1,4 @@ module.exports = { root: true, - extends: '@react-native-community', - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - overrides: [ - { - files: ['*.ts', '*.tsx'], - rules: { - '@typescript-eslint/no-shadow': ['error'], - 'no-shadow': 'off', - 'no-undef': 'off', - }, - }, - ], + extends: '@react-native', }; diff --git a/Sample/.gitignore b/Sample/.gitignore index 81570d9..d5ae456 100644 --- a/Sample/.gitignore +++ b/Sample/.gitignore @@ -20,6 +20,7 @@ DerivedData *.hmap *.ipa *.xcuserstate +**/.xcode.env.local # Android/IntelliJ # @@ -29,6 +30,9 @@ build/ local.properties *.iml *.hprof +.cxx/ +*.keystore +!debug.keystore # node.js # @@ -36,12 +40,6 @@ node_modules/ npm-debug.log yarn-error.log -# BUCK -buck-out/ -\.buckd/ -*.keystore -!debug.keystore - # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the @@ -49,13 +47,28 @@ buck-out/ # For more information about the recommended setup visit: # https://docs.fastlane.tools/best-practices/source-control/ -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output # Bundle artifact *.jsbundle # Ruby / CocoaPods -/ios/Pods/ +**/Pods/ /vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* + +# testing +/coverage + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/Sample/.watchmanconfig b/Sample/.watchmanconfig index 9e26dfe..0967ef4 100644 --- a/Sample/.watchmanconfig +++ b/Sample/.watchmanconfig @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/Sample/App.tsx b/Sample/App.tsx index afabc6f..4a6ea78 100644 --- a/Sample/App.tsx +++ b/Sample/App.tsx @@ -32,6 +32,8 @@ import { Modal, SafeAreaView, Platform, + Keyboard, + Button, } from 'react-native'; import KeyboardManager, {PreviousNextView} from 'react-native-keyboard-manager'; @@ -43,14 +45,14 @@ if (Platform.OS === 'ios') { KeyboardManager.setLayoutIfNeededOnUpdate(true); KeyboardManager.setEnableAutoToolbar(true); KeyboardManager.setToolbarDoneBarButtonItemText('Done'); - KeyboardManager.setToolbarManageBehaviourBy('subviews'); // "subviews" | "tag" | "position" + KeyboardManager.setToolbarManageBehavior('subviews'); // "subviews" | "tag" | "position" KeyboardManager.setToolbarPreviousNextButtonEnable(true); KeyboardManager.setToolbarTintColor('#FF00FF'); // Only #000000 format is supported KeyboardManager.setToolbarBarTintColor('#FFFF00'); // Only #000000 format is supported - KeyboardManager.setShouldShowToolbarPlaceholder(true); - KeyboardManager.setOverrideKeyboardAppearance(false); + KeyboardManager.setToolbarShowPlaceholder(true); + KeyboardManager.setKeyboardOverrideAppearance(false); KeyboardManager.setKeyboardAppearance('default'); // "default" | "light" | "dark" - KeyboardManager.setShouldResignOnTouchOutside(true); + KeyboardManager.setResignOnTouchOutside(true); KeyboardManager.setShouldPlayInputClicks(true); } @@ -68,6 +70,7 @@ const INPUT_KEYS = [ ]; type StateType = { + modalVisible?: boolean; enableDisable?: boolean; inputsValues: { [key: string]: string; @@ -79,6 +82,7 @@ class App extends Component { super(props); this.state = { + modalVisible: false, enableDisable: true, inputsValues: {}, }; @@ -89,18 +93,28 @@ class App extends Component { } componentDidUpdate() { - KeyboardManager.isKeyboardShowing().then(isShowing => { - console.log('isKeyboardShowing: ' + isShowing); - }); + console.log('isKeyboardShowing: ' + Keyboard.isVisible()); } - onEnableDisable = (value: boolean) => { + handleEnableDisable = (value: boolean) => { KeyboardManager.setEnable(value); this.setState({ enableDisable: value, }); }; + handleShowModal = () => { + this.setState({ + modalVisible: true, + }); + }; + + handleCloseModal = () => { + this.setState({ + modalVisible: false, + }); + }; + getRef(key: string) { // eslint-disable-next-line react/no-string-refs return this.refs[key] as T; @@ -156,39 +170,50 @@ class App extends Component { ); }; + renderContent = () => { + return ( + + + + React-Native Keyboard Manager + + + Enable/Disable + + + + + {INPUT_KEYS.map(this.renderInput)} + + ); + }; + render() { return ( - {/* To try with Modal, uncomment the two following lines. */} - {/* */} - {/* */} - - {/* ScrollView is not required, but may be needed in some cases. */} - - - - React-Native Keyboard Manager - - - Enable/Disable - - - - - {INPUT_KEYS.map(this.renderInput)} - - - {/* */} - {/* */} +