@tarojs/taro-h5 3.7.0-beta.1 → 3.7.0-beta.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.
@@ -616,7 +616,6 @@ declare const faceVerifyForPay: (option?: {}, ...args: any[]) => Promise<Partial
616
616
  // 收藏
617
617
  declare const addVideoToFavorites: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
618
618
  declare const addFileToFavorites: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
619
- declare const checkIsAddedToMyMiniProgram: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
620
619
  // 微信群
621
620
  declare const getGroupEnterInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
622
621
  // 发票
@@ -628,6 +627,13 @@ declare const chooseLicensePlate: (option?: {}, ...args: any[]) => Promise<Parti
628
627
  declare const pluginLogin: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
629
628
  declare const login: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
630
629
  declare const checkSession: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
630
+ // 我的小程序
631
+ declare const checkIsAddedToMyMiniProgram: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
632
+ // 隐私信息授权
633
+ declare const requirePrivacyAuthorize: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
634
+ declare const openPrivacyContract: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
635
+ declare const onNeedPrivacyAuthorization: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
636
+ declare const getPrivacySetting: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
631
637
  // 微信红包
632
638
  declare const showRedPackage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
633
639
  // 设置
@@ -816,5 +822,5 @@ declare const createWorker: (option?: {}, ...args: any[]) => Promise<Partial<Tar
816
822
  declare const createSelectorQuery: typeof Taro.createSelectorQuery;
817
823
  declare const createIntersectionObserver: typeof Taro.createIntersectionObserver;
818
824
  declare const createMediaQueryObserver: typeof Taro.createMediaQueryObserver;
819
- export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, getInferenceEnvInfo, createInferenceSession, isVKSupport, createVKSession, getOpenUserInfo, tradePay, env, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, preloadWebview, preloadSkylineView, preloadAssets, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, getSkylineInfoSync, getSkylineInfo, getRendererUserAgent, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onLazyLoadError, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offLazyLoadError, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, onScreenRecordingStateChanged, offScreenRecordingStateChanged, getScreenRecordingState, sendSms, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnectedWithPartialInfo, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, editImage, cropImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseMedia, chooseVideo, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPChatSpeakersChanged, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, join1v1Chat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsUserProfile, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsShareKey, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, requestDeviceVoIP, getDeviceVoIPList, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, checkIsAddedToMyMiniProgram, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, requestSubscribeDeviceMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestPluginPayment, requestOrderPayment, openQzonePublish, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, batchSetStorageSync, batchSetStorage, batchGetStorageSync, batchGetStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, createCacheManager, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, checkIsPictureInPictureActive, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
825
+ export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, getInferenceEnvInfo, createInferenceSession, isVKSupport, createVKSession, getOpenUserInfo, tradePay, env, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, preloadWebview, preloadSkylineView, preloadAssets, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, getSkylineInfoSync, getSkylineInfo, getRendererUserAgent, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onLazyLoadError, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offLazyLoadError, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, onScreenRecordingStateChanged, offScreenRecordingStateChanged, getScreenRecordingState, sendSms, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnectedWithPartialInfo, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, editImage, cropImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseMedia, chooseVideo, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPChatSpeakersChanged, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, join1v1Chat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsUserProfile, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsShareKey, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, requestDeviceVoIP, getDeviceVoIPList, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, checkIsAddedToMyMiniProgram, requirePrivacyAuthorize, openPrivacyContract, onNeedPrivacyAuthorization, getPrivacySetting, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, requestSubscribeDeviceMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestPluginPayment, requestOrderPayment, openQzonePublish, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, batchSetStorageSync, batchSetStorage, batchGetStorageSync, batchGetStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, createCacheManager, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, checkIsPictureInPictureActive, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
820
826
  export { getCurrentPages, navigateBack, navigateTo, redirectTo, reLaunch, switchTab } from "@tarojs/router";
