zcw-shared 1.10.0 → 1.10.2

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.
Files changed (270) hide show
  1. package/dist/constants/colorPatterns.d.ts +8 -0
  2. package/dist/constants/colorPatterns.js +9 -1
  3. package/dist/constants/colorPatterns.js.map +1 -1
  4. package/dist/functions/color/detectColorFormat.js +11 -11
  5. package/dist/functions/color/detectColorFormat.js.map +1 -1
  6. package/dist/functions/color/extractColors.d.ts +1 -0
  7. package/dist/functions/color/extractColors.js +13 -79
  8. package/dist/functions/color/extractColors.js.map +1 -1
  9. package/package.json +1 -1
  10. package/dist/functions/altool/createAltoolClient.d.ts +0 -21
  11. package/dist/functions/altool/createAltoolClient.js +0 -53
  12. package/dist/functions/altool/createAltoolClient.js.map +0 -1
  13. package/dist/functions/altool/getAltoolAuth.d.ts +0 -2
  14. package/dist/functions/altool/getAltoolAuth.js +0 -8
  15. package/dist/functions/altool/getAltoolAuth.js.map +0 -1
  16. package/dist/functions/altool/getAppInfo.d.ts +0 -13
  17. package/dist/functions/altool/getAppInfo.js +0 -39
  18. package/dist/functions/altool/getAppInfo.js.map +0 -1
  19. package/dist/functions/altool/index.d.ts +0 -10
  20. package/dist/functions/altool/index.js +0 -6
  21. package/dist/functions/altool/index.js.map +0 -1
  22. package/dist/functions/altool/isApiKeyAuth.d.ts +0 -2
  23. package/dist/functions/altool/isApiKeyAuth.js +0 -4
  24. package/dist/functions/altool/isApiKeyAuth.js.map +0 -1
  25. package/dist/functions/altool/isCredentialsAuth.d.ts +0 -2
  26. package/dist/functions/altool/isCredentialsAuth.js +0 -4
  27. package/dist/functions/altool/isCredentialsAuth.js.map +0 -1
  28. package/dist/functions/altool/parseAppInfoOutput.d.ts +0 -2
  29. package/dist/functions/altool/parseAppInfoOutput.js +0 -55
  30. package/dist/functions/altool/parseAppInfoOutput.js.map +0 -1
  31. package/dist/functions/altool/parseValidationOutput.d.ts +0 -6
  32. package/dist/functions/altool/parseValidationOutput.js +0 -21
  33. package/dist/functions/altool/parseValidationOutput.js.map +0 -1
  34. package/dist/functions/altool/types.d.ts +0 -26
  35. package/dist/functions/altool/types.js +0 -7
  36. package/dist/functions/altool/types.js.map +0 -1
  37. package/dist/functions/altool/uploadApp.d.ts +0 -6
  38. package/dist/functions/altool/uploadApp.js +0 -36
  39. package/dist/functions/altool/uploadApp.js.map +0 -1
  40. package/dist/functions/altool/validateApp.d.ts +0 -17
  41. package/dist/functions/altool/validateApp.js +0 -40
  42. package/dist/functions/altool/validateApp.js.map +0 -1
  43. package/dist/functions/base64/strToBase64.d.ts +0 -2
  44. package/dist/functions/base64/strToBase64.js +0 -6
  45. package/dist/functions/base64/strToBase64.js.map +0 -1
  46. package/dist/functions/color-converter/COLOR_PATTERNS.d.ts +0 -2
  47. package/dist/functions/color-converter/COLOR_PATTERNS.js +0 -9
  48. package/dist/functions/color-converter/COLOR_PATTERNS.js.map +0 -1
  49. package/dist/functions/color-converter/colorPatterns.d.ts +0 -4
  50. package/dist/functions/color-converter/colorPatterns.js +0 -41
  51. package/dist/functions/color-converter/colorPatterns.js.map +0 -1
  52. package/dist/functions/color-converter/convertColor.d.ts +0 -6
  53. package/dist/functions/color-converter/convertColor.js +0 -12
  54. package/dist/functions/color-converter/convertColor.js.map +0 -1
  55. package/dist/functions/color-converter/createColorReference.d.ts +0 -2
  56. package/dist/functions/color-converter/createColorReference.js +0 -12
  57. package/dist/functions/color-converter/createColorReference.js.map +0 -1
  58. package/dist/functions/color-converter/detectColorFormat.d.ts +0 -2
  59. package/dist/functions/color-converter/detectColorFormat.js +0 -19
  60. package/dist/functions/color-converter/detectColorFormat.js.map +0 -1
  61. package/dist/functions/color-converter/extractColors.d.ts +0 -3
  62. package/dist/functions/color-converter/extractColors.js +0 -16
  63. package/dist/functions/color-converter/extractColors.js.map +0 -1
  64. package/dist/functions/color-converter/extractColorsFromLine.d.ts +0 -2
  65. package/dist/functions/color-converter/extractColorsFromLine.js +0 -18
  66. package/dist/functions/color-converter/extractColorsFromLine.js.map +0 -1
  67. package/dist/functions/color-converter/extractColorsGeneric.d.ts +0 -2
  68. package/dist/functions/color-converter/extractColorsGeneric.js +0 -12
  69. package/dist/functions/color-converter/extractColorsGeneric.js.map +0 -1
  70. package/dist/functions/color-converter/extractCssVariableReferences.d.ts +0 -2
  71. package/dist/functions/color-converter/extractCssVariableReferences.js +0 -15
  72. package/dist/functions/color-converter/extractCssVariableReferences.js.map +0 -1
  73. package/dist/functions/color-converter/extractThirdPartyVariableReferences.d.ts +0 -2
  74. package/dist/functions/color-converter/extractThirdPartyVariableReferences.js +0 -15
  75. package/dist/functions/color-converter/extractThirdPartyVariableReferences.js.map +0 -1
  76. package/dist/functions/color-converter/formatColorOutput.d.ts +0 -5
  77. package/dist/functions/color-converter/formatColorOutput.js +0 -48
  78. package/dist/functions/color-converter/formatColorOutput.js.map +0 -1
  79. package/dist/functions/color-converter/getColorPatterns.d.ts +0 -2
  80. package/dist/functions/color-converter/getColorPatterns.js +0 -11
  81. package/dist/functions/color-converter/getColorPatterns.js.map +0 -1
  82. package/dist/functions/color-converter/getNamedColorMap.d.ts +0 -2
  83. package/dist/functions/color-converter/getNamedColorMap.js +0 -19
  84. package/dist/functions/color-converter/getNamedColorMap.js.map +0 -1
  85. package/dist/functions/color-converter/hexToRgb.d.ts +0 -2
  86. package/dist/functions/color-converter/hexToRgb.js +0 -42
  87. package/dist/functions/color-converter/hexToRgb.js.map +0 -1
  88. package/dist/functions/color-converter/hslToRgb.d.ts +0 -2
  89. package/dist/functions/color-converter/hslToRgb.js +0 -78
  90. package/dist/functions/color-converter/hslToRgb.js.map +0 -1
  91. package/dist/functions/color-converter/hslToRgbInternal.d.ts +0 -2
  92. package/dist/functions/color-converter/hslToRgbInternal.js +0 -24
  93. package/dist/functions/color-converter/hslToRgbInternal.js.map +0 -1
  94. package/dist/functions/color-converter/hueToRgb.d.ts +0 -1
  95. package/dist/functions/color-converter/hueToRgb.js +0 -14
  96. package/dist/functions/color-converter/hueToRgb.js.map +0 -1
  97. package/dist/functions/color-converter/isColorValue.d.ts +0 -2
  98. package/dist/functions/color-converter/isColorValue.js +0 -79
  99. package/dist/functions/color-converter/isColorValue.js.map +0 -1
  100. package/dist/functions/color-converter/isValidColorValue.d.ts +0 -1
  101. package/dist/functions/color-converter/isValidColorValue.js +0 -4
  102. package/dist/functions/color-converter/isValidColorValue.js.map +0 -1
  103. package/dist/functions/color-converter/isValidHslColor.d.ts +0 -2
  104. package/dist/functions/color-converter/isValidHslColor.js +0 -14
  105. package/dist/functions/color-converter/isValidHslColor.js.map +0 -1
  106. package/dist/functions/color-converter/isValidRgbColor.d.ts +0 -2
  107. package/dist/functions/color-converter/isValidRgbColor.js +0 -14
  108. package/dist/functions/color-converter/isValidRgbColor.js.map +0 -1
  109. package/dist/functions/color-converter/normalizeColor.d.ts +0 -1
  110. package/dist/functions/color-converter/normalizeColor.js +0 -49
  111. package/dist/functions/color-converter/normalizeColor.js.map +0 -1
  112. package/dist/functions/color-converter/normalizeColorInput.d.ts +0 -6
  113. package/dist/functions/color-converter/normalizeColorInput.js +0 -94
  114. package/dist/functions/color-converter/normalizeColorInput.js.map +0 -1
  115. package/dist/functions/color-converter/parseColorString.d.ts +0 -12
  116. package/dist/functions/color-converter/parseColorString.js +0 -89
  117. package/dist/functions/color-converter/parseColorString.js.map +0 -1
  118. package/dist/functions/color-converter/parseCssVariables.d.ts +0 -2
  119. package/dist/functions/color-converter/parseCssVariables.js +0 -19
  120. package/dist/functions/color-converter/parseCssVariables.js.map +0 -1
  121. package/dist/functions/color-converter/parseHexColor.d.ts +0 -6
  122. package/dist/functions/color-converter/parseHexColor.js +0 -42
  123. package/dist/functions/color-converter/parseHexColor.js.map +0 -1
  124. package/dist/functions/color-converter/rgbToHex.d.ts +0 -2
  125. package/dist/functions/color-converter/rgbToHex.js +0 -65
  126. package/dist/functions/color-converter/rgbToHex.js.map +0 -1
  127. package/dist/functions/color-converter/rgbToHslInternal.d.ts +0 -2
  128. package/dist/functions/color-converter/rgbToHslInternal.js +0 -31
  129. package/dist/functions/color-converter/rgbToHslInternal.js.map +0 -1
  130. package/dist/functions/color-converter/standardizeColor.d.ts +0 -1
  131. package/dist/functions/color-converter/standardizeColor.js +0 -147
  132. package/dist/functions/color-converter/standardizeColor.js.map +0 -1
  133. package/dist/functions/desensitize/desensitizeName.d.ts +0 -1
  134. package/dist/functions/desensitize/desensitizeName.js +0 -8
  135. package/dist/functions/desensitize/desensitizeName.js.map +0 -1
  136. package/dist/functions/desensitize/desensitizePhone.d.ts +0 -1
  137. package/dist/functions/desensitize/desensitizePhone.js +0 -8
  138. package/dist/functions/desensitize/desensitizePhone.js.map +0 -1
  139. package/dist/functions/dom/getViewportSize.d.ts +0 -5
  140. package/dist/functions/dom/getViewportSize.js +0 -7
  141. package/dist/functions/dom/getViewportSize.js.map +0 -1
  142. package/dist/functions/software/buildPathExecutables.d.ts +0 -1
  143. package/dist/functions/software/buildPathExecutables.js +0 -14
  144. package/dist/functions/software/buildPathExecutables.js.map +0 -1
  145. package/dist/functions/software/buildSoftwarePaths.d.ts +0 -2
  146. package/dist/functions/software/buildSoftwarePaths.js +0 -22
  147. package/dist/functions/software/buildSoftwarePaths.js.map +0 -1
  148. package/dist/functions/software/createConfigGenerator.d.ts +0 -8
  149. package/dist/functions/software/createConfigGenerator.js +0 -13
  150. package/dist/functions/software/createConfigGenerator.js.map +0 -1
  151. package/dist/functions/software/detectPlatform.d.ts +0 -2
  152. package/dist/functions/software/detectPlatform.js +0 -9
  153. package/dist/functions/software/detectPlatform.js.map +0 -1
  154. package/dist/functions/software/find.d.ts +0 -2
  155. package/dist/functions/software/find.js +0 -12
  156. package/dist/functions/software/find.js.map +0 -1
  157. package/dist/functions/software/findSoftwareWithGenerator.d.ts +0 -3
  158. package/dist/functions/software/findSoftwareWithGenerator.js +0 -8
  159. package/dist/functions/software/findSoftwareWithGenerator.js.map +0 -1
  160. package/dist/functions/software/getConfigGenerator.d.ts +0 -2
  161. package/dist/functions/software/getConfigGenerator.js +0 -10
  162. package/dist/functions/software/getConfigGenerator.js.map +0 -1
  163. package/dist/functions/software/getEnvironmentSoftwarePath.d.ts +0 -1
  164. package/dist/functions/software/getEnvironmentSoftwarePath.js +0 -8
  165. package/dist/functions/software/getEnvironmentSoftwarePath.js.map +0 -1
  166. package/dist/functions/software/getSupportedSoftware.d.ts +0 -1
  167. package/dist/functions/software/getSupportedSoftware.js +0 -5
  168. package/dist/functions/software/getSupportedSoftware.js.map +0 -1
  169. package/dist/functions/software/parseEnvironmentPaths.d.ts +0 -1
  170. package/dist/functions/software/parseEnvironmentPaths.js +0 -11
  171. package/dist/functions/software/parseEnvironmentPaths.js.map +0 -1
  172. package/dist/functions/software/softwareConfigs.d.ts +0 -2
  173. package/dist/functions/software/softwareConfigs.js +0 -148
  174. package/dist/functions/software/softwareConfigs.js.map +0 -1
  175. package/dist/functions/software/softwareNameMap.d.ts +0 -1
  176. package/dist/functions/software/softwareNameMap.js +0 -9
  177. package/dist/functions/software/softwareNameMap.js.map +0 -1
  178. package/dist/functions/software/types.d.ts +0 -11
  179. package/dist/functions/software/types.js +0 -2
  180. package/dist/functions/software/types.js.map +0 -1
  181. package/dist/functions/string/camelCase.d.ts +0 -1
  182. package/dist/functions/string/camelCase.js +0 -8
  183. package/dist/functions/string/camelCase.js.map +0 -1
  184. package/dist/functions/string/escape.d.ts +0 -1
  185. package/dist/functions/string/escape.js +0 -13
  186. package/dist/functions/string/escape.js.map +0 -1
  187. package/dist/functions/string/kebabCase.d.ts +0 -1
  188. package/dist/functions/string/kebabCase.js +0 -10
  189. package/dist/functions/string/kebabCase.js.map +0 -1
  190. package/dist/functions/string/mask.d.ts +0 -1
  191. package/dist/functions/string/mask.js +0 -40
  192. package/dist/functions/string/mask.js.map +0 -1
  193. package/dist/functions/string/padEnd.d.ts +0 -1
  194. package/dist/functions/string/padEnd.js +0 -8
  195. package/dist/functions/string/padEnd.js.map +0 -1
  196. package/dist/functions/string/padStart.d.ts +0 -1
  197. package/dist/functions/string/padStart.js +0 -8
  198. package/dist/functions/string/padStart.js.map +0 -1
  199. package/dist/functions/string/pascalCase.d.ts +0 -1
  200. package/dist/functions/string/pascalCase.js +0 -8
  201. package/dist/functions/string/pascalCase.js.map +0 -1
  202. package/dist/functions/string/snakeCase.d.ts +0 -1
  203. package/dist/functions/string/snakeCase.js +0 -10
  204. package/dist/functions/string/snakeCase.js.map +0 -1
  205. package/dist/functions/string/unescape.d.ts +0 -1
  206. package/dist/functions/string/unescape.js +0 -13
  207. package/dist/functions/string/unescape.js.map +0 -1
  208. package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.d.ts +0 -13
  209. package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js +0 -175
  210. package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js.map +0 -1
  211. package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +0 -19
  212. package/dist/functions/uniapp/app-plus/androidProjectStrategy.js +0 -55
  213. package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +0 -1
  214. package/dist/functions/uniapp/app-plus/buildAndroidProject.d.ts +0 -3
  215. package/dist/functions/uniapp/app-plus/buildAndroidProject.js +0 -60
  216. package/dist/functions/uniapp/app-plus/buildAndroidProject.js.map +0 -1
  217. package/dist/functions/uniapp/app-plus/configureAndroidManifest.d.ts +0 -5
  218. package/dist/functions/uniapp/app-plus/configureAndroidManifest.js +0 -51
  219. package/dist/functions/uniapp/app-plus/configureAndroidManifest.js.map +0 -1
  220. package/dist/functions/uniapp/app-plus/configureAndroidProject.d.ts +0 -3
  221. package/dist/functions/uniapp/app-plus/configureAndroidProject.js +0 -63
  222. package/dist/functions/uniapp/app-plus/configureAndroidProject.js.map +0 -1
  223. package/dist/functions/uniapp/app-plus/configureBuildGradle.d.ts +0 -9
  224. package/dist/functions/uniapp/app-plus/configureBuildGradle.js +0 -57
  225. package/dist/functions/uniapp/app-plus/configureBuildGradle.js.map +0 -1
  226. package/dist/functions/uniapp/app-plus/configureDcloudControl.d.ts +0 -5
  227. package/dist/functions/uniapp/app-plus/configureDcloudControl.js +0 -34
  228. package/dist/functions/uniapp/app-plus/configureDcloudControl.js.map +0 -1
  229. package/dist/functions/uniapp/app-plus/configureStrings.d.ts +0 -5
  230. package/dist/functions/uniapp/app-plus/configureStrings.js +0 -42
  231. package/dist/functions/uniapp/app-plus/configureStrings.js.map +0 -1
  232. package/dist/functions/uniapp/app-plus/copyAppResources.d.ts +0 -8
  233. package/dist/functions/uniapp/app-plus/copyAppResources.js +0 -25
  234. package/dist/functions/uniapp/app-plus/copyAppResources.js.map +0 -1
  235. package/dist/functions/uniapp/app-plus/copyDirectory.d.ts +0 -2
  236. package/dist/functions/uniapp/app-plus/copyDirectory.js +0 -18
  237. package/dist/functions/uniapp/app-plus/copyDirectory.js.map +0 -1
  238. package/dist/functions/uniapp/app-plus/generateUniAppResources.d.ts +0 -2
  239. package/dist/functions/uniapp/app-plus/generateUniAppResources.js +0 -35
  240. package/dist/functions/uniapp/app-plus/generateUniAppResources.js.map +0 -1
  241. package/dist/functions/uniapp/app-plus/parseManifest.d.ts +0 -14
  242. package/dist/functions/uniapp/app-plus/parseManifest.js +0 -44
  243. package/dist/functions/uniapp/app-plus/parseManifest.js.map +0 -1
  244. package/dist/functions/uniapp/app-plus/validateOptions.d.ts +0 -3
  245. package/dist/functions/uniapp/app-plus/validateOptions.js +0 -10
  246. package/dist/functions/uniapp/app-plus/validateOptions.js.map +0 -1
  247. package/dist/functions/vue/checkVueType.d.ts +0 -8
  248. package/dist/functions/vue/checkVueType.js +0 -29
  249. package/dist/functions/vue/checkVueType.js.map +0 -1
  250. package/dist/functions/vue/deduplicateColors.d.ts +0 -2
  251. package/dist/functions/vue/deduplicateColors.js +0 -13
  252. package/dist/functions/vue/deduplicateColors.js.map +0 -1
  253. package/dist/functions/vue/processVueFile.d.ts +0 -3
  254. package/dist/functions/vue/processVueFile.js +0 -26
  255. package/dist/functions/vue/processVueFile.js.map +0 -1
  256. package/dist/functions/vue/saveVueSection.d.ts +0 -2
  257. package/dist/functions/vue/saveVueSection.js +0 -11
  258. package/dist/functions/vue/saveVueSection.js.map +0 -1
  259. package/dist/hooks/useAi.d.ts +0 -27
  260. package/dist/hooks/useAi.js +0 -163
  261. package/dist/hooks/useAi.js.map +0 -1
  262. package/dist/hooks/useFetch.d.ts +0 -3
  263. package/dist/hooks/useFetch.js +0 -154
  264. package/dist/hooks/useFetch.js.map +0 -1
  265. package/dist/hooks/useRequest.d.ts +0 -3
  266. package/dist/hooks/useRequest.js +0 -139
  267. package/dist/hooks/useRequest.js.map +0 -1
  268. package/dist/hooks/useWASM.d.ts +0 -4
  269. package/dist/hooks/useWASM.js +0 -263
  270. package/dist/hooks/useWASM.js.map +0 -1
