@tarojs/taro-h5 3.3.14 → 3.3.18

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.
Files changed (175) hide show
  1. package/dist/index.cjs.js +6601 -8371
  2. package/dist/index.js +9493 -0
  3. package/dist/taroApis.js +1 -1
  4. package/package.json +9 -9
  5. package/src/api/ad/index.ts +5 -0
  6. package/src/api/ai/facial.ts +6 -0
  7. package/src/api/ai/index.ts +2 -0
  8. package/src/api/ai/visual.ts +4 -0
  9. package/src/api/alipay/index.ts +4 -0
  10. package/src/api/base/crypto.ts +4 -0
  11. package/src/api/base/debug.ts +5 -0
  12. package/src/api/base/index.ts +23 -0
  13. package/src/api/base/performance.ts +5 -0
  14. package/src/api/base/system/index.ts +2 -0
  15. package/src/api/base/system/info.ts +64 -0
  16. package/src/api/base/system/network.ts +70 -0
  17. package/src/api/base/update.ts +5 -0
  18. package/src/api/base/weapp/app-event.ts +19 -0
  19. package/src/api/base/weapp/life-cycle.ts +5 -0
  20. package/src/api/canvas/CanvasContext.ts +230 -0
  21. package/src/api/canvas/canvasGetImageData.ts +27 -0
  22. package/src/api/canvas/canvasPutImageData.ts +24 -0
  23. package/src/api/canvas/canvasToTempFilePath.ts +24 -0
  24. package/src/api/canvas/createCanvasContext.ts +18 -0
  25. package/src/api/canvas/index.ts +10 -0
  26. package/src/api/cloud/index.ts +27 -0
  27. package/src/api/data-analysis/index.ts +6 -0
  28. package/src/api/device/accelerometer.ts +87 -0
  29. package/src/api/device/accessibility.ts +4 -0
  30. package/src/api/device/battery.ts +5 -0
  31. package/src/api/device/bluetooth-ble.ts +19 -0
  32. package/src/api/device/bluetooth-peripheral.ts +6 -0
  33. package/src/api/device/bluetooth.ts +16 -0
  34. package/src/api/device/calendar.ts +5 -0
  35. package/src/api/device/clipboard.ts +67 -0
  36. package/src/api/device/compass.ts +67 -0
  37. package/src/api/device/contact.ts +5 -0
  38. package/src/api/device/crypto.ts +4 -0
  39. package/src/api/device/gyroscope.ts +7 -0
  40. package/src/api/device/iBeacon.ts +10 -0
  41. package/src/api/device/index.ts +22 -0
  42. package/src/api/device/keyboard.ts +7 -0
  43. package/src/api/device/memory.ts +5 -0
  44. package/src/api/device/motion.ts +85 -0
  45. package/src/api/device/nfc.ts +10 -0
  46. package/src/api/device/phone.ts +30 -0
  47. package/src/api/device/scan.ts +7 -0
  48. package/src/api/device/screen.ts +9 -0
  49. package/src/api/device/vibrate.ts +36 -0
  50. package/src/api/device/wifi.ts +13 -0
  51. package/src/api/ext/index.ts +5 -0
  52. package/src/api/files/index.ts +11 -0
  53. package/src/api/framework/index.ts +10 -0
  54. package/src/api/index.ts +25 -0
  55. package/src/api/location/chooseLocation.ts +106 -0
  56. package/src/api/location/index.ts +19 -0
  57. package/src/api/location/style.css +8 -8
  58. package/src/api/media/audio/index.ts +105 -0
  59. package/src/api/media/background-audio.ts +12 -0
  60. package/src/api/media/camera.ts +4 -0
  61. package/src/api/media/editor.ts +29 -0
  62. package/src/api/media/image/chooseImage.ts +78 -0
  63. package/src/api/media/image/getImageInfo.ts +35 -0
  64. package/src/api/media/image/index.ts +13 -0
  65. package/src/api/media/image/previewImage.ts +101 -0
  66. package/src/api/media/index.ts +13 -0
  67. package/src/api/media/live.ts +5 -0
  68. package/src/api/media/map.ts +4 -0
  69. package/src/api/media/media-recorder.ts +4 -0
  70. package/src/api/media/recorder.ts +6 -0
  71. package/src/api/media/video/index.ts +82 -0
  72. package/src/api/media/video-decoder.ts +4 -0
  73. package/src/api/media/video-processing.ts +4 -0
  74. package/src/api/media/voip.ts +17 -0
  75. package/src/api/navigate/index.ts +7 -0
  76. package/src/api/{fileTransfer/downloadFile.js → network/download.ts} +16 -27
  77. package/src/api/network/index.ts +7 -0
  78. package/src/api/network/mdns.ts +13 -0
  79. package/src/api/{request/index.js → network/request/index.ts} +9 -6
  80. package/src/api/network/tcp.ts +4 -0
  81. package/src/api/network/udp.ts +4 -0
  82. package/src/api/{fileTransfer/uploadFile.js → network/upload.ts} +28 -32
  83. package/src/api/{fileTransfer/utils.js → network/utils.ts} +0 -0
  84. package/src/api/network/websocket/index.ts +88 -0
  85. package/src/api/{webSocket/socketTask.js → network/websocket/socketTask.ts} +17 -7
  86. package/src/api/open-api/account.ts +4 -0
  87. package/src/api/open-api/address.ts +4 -0
  88. package/src/api/open-api/authorize.ts +5 -0
  89. package/src/api/open-api/card.ts +5 -0
  90. package/src/api/open-api/channels-live.ts +9 -0
  91. package/src/api/open-api/customer-service.ts +4 -0
  92. package/src/api/open-api/facial.ts +7 -0
  93. package/src/api/open-api/favorites.ts +5 -0
  94. package/src/api/open-api/group.ts +4 -0
  95. package/src/api/open-api/index.ts +18 -0
  96. package/src/api/open-api/invoice.ts +5 -0
  97. package/src/api/open-api/license-plate.ts +4 -0
  98. package/src/api/open-api/login.ts +6 -0
  99. package/src/api/open-api/red-package.ts +4 -0
  100. package/src/api/open-api/settings.ts +5 -0
  101. package/src/api/open-api/soter.ts +6 -0
  102. package/src/api/open-api/subscribe-message.ts +4 -0
  103. package/src/api/open-api/user-info.ts +5 -0
  104. package/src/api/open-api/werun.ts +5 -0
  105. package/src/api/payment/index.ts +5 -0
  106. package/src/api/route/index.ts +10 -0
  107. package/src/api/share/index.ts +13 -0
  108. package/src/api/storage/background-fetch.ts +7 -0
  109. package/src/api/storage/index.ts +181 -0
  110. package/src/api/swan/index.ts +31 -0
  111. package/src/{taro/index.js → api/taro.ts} +133 -149
  112. package/src/api/{createAnimation/index.js → ui/animation/index.ts} +51 -35
  113. package/src/api/ui/background.ts +5 -0
  114. package/src/api/ui/custom-component.ts +4 -0
  115. package/src/api/ui/fonts.ts +4 -0
  116. package/src/api/ui/index.ts +12 -0
  117. package/src/api/ui/interaction/actionSheet.ts +212 -0
  118. package/src/api/{interactive/index.js → ui/interaction/index.ts} +93 -77
  119. package/src/api/ui/interaction/modal.ts +237 -0
  120. package/src/api/{interactive/toast.js → ui/interaction/toast.ts} +35 -33
  121. package/src/api/ui/menu.ts +4 -0
  122. package/src/api/ui/navigation-bar/index.ts +52 -0
  123. package/src/api/ui/pull-down-refresh.ts +27 -0
  124. package/src/api/ui/scroll/index.ts +85 -0
  125. package/src/api/ui/sticky.ts +4 -0
  126. package/src/api/ui/tab-bar.ts +326 -0
  127. package/src/api/ui/window.ts +37 -0
  128. package/src/api/utils/handler.ts +105 -0
  129. package/src/api/utils/{index.js → index.ts} +36 -115
  130. package/src/api/worker/index.ts +4 -0
  131. package/src/api/wxml/index.ts +9 -0
  132. package/src/api/wxml/nodesRef.ts +49 -0
  133. package/src/api/{createSelectorQuery/index.js → wxml/selectorQuery.ts} +75 -94
  134. package/src/index.ts +6 -0
  135. package/src/types/api.d.ts +4 -0
  136. package/src/types/define.d.ts +2 -0
  137. package/{types → src/types}/index.d.ts +0 -0
  138. package/{types → src/types}/type.ts +1 -1
  139. package/src/api/accelerometer/index.js +0 -105
  140. package/src/api/audio/index.js +0 -137
  141. package/src/api/canvas/canvasGetImageData.js +0 -44
  142. package/src/api/canvas/canvasPutImageData.js +0 -45
  143. package/src/api/canvas/canvasToTempFilePath.js +0 -49
  144. package/src/api/canvas/createCanvasContext.js +0 -340
  145. package/src/api/canvas/index.js +0 -4
  146. package/src/api/clipboard/index.js +0 -113
  147. package/src/api/compass/index.js +0 -99
  148. package/src/api/deviceMotion/index.js +0 -105
  149. package/src/api/fileTransfer/index.js +0 -2
  150. package/src/api/image/chooseImage.js +0 -87
  151. package/src/api/image/getImageInfo.js +0 -74
  152. package/src/api/image/index.js +0 -7
  153. package/src/api/image/previewImage.js +0 -94
  154. package/src/api/index.js +0 -29
  155. package/src/api/interactive/actionSheet.js +0 -214
  156. package/src/api/interactive/modal.js +0 -256
  157. package/src/api/location/chooseLocation.js +0 -143
  158. package/src/api/location/index.js +0 -5
  159. package/src/api/navigationBar/index.js +0 -57
  160. package/src/api/open/index.js +0 -5
  161. package/src/api/others/index.js +0 -43
  162. package/src/api/pullDownRefresh/index.js +0 -51
  163. package/src/api/scroll/index.js +0 -99
  164. package/src/api/storage/index.js +0 -211
  165. package/src/api/system/index.js +0 -9
  166. package/src/api/system/info.js +0 -36
  167. package/src/api/system/network.js +0 -68
  168. package/src/api/tabBar/index.js +0 -424
  169. package/src/api/unsupportedApi/index.js +0 -278
  170. package/src/api/vibrate/index.js +0 -49
  171. package/src/api/video/index.js +0 -87
  172. package/src/api/webSocket/index.js +0 -103
  173. package/src/api/window/index.js +0 -38
  174. package/src/index.cjs.js +0 -11
  175. package/src/index.js +0 -6