package/dist/index.cjs.js CHANGED
@@ -1073,8 +1073,19 @@ class CanvasContext {
1073
1073
  clearRect(...args) { return this.enqueueActions(this.ctx.clearRect, ...args); }
1074
1074
  clip(...args) { return this.enqueueActions(this.ctx.clip, ...args); }
1075
1075
  closePath(...args) { return this.enqueueActions(this.ctx.closePath, ...args); }
1076
- createPattern(image, repetition) {
1077
- return this.createPattern(image, repetition);
1076
+ createPattern(imageResource, repetition) {
1077
+ // 需要转换为 Image
1078
+ if (typeof imageResource === 'string') {
1079
+ const img = new Image();
1080
+ img.src = imageResource;
1081
+ return new Promise((resolve, reject) => {
1082
+ img.onload = () => {
1083
+ resolve(this.ctx.createPattern(img, repetition));
1084
+ };
1085
+ img.onerror = reject;
1086
+ });
1087
+ }
1088
+ return this.ctx.createPattern(imageResource, repetition);
1078
1089
  }
1079
1090
  /**
1080
1091
  * 将之前在绘图上下文中的描述(路径、变形、样式)画到 canvas 中。
@@ -1125,15 +1136,22 @@ class CanvasContext {
1125
1136
  moveTo(...args) { return this.enqueueActions(this.ctx.moveTo, ...args); }
1126
1137
  quadraticCurveTo(...args) { return this.enqueueActions(this.ctx.quadraticCurveTo, ...args); }
1127
1138
  rect(...args) { return this.enqueueActions(this.ctx.rect, ...args); }
1128
- restore(...args) { return this.enqueueActions(this.ctx.restore, ...args); }
1139
+ // @ts-ignore
1140
+ reset() { return this.ctx.reset(); }
1141
+ restore() { return this.ctx.restore(); }
1129
1142
  rotate(...args) { return this.enqueueActions(this.ctx.rotate, ...args); }
1130
- save(...args) { return this.enqueueActions(this.ctx.save, ...args); }
1143
+ save() { return this.ctx.save(); }
1131
1144
  scale(...args) { return this.enqueueActions(this.ctx.scale, ...args); }
1132
1145
  setFillStyle(color) {
1133
1146
  this.enqueueActions(() => { this.ctx.fillStyle = color; });
1134
1147
  }
1135
1148
  setFontSize(fontSize) {
1136
- this.font = `${fontSize}px`;
1149
+ const arr = this.font.split(/\s/);
1150
+ const idx = arr.findIndex(e => /^\d+px$/.test(e));
1151
+ if (idx !== -1) {
1152
+ arr[idx] = `${fontSize}px`;
1153
+ this.font = arr.join(' ');
1154
+ }
1137
1155
  }
1138
1156
  setGlobalAlpha(alpha) {
1139
1157
  this.globalAlpha = alpha;
@@ -2455,7 +2473,17 @@ class InnerAudioContext {
2455
2473
  }
2456
2474
  set autoplay(e) { this.setProperty('autoplay', e); }
2457
2475
  get autoplay() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.autoplay) || false; }
2458
- get buffered() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.buffered.length) || 0; }
2476
+ get buffered() {
2477
+ const { currentTime = 0, buffered: timeRange } = this.Instance || {};
2478
+ if (timeRange) {
2479
+ for (let i = 0; i < timeRange.length; i++) {
2480
+ if (timeRange.start(i) <= currentTime && timeRange.end(i) >= currentTime) {
2481
+ return timeRange.end(i);
2482
+ }
2483
+ }
2484
+ }
2485
+ return 0;
2486
+ }
2459
2487
  get currentTime() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.currentTime) || 0; }
2460
2488
  set currentTime(e) { this.seek(e); }
2461
2489
  get duration() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.duration) || 0; }
@@ -2566,7 +2594,17 @@ class BackgroundAudioManager {
2566
2594
  get duration() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.duration) || 0; }
2567
2595
  get currentTime() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.currentTime) || 0; }
2568
2596
  get paused() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused) || false; }
2569
- get buffered() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.buffered.length) || 0; }
2597
+ get buffered() {
2598
+ const { currentTime = 0, buffered: timeRange } = this.Instance || {};
2599
+ if (timeRange) {
2600
+ for (let i = 0; i < timeRange.length; i++) {
2601
+ if (timeRange.start(i) <= currentTime && timeRange.end(i) >= currentTime) {
2602
+ return timeRange.end(i);
2603
+ }
2604
+ }
2605
+ }
2606
+ return 0;
2607
+ }
2570
2608
  set referrerPolicy(e) { var _a; (_a = this.Instance) === null || _a === void 0 ? void 0 : _a.setAttribute('referrerpolicy', e); }
2571
2609
  get referrerPolicy() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.getAttribute('referrerpolicy')) || 'origin'; }
2572
2610
  setProperty(key, value) {
@@ -5500,7 +5538,6 @@ const faceVerifyForPay = /* @__PURE__ */ temporarilyNotSupport('faceVerifyForPay
5500
5538
  // 收藏
5501
5539
  const addVideoToFavorites = /* @__PURE__ */ temporarilyNotSupport('addVideoToFavorites');
5502
5540
  const addFileToFavorites = /* @__PURE__ */ temporarilyNotSupport('addFileToFavorites');
5503
- const checkIsAddedToMyMiniProgram = /* @__PURE__ */ temporarilyNotSupport('checkIsAddedToMyMiniProgram');
5504
5541
 
5505
5542
  // 微信群
5506
5543
  const getGroupEnterInfo = /* @__PURE__ */ temporarilyNotSupport('getGroupEnterInfo');
@@ -5517,6 +5554,15 @@ const pluginLogin = /* @__PURE__ */ temporarilyNotSupport('pluginLogin');
5517
5554
  const login = /* @__PURE__ */ temporarilyNotSupport('login');
5518
5555
  const checkSession = /* @__PURE__ */ temporarilyNotSupport('checkSession');
5519
5556
 
5557
+ // 我的小程序
5558
+ const checkIsAddedToMyMiniProgram = /* @__PURE__ */ temporarilyNotSupport('checkIsAddedToMyMiniProgram');
5559
+
5560
+ // 隐私信息授权
5561
+ const requirePrivacyAuthorize = /* @__PURE__ */ temporarilyNotSupport('requirePrivacyAuthorize');
5562
+ const openPrivacyContract = /* @__PURE__ */ temporarilyNotSupport('openPrivacyContract');
5563
+ const onNeedPrivacyAuthorization = /* @__PURE__ */ temporarilyNotSupport('onNeedPrivacyAuthorization');
5564
+ const getPrivacySetting = /* @__PURE__ */ temporarilyNotSupport('getPrivacySetting');
5565
+
5520
5566
  // 微信红包
5521
5567
  const showRedPackage = /* @__PURE__ */ temporarilyNotSupport('showRedPackage');
5522
5568
 
@@ -6050,11 +6096,16 @@ function getConfig() {
6050
6096
  return this.pxTransformConfig;
6051
6097
  return ((_a = taro).config || (_a.config = {}));
6052
6098
  }
6053
- const initPxTransform = function ({ designWidth = 750, deviceRatio = {
6099
+ const defaultDesignWidth = 750;
6100
+ const defaultDesignRatio = {
6054
6101
  640: 2.34 / 2,
6055
6102
  750: 1,
6056
6103
  828: 1.81 / 2
6057
- }, baseFontSize = 20, unitPrecision = 5, targetUnit = 'rem' }) {
6104
+ };
6105
+ const defaultBaseFontSize = 20;
6106
+ const defaultUnitPrecision = 5;
6107
+ const defaultTargetUnit = 'rem';
6108
+ const initPxTransform = function ({ designWidth = defaultDesignWidth, deviceRatio = defaultDesignRatio, baseFontSize = defaultBaseFontSize, unitPrecision = defaultUnitPrecision, targetUnit = defaultTargetUnit }) {
6058
6109
  const config = getConfig.call(this);
6059
6110
  config.designWidth = designWidth;
6060
6111
  config.deviceRatio = deviceRatio;
@@ -6064,16 +6115,19 @@ const initPxTransform = function ({ designWidth = 750, deviceRatio = {
6064
6115
  };
6065
6116
  const pxTransform = function (size = 0) {
6066
6117
  const config = getConfig.call(this);
6067
- const baseFontSize = config.baseFontSize || 20;
6118
+ const baseFontSize = config.baseFontSize || defaultBaseFontSize;
6119
+ const deviceRatio = config.deviceRatio || defaultDesignRatio;
6068
6120
  const designWidth = (((input = 0) => shared.isFunction(config.designWidth)
6069
6121
  ? config.designWidth(input)
6070
6122
  : config.designWidth))(size);
6071
6123
  if (!(designWidth in config.deviceRatio)) {
6072
6124
  throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`);
6073
6125
  }
6126
+ const targetUnit = config.targetUnit || defaultTargetUnit;
6127
+ const unitPrecision = config.unitPrecision || defaultUnitPrecision;
6074
6128
  const formatSize = ~~size;
6075
- let rootValue = 1 / config.deviceRatio[designWidth];
6076
- switch (config === null || config === void 0 ? void 0 : config.targetUnit) {
6129
+ let rootValue = 1 / deviceRatio[designWidth];
6130
+ switch (targetUnit) {
6077
6131
  case 'vw':
6078
6132
  rootValue = designWidth / 100;
6079
6133
  break;
@@ -6085,11 +6139,11 @@ const pxTransform = function (size = 0) {
6085
6139
  rootValue *= baseFontSize * 2;
6086
6140
  }
6087
6141
  let val = formatSize / rootValue;
6088
- if (config.unitPrecision >= 0 && config.unitPrecision <= 100) {
6142
+ if (unitPrecision >= 0 && unitPrecision <= 100) {
6089
6143
  // Number(val): 0.50000 => 0.5
6090
- val = Number(val.toFixed(config.unitPrecision));
6144
+ val = Number(val.toFixed(unitPrecision));
6091
6145
  }
6092
- return val + (config === null || config === void 0 ? void 0 : config.targetUnit);
6146
+ return val + targetUnit;
6093
6147
  };
6094
6148
  const canIUseWebp = function () {
6095
6149
  const canvas = document.createElement('canvas');
@@ -6285,6 +6339,7 @@ exports.getNFCAdapter = getNFCAdapter;
6285
6339
  exports.getNetworkType = getNetworkType;
6286
6340
  exports.getOpenUserInfo = getOpenUserInfo;
6287
6341
  exports.getPerformance = getPerformance;
6342
+ exports.getPrivacySetting = getPrivacySetting;
6288
6343
  exports.getRandomValues = getRandomValues;
6289
6344
  exports.getRealtimeLogManager = getRealtimeLogManager;
6290
6345
  exports.getRecorderManager = getRecorderManager;
@@ -6427,6 +6482,7 @@ exports.onLocalServiceResolveFail = onLocalServiceResolveFail;
6427
6482
  exports.onLocationChange = onLocationChange;
6428
6483
  exports.onLocationChangeError = onLocationChangeError;
6429
6484
  exports.onMemoryWarning = onMemoryWarning;
6485
+ exports.onNeedPrivacyAuthorization = onNeedPrivacyAuthorization;
6430
6486
  exports.onNetworkStatusChange = onNetworkStatusChange;
6431
6487
  exports.onNetworkWeakChange = onNetworkWeakChange;
6432
6488
  exports.onPageNotFound = onPageNotFound;
@@ -6458,6 +6514,7 @@ exports.openCustomerServiceChat = openCustomerServiceChat;
6458
6514
  exports.openDocument = openDocument;
6459
6515
  exports.openEmbeddedMiniProgram = openEmbeddedMiniProgram;
6460
6516
  exports.openLocation = openLocation;
6517
+ exports.openPrivacyContract = openPrivacyContract;
6461
6518
  exports.openQzonePublish = openQzonePublish;
6462
6519
  exports.openSetting = openSetting;
6463
6520
  exports.openSystemBluetoothSetting = openSystemBluetoothSetting;
@@ -6496,6 +6553,7 @@ exports.requestPolymerPayment = requestPolymerPayment;
6496
6553
  exports.requestSubscribeDeviceMessage = requestSubscribeDeviceMessage;
6497
6554
  exports.requestSubscribeMessage = requestSubscribeMessage;
6498
6555
  exports.requirePlugin = requirePlugin;
6556
+ exports.requirePrivacyAuthorize = requirePrivacyAuthorize;
6499
6557
  exports.reserveChannelsLive = reserveChannelsLive;
6500
6558
  exports.revokeBufferURL = revokeBufferURL;
6501
6559
  exports.saveFile = saveFile;