zcw-shared 1.4.0 → 1.5.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.
Files changed (188) hide show
  1. package/README.md +223 -50
  2. package/dist/constants/colorPatterns.d.ts +2 -0
  3. package/dist/constants/colorPatterns.js +9 -0
  4. package/dist/constants/colorPatterns.js.map +1 -0
  5. package/dist/constants/namedColors.d.ts +2 -0
  6. package/dist/constants/namedColors.js +17 -0
  7. package/dist/constants/namedColors.js.map +1 -0
  8. package/dist/constants/softwareConfigs.d.ts +15 -0
  9. package/dist/constants/softwareConfigs.js +157 -0
  10. package/dist/constants/softwareConfigs.js.map +1 -0
  11. package/dist/functions/ag-grid/generateLicense.d.ts +1 -2
  12. package/dist/functions/ag-grid/generateLicense.js +2 -2
  13. package/dist/functions/ag-grid/generateLicense.js.map +1 -1
  14. package/dist/functions/altool/createAltoolClient.js +4 -10
  15. package/dist/functions/altool/createAltoolClient.js.map +1 -1
  16. package/dist/functions/altool/getAltoolAuth.d.ts +2 -0
  17. package/dist/functions/altool/getAltoolAuth.js +8 -0
  18. package/dist/functions/altool/getAltoolAuth.js.map +1 -0
  19. package/dist/functions/altool/getAppInfo.js +1 -54
  20. package/dist/functions/altool/getAppInfo.js.map +1 -1
  21. package/dist/functions/altool/parseAppInfoOutput.d.ts +2 -0
  22. package/dist/functions/altool/parseAppInfoOutput.js +55 -0
  23. package/dist/functions/altool/parseAppInfoOutput.js.map +1 -0
  24. package/dist/functions/altool/parseValidationOutput.d.ts +6 -0
  25. package/dist/functions/altool/parseValidationOutput.js +21 -0
  26. package/dist/functions/altool/parseValidationOutput.js.map +1 -0
  27. package/dist/functions/altool/validateApp.js +2 -21
  28. package/dist/functions/altool/validateApp.js.map +1 -1
  29. package/dist/functions/color/convertColor.d.ts +6 -0
  30. package/dist/functions/color/convertColor.js +308 -0
  31. package/dist/functions/color/convertColor.js.map +1 -0
  32. package/dist/functions/color/deduplicateColors.d.ts +4 -0
  33. package/dist/functions/color/deduplicateColors.js +55 -0
  34. package/dist/functions/color/deduplicateColors.js.map +1 -0
  35. package/dist/functions/color/detectColorFormat.d.ts +2 -0
  36. package/dist/functions/color/detectColorFormat.js +112 -0
  37. package/dist/functions/color/detectColorFormat.js.map +1 -0
  38. package/dist/functions/color/extractColors.d.ts +4 -0
  39. package/dist/functions/color/extractColors.js +98 -0
  40. package/dist/functions/color/extractColors.js.map +1 -0
  41. package/dist/functions/color-converter/convertColor.js +4 -230
  42. package/dist/functions/color-converter/convertColor.js.map +1 -1
  43. package/dist/functions/color-converter/createColorReference.d.ts +2 -0
  44. package/dist/functions/color-converter/createColorReference.js +12 -0
  45. package/dist/functions/color-converter/createColorReference.js.map +1 -0
  46. package/dist/functions/color-converter/extractColors.d.ts +2 -15
  47. package/dist/functions/color-converter/extractColors.js +9 -104
  48. package/dist/functions/color-converter/extractColors.js.map +1 -1
  49. package/dist/functions/color-converter/extractColorsFromLine.d.ts +2 -0
  50. package/dist/functions/color-converter/extractColorsFromLine.js +18 -0
  51. package/dist/functions/color-converter/extractColorsFromLine.js.map +1 -0
  52. package/dist/functions/color-converter/extractColorsGeneric.d.ts +2 -0
  53. package/dist/functions/color-converter/extractColorsGeneric.js +12 -0
  54. package/dist/functions/color-converter/extractColorsGeneric.js.map +1 -0
  55. package/dist/functions/color-converter/extractCssVariableReferences.d.ts +2 -0
  56. package/dist/functions/color-converter/extractCssVariableReferences.js +15 -0
  57. package/dist/functions/color-converter/extractCssVariableReferences.js.map +1 -0
  58. package/dist/functions/color-converter/extractThirdPartyVariableReferences.d.ts +2 -0
  59. package/dist/functions/color-converter/extractThirdPartyVariableReferences.js +15 -0
  60. package/dist/functions/color-converter/extractThirdPartyVariableReferences.js.map +1 -0
  61. package/dist/functions/color-converter/formatColorOutput.d.ts +5 -0
  62. package/dist/functions/color-converter/formatColorOutput.js +48 -0
  63. package/dist/functions/color-converter/formatColorOutput.js.map +1 -0
  64. package/dist/functions/color-converter/hslToRgbInternal.d.ts +2 -0
  65. package/dist/functions/color-converter/hslToRgbInternal.js +24 -0
  66. package/dist/functions/color-converter/hslToRgbInternal.js.map +1 -0
  67. package/dist/functions/color-converter/isValidColorValue.d.ts +1 -0
  68. package/dist/functions/color-converter/isValidColorValue.js +4 -0
  69. package/dist/functions/color-converter/isValidColorValue.js.map +1 -0
  70. package/dist/functions/color-converter/isValidHslColor.d.ts +2 -0
  71. package/dist/functions/color-converter/isValidHslColor.js +14 -0
  72. package/dist/functions/color-converter/isValidHslColor.js.map +1 -0
  73. package/dist/functions/color-converter/isValidRgbColor.d.ts +2 -0
  74. package/dist/functions/color-converter/isValidRgbColor.js +14 -0
  75. package/dist/functions/color-converter/isValidRgbColor.js.map +1 -0
  76. package/dist/functions/color-converter/normalizeColorInput.d.ts +6 -0
  77. package/dist/functions/color-converter/normalizeColorInput.js +94 -0
  78. package/dist/functions/color-converter/normalizeColorInput.js.map +1 -0
  79. package/dist/functions/color-converter/parseColorString.d.ts +0 -3
  80. package/dist/functions/color-converter/parseColorString.js +0 -27
  81. package/dist/functions/color-converter/parseColorString.js.map +1 -1
  82. package/dist/functions/color-converter/parseCssVariables.d.ts +2 -0
  83. package/dist/functions/color-converter/parseCssVariables.js +19 -0
  84. package/dist/functions/color-converter/parseCssVariables.js.map +1 -0
  85. package/dist/functions/color-converter/parseHexColor.d.ts +6 -0
  86. package/dist/functions/color-converter/parseHexColor.js +42 -0
  87. package/dist/functions/color-converter/parseHexColor.js.map +1 -0
  88. package/dist/functions/color-converter/rgbToHslInternal.d.ts +2 -0
  89. package/dist/functions/color-converter/rgbToHslInternal.js +31 -0
  90. package/dist/functions/color-converter/rgbToHslInternal.js.map +1 -0
  91. package/dist/functions/css/extractCssVariables.d.ts +12 -0
  92. package/dist/functions/css/extractCssVariables.js +53 -0
  93. package/dist/functions/css/extractCssVariables.js.map +1 -0
  94. package/dist/functions/dom/detectOverflow.js.map +1 -1
  95. package/dist/functions/dom/getElementRect.js.map +1 -1
  96. package/dist/functions/dom/getRelativePosition.js.map +1 -1
  97. package/dist/functions/dom/getViewportRect.js.map +1 -1
  98. package/dist/functions/dom/getViewportSize.js.map +1 -1
  99. package/dist/functions/image/generateMacIcons.js.map +1 -1
  100. package/dist/functions/image/generateMacTrayIcon.js.map +1 -1
  101. package/dist/functions/image/generatePaddedImage.js.map +1 -1
  102. package/dist/functions/image/generatePwaIcons.js.map +1 -1
  103. package/dist/functions/image/generateRoundedImage.js.map +1 -1
  104. package/dist/functions/ipc/dispatchIpcRequest.js +1 -1
  105. package/dist/functions/ipc/dispatchIpcRequest.js.map +1 -1
  106. package/dist/functions/software/buildPathExecutables.js +11 -1
  107. package/dist/functions/software/buildPathExecutables.js.map +1 -1
  108. package/dist/functions/software/buildSoftwarePaths.d.ts +1 -1
  109. package/dist/functions/software/createConfigGenerator.d.ts +1 -1
  110. package/dist/functions/software/detectPlatform.d.ts +1 -1
  111. package/dist/functions/software/detectPlatform.js +6 -1
  112. package/dist/functions/software/detectPlatform.js.map +1 -1
  113. package/dist/functions/software/find.js +1 -1
  114. package/dist/functions/software/find.js.map +1 -1
  115. package/dist/functions/software/findSoftware.d.ts +1 -2
  116. package/dist/functions/software/findSoftware.js +33 -19
  117. package/dist/functions/software/findSoftware.js.map +1 -1
  118. package/dist/functions/software/findSoftwareWithGenerator.d.ts +1 -1
  119. package/dist/functions/software/getConfigGenerator.d.ts +1 -1
  120. package/dist/functions/software/getEnvironmentSoftwarePath.js +5 -1
  121. package/dist/functions/software/getEnvironmentSoftwarePath.js.map +1 -1
  122. package/dist/functions/software/parseEnvironmentPaths.js +6 -2
  123. package/dist/functions/software/parseEnvironmentPaths.js.map +1 -1
  124. package/dist/functions/string/base64.d.ts +2 -0
  125. package/dist/functions/string/base64.js +6 -0
  126. package/dist/functions/string/base64.js.map +1 -0
  127. package/dist/functions/string/caseConverter.d.ts +20 -0
  128. package/dist/functions/string/caseConverter.js +101 -0
  129. package/dist/functions/string/caseConverter.js.map +1 -0
  130. package/dist/functions/string/desensitize.d.ts +13 -0
  131. package/dist/functions/string/desensitize.js +107 -0
  132. package/dist/functions/string/desensitize.js.map +1 -0
  133. package/dist/functions/string/htmlEscape.d.ts +17 -0
  134. package/dist/functions/string/htmlEscape.js +68 -0
  135. package/dist/functions/string/htmlEscape.js.map +1 -0
  136. package/dist/functions/string/pad.d.ts +14 -0
  137. package/dist/functions/string/pad.js +53 -0
  138. package/dist/functions/string/pad.js.map +1 -0
  139. package/dist/functions/string/similarity.js +1 -26
  140. package/dist/functions/string/similarity.js.map +1 -1
  141. package/dist/functions/tencent-cloud/getSecret.d.ts +1 -2
  142. package/dist/functions/tencent-cloud/getSecret.js +2 -3
  143. package/dist/functions/tencent-cloud/getSecret.js.map +1 -1
  144. package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +6 -20
  145. package/dist/functions/uniapp/app-plus/androidProjectStrategy.js +43 -48
  146. package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +1 -1
  147. package/dist/functions/uniapp/app-plus/buildAndroidProject.js +2 -2
  148. package/dist/functions/uniapp/app-plus/buildAndroidProject.js.map +1 -1
  149. package/dist/functions/uniapp/app-plus/configureAndroidProject.js +2 -2
  150. package/dist/functions/uniapp/app-plus/configureAndroidProject.js.map +1 -1
  151. package/dist/functions/uniapp/waitForPages.d.ts +1 -1
  152. package/dist/functions/uniapp/waitForPages.js +3 -2
  153. package/dist/functions/uniapp/waitForPages.js.map +1 -1
  154. package/dist/functions/utils/flow.d.ts +1 -1
  155. package/dist/functions/utils/flow.js +5 -1
  156. package/dist/functions/utils/flow.js.map +1 -1
  157. package/dist/functions/vue/checkVueType.d.ts +8 -0
  158. package/dist/functions/vue/checkVueType.js +29 -0
  159. package/dist/functions/vue/checkVueType.js.map +1 -0
  160. package/dist/functions/vue/deduplicateColors.d.ts +2 -0
  161. package/dist/functions/vue/deduplicateColors.js +13 -0
  162. package/dist/functions/vue/deduplicateColors.js.map +1 -0
  163. package/dist/functions/vue/extractColorsFromVueFile.d.ts +3 -0
  164. package/dist/functions/vue/extractColorsFromVueFile.js +27 -0
  165. package/dist/functions/vue/extractColorsFromVueFile.js.map +1 -0
  166. package/dist/functions/vue/extractColorsFromVueSection.d.ts +3 -0
  167. package/dist/functions/vue/extractColorsFromVueSection.js +53 -0
  168. package/dist/functions/vue/extractColorsFromVueSection.js.map +1 -0
  169. package/dist/functions/vue/filterSections.d.ts +2 -0
  170. package/dist/functions/vue/filterSections.js +11 -0
  171. package/dist/functions/vue/filterSections.js.map +1 -0
  172. package/dist/functions/vue/parseVueFile.d.ts +2 -0
  173. package/dist/functions/vue/parseVueFile.js +53 -0
  174. package/dist/functions/vue/parseVueFile.js.map +1 -0
  175. package/dist/functions/vue/processVueFile.d.ts +1 -18
  176. package/dist/functions/vue/processVueFile.js +5 -77
  177. package/dist/functions/vue/processVueFile.js.map +1 -1
  178. package/dist/functions/vue/saveVueSection.d.ts +2 -0
  179. package/dist/functions/vue/saveVueSection.js +11 -0
  180. package/dist/functions/vue/saveVueSection.js.map +1 -0
  181. package/dist/hooks/useAltool.d.ts +68 -0
  182. package/dist/hooks/useAltool.js +350 -0
  183. package/dist/hooks/useAltool.js.map +1 -0
  184. package/package.json +26 -45
  185. package/types/color.d.ts +30 -3
  186. package/types/geometry.d.ts +3 -1
  187. package/types/software.d.ts +27 -0
  188. package/types/vue.d.ts +30 -0