@@ -1,278 +0,0 @@
1
- import { temporarilyNotSupport } from '../utils'
2
-
3
- // onAndSyncApis
4
- // export const onSocketOpen = temporarilyNotSupport('onSocketOpen')
5
- // export const onSocketError = temporarilyNotSupport('onSocketError')
6
- // export const onSocketMessage = temporarilyNotSupport('onSocketMessage')
7
- // export const onSocketClose = temporarilyNotSupport('onSocketClose')
8
- export const onBackgroundAudioPlay = temporarilyNotSupport('onBackgroundAudioPlay')
9
- export const onBackgroundAudioPause = temporarilyNotSupport('onBackgroundAudioPause')
10
- export const onBackgroundAudioStop = temporarilyNotSupport('onBackgroundAudioStop')
11
- // export const onNetworkStatusChange = temporarilyNotSupport('onNetworkStatusChange')
12
- // export const onAccelerometerChange = temporarilyNotSupport('onAccelerometerChange')
13
- // export const onCompassChange = temporarilyNotSupport('onCompassChange')
14
- // export const onDeviceMotionChange = temporarilyNotSupport('onDeviceMotionChange')
15
- export const onBluetoothAdapterStateChange = temporarilyNotSupport('onBluetoothAdapterStateChange')
16
- export const onBluetoothDeviceFound = temporarilyNotSupport('onBluetoothDeviceFound')
17
- export const onBLEConnectionStateChange = temporarilyNotSupport('onBLEConnectionStateChange')
18
- export const onBLECharacteristicValueChange = temporarilyNotSupport('onBLECharacteristicValueChange')
19
- export const onBeaconUpdate = temporarilyNotSupport('onBeaconUpdate')
20
- export const onBeaconServiceChange = temporarilyNotSupport('onBeaconServiceChange')
21
- export const onUserCaptureScreen = temporarilyNotSupport('onUserCaptureScreen')
22
- export const onHCEMessage = temporarilyNotSupport('onHCEMessage')
23
- export const onGetWifiList = temporarilyNotSupport('onGetWifiList')
24
- export const onWifiConnected = temporarilyNotSupport('onWifiConnected')
25
- // export const setStorageSync = temporarilyNotSupport('setStorageSync')
26
- // export const getStorageSync = temporarilyNotSupport('getStorageSync')
27
- // export const getStorageInfoSync = temporarilyNotSupport('getStorageInfoSync')
28
- // export const removeStorageSync = temporarilyNotSupport('removeStorageSync')
29
- // export const clearStorageSync = temporarilyNotSupport('clearStorageSync')
30
- // export const getSystemInfoSync = temporarilyNotSupport('getSystemInfoSync')
31
- export const getExtConfigSync = temporarilyNotSupport('getExtConfigSync')
32
- export const getLogManager = temporarilyNotSupport('getLogManager')
33
- export const onMemoryWarning = temporarilyNotSupport('onMemoryWarning')
34
- export const reportAnalytics = temporarilyNotSupport('reportAnalytics')
35
- export const navigateToSmartGameProgram = temporarilyNotSupport('navigateToSmartGameProgram')
36
-
37
- // 文件
38
- export const getFileSystemManager = temporarilyNotSupport('getFileSystemManager')
39
-
40
- // noPromiseApis
41
- // 媒体
42
- export const stopRecord = temporarilyNotSupport('stopRecord')
43
- export const getRecorderManager = temporarilyNotSupport('getRecorderManager')
44
- export const pauseVoice = temporarilyNotSupport('pauseVoice')
45
- export const stopVoice = temporarilyNotSupport('stopVoice')
46
- export const pauseBackgroundAudio = temporarilyNotSupport('pauseBackgroundAudio')
47
- export const stopBackgroundAudio = temporarilyNotSupport('stopBackgroundAudio')
48
- export const getBackgroundAudioManager = temporarilyNotSupport('getBackgroundAudioManager')
49
- export const createAudioContext = temporarilyNotSupport('createAudioContext')
50
- // export const createInnerAudioContext = temporarilyNotSupport('createInnerAudioContext')
51
- // export const createVideoContext = temporarilyNotSupport('createVideoContext')
52
- export const createCameraContext = temporarilyNotSupport('createCameraContext')
53
- export const createLivePlayerContext = temporarilyNotSupport('createLivePlayerContext')
54
- export const createLivePusherContext = temporarilyNotSupport('createLivePusherContext')
55
-
56
- // 位置
57
- export const createMapContext = temporarilyNotSupport('createMapContext')
58
-
59
- // 设备
60
- export const canIUse = temporarilyNotSupport('canIUse')
61
- // export const startAccelerometer = temporarilyNotSupport('startAccelerometer')
62
- // export const stopAccelerometer = temporarilyNotSupport('stopAccelerometer')
63
- // export const startCompass = temporarilyNotSupport('startCompass')
64
- // export const stopCompass = temporarilyNotSupport('stopCompass')
65
- // export const startDeviceMotionListening = temporarilyNotSupport('startDeviceMotionListening')
66
- // export const stopDeviceMotionListening = temporarilyNotSupport('stopDeviceMotionListening')
67
-
68
- // 界面
69
- // export const hideToast = temporarilyNotSupport('hideToast')
70
- // export const hideLoading = temporarilyNotSupport('hideLoading')
71
- export const hideHomeButton = temporarilyNotSupport('hideHomeButton')
72
- export const showNavigationBarLoading = temporarilyNotSupport('showNavigationBarLoading')
73
- export const hideNavigationBarLoading = temporarilyNotSupport('hideNavigationBarLoading')
74
- // export const createAnimation = temporarilyNotSupport('createAnimation')
75
- // export const pageScrollTo = temporarilyNotSupport('pageScrollTo')
76
- // export const createSelectorQuery = temporarilyNotSupport('createSelectorQuery')
77
- // export const createCanvasContext = temporarilyNotSupport('createCanvasContext')
78
- // export const createContext = temporarilyNotSupport('createContext')
79
- export const drawCanvas = temporarilyNotSupport('drawCanvas')
80
- export const hideKeyboard = temporarilyNotSupport('hideKeyboard')
81
- // export const stopPullDownRefresh = temporarilyNotSupport('stopPullDownRefresh')
82
- export const createIntersectionObserver = temporarilyNotSupport('createIntersectionObserver')
83
-
84
- // 自定义组件
85
- // export const nextTick = temporarilyNotSupport('nextTick')
86
-
87
- // 菜单
88
- export const getMenuButtonBoundingClientRect = temporarilyNotSupport('getMenuButtonBoundingClientRect')
89
-
90
- // 窗口
91
- // export const onWindowResize = temporarilyNotSupport('onWindowResize')
92
- // export const offWindowResize = temporarilyNotSupport('offWindowResize')
93
-
94
- // 拓展接口
95
- // export const arrayBufferToBase64 = temporarilyNotSupport('arrayBufferToBase64')
96
- // export const base64ToArrayBuffer = temporarilyNotSupport('base64ToArrayBuffer')
97
-
98
- export const getAccountInfoSync = temporarilyNotSupport('getAccountInfoSync')
99
- export const getUpdateManager = temporarilyNotSupport('getUpdateManager')
100
- export const createWorker = temporarilyNotSupport('createWorker')
101
-
102
- // otherApis
103
- // 网络
104
- // export const uploadFile = temporarilyNotSupport('uploadFile')
105
- // export const downloadFile = temporarilyNotSupport('downloadFile')
106
- // export const connectSocket = temporarilyNotSupport('connectSocket')
107
- // export const sendSocketMessage = temporarilyNotSupport('sendSocketMessage')
108
- // export const closeSocket = temporarilyNotSupport('closeSocket')
109
-
110
- // 媒体
111
- // export const chooseImage = temporarilyNotSupport('chooseImage')
112
- // export const previewImage = temporarilyNotSupport('previewImage')
113
- // export const getImageInfo = temporarilyNotSupport('getImageInfo')
114
- export const saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum')
115
- export const startRecord = temporarilyNotSupport('startRecord')
116
- export const playVoice = temporarilyNotSupport('playVoice')
117
- export const setInnerAudioOption = temporarilyNotSupport('setInnerAudioOption')
118
- export const getAvailableAudioSources = temporarilyNotSupport('getAvailableAudioSources')
119
- export const getBackgroundAudioPlayerState = temporarilyNotSupport('getBackgroundAudioPlayerState')
120
- export const playBackgroundAudio = temporarilyNotSupport('playBackgroundAudio')
121
- export const seekBackgroundAudio = temporarilyNotSupport('seekBackgroundAudio')
122
- // export const chooseVideo = temporarilyNotSupport('chooseVideo')
123
- export const saveVideoToPhotosAlbum = temporarilyNotSupport('saveVideoToPhotosAlbum')
124
- export const loadFontFace = temporarilyNotSupport('loadFontFace')
125
-
126
- // 文件
127
- export const saveFile = temporarilyNotSupport('saveFile')
128
- export const getFileInfo = temporarilyNotSupport('getFileInfo')
129
- export const getSavedFileList = temporarilyNotSupport('getSavedFileList')
130
- export const getSavedFileInfo = temporarilyNotSupport('getSavedFileInfo')
131
- export const removeSavedFile = temporarilyNotSupport('removeSavedFile')
132
- export const openDocument = temporarilyNotSupport('openDocument')
133
-
134
- // 数据缓存
135
- // export const setStorage = temporarilyNotSupport('setStorage')
136
- // export const getStorage = temporarilyNotSupport('getStorage')
137
- // export const getStorageInfo = temporarilyNotSupport('getStorageInfo')
138
- // export const removeStorage = temporarilyNotSupport('removeStorage')
139
- // export const clearStorage = temporarilyNotSupport('clearStorage')
140
-
141
- // 导航
142
- // export const navigateBack = temporarilyNotSupport('navigateBack')
143
- // export const navigateTo = temporarilyNotSupport('navigateTo')
144
- // export const redirectTo = temporarilyNotSupport('redirectTo')
145
- // export const switchTab = temporarilyNotSupport('switchTab')
146
- // export const reLaunch = temporarilyNotSupport('reLaunch')
147
-
148
- // 位置
149
- // export const getLocation = temporarilyNotSupport('getLocation')
150
- // export const chooseLocation = temporarilyNotSupport('chooseLocation')
151
- // export const openLocation = temporarilyNotSupport('openLocation')
152
-
153
- // 设备
154
- // export const getSystemInfo = temporarilyNotSupport('getSystemInfo')
155
- // export const getNetworkType = temporarilyNotSupport('getNetworkType')
156
- // export const makePhoneCall = temporarilyNotSupport('makePhoneCall')
157
- // export const scanCode = temporarilyNotSupport('scanCode')
158
- // export const setClipboardData = temporarilyNotSupport('setClipboardData')
159
- // export const getClipboardData = temporarilyNotSupport('getClipboardData')
160
- export const openBluetoothAdapter = temporarilyNotSupport('openBluetoothAdapter')
161
- export const closeBluetoothAdapter = temporarilyNotSupport('closeBluetoothAdapter')
162
- export const getBluetoothAdapterState = temporarilyNotSupport('getBluetoothAdapterState')
163
- export const startBluetoothDevicesDiscovery = temporarilyNotSupport('startBluetoothDevicesDiscovery')
164
- export const stopBluetoothDevicesDiscovery = temporarilyNotSupport('stopBluetoothDevicesDiscovery')
165
- export const getBluetoothDevices = temporarilyNotSupport('getBluetoothDevices')
166
- export const getConnectedBluetoothDevices = temporarilyNotSupport('getConnectedBluetoothDevices')
167
- export const createBLEConnection = temporarilyNotSupport('createBLEConnection')
168
- export const closeBLEConnection = temporarilyNotSupport('closeBLEConnection')
169
- export const getBLEDeviceServices = temporarilyNotSupport('getBLEDeviceServices')
170
- export const getBLEDeviceCharacteristics = temporarilyNotSupport('getBLEDeviceCharacteristics')
171
- export const readBLECharacteristicValue = temporarilyNotSupport('readBLECharacteristicValue')
172
- export const writeBLECharacteristicValue = temporarilyNotSupport('writeBLECharacteristicValue')
173
- export const notifyBLECharacteristicValueChange = temporarilyNotSupport('notifyBLECharacteristicValueChange')
174
- export const startBeaconDiscovery = temporarilyNotSupport('startBeaconDiscovery')
175
- export const stopBeaconDiscovery = temporarilyNotSupport('stopBeaconDiscovery')
176
- export const getBeacons = temporarilyNotSupport('getBeacons')
177
- export const setScreenBrightness = temporarilyNotSupport('setScreenBrightness')
178
- export const getScreenBrightness = temporarilyNotSupport('getScreenBrightness')
179
- export const setKeepScreenOn = temporarilyNotSupport('setKeepScreenOn')
180
- // export const vibrateLong = temporarilyNotSupport('vibrateLong')
181
- // export const vibrateShort = temporarilyNotSupport('vibrateShort')
182
- export const addPhoneContact = temporarilyNotSupport('addPhoneContact')
183
- export const getHCEState = temporarilyNotSupport('getHCEState')
184
- export const startHCE = temporarilyNotSupport('startHCE')
185
- export const stopHCE = temporarilyNotSupport('stopHCE')
186
- export const sendHCEMessage = temporarilyNotSupport('sendHCEMessage')
187
- export const startWifi = temporarilyNotSupport('startWifi')
188
- export const stopWifi = temporarilyNotSupport('stopWifi')
189
- export const connectWifi = temporarilyNotSupport('connectWifi')
190
- export const getWifiList = temporarilyNotSupport('getWifiList')
191
- export const setWifiList = temporarilyNotSupport('setWifiList')
192
- export const getConnectedWifi = temporarilyNotSupport('getConnectedWifi')
193
-
194
- // 界面
195
- // export const showToast = temporarilyNotSupport('showToast')
196
- // export const showLoading = temporarilyNotSupport('showLoading')
197
- // export const showModal = temporarilyNotSupport('showModal')
198
- // export const showActionSheet = temporarilyNotSupport('showActionSheet')
199
- // export const setNavigationBarTitle = temporarilyNotSupport('setNavigationBarTitle')
200
- // export const setNavigationBarColor = temporarilyNotSupport('setNavigationBarColor')
201
- // export const setTabBarBadge = temporarilyNotSupport('setTabBarBadge')
202
- // export const removeTabBarBadge = temporarilyNotSupport('removeTabBarBadge')
203
- // export const showTabBarRedDot = temporarilyNotSupport('showTabBarRedDot')
204
- // export const hideTabBarRedDot = temporarilyNotSupport('hideTabBarRedDot')
205
- // export const setTabBarStyle = temporarilyNotSupport('setTabBarStyle')
206
- // export const setTabBarItem = temporarilyNotSupport('setTabBarItem')
207
- // export const showTabBar = temporarilyNotSupport('showTabBar')
208
- // export const hideTabBar = temporarilyNotSupport('hideTabBar')
209
- export const setTopBarText = temporarilyNotSupport('setTopBarText')
210
- // export const startPullDownRefresh = temporarilyNotSupport('startPullDownRefresh')
211
- // export const canvasToTempFilePath = temporarilyNotSupport('canvasToTempFilePath')
212
- // export const canvasGetImageData = temporarilyNotSupport('canvasGetImageData')
213
- // export const canvasPutImageData = temporarilyNotSupport('canvasPutImageData')
214
-
215
- export const setBackgroundColor = temporarilyNotSupport('setBackgroundColor')
216
- export const setBackgroundTextStyle = temporarilyNotSupport('setBackgroundTextStyle')
217
-
218
- // 第三方平台
219
- export const getExtConfig = temporarilyNotSupport('getExtConfig')
220
-
221
- // 开放接口
222
- export const login = temporarilyNotSupport('login')
223
- export const checkSession = temporarilyNotSupport('checkSession')
224
- export const authorize = temporarilyNotSupport('authorize')
225
- export const getUserInfo = temporarilyNotSupport('getUserInfo')
226
- export const checkIsSupportFacialRecognition = temporarilyNotSupport('checkIsSupportFacialRecognition')
227
- export const startFacialRecognitionVerify = temporarilyNotSupport('startFacialRecognitionVerify')
228
- export const startFacialRecognitionVerifyAndUploadVideo = temporarilyNotSupport('startFacialRecognitionVerifyAndUploadVideo')
229
- export const faceVerifyForPay = temporarilyNotSupport('faceVerifyForPay')
230
- // export const requestPayment = temporarilyNotSupport('requestPayment')
231
- export const showShareMenu = temporarilyNotSupport('showShareMenu')
232
- export const hideShareMenu = temporarilyNotSupport('hideShareMenu')
233
- export const updateShareMenu = temporarilyNotSupport('updateShareMenu')
234
- export const getShareInfo = temporarilyNotSupport('getShareInfo')
235
- export const chooseAddress = temporarilyNotSupport('chooseAddress')
236
- export const addCard = temporarilyNotSupport('addCard')
237
- export const openCard = temporarilyNotSupport('openCard')
238
- export const openSetting = temporarilyNotSupport('openSetting')
239
- export const getSetting = temporarilyNotSupport('getSetting')
240
- export const getWeRunData = temporarilyNotSupport('getWeRunData')
241
- export const navigateToMiniProgram = temporarilyNotSupport('navigateToMiniProgram')
242
- export const navigateBackMiniProgram = temporarilyNotSupport('navigateBackMiniProgram')
243
- export const chooseInvoice = temporarilyNotSupport('chooseInvoice')
244
- export const chooseInvoiceTitle = temporarilyNotSupport('chooseInvoiceTitle')
245
- export const checkIsSupportSoterAuthentication = temporarilyNotSupport('checkIsSupportSoterAuthentication')
246
- export const startSoterAuthentication = temporarilyNotSupport('startSoterAuthentication')
247
- export const checkIsSoterEnrolledInDevice = temporarilyNotSupport('checkIsSoterEnrolledInDevice')
248
- export const exitMiniProgram = temporarilyNotSupport('exitMiniProgram')
249
-
250
- export const setEnableDebug = temporarilyNotSupport('setEnableDebug')
251
-
252
- // 百度小程序专有 API
253
- // 百度小程序 AI 相关
254
- export const ocrIdCard = temporarilyNotSupport('ocrIdCard')
255
- export const ocrBankCard = temporarilyNotSupport('ocrBankCard')
256
- export const ocrDrivingLicense = temporarilyNotSupport('ocrDrivingLicense')
257
- export const ocrVehicleLicense = temporarilyNotSupport('ocrVehicleLicense')
258
- export const textReview = temporarilyNotSupport('textReview')
259
- export const textToAudio = temporarilyNotSupport('textToAudio')
260
- export const imageAudit = temporarilyNotSupport('imageAudit')
261
- export const advancedGeneralIdentify = temporarilyNotSupport('advancedGeneralIdentify')
262
- export const objectDetectIdentify = temporarilyNotSupport('objectDetectIdentify')
263
- export const carClassify = temporarilyNotSupport('carClassify')
264
- export const dishClassify = temporarilyNotSupport('dishClassify')
265
- export const logoClassify = temporarilyNotSupport('logoClassify')
266
- export const animalClassify = temporarilyNotSupport('animalClassify')
267
- export const plantClassify = temporarilyNotSupport('plantClassify')
268
-
269
- // 用户信息
270
- export const getSwanId = temporarilyNotSupport('getSwanId')
271
-
272
- // 百度收银台支付
273
- export const requestPolymerPayment = temporarilyNotSupport('requestPolymerPayment')
274
-
275
- // 打开小程序
276
- export const navigateToSmartProgram = temporarilyNotSupport('navigateToSmartProgram')
277
- export const navigateBackSmartProgram = temporarilyNotSupport('navigateBackSmartProgram')
278
- export const preloadSubPackage = temporarilyNotSupport('preloadSubPackage')
@@ -1,49 +0,0 @@
1
- import { successHandler, errorHandler } from '../utils/index'
2
-
3
- const vibrator = function vibrator (mm) {
4
- try {
5
- return window.navigator.vibrate(mm)
6
- } catch (e) {
7
- console.warn('当前浏览器不支持vibrate')
8
- }
9
- }
10
-
11
- /**
12
- * 使手机发生较短时间的振动(15 ms)。仅在 iPhone 7 / 7 Plus 以上及 Android 机型生效
13
- * @param {Object} object 参数
14
- * @param {function} [object.success] 接口调用成功的回调函数
15
- * @param {function} [object.fail] 接口调用失败的回调函数
16
- * @param {function} [object.complete] 接口调用结束的回调函数(调用成功、失败都会执行)
17
- */
18
- export const vibrateShort = ({ success, fail, complete } = {}) => {
19
- if (vibrator) {
20
- vibrator(15)
21
- return successHandler(success, complete)({
22
- errMsg: 'vibrateShort:ok'
23
- })
24
- } else {
25
- return errorHandler(fail, complete)({
26
- errMsg: 'vibrateShort:fail'
27
- })
28
- }
29
- }
30
-
31
- /**
32
- * 使手机发生较长时间的振动(400 ms)
33
- * @param {Object} object 参数
34
- * @param {function} [object.success] 接口调用成功的回调函数
35
- * @param {function} [object.fail] 接口调用失败的回调函数
36
- * @param {function} [object.complete] 接口调用结束的回调函数(调用成功、失败都会执行)
37
- */
38
- export const vibrateLong = ({ success, fail, complete } = {}) => {
39
- if (vibrator) {
40
- vibrator(400)
41
- return successHandler(success, complete)({
42
- errMsg: 'vibrateLong:ok'
43
- })
44
- } else {
45
- return errorHandler(fail, complete)({
46
- errMsg: 'vibrateLong:fail'
47
- })
48
- }
49
- }
@@ -1,87 +0,0 @@
1
- import { shouldBeObject, getParameterError, findDOM } from '../utils'
2
-
3
- /**
4
- * @typedef {Object} ChooseVideoParam
5
- * @property {Array.<string>} [sourceType=['album', 'camera']] 视频选择的来源
6
- * @property {boolean} [compressed=true] 是否压缩所选择的视频文件
7
- * @property {number} [maxDuration=60] 拍摄视频最长拍摄时间,单位秒
8
- * @property {string} [camera=back] 默认拉起的是前置或者后置摄像头。部分 Android 手机下由于系统 ROM 不支持无法生效
9
- * @property {function} [success] 接口调用成功的回调函数
10
- * @property {function} [fail] 接口调用失败的回调函数
11
- * @property {function} [complete] 接口调用结束的回调函数(调用成功、失败都会执行)
12
- */
13
-
14
- /**
15
- * 拍摄视频或从手机相册中选视频。
16
- * @param {ChooseVideoParam} options
17
- */
18
- export function chooseVideo (options) {
19
- // options must be an Object
20
-
21
- const isObject = shouldBeObject(options)
22
- if (!isObject.res) {
23
- const res = { errMsg: `chooseVideo${isObject.msg}` }
24
- console.error(res.errMsg)
25
- return Promise.reject(res)
26
- }
27
-
28
- const { count = 1, success, fail, complete } = options
29
- const res = {
30
- errMsg: 'chooseVideo:ok',
31
- tempFilePaths: [],
32
- tempFiles: []
33
- }
34
-
35
- if (count && typeof count !== 'number') {
36
- res.errMsg = getParameterError({
37
- name: 'chooseVideo',
38
- para: 'count',
39
- correct: 'Number',
40
- wrong: count
41
- })
42
- console.error(res.errMsg)
43
- typeof fail === 'function' && fail(res)
44
- typeof complete === 'function' && complete(res)
45
- return Promise.reject(res)
46
- }
47
-
48
- const taroChooseVideo = document.createElement('input')
49
- taroChooseVideo.setAttribute('type', 'file')
50
- taroChooseVideo.setAttribute('multiple', 'multiple')
51
- taroChooseVideo.setAttribute('accept', 'video/*')
52
- taroChooseVideo.setAttribute('style', 'position: fixed; top: -4000px; left: -3000px; z-index: -300;')
53
- document.body.appendChild(taroChooseVideo)
54
-
55
- let taroChooseVideoCallback
56
- const taroChooseVideoPromise = new Promise(resolve => {
57
- taroChooseVideoCallback = resolve
58
- })
59
- const TaroMouseEvents = document.createEvent('MouseEvents')
60
- TaroMouseEvents.initEvent('click', true, true)
61
- taroChooseVideo.dispatchEvent(TaroMouseEvents)
62
- taroChooseVideo.onchange = function (e) {
63
- const arr = [...e.target.files]
64
- arr && arr.forEach(item => {
65
- const blob = new Blob([item])
66
- const url = URL.createObjectURL(blob)
67
- res.tempFilePaths.push(url)
68
- res.tempFiles.push({ path: url, size: item.size, type: item.type })
69
- })
70
- typeof success === 'function' && success(res)
71
- typeof complete === 'function' && complete(res)
72
- taroChooseVideoCallback(res)
73
- }
74
- taroChooseVideoPromise.finally(() => {
75
- document.body.removeChild(taroChooseVideo)
76
- })
77
- return taroChooseVideoPromise
78
- }
79
-
80
- /**
81
- * 创建 video 上下文 VideoContext 对象。
82
- * @param {string} id <video> 组件的 id
83
- */
84
- export function createVideoContext (id, inst) {
85
- /** @type {HTMLVideoElement} */
86
- return findDOM(inst).querySelector(`taro-video-core[id=${id}]`)
87
- }
@@ -1,103 +0,0 @@
1
- import SocketTask from './socketTask'
2
- import { shouldBeObject, getParameterError } from '../utils'
3
-
4
- let socketTasks = []
5
- let socketsCounter = 1
6
-
7
- function connectSocket (options) {
8
- const name = 'connectSocket'
9
-
10
- return new Promise((resolve, reject) => {
11
- // options must be an Object
12
- const isObject = shouldBeObject(options)
13
- if (!isObject.res) {
14
- const res = { errMsg: `${name}${isObject.msg}` }
15
- console.error(res.errMsg)
16
- return reject(res)
17
- }
18
-
19
- const { url, protocols, success, fail, complete } = options
20
- const res = { errMsg: 'connectSocket:ok' }
21
-
22
- // options.url must be String
23
- if (typeof url !== 'string') {
24
- res.errMsg = getParameterError({
25
- name,
26
- para: 'url',
27
- correct: 'String',
28
- wrong: url
29
- })
30
- console.error(res.errMsg)
31
- typeof fail === 'function' && fail(res)
32
- typeof complete === 'function' && complete(res)
33
- return reject(res)
34
- }
35
-
36
- // options.url must be invalid
37
- if (!url.startsWith('ws://') && !url.startsWith('wss://')) {
38
- res.errMsg = `request:fail invalid url "${url}"`
39
- console.error(res.errMsg)
40
- typeof fail === 'function' && fail(res)
41
- typeof complete === 'function' && complete(res)
42
- return reject(res)
43
- }
44
-
45
- // protocols must be array
46
- const _protocols = Array.isArray(protocols) ? protocols : null
47
-
48
- // 2 connection at most
49
- if (socketTasks.length > 1) {
50
- res.errMsg = '同时最多发起 2 个 socket 请求,更多请参考文档。'
51
- console.error(res.errMsg)
52
- typeof fail === 'function' && fail(res)
53
- typeof complete === 'function' && complete(res)
54
- return reject(res)
55
- }
56
-
57
- const task = new SocketTask(url, _protocols)
58
- task._destroyWhenClose = function () {
59
- socketTasks = socketTasks.filter(socketTask => socketTask !== this)
60
- }
61
- socketTasks.push(task)
62
-
63
- res.socketTaskId = socketsCounter++
64
- typeof success === 'function' && success(res)
65
- typeof complete === 'function' && complete(res)
66
-
67
- return resolve(task)
68
- })
69
- }
70
-
71
- function onSocketOpen () {
72
- console.warn('Deprecated.Please use socketTask.onOpen instead.')
73
- }
74
-
75
- function onSocketError () {
76
- console.warn('Deprecated.Please use socketTask.onError instead.')
77
- }
78
-
79
- function sendSocketMessage () {
80
- console.warn('Deprecated.Please use socketTask.send instead.')
81
- }
82
-
83
- function onSocketMessage () {
84
- console.warn('Deprecated.Please use socketTask.onMessage instead.')
85
- }
86
-
87
- function closeSocket () {
88
- console.warn('Deprecated.Please use socketTask.close instead.')
89
- }
90
-
91
- function onSocketClose () {
92
- console.warn('Deprecated.Please use socketTask.onClose instead.')
93
- }
94
-
95
- export {
96
- connectSocket,
97
- onSocketOpen,
98
- onSocketError,
99
- sendSocketMessage,
100
- onSocketMessage,
101
- closeSocket,
102
- onSocketClose
103
- }
@@ -1,38 +0,0 @@
1
- import { createCallbackManager } from '../utils/index'
2
-
3
- const callbackManager = createCallbackManager()
4
-
5
- const resizeListener = () => {
6
- callbackManager.trigger({
7
- windowWidth: window.screen.width,
8
- windowHeight: window.screen.height
9
- })
10
- }
11
-
12
- /**
13
- * @typedef {Object} WindowResizeParam
14
- * @property {number} windowWidth 变化后的窗口宽度,单位 px
15
- * @property {number} windowHeight 变化后的窗口高度,单位 px
16
- */
17
-
18
- /**
19
- * 监听窗口尺寸变化事件
20
- * @param {(size: WindowResizeParam) => void} callback 窗口尺寸变化事件的回调函数
21
- */
22
- export const onWindowResize = callback => {
23
- callbackManager.add(callback)
24
- if (callbackManager.count() === 1) {
25
- window.addEventListener('resize', resizeListener)
26
- }
27
- }
28
-
29
- /**
30
- * 取消监听窗口尺寸变化事件
31
- * @param {(size: WindowResizeParam) => void} callback 窗口尺寸变化事件的回调函数
32
- */
33
- export const offWindowResize = callback => {
34
- callbackManager.remove(callback)
35
- if (callbackManager.count() === 0) {
36
- window.removeEventListener('resize', resizeListener)
37
- }
38
- }
package/src/index.cjs.js DELETED
@@ -1,11 +0,0 @@
1
- /* 这个入口提供给使用require的用户 */
2
-
3
- import Taro from './taro/index'
4
- import * as TaroApis from './api/index'
5
-
6
- export * from './taro/index'
7
- export * from './api/index'
8
-
9
- Object.assign(Taro, TaroApis)
10
-
11
- export default Taro
package/src/index.js DELETED
@@ -1,6 +0,0 @@
1
- import Taro from './taro/index'
2
-
3
- export * from './api/index'
4
-
5
- export default Taro
6
- export * from './taro/index'