@capacitor/dialog 1.0.6 → 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 +46 -0
- package/CapacitorDialog.podspec +1 -1
- package/android/build.gradle +10 -11
- package/android/src/main/java/com/capacitorjs/plugins/dialog/Dialog.java +9 -8
- package/android/src/main/java/com/capacitorjs/plugins/dialog/DialogPlugin.java +6 -6
- package/dist/docs.json +3 -3
- package/dist/esm/definitions.d.ts +3 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/ios/Plugin/DialogPlugin.swift +9 -9
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
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
|
+
**Note:** Version bump only for package @capacitor/dialog
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 4.0.0-beta.0 (2022-06-27)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* add es2017 lib to tsconfig ([#180](https://github.com/ionic-team/capacitor-plugins/issues/180)) ([2c3776c](https://github.com/ionic-team/capacitor-plugins/commit/2c3776c38ca025c5ee965dec10ccf1cdb6c02e2f))
|
|
20
|
+
* correct addListeners links ([#655](https://github.com/ionic-team/capacitor-plugins/issues/655)) ([f9871e7](https://github.com/ionic-team/capacitor-plugins/commit/f9871e7bd53478addb21155e148829f550c0e457))
|
|
21
|
+
* inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
|
|
22
|
+
* remove postpublish scripts ([#656](https://github.com/ionic-team/capacitor-plugins/issues/656)) ([ed6ac49](https://github.com/ionic-team/capacitor-plugins/commit/ed6ac499ebf4a47525071ccbfc36c27503e11f60))
|
|
23
|
+
* **dialogs:** put cancel button of confirm/prompt on the left ([#346](https://github.com/ionic-team/capacitor-plugins/issues/346)) ([1ac23db](https://github.com/ionic-team/capacitor-plugins/commit/1ac23db5162fa94742f18f00daf87a62a63f8dca))
|
|
24
|
+
* support deprecated types from Capacitor 2 ([#139](https://github.com/ionic-team/capacitor-plugins/issues/139)) ([2d7127a](https://github.com/ionic-team/capacitor-plugins/commit/2d7127a488e26f0287951921a6db47c49d817336))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* set targetSDK default value to 32 ([#970](https://github.com/ionic-team/capacitor-plugins/issues/970)) ([fa70d96](https://github.com/ionic-team/capacitor-plugins/commit/fa70d96f141af751aae53ceb5642c46b204f5958))
|
|
30
|
+
* **dialog:** Make title optional ([#940](https://github.com/ionic-team/capacitor-plugins/issues/940)) ([497f627](https://github.com/ionic-team/capacitor-plugins/commit/497f6275ee6bc71295403e2cdc5a74b9cc31a310))
|
|
31
|
+
* add commonjs output format ([#179](https://github.com/ionic-team/capacitor-plugins/issues/179)) ([8e9e098](https://github.com/ionic-team/capacitor-plugins/commit/8e9e09862064b3f6771d7facbc4008e995d9b463))
|
|
32
|
+
* Dialog plugin ([#44](https://github.com/ionic-team/capacitor-plugins/issues/44)) ([d7f0dd5](https://github.com/ionic-team/capacitor-plugins/commit/d7f0dd547699734aa44528d01662e6f984668121))
|
|
33
|
+
* set targetSDK default value to 31 ([#824](https://github.com/ionic-team/capacitor-plugins/issues/824)) ([3ee10de](https://github.com/ionic-team/capacitor-plugins/commit/3ee10de98067984c1a4e75295d001c5a895c47f4))
|
|
34
|
+
* Upgrade gradle to 7.4 ([#826](https://github.com/ionic-team/capacitor-plugins/issues/826)) ([5db0906](https://github.com/ionic-team/capacitor-plugins/commit/5db0906f6264287c4f8e69dbaecf19d4d387824b))
|
|
35
|
+
* Use java 11 ([#910](https://github.com/ionic-team/capacitor-plugins/issues/910)) ([5acb2a2](https://github.com/ionic-team/capacitor-plugins/commit/5acb2a288a413492b163e4e97da46a085d9e4be0))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [1.0.7](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/dialog@1.0.6...@capacitor/dialog@1.0.7) (2022-01-19)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
## [1.0.6](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/dialog@1.0.5...@capacitor/dialog@1.0.6) (2021-11-03)
|
|
7
53
|
|
|
8
54
|
**Note:** Version bump only for package @capacitor/dialog
|
package/CapacitorDialog.podspec
CHANGED
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
|
|
13
13
|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}', 'dialog/ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '13.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -11,17 +11,17 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
|
14
|
+
classpath 'com.android.tools.build:gradle:7.2.1'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
apply plugin: 'com.android.library'
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
|
-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
21
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
|
|
22
22
|
defaultConfig {
|
|
23
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
24
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
23
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
24
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
|
|
25
25
|
versionCode 1
|
|
26
26
|
versionName "1.0"
|
|
27
27
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -36,14 +36,13 @@ android {
|
|
|
36
36
|
abortOnError false
|
|
37
37
|
}
|
|
38
38
|
compileOptions {
|
|
39
|
-
sourceCompatibility JavaVersion.
|
|
40
|
-
targetCompatibility JavaVersion.
|
|
39
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
40
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
repositories {
|
|
45
45
|
google()
|
|
46
|
-
jcenter()
|
|
47
46
|
mavenCentral()
|
|
48
47
|
}
|
|
49
48
|
|
|
@@ -40,7 +40,6 @@ public class Dialog {
|
|
|
40
40
|
final String okButtonTitle,
|
|
41
41
|
final Dialog.OnResultListener listener
|
|
42
42
|
) {
|
|
43
|
-
final String alertTitle = title == null ? "Alert" : title;
|
|
44
43
|
final String alertOkButtonTitle = okButtonTitle == null ? "OK" : okButtonTitle;
|
|
45
44
|
|
|
46
45
|
new Handler(Looper.getMainLooper())
|
|
@@ -48,9 +47,11 @@ public class Dialog {
|
|
|
48
47
|
() -> {
|
|
49
48
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
50
49
|
|
|
50
|
+
if (title != null) {
|
|
51
|
+
builder.setTitle(title);
|
|
52
|
+
}
|
|
51
53
|
builder
|
|
52
54
|
.setMessage(message)
|
|
53
|
-
.setTitle(alertTitle)
|
|
54
55
|
.setPositiveButton(
|
|
55
56
|
alertOkButtonTitle,
|
|
56
57
|
(dialog, buttonIndex) -> {
|
|
@@ -84,7 +85,6 @@ public class Dialog {
|
|
|
84
85
|
final String cancelButtonTitle,
|
|
85
86
|
final Dialog.OnResultListener listener
|
|
86
87
|
) {
|
|
87
|
-
final String confirmTitle = title == null ? "Confirm" : title;
|
|
88
88
|
final String confirmOkButtonTitle = okButtonTitle == null ? "OK" : okButtonTitle;
|
|
89
89
|
final String confirmCancelButtonTitle = cancelButtonTitle == null ? "Cancel" : cancelButtonTitle;
|
|
90
90
|
|
|
@@ -92,10 +92,11 @@ public class Dialog {
|
|
|
92
92
|
.post(
|
|
93
93
|
() -> {
|
|
94
94
|
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
95
|
-
|
|
95
|
+
if (title != null) {
|
|
96
|
+
builder.setTitle(title);
|
|
97
|
+
}
|
|
96
98
|
builder
|
|
97
99
|
.setMessage(message)
|
|
98
|
-
.setTitle(confirmTitle)
|
|
99
100
|
.setPositiveButton(
|
|
100
101
|
confirmOkButtonTitle,
|
|
101
102
|
(dialog, buttonIndex) -> {
|
|
@@ -138,7 +139,6 @@ public class Dialog {
|
|
|
138
139
|
final String inputText,
|
|
139
140
|
final Dialog.OnResultListener listener
|
|
140
141
|
) {
|
|
141
|
-
final String promptTitle = title == null ? "Prompt" : title;
|
|
142
142
|
final String promptOkButtonTitle = okButtonTitle == null ? "OK" : okButtonTitle;
|
|
143
143
|
final String promptCancelButtonTitle = cancelButtonTitle == null ? "Cancel" : cancelButtonTitle;
|
|
144
144
|
final String promptInputPlaceholder = inputPlaceholder == null ? "" : inputPlaceholder;
|
|
@@ -152,10 +152,11 @@ public class Dialog {
|
|
|
152
152
|
|
|
153
153
|
input.setHint(promptInputPlaceholder);
|
|
154
154
|
input.setText(promptInputText);
|
|
155
|
-
|
|
155
|
+
if (title != null) {
|
|
156
|
+
builder.setTitle(title);
|
|
157
|
+
}
|
|
156
158
|
builder
|
|
157
159
|
.setMessage(message)
|
|
158
|
-
.setTitle(promptTitle)
|
|
159
160
|
.setView(input)
|
|
160
161
|
.setPositiveButton(
|
|
161
162
|
promptOkButtonTitle,
|
|
@@ -17,8 +17,8 @@ public class DialogPlugin extends Plugin {
|
|
|
17
17
|
final String message = call.getString("message");
|
|
18
18
|
final String buttonTitle = call.getString("buttonTitle", "OK");
|
|
19
19
|
|
|
20
|
-
if (
|
|
21
|
-
call.reject("Please provide a
|
|
20
|
+
if (message == null) {
|
|
21
|
+
call.reject("Please provide a message for the dialog");
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -38,8 +38,8 @@ public class DialogPlugin extends Plugin {
|
|
|
38
38
|
final String okButtonTitle = call.getString("okButtonTitle", "OK");
|
|
39
39
|
final String cancelButtonTitle = call.getString("cancelButtonTitle", "Cancel");
|
|
40
40
|
|
|
41
|
-
if (
|
|
42
|
-
call.reject("Please provide a
|
|
41
|
+
if (message == null) {
|
|
42
|
+
call.reject("Please provide a message for the dialog");
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -72,8 +72,8 @@ public class DialogPlugin extends Plugin {
|
|
|
72
72
|
final String inputPlaceholder = call.getString("inputPlaceholder", "");
|
|
73
73
|
final String inputText = call.getString("inputText", "");
|
|
74
74
|
|
|
75
|
-
if (
|
|
76
|
-
call.reject("Please provide a
|
|
75
|
+
if (message == null) {
|
|
76
|
+
call.reject("Please provide a message for the dialog");
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
|
package/dist/docs.json
CHANGED
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
],
|
|
98
98
|
"docs": "Title of the dialog.",
|
|
99
99
|
"complexTypes": [],
|
|
100
|
-
"type": "string"
|
|
100
|
+
"type": "string | undefined"
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
"name": "message",
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
],
|
|
180
180
|
"docs": "Title of the dialog.",
|
|
181
181
|
"complexTypes": [],
|
|
182
|
-
"type": "string"
|
|
182
|
+
"type": "string | undefined"
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"name": "message",
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
],
|
|
290
290
|
"docs": "Title of the dialog.",
|
|
291
291
|
"complexTypes": [],
|
|
292
|
-
"type": "string"
|
|
292
|
+
"type": "string | undefined"
|
|
293
293
|
},
|
|
294
294
|
{
|
|
295
295
|
"name": "message",
|
|
@@ -4,7 +4,7 @@ export interface AlertOptions {
|
|
|
4
4
|
*
|
|
5
5
|
* @since 1.0.0
|
|
6
6
|
*/
|
|
7
|
-
title
|
|
7
|
+
title?: string;
|
|
8
8
|
/**
|
|
9
9
|
* Message to show on the dialog.
|
|
10
10
|
*
|
|
@@ -25,7 +25,7 @@ export interface PromptOptions {
|
|
|
25
25
|
*
|
|
26
26
|
* @since 1.0.0
|
|
27
27
|
*/
|
|
28
|
-
title
|
|
28
|
+
title?: string;
|
|
29
29
|
/**
|
|
30
30
|
* Message to show on the dialog.
|
|
31
31
|
*
|
|
@@ -65,7 +65,7 @@ export interface ConfirmOptions {
|
|
|
65
65
|
*
|
|
66
66
|
* @since 1.0.0
|
|
67
67
|
*/
|
|
68
|
-
title
|
|
68
|
+
title?: string;
|
|
69
69
|
/**
|
|
70
70
|
* Message to show on the dialog.
|
|
71
71
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface AlertOptions {\n /**\n * Title of the dialog.\n *\n * @since 1.0.0\n */\n title?: string;\n\n /**\n * Message to show on the dialog.\n *\n * @since 1.0.0\n */\n message: string;\n\n /**\n * Text to use on the action button.\n *\n * @default \"OK\"\n * @since 1.0.0\n */\n buttonTitle?: string;\n}\n\nexport interface PromptOptions {\n /**\n * Title of the dialog.\n *\n * @since 1.0.0\n */\n title?: string;\n\n /**\n * Message to show on the dialog.\n *\n * @since 1.0.0\n */\n message: string;\n\n /**\n * Text to use on the positive action button.\n *\n * @default \"OK\"\n * @since 1.0.0\n */\n okButtonTitle?: string;\n\n /**\n * Text to use on the negative action button.\n *\n * @default \"Cancel\"\n * @since 1.0.0\n */\n cancelButtonTitle?: string;\n\n /**\n * Placeholder text for hints.\n *\n * @since 1.0.0\n */\n inputPlaceholder?: string;\n\n /**\n * Prepopulated text.\n *\n * @since 1.0.0\n */\n inputText?: string;\n}\n\nexport interface ConfirmOptions {\n /**\n * Title of the dialog.\n *\n * @since 1.0.0\n */\n title?: string;\n\n /**\n * Message to show on the dialog.\n *\n * @since 1.0.0\n */\n message: string;\n\n /**\n * Text to use on the positive action button.\n *\n * @default \"OK\"\n * @since 1.0.0\n */\n okButtonTitle?: string;\n\n /**\n * Text to use on the negative action button.\n *\n * @default \"Cancel\"\n * @since 1.0.0\n */\n cancelButtonTitle?: string;\n}\n\nexport interface PromptResult {\n /**\n * Text entered on the prompt.\n *\n * @since 1.0.0\n */\n value: string;\n\n /**\n * Whether if the prompt was canceled or accepted.\n *\n * @since 1.0.0\n */\n cancelled: boolean;\n}\n\nexport interface ConfirmResult {\n /**\n * true if the positive button was clicked, false otherwise.\n *\n * @since 1.0.0\n */\n value: boolean;\n}\n\nexport interface DialogPlugin {\n /**\n * Show an alert dialog\n *\n * @since 1.0.0\n */\n alert(options: AlertOptions): Promise<void>;\n\n /**\n * Show a prompt dialog\n *\n * @since 1.0.0\n */\n prompt(options: PromptOptions): Promise<PromptResult>;\n\n /**\n * Show a confirmation dialog\n *\n * @since 1.0.0\n */\n confirm(options: ConfirmOptions): Promise<ConfirmResult>;\n}\n"]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,MAAM,GAAG,cAAc,CAAe,QAAQ,EAAE;IACpD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,MAAM,GAAG,cAAc,CAAe,QAAQ,EAAE;IACpD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { DialogPlugin } from './definitions';\n\nconst Dialog = registerPlugin<DialogPlugin>('Dialog', {\n web: () => import('./web').then(m => new m.DialogWeb()),\n});\n\nexport * from './definitions';\nexport { Dialog };\n"]}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IACtC,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAsB;QACjC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;QACpE,OAAO;YACL,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YAC9B,SAAS,EAAE,GAAG,KAAK,IAAI;SACxB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO;YACL,KAAK,EAAE,GAAG;SACX,CAAC;IACJ,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IACtC,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAsB;QACjC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;QACpE,OAAO;YACL,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YAC9B,SAAS,EAAE,GAAG,KAAK,IAAI;SACxB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO;YACL,KAAK,EAAE,GAAG;SACX,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n DialogPlugin,\n AlertOptions,\n PromptOptions,\n PromptResult,\n ConfirmOptions,\n ConfirmResult,\n} from './definitions';\n\nexport class DialogWeb extends WebPlugin implements DialogPlugin {\n async alert(options: AlertOptions): Promise<void> {\n window.alert(options.message);\n }\n\n async prompt(options: PromptOptions): Promise<PromptResult> {\n const val = window.prompt(options.message, options.inputText || '');\n return {\n value: val !== null ? val : '',\n cancelled: val === null,\n };\n }\n\n async confirm(options: ConfirmOptions): Promise<ConfirmResult> {\n const val = window.confirm(options.message);\n return {\n value: val,\n };\n }\n}\n"]}
|
|
@@ -8,11 +8,11 @@ import Capacitor
|
|
|
8
8
|
public class DialogPlugin: CAPPlugin {
|
|
9
9
|
|
|
10
10
|
@objc public func alert(_ call: CAPPluginCall) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
let title = call.options["title"] as? String
|
|
12
|
+
guard let message = call.options["message"] as? String else {
|
|
13
|
+
call.reject("Please provide a message for the dialog")
|
|
13
14
|
return
|
|
14
15
|
}
|
|
15
|
-
let message = call.options["message"] as? String
|
|
16
16
|
let buttonTitle = call.options["buttonTitle"] as? String ?? "OK"
|
|
17
17
|
|
|
18
18
|
DispatchQueue.main.async { [weak self] in
|
|
@@ -25,11 +25,11 @@ public class DialogPlugin: CAPPlugin {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
@objc public func confirm(_ call: CAPPluginCall) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
let title = call.options["title"] as? String
|
|
29
|
+
guard let message = call.options["message"] as? String else {
|
|
30
|
+
call.reject("Please provide a message for the dialog")
|
|
30
31
|
return
|
|
31
32
|
}
|
|
32
|
-
let message = call.options["message"] as? String ?? ""
|
|
33
33
|
let okButtonTitle = call.options["okButtonTitle"] as? String ?? "OK"
|
|
34
34
|
let cancelButtonTitle = call.options["cancelButtonTitle"] as? String ?? "Cancel"
|
|
35
35
|
|
|
@@ -50,11 +50,11 @@ public class DialogPlugin: CAPPlugin {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
@objc public func prompt (_ call: CAPPluginCall) {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
let title = call.options["title"] as? String
|
|
54
|
+
guard let message = call.options["message"] as? String else {
|
|
55
|
+
call.reject("Please provide a message for the dialog")
|
|
55
56
|
return
|
|
56
57
|
}
|
|
57
|
-
let message = call.options["message"] as? String ?? ""
|
|
58
58
|
let okButtonTitle = call.options["okButtonTitle"] as? String ?? "OK"
|
|
59
59
|
let cancelButtonTitle = call.options["cancelButtonTitle"] as? String ?? "Cancel"
|
|
60
60
|
let inputPlaceholder = call.options["inputPlaceholder"] as? String ?? ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/dialog",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
4
4
|
"description": "The Dialog API provides methods for triggering native dialog windows for alerts, confirmations, and input prompts",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
31
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
32
|
-
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..",
|
|
32
|
+
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
|
|
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",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"publish:cocoapod": "pod trunk push ./CapacitorDialog.podspec --allow-warnings"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@capacitor/android": "
|
|
49
|
-
"@capacitor/core": "
|
|
48
|
+
"@capacitor/android": "next",
|
|
49
|
+
"@capacitor/core": "next",
|
|
50
50
|
"@capacitor/docgen": "0.0.18",
|
|
51
|
-
"@capacitor/ios": "
|
|
51
|
+
"@capacitor/ios": "next",
|
|
52
52
|
"@ionic/eslint-config": "^0.3.0",
|
|
53
53
|
"@ionic/prettier-config": "~1.0.1",
|
|
54
54
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"typescript": "~4.1.5"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@capacitor/core": "
|
|
64
|
+
"@capacitor/core": "next"
|
|
65
65
|
},
|
|
66
66
|
"prettier": "@ionic/prettier-config",
|
|
67
67
|
"swiftlint": "@ionic/swiftlint-config",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "32240b675c12a774920c07a86b4483ecec7a9c8d"
|
|
83
83
|
}
|