@capacitor/toast 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/toast/Toast.java +9 -12
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.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/package.json +13 -13
package/Package.swift
CHANGED
|
@@ -10,7 +10,7 @@ let package = Package(
|
|
|
10
10
|
targets: ["ToastPlugin"])
|
|
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.toast"
|
|
34
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
33
|
+
namespace = "com.capacitorjs.plugins.toast"
|
|
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
|
|
@@ -19,17 +19,14 @@ public class Toast {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
public static void show(final Context c, final String text, final int duration, final String position) {
|
|
22
|
-
new Handler(Looper.getMainLooper())
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
toast.show();
|
|
32
|
-
}
|
|
33
|
-
);
|
|
22
|
+
new Handler(Looper.getMainLooper()).post(() -> {
|
|
23
|
+
android.widget.Toast toast = android.widget.Toast.makeText(c, text, duration);
|
|
24
|
+
if ("top".equals(position)) {
|
|
25
|
+
toast.setGravity(GRAVITY_TOP, 0, 40);
|
|
26
|
+
} else if ("center".equals(position)) {
|
|
27
|
+
toast.setGravity(GRAVITY_CENTER, 0, 0);
|
|
28
|
+
}
|
|
29
|
+
toast.show();
|
|
30
|
+
});
|
|
34
31
|
}
|
|
35
32
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
2
|
const Toast = registerPlugin('Toast', {
|
|
3
|
-
web: () => import('./web').then(m => new m.ToastWeb()),
|
|
3
|
+
web: () => import('./web').then((m) => new m.ToastWeb()),
|
|
4
4
|
});
|
|
5
5
|
export * from './definitions';
|
|
6
6
|
export { Toast };
|
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,KAAK,GAAG,cAAc,CAAc,OAAO,EAAE;IACjD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,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,KAAK,GAAG,cAAc,CAAc,OAAO,EAAE;IACjD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;CACzD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { ToastPlugin } from './definitions';\n\nconst Toast = registerPlugin<ToastPlugin>('Toast', {\n web: () => import('./web').then((m) => new m.ToastWeb()),\n});\n\nexport * from './definitions';\nexport { Toast };\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;AAI5C,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;YACpC,IAAI,QAAQ,GAAG,IAAI,CAAC;YACpB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACrB,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACvD,CAAC;YACD,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAQ,CAAC;YACzD,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC1B,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YAC7B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ToastPlugin, ShowOptions } from './definitions';\n\nexport class ToastWeb extends WebPlugin implements ToastPlugin {\n async show(options: ShowOptions): Promise<void> {\n if (typeof document !== 'undefined') {\n let duration = 2000;\n if (options.duration) {\n duration = options.duration === 'long' ? 3500 : 2000;\n }\n const toast = document.createElement('pwa-toast') as any;\n toast.duration = duration;\n toast.message = options.text;\n document.body.appendChild(toast);\n }\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var core = require('@capacitor/core');
|
|
4
4
|
|
|
5
5
|
const Toast = core.registerPlugin('Toast', {
|
|
6
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ToastWeb()),
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.ToastWeb()),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
class ToastWeb 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 Toast = registerPlugin('Toast', {\n web: () => import('./web').then(m => new m.ToastWeb()),\n});\nexport * from './definitions';\nexport { Toast };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ToastWeb extends WebPlugin {\n async show(options) {\n if (typeof document !== 'undefined') {\n let duration = 2000;\n if (options.duration) {\n duration = options.duration === 'long' ? 3500 : 2000;\n }\n const toast = document.createElement('pwa-toast');\n toast.duration = duration;\n toast.message = options.text;\n document.body.appendChild(toast);\n }\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;AACtC,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 Toast = registerPlugin('Toast', {\n web: () => import('./web').then((m) => new m.ToastWeb()),\n});\nexport * from './definitions';\nexport { Toast };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ToastWeb extends WebPlugin {\n async show(options) {\n if (typeof document !== 'undefined') {\n let duration = 2000;\n if (options.duration) {\n duration = options.duration === 'long' ? 3500 : 2000;\n }\n const toast = document.createElement('pwa-toast');\n toast.duration = duration;\n toast.message = options.text;\n document.body.appendChild(toast);\n }\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;AACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC5D,CAAC;;ACFM,MAAM,QAAQ,SAASC,cAAS,CAAC;AACxC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;AAC7C,YAAY,IAAI,QAAQ,GAAG,IAAI;AAC/B,YAAY,IAAI,OAAO,CAAC,QAAQ,EAAE;AAClC,gBAAgB,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,MAAM,GAAG,IAAI,GAAG,IAAI;AACpE,YAAY;AACZ,YAAY,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC;AAC7D,YAAY,KAAK,CAAC,QAAQ,GAAG,QAAQ;AACrC,YAAY,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI;AACxC,YAAY,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC5C,QAAQ;AACR,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ var capacitorToast = (function (exports, core) {
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const Toast = core.registerPlugin('Toast', {
|
|
5
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ToastWeb()),
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.ToastWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
class ToastWeb 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 Toast = registerPlugin('Toast', {\n web: () => import('./web').then(m => new m.ToastWeb()),\n});\nexport * from './definitions';\nexport { Toast };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ToastWeb extends WebPlugin {\n async show(options) {\n if (typeof document !== 'undefined') {\n let duration = 2000;\n if (options.duration) {\n duration = options.duration === 'long' ? 3500 : 2000;\n }\n const toast = document.createElement('pwa-toast');\n toast.duration = duration;\n toast.message = options.text;\n document.body.appendChild(toast);\n }\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;IACtC,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 Toast = registerPlugin('Toast', {\n web: () => import('./web').then((m) => new m.ToastWeb()),\n});\nexport * from './definitions';\nexport { Toast };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ToastWeb extends WebPlugin {\n async show(options) {\n if (typeof document !== 'undefined') {\n let duration = 2000;\n if (options.duration) {\n duration = options.duration === 'long' ? 3500 : 2000;\n }\n const toast = document.createElement('pwa-toast');\n toast.duration = duration;\n toast.message = options.text;\n document.body.appendChild(toast);\n }\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;IACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D,CAAC;;ICFM,MAAM,QAAQ,SAASC,cAAS,CAAC;IACxC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;IAC7C,YAAY,IAAI,QAAQ,GAAG,IAAI;IAC/B,YAAY,IAAI,OAAO,CAAC,QAAQ,EAAE;IAClC,gBAAgB,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,MAAM,GAAG,IAAI,GAAG,IAAI;IACpE,YAAY;IACZ,YAAY,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC;IAC7D,YAAY,KAAK,CAAC,QAAQ,GAAG,QAAQ;IACrC,YAAY,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI;IACxC,YAAY,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;IAC5C,QAAQ;IACR,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/toast",
|
|
3
|
-
"version": "8.0.0-
|
|
3
|
+
"version": "8.0.0-beta.0",
|
|
4
4
|
"description": "The Toast API provides a notification pop up for displaying important information to a user. Just like real toast!",
|
|
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 ToastPlugin --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
|
}
|