@tarojs/taro-h5 3.6.0-beta.2 → 3.6.0-beta.4
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/api/ad/index.d.ts +3 -2
- package/dist/api/ad/index.js +7 -3
- package/dist/api/ad/index.js.map +1 -0
- package/dist/api/ai/facial.d.ts +4 -3
- package/dist/api/ai/facial.js +8 -4
- package/dist/api/ai/facial.js.map +1 -0
- package/dist/api/ai/index.d.ts +2 -2
- package/dist/api/ai/index.js +3 -2
- package/dist/api/ai/index.js.map +1 -0
- package/dist/api/ai/visual.d.ts +3 -2
- package/dist/api/ai/visual.js +7 -3
- package/dist/api/ai/visual.js.map +1 -0
- package/dist/api/alipay/index.d.ts +2 -1
- package/dist/api/alipay/index.js +6 -2
- package/dist/api/alipay/index.js.map +1 -0
- package/dist/api/base/crypto.d.ts +2 -1
- package/dist/api/base/crypto.js +6 -2
- package/dist/api/base/crypto.js.map +1 -0
- package/dist/api/base/debug.d.ts +4 -3
- package/dist/api/base/debug.js +8 -4
- package/dist/api/base/debug.js.map +1 -0
- package/dist/api/base/index.d.ts +16 -10
- package/dist/api/base/index.js +20 -12
- package/dist/api/base/index.js.map +1 -0
- package/dist/api/base/performance.d.ts +3 -2
- package/dist/api/base/performance.js +7 -3
- package/dist/api/base/performance.js.map +1 -0
- package/dist/api/base/system.d.ts +11 -10
- package/dist/api/base/system.js +17 -21
- package/dist/api/base/system.js.map +1 -0
- package/dist/api/base/update.d.ts +3 -2
- package/dist/api/base/update.js +7 -3
- package/dist/api/base/update.js.map +1 -0
- package/dist/api/base/weapp/app-event.d.ts +17 -16
- package/dist/api/base/weapp/app-event.js +22 -18
- package/dist/api/base/weapp/app-event.js.map +1 -0
- package/dist/api/base/weapp/life-cycle.d.ts +3 -2
- package/dist/api/base/weapp/life-cycle.js +6 -2
- package/dist/api/base/weapp/life-cycle.js.map +1 -0
- package/dist/api/canvas/CanvasContext.d.ts +7 -2
- package/dist/api/canvas/CanvasContext.js +6 -10
- package/dist/api/canvas/CanvasContext.js.map +1 -0
- package/dist/api/canvas/canvasGetImageData.d.ts +2 -1
- package/dist/api/canvas/canvasGetImageData.js +7 -3
- package/dist/api/canvas/canvasGetImageData.js.map +1 -0
- package/dist/api/canvas/canvasPutImageData.d.ts +2 -1
- package/dist/api/canvas/canvasPutImageData.js +7 -3
- package/dist/api/canvas/canvasPutImageData.js.map +1 -0
- package/dist/api/canvas/canvasToTempFilePath.d.ts +2 -1
- package/dist/api/canvas/canvasToTempFilePath.js +7 -3
- package/dist/api/canvas/canvasToTempFilePath.js.map +1 -0
- package/dist/api/canvas/createCanvasContext.d.ts +2 -1
- package/dist/api/canvas/createCanvasContext.js +7 -3
- package/dist/api/canvas/createCanvasContext.js.map +1 -0
- package/dist/api/canvas/index.d.ts +6 -5
- package/dist/api/canvas/index.js +10 -10
- package/dist/api/canvas/index.js.map +1 -0
- package/dist/api/cloud/index.d.ts +2 -1
- package/dist/api/cloud/index.js +6 -2
- package/dist/api/cloud/index.js.map +1 -0
- package/dist/api/data-analysis/index.d.ts +5 -4
- package/dist/api/data-analysis/index.js +9 -5
- package/dist/api/data-analysis/index.js.map +1 -0
- package/dist/api/device/accelerometer.d.ts +5 -4
- package/dist/api/device/accelerometer.js +11 -6
- package/dist/api/device/accelerometer.js.map +1 -0
- package/dist/api/device/accessibility.d.ts +2 -1
- package/dist/api/device/accessibility.js +6 -2
- package/dist/api/device/accessibility.js.map +1 -0
- package/dist/api/device/battery.d.ts +3 -2
- package/dist/api/device/battery.js +9 -13
- package/dist/api/device/battery.js.map +1 -0
- package/dist/api/device/bluetooth-ble.d.ts +17 -16
- package/dist/api/device/bluetooth-ble.js +21 -17
- package/dist/api/device/bluetooth-ble.js.map +1 -0
- package/dist/api/device/bluetooth-peripheral.d.ts +4 -3
- package/dist/api/device/bluetooth-peripheral.js +8 -4
- package/dist/api/device/bluetooth-peripheral.js.map +1 -0
- package/dist/api/device/bluetooth.d.ts +14 -13
- package/dist/api/device/bluetooth.js +18 -14
- package/dist/api/device/bluetooth.js.map +1 -0
- package/dist/api/device/calendar.d.ts +3 -2
- package/dist/api/device/calendar.js +7 -3
- package/dist/api/device/calendar.js.map +1 -0
- package/dist/api/device/clipboard.d.ts +3 -2
- package/dist/api/device/clipboard.js +10 -14
- package/dist/api/device/clipboard.js.map +1 -0
- package/dist/api/device/compass.d.ts +5 -4
- package/dist/api/device/compass.js +12 -7
- package/dist/api/device/compass.js.map +1 -0
- package/dist/api/device/contact.d.ts +3 -2
- package/dist/api/device/contact.js +7 -3
- package/dist/api/device/contact.js.map +1 -0
- package/dist/api/device/crypto.d.ts +2 -1
- package/dist/api/device/crypto.js +6 -2
- package/dist/api/device/crypto.js.map +1 -0
- package/dist/api/device/gyroscope.d.ts +5 -4
- package/dist/api/device/gyroscope.js +9 -5
- package/dist/api/device/gyroscope.js.map +1 -0
- package/dist/api/device/iBeacon.d.ts +8 -7
- package/dist/api/device/iBeacon.js +12 -8
- package/dist/api/device/iBeacon.js.map +1 -0
- package/dist/api/device/index.d.ts +23 -23
- package/dist/api/device/index.js +24 -23
- package/dist/api/device/index.js.map +1 -0
- package/dist/api/device/keyboard.d.ts +5 -4
- package/dist/api/device/keyboard.js +9 -5
- package/dist/api/device/keyboard.js.map +1 -0
- package/dist/api/device/memory.d.ts +3 -2
- package/dist/api/device/memory.js +7 -3
- package/dist/api/device/memory.js.map +1 -0
- package/dist/api/device/motion.d.ts +5 -4
- package/dist/api/device/motion.js +11 -6
- package/dist/api/device/motion.js.map +1 -0
- package/dist/api/device/network.d.ts +7 -6
- package/dist/api/device/network.js +13 -17
- package/dist/api/device/network.js.map +1 -0
- package/dist/api/device/nfc.d.ts +8 -7
- package/dist/api/device/nfc.js +12 -8
- package/dist/api/device/nfc.js.map +1 -0
- package/dist/api/device/phone.d.ts +2 -1
- package/dist/api/device/phone.js +7 -3
- package/dist/api/device/phone.js.map +1 -0
- package/dist/api/device/scan.d.ts +2 -1
- package/dist/api/device/scan.js +6 -2
- package/dist/api/device/scan.js.map +1 -0
- package/dist/api/device/screen.d.ts +7 -6
- package/dist/api/device/screen.js +11 -7
- package/dist/api/device/screen.js.map +1 -0
- package/dist/api/device/vibrate.d.ts +3 -2
- package/dist/api/device/vibrate.js +7 -3
- package/dist/api/device/vibrate.js.map +1 -0
- package/dist/api/device/wifi.d.ts +12 -11
- package/dist/api/device/wifi.js +16 -12
- package/dist/api/device/wifi.js.map +1 -0
- package/dist/api/ext/index.d.ts +3 -2
- package/dist/api/ext/index.js +7 -3
- package/dist/api/ext/index.js.map +1 -0
- package/dist/api/files/index.d.ts +9 -8
- package/dist/api/files/index.js +13 -9
- package/dist/api/files/index.js.map +1 -0
- package/dist/api/framework/index.d.ts +3 -2
- package/dist/api/framework/index.js +7 -3
- package/dist/api/framework/index.js.map +1 -0
- package/dist/api/index.d.ts +24 -24
- package/dist/api/index.js +117 -24
- package/dist/api/index.js.map +1 -0
- package/dist/api/location/chooseLocation.d.ts +2 -2
- package/dist/api/location/chooseLocation.js +8 -14
- package/dist/api/location/chooseLocation.js.map +1 -0
- package/dist/api/location/getLocation.d.ts +2 -1
- package/dist/api/location/getLocation.js +7 -3
- package/dist/api/location/getLocation.js.map +1 -0
- package/dist/api/location/index.d.ts +13 -12
- package/dist/api/location/index.js +17 -13
- package/dist/api/location/index.js.map +1 -0
- package/dist/api/location/style.scss.js +8 -0
- package/dist/api/location/style.scss.js.map +1 -0
- package/dist/api/media/audio/InnerAudioContext.d.ts +3 -2
- package/dist/api/media/audio/InnerAudioContext.js +7 -3
- package/dist/api/media/audio/InnerAudioContext.js.map +1 -0
- package/dist/api/media/audio/index.d.ts +10 -9
- package/dist/api/media/audio/index.js +15 -11
- package/dist/api/media/audio/index.js.map +1 -0
- package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +3 -2
- package/dist/api/media/background-audio/BackgroundAudioManager.js +7 -3
- package/dist/api/media/background-audio/BackgroundAudioManager.js.map +1 -0
- package/dist/api/media/background-audio/index.d.ts +11 -10
- package/dist/api/media/background-audio/index.js +15 -11
- package/dist/api/media/background-audio/index.js.map +1 -0
- package/dist/api/media/camera.d.ts +2 -1
- package/dist/api/media/camera.js +6 -2
- package/dist/api/media/camera.js.map +1 -0
- package/dist/api/media/image/chooseImage.d.ts +2 -1
- package/dist/api/media/image/chooseImage.js +7 -3
- package/dist/api/media/image/chooseImage.js.map +1 -0
- package/dist/api/media/image/getImageInfo.d.ts +2 -1
- package/dist/api/media/image/getImageInfo.js +7 -3
- package/dist/api/media/image/getImageInfo.js.map +1 -0
- package/dist/api/media/image/index.d.ts +8 -7
- package/dist/api/media/image/index.js +12 -8
- package/dist/api/media/image/index.js.map +1 -0
- package/dist/api/media/image/previewImage.d.ts +2 -1
- package/dist/api/media/image/previewImage.js +15 -12
- package/dist/api/media/image/previewImage.js.map +1 -0
- package/dist/api/media/index.d.ts +12 -12
- package/dist/api/media/index.js +13 -12
- package/dist/api/media/index.js.map +1 -0
- package/dist/api/media/live.d.ts +3 -2
- package/dist/api/media/live.js +7 -3
- package/dist/api/media/live.js.map +1 -0
- package/dist/api/media/map.d.ts +2 -1
- package/dist/api/media/map.js +6 -2
- package/dist/api/media/map.js.map +1 -0
- package/dist/api/media/media-recorder.d.ts +2 -1
- package/dist/api/media/media-recorder.js +6 -2
- package/dist/api/media/media-recorder.js.map +1 -0
- package/dist/api/media/recorder.d.ts +4 -3
- package/dist/api/media/recorder.js +8 -4
- package/dist/api/media/recorder.js.map +1 -0
- package/dist/api/media/video/index.d.ts +8 -7
- package/dist/api/media/video/index.js +13 -9
- package/dist/api/media/video/index.js.map +1 -0
- package/dist/api/media/video-decoder.d.ts +2 -1
- package/dist/api/media/video-decoder.js +6 -2
- package/dist/api/media/video-decoder.js.map +1 -0
- package/dist/api/media/video-processing.d.ts +2 -1
- package/dist/api/media/video-processing.js +6 -2
- package/dist/api/media/video-processing.js.map +1 -0
- package/dist/api/media/voip.d.ts +15 -14
- package/dist/api/media/voip.js +19 -15
- package/dist/api/media/voip.js.map +1 -0
- package/dist/api/navigate/index.d.ts +6 -5
- package/dist/api/navigate/index.js +10 -6
- package/dist/api/navigate/index.js.map +1 -0
- package/dist/api/network/download.d.ts +2 -1
- package/dist/api/network/download.js +14 -5
- package/dist/api/network/download.js.map +1 -0
- package/dist/api/network/index.d.ts +7 -7
- package/dist/api/network/index.js +8 -7
- package/dist/api/network/index.js.map +1 -0
- package/dist/api/network/mdns.d.ts +11 -10
- package/dist/api/network/mdns.js +15 -11
- package/dist/api/network/mdns.js.map +1 -0
- package/dist/api/network/request/index.d.ts +3 -3
- package/dist/api/network/request/index.js +8 -4
- package/dist/api/network/request/index.js.map +1 -0
- package/dist/api/network/tcp.d.ts +2 -1
- package/dist/api/network/tcp.js +6 -2
- package/dist/api/network/tcp.js.map +1 -0
- package/dist/api/network/udp.d.ts +2 -1
- package/dist/api/network/udp.js +6 -2
- package/dist/api/network/udp.js.map +1 -0
- package/dist/api/network/upload.d.ts +2 -1
- package/dist/api/network/upload.js +14 -5
- package/dist/api/network/upload.js.map +1 -0
- package/dist/api/network/utils.d.ts +5 -4
- package/dist/api/network/utils.js +7 -4
- package/dist/api/network/utils.js.map +1 -0
- package/dist/api/network/websocket/index.d.ts +8 -7
- package/dist/api/network/websocket/index.js +14 -10
- package/dist/api/network/websocket/index.js.map +1 -0
- package/dist/api/network/websocket/socketTask.d.ts +2 -1
- package/dist/api/network/websocket/socketTask.js +5 -1
- package/dist/api/network/websocket/socketTask.js.map +1 -0
- package/dist/api/open-api/account.d.ts +2 -1
- package/dist/api/open-api/account.js +6 -2
- package/dist/api/open-api/account.js.map +1 -0
- package/dist/api/open-api/address.d.ts +2 -1
- package/dist/api/open-api/address.js +6 -2
- package/dist/api/open-api/address.js.map +1 -0
- package/dist/api/open-api/authorize.d.ts +3 -2
- package/dist/api/open-api/authorize.js +7 -3
- package/dist/api/open-api/authorize.js.map +1 -0
- package/dist/api/open-api/card.d.ts +3 -2
- package/dist/api/open-api/card.js +7 -3
- package/dist/api/open-api/card.js.map +1 -0
- package/dist/api/open-api/channels-live.d.ts +7 -6
- package/dist/api/open-api/channels-live.js +11 -7
- package/dist/api/open-api/channels-live.js.map +1 -0
- package/dist/api/open-api/customer-service.d.ts +2 -1
- package/dist/api/open-api/customer-service.js +6 -2
- package/dist/api/open-api/customer-service.js.map +1 -0
- package/dist/api/open-api/facial.d.ts +5 -4
- package/dist/api/open-api/facial.js +9 -5
- package/dist/api/open-api/facial.js.map +1 -0
- package/dist/api/open-api/favorites.d.ts +3 -2
- package/dist/api/open-api/favorites.js +7 -3
- package/dist/api/open-api/favorites.js.map +1 -0
- package/dist/api/open-api/group.d.ts +2 -1
- package/dist/api/open-api/group.js +6 -2
- package/dist/api/open-api/group.js.map +1 -0
- package/dist/api/open-api/index.d.ts +18 -18
- package/dist/api/open-api/index.js +19 -18
- package/dist/api/open-api/index.js.map +1 -0
- package/dist/api/open-api/invoice.d.ts +3 -2
- package/dist/api/open-api/invoice.js +7 -3
- package/dist/api/open-api/invoice.js.map +1 -0
- package/dist/api/open-api/license-plate.d.ts +2 -1
- package/dist/api/open-api/license-plate.js +6 -2
- package/dist/api/open-api/license-plate.js.map +1 -0
- package/dist/api/open-api/login.d.ts +4 -3
- package/dist/api/open-api/login.js +8 -4
- package/dist/api/open-api/login.js.map +1 -0
- package/dist/api/open-api/red-package.d.ts +2 -1
- package/dist/api/open-api/red-package.js +6 -2
- package/dist/api/open-api/red-package.js.map +1 -0
- package/dist/api/open-api/settings.d.ts +3 -2
- package/dist/api/open-api/settings.js +7 -3
- package/dist/api/open-api/settings.js.map +1 -0
- package/dist/api/open-api/soter.d.ts +4 -3
- package/dist/api/open-api/soter.js +8 -4
- package/dist/api/open-api/soter.js.map +1 -0
- package/dist/api/open-api/subscribe-message.d.ts +2 -1
- package/dist/api/open-api/subscribe-message.js +6 -2
- package/dist/api/open-api/subscribe-message.js.map +1 -0
- package/dist/api/open-api/user-info.d.ts +3 -2
- package/dist/api/open-api/user-info.js +7 -3
- package/dist/api/open-api/user-info.js.map +1 -0
- package/dist/api/open-api/werun.d.ts +3 -2
- package/dist/api/open-api/werun.js +7 -3
- package/dist/api/open-api/werun.js.map +1 -0
- package/dist/api/payment/index.d.ts +3 -2
- package/dist/api/payment/index.js +7 -3
- package/dist/api/payment/index.js.map +1 -0
- package/dist/api/route/index.js +3 -1
- package/dist/api/route/index.js.map +1 -0
- package/dist/api/share/index.d.ts +11 -10
- package/dist/api/share/index.js +15 -11
- package/dist/api/share/index.js.map +1 -0
- package/dist/api/storage/background-fetch.d.ts +5 -4
- package/dist/api/storage/background-fetch.js +9 -5
- package/dist/api/storage/background-fetch.js.map +1 -0
- package/dist/api/storage/index.d.ts +14 -13
- package/dist/api/storage/index.js +19 -15
- package/dist/api/storage/index.js.map +1 -0
- package/dist/api/swan/index.d.ts +22 -21
- package/dist/api/swan/index.js +26 -22
- package/dist/api/swan/index.js.map +1 -0
- package/dist/api/taro.d.ts +1 -2
- package/dist/api/taro.js +17 -12
- package/dist/api/taro.js.map +1 -0
- package/dist/api/ui/animation/index.d.ts +2 -1
- package/dist/api/ui/animation/index.js +4 -1
- package/dist/api/ui/animation/index.js.map +1 -0
- package/dist/api/ui/background.d.ts +3 -2
- package/dist/api/ui/background.js +7 -3
- package/dist/api/ui/background.js.map +1 -0
- package/dist/api/ui/custom-component.d.ts +2 -1
- package/dist/api/ui/custom-component.js +5 -1
- package/dist/api/ui/custom-component.js.map +1 -0
- package/dist/api/ui/fonts.d.ts +2 -1
- package/dist/api/ui/fonts.js +7 -11
- package/dist/api/ui/fonts.js.map +1 -0
- package/dist/api/ui/index.d.ts +12 -12
- package/dist/api/ui/index.js +13 -12
- package/dist/api/ui/index.js.map +1 -0
- package/dist/api/ui/interaction/actionSheet.d.ts +2 -1
- package/dist/api/ui/interaction/actionSheet.js +6 -2
- package/dist/api/ui/interaction/actionSheet.js.map +1 -0
- package/dist/api/ui/interaction/index.js +9 -14
- package/dist/api/ui/interaction/index.js.map +1 -0
- package/dist/api/ui/interaction/modal.d.ts +2 -1
- package/dist/api/ui/interaction/modal.js +8 -4
- package/dist/api/ui/interaction/modal.js.map +1 -0
- package/dist/api/ui/interaction/toast.d.ts +2 -1
- package/dist/api/ui/interaction/toast.js +8 -4
- package/dist/api/ui/interaction/toast.js.map +1 -0
- package/dist/api/ui/menu.d.ts +2 -1
- package/dist/api/ui/menu.js +6 -2
- package/dist/api/ui/menu.js.map +1 -0
- package/dist/api/ui/navigation-bar/index.d.ts +6 -5
- package/dist/api/ui/navigation-bar/index.js +11 -7
- package/dist/api/ui/navigation-bar/index.js.map +1 -0
- package/dist/api/ui/pull-down-refresh.d.ts +3 -2
- package/dist/api/ui/pull-down-refresh.js +7 -3
- package/dist/api/ui/pull-down-refresh.js.map +1 -0
- package/dist/api/ui/scroll/index.d.ts +2 -1
- package/dist/api/ui/scroll/index.js +8 -3
- package/dist/api/ui/scroll/index.js.map +1 -0
- package/dist/api/ui/sticky.d.ts +2 -1
- package/dist/api/ui/sticky.js +6 -2
- package/dist/api/ui/sticky.js.map +1 -0
- package/dist/api/ui/tab-bar.d.ts +12 -10
- package/dist/api/ui/tab-bar.js +16 -11
- package/dist/api/ui/tab-bar.js.map +1 -0
- package/dist/api/ui/window.d.ts +4 -3
- package/dist/api/ui/window.js +9 -5
- package/dist/api/ui/window.js.map +1 -0
- package/dist/api/worker/index.d.ts +2 -1
- package/dist/api/worker/index.js +6 -2
- package/dist/api/worker/index.js.map +1 -0
- package/dist/api/wxml/IntersectionObserver.d.ts +3 -3
- package/dist/api/wxml/IntersectionObserver.js +6 -2
- package/dist/api/wxml/IntersectionObserver.js.map +1 -0
- package/dist/api/wxml/MediaQueryObserver.d.ts +4 -1
- package/dist/api/wxml/MediaQueryObserver.js +6 -2
- package/dist/api/wxml/MediaQueryObserver.js.map +1 -0
- package/dist/api/wxml/index.d.ts +4 -3
- package/dist/api/wxml/index.js +10 -6
- package/dist/api/wxml/index.js.map +1 -0
- package/dist/api/wxml/nodesRef.d.ts +3 -2
- package/dist/api/wxml/nodesRef.js +4 -1
- package/dist/api/wxml/nodesRef.js.map +1 -0
- package/dist/api/wxml/selectorQuery.d.ts +4 -4
- package/dist/api/wxml/selectorQuery.js +8 -4
- package/dist/api/wxml/selectorQuery.js.map +1 -0
- package/dist/index.cjs.d.ts +8 -4
- package/dist/index.cjs.js +51 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.d.ts +8 -4
- package/dist/index.esm.js +52 -40
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +113 -4
- package/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/registry.npmjs.org_style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +29 -0
- package/dist/node_modules/.pnpm/registry.npmjs.org_style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/node_modules/.pnpm/registry.npmjs.org_tslib@1.14.1/node_modules/tslib/tslib.es6.js +221 -0
- package/dist/node_modules/.pnpm/registry.npmjs.org_tslib@1.14.1/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/utils/animation.d.ts +3 -2
- package/dist/utils/animation.js +5 -2
- package/dist/utils/animation.js.map +1 -0
- package/dist/utils/handler.d.ts +7 -7
- package/dist/utils/handler.js +6 -2
- package/dist/utils/handler.js.map +1 -0
- package/dist/utils/index.d.ts +17 -16
- package/dist/utils/index.js +32 -37
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/lodash.d.ts +3 -2
- package/dist/utils/lodash.js +5 -2
- package/dist/utils/lodash.js.map +1 -0
- package/dist/utils/valid.d.ts +2 -1
- package/dist/utils/valid.js +4 -1
- package/dist/utils/valid.js.map +1 -0
- package/package.json +9 -9
- package/types/define.d.ts +2 -0
- package/dist/api/location/style.css +0 -79
- package/dist/api/media/EditorContext.d.ts +0 -16
- package/dist/api/media/EditorContext.js +0 -19
- package/dist/taroApis.d.ts +0 -754
- package/dist/taroApis.js +0 -2
- package/dist/taroApis.js.map +0 -1
package/dist/utils/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
/* eslint-disable prefer-promise-reject-errors */
|
|
2
1
|
import Taro from '@tarojs/api';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { getCurrentPage, getHomePage } from '@tarojs/router/dist/utils';
|
|
3
|
+
import { hooks, Current } from '@tarojs/runtime';
|
|
5
4
|
import { isFunction } from '@tarojs/shared';
|
|
6
|
-
import { MethodHandler } from './handler';
|
|
7
|
-
export
|
|
5
|
+
import { MethodHandler } from './handler.js';
|
|
6
|
+
export { easeInOut, getTimingFunc } from './animation.js';
|
|
7
|
+
export { debounce, throttle } from './lodash.js';
|
|
8
|
+
export { isValidColor } from './valid.js';
|
|
9
|
+
|
|
10
|
+
/* eslint-disable prefer-promise-reject-errors */
|
|
11
|
+
function shouldBeObject(target) {
|
|
8
12
|
if (target && typeof target === 'object')
|
|
9
13
|
return { flag: true };
|
|
10
14
|
return {
|
|
@@ -15,7 +19,7 @@ export function shouldBeObject(target) {
|
|
|
15
19
|
})
|
|
16
20
|
};
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
function findDOM(inst) {
|
|
19
23
|
if (inst && hooks.isExist('getDOMNode')) {
|
|
20
24
|
return hooks.call('getDOMNode', inst);
|
|
21
25
|
}
|
|
@@ -31,7 +35,7 @@ export function findDOM(inst) {
|
|
|
31
35
|
}
|
|
32
36
|
return el;
|
|
33
37
|
}
|
|
34
|
-
|
|
38
|
+
function getParameterError({ name = '', para, correct, wrong }) {
|
|
35
39
|
const parameter = para ? `parameter.${para}` : 'parameter';
|
|
36
40
|
const errorType = upperCaseFirstLetter(wrong === null ? 'Null' : typeof wrong);
|
|
37
41
|
if (name) {
|
|
@@ -47,10 +51,10 @@ function upperCaseFirstLetter(string) {
|
|
|
47
51
|
string = string.replace(/^./, match => match.toUpperCase());
|
|
48
52
|
return string;
|
|
49
53
|
}
|
|
50
|
-
|
|
54
|
+
const toKebabCase = function (string) {
|
|
51
55
|
return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
52
56
|
};
|
|
53
|
-
|
|
57
|
+
function inlineStyle(style) {
|
|
54
58
|
let res = '';
|
|
55
59
|
for (const attr in style)
|
|
56
60
|
res += `${attr}: ${style[attr]};`;
|
|
@@ -60,11 +64,11 @@ export function inlineStyle(style) {
|
|
|
60
64
|
res = res.replace(/flex-direction:(.+?);/g, (s, $1) => `${s}-webkit-flex-direction:${$1};`);
|
|
61
65
|
return res;
|
|
62
66
|
}
|
|
63
|
-
|
|
67
|
+
function setTransform(el, val) {
|
|
64
68
|
el.style.webkitTransform = val;
|
|
65
69
|
el.style.transform = val;
|
|
66
70
|
}
|
|
67
|
-
|
|
71
|
+
function serializeParams(params) {
|
|
68
72
|
if (!params) {
|
|
69
73
|
return '';
|
|
70
74
|
}
|
|
@@ -74,7 +78,7 @@ export function serializeParams(params) {
|
|
|
74
78
|
: encodeURIComponent(params[key])}`))
|
|
75
79
|
.join('&');
|
|
76
80
|
}
|
|
77
|
-
|
|
81
|
+
function temporarilyNotSupport(name = '') {
|
|
78
82
|
return (option = {}, ...args) => {
|
|
79
83
|
const { success, fail, complete } = option;
|
|
80
84
|
const handle = new MethodHandler({ name, success, fail, complete });
|
|
@@ -94,7 +98,7 @@ export function temporarilyNotSupport(name = '') {
|
|
|
94
98
|
}
|
|
95
99
|
};
|
|
96
100
|
}
|
|
97
|
-
|
|
101
|
+
function weixinCorpSupport(name) {
|
|
98
102
|
return (option = {}, ...args) => {
|
|
99
103
|
const { success, fail, complete } = option;
|
|
100
104
|
const handle = new MethodHandler({ name, success, fail, complete });
|
|
@@ -114,7 +118,7 @@ export function weixinCorpSupport(name) {
|
|
|
114
118
|
}
|
|
115
119
|
};
|
|
116
120
|
}
|
|
117
|
-
|
|
121
|
+
function permanentlyNotSupport(name = '') {
|
|
118
122
|
return (option = {}, ...args) => {
|
|
119
123
|
const { success, fail, complete } = option;
|
|
120
124
|
const handle = new MethodHandler({ name, success, fail, complete });
|
|
@@ -134,7 +138,7 @@ export function permanentlyNotSupport(name = '') {
|
|
|
134
138
|
}
|
|
135
139
|
};
|
|
136
140
|
}
|
|
137
|
-
|
|
141
|
+
function processOpenApi({ name, defaultOptions, standardMethod, formatOptions = options => options, formatResult = res => res }) {
|
|
138
142
|
const notSupported = weixinCorpSupport(name);
|
|
139
143
|
return (options = {}, ...args) => {
|
|
140
144
|
var _a;
|
|
@@ -167,29 +171,20 @@ export function processOpenApi({ name, defaultOptions, standardMethod, formatOpt
|
|
|
167
171
|
};
|
|
168
172
|
}
|
|
169
173
|
/**
|
|
170
|
-
*
|
|
174
|
+
* 获取当前页面路径
|
|
171
175
|
* @returns
|
|
172
176
|
*/
|
|
173
|
-
|
|
174
|
-
var _a, _b, _c, _d, _e, _f
|
|
177
|
+
function getCurrentPath() {
|
|
178
|
+
var _a, _b, _c, _d, _e, _f;
|
|
175
179
|
const appConfig = window.__taroAppConfig || {};
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
entryPath = location.hash.slice(1).split('?')[0];
|
|
184
|
-
}
|
|
185
|
-
const routePath = addLeadingSlash(stripBasename(entryPath, (_c = appConfig.router) === null || _c === void 0 ? void 0 : _c.basename));
|
|
186
|
-
const homePath = addLeadingSlash(getHomePage((_e = (_d = appConfig.routes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.path, (_f = appConfig.router) === null || _f === void 0 ? void 0 : _f.basename, (_g = appConfig.router) === null || _g === void 0 ? void 0 : _g.customRoutes, appConfig.entryPagePath));
|
|
187
|
-
// url上没有指定应用的启动页面时使用homePath
|
|
188
|
-
if (routePath === '/') {
|
|
189
|
-
return homePath + stamp;
|
|
190
|
-
}
|
|
191
|
-
return routePath + stamp;
|
|
180
|
+
const routePath = getCurrentPage((_a = appConfig.router) === null || _a === void 0 ? void 0 : _a.mode, (_b = appConfig.router) === null || _b === void 0 ? void 0 : _b.basename);
|
|
181
|
+
const homePath = getHomePage((_d = (_c = appConfig.routes) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.path, (_e = appConfig.router) === null || _e === void 0 ? void 0 : _e.basename, (_f = appConfig.router) === null || _f === void 0 ? void 0 : _f.customRoutes, appConfig.entryPagePath);
|
|
182
|
+
/**
|
|
183
|
+
* createPageConfig 时根据 stack 的长度来设置 stamp 以保证页面 path 的唯一,此函数是在 createPageConfig 之前调用,预先设置 stamp=1
|
|
184
|
+
* url 上没有指定应用的启动页面时使用 homePath
|
|
185
|
+
*/
|
|
186
|
+
return `${routePath === '/' ? homePath : routePath}?stamp=1`;
|
|
192
187
|
}
|
|
193
|
-
|
|
194
|
-
export
|
|
195
|
-
|
|
188
|
+
|
|
189
|
+
export { findDOM, getCurrentPath, getParameterError, inlineStyle, permanentlyNotSupport, processOpenApi, serializeParams, setTransform, shouldBeObject, temporarilyNotSupport, toKebabCase, weixinCorpSupport };
|
|
190
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["/* eslint-disable prefer-promise-reject-errors */\nimport Taro from '@tarojs/api'\nimport { getCurrentPage, getHomePage } from '@tarojs/router/dist/utils'\nimport { Current, hooks, TaroElement } from '@tarojs/runtime'\nimport { isFunction } from '@tarojs/shared'\n\nimport { MethodHandler } from './handler'\n\nexport function shouldBeObject (target: unknown) {\n if (target && typeof target === 'object') return { flag: true }\n return {\n flag: false,\n msg: getParameterError({\n correct: 'Object',\n wrong: target\n })\n }\n}\n\nexport function findDOM (inst?): TaroElement | HTMLElement | undefined {\n if (inst && hooks.isExist('getDOMNode')) {\n return hooks.call('getDOMNode', inst)\n }\n\n const page = Current.page\n const path = page?.path\n const msg = '没有找到已经加载了的页面,请在页面加载完成后时候此 API。'\n if (path == null) {\n throw new Error(msg)\n }\n\n const el = document.getElementById(path)\n if (el == null) {\n throw new Error('在已加载页面中没有找到对应的容器元素。')\n }\n\n return el\n}\n\ninterface IParameterErrorParam {\n name?: string\n para?: string\n correct?: string\n wrong?: unknown\n}\nexport function getParameterError ({ name = '', para, correct, wrong }: IParameterErrorParam) {\n const parameter = para ? `parameter.${para}` : 'parameter'\n const errorType = upperCaseFirstLetter(wrong === null ? 'Null' : typeof wrong)\n if (name) {\n return `${name}:fail parameter error: ${parameter} should be ${correct} instead of ${errorType}`\n } else {\n return `parameter error: ${parameter} should be ${correct} instead of ${errorType}`\n }\n}\n\nfunction upperCaseFirstLetter (string) {\n if (typeof string !== 'string') return string\n string = string.replace(/^./, match => match.toUpperCase())\n return string\n}\n\nexport const toKebabCase = function (string) {\n return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()\n}\n\n\nexport function inlineStyle (style) {\n let res = ''\n for (const attr in style) res += `${attr}: ${style[attr]};`\n if (res.indexOf('display: flex;') >= 0) res += 'display: -webkit-box;display: -webkit-flex;'\n res = res.replace(/transform:(.+?);/g, (s, $1) => `${s}-webkit-transform:${$1};`)\n res = res.replace(/flex-direction:(.+?);/g, (s, $1) => `${s}-webkit-flex-direction:${$1};`)\n return res\n}\n\nexport function setTransform (el, val) {\n el.style.webkitTransform = val\n el.style.transform = val\n}\n\nexport function serializeParams (params) {\n if (!params) {\n return ''\n }\n return Object.keys(params)\n .map(key => (\n `${encodeURIComponent(key)}=${typeof (params[key]) === 'object'\n ? encodeURIComponent(JSON.stringify(params[key]))\n : encodeURIComponent(params[key])}`))\n .join('&')\n}\n\nexport function temporarilyNotSupport (name = '') {\n return (option = {}, ...args) => {\n const { success, fail, complete } = option as any\n const handle = new MethodHandler({ name, success, fail, complete })\n const errMsg = '暂时不支持 API'\n Taro.eventCenter.trigger('__taroNotSupport', {\n name,\n args: [option, ...args],\n type: 'method',\n category: 'temporarily',\n })\n if (process.env.NODE_ENV === 'production') {\n console.warn(errMsg)\n return handle.success({ errMsg })\n } else {\n return handle.fail({ errMsg })\n }\n }\n}\n\nexport function weixinCorpSupport (name: string) {\n return (option = {}, ...args) => {\n const { success, fail, complete } = option as any\n const handle = new MethodHandler({ name, success, fail, complete })\n const errMsg = 'h5 端当前仅在微信公众号 JS-SDK 环境下支持此 API'\n Taro.eventCenter.trigger('__taroNotSupport', {\n name,\n args: [option, ...args],\n type: 'method',\n category: 'weixin_corp',\n })\n if (process.env.NODE_ENV === 'production') {\n console.warn(errMsg)\n return handle.success({ errMsg })\n } else {\n return handle.fail({ errMsg })\n }\n }\n}\n\nexport function permanentlyNotSupport (name = '') {\n return (option = {}, ...args: any[]) => {\n const { success, fail, complete } = option as any\n const handle = new MethodHandler({ name, success, fail, complete })\n const errMsg = '不支持 API'\n Taro.eventCenter.trigger('__taroNotSupport', {\n name,\n args: [option, ...args],\n type: 'method',\n category: 'permanently',\n })\n if (process.env.NODE_ENV === 'production') {\n console.warn(errMsg)\n return handle.success({ errMsg })\n } else {\n return handle.fail({ errMsg })\n }\n }\n}\n\ninterface IProcessOpenApi<TOptions = Record<string, unknown>, TResult extends TaroGeneral.CallbackResult = any> {\n name: string\n defaultOptions?: TOptions\n standardMethod?: (opts: TOptions) => Promise<TResult>\n formatOptions?: (opts: TOptions) => TOptions\n formatResult?: (res: TResult) => TResult\n}\n\nexport function processOpenApi<TOptions = Record<string, unknown>, TResult extends TaroGeneral.CallbackResult = any> ({\n name,\n defaultOptions,\n standardMethod,\n formatOptions = options => options,\n formatResult = res => res\n}: IProcessOpenApi<TOptions, TResult>) {\n const notSupported = weixinCorpSupport(name)\n return (options: Partial<TOptions> = {}, ...args: any[]): Promise<TResult> => {\n // @ts-ignore\n const targetApi = window?.wx?.[name]\n const opts = formatOptions(Object.assign({}, defaultOptions, options))\n if (isFunction(targetApi)) {\n return new Promise<TResult>((resolve, reject) => {\n ['fail', 'success', 'complete'].forEach(k => {\n opts[k] = preRef => {\n const res = formatResult(preRef)\n options[k] && options[k](res)\n if (k === 'success') {\n resolve(res)\n } else if (k === 'fail') {\n reject(res)\n }\n }\n return targetApi(opts)\n })\n })\n } else if (isFunction(standardMethod)) {\n return standardMethod(opts)\n } else {\n return notSupported(options, ...args) as Promise<TResult>\n }\n }\n}\n\n/**\n * 获取当前页面路径\n * @returns\n */\nexport function getCurrentPath (): string {\n const appConfig = (window as any).__taroAppConfig || {}\n const routePath = getCurrentPage(appConfig.router?.mode, appConfig.router?.basename)\n const homePath = getHomePage(appConfig.routes?.[0]?.path, appConfig.router?.basename, appConfig.router?.customRoutes, appConfig.entryPagePath)\n\n /**\n * createPageConfig 时根据 stack 的长度来设置 stamp 以保证页面 path 的唯一,此函数是在 createPageConfig 之前调用,预先设置 stamp=1\n * url 上没有指定应用的启动页面时使用 homePath\n */\n return `${routePath === '/' ? homePath : routePath}?stamp=1`\n}\n\nexport * from './animation'\nexport * from './lodash'\nexport * from './valid'\n"],"names":[],"mappings":";;;;;;;;;AAAA;AAQM,SAAU,cAAc,CAAE,MAAe,EAAA;AAC7C,IAAA,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;AAAE,QAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAC/D,OAAO;AACL,QAAA,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,iBAAiB,CAAC;AACrB,YAAA,OAAO,EAAE,QAAQ;AACjB,YAAA,KAAK,EAAE,MAAM;SACd,CAAC;KACH,CAAA;AACH,CAAC;AAEK,SAAU,OAAO,CAAE,IAAK,EAAA;IAC5B,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACvC,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AACtC,KAAA;AAED,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IACzB,MAAM,IAAI,GAAG,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAJ,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,IAAI,CAAE,IAAI,CA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CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,IAAI,EAAE,CAAA,EAAA,GAAA,SAAS,CAAC,MAAM,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,QAAQ,EAAE,MAAA,SAAS,CAAC,MAAM,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,YAAY,EAAE,SAAS,CAAC,aAAa,CAAC,CAAA;AAE9I;;;AAGG;AACH,IAAA,OAAO,CAAG,EAAA,SAAS,KAAK,GAAG,GAAG,QAAQ,GAAG,SAAS,UAAU,CAAA;AAC9D;;;;"}
|
package/dist/utils/lodash.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function throttle(fn: any, threshold?: number, scope?: any): (...args: any[]) => void;
|
|
2
|
+
declare function debounce(fn: any, ms?: number, scope?: any): (...args: any[]) => void;
|
|
3
|
+
export { throttle, debounce };
|
package/dist/utils/lodash.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function throttle(fn, threshold = 250, scope) {
|
|
2
2
|
let lastTime = 0;
|
|
3
3
|
let deferTimer;
|
|
4
4
|
return function (...args) {
|
|
@@ -17,7 +17,7 @@ export function throttle(fn, threshold = 250, scope) {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
function debounce(fn, ms = 250, scope) {
|
|
21
21
|
let timer;
|
|
22
22
|
return function (...args) {
|
|
23
23
|
const context = scope || this;
|
|
@@ -27,3 +27,6 @@ export function debounce(fn, ms = 250, scope) {
|
|
|
27
27
|
}, ms);
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
export { debounce, throttle };
|
|
32
|
+
//# sourceMappingURL=lodash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lodash.js","sources":["../../src/utils/lodash.ts"],"sourcesContent":["export function throttle (fn, threshold = 250, scope?) {\n let lastTime = 0\n let deferTimer: ReturnType<typeof setTimeout>\n return function (...args) {\n const context = scope || this\n const now = Date.now()\n if (now - lastTime > threshold) {\n fn.apply(this, args)\n lastTime = now\n } else {\n clearTimeout(deferTimer)\n deferTimer = setTimeout(() => {\n lastTime = now\n fn.apply(context, args)\n }, threshold)\n }\n }\n}\n\nexport function debounce (fn, ms = 250, scope?) {\n let timer: ReturnType<typeof setTimeout>\n\n return function (...args) {\n const context = scope || this\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(context, args)\n }, ms)\n }\n}\n"],"names":[],"mappings":"AAAM,SAAU,QAAQ,CAAE,EAAE,EAAE,SAAS,GAAG,GAAG,EAAE,KAAM,EAAA;IACnD,IAAI,QAAQ,GAAG,CAAC,CAAA;AAChB,IAAA,IAAI,UAAyC,CAAA;IAC7C,OAAO,UAAU,GAAG,IAAI,EAAA;AACtB,QAAA,MAAM,OAAO,GAAG,KAAK,IAAI,IAAI,CAAA;AAC7B,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AACtB,QAAA,IAAI,GAAG,GAAG,QAAQ,GAAG,SAAS,EAAE;AAC9B,YAAA,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;YACpB,QAAQ,GAAG,GAAG,CAAA;AACf,SAAA;AAAM,aAAA;YACL,YAAY,CAAC,UAAU,CAAC,CAAA;AACxB,YAAA,UAAU,GAAG,UAAU,CAAC,MAAK;gBAC3B,QAAQ,GAAG,GAAG,CAAA;AACd,gBAAA,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;aACxB,EAAE,SAAS,CAAC,CAAA;AACd,SAAA;AACH,KAAC,CAAA;AACH,CAAC;AAEK,SAAU,QAAQ,CAAE,EAAE,EAAE,EAAE,GAAG,GAAG,EAAE,KAAM,EAAA;AAC5C,IAAA,IAAI,KAAoC,CAAA;IAExC,OAAO,UAAU,GAAG,IAAI,EAAA;AACtB,QAAA,MAAM,OAAO,GAAG,KAAK,IAAI,IAAI,CAAA;QAC7B,YAAY,CAAC,KAAK,CAAC,CAAA;QACnB,KAAK,GAAG,UAAU,CAAC,YAAA;AACjB,YAAA,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;SACxB,EAAE,EAAE,CAAC,CAAA;AACR,KAAC,CAAA;AACH;;;;"}
|
package/dist/utils/valid.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const isValidColor: (color: string) => boolean;
|
|
2
|
+
export { isValidColor };
|
package/dist/utils/valid.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valid.js","sources":["../../src/utils/valid.ts"],"sourcesContent":["const VALID_COLOR_REG = /^#[0-9a-fA-F]{6}$/\nexport const isValidColor = (color: string) => {\n return VALID_COLOR_REG.test(color)\n}\n"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,mBAAmB,CAAA;AAC9B,MAAA,YAAY,GAAG,CAAC,KAAa,KAAI;AAC5C,IAAA,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACpC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro-h5",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.4",
|
|
4
4
|
"description": "Taro h5 framework",
|
|
5
5
|
"browser": "dist/index.esm.js",
|
|
6
6
|
"main:h5": "dist/index.js",
|
|
@@ -31,24 +31,24 @@
|
|
|
31
31
|
"jsonp-retry": "^1.0.3",
|
|
32
32
|
"query-string": "^7.1.1",
|
|
33
33
|
"whatwg-fetch": "^3.4.0",
|
|
34
|
-
"@tarojs/api": "3.6.0-beta.
|
|
35
|
-
"@tarojs/
|
|
36
|
-
"@tarojs/
|
|
37
|
-
"@tarojs/
|
|
34
|
+
"@tarojs/api": "3.6.0-beta.4",
|
|
35
|
+
"@tarojs/components": "3.6.0-beta.4",
|
|
36
|
+
"@tarojs/router": "3.6.0-beta.4",
|
|
37
|
+
"@tarojs/runtime": "3.6.0-beta.4",
|
|
38
|
+
"@tarojs/shared": "3.6.0-beta.4"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"jest": "^29.3.1",
|
|
41
42
|
"jest-fetch-mock": "^3.0.3",
|
|
42
43
|
"jest-localstorage-mock": "^2.4.0",
|
|
43
44
|
"jest-mock-console": "^1.0.0",
|
|
45
|
+
"lodash": "^4.17.21",
|
|
44
46
|
"react": "^18.2.0",
|
|
45
47
|
"react-test-renderer": "^18.2.0"
|
|
46
48
|
},
|
|
47
49
|
"scripts": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"predev": "pnpm run assets",
|
|
51
|
-
"dev": "tsc -w",
|
|
50
|
+
"build": "rimraf ./dist && cross-env NODE_ENV=production rollup -c",
|
|
51
|
+
"dev": "cross-env NODE_ENV=development rollup -c -w",
|
|
52
52
|
"test": "jest",
|
|
53
53
|
"test:ci": "jest -i --coverage false",
|
|
54
54
|
"test:dev": "jest --watch",
|
package/types/define.d.ts
CHANGED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
.taro_choose_location {
|
|
2
|
-
position: fixed;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
top: 100%;
|
|
8
|
-
background-color: #fff;
|
|
9
|
-
transition: ease top .3s;
|
|
10
|
-
z-index: 1;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.taro_choose_location_bar {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex: 0 95px;
|
|
16
|
-
height: 95px;
|
|
17
|
-
background-color: #ededed;
|
|
18
|
-
color: #090909;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.taro_choose_location_back {
|
|
22
|
-
flex: 0 45px;
|
|
23
|
-
position: relative;
|
|
24
|
-
width: 33px;
|
|
25
|
-
height: 30px;
|
|
26
|
-
margin-top: 30px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.taro_choose_location_back::before {
|
|
30
|
-
content: '';
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
display: block;
|
|
35
|
-
width: 0;
|
|
36
|
-
height: 0;
|
|
37
|
-
border: solid 15px;
|
|
38
|
-
border-top-color: transparent;
|
|
39
|
-
border-right-color: #090909;
|
|
40
|
-
border-bottom-color: transparent;
|
|
41
|
-
border-left-color: transparent;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.taro_choose_location_back::after {
|
|
45
|
-
content: '';
|
|
46
|
-
position: absolute;
|
|
47
|
-
display: block;
|
|
48
|
-
width: 0;
|
|
49
|
-
height: 0;
|
|
50
|
-
top: 0;
|
|
51
|
-
left: 3px;
|
|
52
|
-
border: solid 15px;
|
|
53
|
-
border-top-color: transparent;
|
|
54
|
-
border-right-color: #ededed;
|
|
55
|
-
border-bottom-color: transparent;
|
|
56
|
-
border-left-color: transparent;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.taro_choose_location_title {
|
|
60
|
-
flex: 1;
|
|
61
|
-
line-height: 95px;
|
|
62
|
-
padding-left: 30px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.taro_choose_location_submit {
|
|
66
|
-
width: 110px;
|
|
67
|
-
height: 60px;
|
|
68
|
-
color: #fff;
|
|
69
|
-
background-color: #08bf62;
|
|
70
|
-
border: none;
|
|
71
|
-
font-size: 28px;
|
|
72
|
-
line-height: 60px;
|
|
73
|
-
padding: 0;
|
|
74
|
-
margin: 18px 30px 0 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.taro_choose_location_frame {
|
|
78
|
-
flex: 1;
|
|
79
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Taro from '@tarojs/api';
|
|
2
|
-
export declare class EditorContext implements Taro.EditorContext {
|
|
3
|
-
blur: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
4
|
-
clear: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
5
|
-
format: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
6
|
-
getContents: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
7
|
-
getSelectionText: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
8
|
-
insertDivider: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
9
|
-
insertImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
10
|
-
insertText: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
11
|
-
redo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
12
|
-
removeFormat: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
13
|
-
scrollIntoView: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
14
|
-
setContents: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
15
|
-
undo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { temporarilyNotSupport } from '../../utils';
|
|
2
|
-
// 富文本
|
|
3
|
-
export class EditorContext {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.blur = temporarilyNotSupport('EditorContext.blur');
|
|
6
|
-
this.clear = temporarilyNotSupport('EditorContext.clear');
|
|
7
|
-
this.format = temporarilyNotSupport('EditorContext.format');
|
|
8
|
-
this.getContents = temporarilyNotSupport('EditorContext.getContents');
|
|
9
|
-
this.getSelectionText = temporarilyNotSupport('EditorContext.getSelectionText');
|
|
10
|
-
this.insertDivider = temporarilyNotSupport('EditorContext.insertDivider');
|
|
11
|
-
this.insertImage = temporarilyNotSupport('EditorContext.insertImage');
|
|
12
|
-
this.insertText = temporarilyNotSupport('EditorContext.insertText');
|
|
13
|
-
this.redo = temporarilyNotSupport('EditorContext.redo');
|
|
14
|
-
this.removeFormat = temporarilyNotSupport('EditorContext.removeFormat');
|
|
15
|
-
this.scrollIntoView = temporarilyNotSupport('EditorContext.scrollIntoView');
|
|
16
|
-
this.setContents = temporarilyNotSupport('EditorContext.setContents');
|
|
17
|
-
this.undo = temporarilyNotSupport('EditorContext.undo');
|
|
18
|
-
}
|
|
19
|
-
}
|