zcw-shared 1.9.0 → 1.10.1
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/constants/colorPatterns.d.ts +8 -0
- package/dist/constants/colorPatterns.js +9 -1
- package/dist/constants/colorPatterns.js.map +1 -1
- package/dist/functions/color/detectColorFormat.js +11 -11
- package/dist/functions/color/detectColorFormat.js.map +1 -1
- package/dist/functions/color/extractColors.d.ts +1 -0
- package/dist/functions/color/extractColors.js +13 -79
- package/dist/functions/color/extractColors.js.map +1 -1
- package/package.json +2 -1
- package/references/xpath.d.ts +60 -0
- package/types/android-build.d.ts +2 -0
- package/types/uniapp-android-build.d.ts +2 -0
- package/dist/constants/namedColors.d.ts +0 -16
- package/dist/constants/namedColors.js +0 -17
- package/dist/constants/namedColors.js.map +0 -1
- package/dist/constants/softwareConfigs.d.ts +0 -14
- package/dist/constants/softwareConfigs.js +0 -156
- package/dist/constants/softwareConfigs.js.map +0 -1
- package/dist/functions/ag-grid/generateLicense.d.ts +0 -3
- package/dist/functions/ag-grid/generateLicense.js +0 -12
- package/dist/functions/ag-grid/generateLicense.js.map +0 -1
- package/dist/functions/altool/createAltoolClient.d.ts +0 -21
- package/dist/functions/altool/createAltoolClient.js +0 -53
- package/dist/functions/altool/createAltoolClient.js.map +0 -1
- package/dist/functions/altool/getAltoolAuth.d.ts +0 -2
- package/dist/functions/altool/getAltoolAuth.js +0 -8
- package/dist/functions/altool/getAltoolAuth.js.map +0 -1
- package/dist/functions/altool/getAppInfo.d.ts +0 -13
- package/dist/functions/altool/getAppInfo.js +0 -39
- package/dist/functions/altool/getAppInfo.js.map +0 -1
- package/dist/functions/altool/index.d.ts +0 -10
- package/dist/functions/altool/index.js +0 -6
- package/dist/functions/altool/index.js.map +0 -1
- package/dist/functions/altool/isApiKeyAuth.d.ts +0 -2
- package/dist/functions/altool/isApiKeyAuth.js +0 -4
- package/dist/functions/altool/isApiKeyAuth.js.map +0 -1
- package/dist/functions/altool/isCredentialsAuth.d.ts +0 -2
- package/dist/functions/altool/isCredentialsAuth.js +0 -4
- package/dist/functions/altool/isCredentialsAuth.js.map +0 -1
- package/dist/functions/altool/parseAppInfoOutput.d.ts +0 -2
- package/dist/functions/altool/parseAppInfoOutput.js +0 -55
- package/dist/functions/altool/parseAppInfoOutput.js.map +0 -1
- package/dist/functions/altool/parseValidationOutput.d.ts +0 -6
- package/dist/functions/altool/parseValidationOutput.js +0 -21
- package/dist/functions/altool/parseValidationOutput.js.map +0 -1
- package/dist/functions/altool/types.d.ts +0 -26
- package/dist/functions/altool/types.js +0 -7
- package/dist/functions/altool/types.js.map +0 -1
- package/dist/functions/altool/uploadApp.d.ts +0 -6
- package/dist/functions/altool/uploadApp.js +0 -36
- package/dist/functions/altool/uploadApp.js.map +0 -1
- package/dist/functions/altool/validateApp.d.ts +0 -17
- package/dist/functions/altool/validateApp.js +0 -40
- package/dist/functions/altool/validateApp.js.map +0 -1
- package/dist/functions/android/buildProject.d.ts +0 -12
- package/dist/functions/android/buildProject.js +0 -123
- package/dist/functions/android/buildProject.js.map +0 -1
- package/dist/functions/android/modifyGradle.d.ts +0 -17
- package/dist/functions/android/modifyGradle.js +0 -69
- package/dist/functions/android/modifyGradle.js.map +0 -1
- package/dist/functions/android/modifyManifest.d.ts +0 -23
- package/dist/functions/android/modifyManifest.js +0 -198
- package/dist/functions/android/modifyManifest.js.map +0 -1
- package/dist/functions/android/permission.d.ts +0 -30
- package/dist/functions/android/permission.js +0 -65
- package/dist/functions/android/permission.js.map +0 -1
- package/dist/functions/base64/strToBase64.d.ts +0 -2
- package/dist/functions/base64/strToBase64.js +0 -6
- package/dist/functions/base64/strToBase64.js.map +0 -1
- package/dist/functions/color/colorValidation.d.ts +0 -11
- package/dist/functions/color/colorValidation.js +0 -35
- package/dist/functions/color/colorValidation.js.map +0 -1
- package/dist/functions/color/deduplicateColors.d.ts +0 -4
- package/dist/functions/color/deduplicateColors.js +0 -40
- package/dist/functions/color/deduplicateColors.js.map +0 -1
- package/dist/functions/color-converter/COLOR_PATTERNS.d.ts +0 -2
- package/dist/functions/color-converter/COLOR_PATTERNS.js +0 -9
- package/dist/functions/color-converter/COLOR_PATTERNS.js.map +0 -1
- package/dist/functions/color-converter/colorPatterns.d.ts +0 -4
- package/dist/functions/color-converter/colorPatterns.js +0 -41
- package/dist/functions/color-converter/colorPatterns.js.map +0 -1
- package/dist/functions/color-converter/convertColor.d.ts +0 -6
- package/dist/functions/color-converter/convertColor.js +0 -12
- package/dist/functions/color-converter/convertColor.js.map +0 -1
- package/dist/functions/color-converter/createColorReference.d.ts +0 -2
- package/dist/functions/color-converter/createColorReference.js +0 -12
- package/dist/functions/color-converter/createColorReference.js.map +0 -1
- package/dist/functions/color-converter/detectColorFormat.d.ts +0 -2
- package/dist/functions/color-converter/detectColorFormat.js +0 -19
- package/dist/functions/color-converter/detectColorFormat.js.map +0 -1
- package/dist/functions/color-converter/extractColors.d.ts +0 -3
- package/dist/functions/color-converter/extractColors.js +0 -16
- package/dist/functions/color-converter/extractColors.js.map +0 -1
- package/dist/functions/color-converter/extractColorsFromLine.d.ts +0 -2
- package/dist/functions/color-converter/extractColorsFromLine.js +0 -18
- package/dist/functions/color-converter/extractColorsFromLine.js.map +0 -1
- package/dist/functions/color-converter/extractColorsGeneric.d.ts +0 -2
- package/dist/functions/color-converter/extractColorsGeneric.js +0 -12
- package/dist/functions/color-converter/extractColorsGeneric.js.map +0 -1
- package/dist/functions/color-converter/extractCssVariableReferences.d.ts +0 -2
- package/dist/functions/color-converter/extractCssVariableReferences.js +0 -15
- package/dist/functions/color-converter/extractCssVariableReferences.js.map +0 -1
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.d.ts +0 -2
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js +0 -15
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js.map +0 -1
- package/dist/functions/color-converter/formatColorOutput.d.ts +0 -5
- package/dist/functions/color-converter/formatColorOutput.js +0 -48
- package/dist/functions/color-converter/formatColorOutput.js.map +0 -1
- package/dist/functions/color-converter/getColorPatterns.d.ts +0 -2
- package/dist/functions/color-converter/getColorPatterns.js +0 -11
- package/dist/functions/color-converter/getColorPatterns.js.map +0 -1
- package/dist/functions/color-converter/getNamedColorMap.d.ts +0 -2
- package/dist/functions/color-converter/getNamedColorMap.js +0 -19
- package/dist/functions/color-converter/getNamedColorMap.js.map +0 -1
- package/dist/functions/color-converter/hexToRgb.d.ts +0 -2
- package/dist/functions/color-converter/hexToRgb.js +0 -42
- package/dist/functions/color-converter/hexToRgb.js.map +0 -1
- package/dist/functions/color-converter/hslToRgb.d.ts +0 -2
- package/dist/functions/color-converter/hslToRgb.js +0 -78
- package/dist/functions/color-converter/hslToRgb.js.map +0 -1
- package/dist/functions/color-converter/hslToRgbInternal.d.ts +0 -2
- package/dist/functions/color-converter/hslToRgbInternal.js +0 -24
- package/dist/functions/color-converter/hslToRgbInternal.js.map +0 -1
- package/dist/functions/color-converter/hueToRgb.d.ts +0 -1
- package/dist/functions/color-converter/hueToRgb.js +0 -14
- package/dist/functions/color-converter/hueToRgb.js.map +0 -1
- package/dist/functions/color-converter/isColorValue.d.ts +0 -2
- package/dist/functions/color-converter/isColorValue.js +0 -79
- package/dist/functions/color-converter/isColorValue.js.map +0 -1
- package/dist/functions/color-converter/isValidColorValue.d.ts +0 -1
- package/dist/functions/color-converter/isValidColorValue.js +0 -4
- package/dist/functions/color-converter/isValidColorValue.js.map +0 -1
- package/dist/functions/color-converter/isValidHslColor.d.ts +0 -2
- package/dist/functions/color-converter/isValidHslColor.js +0 -14
- package/dist/functions/color-converter/isValidHslColor.js.map +0 -1
- package/dist/functions/color-converter/isValidRgbColor.d.ts +0 -2
- package/dist/functions/color-converter/isValidRgbColor.js +0 -14
- package/dist/functions/color-converter/isValidRgbColor.js.map +0 -1
- package/dist/functions/color-converter/normalizeColor.d.ts +0 -1
- package/dist/functions/color-converter/normalizeColor.js +0 -49
- package/dist/functions/color-converter/normalizeColor.js.map +0 -1
- package/dist/functions/color-converter/normalizeColorInput.d.ts +0 -6
- package/dist/functions/color-converter/normalizeColorInput.js +0 -94
- package/dist/functions/color-converter/normalizeColorInput.js.map +0 -1
- package/dist/functions/color-converter/parseColorString.d.ts +0 -12
- package/dist/functions/color-converter/parseColorString.js +0 -89
- package/dist/functions/color-converter/parseColorString.js.map +0 -1
- package/dist/functions/color-converter/parseCssVariables.d.ts +0 -2
- package/dist/functions/color-converter/parseCssVariables.js +0 -19
- package/dist/functions/color-converter/parseCssVariables.js.map +0 -1
- package/dist/functions/color-converter/parseHexColor.d.ts +0 -6
- package/dist/functions/color-converter/parseHexColor.js +0 -42
- package/dist/functions/color-converter/parseHexColor.js.map +0 -1
- package/dist/functions/color-converter/rgbToHex.d.ts +0 -2
- package/dist/functions/color-converter/rgbToHex.js +0 -65
- package/dist/functions/color-converter/rgbToHex.js.map +0 -1
- package/dist/functions/color-converter/rgbToHslInternal.d.ts +0 -2
- package/dist/functions/color-converter/rgbToHslInternal.js +0 -31
- package/dist/functions/color-converter/rgbToHslInternal.js.map +0 -1
- package/dist/functions/color-converter/standardizeColor.d.ts +0 -1
- package/dist/functions/color-converter/standardizeColor.js +0 -147
- package/dist/functions/color-converter/standardizeColor.js.map +0 -1
- package/dist/functions/css/extractCssVariables.d.ts +0 -12
- package/dist/functions/css/extractCssVariables.js +0 -53
- package/dist/functions/css/extractCssVariables.js.map +0 -1
- package/dist/functions/debug/createDebugger.d.ts +0 -21
- package/dist/functions/debug/createDebugger.js +0 -89
- package/dist/functions/debug/createDebugger.js.map +0 -1
- package/dist/functions/desensitize/desensitizeName.d.ts +0 -1
- package/dist/functions/desensitize/desensitizeName.js +0 -8
- package/dist/functions/desensitize/desensitizeName.js.map +0 -1
- package/dist/functions/desensitize/desensitizePhone.d.ts +0 -1
- package/dist/functions/desensitize/desensitizePhone.js +0 -8
- package/dist/functions/desensitize/desensitizePhone.js.map +0 -1
- package/dist/functions/dom/detectOverflow.d.ts +0 -8
- package/dist/functions/dom/detectOverflow.js +0 -17
- package/dist/functions/dom/detectOverflow.js.map +0 -1
- package/dist/functions/dom/getElementRect.d.ts +0 -3
- package/dist/functions/dom/getElementRect.js +0 -14
- package/dist/functions/dom/getElementRect.js.map +0 -1
- package/dist/functions/dom/getRelativePosition.d.ts +0 -3
- package/dist/functions/dom/getRelativePosition.js +0 -14
- package/dist/functions/dom/getRelativePosition.js.map +0 -1
- package/dist/functions/dom/getViewportRect.d.ts +0 -3
- package/dist/functions/dom/getViewportRect.js +0 -15
- package/dist/functions/dom/getViewportRect.js.map +0 -1
- package/dist/functions/dom/getViewportSize.d.ts +0 -5
- package/dist/functions/dom/getViewportSize.js +0 -7
- package/dist/functions/dom/getViewportSize.js.map +0 -1
- package/dist/functions/image/generateMacIcons.d.ts +0 -6
- package/dist/functions/image/generateMacIcons.js +0 -15
- package/dist/functions/image/generateMacIcons.js.map +0 -1
- package/dist/functions/image/generateMacTrayIcon.d.ts +0 -7
- package/dist/functions/image/generateMacTrayIcon.js +0 -15
- package/dist/functions/image/generateMacTrayIcon.js.map +0 -1
- package/dist/functions/image/generatePaddedImage.d.ts +0 -3
- package/dist/functions/image/generatePaddedImage.js +0 -14
- package/dist/functions/image/generatePaddedImage.js.map +0 -1
- package/dist/functions/image/generatePwaIcons.d.ts +0 -6
- package/dist/functions/image/generatePwaIcons.js +0 -15
- package/dist/functions/image/generatePwaIcons.js.map +0 -1
- package/dist/functions/image/generateRoundedImage.d.ts +0 -3
- package/dist/functions/image/generateRoundedImage.js +0 -17
- package/dist/functions/image/generateRoundedImage.js.map +0 -1
- package/dist/functions/ipc/dispatchIpcRequest.d.ts +0 -6
- package/dist/functions/ipc/dispatchIpcRequest.js +0 -10
- package/dist/functions/ipc/dispatchIpcRequest.js.map +0 -1
- package/dist/functions/software/buildPathExecutables.d.ts +0 -1
- package/dist/functions/software/buildPathExecutables.js +0 -14
- package/dist/functions/software/buildPathExecutables.js.map +0 -1
- package/dist/functions/software/buildSoftwarePaths.d.ts +0 -2
- package/dist/functions/software/buildSoftwarePaths.js +0 -22
- package/dist/functions/software/buildSoftwarePaths.js.map +0 -1
- package/dist/functions/software/createConfigGenerator.d.ts +0 -8
- package/dist/functions/software/createConfigGenerator.js +0 -13
- package/dist/functions/software/createConfigGenerator.js.map +0 -1
- package/dist/functions/software/detectPlatform.d.ts +0 -2
- package/dist/functions/software/detectPlatform.js +0 -9
- package/dist/functions/software/detectPlatform.js.map +0 -1
- package/dist/functions/software/find.d.ts +0 -2
- package/dist/functions/software/find.js +0 -12
- package/dist/functions/software/find.js.map +0 -1
- package/dist/functions/software/findSoftware.d.ts +0 -13
- package/dist/functions/software/findSoftware.js +0 -41
- package/dist/functions/software/findSoftware.js.map +0 -1
- package/dist/functions/software/findSoftwareWithGenerator.d.ts +0 -3
- package/dist/functions/software/findSoftwareWithGenerator.js +0 -8
- package/dist/functions/software/findSoftwareWithGenerator.js.map +0 -1
- package/dist/functions/software/getConfigGenerator.d.ts +0 -2
- package/dist/functions/software/getConfigGenerator.js +0 -10
- package/dist/functions/software/getConfigGenerator.js.map +0 -1
- package/dist/functions/software/getEnvironmentSoftwarePath.d.ts +0 -1
- package/dist/functions/software/getEnvironmentSoftwarePath.js +0 -8
- package/dist/functions/software/getEnvironmentSoftwarePath.js.map +0 -1
- package/dist/functions/software/getSupportedSoftware.d.ts +0 -1
- package/dist/functions/software/getSupportedSoftware.js +0 -5
- package/dist/functions/software/getSupportedSoftware.js.map +0 -1
- package/dist/functions/software/parseEnvironmentPaths.d.ts +0 -1
- package/dist/functions/software/parseEnvironmentPaths.js +0 -11
- package/dist/functions/software/parseEnvironmentPaths.js.map +0 -1
- package/dist/functions/software/softwareConfigs.d.ts +0 -2
- package/dist/functions/software/softwareConfigs.js +0 -148
- package/dist/functions/software/softwareConfigs.js.map +0 -1
- package/dist/functions/software/softwareNameMap.d.ts +0 -1
- package/dist/functions/software/softwareNameMap.js +0 -9
- package/dist/functions/software/softwareNameMap.js.map +0 -1
- package/dist/functions/software/types.d.ts +0 -11
- package/dist/functions/software/types.js +0 -2
- package/dist/functions/software/types.js.map +0 -1
- package/dist/functions/string/base64.d.ts +0 -2
- package/dist/functions/string/base64.js +0 -6
- package/dist/functions/string/base64.js.map +0 -1
- package/dist/functions/string/camelCase.d.ts +0 -1
- package/dist/functions/string/camelCase.js +0 -8
- package/dist/functions/string/camelCase.js.map +0 -1
- package/dist/functions/string/capitalize.d.ts +0 -1
- package/dist/functions/string/capitalize.js +0 -6
- package/dist/functions/string/capitalize.js.map +0 -1
- package/dist/functions/string/caseConverter.d.ts +0 -19
- package/dist/functions/string/caseConverter.js +0 -94
- package/dist/functions/string/caseConverter.js.map +0 -1
- package/dist/functions/string/desensitize.d.ts +0 -13
- package/dist/functions/string/desensitize.js +0 -107
- package/dist/functions/string/desensitize.js.map +0 -1
- package/dist/functions/string/escape.d.ts +0 -1
- package/dist/functions/string/escape.js +0 -13
- package/dist/functions/string/escape.js.map +0 -1
- package/dist/functions/string/htmlEscape.d.ts +0 -20
- package/dist/functions/string/htmlEscape.js +0 -80
- package/dist/functions/string/htmlEscape.js.map +0 -1
- package/dist/functions/string/kebabCase.d.ts +0 -1
- package/dist/functions/string/kebabCase.js +0 -10
- package/dist/functions/string/kebabCase.js.map +0 -1
- package/dist/functions/string/levenshtein.d.ts +0 -1
- package/dist/functions/string/levenshtein.js +0 -27
- package/dist/functions/string/levenshtein.js.map +0 -1
- package/dist/functions/string/mask.d.ts +0 -1
- package/dist/functions/string/mask.js +0 -40
- package/dist/functions/string/mask.js.map +0 -1
- package/dist/functions/string/normalize.d.ts +0 -8
- package/dist/functions/string/normalize.js +0 -37
- package/dist/functions/string/normalize.js.map +0 -1
- package/dist/functions/string/pad.d.ts +0 -13
- package/dist/functions/string/pad.js +0 -50
- package/dist/functions/string/pad.js.map +0 -1
- package/dist/functions/string/padEnd.d.ts +0 -1
- package/dist/functions/string/padEnd.js +0 -8
- package/dist/functions/string/padEnd.js.map +0 -1
- package/dist/functions/string/padStart.d.ts +0 -1
- package/dist/functions/string/padStart.js +0 -8
- package/dist/functions/string/padStart.js.map +0 -1
- package/dist/functions/string/palindrome.d.ts +0 -3
- package/dist/functions/string/palindrome.js +0 -15
- package/dist/functions/string/palindrome.js.map +0 -1
- package/dist/functions/string/pascalCase.d.ts +0 -1
- package/dist/functions/string/pascalCase.js +0 -8
- package/dist/functions/string/pascalCase.js.map +0 -1
- package/dist/functions/string/similarity.d.ts +0 -1
- package/dist/functions/string/similarity.js +0 -13
- package/dist/functions/string/similarity.js.map +0 -1
- package/dist/functions/string/snakeCase.d.ts +0 -1
- package/dist/functions/string/snakeCase.js +0 -10
- package/dist/functions/string/snakeCase.js.map +0 -1
- package/dist/functions/string/template.d.ts +0 -4
- package/dist/functions/string/template.js +0 -21
- package/dist/functions/string/template.js.map +0 -1
- package/dist/functions/string/unescape.d.ts +0 -1
- package/dist/functions/string/unescape.js +0 -13
- package/dist/functions/string/unescape.js.map +0 -1
- package/dist/functions/string/wordCount.d.ts +0 -5
- package/dist/functions/string/wordCount.js +0 -11
- package/dist/functions/string/wordCount.js.map +0 -1
- package/dist/functions/tencent-cloud/getSecret.d.ts +0 -6
- package/dist/functions/tencent-cloud/getSecret.js +0 -18
- package/dist/functions/tencent-cloud/getSecret.js.map +0 -1
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.d.ts +0 -13
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js +0 -175
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js.map +0 -1
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +0 -19
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js +0 -55
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +0 -1
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +0 -2
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +0 -149
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +0 -1
- package/dist/functions/uniapp/app-plus/buildAndroidProject.d.ts +0 -3
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js +0 -60
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.d.ts +0 -5
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js +0 -51
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureAndroidProject.d.ts +0 -3
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js +0 -63
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureBuildGradle.d.ts +0 -9
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js +0 -57
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureDcloudControl.d.ts +0 -5
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js +0 -34
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureStrings.d.ts +0 -5
- package/dist/functions/uniapp/app-plus/configureStrings.js +0 -42
- package/dist/functions/uniapp/app-plus/configureStrings.js.map +0 -1
- package/dist/functions/uniapp/app-plus/copyAppResources.d.ts +0 -8
- package/dist/functions/uniapp/app-plus/copyAppResources.js +0 -25
- package/dist/functions/uniapp/app-plus/copyAppResources.js.map +0 -1
- package/dist/functions/uniapp/app-plus/copyDirectory.d.ts +0 -2
- package/dist/functions/uniapp/app-plus/copyDirectory.js +0 -18
- package/dist/functions/uniapp/app-plus/copyDirectory.js.map +0 -1
- package/dist/functions/uniapp/app-plus/generateUniAppResources.d.ts +0 -2
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js +0 -35
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js.map +0 -1
- package/dist/functions/uniapp/app-plus/parseManifest.d.ts +0 -14
- package/dist/functions/uniapp/app-plus/parseManifest.js +0 -44
- package/dist/functions/uniapp/app-plus/parseManifest.js.map +0 -1
- package/dist/functions/uniapp/app-plus/validateOptions.d.ts +0 -3
- package/dist/functions/uniapp/app-plus/validateOptions.js +0 -10
- package/dist/functions/uniapp/app-plus/validateOptions.js.map +0 -1
- package/dist/functions/uniapp/build.d.ts +0 -20
- package/dist/functions/uniapp/build.js +0 -84
- package/dist/functions/uniapp/build.js.map +0 -1
- package/dist/functions/uniapp/detectAndroidProjectStructure.d.ts +0 -7
- package/dist/functions/uniapp/detectAndroidProjectStructure.js +0 -30
- package/dist/functions/uniapp/detectAndroidProjectStructure.js.map +0 -1
- package/dist/functions/uniapp/detectProjectType.d.ts +0 -16
- package/dist/functions/uniapp/detectProjectType.js +0 -68
- package/dist/functions/uniapp/detectProjectType.js.map +0 -1
- package/dist/functions/uniapp/parseManifest.d.ts +0 -12
- package/dist/functions/uniapp/parseManifest.js +0 -46
- package/dist/functions/uniapp/parseManifest.js.map +0 -1
- package/dist/functions/uniapp/waitForPages.d.ts +0 -3
- package/dist/functions/uniapp/waitForPages.js +0 -20
- package/dist/functions/uniapp/waitForPages.js.map +0 -1
- package/dist/functions/utils/compose.d.ts +0 -1
- package/dist/functions/utils/compose.js +0 -10
- package/dist/functions/utils/compose.js.map +0 -1
- package/dist/functions/utils/cond.d.ts +0 -1
- package/dist/functions/utils/cond.js +0 -15
- package/dist/functions/utils/cond.js.map +0 -1
- package/dist/functions/utils/curry.d.ts +0 -1
- package/dist/functions/utils/curry.js +0 -13
- package/dist/functions/utils/curry.js.map +0 -1
- package/dist/functions/utils/debounce.d.ts +0 -1
- package/dist/functions/utils/debounce.js +0 -13
- package/dist/functions/utils/debounce.js.map +0 -1
- package/dist/functions/utils/evolve.d.ts +0 -3
- package/dist/functions/utils/evolve.js +0 -15
- package/dist/functions/utils/evolve.js.map +0 -1
- package/dist/functions/utils/flow.d.ts +0 -1
- package/dist/functions/utils/flow.js +0 -14
- package/dist/functions/utils/flow.js.map +0 -1
- package/dist/functions/utils/generateExports.d.ts +0 -16
- package/dist/functions/utils/generateExports.js +0 -34
- package/dist/functions/utils/generateExports.js.map +0 -1
- package/dist/functions/utils/isType.d.ts +0 -11
- package/dist/functions/utils/isType.js +0 -30
- package/dist/functions/utils/isType.js.map +0 -1
- package/dist/functions/utils/memoize.d.ts +0 -1
- package/dist/functions/utils/memoize.js +0 -13
- package/dist/functions/utils/memoize.js.map +0 -1
- package/dist/functions/utils/once.d.ts +0 -1
- package/dist/functions/utils/once.js +0 -13
- package/dist/functions/utils/once.js.map +0 -1
- package/dist/functions/utils/partial.d.ts +0 -1
- package/dist/functions/utils/partial.js +0 -13
- package/dist/functions/utils/partial.js.map +0 -1
- package/dist/functions/utils/pipe.d.ts +0 -1
- package/dist/functions/utils/pipe.js +0 -10
- package/dist/functions/utils/pipe.js.map +0 -1
- package/dist/functions/utils/retryWithBackoff.d.ts +0 -9
- package/dist/functions/utils/retryWithBackoff.js +0 -30
- package/dist/functions/utils/retryWithBackoff.js.map +0 -1
- package/dist/functions/utils/tap.d.ts +0 -1
- package/dist/functions/utils/tap.js +0 -14
- package/dist/functions/utils/tap.js.map +0 -1
- package/dist/functions/utils/throttle.d.ts +0 -1
- package/dist/functions/utils/throttle.js +0 -11
- package/dist/functions/utils/throttle.js.map +0 -1
- package/dist/functions/utils/until.d.ts +0 -1
- package/dist/functions/utils/until.js +0 -10
- package/dist/functions/utils/until.js.map +0 -1
- package/dist/functions/utils/validate.d.ts +0 -8
- package/dist/functions/utils/validate.js +0 -45
- package/dist/functions/utils/validate.js.map +0 -1
- package/dist/functions/utils/walk.d.ts +0 -11
- package/dist/functions/utils/walk.js +0 -27
- package/dist/functions/utils/walk.js.map +0 -1
- package/dist/functions/vue/checkVueType.d.ts +0 -8
- package/dist/functions/vue/checkVueType.js +0 -29
- package/dist/functions/vue/checkVueType.js.map +0 -1
- package/dist/functions/vue/deduplicateColors.d.ts +0 -2
- package/dist/functions/vue/deduplicateColors.js +0 -13
- package/dist/functions/vue/deduplicateColors.js.map +0 -1
- package/dist/functions/vue/dynamicMount.d.ts +0 -15
- package/dist/functions/vue/dynamicMount.js +0 -25
- package/dist/functions/vue/dynamicMount.js.map +0 -1
- package/dist/functions/vue/filterSections.d.ts +0 -2
- package/dist/functions/vue/filterSections.js +0 -11
- package/dist/functions/vue/filterSections.js.map +0 -1
- package/dist/functions/vue/isVNode.d.ts +0 -2
- package/dist/functions/vue/isVNode.js +0 -6
- package/dist/functions/vue/isVNode.js.map +0 -1
- package/dist/functions/vue/isVueComponent.d.ts +0 -2
- package/dist/functions/vue/isVueComponent.js +0 -6
- package/dist/functions/vue/isVueComponent.js.map +0 -1
- package/dist/functions/vue/parseVueFile.d.ts +0 -2
- package/dist/functions/vue/parseVueFile.js +0 -53
- package/dist/functions/vue/parseVueFile.js.map +0 -1
- package/dist/functions/vue/processVueFile.d.ts +0 -3
- package/dist/functions/vue/processVueFile.js +0 -26
- package/dist/functions/vue/processVueFile.js.map +0 -1
- package/dist/functions/vue/saveVueSection.d.ts +0 -2
- package/dist/functions/vue/saveVueSection.js +0 -11
- package/dist/functions/vue/saveVueSection.js.map +0 -1
- package/dist/functions/wechat/miniapp/downloadFile.d.ts +0 -2
- package/dist/functions/wechat/miniapp/downloadFile.js +0 -39
- package/dist/functions/wechat/miniapp/downloadFile.js.map +0 -1
- package/dist/functions/xml/modifyXml.d.ts +0 -11
- package/dist/functions/xml/modifyXml.js +0 -46
- package/dist/functions/xml/modifyXml.js.map +0 -1
- package/dist/hooks/useAi.d.ts +0 -27
- package/dist/hooks/useAi.js +0 -163
- package/dist/hooks/useAi.js.map +0 -1
- package/dist/hooks/useAltool.d.ts +0 -39
- package/dist/hooks/useAltool.js +0 -350
- package/dist/hooks/useAltool.js.map +0 -1
- package/dist/hooks/useCache.d.ts +0 -18
- package/dist/hooks/useCache.js +0 -82
- package/dist/hooks/useCache.js.map +0 -1
- package/dist/hooks/useFetch.d.ts +0 -3
- package/dist/hooks/useFetch.js +0 -154
- package/dist/hooks/useFetch.js.map +0 -1
- package/dist/hooks/useLocalStorage.d.ts +0 -4
- package/dist/hooks/useLocalStorage.js +0 -100
- package/dist/hooks/useLocalStorage.js.map +0 -1
- package/dist/hooks/usePluginSystem.d.ts +0 -11
- package/dist/hooks/usePluginSystem.js +0 -34
- package/dist/hooks/usePluginSystem.js.map +0 -1
- package/dist/hooks/useRequest.d.ts +0 -3
- package/dist/hooks/useRequest.js +0 -139
- package/dist/hooks/useRequest.js.map +0 -1
- package/dist/hooks/useSessionStorage.d.ts +0 -4
- package/dist/hooks/useSessionStorage.js +0 -100
- package/dist/hooks/useSessionStorage.js.map +0 -1
- package/dist/hooks/useStorage.d.ts +0 -10
- package/dist/hooks/useStorage.js +0 -62
- package/dist/hooks/useStorage.js.map +0 -1
- package/dist/hooks/useStorageWithIndexedDB.d.ts +0 -4
- package/dist/hooks/useStorageWithIndexedDB.js +0 -119
- package/dist/hooks/useStorageWithIndexedDB.js.map +0 -1
- package/dist/hooks/useWASM.d.ts +0 -4
- package/dist/hooks/useWASM.js +0 -263
- package/dist/hooks/useWASM.js.map +0 -1
- package/dist/hooks/useWebWorker.d.ts +0 -25
- package/dist/hooks/useWebWorker.js +0 -209
- package/dist/hooks/useWebWorker.js.map +0 -1
- package/dist/hooks/useWorkerFunction.d.ts +0 -22
- package/dist/hooks/useWorkerFunction.js +0 -191
- package/dist/hooks/useWorkerFunction.js.map +0 -1
- package/dist/hooks/useWorkerPool.d.ts +0 -30
- package/dist/hooks/useWorkerPool.js +0 -242
- package/dist/hooks/useWorkerPool.js.map +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function createColorReference(value, format, file, line, context, originalValue, isVariableReference = false, variableName) {
|
|
2
|
-
return {
|
|
3
|
-
originalValue,
|
|
4
|
-
format,
|
|
5
|
-
file,
|
|
6
|
-
line,
|
|
7
|
-
context: context.trim(),
|
|
8
|
-
isVariableReference,
|
|
9
|
-
variableName
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=createColorReference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createColorReference.js","sourceRoot":"","sources":["../../../src/functions/color-converter/createColorReference.ts"],"names":[],"mappings":"AAsCA,MAAM,UAAU,oBAAoB,CAClC,KAAa,EACb,MAAgC,EAChC,IAAY,EACZ,IAAY,EACZ,OAAe,EACf,aAAqB,EACrB,sBAA+B,KAAK,EACpC,YAAqB;IAErB,OAAO;QACL,aAAa;QACb,MAAM;QACN,IAAI;QACJ,IAAI;QACJ,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;QACvB,mBAAmB;QACnB,YAAY;KACb,CAAA;AACH,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { getColorPatterns } from './getColorPatterns';
|
|
2
|
-
export function detectColorFormat(color) {
|
|
3
|
-
const trimmedColor = color.trim();
|
|
4
|
-
const patterns = getColorPatterns();
|
|
5
|
-
if (patterns.hex.test(trimmedColor))
|
|
6
|
-
return 'hex';
|
|
7
|
-
if (patterns.rgba.test(trimmedColor))
|
|
8
|
-
return 'rgba';
|
|
9
|
-
if (patterns.rgb.test(trimmedColor))
|
|
10
|
-
return 'rgb';
|
|
11
|
-
if (patterns.hsla.test(trimmedColor))
|
|
12
|
-
return 'hsla';
|
|
13
|
-
if (patterns.hsl.test(trimmedColor))
|
|
14
|
-
return 'hsl';
|
|
15
|
-
if (patterns.namedColors.test(trimmedColor))
|
|
16
|
-
return 'named';
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=detectColorFormat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"detectColorFormat.js","sourceRoot":"","sources":["../../../src/functions/color-converter/detectColorFormat.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAwCrD,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IACjC,MAAM,QAAQ,GAAG,gBAAgB,EAAE,CAAA;IAInC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,KAAK,CAAA;IACjD,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,MAAM,CAAA;IACnD,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,KAAK,CAAA;IACjD,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,MAAM,CAAA;IACnD,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,KAAK,CAAA;IACjD,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,OAAO,CAAA;IAE3D,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ColorReference, ColorExtractorDependencies, ColorExtractionOptions } from '../../../types/color';
|
|
2
|
-
export type { ColorExtractorDependencies, ColorExtractionOptions } from '../../../types/color';
|
|
3
|
-
export declare function extractColors(code: string, filePath: string, dependencies: ColorExtractorDependencies, options?: ColorExtractionOptions): ColorReference[];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { extractColorsFromLine } from './extractColorsFromLine';
|
|
2
|
-
import { parseCssVariables } from './parseCssVariables';
|
|
3
|
-
export function extractColors(code, filePath, dependencies, options = {}) {
|
|
4
|
-
const cssVariables = parseCssVariables(code, filePath, dependencies);
|
|
5
|
-
const thirdPartyVariables = options.thirdPartyVariables || {};
|
|
6
|
-
const colors = [];
|
|
7
|
-
const lines = code.split('\n');
|
|
8
|
-
for (let i = 0; i < lines.length; i++) {
|
|
9
|
-
const line = lines[i];
|
|
10
|
-
const lineNumber = i + 1;
|
|
11
|
-
const lineColors = extractColorsFromLine(line, filePath, lineNumber, dependencies, { cssVariables, thirdPartyVariables });
|
|
12
|
-
colors.push(...lineColors);
|
|
13
|
-
}
|
|
14
|
-
return colors;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=extractColors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractColors.js","sourceRoot":"","sources":["../../../src/functions/color-converter/extractColors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAmCvD,MAAM,UAAU,aAAa,CAC3B,IAAY,EACZ,QAAgB,EAChB,YAAwC,EACxC,UAAkC,EAAE;IAGpC,MAAM,YAAY,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;IAGpE,MAAM,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,IAAI,EAAE,CAAA;IAE7D,MAAM,MAAM,GAAqB,EAAE,CAAA;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE9B,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,UAAU,GAAG,CAAC,GAAG,CAAC,CAAA;QAGxB,MAAM,UAAU,GAAG,qBAAqB,CACtC,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,EAAE,YAAY,EAAE,mBAAmB,EAAE,CACtC,CAAA;QAED,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { ColorReference, ColorExtractorDependencies, ColorExtractionOptions } from '../../../types/color';
|
|
2
|
-
export declare function extractColorsFromLine(line: string, filePath: string, lineNumber: number, dependencies: ColorExtractorDependencies, options?: ColorExtractionOptions): ColorReference[];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { extractColorsGeneric } from './extractColorsGeneric';
|
|
2
|
-
import { extractCssVariableReferences } from './extractCssVariableReferences';
|
|
3
|
-
import { extractThirdPartyVariableReferences } from './extractThirdPartyVariableReferences';
|
|
4
|
-
export function extractColorsFromLine(line, filePath, lineNumber, dependencies, options = {}) {
|
|
5
|
-
const { cssVariables = {}, thirdPartyVariables = {} } = options;
|
|
6
|
-
const colors = [];
|
|
7
|
-
const patterns = dependencies.getColorPatterns();
|
|
8
|
-
colors.push(...extractColorsGeneric(line, filePath, lineNumber, patterns.hex, 'hex', dependencies));
|
|
9
|
-
colors.push(...extractColorsGeneric(line, filePath, lineNumber, patterns.rgb, 'rgb', dependencies));
|
|
10
|
-
colors.push(...extractColorsGeneric(line, filePath, lineNumber, patterns.rgba, 'rgba', dependencies));
|
|
11
|
-
colors.push(...extractColorsGeneric(line, filePath, lineNumber, patterns.hsl, 'hsl', dependencies));
|
|
12
|
-
colors.push(...extractColorsGeneric(line, filePath, lineNumber, patterns.hsla, 'hsla', dependencies));
|
|
13
|
-
colors.push(...extractColorsGeneric(line, filePath, lineNumber, patterns.namedColors, 'named', dependencies));
|
|
14
|
-
colors.push(...extractCssVariableReferences(line, filePath, lineNumber, patterns, cssVariables));
|
|
15
|
-
colors.push(...extractThirdPartyVariableReferences(line, filePath, lineNumber, patterns, thirdPartyVariables));
|
|
16
|
-
return colors;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=extractColorsFromLine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractColorsFromLine.js","sourceRoot":"","sources":["../../../src/functions/color-converter/extractColorsFromLine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,4BAA4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,EAAE,YAAY,CAAC,CAAC,CAAA;IAC7G,MAAM,CAAC,IAAI,CAAC,GAAG,4BAA4B,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAA;IAChG,MAAM,CAAC,IAAI,CAAC,GAAG,mCAAmC,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAA;IAE9G,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { ColorReference, ColorFormat, ColorExtractorDependencies } from '../../../types/color';
|
|
2
|
-
export declare function extractColorsGeneric(line: string, filePath: string, lineNumber: number, pattern: RegExp, format: ColorFormat, dependencies: ColorExtractorDependencies): ColorReference[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createColorReference } from './createColorReference';
|
|
2
|
-
export function extractColorsGeneric(line, filePath, lineNumber, pattern, format, dependencies) {
|
|
3
|
-
const colors = [];
|
|
4
|
-
const matches = line.matchAll(new RegExp(pattern.source, 'g'));
|
|
5
|
-
for (const match of matches) {
|
|
6
|
-
const originalColor = match[0];
|
|
7
|
-
const standardizedColor = dependencies.standardizeColor(originalColor);
|
|
8
|
-
colors.push(createColorReference(standardizedColor, format, filePath, lineNumber, line, originalColor));
|
|
9
|
-
}
|
|
10
|
-
return colors;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=extractColorsGeneric.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractColorsGeneric.js","sourceRoot":"","sources":["../../../src/functions/color-converter/extractColorsGeneric.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAoC7D,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,QAAgB,EAChB,UAAkB,EAClB,OAAe,EACf,MAAmB,EACnB,YAAwC;IAExC,MAAM,MAAM,GAAqB,EAAE,CAAA;IACnC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;IAE9D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAE9B,MAAM,iBAAiB,GAAG,YAAY,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAA;QAEtE,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAC9B,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,aAAa,CACd,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createColorReference } from './createColorReference';
|
|
2
|
-
export function extractCssVariableReferences(line, filePath, lineNumber, patterns, cssVariables) {
|
|
3
|
-
const colors = [];
|
|
4
|
-
const cssVarPattern = /var\(\s*--([\w-]+)\s*\)/g;
|
|
5
|
-
const matches = line.matchAll(cssVarPattern);
|
|
6
|
-
for (const match of matches) {
|
|
7
|
-
const variableName = match[1];
|
|
8
|
-
const variableValue = cssVariables[variableName];
|
|
9
|
-
if (variableValue) {
|
|
10
|
-
colors.push(createColorReference(variableValue, 'css-variable', filePath, lineNumber, line, variableValue, true, variableName));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return colors;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=extractCssVariableReferences.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractCssVariableReferences.js","sourceRoot":"","sources":["../../../src/functions/color-converter/extractCssVariableReferences.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAmC7D,MAAM,UAAU,4BAA4B,CAC1C,IAAY,EACZ,QAAgB,EAChB,UAAkB,EAClB,QAAuB,EACvB,YAAoC;IAEpC,MAAM,MAAM,GAAqB,EAAE,CAAA;IAGnC,MAAM,aAAa,GAAG,0BAA0B,CAAA;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;IAE5C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAC7B,MAAM,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;QAEhD,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAC9B,aAAa,EACb,cAAc,EACd,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,YAAY,CACb,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createColorReference } from './createColorReference';
|
|
2
|
-
export function extractThirdPartyVariableReferences(line, filePath, lineNumber, patterns, thirdPartyVariables) {
|
|
3
|
-
const colors = [];
|
|
4
|
-
const thirdPartyPattern = /\$([\w-]+)/g;
|
|
5
|
-
const matches = line.matchAll(thirdPartyPattern);
|
|
6
|
-
for (const match of matches) {
|
|
7
|
-
const variableName = match[1];
|
|
8
|
-
const variableValue = thirdPartyVariables[variableName];
|
|
9
|
-
if (variableValue) {
|
|
10
|
-
colors.push(createColorReference(variableValue, 'third-party-variable', filePath, lineNumber, line, variableName, true, variableName));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return colors;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=extractThirdPartyVariableReferences.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractThirdPartyVariableReferences.js","sourceRoot":"","sources":["../../../src/functions/color-converter/extractThirdPartyVariableReferences.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAmC7D,MAAM,UAAU,mCAAmC,CACjD,IAAY,EACZ,QAAgB,EAChB,UAAkB,EAClB,QAAuB,EACvB,mBAA2C;IAE3C,MAAM,MAAM,GAAqB,EAAE,CAAA;IAGnC,MAAM,iBAAiB,GAAG,aAAa,CAAA;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAA;IAEhD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAC7B,MAAM,aAAa,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAA;QAEvD,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAC9B,aAAa,EACb,sBAAsB,EACtB,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,YAAY,CACb,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { getNamedColorMap } from './getNamedColorMap';
|
|
2
|
-
import { rgbToHslInternal } from './rgbToHslInternal';
|
|
3
|
-
export function formatColorOutput(rgb, alpha, targetFormat, options) {
|
|
4
|
-
const { includeAlpha = false, precision = 0 } = options;
|
|
5
|
-
const r = Math.max(0, Math.min(255, Math.round(rgb.r)));
|
|
6
|
-
const g = Math.max(0, Math.min(255, Math.round(rgb.g)));
|
|
7
|
-
const b = Math.max(0, Math.min(255, Math.round(rgb.b)));
|
|
8
|
-
const a = Math.max(0, Math.min(1, alpha));
|
|
9
|
-
switch (targetFormat) {
|
|
10
|
-
case 'hex': {
|
|
11
|
-
const toHex = (value) => {
|
|
12
|
-
const hex = value.toString(16);
|
|
13
|
-
return hex.length === 1 ? '0' + hex : hex;
|
|
14
|
-
};
|
|
15
|
-
let result = `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
16
|
-
if (includeAlpha || a < 1) {
|
|
17
|
-
const alphaHex = Math.round(a * 255);
|
|
18
|
-
result += toHex(alphaHex);
|
|
19
|
-
}
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
case 'rgb':
|
|
23
|
-
return `rgb(${r}, ${g}, ${b})`;
|
|
24
|
-
case 'rgba':
|
|
25
|
-
return `rgba(${r}, ${g}, ${b}, ${a.toFixed(precision)})`;
|
|
26
|
-
case 'hsl': {
|
|
27
|
-
const hsl = rgbToHslInternal({ r, g, b });
|
|
28
|
-
return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;
|
|
29
|
-
}
|
|
30
|
-
case 'hsla': {
|
|
31
|
-
const hsl = rgbToHslInternal({ r, g, b });
|
|
32
|
-
return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${a.toFixed(precision)})`;
|
|
33
|
-
}
|
|
34
|
-
case 'named': {
|
|
35
|
-
const namedColorMap = getNamedColorMap();
|
|
36
|
-
const targetHex = `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
|
|
37
|
-
for (const [name, hex] of Object.entries(namedColorMap)) {
|
|
38
|
-
if (hex.toLowerCase() === targetHex.toLowerCase()) {
|
|
39
|
-
return name;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return targetHex;
|
|
43
|
-
}
|
|
44
|
-
default:
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=formatColorOutput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatColorOutput.js","sourceRoot":"","sources":["../../../src/functions/color-converter/formatColorOutput.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAA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,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAA;YAE3H,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;gBACxD,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;oBAClD,OAAO,IAAI,CAAA;gBACb,CAAC;YACH,CAAC;YAGD,OAAO,SAAS,CAAA;QAClB,CAAC;QAED;YACE,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function getColorPatterns() {
|
|
2
|
-
return {
|
|
3
|
-
hex: /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,
|
|
4
|
-
rgb: /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,
|
|
5
|
-
rgba: /^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/,
|
|
6
|
-
hsl: /^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)$/,
|
|
7
|
-
hsla: /^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d.]+)\s*\)$/,
|
|
8
|
-
namedColors: /^(red|green|blue|yellow|orange|purple|pink|brown|black|white|gray|grey|cyan|magenta)$/i
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=getColorPatterns.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getColorPatterns.js","sourceRoot":"","sources":["../../../src/functions/color-converter/getColorPatterns.ts"],"names":[],"mappings":"AAkCA,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QAEL,GAAG,EAAE,kEAAkE;QAGvE,GAAG,EAAE,8CAA8C;QAGnD,IAAI,EAAE,8DAA8D;QAGpE,GAAG,EAAE,gDAAgD;QAGrD,IAAI,EAAE,gEAAgE;QAGtE,WAAW,EAAE,wFAAwF;KACtG,CAAA;AACH,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function getNamedColorMap() {
|
|
2
|
-
return {
|
|
3
|
-
'red': '#ff0000',
|
|
4
|
-
'green': '#00ff00',
|
|
5
|
-
'blue': '#0000ff',
|
|
6
|
-
'yellow': '#ffff00',
|
|
7
|
-
'orange': '#ffa500',
|
|
8
|
-
'purple': '#800080',
|
|
9
|
-
'pink': '#ffc0cb',
|
|
10
|
-
'brown': '#a52a2a',
|
|
11
|
-
'black': '#000000',
|
|
12
|
-
'white': '#ffffff',
|
|
13
|
-
'gray': '#808080',
|
|
14
|
-
'grey': '#808080',
|
|
15
|
-
'cyan': '#00ffff',
|
|
16
|
-
'magenta': '#ff00ff'
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=getNamedColorMap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getNamedColorMap.js","sourceRoot":"","sources":["../../../src/functions/color-converter/getNamedColorMap.ts"],"names":[],"mappings":"AAmCA,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SAAS;KACrB,CAAA;AACH,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export function hexToRgb(hex) {
|
|
2
|
-
if (!hex || typeof hex !== 'string') {
|
|
3
|
-
return null;
|
|
4
|
-
}
|
|
5
|
-
const cleanHex = hex.trim().replace(/^#/, '');
|
|
6
|
-
if (!/^[0-9a-fA-F]+$/.test(cleanHex)) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
let r, g, b;
|
|
10
|
-
switch (cleanHex.length) {
|
|
11
|
-
case 3:
|
|
12
|
-
r = parseInt(cleanHex[0] + cleanHex[0], 16);
|
|
13
|
-
g = parseInt(cleanHex[1] + cleanHex[1], 16);
|
|
14
|
-
b = parseInt(cleanHex[2] + cleanHex[2], 16);
|
|
15
|
-
break;
|
|
16
|
-
case 4:
|
|
17
|
-
r = parseInt(cleanHex[0] + cleanHex[0], 16);
|
|
18
|
-
g = parseInt(cleanHex[1] + cleanHex[1], 16);
|
|
19
|
-
b = parseInt(cleanHex[2] + cleanHex[2], 16);
|
|
20
|
-
break;
|
|
21
|
-
case 6:
|
|
22
|
-
r = parseInt(cleanHex.substring(0, 2), 16);
|
|
23
|
-
g = parseInt(cleanHex.substring(2, 4), 16);
|
|
24
|
-
b = parseInt(cleanHex.substring(4, 6), 16);
|
|
25
|
-
break;
|
|
26
|
-
case 8:
|
|
27
|
-
r = parseInt(cleanHex.substring(0, 2), 16);
|
|
28
|
-
g = parseInt(cleanHex.substring(2, 4), 16);
|
|
29
|
-
b = parseInt(cleanHex.substring(4, 6), 16);
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
if (isNaN(r) || isNaN(g) || isNaN(b)) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return { r, g, b };
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=hexToRgb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|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(input, saturation, lightness) {
|
|
2
|
-
let hsl = null;
|
|
3
|
-
if (typeof input === 'object' && input !== null) {
|
|
4
|
-
hsl = input;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof input === 'string') {
|
|
7
|
-
hsl = parseHslString(input);
|
|
8
|
-
}
|
|
9
|
-
else if (typeof input === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
|
|
10
|
-
hsl = { h: input, s: saturation, l: lightness };
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
if (!hsl) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
if (!isValidHslValue(hsl)) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
let h = hsl.h % 360;
|
|
22
|
-
if (h < 0)
|
|
23
|
-
h += 360;
|
|
24
|
-
const s = Math.max(0, Math.min(100, hsl.s)) / 100;
|
|
25
|
-
const l = Math.max(0, Math.min(100, hsl.l)) / 100;
|
|
26
|
-
if (s === 0) {
|
|
27
|
-
const gray = Math.round(l * 255);
|
|
28
|
-
return { r: gray, g: gray, b: gray };
|
|
29
|
-
}
|
|
30
|
-
const hueToRgb = (p, q, t) => {
|
|
31
|
-
if (t < 0)
|
|
32
|
-
t += 1;
|
|
33
|
-
if (t > 1)
|
|
34
|
-
t -= 1;
|
|
35
|
-
if (t < 1 / 6)
|
|
36
|
-
return p + (q - p) * 6 * t;
|
|
37
|
-
if (t < 1 / 2)
|
|
38
|
-
return q;
|
|
39
|
-
if (t < 2 / 3)
|
|
40
|
-
return p + (q - p) * (2 / 3 - t) * 6;
|
|
41
|
-
return p;
|
|
42
|
-
};
|
|
43
|
-
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
44
|
-
const p = 2 * l - q;
|
|
45
|
-
const hNormalized = h / 360;
|
|
46
|
-
const r = hueToRgb(p, q, hNormalized + 1 / 3);
|
|
47
|
-
const g = hueToRgb(p, q, hNormalized);
|
|
48
|
-
const b = hueToRgb(p, q, hNormalized - 1 / 3);
|
|
49
|
-
return {
|
|
50
|
-
r: Math.round(r * 255),
|
|
51
|
-
g: Math.round(g * 255),
|
|
52
|
-
b: Math.round(b * 255)
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function parseHslString(hslString) {
|
|
56
|
-
if (!hslString || typeof hslString !== 'string') {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
const trimmed = hslString.trim();
|
|
60
|
-
const match = trimmed.match(/^hsl\(\s*([\d.-]+)\s*,\s*([\d.-]+)%\s*,\s*([\d.-]+)%\s*\)$/i);
|
|
61
|
-
if (!match) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
const [, hStr, sStr, lStr] = match;
|
|
65
|
-
const h = parseFloat(hStr);
|
|
66
|
-
const s = parseFloat(sStr);
|
|
67
|
-
const l = parseFloat(lStr);
|
|
68
|
-
if (isNaN(h) || isNaN(s) || isNaN(l)) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
return { h, s, l };
|
|
72
|
-
}
|
|
73
|
-
function isValidHslValue(hsl) {
|
|
74
|
-
return (typeof hsl.h === 'number' && !isNaN(hsl.h) && isFinite(hsl.h) &&
|
|
75
|
-
typeof hsl.s === 'number' && !isNaN(hsl.s) && isFinite(hsl.s) &&
|
|
76
|
-
typeof hsl.l === 'number' && !isNaN(hsl.l) && isFinite(hsl.l));
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=hslToRgb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hslToRgb.js","sourceRoot":"","sources":["../../../src/functions/color-converter/hslToRgb.ts"],"names":[],"mappings":"AAwBA,MAAM,UAAU,QAAQ,CACtB,KAAiC,EACjC,UAAmB,EACnB,SAAkB;IAElB,IAAI,GAAG,GAAoB,IAAI,CAAA;IAG/B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;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C,CAAC,CAAC;QAC7D,OAAO,GAAG,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAC9D,CAAA;AACH,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { hueToRgb } from './hueToRgb';
|
|
2
|
-
export function hslToRgbInternal(hsl) {
|
|
3
|
-
let h = hsl.h % 360;
|
|
4
|
-
if (h < 0)
|
|
5
|
-
h += 360;
|
|
6
|
-
const s = Math.max(0, Math.min(100, hsl.s)) / 100;
|
|
7
|
-
const l = Math.max(0, Math.min(100, hsl.l)) / 100;
|
|
8
|
-
if (s === 0) {
|
|
9
|
-
const gray = Math.round(l * 255);
|
|
10
|
-
return { r: gray, g: gray, b: gray };
|
|
11
|
-
}
|
|
12
|
-
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
13
|
-
const p = 2 * l - q;
|
|
14
|
-
const hNormalized = h / 360;
|
|
15
|
-
const r = hueToRgb(p, q, hNormalized + 1 / 3);
|
|
16
|
-
const g = hueToRgb(p, q, hNormalized);
|
|
17
|
-
const b = hueToRgb(p, q, hNormalized - 1 / 3);
|
|
18
|
-
return {
|
|
19
|
-
r: Math.round(r * 255),
|
|
20
|
-
g: Math.round(g * 255),
|
|
21
|
-
b: Math.round(b * 255)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=hslToRgbInternal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hslToRgbInternal.js","sourceRoot":"","sources":["../../../src/functions/color-converter/hslToRgbInternal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA8BrC,MAAM,UAAU,gBAAgB,CAAC,GAAa;IAC5C,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAA;IACnB,IAAI,CAAC,GAA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KAAK,CAAC,CAAC,GAAG,GAAG,CAAC;QACtB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC;KACvB,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function hueToRgb(p: number, q: number, t: number): number;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function hueToRgb(p, q, t) {
|
|
2
|
-
if (t < 0)
|
|
3
|
-
t += 1;
|
|
4
|
-
if (t > 1)
|
|
5
|
-
t -= 1;
|
|
6
|
-
if (t < 1 / 6)
|
|
7
|
-
return p + (q - p) * 6 * t;
|
|
8
|
-
if (t < 1 / 2)
|
|
9
|
-
return q;
|
|
10
|
-
if (t < 2 / 3)
|
|
11
|
-
return p + (q - p) * (2 / 3 - t) * 6;
|
|
12
|
-
return p;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=hueToRgb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hueToRgb.js","sourceRoot":"","sources":["../../../src/functions/color-converter/hueToRgb.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,QAAQ,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IACtD,IAAI,CAAC,GAAG,CAAC;QAAE,CAAC,IAAI,CAAC,CAAA;IACjB,IAAI,CAAC,GAAG,CAAC;QAAE,CAAC,IAAI,CAAC,CAAA;IACjB,IAAI,CAAC,GAAG,CAAC,GAAC,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACvC,IAAI,CAAC,GAAG,CAAC,GAAC,CAAC;QAAE,OAAO,CAAC,CAAA;IACrB,IAAI,CAAC,GAAG,CAAC,GAAC,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;IAC/C,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { getColorPatterns } from './getColorPatterns';
|
|
2
|
-
export function isColorValue(value) {
|
|
3
|
-
if (!value || typeof value !== 'string') {
|
|
4
|
-
return { isValid: false, format: undefined };
|
|
5
|
-
}
|
|
6
|
-
const trimmedValue = value.trim();
|
|
7
|
-
if (!trimmedValue) {
|
|
8
|
-
return { isValid: false, format: undefined };
|
|
9
|
-
}
|
|
10
|
-
const COLOR_PATTERNS = getColorPatterns();
|
|
11
|
-
const formats = [
|
|
12
|
-
{ format: 'hex', pattern: COLOR_PATTERNS.hex },
|
|
13
|
-
{ format: 'rgb', pattern: COLOR_PATTERNS.rgb },
|
|
14
|
-
{ format: 'rgba', pattern: COLOR_PATTERNS.rgba },
|
|
15
|
-
{ format: 'hsl', pattern: COLOR_PATTERNS.hsl },
|
|
16
|
-
{ format: 'hsla', pattern: COLOR_PATTERNS.hsla },
|
|
17
|
-
{ format: 'named', pattern: COLOR_PATTERNS.namedColors }
|
|
18
|
-
];
|
|
19
|
-
for (const { format, pattern } of formats) {
|
|
20
|
-
if (pattern.test(trimmedValue)) {
|
|
21
|
-
if (format === 'hex') {
|
|
22
|
-
const cleanHex = trimmedValue.replace('#', '');
|
|
23
|
-
if (![3, 4, 6, 8].includes(cleanHex.length)) {
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (!/^[0-9a-fA-F]+$/.test(cleanHex)) {
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (format === 'rgb' || format === 'rgba') {
|
|
31
|
-
const rgbMatch = trimmedValue.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)/);
|
|
32
|
-
if (!rgbMatch) {
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
const [, r, g, b, a] = rgbMatch;
|
|
36
|
-
const rVal = parseInt(r);
|
|
37
|
-
const gVal = parseInt(g);
|
|
38
|
-
const bVal = parseInt(b);
|
|
39
|
-
if (isNaN(rVal) || rVal < 0 || rVal > 255 ||
|
|
40
|
-
isNaN(gVal) || gVal < 0 || gVal > 255 ||
|
|
41
|
-
isNaN(bVal) || bVal < 0 || bVal > 255) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (a !== undefined) {
|
|
45
|
-
const aVal = parseFloat(a);
|
|
46
|
-
if (isNaN(aVal) || aVal < 0 || aVal > 1) {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (format === 'hsl' || format === 'hsla') {
|
|
52
|
-
const hslMatch = trimmedValue.match(/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([\d.]+)\s*)?\)/);
|
|
53
|
-
if (!hslMatch) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
const [, h, s, l, a] = hslMatch;
|
|
57
|
-
const hVal = parseInt(h);
|
|
58
|
-
const sVal = parseInt(s);
|
|
59
|
-
const lVal = parseInt(l);
|
|
60
|
-
if (isNaN(hVal) || hVal < 0 || hVal > 360) {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (isNaN(sVal) || sVal < 0 || sVal > 100 ||
|
|
64
|
-
isNaN(lVal) || lVal < 0 || lVal > 100) {
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
if (a !== undefined) {
|
|
68
|
-
const aVal = parseFloat(a);
|
|
69
|
-
if (isNaN(aVal) || aVal < 0 || aVal > 1) {
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return { isValid: true, format };
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return { isValid: false, format: undefined };
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=isColorValue.js.map
|
|
@@ -1 +0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,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;AAC9C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isValidColorValue(value: any): value is number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isValidColorValue.js","sourceRoot":"","sources":["../../../src/functions/color-converter/isValidColorValue.ts"],"names":[],"mappings":"AA2BA,MAAM,UAAU,iBAAiB,CAAC,KAAU;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAA;AACtE,CAAC"}
|