@tarojs/plugin-platform-h5 3.7.0-alpha.2 → 3.7.0-alpha.3

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 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/runtime/apis/index.ts"],"sourcesContent":["import definition from '@tarojs/plugin-platform-h5/dist/definition.json'\nimport isMatchWith from 'lodash-es/isMatchWith'\nimport set from 'lodash-es/set'\n\nimport Taro from './taro'\n\nexport * from './taro'\nexport * from './taro-h5'\n\nlet list: Record<string, unknown> | null = null\nexport function canIUse (scheme = '') {\n /** Note: 此处方法仅作适配使用,用于避免 babel 无法识别的情况,比如通过变量传递的 scheme 等等\n * 同时,此处的 scheme 不包括在编译时写入的 hooks 等方法,故而不支持相关判断\n */\n if (list === null) {\n list = {\n ...definition.apis,\n ...definition.components,\n canIUse: '*'\n } as Exclude<typeof list, null>\n }\n if (!scheme) return false\n const o = set({}, scheme, true)\n return isMatchWith(list, o, (a, b) => {\n if (a === '*' || b === true) return true\n })\n}\n\nexport default Taro\n"],"names":[],"mappings":";;;;;;;;;;AASA,IAAI,IAAI,GAAmC,IAAI,CAAA;AAC/B,SAAA,OAAO,CAAE,MAAM,GAAG,EAAE,EAAA;AAClC;;AAEG;IACH,IAAI,IAAI,KAAK,IAAI,EAAE;AACjB,QAAA,IAAI,GAAG,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACF,UAAU,CAAC,IAAI,CACf,EAAA,UAAU,CAAC,UAAU,CACxB,EAAA,EAAA,OAAO,EAAE,GAAG,GACiB,CAAA;AAChC,KAAA;AACD,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK,CAAA;IACzB,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IAC/B,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAI;AACnC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI;AAAE,YAAA,OAAO,IAAI,CAAA;AAC1C,KAAC,CAAC,CAAA;AACJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-platform-h5",
3
- "version": "3.7.0-alpha.2",
3
+ "version": "3.7.0-alpha.3",
4
4
  "description": "Web 端平台插件",
5
5
  "author": "ZakaryCode",
6
6
  "license": "MIT",
@@ -9,6 +9,7 @@
9
9
  "taro"
10
10
  ],
11
11
  "files": [
12
+ "build",
12
13
  "dist",
13
14
  "index.js",
14
15
  "types"
@@ -28,27 +29,37 @@
28
29
  },
29
30
  "dependencies": {
30
31
  "@babel/core": "^7.14.5",
31
- "resolve": "^1.22.0",
32
- "@tarojs/components": "3.7.0-alpha.2",
33
- "@tarojs/components-react": "3.7.0-alpha.2",
34
- "@tarojs/router": "3.7.0-alpha.2",
35
- "@tarojs/service": "3.7.0-alpha.2",
36
- "@tarojs/shared": "3.7.0-alpha.2",
37
- "@tarojs/helper": "3.7.0-alpha.2",
38
- "@tarojs/taro-h5": "3.7.0-alpha.2",
39
- "babel-plugin-transform-taroapi": "3.7.0-alpha.2"
32
+ "change-case": "^4.1.2",
33
+ "lodash-es": "4.17.21",
34
+ "@tarojs/components": "3.7.0-alpha.3",
35
+ "@tarojs/components-react": "3.7.0-alpha.3",
36
+ "@tarojs/router": "3.7.0-alpha.3",
37
+ "@tarojs/service": "3.7.0-alpha.3",
38
+ "@tarojs/shared": "3.7.0-alpha.3",
39
+ "@tarojs/helper": "3.7.0-alpha.3",
40
+ "@tarojs/taro-h5": "3.7.0-alpha.3",
41
+ "babel-plugin-transform-taroapi": "3.7.0-alpha.3"
40
42
  },
