@capacitor/dialog 8.0.0-alpha.1 → 8.0.0-beta.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/Package.swift +1 -1
- package/android/build.gradle +8 -8
- package/android/src/main/java/com/capacitorjs/plugins/dialog/Dialog.java +76 -106
- package/android/src/main/java/com/capacitorjs/plugins/dialog/DialogPlugin.java +5 -12
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/DialogPlugin/DialogPlugin.swift +5 -5
- package/package.json +13 -13
package/Package.swift
CHANGED
|
@@ -10,7 +10,7 @@ let package = Package(
|
|
|
10
10
|
targets: ["DialogPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0-beta")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/android/build.gradle
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
capacitorVersion = System.getenv('CAPACITOR_VERSION')
|
|
3
3
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
4
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.
|
|
5
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.
|
|
6
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
4
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
5
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
6
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
@@ -11,11 +11,11 @@ buildscript {
|
|
|
11
11
|
google()
|
|
12
12
|
mavenCentral()
|
|
13
13
|
maven {
|
|
14
|
-
url "https://plugins.gradle.org/m2/"
|
|
14
|
+
url = "https://plugins.gradle.org/m2/"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
dependencies {
|
|
18
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
18
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
19
19
|
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
20
20
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
21
21
|
}
|
|
@@ -30,8 +30,8 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
android {
|
|
33
|
-
namespace "com.capacitorjs.plugins.dialog"
|
|
34
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
33
|
+
namespace = "com.capacitorjs.plugins.dialog"
|
|
34
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
35
35
|
defaultConfig {
|
|
36
36
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
37
37
|
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
@@ -46,7 +46,7 @@ android {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
lintOptions {
|
|
49
|
-
abortOnError false
|
|
49
|
+
abortOnError = false
|
|
50
50
|
}
|
|
51
51
|
compileOptions {
|
|
52
52
|
sourceCompatibility JavaVersion.VERSION_21
|
|
@@ -42,35 +42,27 @@ public class Dialog {
|
|
|
42
42
|
) {
|
|
43
43
|
final String alertOkButtonTitle = okButtonTitle == null ? "OK" : okButtonTitle;
|
|
44
44
|
|
|
45
|
-
new Handler(Looper.getMainLooper())
|
|
46
|
-
.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
AlertDialog dialog = builder.create();
|
|
70
|
-
|
|
71
|
-
dialog.show();
|
|
72
|
-
}
|
|
73
|
-
);
|
|
45
|
+
new Handler(Looper.getMainLooper()).post(() -> {
|
|
46
|
+
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
47
|
+
|
|
48
|
+
if (title != null) {
|
|
49
|
+
builder.setTitle(title);
|
|
50
|
+
}
|
|
51
|
+
builder
|
|
52
|
+
.setMessage(message)
|
|
53
|
+
.setPositiveButton(alertOkButtonTitle, (dialog, buttonIndex) -> {
|
|
54
|
+
dialog.dismiss();
|
|
55
|
+
listener.onResult(true, false, null);
|
|
56
|
+
})
|
|
57
|
+
.setOnCancelListener((dialog) -> {
|
|
58
|
+
dialog.dismiss();
|
|
59
|
+
listener.onResult(false, true, null);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
AlertDialog dialog = builder.create();
|
|
63
|
+
|
|
64
|
+
dialog.show();
|
|
65
|
+
});
|
|
74
66
|
}
|
|
75
67
|
|
|
76
68
|
public static void confirm(final Context context, final String message, final Dialog.OnResultListener listener) {
|
|
@@ -88,41 +80,30 @@ public class Dialog {
|
|
|
88
80
|
final String confirmOkButtonTitle = okButtonTitle == null ? "OK" : okButtonTitle;
|
|
89
81
|
final String confirmCancelButtonTitle = cancelButtonTitle == null ? "Cancel" : cancelButtonTitle;
|
|
90
82
|
|
|
91
|
-
new Handler(Looper.getMainLooper())
|
|
92
|
-
.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
dialog -> {
|
|
116
|
-
dialog.dismiss();
|
|
117
|
-
listener.onResult(false, true, null);
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
AlertDialog dialog = builder.create();
|
|
122
|
-
|
|
123
|
-
dialog.show();
|
|
124
|
-
}
|
|
125
|
-
);
|
|
83
|
+
new Handler(Looper.getMainLooper()).post(() -> {
|
|
84
|
+
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
85
|
+
if (title != null) {
|
|
86
|
+
builder.setTitle(title);
|
|
87
|
+
}
|
|
88
|
+
builder
|
|
89
|
+
.setMessage(message)
|
|
90
|
+
.setPositiveButton(confirmOkButtonTitle, (dialog, buttonIndex) -> {
|
|
91
|
+
dialog.dismiss();
|
|
92
|
+
listener.onResult(true, false, null);
|
|
93
|
+
})
|
|
94
|
+
.setNegativeButton(confirmCancelButtonTitle, (dialog, buttonIndex) -> {
|
|
95
|
+
dialog.dismiss();
|
|
96
|
+
listener.onResult(false, false, null);
|
|
97
|
+
})
|
|
98
|
+
.setOnCancelListener((dialog) -> {
|
|
99
|
+
dialog.dismiss();
|
|
100
|
+
listener.onResult(false, true, null);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
AlertDialog dialog = builder.create();
|
|
104
|
+
|
|
105
|
+
dialog.show();
|
|
106
|
+
});
|
|
126
107
|
}
|
|
127
108
|
|
|
128
109
|
public static void prompt(final Context context, final String message, final Dialog.OnResultListener listener) {
|
|
@@ -144,47 +125,36 @@ public class Dialog {
|
|
|
144
125
|
final String promptInputPlaceholder = inputPlaceholder == null ? "" : inputPlaceholder;
|
|
145
126
|
final String promptInputText = inputText == null ? "" : inputText;
|
|
146
127
|
|
|
147
|
-
new Handler(Looper.getMainLooper())
|
|
148
|
-
.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
dialog -> {
|
|
179
|
-
dialog.dismiss();
|
|
180
|
-
listener.onResult(false, true, null);
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
|
|
184
|
-
AlertDialog dialog = builder.create();
|
|
185
|
-
|
|
186
|
-
dialog.show();
|
|
187
|
-
}
|
|
188
|
-
);
|
|
128
|
+
new Handler(Looper.getMainLooper()).post(() -> {
|
|
129
|
+
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
130
|
+
final EditText input = new EditText(context);
|
|
131
|
+
|
|
132
|
+
input.setHint(promptInputPlaceholder);
|
|
133
|
+
input.setText(promptInputText);
|
|
134
|
+
if (title != null) {
|
|
135
|
+
builder.setTitle(title);
|
|
136
|
+
}
|
|
137
|
+
builder
|
|
138
|
+
.setMessage(message)
|
|
139
|
+
.setView(input)
|
|
140
|
+
.setPositiveButton(promptOkButtonTitle, (dialog, buttonIndex) -> {
|
|
141
|
+
dialog.dismiss();
|
|
142
|
+
|
|
143
|
+
String inputText1 = input.getText().toString().trim();
|
|
144
|
+
listener.onResult(true, false, inputText1);
|
|
145
|
+
})
|
|
146
|
+
.setNegativeButton(promptCancelButtonTitle, (dialog, buttonIndex) -> {
|
|
147
|
+
dialog.dismiss();
|
|
148
|
+
listener.onResult(false, true, null);
|
|
149
|
+
})
|
|
150
|
+
.setOnCancelListener((dialog) -> {
|
|
151
|
+
dialog.dismiss();
|
|
152
|
+
listener.onResult(false, true, null);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
AlertDialog dialog = builder.create();
|
|
156
|
+
|
|
157
|
+
dialog.show();
|
|
158
|
+
});
|
|
189
159
|
}
|
|
190
160
|
}
|
|
@@ -48,18 +48,11 @@ public class DialogPlugin extends Plugin {
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
Dialog.confirm(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
cancelButtonTitle,
|
|
57
|
-
(value, didCancel, inputValue) -> {
|
|
58
|
-
JSObject ret = new JSObject();
|
|
59
|
-
ret.put("value", value);
|
|
60
|
-
call.resolve(ret);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
51
|
+
Dialog.confirm(activity, message, title, okButtonTitle, cancelButtonTitle, (value, didCancel, inputValue) -> {
|
|
52
|
+
JSObject ret = new JSObject();
|
|
53
|
+
ret.put("value", value);
|
|
54
|
+
call.resolve(ret);
|
|
55
|
+
});
|
|
63
56
|
}
|
|
64
57
|
|
|
65
58
|
@PluginMethod
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
2
|
const Dialog = registerPlugin('Dialog', {
|
|
3
|
-
web: () => import('./web').then(m => new m.DialogWeb()),
|
|
3
|
+
web: () => import('./web').then((m) => new m.DialogWeb()),
|
|
4
4
|
});
|
|
5
5
|
export * from './definitions';
|
|
6
6
|
export { Dialog };
|
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;
|
|
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,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;CAC1D,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/plugin.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var core = require('@capacitor/core');
|
|
4
4
|
|
|
5
5
|
const Dialog = core.registerPlugin('Dialog', {
|
|
6
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.DialogWeb()),
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.DialogWeb()),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
class DialogWeb extends core.WebPlugin {
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Dialog = registerPlugin('Dialog', {\n web: () => import('./web').then(m => new m.DialogWeb()),\n});\nexport * from './definitions';\nexport { Dialog };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class DialogWeb extends WebPlugin {\n async alert(options) {\n window.alert(options.message);\n }\n async prompt(options) {\n const val = window.prompt(options.message, options.inputText || '');\n return {\n value: val !== null ? val : '',\n cancelled: val === null,\n };\n }\n async confirm(options) {\n const val = window.confirm(options.message);\n return {\n value: val,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Dialog = registerPlugin('Dialog', {\n web: () => import('./web').then((m) => new m.DialogWeb()),\n});\nexport * from './definitions';\nexport { Dialog };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class DialogWeb extends WebPlugin {\n async alert(options) {\n window.alert(options.message);\n }\n async prompt(options) {\n const val = window.prompt(options.message, options.inputText || '');\n return {\n value: val !== null ? val : '',\n cancelled: val === null,\n };\n }\n async confirm(options) {\n const val = window.confirm(options.message);\n return {\n value: val,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAC7D,CAAC;;ACFM,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;AACzB,QAAQ,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;AACrC,IAAI;AACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;AAC3E,QAAQ,OAAO;AACf,YAAY,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,GAAG,EAAE;AAC1C,YAAY,SAAS,EAAE,GAAG,KAAK,IAAI;AACnC,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE;AAC3B,QAAQ,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;AACnD,QAAQ,OAAO;AACf,YAAY,KAAK,EAAE,GAAG;AACtB,SAAS;AACT,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ var capacitorDialog = (function (exports, core) {
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const Dialog = core.registerPlugin('Dialog', {
|
|
5
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.DialogWeb()),
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.DialogWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
class DialogWeb extends core.WebPlugin {
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Dialog = registerPlugin('Dialog', {\n web: () => import('./web').then(m => new m.DialogWeb()),\n});\nexport * from './definitions';\nexport { Dialog };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class DialogWeb extends WebPlugin {\n async alert(options) {\n window.alert(options.message);\n }\n async prompt(options) {\n const val = window.prompt(options.message, options.inputText || '');\n return {\n value: val !== null ? val : '',\n cancelled: val === null,\n };\n }\n async confirm(options) {\n const val = window.confirm(options.message);\n return {\n value: val,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Dialog = registerPlugin('Dialog', {\n web: () => import('./web').then((m) => new m.DialogWeb()),\n});\nexport * from './definitions';\nexport { Dialog };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class DialogWeb extends WebPlugin {\n async alert(options) {\n window.alert(options.message);\n }\n async prompt(options) {\n const val = window.prompt(options.message, options.inputText || '');\n return {\n value: val !== null ? val : '',\n cancelled: val === null,\n };\n }\n async confirm(options) {\n const val = window.confirm(options.message);\n return {\n value: val,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC7D,CAAC;;ICFM,MAAM,SAAS,SAASC,cAAS,CAAC;IACzC,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;IACzB,QAAQ,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;IACrC,IAAI;IACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;IAC1B,QAAQ,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IAC3E,QAAQ,OAAO;IACf,YAAY,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,GAAG,EAAE;IAC1C,YAAY,SAAS,EAAE,GAAG,KAAK,IAAI;IACnC,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE;IAC3B,QAAQ,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;IACnD,QAAQ,OAAO;IACf,YAAY,KAAK,EAAE,GAAG;IACtB,SAAS;IACT,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -24,7 +24,7 @@ public class DialogPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
24
24
|
|
|
25
25
|
DispatchQueue.main.async { [weak self] in
|
|
26
26
|
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert)
|
|
27
|
-
alert.addAction(UIAlertAction(title: buttonTitle, style: UIAlertAction.Style.default, handler: { (_)
|
|
27
|
+
alert.addAction(UIAlertAction(title: buttonTitle, style: UIAlertAction.Style.default, handler: { (_) in
|
|
28
28
|
call.resolve()
|
|
29
29
|
}))
|
|
30
30
|
self?.bridge?.viewController?.present(alert, animated: true, completion: nil)
|
|
@@ -42,12 +42,12 @@ public class DialogPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
42
42
|
|
|
43
43
|
DispatchQueue.main.async { [weak self] in
|
|
44
44
|
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert)
|
|
45
|
-
alert.addAction(UIAlertAction(title: cancelButtonTitle, style: UIAlertAction.Style.default, handler: { (_)
|
|
45
|
+
alert.addAction(UIAlertAction(title: cancelButtonTitle, style: UIAlertAction.Style.default, handler: { (_) in
|
|
46
46
|
call.resolve([
|
|
47
47
|
"value": false
|
|
48
48
|
])
|
|
49
49
|
}))
|
|
50
|
-
alert.addAction(UIAlertAction(title: okButtonTitle, style: UIAlertAction.Style.default, handler: { (_)
|
|
50
|
+
alert.addAction(UIAlertAction(title: okButtonTitle, style: UIAlertAction.Style.default, handler: { (_) in
|
|
51
51
|
call.resolve([
|
|
52
52
|
"value": true
|
|
53
53
|
])
|
|
@@ -75,13 +75,13 @@ public class DialogPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
75
75
|
textField.text = inputText
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
alert.addAction(UIAlertAction(title: cancelButtonTitle, style: UIAlertAction.Style.default, handler: { (_)
|
|
78
|
+
alert.addAction(UIAlertAction(title: cancelButtonTitle, style: UIAlertAction.Style.default, handler: { (_) in
|
|
79
79
|
call.resolve([
|
|
80
80
|
"value": "",
|
|
81
81
|
"cancelled": true
|
|
82
82
|
])
|
|
83
83
|
}))
|
|
84
|
-
alert.addAction(UIAlertAction(title: okButtonTitle, style: UIAlertAction.Style.default, handler: { (_)
|
|
84
|
+
alert.addAction(UIAlertAction(title: okButtonTitle, style: UIAlertAction.Style.default, handler: { (_) in
|
|
85
85
|
let textField = alert.textFields?[0]
|
|
86
86
|
call.resolve([
|
|
87
87
|
"value": textField?.text ?? "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/dialog",
|
|
3
|
-
"version": "8.0.0-
|
|
3
|
+
"version": "8.0.0-beta.0",
|
|
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",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
38
38
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
39
39
|
"eslint": "eslint . --ext ts",
|
|
40
|
-
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
40
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api DialogPlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
43
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@capacitor/android": "next",
|
|
51
51
|
"@capacitor/core": "next",
|
|
52
|
-
"@capacitor/docgen": "0.
|
|
52
|
+
"@capacitor/docgen": "0.3.0",
|
|
53
53
|
"@capacitor/ios": "next",
|
|
54
54
|
"@ionic/eslint-config": "^0.4.0",
|
|
55
|
-
"@ionic/prettier-config": "
|
|
56
|
-
"@ionic/swiftlint-config": "^
|
|
57
|
-
"eslint": "^8.57.
|
|
58
|
-
"prettier": "
|
|
59
|
-
"prettier-plugin-java": "
|
|
60
|
-
"rimraf": "^6.0
|
|
61
|
-
"rollup": "^4.
|
|
62
|
-
"swiftlint": "^
|
|
63
|
-
"typescript": "
|
|
55
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
56
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
57
|
+
"eslint": "^8.57.1",
|
|
58
|
+
"prettier": "^3.6.2",
|
|
59
|
+
"prettier-plugin-java": "^2.7.7",
|
|
60
|
+
"rimraf": "^6.1.0",
|
|
61
|
+
"rollup": "^4.53.2",
|
|
62
|
+
"swiftlint": "^2.0.0",
|
|
63
|
+
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@capacitor/core": "next"
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "06921fb53dc712720523c13836a92ba371054dcb"
|
|
85
85
|
}
|