@hairy/wechat-jssdk 1.0.3 → 1.0.7

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/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/TuiMao233>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+
package/index.cjs.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var core = require('@hairy/core');
5
+ var utils = require('@hairy/utils');
6
6
 
7
- const loadScript = (source, onLoaded = core.noop, options = {}) => {
7
+ const loadScript = (source, onLoaded = utils.noop, options = {}) => {
8
8
  const {
9
9
  type = "text/javascript",
10
10
  async = true,
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { noop } from '@hairy/core';
1
+ import { noop } from '@hairy/utils';
2
2
 
3
3
  const loadScript = (source, onLoaded = noop, options = {}) => {
4
4
  const {
package/index.iife.js CHANGED
@@ -1,7 +1,7 @@
1
- (function (exports, core) {
1
+ (function (exports, utils) {
2
2
  'use strict';
3
3
 
4
- const loadScript = (source, onLoaded = core.noop, options = {}) => {
4
+ const loadScript = (source, onLoaded = utils.noop, options = {}) => {
5
5
  const {
6
6
  type = "text/javascript",
7
7
  async = true,
@@ -245,4 +245,4 @@
245
245
 
246
246
  Object.defineProperty(exports, '__esModule', { value: true });
247
247
 
248
- })(this.TuiMaoUtils = this.TuiMaoUtils || {}, TuiMaoCore);
248
+ })(this.hairyWechatJssdk = this.hairyWechatJssdk || {}, hairyUtils);
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"use strict";e.WechatJssdk=class extends class{constructor(e){this.isReady=!1;const{immediate:t=!0,version:i,requestConfig:n}=e;this.version=i||"1.3.0",this.requestConfig=n,this.loadJssdk(),t&&this.config()}loadJssdk(){const e=`https://res.wx.qq.com/open/js/jweixin-${this.version}.js`;this.loadPromise=((e,i=t.noop,n={})=>{const{type:r="text/javascript",async:s=!0,crossOrigin:o,referrerPolicy:a,noModule:m,defer:h,waitForScriptLoad:d=!0}=n;return new Promise(((t,n)=>{let c=!1,u=document.querySelector(`script[src="${e}"]`);u?u.hasAttribute("data-loaded")&&t(u):(u=document.createElement("script"),u.type=r,u.async=s,u.src=e,h&&(u.defer=h),o&&(u.crossOrigin=o),m&&(u.noModule=m),a&&(u.referrerPolicy=a),c=!0),u.addEventListener("error",(e=>n(e))),u.addEventListener("abort",(e=>n(e))),u.addEventListener("load",(()=>{u.dataset.loaded="true",i(u),t(u)})),c&&(u=document.head.appendChild(u)),d||t(u)}))})(e).then((()=>{this.loadPromise=void 0}))}async config(){return this.configPromise||(this.loadPromise&&await this.loadPromise,this.configPromise=(async()=>{wx.config(await this.requestConfig())})()),this.configPromise}async ready(){return this.readyPromise?this.readyPromise:(this.loadPromise&&await this.loadPromise,this.isReady?void 0:(this.readyPromise=new Promise(((e,t)=>{wx.ready((()=>{this.isReady=!0,this.readyPromise=void 0,e()})),wx.error((e=>{this.isReady=!1,this.readyPromise=void 0,t(e)}))})),this.readyPromise))}async error(){return this.ready().catch((e=>e))}async implement(e,t){this.configPromise&&await this.configPromise,await this.ready(),wx[e](t)}}{constructor(e){super(e)}updateAppMessageShareData(e){return this.implement("updateAppMessageShareData",e)}updateTimelineShareData(e){return this.implement("updateTimelineShareData",e)}addCard(){return this.implement("addCard")}checkJsApi(e){return this.implement("checkJsApi",e)}chooseCard(e){return this.implement("chooseCard",e)}chooseImage(e){return this.implement("chooseImage",e)}chooseWXPay(e){return this.implement("chooseWXPay",e)}closeWindow(){return this.implement("closeWindow")}consumeAndShareCard(e){return this.implement("consumeAndShareCard",e)}downloadImage(e){return this.implement("downloadImage",e)}downloadVoice(e){return this.implement("downloadVoice",e)}getLocalImgData(e){return this.implement("getLocalImgData",e)}getLocation(e){return this.implement("getLocation",e)}getNetworkType(e){return this.implement("getNetworkType",e)}hideAllNonBaseMenuItem(){return this.implement("hideAllNonBaseMenuItem")}hideMenuItems(e){return this.implement("hideMenuItems",e)}hideOptionMenu(){return this.implement("hideOptionMenu")}onMenuShareAppMessage(e){return this.implement("onMenuShareAppMessage",e)}onMenuShareQQ(e){return this.implement("onMenuShareQQ",e)}onMenuShareQZone(e){return this.implement("onMenuShareQZone",e)}onMenuShareTimeline(e){return this.implement("onMenuShareTimeline",e)}onMenuShareWeibo(e){return this.implement("onMenuShareWeibo",e)}onSearchBeacons(e){return this.implement("onSearchBeacons",e)}onVoicePlayEnd(e){return this.implement("onVoicePlayEnd",e)}onVoiceRecordEnd(e){return this.implement("onVoiceRecordEnd",e)}openCard(e){return this.implement("openCard",e)}openLocation(e){return this.implement("openLocation",e)}openProductSpecificView(e){return this.implement("openProductSpecificView",e)}pauseVoice(e){return this.implement("pauseVoice",e)}playVoice(e){return this.implement("playVoice",e)}previewImage(e){return this.implement("previewImage",e)}scanQRCode(e){return this.implement("scanQRCode",e)}showAllNonBaseMenuItem(){return this.implement("showAllNonBaseMenuItem")}showMenuItems(e){return this.implement("showMenuItems",e)}showOptionMenu(){return this.implement("showOptionMenu")}startRecord(){return this.implement("startRecord")}startSearchBeacons(e){return this.implement("startSearchBeacons",e)}stopRecord(e){return this.implement("stopRecord",e)}stopSearchBeacons(e){return this.implement("stopSearchBeacons",e)}stopVoice(e){return this.implement("stopVoice",e)}translateVoice(e){return this.implement("translateVoice",e)}uploadImage(e){return this.implement("uploadImage",e)}uploadVoice(e){return this.implement("uploadVoice",e)}},Object.defineProperty(e,"__esModule",{value:!0})}(this.TuiMaoUtils=this.TuiMaoUtils||{},TuiMaoCore);
1
+ !function(e,t){"use strict";e.WechatJssdk=class extends class{constructor(e){this.isReady=!1;const{immediate:t=!0,version:i,requestConfig:n}=e;this.version=i||"1.3.0",this.requestConfig=n,this.loadJssdk(),t&&this.config()}loadJssdk(){const e=`https://res.wx.qq.com/open/js/jweixin-${this.version}.js`;this.loadPromise=((e,i=t.noop,n={})=>{const{type:r="text/javascript",async:s=!0,crossOrigin:o,referrerPolicy:a,noModule:m,defer:h,waitForScriptLoad:d=!0}=n;return new Promise(((t,n)=>{let c=!1,p=document.querySelector(`script[src="${e}"]`);p?p.hasAttribute("data-loaded")&&t(p):(p=document.createElement("script"),p.type=r,p.async=s,p.src=e,h&&(p.defer=h),o&&(p.crossOrigin=o),m&&(p.noModule=m),a&&(p.referrerPolicy=a),c=!0),p.addEventListener("error",(e=>n(e))),p.addEventListener("abort",(e=>n(e))),p.addEventListener("load",(()=>{p.dataset.loaded="true",i(p),t(p)})),c&&(p=document.head.appendChild(p)),d||t(p)}))})(e).then((()=>{this.loadPromise=void 0}))}async config(){return this.configPromise||(this.loadPromise&&await this.loadPromise,this.configPromise=(async()=>{wx.config(await this.requestConfig())})()),this.configPromise}async ready(){return this.readyPromise?this.readyPromise:(this.loadPromise&&await this.loadPromise,this.isReady?void 0:(this.readyPromise=new Promise(((e,t)=>{wx.ready((()=>{this.isReady=!0,this.readyPromise=void 0,e()})),wx.error((e=>{this.isReady=!1,this.readyPromise=void 0,t(e)}))})),this.readyPromise))}async error(){return this.ready().catch((e=>e))}async implement(e,t){this.configPromise&&await this.configPromise,await this.ready(),wx[e](t)}}{constructor(e){super(e)}updateAppMessageShareData(e){return this.implement("updateAppMessageShareData",e)}updateTimelineShareData(e){return this.implement("updateTimelineShareData",e)}addCard(){return this.implement("addCard")}checkJsApi(e){return this.implement("checkJsApi",e)}chooseCard(e){return this.implement("chooseCard",e)}chooseImage(e){return this.implement("chooseImage",e)}chooseWXPay(e){return this.implement("chooseWXPay",e)}closeWindow(){return this.implement("closeWindow")}consumeAndShareCard(e){return this.implement("consumeAndShareCard",e)}downloadImage(e){return this.implement("downloadImage",e)}downloadVoice(e){return this.implement("downloadVoice",e)}getLocalImgData(e){return this.implement("getLocalImgData",e)}getLocation(e){return this.implement("getLocation",e)}getNetworkType(e){return this.implement("getNetworkType",e)}hideAllNonBaseMenuItem(){return this.implement("hideAllNonBaseMenuItem")}hideMenuItems(e){return this.implement("hideMenuItems",e)}hideOptionMenu(){return this.implement("hideOptionMenu")}onMenuShareAppMessage(e){return this.implement("onMenuShareAppMessage",e)}onMenuShareQQ(e){return this.implement("onMenuShareQQ",e)}onMenuShareQZone(e){return this.implement("onMenuShareQZone",e)}onMenuShareTimeline(e){return this.implement("onMenuShareTimeline",e)}onMenuShareWeibo(e){return this.implement("onMenuShareWeibo",e)}onSearchBeacons(e){return this.implement("onSearchBeacons",e)}onVoicePlayEnd(e){return this.implement("onVoicePlayEnd",e)}onVoiceRecordEnd(e){return this.implement("onVoiceRecordEnd",e)}openCard(e){return this.implement("openCard",e)}openLocation(e){return this.implement("openLocation",e)}openProductSpecificView(e){return this.implement("openProductSpecificView",e)}pauseVoice(e){return this.implement("pauseVoice",e)}playVoice(e){return this.implement("playVoice",e)}previewImage(e){return this.implement("previewImage",e)}scanQRCode(e){return this.implement("scanQRCode",e)}showAllNonBaseMenuItem(){return this.implement("showAllNonBaseMenuItem")}showMenuItems(e){return this.implement("showMenuItems",e)}showOptionMenu(){return this.implement("showOptionMenu")}startRecord(){return this.implement("startRecord")}startSearchBeacons(e){return this.implement("startSearchBeacons",e)}stopRecord(e){return this.implement("stopRecord",e)}stopSearchBeacons(e){return this.implement("stopSearchBeacons",e)}stopVoice(e){return this.implement("stopVoice",e)}translateVoice(e){return this.implement("translateVoice",e)}uploadImage(e){return this.implement("uploadImage",e)}uploadVoice(e){return this.implement("uploadVoice",e)}},Object.defineProperty(e,"__esModule",{value:!0})}(this.hairyWechatJssdk=this.hairyWechatJssdk||{},hairyUtils);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hairy/wechat-jssdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.7",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "@types/jweixin": "^1.0.8",
@@ -12,5 +12,24 @@
12
12
  "unpkg": "./index.iife.min.js",
13
13
  "jsdelivr": "./index.iife.min.js",
14
14
  "author": "Anthony Fu<https://github.com/TuiMao233>",
15
- "gitHead": "d5b83d069dd7dfcd65aa6bcd07f1a33baceff00d"
15
+ "gitHead": "8fbecb4d66553d61eed585bcbf63ffb1d14ce900",
16
+ "description": "Wechat Jssdk",
17
+ "bugs": {
18
+ "url": "https://github.com/TuiMao233/hairylib/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/TuiMao233/hairylib.git"
23
+ },
24
+ "homepage": "https://github.com/TuiMao233/hairylib#readme",
25
+ "exports": {
26
+ ".": {
27
+ "import": "./index.esm.js",
28
+ "require": "./index.cjs.js"
29
+ },
30
+ "./*": "./*"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ }
16
35
  }
package/README.md DELETED
File without changes