@@ -1,7 +0,0 @@
1
- export function isApiKeyAuth(auth) {
2
- return 'apiKey' in auth && 'apiIssuer' in auth;
3
- }
4
- export function isCredentialsAuth(auth) {
5
- return 'username' in auth && 'password' in auth;
6
- }
7
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/functions/altool/types.ts"],"names":[],"mappings":"AAuEA,MAAM,UAAU,YAAY,CAAC,IAAgB;IAC3C,OAAO,QAAQ,IAAI,IAAI,IAAI,WAAW,IAAI,IAAI,CAAA;AAChD,CAAC;AAOD,MAAM,UAAU,iBAAiB,CAAC,IAAgB;IAChD,OAAO,UAAU,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,CAAA;AACjD,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { NodeChildProcess } from '../../../references/node.d';
2
- import type { AltoolBaseOptions } from '../../../types/altool.d';
3
- export interface AltoolUploadOptions extends AltoolBaseOptions {
4
- file: string;
5
- }
6
- export declare function uploadApp(altoolPath: string, options: AltoolUploadOptions, childProcess: NodeChildProcess): Promise<string>;
@@ -1,36 +0,0 @@
1
- import { isApiKeyAuth } from './isApiKeyAuth';
2
- export async function uploadApp(altoolPath, options, childProcess) {
3
- const { file, type, auth, outputFormat = 'normal' } = options;
4
- const args = [
5
- '--upload-app',
6
- '--file', file,
7
- '--type', type,
8
- '--output-format', outputFormat
9
- ];
10
- if (isApiKeyAuth(auth)) {
11
- args.push('--apiKey', auth.apiKey);
12
- args.push('--apiIssuer', auth.apiIssuer);
13
- }
14
- else {
15
- args.push('--username', auth.username);
16
- args.push('--password', auth.password);
17
- }
18
- const command = `"${altoolPath}" ${args.map(arg => `"${arg}"`).join(' ')}`;
19
- return new Promise((resolve, reject) => {
20
- childProcess.exec(command, (error, stdout, stderr) => {
21
- const output = stdout || '';
22
- const errorOutput = stderr || '';
23
- if (error) {
24
- const errorMessage = errorOutput || error.message;
25
- reject(new Error(`altool上传失败: ${errorMessage}`));
26
- }
27
- else if (errorOutput && errorOutput.includes('error')) {
28
- reject(new Error(`altool上传过程中出现错误: ${errorOutput}`));
29
- }
30
- else {
31
- resolve(output);
32
- }
33
- });
34
- });
35
- }
36
- //# sourceMappingURL=uploadApp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uploadApp.js","sourceRoot":"","sources":["../../../src/functions/altool/uploadApp.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAmB7C,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,UAAkB,EAClB,OAA4B,EAC5B,YAA8B;IAE9B,MAAM,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,GAAG,QAAQ,EACxB,GAAG,OAAO,CAAA;IAGX,MAAM,IAAI,GAAG;QACX,cAAc;QACd,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,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACnD,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAA;YAC3B,MAAM,WAAW,GAAG,MAAM,IAAI,EAAE,CAAA;YAEhC,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,YAAY,GAAG,WAAW,IAAI,KAAK,CAAC,OAAO,CAAA;gBACjD,MAAM,CAAC,IAAI,KAAK,CAAC,eAAe,YAAY,EAAE,CAAC,CAAC,CAAA;YAClD,CAAC;iBAAM,IAAI,WAAW,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBACxD,MAAM,CAAC,IAAI,KAAK,CAAC,oBAAoB,WAAW,EAAE,CAAC,CAAC,CAAA;YACtD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { NodeChildProcess } from '../../../references/node.d';
2
- import type { AltoolBaseOptions } from '../../../types/altool.d';
3
- export interface AltoolValidateOptions extends AltoolBaseOptions {
4
- file: string;
5
- }
6
- export interface AltoolValidateResult {
7
- hasWarnings: boolean;
8
- hasErrors: boolean;
9
- warnings: string[];
10
- errors: string[];
11
- }
12
- export declare function validateApp(altoolPath: string, options: AltoolValidateOptions, childProcess: NodeChildProcess): Promise<{
13
- hasWarnings: boolean;
14
- hasErrors: boolean;
15
- warnings: string[];
16
- errors: string[];
17
- }>;
@@ -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,U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KAAK,CAAC,YAAY,CAAC,CAAC,CAAA;YACjC,CAAC;iBAAM,CAAC;gBAEN,IAAI,iBAAiB,CAAC,SAAS,EAAE,CAAC;oBAChC,MAAM,CAAC,IAAI,KAAK,CAAC,aAAa,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACxE,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,iBAAiB,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { Base64Encoder } from '../../../references/browser.d';
2
- export declare const strToBase64: (str: string, base64Encoder: Base64Encoder) => string;
@@ -1,6 +0,0 @@
1
- export const strToBase64 = (str, base64Encoder) => {
2
- return base64Encoder.btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => {
3
- return String.fromCharCode(parseInt(p1, 16));
4
- }));
5
- };
6
- //# sourceMappingURL=strToBase64.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strToBase64.js","sourceRoot":"","sources":["../../../src/functions/base64/strToBase64.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,aAA4B,EAAU,EAAE;IAC/E,OAAO,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;QACzF,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { ColorPatterns } from '../../../types/color.d';
2
- export declare const COLOR_PATTERNS: ColorPatterns;
@@ -1,9 +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
- //# 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,2 +0,0 @@
1
- import type { ColorFormat } from '../../../types/color.d';
2
- export declare function detectColorFormat(color: string): ColorFormat | undefined;
@@ -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,CAAC,gBAAgB,EAAE,CAAA;IAGhD,MAAM,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,I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ath: 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,2 +0,0 @@
1
- import type { ColorReference, ColorPatterns } from '../../../types/color';
2
- export declare function extractCssVariableReferences(line: string, filePath: string, lineNumber: number, patterns: ColorPatterns, cssVariables: Record<string, string>): ColorReference[];
@@ -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,2 +0,0 @@
1
- import type { ColorReference, ColorPatterns } from '../../../types/color';
2
- export declare function extractThirdPartyVariableReferences(line: string, filePath: string, lineNumber: number, patterns: ColorPatterns, thirdPartyVariables: Record<string, string>): ColorReference[];
@@ -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,5 +0,0 @@
1
- import type { RgbColor, ColorFormat } from '../../../types/color.d';
2
- export declare function formatColorOutput(rgb: RgbColor, alpha: number, targetFormat: ColorFormat, options: {
3
- includeAlpha?: boolean;
4
- precision?: number;
5
- }): string | null;
@@ -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,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,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,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAA;IAEzC,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,KAAK,CAAC,CAAC,CAAC;YACX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GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAA;QACxE,CAAC;QAED,KAAK,OAAO,CAAC,CAAC,CAAC;YAEb,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;YACxC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,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,2 +0,0 @@
1
- import type { ColorPatterns } from '../../../types/color.d';
2
- export declare function getColorPatterns(): ColorPatterns;
@@ -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,2 +0,0 @@
1
- import type { NamedColorMap } from '../../../types/color.d';
2
- export declare function getNamedColorMap(): NamedColorMap;
@@ -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,2 +0,0 @@
1
- import type { RgbColor } from '../../../types/color.d';
2
- export declare function hexToRgb(hex: string): RgbColor | null;
@@ -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","sour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or | string | number, saturation?: number, lightness?: number): RgbColor | null;