zcw-shared 1.7.0 → 1.8.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/README.md +512 -512
- package/assets/logo-colorful.svg +18 -18
- package/assets/logo-name.svg +7 -7
- package/assets/logo-transparent.svg +14 -14
- package/assets/logo.svg +8 -8
- package/dist/constants/softwareConfigs.d.ts +14 -0
- package/dist/constants/softwareConfigs.js +156 -0
- package/dist/constants/softwareConfigs.js.map +1 -0
- package/dist/functions/ag-grid/generateLicense.d.ts +3 -0
- package/dist/functions/ag-grid/generateLicense.js +12 -0
- package/dist/functions/ag-grid/generateLicense.js.map +1 -0
- package/dist/functions/altool/createAltoolClient.d.ts +21 -0
- package/dist/functions/altool/createAltoolClient.js +53 -0
- package/dist/functions/altool/createAltoolClient.js.map +1 -0
- package/dist/functions/altool/getAltoolAuth.d.ts +2 -0
- package/dist/functions/altool/getAltoolAuth.js +8 -0
- package/dist/functions/altool/getAltoolAuth.js.map +1 -0
- package/dist/functions/altool/getAppInfo.d.ts +13 -0
- package/dist/functions/altool/getAppInfo.js +39 -0
- package/dist/functions/altool/getAppInfo.js.map +1 -0
- package/dist/functions/altool/index.d.ts +10 -0
- package/dist/functions/altool/index.js +6 -0
- package/dist/functions/altool/index.js.map +1 -0
- package/dist/functions/altool/isApiKeyAuth.d.ts +2 -0
- package/dist/functions/altool/isApiKeyAuth.js +4 -0
- package/dist/functions/altool/isApiKeyAuth.js.map +1 -0
- package/dist/functions/altool/isCredentialsAuth.d.ts +2 -0
- package/dist/functions/altool/isCredentialsAuth.js +4 -0
- package/dist/functions/altool/isCredentialsAuth.js.map +1 -0
- package/dist/functions/altool/parseAppInfoOutput.d.ts +2 -0
- package/dist/functions/altool/parseAppInfoOutput.js +55 -0
- package/dist/functions/altool/parseAppInfoOutput.js.map +1 -0
- package/dist/functions/altool/parseValidationOutput.d.ts +6 -0
- package/dist/functions/altool/parseValidationOutput.js +21 -0
- package/dist/functions/altool/parseValidationOutput.js.map +1 -0
- package/dist/functions/altool/types.d.ts +26 -0
- package/dist/functions/altool/types.js +7 -0
- package/dist/functions/altool/types.js.map +1 -0
- package/dist/functions/altool/uploadApp.d.ts +6 -0
- package/dist/functions/altool/uploadApp.js +36 -0
- package/dist/functions/altool/uploadApp.js.map +1 -0
- package/dist/functions/altool/validateApp.d.ts +17 -0
- package/dist/functions/altool/validateApp.js +40 -0
- package/dist/functions/altool/validateApp.js.map +1 -0
- package/dist/functions/android/buildProject.d.ts +2 -1
- package/dist/functions/android/buildProject.js +32 -6
- package/dist/functions/android/buildProject.js.map +1 -1
- package/dist/functions/android/modifyGradle.js +10 -10
- package/dist/functions/base64/strToBase64.d.ts +2 -0
- package/dist/functions/base64/strToBase64.js +6 -0
- package/dist/functions/base64/strToBase64.js.map +1 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.d.ts +2 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.js +9 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.js.map +1 -0
- package/dist/functions/color-converter/colorPatterns.d.ts +4 -0
- package/dist/functions/color-converter/colorPatterns.js +41 -0
- package/dist/functions/color-converter/colorPatterns.js.map +1 -0
- package/dist/functions/color-converter/convertColor.d.ts +6 -0
- package/dist/functions/color-converter/convertColor.js +12 -0
- package/dist/functions/color-converter/convertColor.js.map +1 -0
- package/dist/functions/color-converter/createColorReference.d.ts +2 -0
- package/dist/functions/color-converter/createColorReference.js +12 -0
- package/dist/functions/color-converter/createColorReference.js.map +1 -0
- package/dist/functions/color-converter/detectColorFormat.d.ts +2 -0
- package/dist/functions/color-converter/detectColorFormat.js +19 -0
- package/dist/functions/color-converter/detectColorFormat.js.map +1 -0
- package/dist/functions/color-converter/extractColors.d.ts +3 -0
- package/dist/functions/color-converter/extractColors.js +16 -0
- package/dist/functions/color-converter/extractColors.js.map +1 -0
- package/dist/functions/color-converter/extractColorsFromLine.d.ts +2 -0
- package/dist/functions/color-converter/extractColorsFromLine.js +18 -0
- package/dist/functions/color-converter/extractColorsFromLine.js.map +1 -0
- package/dist/functions/color-converter/extractColorsGeneric.d.ts +2 -0
- package/dist/functions/color-converter/extractColorsGeneric.js +12 -0
- package/dist/functions/color-converter/extractColorsGeneric.js.map +1 -0
- package/dist/functions/color-converter/extractCssVariableReferences.d.ts +2 -0
- package/dist/functions/color-converter/extractCssVariableReferences.js +15 -0
- package/dist/functions/color-converter/extractCssVariableReferences.js.map +1 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.d.ts +2 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js +15 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js.map +1 -0
- package/dist/functions/color-converter/formatColorOutput.d.ts +5 -0
- package/dist/functions/color-converter/formatColorOutput.js +48 -0
- package/dist/functions/color-converter/formatColorOutput.js.map +1 -0
- package/dist/functions/color-converter/getColorPatterns.d.ts +2 -0
- package/dist/functions/color-converter/getColorPatterns.js +11 -0
- package/dist/functions/color-converter/getColorPatterns.js.map +1 -0
- package/dist/functions/color-converter/getNamedColorMap.d.ts +2 -0
- package/dist/functions/color-converter/getNamedColorMap.js +19 -0
- package/dist/functions/color-converter/getNamedColorMap.js.map +1 -0
- package/dist/functions/color-converter/hexToRgb.d.ts +2 -0
- package/dist/functions/color-converter/hexToRgb.js +42 -0
- package/dist/functions/color-converter/hexToRgb.js.map +1 -0
- package/dist/functions/color-converter/hslToRgb.d.ts +2 -0
- package/dist/functions/color-converter/hslToRgb.js +78 -0
- package/dist/functions/color-converter/hslToRgb.js.map +1 -0
- package/dist/functions/color-converter/hslToRgbInternal.d.ts +2 -0
- package/dist/functions/color-converter/hslToRgbInternal.js +24 -0
- package/dist/functions/color-converter/hslToRgbInternal.js.map +1 -0
- package/dist/functions/color-converter/hueToRgb.d.ts +1 -0
- package/dist/functions/color-converter/hueToRgb.js +14 -0
- package/dist/functions/color-converter/hueToRgb.js.map +1 -0
- package/dist/functions/color-converter/isColorValue.d.ts +2 -0
- package/dist/functions/color-converter/isColorValue.js +79 -0
- package/dist/functions/color-converter/isColorValue.js.map +1 -0
- package/dist/functions/color-converter/isValidColorValue.d.ts +1 -0
- package/dist/functions/color-converter/isValidColorValue.js +4 -0
- package/dist/functions/color-converter/isValidColorValue.js.map +1 -0
- package/dist/functions/color-converter/isValidHslColor.d.ts +2 -0
- package/dist/functions/color-converter/isValidHslColor.js +14 -0
- package/dist/functions/color-converter/isValidHslColor.js.map +1 -0
- package/dist/functions/color-converter/isValidRgbColor.d.ts +2 -0
- package/dist/functions/color-converter/isValidRgbColor.js +14 -0
- package/dist/functions/color-converter/isValidRgbColor.js.map +1 -0
- package/dist/functions/color-converter/normalizeColor.d.ts +1 -0
- package/dist/functions/color-converter/normalizeColor.js +49 -0
- package/dist/functions/color-converter/normalizeColor.js.map +1 -0
- package/dist/functions/color-converter/normalizeColorInput.d.ts +6 -0
- package/dist/functions/color-converter/normalizeColorInput.js +94 -0
- package/dist/functions/color-converter/normalizeColorInput.js.map +1 -0
- package/dist/functions/color-converter/parseColorString.d.ts +12 -0
- package/dist/functions/color-converter/parseColorString.js +89 -0
- package/dist/functions/color-converter/parseColorString.js.map +1 -0
- package/dist/functions/color-converter/parseCssVariables.d.ts +2 -0
- package/dist/functions/color-converter/parseCssVariables.js +19 -0
- package/dist/functions/color-converter/parseCssVariables.js.map +1 -0
- package/dist/functions/color-converter/parseHexColor.d.ts +6 -0
- package/dist/functions/color-converter/parseHexColor.js +42 -0
- package/dist/functions/color-converter/parseHexColor.js.map +1 -0
- package/dist/functions/color-converter/rgbToHex.d.ts +2 -0
- package/dist/functions/color-converter/rgbToHex.js +65 -0
- package/dist/functions/color-converter/rgbToHex.js.map +1 -0
- package/dist/functions/color-converter/rgbToHslInternal.d.ts +2 -0
- package/dist/functions/color-converter/rgbToHslInternal.js +31 -0
- package/dist/functions/color-converter/rgbToHslInternal.js.map +1 -0
- package/dist/functions/color-converter/standardizeColor.d.ts +1 -0
- package/dist/functions/color-converter/standardizeColor.js +147 -0
- package/dist/functions/color-converter/standardizeColor.js.map +1 -0
- package/dist/functions/desensitize/desensitizeName.d.ts +1 -0
- package/dist/functions/desensitize/desensitizeName.js +8 -0
- package/dist/functions/desensitize/desensitizeName.js.map +1 -0
- package/dist/functions/desensitize/desensitizePhone.d.ts +1 -0
- package/dist/functions/desensitize/desensitizePhone.js +8 -0
- package/dist/functions/desensitize/desensitizePhone.js.map +1 -0
- package/dist/functions/dom/getViewportSize.d.ts +5 -0
- package/dist/functions/dom/getViewportSize.js +7 -0
- package/dist/functions/dom/getViewportSize.js.map +1 -0
- package/dist/functions/software/buildPathExecutables.d.ts +1 -0
- package/dist/functions/software/buildPathExecutables.js +14 -0
- package/dist/functions/software/buildPathExecutables.js.map +1 -0
- package/dist/functions/software/buildSoftwarePaths.d.ts +2 -0
- package/dist/functions/software/buildSoftwarePaths.js +22 -0
- package/dist/functions/software/buildSoftwarePaths.js.map +1 -0
- package/dist/functions/software/createConfigGenerator.d.ts +8 -0
- package/dist/functions/software/createConfigGenerator.js +13 -0
- package/dist/functions/software/createConfigGenerator.js.map +1 -0
- package/dist/functions/software/detectPlatform.d.ts +2 -0
- package/dist/functions/software/detectPlatform.js +9 -0
- package/dist/functions/software/detectPlatform.js.map +1 -0
- package/dist/functions/software/find.d.ts +2 -0
- package/dist/functions/software/find.js +12 -0
- package/dist/functions/software/find.js.map +1 -0
- package/dist/functions/software/findSoftware.js.map +1 -1
- package/dist/functions/software/findSoftwareWithGenerator.d.ts +3 -0
- package/dist/functions/software/findSoftwareWithGenerator.js +8 -0
- package/dist/functions/software/findSoftwareWithGenerator.js.map +1 -0
- package/dist/functions/software/getConfigGenerator.d.ts +2 -0
- package/dist/functions/software/getConfigGenerator.js +10 -0
- package/dist/functions/software/getConfigGenerator.js.map +1 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.d.ts +1 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.js +8 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.js.map +1 -0
- package/dist/functions/software/getSupportedSoftware.d.ts +1 -0
- package/dist/functions/software/getSupportedSoftware.js +5 -0
- package/dist/functions/software/getSupportedSoftware.js.map +1 -0
- package/dist/functions/software/parseEnvironmentPaths.d.ts +1 -0
- package/dist/functions/software/parseEnvironmentPaths.js +11 -0
- package/dist/functions/software/parseEnvironmentPaths.js.map +1 -0
- package/dist/functions/software/softwareConfigs.d.ts +2 -0
- package/dist/functions/software/softwareConfigs.js +148 -0
- package/dist/functions/software/softwareConfigs.js.map +1 -0
- package/dist/functions/software/softwareNameMap.d.ts +1 -0
- package/dist/functions/software/softwareNameMap.js +9 -0
- package/dist/functions/software/softwareNameMap.js.map +1 -0
- package/dist/functions/software/types.d.ts +11 -0
- package/dist/functions/software/types.js +2 -0
- package/dist/functions/software/types.js.map +1 -0
- package/dist/functions/string/base64.d.ts +2 -0
- package/dist/functions/string/base64.js +6 -0
- package/dist/functions/string/base64.js.map +1 -0
- package/dist/functions/string/camelCase.d.ts +1 -0
- package/dist/functions/string/camelCase.js +8 -0
- package/dist/functions/string/camelCase.js.map +1 -0
- package/dist/functions/string/capitalize.d.ts +1 -0
- package/dist/functions/string/capitalize.js +6 -0
- package/dist/functions/string/capitalize.js.map +1 -0
- package/dist/functions/string/caseConverter.d.ts +19 -0
- package/dist/functions/string/caseConverter.js +94 -0
- package/dist/functions/string/caseConverter.js.map +1 -0
- package/dist/functions/string/desensitize.d.ts +13 -0
- package/dist/functions/string/desensitize.js +107 -0
- package/dist/functions/string/desensitize.js.map +1 -0
- package/dist/functions/string/escape.d.ts +1 -0
- package/dist/functions/string/escape.js +13 -0
- package/dist/functions/string/escape.js.map +1 -0
- package/dist/functions/string/htmlEscape.d.ts +20 -0
- package/dist/functions/string/htmlEscape.js +80 -0
- package/dist/functions/string/htmlEscape.js.map +1 -0
- package/dist/functions/string/kebabCase.d.ts +1 -0
- package/dist/functions/string/kebabCase.js +10 -0
- package/dist/functions/string/kebabCase.js.map +1 -0
- package/dist/functions/string/levenshtein.d.ts +1 -0
- package/dist/functions/string/levenshtein.js +27 -0
- package/dist/functions/string/levenshtein.js.map +1 -0
- package/dist/functions/string/mask.d.ts +1 -0
- package/dist/functions/string/mask.js +40 -0
- package/dist/functions/string/mask.js.map +1 -0
- package/dist/functions/string/normalize.d.ts +8 -0
- package/dist/functions/string/normalize.js +37 -0
- package/dist/functions/string/normalize.js.map +1 -0
- package/dist/functions/string/pad.d.ts +13 -0
- package/dist/functions/string/pad.js +50 -0
- package/dist/functions/string/pad.js.map +1 -0
- package/dist/functions/string/padEnd.d.ts +1 -0
- package/dist/functions/string/padEnd.js +8 -0
- package/dist/functions/string/padEnd.js.map +1 -0
- package/dist/functions/string/padStart.d.ts +1 -0
- package/dist/functions/string/padStart.js +8 -0
- package/dist/functions/string/padStart.js.map +1 -0
- package/dist/functions/string/palindrome.d.ts +3 -0
- package/dist/functions/string/palindrome.js +15 -0
- package/dist/functions/string/palindrome.js.map +1 -0
- package/dist/functions/string/pascalCase.d.ts +1 -0
- package/dist/functions/string/pascalCase.js +8 -0
- package/dist/functions/string/pascalCase.js.map +1 -0
- package/dist/functions/string/similarity.d.ts +1 -0
- package/dist/functions/string/similarity.js +13 -0
- package/dist/functions/string/similarity.js.map +1 -0
- package/dist/functions/string/snakeCase.d.ts +1 -0
- package/dist/functions/string/snakeCase.js +10 -0
- package/dist/functions/string/snakeCase.js.map +1 -0
- package/dist/functions/string/template.d.ts +4 -0
- package/dist/functions/string/template.js +21 -0
- package/dist/functions/string/template.js.map +1 -0
- package/dist/functions/string/unescape.d.ts +1 -0
- package/dist/functions/string/unescape.js +13 -0
- package/dist/functions/string/unescape.js.map +1 -0
- package/dist/functions/string/wordCount.d.ts +5 -0
- package/dist/functions/string/wordCount.js +11 -0
- package/dist/functions/string/wordCount.js.map +1 -0
- package/dist/functions/tencent-cloud/getSecret.d.ts +6 -0
- package/dist/functions/tencent-cloud/getSecret.js +18 -0
- package/dist/functions/tencent-cloud/getSecret.js.map +1 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.d.ts +13 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js +175 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js.map +1 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +19 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js +55 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildAndroidProject.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js +60 -0
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js +51 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js +63 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.d.ts +9 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js +57 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js +34 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureStrings.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureStrings.js +42 -0
- package/dist/functions/uniapp/app-plus/configureStrings.js.map +1 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.d.ts +8 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.js +25 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.js.map +1 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.d.ts +2 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.js +18 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.js.map +1 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.d.ts +2 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js +35 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js.map +1 -0
- package/dist/functions/uniapp/app-plus/parseManifest.d.ts +14 -0
- package/dist/functions/uniapp/app-plus/parseManifest.js +44 -0
- package/dist/functions/uniapp/app-plus/parseManifest.js.map +1 -0
- package/dist/functions/uniapp/app-plus/validateOptions.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/validateOptions.js +10 -0
- package/dist/functions/uniapp/app-plus/validateOptions.js.map +1 -0
- package/dist/functions/uniapp/waitForPages.d.ts +3 -0
- package/dist/functions/uniapp/waitForPages.js +20 -0
- package/dist/functions/uniapp/waitForPages.js.map +1 -0
- package/dist/functions/utils/compose.d.ts +1 -0
- package/dist/functions/utils/compose.js +10 -0
- package/dist/functions/utils/compose.js.map +1 -0
- package/dist/functions/utils/cond.d.ts +1 -0
- package/dist/functions/utils/cond.js +15 -0
- package/dist/functions/utils/cond.js.map +1 -0
- package/dist/functions/utils/curry.d.ts +1 -0
- package/dist/functions/utils/curry.js +13 -0
- package/dist/functions/utils/curry.js.map +1 -0
- package/dist/functions/utils/debounce.d.ts +1 -0
- package/dist/functions/utils/debounce.js +13 -0
- package/dist/functions/utils/debounce.js.map +1 -0
- package/dist/functions/utils/evolve.d.ts +3 -0
- package/dist/functions/utils/evolve.js +15 -0
- package/dist/functions/utils/evolve.js.map +1 -0
- package/dist/functions/utils/flow.d.ts +1 -0
- package/dist/functions/utils/flow.js +14 -0
- package/dist/functions/utils/flow.js.map +1 -0
- package/dist/functions/utils/generateExports.js +1 -1
- package/dist/functions/utils/generateExports.js.map +1 -1
- package/dist/functions/utils/isType.d.ts +11 -0
- package/dist/functions/utils/isType.js +30 -0
- package/dist/functions/utils/isType.js.map +1 -0
- package/dist/functions/utils/memoize.d.ts +1 -0
- package/dist/functions/utils/memoize.js +13 -0
- package/dist/functions/utils/memoize.js.map +1 -0
- package/dist/functions/utils/once.d.ts +1 -0
- package/dist/functions/utils/once.js +13 -0
- package/dist/functions/utils/once.js.map +1 -0
- package/dist/functions/utils/partial.d.ts +1 -0
- package/dist/functions/utils/partial.js +13 -0
- package/dist/functions/utils/partial.js.map +1 -0
- package/dist/functions/utils/pipe.d.ts +1 -0
- package/dist/functions/utils/pipe.js +10 -0
- package/dist/functions/utils/pipe.js.map +1 -0
- package/dist/functions/utils/retryWithBackoff.d.ts +9 -0
- package/dist/functions/utils/retryWithBackoff.js +30 -0
- package/dist/functions/utils/retryWithBackoff.js.map +1 -0
- package/dist/functions/utils/tap.d.ts +1 -0
- package/dist/functions/utils/tap.js +14 -0
- package/dist/functions/utils/tap.js.map +1 -0
- package/dist/functions/utils/throttle.d.ts +1 -0
- package/dist/functions/utils/throttle.js +11 -0
- package/dist/functions/utils/throttle.js.map +1 -0
- package/dist/functions/utils/until.d.ts +1 -0
- package/dist/functions/utils/until.js +10 -0
- package/dist/functions/utils/until.js.map +1 -0
- package/dist/functions/utils/validate.d.ts +8 -0
- package/dist/functions/utils/validate.js +45 -0
- package/dist/functions/utils/validate.js.map +1 -0
- package/dist/functions/utils/walk.d.ts +11 -0
- package/dist/functions/utils/walk.js +27 -0
- package/dist/functions/utils/walk.js.map +1 -0
- package/dist/functions/vue/checkVueType.d.ts +8 -0
- package/dist/functions/vue/checkVueType.js +29 -0
- package/dist/functions/vue/checkVueType.js.map +1 -0
- package/dist/functions/vue/deduplicateColors.d.ts +2 -0
- package/dist/functions/vue/deduplicateColors.js +13 -0
- package/dist/functions/vue/deduplicateColors.js.map +1 -0
- package/dist/functions/vue/dynamicMount.d.ts +15 -0
- package/dist/functions/vue/dynamicMount.js +25 -0
- package/dist/functions/vue/dynamicMount.js.map +1 -0
- package/dist/functions/vue/filterSections.js +11 -0
- package/dist/functions/vue/filterSections.js.map +1 -0
- package/dist/functions/vue/isVNode.d.ts +2 -0
- package/dist/functions/vue/isVNode.js +6 -0
- package/dist/functions/vue/isVNode.js.map +1 -0
- package/dist/functions/vue/isVueComponent.d.ts +2 -0
- package/dist/functions/vue/isVueComponent.js +6 -0
- package/dist/functions/vue/isVueComponent.js.map +1 -0
- package/dist/functions/vue/parseVueFile.js +53 -0
- package/dist/functions/vue/parseVueFile.js.map +1 -0
- package/dist/functions/vue/processVueFile.d.ts +3 -0
- package/dist/functions/vue/processVueFile.js +26 -0
- package/dist/functions/vue/processVueFile.js.map +1 -0
- package/dist/functions/vue/saveVueSection.d.ts +2 -0
- package/dist/functions/vue/saveVueSection.js +11 -0
- package/dist/functions/vue/saveVueSection.js.map +1 -0
- package/dist/functions/wechat/miniapp/downloadFile.d.ts +2 -0
- package/dist/functions/wechat/miniapp/downloadFile.js +39 -0
- package/dist/functions/wechat/miniapp/downloadFile.js.map +1 -0
- package/dist/hooks/useAi.d.ts +27 -0
- package/dist/hooks/useAi.js +163 -0
- package/dist/hooks/useAi.js.map +1 -0
- package/dist/hooks/useCache.d.ts +18 -0
- package/dist/hooks/useCache.js +82 -0
- package/dist/hooks/useCache.js.map +1 -0
- package/dist/hooks/useFetch.d.ts +3 -0
- package/dist/hooks/useFetch.js +154 -0
- package/dist/hooks/useFetch.js.map +1 -0
- package/dist/hooks/usePluginSystem.d.ts +11 -0
- package/dist/hooks/usePluginSystem.js +34 -0
- package/dist/hooks/usePluginSystem.js.map +1 -0
- package/dist/hooks/useRequest.d.ts +3 -0
- package/dist/hooks/useRequest.js +139 -0
- package/dist/hooks/useRequest.js.map +1 -0
- package/dist/hooks/useStorageWithIndexedDB.d.ts +2 -1
- package/dist/hooks/useStorageWithIndexedDB.js +1 -1
- package/dist/hooks/useStorageWithIndexedDB.js.map +1 -1
- package/dist/hooks/useWASM.d.ts +4 -0
- package/dist/hooks/useWASM.js +263 -0
- package/dist/hooks/useWASM.js.map +1 -0
- package/dist/hooks/useWorkerFunction.js +27 -27
- package/package.json +1 -1
- package/references/arraybuffer.d.ts +108 -108
- package/references/blob.d.ts +36 -36
- package/references/browser.d.ts +69 -69
- package/references/chrome.extension.d.ts +82 -82
- package/references/console.d.ts +24 -24
- package/references/crypto-js.d.ts +57 -57
- package/references/dom.d.ts +40 -40
- package/references/encoding.d.ts +23 -23
- package/references/fetch.d.ts +123 -123
- package/references/indexeddb.d.ts +48 -48
- package/references/json5.d.ts +21 -21
- package/references/location.d.ts +15 -15
- package/references/node.d.ts +121 -115
- package/references/sharp.d.ts +18 -18
- package/references/storage.d.ts +17 -17
- package/references/timer.d.ts +44 -44
- package/references/uniapp.d.ts +50 -50
- package/references/url.d.ts +55 -55
- package/references/vue.d.ts +85 -85
- package/references/webassembly.d.ts +100 -100
- package/references/wechat.d.ts +48 -48
- package/references/worker.d.ts +152 -152
- package/references/xml.d.ts +87 -88
- package/types/android-build.d.ts +60 -60
- package/types/color.d.ts +72 -72
- package/types/geometry.d.ts +28 -28
- package/types/platform.d.ts +3 -3
- package/types/software.d.ts +14 -14
- package/types/storage.d.ts +50 -50
- package/types/uniapp-android-build.d.ts +48 -48
- package/types/vue.d.ts +29 -29
- package/types/worker.d.ts +177 -177
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe.js","sourceRoot":"","sources":["../../../src/functions/utils/pipe.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,IAAI,CAAI,GAAG,SAA+B;IACxD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,GAAM,EAAE,EAAE,CAAC,GAAG,CAAA;IAClD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAA;IAE/C,OAAO,CAAC,GAAM,EAAE,EAAE;QAChB,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAA;IAC1D,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function retryWithBackoff<T extends (...args: any[]) => Promise<any>>(fn: T, options?: {
|
|
2
|
+
maxAttempts?: number;
|
|
3
|
+
baseDelay?: number;
|
|
4
|
+
maxDelay?: number;
|
|
5
|
+
backoffMultiplier?: number;
|
|
6
|
+
jitter?: boolean;
|
|
7
|
+
shouldRetry?: (error: any, attempt: number) => boolean;
|
|
8
|
+
onRetry?: (error: any, attempt: number, delay: number) => void;
|
|
9
|
+
}): T;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { setTimeout } from '../../../references/timer.d';
|
|
2
|
+
export function retryWithBackoff(fn, options = {}) {
|
|
3
|
+
const { maxAttempts = 3, baseDelay = 1000, maxDelay = 10000, backoffMultiplier = 2, jitter = true, shouldRetry, onRetry } = options;
|
|
4
|
+
return ((...args) => {
|
|
5
|
+
const attempt = async (attemptNumber) => {
|
|
6
|
+
try {
|
|
7
|
+
return await fn(...args);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (attemptNumber >= maxAttempts) {
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
if (shouldRetry && !shouldRetry(error, attemptNumber)) {
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
const delay = Math.min(baseDelay * Math.pow(backoffMultiplier, attemptNumber - 1), maxDelay);
|
|
17
|
+
const finalDelay = jitter
|
|
18
|
+
? delay * (0.5 + Math.random() * 0.5)
|
|
19
|
+
: delay;
|
|
20
|
+
if (onRetry) {
|
|
21
|
+
onRetry(error, attemptNumber, finalDelay);
|
|
22
|
+
}
|
|
23
|
+
await new Promise(resolve => setTimeout(resolve, finalDelay));
|
|
24
|
+
return attempt(attemptNumber + 1);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return attempt(1);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=retryWithBackoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retryWithBackoff.js","sourceRoot":"","sources":["../../../src/functions/utils/retryWithBackoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAcxD,MAAM,UAAU,gBAAgB,CAC9B,EAAK,EACL,UAQI,EAAE;IAEN,MAAM,EACJ,WAAW,GAAG,CAAC,EACf,SAAS,GAAG,IAAI,EAChB,QAAQ,GAAG,KAAK,EAChB,iBAAiB,GAAG,CAAC,EACrB,MAAM,GAAG,IAAI,EACb,WAAW,EACX,OAAO,EACR,GAAG,OAAO,CAAA;IAEX,OAAO,CAAC,CAAC,GAAG,IAAmB,EAA0B,EAAE;QACzD,MAAM,OAAO,GAAG,KAAK,EAAE,aAAqB,EAA0B,EAAE;YACtE,IAAI,CAAC;gBACH,OAAO,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC1B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAEf,IAAI,aAAa,IAAI,WAAW,EAAE,CAAC;oBACjC,MAAM,KAAK,CAAA;gBACb,CAAC;gBAED,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC;oBACtD,MAAM,KAAK,CAAA;gBACb,CAAC;gBAGD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CACpB,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,aAAa,GAAG,CAAC,CAAC,EAC1D,QAAQ,CACT,CAAA;gBAGD,MAAM,UAAU,GAAG,MAAM;oBACvB,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;oBACrC,CAAC,CAAC,KAAK,CAAA;gBAGT,IAAI,OAAO,EAAE,CAAC;oBACZ,OAAO,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,CAAC,CAAA;gBAC3C,CAAC;gBAGD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAA;gBAG7D,OAAO,OAAO,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACnC,CAAC;QACH,CAAC,CAAA;QAED,OAAO,OAAO,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC,CAAM,CAAA;AACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tap<T extends (...args: any[]) => any>(fn: T, interceptor: (args: Parameters<T>, result: ReturnType<T>) => void): T;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function tap(fn, interceptor) {
|
|
2
|
+
return ((...args) => {
|
|
3
|
+
const result = fn(...args);
|
|
4
|
+
if (result instanceof Promise) {
|
|
5
|
+
return result.then(res => {
|
|
6
|
+
interceptor(args, res);
|
|
7
|
+
return res;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
interceptor(args, result);
|
|
11
|
+
return result;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=tap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tap.js","sourceRoot":"","sources":["../../../src/functions/utils/tap.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,GAAG,CACjB,EAAK,EACL,WAAiE;IAEjE,OAAO,CAAC,CAAC,GAAG,IAAmB,EAAiB,EAAE;QAChD,MAAM,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;QAG1B,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACvB,WAAW,CAAC,IAAI,EAAE,GAAoB,CAAC,CAAA;gBACvC,OAAO,GAAG,CAAA;YACZ,CAAC,CAAkB,CAAA;QACrB,CAAC;QAGD,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACzB,OAAO,MAAM,CAAA;IACf,CAAC,CAAM,CAAA;AACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function throttle<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../../src/functions/utils/throttle.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,QAAQ,CACtB,IAAO,EACP,KAAa;IAEb,IAAI,YAAY,GAAG,CAAC,CAAA;IAEpB,OAAO,CAAC,GAAG,IAAmB,EAAE,EAAE;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAEtB,IAAI,GAAG,GAAG,YAAY,IAAI,KAAK,EAAE,CAAC;YAChC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;YACb,YAAY,GAAG,GAAG,CAAA;QACpB,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function until<T>(predicate: (result: T) => boolean, fn: (arg: T) => T | Promise<T>): (arg: T) => T | Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"until.js","sourceRoot":"","sources":["../../../src/functions/utils/until.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,KAAK,CACnB,SAAiC,EACjC,EAA8B;IAE9B,OAAO,KAAK,EAAE,GAAM,EAAc,EAAE;QAClC,IAAI,MAAM,GAAG,GAAG,CAAA;QAEhB,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,CAAA;QAC3B,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { URL } from '../../../references/url.d';
|
|
2
|
+
export const validate = {
|
|
3
|
+
isEmail(value) {
|
|
4
|
+
if (!value || typeof value !== 'string')
|
|
5
|
+
return false;
|
|
6
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
7
|
+
return emailRegex.test(value);
|
|
8
|
+
},
|
|
9
|
+
isPhone(value) {
|
|
10
|
+
if (!value || typeof value !== 'string')
|
|
11
|
+
return false;
|
|
12
|
+
const phoneRegex = /^1[3-9]\d{9}$/;
|
|
13
|
+
return phoneRegex.test(value);
|
|
14
|
+
},
|
|
15
|
+
isUrl(value) {
|
|
16
|
+
if (!value || typeof value !== 'string')
|
|
17
|
+
return false;
|
|
18
|
+
try {
|
|
19
|
+
new URL(value);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
isStrongPassword(value) {
|
|
27
|
+
if (!value || typeof value !== 'string')
|
|
28
|
+
return false;
|
|
29
|
+
const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
|
|
30
|
+
return passwordRegex.test(value);
|
|
31
|
+
},
|
|
32
|
+
isIdCard(value) {
|
|
33
|
+
if (!value || typeof value !== 'string')
|
|
34
|
+
return false;
|
|
35
|
+
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]$/;
|
|
36
|
+
return idCardRegex.test(value);
|
|
37
|
+
},
|
|
38
|
+
isPostalCode(value) {
|
|
39
|
+
if (!value || typeof value !== 'string')
|
|
40
|
+
return false;
|
|
41
|
+
const postalCodeRegex = /^[1-9]\d{5}$/;
|
|
42
|
+
return postalCodeRegex.test(value);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/functions/utils/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAA;AAW/C,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;QACjB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,IAAI,CAAC;YACH,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;YACd,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FileSystem, Path } from '../../../references/node.d';
|
|
2
|
+
export interface WalkDependencies {
|
|
3
|
+
fs: FileSystem;
|
|
4
|
+
path: Path;
|
|
5
|
+
}
|
|
6
|
+
export declare function walk(dir: string, options: {
|
|
7
|
+
prefix?: string;
|
|
8
|
+
extensions?: string[];
|
|
9
|
+
excludeExtensions?: string[];
|
|
10
|
+
excludeNames?: string[];
|
|
11
|
+
} | undefined, deps: WalkDependencies): string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function walk(dir, options = {}, deps) {
|
|
2
|
+
const { fs, path } = deps;
|
|
3
|
+
const { prefix = '', extensions = ['.ts'], excludeExtensions = ['.d.ts'], excludeNames = ['index'] } = options;
|
|
4
|
+
let results = [];
|
|
5
|
+
if (!fs.existsSync(dir)) {
|
|
6
|
+
return results;
|
|
7
|
+
}
|
|
8
|
+
fs.readdirSync(dir).forEach((file) => {
|
|
9
|
+
const fullPath = path.join(dir, file);
|
|
10
|
+
const relPath = path.join(prefix, file);
|
|
11
|
+
if (fs.statSync(fullPath).isDirectory()) {
|
|
12
|
+
results = results.concat(walk(fullPath, { ...options, prefix: relPath }, deps));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
const hasValidExtension = extensions.some(ext => file.endsWith(ext));
|
|
16
|
+
const hasExcludedExtension = excludeExtensions.some(ext => file.endsWith(ext));
|
|
17
|
+
const fileName = file.substring(0, file.lastIndexOf('.'));
|
|
18
|
+
const isExcludedName = excludeNames.includes(fileName);
|
|
19
|
+
if (hasValidExtension && !hasExcludedExtension && !isExcludedName) {
|
|
20
|
+
const posixPath = path.posix.join(prefix.split(path.sep).join(path.posix.sep), fileName);
|
|
21
|
+
results.push(posixPath);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return results;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=walk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../../src/functions/utils/walk.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,IAAI,CAClB,GAAW,EACX,UAKI,EAAE,EACN,IAAsB;IAEtB,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;IACzB,MAAM,EACJ,MAAM,GAAG,EAAE,EACX,UAAU,GAAG,CAAC,KAAK,CAAC,EACpB,iBAAiB,GAAG,CAAC,OAAO,CAAC,EAC7B,YAAY,GAAG,CAAC,OAAO,CAAC,EACzB,GAAG,OAAO,CAAC;IAEZ,IAAI,OAAO,GAAa,EAAE,CAAC;IAG3B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,EAAE;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAExC,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAExC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAClF,CAAC;aAAM,CAAC;YAEN,MAAM,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YACrE,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/E,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1D,MAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAEvD,IAAI,iBAAiB,IAAI,CAAC,oBAAoB,IAAI,CAAC,cAAc,EAAE,CAAC;gBAElE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAC/B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAC3C,QAAQ,CACT,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Component, VNode } from '../../../references/vue.d';
|
|
2
|
+
export type VueTypeCheckResult = {
|
|
3
|
+
isComponent: boolean;
|
|
4
|
+
isVNode: boolean;
|
|
5
|
+
type: 'component' | 'vnode' | 'unknown';
|
|
6
|
+
};
|
|
7
|
+
export declare function checkVueType(content: unknown): VueTypeCheckResult;
|
|
8
|
+
export declare function isVueRelated(content: unknown): content is Component | VNode;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function checkVueType(content) {
|
|
2
|
+
const isComponent = (typeof content === 'object' &&
|
|
3
|
+
content !== null &&
|
|
4
|
+
('render' in content || 'setup' in content || 'template' in content));
|
|
5
|
+
const isVNodeResult = (typeof content === 'object' && content !== null && '__v_isVNode' in content);
|
|
6
|
+
let type;
|
|
7
|
+
if (isComponent) {
|
|
8
|
+
type = 'component';
|
|
9
|
+
}
|
|
10
|
+
else if (isVNodeResult) {
|
|
11
|
+
type = 'vnode';
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
type = 'unknown';
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
isComponent,
|
|
18
|
+
isVNode: isVNodeResult,
|
|
19
|
+
type
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function isVueRelated(content) {
|
|
23
|
+
const isComponent = (typeof content === 'object' &&
|
|
24
|
+
content !== null &&
|
|
25
|
+
('render' in content || 'setup' in content || 'template' in content));
|
|
26
|
+
const isVNodeResult = (typeof content === 'object' && content !== null && '__v_isVNode' in content);
|
|
27
|
+
return isComponent || isVNodeResult;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=checkVueType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkVueType.js","sourceRoot":"","sources":["../../../src/functions/vue/checkVueType.ts"],"names":[],"mappings":"AAgCA,MAAM,UAAU,YAAY,CAAC,OAAgB;IAE3C,MAAM,WAAW,GAAG,CAClB,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,CAAC,CACrE,CAAA;IAGD,MAAM,aAAa,GAAG,CACpB,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,aAAa,IAAI,OAAO,CAC5E,CAAA;IAED,IAAI,IAAuC,CAAA;IAC3C,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,GAAG,WAAW,CAAA;IACpB,CAAC;SAAM,IAAI,aAAa,EAAE,CAAC;QACzB,IAAI,GAAG,OAAO,CAAA;IAChB,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,SAAS,CAAA;IAClB,CAAC;IAED,OAAO;QACL,WAAW;QACX,OAAO,EAAE,aAAa;QACtB,IAAI;KACL,CAAA;AACH,CAAC;AAOD,MAAM,UAAU,YAAY,CAAC,OAAgB;IAE3C,MAAM,WAAW,GAAG,CAClB,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,CAAC,CACrE,CAAA;IAED,MAAM,aAAa,GAAG,CACpB,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,aAAa,IAAI,OAAO,CAC5E,CAAA;IAED,OAAO,WAAW,IAAI,aAAa,CAAA;AACrC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function deduplicateColors(colors) {
|
|
2
|
+
const seen = new Set();
|
|
3
|
+
const result = [];
|
|
4
|
+
for (const color of colors) {
|
|
5
|
+
const key = `${color.file}:${color.line}:${color.originalValue}`;
|
|
6
|
+
if (!seen.has(key)) {
|
|
7
|
+
seen.add(key);
|
|
8
|
+
result.push(color);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=deduplicateColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduplicateColors.js","sourceRoot":"","sources":["../../../src/functions/vue/deduplicateColors.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,iBAAiB,CAAC,MAAwB;IACxD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,MAAM,MAAM,GAAqB,EAAE,CAAA;IAEnC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,aAAa,EAAE,CAAA;QAChE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { VueRuntime, VNode, Component, AppContext } from '../../../references/vue.d';
|
|
2
|
+
import type { HTMLElement, Document } from '../../../references/dom.d';
|
|
3
|
+
export interface DynamicMountOptions {
|
|
4
|
+
props: Record<string, any>;
|
|
5
|
+
container: HTMLElement;
|
|
6
|
+
appContext: AppContext;
|
|
7
|
+
vue: VueRuntime;
|
|
8
|
+
document: Document;
|
|
9
|
+
}
|
|
10
|
+
export declare function dynamicMount(Comp: Component, options: DynamicMountOptions): {
|
|
11
|
+
vnode: VNode;
|
|
12
|
+
update: (newProps: typeof options.props) => void;
|
|
13
|
+
destroy: () => void;
|
|
14
|
+
el: HTMLElement;
|
|
15
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function dynamicMount(Comp, options) {
|
|
2
|
+
let vnode = null;
|
|
3
|
+
const el = options.document.createElement('div');
|
|
4
|
+
options.container.appendChild(el);
|
|
5
|
+
vnode = options.vue.createVNode(Comp, options.props);
|
|
6
|
+
if (vnode) {
|
|
7
|
+
vnode.appContext = options.appContext;
|
|
8
|
+
}
|
|
9
|
+
options.vue.render(vnode, el);
|
|
10
|
+
function update(newProps) {
|
|
11
|
+
vnode = options.vue.createVNode(Comp, newProps);
|
|
12
|
+
if (vnode) {
|
|
13
|
+
vnode.appContext = options.appContext;
|
|
14
|
+
}
|
|
15
|
+
options.vue.render(vnode, el);
|
|
16
|
+
}
|
|
17
|
+
function destroy() {
|
|
18
|
+
options.vue.render(null, el);
|
|
19
|
+
if (el.parentNode) {
|
|
20
|
+
el.parentNode.removeChild(el);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { vnode, update, destroy, el };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=dynamicMount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamicMount.js","sourceRoot":"","sources":["../../../src/functions/vue/dynamicMount.ts"],"names":[],"mappings":"AAiBA,MAAM,UAAU,YAAY,CAC1B,IAAe,EACf,OAA4B;IAE5B,IAAI,KAAK,GAAiB,IAAI,CAAA;IAC9B,MAAM,EAAE,GAAgB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC7D,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IAEjC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACpD,IAAI,KAAK,EAAE,CAAC;QACV,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;IACvC,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAE7B,SAAS,MAAM,CAAC,QAA8B;QAC5C,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC/C,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;QACvC,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAC/B,CAAC;IAED,SAAS,OAAO;QACd,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QAC5B,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC;YACjB,EAAE,CAAC,UAA0B,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function filterSections(sections, options) {
|
|
2
|
+
let filteredSections = sections;
|
|
3
|
+
if (options.includeSections && options.includeSections.length > 0) {
|
|
4
|
+
filteredSections = filteredSections.filter(section => options.includeSections.includes(section.type));
|
|
5
|
+
}
|
|
6
|
+
if (options.excludeSections && options.excludeSections.length > 0) {
|
|
7
|
+
filteredSections = filteredSections.filter(section => !options.excludeSections.includes(section.type));
|
|
8
|
+
}
|
|
9
|
+
return filteredSections;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=filterSections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterSections.js","sourceRoot":"","sources":["../../../src/functions/vue/filterSections.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,cAAc,CAC5B,QAAsB,EACtB,OAA6B;IAE7B,IAAI,gBAAgB,GAAG,QAAQ,CAAA;IAG/B,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAChD,CAAA;IACH,CAAC;IAGD,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,CAAC,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CACjD,CAAA;IACH,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isVNode.js","sourceRoot":"","sources":["../../../src/functions/vue/isVNode.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,OAAO,CAAC,OAAgB;IACtC,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,aAAa,IAAI,OAAO,CACzB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isVueComponent.js","sourceRoot":"","sources":["../../../src/functions/vue/isVueComponent.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,CAAC,CACrE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export function parseVueFile(code) {
|
|
2
|
+
const sections = [];
|
|
3
|
+
const lines = code.split('\n');
|
|
4
|
+
let currentSection = null;
|
|
5
|
+
let sectionStartLine = 0;
|
|
6
|
+
let sectionContent = [];
|
|
7
|
+
for (let i = 0; i < lines.length; i++) {
|
|
8
|
+
const line = lines[i];
|
|
9
|
+
const trimmedLine = line.trim();
|
|
10
|
+
if (trimmedLine.startsWith('<template') && !trimmedLine.includes('</template>')) {
|
|
11
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
12
|
+
currentSection = 'template';
|
|
13
|
+
sectionStartLine = i + 1;
|
|
14
|
+
sectionContent = [];
|
|
15
|
+
}
|
|
16
|
+
else if (trimmedLine.startsWith('<script') && !trimmedLine.includes('</script>')) {
|
|
17
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
18
|
+
currentSection = 'script';
|
|
19
|
+
sectionStartLine = i + 1;
|
|
20
|
+
sectionContent = [];
|
|
21
|
+
}
|
|
22
|
+
else if (trimmedLine.startsWith('<style') && !trimmedLine.includes('</style>')) {
|
|
23
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
24
|
+
currentSection = 'style';
|
|
25
|
+
sectionStartLine = i + 1;
|
|
26
|
+
sectionContent = [];
|
|
27
|
+
}
|
|
28
|
+
else if (trimmedLine === '</template>' ||
|
|
29
|
+
trimmedLine === '</script>' ||
|
|
30
|
+
trimmedLine === '</style>') {
|
|
31
|
+
if (currentSection) {
|
|
32
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
33
|
+
currentSection = null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (currentSection) {
|
|
37
|
+
sectionContent.push(line);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
41
|
+
return sections;
|
|
42
|
+
}
|
|
43
|
+
function saveSectionIfValid(sections, sectionType, startLine, content) {
|
|
44
|
+
if (sectionType && content.length > 0) {
|
|
45
|
+
sections.push({
|
|
46
|
+
type: sectionType,
|
|
47
|
+
content: content.join('\n'),
|
|
48
|
+
startLine,
|
|
49
|
+
endLine: startLine + content.length - 1
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=parseVueFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseVueFile.js","sourceRoot":"","sources":["../../../src/functions/vue/parseVueFile.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,QAAQ,GAAiB,EAAE,CAAA;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE9B,IAAI,cAAc,GAA0B,IAAI,CAAA;IAChD,IAAI,gBAAgB,GAAG,CAAC,CAAA;IACxB,IAAI,cAAc,GAAa,EAAE,CAAA;IAEjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QAG/B,IAAI,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAChF,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;YAC9E,cAAc,GAAG,UAAU,CAAA;YAC3B,gBAAgB,GAAG,CAAC,GAAG,CAAC,CAAA;YACxB,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;aAAM,IAAI,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACnF,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;YAC9E,cAAc,GAAG,QAAQ,CAAA;YACzB,gBAAgB,GAAG,CAAC,GAAG,CAAC,CAAA;YACxB,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;aAAM,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACjF,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;YAC9E,cAAc,GAAG,OAAO,CAAA;YACxB,gBAAgB,GAAG,CAAC,GAAG,CAAC,CAAA;YACxB,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;aAAM,IAAI,WAAW,KAAK,aAAa;YAC7B,WAAW,KAAK,WAAW;YAC3B,WAAW,KAAK,UAAU,EAAE,CAAC;YACtC,IAAI,cAAc,EAAE,CAAC;gBACnB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;gBAC9E,cAAc,GAAG,IAAI,CAAA;YACvB,CAAC;QACH,CAAC;aAAM,IAAI,cAAc,EAAE,CAAC;YAC1B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3B,CAAC;IACH,CAAC;IAGD,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;IAE9E,OAAO,QAAQ,CAAA;AACjB,CAAC;AAMD,SAAS,kBAAkB,CACzB,QAAsB,EACtB,WAAkC,EAClC,SAAiB,EACjB,OAAiB;IAEjB,IAAI,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAC3B,SAAS;YACT,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC;SACxC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ColorReference } from '../../../types/color.d';
|
|
2
|
+
import type { VueProcessorDependencies, VueProcessingOptions } from '../../../types/vue.d';
|
|
3
|
+
export declare function processVueFile(code: string, filePath: string, dependencies: VueProcessorDependencies, options?: VueProcessingOptions): ColorReference[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { parseVueFile } from './parseVueFile';
|
|
2
|
+
import { extractColorsFromVueSection } from './extractColorsFromVueSection';
|
|
3
|
+
import { deduplicateColors } from './deduplicateColors';
|
|
4
|
+
export function processVueFile(code, filePath, dependencies, options = {}) {
|
|
5
|
+
const colors = [];
|
|
6
|
+
const globalColors = dependencies.extractColors(code, filePath, dependencies, options);
|
|
7
|
+
const sections = parseVueFile(code);
|
|
8
|
+
const filteredSections = filterVueSections(sections, options);
|
|
9
|
+
for (const section of filteredSections) {
|
|
10
|
+
const sectionColors = extractColorsFromVueSection(section, filePath, dependencies, options);
|
|
11
|
+
colors.push(...sectionColors);
|
|
12
|
+
}
|
|
13
|
+
const allColors = [...globalColors, ...colors];
|
|
14
|
+
return deduplicateColors(allColors);
|
|
15
|
+
}
|
|
16
|
+
function filterVueSections(sections, options) {
|
|
17
|
+
let filteredSections = sections;
|
|
18
|
+
if (options.includeSections && options.includeSections.length > 0) {
|
|
19
|
+
filteredSections = filteredSections.filter(section => options.includeSections.includes(section.type));
|
|
20
|
+
}
|
|
21
|
+
if (options.excludeSections && options.excludeSections.length > 0) {
|
|
22
|
+
filteredSections = filteredSections.filter(section => !options.excludeSections.includes(section.type));
|
|
23
|
+
}
|
|
24
|
+
return filteredSections;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=processVueFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processVueFile.js","sourceRoot":"","sources":["../../../src/functions/vue/processVueFile.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAkCvD,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,QAAgB,EAChB,YAAsC,EACtC,UAAgC,EAAE;IAElC,MAAM,MAAM,GAAqB,EAAE,CAAA;IAGnC,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,CAAA;IAGtF,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;IAGnC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAG7D,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;QACvC,MAAM,aAAa,GAAG,2BAA2B,CAC/C,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,OAAO,CACR,CAAA;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAA;IAC/B,CAAC;IAGD,MAAM,SAAS,GAAG,CAAC,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC,CAAA;IAC9C,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAA;AACrC,CAAC;AAMD,SAAS,iBAAiB,CACxB,QAAsB,EACtB,OAA6B;IAE7B,IAAI,gBAAgB,GAAG,QAAQ,CAAA;IAG/B,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAChD,CAAA;IACH,CAAC;IAGD,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,CAAC,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CACjD,CAAA;IACH,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function saveVueSection(sections, sectionType, startLine, content) {
|
|
2
|
+
if (sectionType && content.length > 0) {
|
|
3
|
+
sections.push({
|
|
4
|
+
type: sectionType,
|
|
5
|
+
content: content.join('\n'),
|
|
6
|
+
startLine,
|
|
7
|
+
endLine: startLine + content.length - 1
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=saveVueSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saveVueSection.js","sourceRoot":"","sources":["../../../src/functions/vue/saveVueSection.ts"],"names":[],"mappings":"AA6BA,MAAM,UAAU,cAAc,CAC5B,QAAsB,EACtB,WAAkC,EAClC,SAAiB,EACjB,OAAiB;IAEjB,IAAI,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAC3B,SAAS;YACT,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC;SACxC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const wxDownloadFile = (url, fileName, wx) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
if (!url || typeof url !== 'string') {
|
|
4
|
+
reject(new Error('Download URL cannot be empty and must be a string'));
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
if (!fileName || typeof fileName !== 'string') {
|
|
8
|
+
reject(new Error('File name cannot be empty and must be a string'));
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const downloadOptions = {
|
|
12
|
+
url,
|
|
13
|
+
filePath: `${wx.env.USER_DATA_PATH}/${fileName}`,
|
|
14
|
+
success: (res) => {
|
|
15
|
+
if (res.statusCode === 200) {
|
|
16
|
+
resolve(res.filePath);
|
|
17
|
+
}
|
|
18
|
+
else if (res.statusCode === 404) {
|
|
19
|
+
reject(new Error(`File not found, please check the download URL: ${url}`));
|
|
20
|
+
}
|
|
21
|
+
else if (res.statusCode >= 400 && res.statusCode < 500) {
|
|
22
|
+
reject(new Error(`Client error, status code: ${res.statusCode}`));
|
|
23
|
+
}
|
|
24
|
+
else if (res.statusCode >= 500) {
|
|
25
|
+
reject(new Error(`Server error, status code: ${res.statusCode}`));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
reject(new Error(`Download failed, status code: ${res.statusCode}`));
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
fail: (err) => {
|
|
32
|
+
const errorMessage = typeof err === 'string' ? err : err?.errMsg || 'Unknown error';
|
|
33
|
+
reject(new Error(`File download failed: ${errorMessage}`));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
wx.downloadFile(downloadOptions);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=downloadFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadFile.js","sourceRoot":"","sources":["../../../../src/functions/wechat/miniapp/downloadFile.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,QAAgB,EAAE,EAAM,EAAmB,EAAE;IACvF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAErC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QAED,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,CAAC,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC,CAAC;YACpE,OAAO;QACT,CAAC;QAED,MAAM,eAAe,GAAG;YACtB,GAAG;YAEH,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,cAAc,IAAI,QAAQ,EAAE;YAChD,OAAO,EAAE,CAAC,GAA6C,EAAE,EAAE;gBACzD,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAC3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACxB,CAAC;qBAAM,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAClC,MAAM,CAAC,IAAI,KAAK,CAAC,kDAAkD,GAAG,EAAE,CAAC,CAAC,CAAC;gBAC7E,CAAC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC;oBACzD,MAAM,CAAC,IAAI,KAAK,CAAC,8BAA8B,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;gBACpE,CAAC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;oBACjC,MAAM,CAAC,IAAI,KAAK,CAAC,8BAA8B,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;gBACpE,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,KAAK,CAAC,iCAAiC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;gBACvE,CAAC;YACH,CAAC;YACD,IAAI,EAAE,CAAC,GAAQ,EAAE,EAAE;gBACjB,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,IAAI,eAAe,CAAC;gBACpF,MAAM,CAAC,IAAI,KAAK,CAAC,yBAAyB,YAAY,EAAE,CAAC,CAAC,CAAC;YAC7D,CAAC;SACF,CAAC;QAEF,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Ref, VueRuntime } from '../../references/vue.d';
|
|
2
|
+
import type { Window } from '../../references/browser.d';
|
|
3
|
+
export interface UseAiOptions {
|
|
4
|
+
readonly apiUrl: string;
|
|
5
|
+
readonly endpoint?: string;
|
|
6
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
7
|
+
readonly extraPayload?: Readonly<Record<string, unknown>>;
|
|
8
|
+
}
|
|
9
|
+
export interface AiResponseData {
|
|
10
|
+
readonly content?: string;
|
|
11
|
+
readonly done?: boolean;
|
|
12
|
+
readonly error?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class AiError extends Error {
|
|
15
|
+
readonly code: string;
|
|
16
|
+
readonly originalError?: unknown | undefined;
|
|
17
|
+
constructor(message: string, code: string, originalError?: unknown | undefined);
|
|
18
|
+
}
|
|
19
|
+
export interface UseAiReturn {
|
|
20
|
+
readonly response: Ref<string>;
|
|
21
|
+
readonly isLoading: Ref<boolean>;
|
|
22
|
+
readonly error: Ref<AiError | null>;
|
|
23
|
+
readonly completions: (prompt: string) => Promise<void>;
|
|
24
|
+
readonly abort: () => void;
|
|
25
|
+
readonly reset: () => void;
|
|
26
|
+
}
|
|
27
|
+
export default function useAi(options: UseAiOptions, vueAPI: VueRuntime, browserEnv: Window): UseAiReturn;
|