41
43
  "devDependencies": {
42
44
  "@rollup/plugin-commonjs": "^20.0.0",
45
+ "@rollup/plugin-json": "^4.1.0",
43
46
  "@rollup/plugin-node-resolve": "^8.0.0",
44
- "lodash": "^4.17.21",
45
- "rollup": "^2.79.0",
47
+ "@rollup/plugin-typescript": "^11.1.0",
48
+ "rollup": "^3.8.1",
46
49
  "rollup-plugin-node-externals": "^5.0.0",
47
50
  "rollup-plugin-ts": "^3.0.2",
48
- "typescript": "^4.7.4"
51
+ "ts-node": "^10.9.1",
52
+ "tsconfig-paths": "^3.14.1",
53
+ "typescript": "^4.7.4",
54
+ "@tarojs/taro": "3.7.0-alpha.3"
49
55
  },
50
56
  "scripts": {
51
- "build": "cross-env NODE_ENV=production rollup -c",
52
- "dev": "cross-env NODE_ENV=development rollup -c -w"
57
+ "prebuild": "run-s clean generate:desc",
58
+ "build": "pnpm run rollup --environment NODE_ENV:production",
59
+ "clean": "rimraf dist",
60
+ "dev": "pnpm run rollup --environment NODE_ENV:development -w",
61
+ "generate:desc": "pnpm run tsx --files ./build/definition-json",
62
+ "rollup": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
63
+ "tsx": "ts-node --skipIgnore"
53
64
  }
54
65
  }
