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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './types';
2
2
  export * from './channelMessage';
3
3
  import ls from '@/utils/storage';
4
- import JuboSdk from './JuboSdk';
5
4
  export { ls };
6
- export default JuboSdk;
5
+ declare const _default: any;
6
+ export default _default;
package/dist/index.esm.js CHANGED
@@ -135,8 +135,9 @@ var global$o =
135
135
  // eslint-disable-next-line no-restricted-globals -- safe
136
136
  check(typeof self == 'object' && self) ||
137
137
  check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
138
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
138
139
  // eslint-disable-next-line no-new-func -- fallback
139
- (function () { return this; })() || commonjsGlobal || Function('return this')();
140
+ (function () { return this; })() || Function('return this')();
140
141
 
141
142
  var global$n = global$o;
142
143
 
@@ -388,10 +389,10 @@ var store$1 = sharedStore;
388
389
  (shared$4.exports = function (key, value) {
389
390
  return store$1[key] || (store$1[key] = value !== undefined ? value : {});
390
391
  })('versions', []).push({
391
- version: '3.33.0',
392
+ version: '3.33.3',
392
393
  mode: 'global',
393
394
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
394
- license: 'https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE',
395
+ license: 'https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE',
395
396
  source: 'https://github.com/zloirock/core-js'
396
397
  });
397
398
 