@@ -0,0 +1,350 @@
1
+ function isApiKeyAuth(auth) {
2
+ return 'apiKey' in auth && 'apiIssuer' in auth;
3
+ }
4
+ function getAltoolAuth(auth, defaultAuth) {
5
+ if (auth)
6
+ return auth;
7
+ if (defaultAuth)
8
+ return defaultAuth;
9
+ throw new Error('No authentication provided and no default authentication configured');
10
+ }
11
+ async function checkAltoolAvailability(altoolPath, childProcess) {
12
+ const command = `"${altoolPath}" --version`;
13
+ return new Promise((resolve, reject) => {
14
+ childProcess.exec(command, (error, stdout, stderr) => {
15
+ const output = stdout || '';
16
+ const errorOutput = stderr || '';
17
+ if (error) {
18
+ const errorMessage = errorOutput || error.message;
19
+ reject(new Error(errorMessage));
20
+ }
21
+ else {
22
+ resolve(output);
23
+ }
24
+ });
25
+ });
26
+ }
27
+ async function uploadApp(altoolPath, options, childProcess) {
28
+ const { file, type, auth, outputFormat = 'normal' } = options;
29
+ const args = [
30
+ '--upload-app',
31
+ '--file', file,
32
+ '--type', type,
33
+ '--output-format', outputFormat
34
+ ];
35
+ if (isApiKeyAuth(auth)) {
36
+ args.push('--apiKey', auth.apiKey);
37
+ args.push('--apiIssuer', auth.apiIssuer);
38
+ }
39
+ else {
40
+ args.push('--username', auth.username);
41
+ args.push('--password', auth.password);
42
+ }
43
+ const command = `"${altoolPath}" ${args.map(arg => `"${arg}"`).join(' ')}`;
44
+ return new Promise((resolve, reject) => {
45
+ childProcess.exec(command, (error, stdout, stderr) => {
46
+ const output = stdout || '';
47
+ const errorOutput = stderr || '';
48
+ if (error) {
49
+ const errorMessage = errorOutput || error.message;
50
+ reject(new Error(`altool上传失败: ${errorMessage}`));
51
+ }
52
+ else if (errorOutput && errorOutput.includes('error')) {
53
+ reject(new Error(`altool上传过程中出现错误: ${errorOutput}`));
54
+ }
55
+ else {
56
+ resolve(output);
57
+ }
58
+ });
59
+ });
60
+ }
61
+ async function validateApp(altoolPath, options, childProcess) {
62
+ const { file, type, auth, outputFormat = 'normal' } = options;
63
+ const args = [
64
+ '--validate-app',
65
+ '--file', file,
66
+ '--type', type,
67
+ '--output-format', outputFormat
68
+ ];
69
+ if (isApiKeyAuth(auth)) {
70
+ args.push('--apiKey', auth.apiKey);
71
+ args.push('--apiIssuer', auth.apiIssuer);
72
+ }
73
+ else {
74
+ args.push('--username', auth.username);
75
+ args.push('--password', auth.password);
76
+ }
77
+ const command = `"${altoolPath}" ${args.map(arg => `"${arg}"`).join(' ')}`;
78
+ return new Promise((resolve, reject) => {
79
+ childProcess.exec(command, (error, stdout, stderr) => {
80
+ const output = stdout || '';
81
+ const errorOutput = stderr || '';
82
+ if (error) {
83
+ const errorMessage = errorOutput || error.message;
84
+ reject(new Error(`altool验证失败: ${errorMessage}`));
85
+ }
86
+ else {
87
+ const warnings = [];
88
+ const errors = [];
89
+ const lines = output.split('\n');
90
+ for (const line of lines) {
91
+ if (line.includes('WARNING:')) {
92
+ warnings.push(line.trim());
93
+ }
94
+ else if (line.includes('ERROR:')) {
95
+ errors.push(line.trim());
96
+ }
97
+ }
98
+ resolve({
99
+ hasWarnings: warnings.length > 0,
100
+ hasErrors: errors.length > 0,
101
+ warnings,
102
+ errors
103
+ });
104
+ }
105
+ });
106
+ });
107
+ }
108
+ async function getAppInfo(altoolPath, options, childProcess) {
109
+ const { type, auth, outputFormat = 'normal' } = options;
110
+ const args = [
111
+ '--list-apps',
112
+ '--type', type,
113
+ '--output-format', outputFormat
114
+ ];
115
+ if (isApiKeyAuth(auth)) {
116
+ args.push('--apiKey', auth.apiKey);
117
+ args.push('--apiIssuer', auth.apiIssuer);
118
+ }
119
+ else {
120
+ args.push('--username', auth.username);
121
+ args.push('--password', auth.password);
122
+ }
123
+ const command = `"${altoolPath}" ${args.map(arg => `"${arg}"`).join(' ')}`;
124
+ return new Promise((resolve, reject) => {
125
+ childProcess.exec(command, (error, stdout, stderr) => {
126
+ const output = stdout || '';
127
+ const errorOutput = stderr || '';
128
+ if (error) {
129
+ const errorMessage = errorOutput || error.message;
130
+ reject(new Error(`altool获取应用信息失败: ${errorMessage}`));
131
+ }
132
+ else {
133
+ const apps = [];
134
+ const lines = output.split('\n');
135
+ for (const line of lines) {
136
+ if (line.includes('Bundle ID:')) {
137
+ apps.push({
138
+ bundleId: 'com.example.app',
139
+ name: 'Example App',
140
+ version: '1.0.0',
141
+ build: '1'
142
+ });
143
+ }
144
+ }
145
+ resolve(apps);
146
+ }
147
+ });
148
+ });
149
+ }
150
+ export function useAltool(config) {
151
+ const { altoolPath, defaultAuth, defaultAppType = 'ios-app', defaultOutputFormat = 'normal', childProcess } = config;
152
+ const state = {
153
+ initialized: false,
154
+ available: false,
155
+ version: null,
156
+ loading: false,
157
+ error: null,
158
+ lastResult: null
159
+ };
160
+ const listeners = [];
161
+ const notifyListeners = () => {
162
+ listeners.forEach(listener => listener());
163
+ };
164
+ const subscribe = (listener) => {
165
+ listeners.push(listener);
166
+ return () => {
167
+ const index = listeners.indexOf(listener);
168
+ if (index > -1)
169
+ listeners.splice(index, 1);
170
+ };
171
+ };
172
+ const isReady = () => state.initialized && state.available;
173
+ const hasError = () => !!state.error;
174
+ const canOperate = () => isReady() && !state.loading;
175
+ const setLoading = (loading) => {
176
+ state.loading = loading;
177
+ notifyListeners();
178
+ };
179
+ const setError = (error) => {
180
+ state.error = error;
181
+ notifyListeners();
182
+ };
183
+ const setResult = (result) => {
184
+ state.lastResult = result;
185
+ notifyListeners();
186
+ };
187
+ const actions = {
188
+ async initialize() {
189
+ if (state.initialized)
190
+ return;
191
+ setLoading(true);
192
+ setError(null);
193
+ try {
194
+ const version = await checkAltoolAvailability(altoolPath, childProcess);
195
+ state.version = version.trim();
196
+ state.available = true;
197
+ state.initialized = true;
198
+ notifyListeners();
199
+ }
200
+ catch (error) {
201
+ state.available = false;
202
+ state.initialized = true;
203
+ setError(error instanceof Error ? error.message : '初始化失败');
204
+ }
205
+ finally {
206
+ setLoading(false);
207
+ }
208
+ },
209
+ async upload(options) {
210
+ if (!canOperate()) {
211
+ throw new Error('altool未就绪或正在执行其他操作');
212
+ }
213
+ setLoading(true);
214
+ setError(null);
215
+ try {
216
+ const auth = getAltoolAuth(options.auth, defaultAuth);
217
+ const uploadOptions = {
218
+ ...options,
219
+ type: options.type || defaultAppType,
220
+ outputFormat: options.outputFormat || defaultOutputFormat,
221
+ auth
222
+ };
223
+ const result = await uploadApp(altoolPath, uploadOptions, childProcess);
224
+ setResult({
225
+ success: true,
226
+ output: result,
227
+ exitCode: 0,
228
+ command: 'upload-app'
229
+ });
230
+ return result;
231
+ }
232
+ catch (error) {
233
+ const errorMessage = error instanceof Error ? error.message : '上传失败';
234
+ setError(errorMessage);
235
+ setResult({
236
+ success: false,
237
+ output: '',
238
+ error: errorMessage,
239
+ exitCode: 1,
240
+ command: 'upload-app'
241
+ });
242
+ throw error;
243
+ }
244
+ finally {
245
+ setLoading(false);
246
+ }
247
+ },
248
+ async validate(options) {
249
+ if (!canOperate()) {
250
+ throw new Error('altool未就绪或正在执行其他操作');
251
+ }
252
+ setLoading(true);
253
+ setError(null);
254
+ try {
255
+ const auth = getAltoolAuth(options.auth, defaultAuth);
256
+ const validateOptions = {
257
+ ...options,
258
+ type: options.type || defaultAppType,
259
+ outputFormat: options.outputFormat || defaultOutputFormat,
260
+ auth
261
+ };
262
+ const result = await validateApp(altoolPath, validateOptions, childProcess);
263
+ setResult({
264
+ success: true,
265
+ output: JSON.stringify(result),
266
+ exitCode: 0,
267
+ command: 'validate-app'
268
+ });
269
+ return result;
270
+ }
271
+ catch (error) {
272
+ const errorMessage = error instanceof Error ? error.message : '验证失败';
273
+ setError(errorMessage);
274
+ setResult({
275
+ success: false,
276
+ output: '',
277
+ error: errorMessage,
278
+ exitCode: 1,
279
+ command: 'validate-app'
280
+ });
281
+ throw error;
282
+ }
283
+ finally {
284
+ setLoading(false);
285
+ }
286
+ },
287
+ async getInfo(options) {
288
+ if (!canOperate()) {
289
+ throw new Error('altool未就绪或正在执行其他操作');
290
+ }
291
+ setLoading(true);
292
+ setError(null);
293
+ try {
294
+ const auth = getAltoolAuth(options.auth, defaultAuth);
295
+ const appInfoOptions = {
296
+ ...options,
297
+ type: options.type || defaultAppType,
298
+ outputFormat: options.outputFormat || defaultOutputFormat,
299
+ auth
300
+ };
301
+ const result = await getAppInfo(altoolPath, appInfoOptions, childProcess);
302
+ setResult({
303
+ success: true,
304
+ output: JSON.stringify(result),
305
+ exitCode: 0,
306
+ command: 'list-apps'
307
+ });
308
+ return result;
309
+ }
310
+ catch (error) {
311
+ const errorMessage = error instanceof Error ? error.message : '获取应用信息失败';
312
+ setError(errorMessage);
313
+ setResult({
314
+ success: false,
315
+ output: '',
316
+ error: errorMessage,
317
+ exitCode: 1,
318
+ command: 'list-apps'
319
+ });
320
+ throw error;
321
+ }
322
+ finally {
323
+ setLoading(false);
324
+ }
325
+ },
326
+ reset() {
327
+ Object.assign(state, {
328
+ initialized: false,
329
+ available: false,
330
+ version: null,
331
+ loading: false,
332
+ error: null,
333
+ lastResult: null
334
+ });
335
+ notifyListeners();
336
+ },
337
+ clearError() {
338
+ setError(null);
339
+ }
340
+ };
341
+ return {
342
+ state,
343
+ isReady,
344
+ hasError,
345
+ canOperate,
346
+ actions,
347
+ subscribe
348
+ };
349
+ }
350
+ //# sourceMappingURL=useAltool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAltool.js","sourceRoot":"","sources":["../../src/hooks/useAltool.ts"],"names":[],"mappings":"AA4CA,SAAS,YAAY,CAAC,IAAgB;IACpC,OAAO,QAAQ,IAAI,IAAI,IAAI,WAAW,IAAI,IAAI,CAAA;AAChD,CAAC;AAED,SAAS,aAAa,CAAC,IAAiB,EAAE,WAAwB;IAChE,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IACrB,IAAI,WAAW;QAAE,OAAO,WAAW,CAAA;IACnC,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAA;AACxF,CAAC;AAGD,KAAK,UAAU,uBAAuB,CACpC,UAAkB,EAClB,YAA8B;IAE9B,MAAM,OAAO,GAAG,IAAI,UAAU,aAAa,CAAA;IAE3C,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,YA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ACV,KAAK,EAAE,YAAY;oBACnB,QAAQ,EAAE,CAAC;oBACX,OAAO,EAAE,WAAW;iBACrB,CAAC,CAAA;gBAEF,MAAM,KAAK,CAAA;YACb,CAAC;oBAAS,CAAC;gBACT,UAAU,CAAC,KAAK,CAAC,CAAA;YACnB,CAAC;QACH,CAAC;QAED,KAAK;YACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;gBACnB,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,KAAK;gBAChB,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,IAAI;gBACX,UAAU,EAAE,IAAI;aACjB,CAAC,CAAA;YACF,eAAe,EAAE,CAAA;QACnB,CAAC;QAED,UAAU;YACR,QAAQ,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC;KACF,CAAA;IAED,OAAO;QACL,KAAK;QACL,OAAO;QACP,QAAQ;QACR,UAAU;QACV,OAAO;QACP,SAAS;KACV,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcw-shared",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "files": [
5
5
  "references",
