expo-dev-menu-interface 0.5.1 → 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 +1 -1
- package/android/build.gradle +41 -24
- package/android/src/main/java/expo/interfaces/devmenu/DevMenuManagerInterface.kt +4 -10
- package/android/src/main/java/expo/interfaces/devmenu/{DevMenuSettingsInterface.kt → DevMenuPreferencesInterface.kt} +7 -1
- package/ios/DevMenuManagerProtocol.swift +0 -3
- package/ios/EXDevExtensions.swift +10 -0
- package/ios/ExpoApiClient/DevMenuExpoApiClientProtocol.swift +0 -3
- package/package.json +2 -2
- package/android/src/main/java/expo/interfaces/devmenu/DevMenuSessionInterface.kt +0 -14
- package/ios/DevMenuDelegateProtocol.swift +0 -48
- package/ios/DevMenuManagerProviderProtocol.swift +0 -9
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.
|
|
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
|
|
package/android/build.gradle
CHANGED
|
@@ -1,63 +1,80 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
apply plugin: 'kotlin-android'
|
|
3
|
-
apply plugin: 'maven'
|
|
3
|
+
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '0.
|
|
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:${
|
|
34
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
20
35
|
}
|
|
21
36
|
}
|
|
22
37
|
|
|
23
|
-
// Upload android library to maven with javadoc and android sources
|
|
24
|
-
configurations {
|
|
25
|
-
deployerJars
|
|
26
|
-
}
|
|
27
|
-
|
|
28
38
|
// Creating sources with comments
|
|
29
39
|
task androidSourcesJar(type: Jar) {
|
|
30
40
|
classifier = 'sources'
|
|
31
41
|
from android.sourceSets.main.java.srcDirs
|
|
32
42
|
}
|
|
33
43
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
afterEvaluate {
|
|
45
|
+
publishing {
|
|
46
|
+
publications {
|
|
47
|
+
release(MavenPublication) {
|
|
48
|
+
from components.release
|
|
49
|
+
// Add additional sourcesJar to artifacts
|
|
50
|
+
artifact(androidSourcesJar)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
repositories {
|
|
54
|
+
maven {
|
|
55
|
+
url = mavenLocal().url
|
|
56
|
+
}
|
|
44
57
|
}
|
|
45
58
|
}
|
|
46
59
|
}
|
|
47
60
|
|
|
48
61
|
android {
|
|
49
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
62
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
|
|
50
63
|
|
|
51
64
|
compileOptions {
|
|
52
|
-
sourceCompatibility JavaVersion.
|
|
53
|
-
targetCompatibility JavaVersion.
|
|
65
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
66
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
kotlinOptions {
|
|
70
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
54
71
|
}
|
|
55
72
|
|
|
56
73
|
defaultConfig {
|
|
57
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
58
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
75
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
59
76
|
versionCode 6
|
|
60
|
-
versionName '0.
|
|
77
|
+
versionName '0.6.0'
|
|
61
78
|
}
|
|
62
79
|
lintOptions {
|
|
63
80
|
abortOnError false
|
|
@@ -70,6 +87,6 @@ dependencies {
|
|
|
70
87
|
|
|
71
88
|
implementation 'com.squareup.okhttp3:okhttp:3.14.9'
|
|
72
89
|
|
|
73
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${
|
|
90
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
74
91
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3"
|
|
75
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 [
|
|
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 [
|
|
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 [
|
|
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():
|
|
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
|
|
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
|
}
|
|
@@ -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.
|
|
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": "
|
|
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
|
-
}
|