zcw-shared 1.5.0 → 1.7.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 -782
- 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/colorPatterns.d.ts +8 -2
- package/dist/constants/colorPatterns.js.map +1 -1
- package/dist/constants/namedColors.d.ts +16 -2
- package/dist/constants/namedColors.js.map +1 -1
- package/dist/functions/android/buildProject.d.ts +11 -0
- package/dist/functions/android/buildProject.js +97 -0
- package/dist/functions/android/buildProject.js.map +1 -0
- package/dist/functions/android/modifyGradle.d.ts +17 -0
- package/dist/functions/android/modifyGradle.js +69 -0
- package/dist/functions/android/modifyGradle.js.map +1 -0
- package/dist/functions/android/modifyManifest.d.ts +23 -0
- package/dist/functions/android/modifyManifest.js +198 -0
- package/dist/functions/android/modifyManifest.js.map +1 -0
- package/dist/functions/android/permission.d.ts +30 -0
- package/dist/functions/android/permission.js +65 -0
- package/dist/functions/android/permission.js.map +1 -0
- package/dist/functions/color/colorValidation.d.ts +11 -0
- package/dist/functions/color/colorValidation.js +35 -0
- package/dist/functions/color/colorValidation.js.map +1 -0
- package/dist/functions/color/convertColor.d.ts +0 -1
- package/dist/functions/color/convertColor.js +135 -166
- package/dist/functions/color/convertColor.js.map +1 -1
- package/dist/functions/color/deduplicateColors.js +23 -38
- package/dist/functions/color/deduplicateColors.js.map +1 -1
- package/dist/functions/color/detectColorFormat.d.ts +8 -2
- package/dist/functions/color/detectColorFormat.js +49 -51
- package/dist/functions/color/detectColorFormat.js.map +1 -1
- package/dist/functions/color/extractColors.js +48 -18
- package/dist/functions/color/extractColors.js.map +1 -1
- package/dist/functions/css/extractCssVariables.d.ts +1 -1
- package/dist/functions/css/extractCssVariables.js +1 -1
- package/dist/functions/css/extractCssVariables.js.map +1 -1
- package/dist/functions/debug/createDebugger.d.ts +8 -7
- package/dist/functions/debug/createDebugger.js +49 -39
- package/dist/functions/debug/createDebugger.js.map +1 -1
- package/dist/functions/dom/detectOverflow.d.ts +3 -3
- package/dist/functions/dom/detectOverflow.js +3 -3
- package/dist/functions/dom/detectOverflow.js.map +1 -1
- package/dist/functions/dom/getElementRect.d.ts +1 -1
- package/dist/functions/dom/getElementRect.js.map +1 -1
- package/dist/functions/dom/getRelativePosition.d.ts +1 -1
- package/dist/functions/dom/getRelativePosition.js.map +1 -1
- package/dist/functions/dom/getViewportRect.d.ts +2 -2
- package/dist/functions/dom/getViewportRect.js +2 -2
- package/dist/functions/dom/getViewportRect.js.map +1 -1
- package/dist/functions/image/generateMacIcons.d.ts +3 -3
- package/dist/functions/image/generateMacIcons.js.map +1 -1
- package/dist/functions/image/generateMacTrayIcon.d.ts +3 -3
- package/dist/functions/image/generateMacTrayIcon.js.map +1 -1
- package/dist/functions/image/generatePaddedImage.d.ts +2 -2
- package/dist/functions/image/generatePaddedImage.js.map +1 -1
- package/dist/functions/image/generatePwaIcons.d.ts +3 -3
- package/dist/functions/image/generatePwaIcons.js.map +1 -1
- package/dist/functions/image/generateRoundedImage.d.ts +2 -2
- package/dist/functions/image/generateRoundedImage.js.map +1 -1
- package/dist/functions/ipc/dispatchIpcRequest.d.ts +2 -2
- package/dist/functions/ipc/dispatchIpcRequest.js +1 -1
- package/dist/functions/ipc/dispatchIpcRequest.js.map +1 -1
- package/dist/functions/software/findSoftware.d.ts +3 -3
- package/dist/functions/software/findSoftware.js +7 -9
- package/dist/functions/software/findSoftware.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +97 -24
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
- package/dist/functions/uniapp/build.d.ts +20 -0
- package/dist/functions/uniapp/build.js +84 -0
- package/dist/functions/uniapp/build.js.map +1 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.d.ts +7 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.js +30 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.js.map +1 -0
- package/dist/functions/uniapp/detectProjectType.d.ts +16 -0
- package/dist/functions/uniapp/detectProjectType.js +68 -0
- package/dist/functions/uniapp/detectProjectType.js.map +1 -0
- package/dist/functions/uniapp/parseManifest.d.ts +12 -0
- package/dist/functions/uniapp/{app-plus/parseManifest.js → parseManifest.js} +9 -7
- package/dist/functions/uniapp/parseManifest.js.map +1 -0
- package/dist/functions/utils/generateExports.d.ts +16 -0
- package/dist/functions/utils/generateExports.js +34 -0
- package/dist/functions/utils/generateExports.js.map +1 -0
- package/dist/functions/vue/extractColorsFromVueFile.js +2 -11
- package/dist/functions/vue/extractColorsFromVueFile.js.map +1 -1
- package/dist/functions/vue/extractColorsFromVueSection.js.map +1 -1
- package/dist/functions/xml/modifyXml.d.ts +11 -0
- package/dist/functions/xml/modifyXml.js +46 -0
- package/dist/functions/xml/modifyXml.js.map +1 -0
- package/dist/hooks/useAltool.d.ts +3 -32
- package/dist/hooks/useAltool.js.map +1 -1
- package/dist/hooks/useLocalStorage.d.ts +4 -4
- package/dist/hooks/useLocalStorage.js +51 -18
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useSessionStorage.d.ts +4 -4
- package/dist/hooks/useSessionStorage.js +51 -18
- package/dist/hooks/useSessionStorage.js.map +1 -1
- package/dist/hooks/useStorage.d.ts +10 -3
- package/dist/hooks/useStorage.js +33 -35
- package/dist/hooks/useStorage.js.map +1 -1
- package/dist/hooks/useStorageWithIndexedDB.d.ts +3 -4
- package/dist/hooks/useStorageWithIndexedDB.js +39 -29
- package/dist/hooks/useStorageWithIndexedDB.js.map +1 -1
- package/dist/hooks/useWebWorker.d.ts +25 -4
- package/dist/hooks/useWebWorker.js.map +1 -1
- package/dist/hooks/useWorkerFunction.d.ts +22 -4
- package/dist/hooks/useWorkerFunction.js +28 -28
- package/dist/hooks/useWorkerFunction.js.map +1 -1
- package/dist/hooks/useWorkerPool.d.ts +30 -4
- package/dist/hooks/useWorkerPool.js.map +1 -1
- package/package.json +17 -22
- package/references/arraybuffer.d.ts +109 -0
- package/references/blob.d.ts +37 -0
- package/references/browser.d.ts +69 -174
- package/references/chrome.extension.d.ts +83 -0
- package/references/console.d.ts +25 -164
- package/references/{crypto.d.ts → crypto-js.d.ts} +57 -57
- package/references/dom.d.ts +41 -0
- package/references/encoding.d.ts +24 -0
- package/references/fetch.d.ts +124 -269
- package/references/indexeddb.d.ts +49 -0
- package/references/json5.d.ts +21 -28
- package/references/location.d.ts +16 -0
- package/references/node.d.ts +116 -111
- package/references/sharp.d.ts +18 -18
- package/references/storage.d.ts +17 -111
- package/references/timer.d.ts +45 -46
- package/references/uniapp.d.ts +51 -9
- package/references/url.d.ts +55 -160
- package/references/vue.d.ts +86 -113
- package/references/webassembly.d.ts +101 -127
- package/references/wechat.d.ts +48 -48
- package/references/worker.d.ts +152 -206
- package/references/xml.d.ts +88 -55
- package/types/altool.d.ts +49 -17
- package/types/android-build.d.ts +60 -85
- package/types/color.d.ts +72 -162
- package/types/geometry.d.ts +28 -65
- package/types/platform.d.ts +4 -0
- package/types/software.d.ts +14 -26
- package/types/storage.d.ts +50 -48
- package/types/uniapp-android-build.d.ts +49 -0
- package/types/vue.d.ts +29 -29
- package/types/worker.d.ts +178 -364
- package/dist/constants/softwareConfigs.d.ts +0 -15
- package/dist/constants/softwareConfigs.js +0 -157
- 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/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-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/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/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/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/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 -20
- package/dist/functions/string/caseConverter.js +0 -101
- 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 -17
- package/dist/functions/string/htmlEscape.js +0 -68
- 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 -14
- package/dist/functions/string/pad.js +0 -53
- 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/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.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/waitForPages.d.ts +0 -2
- 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/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/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 -23
- package/dist/functions/vue/dynamicMount.js.map +0 -1
- 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 -4
- 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.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/hooks/useAi.d.ts +0 -27
- package/dist/hooks/useAi.js +0 -163
- package/dist/hooks/useAi.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/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/useWASM.d.ts +0 -4
- package/dist/hooks/useWASM.js +0 -267
- package/dist/hooks/useWASM.js.map +0 -1
- package/references/browser.extension.d.ts +0 -14
- package/types/network.d.ts +0 -184
- package/types/util.d.ts +0 -27
- package/types/wasm.d.ts +0 -217
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { isApiKeyAuth } from './isApiKeyAuth';
|
|
2
|
-
import { parseValidationOutput } from './parseValidationOutput';
|
|
3
|
-
export async function validateApp(altoolPath, options, childProcess) {
|
|
4
|
-
const { file, type, auth, outputFormat = 'normal' } = options;
|
|
5
|
-
const args = [
|
|
6
|
-
'--validate-app',
|
|
7
|
-
'--file', file,
|
|
8
|
-
'--type', type,
|
|
9
|
-
'--output-format', outputFormat
|
|
10
|
-
];
|
|
11
|
-
if (isApiKeyAuth(auth)) {
|
|
12
|
-
args.push('--apiKey', auth.apiKey);
|
|
13
|
-
args.push('--apiIssuer', auth.apiIssuer);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
args.push('--username', auth.username);
|
|
17
|
-
args.push('--password', auth.password);
|
|
18
|
-
}
|
|
19
|
-
const command = `"${altoolPath}" ${args.map(arg => `"${arg}"`).join(' ')}`;
|
|
20
|
-
return new Promise((resolve, reject) => {
|
|
21
|
-
childProcess.exec(command, (error, stdout, stderr) => {
|
|
22
|
-
const output = stdout || '';
|
|
23
|
-
const errorOutput = stderr || '';
|
|
24
|
-
const validationDetails = parseValidationOutput(output + errorOutput);
|
|
25
|
-
if (error) {
|
|
26
|
-
const errorMessage = errorOutput || error.message;
|
|
27
|
-
reject(new Error(errorMessage));
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
if (validationDetails.hasErrors) {
|
|
31
|
-
reject(new Error('验证失败,存在错误: ' + validationDetails.errors.join(', ')));
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
resolve(validationDetails);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=validateApp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateApp.js","sourceRoot":"","sources":["../../../src/functions/altool/validateApp.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAqE/D,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,UAAkB,EAClB,OAA8B,EAC9B,YAA8B;IAO9B,MAAM,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,GAAG,QAAQ,EACxB,GAAG,OAAO,CAAA;IAGX,MAAM,IAAI,GAAG;QACX,gBAAgB;QAChB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;QACd,iBAAiB,EAAE,YAAY;KAChC,CAAA;IAGD,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;QAEvB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAClC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QAEN,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QACtC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IACxC,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,UAAU,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;IAE1E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,YAAY,CAAC,I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_PATTERNS = {
|
|
2
|
-
hex: /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,
|
|
3
|
-
rgb: /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,
|
|
4
|
-
rgba: /^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/,
|
|
5
|
-
hsl: /^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)$/,
|
|
6
|
-
hsla: /^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d.]+)\s*\)$/,
|
|
7
|
-
namedColors: /^(red|green|blue|yellow|orange|purple|pink|brown|black|white|gray|grey|cyan|magenta)$/i
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=COLOR_PATTERNS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"COLOR_PATTERNS.js","sourceRoot":"","sources":["../../../src/functions/color-converter/COLOR_PATTERNS.ts"],"names":[],"mappings":"AA2BA,MAAM,CAAC,MAAM,cAAc,GAAkB;IAE3C,GAAG,EAAE,kEAAkE;IAGvE,GAAG,EAAE,8CAA8C;IAGnD,IAAI,EAAE,8DAA8D;IAGpE,GAAG,EAAE,gDAAgD;IAGrD,IAAI,EAAE,gEAAgE;IAGtE,WAAW,EAAE,wFAAwF;CACtG,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ColorPatterns, NamedColorMap } from '../../../types/color.d';
|
|
2
|
-
export declare const COLOR_PATTERNS: ColorPatterns;
|
|
3
|
-
export declare const NAMED_COLOR_MAP: NamedColorMap;
|
|
4
|
-
export declare function detectColorFormat(color: string): keyof ColorPatterns | undefined;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export const COLOR_PATTERNS = {
|
|
2
|
-
hex: /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,
|
|
3
|
-
rgb: /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,
|
|
4
|
-
rgba: /^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/,
|
|
5
|
-
hsl: /^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)$/,
|
|
6
|
-
hsla: /^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d.]+)\s*\)$/,
|
|
7
|
-
namedColors: /^(red|green|blue|yellow|orange|purple|pink|brown|black|white|gray|grey|cyan|magenta)$/i
|
|
8
|
-
};
|
|
9
|
-
export const NAMED_COLOR_MAP = {
|
|
10
|
-
'red': '#ff0000',
|
|
11
|
-
'green': '#00ff00',
|
|
12
|
-
'blue': '#0000ff',
|
|
13
|
-
'yellow': '#ffff00',
|
|
14
|
-
'orange': '#ffa500',
|
|
15
|
-
'purple': '#800080',
|
|
16
|
-
'pink': '#ffc0cb',
|
|
17
|
-
'brown': '#a52a2a',
|
|
18
|
-
'black': '#000000',
|
|
19
|
-
'white': '#ffffff',
|
|
20
|
-
'gray': '#808080',
|
|
21
|
-
'grey': '#808080',
|
|
22
|
-
'cyan': '#00ffff',
|
|
23
|
-
'magenta': '#ff00ff'
|
|
24
|
-
};
|
|
25
|
-
export function detectColorFormat(color) {
|
|
26
|
-
const trimmedColor = color.trim();
|
|
27
|
-
if (COLOR_PATTERNS.hex.test(trimmedColor))
|
|
28
|
-
return 'hex';
|
|
29
|
-
if (COLOR_PATTERNS.rgba.test(trimmedColor))
|
|
30
|
-
return 'rgba';
|
|
31
|
-
if (COLOR_PATTERNS.rgb.test(trimmedColor))
|
|
32
|
-
return 'rgb';
|
|
33
|
-
if (COLOR_PATTERNS.hsla.test(trimmedColor))
|
|
34
|
-
return 'hsla';
|
|
35
|
-
if (COLOR_PATTERNS.hsl.test(trimmedColor))
|
|
36
|
-
return 'hsl';
|
|
37
|
-
if (COLOR_PATTERNS.namedColors.test(trimmedColor))
|
|
38
|
-
return 'namedColors';
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=colorPatterns.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colorPatterns.js","sourceRoot":"","sources":["../../../src/functions/color-converter/colorPatterns.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,cAAc,GAAkB;IAE3C,GAAG,EAAE,kEAAkE;IAGvE,GAAG,EAAE,8CAA8C;IAGnD,IAAI,EAAE,8DAA8D;IAGpE,GAAG,EAAE,gDAAgD;IAGrD,IAAI,EAAE,gEAAgE;IAGtE,WAAW,EAAE,wFAAwF;CACtG,CAAA;AAKD,MAAM,CAAC,MAAM,eAAe,GAAkB;IAC5C,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,SAAS;CACrB,CAAA;AAOD,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAEjC,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,KAAK,CAAA;IACvD,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,MAAM,CAAA;IACzD,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,KAAK,CAAA;IACvD,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,MAAM,CAAA;IACzD,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,KAAK,CAAA;IACvD,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,aAAa,CAAA;IAEvE,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { RgbColor, HslColor, ColorFormat } from '../../../types/color.d';
|
|
2
|
-
export declare function convertColor(input: string | RgbColor | HslColor | number[], targetFormat: ColorFormat, options?: {
|
|
3
|
-
includeAlpha?: boolean;
|
|
4
|
-
strict?: boolean;
|
|
5
|
-
precision?: number;
|
|
6
|
-
}): string | null;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { normalizeColorInput } from './normalizeColorInput';
|
|
2
|
-
import { formatColorOutput } from './formatColorOutput';
|
|
3
|
-
export function convertColor(input, targetFormat, options = {}) {
|
|
4
|
-
const { includeAlpha = false, precision = 0 } = options;
|
|
5
|
-
const normalizedInput = normalizeColorInput(input);
|
|
6
|
-
if (!normalizedInput) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
const { rgb, alpha } = normalizedInput;
|
|
10
|
-
return formatColorOutput(rgb, alpha, targetFormat, { includeAlpha, precision });
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=convertColor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertColor.js","sourceRoot":"","sources":["../../../src/functions/color-converter/convertColor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAmCvD,MAAM,UAAU,YAAY,CAC1B,KAA8C,EAC9C,YAAyB,EACzB,UAOI,EAAE;IAEN,MAAM,EAAE,YAAY,GAAG,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,GAAG,OAAO,CAAA;IAGvD,MAAM,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAA;IAClD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,eAAe,CAAA;IAGtC,OAAO,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAA;AACjF,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { ColorReference } from '../../../types/color';
|
|
2
|
-
export declare function createColorReference(value: string, format: ColorReference['format'], file: string, line: number, context: string, originalValue: string, isVariableReference?: boolean, variableName?: string): ColorReference;
|
|
@@ -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,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAA;AAqC3F,MAAM,UAAU,qBAAqB,CACnC,IAAY,EACZ,QAAgB,EAChB,UAAkB,EAClB,YAAwC,EACxC,UAAkC,EAAE;IAEpC,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,mBAAmB,GAAG,EAAE,EAAE,GAAG,OAAO,CAAA;IAC/D,MAAM,MAAM,GAAqB,EAAE,CAAA;IACnC,MAAM,QAAQ,GAAG,YAAY,C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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,CAAA;AAmCrD,MAAM,UAAU,iBAAiB,CAC/B,GAAa,EACb,KAAa,EACb,YAAyB,EACzB,OAAuD;IAEvD,MAAM,EAAE,YAAY,GAAG,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,GAAG,OAAO,CAAA;IAGvD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,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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
|
-
{"version":3,"file":"hexToRgb.js","sourceRoot":"","sources":["../../../src/functions/color-converter/hexToRgb.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,QAAQ,CAAC,GAAW;IAElC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,IAAI,CAAA;IACb,CAAC;IAGD,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAG7C,IAAI,CAAC,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,EAAE,EAAE,CAAC,CAAA;YAC1C,MAAK;QAEP,KAAK,CAAC;YAEJ,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YAC1C,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YAC1C,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YAC1C,MAAK;QAEP;YACE,OAAO,IAAI,CAAA;IACf,CAAC;IAGD,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,CAAA;IACb,CAAC;IAGD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;AACpB,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
export function hslToRgb(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;QAEhD,GAAG,GAAG,KAAK,CAAA;IACb,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAErC,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAExG,GAAG,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC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