expo-splash-screen 0.27.2 → 0.27.4
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 +10 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/splashscreen/SplashScreenPackage.kt +1 -1
- package/android/src/main/java/expo/modules/splashscreen/SplashScreenReactActivityLifecycleListener.kt +1 -1
- package/build/index.native.d.ts.map +1 -1
- package/build/index.native.js +8 -2
- package/build/index.native.js.map +1 -1
- package/package.json +3 -3
- package/src/index.native.ts +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.27.4 — 2024-05-03
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- No-op when native module is not installed ([#28599](https://github.com/expo/expo/pull/28599) by [@brentvatne](https://github.com/brentvatne))
|
|
18
|
+
|
|
19
|
+
## 0.27.3 — 2024-05-01
|
|
20
|
+
|
|
21
|
+
_This version does not introduce any user-facing changes._
|
|
22
|
+
|
|
13
23
|
## 0.27.2 — 2024-04-23
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'host.exp.exponent'
|
|
4
|
-
version = '0.27.
|
|
4
|
+
version = '0.27.4'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -14,7 +14,7 @@ android {
|
|
|
14
14
|
namespace "expo.modules.splashscreen"
|
|
15
15
|
defaultConfig {
|
|
16
16
|
versionCode 17
|
|
17
|
-
versionName '0.27.
|
|
17
|
+
versionName '0.27.4'
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -13,7 +13,7 @@ class SplashScreenPackage : Package {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
override fun createReactActivityLifecycleListeners(activityContext: Context): List<ReactActivityLifecycleListener> {
|
|
16
|
-
return listOf(SplashScreenReactActivityLifecycleListener(
|
|
16
|
+
return listOf(SplashScreenReactActivityLifecycleListener())
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
override fun createReactActivityHandlers(activityContext: Context?): List<ReactActivityHandler> {
|
|
@@ -9,7 +9,7 @@ import expo.modules.core.interfaces.ReactActivityHandler
|
|
|
9
9
|
import expo.modules.core.interfaces.ReactActivityLifecycleListener
|
|
10
10
|
import expo.modules.splashscreen.singletons.SplashScreen
|
|
11
11
|
|
|
12
|
-
class SplashScreenReactActivityLifecycleListener
|
|
12
|
+
class SplashScreenReactActivityLifecycleListener : ReactActivityLifecycleListener {
|
|
13
13
|
override fun onContentChanged(activity: Activity) {
|
|
14
14
|
SplashScreen.ensureShown(
|
|
15
15
|
activity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,OAAO,CAAC,CAsBvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,YAOpC,CAAC;AAEF,wBAAgB,SAAS,4BAgBxB;AAED,eAAO,MAAM,oBAAoB,wBAKhC,CAAC"}
|
package/build/index.native.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const SplashModule =
|
|
1
|
+
import { requireOptionalNativeModule } from 'expo-modules-core';
|
|
2
|
+
const SplashModule = requireOptionalNativeModule('ExpoSplashScreen');
|
|
3
3
|
let _userControlledAutoHideEnabled = false;
|
|
4
4
|
let _preventAutoHideAsyncInvoked = false;
|
|
5
5
|
/**
|
|
@@ -11,6 +11,9 @@ let _preventAutoHideAsyncInvoked = false;
|
|
|
11
11
|
* @private
|
|
12
12
|
*/
|
|
13
13
|
export async function _internal_preventAutoHideAsync() {
|
|
14
|
+
if (!SplashModule) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
14
17
|
// Memoize, this should only be called once.
|
|
15
18
|
if (_preventAutoHideAsyncInvoked) {
|
|
16
19
|
return false;
|
|
@@ -43,6 +46,9 @@ export const _internal_maybeHideAsync = () => {
|
|
|
43
46
|
hideAsync();
|
|
44
47
|
};
|
|
45
48
|
export function hideAsync() {
|
|
49
|
+
if (!SplashModule) {
|
|
50
|
+
return Promise.resolve(false);
|
|
51
|
+
}
|
|
46
52
|
return SplashModule.hideAsync().catch((error) => {
|
|
47
53
|
// Hide this very unfortunate error.
|
|
48
54
|
if (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,YAAY,GAAG,2BAA2B,CAAC,kBAAkB,CAG3D,CAAC;AAET,IAAI,8BAA8B,GAAG,KAAK,CAAC;AAC3C,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B;IAClD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,4CAA4C;IAC5C,IAAI,4BAA4B,EAAE;QAChC,OAAO,KAAK,CAAC;KACd;IACD,4BAA4B,GAAG,IAAI,CAAC;IAEpC,oGAAoG;IACpG,oEAAoE;IACpE,IAAI,UAAU,EAAE,gBAAgB,EAAE;QAChC,MAAM,eAAe,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACtD,UAAU,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YAC7C,SAAS,EAAE,CAAC;YACZ,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,YAAY,CAAC,oBAAoB,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,kFAAkF;IAClF,kFAAkF;IAClF,IAAI,8BAA8B,EAAE;QAClC,OAAO;KACR;IACD,SAAS,EAAE,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC/B;IAED,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;QACnD,oCAAoC;QACpC;QACE,yDAAyD;QACzD,4BAA4B;YAC5B,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yCAAyC,CAAC,EACjE;YACA,OAAO;SACR;QACD,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,gEAAgE;IAChE,8BAA8B,GAAG,IAAI,CAAC;IACtC,sBAAsB;IACtB,OAAO,8BAA8B,EAAE,CAAC;AAC1C,CAAC,CAAC","sourcesContent":["import { requireOptionalNativeModule } from 'expo-modules-core';\n\nconst SplashModule = requireOptionalNativeModule('ExpoSplashScreen') as {\n preventAutoHideAsync: () => Promise<boolean>;\n hideAsync: () => Promise<boolean>;\n} | null;\n\nlet _userControlledAutoHideEnabled = false;\nlet _preventAutoHideAsyncInvoked = false;\n\n/**\n * Expo Router uses this internal method to ensure that we can detect if the user\n * has explicitly opted into preventing the splash screen from hiding. This means\n * they will also explicitly hide it. If they don't, we will hide it for them after\n * the navigation render completes.\n *\n * @private\n */\nexport async function _internal_preventAutoHideAsync(): Promise<boolean> {\n if (!SplashModule) {\n return false;\n }\n\n // Memoize, this should only be called once.\n if (_preventAutoHideAsyncInvoked) {\n return false;\n }\n _preventAutoHideAsyncInvoked = true;\n\n // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.\n // This prevents the splash screen from floating over error screens.\n if (ErrorUtils?.getGlobalHandler) {\n const originalHandler = ErrorUtils.getGlobalHandler();\n ErrorUtils.setGlobalHandler((error, isFatal) => {\n hideAsync();\n originalHandler(error, isFatal);\n });\n }\n\n return SplashModule.preventAutoHideAsync();\n}\n\n/**\n * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.\n * If the user has explicitly opted into preventing the splash screen from hiding, we should not\n * hide it for them. This is often used for animated splash screens.\n *\n * @private\n */\nexport const _internal_maybeHideAsync = () => {\n // If the user has explicitly opted into preventing the splash screen from hiding,\n // we should not hide it for them. This is often used for animated splash screens.\n if (_userControlledAutoHideEnabled) {\n return;\n }\n hideAsync();\n};\n\nexport function hideAsync() {\n if (!SplashModule) {\n return Promise.resolve(false);\n }\n\n return SplashModule.hideAsync().catch((error: any) => {\n // Hide this very unfortunate error.\n if (\n // Only throw the error is something unexpected happened.\n _preventAutoHideAsyncInvoked &&\n error.message.includes('No native splash screen registered for ')\n ) {\n return;\n }\n throw error;\n });\n}\n\nexport const preventAutoHideAsync = () => {\n // Indicate that the user is controlling the auto hide behavior.\n _userControlledAutoHideEnabled = true;\n // Prevent as usual...\n return _internal_preventAutoHideAsync();\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-splash-screen",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.4",
|
|
4
4
|
"description": "Provides a module to allow keeping the native Splash Screen visible until you choose to hide it.",
|
|
5
5
|
"main": "build",
|
|
6
6
|
"types": "build",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/splash-screen/",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@expo/prebuild-config": "7.0.
|
|
37
|
+
"@expo/prebuild-config": "7.0.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"expo-module-scripts": "^3.0.0"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"expo": "*"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "77f640b4cb930067b44c93446465e67cc4507ef8"
|
|
46
46
|
}
|
package/src/index.native.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { requireOptionalNativeModule } from 'expo-modules-core';
|
|
2
2
|
|
|
3
|
-
const SplashModule =
|
|
3
|
+
const SplashModule = requireOptionalNativeModule('ExpoSplashScreen') as {
|
|
4
4
|
preventAutoHideAsync: () => Promise<boolean>;
|
|
5
5
|
hideAsync: () => Promise<boolean>;
|
|
6
|
-
};
|
|
6
|
+
} | null;
|
|
7
7
|
|
|
8
8
|
let _userControlledAutoHideEnabled = false;
|
|
9
9
|
let _preventAutoHideAsyncInvoked = false;
|
|
@@ -17,6 +17,10 @@ let _preventAutoHideAsyncInvoked = false;
|
|
|
17
17
|
* @private
|
|
18
18
|
*/
|
|
19
19
|
export async function _internal_preventAutoHideAsync(): Promise<boolean> {
|
|
20
|
+
if (!SplashModule) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
// Memoize, this should only be called once.
|
|
21
25
|
if (_preventAutoHideAsyncInvoked) {
|
|
22
26
|
return false;
|
|
@@ -53,6 +57,10 @@ export const _internal_maybeHideAsync = () => {
|
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
export function hideAsync() {
|
|
60
|
+
if (!SplashModule) {
|
|
61
|
+
return Promise.resolve(false);
|
|
62
|
+
}
|
|
63
|
+
|
|
56
64
|
return SplashModule.hideAsync().catch((error: any) => {
|
|
57
65
|
// Hide this very unfortunate error.
|
|
58
66
|
if (
|