@@ -706,7 +707,7 @@ if (DESCRIPTORS$7 && !FUNCTION_NAME_EXISTS) {
706
707
  * @Date: 2023-03-20 19:26:34
707
708
  * @Description:
708
709
  * @LastEditors: Lanrri
709
- * @LastEditTime: 2023-06-14 15:55:26
710
+ * @LastEditTime: 2023-10-19 19:27:02
710
711
  */
711
712
  var systemTypeEnum;
712
713
  (function (systemTypeEnum) {
@@ -742,6 +743,10 @@ var shellTypeEnum;
742
743
  shellTypeEnum["wechat"] = "wechat";
743
744
  /** 微信小程序 */
744
745
  shellTypeEnum["wechat-miniprogram"] = "wechat-miniprogram";
746
+ /** 支付宝 */
747
+ shellTypeEnum["alipay"] = "alipay";
748
+ /** 支付宝小程序 */
749
+ shellTypeEnum["alipay-miniprogram"] = "alipay-miniprogram";
745
750
  /** qq */
746
751
  shellTypeEnum["qq"] = "qq";
747
752
  /** uc */
@@ -1561,13 +1566,12 @@ var es_array_iterator = defineIterator$2(Array, 'Array', function (iterated, kin
1561
1566
  }, function () {
1562
1567
  var state = getInternalState$2(this);
1563
1568
  var target = state.target;
1564
- var kind = state.kind;
1565
1569
  var index = state.index++;
1566
1570
  if (!target || index >= target.length) {
1567
1571
  state.target = undefined;
1568
1572
  return createIterResultObject$2(undefined, true);
1569
1573
  }
1570
- switch (kind) {
1574
+ switch (state.kind) {
1571
1575
  case 'keys': return createIterResultObject$2(index, false);
1572
1576
  case 'values': return createIterResultObject$2(target[index], false);
1573
1577
  } return createIterResultObject$2([index, target[index]], false);
@@ -5146,12 +5150,20 @@ var supporterArr = [{
5146
5150
  }];
5147
5151
  var defaultShellArr = [{
5148
5152
  shell: 'wechat-miniprogram',
5149
- shellRegexp: /miniprogram/g,
5153
+ shellRegexp: /(?=.*micromessenger)(?=.*miniprogram)/g,
5150
5154
  shellValueRegexp: /miniprogram\/[\d._]+/g
5151
5155
  }, {
5152
5156
  shell: 'wechat',
5153
5157
  shellRegexp: /micromessenger/g,
5154
5158
  shellValueRegexp: /micromessenger\/[\d._]+/g
5159
+ }, {
5160
+ shell: 'alipay-miniprogram',
5161
+ shellRegexp: /(?=.*aliapp)(?=.*miniprogram)/g,
5162
+ shellValueRegexp: /miniprogram\/[\d._]+/g
5163
+ }, {
5164
+ shell: 'alipay',
5165
+ shellRegexp: /aliapp/g,
5166
+ shellValueRegexp: /aliapp\(AP\/([\d.]+)\)/g
5155
5167
  }, {
5156
5168
  shell: 'qq',
5157
5169
  shellRegexp: /qqbrowser/g,
@@ -5277,10 +5289,10 @@ var browserType = BrowserType({
5277
5289
  }]
5278
5290
  });
5279
5291
 
5280
- var _weixinJsSdk_1_6_2_weixinJsSdk = {exports: {}};
5292
+ var _weixinJsSdk_1_6_5_weixinJsSdk = {exports: {}};
5281
5293
 
5282
5294
  !(function (e, n) {
5283
- _weixinJsSdk_1_6_2_weixinJsSdk.exports = n(e);
5295
+ _weixinJsSdk_1_6_5_weixinJsSdk.exports = n(e);
5284
5296
  })(typeof window === "object" && window, function (r, e) {
5285
5297
  if (!r) {
5286
5298
  console.warn("can't use weixin-js-sdk in server side");
@@ -6171,8 +6183,8 @@ var _weixinJsSdk_1_6_2_weixinJsSdk = {exports: {}};
6171
6183
  }
6172
6184
  });
6173
6185
 
6174
- var _weixinJsSdk_1_6_2_weixinJsSdkExports = _weixinJsSdk_1_6_2_weixinJsSdk.exports;
6175
- var wx$1 = /*@__PURE__*/getDefaultExportFromCjs(_weixinJsSdk_1_6_2_weixinJsSdkExports);
6186
+ var _weixinJsSdk_1_6_5_weixinJsSdkExports = _weixinJsSdk_1_6_5_weixinJsSdk.exports;
6187
+ var wx$1 = /*@__PURE__*/getDefaultExportFromCjs(_weixinJsSdk_1_6_5_weixinJsSdkExports);
6176
6188
 
6177
6189
  var bridge = {
6178
6190
  default:commonjsGlobal,// for typescript
@@ -6339,6 +6351,13 @@ var OldJuboSdk = /** @class */function () {
6339
6351
  writable: true,
6340
6352
  value: false
6341
6353
  });
6354
+ /** 是否是支付宝小程序 */
6355
+ Object.defineProperty(this, "isAlipayMini", {
6356
+ enumerable: true,
6357
+ configurable: true,
6358
+ writable: true,
6359
+ value: false
6360
+ });
6342
6361
  /** 是否是h5 */
6343
6362
  Object.defineProperty(this, "isH5", {
6344
6363
  enumerable: true,
@@ -7108,6 +7127,13 @@ var JuboSdk = /** @class */function () {
7108
7127
  writable: true,
7109
7128
  value: false
7110
7129
  });
7130
+ /** 是否是支付宝小程序 */
7131
+ Object.defineProperty(this, "isAlipayMini", {
7132
+ enumerable: true,
7133
+ configurable: true,
7134
+ writable: true,
7135
+ value: false
7136
+ });
7111
7137
  /** 是否是h5 */
7112
7138
  Object.defineProperty(this, "isH5", {
7113
7139
  enumerable: true,
@@ -7177,10 +7203,11 @@ var JuboSdk = /** @class */function () {
7177
7203
  this.name = options.name;
7178
7204
  this.isApp = browserType.isShell('airmart') || device === 'ios' || device === 'android';
7179
7205
  this.isMiniProgram = browserType.isShell('wechat-miniprogram') || device === 'wx';
7206
+ this.isAlipayMini = browserType.isShell('alipay-miniprogram') || device === 'alipay';
7180
7207
  this.isH5 = device === 'h5';
7181
7208
  this.isIframe = device === 'h5' && window.top !== window.self;
7182
7209
  this.isIos = browserType.system === 'ios' || device === 'ios';
7183
- this.device = this.isMiniProgram ? 'wx' : this.isApp ? browserType.system : device;
7210
+ this.device = device === 'h5' ? 'h5' : this.isAlipayMini ? 'alipay' : this.isMiniProgram ? 'wx' : this.isApp ? browserType.system : device;
7184
7211
  this.isCanShowNav = this.isApp && true;
7185
7212
  this.version = version;
7186
7213
  this.channel = channel;
@@ -7189,6 +7216,12 @@ var JuboSdk = /** @class */function () {
7189
7216
  if (this.isOldApp) {
7190
7217
  return new OldJuboSdk(options);
7191
7218
  }
7219
+ if (this.isAlipayMini) {
7220
+ var script = document.createElement('script');
7221
+ script.type = 'text/javascript';
7222
+ script.src = 'https://appx/web-view.min.js ';
7223
+ document.body.appendChild(script);
7224
+ }
7192
7225
  return this;
7193
7226
  }
7194
7227
  Object.defineProperty(JuboSdk.prototype, "detection", {
@@ -7283,6 +7316,11 @@ var JuboSdk = /** @class */function () {
7283
7316
  url: _this.options.miniProgramLogin || MINI_PROGRAM_LOGIN
7284
7317
  });
7285
7318
  resolve('');
7319
+ } else if (_this.isAlipayMini) {
7320
+ my.navigateTo({
7321
+ url: _this.options.miniProgramLogin || MINI_PROGRAM_LOGIN
7322
+ });
7323
+ resolve('');
7286
7324
  } else {
7287
7325
  dsBridge.call('toLogin', {}, function (res) {
7288
7326
  var resData = JSON.parse(res);
@@ -7383,6 +7421,16 @@ var JuboSdk = /** @class */function () {
7383
7421
  }
7384
7422
  }
7385
7423
  });
7424
+ } else if (this.isAlipayMini) {
7425
+ my.postMessage({
7426
+ data: {
7427
+ shareData: {
7428
+ title: options.title,
7429
+ path: options.webpage,
7430
+ imageUrl: options.thumbImage
7431
+ }
7432
+ }
7433
+ });
7386
7434
  } else {
7387
7435
  dsBridge.call('shareMiniProgram', {
7388
7436
  imgUrl: options.thumbImage,
@@ -7784,6 +7832,6 @@ if (process.env.NODE_ENV === 'development') {
7784
7832
  export { AppNameEnum, ChannelClient, ChannelParent, JuboSdk as default, ls, shellTypeEnum, supporterTypeEnum, systemTypeEnum };
7785
7833
 
7786
7834
  if(typeof window !== 'undefined') {
7787
- window._juboSDK_VERSION_ = '1.2.1'
7835
+ window._juboSDK_VERSION_ = '1.2.2-beta.2'
7788
7836
  }
7789
7837
  //# sourceMappingURL=index.esm.js.map