zcw-shared 1.46.1 → 1.47.0
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/functions/android/integrateUniAppNativePlugin.js +36 -8
- package/dist/functions/android/integrateUniAppNativePlugin.js.map +1 -1
- package/dist/functions/async/sleep.d.ts +5 -0
- package/dist/functions/async/sleep.js +6 -0
- package/dist/functions/async/sleep.js.map +1 -0
- package/dist/functions/async/timeout.d.ts +6 -0
- package/dist/functions/async/timeout.js +12 -0
- package/dist/functions/async/timeout.js.map +1 -0
- package/dist/functions/browser/computePosition.d.ts +6 -0
- package/dist/functions/browser/computePosition.js +49 -0
- package/dist/functions/browser/computePosition.js.map +1 -0
- package/dist/functions/browser/createSharedKeyboardCenter.d.ts +18 -0
- package/dist/functions/browser/createSharedKeyboardCenter.js +58 -0
- package/dist/functions/browser/createSharedKeyboardCenter.js.map +1 -0
- package/dist/functions/browser/createThrottledEventListener.d.ts +11 -0
- package/dist/functions/browser/createThrottledEventListener.js +51 -0
- package/dist/functions/browser/createThrottledEventListener.js.map +1 -0
- package/dist/functions/browser/demonstrateResourceLoading.d.ts +32 -0
- package/dist/functions/browser/demonstrateResourceLoading.js +169 -0
- package/dist/functions/browser/demonstrateResourceLoading.js.map +1 -0
- package/dist/functions/browser/detectOverflow.d.ts +12 -0
- package/dist/functions/browser/detectOverflow.js +17 -0
- package/dist/functions/browser/detectOverflow.js.map +1 -0
- package/dist/functions/browser/getAlignment.d.ts +2 -0
- package/dist/functions/browser/getAlignment.js +5 -0
- package/dist/functions/browser/getAlignment.js.map +1 -0
- package/dist/functions/browser/getBasePlacement.d.ts +2 -0
- package/dist/functions/browser/getBasePlacement.js +4 -0
- package/dist/functions/browser/getBasePlacement.js.map +1 -0
- package/dist/functions/browser/getCrossAxisFlip.d.ts +2 -0
- package/dist/functions/browser/getCrossAxisFlip.js +11 -0
- package/dist/functions/browser/getCrossAxisFlip.js.map +1 -0
- package/dist/functions/browser/getElementRect.d.ts +3 -0
- package/dist/functions/browser/getElementRect.js +14 -0
- package/dist/functions/browser/getElementRect.js.map +1 -0
- package/dist/functions/browser/getFlipPlacements.d.ts +2 -0
- package/dist/functions/browser/getFlipPlacements.js +13 -0
- package/dist/functions/browser/getFlipPlacements.js.map +1 -0
- package/dist/functions/browser/getMainAxisFlip.d.ts +2 -0
- package/dist/functions/browser/getMainAxisFlip.js +17 -0
- package/dist/functions/browser/getMainAxisFlip.js.map +1 -0
- package/dist/functions/browser/getRelativePosition.d.ts +3 -0
- package/dist/functions/browser/getRelativePosition.js +14 -0
- package/dist/functions/browser/getRelativePosition.js.map +1 -0
- package/dist/functions/browser/getViewportRect.d.ts +7 -0
- package/dist/functions/browser/getViewportRect.js +15 -0
- package/dist/functions/browser/getViewportRect.js.map +1 -0
- package/dist/functions/browser/isValidPlacement.d.ts +2 -0
- package/dist/functions/browser/isValidPlacement.js +16 -0
- package/dist/functions/browser/isValidPlacement.js.map +1 -0
- package/dist/functions/browser/pickFile.d.ts +15 -0
- package/dist/functions/browser/pickFile.js +48 -0
- package/dist/functions/browser/pickFile.js.map +1 -0
- package/dist/functions/build/generateExports.d.ts +26 -0
- package/dist/functions/build/generateExports.js +34 -0
- package/dist/functions/build/generateExports.js.map +1 -0
- package/dist/functions/core/diff/diff.d.ts +25 -0
- package/dist/functions/core/diff/diff.js +316 -0
- package/dist/functions/core/diff/diff.js.map +1 -0
- package/dist/functions/core/diff/vueDiff.d.ts +38 -0
- package/dist/functions/core/diff/vueDiff.js +333 -0
- package/dist/functions/core/diff/vueDiff.js.map +1 -0
- package/dist/functions/core/generator/generatorUtils.d.ts +16 -0
- package/dist/functions/core/generator/generatorUtils.js +139 -0
- package/dist/functions/core/generator/generatorUtils.js.map +1 -0
- package/dist/functions/core/type/isType.d.ts +11 -0
- package/dist/functions/core/type/isType.js +30 -0
- package/dist/functions/core/type/isType.js.map +1 -0
- package/dist/functions/data/array-object/chunk.d.ts +1 -0
- package/dist/functions/data/array-object/chunk.js +11 -0
- package/dist/functions/data/array-object/chunk.js.map +1 -0
- package/dist/functions/data/array-object/deepClone.d.ts +12 -0
- package/dist/functions/data/array-object/deepClone.js +131 -0
- package/dist/functions/data/array-object/deepClone.js.map +1 -0
- package/dist/functions/data/array-object/evolve.d.ts +3 -0
- package/dist/functions/data/array-object/evolve.js +15 -0
- package/dist/functions/data/array-object/evolve.js.map +1 -0
- package/dist/functions/data/array-object/flatten.d.ts +7 -0
- package/dist/functions/data/array-object/flatten.js +60 -0
- package/dist/functions/data/array-object/flatten.js.map +1 -0
- package/dist/functions/data/array-object/flattenObject.d.ts +5 -0
- package/dist/functions/data/array-object/flattenObject.js +102 -0
- package/dist/functions/data/array-object/flattenObject.js.map +1 -0
- package/dist/functions/data/array-object/groupBy.d.ts +1 -0
- package/dist/functions/data/array-object/groupBy.js +14 -0
- package/dist/functions/data/array-object/groupBy.js.map +1 -0
- package/dist/functions/data/array-object/omit.d.ts +1 -0
- package/dist/functions/data/array-object/omit.js +8 -0
- package/dist/functions/data/array-object/omit.js.map +1 -0
- package/dist/functions/data/array-object/pick.d.ts +1 -0
- package/dist/functions/data/array-object/pick.js +10 -0
- package/dist/functions/data/array-object/pick.js.map +1 -0
- package/dist/functions/data/array-object/shuffle.d.ts +1 -0
- package/dist/functions/data/array-object/shuffle.js +9 -0
- package/dist/functions/data/array-object/shuffle.js.map +1 -0
- package/dist/functions/data/array-object/sortBy.d.ts +1 -0
- package/dist/functions/data/array-object/sortBy.js +13 -0
- package/dist/functions/data/array-object/sortBy.js.map +1 -0
- package/dist/functions/data/array-object/unique.d.ts +10 -0
- package/dist/functions/data/array-object/unique.js +85 -0
- package/dist/functions/data/array-object/unique.js.map +1 -0
- package/dist/functions/data/date/dateRange.d.ts +1 -0
- package/dist/functions/data/date/dateRange.js +18 -0
- package/dist/functions/data/date/dateRange.js.map +1 -0
- package/dist/functions/data/date/formatDate.d.ts +1 -0
- package/dist/functions/data/date/formatDate.js +21 -0
- package/dist/functions/data/date/formatDate.js.map +1 -0
- package/dist/functions/data/date/timeAgo.d.ts +1 -0
- package/dist/functions/data/date/timeAgo.js +49 -0
- package/dist/functions/data/date/timeAgo.js.map +1 -0
- package/dist/functions/data/number/average.d.ts +1 -0
- package/dist/functions/data/number/average.js +8 -0
- package/dist/functions/data/number/average.js.map +1 -0
- package/dist/functions/data/number/clamp.d.ts +1 -0
- package/dist/functions/data/number/clamp.js +7 -0
- package/dist/functions/data/number/clamp.js.map +1 -0
- package/dist/functions/data/number/formatNumber.d.ts +8 -0
- package/dist/functions/data/number/formatNumber.js +16 -0
- package/dist/functions/data/number/formatNumber.js.map +1 -0
- package/dist/functions/data/number/median.d.ts +1 -0
- package/dist/functions/data/number/median.js +14 -0
- package/dist/functions/data/number/median.js.map +1 -0
- package/dist/functions/data/number/percentile.d.ts +1 -0
- package/dist/functions/data/number/percentile.js +18 -0
- package/dist/functions/data/number/percentile.js.map +1 -0
- package/dist/functions/data/number/random.d.ts +4 -0
- package/dist/functions/data/number/random.js +9 -0
- package/dist/functions/data/number/random.js.map +1 -0
- package/dist/functions/data/number/range.d.ts +1 -0
- package/dist/functions/data/number/range.js +18 -0
- package/dist/functions/data/number/range.js.map +1 -0
- package/dist/functions/data/number/sum.d.ts +1 -0
- package/dist/functions/data/number/sum.js +4 -0
- package/dist/functions/data/number/sum.js.map +1 -0
- package/dist/functions/data/randomRegion.d.ts +24 -0
- package/dist/functions/data/randomRegion.js +74 -0
- package/dist/functions/data/randomRegion.js.map +1 -0
- package/dist/functions/data/string/base64.d.ts +5 -0
- package/dist/functions/data/string/base64.js +6 -0
- package/dist/functions/data/string/base64.js.map +1 -0
- package/dist/functions/data/string/capitalize.d.ts +1 -0
- package/dist/functions/data/string/capitalize.js +6 -0
- package/dist/functions/data/string/capitalize.js.map +1 -0
- package/dist/functions/data/string/caseConverter.d.ts +19 -0
- package/dist/functions/data/string/caseConverter.js +94 -0
- package/dist/functions/data/string/caseConverter.js.map +1 -0
- package/dist/functions/data/string/desensitize.d.ts +13 -0
- package/dist/functions/data/string/desensitize.js +107 -0
- package/dist/functions/data/string/desensitize.js.map +1 -0
- package/dist/functions/data/string/htmlEscape.d.ts +20 -0
- package/dist/functions/data/string/htmlEscape.js +80 -0
- package/dist/functions/data/string/htmlEscape.js.map +1 -0
- package/dist/functions/data/string/levenshtein.d.ts +1 -0
- package/dist/functions/data/string/levenshtein.js +27 -0
- package/dist/functions/data/string/levenshtein.js.map +1 -0
- package/dist/functions/data/string/normalize.d.ts +8 -0
- package/dist/functions/data/string/normalize.js +37 -0
- package/dist/functions/data/string/normalize.js.map +1 -0
- package/dist/functions/data/string/pad.d.ts +13 -0
- package/dist/functions/data/string/pad.js +50 -0
- package/dist/functions/data/string/pad.js.map +1 -0
- package/dist/functions/data/string/palindrome.d.ts +3 -0
- package/dist/functions/data/string/palindrome.js +15 -0
- package/dist/functions/data/string/palindrome.js.map +1 -0
- package/dist/functions/data/string/similarity.d.ts +1 -0
- package/dist/functions/data/string/similarity.js +13 -0
- package/dist/functions/data/string/similarity.js.map +1 -0
- package/dist/functions/data/string/template.d.ts +4 -0
- package/dist/functions/data/string/template.js +21 -0
- package/dist/functions/data/string/template.js.map +1 -0
- package/dist/functions/data/string/testRegex.d.ts +20 -0
- package/dist/functions/data/string/testRegex.js +300 -0
- package/dist/functions/data/string/testRegex.js.map +1 -0
- package/dist/functions/data/string/wordCount.d.ts +5 -0
- package/dist/functions/data/string/wordCount.js +11 -0
- package/dist/functions/data/string/wordCount.js.map +1 -0
- package/dist/functions/data/tree/buildTree.d.ts +7 -0
- package/dist/functions/data/tree/buildTree.js +27 -0
- package/dist/functions/data/tree/buildTree.js.map +1 -0
- package/dist/functions/data/tree/filterTree.d.ts +4 -0
- package/dist/functions/data/tree/filterTree.js +21 -0
- package/dist/functions/data/tree/filterTree.js.map +1 -0
- package/dist/functions/data/tree/findNode.d.ts +4 -0
- package/dist/functions/data/tree/findNode.js +21 -0
- package/dist/functions/data/tree/findNode.js.map +1 -0
- package/dist/functions/data/tree/flattenTree.d.ts +6 -0
- package/dist/functions/data/tree/flattenTree.js +21 -0
- package/dist/functions/data/tree/flattenTree.js.map +1 -0
- package/dist/functions/file/walk.d.ts +18 -0
- package/dist/functions/file/walk.js +58 -0
- package/dist/functions/file/walk.js.map +1 -0
- package/dist/functions/integrations/ag-grid/generateLicense.d.ts +7 -0
- package/dist/functions/integrations/ag-grid/generateLicense.js +12 -0
- package/dist/functions/integrations/ag-grid/generateLicense.js.map +1 -0
- package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.d.ts +30 -0
- package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js +884 -0
- package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js.map +1 -0
- package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.d.ts +31 -0
- package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js +900 -0
- package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js.map +1 -0
- package/dist/functions/integrations/uniapp/build.d.ts +21 -0
- package/dist/functions/integrations/uniapp/build.js +83 -0
- package/dist/functions/integrations/uniapp/build.js.map +1 -0
- package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.d.ts +11 -0
- package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js +30 -0
- package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js.map +1 -0
- package/dist/functions/integrations/uniapp/detectProjectType.d.ts +20 -0
- package/dist/functions/integrations/uniapp/detectProjectType.js +68 -0
- package/dist/functions/integrations/uniapp/detectProjectType.js.map +1 -0
- package/dist/functions/integrations/uniapp/parseManifest.d.ts +20 -0
- package/dist/functions/integrations/uniapp/parseManifest.js +51 -0
- package/dist/functions/integrations/uniapp/parseManifest.js.map +1 -0
- package/dist/functions/integrations/uniapp/waitForPages.d.ts +7 -0
- package/dist/functions/integrations/uniapp/waitForPages.js +20 -0
- package/dist/functions/integrations/uniapp/waitForPages.js.map +1 -0
- package/dist/functions/integrations/vue/dynamicMount.d.ts +18 -0
- package/dist/functions/integrations/vue/dynamicMount.js +25 -0
- package/dist/functions/integrations/vue/dynamicMount.js.map +1 -0
- package/dist/functions/integrations/vue/extractColorsFromVueFile.d.ts +3 -0
- package/dist/functions/integrations/vue/extractColorsFromVueFile.js +18 -0
- package/dist/functions/integrations/vue/extractColorsFromVueFile.js.map +1 -0
- package/dist/functions/integrations/vue/extractColorsFromVueSection.d.ts +3 -0
- package/dist/functions/integrations/vue/extractColorsFromVueSection.js +53 -0
- package/dist/functions/integrations/vue/extractColorsFromVueSection.js.map +1 -0
- package/dist/functions/integrations/vue/filterSections.d.ts +2 -0
- package/dist/functions/integrations/vue/filterSections.js +11 -0
- package/dist/functions/integrations/vue/filterSections.js.map +1 -0
- package/dist/functions/integrations/vue/isVNode.d.ts +2 -0
- package/dist/functions/integrations/vue/isVNode.js +6 -0
- package/dist/functions/integrations/vue/isVNode.js.map +1 -0
- package/dist/functions/integrations/vue/isVueComponent.d.ts +2 -0
- package/dist/functions/integrations/vue/isVueComponent.js +6 -0
- package/dist/functions/integrations/vue/isVueComponent.js.map +1 -0
- package/dist/functions/integrations/vue/parseVueFile.d.ts +2 -0
- package/dist/functions/integrations/vue/parseVueFile.js +53 -0
- package/dist/functions/integrations/vue/parseVueFile.js.map +1 -0
- package/dist/functions/integrations/wechat/miniapp/downloadFile.d.ts +6 -0
- package/dist/functions/integrations/wechat/miniapp/downloadFile.js +39 -0
- package/dist/functions/integrations/wechat/miniapp/downloadFile.js.map +1 -0
- package/dist/functions/ios/integrateCameraGallery.d.ts +16 -0
- package/dist/functions/ios/integrateCameraGallery.js +93 -0
- package/dist/functions/ios/integrateCameraGallery.js.map +1 -0
- package/dist/functions/ios/integrateNativePlugin.js.map +1 -1
- package/dist/functions/patterns/MyPromise.d.ts +32 -0
- package/dist/functions/patterns/MyPromise.js +254 -0
- package/dist/functions/patterns/MyPromise.js.map +1 -0
- package/dist/functions/patterns/functionBind.d.ts +4 -0
- package/dist/functions/patterns/functionBind.js +33 -0
- package/dist/functions/patterns/functionBind.js.map +1 -0
- package/dist/functions/patterns/myInstanceof.d.ts +5 -0
- package/dist/functions/patterns/myInstanceof.js +56 -0
- package/dist/functions/patterns/myInstanceof.js.map +1 -0
- package/dist/functions/patterns/myNew.d.ts +3 -0
- package/dist/functions/patterns/myNew.js +19 -0
- package/dist/functions/patterns/myNew.js.map +1 -0
- package/dist/functions/platform/android/buildProject.d.ts +13 -0
- package/dist/functions/platform/android/buildProject.js +122 -0
- package/dist/functions/platform/android/buildProject.js.map +1 -0
- package/dist/functions/platform/android/configureAppIcon.d.ts +17 -0
- package/dist/functions/platform/android/configureAppIcon.js +106 -0
- package/dist/functions/platform/android/configureAppIcon.js.map +1 -0
- package/dist/functions/platform/android/configureLaunchScreen.d.ts +21 -0
- package/dist/functions/platform/android/configureLaunchScreen.js +328 -0
- package/dist/functions/platform/android/configureLaunchScreen.js.map +1 -0
- package/dist/functions/platform/android/detectAndroidModules.d.ts +8 -0
- package/dist/functions/platform/android/detectAndroidModules.js +21 -0
- package/dist/functions/platform/android/detectAndroidModules.js.map +1 -0
- package/dist/functions/platform/android/integrateFacebookLogin.d.ts +12 -0
- package/dist/functions/platform/android/integrateFacebookLogin.js +91 -0
- package/dist/functions/platform/android/integrateFacebookLogin.js.map +1 -0
- package/dist/functions/platform/android/integrateGoogleLogin.d.ts +10 -0
- package/dist/functions/platform/android/integrateGoogleLogin.js +199 -0
- package/dist/functions/platform/android/integrateGoogleLogin.js.map +1 -0
- package/dist/functions/platform/android/integrateMiuiLogin.d.ts +13 -0
- package/dist/functions/platform/android/integrateMiuiLogin.js +115 -0
- package/dist/functions/platform/android/integrateMiuiLogin.js.map +1 -0
- package/dist/functions/platform/android/integrateQQLogin.d.ts +12 -0
- package/dist/functions/platform/android/integrateQQLogin.js +130 -0
- package/dist/functions/platform/android/integrateQQLogin.js.map +1 -0
- package/dist/functions/platform/android/integrateShareTrace.d.ts +10 -0
- package/dist/functions/platform/android/integrateShareTrace.js +181 -0
- package/dist/functions/platform/android/integrateShareTrace.js.map +1 -0
- package/dist/functions/platform/android/integrateSinaLogin.d.ts +13 -0
- package/dist/functions/platform/android/integrateSinaLogin.js +85 -0
- package/dist/functions/platform/android/integrateSinaLogin.js.map +1 -0
- package/dist/functions/platform/android/integrateThirdPartyModule.d.ts +46 -0
- package/dist/functions/platform/android/integrateThirdPartyModule.js +251 -0
- package/dist/functions/platform/android/integrateThirdPartyModule.js.map +1 -0
- package/dist/functions/platform/android/integrateUniAppNativePlugin.d.ts +22 -0
- package/dist/functions/platform/android/integrateUniAppNativePlugin.js +631 -0
- package/dist/functions/platform/android/integrateUniAppNativePlugin.js.map +1 -0
- package/dist/functions/platform/android/integrateUniverifyLogin.d.ts +11 -0
- package/dist/functions/platform/android/integrateUniverifyLogin.js +314 -0
- package/dist/functions/platform/android/integrateUniverifyLogin.js.map +1 -0
- package/dist/functions/platform/android/integrateWechatLogin.d.ts +13 -0
- package/dist/functions/platform/android/integrateWechatLogin.js +154 -0
- package/dist/functions/platform/android/integrateWechatLogin.js.map +1 -0
- package/dist/functions/platform/android/integrateWechatShare.d.ts +13 -0
- package/dist/functions/platform/android/integrateWechatShare.js +154 -0
- package/dist/functions/platform/android/integrateWechatShare.js.map +1 -0
- package/dist/functions/platform/android/modifyGradle.d.ts +28 -0
- package/dist/functions/platform/android/modifyGradle.js +119 -0
- package/dist/functions/platform/android/modifyGradle.js.map +1 -0
- package/dist/functions/platform/android/modifyManifest.d.ts +39 -0
- package/dist/functions/platform/android/modifyManifest.js +225 -0
- package/dist/functions/platform/android/modifyManifest.js.map +1 -0
- package/dist/functions/platform/android/permission.d.ts +54 -0
- package/dist/functions/platform/android/permission.js +85 -0
- package/dist/functions/platform/android/permission.js.map +1 -0
- package/dist/functions/platform/ios/configureAppIcon.d.ts +17 -0
- package/dist/functions/platform/ios/configureAppIcon.js +149 -0
- package/dist/functions/platform/ios/configureAppIcon.js.map +1 -0
- package/dist/functions/platform/ios/configureLaunchScreen.d.ts +17 -0
- package/dist/functions/platform/ios/configureLaunchScreen.js +150 -0
- package/dist/functions/platform/ios/configureLaunchScreen.js.map +1 -0
- package/dist/functions/platform/ios/configurePermissions.d.ts +19 -0
- package/dist/functions/platform/ios/configurePermissions.js +120 -0
- package/dist/functions/platform/ios/configurePermissions.js.map +1 -0
- package/dist/functions/platform/ios/integrateNativePlugin.d.ts +35 -0
- package/dist/functions/platform/ios/integrateNativePlugin.js +994 -0
- package/dist/functions/platform/ios/integrateNativePlugin.js.map +1 -0
- package/dist/functions/platform/ios/integrateQQShare.d.ts +14 -0
- package/dist/functions/platform/ios/integrateQQShare.js +132 -0
- package/dist/functions/platform/ios/integrateQQShare.js.map +1 -0
- package/dist/functions/platform/ios/integrateSinaShare.d.ts +16 -0
- package/dist/functions/platform/ios/integrateSinaShare.js +108 -0
- package/dist/functions/platform/ios/integrateSinaShare.js.map +1 -0
- package/dist/functions/platform/ios/integrateThirdPartyModule.d.ts +62 -0
- package/dist/functions/platform/ios/integrateThirdPartyModule.js +883 -0
- package/dist/functions/platform/ios/integrateThirdPartyModule.js.map +1 -0
- package/dist/functions/platform/ios/integrateWechatOauth.d.ts +14 -0
- package/dist/functions/platform/ios/integrateWechatOauth.js +107 -0
- package/dist/functions/platform/ios/integrateWechatOauth.js.map +1 -0
- package/dist/functions/platform/ios/integrateWechatShare.d.ts +14 -0
- package/dist/functions/platform/ios/integrateWechatShare.js +101 -0
- package/dist/functions/platform/ios/integrateWechatShare.js.map +1 -0
- package/dist/functions/platform/ios/modifyInfoPlistKeyValue.d.ts +2 -0
- package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js +45 -0
- package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js.map +1 -0
- package/dist/functions/platform/ios/safelyModifyProjectPbxproj.d.ts +16 -0
- package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js +136 -0
- package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js.map +1 -0
- package/dist/functions/platform/ios/useAltool.d.ts +39 -0
- package/dist/functions/platform/ios/useAltool.js +350 -0
- package/dist/functions/platform/ios/useAltool.js.map +1 -0
- package/dist/functions/style/buildTokens.d.ts +76 -0
- package/dist/functions/style/buildTokens.js +183 -0
- package/dist/functions/style/buildTokens.js.map +1 -0
- package/dist/functions/style/extractCssVariables.d.ts +16 -0
- package/dist/functions/style/extractCssVariables.js +256 -0
- package/dist/functions/style/extractCssVariables.js.map +1 -0
- package/dist/functions/style/generateVariables.d.ts +7 -0
- package/dist/functions/style/generateVariables.js +135 -0
- package/dist/functions/style/generateVariables.js.map +1 -0
- package/dist/functions/style/mixColors.d.ts +1 -0
- package/dist/functions/style/mixColors.js +38 -0
- package/dist/functions/style/mixColors.js.map +1 -0
- package/dist/functions/style/parseDesignTokens.d.ts +10 -0
- package/dist/functions/style/parseDesignTokens.js +216 -0
- package/dist/functions/style/parseDesignTokens.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildIOSApp.js +36 -0
- package/dist/functions/uniapp/app-plus/buildIOSApp.js.map +1 -1
- package/dist/functions/uniapp/camera/showCamera.d.ts +11 -0
- package/dist/functions/uniapp/camera/showCamera.js +22 -0
- package/dist/functions/uniapp/camera/showCamera.js.map +1 -0
- package/dist/functions/uniapp/customer-service/adapters/openCustomerServiceInMiniapp.d.ts +23 -0
- package/dist/functions/uniapp/customer-service/adapters/openCustomerServiceInMiniapp.js +69 -0
- package/dist/functions/uniapp/customer-service/adapters/openCustomerServiceInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/customer-service/showWxCustomerService.d.ts +28 -0
- package/dist/functions/uniapp/customer-service/showWxCustomerService.js +25 -0
- package/dist/functions/uniapp/customer-service/showWxCustomerService.js.map +1 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInApp.d.ts +10 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInApp.js +97 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInApp.js.map +1 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInH5.d.ts +30 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInH5.js +83 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInH5.js.map +1 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInMiniapp.d.ts +10 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInMiniapp.js +97 -0
- package/dist/functions/uniapp/file/adapters/readWriteFileInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/file/showFile.d.ts +35 -0
- package/dist/functions/uniapp/file/showFile.js +66 -0
- package/dist/functions/uniapp/file/showFile.js.map +1 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInApp.d.ts +9 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInApp.js +52 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInApp.js.map +1 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInH5.d.ts +9 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInH5.js +52 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInH5.js.map +1 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInMiniapp.d.ts +9 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInMiniapp.js +52 -0
- package/dist/functions/uniapp/image/adapters/chooseImageInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/image/showImage.d.ts +11 -0
- package/dist/functions/uniapp/image/showImage.js +23 -0
- package/dist/functions/uniapp/image/showImage.js.map +1 -0
- package/dist/functions/uniapp/login/adapters/wechatLoginInApp.d.ts +10 -0
- package/dist/functions/uniapp/login/adapters/wechatLoginInApp.js +49 -0
- package/dist/functions/uniapp/login/adapters/wechatLoginInApp.js.map +1 -0
- package/dist/functions/uniapp/login/adapters/wechatLoginInMiniapp.d.ts +9 -0
- package/dist/functions/uniapp/login/adapters/wechatLoginInMiniapp.js +27 -0
- package/dist/functions/uniapp/login/adapters/wechatLoginInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/login/showLogin.d.ts +13 -0
- package/dist/functions/uniapp/login/showLogin.js +43 -0
- package/dist/functions/uniapp/login/showLogin.js.map +1 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInApp.d.ts +8 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInApp.js +36 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInApp.js.map +1 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInH5.d.ts +13 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInH5.js +44 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInH5.js.map +1 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInMiniapp.d.ts +8 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInMiniapp.js +37 -0
- package/dist/functions/uniapp/pay/adapters/wechatPayInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/pay/showPay.d.ts +18 -0
- package/dist/functions/uniapp/pay/showPay.js +60 -0
- package/dist/functions/uniapp/pay/showPay.js.map +1 -0
- package/dist/functions/uniapp/phone/adapters/getPhoneInMiniapp.d.ts +6 -0
- package/dist/functions/uniapp/phone/adapters/getPhoneInMiniapp.js +41 -0
- package/dist/functions/uniapp/phone/adapters/getPhoneInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/phone/showWxPhone.d.ts +8 -0
- package/dist/functions/uniapp/phone/showWxPhone.js +25 -0
- package/dist/functions/uniapp/phone/showWxPhone.js.map +1 -0
- package/dist/functions/uniapp/record/adapters/recordInApp.d.ts +12 -0
- package/dist/functions/uniapp/record/adapters/recordInApp.js +64 -0
- package/dist/functions/uniapp/record/adapters/recordInApp.js.map +1 -0
- package/dist/functions/uniapp/record/adapters/recordInH5.d.ts +21 -0
- package/dist/functions/uniapp/record/adapters/recordInH5.js +82 -0
- package/dist/functions/uniapp/record/adapters/recordInH5.js.map +1 -0
- package/dist/functions/uniapp/record/adapters/recordInMiniapp.d.ts +12 -0
- package/dist/functions/uniapp/record/adapters/recordInMiniapp.js +64 -0
- package/dist/functions/uniapp/record/adapters/recordInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/record/showRecord.d.ts +23 -0
- package/dist/functions/uniapp/record/showRecord.js +95 -0
- package/dist/functions/uniapp/record/showRecord.js.map +1 -0
- package/dist/functions/uniapp/scan-code/adapters/scanCodeInApp.d.ts +9 -0
- package/dist/functions/uniapp/scan-code/adapters/scanCodeInApp.js +30 -0
- package/dist/functions/uniapp/scan-code/adapters/scanCodeInApp.js.map +1 -0
- package/dist/functions/uniapp/scan-code/adapters/scanCodeInMiniapp.d.ts +9 -0
- package/dist/functions/uniapp/scan-code/adapters/scanCodeInMiniapp.js +30 -0
- package/dist/functions/uniapp/scan-code/adapters/scanCodeInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/scan-code/showScanCode.d.ts +12 -0
- package/dist/functions/uniapp/scan-code/showScanCode.js +28 -0
- package/dist/functions/uniapp/scan-code/showScanCode.js.map +1 -0
- package/dist/functions/uniapp/subscribe-message/adapters/wechatSubscribeMessageInMiniapp.d.ts +9 -0
- package/dist/functions/uniapp/subscribe-message/adapters/wechatSubscribeMessageInMiniapp.js +41 -0
- package/dist/functions/uniapp/subscribe-message/adapters/wechatSubscribeMessageInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.d.ts +11 -0
- package/dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.js +25 -0
- package/dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.js.map +1 -0
- package/dist/functions/uniapp/user-info/wxGetUserInfo.d.ts +43 -0
- package/dist/functions/uniapp/user-info/wxGetUserInfo.js +55 -0
- package/dist/functions/uniapp/user-info/wxGetUserInfo.js.map +1 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInApp.d.ts +9 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInApp.js +31 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInApp.js.map +1 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInH5.d.ts +9 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInH5.js +30 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInH5.js.map +1 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInMiniapp.d.ts +9 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInMiniapp.js +31 -0
- package/dist/functions/uniapp/video/adapters/chooseVideoInMiniapp.js.map +1 -0
- package/dist/functions/uniapp/video/showVideo.d.ts +11 -0
- package/dist/functions/uniapp/video/showVideo.js +23 -0
- package/dist/functions/uniapp/video/showVideo.js.map +1 -0
- package/dist/functions/validation/parseJwtPayload.d.ts +7 -0
- package/dist/functions/validation/parseJwtPayload.js +33 -0
- package/dist/functions/validation/parseJwtPayload.js.map +1 -0
- package/dist/functions/validation/validate.d.ts +11 -0
- package/dist/functions/validation/validate.js +44 -0
- package/dist/functions/validation/validate.js.map +1 -0
- package/dist/vue-hooks/browser/useBridgeMessage.d.ts +2 -1
- package/dist/vue-hooks/browser/useBridgeMessage.js +13 -11
- package/dist/vue-hooks/browser/useBridgeMessage.js.map +1 -1
- package/package.json +37 -2
- package/references/blob.d.ts +2 -0
- package/references/device.d.ts +46 -0
- package/references/dom.d.ts +6 -0
- package/references/uniapp.d.ts +221 -8
- package/types/uniapp-ios-build.d.ts +22 -0
- package/types/uniapp.d.ts +298 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { wechatSubscribeMessageInMiniapp } from './adapters/wechatSubscribeMessageInMiniapp';
|
|
2
|
+
export async function showWxSubscribeMessage(options = {}, deps) {
|
|
3
|
+
const env = deps.detectEnvironment?.() || 'unknown';
|
|
4
|
+
if (env === 'miniapp') {
|
|
5
|
+
return wechatSubscribeMessageInMiniapp(options, deps);
|
|
6
|
+
}
|
|
7
|
+
else if (env === 'h5') {
|
|
8
|
+
return Promise.reject({
|
|
9
|
+
errMsg: 'H5/Web端不支持微信订阅消息功能,请引导用户进入小程序订阅或使用服务号模板消息'
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
else if (env === 'app') {
|
|
13
|
+
return Promise.reject({
|
|
14
|
+
errMsg: 'App端不支持微信订阅消息功能,请引导用户进入小程序订阅或使用其他推送方式'
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return Promise.reject({
|
|
18
|
+
errMsg: '当前平台不支持微信订阅消息,请在微信小程序端使用'
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export async function checkWxSubscribeMessageAvailable(deps) {
|
|
22
|
+
const env = deps.detectEnvironment?.() || 'unknown';
|
|
23
|
+
return env === 'miniapp';
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=showWxSubscribeMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showWxSubscribeMessage.js","sourceRoot":"","sources":["../../../../src/functions/uniapp/subscribe-message/showWxSubscribeMessage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAA;AAoB5F,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,UAAmC,EAAE,EACrC,IAA8B;IAE9B,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,SAAS,CAAA;IAEnD,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,+BAA+B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IACvD,CAAC;SAAM,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAExB,OAAO,OAAO,CAAC,MAAM,CAAC;YACpB,MAAM,EAAE,2CAA2C;SACpD,CAAC,CAAA;IACJ,CAAC;SAAM,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;QAEzB,OAAO,OAAO,CAAC,MAAM,CAAC;YACpB,MAAM,EAAE,uCAAuC;SAChD,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC;QACpB,MAAM,EAAE,0BAA0B;KACnC,CAAC,CAAA;AACJ,CAAC;AAQD,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,IAA8B;IACnF,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,SAAS,CAAA;IACnD,OAAO,GAAG,KAAK,SAAS,CAAA;AAC1B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { UniApp } from '../../../../references/uniapp.d';
|
|
2
|
+
import type { Console } from '../../../../references/console.d';
|
|
3
|
+
import type { Ref } from 'vue';
|
|
4
|
+
export interface GetUserInfoHelperDeps {
|
|
5
|
+
ref: <T>(value: T) => Ref<T>;
|
|
6
|
+
log: Console['log'];
|
|
7
|
+
}
|
|
8
|
+
export interface UploadAvatarDeps {
|
|
9
|
+
uploadFile: UniApp['uploadFile'];
|
|
10
|
+
error: Console['error'];
|
|
11
|
+
}
|
|
12
|
+
export declare function wxGetUserInfoHelper(deps: GetUserInfoHelperDeps): {
|
|
13
|
+
userInfo: Ref<Partial<{
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
nickName?: string;
|
|
16
|
+
avatarUrl?: string;
|
|
17
|
+
gender?: number;
|
|
18
|
+
country?: string;
|
|
19
|
+
province?: string;
|
|
20
|
+
city?: string;
|
|
21
|
+
language?: string;
|
|
22
|
+
} | undefined>, Partial<{
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
nickName?: string;
|
|
25
|
+
avatarUrl?: string;
|
|
26
|
+
gender?: number;
|
|
27
|
+
country?: string;
|
|
28
|
+
province?: string;
|
|
29
|
+
city?: string;
|
|
30
|
+
language?: string;
|
|
31
|
+
} | undefined>>;
|
|
32
|
+
handleChooseAvatar: (event: {
|
|
33
|
+
detail: {
|
|
34
|
+
avatarUrl: string;
|
|
35
|
+
};
|
|
36
|
+
}) => string;
|
|
37
|
+
handleNicknameInput: (event: {
|
|
38
|
+
detail: {
|
|
39
|
+
value: string;
|
|
40
|
+
};
|
|
41
|
+
}) => string;
|
|
42
|
+
};
|
|
43
|
+
export declare function wxUploadAvatar(filePath: string, uploadUrl: string, deps: UploadAvatarDeps): Promise<string>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export function wxGetUserInfoHelper(deps) {
|
|
2
|
+
const userInfo = deps.ref({
|
|
3
|
+
avatarUrl: '',
|
|
4
|
+
nickName: ''
|
|
5
|
+
});
|
|
6
|
+
function handleChooseAvatar(event) {
|
|
7
|
+
const { avatarUrl } = event.detail;
|
|
8
|
+
deps.log('用户选择头像:', avatarUrl);
|
|
9
|
+
if (userInfo.value) {
|
|
10
|
+
userInfo.value.avatarUrl = avatarUrl;
|
|
11
|
+
}
|
|
12
|
+
return avatarUrl;
|
|
13
|
+
}
|
|
14
|
+
function handleNicknameInput(event) {
|
|
15
|
+
const nickName = event.detail.value;
|
|
16
|
+
deps.log('用户输入昵称:', nickName);
|
|
17
|
+
if (userInfo.value) {
|
|
18
|
+
userInfo.value.nickName = nickName;
|
|
19
|
+
}
|
|
20
|
+
return nickName;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
userInfo,
|
|
24
|
+
handleChooseAvatar,
|
|
25
|
+
handleNicknameInput
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function wxUploadAvatar(filePath, uploadUrl, deps) {
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
deps.uploadFile({
|
|
31
|
+
url: uploadUrl,
|
|
32
|
+
filePath: filePath,
|
|
33
|
+
name: 'avatar',
|
|
34
|
+
success: (res) => {
|
|
35
|
+
try {
|
|
36
|
+
const data = JSON.parse(res.data);
|
|
37
|
+
if (data.url || data.data?.url) {
|
|
38
|
+
resolve(data.url || data.data.url);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
reject(new Error('上传成功但未返回URL'));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
reject(new Error('解析上传结果失败'));
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
fail: (err) => {
|
|
49
|
+
deps.error('上传头像失败:', err);
|
|
50
|
+
reject(err);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=wxGetUserInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wxGetUserInfo.js","sourceRoot":"","sources":["../../../../src/functions/uniapp/user-info/wxGetUserInfo.ts"],"names":[],"mappings":"AA4BA,MAAM,UAAU,mBAAmB,CAAC,IAA2B;IAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAsC;QAC7D,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;KACb,CAAC,CAAA;IAOF,SAAS,kBAAkB,CAAC,KAAwC;QAClE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;QAClC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAC9B,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAA;QACtC,CAAC;QAID,OAAO,SAAS,CAAA;IAClB,CAAC;IAOD,SAAS,mBAAmB,CAAC,KAAoC;QAC/D,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAA;QACnC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;QAC7B,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACpC,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,OAAO;QACL,QAAQ;QACR,kBAAkB;QAClB,mBAAmB;KACpB,CAAA;AACH,CAAC;AAWD,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,SAAiB,EACjB,IAAsB;IAEtB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,CAAC,UAAU,CAAC;YACd,GAAG,EAAE,SAAS;YACd,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACf,IAAI,CAAC;oBACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;oBACjC,IAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;wBAC/B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;oBACpC,CAAC;yBAAM,CAAC;wBACN,MAAM,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC,CAAA;oBAClC,CAAC;gBACH,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,MAAM,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAA;gBAC/B,CAAC;YACH,CAAC;YACD,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;gBACZ,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;gBAC1B,MAAM,CAAC,GAAG,CAAC,CAAA;YACb,CAAC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VideoOptions, VideoResult } from '../../../../../types/uniapp';
|
|
2
|
+
import type { UniApp } from '../../../../../references/uniapp.d';
|
|
3
|
+
import type { Console } from '../../../../../references/console.d';
|
|
4
|
+
export interface VideoInAppDeps {
|
|
5
|
+
chooseVideo: UniApp['chooseVideo'];
|
|
6
|
+
log: Console['log'];
|
|
7
|
+
error: Console['error'];
|
|
8
|
+
}
|
|
9
|
+
export declare function chooseVideoInApp(options: VideoOptions | undefined, deps: VideoInAppDeps): Promise<VideoResult>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export async function chooseVideoInApp(options = {}, deps) {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
deps.chooseVideo({
|
|
4
|
+
sourceType: options.sourceType || ['album', 'camera'],
|
|
5
|
+
compressed: options.compressed || false,
|
|
6
|
+
maxDuration: options.maxDuration || 60,
|
|
7
|
+
camera: options.camera || 'back',
|
|
8
|
+
success: (res) => {
|
|
9
|
+
deps.log('选择视频成功:', res);
|
|
10
|
+
const result = {
|
|
11
|
+
errMsg: res.errMsg || 'chooseVideo:ok',
|
|
12
|
+
tempFilePath: res.tempFilePath,
|
|
13
|
+
duration: res.duration,
|
|
14
|
+
size: res.size,
|
|
15
|
+
width: res.width,
|
|
16
|
+
height: res.height,
|
|
17
|
+
raw: res
|
|
18
|
+
};
|
|
19
|
+
resolve(result);
|
|
20
|
+
},
|
|
21
|
+
fail: (err) => {
|
|
22
|
+
deps.error('选择视频失败:', err);
|
|
23
|
+
reject({
|
|
24
|
+
errMsg: err.errMsg || '选择视频失败',
|
|
25
|
+
raw: err
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=chooseVideoInApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chooseVideoInApp.js","sourceRoot":"","sources":["../../../../../src/functions/uniapp/video/adapters/chooseVideoInApp.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,UAAwB,EAAE,EAC1B,IAAoB;IAEpB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,CAAC,WAAW,CAAC;YACf,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;YACrD,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;YACvC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;YACtC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,MAAM;YAChC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACf,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;gBACxB,MAAM,MAAM,GAAgB;oBAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,gBAAgB;oBACtC,YAAY,EAAE,GAAG,CAAC,YAAY;oBAC9B,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,GAAG,EAAE,GAAG;iBACT,CAAA;gBACD,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC;YACD,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;gBACZ,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;gBAC1B,MAAM,CAAC;oBACL,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,QAAQ;oBAC9B,GAAG,EAAE,GAAG;iBACT,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VideoOptions, VideoResult } from '../../../../../types/uniapp';
|
|
2
|
+
import type { UniApp } from '../../../../../references/uniapp.d';
|
|
3
|
+
import type { Console } from '../../../../../references/console.d';
|
|
4
|
+
export interface VideoInH5Deps {
|
|
5
|
+
chooseVideo: UniApp['chooseVideo'];
|
|
6
|
+
log: Console['log'];
|
|
7
|
+
error: Console['error'];
|
|
8
|
+
}
|
|
9
|
+
export declare function chooseVideoInH5(options: VideoOptions | undefined, deps: VideoInH5Deps): Promise<VideoResult>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export async function chooseVideoInH5(options = {}, deps) {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
deps.chooseVideo({
|
|
4
|
+
sourceType: options.sourceType || ['album'],
|
|
5
|
+
compressed: options.compressed || false,
|
|
6
|
+
maxDuration: options.maxDuration || 60,
|
|
7
|
+
success: (res) => {
|
|
8
|
+
deps.log('选择视频成功:', res);
|
|
9
|
+
const result = {
|
|
10
|
+
errMsg: res.errMsg || 'chooseVideo:ok',
|
|
11
|
+
tempFilePath: res.tempFilePath,
|
|
12
|
+
duration: res.duration,
|
|
13
|
+
size: res.size,
|
|
14
|
+
width: res.width,
|
|
15
|
+
height: res.height,
|
|
16
|
+
raw: res
|
|
17
|
+
};
|
|
18
|
+
resolve(result);
|
|
19
|
+
},
|
|
20
|
+
fail: (err) => {
|
|
21
|
+
deps.error('选择视频失败:', err);
|
|
22
|
+
reject({
|
|
23
|
+
errMsg: err.errMsg || '选择视频失败',
|
|
24
|
+
raw: err
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=chooseVideoInH5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chooseVideoInH5.js","sourceRoot":"","sources":["../../../../../src/functions/uniapp/video/adapters/chooseVideoInH5.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,UAAwB,EAAE,EAC1B,IAAmB;IAEnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAErC,IAAI,CAAC,WAAW,CAAC;YACf,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC;YAC3C,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;YACvC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;YACtC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACf,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;gBACxB,MAAM,MAAM,GAAgB;oBAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,gBAAgB;oBACtC,YAAY,EAAE,GAAG,CAAC,YAAY;oBAC9B,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,GAAG,EAAE,GAAG;iBACT,CAAA;gBACD,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC;YACD,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;gBACZ,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;gBAC1B,MAAM,CAAC;oBACL,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,QAAQ;oBAC9B,GAAG,EAAE,GAAG;iBACT,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VideoOptions, VideoResult } from '../../../../../types/uniapp';
|
|
2
|
+
import type { UniApp } from '../../../../../references/uniapp.d';
|
|
3
|
+
import type { Console } from '../../../../../references/console.d';
|
|
4
|
+
export interface VideoInMiniappDeps {
|
|
5
|
+
chooseVideo: UniApp['chooseVideo'];
|
|
6
|
+
log: Console['log'];
|
|
7
|
+
error: Console['error'];
|
|
8
|
+
}
|
|
9
|
+
export declare function chooseVideoInMiniapp(options: VideoOptions | undefined, deps: VideoInMiniappDeps): Promise<VideoResult>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export async function chooseVideoInMiniapp(options = {}, deps) {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
deps.chooseVideo({
|
|
4
|
+
sourceType: options.sourceType || ['album', 'camera'],
|
|
5
|
+
compressed: options.compressed || false,
|
|
6
|
+
maxDuration: options.maxDuration || 60,
|
|
7
|
+
camera: options.camera || 'back',
|
|
8
|
+
success: (res) => {
|
|
9
|
+
deps.log('选择视频成功:', res);
|
|
10
|
+
const result = {
|
|
11
|
+
errMsg: res.errMsg || 'chooseVideo:ok',
|
|
12
|
+
tempFilePath: res.tempFilePath,
|
|
13
|
+
duration: res.duration,
|
|
14
|
+
size: res.size,
|
|
15
|
+
width: res.width,
|
|
16
|
+
height: res.height,
|
|
17
|
+
raw: res
|
|
18
|
+
};
|
|
19
|
+
resolve(result);
|
|
20
|
+
},
|
|
21
|
+
fail: (err) => {
|
|
22
|
+
deps.error('选择视频失败:', err);
|
|
23
|
+
reject({
|
|
24
|
+
errMsg: err.errMsg || '选择视频失败',
|
|
25
|
+
raw: err
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=chooseVideoInMiniapp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chooseVideoInMiniapp.js","sourceRoot":"","sources":["../../../../../src/functions/uniapp/video/adapters/chooseVideoInMiniapp.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,UAAwB,EAAE,EAC1B,IAAwB;IAExB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,CAAC,WAAW,CAAC;YACf,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;YACrD,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;YACvC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;YACtC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,MAAM;YAChC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACf,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;gBACxB,MAAM,MAAM,GAAgB;oBAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,gBAAgB;oBACtC,YAAY,EAAE,GAAG,CAAC,YAAY;oBAC9B,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,GAAG,EAAE,GAAG;iBACT,CAAA;gBACD,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC;YACD,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;gBACZ,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;gBAC1B,MAAM,CAAC;oBACL,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,QAAQ;oBAC9B,GAAG,EAAE,GAAG;iBACT,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VideoOptions, VideoResult } from '../../../../types/uniapp';
|
|
2
|
+
import type { UniApp } from '../../../../references/uniapp.d';
|
|
3
|
+
import type { Console } from '../../../../references/console.d';
|
|
4
|
+
export interface ShowVideoDeps {
|
|
5
|
+
chooseVideo: UniApp['chooseVideo'];
|
|
6
|
+
log: Console['log'];
|
|
7
|
+
error: Console['error'];
|
|
8
|
+
detectEnvironment?: () => 'h5' | 'miniapp' | 'app' | 'unknown';
|
|
9
|
+
}
|
|
10
|
+
export declare function showVideo(options: VideoOptions | undefined, deps: ShowVideoDeps): Promise<VideoResult>;
|
|
11
|
+
export declare function checkVideoAvailable(deps: ShowVideoDeps): Promise<boolean>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { chooseVideoInMiniapp } from './adapters/chooseVideoInMiniapp';
|
|
2
|
+
import { chooseVideoInH5 } from './adapters/chooseVideoInH5';
|
|
3
|
+
import { chooseVideoInApp } from './adapters/chooseVideoInApp';
|
|
4
|
+
export async function showVideo(options = {}, deps) {
|
|
5
|
+
const env = deps.detectEnvironment?.() || 'unknown';
|
|
6
|
+
if (env === 'miniapp') {
|
|
7
|
+
return chooseVideoInMiniapp(options, deps);
|
|
8
|
+
}
|
|
9
|
+
else if (env === 'h5') {
|
|
10
|
+
return chooseVideoInH5(options, deps);
|
|
11
|
+
}
|
|
12
|
+
else if (env === 'app') {
|
|
13
|
+
return chooseVideoInApp(options, deps);
|
|
14
|
+
}
|
|
15
|
+
return Promise.reject({
|
|
16
|
+
errMsg: '当前平台不支持视频选择功能'
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export async function checkVideoAvailable(deps) {
|
|
20
|
+
const env = deps.detectEnvironment?.() || 'unknown';
|
|
21
|
+
return env === 'miniapp' || env === 'h5' || env === 'app';
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=showVideo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showVideo.js","sourceRoot":"","sources":["../../../../src/functions/uniapp/video/showVideo.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAoB9D,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,UAAwB,EAAE,EAC1B,IAAmB;IAEnB,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,SAAS,CAAA;IAEnD,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC5C,CAAC;SAAM,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACxB,OAAO,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IACvC,CAAC;SAAM,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;QACzB,OAAO,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IACxC,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC;QACpB,MAAM,EAAE,eAAe;KACxB,CAAC,CAAA;AACJ,CAAC;AAQD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAmB;IAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,SAAS,CAAA;IACnD,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,KAAK,CAAA;AAC3D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Console } from '../../../references/console.d';
|
|
2
|
+
export interface ParseJwtPayloadDeps {
|
|
3
|
+
base64Decode: (value: string) => string;
|
|
4
|
+
consoleError?: Console['error'];
|
|
5
|
+
}
|
|
6
|
+
export declare function parseJwtPayload<TPayload extends Record<string, any> = Record<string, any>>(token: string, deps: ParseJwtPayloadDeps): TPayload | null;
|
|
7
|
+
export declare function extractJwtSubject(token: string, deps: ParseJwtPayloadDeps): string | null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function parseJwtPayload(token, deps) {
|
|
2
|
+
if (!token)
|
|
3
|
+
return null;
|
|
4
|
+
const parts = token.split('.');
|
|
5
|
+
if (parts.length !== 3)
|
|
6
|
+
return null;
|
|
7
|
+
try {
|
|
8
|
+
const normalized = normalizeBase64Url(parts[1]);
|
|
9
|
+
const decoded = deps.base64Decode(normalized);
|
|
10
|
+
return JSON.parse(decoded);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
deps.consoleError?.('[parseJwtPayload] Failed to parse JWT payload', error);
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function extractJwtSubject(token, deps) {
|
|
18
|
+
const payload = parseJwtPayload(token, deps);
|
|
19
|
+
return typeof payload?.sub === 'string' ? payload.sub : null;
|
|
20
|
+
}
|
|
21
|
+
function normalizeBase64Url(input) {
|
|
22
|
+
let output = input.replace(/-/g, '+').replace(/_/g, '/');
|
|
23
|
+
const pad = output.length % 4;
|
|
24
|
+
if (pad === 2)
|
|
25
|
+
output += '==';
|
|
26
|
+
else if (pad === 3)
|
|
27
|
+
output += '=';
|
|
28
|
+
else if (pad !== 0 && pad !== 2 && pad !== 3) {
|
|
29
|
+
output += '='.repeat((4 - pad) % 4);
|
|
30
|
+
}
|
|
31
|
+
return output;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=parseJwtPayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseJwtPayload.js","sourceRoot":"","sources":["../../../src/functions/validation/parseJwtPayload.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,eAAe,CAC7B,KAAa,EACb,IAAyB;IAEzB,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC9B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAEnC,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAa,CAAA;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,YAAY,EAAE,CAAC,+CAA+C,EAAE,KAAK,CAAC,CAAA;QAC3E,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAKD,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,IAAyB;IAEzB,MAAM,OAAO,GAAG,eAAe,CAAmB,KAAK,EAAE,IAAI,CAAC,CAAA;IAC9D,OAAO,OAAO,OAAO,EAAE,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9D,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,IAAI,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IACxD,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAC7B,IAAI,GAAG,KAAK,CAAC;QAAE,MAAM,IAAI,IAAI,CAAA;SACxB,IAAI,GAAG,KAAK,CAAC;QAAE,MAAM,IAAI,GAAG,CAAA;SAC5B,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IACrC,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { URL } from '../../../references/url.d';
|
|
2
|
+
export declare const validate: {
|
|
3
|
+
isEmail(value: string): boolean;
|
|
4
|
+
isPhone(value: string): boolean;
|
|
5
|
+
isUrl(value: string, host: {
|
|
6
|
+
URL: typeof URL;
|
|
7
|
+
}): boolean;
|
|
8
|
+
isStrongPassword(value: string): boolean;
|
|
9
|
+
isIdCard(value: string): boolean;
|
|
10
|
+
isPostalCode(value: string): boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const validate = {
|
|
2
|
+
isEmail(value) {
|
|
3
|
+
if (!value || typeof value !== 'string')
|
|
4
|
+
return false;
|
|
5
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
6
|
+
return emailRegex.test(value);
|
|
7
|
+
},
|
|
8
|
+
isPhone(value) {
|
|
9
|
+
if (!value || typeof value !== 'string')
|
|
10
|
+
return false;
|
|
11
|
+
const phoneRegex = /^1[3-9]\d{9}$/;
|
|
12
|
+
return phoneRegex.test(value);
|
|
13
|
+
},
|
|
14
|
+
isUrl(value, host) {
|
|
15
|
+
if (!value || typeof value !== 'string')
|
|
16
|
+
return false;
|
|
17
|
+
try {
|
|
18
|
+
new host.URL(value);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
isStrongPassword(value) {
|
|
26
|
+
if (!value || typeof value !== 'string')
|
|
27
|
+
return false;
|
|
28
|
+
const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
|
|
29
|
+
return passwordRegex.test(value);
|
|
30
|
+
},
|
|
31
|
+
isIdCard(value) {
|
|
32
|
+
if (!value || typeof value !== 'string')
|
|
33
|
+
return false;
|
|
34
|
+
const idCardRegex = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
|
35
|
+
return idCardRegex.test(value);
|
|
36
|
+
},
|
|
37
|
+
isPostalCode(value) {
|
|
38
|
+
if (!value || typeof value !== 'string')
|
|
39
|
+
return false;
|
|
40
|
+
const postalCodeRegex = /^[1-9]\d{5}$/;
|
|
41
|
+
return postalCodeRegex.test(value);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/functions/validation/validate.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,QAAQ,GAAG;IAItB,OAAO,CAAC,KAAa;QACnB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,MAAM,UAAU,GAAG,4BAA4B,CAAA;QAC/C,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;IAKD,OAAO,CAAC,KAAa;QACnB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,MAAM,UAAU,GAAG,eAAe,CAAA;QAClC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;IAKD,KAAK,CAAC,KAAa,EAAE,IAAyB;QAC5C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,IAAI,CAAC;YACH,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACnB,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAKD,gBAAgB,CAAC,KAAa;QAC5B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,MAAM,aAAa,GAAG,sEAAsE,CAAA;QAC5F,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IAKD,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,MAAM,WAAW,GAAG,sFAAsF,CAAA;QAC1G,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAChC,CAAC;IAKD,YAAY,CAAC,KAAa;QACxB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,MAAM,eAAe,GAAG,cAAc,CAAA;QACtC,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;CACF,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PostBridgeMessageOptions } from '../../functions/hybrid/postBridgeMessage';
|
|
2
2
|
import type { PlatformDeps } from '../../../types/hybrid';
|
|
3
|
+
import type { Environment } from '../../../types/hybrid';
|
|
3
4
|
export type { PostBridgeMessageOptions as SendOptions };
|
|
4
5
|
export interface UseBridgeMessageDeps extends PlatformDeps {
|
|
5
6
|
vue: {
|
|
@@ -12,7 +13,7 @@ export interface UseBridgeMessageDeps extends PlatformDeps {
|
|
|
12
13
|
}
|
|
13
14
|
export declare function useBridgeMessage(deps: UseBridgeMessageDeps): {
|
|
14
15
|
environment: {
|
|
15
|
-
value:
|
|
16
|
+
value: Environment;
|
|
16
17
|
};
|
|
17
18
|
error: {
|
|
18
19
|
value: string | null;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { postBridgeMessage } from '../../functions/hybrid/postBridgeMessage';
|
|
2
|
-
import { detectBridgeEnvironment } from '../../functions/hybrid/detectBridgeEnvironment';
|
|
3
2
|
import { createRequestMessage } from '../../functions/hybrid/createBridgeMessage';
|
|
4
3
|
export function useBridgeMessage(deps) {
|
|
5
4
|
const { vue, isServer } = deps;
|
|
6
|
-
const platformDeps = {
|
|
7
|
-
isServer: deps.isServer,
|
|
8
|
-
getWindow: () => deps.window,
|
|
9
|
-
getNavigator: () => deps.navigator,
|
|
10
|
-
getWx: deps.getWx
|
|
11
|
-
};
|
|
12
|
-
const detectedEnv = !isServer() ? detectBridgeEnvironment(platformDeps) : 'unknown';
|
|
13
|
-
const environment = vue.ref(detectedEnv);
|
|
14
|
-
const error = vue.ref(null);
|
|
15
5
|
const isInWechatMiniprogram = () => {
|
|
16
6
|
if (isServer())
|
|
17
7
|
return false;
|
|
@@ -24,6 +14,18 @@ export function useBridgeMessage(deps) {
|
|
|
24
14
|
const window = deps.window;
|
|
25
15
|
return !!(window?.uni || window?.plus);
|
|
26
16
|
};
|
|
17
|
+
const getDetectedEnv = () => {
|
|
18
|
+
if (isServer())
|
|
19
|
+
return 'unknown';
|
|
20
|
+
if (isInWechatMiniprogram())
|
|
21
|
+
return 'miniapp';
|
|
22
|
+
if (isInAppWebview())
|
|
23
|
+
return 'app';
|
|
24
|
+
return 'h5';
|
|
25
|
+
};
|
|
26
|
+
const detectedEnv = getDetectedEnv();
|
|
27
|
+
const environment = vue.ref(detectedEnv);
|
|
28
|
+
const error = vue.ref(null);
|
|
27
29
|
const isBridgeSupported = () => {
|
|
28
30
|
return isInWechatMiniprogram() || isInAppWebview();
|
|
29
31
|
};
|
|
@@ -68,7 +70,7 @@ export function useBridgeMessage(deps) {
|
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
72
|
return {
|
|
71
|
-
environment:
|
|
73
|
+
environment: getDetectedEnv(),
|
|
72
74
|
userAgent: deps.navigator?.userAgent || '',
|
|
73
75
|
isWechat: !!deps.navigator?.userAgent?.toLowerCase().includes('micromessenger'),
|
|
74
76
|
isWechatMiniprogram: isInWechatMiniprogram()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBridgeMessage.js","sourceRoot":"","sources":["../../../src/vue-hooks/browser/useBridgeMessage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useBridgeMessage.js","sourceRoot":"","sources":["../../../src/vue-hooks/browser/useBridgeMessage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AAyCjF,MAAM,UAAU,gBAAgB,CAAC,IAA0B;IACzD,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;IAE9B,MAAM,qBAAqB,GAAG,GAAG,EAAE;QACjC,IAAI,QAAQ,EAAE;YAAE,OAAO,KAAK,CAAA;QAC5B,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAA;QACvB,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,CAAA;IACjC,CAAC,CAAA;IAED,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,IAAI,QAAQ,EAAE;YAAE,OAAO,KAAK,CAAA;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAa,CAAA;QACjC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,IAAI,CAAC,CAAA;IACxC,CAAC,CAAA;IAGD,MAAM,cAAc,GAAG,GAAgB,EAAE;QACvC,IAAI,QAAQ,EAAE;YAAE,OAAO,SAAS,CAAA;QAChC,IAAI,qBAAqB,EAAE;YAAE,OAAO,SAAS,CAAA;QAC7C,IAAI,cAAc,EAAE;YAAE,OAAO,KAAK,CAAA;QAClC,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IACxC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAgB,IAAI,CAAC,CAAA;IAE1C,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,OAAO,qBAAqB,EAAE,IAAI,cAAc,EAAE,CAAA;IACpD,CAAC,CAAA;IAKD,MAAM,qBAAqB,GAAG,KAAK,EACjC,IAA0D,EAC1D,OAAkC,EACnB,EAAE;QACjB,IAAI,QAAQ,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;QAC7B,CAAC;QAED,KAAK,CAAC,KAAK,GAAG,IAAI,CAAA;QAElB,IAAI,CAAC;YAEH,IAAI,SAAS,GAAkC,eAAe,CAAA;YAC9D,IAAI,cAAc,EAAE,EAAE,CAAC;gBACrB,SAAS,GAAG,WAAW,CAAA;YACzB,CAAC;YAGD,MAAM,WAAW,GAA4B;gBAC3C,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;gBACvB,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;aAC9B,CAAA;YACD,MAAM,OAAO,GAAG,oBAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE;gBAC1D,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,aAAa;gBACpC,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI;aAC5B,CAAC,CAAA;YAEF,MAAM,QAAQ,GAAG;gBACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAa;gBACnC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,UAAU,EAAE,IAAI,CAAC,UAAU;aAC5B,CAAA;YAED,MAAM,iBAAiB,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;QAChE,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,OAAO,CAAA;YACzB,MAAM,GAAG,CAAA;QACX,CAAC;IACH,CAAC,CAAA;IAKD,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC9B,IAAI,QAAQ,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,WAAW,EAAE,QAAQ;gBACrB,SAAS,EAAE,EAAE;gBACb,QAAQ,EAAE,KAAK;gBACf,mBAAmB,EAAE,KAAK;aAC3B,CAAA;QACH,CAAC;QAED,OAAO;YACL,WAAW,EAAE,cAAc,EAAE;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,IAAI,EAAE;YAC1C,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YAC/E,mBAAmB,EAAE,qBAAqB,EAAE;SAC7C,CAAA;IACH,CAAC,CAAA;IAED,OAAO;QACL,WAAW;QACX,KAAK;QACL,iBAAiB,EAAE,qBAAqB;QACxC,qBAAqB;QACrB,cAAc;QACd,iBAAiB;QACjB,kBAAkB;KACnB,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcw-shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"references",
|
|
6
6
|
"dist",
|
|
@@ -149,7 +149,6 @@
|
|
|
149
149
|
"./functions/functional/tap": "./dist/functions/functional/tap.js",
|
|
150
150
|
"./functions/functional/until": "./dist/functions/functional/until.js",
|
|
151
151
|
"./functions/hybrid/createBridgeMessage": "./dist/functions/hybrid/createBridgeMessage.js",
|
|
152
|
-
"./functions/hybrid/detectBridgeEnvironment": "./dist/functions/hybrid/detectBridgeEnvironment.js",
|
|
153
152
|
"./functions/hybrid/generateBridgeMessageId": "./dist/functions/hybrid/generateBridgeMessageId.js",
|
|
154
153
|
"./functions/hybrid/postBridgeMessage": "./dist/functions/hybrid/postBridgeMessage.js",
|
|
155
154
|
"./functions/hybrid/validateBridgeMessage": "./dist/functions/hybrid/validateBridgeMessage.js",
|
|
@@ -171,6 +170,7 @@
|
|
|
171
170
|
"./functions/ios/configureAppIcon": "./dist/functions/ios/configureAppIcon.js",
|
|
172
171
|
"./functions/ios/configureLaunchScreen": "./dist/functions/ios/configureLaunchScreen.js",
|
|
173
172
|
"./functions/ios/configurePermissions": "./dist/functions/ios/configurePermissions.js",
|
|
173
|
+
"./functions/ios/integrateCameraGallery": "./dist/functions/ios/integrateCameraGallery.js",
|
|
174
174
|
"./functions/ios/integrateNativePlugin": "./dist/functions/ios/integrateNativePlugin.js",
|
|
175
175
|
"./functions/ios/integrateQQShare": "./dist/functions/ios/integrateQQShare.js",
|
|
176
176
|
"./functions/ios/integrateSinaShare": "./dist/functions/ios/integrateSinaShare.js",
|
|
@@ -241,9 +241,43 @@
|
|
|
241
241
|
"./functions/uniapp/app-plus/buildAndroidApp": "./dist/functions/uniapp/app-plus/buildAndroidApp.js",
|
|
242
242
|
"./functions/uniapp/app-plus/buildIOSApp": "./dist/functions/uniapp/app-plus/buildIOSApp.js",
|
|
243
243
|
"./functions/uniapp/build": "./dist/functions/uniapp/build.js",
|
|
244
|
+
"./functions/uniapp/camera/showCamera": "./dist/functions/uniapp/camera/showCamera.js",
|
|
245
|
+
"./functions/uniapp/customer-service/adapters/openCustomerServiceInMiniapp": "./dist/functions/uniapp/customer-service/adapters/openCustomerServiceInMiniapp.js",
|
|
246
|
+
"./functions/uniapp/customer-service/showWxCustomerService": "./dist/functions/uniapp/customer-service/showWxCustomerService.js",
|
|
244
247
|
"./functions/uniapp/detectAndroidProjectStructure": "./dist/functions/uniapp/detectAndroidProjectStructure.js",
|
|
245
248
|
"./functions/uniapp/detectProjectType": "./dist/functions/uniapp/detectProjectType.js",
|
|
249
|
+
"./functions/uniapp/file/adapters/readWriteFileInApp": "./dist/functions/uniapp/file/adapters/readWriteFileInApp.js",
|
|
250
|
+
"./functions/uniapp/file/adapters/readWriteFileInH5": "./dist/functions/uniapp/file/adapters/readWriteFileInH5.js",
|
|
251
|
+
"./functions/uniapp/file/adapters/readWriteFileInMiniapp": "./dist/functions/uniapp/file/adapters/readWriteFileInMiniapp.js",
|
|
252
|
+
"./functions/uniapp/file/showFile": "./dist/functions/uniapp/file/showFile.js",
|
|
253
|
+
"./functions/uniapp/image/adapters/chooseImageInApp": "./dist/functions/uniapp/image/adapters/chooseImageInApp.js",
|
|
254
|
+
"./functions/uniapp/image/adapters/chooseImageInH5": "./dist/functions/uniapp/image/adapters/chooseImageInH5.js",
|
|
255
|
+
"./functions/uniapp/image/adapters/chooseImageInMiniapp": "./dist/functions/uniapp/image/adapters/chooseImageInMiniapp.js",
|
|
256
|
+
"./functions/uniapp/image/showImage": "./dist/functions/uniapp/image/showImage.js",
|
|
257
|
+
"./functions/uniapp/login/adapters/wechatLoginInApp": "./dist/functions/uniapp/login/adapters/wechatLoginInApp.js",
|
|
258
|
+
"./functions/uniapp/login/adapters/wechatLoginInMiniapp": "./dist/functions/uniapp/login/adapters/wechatLoginInMiniapp.js",
|
|
259
|
+
"./functions/uniapp/login/showLogin": "./dist/functions/uniapp/login/showLogin.js",
|
|
246
260
|
"./functions/uniapp/parseManifest": "./dist/functions/uniapp/parseManifest.js",
|
|
261
|
+
"./functions/uniapp/pay/adapters/wechatPayInApp": "./dist/functions/uniapp/pay/adapters/wechatPayInApp.js",
|
|
262
|
+
"./functions/uniapp/pay/adapters/wechatPayInH5": "./dist/functions/uniapp/pay/adapters/wechatPayInH5.js",
|
|
263
|
+
"./functions/uniapp/pay/adapters/wechatPayInMiniapp": "./dist/functions/uniapp/pay/adapters/wechatPayInMiniapp.js",
|
|
264
|
+
"./functions/uniapp/pay/showPay": "./dist/functions/uniapp/pay/showPay.js",
|
|
265
|
+
"./functions/uniapp/phone/adapters/getPhoneInMiniapp": "./dist/functions/uniapp/phone/adapters/getPhoneInMiniapp.js",
|
|
266
|
+
"./functions/uniapp/phone/showWxPhone": "./dist/functions/uniapp/phone/showWxPhone.js",
|
|
267
|
+
"./functions/uniapp/record/adapters/recordInApp": "./dist/functions/uniapp/record/adapters/recordInApp.js",
|
|
268
|
+
"./functions/uniapp/record/adapters/recordInH5": "./dist/functions/uniapp/record/adapters/recordInH5.js",
|
|
269
|
+
"./functions/uniapp/record/adapters/recordInMiniapp": "./dist/functions/uniapp/record/adapters/recordInMiniapp.js",
|
|
270
|
+
"./functions/uniapp/record/showRecord": "./dist/functions/uniapp/record/showRecord.js",
|
|
271
|
+
"./functions/uniapp/scan-code/adapters/scanCodeInApp": "./dist/functions/uniapp/scan-code/adapters/scanCodeInApp.js",
|
|
272
|
+
"./functions/uniapp/scan-code/adapters/scanCodeInMiniapp": "./dist/functions/uniapp/scan-code/adapters/scanCodeInMiniapp.js",
|
|
273
|
+
"./functions/uniapp/scan-code/showScanCode": "./dist/functions/uniapp/scan-code/showScanCode.js",
|
|
274
|
+
"./functions/uniapp/subscribe-message/adapters/wechatSubscribeMessageInMiniapp": "./dist/functions/uniapp/subscribe-message/adapters/wechatSubscribeMessageInMiniapp.js",
|
|
275
|
+
"./functions/uniapp/subscribe-message/showWxSubscribeMessage": "./dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.js",
|
|
276
|
+
"./functions/uniapp/user-info/wxGetUserInfo": "./dist/functions/uniapp/user-info/wxGetUserInfo.js",
|
|
277
|
+
"./functions/uniapp/video/adapters/chooseVideoInApp": "./dist/functions/uniapp/video/adapters/chooseVideoInApp.js",
|
|
278
|
+
"./functions/uniapp/video/adapters/chooseVideoInH5": "./dist/functions/uniapp/video/adapters/chooseVideoInH5.js",
|
|
279
|
+
"./functions/uniapp/video/adapters/chooseVideoInMiniapp": "./dist/functions/uniapp/video/adapters/chooseVideoInMiniapp.js",
|
|
280
|
+
"./functions/uniapp/video/showVideo": "./dist/functions/uniapp/video/showVideo.js",
|
|
247
281
|
"./functions/uniapp/waitForPages": "./dist/functions/uniapp/waitForPages.js",
|
|
248
282
|
"./functions/url/buildQueryString": "./dist/functions/url/buildQueryString.js",
|
|
249
283
|
"./functions/url/parseUrl": "./dist/functions/url/parseUrl.js",
|
|
@@ -349,6 +383,7 @@
|
|
|
349
383
|
"./types/tencent-cloud": "./types/tencent-cloud.d.ts",
|
|
350
384
|
"./types/uniapp-android-build": "./types/uniapp-android-build.d.ts",
|
|
351
385
|
"./types/uniapp-ios-build": "./types/uniapp-ios-build.d.ts",
|
|
386
|
+
"./types/uniapp": "./types/uniapp.d.ts",
|
|
352
387
|
"./types/vue": "./types/vue.d.ts",
|
|
353
388
|
"./types/worker": "./types/worker.d.ts"
|
|
354
389
|
},
|