@capacitor/splash-screen 1.1.2 → 1.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 CHANGED
@@ -3,6 +3,60 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.2.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@1.1.6...@capacitor/splash-screen@1.2.0) (2021-12-08)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **splash-screen:** pick first window when there is no key window ([#730](https://github.com/ionic-team/capacitor-plugins/issues/730)) ([0e335ad](https://github.com/ionic-team/capacitor-plugins/commit/0e335ad386da8ceadfdfaa3be982840547fc41b6))
12
+
13
+
14
+ ### Features
15
+
16
+ * **splash-screen:** Make splash work in apps that use scenes ([#631](https://github.com/ionic-team/capacitor-plugins/issues/631)) ([cf0d214](https://github.com/ionic-team/capacitor-plugins/commit/cf0d2143c225336984a6bc8fa7ef814a18b02bd1))
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.1.6](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@1.1.5...@capacitor/splash-screen@1.1.6) (2021-11-03)
23
+
24
+ **Note:** Version bump only for package @capacitor/splash-screen
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.1.5](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@1.1.4...@capacitor/splash-screen@1.1.5) (2021-10-14)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * remove postpublish scripts ([#656](https://github.com/ionic-team/capacitor-plugins/issues/656)) ([ed6ac49](https://github.com/ionic-team/capacitor-plugins/commit/ed6ac499ebf4a47525071ccbfc36c27503e11f60))
36
+
37
+
38
+
39
+
40
+
41
+ ## [1.1.4](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@1.1.3...@capacitor/splash-screen@1.1.4) (2021-10-13)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * correct addListeners links ([#655](https://github.com/ionic-team/capacitor-plugins/issues/655)) ([f9871e7](https://github.com/ionic-team/capacitor-plugins/commit/f9871e7bd53478addb21155e148829f550c0e457))
47
+
48
+
49
+
50
+
51
+
52
+ ## [1.1.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@1.1.2...@capacitor/splash-screen@1.1.3) (2021-09-27)
53
+
54
+ **Note:** Version bump only for package @capacitor/splash-screen
55
+
56
+
57
+
58
+
59
+
6
60
  ## [1.1.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@1.1.1...@capacitor/splash-screen@1.1.2) (2021-09-01)
7
61
 
8
62
  **Note:** Version bump only for package @capacitor/splash-screen
package/README.md CHANGED
@@ -15,15 +15,15 @@ npx cap sync
15
15
  import { SplashScreen } from '@capacitor/splash-screen';
16
16
 
17
17
  // Hide the splash (you should do this on app launch)
18
- SplashScreen.hide();
18
+ await SplashScreen.hide();
19
19
 
20
20
  // Show the splash for an indefinite amount of time:
21
- SplashScreen.show({
21
+ await SplashScreen.show({
22
22
  autoHide: false
23
23
  });
24
24
 
25
25
  // Show the splash for two seconds and then automatically hide it:
26
- SplashScreen.show({
26
+ await SplashScreen.show({
27
27
  showDuration: 2000,
28
28
  autoHide: true
29
29
  });
@@ -73,7 +73,7 @@ These config values are available:
73
73
 
74
74
  | Prop | Type | Description | Default | Since |
75
75
  | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- | ----- |
76
- | **`launchShowDuration`** | <code>number</code> | How long to show the launch splash screen when autoHide is enabled (in ms) | <code>0</code> | 1.0.0 |
76
+ | **`launchShowDuration`** | <code>number</code> | How long to show the launch splash screen when autoHide is enabled (in ms) | <code>500</code> | 1.0.0 |
77
77
  | **`launchAutoHide`** | <code>boolean</code> | Whether to auto hide the splash after launchShowDuration. | <code>true</code> | 1.0.0 |
78
78
  | **`backgroundColor`** | <code>string</code> | Color of the background of the Splash Screen in hex format, #RRGGBB or #RRGGBBAA. Doesn't work if `useDialog` is true. | | 1.0.0 |
79
79
  | **`androidSplashResourceName`** | <code>string</code> | Name of the resource to be used as Splash Screen. Only available on Android. | <code>splash</code> | 1.0.0 |
package/dist/docs.json CHANGED
@@ -165,7 +165,7 @@
165
165
  "name": "since"
166
166
  },
167
167
  {
168
- "text": "0",
168
+ "text": "500",
169
169
  "name": "default"
170
170
  },
171
171
  {
@@ -8,7 +8,7 @@ declare module '@capacitor/cli' {
8
8
  * How long to show the launch splash screen when autoHide is enabled (in ms)
9
9
  *
10
10
  * @since 1.0.0
11
- * @default 0
11
+ * @default 500
12
12
  * @example 3000
13
13
  */
14
14
  launchShowDuration?: number;
package/dist/plugin.js CHANGED
@@ -25,5 +25,5 @@ var capacitorSplashScreen = (function (exports, core) {
25
25
 
26
26
  return exports;
27
27
 
28
- }({}, capacitorExports));
28
+ })({}, capacitorExports);
29
29
  //# sourceMappingURL=plugin.js.map
@@ -117,16 +117,21 @@ import Capacitor
117
117
  // Update the bounds for the splash image. This will also be called when
118
118
  // the parent view observers fire
119
119
  private func updateSplashImageBounds() {
120
- guard let delegate = UIApplication.shared.delegate else {
121
- CAPLog.print("Unable to find root window object for SplashScreen bounds. Please file an issue")
122
- return
120
+ var window: UIWindow? = UIApplication.shared.delegate?.window as? UIWindow
121
+
122
+ if #available(iOS 13, *), window == nil {
123
+ let scene: UIWindowScene? = UIApplication.shared.connectedScenes.first as? UIWindowScene
124
+ window = scene?.windows.filter({$0.isKeyWindow}).first
125
+ if window == nil {
126
+ window = scene?.windows.first
127
+ }
123
128
  }
124
129
 
125
- guard let window = delegate.window as? UIWindow else {
130
+ if let unwrappedWindow = window {
131
+ viewController.view.frame = CGRect(origin: CGPoint(x: 0, y: 0), size: unwrappedWindow.bounds.size)
132
+ } else {
126
133
  CAPLog.print("Unable to find root window object for SplashScreen bounds. Please file an issue")
127
- return
128
134
  }
129
- viewController.view.frame = CGRect(origin: CGPoint(x: 0, y: 0), size: window.bounds.size)
130
135
  }
131
136
 
132
137
  override public func observeValue(forKeyPath keyPath: String?, of object: Any?, change _: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/splash-screen",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "The Splash Screen API provides methods for showing or hiding a Splash image.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -33,7 +33,7 @@
33
33
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
34
34
  "verify:web": "npm run build",
35
35
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
36
- "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- autocorrect --format",
36
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
37
37
  "eslint": "eslint . --ext ts",
38
38
  "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
39
39
  "swiftlint": "node-swiftlint",
@@ -42,14 +42,13 @@
42
42
  "clean": "rimraf ./dist",
43
43
  "watch": "tsc --watch",
44
44
  "prepublishOnly": "npm run build",
45
- "postpublish": "npm run publish:cocoapod",
46
45
  "publish:cocoapod": "pod trunk push ./CapacitorSplashScreen.podspec --allow-warnings"
47
46
  },
48
47
  "devDependencies": {
49
48
  "@capacitor/android": "^3.0.0",
50
49
  "@capacitor/cli": "^3.0.0",
51
50
  "@capacitor/core": "^3.0.0",
52
- "@capacitor/docgen": "0.0.17",
51
+ "@capacitor/docgen": "0.0.18",
53
52
  "@capacitor/ios": "^3.0.0",
54
53
  "@ionic/eslint-config": "^0.3.0",
55
54
  "@ionic/prettier-config": "~1.0.1",
@@ -81,5 +80,5 @@
81
80
  "publishConfig": {
82
81
  "access": "public"
83
82
  },
84
- "gitHead": "f0dcbb1413ba781714dfdc44f41c0ccab735b1e9"
83
+ "gitHead": "d378c00d51b1c9fb978772906448fa0ec9cb81d0"
85
84
  }