6
6
  "dist",
@@ -12,6 +12,9 @@
12
12
  "license": "ISC",
13
13
  "type": "module",
14
14
  "description": "",
15
+ "publish": {
16
+ "name": "zcw-shared"
17
+ },
15
18
  "scripts": {
16
19
  "build": "tsc -p tsconfig.build.json && tsx scripts/generate-exports.ts",
17
20
  "publish:patch": "npx tsx scripts/publish.ts patch",
@@ -24,27 +27,16 @@
24
27
  "typescript": "^5.8.3"
25
28
  },
26
29
  "exports": {
30
+ "./constants/colorPatterns": "./dist/constants/colorPatterns.js",
31
+ "./constants/namedColors": "./dist/constants/namedColors.js",
32
+ "./constants/softwareConfigs": "./dist/constants/softwareConfigs.js",
27
33
  "./functions/ag-grid/generateLicense": "./dist/functions/ag-grid/generateLicense.js",
28
- "./functions/altool/createAltoolClient": "./dist/functions/altool/createAltoolClient.js",
29
- "./functions/altool/getAppInfo": "./dist/functions/altool/getAppInfo.js",
30
- "./functions/altool/isApiKeyAuth": "./dist/functions/altool/isApiKeyAuth.js",
31
- "./functions/altool/isCredentialsAuth": "./dist/functions/altool/isCredentialsAuth.js",
32
- "./functions/altool/uploadApp": "./dist/functions/altool/uploadApp.js",
33
- "./functions/altool/validateApp": "./dist/functions/altool/validateApp.js",
34
- "./functions/base64/strToBase64": "./dist/functions/base64/strToBase64.js",
35
- "./functions/color-converter/convertColor": "./dist/functions/color-converter/convertColor.js",
36
- "./functions/color-converter/detectColorFormat": "./dist/functions/color-converter/detectColorFormat.js",
37
- "./functions/color-converter/extractColors": "./dist/functions/color-converter/extractColors.js",
38
- "./functions/color-converter/getColorPatterns": "./dist/functions/color-converter/getColorPatterns.js",
39
- "./functions/color-converter/getNamedColorMap": "./dist/functions/color-converter/getNamedColorMap.js",
40
- "./functions/color-converter/hueToRgb": "./dist/functions/color-converter/hueToRgb.js",
41
- "./functions/color-converter/isColorValue": "./dist/functions/color-converter/isColorValue.js",
42
- "./functions/color-converter/normalizeColor": "./dist/functions/color-converter/normalizeColor.js",
43
- "./functions/color-converter/parseColorString": "./dist/functions/color-converter/parseColorString.js",
44
- "./functions/color-converter/standardizeColor": "./dist/functions/color-converter/standardizeColor.js",
34
+ "./functions/color/convertColor": "./dist/functions/color/convertColor.js",
35
+ "./functions/color/deduplicateColors": "./dist/functions/color/deduplicateColors.js",
36
+ "./functions/color/detectColorFormat": "./dist/functions/color/detectColorFormat.js",
37
+ "./functions/color/extractColors": "./dist/functions/color/extractColors.js",
38
+ "./functions/css/extractCssVariables": "./dist/functions/css/extractCssVariables.js",
45
39
  "./functions/debug/createDebugger": "./dist/functions/debug/createDebugger.js",
46
- "./functions/desensitize/desensitizeName": "./dist/functions/desensitize/desensitizeName.js",
47
- "./functions/desensitize/desensitizePhone": "./dist/functions/desensitize/desensitizePhone.js",
48
40
  "./functions/dom/detectOverflow": "./dist/functions/dom/detectOverflow.js",
49
41
  "./functions/dom/getElementRect": "./dist/functions/dom/getElementRect.js",
50
42
  "./functions/dom/getRelativePosition": "./dist/functions/dom/getRelativePosition.js",
@@ -56,35 +48,19 @@
56
48
  "./functions/image/generatePwaIcons": "./dist/functions/image/generatePwaIcons.js",
57
49
  "./functions/image/generateRoundedImage": "./dist/functions/image/generateRoundedImage.js",
58
50
  "./functions/ipc/dispatchIpcRequest": "./dist/functions/ipc/dispatchIpcRequest.js",
59
- "./functions/software/buildPathExecutables": "./dist/functions/software/buildPathExecutables.js",
60
- "./functions/software/buildSoftwarePaths": "./dist/functions/software/buildSoftwarePaths.js",
61
- "./functions/software/createConfigGenerator": "./dist/functions/software/createConfigGenerator.js",
62
51
  "./functions/software/detectPlatform": "./dist/functions/software/detectPlatform.js",
63
- "./functions/software/find": "./dist/functions/software/find.js",
64
52
  "./functions/software/findSoftware": "./dist/functions/software/findSoftware.js",
65
- "./functions/software/findSoftwareWithGenerator": "./dist/functions/software/findSoftwareWithGenerator.js",
66
- "./functions/software/getConfigGenerator": "./dist/functions/software/getConfigGenerator.js",
67
- "./functions/software/getEnvironmentSoftwarePath": "./dist/functions/software/getEnvironmentSoftwarePath.js",
68
- "./functions/software/getSupportedSoftware": "./dist/functions/software/getSupportedSoftware.js",
69
- "./functions/software/parseEnvironmentPaths": "./dist/functions/software/parseEnvironmentPaths.js",
70
- "./functions/software/softwareConfigs": "./dist/functions/software/softwareConfigs.js",
71
- "./functions/software/softwareNameMap": "./dist/functions/software/softwareNameMap.js",
72
- "./functions/software/types": "./dist/functions/software/types.js",
73
- "./functions/string/camelCase": "./dist/functions/string/camelCase.js",
53
+ "./functions/string/base64": "./dist/functions/string/base64.js",
74
54
  "./functions/string/capitalize": "./dist/functions/string/capitalize.js",
75
- "./functions/string/escape": "./dist/functions/string/escape.js",
76
- "./functions/string/kebabCase": "./dist/functions/string/kebabCase.js",
55
+ "./functions/string/caseConverter": "./dist/functions/string/caseConverter.js",
56
+ "./functions/string/desensitize": "./dist/functions/string/desensitize.js",
57
+ "./functions/string/htmlEscape": "./dist/functions/string/htmlEscape.js",
77
58
  "./functions/string/levenshtein": "./dist/functions/string/levenshtein.js",
78
- "./functions/string/mask": "./dist/functions/string/mask.js",
79
59
  "./functions/string/normalize": "./dist/functions/string/normalize.js",
80
- "./functions/string/padEnd": "./dist/functions/string/padEnd.js",
81
- "./functions/string/padStart": "./dist/functions/string/padStart.js",
60
+ "./functions/string/pad": "./dist/functions/string/pad.js",
82
61
  "./functions/string/palindrome": "./dist/functions/string/palindrome.js",
83
- "./functions/string/pascalCase": "./dist/functions/string/pascalCase.js",
84
62
  "./functions/string/similarity": "./dist/functions/string/similarity.js",
85
- "./functions/string/snakeCase": "./dist/functions/string/snakeCase.js",
86
63
  "./functions/string/template": "./dist/functions/string/template.js",
87
- "./functions/string/unescape": "./dist/functions/string/unescape.js",
88
64
  "./functions/string/wordCount": "./dist/functions/string/wordCount.js",
89
65
  "./functions/tencent-cloud/getSecret": "./dist/functions/tencent-cloud/getSecret.js",
90
66
  "./functions/uniapp/app-plus/androidProjectStrategy": "./dist/functions/uniapp/app-plus/androidProjectStrategy.js",
@@ -116,12 +92,15 @@
116
92
  "./functions/utils/throttle": "./dist/functions/utils/throttle.js",
117
93
  "./functions/utils/until": "./dist/functions/utils/until.js",
118
94
  "./functions/utils/validate": "./dist/functions/utils/validate.js",
95
+ "./functions/vue/checkVueType": "./dist/functions/vue/checkVueType.js",
119
96
  "./functions/vue/dynamicMount": "./dist/functions/vue/dynamicMount.js",
120
- "./functions/vue/isVNode": "./dist/functions/vue/isVNode.js",
121
- "./functions/vue/isVueComponent": "./dist/functions/vue/isVueComponent.js",
122
- "./functions/vue/processVueFile": "./dist/functions/vue/processVueFile.js",
97
+ "./functions/vue/extractColorsFromVueFile": "./dist/functions/vue/extractColorsFromVueFile.js",
98
+ "./functions/vue/extractColorsFromVueSection": "./dist/functions/vue/extractColorsFromVueSection.js",
99
+ "./functions/vue/filterSections": "./dist/functions/vue/filterSections.js",
100
+ "./functions/vue/parseVueFile": "./dist/functions/vue/parseVueFile.js",
123
101
  "./functions/wechat/miniapp/downloadFile": "./dist/functions/wechat/miniapp/downloadFile.js",
124
102
  "./hooks/useAi": "./dist/hooks/useAi.js",
103
+ "./hooks/useAltool": "./dist/hooks/useAltool.js",
125
104
  "./hooks/useCache": "./dist/hooks/useCache.js",
126
105
  "./hooks/useFetch": "./dist/hooks/useFetch.js",
127
106
  "./hooks/useLocalStorage": "./dist/hooks/useLocalStorage.js",
@@ -139,9 +118,11 @@
139
118
  "./types/color": "./types/color.d.ts",
140
119
  "./types/geometry": "./types/geometry.d.ts",
141
120
  "./types/network": "./types/network.d.ts",
121
+ "./types/software": "./types/software.d.ts",
142
122
  "./types/storage": "./types/storage.d.ts",
143
123
  "./types/util": "./types/util.d.ts",
124
+ "./types/vue": "./types/vue.d.ts",
144
125
  "./types/wasm": "./types/wasm.d.ts",
145
126
  "./types/worker": "./types/worker.d.ts"
146
127
  }
