expo-dev-menu-interface 0.5.3 → 0.6.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 CHANGED
@@ -4,7 +4,7 @@ Interface for `expo-dev-menu`.
4
4
 
5
5
  # Installation in managed Expo projects
6
6
 
7
- For [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#api-documentation). If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
7
+ For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#api-documentation). If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
8
8
 
9
9
  # Installation in bare React Native projects
10
10
 
@@ -3,20 +3,35 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '0.5.3'
6
+ version = '0.6.0'
7
7
 
8
8
  buildscript {
9
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
+ if (expoModulesCorePlugin.exists()) {
11
+ apply from: expoModulesCorePlugin
12
+ applyKotlinExpoModulesCorePlugin()
13
+ }
14
+
9
15
  // Simple helper that allows the root project to override versions declared by this library.
10
16
  ext.safeExtGet = { prop, fallback ->
11
17
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
12
18
  }
13
19
 
20
+ // Ensures backward compatibility
21
+ ext.getKotlinVersion = {
22
+ if (ext.has("kotlinVersion")) {
23
+ ext.kotlinVersion()
24
+ } else {
25
+ ext.safeExtGet("kotlinVersion", "1.6.10")
26
+ }
27
+ }
28
+
14
29
  repositories {
15
30
  mavenCentral()
16
31
  }
17
32
 
18
33
  dependencies {
19
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
34
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
20
35
  }
21
36
  }
22
37
 
@@ -44,18 +59,22 @@ afterEvaluate {
44
59
  }
45
60
 
46
61
  android {
47
- compileSdkVersion safeExtGet("compileSdkVersion", 30)
62
+ compileSdkVersion safeExtGet("compileSdkVersion", 31)
48
63
 
49
64
  compileOptions {
50
- sourceCompatibility JavaVersion.VERSION_1_8
51
- targetCompatibility JavaVersion.VERSION_1_8
65
+ sourceCompatibility JavaVersion.VERSION_11
66
+ targetCompatibility JavaVersion.VERSION_11
67
+ }
68
+
69
+ kotlinOptions {
70
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
52
71
  }
53
72
 
54
73
  defaultConfig {
55
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
56
- targetSdkVersion safeExtGet("targetSdkVersion", 30)
75
+ targetSdkVersion safeExtGet("targetSdkVersion", 31)
57
76
  versionCode 6
58
- versionName '0.5.3'
77
+ versionName '0.6.0'
59
78
  }
60
79
  lintOptions {
61
80
  abortOnError false
@@ -68,6 +87,6 @@ dependencies {
68
87
 
69
88
  implementation 'com.squareup.okhttp3:okhttp:3.14.9'
70
89
 
71
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
90
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
72
91
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3"
73
92
  }
@@ -34,12 +34,12 @@ interface DevMenuManagerInterface {
34
34
  fun toggleMenu(activity: Activity)
35
35
 
36
36
  /**
37
- * Handles `onKeyEvent`. It's active only if [DevMenuSettingsInterface.keyCommandsEnabled] is true.
37
+ * Handles `onKeyEvent`. It's active only if [DevMenuPreferencesInterface.keyCommandsEnabled] is true.
38
38
  */
39
39
  fun onKeyEvent(keyCode: Int, event: KeyEvent): Boolean
40
40
 
41
41
  /**
42
- * Handles `onTouchEvent`. It's active only if [DevMenuSettingsInterface.touchGestureEnabled] is true.
42
+ * Handles `onTouchEvent`. It's active only if [DevMenuPreferencesInterface.touchGestureEnabled] is true.
43
43
  */
44
44
  fun onTouchEvent(ev: MotionEvent?)
45
45
 
@@ -70,16 +70,10 @@ interface DevMenuManagerInterface {
70
70
  fun serializedScreens(): List<Bundle>
71
71
 
72
72
  /**
73
- * @return a instance of [DevMenuSessionInterface] that keeps the details of the currently opened dev menu session,
74
- * or `null` if menu isn't opened.
75
- */
76
- fun getSession(): DevMenuSessionInterface?
77
-
78
- /**
79
- * @return a instance of [DevMenuSettingsInterface] that keeps all settings for current dev menu delegate,
73
+ * @return a instance of [DevMenuPreferencesInterface] that keeps all settings for current dev menu delegate,
80
74
  * or `null` if delegate wasn't provided.
81
75
  */
82
- fun getSettings(): DevMenuSettingsInterface?
76
+ fun getSettings(): DevMenuPreferencesInterface?
83
77
 
84
78
  /**
85
79
  * @return the dev menu application host.
@@ -1,8 +1,9 @@
1
1
  package expo.interfaces.devmenu
2
2
 
3
+ import com.facebook.react.bridge.ReadableMap
3
4
  import com.facebook.react.bridge.WritableMap
4
5
 
5
- interface DevMenuSettingsInterface {
6
+ interface DevMenuPreferencesInterface {
6
7
  /**
7
8
  * Whether to enable shake gesture.
8
9
  */
@@ -32,4 +33,9 @@ interface DevMenuSettingsInterface {
32
33
  * Serializes settings into a [WritableMap] so they can be passed through the bridge.
33
34
  */
34
35
  fun serialize(): WritableMap
36
+
37
+ /**
38
+ * Updates settings from [ReadableMap] - the map can be a partial of all the possible settings options
39
+ */
40
+ fun setPreferences(settings: ReadableMap)
35
41
  }
@@ -10,9 +10,6 @@ public protocol DevMenuManagerProtocol {
10
10
  @objc
11
11
  var isVisible: Bool { get }
12
12
 
13
- @objc
14
- var delegate: DevMenuDelegateProtocol? { get set }
15
-
16
13
  /**
17
14
  Opens up the dev menu.
18
15
  */
@@ -0,0 +1,10 @@
1
+ // Copyright 2015-present 650 Industries. All rights reserved.
2
+
3
+ import Foundation
4
+
5
+ // A protocol for determining if a given bridge module is a "DevExtension"
6
+ // DevExtensions are passed through to the dev-menu and dev-launcher JS runtimes
7
+ // This protocol has no fields on it as of yet but could be extended if additional functionality is needed in the future
8
+
9
+ @objc
10
+ public protocol EXDevExtensionProtocol {}
@@ -31,9 +31,6 @@ public protocol DevMenuExpoApiClientProtocol {
31
31
  @objc
32
32
  func setSessionSecret(_ sessionSecret: String?)
33
33
 
34
- @objc
35
- func queryDevSessionsAsync(_ installationID: String?, completionHandler: @escaping HTTPCompletionHandler)
36
-
37
34
  @objc
38
35
  func queryUpdateChannels(
39
36
  appId: String,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-dev-menu-interface",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "description": "Interface for expo-dev-menu",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -25,5 +25,5 @@
25
25
  "peerDependencies": {
26
26
  "expo": "*"
27
27
  },
28
- "gitHead": "c689b0c8a14445397ca5f9febdd99b5949e03f9b"
28
+ "gitHead": "2b35d9008fef42cb53473331c37693ca12e9bf12"
29
29
  }
@@ -1,14 +0,0 @@
1
- package expo.interfaces.devmenu
2
-
3
- import android.os.Bundle
4
- import com.facebook.react.ReactInstanceManager
5
-
6
- /**
7
- * Interface that represents a "session".
8
- * A session represents lifecycle/state of the dev menu while it is opened (between opening it and closing it).
9
- */
10
- interface DevMenuSessionInterface {
11
- val reactInstanceManager: ReactInstanceManager
12
- val appInfo: Bundle
13
- val openScreen: String?
14
- }
@@ -1,48 +0,0 @@
1
- // Copyright 2015-present 650 Industries. All rights reserved.
2
-
3
- import Foundation
4
- import UIKit
5
-
6
- @objc
7
- public protocol DevMenuDelegateProtocol {
8
- /**
9
- Returns a pointer to the bridge of the currently shown app. It is a context of what the dev menu displays.
10
- */
11
- @objc
12
- optional func appBridge(forDevMenuManager manager: DevMenuManagerProtocol) -> AnyObject?
13
-
14
- /**
15
- Returns a dictionary with the most important informations about the current app.
16
- */
17
- @objc
18
- optional func appInfo(forDevMenuManager manager: DevMenuManagerProtocol) -> [String: Any]?
19
-
20
- /**
21
- Tells the manager whether it can change dev menu visibility. In some circumstances you may want not to show/close the dev menu. (Optional)
22
- */
23
- @objc
24
- optional func devMenuManager(_ manager: DevMenuManagerProtocol, canChangeVisibility visible: Bool) -> Bool
25
-
26
- /**
27
- Called just before dispatching an action. The delegate can return `false` to prevent an action from being dispatched or `true` otherwise.
28
- */
29
- @objc
30
- optional func devMenuManager(_ manager: DevMenuManagerProtocol, willDispatchAction action: DevMenuAction) -> Bool
31
-
32
- /**
33
- Returns bool value whether the dev menu should show the onboarding view when it opens up.
34
- Default implementation returns true until the user gets it finished.
35
- */
36
- @objc
37
- optional func shouldShowOnboarding(manager: DevMenuManagerProtocol) -> Bool
38
-
39
- /**
40
- Tells the manager which user interface style to use.
41
- */
42
- @available(iOS 12.0, *)
43
- @objc
44
- optional func userInterfaceStyle(forDevMenuManager manager: DevMenuManagerProtocol) -> UIUserInterfaceStyle
45
-
46
- @objc
47
- optional func supportsDevelopment() -> Bool
48
- }
@@ -1,9 +0,0 @@
1
- // Copyright 2015-present 650 Industries. All rights reserved.
2
-
3
- import Foundation
4
-
5
- @objc
6
- public protocol DevMenuManagerProviderProtocol {
7
- @objc
8
- func getDevMenuManager() -> DevMenuManagerProtocol
9
- }