react-native-navigation-mode 1.2.6 → 1.2.7

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  🧭 Detect Android navigation mode (3-button, 2-button, or gesture navigation) with native precision using Turbo modules.
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/react-native-navigation-mode)](https://badge.fury.io/js/react-native-navigation-mode) [![License](https://img.shields.io/github/license/JairajJangle/react-native-navigation-mode)](https://github.com/JairajJangle/react-native-navigation-mode/blob/main/LICENSE) [![Workflow Status](https://github.com/JairajJangle/react-native-navigation-mode/actions/workflows/ci.yml/badge.svg)](https://github.com/JairajJangle/react-native-navigation-mode/actions/workflows/ci.yml) ![Android](https://img.shields.io/badge/-Android-555555?logo=android&logoColor=3DDC84) ![iOS](https://img.shields.io/badge/-iOS-555555?logo=apple&logoColor=white) [![GitHub issues](https://img.shields.io/github/issues/JairajJangle/react-native-navigation-mode)](https://github.com/JairajJangle/react-native-navigation-mode/issues?q=is%3Aopen+is%3Aissue) ![TS](https://img.shields.io/badge/TypeScript-strict_💪-blue) ![Turbo Module](https://img.shields.io/badge/Turbo%20Module-⚡-orange) ![Expo](https://img.shields.io/badge/Expo-SDK_52+-000020?logo=expo) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-native-navigation-mode)
5
+ [![npm version](https://img.shields.io/npm/v/react-native-navigation-mode)](https://badge.fury.io/js/react-native-navigation-mode) [![License](https://img.shields.io/github/license/JairajJangle/react-native-navigation-mode)](https://github.com/JairajJangle/react-native-navigation-mode/blob/main/LICENSE) [![Workflow Status](https://github.com/JairajJangle/react-native-navigation-mode/actions/workflows/ci.yml/badge.svg)](https://github.com/JairajJangle/react-native-navigation-mode/actions/workflows/ci.yml) ![Android](https://img.shields.io/badge/-Android-555555?logo=android&logoColor=3DDC84) ![iOS](https://img.shields.io/badge/-iOS-555555?logo=apple&logoColor=white) [![GitHub issues](https://img.shields.io/github/issues/JairajJangle/react-native-navigation-mode)](https://github.com/JairajJangle/react-native-navigation-mode/issues?q=is%3Aopen+is%3Aissue) ![TS](https://img.shields.io/badge/TypeScript-strict_💪-blue) ![Turbo Module](https://img.shields.io/badge/Turbo%20Module-⚡-orange) ![Expo](https://img.shields.io/badge/Expo-SDK_52+-000020?logo=expo) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-native-navigation-mode) [![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?style=flat&logo=github-sponsors)](https://github.com/sponsors/JairajJangle)
6
6
 
7
7
  <table align="center">
8
8
  <tr>
@@ -3,6 +3,9 @@
3
3
  import { TurboModuleRegistry, Platform } from 'react-native';
4
4
  // Only get the native module on Android
5
5
  // On iOS, we'll handle everything in JavaScript
6
- const NativeModule = Platform.OS === 'android' ? TurboModuleRegistry.getEnforcing('NavigationMode') : null;
6
+ const NativeModule = Platform.OS === 'android' ? TurboModuleRegistry?.getEnforcing ? TurboModuleRegistry.getEnforcing('NavigationMode') : (() => {
7
+ console.error("['react-native-navigation-mode'] TurboModuleRegistry.getEnforcing is not available. Make sure you have enabled the New Architecture (TurboModules) in your project.");
8
+ return null;
9
+ })() : null;
7
10
  export default NativeModule;
8
11
  //# sourceMappingURL=NativeNavigationMode.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","Platform","NativeModule","OS","getEnforcing"],"sourceRoot":"../../src","sources":["NativeNavigationMode.ts"],"mappings":";;AACA,SAASA,mBAAmB,EAAEC,QAAQ,QAAQ,cAAc;AAe5D;AACA;AACA,MAAMC,YAAY,GAChBD,QAAQ,CAACE,EAAE,KAAK,SAAS,GACrBH,mBAAmB,CAACI,YAAY,CAAO,gBAAgB,CAAC,GACxD,IAAI;AAEV,eAAeF,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","Platform","NativeModule","OS","getEnforcing","console","error"],"sourceRoot":"../../src","sources":["NativeNavigationMode.ts"],"mappings":";;AACA,SAASA,mBAAmB,EAAEC,QAAQ,QAAQ,cAAc;AAe5D;AACA;AACA,MAAMC,YAAY,GAChBD,QAAQ,CAACE,EAAE,KAAK,SAAS,GACrBH,mBAAmB,EAAEI,YAAY,GAC/BJ,mBAAmB,CAACI,YAAY,CAAO,gBAAgB,CAAC,GACxD,CAAC,MAAM;EACPC,OAAO,CAACC,KAAK,CACX,qKACF,CAAC;EACD,OAAO,IAAI;AACb,CAAC,EAAE,CAAC,GACJ,IAAI;AAEV,eAAeJ,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeNavigationMode.d.ts","sourceRoot":"","sources":["../../../src/NativeNavigationMode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IACtD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjD,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C;AAID,QAAA,MAAM,YAAY,aAGR,CAAC;AAEX,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"NativeNavigationMode.d.ts","sourceRoot":"","sources":["../../../src/NativeNavigationMode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IACtD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjD,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C;AAID,QAAA,MAAM,YAAY,aAUR,CAAC;AAEX,eAAe,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation-mode",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "Detect Android navigation mode (3-button, 2-button, or gesture)",
5
5
  "main": "./lib/module/index.js",
6
6
  "react-native": "./lib/module/index.js",
@@ -66,31 +66,34 @@
66
66
  "devDependencies": {
67
67
  "@commitlint/config-conventional": "^19.6.0",
68
68
  "@eslint/compat": "^1.2.7",
69
- "@eslint/eslintrc": "^3.3.0",
69
+ "@eslint/eslintrc": "^3.3.3",
70
70
  "@eslint/js": "^9.22.0",
71
71
  "@evilmartians/lefthook": "^1.5.0",
72
72
  "@expo/config-plugins": "^10.1.2",
73
- "@react-native/babel-preset": "0.79.5",
74
- "@react-native/eslint-config": "0.79.5",
75
- "@release-it/conventional-changelog": "^9.0.2",
73
+ "@react-native/babel-preset": "0.79.7",
74
+ "@react-native/eslint-config": "0.79.7",
75
+ "@release-it/conventional-changelog": "^9.0.4",
76
76
  "@semantic-release/changelog": "^6.0.3",
77
77
  "@semantic-release/git": "^10.0.1",
78
- "@semantic-release/github": "^11.0.1",
79
- "@semantic-release/npm": "^12.0.1",
78
+ "@semantic-release/github": "^12.0.5",
79
+ "@semantic-release/npm": "^13.1.4",
80
+ "@testing-library/react-hooks": "^8.0.1",
81
+ "@testing-library/react-native": "^13.3.3",
80
82
  "@types/jest": "^29.5.5",
81
83
  "@types/react": "^19.0.0",
82
- "commitlint": "^19.6.1",
83
- "del-cli": "^5.1.0",
84
+ "commitlint": "^20.4.1",
85
+ "del-cli": "^7.0.0",
84
86
  "eslint": "^9.22.0",
85
- "eslint-config-prettier": "^10.1.1",
87
+ "eslint-config-prettier": "^10.1.8",
86
88
  "eslint-plugin-prettier": "^5.2.3",
87
89
  "jest": "^29.7.0",
88
90
  "prettier": "^3.0.3",
89
91
  "react": "19.0.0",
90
- "react-native": "0.79.5",
91
- "react-native-builder-bob": "^0.40.11",
92
- "release-it": "^17.10.0",
93
- "semantic-release": "^24.1.0",
92
+ "react-native": "0.79.7",
93
+ "react-native-builder-bob": "^0.40.17",
94
+ "react-test-renderer": "19.0.0",
95
+ "release-it": "^19.2.4",
96
+ "semantic-release": "^25.0.3",
94
97
  "turbo": "^1.10.7",
95
98
  "typescript": "^5.8.3"
96
99
  },
@@ -18,7 +18,14 @@ export interface Spec extends TurboModule {
18
18
  // On iOS, we'll handle everything in JavaScript
19
19
  const NativeModule =
20
20
  Platform.OS === 'android'
21
- ? TurboModuleRegistry.getEnforcing<Spec>('NavigationMode')
21
+ ? TurboModuleRegistry?.getEnforcing
22
+ ? TurboModuleRegistry.getEnforcing<Spec>('NavigationMode')
23
+ : (() => {
24
+ console.error(
25
+ "['react-native-navigation-mode'] TurboModuleRegistry.getEnforcing is not available. Make sure you have enabled the New Architecture (TurboModules) in your project."
26
+ );
27
+ return null;
28
+ })()
22
29
  : null;
23
30
 
24
31
  export default NativeModule;