@cronapp/intent-activity 3.0.0-SP.48 → 3.0.0-SP.50

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.
@@ -1 +1,70 @@
1
- (function(){"use strict";this.cronapi=this.cronapi||{},this.cronapi.intent=this.cronapi.intent||{},this.cronapi.intent.startActivity=async function(action,pack,url,requestCode,waitActivity,extras){let rawJson={action:action,package:pack,url:url,requestCode:requestCode,extras:extras};for(let a in rawJson)rawJson[a]||delete rawJson[a];let callFunction=eval(waitActivity)?"startActivityForResult":"startActivity";return new Promise((a,b)=>{try{window.plugins.intentShim[callFunction](rawJson,b=>a(b),a=>b(a))}catch(a){b(a)}})},this.cronapi.intent.packageExists=async function(a){return new Promise((b,c)=>{try{window.plugins.intentShim.packageExists(a,a=>b(a))}catch(a){c(a)}})}}).bind(window)();
1
+ (function () {
2
+ 'use strict';
3
+
4
+ this.cronapi = this.cronapi || {};
5
+
6
+ /**
7
+ * @categoryName Intent
8
+ */
9
+ this.cronapi.intent = this.cronapi.intent || {};
10
+
11
+ /**
12
+ * @type function
13
+ * @name {{startActivity}}
14
+ * @nameTags startActivity|Iniciar atividade| Intent| Intenção| Iniciar intenção| Atividade| Activity
15
+ * @platform M
16
+ * @returns {ObjectType.Object}
17
+ * @description {{startActivityDescription}}
18
+ *
19
+ */
20
+ this.cronapi.intent.startActivity = async function(/** @type {ObjectType.STRING} @description {{actionTitle}} */ action, /** @type {ObjectType.STRING} @description {{packageTitle}} */ pack, /** @type {ObjectType.STRING} @description {{urlTitle}} */ url, /** @type {ObjectType.LONG} @description {{requestCodeTitle}} */ requestCode, /** @type {ObjectType.BOOLEAN} @description {{waitActivity}} @blockType util_dropdown @keys true|false @values {{yes}}|{{no}} */ waitActivity, /** @type {ObjectType.OBJECT} @description {{extrasTitle}} */ extras) {
21
+ let rawJson = {
22
+ action: action,
23
+ package: pack,
24
+ url: url,
25
+ requestCode: requestCode,
26
+ extras: extras
27
+ };
28
+
29
+ for (let name in rawJson) {
30
+ if (!rawJson[name]) delete rawJson[name];
31
+ }
32
+
33
+ let callFunction = eval(waitActivity) ? "startActivityForResult" : "startActivity";
34
+
35
+ return new Promise((resolve, reject) => {
36
+ try {
37
+ window.plugins.intentShim[callFunction](
38
+ rawJson,
39
+ (r) => resolve(r),
40
+ (e) => reject(e)
41
+ );
42
+ }
43
+ catch (e) {
44
+ reject(e);
45
+ }
46
+ });
47
+ };
48
+
49
+ /**
50
+ * @type function
51
+ * @name {{packageExists}}
52
+ * @nameTags packageExists|Existe pacote| Intent| Intenção
53
+ * @platform M
54
+ * @returns {ObjectType.BOOLEAN}
55
+ * @description {{packageExistsDescription}}
56
+ *
57
+ */
58
+ this.cronapi.intent.packageExists = async function(/** @type {ObjectType.STRING} @description {{packageTitle}} */ pack) {
59
+
60
+ return new Promise((resolve, reject) => {
61
+ try {
62
+ window.plugins.intentShim.packageExists(pack, (exists) => resolve(exists) );
63
+ }
64
+ catch (e) {
65
+ reject(e);
66
+ }
67
+ });
68
+ };
69
+
70
+ }).bind(window)();
package/gulpfile.js CHANGED
@@ -2,18 +2,15 @@ var gulp = require("gulp");
2
2
  var ngAnnotate = require("gulp-ng-annotate-patched");
3
3
  var minify = require("gulp-babel-minify");
4
4
 
5
- gulp.task("minify-js", function() {
6
- return gulp.src(["js/**"]).pipe(ngAnnotate()).pipe(minify({
7
- mangle: {
8
- keepClassName: true
9
- }
10
- })).pipe(gulp.dest("dist/js/"));
5
+ // Minify causa problema na leitura das tags cronapi, usar minify será feito futuramente como melhoria
6
+ gulp.task("copy-js", function() {
7
+ return gulp.src("js/**").pipe(gulp.dest("dist/js/"));
11
8
  });
12
9
 
13
10
  gulp.task("i18n", function() {
14
11
  return gulp.src("i18n/**").pipe(gulp.dest("dist/i18n/"));
15
12
  });
16
13
 
17
- gulp.task('build', gulp.series('minify-js', 'i18n'));
14
+ gulp.task('build', gulp.series('copy-js', 'i18n'));
18
15
 
19
16
  gulp.task('default', gulp.series('build'));
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronapp/intent-activity",
3
- "version": "3.0.0-SP.48",
3
+ "version": "3.0.0-SP.50",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronapp/intent-activity",
3
- "version": "3.0.0-SP.48",
3
+ "version": "3.0.0-SP.50",
4
4
  "description": "Cronapp Intent Activity",
5
5
  "keywords": [
6
6
  "cronapp",