@@ -0,0 +1,4 @@
1
+ declare module '*.json' {
2
+ const value: Record<string, any>
3
+ export default value
4
+ }
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function exportNameOnly () {
6
- const emptyMap = { mappings: '' };
7
- return {
8
- name: 'export-name-only',
9
- renderChunk (code, chunk) {
10
- const pos = chunk.exports.indexOf('default');
11
- if (pos > -1) {
12
- chunk.exports.splice(pos, 1);
13
- }
14
- return {
15
- code: `module.exports = new Set(${JSON.stringify(chunk.exports)})`,
16
- map: emptyMap
17
- }
18
- }
19
- }
20
- }
21
-
22
- exports["default"] = exportNameOnly;
@@ -1,5 +0,0 @@
1
- import Taro from "@tarojs/taro-h5/dist/api/taro";
2
- export * from "@tarojs/taro-h5/dist/api/taro";
3
- export { default } from "@tarojs/taro-h5/dist/api/taro";
4
- export * from "@tarojs/taro-h5/dist/api/index";
5
- export { Taro as default };
package/dist/taroApis.js DELETED
@@ -1,2 +0,0 @@
1
- module.exports = new Set(["Behavior","Current","ENV_TYPE","Events","Link","addCard","addFileToFavorites","addInterceptor","addPhoneCalendar","addPhoneContact","addPhoneRepeatCalendar","addVideoToFavorites","advancedGeneralIdentify","animalClassify","arrayBufferToBase64","authPrivateMessage","authorize","authorizeForMiniProgram","base64ToArrayBuffer","canIUse","canIUseWebp","canvasGetImageData","canvasPutImageData","canvasToTempFilePath","carClassify","checkIsAddedToMyMiniProgram","checkIsOpenAccessibility","checkIsSoterEnrolledInDevice","checkIsSupportFacialRecognition","checkIsSupportSoterAuthentication","checkSession","chooseAddress","chooseContact","chooseImage","chooseInvoice","chooseInvoiceTitle","chooseLicensePlate","chooseLocation","chooseMedia","chooseMessageFile","choosePoi","chooseVideo","cleanInterceptors","clearStorage","clearStorageSync","closeBLEConnection","closeBluetoothAdapter","closeSocket","cloud","compressImage","compressVideo","connectSocket","connectWifi","createAnimation","createAudioContext","createBLEConnection","createBLEPeripheralServer","createBufferURL","createCameraContext","createCanvasContext","createInnerAudioContext","createIntersectionObserver","createInterstitialAd","createLivePlayerContext","createLivePusherContext","createMapContext","createMediaAudioPlayer","createMediaContainer","createMediaQueryObserver","createMediaRecorder","createOffscreenCanvas","createRewardedVideoAd","createSelectorQuery","createTCPSocket","createUDPSocket","createVKSession","createVideoContext","createVideoDecoder","createWebAudioContext","createWorker","disableAlertBeforeUnload","dishClassify","downloadFile","enableAlertBeforeUnload","env","eventCenter","exitMiniProgram","exitVoIPChat","faceDetect","faceVerifyForPay","getAccountInfoSync","getApp","getAppAuthorizeSetting","getAppBaseInfo","getAvailableAudioSources","getBLEDeviceCharacteristics","getBLEDeviceRSSI","getBLEDeviceServices","getBLEMTU","getBackgroundAudioManager","getBackgroundAudioPlayerState","getBackgroundFetchData","getBackgroundFetchToken","getBatteryInfo","getBatteryInfoSync","getBeacons","getBluetoothAdapterState","getBluetoothDevices","getChannelsLiveInfo","getChannelsLiveNoticeInfo","getClipboardData","getConnectedBluetoothDevices","getConnectedWifi","getCurrentInstance","getCurrentPages","getDeviceInfo","getEnterOptionsSync","getEnv","getExptInfoSync","getExtConfig","getExtConfigSync","getFileInfo","getFileSystemManager","getFuzzyLocation","getGroupEnterInfo","getHCEState","getImageInfo","getLaunchOptionsSync","getLocalIPAddress","getLocation","getLogManager","getMenuButtonBoundingClientRect","getNFCAdapter","getNetworkType","getOpenUserInfo","getPerformance","getRandomValues","getRealtimeLogManager","getRecorderManager","getSavedFileInfo","getSavedFileList","getScreenBrightness","getSelectedTextRange","getSetting","getShareInfo","getStorage","getStorageInfo","getStorageInfoSync","getStorageSync","getSwanId","getSystemInfo","getSystemInfoAsync","getSystemInfoSync","getSystemSetting","getUpdateManager","getUserCryptoManager","getUserInfo","getUserProfile","getVideoInfo","getWeRunData","getWifiList","getWindowInfo","hideHomeButton","hideKeyboard","hideLoading","hideNavigationBarLoading","hideShareMenu","hideTabBar","hideTabBarRedDot","hideToast","history","imageAudit","initFaceDetect","initPxTransform","initTabBarApis","interceptors","isBluetoothDevicePaired","isVKSupport","joinVoIPChat","loadFontFace","login","logoClassify","makeBluetoothPair","makePhoneCall","navigateBack","navigateBackMiniProgram","navigateBackSmartProgram","navigateTo","navigateToMiniProgram","navigateToSmartGameProgram","navigateToSmartProgram","nextTick","notifyBLECharacteristicValueChange","objectDetectIdentify","ocrBankCard","ocrDrivingLicense","ocrIdCard","ocrVehicleLicense","offAccelerometerChange","offAppHide","offAppShow","offAudioInterruptionBegin","offAudioInterruptionEnd","offBLECharacteristicValueChange","offBLEConnectionStateChange","offBLEMTUChange","offBLEPeripheralConnectionStateChanged","offBeaconServiceChange","offBeaconUpdate","offBluetoothAdapterStateChange","offBluetoothDeviceFound","offCompassChange","offCopyUrl","offDeviceMotionChange","offError","offGetWifiList","offGyroscopeChange","offHCEMessage","offKeyboardHeightChange","offLocalServiceDiscoveryStop","offLocalServiceFound","offLocalServiceLost","offLocalServiceResolveFail","offLocationChange","offLocationChangeError","offMemoryWarning","offNetworkStatusChange","offNetworkWeakChange","offPageNotFound","offThemeChange","offUnhandledRejection","offUserCaptureScreen","offVoIPChatInterrupted","offVoIPChatMembersChanged","offVoIPChatStateChanged","offVoIPVideoMembersChanged","offWifiConnected","offWindowResize","onAccelerometerChange","onAppHide","onAppShow","onAudioInterruptionBegin","onAudioInterruptionEnd","onBLECharacteristicValueChange","onBLEConnectionStateChange","onBLEMTUChange","onBLEPeripheralConnectionStateChanged","onBackgroundAudioPause","onBackgroundAudioPlay","onBackgroundAudioStop","onBackgroundFetchData","onBeaconServiceChange","onBeaconUpdate","onBluetoothAdapterStateChange","onBluetoothDeviceFound","onCompassChange","onCopyUrl","onDeviceMotionChange","onError","onGetWifiList","onGyroscopeChange","onHCEMessage","onKeyboardHeightChange","onLocalServiceDiscoveryStop","onLocalServiceFound","onLocalServiceLost","onLocalServiceResolveFail","onLocationChange","onLocationChangeError","onMemoryWarning","onNetworkStatusChange","onNetworkWeakChange","onPageNotFound","onSocketClose","onSocketError","onSocketMessage","onSocketOpen","onThemeChange","onUnhandledRejection","onUserCaptureScreen","onVoIPChatInterrupted","onVoIPChatMembersChanged","onVoIPChatSpeakersChanged","onVoIPChatStateChanged","onVoIPVideoMembersChanged","onWifiConnected","onWifiConnectedWithPartialInfo","onWindowResize","openAppAuthorizeSetting","openBluetoothAdapter","openBusinessView","openCard","openChannelsActivity","openChannelsEvent","openChannelsLive","openCustomerServiceChat","openDocument","openEmbeddedMiniProgram","openLocation","openSetting","openSystemBluetoothSetting","openVideoEditor","options","pageScrollTo","pauseBackgroundAudio","pauseVoice","plantClassify","playBackgroundAudio","playVoice","pluginLogin","preload","preloadSubPackage","previewImage","previewMedia","pxTransform","reLaunch","readBLECharacteristicValue","redirectTo","removeSavedFile","removeStorage","removeStorageSync","removeTabBarBadge","reportAnalytics","reportEvent","reportMonitor","reportPerformance","request","requestOrderPayment","requestPayment","requestPolymerPayment","requestSubscribeMessage","requirePlugin","reserveChannelsLive","revokeBufferURL","saveFile","saveFileToDisk","saveImageToPhotosAlbum","saveVideoToPhotosAlbum","scanCode","seekBackgroundAudio","sendHCEMessage","sendSocketMessage","setBLEMTU","setBackgroundColor","setBackgroundFetchToken","setBackgroundTextStyle","setClipboardData","setEnable1v1Chat","setEnableDebug","setInnerAudioOption","setKeepScreenOn","setNavigationBarColor","setNavigationBarTitle","setPageInfo","setScreenBrightness","setStorage","setStorageSync","setTabBarBadge","setTabBarItem","setTabBarStyle","setTopBarText","setVisualEffectOnCapture","setWifiList","setWindowSize","shareFileMessage","shareToWeRun","shareVideoMessage","showActionSheet","showLoading","showModal","showNavigationBarLoading","showRedPackage","showShareImageMenu","showShareMenu","showTabBar","showTabBarRedDot","showToast","startAccelerometer","startBeaconDiscovery","startBluetoothDevicesDiscovery","startCompass","startDeviceMotionListening","startFacialRecognitionVerify","startFacialRecognitionVerifyAndUploadVideo","startGyroscope","startHCE","startLocalServiceDiscovery","startLocationUpdate","startLocationUpdateBackground","startPullDownRefresh","startRecord","startSoterAuthentication","startWifi","stopAccelerometer","stopBackgroundAudio","stopBeaconDiscovery","stopBluetoothDevicesDiscovery","stopCompass","stopDeviceMotionListening","stopFaceDetect","stopGyroscope","stopHCE","stopLocalServiceDiscovery","stopLocationUpdate","stopPullDownRefresh","stopRecord","stopVoice","stopWifi","subscribeVoIPVideoMembers","switchTab","textReview","textToAudio","updateShareMenu","updateVoIPChatMuteConfig","updateWeChatApp","uploadFile","vibrateLong","vibrateShort","writeBLECharacteristicValue"])
2
- //# sourceMappingURL=taroApis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taroApis.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}