expo-splash-screen 0.29.3 → 0.29.5
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/SplashScreenManager.kt +6 -0
- package/build/SplashScreen.types.d.ts +1 -1
- package/build/SplashScreen.types.js.map +1 -1
- package/build/index.d.ts +11 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +9 -0
- package/build/index.js.map +1 -1
- package/package.json +3 -3
- package/plugin/build/withSplashScreen.d.ts +9 -4
- package/plugin/build/withSplashScreen.js +14 -5
- package/plugin/src/withSplashScreen.ts +24 -10
- package/src/SplashScreen.types.ts +1 -1
- package/src/index.ts +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.29.5 — 2024-11-10
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- [Android] Added guard to prevent null pointer exception when the splashScreen property is referenced without an activity (headless JS) ([#32707](https://github.com/expo/expo/pull/32707) by [@chrfalch](https://github.com/chrfalch))
|
|
18
|
+
|
|
19
|
+
## 0.29.4 — 2024-11-07
|
|
20
|
+
|
|
21
|
+
_This version does not introduce any user-facing changes._
|
|
22
|
+
|
|
13
23
|
## 0.29.3 — 2024-11-06
|
|
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.29.
|
|
4
|
+
version = '0.29.5'
|
|
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.29.
|
|
17
|
+
versionName '0.29.5'
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -23,6 +23,12 @@ object SplashScreenManager {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
private fun configureSplashScreen(options: SplashScreenOptions = SplashScreenOptions()) {
|
|
26
|
+
// If loaded in a headless JS context we might not have initialized the splash screen
|
|
27
|
+
// lateinit variable, so let's check to be nice citizens
|
|
28
|
+
if (!::splashScreen.isInitialized) {
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
val duration = options.duration
|
|
27
33
|
|
|
28
34
|
splashScreen.setOnExitAnimationListener { splashScreenViewProvider ->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplashScreen.types.js","sourceRoot":"","sources":["../src/SplashScreen.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NativeModule } from 'expo-modules-core/types';\n\nexport type SplashScreenOptions = {\n /**\n * The duration of the fade out animation in milliseconds.\n * @default 400\n */\n duration?: number;\n /**\n * Whether to hide the splash screen with a fade out animation.\n * @ios\n * @default false\n */\n fade?: boolean;\n};\n\nexport interface SplashScreenNativeModule extends NativeModule {\n setOptions: (options: SplashScreenOptions) => void;\n preventAutoHideAsync: () => Promise<boolean>;\n hide: () => void;\n hideAsync: () => Promise<void>;\n // @private\n _internal_maybeHideAsync: () => Promise<void>;\n // @private\n _internal_preventAutoHideAsync: () => Promise<boolean>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SplashScreen.types.js","sourceRoot":"","sources":["../src/SplashScreen.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NativeModule } from 'expo-modules-core/types';\n\nexport type SplashScreenOptions = {\n /**\n * The duration of the fade out animation in milliseconds.\n * @default 400\n */\n duration?: number;\n /**\n * Whether to hide the splash screen with a fade out animation.\n * @platform ios\n * @default false\n */\n fade?: boolean;\n};\n\nexport interface SplashScreenNativeModule extends NativeModule {\n setOptions: (options: SplashScreenOptions) => void;\n preventAutoHideAsync: () => Promise<boolean>;\n hide: () => void;\n hideAsync: () => Promise<void>;\n // @private\n _internal_maybeHideAsync: () => Promise<void>;\n // @private\n _internal_preventAutoHideAsync: () => Promise<boolean>;\n}\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SplashScreenOptions } from './SplashScreen.types';
|
|
1
|
+
import type { SplashScreenOptions } from './SplashScreen.types';
|
|
2
2
|
/**
|
|
3
3
|
* Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.
|
|
4
4
|
*
|
|
@@ -18,6 +18,11 @@ import { SplashScreenOptions } from './SplashScreen.types';
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export declare function preventAutoHideAsync(): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* Configures the splashscreens default animation behavior.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
21
26
|
export declare function setOptions(options: SplashScreenOptions): void;
|
|
22
27
|
/**
|
|
23
28
|
* Hides the native splash screen immediately. Be careful to ensure that your app has content ready
|
|
@@ -25,5 +30,10 @@ export declare function setOptions(options: SplashScreenOptions): void;
|
|
|
25
30
|
* ["Usage"](#usage) section for an example.
|
|
26
31
|
*/
|
|
27
32
|
export declare function hide(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Hides the native splash screen immediately. This method is provided for backwards compatability. See the
|
|
35
|
+
* ["Usage"](#usage) section for an example.
|
|
36
|
+
*/
|
|
28
37
|
export declare function hideAsync(): Promise<void>;
|
|
38
|
+
export { SplashScreenOptions };
|
|
29
39
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAG;AAGjE;;;;GAIG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAAG;AAE/B;;;GAGG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;AAEnD,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
export async function preventAutoHideAsync() {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* Configures the splashscreens default animation behavior.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
23
28
|
export function setOptions(options) { }
|
|
24
29
|
// @needsAudit
|
|
25
30
|
/**
|
|
@@ -28,5 +33,9 @@ export function setOptions(options) { }
|
|
|
28
33
|
* ["Usage"](#usage) section for an example.
|
|
29
34
|
*/
|
|
30
35
|
export function hide() { }
|
|
36
|
+
/**
|
|
37
|
+
* Hides the native splash screen immediately. This method is provided for backwards compatability. See the
|
|
38
|
+
* ["Usage"](#usage) section for an example.
|
|
39
|
+
*/
|
|
31
40
|
export async function hideAsync() { }
|
|
32
41
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc;AAId;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAA4B,IAAS,CAAC;AAEjE,cAAc;AACd;;;;GAIG;AACH,MAAM,UAAU,IAAI,KAAU,CAAC;AAE/B,MAAM,CAAC,KAAK,UAAU,SAAS,KAAmB,CAAC","sourcesContent":["// @needsAudit\n\nimport { SplashScreenOptions } from './SplashScreen.types';\n\n/**\n * Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.\n *\n * > **Important note**: It is recommended to call this in global scope without awaiting, rather than\n * > inside React components or hooks, because otherwise this might be called too late,\n * > when the splash screen is already hidden.\n *\n * @example\n * ```ts\n * import * as SplashScreen from 'expo-splash-screen';\n *\n * SplashScreen.preventAutoHideAsync();\n *\n * export default function App() {\n * // ...\n * }\n * ```\n */\nexport async function preventAutoHideAsync(): Promise<boolean> {\n return false;\n}\n\nexport function setOptions(options: SplashScreenOptions): void {}\n\n// @needsAudit\n/**\n * Hides the native splash screen immediately. Be careful to ensure that your app has content ready\n * to display when you hide the splash screen, or you may see a blank screen briefly. See the\n * [\"Usage\"](#usage) section for an example.\n */\nexport function hide(): void {}\n\nexport async function hideAsync(): Promise<void> {}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc;AAId;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,OAA4B,IAAS,CAAC;AAEjE,cAAc;AACd;;;;GAIG;AACH,MAAM,UAAU,IAAI,KAAU,CAAC;AAE/B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,KAAmB,CAAC","sourcesContent":["// @needsAudit\n\nimport type { SplashScreenOptions } from './SplashScreen.types';\n\n/**\n * Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.\n *\n * > **Important note**: It is recommended to call this in global scope without awaiting, rather than\n * > inside React components or hooks, because otherwise this might be called too late,\n * > when the splash screen is already hidden.\n *\n * @example\n * ```ts\n * import * as SplashScreen from 'expo-splash-screen';\n *\n * SplashScreen.preventAutoHideAsync();\n *\n * export default function App() {\n * // ...\n * }\n * ```\n */\nexport async function preventAutoHideAsync(): Promise<boolean> {\n return false;\n}\n\n/**\n *\n * Configures the splashscreens default animation behavior.\n *\n */\nexport function setOptions(options: SplashScreenOptions): void {}\n\n// @needsAudit\n/**\n * Hides the native splash screen immediately. Be careful to ensure that your app has content ready\n * to display when you hide the splash screen, or you may see a blank screen briefly. See the\n * [\"Usage\"](#usage) section for an example.\n */\nexport function hide(): void {}\n\n/**\n * Hides the native splash screen immediately. This method is provided for backwards compatability. See the\n * [\"Usage\"](#usage) section for an example.\n */\nexport async function hideAsync(): Promise<void> {}\n\nexport { SplashScreenOptions };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-splash-screen",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.5",
|
|
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": "8.0.
|
|
37
|
+
"@expo/prebuild-config": "8.0.10"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"expo-module-scripts": "^4.0.0"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"expo": "*"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "1f84b4c952ed9785c41ee65c9877e44f1df27af9"
|
|
46
46
|
}
|
|
@@ -3,10 +3,15 @@ import { IOSSplashConfig } from '@expo/prebuild-config/build/plugins/unversioned
|
|
|
3
3
|
import { ConfigPlugin } from 'expo/config-plugins';
|
|
4
4
|
type PluginConfig = {
|
|
5
5
|
backgroundColor: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
imageWidth?: number;
|
|
7
|
+
enableFullScreenImage_legacy?: boolean;
|
|
8
|
+
image?: string;
|
|
9
|
+
dark?: {
|
|
10
|
+
image?: string;
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
};
|
|
13
|
+
android?: AndroidSplashConfig;
|
|
14
|
+
ios?: IOSSplashConfig;
|
|
10
15
|
};
|
|
11
16
|
declare const _default: ConfigPlugin<PluginConfig>;
|
|
12
17
|
export default _default;
|
|
@@ -6,18 +6,27 @@ const config_plugins_1 = require("expo/config-plugins");
|
|
|
6
6
|
const pkg = require('expo-splash-screen/package.json');
|
|
7
7
|
const withSplashScreen = (config, props) => {
|
|
8
8
|
const android = {
|
|
9
|
-
...config.splash,
|
|
10
|
-
...config.android?.splash,
|
|
11
9
|
...props,
|
|
12
10
|
...props?.android,
|
|
11
|
+
resizeMode: 'contain',
|
|
12
|
+
dark: {
|
|
13
|
+
...props?.android?.dark,
|
|
14
|
+
...props?.dark,
|
|
15
|
+
resizeMode: 'contain',
|
|
16
|
+
},
|
|
13
17
|
};
|
|
14
18
|
const ios = {
|
|
15
|
-
...config.splash,
|
|
16
|
-
...config.ios?.splash,
|
|
17
19
|
...props,
|
|
18
20
|
...props?.ios,
|
|
21
|
+
resizeMode: 'contain',
|
|
22
|
+
dark: {
|
|
23
|
+
...props?.ios?.dark,
|
|
24
|
+
...props?.dark,
|
|
25
|
+
},
|
|
19
26
|
};
|
|
20
|
-
|
|
27
|
+
// Need to pass null here if we don't receive any props. This means that the plugin has not been used.
|
|
28
|
+
// This only happens on Android. On iOS, if you don't use the plugin, this function won't be called.
|
|
29
|
+
config = (0, withAndroidSplashScreen_1.withAndroidSplashScreen)(config, props ? android : null);
|
|
21
30
|
config = (0, withIosSplashScreen_1.withIosSplashScreen)(config, ios);
|
|
22
31
|
return config;
|
|
23
32
|
};
|
|
@@ -8,27 +8,41 @@ const pkg = require('expo-splash-screen/package.json');
|
|
|
8
8
|
|
|
9
9
|
type PluginConfig = {
|
|
10
10
|
backgroundColor: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
imageWidth?: number;
|
|
12
|
+
enableFullScreenImage_legacy?: boolean;
|
|
13
|
+
image?: string;
|
|
14
|
+
dark?: {
|
|
15
|
+
image?: string;
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
};
|
|
18
|
+
android?: AndroidSplashConfig;
|
|
19
|
+
ios?: IOSSplashConfig;
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
const withSplashScreen: ConfigPlugin<PluginConfig> = (config, props) => {
|
|
18
23
|
const android: AndroidSplashConfig = {
|
|
19
|
-
...config.splash,
|
|
20
|
-
...config.android?.splash,
|
|
21
24
|
...props,
|
|
22
25
|
...props?.android,
|
|
26
|
+
resizeMode: 'contain',
|
|
27
|
+
dark: {
|
|
28
|
+
...props?.android?.dark,
|
|
29
|
+
...props?.dark,
|
|
30
|
+
resizeMode: 'contain',
|
|
31
|
+
},
|
|
23
32
|
};
|
|
24
|
-
const ios = {
|
|
25
|
-
...config.splash,
|
|
26
|
-
...config.ios?.splash,
|
|
33
|
+
const ios: IOSSplashConfig = {
|
|
27
34
|
...props,
|
|
28
35
|
...props?.ios,
|
|
36
|
+
resizeMode: 'contain',
|
|
37
|
+
dark: {
|
|
38
|
+
...props?.ios?.dark,
|
|
39
|
+
...props?.dark,
|
|
40
|
+
},
|
|
29
41
|
};
|
|
30
42
|
|
|
31
|
-
|
|
43
|
+
// Need to pass null here if we don't receive any props. This means that the plugin has not been used.
|
|
44
|
+
// This only happens on Android. On iOS, if you don't use the plugin, this function won't be called.
|
|
45
|
+
config = withAndroidSplashScreen(config, props ? android : null);
|
|
32
46
|
config = withIosSplashScreen(config, ios);
|
|
33
47
|
return config;
|
|
34
48
|
};
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @needsAudit
|
|
2
2
|
|
|
3
|
-
import { SplashScreenOptions } from './SplashScreen.types';
|
|
3
|
+
import type { SplashScreenOptions } from './SplashScreen.types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.
|
|
@@ -24,6 +24,11 @@ export async function preventAutoHideAsync(): Promise<boolean> {
|
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* Configures the splashscreens default animation behavior.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
27
32
|
export function setOptions(options: SplashScreenOptions): void {}
|
|
28
33
|
|
|
29
34
|
// @needsAudit
|
|
@@ -34,4 +39,10 @@ export function setOptions(options: SplashScreenOptions): void {}
|
|
|
34
39
|
*/
|
|
35
40
|
export function hide(): void {}
|
|
36
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Hides the native splash screen immediately. This method is provided for backwards compatability. See the
|
|
44
|
+
* ["Usage"](#usage) section for an example.
|
|
45
|
+
*/
|
|
37
46
|
export async function hideAsync(): Promise<void> {}
|
|
47
|
+
|
|
48
|
+
export { SplashScreenOptions };
|