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 +2 -0
- package/dist/OldJuboSdk.d.ts +2 -0
- package/dist/index.cjs.js +61 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +61 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +61 -13
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/types/browserType.d.ts +4 -0
- package/dist/utils/browserType.d.ts +4 -4
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -141,8 +141,9 @@
|
|
|
141
141
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
142
142
|
check(typeof self == 'object' && self) ||
|
|
143
143
|
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
144
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
144
145
|
// eslint-disable-next-line no-new-func -- fallback
|
|
145
|
-
(function () { return this; })() ||
|
|
146
|
+
(function () { return this; })() || Function('return this')();
|
|
146
147
|
|
|
147
148
|
var global$n = global$o;
|
|
148
149
|
|
|
@@ -394,10 +395,10 @@
|
|
|
394
395
|
(shared$4.exports = function (key, value) {
|
|
395
396
|
return store$1[key] || (store$1[key] = value !== undefined ? value : {});
|
|
396
397
|
})('versions', []).push({
|
|
397
|
-
version: '3.33.
|
|
398
|
+
version: '3.33.3',
|
|
398
399
|
mode: 'global',
|
|
399
400
|
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
400
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.33.
|
|
401
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE',
|
|
401
402
|
source: 'https://github.com/zloirock/core-js'
|
|
402
403
|
});
|
|
403
404
|
|
|
@@ -712,7 +713,7 @@
|
|
|
712
713
|
* @Date: 2023-03-20 19:26:34
|
|
713
714
|
* @Description:
|
|
714
715
|
* @LastEditors: Lanrri
|
|
715
|
-
* @LastEditTime: 2023-
|
|
716
|
+
* @LastEditTime: 2023-10-19 19:27:02
|
|
716
717
|
*/
|
|
717
718
|
exports.systemTypeEnum = void 0;
|
|
718
719
|
(function (systemTypeEnum) {
|
|
@@ -748,6 +749,10 @@
|
|
|
748
749
|
shellTypeEnum["wechat"] = "wechat";
|
|
749
750
|
/** 微信小程序 */
|
|
750
751
|
shellTypeEnum["wechat-miniprogram"] = "wechat-miniprogram";
|
|
752
|
+
/** 支付宝 */
|
|
753
|
+
shellTypeEnum["alipay"] = "alipay";
|
|
754
|
+
/** 支付宝小程序 */
|
|
755
|
+
shellTypeEnum["alipay-miniprogram"] = "alipay-miniprogram";
|
|
751
756
|
/** qq */
|
|
752
757
|
shellTypeEnum["qq"] = "qq";
|
|
753
758
|
/** uc */
|
|
@@ -1567,13 +1572,12 @@
|
|
|
1567
1572
|
}, function () {
|
|
1568
1573
|
var state = getInternalState$2(this);
|
|
1569
1574
|
var target = state.target;
|
|
1570
|
-
var kind = state.kind;
|
|
1571
1575
|
var index = state.index++;
|
|
1572
1576
|
if (!target || index >= target.length) {
|
|
1573
1577
|
state.target = undefined;
|
|
1574
1578
|
return createIterResultObject$2(undefined, true);
|
|
1575
1579
|
}
|
|
1576
|
-
switch (kind) {
|
|
1580
|
+
switch (state.kind) {
|
|
1577
1581
|
case 'keys': return createIterResultObject$2(index, false);
|
|
1578
1582
|
case 'values': return createIterResultObject$2(target[index], false);
|
|
1579
1583
|
} return createIterResultObject$2([index, target[index]], false);
|
|
@@ -5152,12 +5156,20 @@
|
|
|
5152
5156
|
}];
|
|
5153
5157
|
var defaultShellArr = [{
|
|
5154
5158
|
shell: 'wechat-miniprogram',
|
|
5155
|
-
shellRegexp: /miniprogram/g,
|
|
5159
|
+
shellRegexp: /(?=.*micromessenger)(?=.*miniprogram)/g,
|
|
5156
5160
|
shellValueRegexp: /miniprogram\/[\d._]+/g
|
|
5157
5161
|
}, {
|
|
5158
5162
|
shell: 'wechat',
|
|
5159
5163
|
shellRegexp: /micromessenger/g,
|
|
5160
5164
|
shellValueRegexp: /micromessenger\/[\d._]+/g
|
|
5165
|
+
}, {
|
|
5166
|
+
shell: 'alipay-miniprogram',
|
|
5167
|
+
shellRegexp: /(?=.*aliapp)(?=.*miniprogram)/g,
|
|
5168
|
+
shellValueRegexp: /miniprogram\/[\d._]+/g
|
|
5169
|
+
}, {
|
|
5170
|
+
shell: 'alipay',
|
|
5171
|
+
shellRegexp: /aliapp/g,
|
|
5172
|
+
shellValueRegexp: /aliapp\(AP\/([\d.]+)\)/g
|
|
5161
5173
|
}, {
|
|
5162
5174
|
shell: 'qq',
|
|
5163
5175
|
shellRegexp: /qqbrowser/g,
|
|
@@ -5283,10 +5295,10 @@
|
|
|
5283
5295
|
}]
|
|
5284
5296
|
});
|
|
5285
5297
|
|
|
5286
|
-
var
|
|
5298
|
+
var _weixinJsSdk_1_6_5_weixinJsSdk = {exports: {}};
|
|
5287
5299
|
|
|
5288
5300
|
!(function (e, n) {
|
|
5289
|
-
|
|
5301
|
+
_weixinJsSdk_1_6_5_weixinJsSdk.exports = n(e);
|
|
5290
5302
|
})(typeof window === "object" && window, function (r, e) {
|
|
5291
5303
|
if (!r) {
|
|
5292
5304
|
console.warn("can't use weixin-js-sdk in server side");
|
|
@@ -6177,8 +6189,8 @@
|
|
|
6177
6189
|
}
|
|
6178
6190
|
});
|
|
6179
6191
|
|
|
6180
|
-
var
|
|
6181
|
-
var wx$1 = /*@__PURE__*/getDefaultExportFromCjs(
|
|
6192
|
+
var _weixinJsSdk_1_6_5_weixinJsSdkExports = _weixinJsSdk_1_6_5_weixinJsSdk.exports;
|
|
6193
|
+
var wx$1 = /*@__PURE__*/getDefaultExportFromCjs(_weixinJsSdk_1_6_5_weixinJsSdkExports);
|
|
6182
6194
|
|
|
6183
6195
|
var bridge = {
|
|
6184
6196
|
default:commonjsGlobal,// for typescript
|
|
@@ -6345,6 +6357,13 @@
|
|
|
6345
6357
|
writable: true,
|
|
6346
6358
|
value: false
|
|
6347
6359
|
});
|
|
6360
|
+
/** 是否是支付宝小程序 */
|
|
6361
|
+
Object.defineProperty(this, "isAlipayMini", {
|
|
6362
|
+
enumerable: true,
|
|
6363
|
+
configurable: true,
|
|
6364
|
+
writable: true,
|
|
6365
|
+
value: false
|
|
6366
|
+
});
|
|
6348
6367
|
/** 是否是h5 */
|
|
6349
6368
|
Object.defineProperty(this, "isH5", {
|
|
6350
6369
|
enumerable: true,
|
|
@@ -7114,6 +7133,13 @@
|
|
|
7114
7133
|
writable: true,
|
|
7115
7134
|
value: false
|
|
7116
7135
|
});
|
|
7136
|
+
/** 是否是支付宝小程序 */
|
|
7137
|
+
Object.defineProperty(this, "isAlipayMini", {
|
|
7138
|
+
enumerable: true,
|
|
7139
|
+
configurable: true,
|
|
7140
|
+
writable: true,
|
|
7141
|
+
value: false
|
|
7142
|
+
});
|
|
7117
7143
|
/** 是否是h5 */
|
|
7118
7144
|
Object.defineProperty(this, "isH5", {
|
|
7119
7145
|
enumerable: true,
|
|
@@ -7183,10 +7209,11 @@
|
|
|
7183
7209
|
this.name = options.name;
|
|
7184
7210
|
this.isApp = browserType.isShell('airmart') || device === 'ios' || device === 'android';
|
|
7185
7211
|
this.isMiniProgram = browserType.isShell('wechat-miniprogram') || device === 'wx';
|
|
7212
|
+
this.isAlipayMini = browserType.isShell('alipay-miniprogram') || device === 'alipay';
|
|
7186
7213
|
this.isH5 = device === 'h5';
|
|
7187
7214
|
this.isIframe = device === 'h5' && window.top !== window.self;
|
|
7188
7215
|
this.isIos = browserType.system === 'ios' || device === 'ios';
|
|
7189
|
-
this.device = this.isMiniProgram ? 'wx' : this.isApp ? browserType.system : device;
|
|
7216
|
+
this.device = device === 'h5' ? 'h5' : this.isAlipayMini ? 'alipay' : this.isMiniProgram ? 'wx' : this.isApp ? browserType.system : device;
|
|
7190
7217
|
this.isCanShowNav = this.isApp && true;
|
|
7191
7218
|
this.version = version;
|
|
7192
7219
|
this.channel = channel;
|
|
@@ -7195,6 +7222,12 @@
|
|
|
7195
7222
|
if (this.isOldApp) {
|
|
7196
7223
|
return new OldJuboSdk(options);
|
|
7197
7224
|
}
|
|
7225
|
+
if (this.isAlipayMini) {
|
|
7226
|
+
var script = document.createElement('script');
|
|
7227
|
+
script.type = 'text/javascript';
|
|
7228
|
+
script.src = 'https://appx/web-view.min.js ';
|
|
7229
|
+
document.body.appendChild(script);
|
|
7230
|
+
}
|
|
7198
7231
|
return this;
|
|
7199
7232
|
}
|
|
7200
7233
|
Object.defineProperty(JuboSdk.prototype, "detection", {
|
|
@@ -7289,6 +7322,11 @@
|
|
|
7289
7322
|
url: _this.options.miniProgramLogin || MINI_PROGRAM_LOGIN
|
|
7290
7323
|
});
|
|
7291
7324
|
resolve('');
|
|
7325
|
+
} else if (_this.isAlipayMini) {
|
|
7326
|
+
my.navigateTo({
|
|
7327
|
+
url: _this.options.miniProgramLogin || MINI_PROGRAM_LOGIN
|
|
7328
|
+
});
|
|
7329
|
+
resolve('');
|
|
7292
7330
|
} else {
|
|
7293
7331
|
dsBridge.call('toLogin', {}, function (res) {
|
|
7294
7332
|
var resData = JSON.parse(res);
|
|
@@ -7389,6 +7427,16 @@
|
|
|
7389
7427
|
}
|
|
7390
7428
|
}
|
|
7391
7429
|
});
|
|
7430
|
+
} else if (this.isAlipayMini) {
|
|
7431
|
+
my.postMessage({
|
|
7432
|
+
data: {
|
|
7433
|
+
shareData: {
|
|
7434
|
+
title: options.title,
|
|
7435
|
+
path: options.webpage,
|
|
7436
|
+
imageUrl: options.thumbImage
|
|
7437
|
+
}
|
|
7438
|
+
}
|
|
7439
|
+
});
|
|
7392
7440
|
} else {
|
|
7393
7441
|
dsBridge.call('shareMiniProgram', {
|
|
7394
7442
|
imgUrl: options.thumbImage,
|
|
@@ -7797,6 +7845,6 @@
|
|
|
7797
7845
|
}));
|
|
7798
7846
|
|
|
7799
7847
|
if(typeof window !== 'undefined') {
|
|
7800
|
-
window._juboSDK_VERSION_ = '1.2.
|
|
7848
|
+
window._juboSDK_VERSION_ = '1.2.2-beta.2'
|
|
7801
7849
|
}
|
|
7802
7850
|
//# sourceMappingURL=index.js.map
|