react-native-navigation-mode 1.2.5 → 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 +8 -26
- package/app.plugin.js +6 -8
- package/lib/module/NativeNavigationMode.js +4 -1
- package/lib/module/NativeNavigationMode.js.map +1 -1
- package/lib/typescript/src/NativeNavigationMode.d.ts.map +1 -1
- package/package.json +17 -15
- package/src/NativeNavigationMode.ts +8 -1
- package/lib/typescript/plugin/src/withNavigationMode.d.ts +0 -4
- package/lib/typescript/plugin/src/withNavigationMode.d.ts.map +0 -1
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
|
-
[](https://badge.fury.io/js/react-native-navigation-mode) [](https://github.com/JairajJangle/react-native-navigation-mode/blob/main/LICENSE) [](https://github.com/JairajJangle/react-native-navigation-mode/actions/workflows/ci.yml)   [](https://github.com/JairajJangle/react-native-navigation-mode/issues?q=is%3Aopen+is%3Aissue)    
|
|
5
|
+
[](https://badge.fury.io/js/react-native-navigation-mode) [](https://github.com/JairajJangle/react-native-navigation-mode/blob/main/LICENSE) [](https://github.com/JairajJangle/react-native-navigation-mode/actions/workflows/ci.yml)   [](https://github.com/JairajJangle/react-native-navigation-mode/issues?q=is%3Aopen+is%3Aissue)     [](https://github.com/sponsors/JairajJangle)
|
|
6
6
|
|
|
7
7
|
<table align="center">
|
|
8
8
|
<tr>
|
|
@@ -73,29 +73,17 @@ npm install react-native-navigation-mode
|
|
|
73
73
|
npx expo install react-native-navigation-mode
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
#####
|
|
77
|
-
|
|
78
|
-
Add the plugin to your `app.json` or `app.config.ts`:
|
|
79
|
-
|
|
80
|
-
```json
|
|
81
|
-
{
|
|
82
|
-
"expo": {
|
|
83
|
-
"plugins": [
|
|
84
|
-
"react-native-navigation-mode"
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
```
|
|
76
|
+
##### Development Builds
|
|
89
77
|
|
|
90
|
-
|
|
78
|
+
Since this library contains native code, it requires a [development build](https://docs.expo.dev/develop/development-builds/introduction/). It cannot be used with Expo Go.
|
|
91
79
|
|
|
92
80
|
```sh
|
|
93
|
-
|
|
94
|
-
|
|
81
|
+
# Using EAS Build (recommended)
|
|
82
|
+
eas build --profile development --platform android
|
|
95
83
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
# Or locally
|
|
85
|
+
npx expo run:android # Should auto-run prebuild if needed
|
|
86
|
+
```
|
|
99
87
|
|
|
100
88
|
#### Requirements
|
|
101
89
|
|
|
@@ -396,12 +384,6 @@ The library uses multiple detection methods for maximum accuracy:
|
|
|
396
384
|
- This is normal on devices without navigation bars (some tablets)
|
|
397
385
|
- On older Android versions, fallback detection may not work on all devices
|
|
398
386
|
|
|
399
|
-
**Expo: "Package does not contain a valid config plugin"**
|
|
400
|
-
|
|
401
|
-
- Ensure you've installed the latest version of the library
|
|
402
|
-
- Try clearing your cache: `npx expo start --clear`
|
|
403
|
-
- Make sure the plugin is added to your `app.json`
|
|
404
|
-
|
|
405
387
|
## 🤝 Contributing
|
|
406
388
|
|
|
407
389
|
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
package/app.plugin.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
const { createRunOncePlugin } = require('@expo/config-plugins');
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Expo Config Plugin for react-native-navigation-mode
|
|
5
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* Note: This plugin is optional. The library works without adding it to your
|
|
5
|
+
* plugins array because no native configuration changes are required.
|
|
6
6
|
*/
|
|
7
|
+
|
|
8
|
+
/** @type {import('@expo/config-plugins').ConfigPlugin} */
|
|
7
9
|
const withNavigationMode = (config) => {
|
|
8
|
-
// No additional configuration needed for this module
|
|
9
|
-
// The module will be auto-linked through the Expo modules system
|
|
10
10
|
return config;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
module.exports = createRunOncePlugin(withNavigationMode, pkg.name, pkg.version);
|
|
13
|
+
module.exports = withNavigationMode;
|
|
@@ -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') :
|
|
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,
|
|
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,
|
|
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.
|
|
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",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"react-native.config.js",
|
|
17
17
|
"expo-module.config.json",
|
|
18
18
|
"app.plugin.js",
|
|
19
|
-
"plugin/build",
|
|
20
19
|
"!ios/build",
|
|
21
20
|
"!android/build",
|
|
22
21
|
"!android/gradle",
|
|
@@ -67,31 +66,34 @@
|
|
|
67
66
|
"devDependencies": {
|
|
68
67
|
"@commitlint/config-conventional": "^19.6.0",
|
|
69
68
|
"@eslint/compat": "^1.2.7",
|
|
70
|
-
"@eslint/eslintrc": "^3.3.
|
|
69
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
71
70
|
"@eslint/js": "^9.22.0",
|
|
72
71
|
"@evilmartians/lefthook": "^1.5.0",
|
|
73
72
|
"@expo/config-plugins": "^10.1.2",
|
|
74
|
-
"@react-native/babel-preset": "0.79.
|
|
75
|
-
"@react-native/eslint-config": "0.79.
|
|
76
|
-
"@release-it/conventional-changelog": "^9.0.
|
|
73
|
+
"@react-native/babel-preset": "0.79.7",
|
|
74
|
+
"@react-native/eslint-config": "0.79.7",
|
|
75
|
+
"@release-it/conventional-changelog": "^9.0.4",
|
|
77
76
|
"@semantic-release/changelog": "^6.0.3",
|
|
78
77
|
"@semantic-release/git": "^10.0.1",
|
|
79
|
-
"@semantic-release/github": "^
|
|
80
|
-
"@semantic-release/npm": "^
|
|
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",
|
|
81
82
|
"@types/jest": "^29.5.5",
|
|
82
83
|
"@types/react": "^19.0.0",
|
|
83
|
-
"commitlint": "^
|
|
84
|
-
"del-cli": "^
|
|
84
|
+
"commitlint": "^20.4.1",
|
|
85
|
+
"del-cli": "^7.0.0",
|
|
85
86
|
"eslint": "^9.22.0",
|
|
86
|
-
"eslint-config-prettier": "^10.1.
|
|
87
|
+
"eslint-config-prettier": "^10.1.8",
|
|
87
88
|
"eslint-plugin-prettier": "^5.2.3",
|
|
88
89
|
"jest": "^29.7.0",
|
|
89
90
|
"prettier": "^3.0.3",
|
|
90
91
|
"react": "19.0.0",
|
|
91
|
-
"react-native": "0.79.
|
|
92
|
-
"react-native-builder-bob": "^0.40.
|
|
93
|
-
"
|
|
94
|
-
"
|
|
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",
|
|
95
97
|
"turbo": "^1.10.7",
|
|
96
98
|
"typescript": "^5.8.3"
|
|
97
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
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withNavigationMode.d.ts","sourceRoot":"","sources":["../../../../plugin/src/withNavigationMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,QAAA,MAAM,kBAAkB,EAAE,YAEzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|