jubo-sdk 1.2.1 → 1.2.2-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/dist/JuboSdk.d.ts CHANGED
@@ -8,6 +8,8 @@ declare class JuboSdk {
8
8
  readonly isApp: boolean;
9
9
  /** 是否是小程序 */
10
10
  readonly isMiniProgram: boolean;
11
+ /** 是否是支付宝小程序 */
12
+ readonly isAlipayMini: boolean;
11
13
  /** 是否是h5 */
12
14
  readonly isH5: boolean;
13
15
  /** 是否是H5内嵌 */
@@ -8,6 +8,8 @@ declare class OldJuboSdk {
8
8
  readonly isApp: boolean;
9
9
  /** 是否是小程序 */
10
10
  readonly isMiniProgram: boolean;
11
+ /** 是否是支付宝小程序 */
12
+ readonly isAlipayMini: boolean;
11
13
  /** 是否是h5 */
12
14
  readonly isH5: boolean;
13
15
  /** 是否是H5内嵌 */
package/dist/index.cjs.js CHANGED
@@ -139,8 +139,9 @@ var global$o =
139
139
  // eslint-disable-next-line no-restricted-globals -- safe
140
140
  check(typeof self == 'object' && self) ||
141
141
  check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
142
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
142
143
  // eslint-disable-next-line no-new-func -- fallback
143
- (function () { return this; })() || commonjsGlobal || Function('return this')();
144
+ (function () { return this; })() || Function('return this')();
144
145
 
145
146
  var global$n = global$o;
146
147
 
@@ -392,10 +393,10 @@ var store$1 = sharedStore;
392
393
  (shared$4.exports = function (key, value) {
393
394
  return store$1[key] || (store$1[key] = value !== undefined ? value : {});
394
395
  })('versions', []).push({
395
- version: '3.33.0',
396
+ version: '3.33.3',
396
397
  mode: 'global',
397
398
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
398
- license: 'https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE',
399
+ license: 'https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE',
399
400
  source: 'https://github.com/zloirock/core-js'
400
401
  });
401
402
 
@@ -710,7 +711,7 @@ if (DESCRIPTORS$7 && !FUNCTION_NAME_EXISTS) {
710
711
  * @Date: 2023-03-20 19:26:34
711
712
  * @Description:
712
713
  * @LastEditors: Lanrri
713
- * @LastEditTime: 2023-06-14 15:55:26
714
+ * @LastEditTime: 2023-10-19 19:27:02
714
715
  */
715
716
  exports.systemTypeEnum = void 0;
716
717
  (function (systemTypeEnum) {
@@ -746,6 +747,10 @@ exports.shellTypeEnum = void 0;
746
747
  shellTypeEnum["wechat"] = "wechat";
747
748
  /** 微信小程序 */
748
749
  shellTypeEnum["wechat-miniprogram"] = "wechat-miniprogram";
750
+ /** 支付宝 */
751
+ shellTypeEnum["alipay"] = "alipay";
752
+ /** 支付宝小程序 */
753
+ shellTypeEnum["alipay-miniprogram"] = "alipay-miniprogram";
749
754
  /** qq */
750
755
  shellTypeEnum["qq"] = "qq";
751
756
  /** uc */
@@ -1565,13 +1570,12 @@ var es_array_iterator = defineIterator$2(Array, 'Array', function (iterated, kin
1565
1570
  }, function () {
1566
1571
  var state = getInternalState$2(this);
1567
1572
  var target = state.target;
1568
- var kind = state.kind;
1569
1573
  var index = state.index++;
1570
1574
  if (!target || index >= target.length) {
1571
1575
  state.target = undefined;
1572
1576
  return createIterResultObject$2(undefined, true);
1573
1577
  }
1574
- switch (kind) {
1578
+ switch (state.kind) {
1575
1579
  case 'keys': return createIterResultObject$2(index, false);
1576
1580
  case 'values': return createIterResultObject$2(target[index], false);
1577
1581
  } return createIterResultObject$2([index, target[index]], false);
@@ -5150,12 +5154,20 @@ var supporterArr = [{
5150
5154
  }];
5151
5155
  var defaultShellArr = [{
5152
5156
  shell: 'wechat-miniprogram',
5153
- shellRegexp: /miniprogram/g,
5157
+ shellRegexp: /(?=.*micromessenger)(?=.*miniprogram)/g,
5154
5158
  shellValueRegexp: /miniprogram\/[\d._]+/g
5155
5159
  }, {
5156
5160
  shell: 'wechat',
5157
5161
  shellRegexp: /micromessenger/g,
5158
5162
  shellValueRegexp: /micromessenger\/[\d._]+/g
5163
+ }, {
5164
+ shell: 'alipay-miniprogram',
5165
+ shellRegexp: /(?=.*aliapp)(?=.*miniprogram)/g,
5166
+ shellValueRegexp: /miniprogram\/[\d._]+/g
5167
+ }, {
5168
+ shell: 'alipay',
5169
+ shellRegexp: /aliapp/g,
5170
+ shellValueRegexp: /aliapp\(AP\/([\d.]+)\)/g
5159
5171
  }, {
5160
5172
  shell: 'qq',
5161
5173
  shellRegexp: /qqbrowser/g,
@@ -5281,10 +5293,10 @@ var browserType = BrowserType({
5281
5293
  }]
5282
5294
  });
5283
5295
 
5284
- var _weixinJsSdk_1_6_2_weixinJsSdk = {exports: {}};
5296
+ var _weixinJsSdk_1_6_5_weixinJsSdk = {exports: {}};
5285
5297
 
5286
5298
  !(function (e, n) {
5287
- _weixinJsSdk_1_6_2_weixinJsSdk.exports = n(e);
5299
+ _weixinJsSdk_1_6_5_weixinJsSdk.exports = n(e);
5288
5300
  })(typeof window === "object" && window, function (r, e) {
5289
5301
  if (!r) {
5290
5302
  console.warn("can't use weixin-js-sdk in server side");
@@ -6175,8 +6187,8 @@ var _weixinJsSdk_1_6_2_weixinJsSdk = {exports: {}};
6175
6187
  }
6176
6188
  });
6177
6189
 
6178
- var _weixinJsSdk_1_6_2_weixinJsSdkExports = _weixinJsSdk_1_6_2_weixinJsSdk.exports;
6179
- var wx$1 = /*@__PURE__*/getDefaultExportFromCjs(_weixinJsSdk_1_6_2_weixinJsSdkExports);
6190
+ var _weixinJsSdk_1_6_5_weixinJsSdkExports = _weixinJsSdk_1_6_5_weixinJsSdk.exports;
6191
+ var wx$1 = /*@__PURE__*/getDefaultExportFromCjs(_weixinJsSdk_1_6_5_weixinJsSdkExports);
6180
6192
 
6181
6193
  var bridge = {
6182
6194
  default:commonjsGlobal,// for typescript
@@ -6343,6 +6355,13 @@ var OldJuboSdk = /** @class */function () {
6343
6355
  writable: true,
6344
6356
  value: false
6345
6357
  });
6358
+ /** 是否是支付宝小程序 */
6359
+ Object.defineProperty(this, "isAlipayMini", {
6360
+ enumerable: true,
6361
+ configurable: true,
6362
+ writable: true,
6363
+ value: false
6364
+ });
6346
6365
  /** 是否是h5 */
6347
6366
  Object.defineProperty(this, "isH5", {
6348
6367
  enumerable: true,
@@ -7112,6 +7131,13 @@ var JuboSdk = /** @class */function () {
7112
7131
  writable: true,
7113
7132
  value: false
7114
7133
  });
7134
+ /** 是否是支付宝小程序 */
7135
+ Object.defineProperty(this, "isAlipayMini", {
7136
+ enumerable: true,
7137
+ configurable: true,
7138
+ writable: true,
7139
+ value: false
7140
+ });
7115
7141
  /** 是否是h5 */
7116
7142
  Object.defineProperty(this, "isH5", {
7117
7143
  enumerable: true,
@@ -7181,10 +7207,11 @@ var JuboSdk = /** @class */function () {
7181
7207
  this.name = options.name;
7182
7208
  this.isApp = browserType.isShell('airmart') || device === 'ios' || device === 'android';
7183
7209
  this.isMiniProgram = browserType.isShell('wechat-miniprogram') || device === 'wx';
7210
+ this.isAlipayMini = browserType.isShell('alipay-miniprogram') || device === 'alipay';
7184
7211
  this.isH5 = device === 'h5';
7185
7212
  this.isIframe = device === 'h5' && window.top !== window.self;
7186
7213
  this.isIos = browserType.system === 'ios' || device === 'ios';
7187
- this.device = this.isMiniProgram ? 'wx' : this.isApp ? browserType.system : device;
7214
+ this.device = device === 'h5' ? 'h5' : this.isAlipayMini ? 'alipay' : this.isMiniProgram ? 'wx' : this.isApp ? browserType.system : device;
7188
7215
  this.isCanShowNav = this.isApp && true;
7189
7216
  this.version = version;
7190
7217
  this.channel = channel;
@@ -7193,6 +7220,12 @@ var JuboSdk = /** @class */function () {
7193
7220
  if (this.isOldApp) {
7194
7221
  return new OldJuboSdk(options);
7195
7222
  }
7223
+ if (this.isAlipayMini) {
7224
+ var script = document.createElement('script');
7225
+ script.type = 'text/javascript';
7226
+ script.src = 'https://appx/web-view.min.js ';
7227
+ document.body.appendChild(script);
7228
+ }
7196
7229
  return this;
7197
7230
  }
7198
7231
  Object.defineProperty(JuboSdk.prototype, "detection", {
@@ -7287,6 +7320,11 @@ var JuboSdk = /** @class */function () {
7287
7320
  url: _this.options.miniProgramLogin || MINI_PROGRAM_LOGIN
7288
7321
  });
7289
7322
  resolve('');
7323
+ } else if (_this.isAlipayMini) {
7324
+ my.navigateTo({
7325
+ url: _this.options.miniProgramLogin || MINI_PROGRAM_LOGIN
7326
+ });
7327
+ resolve('');
7290
7328
  } else {
7291
7329
  dsBridge.call('toLogin', {}, function (res) {
7292
7330
  var resData = JSON.parse(res);
@@ -7387,6 +7425,16 @@ var JuboSdk = /** @class */function () {
7387
7425
  }
7388
7426
  }
7389
7427
  });
7428
+ } else if (this.isAlipayMini) {
7429
+ my.postMessage({
7430
+ data: {
7431
+ shareData: {
7432
+ title: options.title,
7433
+ path: options.webpage,
7434
+ imageUrl: options.thumbImage
7435
+ }
7436
+ }
7437
+ });
7390
7438
  } else {
7391
7439
  dsBridge.call('shareMiniProgram', {
7392
7440
  imgUrl: options.thumbImage,
@@ -7791,6 +7839,6 @@ exports.default = JuboSdk;
7791
7839
  exports.ls = ls;
7792
7840
 
7793
7841
  if(typeof window !== 'undefined') {
7794
- window._juboSDK_VERSION_ = '1.2.1'
7842
+ window._juboSDK_VERSION_ = '1.2.2-beta.2'
7795
7843
  }
7796
7844
  //# sourceMappingURL=index.cjs.js.map