expo-navigation-bar 1.3.0 → 2.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/CHANGELOG.md CHANGED
@@ -10,6 +10,17 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 2.0.0 — 2022-10-25
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - [plugin] Upgrade minimum runtime requirement to Node 14 (LTS). ([#18204](https://github.com/expo/expo/pull/18204) by [@EvanBacon](https://github.com/EvanBacon))
18
+
19
+ ### 💡 Others
20
+
21
+ - [plugin] Migrate import from @expo/config-plugins to expo/config-plugins and @expo/config-types to expo/config. ([#18855](https://github.com/expo/expo/pull/18855) by [@brentvatne](https://github.com/brentvatne))
22
+ - Drop `@expo/config-plugins` dependency in favor of peer dependency on `expo`. ([#18595](https://github.com/expo/expo/pull/18595) by [@EvanBacon](https://github.com/EvanBacon))
23
+
13
24
  ## 1.3.0 — 2022-07-07
14
25
 
15
26
  _This version does not introduce any user-facing changes._
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '1.3.0'
6
+ version = '2.0.0'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -74,7 +74,7 @@ android {
74
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
75
75
  targetSdkVersion safeExtGet("targetSdkVersion", 31)
76
76
  versionCode 1
77
- versionName '1.3.0'
77
+ versionName '2.0.0'
78
78
  }
79
79
  lintOptions {
80
80
  abortOnError false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-navigation-bar",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "Interact with the system navigation bar",
5
5
  "main": "build/NavigationBar.js",
6
6
  "types": "build/NavigationBar.d.ts",
@@ -33,16 +33,15 @@
33
33
  "license": "MIT",
34
34
  "homepage": "https://docs.expo.dev/versions/latest/sdk/navigation-bar",
35
35
  "dependencies": {
36
- "@expo/config-plugins": "~5.0.0",
37
36
  "@react-native/normalize-color": "^2.0.0",
38
37
  "debug": "^4.3.2"
39
38
  },
40
39
  "devDependencies": {
41
40
  "@types/debug": "^4.1.7",
42
- "expo-module-scripts": "^2.0.0"
41
+ "expo-module-scripts": "^3.0.0"
43
42
  },
44
43
  "peerDependencies": {
45
44
  "expo": "*"
46
45
  },
47
- "gitHead": "6e131f2da851a47c3a24eb3d6fc971a1a7822086"
46
+ "gitHead": "eab2b09c735fb0fc2bf734a3f29a6593adba3838"
48
47
  }
@@ -1,6 +1,6 @@
1
- import { ConfigPlugin, AndroidConfig } from '@expo/config-plugins';
2
- import { ExpoConfig } from '@expo/config-types';
3
1
  import { NavigationBarVisibility, NavigationBarBehavior, NavigationBarPosition, NavigationBarButtonStyle } from 'expo-navigation-bar';
2
+ import { ExpoConfig } from 'expo/config';
3
+ import { ConfigPlugin, AndroidConfig } from 'expo/config-plugins';
4
4
  export declare type Props = {
5
5
  borderColor?: string;
6
6
  backgroundColor?: string | null;
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.setNavigationBarStyles = exports.setNavigationBarColors = exports.setStrings = exports.withAndroidNavigationBarExpoGoManifest = exports.resolveProps = void 0;
7
- const config_plugins_1 = require("@expo/config-plugins");
8
7
  // @ts-ignore: uses flow
9
8
  const normalize_color_1 = __importDefault(require("@react-native/normalize-color"));
10
9
  // @ts-ignore
11
10
  const debug_1 = __importDefault(require("debug"));
11
+ const config_plugins_1 = require("expo/config-plugins");
12
12
  const debug = (0, debug_1.default)('expo:system-navigation-bar:plugin');
13
13
  const pkg = require('expo-navigation-bar/package.json');
14
14
  // strings.xml keys, this should not change.
@@ -37,19 +37,18 @@ function convertColorAndroid(input) {
37
37
  return color | 0x0;
38
38
  }
39
39
  function resolveProps(config, _props) {
40
- var _a, _b, _c, _d;
41
40
  let props;
42
41
  if (!_props) {
43
42
  props = {
44
- backgroundColor: (_a = config.androidNavigationBar) === null || _a === void 0 ? void 0 : _a.backgroundColor,
45
- barStyle: ((_b = config.androidNavigationBar) === null || _b === void 0 ? void 0 : _b.barStyle)
46
- ? LEGACY_BAR_STYLE_MAP[(_c = config.androidNavigationBar) === null || _c === void 0 ? void 0 : _c.barStyle]
43
+ backgroundColor: config.androidNavigationBar?.backgroundColor,
44
+ barStyle: config.androidNavigationBar?.barStyle
45
+ ? LEGACY_BAR_STYLE_MAP[config.androidNavigationBar?.barStyle]
47
46
  : undefined,
48
47
  // Resources for:
49
48
  // - sticky-immersive: https://youtu.be/cBi8fjv90E4?t=416 -- https://developer.android.com/training/system-ui/immersive#sticky-immersive
50
49
  // - immersive: https://youtu.be/cBi8fjv90E4?t=168 -- https://developer.android.com/training/system-ui/immersive#immersive
51
50
  // - leanback: https://developer.android.com/training/system-ui/immersive#leanback
52
- legacyVisible: (_d = config.androidNavigationBar) === null || _d === void 0 ? void 0 : _d.visible,
51
+ legacyVisible: config.androidNavigationBar?.visible,
53
52
  };
54
53
  if (props.legacyVisible) {
55
54
  // Using legacyVisible can break the setPositionAsync method:
@@ -68,12 +67,11 @@ exports.resolveProps = resolveProps;
68
67
  * of the static values that Expo Go reads from (`androidNavigationBar`).
69
68
  */
70
69
  const withAndroidNavigationBarExpoGoManifest = (config, props) => {
71
- var _a, _b;
72
70
  if (!config.androidNavigationBar) {
73
71
  // Remap the config plugin props so Expo Go knows how to apply them.
74
72
  config.androidNavigationBar = {
75
- backgroundColor: (_a = props.backgroundColor) !== null && _a !== void 0 ? _a : undefined,
76
- barStyle: (_b = Object.entries(LEGACY_BAR_STYLE_MAP).find(([, v]) => v === props.barStyle)) === null || _b === void 0 ? void 0 : _b[0],
73
+ backgroundColor: props.backgroundColor ?? undefined,
74
+ barStyle: Object.entries(LEGACY_BAR_STYLE_MAP).find(([, v]) => v === props.barStyle)?.[0],
77
75
  visible: props.legacyVisible,
78
76
  };
79
77
  }
@@ -1,13 +1,3 @@
1
- import {
2
- ConfigPlugin,
3
- createRunOncePlugin,
4
- AndroidConfig,
5
- withStringsXml,
6
- WarningAggregator,
7
- withAndroidColors,
8
- withAndroidStyles,
9
- } from '@expo/config-plugins';
10
- import { ExpoConfig } from '@expo/config-types';
11
1
  // @ts-ignore: uses flow
12
2
  import normalizeColor from '@react-native/normalize-color';
13
3
  // @ts-ignore
@@ -18,6 +8,16 @@ import {
18
8
  NavigationBarPosition,
19
9
  NavigationBarButtonStyle,
20
10
  } from 'expo-navigation-bar';
11
+ import { ExpoConfig } from 'expo/config';
12
+ import {
13
+ ConfigPlugin,
14
+ createRunOncePlugin,
15
+ AndroidConfig,
16
+ withStringsXml,
17
+ WarningAggregator,
18
+ withAndroidColors,
19
+ withAndroidStyles,
20
+ } from 'expo/config-plugins';
21
21
 
22
22
  const debug = Debug('expo:system-navigation-bar:plugin');
23
23