react-native-bootsplash 4.7.5 → 5.0.0-beta.1
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 +214 -107
- package/RNBootSplash.podspec +1 -2
- package/android/build.gradle +0 -1
- package/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplash.java +3 -2
- package/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashDialog.java +49 -0
- package/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashModuleImpl.java +157 -87
- package/android/src/main/res/anim/bootsplash_fade_in.xml +7 -0
- package/android/src/main/res/anim/bootsplash_fade_out.xml +7 -0
- package/android/src/main/res/drawable/compat_splash_screen.xml +19 -0
- package/android/src/main/res/values/attrs.xml +8 -0
- package/android/src/main/res/values/public.xml +7 -0
- package/android/src/main/res/values/styles.xml +29 -0
- package/android/src/main/res/values-v31/styles.xml +7 -0
- package/android/src/newarch/com/zoontek/rnbootsplash/RNBootSplashModule.java +11 -4
- package/android/src/oldarch/com/zoontek/rnbootsplash/RNBootSplashModule.java +13 -4
- package/dist/commonjs/NativeRNBootSplash.js.map +1 -1
- package/dist/commonjs/addon/index.js +3 -0
- package/dist/commonjs/addon/index.js.map +1 -0
- package/dist/commonjs/generate.js +289 -194
- package/dist/commonjs/generate.js.map +1 -1
- package/dist/commonjs/index.js +115 -7
- package/dist/commonjs/index.js.map +1 -1
- package/dist/module/NativeRNBootSplash.js.map +1 -1
- package/dist/module/addon/index.js +3 -0
- package/dist/module/addon/index.js.map +1 -0
- package/dist/module/generate.js +287 -195
- package/dist/module/generate.js.map +1 -1
- package/dist/module/index.js +113 -6
- package/dist/module/index.js.map +1 -1
- package/dist/typescript/NativeRNBootSplash.d.ts +6 -3
- package/dist/typescript/NativeRNBootSplash.d.ts.map +1 -1
- package/dist/typescript/addon/index.d.ts +3 -0
- package/dist/typescript/addon/index.d.ts.map +1 -0
- package/dist/typescript/generate.d.ts +47 -14
- package/dist/typescript/generate.d.ts.map +1 -1
- package/dist/typescript/index.d.ts +33 -5
- package/dist/typescript/index.d.ts.map +1 -1
- package/ios/RNBootSplash.mm +101 -95
- package/package.json +20 -14
- package/react-native.config.js +74 -76
- package/src/NativeRNBootSplash.ts +3 -4
- package/src/generate.ts +457 -232
- package/src/index.ts +205 -8
- package/RNBootSplash.res +0 -29
- package/bsconfig.json +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-bootsplash",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Display a bootsplash on your app starts. Hide it when you want.",
|
|
6
6
|
"author": "Mathieu Acthernoene <zoontek@gmail.com>",
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
"/ios",
|
|
15
15
|
"/src",
|
|
16
16
|
"RNBootSplash.podspec",
|
|
17
|
-
"RNBootSplash.res",
|
|
18
|
-
"bsconfig.json",
|
|
19
17
|
"package.json",
|
|
20
18
|
"react-native.config.js"
|
|
21
19
|
],
|
|
@@ -36,10 +34,12 @@
|
|
|
36
34
|
"launchscreen"
|
|
37
35
|
],
|
|
38
36
|
"scripts": {
|
|
39
|
-
"format": "prettier '**/*' -u -w",
|
|
40
37
|
"setup-hooks": "git config --local core.hooksPath .hooks",
|
|
41
|
-
"
|
|
42
|
-
"typecheck": "tsc --project ./ --noEmit"
|
|
38
|
+
"lint": "eslint --ext ts,tsx ./src",
|
|
39
|
+
"typecheck": "tsc --project ./ --noEmit",
|
|
40
|
+
"build": "bob build",
|
|
41
|
+
"format": "prettier '**/*' -u -w",
|
|
42
|
+
"prepack": "yarn lint && yarn typecheck && yarn build && node ../obfuscator"
|
|
43
43
|
},
|
|
44
44
|
"react-native-builder-bob": {
|
|
45
45
|
"source": "src",
|
|
@@ -57,25 +57,31 @@
|
|
|
57
57
|
"*": "prettier -u -w"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"react-native": ">=0.
|
|
60
|
+
"react-native": ">=0.70.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"fs-extra": "^11.1.1",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
64
|
+
"picocolors": "^1.0.0",
|
|
65
|
+
"sharp": "^0.32.4"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@babel/core": "^7.20.0",
|
|
69
|
+
"@babel/preset-env": "^7.20.0",
|
|
70
|
+
"@react-native-community/cli-types": "11.3.5",
|
|
69
71
|
"@types/fs-extra": "^11.0.1",
|
|
70
|
-
"@types/
|
|
72
|
+
"@types/node": "^20.4.7",
|
|
73
|
+
"@types/react": "^18.2.18",
|
|
71
74
|
"@types/sharp": "^0.31.1",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
|
76
|
+
"@typescript-eslint/parser": "^6.2.1",
|
|
77
|
+
"eslint": "^8.46.0",
|
|
78
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
72
79
|
"lint-staged": "^13.2.3",
|
|
73
80
|
"prettier": "^2.8.8",
|
|
74
|
-
"prettier-plugin-organize-imports": "^3.2.
|
|
81
|
+
"prettier-plugin-organize-imports": "^3.2.3",
|
|
75
82
|
"react": "18.2.0",
|
|
76
|
-
"react-native": "0.72.
|
|
77
|
-
"react-native-builder-bob": "^0.21.
|
|
78
|
-
"rescript": "^10.1.4",
|
|
83
|
+
"react-native": "0.72.3",
|
|
84
|
+
"react-native-builder-bob": "^0.21.3",
|
|
79
85
|
"typescript": "^5.1.6"
|
|
80
86
|
},
|
|
81
87
|
"codegenConfig": {
|
package/react-native.config.js
CHANGED
|
@@ -1,81 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** @type {import("@react-native-community/cli-types").Command} */
|
|
2
|
+
const generateBootSplash = {
|
|
3
|
+
name: "generate-bootsplash <logo>",
|
|
4
|
+
description: "Generate a launch screen using a logo file path (PNG or SVG)",
|
|
5
|
+
options: [
|
|
6
|
+
{
|
|
7
|
+
name: "--background <string>",
|
|
8
|
+
description: "Background color (in hexadecimal format)",
|
|
9
|
+
default: "#fff",
|
|
10
|
+
},
|
|
3
11
|
{
|
|
4
|
-
name: "
|
|
12
|
+
name: "--logo-width <number>",
|
|
5
13
|
description:
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Fix to support previous CLI versions
|
|
58
|
-
projectPath: (ios.xcodeProject
|
|
59
|
-
? path.resolve(ios.sourceDir, ios.xcodeProject.name)
|
|
60
|
-
: ios.projectPath
|
|
61
|
-
).replace(/\.(xcodeproj|xcworkspace)$/, ""),
|
|
62
|
-
}
|
|
63
|
-
: null,
|
|
64
|
-
|
|
65
|
-
workingPath,
|
|
66
|
-
logoPath: path.resolve(workingPath, logoPath),
|
|
67
|
-
assetsPath: assetsPath
|
|
68
|
-
? path.resolve(workingPath, assetsPath)
|
|
69
|
-
: undefined,
|
|
70
|
-
|
|
71
|
-
backgroundColor,
|
|
72
|
-
flavor,
|
|
73
|
-
logoWidth,
|
|
74
|
-
platforms,
|
|
75
|
-
}).catch((error) => {
|
|
76
|
-
console.error(error);
|
|
77
|
-
});
|
|
78
|
-
},
|
|
14
|
+
"Logo width at @1x (in dp - we recommend approximately ~100)",
|
|
15
|
+
default: 100,
|
|
16
|
+
parse: (value) => parseInt(value, 10),
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "--assets-output <string>",
|
|
20
|
+
description: "Assets output directory path",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "--platforms <list>",
|
|
24
|
+
description: "Platforms to generate for, separated by a comma",
|
|
25
|
+
default: "android,ios",
|
|
26
|
+
parse: (value) =>
|
|
27
|
+
value
|
|
28
|
+
.toLowerCase()
|
|
29
|
+
.split(",")
|
|
30
|
+
.map((platform) => platform.trim()),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "--flavor <string>",
|
|
34
|
+
description:
|
|
35
|
+
"Android flavor build variant (where your resource directory is)",
|
|
36
|
+
default: "main",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "--license-key <string>",
|
|
40
|
+
description:
|
|
41
|
+
"License key to enable brand and dark mode assets generation",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "--brand <string>",
|
|
45
|
+
description: "Brand file path (PNG or SVG)",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "--brand-width <number>",
|
|
49
|
+
description:
|
|
50
|
+
"Brand width at @1x (in dp - we recommend approximately ~80)",
|
|
51
|
+
default: 80,
|
|
52
|
+
parse: (value) => parseInt(value, 10),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "--dark-background <string>",
|
|
56
|
+
description: "[dark mode] Background color (in hexadecimal format)",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "--dark-logo <string>",
|
|
60
|
+
description: "[dark mode] Logo file path (PNG or SVG)",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "--dark-brand <string>",
|
|
64
|
+
description: "[dark mode] Brand file path (PNG or SVG)",
|
|
79
65
|
},
|
|
80
66
|
],
|
|
67
|
+
func: (argv, ctx, args) => {
|
|
68
|
+
const { generate } = require("./dist/commonjs/generate");
|
|
69
|
+
|
|
70
|
+
generate(argv, ctx, args).catch((error) => {
|
|
71
|
+
console.error(error);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
module.exports = {
|
|
78
|
+
commands: [generateBootSplash],
|
|
81
79
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { TurboModule } from "react-native";
|
|
2
2
|
import { TurboModuleRegistry } from "react-native";
|
|
3
3
|
|
|
4
|
-
export type VisibilityStatus = "visible" | "hidden" | "transitioning";
|
|
5
|
-
|
|
6
4
|
export interface Spec extends TurboModule {
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
getConstants(): { navigationBarHeight: number; statusBarHeight: number };
|
|
6
|
+
hide(fade: boolean): Promise<void>;
|
|
7
|
+
isVisible(): Promise<boolean>;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export default TurboModuleRegistry.getEnforcing<Spec>("RNBootSplash");
|