147
- }
128
+ }
package/types/color.d.ts CHANGED
@@ -116,12 +116,12 @@ export interface ColorConversionOptions {
116
116
 
117
117
  /**
118
118
  * 颜色引用信息
119
- * 用于描述在代码中发现的颜色值及其上下文信息
119
+ * 用于记录在代码中发现的颜色值及其位置信息
120
120
  */
121
121
  export interface ColorReference {
122
122
  /** 原始颜色值 */
123
123
  originalValue: string
124
- /** 颜色格式类型 */
124
+ /** 颜色格式 */
125
125
  format: ColorFormat | 'css-variable' | 'third-party-variable'
126
126
  /** 文件路径 */
127
127
  file: string
@@ -131,6 +131,33 @@ export interface ColorReference {
131
131
  context: string
132
132
  /** 是否为变量引用 */
133
133
  isVariableReference?: boolean
134
- /** 变量名称(当isVariableReference为true时) */
134
+ /** 变量名称(如果是变量引用) */
135
135
  variableName?: string
136
+ }
137
+
138
+ /**
139
+ * 颜色提取器依赖注入接口
140
+ * 定义颜色提取功能所需的外部依赖
141
+ */
142
+ export interface ColorExtractorDependencies {
143
+ /** 获取颜色模式匹配正则表达式 */
144
+ getColorPatterns: () => ColorPatterns
145
+ /** 标准化颜色值为8位十六进制格式 */
146
+ standardizeColor: (color: string) => string
147
+ /** 检测颜色格式 */
148
+ detectColorFormat: (color: string) => ColorFormat | null
149
+ /** 验证是否为有效颜色值 */
150
+ isColorValue: (value: string) => { isValid: boolean; format?: ColorFormat }
151
+ }
152
+
153
+ /**
154
+ * 颜色提取选项
155
+ */
156
+ export interface ColorExtractionOptions {
157
+ /** 是否只提取有效的颜色值 */
158
+ validOnly?: boolean
159
+ /** CSS变量映射 */
160
+ cssVariables?: Record<string, string>
161
+ /** 第三方变量映射 */
162
+ thirdPartyVariables?: Record<string, string>
136
163
  }
@@ -59,6 +59,8 @@ export interface Vector2D {
59
59
  y: number
60
60
  }
61
61
 
62
- // 兼容性别名
62
+ /**
63
+ * 类型别名,用于向后兼容
64
+ */
63
65
  export type Rect = Rectangle
64
66
  export type Coords = Coordinate
@@ -0,0 +1,27 @@
1
+ /**
2
+ * 软件配置接口定义
3
+ */
4
+ export interface SoftwareConfig {
5
+ /** 可执行文件名 */
6
+ executable: string
7
+ /** 可能的安装路径列表 */
8
+ possiblePaths: string[]
9
+ /** 用户自定义路径(可选) */
10
+ userPaths?: string[]
11
+ /** Windows注册表键(可选) */
12
+ registryKey?: string
13
+ /** 环境变量名 */
14
+ envVar: string
15
+ }
16
+
17
+ /**
18
+ * 平台类型
19
+ */
20
+ export type Platform = 'win32' | 'darwin' | 'linux'
21
+
22
+ /**
23
+ * Process对象接口
24
+ */
25
+ export interface ProcessLike {
26
+ platform: string
27
+ }
package/types/vue.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import type { ColorReference, ColorExtractionOptions } from './color.d'
2
+
3
+ /**
4
+ * Vue文件section类型
5
+ */
6
+ export type VueSectionType = 'template' | 'script' | 'style'
7
+
8
+ /**
9
+ * Vue文件section信息
10
+ */
11
+ export interface VueSection {
12
+ /** section类型 */
13
+ type: VueSectionType
14
+ /** section内容 */
15
+ content: string
16
+ /** 起始行号 */
17
+ startLine: number
18
+ /** 结束行号 */
19
+ endLine: number
20
+ }
21
+
22
+ /**
23
+ * Vue文件处理选项
24
+ */
25
+ export interface VueProcessingOptions extends ColorExtractionOptions {
26
+ /** 是否只处理特定的section类型 */
27
+ includeSections?: VueSectionType[]
28
+ /** 是否排除特定的section类型 */
29
+ excludeSections?: VueSectionType[]
30
+ }