@capacitor/browser 4.0.0-beta.0 → 4.0.0-beta.2
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 -0
- package/README.md +2 -0
- package/dist/docs.json +24 -0
- package/dist/esm/definitions.d.ts +16 -0
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Plugin/BrowserPlugin.swift +5 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [4.0.0-beta.2](https://github.com/ionic-team/capacitor-plugins/compare/4.0.0-beta.0...4.0.0-beta.2) (2022-07-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **browser:** Allow to configure popover size ([#1056](https://github.com/ionic-team/capacitor-plugins/issues/1056)) ([90eb1e5](https://github.com/ionic-team/capacitor-plugins/commit/90eb1e5356aab11103f9b1f56808102ee42f2f1b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 4.0.0-beta.0 (2022-06-27)
|
|
7
18
|
|
|
8
19
|
|
package/README.md
CHANGED
|
@@ -146,6 +146,8 @@ Represents the options passed to `open`.
|
|
|
146
146
|
| **`windowName`** | <code>string</code> | Web only: Optional target for browser open. Follows the `target` property for window.open. Defaults to _blank. Ignored on other platforms. | 1.0.0 |
|
|
147
147
|
| **`toolbarColor`** | <code>string</code> | A hex color to which the toolbar color is set. | 1.0.0 |
|
|
148
148
|
| **`presentationStyle`** | <code>'fullscreen' \| 'popover'</code> | iOS only: The presentation style of the browser. Defaults to fullscreen. Ignored on other platforms. | 1.0.0 |
|
|
149
|
+
| **`width`** | <code>number</code> | iOS only: The width the browser when using presentationStyle 'popover' on iPads. Ignored on other platforms. | 4.0.0 |
|
|
150
|
+
| **`height`** | <code>number</code> | iOS only: The height the browser when using presentationStyle 'popover' on iPads. Ignored on other platforms. | 4.0.0 |
|
|
149
151
|
|
|
150
152
|
|
|
151
153
|
#### PluginListenerHandle
|
package/dist/docs.json
CHANGED
|
@@ -177,6 +177,30 @@
|
|
|
177
177
|
"docs": "iOS only: The presentation style of the browser. Defaults to fullscreen.\n\nIgnored on other platforms.",
|
|
178
178
|
"complexTypes": [],
|
|
179
179
|
"type": "'fullscreen' | 'popover' | undefined"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "width",
|
|
183
|
+
"tags": [
|
|
184
|
+
{
|
|
185
|
+
"text": "4.0.0",
|
|
186
|
+
"name": "since"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"docs": "iOS only: The width the browser when using presentationStyle 'popover' on iPads.\n\nIgnored on other platforms.",
|
|
190
|
+
"complexTypes": [],
|
|
191
|
+
"type": "number | undefined"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "height",
|
|
195
|
+
"tags": [
|
|
196
|
+
{
|
|
197
|
+
"text": "4.0.0",
|
|
198
|
+
"name": "since"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"docs": "iOS only: The height the browser when using presentationStyle 'popover' on iPads.\n\nIgnored on other platforms.",
|
|
202
|
+
"complexTypes": [],
|
|
203
|
+
"type": "number | undefined"
|
|
180
204
|
}
|
|
181
205
|
]
|
|
182
206
|
},
|
|
@@ -72,6 +72,22 @@ export interface OpenOptions {
|
|
|
72
72
|
* @since 1.0.0
|
|
73
73
|
*/
|
|
74
74
|
presentationStyle?: 'fullscreen' | 'popover';
|
|
75
|
+
/**
|
|
76
|
+
* iOS only: The width the browser when using presentationStyle 'popover' on iPads.
|
|
77
|
+
*
|
|
78
|
+
* Ignored on other platforms.
|
|
79
|
+
*
|
|
80
|
+
* @since 4.0.0
|
|
81
|
+
*/
|
|
82
|
+
width?: number;
|
|
83
|
+
/**
|
|
84
|
+
* iOS only: The height the browser when using presentationStyle 'popover' on iPads.
|
|
85
|
+
*
|
|
86
|
+
* Ignored on other platforms.
|
|
87
|
+
*
|
|
88
|
+
* @since 4.0.0
|
|
89
|
+
*/
|
|
90
|
+
height?: number;
|
|
75
91
|
}
|
|
76
92
|
/**
|
|
77
93
|
* @deprecated Use `OpenOptions`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface BrowserPlugin {\n /**\n * Open a page with the specified options.\n *\n * @since 1.0.0\n */\n open(options: OpenOptions): Promise<void>;\n\n /**\n * Web & iOS only: Close an open browser window.\n *\n * No-op on other platforms.\n *\n * @since 1.0.0\n */\n close(): Promise<void>;\n\n /**\n * Android & iOS only: Listen for the browser finished event.\n * It fires when the Browser is closed by the user.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'browserFinished',\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Android & iOS only: Listen for the page loaded event.\n * It's only fired when the URL passed to open method finish loading.\n * It is not invoked for any subsequent page loads.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'browserPageLoaded',\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Remove all native listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * Represents the options passed to `open`.\n *\n * @since 1.0.0\n */\nexport interface OpenOptions {\n /**\n * The URL to which the browser is opened.\n *\n * @since 1.0.0\n */\n url: string;\n\n /**\n * Web only: Optional target for browser open. Follows\n * the `target` property for window.open. Defaults\n * to _blank.\n *\n * Ignored on other platforms.\n *\n * @since 1.0.0\n */\n windowName?: string;\n\n /**\n * A hex color to which the toolbar color is set.\n *\n * @since 1.0.0\n */\n toolbarColor?: string;\n\n /**\n * iOS only: The presentation style of the browser. Defaults to fullscreen.\n *\n * Ignored on other platforms.\n *\n * @since 1.0.0\n */\n presentationStyle?: 'fullscreen' | 'popover';\n}\n\n/**\n * @deprecated Use `OpenOptions`.\n * @since 1.0.0\n */\nexport type BrowserOpenOptions = OpenOptions;\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface BrowserPlugin {\n /**\n * Open a page with the specified options.\n *\n * @since 1.0.0\n */\n open(options: OpenOptions): Promise<void>;\n\n /**\n * Web & iOS only: Close an open browser window.\n *\n * No-op on other platforms.\n *\n * @since 1.0.0\n */\n close(): Promise<void>;\n\n /**\n * Android & iOS only: Listen for the browser finished event.\n * It fires when the Browser is closed by the user.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'browserFinished',\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Android & iOS only: Listen for the page loaded event.\n * It's only fired when the URL passed to open method finish loading.\n * It is not invoked for any subsequent page loads.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'browserPageLoaded',\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Remove all native listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * Represents the options passed to `open`.\n *\n * @since 1.0.0\n */\nexport interface OpenOptions {\n /**\n * The URL to which the browser is opened.\n *\n * @since 1.0.0\n */\n url: string;\n\n /**\n * Web only: Optional target for browser open. Follows\n * the `target` property for window.open. Defaults\n * to _blank.\n *\n * Ignored on other platforms.\n *\n * @since 1.0.0\n */\n windowName?: string;\n\n /**\n * A hex color to which the toolbar color is set.\n *\n * @since 1.0.0\n */\n toolbarColor?: string;\n\n /**\n * iOS only: The presentation style of the browser. Defaults to fullscreen.\n *\n * Ignored on other platforms.\n *\n * @since 1.0.0\n */\n presentationStyle?: 'fullscreen' | 'popover';\n\n /**\n * iOS only: The width the browser when using presentationStyle 'popover' on iPads.\n *\n * Ignored on other platforms.\n *\n * @since 4.0.0\n */\n width?: number;\n\n /**\n * iOS only: The height the browser when using presentationStyle 'popover' on iPads.\n *\n * Ignored on other platforms.\n *\n * @since 4.0.0\n */\n height?: number;\n}\n\n/**\n * @deprecated Use `OpenOptions`.\n * @since 1.0.0\n */\nexport type BrowserOpenOptions = OpenOptions;\n"]}
|
|
@@ -28,7 +28,11 @@ public class CAPBrowserPlugin: CAPPlugin {
|
|
|
28
28
|
// display
|
|
29
29
|
DispatchQueue.main.async { [weak self] in
|
|
30
30
|
if style == .popover {
|
|
31
|
-
|
|
31
|
+
if let width = call.getInt("width"), let height = call.getInt("height") {
|
|
32
|
+
self?.setCenteredPopover(viewController, size: CGSize.init(width: width, height: height))
|
|
33
|
+
} else {
|
|
34
|
+
self?.setCenteredPopover(viewController)
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
self?.bridge?.presentVC(viewController, animated: true, completion: {
|
|
34
38
|
call.resolve()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/browser",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
4
4
|
"description": "The Browser API provides the ability to open an in-app browser and subscribe to browser events.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "32240b675c12a774920c07a86b4483ecec7a9c8d"
|
|
83
83
|
}
|