expo-screen-orientation 4.1.2 → 4.2.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 +11 -1
- package/README.md +3 -3
- package/android/build.gradle +27 -8
- package/build/ExpoScreenOrientation.d.ts +1 -0
- package/build/ExpoScreenOrientation.d.ts.map +1 -0
- package/build/ExpoScreenOrientation.web.d.ts +1 -0
- package/build/ExpoScreenOrientation.web.d.ts.map +1 -0
- package/build/ScreenOrientation.d.ts +1 -0
- package/build/ScreenOrientation.d.ts.map +1 -0
- package/build/ScreenOrientation.types.d.ts +1 -0
- package/build/ScreenOrientation.types.d.ts.map +1 -0
- package/ios/EXScreenOrientation/EXScreenOrientationRegistry.h +1 -0
- package/ios/EXScreenOrientation/ScreenOrientationAppDelegate.swift +1 -1
- package/ios/EXScreenOrientation/ScreenOrientationReactDelegateHandler.swift +1 -1
- package/package.json +3 -3
- package/plugin/src/withScreenOrientation.ts +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
## 4.
|
|
13
|
+
## 4.2.0 — 2022-04-18
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- Updated `@expo/config-plugins` from `4.0.2` to `4.0.14` ([#15621](https://github.com/expo/expo/pull/15621) by [@EvanBacon](https://github.com/EvanBacon))
|
|
18
|
+
|
|
19
|
+
### ⚠️ Notices
|
|
20
|
+
|
|
21
|
+
- On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
|
|
22
|
+
|
|
23
|
+
## 4.1.2 - 2022-02-01
|
|
14
24
|
|
|
15
25
|
### 🐛 Bug fixes
|
|
16
26
|
|
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@ Allows you to manage the orientation of your app's interface.
|
|
|
4
4
|
|
|
5
5
|
# API documentation
|
|
6
6
|
|
|
7
|
-
- [Documentation for the
|
|
8
|
-
- [Documentation for the latest stable release](https://docs.expo.
|
|
7
|
+
- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/screen-orientation.md)
|
|
8
|
+
- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/screen-orientation/)
|
|
9
9
|
|
|
10
10
|
# Installation in managed Expo projects
|
|
11
11
|
|
|
12
|
-
For
|
|
12
|
+
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](https://docs.expo.dev/versions/latest/sdk/screen-orientation/). 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.
|
|
13
13
|
|
|
14
14
|
# Installation in bare React Native projects
|
|
15
15
|
|
package/android/build.gradle
CHANGED
|
@@ -3,20 +3,35 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '4.
|
|
6
|
+
version = '4.2.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
|
|
|
@@ -44,18 +59,22 @@ afterEvaluate {
|
|
|
44
59
|
}
|
|
45
60
|
|
|
46
61
|
android {
|
|
47
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
62
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
|
|
48
63
|
|
|
49
64
|
compileOptions {
|
|
50
|
-
sourceCompatibility JavaVersion.
|
|
51
|
-
targetCompatibility JavaVersion.
|
|
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",
|
|
75
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
57
76
|
versionCode 7
|
|
58
|
-
versionName '4.
|
|
77
|
+
versionName '4.2.0'
|
|
59
78
|
}
|
|
60
79
|
lintOptions {
|
|
61
80
|
abortOnError false
|
|
@@ -65,5 +84,5 @@ android {
|
|
|
65
84
|
dependencies {
|
|
66
85
|
implementation project(':expo-modules-core')
|
|
67
86
|
|
|
68
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${
|
|
87
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
69
88
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoScreenOrientation.d.ts","sourceRoot":"","sources":["../src/ExpoScreenOrientation.ts"],"names":[],"mappings":";AAEA,wBAA8D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoScreenOrientation.web.d.ts","sourceRoot":"","sources":["../src/ExpoScreenOrientation.web.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;;;kDAqGmB,eAAe,GAAG,QAAQ,OAAO,CAAC;uCAG7C,QAAQ,kBAAkB,CAAC;2BAGvC,QAAQ,WAAW,CAAC;+BAQhB,eAAe,GAAG,QAAQ,IAAI,CAAC;0CAOpB,kBAAkB,GAAG,QAAQ,IAAI,CAAC;mBAIzD,QAAQ,IAAI,CAAC;;AA7BpC,wBAoDE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenOrientation.d.ts","sourceRoot":"","sources":["../src/ScreenOrientation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAG9F,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,yBAAyB,EACzB,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,YAAY,GACb,CAAC;AAQF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,SAAS,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAA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 @@
|
|
|
3
3
|
import ExpoModulesCore
|
|
4
4
|
|
|
5
5
|
public class ScreenOrientationAppDelegate: ExpoAppDelegateSubscriber {
|
|
6
|
-
public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey
|
|
6
|
+
public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
|
|
7
7
|
if let screenOrientationRegistry = ModuleRegistryProvider.getSingletonModule(for: EXScreenOrientationRegistry.self) as? EXScreenOrientationRegistry {
|
|
8
8
|
screenOrientationRegistry.updateCurrentScreenOrientation()
|
|
9
9
|
}
|
|
@@ -4,6 +4,6 @@ import ExpoModulesCore
|
|
|
4
4
|
|
|
5
5
|
public class ScreenOrientationReactDelegateHandler: ExpoReactDelegateHandler {
|
|
6
6
|
public override func createRootViewController(reactDelegate: ExpoReactDelegate) -> UIViewController? {
|
|
7
|
-
return EXScreenOrientationViewController(defaultScreenOrientationFromPlist: ())
|
|
7
|
+
return EXScreenOrientationViewController(defaultScreenOrientationFromPlist: ())
|
|
8
8
|
}
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-screen-orientation",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Expo universal module for managing device's screen orientation",
|
|
5
5
|
"main": "build/ScreenOrientation.js",
|
|
6
6
|
"types": "build/ScreenOrientation.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"preset": "expo-module-scripts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@expo/config-plugins": "^4.0.
|
|
39
|
+
"@expo/config-plugins": "^4.0.14"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"expo-module-scripts": "^2.0.0"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"expo": "*"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "22dce752354bb429c84851bc4389abe47a766b1f"
|
|
48
48
|
}
|
|
@@ -25,9 +25,11 @@ interface ExpoConfigWithInitialOrientation extends ExpoConfig {
|
|
|
25
25
|
initialOrientation?: OrientationMasks;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const withScreenOrientationViewController: ConfigPlugin<
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const withScreenOrientationViewController: ConfigPlugin<
|
|
29
|
+
{
|
|
30
|
+
initialOrientation?: keyof typeof OrientationLock;
|
|
31
|
+
} | void
|
|
32
|
+
> = (config, { initialOrientation = 'DEFAULT' } = {}) => {
|
|
31
33
|
config = withInfoPlist(config, (config) => {
|
|
32
34
|
const extendedConfig = {
|
|
33
35
|
...config,
|